aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
committerBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.dg
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20000108-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20000111-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20000623-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20000629-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20000707-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20000906-1.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20000926-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001009-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001012-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001012-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001023-1.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001108-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001116-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001117-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001201-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20001228-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20010202-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20010405-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20010516-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20010622-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20010822-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20010912-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20011008-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20011008-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20011015-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20011021-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20011130-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20011214-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020103-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020104-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020108-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020115-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020116-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020122-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020122-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020122-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020122-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020201-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020206-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020210-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020219-1.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020220-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020220-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020222-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020310-1.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020312-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020312-2.c162
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020319-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020411-1.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020415-1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020418-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020418-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020425-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020426-2.c176
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020430-1.c190
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020503-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020517-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020525-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020527-1.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020530-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020607-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020607-2.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20020919-1.c258
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20021006-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20021014-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20021018-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20021023-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20021029-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20021029-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20021116-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030107-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030120-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030204-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030213-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030225-1.c101
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030309-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030321-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030323-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030324-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030331-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030414-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030414-2.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030612-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030625-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030627-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030702-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030707-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030708-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030711-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030717-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030721-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030804-1.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030805-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030815-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030820-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030826-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030826-2.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030906-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20030906-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031002-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031012-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031111-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031201-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031201-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031202-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031216-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031218-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031218-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031218-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031222-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20031223-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040123-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040127-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040127-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040202-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040203-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040206-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040217-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040219-1.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040223-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040305-2.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040306-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040309-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040310-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040311-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040322-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040331-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040409-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040609-1.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040622-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040625-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040627-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040813-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040910-1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040916-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20040920-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20041014-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20041104-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20041106-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20041122-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20041213-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20041219-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050105-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050105-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050111-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050111-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050121-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050121-2.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050209-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050307-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050309-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050321-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050325-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050330-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050503-1.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050517-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050527-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050603-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050607-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050620-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050629-1.c297
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050702-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050811-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050811-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050826-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050922-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050922-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20051201-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20051207-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20051207-2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20051207-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20060410.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20060419-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20060425-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20060425-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20060801-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20061026.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20061109-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20061109-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20061124-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20061127-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20070112-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20070507-1.c103
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20070725-1.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20080615-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20080820.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20081223-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20090902-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20090922-1.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20100906-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20101010-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20101013-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20111216-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/54455.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/920413-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/940409-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/940510-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/951130-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/980502-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/980523-1.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/980526-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/980816-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/990213-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/990506-0.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Foundation.framework/empty1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/O16384.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/README23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Waddress.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wall.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Walways-true-1.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Walways-true-2.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-10.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-3.c108
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-5.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-6.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-9.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds.c93
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wbad-function-cast-1.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wc++-compat.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wchar-subscripts-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wchar-subscripts.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-4.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-5.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-integer.c98
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-pr34389.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-real-integer.c113
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-10.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-11.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-12.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-13.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-14.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-15.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-16.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-17.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-18.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-19.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-2.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-20.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-21.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-3.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-4.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-5.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-6.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-7.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-8.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-9.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wdouble-promotion.c104
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wenum-compare-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-10.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-11.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-12.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-5.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-6.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-8.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Werror-implicit-function-declaration.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wfatal-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wfatal.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wfloat-equal-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wframe-larger-than.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-default.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-pedantic.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99-pedantic.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wjump-misses-init-1.c156
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wjump-misses-init-2.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wlarger-than.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wlarger-than2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wlogical-op-1.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type-no.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wnested-externs-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wno-all.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wno-c++-compat.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wno-pointer-sign.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wobjsize-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wobjsize-1.h8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wold-style-definition-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wold-style-definition-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-no.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-no.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-3.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-10.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-11.c258
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-2.c121
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-3.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-4.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-5.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-6.c121
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-7.c121
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-8.c103
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-9.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-arith.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-Wall-no.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic-no.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wredundant-decls-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wredundant-decls-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-local-addr.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-type.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-type2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.h3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wsign-conversion.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c456
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-pta-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-struct-included.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-10.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-11.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-12.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-13.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-14.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-15.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-16.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-17.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-18.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-19.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-21.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-22.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-23.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-5.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-6.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-7.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-8.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-9.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-3.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-2.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-default.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-error.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-error.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wswitch.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wtraditional-conversion-2.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wtraditional-conversion.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wtrampolines.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits-no.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunknownprag.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunsuffixed-float-constants-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-function.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-label-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-local-typedefs.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-parm-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-3.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/Wwrite-strings-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-10.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-11.c111
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-12.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-13.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-5.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-6.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-7.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-8.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/alias-9.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/align-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/align-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/always_inline.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/always_inline2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/always_inline3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/and-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-10.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-11.c111
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-12.c108
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-13.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-14.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-3.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-5.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-6.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-7.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-8.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-9.c129
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-10.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-4.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-5.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-6.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-7.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-8.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-9.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-const-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-const-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-const-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-init-2.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-quals-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/array-quals-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asan/asan.exp40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asan/nosanitize-and-inline.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asan/pr56417.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-6.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-7.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-8.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-9.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-a.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-b.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-fs-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-names.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-pr24146.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-qual-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/asm-wide-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-1.c128
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-2.c125
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c88
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c87
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-1.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-2.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-3.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-4.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-5.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-flag.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-generic-aux.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-generic.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-invalid.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-1.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-2.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-3.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-4.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-5.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-lockfree-aux.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-lockfree.c121
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-noinline-aux.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-noinline.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-1.c555
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-2.c556
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-3.c555
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-4.c557
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-5.c556
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-optimize.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-param.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-pr51256.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-2.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-3.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-4.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-5.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-6.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/atomic.exp34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-1.c88
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c171
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c209
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c542
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-1.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-2.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-3.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-4.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-1.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-3.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-4.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-fence.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-generic.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-kill-dep.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-2.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-3.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-4.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-lockfree.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-1.c341
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-2.c341
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-3.c341
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-4.c341
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-1.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-2.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-3.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-4.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-vm.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-3.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-4.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-5.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-3.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_size-2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_size.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-alwaysinline.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-error-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-externally-visible-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-externally-visible-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-hotcold-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-3.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-4.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-5.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-invalid.c102
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-isr.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-may-alias-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-mode-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-mode-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-1.c165
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-nest.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-noinline.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-warn-unused-result.c188
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-hidden-1a.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c223
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1.c231
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1a.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1b.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-3.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-4.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/auto-type-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/auto-type-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/autopar.exp40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-6.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/parallelization-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr39500-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr39500-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46066.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46099.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46194.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46561.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46799.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46885.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46969.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr47060.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49580.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49960-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49960.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr57103.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr57185.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1short.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2short.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bconstp-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bconstp-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bconstp-3.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bconstp-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout-2.c236
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout-3.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout.c231
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bf-no-ms-layout.c231
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bf-spl1.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-1.c312
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand1a.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand2a.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand3a.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand4a.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand5.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand5a.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand6.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notand6a.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notor1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notor2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notxor1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-notxor2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-xor1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-xor2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-xor3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-xor4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/binop-xor5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-10.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-11.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-12.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-13.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-14.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-15.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-16.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-17.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-18.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-19.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-20.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-21.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-3.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-4.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-5.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-6.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-7.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-8.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/bitfld-9.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/boolcomplex-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply2.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply3.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply4.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-assume-aligned-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-assume-aligned-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-4.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-5.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-6.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-7.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-8.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-9.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-choose-expr-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-choose-expr.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-complex-err-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-complex-err-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-constant_p-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-ffs-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-inf-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-1.c440
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-10.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-11.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-12.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-13.c351
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-14.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-2.c397
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-3.c446
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-4.c407
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-5.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-6.c435
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-7.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-8.c200
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-9.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-prefetch-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-protos-1.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-redefine.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-return-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c115
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-stringop-chk-2.c137
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-strncat-chk-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-strstr.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-5.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-6.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-1.c212
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-10.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-11.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-12.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-13.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-14.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-15.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-16.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-17.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-18.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-19.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-2.c227
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-20.c749
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-21.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-22.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-23.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-24.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-26.c105
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-27.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-28.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-30.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-31.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-32.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-33.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-34.c172
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-35.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-36.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-37.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-38.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-39.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-40.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-41.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-43.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-44.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-45.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-46.c142
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-47.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-48.c181
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-49.c181
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-50.c159
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-51.c157
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-52.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-53.c122
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-54.c146
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-55.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-57.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-58.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-59.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-6.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-60.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-61.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-62.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-63.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-64.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-65.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-66.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-67.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-7.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-8.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-85.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-9.c103
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-config.h60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/builtins-error.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-align-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-align-2.c92
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-align-3.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-align-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-align-5.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-align-6.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-1.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-2.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-3.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-1.c267
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-2.c165
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-3.c174
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-complex-1.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-float-1.c169
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-generic-1.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-generic-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-1.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-2.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-pointer-float-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-5.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-6.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-stdatomic-1.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-thread-local-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-thread-local-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-typedef-1.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-uni-string-1.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-uni-string-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-version-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c11-version-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-align-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-anon-struct-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-3.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-5.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-6.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-7.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-8.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-quals-2.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-array-quals.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-arraydecl-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-atomic-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-complex-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-complit-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-10.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-11.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-2.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-3.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-5.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-6.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-7.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-8.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-9.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-digraph-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-dupqual-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-enum-comma-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-flex-array-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-flex-array-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-float-1.c169
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-fordecl-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-hexfloat-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-hexfloat-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-decl-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-int-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-int-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-init-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-intconst-1.c763
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-intprom-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-longlong-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-mixdecl-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-noreturn-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-restrict-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-return-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-scope-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-static-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-static-assert-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-thread-local-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-typedef-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-typespec-1.c522
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c90-vla-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c94-digraph-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c94-version-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-align-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-anon-struct-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-4.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-5.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-7.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-8.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-array-nonobj-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-1.c111
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-atomic-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-1.c248
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-complit-1.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-complit-2.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-condexpr-1.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-10.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-11.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-12.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-13.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-14.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-2.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-3.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-5.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-6.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-7.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-8.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-9.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-digraph-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-dupqual-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-enum-comma-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-3.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-5.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-6.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-7.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-float-1.c169
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-func-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-func-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-func-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-func-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-decl-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-int-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-int-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-init-1.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-init-2.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-init-3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-init-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-init-5.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-init-6.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-intconst-1.c639
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-intconst-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-intprom-1.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-longlong-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-longlong-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-main-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-math-double-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-math-float-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-math-long-double-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-math.h236
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-mixdecl-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-noreturn-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-predef-1.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-return-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-scope-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-scope-2.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-static-1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-static-assert-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-1.c270
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-3.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-5.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-6.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-7.c217
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-8.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-1.c151
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-3.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-1.c248
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-4.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-thread-local-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-typedef-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-typespec-1.c1164
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-version-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-2.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-1.c309
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-2.c309
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-3.c309
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-4.c309
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-5.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/call-diag-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/call-diag-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/case-const-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/case-const-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/case-const-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-3.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-function-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-lvalue-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-lvalue-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-pretty-print-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cdce1.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cdce2.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/char-compare.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/asm1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/asm2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/asm3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/asm4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/asm5.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/asm6.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/attribute1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/attribute2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/builtin1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/builtin2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/charset.exp44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/extern.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/function.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/charset/string.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/for1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/for2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-10.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-11.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-12.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-13.c332
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-3.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-4.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-5.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-6.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-7.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-8.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cleanup-9.c103
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/comp-return-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare10.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare2.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare3.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare4.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare5.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare6.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare7.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare8.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compare9.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/compat-common.h55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/compat.exp86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_main.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_x.c162
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_y.c111
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-check.h71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-defs.h43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-init.h54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-x.h136
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-y.h69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-check.h27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-defs.h15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-init.h27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random.c265
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random.h33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random_r.c385
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-check.h37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-defs.h19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-init.h35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_main.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_x.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_y.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c180
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_y.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_main.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c100
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_y.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c182
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c102
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_x.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_y.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_main.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_x.c170
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_y.c89
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-x.h77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h277
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_y.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_y.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c121
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_main.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_x.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_y.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_main.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_x.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_y.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-section.h7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-check.h29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-defs.h17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-init.h17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1.h180
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c110
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c92
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2.h75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_x.c87
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_y.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c184
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_y.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_y.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_y.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_y.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_y.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_y.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_main.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_main.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_main.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_main.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_x.c178
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c104
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_main.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_x.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_y.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_main.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_x.c166
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_y.c98
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_x.c168
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_y.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c233
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_y.c157
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_main.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c190
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_y.c113
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c257
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_y.c162
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_x.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_y.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_x.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_x.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_y.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_x.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_y.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_x.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_y.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_x.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_y.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c221
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_y.c144
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c224
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_y.c144
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1.h17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_main.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_y.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2.h15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_main.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_y.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp130
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1.h787
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c2087
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x1.h68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x2.h14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y1.h76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y2.h69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_y.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_main.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_x.c122
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_y.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_x.c110
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_y.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_x.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_x.c229
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_y.c126
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_x.c134
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_y.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c180
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_y.c92
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-check.h34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-defs.h15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-init.h34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1.h17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_main.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_x.c124
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_y.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_x.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_y.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_main.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_x.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_y.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_main.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_x.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_y.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_main.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_x.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_y.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_main.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_x.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_y.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_main.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_x.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_y.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-check.h64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-defs.h90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-setup.h28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/complete-port.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/complex-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/complex-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/complex-2.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/complex-3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/complex-4.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/complex-5.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compound-literal-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/compound-lvalue-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/concat.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/concat2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cond-constqual-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cond-lvalue-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/const-1.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/const-elim-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/const-elim-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/const-float128-ped.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/const-float128.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/const-float80-ped.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/const-float80.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/const-uniq-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/constructor-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/conv-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/conv-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/conv-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/#cmdlne-M-2.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19930510-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1.h10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1a.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1b.h2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19951025-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19951227-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19960224-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990119-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990228-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990407-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990409-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990413-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000127-1.c139
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000129-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000207-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000207-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000209-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000209-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000301-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000419-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000519-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000529-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000625-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000627-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1.h8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1a.h15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000725-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20020927-1.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/20050215-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wsignprom.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunused.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunused.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma5.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma6.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma7.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/arith-1.c257
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/arith-3.c447
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/assembl2.S19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/assembler.S26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert1.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert4.c384
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/avoidpaste2.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/backslash.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/backslash2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c89-pedantic.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c89.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-empty-macro-args.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-if-comma-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-pedantic.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c94-pedantic.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c94.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-if-comma-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-pedantic.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-3.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-4.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2#.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-P.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-dM.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-C.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-C.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.h2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-dD.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dN-M.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-10.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-11.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-12.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-13.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-14.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-15.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-16.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-17.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-18.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-19.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-20.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-21.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-22.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-23.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-3.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-4.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-5.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-6.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-7.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-8.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-9.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cpp.exp48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom2.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/defined.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraph1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraph2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraphs.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-1.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-1.h3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3a.h8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3b.h9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-4.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-5.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-6.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/direct2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/direct2s.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/directiv.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/empty-include.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif-pedantic1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/error-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/expr-overflow-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/expr.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/extratokens.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/extratokens2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/fpreprocessed.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/A.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/B.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/C.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Headers/one-includeSubs.h2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc89-pedantic.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc89.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc99-pedantic.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc99.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/hash1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ident-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ident.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-5.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-cexp.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-div.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-mop.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-mpar.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-oppr.c92
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-oppr2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-paren.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-sc.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-shift.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-unary.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/import1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/import1.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/import2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/import2.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/foo.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20348-aux.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20348.h9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20356-aux.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20356.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pragma-once-1a.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/include1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/include2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/include2a.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/include3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/include4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/include5.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/include6.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/include7.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/isysroot-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/isysroot-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexident.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexnum.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexstrng.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/line1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/line2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/line3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/line4.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/line5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/line6.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/line7.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/line8.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-dir-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-dir-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom5.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom6.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-5.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro1.c128
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro10.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro11.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro3.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro5.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro6.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro7.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro8.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro9.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macspace1.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macspace2.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/macsyntx.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1c.h12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1cc.h10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1nd.h8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1ndp.h7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1x.h9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2a.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2b.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2c.h15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.def10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.h7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi5.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6a.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6b.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6c.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6d.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6e.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7a.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7b.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8a.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8b.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8c.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8d.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-MD.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-MMD.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-sysheader-MD.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-sysheader-MMD.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/multiline-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/multiline.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-4.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste10.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste11.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste12-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste12.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste13.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste14-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste14.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste15.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste16.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste17.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste18.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste2.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste5.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste6.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste8-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste8.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste9.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/poison.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20348.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20348.h9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20356.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20356.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr22168-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr22168.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr27777.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28165.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28227.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28709.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr29612-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr29612-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr30786.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr30805.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr32868.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr32974.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr33415.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr33466.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34602.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34692.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34859.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr35313.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr35322.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr36320.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr36674.i12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr43195.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr43195.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-2.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-3.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-3.h3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-3.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-diagnostic-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-diagnostic-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-float-const-decimal64-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1b.h8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1c.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1d.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-pop_macro-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef2.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef4.c499
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/separate-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/skipping.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/skipping2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/spacing1.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/spacing2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify2.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify3.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify4.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify5.c1260
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/strp1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/strp2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/subframework1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr.h10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr1.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr2.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr3.h7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/sysmac1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/sysmac2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn3.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn5.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn6.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/Wunused.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/__STDC__.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/argcount.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assembler.S29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert1.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/builtins.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/builtins.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-C.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-C2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-dD.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-dM.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/define.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/defined.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/directive.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/escaped-eof.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/escaped-nl.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/hash.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/include.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/literals-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom6.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/macro.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/macroargs.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1c.h12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1nd.h8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1ndp.h7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1x.h9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2a.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2b.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2c.h15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.def10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.h7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi5.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6a.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6b.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6c.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6d.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6e.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7a.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7b.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/null-drctv.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/num-sign.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/paste.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/quote.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/redef1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/redef2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/strify.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/trad.exp43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/uchar.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/xwin1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trigraphs.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/uchar-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/uchar-3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-6.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-7.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-8.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-9.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucs.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc4.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/undef-opt-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/undef2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/utf8-5byte-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg2.c131
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/very-long-comment.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-cxx-compat-2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-cxx-compat.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-deprecated-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-deprecated.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-long-long-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-long-long.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-multichar-2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-multichar.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-redefined.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-traditional-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-traditional.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-3.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-4.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-undef-2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-undef.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-variadic-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-variadic.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/wchar-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/widestr1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ctor1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-20040809-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-20040812-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-format-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-comm.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040809-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040809-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-5.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-sections.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-segaddr.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-version-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakref-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20000503-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20010207-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20011223-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20020104-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20020220-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20020224-1.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20020327-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20030605-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20031231-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20041023-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20041219-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/20050907-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/const-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/const-2.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/const-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/crash1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-3.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-5.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-6.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/debug.exp31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-3.h9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/c99-typedef1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/const-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die5.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die6.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die7.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-file1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-merge.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-uninit.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c84
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.h19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.h19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c84
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.h19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.h19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.h19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd.h36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/ipa-cp1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/omp-fesdr.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr31230.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-3.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr37616.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr37726.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr43237.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr49871.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/short-circuit.c108
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/static1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/struct-loc1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/var2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/enum-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr16676.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr26881.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29558.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29609-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29609-2.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr32610.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr33316.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr35154.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-3.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr37616.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr39412.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41264-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41343-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41717.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41893-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41893-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr42244.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr42767.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr43972.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr45849.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr46409.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr46782.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr47498.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr47501.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49032.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49294.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49522.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr55730.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/pr57351.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-1.c352
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-4.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-5.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/tls-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/trivial.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-10.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-5.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-6.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-7.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-8.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-9.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-global-ext.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-10.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-11.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-12.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-13.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-14.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-15.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-16.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-17.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-18.c100
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-3-Wextra.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-3-no.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-3.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-4.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-5.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-6.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-7.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-8.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/declspec-9.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/delay-slot-1.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/delay-slot-2.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/deprecated-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/deprecated-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/deprecated-4.c88
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/deprecated-5.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/deprecated-6.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/deprecated.c117
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/Wbad-function-cast-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/altivec-types.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/builtin-complex.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/cast-bad.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/composite-type.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-c99.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-hex.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-pedantic.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-complex.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c494
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c124
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/ctypes.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/ddmode-ice.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/dec-eval-method-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/dec-eval-method.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-dbg.h12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-except.h13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-round.h22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp.exp65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-binop.c105
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-check.h68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-3.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/float-constant-double.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-c89.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-c99.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-ignored-c99.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-reserved.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/operator-bitwise.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr31344.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr37435.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr41049.c562
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr48204.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr48928.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr52140.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-5.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-6.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c174
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/struct-union.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/typespec.c302
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/union-init.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dfp/wtr-conversion-1.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dg.exp40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/di-longlong64-sync-1.c166
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/di-sync-multithread.c213
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/div-compare-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/div-double-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/divbyzero.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-10.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-10a.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-11.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-11a.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-12.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-12a.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-5.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-6.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-6a.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-7.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-7a.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-8.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-9.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dll-9a.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/do-empty.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dollar.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/doloop-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dse.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/duff-1.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/duff-2.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/duff-3.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/duff-4.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dump-ada-spec-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/dump-pass.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/empty-source-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/empty-source-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/empty-source-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/empty1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/empty2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/enum-compat-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/enum-const-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/enum-const-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/enum-const-3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/enum-incomplete-1.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/enum1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/enum2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/enum3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/errno-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ext-elim-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fail_always_inline.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fail_always_inline2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/falign-labels-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fastmath-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fdata-sections-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/Wbad-function-cast-1.c357
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/addsub.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allconv.c150
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allop-const.c147
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allop.c87
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/binary.c158
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/bit-complement.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/call-by-value.c97
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/cast-bad.c279
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/composite-type.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/const-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/constant.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/constants-pedantic.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-4.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-accum-neg.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-4.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-sat.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert.h359
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/define.c158
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/fixed-point.exp40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-array.c102
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-mixed.c103
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-scalar.c108
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-struct.c191
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg-mixed.c145
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg-size0.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg.c115
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/int-warning.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-c89.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-c99.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-ignored-c99.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-pedantic.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/loop-index.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/modes.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/muldiv-warning.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/noassoc.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-bitwise.c167
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-comma.c98
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-cond.c101
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-logical.c115
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-unary.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/pr33466.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/struct-layout-1.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/struct-union.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/types.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/typespec.c303
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/unary.c256
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/union-init.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/view-convert-2.c139
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/view-convert.c122
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fixuns-trunc-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/float-exact-1.c3178
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/float-range-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/float-range-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/float-range-3.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/float-range-4.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/float-range-5.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fltconst-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fltconst-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fltconst-double-pedantic-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fltconst-double-pedantic-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fnegate-1.c113
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-4.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-addr-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-alloca-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-andxor-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-2.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-1.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-3.c159
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-4.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-5.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-6.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-7.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-complex-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-cond-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-convnotconv-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-convround-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-cstvecshift.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-div-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-div-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-div-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqand-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandnot-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-3.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqcmplx-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-4.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-even-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-minus-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-mod-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-mulconj-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-nonneg-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-notunord.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-overflow-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-perm.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-plusmult-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-plusmult.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-plusnot-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-reassoc-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-reassoc-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-rotate-1.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-sub.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-xor-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-xor-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-xorand-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fold-xornot-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/foo.specs2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/for-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fork-instrumentation.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/array-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-1.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/attr-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/attr-2.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/attr-3.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/attr-4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/attr-5.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/attr-6.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/attr-7.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/bitfld-1.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/branch-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/builtin-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-1.c237
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-3.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-1.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-3.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-4.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-5.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-strftime-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c90-strftime-2.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c94-printf-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c94-scanf-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-1.c197
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-3.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-1.c145
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-3.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-4.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-strftime-1.c97
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/c99-strftime-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/cast-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/cmn-err-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/dfp-printf-1.c123
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/dfp-scanf-1.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/diag-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/diag-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/errmk-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ext-1.c126
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ext-2.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ext-3.c216
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ext-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ext-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ext-6.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ext-7.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ext-8.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/few-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/format.exp34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/format.h192
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-1.c218
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-5.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-6.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-7.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-8.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-9.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_gfc-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_gfc-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/miss-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/miss-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/miss-3.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/miss-4.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/miss-5.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/miss-6.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms-warnI64-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_array-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-2.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-3.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-7.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_bitfld-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_branch-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-1.c184
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-3.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-1.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-4.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-5.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-strftime-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-strftime-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c94-printf-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c94-scanf-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-1.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-3.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-1.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-4.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-strftime-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-strftime-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_cast-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-3.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-4.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-5.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-6.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-1.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-3.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-exargs-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-exargs-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-y2k-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nul-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nul-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_null-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_plus-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_sec-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_va-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/ms_zero-length-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-1.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/no-exargs-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/no-exargs-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/no-y2k-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/nul-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/nul-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/null-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/opt-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/opt-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/opt-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/opt-4.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/opt-5.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/opt-6.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/plus-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/sec-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/sentinel-1.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/strfmon-1.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/strfmon-2.c13
-rwxr-xr-xgcc-4.9/gcc/testsuite/gcc.dg/format/sys_format.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/unnamed-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/va-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/warnll-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-1.c125
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/z-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/format/zero-length-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/framework-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/framework-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/free-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/free-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fshort-wchar.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fstack-protector-strong.c134
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-2.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/func-args-1.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/func-args-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/func-outside-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/func-outside-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/func-ptr-conv-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/funcdef-attr-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/funcdef-storage-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/funcdef-var-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/funcdef-var-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/funcorder.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/funroll-loops-all.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fwrapv-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/fwrapv-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gcc-have-sync-compare-and-swap.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu11-version-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu89-const-expr-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu89-dupqual-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-1.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-4.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-3.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu99-init-1.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu99-init-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gnu99-static-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.1.1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.10.1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.12.1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.13.1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.14.1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.17.1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.17.2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.20.1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.20.2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.3.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.27.1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.30.1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.31.1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.31.2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.34.1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.34.2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.37.1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.37.2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.9.1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/asm-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/atomic-5.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/atomic-6.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/barrier-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/barrier-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-10.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-11.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-3.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-6.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-7.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-8.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-9.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/clause-1.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/clause-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/collapse-1.c92
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/combined-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/complex-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/copyin-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-4.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c100
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/declare-simd-2.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/empty.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/flush-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/flush-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-10.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-11.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-12.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-13.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-14.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-15.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-16.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-17.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-18.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-19.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-3.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-6.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-7.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-8.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-9.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/gomp.exp37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-3.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/nestedfn-1.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/nesting-1.c239
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/num-threads-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/omp-parallel-if.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/openmp-simd-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/openmp-simd-2.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/ordered-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/ordered-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25874.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25989.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25990.c261
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25996.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr26412.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27328.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27358.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-3.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27415.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27416.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27499.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27573.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29955.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-2.c98
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-3.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-4.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-5.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-6.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr30421.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr30494.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr32468-1.c100
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34607.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34610.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34692.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34694.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34964.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35244.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35438.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35439.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35738.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35751.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35818.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr36790.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr38633.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr38676.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr39495-1.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr39495-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr44085.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr47963.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr48591.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr48716.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr49640.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr51339.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr53992.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr57412.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr58809.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr59669-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr59669-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr60534.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/preprocess-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-1.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-5.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-6.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/static.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/target-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/target-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/taskgroup-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/teams-1.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/tls-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/tls-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-1.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-2.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-3.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-4.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/uninit-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-5.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-0.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-3.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-4.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-5.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-6.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-7.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-8.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-pr47654.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/graphite.exp81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-10.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-11.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-12.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-13.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-14.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-15.c120
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-16.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-17.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-18.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-19.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-20.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-22.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-23.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-24.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-25.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-26.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-27.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-4.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-6.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-8.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-9.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43351.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43464-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43464.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr44676.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45230-1.c140
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45230.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45231.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr46834.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr46845.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr47046.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr48648.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr48805.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-0.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-1.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-10.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-11.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-12.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-13.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-14.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-15.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-16.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-2.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-3.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-4.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-5.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-6.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-7.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-8.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-9.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr18792.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr19910.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr20041110-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr20256.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr23625.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr23820.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr24309.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr26435.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29330.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-3.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-4.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr30565.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr31183.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr33576.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr33766.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34016.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34017.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34123.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-2.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-3.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr36287.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37485.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37684.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37686.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37828.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37883.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37928.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37943.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38073.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38084.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38125.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38409.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38413.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38446.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38498.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38500.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38510.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38559.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38786.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39260.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39335.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39335_1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr40157.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr40281.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr41888.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42205-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42205-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42211.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42221.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42284.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42326.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42521.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42530.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42729.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42771.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42914.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42917.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43012.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43083.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43306.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43567.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43657.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr44391.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr45297.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46168.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46185.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46215.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46404-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46404.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46761.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46924.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46966.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46970.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr50561.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr54094.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-4.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-5.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-6.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47593.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47653.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47654.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-0.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-10.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-11.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-12.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-13.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-14.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-15.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-16.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-17.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-18.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-19.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-20.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-21.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-22.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-5.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-6.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-7.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-8.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-9.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-dsyr2k.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-dsyrk.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-matmult.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-mvt.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-sor.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/graphite/vect-pr43423.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/asm-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/bswaptest.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/clztest.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/csttest.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/ctztest.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/drap.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/example.c138
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.h377
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/inline-params.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/nrv-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/param-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/param-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/param-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/param-4.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-1.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-2.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-4.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36977.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41353-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41353-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41404-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41447-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41616-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr42782.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43051-1.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43077-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43177.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43329-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43479.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43593.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-2.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-3.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45882.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr48437.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr48466.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr49888.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54200.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-2.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-3.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-4.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-5.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-6.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54551.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54693-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54693.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54796.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54970.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-3.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-4.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-aux.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-4.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-5.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/pr59776.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/rotatetest.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/sra-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/vla-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/guality/vla-2.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/h8300-bit-insn-ice.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/h8300-bit-insn-ice2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/h8300-bss-align-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/h8300-ice2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/h8300-stack-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/hex-round-1.c114
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/hex-round-2.c115
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-1.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-2.c131
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-3.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-4.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-3.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-4.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-5.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-6.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-7.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-8.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-9.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/if-empty-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ifcvt-fabs-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ifelse-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ifelse-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iftrap-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/iftrap-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/imag-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-bad-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-bad-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-bad-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-bad-4.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-bad-5.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-bad-6.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-bad-7.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-empty-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-empty-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-empty-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-excess-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-string-1.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-string-2.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/init-undef-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/initpri1.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/initpri2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/initpri3.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-10.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-11.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-12.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-13.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-14.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-15.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-16.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-17.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-18.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-19.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-20.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-21.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-22.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-23.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-24.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-25.c145
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-26.c145
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-27.c145
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-28.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-29.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-3.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-30.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-31.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-32.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-32a.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-33.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-34.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-35.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-5.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-6.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-7.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-8.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline-9.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline4.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline5.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline6.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline7.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline_1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline_2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline_3.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/inline_4.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/instrument-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/instrument-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/instrument-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/intermod-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/intmax_t-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/invalid-call-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-4.c221
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-5.c124
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-6.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-7.c157
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-5.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-6.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-3.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-4.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-5.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-6.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-7.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-8.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-11.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-12.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-15.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-17.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-5.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-6.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-7.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-8.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-9.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-3.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-4.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-5.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-7.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-8.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-9.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa.exp35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipacost-1.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipacost-2.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-2.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-3.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-4.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-2.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-3.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-4.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-5.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-6.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-7.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-9.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-ii-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/noclone-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr42706.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr45644.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr48195.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr50744.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr51362.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr55260.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr56988.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57294.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57347.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57358.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57539.c218
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr58106.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr58492.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr59008.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr59610.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pure-const-1.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/pure-const-2.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-0.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-1a.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-1b.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-2a.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-2b.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ivdep.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/kpice1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/label-compound-stmt-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/label-decl-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/label-decl-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/label-decl-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/label-decl-4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-4.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-5.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-6.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/large-size-array.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lazy-ptr-test.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/local1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/long-long-compare-1.c124
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/long-long-cst1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/long-long-typespec-1.c828
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/loop-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/loop-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/loop-3.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/loop-4.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/loop-5.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/loop-6.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/loop-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/loop-unswitch-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lower-subreg-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20080908_0.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20080917_0.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20080924_0.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081024_0.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081109_0.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081111_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081111_1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081112_0.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081112_1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_0.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_0.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-1_0.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-1_1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-2_0.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-2_1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081125_0.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081125_1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081126_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_0.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-2_0.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-2_1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-1_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-1_1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-2_0.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-2_1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-1_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-1_1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-2_0.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081210-1_0.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081212-1_0.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_0.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_0.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_0.h3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090116_0.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090120_0.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090126-1_0.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090126-2_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090206-1_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090206-2_0.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090210_0.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090210_1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090213_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090213_1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-1_0.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-1_1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-2_0.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-2_1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_0.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_3.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090219_0.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090312_0.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090312_1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090313_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090706-1_0.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090706-2_0.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090717_0.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090717_1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090729_0.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090729_1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090812_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090812_1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090914-1_0.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20090914-2_0.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-1_0.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-1_1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-2_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-1_0.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-1_1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_0.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_1.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_0.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_1.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_2.c221
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091014-1_0.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_0.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_a.h2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_b.h2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_0.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_a.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091017-1_0.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091017-1_1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-1_0.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-1_1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-2_0.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-2_1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-3_0.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091027-1_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091027-1_1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091209-1_0.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20091216-1_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100103-1_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100103-2_0.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100104_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100108_0.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100227-1_0.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100227-1_1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-1_0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-1_1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-2_0.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-2_1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100426_0.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100430-1_0.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100518_0.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-1_0.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-2_0.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-3_0.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100709-1_0.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100709-1_1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-1_0.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-1_1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-2_0.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-2_1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-3_0.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-3_1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-4_0.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100722-1_0.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100724-1_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100724-1_1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20100825-1_0.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-1_0.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_0.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20101125-1_0.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20101125-1_1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20110201-1_0.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_0.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_3.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-2_0.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20111213-1_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_0.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/README35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_0.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/const-uniq_0.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/const-uniq_1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/ipacp_0.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/ipacp_1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference2_0.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference2_1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference_0.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference_1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/lto.exp59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/materialize-1_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/materialize-1_1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/noreturn-1_0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/noreturn-1_1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr27898_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr27898_1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28706_0.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28706_1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_0.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr34989-1_0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr34989-1_1.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45721_0.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45721_1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45736_0.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr46940_0.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr46940_1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47188_0.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47188_1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47259_0.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47259_1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47924_0.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr48622_0.c93
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr51572-1_0.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52097_0.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52634_0.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52634_1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr53214_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr53470_0.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54702_0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54702_1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54709_0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54709_1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55113_0.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55525_0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55525_1.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55660_0.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55660_1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55703_0.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56168_0.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56168_1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56297_0.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56297_1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr59323-2_0.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr59323_0.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_0.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60461_0.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/resolutions_0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/save-temps_0.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem.h22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lvalue-2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lvalue-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lvalue-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lvalue-5.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lvalue-6.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lvalue-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/lvalue1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/m-un-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/m-un-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/macro-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/macro-fusion-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/macro-fusion-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/mallign.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/march-generic.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/march.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/max-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/memcpy-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/memcpy-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/memcpy-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/memcpy-4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/memmove-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/memmove-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/memmove-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/memset-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/merge-all-constants-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/minmax-1.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-3.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/misc-column.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/mismatch-decl-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/missing-field-init-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/missing-field-init-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/mmix-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/mtune.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/multiword-1.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nest.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-calls-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-func-1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-func-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-func-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-func-4.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-func-5.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-func-6.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-func-7.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-func-8.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nested-redef-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-asm-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-asm-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-asm-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-asm-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-5.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-6.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nodfp-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nofixed-point-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nofixed-point-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/non-local-goto-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/non-local-goto-2.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20000901-1.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20001228-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20010425-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20010524-1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20011025-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020130-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020207-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020213-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020220-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20030818-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040629-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20041207.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20050120-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920507-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920616-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920721-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920824-1.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920923-1.c127
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/921102-1.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/921116-1.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930301-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930622-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930622-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930714-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/931203-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/940112-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/940227-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/950825-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/950921-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/951123-1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/971104-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/990416-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/const-ll-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-4.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-5.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-2.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-3.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-4.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-5.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/label-1.c175
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/noncompile.exp25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/old-style-parm-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr23576.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35444-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35444-2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr44517.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr52290.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/redecl-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/scope.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/undeclared-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/undeclared-2.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noncompile/voidparam-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nonnull-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nonnull-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nonnull-3.c82
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nop.h7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noreturn-1.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noreturn-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noreturn-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noreturn-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noreturn-5.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noreturn-6.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noreturn-7.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/noreturn-8.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nrv1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nrv2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nrv3.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nrv4.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/nrv5.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/null-pointer-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/old-style-asm-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/old-style-param-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/old-style-then-proto-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapdi-1.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapdi-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapsi-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/opts-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/opts-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/opts-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/opts-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/opts-5.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/opts-6.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-4.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/out-of-bounds-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-1.c124
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-2.c135
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-3.c131
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-4.c131
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-5.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-6.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-7.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-8.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pack-test-1.c154
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pack-test-1.h12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pack-test-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pack-test-3.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pack-test-4.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pack-test-5.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/packed-array.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/packed-vla.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-incomplete-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parm-mismatch-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-decl-after-if.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-decl-after-label.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-error-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-error-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parse-error-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parser-pr28152-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/parser-pr28152.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/common-1.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/common-1.hs3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-1.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-2.hs4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-3.hs4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-1.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-2.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3.hs4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3a.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3b.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-1.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-2.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-2.hs3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-3.hs3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-4.hs7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-5.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-5.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/empty.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/empty.hs0
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/except-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/except-1.hs6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/global-1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/global-1.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/ident-1.c2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/ident-1.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1a.h5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1b.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1c.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/import-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/import-2.hs4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/include/import-2a.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/include/import-2b.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-1.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-2.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-3.hs7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-4.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-4.hs4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-1.hs2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-2.hs2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-3.hs2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-4.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/pch.exp65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/pushpop-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/pushpop-1.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/save-temps-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/save-temps-1.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/static-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/static-1.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/static-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/static-2.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/static-3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/static-3.hs7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/struct-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/struct-1.hs3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/system-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/system-1.hs2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1.hs4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1b.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1b.hs4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-2.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-4.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-4.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-5.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-5.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-6.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-6.hs1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/warn-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pch/warn-1.hs5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pic-macro-define.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pie-link.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/finish_unit-test-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/ggcplug-test-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/ggcplug.c126
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/one_time-test-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugin.exp82
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir3.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir4.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/self-assign-test-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/self-assign-test-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c402
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/start_unit-test-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-10.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-3.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-4.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-6.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-7.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-8.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-9.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/postincr-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr10392-1.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr10474.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr11459-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr11492.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr11864-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr12603.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr12625-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr13519-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr13804-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr14092-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr14475.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr14649-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr14765-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr14796-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr14796-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr14963.c1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15236.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15347.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15360-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15443-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15443-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15649-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15698-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15698-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15698-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15698-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15698-5.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15698-6.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15698-7.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15698-8.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15749-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15749-1.h28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15784-1.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15784-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15784-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15784-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15785-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr15825-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr16194.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr16302.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr16973.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17024-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17036-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17055-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17112-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17188-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17301-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17301-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17319.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17322.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17424-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17581-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17635.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17730-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17844-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr17957.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18164.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18241-1.c111
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18241-2.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18241-3.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18241-4.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18241-5.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18479.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18501.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18502-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18520-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18596-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18596-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18596-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18628.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18725.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18809-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18921-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18928-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr18963-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19105.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19340.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19345.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19402-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19402-2.c82
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19633-1.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19633.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19967.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19984.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr19988.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20017.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20054.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20100.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20115-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20115.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20126.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20130-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20216.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20245-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20368-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20368-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20368-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20672-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20922-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20922-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20922-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20922-4.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20922-5.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr20922-6.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21032.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21041.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21085.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21282.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21419.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21643.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21709-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21858.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr21921.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr22231.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr22308-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr22311-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr22329.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr22335-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr22335-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr22356-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr22458-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23049.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23075.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23165.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23200.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23295.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23408.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23470-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23518.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23547.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23584.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23623.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23818.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr23911.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24101-1.i4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24101-2.i4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24225.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24367.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24445.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24561.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24600.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24615.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24620.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24683.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr24820.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr25023.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr25376.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr25559.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr25682.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr25795-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr25795.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr25805.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26004.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26427.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26632.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26717.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26719.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26729-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26865.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26961-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr26983.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27003.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27095.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27132.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27150-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27301.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27314.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27331.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27335.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27363.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27382-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27382-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27428-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27528.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27531-1.c114
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27639.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27671-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27758.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27802-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27861-1.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27953.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27959-2.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr27959.c93
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28121.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28162.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28187.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28243.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28322-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28322-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28322.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28402.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28419.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28574.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28685-1.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28726.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28755.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28796-1.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28796-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28888.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28911.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr28935.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29091.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29215.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29254.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29299.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29521-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29521.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29637.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29683.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29736.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29801.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29921-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr29921.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30045.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30137-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30137-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30172-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30189.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30260.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30286.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30360.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30457.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30473.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30551-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30551-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30551-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30551-5.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30551-6.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30551.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30643.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr3074-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30744-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30762-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30762-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30904.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30949.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30951.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr30957-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31127.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31490-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31490-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31490-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31490.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31507-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31507-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31529-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31529-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31847.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31866.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr31959.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32041.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32061.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32069.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32135.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32176.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32207.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32293.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32328.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32338-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32338-2.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32370.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32374.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32450.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32559.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32573.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32721.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32912-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32912-2.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32912-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr32975.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33007.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33017.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33092.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33136-1.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33136-2.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33136-3.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33238.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33434-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33434-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33434-3.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33434-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33619.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33644.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33645-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33645-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33648.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33653.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33666.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33667.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33670.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33673.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33676.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33691.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33692.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33693.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33694.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33695.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33696.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33697.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33724.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33726.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33742.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33826.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33919-0.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33919-1.h2
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33919-2.h1
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33919.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33923.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr33961.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34003-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34003-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34027-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34027-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34088.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34171.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34225.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34233.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34263.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34351.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34457-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34457-2.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34668-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34668-2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34825.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34856.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34965.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34969.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr34985.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35045.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35065.c228
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35258.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35264.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35334.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35430.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35440.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35442.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35443.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35445.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35468.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35616.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35635.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35701.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35729.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35736.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35742.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35746.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr35899.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36015.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36017.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36111.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36194.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36224.c249
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36227.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36300-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36300-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36489.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36504.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36508.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36584.c267
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36774-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36774-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36901-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36901-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36901-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36901-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36901-system.h3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36901.h6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36902.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36991.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36997.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr36998.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37106-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37106-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37156.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37171.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37186.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37217.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37261.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37289.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37303.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37353.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37360.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37438.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37529.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37544.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37561.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37645.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37663.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37772.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37858.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37879.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37908.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr37985.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38140.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38200.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38245-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38245-2.c110
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38245-3.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38245-3.h35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38245-4.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38338.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38364.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38615.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38616.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38645.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38700.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38902.c131
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38932.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38934.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38957.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr38984.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39084.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39226.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39323-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39323-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39323-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39343.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39443.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39453.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39455.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39464.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39565.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39666-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39666-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39712.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39794.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39867.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr39874.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40031.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40172-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40172-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40172-3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40209.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40340-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40340-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40340-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40340-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40340-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40340.h31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40501.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40550.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40669.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40792.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40861.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40946.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40971.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr40989.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41033.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41123.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41232.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41241.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41248.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41295.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41340.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41345.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41454.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41470.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41488.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41551.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41573.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41574.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41619.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41643.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41762.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41783.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41837.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41841.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41842.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41935.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr41963.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42078.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42084.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42215.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42245-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42245.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42246.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42249.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42250.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42388.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42389.c87
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42396.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42427.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42461.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42475.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42611.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42629.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42630.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42631.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42662.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42685.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42715.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42719.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42728.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42889.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42916.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42918.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr42963.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43058.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43082.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43084.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43139.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43157.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43211.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43213.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43280.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43299.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43300.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43305.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43317.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43379.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43402.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43419.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43513.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43557-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43557-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43562.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43564.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43643.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43670.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43730.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43864-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43864-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43864-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43864.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr43971.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44012.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44023.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44024.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44028.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44061.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44136.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44194-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44194-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44214-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44214-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44214-3.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44290-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44290-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44337.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44393.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44404.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44485.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44509.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44539.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44545.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44606.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44674.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44699.c157
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44838.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44964.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44971.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr44974.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45055.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45071.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45079.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45083.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45101.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45105.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45107.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45259.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45352-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45352-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45352-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45352.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45353.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45415.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45416.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45449.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45461.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45472.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45506.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45567.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45570.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45652.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45733.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45750.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45819.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45865.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr45991.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46088.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46130-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46130-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46165.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46171.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46177-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46177.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46184.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46212.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46217.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46233.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46251.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46252.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46255.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46288.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46307.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46309-2.c147
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46309.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46315.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46355.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46375.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46387.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46440.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46494.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46499-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46499-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46521.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46522.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46571.c122
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46585.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46614.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46620.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46647.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46674.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46675.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46685.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46728-12.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46728-6.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46728-9.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46771.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46777.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46867.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46875.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46878-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46893.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr46909.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47028.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47086.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47201.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47276.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47369-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47372-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47372-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47381-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47381-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47383.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47391.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47443.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47446-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47446-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47555.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47610.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47684.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47727.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47763.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47766.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47881.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47893.c188
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47899.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47917.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr47991.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48022-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48022-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48067.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48134.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48141.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48144.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48156.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48159-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48159-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48186.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48189.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48203.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48213.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48235.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48335-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48335-2.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48335-3.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48335-4.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48335-5.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48335-6.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48335-7.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48335-8.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48374.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48442.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48524.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48524.spec5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48552-1.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48552-2.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48616.c135
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48685.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48739-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48739-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48768.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48770.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48774.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48784-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48784-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48826.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48837.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr48975.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49000.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49069.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49120.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49235.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49243.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49307.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49496.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49544.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49602.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49619.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49696.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49705.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49799.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49860.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49948.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49994-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49994-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr49994-3.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50017.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50078.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50132.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50133.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50161.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50193-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50205.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50251.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50290.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50310-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50310-2.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50340.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50527.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50571.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50604.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50613.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50717-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50763-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50763-5.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50763.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50764.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50765.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50827.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50908-2.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50908-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr50908.c175
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51012-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51012-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51034.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51039.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51261.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51321.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51408.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51481.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51491-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51491.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51505.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51519.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51557.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51644.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51683.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51695.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51721.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51762.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51796.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51821.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51865.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51867.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-12.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-16.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-17.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-3.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-6.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879-7.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51879.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51957-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51957-1.h9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51957-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51990-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr51990.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52045.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52046.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52086.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52132.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52134.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52139.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52210.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52267.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52283.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52318.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52355.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52445.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52448.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52549.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52578.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52592.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52691.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52734.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52803.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52808.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52862.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr52880.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53060.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53153.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53174.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53196-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53196-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c157
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53352.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53358.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53532.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53550.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53701.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53749.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53849.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53881-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53881-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53887.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr53942.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54087.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54113.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54121.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54355.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54363.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54472.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54669.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54676.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54782.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54838.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54919.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54921.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr54981.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55010.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55019.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55027.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55094.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55110.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55122.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55150-1.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55150-2.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55153.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55191.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55236.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55430.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55570.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55702.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55831.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55833.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55838.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr55940.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56023.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56035.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56078.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56094.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56098-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56098-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56117.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56125.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56144.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56167.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56228.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56275.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56341-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56341-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56350.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56355-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56396.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56424.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56436.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56466.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56494.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56510.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56548.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56809.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56824.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56837.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56847.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56890-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56890-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56977.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56990.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56992.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56997-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56997-2.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56997-3.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr56997-4.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57104.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57105.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57134.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57149.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57154.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57184.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57286.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57287-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57287.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57300.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57518.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57662.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57773.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr57980.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58010.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58145-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58145-2.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58346.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58432.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58463.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58668.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58742-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58742-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58742-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58805.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr58981.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59011.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59020.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59261.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59350-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59350.c82
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59351.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59471.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59523.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59605-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59605.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59630.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59643.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59670.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59722.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59827.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59846.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59860.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59871.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59920-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59920-2.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59920-3.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59924.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59940.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59963-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59963-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59963-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr59992.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr60013.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr60036.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr60087.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr60195.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr60267.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr60485-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr60485-2.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr60598.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr8715.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr8788-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr8835-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr8927-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr9365-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pr9814-1.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-align-2.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-align.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-darwin-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-darwin.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-diag-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-diag-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-init-fini-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-init-fini.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-message.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-ms_struct.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-4.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-5.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-push_macro-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/precedence-1.c153
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/predict-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/predict-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/predict-3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/predict-4.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/predict-5.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/predict-6.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/predict-7.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/prefetch-loop-arrays-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/proto-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-common.h39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-3.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-4.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pure-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/pure-2.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/qual-component-1.c232
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/qual-return-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/qual-return-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/qual-return-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/qual-return-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/range-test-1.c168
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/readonly-loc.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/real-const-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-1.c102
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-10.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-11.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-12.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-13.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-14.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-15.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-16.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-17.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-2.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-3.c1180
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-4.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-5.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-6.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-7.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-8.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/redecl-9.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/reg-vol-struct-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/register-var-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/register-var-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/register-var-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/return-type-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/return-type-2.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/return-type-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/section1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-1.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-pr17880.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/setjmp-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/setjmp-2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/setjmp-3.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/setjmp-4.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/setjmp-5.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/short-compare-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/short-compare-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-pretend.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-sibcall.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sibcall-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sibcall-2.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sibcall-3.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sibcall-4.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sibcall-6.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sibcall-7.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sibcall-8.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simd-1.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simd-1b.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simd-2.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simd-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simd-4.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simd-5.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simd-6.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/README118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c133
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-longlong.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-short.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-longlong.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-short.c117
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h131
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-2.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-3.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-4.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/subfields.c93
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/single-precision-constant.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sizeof-1.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sizeof-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/slp-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/smod-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-10.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-11.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-3.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-4.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-5.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-6.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-7.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-8.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sms-9.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/spec-options.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/20000419-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/alias-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/alias-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/gcsec-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/mips-abi.exp104
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/mips-abi.s0
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/special.exp32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/weak-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/weak-1a.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2a.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2b.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2a.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2b.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/spill-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/split-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/split-2.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/split-3.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/split-4.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/split-5.c171
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/split-6.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ssp-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ssp-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stack-layout-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stack-layout-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-1.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-4.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-1.c407
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-5.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-6.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/string-opt-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-10.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-11.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-12.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-12g.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-13.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-14g.c115
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-14gf.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-15.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-16g.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-17g.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-18g.c82
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-19.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-1f.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-2.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-20.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-21.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-22.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-22g.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-23.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-24.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-25.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-26.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-2f.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-3.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4g.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4gf.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-5.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-6.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-7.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-8.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-9.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strlenopt.h59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/strncpy-fix-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-alias-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-by-value-1.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-by-value-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-in-proto-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-incompl-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-parse-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-parse-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-3.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-libc.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-4.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/superblock.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-4.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-5.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-6.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-8.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-9.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-A.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-1.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sync-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sync-2.c105
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/sync-3.c102
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/system-binary-constants-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/system-binary-constants-1.h3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tail-merge-store.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tg-tests.h148
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/titype-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/alias-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/alpha-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/asm-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/debug-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-4.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-5.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-6.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/emutls-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/emutls-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/init-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/nonpic-1.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-10.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-11.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-12.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-13.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-14.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-15.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-2.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-4.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-5.c110
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-6.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-7.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-8.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-9.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pic-1.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pie-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr24428-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr24428.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr42894.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr45870.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-4.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-5.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/pr58595.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/section-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/section-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/struct-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-cse-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-init-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-init-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/tls.exp36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tls/trivial.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20091013.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20091221.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20100125.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20100519.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20100524-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20100603.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20100609.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20100610.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20100615-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20100615.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/20110216.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/alias-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/alias-2.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/asm-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/clone-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/data-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/data-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/debug-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/indirect-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/indirect-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/instrumented-mask.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-5.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-6.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-7.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/lto-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-10.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-11.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-12.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-13.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-15.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-16.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-4.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-5.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-6.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-7.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-8.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-9.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memset-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/memset.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/nested-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/nested-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/opt-1.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/opt-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr45985.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46567-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46567.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46654.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47520.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47690.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47905.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr51472.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr51696.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52141.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52142.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52173-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52173-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr53008.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr53850.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr55401.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pr56108.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/props-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/props-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/props-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/props-4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/pub-safety-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/reg-promotion.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/tm.exp43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/unsafe.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/unused.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/vector-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/20080716-1.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/20090618-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/20110713-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/20110718-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/20110719-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/20131115-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/20131122-0.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c712
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/alias-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-compile-assign.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-compile-convert.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-alt.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-ieee.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-7.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-8.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops.h135
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/asm-subreg-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/badshift.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c438
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-complex-1.c124
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c149
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-4.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c247
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-cproj-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ctype-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ctype-2.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-explog-1.c232
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-frexp-1.c137
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-integral-1.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-isinf_sign-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ldexp-1.c216
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-logb-1.c192
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-1.c186
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-2.c385
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-3.c374
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-4.c311
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-5.c123
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-6.c302
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-7.c102
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-8.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-minmax-1.c128
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-modf-1.c195
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-nonneg-1.c180
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-noret-1.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-noret-2.c89
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-pow-mpfr-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-power-1.c114
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-rounding-1.c120
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-self.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-sin-mpfr-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-symmetric-1.c111
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-wctype-1.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/builtins-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/c99-contract-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/calleesave-sse.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/cris-volatile-1.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/darwin-cfstring-3.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/dg-torture.exp7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-div-underflow.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-extend-nan.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-truncdf-underflow.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-truncsf-underflow.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-compare.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert.h89
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/inline-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/inline-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/ldist-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-1.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-2.c113
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-3.c97
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-4.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-5.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-6.c97
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/memcpy-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-clobber-at.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-div-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-hilo-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-sdata-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/nested-fn-1.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr16104-1.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr17526.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr17933-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr18582-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr19462-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr19683-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr20314-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr20314-2.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr21817-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr23424-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr23821.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24257.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-2.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-4.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24750-1.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24912-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25183.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25481.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25654.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25706-1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25718-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25947-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26222.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26258.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26515.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26565.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26587.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26630.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26672.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26763-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26763-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26869.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26898-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26898-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26998.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27116-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27116.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27136.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27184.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27302-2.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27302.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27409.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27603.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27743.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27773.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28045.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28230.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28268.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28814.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28900.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29119.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29446.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29584.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30313.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30375.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30665-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30665-2.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr31115.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr31254.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr32897.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33560.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33563.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33655.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33848.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33870.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr34174-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr34330.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35227.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35400.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35634.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-2.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771.h30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35833.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35842.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36066.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36227.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36244.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-10.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-2.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-3.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-4.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-5.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-6.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-7.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-8.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-9.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36400.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36891.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36978.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37731-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37731-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37868.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37969.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38271.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38774.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38948.c101
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074-3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39132.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39204.c131
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39241.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39678.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39829.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39855.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39903-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39903-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40328.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-3.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41094.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41261.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41555.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41993.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42363.c84
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42667.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42878-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42878-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42898-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42898.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42952.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43000.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43002.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43017.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43165.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43360.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43560.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43781.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879-3.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879_1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879_2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44050.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44695.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44806.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44807.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44913.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44977.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45017.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45623.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45636.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45678-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45678-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45704.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45720.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45732.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45764.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45830.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45860.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45865.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45869.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45982.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46068.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46172.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46183.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46216.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46398.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46723.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47228.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47278-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47278-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47281.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47364-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47365.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47370.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47383.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47411.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47426-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47426-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47473.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47621.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47677.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47725.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47743.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-3.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47890.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47917.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47958-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47968.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47975.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48044.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48063.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48098.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-3.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48146.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48343.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48493.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48542.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48694-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48694-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48702.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48731.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48822.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48953.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49030.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49079.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49169.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49217.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49603.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49651.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49958.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49997.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-4.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-5.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50092.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50222.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50287.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50333.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50363.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50389.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50396.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50444.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50472.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50723.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50767.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50768.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50823.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50838.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50890.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50902.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51042.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51070-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51070.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51071-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51071.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51106-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51106-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51238.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51244-21.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51245.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51692.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51760.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51801.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51949.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52028.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52060.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52170.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52244.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52298.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52402.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52406.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52407.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52419.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52429.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52493.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52530.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52693.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52720.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52756.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52881.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52912.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52913.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52943.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52969.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52996.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53070.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53120.c110
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53144.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53168.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53272-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53272-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53366-1.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53366-2.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53390.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53408.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53501.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53516.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53589.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53695.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53703.c149
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53790.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53908.c288
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53922.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54027.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54098.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54109.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54127.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54132.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54261-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54327.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54409.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54436.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54458.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54520.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54824.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54877.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54894.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54920.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55011.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55018.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55107.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55111.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55124.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55238.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55253.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55270.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55305.c151
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55481.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55555.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55633.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55684.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55687.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55755.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55862.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55882.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55888.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-1.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-2.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55964-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55964.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56034.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56150.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56157.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56181.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56195.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56264.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56321.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56349.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56366.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56384.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56407.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56420.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56443.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56478.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56488.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56501.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56661.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56689.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56756.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56778.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57026.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57036-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57036-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57075.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57081.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57083.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57122.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57214.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57251.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57303.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57330.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57341.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57343.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57381.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57417.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-2.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-3.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57478.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57488.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57517.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57521.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57569.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57584.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57656.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57685.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-2.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-3.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-4.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57993-2.cpp213
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57993.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58018.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58041.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58079.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58131.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-1.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58223.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58228.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58246.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58326-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58326-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58417.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58539.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58553.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58554.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58626.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58670.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58779.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58830.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58921.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58941.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58955-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58955-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58956.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59006.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59038.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59047.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59058.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59139.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59164.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59166.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59216.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59245.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59288.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59330.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59338.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59651.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59715.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59891.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59903.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59990.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59993.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60092.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60115.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60183.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr8081.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-escape-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/reassoc-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-5.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-6.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-3.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/check.h36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/fastcall-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-2.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/regparm-1.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-1.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-3.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-4.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/sibcall-1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/thiscall-1.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-gd.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-ie.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-ld.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-le.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/thr-init-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/thr-init-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls-reload-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls-test.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls.exp57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-1.c97
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-2.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-3.c101
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-4.c100
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-5.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-6.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/tree-loop-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/type-generic-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/va-arg-25.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vec-cvt-1.c213
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-2.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shift2.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shuffle1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-16.inc139
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-2.inc19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-32.inc139
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-4.inc139
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-8.inc139
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-main.inc55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v16hi.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v16qi.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2df.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2di.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2sf.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2si.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v32qi.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4df.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4di.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4hi.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4sf.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4si.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8hi.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8qi.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8sf.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8si.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/trampoline-1.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-1.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-3.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-5.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c166
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1a.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/peel-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr34999.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr44777.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr45354.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr47187.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr49299-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr49299-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr50907.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr52027.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr52150.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr59003.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/switch-case-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/time-profiler-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/time-profiler-2.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c145
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-6.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/wcoverage-mismatch.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030820-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030820-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030821-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030825-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030907-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030907-2.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030920-1.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030922-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031021-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031022-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031031-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-3.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-4.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-5.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-6.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031113-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031216-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040121-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040209-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040210-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040216-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040302-1.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040313-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040319-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040324-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040326-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040326-2.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040408-1.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040430-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040513-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040513-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040518-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040518-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040615-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040624-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040713-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041002-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050128-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050215-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050412-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050719-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20070302-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20070815.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20080530.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-10.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-11.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-12.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-13.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-14.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-16.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-17.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-18.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-20.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-21.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-22.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-23.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-24.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-25.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-26.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-27.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-28.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-29.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-30.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-31.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-4.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-5.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-6.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-7.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-8.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-9.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-1.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-2.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-4.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-5.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asmgoto-1.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-alias-2.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-5.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-6.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-8.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-9.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-chk-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-free.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-chk-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-chk-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-chk-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/coalesce-1.c195
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/coalesce-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/col-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-3.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-5.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cswtch-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cswtch.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-10.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-5.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/dce-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-4.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/dump-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-3.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-5.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-6.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-11.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-12.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-13.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-14.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-15.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-16.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-17.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-18.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-19.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-20.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-21.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-23.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-24.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-25.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-26.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-27.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-33.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-4.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-6.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-7.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr44710.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr47271.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-10.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-5.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-6.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-7.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-9.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-reference-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-4.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-2.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-4.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_3.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-3.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-10.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-11.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-12.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-13.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-15.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-16.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-1a.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-2.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-20.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-21.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-22.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-23.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-3.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-4.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-5.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-6.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-7.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-8.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-9.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/leaf.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre11.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre12.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre13.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre14.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre15.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre16.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre17.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre18.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre19.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre20.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre21.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre22.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre5.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c97
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-10.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-11.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-14.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-18.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-2.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-20.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-21.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-22.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-23.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-24.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-25.c129
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-26.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-28.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-29.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-30.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-31.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-32.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-33.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-34.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-36.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-37.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-38.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-4.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-6.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-7.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-8.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-9.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/negate.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-6.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr13146.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14341.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14814.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14841.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15349.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-4.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-5.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr16721.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17141-2.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17598.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-10.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-5.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-6.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-7.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-8.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-9.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19055-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19055.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19210-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19431.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19590.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19633.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-3.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20318.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20470.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20490.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20657.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20739.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20742.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20933.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21029.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21031.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21090.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21171.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21332.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21458.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21559.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21563.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21582.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21959.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21985.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22018.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22026.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22051-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22117.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22171.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22230.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22236.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22321.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22591.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23048.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23086.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23109.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23115.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23192.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23386.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23391.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23401.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23433.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23434.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23546.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23744.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23777.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-4.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24117.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24287.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24627.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24670.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24689.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr2480.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24990-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25382.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25485.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25501.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25734.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26180.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26899.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27236.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27498.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27781.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27799.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27810.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr28410.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr30375.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31521.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32367.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32461-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32461-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32540-1.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32540-2.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32681.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32821.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32901.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32964.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33172.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33723.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33920.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33922.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34146-2.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34146.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34244.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34635-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34635.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr35286.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr35287.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36181.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36326.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36881.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36908.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr37508.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38250.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38385.c124
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38533.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38895.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38997.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr39007.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr40087.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42327.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42640.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42893.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr43491.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44133.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44258.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44423.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44483.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45085.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45122.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45427.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45685.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr47286.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr47392.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49039.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49094.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49642-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49642-2.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49923.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr52631.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54245.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54915.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr55008.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr55579.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr57361.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr57385.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr58480.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr58958.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-6.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-7.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-4.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-5.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-10.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-11.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-12.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-13.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-14.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-15.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-16.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-17.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-18.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-21.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-22.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-26.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-27.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-29.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-30.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-31.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-6.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-7.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-8.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-9.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-4.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-5.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sccp-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-6.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-7.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-10.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-11.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-12.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-13.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-14.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-15.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-16.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-17.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-18.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-19.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-20.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-21.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-22.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-23.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-24.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-25.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-26.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-27.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-28.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-29.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-3.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-31.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-39.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-4.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-40.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-41.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-5.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-6.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-7.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-8.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-9.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-1.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-10.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-11.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-12.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c114
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-2.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-4.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-5.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-6.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-7.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-8.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-9.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-10.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-11.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-12.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-13.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-15.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-16.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-18.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c172
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-22.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-24.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-27.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-28.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-29.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c137
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-30.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-31.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-32.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-33.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-4.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-6.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-7.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-8.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-ccp-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-dse-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-10.c1523
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-12.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-13.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-14.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-4.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-5.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-6.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-7.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-8.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-9.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-11.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-12.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-15.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-18.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-19.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-20.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-22.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-23.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-25.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-27.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-30.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-31.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-32.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-33.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-34.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-35.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-36.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-37.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-38.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-10.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-11.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-12.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-13.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-3.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-4.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-5.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-7.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-8.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-9.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-5.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-6.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-10.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-11.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-5.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-6.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-7.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-9.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-11.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-12.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-13.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-14.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-22.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-25.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-27.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-29.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-30.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-31.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-4.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-5.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-6.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-3.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-4.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-5.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-6.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-7.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-8.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-9.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-2.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-vrp-thread-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-2.c298
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-3.c193
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-4.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-5.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-6.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/strlen-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-2.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-5.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-6.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-4.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-5.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-6.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-7.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tree-ssa.exp36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/unreachable.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-cunroll.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-unroll-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-unswitch-1.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-1.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-3.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp.h27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp01.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp02.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp03.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp04.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp05.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp06.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp07.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp08.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp09.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp10.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp11.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp12.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp13.c258
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp14.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp15.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp16.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp17.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp18.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp19.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp20.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp21.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp22.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp23.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp24.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp25.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp26.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp27.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp28.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp29.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp30.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp31.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp32.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp33.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp34.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp35.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp36.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp37.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp38.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp39.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp40.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp41.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp42.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp43.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp44.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp45.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp46.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp49.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp50.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp51.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp52.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp53.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp54.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp55.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp56.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp58.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp60.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp61.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp62.c110
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp63.c345
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp64.c152
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp65.c376
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp66-int16-sw.c914
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp66.c861
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp68.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp69.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp70.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp71.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp72.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp73.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp74.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp75.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp76.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp77.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp78.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp79.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp80.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp81.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp82.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp83.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp84.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp85.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp86.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp87.c84
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp88.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp89.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp90.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/trunc-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tsan/tsan.exp47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-10.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-3.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-4.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-5.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-6.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-7.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-8.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/two-types-9.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/typedef-init.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/typedef-redecl.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/typedef-redecl.h7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/typename-vla-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/typeof-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/typespec-1.c937
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c99-shift-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c99-shift-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ubsan/ubsan.exp36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-10.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-11.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-12.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-13.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-4.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-5.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-6.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-7.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-8.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/ucnid-9.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unaligned-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-1-O0.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-10-O0.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-10.c109
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-11-O0.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-11.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-12-O0.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-12.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-13-O0.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-13.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-14-O0.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-14.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-15-O0.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-15.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-16.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-2-O0.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-2.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-3-O0.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-3.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-4-O0.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-4.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-5-O0.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-5.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-6-O0.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-6.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-8-O0.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-8.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-9-O0.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-9.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-A-O0.c117
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-A.c117
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-O0-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-O0.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-B.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-C-O0.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-C.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-H-O0.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-H.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-I-O0.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-I.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr20644.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr40943.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_a.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_b.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_c.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_a.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_b.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_c.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_d.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_e.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-4_a.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-4_b.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-5_a.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-5_b.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_a.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_b.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_c.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_d.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_e.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_a.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_b.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_c.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_d.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_a.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_b.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_c.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_d.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-9_a.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-9_b.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-suppress.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/uninit-suppress_2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-2.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-3.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-4.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-5.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-cast-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-cast-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-cast-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/union-cast-4.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unordered-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unordered-2.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unordered-3.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unroll-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unroll_1.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unroll_2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unroll_3.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unroll_4.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unroll_5.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unsigned-long-compare.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-3.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-4.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-5.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-6-WallWextra.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-6-no.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-6.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unused-7.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/unwind-1.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-array-short-wchar.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-array.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-badconcat.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-badconcat2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-cvt.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-dflt.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-dflt2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-inc-init.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf-type.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf16-1.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf16-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf16-3.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf16-4.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf32-1.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf32-2.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf32-3.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf32-4.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf8-1.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/utf8-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-4.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-5.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-2.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-len-1.c122
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-len-2.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/var-expand2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/var-expand3.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/varpool-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O-pr46167.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O1-pr33854.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O1-pr41008.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr36098.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr41881.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr45971.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr46077.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr49087.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-vect-pr32243.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/Os-vect-95.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-nest-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-1.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-10.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-11.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-13.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-14.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-15.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-16.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-17.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-18.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-19.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-2.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-20.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-21.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-22.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-23.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-24.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-25.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-26.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-27.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-28.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-29.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-3.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-30.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-31.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-32.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-4.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-5.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-6.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-7.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8a.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8b.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-9.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-1.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-68.c88
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-fast-math-vect-pr29925.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31b.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31c.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68a.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68b.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68c.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-reduc-1char.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp89
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-fast-math-vect-pr29925.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31a.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31b.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31c.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31d.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68a.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68b.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68c.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68d.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c88
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/dump-tree-dceloop-pr26359.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-3.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-ifcvt-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr43074.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr44152.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr55281.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-call-1.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-call-2.c130
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-outer-7.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pow-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pow-2.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pr25911.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pr29925.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-8.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-9.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/ggc-pr37574.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-fre-pre-pr50208.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-math-errno-slp-32.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-math-errno-vect-pow-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-1.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-2.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-3.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-4.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-5.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-slp-reduc-7.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-11.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-12.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-13.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-14.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-15.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-16.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-17.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-19.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-21.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-22.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-3.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-4.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-5.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6-global.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-7.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-8.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9a.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9b.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-pr49199.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-slp-30.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-slp-31.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c92
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-34.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-36.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c88
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-65.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c84
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c120
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-outer-4h.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-fre-pr50039.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-pre-pr45241.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-pre-slp-29.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-sra-bb-slp-pr50730.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-45.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-49.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-51.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-53.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-3.c187
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-dv-2.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/nodump-forwprop-22.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/nodump-pr23073.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr16105.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18308.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18400.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18425.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18536.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr20122.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr21591.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr21969.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr22480.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr22506.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23816-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23816-2.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23831.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24049.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24059.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24300.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25371.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25413.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25413a.c129
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr27151.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr28952.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30771.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30784.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30795.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30843.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30858.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31041.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31343.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31699.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32216.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32224.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32230.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32366.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32421.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32824.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33369.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33373.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33373b.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33597.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33804.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33833.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33846.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33866.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33953.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34005.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34407.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34591.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36228.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36493.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36630.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37027.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37385.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37474.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37482.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37539.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37730.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr38529.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr39529.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40074.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40238.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40254.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40542.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr41956.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42193.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42395.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42604.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42709.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43430-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43430-2.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43432.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43842.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr44507.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45633.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45752.c108
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45847.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45902.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46009.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46049.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46052.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46126.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46663.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr47001.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr47139.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48172.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48377.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48765.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49038.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49093.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49318.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49352.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49478.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49610.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49771.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49926.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50014.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50451.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50635.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50727.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51000.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51015.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51074.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51301.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-2.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-3.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-4.c166
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51590.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51799.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52091.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52298.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52870.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53185-2.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53185.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53773.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr55857-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr55857-2.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56695.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56787.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56826.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56918.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56920.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56933.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57705.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-2.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-3.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr58508.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59519-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59519-2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59591-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59591-2.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59594.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59651.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59984.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60012.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60092-2.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60276.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60382.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60482.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/section-anchors-pr27770.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c120
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-1.c123
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-10.c113
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11a.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11b.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11c.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12a.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12b.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12c.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c141
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-13.c133
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-14.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-15.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-16.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-17.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-18.c97
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19a.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19b.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19c.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-2.c145
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-20.c115
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-21.c207
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-22.c134
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-23.c113
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-24-big-array.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-24.c84
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-25.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-26.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-28.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-3-big-array.c155
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-3.c147
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-33.c111
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-34-big-array.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-34.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-35.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-36.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-37.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-38.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-39.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-4-big-array.c135
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-4.c127
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-5.c126
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-6.c122
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-7.c128
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-8.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-9.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-1.c126
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c127
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-2.c127
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-3.c84
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-4.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c82
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c92
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-1.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-2.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-3.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-4.c87
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-5.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-6.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-7.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-8.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-9.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-2.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-3.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-4.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-5.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-half.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/tree-vect.h71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt1.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt2.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-1-big-array.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-1.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-10-big-array.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-10.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-100.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-103.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-104.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-105-big-array.c106
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-105.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-106.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-107.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-108.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-109.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-11.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-110.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-112-big-array.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-112.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-113.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-114.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-115.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-116.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-117.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-118.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-119.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-11a.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-12.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-120.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-121.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-122.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-123.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-124.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-13.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-14.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-15-big-array.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-15.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-17.c129
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-18.c128
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-19.c128
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-2-big-array.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-20.c100
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-21.c129
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-22.c126
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-23.c128
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-24.c128
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-25.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-26.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-27.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-28.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-29.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-3.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-30.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-31-big-array.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-31.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-32-big-array.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-32.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-33-big-array.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-33.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-34-big-array.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-34.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-35-big-array.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-35.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-36-big-array.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-36.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-38.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-4.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-40.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-42.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-44.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-46.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-48.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-5.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-50.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-52.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-54.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-56.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-58.c63
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-6-big-array.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-6.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-60.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-62.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-63.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-64.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-65.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-66.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-67.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-68.c89
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-7.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-70.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-71.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-72.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-73-big-array.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-73.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-74-big-array.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-74.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-75-big-array.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-75.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-76-big-array.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-76.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77-global.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78-global.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-8.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-80-big-array.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-80.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-82.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-82_64.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-83.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-83_64.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-85-big-array.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-85.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-86.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-87.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-88.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-89-big-array.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-89.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-9.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-91.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-92.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-93.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-95.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-96.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-97-big-array.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-97.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-98-big-array.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-98.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-99.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-alias-check.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-3.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-all-big-array.c255
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-all.c221
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-bool-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-2.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-4.c108
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-5.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-1.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-10.c165
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-11.c116
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-3.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-4.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-5.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-6.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-7.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-8.c122
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-9.c200
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cselim-2.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-1.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-2.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-3.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-4.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-5.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-6-big-array.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-6.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-7.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-dv-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-fold-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-1.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-10.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-11.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-2.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-3.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-4.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-5.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-6.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-7.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8-big-array.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8a-big-array.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8a.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-9.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-mask-load-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-mask-loadstore-1.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c87
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-10.c68
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-11.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-13.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-14.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-15.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c100
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-7.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-8.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-9.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-neg-store-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-neg-store-2.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-2.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-3.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nop-move.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1-big-array.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1a-big-array.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1b-big-array.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1b.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2-big-array.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2a-big-array.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2a.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2b.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2c-big-array.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2c.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2d.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3-big-array.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3a.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3b.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3c.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4a-big-array.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4a.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4b-big-array.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4b.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4c-big-array.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4c.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4d-big-array.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4d.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4e.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4f.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4g.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4i.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4j.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4k.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4l.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4m-big-array.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4m.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-5.c82
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-6.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-big-array.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb-big-array.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-1-big-array.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-2-big-array.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-3-big-array.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-3.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-4-big-array.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-1.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-2.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-3.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-4.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-pre-interact.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-recip.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-10.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1char-big-array.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2char-big-array.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-7.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-8.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-9.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16b.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16b.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c55
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1a.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b-big-array.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c-big-array.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2a.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b-big-array.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2c.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-3.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-btrunc.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-btruncf.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-ceil.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-ceilf.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-floor.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-floorf.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-lceil.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-lfloor.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-nearbyint.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-nearbyintf.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-round.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-roundf.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-sdivmod-1.c98
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-1.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-2-big-array.c190
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-2.c190
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-3.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-4.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-1.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10.h4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10a.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-11.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12a.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-2.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-3.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-4.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-5.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-6.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-7.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-8.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-9.c95
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c76
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2-big-array.c94
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7-big-array.c103
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c88
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-float.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c72
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c62
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c112
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c84
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2-big-array.c97
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c85
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c118
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c105
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7-big-array.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c90
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c92
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-01.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-02.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-04.c38
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-const-s16.c60
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-const-u16.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-half-u8.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-half.c49
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-s16.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-s8.c46
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-sum.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u16.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-s16.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-s8.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-u16.c58
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-u8.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp311
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-7.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-pattern-2c.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vector-shift-2.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vector-shift.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/verbose-asm.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-10.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-11.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-12.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-13.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-14.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-15.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-16.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-17.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-18.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-19.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-20.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-21.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-3.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-4.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-6.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-7.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-8.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-9.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-a.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-b.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-c.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-d.c205
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-10.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-11.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-12.c50
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-13.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-14.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-15.c27
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-16.c70
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-17.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-18.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-19.c32
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-2.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-20.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-21.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-22.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-23.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-3.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-4.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-5.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-6.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-7.c3
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-8.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-9.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-init-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-init-2.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-init-3.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-init-4.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vla-init-5.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-01.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-02.c61
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-03.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-04.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-05.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-06-ansi.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-06.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-07-ansi.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-07.c54
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1c-01.c56
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/1c-02.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01a.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01m.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-03.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-03m.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-04.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-04m.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-05.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-06.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-06m.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-07.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-01.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-02.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-10.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-13.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-14.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-15.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-01.c86
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-01a.c1450
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-02.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-03.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/3d-01.c171
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/4-01.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/4-03.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-01.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-02.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-03.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-04.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-07t.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-10.c1352
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-11.c289
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/7-01.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/7-01a.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/7c-01.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/7d-01.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/7d-02.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-01.c4
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-02.c299
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-02a.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/brode-1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-1.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-2.c24
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-3.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/cw-bug-1.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/cw-bug-3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/dct.c176
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-1.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-2.c42
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-3.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-4.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/dos-bug-1-gdb.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/dos-bug-2-gdb.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/eg-5.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-be-order.c33
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-vsx.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/fft.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-2.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-3.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-4.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-5.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-6.c30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-7.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-8.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-9.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-b.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-c.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-d.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-e.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-f.c125
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-g.c119
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/harness.h30
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-be-order.c65
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-vsx.c28
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2a.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2b.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2c.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-be-order.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-vsx.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/lde-be-order.c73
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/lde.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-be-order.c107
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-vsx.c39
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl.c91
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/mem.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-be-order.c96
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-vsx.c44
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge.c77
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/mult-even-odd.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/newton-1.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops-long-1.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops-long-2.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops.c3831
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/pack-be-order.c136
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/pack.c108
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/perm-be-order.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/perm.c69
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/pr27006.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/pr27842.c26
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/sn7153.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill.c131
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill2.c155
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill3.c156
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-be-order.c59
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c37
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-vsx.c31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat.c47
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-be-order.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-vsx.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/st.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ste-be-order.c53
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/ste.c41
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-be-order.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-vsx.c29
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/sum2s.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/t.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/unpack-be-order.c88
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/unpack.c67
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-1.c99
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-2.c78
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-3.c75
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-4.c291
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-5.c71
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-6.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-7.c83
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/vec-set.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/vmx.exp57
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/vsums-be-order.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/vsums.c12
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-01.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-02.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-03.c124
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-04.c80
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-05.c82
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/yousufi-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/zero-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vmx/zero.c100
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/void-cast-1.c11
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/void-cast-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/volatile-bitfields-1.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/volatile-bitfields-2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/volatile1.c9
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/volatile2.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/volatile3.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vshift-1.c132
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vshift-2.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vshift-3.c136
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vshift-4.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vshift-5.c81
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vxworks/initpri1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vxworks/initpri2.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/vxworks/vxworks.exp36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/warn-1.c16
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/warn-addr-cmp.c79
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/warn-nsstring.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wcaselabel-1.c15
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wchar_t-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wchar_t-2.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wdate-time.c6
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/typeof-2.c51
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-10.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-11.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-12.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-13.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-14.c34
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-15.c40
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-16.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-2.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-3.c74
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-4.c106
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-5.c110
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-6.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-7.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-8.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-9.c23
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/weak/weak.exp31
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/webizer.c36
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/winline-1.c13
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/winline-10.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/winline-2.c8
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/winline-3.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/winline-5.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/winline-6.c21
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/winline-7.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/winline-9.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wint_t-1.c17
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wmul-1.c19
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-aggr-init-1.c48
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-conversion-1.c66
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-escape-1.c22
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-func-def-1.c204
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-int-type-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-label-1.c52
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-static-1.c14
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-strcat-1.c18
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-suffix-1.c35
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-switch-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-unary-plus-1.c20
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-1.c25
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-2.c45
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-3.c64
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wtypequal.c7
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wvla-1.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wvla-2.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wvla-3.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wvla-4.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wvla-5.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wvla-6.c5
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/wvla-7.c5
8094 files changed, 309092 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20000108-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20000108-1.c
new file mode 100644
index 000000000..4391be2ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20000108-1.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 2000 Free Software Foundation.
+
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+extern void abort (void);
+
+void foo () {} /* unused, but essential to trigger the bug */
+
+int main () {
+ int i;
+ /* use asms to prevent optimizations */
+ /* i = -1; */ asm ("" : "=r" (i) : "0" (-1));
+ /* i = 1; */ asm ("" : "=r" (i) : "0" (i ? 1 : 2));
+ if (i != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20000111-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20000111-1.c
new file mode 100644
index 000000000..a042656d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20000111-1.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2000 Free Software Foundation.
+
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do compile } */
+
+__inline int
+foo (int **q) {
+ return *q && **q;
+}
+
+void
+bar () {
+ int **p;
+ if (foo (p))
+ do_something ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20000623-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20000623-1.c
new file mode 100644
index 000000000..bbc8c10ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20000623-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-strict-aliasing" } */
+
+extern void exit (int);
+extern void abort (void);
+
+struct foos { int l; };
+int foo;
+static struct foos *getfoo(void);
+int main (void)
+{
+ struct foos *f = getfoo();
+ f->l = 1;
+ foo = 2;
+ if (f->l == 1)
+ abort();
+ exit(0);
+}
+static struct foos *getfoo(void)
+{ return (struct foos *)&foo; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20000629-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20000629-1.c
new file mode 100644
index 000000000..b8c7f286d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20000629-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+void foo(register char *p)
+{
+ char c, *q, *sp;
+ while (1) {
+ *p++=0;
+ sp=p+1;
+ c=*sp;
+ *p++=0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20000707-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20000707-1.c
new file mode 100644
index 000000000..5328dfa63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20000707-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+extern void foo(void *here);
+extern inline void bar(void)
+{
+ __label__ here;
+ foo(&&here);
+here:
+ ;
+}
+
+void baz(void)
+{
+ bar();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20000906-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20000906-1.c
new file mode 100644
index 000000000..90d09d4db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20000906-1.c
@@ -0,0 +1,78 @@
+/* { dg-do run } */
+
+/* Testcase distilled from glibc's nss_parse_service_list in nss/nsswitch.c
+ It can't be distilled further. Fails with `-O2' for i[3456]86. */
+
+/* this simulates a bounded-pointer type. */
+struct ucharp { unsigned char *v, *l, *h; };
+
+/* this simulates bounded-pointer check prior to pointer dereference. */
+#define AREF(var, idx) ((((((((var).v+(idx)) < (var).l) \
+ || (((var).v+(idx)+1) > (var).h))) \
+ && (__builtin_trap (), 0)), \
+ (var).v)[(idx)])
+
+struct list
+{
+ struct list *next;
+};
+
+struct list *
+alloc_list (void)
+{
+ static struct list l;
+ return &l;
+}
+
+int one = 1;
+
+void
+foo (struct ucharp cp, struct ucharp lp, struct list **nextp)
+{
+ while (1)
+ {
+ struct list *list;
+ while (AREF (lp, 0) && AREF (cp, AREF (lp, 0)))
+ ++lp.v;
+ list = alloc_list ();
+ while (AREF (cp, AREF (lp, 0)))
+ ++lp.v;
+ if (AREF (lp, 0) == one)
+ do
+ ++lp.v;
+ while (AREF (lp, 0) && AREF (cp, AREF (lp, 0)));
+ /* The above AREF (cp, ...) fails because the pseudo created to
+ hold cp.v holds garbage, having never been set.
+ The easiest way to see the problem is to compile wiht `-O2 -da'
+ then look at *.09.loop. Search for something like this:
+
+ Hoisted regno 183 r/o from (mem/s:SI (reg:SI 16 argp) 10)
+ Replaced reg 91, deleting init_insn (213).
+
+ Now, look for the use of reg 91, which has no set. */
+
+ *nextp = list;
+ nextp = &list->next;
+ if (!*lp.v)
+ break;
+ }
+}
+
+extern void exit (int);
+
+int
+main (void)
+{
+ static unsigned char cp0[] = "\0\0\0\0";
+ struct ucharp cp = { cp0, cp0, cp0 + sizeof (cp0) };
+
+ static unsigned char lp0[] = "\1\1\0\0";
+ struct ucharp lp = { lp0, lp0, lp0 + sizeof (lp0) };
+
+ struct list list;
+ struct list *nextp = &list;
+
+ foo (cp, lp, &nextp);
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20000926-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20000926-1.c
new file mode 100644
index 000000000..2f5ca10a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20000926-1.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000 Free Software Foundation.
+ by William Cohen <wcohen@redhat.com> */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+#include <limits.h>
+
+struct PDATA
+{
+ unsigned int Dummy:(sizeof(int)*CHAR_BIT);
+ const char* PName;
+};
+
+typedef struct PDATA P_DATA;
+
+struct PLAYBOOK {
+ const char * BookName;
+ P_DATA Play[0];
+};
+
+struct PLAYBOOK playbook =
+{
+ "BookName",
+ {
+ { 1, "PName0" }, /* { dg-warning "(excess elements)|(near initialization)" "" } */
+ }
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001009-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001009-1.c
new file mode 100644
index 000000000..1a5567779
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001009-1.c
@@ -0,0 +1,47 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void foo (void *a, double x, double y);
+void
+bar (void *a, double b, double c, double d, double e, double f, double g, double h, double i, double j, double k[6])
+{
+ double l, m, n, o, p;
+ double q, r, s, t, u;
+ double x, y, v, w;
+ double z = 0.5 * j;
+ double aa;
+ l = b - 3 * d;
+ m = 4 * f;
+ n = f - h;
+ q = c + 3 * g - i;
+ r = 2 * (e - 2 * g + i);
+ s = g - i;
+ if (l != 0.0)
+ {
+ aa = 0.0;
+ o = (- m + aa);
+ p = (- m - aa);
+ if (o > 0.0)
+ {
+ x = ((b-h)*o + 3*(d+h)*o + 3*(f-h)*o);
+ y = ((c-i)*o + 3*(e+i)*o + 3*(g-i)*o);
+ foo (a, z, w);
+ foo (a, -z, w);
+ }
+ if (p > 0.0)
+ {
+ x = ((b+3*f-h)*p + 3*(d-2*f+h)*p + 3*p);
+ y = ((c+3*g-i)*p + 3*(e-2*g+i)*p + 3*p);
+ v = x * k[0] + y * k[2];
+ w = x * k[1] + y * k[3];
+ foo (a, z, w);
+ foo (a, - z, w);
+ }
+ }
+ if (q != 0.0)
+ {
+ aa = 0.0;
+ t = (- r + aa) / (2 * q);
+ u = (- r - aa) / (2 * q);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001012-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001012-1.c
new file mode 100644
index 000000000..eda69c029
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001012-1.c
@@ -0,0 +1,18 @@
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void abort (void);
+extern void exit (int);
+
+double
+foo (void)
+{
+ return (__extension__ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) { __l: 0x3f800000UL }).__d);
+}
+
+main ()
+{
+ if (foo() != 1.0)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001012-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001012-2.c
new file mode 100644
index 000000000..32dc27c59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001012-2.c
@@ -0,0 +1,36 @@
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void abort (void);
+extern void exit (int);
+
+void foo (char *x, const char *y, ...)
+{
+}
+
+double bar (const char *x, long y)
+{
+ return 0.0;
+}
+
+typedef __SIZE_TYPE__ size_t;
+extern size_t strlen (const char *);
+
+double baz (const char *x)
+{
+ if (x[0] != '\0')
+ {
+ char y[6 + strlen (x)];
+ foo (y, "FOO", x);
+ return bar (y, 0);
+ }
+
+ return (__extension__ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) { __l: 0x3f800000UL }).__d);
+}
+
+main ()
+{
+ if (baz("") != 1.0)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001023-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001023-1.c
new file mode 100644
index 000000000..10cb27259
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001023-1.c
@@ -0,0 +1,62 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+
+extern void abort (void);
+extern void exit (int);
+
+unsigned char a[256], b[256], c[256], d[256];
+
+void foo(unsigned char *x, int y, unsigned char *z)
+{
+}
+
+void bar(int x, ...)
+{
+}
+
+void baz(int y)
+{
+ if (y != 0x10)
+ abort();
+}
+
+void test(int x, unsigned char *y)
+{
+ unsigned char g,h,j, k[5],l[5], m[30];
+ int i;
+
+ bar(x, y[0], y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9]);
+ for (i = 5; --i >= 0; )
+ k[i] = y[5 + i] ^ a[i] ^ c[i];
+
+ foo(&m[29], sizeof m, k);
+ g = d[x] ^ c[x];
+ bar(x, d[x], x, c[x]);
+ baz(g);
+ for (i = 5, h = 0; --i >= 0; h = y[i])
+ {
+ j = m[25 + i] ^ y[i];
+ j = b[j] ^ g;
+ k[i] = c[j] ^ h;
+ }
+ for (i = 5, h = 0; --i >= 0; h = k[i])
+ {
+ j = m[20 + i] ^ k[i];
+ j = b[j] ^ g;
+ l[i] = c[j] ^ h;
+ }
+ for (i = 5, h = 0; --i >= 0; h = l[i]) {
+ j = m[15 + i] ^ l[i];
+ j = b[j] ^ g;
+ j = c[j] ^ h;
+ k[i] = a[j] ^ c[j];
+ }
+}
+
+int main()
+{
+ c[4] = 0xdc;
+ d[4] = 0xcc;
+ test(4, a);
+ exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001108-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001108-1.c
new file mode 100644
index 000000000..682257fdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001108-1.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+
+extern void abort (void);
+extern void exit (int);
+
+void die (long) __attribute__ ((noreturn));
+
+void die (long e)
+{
+ abort ();
+ for (;;);
+}
+
+long foo (double i)
+{
+ if (i != 2.0)
+ abort ();
+ return 26;
+}
+
+long bar (long i, double x)
+{
+ if (x < 0) die (1);
+ return foo (x);
+}
+
+main()
+{
+ if (bar (0, 2.0) != 26)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001116-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001116-1.c
new file mode 100644
index 000000000..8b1e919c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001116-1.c
@@ -0,0 +1,11 @@
+/* This looks like a warning test, but it's actually a regression test for a
+ nasty ICE due to messed up parser context. Problem originally found
+ during bootstrap; this is synthetic. -zw */
+/* { dg-do compile }
+ { dg-options -Wempty-body } */
+
+void foo (int x)
+{
+ if (x)
+ ; /* { dg-warning "empty body in an" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001117-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001117-1.c
new file mode 100644
index 000000000..a9de496e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001117-1.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -finstrument-functions" } */
+
+extern void abort (void);
+extern void exit (int);
+
+double
+foo (double a, double b)
+{
+ double c;
+ if (0.0 < a)
+ c = a;
+ else if (b > 0.0)
+ c = 0.0;
+ else
+ return 0;
+ return 2.0 * (b - c);
+}
+
+int main ()
+{
+ if (foo (1.0, 4.0) != 6.0)
+ abort ();
+ exit (0);
+}
+
+/* Abort on non-NULL CALL_SITE to ensure that __builtin_return_address
+ was expanded properly. */
+void __attribute__((no_instrument_function))
+__cyg_profile_func_enter(void *this_fn, void *call_site)
+{
+ if (call_site == (void *)0)
+ abort ();
+}
+
+void __attribute__((no_instrument_function))
+__cyg_profile_func_exit(void *this_fn, void *call_site)
+{
+ if (call_site == (void *)0)
+ abort ();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001201-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001201-1.c
new file mode 100644
index 000000000..195801a41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001201-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+char *s =
+"0123456789101214161820222426283032343638404244464850525456586062646668707274767880828486889092949698100103106109112115118121124127130133136139142145148151154157160163166169172175178181184187190193196199202205208211214217220223226229232235238241244247250253256259262265268271274277280283286289292295298301304307310313316319322325328331334337340343346349352355358361364367370373376379382385388391394397400403406409412415418421424427430433436439442445448451454457460463466469472475478481484487490493496499502"
+"505x"; /* { dg-bogus "greater than the minimum length" } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20001228-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20001228-1.c
new file mode 100644
index 000000000..49aec9617
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20001228-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math -O2" } */
+
+typedef struct
+{
+ float vs_data[75], vs_peak[75], vs_peak_speed[75];
+ int vs_refresh_delay;
+ int vs_doublesize;
+} Vis;
+
+void vis_timeout_func(Vis * vis)
+{
+ if (vis->vs_peak[0] < 0.0)
+ vis->vs_peak[0] = 0.0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20010202-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20010202-1.c
new file mode 100644
index 000000000..5f789042e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20010202-1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target i?86-*-* sparc*-*-* x86_64-*-* } } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+typedef enum { false, true } __attribute__ ((packed)) boolean;
+typedef struct {
+ enum {
+ A0 = 0, A1 = 1, A2 = 2
+ } __attribute__((packed)) A:3;
+ enum {
+ B0 = 0, B1 = 1, B2 = 2
+ } __attribute__((packed)) B:3;
+ boolean C:1;
+ boolean D:1;
+ unsigned char :8;
+} foo;
+foo x = { A2, B1, false, true };
+
+int main(void)
+{
+ if (sizeof (foo) != 2 || __alignof__ (foo) != 1)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20010405-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20010405-1.c
new file mode 100644
index 000000000..b4d57a5d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20010405-1.c
@@ -0,0 +1,19 @@
+__inline__ double bar(double *x)
+{
+ static double a;
+ a = *x >= 0 ? *x : -*x;
+ return a;
+}
+
+int main(void)
+{
+ extern double bar();
+ double a;
+ static double b;
+ int r;
+ for (r = 1; r < 3; r++) {
+ a = 1.0;
+ b = bar(&a);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20010516-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20010516-1.c
new file mode 100644
index 000000000..6ddabd093
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20010516-1.c
@@ -0,0 +1,7 @@
+/* { dg-options "-fshow-column" } */
+
+foo()
+{
+ char d;
+ __asm volatile ( "" :: "m"(&d)); /* { dg-error "34:" "non-lvalue" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20010622-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20010622-1.c
new file mode 100644
index 000000000..dc4b28ccb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20010622-1.c
@@ -0,0 +1,11 @@
+/* Test for segfault doing -Wsequence-point processing on an empty
+ statement expression. */
+/* Origin: PR c/3259 from <David.Decotigny@irisa.fr>. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+void
+f (void)
+{
+ ({ });
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20010822-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20010822-1.c
new file mode 100644
index 000000000..b1c1cd45a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20010822-1.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+
+extern void abort (void);
+
+void foo (unsigned long x)
+{
+}
+
+typedef struct a {
+ volatile unsigned int a1, a2, a3, a4, a5;
+} *A;
+typedef struct {
+ volatile unsigned int b1, b2, b3, b4, b5;
+} *B;
+struct C {
+ void *c1, *c2;
+ A c3;
+ unsigned char c4;
+};
+
+void
+bar (struct C *c, unsigned int *d)
+{
+ *d = *d | 1;
+ ((c->c4 >= 2)
+ ? (*(volatile unsigned int *) ((void *)(&((A)c->c3)->a5)) = *d)
+ : (*(volatile unsigned int *) ((void *)(&((B)c->c3)->b5)) = *d));
+
+ foo (50);
+}
+
+int main (void)
+{
+ struct a a;
+ struct C c;
+ unsigned int d = 8;
+ c.c3 = &a;
+ c.c4 = 0;
+ bar (&c, &d);
+ if (a.a5 != 9)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20010912-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20010912-1.c
new file mode 100644
index 000000000..bf81e3bac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20010912-1.c
@@ -0,0 +1,48 @@
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int bar (int x, char **y)
+{
+ if (x != 56)
+ abort ();
+ if (**y != 'a')
+ abort ();
+ *y = "def";
+ return 1;
+}
+
+int baz (int x, char **y)
+{
+ if (x != 56)
+ abort ();
+ if (**y != 'a')
+ abort ();
+ return 26;
+}
+
+int foo (int x, char *y)
+{
+ int a;
+ char *b = y;
+ a = bar (x, &y);
+ if (a)
+ {
+ y = b;
+ a = baz (x, &y);
+ }
+ if (a)
+ return a;
+
+ baz (x, &y);
+ return 0;
+}
+
+int main ()
+{
+ if (foo (56, "abc") != 26)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20011008-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20011008-1.c
new file mode 100644
index 000000000..e3991471a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20011008-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -fshow-column" } */
+
+struct { int; int q; } a; /* { dg-warning "13:does not declare anything" } */
+struct { union {int x;}; int q; } b;
+struct { struct {int x;}; int q; } c;
+union { union {int x;}; int q; } d;
+union { struct {int x;}; int q; } e;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20011008-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20011008-2.c
new file mode 100644
index 000000000..01ff172b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20011008-2.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct { union {int x; int y;}; int q; } b;
+union { struct {int x;}; int q; } e;
+
+main()
+{
+ b.y = 10;
+ b.x = 15;
+ if (b.y != 15)
+ abort();
+
+ e.x = 10;
+ e.q = 15;
+ if (e.x != 15)
+ abort();
+
+ exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20011015-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20011015-1.c
new file mode 100644
index 000000000..0b751bf40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20011015-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -std=gnu99" } */
+
+char foo (char *x)
+{
+ return *x;
+}
+
+void bar (char *x)
+{
+ void *arr[foo (x)] __attribute__((unused));
+}
+
+void baz (char *x)
+{
+ bar (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20011021-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20011021-1.c
new file mode 100644
index 000000000..8893b774a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20011021-1.c
@@ -0,0 +1,45 @@
+/* Test for various initializer warnings being suppressed by use of
+ designated initializers. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -W -Wall -Wtraditional" } */
+
+
+struct t
+{
+ int a;
+ int b; /* { dg-message "note: 'b' declared here" } */
+ int c;
+};
+
+union u
+{
+ int n;
+ float i;
+};
+
+struct multilevel
+{
+ int x;
+ struct t t;
+ union u u;
+ union u v;
+ char *f;
+};
+
+struct t T0 = { 1 }; /* { dg-warning "missing init" } */
+
+struct t T1 = { .a = 1 }; /* { dg-bogus "(missing|near) init" } */
+
+union u U0 = { 1 }; /* { dg-warning "initialization of union" } */
+union u U1 = { .i = 1 }; /* { dg-bogus "initialization of union" } */
+
+struct multilevel M =
+{
+ 12,
+ { .b = 3 }, /* { dg-bogus "missing init" } */
+ { 4 }, /* { dg-warning "initialization of union" } */
+ { .n = 9 }, /* { dg-bogus "initialization of union" } */
+ /* "string here" */
+}; /* { dg-warning "missing init" } */
+/* { dg-message "declared here" "near init" { target *-*-* } 27 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20011130-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20011130-1.c
new file mode 100644
index 000000000..60a2738fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20011130-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -g -finline-limit=100" } */
+
+#define WORK(x, y) __asm__ ("" : "=r" (x) : "0" (x)); y += x + 26
+#define SOME_WORK(x, y) WORK(x, y); WORK(x, y); WORK(x, y); WORK(x, y)
+#define MORE_WORK(x, y) SOME_WORK(x, y); SOME_WORK(x, y); SOME_WORK(x, y)
+#define EVEN_MORE_WORK(x, y) MORE_WORK(x, y); MORE_WORK(x, y); MORE_WORK(x, y)
+#define LOTS_OF_WORK(x, y) EVEN_MORE_WORK(x, y); EVEN_MORE_WORK(x, y)
+
+static int __attribute__((unused)) foo (int x)
+{
+ inline int bar (int x)
+ {
+ int y;
+ y = x;
+ LOTS_OF_WORK(x, y);
+ LOTS_OF_WORK(x, y);
+ LOTS_OF_WORK(x, y);
+ LOTS_OF_WORK(x, y);
+ LOTS_OF_WORK(x, y);
+ LOTS_OF_WORK(x, y);
+ return y;
+ }
+ return bar(x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20011214-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20011214-1.c
new file mode 100644
index 000000000..dd05798fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20011214-1.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+extern void abort (void);
+extern void exit (int);
+
+#define small __attribute__((mode(QI))) int
+int main()
+{
+ int x, y = 0x400;
+
+ x = (small) y; /* { dg-bogus "ignored" } */
+ if (sizeof (small) != sizeof (char)) /* { dg-bogus "ignored" } */
+ abort ();
+ if (sizeof (x) != sizeof (char) && x == y)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020103-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020103-1.c
new file mode 100644
index 000000000..4209486b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020103-1.c
@@ -0,0 +1,39 @@
+/* Verify that constant equivalences get reloaded properly, either by being
+ spilled to the stack, or regenerated, but not dropped to memory. */
+/* { dg-do compile { target { { i?86-*-* rs6000-*-* alpha*-*-* x86_64-*-* } || { powerpc*-*-* && ilp32 } } } } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fpic -fno-omit-frame-pointer -fno-asynchronous-unwind-tables" } */
+/* { dg-final { scan-assembler-not "LC\[0-9\]" } } */
+
+/* Clobber all call-saved registers that can hold a pointer value. */
+#if defined(__i386__)
+#define clobber \
+ asm volatile("#asm" : : : "si", "di")
+#elif defined(__powerpc__) || defined(__PPC__) || defined(__ppc__) || defined(__POWERPC__) || defined(PPC) || defined (_IBMR2) || defined (__ppc)
+#define clobber \
+ asm volatile("#asm" : : : "14", "15", "16", "17", "18", "19", "20", \
+ "21", "22", "23", "24", "25", "26", "27", "28", "29")
+#elif defined(__alpha__)
+#define clobber \
+ asm volatile("#asm" : : : "$9", "$10", "$11", "$12", "$13", "$14", \
+ "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8", "$f9")
+#elif defined(__x86_64__)
+#define clobber \
+ asm volatile("#asm" : : : "rcx", "rdx", "rsi", "rdi", "r8", "r9", "r10", "r11")
+#else
+#error no clobber macro defined
+#endif
+
+extern void f1(int, int, int);
+extern void f2(int*, int*, int*);
+
+extern int ext;
+static int loc_small;
+static int loc_big[100];
+
+void bar(void)
+{
+ f1(ext, loc_small, loc_big[0]);
+ clobber;
+ f2(&ext, &loc_small, &loc_big[0]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020104-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020104-1.c
new file mode 100644
index 000000000..be36a7427
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020104-1.c
@@ -0,0 +1,22 @@
+/* Test whether statement with no effect warnings are not given for last
+ statements inside of statement expression. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+void bar (char *p, char *q);
+
+int main()
+{
+ char foo [32], *p;
+
+ ({
+ void *s = (foo);
+ __builtin_memset (s, '\0', sizeof (foo));
+ s; /* { dg-warning "no effect" "statement with no effect warning" } */
+ s; /* { dg-bogus "no effect" "bogus statement with no effect warning" } */
+ });
+ p = foo;
+ p; /* { dg-warning "no effect" "statement with no effect warning" } */
+ bar (foo, p);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020108-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020108-1.c
new file mode 100644
index 000000000..89ffcaa12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020108-1.c
@@ -0,0 +1,17 @@
+/* This testcase failed on i686 because (const_int -1) was changed into
+ (const_int 0xffff) when storing it into SImode pseudo, but was not
+ converted back to (const_int -1) when returning from store_expr,
+ even though target was (subreg:HI (reg/v:SI indx)). But (const_int 0xffff)
+ is not valid general_operand in HImode. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+
+void
+foo (unsigned short *cp)
+{
+ unsigned short indx;
+
+ *cp = indx = 0xFFFF;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020115-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020115-1.c
new file mode 100644
index 000000000..9d4ea5491
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020115-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+/* Test attributes in function arguments. */
+/* Origin: Aldy Hernandez <aldyh@redhat.com>. */
+
+#define blah __attribute__((__mode__(QI)))
+
+extern void bar(int *);
+
+void foo (blah int abc)
+{
+
+ int b[sizeof(abc) == 1 ? 1 : -1];
+ bar (b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020116-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020116-1.c
new file mode 100644
index 000000000..d554675bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020116-1.c
@@ -0,0 +1,16 @@
+/* This testcase ICEd on Alpha because ldq_u argument was not subject to
+ small_symbolic_mem_operand splitting. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fpic -mexplicit-relocs -mcpu=ev4" { target alpha*-*-* } } */
+
+static char a;
+char *b;
+
+void foo (void)
+{
+ register char *c;
+
+ c = b;
+ *c = a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020122-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020122-1.c
new file mode 100644
index 000000000..b13752f64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020122-1.c
@@ -0,0 +1,21 @@
+/* Copyright (C) 2002 Free Software Foundation.
+ by Hans-Peter Nilsson <hp@axis.com> */
+
+/* { dg-do compile } */
+
+typedef struct
+ {
+ unsigned short s;
+ } t;
+
+struct u
+ {
+ t v;
+ };
+
+int
+foo (struct u *uu)
+{
+ int i = ((unsigned int) ((uu->v) & 42)); /* { dg-error "invalid operands to binary" } */
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020122-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020122-2.c
new file mode 100644
index 000000000..249922185
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020122-2.c
@@ -0,0 +1,41 @@
+/* This test was supplied with PR target/5379. It caused the compiler
+ to get a segmentation fault. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern int access( char* );
+extern int a();
+char* foocp();
+
+void
+_KDE_IceGetPoValidAuthIndices (protocol_name, num_indices_ret, indices_ret)
+const char *protocol_name;
+int *num_indices_ret;
+int *indices_ret;
+{
+ int auth_file;
+ char *filename;
+ int index_ret, i;
+
+ if (!(filename = foocp ()))
+ return;
+
+ if (access (filename))
+ return;
+
+ if (auth_file = access (filename))
+ return;
+
+ for (;;)
+ {
+ if (strcmp (protocol_name, protocol_name) == 0 )
+ {
+ for (i = 0; i < *num_indices_ret; i++)
+ if (index_ret == indices_ret[i])
+ break;
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020122-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020122-3.c
new file mode 100644
index 000000000..e39bd23a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020122-3.c
@@ -0,0 +1,15 @@
+/* Check that the combination of -Os and -fprefetch-loop-arrays does not
+ cause the compiler to crash, which it originally did on i?86.
+ Warnings are turned off because not all targets support prefetch. */
+
+/* { dg-do compile } */
+/* { dg-options "-Os -fprefetch-loop-arrays -w" } */
+/* { dg-options "-Os -fprefetch-loop-arrays -mtune=pentium3 -w" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+int foo (int *p, int n)
+{
+ int i, r;
+ for (i = 0; i < n; i++)
+ r += p[i];
+ return r;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020122-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020122-4.c
new file mode 100644
index 000000000..50aef1950
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020122-4.c
@@ -0,0 +1,11 @@
+/* Alpha -msmall-data didn't transform (mem (symbol_ref)) to
+ (mem (lo_sum pic (symbol_ref))) within an asm at the right time. */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+void foo()
+{
+ static int test;
+ int dummy;
+ asm volatile ("" : "=m"(test), "=r"(dummy) : "m"(test));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020201-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020201-1.c
new file mode 100644
index 000000000..1cb2a8788
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020201-1.c
@@ -0,0 +1,38 @@
+/* Check that arc profiling instrumentation code does not cause problems for
+ a program that calls functions that are likely to be in a shared library.
+ This was added to check the fix for PR target/5469, which prevents arc
+ profiling code from being inserted between a call and the restore of the
+ call-clobbered global pointer. */
+
+/* { dg-options "-fprofile-arcs" } */
+/* { dg-do run { target native } } */
+
+#include <stdlib.h>
+
+int globvar;
+
+void
+leave (int i)
+{
+ if (i != 0)
+ abort ();
+ exit (0);
+}
+
+void
+doit ()
+{
+ srand (12);
+ globvar = rand ();
+ if (rand () > 0)
+ globvar = 0;
+ leave (globvar);
+}
+
+int
+main ()
+{
+ doit ();
+}
+
+/* { dg-final { cleanup-coverage-files } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020206-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020206-1.c
new file mode 100644
index 000000000..4b3d0fc76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020206-1.c
@@ -0,0 +1,45 @@
+/* This code is from the beginning of combine_reloads in reload.c in
+ GCC 3.1-20020117, with simplifications. It compiled incorrectly
+ for -O2 -fprefetch-loop-arrays for ix86 targets. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -mtune=pentium3 -w" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+
+struct reload
+{
+ int first_member;
+ int out;
+ int final_member;
+};
+
+int n_reloads;
+struct reload rld[10];
+
+static int
+combine_reloads ()
+{
+ int i;
+ int output_reload = -1;
+ int secondary_out = -1;
+
+ for (i = 0; i < n_reloads; i++)
+ if (rld[i].out != 0)
+ {
+ if (output_reload >= 0)
+ return output_reload;
+ output_reload = i;
+ }
+ return output_reload;
+}
+
+int
+main ()
+{
+ n_reloads = 4;
+ rld[2].out = 2;
+ if (combine_reloads () != 2)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020210-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020210-1.c
new file mode 100644
index 000000000..369963b25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020210-1.c
@@ -0,0 +1,28 @@
+/* This used to fail on H8/300 due to incorrect specification of pushi1. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fomit-frame-pointer" { target h8300-*-* } } */
+
+extern void abort (void);
+extern void exit (int);
+
+void
+bar (int a, int b, int c, int d, int e)
+{
+ if (d != 1)
+ abort ();
+}
+
+void
+foo (int a, int b, int c, int d, int e)
+{
+ bar (a, b, c, d, e);
+}
+
+int
+main ()
+{
+ foo (0, 0, 0, 1, 2);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020219-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020219-1.c
new file mode 100644
index 000000000..d2ba755f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020219-1.c
@@ -0,0 +1,50 @@
+/* PR c/4389
+ This testcase failed because host_integerp (x, 0) was returning
+ 1 even for constants bigger than 2^31. It fails under under hppa
+ hpux without -mdisable-indexing because the pointer x - 1 is used
+ as the base address of an indexed load. Because the struct A is not
+ actually allocated, x - 1 lies in the text segment and this causes
+ the wrong space register to be selected for the load. It fails on
+ IA64 hpux in ILP32 mode because extending x - 1 before adding the
+ array offset gives a different answer then adding first and then
+ extending. The underlying problem is the same as with hppa, x - 1 is
+ not a legal data address. It also fails on x32 targets for the
+ same reason. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mdisable-indexing" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { aarch64*-*-* && ilp32 } { "*" } { "" } } */
+/* { dg-skip-if "" { "ia64-*-hpux*" } "*" "-mlp64" } */
+/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && x32 } { "*" } { "" } } */
+
+/* Disable the test entirely for 16-bit targets. */
+#if __INT_MAX__ > 32767
+
+extern void abort (void);
+extern void exit (int);
+struct A {
+ int a[10000][10000];
+};
+int b[2] = { 213151, 0 };
+
+void foo (struct A *x, int y)
+{
+ if (x->a[9999][9999] != x->a[y][y])
+ abort ();
+ if (x->a[9999][9999] != 213151)
+ abort ();
+}
+
+int main (void)
+{
+ struct A *x;
+ asm ("" : "=r" (x) : "0" (&b[1]));
+ foo (x - 1, 9999);
+ exit (0);
+}
+
+#else
+
+int main () { return 0; }
+
+#endif /* __INT_MAX__ */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020220-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020220-1.c
new file mode 100644
index 000000000..aa948aa15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020220-1.c
@@ -0,0 +1,19 @@
+/* PR c++/4574
+ This testcase ICEd because expand_and did not handle VOIDmode
+ CONST_DOUBLE arguments. */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+struct A {
+ unsigned long long b : 8;
+ unsigned long long c : 18;
+};
+
+int main()
+{
+ struct A a;
+ long long l;
+
+ l = a.c = 0x123456789aULL;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020220-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020220-2.c
new file mode 100644
index 000000000..95606703c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020220-2.c
@@ -0,0 +1,12 @@
+/* PR c/4697
+ Test whether operand has no effect warning is given for compound
+ expression. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wunused" } */
+
+int b;
+int foo (int a)
+{
+ a = a + 1, 5 * b; /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020222-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020222-1.c
new file mode 100644
index 000000000..d2cf5fe6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020222-1.c
@@ -0,0 +1,34 @@
+/* PR optimization/5747
+ This testcase ICEd on sparc because move_movables created new pseudos,
+ but did not update reg info which load_mems needed. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fPIC" { target fpic } } */
+
+extern void foo (void);
+static char a[256];
+
+void
+bar (void)
+{
+ unsigned int i;
+ static int b = 0;
+ int c;
+
+ if (b == 0)
+ {
+ b = 1;
+ foo ();
+ c = 0;
+ for (i = 0; i < 10; i++)
+ a[i + '0'] = c++;
+ for (i = 'A'; i <= 'Z'; i++)
+ a[i] = c++;
+ a['$'] = c++;
+ a['%'] = c++;
+ a['.'] = c++;
+ a['_'] = c++;
+ for (i = 'a'; i <= 'z'; i++)
+ a[i] = c++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020310-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020310-1.c
new file mode 100644
index 000000000..7f35e9b09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020310-1.c
@@ -0,0 +1,54 @@
+/* PR optimization/5844
+ This testcase was miscompiled because of an rtx sharing bug. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i586" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+struct A
+{
+ struct A *a;
+ int b;
+};
+
+struct B
+{
+ struct A *c;
+ unsigned int d;
+};
+
+struct A p = { &p, -1 };
+struct B q = { &p, 0 };
+
+extern void abort (void);
+extern void exit (int);
+
+struct B *
+foo (void)
+{
+ return &q;
+}
+
+void
+bar (void)
+{
+ struct B *e = foo ();
+ struct A *f = e->c;
+ int g = f->b;
+
+ if (++g == 0)
+ {
+ e->d++;
+ e->c = f->a;
+ }
+
+ f->b = g;
+}
+
+int
+main ()
+{
+ bar ();
+ if (p.b != 0 || q.d != 1 || q.c != &p)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020312-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020312-1.c
new file mode 100644
index 000000000..978401862
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020312-1.c
@@ -0,0 +1,10 @@
+/* This testcase ICEd on alpha because of an unrecognized insn formed
+ by conditional move optimization using an incorrect mode. */
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math" } */
+
+char*
+barf (double x)
+{
+ return (x<0.0) ? "foo" : "bar";
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020312-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020312-2.c
new file mode 100644
index 000000000..63fbfcc5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020312-2.c
@@ -0,0 +1,162 @@
+/* PR 5878.
+
+ We ICEd in verify_local_live_at_start because we incorrectly forced
+ the PIC register live between BAR and BAZ. We did this because the
+ definition of PIC_OFFSET_TABLE_REGNUM was incorrectly not INVALID_REGNUM
+ when !flag_pic for most targets. */
+
+/* { dg-do run } */
+/* { dg-options "-O -fno-pic" } */
+
+extern void abort (void);
+
+#if defined(__alpha__)
+/* PIC register is $29, but is used even without -fpic. */
+#elif defined(__arc__)
+# define PIC_REG "26"
+#elif defined(__arm__)
+# define PIC_REG "9"
+#elif defined(AVR)
+/* No pic register. */
+#elif defined(__cris__)
+# define PIC_REG "0"
+#elif defined(__epiphany__)
+#define PIC_REG "r28"
+#elif defined(__fr30__)
+/* No pic register. */
+#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__)
+/* No pic register. */
+#elif defined(_IBMR2)
+/* No pic register. */
+#elif defined(__i386__)
+# define PIC_REG "ebx"
+#elif defined(__ia64__)
+/* PIC register is r1, but is used even without -fpic. */
+#elif defined(__lm32__)
+/* No pic register. */
+#elif defined(__M32R__)
+/* No pic register. */
+#elif defined(__m68k__)
+# define PIC_REG "a5"
+#elif defined(__mc68hc1x__)
+/* No pic register. */
+#elif defined(__mcore__)
+/* No pic register. */
+#elif defined(__MICROBLAZE__)
+# define PIC_REG "r20"
+#elif defined(__mips__)
+/* PIC register is $28, but is used even without -fpic. */
+#elif defined(__MMIX__)
+/* No pic register. */
+#elif defined(__mn10300__)
+/* No pic register. */
+#elif defined(__moxie__)
+/* No pic register. */
+#elif defined(__nds32__)
+/* No pic register. */
+#elif defined(__nios2__)
+/* No pic register. */
+#elif defined(__hppa__)
+/* PIC register is %r27 or %r19, but is used even without -fpic. */
+#elif defined(__pdp11__)
+/* No pic register. */
+#elif defined(__powerpc__) || defined(__PPC__) || defined(__POWERPC__) || defined (__ppc)
+# ifdef __MACH__
+# define PIC_REG "31"
+# else
+# define PIC_REG "30"
+# endif
+#elif defined(__RX__)
+/* No pic register. */
+#elif defined(__s390__)
+# define PIC_REG "12"
+#elif defined(__sparc__)
+# define PIC_REG "l7"
+#elif defined(__tile__)
+# define PIC_REG "r51"
+#elif defined(__TMS320C6X__)
+# define PIC_REG "B14"
+#elif defined(__v850)
+/* No pic register. */
+#elif defined(__vax__)
+/* No pic register. */
+#elif defined(__xstormy16__)
+/* No pic register. */
+#elif defined(__XTENSA__)
+/* No pic register. */
+#elif defined(__sh__)
+# define PIC_REG "r12"
+#elif defined(__x86_64__)
+/* No pic register. */
+#elif defined(__m32c__)
+/* No pic register. */
+#elif defined(__SPU__)
+# define PIC_REG "126"
+#elif defined (__frv__)
+# ifdef __FRV_FDPIC__
+# define PIC_REG "gr15"
+# else
+# define PIC_REG "gr17"
+#endif
+#elif defined (__aarch64__)
+/* No pic register -- yet. */
+#elif defined(__RL78__)
+/* No pic register. */
+#elif defined(__MSP430__)
+/* No pic register. */
+#else
+# error "Modify the test for your target."
+#endif
+
+#if defined PIC_REG && !defined __PIC__ && !defined __pic__
+register void *reg __asm__(PIC_REG);
+#else
+/* We really need a global register variable set to the PIC register
+ to expose the bug. Oh well, let the test case not fail. */
+static void *reg;
+#endif
+
+void * __attribute__((noinline))
+dummy (void *x)
+{
+ return x;
+}
+
+void
+f (void)
+{
+ goto *dummy (&&bar);
+ for (;;)
+ {
+ foo:
+ reg = (void *) 1;
+ if (!reg)
+ goto baz;
+ reg = &&foo;
+ }
+
+ bar:
+ baz:
+ reg = 0;
+}
+
+int
+main()
+{
+ void *old_reg = reg;
+ reg = (void *) 1;
+
+ f ();
+
+ /* Additionally test that the prologue/epilogue properly does *not*
+ save and restore global registers. Not possible when the PIC
+ register is in a register window, of course. On Darwin, you can't
+ call library routines from non-PIC code. */
+#if !defined (__sparc__) && !defined(__MACH__)
+ if (reg)
+ abort ();
+#endif
+
+ reg = old_reg;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020319-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020319-1.c
new file mode 100644
index 000000000..46a756d77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020319-1.c
@@ -0,0 +1,10 @@
+/* PR optimization/5999
+ This testcase ICEd because one a/b -> a * (1/b) optimization
+ did not handle complex divides. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+__complex__ double foo (__complex__ double x, __complex__ double y)
+{
+ return x / y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020411-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020411-1.c
new file mode 100644
index 000000000..55ca2997c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020411-1.c
@@ -0,0 +1,54 @@
+/* PR c/6223
+ This testcase ICEd in internal check because a constant was not truncated
+ for its mode. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#if __INT_MAX__ > 32767
+
+typedef struct
+{
+ unsigned a : 16;
+ unsigned b : 16;
+ unsigned c : 5;
+ unsigned d : 2;
+ unsigned e : 1;
+ unsigned f : 4;
+ unsigned g : 1;
+ unsigned h : 1;
+ unsigned i : 1;
+ unsigned j : 1;
+} T;
+
+inline void
+foo (T *x, unsigned int y)
+{
+ if ((x->j = (y >= 0x100000)))
+ y >>= 12;
+ x->a = y;
+ x->f = (y >> 16);
+}
+
+void __attribute__((noinline))
+bar (T *x)
+{
+}
+
+void
+baz (unsigned int x, unsigned char y)
+{
+ T t;
+
+ foo (&t, x - 1);
+ t.e = 1;
+ t.c = y;
+ t.g = 0;
+ t.h = 0;
+ t.i = (y & 0x40) != 0;
+ if (x == 1)
+ foo (&t, 1);
+ bar (&t);
+}
+
+#endif /* __INT_MAX__ */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020415-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020415-1.c
new file mode 100644
index 000000000..7d5b5aebd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020415-1.c
@@ -0,0 +1,35 @@
+/* PR target/6303
+ This testcase ICEd because s390 did not define
+ ASM_SIMPLIFY_DWARF_ADDR hook. */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic -g" } */
+
+static inline char *
+bar (unsigned long x, char *y)
+{
+ extern const char ext[];
+ const char *a = ext;
+ char *b = y;
+
+ do *--b = a[x % 10]; while ((x /= 10) != 0);
+ return b;
+}
+
+struct A { char *p, *q; };
+struct B { int r, s; };
+
+int
+foo (struct A *a, const struct B *b)
+{
+ char c[(b->r > b->s) ? b->r : b->s];
+ char *d = &c[sizeof c];
+ register char *e;
+
+ e = bar (b->r, d);
+ while (e < d)
+ {
+ register const int f = *e++;
+ if (((a->p >= a->q) ? 1 : (unsigned char) (*a->p++ = f)) == -1)
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020418-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020418-1.c
new file mode 100644
index 000000000..7314ec000
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020418-1.c
@@ -0,0 +1,26 @@
+/* PR optimization/5887 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -msse -ffast-math" { target i?86-*-* x86_64-*-* } } */
+
+void bar (float *a, float *b);
+
+void foo (char *x)
+{
+ float a, b;
+ char c[256];
+ int i, j;
+
+ bar (&a, &b);
+ for (i = 0; i < 256; i++)
+ {
+ float v = a;
+ if (v < 0.0f) v = 0.0f;
+ if (v < 255.0f) v = 255.0f;
+ c[i] = v;
+ a += b;
+ }
+
+ for (j = 0; j < 256; j++)
+ x[j] = c[j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020418-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020418-2.c
new file mode 100644
index 000000000..56094e71c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020418-2.c
@@ -0,0 +1,21 @@
+/* PR optimization/6010 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-all-loops" } */
+/* { dg-options "-O2 -funroll-all-loops -march=pentium3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+void bar (float);
+
+void foo (float y, unsigned long z)
+{
+ int b;
+ float c = y;
+
+ for (b = 0; b < z; b++)
+ {
+ bar (c);
+ if (c == y)
+ c = -y;
+ else
+ c = y;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020425-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020425-1.c
new file mode 100644
index 000000000..7783c8870
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020425-1.c
@@ -0,0 +1,15 @@
+/* PR c/2161: parser stack overflow. */
+/* { dg-do compile } */
+/* { dg-timeout-factor 4.0 } */
+
+#define ONE else if (0) { }
+#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THOU HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+void foo()
+{
+ if (0) { }
+ /* 11,000 else if's. */
+ THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020426-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020426-2.c
new file mode 100644
index 000000000..9ad7a54f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020426-2.c
@@ -0,0 +1,176 @@
+/* PR optimization/6475
+ Distilled from zlib sources. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && { ia32 && fpic } } } } */
+
+extern void exit (int);
+
+typedef struct
+{
+ union
+ {
+ struct
+ {
+ unsigned char a3;
+ unsigned char a4;
+ } a2;
+ unsigned int a5;
+ } a0;
+ unsigned int a1;
+} A;
+
+static int
+foo (unsigned int *b, unsigned int n, unsigned int s, const unsigned int *d,
+ const unsigned int *e, A **t, unsigned int *m, A *hp, unsigned int *hn,
+ unsigned int *v)
+{
+ unsigned int a, c[15 + 1], f;
+ int g, h;
+ unsigned int i, j, k;
+ int l;
+ unsigned int ee;
+ unsigned int *p;
+ A *q, r, *u[15];
+ int w;
+ unsigned int x[15 + 1], *xx;
+ int y;
+ unsigned int z;
+ p = c;
+ *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
+ *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
+ *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
+ *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0;
+ p = b;
+ i = n;
+ do
+ c[*p++]++;
+ while (--i);
+ if (c[0] == n)
+ {
+ *t = (A *) 0;
+ *m = 0;
+ return 0;
+ }
+ l = *m;
+ for (j = 1; j <= 15; j++)
+ if (c[j])
+ break;
+ k = j;
+ if ((unsigned int) l < j)
+ l = j;
+ for (i = 15; i; i--)
+ if (c[i])
+ break;
+ g = i;
+ if ((unsigned int) l > i)
+ l = i;
+ *m = l;
+ for (y = 1 << j; j < i; j++, y <<= 1)
+ if ((y -= c[j]) < 0)
+ return -3;
+ if ((y -= c[i]) < 0)
+ return -3;
+ c[i] += y;
+ x[1] = j = 0;
+ p = c + 1;
+ xx = x + 2;
+ while (--i)
+ *xx++ = (j += *p++);
+ p = b;
+ i = 0;
+ do
+ if ((j = *p++) != 0)
+ v[x[j]++] = i;
+ while (++i < n);
+ n = x[g];
+ x[0] = i = 0;
+ p = v;
+ h = -1;
+ w = -l;
+ u[0] = (A *) 0;
+ q = (A *) 0;
+ z = 0;
+ for (; k <= g; k++)
+ {
+ a = c[k];
+ while (a--)
+ {
+ while (k > w + l)
+ {
+ h++;
+ w += l;
+ z = g - w;
+ z = z > (unsigned int) l ? l : z;
+ if ((f = 1 << (j = k - w)) > a + 1)
+ {
+ f -= a + 1;
+ xx = c + k;
+ if (j < z)
+ while (++j < z)
+ {
+ if ((f <<= 1) <= *++xx)
+ break;
+ f -= *xx;
+ }
+ }
+ z = 1 << j;
+ if (*hn + z > 1440)
+ return -3;
+ u[h] = q = hp + *hn;
+ *hn += z;
+ if (h)
+ {
+ x[h] = i;
+ r.a0.a2.a4 = (unsigned char) l;
+ r.a0.a2.a3 = (unsigned char) j;
+ j = i >> (w - l);
+ r.a1 = (unsigned int) (q - u[h - 1] - j);
+ u[h - 1][j] = r;
+ }
+ else
+ *t = q;
+ }
+ r.a0.a2.a4 = (unsigned char) (k - w);
+ if (p >= v + n)
+ r.a0.a2.a3 = 128 + 64;
+ else if (*p < s)
+ {
+ r.a0.a2.a3 = (unsigned char) (*p < 256 ? 0 : 32 + 64);
+ r.a1 = *p++;
+ }
+ else
+ {
+ r.a0.a2.a3 = (unsigned char) (e[*p - s] + 16 + 64);
+ r.a1 = d[*p++ - s];
+ }
+ f = 1 << (k - w);
+ for (j = i >> w; j < z; j += f)
+ q[j] = r;
+ for (j = 1 << (k - 1); i & j; j >>= 1)
+ i ^= j;
+ i ^= j;
+ ee = (1 << w) - 1;
+ while ((i & ee) != x[h])
+ {
+ h--;
+ w -= l;
+ ee = (1 << w) - 1;
+ }
+ }
+ }
+ return y != 0 && g != 1 ? (-5) : 0;
+}
+
+unsigned int a[19] = { 3, 4, 0, 2, 2, [17] = 3, 3 };
+unsigned int d[19];
+A h[1440];
+
+int
+main (void)
+{
+ unsigned int b = 0, c = 0;
+ A *e = 0;
+ foo (a, 19, 19, 0, 0, &e, &b, h, &c, d);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020430-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020430-1.c
new file mode 100644
index 000000000..8fcdfba0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020430-1.c
@@ -0,0 +1,190 @@
+/* PR opt/6516 */
+/* On x86, something about the structure of this function prevented
+ cross-jumping from combining the three arms of the switch statement
+ until the last moment. After which we did not delete dead code,
+ which left a reference to the deleted ADDR_VEC. */
+
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -frename-registers -fpic" } */
+
+typedef unsigned long XID;
+typedef XID Window;
+typedef void Display;
+typedef unsigned long Time;
+
+typedef struct {
+ int type;
+ unsigned long serial;
+ int send_event;
+ Display *display;
+ Window window;
+ Window root;
+ Window subwindow;
+ Time time;
+ int x, y;
+ int x_root, y_root;
+ unsigned int state;
+ unsigned int button;
+ int same_screen;
+} XButtonEvent;
+typedef struct {
+ int type;
+ unsigned long serial;
+ int send_event;
+ Display *display;
+ Window window;
+ Window root;
+ Window subwindow;
+ Time time;
+ int x, y;
+ int x_root, y_root;
+ unsigned int state;
+ char is_hint;
+ int same_screen;
+} XMotionEvent;
+typedef struct {
+ int type;
+ unsigned long serial;
+ int send_event;
+ Display *display;
+ Window window;
+ Window root;
+ Window subwindow;
+ Time time;
+ int x, y;
+ int x_root, y_root;
+ int mode;
+ int detail;
+ int same_screen;
+ int focus;
+ unsigned int state;
+} XCrossingEvent;
+typedef union _XEvent {
+ int type;
+ XButtonEvent xbutton;
+ XMotionEvent xmotion;
+ XCrossingEvent xcrossing;
+} XEvent;
+
+typedef struct {
+ int width, height;
+ Display *display;
+} Screen;
+typedef struct _CorePart {
+ Screen *screen;
+} CorePart;
+typedef struct _WidgetRec {
+ CorePart core;
+} WidgetRec;
+typedef struct _WidgetRec *Widget;
+
+typedef struct _SmeRec *SmeObject;
+typedef struct _SimpleMenuPart {
+ SmeObject entry_set;
+} SimpleMenuPart;
+typedef struct _SimpleMenuRec {
+ SimpleMenuPart simple_menu;
+} SimpleMenuRec;
+typedef struct _SimpleMenuRec* SimpleMenuWidget;
+
+typedef short Position;
+typedef unsigned short Dimension;
+typedef char Boolean;
+
+typedef struct _RectObjPart {
+ Position x, y;
+ Dimension width, height;
+ Dimension border_width;
+ Boolean managed;
+ Boolean sensitive;
+ Boolean ancestor_sensitive;
+}RectObjPart;
+typedef struct _RectObjRec {
+ RectObjPart rectangle;
+} RectObjRec;
+typedef struct _RectObjRec *RectObj;
+
+SmeObject DoGetEventEntry();
+
+SmeObject
+GetEventEntry(Widget w, XEvent *event)
+{
+ int x_loc, y_loc, x_root;
+ SimpleMenuWidget smw = (SimpleMenuWidget)w;
+ SmeObject entry;
+ int warp, move;
+ switch (event->type) {
+ case 6:
+ x_loc = event->xmotion.x;
+ y_loc = event->xmotion.y;
+ x_root = event->xmotion.x_root;
+ break;
+ case 7:
+ case 8:
+ x_loc = event->xcrossing.x;
+ y_loc = event->xcrossing.y;
+ x_root = event->xcrossing.x_root;
+ break;
+ case 4:
+ case 5:
+ x_loc = event->xbutton.x;
+ y_loc = event->xbutton.y;
+ x_root = event->xbutton.x_root;
+ break;
+ default:
+ XtAppError(XtWidgetToApplicationContext(w),
+ "Unknown event type in GetEventEntry().");
+ return (((void *)0));
+ }
+ if (x_loc < 0 || x_loc >= (((RectObj)smw)->rectangle.width) ||
+ y_loc < 0 || y_loc >= (((RectObj)smw)->rectangle.height))
+ return (((void *)0));
+ if (x_root == ((((w)->core.screen))->width) - 1 &&
+ (((RectObj)w)->rectangle.x) + (((RectObj)w)->rectangle.width) + ((((RectObj)w)->rectangle.border_width)) > x_root) {
+ warp = -8;
+ if (smw->simple_menu.entry_set) {
+ entry = DoGetEventEntry(w,
+ (((RectObj)smw->simple_menu.entry_set)->rectangle.x)
+ + (((RectObj)smw->simple_menu.entry_set)->rectangle.width) + 1,
+ y_loc);
+ Unhighlight(w, event, ((void *)0), ((void *)0));
+ if (entry) {
+ warp = -(int)(((RectObj)entry)->rectangle.width) >> 1;
+ move = x_loc - (((RectObj)entry)->rectangle.width) - (((RectObj)entry)->rectangle.x) + (((RectObj)w)->rectangle.border_width);
+ }
+ else {
+ warp = 0;
+ move = ((((w)->core.screen))->width) -
+ ((((RectObj)w)->rectangle.x) + (((RectObj)w)->rectangle.width) + ((((RectObj)w)->rectangle.border_width) << 1));
+ }
+ }
+ else {
+ warp = 0;
+ move = ((((w)->core.screen))->width) -
+ ((((RectObj)w)->rectangle.x) + (((RectObj)w)->rectangle.width) + ((((RectObj)w)->rectangle.border_width) << 1));
+ }
+ }
+ else if (x_root == 0 && (((RectObj)w)->rectangle.x) < 0) {
+ warp = 8;
+ if (smw->simple_menu.entry_set) {
+ entry = DoGetEventEntry(w, (((RectObj)smw->simple_menu.entry_set)->rectangle.x) - 1,
+ y_loc);
+ Unhighlight(w, event, ((void *)0), ((void *)0));
+ if (entry) {
+ warp = (((RectObj)entry)->rectangle.width) >> 1;
+ move = x_loc - (((RectObj)entry)->rectangle.x);
+ }
+ else
+ move = x_loc + (((RectObj)w)->rectangle.border_width);
+ }
+ else
+ move = x_loc + (((RectObj)w)->rectangle.border_width);
+ }
+ else
+ move = warp = 0;
+ if (move)
+ XtMoveWidget(w, (((RectObj)w)->rectangle.x) + move, (((RectObj)w)->rectangle.y));
+ if (warp)
+ XWarpPointer((((w)->core.screen)->display), 0L, 0L, 0, 0, 0, 0, warp, 0);
+ return (DoGetEventEntry(w, x_loc, y_loc));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020503-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020503-1.c
new file mode 100644
index 000000000..e13cf954e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020503-1.c
@@ -0,0 +1,11 @@
+/* PR target/6542
+ This testcase caused ICE on SPARC because the function uses no registers
+ after optimizing, so even if -mflat make all registers not permitted
+ for leaf functions, the function was still leaf, but LEAF_REG_REMAP
+ returned -1 for some registers (like %o0). */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -mflat" { target sparc*-*-* } } */
+
+void foo (char *a, char *b, char *c, char *d)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020517-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020517-1.c
new file mode 100644
index 000000000..74c6b3e6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020517-1.c
@@ -0,0 +1,28 @@
+/* This testcase caused ICE in do_SUBST on IA-32, because 0xf6 constant
+ was not sign-extended for QImode. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#include <limits.h>
+
+void abort (void);
+void exit (int);
+
+void foo (void)
+{
+ int i;
+ char *p;
+
+ p = (char *) &i;
+ *p = -10;
+ if (* (unsigned char *) p != 0x100 - 10)
+ abort ();
+}
+
+int main (void)
+{
+ if (UCHAR_MAX == 255)
+ foo ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020525-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020525-1.c
new file mode 100644
index 000000000..7db44f0b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020525-1.c
@@ -0,0 +1,24 @@
+/* PR optimization/6703
+ Origin: Glen Nakamura <glen@imodulo.com> */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+void foo (int *x, int y)
+{
+ __builtin_memset (x, 0, y);
+}
+
+int main ()
+{
+ int x[2] = { -1, -1 };
+
+ if (x[1] != -1)
+ abort ();
+ foo (x, sizeof (int) + 1);
+ if (x[1] == -1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020527-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020527-1.c
new file mode 100644
index 000000000..6f963ed9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020527-1.c
@@ -0,0 +1,54 @@
+/* PR c/6660
+ Test whether an unnamed field with user defined type - struct or union is
+ accepted. */
+/* { dg-do compile } */
+/* { dg-options "-fms-extensions" } */
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+} __attribute__ ((__packed__)) A;
+
+typedef struct B_ {
+ unsigned int c;
+ unsigned int d;
+} B;
+
+typedef struct C_ {
+ B;
+ unsigned int e;
+ unsigned int f;
+} C;
+
+typedef C D;
+
+typedef struct {
+ A;
+ D;
+ struct {
+ unsigned short g;
+ unsigned short h;
+ } __attribute__ ((__packed__));
+ union {
+ int i;
+ long j;
+ };
+ int k;
+} __attribute__ ((__packed__)) E;
+
+E x;
+
+void foo (void)
+{
+ x.a = 1;
+ x.b = 2;
+ x.c = 3;
+ x.d = 4;
+ x.e = 5;
+ x.f = 6;
+ x.g = 7;
+ x.h = 8;
+ x.i = 9;
+ x.j = 10;
+ x.k = 11;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020530-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020530-1.c
new file mode 100644
index 000000000..b2d0ecda5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020530-1.c
@@ -0,0 +1,20 @@
+/* PR c/6809
+ Test -fverbose-asm with unnamed fields. */
+/* { dg-do compile } */
+/* { dg-options "-fverbose-asm" } */
+
+typedef union U
+{
+ struct
+ {
+ unsigned int a;
+ int b;
+ };
+ long long c;
+} *T;
+
+int foo (T x)
+{
+ int r = x->a + x->b;
+ return r;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020607-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020607-1.c
new file mode 100644
index 000000000..afad78d8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020607-1.c
@@ -0,0 +1,40 @@
+/* PR middle-end/6950
+ gcc 3.0.4 mistakenly set lhs.low to 0 at the beginning of the num_eq
+ expansion; it should use a temporary.
+/* { dg-do run } */
+
+typedef struct cpp_num cpp_num;
+struct cpp_num
+{
+ long high;
+ long low;
+ char overflow;
+};
+
+#define num_eq(num1, num2) (num1.low == num2.low && num1.high == num2.high)
+
+static cpp_num
+num_equality_op (lhs, rhs)
+ cpp_num lhs, rhs;
+{
+ lhs.low = num_eq (lhs, rhs);
+ lhs.high = 0;
+ lhs.overflow = 0;
+ return lhs;
+}
+
+int main()
+{
+ cpp_num a = { 1, 2 };
+ cpp_num b = { 3, 4 };
+
+ cpp_num result = num_equality_op (a, b);
+ if (result.low)
+ return 1;
+
+ result = num_equality_op (a, a);
+ if (!result.low)
+ return 2;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020607-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020607-2.c
new file mode 100644
index 000000000..239aa9b38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020607-2.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 2002 Free Software Foundation.
+
+ Test for correctness of floating point comparisons.
+
+ Written by Roger Sayle, 3rd June 2002. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void abort (void);
+
+int test1 (double x, int ok)
+{
+ if ((x - 1.0) > 0.0)
+ {
+ if (!ok) abort ();
+ }
+ else
+ if (ok) abort ();
+}
+
+int test1f (float x, int ok)
+{
+ if ((x - 1.0f) > 0.0f)
+ {
+ if (!ok) abort ();
+ }
+ else
+ if (ok) abort ();
+}
+
+int test2 (double x, int ok)
+{
+ if ((x + 1.0) < 0.0)
+ {
+ if (!ok) abort ();
+ }
+ else
+ if (ok) abort ();
+}
+
+int test2f (float x, int ok)
+{
+ if ((x + 1.0f) < 0.0f)
+ {
+ if (!ok) abort ();
+ }
+ else
+ if (ok) abort ();
+}
+
+
+int
+main ()
+{
+ test1 (-2.0, 0);
+ test1 ( 0.0, 0);
+ test1 ( 2.0, 1);
+
+ test1f (-2.0f, 0);
+ test1f ( 0.0f, 0);
+ test1f ( 2.0f, 1);
+
+ test2 (-2.0, 1);
+ test2 ( 0.0, 0);
+ test2 ( 2.0, 0);
+
+ test2f (-2.0f, 1);
+ test2f ( 0.0f, 0);
+ test2f ( 2.0f, 0);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20020919-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20020919-1.c
new file mode 100644
index 000000000..dfb072109
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20020919-1.c
@@ -0,0 +1,258 @@
+/* Copyright (C) 2002 Free Software Foundation.
+ by Hans-Peter Nilsson <hp@axis.com>
+
+ Making sure that asm clobbers conflicting with asm-declared input
+ operands are detected: ``You may not write a clobber description in a
+ way that overlaps with an input or output operand''.
+
+ You must be this tall ---> fit two long longs in asm-declared registers
+ to enter this amusement. */
+
+/* { dg-do compile { target alpha*-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
+/* { dg-options "-O2" } */
+
+/* Constructed examples; input/output (same register), output, input, and
+ input and output (different registers). */
+
+/* The long longs are used to test overlap overlap for multi-register
+ registers. REG2 and REG4 must be the second halves (defined as
+ higher-numbered parts) of REG1 and REG3 respectively when two registers
+ are needed. */
+
+#if defined (__alpha__)
+# define REG1 "$1"
+# define REG2 "$2"
+#elif defined (__CRIS__)
+# define REG1 "r10"
+# define REG2 "r11"
+# define REG3 "r12"
+# define REG4 "r13"
+# define REG5 "r9"
+#elif defined (__i386__)
+# define REG1 "%eax"
+# define REG2 "%edx"
+/* On Darwin -fpic is on by default, so don't use %ebx. */
+# define REG3 "%esi"
+# define REG4 "%edi"
+#elif defined (__MMIX__)
+# define REG1 "$8"
+# define REG2 "$9"
+#elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
+ || defined (__POWERPC__) || defined (PPC) || defined (_IBMR2) \
+ || defined (__ppc)
+# define REG1 "6"
+# define REG2 "7"
+# if !defined(__powerpc64__) && !defined(__LP64__)
+# define REG3 "8"
+# define REG4 "9"
+# endif
+#elif defined (__x86_64__)
+# define REG1 "rax"
+# define REG2 "rdx"
+#endif
+
+/* For readability of the tests. */
+#ifdef REG3
+# define REG1a REG1
+# define REG1b REG2
+# define REG2a REG3
+# define REG2b REG4
+#else
+# define REG1a REG1
+# define REG1b REG1
+# define REG2a REG2
+# define REG2b REG2
+#endif
+
+/* REG5 is just another reg if there is one; the difference to REG4 is to
+ keep the original set of registers for CRIS. */
+#ifndef REG5
+#define REG5 REG2b
+#endif
+
+void *
+foo (void *p)
+{
+ register void *q asm (REG1) = p;
+ asm ("foo1 %0" : "=r" (q) : "0" (q) : REG1); /* { dg-error "conflict" } */
+ return q;
+}
+
+void *
+nfoo (void *p)
+{
+ register void *q asm (REG1) = p;
+ asm ("foo1 %0" : "=r" (q) : "0" (q) : REG2);
+ return q;
+}
+
+long long
+foolla (long long llp)
+{
+ register long long ll asm (REG1a) = llp;
+ asm ("foo1a %0" : "=r" (ll) : "0" (ll) : REG1a); /* { dg-error "conflict" } */
+ return ll;
+}
+
+long long
+nfoolla (long long llp)
+{
+ register long long ll asm (REG1a) = llp;
+ asm ("foo1a %0" : "=r" (ll) : "0" (ll) : REG2a);
+ return ll;
+}
+
+long long
+foollb (long long llp)
+{
+ register long long ll asm (REG1a) = llp;
+ asm ("foo1b %0" : "=r" (ll) : "0" (ll) : REG1b); /* { dg-error "conflict" } */
+ return ll;
+}
+
+void *
+bar (void *p)
+{
+ register void *q asm (REG1);
+ register void *w asm (REG2) = p;
+ asm ("bar1 %1,%0" : "=r" (q) : "r" (w) : REG1); /* { dg-error "conflict" } */
+ return q;
+}
+
+long long
+barlla (long long llp)
+{
+ register long long ll asm (REG1a);
+ register long long mm asm (REG2a) = llp;
+ asm ("bar1a %1,%0" : "=r" (ll) : "r" (mm) : REG1b); /* { dg-error "conflict" } */
+ return ll;
+}
+
+long long
+barllb (long long llp)
+{
+ register long long ll asm (REG1a);
+ register long long mm asm (REG2a) = llp;
+ asm ("bar1b %1,%0" : "=r" (ll) : "r" (mm) : REG2b); /* { dg-error "conflict" } */
+ return ll;
+}
+
+void *
+foobar (void *p)
+{
+ register void *q asm (REG1);
+ register void *w asm (REG2) = p;
+ asm ("foobar1 %1,%0" : "=r" (q) : "r" (w) : REG2); /* { dg-error "conflict" } */
+ return q;
+}
+
+void *
+nfoobar (void *p)
+{
+ register void *q asm (REG1);
+ register void *w = p;
+ asm ("foobar1 %1,%0" : "=r" (q) : "r" (w) : REG2);
+ return q;
+}
+
+long long
+foobarlla (long long llp)
+{
+ register long long ll asm (REG1a);
+ register long long mm asm (REG2a) = llp;
+ asm ("foobar1a %1,%0" : "=r" (ll) : "r" (mm) : REG1b); /* { dg-error "conflict" } */
+ return ll;
+}
+
+long long
+nfoobarlla (long long llp)
+{
+ register long long ll asm (REG1a);
+ register long long mm = llp;
+ asm ("foobar1a %1,%0" : "=r" (ll) : "r" (mm) : REG2a);
+ return ll;
+}
+
+long long
+foobarllb (long long llp)
+{
+ register long long ll asm (REG1a);
+ register long long mm asm (REG2a) = llp;
+ asm ("foobar1b %1,%0" : "=r" (ll) : "r" (mm) : REG2b); /* { dg-error "conflict" } */
+ return ll;
+}
+
+long long
+nfoobarllb (long long llp)
+{
+ register long long ll asm (REG1a);
+ register long long mm = llp;
+ asm ("foobar1b %1,%0" : "=r" (ll) : "r" (mm) : REG2b);
+ return ll;
+}
+
+void *
+baz (void *p)
+{
+ register void *q asm (REG1);
+ register void *w asm (REG2) = p;
+ asm ("baz1 %1,%0" : "=r" (q) : "r" (w) : REG1, REG2); /* { dg-error "conflict" } */
+ return q;
+}
+
+void *
+nbaz (void *p)
+{
+ register void *q;
+ register void *w = p;
+ asm ("baz1 %1,%0" : "=r" (q) : "r" (w) : REG1, REG2);
+ return q;
+}
+
+void *
+nbaz2 (void *p)
+{
+ register void *q asm (REG1);
+ register void *w asm (REG2) = p;
+ asm ("baz1 %1,%0" : "=r" (q) : "r" (w));
+ return q;
+}
+
+long long
+bazlla (long long llp)
+{
+ register long long ll asm (REG1a);
+ register long long mm asm (REG2a) = llp;
+ asm ("baz1a %1,%0" : "=r" (ll) : "r" (mm) : REG1a, REG2a); /* { dg-error "conflict" } */
+ return ll;
+}
+
+long long
+bazllb (long long llp)
+{
+ register long long ll asm (REG1a);
+ register long long mm asm (REG2a) = llp;
+ asm ("baz2a %1,%0" : "=r" (ll) : "r" (mm) : REG1b, REG2b); /* { dg-error "conflict" } */
+ return ll;
+}
+
+/* Real-world example of bug. */
+
+#ifdef _WIN64
+typedef unsigned int loc_size_t __attribute__ ((mode (DI)));
+#else
+typedef __SIZE_TYPE__ loc_size_t;
+#endif
+
+struct stat;
+int
+_dl_stat (const char *file_name, struct stat *buf)
+{
+ register long a asm (REG1) = (long) (loc_size_t) file_name;
+ register long b asm (REG2) = (long) (loc_size_t) buf;
+
+ asm volatile ("movu.w %1,$r9\n\tbreak 13" : "=r" (a) : "g" (106), "0" (a), "r" (b) : REG1, REG5); /* { dg-error "conflict" } */
+ if (a >= 0)
+ return (int) a;
+ return (int) -1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20021006-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20021006-1.c
new file mode 100644
index 000000000..63cc8a5af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20021006-1.c
@@ -0,0 +1,27 @@
+/* PR target/7559
+ This testcase was miscompiled on x86-64 due to wrong access to the struct
+ members. */
+
+extern void abort();
+
+struct A {
+ long x;
+};
+
+struct R {
+ struct A a, b;
+};
+
+struct R R = {
+ {100}, {200}
+};
+
+void f(struct R r) {
+ if (r.a.x != R.a.x || r.b.x != R.b.x)
+ abort();
+}
+
+int main() {
+ f(R);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20021014-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20021014-1.c
new file mode 100644
index 000000000..e43f7b297
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20021014-1.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-require-profiling "-p" } */
+/* { dg-options "-O2 -p" } */
+/* { dg-options "-O2 -p -static" { target hppa*-*-hpux* } } */
+/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
+/* { dg-message "" "consider using `-pg' instead of `-p' with gprof(1)" { target *-*-freebsd* } 0 } */
+
+extern void abort (void);
+extern void exit (int);
+
+int foo (void)
+{
+ int bar (int x)
+ {
+ return x + 3;
+ }
+ return bar (1) + bar (2);
+}
+
+int main (void)
+{
+ if (foo () != 9)
+ abort ();
+ exit (0);
+}
+
+/* { dg-final { cleanup-profile-file } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20021018-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20021018-1.c
new file mode 100644
index 000000000..bbc889566
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20021018-1.c
@@ -0,0 +1,29 @@
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void abort (void);
+extern void exit (int);
+
+#if __INT_MAX__ >= 2147483647L
+static const long foo [10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+
+long __attribute__((noinline))
+bar (int x)
+{
+ return foo [x - 0x6ffffffa];
+}
+
+int
+main (void)
+{
+ if (bar (0x6ffffffc) != 2)
+ abort ();
+ exit (0);
+}
+#else
+int
+main (void)
+{
+ exit (0);
+}
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20021023-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20021023-1.c
new file mode 100644
index 000000000..855b2cc1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20021023-1.c
@@ -0,0 +1,24 @@
+/* This testcase ICEd on x86-64 because LABEL_REF + small const was not
+ considered as local_symbolic_operand. */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+typedef __builtin_va_list va_list;
+
+static unsigned int
+foo (void *a, float b, const char *c, va_list d, void *e)
+{
+ return -1;
+}
+
+unsigned int
+bar (void *a, float b, const char *c, ...)
+{
+ va_list args;
+ unsigned int d;
+
+ __builtin_va_start (args, c);
+ d = foo (a, b, c, args, a);
+ __builtin_va_end (args);
+ return d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20021029-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20021029-1.c
new file mode 100644
index 000000000..bc330c56f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20021029-1.c
@@ -0,0 +1,17 @@
+/* Test whether difference of local labels doesn't force
+ variables into writable sections. */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+/* { dg-options "-O2 -fpic -mpt-fixed" { target sh64*-*-* } } */
+/* { dg-final { scan-assembler-not ".data.rel.ro.local" } } */
+
+int foo (int a)
+{
+ static const int ar[] = { &&l1 - &&l1, &&l2 - &&l1 };
+ void *p = &&l1 + ar[a];
+ goto *p;
+ l1:
+ return 1;
+ l2:
+ return 2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20021029-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20021029-2.c
new file mode 100644
index 000000000..e99342478
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20021029-2.c
@@ -0,0 +1,14 @@
+/* Test whether variables with relocations aren't put into
+ mergeable sections even with -fmerge-all-constants. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fmerge-all-constants" } */
+/* { dg-final { scan-assembler-not ".rodata.cst" } } */
+
+int foo (int a)
+{
+ static void * const ar[] = { &&l2 };
+ void *p = ar[a];
+ goto *p;
+l2:
+ return 2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20021116-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20021116-1.c
new file mode 100644
index 000000000..4d3afc7b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20021116-1.c
@@ -0,0 +1,31 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+void **
+foo (void **x, int y, void *z)
+{
+ switch (y)
+ {
+ case 162:
+ *x = z;
+ break;
+ case 164:
+ *x = z;
+ break;
+ case 165:
+ *x = z;
+ break;
+ case 166:
+ *x = z;
+ break;
+ case 163:
+ *x = z;
+ break;
+ default:
+ goto out;
+ }
+ return x;
+
+out:
+ return (void **) 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030107-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030107-1.c
new file mode 100644
index 000000000..9264eba70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030107-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-fprofile-arcs" } */
+
+extern void bar(void) __attribute__((noreturn));
+int foo (void) { bar(); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030120-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030120-1.c
new file mode 100644
index 000000000..2d3e2ce65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030120-1.c
@@ -0,0 +1,9 @@
+/* PR 7154 */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O -fpic" } */
+
+const int x[1]={ 1 };
+void foo(int i, int *p)
+{
+ asm volatile("" : "+r"(i) : "m" (x[0]), "r"(p));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030204-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030204-1.c
new file mode 100644
index 000000000..6b8ea4daa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030204-1.c
@@ -0,0 +1,17 @@
+/* PR optimization/8555 */
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -funroll-loops" } */
+/* { dg-options "-march=pentium3 -O -ffast-math -funroll-loops" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+
+float foo (float *a, int i)
+{
+ int j;
+ float x = a[j = i - 1], y;
+
+ for (j = i; --j >= 0; )
+ if ((y = a[j]) > x)
+ x = y;
+
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030213-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030213-1.c
new file mode 100644
index 000000000..35bfe22fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030213-1.c
@@ -0,0 +1,36 @@
+/* Testcase for http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01017.html */
+/* { dg-do link { target fpic } } */
+/* { dg-options "-O -fpic" } */
+
+int *g;
+
+int main (void)
+{
+ switch (*g)
+ {
+ case 0:
+ {
+ switch (*g)
+ {
+ case 0: *g = 1; break;
+ case 1:
+ case 2: *g = 1; break;
+ case 3:
+ case 4: *g = 1; break;
+ }
+ break;
+ }
+ case 1:
+ {
+ switch (*g)
+ {
+ case 0: *g = 1; break;
+ case 1:
+ case 2: *g = 1; break;
+ case 3:
+ case 4: *g = 1; break;
+ }
+ }
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030225-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030225-1.c
new file mode 100644
index 000000000..97a436b4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030225-1.c
@@ -0,0 +1,101 @@
+/* PR target/9732
+ This testcase segfaulted on PPC because PIC_OFFSET_TABLE_REGNUM was no
+ fixed register.
+ Distilled from the xvid sources by Guillaume Morin <guillaume@morinfr.org>
+ and Benjamin Herrenschmidt <benh@kernel.crashing.org>. */
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O2 -fPIC" } */
+
+extern void exit (int);
+
+#define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */
+#define W2 2676 /* 2048*sqrt(2)*cos(2*pi/16) */
+#define W3 2408 /* 2048*sqrt(2)*cos(3*pi/16) */
+#define W5 1609 /* 2048*sqrt(2)*cos(5*pi/16) */
+#define W6 1108 /* 2048*sqrt(2)*cos(6*pi/16) */
+#define W7 565 /* 2048*sqrt(2)*cos(7*pi/16) */
+
+
+/* private data */
+static short iclip[1024]; /* clipping table */
+static short *iclp;
+
+void
+idct_int32(short *const block)
+{
+ static short *blk;
+ static long i;
+ static long X0, X1, X2, X3, X4, X5, X6, X7, X8;
+
+ for (i = 0; i < 8; i++) /* idct columns */
+ {
+ blk = block + i;
+ /* shortcut */
+ if (! ((X1 = (blk[8 * 4] << 8)) | (X2 = blk[8 * 6])
+ | (X3 = blk[8 * 2]) | (X4 = blk[8 * 1]) | (X5 = blk[8 * 7])
+ | (X6 = blk[8 * 5]) | (X7 = blk[8 * 3])))
+ {
+ blk[8 * 0] = blk[8 * 1] = blk[8 * 2] =
+ blk[8 * 3] = blk[8 * 4] =
+ blk[8 * 5] = blk[8 * 6] = blk[8 * 7] =
+ iclp[(blk[8 * 0] + 32) >> 6];
+ continue;
+ }
+ X0 = (blk[8 * 0] << 8) + 8192;
+
+ /* first stage */
+ X8 = W7 * (X4 + X5) + 4;
+ X4 = (X8 + (W1 - W7) * X4) >> 3;
+ X5 = (X8 - (W1 + W7) * X5) >> 3;
+ X8 = W3 * (X6 + X7) + 4;
+ X6 = (X8 - (W3 - W5) * X6) >> 3;
+ X7 = (X8 - (W3 + W5) * X7) >> 3;
+
+ /* second stage */
+ X8 = X0 + X1;
+ X0 -= X1;
+ X1 = W6 * (X3 + X2) + 4;
+ X2 = (X1 - (W2 + W6) * X2) >> 3;
+ X3 = (X1 + (W2 - W6) * X3) >> 3;
+ X1 = X4 + X6;
+ X4 -= X6;
+ X6 = X5 + X7;
+ X5 -= X7;
+
+ /* third stage */
+ X7 = X8 + X3;
+ X8 -= X3;
+ X3 = X0 + X2;
+ X0 -= X2;
+ X2 = (181 * (X4 + X5) + 128) >> 8;
+ X4 = (181 * (X4 - X5) + 128) >> 8;
+
+ /* fourth stage */
+ blk[8 * 0] = iclp[(X7 + X1) >> 14];
+ blk[8 * 1] = iclp[(X3 + X2) >> 14];
+ blk[8 * 2] = iclp[(X0 + X4) >> 14];
+ blk[8 * 3] = iclp[(X8 + X6) >> 14];
+ blk[8 * 4] = iclp[(X8 - X6) >> 14];
+ blk[8 * 5] = iclp[(X0 - X4) >> 14];
+ blk[8 * 6] = iclp[(X3 - X2) >> 14];
+ blk[8 * 7] = iclp[(X7 - X1) >> 14];
+ }
+} /* end function idct_int32(block) */
+
+
+int main(void) {
+ int i;
+ unsigned short tab[64];
+
+ for (i = 0 ; i < 64 ; ++i)
+ {
+ tab[i] = (1+(int) (65535)*8000/(2147483647+1.0));
+ }
+
+ iclp = iclip + 512;
+ for (i = -512; i < 512; i++)
+ iclp[i] = (i < -256) ? -256 : ((i > 255) ? 255 : i);
+
+ idct_int32((short *) tab);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030309-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030309-1.c
new file mode 100644
index 000000000..2431bc1b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030309-1.c
@@ -0,0 +1,42 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+struct A0 { int x; };
+struct A1 { int x; int y[1]; };
+struct A2 { int x; int y[2]; };
+struct A3 { int x; int y[3]; };
+struct A4 { int x; int y[4]; };
+
+void *s;
+int u;
+
+int
+main (void)
+{
+ int x;
+ void *t = s;
+
+ switch (u)
+ {
+ case 0:
+ x = ((struct A0 *) t)->x;
+ break;
+ case 1:
+ x = ((struct A1 *) t)->x;
+ break;
+ case 2:
+ x = ((struct A2 *) t)->x;
+ break;
+ case 3:
+ x = ((struct A3 *) t)->x;
+ break;
+ case 4:
+ x = ((struct A4 *) t)->x;
+ break;
+ default:
+ x = 0;
+ break;
+ }
+
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030321-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030321-1.c
new file mode 100644
index 000000000..1150c7f76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030321-1.c
@@ -0,0 +1,18 @@
+/* This used to ICE on s390 due to displacement overflow
+ when accessing the low-order subword. */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct array
+{
+ char align[4092];
+ long long elem[2] __attribute__ ((__packed__)); /* { dg-warning "attribute ignored" "" { target default_packed } } */
+};
+
+long long
+test (struct array *array, int i)
+{
+ return array->elem[i];
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030323-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030323-1.c
new file mode 100644
index 000000000..8a563ec5e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030323-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+/* PR c/8224 */
+/* Contributed by Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> */
+
+extern void abort (void);
+
+unsigned f (int x)
+{
+ return (unsigned) (x / 2) / 2;
+}
+
+unsigned f1 (int x)
+{
+ unsigned xx = x / 2;
+ return xx / 2;
+}
+
+int main ()
+{
+ if (f1 (-5) != f (-5))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030324-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030324-1.c
new file mode 100644
index 000000000..67db669fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030324-1.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "-O -fstrict-aliasing -fgcse" } */
+
+/* PR optimization/10087 */
+/* Contributed by Peter van Hoof <p.van-hoof@qub.ac.uk> */
+
+extern void abort(void);
+
+void b(int*,int*);
+
+typedef struct {
+ double T1;
+ char c;
+} S;
+
+int main(void)
+{
+ int i,j;
+ double s;
+
+ S x1[2][2];
+ S *x[2] = { x1[0], x1[1] };
+ S **E = x;
+
+ for( i=0; i < 2; i++ )
+ for( j=0; j < 2; j++ )
+ E[j][i].T1 = 1;
+
+ for( i=0; i < 2; i++ )
+ for( j=0; j < 2; j++ )
+ s = E[j][i].T1;
+
+ b(&j,&i);
+ if (s != 1)
+ abort ();
+ return 0;
+}
+
+void b(int *i, int *j) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030331-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030331-2.c
new file mode 100644
index 000000000..2fce78ea9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030331-2.c
@@ -0,0 +1,12 @@
+// { dg-options "" }
+
+extern int printf (const char *, ...);
+
+int foo() {
+ int yd;
+ float in[1][yd];
+
+ void bar() {
+ printf("%p\n",in[0]);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030414-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030414-1.c
new file mode 100644
index 000000000..9ba595318
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030414-1.c
@@ -0,0 +1,39 @@
+/* PR target/10377
+ Distilled by Hans-Peter Nilsson <hp@axis.com> from ncurses-5.3 infocmp.c.
+ Copyright (C) 2003 Free Software Foundation. */
+
+/* { dg-do assemble } */
+/* { dg-options "-O2 -fPIC" { target *-*-*gnu* } } */
+
+extern int f2 (char *, char *);
+extern char *ss[];
+extern char *cc;
+void
+f1 (char *dd, char *bb)
+{
+ char *sp = bb + 1;
+ char *ap;
+ int i;
+ char *ee = 0;
+ char *cp;
+
+ for (i = 0, cp = cc; i < 42; i++)
+ if (cp)
+ {
+ if (f2 (dd, "xx") || f2 (ss[i], "xx") || f2 (ss[i], "yy"))
+ if (bb < cp)
+ continue;
+ ee = ss[i];
+ break;
+ }
+
+ if (!ee)
+ for (ap = cc; *ap; ap++)
+ if (f2(ap, sp))
+ {
+ ee = ap;
+ break;
+ }
+
+ cc = ee;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030414-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030414-2.c
new file mode 100644
index 000000000..f4eb8bf36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030414-2.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding (c1 - x) op c2 into x swap(op) c1-c2
+ doesn't break anything.
+
+ Written by Roger Sayle, 27th March 2003. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void abort (void);
+
+int foo(double x)
+{
+ return (10.0 - x) > 3.0;
+}
+
+int bar (double x)
+{
+ return (10.0 - x) == 5.0;
+}
+
+int main()
+{
+ if (foo (8.0))
+ abort ();
+
+ if (! foo (6.0))
+ abort ();
+
+ if (bar (1.0))
+ abort ();
+
+ if (! bar (5.0))
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030612-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030612-1.c
new file mode 100644
index 000000000..f08751243
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030612-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int A, B;
+
+void foo()
+{
+ long x = 3;
+ (void)({
+ A = B + x + ((1) - 1);
+ return; /* { dg-warning "statement-expressions should end with a non-void expression" "" { xfail *-*-* } } */
+ });
+}
+
+main()
+{
+ B = 5;
+ foo();
+ if (A != 8)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030625-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030625-1.c
new file mode 100644
index 000000000..4e78ae4ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030625-1.c
@@ -0,0 +1,9 @@
+/* Testcase from http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02557.html */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+typedef struct _foo foo;
+struct _foo {
+ struct _moo moo; /* { dg-error "moo" "has incomplete type" } */
+};
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c
new file mode 100644
index 000000000..3a96786fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030626-1.c
@@ -0,0 +1,18 @@
+/* PR optimization/11210 */
+/* Originator: Guido Classen <guido@clagi.de> */
+/* Reduced testcase by Falk Hueffner <falk@debian.org> */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+/* Verify that the constant expressions folder doesn't
+ throw away the cast operation in the comparison. */
+
+struct str {
+ int head;
+ signed char data[8];
+};
+
+int foo(struct str t)
+{
+ return t.data[0] || (unsigned char) t.data[2] != 130; /* { dg-bogus "comparison is always 1" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030627-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030627-1.c
new file mode 100644
index 000000000..4135f71e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030627-1.c
@@ -0,0 +1,20 @@
+/* This tests whether non-offsettable memory operands are reloaded
+ correctly in certain corner cases on s390 targets. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+void test_inout (char *bd, int xd, char *bs, int xs)
+{
+ *(long long *)(bd + xd + 4093) = *(long long *)(bs + xs + 4093);
+}
+
+void test_in (char *bd, int xd, char *bs, int xs)
+{
+ *(long long *)(bd + xd) = *(long long *)(bs + xs + 4093);
+}
+
+void test_out (char *bd, int xd, char *bs, int xs)
+{
+ *(long long *)(bd + xd + 4093) = *(long long *)(bs + xs);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030702-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030702-1.c
new file mode 100644
index 000000000..b530c69a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030702-1.c
@@ -0,0 +1,10 @@
+/* This tests whether REG_ALWAYS_RETURN notes are handled
+ correctly in combine. */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic -fprofile-arcs" } */
+/* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } } */
+
+void test (void)
+{
+ fork ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030707-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030707-1.c
new file mode 100644
index 000000000..cd3e88ebb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030707-1.c
@@ -0,0 +1,16 @@
+/* Derived from PR target/10979. */
+/* This testcase used to ICE on x86. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+void t(double);
+double atan2(double,double);
+
+void temp(double *c)
+{
+ double c2 = 8;
+ double s2 = 0;
+ *c = atan2(s2,c2);
+ t(1/s2);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030708-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030708-1.c
new file mode 100644
index 000000000..344bb4e18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030708-1.c
@@ -0,0 +1,14 @@
+/* PR c/11420 */
+/* { dg-do link { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+void (* volatile fn) (void);
+static void foo (void)
+{
+}
+
+int main (void)
+{
+ fn = foo;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030711-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030711-1.c
new file mode 100644
index 000000000..e8691961f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030711-1.c
@@ -0,0 +1,36 @@
+/* Test whether strncmp has not been "optimized" into memcmp
+ nor any code with memcmp semantics. */
+/* { dg-do run { target mmap } } */
+/* { dg-options "-O2" } */
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/mman.h>
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+#ifndef MAP_ANON
+#define MAP_ANON 0
+#endif
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+#include <stdlib.h>
+
+void __attribute__((noinline)) test (const char *p)
+{
+ if (__builtin_strncmp (p, "abcdefghijklmnopq", 17) == 0)
+ abort ();
+}
+
+int main (void)
+{
+ char *p = mmap (NULL, 131072, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (p == MAP_FAILED)
+ return 0;
+ if (munmap (p + 65536, 65536) < 0)
+ return 0;
+ __builtin_memcpy (p + 65536 - 5, "abcd", 5);
+ test (p + 65536 - 5);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030717-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030717-1.c
new file mode 100644
index 000000000..6a7f6de6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030717-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int zero (void)
+{
+ return 0;
+}
+
+int one (void)
+{
+ return 1;
+}
+
+int main (void)
+{
+ int i = 1;
+ int r = (i ? one : zero)();
+ if (r != 1)
+ abort();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030721-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030721-1.c
new file mode 100644
index 000000000..5e8ed0b43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030721-1.c
@@ -0,0 +1,41 @@
+/* { dg-options "-O2" } */
+/* PR optimization/11536 */
+/* Origin: samal@kam.mff.cuni.cz <samal@kam.mff.cuni.cz> */
+/* Testcase by Andrew Pinski <pinskia@physics.uc.edu> */
+
+/* Verify that the loop optimizer doesn't use moving targets
+ to calculate the number of iterations of a loop. */
+
+extern void abort(void);
+
+void foo(int) __attribute__((__noinline__));
+
+void foo(int i)
+{
+ abort();
+}
+
+int main()
+{
+ int i;
+ int first= 0;
+ int last= 0;
+
+ while (last<3) {
+ last = first;
+
+ while (first<=last) {
+ first++;
+
+ for (i=0;i<3;i++)
+ last++;
+
+ if (last>10)
+ return 0;
+ }
+
+ foo(first);
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030804-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030804-1.c
new file mode 100644
index 000000000..cbc66474a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030804-1.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of mathematical expressions doesn't
+ break anything.
+
+ Written by Roger Sayle, 3rd August 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+void test(double x)
+{
+ if (x+x != 2.0*x)
+ link_error ();
+ if (x+x != x*2.0)
+ link_error ();
+
+ if (x+x+x != 3.0*x)
+ link_error ();
+ if (x+x+x != x*3.0)
+ link_error ();
+
+ if ((x+x)+x != 3.0*x)
+ link_error ();
+ if ((x+x)+x != x*3.0)
+ link_error ();
+
+ if (x+(x+x) != 3.0*x)
+ link_error ();
+ if (x+(x+x) != x*3.0)
+ link_error ();
+
+ if (x+4.0*x != 5.0*x)
+ link_error ();
+ if (x+4.0*x != x*5.0)
+ link_error ();
+ if (x+x*4.0 != 5.0*x)
+ link_error ();
+ if (x+x*4.0 != x*5.0)
+ link_error ();
+ if (4.0*x+x != 5.0*x)
+ link_error ();
+ if (4.0*x+x != x*5.0)
+ link_error ();
+ if (x*4.0+x != 5.0*x)
+ link_error ();
+ if (x*4.0+x != x*5.0)
+ link_error ();
+
+ if (3.0*x + 5.0*x != 8.0*x)
+ link_error ();
+ if (3.0*x + 5.0*x != x*8.0)
+ link_error ();
+ if (x*3.0 + 5.0*x != 8.0*x)
+ link_error ();
+ if (x*3.0 + 5.0*x != x*8.0)
+ link_error ();
+ if (3.0*x + x*5.0 != 8.0*x)
+ link_error ();
+ if (3.0*x + x*5.0 != x*8.0)
+ link_error ();
+ if (x*3.0 + x*5.0 != 8.0*x)
+ link_error ();
+ if (x*3.0 + x*5.0 != x*8.0)
+ link_error ();
+}
+
+int main()
+{
+ test(2.0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030805-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030805-1.c
new file mode 100644
index 000000000..6297c5d83
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030805-1.c
@@ -0,0 +1,23 @@
+/* Test that gcc understands that the call to g might clobber i. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+__inline int f ()
+{
+ static int i;
+ int i2 = i;
+ i = i2 + 1;
+ return i;
+}
+
+int g () { return f (); }
+
+int main ()
+{
+ if (f() != 1
+ || g() != 2
+ || f() != 3)
+ return 1;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030815-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030815-1.c
new file mode 100644
index 000000000..7bf21bd46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030815-1.c
@@ -0,0 +1,18 @@
+/* Test completion of incomplete types.
+ There used to be a bug where some types from incomplete
+ list were accidentally lost. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef struct a E;
+typedef struct b F;
+typedef struct c G;
+typedef struct d H;
+struct a { int a; };
+struct c { int c; };
+struct d { int d; };
+struct b { int b; };
+int se = sizeof (E);
+int sf = sizeof (F);
+int sg = sizeof (G);
+int sh = sizeof (H);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030820-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030820-1.c
new file mode 100644
index 000000000..f86fb3978
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030820-1.c
@@ -0,0 +1,13 @@
+/* PR middle-end/11984 */
+/* The following program used to ICE in fold because we didn't check
+ whether the constants we were reassociating were integer constants
+ before calling tree_int_cst_lt. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double f(double x)
+{
+ return 1.0 - x - 0.1;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030826-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030826-1.c
new file mode 100644
index 000000000..b344ad2dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030826-1.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of mathematical expressions doesn't
+ break anything.
+
+ Written by Roger Sayle, 24th August 2003. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+void abort(void);
+
+double foo(double x)
+{
+ return 12.0/(x*3.0);
+}
+
+double bar(double x)
+{
+ return (3.0/x)*4.0;
+}
+
+int main()
+{
+ if (foo(2.0) != 2.0)
+ abort ();
+
+ if (bar(2.0) != 6.0)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030826-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030826-2.c
new file mode 100644
index 000000000..552c77e7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030826-2.c
@@ -0,0 +1,64 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+/* { dg-options "-O2 -fomit-frame-pointer -march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct S
+{
+ int *a;
+ unsigned char *b, c;
+};
+
+int u, v, w;
+
+void
+foo (unsigned short x)
+{
+ u += x;
+}
+
+int
+bar (struct S **x, int *y)
+{
+ w += *y;
+ *y = w + 25;
+ return 0;
+}
+
+int
+baz (struct S **x)
+{
+ struct S *y = *x;
+ unsigned char *a = y->b;
+
+ foo (*a);
+
+ if (__builtin_expect (y->c != 0 || y->a == &v, 0))
+ return 1;
+
+ if (__builtin_expect (*a == 1, 0))
+ {
+ int a, b = bar (x, &a);
+
+ if (a)
+ return b;
+ }
+
+ return 0;
+}
+
+int
+main (void)
+{
+ struct S a, *b = &a;
+ unsigned char c;
+
+ __builtin_memset (b, 0, sizeof (a));
+ a.a = &v;
+ a.b = &c;
+ if (baz (&b) != 1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030906-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030906-1.c
new file mode 100644
index 000000000..c416f55ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030906-1.c
@@ -0,0 +1,21 @@
+/* Bug 9862 -- Spurious warnings with -finline-functions.
+ Copyright (C) 2003 Free Software Foundation Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -finline-functions -Wreturn-type" } */
+
+extern int i;
+extern int foo (void);
+extern int bar (void);
+
+int foo (void)
+{
+ if( i ) return 0;
+ else return 1;
+}
+
+int bar (void)
+{
+ if( i ) return; /* { dg-warning "'return' with no value, in function returning non-void" } */
+ else return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20030906-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20030906-2.c
new file mode 100644
index 000000000..1191133e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20030906-2.c
@@ -0,0 +1,21 @@
+/* Bug 9862 -- Spurious warnings with -finline-functions.
+ Copyright (C) 2003 Free Software Foundation Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -finline-functions -Wreturn-type" } */
+
+extern int i;
+extern int foo (void);
+extern int bar (void);
+
+int foo (void)
+{
+ if( i ) return; /* { dg-warning "'return' with no value, in function returning non-void" } */
+ else return 1;
+}
+
+int bar (void)
+{
+ if( i ) return 0;
+ else return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031002-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031002-1.c
new file mode 100644
index 000000000..57a31ed7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031002-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void generic_sendmsg (char *fmt, ...)
+{
+ __builtin_next_arg(fmt);
+}
+
+void generic_sendstat()
+{
+ double t;
+
+ generic_sendmsg("F %3.2f", t);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031012-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031012-1.c
new file mode 100644
index 000000000..f83e1d3f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031012-1.c
@@ -0,0 +1,18 @@
+/* { dg-options "-Waddress" } */
+/* Origin: Andrew Morton <akpm@osdl.org> */
+/* Warn if a function addres of a non-weak function is used
+ as a truth value. */
+/* See thread starting at http://gcc.gnu.org/ml/gcc/2003-10/msg00414.html */
+
+void foo(void)
+{}
+
+void bar(void)
+{}
+
+int main() {
+ if (foo) /* { dg-warning "" } */
+ bar();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c
new file mode 100644
index 000000000..2148381a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031102-1.c
@@ -0,0 +1,37 @@
+/* PR optimization/12799 */
+/* Origin: Pratap Subrahmanyam <pratap@vmware.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=i686" { target { { i686-*-* x86_64-*-* } && ia32 } } } */
+
+/* Verify that reload_cse_move2add doesn't add unexpected CLOBBERs. */
+
+extern void abort(void);
+
+int loo = 1;
+
+__inline__ char InlineFunc(void)
+{
+ return __builtin_expect(!!(loo == 1), 1);
+}
+
+int FooBar(void)
+{
+ int i;
+ int var1 = InlineFunc() ? 2046 : 1023;
+ int var2 = InlineFunc() ? 512 : 1024;
+
+ for (i = 0; i < var1; i++)
+ ;
+
+ if (InlineFunc() && var2 != 512)
+ abort();
+
+ return 0;
+}
+
+int main(void)
+{
+ return FooBar();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031111-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031111-1.c
new file mode 100644
index 000000000..f4de52257
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031111-1.c
@@ -0,0 +1,13 @@
+/* Make sure that dead code isn't eliminated too early, avoiding
+ detection of errors. */
+/* { dg-do compile } */
+
+void foo(void)
+{
+ if (0)
+ break; /* { dg-error "" } */
+ if (1)
+ ;
+ else
+ continue; /* { dg-error "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031201-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031201-1.c
new file mode 100644
index 000000000..91f2d9ddf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031201-1.c
@@ -0,0 +1,20 @@
+/* PR optimization/12628 */
+/* The following test used to ICE in init_alias_analysis because the
+ given command line options meant that reg_scan wasn't (re)run before
+ the jump bypassing pass. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-expensive-optimizations" } */
+
+int outbuf[100];
+int outcnt;
+int bi_buf;
+void send_bits(void)
+{
+ bi_buf = 0;
+ outbuf[outcnt++] = 8;
+ outbuf[outcnt++] = 8;
+ if (outcnt)
+ bi_buf = 1;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031201-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031201-2.c
new file mode 100644
index 000000000..c32b5ebd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031201-2.c
@@ -0,0 +1,41 @@
+/* PR optimization/11634 */
+
+/* The following code used to ICE in verify_local_live_at_start on
+ PA when compiled with -O2. The cause was that split_all_insns was
+ not updating liveness information when deleting no-op moves that
+ had REG_UNUSED notes. */
+
+/* { dg-do compile { target hppa*-*-* } } */
+/* { dg-options "-O2" } */
+
+void *f(void *s);
+void H5T_conv_vlen (unsigned long long nelmts, unsigned char *bg_ptr)
+{
+ long long seq_len;
+ unsigned long long bg_seq_len = 0;
+ unsigned src_base_size, dst_base_size;
+ void *tmp_buf = 0;
+ unsigned tmp_buf_size = 0;
+ unsigned long long elmtno;
+ for (elmtno = 0; elmtno < nelmts; elmtno++)
+ {
+ unsigned char *tmp = bg_ptr;
+ bg_seq_len = *tmp;
+ if (bg_seq_len > 0
+ && tmp_buf_size <
+ (unsigned) (bg_seq_len *
+ (src_base_size > dst_base_size
+ ? src_base_size
+ : dst_base_size)))
+ {
+ tmp_buf_size =
+ (unsigned) (bg_seq_len *
+ (src_base_size > dst_base_size
+ ? src_base_size
+ : dst_base_size));
+ }
+ if (bg_seq_len < seq_len)
+ f ((unsigned char *) tmp_buf + dst_base_size * bg_seq_len);
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031202-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031202-1.c
new file mode 100644
index 000000000..a5e78456b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031202-1.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct A { char p[6]; } __attribute__((packed));
+struct B {
+ struct A a;
+ void * const b;
+ struct A const * const c;
+ struct A const *d;
+};
+
+char v;
+
+int __attribute__((noinline))
+foo (struct B *b)
+{
+ int i;
+ for (i = 0; i < 6; ++i)
+ if (b->a.p[i])
+ abort ();
+ if (b->b != &v || b->c || b->d)
+ abort ();
+ return 12;
+}
+
+int __attribute__((noinline))
+bar (void *x)
+{
+ __asm __volatile ("" : "=r" (x) : "0" (x));
+ struct B y = { .b = x, .c = (void *) 0 };
+ return foo (&y) + 1;
+}
+
+int
+main (void)
+{
+ if (bar (&v) != 13)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031216-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031216-1.c
new file mode 100644
index 000000000..7c706d86b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031216-1.c
@@ -0,0 +1,39 @@
+/* This used to abort due to a loop bug on s390*. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fPIC" { target s390*-*-* } } */
+
+extern void abort (void);
+
+int count = 0;
+char *str;
+
+void test (int flag)
+{
+ char *p;
+
+ for (;;)
+ {
+ if (count > 5)
+ return;
+
+ p = "test";
+
+ if (flag)
+ count++;
+
+ str = p;
+ }
+}
+
+int main (void)
+{
+ test (1);
+
+ if (str[0] != 't')
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031218-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031218-1.c
new file mode 100644
index 000000000..87cc1059f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031218-1.c
@@ -0,0 +1,19 @@
+/* Orgin: v.haisman@sh.cvut.cz
+ Reduced by: Wolfgang Bangerth <bangerth@dealii.org>
+ PR debug/12923 ICE in gen_subprogram_die with -O1 -g
+ The problem was that this just to ICE with -O1 -g. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -g" } */
+
+struct S {
+ unsigned n;
+};
+
+inline void foo (struct S * mx) {
+ mx->n = 1;
+}
+
+void bar () {
+ foo (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031218-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031218-2.c
new file mode 100644
index 000000000..497c963d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031218-2.c
@@ -0,0 +1,12 @@
+/* Orgin: Richard Sandiford <rsandifo@gcc.gnu.org>
+ PR debug/12923 ICE in gen_subprogram_die with -O2 -g
+ The problem was that this just to ICE with -O2 -g. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+int f1 (int y)
+{
+ int f2() { return y; }
+ return f2();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031218-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031218-3.c
new file mode 100644
index 000000000..0bae456b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031218-3.c
@@ -0,0 +1,14 @@
+/* Orgin: Chris Demetriou <cgd@broadcom.com>
+ PR debug/12923 ICE in gen_subprogram_die with -O2 -g
+ The problem was that this just to ICE with -O2 -g. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+extern __SIZE_TYPE__ strlen (const char *);
+
+int x (char *s)
+{
+ int y () { return (strlen (s)); }
+ return y (s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031222-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031222-1.c
new file mode 100644
index 000000000..b0d1a2dc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031222-1.c
@@ -0,0 +1,18 @@
+/* PR c/9163 */
+/* The following test used to ICE after an error message in C99 mode
+ because GCC was trying to expand the tree to rtl. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+
+
+void f ()
+{
+ for (; int ; ); /* { dg-error "" } */
+}
+
+void foo ()
+{
+ while (int i); /* { dg-error "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20031223-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20031223-1.c
new file mode 100644
index 000000000..353397eff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20031223-1.c
@@ -0,0 +1,13 @@
+/* PR c/11995 */
+/* The following test used to ICE after an error message
+ because GCC was trying to expand the trees to rtl. */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f ()
+{
+ l: int; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" "not stmt" } */
+ /* { dg-warning "useless type name in empty declaration" "type name" { target *-*-* } 10 } */
+ /* { dg-error "label at end of compound statement" "label" { target *-*-* } 10 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040123-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040123-1.c
new file mode 100644
index 000000000..2a73382dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040123-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "abort" } } */
+
+extern void abort (void);
+extern char a[];
+
+void foo (void)
+{
+ if ((void *) a == (void *) 0x4000UL)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040127-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040127-1.c
new file mode 100644
index 000000000..0ea6062a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040127-1.c
@@ -0,0 +1,24 @@
+/* PR target/10904 */
+/* Origin: <kminola@eng.umd.edu> */
+
+/* Verify that the register allocator correctly aligns
+ floating-point registers on SPARC64. */
+
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+extern int foo1();
+extern int foo2();
+
+void foo(int n, int b)
+{
+ int i, a;
+
+ foo1();
+
+ a = (long)(b * ((double) 0.1));
+
+ for (i=0; i < n; i++) {
+ foo2(a);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040127-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040127-2.c
new file mode 100644
index 000000000..6e56dd8fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040127-2.c
@@ -0,0 +1,32 @@
+/* PR target/13058 */
+/* Origin: Lloyd Parkes <lloyd@must-have-coffee.gen.nz> */
+/* Reduced testcase by Falk Hueffner <falk@debian.org> */
+
+/* Verify that the register allocator correctly aligns
+ floating-point registers on SPARC64. */
+
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+typedef struct { int ThumbnailSize; } ImageInfo_t;
+
+double ConvertAnyFormat(void)
+{
+ return 0;
+}
+
+void ProcessExifDir(ImageInfo_t *ImageInfoP, int NumDirEntries)
+{
+ unsigned int ThumbnailSize;
+
+ for (; NumDirEntries;) {
+ Get16u();
+ switch (NumDirEntries) {
+ case 0x0201:
+ case 0x0202:
+ ThumbnailSize = ConvertAnyFormat();
+ }
+ }
+
+ ImageInfoP->ThumbnailSize = ThumbnailSize;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040202-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040202-1.c
new file mode 100644
index 000000000..f0f4e7410
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040202-1.c
@@ -0,0 +1,8 @@
+/* PR middle-end/13325 */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n);
+void f (void *dest, const void *src) {
+ memcpy (dest, src, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040203-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040203-1.c
new file mode 100644
index 000000000..59c824ea4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040203-1.c
@@ -0,0 +1,17 @@
+/* PR/13994; bug_cond2 was rejected on gcc up to version 3.4.x */
+/* { dg-do compile }*/
+/* { dg-options "-std=gnu89" }*/
+
+struct s { char c[1]; };
+struct s a;
+
+int bug_if(void) { if (a.c) return 1; else return 0; }
+int bug_while(void) { while (a.c); }
+int bug_do_while(void) { do ; while (a.c); }
+int bug_for(void) { for ( ; a.c; ) ; }
+int bug_or(void) { return (a.c || 1); }
+int bug_and(void) { return (a.c && 1); }
+int bug_cond(void) { return (a.c ? 1 : 0); }
+char *bug_cond2(void) { return (a.c ? : 0); }
+int bug_not(void) { return !a.c; }
+int bug_bool(void) { return (_Bool) a.c; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040206-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040206-1.c
new file mode 100644
index 000000000..c9c776f0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040206-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -W -Wall" } */
+/* PR c/13127
+ On the tree-ssa this used to warn about an anonymous
+ uninitialized variable.
+
+ The warning about "no return statement in function
+ returning non-void" is PR 13000. */
+
+static int foo (int a __attribute__((unused)) ) { } /* { dg-warning "no return statement" } */
+int main (void) { return foo (0); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040217-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040217-1.c
new file mode 100644
index 000000000..7ca7388fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040217-1.c
@@ -0,0 +1,19 @@
+/* This used to ICE on s390x due to a bug in simplify_if_then_else. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void use (int);
+void test (void)
+{
+ union
+ {
+ unsigned long ul;
+ signed char sc;
+ } u;
+
+ u.sc = 8;
+ u.sc &= 25;
+
+ use (u.sc);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040219-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040219-1.c
new file mode 100644
index 000000000..1a277d696
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040219-1.c
@@ -0,0 +1,74 @@
+/* Testing save/restore of floating point caller-save registers, on ia64
+ this resulted in bad code. Not all targets will use caller-save regs. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -minline-float-divide-max-throughput" { target ia64-*-* } } */
+
+/* Testing save/restore of floating point caller-save registers on ia64. */
+
+extern void abort (void);
+
+double foo(double a, double b, double c)
+{
+ return (a+b+c);
+}
+
+main ()
+{
+ double f1, f2, f3, f4, f5, f6, f7, f8, f9,f10;
+ double f11,f12,f13,f14,f15,f16,f17,f18,f19,f20;
+ double f21,f22,f23,f24,f25,f26,f27,f28,f29,f30;
+ double x;
+ int i,j,k;
+
+ f1 = 0.1; f2 = 0.2; f3 = 0.3; f4 = 0.4; f5 = 0.5;
+ f6 = 0.6; f7 = 0.7; f8 = 0.8; f9 = 0.9; f10 = 1.0;
+ f11 = 1.1; f12 = 1.2; f13 = 1.3; f14 = 1.4; f15 = 1.5;
+ f16 = 1.6; f17 = 1.7; f18 = 1.8; f19 = 1.9; f20 = 2.0;
+ f21 = 2.1; f22 = 2.2; f23 = 2.3; f24 = 2.4; f25 = 2.5;
+ f26 = 2.6; f27 = 2.7; f28 = 2.8; f29 = 2.9; f30 = 3.0;
+
+ i = (int) foo(1.0,1.0,1.0);
+ while (i > 0) {
+ f1 = f2 / f3 * f30;
+ f2 = f3 / f4 * f30;
+ f3 = f4 / f5 * f30;
+ f4 = f5 / f6 * f30;
+ f5 = f6 / f7 * f30;
+ f6 = f7 / f8 * f30;
+ f7 = f8 / f9 * f30;
+ f8 = f9 / f10 * f30;
+ f9 = f10 / f11 * f30;
+ f10 = f11 / f12 * f30;
+ f11 = f12 / f13 * f30;
+ f12 = f13 / f14 * f25;
+ f13 = f14 / f15 * f30;
+ f14 = f15 / f16 * f30;
+ f15 = f16 / f17 * f30;
+ f16 = f17 / f18 * f30;
+ f17 = f18 / f19 * f30;
+ f18 = f19 / f20 * f30;
+ f19 = f20 / f21 * f30;
+ f20 = f21 / f22 * f20;
+ f21 = f22 / f23 * f30;
+ f22 = f23 / f24 * f30;
+ f23 = f24 / f25 * f30;
+ f24 = f25 / f26 * f30;
+ f25 = f26 / f27 * f30;
+ f26 = f27 / f28 * f30;
+ f27 = f28 / f29 * f30;
+ f28 = f29 / f30 * f30;
+ f29 = f30 / f1 * f30;
+ f30 = f1 / f2 * f30;
+ x = foo(f1,f2,f3);
+ i = i - 1;
+ }
+ x = (f1+f2+f3+f4+f5+f6+f7+f8+f9+f10) *
+ (f11+f12+f13+f14+f15+f16+f17+f18+f19+f20) *
+ (f21+f22+f23+f24+f25+f26+f27+f28+f29+f30);
+
+ /* Exact value is not needed, on IA64 it is massively off. */
+ if (x < 19503.0 || x > 19504.0) abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040223-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040223-1.c
new file mode 100644
index 000000000..71ddf099e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040223-1.c
@@ -0,0 +1,41 @@
+/* GCC was not warning about taking the address of parameters or
+ fields of struct parameters when returning them. */
+/* PR c/14156 */
+
+/* { dg-do compile } */
+
+
+int * f( int a)
+{
+ return &a;/* { dg-warning "address" "" } */
+}
+
+int * g()
+{
+ int b = 0;
+ return &b;/* { dg-warning "address" "" } */
+}
+
+struct ll
+{
+ int i;
+};
+
+int *h(struct ll c)
+{
+ return &c.i;/* { dg-warning "address" "" } */
+}
+
+
+struct ll d;
+
+int *i()
+{
+ return &d.i;/* { dg-bogus "address" "" } */
+}
+
+
+int *j(struct ll *c)
+{
+ return &c->i; /* { dg-bogus "address" "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040305-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040305-2.c
new file mode 100644
index 000000000..ffaf353e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040305-2.c
@@ -0,0 +1,49 @@
+/* PR target/14262 */
+/* { dg-do run } */
+
+extern void abort (void);
+
+typedef char ACS;
+typedef char LSM;
+typedef char PANEL;
+typedef char DRIVE;
+typedef struct {
+ ACS acs;
+ LSM lsm;
+} LSMID;
+typedef struct {
+ LSMID lsm_id;
+ PANEL panel;
+} PANELID;
+typedef struct {
+ PANELID panel_id;
+ DRIVE drive;
+} DRIVEID;
+
+void sub (DRIVEID driveid)
+{
+ if (driveid.drive != 1)
+ abort ();
+ if (driveid.panel_id.panel != 2)
+ abort ();
+ if (driveid.panel_id.lsm_id.lsm != 3)
+ abort ();
+ if (driveid.panel_id.lsm_id.acs != 4)
+ abort ();
+}
+
+int main(void)
+{
+ DRIVEID driveid;
+
+ driveid.drive = 1;
+ driveid.panel_id.panel = 2;
+ driveid.panel_id.lsm_id.lsm = 3;
+ driveid.panel_id.lsm_id.acs = 4;
+
+ sub(driveid);
+
+ return 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040306-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040306-1.c
new file mode 100644
index 000000000..903d20ac2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040306-1.c
@@ -0,0 +1,22 @@
+/* This used to ICE due to a reload bug on s390*. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+
+typedef struct test
+{
+ unsigned short pad;
+ unsigned char type[6];
+} t;
+
+extern void set (t *a, t *b, t *c, t *d, t *e, t *f, t *g, t *h,
+ t *i, t *j, t *k, t *l, t *m, t *n, t *o, t *p);
+extern void use (t a, t b, t c, t d, t e, t f, t g, t h,
+ t i, t j, t k, t l, t m, t n, t o, t p);
+void test (void)
+{
+ t a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
+ set (&a, &b, &c, &d, &e, &f, &g, &h, &i, &j, &k, &l, &m, &n, &o, &p);
+ use (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040309-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040309-1.c
new file mode 100644
index 000000000..736150731
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040309-1.c
@@ -0,0 +1,17 @@
+/* Test integer mod on ia64. There was a bug in the inline integer
+ division code. */
+
+/* { dg-do run } */
+/* { dg-options "-minline-int-divide-max-throughput" { target ia64-*-* } } */
+
+extern void abort (void);
+
+volatile int i = 10;
+volatile int j = 10;
+
+int main()
+{
+ int k = i % j;
+ if (k != 0) abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040310-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040310-1.c
new file mode 100644
index 000000000..104e98d08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040310-1.c
@@ -0,0 +1,34 @@
+/* This caused cc1 to segfault on s390x-ibm-linux
+ due to a bug in if_then_else_cond (combine.c). */
+
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+extern void use (unsigned int x);
+
+int main (void)
+{
+ union
+ {
+ unsigned int x;
+ unsigned long pad;
+ } A;
+
+ struct
+ {
+ unsigned int x : 1;
+ } B;
+
+ A.x = 1;
+ B.x = 1;
+ A.x /= B.x;
+ use (A.x);
+
+ A.x = 1;
+ B.x = 1;
+ B.x /= A.x;
+ use (B.x);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040311-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040311-2.c
new file mode 100644
index 000000000..9dfbb9947
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040311-2.c
@@ -0,0 +1,36 @@
+/* PR target/14533 */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+void bar (char *, int);
+
+extern char b[];
+extern int d, e;
+struct S
+{
+ struct S *m;
+ int n;
+} **g;
+
+void
+foo (int x, char *y)
+{
+ struct S *h;
+ int k = 1, l;
+
+again:
+ for (h = *g; h != (struct S *) g; h = h->m)
+ {
+ if (k == 0 && h->n & 0x100000);
+ l = y - b;
+ if (e)
+ bar (b, l);
+ if (d)
+ bar (b, l);
+ }
+ if (k)
+ {
+ k = 0;
+ goto again;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040322-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040322-1.c
new file mode 100644
index 000000000..139511262
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040322-1.c
@@ -0,0 +1,4 @@
+/* PR c/14069 */
+/* { dg-do compile } */
+struct S { int a; char b[]; char *c; }; /* { dg-error "" "flexible array member not" } */
+struct S s = { .b = "foo", .c = .b }; /* { dg-error "" "parse error before" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040331-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040331-1.c
new file mode 100644
index 000000000..4cef3d329
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040331-1.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fwrapv" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ struct { int count: 2; } s = { -2 };
+ while (s.count-- != -2)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040409-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040409-1.c
new file mode 100644
index 000000000..dc9206a0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040409-1.c
@@ -0,0 +1,4 @@
+/* This tests to make sure that the attribute noreturn
+ can be used on function pointers. */
+
+int (*temp) (void) __attribute__((noreturn));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040609-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040609-1.c
new file mode 100644
index 000000000..ef181476e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040609-1.c
@@ -0,0 +1,73 @@
+/* PRs target/15569, rtl-optimization/15681 */
+/* { dg-do compile } */
+/* { dg-options "-Os -frename-registers" } */
+/* { dg-options "-mconstant-gp -Os -frename-registers" { target ia64-*-* } } */
+
+struct S { struct S *a, *b; };
+struct T { struct S e; unsigned long a; int b, c; void *d; } f;
+
+unsigned long f1 (unsigned long);
+void f2 (int, struct T *);
+void *f3 (void *);
+unsigned long volatile g;
+
+static void
+f4 (struct T *p)
+{
+ f1 (f1 (((unsigned long) g - p->a) >> 20));
+}
+
+static struct T *
+f5 (void)
+{
+ struct T *g, *p;
+ struct T *q = 0;
+ for (g = p = &f; (g = p = (struct T *) (g->e.a)) != &f;)
+ if (p->b)
+ {
+ f4 (p);
+ if (p->c & 0x80000)
+ return p;
+ }
+ return q;
+}
+
+static void
+f6 (struct T *p)
+{
+ f2 (9, p);
+}
+
+static inline void *
+f7 (struct T *t)
+{
+ void *d;
+ d = t->d;
+ if (d)
+ d = f3 (d);
+ return d;
+}
+
+static void *
+f8 (struct T *p)
+{
+ void *d = f7 (p);
+ if (!d)
+ return 0;
+ f6 (p);
+ return d;
+}
+
+static void
+f9 (void)
+{
+ struct T *p;
+ p = f5 ();
+ f8 (p);
+}
+
+void
+test (void)
+{
+ f9 ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040622-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040622-2.c
new file mode 100644
index 000000000..0be320fa4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040622-2.c
@@ -0,0 +1,11 @@
+/* { dg-do link } */
+/* { dg-require-effective-target ptr32plus } */
+/* This validates codegen for [r1+32760] on Darwin. */
+void f(char x[32688], double *y, double *z) __attribute__((noinline));
+void f(char x[32688], double *y, double *z) {}
+main() {
+ char x[32688];
+ double y, z;
+ y = z = 3.0;
+ f(x, &y, &z);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040625-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040625-1.c
new file mode 100644
index 000000000..0a576a5b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040625-1.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-mminimal-toc" { target { { powerpc*-*-* && lp64 } || { powerpc-ibm-aix* } } } } */
+
+extern void abort (void);
+extern void exit (int);
+
+double __attribute__((noinline))
+foo (void)
+{
+ return 16441577472.0;
+}
+
+double __attribute__((noinline))
+bar (double x)
+{
+ return x;
+}
+
+int __attribute__((noinline))
+test (void)
+{
+ double x = foo ();
+ x = bar (x);
+ x /= 1024L * 1024L * 1024L;
+ x *= 70;
+ x = x < 70 ? x : 70;
+ x += 30;
+ return x;
+}
+
+int main (void)
+{
+ if (test () != 100)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040627-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040627-1.c
new file mode 100644
index 000000000..2b4f09fef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040627-1.c
@@ -0,0 +1,42 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+
+void test(int x)
+{
+ if ((x & ~x) != 0)
+ link_error ();
+ if ((~x & x) != 0)
+ link_error ();
+
+ if ((x ^ ~x) != -1)
+ link_error ();
+ if ((~x ^ x) != -1)
+ link_error ();
+
+ if ((x | ~x) != -1)
+ link_error ();
+ if ((~x | x) != -1)
+ link_error ();
+
+ if (x && !x)
+ link_error ();
+ if (!x && x)
+ link_error ();
+
+ if (!(x || !x))
+ link_error ();
+ if (!(!x || x))
+ link_error ();
+}
+
+int main()
+{
+ test (0);
+ test (1);
+ test (-1);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040813-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040813-1.c
new file mode 100644
index 000000000..8be831d96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040813-1.c
@@ -0,0 +1,15 @@
+/* Test lang in N_SO stab. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* *-*-vxworks* } { "*" } { "" } } */
+/* { dg-options "-gstabs" } */
+
+int
+main ()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler ".stabs.*100,0,2" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040910-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040910-1.c
new file mode 100644
index 000000000..ff772ab57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040910-1.c
@@ -0,0 +1,2 @@
+/* Tests error recovery for invalid code. */
+__attribute__((foo) int f (){} /* { dg-error "(parse error|syntax error|expected '\\)') before 'int'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040916-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040916-1.c
new file mode 100644
index 000000000..fbea9e385
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040916-1.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* PR17513 - we hit a bug where EDGE_EXECUTABLE was not cleared on
+ successors of the entry block. This lead to a flow verification
+ error much later in the compilation (after gcse). */
+typedef unsigned char uint8;
+typedef unsigned int uint32;
+
+uint32 marker = 0;
+uint8 *buff = 0;
+uint32 bsize = 0;
+
+extern int foo (void);
+
+uint32
+bar (void)
+{
+ int len, d;
+
+ for (;;)
+ {
+ if (foo () == 0)
+ return (0);
+
+ switch (marker)
+ {
+ case 0xfe:
+ {
+ len |= (*buff++);
+ bsize -= 2;
+
+ while (len > 0)
+ {
+ d = *buff++;
+ len--;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20040920-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20040920-1.c
new file mode 100644
index 000000000..a38ff8889
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20040920-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+int bob;
+struct a
+{
+ int foo;
+};
+int main(void)
+{
+ struct a bar;
+ bob(5); /* { dg-error "called object 'bob' is not a function" } */
+ bar.foo(); /* { dg-error "called object 'bar.foo' is not a function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20041014-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20041014-1.c
new file mode 100644
index 000000000..699844074
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20041014-1.c
@@ -0,0 +1,10 @@
+/* PR c/17023 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f(a, b)
+ int a;
+ int b[({ void h() {} 1; })]; /* { dg-error "braced-group" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20041104-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20041104-1.c
new file mode 100644
index 000000000..b4d359d1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20041104-1.c
@@ -0,0 +1,18 @@
+/* This testcase exposed the same bug as PR 15342. */
+/* { dg-options "-O2 -frename-registers -fno-schedule-insns" } */
+
+void *memcpy (void *, const void *, __SIZE_TYPE__);
+
+void f (int n, int (*x)[4])
+{
+ while (n--)
+ {
+ int f = x[0][0];
+ if (f <= 0)
+ memcpy (&x[1], &x[0], sizeof (x[0]));
+ else
+ memcpy (&x[f], &x[0], sizeof (x[0]));
+ f = x[0][2];
+ x[0][1] = f;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20041106-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20041106-1.c
new file mode 100644
index 000000000..cba4a06f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20041106-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* } } */
+/* { dg-options -O2 } */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+struct S { long x __attribute__((packed)); }; /* { dg-warning "attribute ignored" "" { target default_packed } } */
+volatile long sink;
+
+void foo (struct S *s)
+{
+ sink = s->x;
+}
+
+int main ()
+{
+ size_t ps = getpagesize ();
+ char *ptr, *page;
+ struct S *s;
+
+ ptr = malloc (3*ps);
+ page = (char *)(((__UINTPTR_TYPE__)ptr + (ps - 1)) & -ps);
+ munmap (page + ps, ps);
+
+ s = (struct S *)(page + ps - sizeof(struct S));
+ foo(s);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20041122-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20041122-1.c
new file mode 100644
index 000000000..2d9faccba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20041122-1.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/18611 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fmove-loop-invariants" } */
+typedef struct {
+ int channels_per_image;
+ int channel[8];
+} CineonImageInformation;
+void
+dumpCineonImageInfo(CineonImageInformation* imageInfo) {
+
+ int i;
+ for (i = 0; i < imageInfo->channels_per_image; ++i) {
+ dumpCineonChannelInfo(&imageInfo->channel[i]);
+ }
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20041213-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20041213-1.c
new file mode 100644
index 000000000..aeff7443c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20041213-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-fshow-column" } */
+/* test redeclarations with void and implicit int */
+extern foo1(); /* { dg-message "8:note: previous declaration" } */
+extern void foo1(); /* { dg-error "13:conflicting types" } */
+
+extern void foo2(); /* { dg-message "13:note: previous declaration" } */
+extern foo2(); /* { dg-error "8:conflicting types" } */
+
+void foo3() {} /* { dg-message "6:note: previous definition" } */
+extern foo3(); /* { dg-error "8:conflicting types" } */
+
+extern foo4(); /* { dg-message "8:note: previous declaration" } */
+void foo4() {} /* { dg-error "6:conflicting types" } */
+
+extern void foo5(); /* { dg-message "13:note: previous declaration" } */
+foo5() {} /* { dg-warning "1:conflicting types" } */
+
+foo6() {} /* { dg-message "1:note: previous definition" } */
+extern void foo6(); /* { dg-error "13:conflicting types" } */
+
+foo7() {} /* { dg-message "1:note: previous definition" } */
+void foo7() {} /* { dg-error "6:conflicting types" } */
+
+void foo8() {} /* { dg-message "6:note: previous definition" } */
+foo8() {} /* { dg-error "1:conflicting types" } */
+
+int use9() { foo9(); } /* { dg-message "note: previous implicit declaration" } */
+extern void foo9(); /* { dg-warning "13:conflicting types" } */
+
+int use10() { foo10(); } /* { dg-message "note: previous implicit declaration" } */
+void foo10() {} /* { dg-warning "6:conflicting types" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20041219-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20041219-1.c
new file mode 100644
index 000000000..4fdc9540d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20041219-1.c
@@ -0,0 +1,47 @@
+/* PR18191 Struct member is not getting default-initialized.
+ Origin: Grigory Zagorodnev <grigory.zagorodnev@intel.com> */
+
+/* { dg-do run } */
+
+extern int printf (__const char *__restrict __format, ...);
+
+typedef struct S {
+ const char* s;
+ int i;
+} S;
+
+void
+foo (void)
+{
+ S dummy[2];
+ unsigned i;
+
+ /* Put some garbage on the stack. */
+ for (i = 0; i < sizeof(dummy); i++)
+ ((char *)&dummy)[i] = -1;
+}
+
+int
+bar (void)
+{
+ /* Allocate object on the stack. */
+ S obj[2] = { {"m0"}, {"m1"} };
+
+ /* Assume fields those not explicitly initialized
+ are default initialized to 0 [8.5.1/7 and 8.5/5]. */
+ if (obj[0].i == 0)
+ return 0;
+ else
+ {
+ printf("Failed: obj[0].i == '%d', expecting '0'\n", obj[0].i);
+ return 1;
+ }
+}
+
+int
+main (void)
+{
+ foo();
+ return bar();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050105-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050105-1.c
new file mode 100644
index 000000000..58a75150b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050105-1.c
@@ -0,0 +1,31 @@
+/* PR rtl-optimization/18861 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int
+foo (int code)
+{
+ if (code >= 3)
+ switch (code)
+ {
+ case 3: return 4;
+ case 4: return 3;
+ case 5: return 6;
+ case 6: return 7;
+ case 7: return 8;
+ case 8: return 5;
+ default: abort ();
+ }
+ switch (code)
+ {
+ case 3: return 4;
+ case 4: return 3;
+ case 5: return 6;
+ case 6: return 7;
+ case 7: return 8;
+ case 8: return 5;
+ default: abort ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050105-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050105-2.c
new file mode 100644
index 000000000..02ac1596b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050105-2.c
@@ -0,0 +1,32 @@
+/* PR tree-optimization/18828 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+void foo (int x, ...)
+{
+ va_list ap;
+ if (x != 21)
+ abort ();
+ va_start (ap, x);
+ va_end (ap);
+}
+
+void bar (int x, ...)
+{
+ va_list ap;
+ x++;
+ va_start (ap, x);
+ va_end (ap);
+}
+
+void baz (int x, ...)
+{
+ va_list ap;
+ x = 0;
+ va_start (ap, x);
+ va_end (ap);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050111-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050111-1.c
new file mode 100644
index 000000000..0ad256fec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050111-1.c
@@ -0,0 +1,21 @@
+/* PR middle-end/19084, rtl-optimization/19348 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+unsigned int
+foo (unsigned long long x)
+{
+ unsigned int u;
+
+ if (x == 0)
+ return 0;
+ u = (unsigned int) (x >> 32);
+ return u;
+}
+
+unsigned long long
+bar (unsigned short x)
+{
+ return (unsigned long long) x << 32;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050111-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050111-2.c
new file mode 100644
index 000000000..17e59ce96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050111-2.c
@@ -0,0 +1,21 @@
+/* PR rtl-optimization/15139 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+void
+foo (double **a, double **z)
+{
+ long int i, j;
+ double d = -1.0;
+
+ for (i = 0; i < 6; i++)
+ for (j = 0; j < 5; j++)
+ d = z[i][j] > d ? z[i][j] : d;
+
+ for (i = 0; i < 6; i++)
+ for (j = 0; j < 5; j++)
+ z[i][j] /= d;
+
+ for (i = 0; i < 5; i++)
+ a[i][j] = z[i][j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050121-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050121-1.c
new file mode 100644
index 000000000..3fe299a6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050121-1.c
@@ -0,0 +1,9 @@
+/* I accidentally broke this while developing a patch for PR 13000,
+ and didn't notice since the testsuite didn't catch it -- ian */
+/* { dg-do-compile } */
+
+void foo()
+{
+ return;
+ break; /* { dg-error "break statement not within" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050121-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050121-2.c
new file mode 100644
index 000000000..6a6092c90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050121-2.c
@@ -0,0 +1,67 @@
+/* PR middle-end/19551 */
+/* { dg-options "-O2" } */
+/* { dg-do link } */
+
+extern void abort ();
+
+#define T(type, name) \
+extern __attribute__((pure)) _Complex type \
+foo_c##name (int x); \
+ \
+void \
+bar_c##name (type *x) \
+{ \
+ type f = __real foo_c##name (5); \
+ if (0) *x = f; \
+} \
+ \
+void \
+baz_c##name (type *x) \
+{ \
+ type f = __imag foo_c##name (5); \
+ if (0) *x = f; \
+} \
+ \
+extern __attribute__((pure)) type \
+foo_##name (int x); \
+ \
+void \
+bar_##name (type *x) \
+{ \
+ type f = foo_##name (5); \
+ if (0) *x = f; \
+}
+
+typedef long double ldouble_t;
+typedef long long llong;
+
+T (float, float)
+T (double, double)
+T (long double, ldouble_t)
+T (char, char)
+T (short, short)
+T (int, int)
+T (long, long)
+T (long long, llong)
+#undef T
+
+int
+main (void)
+{
+#define T(type, name) \
+ { \
+ type var = 0; \
+ bar_c##name (&var); \
+ baz_c##name (&var); \
+ bar_##name (&var); \
+ }
+ T (float, float)
+ T (double, double)
+ T (long double, ldouble_t)
+ T (char, char)
+ T (short, short)
+ T (int, int)
+ T (long, long)
+ T (long long, llong)
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050209-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050209-1.c
new file mode 100644
index 000000000..0a62ce351
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050209-1.c
@@ -0,0 +1,5 @@
+/* Test for infinite loop in parser error recovery. From Serge
+ Belyshev <ssb> on IRC. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int f() { return 1); } /* { dg-error "parse|syntax|expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050307-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050307-1.c
new file mode 100644
index 000000000..0e8dac69a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050307-1.c
@@ -0,0 +1,52 @@
+/* PR target/20322 */
+
+extern void abort (void);
+
+typedef unsigned long T;
+typedef struct
+{
+ T a, b;
+ unsigned char c, d;
+} S;
+
+#define M (sizeof (T) * 4)
+
+S __attribute__((noinline))
+foo (T x, T y)
+{
+ S e;
+ T f[2], g;
+
+ e.b = (x & (~(T) 0 >> M)) * (y & (~(T) 0 >> M));
+ e.a = (x >> M) * (y >> M);
+
+ f[0] = (x & (~(T) 0 >> M)) * (y >> M);
+ f[1] = (x >> M) * (y & (~(T) 0 >> M));
+
+ g = e.b;
+ e.b += (f[0] & (~(T) 0 >> M)) << M;
+ if (e.b < g)
+ e.a++;
+
+ g = e.b;
+ e.b += (f[1] & (~(T) 0 >> M)) << M;
+ if (e.b < g)
+ e.a++;
+
+ e.a += (f[0] >> M);
+ e.a += (f[1] >> M);
+ e.c = 1;
+ e.d = 0;
+
+ return e;
+}
+
+int
+main (void)
+{
+ T x = 1UL << (M * 2 - 1);
+ S y = foo (1, x);
+ if (y.a || y.b != x || y.c != 1 || y.d)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050309-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050309-1.c
new file mode 100644
index 000000000..8e11bc5c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050309-1.c
@@ -0,0 +1,37 @@
+/* This caused an ICE on s390 due to incorrect secondary
+ output reloads. */
+
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O2 -fprofile-generate" } */
+
+char *
+test(char *ret, int *counter, void *schema,
+ const char* name, const char *namespace,
+ void *node, int topLevel)
+{
+ char buf[30];
+ int val;
+
+ if (counter == 0) return 0;
+ if (schema == 0) return 0;
+ if (name == 0) return 0;
+
+ __builtin_memset (ret, 0, 100);
+ lookup (schema, name, -1);
+ val = hash (schema, name, namespace, name, ret);
+ if (val == 0) return ret;
+
+ if (topLevel != 0)
+ {
+ error (1, 0, 0, node, "%s", name);
+ return 0;
+ }
+
+ __snprintf_chk (buf, 29, 1, 30, "#eCont %d", ++*counter);
+ val = hash (schema, name, buf, namespace, ret);
+ if (val == 0) return ret;
+
+ error (1, 0, 0, node, "%s", name);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050321-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050321-1.c
new file mode 100644
index 000000000..79f62a326
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050321-1.c
@@ -0,0 +1,26 @@
+/* This caused an ICE on powerpc-linux-gnu due to not
+ up-to-date life info (PR middle-end/20177). */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fmodulo-sched" } */
+extern void * malloc (__SIZE_TYPE__);
+
+struct s {
+ int k;
+};
+
+int n;
+struct s *a1, *(*use)[];
+float (*vector)[];
+
+void
+foo (float *V)
+{
+ int i, used = 0;
+
+ vector = malloc (i * sizeof (float));
+ while ((*use)[used] != a1)
+ used += 1;
+ for (i = 0; i < n; i++)
+ *V += (*vector)[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c
new file mode 100644
index 000000000..1c5575bde
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c
@@ -0,0 +1,55 @@
+/* This testcase could not assemble on ppc32, because the compiler assumed
+ the huge ADDR_DIFF_VEC will be emitted into rodata section, yet because
+ of some notes inserted between jump table's CODE_LABEL and the jump table
+ it ended up in the .text section and thus shorten_branches couldn't
+ figure out branch to lab is too far. */
+/* { dg-do link { target fpic } } */
+/* { dg-options "-g1 -fpic" } */
+/* { dg-require-effective-target int32plus } */
+
+#define A(n) \
+ case n##1: return n##1 * 131 + 63; \
+ case n##3: return n##3 * 1231 + 182; \
+ case n##5: return n##5 * 351 + 1; \
+ case n##7: return n##7 * 312 + 61; \
+ case n##9: return n##9 * 17 - 1;
+#define B(n) \
+A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) \
+A(n##5) A(n##6) A(n##7) A(n##8) A(n##9)
+#define C(n) \
+B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) \
+B(n##5) B(n##6) B(n##7) B(n##8) B(n##9)
+#define D(n) \
+C(n##0) C(n##1) B(n##20) B(n##21) B(n##22)
+
+int
+foo (int x)
+{
+ {
+lab:;
+ int a = x;
+ while (a < 60000)
+ {
+ int b = a;
+ {
+ int c = b;
+ switch (c)
+ {
+ D(1)
+ default: break;
+ }
+ }
+ a += 10000;
+ if (a == 4168)
+ goto lab;
+ }
+ }
+ return x;
+}
+
+int
+main (void)
+{
+ foo (71);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050325-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050325-1.c
new file mode 100644
index 000000000..5760e387a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050325-1.c
@@ -0,0 +1,19 @@
+/* PR 20249 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-arcs" } */
+
+extern int *g (int x, void* y);
+extern void fg (long long x, int y);
+
+static void
+ff (int y, long long z)
+{
+ fg (z, 1);
+}
+
+void
+f ()
+{
+ g (42, ff);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050330-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050330-1.c
new file mode 100644
index 000000000..69b5f9dcf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050330-1.c
@@ -0,0 +1,14 @@
+/* This test is a reduced test case for a bug that caused
+ ICE while bootstrapping with -fmodulo-sched on powerpc-apple-darwin
+ related to (PR middle-end/20177). */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fmodulo-sched" } */
+
+void
+foo ( const char *bytes, int len , char *buf)
+{
+ int i;
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c
new file mode 100644
index 000000000..f2562a8cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050330-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O2 -fprofile-generate" } */
+
+struct S
+{
+ int a;
+ void **b;
+};
+
+void
+foo (struct S *x, int y)
+{
+ if (!x)
+ return;
+ if (y >= x->a)
+ return;
+ x->a--;
+ for (; y < x->a; y++)
+ x->b[y] = x->b[y + 1];
+ x->b[x->a] = (void *) 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050503-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050503-1.c
new file mode 100644
index 000000000..f85129a95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050503-1.c
@@ -0,0 +1,50 @@
+/* PR middle-end/21265
+ Test whether tail call information is propagated through builtin
+ expanders. */
+/* { dg-do compile } */
+/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! nonpic } } } { "*" } { "" } } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+#define F(n, rettype, name, args, callargs) \
+extern rettype name args; \
+rettype test##n args \
+{ \
+ return name callargs; \
+}
+#define F1(n, rettype, name, t1, callargs) \
+ F (n, rettype, name, (t1 a1), callargs)
+#define F2(n, rettype, name, t1, t2, callargs) \
+ F (n, rettype, name, (t1 a1, t2 a2), callargs)
+#define F3(n, rettype, name, t1, t2, t3, callargs) \
+ F (n, rettype, name, (t1 a1, t2 a2, t3 a3), callargs)
+
+F3 (1a, void *, memcpy, void *, const void *, size_t, (a1, a2, a3))
+F3 (1b, void *, memcpy, void *, const void *, size_t, (a1, a2, 10))
+F3 (2a, void *, mempcpy, void *, const void *, size_t, (a1, a2, a3))
+F3 (2b, void *, mempcpy, void *, const void *, size_t, (a1, a2, 10))
+F3 (3a, void *, memmove, void *, const void *, size_t, (a1, a2, a3))
+F3 (3b, void *, memmove, void *, const void *, size_t, (a1, "abcdefghijklmno", a3))
+F3 (4a, void *, memset, void *, int, size_t, (a1, a2, a3))
+F3 (4b, void *, memset, void *, int, size_t, (a1, a2, 156))
+F3 (4c, void *, memset, void *, int, size_t, (a1, 0, a3))
+F3 (4d, void *, memset, void *, int, size_t, (a1, 0, 10000))
+F3 (5a, int, memcmp, const void *, const void *, size_t, (a1, a2, a3))
+F3 (5b, int, memcmp, const void *, const void *, size_t, (a1, "abcdefghijkl", a3))
+F2 (6, char *, strcpy, char *, const char *, (a1, a2))
+F2 (7, char *, stpcpy, char *, const char *, (a1, a2))
+F3 (8, char *, strncpy, char *, const char *, size_t, (a1, a2, a3))
+F3 (9, char *, stpncpy, char *, const char *, size_t, (a1, a2, a3))
+F2 (10, char *, strcat, char *, const char *, (a1, a2))
+F3 (11, char *, strncat, char *, const char *, size_t, (a1, a2, a3))
+F1 (12a, size_t, strlen, const char *, (a1))
+F1 (12b, size_t, strlen, const char *, ("foobar"))
+F2 (13a, int, strcmp, const char *, const char *, (a1, a2))
+F2 (13b, int, strcmp, const char *, const char *, (a1, "abcdefghijklm"))
+F3 (14a, int, strncmp, const char *, const char *, size_t, (a1, a2, a3))
+F3 (14b, int, strncmp, const char *, const char *, size_t, (a1, "abcdefghijklm", 10))
+F2 (15, char *, strchr, const char *, int, (a1, a2))
+
+/* All the calls above should be tail call optimized on i?86/x86-64. */
+/* { dg-final { scan-assembler-not "call" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050517-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050517-1.c
new file mode 100644
index 000000000..856fda206
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050517-1.c
@@ -0,0 +1,8 @@
+/* Tree PRE is going to transform this so that it doesn't call cos on the
+ d = 0 path, and in doing so, it needs to regenerate the cos call.
+ This was ICE'ing due to an overly strict check on what it knew how
+ to regenerate. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+double cos(double);
+double f(double d, double i, int j) { if (j == 1) d = 0; return d * cos(i); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050527-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050527-1.c
new file mode 100644
index 000000000..1b3232447
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050527-1.c
@@ -0,0 +1,55 @@
+/* PR c/21536 */
+/* { dg-do run } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+extern void free (void *);
+
+void *
+foo (int x, int y)
+{
+ void *d = malloc (x * y * sizeof (double));
+ double (*e)[x][y] = d;
+ x += 10;
+ y += 10;
+ if (x > 18)
+ (*e)[x - 12][y - 12] = 0.0;
+ else
+ (*e)[x - 11][y - 11] = 1.0;
+ return d;
+}
+
+void *
+bar (int x, int y)
+{
+ void *d = malloc (x * y * sizeof (double));
+ struct S
+ {
+ double (*e)[x][y];
+ double (*f)[x][y];
+ } s;
+ s.e = d;
+ s.f = d;
+ x += 10;
+ y += 10;
+ if (x > 18)
+ (*s.e)[x - 12][y - 12] = 0.0;
+ else
+ (*s.e)[x - 11][y - 11] = 1.0;
+ if (x > 16)
+ (*s.f)[x - 13][y - 13] = 0.0;
+ else
+ (*s.f)[x - 14][y - 14] = 1.0;
+ return d;
+}
+
+int
+main ()
+{
+ void *d1 = foo (10, 10);
+ void *d2 = bar (10, 10);
+ free (d1);
+ free (d2);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050603-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050603-2.c
new file mode 100644
index 000000000..363e3cdf3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050603-2.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+#include <stdlib.h>
+struct s {
+ unsigned short f: 16;
+ unsigned short y: 8;
+ unsigned short g: 2;
+ unsigned int x;
+};
+
+void set (struct s*, int) __attribute__((noinline));
+void set (struct s* p, int flags) {
+ p->g = flags << 1;
+}
+main() {
+ struct s foo = {0 , 0, 3, 0};
+ set (&foo, -1);
+ if (foo.g != 2)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050607-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050607-1.c
new file mode 100644
index 000000000..83c096748
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050607-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target trampolines } */
+/* { dg-options "-Wpadded" }
+/* The struct internally constructed for the nested function should
+ not result in a warning from -Wpadded. */
+extern int baz(int (*) (int));
+int foo(void)
+{
+ int k = 3;
+ int bar(int x) {
+ return x + k;
+ }
+ return baz(bar);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050620-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050620-1.c
new file mode 100644
index 000000000..befdd9636
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050620-1.c
@@ -0,0 +1,15 @@
+/* PR middle-end/22028 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+foo (void)
+{
+ struct { int i[]; } u; /* { dg-error "flexible array member" } */
+}
+
+void
+bar (void)
+{
+ struct { struct a b; } c; /* { dg-error "has incomplete type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050629-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050629-1.c
new file mode 100644
index 000000000..0dd47f702
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050629-1.c
@@ -0,0 +1,297 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -w" } */
+
+/* This file was automatically reduced from tree-ssa-operands.c. It
+ contains many warnings, but it exposes a copy propagation bug that
+ is somewhat difficult to reproduce otherwise. */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+ extern void fancy_abort (const char *, int, const char *) __attribute__ ((__noreturn__));
+ typedef union tree_node *tree;
+ enum tree_code {
+ TREE_LIST, ARRAY_TYPE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, STRING_CST, LT_EXPR, GE_EXPR, LABEL_EXPR, ASM_EXPR, SSA_NAME, };
+ enum tree_code_class {
+ tcc_type, tcc_reference, tcc_expression };
+ extern const enum tree_code_class tree_code_type[];
+ extern const unsigned char tree_code_length[];
+ struct tree_common {
+ union tree_ann_d *ann;
+ __extension__ enum tree_code code : 8;
+ };
+ struct tree_string {
+ char str[1];
+ };
+ struct tree_list {
+ tree purpose;
+ tree value;
+ };
+ struct tree_exp {
+ tree operands[1];
+ };
+ typedef struct ssa_use_operand_d {
+ struct ssa_use_operand_d* prev;
+ struct ssa_use_operand_d* next;
+ tree stmt;
+ tree * use;
+ }
+ ssa_use_operand_t;
+ struct tree_ssa_name {
+ struct ssa_use_operand_d imm_uses;
+ };
+ union tree_node {
+ struct tree_common common;
+ struct tree_string string;
+ struct tree_list list;
+ struct tree_exp exp;
+ struct tree_ssa_name ssa_name;
+ };
+ typedef struct bitmap_head_def *bitmap;
+ typedef union varray_data_tag {
+ char c[1];
+ int i[1];
+ tree * tp[1];
+ }
+ varray_data;
+ struct varray_head_tag {
+ size_t num_elements;
+ size_t elements_used;
+ varray_data data;
+ };
+ typedef struct varray_head_tag *varray_type;
+ extern void varray_check_failed (varray_type, size_t, const char *, int, const char *) __attribute__ ((__noreturn__));
+ typedef ssa_use_operand_t *use_operand_p;
+ struct use_optype_d {
+ struct use_optype_d *next;
+ struct ssa_use_operand_d use_ptr;
+ };
+ typedef struct use_optype_d *use_optype_p;
+ struct ssa_operand_memory_d {
+ char mem[(2048 - sizeof (void *))];
+ };
+ struct stmt_operands_d {
+ struct use_optype_d * use_ops;
+ };
+ struct ptr_info_def {
+ tree name_mem_tag;
+ };
+ typedef struct subvar *subvar_t;
+ struct var_ann_d {
+ size_t uid;
+ };
+ struct stmt_ann_d {
+ unsigned modified : 1;
+ struct stmt_operands_d operands;
+ bitmap addresses_taken;
+ };
+ typedef struct var_ann_d *var_ann_t;
+ typedef struct stmt_ann_d *stmt_ann_t;
+ static __inline__ var_ann_t var_ann (tree t) {
+ }
+ static __inline__ stmt_ann_t stmt_ann (tree t) {
+ ((void)(!(is_gimple_stmt (t)) ? fancy_abort ("/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-flow-inline.h", 55, __FUNCTION__), 0 : 0));
+ return (stmt_ann_t) t->common.ann;
+ }
+ static __inline__ unsigned char stmt_modified_p (tree t) {
+ stmt_ann_t ann = stmt_ann (t);
+ return ann ? ann->modified : 1;
+ }
+ static __inline__ void delink_imm_use (ssa_use_operand_t *linknode) {
+ if (linknode->prev == ((void *)0)) return;
+ linknode->prev->next = linknode->next;
+ linknode->next->prev = linknode->prev;
+ linknode->prev = ((void *)0);
+ linknode->next = ((void *)0);
+ }
+ static __inline__ void link_imm_use_to_list (ssa_use_operand_t *linknode, ssa_use_operand_t *list) {
+ linknode->prev = list;
+ linknode->next = list->next;
+ list->next = linknode;
+ }
+ static __inline__ void link_imm_use (ssa_use_operand_t *linknode, tree def) {
+ ssa_use_operand_t *root;
+ if (!def || ((enum tree_code) (def)->common.code) != SSA_NAME) linknode->prev = ((void *)0);
+ else {
+ root = &(__extension__ ({ const tree __t = (def); if (((enum tree_code) (__t)->common.code) != (SSA_NAME)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-flow-inline.h", 222, __FUNCTION__, (SSA_NAME), 0); __t; }
+)->ssa_name.imm_uses);
+ link_imm_use_to_list (linknode, root);
+ }
+ }
+ static __inline__ void link_imm_use_stmt (ssa_use_operand_t *linknode, tree def, tree stmt) {
+ link_imm_use (linknode, def);
+ }
+ struct ggc_root_tab {
+ };
+ struct opbuild_list_d {
+ varray_type vars;
+ varray_type uid;
+ varray_type next;
+ int first;
+ unsigned num;
+ };
+ static struct opbuild_list_d build_uses;
+ static struct opbuild_list_d build_v_may_defs;
+ static struct ssa_operand_memory_d *operand_memory = ((void *)0);
+ static unsigned operand_memory_index;
+ static use_optype_p free_uses = ((void *)0);
+ static __inline__ int opbuild_next (struct opbuild_list_d *list, int prev) {
+ return __extension__ (*({
+ varray_type const _va = (list->next);
+ const size_t _n = (prev);
+ if (_n >= _va->num_elements) varray_check_failed (_va, _n, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 323, __FUNCTION__);
+ &_va->data.i[_n];
+ }
+));
+ }
+ static __inline__ tree * opbuild_elem_real (struct opbuild_list_d *list, int elem) {
+ return __extension__ (*({
+ varray_type const _va = (list->vars);
+ const size_t _n = (elem);
+ if (_n >= _va->num_elements) varray_check_failed (_va, _n, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 332, __FUNCTION__);
+ &_va->data.tp[_n];
+ }
+));
+ }
+ static __inline__ void opbuild_clear (struct opbuild_list_d *list) {
+ ((list->vars)->elements_used = 0);
+ ((list->next)->elements_used = 0);
+ }
+ static __inline__ void * ssa_operand_alloc (unsigned size) {
+ char *ptr;
+ if (operand_memory_index + size >= (2048 - sizeof (void *))) {
+ ptr = ggc_alloc_stat (sizeof (struct ssa_operand_memory_d) );
+ }
+ ptr = &(operand_memory->mem[operand_memory_index]);
+ return ptr;
+ }
+ static __inline__ void correct_use_link (use_operand_p ptr, tree stmt) {
+ use_operand_p prev;
+ tree root;
+ prev = ptr->prev;
+ if (prev) {
+ unsigned char stmt_mod = 1;
+ while (stmt_mod) { while (prev->stmt == stmt || prev->stmt == ((void *)0)) prev = prev->prev; if (prev->use == ((void *)0)) stmt_mod = 0; else if ((stmt_mod = stmt_modified_p (prev->stmt))) prev = prev->prev; }
+ if (prev->use == ((void *)0)) root = prev->stmt;
+ else root = *(prev->use);
+ if (root == *(ptr->use)) return;
+ }
+ delink_imm_use (ptr);
+ link_imm_use (ptr, *(ptr->use));
+ }
+ static __inline__ struct use_optype_d * alloc_use (void) {
+ struct use_optype_d *ret;
+ {
+ free_uses = free_uses->next;
+ }
+ ret = (struct use_optype_d *)ssa_operand_alloc (sizeof (struct use_optype_d));
+ return ret;
+ }
+ static __inline__ void finalize_ssa_use_ops (tree stmt) {
+ int new_i;
+ struct use_optype_d *old_ops, *ptr, *last;
+ tree * old_base;
+ struct use_optype_d new_list;
+ last = &new_list;
+ if (old_ops) old_base = ((old_ops)->use_ptr.use);
+ while (old_ops && new_i != -1) {
+ tree * new_base = opbuild_elem_real (&build_uses, (new_i));
+ if (old_base == new_base) { last->next = old_ops; last = old_ops; correct_use_link ((&((last)->use_ptr)), stmt); old_ops = old_ops->next; new_i = opbuild_next (&build_uses, new_i); }
+ else if (old_base < new_base) { use_operand_p use_p = (&((old_ops)->use_ptr)); delink_imm_use (use_p); old_ops = old_ops->next; ptr->next = free_uses; }
+ else { ptr = alloc_use (); (ptr)->use_ptr.use = (opbuild_elem_real (&build_uses, (new_i))); link_imm_use_stmt (&((ptr)->use_ptr), *(opbuild_elem_real (&build_uses, (new_i))), (stmt)); new_i = opbuild_next (&build_uses, new_i); }
+ if (old_ops) old_base = ((old_ops)->use_ptr.use);
+ }
+ for ( ;
+ new_i != -1;
+ new_i = opbuild_next (&build_uses, new_i)) {
+ ptr = alloc_use ();
+ (ptr)->use_ptr.use = (opbuild_elem_real (&build_uses, (new_i)));
+ link_imm_use_stmt (&((ptr)->use_ptr), *(opbuild_elem_real (&build_uses, (new_i))), (stmt));
+ }
+ {
+ { use_operand_p use_p = (&((ptr)->use_ptr)); delink_imm_use (use_p); }
+ }
+ (stmt_ann (stmt)->operands.use_ops) = new_list.next;
+ {
+ unsigned x = 0;
+ for (ptr = (stmt_ann (stmt)->operands.use_ops);
+ ptr;
+ ptr = ptr->next) x++;
+ }
+ }
+ finalize_ssa_uses (tree stmt) {
+ {
+ unsigned x;
+ ((void)(!(*(opbuild_elem_real (&build_uses, x)) != stmt) ? fancy_abort ("/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 581, __FUNCTION__), 0 : 0));
+ }
+ finalize_ssa_use_ops (stmt);
+ opbuild_clear (&build_uses);
+ }
+ finalize_ssa_v_may_def_ops (tree stmt) {
+ int new_i;
+ {
+ }
+ for ( ;
+ new_i != -1;
+ new_i = opbuild_next (&build_v_may_defs, new_i)) {
+ }
+ {
+ }
+ }
+ get_expr_operands (tree stmt, tree *expr_p, int flags) {
+ enum tree_code code;
+ tree expr = *expr_p;
+ {
+ { subvar_t svars; if (var_can_have_subvars (expr) && (svars = get_subvars_for_var (expr))) { } { } }
+ { { if (code == LT_EXPR || code == GE_EXPR) { swap_tree_operands (stmt, &__extension__ (*({const tree __t = __extension__ ({ const tree __t = (expr); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) >= tcc_reference && (__c) <= tcc_expression)) tree_class_check_failed (__t, tcc_expression, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1435, __FUNCTION__); __t; }); const int __i = (0); if (__i < 0 || __i >= tree_code_length[(int) (((enum tree_code) (__t)->common.code))]) tree_operand_check_failed (__i, ((enum tree_code) (__t)->common.code), "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1435, __FUNCTION__); &__t->exp.operands[__i]; })), &__extension__ (*({const tree __t = __extension__ ({ const tree __t = (expr); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) >= tcc_reference && (__c) <= tcc_expression)) tree_class_check_failed (__t, tcc_expression, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1436, __FUNCTION__); __t; }); const int __i = (1); if (__i < 0 || __i >= tree_code_length[(int) (((enum tree_code) (__t)->common.code))]) tree_operand_check_failed (__i, ((enum tree_code) (__t)->common.code), "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1436, __FUNCTION__); &__t->exp.operands[__i]; }))); } { } } }
+ }
+ }
+ get_asm_expr_operands (tree stmt) {
+ int noutputs = list_length (__extension__ (*({
+const tree __t = __extension__ ({ const tree __t = (__extension__ ({ const tree __t = (stmt); if (((enum tree_code) (__t)->common.code) != (ASM_EXPR)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1495, __FUNCTION__, (ASM_EXPR), 0); __t; })); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) >= tcc_reference && (__c) <= tcc_expression)) tree_class_check_failed (__t, tcc_expression, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1495, __FUNCTION__); __t; }
+);
+ const int __i = (1);
+ if (__i < 0 || __i >= tree_code_length[(int) (((enum tree_code) (__t)->common.code))]) tree_operand_check_failed (__i, ((enum tree_code) (__t)->common.code), "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1495, __FUNCTION__);
+ &__t->exp.operands[__i];
+ }
+)));
+ const char **oconstraints = (const char **) __builtin_alloca((noutputs) * sizeof (const char *));
+ int i;
+ tree link;
+ const char *constraint;
+ unsigned char allows_mem, allows_reg, is_inout;
+ {
+ oconstraints[i] = constraint = ((const char *)(__extension__ ({ const tree __t = ((__extension__ ({ const tree __t = ((__extension__ ({ const tree __t = (link); if (((enum tree_code) (__t)->common.code) != (TREE_LIST)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1506, __FUNCTION__, (TREE_LIST), 0); __t; })->list.purpose)); if (((enum tree_code) (__t)->common.code) != (TREE_LIST)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1506, __FUNCTION__, (TREE_LIST), 0); __t; })->list.value)); if (((enum tree_code) (__t)->common.code) != (STRING_CST)) tree_check_failed (__t, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1506, __FUNCTION__, (STRING_CST), 0); __t; }
+)->string.str));
+ parse_output_constraint (&constraint, i, 0, 0, &allows_mem, &allows_reg, &is_inout);
+ }
+ }
+ get_indirect_ref_operands (tree stmt, tree expr, int flags) {
+ tree *pptr = &__extension__ (*({
+const tree __t = __extension__ ({ const tree __t = (expr); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) >= tcc_reference && (__c) <= tcc_expression)) tree_class_check_failed (__t, tcc_expression, "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1591, __FUNCTION__); __t; }
+);
+ const int __i = (0);
+ if (__i < 0 || __i >= tree_code_length[(int) (((enum tree_code) (__t)->common.code))]) tree_operand_check_failed (__i, ((enum tree_code) (__t)->common.code), "/home/cygnus/dnovillo/gcc/src.ppc64/gcc/tree-ssa-operands.c", 1591, __FUNCTION__);
+ &__t->exp.operands[__i];
+ }
+));
+ tree ptr = *pptr;
+ {
+ struct ptr_info_def *pi = ((void *)0);
+ if (((enum tree_code) (ptr)->common.code) == SSA_NAME && pi->name_mem_tag) { }
+ }
+ }
+ note_addressable (tree var, stmt_ann_t s_ann) {
+ subvar_t svars;
+ {
+ if (var_can_have_subvars (var) && (svars = get_subvars_for_var (var))) bitmap_set_bit (s_ann->addresses_taken, var_ann (var)->uid);
+ }
+ }
+ const struct ggc_root_tab gt_ggc_r_gt_tree_ssa_operands_h[] = {
+ {
+ &operand_memory, }
+, {
+ }
+, {
+ }
+, {
+ }
+, };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050702-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050702-1.c
new file mode 100644
index 000000000..ce151d361
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050702-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* We going into an infinite loop in fold because we
+ were mishandling the return value of
+ fold_to_nonsharp_ineq_using_bound. */
+_Bool f();
+void g(int);
+void h (int old_size)
+{
+ int new_size = old_size, i;
+ g(old_size - 1);
+ i = 0;
+ while (i < old_size - 1)
+ {
+ if (f())
+ {
+ i++;
+ continue;
+ }
+ while (i < old_size - 1)
+ i++;
+ }
+ g(new_size);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050811-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050811-1.c
new file mode 100644
index 000000000..010aa5a09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050811-1.c
@@ -0,0 +1,20 @@
+/* Test whether -fdump-rtl-all-graph doesn't crash. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-all-graph" } */
+
+int foo (void)
+{
+ return 6;
+}
+
+int bar (int x)
+{
+ if (x < 0)
+ return foo () + 8;
+ else if (x > 0)
+ return 2 * foo ();
+ else
+ return foo ();
+}
+
+// { dg-final { cleanup-rtl-dump "*" } }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050811-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050811-2.c
new file mode 100644
index 000000000..afee9b0af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050811-2.c
@@ -0,0 +1,20 @@
+/* Test whether graph dumping doesn't crash. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-postreload-graph" } */
+
+int foo (void)
+{
+ return 6;
+}
+
+int bar (int x)
+{
+ if (x < 0)
+ return foo () + 8;
+ else if (x > 0)
+ return 2 * foo ();
+ else
+ return foo ();
+}
+
+/* { dg-final { cleanup-rtl-dump "postreload*" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050826-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050826-1.c
new file mode 100644
index 000000000..9595236cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050826-1.c
@@ -0,0 +1,52 @@
+/* Test whether strncmp has not been "optimized" into memcmp
+ nor any code with memcmp semantics. */
+/* { dg-do run { target mmap } } */
+/* { dg-options "-O2" } */
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/mman.h>
+/* Darwin spells this differently */
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+#ifndef MAP_ANON
+#define MAP_ANON 0
+#endif
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+#include <stdlib.h>
+
+ struct Flags {
+ int filler[18];
+ unsigned int a:14;
+ unsigned int b:14;
+ unsigned int c:1;
+ unsigned int d:1;
+ unsigned int e:1;
+ unsigned int f:1;
+ };
+static void __attribute__((noinline)) set (struct Flags *);
+static void set (struct Flags *fp)
+{
+ fp->b = 5;
+ fp->d = 1;
+}
+
+static int __attribute__((noinline)) bar (int);
+static int bar(int x) { return !(x==1); }
+int main (void)
+{
+ char *p = mmap (NULL, 131072, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ struct Flags *fp;
+ if (p == MAP_FAILED)
+ return 0;
+ if (munmap (p + 65536, 65536) < 0)
+ return 0;
+ fp = (struct Flags*)(p + 65536 - sizeof(struct Flags));
+ set(fp);
+ if (fp->b > 0)
+ return (bar(fp->d));
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050922-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050922-1.c
new file mode 100644
index 000000000..982f82011
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050922-1.c
@@ -0,0 +1,47 @@
+/* This revealed a bug when rotates are expanded into
+ two shifts. */
+
+/* { dg-do run } */
+/* { dg-options "-O1 -std=c99" } */
+
+extern void abort (void);
+
+#if __INT_MAX__ == 2147483647
+typedef unsigned int uint32_t;
+#elif __LONG_MAX__ == 2147483647
+typedef unsigned long uint32_t;
+#else
+#error unable to find 32-bit integer type
+#endif
+
+uint32_t
+f (uint32_t *S, int j)
+{
+ uint32_t A, B, k, L[2] = {1234, 5678};
+ int i, m;
+
+ A = B = 0;
+ for (i = 0; i < j; i++)
+ {
+ k = (S[i] + A + B) & 0xffffffffL;
+ A = S[i] =
+ ((k << (3 & 0x1f)) | ((k & 0xffffffff) >> (32 - (3 & 0x1f))));
+
+ m = (int) (A + B);
+ k = (L[i] + A + B) & 0xffffffffL;
+ B = L[i] =
+ ((k << (m & 0x1f)) | ((k & 0xffffffff) >> (32 - (m & 0x1f))));
+ }
+ return L[0] + L[1];
+}
+
+int
+main ()
+{
+ uint32_t S[2] = {0xffff, 0xffffff};
+
+ if (f (S,2)!= 1392607300)
+ abort();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050922-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050922-2.c
new file mode 100644
index 000000000..2e8db829e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050922-2.c
@@ -0,0 +1,34 @@
+/* 20050922-1.c does not trigger the expand_shift rotate bug on sh4-elf, but
+ this does. */
+
+/* { dg-do run } */
+/* { dg-options "-O1 -std=c99" } */
+
+extern void abort (void);
+extern void exit (int);
+
+#if __INT_MAX__ == 2147483647
+typedef unsigned int uint32_t;
+#elif __LONG_MAX__ == 2147483647
+typedef unsigned long uint32_t;
+#else
+#error unable to find 32-bit integer type
+#endif
+
+#define rotl(x,n) (((x) << ((int)(n))) | ((x) >> (32 - (int)(n))))
+
+uint32_t
+f (uint32_t a, uint32_t b)
+{
+
+ b = rotl (a, b & 31);
+ return b;
+}
+
+int
+main ()
+{
+ if (f(2,31) != 1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20051201-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20051201-1.c
new file mode 100644
index 000000000..c02920545
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20051201-1.c
@@ -0,0 +1,27 @@
+/* This failed with profiling due to a missing check in
+ tree_flow_call_edges_add. */
+
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O1 -fprofile-generate -Wno-attributes" } */
+
+static __attribute__ ((always_inline)) void
+baz ()
+{
+}
+
+static __attribute__ ((always_inline)) int
+bar ()
+{
+ out:
+ baz ();
+ goto out;
+}
+
+int
+foo ()
+{
+ long res;
+
+ res = bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20051207-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20051207-1.c
new file mode 100644
index 000000000..326fb0271
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20051207-1.c
@@ -0,0 +1,5 @@
+/* GCC doesn't generate any .eh_frame data for this TU itself, so it
+ shouldn't warn about "a" conflicting with the built-in idea of
+ .eh_frame, even if it thinks that .eh_frame should be read-only. */
+/* { dg-require-named-sections "" } */
+int a __attribute__((section (".eh_frame"))) = 1;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20051207-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20051207-2.c
new file mode 100644
index 000000000..8a8708794
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20051207-2.c
@@ -0,0 +1,5 @@
+/* GCC doesn't generate any .eh_frame data for this TU itself, so it
+ shouldn't warn about "a" conflicting with the built-in idea of
+ .eh_frame, even if it thinks that .eh_frame should be read-write. */
+/* { dg-require-named-sections "" } */
+const int a __attribute__((section (".eh_frame"))) = 1;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20051207-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/20051207-3.c
new file mode 100644
index 000000000..3d4b2a48c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20051207-3.c
@@ -0,0 +1,7 @@
+/* GCC doesn't generate any .eh_frame data for this TU itself, so it
+ shouldn't warn about "a" conflicting with the built-in idea of
+ .eh_frame. The warning therefore belongs on the second decl. */
+/* { dg-options "-fno-unit-at-a-time" } */
+/* { dg-require-named-sections "" } */
+int a __attribute__((section (".eh_frame"))) = 1;
+const int b __attribute__((section (".eh_frame"))) = 1; /* { dg-error "section type conflict" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20060410.c b/gcc-4.9/gcc/testsuite/gcc.dg/20060410.c
new file mode 100644
index 000000000..88253bb43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20060410.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+/* Make sure we didn't eliminate foo because we thought it was unused. */
+
+struct foo
+{
+ int i;
+};
+
+int bar (void)
+{
+ return ((struct foo *)0x1234)->i;
+}
+
+/* { dg-final { scan-assembler "foo" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20060419-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20060419-1.c
new file mode 100644
index 000000000..754774162
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20060419-1.c
@@ -0,0 +1,4 @@
+struct T {
+ unsigned char f[1] __attribute__((packed)); /* { dg-warning "ignored for field of type.*unsigned char\\\[1\\\]" } */
+ unsigned char g[14] __attribute__((packed)); /* { dg-warning "ignored for field of type.*unsigned char\\\[14\\\]" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20060425-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20060425-1.c
new file mode 100644
index 000000000..7d899b2bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20060425-1.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+/* This failed because if conversion didn't handle insv patterns properly. */
+
+void abort (void);
+
+union y
+{
+ int a;
+ unsigned short b;
+};
+
+void __attribute__ ((noinline))
+bar (unsigned short u, union y v)
+{
+ if (u != 1)
+ abort ();
+}
+
+void __attribute__ ((noinline))
+foo (int check)
+{
+ union y x;
+
+ if (check != 0)
+ x.b = 1;
+ else
+ x.b = 2;
+ bar (x.b, x);
+}
+
+int
+main ()
+{
+ foo (1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20060425-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20060425-2.c
new file mode 100644
index 000000000..2a5e131a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20060425-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+double
+crashme (double v, double *p)
+{
+ if (v < 0. && *p == 1.)
+ v = 0.;
+ return v;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20060801-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20060801-1.c
new file mode 100644
index 000000000..c036acbec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20060801-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-fPIC" } */
+char *ptr = 0;
+char array[100];
+void
+f()
+{
+ ptr = &array[0x100000000ULL]; /* A 33-bit constant. */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20061026.c b/gcc-4.9/gcc/testsuite/gcc.dg/20061026.c
new file mode 100644
index 000000000..fb3de2375
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20061026.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* This testcase failed on s390. The frame size for function f will be
+ exactly 32768 bytes. The back end has to recognize that this is to
+ large for a 16bit constant and therefore should reserve the literal
+ pool base pointer. */
+
+int f () {
+ char a[32608];
+
+ g (a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20061109-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20061109-1.c
new file mode 100644
index 000000000..2ba30bf84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20061109-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { int32plus } } } */
+/* { dg-options "-O1" } */
+
+/* This assignment might be implemented with a mem copy from the
+ literal pool with two BLKmode operands. This produced an ICE on S/390
+ since simplify_subreg was called for such a BLKmode operand. */
+
+struct a
+{
+ unsigned int b:24;
+};
+
+void
+foo (struct a *t)
+{
+ t->b = 32;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20061109-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20061109-2.c
new file mode 100644
index 000000000..30be434d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20061109-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* This assignment might be implemented with a mem copy from the
+ literal pool with two BLKmode operands. This produced an ICE on S/390
+ since simplify_subreg was called for such a BLKmode operand. */
+
+struct a
+{
+ unsigned long b:24;
+};
+
+void
+foo (struct a *t)
+{
+ t->b = 32;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20061124-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20061124-1.c
new file mode 100644
index 000000000..26c35f75a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20061124-1.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
+
+/* This testcase failed on s390 because no compare instruction for
+ the check of FLAG was emitted. */
+
+unsigned short int count = 0;
+int flag = 1;
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main ()
+{
+ __sync_add_and_fetch (&count, -1);
+
+ if (!flag)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20061127-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20061127-1.c
new file mode 100644
index 000000000..0b70a5ae2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20061127-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O1 -fPIC" } */
+
+/* PR target/29319 */
+
+extern void abort(void);
+static char l_info[100];
+
+void
+bug1 (unsigned long tag)
+{
+ char *info = l_info;
+ info[tag - 0x100000000 + 1] = 1;
+}
+
+void
+bug2 (unsigned long tag)
+{
+ char *info = l_info;
+ info[tag - 0x700000000 + 2] = 2;
+}
+
+void
+bug3 (unsigned long tag)
+{
+ char *info = l_info;
+ info[tag - 0x100000000 + 1] = 3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20070112-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20070112-1.c
new file mode 100644
index 000000000..bd7833567
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20070112-1.c
@@ -0,0 +1,24 @@
+/* We used to ICE on this testcase: the address of bad_spill_regs is
+ only taken in a phi node, which we missed and cleared its TREE_ADDRESSABLE
+ flag. This gets revealed when the loop is completely unrolled, thus
+ exposing the addresses as ordinary statements. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+
+typedef unsigned HARD_REG_SET[2];
+static HARD_REG_SET bad_spill_regs;
+
+void
+order_regs_for_reload ()
+{
+ register int i;
+
+ register unsigned *scan_tp_ = bad_spill_regs;
+
+ for (i = 0; i < 2; i++)
+ *scan_tp_++ = 0;
+
+ bad_spill_regs[0] |= 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20070507-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20070507-1.c
new file mode 100644
index 000000000..2884d1aa8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20070507-1.c
@@ -0,0 +1,103 @@
+/* This failed on s390x due to bug in loop.c.
+ loop.c failed to remove a REG_EQUAL note when
+ hoisting an insn from a loop body. */
+
+/* { dg-options "-O3 -fPIC" } */
+/* { dg-do run { target fpic } } */
+
+typedef __SIZE_TYPE__ size_t;
+int memcmp(const void *s1, const void *s2, size_t n);
+
+typedef struct
+{
+ char name[30];
+ int a;
+} LOCAL;
+
+int global = 0;
+int sy = 1;
+int subroutine_offset;
+
+LOCAL local = { "local", 0 };
+LOCAL keywords = { "keywords", 1 };
+int local_table = 0;
+int keywords_table = 0;
+
+void __attribute__((noinline)) bar (char *p_buffer)
+{
+ p_buffer[255] = 1;
+}
+
+int __attribute__((noinline)) foo (char *p_str1)
+{
+ global = 1;
+ return 1;
+}
+
+int __attribute__((noinline)) loop_next (int *p_table, char *p_table_head)
+{
+ static loop_next = 0;
+
+ if (loop_next == 1)
+ return 1;
+
+ loop_next = 1;
+ return 0;
+}
+
+int
+main ()
+{
+ char buffer[256];
+ int ende = 0;
+ int index;
+ int local_base = 2;
+
+ keywords.a = 1;
+ for (sy = 0;; sy++)
+ {
+ for (index = 1;;)
+ {
+ bar (buffer);
+ if (buffer[sy] != 0)
+ {
+ ende = 1;
+ break;
+ };
+ if (foo (buffer))
+ {
+ keywords.a += index - 1;
+ break;
+ }
+ index++;
+ }
+ if (ende)
+ break;
+ }
+
+ subroutine_offset = 0;
+
+ for (;;)
+ {
+ if (loop_next (&keywords_table, (char*)&keywords))
+ break;
+
+ if ((!memcmp (keywords.name, "+++", 3)))
+ local_base = 100;
+ else
+ local_base = 0;
+
+ if ((!memcmp (keywords.name, "+++", 3)))
+ subroutine_offset += local_table;
+
+ for (;;)
+ {
+ if (loop_next (&local_table, (char*)&local))
+ break;;
+ if ((local.a == 0))
+ continue;;
+ foo (local.name);
+ }
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20070725-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20070725-1.c
new file mode 100644
index 000000000..07b609cf8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20070725-1.c
@@ -0,0 +1,64 @@
+/* This used to fail due to a ifcombine problem wrecking 64bit
+ checks. Fixed with rev. 126876. */
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+struct tree_base
+{
+ unsigned code:16;
+
+ unsigned side_effects_flag:1;
+ unsigned constant_flag:1;
+ unsigned addressable_flag:1;
+ unsigned volatile_flag:1;
+ unsigned readonly_flag:1;
+ unsigned unsigned_flag:1;
+ unsigned asm_written_flag:1;
+ unsigned nowarning_flag:1;
+
+ unsigned used_flag:1;
+ unsigned nothrow_flag:1;
+ unsigned static_flag:1;
+ unsigned public_flag:1;
+ unsigned private_flag:1;
+ unsigned protected_flag:1;
+ unsigned deprecated_flag:1;
+ unsigned invariant_flag:1;
+
+ unsigned lang_flag_0:1;
+ unsigned lang_flag_1:1;
+ unsigned lang_flag_2:1;
+ unsigned lang_flag_3:1;
+ unsigned lang_flag_4:1;
+ unsigned lang_flag_5:1;
+ unsigned lang_flag_6:1;
+ unsigned visited:1;
+
+ unsigned spare1:16;
+ unsigned spare2:8;
+ unsigned long a;
+};
+
+int
+foo (struct tree_base *rhs)
+{
+ if (({const struct tree_base* __t = (rhs); __t;})->readonly_flag
+ && (rhs)->static_flag)
+ return 1;
+
+ return 0;
+}
+
+extern void abort (void);
+
+int
+main ()
+{
+ struct tree_base t;
+
+ t.readonly_flag = t.static_flag = 0;
+ if (foo (&t))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20080615-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20080615-1.c
new file mode 100644
index 000000000..bce9476cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20080615-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-w -O2" } */
+
+static int *see_bb_splay_ar = ((void *) 0);
+static void
+see_merge_and_eliminate_extensions (void)
+{
+ int i = 0;
+ printf ("* Phase 2: Merge and eliminate locally redundant extensions. *\n");
+ splay_tree_foreach (see_bb_splay_ar[i], ((void *) 0), ((void *) 0));
+}
+static void
+see_main (void)
+{
+ int i = 0;
+ see_merge_and_eliminate_extensions ();
+ printf ("Searching register properties in bb %d\n", i);
+}
+gate_handle_see (void)
+{
+}
+rest_of_handle_see (void)
+{
+ see_main ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20080820.c b/gcc-4.9/gcc/testsuite/gcc.dg/20080820.c
new file mode 100644
index 000000000..002edb1dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20080820.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-fshow-column -fms-extensions -pedantic" } */
+
+struct { struct a { int x; }; int bar; } hot; /* { dg-warning "29:ISO C90 doesn't support unnamed" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20081223-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20081223-1.c
new file mode 100644
index 000000000..e5184e044
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20081223-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-flto -ffat-lto-objects" { target lto } } */
+
+typedef struct foo_ foo_t;
+foo_t bar; /* { dg-error "storage size of 'bar' isn't known" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20090902-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20090902-1.c
new file mode 100644
index 000000000..6120ee907
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20090902-1.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+#define STRING(x) #x
+char buf[] = STRING(L'\x123');
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20090922-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20090922-1.c
new file mode 100644
index 000000000..62045cbbd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20090922-1.c
@@ -0,0 +1,65 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -funroll-loops -std=gnu99" } */
+
+struct S
+{
+ unsigned long s1;
+ int **s2;
+};
+struct T
+{
+ unsigned long t1, t2;
+};
+struct U
+{
+ int u1, u2;
+ unsigned long u3;
+};
+struct V
+{
+ int v1, v3;
+ struct T *v2;
+ struct U *v4;
+};
+struct W
+{
+ int w1;
+ struct V **w2;
+};
+struct S *foo1 (void);
+int *foo2 (void);
+
+void
+test (struct W *w)
+{
+ for (int i = 0; i < w->w1; i++)
+ {
+ struct V *v = w->w2[i];
+ struct S *t = foo1 ();
+ if (!t)
+ for (int j; j < v->v1;)
+ {
+ struct T *q = &v->v2[j];
+ t += (q->t2 - q->t1) * 45000L;
+ }
+ for (; v->v3;)
+ {
+ struct U *v4 = (struct U *) &v->v4;
+ if (v4->u1 && v4->u2 >= 0 && v4->u2)
+ {
+ int *s = foo2 ();
+ if (!s)
+ for (int k = 0; k <= v4->u2; k++)
+ {
+ struct T *q = &v->v2[k];
+ if (k == v4->u2)
+ v4->u3 += (q->t1) * 1000000;
+ }
+ t->s2[t->s1] = s;
+ }
+ }
+ int *s = foo2 ();
+ if (!t)
+ t->s2[t->s1] = s;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20100906-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20100906-1.c
new file mode 100644
index 000000000..042ba99c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20100906-1.c
@@ -0,0 +1,49 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fno-short-enums -Wl,--no-enum-size-warning" {target arm_eabi} } */
+
+/* This testcase got misoptimized by combine due to a wrong setting of
+ subst_low_luid in try_combine. */
+
+enum rtx_code {
+ A, B
+};
+
+void abort (void);
+
+struct rtx_def {
+ __extension__ enum rtx_code code:16;
+};
+typedef struct rtx_def *rtx;
+
+void __attribute__((noinline))
+add_constraint (unsigned char is_a)
+{
+ if (is_a)
+ abort ();
+}
+
+void __attribute__((noinline))
+foo (rtx defn)
+{
+ switch (defn->code)
+ {
+ case A:
+ case B:
+ add_constraint (defn->code == A);
+ break;
+ default:
+ break;
+ }
+}
+
+int
+main ()
+{
+ struct rtx_def r;
+
+ r.code = B;
+
+ foo (&r);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20101010-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20101010-1.c
new file mode 100644
index 000000000..8d74bbf5a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20101010-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-crossjumping" } */
+
+int foo (void)
+{
+ int len;
+ if (bar1 (&len))
+ {
+ char devpath [len];
+ if (bar2 (devpath) == len)
+ return len;
+ }
+ return -1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20101013-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20101013-1.c
new file mode 100644
index 000000000..b5bd3a7ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20101013-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int foo(int a)
+{
+ int x = (a & (~15)) / 16;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump ">>" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20111216-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/20111216-1.c
new file mode 100644
index 000000000..cd82cf929
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20111216-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fexceptions -fnon-call-exceptions" } */
+
+extern void f2 () __attribute__ ((noreturn));
+void
+f1 ()
+{
+ unsigned char a[8];
+ unsigned int i;
+
+ for (i = 0; i < 8; i++)
+ {
+ if (i > 8)
+ f2 ();
+ a[i] = i <= 8;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/54455.c b/gcc-4.9/gcc/testsuite/gcc.dg/54455.c
new file mode 100644
index 000000000..281c8620a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/54455.c
@@ -0,0 +1,26 @@
+/* PR rtl-optimization/54455 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fschedule-insns -fselective-scheduling --param max-sched-extend-regions-iters=2" } */
+/* { dg-require-effective-target scheduling } */
+
+extern void fn1 (void), fn2 (void);
+
+static inline __attribute__((always_inline)) int
+foo (int *x, long y)
+{
+ asm goto ("" : : "r" (x), "r" (y) : "memory" : lab);
+ return 0;
+lab:
+ return 1;
+}
+
+void
+bar (int *x)
+{
+ if (foo (x, 23))
+ fn1 ();
+ else
+ fn2 ();
+
+ foo (x, 2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/920413-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/920413-1.c
new file mode 100644
index 000000000..6e8fff7eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/920413-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+int
+x (b)
+{
+ return
+ 4294967295U /* { dg-warning "width of integer|traditional C rejects" } */
+ / (unsigned long) b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/940409-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/940409-1.c
new file mode 100644
index 000000000..2d20b891f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/940409-1.c
@@ -0,0 +1,6 @@
+/* GCC should allow struct S to be in a register. */
+/* { dg-do compile } */
+
+struct S { volatile int field; };
+int f (register struct S arg); /* { dg-bogus "volatile field" "with arg" } */
+int g (register struct S); /* { dg-bogus "volatile field" "no arg" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/940510-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/940510-1.c
new file mode 100644
index 000000000..2c27e0090
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/940510-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -pedantic" } */
+struct { int a[]; } x = { 0 }; /* { dg-warning "ISO C90 does not support flexible array members" } */
+/* { dg-error "flexible array member in otherwise empty struct" "" { target *-*-* } 3 } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/951130-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/951130-1.c
new file mode 100644
index 000000000..60013e267
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/951130-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile }
+ { dg-options "-Werror" } */
+
+unsigned long long x = -(unsigned long long)(-(long long)
+ (((unsigned long long)0 - 1) >> 1) - 1);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/980502-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/980502-1.c
new file mode 100644
index 000000000..f06491cd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/980502-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile }*/
+/* { dg-options "-O2" } */
+
+char *const f(void)
+{
+ char *const line = "/dev/ptyXX";
+ line[8] = 1;
+ return line;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/980523-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/980523-1.c
new file mode 100644
index 000000000..970b57c59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/980523-1.c
@@ -0,0 +1,53 @@
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void exit (int);
+
+void foo1(int a, char *b, int c)
+{
+ c =a+c+234;
+}
+
+int foo2(int d)
+{
+ return d*d;
+}
+
+int bar1, bar2, bar3;
+char * bar4;
+
+int main(void) {
+ int h;
+ bar1 = foo2(1);
+ bar2 = foo2(1);
+
+ h = foo2(1);
+ foo1(1, "a", foo2(1));
+ foo1(bar1, "a", foo2(1));
+ foo2(1);
+
+ h = foo2(1);
+ bar3 = 1;
+ bar4 = "a";
+ foo1(1, "n", foo2(1));
+ foo1(1, "o", foo2(1));
+ foo1(1, "p", foo2(1));
+ foo1(bar1, "a", foo2(1));
+
+ bar3 = h;
+ bar4 = "b"; foo1(bar1, "b", foo2(1));
+ foo1(1, "q", foo2(1));
+ bar4 = "c"; foo1(1, "c", foo2(1));
+ bar4 = "d"; foo1(1, "d", foo2(1));
+ bar4 = "e"; foo1(1, "e", foo2(1));
+ bar4 = "f"; foo1(1, "f", foo2(1));
+ bar4 = "g"; foo1(1, "g", foo2(1));
+ bar4 = "h"; foo1(1, "h", foo2(1));
+ bar4 = "i"; foo1(1, "i", foo2(1));
+ bar4 = "j"; foo1(1, "j", foo2(1));
+ bar4 = "k"; foo1(1, "k", foo2(1));
+ bar4 = "l"; foo1(1, "l", foo2(1));
+ bar4 = "m";
+ foo1(bar2, "m", foo2(1));
+ exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/980526-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/980526-1.c
new file mode 100644
index 000000000..6ab9db679
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/980526-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+int
+test(void)
+{
+ double value, maxValue = - (__extension__ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) { __l: 0x7ff0000000000000ULL }).__d) ;
+ int idx, maxIdx = 1;
+
+ for (idx = 1; idx < 22; idx++) {
+ if (value > maxValue) {
+ maxValue = value;
+ maxIdx = idx;
+ }
+ }
+ return 0 ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/980816-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/980816-1.c
new file mode 100644
index 000000000..d4f59c40c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/980816-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+int
+div_and_round_double (lden_orig, hden_orig)
+ int lden_orig, hden_orig;
+{
+ int quo[4];
+ register int i;
+ unsigned int work;
+ register unsigned int carry = 0;
+ int lden = lden_orig;
+ int hden = hden_orig;
+ neg_double (&lden, &hden);
+ for (i = 4 - 1; i >= 0; i--)
+ {
+ quo[i] = work / (unsigned int ) lden;
+ carry = work % (unsigned int ) lden;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/990213-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/990213-1.c
new file mode 100644
index 000000000..a7c9f2489
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/990213-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-W -Wall -Werror" } */
+
+static inline int unused_fn(int dummyarg)
+{
+ return dummyarg*dummyarg;
+}
+
+int main()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/990506-0.c b/gcc-4.9/gcc/testsuite/gcc.dg/990506-0.c
new file mode 100644
index 000000000..3cd3be3fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/990506-0.c
@@ -0,0 +1,9 @@
+/* Verify that a diagnostic is issued without crashing due to
+ --enable-checking catching a bug in the C front end. */
+/* { dg-do compile } */
+x()
+{
+ foo (i);
+ /* { dg-error "undeclared" "undeclared-variable message" { target *-*-* } { 6 } } */
+ /* { dg-message "function it appears in" "reminder message" { target *-*-* } { 6 } } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Foundation.framework/empty b/gcc-4.9/gcc/testsuite/gcc.dg/Foundation.framework/empty
new file mode 100644
index 000000000..41347913e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Foundation.framework/empty
@@ -0,0 +1 @@
+This directory is empty.
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/O16384.c b/gcc-4.9/gcc/testsuite/gcc.dg/O16384.c
new file mode 100644
index 000000000..32e17d4e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/O16384.c
@@ -0,0 +1,15 @@
+/* Test insane -O argument. */
+/* { dg-do compile } */
+/* { dg-options "-O16384" } */
+
+__attribute__((__optimize__(16396), __noinline__)) void
+foo (void)
+{
+}
+
+int
+main (void)
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/README b/gcc-4.9/gcc/testsuite/gcc.dg/README
new file mode 100644
index 000000000..98c78f709
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/README
@@ -0,0 +1,23 @@
+Notes for testsuite/gcc.dg.
+
+1) There should be only one driver, dg.exp.
+
+2) Try to organize the tests by topic using file name prefixes.
+
+ Eg: All bitfield tests are named "bf-*.c".
+
+ This lets the person running the tests choose particular sets of tests to
+ run easily (using wildcards).
+
+ Eg: make check RUNTESTFLAGS='dg.exp=bf-*.c'
+
+3) Remember DOS file name restrictions (8.3). Sigh.
+
+4) Send bugs, comments, etc. to dje@cygnus.com.
+
+
+Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Waddress.c b/gcc-4.9/gcc/testsuite/gcc.dg/Waddress.c
new file mode 100644
index 000000000..146b1a932
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Waddress.c
@@ -0,0 +1,10 @@
+/* PR c/36299 */
+/* { dg-do compile } */
+/* { dg-options "-Waddress" } */
+
+int
+foo(void)
+{
+ char a[1];
+ return a == 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wall.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wall.c
new file mode 100644
index 000000000..898484717
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wall.c
@@ -0,0 +1,9 @@
+/* PR 30437: Test -Wall
+ Don't change this without changing Wno-all.c as well. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+void foo(int a)
+{
+ 5 * (a == 1) | (a == 2); /* { dg-warning "no effect" "no effect" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Walways-true-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Walways-true-1.c
new file mode 100644
index 000000000..4aa5d39ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Walways-true-1.c
@@ -0,0 +1,57 @@
+/* Test -Waddress for testing an address against NULL.
+ Origin: Ian Lance Taylor <iant@google.com>. */
+
+/* { dg-do compile } */
+/* { dg-options "-Waddress -fshow-column" } */
+
+extern int foo (int);
+
+int i;
+
+void
+bar (int a)
+{
+ lab:
+ if (foo) /* { dg-warning "7:always evaluate as" "correct warning" } */
+ foo (0);
+ if (foo (1))
+ ;
+ if (&i) /* { dg-warning "7:always evaluate as" "correct warning" } */
+ foo (2);
+ if (i)
+ foo (3);
+ if (&a) /* { dg-warning "7:always evaluate as" "correct warning" } */
+ foo (4);
+ if (a)
+ foo (5);
+ if (&&lab) /* { dg-warning "7:always evaluate as" "correct warning" } */
+ foo (6);
+ if (foo == 0) /* { dg-warning "11:the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (7);
+ if (foo (1) == 0)
+ foo (8);
+ if (&i == 0) /* { dg-warning "10:the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (9);
+ if (i == 0)
+ foo (10);
+ if (&a == 0) /* { dg-warning "10:the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (11);
+ if (a == 0)
+ foo (12);
+ if (&&lab == 0) /* { dg-warning "13:the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (13);
+ if (0 == foo) /* { dg-warning "9:the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (14);
+ if (0 == foo (1))
+ foo (15);
+ if (0 == &i) /* { dg-warning "9:the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (16);
+ if (0 == i)
+ foo (17);
+ if (0 == &a) /* { dg-warning "9:the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (18);
+ if (0 == a)
+ foo (19);
+ if (0 == &&lab) /* { dg-warning "9:the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (20);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Walways-true-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Walways-true-2.c
new file mode 100644
index 000000000..7f0bb7b10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Walways-true-2.c
@@ -0,0 +1,60 @@
+/* Make sure we don't assume that a weak symbol is always non-NULL.
+ This is just like Walways-true-1.C, except that it uses a weak
+ symbol.
+ Origin: Ian Lance Taylor <iant@google.com>. */
+
+/* { dg-do compile } */
+/* { dg-options "-Waddress" } */
+/* { dg-require-weak "" } */
+
+extern int foo (int) __attribute__ ((weak));
+
+int i __attribute__ ((weak));
+
+void
+bar (int a)
+{
+ lab:
+ if (foo)
+ foo (0);
+ if (foo (1))
+ ;
+ if (&i)
+ foo (2);
+ if (i)
+ foo (3);
+ if (&a) /* { dg-warning "always evaluate as" "correct warning" } */
+ foo (4);
+ if (a)
+ foo (5);
+ if (&&lab) /* { dg-warning "always evaluate as" "correct warning" } */
+ foo (6);
+ if (foo == 0)
+ foo (7);
+ if (foo (1) == 0)
+ foo (8);
+ if (&i == 0)
+ foo (9);
+ if (i == 0)
+ foo (10);
+ if (&a == 0) /* { dg-warning "the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (11);
+ if (a == 0)
+ foo (12);
+ if (&&lab == 0) /* { dg-warning "the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (13);
+ if (0 == foo)
+ foo (14);
+ if (0 == foo (1))
+ foo (15);
+ if (0 == &i)
+ foo (16);
+ if (0 == i)
+ foo (17);
+ if (0 == &a) /* { dg-warning "the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (18);
+ if (0 == a)
+ foo (19);
+ if (0 == &&lab) /* { dg-warning "the comparison will always evaluate as 'false'" "correct warning" } */
+ foo (20);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-10.c
new file mode 100644
index 000000000..5fd6e6f1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-10.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Warray-bounds" } */
+
+int f(unsigned len, int buflen)
+{
+ unsigned taillen;
+ unsigned slen;
+ unsigned i;
+ int b[17]; /* needed <= 17 to trigger Warning */
+ int j = 0; /* needed to trigger Warning */
+
+ b[0] = 0;
+ taillen= buflen & 7; /* taillen [0..7] */
+
+ if(taillen) { /* taillen [1..7] */
+ slen= 8 - taillen; /* slen [7..1] */
+ if (len<slen) /* needed to trigger Warning */
+ slen=len; /* slen' < slen */
+ for(i=0; i<slen; i++) {
+ j = b[taillen]; /* taillen + slen = [1..7] + [7..1] = 8 */
+ taillen++;
+ }
+ }
+ return j;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-2.c
new file mode 100644
index 000000000..796483e0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* Test that -Warray-bounds is enabled by -Wall */
+/* { dg-options "-O2 -Wall" } */
+
+int a[10];
+
+int* f(void) {
+
+ a[-1] = 0; /* { dg-warning "array subscript" } */
+
+ return a;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-3.c
new file mode 100644
index 000000000..773f4633d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-3.c
@@ -0,0 +1,108 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Warray-bounds" } */
+/* based on PR 31227 */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern size_t strlen (const char *);
+
+struct iovec
+{
+ void *iov_base;
+ size_t iov_len;
+};
+
+struct S
+{
+ const char *abday[7];
+ const char *day[7];
+ const char *abmon[12];
+ const char *mon[12];
+ const char *am_pm[2];
+};
+
+extern void foo (size_t, struct iovec *);
+
+void
+bar (struct S *time)
+{
+ struct iovec iov[43];
+ size_t cnt;
+ iov[0].iov_base = (void *) "abc";
+ iov[0].iov_len = 3;
+
+ iov[1].iov_base = (void *) "def";
+ iov[1].iov_len = 3;
+
+ for (cnt = 0; cnt < 7; ++cnt)
+ {
+ iov[2 + cnt].iov_base = (void *) (time->abday[cnt] ?: "");
+ iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
+ }
+
+ for (; cnt < 14; ++cnt)
+ {
+ iov[2 + cnt].iov_base = (void *) (time->day[cnt - 7] ?: "");
+ iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
+ }
+
+ for (; cnt < 26; ++cnt)
+ {
+ iov[2 + cnt].iov_base = (void *) (time->abmon[cnt - 14] ?: "");
+ iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
+ }
+
+ for (; cnt < 38; ++cnt)
+ {
+ iov[2 + cnt].iov_base = (void *) (time->mon[cnt - 26] ?: "");
+ iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
+ }
+
+ for (; cnt < 40; ++cnt)
+ {
+ iov[2 + cnt].iov_base = (void *) (time->am_pm[cnt - 38] ?: "");
+ iov[2 + cnt].iov_len = strlen (iov[2 + cnt].iov_base) + 1;
+ }
+
+ foo (2 + cnt, iov);
+}
+
+struct malloc_chunk {
+ long prev_size;
+ long size;
+ struct malloc_chunk* fd;
+ struct malloc_chunk* bk;
+};
+typedef struct malloc_chunk* mchunkptr;
+struct malloc_state {
+ mchunkptr top;
+ mchunkptr last_remainder;
+ mchunkptr bins[128 * 2 - 2];
+};
+#define bin_at(m, i) \
+ (mchunkptr) (((char *) &((m)->bins[((i) - 1) * 2])) \
+ - __builtin_offsetof (struct malloc_chunk, fd))
+
+void malloc_init_state(struct malloc_state *av)
+{
+ int i;
+ mchunkptr bin;
+
+ for (i = 1; i < 128; ++i) {
+ bin = bin_at(av,i);
+ bin->fd = bin->bk = bin;
+ }
+}
+
+typedef unsigned short WCHAR;
+typedef WCHAR *LPWSTR;
+
+static void g(LPWSTR dest, int len) {
+ dest[len-1] = 0;
+}
+
+void f() {
+ WCHAR szPathW[260];
+
+ g(szPathW, 260);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-4.c
new file mode 100644
index 000000000..71526f27f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+typedef unsigned int DWORD;
+
+static void g(DWORD * p, int n)
+{
+ int i;
+
+ for (i = 0; i < n && !p[n - 1]; i++); /* { dg-bogus "subscript is above array bounds" } */
+}
+
+void f() {
+ DWORD arr[8];
+
+ g(arr, 4);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-5.c
new file mode 100644
index 000000000..ba9cd2aa0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-5.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wall" } */
+/* based on PR 37861 */
+
+extern int printf (__const char *__restrict __format, ...);
+
+static int f2(char formatstr[10][100])
+{
+ int anz;
+ for( anz = 0; anz < 10; ++anz ) {
+ printf( "%d %s\n", anz, formatstr[anz] );
+ }
+ return anz;
+}
+
+
+static char formatstr[10][100];
+int main( void )
+{
+ int anz;
+ anz = f2(formatstr);
+ printf( " %d\n",anz);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-6.c
new file mode 100644
index 000000000..44a513bba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-6.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wall" } */
+/* based on PR 37861 */
+
+extern int printf (__const char *__restrict __format, ...);
+
+static int f3(int v)
+{
+ int i,j = 0;
+ for (i = 0; i <= v; i++)
+ j++;
+ return j;
+}
+
+static int f2(char formatstr[10][100]) {
+ printf( "%d %s\n", 0, formatstr[f3(0)] );
+ printf( "%d %s\n", 1, formatstr[f3(1)] );
+ printf( "%d %s\n", 2, formatstr[f3(2)] );
+ printf( "%d %s\n", 3, formatstr[f3(3)] );
+ return 3;
+}
+
+static char formatstr[10][100];
+int main( void ) {
+ int anz;
+ anz = f2(formatstr);
+ printf( " %d\n",anz);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c
new file mode 100644
index 000000000..fdd95789a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-7.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Warray-bounds" } */
+
+char *p;
+
+int main()
+{
+ p = "";
+ if (p[0] == 0
+ || (p[0] == '_' && p[1] == 0)) /* { dg-bogus "array bounds" "" } */
+ return 0;
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c
new file mode 100644
index 000000000..85839f3f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-8.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wall" } */
+/* based on PR 43833 */
+
+extern unsigned char data[5];
+
+unsigned char
+foo (char *str)
+{
+ int i, j;
+ unsigned char c = 0;
+
+ for (i = 0; i < 8; i++)
+ {
+ j = i * 5;
+ if ((j % 8) > 3)
+ c |= data[(j / 8) + 1];
+ }
+ return c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-9.c
new file mode 100644
index 000000000..92bcd4e5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds-9.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Warray-bounds" } */
+
+int a[8];
+
+void
+test(unsigned int n)
+{
+ unsigned int i;
+ unsigned int j;
+ if (n<8)
+ for (j=0;j<n;j++)
+ {
+ i = j;
+ do
+ a[i+1]=a[i];
+ while (i--);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds.c b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds.c
new file mode 100644
index 000000000..aa154a7e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Warray-bounds.c
@@ -0,0 +1,93 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Warray-bounds" } */
+
+int a[10];
+
+static inline int n(void) {
+ __SIZE_TYPE__ strlen(const char *s);
+ return strlen("12345");
+}
+
+void g(int *p);
+void h(int p);
+
+int* f(void) {
+ int b[10];
+ int i;
+ struct {
+ int c[10];
+ } c;
+
+ a[-1] = 0; /* { dg-warning "6:array subscript" } */
+ a[ 0] = 0;
+ a[ 1] = 0;
+
+
+ a[ 9] = 0;
+ a[10] = 0; /* { dg-warning "6:array subscript" } */
+ a[11] = 0; /* { dg-warning "6:array subscript" } */
+ a[2 * n() - 11] = 1; /* { dg-warning "6:array subscript" } */
+ a[2 * n() - 10] = 1;
+ a[2 * n() - 1] = 1;
+ a[2 * n() - 0] = 1; /* { dg-warning "6:array subscript" } */
+
+ b[-1] = 0; /* { dg-warning "6:array subscript" } */
+ b[ 0] = 0;
+ b[ 1] = 0;
+ b[ 9] = 0;
+ b[10] = 0; /* { dg-warning "6:array subscript" } */
+ b[11] = 0; /* { dg-warning "6:array subscript" } */
+ b[2 * n() - 11] = 1; /* { dg-warning "6:array subscript" } */
+ b[2 * n() - 10] = 1;
+ b[2 * n() - 1] = 1;
+ b[2 * n() - 0] = 1; /* { dg-warning "array subscript" } */
+
+ c.c[-1] = 0; /* { dg-warning "8:array subscript" } */
+ c.c[ 0] = 0;
+ c.c[ 1] = 0;
+ c.c[ 9] = 0;
+ c.c[10] = 0; /* { dg-warning "8:array subscript" } */
+ c.c[11] = 0; /* { dg-warning "8:array subscript" } */
+ c.c[2 * n() - 11] = 1; /* { dg-warning "8:array subscript" } */
+ c.c[2 * n() - 10] = 1;
+ c.c[2 * n() - 1] = 1;
+ c.c[2 * n() - 0] = 1; /* { dg-warning "8:array subscript" } */
+
+ g(&a[8]);
+ g(&a[9]);
+ g(&a[10]);
+ g(&a[11]); /* { dg-warning "array subscript" } */
+ g(&a[-30]+10); /* { dg-warning "array subscript" } */
+ g(&a[-30]+30);
+
+ g(&b[10]);
+ g(&c.c[10]);
+ g(&b[11]); /* { dg-warning "array subscript" } */
+ g(&c.c[11]); /* { dg-warning "array subscript" } */
+
+ g(&a[0]);
+ g(&b[0]);
+ g(&c.c[0]);
+
+ g(&a[-1]); /* { dg-warning "array subscript" } */
+ g(&b[-1]); /* { dg-warning "array subscript" } */
+ h(sizeof a[-1]);
+ h(sizeof a[10]);
+ h(sizeof b[-1]);
+ h(sizeof b[10]);
+ h(sizeof c.c[-1]);
+ h(sizeof c.c[10]);
+
+ if (10 < 10)
+ a[10] = 0;
+ if (10 < 10)
+ b[10] = 0;
+ if (-1 >= 0)
+ c.c[-1] = 0;
+
+ for (i = 20; i < 30; ++i)
+ a[i] = 1; /* { dg-warning "15:array subscript" } */
+
+ return a;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-1.c
new file mode 100644
index 000000000..29e07e412
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options -Wattributes } */
+
+void __attribute__((dj)) foo() { } /* { dg-warning "attribute directive ignored" } */
+
+int j __attribute__((unrecognized)); /* { dg-warning "attribute directive ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-2.c
new file mode 100644
index 000000000..691870420
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-2.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options -Wno-attributes } */
+
+void __attribute__((dj)) foo() { } /* { dg-bogus "attribute directive ignored" } */
+
+int j __attribute__((unrecognized)); /* { dg-bogus "attribute directive ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-3.c
new file mode 100644
index 000000000..59d14c7b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wattributes-3.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+
+void __attribute__((dj)) foo() { } /* { dg-warning "attribute directive ignored" } */
+
+int j __attribute__((unrecognized)); /* { dg-warning "attribute directive ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wbad-function-cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wbad-function-cast-1.c
new file mode 100644
index 000000000..4a0547f0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wbad-function-cast-1.c
@@ -0,0 +1,51 @@
+/* Test operation of -Wbad-function-cast. Bug 6980 complained of the
+ wording of the diagnostic. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-Wbad-function-cast" } */
+
+void vf(void);
+int if1(void);
+char if2(void);
+long if3(void);
+float rf1(void);
+double rf2(void);
+_Complex double cf(void);
+enum e { E1 } ef(void);
+_Bool bf(void);
+char *pf1(void);
+int *pf2(void);
+
+void
+foo(void)
+{
+ /* Casts to void types are always OK. */
+ (void)vf();
+ (void)if1();
+ (void)cf();
+ (const void)bf();
+ /* Casts to the same type or similar types are OK. */
+ (int)if1();
+ (long)if2();
+ (char)if3();
+ (float)rf1();
+ (long double)rf2();
+ (_Complex float)cf();
+ (enum f { F1 })ef();
+ (_Bool)bf();
+ (void *)pf1();
+ (char *)pf2();
+ /* Casts to types with different TREE_CODE (which is how this
+ warning has been defined) are not OK, except for casts to void
+ types. */
+ (float)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'float'" } */
+ (double)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'double'" } */
+ (_Bool)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Bool'" } */
+ (int)rf1(); /* { dg-warning "cast from function call of type 'float' to non-matching type 'int'" } */
+ (long)rf2(); /* { dg-warning "cast from function call of type 'double' to non-matching type 'long int'" } */
+ (double)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'double'" } */
+ (int)ef(); /* { dg-warning "cast from function call of type 'enum e' to non-matching type 'int'" } */
+ (int)bf(); /* { dg-warning "cast from function call of type '_Bool' to non-matching type 'int'" } */
+ (__SIZE_TYPE__)pf1(); /* { dg-warning "cast from function call of type 'char \\*' to non-matching type '\[^\\n\]*'" } */
+ (__PTRDIFF_TYPE__)pf2(); /* { dg-warning "cast from function call of type 'int \\*' to non-matching type '\[^\\n\]*'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wc++-compat.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wc++-compat.c
new file mode 100644
index 000000000..aa435be9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wc++-compat.c
@@ -0,0 +1,9 @@
+/* Copyright (C) 2005 Free Software Foundation.
+
+ by Gabriel Dos Reis <gdr@integrable-solutions.net> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+extern const int foo = 42;
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wchar-subscripts-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wchar-subscripts-1.c
new file mode 100644
index 000000000..3f5adeb31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wchar-subscripts-1.c
@@ -0,0 +1,29 @@
+/* Test -Wchar-subscripts. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wchar-subscripts" } */
+
+extern int a[];
+int *p;
+char c;
+signed char sc;
+unsigned char uc;
+
+void
+f (void)
+{
+ a[sc];
+ a[uc];
+ sc[a];
+ uc[a];
+ p[sc];
+ p[uc];
+ sc[p];
+ uc[p];
+ a[c]; /* { dg-warning "array subscript has type 'char'" } */
+ p[c]; /* { dg-warning "array subscript has type 'char'" } */
+ /* -Wchar-subscripts does not warn if the char is not syntactically
+ the subscript. */
+ c[a];
+ c[p];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wchar-subscripts.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wchar-subscripts.c
new file mode 100644
index 000000000..acc6d2357
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wchar-subscripts.c
@@ -0,0 +1,12 @@
+/* Copyright (C) 2005 Free Software Foundation.
+
+ by Gabriel Dos Reis <gdr@integrable-solutions.net> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wchar-subscripts" } */
+
+int main(void)
+{
+ int ary[256] = { 0 };
+ return ary['a'];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-3.c
new file mode 100644
index 000000000..d45749d69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-3.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wconversion" } */
+
+unsigned f(unsigned a) { return a + -1; } /* { dg-warning "negative" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-4.c
new file mode 100644
index 000000000..ddd19879f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-4.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned f(unsigned a) { return a + -1; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-5.c
new file mode 100644
index 000000000..be749a9a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-5.c
@@ -0,0 +1,35 @@
+/* PR c++/34198 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wconversion" } */
+
+signed char sc;
+unsigned char uc;
+short int ss;
+unsigned short int us;
+int si;
+unsigned int ui;
+
+void test1 (void)
+{
+ int a = uc & 0xff;
+ int b = sc & 0x7f;
+ int c = 0xff & uc;
+ int d = 0x7f & sc;
+ int e = uc & sc;
+ unsigned char f = (int) uc;
+ signed char g = (int) sc;
+ unsigned char h = (unsigned int) (short int) uc;
+ signed char i = (int) (unsigned short int) sc; /* { dg-warning "may alter its value" "" { target { int32plus } } } */
+ unsigned char j = (unsigned int) (short int) us; /* { dg-warning "may alter its value" } */
+ signed char k = (int) (unsigned short int) ss; /* { dg-warning "may alter its value" } */
+}
+
+void test2 (void)
+{
+ signed char a = (unsigned char) sc; /* { dg-warning "may change the sign" } */
+ unsigned char b = (signed char) uc; /* { dg-warning "may change the sign" } */
+ signed char c = (int) (unsigned char) sc; /* { dg-warning "may change the sign" } */
+ unsigned char d = (int) (signed char) uc; /* { dg-warning "may change the sign" } */
+ int e = (unsigned int) si; /* { dg-warning "may change the sign" } */
+ unsigned int f = (int) ui; /* { dg-warning "may change the sign" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c
new file mode 100644
index 000000000..c17d502d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-integer-no-sign.c
@@ -0,0 +1,96 @@
+/* Test for diagnostics for implicit conversions between integer types
+ These tests come from gcc/testsuite/gcc.dg/overflow-warn-2.c */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fsigned-char -Wconversion -Wno-sign-conversion" } */
+
+#include <limits.h>
+
+void fsc (signed char sc);
+void fuc (unsigned char uc);
+unsigned fui (unsigned int ui);
+void fsi (signed int ui);
+
+void h (int x)
+{
+ unsigned int ui = 3;
+ int si = 3;
+ unsigned char uc = 3;
+ signed char sc = 3;
+
+ uc = ui; /* { dg-warning "conversion" } */
+ uc = si; /* { dg-warning "conversion" } */
+ sc = ui; /* { dg-warning "conversion" } */
+ sc = si; /* { dg-warning "conversion" } */
+ fuc (ui); /* { dg-warning "conversion" } */
+ fuc (si); /* { dg-warning "conversion" } */
+ fsc (ui); /* { dg-warning "conversion" } */
+ fsc (si); /* { dg-warning "conversion" } */
+
+ fsi (si);
+ fui (ui);
+ fsi (uc);
+ si = uc;
+ fui (uc);
+ ui = uc;
+ fui ('A');
+ ui = 'A';
+ fsi ('A');
+ si = 'A';
+ fuc ('A');
+ uc = 'A';
+
+ uc = x ? 1U : -1; /* { dg-warning "conversion" } */
+ uc = x ? SCHAR_MIN : 1U; /* { dg-warning "conversion" } */
+ uc = x ? 1 : -1; /* Warned by -Wsign-conversion. */
+ uc = x ? SCHAR_MIN : 1; /* Warned by -Wsign-conversion. */
+ ui = x ? 1U : -1; /* Warned by -Wsign-conversion. */
+ ui = x ? INT_MIN : 1U; /* Warned by -Wsign-conversion. */
+ ui = ui ? SCHAR_MIN : 1U; /* Warned by -Wsign-conversion. */
+ ui = 1U * -1; /* Warned by -Wsign-conversion. */
+ ui = ui + INT_MIN; /* Warned by -Wsign-conversion. */
+ ui = x ? 1 : -1; /* Warned by -Wsign-conversion. */
+ ui = ui ? SCHAR_MIN : 1; /* Warned by -Wsign-conversion. */
+
+ fuc (-1); /* Warned by -Wsign-conversion. */
+ uc = -1; /* Warned by -Wsign-conversion. */
+ fui (-1); /* Warned by -Wsign-conversion. */
+ ui = -1; /* Warned by -Wsign-conversion. */
+ fuc ('\xa0'); /* Warned by -Wsign-conversion. */
+ uc = '\xa0'; /* Warned by -Wsign-conversion. */
+ fui ('\xa0'); /* Warned by -Wsign-conversion. */
+ ui = '\xa0'; /* Warned by -Wsign-conversion. */
+ fsi ((unsigned) INT_MAX + 1U); /* Warned by -Wsign-conversion. */
+ si = (unsigned) INT_MAX + 1U; /* Warned by -Wsign-conversion. */
+
+
+ fsi (UINT_MAX - 1); /* Warned by -Wsign-conversion. */
+ si = UINT_MAX - 1; /* Warned by -Wsign-conversion. */
+ fsi (UINT_MAX - 1U); /* Warned by -Wsign-conversion. */
+ si = UINT_MAX - 1U; /* Warned by -Wsign-conversion. */
+ fsi (UINT_MAX/3U);
+ si = UINT_MAX/3U;
+ fsi (UINT_MAX/3);
+ si = UINT_MAX/3;
+ fui (UINT_MAX - 1);
+ ui = UINT_MAX - 1;
+
+ uc = (unsigned char) -1;
+ ui = -1 * (1 * -1);
+ ui = (unsigned) -1;
+
+ fsc (uc); /* Warned by -Wsign-conversion. */
+ sc = uc; /* Warned by -Wsign-conversion. */
+ fuc (sc); /* Warned by -Wsign-conversion. */
+ uc = sc; /* Warned by -Wsign-conversion. */
+ fsi (ui); /* Warned by -Wsign-conversion. */
+ si = ui; /* Warned by -Wsign-conversion. */
+ fui (si); /* Warned by -Wsign-conversion. */
+ ui = si; /* Warned by -Wsign-conversion. */
+ fui (sc); /* Warned by -Wsign-conversion. */
+ ui = sc; /* Warned by -Wsign-conversion. */
+}
+
+unsigned fui (unsigned a) { return a + -1; } /* Warned by -Wsign-conversion. */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-integer.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-integer.c
new file mode 100644
index 000000000..4479349e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-integer.c
@@ -0,0 +1,98 @@
+/* Test for diagnostics for implicit conversions between integer types
+ These tests come from gcc/testsuite/gcc.dg/overflow-warn-2.c */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fsigned-char -Wconversion" } */
+
+#include <limits.h>
+
+void fsc (signed char sc);
+void fuc (unsigned char uc);
+unsigned fui (unsigned int ui);
+void fsi (signed int ui);
+
+void h (int x)
+{
+ unsigned int ui = 3;
+ int si = 3;
+ unsigned char uc = 3;
+ signed char sc = 3;
+
+ uc = ui; /* { dg-warning "conversion" } */
+ uc = si; /* { dg-warning "conversion" } */
+ sc = ui; /* { dg-warning "conversion" } */
+ sc = si; /* { dg-warning "conversion" } */
+ fuc (ui); /* { dg-warning "conversion" } */
+ fuc (si); /* { dg-warning "conversion" } */
+ fsc (ui); /* { dg-warning "conversion" } */
+ fsc (si); /* { dg-warning "conversion" } */
+
+ fsi (si);
+ fui (ui);
+ fsi (uc);
+ si = uc;
+ fui (uc);
+ ui = uc;
+ fui ('A');
+ ui = 'A';
+ fsi ('A');
+ si = 'A';
+ fuc ('A');
+ uc = 'A';
+
+ uc = x ? 1U : -1; /* { dg-warning " conversion" "conversion" } */
+ /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } 43 } */
+ uc = x ? SCHAR_MIN : 1U; /* { dg-warning " conversion" "conversion" } */
+ /* { dg-warning "negative integer implicitly converted to unsigned type" "implicit" { target *-*-* } 45 } */
+ uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+
+ fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ fui (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ fuc ('\xa0'); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ fui ('\xa0');/* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ fsi (0x80000000); /* { dg-warning "conversion" } */
+ si = 0x80000000; /* { dg-warning "conversion" } */
+
+
+ fsi (UINT_MAX - 1); /* { dg-warning "conversion" } */
+ si = UINT_MAX - 1; /* { dg-warning "conversion" } */
+ fsi (UINT_MAX - 1U); /* { dg-warning "conversion" } */
+ si = UINT_MAX - 1U; /* { dg-warning "conversion" } */
+ fsi (UINT_MAX/3U);
+ si = UINT_MAX/3U;
+ fsi (UINT_MAX/3);
+ si = UINT_MAX/3;
+ fui (UINT_MAX - 1);
+ ui = UINT_MAX - 1;
+
+ uc = (unsigned char) -1;
+ ui = -1 * (1 * -1);
+ ui = (unsigned) -1;
+
+ fsc (uc); /* { dg-warning "conversion" } */
+ sc = uc; /* { dg-warning "conversion" } */
+ fuc (sc); /* { dg-warning "conversion" } */
+ uc = sc; /* { dg-warning "conversion" } */
+ fsi (ui); /* { dg-warning "conversion" } */
+ si = ui; /* { dg-warning "conversion" } */
+ fui (si); /* { dg-warning "conversion" } */
+ ui = si; /* { dg-warning "conversion" } */
+ fui (sc); /* { dg-warning "conversion" } */
+ ui = sc; /* { dg-warning "conversion" } */
+}
+
+unsigned fui (unsigned a) { return a + -1; } /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-pr34389.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-pr34389.c
new file mode 100644
index 000000000..1a4336802
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-pr34389.c
@@ -0,0 +1,55 @@
+/* PR 34389 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Wsign-conversion" } */
+/* { dg-require-effective-target int32plus } */
+
+short mask1(short x)
+{
+ short y = 0x7fff;
+ return x & y;
+}
+
+short mask2(short ssx)
+{
+ short ssy;
+ short ssz;
+
+ ssz = ((int)ssx) & 0x7fff;
+ ssy = ((int)ssx) | 0x7fff;
+ ssz = ((int)ssx) ^ 0x7fff;
+ return ssx & 0x7fff;
+}
+
+short mask3(int si, unsigned int ui)
+{
+ short ss;
+ unsigned short us;
+
+ ss = si & 0x7fff;
+ ss = si & 0xAAAA; /* { dg-warning "conversion" } */
+ ss = ui & 0x7fff;
+ ss = ui & 0xAAAA; /* { dg-warning "conversion" } */
+
+ us = si & 0x7fff;
+ us = si & 0xAAAA; /* { dg-warning "conversion" } */
+ us = ui & 0x7fff;
+ us = ui & 0xAAAA; /* 0xAAAA is zero-extended, thus it masks the
+ upper bits of 'ui' making it fit in 'us'. */
+
+ return ss;
+}
+
+short mask4(int x, int y)
+{
+ return x & y; /* { dg-warning "conversion" } */
+}
+
+short mask5(int x)
+{
+ return x & -1; /* { dg-warning "conversion" } */
+}
+
+short mask6(short x)
+{
+ return x & -1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-real-integer.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-real-integer.c
new file mode 100644
index 000000000..896702546
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wconversion-real-integer.c
@@ -0,0 +1,113 @@
+/* Test for diagnostics for Wconversion between floating-point and
+ integers. */
+
+/* { dg-do compile } */
+/* { dg-skip-if "doubles are floats,ints are 16bits" { "avr-*-*" } { "*" } { "" } } */
+/* { dg-options "-std=c99 -Wconversion" } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-require-effective-target double64plus } */
+#include <limits.h>
+
+void fsi (signed int x);
+void fui (unsigned int x);
+void ffloat (float x);
+void fdouble (double x);
+
+float vfloat;
+double vdouble;
+
+void h (void)
+{
+ unsigned int ui = 3;
+ int si = 3;
+ unsigned char uc = 3;
+ signed char sc = 3;
+ float f = 3;
+ double d = 3;
+
+ fsi (3.1f); /* { dg-warning "conversion" } */
+ si = 3.1f; /* { dg-warning "conversion" } */
+ fsi (3.1); /* { dg-warning "conversion" } */
+ si = 3.1; /* { dg-warning "conversion" } */
+ fsi (d); /* { dg-warning "conversion" } */
+ si = d; /* { dg-warning "conversion" } */
+ fui (-1.0); /* { dg-warning "overflow" } */
+ ui = -1.0; /* { dg-warning "overflow" } */
+ ffloat (INT_MAX); /* { dg-warning "conversion" } */
+ vfloat = INT_MAX; /* { dg-warning "conversion" } */
+ ffloat (16777217); /* { dg-warning "conversion" } */
+ vfloat = 16777217; /* { dg-warning "conversion" } */
+ ffloat (si); /* { dg-warning "conversion" } */
+ vfloat = si; /* { dg-warning "conversion" } */
+ ffloat (ui); /* { dg-warning "conversion" } */
+ vfloat = ui; /* { dg-warning "conversion" } */
+
+ fsi (3);
+ si = 3;
+ fsi (3.0f);
+ si = 3.0f;
+ fsi (3.0);
+ si = 3.0;
+ fsi (16777217.0f);
+ si = 16777217.0f;
+ fsi ((int) 3.1);
+ si = (int) 3.1;
+ ffloat (3U);
+ vfloat = 3U;
+ ffloat (3);
+ vfloat = 3;
+ ffloat (INT_MIN);
+ vfloat = INT_MIN;
+ ffloat (uc);
+ vfloat = uc;
+ ffloat (sc);
+ vfloat = sc;
+
+ fdouble (UINT_MAX);
+ vdouble = UINT_MAX;
+ fdouble (ui);
+ vdouble = ui;
+ fdouble (si);
+ vdouble = si;
+}
+
+
+void fss (signed short x);
+void fus (unsigned short x);
+void fsc (signed char x);
+void fuc (unsigned char x);
+
+void h2 (void)
+{
+ unsigned short int us;
+ short int ss;
+ unsigned char uc;
+ signed char sc;
+
+ fss (4294967294.0); /* { dg-warning "conversion" } */
+ ss = 4294967294.0; /* { dg-warning "conversion" } */
+ fss (-4294967294.0); /* { dg-warning "conversion" } */
+ ss = -4294967294.0; /* { dg-warning "conversion" } */
+ fus (4294967294.0); /* { dg-warning "conversion" } */
+ us = 4294967294.0; /* { dg-warning "conversion" } */
+ fus (-4294967294.0); /* { dg-warning "conversion" } */
+ us = -4294967294.0; /* { dg-warning "conversion" } */
+
+ fsc (500.0); /* { dg-warning "conversion" } */
+ sc = 500.0; /* { dg-warning "conversion" } */
+ fsc (-500.0); /* { dg-warning "conversion" } */
+ sc = -500.0; /* { dg-warning "conversion" } */
+ fuc (500.0); /* { dg-warning "conversion" } */
+ uc = 500.0; /* { dg-warning "conversion" } */
+ fuc (-500.0); /* { dg-warning "conversion" } */
+ uc = -500.0; /* { dg-warning "conversion" } */
+
+ fss (500.0);
+ ss = 500.0;
+ fss (-500.0);
+ ss = -500.0;
+ fus (500.0);
+ us = 500.0;
+ fus (-500.0); /* { dg-warning "conversion" } */
+ us = -500.0; /* { dg-warning "conversion" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-1.c
new file mode 100644
index 000000000..91500421e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-1.c
@@ -0,0 +1,11 @@
+/* PR c/21759 */
+/* { dg-options "-Wc++-compat" } */
+
+int
+main(void)
+{
+ void *p = 0;
+ int *q = p; /* { dg-warning "not permitted" } */
+ double* t = (void *)0;
+ return p != q;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-10.c
new file mode 100644
index 000000000..0f1d037bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-10.c
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+struct s1 { int f; };
+typedef int s2;
+void
+f1 ()
+{
+ typedef int s1;
+ struct s2 { int f; };
+}
+
+struct s3 { int f; };
+typedef struct s3 s3;
+
+typedef struct s4 s4;
+struct s4 { int f; };
+
+struct s5 { int f; }; /* { dg-message "note: originally defined here" } */
+typedef int s5; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+typedef int s6; /* { dg-message "note: originally defined here" } */
+struct s6 { int f; }; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+void
+f2 ()
+{
+ struct s7 { int f; }; /* { dg-message "note: originally defined here" } */
+ typedef int s7; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+ typedef int s8; /* { dg-message "note: originally defined here" } */
+ struct s8 { int f; }; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+ struct s9 { int f; };
+ { typedef int s9; }
+
+ typedef int s10;
+ { struct s10 { int f; }; }
+}
+
+enum e1 { A };
+typedef int e2;
+void
+f3 ()
+{
+ typedef int e1;
+ enum e2 { B };
+}
+
+enum e3 { C };
+typedef enum e3 e3;
+
+enum e5 { E }; /* { dg-message "note: originally defined here" } */
+typedef int e5; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+typedef int e6; /* { dg-message "note: originally defined here" } */
+enum e6 { F }; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+void
+f4 ()
+{
+ enum e7 { G }; /* { dg-message "note: originally defined here" } */
+ typedef int e7; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+ typedef int e8; /* { dg-message "note: originally defined here" } */
+ enum e8 { H }; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+ enum e9 { I };
+ { typedef int e9; }
+
+ typedef int e10;
+ { enum e10 { J }; }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-11.c
new file mode 100644
index 000000000..8818338ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-11.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+#include <stdarg.h>
+
+enum E { A };
+
+extern void f2 (int);
+void
+f1 (int n, ...)
+{
+ va_list ap;
+
+ va_start (ap, n);
+ f2 (va_arg (ap, int));
+ f2 (va_arg (ap, _Bool)); /* { dg-warning "promoted" } */
+ f2 (va_arg (ap, enum E)); /* { dg-warning "promoted" } */
+}
+
+/* Match extra informative notes. */
+/* { dg-message "note:" "expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-12.c
new file mode 100644
index 000000000..9061ee67c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-12.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-short-enums -Wc++-compat" } */
+
+enum E { A };
+
+enum E v;
+unsigned int *p = &v; /* { dg-warning "incompatible in C\[+\]\[+\]" } */
+
+void foo(unsigned int);
+void (*pfn)(enum E) = &foo; /* { dg-warning "incompatible in C\[+\]\[+\]" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-13.c
new file mode 100644
index 000000000..188239644
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-13.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+int and; /* { dg-warning "operator" } */
+int and_eq; /* { dg-warning "operator" } */
+int bitand; /* { dg-warning "operator" } */
+int bitor; /* { dg-warning "operator" } */
+int compl; /* { dg-warning "operator" } */
+int not; /* { dg-warning "operator" } */
+int not_eq; /* { dg-warning "operator" } */
+int or; /* { dg-warning "operator" } */
+int or_eq; /* { dg-warning "operator" } */
+int xor; /* { dg-warning "operator" } */
+int xor_eq; /* { dg-warning "operator" } */
+
+#define M1 and /* { dg-warning "operator" } */
+#define M2 and_eq /* { dg-warning "operator" } */
+#define M3 bitand /* { dg-warning "operator" } */
+#define M4 bitor /* { dg-warning "operator" } */
+#define M5 compl /* { dg-warning "operator" } */
+#define M6 not /* { dg-warning "operator" } */
+#define M7 not_eq /* { dg-warning "operator" } */
+#define M8 or /* { dg-warning "operator" } */
+#define M9 or_eq /* { dg-warning "operator" } */
+#define M10 xor /* { dg-warning "operator" } */
+#define M11 xor_eq /* { dg-warning "operator" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-14.c
new file mode 100644
index 000000000..23783711b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-14.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+char a1[] = "a";
+char a2[1] = "a"; /* { dg-warning "C\[+\]\[+\]" } */
+char a3[2] = "a";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-15.c
new file mode 100644
index 000000000..82a76ec4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-15.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+typedef int myint1;
+typedef int myint2;
+typedef int myint3;
+struct s1
+{
+ myint1 myint1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ myint2 *myint2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ int myint3;
+ struct s2
+ {
+ myint3 f2; /* { dg-warning "C\[+\]\[+\]" } */
+ } f1;
+};
+
+struct s3
+{
+ int myint1;
+ struct s4
+ {
+ int myint1;
+ } f1;
+ struct s5
+ {
+ int myint1;
+ struct s6
+ {
+ myint1 f4; /* { dg-warning "C\[+\]\[+\]" } */
+ } f3;
+ } f2;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-16.c
new file mode 100644
index 000000000..51b503bf6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-16.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+struct { int f1; } g1; /* { dg-warning "C\[+\]\[+\]" } */
+static struct { int f2; } g2;
+struct s { int f3; } g3;
+union { int f4; } g4; /* { dg-warning "C\[+\]\[+\]" } */
+static union { int f5; } g5;
+union u { int f6; } g6;
+enum { A } g7; /* { dg-warning "C\[+\]\[+\]" } */
+static enum { B } g8;
+enum E { C } g9;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-17.c
new file mode 100644
index 000000000..78760d641
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-17.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+const int v1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+const char * const v2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+struct s { int f1; int f2; };
+const struct s v3; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+const int v4 = 1;
+const char * const v5 = 0;
+const struct s v6 = { 0, 0 };
+const struct s v7 = { 0 };
+void
+f()
+{
+ const int v11; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ const char * const v12; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ const struct s v13; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ const int v14 = 1;
+ const char * const v15 = 0;
+ const struct s v16 = { 0, 0 };
+ const struct s v17 = { 0 };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-18.c
new file mode 100644
index 000000000..9ae2d770a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-18.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+enum E1 { A };
+enum E2 { B };
+int
+f1 (int i)
+{
+ return (int) (i ? A : B); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
+extern enum E1 f2();
+int
+f3 (int i)
+{
+ return (int) (i ? f2 () : B); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-19.c
new file mode 100644
index 000000000..120ccf5c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-19.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+int v1; /* { dg-message "previous declaration" } */
+int v1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+int v2; /* { dg-message "previous declaration" } */
+int v2 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+extern int v3;
+int v3; /* { dg-message "previous declaration" } */
+int v3 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+extern int v4;
+int v4 = 1;
+static int v5; /* { dg-message "previous declaration" } */
+static int v5; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+static int v6; /* { dg-message "previous declaration" } */
+static int v6 = 1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+int v7;
+extern int v7;
+int v8 = 1;
+extern int v8;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
new file mode 100644
index 000000000..4578bece1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
@@ -0,0 +1,38 @@
+/* { dg-options "-Wc++-compat" } */
+
+_Bool foo; /* This is okay. */
+int bool; /* { dg-warning "5:keyword" } */
+int catch; /* { dg-warning "5:keyword" } */
+int char16_t; /* { dg-warning "5:keyword" } */
+int char32_t; /* { dg-warning "5:keyword" } */
+int class; /* { dg-warning "5:keyword" } */
+int const_cast; /* { dg-warning "5:keyword" } */
+int constexpr; /* { dg-warning "5:keyword" } */
+int decltype; /* { dg-warning "5:keyword" } */
+int delete; /* { dg-warning "5:keyword" } */
+int dynamic_cast; /* { dg-warning "5:keyword" } */
+int explicit; /* { dg-warning "5:keyword" } */
+int export; /* { dg-warning "5:keyword" } */
+int false; /* { dg-warning "5:keyword" } */
+int friend; /* { dg-warning "5:keyword" } */
+int mutable; /* { dg-warning "5:keyword" } */
+int namespace; /* { dg-warning "5:keyword" } */
+int new; /* { dg-warning "5:keyword" } */
+int nullptr; /* { dg-warning "5:keyword" } */
+int operator; /* { dg-warning "5:keyword" } */
+int private; /* { dg-warning "5:keyword" } */
+int protected; /* { dg-warning "5:keyword" } */
+int public; /* { dg-warning "5:keyword" } */
+int reinterpret_cast; /* { dg-warning "5:keyword" } */
+int static_assert; /* { dg-warning "5:keyword" } */
+int static_cast; /* { dg-warning "5:keyword" } */
+int template; /* { dg-warning "5:keyword" } */
+int this; /* { dg-warning "5:keyword" } */
+int throw; /* { dg-warning "5:keyword" } */
+int true; /* { dg-warning "5:keyword" } */
+int try; /* { dg-warning "5:keyword" } */
+int typename; /* { dg-warning "5:keyword" } */
+int typeid; /* { dg-warning "5:keyword" } */
+int using; /* { dg-warning "5:keyword" } */
+int virtual; /* { dg-warning "5:keyword" } */
+int wchar_t;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-20.c
new file mode 100644
index 000000000..af774acc8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-20.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+typedef struct s { const int i; } s; /* { dg-message "should be initialized" } */
+union u {const int a; double b;}; /* { dg-message "should be initialized" } */
+struct ts { int a; s v;};
+struct ta { int a; s v[2];};
+
+void f ()
+{
+ s v1; /* { dg-warning "uninitialized const member in" } */
+ s va[2]; /* { dg-warning "uninitialized const member in" } */
+ union u v2; /* { dg-warning "uninitialized const member in" } */
+ struct ts v3; /* { dg-warning "uninitialized const member in" } */
+ struct ta ta[2]; /* { dg-warning "uninitialized const member in" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-21.c
new file mode 100644
index 000000000..183f0f179
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-21.c
@@ -0,0 +1,25 @@
+/* PR c/44772 */
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+typedef enum { E1, E2 } E;
+
+typedef struct
+{
+ E e;
+ union
+ {
+ int i;
+ char *c;
+ }; /* { dg-bogus "as both field and typedef name" } */
+} S;
+
+S s;
+
+typedef int T;
+
+struct U
+{
+ T t;
+ union { int i; }; /* { dg-bogus "as both field and typedef name" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-3.c
new file mode 100644
index 000000000..306167314
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-3.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+enum E1 { A, B, C };
+enum E2 { D, E, F };
+extern void f2 (enum E1);
+
+void
+f1 ()
+{
+ int a = A;
+ enum E1 e1;
+ enum E2 e2;
+
+ f2 (0); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ f2 (A);
+ f2 (D); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ f2 (a); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ f2 (e1);
+ f2 (e2); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ f2 ((A));
+ f2 (a ? A : B);
+ f2 ((enum E1) 0);
+ f2 ((enum E1) D);
+ f2 ((enum E1) a);
+ f2 ((enum E1) e2);
+}
+
+struct s1 { enum E1 e1 : 3; };
+struct s2 { enum E2 e2 : 3; };
+
+void
+f3 (struct s1 sv1, struct s2 sv2)
+{
+ f2 (sv1.e1);
+ f2 (sv2.e2); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
+
+void
+f4 (struct s1 *pv1, struct s2 *pv2)
+{
+ f2 (pv1->e1);
+ f2 (pv2->e2); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
+
+/* Match all extra informative notes. */
+/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-4.c
new file mode 100644
index 000000000..a294ffe0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-4.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+enum E1 { A, B, C };
+enum E2 { D, E, F };
+
+enum E1 g1;
+enum E2 g2;
+
+void
+f1 ()
+{
+ int a;
+ int d;
+ enum E1 e1;
+ enum E2 e2;
+ a = A;
+ a = !B;
+ d = E;
+ e1 = A;
+ e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e1 = 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e1 = (enum E1) 0;
+ e1 = (enum E2) 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e1 = e2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e1 = g1;
+ e1 = g2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e2 = A; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e2 = D;
+}
+
+struct s { enum E1 e1 : 3; };
+
+void
+f2 (struct s sv)
+{
+ sv.e1 = A;
+ sv.e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ g1 = sv.e1;
+ g2 = sv.e1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
+
+void
+f3 (struct s *pv)
+{
+ pv->e1 = A;
+ pv->e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ g1 = pv->e1;
+ g2 = pv->e1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-5.c
new file mode 100644
index 000000000..d7b2f96a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-5.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+enum E1 { A, B, C };
+enum E2 { D, E, F };
+
+int f1() { return A; }
+
+struct s { enum E1 e1 : 3; enum E2 e2 : 4; };
+
+enum E1
+f2 (int i, struct s sv, struct s *pv)
+{
+ int a;
+ enum E1 e1 = B;
+ enum E2 e2 = E;
+ switch (i)
+ {
+ case 0:
+ return A;
+ case 1:
+ return D; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ case 2:
+ return 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ case 3:
+ return (enum E1) 1;
+ case 4:
+ return (enum E2) 2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ case 5:
+ return e1;
+ case 6:
+ return e2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ case 7:
+ return pv->e1;
+ case 8:
+ return sv.e1;
+ case 9:
+ return pv->e2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ case 10:
+ return sv.e2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ case 11:
+ return 1, A;
+ default:
+ return C;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-6.c
new file mode 100644
index 000000000..2b327c4bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-6.c
@@ -0,0 +1,112 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+enum E1 { A, B, C };
+enum E2 { D, E, F };
+
+enum E1 v1a = A;
+enum E1 v1b = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+enum E1 v1c = 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+enum E1 v1d = (enum E1) 0;
+enum E1 v1e = (enum E2) 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+
+enum E2 v2a;
+
+enum E1 a1[] =
+{
+ A,
+ D, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ 0, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ (enum E1) 0,
+ (enum E2) 0, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ A
+};
+
+struct s1
+{
+ enum E1 e1;
+};
+
+struct s1 a2[] =
+{
+ { A },
+ { D }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { 0 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { (enum E1) 0 },
+ { (enum E2) 0 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { A }
+};
+
+struct s1 a3[] =
+{
+ [ 5 ] = { .e1 = A },
+ [ 4 ] = { .e1 = D }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ [ 3 ] = { .e1 = 0 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ [ 2 ] = { .e1 = (enum E1) 0 },
+ [ 1 ] = { .e1 = (enum E2) 0 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ [ 0 ] = { .e1 = A }
+};
+
+struct s2
+{
+ enum E1 e1 : 3;
+};
+
+struct s2 a4[] =
+{
+ { A },
+ { D }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { 0 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { (enum E1) 0 },
+ { (enum E2) 0 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { A }
+};
+
+struct s2 a5[] =
+{
+ [ 5 ] = { .e1 = A },
+ [ 4 ] = { .e1 = D }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ [ 3 ] = { .e1 = 0 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ [ 2 ] = { .e1 = (enum E1) 0 },
+ [ 1 ] = { .e1 = (enum E2) 0 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ [ 0 ] = { .e1 = A }
+};
+
+void
+f(enum E1 e1, enum E2 e2, struct s1 vs1, struct s1 *vp1)
+{
+ enum E1 va1[] = {
+ e1,
+ e2, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ v1a,
+ v2a, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ vs1.e1,
+ vp1->e1,
+ e1 ? e1 : e1,
+ (0, e1)
+ };
+
+ struct s1 va2[] = {
+ { e1 },
+ { e2 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { v1a },
+ { v2a }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { vs1.e1 },
+ { vp1->e1 },
+ { e1 ? e1 : e1 },
+ { (0, e1) }
+ };
+
+ struct s2 va3[] = {
+ { e1 },
+ { e2 }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { v1a },
+ { v2a }, /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ { vs1.e1 },
+ { vp1->e1 },
+ { e1 ? e1 : e1 },
+ { (0, e1) }
+ };
+}
+
+/* Match all extra informative notes. */
+/* { dg-warning "near initialization for" "expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-7.c
new file mode 100644
index 000000000..bccbd1107
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-7.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+struct s1
+{
+ enum e1 /* { dg-message "note: enum type defined here" } */
+ {
+ A, /* { dg-message "note: enum constant defined here" } */
+ B
+ } f1;
+ struct s2 /* { dg-message "note: struct defined here" } */
+ {
+ struct s3 /* { dg-message "note: struct defined here" } */
+ {
+ enum e1 f3;
+ struct s1 *p1;
+ struct s2 *p2;
+ struct s3 *p3;
+ } f2;
+ union u1 /* { dg-message "note: union defined here" } */
+ {
+ int f4;
+ } f5;
+ struct s3 f6;
+ } f7;
+ struct s2 f8;
+ enum e1 f9;
+};
+
+struct s1 v1;
+enum e1 v2; /* { dg-warning "not visible in C\[+\]\[+\]" } */
+struct s2 v3; /* { dg-warning "not visible in C\[+\]\[+\]" } */
+struct s3 v4; /* { dg-warning "not visible in C\[+\]\[+\]" } */
+union u1 v5; /* { dg-warning "not visible in C\[+\]\[+\]" } */
+int i = A; /* { dg-warning "not visible in C\[+\]\[+\]" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-8.c
new file mode 100644
index 000000000..f7e8c5579
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-8.c
@@ -0,0 +1,67 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+struct s1
+{
+ enum e1 /* { dg-message "note: enum type defined here" } */
+ {
+ A = sizeof (struct s2 { int i; }), /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ B
+ } f1;
+};
+struct s2 v1; /* Don't issue another warning about s2. */
+enum e1 v2; /* { dg-warning "not visible in C\[+\]\[+\]" } */
+
+enum e2
+{
+ C = sizeof (struct s3 { int i; }), /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ D = __alignof__ (struct s4 { int i; }), /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ E
+};
+
+struct s3 v3;
+int v4 = C;
+
+enum e3
+{
+ F = sizeof (struct t3), /* { dg-bogus "invalid in C\[+\]\[+\]" } */
+ /* { dg-error "invalid application of 'sizeof'" "" { target *-*-* } 27 } */
+ G = __alignof__ (struct t4), /* { dg-bogus "invalid in C\[+\]\[+\]" } */
+ /* { dg-error "invalid application of '__alignof__'" "" { target *-*-* } 29 } */
+ H
+};
+
+__typeof__ (struct s5 { int i; }) v5; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+__typeof__ (struct t5) w5; /* { dg-bogus "invalid in C\[+\]\[+\]" } */
+
+int
+f1 (struct s1 *p)
+{
+ return ((struct s6 { int j; } *) p)->j; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
+
+void *
+f2 (struct s1 *p)
+{
+ return ((struct t6 *) p); /* { dg-bogus "invalid in C\[+\]\[+\]" } */
+}
+
+int
+f3 (struct s1 *p)
+{
+ return (__extension__ (struct s7 { int j; } *)p)->j;
+}
+
+int
+f4 ()
+{
+ return (struct s8 { int i; }) { 0 }.i; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
+
+void *
+f5 ()
+{
+ return &((struct t8) { }); /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
+
+/* { dg-error "invalid use of undefined type" "" { target *-*-* } 64 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-9.c
new file mode 100644
index 000000000..8a3867c11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wcxx-compat-9.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+enum e { FIRST, LAST };
+
+extern void f2 (enum e);
+
+void
+f1 ()
+{
+ enum e v;
+
+ for (v = FIRST; v < LAST; ++v) /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ f2 (v);
+ for (v = FIRST; v < LAST; v++) /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ f2 (v);
+ for (v = LAST; v > FIRST; --v) /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ f2 (v);
+ for (v = LAST; v > FIRST; v--) /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ f2 (v);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-1.c
new file mode 100644
index 000000000..64a173a9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-1.c
@@ -0,0 +1,26 @@
+/* Test for -Wdeclaration-after-statement emitting warnings when no
+ standard-specifying option is given. See also c9?-mixdecl-*. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-Wdeclaration-after-statement" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i = 0;
+ if (i != 0)
+ abort ();
+ i++;
+ if (i != 1)
+ abort ();
+ int j = i; /* { dg-warning "" "declaration after statement" } */
+ if (j != 1)
+ abort ();
+ struct foo { int i0; } k = { 4 }; /* { dg-warning "" "declaration after statement" } */
+ if (k.i0 != 4)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-2.c
new file mode 100644
index 000000000..ac89bbc26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-2.c
@@ -0,0 +1,26 @@
+/* Test for C99 mixed declarations and code giving warnings, not error with
+ -Wdeclaration-after-statement. See also c9?-mixdecl-*. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=c99 -pedantic-errors -Wdeclaration-after-statement" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i = 0;
+ if (i != 0)
+ abort ();
+ i++;
+ if (i != 1)
+ abort ();
+ int j = i; /* { dg-warning "" "declaration-after-statement" } */
+ if (j != 1)
+ abort ();
+ struct foo { int i0; } k = { 4 }; /* { dg-warning "" "declaration-after-statement" } */
+ if (k.i0 != 4)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-3.c
new file mode 100644
index 000000000..f001edf20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wdeclaration-after-statement-3.c
@@ -0,0 +1,24 @@
+/* PR 35058: -Werror= works only with some warnings. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic -Werror=declaration-after-statement" } */
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i = 0;
+ if (i != 0)
+ abort ();
+ i++;
+ if (i != 1)
+ abort ();
+ int j = i; /* { dg-error "" "declaration-after-statement" } */
+ if (j != 1)
+ abort ();
+ struct foo { int i0; } k = { 4 }; /* { dg-error "" "declaration-after-statement" } */
+ if (k.i0 != 4)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wdouble-promotion.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wdouble-promotion.c
new file mode 100644
index 000000000..d7a61899f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wdouble-promotion.c
@@ -0,0 +1,104 @@
+/* { dg-do compile } */
+/* { dg-options "-Wdouble-promotion" } */
+
+#include <stddef.h>
+
+/* Some targets do not provide <complex.h> so we define I ourselves. */
+#define I 1.0iF
+#define ID ((_Complex double)I)
+
+float f;
+double d;
+int i;
+long double ld;
+_Complex float cf;
+_Complex double cd;
+_Complex long double cld;
+size_t s;
+
+extern void unprototyped_fn ();
+extern void varargs_fn (int, ...);
+extern void double_fn (double);
+extern float float_fn (void);
+
+void
+usual_arithmetic_conversions(void)
+{
+ float local_f;
+ _Complex float local_cf;
+
+ /* Values of type "float" are implicitly converted to "double" or
+ "long double" due to use in arithmetic with "double" or "long
+ double" operands. */
+ local_f = f + 1.0; /* { dg-warning "implicit" } */
+ local_f = f - d; /* { dg-warning "implicit" } */
+ local_f = 1.0f * 1.0; /* { dg-warning "implicit" } */
+ local_f = 1.0f / d; /* { dg-warning "implicit" } */
+
+ local_cf = cf + 1.0; /* { dg-warning "implicit" } */
+ local_cf = cf - d; /* { dg-warning "implicit" } */
+ local_cf = cf + 1.0 * ID; /* { dg-warning "implicit" } */
+ local_cf = cf - cd; /* { dg-warning "implicit" } */
+
+ local_f = i ? f : d; /* { dg-warning "implicit" } */
+ i = f == d; /* { dg-warning "implicit" } */
+ i = d != f; /* { dg-warning "implicit" } */
+}
+
+void
+default_argument_promotion (void)
+{
+ /* Because there is no prototype, "f" is promoted to "double". */
+ unprototyped_fn (f); /* { dg-warning "implicit" } */
+ undeclared_fn (f); /* { dg-warning "implicit" } */
+ /* Because "f" is part of the variable argument list, it is promoted
+ to "double". */
+ varargs_fn (1, f); /* { dg-warning "implicit" } */
+}
+
+/* There is no warning when an explicit cast is used to perform the
+ conversion. */
+
+void
+casts (void)
+{
+ float local_f;
+ _Complex float local_cf;
+
+ local_f = (double)f + 1.0; /* { dg-bogus "implicit" } */
+ local_f = (double)f - d; /* { dg-bogus "implicit" } */
+ local_f = (double)1.0f + 1.0; /* { dg-bogus "implicit" } */
+ local_f = (double)1.0f - d; /* { dg-bogus "implicit" } */
+
+ local_cf = (_Complex double)cf + 1.0; /* { dg-bogus "implicit" } */
+ local_cf = (_Complex double)cf - d; /* { dg-bogus "implicit" } */
+ local_cf = (_Complex double)cf + 1.0 * ID; /* { dg-bogus "implicit" } */
+ local_cf = (_Complex double)cf - cd; /* { dg-bogus "implicit" } */
+
+ local_f = i ? (double)f : d; /* { dg-bogus "implicit" } */
+ i = (double)f == d; /* { dg-bogus "implicit" } */
+ i = d != (double)f; /* { dg-bogus "implicit" } */
+}
+
+/* There is no warning on conversions that occur in assignment (and
+ assignment-like) contexts. */
+
+void
+assignments (void)
+{
+ d = f; /* { dg-bogus "implicit" } */
+ double_fn (f); /* { dg-bogus "implicit" } */
+ d = float_fn (); /* { dg-bogus "implicit" } */
+}
+
+/* There is no warning in non-evaluated contexts. */
+
+void
+non_evaluated (void)
+{
+ s = sizeof (f + 1.0); /* { dg-bogus "implicit" } */
+ s = __alignof__ (f + 1.0); /* { dg-bogus "implicit" } */
+ d = (__typeof__(f + 1.0))f; /* { dg-bogus "implicit" } */
+ s = sizeof (i ? f : d); /* { dg-bogus "implicit" } */
+ s = sizeof (unprototyped_fn (f)); /* { dg-bogus "implicit" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wenum-compare-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wenum-compare-1.c
new file mode 100644
index 000000000..dd321e0f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wenum-compare-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-Wenum-compare" } */
+enum E1 { A, B, C };
+enum E2 { D, E, F };
+extern void f2 ();
+void
+f1 ()
+{
+ int a = A;
+ int d = D;
+ enum E1 e1 = A;
+ enum E2 e2 = D;
+ if (A > D) /* { dg-warning "comparison between .enum E1. and .enum E2." } */
+ f2 ();
+ if (e1 > e2) /* { dg-warning "comparison between .enum E1. and .enum E2." } */
+ f2 ();
+ if (e1 > e2 + 1)
+ f2 ();
+ if (A > 0)
+ f2 ();
+ if (e1 > 0)
+ f2 ();
+ if (A + D > 0)
+ f2 ();
+ if (e1 > 0)
+ f2 ();
+ if (A + D > 0)
+ f2 ();
+ if ((int) A > D)
+ f2 ();
+ if ((int) e1 > e2)
+ f2 ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-1.c
new file mode 100644
index 000000000..001af2452
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Waddress -Wattributes -Werror -fshow-column" } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+
+/* This is the first in a series of test cases that test the
+ interaction between -Wfoo, -Werror, -Werror=foo, and #pragma GCC
+ diagnostic error foo. This one has all the bits we're testing, the
+ others are subsets of this one. */
+
+#pragma GCC diagnostic error "-Waddress"
+
+void __attribute__((dj)) bar() { } /* { dg-error ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-error "7:.* will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-10.c
new file mode 100644
index 000000000..dced20cf0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-10.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-Wattributes -Werror" } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+
+/* Make sure #pragma can work with -Werror. */
+
+#pragma GCC diagnostic error "-Waddress"
+
+void __attribute__((dj)) bar() { } /* { dg-error ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-error ".* will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-11.c
new file mode 100644
index 000000000..3fb892ee6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-11.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-Wattributes -Werror" } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+
+/* Make sure #pragma can override -Werror. */
+
+#pragma GCC diagnostic warning "-Waddress"
+
+void __attribute__((dj)) bar() { } /* { dg-error ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-warning ".* will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-12.c
new file mode 100644
index 000000000..4f0bd1762
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-12.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Wattributes -Waddress" } */
+
+/* Make sure #pragma can override -Wfoo. */
+
+#pragma GCC diagnostic ignored "-Waddress"
+
+void __attribute__((dj)) bar() { } /* { dg-warning "attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-bogus "true" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-2.c
new file mode 100644
index 000000000..65f285edd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* This one is the baseline. Make sure with no option we get no
+ warnings. */
+
+void __attribute__((dj)) bar() { } /* { dg-warning ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i)
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-3.c
new file mode 100644
index 000000000..97874075d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-3.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-Waddress -Wattributes" } */
+
+/* Make sure the command line option enables the warning. */
+
+void __attribute__((dj)) bar() { } /* { dg-warning ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-warning ".* will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-4.c
new file mode 100644
index 000000000..73687bef1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Wattributes" } */
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+/* Make sure the pragma enables the error. */
+
+#pragma GCC diagnostic error "-Waddress"
+
+void __attribute__((dj)) bar() { } /* { dg-warning "attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-error "will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-5.c
new file mode 100644
index 000000000..c03fc3b51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-5.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-Waddress -Wattributes -Werror" } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+
+/* Make sure -Werror turns warnings in to errors. */
+
+void __attribute__((dj)) bar() { } /* { dg-error ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-error ".* will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-6.c
new file mode 100644
index 000000000..a99c13b08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-6.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-Wattributes -Werror=address" } */
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+/* Make sure -Werror=foo emits an error and not a warning */
+
+void __attribute__((dj)) bar() { } /* { dg-warning ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-error ".* will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-7.c
new file mode 100644
index 000000000..bafb5c924
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-7.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-Waddress -Werror -Wno-error=address -Wattributes" } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+
+/* Make sure -Wno-error= overrides -Werror. */
+
+void __attribute__((dj)) bar() { } /* { dg-error ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-warning ".* will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-8.c
new file mode 100644
index 000000000..23079ce9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-8.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Wattributes" } */
+
+/* Make sure #pragma can enable a warning. */
+
+#pragma GCC diagnostic warning "-Waddress"
+
+void __attribute__((dj)) bar() { } /* { dg-warning ".* attribute directive ignored" } */
+
+int i;
+
+void
+foo ()
+{
+ if (&i) /* { dg-warning ".* will always evaluate as 'true'" } */
+ grill ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Werror-implicit-function-declaration.c b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-implicit-function-declaration.c
new file mode 100644
index 000000000..3261fc0d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Werror-implicit-function-declaration.c
@@ -0,0 +1,8 @@
+/* Test the legacy option -Werror-implicit-function-declaration */
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -Werror-implicit-function-declaration" } */
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+void f(void)
+{
+ puts("Hello"); /* { dg-error "implicit declaration of function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wfatal-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wfatal-2.c
new file mode 100644
index 000000000..796fc8be4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wfatal-2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-Woverflow -Wdiv-by-zero -Werror -Wfatal-errors" } */
+#include <limits.h>
+
+int i = INT_MAX + 1; /* { dg-error "integer overflow in expression" } */
+int k = 1 / 0;
+int j = INT_MIN - 1;
+/* { dg-message "being treated as errors" "treated as errors" { target *-*-* } 0 } */
+/* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wfatal.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wfatal.c
new file mode 100644
index 000000000..6438d54e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wfatal.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Woverflow -Werror=div-by-zero -Wfatal-errors" } */
+#include <limits.h>
+
+int i = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+int k = 1 / 0; /* { dg-error "division by zero" } */
+int j = INT_MIN - 1;
+/* { dg-message "some warnings being treated as errors" "treated as errors" {target "*-*-*"} 0 } */
+/* { dg-message "terminated due to -Wfatal-errors" "terminated" { target *-*-* } 0 } */
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wfloat-equal-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wfloat-equal-1.c
new file mode 100644
index 000000000..36b3fa53f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wfloat-equal-1.c
@@ -0,0 +1,10 @@
+/* PR c/19999 */
+/* { dg-do compile } */
+/* { dg-options "-Wfloat-equal" } */
+
+double a, b;
+_Complex double c, d;
+int f(void) { return a == b; } /* { dg-warning "comparing floating point" } */
+int g(void) { return c == d; } /* { dg-warning "comparing floating point" } */
+int h(void) { return a != b; } /* { dg-warning "comparing floating point" } */
+int i(void) { return c != d; } /* { dg-warning "comparing floating point" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wframe-larger-than.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wframe-larger-than.c
new file mode 100644
index 000000000..fab0adf37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wframe-larger-than.c
@@ -0,0 +1,13 @@
+/* Test -Wframe-larger-than for warning
+ when the frame size is bigger than specified.
+ Origin: Seongbae Park <seongbae.park@gmail.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wframe-larger-than=2048" } */
+
+extern void func(char *);
+
+void foo (void) {
+ char array[4096];
+ func(array);
+} /* { dg-warning "the frame size of .* bytes is larger than 2048 bytes" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-default.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-default.c
new file mode 100644
index 000000000..c725ffaca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-default.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89" } */
+
+void f(void)
+{
+ puts("Hello"); /* { dg-bogus "warning: implicit declaration of function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-pedantic.c
new file mode 100644
index 000000000..5491aea79
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-pedantic.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -pedantic-errors -Wimplicit-function-declaration" } */
+
+void f(void)
+{
+ puts("Hello"); /* { dg-warning "implicit declaration of function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89.c
new file mode 100644
index 000000000..441899edb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -Wimplicit-function-declaration" } */
+
+void f(void)
+{
+ puts("Hello"); /* { dg-warning "implicit declaration of function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99-pedantic.c
new file mode 100644
index 000000000..05cca9a2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99-pedantic.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors -Wall" } */
+
+void f(void)
+{
+ puts("Hello"); /* { dg-error "implicit declaration of function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99.c
new file mode 100644
index 000000000..254f7e70e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+void f(void)
+{
+ puts("Hello"); /* { dg-warning "implicit declaration of function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wjump-misses-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wjump-misses-init-1.c
new file mode 100644
index 000000000..86117f1f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wjump-misses-init-1.c
@@ -0,0 +1,156 @@
+/* { dg-do compile } */
+/* { dg-options "-Wjump-misses-init" } */
+int
+f1 (int a)
+{
+ if (a > 0)
+ {
+ int i = 7; /* { dg-message "here" } */
+ lab: /* { dg-message "here" } */
+ return a;
+ }
+ else
+ {
+ if (a < 0)
+ goto lab; /* { dg-warning "jump" } */
+ return 1;
+ }
+}
+
+int
+f2 (int a)
+{
+ if (a > 0)
+ {
+ if (a < 0)
+ goto lab; /* { dg-warning "jump" } */
+ return 1;
+ }
+ else
+ {
+ int i = 7; /* { dg-message "here" } */
+ lab: /* { dg-message "here" } */
+ return a;
+ }
+}
+
+int
+f3 (int a)
+{
+ if (a > 0)
+ {
+ static int i = 7;
+ lab:
+ return a;
+ }
+ else
+ {
+ if (a < 0)
+ goto lab;
+ return 1;
+ }
+}
+
+int
+f4 (int a)
+{
+ if (a > 0)
+ {
+ if (a < 0)
+ goto lab;
+ return 1;
+ }
+ else
+ {
+ static int i = 7;
+ lab:
+ return a;
+ }
+}
+
+int
+f5 (int a)
+{
+ if (a > 0)
+ {
+ int b = 1;
+ if (a < 0)
+ goto lab;
+ }
+ lab:
+ return a;
+}
+
+int
+f6 (int a)
+{
+ if (a > 0)
+ {
+ lab:
+ return a;
+ }
+ else
+ {
+ int b = 1;
+ goto lab;
+ }
+}
+
+int
+f7 (int a)
+{
+ switch (a) /* { dg-message "switch" } */
+ {
+ int b = 1; /* { dg-message "here" } */
+
+ case 1: /* { dg-warning "jump" } */
+ return a;
+ }
+}
+
+int
+f8 (int a)
+{
+ switch (a) /* { dg-message "switch" } */
+ {
+ int b = 1; /* { dg-message "here" } */
+
+ case 1: /* { dg-warning "jump" } */
+ goto lab;
+ }
+ lab:
+ return a;
+}
+
+int
+f9 (int a)
+{
+ switch (a)
+ {
+ case 0:
+ {
+ int b = 1;
+ return b;
+ }
+ case 1:
+ return a;
+ }
+}
+
+int
+f10 (int a)
+{
+ switch (a)
+ {
+ case 0:
+ {
+ int b = 1;
+ goto lab;
+ }
+
+ case 1:
+ goto lab;
+ }
+ lab:
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wjump-misses-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wjump-misses-init-2.c
new file mode 100644
index 000000000..042c02aa7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wjump-misses-init-2.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-Wjump-misses-init -std=c99" } */
+extern void f1 ();
+int
+f2 (int a)
+{
+ switch (a) /* { dg-message "switch" } */
+ {
+ case 1:
+ f1 ();
+ int v2 = 3; /* { dg-message "here" } */
+ case 2: /* { dg-warning "jump" } */
+ if (v2 == 7)
+ f1 ();
+ }
+ return 0;
+}
+
+int
+f3 (int i)
+{
+ if (i)
+ goto bad; /* { dg-warning "jump" } */
+ int a = f2 (i); /* { dg-message "here" } */
+ bad: /* { dg-message "here" } */
+ return a;
+}
+
+int
+f4 (int a)
+{
+ switch (a)
+ {
+ case 1:
+ f1 ();
+ static int v2 = 3;
+ case 2:
+ if (v2 == 7)
+ f1 ();
+ }
+ return 0;
+}
+
+int
+f5 (int i)
+{
+ if (i)
+ goto bad;
+ static int a = 6;
+ bad:
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wlarger-than.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wlarger-than.c
new file mode 100644
index 000000000..609a7ae4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wlarger-than.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wlarger-than-32768" } */
+
+/* -Wlarger-than with functions returning void used to segfault.
+ Source: PR 602, testsuite-ized by Neil Booth 21 Jan 2000. */
+
+static void foo (void) {}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wlarger-than2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wlarger-than2.c
new file mode 100644
index 000000000..eac67f48b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wlarger-than2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-Wlarger-than=8" } */
+static void foo (void)
+{
+ char buf[9]; /* { dg-warning "size of.*9 bytes" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wlogical-op-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wlogical-op-1.c
new file mode 100644
index 000000000..462b90bea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wlogical-op-1.c
@@ -0,0 +1,77 @@
+/*
+ { dg-do compile }
+ { dg-options "-Wlogical-op" }
+*/
+
+enum { a, ba, b };
+
+enum testenum { t1, t2};
+
+extern int c;
+extern char bool_a, bool_b;
+
+extern int testa();
+
+void foo()
+{
+ if ( testa() && b ) /* { dg-warning "logical" } */
+ (void)testa();
+
+ if ( c && b ) /* { dg-warning "logical" } */
+ (void)testa();
+
+ if ( c && 0x42 ) /* { dg-warning "logical" } */
+ (void)testa();
+
+ if ( c && 0x80 >>6) /* { dg-warning "logical" } */
+ (void)testa();
+
+
+ if ( b && c == a ) /* { dg-bogus "logical" } */
+ (void)testa();
+
+ if ( 1 && c ) /* { dg-bogus "logical" } */
+ (void)testa();
+
+ if ( t2 && b ) /* { dg-bogus "logical" } */
+ (void)testa();
+
+ if ( 0 && c == a ) /* { dg-bogus "logical" } */
+ (void)testa();
+
+ if ( b && 1 ) /* { dg-bogus "logical" } */
+ (void)testa();
+}
+
+
+void bar()
+{
+ if ( testa() || b ) /* { dg-warning "logical" } */
+ (void)testa();
+
+ if ( c || b ) /* { dg-warning "logical" } */
+ (void)testa();
+
+ if ( c || 0x42 ) /* { dg-warning "logical" } */
+ (void) testa();
+
+ if ( c || 0x80 >>6) /* { dg-warning "logical" } */
+ (void)testa();
+
+
+ if ( b || c == a ) /* { dg-bogus "logical" } */
+ (void)testa();
+
+ if ( 1 || c ) /* { dg-bogus "logical" } */
+ (void)testa();
+
+ if ( t2 || b ) /* { dg-bogus "logical" } */
+ (void)testa();
+
+ if ( 0 || c == a ) /* { dg-bogus "logical" } */
+ (void)testa();
+
+ if ( b || 1 ) /* { dg-bogus "logical" } */
+ (void)testa();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c
new file mode 100644
index 000000000..37e1a571b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c
@@ -0,0 +1,7 @@
+/* Test -Wmissing-parameter-type is enabled by -Wextra */
+/* { dg-do compile } */
+/* { dg-options "-Wextra" } */
+
+int foo(bar) { return bar;} /* { dg-warning "type of 'bar' defaults to 'int'" } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type-no.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type-no.c
new file mode 100644
index 000000000..1031e57a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type-no.c
@@ -0,0 +1,7 @@
+/* Test that we can disable -Wmissing-parameter-type */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -Wno-missing-parameter-type" } */
+
+int foo(bar) { return bar;} /* { dg-bogus "type of 'bar' defaults to 'int'" } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c
new file mode 100644
index 000000000..8ec94e2ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-parameter-type" } */
+
+int foo(bar) { return bar; } /* { dg-warning "type of 'bar' defaults to 'int'" } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wnested-externs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wnested-externs-1.c
new file mode 100644
index 000000000..5c4b5ddd8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wnested-externs-1.c
@@ -0,0 +1,22 @@
+/* Test -Wnested-externs. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wnested-externs" } */
+
+int a;
+static int b;
+extern int c;
+void f0(void);
+static void f1(void);
+
+void
+g(void)
+{
+ extern int a; /* { dg-warning "nested extern declaration of 'a'" } */
+ extern int b; /* { dg-warning "nested extern declaration of 'b'" } */
+ extern int c; /* { dg-warning "nested extern declaration of 'c'" } */
+ extern int d; /* { dg-warning "nested extern declaration of 'd'" } */
+ extern void f0(void); /* { dg-warning "nested extern declaration of 'f0'" } */
+ extern void f1(void); /* { dg-warning "nested extern declaration of 'f1'" } */
+ extern void f2(void); /* { dg-warning "nested extern declaration of 'f2'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wno-all.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wno-all.c
new file mode 100644
index 000000000..de55bbcda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wno-all.c
@@ -0,0 +1,10 @@
+/* PR 30437: Test negative of -Wall
+ Don't change this without changing Wall.c as well. */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wno-all" } */
+
+void foo(int a)
+{
+ 5 * (a == 1) | (a == 2); /* { dg-bogus "no effect" "no effect" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wno-c++-compat.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wno-c++-compat.c
new file mode 100644
index 000000000..1fda016e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wno-c++-compat.c
@@ -0,0 +1,9 @@
+/* Copyright (C) 2005 Free Software Foundation.
+
+ by Gabriel Dos Reis <gdr@integrable-solutions.net> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wno-c++-compat" } */
+
+extern const int foo = 42; /* { dg-warning "initialized and declared" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wno-pointer-sign.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wno-pointer-sign.c
new file mode 100644
index 000000000..780c9d4e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wno-pointer-sign.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-pointer-sign" } */
+
+void f1(long *);
+void f2(unsigned long *);
+
+int main()
+{
+ long *lp;
+ unsigned long *ulp;
+ char *cp;
+ unsigned char *ucp;
+ signed char *scp;
+
+ ulp = lp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ lp = ulp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ f1(ulp); /* { dg-bogus " differ in signedness" } */
+ f2(lp); /* { dg-bogus " differ in signedness" } */
+
+ cp = ucp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ cp = scp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ ucp = scp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ ucp = cp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ scp = ucp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+ scp = cp; /* { dg-bogus " pointer targets in assignment differ in signedness" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wobjsize-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wobjsize-1.c
new file mode 100644
index 000000000..291cfb9be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wobjsize-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+#include "Wobjsize-1.h"
+
+char buf[6];
+int main(int argc, char **argv)
+{
+ strcpy (buf,"hello ");
+ return 0;
+}
+
+/* { dg-warning "will always overflow destination buffer" "" { target *-*-* } 6 } */
+/* { dg-message "file included" "included" { target *-*-* } 0 } */
+/* { dg-message "inlined from" "inlined" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wobjsize-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/Wobjsize-1.h
new file mode 100644
index 000000000..a879f6db9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wobjsize-1.h
@@ -0,0 +1,8 @@
+#pragma GCC system_header
+
+extern __inline __attribute__ ((__always_inline__,__artificial__,__gnu_inline__)) char *
+__attribute__ ((__nothrow__)) strcpy (char *__restrict __dest, __const char *__restrict __src)
+{
+ return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wold-style-definition-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wold-style-definition-1.c
new file mode 100644
index 000000000..aa016338b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wold-style-definition-1.c
@@ -0,0 +1,24 @@
+/* Test for warning about old-style function definition. */
+
+/* Origin: Andreas Jaeger <aj@suse.de> */
+/* { dg-do compile } */
+/* { dg-options "-Wold-style-definition" } */
+
+void
+bar (a) int a; { } /* { dg-warning "old-style function definition" } */
+
+void bar1 () {} /* { dg-warning "old-style function definition" } */
+
+extern void bar2 (void);
+
+void bar2 () {} /* { dg-warning "old-style function definition" } */
+
+extern void bar3 (int);
+
+void bar3 (a) {} /* { dg-warning "old-style function definition" } */
+
+void bar4 (a) {} /* { dg-warning "old-style function definition" } */
+
+void bar5 (int a) {}
+
+void bar6 (void) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wold-style-definition-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wold-style-definition-2.c
new file mode 100644
index 000000000..a69aae6fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wold-style-definition-2.c
@@ -0,0 +1,10 @@
+/* PR c/12466
+ Test for not warning about ellipsises with -Wold-style-definition. */
+
+/* Origin: Kelley Cook <kcook@gcc.gnu.org> */
+/* { dg-do compile } */
+/* { dg-options "-Wold-style-definition" } */
+
+void bar1 ( ... ) {} /* { dg-error "ISO C requires a named argument" } */
+
+void bar2 (int a, ... ) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-1.c
new file mode 100644
index 000000000..064af4561
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include <limits.h>
+
+int foo = INT_MAX + 1; /* { dg-warning "integer overflow" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-2.c
new file mode 100644
index 000000000..44368b66f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Woverflow" } */
+
+#include <limits.h>
+
+int foo = INT_MAX + 1; /* { dg-warning "integer overflow" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-3.c
new file mode 100644
index 000000000..73a021b59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverflow-3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-overflow" } */
+
+#include <limits.h>
+
+int foo = INT_MAX + 1;
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c
new file mode 100644
index 000000000..45373bc1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c
@@ -0,0 +1,47 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c89 -pedantic" } */
+
+#define TEN " "
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+__asm__ (HUN HUN HUN HUN HUN TEN);
+
+/* C99's minimum-maximum is 4095. */
+__asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456");
+
+void
+f (void)
+{
+ /* C89's minimum-maximum is 509. */
+ __asm__ (HUN HUN HUN HUN HUN TEN);
+ __asm__ (HUN HUN HUN HUN HUN TEN : : );
+ __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label);
+
+ /* C99's minimum-maximum is 4095. */
+ __asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456");
+ __asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456" : : );
+ __asm__ goto (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456" : : : : label);
+
+ label: ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c
new file mode 100644
index 000000000..09b8079d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c89 -pedantic" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = __extension__ HUN HUN HUN HUN HUN TEN;
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] = __extension__
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-no.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-no.c
new file mode 100644
index 000000000..a2ccbddf2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-no.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c89 -pedantic -Wno-overlength-strings" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = HUN HUN HUN HUN HUN TEN;
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] =
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89.c
new file mode 100644
index 000000000..9370acf84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c89 -pedantic" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = HUN HUN HUN HUN HUN TEN; /* { dg-warning "greater than" } */
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] =
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456"; /* { dg-warning "greater than" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c
new file mode 100644
index 000000000..b5523bc89
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c
@@ -0,0 +1,48 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c90 -pedantic" } */
+
+#define TEN " "
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+__asm__ (HUN HUN HUN HUN HUN TEN);
+
+/* C99's minimum-maximum is 4095. */
+__asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456");
+
+void
+f (void)
+{
+ /* C89's minimum-maximum is 509. */
+ __asm__ (HUN HUN HUN HUN HUN TEN);
+ __asm__ (HUN HUN HUN HUN HUN TEN : :);
+ __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label);
+
+ /* C99's minimum-maximum is 4095. */
+ __asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456");
+ __asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456" : :);
+ __asm__ goto (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456" : : : : label);
+
+ label: ;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c
new file mode 100644
index 000000000..6fbaebef3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c90 -pedantic" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = __extension__ HUN HUN HUN HUN HUN TEN;
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] = __extension__
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90.c
new file mode 100644
index 000000000..94264f3b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c90 -pedantic" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = HUN HUN HUN HUN HUN TEN; /* { dg-warning "greater than" } */
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] =
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456"; /* { dg-warning "greater than" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c
new file mode 100644
index 000000000..8840e38bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c
@@ -0,0 +1,48 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c99 -pedantic" } */
+
+#define TEN " "
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+__asm__ (HUN HUN HUN HUN HUN TEN);
+
+/* C99's minimum-maximum is 4095. */
+__asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456");
+
+void
+f (void)
+{
+ /* C89's minimum-maximum is 509. */
+ __asm__ (HUN HUN HUN HUN HUN TEN);
+ __asm__ (HUN HUN HUN HUN HUN TEN : :);
+ __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label);
+
+ /* C99's minimum-maximum is 4095. */
+ __asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456");
+ __asm__ (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456" : :);
+ __asm__ goto (
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456" : : : : label);
+
+ label: ;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c
new file mode 100644
index 000000000..93d5e4600
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c99 -pedantic" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = HUN HUN HUN HUN HUN TEN;
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] = __extension__
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-no.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-no.c
new file mode 100644
index 000000000..a44a21409
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-no.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c99 -pedantic -Wno-overlength-strings" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = HUN HUN HUN HUN HUN TEN;
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] =
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99.c
new file mode 100644
index 000000000..e7f512192
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "-std=c99 -pedantic" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = HUN HUN HUN HUN HUN TEN;
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] =
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456"; /* { dg-warning "greater than" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings.c
new file mode 100644
index 000000000..d02e18ea2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverlength-strings.c
@@ -0,0 +1,19 @@
+/* -Woverlength-strings complains about string constants which are too long
+ for the C standard's "minimum maximum" limits. It is off by default,
+ but implied by -pedantic. */
+
+/* { dg-options "" } */
+
+#define TEN "xxxxxxxxxx"
+#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
+#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN
+
+/* C89's minimum-maximum is 509. */
+const char x510[] = HUN HUN HUN HUN HUN TEN;
+
+/* C99's minimum-maximum is 4095. */
+const char x4096[] =
+ THO THO THO THO /* 4000 */
+ TEN TEN TEN TEN TEN /* 4050 */
+ TEN TEN TEN TEN /* 4090 */
+ "123456";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-1.c
new file mode 100644
index 000000000..29eca3095
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-1.c
@@ -0,0 +1,28 @@
+/* Test for warnings for overriding designated initializers:
+ -Woverride-init. Bug 24010. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Woverride-init" } */
+
+struct s { int a; int b; int c; };
+union u { char a; long long b; };
+
+struct s s0 = {
+ .a = 1,
+ .b = 2,
+ .a = 3, /* { dg-warning "initialized field overwritten|near init" } */
+ 4, /* { dg-warning "initialized field overwritten|near init" } */
+ 5
+};
+
+union u u0 = {
+ .a = 1,
+ .b = 2, /* { dg-warning "initialized field overwritten|near init" } */
+ .a = 3 }; /* { dg-warning "initialized field overwritten|near init" } */
+
+int a[5] = {
+ [0] = 1,
+ [1] = 2,
+ [0] = 3, /* { dg-warning "initialized field overwritten|near init" } */
+ [2] = 4
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-2.c
new file mode 100644
index 000000000..c5490b5ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-2.c
@@ -0,0 +1,28 @@
+/* Test for warnings for overriding designated initializers:
+ -Wextra. Bug 24010. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wextra" } */
+
+struct s { int a; int b; int c; };
+union u { char a; long long b; };
+
+struct s s0 = {
+ .a = 1,
+ .b = 2,
+ .a = 3, /* { dg-warning "initialized field overwritten|near init" } */
+ 4, /* { dg-warning "initialized field overwritten|near init" } */
+ 5
+};
+
+union u u0 = {
+ .a = 1,
+ .b = 2, /* { dg-warning "initialized field overwritten|near init" } */
+ .a = 3 }; /* { dg-warning "initialized field overwritten|near init" } */
+
+int a[5] = {
+ [0] = 1,
+ [1] = 2,
+ [0] = 3, /* { dg-warning "initialized field overwritten|near init" } */
+ [2] = 4
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-3.c
new file mode 100644
index 000000000..3fec7385d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Woverride-init-3.c
@@ -0,0 +1,29 @@
+/* Test for warnings for overriding designated initializers: not
+ warned for with -Wextra -Wno-override-init. Bug 24010. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wextra -Wno-override-init" } */
+
+struct s { int a; int b; int c; };
+union u { char a; long long b; };
+
+struct s s0 = {
+ .a = 1,
+ .b = 2,
+ .a = 3,
+ 4,
+ 5
+};
+
+union u u0 = {
+ .a = 1,
+ .b = 2,
+ .a = 3
+};
+
+int a[5] = {
+ [0] = 1,
+ [1] = 2,
+ [0] = 3,
+ [2] = 4
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c
new file mode 100644
index 000000000..70fcd79a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpadded.c
@@ -0,0 +1,14 @@
+/* Source: EMC. */
+
+/* { dg-do compile } */
+/* -fpack-struct is necessary because the warning expected requires the initial
+ packing to be larger than 1, which cannot be guaranteed for all targets.
+ We won't get a warning anyway if the target has "packed" structure
+ layout. */
+/* { dg-options "-Wpadded -fpack-struct=8" } */
+/* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */
+
+struct foo {
+ char bar;
+ long baz; /* { dg-warning "padding struct to align" "" { target { ! default_packed } } } */
+} futz;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-1.c
new file mode 100644
index 000000000..d6e86eb48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-1.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options -Wparentheses } */
+
+/* Source: Neil Booth, 1 Nov 2001. PR 3170, 3422 - bogus warnings
+ about suggesting parentheses. */
+
+int foo (int a, int b)
+{
+ int c = (a && b) || 0; /* { dg-bogus "suggest parentheses" } */
+ c = a && b || 0; /* { dg-warning "suggest parentheses" } */
+
+ return (a && b && 1) || 0; /* { dg-bogus "suggest parentheses" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-10.c
new file mode 100644
index 000000000..aafcae2ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-10.c
@@ -0,0 +1,42 @@
+/* Test operation of -Wparentheses. Warnings for assignments used as
+ truth-values shouldn't apply other than for plain assignment. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses -std=gnu99" } */
+
+int foo (int);
+
+int a, b, c;
+_Bool d;
+
+void
+bar (void)
+{
+ if (a += b)
+ foo (0);
+ if (a -= a)
+ foo (1);
+ if (b *= c)
+ foo (2);
+ else
+ foo (3);
+ if (b /= b)
+ foo (4);
+ else
+ foo (5);
+ while (c %= b)
+ foo (6);
+ while (c <<= c)
+ foo (7);
+ do foo (8); while (a >>= b);
+ do foo (9); while (a &= a);
+ for (;c ^= b;)
+ foo (10);
+ for (;c |= c;)
+ foo (11);
+ d = a += b;
+ foo (12);
+ d = a -= a;
+ foo (13);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-11.c
new file mode 100644
index 000000000..8858a7fb3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-11.c
@@ -0,0 +1,258 @@
+/* PR 7543. Test operation of -Wparentheses. Precedence warnings.
+ !a | b and !a & b. */
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+int foo (int);
+
+int
+bar (int a, int b, int c)
+{
+ foo (!a & b); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (b < c));
+ foo (!a & (b > c));
+ foo (!a & (b == c));
+ foo (!a & (b != c));
+ foo (!a & (b <= c));
+ foo (!a & (b >= c));
+ foo (!a & (b && c));
+ foo (!a & (b || c));
+ foo (!a & !b);
+ foo (!(a & b));
+ foo ((!a) & b);
+ foo (!a & 2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (2 < c));
+ foo (!a & (2 > c));
+ foo (!a & (2 == c));
+ foo (!a & (2 != c));
+ foo (!a & (2 <= c));
+ foo (!a & (2 >= c));
+ foo (!a & (2 && c));
+ foo (!a & (2 || c));
+ foo (!a & !2);
+ foo (!(a & 2));
+ foo ((!a) & 2);
+ foo (!1 & 2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & (2 < c));
+ foo (!1 & (2 > c));
+ foo (!1 & (2 == c));
+ foo (!1 & (2 != c));
+ foo (!1 & (2 <= c));
+ foo (!1 & (2 >= c));
+ foo (!1 & (2 && c));
+ foo (!1 & (2 || c));
+ foo (!1 & !2);
+ foo (!(1 & 2));
+
+ foo (!a | b); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (b < c));
+ foo (!a | (b > c));
+ foo (!a | (b == c));
+ foo (!a | (b != c));
+ foo (!a | (b <= c));
+ foo (!a | (b >= c));
+ foo (!a | (b && c));
+ foo (!a | (b || c));
+ foo (!a | !b);
+ foo (!(a | b));
+ foo ((!a) | b);
+ foo (!a | 2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (2 < c));
+ foo (!a | (2 > c));
+ foo (!a | (2 == c));
+ foo (!a | (2 != c));
+ foo (!a | (2 <= c));
+ foo (!a | (2 >= c));
+ foo (!a | (2 && c));
+ foo (!a | (2 || c));
+ foo (!a | !2);
+ foo (!(a | 2));
+ foo ((!a) | 2);
+ foo (!1 | 2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | (2 < c));
+ foo (!1 | (2 > c));
+ foo (!1 | (2 == c));
+ foo (!1 | (2 != c));
+ foo (!1 | (2 <= c));
+ foo (!1 | (2 >= c));
+ foo (!1 | (2 && c));
+ foo (!1 | (2 || c));
+ foo (!1 | !2);
+ foo (!(1 | 2));
+ foo ((!1) | 2);
+
+ foo (b & !a); /* { dg-bogus "parentheses" "bogus warning" } */
+ foo ((b < c) & !a);
+ foo ((b > c) & !a);
+ foo ((b == c) & !a);
+ foo ((b != c) & !a);
+ foo ((b <= c) & !a);
+ foo ((b >= c) & !a);
+ foo ((b && c) & !a);
+ foo ((b || c) & !a);
+ foo (!b & !a);
+ foo (!(b & a));
+ foo (b & (!a));
+ foo (2 & !a); /* { dg-bogus "parentheses" "correct warning" } */
+ foo ((2 < c) & !a);
+ foo ((2 > c) & !a);
+ foo ((2 == c) & !a);
+ foo ((2 != c) & !a);
+ foo ((2 <= c) & !a);
+ foo ((2 >= c) & !a);
+ foo ((2 && c) & !a);
+ foo ((2 || c) & !a);
+ foo (!2 & !a);
+ foo (!(2 & a));
+ foo (2 & (!a));
+ foo (2 & !1); /* { dg-bogus "parentheses" "correct warning" } */
+ foo ((2 < c) & !1);
+ foo ((2 > c) & !1);
+ foo ((2 == c) & !1);
+ foo ((2 != c) & !1);
+ foo ((2 <= c) & !1);
+ foo ((2 >= c) & !1);
+ foo ((2 && c) & !1);
+ foo ((2 || c) & !1);
+ foo (!2 & !1);
+ foo (!(2 & 1));
+
+ foo (b | !a); /* { dg-bogus "parentheses" "correct warning" } */
+ foo ((b < c) | !a);
+ foo ((b > c) | !a);
+ foo ((b == c) | !a);
+ foo ((b != c) | !a);
+ foo ((b <= c) | !a);
+ foo ((b >= c) | !a);
+ foo ((b && c) | !a);
+ foo ((b || c) | !a);
+ foo (!b | !a);
+ foo (!(b | a));
+ foo (b | (!a));
+ foo (2 | !a); /* { dg-bogus "parentheses" "correct warning" } */
+ foo ((2 < c) | !a);
+ foo ((2 > c) | !a);
+ foo ((2 == c) | !a);
+ foo ((2 != c) | !a);
+ foo ((2 <= c) | !a);
+ foo ((2 >= c) | !a);
+ foo ((2 && c) | !a);
+ foo ((2 || c) | !a);
+ foo (!2 | !a);
+ foo (!(2 | a));
+ foo (2 | (!a));
+ foo (2 | !1); /* { dg-bogus "parentheses" "correct warning" } */
+ foo ((2 < c) | !1);
+ foo ((2 > c) | !1);
+ foo ((2 == c) | !1);
+ foo ((2 != c) | !1);
+ foo ((2 <= c) | !1);
+ foo ((2 >= c) | !1);
+ foo ((2 && c) | !1);
+ foo ((2 || c) | !1);
+ foo (!2 | !1);
+ foo (!(2 | 1));
+ foo (2 | (!1));
+}
+
+int
+baz (int a, int b, int c)
+{
+ foo (!a & (b << c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (b >> c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (b + c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (b - c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (b = c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & ~b); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (b & c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (b | c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & 2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (2 << c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (2 >> c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (2 + c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (2 - c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (c = 2)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & ~2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (2 & c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a & (2 | c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & (2 << c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & (2 >> c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & (2 + c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & (2 - c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & (c = 2)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & ~2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & (2 & c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 & (2 | c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (b << c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (b >> c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (b + c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (b - c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (b = c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | ~b); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (b & c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (b | c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (2 << c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (2 >> c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (2 + c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (2 - c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (c = 2)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | ~2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (2 & c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!a | (2 | c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | (2 << c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | (2 >> c));/* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | (2 + c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | (2 - c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | (c = 2)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | ~2); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | (2 & c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo (!1 | (2 | c)); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((b << c) & !a);
+ foo ((b >> c) & !a);
+ foo ((b + c) & !a);
+ foo ((b - c) & !a);
+ foo ((b = c) & !a);
+ foo (~b & !a);
+ foo ((b & c) & !a);
+ foo ((b | c) & !a);
+ foo ((2 << c) & !a);
+ foo ((2 >> c) & !a);
+ foo ((2 + c) & !a);
+ foo ((2 - c) & !a);
+ foo ((c = 2) & !a);
+ foo (~2 & !a);
+ foo ((2 & c) & !a);
+ foo ((2 | c) & !a);
+ foo ((2 << c) & !1);
+ foo ((2 >> c) & !1);
+ foo ((2 + c) & !1);
+ foo ((2 - c) & !1);
+ foo ((c = 2) & !1);
+ foo (~2 & !1);
+ foo ((2 & c) & !1);
+ foo ((2 | c) & !1);
+ foo ((b << c) | !a);
+ foo ((b >> c) | !a);
+ foo ((b + c) | !a);
+ foo ((b - c) | !a);
+ foo ((b = c) | !a);
+ foo (~b | !a);
+ foo ((b & c) | !a);
+ foo ((b | c) | !a);
+ foo ((2 << c) | !a);
+ foo ((2 >> c) | !a);
+ foo ((2 + c) | !a);
+ foo ((2 - c) | !a);
+ foo ((c = 2) | !a);
+ foo (~2 | !a);
+ foo ((2 & c) | !a);
+ foo ((2 | c) | !a);
+ foo ((2 << c) | !1);
+ foo ((2 >> c) | !1);
+ foo ((2 + c) | !1);
+ foo ((2 - c) | !1);
+ foo ((c = 2) | !1);
+ foo (~2 | !1);
+ foo ((2 & c) | !1);
+ foo ((2 | c) | !1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-2.c
new file mode 100644
index 000000000..51038c2d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-2.c
@@ -0,0 +1,121 @@
+/* Test operation of -Wparentheses. Warnings for X<=Y<=Z should be
+ there rather than hidden in -Wextra. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+int foo (int);
+
+int
+bar (int a, int b, int c)
+{
+ foo (a <= b <= c); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((a <= b) <= c);
+ foo (a <= (b <= c));
+ foo (1 <= 2 <= c); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((1 <= 2) <= c);
+ foo (1 <= (2 <= c));
+ foo (1 <= 2 <= 3); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((1 <= 2) <= 3);
+ foo (1 <= (2 <= 3));
+ foo (a > b > c); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((a > b) > c);
+ foo (a > (b > c));
+ foo (1 > 2 > c); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((1 > 2) > c);
+ foo (1 > (2 > c));
+ foo (1 > 2 > 3); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((1 > 2) > 3);
+ foo (1 > (2 > 3));
+ foo (a < b <= c); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((a < b) <= c);
+ foo (a < (b <= c));
+ foo (1 < 2 <= c); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((1 < 2) <= c);
+ foo (1 < (2 <= c));
+ foo (1 < 2 <= 3); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((1 < 2) <= 3);
+ foo (1 < (2 <= 3));
+ foo (a <= b > c); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((a <= b) > c);
+ foo (a <= (b > c));
+ foo (1 <= 2 > c); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((1 <= 2) > c);
+ foo (1 <= (2 > c));
+ foo (1 <= 2 > 3); /* { dg-warning "mathematical meaning" "correct warning" } */
+ foo ((1 <= 2) > 3);
+ foo (1 <= (2 > 3));
+ foo (a <= b == c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a <= b) == c);
+ foo (a <= (b == c));
+ foo (1 <= 2 == c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 <= 2) == c);
+ foo (1 <= (2 == c));
+ foo (1 <= 2 == 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 <= 2) == 3);
+ foo (1 <= (2 == 3));
+ foo (a != b != c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a != b) != c);
+ foo (a != (b != c));
+ foo (1 != 2 != c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 != 2) != c);
+ foo (1 != (2 != c));
+ foo (1 != 2 != 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 != 2) != 3);
+ foo (1 != (2 != 3));
+ foo (a < b == c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a < b) == c);
+ foo (a < (b == c));
+ foo (a > b == c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a > b) == c);
+ foo (a > (b == c));
+ foo (a == b < c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a == b) < c);
+ foo (a == (b < c));
+ foo (a == b > c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a == b) > c);
+ foo (a == (b > c));
+ foo (a == b == c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a == b) == c);
+ foo (a == (b == c));
+ foo (1 == 2 == 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 == 2) == 3);
+ foo (1 == (2 == 3));
+ foo (1 < 2 == 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 < 2) == 3);
+ foo (1 < (2 == 3));
+ foo (1 > 2 == 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 > 2) == 3);
+ foo (1 > (2 == 3));
+ foo (1 == 2 < 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 == 2) < 3);
+ foo (1 == (2 < 3));
+ foo (1 == 2 > 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 == 2) > 3);
+ foo (1 == (2 > 3));
+ foo (a < b != c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a < b) != c);
+ foo (a < (b != c));
+ foo (a > b != c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a > b) != c);
+ foo (a > (b != c));
+ foo (a != b < c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a != b) < c);
+ foo (a != (b < c));
+ foo (a != b > c); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((a != b) > c);
+ foo (a != (b > c));
+ foo (1 < 2 != 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 < 2) != 3);
+ foo (1 < (2 != 3));
+ foo (1 > 2 != 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 > 2) != 3);
+ foo (1 > (2 != 3));
+ foo (1 != 2 < 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 != 2) < 3);
+ foo (1 != (2 < 3));
+ foo (1 != 2 > 3); /* { dg-warning "suggest parentheses around comparison" "correct warning" } */
+ foo ((1 != 2) > 3);
+ foo (1 != (2 > 3));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-3.c
new file mode 100644
index 000000000..64899887c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-3.c
@@ -0,0 +1,68 @@
+/* Test operation of -Wparentheses. Warnings for assignments used as
+ truth-values. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses -std=gnu99" } */
+
+int foo (int);
+
+int a, b, c;
+_Bool d;
+
+int
+bar (void)
+{
+ if (a = b) /* { dg-warning "assignment" "correct warning" } */
+ foo (0);
+ if ((a = b))
+ foo (1);
+ if (a = a) /* { dg-warning "assignment" "correct warning" } */
+ foo (2);
+ if ((a = a))
+ foo (3);
+ if (b = c) /* { dg-warning "assignment" "correct warning" } */
+ foo (4);
+ else
+ foo (5);
+ if ((b = c))
+ foo (6);
+ else
+ foo (7);
+ if (b = b) /* { dg-warning "assignment" "correct warning" } */
+ foo (8);
+ else
+ foo (9);
+ if ((b = b))
+ foo (10);
+ else
+ foo (11);
+ while (c = b) /* { dg-warning "assignment" "correct warning" } */
+ foo (12);
+ while ((c = b))
+ foo (13);
+ while (c = c) /* { dg-warning "assignment" "correct warning" } */
+ foo (14);
+ while ((c = c))
+ foo (15);
+ do foo (16); while (a = b); /* { dg-warning "assignment" "correct warning" } */
+ do foo (17); while ((a = b));
+ do foo (18); while (a = a); /* { dg-warning "assignment" "correct warning" } */
+ do foo (19); while ((a = a));
+ for (;c = b;) /* { dg-warning "assignment" "correct warning" } */
+ foo (20);
+ for (;(c = b);)
+ foo (21);
+ for (;c = c;) /* { dg-warning "assignment" "correct warning" } */
+ foo (22);
+ for (;(c = c);)
+ foo (23);
+ d = a = b; /* { dg-warning "assignment" "correct warning" } */
+ foo (24);
+ d = (a = b);
+ foo (25);
+ d = a = a; /* { dg-warning "assignment" "correct warning" } */
+ foo (26);
+ d = (a = a);
+ foo (27);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-4.c
new file mode 100644
index 000000000..dfc9d1008
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-4.c
@@ -0,0 +1,85 @@
+/* Test operation of -Wparentheses. Precedence warnings. + or -
+ inside shift. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+int foo (int);
+
+int
+bar (int a, int b, int c)
+{
+ foo (a + b << c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a + b) << c);
+ foo (a + (b << c));
+ foo (1 + 2 << c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) << c);
+ foo (1 + (2 << c));
+ foo (1 + 2 << 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) << 3);
+ foo (1 + (2 << 3));
+ foo (a << b + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a << b) + c);
+ foo (a << (b + c));
+ foo (1 << 2 + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 << 2) + c);
+ foo (1 << (2 + c));
+ foo (1 << 2 + 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 << 2) + 3);
+ foo (1 << (2 + 3));
+ foo (a + b >> c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a + b) >> c);
+ foo (a + (b >> c));
+ foo (1 + 2 >> c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) >> c);
+ foo (1 + (2 >> c));
+ foo (1 + 2 >> 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) >> 3);
+ foo (1 + (2 >> 3));
+ foo (a >> b + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a >> b) + c);
+ foo (a >> (b + c));
+ foo (1 >> 2 + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 >> 2) + c);
+ foo (1 >> (2 + c));
+ foo (1 >> 2 + 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 >> 2) + 3);
+ foo (1 >> (2 + 3));
+ foo (a - b << c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a - b) << c);
+ foo (a - (b << c));
+ foo (6 - 5 << c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((6 - 5) << c);
+ foo (6 - (5 << c));
+ foo (6 - 5 << 4); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((6 - 5) << 4);
+ foo (6 - (5 << 4));
+ foo (a << b - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a << b) - c);
+ foo (a << (b - c));
+ foo (6 << 5 - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((6 << 5) - c);
+ foo (6 << (5 - c));
+ foo (6 << 5 - 4); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((6 << 5) - 4);
+ foo (6 << (5 - 4));
+ foo (a - b >> c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a - b) >> c);
+ foo (a - (b >> c));
+ foo (6 - 5 >> c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((6 - 5) >> c);
+ foo (6 - (5 >> c));
+ foo (6 - 5 >> 4); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((6 - 5) >> 4);
+ foo (6 - (5 >> 4));
+ foo (a >> b - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a >> b) - c);
+ foo (a >> (b - c));
+ foo (6 >> 5 - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((6 >> 5) - c);
+ foo (6 >> (5 - c));
+ foo (6 >> 5 - 4); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((6 >> 5) - 4);
+ foo (6 >> (5 - 4));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-5.c
new file mode 100644
index 000000000..49c65c21a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-5.c
@@ -0,0 +1,31 @@
+/* Test operation of -Wparentheses. Precedence warnings. && inside
+ ||. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+int foo (int);
+
+int
+bar (int a, int b, int c)
+{
+ foo (a && b || c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a && b) || c);
+ foo (a && (b || c));
+ foo (1 && 2 || c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 && 2) || c);
+ foo (1 && (2 || c));
+ foo (1 && 2 || 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 && 2) || 3);
+ foo (1 && (2 || 3));
+ foo (a || b && c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a || b) && c);
+ foo (a || (b && c));
+ foo (1 || 2 && c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 || 2) && c);
+ foo (1 || (2 && c));
+ foo (1 || 2 && 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 || 2) && 3);
+ foo (1 || (2 && 3));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-6.c
new file mode 100644
index 000000000..2d2cc1613
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-6.c
@@ -0,0 +1,121 @@
+/* Test operation of -Wparentheses. Precedence warnings. & or ^ or +
+ or - or comparison inside |. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+int foo (int);
+
+int
+bar (int a, int b, int c)
+{
+ foo (a & b | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a & b) | c);
+ foo (a & (b | c));
+ foo (1 & 2 | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) | c);
+ foo (1 & (2 | c));
+ foo (1 & 2 | 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) | 3);
+ foo (1 & (2 | 3));
+ foo (a | b & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a | b) & c);
+ foo (a | (b & c));
+ foo (1 | 2 & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) & c);
+ foo (1 | (2 & c));
+ foo (1 | 2 & 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) & 3);
+ foo (1 | (2 & 3));
+ foo (a ^ b | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a ^ b) | c);
+ foo (a ^ (b | c));
+ foo (1 ^ 2 | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) | c);
+ foo (1 ^ (2 | c));
+ foo (1 ^ 2 | 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) | 3);
+ foo (1 ^ (2 | 3));
+ foo (a | b ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a | b) ^ c);
+ foo (a | (b ^ c));
+ foo (1 | 2 ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) ^ c);
+ foo (1 | (2 ^ c));
+ foo (1 | 2 ^ 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) ^ 3);
+ foo (1 | (2 ^ 3));
+ foo (a + b | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a + b) | c);
+ foo (a + (b | c));
+ foo (1 + 2 | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) | c);
+ foo (1 + (2 | c));
+ foo (1 + 2 | 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) | 3);
+ foo (1 + (2 | 3));
+ foo (a | b + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a | b) + c);
+ foo (a | (b + c));
+ foo (1 | 2 + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) + c);
+ foo (1 | (2 + c));
+ foo (1 | 2 + 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) + 3);
+ foo (1 | (2 + 3));
+ foo (a - b | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a - b) | c);
+ foo (a - (b | c));
+ foo (1 - 2 | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 - 2) | c);
+ foo (1 - (2 | c));
+ foo (1 - 2 | 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 - 2) | 3);
+ foo (1 - (2 | 3));
+ foo (a | b - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a | b) - c);
+ foo (a | (b - c));
+ foo (1 | 2 - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) - c);
+ foo (1 | (2 - c));
+ foo (1 | 2 - 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) - 3);
+ foo (1 | (2 - 3));
+ foo (a > b | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a > b) | c);
+ foo (a > (b | c));
+ foo (1 > 2 | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 > 2) | c);
+ foo (1 > (2 | c));
+ foo (1 > 2 | 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 > 2) | 3);
+ foo (1 > (2 | 3));
+ foo (a | b > c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a | b) > c);
+ foo (a | (b > c));
+ foo (1 | 2 > c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) > c);
+ foo (1 | (2 > c));
+ foo (1 | 2 > 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) > 3);
+ foo (1 | (2 > 3));
+ foo (a <= b | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a <= b) | c);
+ foo (a <= (b | c));
+ foo (1 <= 2 | c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 <= 2) | c);
+ foo (1 <= (2 | c));
+ foo (1 <= 2 | 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 <= 2) | 3);
+ foo (1 <= (2 | 3));
+ foo (a | b <= c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a | b) <= c);
+ foo (a | (b <= c));
+ foo (1 | 2 <= c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) <= c);
+ foo (1 | (2 <= c));
+ foo (1 | 2 <= 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 | 2) <= 3);
+ foo (1 | (2 <= 3));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-7.c
new file mode 100644
index 000000000..f3516969d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-7.c
@@ -0,0 +1,121 @@
+/* Test operation of -Wparentheses. Precedence warnings. & or + or -
+ or comparison inside ^. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+int foo (int);
+
+int
+bar (int a, int b, int c)
+{
+ foo (a & b ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a & b) ^ c);
+ foo (a & (b ^ c));
+ foo (1 & 2 ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) ^ c);
+ foo (1 & (2 ^ c));
+ foo (1 & 2 ^ 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) ^ 3);
+ foo (1 & (2 ^ 3));
+ foo (a ^ b & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a ^ b) & c);
+ foo (a ^ (b & c));
+ foo (1 ^ 2 & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) & c);
+ foo (1 ^ (2 & c));
+ foo (1 ^ 2 & 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) & 3);
+ foo (1 ^ (2 & 3));
+ foo (a + b ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a + b) ^ c);
+ foo (a + (b ^ c));
+ foo (1 + 2 ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) ^ c);
+ foo (1 + (2 ^ c));
+ foo (1 + 2 ^ 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) ^ 3);
+ foo (1 + (2 ^ 3));
+ foo (a ^ b + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a ^ b) + c);
+ foo (a ^ (b + c));
+ foo (1 ^ 2 + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) + c);
+ foo (1 ^ (2 + c));
+ foo (1 ^ 2 + 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) + 3);
+ foo (1 ^ (2 + 3));
+ foo (a - b ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a - b) ^ c);
+ foo (a - (b ^ c));
+ foo (1 - 2 ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 - 2) ^ c);
+ foo (1 - (2 ^ c));
+ foo (1 - 2 ^ 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 - 2) ^ 3);
+ foo (1 - (2 ^ 3));
+ foo (a ^ b - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a ^ b) - c);
+ foo (a ^ (b - c));
+ foo (1 ^ 2 - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) - c);
+ foo (1 ^ (2 - c));
+ foo (1 ^ 2 - 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) - 3);
+ foo (1 ^ (2 - 3));
+ foo (a >= b ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a >= b) ^ c);
+ foo (a >= (b ^ c));
+ foo (1 >= 2 ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 >= 2) ^ c);
+ foo (1 >= (2 ^ c));
+ foo (1 >= 2 ^ 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 >= 2) ^ 3);
+ foo (1 >= (2 ^ 3));
+ foo (a ^ b >= c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a ^ b) >= c);
+ foo (a ^ (b >= c));
+ foo (1 ^ 2 >= c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) >= c);
+ foo (1 ^ (2 >= c));
+ foo (1 ^ 2 >= 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) >= 3);
+ foo (1 ^ (2 >= 3));
+ foo (a == b ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a == b) ^ c);
+ foo (a == (b ^ c));
+ foo (1 == 2 ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 == 2) ^ c);
+ foo (1 == (2 ^ c));
+ foo (1 == 2 ^ 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 == 2) ^ 3);
+ foo (1 == (2 ^ 3));
+ foo (a ^ b == c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a ^ b) == c);
+ foo (a ^ (b == c));
+ foo (1 ^ 2 == c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) == c);
+ foo (1 ^ (2 == c));
+ foo (1 ^ 2 == 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) == 3);
+ foo (1 ^ (2 == 3));
+ foo (a < b ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a < b) ^ c);
+ foo (a < (b ^ c));
+ foo (1 < 2 ^ c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 < 2) ^ c);
+ foo (1 < (2 ^ c));
+ foo (1 < 2 ^ 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 < 2) ^ 3);
+ foo (1 < (2 ^ 3));
+ foo (a ^ b < c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a ^ b) < c);
+ foo (a ^ (b < c));
+ foo (1 ^ 2 < c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) < c);
+ foo (1 ^ (2 < c));
+ foo (1 ^ 2 < 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 ^ 2) < 3);
+ foo (1 ^ (2 < 3));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-8.c
new file mode 100644
index 000000000..ff34ee0a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-8.c
@@ -0,0 +1,103 @@
+/* Test operation of -Wparentheses. Precedence warnings. + or - or
+ comparison inside &. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+int foo (int);
+
+int
+bar (int a, int b, int c)
+{
+ foo (a + b & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a + b) & c);
+ foo (a + (b & c));
+ foo (1 + 2 & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) & c);
+ foo (1 + (2 & c));
+ foo (1 + 2 & 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 + 2) & 3);
+ foo (1 + (2 & 3));
+ foo (a & b + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a & b) + c);
+ foo (a & (b + c));
+ foo (1 & 2 + c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) + c);
+ foo (1 & (2 + c));
+ foo (1 & 2 + 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) + 3);
+ foo (1 & (2 + 3));
+ foo (a - b & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a - b) & c);
+ foo (a - (b & c));
+ foo (1 - 2 & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 - 2) & c);
+ foo (1 - (2 & c));
+ foo (1 - 2 & 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 - 2) & 3);
+ foo (1 - (2 & 3));
+ foo (a & b - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a & b) - c);
+ foo (a & (b - c));
+ foo (1 & 2 - c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) - c);
+ foo (1 & (2 - c));
+ foo (1 & 2 - 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) - 3);
+ foo (1 & (2 - 3));
+ foo (a < b & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a < b) & c);
+ foo (a < (b & c));
+ foo (1 < 2 & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 < 2) & c);
+ foo (1 < (2 & c));
+ foo (1 < 2 & 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 < 2) & 3);
+ foo (1 < (2 & 3));
+ foo (a & b < c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a & b) < c);
+ foo (a & (b < c));
+ foo (1 & 2 < c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) < c);
+ foo (1 & (2 < c));
+ foo (1 & 2 < 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) < 3);
+ foo (1 & (2 < 3));
+ foo (a == b & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a == b) & c);
+ foo (a == (b & c));
+ foo (1 == 2 & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 == 2) & c);
+ foo (1 == (2 & c));
+ foo (1 == 2 & 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 == 2) & 3);
+ foo (1 == (2 & 3));
+ foo (a & b == c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a & b) == c);
+ foo (a & (b == c));
+ foo (1 & 2 == c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) == c);
+ foo (1 & (2 == c));
+ foo (1 & 2 == 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) == 3);
+ foo (1 & (2 == 3));
+ foo (a != b & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a != b) & c);
+ foo (a != (b & c));
+ foo (1 != 2 & c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 != 2) & c);
+ foo (1 != (2 & c));
+ foo (1 != 2 & 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 != 2) & 3);
+ foo (1 != (2 & 3));
+ foo (a & b != c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((a & b) != c);
+ foo (a & (b != c));
+ foo (1 & 2 != c); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) != c);
+ foo (1 & (2 != c));
+ foo (1 & 2 != 3); /* { dg-warning "parentheses" "correct warning" } */
+ foo ((1 & 2) != 3);
+ foo (1 & (2 != 3));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-9.c
new file mode 100644
index 000000000..0fff6ea1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wparentheses-9.c
@@ -0,0 +1,61 @@
+/* Test operation of -Wparentheses. Warnings for ambiguous else. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+int foo (int);
+
+int a, b, c;
+
+int
+bar (void)
+{
+ if (a)
+ foo (0);
+ if (b)
+ foo (1);
+ else
+ foo (2);
+ if (c) /* { dg-warning "ambiguous" "correct warning" } */
+ if (a)
+ foo (3);
+ else
+ foo (4);
+ if (a)
+ if (c)
+ foo (5);
+ if (a)
+ if (b) /* { dg-warning "ambiguous" "correct warning" } */
+ if (c)
+ foo (6);
+ else
+ foo (7);
+ if (a) /* { dg-warning "ambiguous" "correct warning" } */
+ if (b)
+ if (c)
+ foo (8);
+ else
+ foo (9);
+ else
+ foo (10);
+ if (a)
+ if (b)
+ if (c)
+ foo (11);
+ else
+ foo (12);
+ else
+ foo (13);
+ else
+ foo (14);
+ if (a) {
+ if (b)
+ if (c)
+ foo (15);
+ else
+ foo (16);
+ else
+ foo (17);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-arith.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-arith.c
new file mode 100644
index 000000000..2d5b0cee3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-arith.c
@@ -0,0 +1,11 @@
+/* PR 35058: -Werror= works only with some warnings. */
+/* { dg-do compile } */
+/* { dg-options "-Werror=pointer-arith" } */
+void *a;
+
+void *test(){
+ int x=5;
+ if(a) a++; /* { dg-error "wrong type argument to increment" } */
+ return a+x; /* { dg-error "pointer of type" } */
+}
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-Wall-no.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-Wall-no.c
new file mode 100644
index 000000000..23df20721
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-Wall-no.c
@@ -0,0 +1,9 @@
+/* This is from PR c/25892. See Wpointer-sign.c for more details. */
+
+/* { dg-options "-Wno-pointer-sign -Wall" } */
+
+void foo(unsigned long* ulp);
+
+void bar(long* lp) {
+ foo(lp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c
new file mode 100644
index 000000000..302d50e5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c
@@ -0,0 +1,10 @@
+/* This is from PR c/25892. See Wpointer-sign.c for more details. */
+
+/* { dg-options "-Wall" } */
+
+void foo(unsigned long* ulp); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 5 } */
+
+
+void bar(long* lp) {
+ foo(lp); /* { dg-warning "differ in signedness" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic-no.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic-no.c
new file mode 100644
index 000000000..d4f597fe7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic-no.c
@@ -0,0 +1,9 @@
+/* This is from PR c/25892. See Wpointer-sign.c for more details. */
+
+/* { dg-options "-Wno-pointer-sign -pedantic" } */
+
+void foo(unsigned long* ulp);
+
+void bar(long* lp) {
+ foo(lp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c
new file mode 100644
index 000000000..8b9211098
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c
@@ -0,0 +1,9 @@
+/* This is from PR c/25892. See Wpointer-sign.c for more details. */
+
+/* { dg-options "-pedantic" } */
+
+void foo(unsigned long* ulp);/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */
+
+void bar(long* lp) {
+ foo(lp); /* { dg-warning "differ in signedness" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign.c
new file mode 100644
index 000000000..74cdbe4bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-sign.c
@@ -0,0 +1,13 @@
+/* This is from PR c/25892. The SC promised RMS that -Wpointer-sign
+ would be off by default in GCC 4.1 to avoid inconvenient warnings
+ while compiling GNU Emacs. It should be enabled with -Wall and/or
+ -pedantic, though. Make sure it's off by default in this test (so
+ use dg-options "" to avoid passing -pedantic-errors). */
+
+/* { dg-options "" } */
+
+void foo(unsigned long* ulp);
+
+void bar(long* lp) {
+ foo(lp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-1.c
new file mode 100644
index 000000000..ff011c75d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-1.c
@@ -0,0 +1,12 @@
+/* Test -Wpointer-to-int-cast - on by default. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void *p;
+
+char
+f (void)
+{
+ return (char) p; /* { dg-warning "cast from pointer to integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c
new file mode 100644
index 000000000..9ece965d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c
@@ -0,0 +1,12 @@
+/* Test -Wpointer-to-int-cast. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wpointer-to-int-cast" } */
+
+void *p;
+
+char
+f (void)
+{
+ return (char) p; /* { dg-warning "cast from pointer to integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-3.c
new file mode 100644
index 000000000..c82ca5cf5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-3.c
@@ -0,0 +1,21 @@
+/* Test -Wno-pointer-to-int-cast. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wno-pointer-to-int-cast" } */
+
+void *p;
+
+char
+f (void)
+{
+ return (char) p;
+}
+
+
+char c;
+
+void *
+g (void)
+{
+ return (void *) c; /* { dg-warning "cast to pointer from integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wredundant-decls-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wredundant-decls-1.c
new file mode 100644
index 000000000..c38c7b554
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wredundant-decls-1.c
@@ -0,0 +1,7 @@
+/* PR 16684: no redundant declaration warnings should issue the first
+ time a built-in function is declared.
+ { dg-do compile }
+ { dg-options "-Wredundant-decls" } */
+
+void *malloc (__SIZE_TYPE__); /* { dg-bogus "redundant" } */
+void *malloc (__SIZE_TYPE__); /* { dg-warning "redundant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wredundant-decls-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wredundant-decls-2.c
new file mode 100644
index 000000000..27c8e5d9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wredundant-decls-2.c
@@ -0,0 +1,27 @@
+/* Test for -Wredundant-decls warnings */
+/* { dg-do compile } */
+/* { dg-options "-Wredundant-decls" } */
+
+int j = 5; /* { dg-message "5:note: previous" } */
+int j; /* { dg-warning "5:redundant" } */
+
+static int k;
+static int k = 5; /* { dg-message "12:note: previous" } */
+static int k; /* { dg-warning "12:redundant" } */
+
+static int l = 5; /* { dg-message "12:note: previous" } */
+static int l; /* { dg-warning "12:redundant" } */
+
+static int m; /* { dg-message "12:note: previous" } */
+static int m; /* { dg-warning "12:redundant" } */
+static int m = 5;
+
+int n; /* { dg-message "5:note: previous" } */
+int n; /* { dg-warning "5:redundant" } */
+int n = 5;
+
+static int o;
+static int o = 5;
+
+int p;
+int p = 5;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-local-addr.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-local-addr.c
new file mode 100644
index 000000000..d496d205e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-local-addr.c
@@ -0,0 +1,9 @@
+/* { dg-do assemble } */
+/* { dg-options "-Werror=return-local-addr" } */
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+
+int* bad()
+{
+ int x = 0;
+ return &x; /* { dg-error "address of local variable" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-type.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-type.c
new file mode 100644
index 000000000..a122e5291
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-type.c
@@ -0,0 +1,5 @@
+/* PR c++/4872 */
+/* { dg-do compile } */
+/* { dg-options "-Wreturn-type" } */
+
+static inline int f() {} /* { dg-warning "return" "missing return" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-type2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-type2.c
new file mode 100644
index 000000000..781414a1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wreturn-type2.c
@@ -0,0 +1,9 @@
+/* Test for cases that should not get the unconditional warning about
+ missing return. */
+/* { dg-do compile } */
+
+extern void abort (void);
+
+f() {} /* { dg-bogus "" "no return warning" } */
+int g() { abort (); } /* { dg-bogus "" "no return warning" } */
+int main() {} /* { dg-bogus "" "no return warning" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c
new file mode 100644
index 000000000..63aecd0f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c
@@ -0,0 +1,24 @@
+/* PR 18050 : bogus warning with -Wsequence-point */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+struct x
+{
+ int i;
+};
+void bar(struct x*, int *);
+
+void foo(struct x *y)
+{
+ bar(y++, &y->i); /* { dg-warning "operation on 'y' may be undefined" } */
+}
+
+void zz(int a, int *b)
+{
+ *b = a;
+}
+
+void baz(void) {
+ int a = 5;
+ zz(++a, &a); /* { dg-bogus "operation on 'a' may be undefined" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-1.c
new file mode 100644
index 000000000..40073f337
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-1.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wshadow -pedantic-errors" } */
+
+/* Source: Neil Booth, 5 Dec 2001. */
+
+int decl1; /* { dg-warning "shadowed declaration" } */
+void foo (double decl1) /* { dg-warning "shadows a global decl" } */
+{
+}
+
+void foo1 (int d) /* { dg-message "note: previous definition" } */
+{
+ double d; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "redeclared as different" "" { target *-*-* } 15 } */
+}
+
+void foo2 (int d) /* { dg-warning "shadowed declaration" } */
+{
+ {
+ double d; /* { dg-warning "shadows a parameter" } */
+ }
+}
+
+void foo3 ()
+{
+ int local; /* { dg-warning "shadowed declaration" } */
+ {
+ int local; /* { dg-warning "shadows a previous local" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-2.c
new file mode 100644
index 000000000..b0c051271
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-2.c
@@ -0,0 +1,10 @@
+/* Bogus warning for a double declaration of the same extern variable,
+ first at file scope, then at block scope. PR 13129. */
+
+/* { dg-options "-Wshadow" } */
+
+extern struct foo bar;
+void dummy()
+{
+ extern struct foo bar; /* { dg-bogus "shadows" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-3.c
new file mode 100644
index 000000000..a7f06a26f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-3.c
@@ -0,0 +1,21 @@
+/* Test warnings for shadowing in function prototype scope: generally
+ useless but of use if the parameter is used within the scope. Bug
+ 529. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -Wshadow" } */
+
+int v; /* { dg-warning "shadowed declaration" } */
+int f1(int v);
+int f2(int v, int x[v]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */
+int f3(int v, int y[sizeof(v)]); /* { dg-warning "declaration of 'v' shadows a global declaration" } */
+int f4(int v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
+int f5(int v, int x[v]) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
+int f6(int x) { return 0; }
+int f7(v) int v; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
+int f8(v, w) int v; int w[v]; { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
+int f9(x) int x; { return 0; }
+int f10(v) { return 0; } /* { dg-warning "declaration of 'v' shadows a global declaration" } */
+int f11(int a, int b(int a));
+int f12(int a, int b(int a, int x[a])); /* { dg-warning "declaration of 'a' shadows a parameter" } */
+/* { dg-warning "shadowed declaration" "outer parm" { target *-*-* } 20 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c
new file mode 100644
index 000000000..f3b986fa6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-Wshadow -Wsystem-headers" } */
+
+#include "Wshadow-4.h"
+extern void index2 (void); /* { dg-message "declaration is here" } */
+
+void foo (double index1,
+ double index2)
+{
+}
+
+void foo1 (void)
+{
+ double index1;
+ double index2;
+}
+
+void foo2 (void)
+{
+ {
+ double index1;
+ double index2;
+ }
+}
+
+void foo3 (void)
+{
+ void (*index1)(void); /* { dg-warning "shadows" } */
+ void (*index2)(void); /* { dg-warning "shadows" } */
+}
+
+void foo4 (void)
+{
+ void index1(void) {}; /* { dg-warning "shadows" } */
+ void index2(void) {}; /* { dg-warning "shadows" } */
+}
+
+/* { dg-message "declaration is here" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.h b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.h
new file mode 100644
index 000000000..5a44ca452
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-4.h
@@ -0,0 +1,3 @@
+#pragma GCC system_header
+extern void index1 (void);
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wsign-conversion.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wsign-conversion.c
new file mode 100644
index 000000000..0300850f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wsign-conversion.c
@@ -0,0 +1,96 @@
+/* Test for diagnostics for implicit conversions between signed and
+ unsigned integer types.
+ These tests come from gcc/testsuite/gcc.dg/overflow-warn-2.c */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fsigned-char -Wsign-conversion" } */
+#include <limits.h>
+
+void fsc (signed char sc);
+void fuc (unsigned char uc);
+unsigned fui (unsigned int ui);
+void fsi (signed int ui);
+
+void h (int x)
+{
+ unsigned int ui = 3;
+ int si = 3;
+ unsigned char uc = 3;
+ signed char sc = 3;
+
+ uc = ui;
+ uc = si;
+ sc = ui;
+ sc = si;
+ fuc (ui);
+ fuc (si);
+ fsc (ui);
+ fsc (si);
+
+ fsi (si);
+ fui (ui);
+ fsi (uc);
+ si = uc;
+ fui (uc);
+ ui = uc;
+ fui ('A');
+ ui = 'A';
+ fsi ('A');
+ si = 'A';
+ fuc ('A');
+ uc = 'A';
+
+ uc = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = x ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+
+ fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ fui (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ fuc ('\xa0'); /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ uc = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ fui ('\xa0');/* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ui = '\xa0'; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ fsi (0x80000000); /* { dg-warning "conversion" } */
+ si = 0x80000000; /* { dg-warning "conversion" } */
+
+
+ fsi (UINT_MAX - 1); /* { dg-warning "conversion" } */
+ si = UINT_MAX - 1; /* { dg-warning "conversion" } */
+ fsi (UINT_MAX - 1U); /* { dg-warning "conversion" } */
+ si = UINT_MAX - 1U; /* { dg-warning "conversion" } */
+ fsi (UINT_MAX/3U);
+ si = UINT_MAX/3U;
+ fsi (UINT_MAX/3);
+ si = UINT_MAX/3;
+ fui (UINT_MAX - 1);
+ ui = UINT_MAX - 1;
+
+ uc = (unsigned char) -1;
+ ui = -1 * (1 * -1);
+ ui = (unsigned) -1;
+
+ fsc (uc); /* { dg-warning "conversion" } */
+ sc = uc; /* { dg-warning "conversion" } */
+ fuc (sc); /* { dg-warning "conversion" } */
+ uc = sc; /* { dg-warning "conversion" } */
+ fsi (ui); /* { dg-warning "conversion" } */
+ si = ui; /* { dg-warning "conversion" } */
+ fui (si); /* { dg-warning "conversion" } */
+ ui = si; /* { dg-warning "conversion" } */
+ fui (sc); /* { dg-warning "conversion" } */
+ ui = sc; /* { dg-warning "conversion" } */
+}
+
+unsigned fui (unsigned a) { return a + -1; } /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c
new file mode 100644
index 000000000..b683be7ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wsizeof-pointer-memaccess1.c
@@ -0,0 +1,456 @@
+/* Test -Wsizeof-pointer-memaccess warnings. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void bzero (void *, size_t);
+extern void bcopy (void *, const void *, size_t);
+extern int bcmp (const void *, const void *, size_t);
+
+struct A { short a, b; int c, d; long e, f; };
+typedef struct A TA;
+typedef struct A *PA;
+typedef TA *PTA;
+struct B {};
+typedef struct B TB;
+typedef struct B *PB;
+typedef TB *PTB;
+typedef int X[3][3][3];
+
+int
+f1 (void *x, int z)
+{
+ struct A a, *pa1 = &a;
+ TA *pa2 = &a;
+ PA pa3 = &a;
+ PTA pa4 = &a;
+ bzero (&a, sizeof (&a)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ bzero (pa1, sizeof (pa1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bzero (pa2, sizeof pa2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bzero (pa3, sizeof (pa3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bzero (pa4, sizeof pa4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bzero (pa1, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bzero (pa2, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bzero (pa3, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bzero (pa4, sizeof (__typeof (pa4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ bcopy (x, &a, sizeof (&a)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ bcopy (x, pa1, sizeof (pa1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bcopy (x, pa2, sizeof pa2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bcopy (x, pa3, sizeof (pa3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bcopy (x, pa4, sizeof pa4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bcopy (x, pa1, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (x, pa2, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (x, pa3, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (x, pa4, sizeof (__typeof (pa4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ bcopy (&a, x, sizeof (&a)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ bcopy (pa1, x, sizeof (pa1)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ bcopy (pa2, x, sizeof pa2); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ bcopy (pa3, x, sizeof (pa3)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ bcopy (pa4, x, sizeof pa4); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ bcopy (pa1, x, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (pa2, x, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (pa3, x, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (pa4, x, sizeof (__typeof (pa4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+
+ z += bcmp (&a, x, sizeof (&a)); /* { dg-warning "call is the same expression as the first source; did you mean to remove the addressof" } */
+ z += bcmp (pa1, x, sizeof (pa1)); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += bcmp (pa2, x, sizeof pa2); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += bcmp (pa3, x, sizeof (pa3)); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += bcmp (pa4, x, sizeof pa4); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += bcmp (pa1, x, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+ z += bcmp (pa2, x, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+ z += bcmp (pa3, x, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+
+ z += bcmp (x, &a, sizeof (&a)); /* { dg-warning "call is the same expression as the second source; did you mean to remove the addressof" } */
+ z += bcmp (x, pa1, sizeof (pa1)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += bcmp (x, pa2, sizeof pa2); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += bcmp (x, pa3, sizeof (pa3)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += bcmp (x, pa4, sizeof pa4); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += bcmp (x, pa1, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+ z += bcmp (x, pa2, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+ z += bcmp (x, pa3, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+
+ /* These are correct, no warning. */
+ bzero (&a, sizeof a);
+ bzero (&a, sizeof (a));
+ bzero (&a, sizeof (struct A));
+ bzero (&a, sizeof (const struct A));
+ bzero (&a, sizeof (volatile struct A));
+ bzero (&a, sizeof (volatile const struct A));
+ bzero (&a, sizeof (TA));
+ bzero (&a, sizeof (__typeof (*&a)));
+ bzero (pa1, sizeof (*pa1));
+ bzero (pa2, sizeof (*pa3));
+ bzero (pa3, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ bzero ((void *) &a, sizeof (&a));
+ bzero ((char *) &a, sizeof (&a));
+ bzero (&a, sizeof (&a) + 0);
+ bzero (&a, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ bcopy (x, &a, sizeof a);
+ bcopy (x, &a, sizeof (a));
+ bcopy (x, &a, sizeof (struct A));
+ bcopy (x, &a, sizeof (const struct A));
+ bcopy (x, &a, sizeof (volatile struct A));
+ bcopy (x, &a, sizeof (volatile const struct A));
+ bcopy (x, &a, sizeof (TA));
+ bcopy (x, &a, sizeof (__typeof (*&a)));
+ bcopy (x, pa1, sizeof (*pa1));
+ bcopy (x, pa2, sizeof (*pa3));
+ bcopy (x, pa3, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ bcopy (x, (void *) &a, sizeof (&a));
+ bcopy (x, (char *) &a, sizeof (&a));
+ bcopy (x, &a, sizeof (&a) + 0);
+ bcopy (x, &a, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ bcopy (&a, x, sizeof a);
+ bcopy (&a, x, sizeof (a));
+ bcopy (&a, x, sizeof (struct A));
+ bcopy (&a, x, sizeof (const struct A));
+ bcopy (&a, x, sizeof (volatile struct A));
+ bcopy (&a, x, sizeof (volatile const struct A));
+ bcopy (&a, x, sizeof (TA));
+ bcopy (&a, x, sizeof (__typeof (*&a)));
+ bcopy (pa1, x, sizeof (*pa1));
+ bcopy (pa2, x, sizeof (*pa3));
+ bcopy (pa3, x, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ bcopy ((void *) &a, x, sizeof (&a));
+ bcopy ((char *) &a, x, sizeof (&a));
+ bcopy (&a, x, sizeof (&a) + 0);
+ bcopy (&a, x, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ z += bcmp (&a, x, sizeof a);
+ z += bcmp (&a, x, sizeof (a));
+ z += bcmp (&a, x, sizeof (struct A));
+ z += bcmp (&a, x, sizeof (const struct A));
+ z += bcmp (&a, x, sizeof (volatile struct A));
+ z += bcmp (&a, x, sizeof (volatile const struct A));
+ z += bcmp (&a, x, sizeof (TA));
+ z += bcmp (&a, x, sizeof (__typeof (*&a)));
+ z += bcmp (pa1, x, sizeof (*pa1));
+ z += bcmp (pa2, x, sizeof (*pa3));
+ z += bcmp (pa3, x, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += bcmp ((void *) &a, x, sizeof (&a));
+ z += bcmp ((char *) &a, x, sizeof (&a));
+ z += bcmp (&a, x, sizeof (&a) + 0);
+ z += bcmp (&a, x, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ z += bcmp (x, &a, sizeof a);
+ z += bcmp (x, &a, sizeof (a));
+ z += bcmp (x, &a, sizeof (struct A));
+ z += bcmp (x, &a, sizeof (const struct A));
+ z += bcmp (x, &a, sizeof (volatile struct A));
+ z += bcmp (x, &a, sizeof (volatile const struct A));
+ z += bcmp (x, &a, sizeof (TA));
+ z += bcmp (x, &a, sizeof (__typeof (*&a)));
+ z += bcmp (x, pa1, sizeof (*pa1));
+ z += bcmp (x, pa2, sizeof (*pa3));
+ z += bcmp (x, pa3, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += bcmp (x, (void *) &a, sizeof (&a));
+ z += bcmp (x, (char *) &a, sizeof (&a));
+ z += bcmp (x, &a, sizeof (&a) + 0);
+ z += bcmp (x, &a, 0 + sizeof (&a));
+
+ return z;
+}
+
+int
+f2 (void *x, int z)
+{
+ struct B b, *pb1 = &b;
+ TB *pb2 = &b;
+ PB pb3 = &b;
+ PTB pb4 = &b;
+ bzero (&b, sizeof (&b)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ bzero (pb1, sizeof (pb1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bzero (pb2, sizeof pb2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bzero (pb3, sizeof (pb3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bzero (pb4, sizeof pb4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bzero (pb1, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bzero (pb2, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bzero (pb3, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bzero (pb4, sizeof (__typeof (pb4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ bcopy (x, &b, sizeof (&b)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ bcopy (x, pb1, sizeof (pb1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bcopy (x, pb2, sizeof pb2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bcopy (x, pb3, sizeof (pb3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bcopy (x, pb4, sizeof pb4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ bcopy (x, pb1, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (x, pb2, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (x, pb3, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (x, pb4, sizeof (__typeof (pb4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ bcopy (&b, x, sizeof (&b)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ bcopy (pb1, x, sizeof (pb1)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ bcopy (pb2, x, sizeof pb2); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ bcopy (pb3, x, sizeof (pb3)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ bcopy (pb4, x, sizeof pb4); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ bcopy (pb1, x, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (pb2, x, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (pb3, x, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ bcopy (pb4, x, sizeof (__typeof (pb4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+
+ z += bcmp (&b, x, sizeof (&b)); /* { dg-warning "call is the same expression as the first source; did you mean to remove the addressof" } */
+ z += bcmp (pb1, x, sizeof (pb1)); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += bcmp (pb2, x, sizeof pb2); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += bcmp (pb3, x, sizeof (pb3)); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += bcmp (pb4, x, sizeof pb4); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += bcmp (pb1, x, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+ z += bcmp (pb2, x, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+ z += bcmp (pb3, x, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+
+ z += bcmp (x, &b, sizeof (&b)); /* { dg-warning "call is the same expression as the second source; did you mean to remove the addressof" } */
+ z += bcmp (x, pb1, sizeof (pb1)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += bcmp (x, pb2, sizeof pb2); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += bcmp (x, pb3, sizeof (pb3)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += bcmp (x, pb4, sizeof pb4); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += bcmp (x, pb1, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+ z += bcmp (x, pb2, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+ z += bcmp (x, pb3, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+
+ /* These are correct, no warning. */
+ bzero (&b, sizeof b);
+ bzero (&b, sizeof (b));
+ bzero (&b, sizeof (struct B));
+ bzero (&b, sizeof (const struct B));
+ bzero (&b, sizeof (volatile struct B));
+ bzero (&b, sizeof (volatile const struct B));
+ bzero (&b, sizeof (TB));
+ bzero (&b, sizeof (__typeof (*&b)));
+ bzero (pb1, sizeof (*pb1));
+ bzero (pb2, sizeof (*pb3));
+ bzero (pb3, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ bzero ((void *) &b, sizeof (&b));
+ bzero ((char *) &b, sizeof (&b));
+ bzero (&b, sizeof (&b) + 0);
+ bzero (&b, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ bcopy (x, &b, sizeof b);
+ bcopy (x, &b, sizeof (b));
+ bcopy (x, &b, sizeof (struct B));
+ bcopy (x, &b, sizeof (const struct B));
+ bcopy (x, &b, sizeof (volatile struct B));
+ bcopy (x, &b, sizeof (volatile const struct B));
+ bcopy (x, &b, sizeof (TB));
+ bcopy (x, &b, sizeof (__typeof (*&b)));
+ bcopy (x, pb1, sizeof (*pb1));
+ bcopy (x, pb2, sizeof (*pb3));
+ bcopy (x, pb3, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ bcopy (x, (void *) &b, sizeof (&b));
+ bcopy (x, (char *) &b, sizeof (&b));
+ bcopy (x, &b, sizeof (&b) + 0);
+ bcopy (x, &b, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ bcopy (&b, x, sizeof b);
+ bcopy (&b, x, sizeof (b));
+ bcopy (&b, x, sizeof (struct B));
+ bcopy (&b, x, sizeof (const struct B));
+ bcopy (&b, x, sizeof (volatile struct B));
+ bcopy (&b, x, sizeof (volatile const struct B));
+ bcopy (&b, x, sizeof (TB));
+ bcopy (&b, x, sizeof (__typeof (*&b)));
+ bcopy (pb1, x, sizeof (*pb1));
+ bcopy (pb2, x, sizeof (*pb3));
+ bcopy (pb3, x, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ bcopy ((void *) &b, x, sizeof (&b));
+ bcopy ((char *) &b, x, sizeof (&b));
+ bcopy (&b, x, sizeof (&b) + 0);
+ bcopy (&b, x, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ z += bcmp (&b, x, sizeof b);
+ z += bcmp (&b, x, sizeof (b));
+ z += bcmp (&b, x, sizeof (struct B));
+ z += bcmp (&b, x, sizeof (const struct B));
+ z += bcmp (&b, x, sizeof (volatile struct B));
+ z += bcmp (&b, x, sizeof (volatile const struct B));
+ z += bcmp (&b, x, sizeof (TB));
+ z += bcmp (&b, x, sizeof (__typeof (*&b)));
+ z += bcmp (pb1, x, sizeof (*pb1));
+ z += bcmp (pb2, x, sizeof (*pb3));
+ z += bcmp (pb3, x, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += bcmp ((void *) &b, x, sizeof (&b));
+ z += bcmp ((char *) &b, x, sizeof (&b));
+ z += bcmp (&b, x, sizeof (&b) + 0);
+ z += bcmp (&b, x, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ z += bcmp (x, &b, sizeof b);
+ z += bcmp (x, &b, sizeof (b));
+ z += bcmp (x, &b, sizeof (struct B));
+ z += bcmp (x, &b, sizeof (const struct B));
+ z += bcmp (x, &b, sizeof (volatile struct B));
+ z += bcmp (x, &b, sizeof (volatile const struct B));
+ z += bcmp (x, &b, sizeof (TB));
+ z += bcmp (x, &b, sizeof (__typeof (*&b)));
+ z += bcmp (x, pb1, sizeof (*pb1));
+ z += bcmp (x, pb2, sizeof (*pb3));
+ z += bcmp (x, pb3, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += bcmp (x, (void *) &b, sizeof (&b));
+ z += bcmp (x, (char *) &b, sizeof (&b));
+ z += bcmp (x, &b, sizeof (&b) + 0);
+ z += bcmp (x, &b, 0 + sizeof (&b));
+
+ return z;
+}
+
+int
+f3 (void *x, char *y, int z, X w)
+{
+ unsigned char *y1 = (unsigned char *) __builtin_alloca (z + 16);
+ char buf1[7];
+ signed char buf2[z + 32];
+ long buf3[17];
+ int *buf4[9];
+ signed char *y2 = buf2;
+ char c;
+ char *y3;
+ bzero (y, sizeof (y)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ bzero (y1, sizeof (y1)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ bzero (y2, sizeof (y2)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ bzero (&c, sizeof (&c)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ bzero (w, sizeof w); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+
+ bcopy (x, y, sizeof (y)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ bcopy (x, y1, sizeof (y1)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ bcopy (x, y2, sizeof (y2)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ bcopy (x, &c, sizeof (&c)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ bcopy (x, w, sizeof w); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+
+ bcopy (y, x, sizeof (y)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ bcopy (y1, x, sizeof (y1)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ bcopy (y2, x, sizeof (y2)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ bcopy (&c, x, sizeof (&c)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ bcopy (w, x, sizeof w); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+
+ z += bcmp (y, x, sizeof (y)); /* { dg-warning "call is the same expression as the first source; did you mean to provide an explicit length" } */
+ z += bcmp (y1, x, sizeof (y1)); /* { dg-warning "call is the same expression as the first source; did you mean to provide an explicit length" } */
+ z += bcmp (y2, x, sizeof (y2)); /* { dg-warning "call is the same expression as the first source; did you mean to provide an explicit length" } */
+ z += bcmp (&c, x, sizeof (&c)); /* { dg-warning "call is the same expression as the first source; did you mean to remove the addressof" } */
+ z += bcmp (w, x, sizeof w); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+
+ z += bcmp (x, y, sizeof (y)); /* { dg-warning "call is the same expression as the second source; did you mean to provide an explicit length" } */
+ z += bcmp (x, y1, sizeof (y1)); /* { dg-warning "call is the same expression as the second source; did you mean to provide an explicit length" } */
+ z += bcmp (x, y2, sizeof (y2)); /* { dg-warning "call is the same expression as the second source; did you mean to provide an explicit length" } */
+ z += bcmp (x, &c, sizeof (&c)); /* { dg-warning "call is the same expression as the second source; did you mean to remove the addressof" } */
+ z += bcmp (x, w, sizeof w); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+
+ /* These are correct, no warning. */
+ bzero (y, sizeof (*y));
+ bzero (y1, sizeof (*y2));
+ bzero (buf1, sizeof buf1);
+ bzero (buf3, sizeof (buf3));
+ bzero (&buf3[0], sizeof (buf3));
+ bzero (&buf4[0], sizeof (buf4));
+ bzero (w, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ bzero ((void *) y, sizeof (y));
+ bzero ((char *) y1, sizeof (y2));
+ bzero (y, sizeof (y) + 0);
+ bzero (y1, 0 + sizeof (y2));
+ bzero ((void *) &c, sizeof (&c));
+ bzero ((signed char *) &c, sizeof (&c));
+ bzero (&c, sizeof (&c) + 0);
+ bzero (&c, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ bcopy (x, y, sizeof (*y));
+ bcopy (x, y1, sizeof (*y2));
+ bcopy (x, buf1, sizeof buf1);
+ bcopy (x, buf3, sizeof (buf3));
+ bcopy (x, &buf3[0], sizeof (buf3));
+ bcopy (x, &buf4[0], sizeof (buf4));
+ bcopy (y, &y3, sizeof (y3));
+ bcopy (y, (char *) &y3, sizeof (y3));
+ bcopy (x, w, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ bcopy (x, (void *) y, sizeof (y));
+ bcopy (x, (char *) y1, sizeof (y2));
+ bcopy (x, y, sizeof (y) + 0);
+ bcopy (x, y1, 0 + sizeof (y2));
+ bcopy (x, (void *) &c, sizeof (&c));
+ bcopy (x, (signed char *) &c, sizeof (&c));
+ bcopy (x, &c, sizeof (&c) + 0);
+ bcopy (x, &c, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ bcopy (y, x, sizeof (*y));
+ bcopy (y1, x, sizeof (*y2));
+ bcopy (buf1, x, sizeof buf1);
+ bcopy (buf3, x, sizeof (buf3));
+ bcopy (&buf3[0], x, sizeof (buf3));
+ bcopy (&buf4[0], x, sizeof (buf4));
+ bcopy (&y3, y, sizeof (y3));
+ bcopy ((char *) &y3, y, sizeof (y3));
+ bcopy (w, x, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ bcopy ((void *) y, x, sizeof (y));
+ bcopy ((char *) y1, x, sizeof (y2));
+ bcopy (y, x, sizeof (y) + 0);
+ bcopy (y1, x, 0 + sizeof (y2));
+ bcopy ((void *) &c, x, sizeof (&c));
+ bcopy ((signed char *) &c, x, sizeof (&c));
+ bcopy (&c, x, sizeof (&c) + 0);
+ bcopy (&c, x, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ z += bcmp (y, x, sizeof (*y));
+ z += bcmp (y1, x, sizeof (*y2));
+ z += bcmp (buf1, x, sizeof buf1);
+ z += bcmp (buf3, x, sizeof (buf3));
+ z += bcmp (&buf3[0], x, sizeof (buf3));
+ z += bcmp (&buf4[0], x, sizeof (buf4));
+ z += bcmp (&y3, y, sizeof (y3));
+ z += bcmp ((char *) &y3, y, sizeof (y3));
+ z += bcmp (w, x, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += bcmp ((void *) y, x, sizeof (y));
+ z += bcmp ((char *) y1, x, sizeof (y2));
+ z += bcmp (y, x, sizeof (y) + 0);
+ z += bcmp (y1, x, 0 + sizeof (y2));
+ z += bcmp ((void *) &c, x, sizeof (&c));
+ z += bcmp ((signed char *) &c, x, sizeof (&c));
+ z += bcmp (&c, x, sizeof (&c) + 0);
+ z += bcmp (&c, x, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ z += bcmp (x, y, sizeof (*y));
+ z += bcmp (x, y1, sizeof (*y2));
+ z += bcmp (x, buf1, sizeof buf1);
+ z += bcmp (x, buf3, sizeof (buf3));
+ z += bcmp (x, &buf3[0], sizeof (buf3));
+ z += bcmp (x, &buf4[0], sizeof (buf4));
+ z += bcmp (y, &y3, sizeof (y3));
+ z += bcmp (y, (char *) &y3, sizeof (y3));
+ z += bcmp (x, w, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += bcmp (x, (void *) y, sizeof (y));
+ z += bcmp (x, (char *) y1, sizeof (y2));
+ z += bcmp (x, y, sizeof (y) + 0);
+ z += bcmp (x, y1, 0 + sizeof (y2));
+ z += bcmp (x, (void *) &c, sizeof (&c));
+ z += bcmp (x, (signed char *) &c, sizeof (&c));
+ z += bcmp (x, &c, sizeof (&c) + 0);
+ z += bcmp (x, &c, 0 + sizeof (&c));
+
+ return z;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c
new file mode 100644
index 000000000..8a5dcd8e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+const int* foo (void)
+{
+ int *i;
+ const int** cpi = (const int**) &i; /* { dg-bogus "const vs. non-const" } */
+ i = 0;
+ return *cpi;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c
new file mode 100644
index 000000000..fd3f767ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+int foo ()
+{
+ int x = 10;
+ int *p;
+ float *q;
+
+ q = (float*) &x; /* { dg-bogus "not referenced" } */
+
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-pta-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-pta-1.c
new file mode 100644
index 000000000..a48827474
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-pta-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+struct S { int *p; int *q; };
+
+void foo (struct S *);
+
+int bar (int b)
+{
+ struct S s;
+ int *p;
+ float f;
+ foo (&s);
+ if (b)
+ p = s.q;
+ else
+ p = (int *)&f;
+ return *p;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c
new file mode 100644
index 000000000..b1bee33c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+/* { dg-options "-O2 -Wall -mabi=altivec" { target { { powerpc*-*-linux* } && ilp32 } } } */
+/* { dg-options "-O2 -Wall -msse2" { target { i?86-*-* x86_64-*-* } } } */
+
+typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_load_si128 (__m128i const *__P)
+{
+ return *__P;
+}
+
+static const short __attribute__((__aligned__(16))) tbl[8] =
+{ 1, 2, 3, 4, 5, 6, 7, 8};
+
+
+__m128i get_vec(void)
+{
+ __m128i ret;
+
+ ret = _mm_load_si128((__m128i *)tbl); /* { dg-bogus "type-punning" } */
+
+ return ret;
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*GCC vector returned by reference.*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all.c
new file mode 100644
index 000000000..7e8d17715
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-ref-all.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+struct g { long a; };
+unsigned long f(struct g *a) { return *(unsigned long *)&a->a; }
+
+struct A
+{
+ void *a;
+};
+
+int g(const struct A *x, long *y)
+{
+ typedef long __attribute__ ((may_alias)) long_a;
+ *y = *(const long_a *) (&x->a);
+ return 1;
+}
+
+void *a;
+
+int
+f0 (long *y)
+{
+ *y = *(const long *) &a; /* { dg-warning "will break" } */
+ return 1;
+}
+
+int
+f1 (long *y)
+{
+ typedef long __attribute__ ((may_alias)) long_a;
+ *y = *(const long_a *) &a;
+ return 1;
+}
+
+int
+f2 (long *y)
+{
+ *y = *(const long *) &a; /* { dg-warning "will break" } */
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-struct-included.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-struct-included.c
new file mode 100644
index 000000000..382fecd6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-struct-included.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+struct U
+{
+ float f;
+ int i;
+};
+
+
+int foo ()
+{
+ struct U u;
+ float *pf = (float*)&u; /* { dg-bogus "float included in struct U" } */
+ *pf = 2.0;
+ return u.i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c
new file mode 100644
index 000000000..e9f63d368
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c
@@ -0,0 +1,10 @@
+/* PR 41673: bogus -Wstrict-aliasing warning from VLA dereference. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -O2 -Wall" } */
+
+int main(int argc, char *argv[])
+{
+ float x[argc];
+ float y[argc];
+ return 0 == __builtin_memcpy(y, x, argc * sizeof(*x));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c
new file mode 100644
index 000000000..06a8a376b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-converted-assigned.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */
+
+
+int foo()
+{
+ int i;
+ *(long*)&i = 0; /* { dg-warning "type-punn" "type-punn" } */
+ return i;
+}
+
+/* These messages are only expected for lp64, but fail there. When they
+ pass for lp64, replace "xfail *-*-*" with "target lp64". */
+/* { dg-message "does break strict-aliasing" "break" { xfail *-*-* } 8 } */
+/* { dg-message "initialized" "init" { xfail *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c
new file mode 100644
index 000000000..b90fb76c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wstrict-aliasing -fstrict-aliasing" } */
+
+extern int flag;
+
+int foo() {
+
+ int x;
+ int y = 9;
+ float* q;
+ float* r;
+
+ if (flag) {
+ q = (float*) &x; /* { dg-message "initialized" "" { xfail *-*-* } } */
+ } else {
+ q = (float*) &y; /* { dg-message "initialized" "" { xfail *-*-* } } */
+ }
+
+ *q = 1.0; /* { dg-warning "does break strict-aliasing" "" { xfail *-*-* } } */
+
+ return x;
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-1.c
new file mode 100644
index 000000000..068bfe494
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=3" } */
+
+/* Source: Ian Lance Taylor. Based on strict-overflow-1.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return i - 5 < 10; /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-10.c
new file mode 100644
index 000000000..d2c259728
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-10.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=1" } */
+
+/* Source: Ian Lance Taylor. */
+
+int
+foo (int i)
+{
+ return __builtin_abs (i) >= 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-11.c
new file mode 100644
index 000000000..3caf1cb6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-11.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=1" } */
+
+/* Based on strict-overflow-5.c. */
+
+/* We can only unroll when using strict overflow semantics. But we
+ don't issue a warning for relying on undefined overflow in
+ loops. */
+
+int foo (int i)
+{
+ int index;
+ int r=0;
+
+ for (index = i; index <= i+4; index+=2)
+ r++;
+
+ return r;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-12.c
new file mode 100644
index 000000000..177904db7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-12.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2" } */
+
+/* Source: Ian Lance Taylor. Dual of no-strict-overflow-6.c. */
+
+/* VRP test. This turns into an infinite loop when using strict
+ overflow semantics. */
+
+int
+foo ()
+{
+ int i, bits;
+ for (i = 1, bits = 1; i > 0; i += i) /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
+ ++bits;
+ return bits;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-13.c
new file mode 100644
index 000000000..170d13777
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-13.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2" } */
+
+/* Source: Ian Lance Taylor. Dual of no-strict-overflow-6.c. */
+
+/* VRP test. This turns into an infinite loop (depending on what
+ bigtime_test does), but at least we warn about it. */
+
+extern int bigtime_test (int);
+int
+foo ()
+{
+ int j;
+ for (j = 1; 0 < j; j *= 2) /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
+ if (! bigtime_test (j))
+ return 1;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-14.c
new file mode 100644
index 000000000..6f3c5a24f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-14.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=4" } */
+
+/* Source: Ian Lance Taylor. */
+
+int
+foo (int j)
+{
+ int i;
+ int sum = 0;
+
+ for (i = 1; i < j; i += i)
+ sum += i / 16; /* { dg-warning "assuming signed overflow does not occur" "" } */
+ return sum;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-15.c
new file mode 100644
index 000000000..d1627d2f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-15.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=4" } */
+
+/* Source: Ian Lance Taylor. */
+
+int
+foo (int j)
+{
+ int i;
+ int sum = 0;
+
+ for (i = 1; i < j; i += i)
+ sum += __builtin_abs (i); /* { dg-warning "assuming signed overflow does not occur" "" } */
+ return sum;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-16.c
new file mode 100644
index 000000000..e8c31cf50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-16.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+
+/* From PR 31522. */
+
+int f (int x) {
+ int y;
+ if (x <= 4) y = 1;
+ else y = x / 4;
+ return y <= 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-17.c
new file mode 100644
index 000000000..5625bc2a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-17.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+
+/* This erroneously gave an overflow warning. */
+
+extern void bar (char);
+void
+foo (char *s)
+{
+ int len, i;
+
+ for (len = 1; len < 5000; ++len)
+ {
+ for (i = 0; i < len; ++i)
+ {
+ if (s[i] != '\0')
+ bar (s[i]);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-18.c
new file mode 100644
index 000000000..2767c44fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-18.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+
+/* Don't warn about an overflow when folding i > 0. The loop analysis
+ should determine that i does not wrap.
+
+ The test is really bogus, p->a - p->b can be larger than INT_MAX
+ and thus i can very well wrap. */
+
+struct c { unsigned int a; unsigned int b; };
+extern void bar (struct c *);
+int
+foo (struct c *p)
+{
+ int i;
+ int sum = 0;
+
+ for (i = 0; i < p->a - p->b; ++i)
+ {
+ if (i > 0) /* { dg-bogus "warning" "" { xfail *-*-* } } */
+ sum += 2;
+ bar (p);
+ }
+ return sum;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-19.c
new file mode 100644
index 000000000..daf98b0ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-19.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+
+/* Don't warn about an overflow when threading jumps. We used to get
+ a warning from comparing bounds generated by VRP. */
+
+int
+bar(int a, int b, int n)
+{
+ if (b > a)
+ n = a - b;
+ if (a >= b)
+ n = 1;
+ return n;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-2.c
new file mode 100644
index 000000000..2112571ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2" } */
+
+/* Source: Ian Lance Taylor. Based on strict-overflow-1.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return i - 5 < 10;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
new file mode 100644
index 000000000..207162d0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+
+/* Don't warn about an overflow in a copied loop header. We used to
+ get a warning in value numbering. This is PR 33565. */
+
+void f (int m, int n)
+{
+ int j;
+
+ for (j = m; j < m + 10 && j < n; j ++)
+ do_something (j);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-21.c
new file mode 100644
index 000000000..57e946526
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-21.c
@@ -0,0 +1,12 @@
+/* PR 32102: -Wall stomps on -Wstrict-overflow */
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2 -Wall" } */
+int
+foo ()
+{
+ int i, bits;
+ for (i = 1, bits = 1; i > 0; i += i) /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
+ ++bits;
+ return bits;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-22.c
new file mode 100644
index 000000000..4b8438733
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-22.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=3" } */
+
+/* Source: Ian Lance Taylor. Based on strict-overflow-6.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (char* p)
+{
+ return p + 1000 < p; /* { dg-warning "assuming pointer wraparound does not occur" "correct warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-23.c
new file mode 100644
index 000000000..16014bb15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-23.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-overflow" } */
+
+unsigned int
+do_scrolling (unsigned int window_size, unsigned int writecost)
+{
+ unsigned int i = window_size;
+
+ int terminal_window_p = 0;
+ unsigned int queue = 0;
+
+ for (i = window_size; i; i--)
+ {
+ if (writecost < i)
+ ++queue;
+ else if (writecost & 1)
+ terminal_window_p = 1;
+ }
+
+ if (queue > 0)
+ {
+ if (!terminal_window_p)
+ {
+ terminal_window_p = 1;
+ }
+ }
+
+ if (terminal_window_p)
+ return 100;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c
new file mode 100644
index 000000000..05e8dd144
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-24.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2" } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#pragma GCC diagnostic error "-Wstrict-overflow"
+
+int
+foo (int i)
+{
+ return __builtin_abs (i) >= 0; /* { dg-error "assuming signed overflow does not occur" "correct warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-3.c
new file mode 100644
index 000000000..22f6a56a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=4" } */
+
+/* Source: Ian Lance Taylor. Based on strict-overflow-2.c. */
+
+/* We can only simplify the division when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return (i * 100) / 10; /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-4.c
new file mode 100644
index 000000000..e880bef45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-4.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=3" } */
+
+/* Source: Ian Lance Taylor. Based on strict-overflow-2.c. */
+
+/* We can only simplify the division when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return (i * 100) / 10;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-5.c
new file mode 100644
index 000000000..9af0adb99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-5.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=3" } */
+
+/* Source: Ian Lance Taylor. Based on strict-overflow-3.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i, int j)
+{
+ return i + 100 < j + 1000; /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-6.c
new file mode 100644
index 000000000..c3a160c60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-6.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2" } */
+
+/* Source: Ian Lance Taylor. Based on strict-overflow-3.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i, int j)
+{
+ return i + 100 < j + 1000;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-7.c
new file mode 100644
index 000000000..5bf7b6005
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-7.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+
+/* Source: Ian Lance Taylor. */
+
+int
+foo (int i)
+{
+ return i + 10 > i; /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-8.c
new file mode 100644
index 000000000..566729fe3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-8.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wall -Wno-strict-overflow" } */
+
+/* Source: Ian Lance Taylor. */
+
+int
+foo (int i)
+{
+ return i + 10 > i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-9.c
new file mode 100644
index 000000000..425a121d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstrict-overflow-9.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=2" } */
+
+/* Source: Ian Lance Taylor. */
+
+int
+foo (int i)
+{
+ return __builtin_abs (i) >= 0; /* { dg-warning "assuming signed overflow does not occur" "correct warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-1.c
new file mode 100644
index 000000000..97e317644
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-1.c
@@ -0,0 +1,29 @@
+/* PR c/7776 */
+/* { dg-do compile } */
+/* { dg-options "-Waddress" } */
+
+int test1(char *ptr)
+{
+ return ptr == "foo"; /* { dg-warning "comparison with string" } */
+}
+
+int test2()
+{
+ return "foo" != (const char*)0;
+}
+
+int test3()
+{
+ return "foo" == (const char*)0;
+}
+
+int test4()
+{
+ return (const char*)0 != "foo";
+}
+
+int test5()
+{
+ return (const char*)0 == "foo";
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-2.c
new file mode 100644
index 000000000..3eb91eeca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-2.c
@@ -0,0 +1,29 @@
+/* PR c/7776 */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+int test1(char *ptr)
+{
+ return ptr == "foo"; /* { dg-warning "comparison with string" } */
+}
+
+int test2()
+{
+ return "foo" != (const char*)0;
+}
+
+int test3()
+{
+ return "foo" == (const char*)0;
+}
+
+int test4()
+{
+ return (const char*)0 != "foo";
+}
+
+int test5()
+{
+ return (const char*)0 == "foo";
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-3.c
new file mode 100644
index 000000000..f700a51a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-3.c
@@ -0,0 +1,29 @@
+/* PR c/7776 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int test1(char *ptr)
+{
+ return ptr == "foo";
+}
+
+int test2()
+{
+ return "foo" != (const char*)0;
+}
+
+int test3()
+{
+ return "foo" == (const char*)0;
+}
+
+int test4()
+{
+ return (const char*)0 != "foo";
+}
+
+int test5()
+{
+ return (const char*)0 == "foo";
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-4.c
new file mode 100644
index 000000000..f2a711aeb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wstring-literal-comparison-4.c
@@ -0,0 +1,29 @@
+/* PR c/7776 */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wno-address" } */
+
+int test1(char *ptr)
+{
+ return ptr == "foo";
+}
+
+int test2()
+{
+ return "foo" != (const char*)0;
+}
+
+int test3()
+{
+ return "foo" == (const char*)0;
+}
+
+int test4()
+{
+ return (const char*)0 != "foo";
+}
+
+int test5()
+{
+ return (const char*)0 == "foo";
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-2.c
new file mode 100644
index 000000000..79ba4bdcb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-2.c
@@ -0,0 +1,31 @@
+/* Further -Wswitch tests. */
+/* { dg-do compile } */
+/* { dg-options "-Wswitch" } */
+
+enum e { e1 = 0, e2 = 1, e3 = 1, e4 = 2 };
+
+int
+foo (enum e ei, int j)
+{
+ switch (ei)
+ {
+ case e1: return 1;
+ case e3: return 2;
+ case e4: return 3;
+ } /* No warning here since e2 has the same value as e3. */
+ switch (ei) /* { dg-warning "enumeration value 'e4' not handled in switch" "enum e4" } */
+ {
+ case e1: return 1;
+ case e2: return 2;
+ }
+ switch ((int) ei)
+ {
+ case e1: return 1;
+ } /* No warning here since switch condition was cast to int. */
+ switch ((enum e) j) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
+ {
+ case e2: return 1;
+ case e4: return 2;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-default.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-default.c
new file mode 100644
index 000000000..2d4e7994c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-default.c
@@ -0,0 +1,62 @@
+/* { dg-do compile } */
+/* { dg-options "-Wswitch-default" } */
+
+enum e { e1, e2 };
+
+int
+foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
+ enum e em, enum e en, enum e eo, enum e ep)
+{
+ switch (i) /* { dg-warning "switch missing default case" } */
+ {
+ case 1: return 1;
+ case 2: return 2;
+ }
+ switch (j)
+ {
+ case 3: return 4;
+ case 4: return 3;
+ default: break;
+ }
+ switch (ei) /* { dg-warning "switch missing default case" } */
+ {
+ }
+ switch (ej)
+ {
+ default: break;
+ }
+ switch (ek) /* { dg-warning "switch missing default case" } */
+ {
+ case e1: return 1;
+ }
+ switch (el)
+ {
+ case e1: return 1;
+ default: break;
+ }
+ switch (em) /* { dg-warning "switch missing default case" } */
+ {
+ case e1: return 1;
+ case e2: return 2;
+ }
+ switch (en)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ default: break;
+ }
+ switch (eo) /* { dg-warning "switch missing default case" } */
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3;
+ }
+ switch (ep)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3;
+ default: break;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-2.c
new file mode 100644
index 000000000..6b5ca1d30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wswitch-enum" } */
+
+typedef enum { a = 2 } T;
+
+int main()
+{
+ T x = a;
+ switch(x)
+ {
+ case a ... 3: /* { dg-warning "case value '3' not in enumerated" "3" } */
+ break;
+ }
+ switch(x)
+ {
+ case 1 ... a: /* { dg-warning "case value '1' not in enumerated" "1" } */
+ break;
+ }
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-3.c
new file mode 100644
index 000000000..98db4d578
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-3.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wswitch-enum" } */
+
+typedef enum { a = 2 } T;
+
+int main()
+{
+ switch((T)a) /* { dg-warning "enumeration value 'a' not handled" "a" } */
+ {
+ case 1: /* { dg-warning "case value '1' not in enumerated" "1" } */
+ break;
+ }
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-error.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-error.c
new file mode 100644
index 000000000..992684007
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum-error.c
@@ -0,0 +1,63 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Werror=switch-enum -Wswitch" } */
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+enum e { e1, e2 };
+
+int
+foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
+ enum e em, enum e en, enum e eo, enum e ep)
+{
+ switch (i)
+ {
+ case 1: return 1;
+ case 2: return 2;
+ }
+ switch (j)
+ {
+ case 3: return 4;
+ case 4: return 3;
+ default: break;
+ }
+ switch (ei) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
+ { /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
+ }
+ switch (ej) /* { dg-error "enumeration value 'e1' not handled in switch" "enum e1" } */
+ { /* { dg-error "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 25 } */
+ default: break;
+ }
+ switch (ek) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
+ {
+ case e1: return 1;
+ }
+ switch (el) /* { dg-error "enumeration value 'e2' not handled in switch" "enum e2" } */
+ {
+ case e1: return 1;
+ default: break;
+ }
+ switch (em)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ }
+ switch (en)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ default: break;
+ }
+ switch (eo)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
+ }
+ switch (ep)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
+ default: break;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum.c
new file mode 100644
index 000000000..28c60d879
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-enum.c
@@ -0,0 +1,63 @@
+/* PR c/5044 */
+/* { dg-do compile } */
+/* { dg-options "-Wswitch-enum" } */
+
+enum e { e1, e2 };
+
+int
+foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
+ enum e em, enum e en, enum e eo, enum e ep)
+{
+ switch (i)
+ {
+ case 1: return 1;
+ case 2: return 2;
+ }
+ switch (j)
+ {
+ case 3: return 4;
+ case 4: return 3;
+ default: break;
+ }
+ switch (ei) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
+ { /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
+ }
+ switch (ej) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
+ { /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 25 } */
+ default: break;
+ }
+ switch (ek) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
+ {
+ case e1: return 1;
+ }
+ switch (el) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
+ {
+ case e1: return 1;
+ default: break;
+ }
+ switch (em)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ }
+ switch (en)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ default: break;
+ }
+ switch (eo)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
+ }
+ switch (ep)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
+ default: break;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-error.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-error.c
new file mode 100644
index 000000000..2fcd1ddd5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch-error.c
@@ -0,0 +1,64 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Werror=switch -Wswitch-enum" } */
+
+enum e { e1, e2 };
+
+int
+foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
+ enum e em, enum e en, enum e eo, enum e ep)
+{
+ switch (i)
+ {
+ case 1: return 1;
+ case 2: return 2;
+ }
+ switch (j)
+ {
+ case 3: return 4;
+ case 4: return 3;
+ default: break;
+ }
+ switch (ei) /* { dg-error "enumeration value 'e1' not handled in switch" "enum e1" } */
+ { /* { dg-error "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
+ }
+ switch (ej) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
+ { /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 25 } */
+ default: break;
+ }
+ switch (ek) /* { dg-error "enumeration value 'e2' not handled in switch" "enum e2" } */
+ {
+ case e1: return 1;
+ }
+ switch (el) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
+ {
+ case e1: return 1;
+ default: break;
+ }
+ switch (em)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ }
+ switch (en)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ default: break;
+ }
+ switch (eo)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3; /* { dg-error "case value '3' not in enumerated type 'enum e'" "excess 3" } */
+ }
+ switch (ep)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3; /* { dg-error "case value '3' not in enumerated type 'enum e'" "excess 3" } */
+ default: break;
+ }
+ return 0;
+}
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch.c
new file mode 100644
index 000000000..9b43ed445
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wswitch.c
@@ -0,0 +1,63 @@
+/* PR c/4475, PR c++/3780 */
+/* { dg-do compile } */
+/* { dg-options "-Wswitch" } */
+
+enum e { e1, e2 };
+
+int
+foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
+ enum e em, enum e en, enum e eo, enum e ep)
+{
+ switch (i)
+ {
+ case 1: return 1;
+ case 2: return 2;
+ }
+ switch (j)
+ {
+ case 3: return 4;
+ case 4: return 3;
+ default: break;
+ }
+ switch (ei) /* { dg-warning "enumeration value 'e1' not handled in switch" "enum e1" } */
+ { /*{ dg-warning "enumeration value 'e2' not handled in switch" "enum e2" { target *-*-* } 22 } */
+ }
+ switch (ej)
+ {
+ default: break;
+ }
+ switch (ek) /* { dg-warning "enumeration value 'e2' not handled in switch" "enum e2" } */
+ {
+ case e1: return 1;
+ }
+ switch (el)
+ {
+ case e1: return 1;
+ default: break;
+ }
+ switch (em)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ }
+ switch (en)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ default: break;
+ }
+ switch (eo)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
+ }
+ switch (ep)
+ {
+ case e1: return 1;
+ case e2: return 2;
+ case 3: return 3; /* { dg-warning "case value '3' not in enumerated type 'enum e'" "excess 3" } */
+ default: break;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wtraditional-conversion-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wtraditional-conversion-2.c
new file mode 100644
index 000000000..b3c7e3c6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wtraditional-conversion-2.c
@@ -0,0 +1,64 @@
+/* Test messages for -Wtraditional-conversion, including that they are not
+ pedwarns. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors -Wtraditional-conversion" } */
+
+void fsc(signed char);
+void fsi(signed int);
+void fsll(signed long long);
+void fuc(unsigned char);
+void fui(unsigned int);
+void full(unsigned long long);
+void ff(float);
+void fld(long double);
+void fcf(_Complex float);
+
+struct s {
+ void (*fsc)(signed char);
+ void (*fsi)(signed int);
+ void (*fsll)(signed long long);
+ void (*fuc)(unsigned char);
+ void (*fui)(unsigned int);
+ void (*full)(unsigned long long);
+ void (*ff)(float);
+ void (*fld)(long double);
+ void (*fcf)(_Complex float);
+} x;
+
+signed char sc;
+signed int si;
+signed long long sll;
+unsigned char uc;
+unsigned int ui;
+unsigned long long ull;
+float f;
+long double ld;
+_Complex float cf;
+
+void
+g (void)
+{
+ fsi(f); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
+ x.fsi(f); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
+ fsi(cf); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than complex due to prototype" } */
+ x.fsi(cf); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than complex due to prototype" } */
+ fcf(f); /* { dg-warning "passing argument 1 of 'fcf' as complex rather than floating due to prototype" } */
+ x.fcf(f); /* { dg-warning "passing argument 1 of 'x.fcf' as complex rather than floating due to prototype" } */
+ fcf(si); /* { dg-warning "passing argument 1 of 'fcf' as complex rather than integer due to prototype" } */
+ x.fcf(si); /* { dg-warning "passing argument 1 of 'x.fcf' as complex rather than integer due to prototype" } */
+ ff(sc); /* { dg-warning "passing argument 1 of 'ff' as floating rather than integer due to prototype" } */
+ x.ff(sc); /* { dg-warning "passing argument 1 of 'x.ff' as floating rather than integer due to prototype" } */
+ ff(cf); /* { dg-warning "passing argument 1 of 'ff' as floating rather than complex due to prototype" } */
+ x.ff(cf); /* { dg-warning "passing argument 1 of 'x.ff' as floating rather than complex due to prototype" } */
+ ff(1.0); /* { dg-warning "passing argument 1 of 'ff' as 'float' rather than 'double' due to prototype" } */
+ x.ff(1.0); /* { dg-warning "passing argument 1 of 'x.ff' as 'float' rather than 'double' due to prototype" } */
+ fsll(sc); /* { dg-warning "passing argument 1 of 'fsll' with different width due to prototype" } */
+ x.fsll(sc); /* { dg-warning "passing argument 1 of 'x.fsll' with different width due to prototype" } */
+ fsc(sll); /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" } */
+ x.fsc(sll); /* { dg-warning "passing argument 1 of 'x.fsc' with different width due to prototype" } */
+ fsi(ui); /* { dg-warning "passing argument 1 of 'fsi' as signed due to prototype" } */
+ x.fsi(ui); /* { dg-warning "passing argument 1 of 'x.fsi' as signed due to prototype" } */
+ full(sll); /* { dg-warning "passing argument 1 of 'full' as unsigned due to prototype" } */
+ x.full(sll); /* { dg-warning "passing argument 1 of 'x.full' as unsigned due to prototype" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wtraditional-conversion.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wtraditional-conversion.c
new file mode 100644
index 000000000..a3f04acb5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wtraditional-conversion.c
@@ -0,0 +1,20 @@
+/* Source: PR 137.
+
+ We would not warn about passing an enum, but would warn about
+ passing a enum that was part of an array. TYPE_MAIN_VARIANT was
+ not used in the appropriate place in the warning code. */
+
+/* { dg-do compile } */
+/* { dg-options -Wtraditional-conversion } */
+
+typedef enum { a } __attribute__((packed)) t;
+void f(t x) {}
+
+int main(void)
+{
+ t x[2], y;
+ f(x[0]); /* { dg-bogus "different width" } */
+ f(y); /* { dg-bogus "different width" } */
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wtrampolines.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wtrampolines.c
new file mode 100644
index 000000000..dcb368147
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wtrampolines.c
@@ -0,0 +1,57 @@
+/* Origin: trampoline-1.c Waldek Hebisch <hebisch@math.uni.wroc.pl> */
+/* Ported to test -Wtrampolines Magnus Granberg <zorry@gentoo.org> */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target trampolines } */
+/* { dg-options "-O2 -Wtrampolines" } */
+
+#ifndef NO_TRAMPOLINES
+
+/* This used to fail on various versions of Solaris 2 because the
+ trampoline couldn't be made executable. */
+
+extern void abort(void);
+extern double fabs(double);
+
+void foo (void)
+{
+ const int correct[1100] = {1, 0, -2, 0, 1, 0, 1, -1, -10, -30, -67};
+ int i;
+
+ double x1 (void) {return 1; }
+ double x2 (void) {return -1;}
+ double x3 (void) {return -1;}
+ double x4 (void) {return 1; }
+ double x5 (void) {return 0; }
+
+ typedef double pfun(void);
+
+ double a (int k, pfun x1, pfun x2, pfun x3, pfun x4, pfun x5)
+ {
+ double b (void) /* { dg-warning "trampoline generated for nested function 'b'" } */
+ {
+ k = k - 1;
+ return a (k, b, x1, x2, x3, x4 );
+ }
+
+ if (k <= 0)
+ return x4 () + x5 ();
+ else
+ return b ();
+ }
+
+ for (i=0; i<=10; i++)
+ {
+ if (fabs(a( i, x1, x2, x3, x4, x5 ) - correct [i]) > 0.1)
+ abort();
+ }
+}
+#endif
+
+int main (void)
+{
+#ifndef NO_TRAMPOLINES
+ foo ();
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c
new file mode 100644
index 000000000..f8f528c99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits-Wextra.c
@@ -0,0 +1,70 @@
+/* Test that -Wtype-limits is enabled by -Wextra */
+/* { dg-do compile } */
+/* { dg-excess-errors "short=int" { target { avr-*-* } } } */
+/* { dg-options "-Wextra" } */
+
+void a (unsigned char x)
+{
+ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
+ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" } */
+ if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
+ if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" } */
+ if (x <= 255) /* { dg-warning "comparison is always true due to limited range of data type" } */
+ return;
+ if (255 >= x) /* { dg-warning "comparison is always true due to limited range of data type" } */
+ return;
+ if ((int)x <= 255) /* { dg-bogus "comparison is always true due to limited range of data type" "" { xfail *-*-* } 16 } */
+ return;
+ if (255 >= (unsigned char) 1)
+ return;
+
+}
+
+void b (unsigned short x)
+{ /* { dg-warning "comparison of unsigned expression < 0 is always false" "" { target { ! int32plus } } 25 } */
+ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { int32plus } } } */
+ /* { dg-warning "comparison of unsigned expression >= 0 is always true" "" { target { ! int32plus } } 27 } */
+ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { int32plus } } } */
+ /* { dg-warning "comparison of unsigned expression < 0 is always false" "" { target { ! int32plus } } 29 } */
+ if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { int32plus } } } */
+ /* { dg-warning "comparison of unsigned expression >= 0 is always true" "" { target { ! int32plus } } 31 } */
+ if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { int32plus } } } */
+}
+
+void c (unsigned int x)
+{
+ if (x < 0) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+ if (1U >= 0) return;
+ if (1U < 0) return;
+ if (0 <= 1U) return;
+ if (0 > 1U) return;
+}
+
+void d (unsigned long x)
+{
+ if (x < 0) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+}
+
+void e (unsigned long long x)
+{
+ if (x < 0) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+}
+
+int test (int x)
+{
+ if ((long long)x <= 0x123456789ABCLL) /* { dg-bogus "comparison is always true due to limited range of data type" "" { xfail *-*-* } 64 } */
+ return 1;
+ else
+ return 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits-no.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits-no.c
new file mode 100644
index 000000000..2af909abf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits-no.c
@@ -0,0 +1,66 @@
+/* Test disabling -Wtype-limits */
+/* { dg-do compile } */
+/* { dg-options "-Wextra -Wno-type-limits" } */
+
+
+void a (unsigned char x)
+{
+ if (x < 0) return;/* { dg-bogus "comparison is always false due to limited range of data type" } */
+ if (x >= 0) return;/* { dg-bogus "comparison is always true due to limited range of data type" } */
+ if (0 > x) return;/* { dg-bogus "comparison is always false due to limited range of data type" } */
+ if (0 <= x) return;/* { dg-bogus "comparison is always true due to limited range of data type" } */
+ if (x <= 255) /* { dg-bogus "comparison is always true due to limited range of data type" } */
+ return;
+ if (255 >= x) /* { dg-bogus "comparison is always true due to limited range of data type" } */
+ return;
+ if ((int)x <= 255)
+ return;
+ if (255 >= (unsigned char) 1)
+ return;
+
+}
+
+void b (unsigned short x)
+{
+ if (x < 0) return;/* { dg-bogus "comparison is always false due to limited range of data type" } */
+ if (x >= 0) return;/* { dg-bogus "comparison is always true due to limited range of data type" } */
+ if (0 > x) return;/* { dg-bogus "comparison is always false due to limited range of data type" } */
+ if (0 <= x) return;/* { dg-bogus "comparison is always true due to limited range of data type" } */
+}
+
+void c (unsigned int x)
+{
+ if (x < 0) return;/* { dg-bogus "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-bogus "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-bogus "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-bogus "comparison of unsigned expression >= 0 is always true" } */
+ if (1U >= 0) return;
+ if (1U < 0) return;
+ if (0 <= 1U) return;
+ if (0 > 1U) return;
+}
+
+void d (unsigned long x)
+{
+ if (x < 0) return;/* { dg-bogus "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-bogus "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-bogus "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-bogus "comparison of unsigned expression >= 0 is always true" } */
+}
+
+void e (unsigned long long x)
+{
+ if (x < 0) return;/* { dg-bogus "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-bogus "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-bogus "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-bogus "comparison of unsigned expression >= 0 is always true" } */
+}
+
+int test (int x)
+{
+ if ((long long)x <= 0x123456789ABCLL)
+ return 1;
+ else
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits.c
new file mode 100644
index 000000000..16173e5b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wtype-limits.c
@@ -0,0 +1,70 @@
+/* { dg-do compile } */
+/* { dg-options "-Wtype-limits" } */
+
+
+
+void a (unsigned char x)
+{
+ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
+ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" } */
+ if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" } */
+ if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" } */
+ if (x <= 255) /* { dg-warning "comparison is always true due to limited range of data type" } */
+ return;
+ if (255 >= x) /* { dg-warning "comparison is always true due to limited range of data type" } */
+ return;
+ if ((int)x <= 255) /* { dg-bogus "comparison is always true due to limited range of data type" "" { xfail *-*-* } 16 } */
+ return;
+ if (255 >= (unsigned char) 1)
+ return;
+
+}
+
+void b (unsigned short x)
+{ /* { dg-warning "comparison of unsigned expression < 0 is always false" "" { target { ! int32plus } } 25 } */
+ if (x < 0) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { int32plus } } } */
+ /* { dg-warning "comparison of unsigned expression >= 0 is always true" "" { target { ! int32plus } } 27 } */
+ if (x >= 0) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { int32plus } } } */
+ /* { dg-warning "comparison of unsigned expression < 0 is always false" "" { target { ! int32plus } } 29 } */
+ if (0 > x) return;/* { dg-warning "comparison is always false due to limited range of data type" "" { target { int32plus } } } */
+ /* { dg-warning "comparison of unsigned expression >= 0 is always true" "" { target { ! int32plus } } 31 } */
+ if (0 <= x) return;/* { dg-warning "comparison is always true due to limited range of data type" "" { target { int32plus } } } */
+}
+
+void c (unsigned int x)
+{
+ if (x < 0) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+ if (1U >= 0) return;
+ if (1U < 0) return;
+ if (0 <= 1U) return;
+ if (0 > 1U) return;
+}
+
+void d (unsigned long x)
+{
+ if (x < 0) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+}
+
+void e (unsigned long long x)
+{
+ if (x < 0) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (x >= 0) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+ if (0 > x) return;/* { dg-warning "comparison of unsigned expression < 0 is always false" } */
+ if (0 <= x) return;/* { dg-warning "comparison of unsigned expression >= 0 is always true" } */
+}
+
+int test (int x)
+{
+ if ((long long)x <= 0x123456789ABCLL) /* { dg-bogus "comparison is always true due to limited range of data type" "" { xfail *-*-* } 64 } */
+ return 1;
+ else
+ return 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunknownprag.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunknownprag.c
new file mode 100644
index 000000000..c5ba58f76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunknownprag.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wunknown-pragmas" } */
+
+/* We used to get "unspellable token: CPP_EOF" warnings. */
+
+#pragma /* { dg-warning "ignoring #pragma" } */
+#pragma ~ /* { dg-warning "ignoring #pragma" } */
+#pragma baz /* { dg-warning "ignoring #pragma" } */
+#pragma baz baz /* { dg-warning "ignoring #pragma" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunsuffixed-float-constants-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunsuffixed-float-constants-1.c
new file mode 100644
index 000000000..b4a38d5cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunsuffixed-float-constants-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wunsuffixed-float-constants" } */
+
+#define VAL 0.5;
+
+double a = 1.1d;
+
+/* With FLOAT_CONST_DECIMAL64 switched to ON these would have type
+ _Decimal64. */
+
+double b = VAL; /* { dg-warning "unsuffixed float constant" } */
+double c = 1.2; /* { dg-warning "unsuffixed float constant" } */
+
+/* With FLOAT_CONST_DECIMAL64 switched to ON these are still binary. */
+
+double d = 0x5.0p1; /* No warning for hex constant. */
+double e = 3.1i; /* No warning for imaginary constant. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-function.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-function.c
new file mode 100644
index 000000000..1c59c5003
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-function.c
@@ -0,0 +1,6 @@
+/* PR c/4076 -Wunused doesn't warn about static function only called by itself. */
+/* { dg-do compile } */
+/* { dg-options "-Wunused-function" } */
+
+static void foo (void) {} /* { dg-warning "'foo' defined but not used" } */
+static void bar (void) { bar (); } /* { dg-warning "'bar' defined but not used" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-label-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-label-1.c
new file mode 100644
index 000000000..1840a8008
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-label-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Wunused-label" } */
+
+extern void f2 ();
+
+void
+f1 ()
+{
+ l1: f2 (); /* { dg-warning "not used" } */
+ l2: __attribute__ ((unused)) f2 ();
+ l3: ; f2 (); /* { dg-warning "not used" } */
+ l4: __attribute__ ((unused)) ; f2 ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-local-typedefs.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-local-typedefs.c
new file mode 100644
index 000000000..4c8c15ed2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-local-typedefs.c
@@ -0,0 +1,36 @@
+/* Origin PR c/53702
+ { dg-options "-Wunused-local-typedefs" }
+ { dg-do compile }
+*/
+
+/* Only test nested functions for C. More tests that work for C and C++
+ can be found in c-c++-common.
+*/
+
+void
+test0 ()
+{
+ typedef int foo; /* { dg-warning "locally defined but not used" } */
+ void f ()
+ {
+ }
+}
+
+void
+test1 ()
+{
+ void f ()
+ {
+ typedef int foo; /* { dg-warning "locally defined but not used" } */
+ }
+}
+
+
+void
+test2 ()
+{
+ void f ()
+ {
+ }
+ typedef int foo; /* { dg-warning "locally defined but not used" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-parm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-parm-1.c
new file mode 100644
index 000000000..bddbd83a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-parm-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-Wunused -W" } */
+
+long
+f1 (unsigned long long x)
+{
+ unsigned long long a = 1;
+ const union { unsigned long long l; unsigned int p[2]; } b = { .l = x };
+ const union { unsigned long long l; unsigned int p[2]; } c = { .l = a };
+ return b.p[0] + c.p[0];
+}
+
+int
+f2 (int x, int y)
+{
+ int a = 1;
+ int b[] = { 1, 2, x, a, 3, 4 };
+ return b[y];
+}
+
+int
+f3 (int a, /* { dg-warning "unused parameter" } */
+ int b, /* { dg-warning "set but not used" } */
+ int c)
+{
+ b = 1;
+ c = 1;
+ return c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-1.c
new file mode 100644
index 000000000..0fc7c364b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-1.c
@@ -0,0 +1,31 @@
+/* Test -Wunused-value. Bug 23113. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wunused-value" } */
+
+int f (void);
+void g (void);
+int *p;
+
+void
+h (void)
+{
+ 1 + f (); /* { dg-warning "value computed is not used" } */
+ f () + f (); /* { dg-warning "value computed is not used" } */
+ f () + f (), f (); /* { dg-warning "value computed is not used" } */
+ (char) f (); /* { dg-warning "value computed is not used" } */
+ g ();
+ f ();
+ (void) f ();
+ *p++; /* { dg-warning "value computed is not used" } */
+ ++*p;
+ (*p ? f() : 0);
+ ({ f(); });
+ /* Statement expressions may be used in macro expansions which like
+ functions return values which may or may not be of use, so don't
+ warn for them but do warn inside them. */
+ ({ f() + 1; });
+ ({ f(); 0; });
+ ({ f() + 1; 0; }); /* { dg-warning "value computed is not used" } */
+ 1 + ({ f(); }); /* { dg-warning "value computed is not used" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-2.c
new file mode 100644
index 000000000..4858bfade
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-2.c
@@ -0,0 +1,18 @@
+/* Test -Wunused-value. Bug 30729. */
+/* { dg-do compile } */
+/* { dg-options "-Wunused-value" } */
+/* Make sure va_arg does not cause a value computed is not used warning
+ because it has side effects. */
+#include <stdarg.h>
+
+int f(int t, ...)
+{
+ va_list a;
+ va_start (a, t);
+ va_arg(a, int);/* { dg-bogus "value computed is not used" } */
+ int t1 = va_arg(a, int);
+ va_end(a);
+ return t1;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-3.c
new file mode 100644
index 000000000..333ddea4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-value-3.c
@@ -0,0 +1,9 @@
+/* PR c/39889 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused-value" } */
+
+int x;
+int foo (void)
+{
+ return (1 ? x = 0 : (void) 0), 0; /* { dg-bogus "value computed is not used" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-1.c
new file mode 100644
index 000000000..d60dd70e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+int
+f1 (void)
+{
+ int a;
+ int foo (void)
+ {
+ return a;
+ }
+ a = 1;
+ return foo ();
+}
+
+void
+f2 (void)
+{
+ int a; /* { dg-warning "set but not used" } */
+ void foo (void)
+ {
+ a = 2;
+ }
+ a = 1;
+ foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-2.c
new file mode 100644
index 000000000..b5a22f865
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+int
+f1 (void)
+{
+ int a;
+ int b;
+ int c;
+ int d;
+ int e;
+ a = 1;
+ b = 2;
+ c = 3;
+ d = 4;
+ e = 5;
+ return sizeof (a) + ((__typeof (b)) 1) + __alignof__ (c)
+ + __builtin_choose_expr (1, d, e);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-3.c
new file mode 100644
index 000000000..5954c3b1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wunused-var-3.c
@@ -0,0 +1,34 @@
+/* PR c/52577 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+typedef int V __attribute__((vector_size (sizeof (int) * 4)));
+
+void
+f1 (V *p)
+{
+ V mask = { 1, 2, 3, 0 };
+ *p = __builtin_shuffle (*p, mask);
+}
+
+void
+f2 (V *p, V *q)
+{
+ V mask = { 1, 2, 3, 0 };
+ *p = __builtin_shuffle (*p, *q, mask);
+}
+
+void
+f3 (V *p, V *mask)
+{
+ V a = { 1, 2, 3, 0 };
+ *p = __builtin_shuffle (a, *mask);
+}
+
+void
+f4 (V *p, V *mask)
+{
+ V a = { 1, 2, 3, 0 };
+ V b = { 2, 3, 4, 1 };
+ *p = __builtin_shuffle (a, b, *mask);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wwrite-strings-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wwrite-strings-1.c
new file mode 100644
index 000000000..03bb40941
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wwrite-strings-1.c
@@ -0,0 +1,8 @@
+/* Test pointer initialization and dereference don't lose qualifiers
+ on array types. This test wrongly failed to diagnose the loss of
+ const. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wwrite-strings" } */
+typedef char T[1];
+T *p = &""; /* { dg-warning "initialization from incompatible pointer type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-1.c
new file mode 100644
index 000000000..388cb3bf5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-1.c
@@ -0,0 +1,28 @@
+// { dg-do compile }
+// { dg-options "-Wstrict-aliasing=2 -fstrict-aliasing" }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Sep 2002 <nathan@codesourcery.com>
+
+// 8083. warn about odd casts
+
+typedef int YYSTYPE;
+typedef struct tDefEntry
+{
+ unsigned t;
+
+} tDefEntry;
+struct incomplete;
+
+
+YYSTYPE
+ addSibMacro(
+ YYSTYPE list )
+ {
+ tDefEntry** ppT = (tDefEntry**)&list; // { dg-warning "type-punned pointer will" "" }
+
+ struct incomplete *p = (struct incomplete *)&list; // { dg-warning "type-punning to incomplete" "" }
+
+ return list;
+ }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-10.c
new file mode 100644
index 000000000..6e9cb3f3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-10.c
@@ -0,0 +1,32 @@
+/* For PR tree-optimization/14784 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */
+
+typedef struct bitmap_element_def
+{
+ unsigned int indx;
+} bitmap_element;
+
+typedef struct bitmap_head_def {
+ bitmap_element *first;
+ int using_obstack;
+} bitmap_head;
+typedef struct bitmap_head_def *bitmap;
+
+bitmap_element *bitmap_free;
+
+void foo (bitmap head, bitmap_element *elt)
+{
+ while (1)
+ {
+ /* Alias analysis problems used to prevent us from recognizing
+ that this condition is invariant. */
+ if (head->using_obstack)
+ bitmap_free = elt;
+ }
+}
+
+
+/* { dg-final { scan-tree-dump-times "Unswitching" 1 "unswitch"} } */
+/* { dg-final { cleanup-tree-dump "unswitch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-11.c
new file mode 100644
index 000000000..36175d7c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-11.c
@@ -0,0 +1,111 @@
+/* { dg-do run } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+typedef struct dw_cfi_struct
+{
+ struct dw_cfi_struct *dw_cfi_next;
+ const char *dw_cfi_addr;
+}
+dw_cfi_node;
+
+typedef struct dw_fde_struct
+{
+ const char *dw_fde_current_label;
+ dw_cfi_node *dw_fde_cfi;
+}
+dw_fde_node;
+
+dw_cfi_node *cie_cfi_head;
+unsigned fde_table_in_use;
+dw_fde_node *fde_table;
+
+__inline__ void
+add_cfi (dw_cfi_node **list_head, dw_cfi_node *cfi)
+{
+ dw_cfi_node **p;
+
+ for (p = list_head; (*p) != ((void *)0); p = &(*p)->dw_cfi_next)
+ ;
+
+ *p = cfi;
+}
+
+__inline__ struct dw_cfi_struct *
+new_cfi (void)
+{
+ dw_cfi_node *cfi = (dw_cfi_node *) malloc (sizeof (dw_cfi_node));
+
+ memset (cfi, 0, sizeof (dw_cfi_node));
+ return cfi;
+}
+
+char *
+dwarf2out_cfi_label (void)
+{
+ static char label[20];
+ static unsigned long label_num = 0;
+
+ sprintf (label, "*.%s%u", "LCFI", (unsigned) (label_num++));
+ return label;
+}
+
+void
+add_fde_cfi (const char *label, dw_cfi_node *cfi)
+{
+ if (label)
+ {
+ dw_fde_node *fde = fde_table + fde_table_in_use - 1;
+
+ if (*label == 0)
+ label = dwarf2out_cfi_label ();
+
+ if (fde->dw_fde_current_label == ((void *)0)
+ || strcmp (label, fde->dw_fde_current_label))
+ {
+ dw_cfi_node *xcfi;
+
+ fde->dw_fde_current_label = label = strdup (label);
+
+ xcfi = new_cfi ();
+ xcfi->dw_cfi_addr = label;
+ add_cfi (&fde->dw_fde_cfi, xcfi);
+ }
+
+ add_cfi (&fde->dw_fde_cfi, cfi);
+ }
+ else
+ add_cfi (&cie_cfi_head, cfi);
+}
+
+int
+main ()
+{
+ dw_cfi_node *cfi;
+ dw_fde_node *fde;
+
+ fde_table_in_use = 1;
+ fde_table = (dw_fde_node *) realloc (fde_table,
+ sizeof (dw_fde_node));
+ memset (fde_table, 0, sizeof (dw_fde_node));
+ cfi = new_cfi ();
+ add_fde_cfi ("", cfi);
+
+ fde = &fde_table[0];
+ cfi = fde->dw_fde_cfi;
+
+ if (cfi == NULL)
+ abort ();
+
+ if (cfi->dw_cfi_addr == NULL)
+ abort ();
+
+ if (strcmp ("*.LCFI0", cfi->dw_cfi_addr))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-12.c
new file mode 100644
index 000000000..721716c2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-12.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2" } */
+static void f (void) __attribute__((alias("f"))); // { dg-error "part of alias cycle" "" }
+
+void g ()
+{
+ f ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-13.c
new file mode 100644
index 000000000..a8390d45c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-13.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2" } */
+static void f (void) __attribute__((alias("g"))); static void g (void) __attribute__((alias("f"))); // { dg-error "part of alias cycle" "" }
+
+void h ()
+{
+ f ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-2.c
new file mode 100644
index 000000000..d507416b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-2.c
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// { dg-options "-Wstrict-aliasing=2 -fstrict-aliasing" }
+
+struct foo {
+ char c;
+ char d;
+ short s;
+ int i;
+} bar;
+
+int
+sub1 (long long int foobar)
+{
+ struct foo *tmp = (struct foo *) &foobar; // { dg-warning "type-punned pointer might" "" }
+ return tmp->i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-3.c
new file mode 100644
index 000000000..3dc25a91c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "" } */
+
+extern int foo();
+
+int baz () { return foo(); }
+
+static inline int bar () __attribute__ ((alias ("foo"))); /* { dg-error "aliased to" } */
+
+int main () { return bar (); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-4.c
new file mode 100644
index 000000000..0a2633932
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-4.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2 -funit-at-a-time" } */
+
+extern int foo();
+
+int baz () { return foo(); }
+
+static inline int bar () __attribute__ ((alias ("foo"))); /* { dg-error "aliased to" } */
+
+int main () { return bar (); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-5.c
new file mode 100644
index 000000000..56848c9a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-5.c
@@ -0,0 +1,7 @@
+/* { dg-do link } */
+/* { dg-require-alias "" } */
+/* { dg-options "" } */
+
+static inline int foo () { return 0; }
+static int bar () __attribute__ ((alias ("foo")));
+int main () { return bar (); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-6.c
new file mode 100644
index 000000000..3ba101aa1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-6.c
@@ -0,0 +1,7 @@
+/* { dg-do link } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2 -funit-at-a-time" } */
+
+static inline int foo () { return 0; }
+static int bar () __attribute__ ((alias ("foo")));
+int main () { return bar (); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-7.c
new file mode 100644
index 000000000..591c3028e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-7.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x) #x
+
+int foo __asm__ (ASMNAME ("foo")) __attribute__((nocommon));
+extern __typeof (foo) bar __attribute__ ((weak, alias ("foo")));
+
+int
+main (void)
+{
+ if (&foo != &bar || foo || bar)
+ abort ();
+ return bar;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-8.c
new file mode 100644
index 000000000..8eba671a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-8.c
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-options "-Wstrict-aliasing=2 -fstrict-aliasing" }
+
+struct s {
+ char *p;
+};
+
+void
+func(struct s *ptr)
+{
+ *(void **)&ptr->p = 0; /* { dg-warning "type-punned pointer" "" { xfail *-*-* } } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/alias-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/alias-9.c
new file mode 100644
index 000000000..f8c100316
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/alias-9.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-Wstrict-aliasing=2 -O2" } */
+
+int a[2];
+
+double *foo1(void)
+{
+ return (double *)a; /* { dg-warning "strict-aliasing" } */
+}
+
+double *foo2(void)
+{
+ return (double *)&a[0]; /* { dg-warning "strict-aliasing" } */
+}
+
+_Complex x;
+int *bar(void)
+{
+ return (int *)&__imag x; /* { dg-warning "strict-aliasing" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/align-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/align-1.c
new file mode 100644
index 000000000..187eb5271
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/align-1.c
@@ -0,0 +1,28 @@
+/* PR java/10145
+ Test that requesting an alignment of 1 does not increase the alignment
+ of a long long field.
+
+ { dg-do run }
+ { dg-options "" }
+*/
+
+extern void abort (void);
+
+struct A
+{
+ char c;
+ long long i;
+};
+
+struct B
+{
+ char c;
+ long long i __attribute ((__aligned__ (1)));
+};
+
+int main ()
+{
+ if (sizeof (struct A) != sizeof (struct B))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/align-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/align-2.c
new file mode 100644
index 000000000..2001a153b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/align-2.c
@@ -0,0 +1,6 @@
+/* PR 17962 */
+/* { dg-do compile { target vect_natural_alignment } } */
+/* { dg-options "" } */
+
+typedef float v4 __attribute__((vector_size(sizeof(float)*4)));
+extern char compile_time_assert[__alignof__(v4) == sizeof(float)*4 ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/always_inline.c b/gcc-4.9/gcc/testsuite/gcc.dg/always_inline.c
new file mode 100644
index 000000000..482a0a2b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/always_inline.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+#include <stdarg.h>
+inline __attribute__ ((always_inline)) void
+e(int t, ...) /* { dg-error "variable argument lists" } */
+{
+ va_list q;
+ va_start (q, t);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/always_inline2.c b/gcc-4.9/gcc/testsuite/gcc.dg/always_inline2.c
new file mode 100644
index 000000000..4f1634e13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/always_inline2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+inline __attribute__ ((always_inline)) void t(void); /* { dg-error "body not available" } */
+void
+q(void)
+{
+ t(); /* { dg-error "called from here" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/always_inline3.c b/gcc-4.9/gcc/testsuite/gcc.dg/always_inline3.c
new file mode 100644
index 000000000..80ea31474
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/always_inline3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+int do_something_evil (void);
+inline __attribute__ ((always_inline)) void
+q2(void) /* { dg-error "recursive inlining" } */
+{
+ if (do_something_evil ())
+ return;
+ q2(); /* { dg-error "called from here" } */
+ q2(); /* With -O2 we don't warn here, it is eliminated by tail recursion. */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/and-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/and-1.c
new file mode 100644
index 000000000..c66e4e15f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/and-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "and" { target powerpc*-*-* spu-*-* } } } */
+/* There should be no nand for this testcase (for either PPC or SPU). */
+/* { dg-final { scan-assembler-not "nand" { target powerpc*-*-* spu-*-* } } } */
+
+int f(int y)
+{
+ return y & ~(y & -y);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-1.c
new file mode 100644
index 000000000..c599fa566
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-1.c
@@ -0,0 +1,56 @@
+/* { dg-options "-std=iso9899:1990 -pedantic" } */
+/* In strict ISO C mode, we don't recognize the anonymous struct/union
+ extension or any Microsoft extensions. */
+
+struct A { char a; };
+
+/* MS extension. */
+struct B {
+ struct A; /* { dg-warning "does not declare anything" } */
+ char b;
+};
+char testB[sizeof(struct B) == sizeof(struct A) ? 1 : -1];
+
+/* MS extension. */
+struct C {
+ struct D { char d; }; /* { dg-warning "does not declare anything" } */
+ char c;
+};
+char testC[sizeof(struct C) == sizeof(struct A) ? 1 : -1];
+char testD[sizeof(struct D) == sizeof(struct A) ? 1 : -1];
+
+/* GNU extension. */
+struct E {
+ struct { char z; }; /* { dg-warning "unnamed structs" } */
+ char e;
+};
+
+
+/* MS extension. */
+typedef struct A typedef_A;
+struct F {
+ typedef_A; /* { dg-warning "does not declare anything" } */
+ char f;
+};
+char testF[sizeof(struct F) == sizeof(struct A) ? 1 : -1];
+
+/* __extension__ enables GNU C mode for the duration of the declaration. */
+__extension__ struct G {
+ struct { char z; };
+ char g;
+};
+char testG[sizeof(struct G) == 2 * sizeof(struct A) ? 1 : -1];
+
+struct H {
+ __extension__ struct { char z; };
+ char h;
+};
+char testH[sizeof(struct H) == 2 * sizeof(struct A) ? 1 : -1];
+
+/* Make sure __extension__ gets turned back off. */
+struct I {
+ struct { char z; }; /* { dg-warning "unnamed structs" } */
+ char i;
+};
+char testI[sizeof(struct I) == sizeof(struct E) ? 1 : -1];
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-10.c
new file mode 100644
index 000000000..e212317ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-10.c
@@ -0,0 +1,57 @@
+/* Test for designated initializers for anonymous structures and
+ unions. PR 10676. */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct s
+{
+ int a;
+ struct
+ {
+ int b;
+ int c;
+ };
+ union
+ {
+ int d;
+ struct
+ {
+ int e;
+ };
+ };
+ struct
+ {
+ struct
+ {
+ struct
+ {
+ int f;
+ };
+ };
+ };
+};
+
+struct s x =
+ {
+ .e = 5,
+ .b = 4,
+ .a = 3,
+ .f = 7,
+ .c = 9
+ };
+
+int
+main (void)
+{
+ if (x.a != 3
+ || x.b != 4
+ || x.c != 9
+ || x.d != 5
+ || x.e != 5
+ || x.f != 7)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-11.c
new file mode 100644
index 000000000..c2f85fc24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-11.c
@@ -0,0 +1,111 @@
+/* { dg-do compile } */
+
+/* No special options--in particular, turn off the default
+ -pedantic-errors option. */
+/* { dg-options "" } */
+
+/* When not using -fplan9-extensions, we don't support automatic
+ conversion of pointer types, and we don't support referring to a
+ typedef name directly. */
+
+extern void exit (int);
+extern void abort (void);
+
+struct A { char a; };
+
+struct B {
+ char b;
+ struct A; /* { dg-warning "does not declare anything" } */
+ char c;
+};
+
+void
+f1 (struct A *p) /* { dg-message "expected" } */
+{
+ p->a = 1;
+}
+
+void
+test1 (void)
+{
+ struct B b;
+ struct A *p;
+
+ b.b = 2;
+ b.c = 3;
+ f1 (&b); /* { dg-warning "incompatible pointer type" } */
+ if (b.a != 1) /* { dg-error "no member" } */
+ abort ();
+ if (b.b != 2 || b.c != 3)
+ abort ();
+ p = &b; /* { dg-warning "incompatible pointer type" } */
+ if (p->a != 1)
+ abort ();
+}
+
+typedef struct { char d; } D;
+
+struct E {
+ char b;
+ struct F { char f; }; /* { dg-warning "does not declare anything" } */
+ char c;
+ union {
+ D; /* { dg-warning "does not declare anything" } */
+ };
+ char e;
+};
+
+void
+f2 (struct F *p) /* { dg-message "expected" } */
+{
+ p->f = 6;
+}
+
+void
+f3 (D *p) /* { dg-message "expected" } */
+{
+ p->d = 4;
+}
+
+void
+f4 (D d)
+{
+}
+
+void
+test2 (void)
+{
+ struct E e;
+ struct F *pf;
+ D *pd;
+ D d;
+
+ e.b = 2;
+ e.c = 3;
+ e.e = 5;
+ f2 (&e); /* { dg-warning "incompatible pointer type" } */
+ f3 (&e); /* { dg-warning "incompatible pointer type" } */
+ if (e.d != 4) /* { dg-error "no member" } */
+ abort ();
+ if (e.f != 6) /* { dg-error "no member" } */
+ abort ();
+ if (e.b != 2 || e.c != 3 || e.e != 5)
+ abort ();
+ pf = &e; /* { dg-warning "incompatible pointer type" } */
+ if (pf->f != 6)
+ abort ();
+ pd = &e; /* { dg-warning "incompatible pointer type" } */
+ if (pd->d != 4)
+ abort ();
+ d = e.D; /* { dg-error "no member" } */
+ f3 (&e.D); /* { dg-error "no member" } */
+ f4 (e.D); /* { dg-error "no member" } */
+}
+
+int
+main ()
+{
+ test1 ();
+ test2 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-12.c
new file mode 100644
index 000000000..60cd17822
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-12.c
@@ -0,0 +1,108 @@
+/* { dg-do run } */
+/* { dg-options "-fplan9-extensions" } */
+
+/* When using -fplan9-extensions, we support automatic conversion of
+ pointer types, and we support referring to a typedef name
+ directly. */
+
+extern void exit (int);
+extern void abort (void);
+
+struct A { char a; };
+
+struct B {
+ char b;
+ struct A;
+ char c;
+};
+
+void
+f1 (struct A *p)
+{
+ p->a = 1;
+}
+
+void
+test1 (void)
+{
+ struct B b;
+ struct A *p;
+
+ b.b = 2;
+ b.c = 3;
+ f1 (&b);
+ if (b.a != 1)
+ abort ();
+ if (b.b != 2 || b.c != 3)
+ abort ();
+ p = &b;
+ if (p->a != 1)
+ abort ();
+}
+
+typedef struct { char d; } D;
+
+struct E {
+ char b;
+ struct F { char f; };
+ char c;
+ union {
+ D;
+ };
+ char e;
+};
+
+void
+f2 (struct F *p)
+{
+ p->f = 6;
+}
+
+void
+f3 (D *p)
+{
+ p->d = 4;
+}
+
+void
+f4 (D d)
+{
+}
+
+void
+test2 (void)
+{
+ struct E e;
+ struct F *pf;
+ D *pd;
+ D d;
+
+ e.b = 2;
+ e.c = 3;
+ e.e = 5;
+ f2 (&e);
+ f3 (&e);
+ if (e.d != 4)
+ abort ();
+ if (e.f != 6)
+ abort ();
+ if (e.b != 2 || e.c != 3 || e.e != 5)
+ abort ();
+ pf = &e;
+ if (pf->f != 6)
+ abort ();
+ pd = &e;
+ if (pd->d != 4)
+ abort ();
+ d = e.D;
+ f3 (&e.D);
+ f4 (e.D);
+}
+
+int
+main ()
+{
+ test1 ();
+ test2 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-13.c
new file mode 100644
index 000000000..6a508141b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-13.c
@@ -0,0 +1,76 @@
+/* { dg-do compile } */
+/* { dg-options "-fplan9-extensions" } */
+
+/* Test for ambiguity when using the Plan 9 extensions. */
+
+struct A {
+ char a; /* { dg-error "duplicate member" } */
+};
+
+struct B
+{
+ struct A;
+ struct A;
+};
+
+char
+f1 (struct B *p)
+{
+ return p->a; /* { dg-error "no member" } */
+}
+
+void
+f2 (struct A *p) /* { dg-message "expected" } */
+{
+}
+
+void
+f3 (struct B *p)
+{
+ f2 (p); /* { dg-warning "incompatible pointer type" } */
+}
+
+struct C
+{
+ char c; /* { dg-error "duplicate member" } */
+};
+
+struct D
+{
+ struct C;
+};
+
+struct E
+{
+ struct C;
+ struct D;
+};
+
+char
+f4 (struct E *p)
+{
+ return p->c; /* { dg-error "no member" } */
+}
+
+void
+f6 (struct C *p) /* { dg-message "expected" } */
+{
+}
+
+void
+f7 (struct E *p)
+{
+ f6 (p); /* { dg-warning "incompatible pointer type" } */
+}
+
+struct A
+f8 (struct B *p)
+{
+ return p->A; /* { dg-error "no member" } */
+}
+
+struct C
+f9 (struct E *p)
+{
+ return p->C; /* { dg-error "no member" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-14.c
new file mode 100644
index 000000000..293ccc75a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-14.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-fplan9-extensions" } */
+
+/* When using Plan 9 extensions, a typedef can conflict with an
+ anonymous field. */
+
+typedef struct { int a; } s1;
+struct s2 { s1; int s1; }; /* { dg-error "duplicate" } */
+int f(struct s2 *p) { return p->s1; } /* { dg-error "incompatible" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c
new file mode 100644
index 000000000..d9e786a8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-15.c
@@ -0,0 +1,16 @@
+/* Test diagnostics for duplicate field names involving anonymous
+ struct or union as first field. PR 46889. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct foo {
+ union {
+ struct {
+ unsigned long time_stamp;
+ };
+ struct {
+ int *page;
+ };
+ };
+ int *page; /* { dg-error "duplicate member" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-2.c
new file mode 100644
index 000000000..4bd2d0f33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-2.c
@@ -0,0 +1,48 @@
+/* { dg-options "-std=gnu89" } */
+/* In GNU C mode, we recognize the anonymous struct/union extension,
+ but not Microsoft extensions. */
+
+struct A { char a; };
+
+/* MS extension. */
+struct B {
+ struct A; /* { dg-warning "does not declare anything" } */
+ char b;
+};
+char testB[sizeof(struct B) == sizeof(struct A) ? 1 : -1];
+
+/* MS extension. */
+struct C {
+ struct D { char d; }; /* { dg-warning "does not declare anything" } */
+ char c;
+};
+char testC[sizeof(struct C) == sizeof(struct A) ? 1 : -1];
+char testD[sizeof(struct D) == sizeof(struct A) ? 1 : -1];
+
+/* GNU extension. */
+struct E {
+ struct { char z; };
+ char e;
+};
+char testE[sizeof(struct E) == 2 * sizeof(struct A) ? 1 : -1];
+
+/* MS extension. */
+typedef struct A typedef_A;
+struct F {
+ typedef_A; /* { dg-warning "does not declare anything" } */
+ char f;
+};
+char testF[sizeof(struct F) == sizeof(struct A) ? 1 : -1];
+
+/* Test that __extension__ does the right thing coming _from_ GNU C mode. */
+__extension__ struct G {
+ struct { char z; };
+ char g;
+};
+char testG[sizeof(struct G) == 2 * sizeof(struct A) ? 1 : -1];
+
+struct H {
+ struct { char z; };
+ char h;
+};
+char testH[sizeof(struct H) == 2 * sizeof(struct A) ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-3.c
new file mode 100644
index 000000000..3ed6e672b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-3.c
@@ -0,0 +1,32 @@
+/* { dg-options "-std=gnu89 -fms-extensions" } */
+/* Enabling Microsoft mode makes all of the tests equivalent. Checked vs
+ Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
+ */
+
+struct A { char a; };
+
+struct B {
+ struct A;
+ char b;
+};
+char testB[sizeof(struct B) == 2 * sizeof(struct A) ? 1 : -1];
+
+struct C {
+ struct D { char d; };
+ char c;
+};
+char testC[sizeof(struct C) == 2 * sizeof(struct A) ? 1 : -1];
+char testD[sizeof(struct D) == sizeof(struct A) ? 1 : -1];
+
+struct E {
+ struct { char z; };
+ char e;
+};
+char testE[sizeof(struct E) == 2 * sizeof(struct A) ? 1 : -1];
+
+typedef struct A typedef_A;
+struct F {
+ typedef_A;
+ char f;
+};
+char testF[sizeof(struct F) == 2 * sizeof(struct A) ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-4.c
new file mode 100644
index 000000000..dc30b0cc0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-4.c
@@ -0,0 +1,10 @@
+/* Test anonymous structures with type qualifiers. Bug 8420. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+struct s {
+ struct { int a; };
+ const struct { int b; };
+ struct { int c; } volatile;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-5.c
new file mode 100644
index 000000000..af1690ed3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-5.c
@@ -0,0 +1,7 @@
+/* Test bad warning for anonymous int in structure. Bug 17189. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+struct Foo { int; }; /* { dg-bogus "unnamed" } */
+/* { dg-error "declaration does not declare anything" "int;" { target *-*-* } 5 } */
+/* { dg-error "struct has no members" "no members" { target *-*-* } 5 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-6.c
new file mode 100644
index 000000000..8ce14f484
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-6.c
@@ -0,0 +1,12 @@
+/* Test diagnostics for structure member with no type specifier or
+ declarator. Test with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s {
+ int a;
+ const;
+};
+/* { dg-warning "useless type qualifier in empty declaration" "empty" { target *-*-* } 9 } */
+/* { dg-warning "empty declaration" "empty 2" { target *-*-* } 9 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-7.c
new file mode 100644
index 000000000..0f05583c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-7.c
@@ -0,0 +1,10 @@
+/* Test diagnostics for structure member with no type specifier or
+ declarator. Test with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+struct s {
+ int a;
+ const; /* { dg-warning "ISO C forbids member declarations with no members" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-8.c
new file mode 100644
index 000000000..66db0834e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-8.c
@@ -0,0 +1,10 @@
+/* Test diagnostics for structure member with no type specifier or
+ declarator. Test with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+struct s {
+ int a;
+ const; /* { dg-error "ISO C forbids member declarations with no members" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-9.c
new file mode 100644
index 000000000..d22349045
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/anon-struct-9.c
@@ -0,0 +1,129 @@
+/* Test for diagnostics for duplicate member names in anonymous
+ structures and unions. PR 4784. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s1
+{
+ int x;
+ struct
+ {
+ int x; /* { dg-error "duplicate member" } */
+ };
+};
+
+struct s2
+{
+ struct
+ {
+ int a;
+ struct
+ {
+ int b;
+ };
+ };
+ struct
+ {
+ int b; /* { dg-error "duplicate member" } */
+ };
+};
+
+struct s3
+{
+ struct
+ {
+ int a;
+ struct
+ {
+ int b;
+ };
+ };
+ struct
+ {
+ int b; /* { dg-error "duplicate member" } */
+ int c;
+ };
+};
+
+struct s4
+{
+ int x;
+ struct
+ {
+ int x;
+ } y;
+};
+
+union u1
+{
+ int x;
+ union
+ {
+ int x; /* { dg-error "duplicate member" } */
+ };
+};
+
+union u2
+{
+ union
+ {
+ int a;
+ union
+ {
+ int b;
+ };
+ };
+ union
+ {
+ int b; /* { dg-error "duplicate member" } */
+ };
+};
+
+union u3
+{
+ union
+ {
+ int a;
+ union
+ {
+ int b;
+ };
+ };
+ union
+ {
+ int b; /* { dg-error "duplicate member" } */
+ int c;
+ };
+};
+
+union u4
+{
+ int x;
+ union
+ {
+ int x;
+ } y;
+};
+
+#define D10(x) int x##0; int x##1; int x##2; int x##3; int x##4; int x##5; int x##6; int x##7; int x##8; int x##9;
+#define D100(x) D10(x##0) D10(x##1) D10(x##2) D10(x##3) D10(x##4) D10(x##5) D10(x##6) D10(x##7) D10(x##8) D10(x##9)
+
+#define S10(x) struct { D100(x##0) }; struct { D100(x##1) }; struct { D100(x##2) }; struct { D100(x##3) }; struct { D100(x##4) }; struct { D100(x##5) }; struct { D100(x##6) }; struct { D100(x##7) }; struct { D100(x##8) }; struct { D100(x##9) };
+
+struct sbig
+{
+ S10(a)
+ S10(b)
+ S10(c)
+ S10(d)
+ S10(e)
+ S10(f)
+ S10(g)
+ S10(h)
+ S10(j)
+ S10(k)
+ struct
+ {
+ int a123; /* { dg-error "duplicate member" } */
+ };
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-1.c
new file mode 100644
index 000000000..6d1e69a17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-1.c
@@ -0,0 +1,15 @@
+/* Simplified from ncurses 5.0's pad.c
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ Copyright (C) 1999 Free Software Foundation */
+
+/* { dg-do compile } */
+
+extern char foo[1];
+char foo[] = "";
+
+int
+bar()
+{
+ return foo[0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-10.c
new file mode 100644
index 000000000..44457d12c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-10.c
@@ -0,0 +1,33 @@
+/* Test invalid array sizes at file scope: should not cause ICEs.
+ Bugs 25161 and 27020. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int a;
+
+int b0[a]; /* { dg-error "5:at file scope" } */
+int (*b1)[a]; /* { dg-error "7:at file scope" } */
+int (*b2())[a]; /* { dg-error "at file scope" } */
+struct b3 { int x[a]; }; /* { dg-error "17:at file scope" } */
+struct b4 { int (*x)[a]; }; /* { dg-error "19:at file scope" } */
+typeof (int [a]) b5; /* { dg-error "at file scope|outside of any function" } */
+
+int c0[(__UINTPTR_TYPE__)&a]; /* { dg-error "5:at file scope" } */
+int (*c1)[(__UINTPTR_TYPE__)&a]; /* { dg-error "7:at file scope" } */
+int (*c2())[(__UINTPTR_TYPE__)&a]; /* { dg-error "7:at file scope" } */
+struct c3 { int x[(__UINTPTR_TYPE__)&a]; }; /* { dg-error "17:at file scope" } */
+struct c4 { int (*x)[(__UINTPTR_TYPE__)&a]; }; /* { dg-error "19:at file scope" } */
+typeof (int [(__UINTPTR_TYPE__)&a]) c5; /* { dg-error "37:at file scope" } */
+
+int d0[1/0]; /* { dg-error "5:at file scope" } */
+/* { dg-warning "9:division by zero" "" { target *-*-* } 23 } */
+int (*d1)[1/0]; /* { dg-error "7:at file scope" } */
+/* { dg-warning "12:division by zero" "" { target *-*-* } 25 } */
+int (*d2())[1/0]; /* { dg-error "7:at file scope" } */
+/* { dg-warning "14:division by zero" "" { target *-*-* } 27 } */
+struct d3 { int x[1/0]; }; /* { dg-error "17:at file scope" } */
+/* { dg-warning "20:division by zero" "" { target *-*-* } 29 } */
+struct d4 { int (*x)[1/0]; }; /* { dg-error "19:at file scope" } */
+/* { dg-warning "23:division by zero" "" { target *-*-* } 31 } */
+typeof (int [1/0]) d5; /* { dg-error "20:at file scope" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-2.c
new file mode 100644
index 000000000..497c58666
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Verify that we can't do things to get ourselves in trouble
+ with GCC's initialized flexible array member extension. */
+
+struct f { int w; int x[]; };
+struct g { struct f f; };
+struct g g1 = { { 0, { } } };
+struct g g2 = { { 0, { 1 } } }; /* { dg-error "nested context" "nested" } */
+ /* { dg-error "near init" "near" { target *-*-* } 10 } */
+struct h { int x[0]; int y; };
+struct h h1 = { { 0 }, 1 }; /* { dg-warning "excess elements" "excess" } */
+ /* { dg-warning "near init" "before end" { target *-*-* } 13 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-3.c
new file mode 100644
index 000000000..f0709d220
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* ISO C99 flexible array members don't have a size. GCC's zero-length
+ array extension does. */
+
+struct f { int w; int x[0]; } f;
+struct g { int w; int x[]; } g;
+
+char test_gcc[sizeof (f.x) ? -1 : 1];
+char test_iso[sizeof (g.x) ? -1 : 1]; /* { dg-error "incomplete type" "iso" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-4.c
new file mode 100644
index 000000000..b3e4f6c50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-4.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "" } */
+
+/* Verify that GCC's initialized flexible array member extension
+ works properly. */
+
+extern void abort(void);
+extern void exit(int);
+
+struct f { int w; int x[]; };
+struct g { int w; int x[0]; };
+
+static struct f f = { 4, { 0, 1, 2, 3 } };
+static int junk1[] = { -1, -1, -1, -1 };
+static struct g g = { 4, { 0, 1, 2, 3 } }; /* { dg-warning "(excess elements)|(near initialization)" "" } */
+static int junk2[] = { -1, -1, -1, -1 };
+
+int main()
+{
+ int i;
+ for (i = 0; i < f.w; ++i)
+ if (f.x[i] != i)
+ abort ();
+ exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-5.c
new file mode 100644
index 000000000..4083c92ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-5.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Check compatibility of array declarations. */
+
+/* Incomplete decl matches. */
+extern char arr0[];
+char arr0[1];
+
+/* Two integral expressions must be the same. Note that 0 is
+ a gcc extension, but it should work like any other constant. */
+extern char arr1[1];
+char arr1[1];
+extern char arr2[0];
+char arr2[0];
+extern char arr3[0]; /* { dg-message "note: previous declaration" } */
+char arr3[1]; /* { dg-error "conflicting types" } */
+
+/* Variable size matches. */
+void func(int n, int m)
+{
+ /* The next two are from the example in c99 6.7.5.2/9. */
+ {
+ /* Invalid: not compatible because 4 != 6. */
+ int a[n][6][m];
+ int (*p)[4][n+1];
+ p = a; /* { dg-warning "incompatible" } */
+ }
+ {
+ /* Compatible, but defined behavior only if n == 6 and m == n+1. */
+ int c[n][n][6][m];
+ int (*r)[n][n][n+1];
+ r = c;
+ }
+ {
+ /* Compatible, but undefined behavior; (2, 2) is not a constant
+ expression, and thus A is a VLA. */
+ int a[6][(2, 2)];
+ int (*p)[3];
+ p = a; /* { dg-bogus "incompatible" "bad vla handling" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-6.c
new file mode 100644
index 000000000..6ef64625b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-6.c
@@ -0,0 +1,18 @@
+/* PR c/5597 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Verify that GCC forbids non-static initialization of
+ flexible array members. */
+
+struct str { int len; char s[]; };
+
+struct str a = { 2, "a" };
+
+void foo()
+{
+ static struct str b = { 2, "b" };
+ struct str c = { 2, "c" }; /* { dg-error "(non-static)|(near initialization)" } */
+ struct str d = (struct str) { 2, "d" }; /* { dg-error "(non-static)|(near initialization)" } */
+ struct str e = (struct str) { d.len, "e" }; /* { dg-error "(non-static)|(initialization)" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-7.c
new file mode 100644
index 000000000..9e70b2682
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-7.c
@@ -0,0 +1,14 @@
+/* Test for array of incomplete structure type - Zack Weinberg in
+ <http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00108.html>. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct foo;
+
+void
+f (void)
+{
+ struct foo { int a; int b; };
+}
+
+struct foo array[5]; /* { dg-error "array type has incomplete element type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-8.c
new file mode 100644
index 000000000..d469a80ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-8.c
@@ -0,0 +1,49 @@
+/* Test diagnostics for array references. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+struct s { char c[1]; };
+struct s f (void);
+_Bool b;
+char c;
+enum e { E } e;
+extern int a[];
+int *p;
+void *pv;
+void (*fp)(void);
+struct si *sip;
+
+void
+g (void)
+{
+ a[b];
+ a[c];
+ a[e];
+ p[b];
+ p[c];
+ p[e];
+ b[a];
+ c[a];
+ e[a];
+ b[p];
+ c[p];
+ e[p];
+ /* These two should be treated the same. In particular, a "neither
+ array nor pointer" bogus warning used to be given for the
+ second. */
+ f().c[0];
+ 0[f().c];
+ /* Various invalid cases. */
+ c[c]; /* { dg-error "subscripted value is neither array nor pointer nor vector" } */
+ p[1.0]; /* { dg-error "array subscript is not an integer" } */
+ 1.0[a]; /* { dg-error "array subscript is not an integer" } */
+ fp[0]; /* { dg-error "subscripted value is pointer to function" } */
+ 0[fp]; /* { dg-error "subscripted value is pointer to function" } */
+ pv[0]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ 0[pv]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ sip[0]; /* { dg-error "invalid use of undefined type 'struct si'" } */
+ /* { dg-error "dereferencing pointer to incomplete type" "incomplete" { target *-*-* } 45 } */
+ 0[sip]; /* { dg-error "invalid use of undefined type 'struct si'" } */
+ /* { dg-error "dereferencing pointer to incomplete type" "incomplete" { target *-*-* } 47 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-9.c
new file mode 100644
index 000000000..f173f6569
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-9.c
@@ -0,0 +1,10 @@
+/* PR target/27421 */
+/* { dg-do compile } */
+
+struct A
+{
+ int i;
+ void x[1]; /* { dg-error "array of voids" } */
+};
+
+void foo(struct A a) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-const-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-const-1.c
new file mode 100644
index 000000000..0e0c46224
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-const-1.c
@@ -0,0 +1,8 @@
+/* Test for array designators not integer constant expressions but
+ folding to integer constants (used in Linux kernel,
+ <http://gcc.gnu.org/ml/gcc/2009-04/msg00611.html>). */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+extern int i;
+int a[] = { [1 ? 1 : i] = 0 };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-const-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-const-2.c
new file mode 100644
index 000000000..f6e2bd5bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-const-2.c
@@ -0,0 +1,9 @@
+/* Test for array designators not integer constant expressions but
+ folding to integer constants (used in Linux kernel,
+ <http://gcc.gnu.org/ml/gcc/2009-04/msg00611.html>). */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+extern int i;
+int a[] = { [1 ? 1 : i] = 0 }; /* { dg-warning "array index in initializer is not an integer constant expression" } */
+/* { dg-warning "near initialization" "near init" { target *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-const-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-const-3.c
new file mode 100644
index 000000000..5bb215cbd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-const-3.c
@@ -0,0 +1,9 @@
+/* Test for array designators not integer constant expressions but
+ folding to integer constants (used in Linux kernel,
+ <http://gcc.gnu.org/ml/gcc/2009-04/msg00611.html>). */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+extern int i;
+int a[] = { [1 ? 1 : i] = 0 }; /* { dg-error "array index in initializer is not an integer constant expression" } */
+/* { dg-error "near initialization" "near init" { target *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c
new file mode 100644
index 000000000..14ec9552e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-init-1.c
@@ -0,0 +1,25 @@
+/* Test that both arrays are initialized by store_by_pieces. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+struct A { char c[10]; };
+extern void baz (struct A *);
+
+void
+foo (void)
+{
+ struct A a = { "abcdefghi" };
+ baz (&a);
+}
+
+void
+bar (void)
+{
+ struct A a;
+ __builtin_strcpy (&a.c[0], "abcdefghi");
+ baz (&a);
+}
+
+/* { dg-final { scan-assembler-not "abcdefghi" { target i?86-*-* x86_64-*-* ia64-*-* } } } */
+/* { dg-final { scan-assembler-times "7017280452245743464\|7523094288207667809\|6867666564636261\|1684234849\|64636261" 2 { target i?86-*-* x86_64-*-* ia64-*-* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-init-2.c
new file mode 100644
index 000000000..9c425818f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-init-2.c
@@ -0,0 +1,51 @@
+/* Test array initializion by store_by_pieces. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+struct A { char c[10]; };
+extern void abort (void);
+
+void
+__attribute__((noinline))
+check (struct A * a, int b)
+{
+ const char *p;
+ switch (b)
+ {
+ case 0:
+ p = "abcdefghi";
+ break;
+ case 1:
+ p = "j\0\0\0\0\0\0\0\0";
+ break;
+ case 2:
+ p = "kl\0\0\0\0\0\0\0";
+ break;
+ case 3:
+ p = "mnop\0\0\0\0\0";
+ break;
+ case 4:
+ p = "qrstuvwx\0";
+ break;
+ default:
+ abort ();
+ }
+ if (__builtin_memcmp (a->c, p, 10) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct A a = { "abcdefghi" };
+ check (&a, 0);
+ struct A b = { "j" };
+ check (&b, 1);
+ struct A c = { "kl" };
+ check (&c, 2);
+ struct A d = { "mnop" };
+ check (&d, 3);
+ struct A e = { "qrstuvwx" };
+ check (&e, 4);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-quals-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-quals-1.c
new file mode 100644
index 000000000..17df98378
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-quals-1.c
@@ -0,0 +1,30 @@
+/* Test for various combinations of const, arrays and typedefs:
+ should never actually get const on the final array type, but
+ all should end up in a read-only section. PR c/12165. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* The MMIX port always switches to the .data section at the end of a file. */
+/* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* x86_64-*-mingw* picochip--*-* } } } */
+static const int a[2] = { 1, 2 };
+const int a1[2] = { 1, 2 };
+typedef const int ci;
+static ci b[2] = { 3, 4 };
+ci b1[2] = { 3, 4 };
+typedef int ia[2];
+static const ia c = { 5, 6 };
+const ia c1 = { 5, 6 };
+typedef const int cia[2];
+static cia d = { 7, 8 };
+cia d1 = { 7, 8 };
+static cia e[2] = { { 1, 2 }, { 3, 4 } };
+cia e1[2] = { { 1, 2 }, { 3, 4 } };
+void *const p = &a;
+void *const q = &b;
+void *const r = &c;
+void *const s = &d;
+void *const t = &e;
+void *const p1 = &a1;
+void *const q1 = &b1;
+void *const r1 = &c1;
+void *const s1 = &d1;
+void *const t1 = &e1;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/array-quals-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/array-quals-2.c
new file mode 100644
index 000000000..2f1304e2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/array-quals-2.c
@@ -0,0 +1,14 @@
+/* Test that pointers to arrays of differently qualified types aren't
+ permitted in conditional expressions, and that qualifiers aren't
+ lost in forming composite types. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+typedef const char T[1];
+typedef const char T2[1];
+typedef volatile char U[1];
+T *p;
+T2 *p2;
+U *q;
+void *f(void) { return 1 ? p : q; } /* { dg-warning "pointer type mismatch in conditional expression" } */
+T *g(void) { return 1 ? p : p2; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asan/asan.exp b/gcc-4.9/gcc/testsuite/gcc.dg/asan/asan.exp
new file mode 100644
index 000000000..9be07fca1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asan/asan.exp
@@ -0,0 +1,40 @@
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib asan-dg.exp
+
+if ![check_effective_target_faddress_sanitizer] {
+ return
+}
+
+# Initialize `dg'.
+dg-init
+if [asan_init] {
+
+# Main loop.
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common/asan/*.c]] ""
+
+}
+
+# All done.
+asan_finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asan/nosanitize-and-inline.c b/gcc-4.9/gcc/testsuite/gcc.dg/asan/nosanitize-and-inline.c
new file mode 100644
index 000000000..585380162
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asan/nosanitize-and-inline.c
@@ -0,0 +1,57 @@
+/* { dg-do run } */
+
+/* This is a simplified version of what Emacs does internally,
+ when marking its stack. */
+
+static unsigned long sum;
+static void *stack_base;
+
+/* A simple substitute for what Emacs actually does. */
+static void
+mark_maybe_pointer (void *p)
+{
+ sum ^= (unsigned long) p;
+}
+
+static inline void __attribute__ ((no_sanitize_address))
+mark_memory (void **start, void **end)
+{
+ void **pp;
+
+ if (end < start)
+ {
+ void **tem = start;
+ start = end;
+ end = tem;
+ }
+
+ for (pp = start; pp < end; pp++)
+ {
+ /* This is the dereference that we don't want sanitized. */
+ void *p = *pp;
+
+ mark_maybe_pointer (p);
+ }
+}
+
+static void
+mark_stack (void)
+{
+ void *end;
+ mark_memory (stack_base, &end);
+}
+
+void
+garbage_collect (void)
+{
+ mark_stack ();
+}
+
+int
+main (void)
+{
+ void *dummy;
+ stack_base = &dummy;
+ garbage_collect ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asan/pr56417.c b/gcc-4.9/gcc/testsuite/gcc.dg/asan/pr56417.c
new file mode 100644
index 000000000..b7eabf125
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asan/pr56417.c
@@ -0,0 +1,9 @@
+/* PR sanitizer/56417 */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+int
+foo (void)
+{
+ return __builtin_strlen (&foo);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-1.c
new file mode 100644
index 000000000..fecac780f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+struct x {
+ int selector;
+};
+
+void f()
+{
+ struct x* addr;
+ __asm__("mov %%gs,%0":"=r" ((unsigned short)addr->selector)); /* { dg-error "lvalue" "casts make rvalues" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-2.c
new file mode 100644
index 000000000..9c464ce89
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f()
+{
+ asm volatile ("foo%%bar" : : );
+}
+
+/* { dg-final { scan-assembler "foo%bar" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-3.c
new file mode 100644
index 000000000..917942d7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f()
+{
+ asm ("foo%%bar");
+}
+
+/* { dg-final { scan-assembler "foo%%bar" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-4.c
new file mode 100644
index 000000000..00675982a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int main()
+{
+ int x, y, z;
+
+ asm volatile ("test0 X%0Y%[arg]Z" : [arg] "=g" (x));
+ asm volatile ("test1 X%[out]Y%[in]Z" : [out] "=g" (y) : [in] "0"(y));
+ asm volatile ("test2 X%a0Y%a[arg]Z" : : [arg] "p" (&z));
+ asm volatile ("test3 %[in]" : [inout] "=g"(x) : "[inout]" (x), [in] "g" (y));
+}
+
+/* ??? Someone explain why the back reference dosn't work. */
+/* { dontdg-final { scan-assembler "test0 X(.*)Y\1Z" } } */
+/* { dontdg-final { scan-assembler "test1 X(.*)Y\1Z" } } */
+/* { dontdg-final { scan-assembler "test2 X(.*)Y\1Z" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-6.c
new file mode 100644
index 000000000..9c0ac1eb2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-6.c
@@ -0,0 +1,7 @@
+/* Check error messages for named asm operands. */
+void foo ()
+{
+ int i;
+ __asm__ ("" : [data] "=r" (i) : [data] "i" (100)); /* { dg-error "duplicate asm operand" } */
+ __asm__ ("%[foo]" :: [bar] "i" (1)); /* { dg-error "undefined named operand" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-7.c
new file mode 100644
index 000000000..65b0353fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-7.c
@@ -0,0 +1,28 @@
+/* Gcc 3.3.1 deprecates memory inputs of non-lvalues. */
+/* { dg-do compile } */
+
+void test(void)
+{
+ register int r;
+ register int r2;
+ int i;
+ static int m;
+ int *p;
+
+ __asm__ ("" : : "m"(r)); /* { dg-error "" } */
+ __asm__ ("" : : "m"(i));
+ __asm__ ("" : : "m"(m));
+ __asm__ ("" : : "m"(0)); /* { dg-error "" } */
+ __asm__ ("" : : "m"(i+1)); /* { dg-error "" } */
+ __asm__ ("" : : "m"(*p++));
+
+ __asm__ ("" : : "g"(r));
+ __asm__ ("" : : "g"(i));
+ __asm__ ("" : : "g"(m));
+ __asm__ ("" : : "g"(0));
+ __asm__ ("" : : "g"(i+1));
+
+ __asm__ ("" : "=m"(r2)); /* { dg-error "" } */
+ __asm__ ("" : "=m"(i));
+ __asm__ ("" : "=m"(m));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-8.c
new file mode 100644
index 000000000..a3f3962eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-8.c
@@ -0,0 +1,9 @@
+/* PR inline-asm/11676 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+void foo(void)
+{
+ long x = 0;
+ asm volatile ("" : "=r"(x) : "r"(x)); /* { dg-bogus "uninitialized" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-9.c
new file mode 100644
index 000000000..4e3244169
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-9.c
@@ -0,0 +1,11 @@
+/* PR inline-asm/15740 */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+void foo(void)
+{
+ int a, b;
+ a = 1;
+ b = a + 1;
+ asm ("" : : "m" (a));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-a.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-a.c
new file mode 100644
index 000000000..a676c9ebc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-a.c
@@ -0,0 +1,15 @@
+/* { dg-options "-O2" } */
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+
+/* The problem was we were not striping the long cast here.
+ Note this really should be invalid code but not for the
+ current release (4.0) as we have people using it. */
+
+void blockCopy_MMX2(int*);
+void postProcess_MMX2()
+{
+ int c, x,y, width;
+ asm( "" :: "m" ((long)x));
+ blockCopy_MMX2(&c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-b.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-b.c
new file mode 100644
index 000000000..f888839ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-b.c
@@ -0,0 +1,39 @@
+/* { dg-do run { target powerpc*-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O1" } */
+/* Test to make sure that inline-asm causes the tree optimizers to get the
+ V_MAY_DEFs and clobber memory. */
+/* Test from Jakub Jelinek, modified by Andrew Pinski to work on all powerpc targets. */
+extern void abort (void);
+
+unsigned short v = 0x0300;
+
+void
+foo (unsigned short *p)
+{
+ *p = v;
+}
+
+int
+bar (void)
+{
+ unsigned short x;
+ volatile unsigned short *z;
+ foo (&x);
+ const unsigned int y = x;
+ z = &x;
+#if defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) || defined (_POWER) || defined (__ppc64__) || defined (__ppc)
+ __asm __volatile ("sthbrx %1,0,%2" : "=m" (*z) : "r" (y), "r" (z));
+#elif defined __i386__ || defined __x86_64__
+ __asm __volatile ("movb %b1,1(%2)\n\tmovb %h1,(%2)"
+ : "=m" (*z) : "Q" (y), "R" (z));
+#endif
+ return (x & 1) == 0;
+}
+
+int
+main (void)
+{
+ if (bar ())
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-fs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-fs-1.c
new file mode 100644
index 000000000..f215ee8ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-fs-1.c
@@ -0,0 +1,14 @@
+/* Origin: <hp@bitrange.com>
+ Make sure we do not get spurious '*' characters in section names or
+ elsewhere, with asm-specified names. */
+/* { dg-do compile } */
+/* { dg-options "-w -ffunction-sections -fdata-sections" } */
+
+void foo (void) asm ("_bar");
+void foo (void) {}
+
+extern int foobar asm ("_baz");
+int foobar = 3;
+
+/* { dg-final { scan-assembler-not "\\*_bar" } } */
+/* { dg-final { scan-assembler-not "\\*_baz" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-names.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-names.c
new file mode 100644
index 000000000..f5e44e65f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-names.c
@@ -0,0 +1,16 @@
+/* The name specified by an asm("...") suffix on a declaration is not
+ to have an underscore prefixed, even if normal symbols are.
+ Problem reported by Krister Walfridsson <cato@df.lth.se>. */
+
+/* { dg-do compile } */
+/* { dg-options "-fleading-underscore" } */
+/* { dg-final { scan-assembler-not "____frob14" } } */
+
+extern void frobnicate (void) asm ("___frob14"); /* three underscores */
+
+int
+main (void)
+{
+ frobnicate ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-pr24146.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-pr24146.c
new file mode 100644
index 000000000..0b1be7da7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-pr24146.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+/* Test that asm with no outputs are treated as volatile. */
+
+void f(int x)
+{
+ __asm__ ("extended asm not discarded" : : "r" (x));
+}
+
+void g (void)
+{
+ __asm__ ("simple asm not discarded");
+}
+/* { dg-final { scan-assembler "extended asm not discarded" } } */
+/* { dg-final { scan-assembler "simple asm not discarded" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-qual-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-qual-1.c
new file mode 100644
index 000000000..5ec9a29a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-qual-1.c
@@ -0,0 +1,12 @@
+/* Test that qualifiers other than volatile are ignored on asm. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void
+f (void)
+{
+ asm volatile ("");
+ asm const (""); /* { dg-warning "const qualifier ignored on asm" } */
+ asm restrict (""); /* { dg-warning "restrict qualifier ignored on asm" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/asm-wide-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/asm-wide-1.c
new file mode 100644
index 000000000..c14b19d34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/asm-wide-1.c
@@ -0,0 +1,32 @@
+/* Wide string literals should not be allowed in asm. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int foo asm (L"bar"); /* { dg-error "14:wide string literal in 'asm'" } */
+
+asm (L"foo"); /* { dg-error "6:wide string literal in 'asm'" } */
+
+void
+f (void)
+{
+ int x = 1;
+ asm (L"foo"); /* { dg-error "8:wide string literal in 'asm'" } */
+ asm ("foo" :
+ L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
+ asm ("foo" : [x]
+ L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
+ asm ("foo" : [x] "=g" (x),
+ L"=g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
+ asm ("foo" : :
+ L"g" (x)); /* { dg-error "8:wide string literal in 'asm'" } */
+ asm ("foo" : : :
+ L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */
+ asm ("foo" : : : "memory",
+ L"memory"); /* { dg-error "8:wide string literal in 'asm'" } */
+}
+
+/* Extra errors from the substitution of "" for wide strings: */
+/* { dg-error "output" "output" { target *-*-* } 16 } */
+/* { dg-error "output" "output" { target *-*-* } 18 } */
+/* { dg-error "output" "output" { target *-*-* } 20 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-1.c
new file mode 100644
index 000000000..f26a5447e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-1.c
@@ -0,0 +1,128 @@
+/* Test diagnostics for bad implicit type conversions. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic -ftrack-macro-expansion=0" } */
+
+#define TESTARG(ID, TL, TR) void ID##F(TL); void ID##F2(TR x) { ID##F(x); } extern int dummy
+#define TESTARP(ID, TL, TR) struct { void (*x)(TL); } ID##Fp; void ID##F2(TR x) { ID##Fp.x(x); } extern int dummy
+#define TESTASS(ID, TL, TR) void ID##F(TR x) { TL y; y = x; } extern int dummy
+#define TESTINI(ID, TL, TR) void ID##F(TR x) { TL y = x; } extern int dummy
+#define TESTRET(ID, TL, TR) TR ID##V; TL ID##F(void) { return ID##V; } extern int dummy
+
+typedef void (*fp)(void);
+typedef void (*nrfp)(void) __attribute__((noreturn));
+
+TESTARG(fqa, nrfp, fp); /* { dg-warning "passing argument 1 of 'fqaF' makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+TESTARP(fqb, nrfp, fp); /* { dg-warning "passing argument 1 of 'fqbFp.x' makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+TESTASS(fqc, nrfp, fp); /* { dg-warning "assignment makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+TESTINI(fqd, nrfp, fp); /* { dg-warning "initialization makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+TESTRET(fqe, nrfp, fp); /* { dg-warning "return makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+
+TESTARG(ofqa, fp, nrfp);
+TESTARP(ofqb, fp, nrfp);
+TESTASS(ofqc, fp, nrfp);
+TESTINI(ofqd, fp, nrfp);
+TESTRET(ofqe, fp, nrfp);
+
+TESTARG(qa, char *, const char *); /* { dg-warning "passing argument 1 of 'qaF' discards 'const' qualifier from pointer target type" } */
+TESTARP(qb, char *, const char *); /* { dg-warning "passing argument 1 of 'qbFp.x' discards 'const' qualifier from pointer target type" } */
+TESTASS(qc, char *, const char *); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+TESTINI(qd, char *, const char *); /* { dg-warning "initialization discards 'const' qualifier from pointer target type" } */
+TESTRET(qe, char *, const char *); /* { dg-warning "return discards 'const' qualifier from pointer target type" } */
+
+TESTARG(oqa, const char *, char *);
+TESTARP(oqb, const char *, char *);
+TESTASS(oqc, const char *, char *);
+TESTINI(oqd, const char *, char *);
+TESTRET(oqe, const char *, char *);
+
+TESTARG(fda, fp, void *); /* { dg-warning "ISO C forbids passing argument 1 of 'fdaF' between function pointer and 'void \\*'" } */
+TESTARP(fdb, fp, void *); /* { dg-warning "ISO C forbids passing argument 1 of 'fdbFp.x' between function pointer and 'void \\*'" } */
+TESTASS(fdc, fp, void *); /* { dg-warning "ISO C forbids assignment between function pointer and 'void \\*'" } */
+TESTINI(fdd, fp, void *); /* { dg-warning "ISO C forbids initialization between function pointer and 'void \\*'" } */
+TESTRET(fde, fp, void *); /* { dg-warning "ISO C forbids return between function pointer and 'void \\*'" } */
+
+TESTARG(dfa, void *, fp); /* { dg-warning "ISO C forbids passing argument 1 of 'dfaF' between function pointer and 'void \\*'" } */
+TESTARP(dfb, void *, fp); /* { dg-warning "ISO C forbids passing argument 1 of 'dfbFp.x' between function pointer and 'void \\*'" } */
+TESTASS(dfc, void *, fp); /* { dg-warning "ISO C forbids assignment between function pointer and 'void \\*'" } */
+TESTINI(dfd, void *, fp); /* { dg-warning "ISO C forbids initialization between function pointer and 'void \\*'" } */
+TESTRET(dfe, void *, fp); /* { dg-warning "ISO C forbids return between function pointer and 'void \\*'" } */
+
+TESTARG(sua, int *, unsigned int *); /* { dg-warning "pointer targets in passing argument 1 of 'suaF' differ in signedness" } */
+TESTARP(sub, int *, unsigned int *); /* { dg-warning "pointer targets in passing argument 1 of 'subFp.x' differ in signedness" } */
+TESTASS(suc, int *, unsigned int *); /* { dg-warning "pointer targets in assignment differ in signedness" } */
+TESTINI(sud, int *, unsigned int *); /* { dg-warning "pointer targets in initialization differ in signedness" } */
+TESTRET(sue, int *, unsigned int *); /* { dg-warning "pointer targets in return differ in signedness" } */
+
+TESTARG(usa, unsigned int *, int *); /* { dg-warning "pointer targets in passing argument 1 of 'usaF' differ in signedness" } */
+TESTARP(usb, unsigned int *, int *); /* { dg-warning "pointer targets in passing argument 1 of 'usbFp.x' differ in signedness" } */
+TESTASS(usc, unsigned int *, int *); /* { dg-warning "pointer targets in assignment differ in signedness" } */
+TESTINI(usd, unsigned int *, int *); /* { dg-warning "pointer targets in initialization differ in signedness" } */
+TESTRET(use, unsigned int *, int *); /* { dg-warning "pointer targets in return differ in signedness" } */
+
+TESTARG(cua, char *, unsigned char *); /* { dg-warning "pointer targets in passing argument 1 of 'cuaF' differ in signedness" } */
+TESTARP(cub, char *, unsigned char *); /* { dg-warning "pointer targets in passing argument 1 of 'cubFp.x' differ in signedness" } */
+TESTASS(cuc, char *, unsigned char *); /* { dg-warning "pointer targets in assignment differ in signedness" } */
+TESTINI(cud, char *, unsigned char *); /* { dg-warning "pointer targets in initialization differ in signedness" } */
+TESTRET(cue, char *, unsigned char *); /* { dg-warning "pointer targets in return differ in signedness" } */
+
+TESTARG(uca, unsigned char *, char *); /* { dg-warning "pointer targets in passing argument 1 of 'ucaF' differ in signedness" } */
+TESTARP(ucb, unsigned char *, char *); /* { dg-warning "pointer targets in passing argument 1 of 'ucbFp.x' differ in signedness" } */
+TESTASS(ucc, unsigned char *, char *); /* { dg-warning "pointer targets in assignment differ in signedness" } */
+TESTINI(ucd, unsigned char *, char *); /* { dg-warning "pointer targets in initialization differ in signedness" } */
+TESTRET(uce, unsigned char *, char *); /* { dg-warning "pointer targets in return differ in signedness" } */
+
+TESTARG(csa, char *, signed char *); /* { dg-warning "pointer targets in passing argument 1 of 'csaF' differ in signedness" } */
+TESTARP(csb, char *, signed char *); /* { dg-warning "pointer targets in passing argument 1 of 'csbFp.x' differ in signedness" } */
+TESTASS(csc, char *, signed char *); /* { dg-warning "pointer targets in assignment differ in signedness" } */
+TESTINI(csd, char *, signed char *); /* { dg-warning "pointer targets in initialization differ in signedness" } */
+TESTRET(cse, char *, signed char *); /* { dg-warning "pointer targets in return differ in signedness" } */
+
+TESTARG(sca, signed char *, char *); /* { dg-warning "pointer targets in passing argument 1 of 'scaF' differ in signedness" } */
+TESTARP(scb, signed char *, char *); /* { dg-warning "pointer targets in passing argument 1 of 'scbFp.x' differ in signedness" } */
+TESTASS(scc, signed char *, char *); /* { dg-warning "pointer targets in assignment differ in signedness" } */
+TESTINI(scd, signed char *, char *); /* { dg-warning "pointer targets in initialization differ in signedness" } */
+TESTRET(sce, signed char *, char *); /* { dg-warning "pointer targets in return differ in signedness" } */
+
+TESTARG(cia, char *, int *); /* { dg-warning "passing argument 1 of 'ciaF' from incompatible pointer type" } */
+TESTARP(cib, char *, int *); /* { dg-warning "passing argument 1 of 'cibFp.x' from incompatible pointer type" } */
+TESTASS(cic, char *, int *); /* { dg-warning "assignment from incompatible pointer type" } */
+TESTINI(cid, char *, int *); /* { dg-warning "initialization from incompatible pointer type" } */
+TESTRET(cie, char *, int *); /* { dg-warning "return from incompatible pointer type" } */
+
+TESTARG(ica, int *, char *); /* { dg-warning "passing argument 1 of 'icaF' from incompatible pointer type" } */
+TESTARP(icb, int *, char *); /* { dg-warning "passing argument 1 of 'icbFp.x' from incompatible pointer type" } */
+TESTASS(icc, int *, char *); /* { dg-warning "assignment from incompatible pointer type" } */
+TESTINI(icd, int *, char *); /* { dg-warning "initialization from incompatible pointer type" } */
+TESTRET(ice, int *, char *); /* { dg-warning "return from incompatible pointer type" } */
+
+TESTARG(ciia, char *, int); /* { dg-warning "passing argument 1 of 'ciiaF' makes pointer from integer without a cast" } */
+TESTARP(ciib, char *, int); /* { dg-warning "passing argument 1 of 'ciibFp.x' makes pointer from integer without a cast" } */
+TESTASS(ciic, char *, int); /* { dg-warning "assignment makes pointer from integer without a cast" } */
+TESTINI(ciid, char *, int); /* { dg-warning "initialization makes pointer from integer without a cast" } */
+TESTRET(ciie, char *, int); /* { dg-warning "return makes pointer from integer without a cast" } */
+
+TESTARG(iica, int, char *); /* { dg-warning "passing argument 1 of 'iicaF' makes integer from pointer without a cast" } */
+TESTARP(iicb, int, char *); /* { dg-warning "passing argument 1 of 'iicbFp.x' makes integer from pointer without a cast" } */
+TESTASS(iicc, int, char *); /* { dg-warning "assignment makes integer from pointer without a cast" } */
+TESTINI(iicd, int, char *); /* { dg-warning "initialization makes integer from pointer without a cast" } */
+TESTRET(iice, int, char *); /* { dg-warning "return makes integer from pointer without a cast" } */
+
+struct s { int a; };
+
+TESTARG(stria, struct s, int); /* { dg-error "incompatible type for argument 1 of 'striaF'" } */
+TESTARP(strib, struct s, int); /* { dg-error "incompatible type for argument 1 of 'stribFp.x'" } */
+TESTASS(stric, struct s, int); /* { dg-error "incompatible types when assigning to type 'struct s' from type 'int'" } */
+TESTINI(strid, struct s, int); /* { dg-error "invalid initializer" } */
+TESTRET(strie, struct s, int); /* { dg-error "incompatible types when returning type 'int' but 'struct s' was expected" } */
+
+TESTARG(istra, int, struct s); /* { dg-error "incompatible type for argument 1 of 'istraF'" } */
+
+TESTARP(istrb, int, struct s); /* { dg-error "incompatible type for argument 1 of 'istrbFp.x'" } */
+
+TESTASS(istrc, int, struct s); /* { dg-error "incompatible types when assigning to type 'int' from type 'struct s'" } */
+TESTINI(istrd, int, struct s); /* { dg-error "incompatible types when initializing type 'int' using type 'struct s'" } */
+TESTRET(istre, int, struct s); /* { dg-error "incompatible types when returning type 'struct s' but 'int' was expected" } */
+
+/* Match all extra informative notes. */
+/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-2.c
new file mode 100644
index 000000000..1e5eb1ca6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-2.c
@@ -0,0 +1,125 @@
+/* Test diagnostics for bad implicit type conversions.
+ -pedantic-errors test. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -ftrack-macro-expansion=0" } */
+
+#define TESTARG(ID, TL, TR) void ID##F(TL); void ID##F2(TR x) { ID##F(x); } extern int dummy
+#define TESTARP(ID, TL, TR) struct { void (*x)(TL); } ID##Fp; void ID##F2(TR x) { ID##Fp.x(x); } extern int dummy
+#define TESTASS(ID, TL, TR) void ID##F(TR x) { TL y; y = x; } extern int dummy
+#define TESTINI(ID, TL, TR) void ID##F(TR x) { TL y = x; } extern int dummy
+#define TESTRET(ID, TL, TR) TR ID##V; TL ID##F(void) { return ID##V; } extern int dummy
+
+typedef void (*fp)(void);
+typedef void (*nrfp)(void) __attribute__((noreturn));
+
+TESTARG(fqa, nrfp, fp); /* { dg-error "passing argument 1 of 'fqaF' makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+TESTARP(fqb, nrfp, fp); /* { dg-error "passing argument 1 of 'fqbFp.x' makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+TESTASS(fqc, nrfp, fp); /* { dg-error "assignment makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+TESTINI(fqd, nrfp, fp); /* { dg-error "initialization makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+TESTRET(fqe, nrfp, fp); /* { dg-error "return makes '__attribute__..noreturn..' qualified function pointer from unqualified" } */
+
+TESTARG(ofqa, fp, nrfp);
+TESTARP(ofqb, fp, nrfp);
+TESTASS(ofqc, fp, nrfp);
+TESTINI(ofqd, fp, nrfp);
+TESTRET(ofqe, fp, nrfp);
+
+TESTARG(qa, char *, const char *); /* { dg-error "passing argument 1 of 'qaF' discards 'const' qualifier from pointer target type" } */
+TESTARP(qb, char *, const char *); /* { dg-error "passing argument 1 of 'qbFp.x' discards 'const' qualifier from pointer target type" } */
+TESTASS(qc, char *, const char *); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+TESTINI(qd, char *, const char *); /* { dg-error "initialization discards 'const' qualifier from pointer target type" } */
+TESTRET(qe, char *, const char *); /* { dg-error "return discards 'const' qualifier from pointer target type" } */
+
+TESTARG(oqa, const char *, char *);
+TESTARP(oqb, const char *, char *);
+TESTASS(oqc, const char *, char *);
+TESTINI(oqd, const char *, char *);
+TESTRET(oqe, const char *, char *);
+
+TESTARG(fda, fp, void *); /* { dg-error "ISO C forbids passing argument 1 of 'fdaF' between function pointer and 'void \\*'" } */
+TESTARP(fdb, fp, void *); /* { dg-error "ISO C forbids passing argument 1 of 'fdbFp.x' between function pointer and 'void \\*'" } */
+TESTASS(fdc, fp, void *); /* { dg-error "ISO C forbids assignment between function pointer and 'void \\*'" } */
+TESTINI(fdd, fp, void *); /* { dg-error "ISO C forbids initialization between function pointer and 'void \\*'" } */
+TESTRET(fde, fp, void *); /* { dg-error "ISO C forbids return between function pointer and 'void \\*'" } */
+
+TESTARG(dfa, void *, fp); /* { dg-error "ISO C forbids passing argument 1 of 'dfaF' between function pointer and 'void \\*'" } */
+TESTARP(dfb, void *, fp); /* { dg-error "ISO C forbids passing argument 1 of 'dfbFp.x' between function pointer and 'void \\*'" } */
+TESTASS(dfc, void *, fp); /* { dg-error "ISO C forbids assignment between function pointer and 'void \\*'" } */
+TESTINI(dfd, void *, fp); /* { dg-error "ISO C forbids initialization between function pointer and 'void \\*'" } */
+TESTRET(dfe, void *, fp); /* { dg-error "ISO C forbids return between function pointer and 'void \\*'" } */
+
+TESTARG(sua, int *, unsigned int *); /* { dg-error "pointer targets in passing argument 1 of 'suaF' differ in signedness" } */
+TESTARP(sub, int *, unsigned int *); /* { dg-error "pointer targets in passing argument 1 of 'subFp.x' differ in signedness" } */
+TESTASS(suc, int *, unsigned int *); /* { dg-error "pointer targets in assignment differ in signedness" } */
+TESTINI(sud, int *, unsigned int *); /* { dg-error "pointer targets in initialization differ in signedness" } */
+TESTRET(sue, int *, unsigned int *); /* { dg-error "pointer targets in return differ in signedness" } */
+
+TESTARG(usa, unsigned int *, int *); /* { dg-error "pointer targets in passing argument 1 of 'usaF' differ in signedness" } */
+TESTARP(usb, unsigned int *, int *); /* { dg-error "pointer targets in passing argument 1 of 'usbFp.x' differ in signedness" } */
+TESTASS(usc, unsigned int *, int *); /* { dg-error "pointer targets in assignment differ in signedness" } */
+TESTINI(usd, unsigned int *, int *); /* { dg-error "pointer targets in initialization differ in signedness" } */
+TESTRET(use, unsigned int *, int *); /* { dg-error "pointer targets in return differ in signedness" } */
+
+TESTARG(cua, char *, unsigned char *); /* { dg-error "pointer targets in passing argument 1 of 'cuaF' differ in signedness" } */
+TESTARP(cub, char *, unsigned char *); /* { dg-error "pointer targets in passing argument 1 of 'cubFp.x' differ in signedness" } */
+TESTASS(cuc, char *, unsigned char *); /* { dg-error "pointer targets in assignment differ in signedness" } */
+TESTINI(cud, char *, unsigned char *); /* { dg-error "pointer targets in initialization differ in signedness" } */
+TESTRET(cue, char *, unsigned char *); /* { dg-error "pointer targets in return differ in signedness" } */
+
+TESTARG(uca, unsigned char *, char *); /* { dg-error "pointer targets in passing argument 1 of 'ucaF' differ in signedness" } */
+TESTARP(ucb, unsigned char *, char *); /* { dg-error "pointer targets in passing argument 1 of 'ucbFp.x' differ in signedness" } */
+TESTASS(ucc, unsigned char *, char *); /* { dg-error "pointer targets in assignment differ in signedness" } */
+TESTINI(ucd, unsigned char *, char *); /* { dg-error "pointer targets in initialization differ in signedness" } */
+TESTRET(uce, unsigned char *, char *); /* { dg-error "pointer targets in return differ in signedness" } */
+
+TESTARG(csa, char *, signed char *); /* { dg-error "pointer targets in passing argument 1 of 'csaF' differ in signedness" } */
+TESTARP(csb, char *, signed char *); /* { dg-error "pointer targets in passing argument 1 of 'csbFp.x' differ in signedness" } */
+TESTASS(csc, char *, signed char *); /* { dg-error "pointer targets in assignment differ in signedness" } */
+TESTINI(csd, char *, signed char *); /* { dg-error "pointer targets in initialization differ in signedness" } */
+TESTRET(cse, char *, signed char *); /* { dg-error "pointer targets in return differ in signedness" } */
+
+TESTARG(sca, signed char *, char *); /* { dg-error "pointer targets in passing argument 1 of 'scaF' differ in signedness" } */
+TESTARP(scb, signed char *, char *); /* { dg-error "pointer targets in passing argument 1 of 'scbFp.x' differ in signedness" } */
+TESTASS(scc, signed char *, char *); /* { dg-error "pointer targets in assignment differ in signedness" } */
+TESTINI(scd, signed char *, char *); /* { dg-error "pointer targets in initialization differ in signedness" } */
+TESTRET(sce, signed char *, char *); /* { dg-error "pointer targets in return differ in signedness" } */
+
+TESTARG(cia, char *, int *); /* { dg-error "passing argument 1 of 'ciaF' from incompatible pointer type" } */
+TESTARP(cib, char *, int *); /* { dg-error "passing argument 1 of 'cibFp.x' from incompatible pointer type" } */
+TESTASS(cic, char *, int *); /* { dg-error "assignment from incompatible pointer type" } */
+TESTINI(cid, char *, int *); /* { dg-error "initialization from incompatible pointer type" } */
+TESTRET(cie, char *, int *); /* { dg-error "return from incompatible pointer type" } */
+
+TESTARG(ica, int *, char *); /* { dg-error "passing argument 1 of 'icaF' from incompatible pointer type" } */
+TESTARP(icb, int *, char *); /* { dg-error "passing argument 1 of 'icbFp.x' from incompatible pointer type" } */
+TESTASS(icc, int *, char *); /* { dg-error "assignment from incompatible pointer type" } */
+TESTINI(icd, int *, char *); /* { dg-error "initialization from incompatible pointer type" } */
+TESTRET(ice, int *, char *); /* { dg-error "return from incompatible pointer type" } */
+
+TESTARG(ciia, char *, int); /* { dg-error "passing argument 1 of 'ciiaF' makes pointer from integer without a cast" } */
+TESTARP(ciib, char *, int); /* { dg-error "passing argument 1 of 'ciibFp.x' makes pointer from integer without a cast" } */
+TESTASS(ciic, char *, int); /* { dg-error "assignment makes pointer from integer without a cast" } */
+TESTINI(ciid, char *, int); /* { dg-error "initialization makes pointer from integer without a cast" } */
+TESTRET(ciie, char *, int); /* { dg-error "return makes pointer from integer without a cast" } */
+
+TESTARG(iica, int, char *); /* { dg-error "passing argument 1 of 'iicaF' makes integer from pointer without a cast" } */
+TESTARP(iicb, int, char *); /* { dg-error "passing argument 1 of 'iicbFp.x' makes integer from pointer without a cast" } */
+TESTASS(iicc, int, char *); /* { dg-error "assignment makes integer from pointer without a cast" } */
+TESTINI(iicd, int, char *); /* { dg-error "initialization makes integer from pointer without a cast" } */
+TESTRET(iice, int, char *); /* { dg-error "return makes integer from pointer without a cast" } */
+
+struct s { int a; };
+
+TESTARG(stria, struct s, int); /* { dg-error "incompatible type for argument 1 of 'striaF'" } */
+TESTARP(strib, struct s, int); /* { dg-error "incompatible type for argument 1 of 'stribFp.x'" } */
+TESTASS(stric, struct s, int); /* { dg-error "incompatible types when assigning to type 'struct s' from type 'int'" } */
+TESTINI(strid, struct s, int); /* { dg-error "invalid initializer" } */
+TESTRET(strie, struct s, int); /* { dg-error "incompatible types when returning type 'int' but 'struct s' was expected" } */
+
+TESTARG(istra, int, struct s); /* { dg-error "incompatible type for argument 1 of 'istraF'" } */
+TESTARP(istrb, int, struct s); /* { dg-error "incompatible type for argument 1 of 'istrbFp.x'" } */
+TESTASS(istrc, int, struct s); /* { dg-error "incompatible types when assigning to type 'int' from type 'struct s'" } */
+TESTINI(istrd, int, struct s); /* { dg-error "incompatible types when initializing type 'int' using type 'struct s'" } */
+TESTRET(istre, int, struct s); /* { dg-error "incompatible types when returning type 'struct s' but 'int' was expected" } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-3.c
new file mode 100644
index 000000000..f415cc6a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/assign-warn-3.c
@@ -0,0 +1,13 @@
+/* Test diagnostics for bad type conversion when inlining unprototyped
+ functions: should not be errors with -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-O3 -std=c99 -pedantic-errors" } */
+
+/* This is valid to execute, so maybe shouldn't warn at all. */
+inline void f0(x) signed char *x; { }
+void g0(unsigned char *x) { f0(x); } /* { dg-bogus "warning: pointer targets in passing argument 1 of 'f0' differ in signedness" } */
+
+/* This is undefined on execution but still must compile. */
+inline void f1(x) int *x; { }
+void g1(unsigned int *x) { f1(x); } /* { dg-bogus "warning: pointer targets in passing argument 1 of 'f1' differ in signedness" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c
new file mode 100644
index 000000000..4b999c682
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-1.c
@@ -0,0 +1,86 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_compare_exchange_n builtin for a char. */
+
+extern void abort(void);
+
+char v = 0;
+char expected = 0;
+char max = ~0;
+char desired = ~0;
+char zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+int
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c
new file mode 100644
index 000000000..736e358a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-2.c
@@ -0,0 +1,86 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_compare_exchange_n builtin for a short. */
+
+extern void abort(void);
+
+short v = 0;
+short expected = 0;
+short max = ~0;
+short desired = ~0;
+short zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+int
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c
new file mode 100644
index 000000000..91a67cd74
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-3.c
@@ -0,0 +1,86 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+/* Test the execution of the __atomic_compare_exchange_n builtin for an int. */
+
+extern void abort(void);
+
+int v = 0;
+int expected = 0;
+int max = ~0;
+int desired = ~0;
+int zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+int
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c
new file mode 100644
index 000000000..ac9531b78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-4.c
@@ -0,0 +1,88 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+/* Test the execution of __atomic_compare_exchange_n builtin for a long_long. */
+
+extern void abort(void);
+
+long long v = 0;
+long long expected = 0;
+long long max = ~0;
+long long desired = ~0;
+long long zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+int
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c
new file mode 100644
index 000000000..f5d071aff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-compare-exchange-5.c
@@ -0,0 +1,87 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128_runtime } */
+/* { dg-options "-mcx16" { target { i?86-*-* x86_64-*-* } } } */
+
+/* Test the execution of __atomic_compare_exchange_n builtin for an int_128. */
+
+extern void abort(void);
+
+__int128_t v = 0;
+__int128_t expected = 0;
+__int128_t max = ~0;
+__int128_t desired = ~0;
+__int128_t zero = 0;
+
+#define STRONG 0
+#define WEAK 1
+
+int
+main ()
+{
+
+ if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ /* Now test the generic version. */
+
+ v = 0;
+
+ if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-1.c
new file mode 100644
index 000000000..ec8a09c8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-1.c
@@ -0,0 +1,68 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_exchange_n builtin for a char. */
+
+extern void abort(void);
+
+char v, count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
+ abort ();
+ count++;
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-2.c
new file mode 100644
index 000000000..0de2e6820
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-2.c
@@ -0,0 +1,68 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_X builtin for a short. */
+
+extern void abort(void);
+
+short v, count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
+ abort ();
+ count++;
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-3.c
new file mode 100644
index 000000000..63a68cf47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-3.c
@@ -0,0 +1,68 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+/* Test the execution of the __atomic_X builtin for an int. */
+
+extern void abort(void);
+
+int v, count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
+ abort ();
+ count++;
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-4.c
new file mode 100644
index 000000000..fc1e5081a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-4.c
@@ -0,0 +1,70 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+/* Test the execution of the __atomic_X builtin for a long_long. */
+
+extern void abort(void);
+
+long long v, count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
+ abort ();
+ count++;
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-5.c
new file mode 100644
index 000000000..190377f0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-exchange-5.c
@@ -0,0 +1,69 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128_runtime } */
+/* { dg-options "-mcx16" { target { i?86-*-* x86_64-*-* } } } */
+
+/* Test the execution of the __atomic_X builtin for a 16 byte value. */
+
+extern void abort(void);
+
+__int128_t v, count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELAXED) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQUIRE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_RELEASE) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_ACQ_REL) != count)
+ abort ();
+ count++;
+
+ if (__atomic_exchange_n (&v, count + 1, __ATOMIC_SEQ_CST) != count)
+ abort ();
+ count++;
+
+ /* Now test the generic version. */
+
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELAXED);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQUIRE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_RELEASE);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_ACQ_REL);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ __atomic_exchange (&v, &count, &ret, __ATOMIC_SEQ_CST);
+ if (ret != count - 1 || v != count)
+ abort ();
+ count++;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c
new file mode 100644
index 000000000..ab5c7d62c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-fence.c
@@ -0,0 +1,28 @@
+/* Test __atomic routines for existence and execution with each valid
+ memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test that __atomic_{thread,signal}_fence builtins execute. */
+
+int
+main ()
+{
+ __atomic_thread_fence (__ATOMIC_RELAXED);
+ __atomic_thread_fence (__ATOMIC_CONSUME);
+ __atomic_thread_fence (__ATOMIC_ACQUIRE);
+ __atomic_thread_fence (__ATOMIC_RELEASE);
+ __atomic_thread_fence (__ATOMIC_ACQ_REL);
+ __atomic_thread_fence (__ATOMIC_SEQ_CST);
+
+ __atomic_signal_fence (__ATOMIC_RELAXED);
+ __atomic_signal_fence (__ATOMIC_CONSUME);
+ __atomic_signal_fence (__ATOMIC_ACQUIRE);
+ __atomic_signal_fence (__ATOMIC_RELEASE);
+ __atomic_signal_fence (__ATOMIC_ACQ_REL);
+ __atomic_signal_fence (__ATOMIC_SEQ_CST);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-flag.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-flag.c
new file mode 100644
index 000000000..6e79b9027
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-flag.c
@@ -0,0 +1,32 @@
+/* Test __atomic routines for existence and execution. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test that __atomic_test_and_set and __atomic_clear builtins execute. */
+
+extern void abort(void);
+unsigned char a;
+
+int
+main ()
+{
+ int b;
+
+ __atomic_clear (&a, __ATOMIC_RELAXED);
+ if (a != 0)
+ abort ();
+
+ b = __atomic_test_and_set (&a, __ATOMIC_SEQ_CST);
+ if (a != __GCC_ATOMIC_TEST_AND_SET_TRUEVAL || b != 0)
+ abort ();
+
+ b = __atomic_test_and_set (&a, __ATOMIC_ACQ_REL);
+ if (a != __GCC_ATOMIC_TEST_AND_SET_TRUEVAL || b != 1)
+ abort ();
+
+ __atomic_clear (&a, __ATOMIC_SEQ_CST);
+ if (a != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-generic-aux.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-generic-aux.c
new file mode 100644
index 000000000..73e1ed853
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-generic-aux.c
@@ -0,0 +1,58 @@
+/* Supply a set of generic atomic functions to test the compiler make the
+ calls properly. */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+/* Test that the generic builtins make calls as expected. */
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+void
+__atomic_exchange (size_t size, void *obj, void *val, void *ret, int model)
+{
+ /* Copy old value into *ret. */
+ memcpy (ret, obj, size);
+ /* Copy val into object. */
+ memcpy (obj, val, size);
+}
+
+
+/* Note that the external version of this routine has the boolean weak/strong
+ parameter removed. This is required by the external library. */
+bool
+__atomic_compare_exchange (size_t size, void *obj, void *expected,
+ void *desired, int model1, int model2)
+{
+ bool ret;
+ if (!memcmp (obj, expected, size))
+ {
+ memcpy (obj, desired, size);
+ ret = true;
+ }
+ else
+ {
+ memcpy (expected, obj, size);
+ ret = false;
+ }
+
+ /* Make sure the parameters have been properly adjusted for the external
+ function call (no weak/strong parameter. */
+ if (model1 != __ATOMIC_SEQ_CST || model2 != __ATOMIC_ACQUIRE)
+ ret = !ret;
+
+ return ret;
+}
+
+
+void __atomic_load (size_t size, void *obj, void *ret, int model)
+{
+ memcpy (ret, obj, size);
+}
+
+
+void __atomic_store (size_t size, void *obj, void *val, int model)
+{
+ memcpy (obj, val, size);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-generic.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-generic.c
new file mode 100644
index 000000000..9b09f87b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-generic.c
@@ -0,0 +1,57 @@
+/* Test generic __atomic routines for proper function calling.
+ memory model. */
+/* { dg-options "-w" } */
+/* { dg-do run } */
+/* { dg-additional-sources "atomic-generic-aux.c" } */
+
+/* Test that the generioc atomic builtins execute as expected..
+ sync-mem-generic-aux.c supplies a functional external entry point for
+ the 4 generic functions. */
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+extern void abort();
+
+typedef struct test {
+ int array[10];
+} test_struct;
+
+test_struct zero = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+test_struct ones = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
+test_struct a,b;
+
+int size = sizeof (test_struct);
+/* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */
+int
+main ()
+{
+ test_struct c;
+
+ __atomic_store (&a, &zero, __ATOMIC_RELAXED);
+ if (memcmp (&a, &zero, size))
+ abort ();
+
+ __atomic_exchange (&a, &ones, &c, __ATOMIC_SEQ_CST);
+ if (memcmp (&c, &zero, size))
+ abort ();
+ if (memcmp (&a, &ones, size))
+ abort ();
+
+ __atomic_load (&a, &b, __ATOMIC_RELAXED);
+ if (memcmp (&b, &ones, size))
+ abort ();
+
+ if (!__atomic_compare_exchange (&a, &b, &zero, false, __ATOMIC_SEQ_CST, __ATOMIC_ACQUIRE))
+ abort();
+ if (memcmp (&a, &zero, size))
+ abort ();
+
+ if (__atomic_compare_exchange (&a, &b, &ones, false, __ATOMIC_SEQ_CST, __ATOMIC_ACQUIRE))
+ abort();
+ if (memcmp (&b, &zero, size))
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-invalid.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-invalid.c
new file mode 100644
index 000000000..4d040e1d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-invalid.c
@@ -0,0 +1,37 @@
+/* Test __atomic routines for invalid memory model errors. This only needs
+ to be tested on a single size. */
+/* { dg-do compile } */
+/* { dg-require-effective-target sync_int_long } */
+
+#include <stddef.h>
+#include <stdbool.h>
+
+int i, e, b;
+size_t s;
+bool x;
+
+int
+main ()
+{
+ __atomic_compare_exchange_n (&i, &e, 1, 0, __ATOMIC_RELAXED, __ATOMIC_SEQ_CST); /* { dg-error "failure memory model cannot be stronger" } */
+ __atomic_compare_exchange_n (&i, &e, 1, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELEASE); /* { dg-error "invalid failure memory" } */
+ __atomic_compare_exchange_n (&i, &e, 1, 1, __ATOMIC_SEQ_CST, __ATOMIC_ACQ_REL); /* { dg-error "invalid failure memory" } */
+
+ __atomic_exchange_n (&i, 1, __ATOMIC_CONSUME); /* { dg-error "invalid memory model" } */
+
+ __atomic_load_n (&i, __ATOMIC_RELEASE); /* { dg-error "invalid memory model" } */
+ __atomic_load_n (&i, __ATOMIC_ACQ_REL); /* { dg-error "invalid memory model" } */
+
+ __atomic_store_n (&i, 1, __ATOMIC_ACQUIRE); /* { dg-error "invalid memory model" } */
+ __atomic_store_n (&i, 1, __ATOMIC_CONSUME); /* { dg-error "invalid memory model" } */
+ __atomic_store_n (&i, 1, __ATOMIC_ACQ_REL); /* { dg-error "invalid memory model" } */
+
+ i = __atomic_always_lock_free (s, NULL); /* { dg-error "non-constant argument" } */
+
+ __atomic_load_n (&i, 44); /* { dg-warning "invalid memory model" } */
+
+ __atomic_clear (&x, __ATOMIC_ACQUIRE); /* { dg-error "invalid memory model" } */
+
+ __atomic_clear (&x, __ATOMIC_ACQ_REL); /* { dg-error "invalid memory model" } */
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-1.c
new file mode 100644
index 000000000..72ca317f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-1.c
@@ -0,0 +1,67 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test the execution of the __atomic_load_n builtin for a char. */
+
+extern void abort(void);
+
+char v, count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-2.c
new file mode 100644
index 000000000..e937a2dab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-2.c
@@ -0,0 +1,69 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test the execution of the __atomic_load_n builtin for a short. */
+
+extern void abort(void);
+
+short v, count;
+
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-3.c
new file mode 100644
index 000000000..3e70ef429
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-3.c
@@ -0,0 +1,66 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+extern void abort(void);
+
+int v, count;
+
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-4.c
new file mode 100644
index 000000000..750623dcb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-4.c
@@ -0,0 +1,67 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern void abort(void);
+
+long long v, count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-5.c
new file mode 100644
index 000000000..d37d64248
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-load-5.c
@@ -0,0 +1,66 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128_runtime } */
+/* { dg-options "-mcx16" { target { i?86-*-* x86_64-*-* } } } */
+
+extern void abort(void);
+
+__int128_t v, count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (__atomic_load_n (&v, __ATOMIC_RELAXED) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_ACQUIRE) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_CONSUME) != count++)
+ abort();
+ else
+ v++;
+
+ if (__atomic_load_n (&v, __ATOMIC_SEQ_CST) != count++)
+ abort();
+ else
+ v++;
+
+ /* Now test the generic variants. */
+
+ __atomic_load (&v, &count, __ATOMIC_RELAXED);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_ACQUIRE);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_CONSUME);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+ __atomic_load (&v, &count, __ATOMIC_SEQ_CST);
+ if (count != v)
+ abort();
+ else
+ v++;
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-lockfree-aux.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-lockfree-aux.c
new file mode 100644
index 000000000..0ea872c30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-lockfree-aux.c
@@ -0,0 +1,17 @@
+/* Test supply a __atomic_is_lock_free routine for lock-free tests. */
+/* Just compile it on its own. */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+/* Test that __atomic_{is,always}_lock_free builtins execute. */
+
+#include <stdlib.h>
+
+/* Supply a builtin external function which returns a non-standard value so
+ it can be detected that it was called. */
+int
+__atomic_is_lock_free (size_t s, void *p)
+{
+ return 2;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-lockfree.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-lockfree.c
new file mode 100644
index 000000000..093aee919
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-lockfree.c
@@ -0,0 +1,121 @@
+/* Test __atomic routines for existence and execution with each valid
+ memory model. */
+/* { dg-options "-w" } */
+/* { dg-do run } */
+/* { dg-additional-sources "atomic-lockfree-aux.c" } */
+
+/* Test that __atomic_{is,always}_lock_free builtins execute.
+ sync-mem-lockfree-aux.c supplies and external entry point for
+ __atomic_is_lock_free which always returns a 2. We can detect the
+ external routine was called if 2 is returned since that is not a valid
+ result normally. */
+
+#include <stdlib.h>
+
+extern void abort();
+
+int r1, r2;
+
+/* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */
+int
+main ()
+{
+
+ r1 = __atomic_always_lock_free (sizeof(char), 0);
+ r2 = __atomic_is_lock_free (sizeof(char), 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+ r1 = __atomic_always_lock_free (2, 0);
+ r2 = __atomic_is_lock_free (2, 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ r1 = __atomic_always_lock_free (4, 0);
+ r2 = __atomic_is_lock_free (4, 0); /* Try passing in a variable. */
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ r1 = __atomic_always_lock_free (8, 0);
+ r2 = __atomic_is_lock_free (8, 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ r1 = __atomic_always_lock_free (16, 0);
+ r2 = __atomic_is_lock_free (16, 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ r1 = __atomic_always_lock_free (32, 0);
+ r2 = __atomic_is_lock_free (32, 0);
+ /* If always lock free, then is_lock_free must also be true. */
+ if (r1)
+ {
+ if (r2 != 1)
+ abort ();
+ }
+ else
+ {
+ /* If it is not lock free, then the external routine must be called. */
+ if (r2 != 2)
+ abort ();
+ }
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-noinline-aux.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-noinline-aux.c
new file mode 100644
index 000000000..deab7ae1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-noinline-aux.c
@@ -0,0 +1,70 @@
+/* Supply a set of generic atomic functions to test the compiler make the
+ calls properly. */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+/* Test that the generic builtins make calls as expected. This file provides
+ the exact entry points the test file will require. All these routines
+ simply set the first parameter to 1, and the caller will test for that. */
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+
+char
+__atomic_exchange_1 (char *p, char t, int i)
+{
+ *p = 1;
+}
+
+short
+__atomic_load_2 (short *p, int i)
+{
+ *p = 1;
+}
+
+void
+__atomic_store_1 (char *p, char v, int i)
+{
+ *p = 1;
+}
+
+int __atomic_compare_exchange_2 (short *p, short *a, short b, int y, int z)
+{
+ /* Fail if the memory models aren't correct as that will indicate the external
+ call has failed to remove the weak/strong parameter as required by the
+ library. */
+ if (y != __ATOMIC_SEQ_CST || z != __ATOMIC_ACQUIRE)
+ *p = 0;
+ else
+ *p = 1;
+}
+
+char __atomic_fetch_add_1 (char *p, char v, int i)
+{
+ *p = 1;
+}
+
+short __atomic_fetch_add_2 (short *p, short v, int i)
+{
+ *p = 1;
+}
+
+/* Really perform a NAND. PR51040 showed incorrect calculation of a
+ non-inlined fetch_nand. */
+unsigned char
+__atomic_fetch_nand_1 (unsigned char *p, unsigned char v, int i)
+{
+ unsigned char ret;
+
+ ret = *p;
+ *p = ~(*p & v);
+
+ return ret;
+}
+
+int __atomic_is_lock_free (int i, void *p)
+{
+ return 10;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-noinline.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-noinline.c
new file mode 100644
index 000000000..b3490ea32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-noinline.c
@@ -0,0 +1,64 @@
+/* Test generic __atomic routines for proper function calling.
+ memory model. */
+/* { dg-options "-w -fno-inline-atomics" } */
+/* { dg-do run } */
+/* { dg-additional-sources "atomic-noinline-aux.c" } */
+
+/* Test that -fno-inline-atomics works as expected.
+ atomic-generic-aux provide the expected routines which simply set the
+ value of the first parameter to */
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+extern void abort();
+
+short as,bs,cs;
+char ac,bc,cc;
+
+int
+main ()
+{
+
+ ac = __atomic_exchange_n (&bc, cc, __ATOMIC_RELAXED);
+ if (bc != 1)
+ abort ();
+
+ as = __atomic_load_n (&bs, __ATOMIC_SEQ_CST);
+ if (bs != 1)
+ abort ();
+
+ __atomic_store_n (&ac, bc, __ATOMIC_RELAXED);
+ if (ac != 1)
+ abort ();
+
+ __atomic_compare_exchange_n (&as, &bs, cs, 0, __ATOMIC_SEQ_CST, __ATOMIC_ACQUIRE);
+ if (as != 1)
+ abort ();
+
+ ac = __atomic_fetch_add (&cc, 15, __ATOMIC_SEQ_CST);
+ if (cc != 1)
+ abort ();
+
+ /* This should be translated to __atomic_fetch_add for the library */
+ as = __atomic_add_fetch (&cs, 10, __ATOMIC_RELAXED);
+
+ if (cs != 1)
+ abort ();
+
+ /* The fake external function should return 10. */
+ if (__atomic_is_lock_free (4, 0) != 10)
+ abort ();
+
+ /* PR 51040 was caused by arithmetic code not patching up nand_fetch properly
+ when used an an external function. Look for proper return value here. */
+ ac = 0x3C;
+ bc = __atomic_nand_fetch (&ac, 0x0f, __ATOMIC_RELAXED);
+ if (bc != ac)
+ abort ();
+
+ return 0;
+}
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-1.c
new file mode 100644
index 000000000..a8a97c401
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-1.c
@@ -0,0 +1,555 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_*OP builtin routines for a char. */
+
+extern void abort(void);
+
+char v, count, res;
+const char init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-2.c
new file mode 100644
index 000000000..949850345
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-2.c
@@ -0,0 +1,556 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+
+/* Test the execution of the __atomic_*OP builtin routines for a short. */
+
+extern void abort(void);
+
+short v, count, res;
+const short init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-3.c
new file mode 100644
index 000000000..9a54a2a41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-3.c
@@ -0,0 +1,555 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+/* Test the execution of the __atomic_*OP builtin routines for an int. */
+
+extern void abort(void);
+
+int v, count, res;
+const int init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-4.c
new file mode 100644
index 000000000..6990b0e2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-4.c
@@ -0,0 +1,557 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+/* Test the execution of the __atomic_*OP builtin routines for long long. */
+
+extern void abort(void);
+
+long long v, count, res;
+const long long init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-5.c
new file mode 100644
index 000000000..1407f3fe3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-5.c
@@ -0,0 +1,556 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128_runtime } */
+/* { dg-options "-mcx16" { target { i?86-*-* x86_64-*-* } } } */
+
+/* Test the execution of the __atomic_*OP builtin routines for an int_128. */
+
+extern void abort(void);
+
+__int128_t v, count, res;
+const __int128_t init = ~0;
+
+/* The fetch_op routines return the original value before the operation. */
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQUIRE) != 2)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_RELEASE) != 3)
+ abort ();
+
+ if (__atomic_fetch_add (&v, count, __ATOMIC_ACQ_REL) != 4)
+ abort ();
+
+ if (__atomic_fetch_add (&v, 1, __ATOMIC_SEQ_CST) != 5)
+ abort ();
+}
+
+
+void
+test_fetch_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_RELAXED) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_CONSUME) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQUIRE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, count + 1, __ATOMIC_ACQ_REL) != res--)
+ abort ();
+
+ if (__atomic_fetch_sub (&v, 1, __ATOMIC_SEQ_CST) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_fetch_and (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_fetch_nand ()
+{
+ v = init;
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_ACQUIRE) != 0 )
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ if (__atomic_fetch_nand (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_fetch_xor (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_fetch_xor (&v, ~count, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_fetch_or (&v, count, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 2, __ATOMIC_CONSUME) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, 8, __ATOMIC_RELEASE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_ACQ_REL) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST) != 31)
+ abort ();
+}
+
+/* The OP_fetch routines return the new value after the operation. */
+
+void
+test_add_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_CONSUME) != 2)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQUIRE) != 3)
+ abort ();
+
+ if (__atomic_add_fetch (&v, 1, __ATOMIC_RELEASE) != 4)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL) != 5)
+ abort ();
+
+ if (__atomic_add_fetch (&v, count, __ATOMIC_SEQ_CST) != 6)
+ abort ();
+}
+
+
+void
+test_sub_fetch ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_CONSUME) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQUIRE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, 1, __ATOMIC_RELEASE) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL) != --res)
+ abort ();
+
+ if (__atomic_sub_fetch (&v, count + 1, __ATOMIC_SEQ_CST) != --res)
+ abort ();
+}
+
+void
+test_and_fetch ()
+{
+ v = init;
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_RELAXED) != 0)
+ abort ();
+
+ v = init;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_CONSUME) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, init, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL) != 0)
+ abort ();
+
+ v = ~v;
+ if (__atomic_and_fetch (&v, 0, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_nand_fetch ()
+{
+ v = init;
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_RELEASE) != 0)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, init, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST) != init)
+ abort ();
+}
+
+
+
+void
+test_xor_fetch ()
+{
+ v = init;
+ count = 0;
+
+ if (__atomic_xor_fetch (&v, count, __ATOMIC_RELAXED) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_CONSUME) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE) != 0)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_RELEASE) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, 0, __ATOMIC_ACQ_REL) != init)
+ abort ();
+
+ if (__atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST) != 0)
+ abort ();
+}
+
+void
+test_or_fetch ()
+{
+ v = 0;
+ count = 1;
+
+ if (__atomic_or_fetch (&v, count, __ATOMIC_RELAXED) != 1)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 2, __ATOMIC_CONSUME) != 3)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQUIRE) != 7)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, 8, __ATOMIC_RELEASE) != 15)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL) != 31)
+ abort ();
+
+ count *= 2;
+ if (__atomic_or_fetch (&v, count, __ATOMIC_SEQ_CST) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. Use both variations
+ within each function. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_add_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_CONSUME);
+ if (v != 2)
+ abort ();
+
+ __atomic_add_fetch (&v, 1 , __ATOMIC_ACQUIRE);
+ if (v != 3)
+ abort ();
+
+ __atomic_fetch_add (&v, 1, __ATOMIC_RELEASE);
+ if (v != 4)
+ abort ();
+
+ __atomic_add_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 5)
+ abort ();
+
+ __atomic_fetch_add (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 6)
+ abort ();
+}
+
+
+void
+test_sub()
+{
+ v = res = 20;
+ count = 0;
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_CONSUME);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, 1, __ATOMIC_ACQUIRE);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, 1, __ATOMIC_RELEASE);
+ if (v != --res)
+ abort ();
+
+ __atomic_sub_fetch (&v, count + 1, __ATOMIC_ACQ_REL);
+ if (v != --res)
+ abort ();
+
+ __atomic_fetch_sub (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_RELAXED);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ __atomic_fetch_and (&v, init, __ATOMIC_CONSUME);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, init, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_and_fetch (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ __atomic_fetch_and (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_nand ()
+{
+ v = init;
+
+ __atomic_fetch_nand (&v, 0, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, init, __ATOMIC_RELEASE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_nand (&v, init, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_nand_fetch (&v, 0, __ATOMIC_SEQ_CST);
+ if (v != init)
+ abort ();
+}
+
+
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ __atomic_xor_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_CONSUME);
+ if (v != 0)
+ abort ();
+
+ __atomic_xor_fetch (&v, 0, __ATOMIC_ACQUIRE);
+ if (v != 0)
+ abort ();
+
+ __atomic_fetch_xor (&v, ~count, __ATOMIC_RELEASE);
+ if (v != init)
+ abort ();
+
+ __atomic_fetch_xor (&v, 0, __ATOMIC_ACQ_REL);
+ if (v != init)
+ abort ();
+
+ __atomic_xor_fetch (&v, ~count, __ATOMIC_SEQ_CST);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ __atomic_or_fetch (&v, count, __ATOMIC_RELAXED);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_CONSUME);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, 4, __ATOMIC_ACQUIRE);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, 8, __ATOMIC_RELEASE);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ __atomic_or_fetch (&v, count, __ATOMIC_ACQ_REL);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ __atomic_fetch_or (&v, count, __ATOMIC_SEQ_CST);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_nand ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add_fetch ();
+ test_sub_fetch ();
+ test_and_fetch ();
+ test_nand_fetch ();
+ test_xor_fetch ();
+ test_or_fetch ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_nand ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-optimize.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-optimize.c
new file mode 100644
index 000000000..d2e960a0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-op-optimize.c
@@ -0,0 +1,20 @@
+/* Both these atomic operations should be optimized to an exchange operation.
+ Test that it at happens on x86 by making sure there are 2 xchg's and no
+ compare_exchange loop. */
+
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler-times "cmpxchg" 0 } } */
+/* { dg-final { scan-assembler-times "xchg" 2 } } */
+
+int x;
+
+int f()
+{
+ return __atomic_fetch_and (&x, 0, __ATOMIC_RELAXED);
+}
+
+int g()
+{
+ return __atomic_fetch_or (&x, -1, __ATOMIC_RELAXED);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-param.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-param.c
new file mode 100644
index 000000000..1f2b12690
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-param.c
@@ -0,0 +1,14 @@
+/* Test __atomic routines for invalid memory model errors. This only needs
+ to be tested on a single size. */
+/* { dg-do compile } */
+/* { dg-require-effective-target sync_int_long } */
+
+int i;
+
+int
+main ()
+{
+
+ __atomic_exchange_n (&i, 1); /* { dg-error "too few arguments" } */
+ __atomic_exchange_n (&i, 1, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); /* { dg-error "too many arguments" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-pr51256.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-pr51256.c
new file mode 100644
index 000000000..2d39549c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-pr51256.c
@@ -0,0 +1,47 @@
+/* Test generic __atomic routines for various errors. */
+/* { dg-do compile } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-options "-ansi" } */
+
+void f1 (void* p)
+{
+ __atomic_compare_exchange(p, p, p, 0, 0, 0); /* { dg-error "must be a non-void pointer type" } */
+}
+
+void f2 (int n)
+{
+ int a[n], b[n];
+ __atomic_load (&a, &b, __ATOMIC_SEQ_CST); /* { dg-error "must be a pointer to a constant size" } */
+}
+
+struct s { };
+void f3 (void)
+{
+ struct s a,b;
+ __atomic_load (&a, &b, __ATOMIC_SEQ_CST); /* { dg-error "must be a pointer to a nonzero size" } */
+}
+
+void f4 (int a, int b, int c)
+{
+ __atomic_load (&a, &b, &c, __ATOMIC_SEQ_CST); /* { dg-error "incorrect number of arguments" } */
+}
+
+void f5 (int a, int b)
+{
+ __atomic_load (&a, b, __ATOMIC_SEQ_CST); /* { dg-error "must be a pointer type" } */
+}
+
+void f6 (int a, char b)
+{
+ __atomic_load (&a, &b, __ATOMIC_SEQ_CST); /* { dg-error "size mismatch in argument" } */
+}
+
+void f7 (int a, int b)
+{
+ __atomic_load (&a, &b, 45); /* { dg-warning "invalid memory model argument" } */
+}
+
+void f8 (int a, int b, float c)
+{
+ __atomic_load (&a, &b, c); /* { dg-error "non-integer memory model argument" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-1.c
new file mode 100644
index 000000000..1ca5febcf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-1.c
@@ -0,0 +1,48 @@
+/* Test __atomic routines for existence and proper execution on 1 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_store_n builtin for a char. */
+
+extern void abort(void);
+
+char v, count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-2.c
new file mode 100644
index 000000000..c7b1e211a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-2.c
@@ -0,0 +1,47 @@
+/* Test __atomic routines for existence and proper execution on 2 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+
+/* Test the execution of the __atomic_store_n builtin for a short. */
+
+extern void abort(void);
+
+short v, count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-3.c
new file mode 100644
index 000000000..52b30faac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-3.c
@@ -0,0 +1,48 @@
+/* Test __atomic routines for existence and proper execution on 4 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+
+/* Test the execution of the __atomic_store_n builtin for an int. */
+
+extern void abort(void);
+
+int v, count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-4.c
new file mode 100644
index 000000000..ca37fdc46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-4.c
@@ -0,0 +1,50 @@
+/* Test __atomic routines for existence and proper execution on 8 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+/* Test the execution of the __atomic_store_n builtin for a long long. */
+
+extern void abort(void);
+
+long long v, count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-5.c
new file mode 100644
index 000000000..a855182bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-5.c
@@ -0,0 +1,49 @@
+/* Test __atomic routines for existence and proper execution on 16 byte
+ values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128_runtime } */
+/* { dg-options "-mcx16" { target { i?86-*-* x86_64-*-* } } } */
+
+/* Test the execution of the __atomic_store_n builtin for a 16 byte value. */
+
+extern void abort(void);
+
+__int128_t v, count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELAXED);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_RELEASE);
+ if (v != ++count)
+ abort ();
+
+ __atomic_store_n (&v, count + 1, __ATOMIC_SEQ_CST);
+ if (v != ++count)
+ abort ();
+
+ /* Now test the generic variant. */
+ count++;
+
+ __atomic_store (&v, &count, __ATOMIC_RELAXED);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_RELEASE);
+ if (v != count++)
+ abort ();
+
+ __atomic_store (&v, &count, __ATOMIC_SEQ_CST);
+ if (v != count)
+ abort ();
+
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-6.c
new file mode 100644
index 000000000..81499cd71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic-store-6.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_128_runtime } */
+/* { dg-options "-mcx16" { target { i?86-*-* x86_64-*-* } } } */
+
+__int128_t i;
+
+int main()
+{
+ __atomic_store_16(&i, -1, 0);
+ if (i != -1)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/atomic.exp b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/atomic.exp
new file mode 100644
index 000000000..9200e3198
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/atomic.exp
@@ -0,0 +1,34 @@
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib atomic-dg.exp
+
+# Initialize `dg'.
+dg-init
+if [atomic_init] {
+ # Main loop.
+ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] ""
+}
+
+# All done.
+atomic_finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-1.c
new file mode 100644
index 000000000..c0db93f07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-1.c
@@ -0,0 +1,88 @@
+/* Test for _Atomic in C11. Basic execution tests for atomic loads
+ and stores. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+
+#define CMPLX(X, Y) __builtin_complex ((X), (Y))
+
+#define TEST_SIMPLE_ASSIGN(TYPE, VALUE) \
+ do \
+ { \
+ static volatile _Atomic (TYPE) a, b = (TYPE) (VALUE); \
+ if (a != 0) \
+ abort (); \
+ if (b != ((TYPE) (VALUE))) \
+ abort (); \
+ if ((a = b) != ((TYPE) (VALUE))) \
+ abort (); \
+ if (a != ((TYPE) (VALUE))) \
+ abort (); \
+ } \
+ while (0)
+
+#define TEST_SIMPLE_ASSIGN_ARITH(VALUE) \
+ do \
+ { \
+ TEST_SIMPLE_ASSIGN (_Bool, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (char, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (signed char, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (unsigned char, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (signed short, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (unsigned short, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (signed int, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (unsigned int, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (signed long, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (unsigned long, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (signed long long, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (unsigned long long, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (float, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (double, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (long double, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (_Complex float, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (_Complex double, (VALUE)); \
+ TEST_SIMPLE_ASSIGN (_Complex long double, (VALUE)); \
+ } \
+ while (0)
+
+static void
+test_simple_assign (void)
+{
+ TEST_SIMPLE_ASSIGN_ARITH (0);
+ TEST_SIMPLE_ASSIGN_ARITH (1);
+ TEST_SIMPLE_ASSIGN_ARITH (2);
+ TEST_SIMPLE_ASSIGN_ARITH (-1);
+ TEST_SIMPLE_ASSIGN_ARITH (1ULL << 63);
+ TEST_SIMPLE_ASSIGN_ARITH (1.5);
+ TEST_SIMPLE_ASSIGN_ARITH (CMPLX (2.5, 3.5));
+ static int i;
+ TEST_SIMPLE_ASSIGN (int *, 0);
+ TEST_SIMPLE_ASSIGN (int *, &i);
+ struct s { short a[1024]; };
+ struct s init, copy;
+ _Atomic struct s s1, s2;
+ for (int j = 0; j < 1024; j++)
+ init.a[j] = j;
+ copy = (s1 = init);
+ if (memcmp (&init, &copy, sizeof init) != 0)
+ abort ();
+ copy = (s2 = s1);
+ if (memcmp (&init, &copy, sizeof init) != 0)
+ abort ();
+ copy = s1;
+ if (memcmp (&init, &copy, sizeof init) != 0)
+ abort ();
+ copy = s2;
+ if (memcmp (&init, &copy, sizeof init) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ test_simple_assign ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c
new file mode 100644
index 000000000..9ee56b601
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c
@@ -0,0 +1,171 @@
+/* Test for _Atomic in C11. Basic execution tests for atomic compound
+ assignment. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+#define CMPLX(X, Y) __builtin_complex ((X), (Y))
+
+#define TEST_COMPOUND(TYPE, LHSVAL, RHSVAL, OP) \
+ do \
+ { \
+ static volatile _Atomic (TYPE) a = (TYPE) (LHSVAL); \
+ if ((a OP##= (RHSVAL)) != (TYPE) ((TYPE) (LHSVAL) OP (RHSVAL))) \
+ abort (); \
+ if (a != (TYPE) ((TYPE) (LHSVAL) OP (RHSVAL))) \
+ abort (); \
+ } \
+ while (0)
+
+#define TEST_COMPOUND_ARITH(LHSVAL, RHSVAL, OP) \
+ do \
+ { \
+ TEST_COMPOUND (_Bool, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (char, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed char, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned char, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed short, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned short, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed int, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned int, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed long, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned long, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed long long, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned long long, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (float, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (double, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (long double, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (_Complex float, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (_Complex double, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (_Complex long double, (LHSVAL), (RHSVAL), OP); \
+ } \
+ while (0)
+
+#define TEST_COMPOUND_INT(LHSVAL, RHSVAL, OP) \
+ do \
+ { \
+ TEST_COMPOUND (_Bool, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (char, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed char, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned char, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed short, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned short, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed int, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned int, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed long, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned long, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (signed long long, (LHSVAL), (RHSVAL), OP); \
+ TEST_COMPOUND (unsigned long long, (LHSVAL), (RHSVAL), OP); \
+ } \
+ while (0)
+
+static void
+test_mult (void)
+{
+ TEST_COMPOUND_ARITH (1, 2, *);
+ TEST_COMPOUND_ARITH (-3, 5, *);
+ TEST_COMPOUND_ARITH (-7, -20, *);
+ TEST_COMPOUND_ARITH (1.25, 3.5, *);
+ TEST_COMPOUND_ARITH (CMPLX (1.5, 2.5), CMPLX (3.5, 4.5), *);
+ TEST_COMPOUND_ARITH (CMPLX (1.5, 2.5), 2, *);
+}
+
+static void
+test_div (void)
+{
+ TEST_COMPOUND_ARITH (1, 2, /);
+ TEST_COMPOUND_ARITH (-6, 3, /);
+ TEST_COMPOUND_ARITH (-70, -10, /);
+ TEST_COMPOUND_ARITH (1.25, 2.5, /);
+ TEST_COMPOUND_ARITH (CMPLX (1.0, 1.0), CMPLX (0.5, 0.5), /);
+ TEST_COMPOUND_ARITH (CMPLX (1.5, 2.5), 2, /);
+}
+
+static void
+test_mod (void)
+{
+ TEST_COMPOUND_INT (1, 2, %);
+ TEST_COMPOUND_INT (-3, 5, %);
+ TEST_COMPOUND_INT (-7, -2, %);
+}
+
+static void
+test_plus (void)
+{
+ TEST_COMPOUND_ARITH (1, 2, +);
+ TEST_COMPOUND_ARITH (-3, 5, +);
+ TEST_COMPOUND_ARITH (-7, -20, +);
+ TEST_COMPOUND_ARITH (1.25, 3.5, +);
+ TEST_COMPOUND_ARITH (CMPLX (1.5, 2.5), CMPLX (3.5, 4.5), +);
+ TEST_COMPOUND_ARITH (CMPLX (1.5, 2.5), 2, +);
+ static int ia[2];
+ TEST_COMPOUND (int *, &ia[1], 1, +);
+ TEST_COMPOUND (int *, &ia[1], -1, +);
+}
+
+static void
+test_minus (void)
+{
+ TEST_COMPOUND_ARITH (1, 2, -);
+ TEST_COMPOUND_ARITH (-3, 5, -);
+ TEST_COMPOUND_ARITH (-7, -20, -);
+ TEST_COMPOUND_ARITH (3.5, 1.25, -);
+ TEST_COMPOUND_ARITH (CMPLX (3.5, 4.5), CMPLX (1.5, 2.5), -);
+ TEST_COMPOUND_ARITH (CMPLX (3.5, 2.5), 2, -);
+ static int ia[2];
+ TEST_COMPOUND (int *, &ia[1], 1, -);
+ TEST_COMPOUND (int *, &ia[1], -1, -);
+}
+
+static void
+test_lshift (void)
+{
+ TEST_COMPOUND_INT (1, 7, <<);
+ TEST_COMPOUND_INT (15, 3, <<);
+}
+
+static void
+test_rshift (void)
+{
+ TEST_COMPOUND_INT (1, 1, >>);
+ TEST_COMPOUND_INT (127, 4, >>);
+}
+
+static void
+test_and (void)
+{
+ TEST_COMPOUND_INT (0x1234, 0x7856, &);
+ TEST_COMPOUND_INT (-1, 0x12345678, &);
+}
+
+static void
+test_xor (void)
+{
+ TEST_COMPOUND_INT (0x1234, 0x7856, ^);
+ TEST_COMPOUND_INT (-1, 0x12345678, ^);
+}
+
+static void
+test_or (void)
+{
+ TEST_COMPOUND_INT (0x1234, 0x7856, |);
+ TEST_COMPOUND_INT (-12345, 0x12345678, |);
+}
+
+int
+main (void)
+{
+ test_mult ();
+ test_div ();
+ test_mod ();
+ test_plus ();
+ test_minus ();
+ test_lshift ();
+ test_rshift ();
+ test_and ();
+ test_xor ();
+ test_or ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c
new file mode 100644
index 000000000..7bfa8c05f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c
@@ -0,0 +1,85 @@
+/* Test for _Atomic in C11. Basic execution tests for atomic
+ increment and decrement. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+#define TEST_INCDEC(TYPE, VALUE, PREOP, POSTOP, PRE_P, CHANGE) \
+ do \
+ { \
+ static volatile _Atomic (TYPE) a = (TYPE) (VALUE); \
+ if (PREOP a POSTOP != (PRE_P \
+ ? (TYPE) ((TYPE) (VALUE) + (CHANGE)) \
+ : (TYPE) (VALUE))) \
+ abort (); \
+ if (a != (TYPE) ((TYPE) (VALUE) + (CHANGE))) \
+ abort (); \
+ } \
+ while (0)
+
+#define TEST_INCDEC_ARITH(VALUE, PREOP, POSTOP, PRE_P, CHANGE) \
+ do \
+ { \
+ TEST_INCDEC (_Bool, (VALUE), PREOP, POSTOP, (PRE_P), (CHANGE)); \
+ TEST_INCDEC (char, (VALUE), PREOP, POSTOP, (PRE_P), (CHANGE)); \
+ TEST_INCDEC (signed char, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (unsigned char, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (signed short, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (unsigned short, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (signed int, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (unsigned int, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (signed long, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (unsigned long, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (signed long long, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (unsigned long long, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ TEST_INCDEC (float, (VALUE), PREOP, POSTOP, (PRE_P), (CHANGE)); \
+ TEST_INCDEC (double, (VALUE), PREOP, POSTOP, (PRE_P), (CHANGE)); \
+ TEST_INCDEC (long double, (VALUE), PREOP, POSTOP, (PRE_P), \
+ (CHANGE)); \
+ } \
+ while (0)
+
+#define TEST_ALL_INCDEC_ARITH(VALUE) \
+ do \
+ { \
+ TEST_INCDEC_ARITH ((VALUE), ++, , 1, 1); \
+ TEST_INCDEC_ARITH ((VALUE), --, , 1, -1); \
+ TEST_INCDEC_ARITH ((VALUE), , ++, 0, 1); \
+ TEST_INCDEC_ARITH ((VALUE), , --, 0, -1); \
+ } \
+ while (0)
+
+static void
+test_incdec (void)
+{
+ TEST_ALL_INCDEC_ARITH (0);
+ TEST_ALL_INCDEC_ARITH (1);
+ TEST_ALL_INCDEC_ARITH (2);
+ TEST_ALL_INCDEC_ARITH (-1);
+ TEST_ALL_INCDEC_ARITH (1ULL << 60);
+ TEST_ALL_INCDEC_ARITH (1.5);
+ static int ia[2];
+ TEST_INCDEC (int *, &ia[1], ++, , 1, 1);
+ TEST_INCDEC (int *, &ia[1], --, , 1, -1);
+ TEST_INCDEC (int *, &ia[1], , ++, 0, 1);
+ TEST_INCDEC (int *, &ia[1], , --, 0, -1);
+}
+
+int
+main (void)
+{
+ test_incdec ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
new file mode 100644
index 000000000..1558200db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-4.c
@@ -0,0 +1,209 @@
+/* Test for _Atomic in C11. Test that compare-and-exchange is
+ operating properly when operations on the same variable are carried
+ out in two threads. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
+/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
+/* { dg-require-effective-target pthread } */
+
+#include <stdint.h>
+#include <pthread.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define ITER_COUNT 10000
+
+static volatile _Atomic bool thread_ready;
+
+/* Generate test code (with NAME used to name functions and variables)
+ for atomic compound assignments to a variable of type LHSTYPE. The
+ variable is initialized to INIT, then PRE var POST is executed
+ ITER_COUNT times in each of two threads, and the final result
+ should be FINAL. A function test_main_##NAME is generated that
+ returns nonzero on failure, zero on success. */
+
+#define TEST_FUNCS(NAME, LHSTYPE, PRE, POST, INIT, FINAL) \
+ \
+static volatile _Atomic LHSTYPE var_##NAME = (INIT); \
+ \
+static void * \
+test_thread_##NAME (void *arg) \
+{ \
+ thread_ready = true; \
+ for (int i = 0; i < ITER_COUNT; i++) \
+ PRE var_##NAME POST; \
+ return NULL; \
+} \
+ \
+static int \
+test_main_##NAME (void) \
+{ \
+ thread_ready = false; \
+ pthread_t thread_id; \
+ int pret = pthread_create (&thread_id, NULL, test_thread_##NAME, \
+ NULL); \
+ if (pret != 0) \
+ { \
+ printf ("pthread_create failed: %d\n", pret); \
+ return 1; \
+ } \
+ while (!thread_ready) \
+ ; \
+ for (int i = 0; i < ITER_COUNT; i++) \
+ PRE var_##NAME POST; \
+ pthread_join (thread_id, NULL); \
+ if (var_##NAME != (FINAL)) \
+ { \
+ printf (#NAME " failed\n"); \
+ return 1; \
+ } \
+ else \
+ { \
+ printf (#NAME " passed\n"); \
+ return 0; \
+ } \
+}
+
+TEST_FUNCS (uint8_add, uint8_t, , += 1, 0, (uint8_t) 20000)
+TEST_FUNCS (uint8_add_3, uint8_t, , += 3, 0, (uint8_t) 60000)
+TEST_FUNCS (uint16_add, uint16_t, , += 1, 0, (uint16_t) 20000)
+TEST_FUNCS (uint16_add_3, uint16_t, , += 3, 0, (uint16_t) 60000)
+TEST_FUNCS (uint32_add, uint32_t, , += 1, 0, (uint32_t) 20000)
+TEST_FUNCS (uint32_add_3, uint32_t, , += 3, 0, (uint32_t) 60000)
+TEST_FUNCS (uint64_add, uint64_t, , += 1, 0, (uint64_t) 20000)
+TEST_FUNCS (uint64_add_3, uint64_t, , += 3, 0, (uint64_t) 60000)
+TEST_FUNCS (uint64_add_neg, uint64_t, , += 1, -10000, (uint64_t) 10000)
+TEST_FUNCS (float_add, float, , += 1, 0, 20000)
+TEST_FUNCS (double_add, double, , += 1, 0, 20000)
+TEST_FUNCS (long_double_add, long double, , += 1, 0, 20000)
+TEST_FUNCS (complex_float_add, _Complex float, , += 1, 0, 20000)
+TEST_FUNCS (complex_double_add, _Complex double, , += 1, 0, 20000)
+TEST_FUNCS (complex_long_double_add, _Complex long double, , += 1, 0, 20000)
+TEST_FUNCS (uint8_postinc, uint8_t, , ++, 0, (uint8_t) 20000)
+TEST_FUNCS (uint16_postinc, uint16_t, , ++, 0, (uint16_t) 20000)
+TEST_FUNCS (uint32_postinc, uint32_t, , ++, 0, (uint32_t) 20000)
+TEST_FUNCS (uint64_postinc, uint64_t, , ++, 0, (uint64_t) 20000)
+TEST_FUNCS (uint64_postinc_neg, uint64_t, , ++, -10000, (uint64_t) 10000)
+TEST_FUNCS (float_postinc, float, , ++, 0, 20000)
+TEST_FUNCS (double_postinc, double, , ++, 0, 20000)
+TEST_FUNCS (long_double_postinc, long double, , ++, 0, 20000)
+TEST_FUNCS (uint8_preinc, uint8_t, ++, , 0, (uint8_t) 20000)
+TEST_FUNCS (uint16_preinc, uint16_t, ++, , 0, (uint16_t) 20000)
+TEST_FUNCS (uint32_preinc, uint32_t, ++, , 0, (uint32_t) 20000)
+TEST_FUNCS (uint64_preinc, uint64_t, ++, , 0, (uint64_t) 20000)
+TEST_FUNCS (uint64_preinc_neg, uint64_t, ++, , -10000, (uint64_t) 10000)
+TEST_FUNCS (float_preinc, float, ++, , 0, 20000)
+TEST_FUNCS (double_preinc, double, ++, , 0, 20000)
+TEST_FUNCS (long_double_preinc, long double, ++, , 0, 20000)
+TEST_FUNCS (uint8_sub, uint8_t, , -= 1, 0, (uint8_t) -20000)
+TEST_FUNCS (uint8_sub_3, uint8_t, , -= 3, 0, (uint8_t) -60000)
+TEST_FUNCS (uint16_sub, uint16_t, , -= 1, 0, (uint16_t) -20000)
+TEST_FUNCS (uint16_sub_3, uint16_t, , -= 3, 0, (uint16_t) -60000)
+TEST_FUNCS (uint32_sub, uint32_t, , -= 1, 0, (uint32_t) -20000)
+TEST_FUNCS (uint32_sub_3, uint32_t, , -= 3, 0, (uint32_t) -60000)
+TEST_FUNCS (uint64_sub, uint64_t, , -= 1, 0, (uint64_t) -20000)
+TEST_FUNCS (uint64_sub_3, uint64_t, , -= 3, 0, (uint64_t) -60000)
+TEST_FUNCS (uint64_sub_neg, uint64_t, , -= 1, 10000, (uint64_t) -10000)
+TEST_FUNCS (float_sub, float, , -= 1, 0, -20000)
+TEST_FUNCS (double_sub, double, , -= 1, 0, -20000)
+TEST_FUNCS (long_double_sub, long double, , -= 1, 0, -20000)
+TEST_FUNCS (complex_float_sub, _Complex float, , -= 1, 0, -20000)
+TEST_FUNCS (complex_double_sub, _Complex double, , -= 1, 0, -20000)
+TEST_FUNCS (complex_long_double_sub, _Complex long double, , -= 1, 0, -20000)
+TEST_FUNCS (uint8_postdec, uint8_t, , --, 0, (uint8_t) -20000)
+TEST_FUNCS (uint16_postdec, uint16_t, , --, 0, (uint16_t) -20000)
+TEST_FUNCS (uint32_postdec, uint32_t, , --, 0, (uint32_t) -20000)
+TEST_FUNCS (uint64_postdec, uint64_t, , --, 0, (uint64_t) -20000)
+TEST_FUNCS (uint64_postdec_neg, uint64_t, , --, 10000, (uint64_t) -10000)
+TEST_FUNCS (float_postdec, float, , --, 0, -20000)
+TEST_FUNCS (double_postdec, double, , --, 0, -20000)
+TEST_FUNCS (long_double_postdec, long double, , --, 0, -20000)
+TEST_FUNCS (uint8_predec, uint8_t, --, , 0, (uint8_t) -20000)
+TEST_FUNCS (uint16_predec, uint16_t, --, , 0, (uint16_t) -20000)
+TEST_FUNCS (uint32_predec, uint32_t, --, , 0, (uint32_t) -20000)
+TEST_FUNCS (uint64_predec, uint64_t, --, , 0, (uint64_t) -20000)
+TEST_FUNCS (uint64_predec_neg, uint64_t, --, , 10000, (uint64_t) -10000)
+TEST_FUNCS (float_predec, float, --, , 0, -20000)
+TEST_FUNCS (double_predec, double, --, , 0, -20000)
+TEST_FUNCS (long_double_predec, long double, --, , 0, -20000)
+TEST_FUNCS (uint8_mul, uint8_t, , *= 3, 1, (uint8_t) 0x81)
+TEST_FUNCS (uint16_mul, uint16_t, , *= 3, 1, (uint16_t) 0x9681)
+TEST_FUNCS (uint32_mul, uint32_t, , *= 3, 1, (uint32_t) 0x62b49681U)
+TEST_FUNCS (uint64_mul, uint64_t, , *= 3, 1, (uint64_t) 0xcd926beb62b49681ULL)
+
+int
+main (void)
+{
+ int ret = 0;
+ ret |= test_main_uint8_add ();
+ ret |= test_main_uint8_add_3 ();
+ ret |= test_main_uint16_add ();
+ ret |= test_main_uint16_add_3 ();
+ ret |= test_main_uint32_add ();
+ ret |= test_main_uint32_add_3 ();
+ ret |= test_main_uint64_add ();
+ ret |= test_main_uint64_add_3 ();
+ ret |= test_main_uint64_add_neg ();
+ ret |= test_main_float_add ();
+ ret |= test_main_double_add ();
+ ret |= test_main_long_double_add ();
+ ret |= test_main_complex_float_add ();
+ ret |= test_main_complex_double_add ();
+ ret |= test_main_complex_long_double_add ();
+ ret |= test_main_uint8_postinc ();
+ ret |= test_main_uint16_postinc ();
+ ret |= test_main_uint32_postinc ();
+ ret |= test_main_uint64_postinc ();
+ ret |= test_main_uint64_postinc_neg ();
+ ret |= test_main_float_postinc ();
+ ret |= test_main_double_postinc ();
+ ret |= test_main_long_double_postinc ();
+ ret |= test_main_uint8_preinc ();
+ ret |= test_main_uint16_preinc ();
+ ret |= test_main_uint32_preinc ();
+ ret |= test_main_uint64_preinc ();
+ ret |= test_main_uint64_preinc_neg ();
+ ret |= test_main_float_preinc ();
+ ret |= test_main_double_preinc ();
+ ret |= test_main_long_double_preinc ();
+ ret |= test_main_uint8_sub ();
+ ret |= test_main_uint8_sub_3 ();
+ ret |= test_main_uint16_sub ();
+ ret |= test_main_uint16_sub_3 ();
+ ret |= test_main_uint32_sub ();
+ ret |= test_main_uint32_sub_3 ();
+ ret |= test_main_uint64_sub ();
+ ret |= test_main_uint64_sub_3 ();
+ ret |= test_main_uint64_sub_neg ();
+ ret |= test_main_float_sub ();
+ ret |= test_main_double_sub ();
+ ret |= test_main_long_double_sub ();
+ ret |= test_main_complex_float_sub ();
+ ret |= test_main_complex_double_sub ();
+ ret |= test_main_complex_long_double_sub ();
+ ret |= test_main_uint8_postdec ();
+ ret |= test_main_uint16_postdec ();
+ ret |= test_main_uint32_postdec ();
+ ret |= test_main_uint64_postdec ();
+ ret |= test_main_uint64_postdec_neg ();
+ ret |= test_main_float_postdec ();
+ ret |= test_main_double_postdec ();
+ ret |= test_main_long_double_postdec ();
+ ret |= test_main_uint8_predec ();
+ ret |= test_main_uint16_predec ();
+ ret |= test_main_uint32_predec ();
+ ret |= test_main_uint64_predec ();
+ ret |= test_main_uint64_predec_neg ();
+ ret |= test_main_float_predec ();
+ ret |= test_main_double_predec ();
+ ret |= test_main_long_double_predec ();
+ ret |= test_main_uint8_mul ();
+ ret |= test_main_uint16_mul ();
+ ret |= test_main_uint32_mul ();
+ ret |= test_main_uint64_mul ();
+ if (ret)
+ abort ();
+ else
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
new file mode 100644
index 000000000..bc87de4cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-5.c
@@ -0,0 +1,542 @@
+/* Test for _Atomic in C11. Test floating-point exceptions for
+ compound assignment are consistent with result (so that if multiple
+ iterations of the compare-and-exchange loop are needed, exceptions
+ get properly cleared). */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors -pthread -D_POSIX_C_SOURCE=200809L" } */
+/* { dg-additional-options "-D_XOPEN_SOURCE=600" { target *-*-solaris2.1[0-9]* } }
+/* { dg-require-effective-target fenv_exceptions } */
+/* { dg-require-effective-target pthread } */
+
+#include <fenv.h>
+#include <float.h>
+#include <pthread.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define TEST_ALL_EXCEPT (FE_DIVBYZERO \
+ | FE_INEXACT \
+ | FE_INVALID \
+ | FE_OVERFLOW \
+ | FE_UNDERFLOW)
+
+#define ITER_COUNT 10000
+
+static volatile _Atomic bool thread_ready, thread_stop;
+
+/* Generate test code (with NAME used to name functions and variables)
+ for atomic compound assignments to a variable of type LHSTYPE. One
+ thread repeatedly stores the values INIT1 and INIT2 in a variable,
+ while the other repeatedly executes PRE var POST having set
+ floating-point exceptions to BEXC. If the value of the assignment
+ operation satisfies VALTEST1 (var), the floating-point exceptions
+ should be BEXC | EXC1; otherwise, they should be BEXC | EXC2. A
+ function test_main_##NAME is generated that returns nonzero on
+ failure, zero on success. */
+
+#define TEST_FUNCS(NAME, LHSTYPE, PRE, POST, BEXC, \
+ INIT1, VALTEST1, EXC1, INIT2, EXC2) \
+ \
+static volatile _Atomic LHSTYPE var_##NAME; \
+ \
+static void * \
+test_thread_##NAME (void *arg) \
+{ \
+ thread_ready = true; \
+ while (!thread_stop) \
+ { \
+ var_##NAME = (INIT1); \
+ var_##NAME = (INIT2); \
+ } \
+ return NULL; \
+} \
+ \
+static int \
+test_main_##NAME (void) \
+{ \
+ thread_stop = false; \
+ thread_ready = false; \
+ var_##NAME = (INIT1); \
+ pthread_t thread_id; \
+ int pret = pthread_create (&thread_id, NULL, test_thread_##NAME, \
+ NULL); \
+ if (pret != 0) \
+ { \
+ printf ("pthread_create failed: %d\n", pret); \
+ return 1; \
+ } \
+ int num_1_pass = 0, num_1_fail = 0, num_2_pass = 0, num_2_fail = 0; \
+ while (!thread_ready) \
+ ; \
+ for (int i = 0; i < ITER_COUNT; i++) \
+ { \
+ feclearexcept (FE_ALL_EXCEPT); \
+ feraiseexcept (BEXC); \
+ LHSTYPE r = (PRE var_##NAME POST); \
+ int rexc = fetestexcept (TEST_ALL_EXCEPT); \
+ if (VALTEST1 (r)) \
+ { \
+ if (rexc == ((BEXC) | (EXC1))) \
+ num_1_pass++; \
+ else \
+ num_1_fail++; \
+ var_##NAME = (INIT2); \
+ } \
+ else \
+ { \
+ if (rexc == ((BEXC) | (EXC2))) \
+ num_2_pass++; \
+ else \
+ num_2_fail++; \
+ var_##NAME = (INIT1); \
+ } \
+ } \
+ thread_stop = true; \
+ pthread_join (thread_id, NULL); \
+ printf (#NAME " (a) %d pass, %d fail; (b) %d pass, %d fail\n", \
+ num_1_pass, num_1_fail, num_2_pass, num_2_fail); \
+ return num_1_fail || num_2_fail; \
+}
+
+TEST_FUNCS (float_add_invalid, float, , += __builtin_inff (), 0,
+ 0, __builtin_isinf, 0,
+ -__builtin_inff (), FE_INVALID)
+TEST_FUNCS (float_add_invalid_prev, float, , += __builtin_inff (),
+ FE_DIVBYZERO | FE_INEXACT | FE_OVERFLOW | FE_UNDERFLOW,
+ 0, __builtin_isinf, 0,
+ -__builtin_inff (), FE_INVALID)
+TEST_FUNCS (float_add_overflow, float, , += FLT_MAX, 0,
+ FLT_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_add_overflow_prev, float, , += FLT_MAX, FE_INVALID,
+ FLT_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_add_overflow_double, float, , += (double) FLT_MAX, 0,
+ FLT_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_add_overflow_long_double, float, , += (long double) FLT_MAX, 0,
+ FLT_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+#define NOT_FLT_EPSILON_2(X) ((X) != FLT_EPSILON / 2)
+TEST_FUNCS (float_add_inexact, float, , += FLT_EPSILON / 2, 0,
+ 1.0f, NOT_FLT_EPSILON_2, FE_INEXACT,
+ 0, 0)
+#define NOT_0(X) ((X) != 0)
+TEST_FUNCS (float_add_inexact_int, float, , += 1, 0,
+ FLT_EPSILON / 2, NOT_0, FE_INEXACT,
+ -1, 0)
+TEST_FUNCS (float_preinc_inexact, float, ++, , 0,
+ FLT_EPSILON / 2, NOT_0, FE_INEXACT,
+ -1, 0)
+#define NOT_MINUS_1(X) ((X) != -1)
+TEST_FUNCS (float_postinc_inexact, float, , ++, 0,
+ FLT_EPSILON / 2, NOT_MINUS_1, FE_INEXACT,
+ -1, 0)
+#if FLT_EVAL_METHOD == 0
+TEST_FUNCS (long_add_float_inexact, long, , += 2 / FLT_EPSILON, 0,
+ 1, NOT_0, FE_INEXACT,
+ -2 / FLT_EPSILON, 0)
+#endif
+#define REAL_ISINF(X) (__builtin_isinf (__real__ (X)))
+TEST_FUNCS (complex_float_add_overflow, _Complex float, , += FLT_MAX, 0,
+ FLT_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_sub_invalid, float, , -= __builtin_inff (), 0,
+ 0, __builtin_isinf, 0,
+ __builtin_inff (), FE_INVALID)
+TEST_FUNCS (float_sub_overflow, float, , -= FLT_MAX, 0,
+ -FLT_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+#define NOT_MINUS_FLT_EPSILON_2(X) ((X) != -FLT_EPSILON / 2)
+TEST_FUNCS (float_sub_inexact, float, , -= FLT_EPSILON / 2, 0,
+ -1.0f, NOT_MINUS_FLT_EPSILON_2, FE_INEXACT,
+ 0, 0)
+#define NOT_0(X) ((X) != 0)
+TEST_FUNCS (float_sub_inexact_int, float, , -= 1, 0,
+ -FLT_EPSILON / 2, NOT_0, FE_INEXACT,
+ 1, 0)
+TEST_FUNCS (float_predec_inexact, float, --, , 0,
+ -FLT_EPSILON / 2, NOT_0, FE_INEXACT,
+ 1, 0)
+#define NOT_1(X) ((X) != 1)
+TEST_FUNCS (float_postdec_inexact, float, , --, 0,
+ -FLT_EPSILON / 2, NOT_1, FE_INEXACT,
+ 1, 0)
+#if FLT_EVAL_METHOD == 0
+TEST_FUNCS (long_sub_float_inexact, long, , -= 2 / FLT_EPSILON, 0,
+ -1, NOT_0, FE_INEXACT,
+ 2 / FLT_EPSILON, 0)
+#endif
+TEST_FUNCS (complex_float_sub_overflow, _Complex float, , -= FLT_MAX, 0,
+ -FLT_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_mul_invalid, float, , *= __builtin_inff (), 0,
+ __builtin_inff (), __builtin_isinf, 0,
+ 0, FE_INVALID)
+TEST_FUNCS (float_mul_overflow, float, , *= FLT_MAX, 0,
+ FLT_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+#define IS_0(X) ((X) == 0)
+TEST_FUNCS (float_mul_underflow, float, , *= FLT_MIN, 0,
+ FLT_MIN, IS_0, FE_UNDERFLOW | FE_INEXACT,
+ 1, 0)
+TEST_FUNCS (float_mul_inexact, float, , *= 1 + FLT_EPSILON, 0,
+ 1 + FLT_EPSILON, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_mul_inexact_int, float, , *= 3, 0,
+ 1 + FLT_EPSILON, NOT_0, FE_INEXACT,
+ 0, 0)
+#if FLT_EVAL_METHOD == 0
+TEST_FUNCS(long_mul_float_inexact, long, , *= 3.0f, 0,
+ 1 + 1 / FLT_EPSILON, NOT_0, FE_INEXACT,
+ 0, 0)
+#endif
+TEST_FUNCS (complex_float_mul_overflow, _Complex float, , *= FLT_MAX, 0,
+ FLT_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_div_invalid_divbyzero, float, , /= 0.0f, 0,
+ 1, __builtin_isinf, FE_DIVBYZERO,
+ 0, FE_INVALID)
+TEST_FUNCS (float_div_overflow, float, , /= FLT_MIN, 0,
+ FLT_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_div_underflow, float, , /= FLT_MAX, 0,
+ FLT_MIN, IS_0, FE_UNDERFLOW | FE_INEXACT,
+ FLT_MAX, 0)
+TEST_FUNCS (float_div_inexact, float, , /= 3.0f, 0,
+ 1, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (float_div_inexact_int, float, , /= 3, 0,
+ 1, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (int_div_float_inexact, int, , /= 3.0f, 0,
+ 4, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (complex_float_div_overflow, _Complex float, , /= FLT_MIN, 0,
+ FLT_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+
+TEST_FUNCS (double_add_invalid, double, , += __builtin_inf (), 0,
+ 0, __builtin_isinf, 0,
+ -__builtin_inf (), FE_INVALID)
+TEST_FUNCS (double_add_overflow, double, , += DBL_MAX, 0,
+ DBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_add_overflow_long_double, double, , += (long double) DBL_MAX, 0,
+ DBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+#define NOT_DBL_EPSILON_2(X) ((X) != DBL_EPSILON / 2)
+TEST_FUNCS (double_add_inexact, double, , += DBL_EPSILON / 2, 0,
+ 1.0, NOT_DBL_EPSILON_2, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_add_inexact_int, double, , += 1, 0,
+ DBL_EPSILON / 2, NOT_0, FE_INEXACT,
+ -1, 0)
+TEST_FUNCS (double_preinc_inexact, double, ++, , 0,
+ DBL_EPSILON / 2, NOT_0, FE_INEXACT,
+ -1, 0)
+TEST_FUNCS (double_postinc_inexact, double, , ++, 0,
+ DBL_EPSILON / 2, NOT_MINUS_1, FE_INEXACT,
+ -1, 0)
+#if FLT_EVAL_METHOD == 0
+TEST_FUNCS (long_long_add_double_inexact, long long, , += 2 / DBL_EPSILON, 0,
+ 1, NOT_0, FE_INEXACT,
+ -2 / DBL_EPSILON, 0)
+#endif
+TEST_FUNCS (complex_double_add_overflow, _Complex double, , += DBL_MAX, 0,
+ DBL_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_sub_invalid, double, , -= __builtin_inf (), 0,
+ 0, __builtin_isinf, 0,
+ __builtin_inf (), FE_INVALID)
+TEST_FUNCS (double_sub_overflow, double, , -= DBL_MAX, 0,
+ -DBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+#define NOT_MINUS_DBL_EPSILON_2(X) ((X) != -DBL_EPSILON / 2)
+TEST_FUNCS (double_sub_inexact, double, , -= DBL_EPSILON / 2, 0,
+ -1.0, NOT_MINUS_DBL_EPSILON_2, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_sub_inexact_int, double, , -= 1, 0,
+ -DBL_EPSILON / 2, NOT_0, FE_INEXACT,
+ 1, 0)
+TEST_FUNCS (double_predec_inexact, double, --, , 0,
+ -DBL_EPSILON / 2, NOT_0, FE_INEXACT,
+ 1, 0)
+TEST_FUNCS (double_postdec_inexact, double, , --, 0,
+ -DBL_EPSILON / 2, NOT_1, FE_INEXACT,
+ 1, 0)
+#if FLT_EVAL_METHOD == 0
+TEST_FUNCS (long_long_sub_double_inexact, long long, , -= 2 / DBL_EPSILON, 0,
+ -1, NOT_0, FE_INEXACT,
+ 2 / DBL_EPSILON, 0)
+#endif
+TEST_FUNCS (complex_double_sub_overflow, _Complex double, , -= DBL_MAX, 0,
+ -DBL_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_mul_invalid, double, , *= __builtin_inf (), 0,
+ __builtin_inf (), __builtin_isinf, 0,
+ 0, FE_INVALID)
+TEST_FUNCS (double_mul_overflow, double, , *= DBL_MAX, 0,
+ DBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_mul_overflow_float, double, , *= FLT_MAX, 0,
+ DBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_mul_underflow, double, , *= DBL_MIN, 0,
+ DBL_MIN, IS_0, FE_UNDERFLOW | FE_INEXACT,
+ 1, 0)
+TEST_FUNCS (double_mul_inexact, double, , *= 1 + DBL_EPSILON, 0,
+ 1 + DBL_EPSILON, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_mul_inexact_int, double, , *= 3, 0,
+ 1 + DBL_EPSILON, NOT_0, FE_INEXACT,
+ 0, 0)
+#if FLT_EVAL_METHOD == 0
+TEST_FUNCS(long_long_mul_double_inexact, long long, , *= 3.0, 0,
+ 1 + 1 / DBL_EPSILON, NOT_0, FE_INEXACT,
+ 0, 0)
+#endif
+TEST_FUNCS (complex_double_mul_overflow, _Complex double, , *= DBL_MAX, 0,
+ DBL_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_div_invalid_divbyzero, double, , /= 0.0, 0,
+ 1, __builtin_isinf, FE_DIVBYZERO,
+ 0, FE_INVALID)
+TEST_FUNCS (double_div_overflow, double, , /= DBL_MIN, 0,
+ DBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_div_underflow, double, , /= DBL_MAX, 0,
+ DBL_MIN, IS_0, FE_UNDERFLOW | FE_INEXACT,
+ DBL_MAX, 0)
+TEST_FUNCS (double_div_inexact, double, , /= 3.0, 0,
+ 1, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (double_div_inexact_int, double, , /= 3, 0,
+ 1, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (int_div_double_inexact, int, , /= 3.0, 0,
+ 4, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (complex_double_div_overflow, _Complex double, , /= DBL_MIN, 0,
+ DBL_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+
+TEST_FUNCS (long_double_add_invalid, long double, , += __builtin_infl (), 0,
+ 0, __builtin_isinf, 0,
+ -__builtin_infl (), FE_INVALID)
+TEST_FUNCS (long_double_add_overflow, long double, , += LDBL_MAX, 0,
+ LDBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+#define NOT_LDBL_EPSILON_2(X) ((X) != LDBL_EPSILON / 2)
+#if LDBL_MANT_DIG != 106
+TEST_FUNCS (long_double_add_inexact, long double, , += LDBL_EPSILON / 2, 0,
+ 1.0L, NOT_LDBL_EPSILON_2, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_add_inexact_int, long double, , += 1, 0,
+ LDBL_EPSILON / 2, NOT_0, FE_INEXACT,
+ -1, 0)
+TEST_FUNCS (long_double_preinc_inexact, long double, ++, , 0,
+ LDBL_EPSILON / 2, NOT_0, FE_INEXACT,
+ -1, 0)
+TEST_FUNCS (long_double_postinc_inexact, long double, , ++, 0,
+ LDBL_EPSILON / 2, NOT_MINUS_1, FE_INEXACT,
+ -1, 0)
+#endif
+TEST_FUNCS (complex_long_double_add_overflow, _Complex long double, , += LDBL_MAX, 0,
+ LDBL_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_sub_invalid, long double, , -= __builtin_infl (), 0,
+ 0, __builtin_isinf, 0,
+ __builtin_infl (), FE_INVALID)
+TEST_FUNCS (long_double_sub_overflow, long double, , -= LDBL_MAX, 0,
+ -LDBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+#define NOT_MINUS_LDBL_EPSILON_2(X) ((X) != -LDBL_EPSILON / 2)
+#if LDBL_MANT_DIG != 106
+TEST_FUNCS (long_double_sub_inexact, long double, , -= LDBL_EPSILON / 2, 0,
+ -1.0L, NOT_MINUS_LDBL_EPSILON_2, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_sub_inexact_int, long double, , -= 1, 0,
+ -LDBL_EPSILON / 2, NOT_0, FE_INEXACT,
+ 1, 0)
+TEST_FUNCS (long_double_predec_inexact, long double, --, , 0,
+ -LDBL_EPSILON / 2, NOT_0, FE_INEXACT,
+ 1, 0)
+TEST_FUNCS (long_double_postdec_inexact, long double, , --, 0,
+ -LDBL_EPSILON / 2, NOT_1, FE_INEXACT,
+ 1, 0)
+#endif
+TEST_FUNCS (complex_long_double_sub_overflow, _Complex long double, , -= LDBL_MAX, 0,
+ -LDBL_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_mul_invalid, long double, , *= __builtin_infl (), 0,
+ __builtin_infl (), __builtin_isinf, 0,
+ 0, FE_INVALID)
+TEST_FUNCS (long_double_mul_overflow, long double, , *= LDBL_MAX, 0,
+ LDBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_mul_overflow_float, long double, , *= FLT_MAX, 0,
+ LDBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_mul_overflow_double, long double, , *= DBL_MAX, 0,
+ LDBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_mul_underflow, long double, , *= LDBL_MIN, 0,
+ LDBL_MIN, IS_0, FE_UNDERFLOW | FE_INEXACT,
+ 1, 0)
+#if LDBL_MANT_DIG != 106
+TEST_FUNCS (long_double_mul_inexact, long double, , *= 1 + LDBL_EPSILON, 0,
+ 1 + LDBL_EPSILON, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_mul_inexact_int, long double, , *= 3, 0,
+ 1 + LDBL_EPSILON, NOT_0, FE_INEXACT,
+ 0, 0)
+#endif
+TEST_FUNCS (complex_long_double_mul_overflow, _Complex long double, , *= LDBL_MAX, 0,
+ LDBL_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_div_invalid_divbyzero, long double, , /= 0.0L, 0,
+ 1, __builtin_isinf, FE_DIVBYZERO,
+ 0, FE_INVALID)
+TEST_FUNCS (long_double_div_overflow, long double, , /= LDBL_MIN, 0,
+ LDBL_MAX, __builtin_isinf, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_div_underflow, long double, , /= LDBL_MAX, 0,
+ LDBL_MIN, IS_0, FE_UNDERFLOW | FE_INEXACT,
+ LDBL_MAX, 0)
+TEST_FUNCS (long_double_div_inexact, long double, , /= 3.0L, 0,
+ 1, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (long_double_div_inexact_int, long double, , /= 3, 0,
+ 1, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (int_div_long_double_inexact, int, , /= 3.0L, 0,
+ 4, NOT_0, FE_INEXACT,
+ 0, 0)
+TEST_FUNCS (complex_long_double_div_overflow, _Complex long double, , /= LDBL_MIN, 0,
+ LDBL_MAX, REAL_ISINF, FE_OVERFLOW | FE_INEXACT,
+ 0, 0)
+
+int
+main (void)
+{
+ int ret = 0;
+ ret |= test_main_float_add_invalid ();
+ ret |= test_main_float_add_invalid_prev ();
+ ret |= test_main_float_add_overflow ();
+ ret |= test_main_float_add_overflow_prev ();
+ ret |= test_main_float_add_overflow_double ();
+ ret |= test_main_float_add_overflow_long_double ();
+ ret |= test_main_float_add_inexact ();
+ ret |= test_main_float_add_inexact_int ();
+ ret |= test_main_float_preinc_inexact ();
+ ret |= test_main_float_postinc_inexact ();
+#if FLT_EVAL_METHOD == 0
+ ret |= test_main_long_add_float_inexact ();
+#endif
+ ret |= test_main_complex_float_add_overflow ();
+ ret |= test_main_float_sub_invalid ();
+ ret |= test_main_float_sub_overflow ();
+ ret |= test_main_float_sub_inexact ();
+ ret |= test_main_float_sub_inexact_int ();
+ ret |= test_main_float_predec_inexact ();
+ ret |= test_main_float_postdec_inexact ();
+#if FLT_EVAL_METHOD == 0
+ ret |= test_main_long_sub_float_inexact ();
+#endif
+ ret |= test_main_complex_float_sub_overflow ();
+ ret |= test_main_float_mul_invalid ();
+ ret |= test_main_float_mul_overflow ();
+ ret |= test_main_float_mul_underflow ();
+ ret |= test_main_float_mul_inexact ();
+ ret |= test_main_float_mul_inexact_int ();
+#if FLT_EVAL_METHOD == 0
+ ret |= test_main_long_mul_float_inexact ();
+#endif
+ ret |= test_main_complex_float_mul_overflow ();
+ ret |= test_main_float_div_invalid_divbyzero ();
+ ret |= test_main_float_div_overflow ();
+ ret |= test_main_float_div_underflow ();
+ ret |= test_main_float_div_inexact ();
+ ret |= test_main_float_div_inexact_int ();
+ ret |= test_main_int_div_float_inexact ();
+ ret |= test_main_complex_float_div_overflow ();
+ ret |= test_main_double_add_invalid ();
+ ret |= test_main_double_add_overflow ();
+ ret |= test_main_double_add_overflow_long_double ();
+ ret |= test_main_double_add_inexact ();
+ ret |= test_main_double_add_inexact_int ();
+ ret |= test_main_double_preinc_inexact ();
+ ret |= test_main_double_postinc_inexact ();
+#if FLT_EVAL_METHOD == 0
+ ret |= test_main_long_long_add_double_inexact ();
+#endif
+ ret |= test_main_complex_double_add_overflow ();
+ ret |= test_main_double_sub_invalid ();
+ ret |= test_main_double_sub_overflow ();
+ ret |= test_main_double_sub_inexact ();
+ ret |= test_main_double_sub_inexact_int ();
+ ret |= test_main_double_predec_inexact ();
+ ret |= test_main_double_postdec_inexact ();
+#if FLT_EVAL_METHOD == 0
+ ret |= test_main_long_long_sub_double_inexact ();
+#endif
+ ret |= test_main_complex_double_sub_overflow ();
+ ret |= test_main_double_mul_invalid ();
+ ret |= test_main_double_mul_overflow ();
+ ret |= test_main_double_mul_overflow_float ();
+ ret |= test_main_double_mul_underflow ();
+ ret |= test_main_double_mul_inexact ();
+ ret |= test_main_double_mul_inexact_int ();
+#if FLT_EVAL_METHOD == 0
+ ret |= test_main_long_long_mul_double_inexact ();
+#endif
+ ret |= test_main_complex_double_mul_overflow ();
+ ret |= test_main_double_div_invalid_divbyzero ();
+ ret |= test_main_double_div_overflow ();
+ ret |= test_main_double_div_underflow ();
+ ret |= test_main_double_div_inexact ();
+ ret |= test_main_double_div_inexact_int ();
+ ret |= test_main_int_div_double_inexact ();
+ ret |= test_main_complex_double_div_overflow ();
+ ret |= test_main_long_double_add_invalid ();
+ ret |= test_main_long_double_add_overflow ();
+#if LDBL_MANT_DIG != 106
+ ret |= test_main_long_double_add_inexact ();
+ ret |= test_main_long_double_add_inexact_int ();
+ ret |= test_main_long_double_preinc_inexact ();
+ ret |= test_main_long_double_postinc_inexact ();
+#endif
+ ret |= test_main_complex_long_double_add_overflow ();
+ ret |= test_main_long_double_sub_invalid ();
+ ret |= test_main_long_double_sub_overflow ();
+#if LDBL_MANT_DIG != 106
+ ret |= test_main_long_double_sub_inexact ();
+ ret |= test_main_long_double_sub_inexact_int ();
+ ret |= test_main_long_double_predec_inexact ();
+ ret |= test_main_long_double_postdec_inexact ();
+#endif
+ ret |= test_main_complex_long_double_sub_overflow ();
+ ret |= test_main_long_double_mul_invalid ();
+ ret |= test_main_long_double_mul_overflow ();
+ ret |= test_main_long_double_mul_overflow_float ();
+ ret |= test_main_long_double_mul_overflow_double ();
+ ret |= test_main_long_double_mul_underflow ();
+#if LDBL_MANT_DIG != 106
+ ret |= test_main_long_double_mul_inexact ();
+ ret |= test_main_long_double_mul_inexact_int ();
+#endif
+ ret |= test_main_complex_long_double_mul_overflow ();
+ ret |= test_main_long_double_div_invalid_divbyzero ();
+ ret |= test_main_long_double_div_overflow ();
+ ret |= test_main_long_double_div_underflow ();
+ ret |= test_main_long_double_div_inexact ();
+ ret |= test_main_long_double_div_inexact_int ();
+ ret |= test_main_int_div_long_double_inexact ();
+ ret |= test_main_complex_long_double_div_overflow ();
+ if (ret != 0)
+ abort ();
+ else
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-1.c
new file mode 100644
index 000000000..d44c17dd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-1.c
@@ -0,0 +1,81 @@
+/* Test atomic_compare_exchange routines for existence and proper
+ execution on 1-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic char v = ATOMIC_VAR_INIT (0);
+char expected = 0;
+char max = ~0;
+char desired = ~0;
+char zero = 0;
+
+int
+main ()
+{
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, max, memory_order_relaxed, memory_order_relaxed))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (atomic_compare_exchange_strong_explicit (&v, &expected, 0, memory_order_acquire, memory_order_relaxed))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, 0, memory_order_release, memory_order_acquire))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (atomic_compare_exchange_weak_explicit (&v, &expected, desired, memory_order_acq_rel, memory_order_acquire))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, desired, memory_order_seq_cst, memory_order_seq_cst))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ v = 0;
+
+ if (!atomic_compare_exchange_strong (&v, &expected, max))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (atomic_compare_exchange_strong (&v, &expected, zero))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!atomic_compare_exchange_strong (&v, &expected, zero))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (atomic_compare_exchange_weak (&v, &expected, desired))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!atomic_compare_exchange_strong (&v, &expected, desired))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-2.c
new file mode 100644
index 000000000..5647ee663
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-2.c
@@ -0,0 +1,81 @@
+/* Test atomic_compare_exchange routines for existence and proper
+ execution on 2-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic short v = ATOMIC_VAR_INIT (0);
+short expected = 0;
+short max = ~0;
+short desired = ~0;
+short zero = 0;
+
+int
+main ()
+{
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, max, memory_order_relaxed, memory_order_relaxed))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (atomic_compare_exchange_strong_explicit (&v, &expected, 0, memory_order_acquire, memory_order_relaxed))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, 0, memory_order_release, memory_order_acquire))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (atomic_compare_exchange_weak_explicit (&v, &expected, desired, memory_order_acq_rel, memory_order_acquire))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, desired, memory_order_seq_cst, memory_order_seq_cst))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ v = 0;
+
+ if (!atomic_compare_exchange_strong (&v, &expected, max))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (atomic_compare_exchange_strong (&v, &expected, zero))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!atomic_compare_exchange_strong (&v, &expected, zero))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (atomic_compare_exchange_weak (&v, &expected, desired))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!atomic_compare_exchange_strong (&v, &expected, desired))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-3.c
new file mode 100644
index 000000000..e29784e5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-3.c
@@ -0,0 +1,81 @@
+/* Test atomic_compare_exchange routines for existence and proper
+ execution on 2-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic int v = ATOMIC_VAR_INIT (0);
+int expected = 0;
+int max = ~0;
+int desired = ~0;
+int zero = 0;
+
+int
+main ()
+{
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, max, memory_order_relaxed, memory_order_relaxed))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (atomic_compare_exchange_strong_explicit (&v, &expected, 0, memory_order_acquire, memory_order_relaxed))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, 0, memory_order_release, memory_order_acquire))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (atomic_compare_exchange_weak_explicit (&v, &expected, desired, memory_order_acq_rel, memory_order_acquire))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, desired, memory_order_seq_cst, memory_order_seq_cst))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ v = 0;
+
+ if (!atomic_compare_exchange_strong (&v, &expected, max))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (atomic_compare_exchange_strong (&v, &expected, zero))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!atomic_compare_exchange_strong (&v, &expected, zero))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (atomic_compare_exchange_weak (&v, &expected, desired))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!atomic_compare_exchange_strong (&v, &expected, desired))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-4.c
new file mode 100644
index 000000000..e052dca0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-compare-exchange-4.c
@@ -0,0 +1,81 @@
+/* Test atomic_compare_exchange routines for existence and proper
+ execution on 2-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic long long v = ATOMIC_VAR_INIT (0);
+long long expected = 0;
+long long max = ~0LL;
+long long desired = ~0LL;
+long long zero = 0;
+
+int
+main ()
+{
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, max, memory_order_relaxed, memory_order_relaxed))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (atomic_compare_exchange_strong_explicit (&v, &expected, 0, memory_order_acquire, memory_order_relaxed))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, 0, memory_order_release, memory_order_acquire))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (atomic_compare_exchange_weak_explicit (&v, &expected, desired, memory_order_acq_rel, memory_order_acquire))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&v, &expected, desired, memory_order_seq_cst, memory_order_seq_cst))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ v = 0;
+
+ if (!atomic_compare_exchange_strong (&v, &expected, max))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (atomic_compare_exchange_strong (&v, &expected, zero))
+ abort ();
+ if (expected != max)
+ abort ();
+
+ if (!atomic_compare_exchange_strong (&v, &expected, zero))
+ abort ();
+ if (expected != max)
+ abort ();
+ if (v != 0)
+ abort ();
+
+ if (atomic_compare_exchange_weak (&v, &expected, desired))
+ abort ();
+ if (expected != 0)
+ abort ();
+
+ if (!atomic_compare_exchange_strong (&v, &expected, desired))
+ abort ();
+ if (expected != 0)
+ abort ();
+ if (v != max)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-1.c
new file mode 100644
index 000000000..d7c751a34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-1.c
@@ -0,0 +1,46 @@
+/* Test atomic_exchange routines for existence and proper execution on
+ 1-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic char v;
+char count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_relaxed) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_acquire) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_release) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_acq_rel) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_seq_cst) != count)
+ abort ();
+ count++;
+
+ count++;
+
+ ret = atomic_exchange (&v, count);
+ if (ret != count - 1 || v != count)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-2.c
new file mode 100644
index 000000000..2f1f7e235
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-2.c
@@ -0,0 +1,46 @@
+/* Test atomic_exchange routines for existence and proper execution on
+ 2-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic short v;
+short count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_relaxed) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_acquire) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_release) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_acq_rel) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_seq_cst) != count)
+ abort ();
+ count++;
+
+ count++;
+
+ ret = atomic_exchange (&v, count);
+ if (ret != count - 1 || v != count)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-3.c
new file mode 100644
index 000000000..a62c57187
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-3.c
@@ -0,0 +1,46 @@
+/* Test atomic_exchange routines for existence and proper execution on
+ 4-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic int v;
+int count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_relaxed) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_acquire) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_release) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_acq_rel) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_seq_cst) != count)
+ abort ();
+ count++;
+
+ count++;
+
+ ret = atomic_exchange (&v, count);
+ if (ret != count - 1 || v != count)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-4.c
new file mode 100644
index 000000000..1be9b2999
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-exchange-4.c
@@ -0,0 +1,46 @@
+/* Test atomic_exchange routines for existence and proper execution on
+ 8-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic long long v;
+long long count, ret;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_relaxed) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_acquire) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_release) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_acq_rel) != count)
+ abort ();
+ count++;
+
+ if (atomic_exchange_explicit (&v, count + 1, memory_order_seq_cst) != count)
+ abort ();
+ count++;
+
+ count++;
+
+ ret = atomic_exchange (&v, count);
+ if (ret != count - 1 || v != count)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-fence.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-fence.c
new file mode 100644
index 000000000..5f6c4e0f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-fence.c
@@ -0,0 +1,26 @@
+/* Test atomic_*_fence routines for existence and execution with each
+ valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+int
+main ()
+{
+ atomic_thread_fence (memory_order_relaxed);
+ atomic_thread_fence (memory_order_consume);
+ atomic_thread_fence (memory_order_acquire);
+ atomic_thread_fence (memory_order_release);
+ atomic_thread_fence (memory_order_acq_rel);
+ atomic_thread_fence (memory_order_seq_cst);
+
+ atomic_signal_fence (memory_order_relaxed);
+ atomic_signal_fence (memory_order_consume);
+ atomic_signal_fence (memory_order_acquire);
+ atomic_signal_fence (memory_order_release);
+ atomic_signal_fence (memory_order_acq_rel);
+ atomic_signal_fence (memory_order_seq_cst);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
new file mode 100644
index 000000000..32f9e9bb6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-flag.c
@@ -0,0 +1,38 @@
+/* Test atomic_flag routines for existence and execution. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+atomic_flag a = ATOMIC_FLAG_INIT;
+
+int
+main ()
+{
+ int b;
+
+ if (!atomic_is_lock_free (&a))
+ abort ();
+
+ if (atomic_flag_test_and_set (&a))
+ abort ();
+ atomic_flag_clear_explicit (&a, memory_order_relaxed);
+ if (atomic_flag_test_and_set (&a))
+ abort ();
+ atomic_flag_clear (&a);
+
+ b = atomic_flag_test_and_set_explicit (&a, memory_order_seq_cst);
+ if (!atomic_flag_test_and_set (&a) || b != 0)
+ abort ();
+
+ b = atomic_flag_test_and_set_explicit (&a, memory_order_acq_rel);
+ if (!atomic_flag_test_and_set (&a) || b != 1)
+ abort ();
+
+ atomic_flag_clear_explicit (&a, memory_order_seq_cst);
+ if (atomic_flag_test_and_set (&a))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-generic.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-generic.c
new file mode 100644
index 000000000..8033c5373
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-generic.c
@@ -0,0 +1,52 @@
+/* Test generic atomic routines for proper function calling. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort ();
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+
+typedef struct test {
+ int array[10];
+} test_struct;
+
+test_struct zero = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+test_struct ones = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
+_Atomic test_struct a;
+test_struct b;
+
+int size = sizeof (test_struct);
+/* Test for consistency on sizes 1, 2, 4, 8, 16 and 32. */
+int
+main ()
+{
+ test_struct c;
+
+ atomic_store_explicit (&a, zero, memory_order_relaxed);
+ if (memcmp (&a, &zero, size))
+ abort ();
+
+ c = atomic_exchange_explicit (&a, ones, memory_order_seq_cst);
+ if (memcmp (&c, &zero, size))
+ abort ();
+ if (memcmp (&a, &ones, size))
+ abort ();
+
+ b = atomic_load_explicit (&a, memory_order_relaxed);
+ if (memcmp (&b, &ones, size))
+ abort ();
+
+ if (!atomic_compare_exchange_strong_explicit (&a, &b, zero, memory_order_seq_cst, memory_order_acquire))
+ abort ();
+ if (memcmp (&a, &zero, size))
+ abort ();
+
+ if (atomic_compare_exchange_weak_explicit (&a, &b, ones, memory_order_seq_cst, memory_order_acquire))
+ abort ();
+ if (memcmp (&b, &zero, size))
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-kill-dep.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-kill-dep.c
new file mode 100644
index 000000000..fda7fe7d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-kill-dep.c
@@ -0,0 +1,19 @@
+/* Test atomic_kill_dependency. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic int a = ATOMIC_VAR_INIT (1), b;
+
+int
+main ()
+{
+ b = kill_dependency (a);
+ if (b != 1)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-1.c
new file mode 100644
index 000000000..16bea684c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-1.c
@@ -0,0 +1,44 @@
+/* Test atomic_load routines for existence and proper execution on
+ 1-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic char v;
+char count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (atomic_load_explicit (&v, memory_order_relaxed) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_acquire) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_consume) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_seq_cst) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load (&v) != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-2.c
new file mode 100644
index 000000000..6b492d8c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-2.c
@@ -0,0 +1,44 @@
+/* Test atomic_load routines for existence and proper execution on
+ 2-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic short v;
+short count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (atomic_load_explicit (&v, memory_order_relaxed) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_acquire) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_consume) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_seq_cst) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load (&v) != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-3.c
new file mode 100644
index 000000000..c6f2e4b09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-3.c
@@ -0,0 +1,44 @@
+/* Test atomic_load routines for existence and proper execution on
+ 4-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic int v;
+int count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (atomic_load_explicit (&v, memory_order_relaxed) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_acquire) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_consume) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_seq_cst) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load (&v) != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-4.c
new file mode 100644
index 000000000..bc26a5238
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-load-4.c
@@ -0,0 +1,44 @@
+/* Test atomic_load routines for existence and proper execution on
+ 8-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic long long v;
+long long count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ if (atomic_load_explicit (&v, memory_order_relaxed) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_acquire) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_consume) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load_explicit (&v, memory_order_seq_cst) != count++)
+ abort ();
+ else
+ v++;
+
+ if (atomic_load (&v) != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-lockfree.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-lockfree.c
new file mode 100644
index 000000000..29310e9ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-lockfree.c
@@ -0,0 +1,68 @@
+/* Test atomic_is_lock_free. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+#include <stdint.h>
+
+extern void abort ();
+
+_Atomic _Bool aba;
+atomic_bool abt;
+_Atomic char aca;
+atomic_char act;
+_Atomic __CHAR16_TYPE__ ac16a;
+atomic_char16_t ac16t;
+_Atomic __CHAR32_TYPE__ ac32a;
+atomic_char32_t ac32t;
+_Atomic __WCHAR_TYPE__ awca;
+atomic_wchar_t awct;
+_Atomic short asa;
+atomic_short ast;
+_Atomic int aia;
+atomic_int ait;
+_Atomic long ala;
+atomic_long alt;
+_Atomic long long alla;
+atomic_llong allt;
+void *_Atomic apa;
+
+#define CHECK_TYPE(MACRO, V1, V2) \
+ do \
+ { \
+ int r1 = MACRO; \
+ int r2 = atomic_is_lock_free (&V1); \
+ int r3 = atomic_is_lock_free (&V2); \
+ if (r1 != 0 && r1 != 1 && r1 != 2) \
+ abort (); \
+ if (r2 != 0 && r2 != 1) \
+ abort (); \
+ if (r3 != 0 && r3 != 1) \
+ abort (); \
+ if (r1 == 2 && r2 != 1) \
+ abort (); \
+ if (r1 == 2 && r3 != 1) \
+ abort (); \
+ if (r1 == 0 && r2 != 0) \
+ abort (); \
+ if (r1 == 0 && r3 != 0) \
+ abort (); \
+ } \
+ while (0)
+
+int
+main ()
+{
+ CHECK_TYPE (ATOMIC_BOOL_LOCK_FREE, aba, abt);
+ CHECK_TYPE (ATOMIC_CHAR_LOCK_FREE, aca, act);
+ CHECK_TYPE (ATOMIC_CHAR16_T_LOCK_FREE, ac16a, ac16t);
+ CHECK_TYPE (ATOMIC_CHAR32_T_LOCK_FREE, ac32a, ac32t);
+ CHECK_TYPE (ATOMIC_WCHAR_T_LOCK_FREE, awca, awct);
+ CHECK_TYPE (ATOMIC_SHORT_LOCK_FREE, asa, ast);
+ CHECK_TYPE (ATOMIC_INT_LOCK_FREE, aia, ait);
+ CHECK_TYPE (ATOMIC_LONG_LOCK_FREE, ala, alt);
+ CHECK_TYPE (ATOMIC_LLONG_LOCK_FREE, alla, allt);
+ CHECK_TYPE (ATOMIC_POINTER_LOCK_FREE, apa, apa);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-1.c
new file mode 100644
index 000000000..6513a5340
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-1.c
@@ -0,0 +1,341 @@
+/* Test atomic_fetch routines for existence and proper execution on
+ 1-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic char v;
+char count, res;
+const char init = ~0;
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_relaxed) != 0)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_consume) != 1)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_acquire) != 2)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_release) != 3)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_acq_rel) != 4)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_seq_cst) != 5)
+ abort ();
+
+ if (atomic_fetch_add (&v, 1) != 6)
+ abort ();
+}
+
+void
+test_fetch_sub ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_relaxed) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_consume) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_acquire) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_release) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_acq_rel) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_seq_cst) != res--)
+ abort ();
+
+ if (atomic_fetch_sub (&v, 1) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_relaxed) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, init, memory_order_consume) != 0)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_acquire) != 0)
+ abort ();
+
+ v = ~v;
+ if (atomic_fetch_and_explicit (&v, init, memory_order_release) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_acq_rel) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_seq_cst) != 0)
+ abort ();
+
+ if (atomic_fetch_and (&v, 0) != 0)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (atomic_fetch_xor_explicit (&v, count, memory_order_relaxed) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_consume) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, 0, memory_order_acquire) != 0)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_release) != 0)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, 0, memory_order_acq_rel) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_seq_cst) != init)
+ abort ();
+
+ if (atomic_fetch_xor (&v, ~count) != 0)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (atomic_fetch_or_explicit (&v, count, memory_order_relaxed) != 0)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, 2, memory_order_consume) != 1)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_acquire) != 3)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, 8, memory_order_release) != 7)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_acq_rel) != 15)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_seq_cst) != 31)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or (&v, count) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ atomic_fetch_add (&v, count);
+ if (v != 1)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, count, memory_order_consume);
+ if (v != 2)
+ abort ();
+
+ atomic_fetch_add (&v, 1);
+ if (v != 3)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, 1, memory_order_release);
+ if (v != 4)
+ abort ();
+
+ atomic_fetch_add (&v, 1);
+ if (v != 5)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, count, memory_order_seq_cst);
+ if (v != 6)
+ abort ();
+}
+
+void
+test_sub ()
+{
+ v = res = 20;
+ count = 0;
+
+ atomic_fetch_sub (&v, count + 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, count + 1, memory_order_consume);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub (&v, 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, 1, memory_order_release);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub (&v, count + 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, count + 1, memory_order_seq_cst);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ atomic_fetch_and_explicit (&v, init, memory_order_consume);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ atomic_fetch_and_explicit (&v, init, memory_order_release);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ atomic_fetch_and_explicit (&v, 0, memory_order_seq_cst);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ atomic_fetch_xor (&v, count);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, ~count, memory_order_consume);
+ if (v != 0)
+ abort ();
+
+ atomic_fetch_xor (&v, 0);
+ if (v != 0)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, ~count, memory_order_release);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, 0, memory_order_acq_rel);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor (&v, ~count);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ atomic_fetch_or (&v, count);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, count, memory_order_consume);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or (&v, 4);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, 8, memory_order_release);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or (&v, count);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, count, memory_order_seq_cst);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-2.c
new file mode 100644
index 000000000..05edafff0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-2.c
@@ -0,0 +1,341 @@
+/* Test atomic_fetch routines for existence and proper execution on
+ 2-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic short v;
+short count, res;
+const short init = ~0;
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_relaxed) != 0)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_consume) != 1)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_acquire) != 2)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_release) != 3)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_acq_rel) != 4)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_seq_cst) != 5)
+ abort ();
+
+ if (atomic_fetch_add (&v, 1) != 6)
+ abort ();
+}
+
+void
+test_fetch_sub ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_relaxed) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_consume) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_acquire) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_release) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_acq_rel) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_seq_cst) != res--)
+ abort ();
+
+ if (atomic_fetch_sub (&v, 1) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_relaxed) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, init, memory_order_consume) != 0)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_acquire) != 0)
+ abort ();
+
+ v = ~v;
+ if (atomic_fetch_and_explicit (&v, init, memory_order_release) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_acq_rel) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_seq_cst) != 0)
+ abort ();
+
+ if (atomic_fetch_and (&v, 0) != 0)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (atomic_fetch_xor_explicit (&v, count, memory_order_relaxed) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_consume) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, 0, memory_order_acquire) != 0)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_release) != 0)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, 0, memory_order_acq_rel) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_seq_cst) != init)
+ abort ();
+
+ if (atomic_fetch_xor (&v, ~count) != 0)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (atomic_fetch_or_explicit (&v, count, memory_order_relaxed) != 0)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, 2, memory_order_consume) != 1)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_acquire) != 3)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, 8, memory_order_release) != 7)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_acq_rel) != 15)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_seq_cst) != 31)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or (&v, count) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ atomic_fetch_add (&v, count);
+ if (v != 1)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, count, memory_order_consume);
+ if (v != 2)
+ abort ();
+
+ atomic_fetch_add (&v, 1);
+ if (v != 3)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, 1, memory_order_release);
+ if (v != 4)
+ abort ();
+
+ atomic_fetch_add (&v, 1);
+ if (v != 5)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, count, memory_order_seq_cst);
+ if (v != 6)
+ abort ();
+}
+
+void
+test_sub ()
+{
+ v = res = 20;
+ count = 0;
+
+ atomic_fetch_sub (&v, count + 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, count + 1, memory_order_consume);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub (&v, 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, 1, memory_order_release);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub (&v, count + 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, count + 1, memory_order_seq_cst);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ atomic_fetch_and_explicit (&v, init, memory_order_consume);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ atomic_fetch_and_explicit (&v, init, memory_order_release);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ atomic_fetch_and_explicit (&v, 0, memory_order_seq_cst);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ atomic_fetch_xor (&v, count);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, ~count, memory_order_consume);
+ if (v != 0)
+ abort ();
+
+ atomic_fetch_xor (&v, 0);
+ if (v != 0)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, ~count, memory_order_release);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, 0, memory_order_acq_rel);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor (&v, ~count);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ atomic_fetch_or (&v, count);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, count, memory_order_consume);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or (&v, 4);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, 8, memory_order_release);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or (&v, count);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, count, memory_order_seq_cst);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-3.c
new file mode 100644
index 000000000..dc745d405
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-3.c
@@ -0,0 +1,341 @@
+/* Test atomic_fetch routines for existence and proper execution on
+ 4-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic int v;
+int count, res;
+const int init = ~0;
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_relaxed) != 0)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_consume) != 1)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_acquire) != 2)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_release) != 3)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_acq_rel) != 4)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_seq_cst) != 5)
+ abort ();
+
+ if (atomic_fetch_add (&v, 1) != 6)
+ abort ();
+}
+
+void
+test_fetch_sub ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_relaxed) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_consume) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_acquire) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_release) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_acq_rel) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_seq_cst) != res--)
+ abort ();
+
+ if (atomic_fetch_sub (&v, 1) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_relaxed) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, init, memory_order_consume) != 0)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_acquire) != 0)
+ abort ();
+
+ v = ~v;
+ if (atomic_fetch_and_explicit (&v, init, memory_order_release) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_acq_rel) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_seq_cst) != 0)
+ abort ();
+
+ if (atomic_fetch_and (&v, 0) != 0)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (atomic_fetch_xor_explicit (&v, count, memory_order_relaxed) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_consume) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, 0, memory_order_acquire) != 0)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_release) != 0)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, 0, memory_order_acq_rel) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_seq_cst) != init)
+ abort ();
+
+ if (atomic_fetch_xor (&v, ~count) != 0)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (atomic_fetch_or_explicit (&v, count, memory_order_relaxed) != 0)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, 2, memory_order_consume) != 1)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_acquire) != 3)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, 8, memory_order_release) != 7)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_acq_rel) != 15)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_seq_cst) != 31)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or (&v, count) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ atomic_fetch_add (&v, count);
+ if (v != 1)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, count, memory_order_consume);
+ if (v != 2)
+ abort ();
+
+ atomic_fetch_add (&v, 1);
+ if (v != 3)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, 1, memory_order_release);
+ if (v != 4)
+ abort ();
+
+ atomic_fetch_add (&v, 1);
+ if (v != 5)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, count, memory_order_seq_cst);
+ if (v != 6)
+ abort ();
+}
+
+void
+test_sub ()
+{
+ v = res = 20;
+ count = 0;
+
+ atomic_fetch_sub (&v, count + 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, count + 1, memory_order_consume);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub (&v, 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, 1, memory_order_release);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub (&v, count + 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, count + 1, memory_order_seq_cst);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ atomic_fetch_and_explicit (&v, init, memory_order_consume);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ atomic_fetch_and_explicit (&v, init, memory_order_release);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ atomic_fetch_and_explicit (&v, 0, memory_order_seq_cst);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ atomic_fetch_xor (&v, count);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, ~count, memory_order_consume);
+ if (v != 0)
+ abort ();
+
+ atomic_fetch_xor (&v, 0);
+ if (v != 0)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, ~count, memory_order_release);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, 0, memory_order_acq_rel);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor (&v, ~count);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ atomic_fetch_or (&v, count);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, count, memory_order_consume);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or (&v, 4);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, 8, memory_order_release);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or (&v, count);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, count, memory_order_seq_cst);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-4.c
new file mode 100644
index 000000000..84b83e44f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-op-4.c
@@ -0,0 +1,341 @@
+/* Test atomic_fetch routines for existence and proper execution on
+ 8-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic long long v;
+long long count, res;
+const long long init = ~0;
+
+void
+test_fetch_add ()
+{
+ v = 0;
+ count = 1;
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_relaxed) != 0)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_consume) != 1)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_acquire) != 2)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_release) != 3)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, count, memory_order_acq_rel) != 4)
+ abort ();
+
+ if (atomic_fetch_add_explicit (&v, 1, memory_order_seq_cst) != 5)
+ abort ();
+
+ if (atomic_fetch_add (&v, 1) != 6)
+ abort ();
+}
+
+void
+test_fetch_sub ()
+{
+ v = res = 20;
+ count = 0;
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_relaxed) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_consume) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_acquire) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_release) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, count + 1, memory_order_acq_rel) != res--)
+ abort ();
+
+ if (atomic_fetch_sub_explicit (&v, 1, memory_order_seq_cst) != res--)
+ abort ();
+
+ if (atomic_fetch_sub (&v, 1) != res--)
+ abort ();
+}
+
+void
+test_fetch_and ()
+{
+ v = init;
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_relaxed) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, init, memory_order_consume) != 0)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_acquire) != 0)
+ abort ();
+
+ v = ~v;
+ if (atomic_fetch_and_explicit (&v, init, memory_order_release) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_acq_rel) != init)
+ abort ();
+
+ if (atomic_fetch_and_explicit (&v, 0, memory_order_seq_cst) != 0)
+ abort ();
+
+ if (atomic_fetch_and (&v, 0) != 0)
+ abort ();
+}
+
+void
+test_fetch_xor ()
+{
+ v = init;
+ count = 0;
+
+ if (atomic_fetch_xor_explicit (&v, count, memory_order_relaxed) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_consume) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, 0, memory_order_acquire) != 0)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_release) != 0)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, 0, memory_order_acq_rel) != init)
+ abort ();
+
+ if (atomic_fetch_xor_explicit (&v, ~count, memory_order_seq_cst) != init)
+ abort ();
+
+ if (atomic_fetch_xor (&v, ~count) != 0)
+ abort ();
+}
+
+void
+test_fetch_or ()
+{
+ v = 0;
+ count = 1;
+
+ if (atomic_fetch_or_explicit (&v, count, memory_order_relaxed) != 0)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, 2, memory_order_consume) != 1)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_acquire) != 3)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, 8, memory_order_release) != 7)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_acq_rel) != 15)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or_explicit (&v, count, memory_order_seq_cst) != 31)
+ abort ();
+
+ count *= 2;
+ if (atomic_fetch_or (&v, count) != 63)
+ abort ();
+}
+
+
+/* Test the OP routines with a result which isn't used. */
+
+void
+test_add ()
+{
+ v = 0;
+ count = 1;
+
+ atomic_fetch_add (&v, count);
+ if (v != 1)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, count, memory_order_consume);
+ if (v != 2)
+ abort ();
+
+ atomic_fetch_add (&v, 1);
+ if (v != 3)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, 1, memory_order_release);
+ if (v != 4)
+ abort ();
+
+ atomic_fetch_add (&v, 1);
+ if (v != 5)
+ abort ();
+
+ atomic_fetch_add_explicit (&v, count, memory_order_seq_cst);
+ if (v != 6)
+ abort ();
+}
+
+void
+test_sub ()
+{
+ v = res = 20;
+ count = 0;
+
+ atomic_fetch_sub (&v, count + 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, count + 1, memory_order_consume);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub (&v, 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, 1, memory_order_release);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub (&v, count + 1);
+ if (v != --res)
+ abort ();
+
+ atomic_fetch_sub_explicit (&v, count + 1, memory_order_seq_cst);
+ if (v != --res)
+ abort ();
+}
+
+void
+test_and ()
+{
+ v = init;
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = init;
+ atomic_fetch_and_explicit (&v, init, memory_order_consume);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ atomic_fetch_and_explicit (&v, init, memory_order_release);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_and (&v, 0);
+ if (v != 0)
+ abort ();
+
+ v = ~v;
+ atomic_fetch_and_explicit (&v, 0, memory_order_seq_cst);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_xor ()
+{
+ v = init;
+ count = 0;
+
+ atomic_fetch_xor (&v, count);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, ~count, memory_order_consume);
+ if (v != 0)
+ abort ();
+
+ atomic_fetch_xor (&v, 0);
+ if (v != 0)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, ~count, memory_order_release);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor_explicit (&v, 0, memory_order_acq_rel);
+ if (v != init)
+ abort ();
+
+ atomic_fetch_xor (&v, ~count);
+ if (v != 0)
+ abort ();
+}
+
+void
+test_or ()
+{
+ v = 0;
+ count = 1;
+
+ atomic_fetch_or (&v, count);
+ if (v != 1)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, count, memory_order_consume);
+ if (v != 3)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or (&v, 4);
+ if (v != 7)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, 8, memory_order_release);
+ if (v != 15)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or (&v, count);
+ if (v != 31)
+ abort ();
+
+ count *= 2;
+ atomic_fetch_or_explicit (&v, count, memory_order_seq_cst);
+ if (v != 63)
+ abort ();
+}
+
+int
+main ()
+{
+ test_fetch_add ();
+ test_fetch_sub ();
+ test_fetch_and ();
+ test_fetch_xor ();
+ test_fetch_or ();
+
+ test_add ();
+ test_sub ();
+ test_and ();
+ test_xor ();
+ test_or ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-1.c
new file mode 100644
index 000000000..f7936dabc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-1.c
@@ -0,0 +1,43 @@
+/* Test atomic_store routines for existence and proper execution on
+ 1-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic char v;
+char count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ atomic_init (&v, count + 1);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_relaxed);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_release);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_seq_cst);
+ if (v != ++count)
+ abort ();
+
+ count++;
+
+ atomic_store (&v, count);
+ if (v != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-2.c
new file mode 100644
index 000000000..0bbba1cef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-2.c
@@ -0,0 +1,43 @@
+/* Test atomic_store routines for existence and proper execution on
+ 2-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic short v;
+short count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ atomic_init (&v, count + 1);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_relaxed);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_release);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_seq_cst);
+ if (v != ++count)
+ abort ();
+
+ count++;
+
+ atomic_store (&v, count);
+ if (v != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-3.c
new file mode 100644
index 000000000..86c1b2aa8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-3.c
@@ -0,0 +1,43 @@
+/* Test atomic_store routines for existence and proper execution on
+ 4-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic int v;
+int count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ atomic_init (&v, count + 1);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_relaxed);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_release);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_seq_cst);
+ if (v != ++count)
+ abort ();
+
+ count++;
+
+ atomic_store (&v, count);
+ if (v != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-4.c
new file mode 100644
index 000000000..fe96469a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-store-4.c
@@ -0,0 +1,43 @@
+/* Test atomic_store routines for existence and proper execution on
+ 8-byte values with each valid memory model. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+_Atomic long long v;
+long long count;
+
+int
+main ()
+{
+ v = 0;
+ count = 0;
+
+ atomic_init (&v, count + 1);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_relaxed);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_release);
+ if (v != ++count)
+ abort ();
+
+ atomic_store_explicit (&v, count + 1, memory_order_seq_cst);
+ if (v != ++count)
+ abort ();
+
+ count++;
+
+ atomic_store (&v, count);
+ if (v != count)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-vm.c b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-vm.c
new file mode 100644
index 000000000..f43fa49ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/atomic/stdatomic-vm.c
@@ -0,0 +1,68 @@
+/* Test atomic operations on expressions of variably modified type
+ with side effects. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+extern void abort (void);
+
+int s = 5;
+
+int count = 0;
+
+int
+func (void)
+{
+ count++;
+ return 0;
+}
+
+int
+main (void)
+{
+ int vla[s][s];
+ int (*_Atomic p)[s] = &vla[0];
+ int (*b)[s] = kill_dependency (++p);
+ if (b != &vla[1] || p != &vla[1])
+ abort ();
+ int (*_Atomic *q)[s] = &p;
+ atomic_store_explicit (q + func (), &vla[0], memory_order_seq_cst);
+ if (count != 1)
+ abort ();
+ atomic_store (q + func (), &vla[0]);
+ if (count != 2)
+ abort ();
+ (void) atomic_load_explicit (q + func (), memory_order_seq_cst);
+ if (count != 3)
+ abort ();
+ (void) atomic_load (q + func ());
+ if (count != 4)
+ abort ();
+ (void) atomic_exchange_explicit (q + func (), &vla[0], memory_order_seq_cst);
+ if (count != 5)
+ abort ();
+ (void) atomic_exchange (q + func (), &vla[0]);
+ if (count != 6)
+ abort ();
+ int vla2[s][s];
+ int (*p2)[s] = &vla2[0];
+ int (**qna)[s] = &p2;
+ (void) atomic_compare_exchange_strong_explicit (q + func (), qna, &vla[0],
+ memory_order_seq_cst,
+ memory_order_seq_cst);
+ if (count != 7)
+ abort ();
+ (void) atomic_compare_exchange_strong (q + func (), qna, &vla[0]);
+ if (count != 8)
+ abort ();
+ (void) atomic_compare_exchange_weak_explicit (q + func (), qna, &vla[0],
+ memory_order_seq_cst,
+ memory_order_seq_cst);
+ if (count != 9)
+ abort ();
+ (void) atomic_compare_exchange_weak (q + func (), qna, &vla[0]);
+ if (count != 10)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-1.c
new file mode 100644
index 000000000..8f530a84c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-1.c
@@ -0,0 +1,8 @@
+/* PR c++/12795 */
+/* { dg-require-alias "" } */
+
+void foo()
+{
+ extern void bar () __attribute__ ((__alias__ ("BAR"))); /* { dg-warning "ignored" } */
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-2.c
new file mode 100644
index 000000000..c4179a47c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-2.c
@@ -0,0 +1,20 @@
+/* PR 19031 */
+/* { dg-do link } */
+/* { dg-require-alias "" } */
+/* { dg-options "-funit-at-a-time" } */
+
+static int f1 (void) { return 0; }
+extern int g1 (void) __attribute__((__alias__("f1")));
+
+#define STR(x) STR1(__USER_LABEL_PREFIX__, x)
+#define STR1(x,y) STR2(x, y)
+#define STR2(x,y) #x #y
+
+static int f2 (void) __asm__(STR(a2));
+static int f2 (void) { return 0; }
+extern int g2 (void) __attribute__((__alias__("a2")));
+
+int main ()
+{
+ return g1() + g2();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-3.c
new file mode 100644
index 000000000..6ff1b475a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-3.c
@@ -0,0 +1,62 @@
+// { dg-do link }
+// { dg-skip-if "" { "powerpc-ibm-aix*" } { "*" } { "" } }
+// { dg-require-alias "" }
+// { dg-options "-O2 -fno-common" }
+
+// Copyright 2005 Free Software Foundation, Inc.
+// Contributed by Alexandre Oliva <aoliva@redhat.com>
+
+// PR middle-end/24295
+
+// The unit-at-a-time call graph code used to fail to emit variables
+// without external linkage that were only used indirectly, through
+// aliases. Although the PR above is about #pragma weak-introduced
+// aliases, the underlying machinery is the same.
+
+#ifndef ATTRIBUTE_USED
+# define ATTRIBUTE_USED __attribute__((used))
+#endif
+
+static int lv1;
+extern int Av1a __attribute__((alias ("lv1")));
+int *pv1a = &Av1a;
+
+static int lv2;
+extern int Av2a __attribute__((alias ("lv2")));
+int *pv2a = &lv2;
+
+static int lv3;
+extern int Av3a __attribute__((alias ("lv3")));
+static int *pv3a ATTRIBUTE_USED = &Av3a;
+
+static int lv4;
+extern int Av4a __attribute__((alias ("lv4")));
+static int *pv4a = &Av4a;
+
+typedef void ftype(void);
+
+static void lf1(void) {}
+extern ftype Af1a __attribute__((alias ("lf1")));
+ftype *pf1a = &Af1a;
+
+static void lf2(void) {}
+extern ftype Af2a __attribute__((alias ("lf2")));
+ftype *pf2a = &Af2a;
+
+static void lf3(void) {}
+extern ftype Af3a __attribute__((alias ("lf3")));
+static ftype *pf3a ATTRIBUTE_USED = &Af3a;
+
+static void lf4(void) {}
+extern ftype Af4a __attribute__((alias ("lf4")));
+static ftype *pf4a = &Af4a;
+
+main() {
+#ifdef __mips
+ /* Use real asm for MIPS, to stop the assembler warning about
+ orphaned high-part relocations. */
+ asm volatile ("lw $2,%0\n\tlw $2,%1" : : "m" (pv4a), "m" (pf4a) : "$2");
+#else
+ asm volatile ("" : : "m" (pv4a), "m" (pf4a));
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-4.c
new file mode 100644
index 000000000..fb15a20bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-4.c
@@ -0,0 +1,4 @@
+/* ICE on invalid alias attribute: PR 35434. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+typedef int i __attribute__((alias("j"))); /* { dg-warning "ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-5.c
new file mode 100644
index 000000000..56d9b302c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alias-5.c
@@ -0,0 +1,14 @@
+/* Verify diagnostics for aliases to strings containing extended
+ identifiers or bad characters. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+/* { dg-require-alias "" } */
+/* { dg-require-ascii-locale "" } */
+/* { dg-skip-if "" { powerpc*-*-aix* } { "*" } { "" } } */
+
+void f0 (void) __attribute__((alias("\xa1"))); /* { dg-error "undefined symbol '\\\\241'" } */
+void f1 (void) __attribute__((alias("\u00e9"))); /* { dg-error "undefined symbol '\\\\U000000e9'" } */
+void f2 (void) __attribute__((alias("\uffff"))); /* { dg-error "undefined symbol '\\\\U0000ffff'" } */
+void f3 (void) __attribute__((alias("\U000fffff"))); /* { dg-error "undefined symbol '\\\\U000fffff'" } */
+void f4 (void) __attribute__((alias("\U00ffffff"))); /* { dg-error "undefined symbol '\\\\U00ffffff'" } */
+void f5 (void) __attribute__((alias("\U0fffffff"))); /* { dg-error "undefined symbol '\\\\U0fffffff'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-1.c
new file mode 100644
index 000000000..45f5ec065
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-1.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+double *my_alloc1 (int len, int align) __attribute__((__alloc_align__ (2)));
+double *my_alloc2 (int align, int len) __attribute__((alloc_align (1)));
+
+void
+test1 (int len, int align)
+{
+ int i;
+ double *__restrict o1 = my_alloc1 (len, 32);
+ double *__restrict o2 = my_alloc1 (len, 32);
+ double *__restrict o3 = my_alloc1 (len, 32);
+ double *__restrict i1 = my_alloc1 (len, 32);
+ double *__restrict i2 = my_alloc1 (len, align);
+ for (i = 0; i < len; ++i)
+ {
+ o1[i] = i1[i] * i2[i];
+ o2[i] = i1[i] + i2[i];
+ o3[i] = i1[i] - i2[i];
+ }
+}
+
+void
+test2 (int len, int align)
+{
+ int i;
+ double *__restrict o1 = my_alloc2 (32, len);
+ double *__restrict o2 = my_alloc2 (32, len);
+ double *__restrict o3 = my_alloc2 (32, len);
+ double *__restrict i1 = my_alloc2 (32, len);
+ double *__restrict i2 = my_alloc2 (align, len);
+ for (i = 0; i < len; ++i)
+ {
+ o1[i] = i1[i] * i2[i];
+ o2[i] = i1[i] + i2[i];
+ o3[i] = i1[i] - i2[i];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-2.c
new file mode 100644
index 000000000..3dc7a2198
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+int i;
+void *f1 (int) __attribute__((alloc_align (1)));
+void *f2 (int, int, int) __attribute__((alloc_align (3)));
+void *f3 (void) __attribute__((alloc_align)); /* { dg-error "wrong number of arguments specified" } */
+void *f4 (int, int) __attribute__((alloc_align (1, 2))); /* { dg-error "wrong number of arguments specified" } */
+void *f5 (void) __attribute__((alloc_align (i))); /* { dg-warning "outside range" } */
+void *f6 (int) __attribute__((alloc_align (0))); /* { dg-warning "outside range" } */
+void *f7 (int) __attribute__((alloc_align (2))); /* { dg-warning "outside range" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-3.c
new file mode 100644
index 000000000..2efe0c068
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_align-3.c
@@ -0,0 +1,56 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+char *my_alloc1 (int len, int align) __attribute__((__alloc_align__ (2)));
+char *my_alloc2 (int align, int len) __attribute__((alloc_align (1)));
+
+int
+test1 (int len)
+{
+ int i;
+ char *p = my_alloc1 (len, 32);
+ return ((__INTPTR_TYPE__) p) & 31;
+}
+
+int
+test2 (int len)
+{
+ int i;
+ char *p = my_alloc2 (32, len);
+ return ((__INTPTR_TYPE__) p) & 31;
+}
+
+int
+test3 (int len)
+{
+ int i;
+ char *p = my_alloc1 (len, 16);
+ return ((__INTPTR_TYPE__) p) & 15;
+}
+
+int
+test4 (int len)
+{
+ int i;
+ char *p = my_alloc2 (16, len);
+ return ((__INTPTR_TYPE__) p) & 15;
+}
+
+int
+test5 (int len, int align)
+{
+ int i;
+ char *p = my_alloc1 (len, align);
+ return ((__INTPTR_TYPE__) p) & 15;
+}
+
+int
+test6 (int len, int align)
+{
+ int i;
+ char *p = my_alloc2 (align, len);
+ return ((__INTPTR_TYPE__) p) & 15;
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_size-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_size-2.c
new file mode 100644
index 000000000..3cac80737
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_size-2.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+
+char *foo() __attribute__((alloc_size(1))); /* { dg-warning "outside range" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_size.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_size.c
new file mode 100644
index 000000000..e8129ceae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alloc_size.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -ftrack-macro-expansion=0" } */
+
+extern void abort (void);
+
+#include "../gcc.c-torture/execute/builtins/chk.h"
+
+extern char *mallocminus1(int size) __attribute__((alloc_size(-1))); /* { dg-warning "parameter outside range" } */
+extern char *malloc0(int size) __attribute__((alloc_size(0))); /* { dg-warning "parameter outside range" } */
+extern char *malloc1(int size) __attribute__((alloc_size(1)));
+extern char *malloc2(int empty, int size) __attribute__((alloc_size(2)));
+extern char *calloc1(int size, int elements) __attribute__((alloc_size(1,2)));
+extern char *calloc2(int size, int empty, int elements) __attribute__((alloc_size(1,3)));
+extern char *balloc1(void *size) __attribute__((alloc_size(1)));
+
+void
+test (void)
+{
+ char *p;
+
+ p = malloc0 (6);
+ strcpy (p, "Hello");
+ p = malloc1 (6);
+ strcpy (p, "Hello");
+ strcpy (p, "Hello World"); /* { dg-warning "will always overflow" "strcpy" } */
+ p = malloc2 (__INT_MAX__ >= 1700000 ? 424242 : __INT_MAX__ / 4, 6);
+ strcpy (p, "World");
+ strcpy (p, "Hello World"); /* { dg-warning "will always overflow" "strcpy" } */
+ p = calloc1 (2, 5);
+ strcpy (p, "World");
+ strcpy (p, "Hello World"); /* { dg-warning "will always overflow" "strcpy" } */
+ p = calloc2 (2, __INT_MAX__ >= 1700000 ? 424242 : __INT_MAX__ / 4, 5);
+ strcpy (p, "World");
+ strcpy (p, "Hello World"); /* { dg-warning "will always overflow" "strcpy" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-alwaysinline.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alwaysinline.c
new file mode 100644
index 000000000..8ff92b23a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-alwaysinline.c
@@ -0,0 +1,19 @@
+/* Test always_inline attribute, which forces inlining of functions
+ even at no optimization. */
+/* Origin: Aldy Hernandez <aldyh@redhat.com>. */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+static inline int sabrina (void) __attribute__((always_inline));
+
+static inline int sabrina (void)
+{
+ return 13;
+}
+
+int bar (void)
+{
+ return sabrina () + 68;
+}
+
+/* { dg-final { scan-assembler-not "sabrina" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-1.c
new file mode 100644
index 000000000..9a7d5a1ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-1.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+double *my_alloc1 (int len) __attribute__((__assume_aligned__ (16)));
+double *my_alloc2 (int len) __attribute__((__assume_aligned__ (32, 16)));
+
+void
+test1 (int len)
+{
+ int i;
+ double *__restrict o1 = my_alloc1 (len);
+ double *__restrict o2 = my_alloc1 (len);
+ double *__restrict o3 = my_alloc1 (len);
+ double *__restrict i1 = my_alloc1 (len);
+ double *__restrict i2 = my_alloc1 (len);
+ for (i = 0; i < len; ++i)
+ {
+ o1[i] = i1[i] * i2[i];
+ o2[i] = i1[i] + i2[i];
+ o3[i] = i1[i] - i2[i];
+ }
+}
+
+void
+test2 (int len)
+{
+ int i;
+ double *__restrict o1 = my_alloc2 (len);
+ double *__restrict o2 = my_alloc2 (len);
+ double *__restrict o3 = my_alloc2 (len);
+ double *__restrict i1 = my_alloc2 (len);
+ double *__restrict i2 = my_alloc2 (len);
+ for (i = 0; i < len; ++i)
+ {
+ o1[i] = i1[i] * i2[i];
+ o2[i] = i1[i] + i2[i];
+ o3[i] = i1[i] - i2[i];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-2.c
new file mode 100644
index 000000000..9ab558945
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+int i;
+void *f1 (void) __attribute__((assume_aligned (32)));
+void *f2 (void) __attribute__((assume_aligned (16, 4)));
+void *f3 (void) __attribute__((assume_aligned)); /* { dg-error "wrong number of arguments specified" } */
+void *f4 (void) __attribute__((assume_aligned (32, 16, 8))); /* { dg-error "wrong number of arguments specified" } */
+void *f5 (void) __attribute__((assume_aligned (i))); /* { dg-warning "integer constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-3.c
new file mode 100644
index 000000000..3731aac50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-assume_aligned-3.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+char *my_alloc1 (int len) __attribute__((__assume_aligned__ (32)));
+char *my_alloc2 (int len) __attribute__((assume_aligned (32, 4)));
+
+int
+test1 (int len)
+{
+ int i;
+ char *p = my_alloc1 (len);
+ return ((__INTPTR_TYPE__) p) & 31;
+}
+
+int
+test2 (int len)
+{
+ int i;
+ char *p = my_alloc2 (len);
+ return (((__INTPTR_TYPE__) p) & 31) != 4;
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-error-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-error-1.c
new file mode 100644
index 000000000..c136484a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-error-1.c
@@ -0,0 +1,12 @@
+/* PR c/35744 */
+
+typedef char a[N] __attribute__((aligned(4))); /* { dg-error "undeclared" } */
+
+void c[1] __attribute__((vector_size(8))); /* { dg-error "array of voids" } */
+
+void b[1] __attribute__((may_alias)); /* { dg-error "array of voids" } */
+
+struct A
+{
+ void d[1] __attribute__((packed)); /* { dg-error "array of voids" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-externally-visible-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-externally-visible-1.c
new file mode 100644
index 000000000..e1db6923a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-externally-visible-1.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fwhole-program" } */
+/* { dg-final { scan-assembler "foo1" } } */
+/* { dg-final { scan-assembler "foo2" } } */
+/* { dg-final { scan-assembler "foo3" } } */
+/* { dg-final { scan-assembler "foo4" } } */
+/* { dg-final { scan-assembler "foo5" } } */
+/* { dg-final { scan-assembler-not "foo6" } } */
+/* { dg-final { scan-assembler "bar1" } } */
+/* { dg-final { scan-assembler "bar2" } } */
+/* { dg-final { scan-assembler "bar3" } } */
+/* { dg-final { scan-assembler "bar4" } } */
+/* { dg-final { scan-assembler "bar5" } } */
+/* { dg-final { scan-assembler-not "bar6" } } */
+
+extern void foo1 (void) __attribute__((externally_visible));
+void foo1 (void) { }
+
+extern void foo2 (void) __attribute__((externally_visible));
+__attribute__((externally_visible)) void foo2 (void) { }
+
+extern void foo3 (void);
+__attribute__((externally_visible)) void foo3 (void) { }
+
+__attribute__((externally_visible)) void foo4 (void) { }
+
+void foo5 (void) { }
+extern void foo5 (void) __attribute__((externally_visible));
+
+void foo6 (void) { }
+
+extern char *bar1 __attribute__((externally_visible));
+char *bar1;
+
+extern char *bar2 __attribute__((externally_visible));
+char *bar2 __attribute__((externally_visible));
+
+extern char *bar3;
+char *bar3 __attribute__((externally_visible));
+
+char *bar4 __attribute__((externally_visible));
+
+char *bar5;
+extern char *bar5 __attribute__((externally_visible));
+
+char *bar6;
+
+int main (void) { }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-externally-visible-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-externally-visible-2.c
new file mode 100644
index 000000000..0a925bab3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-externally-visible-2.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fwhole-program" } */
+
+static void foo1 (void) { } /* { dg-warning "have effect only on public" } */
+extern void foo1 (void) __attribute__((externally_visible));
+
+void foo2 (void)
+{
+ __attribute__((externally_visible)) void foo3 (void) { } /* { dg-warning "have effect only on public" } */
+}
+
+__attribute__((externally_visible)) static void foo3 (void) { } /* { dg-warning "have effect only on public" } */
+
+static int bar1;
+extern int bar1 __attribute__((externally_visible)); /* { dg-warning "have effect only on public" } */
+
+static int bar2 __attribute__((externally_visible)); /* { dg-warning "have effect only on public" } */
+
+void fn1 (void)
+{
+ static int bar3 __attribute__((externally_visible)); /* { dg-warning "have effect only on public" } */
+}
+
+void fn2 (void)
+{
+ int bar4 __attribute__((externally_visible)); /* { dg-warning "have effect only on public" } */
+}
+
+struct A
+{
+} __attribute__((externally_visible)); /* { dg-warning "does not apply to types" } */
+
+typedef int B __attribute__((externally_visible)); /* { dg-warning "attribute ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-hotcold-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-hotcold-1.c
new file mode 100644
index 000000000..f63a95c71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-hotcold-1.c
@@ -0,0 +1,8 @@
+void f(void)
+{
+ goto A;
+ A: __attribute__((cold))
+ goto B;
+ B: __attribute__((hot))
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-1.c
new file mode 100644
index 000000000..f9c648229
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "" } */
+
+#include <stdio.h>
+
+static int implementation (void)
+{
+ printf ("'ere I am JH\n");
+ return 0;
+}
+
+static void *resolver (void)
+{
+ return (void *)implementation;
+}
+
+extern int magic (void) __attribute__ ((ifunc ("resolver")));
+
+int main ()
+{
+ return magic () != 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-2.c
new file mode 100644
index 000000000..f717315f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-2.c
@@ -0,0 +1,28 @@
+/* { dg-require-ifunc "" } */
+
+static void *resolver ()
+{
+ return 0;
+}
+
+extern int magic (void) /* { dg-message "previous definition" } */
+ __attribute__ ((ifunc ("resolver")));
+extern int magic (void) /* { dg-error "redefinition" "" } */
+ __attribute__ ((alias ("resolver")));
+
+extern int spell (void) /* { dg-message "previous definition" } */
+{
+ return 0;
+}
+extern int spell (void) /* { dg-error "redefinition" "" } */
+ __attribute__ ((ifunc ("resolver")));
+
+extern int mantra (void) /* { dg-message "previous definition" } */
+ __attribute__ ((alias ("resolver")));
+extern int mantra (void) /* { dg-error "redefinition" "" } */
+ __attribute__ ((ifunc ("resolver")));
+
+extern int saying (void) /* { dg-error "weak .* cannot be defined" "" } */
+ __attribute__ ((weak,ifunc ("resolver")));
+extern int maxim (void) /* { dg-error "indirect function .* cannot be declared weak" "" } */
+ __attribute__ ((ifunc ("resolver"),weak));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-3.c
new file mode 100644
index 000000000..fbd972d7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-3.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "" } */
+
+#include <stdio.h>
+
+static int __attribute__((noinline))
+ implementation (void *ptr)
+{
+ if (ptr)
+ return ((int (*) (void *))ptr) (0);
+
+ printf ("'ere I am JH\n");
+ return 0;
+}
+
+static void *resolver (void)
+{
+ return (void *)implementation;
+}
+
+extern int magic (void *) __attribute__ ((ifunc ("resolver")));
+
+int main ()
+{
+ return magic ((void *)magic);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-4.c
new file mode 100644
index 000000000..698c06b1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-4.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "" } */
+
+#include <stdio.h>
+
+static void *implementation (void)
+{
+ printf ("'ere I am JH\n");
+ return 0;
+}
+
+static void *resolver (void)
+{
+ return (void *)implementation;
+}
+
+static int magic (void) __attribute__ ((ifunc ("resolver")));
+
+int main ()
+{
+ return magic () != 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-5.c
new file mode 100644
index 000000000..4dddec430
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ifunc-5.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "" } */
+
+#include <stdio.h>
+
+static void *implementation (void)
+{
+ printf ("'ere I am JH\n");
+ return 0;
+}
+
+static void *resolver (void)
+{
+ return (void *)implementation;
+}
+
+extern int magic (void) __attribute__ ((ifunc ("resolver"),visibility ("hidden")));
+
+int main ()
+{
+ return magic () != 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-invalid.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-invalid.c
new file mode 100644
index 000000000..f2a5887a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-invalid.c
@@ -0,0 +1,102 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#define CONCAT_(A,B) A ## B
+#define CONCAT(A,B) CONCAT_(A,B)
+
+#define ATTR __attribute__((AT))
+#define ATSYM(suf) CONCAT (AT, CONCAT_ (_, suf))
+
+#define AT noinline
+
+typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */
+
+typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */
+
+struct ATSYM(struct) {
+ char dummy ATTR; /* { dg-warning "attribute ignored" "" } */
+} ATTR; /* { dg-warning "does not apply to types" "" } */
+
+int ATSYM(var) ATTR; /* { dg-warning "attribute ignored" "" } */
+
+int ATSYM(fn_knrarg) (arg)
+ int arg ATTR; /* { dg-warning "attribute ignored" "" } */
+{ return 0; }
+
+int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */
+
+int ATSYM(fn_vars) (void) {
+ static int svar ATTR; /* { dg-warning "attribute ignored" "" } */
+ auto int lvar ATTR; /* { dg-warning "attribute ignored" "" } */
+ return 0;
+}
+
+
+#undef AT
+#define AT used
+
+typedef int ATSYM(type) ATTR; /* used attribute is no longer
+ ignored. */
+
+typedef int (*ATSYM(fntype))(void) ATTR; /* used attribute is no
+ longer ignored. */
+
+struct ATSYM(struct) {
+ char dummy ATTR; /* { dg-warning "attribute ignored" "" } */
+} ATTR; /* { dg-warning "does not apply to types" "" } */
+
+int ATSYM(var) ATTR;
+
+int ATSYM(fn_knrarg) (arg)
+ int arg ATTR; /* { dg-warning "attribute ignored" "" } */
+{ return 0; }
+
+int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */
+
+int ATSYM(fn_vars) (void) {
+ static int svar ATTR;
+ auto int lvar ATTR; /* { dg-warning "attribute ignored" "" } */
+ return 0;
+}
+
+
+/* PR 28287 */
+/* These are invalid on all targets. Applying to PARM_ or FIELD_DECL
+ also caused a tree checking ice on targets that support weak, */
+#undef AT
+#define AT weak
+
+typedef int ATSYM(type) ATTR; /* { dg-warning "attribute ignored" "" } */
+
+typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute ignored" "" } */
+
+struct ATSYM(struct) {
+ char dummy ATTR; /* { dg-warning "attribute ignored" "" } */
+};
+
+int ATSYM(fn_knrarg) (arg)
+ int arg ATTR; /* { dg-warning "attribute ignored" "" } */
+{ return 0; }
+
+int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute ignored" "" } */
+
+
+/* PR target/28648 */
+/* These are invalid on all targets. Applying to PARM_ or FIELD_DECL
+ also caused a tree checking ice on targets that support dllimport. */
+#undef AT
+#define AT dllimport
+
+typedef int ATSYM(type) ATTR; /* { dg-warning "attribute |directive ignored" "" } */
+
+typedef int (*ATSYM(fntype))(void) ATTR; /* { dg-warning "attribute |directive ignored" "" } */
+
+struct ATSYM(struct) {
+ char dummy ATTR; /* { dg-warning "attribute |directive ignored" "" } */
+};
+
+int ATSYM(fn_knrarg) (arg)
+ int arg ATTR; /* { dg-warning "attribute |directive ignored" "" } */
+{ return 0; }
+
+int ATSYM(fn_isoarg) (int arg ATTR) { return 0; } /* { dg-warning "attribute |directive ignored" "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-isr.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-isr.c
new file mode 100644
index 000000000..1373c15f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-isr.c
@@ -0,0 +1,20 @@
+/* { dg-do compile { target { { { sh-*-* sh[1234ble]*-*-* } && { ! sh2a*-*-* } } && nonpic } } } */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m2a*" } { "" } } */
+/* { dg-options "-O" } */
+extern void foo ();
+
+void
+(__attribute ((interrupt_handler)) isr)()
+{
+ foo ();
+}
+
+/* { dg-final { scan-assembler-times "rte" 1} } */
+/* The call will clobber r0..r7, which will need not be saved/restored.
+ One of these registers will do fine to hold the function address,
+ hence the all-saved registers r8..r13 don't need to be restored. */
+/* { dg-final { scan-assembler-times "r15\[+\],\[ \t\]*r\[0-9\]\[ \t\]*\n" 8 } } */
+/* { dg-final { scan-assembler-times "\[^f\]r\[0-9\]\[ \t\]*," 8 } } */
+/* { dg-final { scan-assembler-not "\[^f\]r1\[0-3\]" } } */
+/* { dg-final { scan-assembler-times "macl" 2} } */
+/* { dg-final { scan-assembler-not "rte.*\n.*r15\[+\],r\[0-7\]\n" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-may-alias-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-may-alias-1.c
new file mode 100644
index 000000000..30e2bca6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-may-alias-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "dont_delete" } } */
+
+typedef struct { int x; } __attribute__((may_alias)) S;
+
+extern void dont_delete (void);
+
+void f(S *s, float *f)
+{
+ s->x = 1;
+ *f = 0;
+ if (s->x != 1)
+ dont_delete ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-mode-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-mode-1.c
new file mode 100644
index 000000000..e60d01b33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-mode-1.c
@@ -0,0 +1,13 @@
+/* PR c/17384 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef struct __attribute__((mode(SI))) {
+ unsigned INT0 :1,
+ RES0 :1,
+ :6,
+ INT1 :1,
+ RES1 :1,
+ :6,
+ :16;
+} MCR; /* { dg-error "inappropriate type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-mode-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-mode-2.c
new file mode 100644
index 000000000..1a025212e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-mode-2.c
@@ -0,0 +1,22 @@
+/* PR c/18282 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int tword __attribute__((mode(word)));
+
+typedef enum { B1 = 1 } B;
+typedef enum { C1 = 1 } C __attribute__ ((mode(QI)));
+typedef enum { D1 = 1 } __attribute__ ((mode(word))) D;
+
+B __attribute__ ((mode (QI))) bqi;
+B __attribute__ ((mode (word))) bword;
+
+int sqi[sizeof (bqi) == 1 ? 1 : -1];
+int sword[sizeof (bword) == sizeof(tword) ? 1 : -1];
+int sc[sizeof (C) == 1 ? 1 : -1];
+int sd[sizeof (D) == sizeof(tword) ? 1 : -1];
+
+int aqi[__alignof (bqi) == 1 ? 1 : -1];
+int aword[__alignof (bword) == __alignof(tword) ? 1 : -1];
+int ac[__alignof (C) == 1 ? 1 : -1];
+int ad[__alignof (D) == __alignof(tword) ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-1.c
new file mode 100644
index 000000000..4cbff013f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-1.c
@@ -0,0 +1,165 @@
+/* Test for MS structure sizes. */
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-std=gnu99" } */
+
+extern void abort ();
+
+#define ATTR __attribute__((__ms_struct__))
+
+#define size_struct_0 1
+#define size_struct_1 4
+#define size_struct_2 24
+#define size_struct_3 8
+#define size_struct_4 32
+#define size_struct_5 12
+#define size_struct_6 40
+#define size_struct_7 8
+#define size_struct_8 20
+#define size_struct_9 32
+
+struct _struct_0
+{
+ char member_0;
+} ATTR;
+typedef struct _struct_0 struct_0;
+
+struct _struct_1
+{
+ char member_0;
+ short member_1:13;
+} ATTR;
+typedef struct _struct_1 struct_1;
+
+struct _struct_2
+{
+ double member_0;
+ unsigned char member_1:8;
+ long member_2:32;
+ unsigned char member_3:5;
+ short member_4:14;
+ short member_5:13;
+ unsigned char:0;
+} ATTR;
+typedef struct _struct_2 struct_2;
+
+struct _struct_3
+{
+ unsigned long member_0:26;
+ unsigned char member_1:2;
+
+} ATTR;
+typedef struct _struct_3 struct_3;
+
+struct _struct_4
+{
+ unsigned char member_0:7;
+ double member_1;
+ double member_2;
+ short member_3:5;
+ char member_4:2;
+
+} ATTR;
+typedef struct _struct_4 struct_4;
+
+struct _struct_5
+{
+ unsigned short member_0:12;
+ long member_1:1;
+ unsigned short member_2:6;
+
+} ATTR;
+typedef struct _struct_5 struct_5;
+
+struct _struct_6
+{
+ unsigned char member_0:7;
+ unsigned long member_1:25;
+ char member_2:1;
+ double member_3;
+ short member_4:9;
+ double member_5;
+
+} ATTR;
+typedef struct _struct_6 struct_6;
+
+struct _struct_7
+{
+ double member_0;
+
+} ATTR;
+typedef struct _struct_7 struct_7;
+
+struct _struct_8
+{
+ unsigned char member_0:7;
+ long member_1:11;
+ long member_2:5;
+ long:0;
+ char member_4:8;
+ unsigned short member_5:4;
+ unsigned char member_6:3;
+ long member_7:23;
+
+} ATTR;
+typedef struct _struct_8 struct_8;
+
+struct _struct_9
+{
+ double member_0;
+ unsigned long member_1:6;
+ long member_2:17;
+ double member_3;
+ unsigned long member_4:22;
+
+} ATTR;
+typedef struct _struct_9 struct_9;
+
+struct_0 test_struct_0 = { 123 };
+struct_1 test_struct_1 = { 82, 1081 };
+struct_2 test_struct_2 = { 20.0, 31, 407760, 1, 14916, 6712 };
+struct_3 test_struct_3 = { 64616999, 1 };
+struct_4 test_struct_4 = { 61, 20.0, 20.0, 12, 0 };
+struct_5 test_struct_5 = { 909, 1, 57 };
+struct_6 test_struct_6 = { 12, 21355796, 0, 20.0, 467, 20.0 };
+struct_7 test_struct_7 = { 20.0 };
+struct_8 test_struct_8 = { 126, 1821, 22, 125, 6, 0, 2432638 };
+struct_9 test_struct_9 = { 20.0, 3, 23957, 20.0, 1001631 };
+
+
+int
+main (void)
+{
+
+ if (size_struct_0 != sizeof (struct_0))
+ abort ();
+
+ if (size_struct_1 != sizeof (struct_1))
+ abort ();
+
+ if (size_struct_2 != sizeof (struct_2))
+ abort ();
+
+ if (size_struct_3 != sizeof (struct_3))
+ abort ();
+
+ if (size_struct_4 != sizeof (struct_4))
+ abort ();
+
+ if (size_struct_5 != sizeof (struct_5))
+ abort ();
+
+ if (size_struct_6 != sizeof (struct_6))
+ abort ();
+
+ if (size_struct_7 != sizeof (struct_7))
+ abort ();
+
+ if (size_struct_8 != sizeof (struct_8))
+ abort ();
+
+ if (size_struct_9 != sizeof (struct_9))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-2.c
new file mode 100644
index 000000000..58804525b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-2.c
@@ -0,0 +1,36 @@
+/* Test for MS structure sizes. */
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-std=gnu99" } */
+
+extern void abort ();
+
+#define ATTR __attribute__((__ms_struct__))
+
+struct _struct_0
+{
+ long member_0 : 25 ;
+ short member_1 : 6 ;
+ char member_2 : 2 ;
+ unsigned short member_3 : 1 ;
+ unsigned char member_4 : 7 ;
+ short member_5 : 16 ;
+ long : 0 ;
+ char member_7 ;
+
+} ATTR;
+typedef struct _struct_0 struct_0;
+
+#define size_struct_0 20
+
+struct_0 test_struct_0 = { 18557917, 17, 3, 0, 80, 6487, 93 };
+
+int
+main (void)
+{
+
+ if (size_struct_0 != sizeof (struct_0))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c
new file mode 100644
index 000000000..d885c6ff3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-ms_struct-packed1.c
@@ -0,0 +1,25 @@
+/* Test for MS structure with packed attribute. */
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } }
+/* { dg-options "-std=gnu99" } */
+
+extern void abort ();
+
+union u
+{
+ int a;
+} __attribute__((__ms_struct__, __packed__));
+
+struct s
+{
+ char c;
+ union u u;
+};
+
+int
+main (void)
+{
+ if (sizeof (struct s) != (sizeof (char) + sizeof (union u)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-nest.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-nest.c
new file mode 100644
index 000000000..16a79c6e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-nest.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+#define ATTR_PRINTF __attribute__ ((format (printf, 1, 2)))
+#define ATTR_USED __attribute__ ((used))
+
+void bar (int, ...);
+
+/* gcc would segfault on the nested attribute. */
+void foo (void)
+{
+ bar (0, (void (*ATTR_PRINTF) (const char *, ...)) 0);
+}
+
+/* For consistency, unnamed decls should give the same warnings as
+ named ones. */
+void proto1 (int (*ATTR_USED) (void)); /* { dg-warning "attribute ignored" } */
+void proto2 (int (*ATTR_USED bar) (void)); /* { dg-warning "attribute ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-noinline.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-noinline.c
new file mode 100644
index 000000000..7d57c0172
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-noinline.c
@@ -0,0 +1,68 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -finline-functions" } */
+
+extern int t();
+
+static inline void __attribute__((__noinline__)) function_definition(void) {t();} /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
+
+static inline void __attribute__((__noinline__)) function_declaration_both_before(void); /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
+
+static void function_declaration_both_before(void) {t();}
+
+static void function_declaration_both_after(void);
+
+static inline void __attribute__((__noinline__)) function_declaration_both_after(void); /* { dg-warning "(inline function \[^\n\]* given attribute noinline|declared inline after its definition)" "" } */
+
+static void function_declaration_both_after(void) {t();}
+
+static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */
+
+static inline void function_declaration_noinline_before(void) {t();} /* { dg-warning "follows declaration with attribute noinline" "" } */
+
+static inline void function_declaration_noinline_after(void) {t();} /* { dg-message "note: previous definition" "" } */
+
+static void function_declaration_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
+
+static inline void function_declaration_inline_before(void); /* { dg-message "note: previous declaration" "" } */
+
+static void __attribute__((__noinline__)) function_declaration_inline_before(void) {t();} /* { dg-warning "follows inline declaration" "" } */
+
+static inline void function_declaration_inline_noinline_before(void); /* { dg-message "note: previous declaration" "" } */
+
+static void function_declaration_inline_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
+
+static void function_declaration_inline_noinline_before(void) {t();}
+
+static inline void function_declaration_inline_noinline_after(void);
+
+static void function_declaration_inline_noinline_after(void) {t();} /* { dg-message "note: previous definition" "" } */
+
+static void function_declaration_inline_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
+
+static void function_declaration_noinline_inline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */
+
+static inline void function_declaration_noinline_inline_before(void); /* { dg-warning "follows declaration with attribute noinline" "" } */
+
+static void function_declaration_noinline_inline_before(void) {t();}
+
+void f () {
+ function_definition ();
+ function_declaration_both_before ();
+ function_declaration_both_after ();
+ function_declaration_noinline_before ();
+ function_declaration_noinline_after ();
+ function_declaration_inline_before ();
+ function_declaration_inline_noinline_before ();
+ function_declaration_inline_noinline_after ();
+ function_declaration_noinline_inline_before ();
+}
+
+/* { dg-final { scan-assembler "function_definition" } } */
+/* { dg-final { scan-assembler "function_declaration_both_before" } } */
+/* { dg-final { scan-assembler "function_declaration_both_after" } } */
+/* { dg-final { scan-assembler "function_declaration_noinline_before" } } */
+/* { dg-final { scan-assembler "function_declaration_noinline_after" } } */
+/* { dg-final { scan-assembler "function_declaration_inline_before" } } */
+/* { dg-final { scan-assembler "function_declaration_inline_noinline_before" } } */
+/* { dg-final { scan-assembler "function_declaration_inline_noinline_after" } } */
+/* { dg-final { scan-assembler "function_declaration_noinline_inline_before" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-warn-unused-result.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-warn-unused-result.c
new file mode 100644
index 000000000..0404ceceb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-warn-unused-result.c
@@ -0,0 +1,188 @@
+/* warn_unused_result attribute tests. */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+#define WUR __attribute__((warn_unused_result))
+#define WURAI __attribute__((warn_unused_result, always_inline)) inline
+typedef WUR int (*fnt) (void);
+
+typedef struct { long i; } A;
+typedef struct { long i; long j; } B;
+typedef struct { char big[1024]; fnt fn; } C;
+
+WUR int check1 (void);
+WUR void check2 (void); /* { dg-warning "attribute ignored" } */
+int foo WUR; /* { dg-warning "only applies" } */
+int bar (void);
+extern WURAI int check3 (void) { return bar (); }
+WUR A check4 (void);
+WUR B check5 (void);
+WUR C check6 (void);
+A bar7 (void);
+B bar8 (void);
+C bar9 (void);
+extern WURAI A check7 (void) { return bar7 (); }
+extern WURAI B check8 (void) { return bar8 (); }
+extern WURAI C check9 (void) { return bar9 (); }
+/* This is useful for checking whether return value of statement
+ expressions (returning int in this case) is used. */
+extern WURAI int check_int_result (int res) { return res; }
+#define GU(v) ({ int e = 0; (v) = bar (); if ((v) < 23) e = 14; e; })
+fnt fnptr;
+WUR int check10 (void);
+int baz (void);
+extern WURAI int check11 (void) { return baz (); }
+int k;
+
+void
+test (void)
+{
+ int i = 0, j;
+ const fnt pcheck1 = check1;
+ const fnt pcheck3 = check3;
+ A a;
+ B b;
+ C c;
+ if (check1 ())
+ return;
+ i += check1 ();
+ i += ({ check1 (); });
+ check1 (); /* { dg-warning "ignoring return value of" } */
+ (void) check1 (); /* { dg-warning "ignoring return value of" } */
+ check1 (), bar (); /* { dg-warning "ignoring return value of" } */
+ check2 ();
+ (void) check2 ();
+ check2 (), bar ();
+ if (check3 ())
+ return;
+ i += check3 ();
+ i += ({ check3 (); });
+ check3 (); /* { dg-warning "ignoring return value of" } */
+ (void) check3 (); /* { dg-warning "ignoring return value of" } */
+ check3 (), bar (); /* { dg-warning "ignoring return value of" } */
+ a = check4 ();
+ if (a.i)
+ return;
+ if (check4 ().i)
+ return;
+ if (({ check4 (); }).i)
+ return;
+ check4 (); /* { dg-warning "ignoring return value of" } */
+ (void) check4 (); /* { dg-warning "ignoring return value of" } */
+ check4 (), bar (); /* { dg-warning "ignoring return value of" } */
+ b = check5 ();
+ if (b.i + b.j)
+ return;
+ if (check5 ().j)
+ return;
+ if (({ check5 (); }).j)
+ return;
+ check5 (); /* { dg-warning "ignoring return value of" } */
+ (void) check5 (); /* { dg-warning "ignoring return value of" } */
+ check5 (), bar (); /* { dg-warning "ignoring return value of" } */
+ c = check6 ();
+ if (c.big[12] + c.big[29])
+ return;
+ if (check6 ().big[27])
+ return;
+ if (({ check6 (); }).big[0])
+ return;
+ check6 (); /* { dg-warning "ignoring return value of" } */
+ (void) check6 (); /* { dg-warning "ignoring return value of" } */
+ check6 (), bar (); /* { dg-warning "ignoring return value of" } */
+ a = check7 ();
+ if (a.i)
+ return;
+ if (check7 ().i)
+ return;
+ if (({ check7 (); }).i)
+ return;
+ check7 (); /* { dg-warning "ignoring return value of" } */
+ (void) check7 (); /* { dg-warning "ignoring return value of" } */
+ check7 (), bar (); /* { dg-warning "ignoring return value of" } */
+ b = check8 ();
+ if (b.i + b.j)
+ return;
+ if (check8 ().j)
+ return;
+ if (({ check8 (); }).j)
+ return;
+ check8 (); /* { dg-warning "ignoring return value of" } */
+ (void) check8 (); /* { dg-warning "ignoring return value of" } */
+ check8 (), bar (); /* { dg-warning "ignoring return value of" } */
+ c = check9 ();
+ if (c.big[12] + c.big[29])
+ return;
+ if (check9 ().big[27])
+ return;
+ if (({ check9 (); }).big[0])
+ return;
+ check9 (); /* { dg-warning "ignoring return value of" } */
+ (void) check9 (); /* { dg-warning "ignoring return value of" } */
+ check9 (), bar (); /* { dg-warning "ignoring return value of" } */
+ if (check_int_result (GU (j)))
+ return;
+ i += check_int_result (GU (j));
+ i += ({ check_int_result (GU (j)); });
+ check_int_result (GU (j)); /* { dg-warning "ignoring return value of" } */
+ (void) check_int_result (GU (j)); /* { dg-warning "ignoring return value of" } */
+ check_int_result (GU (j)), bar (); /* { dg-warning "ignoring return value of" } */
+ if (fnptr ())
+ return;
+ i += fnptr ();
+ i += ({ fnptr (); });
+ fnptr (); /* { dg-warning "ignoring return value of" } */
+ (void) fnptr (); /* { dg-warning "ignoring return value of" } */
+ fnptr (), bar (); /* { dg-warning "ignoring return value of" } */
+ fnptr = check1;
+ if (fnptr ())
+ return;
+ i += fnptr ();
+ i += ({ fnptr (); });
+ fnptr (); /* { dg-warning "ignoring return value of" } */
+ (void) fnptr (); /* { dg-warning "ignoring return value of" } */
+ fnptr (), bar (); /* { dg-warning "ignoring return value of" } */
+ fnptr = check3;
+ if (fnptr ())
+ return;
+ i += fnptr ();
+ i += ({ fnptr (); });
+ fnptr (); /* { dg-warning "ignoring return value of" } */
+ (void) fnptr (); /* { dg-warning "ignoring return value of" } */
+ fnptr (), bar (); /* { dg-warning "ignoring return value of" } */
+ if (bar9 ().fn ())
+ return;
+ i += bar9 ().fn ();
+ i += ({ bar9 ().fn (); });
+ bar9 ().fn (); /* { dg-warning "ignoring return value of" } */
+ (void) bar9 ().fn (); /* { dg-warning "ignoring return value of" } */
+ bar9 ().fn (), bar (); /* { dg-warning "ignoring return value of" } */
+ if ((k ? check1 : check10) ())
+ return;
+ i += (k ? check1 : check10) ();
+ i += ({ (k ? check1 : check10) (); });
+ (k ? check1 : check10) (); /* { dg-warning "ignoring return value of" } */
+ (void) (k ? check1 : check10) (); /* { dg-warning "ignoring return value of" } */
+ (k ? check1 : check10) (), bar (); /* { dg-warning "ignoring return value of" } */
+ if ((k ? check3 : check11) ())
+ return;
+ i += (k ? check3 : check11) ();
+ i += ({ (k ? check3 : check11) (); });
+ (k ? check3 : check11) (); /* { dg-warning "ignoring return value of" } */
+ (void) (k ? check3 : check11) (); /* { dg-warning "ignoring return value of" } */
+ (k ? check3 : check11) (), bar (); /* { dg-warning "ignoring return value of" } */
+ if (pcheck1 ())
+ return;
+ i += pcheck1 ();
+ i += ({ pcheck1 (); });
+ pcheck1 (); /* { dg-warning "ignoring return value of" } */
+ (void) pcheck1 (); /* { dg-warning "ignoring return value of" } */
+ pcheck1 (), bar (); /* { dg-warning "ignoring return value of" } */
+ if (pcheck3 ())
+ return;
+ i += pcheck3 ();
+ i += ({ pcheck3 (); });
+ pcheck3 (); /* { dg-warning "ignoring return value of" } */
+ (void) pcheck3 (); /* { dg-warning "ignoring return value of" } */
+ pcheck3 (), bar (); /* { dg-warning "ignoring return value of" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-1.c
new file mode 100644
index 000000000..65041291b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-1.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+
+__inline void foo(void) __attribute__((weak)); /* { dg-warning "inline.*weak" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c
new file mode 100644
index 000000000..b8d75d9c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c
@@ -0,0 +1,6 @@
+/* { dg-do run } */
+/* { dg-require-weak "" } */
+/* { dg-require-visibility "" } */
+/* { dg-options "-O2" } */
+/* { dg-additional-sources "attr-weak-hidden-1a.c" } */
+int __attribute__((visibility("hidden"))) foo (void) { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-hidden-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-hidden-1a.c
new file mode 100644
index 000000000..f6d3e9eae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weak-hidden-1a.c
@@ -0,0 +1,11 @@
+/* { dg-require-weak "" } */
+/* { dg-require-visibility "" } */
+void abort (void);
+int __attribute__((weak, visibility("hidden"))) foo (void) { return 1; }
+int
+main (void)
+{
+ if (foo ())
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c
new file mode 100644
index 000000000..c6835ed7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1-darwin.c
@@ -0,0 +1,223 @@
+// { dg-do run { target { *-*-darwin* } } }
+// { dg-require-weak "" }
+// { dg-options "-O2" }
+// { dg-options "-O2 -mmacosx-version-min=10.2" { target { powerpc-*-darwin* } } }
+// { dg-additional-sources "attr-weakref-1a.c attr-weakref-1b.c" }
+
+// Copyright 2005 Free Software Foundation, Inc.
+// Contributed by Alexandre Oliva <aoliva@redhat.com>
+
+// Torture test for weakrefs. The first letter of an identifier
+// indicates whether/how it is defined; the second letter indicates
+// whether it is part of a variable or function test; the number that
+// follows is a test counter, and a letter that may follow enables
+// multiple identifiers within the same test (e.g., multiple weakrefs
+// or pointers to the same identifier).
+
+// Identifiers starting with W are weakrefs; those with p are
+// pointers; those with g are global definitions; those with l are
+// local definitions; those with w are expected to be weak undefined
+// in the symbol table; those with u are expected to be marked as
+// non-weak undefined in the symbol table.
+
+#include <stdlib.h>
+
+#define USED __attribute__((used))
+
+typedef int vtype;
+
+extern vtype wv1;
+static vtype Wv1a __attribute__((weakref ("wv1")));
+static vtype *pv1a USED = &Wv1a;
+
+vtype gv2;
+static vtype Wv2a __attribute__((weakref ("gv2")));
+static vtype *pv2a USED = &Wv2a;
+
+static vtype lv3;
+static vtype Wv3a __attribute__((weakref ("lv3")));
+static vtype *pv3a USED = &Wv3a;
+
+extern vtype uv4;
+static vtype Wv4a __attribute__((weakref ("uv4")));
+static vtype *pv4a USED = &Wv4a;
+static vtype *pv4 USED = &uv4;
+
+static vtype Wv5a __attribute__((weakref ("uv5")));
+static vtype *pv5a USED = &Wv5a;
+extern vtype uv5;
+static vtype *pv5 USED = &uv5;
+
+static vtype Wv6a __attribute__((weakref ("wv6")));
+static vtype *pv6a USED = &Wv6a;
+extern vtype wv6;
+
+static vtype Wv7a __attribute__((weakref ("uv7")));
+static vtype* USED fv7 (void) {
+ return &Wv7a;
+}
+extern vtype uv7;
+static vtype* USED fv7a (void) {
+ return &uv7;
+}
+
+extern vtype uv8;
+static vtype* USED fv8a (void) {
+ return &uv8;
+}
+static vtype Wv8a __attribute__((weakref ("uv8")));
+static vtype* USED fv8 (void) {
+ return &Wv8a;
+}
+
+extern vtype wv9 __attribute__((weak));
+static vtype Wv9a __attribute__((weakref ("wv9")));
+static vtype *pv9a USED = &Wv9a;
+
+static vtype Wv10a __attribute__((weakref ("Wv10b")));
+static vtype Wv10b __attribute__((weakref ("Wv10c")));
+static vtype Wv10c __attribute__((weakref ("Wv10d")));
+static vtype Wv10d __attribute__((weakref ("wv10")));
+extern vtype wv10;
+
+extern vtype wv11;
+static vtype Wv11d __attribute__((weakref ("wv11")));
+static vtype Wv11c __attribute__((weakref ("Wv11d")));
+static vtype Wv11b __attribute__((weakref ("Wv11c")));
+static vtype Wv11a __attribute__((weakref ("Wv11b")));
+
+static vtype Wv12 __attribute__((weakref ("wv12")));
+extern vtype wv12 __attribute__((weak));
+
+static vtype Wv13 __attribute__((weakref ("wv13")));
+extern vtype wv13 __attribute__((weak));
+
+static vtype Wv14a __attribute__((weakref ("wv14")));
+static vtype Wv14b __attribute__((weakref ("wv14")));
+extern vtype wv14 __attribute__((weak));
+
+typedef void ftype(void);
+
+extern ftype wf1;
+static ftype Wf1a __attribute__((weakref ("wf1")));
+static ftype *pf1a USED = &Wf1a;
+static ftype Wf1c __attribute__((weakref));
+extern ftype Wf1c __attribute__((alias ("wf1")));
+static ftype *pf1c USED = &Wf1c;
+
+void gf2(void) {}
+static ftype Wf2a __attribute__((weakref ("gf2")));
+static ftype *pf2a USED = &Wf2a;
+
+static void lf3(void) {}
+static ftype Wf3a __attribute__((weakref ("lf3")));
+static ftype *pf3a USED = &Wf3a;
+
+extern ftype uf4;
+static ftype Wf4a __attribute__((weakref ("uf4")));
+static ftype *pf4a USED = &Wf4a;
+static ftype *pf4 USED = &uf4;
+
+static ftype Wf5a __attribute__((weakref ("uf5")));
+static ftype *pf5a USED = &Wf5a;
+extern ftype uf5;
+static ftype *pf5 USED = &uf5;
+
+static ftype Wf6a __attribute__((weakref ("wf6")));
+static ftype *pf6a USED = &Wf6a;
+extern ftype wf6;
+
+static ftype Wf7a __attribute__((weakref ("uf7")));
+static ftype* USED ff7 (void) {
+ return &Wf7a;
+}
+extern ftype uf7;
+static ftype* USED ff7a (void) {
+ return &uf7;
+}
+
+extern ftype uf8;
+static ftype* USED ff8a (void) {
+ return &uf8;
+}
+static ftype Wf8a __attribute__((weakref ("uf8")));
+static ftype* USED ff8 (void) {
+ return &Wf8a;
+}
+
+extern ftype wf9 __attribute__((weak));
+static ftype Wf9a __attribute__((weakref ("wf9")));
+static ftype *pf9a USED = &Wf9a;
+
+static ftype Wf10a __attribute__((weakref ("Wf10b")));
+static ftype Wf10b __attribute__((weakref ("Wf10c")));
+static ftype Wf10c __attribute__((weakref ("Wf10d")));
+static ftype Wf10d __attribute__((weakref ("wf10")));
+extern ftype wf10;
+
+extern ftype wf11;
+static ftype Wf11d __attribute__((weakref ("wf11")));
+static ftype Wf11c __attribute__((weakref ("Wf11d")));
+static ftype Wf11b __attribute__((weakref ("Wf11c")));
+static ftype Wf11a __attribute__((weakref ("Wf11b")));
+
+static ftype Wf12 __attribute__((weakref ("wf12")));
+extern ftype wf12 __attribute__((weak));
+
+static ftype Wf13 __attribute__((weakref ("wf13")));
+extern ftype wf13 __attribute__((weak));
+
+static ftype Wf14a __attribute__((weakref ("wf14")));
+static ftype Wf14b __attribute__((weakref ("wf14")));
+extern ftype wf14 __attribute__((weak));
+
+#ifndef __APPLE__
+#define chk(p) do { if (!p) abort (); } while (0)
+#else
+#define chk(p) /* */
+#endif
+
+int main () {
+ chk (!pv1a);
+ chk (pv2a);
+ chk (pv3a);
+ chk (pv4a);
+ chk (pv4);
+ chk (pv5a);
+ chk (pv5);
+ chk (!pv6a);
+ chk (fv7 ());
+ chk (fv7a ());
+ chk (fv8 ());
+ chk (fv8a ());
+ chk (!pv9a);
+ chk (!&Wv10a);
+ chk (!&Wv11a);
+ chk (!&Wv12);
+ chk (!&wv12);
+ chk (!&wv13);
+ chk (!&Wv14a);
+
+ chk (!pf1a);
+ chk (!pf1c);
+ chk (pf2a);
+ chk (pf3a);
+ chk (pf4a);
+ chk (pf4);
+ chk (pf5a);
+ chk (pf5);
+ chk (!pf6a);
+ chk (ff7 ());
+ chk (ff7a ());
+ chk (ff8 ());
+ chk (ff8a ());
+ chk (!pf9a);
+ chk (!&Wf10a);
+ chk (!&Wf11a);
+ chk (!&Wf12);
+ chk (!&wf12);
+ chk (!&wf13);
+ chk (!&Wf14a);
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1.c
new file mode 100644
index 000000000..ee900fcde
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1.c
@@ -0,0 +1,231 @@
+// { dg-do run }
+// { dg-require-weak "" }
+// On darwin, we use attr-weakref-1-darwin.c.
+// This test requires support for undefined weak symbols. This support
+// is not available on hppa*-*-hpux*. The test is skipped rather than
+// xfailed to suppress the warning that would otherwise arise.
+// { dg-skip-if "" { "*-*-darwin*" "hppa*-*-hpux*" "*-*-aix*" } "*" { "" } }
+// For kernel modules and static RTPs, the loader treats undefined weak
+// symbols in the same way as undefined strong symbols. The test
+// therefore fails to load, so skip it.
+// { dg-skip-if "" { "*-*-vxworks*" && nonpic } "*" { "-non-static" } }
+// { dg-options "-O2" }
+// { dg-additional-sources "attr-weakref-1a.c" }
+
+// Copyright 2005 Free Software Foundation, Inc.
+// Contributed by Alexandre Oliva <aoliva@redhat.com>
+
+// Torture test for weakrefs. The first letter of an identifier
+// indicates whether/how it is defined; the second letter indicates
+// whether it is part of a variable or function test; the number that
+// follows is a test counter, and a letter that may follow enables
+// multiple identifiers within the same test (e.g., multiple weakrefs
+// or pointers to the same identifier).
+
+// Identifiers starting with W are weakrefs; those with p are
+// pointers; those with g are global definitions; those with l are
+// local definitions; those with w are expected to be weak undefined
+// in the symbol table; those with u are expected to be marked as
+// non-weak undefined in the symbol table.
+
+#include <stdlib.h>
+
+#define USED __attribute__((used))
+
+typedef int vtype;
+
+extern vtype wv1;
+static vtype Wv1a __attribute__((weakref ("wv1")));
+static vtype *pv1a USED = &Wv1a;
+
+vtype gv2;
+static vtype Wv2a __attribute__((weakref ("gv2")));
+static vtype *pv2a USED = &Wv2a;
+
+static vtype lv3;
+static vtype Wv3a __attribute__((weakref ("lv3")));
+static vtype *pv3a USED = &Wv3a;
+
+extern vtype uv4;
+static vtype Wv4a __attribute__((weakref ("uv4")));
+static vtype *pv4a USED = &Wv4a;
+static vtype *pv4 USED = &uv4;
+
+static vtype Wv5a __attribute__((weakref ("uv5")));
+static vtype *pv5a USED = &Wv5a;
+extern vtype uv5;
+static vtype *pv5 USED = &uv5;
+
+static vtype Wv6a __attribute__((weakref ("wv6")));
+static vtype *pv6a USED = &Wv6a;
+extern vtype wv6;
+
+static vtype Wv7a __attribute__((weakref ("uv7")));
+static vtype* USED fv7 (void) {
+ return &Wv7a;
+}
+extern vtype uv7;
+static vtype* USED fv7a (void) {
+ return &uv7;
+}
+
+extern vtype uv8;
+static vtype* USED fv8a (void) {
+ return &uv8;
+}
+static vtype Wv8a __attribute__((weakref ("uv8")));
+static vtype* USED fv8 (void) {
+ return &Wv8a;
+}
+
+extern vtype wv9 __attribute__((weak));
+static vtype Wv9a __attribute__((weakref ("wv9")));
+static vtype *pv9a USED = &Wv9a;
+
+static vtype Wv10a __attribute__((weakref ("Wv10b")));
+static vtype Wv10b __attribute__((weakref ("Wv10c")));
+static vtype Wv10c __attribute__((weakref ("Wv10d")));
+static vtype Wv10d __attribute__((weakref ("wv10")));
+extern vtype wv10;
+
+extern vtype wv11;
+static vtype Wv11d __attribute__((weakref ("wv11")));
+static vtype Wv11c __attribute__((weakref ("Wv11d")));
+static vtype Wv11b __attribute__((weakref ("Wv11c")));
+static vtype Wv11a __attribute__((weakref ("Wv11b")));
+
+static vtype Wv12 __attribute__((weakref ("wv12")));
+extern vtype wv12 __attribute__((weak));
+
+static vtype Wv13 __attribute__((weakref ("wv13")));
+extern vtype wv13 __attribute__((weak));
+
+static vtype Wv14a __attribute__((weakref ("wv14")));
+static vtype Wv14b __attribute__((weakref ("wv14")));
+extern vtype wv14 __attribute__((weak));
+
+typedef void ftype(void);
+
+extern ftype wf1;
+static ftype Wf1a __attribute__((weakref ("wf1")));
+static ftype *pf1a USED = &Wf1a;
+static ftype Wf1c __attribute__((weakref));
+extern ftype Wf1c __attribute__((alias ("wf1")));
+static ftype *pf1c USED = &Wf1c;
+
+void gf2(void) {}
+static ftype Wf2a __attribute__((weakref ("gf2")));
+static ftype *pf2a USED = &Wf2a;
+
+static void lf3(void) {}
+static ftype Wf3a __attribute__((weakref ("lf3")));
+static ftype *pf3a USED = &Wf3a;
+
+extern ftype uf4;
+static ftype Wf4a __attribute__((weakref ("uf4")));
+static ftype *pf4a USED = &Wf4a;
+static ftype *pf4 USED = &uf4;
+
+static ftype Wf5a __attribute__((weakref ("uf5")));
+static ftype *pf5a USED = &Wf5a;
+extern ftype uf5;
+static ftype *pf5 USED = &uf5;
+
+static ftype Wf6a __attribute__((weakref ("wf6")));
+static ftype *pf6a USED = &Wf6a;
+extern ftype wf6;
+
+static ftype Wf7a __attribute__((weakref ("uf7")));
+static ftype* USED ff7 (void) {
+ return &Wf7a;
+}
+extern ftype uf7;
+static ftype* USED ff7a (void) {
+ return &uf7;
+}
+
+extern ftype uf8;
+static ftype* USED ff8a (void) {
+ return &uf8;
+}
+static ftype Wf8a __attribute__((weakref ("uf8")));
+static ftype* USED ff8 (void) {
+ return &Wf8a;
+}
+
+extern ftype wf9 __attribute__((weak));
+static ftype Wf9a __attribute__((weakref ("wf9")));
+static ftype *pf9a USED = &Wf9a;
+
+static ftype Wf10a __attribute__((weakref ("Wf10b")));
+static ftype Wf10b __attribute__((weakref ("Wf10c")));
+static ftype Wf10c __attribute__((weakref ("Wf10d")));
+static ftype Wf10d __attribute__((weakref ("wf10")));
+extern ftype wf10;
+
+extern ftype wf11;
+static ftype Wf11d __attribute__((weakref ("wf11")));
+static ftype Wf11c __attribute__((weakref ("Wf11d")));
+static ftype Wf11b __attribute__((weakref ("Wf11c")));
+static ftype Wf11a __attribute__((weakref ("Wf11b")));
+
+static ftype Wf12 __attribute__((weakref ("wf12")));
+extern ftype wf12 __attribute__((weak));
+
+static ftype Wf13 __attribute__((weakref ("wf13")));
+extern ftype wf13 __attribute__((weak));
+
+static ftype Wf14a __attribute__((weakref ("wf14")));
+static ftype Wf14b __attribute__((weakref ("wf14")));
+extern ftype wf14 __attribute__((weak));
+
+#ifndef __APPLE__
+#define chk(p) do { if (!p) abort (); } while (0)
+#else
+#define chk(p) /* */
+#endif
+
+int main () {
+ chk (!pv1a);
+ chk (pv2a);
+ chk (pv3a);
+ chk (pv4a);
+ chk (pv4);
+ chk (pv5a);
+ chk (pv5);
+ chk (!pv6a);
+ chk (fv7 ());
+ chk (fv7a ());
+ chk (fv8 ());
+ chk (fv8a ());
+ chk (!pv9a);
+ chk (!&Wv10a);
+ chk (!&Wv11a);
+ chk (!&Wv12);
+ chk (!&wv12);
+ chk (!&wv13);
+ chk (!&Wv14a);
+
+ chk (!pf1a);
+ chk (!pf1c);
+ chk (pf2a);
+ chk (pf3a);
+ chk (pf4a);
+ chk (pf4);
+ chk (pf5a);
+ chk (pf5);
+ chk (!pf6a);
+ chk (ff7 ());
+ chk (ff7a ());
+ chk (ff8 ());
+ chk (ff8a ());
+ chk (!pf9a);
+ chk (!&Wf10a);
+ chk (!&Wf11a);
+ chk (!&Wf12);
+ chk (!&wf12);
+ chk (!&wf13);
+ chk (!&Wf14a);
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1a.c
new file mode 100644
index 000000000..5ce1e4e72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1a.c
@@ -0,0 +1,8 @@
+int uv4;
+int uv5;
+int uv7;
+int uv8;
+void uf4 (void) {}
+void uf5 (void) {}
+void uf7 (void) {}
+void uf8 (void) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1b.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1b.c
new file mode 100644
index 000000000..c2c43898c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-1b.c
@@ -0,0 +1,20 @@
+/* On Darwin, you have to have a definition of the function to link,
+ even if later on it won't be present in some dylib. (That is,
+ you have to link with the latest version of the dylib.) */
+void wf1(void) { }
+void wf6(void) { }
+void wf9(void) { }
+void wf10(void) { }
+void wf11(void) { }
+void wf12(void) { }
+void wf13(void) { }
+void wf14(void) { }
+
+int wv1;
+int wv6;
+int wv9;
+int wv10;
+int wv11;
+int wv12;
+int wv13;
+int wv14;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-2.c
new file mode 100644
index 000000000..75cc0779c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+
+typedef int vtype;
+
+extern vtype wv1;
+extern vtype Wv1a __attribute__((weakref ("wv1"))); /* { dg-error "weakref 'Wv1a' must have static linkage" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-3.c
new file mode 100644
index 000000000..fe4462a8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-3.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+static int i __attribute__ ((weakref)); /* { dg-warning "attribute should be accompanied" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-4.c
new file mode 100644
index 000000000..df5fdebdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/attr-weakref-4.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+static void __attribute__((weakref("bar"))) foo(void) { } /* { dg-warning "attribute ignored because function is defined" } */
+static int __attribute__((weakref)) a=0; /* { dg-warning "attribute ignored because variable is initialized" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/auto-type-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/auto-type-1.c
new file mode 100644
index 000000000..f47693abb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/auto-type-1.c
@@ -0,0 +1,37 @@
+/* Test __auto_type. Test correct uses. */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+extern void abort (void);
+extern void exit (int);
+
+__auto_type i = 1;
+extern int i;
+__auto_type c = (char) 1;
+extern char c;
+static __auto_type u = 10U;
+extern unsigned int u;
+const __auto_type ll = 1LL;
+extern const long long ll;
+
+int
+main (void)
+{
+ if (i != 1 || c != 1 || u != 10U)
+ abort ();
+ __auto_type ai = i;
+ int *aip = &ai;
+ if (ai != 1)
+ abort ();
+ __auto_type p = (int (*) [++i]) 0;
+ if (i != 2)
+ abort ();
+ if (sizeof (*p) != 2 * sizeof (int))
+ abort ();
+ int vla[u][u];
+ int (*vp)[u] = &vla[0];
+ __auto_type vpp = ++vp;
+ if (vp != &vla[1])
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/auto-type-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/auto-type-2.c
new file mode 100644
index 000000000..761671b3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/auto-type-2.c
@@ -0,0 +1,23 @@
+/* Test __auto_type. Test invalid uses. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+__auto_type; /* { dg-error "empty declaration" } */
+__auto_type *p = (int *) 0; /* { dg-error "plain identifier" } */
+struct s0 { int i : 1; } x;
+void f (void) { __auto_type v = x.i; } /* { dg-error "bit-field initializer" } */
+__auto_type i; /* { dg-error "initialized data declaration" } */
+__auto_type g { } /* { dg-error "initialized data declaration" } */
+__auto_type a = 1, b = 2; /* { dg-error "single declarator" } */
+__auto_type long e0 = 0; /* { dg-error "__auto_type" } */
+__auto_type short e1 = 0; /* { dg-error "__auto_type" } */
+__auto_type signed e2 = 0; /* { dg-error "__auto_type" } */
+__auto_type unsigned e3 = 0; /* { dg-error "__auto_type" } */
+__auto_type _Complex e4 = 0; /* { dg-error "__auto_type" } */
+long __auto_type e5 = 0; /* { dg-error "__auto_type" } */
+short __auto_type e6 = 0; /* { dg-error "__auto_type" } */
+signed __auto_type e7 = 0; /* { dg-error "__auto_type" } */
+unsigned __auto_type e8 = 0; /* { dg-error "__auto_type" } */
+_Complex __auto_type e9 = 0; /* { dg-error "__auto_type" } */
+int __auto_type e10 = 0; /* { dg-error "two or more data types" } */
+__auto_type _Bool e11 = 0; /* { dg-error "two or more data types" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/autopar.exp b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/autopar.exp
new file mode 100644
index 000000000..c20cc3d47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/autopar.exp
@@ -0,0 +1,40 @@
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+if ![check_effective_target_pthread] {
+ return
+}
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c
new file mode 100644
index 000000000..a9d2185f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j;
+ int x[10000][10000];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i][j] = i + j + 3;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ if (x[i][j] != i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(10000);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-2.c
new file mode 100644
index 000000000..e0a142f0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-2.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j,ii;
+ int x[401][10][401];
+
+for (ii = 0; ii < N; ii++)
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i][j][ii] = ii+i + j + 3;
+
+for (ii = 0; ii < N; ii++)
+ for (i = 0; i < N;i++)
+ for (j = 0; j < N; j++)
+ if (x[i][j][ii] != ii+i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(400);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c
new file mode 100644
index 000000000..c6e0adbff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j;
+ int x[500][500];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < i; j++)
+ x[i][j] = i + j + 3;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < i; j++)
+ if (x[i][j] != i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(500);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c
new file mode 100644
index 000000000..d60023f5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int g_sum=0;
+int x[500][500];
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Double reduction is currently not supported, outer loop is not
+ parallelized. Inner reduction is detected, inner loop is
+ parallelized. */
+ sum = 0;
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum += x[i][j];
+
+ g_sum = sum;
+}
+
+int main(void)
+{
+ parloop(500);
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c
new file mode 100644
index 000000000..fa8029326
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c
@@ -0,0 +1,50 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int x[500][500];
+int y[500];
+int g_sum=0;
+
+__attribute__((noinline))
+void init (int i, int j)
+{
+ x[i][j]=1;
+}
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Inner cycle is currently not supported, outer loop is not
+ parallelized. Inner reduction is detected, inner loop is
+ parallelized. */
+ for (i = 0; i < N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += x[i][j];
+ y[i]=sum;
+ }
+ g_sum = sum;
+}
+
+int main(void)
+{
+ int i,j;
+ for (i = 0; i < 500; i++)
+ for (j = 0; j < 500; j++)
+ init(i, j);
+
+ parloop(500);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-6.c
new file mode 100644
index 000000000..b16366932
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-6.c
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int x[500][500];
+int y[500];
+int g_sum=0;
+
+__attribute__((noinline))
+void init (int i, int j)
+{
+ x[i][j]=1;
+}
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Outer loop reduction, outerloop is parallelized. */
+ sum=0;
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ y[i]=x[i][j];
+ sum += y[i];
+ }
+ g_sum = sum;
+}
+
+int main(void)
+{
+ int i,j;
+ for (i = 0; i < 500; i++)
+ for (j = 0; j < 500; j++)
+ init(i, j);
+
+ parloop(500);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "parallelizing inner loop" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/parallelization-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/parallelization-1.c
new file mode 100644
index 000000000..de2a0f3cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/parallelization-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i;
+ int x[10000990];
+
+ for (i = 0; i < N; i++)
+ x[i] = i + 3;
+
+ for (i = 0; i < N; i++)
+ {
+ if (x[i] != i + 3)
+ abort ();
+ }
+}
+
+int main(void)
+{
+ parloop(10000);
+
+ return 0;
+}
+
+/* Check that the first loop in parloop got parallelized. */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr39500-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr39500-1.c
new file mode 100644
index 000000000..6428bd062
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr39500-1.c
@@ -0,0 +1,28 @@
+/* pr39500: autopar fails to parallel */
+/* origin: nemokingdom@gmail.com(LiFeng) */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */
+
+void abort (void);
+
+int main (void)
+{
+ int i;
+ int x[100000];
+
+ for (i = 0; i < 10000; i++)
+ x[i] = x[i+10000];
+
+ for (i = 0; i < 10000; i++)
+ {
+ if (x[i] != x[i+10000])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* Check that the first loop in parloop got parallelized. */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr39500-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr39500-2.c
new file mode 100644
index 000000000..eabac3f88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr39500-2.c
@@ -0,0 +1,20 @@
+/* pr39500: autopar fails to parallel */
+/* origin: nemokingdom@gmail.com(LiFeng) */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */
+
+int main (void)
+{
+ int i;
+ int x[1000];
+
+ for (i = 0; i < 101; i++)
+ x[i] = x[i+100];
+
+ return x[12];
+}
+
+/* This loop cannot be parallelized due to a dependence. */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46066.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46066.c
new file mode 100644
index 000000000..e9bf6c59e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46066.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/46066 */
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug -O -ftree-parallelize-loops=4" } */
+
+void
+parloop (int N)
+{
+ int i, j, ii;
+ int x[400][10][400];
+ for (ii = 0; ii < N; ii++)
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i][j][ii] = 3;
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ if (x[i][j][0] != 3)
+ __builtin_abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46099.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46099.c
new file mode 100644
index 000000000..074278e64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46099.c
@@ -0,0 +1,47 @@
+/* PR tree-optimization/46099 */
+/* { dg-do compile } */
+/* { dg-options "-ftree-parallelize-loops=2 -fcompare-debug -O" } */
+
+static inline void
+bar (int *i)
+{
+ int j = *i;
+}
+
+void baz (int *, int *, int *);
+
+void
+f1 (int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ bar (&i);
+}
+
+void
+f2 (int n)
+{
+ int i;
+ int a[10000], b[10000], c[10000];
+ baz (a, b, c);
+ for (i = 0; i < n; i++)
+ {
+ void *p = c;
+ a[i] = b[i] + c[i];
+ }
+ baz (a, b, c);
+}
+
+void
+f3 (int n)
+{
+ int i;
+ int a[10000], b[10000], c[10000];
+ baz (a, b, c);
+ for (i = 0; i < n; i++)
+ {
+ a[i] = b[i] + c[i];
+ void *p = c;
+ }
+ baz (a, b, c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46194.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46194.c
new file mode 100644
index 000000000..574d6e672
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46194.c
@@ -0,0 +1,24 @@
+/* PR tree-optimization/46194 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
+
+#define N 1000
+int a[N];
+
+int foo (void)
+{
+ int j;
+ int i;
+
+ /* This is not blocked as it is not profitable. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[j] = a[i] + 1;
+
+ return a[0];
+}
+
+/* This loop cannot be parallelized due to a dependence. */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46561.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46561.c
new file mode 100644
index 000000000..a9499f340
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46561.c
@@ -0,0 +1,17 @@
+/* PR debug/46561 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -ftree-parallelize-loops=2 -fcompare-debug" } */
+
+extern void abort (void);
+
+void foo (char *c)
+{
+ int i;
+ unsigned x = 0;
+ {
+ for (i = 0; i < 64; i += 4)
+ x = x | *((unsigned *) (&c[i]));
+ if (x)
+ abort ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46799.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46799.c
new file mode 100644
index 000000000..575e12c55
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46799.c
@@ -0,0 +1,12 @@
+/* PR debug/46799 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-parallelize-loops=2 -fno-tree-dce -ftree-pre -fcompare-debug" } */
+
+int
+foo (int i, int *a)
+{
+ int e;
+ for (; i; i++)
+ e = *a;
+ return e;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46885.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46885.c
new file mode 100644
index 000000000..9560c92bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46885.c
@@ -0,0 +1,23 @@
+/* PR debug/46885 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-parallelize-loops=4 -fcompare-debug -fno-tree-dominator-opts -funswitch-loops" } */
+
+static inline void
+bar (int i)
+{
+ (void) i;
+}
+
+int
+foo (int *begin, int *end)
+{
+ int s = 0;
+ int *i;
+ for (i = begin; i != end; ++i)
+ {
+ bar (0);
+ if (begin)
+ return s;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46969.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46969.c
new file mode 100644
index 000000000..807ce4f92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr46969.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/46969 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-parallelize-loops=2 -fcompare-debug" } */
+
+extern void abort (void);
+#define F(name) \
+int \
+name (unsigned char *x) \
+{ \
+ int i; \
+ unsigned int c, d, e; \
+ if (x != 0) \
+ { \
+ for (i = 0, d = 0, e = 0xFFFFFFFF; \
+ i < 64; \
+ i += (int) sizeof(unsigned int)) \
+ { \
+ c = *((unsigned int *)(&x[i])); \
+ d = d | c; \
+ e = e & c; \
+ } \
+ if (!((d == e) && ((d >> 8) == (e & 0x00FFFFFF)))) \
+ abort (); \
+ } \
+ return 0; \
+}
+F (foo0) F (foo1)
+F (foo2) F (foo3)
+F (foo4) F (foo5)
+F (foo6) F (foo7)
+F (foo8) F (foo9)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr47060.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr47060.c
new file mode 100644
index 000000000..e8cdfd667
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr47060.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/47060 */
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -ftree-parallelize-loops=2 -fno-tree-dce" } */
+
+struct S
+{
+ int n;
+ float *a;
+};
+
+float
+foo (struct S *b)
+{
+ float c, d;
+ int j;
+ for (j = 0; j < b->n; j++)
+ d += b->a[j];
+ for (j = 0; j < b->n; j++)
+ c += b->a[j];
+ return d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49580.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49580.c
new file mode 100644
index 000000000..e08fd0e0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49580.c
@@ -0,0 +1,38 @@
+/* PR debug/49580 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 1600
+
+unsigned int ub[N];
+unsigned char reg_has_output_reload[N];
+unsigned int uc[N];
+
+ __attribute__ ((noinline))
+ void main2 (unsigned int regno, unsigned int n_reloads)
+ {
+ unsigned int nr=0;
+
+ if (regno> ub[regno])
+ nr=regno;
+ else
+ nr=ub[nr];
+
+ while (nr-- > 0)
+ if (n_reloads == 0 || reg_has_output_reload[regno + nr] == 0)
+ ub[regno + nr] = 0;
+}
+
+int main (void)
+{
+ main2 (799, 0);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49960-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49960-1.c
new file mode 100644
index 000000000..ac9d56784
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49960-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+int main()
+{
+ unsigned int x, y, idx, H = 1024, W = 1024;
+
+ int * tmps = (int *)malloc(H*W*sizeof(int));
+
+ /* This loop gets parallelized even though output dependences exist
+ between writes to 'tmps' that prevent parallelization.
+ For example: tmps[1] = 1, ..., tmps[1] = 17. */
+
+ for(x = 1; x < H; x++)
+ {
+ for(y = 1; y < W; y++)
+ {
+ idx = x*W+y;
+ tmps[idx % 4096] = idx;
+ }
+ }
+
+ for(x = 1; x < 8; x++)
+ printf("tmps[%d]=%d\n", x, tmps[x]);
+
+ return 0;
+}
+/* Check that no loop gets parallelized. */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49960.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49960.c
new file mode 100644
index 000000000..5dacb8de8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr49960.c
@@ -0,0 +1,56 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized -fno-partial-inlining" } */
+
+#include <stdio.h>
+#define MB 100
+#define NA 450
+#define MA 400
+
+int T[MA][MB],A[MA][NA],B[MB][NA];
+void MRTRBR(int MA_1, int NA_1, int MB_1)
+{
+ int i,j, t,k;
+
+ /* At the moment we are not able to hoist the loop headers out of the loop
+ nest.
+ Partial inlining needs to be disabled so we do not optimize this out
+ of the function body. */
+ if (MA_1 < 4 || NA_1 < 4 || MB_1 < 4)
+ return;
+
+ /* The outer most loop is not parallel because for different k's there
+ is write-write dependency for T[i][j]. */
+
+ /* The two inner loops don't get parallelized due to low number of
+ iterations. */
+
+ for (k = 3; k < NA_1; k++)
+ for (i = 3; i < MA_1; i++)
+ for (j = 3; j < MB_1; j++)
+ {
+ t = T[i][j];
+ T[i][j] = t+2+A[i][k]*B[j][k];
+ }
+}
+void main ()
+{
+ int j,i;
+
+ for (i = 3; i < MA; i++)
+ for (j = 3; j < MB; j++)
+ T[i][j] = (i>j?i:j);
+
+ MRTRBR (MA,NA,MB);
+
+ for (i = MA-1; i < MA; i++)
+ for (j = MB-10; j < MB; j++)
+ printf ("i %d j %d T[i][j] = %d\n",i,j,T[i][j]);
+}
+
+
+/* Check that the outer most loop doesn't get parallelized (thus no loop gets parallelized) */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr57103.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr57103.c
new file mode 100644
index 000000000..fa7067607
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr57103.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-parallelize-loops=4" } */
+
+int d[1024];
+
+static inline int foo (void)
+{
+ int s = 0;
+ int i = 0;
+ for (; i < 1024; i++)
+ s += d[i];
+ return s;
+}
+
+void bar (void)
+{
+ if (foo ())
+ __builtin_abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr57185.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr57185.c
new file mode 100644
index 000000000..b4657576d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/pr57185.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-parallelize-loops=2 -fipa-pta" } */
+
+int a, b;
+int *d;
+void f(void)
+{
+ int c;
+ b %= 1;
+
+ if(1 - (b < 1))
+ {
+ int *q = 0;
+
+ if(a)
+ {
+ c = 0;
+lbl:
+ for(*d; *d; ++*d)
+ if(c ? : a ? : (c = 1) ? : 0)
+ *q &= 1;
+ return;
+ }
+
+ q = (int *)1;
+ }
+ goto lbl;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c
new file mode 100644
index 000000000..8018a558c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+ #define N 1600
+ #define DIFF 2558402
+
+unsigned int ub[N];
+unsigned int uc[N];
+
+ /* Reduction of unsigned-int. */
+
+ void main1 (unsigned int x, unsigned int max_result, unsigned int min_result)
+ {
+ int i;
+ unsigned int udiff = 2;
+ unsigned int umax = x;
+ unsigned int umin = x;
+
+ /* Summation. */
+ for (i = 0; i < N; i++) {
+ udiff += (ub[i] - uc[i]);
+ }
+
+ /* Maximum. */
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ /* Minimum. */
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+ }
+
+ __attribute__((noinline))
+ void init_arrays ()
+ {
+ int i;
+
+ ub[0] = 1;
+ uc[0] = 1;
+ for (i=1; i<N; i++)
+ {
+ ub[i] = i * 3;
+ uc[i] = i;
+ }
+}
+
+int main (void)
+{
+ init_arrays ();
+ main1 (2000, 2000, 1);
+ main1 (0, 1599, 0);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 4 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c
new file mode 100644
index 000000000..76645c850
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c
@@ -0,0 +1,67 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 1600
+#define DIFF 242
+
+unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
+{
+ int i;
+ unsigned char udiff = 2;
+ unsigned char umax = x;
+ unsigned char umin = x;
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned char)(ub[i] - uc[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+ __attribute__((noinline))
+ void init_arrays ()
+ {
+ int i;
+
+ for (i=16; i<N; i++)
+ {
+ ub[i] = 1;
+ uc[i] = 1;
+ }
+}
+
+int main (void)
+{
+ init_arrays();
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 4 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1short.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1short.c
new file mode 100644
index 000000000..526f17009
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1short.c
@@ -0,0 +1,66 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 1600
+#define DIFF 242
+
+unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) void
+main1 (unsigned short x, unsigned short max_result, unsigned short min_result)
+{
+ int i;
+ unsigned short udiff = 2;
+ unsigned short umax = x;
+ unsigned short umin = x;
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned short)(ub[i] - uc[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+ __attribute__((noinline))
+ void init_arrays ()
+ {
+ int i;
+
+ for (i=16; i<N; i++)
+ {
+ ub[i] = 1;
+ uc[i] = 1;
+ }
+}
+
+int main (void)
+{
+ init_arrays();
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 4 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c
new file mode 100644
index 000000000..e0abb265b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c
@@ -0,0 +1,70 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 1600
+#define DIFF 2558400
+
+int b[N];
+int c[N];
+
+/* Reduction of signed-int. */
+
+__attribute__ ((noinline))
+void main1 (int x, int max_result, int min_result)
+{
+ int i;
+ int diff = 0;
+ int max = x;
+ int min = x;
+
+ for (i = 0; i < N; i++) {
+ diff += (b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+ __attribute__((noinline))
+ void init_arrays ()
+ {
+ int i;
+
+ b[0] = 1;
+ c[0] = 1;
+ for (i=1; i<N; i++)
+ {
+ b[i] = i * 3;
+ c[i] = i;
+ }
+}
+
+int main (void)
+{
+ init_arrays ();
+ main1 (2000, 2000, 1);
+ main1 (0, 1599, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 3 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 4 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c
new file mode 100644
index 000000000..ada1275f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c
@@ -0,0 +1,68 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 1600
+#define DIFF 121
+
+signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
+signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline))
+void main1 (signed char x, signed char max_result, signed char min_result)
+{
+ int i;
+ signed char diff = 2;
+ signed char max = x;
+ signed char min = x;
+
+ for (i = 0; i < N; i++) {
+ diff += (signed char)(b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+ __attribute__((noinline))
+ void init_arrays ()
+ {
+ int i;
+
+ for (i=16; i<N; i++)
+ {
+ b[i] = 1;
+ c[i] = 1;
+ }
+}
+
+int main (void)
+{
+ init_arrays();
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2short.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2short.c
new file mode 100644
index 000000000..3363c68f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2short.c
@@ -0,0 +1,66 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 1600
+#define DIFF 242
+
+short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline))
+void main1 (short x, short max_result, short min_result)
+{
+ int i;
+ short diff = 2;
+ short max = x;
+ short min = x;
+
+ for (i = 0; i < N; i++) {
+ diff += (short)(b[i] - c[i]);
+ }
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+ __attribute__((noinline))
+ void init_arrays ()
+ {
+ int i;
+
+ for (i=16; i<N; i++)
+ {
+ b[i] = 1;
+ c[i] = 1;
+ }
+}
+
+int main (void)
+{
+ init_arrays();
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c
new file mode 100644
index 000000000..6bc204711
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c
@@ -0,0 +1,57 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 1600
+
+unsigned int ub[N];
+unsigned int uc[N];
+
+/* Reduction of unsigned-int. */
+
+__attribute__ ((noinline))
+int main1 (int n, int res)
+{
+ int i;
+ unsigned int udiff;
+
+ udiff = 0;
+ for (i = 0; i < n; i++) {
+ udiff += (ub[i] - uc[i]);
+ }
+
+ /* check results: */
+ if (udiff != res)
+ abort ();
+
+ return 0;
+}
+
+__attribute__((noinline))
+void init_arrays ()
+{
+ int i;
+
+ for (i=0; i<N; i++)
+ {
+ ub[i] = i * 3;
+ uc[i] = i;
+ }
+}
+
+int main (void)
+{
+ init_arrays ();
+ main1 (N, 2558400);
+ main1 (N-1, 2555202);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 2 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c
new file mode 100644
index 000000000..fface8fed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c
@@ -0,0 +1,63 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+#define N 1600
+#define DIFF 2558402
+
+
+__attribute__ ((noinline))
+int main1 (float x, float max_result)
+{
+ int i;
+ float b[N];
+ float c[N];
+ float diff = 2;
+ float max = x;
+ float min = 10;
+
+ for (i=0; i<N; i++)
+ {
+ b[i] = i * 3;
+ c[i] = i;
+ }
+
+ for (i = 0; i < N; i++) {
+ diff += (b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != 0)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ main1 (2000, 2000);
+ main1 (0, 1599);
+ return 0;
+}
+
+
+/* need -ffast-math to parallelize these loops. */
+/* { dg-final { scan-tree-dump-times "Detected reduction" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "FAILED: it is not a part of reduction" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c
new file mode 100644
index 000000000..f66069e56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c
@@ -0,0 +1,91 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdlib.h>
+
+#define N 3200
+
+extern void abort (void);
+typedef unsigned char T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum < lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum > lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+int main (void)
+{
+ static unsigned char A[N] = {
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
+ };
+
+ static unsigned char B[N] = {
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
+ };
+
+ static unsigned char C[N] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ };
+
+ int i;
+
+ for (i=32; i<N; i++)
+ {
+ A[i]= 0x01;
+ B[i]= 0x70;
+ C[i]= 0xff;
+ }
+
+ testmin (A, 10, 1);
+ testmin (B, 0x7f, 0x70);
+ testmin (C, 0x7f, 0x09);
+
+ testmax (A, 0, 0x7f);
+ testmax (B, 0, 0x8f);
+ testmax (C, 0, 0xff);
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c
new file mode 100644
index 000000000..4a416df23
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c
@@ -0,0 +1,90 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdlib.h>
+
+#define N 3200
+
+extern void abort (void);
+typedef signed char T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum < lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum > lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+int main (void)
+{
+ static signed char A[N] = {
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
+ };
+
+ static signed char B[N] = {
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
+ };
+
+ static signed char C[N] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ };
+
+ int i;
+
+ for (i=32; i<N; i++)
+ {
+ A[i]= 0x01;
+ B[i]= 0x70;
+ C[i]= 0xff;
+ }
+
+ testmin (A, 0, 0);
+ testmin (B, 0, 0x80);
+ testmin (C, 0, 0x80);
+
+ testmax (A, 0, 0x7f);
+ testmax (B, 0, 0x7f);
+ testmax (C, 0, 0x77);
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c
new file mode 100644
index 000000000..2c1677ce5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c
@@ -0,0 +1,90 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+#include <stdlib.h>
+
+#define N 3200
+
+extern void abort (void);
+typedef unsigned short T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum < lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum > lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+int main (void)
+{
+ static unsigned short A[N] = {
+ 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
+ 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010,
+ 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+ 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff
+ };
+
+ static unsigned short B[N] = {
+ 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+ 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
+ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
+ 0x8008, 0x8009, 0x800a, 0x800b, 0x800c, 0x800d, 0x800e, 0x800f
+ };
+
+ static unsigned short C[N] = {
+ 0xffff, 0xfffe, 0xfffd, 0xfffc, 0xfffb, 0xfffa, 0xfff9, 0xfff8,
+ 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010,
+ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
+ 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+ };
+
+ int i;
+
+ for (i=32; i<N; i++)
+ {
+ A[i]= 0x0001;
+ B[i]= 0x7000;
+ C[i]= 0xffff;
+ }
+
+ testmin (A, 10, 1);
+ testmin (B, 0x7fff, 0x7000);
+ testmin (C, 0x7fff, 0x0009);
+
+ testmax (A, 0, 0x7fff);
+ testmax (B, 0, 0x800f);
+ testmax (C, 0, 0xffff);
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Detected reduction" 2 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-1.c
new file mode 100644
index 000000000..36831a5d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+/* This test checks that builtin_constant_p can be used safely in
+ initializers for static data. The macro X() defined below should
+ be an acceptable initializer expression no matter how complex its
+ argument is. */
+
+extern int a;
+extern int b;
+
+extern int foo(void);
+extern int bar(void);
+
+#define X(exp) (__builtin_constant_p(exp) ? (exp) : -1)
+
+const short tests[] = {
+ X(0),
+ X(a),
+ X(0 && a),
+ X(a && b),
+ X(foo()),
+ X(0 && foo()),
+ X(a && foo()),
+ X(foo() && bar())
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-2.c
new file mode 100644
index 000000000..5b5ff8b1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-2.c
@@ -0,0 +1,27 @@
+/* As bconstp-1.c, but with the __builtin_constant_p calls
+ parenthesized. */
+/* { dg-do compile } */
+
+/* This test checks that builtin_constant_p can be used safely in
+ initializers for static data. The macro X() defined below should
+ be an acceptable initializer expression no matter how complex its
+ argument is. */
+
+extern int a;
+extern int b;
+
+extern int foo(void);
+extern int bar(void);
+
+#define X(exp) ((__builtin_constant_p(exp)) ? (exp) : -1)
+
+const short tests[] = {
+ X(0),
+ X(a),
+ X(0 && a),
+ X(a && b),
+ X(foo()),
+ X(0 && foo()),
+ X(a && foo()),
+ X(foo() && bar())
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-3.c
new file mode 100644
index 000000000..9e3d10f39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-3.c
@@ -0,0 +1,27 @@
+/* As bconstp-1.c, but with the __builtin_constant_p calls inside
+ __builtin_choose_expr. */
+/* { dg-do compile } */
+
+/* This test checks that builtin_constant_p can be used safely in
+ initializers for static data. The macro X() defined below should
+ be an acceptable initializer expression no matter how complex its
+ argument is. */
+
+extern int a;
+extern int b;
+
+extern int foo(void);
+extern int bar(void);
+
+#define X(exp) (__builtin_choose_expr(1, __builtin_constant_p(exp), 1) ? (exp) : -1)
+
+const short tests[] = {
+ X(0),
+ X(a),
+ X(0 && a),
+ X(a && b),
+ X(foo()),
+ X(0 && foo()),
+ X(a && foo()),
+ X(foo() && bar())
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-4.c
new file mode 100644
index 000000000..bb8aef19f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bconstp-4.c
@@ -0,0 +1,10 @@
+/* Test that a condition is not counted as a call to
+ __builtin_constant_p if that call is itself inside a conditional
+ expression with __builtin_constant_p condition. */
+/* { dg-do compile } */
+
+extern int foo(void);
+
+#define X(exp) (__builtin_choose_expr(1, __builtin_constant_p(exp), 1) ? (exp) : -1)
+
+const int x = ((__builtin_constant_p(1) ? __builtin_constant_p (0 && foo()) : 0) ? (0 && foo()) : -1); /* { dg-error "initializer element is not a constant expression" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c
new file mode 100644
index 000000000..d62da2ad5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-attrib.c
@@ -0,0 +1,40 @@
+/* bf-ms-attrib.c */
+/* Adapted from Donn Terry <donnte@microsoft.com> testcase
+ posted to GCC-patches
+ http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */
+
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* } } */
+
+/* We don't want the default "pedantic-errors" in this case, since we're
+ testing nonstandard stuff to begin with. */
+/* { dg-options "-ansi" } */
+
+extern void abort(void);
+
+struct one_gcc {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+} __attribute__((__gcc_struct__)) ;
+
+
+struct one_ms {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+} __attribute__((__ms_struct__));
+
+
+main()
+ {
+ /* As long as the sizes are as expected, we know attributes are working.
+ bf-ms-layout.c makes sure the right thing happens when the attribute
+ is on. */
+ if (sizeof(struct one_ms) != 8)
+ abort();
+ if (sizeof(struct one_gcc) != 8)
+ abort();
+ return 0;
+ }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout-2.c
new file mode 100644
index 000000000..408ddbeb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout-2.c
@@ -0,0 +1,236 @@
+/* bf-ms-layout.c */
+
+/* Test for MS bitfield layout */
+/* Adapted from Donn Terry <donnte@microsoft.com> testcase
+ posted to GCC-patches
+ http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */
+
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } } */
+/* { dg-options "-D_TEST_MS_LAYOUT" } */
+/* This test uses the attribute instead of the command line option. */
+
+#include <stddef.h>
+#include <string.h>
+
+extern void abort();
+
+#pragma pack(8)
+
+#ifdef __GNUC__
+#define ATTR __attribute__ ((ms_struct))
+#endif
+
+struct one {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+} ATTR;
+
+struct two {
+ int d;
+ unsigned char a;
+ unsigned int b:7;
+ char c;
+} ATTR;
+
+struct three {
+ short d;
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned char c:7;
+} ATTR;
+
+
+/* Bitfields of size 0 have some truly odd behaviors. */
+
+struct four {
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned int :0; /* forces struct alignment to int */
+ unsigned char c:7;
+} ATTR;
+
+struct five {
+ char a;
+ int :0; /* ignored; prior field is not a bitfield. */
+ char b;
+ char c;
+} ATTR;
+
+struct six {
+ char a :8;
+ int :0; /* not ignored; prior field IS a bitfield, causes
+ struct alignment as well. */
+ char b;
+ char c;
+} ATTR;
+
+struct seven {
+ char a:8;
+ char :0;
+ int :0; /* Ignored; prior field is zero size bitfield. */
+ char b;
+ char c;
+} ATTR;
+
+struct eight { /* ms size 4 */
+ short b:3;
+ char c;
+} ATTR;
+
+#ifdef _MSC_VER
+#define LONGLONG __int64
+#else
+#define LONGLONG long long
+#endif
+
+union nine { /* ms size 8 */
+ LONGLONG a:3;
+ char c;
+} ATTR;
+
+struct ten { /* ms size 16 */
+ LONGLONG a:3;
+ LONGLONG b:3;
+ char c;
+} ATTR;
+
+
+#define val(s,f) (s.f)
+
+#define check_struct(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_struct_size(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_struct_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union_size(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_union_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+int main(){
+
+ unsigned char filler[16];
+ struct one test_one;
+ struct two test_two;
+ struct three test_three;
+ struct four test_four;
+ struct five test_five;
+ struct six test_six;
+ struct seven test_seven;
+ struct eight test_eight;
+ union nine test_nine;
+ struct ten test_ten;
+
+#if defined (_TEST_MS_LAYOUT) || defined (_MSC_VER)
+ size_t exp_sizeof_one = 8;
+ size_t exp_sizeof_two = 12;
+ size_t exp_sizeof_three =6;
+ size_t exp_sizeof_four = 8;
+ size_t exp_sizeof_five = 3;
+ size_t exp_sizeof_six = 8;
+ size_t exp_sizeof_seven = 3;
+ size_t exp_sizeof_eight = 2;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 8;
+
+ unsigned char exp_one_c = 7;
+ unsigned char exp_two_c = 9;
+ unsigned char exp_three_c = 4;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 2;
+ char exp_six_c = 5;
+ char exp_seven_c = 2;
+ char exp_eight_c = 1;
+ char exp_nine_c = 0;
+ char exp_ten_c = 1;
+
+#else /* testing -mno-ms-bitfields */
+
+ size_t exp_sizeof_one = 8;
+ size_t exp_sizeof_two = 8;
+ size_t exp_sizeof_three = 6;
+ size_t exp_sizeof_four = 6;
+ size_t exp_sizeof_five = 6;
+ size_t exp_sizeof_six = 6;
+ size_t exp_sizeof_seven = 6;
+ size_t exp_sizeof_eight = 2;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 8;
+
+ unsigned short exp_one_c = 6;
+ unsigned int exp_two_c = 6;
+ unsigned char exp_three_c = 64;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 5;
+ char exp_six_c = 5;
+ char exp_seven_c = 5;
+ char exp_eight_c = 1;
+ char exp_nine_c = 0;
+ char exp_ten_c = 1;
+
+#endif
+
+ unsigned char i;
+ for ( i = 0; i < 16; i++ )
+ filler[i] = i;
+
+ check_struct_off (one);
+ check_struct_off (two);
+ check_struct_off (three);
+ check_struct_off (four);
+ check_struct_off (five);
+ check_struct_off (six);
+ check_struct_off (seven);
+ check_struct_off (eight);
+ check_union_off (nine);
+ check_struct_off (ten);
+
+ check_struct_size (one);
+ check_struct_size (two);
+ check_struct_size (three);
+ check_struct_size (four);
+ check_struct_size (five);
+ check_struct_size (six);
+ check_struct_size (seven);
+ check_struct_size (eight);
+ check_union_size (nine);
+ check_struct_size (ten);
+
+ return 0;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout-3.c
new file mode 100644
index 000000000..a4e9ab3ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout-3.c
@@ -0,0 +1,52 @@
+/* Test for MS bitfield layout */
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-* x86_64-*-* } } */
+
+extern void abort();
+
+struct s1_t {
+ char a;
+ char b __attribute__ ((aligned (16)));
+} __attribute__ ((ms_struct));
+struct s1_t s1;
+
+struct s2_t {
+ char a;
+ char b;
+} __attribute__ ((ms_struct));
+struct s2_t s2;
+
+struct s3_t {
+ __extension__ char a : 6;
+ char b __attribute__ ((aligned (16)));
+} __attribute__ ((ms_struct));
+struct s3_t s3;
+
+struct s4_t {
+ __extension__ char a : 6;
+ char b __attribute__ ((aligned (2)));
+} __attribute__ ((ms_struct));
+struct s4_t s4;
+
+struct s5_t {
+ __extension__ char a : 6;
+ char b __attribute__ ((aligned (1)));
+} __attribute__ ((ms_struct));
+struct s5_t s5;
+
+__extension__
+static __PTRDIFF_TYPE__ offs (const void *a, const void *b)
+{
+ return (__PTRDIFF_TYPE__) ((const char*)a - (const char*)b);
+}
+
+int main()
+{
+ if (offs (&s1.b, &s1) != 16
+ || offs (&s2.b, &s2) != 1
+ || offs (&s3.b, &s3) != 16
+ || offs (&s4.b, &s4) != 2
+ || offs (&s5.b, &s5) != 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout.c b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout.c
new file mode 100644
index 000000000..109a01b0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bf-ms-layout.c
@@ -0,0 +1,231 @@
+/* bf-ms-layout.c */
+
+/* Test for MS bitfield layout */
+/* Adapted from Donn Terry <donnte@microsoft.com> testcase
+ posted to GCC-patches
+ http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */
+
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin* } } */
+/* { dg-options "-mms-bitfields -D_TEST_MS_LAYOUT" } */
+
+#include <stddef.h>
+#include <string.h>
+
+extern void abort();
+
+#pragma pack(8)
+
+struct one {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+} ;
+
+struct two {
+ int d;
+ unsigned char a;
+ unsigned int b:7;
+ char c;
+} ;
+
+struct three {
+ short d;
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned char c:7;
+} ;
+
+
+/* Bitfields of size 0 have some truly odd behaviors. */
+
+struct four {
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned int :0; /* forces struct alignment to int */
+ unsigned char c:7;
+} ;
+
+struct five {
+ char a;
+ int :0; /* ignored; prior field is not a bitfield. */
+ char b;
+ char c;
+} ;
+
+struct six {
+ char a :8;
+ int :0; /* not ignored; prior field IS a bitfield, causes
+ struct alignment as well. */
+ char b;
+ char c;
+} ;
+
+struct seven {
+ char a:8;
+ char :0;
+ int :0; /* Ignored; prior field is zero size bitfield. */
+ char b;
+ char c;
+} ;
+
+struct eight { /* ms size 4 */
+ short b:3;
+ char c;
+} ;
+
+#ifdef _MSC_VER
+#define LONGLONG __int64
+#else
+#define LONGLONG long long
+#endif
+
+union nine { /* ms size 8 */
+ LONGLONG a:3;
+ char c;
+} ;
+
+struct ten { /* ms size 16 */
+ LONGLONG a:3;
+ LONGLONG b:3;
+ char c;
+} ;
+
+
+#define val(s,f) (s.f)
+
+#define check_struct(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_struct_size(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_struct_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union_size(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_union_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+int main(){
+
+ unsigned char filler[16];
+ struct one test_one;
+ struct two test_two;
+ struct three test_three;
+ struct four test_four;
+ struct five test_five;
+ struct six test_six;
+ struct seven test_seven;
+ struct eight test_eight;
+ union nine test_nine;
+ struct ten test_ten;
+
+#if defined (_TEST_MS_LAYOUT) || defined (_MSC_VER)
+ size_t exp_sizeof_one = 8;
+ size_t exp_sizeof_two = 12;
+ size_t exp_sizeof_three =6;
+ size_t exp_sizeof_four = 8;
+ size_t exp_sizeof_five = 3;
+ size_t exp_sizeof_six = 8;
+ size_t exp_sizeof_seven = 3;
+ size_t exp_sizeof_eight = 2;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 8;
+
+ unsigned char exp_one_c = 7;
+ unsigned char exp_two_c = 9;
+ unsigned char exp_three_c = 4;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 2;
+ char exp_six_c = 5;
+ char exp_seven_c = 2;
+ char exp_eight_c = 1;
+ char exp_nine_c = 0;
+ char exp_ten_c = 1;
+
+#else /* testing -mno-ms-bitfields */
+
+ size_t exp_sizeof_one = 8;
+ size_t exp_sizeof_two = 8;
+ size_t exp_sizeof_three = 6;
+ size_t exp_sizeof_four = 6;
+ size_t exp_sizeof_five = 6;
+ size_t exp_sizeof_six = 6;
+ size_t exp_sizeof_seven = 6;
+ size_t exp_sizeof_eight = 2;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 8;
+
+ unsigned short exp_one_c = 6;
+ unsigned int exp_two_c = 6;
+ unsigned char exp_three_c = 64;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 5;
+ char exp_six_c = 5;
+ char exp_seven_c = 5;
+ char exp_eight_c = 1;
+ char exp_nine_c = 0;
+ char exp_ten_c = 1;
+
+#endif
+
+ unsigned char i;
+ for ( i = 0; i < 16; i++ )
+ filler[i] = i;
+
+ check_struct_off (one);
+ check_struct_off (two);
+ check_struct_off (three);
+ check_struct_off (four);
+ check_struct_off (five);
+ check_struct_off (six);
+ check_struct_off (seven);
+ check_struct_off (eight);
+ check_union_off (nine);
+ check_struct_off (ten);
+
+ check_struct_size (one);
+ check_struct_size (two);
+ check_struct_size (three);
+ check_struct_size (four);
+ check_struct_size (five);
+ check_struct_size (six);
+ check_struct_size (seven);
+ check_struct_size (eight);
+ check_union_size (nine);
+ check_struct_size (ten);
+
+ return 0;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bf-no-ms-layout.c b/gcc-4.9/gcc/testsuite/gcc.dg/bf-no-ms-layout.c
new file mode 100644
index 000000000..7e5532182
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bf-no-ms-layout.c
@@ -0,0 +1,231 @@
+/* bf-no-ms-layout.c */
+
+/* Test for gcc bitfield layout, with -mno-ms-bitfields */
+/* Adapted from Donn Terry <donnte@microsoft.com> testcase
+ posted to GCC-patches
+ http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00577.html */
+
+/* { dg-do run { target *-*-interix* *-*-mingw* *-*-cygwin* i?86-*-darwin } } */
+/* { dg-options "-mno-ms-bitfields" } */
+
+#include <stddef.h>
+#include <string.h>
+
+extern void abort();
+
+#pragma pack(8)
+
+struct one {
+ int d;
+ unsigned char a;
+ unsigned short b:7;
+ char c;
+};
+
+struct two {
+ int d;
+ unsigned char a;
+ unsigned int b:7;
+ char c;
+};
+
+struct three {
+ short d;
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned char c:7;
+};
+
+
+/* Bitfields of size 0 have some truly odd behaviors. */
+
+struct four {
+ unsigned short a:3;
+ unsigned short b:9;
+ unsigned int :0; /* forces struct alignment to int */
+ unsigned char c:7;
+};
+
+struct five {
+ char a;
+ int :0; /* ignored; prior field is not a bitfield. */
+ char b;
+ char c;
+};
+
+struct six {
+ char a :8;
+ int :0; /* not ignored; prior field IS a bitfield, causes
+ struct alignment as well. */
+ char b;
+ char c;
+} ;
+
+struct seven {
+ char a:8;
+ char :0;
+ int :0; /* Ignored; prior field is zero size bitfield. */
+ char b;
+ char c;
+};
+
+struct eight { /* ms size 4 */
+ short b:3;
+ char c;
+};
+
+#ifdef _MSC_VER
+#define LONGLONG __int64
+#else
+#define LONGLONG long long
+#endif
+
+union nine { /* ms size 8 */
+ LONGLONG a:3;
+ char c;
+};
+
+struct ten { /* ms size 16 */
+ LONGLONG a:3;
+ LONGLONG b:3;
+ char c;
+};
+
+
+#define val(s,f) (s.f)
+
+#define check_struct(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_struct_size(_X) \
+{ \
+ if (sizeof (struct _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_struct_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+#define check_union_size(_X) \
+{ \
+ if (sizeof (union _X) != exp_sizeof_##_X ) \
+ abort(); \
+}
+
+#define check_union_off(_X) \
+{ \
+ memcpy(&test_##_X, filler, sizeof(test_##_X));\
+ if (val(test_##_X,c) != exp_##_X##_c) \
+ abort(); \
+}
+
+int main(){
+
+ unsigned char filler[16];
+ struct one test_one;
+ struct two test_two;
+ struct three test_three;
+ struct four test_four;
+ struct five test_five;
+ struct six test_six;
+ struct seven test_seven;
+ struct eight test_eight;
+ union nine test_nine;
+ struct ten test_ten;
+
+#if defined (_TEST_MS_LAYOUT) || defined (_MSC_VER)
+ size_t exp_sizeof_one = 12;
+ size_t exp_sizeof_two = 16;
+ size_t exp_sizeof_three =6;
+ size_t exp_sizeof_four = 8;
+ size_t exp_sizeof_five = 3;
+ size_t exp_sizeof_six = 8;
+ size_t exp_sizeof_seven = 3;
+ size_t exp_sizeof_eight = 4;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 16;
+
+ unsigned char exp_one_c = 8;
+ unsigned char exp_two_c = 12;
+ unsigned char exp_three_c = 4;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 2;
+ char exp_six_c = 5;
+ char exp_seven_c = 2;
+ char exp_eight_c = 2;
+ char exp_nine_c = 0;
+ char exp_ten_c = 8;
+
+#else /* testing -mno-ms-bitfields */
+
+ size_t exp_sizeof_one = 8;
+ size_t exp_sizeof_two = 8;
+ size_t exp_sizeof_three = 6;
+ size_t exp_sizeof_four = 6;
+ size_t exp_sizeof_five = 6;
+ size_t exp_sizeof_six = 6;
+ size_t exp_sizeof_seven = 6;
+ size_t exp_sizeof_eight = 2;
+ size_t exp_sizeof_nine = 8;
+ size_t exp_sizeof_ten = 8;
+
+ unsigned short exp_one_c = 6;
+ unsigned int exp_two_c = 6;
+ unsigned char exp_three_c = 64;
+ unsigned char exp_four_c = 4;
+ char exp_five_c = 5;
+ char exp_six_c = 5;
+ char exp_seven_c = 5;
+ char exp_eight_c = 1;
+ char exp_nine_c = 0;
+ char exp_ten_c = 1;
+
+#endif
+
+ unsigned char i;
+ for ( i = 0; i < 16; i++ )
+ filler[i] = i;
+
+ check_struct_off (one);
+ check_struct_off (two);
+ check_struct_off (three);
+ check_struct_off (four);
+ check_struct_off (five);
+ check_struct_off (six);
+ check_struct_off (seven);
+ check_struct_off (eight);
+ check_union_off (nine);
+ check_struct_off (ten);
+
+ check_struct_size (one);
+ check_struct_size (two);
+ check_struct_size (three);
+ check_struct_size (four);
+ check_struct_size (five);
+ check_struct_size (six);
+ check_struct_size (seven);
+ check_struct_size (eight);
+ check_union_size (nine);
+ check_struct_size (ten);
+
+ return 0;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bf-spl1.c b/gcc-4.9/gcc/testsuite/gcc.dg/bf-spl1.c
new file mode 100644
index 000000000..b28130dac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bf-spl1.c
@@ -0,0 +1,59 @@
+/* { dg-do run { target m68k-*-* fido-*-* sparc-*-* } } */
+/* { dg-options { -O2 } } */
+
+extern void abort (void);
+
+typedef float SFtype __attribute__ ((mode (SF)));
+typedef float DFtype __attribute__ ((mode (DF)));
+
+typedef int HItype __attribute__ ((mode (HI)));
+typedef int SItype __attribute__ ((mode (SI)));
+typedef int DItype __attribute__ ((mode (DI)));
+
+typedef unsigned int UHItype __attribute__ ((mode (HI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+typedef unsigned int UDItype __attribute__ ((mode (DI)));
+
+typedef UDItype fractype;
+typedef USItype halffractype;
+typedef DFtype FLO_type;
+typedef DItype intfrac;
+
+
+typedef union
+{
+ long long foo;
+ FLO_type value;
+ struct
+ {
+ fractype fraction:52 __attribute__ ((packed));
+ unsigned int exp:11 __attribute__ ((packed));
+ unsigned int sign:1 __attribute__ ((packed));
+ }
+ bits;
+} FLO_union_type;
+
+void foo (long long a);
+long long x;
+
+void
+pack_d ()
+{
+ FLO_union_type dst = { 0x0123456789abcdefLL };
+
+ x = dst.bits.fraction;
+}
+
+main ()
+{
+ pack_d ();
+ foo (x);
+ return 0;
+}
+
+void
+foo (long long a)
+{
+ if (a != 0x0123456789abcLL)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-1.c
new file mode 100644
index 000000000..b7cc5fd0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-1.c
@@ -0,0 +1,312 @@
+/* Test for binary integer constants. */
+
+/* Derived from: c99-intconst-1.c, bye Joseph Myers <jsm28@cam.ac.uk>. */
+/* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+#include <limits.h>
+
+/* Assertion that constant C is of type T. */
+#define ASSERT_CONST_TYPE(C, T) \
+ do { \
+ typedef T type; \
+ typedef type **typepp; \
+ typedef __typeof__((C)) ctype; \
+ typedef ctype **ctypepp; \
+ typepp x = 0; \
+ ctypepp y = 0; \
+ x = y; \
+ y = x; \
+ } while (0)
+
+/* (T *) if E is zero, (void *) otherwise. */
+#define type_if_not(T, E) __typeof__(0 ? (T *)0 : (void *)(E))
+
+/* (T *) if E is nonzero, (void *) otherwise. */
+#define type_if(T, E) type_if_not(T, !(E))
+
+/* Combine pointer types, all but one (void *). */
+#define type_comb2(T1, T2) __typeof__(0 ? (T1)0 : (T2)0)
+#define type_comb3(T1, T2, T3) type_comb2(T1, type_comb2(T2, T3))
+#define type_comb4(T1, T2, T3, T4) \
+ type_comb2(T1, type_comb2(T2, type_comb2(T3, T4)))
+#define type_comb6(T1, T2, T3, T4, T5, T6) \
+ type_comb2(T1, \
+ type_comb2(T2, \
+ type_comb2(T3, \
+ type_comb2(T4, \
+ type_comb2(T5, T6)))))
+
+/* (T1 *) if E1, otherwise (T2 *) if E2. */
+#define first_of2p(T1, E1, T2, E2) type_comb2(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))))
+/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3. */
+#define first_of3p(T1, E1, T2, E2, T3, E3) \
+ type_comb3(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))), \
+ type_if(T3, (!(E1) && !(E2) && (E3))))
+/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise
+ (T4 *) if E4. */
+#define first_of4p(T1, E1, T2, E2, T3, E3, T4, E4) \
+ type_comb4(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))), \
+ type_if(T3, (!(E1) && !(E2) && (E3))), \
+ type_if(T4, (!(E1) && !(E2) && !(E3) && (E4))))
+/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise
+ (T4 *) if E4, otherwise (T5 *) if E5, otherwise (T6 *) if E6. */
+#define first_of6p(T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6) \
+ type_comb6(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))), \
+ type_if(T3, (!(E1) && !(E2) && (E3))), \
+ type_if(T4, (!(E1) && !(E2) && !(E3) && (E4))), \
+ type_if(T5, (!(E1) && !(E2) && !(E3) && !(E4) && (E5))), \
+ type_if(T6, (!(E1) && !(E2) && !(E3) \
+ && !(E4) && !(E5) && (E6))))
+
+/* Likewise, but return the original type rather than a pointer type. */
+#define first_of2(T1, E1, T2, E2) \
+ __typeof__(*((first_of2p(T1, (E1), T2, (E2)))0))
+#define first_of3(T1, E1, T2, E2, T3, E3) \
+ __typeof__(*((first_of3p(T1, (E1), T2, (E2), T3, (E3)))0))
+#define first_of4(T1, E1, T2, E2, T3, E3, T4, E4) \
+ __typeof__(*((first_of4p(T1, (E1), T2, (E2), T3, (E3), T4, (E4)))0))
+#define first_of6(T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6) \
+ __typeof__(*((first_of6p(T1, (E1), T2, (E2), T3, (E3), \
+ T4, (E4), T5, (E5), T6, (E6)))0))
+
+/* Types of constants according to the C99 rules. */
+#define C99_UNSUF_TYPE(C) \
+ first_of6(int, (C) <= INT_MAX, \
+ unsigned int, (C) <= UINT_MAX, \
+ long int, (C) <= LONG_MAX, \
+ unsigned long int, (C) <= ULONG_MAX, \
+ long long int, (C) <= LLONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+#define C99_SUFu_TYPE(C) \
+ first_of3(unsigned int, (C) <= UINT_MAX, \
+ unsigned long int, (C) <= ULONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+#define C99_SUFl_TYPE(C) \
+ first_of4(long int, (C) <= LONG_MAX, \
+ unsigned long int, (C) <= ULONG_MAX, \
+ long long int, (C) <= LLONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+#define C99_SUFul_TYPE(C) \
+ first_of2(unsigned long int, (C) <= ULONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+#define C99_SUFll_TYPE(C) \
+ first_of2(long long int, (C) <= LLONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+
+/* Checks that constants have correct type. */
+#define CHECK_UNSUF_TYPE(C) \
+ ASSERT_CONST_TYPE((C), C99_UNSUF_TYPE((C)))
+#define CHECK_SUFu_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFu_TYPE((C)))
+#define CHECK_SUFl_TYPE(C) \
+ ASSERT_CONST_TYPE((C), C99_SUFl_TYPE((C)))
+#define CHECK_SUFul_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFul_TYPE((C)))
+#define CHECK_SUFll_TYPE(C) \
+ ASSERT_CONST_TYPE((C), C99_SUFll_TYPE((C)))
+#define CHECK_SUFull_TYPE(C) ASSERT_CONST_TYPE((C), unsigned long long int)
+
+/* Check an octal or hexadecimal value, with all suffixes. */
+#define CHECK_CONST(C) \
+ CHECK_UNSUF_TYPE(C); \
+ CHECK_SUFu_TYPE(C##u); \
+ CHECK_SUFu_TYPE(C##U); \
+ CHECK_SUFl_TYPE(C##l); \
+ CHECK_SUFl_TYPE(C##L); \
+ CHECK_SUFul_TYPE(C##ul); \
+ CHECK_SUFul_TYPE(C##uL); \
+ CHECK_SUFul_TYPE(C##Ul); \
+ CHECK_SUFul_TYPE(C##UL); \
+ CHECK_SUFll_TYPE(C##ll); \
+ CHECK_SUFll_TYPE(C##LL); \
+ CHECK_SUFull_TYPE(C##ull); \
+ CHECK_SUFull_TYPE(C##uLL); \
+ CHECK_SUFull_TYPE(C##Ull); \
+ CHECK_SUFull_TYPE(C##ULL);
+
+#define CHECK_BIN_CONST(C) \
+ CHECK_CONST(0b##C); \
+ CHECK_CONST(0B##C);
+
+/* True iff "long long" is at least B bits. This presumes that (B-2)/3 is at
+ most 63. */
+#define LLONG_AT_LEAST(B) \
+ (LLONG_MAX >> ((B)-2)/3 >> ((B)-2)/3 \
+ >> ((B)-2 - ((B)-2)/3 - ((B)-2)/3))
+
+#define LLONG_HAS_BITS(B) (LLONG_AT_LEAST((B)) && !LLONG_AT_LEAST((B) + 1))
+
+#define FOO 0b1101
+#if !FOO
+# error "preprocessor does not accept binary constants"
+#endif
+
+void
+foo (void)
+{
+ /* Check all 2^n and 2^n - 1 up to 2^72 - 1. */
+ CHECK_BIN_CONST(1);
+ CHECK_BIN_CONST(10);
+ CHECK_BIN_CONST(11);
+ CHECK_BIN_CONST(100);
+ CHECK_BIN_CONST(111);
+ CHECK_BIN_CONST(1000);
+ CHECK_BIN_CONST(1111);
+ CHECK_BIN_CONST(10000);
+ CHECK_BIN_CONST(11111);
+ CHECK_BIN_CONST(100000);
+ CHECK_BIN_CONST(111111);
+ CHECK_BIN_CONST(1000000);
+ CHECK_BIN_CONST(1111111);
+ CHECK_BIN_CONST(10000000);
+ CHECK_BIN_CONST(11111111);
+ CHECK_BIN_CONST(100000000);
+ CHECK_BIN_CONST(111111111);
+ CHECK_BIN_CONST(1000000000);
+ CHECK_BIN_CONST(1111111111);
+ CHECK_BIN_CONST(10000000000);
+ CHECK_BIN_CONST(11111111111);
+ CHECK_BIN_CONST(100000000000);
+ CHECK_BIN_CONST(111111111111);
+ CHECK_BIN_CONST(1000000000000);
+ CHECK_BIN_CONST(1111111111111);
+ CHECK_BIN_CONST(10000000000000);
+ CHECK_BIN_CONST(11111111111111);
+ CHECK_BIN_CONST(100000000000000);
+ CHECK_BIN_CONST(111111111111111);
+ CHECK_BIN_CONST(1000000000000000);
+ CHECK_BIN_CONST(1111111111111111);
+ CHECK_BIN_CONST(10000000000000000);
+ CHECK_BIN_CONST(11111111111111111);
+ CHECK_BIN_CONST(100000000000000000);
+ CHECK_BIN_CONST(111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111111111111111111);
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111111111111111111111);
+#if LLONG_AT_LEAST(65)
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111111111111111111111);
+#endif
+#if LLONG_AT_LEAST(66)
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111111111111111111111);
+#endif
+#if LLONG_AT_LEAST(67)
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111111111111111111111111);
+#endif
+#if LLONG_AT_LEAST(68)
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111111111111111111111111);
+#endif
+#if LLONG_AT_LEAST(69)
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111111111111111111111111);
+#endif
+#if LLONG_AT_LEAST(70)
+ CHECK_BIN_CONST(1000000000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(1111111111111111111111111111111111111111111111111111111111111111111111);
+#endif
+#if LLONG_AT_LEAST(71)
+ CHECK_BIN_CONST(10000000000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(11111111111111111111111111111111111111111111111111111111111111111111111);
+#endif
+#if LLONG_AT_LEAST(72)
+ CHECK_BIN_CONST(100000000000000000000000000000000000000000000000000000000000000000000000);
+ CHECK_BIN_CONST(111111111111111111111111111111111111111111111111111111111111111111111111);
+#endif
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-2.c
new file mode 100644
index 000000000..6c3928aa2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-2.c
@@ -0,0 +1,16 @@
+/* Test for binary integer constants: -pedantic warnings. */
+
+/* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -ftrack-macro-expansion=0" } */
+
+#define FOO 0b1101
+
+int
+foo (void)
+{
+#if FOO /* { dg-warning "binary constants are a GCC extension" } */
+ return 23;
+#endif
+ return 0b1101; /* { dg-warning "binary constants are a GCC extension" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-3.c
new file mode 100644
index 000000000..410fc4cd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-3.c
@@ -0,0 +1,16 @@
+/* Test for binary integer constants: -pedantic-errors. */
+
+/* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors -ftrack-macro-expansion=0" } */
+
+#define FOO 0b1101
+
+int
+foo (void)
+{
+#if FOO /* { dg-error "binary constants are a GCC extension" } */
+ return 23;
+#endif
+ return 0b1101; /* { dg-error "binary constants are a GCC extension" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-4.c
new file mode 100644
index 000000000..32c9d65a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binary-constants-4.c
@@ -0,0 +1,18 @@
+/* Test for binary integer constants: random errors. */
+
+/* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void
+foo(void)
+{
+ double d;
+ int i;
+
+ d = 0b1101;
+ d = 0b1101p1; /* { dg-error "invalid suffix \"p1\" on integer constant" } */
+ d = 0x1101p1;
+ i = 0b3011; /* { dg-error "invalid suffix \"b3011\" on integer constant" } */
+ i = 0b113; /* { dg-error "invalid digit \"3\" in binary constant" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand1.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand1.c
new file mode 100644
index 000000000..cadf7e532
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b)
+{
+ return (a & !a) | (b & !b);
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand1a.c
new file mode 100644
index 000000000..2d8202a0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand1a.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (char a, unsigned short b)
+{
+ return (a & !a) | (b & !b);
+}
+
+/* As long as comparisons aren't boolified and casts from boolean-types
+ aren't preserved, the folding of X & !X to zero fails. */
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand2.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand2.c
new file mode 100644
index 000000000..0076d4be7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a)
+{
+ return (!a & 1) != (a == 0);
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand2a.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand2a.c
new file mode 100644
index 000000000..0076d4be7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand2a.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a)
+{
+ return (!a & 1) != (a == 0);
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand3.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand3.c
new file mode 100644
index 000000000..5f8e32ff8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a)
+{
+ return (!a & 1) != ((a == 0) & 1);
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand3a.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand3a.c
new file mode 100644
index 000000000..40e8038a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand3a.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (short a)
+{
+ return (!a & 1) != ((a == 0) & 1);
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand4.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand4.c
new file mode 100644
index 000000000..1c3fefd61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand4.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b)
+{
+ return (!a & a) | (b & !b);
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand4a.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand4a.c
new file mode 100644
index 000000000..1178cf788
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand4a.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (unsigned char a, _Bool b)
+{
+ return (!a & a) | (b & !b);
+}
+
+/* As long as comparisons aren't boolified and casts from boolean-types
+ aren't preserved, the folding of X & !X to zero fails. */
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand5.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand5.c
new file mode 100644
index 000000000..463f19b04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand5.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b)
+{
+ return (a & (a == 0)) | (b & !b);
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand5a.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand5a.c
new file mode 100644
index 000000000..289abcb6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand5a.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (long a, unsigned long b)
+{
+ return (a & (a == 0)) | (b & !b);
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand6.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand6.c
new file mode 100644
index 000000000..e1882aca6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand6.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b)
+{
+ return (a & !a) | (b & (b == 0));
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand6a.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand6a.c
new file mode 100644
index 000000000..b9fe4052d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notand6a.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (unsigned long a, long b)
+{
+ return (a & !a) | (b & (b == 0));
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notor1.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notor1.c
new file mode 100644
index 000000000..a2cb6a327
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notor1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (_Bool a, _Bool b)
+{
+ return (a | !a) | (!b | b);
+}
+
+/* { dg-final { scan-tree-dump-times "return 1" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notor2.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notor2.c
new file mode 100644
index 000000000..ab8d70e4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notor2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (_Bool a, _Bool b)
+{
+ return (a | (a == 0)) | ((b ^ 1) | b);
+}
+
+/* { dg-final { scan-tree-dump-times "return 1" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notxor1.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notxor1.c
new file mode 100644
index 000000000..39c258dcd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notxor1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (_Bool a, _Bool b)
+{
+ return (a ^ !a) | (!b ^ b);
+}
+
+/* { dg-final { scan-tree-dump-times "return 1" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-notxor2.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notxor2.c
new file mode 100644
index 000000000..9f34cf284
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-notxor2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (_Bool a, _Bool b)
+{
+ return (a ^ (a == 0)) | ((b == 0) ^ b);
+}
+
+/* { dg-final { scan-tree-dump-times "return 1" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor1.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor1.c
new file mode 100644
index 000000000..c6a19cf01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b, int c)
+{
+ return ((a && !b && c) || (!a && b && c));
+}
+
+/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" { xfail logical_op_short_circuit } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor2.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor2.c
new file mode 100644
index 000000000..51b41dd7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b)
+{
+ return ((a & ~b) | (~a & b));
+}
+
+/* We expect to see "<bb N>"; confirm that, so that we know to count
+ it in the real test. */
+/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor3.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor3.c
new file mode 100644
index 000000000..4c2694a77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b)
+{
+ return ((a && !b) || (!a && b));
+}
+
+/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor4.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor4.c
new file mode 100644
index 000000000..f87950a33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor4.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b, int c)
+{
+ return ((a & ~b) | (~a & b)) & c;
+}
+
+/* We expect to see "<bb N>"; confirm that, so that we know to count
+ it in the real test. */
+/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor5.c b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor5.c
new file mode 100644
index 000000000..256c4bfa8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/binop-xor5.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b, int c)
+{
+ return ((a & ~b & c) | (~a & b & c));
+}
+
+/* We expect to see "<bb N>"; confirm that, so that we know to count
+ it in the real test. */
+/* { dg-final { scan-tree-dump-times "<bb\[^>\]*>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\\^" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\&" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-1.c
new file mode 100644
index 000000000..fa835f229
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-1.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+
+ Tests various diagnostics about a bit-field's type and width.
+
+ Source: Neil Booth, 26 Jan 2002.
+*/
+
+/* { dg-options -pedantic } */
+
+enum foo {e1 = 0, e2, e3, e4, e5};
+
+int x;
+typedef unsigned int ui;
+
+struct bf1
+{
+ unsigned int a: 3.5; /* { dg-error "integer constant" } */
+ unsigned int b: x; /* { dg-error "integer constant" } */
+ unsigned int c: -1; /* { dg-error "negative width" } */
+ unsigned int d: 0; /* { dg-error "zero width" } */
+ unsigned int : 0; /* { dg-bogus "zero width" } */
+ unsigned int : 5;
+ double e: 1; /* { dg-error "invalid type" } */
+ float f: 1; /* { dg-error "invalid type" } */
+ unsigned long g: 5; /* { dg-warning "GCC extension|ISO C" } */
+ ui h: 5;
+ enum foo i: 2; /* { dg-warning "narrower" } */
+ /* { dg-warning "GCC extension|ISO C" "extension" { target *-*-* } 27 } */
+ enum foo j: 3; /* { dg-warning "GCC extension|ISO C" } */
+ unsigned int k: 256; /* { dg-error "exceeds its type" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-10.c
new file mode 100644
index 000000000..ce7223149
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-10.c
@@ -0,0 +1,8 @@
+/* Test for rejection of sizeof on bit-fields. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct { int a : 1; } x;
+
+int r = sizeof (x.a); /* { dg-error "'sizeof' applied to a bit-field" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-11.c
new file mode 100644
index 000000000..c7fe6a510
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-11.c
@@ -0,0 +1,8 @@
+/* Test for rejection of __alignof on bit-fields. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct { int a : 1; } x;
+
+int r = __alignof (x.a); /* { dg-error "'__alignof' applied to a bit-field" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-12.c
new file mode 100644
index 000000000..1270d9b34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-12.c
@@ -0,0 +1,12 @@
+/* Test for rejection of taking address of bit-fields. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#include <stddef.h>
+
+struct s { int a : 1; } x, *y;
+
+int a = offsetof (struct s, a); /* { dg-error "attempt to take address of bit-field structure member 'a'" } */
+void *b = &x.a; /* { dg-error "cannot take address of bit-field 'a'" } */
+void *c = &y->a; /* { dg-error "cannot take address of bit-field 'a'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-13.c
new file mode 100644
index 000000000..fcb381c86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-13.c
@@ -0,0 +1,14 @@
+/* Test invalid bit-field types: bug 18498. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int
+main(void)
+{
+ struct X {
+ int s[20] : 1; /* { dg-error "bit-field 's' has invalid type" } */
+ int *p : 2; /* { dg-error "bit-field 'p' has invalid type" } */
+ int (*f)(float) : 3; /* { dg-error "bit-field 'f' has invalid type" } */
+ } x;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-14.c
new file mode 100644
index 000000000..de1971cd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-14.c
@@ -0,0 +1,11 @@
+/* Test for non-integer bit-field widths. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+enum e { E, F };
+struct s {
+ int a : (void *)4; /* { dg-error "bit-field 'a' width not an integer constant" } */
+ int b : (enum e)F;
+ int c : (_Bool)1;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-15.c
new file mode 100644
index 000000000..32878d74d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-15.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* Remove pedantic. Allow the GCC extension to use char for bitfields. */
+/* { dg-options "" } */
+/* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
+
+struct t
+{
+ char a:4;
+ char b:8;
+ char c:4;
+} __attribute__ ((packed)); /* { dg-message "note: offset of packed bit-field 'b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */
+
+int assrt[sizeof (struct t) == 2 ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-16.c
new file mode 100644
index 000000000..75d290f00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-16.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-packed-bitfield-compat" } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
+
+struct t
+{
+ char a:4;
+ char b:8;
+ char c:4;
+} __attribute__ ((packed));
+
+int assrt[sizeof (struct t) == 2 ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-17.c
new file mode 100644
index 000000000..6dc6989df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-17.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-options "-mno-ms-bitfields -Wno-packed-bitfield-compat" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
+
+struct t
+{
+ char a:4;
+ char b:8 __attribute__ ((packed));
+ char c:4;
+}; /* { dg-message "note: offset of packed bit-field 'b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */
+
+int assrt[sizeof (struct t) == 2 ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-18.c
new file mode 100644
index 000000000..748669543
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-18.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-packed-bitfield-compat" } */
+/* { dg-options "-Wno-packed-bitfield-compat -mno-ms-bitfields" { target { i?86-*-mingw* x86_64-*-mingw* } } } */
+
+struct t
+{
+ char a:4;
+ char b:8 __attribute__ ((packed));
+ char c:4;
+};
+
+int assrt[sizeof (struct t) == 2 ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-19.c
new file mode 100644
index 000000000..072e93c2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-19.c
@@ -0,0 +1,11 @@
+/* Test for bit-field widths not integer constant expressions but
+ folding to integer constants: PR 42439. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+f (void)
+{
+ const int m = 1;
+ ((void)(sizeof(struct { int i:!!m; })));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-2.c
new file mode 100644
index 000000000..b61fec608
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-2.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+
+ Tests we warn about overly-large assignments to bitfields.
+
+ Source: Neil Booth, 28 Jan 2002.
+*/
+
+struct bf
+{
+ unsigned int a: 2;
+ int b: 2;
+};
+
+struct bf p = {4, 0}; /* { dg-warning "truncated" "" } */
+struct bf q = {0, 2}; /* { dg-warning "overflow" "" } */
+struct bf r = {3, -2}; /* { dg-bogus "(truncated|overflow)" } */
+
+void foo ()
+{
+ p.a = 4, p.b = 0; /* { dg-warning "truncated" "" } */
+ q.a = 0, q.b = 2; /* { dg-warning "overflow" "" } */
+ r.a = 3, r.b = -2; /* { dg-bogus "(truncated|overflow)" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-20.c
new file mode 100644
index 000000000..63aaa5c8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-20.c
@@ -0,0 +1,11 @@
+/* Test for bit-field widths not integer constant expressions but
+ folding to integer constants: PR 42439. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -pedantic" } */
+
+void
+f (void)
+{
+ const int m = 1;
+ ((void)(sizeof(struct { int i:!!m; }))); /* { dg-warning "not an integer constant expression" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-21.c
new file mode 100644
index 000000000..66f9330f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-21.c
@@ -0,0 +1,11 @@
+/* Test for bit-field widths not integer constant expressions but
+ folding to integer constants: PR 42439. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -pedantic-errors" } */
+
+void
+f (void)
+{
+ const int m = 1;
+ ((void)(sizeof(struct { int i:!!m; }))); /* { dg-error "not an integer constant expression" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-3.c
new file mode 100644
index 000000000..5207bedb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-3.c
@@ -0,0 +1,67 @@
+/* Test for bitfield alignment in structs and unions. */
+/* { dg-do run { target pcc_bitfield_type_matters } } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+typedef long la __attribute__((aligned (8)));
+
+struct A
+{
+ char a;
+ union UA
+ {
+ char x;
+ la y : 6;
+ } b;
+ char c;
+} a;
+
+struct B
+{
+ char a;
+ union UB
+ {
+ char x;
+ long y : 6 __attribute__((aligned (8)));
+ } b;
+ char c;
+} b;
+
+struct C
+{
+ char a;
+ struct UC
+ {
+ la y : 6;
+ } b;
+ char c;
+} c;
+
+struct D
+{
+ char a;
+ struct UD
+ {
+ long y : 6 __attribute__((aligned (8)));
+ } b;
+ char c;
+} d;
+
+int main (void)
+{
+ if (sizeof (a) != sizeof (b))
+ abort ();
+ if (sizeof (a) != sizeof (c))
+ abort ();
+ if (sizeof (a) != sizeof (d))
+ abort ();
+ if ((&a.c - &a.a) != (&b.c - &b.a))
+ abort ();
+ if ((&a.c - &a.a) != (&c.c - &c.a))
+ abort ();
+ if ((&a.c - &a.a) != (&d.c - &d.a))
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-4.c
new file mode 100644
index 000000000..e642bec5a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-4.c
@@ -0,0 +1,42 @@
+/* { dg-do run { target { pcc_bitfield_type_matters || default_packed } } } */
+/* { dg-options "" } */
+
+/* Check bitfields and non-bitfields are aligned & sized similarly.
+
+ Copyright (C) 2002 Free Software Foundation Inc
+ Contributed by Nathan Sidwell <nathan@codesourcery.com>
+*/
+
+#include <limits.h>
+#include <stdio.h>
+
+static int fail;
+
+#define CHECK1(N, T) do { \
+ typedef struct Field_##N { char c; T f; } Field_##N; \
+ typedef struct BitField_##N { char c; T f : sizeof (T) * CHAR_BIT; } BitField_##N; \
+ if (sizeof (Field_##N) != sizeof (BitField_##N)) { \
+ fail = 1; printf ("sizeof %s failed\n", #T); \
+ } \
+ if (__alignof__ (Field_##N) != __alignof__ (BitField_##N)) { \
+ fail = 1; printf ("__alignof__ %s failed\n", #T); \
+ } \
+} while (0)
+
+#define CHECK(N, T) do { \
+ CHECK1(N, T); \
+ CHECK1 (s##N, signed T); \
+ CHECK1 (u##N, unsigned T); \
+} while (0)
+
+int main ()
+{
+
+ CHECK (c, char);
+ CHECK (s, short);
+ CHECK (i, int);
+ CHECK (l, long);
+ CHECK (ll, long long);
+
+ return fail;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-5.c
new file mode 100644
index 000000000..835bbce32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-5.c
@@ -0,0 +1,12 @@
+/* { dg-options "" } */
+#include <limits.h>
+
+struct s
+{
+ int i1 : sizeof (int) * CHAR_BIT;
+ int i2 : sizeof (int) * CHAR_BIT;
+ int i3 : sizeof (int) * CHAR_BIT;
+ int i4 : sizeof (int) * CHAR_BIT;
+};
+
+int f[sizeof (struct s) != sizeof (int) * 4 ? -1 : 1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-6.c
new file mode 100644
index 000000000..a9a7f4099
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-6.c
@@ -0,0 +1,16 @@
+/* { dg-options "" } */
+#include <limits.h>
+
+struct s
+{
+ int i1 : sizeof (int) * CHAR_BIT;
+ int i2 : sizeof (int) * CHAR_BIT;
+ int i3 : sizeof (int) * CHAR_BIT;
+ int i4 : sizeof (int) * CHAR_BIT;
+ int i5 : sizeof (int) * CHAR_BIT;
+ int i6 : sizeof (int) * CHAR_BIT;
+ int i7 : sizeof (int) * CHAR_BIT;
+ int i8 : sizeof (int) * CHAR_BIT;
+};
+
+int f[sizeof (struct s) != sizeof (int) * 8 ? -1 : 1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-7.c
new file mode 100644
index 000000000..fdaa93f26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-7.c
@@ -0,0 +1,8 @@
+/* Test for rejection of typeof on bit-fields. PR c/10333. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-fshow-column" } */
+
+struct { int a:1; } x;
+
+typeof (x.a) z; /* { dg-error "9:applied to a bit-field" "typeof" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-8.c
new file mode 100644
index 000000000..937fb64f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-8.c
@@ -0,0 +1,7 @@
+/* Test that too wide bit-fields are hard errors. PR c/3347. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk>, from PR c/3347 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct { int i : 1999; } x; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "width" "bit-field too wide" { target *-*-* } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-9.c
new file mode 100644
index 000000000..d6ae0ac31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/bitfld-9.c
@@ -0,0 +1,119 @@
+/* Test -funsigned-bitfields works. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do run } */
+/* { dg-options "-funsigned-bitfields -fsigned-char" } */
+
+typedef char c;
+typedef signed char sc;
+typedef unsigned char uc;
+typedef short s;
+typedef signed short ss;
+typedef unsigned short us;
+typedef n;
+typedef int i;
+typedef signed int si;
+typedef unsigned int ui;
+typedef long l;
+typedef signed long sl;
+typedef unsigned long ul;
+typedef long long ll;
+typedef signed long long sll;
+typedef unsigned long long ull;
+
+typedef c ct;
+typedef sc sct;
+typedef uc uct;
+typedef s st;
+typedef ss sst;
+typedef us ust;
+typedef n nt;
+typedef i it;
+typedef si sit;
+typedef ui uit;
+typedef l lt;
+typedef sl slt;
+typedef ul ult;
+typedef ll llt;
+typedef sll sllt;
+typedef ull ullt;
+
+struct foo {
+ char char0 : 1;
+ c char1 : 1;
+ ct char2 : 1;
+ signed char schar0 : 1;
+ sc schar1 : 1;
+ sct schar2 : 1;
+ unsigned char uchar0 : 1;
+ uc uchar1 : 1;
+ uct uchar2 : 1;
+ short short0 : 1;
+ s short1 : 1;
+ st short2 : 1;
+ signed short sshort0 : 1;
+ ss sshort1 : 1;
+ sst sshort2 : 1;
+ unsigned short ushort0 : 1;
+ us ushort1 : 1;
+ ust ushort2 : 1;
+ __attribute__((dummy)) int0 : 1; /* { dg-warning "attribute directive ignored" } */
+ n int1 : 1;
+ nt int2 : 1;
+ int int3 : 1;
+ i int4 : 1;
+ it int5 : 1;
+ signed int sint0 : 1;
+ si sint1 : 1;
+ sit sint2 : 1;
+ unsigned int uint0 : 1;
+ ui uint1 : 1;
+ uit uint2 : 1;
+ long long0 : 1;
+ l long1 : 1;
+ lt long2 : 1;
+ signed long slong0 : 1;
+ sl slong1 : 1;
+ slt slong2 : 1;
+ unsigned long ulong0 : 1;
+ ul ulong1 : 1;
+ ult ulong2 : 1;
+ long long llong0 : 1;
+ ll llong1 : 1;
+ llt llong2 : 1;
+ signed long long sllong0 : 1;
+ sll sllong1 : 1;
+ sllt sllong2 : 1;
+ unsigned long long ullong0 : 1;
+ ull ullong1 : 1;
+ ullt ullong2 : 1;
+};
+
+struct foo x;
+
+extern void abort (void);
+extern void exit (int);
+extern void *memset (void *, int, __SIZE_TYPE__);
+
+int
+main (void)
+{
+ memset (&x, (unsigned char)-1, sizeof(x));
+ if (x.char0 != 1 || x.char1 != 1 || x.char2 != 1
+ || x.schar0 != -1 || x.schar1 != -1 || x.schar2 != -1
+ || x.uchar0 != 1 || x.uchar1 != 1 || x.uchar2 != 1
+ || x.short0 != 1 || x.short1 != 1 || x.short2 != 1
+ || x.sshort0 != -1 || x.sshort1 != -1 || x.sshort2 != -1
+ || x.ushort0 != 1 || x.ushort1 != 1 || x.ushort2 != 1
+ || x.int0 != 1 || x.int1 != 1 || x.int2 != 1
+ || x.int3 != 1 || x.int4 != 1 || x.int5 != 1
+ || x.sint0 != -1 || x.sint1 != -1 || x.sint2 != -1
+ || x.uint0 != 1 || x.uint1 != 1 || x.uint2 != 1
+ || x.long0 != 1 || x.long1 != 1 || x.long2 != 1
+ || x.slong0 != -1 || x.slong1 != -1 || x.slong2 != -1
+ || x.ulong0 != 1 || x.ulong1 != 1 || x.ulong2 != 1
+ || x.llong0 != 1 || x.llong1 != 1 || x.llong2 != 1
+ || x.sllong0 != -1 || x.sllong1 != -1 || x.sllong2 != -1
+ || x.ullong0 != 1 || x.ullong1 != 1 || x.ullong2 != 1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/boolcomplex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/boolcomplex-1.c
new file mode 100644
index 000000000..c34da04d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/boolcomplex-1.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+_Bool b = --0i == 0; /* { dg-error "lvalue required as decrement operand" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply1.c
new file mode 100644
index 000000000..38b384e7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply1.c
@@ -0,0 +1,9 @@
+/* PR 11184 */
+/* Origin: Dara Hazeghi <dhazeghi@yahoo.com> */
+
+void *
+objc_msg_sendv (char * arg_frame, void (*foo)())
+{
+ return __builtin_apply ( foo, arg_frame, 4);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply2.c
new file mode 100644
index 000000000..3ae2adc6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "aarch64*-*-* avr-*-* nds32*-*-*" } { "*" } { "" } } */
+/* { dg-skip-if "Variadic funcs use Base AAPCS. Normal funcs use VFP variant." { arm*-*-* && arm_hf_eabi } { "*" } { "" } } */
+
+/* PR target/12503 */
+/* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */
+
+/* Verify that __builtin_apply behaves correctly on targets
+ with pre-pushed arguments (e.g. SPARC). */
+
+
+
+#define INTEGER_ARG 5
+
+#if defined(__ARM_PCS) || defined(__epiphany__)
+/* For Base AAPCS, NAME is passed in r0. D is passed in r2 and r3.
+ E, F and G are passed on stack. So the size of the stack argument
+ data is 20. */
+#define STACK_ARGUMENTS_SIZE 20
+#elif defined __MMIX__ || defined __arc__
+/* No parameters on stack for bar. */
+#define STACK_ARGUMENTS_SIZE 0
+#else
+#define STACK_ARGUMENTS_SIZE 64
+#endif
+
+extern void abort(void);
+
+void foo(char *name, double d, double e, double f, int g)
+{
+ if (g != INTEGER_ARG)
+ abort();
+}
+
+void bar(char *name, ...)
+{
+ __builtin_apply(foo, __builtin_apply_args(), STACK_ARGUMENTS_SIZE);
+}
+
+int main(void)
+{
+ bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply3.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply3.c
new file mode 100644
index 000000000..1335d0902
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply3.c
@@ -0,0 +1,31 @@
+/* PR middle-end/12210 */
+/* Origin: Ossadchy Yury A. <waspcoder@mail.ru> */
+
+/* This used to fail on i686 because the argument was not copied
+ to the right location by __builtin_apply after the direct call. */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+void foo(int arg)
+{
+ if (arg != INTEGER_ARG)
+ abort();
+}
+
+void bar(int arg)
+{
+ foo(arg);
+ __builtin_apply(foo, __builtin_apply_args(), 16);
+}
+
+int main(void)
+{
+ bar(INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply4.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply4.c
new file mode 100644
index 000000000..530da7115
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-apply4.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/20076 */
+/* { dg-options "-O2 -Wmissing-noreturn" } */
+/* { dg-options "-O2 -mno-mmx" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-do run } */
+
+extern void abort (void);
+
+double
+foo (int arg)
+{
+ if (arg != 116)
+ abort();
+ return arg + 1;
+}
+
+inline double
+bar (int arg)
+{
+ foo (arg);
+ __builtin_return (__builtin_apply ((void (*) ()) foo,
+ __builtin_apply_args (), 16));
+}
+
+int
+main (int argc, char **argv)
+{
+ if (bar (116) != 117.0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-assume-aligned-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-assume-aligned-1.c
new file mode 100644
index 000000000..46b65a768
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-assume-aligned-1.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+void
+test1 (double *out1, double *out2, double *out3, double *in1,
+ double *in2, int len)
+{
+ int i;
+ double *__restrict o1 = __builtin_assume_aligned (out1, 16);
+ double *__restrict o2 = __builtin_assume_aligned (out2, 16);
+ double *__restrict o3 = __builtin_assume_aligned (out3, 16);
+ double *__restrict i1 = __builtin_assume_aligned (in1, 16);
+ double *__restrict i2 = __builtin_assume_aligned (in2, 16);
+ for (i = 0; i < len; ++i)
+ {
+ o1[i] = i1[i] * i2[i];
+ o2[i] = i1[i] + i2[i];
+ o3[i] = i1[i] - i2[i];
+ }
+}
+
+void
+test2 (double *out1, double *out2, double *out3, double *in1,
+ double *in2, int len)
+{
+ int i, align = 32, misalign = 16;
+ out1 = __builtin_assume_aligned (out1, align, misalign);
+ out2 = __builtin_assume_aligned (out2, align, 16);
+ out3 = __builtin_assume_aligned (out3, 32, misalign);
+ in1 = __builtin_assume_aligned (in1, 32, 16);
+ in2 = __builtin_assume_aligned (in2, 32, 0);
+ for (i = 0; i < len; ++i)
+ {
+ out1[i] = in1[i] * in2[i];
+ out2[i] = in1[i] + in2[i];
+ out3[i] = in1[i] - in2[i];
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "__builtin_assume_aligned" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-assume-aligned-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-assume-aligned-2.c
new file mode 100644
index 000000000..5b0de5720
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-assume-aligned-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+double *bar (void);
+
+void
+foo (double *ptr, int i)
+{
+ double *a = __builtin_assume_aligned (ptr, 16, 8, 7); /* { dg-error "too many arguments to function" } */
+ double *b = __builtin_assume_aligned (bar (), 16);
+ double *c = __builtin_assume_aligned (bar (), 16, 8);
+ double *d = __builtin_assume_aligned (ptr, i, ptr); /* { dg-error "non-integer argument 3 in call to function" } */
+ double *e = __builtin_assume_aligned (ptr, i, *ptr); /* { dg-error "non-integer argument 3 in call to function" } */
+ *a = 0.0;
+ *b = 0.0;
+ *c = 0.0;
+ *d = 0.0;
+ *e = 0.0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-1.c
new file mode 100644
index 000000000..724ba1e98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "" } */
+/* { dg-final { scan-assembler-not "__builtin_" } } */
+
+#include <stdint.h>
+
+uint16_t foo16 (uint16_t a)
+{
+ uint16_t b;
+
+ b = __builtin_bswap16 (a);
+
+ return b;
+}
+
+uint32_t foo32 (uint32_t a)
+{
+ uint32_t b;
+
+ b = __builtin_bswap32 (a);
+
+ return b;
+}
+
+uint64_t foo64 (uint64_t a)
+{
+ uint64_t b;
+
+ b = __builtin_bswap64 (a);
+
+ return b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c
new file mode 100644
index 000000000..745fed9d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-2.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "" } */
+#include <stdint.h>
+
+extern void abort (void);
+
+int main (void)
+{
+ uint32_t a = 4;
+ uint32_t b;
+
+ b = __builtin_bswap32 (a);
+ a = __builtin_bswap32 (b);
+
+ if (b == 4 || a != 4)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-3.c
new file mode 100644
index 000000000..031817e78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-3.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "" } */
+#include <stdint.h>
+
+extern void abort (void);
+
+int main (void)
+{
+ uint32_t a = 0x80000000;
+ uint32_t b;
+
+ b = __builtin_bswap32 (a);
+ a = __builtin_bswap32 (b);
+
+ if (b != 0x80 || a != 0x80000000)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-4.c
new file mode 100644
index 000000000..da8ee68cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-4.c
@@ -0,0 +1,75 @@
+/* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-Wall" } */
+
+#include <stdint.h>
+
+#define MAKE_FUN(suffix, type) \
+ type my_bswap##suffix(type x) { \
+ type result = 0; \
+ int shift; \
+ for (shift = 0; shift < 8 * sizeof (type); shift += 8) \
+ { \
+ result <<= 8; \
+ result |= (x >> shift) & 0xff; \
+ } \
+ return result; \
+ } \
+
+MAKE_FUN(16, uint16_t);
+MAKE_FUN(32, uint32_t);
+MAKE_FUN(64, uint64_t);
+
+extern void abort (void);
+
+#define NUMS16 \
+ { \
+ 0x0000, \
+ 0x1122, \
+ 0xffff, \
+ }
+
+#define NUMS32 \
+ { \
+ 0x00000000UL, \
+ 0x11223344UL, \
+ 0xffffffffUL, \
+ }
+
+#define NUMS64 \
+ { \
+ 0x0000000000000000ULL, \
+ 0x1122334455667788ULL, \
+ 0xffffffffffffffffULL, \
+ }
+
+uint16_t uint16_ts[] =
+ NUMS16;
+
+uint32_t uint32_ts[] =
+ NUMS32;
+
+uint64_t uint64_ts[] =
+ NUMS64;
+
+#define N(table) (sizeof (table) / sizeof (table[0]))
+
+int
+main (void)
+{
+ int i;
+
+ for (i = 0; i < N(uint16_ts); i++)
+ if (__builtin_bswap16 (uint16_ts[i]) != my_bswap16 (uint16_ts[i]))
+ abort ();
+
+ for (i = 0; i < N(uint32_ts); i++)
+ if (__builtin_bswap32 (uint32_ts[i]) != my_bswap32 (uint32_ts[i]))
+ abort ();
+
+ for (i = 0; i < N(uint64_ts); i++)
+ if (__builtin_bswap64 (uint64_ts[i]) != my_bswap64 (uint64_ts[i]))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-5.c
new file mode 100644
index 000000000..b29931e4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-5.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+int
+main (void)
+{
+ /* Test constant folding. */
+ extern void link_error (void);
+
+ if (__builtin_bswap16(0xaabb) != 0xbbaa)
+ link_error ();
+
+ if (__builtin_bswap32(0xaabbccdd) != 0xddccbbaa)
+ link_error ();
+
+ if (__builtin_bswap64(0x1122334455667788ULL) != 0x8877665544332211ULL)
+ link_error ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-6.c
new file mode 100644
index 000000000..024ebf1ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-6.c
@@ -0,0 +1,39 @@
+/* { dg-do compile { target arm*-*-* alpha*-*-* i?86-*-* powerpc*-*-* rs6000-*-* x86_64-*-* s390*-*-* } } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-O -fdump-rtl-combine" } */
+/* { dg-options "-O -fdump-rtl-combine -march=z900" { target s390-*-* } } */
+
+#include <stdint.h>
+
+#define BS(X) __builtin_bswap32(X)
+
+int foo1 (uint32_t a)
+{
+ if (BS (a) == 0xA0000)
+ return 1;
+ return 0;
+}
+
+int foo2 (uint32_t a)
+{
+ if (BS (a) != 0xA0000)
+ return 1;
+ return 0;
+}
+
+int foo3 (uint32_t a, uint32_t b)
+{
+ if (BS (a) == BS (b))
+ return 1;
+ return 0;
+}
+
+int foo4 (uint32_t a, uint32_t b)
+{
+ if (BS (a) != BS (b))
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-not "bswapsi" "combine" } } */
+/* { dg-final { cleanup-rtl-dump "combine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-7.c
new file mode 100644
index 000000000..399b825ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-7.c
@@ -0,0 +1,39 @@
+/* { dg-do compile { target arm*-*-* alpha*-*-* ia64*-*-* x86_64-*-* s390x-*-* powerpc*-*-* rs6000-*-* } } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O -fdump-rtl-combine" } */
+
+#include <stdint.h>
+
+#define BS(X) __builtin_bswap64(X)
+
+int foo1 (uint64_t a)
+{
+ if (BS (a) == 0xA00000000)
+ return 1;
+ return 0;
+}
+
+int foo2 (uint64_t a)
+{
+ if (BS (a) != 0xA00000000)
+ return 1;
+ return 0;
+}
+
+int foo3 (uint64_t a, uint64_t b)
+{
+ if (BS (a) == BS (b))
+ return 1;
+ return 0;
+}
+
+int foo4 (uint64_t a, uint64_t b)
+{
+ if (BS (a) != BS (b))
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-not "bswapdi" "combine" } } */
+/* { dg-final { cleanup-rtl-dump "combine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-8.c
new file mode 100644
index 000000000..38c00a314
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-8.c
@@ -0,0 +1,46 @@
+/* { dg-do compile { target arm*-*-* alpha*-*-* i?86-*-* powerpc*-*-* rs6000-*-* x86_64-*-* s390*-*-* } } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-O2 -fdump-rtl-combine" } */
+/* { dg-options "-O2 -fdump-rtl-combine -march=z900" { target s390-*-* } } */
+
+#include <stdint.h>
+
+#define BS(X) __builtin_bswap32(X)
+
+uint32_t foo1 (uint32_t a)
+{
+ return BS (~ BS (a));
+}
+
+uint32_t foo2 (uint32_t a)
+{
+ return BS (BS (a) & 0xA0000);
+}
+
+uint32_t foo3 (uint32_t a)
+{
+ return BS (BS (a) | 0xA0000);
+}
+
+uint32_t foo4 (uint32_t a)
+{
+ return BS (BS (a) ^ 0xA0000);
+}
+
+uint32_t foo5 (uint32_t a, uint32_t b)
+{
+ return BS (BS (a) & BS (b));
+}
+
+uint32_t foo6 (uint32_t a, uint32_t b)
+{
+ return BS (BS (a) | BS (b));
+}
+
+uint32_t foo7 (uint32_t a, uint32_t b)
+{
+ return BS (BS (a) ^ BS (b));
+}
+
+/* { dg-final { scan-rtl-dump-not "bswapsi" "combine" } } */
+/* { dg-final { cleanup-rtl-dump "combine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-9.c
new file mode 100644
index 000000000..4aa1a40c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-bswap-9.c
@@ -0,0 +1,46 @@
+/* { dg-do compile { target arm*-*-* alpha*-*-* ia64*-*-* x86_64-*-* s390x-*-* powerpc*-*-* rs6000-*-* } } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -fdump-rtl-combine" } */
+
+#include <stdint.h>
+
+#define BS(X) __builtin_bswap64(X)
+
+uint64_t foo1 (uint64_t a)
+{
+ return BS (~ BS (a));
+}
+
+uint64_t foo2 (uint64_t a)
+{
+ return BS (BS (a) & 0xA00000000);
+}
+
+uint64_t foo3 (uint64_t a)
+{
+ return BS (BS (a) | 0xA00000000);
+}
+
+uint64_t foo4 (uint64_t a)
+{
+ return BS (BS (a) ^ 0xA00000000);
+}
+
+uint64_t foo5 (uint64_t a, uint64_t b)
+{
+ return BS (BS (a) & BS (b));
+}
+
+uint64_t foo6 (uint64_t a, uint64_t b)
+{
+ return BS (BS (a) | BS (b));
+}
+
+uint64_t foo7 (uint64_t a, uint64_t b)
+{
+ return BS (BS (a) ^ BS (b));
+}
+
+/* { dg-final { scan-rtl-dump-not "bswapdi" "combine" } } */
+/* { dg-final { cleanup-rtl-dump "combine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-choose-expr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-choose-expr-2.c
new file mode 100644
index 000000000..d986b405f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-choose-expr-2.c
@@ -0,0 +1,12 @@
+/* Test diagnostic for invalid use of __builtin_choose_expr. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int a, b, c, d;
+
+void
+f (void)
+{
+ a = __builtin_choose_expr (b, c, d); /* { dg-error "first argument to '__builtin_choose_expr' not a constant" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-choose-expr.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-choose-expr.c
new file mode 100644
index 000000000..ceac6051f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-choose-expr.c
@@ -0,0 +1,90 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -Wall" } */
+
+#define choose __builtin_choose_expr
+
+/* Check the type of __builtin_choose_expr between E1 and E2, both
+ ways round and with both 0 and 1 as the condition. */
+#define ASSERT_COND_TYPE(E1, E2) \
+ do { \
+ typedef __typeof(E1) T1; \
+ typedef __typeof(E2) T2; \
+ typedef T1 **T1pp; \
+ typedef T2 **T2pp; \
+ typedef __typeof(choose (1, (E1), (E2))) T1a; \
+ typedef __typeof(choose (0, (E2), (E1))) T1b; \
+ typedef __typeof(choose (1, (E2), (E1))) T2a; \
+ typedef __typeof(choose (0, (E1), (E2))) T2b; \
+ typedef T1a **T1app; \
+ typedef T1b **T1bpp; \
+ typedef T2a **T2app; \
+ typedef T2b **T2bpp; \
+ T1pp t1 = 0; \
+ T2pp t2 = 0; \
+ T1app t1a = 0; \
+ T1bpp t1b = 0; \
+ T2app t2a = 0; \
+ T2bpp t2b = 0; \
+ t1 = t1a; \
+ t1 = t1b; \
+ t2 = t2a; \
+ t2 = t2b; \
+ (void) t1; \
+ (void) t2; \
+ } while (0)
+
+
+extern void abort ();
+extern void exit ();
+
+void bad ()
+{
+ abort ();
+}
+
+void good ()
+{
+ exit (0);
+}
+
+int main (void)
+{
+ signed char sc1, sc2;
+ void *v1;
+ int i, j;
+ double dd;
+ float f;
+ typedef void (*fpt)(void);
+ fpt triple;
+ struct S { int x, y; } pour, some, sugar;
+ union u { int p; } united, nations;
+
+ if (__builtin_choose_expr (0, 12, 0)
+ || !__builtin_choose_expr (45, 5, 0)
+ || !__builtin_choose_expr (45, 3, 0))
+ abort ();
+
+ ASSERT_COND_TYPE (sc1, sc2);
+ ASSERT_COND_TYPE (v1, sc1);
+ ASSERT_COND_TYPE (i, j);
+ ASSERT_COND_TYPE (dd, main);
+ ASSERT_COND_TYPE ((float)dd, i);
+ ASSERT_COND_TYPE (4, f);
+ ASSERT_COND_TYPE (triple, some);
+ ASSERT_COND_TYPE (united, nations);
+ ASSERT_COND_TYPE (nations, main);
+
+ pour.y = 69;
+ __builtin_choose_expr (0, bad (), sugar) = pour;
+ if (sugar.y != 69)
+ abort ();
+
+ __builtin_choose_expr (sizeof (int), f, bad ()) = 3.5F;
+
+ if (f != 3.5F)
+ abort ();
+
+ __builtin_choose_expr (1, good, bad)();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-complex-err-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-complex-err-1.c
new file mode 100644
index 000000000..ddc72b583
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-complex-err-1.c
@@ -0,0 +1,26 @@
+/* Test __builtin_complex errors. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+typedef double D;
+
+double d;
+
+_Complex double dc = __builtin_complex (1.0, (D) 0.0);
+
+_Complex double dc2 = __builtin_complex (d, 0.0); /* { dg-error "not constant" } */
+
+_Complex float fc = __builtin_complex (1.0f, 1); /* { dg-error "not of real binary floating-point type" } */
+
+_Complex float fc2 = __builtin_complex (1, 1.0f); /* { dg-error "not of real binary floating-point type" } */
+
+_Complex float fc3 = __builtin_complex (1.0f, 1.0); /* { dg-error "different types" } */
+
+void
+f (void)
+{
+ __builtin_complex (0.0); /* { dg-error "wrong number of arguments" } */
+ __builtin_complex (0.0, 0.0, 0.0); /* { dg-error "wrong number of arguments" } */
+}
+
+void (*p) (void) = __builtin_complex; /* { dg-error "cannot take address" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-complex-err-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-complex-err-2.c
new file mode 100644
index 000000000..be5ff65fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-complex-err-2.c
@@ -0,0 +1,10 @@
+/* Test __builtin_complex errors. Verify it does not allow quiet
+ creation of complex types in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=c90 -pedantic-errors" } */
+
+void
+f (void)
+{
+ __builtin_complex (0.0, 0.0); /* { dg-error "ISO C90 does not support complex types" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-constant_p-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-constant_p-1.c
new file mode 100644
index 000000000..b0b34f4a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-constant_p-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+int main()
+{
+ if (__builtin_constant_p ()) /* { dg-error "not enough" } */
+ return 0;
+ if (__builtin_constant_p (5, 6)) /* { dg-error "too many" } */
+ return 1;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-ffs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-ffs-1.c
new file mode 100644
index 000000000..2bf0e9873
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-ffs-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern int ffs (int) __asm ("__GI_ffs") __attribute__ ((nothrow, const));
+
+int
+ffsll (long long int i)
+{
+ unsigned long long int x = i & -i;
+
+ if (x <= 0xffffffff)
+ return ffs (i);
+ else
+ return 32 + ffs (i >> 32);
+}
+
+/* { dg-final { scan-assembler-not "\nffs\n|\nffs\[^a-zA-Z0-9_\]|\[^a-zA-Z0-9_\]ffs\n" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-inf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-inf-1.c
new file mode 100644
index 000000000..d96a5b6b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-inf-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+float fi = __builtin_inff();
+double di = __builtin_inf();
+long double li = __builtin_infl();
+
+float fh = __builtin_huge_valf();
+double dh = __builtin_huge_val();
+long double lh = __builtin_huge_vall();
+
+/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* spu-*-* } 3 } */
+/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } 4 } */
+/* { dg-error "does not support infinity" "INF unsupported" { target vax-*-* } 5 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-1.c
new file mode 100644
index 000000000..13ebeb15b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-1.c
@@ -0,0 +1,440 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void *malloc (size_t);
+extern void *calloc (size_t, size_t);
+extern void *alloca (size_t);
+extern void *memcpy (void *, const void *, size_t);
+extern void *memset (void *, int, size_t);
+extern char *strcpy (char *, const char *);
+
+struct A
+{
+ char a[10];
+ int b;
+ char c[10];
+} y, w[4];
+
+extern char exta[];
+extern char extb[30];
+extern struct A zerol[0];
+
+void
+__attribute__ ((noinline))
+test1 (void *q, int x)
+{
+ struct A a;
+ void *p = &a.a[3], *r;
+ char var[x + 10];
+ if (x < 0)
+ r = &a.a[9];
+ else
+ r = &a.c[1];
+ if (__builtin_object_size (p, 0)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 3)
+ abort ();
+ if (__builtin_object_size (&a.c[9], 0)
+ != sizeof (a) - __builtin_offsetof (struct A, c) - 9)
+ abort ();
+ if (__builtin_object_size (q, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (r, 0)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 9)
+ abort ();
+ if (x < 6)
+ r = &w[2].a[1];
+ else
+ r = &a.a[6];
+ if (__builtin_object_size (&y, 0)
+ != sizeof (y))
+ abort ();
+ if (__builtin_object_size (w, 0)
+ != sizeof (w))
+ abort ();
+ if (__builtin_object_size (&y.b, 0)
+ != sizeof (a) - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (r, 0)
+ != 2 * sizeof (w[0]) - __builtin_offsetof (struct A, a) - 1)
+ abort ();
+ if (x < 20)
+ r = malloc (30);
+ else
+ r = calloc (2, 16);
+ /* We may duplicate this test onto the two exit paths. On one path
+ the size will be 32, the other it will be 30. If we don't duplicate
+ this test, then the size will be 32. */
+ if (__builtin_object_size (r, 0) != 2 * 16
+ && __builtin_object_size (r, 0) != 30)
+ abort ();
+ if (x < 20)
+ r = malloc (30);
+ else
+ r = calloc (2, 14);
+ if (__builtin_object_size (r, 0) != 30)
+ abort ();
+ if (x < 30)
+ r = malloc (sizeof (a));
+ else
+ r = &a.a[3];
+ if (__builtin_object_size (r, 0) != sizeof (a))
+ abort ();
+ r = memcpy (r, "a", 2);
+ if (__builtin_object_size (r, 0) != sizeof (a))
+ abort ();
+ r = memcpy (r + 2, "b", 2) + 2;
+ if (__builtin_object_size (r, 0) != sizeof (a) - 4)
+ abort ();
+ r = &a.a[4];
+ r = memset (r, 'a', 2);
+ if (__builtin_object_size (r, 0)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 4)
+ abort ();
+ r = memset (r + 2, 'b', 2) + 2;
+ if (__builtin_object_size (r, 0)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 8)
+ abort ();
+ r = &a.a[1];
+ r = strcpy (r, "ab");
+ if (__builtin_object_size (r, 0)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 1)
+ abort ();
+ r = strcpy (r + 2, "cd") + 2;
+ if (__builtin_object_size (r, 0)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 5)
+ abort ();
+ if (__builtin_object_size (exta, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (exta + 10, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&exta[5], 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (extb, 0) != sizeof (extb))
+ abort ();
+ if (__builtin_object_size (extb + 10, 0) != sizeof (extb) - 10)
+ abort ();
+ if (__builtin_object_size (&extb[5], 0) != sizeof (extb) - 5)
+ abort ();
+ if (__builtin_object_size (var, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (var + 10, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&var[5], 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (zerol, 0) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol, 0) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0], 0) != 0)
+ abort ();
+ if (__builtin_object_size (zerol[0].a, 0) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0].a[0], 0) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0].b, 0) != 0)
+ abort ();
+ if (__builtin_object_size ("abcdefg", 0) != sizeof ("abcdefg"))
+ abort ();
+ if (__builtin_object_size ("abcd\0efg", 0) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg", 0) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg"[0], 0) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg"[4], 0) != sizeof ("abcd\0efg") - 4)
+ abort ();
+ if (__builtin_object_size ("abcd\0efg" + 5, 0) != sizeof ("abcd\0efg") - 5)
+ abort ();
+ if (__builtin_object_size (L"abcdefg", 0) != sizeof (L"abcdefg"))
+ abort ();
+ r = (char *) L"abcd\0efg";
+ if (__builtin_object_size (r + 2, 0) != sizeof (L"abcd\0efg") - 2)
+ abort ();
+}
+
+size_t l1 = 1;
+
+void
+__attribute__ ((noinline))
+test2 (void)
+{
+ struct B { char buf1[10]; char buf2[10]; } a;
+ char *r, buf3[20];
+ int i;
+
+ if (sizeof (a) != 20)
+ return;
+
+ r = buf3;
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[1];
+ else if (i == l1)
+ r = &a.buf2[7];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[9];
+ }
+ if (__builtin_object_size (r, 0) != 20)
+ abort ();
+ r = &buf3[20];
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[7];
+ else if (i == l1)
+ r = &a.buf2[7];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[9];
+ }
+ if (__builtin_object_size (r, 0) != 15)
+ abort ();
+ r += 8;
+ if (__builtin_object_size (r, 0) != 7)
+ abort ();
+ if (__builtin_object_size (r + 6, 0) != 1)
+ abort ();
+ r = &buf3[18];
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[9];
+ else if (i == l1)
+ r = &a.buf2[9];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[4];
+ }
+ if (__builtin_object_size (r + 12, 0) != 4)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test3 (void)
+{
+ char buf4[10];
+ struct B { struct A a[2]; struct A b; char c[4]; char d; double e;
+ _Complex double f; } x;
+ double y;
+ _Complex double z;
+ double *dp;
+
+ if (__builtin_object_size (buf4, 0) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4, 0) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4[0], 0) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4[1], 0) != sizeof (buf4) - 1)
+ abort ();
+ if (__builtin_object_size (&x, 0) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a, 0) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a[0], 0) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a, 0) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a[0], 0) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a[3], 0) != sizeof (x) - 3)
+ abort ();
+ if (__builtin_object_size (&x.a[0].b, 0)
+ != sizeof (x) - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c, 0)
+ != sizeof (x) - sizeof (struct A) - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c[0], 0)
+ != sizeof (x) - sizeof (struct A) - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c[3], 0)
+ != sizeof (x) - sizeof (struct A) - __builtin_offsetof (struct A, c) - 3)
+ abort ();
+ if (__builtin_object_size (&x.b, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, b))
+ abort ();
+ if (__builtin_object_size (&x.b.a, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, b))
+ abort ();
+ if (__builtin_object_size (&x.b.a[0], 0)
+ != sizeof (x) - __builtin_offsetof (struct B, b))
+ abort ();
+ if (__builtin_object_size (&x.b.a[3], 0)
+ != sizeof (x) - __builtin_offsetof (struct B, b) - 3)
+ abort ();
+ if (__builtin_object_size (&x.b.b, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, b)
+ - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (&x.b.c, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, b)
+ - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&x.b.c[0], 0)
+ != sizeof (x) - __builtin_offsetof (struct B, b)
+ - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&x.b.c[3], 0)
+ != sizeof (x) - __builtin_offsetof (struct B, b)
+ - __builtin_offsetof (struct A, c) - 3)
+ abort ();
+ if (__builtin_object_size (&x.c, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, c))
+ abort ();
+ if (__builtin_object_size (&x.c[0], 0)
+ != sizeof (x) - __builtin_offsetof (struct B, c))
+ abort ();
+ if (__builtin_object_size (&x.c[1], 0)
+ != sizeof (x) - __builtin_offsetof (struct B, c) - 1)
+ abort ();
+ if (__builtin_object_size (&x.d, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, d))
+ abort ();
+ if (__builtin_object_size (&x.e, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, e))
+ abort ();
+ if (__builtin_object_size (&x.f, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, f))
+ abort ();
+ dp = &__real__ x.f;
+ if (__builtin_object_size (dp, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, f))
+ abort ();
+ dp = &__imag__ x.f;
+ if (__builtin_object_size (dp, 0)
+ != sizeof (x) - __builtin_offsetof (struct B, f)
+ - sizeof (x.f) / 2)
+ abort ();
+ dp = &y;
+ if (__builtin_object_size (dp, 0) != sizeof (y))
+ abort ();
+ if (__builtin_object_size (&z, 0) != sizeof (z))
+ abort ();
+ dp = &__real__ z;
+ if (__builtin_object_size (dp, 0) != sizeof (z))
+ abort ();
+ dp = &__imag__ z;
+ if (__builtin_object_size (dp, 0) != sizeof (z) / 2)
+ abort ();
+}
+
+struct S { unsigned int a; };
+
+char *
+__attribute__ ((noinline))
+test4 (char *x, int y)
+{
+ register int i;
+ struct A *p;
+
+ for (i = 0; i < y; i++)
+ {
+ p = (struct A *) x;
+ x = (char *) &p[1];
+ if (__builtin_object_size (p, 0) != (size_t) -1)
+ abort ();
+ }
+ return x;
+}
+
+void
+__attribute__ ((noinline))
+test5 (size_t x)
+{
+ char buf[64];
+ char *p = &buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ /* My understanding of ISO C99 6.5.6 is that a conforming
+ program will not end up with p equal to &buf[0]
+ through &buf[7], i.e. calling this function with say
+ UINTPTR_MAX / 4 results in undefined behaviour.
+ If that's true, then the maximum number of remaining
+ bytes from p until end of the object is 56, otherwise
+ it would be 64 (or conservative (size_t) -1 == unknown). */
+ if (__builtin_object_size (p, 0) != sizeof (buf) - 8)
+ abort ();
+ memset (p, ' ', sizeof (buf) - 8 - 4 * 4);
+}
+
+void
+__attribute__ ((noinline))
+test6 (size_t x)
+{
+ struct T { char buf[64]; char buf2[64]; } t;
+ char *p = &t.buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 0) != sizeof (t) - 8)
+ abort ();
+ memset (p, ' ', sizeof (t) - 8 - 4 * 4);
+}
+
+void
+__attribute__ ((noinline))
+test7 (void)
+{
+ char buf[64];
+ struct T { char buf[64]; char buf2[64]; } t;
+ char *p = &buf[64], *q = &t.buf[64];
+
+ if (__builtin_object_size (p + 64, 0) != 0)
+ abort ();
+ if (__builtin_object_size (q + 63, 0) != sizeof (t) - 64 - 63)
+ abort ();
+ if (__builtin_object_size (q + 64, 0) != sizeof (t) - 64 - 64)
+ abort ();
+ if (__builtin_object_size (q + 256, 0) != 0)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test8 (void)
+{
+ struct T { char buf[10]; char buf2[10]; } t;
+ char *p = &t.buf2[-4];
+ char *q = &t.buf2[0];
+ if (__builtin_object_size (p, 0) != sizeof (t) - 10 + 4)
+ abort ();
+ if (__builtin_object_size (q, 0) != sizeof (t) - 10)
+ abort ();
+ /* GCC only handles additions, not subtractions. */
+ q = q - 8;
+ if (__builtin_object_size (q, 0) != (size_t) -1
+ && __builtin_object_size (q, 0) != sizeof (t) - 10 + 8)
+ abort ();
+ p = &t.buf[-4];
+ if (__builtin_object_size (p, 0) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct S s[10];
+ __asm ("" : "=r" (l1) : "0" (l1));
+ test1 (main, 6);
+ test2 ();
+ test3 ();
+ test4 ((char *) s, 10);
+ test5 (4);
+ test6 (4);
+ test7 ();
+ test8 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-10.c
new file mode 100644
index 000000000..956d4a860
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-10.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-objsz1-details" } */
+// { dg-skip-if "packed attribute missing for drone_source_packet" { "epiphany-*-*" } { "*" } { "" } }
+
+typedef struct {
+ char sentinel[4];
+ char data[0];
+} drone_packet;
+typedef struct {
+ char type_str[16];
+ char channel_hop;
+} drone_source_packet;
+drone_packet *
+foo(char *x)
+{
+ drone_packet *dpkt = __builtin_malloc(sizeof(drone_packet)
+ + sizeof(drone_source_packet));
+ drone_source_packet *spkt = (drone_source_packet *) dpkt->data;
+ __builtin___snprintf_chk (spkt->type_str, 16,
+ 1, __builtin_object_size (spkt->type_str, 1),
+ "%s", x);
+ return dpkt;
+}
+
+/* { dg-final { scan-tree-dump "maximum object size 21" "objsz1" } } */
+/* { dg-final { scan-tree-dump "maximum subobject size 16" "objsz1" } } */
+/* { dg-final { cleanup-tree-dump "objsz1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-11.c
new file mode 100644
index 000000000..309a68416
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-11.c
@@ -0,0 +1,22 @@
+/* PR48985 */
+/* { dg-do run } */
+/* { dg-options "-std=gnu89" } */
+/* { dg-skip-if "packed attribute missing for struct s" { "epiphany-*-*" } { "*" } { "" } } */
+
+extern void abort (void);
+
+struct s {
+ int i;
+ char c[];
+} s = { 1, "01234" };
+
+__SIZE_TYPE__ f (void) { return __builtin_object_size (&s.c, 0); }
+
+int
+main()
+{
+ if (f() != sizeof ("01234"))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-12.c
new file mode 100644
index 000000000..b21eb0071
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-12.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+struct S {
+ int len;
+ char s[0];
+};
+int main()
+{
+ char buf[sizeof (struct S) + 32];
+ if (__builtin_object_size (((struct S *)&buf[0])->s, 1) != 32)
+ abort ();
+ if (__builtin_object_size (((struct S *)&buf[1])->s, 1) != 31)
+ abort ();
+ if (__builtin_object_size (((struct S *)&buf[64])->s, 0) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-13.c
new file mode 100644
index 000000000..80a6280e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-13.c
@@ -0,0 +1,351 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+extern void free (void *);
+extern void abort (void);
+
+union A
+{
+ int a1;
+ char a2[3];
+};
+
+union B
+{
+ long long b1;
+ union A b2;
+};
+
+struct C
+{
+ int c1;
+ union A c2;
+};
+
+struct D
+{
+ int d1;
+ union B d2;
+};
+
+union E
+{
+ struct C e1;
+ char e2[3];
+};
+
+union F
+{
+ int f1;
+ struct D f2;
+};
+
+struct G
+{
+ union A g1;
+ char g2;
+};
+
+struct H
+{
+ int h1;
+ union E h2;
+};
+
+#define T(X, S0, S1) \
+ if (__builtin_object_size (X, 0) != (S0)) \
+ abort (); \
+ if (__builtin_object_size (X, 1) != (S1)) \
+ abort (); \
+ if (__builtin_object_size (X, 2) != (S0)) \
+ abort (); \
+ if (__builtin_object_size (X, 3) != (S1)) \
+ abort ()
+#define TS(X, S0) T(&X, S0, sizeof (X))
+#define TA(X, S0, S1) \
+ T(X, S0, S1); T(&X[0], S0, S1); T(&X[1], (S0) - 1, (S1) - 1)
+#define TF(X, S0) TA(X, S0, S0)
+
+int
+main (void)
+{
+ size_t s, o, o2;
+
+ s = sizeof (union A);
+ o = 0;
+ union A *a1 = malloc (s);
+ union A *a2 = malloc (o + 212);
+ TS (a1->a1, s);
+ s = o + 212;
+ TS (a2->a1, s);
+ free (a2);
+ free (a1);
+ s = sizeof (union A);
+ o = 0;
+ a1 = malloc (s);
+ a2 = malloc (o + 212);
+ TF (a1->a2, s);
+ s = o + 212;
+ TF (a2->a2, s);
+ free (a2);
+ free (a1);
+
+ s = sizeof (union B);
+ o = 0;
+ union B *b1 = malloc (s);
+ union B *b2 = malloc (o + 212);
+ TS (b1->b1, s);
+ s = o + 212;
+ TS (b2->b1, s);
+ free (b2);
+ free (b1);
+ s = sizeof (union B);
+ o = 0;
+ b1 = malloc (s);
+ b2 = malloc (o + 212);
+ TS (b1->b2.a1, s);
+ s = o + 212;
+ TS (b2->b2.a1, s);
+ free (b2);
+ free (b1);
+ s = sizeof (union B);
+ o = 0;
+ b1 = malloc (s);
+ b2 = malloc (o + 212);
+ TF (b1->b2.a2, s);
+ s = o + 212;
+ TF (b2->b2.a2, s);
+ free (b2);
+ free (b1);
+
+ s = sizeof (struct C);
+ o = __builtin_offsetof (struct C, c2);
+ struct C *c1 = malloc (s);
+ struct C *c2 = malloc (o + 212);
+ TS (c1->c1, s);
+ s = o + 212;
+ TS (c2->c1, s);
+ free (c2);
+ free (c1);
+ s = sizeof (struct C);
+ o = __builtin_offsetof (struct C, c2);
+ c1 = malloc (s);
+ c2 = malloc (o + 212);
+ TS (c1->c2.a1, s - o);
+ s = o + 212;
+ TS (c2->c2.a1, s - o);
+ free (c2);
+ free (c1);
+ s = sizeof (struct C);
+ o = __builtin_offsetof (struct C, c2);
+ c1 = malloc (s);
+ c2 = malloc (o + 212);
+ TF (c1->c2.a2, s - o);
+ s = o + 212;
+ TF (c2->c2.a2, s - o);
+ free (c2);
+ free (c1);
+
+ s = sizeof (struct D);
+ o = __builtin_offsetof (struct D, d2);
+ struct D *d1 = malloc (s);
+ struct D *d2 = malloc (o + 212);
+ TS (d1->d1, s);
+ s = o + 212;
+ TS (d2->d1, s);
+ free (d2);
+ free (d1);
+ s = sizeof (struct D);
+ o = __builtin_offsetof (struct D, d2);
+ d1 = malloc (s);
+ d2 = malloc (o + 212);
+ TS (d1->d2.b1, s - o);
+ s = o + 212;
+ TS (d2->d2.b1, s - o);
+ free (d2);
+ free (d1);
+ s = sizeof (struct D);
+ o = __builtin_offsetof (struct D, d2);
+ d1 = malloc (s);
+ d2 = malloc (o + 212);
+ TS (d1->d2.b2.a1, s - o);
+ s = o + 212;
+ TS (d2->d2.b2.a1, s - o);
+ free (d2);
+ free (d1);
+ s = sizeof (struct D);
+ o = __builtin_offsetof (struct D, d2);
+ d1 = malloc (s);
+ d2 = malloc (o + 212);
+ TF (d1->d2.b2.a2, s - o);
+ s = o + 212;
+ TF (d2->d2.b2.a2, s - o);
+ free (d2);
+ free (d1);
+
+ s = sizeof (union E);
+ o = __builtin_offsetof (union E, e1.c2);
+ union E *e1 = malloc (s);
+ union E *e2 = malloc (o + 212);
+ TS (e1->e1.c1, s);
+ s = o + 212;
+ TS (e2->e1.c1, s);
+ free (e2);
+ free (e1);
+ s = sizeof (union E);
+ o = __builtin_offsetof (union E, e1.c2);
+ e1 = malloc (s);
+ e2 = malloc (o + 212);
+ TS (e1->e1.c2.a1, s - o);
+ s = o + 212;
+ TS (e2->e1.c2.a1, s - o);
+ free (e2);
+ free (e1);
+ s = sizeof (union E);
+ o = __builtin_offsetof (union E, e1.c2);
+ e1 = malloc (s);
+ e2 = malloc (o + 212);
+ TF (e1->e1.c2.a2, s - o);
+ s = o + 212;
+ TF (e2->e1.c2.a2, s - o);
+ free (e2);
+ free (e1);
+ s = sizeof (union E);
+ o = __builtin_offsetof (union E, e1.c2);
+ e1 = malloc (s);
+ e2 = malloc (o + 212);
+ TF (e1->e2, s);
+ s = o + 212;
+ TF (e2->e2, s);
+ free (e2);
+ free (e1);
+
+ s = sizeof (union F);
+ o = __builtin_offsetof (union F, f2.d2);
+ union F *f1 = malloc (s);
+ union F *f2 = malloc (o + 212);
+ TS (f1->f1, s);
+ s = o + 212;
+ TS (f2->f1, s);
+ free (f2);
+ free (f1);
+ s = sizeof (union F);
+ o = __builtin_offsetof (union F, f2.d2);
+ f1 = malloc (s);
+ f2 = malloc (o + 212);
+ TS (f1->f2.d1, s);
+ s = o + 212;
+ TS (f2->f2.d1, s);
+ free (f2);
+ free (f1);
+ s = sizeof (union F);
+ o = __builtin_offsetof (union F, f2.d2);
+ f1 = malloc (s);
+ f2 = malloc (o + 212);
+ TS (f1->f2.d2.b1, s - o);
+ s = o + 212;
+ TS (f2->f2.d2.b1, s - o);
+ free (f2);
+ free (f1);
+ s = sizeof (union F);
+ o = __builtin_offsetof (union F, f2.d2);
+ f1 = malloc (s);
+ f2 = malloc (o + 212);
+ TS (f1->f2.d2.b2.a1, s - o);
+ s = o + 212;
+ TS (f2->f2.d2.b2.a1, s - o);
+ free (f2);
+ free (f1);
+ s = sizeof (union F);
+ o = __builtin_offsetof (union F, f2.d2);
+ f1 = malloc (s);
+ f2 = malloc (o + 212);
+ TF (f1->f2.d2.b2.a2, s - o);
+ s = o + 212;
+ TF (f2->f2.d2.b2.a2, s - o);
+ free (f2);
+ free (f1);
+
+ s = sizeof (struct G);
+ o = __builtin_offsetof (struct G, g2);
+ struct G *g1 = malloc (s);
+ struct G *g2 = malloc (o + 212);
+ TS (g1->g1.a1, s);
+ s = o + 212;
+ TS (g2->g1.a1, s);
+ free (g2);
+ free (g1);
+ s = sizeof (struct G);
+ o = __builtin_offsetof (struct G, g2);
+ g1 = malloc (s);
+ g2 = malloc (o + 212);
+ TA (g1->g1.a2, s, sizeof (g1->g1.a2));
+ s = o + 212;
+ TA (g2->g1.a2, s, sizeof (g1->g1.a2));
+ free (g2);
+ free (g1);
+ s = sizeof (struct G);
+ o = __builtin_offsetof (struct G, g2);
+ g1 = malloc (s);
+ g2 = malloc (o + 212);
+ TS (g1->g2, s - o);
+ s = o + 212;
+ TS (g2->g2, s - o);
+ free (g2);
+ free (g1);
+
+ s = sizeof (struct H);
+ o = __builtin_offsetof (struct H, h2);
+ o2 = __builtin_offsetof (struct H, h2.e1.c2);
+ struct H *h1 = malloc (s);
+ struct H *h2 = malloc (o2 + 212);
+ TS (h1->h1, s);
+ s = o2 + 212;
+ TS (h2->h1, s);
+ free (h2);
+ free (h1);
+ s = sizeof (struct H);
+ o = __builtin_offsetof (struct H, h2);
+ o2 = __builtin_offsetof (struct H, h2.e1.c2);
+ h1 = malloc (s);
+ h2 = malloc (o2 + 212);
+ TS (h1->h2.e1.c1, s - o);
+ s = o2 + 212;
+ TS (h2->h2.e1.c1, s - o);
+ free (h2);
+ free (h1);
+ s = sizeof (struct H);
+ o = __builtin_offsetof (struct H, h2);
+ o2 = __builtin_offsetof (struct H, h2.e1.c2);
+ h1 = malloc (s);
+ h2 = malloc (o2 + 212);
+ TS (h1->h2.e1.c2.a1, s - o2);
+ s = o2 + 212;
+ TS (h2->h2.e1.c2.a1, s - o2);
+ free (h2);
+ free (h1);
+ s = sizeof (struct H);
+ o = __builtin_offsetof (struct H, h2);
+ o2 = __builtin_offsetof (struct H, h2.e1.c2);
+ h1 = malloc (s);
+ h2 = malloc (o2 + 212);
+ TA (h1->h2.e1.c2.a2, s - o2, sizeof (h1->h2.e1.c2.a2));
+ s = o2 + 212;
+ TA (h2->h2.e1.c2.a2, s - o2, sizeof (h2->h2.e1.c2.a2));
+ free (h2);
+ free (h1);
+ s = sizeof (struct H);
+ o = __builtin_offsetof (struct H, h2);
+ o2 = __builtin_offsetof (struct H, h2.e1.c2);
+ h1 = malloc (s);
+ h2 = malloc (o2 + 212);
+ TF (h1->h2.e2, s - o);
+ s = o2 + 212;
+ TF (h2->h2.e2, s - o);
+ free (h2);
+ free (h1);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-14.c
new file mode 100644
index 000000000..085011eda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-14.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern char *strncpy(char *, const char *, __SIZE_TYPE__);
+
+union u {
+ struct {
+ char vi[8];
+ char pi[16];
+ };
+ char all[8+16+4];
+};
+
+void __attribute__((noinline,noclone))
+f(union u *u)
+{
+ char vi[8+1];
+ __builtin_strncpy(vi, u->vi, sizeof(u->vi));
+ if (__builtin_object_size (u->all, 1) != -1)
+ abort ();
+}
+int main()
+{
+ union u u;
+ f (&u);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-2.c
new file mode 100644
index 000000000..21aff5a95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-2.c
@@ -0,0 +1,397 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void *malloc (size_t);
+extern void *calloc (size_t, size_t);
+extern void *alloca (size_t);
+extern void *memcpy (void *, const void *, size_t);
+extern void *memset (void *, int, size_t);
+extern char *strcpy (char *, const char *);
+
+struct A
+{
+ char a[10];
+ int b;
+ char c[10];
+} y, w[4];
+
+extern char exta[];
+extern char extb[30];
+extern struct A extc[];
+struct A zerol[0];
+
+void
+__attribute__ ((noinline))
+test1 (void *q, int x)
+{
+ struct A a;
+ void *p = &a.a[3], *r;
+ char var[x + 10];
+ struct A vara[x + 10];
+ if (x < 0)
+ r = &a.a[9];
+ else
+ r = &a.c[1];
+ if (__builtin_object_size (p, 1) != sizeof (a.a) - 3)
+ abort ();
+ if (__builtin_object_size (&a.c[9], 1)
+ != sizeof (a.c) - 9)
+ abort ();
+ if (__builtin_object_size (q, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (r, 1) != sizeof (a.c) - 1)
+ abort ();
+ if (x < 6)
+ r = &w[2].a[1];
+ else
+ r = &a.a[6];
+ if (__builtin_object_size (&y, 1) != sizeof (y))
+ abort ();
+ if (__builtin_object_size (w, 1) != sizeof (w))
+ abort ();
+ if (__builtin_object_size (&y.b, 1) != sizeof (a.b))
+ abort ();
+ if (__builtin_object_size (r, 1) != sizeof (a.a) - 1)
+ abort ();
+ if (x < 20)
+ r = malloc (30);
+ else
+ r = calloc (2, 16);
+ /* We may duplicate this test onto the two exit paths. On one path
+ the size will be 32, the other it will be 30. If we don't duplicate
+ this test, then the size will be 32. */
+ if (__builtin_object_size (r, 1) != 2 * 16
+ && __builtin_object_size (r, 1) != 30)
+ abort ();
+ if (x < 20)
+ r = malloc (30);
+ else
+ r = calloc (2, 14);
+ if (__builtin_object_size (r, 1) != 30)
+ abort ();
+ if (x < 30)
+ r = malloc (sizeof (a));
+ else
+ r = &a.a[3];
+ if (__builtin_object_size (r, 1) != sizeof (a))
+ abort ();
+ r = memcpy (r, "a", 2);
+ if (__builtin_object_size (r, 1) != sizeof (a))
+ abort ();
+ r = memcpy (r + 2, "b", 2) + 2;
+ if (__builtin_object_size (r, 1) != sizeof (a) - 4)
+ abort ();
+ r = &a.a[4];
+ r = memset (r, 'a', 2);
+ if (__builtin_object_size (r, 1) != sizeof (a.a) - 4)
+ abort ();
+ r = memset (r + 2, 'b', 2) + 2;
+ if (__builtin_object_size (r, 1) != sizeof (a.a) - 8)
+ abort ();
+ r = &a.a[1];
+ r = strcpy (r, "ab");
+ if (__builtin_object_size (r, 1) != sizeof (a.a) - 1)
+ abort ();
+ r = strcpy (r + 2, "cd") + 2;
+ if (__builtin_object_size (r, 1) != sizeof (a.a) - 5)
+ abort ();
+ if (__builtin_object_size (exta, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (exta + 10, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&exta[5], 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (extb, 1) != sizeof (extb))
+ abort ();
+ if (__builtin_object_size (extb + 10, 1) != sizeof (extb) - 10)
+ abort ();
+ if (__builtin_object_size (&extb[5], 1) != sizeof (extb) - 5)
+ abort ();
+ if (__builtin_object_size (extc, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (extc + 10, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&extc[5], 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&extc->a, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&(extc + 10)->b, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&extc[5].c[3], 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (var, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (var + 10, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&var[5], 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (vara, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (vara + 10, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&vara[5], 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&vara[0].a, 1) != sizeof (vara[0].a))
+ abort ();
+ if (__builtin_object_size (&vara[10].a[0], 1) != sizeof (vara[0].a))
+ abort ();
+ if (__builtin_object_size (&vara[5].a[4], 1) != sizeof (vara[0].a) - 4)
+ abort ();
+ if (__builtin_object_size (&vara[5].b, 1) != sizeof (vara[0].b))
+ abort ();
+ if (__builtin_object_size (&vara[7].c[7], 1) != sizeof (vara[0].c) - 7)
+ abort ();
+ if (__builtin_object_size (zerol, 1) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol, 1) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0], 1) != 0)
+ abort ();
+ if (__builtin_object_size (zerol[0].a, 1) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0].a[0], 1) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0].b, 1) != 0)
+ abort ();
+ if (__builtin_object_size ("abcdefg", 1) != sizeof ("abcdefg"))
+ abort ();
+ if (__builtin_object_size ("abcd\0efg", 1) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg", 1) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg"[0], 1) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg"[4], 1) != sizeof ("abcd\0efg") - 4)
+ abort ();
+ if (__builtin_object_size ("abcd\0efg" + 5, 1) != sizeof ("abcd\0efg") - 5)
+ abort ();
+ if (__builtin_object_size (L"abcdefg", 1) != sizeof (L"abcdefg"))
+ abort ();
+ r = (char *) L"abcd\0efg";
+ if (__builtin_object_size (r + 2, 1) != sizeof (L"abcd\0efg") - 2)
+ abort ();
+}
+
+size_t l1 = 1;
+
+void
+__attribute__ ((noinline))
+test2 (void)
+{
+ struct B { char buf1[10]; char buf2[10]; } a;
+ char *r, buf3[20];
+ int i;
+
+ if (sizeof (a) != 20)
+ return;
+
+ r = buf3;
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[1];
+ else if (i == l1)
+ r = &a.buf2[7];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[9];
+ }
+ if (__builtin_object_size (r, 1) != sizeof (buf3))
+ abort ();
+ r = &buf3[20];
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[7];
+ else if (i == l1)
+ r = &a.buf2[7];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[9];
+ }
+ if (__builtin_object_size (r, 1) != sizeof (buf3) - 5)
+ abort ();
+ r += 8;
+ if (__builtin_object_size (r, 1) != sizeof (buf3) - 13)
+ abort ();
+ if (__builtin_object_size (r + 6, 1) != sizeof (buf3) - 19)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test3 (void)
+{
+ char buf4[10];
+ struct B { struct A a[2]; struct A b; char c[4]; char d; double e;
+ _Complex double f; } x;
+ double y;
+ _Complex double z;
+ double *dp;
+
+ if (__builtin_object_size (buf4, 1) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4, 1) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4[0], 1) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4[1], 1) != sizeof (buf4) - 1)
+ abort ();
+ if (__builtin_object_size (&x, 1) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a, 1) != sizeof (x.a))
+ abort ();
+ if (__builtin_object_size (&x.a[0], 1) != sizeof (x.a))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a, 1) != sizeof (x.a[0].a))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a[0], 1) != sizeof (x.a[0].a))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a[3], 1) != sizeof (x.a[0].a) - 3)
+ abort ();
+ if (__builtin_object_size (&x.a[0].b, 1) != sizeof (x.a[0].b))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c, 1) != sizeof (x.a[1].c))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c[0], 1) != sizeof (x.a[1].c))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c[3], 1) != sizeof (x.a[1].c) - 3)
+ abort ();
+ if (__builtin_object_size (&x.b, 1) != sizeof (x.b))
+ abort ();
+ if (__builtin_object_size (&x.b.a, 1) != sizeof (x.b.a))
+ abort ();
+ if (__builtin_object_size (&x.b.a[0], 1) != sizeof (x.b.a))
+ abort ();
+ if (__builtin_object_size (&x.b.a[3], 1) != sizeof (x.b.a) - 3)
+ abort ();
+ if (__builtin_object_size (&x.b.b, 1) != sizeof (x.b.b))
+ abort ();
+ if (__builtin_object_size (&x.b.c, 1) != sizeof (x.b.c))
+ abort ();
+ if (__builtin_object_size (&x.b.c[0], 1) != sizeof (x.b.c))
+ abort ();
+ if (__builtin_object_size (&x.b.c[3], 1) != sizeof (x.b.c) - 3)
+ abort ();
+ if (__builtin_object_size (&x.c, 1) != sizeof (x.c))
+ abort ();
+ if (__builtin_object_size (&x.c[0], 1) != sizeof (x.c))
+ abort ();
+ if (__builtin_object_size (&x.c[1], 1) != sizeof (x.c) - 1)
+ abort ();
+ if (__builtin_object_size (&x.d, 1) != sizeof (x.d))
+ abort ();
+ if (__builtin_object_size (&x.e, 1) != sizeof (x.e))
+ abort ();
+ if (__builtin_object_size (&x.f, 1) != sizeof (x.f))
+ abort ();
+ dp = &__real__ x.f;
+ if (__builtin_object_size (dp, 1) != sizeof (x.f) / 2)
+ abort ();
+ dp = &__imag__ x.f;
+ if (__builtin_object_size (dp, 1) != sizeof (x.f) / 2)
+ abort ();
+ dp = &y;
+ if (__builtin_object_size (dp, 1) != sizeof (y))
+ abort ();
+ if (__builtin_object_size (&z, 1) != sizeof (z))
+ abort ();
+ dp = &__real__ z;
+ if (__builtin_object_size (dp, 1) != sizeof (z) / 2)
+ abort ();
+ dp = &__imag__ z;
+ if (__builtin_object_size (dp, 1) != sizeof (z) / 2)
+ abort ();
+}
+
+struct S { unsigned int a; };
+
+char *
+__attribute__ ((noinline))
+test4 (char *x, int y)
+{
+ register int i;
+ struct A *p;
+
+ for (i = 0; i < y; i++)
+ {
+ p = (struct A *) x;
+ x = (char *) &p[1];
+ if (__builtin_object_size (p, 1) != (size_t) -1)
+ abort ();
+ }
+ return x;
+}
+
+void
+__attribute__ ((noinline))
+test5 (size_t x)
+{
+ struct T { char buf[64]; char buf2[64]; } t;
+ char *p = &t.buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 1) != sizeof (t.buf) - 8)
+ abort ();
+ memset (p, ' ', sizeof (t.buf) - 8 - 4 * 4);
+}
+
+void
+__attribute__ ((noinline))
+test6 (void)
+{
+ char buf[64];
+ struct T { char buf[64]; char buf2[64]; } t;
+ char *p = &buf[64], *q = &t.buf[64];
+
+ if (__builtin_object_size (p + 64, 1) != 0)
+ abort ();
+ if (__builtin_object_size (q + 0, 1) != 0)
+ abort ();
+ if (__builtin_object_size (q + 64, 1) != 0)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test7 (void)
+{
+ struct T { char buf[10]; char buf2[10]; } t;
+ char *p = &t.buf2[-4];
+ char *q = &t.buf2[0];
+ if (__builtin_object_size (p, 1) != 0)
+ abort ();
+ if (__builtin_object_size (q, 1) != sizeof (t.buf2))
+ abort ();
+ q = &t.buf[10];
+ if (__builtin_object_size (q, 1) != 0)
+ abort ();
+ q = &t.buf[11];
+ if (__builtin_object_size (q, 1) != 0)
+ abort ();
+ p = &t.buf[-4];
+ if (__builtin_object_size (p, 1) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct S s[10];
+ __asm ("" : "=r" (l1) : "0" (l1));
+ test1 (main, 6);
+ test2 ();
+ test3 ();
+ test4 ((char *) s, 10);
+ test5 (4);
+ test6 ();
+ test7 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-3.c
new file mode 100644
index 000000000..572ecda04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-3.c
@@ -0,0 +1,446 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void *malloc (size_t);
+extern void *calloc (size_t, size_t);
+extern void *alloca (size_t);
+extern void *memcpy (void *, const void *, size_t);
+extern void *memset (void *, int, size_t);
+extern char *strcpy (char *, const char *);
+
+struct A
+{
+ char a[10];
+ int b;
+ char c[10];
+} y, w[4];
+
+extern char exta[];
+extern char extb[30];
+extern struct A zerol[0];
+
+void
+__attribute__ ((noinline))
+test1 (void *q, int x)
+{
+ struct A a;
+ void *p = &a.a[3], *r;
+ char var[x + 10];
+ if (x < 0)
+ r = &a.a[9];
+ else
+ r = &a.c[1];
+ if (__builtin_object_size (p, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 3)
+ abort ();
+ if (__builtin_object_size (&a.c[9], 2)
+ != sizeof (a) - __builtin_offsetof (struct A, c) - 9)
+ abort ();
+ if (__builtin_object_size (q, 2) != 0)
+ abort ();
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, c) - 1)
+ abort ();
+ if (x < 6)
+ r = &w[2].a[1];
+ else
+ r = &a.a[6];
+ if (__builtin_object_size (&y, 2)
+ != sizeof (y))
+ abort ();
+ if (__builtin_object_size (w, 2)
+ != sizeof (w))
+ abort ();
+ if (__builtin_object_size (&y.b, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 6)
+ abort ();
+ if (x < 20)
+ r = malloc (30);
+ else
+ r = calloc (2, 16);
+ if (__builtin_object_size (r, 2) != 30)
+ abort ();
+ if (x < 20)
+ r = malloc (30);
+ else
+ r = calloc (2, 14);
+ if (__builtin_object_size (r, 2) != 2 * 14)
+ abort ();
+ if (x < 30)
+ r = malloc (sizeof (a));
+ else
+ r = &a.a[3];
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 3)
+ abort ();
+ r = memcpy (r, "a", 2);
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 3)
+ abort ();
+ r = memcpy (r + 2, "b", 2) + 2;
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 3 - 4)
+ abort ();
+ r = &a.a[4];
+ r = memset (r, 'a', 2);
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 4)
+ abort ();
+ r = memset (r + 2, 'b', 2) + 2;
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 8)
+ abort ();
+ r = &a.a[1];
+ r = strcpy (r, "ab");
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 1)
+ abort ();
+ r = strcpy (r + 2, "cd") + 2;
+ if (__builtin_object_size (r, 2)
+ != sizeof (a) - __builtin_offsetof (struct A, a) - 5)
+ abort ();
+ if (__builtin_object_size (exta, 2) != 0)
+ abort ();
+ if (__builtin_object_size (exta + 10, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&exta[5], 2) != 0)
+ abort ();
+ if (__builtin_object_size (extb, 2) != sizeof (extb))
+ abort ();
+ if (__builtin_object_size (extb + 10, 2) != sizeof (extb) - 10)
+ abort ();
+ if (__builtin_object_size (&extb[5], 2) != sizeof (extb) - 5)
+ abort ();
+ if (__builtin_object_size (var, 2) != 0)
+ abort ();
+ if (__builtin_object_size (var + 10, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&var[5], 2) != 0)
+ abort ();
+ if (__builtin_object_size (zerol, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0], 2) != 0)
+ abort ();
+ if (__builtin_object_size (zerol[0].a, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0].a[0], 2) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0].b, 2) != 0)
+ abort ();
+ if (__builtin_object_size ("abcdefg", 2) != sizeof ("abcdefg"))
+ abort ();
+ if (__builtin_object_size ("abcd\0efg", 2) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg", 2) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg"[0], 2) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg"[4], 2) != sizeof ("abcd\0efg") - 4)
+ abort ();
+ if (__builtin_object_size ("abcd\0efg" + 5, 2) != sizeof ("abcd\0efg") - 5)
+ abort ();
+ if (__builtin_object_size (L"abcdefg", 2) != sizeof (L"abcdefg"))
+ abort ();
+ r = (char *) L"abcd\0efg";
+ if (__builtin_object_size (r + 2, 2) != sizeof (L"abcd\0efg") - 2)
+ abort ();
+}
+
+size_t l1 = 1;
+
+void
+__attribute__ ((noinline))
+test2 (void)
+{
+ struct B { char buf1[10]; char buf2[10]; } a;
+ char *r, buf3[20];
+ int i;
+
+ if (sizeof (a) != 20)
+ return;
+
+ r = buf3;
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[1];
+ else if (i == l1)
+ r = &a.buf2[7];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[9];
+ }
+ if (__builtin_object_size (r, 2) != 3)
+ abort ();
+ r = &buf3[20];
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[7];
+ else if (i == l1)
+ r = &a.buf2[7];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[9];
+ }
+ if (__builtin_object_size (r, 2) != 0)
+ abort ();
+ r = &buf3[2];
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[1];
+ else if (i == l1)
+ r = &a.buf1[2];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[4];
+ }
+ if (__builtin_object_size (r, 2) != 15)
+ abort ();
+ r += 8;
+ if (__builtin_object_size (r, 2) != 7)
+ abort ();
+ if (__builtin_object_size (r + 6, 2) != 1)
+ abort ();
+ r = &buf3[18];
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[9];
+ else if (i == l1)
+ r = &a.buf2[9];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[4];
+ }
+ if (__builtin_object_size (r + 12, 2) != 0)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test3 (void)
+{
+ char buf4[10];
+ struct B { struct A a[2]; struct A b; char c[4]; char d; double e;
+ _Complex double f; } x;
+ double y;
+ _Complex double z;
+ double *dp;
+
+ if (__builtin_object_size (buf4, 2) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4, 2) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4[0], 2) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4[1], 2) != sizeof (buf4) - 1)
+ abort ();
+ if (__builtin_object_size (&x, 2) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a, 2) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a[0], 2) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a, 2) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a[0], 2) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a[3], 2) != sizeof (x) - 3)
+ abort ();
+ if (__builtin_object_size (&x.a[0].b, 2)
+ != sizeof (x) - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c, 2)
+ != sizeof (x) - sizeof (struct A) - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c[0], 2)
+ != sizeof (x) - sizeof (struct A) - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c[3], 2)
+ != sizeof (x) - sizeof (struct A) - __builtin_offsetof (struct A, c) - 3)
+ abort ();
+ if (__builtin_object_size (&x.b, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, b))
+ abort ();
+ if (__builtin_object_size (&x.b.a, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, b))
+ abort ();
+ if (__builtin_object_size (&x.b.a[0], 2)
+ != sizeof (x) - __builtin_offsetof (struct B, b))
+ abort ();
+ if (__builtin_object_size (&x.b.a[3], 2)
+ != sizeof (x) - __builtin_offsetof (struct B, b) - 3)
+ abort ();
+ if (__builtin_object_size (&x.b.b, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, b)
+ - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (&x.b.c, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, b)
+ - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&x.b.c[0], 2)
+ != sizeof (x) - __builtin_offsetof (struct B, b)
+ - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&x.b.c[3], 2)
+ != sizeof (x) - __builtin_offsetof (struct B, b)
+ - __builtin_offsetof (struct A, c) - 3)
+ abort ();
+ if (__builtin_object_size (&x.c, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, c))
+ abort ();
+ if (__builtin_object_size (&x.c[0], 2)
+ != sizeof (x) - __builtin_offsetof (struct B, c))
+ abort ();
+ if (__builtin_object_size (&x.c[1], 2)
+ != sizeof (x) - __builtin_offsetof (struct B, c) - 1)
+ abort ();
+ if (__builtin_object_size (&x.d, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, d))
+ abort ();
+ if (__builtin_object_size (&x.e, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, e))
+ abort ();
+ if (__builtin_object_size (&x.f, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, f))
+ abort ();
+ dp = &__real__ x.f;
+ if (__builtin_object_size (dp, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, f))
+ abort ();
+ dp = &__imag__ x.f;
+ if (__builtin_object_size (dp, 2)
+ != sizeof (x) - __builtin_offsetof (struct B, f)
+ - sizeof (x.f) / 2)
+ abort ();
+ dp = &y;
+ if (__builtin_object_size (dp, 2) != sizeof (y))
+ abort ();
+ if (__builtin_object_size (&z, 2) != sizeof (z))
+ abort ();
+ dp = &__real__ z;
+ if (__builtin_object_size (dp, 2) != sizeof (z))
+ abort ();
+ dp = &__imag__ z;
+ if (__builtin_object_size (dp, 2) != sizeof (z) / 2)
+ abort ();
+}
+
+struct S { unsigned int a; };
+
+char *
+__attribute__ ((noinline))
+test4 (char *x, int y)
+{
+ register int i;
+ struct A *p;
+
+ for (i = 0; i < y; i++)
+ {
+ p = (struct A *) x;
+ x = (char *) &p[1];
+ if (__builtin_object_size (p, 2) != 0)
+ abort ();
+ }
+ return x;
+}
+
+void
+__attribute__ ((noinline))
+test5 (size_t x)
+{
+ char buf[64];
+ char *p = &buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 2) != 0)
+ abort ();
+ memset (p, ' ', sizeof (buf) - 8 - 4 * 4);
+}
+
+void
+__attribute__ ((noinline))
+test6 (size_t x)
+{
+ struct T { char buf[64]; char buf2[64]; } t;
+ char *p = &t.buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 2) != 0)
+ abort ();
+ memset (p, ' ', sizeof (t) - 8 - 4 * 4);
+}
+
+void
+__attribute__ ((noinline))
+test7 (void)
+{
+ char buf[64];
+ struct T { char buf[64]; char buf2[64]; } t;
+ char *p = &buf[64], *q = &t.buf[64];
+
+ if (__builtin_object_size (p + 64, 2) != 0)
+ abort ();
+ if (__builtin_object_size (q + 63, 2) != sizeof (t) - 64 - 63)
+ abort ();
+ if (__builtin_object_size (q + 64, 2) != sizeof (t) - 64 - 64)
+ abort ();
+ if (__builtin_object_size (q + 256, 2) != 0)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test8 (void)
+{
+ struct T { char buf[10]; char buf2[10]; } t;
+ char *p = &t.buf2[-4];
+ char *q = &t.buf2[0];
+ if (__builtin_object_size (p, 2) != sizeof (t) - 10 + 4)
+ abort ();
+ if (__builtin_object_size (q, 2) != sizeof (t) - 10)
+ abort ();
+ /* GCC only handles additions, not subtractions. */
+ q = q - 8;
+ if (__builtin_object_size (q, 2) != 0
+ && __builtin_object_size (q, 2) != sizeof (t) - 10 + 8)
+ abort ();
+ p = &t.buf[-4];
+ if (__builtin_object_size (p, 2) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct S s[10];
+ __asm ("" : "=r" (l1) : "0" (l1));
+ test1 (main, 6);
+ test2 ();
+ test3 ();
+ test4 ((char *) s, 10);
+ test5 (4);
+ test6 (4);
+ test7 ();
+ test8 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-4.c
new file mode 100644
index 000000000..1eb30d1ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-4.c
@@ -0,0 +1,407 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void *malloc (size_t);
+extern void *calloc (size_t, size_t);
+extern void *alloca (size_t);
+extern void *memcpy (void *, const void *, size_t);
+extern void *memset (void *, int, size_t);
+extern char *strcpy (char *, const char *);
+
+struct A
+{
+ char a[10];
+ int b;
+ char c[10];
+} y, w[4];
+
+extern char exta[];
+extern char extb[30];
+extern struct A extc[];
+struct A zerol[0];
+
+void
+__attribute__ ((noinline))
+test1 (void *q, int x)
+{
+ struct A a;
+ void *p = &a.a[3], *r;
+ char var[x + 10];
+ struct A vara[x + 10];
+ if (x < 0)
+ r = &a.a[9];
+ else
+ r = &a.c[1];
+ if (__builtin_object_size (p, 3) != sizeof (a.a) - 3)
+ abort ();
+ if (__builtin_object_size (&a.c[9], 3)
+ != sizeof (a.c) - 9)
+ abort ();
+ if (__builtin_object_size (q, 3) != 0)
+ abort ();
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 9)
+ abort ();
+ if (x < 6)
+ r = &w[2].a[1];
+ else
+ r = &a.a[6];
+ if (__builtin_object_size (&y, 3) != sizeof (y))
+ abort ();
+ if (__builtin_object_size (w, 3) != sizeof (w))
+ abort ();
+ if (__builtin_object_size (&y.b, 3) != sizeof (a.b))
+ abort ();
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 6)
+ abort ();
+ if (x < 20)
+ r = malloc (30);
+ else
+ r = calloc (2, 16);
+ if (__builtin_object_size (r, 3) != 30)
+ abort ();
+ if (x < 20)
+ r = malloc (30);
+ else
+ r = calloc (2, 14);
+ if (__builtin_object_size (r, 3) != 2 * 14)
+ abort ();
+ if (x < 30)
+ r = malloc (sizeof (a));
+ else
+ r = &a.a[3];
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 3)
+ abort ();
+ r = memcpy (r, "a", 2);
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 3)
+ abort ();
+ r = memcpy (r + 2, "b", 2) + 2;
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 3 - 4)
+ abort ();
+ r = &a.a[4];
+ r = memset (r, 'a', 2);
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 4)
+ abort ();
+ r = memset (r + 2, 'b', 2) + 2;
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 8)
+ abort ();
+ r = &a.a[1];
+ r = strcpy (r, "ab");
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 1)
+ abort ();
+ r = strcpy (r + 2, "cd") + 2;
+ if (__builtin_object_size (r, 3) != sizeof (a.a) - 5)
+ abort ();
+ if (__builtin_object_size (exta, 3) != 0)
+ abort ();
+ if (__builtin_object_size (exta + 10, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&exta[5], 3) != 0)
+ abort ();
+ if (__builtin_object_size (extb, 3) != sizeof (extb))
+ abort ();
+ if (__builtin_object_size (extb + 10, 3) != sizeof (extb) - 10)
+ abort ();
+ if (__builtin_object_size (&extb[5], 3) != sizeof (extb) - 5)
+ abort ();
+ if (__builtin_object_size (extc, 3) != 0)
+ abort ();
+ if (__builtin_object_size (extc + 10, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&extc[5], 3) != 0)
+ abort ();
+ if (__builtin_object_size (&extc->a, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&(extc + 10)->b, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&extc[5].c[3], 3) != 0)
+ abort ();
+ if (__builtin_object_size (var, 3) != 0)
+ abort ();
+ if (__builtin_object_size (var + 10, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&var[5], 3) != 0)
+ abort ();
+ if (__builtin_object_size (vara, 3) != 0)
+ abort ();
+ if (__builtin_object_size (vara + 10, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&vara[5], 3) != 0)
+ abort ();
+ if (__builtin_object_size (&vara[0].a, 3) != sizeof (vara[0].a))
+ abort ();
+ if (__builtin_object_size (&vara[10].a[0], 3) != sizeof (vara[0].a))
+ abort ();
+ if (__builtin_object_size (&vara[5].a[4], 3) != sizeof (vara[0].a) - 4)
+ abort ();
+ if (__builtin_object_size (&vara[5].b, 3) != sizeof (vara[0].b))
+ abort ();
+ if (__builtin_object_size (&vara[7].c[7], 3) != sizeof (vara[0].c) - 7)
+ abort ();
+ if (__builtin_object_size (zerol, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0], 3) != 0)
+ abort ();
+ if (__builtin_object_size (zerol[0].a, 3) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0].a[0], 3) != 0)
+ abort ();
+ if (__builtin_object_size (&zerol[0].b, 3) != 0)
+ abort ();
+ if (__builtin_object_size ("abcdefg", 3) != sizeof ("abcdefg"))
+ abort ();
+ if (__builtin_object_size ("abcd\0efg", 3) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg", 3) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg"[0], 3) != sizeof ("abcd\0efg"))
+ abort ();
+ if (__builtin_object_size (&"abcd\0efg"[4], 3) != sizeof ("abcd\0efg") - 4)
+ abort ();
+ if (__builtin_object_size ("abcd\0efg" + 5, 3) != sizeof ("abcd\0efg") - 5)
+ abort ();
+ if (__builtin_object_size (L"abcdefg", 3) != sizeof (L"abcdefg"))
+ abort ();
+ r = (char *) L"abcd\0efg";
+ if (__builtin_object_size (r + 2, 3) != sizeof (L"abcd\0efg") - 2)
+ abort ();
+}
+
+size_t l1 = 1;
+
+void
+__attribute__ ((noinline))
+test2 (void)
+{
+ struct B { char buf1[10]; char buf2[10]; } a;
+ char *r, buf3[20];
+ int i;
+
+ if (sizeof (a) != 20)
+ return;
+
+ r = buf3;
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[1];
+ else if (i == l1)
+ r = &a.buf2[7];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[9];
+ }
+ if (__builtin_object_size (r, 3) != sizeof (a.buf1) - 9)
+ abort ();
+ r = &buf3[20];
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[7];
+ else if (i == l1)
+ r = &a.buf2[7];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[9];
+ }
+ if (__builtin_object_size (r, 3) != 0)
+ abort ();
+ r = &buf3[1];
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == l1 - 1)
+ r = &a.buf1[6];
+ else if (i == l1)
+ r = &a.buf2[4];
+ else if (i == l1 + 1)
+ r = &buf3[5];
+ else if (i == l1 + 2)
+ r = &a.buf1[2];
+ }
+ if (__builtin_object_size (r, 3) != sizeof (a.buf1) - 6)
+ abort ();
+ r += 2;
+ if (__builtin_object_size (r, 3) != sizeof (a.buf1) - 6 - 2)
+ abort ();
+ if (__builtin_object_size (r + 1, 3) != sizeof (a.buf1) - 6 - 3)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test3 (void)
+{
+ char buf4[10];
+ struct B { struct A a[2]; struct A b; char c[4]; char d; double e;
+ _Complex double f; } x;
+ double y;
+ _Complex double z;
+ double *dp;
+
+ if (__builtin_object_size (buf4, 3) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4, 3) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4[0], 3) != sizeof (buf4))
+ abort ();
+ if (__builtin_object_size (&buf4[1], 3) != sizeof (buf4) - 1)
+ abort ();
+ if (__builtin_object_size (&x, 3) != sizeof (x))
+ abort ();
+ if (__builtin_object_size (&x.a, 3) != sizeof (x.a))
+ abort ();
+ if (__builtin_object_size (&x.a[0], 3) != sizeof (x.a))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a, 3) != sizeof (x.a[0].a))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a[0], 3) != sizeof (x.a[0].a))
+ abort ();
+ if (__builtin_object_size (&x.a[0].a[3], 3) != sizeof (x.a[0].a) - 3)
+ abort ();
+ if (__builtin_object_size (&x.a[0].b, 3) != sizeof (x.a[0].b))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c, 3) != sizeof (x.a[1].c))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c[0], 3) != sizeof (x.a[1].c))
+ abort ();
+ if (__builtin_object_size (&x.a[1].c[3], 3) != sizeof (x.a[1].c) - 3)
+ abort ();
+ if (__builtin_object_size (&x.b, 3) != sizeof (x.b))
+ abort ();
+ if (__builtin_object_size (&x.b.a, 3) != sizeof (x.b.a))
+ abort ();
+ if (__builtin_object_size (&x.b.a[0], 3) != sizeof (x.b.a))
+ abort ();
+ if (__builtin_object_size (&x.b.a[3], 3) != sizeof (x.b.a) - 3)
+ abort ();
+ if (__builtin_object_size (&x.b.b, 3) != sizeof (x.b.b))
+ abort ();
+ if (__builtin_object_size (&x.b.c, 3) != sizeof (x.b.c))
+ abort ();
+ if (__builtin_object_size (&x.b.c[0], 3) != sizeof (x.b.c))
+ abort ();
+ if (__builtin_object_size (&x.b.c[3], 3) != sizeof (x.b.c) - 3)
+ abort ();
+ if (__builtin_object_size (&x.c, 3) != sizeof (x.c))
+ abort ();
+ if (__builtin_object_size (&x.c[0], 3) != sizeof (x.c))
+ abort ();
+ if (__builtin_object_size (&x.c[1], 3) != sizeof (x.c) - 1)
+ abort ();
+ if (__builtin_object_size (&x.d, 3) != sizeof (x.d))
+ abort ();
+ if (__builtin_object_size (&x.e, 3) != sizeof (x.e))
+ abort ();
+ if (__builtin_object_size (&x.f, 3) != sizeof (x.f))
+ abort ();
+ dp = &__real__ x.f;
+ if (__builtin_object_size (dp, 3) != sizeof (x.f) / 2)
+ abort ();
+ dp = &__imag__ x.f;
+ if (__builtin_object_size (dp, 3) != sizeof (x.f) / 2)
+ abort ();
+ dp = &y;
+ if (__builtin_object_size (dp, 3) != sizeof (y))
+ abort ();
+ if (__builtin_object_size (&z, 3) != sizeof (z))
+ abort ();
+ dp = &__real__ z;
+ if (__builtin_object_size (dp, 3) != sizeof (z) / 2)
+ abort ();
+ dp = &__imag__ z;
+ if (__builtin_object_size (dp, 3) != sizeof (z) / 2)
+ abort ();
+}
+
+struct S { unsigned int a; };
+
+char *
+__attribute__ ((noinline))
+test4 (char *x, int y)
+{
+ register int i;
+ struct A *p;
+
+ for (i = 0; i < y; i++)
+ {
+ p = (struct A *) x;
+ x = (char *) &p[1];
+ if (__builtin_object_size (p, 3) != 0)
+ abort ();
+ }
+ return x;
+}
+
+void
+__attribute__ ((noinline))
+test5 (size_t x)
+{
+ struct T { char buf[64]; char buf2[64]; } t;
+ char *p = &t.buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 3) != 0)
+ abort ();
+ memset (p, ' ', sizeof (t.buf) - 8 - 4 * 4);
+}
+
+void
+__attribute__ ((noinline))
+test6 (void)
+{
+ char buf[64];
+ struct T { char buf[64]; char buf2[64]; } t;
+ char *p = &buf[64], *q = &t.buf[64];
+
+ if (__builtin_object_size (p + 64, 3) != 0)
+ abort ();
+ if (__builtin_object_size (q + 0, 3) != 0)
+ abort ();
+ if (__builtin_object_size (q + 64, 3) != 0)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test7 (void)
+{
+ struct T { char buf[10]; char buf2[10]; } t;
+ char *p = &t.buf2[-4];
+ char *q = &t.buf2[0];
+ if (__builtin_object_size (p, 3) != 0)
+ abort ();
+ if (__builtin_object_size (q, 3) != sizeof (t.buf2))
+ abort ();
+ q = &t.buf[10];
+ if (__builtin_object_size (q, 3) != 0)
+ abort ();
+ q = &t.buf[11];
+ if (__builtin_object_size (q, 3) != 0)
+ abort ();
+ p = &t.buf[-4];
+ if (__builtin_object_size (p, 3) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct S s[10];
+ __asm ("" : "=r" (l1) : "0" (l1));
+ test1 (main, 6);
+ test2 ();
+ test3 ();
+ test4 ((char *) s, 10);
+ test5 (4);
+ test6 ();
+ test7 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-5.c
new file mode 100644
index 000000000..7c274cdfd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-5.c
@@ -0,0 +1,56 @@
+/* { dg-do compile { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern char buf[0x40000000];
+
+void
+test1 (size_t x)
+{
+ char *p = &buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 0) != sizeof (buf) - 8)
+ abort ();
+}
+
+void
+test2 (size_t x)
+{
+ char *p = &buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 1) != sizeof (buf) - 8)
+ abort ();
+}
+
+void
+test3 (size_t x)
+{
+ char *p = &buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 2) != 0)
+ abort ();
+}
+
+void
+test4 (size_t x)
+{
+ char *p = &buf[8];
+ size_t i;
+
+ for (i = 0; i < x; ++i)
+ p = p + 4;
+ if (__builtin_object_size (p, 3) != 0)
+ abort ();
+}
+
+/* { dg-final { scan-assembler-not "abort" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-6.c
new file mode 100644
index 000000000..c6887b854
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-6.c
@@ -0,0 +1,435 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void *malloc (size_t);
+extern void free (void *);
+
+struct A
+{
+ char a[10];
+ int b;
+ char c[10];
+};
+
+void
+__attribute__ ((noinline))
+test1 (struct A *p)
+{
+ char *c;
+ if (__builtin_object_size (&p->a, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&p->a[0], 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&p->a[3], 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&p->b, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&p->c, 0) != (size_t) -1)
+ abort ();
+ c = p->a;
+ if (__builtin_object_size (c, 0) != (size_t) -1)
+ abort ();
+ c = &p->a[0];
+ if (__builtin_object_size (c, 0) != (size_t) -1)
+ abort ();
+ c = &p->a[3];
+ if (__builtin_object_size (c, 0) != (size_t) -1)
+ abort ();
+ c = (char *) &p->b;
+ if (__builtin_object_size (c, 0) != (size_t) -1)
+ abort ();
+ c = (char *) &p->c;
+ if (__builtin_object_size (c, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&p->a, 1) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[0], 1) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[3], 1) != sizeof (p->a) - 3)
+ abort ();
+ if (__builtin_object_size (&p->b, 1) != sizeof (p->b))
+ abort ();
+ if (__builtin_object_size (&p->c, 1) != (size_t) -1)
+ abort ();
+ c = p->a;
+ if (__builtin_object_size (c, 1) != sizeof (p->a))
+ abort ();
+ c = &p->a[0];
+ if (__builtin_object_size (c, 1) != sizeof (p->a))
+ abort ();
+ c = &p->a[3];
+ if (__builtin_object_size (c, 1) != sizeof (p->a) - 3)
+ abort ();
+ c = (char *) &p->b;
+ if (__builtin_object_size (c, 1) != sizeof (p->b))
+ abort ();
+ c = (char *) &p->c;
+ if (__builtin_object_size (c, 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&p->a, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&p->a[0], 2) != 0)
+ abort ();
+ if (__builtin_object_size (&p->a[3], 2) != 0)
+ abort ();
+ if (__builtin_object_size (&p->b, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&p->c, 2) != 0)
+ abort ();
+ c = p->a;
+ if (__builtin_object_size (c, 2) != 0)
+ abort ();
+ c = &p->a[0];
+ if (__builtin_object_size (c, 2) != 0)
+ abort ();
+ c = &p->a[3];
+ if (__builtin_object_size (c, 2) != 0)
+ abort ();
+ c = (char *) &p->b;
+ if (__builtin_object_size (c, 2) != 0)
+ abort ();
+ c = (char *) &p->c;
+ if (__builtin_object_size (c, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&p->a, 3) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[0], 3) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[3], 3) != sizeof (p->a) - 3)
+ abort ();
+ if (__builtin_object_size (&p->b, 3) != sizeof (p->b))
+ abort ();
+ if (__builtin_object_size (&p->c, 3) != 0)
+ abort ();
+ c = p->a;
+ if (__builtin_object_size (c, 3) != sizeof (p->a))
+ abort ();
+ c = &p->a[0];
+ if (__builtin_object_size (c, 3) != sizeof (p->a))
+ abort ();
+ c = &p->a[3];
+ if (__builtin_object_size (c, 3) != sizeof (p->a) - 3)
+ abort ();
+ c = (char *) &p->b;
+ if (__builtin_object_size (c, 3) != sizeof (p->b))
+ abort ();
+ c = (char *) &p->c;
+ if (__builtin_object_size (c, 3) != 0)
+ abort ();
+}
+
+void
+__attribute__ ((noinline))
+test2 (void)
+{
+ char *c;
+ size_t s = 2 * sizeof (struct A);
+ struct A *p = malloc (2 * sizeof (struct A));
+ if (__builtin_object_size (&p->a, 0) != s)
+ abort ();
+ if (__builtin_object_size (&p->a[0], 0) != s)
+ abort ();
+ if (__builtin_object_size (&p->a[3], 0) != s - 3)
+ abort ();
+ if (__builtin_object_size (&p->b, 0) != s - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (&p->c, 0) != s - __builtin_offsetof (struct A, c))
+ abort ();
+ c = p->a;
+ if (__builtin_object_size (c, 0) != s)
+ abort ();
+ c = &p->a[0];
+ if (__builtin_object_size (c, 0) != s)
+ abort ();
+ c = &p->a[3];
+ if (__builtin_object_size (c, 0) != s - 3)
+ abort ();
+ c = (char *) &p->b;
+ if (__builtin_object_size (c, 0) != s - __builtin_offsetof (struct A, b))
+ abort ();
+ c = (char *) &p->c;
+ if (__builtin_object_size (c, 0) != s - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&p->a, 1) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[0], 1) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[3], 1) != sizeof (p->a) - 3)
+ abort ();
+ if (__builtin_object_size (&p->b, 1) != sizeof (p->b))
+ abort ();
+ if (__builtin_object_size (&p->c, 1) != s - __builtin_offsetof (struct A, c))
+ abort ();
+ c = p->a;
+ if (__builtin_object_size (c, 1) != sizeof (p->a))
+ abort ();
+ c = &p->a[0];
+ if (__builtin_object_size (c, 1) != sizeof (p->a))
+ abort ();
+ c = &p->a[3];
+ if (__builtin_object_size (c, 1) != sizeof (p->a) - 3)
+ abort ();
+ c = (char *) &p->b;
+ if (__builtin_object_size (c, 1) != sizeof (p->b))
+ abort ();
+ c = (char *) &p->c;
+ if (__builtin_object_size (c, 1) != s - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&p->a, 2) != s)
+ abort ();
+ if (__builtin_object_size (&p->a[0], 2) != s)
+ abort ();
+ if (__builtin_object_size (&p->a[3], 2) != s - 3)
+ abort ();
+ if (__builtin_object_size (&p->b, 2) != s - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (&p->c, 2) != s - __builtin_offsetof (struct A, c))
+ abort ();
+ c = p->a;
+ if (__builtin_object_size (c, 2) != s)
+ abort ();
+ c = &p->a[0];
+ if (__builtin_object_size (c, 2) != s)
+ abort ();
+ c = &p->a[3];
+ if (__builtin_object_size (c, 2) != s - 3)
+ abort ();
+ c = (char *) &p->b;
+ if (__builtin_object_size (c, 2) != s - __builtin_offsetof (struct A, b))
+ abort ();
+ c = (char *) &p->c;
+ if (__builtin_object_size (c, 2) != s - __builtin_offsetof (struct A, c))
+ abort ();
+ if (__builtin_object_size (&p->a, 3) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[0], 3) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[3], 3) != sizeof (p->a) - 3)
+ abort ();
+ if (__builtin_object_size (&p->b, 3) != sizeof (p->b))
+ abort ();
+ if (__builtin_object_size (&p->c, 3) != s - __builtin_offsetof (struct A, c))
+ abort ();
+ c = p->a;
+ if (__builtin_object_size (c, 3) != sizeof (p->a))
+ abort ();
+ c = &p->a[0];
+ if (__builtin_object_size (c, 3) != sizeof (p->a))
+ abort ();
+ c = &p->a[3];
+ if (__builtin_object_size (c, 3) != sizeof (p->a) - 3)
+ abort ();
+ c = (char *) &p->b;
+ if (__builtin_object_size (c, 3) != sizeof (p->b))
+ abort ();
+ c = (char *) &p->c;
+ if (__builtin_object_size (c, 3) != s - __builtin_offsetof (struct A, c))
+ abort ();
+ free (p);
+}
+
+void
+__attribute__ ((noinline))
+test3 (void)
+{
+ char *c;
+ size_t s;
+ struct A *p = malloc (4);
+ if (__builtin_object_size (&p->a, 0) != 4)
+ abort ();
+ if (__builtin_object_size (&p->a[0], 0) != 4)
+ abort ();
+ if (__builtin_object_size (&p->a[3], 0) != 1)
+ abort ();
+ if (__builtin_object_size (&p->b, 0) != 0)
+ abort ();
+ if (__builtin_object_size (&p->c, 0) != 0)
+ abort ();
+ if (__builtin_object_size (&p->a, 1) != 4)
+ abort ();
+ if (__builtin_object_size (&p->a[0], 1) != 4)
+ abort ();
+ if (__builtin_object_size (&p->a[3], 1) != 1)
+ abort ();
+ if (__builtin_object_size (&p->b, 1) != 0)
+ abort ();
+ if (__builtin_object_size (&p->c, 1) != 0)
+ abort ();
+ free (p);
+ s = __builtin_offsetof (struct A, c) + 4;
+ p = malloc (s);
+ if (__builtin_object_size (&p->a, 0) != s)
+ abort ();
+ if (__builtin_object_size (&p->a[0], 0) != s)
+ abort ();
+ if (__builtin_object_size (&p->a[3], 0) != s - 3)
+ abort ();
+ if (__builtin_object_size (&p->b, 0) != s - __builtin_offsetof (struct A, b))
+ abort ();
+ if (__builtin_object_size (&p->c, 0) != 4)
+ abort ();
+ if (__builtin_object_size (&p->a, 1) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[0], 1) != sizeof (p->a))
+ abort ();
+ if (__builtin_object_size (&p->a[3], 1) != sizeof (p->a) - 3)
+ abort ();
+ if (__builtin_object_size (&p->b, 1) != sizeof (p->b))
+ abort ();
+ if (__builtin_object_size (&p->c, 1) != 4)
+ abort ();
+ free (p);
+}
+
+struct B
+{
+ struct A a[4];
+};
+
+void
+__attribute__ ((noinline))
+test4 (struct B *q, int i)
+{
+ if (__builtin_object_size (&q->a[2].a[2], 1) != sizeof (q->a[0].a) - 2)
+ abort ();
+ if (__builtin_object_size (&q->a[2].c[2], 1) != sizeof (q->a[0].c) - 2)
+ abort ();
+ if (__builtin_object_size (&q->a[3].a[2], 1) != sizeof (q->a[0].a) - 2)
+ abort ();
+ if (__builtin_object_size (&q->a[3].c[2], 1) != sizeof (q->a[0].c) - 2)
+ abort ();
+ if (__builtin_object_size (&q->a[i].a[2], 1) != sizeof (q->a[0].a) - 2)
+ abort ();
+ if (__builtin_object_size (&q->a[i].c[2], 1) != sizeof (q->a[0].c) - 2)
+ abort ();
+}
+
+struct C
+{
+ char a[10];
+ char b;
+};
+
+void
+__attribute__ ((noinline))
+test5 (struct C *c)
+{
+ if (__builtin_object_size (&c->b, 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&c->b, 1) != 1)
+ abort ();
+ if (__builtin_object_size (&c->b, 2) != 0)
+ abort ();
+ if (__builtin_object_size (&c->b, 3) != 1)
+ abort ();
+}
+
+struct D
+{
+ int i;
+ struct D1
+ {
+ char b;
+ char a[10];
+ } j;
+};
+
+void
+__attribute__ ((noinline))
+test6 (struct D *d)
+{
+ if (__builtin_object_size (&d->j.a[3], 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&d->j.a[3], 1) != sizeof (d->j.a) - 3)
+ abort ();
+ if (__builtin_object_size (&d->j.a[3], 2) != 0)
+ abort ();
+ if (__builtin_object_size (&d->j.a[3], 3) != sizeof (d->j.a) - 3)
+ abort ();
+}
+
+struct E
+{
+ int i;
+ struct E1
+ {
+ char b;
+ char a[10];
+ } j[1];
+};
+
+void
+__attribute__ ((noinline))
+test7 (struct E *e)
+{
+ if (__builtin_object_size (&e->j[0].a[3], 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&e->j[0].a[3], 1) != sizeof (e->j[0].a) - 3)
+ abort ();
+ if (__builtin_object_size (&e->j[0].a[3], 2) != 0)
+ abort ();
+ if (__builtin_object_size (&e->j[0].a[3], 3) != sizeof (e->j[0].a) - 3)
+ abort ();
+ if (__builtin_object_size ((char *) &e->j[0], 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size ((char *) &e->j[0], 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size ((char *) &e->j[0], 2) != 0)
+ abort ();
+ if (__builtin_object_size ((char *) &e->j[0], 3) != 0)
+ abort ();
+}
+
+union F
+{
+ char a[1];
+ struct F1
+ {
+ char b;
+ char c[10];
+ } d;
+};
+
+void
+__attribute__ ((noinline))
+test8 (union F *f)
+{
+ if (__builtin_object_size (&f->d.c[3], 0) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&f->d.c[3], 1) != (size_t) -1)
+ abort ();
+ if (__builtin_object_size (&f->d.c[3], 2) != 0)
+ abort ();
+ if (__builtin_object_size (&f->d.c[3], 3) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct A a, *p = &a;
+ int i = 1;
+ __asm ("" : "+r" (p));
+ test1 (p);
+ test2 ();
+ test3 ();
+ struct B b, *q = &b;
+ __asm ("" : "+r" (q), "+r" (i));
+ test4 (q, i);
+ struct C c, *cp = &c;
+ __asm ("" : "+r" (cp));
+ test5 (cp);
+ struct D d, *dp = &d;
+ __asm ("" : "+r" (dp));
+ test6 (dp);
+ struct E e, *ep = &e;
+ __asm ("" : "+r" (ep));
+ test7 (ep);
+ union F f, *fp = &f;
+ __asm ("" : "+r" (fp));
+ test8 (fp);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-7.c
new file mode 100644
index 000000000..41742b974
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-7.c
@@ -0,0 +1,71 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+extern void abort (void);
+
+struct A
+{
+ int i, j, k;
+ char buf[255];
+ int l, m, n, o;
+};
+
+int
+main (void)
+{
+ const size_t s = sizeof (struct A);
+ const size_t o = __builtin_offsetof (struct A, buf);
+ struct A *a = malloc (s);
+ struct A *b = malloc (o + 212);
+ if (__builtin_object_size (a->buf, 0) != s - o)
+ abort ();
+ if (__builtin_object_size (a->buf, 1) != sizeof (a->buf))
+ abort ();
+ if (__builtin_object_size (a->buf, 2) != s - o)
+ abort ();
+ if (__builtin_object_size (a->buf, 3) != sizeof (a->buf))
+ abort ();
+ if (__builtin_object_size (&a->buf[0], 0) != s - o)
+ abort ();
+ if (__builtin_object_size (&a->buf[0], 1) != sizeof (a->buf))
+ abort ();
+ if (__builtin_object_size (&a->buf[0], 2) != s - o)
+ abort ();
+ if (__builtin_object_size (&a->buf[0], 3) != sizeof (a->buf))
+ abort ();
+ if (__builtin_object_size (&a->buf[6], 0) != s - o - 6)
+ abort ();
+ if (__builtin_object_size (&a->buf[6], 1) != sizeof (a->buf) - 6)
+ abort ();
+ if (__builtin_object_size (&a->buf[6], 2) != s - o - 6)
+ abort ();
+ if (__builtin_object_size (&a->buf[6], 3) != sizeof (a->buf) - 6)
+ abort ();
+ if (__builtin_object_size (b->buf, 0) != 212)
+ abort ();
+ if (__builtin_object_size (b->buf, 1) != 212)
+ abort ();
+ if (__builtin_object_size (b->buf, 2) != 212)
+ abort ();
+ if (__builtin_object_size (b->buf, 3) != 212)
+ abort ();
+ if (__builtin_object_size (&b->buf[0], 0) != 212)
+ abort ();
+ if (__builtin_object_size (&b->buf[0], 1) != 212)
+ abort ();
+ if (__builtin_object_size (&b->buf[0], 2) != 212)
+ abort ();
+ if (__builtin_object_size (&b->buf[0], 3) != 212)
+ abort ();
+ if (__builtin_object_size (&b->buf[28], 0) != 212 - 28)
+ abort ();
+ if (__builtin_object_size (&b->buf[28], 1) != 212 - 28)
+ abort ();
+ if (__builtin_object_size (&b->buf[28], 2) != 212 - 28)
+ abort ();
+ if (__builtin_object_size (&b->buf[28], 3) != 212 - 28)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-8.c
new file mode 100644
index 000000000..f2d88f9d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-8.c
@@ -0,0 +1,200 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+extern void free (void *);
+extern void abort (void);
+
+union A
+{
+ int a1;
+ char a2[3];
+};
+
+union B
+{
+ long long b1;
+ union A b2;
+};
+
+struct C
+{
+ int c1;
+ union A c2;
+};
+
+struct D
+{
+ int d1;
+ union B d2;
+};
+
+union E
+{
+ struct C e1;
+ char e2[3];
+};
+
+union F
+{
+ int f1;
+ struct D f2;
+};
+
+struct G
+{
+ union A g1;
+ char g2;
+};
+
+struct H
+{
+ int h1;
+ union E h2;
+};
+
+#define T(X, S0, S1) \
+ if (__builtin_object_size (X, 0) != (S0)) \
+ abort (); \
+ if (__builtin_object_size (X, 1) != (S1)) \
+ abort (); \
+ if (__builtin_object_size (X, 2) != (S0)) \
+ abort (); \
+ if (__builtin_object_size (X, 3) != (S1)) \
+ abort ()
+#define TS(X, S0) T(&X, S0, sizeof (X))
+#define TA(X, S0, S1) \
+ T(X, S0, S1); T(&X[0], S0, S1); T(&X[1], (S0) - 1, (S1) - 1)
+#define TF(X, S0) TA(X, S0, S0)
+
+int
+main (void)
+{
+ size_t s, o, o2;
+
+ s = sizeof (union A);
+ o = 0;
+ union A *a1 = malloc (s);
+ union A *a2 = malloc (o + 212);
+ TS (a1->a1, s);
+ TF (a1->a2, s);
+ s = o + 212;
+ TS (a2->a1, s);
+ TF (a2->a2, s);
+ free (a2);
+ free (a1);
+
+ s = sizeof (union B);
+ o = 0;
+ union B *b1 = malloc (s);
+ union B *b2 = malloc (o + 212);
+ TS (b1->b1, s);
+ TS (b1->b2.a1, s);
+ TF (b1->b2.a2, s);
+ s = o + 212;
+ TS (b2->b1, s);
+ TS (b2->b2.a1, s);
+ TF (b2->b2.a2, s);
+ free (b2);
+ free (b1);
+
+ s = sizeof (struct C);
+ o = __builtin_offsetof (struct C, c2);
+ struct C *c1 = malloc (s);
+ struct C *c2 = malloc (o + 212);
+ TS (c1->c1, s);
+ TS (c1->c2.a1, s - o);
+ TF (c1->c2.a2, s - o);
+ s = o + 212;
+ TS (c2->c1, s);
+ TS (c2->c2.a1, s - o);
+ TF (c2->c2.a2, s - o);
+ free (c2);
+ free (c1);
+
+ s = sizeof (struct D);
+ o = __builtin_offsetof (struct D, d2);
+ struct D *d1 = malloc (s);
+ struct D *d2 = malloc (o + 212);
+ TS (d1->d1, s);
+ TS (d1->d2.b1, s - o);
+ TS (d1->d2.b2.a1, s - o);
+ TF (d1->d2.b2.a2, s - o);
+ s = o + 212;
+ TS (d2->d1, s);
+ TS (d2->d2.b1, s - o);
+ TS (d2->d2.b2.a1, s - o);
+ TF (d2->d2.b2.a2, s - o);
+ free (d2);
+ free (d1);
+
+ s = sizeof (union E);
+ o = __builtin_offsetof (union E, e1.c2);
+ union E *e1 = malloc (s);
+ union E *e2 = malloc (o + 212);
+ TS (e1->e1.c1, s);
+ TS (e1->e1.c2.a1, s - o);
+ TF (e1->e1.c2.a2, s - o);
+ TF (e1->e2, s);
+ s = o + 212;
+ TS (e2->e1.c1, s);
+ TS (e2->e1.c2.a1, s - o);
+ TF (e2->e1.c2.a2, s - o);
+ TF (e2->e2, s);
+ free (e2);
+ free (e1);
+
+ s = sizeof (union F);
+ o = __builtin_offsetof (union F, f2.d2);
+ union F *f1 = malloc (s);
+ union F *f2 = malloc (o + 212);
+ TS (f1->f1, s);
+ TS (f1->f2.d1, s);
+ TS (f1->f2.d2.b1, s - o);
+ TS (f1->f2.d2.b2.a1, s - o);
+ TF (f1->f2.d2.b2.a2, s - o);
+ s = o + 212;
+ TS (f2->f1, s);
+ TS (f2->f2.d1, s);
+ TS (f2->f2.d2.b1, s - o);
+ TS (f2->f2.d2.b2.a1, s - o);
+ TF (f2->f2.d2.b2.a2, s - o);
+ free (f2);
+ free (f1);
+
+ s = sizeof (struct G);
+ o = __builtin_offsetof (struct G, g2);
+ struct G *g1 = malloc (s);
+ struct G *g2 = malloc (o + 212);
+ TS (g1->g1.a1, s);
+ TA (g1->g1.a2, s, sizeof (g1->g1.a2));
+ TS (g1->g2, s - o);
+ s = o + 212;
+ TS (g2->g1.a1, s);
+ TA (g2->g1.a2, s, sizeof (g1->g1.a2));
+ TS (g2->g2, s - o);
+ free (g2);
+ free (g1);
+
+ s = sizeof (struct H);
+ o = __builtin_offsetof (struct H, h2);
+ o2 = __builtin_offsetof (struct H, h2.e1.c2);
+ struct H *h1 = malloc (s);
+ struct H *h2 = malloc (o2 + 212);
+ TS (h1->h1, s);
+ TS (h1->h2.e1.c1, s - o);
+ TS (h1->h2.e1.c2.a1, s - o2);
+ TA (h1->h2.e1.c2.a2, s - o2, sizeof (h1->h2.e1.c2.a2));
+ TF (h1->h2.e2, s - o);
+ s = o2 + 212;
+ TS (h2->h1, s);
+ TS (h2->h2.e1.c1, s - o);
+ TS (h2->h2.e1.c2.a1, s - o2);
+ TA (h2->h2.e1.c2.a2, s - o2, sizeof (h2->h2.e1.c2.a2));
+ TF (h2->h2.e2, s - o);
+ free (h2);
+ free (h1);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-9.c
new file mode 100644
index 000000000..f134aaca0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-object-size-9.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+extern void free (void *);
+extern void abort (void);
+
+union U
+{
+ struct S { int a; int b; } s;
+ int t;
+};
+
+struct T
+{
+ int c;
+ char d[1];
+};
+
+int
+main (void)
+{
+ union U *u = malloc (sizeof (struct S) + sizeof (struct T) + 6);
+ struct T *t = (struct T *) (&u->s + 1);
+ if (__builtin_object_size (t->d, 1)
+ != sizeof (struct T) + 6 - __builtin_offsetof (struct T, d))
+ abort ();
+ free (u);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-prefetch-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-prefetch-1.c
new file mode 100644
index 000000000..11beb4e1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-prefetch-1.c
@@ -0,0 +1,45 @@
+/* Test that __builtin_prefetch does no harm.
+
+ Prefetch using some invalid rw and locality values. These must be
+ compile-time constants. */
+
+/* { dg-do run } */
+
+extern void exit (int);
+
+enum locality { none, low, moderate, high, bogus };
+enum rw { read, write };
+
+int arr[10];
+
+void
+good (int *p)
+{
+ __builtin_prefetch (p, 0, 0);
+ __builtin_prefetch (p, 0, 1);
+ __builtin_prefetch (p, 0, 2);
+ __builtin_prefetch (p, 0, 3);
+ __builtin_prefetch (p, 1, 0);
+ __builtin_prefetch (p, 1, 1);
+ __builtin_prefetch (p, 1, 2);
+ __builtin_prefetch (p, 1, 3);
+}
+
+void
+bad (int *p)
+{
+ __builtin_prefetch (p, -1, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
+ __builtin_prefetch (p, 2, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
+ __builtin_prefetch (p, bogus, 0); /* { dg-warning "invalid second argument to '__builtin_prefetch'; using zero" } */
+ __builtin_prefetch (p, 0, -1); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
+ __builtin_prefetch (p, 0, 4); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
+ __builtin_prefetch (p, 0, bogus); /* { dg-warning "invalid third argument to '__builtin_prefetch'; using zero" } */
+}
+
+int
+main ()
+{
+ good (arr);
+ bad (arr);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-protos-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-protos-1.c
new file mode 100644
index 000000000..b9e939699
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-protos-1.c
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+/* { dg-options -Wtraditional-conversion } */
+
+int
+test_s (signed int x)
+{
+ return __builtin_abs (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_clz (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_ctz (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_clrsb (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_ffs (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_parity (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_popcount (x); /* { dg-warning "as unsigned due to prototype" } */
+}
+
+int
+test_u (unsigned int x)
+{
+ return __builtin_abs (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_clz (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_ctz (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_clrsb (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_ffs (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_parity (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_popcount (x); /* { dg-bogus "as signed due to prototype" } */
+}
+
+int
+test_sl (signed long x)
+{
+ return __builtin_labs (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_clzl (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_ctzl (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_clrsbl (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_ffsl (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_parityl (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_popcountl (x); /* { dg-warning "as unsigned due to prototype" } */
+}
+
+int
+test_ul (unsigned long x)
+{
+ return __builtin_labs (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_clzl (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_ctzl (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_clrsbl (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_ffsl (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_parityl (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_popcountl (x); /* { dg-bogus "as signed due to prototype" } */
+}
+
+int
+test_sll (signed long long x)
+{
+ return __builtin_llabs (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_clzll (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_ctzll (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_clrsbll (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_ffsll (x) /* { dg-bogus "as unsigned due to prototype" } */
+ + __builtin_parityll (x) /* { dg-warning "as unsigned due to prototype" } */
+ + __builtin_popcountll (x); /* { dg-warning "as unsigned due to prototype" } */
+}
+
+int
+test_ull (unsigned long long x)
+{
+ return __builtin_llabs (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_clzll (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_ctzll (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_clrsbll (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_ffsll (x) /* { dg-warning "as signed due to prototype" } */
+ + __builtin_parityll (x) /* { dg-bogus "as signed due to prototype" } */
+ + __builtin_popcountll (x); /* { dg-bogus "as signed due to prototype" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-redefine.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-redefine.c
new file mode 100644
index 000000000..1d0f29da8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-redefine.c
@@ -0,0 +1,79 @@
+/* Test -Wno-builtin-macro-redefined warnings. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wno-builtin-macro-redefined -U__DATE__ -D__TIME__=X" } */
+
+/* Check date, time, and datestamp built-ins warnings may be suppressed. */
+
+#if defined(__DATE__)
+#error "__DATE__ is defined, but should not be (-U command line error)"
+/* { dg-bogus "__DATE__ is defined" "" { target *-*-* } 9 } */
+#endif
+
+#if __TIME__ != X
+#error "__TIME__ is not defined as expected (-D command line error)"
+/* { dg-bogus "__TIME__ is not defined" "" { target *-*-* } 14 } */
+#endif
+
+#if !defined(__TIMESTAMP__)
+#error "__TIMESTAMP__ is not defined (built-in macro expectation error)"
+/* { dg-bogus "__TIMESTAMP__ is not defined" "" { target *-*-* } 19 } */
+#endif
+
+
+#undef __TIME__ /* Undefine while defined. */
+#undef __TIME__ /* Undefine while already undefined. */
+
+#define __TIME__ "X" /* Define while undefined. */
+#define __TIME__ "X" /* Re-define while defined. */
+
+#define __TIME__ "Y" /* { dg-warning "\"__TIME__\" redefined" } */
+/* { dg-message "previous definition" "" { target *-*-* } 28 } */
+
+#undef __TIME__ /* Undefine while defined. */
+
+
+#undef __DATE__ /* Undefine while already undefined. */
+
+#define __DATE__ "X" /* Define while undefined. */
+#define __DATE__ "X" /* Re-define while defined. */
+
+#define __DATE__ "Y" /* { dg-warning "\"__DATE__\" redefined" } */
+/* { dg-message "previous definition" "" { target *-*-* } 39 } */
+
+#undef __DATE__ /* Undefine while defined. */
+
+
+#define __TIMESTAMP__ "X" /* Define while already defined. */
+#define __TIMESTAMP__ "X" /* Re-define while defined. */
+
+#define __TIMESTAMP__ "Y" /* { dg-warning "\"__TIMESTAMP__\" redefined" } */
+/* { dg-message "previous definition" "" { target *-*-* } 48 } */
+
+#undef __TIMESTAMP__ /* Undefine while defined. */
+
+
+/* Check other built-ins with warnings that may be suppressed. */
+
+#if !defined(__FILE__) || !defined(__BASE_FILE__)
+#error "Expected built-in is not defined (built-in macro expectation error)"
+/* { dg-bogus "Expected built-in is not defined" "" { target *-*-* } 59 } */
+#endif
+
+#define __FILE__ "X" /* Define while already defined. */
+#define __BASE_FILE__ "X" /* Define while already defined. */
+
+
+/* Check selected built-ins not affected by warning suppression. */
+
+#if !defined(__LINE__) || !defined(__INCLUDE_LEVEL__) || !defined(__COUNTER__)
+#error "Expected built-in is not defined (built-in macro expectation error)"
+/* { dg-bogus "Expected built-in is not defined" "" { target *-*-* } 70 } */
+#endif
+
+#define __LINE__ 0 /* { dg-warning "\"__LINE__\" redef" } */
+#define __INCLUDE_LEVEL__ 0 /* { dg-warning "\"__INCLUDE_LEVEL__\" redef" } */
+#define __COUNTER__ 0 /* { dg-warning "\"__COUNTER__\" redef" } */
+
+
+int unused; /* Silence `ISO C forbids an empty translation unit' warning. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-return-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-return-1.c
new file mode 100644
index 000000000..68fd0556b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-return-1.c
@@ -0,0 +1,34 @@
+/* PR middle-end/11151 */
+/* Originator: Andrew Church <gcczilla@achurch.org> */
+/* { dg-do run } */
+/* { dg-xfail-run-if "PR36571 untyped return is char register" { "avr-*-*" } { "*" } { "" } } */
+/* This used to fail on SPARC because the (undefined) return
+ value of 'bar' was overwriting that of 'foo'. */
+
+extern void abort(void);
+
+int foo(int n)
+{
+ return n+1;
+}
+
+int bar(int n)
+{
+ __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(), 64));
+}
+
+char *g;
+
+int main(void)
+{
+ /* Allocate 64 bytes on the stack to make sure that __builtin_apply
+ can read at least 64 bytes above the return address. */
+ char dummy[64];
+
+ g = dummy;
+
+ if (bar(1) != 2)
+ abort();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c
new file mode 100644
index 000000000..bb727da28
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c
@@ -0,0 +1,115 @@
+/* Test whether buffer overflow warnings for __*_chk builtins
+ are emitted properly. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -ftrack-macro-expansion=0" } */
+/* { dg-additional-options "-mstructure-size-boundary=8" { target arm*-*-* } } */
+// { dg-skip-if "packed attribute missing for t" { "epiphany-*-*" } { "*" } { "" } }
+
+extern void abort (void);
+
+#include "../gcc.c-torture/execute/builtins/chk.h"
+#include <stdarg.h>
+
+volatile void *vx;
+char buf1[20];
+int x;
+
+void
+test (int arg, ...)
+{
+ char buf2[20];
+ va_list ap;
+ char *p = &buf1[10], *q;
+
+ memcpy (&buf2[19], "ab", 1);
+ memcpy (&buf2[19], "ab", 2); /* { dg-warning "will always overflow" "memcpy" } */
+ vx = mempcpy (&buf2[19], "ab", 1);
+ vx = mempcpy (&buf2[19], "ab", 2); /* { dg-warning "will always overflow" "mempcpy" } */
+ memmove (&buf2[18], &buf1[10], 2);
+ memmove (&buf2[18], &buf1[10], 3); /* { dg-warning "will always overflow" "memmove" } */
+ memset (&buf2[16], 'a', 4);
+ memset (&buf2[15], 'b', 6); /* { dg-warning "will always overflow" "memset" } */
+ strcpy (&buf2[18], "a");
+ strcpy (&buf2[18], "ab"); /* { dg-warning "will always overflow" "strcpy" } */
+ vx = stpcpy (&buf2[18], "a");
+ vx = stpcpy (&buf2[18], "ab"); /* { dg-warning "will always overflow" "stpcpy" } */
+ strncpy (&buf2[18], "a", 2);
+ strncpy (&buf2[18], "a", 3); /* { dg-warning "will always overflow" "strncpy" } */
+ strncpy (&buf2[18], "abc", 2);
+ strncpy (&buf2[18], "abc", 3); /* { dg-warning "will always overflow" "strncpy" } */
+ memset (buf2, '\0', sizeof (buf2));
+ strcat (&buf2[18], "a");
+ memset (buf2, '\0', sizeof (buf2));
+ strcat (&buf2[18], "ab"); /* { dg-warning "will always overflow" "strcat" } */
+ sprintf (&buf2[18], "%s", buf1);
+ sprintf (&buf2[18], "%s", "a");
+ sprintf (&buf2[18], "%s", "ab"); /* { dg-warning "will always overflow" "sprintf" } */
+ sprintf (&buf2[18], "a");
+ sprintf (&buf2[18], "ab"); /* { dg-warning "will always overflow" "sprintf" } */
+ snprintf (&buf2[18], 2, "%d", x);
+ /* N argument to snprintf is the size of the buffer.
+ Although this particular call wouldn't overflow buf2,
+ incorrect buffer size was passed to it and therefore
+ we want a warning and runtime failure. */
+ snprintf (&buf2[18], 3, "%d", x); /* { dg-warning "will always overflow" "snprintf" } */
+ va_start (ap, arg);
+ vsprintf (&buf2[18], "a", ap);
+ va_end (ap);
+ va_start (ap, arg);
+ vsprintf (&buf2[18], "ab", ap); /* { dg-warning "will always overflow" "vsprintf" } */
+ va_end (ap);
+ va_start (ap, arg);
+ vsnprintf (&buf2[18], 2, "%s", ap);
+ va_end (ap);
+ va_start (ap, arg);
+ /* See snprintf above. */
+ vsnprintf (&buf2[18], 3, "%s", ap); /* { dg-warning "will always overflow" "vsnprintf" } */
+ va_end (ap);
+
+ p = p + 10;
+ memset (p, 'd', 0);
+ q = strcpy (p, ""); /* { dg-warning "will always overflow" "strcpy" } */
+
+ /* This invokes undefined behaviour, since we are past the end of buf1. */
+ p = p + 10;
+ memset (p, 'd', 1); /* { dg-warning "will always overflow" "memset" } */
+
+ memset (q, 'd', 0);
+ memset (q, 'd', 1); /* { dg-warning "will always overflow" "memset" } */
+ q = q - 10;
+ memset (q, 'd', 10);
+}
+
+char *str = "ABCDEFG";
+typedef struct { char b[16]; } H;
+
+/* Some brown paper bag bugs found in real applications.
+ This test is here merely for amusement. */
+
+void
+test2 (const H h)
+{
+ char c;
+ strncpy (&c, str, 3); /* { dg-warning "will always overflow" "strncpy" } */
+
+ struct { char b[4]; } x;
+ sprintf (x.b, "%s", "ABCD"); /* { dg-warning "will always overflow" "sprintf" } */
+
+ unsigned int i;
+ memcpy (&i, &h, sizeof (h)); /* { dg-warning "will always overflow" "memcpy" } */
+
+ unsigned char buf[21];
+ memset (buf + 16, 0, 8); /* { dg-warning "will always overflow" "memset" } */
+
+ typedef struct { int i, j, k, l; } S;
+ S *s[3];
+ memset (s, 0, sizeof (S) * 3); /* { dg-warning "will always overflow" "memset" } */
+
+ struct T { char a[8]; char b[4]; char c[10]; } t;
+ stpcpy (t.c,"Testing..."); /* { dg-warning "will always overflow" "stpcpy" } */
+
+ char b1[7];
+ char b2[4];
+ memset (b1, 0, sizeof (b1));
+ memset (b2, 0, sizeof (b1)); /* { dg-warning "will always overflow" "memset" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-stringop-chk-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-stringop-chk-2.c
new file mode 100644
index 000000000..7c2bb6098
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-stringop-chk-2.c
@@ -0,0 +1,137 @@
+/* This file was miscompiled by an earlier version of the object size
+ checking patch. Object size in one of the memcpy calls was
+ incorrectly determined to be 0 while it should be (size_t) -1
+ (== unknown). */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftrack-macro-expansion=0" } */
+
+#include "../gcc.c-torture/execute/builtins/chk.h"
+
+void *bar (int);
+extern void *malloc (__SIZE_TYPE__);
+
+struct A
+{
+ int i, j, k;
+};
+
+/* Here all object sizes are not known at compile time. There
+ should be no warning, nor any checker functions called. */
+
+void
+foo (const struct A *x, int y, const unsigned char *z)
+{
+ unsigned int b;
+ unsigned char *c = 0;
+
+ b = (x->i & 0xff) == 1 ? 3 : 4;
+ if (y)
+ c = bar (x->j * x->k);
+
+ const unsigned char *d = z;
+ unsigned char *e = c;
+ unsigned char *f = c + x->j * x->k;
+ int g = 0;
+
+ while (e < f)
+ {
+ unsigned int h = *d++;
+
+ if (h & 128)
+ {
+ h = h - 128;
+ g = e + h * b > f;
+ if (g)
+ h = (f - e) / b;
+ if (b < 4)
+ do
+ {
+ memcpy (e, d, 3);
+ e += 3;
+ }
+ while (--h);
+ else
+ do
+ {
+ memcpy (e, d, 4);
+ e += 4;
+ }
+ while (--h);
+ d += b;
+ }
+ else
+ {
+ h *= b;
+ g = e + h > f;
+ if (g)
+ h = f - e;
+ memcpy (e, d, h);
+ e += h;
+ d += h;
+ }
+ }
+}
+
+/* The same routine, slightly modified:
+ 1) c has known size at compile time
+ 2) e += h was changed into e += 16.
+ GCC could actually through VRP determine that
+ in e += h is (h >= 0 && h <= 127), thus know
+ it is pointer addition and not subtraction and
+ know e's __builtin_object_size (e, 0) is at 512,
+ but we are not there yet. */
+
+unsigned char *
+baz (const struct A *x, const unsigned char *z)
+{
+ unsigned int b;
+ unsigned char *c = 0;
+
+ b = (x->i & 0xff) == 1 ? 3 : 4;
+ c = malloc (512);
+
+ const unsigned char *d = z;
+ unsigned char *e = c;
+ unsigned char *f = c + x->j * x->k;
+ int g = 0;
+
+ while (e < f)
+ {
+ unsigned int h = *d++;
+
+ if (h & 128)
+ {
+ h = h - 128;
+ g = e + h * b > f;
+ if (g)
+ h = (f - e) / b;
+ if (b < 4)
+ do
+ {
+ memcpy (e, d, 3);
+ e += 3;
+ }
+ while (--h);
+ else
+ do
+ {
+ memcpy (e, d, 513); /* { dg-warning "will always overflow" "memcpy" } */
+ e += 4;
+ }
+ while (--h);
+ d += b;
+ }
+ else
+ {
+ h *= b;
+ g = e + h > f;
+ if (g)
+ h = f - e;
+ memcpy (e, d, h);
+ /* e += h; */
+ e += 16;
+ d += h;
+ }
+ }
+ return c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-strncat-chk-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-strncat-chk-1.c
new file mode 100644
index 000000000..44677f167
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-strncat-chk-1.c
@@ -0,0 +1,38 @@
+/* Test whether buffer overflow warnings for __strncat_chk builtin
+ are emitted properly. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -ftrack-macro-expansion=0" } */
+
+extern void abort (void);
+
+#include "../gcc.c-torture/execute/builtins/chk.h"
+
+char buf1[20];
+char *q;
+
+void
+test (int arg, ...)
+{
+ char *p = &buf1[10];
+
+ *p = 0;
+ strncat (p, "abcdefg", 9);
+ *p = 0;
+ strncat (p, "abcdefghi", 9);
+ *p = 0;
+ strncat (p, "abcdefghij", 9);
+ *p = 0;
+ strncat (p, "abcdefghi", 10);
+ *p = 0;
+ strncat (p, "abcdefghij", 10); /* { dg-warning "will always overflow" } */
+ *p = 0;
+ strncat (p, "abcdefgh", 11);
+ *p = 0;
+ strncat (p, "abcdefghijkl", 11); /* { dg-warning "will always overflow" } */
+ *p = 0;
+ strncat (p, q, 9);
+ *p = 0;
+ strncat (p, q, 10); /* { dg-warning "might overflow" } */
+ *p = 0;
+ strncat (p, q, 11); /* { dg-warning "might overflow" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-strstr.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-strstr.c
new file mode 100644
index 000000000..b8201f416
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-strstr.c
@@ -0,0 +1,8 @@
+/* The strstr call is expanded to just "s", which should not result in a
+ warning about discarding qualifiers in an assignment. */
+/* { dg-do compile } */
+extern char * strstr (const char *s1, const char * s2);
+void foo(const char *s){
+ char * cp;
+ cp = strstr(s, "");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-1.c
new file mode 100644
index 000000000..165da3f94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-1.c
@@ -0,0 +1,17 @@
+/* Check that __builtin_unreachable() prevents the 'control reaches
+ end of non-void function' diagnostic. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wreturn-type" } */
+int
+f(int a, int b)
+{
+ if (a)
+ {
+ return b;
+ }
+ else
+ {
+ asm ("bug");
+ __builtin_unreachable();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-2.c
new file mode 100644
index 000000000..13bdb9f73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-2.c
@@ -0,0 +1,20 @@
+/* Check that __builtin_unreachable() is a no-return function thus
+ causing the dead call to foo() to be removed. The comparison is
+ dead too, and should be removed. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-rtl-cse1" } */
+void foo (void);
+
+int
+f (int i)
+{
+ if (i > 1)
+ __builtin_unreachable();
+ if (i > 1)
+ foo ();
+ return 1;
+}
+/* { dg-final { scan-tree-dump-not "foo" "optimized" } } */
+/* { dg-final { scan-rtl-dump-not "\\(if_then_else" "cse1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+/* { dg-final { cleanup-rtl-dump "cse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-3.c
new file mode 100644
index 000000000..6ad69261e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-3.c
@@ -0,0 +1,9 @@
+/* Check that a function containing only __builtin_unreachable()
+ doesn't ICE. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+const char *
+f (void)
+{
+ __builtin_unreachable ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-4.c
new file mode 100644
index 000000000..90bc99cbe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-4.c
@@ -0,0 +1,14 @@
+/* Check that this valid code doesn't ICE. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+void
+g (int a, int b, int c, int d)
+{
+ if (d)
+ {
+ ((void)
+ (!(a && b && c) ? __builtin_unreachable (), 0 : 0));
+ }
+ ((void)
+ (!(a && b && c) ? __builtin_unreachable (), 0 : 0));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-5.c
new file mode 100644
index 000000000..904a474a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-5.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+int
+foo (int a)
+{
+ if (a <= 0)
+ {
+ L1:
+ __builtin_unreachable ();
+ }
+
+ if (a > 2)
+ goto L1;
+
+ return a > 0;
+}
+
+/* { dg-final { scan-tree-dump-times "if \\(" 0 "fab1" } } */
+/* { dg-final { scan-tree-dump-times "goto" 0 "fab1" } } */
+/* { dg-final { scan-tree-dump-times "L1:" 0 "fab1" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_unreachable" 0 "fab1" } } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-6.c
new file mode 100644
index 000000000..2fe06ac7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtin-unreachable-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+void
+foo (int b, int c)
+{
+ void *x = &&lab;
+ if (b)
+ {
+lab:
+ __builtin_unreachable ();
+ }
+lab2:
+ if (c)
+ x = &&lab2;
+ goto *x;
+}
+
+/* { dg-final { scan-tree-dump-times "lab:" 1 "fab1" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_unreachable" 1 "fab1" } } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-1.c
new file mode 100644
index 000000000..5dab9fe0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-1.c
@@ -0,0 +1,212 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation.
+
+ Verify that all the __builtin_ math functions are recognized
+ by the compiler.
+
+ Written by Roger Sayle, 11th July 2002. */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-final { scan-assembler-not "__builtin_" } } */
+
+/* These helper macros ensure we also check the float and long double
+ cases. */
+
+/* Test FP functions taking void. */
+#define FPTEST0(FN) \
+double test_##FN(void) { return __builtin_##FN(); } \
+float test_##FN##f(void) { return __builtin_##FN##f(); } \
+long double test_##FN##l(void) { return __builtin_##FN##l(); }
+
+/* Test FP functions taking one FP argument. */
+#define FPTEST1(FN) \
+double test_##FN(double x) { return __builtin_##FN(x); } \
+float test_##FN##f(float x) { return __builtin_##FN##f(x); } \
+long double test_##FN##l(long double x) { return __builtin_##FN##l(x); }
+
+/* Test FP functions taking one argument of a supplied type. */
+#define FPTEST1ARG(FN, TYPE) \
+double test_##FN(TYPE x) { return __builtin_##FN(x); } \
+float test_##FN##f(TYPE x) { return __builtin_##FN##f(x); } \
+long double test_##FN##l(TYPE x) { return __builtin_##FN##l(x); }
+
+/* Test FP functions taking two arguments, the first argument is of a
+ supplied type. */
+#define FPTEST2ARG1(FN, TYPE) \
+double test_##FN(TYPE x, double y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(TYPE x, float y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(TYPE x, long double y) { return __builtin_##FN##l(x, y); }
+
+/* Test FP functions taking two arguments, the second argument is of a
+ supplied type. */
+#define FPTEST2ARG2(FN, TYPE) \
+double test_##FN(double x, TYPE y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(float x, TYPE y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(long double x, TYPE y) { return __builtin_##FN##l(x, y); }
+
+/* Test FP functions taking two arguments, the second argument is of a
+ supplied type. The function is named reentrant style, meaning "_r"
+ appears after the possible f/l suffix. */
+#define FPTEST2ARG2_REENT(FN, TYPE) \
+double test_##FN##_r(double x, TYPE y) { return __builtin_##FN##_r(x, y); } \
+float test_##FN##f_r(float x, TYPE y) { return __builtin_##FN##f_r(x, y); } \
+long double test_##FN##l_r(long double x, TYPE y) { return __builtin_##FN##l_r(x, y); }
+
+/* Test FP functions taking two arguments, the second argument is a
+ FP pointer. */
+#define FPTEST2FPP2(FN) \
+double test_##FN(double x, double *y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(float x, float *y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(long double x, long double *y) { return __builtin_##FN##l(x, y); }
+
+/* Test FP functions taking one FP argument and a supplied return
+ type. */
+#define FPTEST1RET(FN, TYPE) \
+TYPE test_##FN(double x) { return __builtin_##FN(x); } \
+TYPE test_##FN##f(float x) { return __builtin_##FN##f(x); } \
+TYPE test_##FN##l(long double x) { return __builtin_##FN##l(x); }
+
+/* Test FP functions taking two FP arguments. */
+#define FPTEST2(FN) \
+double test_##FN(double x, double y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(float x, float y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(long double x, long double y) { return __builtin_##FN##l(x, y); }
+
+/* Test FP functions taking three FP arguments. */
+#define FPTEST3(FN) \
+double test_##FN(double x, double y, double z) { return __builtin_##FN(x, y, z); } \
+float test_##FN##f(float x, float y, float z) { return __builtin_##FN##f(x, y, z); } \
+long double test_##FN##l(long double x, long double y, long double z) { return __builtin_##FN##l(x, y, z); }
+
+/* Test FP functions taking three arguments, two FP and the third is
+ of a supplied type. */
+#define FPTEST3ARG3(FN, TYPE) \
+double test_##FN(double x, double y, TYPE z) { return __builtin_##FN(x, y, z); } \
+float test_##FN##f(float x, float y, TYPE z) { return __builtin_##FN##f(x, y, z); } \
+long double test_##FN##l(long double x, long double y, TYPE z) { return __builtin_##FN##l(x, y, z); }
+
+/* Test FP functions taking three FP arguments. The second and third
+ are FP pointers. The return type is void. */
+#define FPTEST3FPP23VOID(FN) \
+double test_##FN(double x, double *y, double *z) { __builtin_##FN(x, y, z); return *y * *z; } \
+float test_##FN##f(float x, float *y, float *z) { __builtin_##FN##f(x, y, z); return *y * *z; } \
+long double test_##FN##l(long double x, long double *y, long double *z) { __builtin_##FN##l(x, y, z); return *y * *z; }
+
+/* Test Complex functions taking one Complex argument. */
+#define CPTEST1(FN) \
+_Complex double test_##FN(_Complex double x) { return __builtin_##FN(x); } \
+_Complex float test_##FN##f(_Complex float x) { return __builtin_##FN##f(x); } \
+_Complex long double test_##FN##l(_Complex long double x) { return __builtin_##FN##l(x); }
+
+/* Test Complex functions taking one Complex argument and returning an FP type. */
+#define CPTEST1RETFP(FN) \
+double test_##FN(_Complex double x) { return __builtin_##FN(x); } \
+float test_##FN##f(_Complex float x) { return __builtin_##FN##f(x); } \
+long double test_##FN##l(_Complex long double x) { return __builtin_##FN##l(x); }
+
+/* Test Complex functions taking two Complex arguments. */
+#define CPTEST2(FN) \
+_Complex double test_##FN(_Complex double x, _Complex double y) { return __builtin_##FN(x,y); } \
+_Complex float test_##FN##f(_Complex float x, _Complex float y) { return __builtin_##FN##f(x,y); } \
+_Complex long double test_##FN##l(_Complex long double x, _Complex long double y) { return __builtin_##FN##l(x,y); }
+
+
+/* Keep this list sorted alphabetically by function name. */
+FPTEST1 (acos)
+FPTEST1 (acosh)
+FPTEST1 (asin)
+FPTEST1 (asinh)
+FPTEST1 (atan)
+FPTEST2 (atan2)
+FPTEST1 (atanh)
+FPTEST1 (cbrt)
+FPTEST1 (ceil)
+FPTEST2 (copysign)
+FPTEST1 (cos)
+FPTEST1 (cosh)
+FPTEST2 (drem)
+FPTEST1 (erf)
+FPTEST1 (erfc)
+FPTEST1 (exp)
+FPTEST1 (exp10)
+FPTEST1 (exp2)
+FPTEST1 (expm1)
+FPTEST1 (fabs)
+FPTEST2 (fdim)
+FPTEST1 (floor)
+FPTEST3 (fma)
+FPTEST2 (fmax)
+FPTEST2 (fmin)
+FPTEST2 (fmod)
+FPTEST2ARG2 (frexp, int *)
+FPTEST1 (gamma)
+FPTEST2ARG2_REENT (gamma, int *) /* gamma_r */
+FPTEST0 (huge_val)
+FPTEST2 (hypot)
+FPTEST1 (ilogb)
+FPTEST0 (inf) /* { dg-warning "target format does not support infinity" "inf" {target spu-*-*} } */
+FPTEST1 (j0)
+FPTEST1 (j1)
+FPTEST2ARG1 (jn, int)
+FPTEST2ARG2 (ldexp, int)
+FPTEST1 (lgamma)
+FPTEST2ARG2_REENT (lgamma, int *) /* lgamma_r */
+FPTEST1RET (llrint, long long)
+FPTEST1RET (llround, long long)
+FPTEST1 (log)
+FPTEST1 (log10)
+FPTEST1 (log1p)
+FPTEST1 (log2)
+FPTEST1 (logb)
+FPTEST1RET (lrint, long)
+FPTEST1RET (lround, long)
+FPTEST2FPP2 (modf)
+FPTEST1 (nearbyint)
+FPTEST2 (nextafter)
+FPTEST2 (nexttoward)
+FPTEST2 (pow)
+FPTEST1 (pow10)
+FPTEST2 (remainder)
+FPTEST3ARG3 (remquo, int *)
+FPTEST1 (rint)
+FPTEST1 (round)
+FPTEST2 (scalb)
+FPTEST2ARG2 (scalbln, int)
+FPTEST2ARG2 (scalbn, int)
+FPTEST1RET (signbit, int)
+FPTEST1 (significand)
+FPTEST1 (sin)
+FPTEST3FPP23VOID (sincos)
+FPTEST1 (sinh)
+FPTEST1 (sqrt)
+FPTEST1 (tan)
+FPTEST1 (tanh)
+FPTEST1 (tgamma)
+FPTEST1 (trunc)
+FPTEST1 (y0)
+FPTEST1 (y1)
+FPTEST2ARG1 (yn, int)
+
+/* Keep this list sorted alphabetically by function name. */
+CPTEST1RETFP (cabs)
+CPTEST1 (cacos)
+CPTEST1 (cacosh)
+CPTEST1RETFP (carg)
+CPTEST1 (casin)
+CPTEST1 (casinh)
+CPTEST1 (catan)
+CPTEST1 (catanh)
+CPTEST1 (ccos)
+CPTEST1 (ccosh)
+CPTEST1 (cexp)
+CPTEST1RETFP (cimag)
+CPTEST1 (clog)
+CPTEST1 (conj)
+CPTEST2 (cpow)
+CPTEST1 (cproj)
+CPTEST1RETFP (creal)
+CPTEST1 (csin)
+CPTEST1 (csinh)
+CPTEST1 (csqrt)
+CPTEST1 (ctan)
+CPTEST1 (ctanh)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-10.c
new file mode 100644
index 000000000..1b141fda2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-10.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of built-in math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Roger Sayle, 2nd April 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+extern double exp(double);
+extern double log(double);
+extern double sqrt(double);
+extern double pow(double,double);
+extern double fabs(double);
+
+void test(double x)
+{
+ if (sqrt(pow(x,4.0)) != x*x)
+ link_error ();
+
+ if (pow(sqrt(x),4.0) != x*x)
+ link_error ();
+
+ if (pow(pow(x,4.0),0.25) != x)
+ /* XFAIL. PR41098. */;
+}
+
+void test2(double x, double y, double z)
+{
+ if (sqrt(pow(x,y)) != pow(fabs(x),y*0.5))
+ link_error ();
+
+ if (log(pow(x,y)) != y*log(x))
+ link_error ();
+
+ if (pow(exp(x),y) != exp(x*y))
+ link_error ();
+
+ if (pow(sqrt(x),y) != pow(x,y*0.5))
+ link_error ();
+
+ if (pow(pow(fabs(x),y),z) != pow(fabs(x),y*z))
+ link_error ();
+}
+
+int main()
+{
+ test (2.0);
+ test2 (2.0, 3.0, 4.0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-11.c
new file mode 100644
index 000000000..ba0d2dbf0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-11.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 2003,2007 Free Software Foundation.
+
+ Check that constant folding of built-in math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Roger Sayle, 5th April 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+extern double exp(double);
+extern double sqrt(double);
+extern double cbrt(double);
+extern double pow(double,double);
+
+void test(double x, double y, double z)
+{
+ if (sqrt(x)*sqrt(x) != x)
+ link_error ();
+
+ if (sqrt(x)*sqrt(y) != sqrt(x*y))
+ link_error ();
+
+ if (exp(x)*exp(y) != exp(x+y))
+ link_error ();
+
+ if (pow(x,y)*pow(z,y) != pow(z*x,y))
+ link_error ();
+
+ if (pow(x,y)*pow(x,z) != pow(x,y+z))
+ link_error ();
+
+ if (x/exp(y) != x*exp(-y))
+ link_error ();
+
+ if (x/pow(y,z) != x*pow(y,-z))
+ link_error ();
+
+ if (x/sqrt(y/z) != x*sqrt(z/y))
+ link_error ();
+
+ if (x/cbrt(y/z) != x*cbrt(z/y))
+ link_error ();
+}
+
+int main()
+{
+ test (2.0, 3.0, 4.0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-12.c
new file mode 100644
index 000000000..61a80edf7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-12.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that all the malloc-like __builtin_ allocation functions are
+ recognized by the compiler.
+
+ Written by Roger Sayle, 12th April 2003. */
+
+/* { dg-do compile } */
+/* { dg-options "-ansi" } */
+/* { dg-final { scan-assembler-not "__builtin_" } } */
+
+typedef __SIZE_TYPE__ size_t;
+
+void *test1(size_t n)
+{
+ return __builtin_malloc(n);
+}
+
+void *test2(size_t n, size_t s)
+{
+ return __builtin_calloc(n,s);
+}
+
+char *test3(const char *ptr)
+{
+ return __builtin_strdup(ptr);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-13.c
new file mode 100644
index 000000000..149407b54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-13.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that the malloc-like __builtin_ allocation functions are
+ correctly aliased by the compiler.
+
+ Written by Roger Sayle, 12th April 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-ansi" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern void *malloc (size_t);
+extern void *calloc (size_t,size_t);
+
+extern void link_error (void);
+
+static int x;
+
+void test1(void)
+{
+ int *ptr1, *ptr2;
+
+ ptr1 = &x;
+ ptr2 = (int*) malloc (sizeof (int));
+
+ *ptr1 = 12;
+ *ptr2 = 8;
+
+ if (*ptr1 != 12)
+ link_error();
+}
+
+void test2(void)
+{
+ int *ptr1, *ptr2;
+
+ ptr1 = &x;
+ ptr2 = (int*) calloc (1, sizeof (int));
+
+ *ptr1 = 12;
+ *ptr2 = 8;
+
+ if (*ptr1 != 12)
+ link_error ();
+}
+
+int main()
+{
+ test1 ();
+ test2 ();
+ return 0;
+}
+
+#ifndef __OPTIMIZE__
+void link_error (void)
+{
+ abort ();
+}
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-14.c
new file mode 100644
index 000000000..e025391a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-14.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of built-in math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Roger Sayle, 9th April 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error(void);
+
+extern double pow(double,double);
+
+
+int main()
+{
+ if (pow (2.0, 3.0) != 8.0)
+ link_error ();
+
+ if (pow (2.0, -3.0) != 0.125)
+ link_error ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-15.c
new file mode 100644
index 000000000..6d94c7edc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-15.c
@@ -0,0 +1,17 @@
+/* Derived from PR optimization/10764 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double log(double x);
+
+double ndtri(double y0)
+{
+ double x;
+
+ x = log(y0);
+ x = log(x);
+
+ return x;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-16.c
new file mode 100644
index 000000000..e7ffe9350
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-16.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that all the __builtin_cabs? functions are recognized
+ by the compiler. Complex numbers are not supported with the
+ gcc.dg default "-pedantic-errors" option, so the dg-options
+ overrides this.
+
+ Written by Roger Sayle, 1st June 2003. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -ansi" } */
+/* { dg-final { scan-assembler-not "__builtin_" } } */
+
+double test(__complex__ double x)
+{
+ return __builtin_cabs (x);
+}
+
+float testf(__complex__ float x)
+{
+ return __builtin_cabsf (x);
+}
+
+long double testl(__complex__ long double x)
+{
+ return __builtin_cabsl (x);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-17.c
new file mode 100644
index 000000000..a9e21fba8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-17.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of built-in math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Roger Sayle, 25th May 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+extern double exp(double);
+extern double atan(double);
+
+int main()
+{
+ if (exp (1.0) < 2.71 || exp (1.0) > 2.72)
+ link_error ();
+ if (exp (2.0) < 7.38 || exp (2.0) > 7.39)
+ link_error ();
+ if (exp (-2.0) < 0.13 || exp (-2.0) > 0.14)
+ link_error ();
+ if (atan (1.0) < 0.78 || atan (1.0) > 0.79)
+ link_error ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-18.c
new file mode 100644
index 000000000..9afaca23a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-18.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that built-in cabs, cabsf and cabsl functions don't
+ break anything and produces the expected results.
+
+ Written by Roger Sayle, 1st June 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+/* { dg-add-options c99_runtime } */
+
+#include "builtins-config.h"
+
+extern void link_error(void);
+
+extern float cabsf (float _Complex);
+extern double cabs (double _Complex);
+extern long double cabsl (long double _Complex);
+
+int
+main (void)
+{
+ /* For each type, test both runtime and compile time (constant folding)
+ optimization. */
+ float _Complex fc = 3.0F + 4.0iF;
+ double _Complex dc = 3.0 + 4.0i;
+ long double _Complex ldc = 3.0L + 4.0iL;
+
+#ifdef HAVE_C99_RUNTIME
+ /* Test floats. */
+ if (cabsf (fc) != 5.0F)
+ link_error ();
+ if (__builtin_cabsf (fc) != 5.0F)
+ link_error ();
+ if (cabsf (3.0F + 4.0iF) != 5.0F)
+ link_error ();
+ if (__builtin_cabsf (3.0F + 4.0iF) != 5.0F)
+ link_error ();
+#endif
+
+ /* Test doubles. */
+ if (cabs (dc) != 5.0)
+ link_error ();
+ if (__builtin_cabs (dc) != 5.0)
+ link_error ();
+ if (cabs (3.0 + 4.0i) != 5.0)
+ link_error ();
+ if (__builtin_cabs (3.0 + 4.0i) != 5.0)
+ link_error ();
+
+#ifdef HAVE_C99_RUNTIME
+ /* Test long doubles. */
+ if (cabsl (ldc) != 5.0L)
+ link_error ();
+ if (__builtin_cabsl (ldc) != 5.0L)
+ link_error ();
+ if (cabsl (3.0L + 4.0iL) != 5.0L)
+ link_error ();
+ if (__builtin_cabsl (3.0L + 4.0iL) != 5.0L)
+ link_error ();
+#endif
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-19.c
new file mode 100644
index 000000000..f0583a978
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-19.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that cabs of a non-complex argument is converted into fabs.
+
+ Written by Roger Sayle, 1st June 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double cabs (__complex__ double);
+float cabsf (__complex__ float);
+long double cabsl (__complex__ long double);
+double fabs (double);
+float fabsf (float);
+long double fabsl (long double);
+
+void link_error (void);
+
+void test (double x)
+{
+ if (cabs (x) != fabs (x))
+ link_error ();
+}
+
+void testf (float x)
+{
+ if (cabsf (x) != fabsf (x))
+ link_error ();
+}
+
+void testl (long double x)
+{
+ if (cabsl (x) != fabsl (x))
+ link_error ();
+}
+
+int main ()
+{
+ test (1.0);
+ testf (1.0f);
+ testl (1.0l);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-2.c
new file mode 100644
index 000000000..b1f31c84a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-2.c
@@ -0,0 +1,227 @@
+/* Copyright (C) 2002 Free Software Foundation.
+
+ Verify that built-in math function constant folding doesn't
+ cause any problems for the compiler.
+
+ Written by Roger Sayle, 16th August 2002. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double atan (double);
+extern float atanf (float);
+extern long double atanl (long double);
+extern double exp (double);
+extern float expf (float);
+extern long double expl (long double);
+extern double fabs (double);
+extern float fabsf (float);
+extern long double fabsl (long double);
+extern double log (double);
+extern float logf (float);
+extern long double logl (long double);
+extern double pow (double, double);
+extern float powf (float, float);
+extern long double powl (long double, long double);
+extern double sqrt (double);
+extern float sqrtf (float);
+extern long double sqrtl (long double);
+extern double tan (double);
+extern float tanf (float);
+extern long double tanl (long double);
+
+double test1(double x)
+{
+ return log(exp(x));
+}
+
+double test2(double x)
+{
+ return exp(log(x));
+}
+
+double test3(double x)
+{
+ return sqrt(exp(x));
+}
+
+double test4(double x)
+{
+ return log(sqrt(x));
+}
+
+double test5(double x, double y)
+{
+ return sqrt(x)*sqrt(y);
+}
+
+double test6(double x, double y)
+{
+ return exp(x)*exp(y);
+}
+
+double test7(double x, double y)
+{
+ return x/exp(y);
+}
+
+double test8(double x)
+{
+ return fabs(sqrt(x));
+}
+
+double test9(double x)
+{
+ return fabs(exp(x));
+}
+
+double test10(double x)
+{
+ return tan(atan(x));
+}
+
+double test11(double x)
+{
+ return fabs(fabs(x));
+}
+
+double test12(double x)
+{
+ return fabs(atan(x));
+}
+
+double test13(double x)
+{
+ return fabs(pow(2.0,x));
+}
+
+float test1f(float x)
+{
+ return logf(expf(x));
+}
+
+float test2f(float x)
+{
+ return expf(logf(x));
+}
+
+float test3f(float x)
+{
+ return sqrtf(expf(x));
+}
+
+float test4f(float x)
+{
+ return logf(sqrtf(x));
+}
+
+float test5f(float x, float y)
+{
+ return sqrtf(x)*sqrtf(y);
+}
+
+float test6f(float x, float y)
+{
+ return expf(x)*expf(y);
+}
+
+float test7f(float x, float y)
+{
+ return x/expf(y);
+}
+
+float test8f(float x)
+{
+ return fabsf(sqrtf(x));
+}
+
+float test9f(float x)
+{
+ return fabsf(expf(x));
+}
+
+float test10f(float x)
+{
+ return tanf(atanf(x));
+}
+
+float test11f(float x)
+{
+ return fabsf(fabsf(x));
+}
+
+float test12f(float x)
+{
+ return fabsf(atanf(x));
+}
+
+float test13f(float x)
+{
+ return fabsf(powf(2.0f,x));
+}
+
+long double test1l(long double x)
+{
+ return logl(expl(x));
+}
+
+long double test2l(long double x)
+{
+ return expl(logl(x));
+}
+
+long double test3l(long double x)
+{
+ return sqrtl(expl(x));
+}
+
+long double test4l(long double x)
+{
+ return logl(sqrtl(x));
+}
+
+long double test5l(long double x, long double y)
+{
+ return sqrtl(x)*sqrtl(y);
+}
+
+long double test6l(long double x, long double y)
+{
+ return expl(x)*expl(y);
+}
+
+long double test7l(long double x, long double y)
+{
+ return x/expl(y);
+}
+
+long double test8l(long double x)
+{
+ return fabsl(sqrtl(x));
+}
+
+long double test9l(long double x)
+{
+ return fabsl(expl(x));
+}
+
+long double test10l(long double x)
+{
+ return tanl(atanl(x));
+}
+
+long double test11l(long double x)
+{
+ return fabsl(fabsl(x));
+}
+
+long double test12l(long double x)
+{
+ return fabsl(atanl(x));
+}
+
+long double test13l(long double x)
+{
+ return fabsl(powl(2.0l,x));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-20.c
new file mode 100644
index 000000000..43aa71b27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-20.c
@@ -0,0 +1,749 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that built-in math function constant folding doesn't break
+ anything and produces the expected results.
+
+ Written by Roger Sayle, 8th June 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+/* { dg-add-options c99_runtime } */
+
+#include "builtins-config.h"
+
+extern double cos (double);
+extern double sin (double);
+extern double tan (double);
+extern double fabs (double);
+extern double atan2 (double, double);
+extern double copysign (double, double);
+extern double fmin (double, double);
+extern double fmax (double, double);
+extern double hypot (double, double);
+extern double pure (double) __attribute__ ((__pure__));
+extern double carg (__complex__ double);
+extern __complex__ double ccos (__complex__ double);
+extern __complex__ double ctan (__complex__ double);
+extern float cosf (float);
+extern float sinf (float);
+extern float tanf (float);
+extern float fabsf (float);
+extern float atan2f (float, float);
+extern float copysignf (float, float);
+extern float fminf (float, float);
+extern float fmaxf (float, float);
+extern float hypotf (float, float);
+extern float puref (float) __attribute__ ((__pure__));
+extern float cargf (__complex__ float);
+extern __complex__ float ccosf (__complex__ float);
+extern __complex__ float ctanf (__complex__ float);
+extern long double cosl (long double);
+extern long double sinl (long double);
+extern long double tanl (long double);
+extern long double fabsl (long double);
+extern long double atan2l (long double, long double);
+extern long double copysignl (long double, long double);
+extern long double fminl (long double, long double);
+extern long double fmaxl (long double, long double);
+extern long double hypotl (long double, long double);
+extern long double purel (long double) __attribute__ ((__pure__));
+extern long double cargl (__complex__ long double);
+extern __complex__ long double ccosl (__complex__ long double);
+extern __complex__ long double ctanl (__complex__ long double);
+
+extern void link_error(void);
+
+void test1(double x)
+{
+ if (cos(x) != cos(-x))
+ link_error ();
+
+ if (cos(x) != cos(fabs(x)))
+ link_error ();
+
+ if (cos(x) != cos(-fabs(x)))
+ link_error ();
+
+ if (cos(tan(x)) != cos(tan(-fabs(x))))
+ link_error ();
+
+ if (sin(x)/cos(x) != tan(x))
+ link_error ();
+
+ if (cos(x)/sin(x) != 1.0/tan(x))
+ link_error ();
+
+ if (tan(x)*cos(x) != sin(x))
+ link_error ();
+
+ if (cos(x)*tan(x) != sin(x))
+ link_error ();
+
+ if (sin(x)/tan(x) != cos(x))
+ link_error ();
+
+ if (tan(x)/sin(x) != 1.0/cos(x))
+ link_error ();
+}
+
+void test2(double x, double y)
+{
+ if (-tan(x-y) != tan(y-x))
+ link_error ();
+
+ if (-sin(x-y) != sin(y-x))
+ link_error ();
+
+ if (cos(-x*y) != cos(x*y))
+ link_error ();
+
+ if (cos(x*-y) != cos(x*y))
+ link_error ();
+
+ if (cos(-x/y) != cos(x/y))
+ link_error ();
+
+ if (cos(x/-y) != cos(x/y))
+ link_error ();
+
+ if (cos(-fabs(tan(x/-y))) != cos(tan(x/y)))
+ link_error ();
+
+ if (cos(y<10 ? -x : y) != cos(y<10 ? x : y))
+ link_error ();
+
+ if (cos(y<10 ? x : -y) != cos(y<10 ? x : y))
+ link_error ();
+
+ if (cos(y<10 ? -fabs(x) : tan(x<20 ? -x : -fabs(y)))
+ != cos(y<10 ? x : tan(x<20 ? x : y)))
+ link_error ();
+
+ if (cos((y*=3, -x)) != cos((y*=3,x)))
+ link_error ();
+
+ if (cos((y*=2, -fabs(tan(x/-y)))) != cos((y*=2,tan(x/y))))
+ link_error ();
+
+ if (cos(copysign(x,y)) != cos(x))
+ link_error ();
+
+ if (cos(copysign(-fabs(x),y*=2)) != cos((y*=2,x)))
+ link_error ();
+
+ if (hypot (x, 0) != fabs(x))
+ link_error ();
+
+ if (hypot (0, x) != fabs(x))
+ link_error ();
+
+ if (hypot (x, x) != fabs(x) * __builtin_sqrt(2))
+ link_error ();
+
+ if (hypot (-x, y) != hypot (x, y))
+ link_error ();
+
+ if (hypot (x, -y) != hypot (x, y))
+ link_error ();
+
+ if (hypot (-x, -y) != hypot (x, y))
+ link_error ();
+
+ if (hypot (fabs(x), y) != hypot (x, y))
+ link_error ();
+
+ if (hypot (x, fabs(y)) != hypot (x, y))
+ link_error ();
+
+ if (hypot (fabs(x), fabs(y)) != hypot (x, y))
+ link_error ();
+
+ if (hypot (-fabs(-x), -fabs(fabs(fabs(-y)))) != hypot (x, y))
+ link_error ();
+
+ if (hypot (-x, 0) != fabs(x))
+ link_error ();
+
+ if (hypot (-x, x) != fabs(x) * __builtin_sqrt(2))
+ link_error ();
+
+ if (hypot (pure(x), -pure(x)) != fabs(pure(x)) * __builtin_sqrt(2))
+ link_error ();
+
+ if (hypot (tan(-x), tan(-fabs(y))) != hypot (tan(x), tan(y)))
+ link_error ();
+
+ if (fmin (fmax(x,y),y) != y)
+ link_error ();
+
+ if (fmin (fmax(y,x),y) != y)
+ link_error ();
+
+ if (fmin (x,fmax(x,y)) != x)
+ link_error ();
+
+ if (fmin (x,fmax(y,x)) != x)
+ link_error ();
+
+ if (fmax (fmin(x,y),y) != y)
+ link_error ();
+
+ if (fmax (fmin(y,x),y) != y)
+ link_error ();
+
+ if (fmax (x,fmin(x,y)) != x)
+ link_error ();
+
+ if (fmax (x,fmin(y,x)) != x)
+ link_error ();
+
+ if ((__complex__ double) x != -(__complex__ double) (-x))
+ link_error ();
+
+ if (x*1i != -(-x*1i))
+ link_error ();
+
+ if (x+(x-y)*1i != -(-x+(y-x)*1i))
+ link_error ();
+
+ if (x+(x-y)*1i != -(-x-(x-y)*1i))
+ link_error ();
+
+ if (ccos(tan(x)+sin(y)*1i) != ccos(-tan(-x)+-sin(-y)*1i))
+ link_error ();
+
+ if (ccos(tan(x)+sin(x-y)*1i) != ccos(-tan(-x)-sin(y-x)*1i))
+ link_error ();
+
+ if (-5+x*1i != -~(5+x*1i))
+ link_error ();
+
+ if (tan(x)+tan(y)*1i != -~(tan(-x)+tan(y)*1i))
+ link_error ();
+}
+
+void test3(__complex__ double x, __complex__ double y, int i)
+{
+ if (carg(x) != atan2(__imag__ x, __real__ x))
+ link_error ();
+
+ if (ccos(x) != ccos(-x))
+ link_error();
+
+ if (ccos(ctan(x)) != ccos(ctan(-x)))
+ link_error();
+
+ if (ctan(x-y) != -ctan(y-x))
+ link_error();
+
+ if (ccos(x/y) != ccos(-x/y))
+ link_error();
+
+ if (ccos(x/y) != ccos(x/-y))
+ link_error();
+
+ if (ccos(x/ctan(y)) != ccos(-x/ctan(-y)))
+ link_error();
+
+ if (ccos(x*y) != ccos(-x*y))
+ link_error();
+
+ if (ccos(x*y) != ccos(x*-y))
+ link_error();
+
+ if (ccos(ctan(x)*y) != ccos(ctan(-x)*-y))
+ link_error();
+
+ if (ccos(ctan(x/y)) != ccos(-ctan(x/-y)))
+ link_error();
+
+ if (ccos(i ? x : y) != ccos(i ? -x : y))
+ link_error();
+
+ if (ccos(i ? x : y) != ccos(i ? x : -y))
+ link_error();
+
+ if (ccos(i ? x : ctan(y/x)) != ccos(i ? -x : -ctan(-y/x)))
+ link_error();
+
+ if (~x != -~-x)
+ link_error();
+
+ if (ccos(~x) != ccos(-~-x))
+ link_error();
+
+ if (ctan(~(x-y)) != -ctan(~(y-x)))
+ link_error();
+
+ if (ctan(~(x/y)) != -ctan(~(x/-y)))
+ link_error();
+}
+
+void test1f(float x)
+{
+ if (cosf(x) != cosf(-x))
+ link_error ();
+
+ if (cosf(x) != cosf(fabsf(x)))
+ link_error ();
+
+ if (cosf(x) != cosf(-fabsf(x)))
+ link_error ();
+
+ if (cosf(tanf(x)) != cosf(tanf(-fabsf(x))))
+ link_error ();
+
+#ifdef HAVE_C99_RUNTIME
+ if (sinf(x)/cosf(x) != tanf(x))
+ link_error ();
+
+ if (cosf(x)/sinf(x) != 1.0f/tanf(x))
+ link_error ();
+
+ if (tanf(x)*cosf(x) != sinf(x))
+ link_error ();
+
+ if (cosf(x)*tanf(x) != sinf(x))
+ link_error ();
+
+ if (sinf(x)/tanf(x) != cosf(x))
+ link_error ();
+
+ if (tanf(x)/sinf(x) != 1.0f/cosf(x))
+ link_error ();
+#endif
+}
+
+void test2f(float x, float y)
+{
+ if (-tanf(x-y) != tanf(y-x))
+ link_error ();
+
+ if (-sinf(x-y) != sinf(y-x))
+ link_error ();
+
+ if (cosf(-x*y) != cosf(x*y))
+ link_error ();
+
+ if (cosf(x*-y) != cosf(x*y))
+ link_error ();
+
+ if (cosf(-x/y) != cosf(x/y))
+ link_error ();
+
+ if (cosf(x/-y) != cosf(x/y))
+ link_error ();
+
+ if (cosf(-fabsf(tanf(x/-y))) != cosf(tanf(x/y)))
+ link_error ();
+
+ if (cosf(y<10 ? -x : y) != cosf(y<10 ? x : y))
+ link_error ();
+
+ if (cosf(y<10 ? x : -y) != cosf(y<10 ? x : y))
+ link_error ();
+
+ if (cosf(y<10 ? -fabsf(x) : tanf(x<20 ? -x : -fabsf(y)))
+ != cosf(y<10 ? x : tanf(x<20 ? x : y)))
+ link_error ();
+
+ if (cosf((y*=3, -x)) != cosf((y*=3,x)))
+ link_error ();
+
+ if (cosf((y*=2, -fabsf(tanf(x/-y)))) != cosf((y*=2,tanf(x/y))))
+ link_error ();
+
+ if (cosf(copysignf(x,y)) != cosf(x))
+ link_error ();
+
+ if (cosf(copysignf(-fabsf(x),y*=2)) != cosf((y*=2,x)))
+ link_error ();
+
+ if (hypotf (x, 0) != fabsf(x))
+ link_error ();
+
+ if (hypotf (0, x) != fabsf(x))
+ link_error ();
+
+ if (hypotf (x, x) != fabsf(x) * __builtin_sqrtf(2))
+ link_error ();
+
+ if (hypotf (-x, y) != hypotf (x, y))
+ link_error ();
+
+ if (hypotf (x, -y) != hypotf (x, y))
+ link_error ();
+
+ if (hypotf (-x, -y) != hypotf (x, y))
+ link_error ();
+
+ if (hypotf (fabsf(x), y) != hypotf (x, y))
+ link_error ();
+
+ if (hypotf (x, fabsf(y)) != hypotf (x, y))
+ link_error ();
+
+ if (hypotf (fabsf(x), fabsf(y)) != hypotf (x, y))
+ link_error ();
+
+ if (hypotf (-fabsf(-x), -fabsf(fabsf(fabsf(-y)))) != hypotf (x, y))
+ link_error ();
+
+ if (hypotf (-x, 0) != fabsf(x))
+ link_error ();
+
+ if (hypotf (-x, x) != fabsf(x) * __builtin_sqrtf(2))
+ link_error ();
+
+ if (hypotf (puref(x), -puref(x)) != fabsf(puref(x)) * __builtin_sqrtf(2))
+ link_error ();
+
+ if (hypotf (tanf(-x), tanf(-fabsf(y))) != hypotf (tanf(x), tanf(y)))
+ link_error ();
+
+ if (fminf (fmaxf(x,y),y) != y)
+ link_error ();
+
+ if (fminf (fmaxf(y,x),y) != y)
+ link_error ();
+
+ if (fminf (x,fmaxf(x,y)) != x)
+ link_error ();
+
+ if (fminf (x,fmaxf(y,x)) != x)
+ link_error ();
+
+ if (fmaxf (fminf(x,y),y) != y)
+ link_error ();
+
+ if (fmaxf (fminf(y,x),y) != y)
+ link_error ();
+
+ if (fmaxf (x,fminf(x,y)) != x)
+ link_error ();
+
+ if (fmaxf (x,fminf(y,x)) != x)
+ link_error ();
+
+ if ((__complex__ float) x != -(__complex__ float) (-x))
+ link_error ();
+
+ if (x+(x-y)*1i != -(-x+(y-x)*1i))
+ link_error ();
+
+ if (x+(x-y)*1i != -(-x-(x-y)*1i))
+ link_error ();
+
+ if (ccosf(tanf(x)+sinf(y)*1i) != ccosf(-tanf(-x)+-sinf(-y)*1i))
+ link_error ();
+
+ if (ccosf(tanf(x)+sinf(x-y)*1i) != ccosf(-tanf(-x)-sinf(y-x)*1i))
+ link_error ();
+
+ if (-5+x*1i != -~(5+x*1i))
+ link_error ();
+
+ if (tanf(x)+tanf(y)*1i != -~(tanf(-x)+tanf(y)*1i))
+ link_error ();
+}
+
+void test3f(__complex__ float x, __complex__ float y, int i)
+{
+ if (ccosf(x) != ccosf(-x))
+ link_error();
+
+ if (ccosf(ctanf(x)) != ccosf(ctanf(-x)))
+ link_error();
+
+ if (ctanf(x-y) != -ctanf(y-x))
+ link_error();
+
+ if (ccosf(x/y) != ccosf(-x/y))
+ link_error();
+
+ if (ccosf(x/y) != ccosf(x/-y))
+ link_error();
+
+ if (ccosf(x/ctanf(y)) != ccosf(-x/ctanf(-y)))
+ link_error();
+
+ if (ccosf(x*y) != ccosf(-x*y))
+ link_error();
+
+ if (ccosf(x*y) != ccosf(x*-y))
+ link_error();
+
+ if (ccosf(ctanf(x)*y) != ccosf(ctanf(-x)*-y))
+ link_error();
+
+ if (ccosf(ctanf(x/y)) != ccosf(-ctanf(x/-y)))
+ link_error();
+
+ if (ccosf(i ? x : y) != ccosf(i ? -x : y))
+ link_error();
+
+ if (ccosf(i ? x : y) != ccosf(i ? x : -y))
+ link_error();
+
+ if (ccosf(i ? x : ctanf(y/x)) != ccosf(i ? -x : -ctanf(-y/x)))
+ link_error();
+
+ if (~x != -~-x)
+ link_error();
+
+ if (ccosf(~x) != ccosf(-~-x))
+ link_error();
+
+ if (ctanf(~(x-y)) != -ctanf(~(y-x)))
+ link_error();
+
+ if (ctanf(~(x/y)) != -ctanf(~(x/-y)))
+ link_error();
+
+#ifdef HAVE_C99_RUNTIME
+ if (cargf(x) != atan2f(__imag__ x, __real__ x))
+ link_error ();
+#endif
+}
+
+void test1l(long double x)
+{
+ if (cosl(x) != cosl(-x))
+ link_error ();
+
+ if (cosl(x) != cosl(fabsl(x)))
+ link_error ();
+
+ if (cosl(x) != cosl(-fabsl(x)))
+ link_error ();
+
+ if (cosl(tanl(x)) != cosl(tanl(-fabsl(x))))
+ link_error ();
+
+#ifdef HAVE_C99_RUNTIME
+ if (sinl(x)/cosl(x) != tanl(x))
+ link_error ();
+
+ if (cosl(x)/sinl(x) != 1.0l/tanl(x))
+ link_error ();
+
+ if (tanl(x)*cosl(x) != sinl(x))
+ link_error ();
+
+ if (cosl(x)*tanl(x) != sinl(x))
+ link_error ();
+
+ if (sinl(x)/tanl(x) != cosl(x))
+ link_error ();
+
+ if (tanl(x)/sinl(x) != 1.0l/cosl(x))
+ link_error ();
+#endif
+}
+
+void test2l(long double x, long double y)
+{
+ if (-tanl(x-y) != tanl(y-x))
+ link_error ();
+
+ if (-sinl(x-y) != sinl(y-x))
+ link_error ();
+
+ if (cosl(-x*y) != cosl(x*y))
+ link_error ();
+
+ if (cosl(x*-y) != cosl(x*y))
+ link_error ();
+
+ if (cosl(-x/y) != cosl(x/y))
+ link_error ();
+
+ if (cosl(x/-y) != cosl(x/y))
+ link_error ();
+
+ if (cosl(-fabsl(tanl(x/-y))) != cosl(tanl(x/y)))
+ link_error ();
+
+ if (cosl(y<10 ? -x : y) != cosl(y<10 ? x : y))
+ link_error ();
+
+ if (cosl(y<10 ? x : -y) != cosl(y<10 ? x : y))
+ link_error ();
+
+ if (cosl(y<10 ? -fabsl(x) : tanl(x<20 ? -x : -fabsl(y)))
+ != cosl(y<10 ? x : tanl(x<20 ? x : y)))
+ link_error ();
+
+ if (cosl((y*=3, -x)) != cosl((y*=3,x)))
+ link_error ();
+
+ if (cosl((y*=2, -fabsl(tanl(x/-y)))) != cosl((y*=2,tanl(x/y))))
+ link_error ();
+
+ if (cosl(copysignl(x,y)) != cosl(x))
+ link_error ();
+
+ if (cosl(copysignl(-fabsl(x),y*=2)) != cosl((y*=2,x)))
+ link_error ();
+
+ if (hypotl (x, 0) != fabsl(x))
+ link_error ();
+
+ if (hypotl (0, x) != fabsl(x))
+ link_error ();
+
+ if (hypotl (x, x) != fabsl(x) * __builtin_sqrtl(2))
+ link_error ();
+
+ if (hypotl (-x, y) != hypotl (x, y))
+ link_error ();
+
+ if (hypotl (x, -y) != hypotl (x, y))
+ link_error ();
+
+ if (hypotl (-x, -y) != hypotl (x, y))
+ link_error ();
+
+ if (hypotl (fabsl(x), y) != hypotl (x, y))
+ link_error ();
+
+ if (hypotl (x, fabsl(y)) != hypotl (x, y))
+ link_error ();
+
+ if (hypotl (fabsl(x), fabsl(y)) != hypotl (x, y))
+ link_error ();
+
+ if (hypotl (-fabsl(-x), -fabsl(fabsl(fabsl(-y)))) != hypotl (x, y))
+ link_error ();
+
+ if (hypotl (-x, 0) != fabsl(x))
+ link_error ();
+
+ if (hypotl (-x, x) != fabsl(x) * __builtin_sqrtl(2))
+ link_error ();
+
+ if (hypotl (purel(x), -purel(x)) != fabsl(purel(x)) * __builtin_sqrtl(2))
+ link_error ();
+
+ if (hypotl (tanl(-x), tanl(-fabsl(y))) != hypotl (tanl(x), tanl(y)))
+ link_error ();
+
+ if (fminl (fmaxl(x,y),y) != y)
+ link_error ();
+
+ if (fminl (fmaxl(y,x),y) != y)
+ link_error ();
+
+ if (fminl (x,fmaxl(x,y)) != x)
+ link_error ();
+
+ if (fminl (x,fmaxl(y,x)) != x)
+ link_error ();
+
+ if (fmaxl (fminl(x,y),y) != y)
+ link_error ();
+
+ if (fmaxl (fminl(y,x),y) != y)
+ link_error ();
+
+ if (fmaxl (x,fminl(x,y)) != x)
+ link_error ();
+
+ if (fmaxl (x,fminl(y,x)) != x)
+ link_error ();
+
+ if ((__complex__ long double) x != -(__complex__ long double) (-x))
+ link_error ();
+
+ if (x+(x-y)*1i != -(-x+(y-x)*1i))
+ link_error ();
+
+ if (x+(x-y)*1i != -(-x-(x-y)*1i))
+ link_error ();
+
+ if (ccosl(tanl(x)+sinl(y)*1i) != ccosl(-tanl(-x)+-sinl(-y)*1i))
+ link_error ();
+
+ if (ccosl(tanl(x)+sinl(x-y)*1i) != ccosl(-tanl(-x)-sinl(y-x)*1i))
+ link_error ();
+
+ if (-5+x*1i != -~(5+x*1i))
+ link_error ();
+
+ if (tanl(x)+tanl(y)*1i != -~(tanl(-x)+tanl(y)*1i))
+ link_error ();
+}
+
+void test3l(__complex__ long double x, __complex__ long double y, int i)
+{
+ if (ccosl(x) != ccosl(-x))
+ link_error();
+
+ if (ccosl(ctanl(x)) != ccosl(ctanl(-x)))
+ link_error();
+
+ if (ctanl(x-y) != -ctanl(y-x))
+ link_error();
+
+ if (ccosl(x/y) != ccosl(-x/y))
+ link_error();
+
+ if (ccosl(x/y) != ccosl(x/-y))
+ link_error();
+
+ if (ccosl(x/ctanl(y)) != ccosl(-x/ctanl(-y)))
+ link_error();
+
+ if (ccosl(x*y) != ccosl(-x*y))
+ link_error();
+
+ if (ccosl(x*y) != ccosl(x*-y))
+ link_error();
+
+ if (ccosl(ctanl(x)*y) != ccosl(ctanl(-x)*-y))
+ link_error();
+
+ if (ccosl(ctanl(x/y)) != ccosl(-ctanl(x/-y)))
+ link_error();
+
+ if (ccosl(i ? x : y) != ccosl(i ? -x : y))
+ link_error();
+
+ if (ccosl(i ? x : y) != ccosl(i ? x : -y))
+ link_error();
+
+ if (ccosl(i ? x : ctanl(y/x)) != ccosl(i ? -x : -ctanl(-y/x)))
+ link_error();
+
+ if (~x != -~-x)
+ link_error();
+
+ if (ccosl(~x) != ccosl(-~-x))
+ link_error();
+
+ if (ctanl(~(x-y)) != -ctanl(~(y-x)))
+ link_error();
+
+ if (ctanl(~(x/y)) != -ctanl(~(x/-y)))
+ link_error();
+
+#ifdef HAVE_C99_RUNTIME
+ if (cargl(x) != atan2l(__imag__ x, __real__ x))
+ link_error ();
+#endif
+}
+
+int main()
+{
+ test1 (1.0);
+ test2 (1.0, 2.0);
+
+ test1f (1.0f);
+ test2f (1.0f, 2.0f);
+
+ test1l (1.0l);
+ test2l (1.0l, 2.0l);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-21.c
new file mode 100644
index 000000000..60b127fe6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-21.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that built-in math function constant folding doesn't
+ cause any problems for the compiler.
+
+ Written by Roger Sayle, 7th June 2003. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double fabs (double);
+extern float fabsf (float);
+extern long double fabsl (long double);
+extern double sqrt (double);
+extern float sqrtf (float);
+extern long double sqrtl (long double);
+extern double exp (double);
+extern float expf (float);
+extern long double expl (long double);
+
+double test1(double x)
+{
+ return fabs(x*x);
+}
+
+double test2(double x)
+{
+ return fabs(sqrt(x)+2.0);
+}
+
+double test3(double x)
+{
+ return fabs(3.0*exp(x));
+}
+
+float test1f(float x)
+{
+ return fabsf(x*x);
+}
+
+float test2f(float x)
+{
+ return fabsf(sqrtf(x)+2.0f);
+}
+
+float test3f(float x)
+{
+ return fabsf(3.0f*expf(x));
+}
+
+long double test1l(long double x)
+{
+ return fabsl(x*x);
+}
+
+long double test2l(long double x)
+{
+ return fabsl(sqrtl(x)+2.0l);
+}
+
+long double test3l(long double x)
+{
+ return fabsl(3.0l*expl(x));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-22.c
new file mode 100644
index 000000000..916890b40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-22.c
@@ -0,0 +1,12 @@
+/* Related to PR optimization/10764 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double exp(double x);
+
+double foo(double x)
+{
+ return exp(exp(x));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-23.c
new file mode 100644
index 000000000..f463e17e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-23.c
@@ -0,0 +1,12 @@
+/* Related to PR optimization/10764 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double atan(double x);
+
+double foo(double x)
+{
+ return atan(atan(x));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-24.c
new file mode 100644
index 000000000..41ec1889f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-24.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that the RTL expansion of floating point exponentiation by
+ a constant integer doesn't break anything and produces the expected
+ results.
+
+ Written by Roger Sayle, 20th June 2003. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double pow(double,double);
+extern void abort(void);
+
+double foo (double x)
+{
+ return pow (x, 6);
+}
+
+double bar (double x)
+{
+ return pow (x, -4);
+}
+
+int main()
+{
+ if (foo (2.0) != 64.0)
+ abort ();
+
+ if (bar (2.0) != 0.0625)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-26.c
new file mode 100644
index 000000000..c4d03cd7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-26.c
@@ -0,0 +1,105 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of built-in math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Roger Sayle, 28th June 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+extern double trunc(double);
+extern double floor(double);
+extern double ceil(double);
+
+extern float truncf(float);
+extern float floorf(float);
+extern float ceilf(float);
+
+extern long double truncl(long double);
+extern long double floorl(long double);
+extern long double ceill(long double);
+
+void test(double x)
+{
+ if (trunc (trunc (x)) != trunc (x))
+ link_error ();
+ if (trunc (floor (x)) != floor (x))
+ link_error ();
+ if (trunc (ceil (x)) != ceil (x))
+ link_error ();
+
+ if (floor (trunc (x)) != trunc (x))
+ link_error ();
+ if (floor (floor (x)) != floor (x))
+ link_error ();
+ if (floor (ceil (x)) != ceil (x))
+ link_error ();
+
+ if (ceil (trunc (x)) != trunc (x))
+ link_error ();
+ if (ceil (floor (x)) != floor (x))
+ link_error ();
+ if (ceil (ceil (x)) != ceil (x))
+ link_error ();
+}
+
+void testf(float x)
+{
+ if (truncf (truncf (x)) != truncf (x))
+ link_error ();
+ if (truncf (floorf (x)) != floorf (x))
+ link_error ();
+ if (truncf (ceilf (x)) != ceilf (x))
+ link_error ();
+
+ if (floorf (truncf (x)) != truncf (x))
+ link_error ();
+ if (floorf (floorf (x)) != floorf (x))
+ link_error ();
+ if (floorf (ceilf (x)) != ceilf (x))
+ link_error ();
+
+ if (ceilf (truncf (x)) != truncf (x))
+ link_error ();
+ if (ceilf (floorf (x)) != floorf (x))
+ link_error ();
+ if (ceilf (ceilf (x)) != ceilf (x))
+ link_error ();
+}
+
+void testl(long double x)
+{
+ if (truncl (truncl (x)) != truncl (x))
+ link_error ();
+ if (truncl (floorl (x)) != floorl (x))
+ link_error ();
+ if (truncl (ceill (x)) != ceill (x))
+ link_error ();
+
+ if (floorl (truncl (x)) != truncl (x))
+ link_error ();
+ if (floorl (floorl (x)) != floorl (x))
+ link_error ();
+ if (floorl (ceill (x)) != ceill (x))
+ link_error ();
+
+ if (ceill (truncl (x)) != truncl (x))
+ link_error ();
+ if (ceill (floorl (x)) != floorl (x))
+ link_error ();
+ if (ceill (ceill (x)) != ceill (x))
+ link_error ();
+}
+
+
+int main()
+{
+ test (3.2);
+ testf (3.2f);
+ testl (3.2l);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-27.c
new file mode 100644
index 000000000..69d8f9944
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-27.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of built-in math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Roger Sayle, 29th July 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void link_error(void);
+
+extern double pow(double,double);
+
+void test(double x)
+{
+ if (pow(x,2.0) != x*x)
+ link_error ();
+
+ if (x*pow(x,2.0) != pow(x,3.0))
+ link_error ();
+
+ if (pow(x,2.0)*x != pow(x,3.0))
+ link_error ();
+
+ if (pow(x,3.0) != x*x*x)
+ link_error ();
+
+ if (pow(x,2.0)*x != x*x*x)
+ link_error ();
+
+ if (x*pow(x,2.0) != x*x*x)
+ link_error ();
+
+ if (pow(x,3.0)/x != pow(x,2.0))
+ link_error ();
+
+ if (pow(x,3.0)/x != x*x)
+ link_error ();
+}
+
+int main()
+{
+ test (2.0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-28.c
new file mode 100644
index 000000000..bd76d6b97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-28.c
@@ -0,0 +1,27 @@
+/* Test that creal and cimag built-in functions do not return lvalues. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern float crealf (float _Complex);
+extern double creal (double _Complex);
+extern long double creall (long double _Complex);
+
+extern float cimagf (float _Complex);
+extern double cimag (double _Complex);
+extern long double cimagl (long double _Complex);
+
+float _Complex fc;
+double _Complex dc;
+long double _Complex ldc;
+
+void
+foo (void)
+{
+ crealf (fc) = 0; /* { dg-error "lvalue" "crealf not lvalue" } */
+ cimagf (fc) = 0; /* { dg-error "lvalue" "cimagf not lvalue" } */
+ creal (dc) = 0; /* { dg-error "lvalue" "creal not lvalue" } */
+ cimag (dc) = 0; /* { dg-error "lvalue" "cimag not lvalue" } */
+ creall (ldc) = 0; /* { dg-error "lvalue" "creall not lvalue" } */
+ cimagl (ldc) = 0; /* { dg-error "lvalue" "cimagl not lvalue" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-30.c
new file mode 100644
index 000000000..37e5dba2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-30.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wshadow -fshow-column" } */
+
+extern double strtod (const char *, char **);
+#define UNUSED __attribute__ ((unused))
+
+/* A built-in function may be overridden by an old-style definition
+ specifying too few arguments... */
+double cos () /* { dg-warning "shadows a built-in|number of arguments" } */
+{
+ return strtod ("nan", 0);
+}
+
+/* the right number, but the wrong type, arguments... */
+double sin (foo) /* { dg-warning "8:shadows a built-in" } */
+ int foo UNUSED; /* { dg-warning "10:argument 'foo' doesn't match built-in prototype" } */
+{
+ return strtod ("nan", 0);
+}
+
+/* or too many arguments. */
+long double cosl (foo, bar) /* { dg-warning "shadows a built-in|number of arguments" } */
+ const char *foo UNUSED; /* { dg-warning "18:argument 'foo' doesn't match" } */
+ int bar UNUSED;
+{
+ return strtod ("nan", 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-31.c
new file mode 100644
index 000000000..6e1bda0b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-31.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that constant folding of signbit, signbitf and signbitl math
+ functions doesn't break anything and produces the expected results.
+
+ Written by Roger Sayle, 28th January 2004. */
+
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error(void);
+
+extern int signbit(double);
+extern int signbitf(float);
+extern int signbitl(long double);
+
+int main()
+{
+ if (signbit (1.0) != 0)
+ link_error ();
+ if (signbit (-2.0) == 0)
+ link_error ();
+
+ if (signbitf (1.0f) != 0)
+ link_error ();
+ if (signbitf (-2.0f) == 0)
+ link_error ();
+
+ if (signbitl (1.0l) != 0)
+ link_error ();
+ if (signbitl (-2.0f) == 0)
+ link_error ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-32.c
new file mode 100644
index 000000000..3d2a36190
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-32.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that constant folding of signbit, signbitf and signbitl math
+ functions doesn't break anything and produces the expected results.
+
+ Written by Roger Sayle, 28th January 2004. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort(void);
+
+extern int signbit(double);
+extern int signbitf(float);
+extern int signbitl(long double);
+
+int test (double x)
+{
+ return signbit(x);
+}
+
+int testf (float x)
+{
+ return signbitf(x);
+}
+
+int testl (long double x)
+{
+ return signbitl(x);
+}
+
+
+int main()
+{
+ if (test (0.0) != 0)
+ abort ();
+ if (test (1.0) != 0)
+ abort ();
+ if (test (-2.0) == 0)
+ abort ();
+
+ if (testf (0.0f) != 0)
+ abort ();
+ if (testf (1.0f) != 0)
+ abort ();
+ if (testf (-2.0f) == 0)
+ abort ();
+
+ if (testl (0.0l) != 0)
+ abort ();
+ if (testl (1.0l) != 0)
+ abort ();
+ if (testl (-2.0l) == 0)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-33.c
new file mode 100644
index 000000000..11393e300
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-33.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that log10, log10f, log10l, log2, log2f and log2l
+ built-in functions compile.
+
+ Written by Uros Bizjak, 11th February 2004. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double log10(double);
+extern double log2(double);
+extern double log1p(double);
+extern float log10f(float);
+extern float log2f(float);
+extern float log1pf(float);
+extern long double log10l(long double);
+extern long double log2l(long double);
+extern long double log1pl(long double);
+
+
+double test1(double x)
+{
+ return log10(x);
+}
+
+double test2(double x)
+{
+ return log2(x);
+}
+
+double test3(double x)
+{
+ return log1p(x);
+}
+
+float test1f(float x)
+{
+ return log10f(x);
+}
+
+float test2f(float x)
+{
+ return log2f(x);
+}
+
+float test3f(float x)
+{
+ return log1pf(x);
+}
+
+long double test1l(long double x)
+{
+ return log10l(x);
+}
+
+long double test2l(long double x)
+{
+ return log2l(x);
+}
+
+long double test3l(long double x)
+{
+ return log1pl(x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-34.c
new file mode 100644
index 000000000..e348a1ca9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-34.c
@@ -0,0 +1,172 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that various built-in functions compile.
+
+ Written by Uros Bizjak, 13th February 2004. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double exp10(double);
+extern double exp2(double);
+extern double pow10(double);
+extern double expm1(double);
+extern double ldexp(double, int);
+extern double scalb(double, double);
+extern double scalbn(double, int);
+extern double scalbln(double, long);
+extern double significand(double);
+extern float exp10f(float);
+extern float exp2f(float);
+extern float pow10f(float);
+extern float expm1f(float);
+extern float ldexpf(float, int);
+extern float scalbf(float, float);
+extern float scalbnf(float, int);
+extern float scalblnf(float, long);
+extern float significandf(float);
+extern long double exp10l(long double);
+extern long double exp2l(long double);
+extern long double pow10l(long double);
+extern long double expm1l(long double);
+extern long double ldexpl(long double, int);
+extern long double scalbl(long double, long double);
+extern long double scalbnl(long double, int);
+extern long double scalblnl(long double, long);
+extern long double significandl(long double);
+
+
+double test1(double x)
+{
+ return exp10(x);
+}
+
+double test2(double x)
+{
+ return exp2(x);
+}
+
+double test3(double x)
+{
+ return pow10(x);
+}
+
+double test4(double x)
+{
+ return expm1(x);
+}
+
+double test5(double x, int exp)
+{
+ return ldexp(x, exp);
+}
+
+double test6(double x, double exp)
+{
+ return scalb(x, exp);
+}
+
+double test7(double x, int exp)
+{
+ return scalbn(x, exp);
+}
+
+double test8(double x, long exp)
+{
+ return scalbln(x, exp);
+}
+
+double test9(double x)
+{
+ return significand(x);
+}
+
+float test1f(float x)
+{
+ return exp10f(x);
+}
+
+float test2f(float x)
+{
+ return exp2f(x);
+}
+
+float test3f(float x)
+{
+ return pow10f(x);
+}
+
+float test4f(float x)
+{
+ return expm1f(x);
+}
+
+float test5f(float x, int exp)
+{
+ return ldexpf(x, exp);
+}
+
+float test6f(float x, float exp)
+{
+ return scalbf(x, exp);
+}
+
+float test7f(float x, int exp)
+{
+ return scalbnf(x, exp);
+}
+
+float test8f(float x, long exp)
+{
+ return scalblnf(x, exp);
+}
+
+float test9f(float x)
+{
+ return significandf(x);
+}
+
+long double test1l(long double x)
+{
+ return exp10l(x);
+}
+
+long double test2l(long double x)
+{
+ return exp2l(x);
+}
+
+long double test3l(long double x)
+{
+ return pow10l(x);
+}
+
+long double test4l(long double x)
+{
+ return expm1l(x);
+}
+
+long double test5l(long double x, int exp)
+{
+ return ldexpl(x, exp);
+}
+
+long double test6l(long double x, long double exp)
+{
+ return scalbl(x, exp);
+}
+
+long double test7l(long double x, int exp)
+{
+ return scalbnl(x, exp);
+}
+
+long double test8l(long double x, long exp)
+{
+ return scalblnl(x, exp);
+}
+
+long double test9l(long double x)
+{
+ return significandl(x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-35.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-35.c
new file mode 100644
index 000000000..f898707e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-35.c
@@ -0,0 +1,6 @@
+/* Test that nan functions are not built-in in C90 mode. Bug 14635. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=c89" } */
+
+int nan, nanf, nanl, nans, nansf, nansl;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-36.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-36.c
new file mode 100644
index 000000000..dc7119884
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-36.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check sin, sinf, sinl, cos, cosf and cosl built-in functions
+ eventually compile to sincos, sincosf and sincosl.
+
+ Written by Uros Bizjak, 5th April 2004. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double sin(double);
+extern float sinf(float);
+extern long double sinl(long double);
+
+extern double cos(double);
+extern float cosf(float);
+extern long double cosl(long double);
+
+
+double test1(double x)
+{
+ double y1, y2;
+
+ y1 = sin(x);
+ y2 = cos(x);
+
+ return y1 - y2;
+}
+
+float test1f(float x)
+{
+ float y1, y2;
+
+ y1 = sinf(x);
+ y2 = cosf(x);
+
+ return y1 - y2;
+}
+
+long double test1l(long double x)
+{
+ long double y1, y2;
+
+ y1 = sinl(x);
+ y2 = cosl(x);
+
+ return y1 - y2;
+}
+
+double test2(double x)
+{
+ return sin(x);
+}
+
+float test2f(float x)
+{
+ return sinf(x);
+}
+
+long double test2l(long double x)
+{
+ return sinl(x);
+}
+
+double test3(double x)
+{
+ return cos(x);
+}
+
+float test3f(float x)
+{
+ return cosf(x);
+}
+
+long double test3l(long double x)
+{
+ return cosl(x);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-37.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-37.c
new file mode 100644
index 000000000..e366a6ac5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-37.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check tan, tanf and tanl built-in functions.
+
+ Written by Uros Bizjak, 7th April 2004. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double tan(double);
+extern float tanf(float);
+extern long double tanl(long double);
+
+
+double test1(double x)
+{
+ return tan(x);
+}
+
+float test1f(float x)
+{
+ return tanf(x);
+}
+
+long double test1l(long double x)
+{
+ return tanl(x);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-38.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-38.c
new file mode 100644
index 000000000..210516bb7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-38.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that logb, logbf, logbl, ilogb, ilogbf and ilogbl
+ built-in functions compile.
+
+ Written by Uros Bizjak, 14th April 2004. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double logb(double);
+extern float logbf(float);
+extern long double logbl(long double);
+extern int ilogb(double);
+extern int ilogbf(float);
+extern int ilogbl(long double);
+
+
+double test1(double x)
+{
+ return logb(x);
+}
+
+float test1f(float x)
+{
+ return logbf(x);
+}
+
+long double test1l(long double x)
+{
+ return logbl(x);
+}
+
+int test2(double x)
+{
+ return ilogb(x);
+}
+
+int test2f(float x)
+{
+ return ilogbf(x);
+}
+
+int test2l(long double x)
+{
+ return ilogbl(x);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-39.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-39.c
new file mode 100644
index 000000000..6359be2b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-39.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that asin, asinf, asinl, acos, acosf
+ and acosl built-in functions compile.
+
+ Written by Uros Bizjak, 20th April 2004. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double asin(double);
+extern double acos(double);
+extern float asinf(float);
+extern float acosf(float);
+extern long double asinl(long double);
+extern long double acosl(long double);
+
+
+double test1(double x)
+{
+ return asin(x);
+}
+
+double test2(double x)
+{
+ return acos(x);
+}
+
+float test1f(float x)
+{
+ return asinf(x);
+}
+
+float test2f(float x)
+{
+ return acosf(x);
+}
+
+long double test1l(long double x)
+{
+ return asinl(x);
+}
+
+long double test2l(long double x)
+{
+ return acosl(x);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-40.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-40.c
new file mode 100644
index 000000000..982175a3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-40.c
@@ -0,0 +1,68 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that fmod, fmodf, fmodl, drem, dremf, dreml,
+ remainder, remainderf and remainderl
+ built-in functions compile.
+
+ Written by Uros Bizjak, 5th May 2004. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern double fmod(double, double);
+extern float fmodf(float, float);
+extern long double fmodl(long double, long double);
+
+extern double remainder(double, double);
+extern float remainderf(float, float);
+extern long double remainderl(long double, long double);
+
+extern double drem(double, double);
+extern float dremf(float, float);
+extern long double dreml(long double, long double);
+
+
+double test1(double x, double y)
+{
+ return fmod(x, y);
+}
+
+float test1f(float x, float y)
+{
+ return fmodf(x, y);
+}
+
+long double test1l(long double x, long double y)
+{
+ return fmodl(x, y);
+}
+
+double test2(double x, double y)
+{
+ return remainder(x, y);
+}
+
+float test2f(float x, float y)
+{
+ return remainderf(x, y);
+}
+
+long double test2l(long double x, long double y)
+{
+ return remainderl(x, y);
+}
+
+double test3(double x, double y)
+{
+ return drem(x, y);
+}
+
+float test3f(float x, float y)
+{
+ return dremf(x, y);
+}
+
+long double test3l(long double x, long double y)
+{
+ return dreml(x, y);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-41.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-41.c
new file mode 100644
index 000000000..5b96551fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-41.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that constant folding of copysign, copysignf and copysignl math
+ functions doesn't break anything and produces the expected results.
+
+ Written by Roger Sayle, 6th June 2004. */
+
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error(void);
+
+extern double copysign(double, double);
+extern float copysignf(float, float);
+extern long double copysignl(long double, long double);
+
+int main()
+{
+ if (copysign (2.0, 1.0) != 2.0)
+ link_error ();
+ if (copysign (2.0, -1.0) != -2.0)
+ link_error ();
+ if (copysign (-2.0, 1.0) != 2.0)
+ link_error ();
+ if (copysign (-2.0, -1.0) != -2.0)
+ link_error ();
+
+ if (copysign (2.0, 1.0) != 2.0)
+ link_error ();
+ if (copysign (2.0, -1.0) != -2.0)
+ link_error ();
+ if (copysign (-2.0, 1.0) != 2.0)
+ link_error ();
+ if (copysign (-2.0, -1.0) != -2.0)
+ link_error ();
+
+ if (copysignf (2.0f, 1.0f) != 2.0f)
+ link_error ();
+ if (copysignf (2.0f, -1.0f) != -2.0f)
+ link_error ();
+ if (copysignf (-2.0f, 1.0f) != 2.0f)
+ link_error ();
+ if (copysignf (-2.0f, -1.0f) != -2.0f)
+ link_error ();
+
+ if (copysignl (2.0l, 1.0l) != 2.0l)
+ link_error ();
+ if (copysignl (2.0l, -1.0l) != -2.0l)
+ link_error ();
+ if (copysignl (-2.0l, 1.0l) != 2.0l)
+ link_error ();
+ if (copysignl (-2.0l, -1.0l) != -2.0l)
+ link_error ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-43.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-43.c
new file mode 100644
index 000000000..85d96b6cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-43.c
@@ -0,0 +1,59 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-trapping-math -fno-finite-math-only -fdump-tree-gimple -fdump-tree-optimized" } */
+
+extern void f(int);
+extern void link_error ();
+
+extern float x;
+extern double y;
+extern long double z;
+
+int
+main ()
+{
+ double nan = __builtin_nan ("");
+#ifndef __SPU__
+ /* The SPU single-precision floating point format does not support NANs. */
+ float nanf = __builtin_nanf ("");
+#endif
+ long double nanl = __builtin_nanl ("");
+
+ if (!__builtin_isnan (nan))
+ link_error ();
+#ifndef __SPU__
+ if (!__builtin_isnan (nanf))
+ link_error ();
+ if (!__builtin_isnanf (nanf))
+ link_error ();
+#endif
+ if (!__builtin_isnan (nanl))
+ link_error ();
+ if (!__builtin_isnanl (nanl))
+ link_error ();
+
+ if (__builtin_isnan (4.0))
+ link_error ();
+ if (__builtin_isnan (4.0))
+ link_error ();
+ if (__builtin_isnanf (4.0))
+ link_error ();
+ if (__builtin_isnan (4.0))
+ link_error ();
+ if (__builtin_isnanl (4.0))
+ link_error ();
+
+ f (__builtin_isnan (x));
+ f (__builtin_isnan (y));
+ f (__builtin_isnanf (y));
+ f (__builtin_isnan (z));
+ f (__builtin_isnanl (z));
+}
+
+
+/* Check that all instances of __builtin_isnan were folded. */
+/* { dg-final { scan-tree-dump-times "isnan" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
+
+/* Check that all instances of link_error were subject to DCE. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-44.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-44.c
new file mode 100644
index 000000000..1f1eaf0f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-44.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-trapping-math -fno-finite-math-only -fdump-tree-optimized" } */
+
+extern void f(int);
+extern void link_error ();
+
+extern float x;
+extern double y;
+extern long double z;
+
+int
+main ()
+{
+ double pinf = __builtin_inf ();
+#ifndef __SPU__
+ /* The SPU single-precision floating point format does not support Inf. */
+ float pinff = __builtin_inff ();
+#endif
+ long double pinfl = __builtin_infl ();
+
+ if (__builtin_isinf (pinf) != 1)
+ link_error ();
+#ifndef __SPU__
+ if (__builtin_isinf (pinff) != 1)
+ link_error ();
+ if (__builtin_isinff (pinff) != 1)
+ link_error ();
+#endif
+ if (__builtin_isinf (pinfl) != 1)
+ link_error ();
+ if (__builtin_isinfl (pinfl) != 1)
+ link_error ();
+
+ if (__builtin_isinf_sign (-pinf) != -1)
+ link_error ();
+#ifndef __SPU__
+ if (__builtin_isinf_sign (-pinff) != -1)
+ link_error ();
+#endif
+ if (__builtin_isinf_sign (-pinfl) != -1)
+ link_error ();
+
+ if (__builtin_isinf (4.0))
+ link_error ();
+ if (__builtin_isinf (4.0))
+ link_error ();
+ if (__builtin_isinff (4.0))
+ link_error ();
+ if (__builtin_isinf (4.0))
+ link_error ();
+ if (__builtin_isinfl (4.0))
+ link_error ();
+}
+
+
+/* Check that all instances of link_error were subject to DCE. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-45.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-45.c
new file mode 100644
index 000000000..15ec33af6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-45.c
@@ -0,0 +1,57 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-trapping-math -fno-finite-math-only -fdump-tree-optimized" } */
+
+extern void f(int);
+extern void link_error ();
+
+extern float x;
+extern double y;
+extern long double z;
+
+int
+main ()
+{
+ double nan = __builtin_nan ("");
+#ifndef __SPU__
+ /* The SPU single-precision floating point format does not support NANs. */
+ float nanf = __builtin_nanf ("");
+#endif
+ long double nanl = __builtin_nanl ("");
+
+ double pinf = __builtin_inf ();
+#ifndef __SPU__
+ /* The SPU single-precision floating point format does not support Inf. */
+ float pinff = __builtin_inff ();
+#endif
+ long double pinfl = __builtin_infl ();
+
+ if (__builtin_finite (pinf))
+ link_error ();
+#ifndef __SPU__
+ if (__builtin_finitef (pinff))
+ link_error ();
+#endif
+ if (__builtin_finitel (pinfl))
+ link_error ();
+
+ if (__builtin_finite (nan))
+ link_error ();
+#ifndef __SPU__
+ if (__builtin_finitef (nanf))
+ link_error ();
+#endif
+ if (__builtin_finitel (nanl))
+ link_error ();
+
+ if (!__builtin_finite (4.0))
+ link_error ();
+ if (!__builtin_finitef (4.0))
+ link_error ();
+ if (!__builtin_finitel (4.0))
+ link_error ();
+}
+
+
+/* Check that all instances of link_error were subject to DCE. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-46.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-46.c
new file mode 100644
index 000000000..3a955a569
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-46.c
@@ -0,0 +1,142 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that rint, rintf, rintl, lrint, lrintf, lrintl,
+ llrint, llrintf, llrintl, floor, floorf, floorl,
+ ceil, ceilf, ceill, trunc, truncf, truncl,
+ nearbyint, nearbyintf and nearbyintl
+ built-in functions compile.
+
+ Written by Uros Bizjak, 25th Aug 2004. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double rint(double);
+extern long int lrint(double);
+extern long long int llrint(double);
+extern double floor(double);
+extern double ceil(double);
+extern double trunc(double);
+extern double nearbyint(double);
+
+extern float rintf(float);
+extern long int lrintf(float);
+extern long long int llrintf(float);
+extern float floorf(float);
+extern float ceilf(float);
+extern float truncf(float);
+extern float nearbyintf(float);
+
+extern long double rintl(long double);
+extern long int lrintl(long double);
+extern long long int llrintl(long double);
+extern long double floorl(long double);
+extern long double ceill(long double);
+extern long double truncl(long double);
+extern long double nearbyintl(long double);
+
+
+double test1(double x)
+{
+ return rint(x);
+}
+
+long int test11(double x)
+{
+ return lrint(x);
+}
+
+long long int test12(double x)
+{
+ return llrint(x);
+}
+
+double test2(double x)
+{
+ return floor(x);
+}
+
+double test3(double x)
+{
+ return ceil(x);
+}
+
+double test4(double x)
+{
+ return trunc(x);
+}
+
+double test5(double x)
+{
+ return nearbyint(x);
+}
+
+float test1f(float x)
+{
+ return rintf(x);
+}
+
+long int test11f(float x)
+{
+ return lrintf(x);
+}
+
+long long int test12f(float x)
+{
+ return llrintf(x);
+}
+
+float test2f(float x)
+{
+ return floorf(x);
+}
+
+float test3f(float x)
+{
+ return ceilf(x);
+}
+
+float test4f(float x)
+{
+ return truncf(x);
+}
+
+float test5f(float x)
+{
+ return nearbyintf(x);
+}
+
+long double test1l(long double x)
+{
+ return rintl(x);
+}
+
+long int test11l(long double x)
+{
+ return lrintl(x);
+}
+
+long long int test12l(long double x)
+{
+ return llrintl(x);
+}
+
+long double test2l(long double x)
+{
+ return floorl(x);
+}
+
+long double test3l(long double x)
+{
+ return ceill(x);
+}
+
+long double test4l(long double x)
+{
+ return truncl(x);
+}
+
+long double test5l(long double x)
+{
+ return nearbyintl(x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-47.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-47.c
new file mode 100644
index 000000000..9513483cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-47.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-O -ffast-math -fdump-tree-gimple" } */
+
+extern double sqrt (double);
+extern double pow (double, double);
+extern void abort (void);
+
+int main ()
+{
+ double x = -1.0;
+ if (sqrt (pow (x, 2)) != 1.0)
+ abort();
+ if (sqrt (x*x) != 1.0)
+ abort();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "sqrt" 0 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "pow" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-48.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-48.c
new file mode 100644
index 000000000..43710b868
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-48.c
@@ -0,0 +1,181 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern double fabs(double);
+extern float fabsf(float);
+extern void abort(void);
+
+
+double test1(double x)
+{
+ return (-x)*(-x);
+}
+
+float test1f(float x)
+{
+ return (-x)*(-x);
+}
+
+double test2(double x)
+{
+ return fabs(x)*fabs(x);
+}
+
+float test2f(float x)
+{
+ return fabsf(x)*fabsf(x);
+}
+
+double test3(double x, double y)
+{
+ return (x*-y)*(x*-y);
+}
+
+float test3f(float x, float y)
+{
+ return (x*-y)*(x*-y);
+}
+
+double test4(double x, double y)
+{
+ return (x/-y)*(x/-y);
+}
+
+float test4f(float x, float y)
+{
+ return (x/-y)*(x/-y);
+}
+
+int main()
+{
+ if (test1(1.0) != 1.0)
+ abort();
+ if (test1(2.0) != 4.0)
+ abort();
+ if (test1(0.0) != 0.0)
+ abort();
+ if (test1(-1.0) != 1.0)
+ abort();
+ if (test1(-2.0) != 4.0)
+ abort();
+
+ if (test1f(1.0f) != 1.0f)
+ abort();
+ if (test1f(2.0f) != 4.0f)
+ abort();
+ if (test1f(0.0f) != 0.0f)
+ abort();
+ if (test1f(-1.0f) != 1.0f)
+ abort();
+ if (test1f(-2.0f) != 4.0f)
+ abort();
+
+ if (test2(1.0) != 1.0)
+ abort();
+ if (test2(2.0) != 4.0)
+ abort();
+ if (test2(0.0) != 0.0)
+ abort();
+ if (test2(-1.0) != 1.0)
+ abort();
+ if (test2(-2.0) != 4.0)
+ abort();
+
+ if (test2f(1.0f) != 1.0f)
+ abort();
+ if (test2f(2.0f) != 4.0f)
+ abort();
+ if (test2f(0.0f) != 0.0f)
+ abort();
+ if (test2f(-1.0f) != 1.0f)
+ abort();
+ if (test2f(-2.0f) != 4.0f)
+ abort();
+
+ if (test3(1.0,1.0) != 1.0)
+ abort();
+ if (test3(1.0,-1.0) != 1.0)
+ abort();
+ if (test3(1.0,2.0) != 4.0)
+ abort();
+ if (test3(1.0,-2.0) != 4.0)
+ abort();
+ if (test3(2.0,1.0) != 4.0)
+ abort();
+ if (test3(2.0,-1.0) != 4.0)
+ abort();
+ if (test3(2.0,2.0) != 16.0)
+ abort();
+ if (test3(2.0,-2.0) != 16.0)
+ abort();
+ if (test3(-2.0,1.0) != 4.0)
+ abort();
+ if (test3(-2.0,-1.0) != 4.0)
+ abort();
+ if (test3(-2.0,2.0) != 16.0)
+ abort();
+ if (test3(-2.0,-2.0) != 16.0)
+ abort();
+
+ if (test3f(1.0f,1.0f) != 1.0f)
+ abort();
+ if (test3f(1.0f,-1.0f) != 1.0f)
+ abort();
+ if (test3f(1.0f,2.0f) != 4.0f)
+ abort();
+ if (test3f(1.0f,-2.0f) != 4.0f)
+ abort();
+ if (test3f(2.0f,1.0f) != 4.0f)
+ abort();
+ if (test3f(2.0f,-1.0f) != 4.0f)
+ abort();
+ if (test3f(2.0f,2.0f) != 16.0f)
+ abort();
+ if (test3f(2.0f,-2.0f) != 16.0f)
+ abort();
+ if (test3f(-2.0f,1.0f) != 4.0f)
+ abort();
+ if (test3f(-2.0f,-1.0f) != 4.0f)
+ abort();
+ if (test3f(-2.0f,2.0f) != 16.0f)
+ abort();
+ if (test3f(-2.0f,-2.0f) != 16.0f)
+ abort();
+
+ if (test4(1.0,1.0) != 1.0)
+ abort();
+ if (test4(1.0,-1.0) != 1.0)
+ abort();
+ if (test4(-1.0,1.0) != 1.0)
+ abort();
+ if (test4(-1.0,-1.0) != 1.0)
+ abort();
+ if (test4(6.0,3.0) != 4.0)
+ abort();
+ if (test4(6.0,-3.0) != 4.0)
+ abort();
+ if (test4(-6.0,3.0) != 4.0)
+ abort();
+ if (test4(-6.0,-3.0) != 4.0)
+ abort();
+
+ if (test4f(1.0f,1.0f) != 1.0f)
+ abort();
+ if (test4f(1.0f,-1.0f) != 1.0f)
+ abort();
+ if (test4f(-1.0f,1.0f) != 1.0f)
+ abort();
+ if (test4f(-1.0f,-1.0f) != 1.0f)
+ abort();
+ if (test4f(6.0f,3.0f) != 4.0f)
+ abort();
+ if (test4f(6.0f,-3.0f) != 4.0f)
+ abort();
+ if (test4f(-6.0f,3.0f) != 4.0f)
+ abort();
+ if (test4f(-6.0f,-3.0f) != 4.0f)
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-49.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-49.c
new file mode 100644
index 000000000..fdeaad467
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-49.c
@@ -0,0 +1,181 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern double fabs(double);
+extern float fabsf(float);
+extern void abort(void);
+
+
+double test1(double x)
+{
+ return fabs(-x);
+}
+
+float test1f(float x)
+{
+ return fabsf(-x);
+}
+
+double test2(double x)
+{
+ return fabs(fabs(x));
+}
+
+float test2f(float x)
+{
+ return fabsf(fabsf(x));
+}
+
+double test3(double x, double y)
+{
+ return fabs(x*-y);
+}
+
+float test3f(float x, float y)
+{
+ return fabsf(x*-y);
+}
+
+double test4(double x, double y)
+{
+ return fabs(x/-y);
+}
+
+float test4f(float x, float y)
+{
+ return fabsf(x/-y);
+}
+
+int main()
+{
+ if (test1(1.0) != 1.0)
+ abort();
+ if (test1(2.0) != 2.0)
+ abort();
+ if (test1(0.0) != 0.0)
+ abort();
+ if (test1(-1.0) != 1.0)
+ abort();
+ if (test1(-2.0) != 2.0)
+ abort();
+
+ if (test1f(1.0f) != 1.0f)
+ abort();
+ if (test1f(2.0f) != 2.0f)
+ abort();
+ if (test1f(0.0f) != 0.0f)
+ abort();
+ if (test1f(-1.0f) != 1.0f)
+ abort();
+ if (test1f(-2.0f) != 2.0f)
+ abort();
+
+ if (test2(1.0) != 1.0)
+ abort();
+ if (test2(2.0) != 2.0)
+ abort();
+ if (test2(0.0) != 0.0)
+ abort();
+ if (test2(-1.0) != 1.0)
+ abort();
+ if (test2(-2.0) != 2.0)
+ abort();
+
+ if (test2f(1.0f) != 1.0f)
+ abort();
+ if (test2f(2.0f) != 2.0f)
+ abort();
+ if (test2f(0.0f) != 0.0f)
+ abort();
+ if (test2f(-1.0f) != 1.0f)
+ abort();
+ if (test2f(-2.0f) != 2.0f)
+ abort();
+
+ if (test3(1.0,1.0) != 1.0)
+ abort();
+ if (test3(1.0,-1.0) != 1.0)
+ abort();
+ if (test3(1.0,2.0) != 2.0)
+ abort();
+ if (test3(1.0,-2.0) != 2.0)
+ abort();
+ if (test3(2.0,1.0) != 2.0)
+ abort();
+ if (test3(2.0,-1.0) != 2.0)
+ abort();
+ if (test3(2.0,2.0) != 4.0)
+ abort();
+ if (test3(2.0,-2.0) != 4.0)
+ abort();
+ if (test3(-2.0,1.0) != 2.0)
+ abort();
+ if (test3(-2.0,-1.0) != 2.0)
+ abort();
+ if (test3(-2.0,2.0) != 4.0)
+ abort();
+ if (test3(-2.0,-2.0) != 4.0)
+ abort();
+
+ if (test3f(1.0f,1.0f) != 1.0f)
+ abort();
+ if (test3f(1.0f,-1.0f) != 1.0f)
+ abort();
+ if (test3f(1.0f,2.0f) != 2.0f)
+ abort();
+ if (test3f(1.0f,-2.0f) != 2.0f)
+ abort();
+ if (test3f(2.0f,1.0f) != 2.0f)
+ abort();
+ if (test3f(2.0f,-1.0f) != 2.0f)
+ abort();
+ if (test3f(2.0f,2.0f) != 4.0f)
+ abort();
+ if (test3f(2.0f,-2.0f) != 4.0f)
+ abort();
+ if (test3f(-2.0f,1.0f) != 2.0f)
+ abort();
+ if (test3f(-2.0f,-1.0f) != 2.0f)
+ abort();
+ if (test3f(-2.0f,2.0f) != 4.0f)
+ abort();
+ if (test3f(-2.0f,-2.0f) != 4.0f)
+ abort();
+
+ if (test4(1.0,1.0) != 1.0)
+ abort();
+ if (test4(1.0,-1.0) != 1.0)
+ abort();
+ if (test4(-1.0,1.0) != 1.0)
+ abort();
+ if (test4(-1.0,-1.0) != 1.0)
+ abort();
+ if (test4(6.0,3.0) != 2.0)
+ abort();
+ if (test4(6.0,-3.0) != 2.0)
+ abort();
+ if (test4(-6.0,3.0) != 2.0)
+ abort();
+ if (test4(-6.0,-3.0) != 2.0)
+ abort();
+
+ if (test4f(1.0f,1.0f) != 1.0f)
+ abort();
+ if (test4f(1.0f,-1.0f) != 1.0f)
+ abort();
+ if (test4f(-1.0f,1.0f) != 1.0f)
+ abort();
+ if (test4f(-1.0f,-1.0f) != 1.0f)
+ abort();
+ if (test4f(6.0f,3.0f) != 2.0f)
+ abort();
+ if (test4f(6.0f,-3.0f) != 2.0f)
+ abort();
+ if (test4f(-6.0f,3.0f) != 2.0f)
+ abort();
+ if (test4f(-6.0f,-3.0f) != 2.0f)
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-50.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-50.c
new file mode 100644
index 000000000..2d32d1ed9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-50.c
@@ -0,0 +1,159 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern double copysign(double,double);
+extern float copysignf(float,float);
+extern double fabs(double);
+extern float fabsf(float);
+extern void abort(void);
+
+
+double test1(double x, double y)
+{
+ return copysign(-x,y);
+}
+
+float test1f(float x, float y)
+{
+ return copysignf(-x,y);
+}
+
+double test2(double x, double y)
+{
+ return copysign(fabs(x),y);
+}
+
+float test2f(float x, float y)
+{
+ return copysignf(fabsf(x),y);
+}
+
+double test3(double x, double y, double z)
+{
+ return copysign(x*-y,z);
+}
+
+float test3f(float x, float y, float z)
+{
+ return copysignf(x*-y,z);
+}
+
+double test4(double x, double y, double z)
+{
+ return copysign(x/-y,z);
+}
+
+float test4f(float x, float y, float z)
+{
+ return copysignf(x/-y,z);
+}
+
+int main()
+{
+ if (test1(3.0,2.0) != 3.0)
+ abort();
+ if (test1(3.0,-2.0) != -3.0)
+ abort();
+ if (test1(-3.0,2.0) != 3.0)
+ abort();
+ if (test1(-3.0,-2.0) != -3.0)
+ abort();
+
+ if (test1f(3.0f,2.0f) != 3.0f)
+ abort();
+ if (test1f(3.0f,-2.0f) != -3.0f)
+ abort();
+ if (test1f(-3.0f,2.0f) != 3.0f)
+ abort();
+ if (test1f(-3.0f,-2.0f) != -3.0f)
+ abort();
+
+ if (test2(3.0,2.0) != 3.0)
+ abort();
+ if (test2(3.0,-2.0) != -3.0)
+ abort();
+ if (test2(-3.0,2.0) != 3.0)
+ abort();
+ if (test2(-3.0,-2.0) != -3.0)
+ abort();
+
+ if (test2f(3.0f,2.0f) != 3.0f)
+ abort();
+ if (test2f(3.0f,-2.0f) != -3.0f)
+ abort();
+ if (test2f(-3.0f,2.0f) != 3.0f)
+ abort();
+ if (test2f(-3.0f,-2.0f) != -3.0f)
+ abort();
+
+ if (test3(2.0,3.0,4.0) != 6.0)
+ abort();
+ if (test3(2.0,3.0,-4.0) != -6.0)
+ abort();
+ if (test3(2.0,-3.0,4.0) != 6.0)
+ abort();
+ if (test3(2.0,-3.0,-4.0) != -6.0)
+ abort();
+ if (test3(-2.0,3.0,4.0) != 6.0)
+ abort();
+ if (test3(-2.0,3.0,-4.0) != -6.0)
+ abort();
+ if (test3(-2.0,-3.0,4.0) != 6.0)
+ abort();
+ if (test3(-2.0,-3.0,-4.0) != -6.0)
+ abort();
+
+ if (test3f(2.0f,3.0f,4.0f) != 6.0f)
+ abort();
+ if (test3f(2.0f,3.0f,-4.0f) != -6.0f)
+ abort();
+ if (test3f(2.0f,-3.0f,4.0f) != 6.0f)
+ abort();
+ if (test3f(2.0f,-3.0f,-4.0f) != -6.0f)
+ abort();
+ if (test3f(-2.0f,3.0f,4.0f) != 6.0f)
+ abort();
+ if (test3f(-2.0f,3.0f,-4.0f) != -6.0f)
+ abort();
+ if (test3f(-2.0f,-3.0f,4.0f) != 6.0f)
+ abort();
+ if (test3f(-2.0f,-3.0f,-4.0f) != -6.0f)
+ abort();
+
+ if (test4(8.0,2.0,3.0) != 4.0)
+ abort();
+ if (test4(8.0,2.0,-3.0) != -4.0)
+ abort();
+ if (test4(8.0,-2.0,3.0) != 4.0)
+ abort();
+ if (test4(8.0,-2.0,-3.0) != -4.0)
+ abort();
+ if (test4(-8.0,2.0,3.0) != 4.0)
+ abort();
+ if (test4(-8.0,2.0,-3.0) != -4.0)
+ abort();
+ if (test4(-8.0,-2.0,3.0) != 4.0)
+ abort();
+ if (test4(-8.0,-2.0,-3.0) != -4.0)
+ abort();
+
+ if (test4f(8.0f,2.0f,3.0f) != 4.0f)
+ abort();
+ if (test4f(8.0f,2.0f,-3.0f) != -4.0f)
+ abort();
+ if (test4f(8.0f,-2.0f,3.0f) != 4.0f)
+ abort();
+ if (test4f(8.0f,-2.0f,-3.0f) != -4.0f)
+ abort();
+ if (test4f(-8.0f,2.0f,3.0f) != 4.0f)
+ abort();
+ if (test4f(-8.0f,2.0f,-3.0f) != -4.0f)
+ abort();
+ if (test4f(-8.0f,-2.0f,3.0f) != 4.0f)
+ abort();
+ if (test4f(-8.0f,-2.0f,-3.0f) != -4.0f)
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-51.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-51.c
new file mode 100644
index 000000000..fdfc9bec7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-51.c
@@ -0,0 +1,157 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double pow(double, double);
+extern double fabs(double);
+extern void abort(void);
+
+double test2_1(double x)
+{
+ return pow(x,2.0);
+}
+
+double test2_2(double x)
+{
+ return pow(-x,2.0);
+}
+
+double test2_3(double x)
+{
+ return pow(fabs(x),2.0);
+}
+
+double test3_1(double x)
+{
+ return pow(x,3.0);
+}
+
+double test3_2(double x)
+{
+ return pow(-x,3.0);
+}
+
+double test3_3(double x)
+{
+ return pow(fabs(x),3.0);
+}
+
+double test6_1(double x)
+{
+ return pow(x,6.0);
+}
+
+double test6_2(double x)
+{
+ return pow(-x,6.0);
+}
+
+double test6_3(double x)
+{
+ return pow(fabs(x),6.0);
+}
+
+
+int main()
+{
+ if (test2_1(1.0) != 1.0)
+ abort();
+ if (test2_1(2.0) != 4.0)
+ abort();
+ if (test2_1(0.0) != 0.0)
+ abort();
+ if (test2_1(-1.0) != 1.0)
+ abort();
+ if (test2_1(-2.0) != 4.0)
+ abort();
+
+ if (test2_2(1.0) != 1.0)
+ abort();
+ if (test2_2(2.0) != 4.0)
+ abort();
+ if (test2_2(0.0) != 0.0)
+ abort();
+ if (test2_2(-1.0) != 1.0)
+ abort();
+ if (test2_2(-2.0) != 4.0)
+ abort();
+
+ if (test2_3(1.0) != 1.0)
+ abort();
+ if (test2_3(2.0) != 4.0)
+ abort();
+ if (test2_3(0.0) != 0.0)
+ abort();
+ if (test2_3(-1.0) != 1.0)
+ abort();
+ if (test2_3(2.0) != 4.0)
+ abort();
+
+ if (test3_1(1.0) != 1.0)
+ abort();
+ if (test3_1(2.0) != 8.0)
+ abort();
+ if (test3_1(0.0) != 0.0)
+ abort();
+ if (test3_1(-1.0) != -1.0)
+ abort();
+ if (test3_1(-2.0) != -8.0)
+ abort();
+
+ if (test3_2(1.0) != -1.0)
+ abort();
+ if (test3_2(2.0) != -8.0)
+ abort();
+ if (test3_2(0.0) != -0.0)
+ abort();
+ if (test3_2(-1.0) != 1.0)
+ abort();
+ if (test3_2(-2.0) != 8.0)
+ abort();
+
+ if (test3_3(1.0) != 1.0)
+ abort();
+ if (test3_3(2.0) != 8.0)
+ abort();
+ if (test3_3(0.0) != 0.0)
+ abort();
+ if (test3_3(-1.0) != 1.0)
+ abort();
+ if (test3_3(-2.0) != 8.0)
+ abort();
+
+ if (test6_1(1.0) != 1.0)
+ abort();
+ if (test6_1(2.0) != 64.0)
+ abort();
+ if (test6_1(0.0) != 0.0)
+ abort();
+ if (test6_1(-1.0) != 1.0)
+ abort();
+ if (test6_1(-2.0) != 64.0)
+ abort();
+
+ if (test6_2(1.0) != 1.0)
+ abort();
+ if (test6_2(2.0) != 64.0)
+ abort();
+ if (test6_2(0.0) != 0.0)
+ abort();
+ if (test6_2(-1.0) != 1.0)
+ abort();
+ if (test6_2(-2.0) != 64.0)
+ abort();
+
+ if (test6_3(1.0) != 1.0)
+ abort();
+ if (test6_3(2.0) != 64.0)
+ abort();
+ if (test6_3(0.0) != 0.0)
+ abort();
+ if (test6_3(-1.0) != 1.0)
+ abort();
+ if (test6_3(-2.0) != 64.0)
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-52.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-52.c
new file mode 100644
index 000000000..684fd661d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-52.c
@@ -0,0 +1,23 @@
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+extern void link_error(void);
+
+void test(double x, int n)
+{
+ if (__builtin_powi(x,-1.0) != 1.0/x)
+ link_error ();
+ if (__builtin_powi(x,0.0) != 1.0)
+ link_error ();
+ if (__builtin_powi(x,1.0) != x)
+ link_error ();
+ if (__builtin_powi(1.0,n) != 1.0)
+ link_error ();
+}
+
+int main()
+{
+ test(7.3, 2);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-53.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-53.c
new file mode 100644
index 000000000..9a50bf5ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-53.c
@@ -0,0 +1,122 @@
+/* Copyright (C) 2005 Free Software Foundation.
+
+ Check that (long)floor, (long)floorf, (long)floorl,
+ (long long)floor, (long long)floorf, (long long)floorl,
+ (long)ceil, (long)ceilf, (long)ceill,
+ (long long)ceil, (long long)ceilf, (long long)ceill
+ built-in functions compile.
+
+ Written by Uros Bizjak, 5th April 2005. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+/* { dg-add-options c99_runtime } */
+
+#include "builtins-config.h"
+
+extern double floor(double);
+extern double ceil(double);
+extern double trunc(double);
+
+extern float floorf(float);
+extern float ceilf(float);
+extern float truncf(float);
+
+extern long double floorl(long double);
+extern long double ceill(long double);
+extern long double truncl(long double);
+
+
+long int test1(double x)
+{
+ return floor(x);
+}
+
+long long int test2(double x)
+{
+ return floor(x);
+}
+
+long int test3(double x)
+{
+ return ceil(x);
+}
+
+long long int test4(double x)
+{
+ return ceil(x);
+}
+
+long int test5(double x)
+{
+ return trunc(x);
+}
+
+long long int test6(double x)
+{
+ return trunc(x);
+}
+
+#ifdef HAVE_C99_RUNTIME
+long int test1f(float x)
+{
+ return floorf(x);
+}
+
+long long int test2f(float x)
+{
+ return floorf(x);
+}
+
+long int test3f(float x)
+{
+ return ceilf(x);
+}
+
+long long int test4f(float x)
+{
+ return ceilf(x);
+}
+#endif
+
+long int test5f(float x)
+{
+ return truncf(x);
+}
+
+long long int test6f(float x)
+{
+ return truncf(x);
+}
+
+#ifdef HAVE_C99_RUNTIME
+long int test1l(long double x)
+{
+ return floorl(x);
+}
+
+long long int test2l(long double x)
+{
+ return floorl(x);
+}
+
+long int test3l(long double x)
+{
+ return ceill(x);
+}
+
+long long int test4l(long double x)
+{
+ return ceill(x);
+}
+#endif
+
+long int test5l(long double x)
+{
+ return truncl(x);
+}
+
+long long int test6l(long double x)
+{
+ return truncl(x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-54.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-54.c
new file mode 100644
index 000000000..2713a3b1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-54.c
@@ -0,0 +1,146 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double fabs(double);
+float fabsf(float);
+long double fabsl(long double);
+double cabs(__complex__ double);
+float cabsf(__complex__ float);
+long double cabsl(__complex__ long double);
+
+void link_error (void);
+
+void test(__complex__ double x, double a, double b)
+{
+ if (cabs(x) != cabs(-x))
+ link_error();
+
+ if (cabs(x) != cabs(~x))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (a+a*1i))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (a*1i+a))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (-a+a*-1i))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (-a+-a*1i))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (-a-a*1i))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (a*-1i-a))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (-a*1i-a))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (a*-1i+-a))
+ link_error();
+
+ if (fabs(a) * __builtin_sqrt(2) != cabs (-a*1i+-a))
+ link_error();
+
+ if (fabs(a*b) * __builtin_sqrt(2) != cabs (a*b-(-b*a*1i)))
+ link_error();
+
+ if (fabs(a*b) * __builtin_sqrt(2) != cabs (a*b*1i-a*-b))
+ link_error();
+}
+
+void testf(__complex__ float x, float a, float b)
+{
+ if (cabsf(x) != cabsf(-x))
+ link_error();
+
+ if (cabsf(x) != cabsf(~x))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (a+a*1i))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (a*1i+a))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (-a+a*-1i))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (-a+-a*1i))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (-a-a*1i))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (a*-1i-a))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (-a*1i-a))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (a*-1i+-a))
+ link_error();
+
+ if (fabsf(a) * __builtin_sqrtf(2) != cabsf (-a*1i+-a))
+ link_error();
+
+ if (fabsf(a*b) * __builtin_sqrtf(2) != cabsf (a*b-(-b*a*1i)))
+ link_error();
+
+ if (fabsf(a*b) * __builtin_sqrtf(2) != cabsf (a*b*1i-a*-b))
+ link_error();
+}
+
+void testl(__complex__ long double x, long double a, long double b)
+{
+ if (cabsl(x) != cabsl(-x))
+ link_error();
+
+ if (cabsl(x) != cabsl(~x))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (a+a*1i))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (a*1i+a))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (-a+a*-1i))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (-a+-a*1i))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (-a-a*1i))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (a*-1i-a))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (-a*1i-a))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (a*-1i+-a))
+ link_error();
+
+ if (fabsl(a) * __builtin_sqrtl(2) != cabsl (-a*1i+-a))
+ link_error();
+
+ if (fabsl(a*b) * __builtin_sqrtl(2) != cabsl (a*b-(-b*a*1i)))
+ link_error();
+
+ if (fabsl(a*b) * __builtin_sqrtl(2) != cabsl (a*b*1i-a*-b))
+ link_error();
+}
+
+int main()
+{
+ test(0, 0, 0);
+ testf(0, 0, 0);
+ testl(0, 0, 0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-55.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-55.c
new file mode 100644
index 000000000..0db7976a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-55.c
@@ -0,0 +1,86 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+/* { dg-add-options c99_runtime } */
+
+#include "builtins-config.h"
+
+void link_error (void);
+
+extern long lround(double);
+extern long lrint(double);
+
+extern long long llround(double);
+extern long long llrint(double);
+
+extern long lroundf(float);
+extern long lrintf(float);
+
+extern long long llroundf(float);
+extern long long llrintf(float);
+
+extern long lroundl(long double);
+extern long lrintl(long double);
+
+extern long long llroundl(long double);
+extern long long llrintl(long double);
+
+
+void test(double x)
+{
+#ifdef HAVE_C99_RUNTIME
+ if (sizeof(long) != sizeof(long long))
+ return;
+
+ if (__builtin_lceil(x) != __builtin_llceil(x))
+ link_error();
+ if (__builtin_lfloor(x) != __builtin_llfloor(x))
+ link_error();
+ if (lround(x) != llround(x))
+ link_error();
+ if (lrint(x) != llrint(x))
+ link_error();
+#endif
+}
+
+void testf(float x)
+{
+#ifdef HAVE_C99_RUNTIME
+ if (sizeof(long) != sizeof(long long))
+ return;
+
+ if (__builtin_lceilf(x) != __builtin_llceilf(x))
+ link_error();
+ if (__builtin_lfloorf(x) != __builtin_llfloorf(x))
+ link_error();
+ if (lroundf(x) != llroundf(x))
+ link_error();
+ if (lrintf(x) != llrintf(x))
+ link_error();
+#endif
+}
+
+void testl(long double x)
+{
+#ifdef HAVE_C99_RUNTIME
+ if (sizeof(long) != sizeof(long long))
+ return;
+
+ if (__builtin_lceill(x) != __builtin_llceill(x))
+ link_error();
+ if (__builtin_lfloorl(x) != __builtin_llfloorl(x))
+ link_error();
+ if (lroundl(x) != llroundl(x))
+ link_error();
+ if (lrintl(x) != llrintl(x))
+ link_error();
+#endif
+}
+
+int main()
+{
+ test(0.0);
+ testf(0.0);
+ testl(0.0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-57.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-57.c
new file mode 100644
index 000000000..361826cb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-57.c
@@ -0,0 +1,25 @@
+/* { dg-do link } */
+/* { dg-options "-std=c99 -ffinite-math-only" } */
+
+#include "builtins-config.h"
+
+extern void link_error (void);
+
+extern double floor (double);
+extern double trunc (double);
+extern double fabs (double);
+
+void test (double x)
+{
+#ifdef HAVE_C99_RUNTIME
+ if (floor (fabs (x)) != trunc (fabs (x)))
+ link_error ();
+#endif
+ if (__builtin_lfloor (fabs (x)) != (long)fabs (x))
+ link_error ();
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-58.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-58.c
new file mode 100644
index 000000000..4c2f351a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-58.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -std=c99 -fno-ident" } */
+
+#include "builtins-config.h"
+
+#ifdef HAVE_C99_RUNTIME
+double test1 (double x)
+{
+ return __builtin_pow (x, 1./3.);
+}
+
+double test2 (double x)
+{
+ return __builtin_pow (x, 4./3.);
+}
+
+double test3a (double x)
+{
+ return __builtin_pow (x, 5./3.);
+}
+
+double test3b (double x)
+{
+ return __builtin_pow (x, -5./3.);
+}
+
+double test4 (double x)
+{
+ return __builtin_pow (x, 7./3.);
+}
+#endif
+
+/* { dg-final { scan-assembler-not "pow" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-59.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-59.c
new file mode 100644
index 000000000..b940d39ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-59.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+/* { dg-require-effective-target c99_runtime } */
+
+double test (double x)
+{
+ double s, c;
+ __builtin_sincos (x, &s, &c);
+ return s + c;
+}
+
+/* { dg-final { scan-tree-dump "__builtin_cexpi" "gimple" } } */
+/* { dg-final { scan-tree-dump-not "sincos" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-6.c
new file mode 100644
index 000000000..2ebb0b2d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-6.c
@@ -0,0 +1,80 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that constant folding comparisons against built-in math functions
+ don't cause any problems for the compiler, and produce expected results.
+
+ Written by Roger Sayle, 15th March 2003. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+#include <float.h>
+
+extern void abort (void);
+extern double sqrt (double);
+
+int test1(double x)
+{
+ return sqrt(x) < -9.0;
+}
+
+int test2(double x)
+{
+ return sqrt(x) > -9.0;
+}
+
+int test3(double x)
+{
+ return sqrt(x) < 9.0;
+}
+
+int test4(double x)
+{
+ return sqrt(x) > 9.0;
+}
+
+int test5(double x)
+{
+ return sqrt(x) < DBL_MAX;
+}
+
+int test6(double x)
+{
+ return sqrt(x) > DBL_MAX;
+}
+
+int main()
+{
+ double x;
+
+ x = 80.0;
+ if (test1 (x))
+ abort ();
+ if (! test2 (x))
+ abort ();
+ if (! test3 (x))
+ abort ();
+ if (test4 (x))
+ abort ();
+ if (! test5 (x))
+ abort ();
+ if (test6 (x))
+ abort ();
+
+ x = 100.0;
+ if (test1 (x))
+ abort ();
+ if (! test2 (x))
+ abort ();
+ if (test3 (x))
+ abort ();
+ if (! test4 (x))
+ abort ();
+ if (! test5 (x))
+ abort ();
+ if (test6 (x))
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-60.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-60.c
new file mode 100644
index 000000000..b57679f36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-60.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+double test1 (double x)
+{
+ return __real __builtin_cexpi (x);
+}
+
+double test2 (double x)
+{
+ return __imag __builtin_cexpi (x);
+}
+
+/* { dg-final { scan-tree-dump "cos" "gimple" } } */
+/* { dg-final { scan-tree-dump "sin" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-61.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-61.c
new file mode 100644
index 000000000..dff163ff1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-61.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -fdump-tree-optimized" } */
+/* { dg-require-effective-target c99_runtime } */
+
+double test1 (double x)
+{
+ return __real __builtin_cexp(x * (__extension__ 1.0iF));
+}
+
+double test2(double x)
+{
+ return __imag __builtin_cexp((__extension__ 1.0iF) * x);
+}
+
+double test3(double x)
+{
+ _Complex c = __builtin_cexp(x * (__extension__ 1.0iF));
+ return __imag c + __real c;
+}
+
+double test4(double x, double y)
+{
+ _Complex c = __builtin_cexp(x);
+ x = __builtin_exp (x);
+ return x - __real c;
+}
+
+/* { dg-final { scan-tree-dump "cexpi" "optimized" } } */
+/* { dg-final { scan-tree-dump "sin" "optimized" } } */
+/* { dg-final { scan-tree-dump "cos" "optimized" } } */
+/* { dg-final { scan-tree-dump "return 0.0" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-62.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-62.c
new file mode 100644
index 000000000..db6269693
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-62.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffinite-math-only -fdump-tree-optimized" } */
+/* { dg-require-effective-target c99_runtime } */
+
+double test1 (double x)
+{
+ double s, c;
+ s = __builtin_sin (x);
+ c = __builtin_cos (x);
+ return s + c;
+}
+
+double test2 (double x)
+{
+ double s, c;
+ x = x * 2;
+ s = __builtin_sin (x);
+ c = __builtin_cos (x);
+ return s + c;
+}
+
+double test3 (double x, int b)
+{
+ double s, c;
+ if (b)
+ x = x * 2;
+ s = __builtin_sin (x);
+ c = __builtin_cos (x);
+ return s + c;
+}
+
+double test4 (double x)
+{
+ double s;
+ x = x * 2;
+ s = __builtin_sin (x);
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times "cexpi" 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-63.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-63.c
new file mode 100644
index 000000000..8fcbc68e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-63.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Check that isinf, isinff and isinfl built-in functions compile.
+
+ Written by Uros Bizjak, 31st January 2007. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern int isinf(double);
+extern int isinff(float);
+extern int isinfl(long double);
+
+int test1(double x)
+{
+ return isinf(x);
+}
+
+int test1f(float x)
+{
+ return isinff(x);
+}
+
+int test1l(long double x)
+{
+ return isinfl(x);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-64.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-64.c
new file mode 100644
index 000000000..6e84633d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-64.c
@@ -0,0 +1,8 @@
+/* { dg-do run } */
+
+int main ()
+{
+ char *mem = __builtin_alloca (40);
+ __builtin___clear_cache (mem, mem + 40);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-65.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-65.c
new file mode 100644
index 000000000..91930c958
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-65.c
@@ -0,0 +1,40 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+/* { dg-require-effective-target c99_runtime } */
+
+extern int ilogbf (float);
+extern float logbf (float);
+extern int ilogb (double);
+extern double logb (double);
+extern int ilogbl (long double);
+extern long double logbl (long double);
+
+extern void link_error(void);
+
+void testf(float x)
+{
+ if ((int) logbf (x) != ilogbf (x))
+ link_error ();
+}
+
+void test(double x)
+{
+ if ((int) logb (x) != ilogb (x))
+ link_error ();
+}
+
+void testl(long double x)
+{
+ if ((int) logbl (x) != ilogbl (x))
+ link_error ();
+}
+
+int main()
+{
+ testf (2.0f);
+ test (2.0);
+ testl (2.0l);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-66.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-66.c
new file mode 100644
index 000000000..87bea3f42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-66.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+enum { E0 = 0, E1 = 1, E2 = 2 } e;
+
+int
+foo (void)
+{
+ return __builtin_popcount ((int) e);
+}
+
+/* { dg-final { scan-assembler-not "__builtin_popcount" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-67.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-67.c
new file mode 100644
index 000000000..22267bd31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-67.c
@@ -0,0 +1,73 @@
+/* Check that conversion functions link correctly with -ffast-math. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math -lm" } */
+/* { dg-add-options c99_runtime } */
+
+#include "builtins-config.h"
+
+double floor (double);
+float floorf (float);
+long double floorl (long double);
+
+double ceil (double);
+float ceilf (float);
+long double ceill (long double);
+
+double round (double);
+float roundf (float);
+long double roundl (long double);
+
+double rint (double);
+float rintf (float);
+long double rintl (long double);
+
+int ifloor (double a) { return (int) floor (a); }
+#ifdef HAVE_C99_RUNTIME
+int ifloorf (float a) { return (int) floorf (a); }
+int ifloorl (long double a) { return (int) floorl (a); }
+#endif
+
+long lfloor (double a) { return (long) floor (a); }
+#ifdef HAVE_C99_RUNTIME
+long lfloorf (float a) { return (long) floorf (a); }
+long lfloorl (long double a) { return (long) floorl (a); }
+#endif
+
+long long llfloor (double a) { return (long long) floor (a); }
+#ifdef HAVE_C99_RUNTIME
+long long llfloorf (float a) { return (long long) floorf (a); }
+long long llfloorl (long double a) { return (long long) floorl (a); }
+#endif
+
+int iceil (double a) { return (int) ceil (a); }
+#ifdef HAVE_C99_RUNTIME
+int iceilf (float a) { return (int) ceilf (a); }
+int iceill (long double a) { return (int) ceill (a); }
+#endif
+
+long lceil (double a) { return (long) ceil (a); }
+#ifdef HAVE_C99_RUNTIME
+long lceilf (float a) { return (long) ceilf (a); }
+long lceill (long double a) { return (long) ceill (a); }
+#endif
+
+long long llceil (double a) { return (long long) ceil (a); }
+#ifdef HAVE_C99_RUNTIME
+long long llceilf (float a) { return (long long) ceilf (a); }
+long long llceill (long double a) { return (long long) ceill (a); }
+#endif
+
+#ifdef HAVE_C99_RUNTIME
+int iround (double a) { return (int) round (a); }
+int iroundf (float a) { return (int) roundf (a); }
+int iroundl (long double a) { return (int) roundl (a); }
+#endif
+
+#ifdef HAVE_C99_RUNTIME
+int irint (double a) { return (int) rint (a); }
+int irintf (float a) { return (int) rintf (a); }
+int irintl (long double a) { return (int) rintl (a); }
+#endif
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-7.c
new file mode 100644
index 000000000..13e708e29
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-7.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Verify that built-in math function constant folding of constant
+ arguments is correctly performed by the by the compiler.
+
+ Written by Roger Sayle, 30th March 2003. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double pow (double, double);
+extern float powf (float, float);
+extern long double powl (long double, long double);
+extern double tan (double);
+extern float tanf (float);
+extern long double tanl (long double);
+extern double atan (double);
+extern float atanf (float);
+extern long double atanl (long double);
+
+extern void link_error(void);
+
+void test(double x)
+{
+ if (pow (x, 1.0) != x)
+ link_error ();
+ if (tan (atan (x)) != x)
+ link_error ();
+}
+
+void testf(float x)
+{
+ if (powf (x, 1.0f) != x)
+ link_error ();
+ if (tanf (atanf (x)) != x)
+ link_error ();
+}
+
+void testl(long double x)
+{
+ if (powl (x, 1.0l) != x)
+ link_error ();
+ if (tanl (atanl (x)) != x)
+ link_error ();
+}
+
+int main()
+{
+ test (2.0);
+ testf (2.0f);
+ testl (2.0l);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-8.c
new file mode 100644
index 000000000..95c17e72f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-8.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 2003, 2006 Free Software Foundation.
+
+ Verify that built-in math function constant folding of functions
+ with one constant argument is correctly performed by the compiler.
+
+ Written by Roger Sayle, 30th March 2003. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void abort(void);
+extern double pow(double, double);
+extern double sqrt(double);
+extern double cbrt(double);
+
+void test(double x)
+{
+ if (pow(x,-1.0) != 1.0/x)
+ abort ();
+
+ if (pow(x,2.0) != x*x)
+ abort ();
+
+ if (pow(x,-2.0) != 1.0/(x*x))
+ abort ();
+
+ if (pow(x,0.5) != sqrt(x))
+ abort ();
+
+#ifdef HAVE_C99_RUNTIME
+ if (pow(x,1.0/3.0) != cbrt(x))
+ abort ();
+#endif
+}
+
+int main()
+{
+ test (1.0);
+ test (2.0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-85.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-85.c
new file mode 100644
index 000000000..0993fbc19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-85.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void __chk_fail (void);
+extern int snprintf (char *, size_t, const char *, ...);
+extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...)
+{
+ if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b)
+ __chk_fail ();
+ return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ());
+}
+extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf");
+
+char buf[10];
+
+int
+main (void)
+{
+ snprintf (buf, 10, "%d%d\n", 10, 10);
+ return 0;
+}
+
+/* { dg-final { scan-assembler "mysnprintf" } } */
+/* { dg-final { scan-assembler-not "__chk_fail" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-9.c
new file mode 100644
index 000000000..108e0d2f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-9.c
@@ -0,0 +1,103 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Check that constant folding of built-in math functions doesn't
+ break anything.
+
+ Written by Roger Sayle, 2nd April 2003. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern double log(double);
+extern double exp(double);
+extern double sqrt(double);
+extern double pow(double,double);
+
+extern float logf(float);
+extern float expf(float);
+extern float sqrtf(float);
+extern float powf(float,float);
+
+extern long double logl(long double);
+extern long double expl(long double);
+extern long double sqrtl(long double);
+extern long double powl(long double,long double);
+
+
+double test1(double x, double y)
+{
+ return log(pow(x,y));
+}
+
+double test2(double x, double y)
+{
+ return sqrt(pow(x,y));
+}
+
+double test3(double x, double y)
+{
+ return pow(exp(x),y);
+}
+
+double test4(double x, double y)
+{
+ return pow(sqrt(x),y);
+}
+
+double test5(double x, double y, double z)
+{
+ return pow(pow(x,y),z);
+}
+
+
+float test1f(float x, float y)
+{
+ return logf(powf(x,y));
+}
+
+float test2f(float x, float y)
+{
+ return sqrtf(powf(x,y));
+}
+
+float test3f(float x, float y)
+{
+ return powf(expf(x),y);
+}
+
+float test4f(float x, float y)
+{
+ return powf(sqrtf(x),y);
+}
+
+float test5f(float x, float y, float z)
+{
+ return powf(powf(x,y),z);
+}
+
+
+long double test1l(long double x, long double y)
+{
+ return logl(powl(x,y));
+}
+
+long double test2l(long double x, long double y)
+{
+ return sqrtl(powl(x,y));
+}
+
+long double test3l(long double x, long double y)
+{
+ return powl(expl(x),y);
+}
+
+long double test4l(long double x, long double y)
+{
+ return powl(sqrtl(x),y);
+}
+
+long double test5l(long double x, long double y, long double z)
+{
+ return powl(powl(x,y),z);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-config.h b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-config.h
new file mode 100644
index 000000000..8d5a10d3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-config.h
@@ -0,0 +1,60 @@
+/* Copyright (C) 2003, 2004, 2005, 2006, 2009, 2011, 2012
+ Free Software Foundation.
+
+ Define macros useful in tests for bulitin functions. */
+
+/* Define HAVE_C99_RUNTIME if the entire C99 runtime is available on
+ the target system. The value of HAVE_C99_RUNTIME should be the
+ same as the value of TARGET_C99_FUNCTIONS in the GCC machine
+ description. (Perhaps GCC should predefine a special macro
+ indicating whether or not TARGET_C99_FUNCTIONS is set, but it does
+ not presently do that.) */
+
+#if defined(__hppa) && defined(__hpux)
+/* PA HP-UX doesn't have the entire C99 runtime. */
+#elif defined(__INTERIX)
+/* Interix6 doesn't have the entire C99 runtime. */
+#elif defined(__AVR__)
+/* AVR doesn't have the entire C99 runtime. */
+#elif defined(__FreeBSD__) && (__FreeBSD__ < 9)
+/* FreeBSD up to version 8 lacks support for cexp and friends. */
+#elif defined(__vxworks)
+/* VxWorks doesn't have a full C99 time. (cabs is missing, for example.) */
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+/* Windows doesn't have the entire C99 runtime. */
+#elif (defined(__APPLE__) && defined(__ppc__) \
+ && ! defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__))
+/* MacOS versions before 10.3 don't have many C99 functions.
+ But, if you're including this file, you probably want to test the
+ newer behaviour, so: */
+#error forgot to set -mmacosx-version-min.
+#elif (defined(__APPLE__) && defined(__ppc__) \
+ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1030)
+/* MacOS versions before 10.3 don't have many C99 functions. */
+#else
+/* Newlib has the "f" variants of the math functions, but not the "l"
+ variants. TARGET_C99_FUNCTIONS is only defined if all C99
+ functions are present. Therefore, on systems using newlib, tests
+ of builtins will fail the "l" variants, and we should therefore not
+ define HAVE_C99_RUNTIME. Including <sys/types.h> gives us a way of
+ seeing if _NEWLIB_VERSION is defined. Including <math.h> would work
+ too, but the GLIBC math inlines cause us to generate inferior code,
+ which causes the test to fail, so it is not safe. Including <limits.h>
+ also fails because the include search paths are ordered such that GCC's
+ version will be found before the newlib version. Similarly, uClibc
+ lacks the C99 functions. */
+#include <sys/types.h>
+#if defined(_NEWLIB_VERSION) || defined(__UCLIBC__)
+#elif defined(__sun) && __STDC_VERSION__ - 0 < 199901L
+/* If you're including this file, you probably want to test the newer
+ behaviour, so ensure the right flags were used for each test: */
+#error forgot to set -std=c99.
+#elif defined(__sun) && ! defined (_STDC_C99)
+/* Solaris up to 9 doesn't have the entire C99 runtime.
+ Solaris 10 defines _STDC_C99 if __STDC_VERSION__ is >= 199901L.
+ This macro is defined in <sys/feature_tests.h> which is included by
+ various system headers, in this case <sys/types.h> above. */
+#else
+#define HAVE_C99_RUNTIME
+#endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/builtins-error.c b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-error.c
new file mode 100644
index 000000000..0f41700ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/builtins-error.c
@@ -0,0 +1,65 @@
+/* { dg-do compile } */
+
+struct X { int x; };
+
+int test1(struct X x)
+{
+ if (x.x == 1) return __builtin_fpclassify(1,2,3,4,5,x); /* { dg-error "non-floating-point argument" } */
+ if (x.x == 2) return __builtin_isfinite(x); /* { dg-error "non-floating-point argument" } */
+ if (x.x == 3) return __builtin_isinf_sign(x); /* { dg-error "non-floating-point argument" } */
+ if (x.x == 4) return __builtin_isinf(x); /* { dg-error "non-floating-point argument" } */
+ if (x.x == 5) return __builtin_isnan(x); /* { dg-error "non-floating-point argument" } */
+ if (x.x == 6) return __builtin_isnormal(x); /* { dg-error "non-floating-point argument" } */
+ if (x.x == 7) return __builtin_isgreater(x, x); /* { dg-error "non-floating-point arguments" } */
+ if (x.x == 8) return __builtin_isgreaterequal(x, x); /* { dg-error "non-floating-point arguments" } */
+ if (x.x == 9) return __builtin_isless(x, x); /* { dg-error "non-floating-point arguments" } */
+ if (x.x == 10) return __builtin_islessequal(x, x); /* { dg-error "non-floating-point arguments" } */
+ if (x.x == 11) return __builtin_islessgreater(x, x); /* { dg-error "non-floating-point arguments" } */
+ if (x.x == 12) return __builtin_isunordered(x, x); /* { dg-error "non-floating-point arguments" } */
+
+ return 0;
+}
+
+int test2(double x)
+{
+ if (x == 1) return __builtin_fpclassify(1,2,3,4,5); /* { dg-error "not enough arguments" } */
+ if (x == 2) return __builtin_isfinite(); /* { dg-error "not enough arguments" } */
+ if (x == 3) return __builtin_isinf_sign(); /* { dg-error "not enough arguments" } */
+ if (x == 4) return __builtin_isinf(); /* { dg-error "not enough arguments" } */
+ if (x == 5) return __builtin_isnan(); /* { dg-error "not enough arguments" } */
+ if (x == 6) return __builtin_isnormal(); /* { dg-error "not enough arguments" } */
+ if (x == 7) return __builtin_isgreater(x); /* { dg-error "not enough arguments" } */
+ if (x == 8) return __builtin_isgreaterequal(x); /* { dg-error "not enough arguments" } */
+ if (x == 9) return __builtin_isless(x); /* { dg-error "not enough arguments" } */
+ if (x == 10) return __builtin_islessequal(x); /* { dg-error "not enough arguments" } */
+ if (x == 11) return __builtin_islessgreater(x); /* { dg-error "not enough arguments" } */
+ if (x == 12) return __builtin_isunordered(x); /* { dg-error "not enough arguments" } */
+ return 0;
+}
+
+int test3(double x)
+{
+ if (x == 1) return __builtin_fpclassify(1,2,3,4,5,x,x); /* { dg-error "too many arguments" } */
+ if (x == 2) return __builtin_isfinite(x, x); /* { dg-error "too many arguments" } */
+ if (x == 3) return __builtin_isinf_sign(x, x); /* { dg-error "too many arguments" } */
+ if (x == 4) return __builtin_isinf(x, x); /* { dg-error "too many arguments" } */
+ if (x == 5) return __builtin_isnan(x, x); /* { dg-error "too many arguments" } */
+ if (x == 6) return __builtin_isnormal(x, x); /* { dg-error "too many arguments" } */
+ if (x == 7) return __builtin_isgreater(x, x, x); /* { dg-error "too many arguments" } */
+ if (x == 8) return __builtin_isgreaterequal(x, x, x); /* { dg-error "too many arguments" } */
+ if (x == 9) return __builtin_isless(x, x, x); /* { dg-error "too many arguments" } */
+ if (x == 10) return __builtin_islessequal(x, x, x); /* { dg-error "too many arguments" } */
+ if (x == 11) return __builtin_islessgreater(x, x, x); /* { dg-error "too many arguments" } */
+ if (x == 12) return __builtin_isunordered(x, x, x); /* { dg-error "too many arguments" } */
+ return 0;
+}
+
+int test4(int i, double x)
+{
+ if (x == 1) return __builtin_fpclassify(i,2,3,4,5,x); /* { dg-error "non-const integer argument" } */
+ if (x == 2) return __builtin_fpclassify(1,i,3,4,5,x); /* { dg-error "non-const integer argument" } */
+ if (x == 3) return __builtin_fpclassify(1,2,i,4,5,x); /* { dg-error "non-const integer argument" } */
+ if (x == 4) return __builtin_fpclassify(1,2,3,i,5,x); /* { dg-error "non-const integer argument" } */
+ if (x == 5) return __builtin_fpclassify(1,2,3,4,i,x); /* { dg-error "non-const integer argument" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-1.c
new file mode 100644
index 000000000..e0058c380
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-1.c
@@ -0,0 +1,41 @@
+/* Test C11 alignment support. Test valid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stddef.h>
+
+_Alignas (_Alignof (max_align_t)) char c;
+extern _Alignas (max_align_t) char c;
+extern char c;
+
+extern _Alignas (max_align_t) short s;
+_Alignas (max_align_t) short s;
+
+_Alignas (int) int i;
+extern int i;
+
+_Alignas (max_align_t) long l;
+
+_Alignas (max_align_t) long long ll;
+
+_Alignas (max_align_t) float f;
+
+_Alignas (max_align_t) double d;
+
+_Alignas (max_align_t) _Complex long double cld;
+
+_Alignas (0) _Alignas (int) _Alignas (char) char ca[10];
+
+_Alignas ((int) _Alignof (max_align_t) + 0) int x;
+
+enum e { E = _Alignof (max_align_t) };
+_Alignas (E) int y;
+
+void
+func (void)
+{
+ _Alignas (max_align_t) long long auto_ll;
+}
+
+/* Valid, but useless. */
+_Alignas (0) struct s; /* { dg-warning "useless" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-2.c
new file mode 100644
index 000000000..a1750ac54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-2.c
@@ -0,0 +1,92 @@
+/* Test C11 alignment support. Test valid code using stdalign.h. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdalign.h>
+#include <stddef.h>
+
+extern int strcmp (const char *, const char *);
+
+extern void exit (int);
+extern void abort (void);
+
+alignas (alignof (max_align_t)) char c;
+extern alignas (max_align_t) char c;
+extern char c;
+
+extern alignas (max_align_t) short s;
+alignas (max_align_t) short s;
+
+alignas (int) int i;
+extern int i;
+
+alignas (max_align_t) long l;
+
+alignas (max_align_t) long long ll;
+
+alignas (max_align_t) float f;
+
+alignas (max_align_t) double d;
+
+alignas (max_align_t) _Complex long double cld;
+
+alignas (0) alignas (int) alignas (char) char ca[10];
+
+alignas ((int) alignof (max_align_t) + 0) int x;
+
+enum e { E = alignof (max_align_t) };
+alignas (E) int y;
+
+void
+func (void)
+{
+ alignas (max_align_t) long long auto_ll;
+}
+
+/* Valid, but useless. */
+alignas (0) struct s; /* { dg-warning "useless" } */
+
+#ifndef alignas
+#error "alignas not defined"
+#endif
+
+#ifndef alignof
+#error "alignof not defined"
+#endif
+
+#ifndef __alignas_is_defined
+#error "__alignas_is_defined not defined"
+#endif
+
+#if __alignas_is_defined != 1
+#error "__alignas_is_defined not 1"
+#endif
+
+#ifndef __alignof_is_defined
+#error "__alignof_is_defined not defined"
+#endif
+
+#if __alignof_is_defined != 1
+#error "__alignof_is_defined not 1"
+#endif
+
+#define str(x) #x
+#define xstr(x) str(x)
+
+const char *s1 = xstr(alignas);
+const char *s2 = xstr(alignof);
+const char *s3 = xstr(__alignas_is_defined);
+const char *s4 = xstr(__alignof_is_defined);
+
+int
+main (void)
+{
+ if (strcmp (s1, "_Alignas") != 0)
+ abort ();
+ if (strcmp (s2, "_Alignof") != 0)
+ abort ();
+ if (strcmp (s3, "1") != 0)
+ abort ();
+ if (strcmp (s4, "1") != 0)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-3.c
new file mode 100644
index 000000000..39b81ef6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-3.c
@@ -0,0 +1,43 @@
+/* Test C11 alignment support. Test invalid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+int a = _Alignof (void (void)); /* { dg-error "function" } */
+struct s;
+int b = _Alignof (struct s); /* { dg-error "incomplete" } */
+int c = _Alignof (void); /* { dg-error "void" } */
+int d = _Alignof (a); /* { dg-error "expression" } */
+
+_Alignas (void (void)) char e; /* { dg-error "function" } */
+_Alignas (struct s) char f; /* { dg-error "incomplete" } */
+_Alignas (void) char g; /* { dg-error "void" } */
+
+_Alignas (-__INT_MAX__-1) char h; /* { dg-error "too large|power of 2" } */
+_Alignas (-__INT_MAX__) char h2; /* { dg-error "too large|power of 2" } */
+_Alignas ((-__INT_MAX__-1)/2) char h3; /* { dg-error "too large|power of 2" } */
+_Alignas ((-__INT_MAX__-1)/4) char h4; /* { dg-error "too large|power of 2" } */
+_Alignas ((-__INT_MAX__-1)/8) char h5; /* { dg-error "too large|power of 2" } */
+_Alignas (-__LONG_LONG_MAX__-1) char i; /* { dg-error "too large|power of 2" } */
+_Alignas (-(__LONG_LONG_MAX__-1)/2) char i2; /* { dg-error "too large|power of 2" } */
+_Alignas (-(__LONG_LONG_MAX__-1)/4) char i3; /* { dg-error "too large|power of 2" } */
+_Alignas (-(__LONG_LONG_MAX__-1)/8) char i4; /* { dg-error "too large|power of 2" } */
+_Alignas (-(__LONG_LONG_MAX__-1)/16) char i5; /* { dg-error "too large|power of 2" } */
+_Alignas (-1) char j; /* { dg-error "power of 2" } */
+_Alignas (-2) char j; /* { dg-error "positive power of 2" } */
+_Alignas (3) char k; /* { dg-error "power of 2" } */
+
+_Alignas ((void *) 1) char k; /* { dg-error "integer constant" } */
+int x;
+_Alignas (x) char l; /* { dg-error "integer constant" } */
+
+_Alignas (0) struct s; /* { dg-error "does not redeclare tag" } */
+
+_Alignas (0) typedef int T; /* { dg-error "alignment specified for typedef" } */
+void func (_Alignas (0) int); /* { dg-error "alignment specified for unnamed parameter" } */
+void f2 (_Alignas (0) int parm2) {} /* { dg-error "alignment specified for parameter" } */
+void
+f3 (void)
+{
+ register _Alignas (0) int reg; /* { dg-error "register" } */
+}
+_Alignas (0) void f4 (void); /* { dg-error "alignment specified for function" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-4.c
new file mode 100644
index 000000000..6377db6ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-4.c
@@ -0,0 +1,9 @@
+/* Test C11 alignment support. Test reducing alignment (assumes there
+ are at least some alignment constraints). */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+/* { dg-skip-if "no alignment constraints" { "avr-*-*" } { "*" } { "" } } */
+
+#include <stddef.h>
+
+_Alignas (_Alignof (char)) max_align_t x; /* { dg-error "reduce alignment" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-5.c
new file mode 100644
index 000000000..f3a14779f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-5.c
@@ -0,0 +1,28 @@
+/* Test C11 alignment support. Test invalid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+void foo (int []);
+void bar1 (int [_Alignas (double) 10]); /* { dg-error "expected expression before" } */
+void bar2 (int [static _Alignas (double) 10]); /* { dg-error "expected expression before" } */
+void bar3 (int [static const _Alignas (double) 10]); /* { dg-error "expected expression before" } */
+void bar4 (int [const _Alignas (double) 10]); /* { dg-error "expected expression before" } */
+void bar5 (int [_Alignas (0) *]); /* { dg-error "expected expression before" } */
+
+void foo (int a[_Alignas (0) 10]) { } /* { dg-error "expected expression before" } */
+
+void
+test (void)
+{
+ int *_Alignas (long) p; /* { dg-error "expected" } */
+ int *const _Alignas (long) *q; /* { dg-error "expected" } */
+ struct s { int n; };
+ __builtin_offsetof (struct s _Alignas (int), n); /* { dg-error "expected" } */
+ __typeof (long double _Alignas (0)) e; /* { dg-error "expected" } */
+ sizeof (int _Alignas (int)); /* { dg-error "expected" } */
+ _Alignas (int _Alignas (float)) int t; /* { dg-error "expected" } */
+ __builtin_types_compatible_p (signed _Alignas (0), unsigned); /* { dg-error "expected" } */
+ int a[_Alignas (int) 10]; /* { dg-error "expected expression before" } */
+ int b[10];
+ foo (b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-6.c
new file mode 100644
index 000000000..7ea994da4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-align-6.c
@@ -0,0 +1,40 @@
+/* Test C11 _Alignof returning minimum alignment for a type. PR
+ 52023. */
+/* { dg-do run } */
+/* { dg-options "-std=c11" } */
+
+extern void abort (void);
+extern void exit (int);
+
+#define CHECK_ALIGN(TYPE) \
+ do \
+ { \
+ struct { char c; TYPE v; } x; \
+ if (_Alignof (TYPE) > __alignof__ (x.v)) \
+ abort (); \
+ } \
+ while (0)
+
+int
+main (void)
+{
+ CHECK_ALIGN (_Bool);
+ CHECK_ALIGN (char);
+ CHECK_ALIGN (signed char);
+ CHECK_ALIGN (unsigned char);
+ CHECK_ALIGN (signed short);
+ CHECK_ALIGN (unsigned short);
+ CHECK_ALIGN (signed int);
+ CHECK_ALIGN (unsigned int);
+ CHECK_ALIGN (signed long);
+ CHECK_ALIGN (unsigned long);
+ CHECK_ALIGN (signed long long);
+ CHECK_ALIGN (unsigned long long);
+ CHECK_ALIGN (float);
+ CHECK_ALIGN (double);
+ CHECK_ALIGN (long double);
+ CHECK_ALIGN (_Complex float);
+ CHECK_ALIGN (_Complex double);
+ CHECK_ALIGN (_Complex long double);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-1.c
new file mode 100644
index 000000000..779ae66b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-1.c
@@ -0,0 +1,72 @@
+/* Test for anonymous structures and unions in C11. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stddef.h>
+
+struct s1
+{
+ int a;
+ union
+ {
+ int i;
+ };
+ struct
+ {
+ int b;
+ };
+};
+
+union u1
+{
+ int b;
+ struct
+ {
+ int i;
+ };
+ union
+ {
+ int c;
+ };
+};
+
+struct s2
+{
+ struct
+ {
+ int a;
+ };
+};
+
+struct s3
+{
+ union
+ {
+ int i;
+ };
+};
+
+struct s4
+{
+ struct
+ {
+ int i;
+ };
+ int a[];
+};
+
+struct s1 x =
+ {
+ .b = 1,
+ .i = 2,
+ .a = 3
+ };
+
+int o = offsetof (struct s1, i);
+
+void
+f (void)
+{
+ x.i = 3;
+ (&x)->i = 4;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-2.c
new file mode 100644
index 000000000..d954b4b12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-2.c
@@ -0,0 +1,57 @@
+/* Test for anonymous structures and unions in C11. Test for invalid
+ cases. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+typedef struct s0
+{
+ int i;
+} s0;
+
+struct s1
+{
+ int a;
+ struct s0; /* { dg-error "declaration does not declare anything" } */
+};
+
+struct s2
+{
+ int a;
+ s0; /* { dg-error "declaration does not declare anything" } */
+};
+
+struct s3
+{
+ struct
+ {
+ int i;
+ };
+ struct
+ {
+ int i; /* { dg-error "duplicate member" } */
+ };
+};
+
+struct s4
+{
+ int a;
+ struct s
+ {
+ int i;
+ }; /* { dg-error "declaration does not declare anything" } */
+};
+
+struct s5
+{
+ struct
+ {
+ int i;
+ } a;
+ int b;
+} x;
+
+void
+f (void)
+{
+ x.i = 0; /* { dg-error "has no member" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-3.c
new file mode 100644
index 000000000..05cc3660c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-anon-struct-3.c
@@ -0,0 +1,34 @@
+/* Test for anonymous structures and unions in C11. Test for invalid
+ cases: typedefs disallowed by N1549. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+typedef struct
+{
+ int i;
+} s0;
+
+typedef union
+{
+ int i;
+} u0;
+
+struct s1
+{
+ int a;
+ u0; /* { dg-error "declaration does not declare anything" } */
+ struct
+ {
+ int b;
+ };
+};
+
+union u1
+{
+ int b;
+ s0; /* { dg-error "declaration does not declare anything" } */
+ union
+ {
+ int c;
+ };
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-1.c
new file mode 100644
index 000000000..c7f9a1ef4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-1.c
@@ -0,0 +1,267 @@
+/* Test for _Atomic in C11. Test of valid code. See c11-atomic-2.c
+ for more exhaustive tests of assignment cases. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+/* The use of _Atomic as a qualifier, and of _Atomic (type-name), give
+ the same type. */
+extern _Atomic int a;
+extern _Atomic (int) a;
+extern int *_Atomic b;
+extern _Atomic (int *) b;
+extern void f (int [_Atomic]);
+extern void f (int *_Atomic);
+
+/* _Atomic may be applied to arbitrary types, with or without other
+ qualifiers, and assignments may be made as with non-atomic
+ types. Structure and union elements may be atomic. */
+_Atomic int ai1, ai2;
+int i1;
+volatile _Atomic long double ald1;
+const _Atomic long double ald2;
+long double ld1;
+_Atomic _Complex double acd1, acd2;
+_Complex double d1;
+_Atomic volatile _Bool ab1;
+int *p;
+int *_Atomic restrict ap;
+struct s { char c[1000]; };
+_Atomic struct s as1;
+struct s s1;
+struct t { _Atomic int i; };
+_Atomic struct t at1;
+_Atomic struct t *atp1;
+struct t t1;
+union u { char c[1000]; };
+_Atomic union u au1;
+union u u1;
+union v { _Atomic int i; };
+_Atomic union v av1;
+union v v1;
+
+void
+func (_Atomic volatile long al1)
+{
+ ai1 = ai2;
+ ai1 = i1;
+ i1 = ai2;
+ ai1 = ald2;
+ ald1 = d1;
+ ld1 = acd2;
+ acd1 += ab1;
+ acd2 /= ai1;
+ p = ap;
+ ap = p;
+ ab1 = p;
+ as1 = s1;
+ s1 = as1;
+ at1 = t1;
+ t1 = at1;
+ /* It's unclear whether the undefined behavior (6.5.2.3#5) for
+ accessing elements of atomic structures and unions is at
+ translation or execution time; presume here that it's at
+ execution time. */
+ t1.i = at1.i;
+ at1.i = t1.i;
+ atp1->i = t1.i;
+ au1 = u1;
+ u1 = au1;
+ av1 = v1;
+ v1 = av1;
+ v1.i = av1.i;
+ av1.i = v1.i;
+ /* _Atomic is valid on register variables, even if not particularly
+ useful. */
+ register _Atomic volatile int ra1 = 1, ra2 = 2;
+ ra1 = ra2;
+ ra2 = ra1;
+ /* And on parameters. */
+ al1 = ra1;
+ ra2 = al1;
+}
+
+/* A function may return an atomic type. */
+_Atomic int
+func2 (int i)
+{
+ return i;
+}
+
+/* Casts may specify atomic type. */
+int
+func3 (int i)
+{
+ return func2 ((_Atomic long) i);
+}
+
+/* The _Atomic void type is valid. */
+_Atomic void *avp;
+
+/* An array of atomic elements is valid (the elements being atomic,
+ not the array). */
+_Atomic int aa[10];
+int
+func4 (void)
+{
+ return aa[2];
+}
+
+/* Increment and decrement are valid for atomic types when they are
+ valid for non-atomic types. */
+void
+func5 (void)
+{
+ ald1++;
+ ald1--;
+ ++ald1;
+ --ald1;
+ ai1++;
+ ai1--;
+ ++ai1;
+ --ai1;
+ ab1++;
+ ab1--;
+ ++ab1;
+ --ab1;
+ ap++;
+ ap--;
+ ++ap;
+ --ap;
+}
+
+/* Compound literals may have atomic type. */
+_Atomic int *aiclp = &(_Atomic int) { 1 };
+
+/* Test unary & and *. */
+void
+func6 (void)
+{
+ int i = *aiclp;
+ _Atomic int *p = &ai2;
+}
+
+/* Casts to atomic type are valid (although the _Atomic has little
+ effect because the result is an rvalue). */
+int i2 = (_Atomic int) 1.0;
+
+/* For pointer subtraction and comparisons, _Atomic does not count as
+ a qualifier. Likewise for conditional expressions. */
+_Atomic int *xaip1;
+volatile _Atomic int *xaip2;
+void *xvp1;
+
+void
+func7 (void)
+{
+ int r;
+ r = xaip1 - xaip2;
+ r = xaip1 < xaip2;
+ r = xaip1 > xaip2;
+ r = xaip1 <= xaip2;
+ r = xaip1 >= xaip2;
+ r = xaip1 == xaip2;
+ r = xaip1 != xaip2;
+ r = xaip1 == xvp1;
+ r = xaip1 != xvp1;
+ r = xvp1 == xaip1;
+ r = xvp1 != xaip1;
+ r = xaip1 == 0;
+ r = ((void *) 0) == xaip2;
+ (void) (r ? xaip1 : xaip2);
+ (void) (r ? xvp1 : xaip2);
+ (void) (r ? xaip2 : xvp1);
+ (void) (r ? xaip1 : 0);
+ (void) (r ? 0 : xaip1);
+ /* The result of a conditional expression between a pointer to
+ qualified or unqualified (but not atomic) void, and a pointer to
+ an atomic type, is a pointer to appropriately qualified, not
+ atomic, void. As such, it is valid to use further in conditional
+ expressions with other pointer types. */
+ (void) (r ? xaip1 : (r ? xaip1 : xvp1));
+}
+
+/* Pointer += and -= integer is valid. */
+void
+func8 (void)
+{
+ b += 1;
+ b -= 2ULL;
+ ap += 3;
+}
+
+/* Various other cases of simple assignment are valid (some already
+ tested above). */
+void
+func9 (void)
+{
+ ap = 0;
+ ap = (void *) 0;
+ xvp1 = atp1;
+ atp1 = xvp1;
+}
+
+/* Test compatibility of function types in cases where _Atomic matches
+ (see c11-atomic-3.c for corresponding cases where it doesn't
+ match). */
+void fc0a (int const);
+void fc0a (int);
+void fc0b (int _Atomic);
+void fc0b (int _Atomic);
+void fc1a (int);
+void
+fc1a (x)
+ volatile int x;
+{
+}
+void fc1b (_Atomic int);
+void
+fc1b (x)
+ volatile _Atomic int x;
+{
+}
+void
+fc2a (x)
+ const int x;
+{
+}
+void fc2a (int); /* { dg-warning "follows non-prototype" } */
+void
+fc2b (x)
+ _Atomic int x;
+{
+}
+void fc2b (_Atomic int); /* { dg-warning "follows non-prototype" } */
+void fc3a (int);
+void
+fc3a (x)
+ volatile short x;
+{
+}
+void fc3b (_Atomic int);
+void
+fc3b (x)
+ _Atomic short x;
+{
+}
+void
+fc4a (x)
+ const short x;
+{
+}
+void fc4a (int); /* { dg-warning "follows non-prototype" } */
+void
+fc4b (x)
+ _Atomic short x;
+{
+}
+void fc4b (_Atomic int); /* { dg-warning "follows non-prototype" } */
+
+/* Test cases involving C_MAYBE_CONST_EXPR work. */
+void
+func10 (_Atomic int *p)
+{
+ p[0 / 0] = 1; /* { dg-warning "division by zero" } */
+ p[0 / 0] += 1; /* { dg-warning "division by zero" } */
+ *p = 0 / 0; /* { dg-warning "division by zero" } */
+ *p += 0 / 0; /* { dg-warning "division by zero" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-2.c
new file mode 100644
index 000000000..34ee081d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-2.c
@@ -0,0 +1,165 @@
+/* Test for _Atomic in C11. Test of valid assignment cases for
+ arithmetic types. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#define TEST_ASSIGN(TYPE1, OP, TYPE2) \
+ do \
+ { \
+ _Atomic TYPE1 a = 0; \
+ TYPE2 b = 0; \
+ _Atomic TYPE2 c = 0; \
+ a OP b; \
+ a OP c; \
+ } \
+ while (0)
+
+#define TEST_ASSIGN_ARITHR(TYPE1, OP) \
+ do \
+ { \
+ TEST_ASSIGN (TYPE1, OP, _Bool); \
+ TEST_ASSIGN (TYPE1, OP, char); \
+ TEST_ASSIGN (TYPE1, OP, signed char); \
+ TEST_ASSIGN (TYPE1, OP, unsigned char); \
+ TEST_ASSIGN (TYPE1, OP, signed short); \
+ TEST_ASSIGN (TYPE1, OP, unsigned short); \
+ TEST_ASSIGN (TYPE1, OP, signed int); \
+ TEST_ASSIGN (TYPE1, OP, unsigned int); \
+ TEST_ASSIGN (TYPE1, OP, signed long); \
+ TEST_ASSIGN (TYPE1, OP, unsigned long); \
+ TEST_ASSIGN (TYPE1, OP, signed long long); \
+ TEST_ASSIGN (TYPE1, OP, unsigned long long); \
+ TEST_ASSIGN (TYPE1, OP, float); \
+ TEST_ASSIGN (TYPE1, OP, double); \
+ TEST_ASSIGN (TYPE1, OP, long double); \
+ TEST_ASSIGN (TYPE1, OP, _Complex float); \
+ TEST_ASSIGN (TYPE1, OP, _Complex double); \
+ TEST_ASSIGN (TYPE1, OP, _Complex long double); \
+ } \
+ while (0)
+
+#define TEST_ASSIGN_ARITHBOTH(OP) \
+ do \
+ { \
+ TEST_ASSIGN_ARITHR (_Bool, OP); \
+ TEST_ASSIGN_ARITHR (char, OP); \
+ TEST_ASSIGN_ARITHR (signed char, OP); \
+ TEST_ASSIGN_ARITHR (unsigned char, OP); \
+ TEST_ASSIGN_ARITHR (signed short, OP); \
+ TEST_ASSIGN_ARITHR (unsigned short, OP); \
+ TEST_ASSIGN_ARITHR (signed int, OP); \
+ TEST_ASSIGN_ARITHR (unsigned int, OP); \
+ TEST_ASSIGN_ARITHR (signed long, OP); \
+ TEST_ASSIGN_ARITHR (unsigned long, OP); \
+ TEST_ASSIGN_ARITHR (signed long long, OP); \
+ TEST_ASSIGN_ARITHR (unsigned long long, OP); \
+ TEST_ASSIGN_ARITHR (float, OP); \
+ TEST_ASSIGN_ARITHR (double, OP); \
+ TEST_ASSIGN_ARITHR (long double, OP); \
+ TEST_ASSIGN_ARITHR (_Complex float, OP); \
+ TEST_ASSIGN_ARITHR (_Complex double, OP); \
+ TEST_ASSIGN_ARITHR (_Complex long double, OP); \
+ } \
+ while (0)
+
+#define TEST_ASSIGN_INTR(TYPE1, OP) \
+ do \
+ { \
+ TEST_ASSIGN (TYPE1, OP, _Bool); \
+ TEST_ASSIGN (TYPE1, OP, char); \
+ TEST_ASSIGN (TYPE1, OP, signed char); \
+ TEST_ASSIGN (TYPE1, OP, unsigned char); \
+ TEST_ASSIGN (TYPE1, OP, signed short); \
+ TEST_ASSIGN (TYPE1, OP, unsigned short); \
+ TEST_ASSIGN (TYPE1, OP, signed int); \
+ TEST_ASSIGN (TYPE1, OP, unsigned int); \
+ TEST_ASSIGN (TYPE1, OP, signed long); \
+ TEST_ASSIGN (TYPE1, OP, unsigned long); \
+ TEST_ASSIGN (TYPE1, OP, signed long long); \
+ TEST_ASSIGN (TYPE1, OP, unsigned long long); \
+ } \
+ while (0)
+
+#define TEST_ASSIGN_INTBOTH(OP) \
+ do \
+ { \
+ TEST_ASSIGN_INTR (_Bool, OP); \
+ TEST_ASSIGN_INTR (char, OP); \
+ TEST_ASSIGN_INTR (signed char, OP); \
+ TEST_ASSIGN_INTR (unsigned char, OP); \
+ TEST_ASSIGN_INTR (signed short, OP); \
+ TEST_ASSIGN_INTR (unsigned short, OP); \
+ TEST_ASSIGN_INTR (signed int, OP); \
+ TEST_ASSIGN_INTR (unsigned int, OP); \
+ TEST_ASSIGN_INTR (signed long, OP); \
+ TEST_ASSIGN_INTR (unsigned long, OP); \
+ TEST_ASSIGN_INTR (signed long long, OP); \
+ TEST_ASSIGN_INTR (unsigned long long, OP); \
+ } \
+ while (0)
+
+void
+test_simple (void)
+{
+ TEST_ASSIGN_ARITHBOTH (=);
+}
+
+void
+test_mult (void)
+{
+ TEST_ASSIGN_ARITHBOTH (*=);
+}
+
+void
+test_div (void)
+{
+ TEST_ASSIGN_ARITHBOTH (/=);
+}
+
+void
+test_mod (void)
+{
+ TEST_ASSIGN_INTBOTH (%=);
+}
+
+void
+test_plus (void)
+{
+ TEST_ASSIGN_ARITHBOTH (+=);
+}
+
+void
+test_minus (void)
+{
+ TEST_ASSIGN_ARITHBOTH (-=);
+}
+
+void
+test_lshift (void)
+{
+ TEST_ASSIGN_INTBOTH (<<=);
+}
+
+void
+test_rshift (void)
+{
+ TEST_ASSIGN_INTBOTH (>>=);
+}
+
+void
+test_and (void)
+{
+ TEST_ASSIGN_INTBOTH (&=);
+}
+
+void
+test_xor (void)
+{
+ TEST_ASSIGN_INTBOTH (^=);
+}
+
+void
+test_or (void)
+{
+ TEST_ASSIGN_INTBOTH (|=);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-3.c
new file mode 100644
index 000000000..4b314e88a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-atomic-3.c
@@ -0,0 +1,174 @@
+/* Test for _Atomic in C11. Test of invalid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+/* Increment and decrement are invalid for atomic complex types and
+ atomic pointers to incomplete types, just as for the corresponding
+ non-atomic types. Likewise for types on which arithmetic is
+ invalid. */
+_Atomic _Complex float acf;
+void *_Atomic apv;
+struct s *_Atomic aps;
+_Atomic struct t { char c; } as;
+
+void
+func (void)
+{
+ acf++; /* { dg-error "complex types" } */
+ acf--; /* { dg-error "complex types" } */
+ ++acf; /* { dg-error "complex types" } */
+ --acf; /* { dg-error "complex types" } */
+ apv++; /* { dg-error "wrong type|pointer of type" } */
+ apv--; /* { dg-error "wrong type|pointer of type" } */
+ ++apv; /* { dg-error "wrong type|pointer of type" } */
+ --apv; /* { dg-error "wrong type|pointer of type" } */
+ aps++; /* { dg-error "pointer to|invalid use of undefined type" } */
+ aps--; /* { dg-error "pointer to|invalid use of undefined type" } */
+ ++aps; /* { dg-error "pointer to|invalid use of undefined type" } */
+ --aps; /* { dg-error "pointer to|invalid use of undefined type" } */
+ as++; /* { dg-error "wrong type" } */
+ as--; /* { dg-error "wrong type" } */
+ ++as; /* { dg-error "wrong type" } */
+ --as; /* { dg-error "wrong type" } */
+}
+
+/* Pointer subtraction and comparisons differing in _Atomic are
+ invalid where such subtraction and comparisons differing in
+ qualifiers are valid. There is no special allowance for equality
+ comparisons of pointers to atomic void to pointers to object
+ types. Likewise for conditional expressions. */
+int *pi;
+_Atomic int *pai;
+_Atomic void *pav;
+int r;
+
+void
+func2 (void)
+{
+ r = pai - pi; /* { dg-error "invalid operands" } */
+ r = pi - pai; /* { dg-error "invalid operands" } */
+ r = pi < pai; /* { dg-error "distinct pointer types" } */
+ r = pi > pai; /* { dg-error "distinct pointer types" } */
+ r = pi <= pai; /* { dg-error "distinct pointer types" } */
+ r = pi >= pai; /* { dg-error "distinct pointer types" } */
+ r = pai < pi; /* { dg-error "distinct pointer types" } */
+ r = pai > pi; /* { dg-error "distinct pointer types" } */
+ r = pai <= pi; /* { dg-error "distinct pointer types" } */
+ r = pai >= pi; /* { dg-error "distinct pointer types" } */
+ r = pav == pi; /* { dg-error "distinct pointer types" } */
+ r = pav != pi; /* { dg-error "distinct pointer types" } */
+ r = pi == pav; /* { dg-error "distinct pointer types" } */
+ r = pi != pav; /* { dg-error "distinct pointer types" } */
+ (void) (r ? pai : pi); /* { dg-error "pointer type mismatch" } */
+ (void) (r ? pi : pai); /* { dg-error "pointer type mismatch" } */
+ (void) (r ? pai : pav); /* { dg-error "pointer type mismatch" } */
+ (void) (r ? pav : pai); /* { dg-error "pointer type mismatch" } */
+}
+
+/* Likewise for pointer assignment. */
+void
+func3 (void)
+{
+ pai = pi; /* { dg-error "incompatible pointer type" } */
+ pi = pai; /* { dg-error "incompatible pointer type" } */
+ pav = pai; /* { dg-error "incompatible pointer type" } */
+ pai = pav; /* { dg-error "incompatible pointer type" } */
+}
+
+/* Cases that are invalid for normal assignments are just as invalid
+ (and should not ICE) when the LHS is atomic. */
+void
+func4 (void)
+{
+ as = acf; /* { dg-error "incompatible types" } */
+ apv = as; /* { dg-error "incompatible types" } */
+ as += 1; /* { dg-error "invalid operands" } */
+ apv -= 1; /* { dg-error "pointer of type" } */
+ apv *= 1; /* { dg-error "invalid operands" } */
+ apv /= 1; /* { dg-error "invalid operands" } */
+ apv %= 1; /* { dg-error "invalid operands" } */
+ apv <<= 1; /* { dg-error "invalid operands" } */
+ apv >>= 1; /* { dg-error "invalid operands" } */
+ apv &= 1; /* { dg-error "invalid operands" } */
+ apv ^= 1; /* { dg-error "invalid operands" } */
+ apv |= 1; /* { dg-error "invalid operands" } */
+}
+
+/* We don't allow atomic bit-fields in GCC (implementation-defined
+ whether they are permitted). */
+struct abf
+{
+ _Atomic int i : 1; /* { dg-error "atomic type" } */
+ _Atomic int : 0; /* { dg-error "atomic type" } */
+};
+
+/* _Atomic (type-name) may not use a name for an array, function,
+ qualified or atomic type. */
+_Atomic (int [2]) v0; /* { dg-error "array type" } */
+_Atomic (void (void)) v1; /* { dg-error "function type" } */
+_Atomic (_Atomic int) v2; /* { dg-error "applied to a qualified type" } */
+_Atomic (const int) v3; /* { dg-error "applied to a qualified type" } */
+_Atomic (volatile int) v4; /* { dg-error "applied to a qualified type" } */
+_Atomic (int *restrict) v5; /* { dg-error "applied to a qualified type" } */
+
+/* _Atomic, used as a qualifier, may not be applied to a function or
+ array type. */
+typedef int arraytype[2];
+typedef void functiontype (void);
+_Atomic arraytype v6; /* { dg-error "array type" } */
+_Atomic arraytype *v7; /* { dg-error "array type" } */
+typedef _Atomic arraytype v8; /* { dg-error "array type" } */
+int v9 = sizeof (_Atomic arraytype); /* { dg-error "array type" } */
+void v10 (_Atomic arraytype parm); /* { dg-error "array type" } */
+struct v11 { _Atomic arraytype f; }; /* { dg-error "array type" } */
+_Atomic functiontype v12; /* { dg-error "function type" } */
+_Atomic functiontype *v13; /* { dg-error "function type" } */
+typedef _Atomic functiontype *v14; /* { dg-error "function type" } */
+void v15 (_Atomic functiontype parm); /* { dg-error "function type" } */
+
+/* Function parameters, when function types are required to be
+ compatible, may not differ in the presence of _Atomic. See
+ c11-atomic-1.c for corresponding tests where _Atomic matches. */
+void fc0 (int _Atomic); /* { dg-message "previous declaration" } */
+void fc0 (int); /* { dg-error "conflicting types" } */
+void fc1 (int); /* { dg-message "prototype declaration" } */
+void
+fc1 (x)
+ _Atomic int x; /* { dg-error "match prototype" } */
+{
+}
+void
+fc2 (x) /* { dg-message "previous definition" } */
+ _Atomic int x;
+{
+}
+void fc2 (int); /* { dg-error "incompatible type" } */
+void fc3 (int); /* { dg-message "prototype declaration" } */
+void
+fc3 (x)
+ _Atomic short x; /* { dg-error "match prototype" } */
+{
+}
+void
+fc4 (x) /* { dg-message "previous definition" } */
+ _Atomic short x;
+{
+}
+void fc4 (int); /* { dg-error "incompatible type" } */
+
+/* Arrays of atomic elements cannot be initialized with string
+ literals. */
+_Atomic char si0[] = ""; /* { dg-error "inappropriate type" } */
+_Atomic char si1[] = u8""; /* { dg-error "inappropriate type" } */
+_Atomic signed char si2[] = ""; /* { dg-error "inappropriate type" } */
+_Atomic signed char si3[] = u8""; /* { dg-error "inappropriate type" } */
+_Atomic unsigned char si4[] = ""; /* { dg-error "inappropriate type" } */
+_Atomic unsigned char si5[] = u8""; /* { dg-error "inappropriate type" } */
+_Atomic __WCHAR_TYPE__ si6[] = L""; /* { dg-error "inappropriate type" } */
+_Atomic __CHAR16_TYPE__ si7[] = u""; /* { dg-error "inappropriate type" } */
+_Atomic __CHAR32_TYPE__ si8[] = U""; /* { dg-error "inappropriate type" } */
+
+/* Anything that is syntactically a qualifier applied to the (void)
+ parameter list results in undefined behavior, which we
+ diagnose. */
+void fv (_Atomic void); /* { dg-error "may not be qualified" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-complex-1.c
new file mode 100644
index 000000000..4acb2bcc2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-complex-1.c
@@ -0,0 +1,43 @@
+/* Test complex divide does not have the bug identified in N1496. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+/* { dg-add-options ieee } */
+
+extern void abort (void);
+extern void exit (int);
+
+#define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y))
+#define CMPLXF(x, y) __builtin_complex ((float) (x), (float) (y))
+#define CMPLXL(x, y) __builtin_complex ((long double) (x), (long double) (y))
+#define NAN __builtin_nanf ("")
+#define isnan(x) __builtin_isnan (x)
+
+volatile _Complex float num_f = CMPLXF (1, 1);
+volatile _Complex float den_f = CMPLXF (0, NAN);
+volatile _Complex float res_f, cres_f = CMPLXF (1, 1) / CMPLXF (0, NAN);
+
+volatile _Complex double num_d = CMPLX (1, 1);
+volatile _Complex double den_d = CMPLX (0, NAN);
+volatile _Complex double res_d, cres_d = CMPLX (1, 1) / CMPLX (0, NAN);
+
+volatile _Complex long double num_ld = CMPLXL (1, 1);
+volatile _Complex long double den_ld = CMPLXL (0, NAN);
+volatile _Complex long double res_ld, cres_ld = CMPLXL (1, 1) / CMPLXL (0, NAN);
+
+int
+main (void)
+{
+ res_f = num_f / den_f;
+ if (!isnan (__real__ res_f) || !isnan (__imag__ res_f)
+ || !isnan (__real__ cres_f) || !isnan (__imag__ cres_f))
+ abort ();
+ res_d = num_d / den_d;
+ if (!isnan (__real__ res_d) || !isnan (__imag__ res_d)
+ || !isnan (__real__ cres_d) || !isnan (__imag__ cres_d))
+ abort ();
+ res_ld = num_ld / den_ld;
+ if (!isnan (__real__ res_ld) || !isnan (__imag__ res_ld)
+ || !isnan (__real__ cres_ld) || !isnan (__imag__ cres_ld))
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-float-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-float-1.c
new file mode 100644
index 000000000..376c44d3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-float-1.c
@@ -0,0 +1,169 @@
+/* Test for <float.h> C11 macros. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do preprocess } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+/* This test checks that the C11 macros are defined;
+ it does not check the correctness of their values. */
+
+#include <float.h>
+
+#ifndef FLT_ROUNDS
+#error "FLT_ROUNDS undefined"
+#endif
+
+#ifndef FLT_RADIX
+#error "FLT_RADIX undefined"
+#endif
+
+#ifndef FLT_MANT_DIG
+#error "FLT_MANT_DIG undefined"
+#endif
+
+#ifndef FLT_DIG
+#error "FLT_DIG undefined"
+#endif
+
+#ifndef FLT_MIN_EXP
+#error "FLT_MIN_EXP undefined"
+#endif
+
+#ifndef FLT_MIN_10_EXP
+#error "FLT_MIN_10_EXP undefined"
+#endif
+
+#ifndef FLT_MAX_EXP
+#error "FLT_MAX_EXP undefined"
+#endif
+
+#ifndef FLT_MAX_10_EXP
+#error "FLT_MAX_10_EXP undefined"
+#endif
+
+#ifndef FLT_MAX
+#error "FLT_MAX undefined"
+#endif
+
+#ifndef FLT_EPSILON
+#error "FLT_EPSILON undefined"
+#endif
+
+#ifndef FLT_MIN
+#error "FLT_MIN undefined"
+#endif
+
+#ifndef DBL_MANT_DIG
+#error "DBL_MANT_DIG undefined"
+#endif
+
+#ifndef DBL_DIG
+#error "DBL_DIG undefined"
+#endif
+
+#ifndef DBL_MIN_EXP
+#error "DBL_MIN_EXP undefined"
+#endif
+
+#ifndef DBL_MIN_10_EXP
+#error "DBL_MIN_10_EXP undefined"
+#endif
+
+#ifndef DBL_MAX_EXP
+#error "DBL_MAX_EXP undefined"
+#endif
+
+#ifndef DBL_MAX_10_EXP
+#error "DBL_MAX_10_EXP undefined"
+#endif
+
+#ifndef DBL_MAX
+#error "DBL_MAX undefined"
+#endif
+
+#ifndef DBL_EPSILON
+#error "DBL_EPSILON undefined"
+#endif
+
+#ifndef DBL_MIN
+#error "DBL_MIN undefined"
+#endif
+
+#ifndef LDBL_MANT_DIG
+#error "LDBL_MANT_DIG undefined"
+#endif
+
+#ifndef LDBL_DIG
+#error "LDBL_DIG undefined"
+#endif
+
+#ifndef LDBL_MIN_EXP
+#error "LDBL_MIN_EXP undefined"
+#endif
+
+#ifndef LDBL_MIN_10_EXP
+#error "LDBL_MIN_10_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX_EXP
+#error "LDBL_MAX_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX_10_EXP
+#error "LDBL_MAX_10_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX
+#error "LDBL_MAX undefined"
+#endif
+
+#ifndef LDBL_EPSILON
+#error "LDBL_EPSILON undefined"
+#endif
+
+#ifndef LDBL_MIN
+#error "LDBL_MIN undefined"
+#endif
+
+#ifndef FLT_EVAL_METHOD
+#error "FLT_EVAL_METHOD undefined"
+#endif
+
+#ifndef DECIMAL_DIG
+#error "DECIMAL_DIG undefined"
+#endif
+
+#ifndef FLT_DECIMAL_DIG
+#error "FLT_DECIMAL_DIG undefined"
+#endif
+
+#ifndef DBL_DECIMAL_DIG
+#error "DBL_DECIMAL_DIG undefined"
+#endif
+
+#ifndef LDBL_DECIMAL_DIG
+#error "LDBL_DECIMAL_DIG undefined"
+#endif
+
+#ifndef FLT_HAS_SUBNORM
+#error "FLT_HAS_SUBNORM undefined"
+#endif
+
+#ifndef DBL_HAS_SUBNORM
+#error "DBL_HAS_SUBNORM undefined"
+#endif
+
+#ifndef LDBL_HAS_SUBNORM
+#error "LDBL_HAS_SUBNORM undefined"
+#endif
+
+#ifndef FLT_TRUE_MIN
+#error "FLT_TRUE_MIN undefined"
+#endif
+
+#ifndef DBL_TRUE_MIN
+#error "DBL_TRUE_MIN undefined"
+#endif
+
+#ifndef LDBL_TRUE_MIN
+#error "LDBL_TRUE_MIN undefined"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-generic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-generic-1.c
new file mode 100644
index 000000000..60ef1f0eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-generic-1.c
@@ -0,0 +1,57 @@
+/* Test C11 _Generic. Valid uses. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+_Noreturn extern void exit (int);
+_Noreturn extern void abort (void);
+
+void
+check (int n)
+{
+ if (n)
+ abort ();
+}
+
+int
+main (void)
+{
+ int n = 0;
+
+ check (_Generic (n++, int: 0));
+ /* _Generic should not evaluate its argument. */
+ check (n);
+
+ check (_Generic (n, double: n++, default: 0));
+ check (n);
+
+ /* Qualifiers are removed for the purpose of type matching. */
+ const int cn = 0;
+ check (_Generic (cn, int: 0, default: n++));
+ check (n);
+ check (_Generic ((const int) n, int: 0, default: n++));
+ check (n);
+
+ /* Arrays decay to pointers. */
+ int a[1];
+ const int ca[1];
+ check (_Generic (a, int *: 0, const int *: n++));
+ check (n);
+ check (_Generic (ca, const int *: 0, int *: n++));
+ check (n);
+
+ /* Functions decay to pointers. */
+ extern void f (void);
+ check (_Generic (f, void (*) (void): 0, default: n++));
+ check (n);
+
+ /* _Noreturn is not part of the function type. */
+ check (_Generic (&abort, void (*) (void): 0, default: n++));
+ check (n);
+
+ /* Integer promotions do not occur. */
+ short s;
+ check (_Generic (s, short: 0, int: n++));
+ check (n);
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-generic-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-generic-2.c
new file mode 100644
index 000000000..90be650af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-generic-2.c
@@ -0,0 +1,27 @@
+/* Test C11 _Generic. Error cases. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+struct incomplete;
+
+void
+f (int n)
+{
+ /* Multiple 'default's. */
+ _Generic (n, default: 1, default: 2); /* { dg-error "duplicate .*default.* case" } */
+
+ /* Variably-modified type not ok. */
+ _Generic (n, int[n]: 0, default: 1); /* { dg-error "variable length type" } */
+ /* Type must be complete. */
+ _Generic (n, struct incomplete: 0, default: 1); /* { dg-error "incomplete type" } */
+ _Generic (n, void: 0, default: 1); /* { dg-error "incomplete type" } */
+
+ /* Type must be object type. */
+ _Generic (n, void (void): 0, default: 1); /* { dg-error "function type" } */
+
+ /* Two compatible types in association list. */
+ _Generic (&n, int: 5, signed int: 7, default: 23); /* { dg-error "two compatible types" } */
+
+ /* No matching association. */
+ _Generic (n, void *: 5); /* { dg-error "not compatible with any association" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-1.c
new file mode 100644
index 000000000..e92c5ae04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-1.c
@@ -0,0 +1,59 @@
+/* Test C11 _Noreturn. Test valid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+_Noreturn void exit (int);
+
+_Noreturn int f1 (void);
+
+_Noreturn void f2 (void);
+
+static void _Noreturn f3 (void) { exit (0); }
+
+/* Returning from a noreturn function is undefined at runtime, not a
+ constraint violation, but recommended practice is to diagnose if
+ such a return appears possible. */
+
+_Noreturn int
+f4 (void)
+{
+ return 1; /* { dg-warning "has a 'return' statement" } */
+ /* { dg-warning "does return" "second warning" { target *-*-* } 20 } */
+}
+
+_Noreturn void
+f5 (void)
+{
+ return; /* { dg-warning "has a 'return' statement" } */
+ /* { dg-warning "does return" "second warning" { target *-*-* } 27 } */
+}
+
+_Noreturn void
+f6 (void)
+{
+} /* { dg-warning "does return" } */
+
+_Noreturn void
+f7 (int a)
+{
+ if (a)
+ exit (0);
+} /* { dg-warning "does return" } */
+
+/* Declarations need not all have _Noreturn. */
+
+void f2 (void);
+
+void f8 (void);
+_Noreturn void f8 (void);
+
+/* Duplicate _Noreturn is OK. */
+_Noreturn _Noreturn void _Noreturn f9 (void);
+
+/* _Noreturn does not affect type compatibility. */
+
+void (*fp) (void) = f5;
+
+/* noreturn is an ordinary identifier. */
+
+int noreturn;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-2.c
new file mode 100644
index 000000000..951d028f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-2.c
@@ -0,0 +1,77 @@
+/* Test C11 _Noreturn. Test valid code using stdnoreturn.h. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdnoreturn.h>
+
+extern int strcmp (const char *, const char *);
+
+noreturn void exit (int);
+noreturn void abort (void);
+
+noreturn int f1 (void);
+
+noreturn void f2 (void);
+
+static void noreturn f3 (void) { exit (0); }
+
+/* Returning from a noreturn function is undefined at runtime, not a
+ constraint violation, but recommended practice is to diagnose if
+ such a return appears possible. */
+
+noreturn int
+f4 (void)
+{
+ return 1; /* { dg-warning "has a 'return' statement" } */
+ /* { dg-warning "does return" "second warning" { target *-*-* } 25 } */
+}
+
+noreturn void
+f5 (void)
+{
+ return; /* { dg-warning "has a 'return' statement" } */
+ /* { dg-warning "does return" "second warning" { target *-*-* } 32 } */
+}
+
+noreturn void
+f6 (void)
+{
+} /* { dg-warning "does return" } */
+
+noreturn void
+f7 (int a)
+{
+ if (a)
+ exit (0);
+} /* { dg-warning "does return" } */
+
+/* Declarations need not all have noreturn. */
+
+void f2 (void);
+
+void f8 (void);
+noreturn void f8 (void);
+
+/* Duplicate noreturn is OK. */
+noreturn noreturn void noreturn f9 (void);
+
+/* noreturn does not affect type compatibility. */
+
+void (*fp) (void) = f5;
+
+#ifndef noreturn
+#error "noreturn not defined"
+#endif
+
+#define str(x) #x
+#define xstr(x) str(x)
+
+const char *s = xstr(noreturn);
+
+int
+main (void)
+{
+ if (strcmp (s, "_Noreturn") != 0)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-3.c
new file mode 100644
index 000000000..168d012a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-3.c
@@ -0,0 +1,11 @@
+/* Test C11 _Noreturn. Test _Noreturn on main, hosted. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors -fhosted" } */
+
+_Noreturn void exit (int);
+
+_Noreturn int
+main (void) /* { dg-error "'main' declared '_Noreturn'" } */
+{
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-4.c
new file mode 100644
index 000000000..a92a1140f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-4.c
@@ -0,0 +1,11 @@
+/* Test C11 _Noreturn. Test _Noreturn on main, freestanding. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors -ffreestanding" } */
+
+_Noreturn void exit (int);
+
+_Noreturn int
+main (void)
+{
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-5.c
new file mode 100644
index 000000000..d1c0949f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-noreturn-5.c
@@ -0,0 +1,17 @@
+/* Test C11 _Noreturn. Test invalid uses. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+_Noreturn struct s; /* { dg-error "empty declaration" } */
+
+typedef _Noreturn void f (void); /* { dg-error "typedef" } */
+
+void g (_Noreturn void fp (void)); /* { dg-error "parameter" } */
+
+_Noreturn void (*p) (void); /* { dg-error "variable" } */
+
+struct t { int a; _Noreturn void (*f) (void); }; /* { dg-error "expected" } */
+
+int *_Noreturn *q; /* { dg-error "expected" } */
+
+int i = sizeof (_Noreturn int (*) (void)); /* { dg-error "expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-pointer-float-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-pointer-float-1.c
new file mode 100644
index 000000000..8c2416587
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-pointer-float-1.c
@@ -0,0 +1,28 @@
+/* Test C11 constraint against pointer / floating-point casts. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+void *p;
+float f;
+double d;
+long double ld;
+_Complex float cf;
+_Complex double cd;
+_Complex long double cld;
+
+void
+func (void)
+{
+ f = (float) p; /* { dg-error "pointer" } */
+ d = (double) p; /* { dg-error "pointer" } */
+ ld = (long double) p; /* { dg-error "pointer" } */
+ cf = (_Complex float) p; /* { dg-error "pointer" } */
+ cd = (_Complex double) p; /* { dg-error "pointer" } */
+ cld = (_Complex long double) p; /* { dg-error "pointer" } */
+ p = (void *) f; /* { dg-error "pointer" } */
+ p = (void *) d; /* { dg-error "pointer" } */
+ p = (void *) ld; /* { dg-error "pointer" } */
+ p = (void *) cf; /* { dg-error "pointer" } */
+ p = (void *) cd; /* { dg-error "pointer" } */
+ p = (void *) cld; /* { dg-error "pointer" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-1.c
new file mode 100644
index 000000000..9209a7a40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-1.c
@@ -0,0 +1,41 @@
+/* Test C11 static assertions. Valid assertions. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+_Static_assert (1, "foo");
+
+enum e { E0, E1 };
+
+_Static_assert (E1, L"bar");
+
+_Static_assert (-1, "foo" L"bar");
+
+struct s
+{
+ int a;
+ _Static_assert (3, "s");
+ int b;
+};
+
+union u
+{
+ int i;
+ _Static_assert ((int)1.0, L"");
+};
+
+void
+f (void)
+{
+ int i;
+ i = 1;
+ _Static_assert (0 + 1, "f");
+ i = 2;
+}
+
+void
+g (void)
+{
+ int i = 0;
+ for (_Static_assert (1, ""); i < 10; i++)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-2.c
new file mode 100644
index 000000000..de2f573cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-2.c
@@ -0,0 +1,41 @@
+/* Test C11 static assertions. Failed assertions. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+_Static_assert (0, "assert1"); /* { dg-error "static assertion failed: \"assert1\"" } */
+
+enum e { E0, E1 };
+
+_Static_assert (E0, L"assert2"); /* { dg-error "static assertion failed: \"assert2\"" } */
+
+_Static_assert (-0, "ass" L"ert3"); /* { dg-error "static assertion failed: \"assert3\"" } */
+
+struct s
+{
+ int a;
+ _Static_assert (0, "assert4"); /* { dg-error "static assertion failed: \"assert4\"" } */
+ int b;
+};
+
+union u
+{
+ int i;
+ _Static_assert ((int)0.0, L"assert5"); /* { dg-error "static assertion failed: \"assert5\"" } */
+};
+
+void
+f (void)
+{
+ int i;
+ i = 1;
+ _Static_assert (0 + 0, "assert6"); /* { dg-error "static assertion failed: \"assert6\"" } */
+ i = 2;
+}
+
+void
+g (void)
+{
+ int i = 0;
+ for (_Static_assert (0, "assert7"); i < 10; i++) /* { dg-error "static assertion failed: \"assert7\"" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-3.c
new file mode 100644
index 000000000..79448a533
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-3.c
@@ -0,0 +1,28 @@
+/* Test C11 static assertions. Invalid assertions. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+_Static_assert (__INT_MAX__ * 2, "overflow"); /* { dg-warning "integer overflow in expression" } */
+/* { dg-error "overflow in constant expression" "error" { target *-*-* } 5 } */
+
+_Static_assert ((void *)(__SIZE_TYPE__)16, "non-integer"); /* { dg-error "not an integer" } */
+
+_Static_assert (1.0, "non-integer"); /* { dg-error "not an integer" } */
+
+_Static_assert ((int)(1.0 + 1.0), "non-constant-expression"); /* { dg-error "not an integer constant expression" } */
+
+int i;
+
+_Static_assert (i, "non-constant"); /* { dg-error "not constant" } */
+
+void
+f (void)
+{
+ int j = 0;
+ for (_Static_assert (sizeof (struct s { int k; }), ""); j < 10; j++) /* { dg-error "loop initial declaration" } */
+ ;
+}
+
+_Static_assert (1, 1); /* { dg-error "expected" } */
+
+_Static_assert (1, ("")); /* { dg-error "expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-4.c
new file mode 100644
index 000000000..ddab440ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-4.c
@@ -0,0 +1,13 @@
+/* Test C11 static assertions. More invalid assertions. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+/* Static assertions not valid in old-style parameter declarations
+ because declarations there must have declarators. */
+
+void
+f (i)
+ int i;
+ _Static_assert (1, ""); /* { dg-error "expected" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-5.c
new file mode 100644
index 000000000..e88b8167a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-5.c
@@ -0,0 +1,5 @@
+/* Test C11 static assertions. Non-constant-expression without -pedantic. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11" } */
+
+_Static_assert ((int)(1.0 + 1.0), "non-constant-expression");
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-6.c
new file mode 100644
index 000000000..ac7e14114
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-static-assert-6.c
@@ -0,0 +1,5 @@
+/* Test C11 static assertions. Non-constant-expression with -pedantic. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic" } */
+
+_Static_assert ((int)(1.0 + 1.0), "non-constant-expression"); /* { dg-warning "not an integer constant expression" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-stdatomic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-stdatomic-1.c
new file mode 100644
index 000000000..79909c055
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-stdatomic-1.c
@@ -0,0 +1,119 @@
+/* Test stdatomic.h header contents. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include <stdatomic.h>
+
+#ifndef ATOMIC_BOOL_LOCK_FREE
+# error ATOMIC_BOOL_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_CHAR_LOCK_FREE
+# error ATOMIC_CHAR_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_CHAR16_T_LOCK_FREE
+# error ATOMIC_CHAR16_T_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_CHAR32_T_LOCK_FREE
+# error ATOMIC_CHAR32_T_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_WCHAR_T_LOCK_FREE
+# error ATOMIC_WCHAR_T_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_SHORT_LOCK_FREE
+# error ATOMIC_SHORT_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_INT_LOCK_FREE
+# error ATOMIC_INT_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_LONG_LOCK_FREE
+# error ATOMIC_LONG_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_LLONG_LOCK_FREE
+# error ATOMIC_LLONG_LOCK_FREE not defined
+#endif
+
+#ifndef ATOMIC_POINTER_LOCK_FREE
+# error ATOMIC_POINTER_LOCK_FREE not defined
+#endif
+
+memory_order m0 = memory_order_relaxed;
+memory_order m1 = memory_order_consume;
+memory_order m2 = memory_order_acquire;
+memory_order m3 = memory_order_release;
+memory_order m4 = memory_order_acq_rel;
+memory_order m5 = memory_order_seq_cst;
+
+atomic_flag af = ATOMIC_FLAG_INIT;
+
+struct s { int i[100]; } sv;
+void
+f (void)
+{
+ _Atomic struct s sva = ATOMIC_VAR_INIT (sv);
+}
+
+#ifndef kill_dependency
+# error kill_dependency not defined
+#endif
+
+#define CHECK_ATOMIC_TYPEDEF(A, B) \
+ do \
+ { \
+ A v; \
+ char array1[sizeof (A) == sizeof (B) ? 1 : -1]; \
+ char array2[_Alignof (A) == _Alignof (B) ? 1 : -1]; \
+ } \
+ while (0)
+
+#include <stddef.h>
+#include <stdint.h>
+
+void
+check_typedefs (void)
+{
+ CHECK_ATOMIC_TYPEDEF (atomic_bool, _Atomic _Bool);
+ CHECK_ATOMIC_TYPEDEF (atomic_char, _Atomic char);
+ CHECK_ATOMIC_TYPEDEF (atomic_schar, _Atomic signed char);
+ CHECK_ATOMIC_TYPEDEF (atomic_uchar, _Atomic unsigned char);
+ CHECK_ATOMIC_TYPEDEF (atomic_short, _Atomic short);
+ CHECK_ATOMIC_TYPEDEF (atomic_ushort, _Atomic unsigned short);
+ CHECK_ATOMIC_TYPEDEF (atomic_int, _Atomic int);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint, _Atomic unsigned int);
+ CHECK_ATOMIC_TYPEDEF (atomic_long, _Atomic long);
+ CHECK_ATOMIC_TYPEDEF (atomic_ulong, _Atomic unsigned long);
+ CHECK_ATOMIC_TYPEDEF (atomic_llong, _Atomic long long);
+ CHECK_ATOMIC_TYPEDEF (atomic_ullong, _Atomic unsigned long long);
+ CHECK_ATOMIC_TYPEDEF (atomic_char16_t, _Atomic __CHAR16_TYPE__);
+ CHECK_ATOMIC_TYPEDEF (atomic_char32_t, _Atomic __CHAR32_TYPE__);
+ CHECK_ATOMIC_TYPEDEF (atomic_wchar_t, _Atomic wchar_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_int_least8_t, _Atomic int_least8_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint_least8_t, _Atomic uint_least8_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_int_least16_t, _Atomic int_least16_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint_least16_t, _Atomic uint_least16_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_int_least32_t, _Atomic int_least32_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint_least32_t, _Atomic uint_least32_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_int_least64_t, _Atomic int_least64_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint_least64_t, _Atomic uint_least64_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_int_fast8_t, _Atomic int_fast8_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint_fast8_t, _Atomic uint_fast8_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_int_fast16_t, _Atomic int_fast16_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint_fast16_t, _Atomic uint_fast16_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_int_fast32_t, _Atomic int_fast32_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint_fast32_t, _Atomic uint_fast32_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_int_fast64_t, _Atomic int_fast64_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uint_fast64_t, _Atomic uint_fast64_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_intptr_t, _Atomic intptr_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uintptr_t, _Atomic uintptr_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_size_t, _Atomic size_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_ptrdiff_t, _Atomic ptrdiff_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_intmax_t, _Atomic intmax_t);
+ CHECK_ATOMIC_TYPEDEF (atomic_uintmax_t, _Atomic uintmax_t);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-thread-local-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-thread-local-1.c
new file mode 100644
index 000000000..b21209aec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-thread-local-1.c
@@ -0,0 +1,28 @@
+/* Test for _Thread_local in C11. Test of valid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+_Thread_local int a;
+static _Thread_local long b;
+extern _Thread_local int c, a;
+_Thread_local static int d;
+long _Thread_local extern b;
+_Thread_local int extern a;
+_Thread_local struct s; /* { dg-warning "useless" } */
+_Thread_local int a = 1;
+extern _Thread_local int c = 2; /* { dg-warning "initialized and" } */
+void
+f (void)
+{
+ static _Thread_local int x;
+ extern _Thread_local long b;
+ _Thread_local extern int a;
+}
+
+inline void
+fi (void)
+{
+ static _Thread_local const int v;
+ (void) a;
+ static _Thread_local int (*const p)[a];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-thread-local-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-thread-local-2.c
new file mode 100644
index 000000000..338722616
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-thread-local-2.c
@@ -0,0 +1,46 @@
+/* Test for _Thread_local in C11. Test of invalid code. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+_Thread_local void f (void); /* { dg-error "storage class" } */
+_Thread_local void g (void) {} /* { dg-error "_Thread_local" } */
+typedef _Thread_local int t1; /* { dg-error "_Thread_local" } */
+_Thread_local typedef int t2; /* { dg-error "_Thread_local" } */
+
+void
+h (void)
+{
+ _Thread_local auto int a; /* { dg-error "_Thread_local" } */
+ _Thread_local register int b; /* { dg-error "_Thread_local" } */
+ auto _Thread_local int c; /* { dg-error "_Thread_local" } */
+ register _Thread_local int d; /* { dg-error "_Thread_local" } */
+ _Thread_local int e; /* { dg-error "_Thread_local" } */
+}
+
+_Thread_local int v; /* { dg-message "previous" } */
+extern int v; /* { dg-error "thread" } */
+int w; /* { dg-message "previous" } */
+extern _Thread_local int w; /* { dg-error "thread" } */
+
+_Thread_local int x; /* { dg-message "previous" } */
+int y; /* { dg-message "previous" } */
+
+int vv;
+
+void
+i (void)
+{
+ extern int x; /* { dg-error "thread" } */
+ extern _Thread_local int y; /* { dg-error "thread" } */
+ static _Thread_local int a[vv]; /* { dg-error "storage size" } */
+ static _Thread_local int vi = vv; /* { dg-error "not constant" } */
+}
+
+static _Thread_local int sv;
+
+inline void
+j (void)
+{
+ static _Thread_local int vj; /* { dg-error "static but declared" } */
+ (void) sv; /* { dg-error "static but used in inline" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-typedef-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-typedef-1.c
new file mode 100644
index 000000000..3224ba5a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-typedef-1.c
@@ -0,0 +1,70 @@
+/* Test typedef redeclaration in C11. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+/* C11 permits typedefs to be redeclared to the same type, but not to
+ different-but-compatible types, and not when the type is variably
+ modified. */
+
+#include <limits.h>
+
+typedef int TI;
+typedef int TI2;
+typedef TI2 TI;
+typedef TI TI2;
+
+enum e { E1 = 0, E2 = INT_MAX, E3 = -1 };
+typedef enum e TE;
+typedef enum e TE; /* { dg-message "previous declaration" } */
+typedef int TE; /* { dg-error "with different type" } */
+
+struct s;
+typedef struct s TS;
+struct s { int i; };
+typedef struct s TS;
+
+typedef int IA[];
+typedef TI2 IA[]; /* { dg-message "previous declaration" } */
+typedef int A2[2];
+typedef TI A2[2]; /* { dg-message "previous declaration" } */
+typedef IA A2; /* { dg-error "with different type" } */
+typedef int A3[3];
+typedef A3 IA; /* { dg-error "with different type" } */
+
+typedef void F(int);
+typedef void F(TI); /* { dg-message "previous declaration" } */
+typedef void F(enum e); /* { dg-error "with different type" } */
+
+typedef int G(void);
+typedef TI G(void); /* { dg-message "previous declaration" } */
+typedef enum e G(void); /* { dg-error "with different type" } */
+
+typedef int *P;
+typedef TI *P; /* { dg-message "previous declaration" } */
+typedef enum e *P; /* { dg-error "with different type" } */
+
+typedef void F2();
+typedef void F2(); /* { dg-message "previous declaration" } */
+typedef void F2(int); /* { dg-error "with different type" } */
+
+void
+f (void)
+{
+ int a = 1;
+ int b = 2;
+ typedef void FN(int (*p)[a]);
+ typedef void FN(int (*p)[b]);
+ typedef void FN(int (*p)[*]); /* { dg-message "previous declaration" } */
+ typedef void FN(int (*p)[1]); /* { dg-error "with different type" } */
+ typedef void FN2(int (*p)[a]);
+ typedef void FN2(int (*p)[b]);
+ typedef void FN2(int (*p)[*]); /* { dg-message "previous declaration" } */
+ typedef void FN2(int (*p)[]); /* { dg-error "with different type" } */
+ typedef int AV[a]; /* { dg-message "previous declaration" } */
+ typedef int AV[b-1]; /* { dg-error "redefinition" } */
+ typedef int AAa[a]; /* { dg-message "previous declaration" } */
+ typedef int AAb[b-1];
+ typedef AAa *VF(void); /* { dg-message "previous declaration" } */
+ typedef AAb *VF(void); /* { dg-error "redefinition" } */
+ typedef AAa AAa; /* { dg-error "redefinition" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-uni-string-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-uni-string-1.c
new file mode 100644
index 000000000..9f86bea82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-uni-string-1.c
@@ -0,0 +1,112 @@
+/* Test Unicode strings in C11. Test valid code. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+/* More thorough tests are in c-c++-common/raw-string-*.c; this test
+ verifies the particular subset (Unicode but not raw strings) that
+ is in C11. */
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern void exit (int);
+extern int memcmp (const void *, const void *, size_t);
+
+#define R "(R)"
+#define u8R "(u8R)"
+#define uR "(uR)"
+#define UR "(UR)"
+#define LR "(LR)"
+#define u8 randomu8
+#define u randomu
+#define U randomU
+
+const char su8[] = u8"a\u010d";
+const char su8a[] = "a\xc4\x8d";
+
+const char16_t su16[] = u"\u0567";
+const char16_t su16a[] = { 0x0567, 0 };
+
+const char32_t su32[] = U"\u0123";
+const char32_t su32a[] = { 0x0123, 0 };
+
+const char tu[] = R"a";
+const char tua[] = "(R)a";
+
+const char tu8[] = u8R"b";
+const char tu8a[] = "(u8R)b";
+
+const char tu16[] = uR"c";
+const char tu16a[] = "(uR)c";
+
+const char tu32[] = UR"d";
+const char tu32a[] = "(UR)d";
+
+const char tl[] = LR"e";
+const char tla[] = "(LR)e";
+
+#define str(x) #x
+const char ts[] = str(u"a" U"b" u8"c");
+const char tsa[] = "u\"a\" U\"b\" u8\"c\"";
+
+/* GCC always uses UTF-16 and UTF-32 for char16_t and char32_t. */
+#ifndef __STDC_UTF_16__
+#error "__STDC_UTF_16__ not defined"
+#endif
+#ifndef __STDC_UTF_32__
+#error "__STDC_UTF_32__ not defined"
+#endif
+#define xstr(x) str(x)
+const char tm16[] = xstr(__STDC_UTF_16__);
+const char tm16a[] = "1";
+const char tm32[] = xstr(__STDC_UTF_32__);
+const char tm32a[] = "1";
+
+int
+main (void)
+{
+ if (sizeof (su8) != sizeof (su8a)
+ || memcmp (su8, su8a, sizeof (su8)) != 0)
+ abort ();
+ if (sizeof (su16) != sizeof (su16a)
+ || memcmp (su16, su16a, sizeof (su16)) != 0)
+ abort ();
+ if (sizeof (su32) != sizeof (su32a)
+ || memcmp (su32, su32a, sizeof (su32)) != 0)
+ abort ();
+ if (sizeof (tu) != sizeof (tua)
+ || memcmp (tu, tua, sizeof (tu)) != 0)
+ abort ();
+ if (sizeof (tu8) != sizeof (tu8a)
+ || memcmp (tu8, tu8a, sizeof (tu8)) != 0)
+ abort ();
+ if (sizeof (tu16) != sizeof (tu16a)
+ || memcmp (tu16, tu16a, sizeof (tu16)) != 0)
+ abort ();
+ if (sizeof (tu32) != sizeof (tu32a)
+ || memcmp (tu32, tu32a, sizeof (tu32)) != 0)
+ abort ();
+ if (sizeof (tl) != sizeof (tla)
+ || memcmp (tl, tla, sizeof (tl)) != 0)
+ abort ();
+ if (sizeof (ts) != sizeof (tsa)
+ || memcmp (ts, tsa, sizeof (ts)) != 0)
+ abort ();
+ if (sizeof (tm16) != sizeof (tm16a)
+ || memcmp (tm16, tm16a, sizeof (tm16)) != 0)
+ abort ();
+ if (sizeof (tm32) != sizeof (tm32a)
+ || memcmp (tm32, tm32a, sizeof (tm32)) != 0)
+ abort ();
+ if (u'\u0123' != 0x0123)
+ abort ();
+ if (U'\u0456' != 0x0456)
+ abort ();
+#undef u8
+#define u8
+ if (u8'a' != 'a')
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-uni-string-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-uni-string-2.c
new file mode 100644
index 000000000..583c38a87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-uni-string-2.c
@@ -0,0 +1,8 @@
+/* Test Unicode strings in C11. Test constraint. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+const void *p1 = L"a" u8"b"; /* { dg-error "concatenation" } */
+const void *p2 = L"a" "b" u8"c"; /* { dg-error "concatenation" } */
+const void *p3 = u8"a" L"b"; /* { dg-error "concatenation" } */
+const void *p4 = u8"a" "b" L"c"; /* { dg-error "concatenation" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-version-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-version-1.c
new file mode 100644
index 000000000..9ab7936d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-version-1.c
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C11. Test -std=c11. */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 201112L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c11-version-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c11-version-2.c
new file mode 100644
index 000000000..3ac2305f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c11-version-2.c
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C11. Test -std=iso9899:2011. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:2011 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 201112L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-align-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-align-1.c
new file mode 100644
index 000000000..77510f4e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-align-1.c
@@ -0,0 +1,6 @@
+/* Test _Alignof and _Alignas not in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+int a = _Alignof (int); /* { dg-error "ISO C90 does not support '_Alignof'" } */
+_Alignas (int) int b; /* { dg-error "ISO C90 does not support '_Alignas'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-anon-struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-anon-struct-1.c
new file mode 100644
index 000000000..a3eb7f7e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-anon-struct-1.c
@@ -0,0 +1,12 @@
+/* Test for anonymous structures and unions not permitted in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s
+{
+ int a;
+ struct
+ {
+ int b;
+ }; /* { dg-error "unnamed structs" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-1.c
new file mode 100644
index 000000000..69655c835
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-1.c
@@ -0,0 +1,21 @@
+/* Test for non-lvalue arrays decaying to pointers: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s { char c[1]; };
+
+extern struct s foo (void);
+
+void
+bar (void)
+{
+ char *t;
+ (foo ()).c[0]; /* { dg-bogus "warning" "warning in place of error" } */
+ t = (foo ()).c; /* { dg-bogus "warning" "warning in place of error" } */
+ (foo ()).c + 1; /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 14 }
+ { dg-error "non-lvalue|incompatible" "array not decaying to lvalue" { target *-*-* } 15 }
+ { dg-error "non-lvalue|invalid" "array not decaying to lvalue" { target *-*-* } 16 }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-2.c
new file mode 100644
index 000000000..9f261e05e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-2.c
@@ -0,0 +1,20 @@
+/* Test for non-lvalue arrays decaying to pointers: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s { char c[17]; };
+
+struct s x;
+
+extern struct s foo (void);
+
+#define ASSERT(v, a) char v[((a) ? 1 : -1)]
+
+ASSERT (p, sizeof (x.c) == 17);
+ASSERT (q, sizeof (0, x.c) == sizeof (char *));
+ASSERT (r, sizeof ((foo ()).c) == 17);
+/* The non-lvalue array does not decay to a pointer, so the comma expression
+ has (non-lvalue) array type.
+*/
+ASSERT (s, sizeof (0, (foo ()).c) == 17); /* { dg-bogus "array" "bad non-lvalue array handling" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-3.c
new file mode 100644
index 000000000..192a05f62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-3.c
@@ -0,0 +1,34 @@
+/* Test for non-lvalue arrays decaying to pointers: in C99 only.
+ Test various ways of producing non-lvalue arrays. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s { char c[1]; };
+struct s a, b, c;
+int d;
+
+void
+bar (void)
+{
+ char *t;
+ (d ? b : c).c[0]; /* { dg-bogus "warning" "warning in place of error" } */
+ (d, b).c[0]; /* { dg-bogus "warning" "warning in place of error" } */
+ (a = b).c[0]; /* { dg-bogus "warning" "warning in place of error" } */
+ t = (d ? b : c).c; /* { dg-bogus "warning" "warning in place of error" } */
+ t = (d, b).c; /* { dg-bogus "warning" "warning in place of error" } */
+ t = (a = b).c; /* { dg-bogus "warning" "warning in place of error" } */
+ (d ? b : c).c + 1; /* { dg-bogus "warning" "warning in place of error" } */
+ (d, b).c + 1; /* { dg-bogus "warning" "warning in place of error" } */
+ (a = b).c + 1; /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 15 }
+ { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 16 }
+ { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 17 }
+ { dg-error "non-lvalue|incompatible" "array not decaying to lvalue" { target *-*-* } 18 }
+ { dg-error "non-lvalue|incompatible" "array not decaying to lvalue" { target *-*-* } 19 }
+ { dg-error "non-lvalue|incompatible" "array not decaying to lvalue" { target *-*-* } 20 }
+ { dg-error "non-lvalue|invalid" "array not decaying to lvalue" { target *-*-* } 21 }
+ { dg-error "non-lvalue|invalid" "array not decaying to lvalue" { target *-*-* } 22 }
+ { dg-error "non-lvalue|invalid" "array not decaying to lvalue" { target *-*-* } 23 }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-4.c
new file mode 100644
index 000000000..1f9cb1455
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-4.c
@@ -0,0 +1,26 @@
+/* Test for non-lvalue arrays decaying to pointers: in C99 only.
+ Test various ways of producing non-lvalue arrays. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s { char c[17]; };
+
+struct s x;
+
+struct s a, b, c;
+int d;
+
+#define ASSERT(v, a) char v[((a) ? 1 : -1)]
+
+ASSERT (p, sizeof (x.c) == 17);
+ASSERT (q, sizeof (0, x.c) == sizeof (char *));
+ASSERT (r0, sizeof ((d ? b : c).c) == 17);
+ASSERT (r1, sizeof ((d, b).c) == 17);
+ASSERT (r2, sizeof ((a = b).c) == 17);
+/* The non-lvalue array does not decay to a pointer, so the comma expression
+ has (non-lvalue) array type.
+*/
+ASSERT (s0, sizeof (0, (d ? b : c).c) == 17); /* { dg-bogus "array" "bad non-lvalue array handling" } */
+ASSERT (s0, sizeof (0, (d, b).c) == 17); /* { dg-bogus "array" "bad non-lvalue array handling" } */
+ASSERT (s0, sizeof (0, (a = b).c) == 17); /* { dg-bogus "array" "bad non-lvalue array handling" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-5.c
new file mode 100644
index 000000000..c218a4dae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-5.c
@@ -0,0 +1,26 @@
+/* Test for non-lvalue arrays: test that the unary '&' operator is not
+ allowed on them, for both C90 and C99. */
+
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s { char c[1]; };
+
+extern struct s foo (void);
+struct s a, b, c;
+int d;
+
+void
+bar (void)
+{
+ &((foo ()).c); /* { dg-bogus "warning" "warning in place of error" } */
+ &((d ? b : c).c); /* { dg-bogus "warning" "warning in place of error" } */
+ &((d, b).c); /* { dg-bogus "warning" "warning in place of error" } */
+ &((a = b).c); /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "lvalue" "bad address-of" { target *-*-* } 17 }
+ { dg-error "lvalue" "bad address-of" { target *-*-* } 18 }
+ { dg-error "lvalue" "bad address-of" { target *-*-* } 19 }
+ { dg-error "lvalue" "bad address-of" { target *-*-* } 20 }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-6.c
new file mode 100644
index 000000000..f42ef52bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-6.c
@@ -0,0 +1,16 @@
+/* PR c/12446 */
+/* Origin: Keith Thompson <kst@cts.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+
+struct s { char c[1]; };
+
+extern struct s foo(void);
+
+void bar(void)
+{
+ char *ptr = foo().c; /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 14 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-7.c
new file mode 100644
index 000000000..ee8da4c70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-7.c
@@ -0,0 +1,23 @@
+/* Test for non-lvalue arrays: test that C90 does not allow them in
+ conditional expressions, while in C99 they decay and are
+ allowed. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s { char c[1]; };
+struct s a, b, c;
+int d;
+int e;
+
+void
+bar (void)
+{
+ /* In C90, the non-lvalue arrays do not decay to pointers, and
+ 6.3.15 does not permit conditional expressions between arrays.
+ In C99, they decay to pointers. */
+ (e ? (d ? b : c).c : (e ? b : c).c); /* { dg-bogus "warning" "warning in place of error" } */
+}
+
+/* { dg-error "array" "bad conditional" { target *-*-* } 20 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-8.c
new file mode 100644
index 000000000..bc5b7b21b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-lval-8.c
@@ -0,0 +1,20 @@
+/* Test for non-lvalue arrays: test that they cannot be assigned to
+ array variables. PR 58235. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s { char c[1]; } x;
+struct s f (void) { return x; }
+
+void
+g (void)
+{
+ char c[1];
+ c = f ().c; /* { dg-error "array" } */
+}
+
+void
+h (void)
+{
+ char c[1] = f ().c; /* { dg-error "array" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-quals-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-quals-2.c
new file mode 100644
index 000000000..7cb68c846
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-quals-2.c
@@ -0,0 +1,3 @@
+extern const char *const a[];
+extern const char *const a[];
+extern const char *const a[];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-quals.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-quals.c
new file mode 100644
index 000000000..228e79f65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-array-quals.c
@@ -0,0 +1,3 @@
+extern int (*const a)[];
+extern int (*const a)[10];
+extern int (*const a)[];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-arraydecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-arraydecl-1.c
new file mode 100644
index 000000000..2b7eadbf6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-arraydecl-1.c
@@ -0,0 +1,30 @@
+/* Test for C99 forms of array declarator: rejected in C90. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+/* Use of [*] (possibly with type qualifiers) in an array declarator with
+ function prototype scope is a C99 feature. GCC does not yet implement
+ it correctly, so gives a warning about this. so we can't yet test here
+ that we get just one error and no warnings. */
+
+void foo0 (int a, int b[*]); /* { dg-error "ISO C90" "\[*\] not in C90" } */
+void foo1 (int, int [*]); /* { dg-error "ISO C90" "\[*\] not in C90" } */
+
+
+/* Use of static and type qualifiers (not allowed with abstract declarators)
+ is a C99 feature. */
+
+void bar0 (int a[const]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "ISO C90" "\[quals\] not in C90" { target *-*-* } 18 } */
+void bar1 (int a[const 2]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "ISO C90" "\[quals expr\] not in C90" { target *-*-* } 20 } */
+void bar2 (int a[static 2]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "ISO C90" "\[static expr\] not in C90" { target *-*-* } 22 } */
+void bar3 (int a[static const 2]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "ISO C90" "\[static quals expr\] not in C90" { target *-*-* } 24 } */
+void bar4 (int a[const static 2]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "ISO C90" "\[quals static expr\] not in C90" { target *-*-* } 26 } */
+
+/* Because [*] isn't properly implemented and so warns, we don't test here
+ for [const *] yet. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-atomic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-atomic-1.c
new file mode 100644
index 000000000..350656394
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-atomic-1.c
@@ -0,0 +1,7 @@
+/* Test for _Atomic: not in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=c90 -pedantic-errors" } */
+
+_Atomic int i; /* { dg-error "_Atomic" } */
+_Atomic (int) j; /* { dg-error "_Atomic" } */
+int *_Atomic p; /* { dg-error "_Atomic" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-complex-1.c
new file mode 100644
index 000000000..b65fc6873
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-complex-1.c
@@ -0,0 +1,7 @@
+/* Test for _Complex: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+_Complex double foo; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "C" "_Complex not in C90" { target *-*-* } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-complit-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-complit-1.c
new file mode 100644
index 000000000..4cd910fa8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-complit-1.c
@@ -0,0 +1,20 @@
+/* Test for compound literals: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct s { int a; int b; };
+union u { int c; int d; };
+
+void
+foo (void)
+{
+ (int) { 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "compound literal" "scalar" { target *-*-* } 12 } */
+ (struct s) { 1, 2 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "compound literal" "struct" { target *-*-* } 14 } */
+ (union u) { 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "compound literal" "union" { target *-*-* } 16 } */
+ (int [1]) { 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "compound literal" "array" { target *-*-* } 18 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-1.c
new file mode 100644
index 000000000..e4c27ac45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-1.c
@@ -0,0 +1,23 @@
+/* Test for constraints on constant expressions. In C90 it is clear that
+ certain constructs are not permitted in unevaluated parts of an
+ expression (except in sizeof); in C99 it might fall within implementation
+ latitude.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>; inspired by
+ http://deja.com/getdoc.xp?AN=524271595&fmt=text by Peter Seebach.
+*/
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+extern int bar (void);
+
+void
+foo (void)
+{
+ int i;
+ static int j = (1 ? 0 : (i = 2)); /* { dg-error "initial" "assignment" } */
+ static int k = (1 ? 0 : ++i); /* { dg-error "initial" "increment" } */
+ static int l = (1 ? 0 : --i); /* { dg-error "initial" "decrement" } */
+ static int m = (1 ? 0 : bar ()); /* { dg-error "initial" "function call" } */
+ static int n = (1 ? 0 : (2, 3)); /* { dg-error "initial" "comma" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-10.c
new file mode 100644
index 000000000..30c60e31f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-10.c
@@ -0,0 +1,30 @@
+/* Test for constant expressions: invalid null pointer constants in
+ various contexts (make sure NOPs are not inappropriately
+ stripped). */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+void *p = (size_t)(void *)0; /* { dg-error "without a cast" } */
+struct s { void *a; } q = { (size_t)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
+void *
+f (void)
+{
+ void *r;
+ r = (size_t)(void *)0; /* { dg-error "without a cast" } */
+ return (size_t)(void *)0; /* { dg-error "without a cast" } */
+}
+void g (void *); /* { dg-message "but argument is of type" } */
+void
+h (void)
+{
+ g ((size_t)(void *)0); /* { dg-error "without a cast" } */
+}
+void g2 (int, void *); /* { dg-message "but argument is of type" } */
+void
+h2 (void)
+{
+ g2 (0, (size_t)(void *)0); /* { dg-error "without a cast" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-11.c
new file mode 100644
index 000000000..cfda93e12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-11.c
@@ -0,0 +1,27 @@
+/* Test for constant expressions: C90 aggregate initializers requiring
+ constant expressions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors -O2" } */
+
+#include <float.h>
+#include <limits.h>
+
+double atan(double);
+
+struct s { double d; };
+struct t { int i; };
+
+void
+f (void)
+{
+ /* As in PR 14649 for static initializers. */
+ struct s a = { atan (1.0) }; /* { dg-error "is not a constant expression|near initialization" } */
+ /* Overflow. */
+ struct t b = { INT_MAX + 1 }; /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 21 } */
+ struct t c = { DBL_MAX }; /* { dg-warning "overflow in implicit constant conversion" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 23 } */
+ /* Bad operator outside sizeof. */
+ struct s d = { 1 ? 1.0 : atan (a.d) }; /* { dg-error "is not a constant expression|near initialization" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-2.c
new file mode 100644
index 000000000..ee57d5503
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-2.c
@@ -0,0 +1,45 @@
+/* Test for constant expressions: details of what is a null pointer
+ constant.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990" } */
+/* Note: not using -pedantic since the -std option alone should be enough
+ to give the correct behavior to conforming programs. If -pedantic is
+ needed to make (say) (0, 0) not be a constant expression, this is a
+ bug.
+*/
+
+int *a;
+int b;
+long *c;
+
+#if defined(_LP64)
+#define ZERO 0L
+#elif defined(_WIN64)
+#define ZERO 0LL
+#else
+#define ZERO 0
+#endif
+
+/* Assertion that n is a null pointer constant: so the conditional expression
+ has type 'int *' instead of 'void *'.
+*/
+#define ASSERT_NPC(n) (b = *(1 ? a : (n)))
+/* Assertion that n is not a null pointer constant: so the conditional
+ expressions has type 'void *' instead of 'int *'.
+*/
+#define ASSERT_NOT_NPC(n) (c = (1 ? a : (n)))
+
+void
+foo (void)
+{
+ ASSERT_NPC (0);
+ ASSERT_NPC ((void *)0);
+ ASSERT_NOT_NPC ((void *)(void *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((void *)(char *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((void *)(0, ZERO)); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((void *)(&"Foobar"[0] - &"Foobar"[0])); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ /* This last one is a null pointer constant in C99 only. */
+ ASSERT_NOT_NPC ((void *)(1 ? ZERO : (0, ZERO))); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-3.c
new file mode 100644
index 000000000..46a022734
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-3.c
@@ -0,0 +1,46 @@
+/* Test for constant expressions: broken optimization with const variables. */
+/* Reference: ISO 9989:1990 6.5.15 */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -O2" } */
+/* Note: not using -pedantic since the -std option alone should be enough
+ to give the correct behavior to conforming programs. */
+
+static const int ZERO = 0;
+static const double DZERO = 0;
+
+int *a;
+int b;
+long *c;
+
+/* Assertion that n is a constant zero: so the conditional expression
+ has type 'int *' instead of 'void *'.
+*/
+#define ASSERT_NPC(n) (b = *(1 ? a : (n)))
+/* Assertion that n is not a constant zero: so the conditional
+ expressions has type 'void *' instead of 'int *'.
+*/
+#define ASSERT_NOT_NPC(n) (c = (1 ? a : (void *)(__SIZE_TYPE__)(n)))
+
+void
+foo (void)
+{
+ ASSERT_NPC (0);
+ ASSERT_NOT_NPC (ZERO);
+ ASSERT_NPC (0 + 0);
+ ASSERT_NOT_NPC (ZERO + 0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC (ZERO + ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NPC (+0);
+ ASSERT_NOT_NPC (+ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NPC (-0);
+ ASSERT_NOT_NPC (-ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NPC ((char) 0);
+ ASSERT_NOT_NPC ((char) ZERO);
+ ASSERT_NPC ((int) 0);
+ ASSERT_NOT_NPC ((int) ZERO);
+ ASSERT_NPC ((int) 0.0);
+ ASSERT_NOT_NPC ((int) DZERO);
+ ASSERT_NOT_NPC ((int) +0.0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((int) (0.0+0.0)); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((int) (double)0.0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-4.c
new file mode 100644
index 000000000..6a449870e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-4.c
@@ -0,0 +1,11 @@
+/* Test for constant expressions: const variable with value 0 is not a
+ null pointer constant so the conditional expression should have
+ type void * and the assignment is OK. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -O2" } */
+int *p;
+long *q;
+static void *const n = 0;
+int j;
+void f(void) { q = j ? p : n; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-5.c
new file mode 100644
index 000000000..9f5cdef83
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-5.c
@@ -0,0 +1,39 @@
+/* Test null pointer constants: typedefs for void should be OK but not
+ qualified void. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+typedef void V;
+int *p;
+long *q;
+int j;
+void (*fp)(void);
+
+void
+f (void)
+{
+ /* (V *)0 is a null pointer constant, so the assignment should be
+ diagnosed. */
+ q = (j ? p : (V *)0); /* { dg-error "5:assignment from incompatible pointer type" } */
+ q = (j ? p : (void *)0); /* { dg-error "5:assignment from incompatible pointer type" } */
+ /* And this conversion should be valid. */
+ (void (*)(void))(V *)0;
+ (void (*)(void))(void *)0;
+ /* Pointers to qualified void are not valid null pointer
+ constants. */
+ fp = (const void *)0; /* { dg-error "6:ISO C forbids assignment between function pointer and 'void \\*'" } */
+ fp = (void *)0;
+ fp = (V *)0;
+ fp = 0;
+ fp == 0;
+ 0 == fp;
+ fp == (void *)0;
+ (void *)0 == fp;
+ fp == (V *)0;
+ (V *)0 == fp;
+ fp == (V *)1; /* { dg-error "6:ISO C forbids comparison of 'void \\*' with function pointer" } */
+ (V *)1 == fp; /* { dg-error "10:ISO C forbids comparison of 'void \\*' with function pointer" } */
+ fp == (const void *)0; /* { dg-error "6:ISO C forbids comparison of 'void \\*' with function pointer" } */
+ (const void *)0 == fp; /* { dg-error "19:ISO C forbids comparison of 'void \\*' with function pointer" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-6.c
new file mode 100644
index 000000000..50239ce2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-6.c
@@ -0,0 +1,55 @@
+/* Test for constant expressions: operands and casts not permitted in
+ integer constant expressions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+__extension__ typedef __INTPTR_TYPE__ intptr_t;
+
+/* PR 29116. */
+int n = 0, p[n * 0 + 1]; /* { dg-error "variabl|can't be evaluated" } */
+
+/* PR 31871. */
+extern int c[1 + ((intptr_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
+
+/* Implicit conversions from floating-point constants are not OK,
+ although explicit ones are. */
+extern int c1[1.0 ? 1 : 0]; /* { dg-error "variab|can't be evaluated" } */
+
+extern int c2[(int)1.0 ? 1 : 0];
+
+extern int c3[1.0 && 1]; /* { dg-error "variab|can't be evaluated" } */
+
+extern int c4[(int)1.0 && 1];
+
+extern int c5[1.0 || 1]; /* { dg-error "variab|can't be evaluated" } */
+
+extern int c6[(int)1.0 || 1];
+
+/* Similar with various other cases where integer constant expressions
+ are required. */
+
+struct s {
+ int a : (n * 0 + 1); /* { dg-error "constant" } */
+};
+
+enum e {
+ E = (1 + ((intptr_t) (void *) 0)), /* { dg-error "constant" } */
+ E2 = 0
+};
+
+enum f {
+ F = (1 ? 1 : n), /* { dg-error "constant" } */
+ F2 = 0
+};
+
+void
+f (int a)
+{
+ int v[1 + ((intptr_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
+ switch (a)
+ {
+ case (n * 0 + 1): /* { dg-error "constant" } */
+ ;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-7.c
new file mode 100644
index 000000000..30aeba06a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-7.c
@@ -0,0 +1,35 @@
+/* Test for constant expressions: overflow and constant expressions;
+ see also overflow-warn-*.c for some other cases. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#include <float.h>
+
+int a = DBL_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 9 } */
+int b = (int) DBL_MAX; /* { dg-error "overflow" "" } */
+unsigned int c = -1.0; /* { dg-warning "overflow in implicit constant conversion" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 12 } */
+unsigned int d = (unsigned)-1.0; /* { dg-error "overflow" } */
+
+int e = 0 << 1000; /* { dg-warning "shift count" } */
+/* { dg-error "constant" "constant" { target *-*-* } 16 } */
+int f = 0 << -1; /* { dg-warning "shift count" } */
+/* { dg-error "constant" "constant" { target *-*-* } 18 } */
+int g = 0 >> 1000; /* { dg-warning "shift count" } */
+/* { dg-error "constant" "constant" { target *-*-* } 20 } */
+int h = 0 >> -1; /* { dg-warning "shift count" } */
+/* { dg-error "constant" "constant" { target *-*-* } 22 } */
+
+int b1 = (0 ? (int) DBL_MAX : 0);
+unsigned int d1 = (0 ? (unsigned int)-1.0 : 0);
+int e1 = (0 ? 0 << 1000 : 0);
+int f1 = (0 ? 0 << -1 : 0);
+int g1 = (0 ? 0 >> 1000 : 0);
+int h1 = (0 ? 0 >> -1: 0);
+
+int i = -1 << 0;
+
+int j[1] = { DBL_MAX }; /* { dg-warning "overflow in implicit constant conversion" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 34 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-8.c
new file mode 100644
index 000000000..b6aba7b1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-8.c
@@ -0,0 +1,28 @@
+/* Test for constant expressions: overflow and constant expressions
+ with -fwrapv: overflows still count as such for the purposes of
+ constant expressions even when they have defined values at
+ runtime. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors -fwrapv" } */
+
+#include <limits.h>
+
+enum e {
+ E0 = 0 * (INT_MAX + 1), /* { dg-warning "21:integer overflow in expression" } */
+ /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 12 } */
+ E1 = 0 * (INT_MIN / -1), /* { dg-warning "21:integer overflow in expression" } */
+ /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 14 } */
+ E2 = 0 * (INT_MAX * INT_MAX), /* { dg-warning "21:integer overflow in expression" } */
+ /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 16 } */
+ E3 = 0 * (INT_MIN - 1), /* { dg-warning "21:integer overflow in expression" } */
+ /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 18 } */
+ E4 = 0 * (unsigned)(INT_MIN - 1), /* { dg-warning "31:integer overflow in expression" } */
+ /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 20 } */
+ E5 = 0 * -INT_MIN, /* { dg-warning "12:integer overflow in expression" } */
+ /* { dg-error "3:overflow in constant expression" "constant" { target *-*-* } 22 } */
+ E6 = 0 * !-INT_MIN, /* { dg-warning "13:integer overflow in expression" } */
+ /* { dg-error "8:not an integer constant" "constant" { target *-*-* } 24 } */
+ E7 = INT_MIN % -1 /* { dg-warning "16:integer overflow in expression" } */
+ /* { dg-error "1:overflow in constant expression" "constant" { target *-*-* } 28 } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-9.c
new file mode 100644
index 000000000..4793a14b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-const-expr-9.c
@@ -0,0 +1,29 @@
+/* Test for constant expressions: __builtin_offsetof allowed in
+ integer constant expressions but not traditional offsetof
+ expansion. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors -ftrack-macro-expansion=0" } */
+
+struct s {
+ int a;
+};
+
+struct t {
+ struct s a;
+ int b[2];
+};
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
+
+#define old_offsetof(TYPE, MEMBER) ((size_t) (uintptr_t) &((TYPE *)0)->MEMBER)
+
+enum e {
+ E1 = old_offsetof (struct s, a), /* { dg-error "constant" } */
+ E2 = old_offsetof (struct t, a.a), /* { dg-error "constant" } */
+ E3 = old_offsetof (struct t, b[1]), /* { dg-error "constant" } */
+ E4 = __builtin_offsetof (struct s, a),
+ E5 = __builtin_offsetof (struct t, a.a),
+ E6 = __builtin_offsetof (struct t, b[1])
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-digraph-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-digraph-1.c
new file mode 100644
index 000000000..9396d1367
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-digraph-1.c
@@ -0,0 +1,24 @@
+/* Test for recognition of digraphs: should be recognized in C94 and C99
+ mode, but not in C90 mode. Also check correct stringizing.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#define str(x) xstr(x)
+#define xstr(x) #x
+#define foo(p, q) str(p %:%: q)
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+ const char *t = foo (1, 2);
+ const char *u = str (<:);
+ if (strcmp (t, "1 %:%: 2") || strcmp (u, "<:"))
+ abort ();
+ else
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-dupqual-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-dupqual-1.c
new file mode 100644
index 000000000..14838c736
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-dupqual-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+typedef const int CI;
+const const int c1; /* { dg-error "duplicate" } */
+const CI c2; /* { dg-error "duplicate" } */
+const CI *c3; /* { dg-error "duplicate" } */
+
+typedef volatile int VI;
+volatile volatile int v1; /* { dg-error "duplicate" } */
+volatile VI v2; /* { dg-error "duplicate" } */
+volatile VI *v3; /* { dg-error "duplicate" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-enum-comma-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-enum-comma-1.c
new file mode 100644
index 000000000..2029c92f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-enum-comma-1.c
@@ -0,0 +1,7 @@
+/* Test for commas at end of enums: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+enum foo { bar, }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "comma at end" "enum comma error" { target *-*-* } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-flex-array-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-flex-array-1.c
new file mode 100644
index 000000000..1eead199e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-flex-array-1.c
@@ -0,0 +1,7 @@
+/* Test for flexible array members. Test for rejection in C90 mode. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct flex { int a; int b[]; }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "ISO C90" "flexible array members not in C90" { target *-*-* } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-flex-array-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-flex-array-2.c
new file mode 100644
index 000000000..425ce8464
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-flex-array-2.c
@@ -0,0 +1,15 @@
+/* [] does not indicate a flexible array member unless it is the field
+ itself being declared as an incomplete array type rather than a
+ pointer or other type derived from such a type. PR 36432. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+void
+f (void)
+{
+ int a[3];
+ int (*p)[];
+ struct { int (*p)[]; } s;
+ p = &a;
+ s.p = &a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-float-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-float-1.c
new file mode 100644
index 000000000..649cddfa0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-float-1.c
@@ -0,0 +1,169 @@
+/* Test for <float.h> C90 macros. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+/* This test checks that the C90 macros (but not the C99 or C11 ones)
+ are defined; it does not check the correctness of their values. */
+
+#include <float.h>
+
+#ifndef FLT_ROUNDS
+#error "FLT_ROUNDS undefined"
+#endif
+
+#ifndef FLT_RADIX
+#error "FLT_RADIX undefined"
+#endif
+
+#ifndef FLT_MANT_DIG
+#error "FLT_MANT_DIG undefined"
+#endif
+
+#ifndef FLT_DIG
+#error "FLT_DIG undefined"
+#endif
+
+#ifndef FLT_MIN_EXP
+#error "FLT_MIN_EXP undefined"
+#endif
+
+#ifndef FLT_MIN_10_EXP
+#error "FLT_MIN_10_EXP undefined"
+#endif
+
+#ifndef FLT_MAX_EXP
+#error "FLT_MAX_EXP undefined"
+#endif
+
+#ifndef FLT_MAX_10_EXP
+#error "FLT_MAX_10_EXP undefined"
+#endif
+
+#ifndef FLT_MAX
+#error "FLT_MAX undefined"
+#endif
+
+#ifndef FLT_EPSILON
+#error "FLT_EPSILON undefined"
+#endif
+
+#ifndef FLT_MIN
+#error "FLT_MIN undefined"
+#endif
+
+#ifndef DBL_MANT_DIG
+#error "DBL_MANT_DIG undefined"
+#endif
+
+#ifndef DBL_DIG
+#error "DBL_DIG undefined"
+#endif
+
+#ifndef DBL_MIN_EXP
+#error "DBL_MIN_EXP undefined"
+#endif
+
+#ifndef DBL_MIN_10_EXP
+#error "DBL_MIN_10_EXP undefined"
+#endif
+
+#ifndef DBL_MAX_EXP
+#error "DBL_MAX_EXP undefined"
+#endif
+
+#ifndef DBL_MAX_10_EXP
+#error "DBL_MAX_10_EXP undefined"
+#endif
+
+#ifndef DBL_MAX
+#error "DBL_MAX undefined"
+#endif
+
+#ifndef DBL_EPSILON
+#error "DBL_EPSILON undefined"
+#endif
+
+#ifndef DBL_MIN
+#error "DBL_MIN undefined"
+#endif
+
+#ifndef LDBL_MANT_DIG
+#error "LDBL_MANT_DIG undefined"
+#endif
+
+#ifndef LDBL_DIG
+#error "LDBL_DIG undefined"
+#endif
+
+#ifndef LDBL_MIN_EXP
+#error "LDBL_MIN_EXP undefined"
+#endif
+
+#ifndef LDBL_MIN_10_EXP
+#error "LDBL_MIN_10_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX_EXP
+#error "LDBL_MAX_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX_10_EXP
+#error "LDBL_MAX_10_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX
+#error "LDBL_MAX undefined"
+#endif
+
+#ifndef LDBL_EPSILON
+#error "LDBL_EPSILON undefined"
+#endif
+
+#ifndef LDBL_MIN
+#error "LDBL_MIN undefined"
+#endif
+
+#ifdef FLT_EVAL_METHOD
+#error "FLT_EVAL_METHOD defined"
+#endif
+
+#ifdef DECIMAL_DIG
+#error "DECIMAL_DIG defined"
+#endif
+
+#ifdef FLT_DECIMAL_DIG
+#error "FLT_DECIMAL_DIG defined"
+#endif
+
+#ifdef DBL_DECIMAL_DIG
+#error "DBL_DECIMAL_DIG defined"
+#endif
+
+#ifdef LDBL_DECIMAL_DIG
+#error "LDBL_DECIMAL_DIG defined"
+#endif
+
+#ifdef FLT_HAS_SUBNORM
+#error "FLT_HAS_SUBNORM defined"
+#endif
+
+#ifdef DBL_HAS_SUBNORM
+#error "DBL_HAS_SUBNORM defined"
+#endif
+
+#ifdef LDBL_HAS_SUBNORM
+#error "LDBL_HAS_SUBNORM defined"
+#endif
+
+#ifdef FLT_TRUE_MIN
+#error "FLT_TRUE_MIN defined"
+#endif
+
+#ifdef DBL_TRUE_MIN
+#error "DBL_TRUE_MIN defined"
+#endif
+
+#ifdef LDBL_TRUE_MIN
+#error "LDBL_TRUE_MIN defined"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-fordecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-fordecl-1.c
new file mode 100644
index 000000000..51e82ff7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-fordecl-1.c
@@ -0,0 +1,14 @@
+/* Test for C99 declarations in for loops - rejection in C90 mode. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ int j = 0;
+ for (int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ j += i;
+ /* { dg-error "'for' loop initial declarations are only allowed in C99 or C11 mode" "declaration in for loop" { target *-*-* } 10 } */
+ /* { dg-message "note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code" "note" { target *-*-* } 10 }} */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-hexfloat-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-hexfloat-1.c
new file mode 100644
index 000000000..2dd90a1e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-hexfloat-1.c
@@ -0,0 +1,11 @@
+/* Test for hex floating point constants: in C99 only. Compiler test. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+double d = 0x1.2p2; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "hexadecimal floating" "hex float error" { target *-*-* } 6 } */
+double d1 = 0x1p2; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "hexadecimal floating" "hex float error" { target *-*-* } 8 } */
+double d2 = 0x1...p2; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "too many decimal points" "bad hex float" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-hexfloat-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-hexfloat-2.c
new file mode 100644
index 000000000..259471c8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-hexfloat-2.c
@@ -0,0 +1,24 @@
+/* Test for hex floating point constants: in C99 only. Preprocessor test. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#define f (
+#define l )
+#define str(x) #x
+#define xstr(x) str(x)
+
+/* C90: "0x1p+( 0x1p+)"; C99: "0x1p+f 0x1p+l" */
+const char *s = xstr(0x1p+f 0x1p+l);
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+ if (strcmp (s, "0x1p+( 0x1p+)"))
+ abort ();
+ else
+ return 0; /* Correct C90 behavior. */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-1.c
new file mode 100644
index 000000000..ee05a82f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-1.c
@@ -0,0 +1,8 @@
+/* Test for idempotent type qualifiers: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+typedef const int cint;
+const cint foo; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "duplicate" "duplicate type qualifier error" { target *-*-* } 7 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-2.c
new file mode 100644
index 000000000..c9bb6f7e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-2.c
@@ -0,0 +1,7 @@
+/* Test for idempotent type qualifiers: in C99 only. Test "const const". */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+const const int foo; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "duplicate" "duplicate type qualifier error" { target *-*-* } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-3.c
new file mode 100644
index 000000000..9976a0888
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-idem-qual-3.c
@@ -0,0 +1,11 @@
+/* Test for idempotent type qualifiers: in C99 only. Test duplicate
+ type qualifiers with array element types. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+typedef const int cia[2];
+const cia a; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "duplicate" "duplicate type qualifier error" { target *-*-* } 8 } */
+const cia b[2]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "duplicate" "duplicate type qualifier error" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-decl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-decl-1.c
new file mode 100644
index 000000000..4e4431e6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-decl-1.c
@@ -0,0 +1,22 @@
+/* Test for implicit function declaration: in C90 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ bar ();
+}
+
+/* C90 subclause 7.1.7 says we can implicitly declare strcmp; C99 removes
+ implict declarations.
+*/
+int
+bar (const char *a, const char *b)
+{
+ /* This fails for GCC CVS 20000709, but is not marked XFAIL since
+ GCC 2.95.2 passes.
+ */
+ return strcmp (a, b); /* { dg-bogus "implicit" "implicit declaration warning for strcmp" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-int-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-int-1.c
new file mode 100644
index 000000000..cd995c296
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-int-1.c
@@ -0,0 +1,8 @@
+/* Test for implicit int: in C90 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+extern foo;
+
+bar (void) { }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-int-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-int-2.c
new file mode 100644
index 000000000..884c9d92e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-impl-int-2.c
@@ -0,0 +1,8 @@
+/* Test for implicit int: in C90 only. Function parameters in old-style
+ function definition.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+void foo (a) { }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-init-1.c
new file mode 100644
index 000000000..68308d3e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-init-1.c
@@ -0,0 +1,25 @@
+/* Test for C99 designated initializers */
+/* Origin: Jakub Jelinek <jakub@redhat.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct A {
+ int B;
+ short C[2];
+};
+int a[10] = { 10, [4] = 15 }; /* { dg-error "ISO (C89|C90) forbids specifying subobject to initialize" } */
+struct A b = { .B = 2 }; /* { dg-error "ISO (C89|C90) forbids specifying subobject to initialize" } */
+struct A c[] = { [3].C[1] = 1 }; /* { dg-error "ISO (C89|C90) forbids specifying subobject to initialize" } */
+struct A d[] = { [4 ... 6].C[0 ... 1] = 2 }; /* { dg-error "(forbids specifying range of elements to initialize)|(ISO (C89|C90) forbids specifying subobject to initialize)" } */
+int e[] = { [2] 2 }; /* { dg-error "use of designated initializer without" } */
+struct A f = { C: { 0, 1 } }; /* { dg-error "use of designated initializer with " } */
+int g;
+
+void foo (int *);
+
+void bar (void)
+{
+ int x[] = { g++, 2 }; /* { dg-error "is not computable at load time" } */
+
+ foo (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-intconst-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-intconst-1.c
new file mode 100644
index 000000000..de7371c06
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-intconst-1.c
@@ -0,0 +1,763 @@
+/* Test for integer constant types. */
+
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#include <limits.h>
+
+/* Assertion that constant C is of type T. */
+#define ASSERT_CONST_TYPE(C, T) \
+ do { \
+ typedef T type; \
+ typedef type **typepp; \
+ typedef __typeof__((C)) ctype; \
+ typedef ctype **ctypepp; \
+ typepp x = 0; \
+ ctypepp y = 0; \
+ x = y; \
+ y = x; \
+ } while (0)
+
+/* (T *) if E is zero, (void *) otherwise. */
+#define type_if_not(T, E) __typeof__(0 ? (T *)0 : (void *)(E))
+
+/* (T *) if E is nonzero, (void *) otherwise. */
+#define type_if(T, E) type_if_not(T, !(E))
+
+/* Combine pointer types, all but one (void *). */
+#define type_comb2(T1, T2) __typeof__(0 ? (T1)0 : (T2)0)
+#define type_comb3(T1, T2, T3) type_comb2(T1, type_comb2(T2, T3))
+#define type_comb4(T1, T2, T3, T4) \
+ type_comb2(T1, type_comb2(T2, type_comb2(T3, T4)))
+
+/* (T1 *) if E1, otherwise (T2 *) if E2. */
+#define first_of2p(T1, E1, T2, E2) type_comb2(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))))
+/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3. */
+#define first_of3p(T1, E1, T2, E2, T3, E3) \
+ type_comb3(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))), \
+ type_if(T3, (!(E1) && !(E2) && (E3))))
+/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise
+ (T4 *) if E4. */
+#define first_of4p(T1, E1, T2, E2, T3, E3, T4, E4) \
+ type_comb4(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))), \
+ type_if(T3, (!(E1) && !(E2) && (E3))), \
+ type_if(T4, (!(E1) && !(E2) && !(E3) && (E4))))
+
+/* Likewise, but return the original type rather than a pointer type. */
+#define first_of2(T1, E1, T2, E2) \
+ __typeof__(*((first_of2p(T1, (E1), T2, (E2)))0))
+#define first_of3(T1, E1, T2, E2, T3, E3) \
+ __typeof__(*((first_of3p(T1, (E1), T2, (E2), T3, (E3)))0))
+#define first_of4(T1, E1, T2, E2, T3, E3, T4, E4) \
+ __typeof__(*((first_of4p(T1, (E1), T2, (E2), T3, (E3), T4, (E4)))0))
+
+/* Types of constants according to the C90 rules. */
+#define C90_UNSUF_DEC_TYPE(C) \
+ first_of3(int, (C) <= INT_MAX, \
+ long int, (C) <= LONG_MAX, \
+ unsigned long int, (C) <= ULONG_MAX)
+#define C90_UNSUF_OCTHEX_TYPE(C) \
+ first_of4(int, (C) <= INT_MAX, \
+ unsigned int, (C) <= UINT_MAX, \
+ long int, (C) <= LONG_MAX, \
+ unsigned long int, (C) <= ULONG_MAX)
+#define C90_SUFu_TYPE(C) \
+ first_of2(unsigned int, (C) <= UINT_MAX, \
+ unsigned long int, (C) <= ULONG_MAX)
+#define C90_SUFl_TYPE(C) \
+ first_of2(long int, (C) <= LONG_MAX, \
+ unsigned long int, (C) <= ULONG_MAX)
+
+/* Checks that constants have correct type. */
+#define CHECK_UNSUF_DEC_TYPE(C) ASSERT_CONST_TYPE((C), C90_UNSUF_DEC_TYPE((C)))
+#define CHECK_UNSUF_OCTHEX_TYPE(C) \
+ ASSERT_CONST_TYPE((C), C90_UNSUF_OCTHEX_TYPE((C)))
+#define CHECK_SUFu_TYPE(C) ASSERT_CONST_TYPE((C), C90_SUFu_TYPE((C)))
+#define CHECK_SUFl_TYPE(C) ASSERT_CONST_TYPE((C), C90_SUFl_TYPE((C)))
+#define CHECK_SUFul_TYPE(C) ASSERT_CONST_TYPE((C), unsigned long int)
+
+/* Check a decimal value, with all suffixes. */
+#define CHECK_DEC_CONST(C) \
+ CHECK_UNSUF_DEC_TYPE(C); \
+ CHECK_SUFu_TYPE(C##u); \
+ CHECK_SUFu_TYPE(C##U); \
+ CHECK_SUFl_TYPE(C##l); \
+ CHECK_SUFl_TYPE(C##L); \
+ CHECK_SUFul_TYPE(C##ul); \
+ CHECK_SUFul_TYPE(C##uL); \
+ CHECK_SUFul_TYPE(C##Ul); \
+ CHECK_SUFul_TYPE(C##UL);
+
+/* Check an octal or hexadecimal value, with all suffixes. */
+#define CHECK_OCTHEX_CONST(C) \
+ CHECK_UNSUF_OCTHEX_TYPE(C); \
+ CHECK_SUFu_TYPE(C##u); \
+ CHECK_SUFu_TYPE(C##U); \
+ CHECK_SUFl_TYPE(C##l); \
+ CHECK_SUFl_TYPE(C##L); \
+ CHECK_SUFul_TYPE(C##ul); \
+ CHECK_SUFul_TYPE(C##uL); \
+ CHECK_SUFul_TYPE(C##Ul); \
+ CHECK_SUFul_TYPE(C##UL);
+
+#define CHECK_OCT_CONST(C) CHECK_OCTHEX_CONST(C)
+#define CHECK_HEX_CONST(C) \
+ CHECK_OCTHEX_CONST(0x##C); \
+ CHECK_OCTHEX_CONST(0X##C);
+
+/* True iff "long" is at least B bits. This presumes that (B-2)/3 is at
+ most 31. */
+#define LONG_AT_LEAST(B) \
+ (LONG_MAX >> ((B)-2)/3 >> ((B)-2)/3 >> ((B)-2 - ((B)-2)/3 - ((B)-2)/3))
+
+#define LONG_HAS_BITS(B) (LONG_AT_LEAST((B)) && !LONG_AT_LEAST((B) + 1))
+
+/* Decimal values that are large enough to be unsigned. Allow for up to
+ 64 bits in long. */
+#if LONG_HAS_BITS(32)
+#define LARGE_UNSIGNED_DECIMAL 2147483648
+#endif
+#if LONG_HAS_BITS(33)
+#define LARGE_UNSIGNED_DECIMAL 4294967296
+#endif
+#if LONG_HAS_BITS(34)
+#define LARGE_UNSIGNED_DECIMAL 8589934592
+#endif
+#if LONG_HAS_BITS(35)
+#define LARGE_UNSIGNED_DECIMAL 17179869184
+#endif
+#if LONG_HAS_BITS(36)
+#define LARGE_UNSIGNED_DECIMAL 34359738368
+#endif
+#if LONG_HAS_BITS(37)
+#define LARGE_UNSIGNED_DECIMAL 68719476736
+#endif
+#if LONG_HAS_BITS(38)
+#define LARGE_UNSIGNED_DECIMAL 137438953472
+#endif
+#if LONG_HAS_BITS(39)
+#define LARGE_UNSIGNED_DECIMAL 274877906944
+#endif
+#if LONG_HAS_BITS(40)
+#define LARGE_UNSIGNED_DECIMAL 549755813888
+#endif
+#if LONG_HAS_BITS(41)
+#define LARGE_UNSIGNED_DECIMAL 1099511627776
+#endif
+#if LONG_HAS_BITS(42)
+#define LARGE_UNSIGNED_DECIMAL 2199023255552
+#endif
+#if LONG_HAS_BITS(43)
+#define LARGE_UNSIGNED_DECIMAL 4398046511104
+#endif
+#if LONG_HAS_BITS(44)
+#define LARGE_UNSIGNED_DECIMAL 8796093022208
+#endif
+#if LONG_HAS_BITS(45)
+#define LARGE_UNSIGNED_DECIMAL 17592186044416
+#endif
+#if LONG_HAS_BITS(46)
+#define LARGE_UNSIGNED_DECIMAL 35184372088832
+#endif
+#if LONG_HAS_BITS(47)
+#define LARGE_UNSIGNED_DECIMAL 70368744177664
+#endif
+#if LONG_HAS_BITS(48)
+#define LARGE_UNSIGNED_DECIMAL 140737488355328
+#endif
+#if LONG_HAS_BITS(49)
+#define LARGE_UNSIGNED_DECIMAL 281474976710656
+#endif
+#if LONG_HAS_BITS(50)
+#define LARGE_UNSIGNED_DECIMAL 562949953421312
+#endif
+#if LONG_HAS_BITS(51)
+#define LARGE_UNSIGNED_DECIMAL 1125899906842624
+#endif
+#if LONG_HAS_BITS(52)
+#define LARGE_UNSIGNED_DECIMAL 2251799813685248
+#endif
+#if LONG_HAS_BITS(53)
+#define LARGE_UNSIGNED_DECIMAL 4503599627370496
+#endif
+#if LONG_HAS_BITS(54)
+#define LARGE_UNSIGNED_DECIMAL 9007199254740992
+#endif
+#if LONG_HAS_BITS(55)
+#define LARGE_UNSIGNED_DECIMAL 18014398509481984
+#endif
+#if LONG_HAS_BITS(56)
+#define LARGE_UNSIGNED_DECIMAL 36028797018963968
+#endif
+#if LONG_HAS_BITS(57)
+#define LARGE_UNSIGNED_DECIMAL 72057594037927936
+#endif
+#if LONG_HAS_BITS(58)
+#define LARGE_UNSIGNED_DECIMAL 144115188075855872
+#endif
+#if LONG_HAS_BITS(59)
+#define LARGE_UNSIGNED_DECIMAL 288230376151711744
+#endif
+#if LONG_HAS_BITS(60)
+#define LARGE_UNSIGNED_DECIMAL 576460752303423488
+#endif
+#if LONG_HAS_BITS(61)
+#define LARGE_UNSIGNED_DECIMAL 1152921504606846976
+#endif
+#if LONG_HAS_BITS(62)
+#define LARGE_UNSIGNED_DECIMAL 2305843009213693952
+#endif
+#if LONG_HAS_BITS(63)
+#define LARGE_UNSIGNED_DECIMAL 4611686018427387904
+#endif
+#if LONG_HAS_BITS(64)
+#define LARGE_UNSIGNED_DECIMAL 9223372036854775808
+#endif
+#if LONG_AT_LEAST(65)
+#error "extend this test to allow for long larger than 64 bits"
+#endif
+
+#define cat(x, y) x ## y
+#define xcat(x, y) cat(x, y)
+
+#define LARGE_UNSIGNED_DECIMALl xcat(LARGE_UNSIGNED_DECIMAL, l)
+#define LARGE_UNSIGNED_DECIMALL xcat(LARGE_UNSIGNED_DECIMAL, L)
+#define LARGE_UNSIGNED_DECIMALu xcat(LARGE_UNSIGNED_DECIMAL, u)
+#define LARGE_UNSIGNED_DECIMALU xcat(LARGE_UNSIGNED_DECIMAL, U)
+#define LARGE_UNSIGNED_DECIMALul xcat(LARGE_UNSIGNED_DECIMAL, ul)
+#define LARGE_UNSIGNED_DECIMALuL xcat(LARGE_UNSIGNED_DECIMAL, uL)
+#define LARGE_UNSIGNED_DECIMALUl xcat(LARGE_UNSIGNED_DECIMAL, Ul)
+#define LARGE_UNSIGNED_DECIMALUL xcat(LARGE_UNSIGNED_DECIMAL, UL)
+
+void
+foo (void)
+{
+ /* Decimal. */
+ /* Check all 2^n and 2^n - 1 up to 2^63 - 1. Check values that would be
+ unsigned separately since they generate a warning. */
+ CHECK_DEC_CONST(1);
+ CHECK_DEC_CONST(2);
+ CHECK_DEC_CONST(3);
+ CHECK_DEC_CONST(4);
+ CHECK_DEC_CONST(7);
+ CHECK_DEC_CONST(8);
+ CHECK_DEC_CONST(15);
+ CHECK_DEC_CONST(16);
+ CHECK_DEC_CONST(31);
+ CHECK_DEC_CONST(32);
+ CHECK_DEC_CONST(63);
+ CHECK_DEC_CONST(64);
+ CHECK_DEC_CONST(127);
+ CHECK_DEC_CONST(128);
+ CHECK_DEC_CONST(255);
+ CHECK_DEC_CONST(256);
+ CHECK_DEC_CONST(511);
+ CHECK_DEC_CONST(512);
+ CHECK_DEC_CONST(1023);
+ CHECK_DEC_CONST(1024);
+ CHECK_DEC_CONST(2047);
+ CHECK_DEC_CONST(2048);
+ CHECK_DEC_CONST(4095);
+ CHECK_DEC_CONST(4096);
+ CHECK_DEC_CONST(8191);
+ CHECK_DEC_CONST(8192);
+ CHECK_DEC_CONST(16383);
+ CHECK_DEC_CONST(16384);
+ CHECK_DEC_CONST(32767);
+ CHECK_DEC_CONST(32768);
+ CHECK_DEC_CONST(65535);
+ CHECK_DEC_CONST(65536);
+ CHECK_DEC_CONST(131071);
+ CHECK_DEC_CONST(131072);
+ CHECK_DEC_CONST(262143);
+ CHECK_DEC_CONST(262144);
+ CHECK_DEC_CONST(524287);
+ CHECK_DEC_CONST(524288);
+ CHECK_DEC_CONST(1048575);
+ CHECK_DEC_CONST(1048576);
+ CHECK_DEC_CONST(2097151);
+ CHECK_DEC_CONST(2097152);
+ CHECK_DEC_CONST(4194303);
+ CHECK_DEC_CONST(4194304);
+ CHECK_DEC_CONST(8388607);
+ CHECK_DEC_CONST(8388608);
+ CHECK_DEC_CONST(16777215);
+ CHECK_DEC_CONST(16777216);
+ CHECK_DEC_CONST(33554431);
+ CHECK_DEC_CONST(33554432);
+ CHECK_DEC_CONST(67108863);
+ CHECK_DEC_CONST(67108864);
+ CHECK_DEC_CONST(134217727);
+ CHECK_DEC_CONST(134217728);
+ CHECK_DEC_CONST(268435455);
+ CHECK_DEC_CONST(268435456);
+ CHECK_DEC_CONST(536870911);
+ CHECK_DEC_CONST(536870912);
+ CHECK_DEC_CONST(1073741823);
+ CHECK_DEC_CONST(1073741824);
+ CHECK_DEC_CONST(2147483647);
+#if LONG_AT_LEAST(33)
+ CHECK_DEC_CONST(2147483648);
+ CHECK_DEC_CONST(4294967295);
+#endif
+#if LONG_AT_LEAST(34)
+ CHECK_DEC_CONST(4294967296);
+ CHECK_DEC_CONST(8589934591);
+#endif
+#if LONG_AT_LEAST(35)
+ CHECK_DEC_CONST(8589934592);
+ CHECK_DEC_CONST(17179869183);
+#endif
+#if LONG_AT_LEAST(36)
+ CHECK_DEC_CONST(17179869184);
+ CHECK_DEC_CONST(34359738367);
+#endif
+#if LONG_AT_LEAST(37)
+ CHECK_DEC_CONST(34359738368);
+ CHECK_DEC_CONST(68719476735);
+#endif
+#if LONG_AT_LEAST(38)
+ CHECK_DEC_CONST(68719476736);
+ CHECK_DEC_CONST(137438953471);
+#endif
+#if LONG_AT_LEAST(39)
+ CHECK_DEC_CONST(137438953472);
+ CHECK_DEC_CONST(274877906943);
+#endif
+#if LONG_AT_LEAST(40)
+ CHECK_DEC_CONST(274877906944);
+ CHECK_DEC_CONST(549755813887);
+#endif
+#if LONG_AT_LEAST(41)
+ CHECK_DEC_CONST(549755813888);
+ CHECK_DEC_CONST(1099511627775);
+#endif
+#if LONG_AT_LEAST(42)
+ CHECK_DEC_CONST(1099511627776);
+ CHECK_DEC_CONST(2199023255551);
+#endif
+#if LONG_AT_LEAST(43)
+ CHECK_DEC_CONST(2199023255552);
+ CHECK_DEC_CONST(4398046511103);
+#endif
+#if LONG_AT_LEAST(44)
+ CHECK_DEC_CONST(4398046511104);
+ CHECK_DEC_CONST(8796093022207);
+#endif
+#if LONG_AT_LEAST(45)
+ CHECK_DEC_CONST(8796093022208);
+ CHECK_DEC_CONST(17592186044415);
+#endif
+#if LONG_AT_LEAST(46)
+ CHECK_DEC_CONST(17592186044416);
+ CHECK_DEC_CONST(35184372088831);
+#endif
+#if LONG_AT_LEAST(47)
+ CHECK_DEC_CONST(35184372088832);
+ CHECK_DEC_CONST(70368744177663);
+#endif
+#if LONG_AT_LEAST(48)
+ CHECK_DEC_CONST(70368744177664);
+ CHECK_DEC_CONST(140737488355327);
+#endif
+#if LONG_AT_LEAST(49)
+ CHECK_DEC_CONST(140737488355328);
+ CHECK_DEC_CONST(281474976710655);
+#endif
+#if LONG_AT_LEAST(50)
+ CHECK_DEC_CONST(281474976710656);
+ CHECK_DEC_CONST(562949953421311);
+#endif
+#if LONG_AT_LEAST(51)
+ CHECK_DEC_CONST(562949953421312);
+ CHECK_DEC_CONST(1125899906842623);
+#endif
+#if LONG_AT_LEAST(52)
+ CHECK_DEC_CONST(1125899906842624);
+ CHECK_DEC_CONST(2251799813685247);
+#endif
+#if LONG_AT_LEAST(53)
+ CHECK_DEC_CONST(2251799813685248);
+ CHECK_DEC_CONST(4503599627370495);
+#endif
+#if LONG_AT_LEAST(54)
+ CHECK_DEC_CONST(4503599627370496);
+ CHECK_DEC_CONST(9007199254740991);
+#endif
+#if LONG_AT_LEAST(55)
+ CHECK_DEC_CONST(9007199254740992);
+ CHECK_DEC_CONST(18014398509481983);
+#endif
+#if LONG_AT_LEAST(56)
+ CHECK_DEC_CONST(18014398509481984);
+ CHECK_DEC_CONST(36028797018963967);
+#endif
+#if LONG_AT_LEAST(57)
+ CHECK_DEC_CONST(36028797018963968);
+ CHECK_DEC_CONST(72057594037927935);
+#endif
+#if LONG_AT_LEAST(58)
+ CHECK_DEC_CONST(72057594037927936);
+ CHECK_DEC_CONST(144115188075855871);
+#endif
+#if LONG_AT_LEAST(59)
+ CHECK_DEC_CONST(144115188075855872);
+ CHECK_DEC_CONST(288230376151711743);
+#endif
+#if LONG_AT_LEAST(60)
+ CHECK_DEC_CONST(288230376151711744);
+ CHECK_DEC_CONST(576460752303423487);
+#endif
+#if LONG_AT_LEAST(61)
+ CHECK_DEC_CONST(576460752303423488);
+ CHECK_DEC_CONST(1152921504606846975);
+#endif
+#if LONG_AT_LEAST(62)
+ CHECK_DEC_CONST(1152921504606846976);
+ CHECK_DEC_CONST(2305843009213693951);
+#endif
+#if LONG_AT_LEAST(63)
+ CHECK_DEC_CONST(2305843009213693952);
+ CHECK_DEC_CONST(4611686018427387903);
+#endif
+#if LONG_AT_LEAST(64)
+ CHECK_DEC_CONST(4611686018427387904);
+ CHECK_DEC_CONST(9223372036854775807);
+#endif
+ /* Separate checks for values that are unsigned. */
+ CHECK_UNSUF_DEC_TYPE(LARGE_UNSIGNED_DECIMAL); /* { dg-warning "unsigned" "unsigned decimal no suffix" } */
+ CHECK_SUFl_TYPE(LARGE_UNSIGNED_DECIMALl); /* { dg-warning "unsigned" "unsigned decimal long suffix" } */
+ CHECK_SUFl_TYPE(LARGE_UNSIGNED_DECIMALL); /* { dg-warning "unsigned" "unsigned decimal long suffix" } */
+ CHECK_SUFu_TYPE(LARGE_UNSIGNED_DECIMALu);
+ CHECK_SUFu_TYPE(LARGE_UNSIGNED_DECIMALU);
+ CHECK_SUFul_TYPE(LARGE_UNSIGNED_DECIMALul);
+ CHECK_SUFul_TYPE(LARGE_UNSIGNED_DECIMALuL);
+ CHECK_SUFul_TYPE(LARGE_UNSIGNED_DECIMALUl);
+ CHECK_SUFul_TYPE(LARGE_UNSIGNED_DECIMALUL);
+ /* Octal and hexadecimal. */
+ /* Check all 2^n and 2^n - 1 up to 2^64 - 1. */
+ CHECK_OCT_CONST(0);
+ CHECK_HEX_CONST(0);
+ CHECK_OCT_CONST(01);
+ CHECK_HEX_CONST(1);
+ CHECK_OCT_CONST(02);
+ CHECK_HEX_CONST(2);
+ CHECK_OCT_CONST(03);
+ CHECK_HEX_CONST(3);
+ CHECK_OCT_CONST(04);
+ CHECK_HEX_CONST(4);
+ CHECK_OCT_CONST(07);
+ CHECK_HEX_CONST(7);
+ CHECK_OCT_CONST(010);
+ CHECK_HEX_CONST(8);
+ CHECK_OCT_CONST(017);
+ CHECK_HEX_CONST(f);
+ CHECK_OCT_CONST(020);
+ CHECK_HEX_CONST(10);
+ CHECK_OCT_CONST(037);
+ CHECK_HEX_CONST(1f);
+ CHECK_OCT_CONST(040);
+ CHECK_HEX_CONST(20);
+ CHECK_OCT_CONST(077);
+ CHECK_HEX_CONST(3f);
+ CHECK_OCT_CONST(0100);
+ CHECK_HEX_CONST(40);
+ CHECK_OCT_CONST(0177);
+ CHECK_HEX_CONST(7f);
+ CHECK_OCT_CONST(0200);
+ CHECK_HEX_CONST(80);
+ CHECK_OCT_CONST(0377);
+ CHECK_HEX_CONST(ff);
+ CHECK_OCT_CONST(0400);
+ CHECK_HEX_CONST(100);
+ CHECK_OCT_CONST(0777);
+ CHECK_HEX_CONST(1ff);
+ CHECK_OCT_CONST(01000);
+ CHECK_HEX_CONST(200);
+ CHECK_OCT_CONST(01777);
+ CHECK_HEX_CONST(3ff);
+ CHECK_OCT_CONST(02000);
+ CHECK_HEX_CONST(400);
+ CHECK_OCT_CONST(03777);
+ CHECK_HEX_CONST(7ff);
+ CHECK_OCT_CONST(04000);
+ CHECK_HEX_CONST(800);
+ CHECK_OCT_CONST(07777);
+ CHECK_HEX_CONST(fff);
+ CHECK_OCT_CONST(010000);
+ CHECK_HEX_CONST(1000);
+ CHECK_OCT_CONST(017777);
+ CHECK_HEX_CONST(1fff);
+ CHECK_OCT_CONST(020000);
+ CHECK_HEX_CONST(2000);
+ CHECK_OCT_CONST(037777);
+ CHECK_HEX_CONST(3fff);
+ CHECK_OCT_CONST(040000);
+ CHECK_HEX_CONST(4000);
+ CHECK_OCT_CONST(077777);
+ CHECK_HEX_CONST(7fff);
+ CHECK_OCT_CONST(0100000);
+ CHECK_HEX_CONST(8000);
+ CHECK_OCT_CONST(0177777);
+ CHECK_HEX_CONST(ffff);
+ CHECK_OCT_CONST(0200000);
+ CHECK_HEX_CONST(10000);
+ CHECK_OCT_CONST(0377777);
+ CHECK_HEX_CONST(1ffff);
+ CHECK_OCT_CONST(0400000);
+ CHECK_HEX_CONST(20000);
+ CHECK_OCT_CONST(0777777);
+ CHECK_HEX_CONST(3ffff);
+ CHECK_OCT_CONST(01000000);
+ CHECK_HEX_CONST(40000);
+ CHECK_OCT_CONST(01777777);
+ CHECK_HEX_CONST(7ffff);
+ CHECK_OCT_CONST(02000000);
+ CHECK_HEX_CONST(80000);
+ CHECK_OCT_CONST(03777777);
+ CHECK_HEX_CONST(fffff);
+ CHECK_OCT_CONST(04000000);
+ CHECK_HEX_CONST(100000);
+ CHECK_OCT_CONST(07777777);
+ CHECK_HEX_CONST(1fffff);
+ CHECK_OCT_CONST(010000000);
+ CHECK_HEX_CONST(200000);
+ CHECK_OCT_CONST(017777777);
+ CHECK_HEX_CONST(3fffff);
+ CHECK_OCT_CONST(020000000);
+ CHECK_HEX_CONST(400000);
+ CHECK_OCT_CONST(037777777);
+ CHECK_HEX_CONST(7fffff);
+ CHECK_OCT_CONST(040000000);
+ CHECK_HEX_CONST(800000);
+ CHECK_OCT_CONST(077777777);
+ CHECK_HEX_CONST(ffffff);
+ CHECK_OCT_CONST(0100000000);
+ CHECK_HEX_CONST(1000000);
+ CHECK_OCT_CONST(0177777777);
+ CHECK_HEX_CONST(1ffffff);
+ CHECK_OCT_CONST(0200000000);
+ CHECK_HEX_CONST(2000000);
+ CHECK_OCT_CONST(0377777777);
+ CHECK_HEX_CONST(3ffffff);
+ CHECK_OCT_CONST(0400000000);
+ CHECK_HEX_CONST(4000000);
+ CHECK_OCT_CONST(0777777777);
+ CHECK_HEX_CONST(7ffffff);
+ CHECK_OCT_CONST(01000000000);
+ CHECK_HEX_CONST(8000000);
+ CHECK_OCT_CONST(01777777777);
+ CHECK_HEX_CONST(fffffff);
+ CHECK_OCT_CONST(02000000000);
+ CHECK_HEX_CONST(10000000);
+ CHECK_OCT_CONST(03777777777);
+ CHECK_HEX_CONST(1fffffff);
+ CHECK_OCT_CONST(04000000000);
+ CHECK_HEX_CONST(20000000);
+ CHECK_OCT_CONST(07777777777);
+ CHECK_HEX_CONST(3fffffff);
+ CHECK_OCT_CONST(010000000000);
+ CHECK_HEX_CONST(40000000);
+ CHECK_OCT_CONST(017777777777);
+ CHECK_HEX_CONST(7fffffff);
+ CHECK_OCT_CONST(020000000000);
+ CHECK_HEX_CONST(80000000);
+ CHECK_OCT_CONST(037777777777);
+ CHECK_HEX_CONST(ffffffff);
+#if LONG_AT_LEAST(33)
+ CHECK_OCT_CONST(040000000000);
+ CHECK_HEX_CONST(100000000);
+ CHECK_OCT_CONST(077777777777);
+ CHECK_HEX_CONST(1ffffffff);
+#endif
+#if LONG_AT_LEAST(34)
+ CHECK_OCT_CONST(0100000000000);
+ CHECK_HEX_CONST(200000000);
+ CHECK_OCT_CONST(0177777777777);
+ CHECK_HEX_CONST(3ffffffff);
+#endif
+#if LONG_AT_LEAST(35)
+ CHECK_OCT_CONST(0200000000000);
+ CHECK_HEX_CONST(400000000);
+ CHECK_OCT_CONST(0377777777777);
+ CHECK_HEX_CONST(7ffffffff);
+#endif
+#if LONG_AT_LEAST(36)
+ CHECK_OCT_CONST(0400000000000);
+ CHECK_HEX_CONST(800000000);
+ CHECK_OCT_CONST(0777777777777);
+ CHECK_HEX_CONST(fffffffff);
+#endif
+#if LONG_AT_LEAST(37)
+ CHECK_OCT_CONST(01000000000000);
+ CHECK_HEX_CONST(1000000000);
+ CHECK_OCT_CONST(01777777777777);
+ CHECK_HEX_CONST(1fffffffff);
+#endif
+#if LONG_AT_LEAST(38)
+ CHECK_OCT_CONST(02000000000000);
+ CHECK_HEX_CONST(2000000000);
+ CHECK_OCT_CONST(03777777777777);
+ CHECK_HEX_CONST(3fffffffff);
+#endif
+#if LONG_AT_LEAST(39)
+ CHECK_OCT_CONST(04000000000000);
+ CHECK_HEX_CONST(4000000000);
+ CHECK_OCT_CONST(07777777777777);
+ CHECK_HEX_CONST(7fffffffff);
+#endif
+#if LONG_AT_LEAST(40)
+ CHECK_OCT_CONST(010000000000000);
+ CHECK_HEX_CONST(8000000000);
+ CHECK_OCT_CONST(017777777777777);
+ CHECK_HEX_CONST(ffffffffff);
+#endif
+#if LONG_AT_LEAST(41)
+ CHECK_OCT_CONST(020000000000000);
+ CHECK_HEX_CONST(10000000000);
+ CHECK_OCT_CONST(037777777777777);
+ CHECK_HEX_CONST(1ffffffffff);
+#endif
+#if LONG_AT_LEAST(42)
+ CHECK_OCT_CONST(040000000000000);
+ CHECK_HEX_CONST(20000000000);
+ CHECK_OCT_CONST(077777777777777);
+ CHECK_HEX_CONST(3ffffffffff);
+#endif
+#if LONG_AT_LEAST(43)
+ CHECK_OCT_CONST(0100000000000000);
+ CHECK_HEX_CONST(40000000000);
+ CHECK_OCT_CONST(0177777777777777);
+ CHECK_HEX_CONST(7ffffffffff);
+#endif
+#if LONG_AT_LEAST(44)
+ CHECK_OCT_CONST(0200000000000000);
+ CHECK_HEX_CONST(80000000000);
+ CHECK_OCT_CONST(0377777777777777);
+ CHECK_HEX_CONST(fffffffffff);
+#endif
+#if LONG_AT_LEAST(45)
+ CHECK_OCT_CONST(0400000000000000);
+ CHECK_HEX_CONST(100000000000);
+ CHECK_OCT_CONST(0777777777777777);
+ CHECK_HEX_CONST(1fffffffffff);
+#endif
+#if LONG_AT_LEAST(46)
+ CHECK_OCT_CONST(01000000000000000);
+ CHECK_HEX_CONST(200000000000);
+ CHECK_OCT_CONST(01777777777777777);
+ CHECK_HEX_CONST(3fffffffffff);
+#endif
+#if LONG_AT_LEAST(47)
+ CHECK_OCT_CONST(02000000000000000);
+ CHECK_HEX_CONST(400000000000);
+ CHECK_OCT_CONST(03777777777777777);
+ CHECK_HEX_CONST(7fffffffffff);
+#endif
+#if LONG_AT_LEAST(48)
+ CHECK_OCT_CONST(04000000000000000);
+ CHECK_HEX_CONST(800000000000);
+ CHECK_OCT_CONST(07777777777777777);
+ CHECK_HEX_CONST(ffffffffffff);
+#endif
+#if LONG_AT_LEAST(49)
+ CHECK_OCT_CONST(010000000000000000);
+ CHECK_HEX_CONST(1000000000000);
+ CHECK_OCT_CONST(017777777777777777);
+ CHECK_HEX_CONST(1ffffffffffff);
+#endif
+#if LONG_AT_LEAST(50)
+ CHECK_OCT_CONST(020000000000000000);
+ CHECK_HEX_CONST(2000000000000);
+ CHECK_OCT_CONST(037777777777777777);
+ CHECK_HEX_CONST(3ffffffffffff);
+#endif
+#if LONG_AT_LEAST(51)
+ CHECK_OCT_CONST(040000000000000000);
+ CHECK_HEX_CONST(4000000000000);
+ CHECK_OCT_CONST(077777777777777777);
+ CHECK_HEX_CONST(7ffffffffffff);
+#endif
+#if LONG_AT_LEAST(52)
+ CHECK_OCT_CONST(0100000000000000000);
+ CHECK_HEX_CONST(8000000000000);
+ CHECK_OCT_CONST(0177777777777777777);
+ CHECK_HEX_CONST(fffffffffffff);
+#endif
+#if LONG_AT_LEAST(53)
+ CHECK_OCT_CONST(0200000000000000000);
+ CHECK_HEX_CONST(10000000000000);
+ CHECK_OCT_CONST(0377777777777777777);
+ CHECK_HEX_CONST(1fffffffffffff);
+#endif
+#if LONG_AT_LEAST(54)
+ CHECK_OCT_CONST(0400000000000000000);
+ CHECK_HEX_CONST(20000000000000);
+ CHECK_OCT_CONST(0777777777777777777);
+ CHECK_HEX_CONST(3fffffffffffff);
+#endif
+#if LONG_AT_LEAST(55)
+ CHECK_OCT_CONST(01000000000000000000);
+ CHECK_HEX_CONST(40000000000000);
+ CHECK_OCT_CONST(01777777777777777777);
+ CHECK_HEX_CONST(7fffffffffffff);
+#endif
+#if LONG_AT_LEAST(56)
+ CHECK_OCT_CONST(02000000000000000000);
+ CHECK_HEX_CONST(80000000000000);
+ CHECK_OCT_CONST(03777777777777777777);
+ CHECK_HEX_CONST(ffffffffffffff);
+#endif
+#if LONG_AT_LEAST(57)
+ CHECK_OCT_CONST(04000000000000000000);
+ CHECK_HEX_CONST(100000000000000);
+ CHECK_OCT_CONST(07777777777777777777);
+ CHECK_HEX_CONST(1ffffffffffffff);
+#endif
+#if LONG_AT_LEAST(58)
+ CHECK_OCT_CONST(010000000000000000000);
+ CHECK_HEX_CONST(200000000000000);
+ CHECK_OCT_CONST(017777777777777777777);
+ CHECK_HEX_CONST(3ffffffffffffff);
+#endif
+#if LONG_AT_LEAST(59)
+ CHECK_OCT_CONST(020000000000000000000);
+ CHECK_HEX_CONST(400000000000000);
+ CHECK_OCT_CONST(037777777777777777777);
+ CHECK_HEX_CONST(7ffffffffffffff);
+#endif
+#if LONG_AT_LEAST(60)
+ CHECK_OCT_CONST(040000000000000000000);
+ CHECK_HEX_CONST(800000000000000);
+ CHECK_OCT_CONST(077777777777777777777);
+ CHECK_HEX_CONST(fffffffffffffff);
+#endif
+#if LONG_AT_LEAST(61)
+ CHECK_OCT_CONST(0100000000000000000000);
+ CHECK_HEX_CONST(1000000000000000);
+ CHECK_OCT_CONST(0177777777777777777777);
+ CHECK_HEX_CONST(1fffffffffffffff);
+#endif
+#if LONG_AT_LEAST(62)
+ CHECK_OCT_CONST(0200000000000000000000);
+ CHECK_HEX_CONST(2000000000000000);
+ CHECK_OCT_CONST(0377777777777777777777);
+ CHECK_HEX_CONST(3fffffffffffffff);
+#endif
+#if LONG_AT_LEAST(63)
+ CHECK_OCT_CONST(0400000000000000000000);
+ CHECK_HEX_CONST(4000000000000000);
+ CHECK_OCT_CONST(0777777777777777777777);
+ CHECK_HEX_CONST(7fffffffffffffff);
+#endif
+#if LONG_AT_LEAST(64)
+ CHECK_OCT_CONST(01000000000000000000000);
+ CHECK_HEX_CONST(8000000000000000);
+ CHECK_OCT_CONST(01777777777777777777777);
+ CHECK_HEX_CONST(ffffffffffffffff);
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-intprom-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-intprom-1.c
new file mode 100644
index 000000000..78e4b39ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-intprom-1.c
@@ -0,0 +1,47 @@
+/* Test for integer promotion rules: C90 subset of types. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#include <limits.h>
+
+#define CHECK(T1, T2, TC) \
+ do { \
+ T1 a = 0; \
+ T2 b = 0; \
+ TC *c = 0; \
+ __typeof__(a+b) *d = 0; \
+ c = d; \
+ d = c; \
+ } while (0)
+
+void
+f (void)
+{
+ /* One type is unsigned long. */
+ CHECK(unsigned long, unsigned long, unsigned long);
+ CHECK(unsigned int, unsigned long, unsigned long);
+ CHECK(unsigned long, unsigned int, unsigned long);
+ CHECK(int, unsigned long, unsigned long);
+ CHECK(long, unsigned long, unsigned long);
+ CHECK(unsigned long, int, unsigned long);
+ CHECK(unsigned long, long, unsigned long);
+ /* long and unsigned int. */
+#if LONG_MAX >= UINT_MAX
+ CHECK(unsigned int, long, long);
+ CHECK(long, unsigned int, long);
+#else
+ CHECK(unsigned int, long, unsigned long);
+ CHECK(long, unsigned int, unsigned long);
+#endif
+ /* One type is long. */
+ CHECK(long, long, long);
+ CHECK(int, long, long);
+ CHECK(long, int, long);
+ /* One type is unsigned int. */
+ CHECK(unsigned int, unsigned int, unsigned int);
+ CHECK(int, unsigned int, unsigned int);
+ CHECK(unsigned int, int, unsigned int);
+ /* Otherwise int. */
+ CHECK(int, int, int);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-longlong-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-longlong-1.c
new file mode 100644
index 000000000..3594d4be9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-longlong-1.c
@@ -0,0 +1,6 @@
+/* Test for long long: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+long long foo; /* { dg-error "long long" "long long not in C90" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-mixdecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-mixdecl-1.c
new file mode 100644
index 000000000..b07ab2674
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-mixdecl-1.c
@@ -0,0 +1,13 @@
+/* Test for C99 mixed declarations and code: not in C90. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ int i;
+ i = 0;
+ int j; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "mix|parse" "mixed declarations and code not in C90" { target *-*-* } 11 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-noreturn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-noreturn-1.c
new file mode 100644
index 000000000..87b832e06
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-noreturn-1.c
@@ -0,0 +1,5 @@
+/* Test _Noreturn not in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+_Noreturn void f (void); /* { dg-error "ISO C90 does not support '_Noreturn'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-restrict-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-restrict-1.c
new file mode 100644
index 000000000..482083151
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-restrict-1.c
@@ -0,0 +1,7 @@
+/* Test for restrict: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+char *restrict foo; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parse error|syntax error|expected|no type" "restrict not in C90" { target *-*-* } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-return-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-return-1.c
new file mode 100644
index 000000000..59e9a920b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-return-1.c
@@ -0,0 +1,17 @@
+/* Test for constraints on return statements. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+int
+foo (void)
+{
+ return;
+}
+
+void
+bar (void)
+{
+ return 1; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "with a value" "return constraint violation" { target *-*-* } 15 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-scope-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-scope-1.c
new file mode 100644
index 000000000..ad36b7063
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-scope-1.c
@@ -0,0 +1,34 @@
+/* Test for new block scopes in C99. Inspired by C99 Rationale (N897). */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+struct foo {
+ char a;
+};
+
+extern void abort (void);
+extern void exit (int);
+
+int
+sfoo (void)
+{
+ if (sizeof (struct foo { int a; double b; char *c; void *d; }))
+ (void) 0;
+ return sizeof (struct foo);
+}
+
+int
+main (void)
+{
+ int t, u;
+ t = sfoo ();
+ u = sizeof (struct foo);
+ /* With C90 scoping rules the new declaration of struct foo is in scope
+ above; with C99 it is local to the if.
+ */
+ if (t == u)
+ abort (); /* C99 rules apply. */
+ else
+ exit (0); /* C90 rules apply. */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-static-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-static-1.c
new file mode 100644
index 000000000..cc6f320c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-static-1.c
@@ -0,0 +1,22 @@
+/* It is a constraint violation for a static function to be declared
+ but not defined if it is used except in a sizeof expression. The
+ use of the function simply being unevaluated is not enough. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=iso9899:1990 -pedantic-errors" } */
+
+/* Constraint violation (trivial case, where function is used). */
+static void f0(void); /* { dg-error "used but never defined" } */
+void g0(void) { f0(); }
+
+/* Constraint violation. */
+static void f1(void); /* { dg-error "used but never defined" } */
+void g1(void) { if (0) { f1(); } }
+
+/* Constraint violation. */
+static int f2(void); /* { dg-error "used but never defined" } */
+void g2(void) { 0 ? f2() : 0; }
+
+/* OK. */
+static int f3(void);
+void g3(void) { sizeof(f3()); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-static-assert-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-static-assert-1.c
new file mode 100644
index 000000000..d174ec9b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-static-assert-1.c
@@ -0,0 +1,5 @@
+/* Test for static assertions not in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+_Static_assert (1, ""); /* { dg-error "ISO C90 does not support '_Static_assert'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-thread-local-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-thread-local-1.c
new file mode 100644
index 000000000..92bf57a90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-thread-local-1.c
@@ -0,0 +1,5 @@
+/* Test for _Thread_local: not in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=c90 -pedantic-errors" } */
+
+static _Thread_local int x; /* { dg-error "_Thread_local" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-typedef-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-typedef-1.c
new file mode 100644
index 000000000..1920f3b51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-typedef-1.c
@@ -0,0 +1,6 @@
+/* Test typedef redeclaration not permitted in C90. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+typedef int TI; /* { dg-message "previous declaration" } */
+typedef int TI; /* { dg-error "redefinition of typedef" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-typespec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-typespec-1.c
new file mode 100644
index 000000000..e32111b63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-typespec-1.c
@@ -0,0 +1,522 @@
+/* Test for valid and invalid combinations of type specifiers in C90.
+ Similar to typespec-1.c but with -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+typedef char type;
+extern *x0;
+void *x1;
+char *x2;
+short *x3;
+int *x4;
+long *x5;
+float *x6;
+double *x7;
+signed *x8;
+unsigned *x9;
+type *x10;
+void void *x11; /* { dg-error "" "void void" } */
+void char *x12; /* { dg-error "" "void char" } */
+void short *x13; /* { dg-error "" "void short" } */
+void int *x14; /* { dg-error "" "void int" } */
+void long *x15; /* { dg-error "" "void long" } */
+void float *x16; /* { dg-error "" "void float" } */
+void double *x17; /* { dg-error "" "void double" } */
+void signed *x18; /* { dg-error "" "void signed" } */
+void unsigned *x19; /* { dg-error "" "void unsigned" } */
+char void *x20; /* { dg-error "" "char void" } */
+char char *x21; /* { dg-error "" "char char" } */
+char short *x22; /* { dg-error "" "char short" } */
+char int *x23; /* { dg-error "" "char int" } */
+char long *x24; /* { dg-error "" "char long" } */
+char float *x25; /* { dg-error "" "char float" } */
+char double *x26; /* { dg-error "" "char double" } */
+char signed *x27;
+char unsigned *x28;
+short void *x29; /* { dg-error "" "short void" } */
+short char *x30; /* { dg-error "" "short char" } */
+short short *x31; /* { dg-error "" "short short" } */
+short int *x32;
+short long *x33; /* { dg-error "" "short long" } */
+short float *x34; /* { dg-error "" "short float" } */
+short double *x35; /* { dg-error "" "short double" } */
+short signed *x36;
+short unsigned *x37;
+int void *x38; /* { dg-error "" "int void" } */
+int char *x39; /* { dg-error "" "int char" } */
+int short *x40;
+int int *x41; /* { dg-error "" "int int" } */
+int long *x42;
+int float *x43; /* { dg-error "" "int float" } */
+int double *x44; /* { dg-error "" "int double" } */
+int signed *x45;
+int unsigned *x46;
+long void *x47; /* { dg-error "" "long void" } */
+long char *x48; /* { dg-error "" "long char" } */
+long short *x49; /* { dg-error "" "long short" } */
+long int *x50;
+long long *x51; /* { dg-error "" "long long" } */
+long float *x52; /* { dg-error "" "long float" } */
+long double *x53;
+long signed *x54;
+long unsigned *x55;
+float void *x56; /* { dg-error "" "float void" } */
+float char *x57; /* { dg-error "" "float char" } */
+float short *x58; /* { dg-error "" "float short" } */
+float int *x59; /* { dg-error "" "float int" } */
+float long *x60; /* { dg-error "" "float long" } */
+float float *x61; /* { dg-error "" "float float" } */
+float double *x62; /* { dg-error "" "float double" } */
+float signed *x63; /* { dg-error "" "float signed" } */
+float unsigned *x64; /* { dg-error "" "float unsigned" } */
+double void *x65; /* { dg-error "" "double void" } */
+double char *x66; /* { dg-error "" "double char" } */
+double short *x67; /* { dg-error "" "double short" } */
+double int *x68; /* { dg-error "" "double int" } */
+double long *x69;
+double float *x70; /* { dg-error "" "double float" } */
+double double *x71; /* { dg-error "" "double double" } */
+double signed *x72; /* { dg-error "" "double signed" } */
+double unsigned *x73; /* { dg-error "" "double unsigned" } */
+signed void *x74; /* { dg-error "" "signed void" } */
+signed char *x75;
+signed short *x76;
+signed int *x77;
+signed long *x78;
+signed float *x79; /* { dg-error "" "signed float" } */
+signed double *x80; /* { dg-error "" "signed double" } */
+signed signed *x81; /* { dg-error "" "signed signed" } */
+signed unsigned *x82; /* { dg-error "" "signed unsigned" } */
+unsigned void *x83; /* { dg-error "" "unsigned void" } */
+unsigned char *x84;
+unsigned short *x85;
+unsigned int *x86;
+unsigned long *x87;
+unsigned float *x88; /* { dg-error "" "unsigned float" } */
+unsigned double *x89; /* { dg-error "" "unsigned double" } */
+unsigned signed *x90; /* { dg-error "" "unsigned signed" } */
+unsigned unsigned *x91; /* { dg-error "" "unsigned unsigned" } */
+type void *x92; /* { dg-error "" "type void" } */
+type char *x93; /* { dg-error "" "type char" } */
+type short *x94; /* { dg-error "" "type short" } */
+type int *x95; /* { dg-error "" "type int" } */
+type long *x96; /* { dg-error "" "type long" } */
+type float *x97; /* { dg-error "" "type float" } */
+type double *x98; /* { dg-error "" "type double" } */
+type signed *x99; /* { dg-error "" "type signed" } */
+type unsigned *x100; /* { dg-error "" "type unsigned" } */
+char signed void *x101; /* { dg-error "" "char signed void" } */
+char signed char *x102; /* { dg-error "" "char signed char" } */
+char signed short *x103; /* { dg-error "" "char signed short" } */
+char signed int *x104; /* { dg-error "" "char signed int" } */
+char signed long *x105; /* { dg-error "" "char signed long" } */
+char signed float *x106; /* { dg-error "" "char signed float" } */
+char signed double *x107; /* { dg-error "" "char signed double" } */
+char signed signed *x108; /* { dg-error "" "char signed signed" } */
+char signed unsigned *x109; /* { dg-error "" "char signed unsigned" } */
+char unsigned void *x110; /* { dg-error "" "char unsigned void" } */
+char unsigned char *x111; /* { dg-error "" "char unsigned char" } */
+char unsigned short *x112; /* { dg-error "" "char unsigned short" } */
+char unsigned int *x113; /* { dg-error "" "char unsigned int" } */
+char unsigned long *x114; /* { dg-error "" "char unsigned long" } */
+char unsigned float *x115; /* { dg-error "" "char unsigned float" } */
+char unsigned double *x116; /* { dg-error "" "char unsigned double" } */
+char unsigned signed *x117; /* { dg-error "" "char unsigned signed" } */
+char unsigned unsigned *x118; /* { dg-error "" "char unsigned unsigned" } */
+short int void *x119; /* { dg-error "" "short int void" } */
+short int char *x120; /* { dg-error "" "short int char" } */
+short int short *x121; /* { dg-error "" "short int short" } */
+short int int *x122; /* { dg-error "" "short int int" } */
+short int long *x123; /* { dg-error "" "short int long" } */
+short int float *x124; /* { dg-error "" "short int float" } */
+short int double *x125; /* { dg-error "" "short int double" } */
+short int signed *x126;
+short int unsigned *x127;
+short signed void *x128; /* { dg-error "" "short signed void" } */
+short signed char *x129; /* { dg-error "" "short signed char" } */
+short signed short *x130; /* { dg-error "" "short signed short" } */
+short signed int *x131;
+short signed long *x132; /* { dg-error "" "short signed long" } */
+short signed float *x133; /* { dg-error "" "short signed float" } */
+short signed double *x134; /* { dg-error "" "short signed double" } */
+short signed signed *x135; /* { dg-error "" "short signed signed" } */
+short signed unsigned *x136; /* { dg-error "" "short signed unsigned" } */
+short unsigned void *x137; /* { dg-error "" "short unsigned void" } */
+short unsigned char *x138; /* { dg-error "" "short unsigned char" } */
+short unsigned short *x139; /* { dg-error "" "short unsigned short" } */
+short unsigned int *x140;
+short unsigned long *x141; /* { dg-error "" "short unsigned long" } */
+short unsigned float *x142; /* { dg-error "" "short unsigned float" } */
+short unsigned double *x143; /* { dg-error "" "short unsigned double" } */
+short unsigned signed *x144; /* { dg-error "" "short unsigned signed" } */
+short unsigned unsigned *x145; /* { dg-error "" "short unsigned unsigned" } */
+int short void *x146; /* { dg-error "" "int short void" } */
+int short char *x147; /* { dg-error "" "int short char" } */
+int short short *x148; /* { dg-error "" "int short short" } */
+int short int *x149; /* { dg-error "" "int short int" } */
+int short long *x150; /* { dg-error "" "int short long" } */
+int short float *x151; /* { dg-error "" "int short float" } */
+int short double *x152; /* { dg-error "" "int short double" } */
+int short signed *x153;
+int short unsigned *x154;
+int long void *x155; /* { dg-error "" "int long void" } */
+int long char *x156; /* { dg-error "" "int long char" } */
+int long short *x157; /* { dg-error "" "int long short" } */
+int long int *x158; /* { dg-error "" "int long int" } */
+int long long *x159; /* { dg-error "" "int long long" } */
+int long float *x160; /* { dg-error "" "int long float" } */
+int long double *x161; /* { dg-error "" "int long double" } */
+int long signed *x162;
+int long unsigned *x163;
+int signed void *x164; /* { dg-error "" "int signed void" } */
+int signed char *x165; /* { dg-error "" "int signed char" } */
+int signed short *x166;
+int signed int *x167; /* { dg-error "" "int signed int" } */
+int signed long *x168;
+int signed float *x169; /* { dg-error "" "int signed float" } */
+int signed double *x170; /* { dg-error "" "int signed double" } */
+int signed signed *x171; /* { dg-error "" "int signed signed" } */
+int signed unsigned *x172; /* { dg-error "" "int signed unsigned" } */
+int unsigned void *x173; /* { dg-error "" "int unsigned void" } */
+int unsigned char *x174; /* { dg-error "" "int unsigned char" } */
+int unsigned short *x175;
+int unsigned int *x176; /* { dg-error "" "int unsigned int" } */
+int unsigned long *x177;
+int unsigned float *x178; /* { dg-error "" "int unsigned float" } */
+int unsigned double *x179; /* { dg-error "" "int unsigned double" } */
+int unsigned signed *x180; /* { dg-error "" "int unsigned signed" } */
+int unsigned unsigned *x181; /* { dg-error "" "int unsigned unsigned" } */
+long int void *x182; /* { dg-error "" "long int void" } */
+long int char *x183; /* { dg-error "" "long int char" } */
+long int short *x184; /* { dg-error "" "long int short" } */
+long int int *x185; /* { dg-error "" "long int int" } */
+long int long *x186; /* { dg-error "" "long int long" } */
+long int float *x187; /* { dg-error "" "long int float" } */
+long int double *x188; /* { dg-error "" "long int double" } */
+long int signed *x189;
+long int unsigned *x190;
+long double void *x191; /* { dg-error "" "long double void" } */
+long double char *x192; /* { dg-error "" "long double char" } */
+long double short *x193; /* { dg-error "" "long double short" } */
+long double int *x194; /* { dg-error "" "long double int" } */
+long double long *x195; /* { dg-error "" "long double long" } */
+long double float *x196; /* { dg-error "" "long double float" } */
+long double double *x197; /* { dg-error "" "long double double" } */
+long double signed *x198; /* { dg-error "" "long double signed" } */
+long double unsigned *x199; /* { dg-error "" "long double unsigned" } */
+long signed void *x200; /* { dg-error "" "long signed void" } */
+long signed char *x201; /* { dg-error "" "long signed char" } */
+long signed short *x202; /* { dg-error "" "long signed short" } */
+long signed int *x203;
+long signed long *x204; /* { dg-error "" "long signed long" } */
+long signed float *x205; /* { dg-error "" "long signed float" } */
+long signed double *x206; /* { dg-error "" "long signed double" } */
+long signed signed *x207; /* { dg-error "" "long signed signed" } */
+long signed unsigned *x208; /* { dg-error "" "long signed unsigned" } */
+long unsigned void *x209; /* { dg-error "" "long unsigned void" } */
+long unsigned char *x210; /* { dg-error "" "long unsigned char" } */
+long unsigned short *x211; /* { dg-error "" "long unsigned short" } */
+long unsigned int *x212;
+long unsigned long *x213; /* { dg-error "" "long unsigned long" } */
+long unsigned float *x214; /* { dg-error "" "long unsigned float" } */
+long unsigned double *x215; /* { dg-error "" "long unsigned double" } */
+long unsigned signed *x216; /* { dg-error "" "long unsigned signed" } */
+long unsigned unsigned *x217; /* { dg-error "" "long unsigned unsigned" } */
+double long void *x218; /* { dg-error "" "double long void" } */
+double long char *x219; /* { dg-error "" "double long char" } */
+double long short *x220; /* { dg-error "" "double long short" } */
+double long int *x221; /* { dg-error "" "double long int" } */
+double long long *x222; /* { dg-error "" "double long long" } */
+double long float *x223; /* { dg-error "" "double long float" } */
+double long double *x224; /* { dg-error "" "double long double" } */
+double long signed *x225; /* { dg-error "" "double long signed" } */
+double long unsigned *x226; /* { dg-error "" "double long unsigned" } */
+signed char void *x227; /* { dg-error "" "signed char void" } */
+signed char char *x228; /* { dg-error "" "signed char char" } */
+signed char short *x229; /* { dg-error "" "signed char short" } */
+signed char int *x230; /* { dg-error "" "signed char int" } */
+signed char long *x231; /* { dg-error "" "signed char long" } */
+signed char float *x232; /* { dg-error "" "signed char float" } */
+signed char double *x233; /* { dg-error "" "signed char double" } */
+signed char signed *x234; /* { dg-error "" "signed char signed" } */
+signed char unsigned *x235; /* { dg-error "" "signed char unsigned" } */
+signed short void *x236; /* { dg-error "" "signed short void" } */
+signed short char *x237; /* { dg-error "" "signed short char" } */
+signed short short *x238; /* { dg-error "" "signed short short" } */
+signed short int *x239;
+signed short long *x240; /* { dg-error "" "signed short long" } */
+signed short float *x241; /* { dg-error "" "signed short float" } */
+signed short double *x242; /* { dg-error "" "signed short double" } */
+signed short signed *x243; /* { dg-error "" "signed short signed" } */
+signed short unsigned *x244; /* { dg-error "" "signed short unsigned" } */
+signed int void *x245; /* { dg-error "" "signed int void" } */
+signed int char *x246; /* { dg-error "" "signed int char" } */
+signed int short *x247;
+signed int int *x248; /* { dg-error "" "signed int int" } */
+signed int long *x249;
+signed int float *x250; /* { dg-error "" "signed int float" } */
+signed int double *x251; /* { dg-error "" "signed int double" } */
+signed int signed *x252; /* { dg-error "" "signed int signed" } */
+signed int unsigned *x253; /* { dg-error "" "signed int unsigned" } */
+signed long void *x254; /* { dg-error "" "signed long void" } */
+signed long char *x255; /* { dg-error "" "signed long char" } */
+signed long short *x256; /* { dg-error "" "signed long short" } */
+signed long int *x257;
+signed long long *x258; /* { dg-error "" "signed long long" } */
+signed long float *x259; /* { dg-error "" "signed long float" } */
+signed long double *x260; /* { dg-error "" "signed long double" } */
+signed long signed *x261; /* { dg-error "" "signed long signed" } */
+signed long unsigned *x262; /* { dg-error "" "signed long unsigned" } */
+unsigned char void *x263; /* { dg-error "" "unsigned char void" } */
+unsigned char char *x264; /* { dg-error "" "unsigned char char" } */
+unsigned char short *x265; /* { dg-error "" "unsigned char short" } */
+unsigned char int *x266; /* { dg-error "" "unsigned char int" } */
+unsigned char long *x267; /* { dg-error "" "unsigned char long" } */
+unsigned char float *x268; /* { dg-error "" "unsigned char float" } */
+unsigned char double *x269; /* { dg-error "" "unsigned char double" } */
+unsigned char signed *x270; /* { dg-error "" "unsigned char signed" } */
+unsigned char unsigned *x271; /* { dg-error "" "unsigned char unsigned" } */
+unsigned short void *x272; /* { dg-error "" "unsigned short void" } */
+unsigned short char *x273; /* { dg-error "" "unsigned short char" } */
+unsigned short short *x274; /* { dg-error "" "unsigned short short" } */
+unsigned short int *x275;
+unsigned short long *x276; /* { dg-error "" "unsigned short long" } */
+unsigned short float *x277; /* { dg-error "" "unsigned short float" } */
+unsigned short double *x278; /* { dg-error "" "unsigned short double" } */
+unsigned short signed *x279; /* { dg-error "" "unsigned short signed" } */
+unsigned short unsigned *x280; /* { dg-error "" "unsigned short unsigned" } */
+unsigned int void *x281; /* { dg-error "" "unsigned int void" } */
+unsigned int char *x282; /* { dg-error "" "unsigned int char" } */
+unsigned int short *x283;
+unsigned int int *x284; /* { dg-error "" "unsigned int int" } */
+unsigned int long *x285;
+unsigned int float *x286; /* { dg-error "" "unsigned int float" } */
+unsigned int double *x287; /* { dg-error "" "unsigned int double" } */
+unsigned int signed *x288; /* { dg-error "" "unsigned int signed" } */
+unsigned int unsigned *x289; /* { dg-error "" "unsigned int unsigned" } */
+unsigned long void *x290; /* { dg-error "" "unsigned long void" } */
+unsigned long char *x291; /* { dg-error "" "unsigned long char" } */
+unsigned long short *x292; /* { dg-error "" "unsigned long short" } */
+unsigned long int *x293;
+unsigned long long *x294; /* { dg-error "" "unsigned long long" } */
+unsigned long float *x295; /* { dg-error "" "unsigned long float" } */
+unsigned long double *x296; /* { dg-error "" "unsigned long double" } */
+unsigned long signed *x297; /* { dg-error "" "unsigned long signed" } */
+unsigned long unsigned *x298; /* { dg-error "" "unsigned long unsigned" } */
+short int signed void *x299; /* { dg-error "" "short int signed void" } */
+short int signed char *x300; /* { dg-error "" "short int signed char" } */
+short int signed short *x301; /* { dg-error "" "short int signed short" } */
+short int signed int *x302; /* { dg-error "" "short int signed int" } */
+short int signed long *x303; /* { dg-error "" "short int signed long" } */
+short int signed float *x304; /* { dg-error "" "short int signed float" } */
+short int signed double *x305; /* { dg-error "" "short int signed double" } */
+short int signed signed *x306; /* { dg-error "" "short int signed signed" } */
+short int signed unsigned *x307; /* { dg-error "" "short int signed unsigned" } */
+short int unsigned void *x308; /* { dg-error "" "short int unsigned void" } */
+short int unsigned char *x309; /* { dg-error "" "short int unsigned char" } */
+short int unsigned short *x310; /* { dg-error "" "short int unsigned short" } */
+short int unsigned int *x311; /* { dg-error "" "short int unsigned int" } */
+short int unsigned long *x312; /* { dg-error "" "short int unsigned long" } */
+short int unsigned float *x313; /* { dg-error "" "short int unsigned float" } */
+short int unsigned double *x314; /* { dg-error "" "short int unsigned double" } */
+short int unsigned signed *x315; /* { dg-error "" "short int unsigned signed" } */
+short int unsigned unsigned *x316; /* { dg-error "" "short int unsigned unsigned" } */
+short signed int void *x317; /* { dg-error "" "short signed int void" } */
+short signed int char *x318; /* { dg-error "" "short signed int char" } */
+short signed int short *x319; /* { dg-error "" "short signed int short" } */
+short signed int int *x320; /* { dg-error "" "short signed int int" } */
+short signed int long *x321; /* { dg-error "" "short signed int long" } */
+short signed int float *x322; /* { dg-error "" "short signed int float" } */
+short signed int double *x323; /* { dg-error "" "short signed int double" } */
+short signed int signed *x324; /* { dg-error "" "short signed int signed" } */
+short signed int unsigned *x325; /* { dg-error "" "short signed int unsigned" } */
+short unsigned int void *x326; /* { dg-error "" "short unsigned int void" } */
+short unsigned int char *x327; /* { dg-error "" "short unsigned int char" } */
+short unsigned int short *x328; /* { dg-error "" "short unsigned int short" } */
+short unsigned int int *x329; /* { dg-error "" "short unsigned int int" } */
+short unsigned int long *x330; /* { dg-error "" "short unsigned int long" } */
+short unsigned int float *x331; /* { dg-error "" "short unsigned int float" } */
+short unsigned int double *x332; /* { dg-error "" "short unsigned int double" } */
+short unsigned int signed *x333; /* { dg-error "" "short unsigned int signed" } */
+short unsigned int unsigned *x334; /* { dg-error "" "short unsigned int unsigned" } */
+int short signed void *x335; /* { dg-error "" "int short signed void" } */
+int short signed char *x336; /* { dg-error "" "int short signed char" } */
+int short signed short *x337; /* { dg-error "" "int short signed short" } */
+int short signed int *x338; /* { dg-error "" "int short signed int" } */
+int short signed long *x339; /* { dg-error "" "int short signed long" } */
+int short signed float *x340; /* { dg-error "" "int short signed float" } */
+int short signed double *x341; /* { dg-error "" "int short signed double" } */
+int short signed signed *x342; /* { dg-error "" "int short signed signed" } */
+int short signed unsigned *x343; /* { dg-error "" "int short signed unsigned" } */
+int short unsigned void *x344; /* { dg-error "" "int short unsigned void" } */
+int short unsigned char *x345; /* { dg-error "" "int short unsigned char" } */
+int short unsigned short *x346; /* { dg-error "" "int short unsigned short" } */
+int short unsigned int *x347; /* { dg-error "" "int short unsigned int" } */
+int short unsigned long *x348; /* { dg-error "" "int short unsigned long" } */
+int short unsigned float *x349; /* { dg-error "" "int short unsigned float" } */
+int short unsigned double *x350; /* { dg-error "" "int short unsigned double" } */
+int short unsigned signed *x351; /* { dg-error "" "int short unsigned signed" } */
+int short unsigned unsigned *x352; /* { dg-error "" "int short unsigned unsigned" } */
+int long signed void *x353; /* { dg-error "" "int long signed void" } */
+int long signed char *x354; /* { dg-error "" "int long signed char" } */
+int long signed short *x355; /* { dg-error "" "int long signed short" } */
+int long signed int *x356; /* { dg-error "" "int long signed int" } */
+int long signed long *x357; /* { dg-error "" "int long signed long" } */
+int long signed float *x358; /* { dg-error "" "int long signed float" } */
+int long signed double *x359; /* { dg-error "" "int long signed double" } */
+int long signed signed *x360; /* { dg-error "" "int long signed signed" } */
+int long signed unsigned *x361; /* { dg-error "" "int long signed unsigned" } */
+int long unsigned void *x362; /* { dg-error "" "int long unsigned void" } */
+int long unsigned char *x363; /* { dg-error "" "int long unsigned char" } */
+int long unsigned short *x364; /* { dg-error "" "int long unsigned short" } */
+int long unsigned int *x365; /* { dg-error "" "int long unsigned int" } */
+int long unsigned long *x366; /* { dg-error "" "int long unsigned long" } */
+int long unsigned float *x367; /* { dg-error "" "int long unsigned float" } */
+int long unsigned double *x368; /* { dg-error "" "int long unsigned double" } */
+int long unsigned signed *x369; /* { dg-error "" "int long unsigned signed" } */
+int long unsigned unsigned *x370; /* { dg-error "" "int long unsigned unsigned" } */
+int signed short void *x371; /* { dg-error "" "int signed short void" } */
+int signed short char *x372; /* { dg-error "" "int signed short char" } */
+int signed short short *x373; /* { dg-error "" "int signed short short" } */
+int signed short int *x374; /* { dg-error "" "int signed short int" } */
+int signed short long *x375; /* { dg-error "" "int signed short long" } */
+int signed short float *x376; /* { dg-error "" "int signed short float" } */
+int signed short double *x377; /* { dg-error "" "int signed short double" } */
+int signed short signed *x378; /* { dg-error "" "int signed short signed" } */
+int signed short unsigned *x379; /* { dg-error "" "int signed short unsigned" } */
+int signed long void *x380; /* { dg-error "" "int signed long void" } */
+int signed long char *x381; /* { dg-error "" "int signed long char" } */
+int signed long short *x382; /* { dg-error "" "int signed long short" } */
+int signed long int *x383; /* { dg-error "" "int signed long int" } */
+int signed long long *x384; /* { dg-error "" "int signed long long" } */
+int signed long float *x385; /* { dg-error "" "int signed long float" } */
+int signed long double *x386; /* { dg-error "" "int signed long double" } */
+int signed long signed *x387; /* { dg-error "" "int signed long signed" } */
+int signed long unsigned *x388; /* { dg-error "" "int signed long unsigned" } */
+int unsigned short void *x389; /* { dg-error "" "int unsigned short void" } */
+int unsigned short char *x390; /* { dg-error "" "int unsigned short char" } */
+int unsigned short short *x391; /* { dg-error "" "int unsigned short short" } */
+int unsigned short int *x392; /* { dg-error "" "int unsigned short int" } */
+int unsigned short long *x393; /* { dg-error "" "int unsigned short long" } */
+int unsigned short float *x394; /* { dg-error "" "int unsigned short float" } */
+int unsigned short double *x395; /* { dg-error "" "int unsigned short double" } */
+int unsigned short signed *x396; /* { dg-error "" "int unsigned short signed" } */
+int unsigned short unsigned *x397; /* { dg-error "" "int unsigned short unsigned" } */
+int unsigned long void *x398; /* { dg-error "" "int unsigned long void" } */
+int unsigned long char *x399; /* { dg-error "" "int unsigned long char" } */
+int unsigned long short *x400; /* { dg-error "" "int unsigned long short" } */
+int unsigned long int *x401; /* { dg-error "" "int unsigned long int" } */
+int unsigned long long *x402; /* { dg-error "" "int unsigned long long" } */
+int unsigned long float *x403; /* { dg-error "" "int unsigned long float" } */
+int unsigned long double *x404; /* { dg-error "" "int unsigned long double" } */
+int unsigned long signed *x405; /* { dg-error "" "int unsigned long signed" } */
+int unsigned long unsigned *x406; /* { dg-error "" "int unsigned long unsigned" } */
+long int signed void *x407; /* { dg-error "" "long int signed void" } */
+long int signed char *x408; /* { dg-error "" "long int signed char" } */
+long int signed short *x409; /* { dg-error "" "long int signed short" } */
+long int signed int *x410; /* { dg-error "" "long int signed int" } */
+long int signed long *x411; /* { dg-error "" "long int signed long" } */
+long int signed float *x412; /* { dg-error "" "long int signed float" } */
+long int signed double *x413; /* { dg-error "" "long int signed double" } */
+long int signed signed *x414; /* { dg-error "" "long int signed signed" } */
+long int signed unsigned *x415; /* { dg-error "" "long int signed unsigned" } */
+long int unsigned void *x416; /* { dg-error "" "long int unsigned void" } */
+long int unsigned char *x417; /* { dg-error "" "long int unsigned char" } */
+long int unsigned short *x418; /* { dg-error "" "long int unsigned short" } */
+long int unsigned int *x419; /* { dg-error "" "long int unsigned int" } */
+long int unsigned long *x420; /* { dg-error "" "long int unsigned long" } */
+long int unsigned float *x421; /* { dg-error "" "long int unsigned float" } */
+long int unsigned double *x422; /* { dg-error "" "long int unsigned double" } */
+long int unsigned signed *x423; /* { dg-error "" "long int unsigned signed" } */
+long int unsigned unsigned *x424; /* { dg-error "" "long int unsigned unsigned" } */
+long signed int void *x425; /* { dg-error "" "long signed int void" } */
+long signed int char *x426; /* { dg-error "" "long signed int char" } */
+long signed int short *x427; /* { dg-error "" "long signed int short" } */
+long signed int int *x428; /* { dg-error "" "long signed int int" } */
+long signed int long *x429; /* { dg-error "" "long signed int long" } */
+long signed int float *x430; /* { dg-error "" "long signed int float" } */
+long signed int double *x431; /* { dg-error "" "long signed int double" } */
+long signed int signed *x432; /* { dg-error "" "long signed int signed" } */
+long signed int unsigned *x433; /* { dg-error "" "long signed int unsigned" } */
+long unsigned int void *x434; /* { dg-error "" "long unsigned int void" } */
+long unsigned int char *x435; /* { dg-error "" "long unsigned int char" } */
+long unsigned int short *x436; /* { dg-error "" "long unsigned int short" } */
+long unsigned int int *x437; /* { dg-error "" "long unsigned int int" } */
+long unsigned int long *x438; /* { dg-error "" "long unsigned int long" } */
+long unsigned int float *x439; /* { dg-error "" "long unsigned int float" } */
+long unsigned int double *x440; /* { dg-error "" "long unsigned int double" } */
+long unsigned int signed *x441; /* { dg-error "" "long unsigned int signed" } */
+long unsigned int unsigned *x442; /* { dg-error "" "long unsigned int unsigned" } */
+signed short int void *x443; /* { dg-error "" "signed short int void" } */
+signed short int char *x444; /* { dg-error "" "signed short int char" } */
+signed short int short *x445; /* { dg-error "" "signed short int short" } */
+signed short int int *x446; /* { dg-error "" "signed short int int" } */
+signed short int long *x447; /* { dg-error "" "signed short int long" } */
+signed short int float *x448; /* { dg-error "" "signed short int float" } */
+signed short int double *x449; /* { dg-error "" "signed short int double" } */
+signed short int signed *x450; /* { dg-error "" "signed short int signed" } */
+signed short int unsigned *x451; /* { dg-error "" "signed short int unsigned" } */
+signed int short void *x452; /* { dg-error "" "signed int short void" } */
+signed int short char *x453; /* { dg-error "" "signed int short char" } */
+signed int short short *x454; /* { dg-error "" "signed int short short" } */
+signed int short int *x455; /* { dg-error "" "signed int short int" } */
+signed int short long *x456; /* { dg-error "" "signed int short long" } */
+signed int short float *x457; /* { dg-error "" "signed int short float" } */
+signed int short double *x458; /* { dg-error "" "signed int short double" } */
+signed int short signed *x459; /* { dg-error "" "signed int short signed" } */
+signed int short unsigned *x460; /* { dg-error "" "signed int short unsigned" } */
+signed int long void *x461; /* { dg-error "" "signed int long void" } */
+signed int long char *x462; /* { dg-error "" "signed int long char" } */
+signed int long short *x463; /* { dg-error "" "signed int long short" } */
+signed int long int *x464; /* { dg-error "" "signed int long int" } */
+signed int long long *x465; /* { dg-error "" "signed int long long" } */
+signed int long float *x466; /* { dg-error "" "signed int long float" } */
+signed int long double *x467; /* { dg-error "" "signed int long double" } */
+signed int long signed *x468; /* { dg-error "" "signed int long signed" } */
+signed int long unsigned *x469; /* { dg-error "" "signed int long unsigned" } */
+signed long int void *x470; /* { dg-error "" "signed long int void" } */
+signed long int char *x471; /* { dg-error "" "signed long int char" } */
+signed long int short *x472; /* { dg-error "" "signed long int short" } */
+signed long int int *x473; /* { dg-error "" "signed long int int" } */
+signed long int long *x474; /* { dg-error "" "signed long int long" } */
+signed long int float *x475; /* { dg-error "" "signed long int float" } */
+signed long int double *x476; /* { dg-error "" "signed long int double" } */
+signed long int signed *x477; /* { dg-error "" "signed long int signed" } */
+signed long int unsigned *x478; /* { dg-error "" "signed long int unsigned" } */
+unsigned short int void *x479; /* { dg-error "" "unsigned short int void" } */
+unsigned short int char *x480; /* { dg-error "" "unsigned short int char" } */
+unsigned short int short *x481; /* { dg-error "" "unsigned short int short" } */
+unsigned short int int *x482; /* { dg-error "" "unsigned short int int" } */
+unsigned short int long *x483; /* { dg-error "" "unsigned short int long" } */
+unsigned short int float *x484; /* { dg-error "" "unsigned short int float" } */
+unsigned short int double *x485; /* { dg-error "" "unsigned short int double" } */
+unsigned short int signed *x486; /* { dg-error "" "unsigned short int signed" } */
+unsigned short int unsigned *x487; /* { dg-error "" "unsigned short int unsigned" } */
+unsigned int short void *x488; /* { dg-error "" "unsigned int short void" } */
+unsigned int short char *x489; /* { dg-error "" "unsigned int short char" } */
+unsigned int short short *x490; /* { dg-error "" "unsigned int short short" } */
+unsigned int short int *x491; /* { dg-error "" "unsigned int short int" } */
+unsigned int short long *x492; /* { dg-error "" "unsigned int short long" } */
+unsigned int short float *x493; /* { dg-error "" "unsigned int short float" } */
+unsigned int short double *x494; /* { dg-error "" "unsigned int short double" } */
+unsigned int short signed *x495; /* { dg-error "" "unsigned int short signed" } */
+unsigned int short unsigned *x496; /* { dg-error "" "unsigned int short unsigned" } */
+unsigned int long void *x497; /* { dg-error "" "unsigned int long void" } */
+unsigned int long char *x498; /* { dg-error "" "unsigned int long char" } */
+unsigned int long short *x499; /* { dg-error "" "unsigned int long short" } */
+unsigned int long int *x500; /* { dg-error "" "unsigned int long int" } */
+unsigned int long long *x501; /* { dg-error "" "unsigned int long long" } */
+unsigned int long float *x502; /* { dg-error "" "unsigned int long float" } */
+unsigned int long double *x503; /* { dg-error "" "unsigned int long double" } */
+unsigned int long signed *x504; /* { dg-error "" "unsigned int long signed" } */
+unsigned int long unsigned *x505; /* { dg-error "" "unsigned int long unsigned" } */
+unsigned long int void *x506; /* { dg-error "" "unsigned long int void" } */
+unsigned long int char *x507; /* { dg-error "" "unsigned long int char" } */
+unsigned long int short *x508; /* { dg-error "" "unsigned long int short" } */
+unsigned long int int *x509; /* { dg-error "" "unsigned long int int" } */
+unsigned long int long *x510; /* { dg-error "" "unsigned long int long" } */
+unsigned long int float *x511; /* { dg-error "" "unsigned long int float" } */
+unsigned long int double *x512; /* { dg-error "" "unsigned long int double" } */
+unsigned long int signed *x513; /* { dg-error "" "unsigned long int signed" } */
+unsigned long int unsigned *x514; /* { dg-error "" "unsigned long int unsigned" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c90-vla-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c90-vla-1.c
new file mode 100644
index 000000000..2d9b5f10b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c90-vla-1.c
@@ -0,0 +1,12 @@
+/* Origin: PR 3467 */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+void
+tdef (int n)
+{
+ typedef int A[n]; /* { dg-error "forbids variable length array" } */
+ A a;
+ A *p;
+ p = &a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c94-digraph-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c94-digraph-1.c
new file mode 100644
index 000000000..55d77146b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c94-digraph-1.c
@@ -0,0 +1,24 @@
+/* Test for recognition of digraphs: should be recognized in C94 and C99
+ mode, but not in C90 mode. Also check correct stringizing.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:199409 -pedantic-errors" } */
+
+#define str(x) xstr(x)
+#define xstr(x) #x
+#define foo(p, q) str(p %:%: q)
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+ const char *t = foo (1, 2);
+ const char *u = str (<:);
+ if (strcmp (t, "12") || strcmp (u, "<:"))
+ abort ();
+ else
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c94-version-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c94-version-1.c
new file mode 100644
index 000000000..7437dda90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c94-version-1.c
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C94. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:199409 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 199409L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-align-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-align-1.c
new file mode 100644
index 000000000..1fb2cb071
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-align-1.c
@@ -0,0 +1,6 @@
+/* Test _Alignof and _Alignas not in C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+int a = _Alignof (int); /* { dg-error "ISO C99 does not support '_Alignof'" } */
+_Alignas (int) int b; /* { dg-error "ISO C99 does not support '_Alignas'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-anon-struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-anon-struct-1.c
new file mode 100644
index 000000000..87d4c3438
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-anon-struct-1.c
@@ -0,0 +1,12 @@
+/* Test for anonymous structures and unions not permitted in C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s
+{
+ int a;
+ struct
+ {
+ int b;
+ }; /* { dg-error "unnamed structs" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-1.c
new file mode 100644
index 000000000..c0fccc813
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-1.c
@@ -0,0 +1,17 @@
+/* Test for non-lvalue arrays decaying to pointers: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { char c[1]; };
+
+extern struct s foo (void);
+
+void
+bar (void)
+{
+ char *t;
+ (foo ()).c[0]; /* { dg-bogus "non-lvalue" "array not decaying to lvalue" } */
+ t = (foo ()).c; /* { dg-bogus "non-lvalue" "array not decaying to lvalue" } */
+ (foo ()).c + 1; /* { dg-bogus "non-lvalue" "array not decaying to lvalue" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-2.c
new file mode 100644
index 000000000..894ff957a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-2.c
@@ -0,0 +1,18 @@
+/* Test for non-lvalue arrays decaying to pointers: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { char c[17]; };
+
+struct s x;
+
+extern struct s foo (void);
+
+#define ASSERT(v, a) char v[((a) ? 1 : -1)]
+
+ASSERT (p, sizeof (x.c) == 17);
+ASSERT (q, sizeof (0, x.c) == sizeof (char *));
+ASSERT (r, sizeof ((foo ()).c) == 17);
+/* The non-lvalue array decays to a pointer in C99. */
+ASSERT (s, sizeof (0, (foo ()).c) == sizeof (char *)); /* { dg-bogus "array" "bad non-lvalue array handling" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-3.c
new file mode 100644
index 000000000..a12a9600b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-3.c
@@ -0,0 +1,24 @@
+/* Test for non-lvalue arrays decaying to pointers: in C99 only.
+ Test various ways of producing non-lvalue arrays. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { char c[1]; };
+struct s a, b, c;
+int d;
+
+void
+bar (void)
+{
+ char *t;
+ (d ? b : c).c[0];
+ (d, b).c[0];
+ (a = b).c[0];
+ t = (d ? b : c).c;
+ t = (d, b).c;
+ t = (a = b).c;
+ (d ? b : c).c + 1;
+ (d, b).c + 1;
+ (a = b).c + 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-4.c
new file mode 100644
index 000000000..259ce9214
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-4.c
@@ -0,0 +1,24 @@
+/* Test for non-lvalue arrays decaying to pointers: in C99 only.
+ Test various ways of producing non-lvalue arrays. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { char c[17]; };
+
+struct s x;
+
+struct s a, b, c;
+int d;
+
+#define ASSERT(v, a) char v[((a) ? 1 : -1)]
+
+ASSERT (p, sizeof (x.c) == 17);
+ASSERT (q, sizeof (0, x.c) == sizeof (char *));
+ASSERT (r0, sizeof ((d ? b : c).c) == 17);
+ASSERT (r1, sizeof ((d, b).c) == 17);
+ASSERT (r2, sizeof ((a = b).c) == 17);
+/* The non-lvalue array decays to a pointer in C99. */
+ASSERT (s0, sizeof (0, (d ? b : c).c) == sizeof (char *)); /* { dg-bogus "array" "bad non-lvalue array handling" } */
+ASSERT (s0, sizeof (0, (d, b).c) == sizeof (char *)); /* { dg-bogus "array" "bad non-lvalue array handling" } */
+ASSERT (s0, sizeof (0, (a = b).c) == sizeof (char *)); /* { dg-bogus "array" "bad non-lvalue array handling" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-5.c
new file mode 100644
index 000000000..57e806d97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-5.c
@@ -0,0 +1,26 @@
+/* Test for non-lvalue arrays: test that the unary '&' operator is not
+ allowed on them, for both C90 and C99. */
+
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { char c[1]; };
+
+extern struct s foo (void);
+struct s a, b, c;
+int d;
+
+void
+bar (void)
+{
+ &((foo ()).c); /* { dg-bogus "warning" "warning in place of error" } */
+ &((d ? b : c).c); /* { dg-bogus "warning" "warning in place of error" } */
+ &((d, b).c); /* { dg-bogus "warning" "warning in place of error" } */
+ &((a = b).c); /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "lvalue" "bad address-of" { target *-*-* } 17 }
+ { dg-error "lvalue" "bad address-of" { target *-*-* } 18 }
+ { dg-error "lvalue" "bad address-of" { target *-*-* } 19 }
+ { dg-error "lvalue" "bad address-of" { target *-*-* } 20 }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c
new file mode 100644
index 000000000..426b3c75c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-6.c
@@ -0,0 +1,15 @@
+/* PR c/12446 */
+/* Origin: Keith Thompson <kst@cts.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+
+struct s { char c[1]; };
+
+extern struct s foo(void);
+
+void bar(void)
+{
+ char *ptr = foo().c; /* { dg-bogus "non-lvalue" "array not decaying to lvalue" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-7.c
new file mode 100644
index 000000000..3d70ed07b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-7.c
@@ -0,0 +1,21 @@
+/* Test for non-lvalue arrays: test that C90 does not allow them in
+ conditional expressions, while in C99 they decay and are
+ allowed. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { char c[1]; };
+struct s a, b, c;
+int d;
+int e;
+
+void
+bar (void)
+{
+ /* In C90, the non-lvalue arrays do not decay to pointers, and
+ 6.3.15 does not permit conditional expressions between arrays.
+ In C99, they decay to pointers. */
+ (e ? (d ? b : c).c : (e ? b : c).c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-8.c
new file mode 100644
index 000000000..c4e202ef3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-lval-8.c
@@ -0,0 +1,30 @@
+/* Test for non-lvalue arrays: test that qualifiers on non-lvalues
+ containing arrays do not remain when those arrays decay to
+ pointers. PR 35235. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+int a;
+
+void
+f (void)
+{
+ const struct {
+ int a[1];
+ } s;
+ int *p1 = s.a; /* { dg-error "qualifier" } */
+ int *p2 = (a ? s : s).a;
+ /* In this case, the qualifier is properly on the array element type
+ not on the rvalue structure and so is not discarded. */
+ struct {
+ const int a[1];
+ } t;
+ int *p3 = t.a; /* { dg-error "qualifier" } */
+ int *p4 = (a ? t : t).a; /* { dg-error "qualifier" } */
+ /* The issue could also lead to code being wrongly accepted. */
+ const struct {
+ int a[1][1];
+ } u;
+ const int (*p5)[1] = u.a;
+ const int (*p6)[1] = (a ? u : u).a; /* { dg-error "pointer" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-nonobj-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-nonobj-1.c
new file mode 100644
index 000000000..45fc74c4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-array-nonobj-1.c
@@ -0,0 +1,27 @@
+/* Test for arrays of incomplete and function types: a constraint violation
+ in C99 only, though undefined (DR#047) before.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef void func (void);
+struct s;
+
+extern int a[][]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "\[\]\[\] var" { target *-*-* } 11 } */
+
+void f (int [][]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "\[\]\[\] arg" { target *-*-* } 14 } */
+
+extern struct s b[]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "struct \[\] var" { target *-*-* } 17 } */
+
+void g (struct s []); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "struct \[\] arg" { target *-*-* } 20 } */
+
+extern func c[]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "func \[\] var" { target *-*-* } 23 } */
+
+void h (func []); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "array" "func \[\] arg" { target *-*-* } 26 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-1.c
new file mode 100644
index 000000000..2036d82fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-1.c
@@ -0,0 +1,111 @@
+/* Test for C99 forms of array declarator. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* Because GCC doesn't yet implement it, we don't yet test for [*] here. */
+
+/* Test each of: [quals], [quals expr], [static expr], [static quals expr],
+ [quals static expr]. Not yet: [quals *]. */
+
+void f00 (int a[const]);
+void f01 (int [const]);
+
+void
+f02 (int a[const])
+{
+ int **b = &a; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "discards" "discards quals" { target *-*-* } 17 } */
+ int *const *c = &a;
+}
+void
+f03 (a)
+ int a[const];
+{
+ int **b = &a; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "discards" "discards quals" { target *-*-* } 25 } */
+ int *const *c = &a;
+}
+
+void f10 (int a[const 2]);
+void f11 (int [const 2]);
+
+void
+f12 (int a[const 2])
+{
+ int **b = &a; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "discards" "discards quals" { target *-*-* } 36 } */
+ int *const *c = &a;
+}
+void
+f13 (a)
+ int a[const 2];
+{
+ int **b = &a; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "discards" "discards quals" { target *-*-* } 44 } */
+ int *const *c = &a;
+}
+
+void f20 (int a[static 2]);
+void f21 (int [static 2]);
+
+void
+f22 (int a[static 2])
+{
+ int **b = &a;
+ int *const *c = &a;
+}
+void
+f23 (a)
+ int a[static 2];
+{
+ int **b = &a;
+ int *const *c = &a;
+}
+
+void f30 (int a[static const 2]);
+void f31 (int [static const 2]);
+
+void
+f32 (int a[static const 2])
+{
+ int **b = &a; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "discards" "discards quals" { target *-*-* } 72 } */
+ int *const *c = &a;
+}
+void
+f33 (a)
+ int a[static const 2];
+{
+ int **b = &a; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "discards" "discards quals" { target *-*-* } 80 } */
+ int *const *c = &a;
+}
+
+void f40 (int a[const static 2]);
+void f41 (int [const static 2]);
+
+void
+f42 (int a[const static 2])
+{
+ int **b = &a; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "discards" "discards quals" { target *-*-* } 91 } */
+ int *const *c = &a;
+}
+void
+f43 (a)
+ int a[const static 2];
+{
+ int **b = &a; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "discards" "discards quals" { target *-*-* } 99 } */
+ int *const *c = &a;
+}
+
+/* Test rejection of static and type qualifiers in non-parameter contexts. */
+int x[const 2]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "non-parameter" "quals in non-parm array" { target *-*-* } 105 } */
+int y[static 2]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "non-parameter" "static in non-parm array" { target *-*-* } 107 } */
+void g (int a[static 2][3]);
+void h (int a[2][static 3]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "non-parameter" "static in non-final parm array" { target *-*-* } 110 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c
new file mode 100644
index 000000000..22d6e97be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-2.c
@@ -0,0 +1,16 @@
+/* Test for C99 array declarators: expression must be an
+ assignment-expression. PR 11943. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ int a[2, 3]; /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void b(int x[2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void c(int [2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void d(int *x[restrict 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void e(int *x[static restrict 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+ void f(int *x[restrict static 2, 3]); /* { dg-error "parse|syntax|expected" "bad array declarator" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-3.c
new file mode 100644
index 000000000..9f383b9c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-arraydecl-3.c
@@ -0,0 +1,20 @@
+/* Test for C99 forms of array declarator. Test restrict qualifiers
+ properly applied to type of parameter. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+f0 (int a[restrict])
+{
+ int **b = &a; /* { dg-error "discards 'restrict' qualifier" } */
+ int *restrict *c = &a;
+}
+
+void
+f1 (a)
+ int a[restrict];
+{
+ int **b = &a; /* { dg-error "discards 'restrict' qualifier" } */
+ int *restrict *c = &a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-atomic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-atomic-1.c
new file mode 100644
index 000000000..3a13f7771
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-atomic-1.c
@@ -0,0 +1,8 @@
+/* Test for _Atomic: not in C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+_Atomic int i; /* { dg-error "_Atomic" } */
+_Atomic (int) j; /* { dg-error "_Atomic" } */
+int *_Atomic p; /* { dg-error "_Atomic" } */
+void f (int a[_Atomic]); /* { dg-error "_Atomic" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-1.c
new file mode 100644
index 000000000..7ec99a76b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-1.c
@@ -0,0 +1,248 @@
+/* Test for _Bool and <stdbool.h> in C99. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* _Bool must be a builtin type. */
+
+_Bool foo;
+
+#include <stdbool.h>
+
+/* Three macros must be integer constant expressions suitable for use
+ in #if.
+*/
+
+#if !defined(true) || (true != 1)
+#error "bad stdbool true" /* { dg-bogus "#error" "bad stdbool.h" } */
+#endif
+
+#if !defined(false) || (false != 0)
+#error "bad stdbool false" /* { dg-bogus "#error" "bad stdbool.h" } */
+#endif
+
+#if !defined(__bool_true_false_are_defined) || (__bool_true_false_are_defined != 1)
+#error "bad stdbool __bool_true_false_are_defined" /* { dg-bogus "#error" "bad stdbool.h" } */
+#endif
+
+int a = true;
+int b = false;
+int c = __bool_true_false_are_defined;
+
+struct foo
+{
+ _Bool a : 1;
+} sf;
+
+#define str(x) xstr(x)
+#define xstr(x) #x
+
+
+extern void abort (void);
+extern void exit (int);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+ /* The macro `bool' must expand to _Bool. */
+ const char *t = str (bool);
+ _Bool u, v;
+ if (strcmp (t, "_Bool"))
+ abort ();
+ if (a != 1 || b != 0 || c != 1)
+ abort ();
+ /* Casts to _Bool have a specified behavior. */
+ if ((int)(_Bool)2 != 1)
+ abort ();
+ if ((int)(_Bool)0.2 != 1)
+ abort ();
+ /* Pointers may be assigned to _Bool. */
+ if ((u = t) != 1)
+ abort ();
+ /* _Bool may be used to subscript arrays. */
+ u = 0;
+ if (t[u] != '_')
+ abort ();
+ if (u[t] != '_')
+ abort ();
+ u = 1;
+ if (t[u] != 'B')
+ abort ();
+ if (u[t] != 'B')
+ abort ();
+ /* Test increment and decrement operators. */
+ u = 0;
+ if (u++ != 0)
+ abort ();
+ if (u != 1)
+ abort ();
+ if (u++ != 1)
+ abort ();
+ if (u != 1)
+ abort ();
+ u = 0;
+ if (++u != 1)
+ abort ();
+ if (u != 1)
+ abort ();
+ if (++u != 1)
+ abort ();
+ if (u != 1)
+ abort ();
+ u = 0;
+ if (u-- != 0)
+ abort ();
+ if (u != 1)
+ abort ();
+ if (u-- != 1)
+ abort ();
+ if (u != 0)
+ abort ();
+ u = 0;
+ if (--u != 1)
+ abort ();
+ if (u != 1)
+ abort ();
+ if (--u != 0)
+ abort ();
+ if (u != 0)
+ abort ();
+ /* Test unary + - ~ !. */
+ u = 0;
+ if (+u != 0)
+ abort ();
+ if (-u != 0)
+ abort ();
+ u = 1;
+ if (+u != 1)
+ abort ();
+ if (-u != -1)
+ abort ();
+ u = 2;
+ if (+u != 1)
+ abort ();
+ if (-u != -1)
+ abort ();
+ u = 0;
+ if (~u != ~(int)0)
+ abort ();
+ u = 1;
+ if (~u != ~(int)1)
+ abort ();
+ u = 0;
+ if (!u != 1)
+ abort ();
+ u = 1;
+ if (!u != 0)
+ abort ();
+ /* Test arithmetic * / % + - (which all apply promotions). */
+ u = 0;
+ if (u + 2 != 2)
+ abort ();
+ u = 1;
+ if (u * 4 != 4)
+ abort ();
+ if (u % 3 != 1)
+ abort ();
+ if (u / 1 != 1)
+ abort ();
+ if (4 / u != 4)
+ abort ();
+ if (u - 7 != -6)
+ abort ();
+ /* Test bitwise shift << >>. */
+ u = 1;
+ if (u << 1 != 2)
+ abort ();
+ if (u >> 1 != 0)
+ abort ();
+ /* Test relational and equality operators < > <= >= == !=. */
+ u = 0;
+ v = 0;
+ if (u < v || u > v || !(u <= v) || !(u >= v) || !(u == v) || u != v)
+ abort ();
+ u = 0;
+ v = 1;
+ if (!(u < v) || u > v || !(u <= v) || u >= v || u == v || !(u != v))
+ abort ();
+ /* Test bitwise operators & ^ |. */
+ u = 1;
+ if ((u | 2) != 3)
+ abort ();
+ if ((u ^ 3) != 2)
+ abort ();
+ if ((u & 1) != 1)
+ abort ();
+ if ((u & 0) != 0)
+ abort ();
+ /* Test logical && ||. */
+ u = 0;
+ v = 1;
+ if (!(u || v))
+ abort ();
+ if (!(v || u))
+ abort ();
+ if (u && v)
+ abort ();
+ if (v && u)
+ abort ();
+ u = 1;
+ v = 1;
+ if (!(u && v))
+ abort ();
+ /* Test conditional ? :. */
+ u = 0;
+ if ((u ? 4 : 7) != 7)
+ abort ();
+ u = 1;
+ v = 0;
+ if ((1 ? u : v) != 1)
+ abort ();
+ if ((1 ? 4 : u) != 4)
+ abort ();
+ /* Test assignment operators = *= /= %= += -= <<= >>= &= ^= |=. */
+ if ((u = 2) != 1)
+ abort ();
+ if (u != 1)
+ abort ();
+ if ((u *= -1) != 1)
+ abort ();
+ if (u != 1)
+ abort ();
+ if ((u /= 2) != 0)
+ abort ();
+ if ((u += 3) != 1)
+ abort ();
+ if ((u -= 1) != 0)
+ abort ();
+ u = 1;
+ if ((u <<= 4) != 1)
+ abort ();
+ if ((u >>= 1) != 0)
+ abort ();
+ u = 1;
+ if ((u &= 0) != 0)
+ abort ();
+ if ((u |= 2) != 1)
+ abort ();
+ if ((u ^= 3) != 1)
+ abort ();
+ /* Test comma expressions. */
+ u = 1;
+ if ((4, u) != 1)
+ abort ();
+ /* Test bitfields. */
+ {
+ int i;
+ for (i = 0; i < sizeof (struct foo); i++)
+ *((unsigned char *)&sf + i) = (unsigned char) -1;
+ sf.a = 1;
+ if (sf.a != 1)
+ abort ();
+ sf.a = 0;
+ if (sf.a != 0)
+ abort ();
+ }
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-2.c
new file mode 100644
index 000000000..5a577a428
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-2.c
@@ -0,0 +1,14 @@
+/* Test for _Bool bit-fields. After TC2, the width of a _Bool
+ bit-field must not extend the width (number of sign and value bits)
+ of _Bool, which is implementation-defined but is 1 unless the
+ implementation defines representations for values greater than 1 in
+ type _Bool and allows for _Bool objects to have such types, which
+ GCC does not. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct foo
+{
+ _Bool b : 2; /* { dg-error "width" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-3.c
new file mode 100644
index 000000000..f93547ac0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-bool-3.c
@@ -0,0 +1,33 @@
+/* Test for _Bool bit-fields. They have the semantics of _Bool, at
+ least for now (DR#335 Spring 2007 discussion). */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+struct foo
+{
+ _Bool a : 1;
+} sf;
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i;
+ for (i = 0; i < sizeof (struct foo); i++)
+ *((unsigned char *)&sf + i) = (unsigned char) -1;
+ sf.a = 2;
+ if (sf.a != 1)
+ abort ();
+ sf.a = 0;
+ if (sf.a != 0)
+ abort ();
+ sf.a = 0.2;
+ if (sf.a != 1)
+ abort ();
+ sf.a = &sf;
+ if (sf.a != 1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-1.c
new file mode 100644
index 000000000..2e1ba7df5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-1.c
@@ -0,0 +1,33 @@
+/* Test for _Complex: in C99 only. A few basic tests. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* Test _Complex allowed on floating types. */
+
+float _Complex a;
+_Complex float b;
+double _Complex c;
+_Complex double d;
+long double _Complex e;
+_Complex long double f;
+
+/* Plain `_Complex' for complex double is a GNU extension. */
+_Complex g; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "plain" "plain _Complex" { target *-*-* } 16 } */
+
+/* Complex integer types are GNU extensions. */
+_Complex int h; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "complex integer" "_Complex int" { target *-*-* } 20 } */
+_Complex long i; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "complex integer" "_Complex long" { target *-*-* } 22 } */
+
+/* Use of ~ for complex conjugation is a GNU extension, but a constraint
+ violation (6.5.3.3p1) in C99.
+*/
+_Complex double
+foo (_Complex double z)
+{
+ return ~z; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "complex conj" "~ for conjugation" { target *-*-* } 31 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-2.c
new file mode 100644
index 000000000..078e92ae9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-2.c
@@ -0,0 +1,22 @@
+/* Test for _Complex: in C99 only. Test for increment and decrement. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* Use of ++ and -- on complex types (both prefix and postfix) is a
+ C99 constraint violation (6.5.2.4p1, 6.5.3.1p1).
+*/
+
+_Complex double
+foo (_Complex double z)
+{
+ z++; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "complex" "postinc" { target *-*-* } 13 } */
+ ++z; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "complex" "preinc" { target *-*-* } 15 } */
+ z--; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "complex" "postdec" { target *-*-* } 17 } */
+ --z; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "complex" "predec" { target *-*-* } 19 } */
+ return z;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-3.c
new file mode 100644
index 000000000..f1f7a1f87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complex-3.c
@@ -0,0 +1,7 @@
+/* Test for _Imaginary: when imaginary types are not implemented, this
+ is still a keyword and must give a syntax error if used rather than
+ being treated as an identifier. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+float _Imaginary; /* { dg-error "expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-complit-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complit-1.c
new file mode 100644
index 000000000..94e15db6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complit-1.c
@@ -0,0 +1,112 @@
+/* Test for compound literals: in C99 only. Test for valid uses. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct s { int a; int b; };
+union u { int c; int d; };
+
+int *i0a = &(int) { 0 };
+int *i0b = &(int) { 0 };
+int *i1a = &(int) { 1 };
+int *i1b = &(int) { 1 };
+const int *i0c = &(const int) { 0 };
+
+struct s *s0 = &(struct s) { 1, 2 };
+struct s *s1 = &(struct s) { 1, 2 };
+const struct s *s2 = &(const struct s) { 1, 2 };
+
+union u *u0 = &(union u) { 3 };
+union u *u1 = &(union u) { 3 };
+const union u *u2 = &(const union u) { 3 };
+
+int *a0 = (int []) { 1, 2, 3 };
+const int *a1 = (const int []) { 1, 2, 3 };
+
+char *p = (char []){ "foo" };
+
+int
+main (void)
+{
+ if (i0a == i0b || i0a == i0c || i0b == i0c)
+ abort ();
+ if (i1a == i1b)
+ abort ();
+ if (*i0a != 0 || *i0b != 0 || *i1a != 1 || *i1b != 1 || *i0c != 0)
+ abort ();
+ *i0a = 1;
+ *i1a = 0;
+ if (*i0a != 1 || *i0b != 0 || *i1a != 0 || *i1b != 1 || *i0c != 0)
+ abort ();
+ if (s0 == s1 || s1 == s2 || s2 == s0)
+ abort ();
+ if (s0->a != 1 || s0->b != 2 || s1->a != 1 || s1->b != 2
+ || s2->a != 1 || s2->b != 2)
+ abort ();
+ s0->a = 2;
+ s1->b = 1;
+ if (s0->a != 2 || s0->b != 2 || s1->a != 1 || s1->b != 1
+ || s2->a != 1 || s2->b != 2)
+ abort ();
+ if (u0 == u1 || u1 == u2 || u2 == u0)
+ abort ();
+ if (u0->c != 3 || u1->c != 3 || u2->c != 3)
+ abort ();
+ u0->d = 2;
+ if (u0->d != 2 || u1->c != 3 || u2->c != 3)
+ abort ();
+ if (a0 == a1)
+ abort ();
+ if (a0[0] != 1 || a0[1] != 2 || a0[2] != 3
+ || a1[0] != 1 || a1[1] != 2 || a1[2] != 3)
+ abort ();
+ a0[0] = 3;
+ if (a0[0] != 3 || a0[1] != 2 || a0[2] != 3
+ || a1[0] != 1 || a1[1] != 2 || a1[2] != 3)
+ abort ();
+ if (p[0] != 'f' || p[1] != 'o' || p[2] != 'o' || p[3] != 0)
+ abort ();
+ p[0] = 'g';
+ if (p[0] != 'g' || p[1] != 'o' || p[2] != 'o' || p[3] != 0)
+ abort ();
+ if (sizeof((int []) { 1, 2 ,3 }) != 3 * sizeof(int))
+ abort ();
+ if (sizeof((int []) { [3] = 4 }) != 4 * sizeof(int))
+ abort ();
+ struct s *y;
+ for (int i = 0; i < 3; i++) {
+ struct s *x = &(struct s) { 1, i };
+ if (x->a != 1 || x->b != i)
+ abort ();
+ x->a++;
+ x->b--;
+ if (x->a != 2 || x->b != i - 1)
+ abort ();
+ if (i && y != x)
+ abort ();
+ y = x;
+ }
+ int *z;
+ for (int i = 0; i < 4; i++) {
+ int *x = (int []){ 0, i, i + 2, i - 3 };
+ if (x[0] != 0 || x[1] != i || x[2] != i + 2 || x[3] != i - 3)
+ abort ();
+ x[0] = x[1];
+ x[1] *= x[2];
+ x[2] -= x[3];
+ x[3] += 7;
+ if (x[0] != i || x[1] != i * (i + 2) || x[2] != 5 || x[3] != i + 4)
+ abort ();
+ if (i && z != x)
+ abort ();
+ z = x;
+ }
+ (int) { 0 } = 1;
+ (struct s) { 0, 1 }.a = 3;
+ (union u) { 3 }.c = 4;
+ (int []){ 1, 2 }[0] = 0;
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-complit-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complit-2.c
new file mode 100644
index 000000000..1285e7e0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-complit-2.c
@@ -0,0 +1,70 @@
+/* Test for compound literals: in C99 only. Test for invalid uses. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { int a; int b; };
+union u { int c; int d; };
+
+struct si;
+union ui;
+
+void
+foo (int a)
+{
+ /* The type name must not be incomplete (apart from arrays of unknown
+ size), or a function type, or a VLA type. */
+ (void) { 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init" "void type" { target *-*-* } 17 } */
+ &(struct si) { 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init" "incomplete struct type" { target *-*-* } 19 } */
+ /* { dg-error "invalid use of undefined type" "" { target *-*-* } 19 } */
+ &(union ui) { 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init" "incomplete union type" { target *-*-* } 22 } */
+ /* { dg-error "invalid use of undefined type" "" { target *-*-* } 22 } */
+ (void (void)) { 0 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init" "function type" { target *-*-* } 25 } */
+ (int [a]) { 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init|variable" "VLA type" { target *-*-* } 27 } */
+ /* Initializers must not attempt to initialize outside the object
+ declared. */
+ (int [1]) { [1] = 2 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init" "value outside array" { target *-*-* } 31 } */
+ (int [1]) { [-1] = 2 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init" "value outside array" { target *-*-* } 33 } */
+ (int [1]) { 0, 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init" "value outside array" { target *-*-* } 35 } */
+}
+
+int z;
+
+/* Outside a function, initializers must be constant. */
+struct s *s0 = &(struct s) { 0, z }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "init" "non-const" { target *-*-* } 42 } */
+int sz = sizeof((struct s) { 0, z }); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "init" "non-const" { target *-*-* } 44 } */
+
+/* Compound literals aren't themselves constant expressions. */
+int x = (int) { 0 }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "init" "non-const" { target *-*-* } 48 } */
+
+/* Nor are they suitable structure or union initializers
+ outside a function. */
+struct s s1 = (struct s) { 0, 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "init" "struct bad init" { target *-*-* } 53 } */
+union u u1 = (union u) { 0 }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "init" "union bad init" { target *-*-* } 55 } */
+
+/* They aren't suitable for array initializers, either inside or outside
+ a function. */
+int y[2] = (int [2]) { 0, 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "init" "array bad init" { target *-*-* } 60 } */
+
+void
+bar (void)
+{
+ struct s s2 = (struct s) { 0, 1 };
+ union u u2 = (union u) { 0 };
+ int z[2] = (int [2]) { 0, 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "init" "array bad init" { target *-*-* } 68 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-condexpr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-condexpr-1.c
new file mode 100644
index 000000000..69d425080
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-condexpr-1.c
@@ -0,0 +1,70 @@
+/* Test for types of conditional expressions. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* Notes:
+
+ (a) The rules are the same in both C standard versions, but C99 also
+ gives us the "restrict" qualifier to play with.
+
+ (b) Within the C standard, the value of a conditional expression can't
+ have qualified type - but nor can this be detected. Because of GCC's
+ extended lvalues, the value may in GCC have qualified type if the
+ arguments do. So don't use the following macro with arguments of
+ qualified type.
+
+*/
+
+/* Assertion that the type of a conditional expression between E1 and E2
+ is T. Checks the expression both ways round. */
+#define ASSERT_COND_TYPE(E1, E2, T) \
+ do { \
+ typedef T type; \
+ typedef type **typepp; \
+ typedef __typeof(0 ? (E1) : (E2)) ctype; \
+ typedef __typeof(0 ? (E2) : (E1)) ctype2; \
+ typedef ctype **ctypepp; \
+ typedef ctype2 **ctype2pp; \
+ typepp x = 0; \
+ ctypepp y = 0; \
+ ctype2pp z = 0; \
+ x = y; \
+ x = z; \
+ } while (0)
+
+void
+foo (void)
+{
+ const void *c_vp;
+ void *vp;
+ const int *c_ip;
+ volatile int *v_ip;
+ int *ip;
+ const char *c_cp;
+ int *restrict *r_ipp;
+ typedef void (*fpt)(void);
+ fpt fp;
+ signed char sc;
+ struct s { int p; } st;
+ union u { int p; } un;
+ /* Arithmetic type. */
+ ASSERT_COND_TYPE (sc, sc, int);
+ /* Structure and union. */
+ ASSERT_COND_TYPE (st, st, struct s);
+ ASSERT_COND_TYPE (un, un, union u);
+ /* Void. */
+ ASSERT_COND_TYPE ((void)0, (void)1, void);
+ /* Pointers: examples from 6.5.15 paragraph 8. */
+ ASSERT_COND_TYPE (c_vp, c_ip, const void *);
+ ASSERT_COND_TYPE (v_ip, 0, volatile int *);
+ ASSERT_COND_TYPE (c_ip, v_ip, const volatile int *);
+ ASSERT_COND_TYPE (vp, c_cp, const void *);
+ ASSERT_COND_TYPE (ip, c_ip, const int *);
+ ASSERT_COND_TYPE (vp, ip, void *);
+ /* Null pointer constants. */
+ ASSERT_COND_TYPE (v_ip, (void *)0, volatile int *);
+ ASSERT_COND_TYPE (r_ipp, (void *)0, int *restrict *);
+ ASSERT_COND_TYPE (fp, 0, fpt);
+ ASSERT_COND_TYPE (fp, (void *)0, fpt);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-1.c
new file mode 100644
index 000000000..c3082ee38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-1.c
@@ -0,0 +1,16 @@
+/* Test for constraints on constant expressions. In C90 it is clear that
+ certain constructs are not permitted in unevaluated parts of an
+ expression (except in sizeof); in C99 it might fall within implementation
+ latitude; and if the operands are suitable, diagnostics should not be
+ issued.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>; inspired by
+ http://deja.com/getdoc.xp?AN=524271595&fmt=text by Peter Seebach.
+*/
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* The comma operator is in a subexpression that is not evaluated, so OK
+ by C99. In C90 a diagnostic is required since it is not in a sizeof.
+*/
+int i = (1 ? 0 : (2, 3));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-10.c
new file mode 100644
index 000000000..2aca6106a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-10.c
@@ -0,0 +1,28 @@
+/* Test for constant expressions: invalid null pointer constants in
+ various contexts (make sure NOPs are not inappropriately
+ stripped). */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void *p = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
+struct s { void *a; } q = { (__SIZE_TYPE__)(void *)0 }; /* { dg-error "without a cast|near initialization" } */
+void *
+f (void)
+{
+ void *r;
+ r = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
+ return (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
+}
+void g (void *); /* { dg-message "but argument is of type" } */
+void
+h (void)
+{
+ g ((__SIZE_TYPE__)(void *)0); /* { dg-error "without a cast" } */
+}
+void g2 (int, void *); /* { dg-message "but argument is of type" } */
+void
+h2 (void)
+{
+ g2 (0, (__SIZE_TYPE__)(void *)0); /* { dg-error "without a cast" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-11.c
new file mode 100644
index 000000000..21d9c5f46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-11.c
@@ -0,0 +1,46 @@
+/* Test for constant expressions: cases involving VLAs. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* It appears address constants may contain casts to variably modified
+ types. Whether they should be permitted was discussed in
+ <http://groups.google.com/group/comp.std.c/msg/923eee5ab690fd98>
+ <LV7g2Vy3ARF$Ew9Q@romana.davros.org>; since static pointers to VLAs
+ are definitely permitted within functions and may be initialized
+ and such initialization involves implicit conversion to a variably
+ modified type, allowing explicit casts seems appropriate. Thus,
+ GCC allows them as long as the "evaluated" size expressions do not
+ contain the various operators not permitted to be evaluated in a
+ constant expression, and as long as the result is genuinely
+ constant (meaning that pointer arithmetic using the size of the VLA
+ is generally not permitted). */
+
+static int sa[100];
+
+volatile int nv;
+
+int
+f (int m, int n)
+{
+ static int (*a1)[n] = &sa;
+ static int (*a2)[n] = (int (*)[n])sa;
+ static int (*a3)[n] = (int (*)[(int){n}])sa;
+ static int (*a4)[n] = (int (*)[(int){m++}])sa; /* { dg-error "constant" } */
+ static int (*a5)[n] = (int (*)[(int){++m}])sa; /* { dg-error "constant" } */
+ static int (*a6)[n] = (int (*)[(int){m--}])sa; /* { dg-error "constant" } */
+ static int (*a7)[n] = (int (*)[(int){--m}])sa; /* { dg-error "constant" } */
+ static int (*a8)[n] = (int (*)[(m=n)])sa; /* { dg-error "constant" } */
+ static int (*a9)[n] = (int (*)[(m+=n)])sa; /* { dg-error "constant" } */
+ static int (*a10)[n] = (int (*)[f(m,n)])sa; /* { dg-error "constant" } */
+ static int (*a11)[n] = (int (*)[(m,n)])sa; /* { dg-error "constant" } */
+ static int (*a12)[n] = (int (*)[sizeof(int[n])])sa;
+ static int (*a13)[n] = (int (*)[sizeof(int[m++])])sa; /* { dg-error "constant" } */
+ static int (*a14)[n] = (int (*)[sizeof(*a1)])sa;
+ static int (*a15)[n] = (int (*)[sizeof(*(int (*)[n])sa)])sa;
+ static int (*a16)[n] = (int (*)[sizeof(*(int (*)[m++])sa)])sa; /* { dg-error "constant" } */
+ static int (*a17)[n] = (int (*)[nv])sa;
+ typedef int (*vmt)[m++];
+ static int (*a18)[n] = (vmt)sa;
+ return n;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-12.c
new file mode 100644
index 000000000..396cea51a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-12.c
@@ -0,0 +1,23 @@
+/* Test for constant expressions: VLA size constraints. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+f (int m)
+{
+ /* An array size that is a constant expression, not just an integer
+ constant expression, must be checked for being positive, but only
+ an integer constant expression makes it not a VLA (which affects
+ certain compatibility checks, in particular). */
+ int a1[0]; /* { dg-error "zero" } */
+ int a2[-1]; /* { dg-error "negative" } */
+ int a3[(int)(double)0.0]; /* { dg-error "zero" } */
+ int a4[(int)-1.0]; /* { dg-error "negative" } */
+ int a5[(int)+1.0];
+ int a6[(int)+2.0];
+ void *p = (m ? &a5 : &a6);
+ int a7[(int)1.0];
+ int a8[(int)2.0];
+ void *q = (m ? &a7 : &a8); /* { dg-error "pointer type mismatch in conditional expression" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-13.c
new file mode 100644
index 000000000..0ee525bec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-13.c
@@ -0,0 +1,15 @@
+/* Test for constant expressions: VLA size constraints with
+ -frounding-math. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors -frounding-math" } */
+
+void
+f (void)
+{
+ /* With -frounding-math, presume that floating-point expressions
+ that may depend on the rounding mode do not count as arithmetic
+ constant expressions, and so arrays involving such expressions in
+ their sizes do not have the size checked for being negative. */
+ int a1[(int)(-5.0/3.0)];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-14.c
new file mode 100644
index 000000000..0c4f1b69b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-14.c
@@ -0,0 +1,35 @@
+/* Test for constant expressions: cases involving VLAs, at file scope. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* It appears address constants may contain casts to variably modified
+ types. Whether they should be permitted was discussed in
+ <http://groups.google.com/group/comp.std.c/msg/923eee5ab690fd98>
+ <LV7g2Vy3ARF$Ew9Q@romana.davros.org>; since static pointers to VLAs
+ are definitely permitted within functions and may be initialized
+ and such initialization involves implicit conversion to a variably
+ modified type, allowing explicit casts seems appropriate. Thus,
+ GCC allows them as long as the "evaluated" size expressions do not
+ contain the various operators not permitted to be evaluated in a
+ constant expression, and as long as the result is genuinely
+ constant (meaning that pointer arithmetic using the size of the VLA
+ is generally not permitted). */
+
+static int sa[100];
+
+volatile int nv;
+int m;
+int n;
+int f (int, int);
+
+static int (*a2)[] = (int (*)[n])sa;
+static int (*a8)[] = (int (*)[(m=n)])sa; /* { dg-error "constant" } */
+static int (*a9)[] = (int (*)[(m+=n)])sa; /* { dg-error "constant" } */
+static int (*a10)[] = (int (*)[f(m,n)])sa; /* { dg-error "constant" } */
+static int (*a11)[] = (int (*)[(m,n)])sa; /* { dg-error "constant" } */
+static int (*a12)[] = (int (*)[sizeof(int[n])])sa;
+static int (*a13)[] = (int (*)[sizeof(int[m++])])sa; /* { dg-error "constant" } */
+static int (*a15)[] = (int (*)[sizeof(*(int (*)[n])sa)])sa;
+static int (*a16)[] = (int (*)[sizeof(*(int (*)[m++])sa)])sa; /* { dg-error "constant" } */
+static int (*a17)[] = (int (*)[nv])sa;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-2.c
new file mode 100644
index 000000000..a78e412d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-2.c
@@ -0,0 +1,45 @@
+/* Test for constant expressions: details of what is a null pointer
+ constant.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999" } */
+/* Note: not using -pedantic since the -std option alone should be enough
+ to give the correct behavior to conforming programs. If -pedantic is
+ needed to make (say) (0, 0) not be a constant expression, this is a
+ bug.
+*/
+
+int *a;
+int b;
+long *c;
+
+#if defined(_LP64)
+#define ZERO 0L
+#elif defined(_WIN64)
+#define ZERO 0LL
+#else
+#define ZERO 0
+#endif
+
+/* Assertion that n is a null pointer constant: so the conditional expression
+ has type 'int *' instead of 'void *'.
+*/
+#define ASSERT_NPC(n) (b = *(1 ? a : (n)))
+/* Assertion that n is not a null pointer constant: so the conditional
+ expressions has type 'void *' instead of 'int *'.
+*/
+#define ASSERT_NOT_NPC(n) (c = (1 ? a : (n)))
+
+void
+foo (void)
+{
+ ASSERT_NPC (0);
+ ASSERT_NPC ((void *)0);
+ ASSERT_NOT_NPC ((void *)(void *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((void *)(char *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((void *)(0, ZERO)); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((void *)(&"Foobar"[0] - &"Foobar"[0])); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ /* This last one is a null pointer constant in C99 only. */
+ ASSERT_NPC ((void *)(1 ? 0 : (0, 0)));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-3.c
new file mode 100644
index 000000000..9b036a32d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-3.c
@@ -0,0 +1,45 @@
+/* Test for constant expressions: broken optimization with const variables. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -O2" } */
+/* Note: not using -pedantic since the -std option alone should be enough
+ to give the correct behavior to conforming programs. */
+
+static const int ZERO = 0;
+static const double DZERO = 0;
+
+int *a;
+int b;
+long *c;
+
+/* Assertion that n is a constant zero: so the conditional expression
+ has type 'int *' instead of 'void *'.
+*/
+#define ASSERT_NPC(n) (b = *(1 ? a : (n)))
+/* Assertion that n is not a constant zero: so the conditional
+ expressions has type 'void *' instead of 'int *'.
+*/
+#define ASSERT_NOT_NPC(n) (c = (1 ? a : (void *)(__SIZE_TYPE__)(n)))
+
+void
+foo (void)
+{
+ ASSERT_NPC (0);
+ ASSERT_NOT_NPC (ZERO);
+ ASSERT_NPC (0 + 0);
+ ASSERT_NOT_NPC (ZERO + 0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC (ZERO + ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NPC (+0);
+ ASSERT_NOT_NPC (+ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NPC (-0);
+ ASSERT_NOT_NPC (-ZERO); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NPC ((char) 0);
+ ASSERT_NOT_NPC ((char) ZERO);
+ ASSERT_NPC ((int) 0);
+ ASSERT_NOT_NPC ((int) ZERO);
+ ASSERT_NPC ((int) 0.0);
+ ASSERT_NOT_NPC ((int) DZERO);
+ ASSERT_NOT_NPC ((int) +0.0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((int) (0.0+0.0)); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+ ASSERT_NOT_NPC ((int) (double)0.0); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-4.c
new file mode 100644
index 000000000..f6beaf77a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-4.c
@@ -0,0 +1,11 @@
+/* Test for constant expressions: const variable with value 0 is not a
+ null pointer constant so the conditional expression should have
+ type void * and the assignment is OK. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -O2" } */
+int *p;
+long *q;
+static void *const n = 0;
+int j;
+void f(void) { q = j ? p : n; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-5.c
new file mode 100644
index 000000000..3bfa7f6fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-5.c
@@ -0,0 +1,39 @@
+/* Test null pointer constants: typedefs for void should be OK but not
+ qualified void. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef void V;
+int *p;
+long *q;
+int j;
+void (*fp)(void);
+
+void
+f (void)
+{
+ /* (V *)0 is a null pointer constant, so the assignment should be
+ diagnosed. */
+ q = (j ? p : (V *)0); /* { dg-error "assignment from incompatible pointer type" } */
+ q = (j ? p : (void *)0); /* { dg-error "assignment from incompatible pointer type" } */
+ /* And this conversion should be valid. */
+ (void (*)(void))(V *)0;
+ (void (*)(void))(void *)0;
+ /* Pointers to qualified void are not valid null pointer
+ constants. */
+ fp = (const void *)0; /* { dg-error "ISO C forbids assignment between function pointer and 'void \\*'" } */
+ fp = (void *)0;
+ fp = (V *)0;
+ fp = 0;
+ fp == 0;
+ 0 == fp;
+ fp == (void *)0;
+ (void *)0 == fp;
+ fp == (V *)0;
+ (V *)0 == fp;
+ fp == (V *)1; /* { dg-error "ISO C forbids comparison of 'void \\*' with function pointer" } */
+ (V *)1 == fp; /* { dg-error "ISO C forbids comparison of 'void \\*' with function pointer" } */
+ fp == (const void *)0; /* { dg-error "ISO C forbids comparison of 'void \\*' with function pointer" } */
+ (const void *)0 == fp; /* { dg-error "ISO C forbids comparison of 'void \\*' with function pointer" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-6.c
new file mode 100644
index 000000000..ca602438d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-6.c
@@ -0,0 +1,62 @@
+/* Test for constant expressions: operands and casts not permitted in
+ integer constant expressions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* PR 29116. */
+int n = 0, p[n * 0 + 1]; /* { dg-error "variabl" } */
+
+/* PR 31871. */
+extern int c[1 + ((__INTPTR_TYPE__) (void *) 0)]; /* { dg-error "variab" } */
+
+/* Implicit conversions from floating-point constants are not OK,
+ although explicit ones are. */
+extern int c1[1.0 ? 1 : 0]; /* { dg-error "variab" } */
+
+extern int c2[(int)1.0 ? 1 : 0];
+
+extern int c3[1.0 && 1]; /* { dg-error "variab" } */
+
+extern int c4[(int)1.0 && 1];
+
+extern int c5[1.0 || 1]; /* { dg-error "variab" } */
+
+extern int c6[(int)1.0 || 1];
+
+/* Similar with various other cases where integer constant expressions
+ are required. */
+
+struct s {
+ int a : (n * 0 + 1); /* { dg-error "constant" } */
+};
+
+enum e {
+ E = (1 + ((__INTPTR_TYPE__) (void *) 0)), /* { dg-error "constant" } */
+ E2 = 0
+};
+
+enum f {
+ F = (1 ? 1 : n), /* { dg-error "constant" } */
+ F2 = 0
+};
+
+/* Presume that a compound literal, being a reference to an anonymous
+ variable, is not allowed in an integer constant expression
+ regardless of what initializers it contains. */
+enum g {
+ G = (1 ? 1 : (int){0}), /* { dg-error "constant" } */
+ G2 = 0
+};
+
+int v[2] = { [(n * 0 + 1)] = 1 }; /* { dg-error "constant|near initialization" } */
+
+void
+f (int a)
+{
+ switch (a)
+ {
+ case (n * 0 + 1): /* { dg-error "constant" } */
+ ;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-7.c
new file mode 100644
index 000000000..b872077e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-7.c
@@ -0,0 +1,43 @@
+/* Test for constant expressions: overflow and constant expressions;
+ see also overflow-warn-*.c for some other cases. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#include <float.h>
+#include <limits.h>
+
+int a = DBL_MAX; /* { dg-warning "overflow in implicit constant conversion" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 10 } */
+int b = (int) DBL_MAX; /* { dg-error "overflow" "" } */
+unsigned int c = -1.0; /* { dg-warning "overflow in implicit constant conversion" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 13 } */
+unsigned int d = (unsigned)-1.0; /* { dg-error "overflow" } */
+
+int e = 0 << 1000; /* { dg-warning "shift count" } */
+/* { dg-error "constant" "constant" { target *-*-* } 17 } */
+int f = 0 << -1; /* { dg-warning "shift count" } */
+/* { dg-error "constant" "constant" { target *-*-* } 19 } */
+int g = 0 >> 1000; /* { dg-warning "shift count" } */
+/* { dg-error "constant" "constant" { target *-*-* } 21 } */
+int h = 0 >> -1; /* { dg-warning "shift count" } */
+/* { dg-error "constant" "constant" { target *-*-* } 23 } */
+
+int b1 = (0 ? (int) DBL_MAX : 0);
+unsigned int d1 = (0 ? (unsigned int)-1.0 : 0);
+int e1 = (0 ? 0 << 1000 : 0);
+int f1 = (0 ? 0 << -1 : 0);
+int g1 = (0 ? 0 >> 1000 : 0);
+int h1 = (0 ? 0 >> -1: 0);
+
+/* Allowed for now, but actually undefined behavior in C99. */
+int i = -1 << 0;
+
+int j[1] = { DBL_MAX }; /* { dg-warning "overflow in implicit constant conversion" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 36 } */
+
+int array[2] = { [0 * (INT_MAX + 1)] = 0 }; /* { dg-warning "integer overflow in expression" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 39 } */
+
+_Bool k = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 42 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-8.c
new file mode 100644
index 000000000..1ddd9ed91
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-8.c
@@ -0,0 +1,28 @@
+/* Test for constant expressions: overflow and constant expressions
+ with -fwrapv: overflows still count as such for the purposes of
+ constant expressions even when they have defined values at
+ runtime. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors -fwrapv" } */
+
+#include <limits.h>
+
+enum e {
+ E0 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 12 } */
+ E1 = 0 * (INT_MIN / -1), /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 14 } */
+ E2 = 0 * (INT_MAX * INT_MAX), /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 16 } */
+ E3 = 0 * (INT_MIN - 1), /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 18 } */
+ E4 = 0 * (unsigned)(INT_MIN - 1), /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 20 } */
+ E5 = 0 * -INT_MIN, /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 22 } */
+ E6 = 0 * !-INT_MIN, /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "not an integer constant" "constant" { target *-*-* } 24 } */
+ E7 = INT_MIN % -1 /* { dg-warning "16:integer overflow in expression" } */
+ /* { dg-error "1:overflow in constant expression" "constant" { target *-*-* } 28 } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-9.c
new file mode 100644
index 000000000..11e0b2c08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-const-expr-9.c
@@ -0,0 +1,26 @@
+/* Test for constant expressions: __builtin_offsetof allowed in
+ integer constant expressions but not traditional offsetof
+ expansion. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors -ftrack-macro-expansion=0" } */
+
+struct s {
+ int a;
+};
+
+struct t {
+ struct s a;
+ int b[2];
+};
+
+#define old_offsetof(TYPE, MEMBER) ((__SIZE_TYPE__)(__UINTPTR_TYPE__) &((TYPE *)0)->MEMBER)
+
+enum e {
+ E1 = old_offsetof (struct s, a), /* { dg-error "constant" } */
+ E2 = old_offsetof (struct t, a.a), /* { dg-error "constant" } */
+ E3 = old_offsetof (struct t, b[1]), /* { dg-error "constant" } */
+ E4 = __builtin_offsetof (struct s, a),
+ E5 = __builtin_offsetof (struct t, a.a),
+ E6 = __builtin_offsetof (struct t, b[1])
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-digraph-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-digraph-1.c
new file mode 100644
index 000000000..318aa70bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-digraph-1.c
@@ -0,0 +1,24 @@
+/* Test for recognition of digraphs: should be recognized in C94 and C99
+ mode, but not in C90 mode. Also check correct stringizing.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#define str(x) xstr(x)
+#define xstr(x) #x
+#define foo(p, q) str(p %:%: q)
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+ const char *t = foo (1, 2);
+ const char *u = str (<:);
+ if (strcmp (t, "12") || strcmp (u, "<:"))
+ abort ();
+ else
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-dupqual-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-dupqual-1.c
new file mode 100644
index 000000000..2e6d7e1bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-dupqual-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef const int CI;
+const const int c1; /* { dg-bogus "duplicate" } */
+const CI c2; /* { dg-bogus "duplicate" } */
+const CI *c3; /* { dg-bogus "duplicate" } */
+
+typedef volatile int VI;
+volatile volatile int v1; /* { dg-bogus "duplicate" } */
+volatile VI v2; /* { dg-bogus "duplicate" } */
+volatile VI *v3; /* { dg-bogus "duplicate" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-enum-comma-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-enum-comma-1.c
new file mode 100644
index 000000000..1b676a229
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-enum-comma-1.c
@@ -0,0 +1,6 @@
+/* Test for commas at end of enums: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+enum foo { bar, };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-1.c
new file mode 100644
index 000000000..b14397ad2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-1.c
@@ -0,0 +1,8 @@
+/* Test for invalid uses of flexible array members. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s1 { int x[]; }; /* { dg-error "empty struct" "empty" } */
+struct s2 { int :1; int x[]; }; /* { dg-error "empty struct" "empty" } */
+struct s3 { int x[]; int y; }; /* { dg-error "not at end" "not at end" } */
+struct s4 { int x; int y[]; };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-2.c
new file mode 100644
index 000000000..496f4f985
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-2.c
@@ -0,0 +1,14 @@
+/* PR c/5623 */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct blah {
+ int number;
+ char array[];
+};
+
+void foo(void)
+{
+ struct blah b;
+ b.array = "hi"; /* { dg-error "invalid use of flexible array member" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-3.c
new file mode 100644
index 000000000..e8647f6ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-3.c
@@ -0,0 +1,47 @@
+/* Test for flexible array members. Test for where structures with
+ such members may not occur. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct flex { int a; int b[]; };
+union rf1 { struct flex a; int b; };
+union rf2 { int a; struct flex b; };
+union rf3 { int a; union rf1 b; };
+union rf4 { union rf2 a; int b; };
+
+/* The above structure and unions may not be members of structures or
+ elements of arrays (6.7.2.1#2). */
+
+struct t0 { struct flex a; }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "struct in struct" { target *-*-* } 16 } */
+struct t1 { union rf1 a; }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "union in struct" { target *-*-* } 18 } */
+struct t2 { union rf2 a; }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "union in struct" { target *-*-* } 20 } */
+struct t3 { union rf3 a; }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "recursive union in struct" { target *-*-* } 22 } */
+struct t4 { union rf4 a; }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "recursive union in struct" { target *-*-* } 24 } */
+
+void f0 (struct flex[]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "struct in array" { target *-*-* } 27 } */
+void f1 (union rf1[]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "union in array" { target *-*-* } 29 } */
+void f2 (union rf2[]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "union in array" { target *-*-* } 31 } */
+void f3 (union rf3[]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } 33 } */
+void f4 (union rf4[]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } 35 } */
+
+struct flex a0[1]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "struct in array" { target *-*-* } 38 } */
+union rf1 a1[1]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "union in array" { target *-*-* } 40 } */
+union rf2 a2[1]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "union in array" { target *-*-* } 42 } */
+union rf3 a3[1]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } 44 } */
+union rf4 a4[1]; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } 46 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-5.c
new file mode 100644
index 000000000..385b0cb95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-5.c
@@ -0,0 +1,6 @@
+/* Test for flexible array members: not permitted in unions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+union u { int a; char b[]; }; /* { dg-error "flexible array member in union" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-6.c
new file mode 100644
index 000000000..468c4b3cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-6.c
@@ -0,0 +1,15 @@
+/* [] does not indicate a flexible array member unless it is the field
+ itself being declared as an incomplete array type rather than a
+ pointer or other type derived from such a type. PR 36432. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+f (void)
+{
+ int a[3];
+ int (*p)[];
+ struct { int (*p)[]; } s;
+ p = &a;
+ s.p = &a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-7.c
new file mode 100644
index 000000000..8966e6ccc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-flex-array-7.c
@@ -0,0 +1,17 @@
+/* Initialization of a flexible array member with a string constant
+ must be diagnosed. PR 37481. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { int a; char b[]; };
+
+struct s a = { 0, "" }; /* { dg-error "initialization of a flexible array member" } */
+/* { dg-error "near init" "near init" { target *-*-* } 8 } */
+struct s b = { 0, { 0 } }; /* { dg-error "initialization of a flexible array member" } */
+/* { dg-error "near init" "near init" { target *-*-* } 10 } */
+struct s c = { 0, { } }; /* { dg-error "ISO C forbids empty initializer braces" } */
+struct s d = { .b = "" }; /* { dg-error "initialization of a flexible array member" } */
+/* { dg-error "near init" "near init" { target *-*-* } 13 } */
+struct s e = { .b = { 0 } }; /* { dg-error "initialization of a flexible array member" } */
+/* { dg-error "near init" "near init" { target *-*-* } 15 } */
+struct s f = { .b = { } }; /* { dg-error "ISO C forbids empty initializer braces" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-float-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-float-1.c
new file mode 100644
index 000000000..7ee87a564
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-float-1.c
@@ -0,0 +1,169 @@
+/* Test for <float.h> C99 macros. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* This test checks that the C99 macros (but not the C11 ones) are defined;
+ it does not check the correctness of their values. */
+
+#include <float.h>
+
+#ifndef FLT_ROUNDS
+#error "FLT_ROUNDS undefined"
+#endif
+
+#ifndef FLT_RADIX
+#error "FLT_RADIX undefined"
+#endif
+
+#ifndef FLT_MANT_DIG
+#error "FLT_MANT_DIG undefined"
+#endif
+
+#ifndef FLT_DIG
+#error "FLT_DIG undefined"
+#endif
+
+#ifndef FLT_MIN_EXP
+#error "FLT_MIN_EXP undefined"
+#endif
+
+#ifndef FLT_MIN_10_EXP
+#error "FLT_MIN_10_EXP undefined"
+#endif
+
+#ifndef FLT_MAX_EXP
+#error "FLT_MAX_EXP undefined"
+#endif
+
+#ifndef FLT_MAX_10_EXP
+#error "FLT_MAX_10_EXP undefined"
+#endif
+
+#ifndef FLT_MAX
+#error "FLT_MAX undefined"
+#endif
+
+#ifndef FLT_EPSILON
+#error "FLT_EPSILON undefined"
+#endif
+
+#ifndef FLT_MIN
+#error "FLT_MIN undefined"
+#endif
+
+#ifndef DBL_MANT_DIG
+#error "DBL_MANT_DIG undefined"
+#endif
+
+#ifndef DBL_DIG
+#error "DBL_DIG undefined"
+#endif
+
+#ifndef DBL_MIN_EXP
+#error "DBL_MIN_EXP undefined"
+#endif
+
+#ifndef DBL_MIN_10_EXP
+#error "DBL_MIN_10_EXP undefined"
+#endif
+
+#ifndef DBL_MAX_EXP
+#error "DBL_MAX_EXP undefined"
+#endif
+
+#ifndef DBL_MAX_10_EXP
+#error "DBL_MAX_10_EXP undefined"
+#endif
+
+#ifndef DBL_MAX
+#error "DBL_MAX undefined"
+#endif
+
+#ifndef DBL_EPSILON
+#error "DBL_EPSILON undefined"
+#endif
+
+#ifndef DBL_MIN
+#error "DBL_MIN undefined"
+#endif
+
+#ifndef LDBL_MANT_DIG
+#error "LDBL_MANT_DIG undefined"
+#endif
+
+#ifndef LDBL_DIG
+#error "LDBL_DIG undefined"
+#endif
+
+#ifndef LDBL_MIN_EXP
+#error "LDBL_MIN_EXP undefined"
+#endif
+
+#ifndef LDBL_MIN_10_EXP
+#error "LDBL_MIN_10_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX_EXP
+#error "LDBL_MAX_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX_10_EXP
+#error "LDBL_MAX_10_EXP undefined"
+#endif
+
+#ifndef LDBL_MAX
+#error "LDBL_MAX undefined"
+#endif
+
+#ifndef LDBL_EPSILON
+#error "LDBL_EPSILON undefined"
+#endif
+
+#ifndef LDBL_MIN
+#error "LDBL_MIN undefined"
+#endif
+
+#ifndef FLT_EVAL_METHOD
+#error "FLT_EVAL_METHOD undefined"
+#endif
+
+#ifndef DECIMAL_DIG
+#error "DECIMAL_DIG undefined"
+#endif
+
+#ifdef FLT_DECIMAL_DIG
+#error "FLT_DECIMAL_DIG defined"
+#endif
+
+#ifdef DBL_DECIMAL_DIG
+#error "DBL_DECIMAL_DIG defined"
+#endif
+
+#ifdef LDBL_DECIMAL_DIG
+#error "LDBL_DECIMAL_DIG defined"
+#endif
+
+#ifdef FLT_HAS_SUBNORM
+#error "FLT_HAS_SUBNORM defined"
+#endif
+
+#ifdef DBL_HAS_SUBNORM
+#error "DBL_HAS_SUBNORM defined"
+#endif
+
+#ifdef LDBL_HAS_SUBNORM
+#error "LDBL_HAS_SUBNORM defined"
+#endif
+
+#ifdef FLT_TRUE_MIN
+#error "FLT_TRUE_MIN defined"
+#endif
+
+#ifdef DBL_TRUE_MIN
+#error "DBL_TRUE_MIN defined"
+#endif
+
+#ifdef LDBL_TRUE_MIN
+#error "LDBL_TRUE_MIN defined"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-1.c
new file mode 100644
index 000000000..faaab1e95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-1.c
@@ -0,0 +1,35 @@
+/* Test for C99 declarations in for loops. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int j = 0;
+ int i = -1;
+ for (int i = 1; i <= 10; i++)
+ j += i;
+ if (j != 55)
+ abort ();
+ if (i != -1)
+ abort ();
+ j = 0;
+ for (auto int i = 1; i <= 10; i++)
+ j += i;
+ if (j != 55)
+ abort ();
+ if (i != -1)
+ abort ();
+ j = 0;
+ for (register int i = 1; i <= 10; i++)
+ j += i;
+ if (j != 55)
+ abort ();
+ if (i != -1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-2.c
new file mode 100644
index 000000000..0ef11f612
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-2.c
@@ -0,0 +1,28 @@
+/* Test for C99 declarations in for loops. Test constraints. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ /* See comments in check_for_loop_decls (c-decl.c) for the presumptions
+ behind these tests. */
+ int j = 0;
+ for (int i = 1, bar (void); i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ j += i;
+ /* { dg-error "bar" "function in for loop" { target *-*-* } 12 } */
+ for (static int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ j += i;
+ /* { dg-error "static" "static in for loop" { target *-*-* } 15 } */
+ for (extern int i; j <= 500; j++) /* { dg-bogus "warning" "warning in place of error" } */
+ j += 5;
+ /* { dg-error "extern" "extern in for loop" { target *-*-* } 18 } */
+ for (enum { FOO } i = FOO; i < 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ j += i;
+ /* { dg-error "FOO" "enum value in for loop" { target *-*-* } 21 } */
+ for (enum BAR { FOO } i = FOO; i < 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
+ j += i;
+ /* { dg-error "FOO" "enum value in for loop" { target *-*-* } 24 } */
+ /* { dg-error "BAR" "enum tag in for loop" { target *-*-* } 24 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-3.c
new file mode 100644
index 000000000..ff814ad57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-fordecl-3.c
@@ -0,0 +1,15 @@
+/* Test for C99 declarations in for loops. Test constraints: struct
+ and union tags can't be declared there (affirmed in response to
+ DR#277). */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ for (struct s { int p; } *p = 0; ;) /* { dg-error "'struct s' declared in 'for' loop initial declaration" } */
+ ;
+ for (union u { int p; } *p = 0; ;) /* { dg-error "'union u' declared in 'for' loop initial declaration" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-1.c
new file mode 100644
index 000000000..43fb03217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-1.c
@@ -0,0 +1,17 @@
+/* Test for C99 __func__. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+extern void exit (int);
+
+int
+main (void)
+{
+ if (strcmp (__func__, "main") || sizeof (__func__) != 5)
+ abort ();
+ else
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-2.c
new file mode 100644
index 000000000..f3eaaa1fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-2.c
@@ -0,0 +1,10 @@
+/* Test for C99 __func__: not a string constant. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ __func__ "foo"; /* { dg-error "parse error|syntax error|expected" "before string constant" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-3.c
new file mode 100644
index 000000000..f8a06a0e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-3.c
@@ -0,0 +1,16 @@
+/* Test for C99 __func__: not merging with string literals. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ if ("main" == __func__)
+ abort ();
+ else
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-4.c
new file mode 100644
index 000000000..10ec19566
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-func-4.c
@@ -0,0 +1,10 @@
+/* Test for C99 __func__: of type const char []. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ char *p = __func__; /* { dg-error "discards" "__func__ pointer to const" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-1.c
new file mode 100644
index 000000000..f4c147bcc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-1.c
@@ -0,0 +1,6 @@
+/* Test for hex floating point constants: in C99 only. Compiler test. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+double d = 0x1.2p2; /* { dg-bogus "radix 16" "bogus C99 hex float error" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-2.c
new file mode 100644
index 000000000..3ca15c3c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-2.c
@@ -0,0 +1,24 @@
+/* Test for hex floating point constants: in C99 only. Preprocessor test. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#define f (
+#define l )
+#define str(x) #x
+#define xstr(x) str(x)
+
+/* C90: "0x1p+( 0x1p+)"; C99: "0x1p+f 0x1p+l" */
+const char *s = xstr(0x1p+f 0x1p+l);
+
+extern void abort (void);
+extern int strcmp (const char *, const char *);
+
+int
+main (void)
+{
+ if (strcmp (s, "0x1p+f 0x1p+l"))
+ abort ();
+ else
+ return 0; /* Correct C99 behavior. */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-3.c
new file mode 100644
index 000000000..62dc4956a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-hexfloat-3.c
@@ -0,0 +1,25 @@
+/* Test syntax of hexadecimal floating point constants: at least one
+ digit needed before or after point. PR 41947. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+double d0 = 0x0.0p0;
+double d1 = 0x.0p0;
+double d2 = 0x0.p0;
+double d3 = 0x0.0p+0;
+double d4 = 0x.0p+0;
+double d5 = 0x0.p+0;
+double d6 = 0x0.0p-0;
+double d7 = 0x.0p-0;
+double d8 = 0x0.p-0;
+
+double e0 = 0x.p0; /* { dg-error "no digits" } */
+double e1 = 0x0.; /* { dg-error "require an exponent" } */
+double e2 = 0x.0; /* { dg-error "require an exponent" } */
+double e3 = 0x0.0; /* { dg-error "require an exponent" } */
+double e4 = 0x0.0p; /* { dg-error "exponent has no digits" } */
+double e5 = 0x0.0pf; /* { dg-error "exponent has no digits" } */
+double e6 = 0x0.0p+; /* { dg-error "exponent has no digits" } */
+double e7 = 0x0.0p+f; /* { dg-error "exponent has no digits" } */
+double e8 = 0x0.0p-; /* { dg-error "exponent has no digits" } */
+double e9 = 0x0.0p-f; /* { dg-error "exponent has no digits" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-1.c
new file mode 100644
index 000000000..c541d075c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-1.c
@@ -0,0 +1,7 @@
+/* Test for idempotent type qualifiers: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef const int cint;
+const cint foo; /* { dg-bogus "duplicate" "duplicate type qualifier error" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-2.c
new file mode 100644
index 000000000..dd9f932b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-2.c
@@ -0,0 +1,6 @@
+/* Test for idempotent type qualifiers: in C99 only. Test "const const". */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+const const int foo; /* { dg-bogus "duplicate" "duplicate type qualifier error" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-3.c
new file mode 100644
index 000000000..0f34f8321
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-idem-qual-3.c
@@ -0,0 +1,9 @@
+/* Test for idempotent type qualifiers: in C99 only. Test duplicate
+ type qualifiers with array element types. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef const int cia[2];
+const cia a; /* { dg-bogus "duplicate" "duplicate type qualifier warning" } */
+const cia b[2]; /* { dg-bogus "duplicate" "duplicate type qualifier warning" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-decl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-decl-1.c
new file mode 100644
index 000000000..6602bc71d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-decl-1.c
@@ -0,0 +1,21 @@
+/* Test for implicit function declaration: in C90 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ bar (); /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "implicit" "C99 implicit declaration error" { target *-*-* } 9 } */
+}
+
+/* C90 subclause 7.1.7 says we can implicitly declare strcmp; C99 removes
+ implict declarations.
+*/
+int
+bar (const char *a, const char *b)
+{
+ return strcmp (a, b); /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "implicit" "C99 implicit declaration error" { target *-*-* } 19 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-int-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-int-1.c
new file mode 100644
index 000000000..dcc25203a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-int-1.c
@@ -0,0 +1,9 @@
+/* Test for implicit int: in C90 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+extern foo; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "type defaults" "C99 implicit int error" { target *-*-* } 6 } */
+bar (void) { } /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "return type defaults" "C99 implicit int error" { target *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-int-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-int-2.c
new file mode 100644
index 000000000..e9e974767
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-impl-int-2.c
@@ -0,0 +1,9 @@
+/* Test for implicit int: in C90 only. Function parameters in old-style
+ function definition.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void foo (a) { } /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "defaults" "C99 implicit int parameter error" { target *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-1.c
new file mode 100644
index 000000000..95803c241
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-1.c
@@ -0,0 +1,78 @@
+/* Test for C99 designated initializers */
+/* Origin: Jakub Jelinek <jakub@redhat.com> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef __SIZE_TYPE__ size_t;
+typedef __WCHAR_TYPE__ wchar_t;
+extern int memcmp (const void *, const void *, size_t);
+extern void abort (void);
+extern void exit (int);
+
+int a[10] = { 10, 0, 12, 13, 14, 0, 0, 17, 0, 0 };
+int b[10] = { 10, [4] = 15, [2] = 12, [4] = 14, [7] = 17 };
+int c[10] = { 10, [4] = 15, [2] = 12, [3] = 13, 14, [7] = 17 };
+struct A {
+ int B;
+ short C[2];
+};
+struct A d[] = { { 0, { 1, 2 } }, { 0, { 0, 0 } }, { 10, { 11, 12 } } };
+struct A e[] = { 0, 1, 2, [2] = 10, 11, 12 };
+struct A f[] = { 0, 1, 2, [2].C = 11, 12, 13 };
+struct A g[] = { 0, 1, 2, [2].C[1] = 12, 13, 14 };
+struct A h[] = { 0, 1, 2, [2] = { .C[1] = 12 }, 13, 14 };
+struct A i[] = { 0, 1, 2, [2] = { .C = { [1] = 12 } }, 13, 14 };
+union D {
+ int E;
+ double F;
+ struct A G;
+};
+union D j[] = { [4] = 1, [4].F = 1.0, [1].G.C[1] = 4 };
+struct H {
+ char I[6];
+ int J;
+} k[] = { { { "foo" }, 1 }, [0].I[0] = 'b' };
+struct K {
+ wchar_t L[6];
+ int M;
+} l[] = { { { L"foo" }, 1 }, [0].L[2] = L'x', [0].L[4] = L'y' };
+struct H m[] = { { { "foo" }, 1 }, [0] = { .I[0] = 'b' } };
+struct H n[] = { { { "foo" }, 1 }, [0].I = { "a" }, [0].J = 2 };
+int o = { 22 };
+
+int main (void)
+{
+ if (b[3])
+ abort ();
+ b[3] = 13;
+ if (memcmp (a, b, sizeof (a)) || memcmp (a, c, sizeof (a)))
+ abort ();
+ if (memcmp (d, e, sizeof (d)) || sizeof (d) != sizeof (e))
+ abort ();
+ if (f[2].B != 0 || g[2].B != 0 || g[2].C[0] != 0)
+ abort ();
+ if (memcmp (g, h, sizeof (g)) || memcmp (g, i, sizeof (g)))
+ abort ();
+ f[2].B = 10;
+ g[2].B = 10;
+ g[2].C[0] = 11;
+ if (memcmp (d, f, sizeof (d)) || memcmp (d, g, sizeof (d)))
+ abort ();
+ if (f[3].B != 13 || g[3].B != 13 || g[3].C[0] != 14)
+ abort ();
+ if (j[0].E || j[1].G.B || j[1].G.C[0] || j[1].G.C[1] != 4)
+ abort ();
+ if (j[2].E || j[3].E || j[4].F != 1.0)
+ abort ();
+ if (memcmp (k[0].I, "boo\0\0", 6) || k[0].J != 1)
+ abort ();
+ if (memcmp (l[0].L, L"fox\0y", 6 * sizeof(wchar_t)) || l[0].M != 1)
+ abort ();
+ if (memcmp (m[0].I, "b\0\0\0\0", 6) || m[0].J)
+ abort ();
+ if (memcmp (n[0].I, "a\0\0\0\0", 6) || n[0].J != 2)
+ abort ();
+ if (o != 22)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-2.c
new file mode 100644
index 000000000..d3a331ff3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-2.c
@@ -0,0 +1,30 @@
+/* Test for C99 designated initializer warnings and errors */
+/* Origin: Jakub Jelinek <jakub@redhat.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -Wall -pedantic-errors" } */
+
+typedef struct {
+ int B;
+ short C[2];
+} A;
+A a = { [2] = 1 }; /* { dg-error "(array index in non-array)|(near initialization)" } */
+int b[] = { .B = 1 }; /* { dg-error "(field name not in record)|(near initialization)" } */
+A c[] = { [0].D = 1 }; /* { dg-error "unknown field" } */
+int d;
+int e = { d++ }; /* { dg-error "(is not constant)|(near initialization)" } */
+A f[2] = { [0].C[0] = 1, [2] = { 2, { 1, 2 } } };/* { dg-error "(array index in initializer exceeds array bounds)|(near initialization)" } */
+int g[4] = { [1] = 1, 2, [6] = 5 }; /* { dg-error "(array index in initializer exceeds array bounds)|(near initialization)" } */
+int h[] = { [0 ... 3] = 5 }; /* { dg-error "forbids specifying range of elements" } */
+int i[] = { [2] 4 }; /* { dg-error "use of designated initializer without" } */
+A j = { B: 2 }; /* { dg-error "use of designated initializer with " } */
+
+void foo (int *, A *);
+
+void bar (void)
+{
+ int a[] = { d++, [0] = 1 }; /* { dg-warning "(initialized field with side-effects overwritten)|(near initialization)" } */
+ A b = { 1, { d++, 2 }, .C[0] = 3 };/* { dg-warning "(initialized field with side-effects overwritten)|(near initialization)" } */
+ A c = { d++, { 2, 3 }, .B = 4 }; /* { dg-warning "(initialized field with side-effects overwritten)|(near initialization)" } */
+
+ foo (a, d ? &b : &c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-3.c
new file mode 100644
index 000000000..9aca19acc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-3.c
@@ -0,0 +1,8 @@
+/* Test for designated initializers: array designators must be of
+ integer type. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+int a[] = { [(void *)0] = 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "integer type|near init" "pointer designator" { target *-*-* } 7 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-4.c
new file mode 100644
index 000000000..707355785
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-4.c
@@ -0,0 +1,8 @@
+/* Test for nested initialization of a compound literal: must not be
+ checked against outer array bounds. Bug 19435. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { char *p; };
+struct s a[1] = { { .p = ((char []){ 1, 2 }) } };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-5.c
new file mode 100644
index 000000000..17bacd90c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-5.c
@@ -0,0 +1,9 @@
+/* Test for designated initializers: string constants used with
+ designator in character array should not initialize the array as a
+ whole. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+char g[] = { [7] = "abcd" }; /* { dg-error "initial" } */
+char h[10][10] = { [1][1] = "abcd" }; /* { dg-error "initial" } */
+char i[10][10] = { [1] = "abcd" };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-6.c
new file mode 100644
index 000000000..6328f8267
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-init-6.c
@@ -0,0 +1,6 @@
+/* Test for designated initializers: invalid uses of string constants
+ should not ICE. PR 42262. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+int a[] = { [0 ... 1] = "", [0] = "" }; /* { dg-error "initial" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-intconst-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-intconst-1.c
new file mode 100644
index 000000000..629b0bcac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-intconst-1.c
@@ -0,0 +1,639 @@
+/* Test for integer constant types. */
+
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#include <limits.h>
+
+/* Assertion that constant C is of type T. */
+#define ASSERT_CONST_TYPE(C, T) \
+ do { \
+ typedef T type; \
+ typedef type **typepp; \
+ typedef __typeof__((C)) ctype; \
+ typedef ctype **ctypepp; \
+ typepp x = 0; \
+ ctypepp y = 0; \
+ x = y; \
+ y = x; \
+ } while (0)
+
+/* (T *) if E is zero, (void *) otherwise. */
+#define type_if_not(T, E) __typeof__(0 ? (T *)0 : (void *)(E))
+
+/* (T *) if E is nonzero, (void *) otherwise. */
+#define type_if(T, E) type_if_not(T, !(E))
+
+/* Combine pointer types, all but one (void *). */
+#define type_comb2(T1, T2) __typeof__(0 ? (T1)0 : (T2)0)
+#define type_comb3(T1, T2, T3) type_comb2(T1, type_comb2(T2, T3))
+#define type_comb4(T1, T2, T3, T4) \
+ type_comb2(T1, type_comb2(T2, type_comb2(T3, T4)))
+#define type_comb6(T1, T2, T3, T4, T5, T6) \
+ type_comb2(T1, \
+ type_comb2(T2, \
+ type_comb2(T3, \
+ type_comb2(T4, \
+ type_comb2(T5, T6)))))
+
+/* (T1 *) if E1, otherwise (T2 *) if E2. */
+#define first_of2p(T1, E1, T2, E2) type_comb2(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))))
+/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3. */
+#define first_of3p(T1, E1, T2, E2, T3, E3) \
+ type_comb3(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))), \
+ type_if(T3, (!(E1) && !(E2) && (E3))))
+/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise
+ (T4 *) if E4. */
+#define first_of4p(T1, E1, T2, E2, T3, E3, T4, E4) \
+ type_comb4(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))), \
+ type_if(T3, (!(E1) && !(E2) && (E3))), \
+ type_if(T4, (!(E1) && !(E2) && !(E3) && (E4))))
+/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise
+ (T4 *) if E4, otherwise (T5 *) if E5, otherwise (T6 *) if E6. */
+#define first_of6p(T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6) \
+ type_comb6(type_if(T1, (E1)), \
+ type_if(T2, (!(E1) && (E2))), \
+ type_if(T3, (!(E1) && !(E2) && (E3))), \
+ type_if(T4, (!(E1) && !(E2) && !(E3) && (E4))), \
+ type_if(T5, (!(E1) && !(E2) && !(E3) && !(E4) && (E5))), \
+ type_if(T6, (!(E1) && !(E2) && !(E3) \
+ && !(E4) && !(E5) && (E6))))
+
+/* Likewise, but return the original type rather than a pointer type. */
+#define first_of2(T1, E1, T2, E2) \
+ __typeof__(*((first_of2p(T1, (E1), T2, (E2)))0))
+#define first_of3(T1, E1, T2, E2, T3, E3) \
+ __typeof__(*((first_of3p(T1, (E1), T2, (E2), T3, (E3)))0))
+#define first_of4(T1, E1, T2, E2, T3, E3, T4, E4) \
+ __typeof__(*((first_of4p(T1, (E1), T2, (E2), T3, (E3), T4, (E4)))0))
+#define first_of6(T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6) \
+ __typeof__(*((first_of6p(T1, (E1), T2, (E2), T3, (E3), \
+ T4, (E4), T5, (E5), T6, (E6)))0))
+
+/* Types of constants according to the C99 rules. */
+#define C99_UNSUF_DEC_TYPE(C) \
+ first_of3(int, (C) <= INT_MAX, \
+ long int, (C) <= LONG_MAX, \
+ long long int, (C) <= LLONG_MAX)
+#define C99_UNSUF_OCTHEX_TYPE(C) \
+ first_of6(int, (C) <= INT_MAX, \
+ unsigned int, (C) <= UINT_MAX, \
+ long int, (C) <= LONG_MAX, \
+ unsigned long int, (C) <= ULONG_MAX, \
+ long long int, (C) <= LLONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+#define C99_SUFu_TYPE(C) \
+ first_of3(unsigned int, (C) <= UINT_MAX, \
+ unsigned long int, (C) <= ULONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+#define C99_SUFl_DEC_TYPE(C) \
+ first_of2(long int, (C) <= LONG_MAX, \
+ long long int, (C) <= LLONG_MAX)
+#define C99_SUFl_OCTHEX_TYPE(C) \
+ first_of4(long int, (C) <= LONG_MAX, \
+ unsigned long int, (C) <= ULONG_MAX, \
+ long long int, (C) <= LLONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+#define C99_SUFul_TYPE(C) \
+ first_of2(unsigned long int, (C) <= ULONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+#define C99_SUFll_OCTHEX_TYPE(C) \
+ first_of2(long long int, (C) <= LLONG_MAX, \
+ unsigned long long int, (C) <= ULLONG_MAX)
+
+/* Checks that constants have correct type. */
+#define CHECK_UNSUF_DEC_TYPE(C) ASSERT_CONST_TYPE((C), C99_UNSUF_DEC_TYPE((C)))
+#define CHECK_UNSUF_OCTHEX_TYPE(C) \
+ ASSERT_CONST_TYPE((C), C99_UNSUF_OCTHEX_TYPE((C)))
+#define CHECK_SUFu_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFu_TYPE((C)))
+#define CHECK_SUFl_DEC_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFl_DEC_TYPE((C)))
+#define CHECK_SUFl_OCTHEX_TYPE(C) \
+ ASSERT_CONST_TYPE((C), C99_SUFl_OCTHEX_TYPE((C)))
+#define CHECK_SUFul_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFul_TYPE((C)))
+#define CHECK_SUFll_DEC_TYPE(C) ASSERT_CONST_TYPE((C), long long int)
+#define CHECK_SUFll_OCTHEX_TYPE(C) \
+ ASSERT_CONST_TYPE((C), C99_SUFll_OCTHEX_TYPE((C)))
+#define CHECK_SUFull_TYPE(C) ASSERT_CONST_TYPE((C), unsigned long long int)
+
+/* Check a decimal value, with all suffixes. */
+#define CHECK_DEC_CONST(C) \
+ CHECK_UNSUF_DEC_TYPE(C); \
+ CHECK_SUFu_TYPE(C##u); \
+ CHECK_SUFu_TYPE(C##U); \
+ CHECK_SUFl_DEC_TYPE(C##l); \
+ CHECK_SUFl_DEC_TYPE(C##L); \
+ CHECK_SUFul_TYPE(C##ul); \
+ CHECK_SUFul_TYPE(C##uL); \
+ CHECK_SUFul_TYPE(C##Ul); \
+ CHECK_SUFul_TYPE(C##UL); \
+ CHECK_SUFll_DEC_TYPE(C##ll); \
+ CHECK_SUFll_DEC_TYPE(C##LL); \
+ CHECK_SUFull_TYPE(C##ull); \
+ CHECK_SUFull_TYPE(C##uLL); \
+ CHECK_SUFull_TYPE(C##Ull); \
+ CHECK_SUFull_TYPE(C##ULL);
+
+/* Check an octal or hexadecimal value, with all suffixes. */
+#define CHECK_OCTHEX_CONST(C) \
+ CHECK_UNSUF_OCTHEX_TYPE(C); \
+ CHECK_SUFu_TYPE(C##u); \
+ CHECK_SUFu_TYPE(C##U); \
+ CHECK_SUFl_OCTHEX_TYPE(C##l); \
+ CHECK_SUFl_OCTHEX_TYPE(C##L); \
+ CHECK_SUFul_TYPE(C##ul); \
+ CHECK_SUFul_TYPE(C##uL); \
+ CHECK_SUFul_TYPE(C##Ul); \
+ CHECK_SUFul_TYPE(C##UL); \
+ CHECK_SUFll_OCTHEX_TYPE(C##ll); \
+ CHECK_SUFll_OCTHEX_TYPE(C##LL); \
+ CHECK_SUFull_TYPE(C##ull); \
+ CHECK_SUFull_TYPE(C##uLL); \
+ CHECK_SUFull_TYPE(C##Ull); \
+ CHECK_SUFull_TYPE(C##ULL);
+
+#define CHECK_OCT_CONST(C) CHECK_OCTHEX_CONST(C)
+#define CHECK_HEX_CONST(C) \
+ CHECK_OCTHEX_CONST(0x##C); \
+ CHECK_OCTHEX_CONST(0X##C);
+
+/* True iff "long long" is at least B bits. This presumes that (B-2)/3 is at
+ most 63. */
+#define LLONG_AT_LEAST(B) \
+ (LLONG_MAX >> ((B)-2)/3 >> ((B)-2)/3 \
+ >> ((B)-2 - ((B)-2)/3 - ((B)-2)/3))
+
+#define LLONG_HAS_BITS(B) (LLONG_AT_LEAST((B)) && !LLONG_AT_LEAST((B) + 1))
+
+void
+foo (void)
+{
+ /* Decimal. */
+ /* Check all 2^n and 2^n - 1 up to 2^71 - 1. */
+ CHECK_DEC_CONST(1);
+ CHECK_DEC_CONST(2);
+ CHECK_DEC_CONST(3);
+ CHECK_DEC_CONST(4);
+ CHECK_DEC_CONST(7);
+ CHECK_DEC_CONST(8);
+ CHECK_DEC_CONST(15);
+ CHECK_DEC_CONST(16);
+ CHECK_DEC_CONST(31);
+ CHECK_DEC_CONST(32);
+ CHECK_DEC_CONST(63);
+ CHECK_DEC_CONST(64);
+ CHECK_DEC_CONST(127);
+ CHECK_DEC_CONST(128);
+ CHECK_DEC_CONST(255);
+ CHECK_DEC_CONST(256);
+ CHECK_DEC_CONST(511);
+ CHECK_DEC_CONST(512);
+ CHECK_DEC_CONST(1023);
+ CHECK_DEC_CONST(1024);
+ CHECK_DEC_CONST(2047);
+ CHECK_DEC_CONST(2048);
+ CHECK_DEC_CONST(4095);
+ CHECK_DEC_CONST(4096);
+ CHECK_DEC_CONST(8191);
+ CHECK_DEC_CONST(8192);
+ CHECK_DEC_CONST(16383);
+ CHECK_DEC_CONST(16384);
+ CHECK_DEC_CONST(32767);
+ CHECK_DEC_CONST(32768);
+ CHECK_DEC_CONST(65535);
+ CHECK_DEC_CONST(65536);
+ CHECK_DEC_CONST(131071);
+ CHECK_DEC_CONST(131072);
+ CHECK_DEC_CONST(262143);
+ CHECK_DEC_CONST(262144);
+ CHECK_DEC_CONST(524287);
+ CHECK_DEC_CONST(524288);
+ CHECK_DEC_CONST(1048575);
+ CHECK_DEC_CONST(1048576);
+ CHECK_DEC_CONST(2097151);
+ CHECK_DEC_CONST(2097152);
+ CHECK_DEC_CONST(4194303);
+ CHECK_DEC_CONST(4194304);
+ CHECK_DEC_CONST(8388607);
+ CHECK_DEC_CONST(8388608);
+ CHECK_DEC_CONST(16777215);
+ CHECK_DEC_CONST(16777216);
+ CHECK_DEC_CONST(33554431);
+ CHECK_DEC_CONST(33554432);
+ CHECK_DEC_CONST(67108863);
+ CHECK_DEC_CONST(67108864);
+ CHECK_DEC_CONST(134217727);
+ CHECK_DEC_CONST(134217728);
+ CHECK_DEC_CONST(268435455);
+ CHECK_DEC_CONST(268435456);
+ CHECK_DEC_CONST(536870911);
+ CHECK_DEC_CONST(536870912);
+ CHECK_DEC_CONST(1073741823);
+ CHECK_DEC_CONST(1073741824);
+ CHECK_DEC_CONST(2147483647);
+ CHECK_DEC_CONST(2147483648);
+ CHECK_DEC_CONST(4294967295);
+ CHECK_DEC_CONST(4294967296);
+ CHECK_DEC_CONST(8589934591);
+ CHECK_DEC_CONST(8589934592);
+ CHECK_DEC_CONST(17179869183);
+ CHECK_DEC_CONST(17179869184);
+ CHECK_DEC_CONST(34359738367);
+ CHECK_DEC_CONST(34359738368);
+ CHECK_DEC_CONST(68719476735);
+ CHECK_DEC_CONST(68719476736);
+ CHECK_DEC_CONST(137438953471);
+ CHECK_DEC_CONST(137438953472);
+ CHECK_DEC_CONST(274877906943);
+ CHECK_DEC_CONST(274877906944);
+ CHECK_DEC_CONST(549755813887);
+ CHECK_DEC_CONST(549755813888);
+ CHECK_DEC_CONST(1099511627775);
+ CHECK_DEC_CONST(1099511627776);
+ CHECK_DEC_CONST(2199023255551);
+ CHECK_DEC_CONST(2199023255552);
+ CHECK_DEC_CONST(4398046511103);
+ CHECK_DEC_CONST(4398046511104);
+ CHECK_DEC_CONST(8796093022207);
+ CHECK_DEC_CONST(8796093022208);
+ CHECK_DEC_CONST(17592186044415);
+ CHECK_DEC_CONST(17592186044416);
+ CHECK_DEC_CONST(35184372088831);
+ CHECK_DEC_CONST(35184372088832);
+ CHECK_DEC_CONST(70368744177663);
+ CHECK_DEC_CONST(70368744177664);
+ CHECK_DEC_CONST(140737488355327);
+ CHECK_DEC_CONST(140737488355328);
+ CHECK_DEC_CONST(281474976710655);
+ CHECK_DEC_CONST(281474976710656);
+ CHECK_DEC_CONST(562949953421311);
+ CHECK_DEC_CONST(562949953421312);
+ CHECK_DEC_CONST(1125899906842623);
+ CHECK_DEC_CONST(1125899906842624);
+ CHECK_DEC_CONST(2251799813685247);
+ CHECK_DEC_CONST(2251799813685248);
+ CHECK_DEC_CONST(4503599627370495);
+ CHECK_DEC_CONST(4503599627370496);
+ CHECK_DEC_CONST(9007199254740991);
+ CHECK_DEC_CONST(9007199254740992);
+ CHECK_DEC_CONST(18014398509481983);
+ CHECK_DEC_CONST(18014398509481984);
+ CHECK_DEC_CONST(36028797018963967);
+ CHECK_DEC_CONST(36028797018963968);
+ CHECK_DEC_CONST(72057594037927935);
+ CHECK_DEC_CONST(72057594037927936);
+ CHECK_DEC_CONST(144115188075855871);
+ CHECK_DEC_CONST(144115188075855872);
+ CHECK_DEC_CONST(288230376151711743);
+ CHECK_DEC_CONST(288230376151711744);
+ CHECK_DEC_CONST(576460752303423487);
+ CHECK_DEC_CONST(576460752303423488);
+ CHECK_DEC_CONST(1152921504606846975);
+ CHECK_DEC_CONST(1152921504606846976);
+ CHECK_DEC_CONST(2305843009213693951);
+ CHECK_DEC_CONST(2305843009213693952);
+ CHECK_DEC_CONST(4611686018427387903);
+ CHECK_DEC_CONST(4611686018427387904);
+ CHECK_DEC_CONST(9223372036854775807);
+#if LLONG_AT_LEAST(65)
+ CHECK_DEC_CONST(9223372036854775808);
+ CHECK_DEC_CONST(18446744073709551615);
+#endif
+#if LLONG_AT_LEAST(66)
+ CHECK_DEC_CONST(18446744073709551616);
+ CHECK_DEC_CONST(36893488147419103231);
+#endif
+#if LLONG_AT_LEAST(67)
+ CHECK_DEC_CONST(36893488147419103232);
+ CHECK_DEC_CONST(73786976294838206463);
+#endif
+#if LLONG_AT_LEAST(68)
+ CHECK_DEC_CONST(73786976294838206464);
+ CHECK_DEC_CONST(147573952589676412927);
+#endif
+#if LLONG_AT_LEAST(69)
+ CHECK_DEC_CONST(147573952589676412928);
+ CHECK_DEC_CONST(295147905179352825855);
+#endif
+#if LLONG_AT_LEAST(70)
+ CHECK_DEC_CONST(295147905179352825856);
+ CHECK_DEC_CONST(590295810358705651711);
+#endif
+#if LLONG_AT_LEAST(71)
+ CHECK_DEC_CONST(590295810358705651712);
+ CHECK_DEC_CONST(1180591620717411303423);
+#endif
+#if LLONG_AT_LEAST(72)
+ CHECK_DEC_CONST(1180591620717411303424);
+ CHECK_DEC_CONST(2361183241434822606847);
+#endif
+ /* Octal and hexadecimal. */
+ /* Check all 2^n and 2^n - 1 up to 2^72 - 1. */
+ CHECK_OCT_CONST(0);
+ CHECK_HEX_CONST(0);
+ CHECK_OCT_CONST(01);
+ CHECK_HEX_CONST(1);
+ CHECK_OCT_CONST(02);
+ CHECK_HEX_CONST(2);
+ CHECK_OCT_CONST(03);
+ CHECK_HEX_CONST(3);
+ CHECK_OCT_CONST(04);
+ CHECK_HEX_CONST(4);
+ CHECK_OCT_CONST(07);
+ CHECK_HEX_CONST(7);
+ CHECK_OCT_CONST(010);
+ CHECK_HEX_CONST(8);
+ CHECK_OCT_CONST(017);
+ CHECK_HEX_CONST(f);
+ CHECK_OCT_CONST(020);
+ CHECK_HEX_CONST(10);
+ CHECK_OCT_CONST(037);
+ CHECK_HEX_CONST(1f);
+ CHECK_OCT_CONST(040);
+ CHECK_HEX_CONST(20);
+ CHECK_OCT_CONST(077);
+ CHECK_HEX_CONST(3f);
+ CHECK_OCT_CONST(0100);
+ CHECK_HEX_CONST(40);
+ CHECK_OCT_CONST(0177);
+ CHECK_HEX_CONST(7f);
+ CHECK_OCT_CONST(0200);
+ CHECK_HEX_CONST(80);
+ CHECK_OCT_CONST(0377);
+ CHECK_HEX_CONST(ff);
+ CHECK_OCT_CONST(0400);
+ CHECK_HEX_CONST(100);
+ CHECK_OCT_CONST(0777);
+ CHECK_HEX_CONST(1ff);
+ CHECK_OCT_CONST(01000);
+ CHECK_HEX_CONST(200);
+ CHECK_OCT_CONST(01777);
+ CHECK_HEX_CONST(3ff);
+ CHECK_OCT_CONST(02000);
+ CHECK_HEX_CONST(400);
+ CHECK_OCT_CONST(03777);
+ CHECK_HEX_CONST(7ff);
+ CHECK_OCT_CONST(04000);
+ CHECK_HEX_CONST(800);
+ CHECK_OCT_CONST(07777);
+ CHECK_HEX_CONST(fff);
+ CHECK_OCT_CONST(010000);
+ CHECK_HEX_CONST(1000);
+ CHECK_OCT_CONST(017777);
+ CHECK_HEX_CONST(1fff);
+ CHECK_OCT_CONST(020000);
+ CHECK_HEX_CONST(2000);
+ CHECK_OCT_CONST(037777);
+ CHECK_HEX_CONST(3fff);
+ CHECK_OCT_CONST(040000);
+ CHECK_HEX_CONST(4000);
+ CHECK_OCT_CONST(077777);
+ CHECK_HEX_CONST(7fff);
+ CHECK_OCT_CONST(0100000);
+ CHECK_HEX_CONST(8000);
+ CHECK_OCT_CONST(0177777);
+ CHECK_HEX_CONST(ffff);
+ CHECK_OCT_CONST(0200000);
+ CHECK_HEX_CONST(10000);
+ CHECK_OCT_CONST(0377777);
+ CHECK_HEX_CONST(1ffff);
+ CHECK_OCT_CONST(0400000);
+ CHECK_HEX_CONST(20000);
+ CHECK_OCT_CONST(0777777);
+ CHECK_HEX_CONST(3ffff);
+ CHECK_OCT_CONST(01000000);
+ CHECK_HEX_CONST(40000);
+ CHECK_OCT_CONST(01777777);
+ CHECK_HEX_CONST(7ffff);
+ CHECK_OCT_CONST(02000000);
+ CHECK_HEX_CONST(80000);
+ CHECK_OCT_CONST(03777777);
+ CHECK_HEX_CONST(fffff);
+ CHECK_OCT_CONST(04000000);
+ CHECK_HEX_CONST(100000);
+ CHECK_OCT_CONST(07777777);
+ CHECK_HEX_CONST(1fffff);
+ CHECK_OCT_CONST(010000000);
+ CHECK_HEX_CONST(200000);
+ CHECK_OCT_CONST(017777777);
+ CHECK_HEX_CONST(3fffff);
+ CHECK_OCT_CONST(020000000);
+ CHECK_HEX_CONST(400000);
+ CHECK_OCT_CONST(037777777);
+ CHECK_HEX_CONST(7fffff);
+ CHECK_OCT_CONST(040000000);
+ CHECK_HEX_CONST(800000);
+ CHECK_OCT_CONST(077777777);
+ CHECK_HEX_CONST(ffffff);
+ CHECK_OCT_CONST(0100000000);
+ CHECK_HEX_CONST(1000000);
+ CHECK_OCT_CONST(0177777777);
+ CHECK_HEX_CONST(1ffffff);
+ CHECK_OCT_CONST(0200000000);
+ CHECK_HEX_CONST(2000000);
+ CHECK_OCT_CONST(0377777777);
+ CHECK_HEX_CONST(3ffffff);
+ CHECK_OCT_CONST(0400000000);
+ CHECK_HEX_CONST(4000000);
+ CHECK_OCT_CONST(0777777777);
+ CHECK_HEX_CONST(7ffffff);
+ CHECK_OCT_CONST(01000000000);
+ CHECK_HEX_CONST(8000000);
+ CHECK_OCT_CONST(01777777777);
+ CHECK_HEX_CONST(fffffff);
+ CHECK_OCT_CONST(02000000000);
+ CHECK_HEX_CONST(10000000);
+ CHECK_OCT_CONST(03777777777);
+ CHECK_HEX_CONST(1fffffff);
+ CHECK_OCT_CONST(04000000000);
+ CHECK_HEX_CONST(20000000);
+ CHECK_OCT_CONST(07777777777);
+ CHECK_HEX_CONST(3fffffff);
+ CHECK_OCT_CONST(010000000000);
+ CHECK_HEX_CONST(40000000);
+ CHECK_OCT_CONST(017777777777);
+ CHECK_HEX_CONST(7fffffff);
+ CHECK_OCT_CONST(020000000000);
+ CHECK_HEX_CONST(80000000);
+ CHECK_OCT_CONST(037777777777);
+ CHECK_HEX_CONST(ffffffff);
+ CHECK_OCT_CONST(040000000000);
+ CHECK_HEX_CONST(100000000);
+ CHECK_OCT_CONST(077777777777);
+ CHECK_HEX_CONST(1ffffffff);
+ CHECK_OCT_CONST(0100000000000);
+ CHECK_HEX_CONST(200000000);
+ CHECK_OCT_CONST(0177777777777);
+ CHECK_HEX_CONST(3ffffffff);
+ CHECK_OCT_CONST(0200000000000);
+ CHECK_HEX_CONST(400000000);
+ CHECK_OCT_CONST(0377777777777);
+ CHECK_HEX_CONST(7ffffffff);
+ CHECK_OCT_CONST(0400000000000);
+ CHECK_HEX_CONST(800000000);
+ CHECK_OCT_CONST(0777777777777);
+ CHECK_HEX_CONST(fffffffff);
+ CHECK_OCT_CONST(01000000000000);
+ CHECK_HEX_CONST(1000000000);
+ CHECK_OCT_CONST(01777777777777);
+ CHECK_HEX_CONST(1fffffffff);
+ CHECK_OCT_CONST(02000000000000);
+ CHECK_HEX_CONST(2000000000);
+ CHECK_OCT_CONST(03777777777777);
+ CHECK_HEX_CONST(3fffffffff);
+ CHECK_OCT_CONST(04000000000000);
+ CHECK_HEX_CONST(4000000000);
+ CHECK_OCT_CONST(07777777777777);
+ CHECK_HEX_CONST(7fffffffff);
+ CHECK_OCT_CONST(010000000000000);
+ CHECK_HEX_CONST(8000000000);
+ CHECK_OCT_CONST(017777777777777);
+ CHECK_HEX_CONST(ffffffffff);
+ CHECK_OCT_CONST(020000000000000);
+ CHECK_HEX_CONST(10000000000);
+ CHECK_OCT_CONST(037777777777777);
+ CHECK_HEX_CONST(1ffffffffff);
+ CHECK_OCT_CONST(040000000000000);
+ CHECK_HEX_CONST(20000000000);
+ CHECK_OCT_CONST(077777777777777);
+ CHECK_HEX_CONST(3ffffffffff);
+ CHECK_OCT_CONST(0100000000000000);
+ CHECK_HEX_CONST(40000000000);
+ CHECK_OCT_CONST(0177777777777777);
+ CHECK_HEX_CONST(7ffffffffff);
+ CHECK_OCT_CONST(0200000000000000);
+ CHECK_HEX_CONST(80000000000);
+ CHECK_OCT_CONST(0377777777777777);
+ CHECK_HEX_CONST(fffffffffff);
+ CHECK_OCT_CONST(0400000000000000);
+ CHECK_HEX_CONST(100000000000);
+ CHECK_OCT_CONST(0777777777777777);
+ CHECK_HEX_CONST(1fffffffffff);
+ CHECK_OCT_CONST(01000000000000000);
+ CHECK_HEX_CONST(200000000000);
+ CHECK_OCT_CONST(01777777777777777);
+ CHECK_HEX_CONST(3fffffffffff);
+ CHECK_OCT_CONST(02000000000000000);
+ CHECK_HEX_CONST(400000000000);
+ CHECK_OCT_CONST(03777777777777777);
+ CHECK_HEX_CONST(7fffffffffff);
+ CHECK_OCT_CONST(04000000000000000);
+ CHECK_HEX_CONST(800000000000);
+ CHECK_OCT_CONST(07777777777777777);
+ CHECK_HEX_CONST(ffffffffffff);
+ CHECK_OCT_CONST(010000000000000000);
+ CHECK_HEX_CONST(1000000000000);
+ CHECK_OCT_CONST(017777777777777777);
+ CHECK_HEX_CONST(1ffffffffffff);
+ CHECK_OCT_CONST(020000000000000000);
+ CHECK_HEX_CONST(2000000000000);
+ CHECK_OCT_CONST(037777777777777777);
+ CHECK_HEX_CONST(3ffffffffffff);
+ CHECK_OCT_CONST(040000000000000000);
+ CHECK_HEX_CONST(4000000000000);
+ CHECK_OCT_CONST(077777777777777777);
+ CHECK_HEX_CONST(7ffffffffffff);
+ CHECK_OCT_CONST(0100000000000000000);
+ CHECK_HEX_CONST(8000000000000);
+ CHECK_OCT_CONST(0177777777777777777);
+ CHECK_HEX_CONST(fffffffffffff);
+ CHECK_OCT_CONST(0200000000000000000);
+ CHECK_HEX_CONST(10000000000000);
+ CHECK_OCT_CONST(0377777777777777777);
+ CHECK_HEX_CONST(1fffffffffffff);
+ CHECK_OCT_CONST(0400000000000000000);
+ CHECK_HEX_CONST(20000000000000);
+ CHECK_OCT_CONST(0777777777777777777);
+ CHECK_HEX_CONST(3fffffffffffff);
+ CHECK_OCT_CONST(01000000000000000000);
+ CHECK_HEX_CONST(40000000000000);
+ CHECK_OCT_CONST(01777777777777777777);
+ CHECK_HEX_CONST(7fffffffffffff);
+ CHECK_OCT_CONST(02000000000000000000);
+ CHECK_HEX_CONST(80000000000000);
+ CHECK_OCT_CONST(03777777777777777777);
+ CHECK_HEX_CONST(ffffffffffffff);
+ CHECK_OCT_CONST(04000000000000000000);
+ CHECK_HEX_CONST(100000000000000);
+ CHECK_OCT_CONST(07777777777777777777);
+ CHECK_HEX_CONST(1ffffffffffffff);
+ CHECK_OCT_CONST(010000000000000000000);
+ CHECK_HEX_CONST(200000000000000);
+ CHECK_OCT_CONST(017777777777777777777);
+ CHECK_HEX_CONST(3ffffffffffffff);
+ CHECK_OCT_CONST(020000000000000000000);
+ CHECK_HEX_CONST(400000000000000);
+ CHECK_OCT_CONST(037777777777777777777);
+ CHECK_HEX_CONST(7ffffffffffffff);
+ CHECK_OCT_CONST(040000000000000000000);
+ CHECK_HEX_CONST(800000000000000);
+ CHECK_OCT_CONST(077777777777777777777);
+ CHECK_HEX_CONST(fffffffffffffff);
+ CHECK_OCT_CONST(0100000000000000000000);
+ CHECK_HEX_CONST(1000000000000000);
+ CHECK_OCT_CONST(0177777777777777777777);
+ CHECK_HEX_CONST(1fffffffffffffff);
+ CHECK_OCT_CONST(0200000000000000000000);
+ CHECK_HEX_CONST(2000000000000000);
+ CHECK_OCT_CONST(0377777777777777777777);
+ CHECK_HEX_CONST(3fffffffffffffff);
+ CHECK_OCT_CONST(0400000000000000000000);
+ CHECK_HEX_CONST(4000000000000000);
+ CHECK_OCT_CONST(0777777777777777777777);
+ CHECK_HEX_CONST(7fffffffffffffff);
+ CHECK_OCT_CONST(01000000000000000000000);
+ CHECK_HEX_CONST(8000000000000000);
+ CHECK_OCT_CONST(01777777777777777777777);
+ CHECK_HEX_CONST(ffffffffffffffff);
+#if LLONG_AT_LEAST(65)
+ CHECK_OCT_CONST(02000000000000000000000);
+ CHECK_HEX_CONST(10000000000000000);
+ CHECK_OCT_CONST(03777777777777777777777);
+ CHECK_HEX_CONST(1ffffffffffffffff);
+#endif
+#if LLONG_AT_LEAST(66)
+ CHECK_OCT_CONST(04000000000000000000000);
+ CHECK_HEX_CONST(20000000000000000);
+ CHECK_OCT_CONST(07777777777777777777777);
+ CHECK_HEX_CONST(3ffffffffffffffff);
+#endif
+#if LLONG_AT_LEAST(67)
+ CHECK_OCT_CONST(010000000000000000000000);
+ CHECK_HEX_CONST(40000000000000000);
+ CHECK_OCT_CONST(017777777777777777777777);
+ CHECK_HEX_CONST(7ffffffffffffffff);
+#endif
+#if LLONG_AT_LEAST(68)
+ CHECK_OCT_CONST(020000000000000000000000);
+ CHECK_HEX_CONST(80000000000000000);
+ CHECK_OCT_CONST(037777777777777777777777);
+ CHECK_HEX_CONST(fffffffffffffffff);
+#endif
+#if LLONG_AT_LEAST(69)
+ CHECK_OCT_CONST(040000000000000000000000);
+ CHECK_HEX_CONST(100000000000000000);
+ CHECK_OCT_CONST(077777777777777777777777);
+ CHECK_HEX_CONST(1fffffffffffffffff);
+#endif
+#if LLONG_AT_LEAST(70)
+ CHECK_OCT_CONST(0100000000000000000000000);
+ CHECK_HEX_CONST(200000000000000000);
+ CHECK_OCT_CONST(0177777777777777777777777);
+ CHECK_HEX_CONST(3fffffffffffffffff);
+#endif
+#if LLONG_AT_LEAST(71)
+ CHECK_OCT_CONST(0200000000000000000000000);
+ CHECK_HEX_CONST(400000000000000000);
+ CHECK_OCT_CONST(0377777777777777777777777);
+ CHECK_HEX_CONST(7fffffffffffffffff);
+#endif
+#if LLONG_AT_LEAST(72)
+ CHECK_OCT_CONST(0400000000000000000000000);
+ CHECK_HEX_CONST(800000000000000000);
+ CHECK_OCT_CONST(0777777777777777777777777);
+ CHECK_HEX_CONST(ffffffffffffffffff);
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-intconst-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-intconst-2.c
new file mode 100644
index 000000000..349236757
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-intconst-2.c
@@ -0,0 +1,8 @@
+/* Test for integer constant types: diagnostics for constants outside
+ range of intmax_t must be pedwarns. PR 39559. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#if 9223372036854775808LL /* { dg-error "integer constant is so large that it is unsigned" } */
+unsigned long long l = 9223372036854775808LL; /* { dg-error "integer constant is so large that it is unsigned" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-intprom-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-intprom-1.c
new file mode 100644
index 000000000..0d7a33ee8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-intprom-1.c
@@ -0,0 +1,77 @@
+/* Test for integer promotion rules: extended to long long by C99. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#include <limits.h>
+
+#define CHECK(T1, T2, TC) \
+ do { \
+ T1 a = 0; \
+ T2 b = 0; \
+ TC *c = 0; \
+ __typeof__(a+b) *d = 0; \
+ c = d; \
+ d = c; \
+ } while (0)
+
+void
+f (void)
+{
+ /* Same type. */
+ CHECK(int, int, int);
+ CHECK(unsigned int, unsigned int, unsigned int);
+ CHECK(long, long, long);
+ CHECK(unsigned long, unsigned long, unsigned long);
+ CHECK(long long, long long, long long);
+ CHECK(unsigned long long, unsigned long long, unsigned long long);
+ /* Both signed. */
+ CHECK(int, long, long);
+ CHECK(int, long long, long long);
+ CHECK(long, int, long);
+ CHECK(long, long long, long long);
+ CHECK(long long, int, long long);
+ CHECK(long long, long, long long);
+ /* Both unsigned. */
+ CHECK(unsigned int, unsigned long, unsigned long);
+ CHECK(unsigned int, unsigned long long, unsigned long long);
+ CHECK(unsigned long, unsigned int, unsigned long);
+ CHECK(unsigned long, unsigned long long, unsigned long long);
+ CHECK(unsigned long long, unsigned int, unsigned long long);
+ CHECK(unsigned long long, unsigned long, unsigned long long);
+ /* Unsigned of greater or equal rank. */
+ CHECK(int, unsigned int, unsigned int);
+ CHECK(int, unsigned long, unsigned long);
+ CHECK(int, unsigned long long, unsigned long long);
+ CHECK(unsigned int, int, unsigned int);
+ CHECK(long, unsigned long, unsigned long);
+ CHECK(long, unsigned long long, unsigned long long);
+ CHECK(unsigned long, int, unsigned long);
+ CHECK(unsigned long, long, unsigned long);
+ CHECK(long long, unsigned long long, unsigned long long);
+ CHECK(unsigned long long, int, unsigned long long);
+ CHECK(unsigned long long, long, unsigned long long);
+ CHECK(unsigned long long, long long, unsigned long long);
+ /* Signed of greater rank. */
+#if LONG_MAX >= UINT_MAX
+ CHECK(unsigned int, long, long);
+ CHECK(long, unsigned int, long);
+#else
+ CHECK(unsigned int, long, unsigned long);
+ CHECK(long, unsigned int, unsigned long);
+#endif
+#if LLONG_MAX >= UINT_MAX
+ CHECK(unsigned int, long long, long long);
+ CHECK(long long, unsigned int, long long);
+#else
+ CHECK(unsigned int, long long, unsigned long long);
+ CHECK(long long, unsigned int, unsigned long long);
+#endif
+#if LLONG_MAX >= ULONG_MAX
+ CHECK(unsigned long, long long, long long);
+ CHECK(long long, unsigned long, long long);
+#else
+ CHECK(unsigned long, long long, unsigned long long);
+ CHECK(long long, unsigned long, unsigned long long);
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-longlong-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-longlong-1.c
new file mode 100644
index 000000000..92d5e0e80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-longlong-1.c
@@ -0,0 +1,6 @@
+/* Test for long long: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+long long foo; /* { dg-bogus "long long" "bogus long long error" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-longlong-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-longlong-2.c
new file mode 100644
index 000000000..fc6c8a5ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-longlong-2.c
@@ -0,0 +1,6 @@
+/* Test for long long: if explicit Wlong-long, in C99 only warn, not
+ pedwarn. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors -Wlong-long" } */
+
+long long foo; /* { dg-warning "long long" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-main-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-main-1.c
new file mode 100644
index 000000000..fdef9fd36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-main-1.c
@@ -0,0 +1,9 @@
+/* Test for implicit return 0 from main in C99. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors -Wreturn-type -O -fhosted" } */
+
+int
+main (void)
+{
+} /* { dg-bogus "control reaches end" "missing implicit return" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-double-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-double-1.c
new file mode 100644
index 000000000..6441a59fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-double-1.c
@@ -0,0 +1,22 @@
+/* { dg-do run { target *-*-solaris2.1[0-9]* } } */
+/* { dg-options "-std=c99 -O" } */
+
+#include <math.h>
+#include "c99-math.h"
+
+int main(void)
+{
+ volatile double nan = NAN;
+ volatile double inf = INFINITY;
+ volatile double huge = HUGE_VAL;
+ volatile double norm1 = __DBL_MIN__;
+ volatile double norm2 = 1;
+ volatile double norm3 = __DBL_MAX__;
+ volatile double sub = __DBL_MIN__ / 2;
+ volatile double zero = 0.0;
+
+ C99_MATH_TESTS (nan, inf, huge, norm1, norm2, norm3, sub, zero, /*neg=*/0)
+ C99_MATH_TESTS (-nan, -inf, -huge, -norm1, -norm2, -norm3, -sub, -zero, /*neg=*/1)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-float-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-float-1.c
new file mode 100644
index 000000000..36a739602
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-float-1.c
@@ -0,0 +1,22 @@
+/* { dg-do run { target *-*-solaris2.1[0-9]* } } */
+/* { dg-options "-std=c99 -O" } */
+
+#include <math.h>
+#include "c99-math.h"
+
+int main(void)
+{
+ volatile float nan = NAN;
+ volatile float inf = INFINITY;
+ volatile float huge = HUGE_VALF;
+ volatile float norm1 = __FLT_MIN__;
+ volatile float norm2 = 1;
+ volatile float norm3 = __FLT_MAX__;
+ volatile float sub = __FLT_MIN__ / 2;
+ volatile float zero = 0.0f;
+
+ C99_MATH_TESTS (nan, inf, huge, norm1, norm2, norm3, sub, zero, /*neg=*/0)
+ C99_MATH_TESTS (-nan, -inf, -huge, -norm1, -norm2, -norm3, -sub, -zero, /*neg=*/1)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-long-double-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-long-double-1.c
new file mode 100644
index 000000000..d8146c28a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-math-long-double-1.c
@@ -0,0 +1,22 @@
+/* { dg-do run { target *-*-solaris2.1[0-9]* } } */
+/* { dg-options "-std=c99 -O" } */
+
+#include <math.h>
+#include "c99-math.h"
+
+int main(void)
+{
+ volatile long double nan = NAN;
+ volatile long double inf = INFINITY;
+ volatile long double huge = HUGE_VALL;
+ volatile long double norm1 = __LDBL_MIN__;
+ volatile long double norm2 = 1;
+ volatile long double norm3 = __LDBL_MAX__;
+ volatile long double sub = __LDBL_MIN__ / 2;
+ volatile long double zero = 0.0l;
+
+ C99_MATH_TESTS (nan, inf, huge, norm1, norm2, norm3, sub, zero, /*neg=*/0)
+ C99_MATH_TESTS (-nan, -inf, -huge, -norm1, -norm2, -norm3, -sub, -zero, /*neg=*/1)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-math.h b/gcc-4.9/gcc/testsuite/gcc.dg/c99-math.h
new file mode 100644
index 000000000..81f2e6ddb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-math.h
@@ -0,0 +1,236 @@
+#include <math.h>
+#include <fenv.h>
+
+extern void abort(void);
+
+#define C99_MATH_TESTS(nan, inf, huge, norm1, norm2, norm3, sub, zero, neg) \
+{ \
+ if (feclearexcept (FE_ALL_EXCEPT) != 0) \
+ abort(); \
+ \
+ \
+ if (fpclassify (nan) != FP_NAN) \
+ abort (); \
+ \
+ if (fpclassify (inf) != FP_INFINITE) \
+ abort (); \
+ \
+ if (fpclassify (huge) != FP_INFINITE) \
+ abort (); \
+ \
+ if (fpclassify (norm1) != FP_NORMAL) \
+ abort (); \
+ \
+ if (fpclassify (norm2) != FP_NORMAL) \
+ abort (); \
+ \
+ if (fpclassify (norm3) != FP_NORMAL) \
+ abort (); \
+ \
+ if (fpclassify (sub) != FP_SUBNORMAL) \
+ abort (); \
+ \
+ if (fpclassify (zero) != FP_ZERO) \
+ abort (); \
+ \
+ \
+ if (!isnan (nan)) \
+ abort (); \
+ \
+ if (isnan (inf)) \
+ abort (); \
+ \
+ if (isnan (huge)) \
+ abort (); \
+ \
+ if (isnan (norm1)) \
+ abort (); \
+ \
+ if (isnan (norm2)) \
+ abort (); \
+ \
+ if (isnan (norm3)) \
+ abort (); \
+ \
+ if (isnan (sub)) \
+ abort (); \
+ \
+ if (isnan (zero)) \
+ abort (); \
+ \
+ \
+ if (isinf (nan)) \
+ abort (); \
+ \
+ if (!isinf (inf)) \
+ abort (); \
+ \
+ if (!isinf (huge)) \
+ abort (); \
+ \
+ if (isinf (norm1)) \
+ abort (); \
+ \
+ if (isinf (norm2)) \
+ abort (); \
+ \
+ if (isinf (norm3)) \
+ abort (); \
+ \
+ if (isinf (sub)) \
+ abort (); \
+ \
+ if (isinf (zero)) \
+ abort (); \
+ \
+ \
+ if (isfinite (nan)) \
+ abort (); \
+ \
+ if (isfinite (inf)) \
+ abort (); \
+ \
+ if (isfinite (huge)) \
+ abort (); \
+ \
+ if (!isfinite (norm1)) \
+ abort (); \
+ \
+ if (!isfinite (norm2)) \
+ abort (); \
+ \
+ if (!isfinite (norm3)) \
+ abort (); \
+ \
+ if (!isfinite (sub)) \
+ abort (); \
+ \
+ if (!isfinite (zero)) \
+ abort (); \
+ \
+ \
+ if (isnormal (nan)) \
+ abort (); \
+ \
+ if (isnormal (inf)) \
+ abort (); \
+ \
+ if (isnormal (huge)) \
+ abort (); \
+ \
+ if (!isnormal (norm1)) \
+ abort (); \
+ \
+ if (!isnormal (norm2)) \
+ abort (); \
+ \
+ if (!isnormal (norm3)) \
+ abort (); \
+ \
+ if (isnormal (sub)) \
+ abort (); \
+ \
+ if (isnormal (zero)) \
+ abort (); \
+ \
+ \
+ if (!!signbit (nan) != neg) \
+ abort (); \
+ \
+ if (!!signbit (inf) != neg) \
+ abort (); \
+ \
+ if (!!signbit (huge) != neg) \
+ abort (); \
+ \
+ if (!!signbit (norm1) != neg) \
+ abort (); \
+ \
+ if (!!signbit (norm2) != neg) \
+ abort (); \
+ \
+ if (!!signbit (norm3) != neg) \
+ abort (); \
+ \
+ if (!!signbit (sub) != neg) \
+ abort (); \
+ \
+ if (!!signbit (zero) != neg) \
+ abort (); \
+ \
+ \
+ if (neg) \
+ { \
+ if (!isless ((inf), (norm1))) \
+ abort (); \
+ \
+ if (!isless ((inf), (norm2))) \
+ abort (); \
+ \
+ if (!isless ((inf), (norm3))) \
+ abort (); \
+ \
+ if (!islessequal ((inf), (huge))) \
+ abort (); \
+ \
+ if (!isgreater ((norm1), (inf))) \
+ abort (); \
+ \
+ if (!isgreater ((norm2), (inf))) \
+ abort (); \
+ \
+ if (!isgreater ((norm3), (inf))) \
+ abort (); \
+ \
+ if (!isgreaterequal ((huge), (inf))) \
+ abort (); \
+ } \
+ else \
+ { \
+ if (!isgreater ((inf), (norm1))) \
+ abort (); \
+ \
+ if (!isgreater ((inf), (norm2))) \
+ abort (); \
+ \
+ if (!isgreater ((inf), (norm3))) \
+ abort (); \
+ \
+ if (!isgreaterequal ((inf), (huge))) \
+ abort (); \
+ \
+ if (!isless ((norm1), (inf))) \
+ abort (); \
+ \
+ if (!isless ((norm2), (inf))) \
+ abort (); \
+ \
+ if (!isless ((norm3), (inf))) \
+ abort (); \
+ \
+ if (!islessequal ((huge), (inf))) \
+ abort (); \
+ } \
+ \
+ if (!islessgreater ((inf), (norm1))) \
+ abort (); \
+ \
+ if (!islessgreater ((inf), (norm2))) \
+ abort (); \
+ \
+ if (!islessgreater ((inf), (norm3))) \
+ abort (); \
+ \
+ if (!isunordered ((nan), (norm1))) \
+ abort (); \
+ \
+ if (!isunordered ((nan), (norm2))) \
+ abort (); \
+ \
+ if (!isunordered ((nan), (norm3))) \
+ abort (); \
+ \
+ \
+ if (fetestexcept (FE_ALL_EXCEPT) != 0) \
+ abort(); \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-mixdecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-mixdecl-1.c
new file mode 100644
index 000000000..cfedad44c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-mixdecl-1.c
@@ -0,0 +1,25 @@
+/* Test for C99 mixed declarations and code. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i = 0;
+ if (i != 0)
+ abort ();
+ i++;
+ if (i != 1)
+ abort ();
+ int j = i;
+ if (j != 1)
+ abort ();
+ struct foo { int i0; } k = { 4 };
+ if (k.i0 != 4)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-noreturn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-noreturn-1.c
new file mode 100644
index 000000000..4cbc51359
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-noreturn-1.c
@@ -0,0 +1,5 @@
+/* Test _Noreturn not in C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+_Noreturn void f (void); /* { dg-error "ISO C99 does not support '_Noreturn'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-predef-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-predef-1.c
new file mode 100644
index 000000000..b90776457
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-predef-1.c
@@ -0,0 +1,63 @@
+/* Verify that predefined macros for properties of the compiler and
+ library together are the same before and after system headers are
+ included. This is broken with older glibc versions. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#ifdef __STDC_IEC_559__
+#define IEC_559_DEFINED_BEFORE 1
+#else
+#define IEC_559_DEFINED_BEFORE 0
+#endif
+
+#ifdef __STDC_IEC_559_COMPLEX__
+#define IEC_559_COMPLEX_DEFINED_BEFORE 1
+#else
+#define IEC_559_COMPLEX_DEFINED_BEFORE 0
+#endif
+
+#ifdef __STDC_ISO_10646__
+#define ISO_10646_DEFINED_BEFORE 1
+#else
+#define ISO_10646_DEFINED_BEFORE 0
+#endif
+
+#include <stdio.h>
+
+#ifdef __STDC_IEC_559__
+#define IEC_559_DEFINED_AFTER 1
+#else
+#define IEC_559_DEFINED_AFTER 0
+#endif
+
+#ifdef __STDC_IEC_559_COMPLEX__
+#define IEC_559_COMPLEX_DEFINED_AFTER 1
+#else
+#define IEC_559_COMPLEX_DEFINED_AFTER 0
+#endif
+
+#ifdef __STDC_ISO_10646__
+#define ISO_10646_DEFINED_AFTER 1
+#else
+#define ISO_10646_DEFINED_AFTER 0
+#endif
+
+#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 16))
+#define BROKEN
+#endif
+
+#ifndef BROKEN
+
+#if IEC_559_DEFINED_BEFORE != IEC_559_DEFINED_AFTER
+#error "__STDC_IEC_559__ definition inconsistency"
+#endif
+
+#if IEC_559_COMPLEX_DEFINED_BEFORE != IEC_559_COMPLEX_DEFINED_AFTER
+#error "__STDC_IEC_559_COMPLEX__ definition inconsistency"
+#endif
+
+#if ISO_10646_DEFINED_BEFORE != ISO_10646_DEFINED_AFTER
+#error "__STDC_ISO_10646__ definition inconsistency"
+#endif
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-1.c
new file mode 100644
index 000000000..30ddd96bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-1.c
@@ -0,0 +1,19 @@
+/* Test for restrict: in C99 only. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+char *restrict foo;
+
+/* The following are constraint violations and should be rejected. */
+
+int restrict bar; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "restrict" "restrict constraint violation" { target *-*-* } 10 } */
+
+typedef void (*fp) (void);
+
+fp restrict baz; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "restrict" "restrict constraint violation" { target *-*-* } 15 } */
+
+void quux (int restrict a[3]); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "restrict" "restrict constraint violation" { target *-*-* } 18 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-2.c
new file mode 100644
index 000000000..2adc5f2b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-2.c
@@ -0,0 +1,12 @@
+/* Test for restrict: in C99 only. Test handling of arrays of restricted
+ pointers. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef int *ipa[2];
+
+int *restrict x[2];
+restrict ipa y;
+
+void f(int *restrict a[2], restrict ipa b, int *restrict c[restrict]);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-3.c
new file mode 100644
index 000000000..e5200a57b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-3.c
@@ -0,0 +1,7 @@
+/* restrict qualifiers on non-pointers must be diagnosed even when
+ only a tag is being declared. PR 38243. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+restrict struct s; /* { dg-error "restrict" } */
+restrict union u; /* { dg-error "restrict" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-4.c
new file mode 100644
index 000000000..5852d0a11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-restrict-4.c
@@ -0,0 +1,17 @@
+/* Qualifiers lost when taking the address of a const restrict object.
+ PR 44322. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+void * restrict const a[2];
+void * restrict const (*p2)[2];
+
+void foo(void) {
+ p2 = &a;
+}
+
+void * restrict volatile b[2];
+void * restrict volatile (*q2)[2];
+
+void bar(void) {
+ q2 = &b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-return-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-return-1.c
new file mode 100644
index 000000000..017cf89a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-return-1.c
@@ -0,0 +1,18 @@
+/* Test for constraints on return statements. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+int
+foo (void)
+{
+ return; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "with no value" "return constraint violation" { target *-*-* } 9 } */
+}
+
+void
+bar (void)
+{
+ return 1; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "with a value" "return constraint violation" { target *-*-* } 16 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-scope-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-scope-1.c
new file mode 100644
index 000000000..48ea3b088
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-scope-1.c
@@ -0,0 +1,34 @@
+/* Test for new block scopes in C99. Inspired by C99 Rationale (N897). */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct foo {
+ char a;
+};
+
+extern void abort (void);
+extern void exit (int);
+
+int
+sfoo (void)
+{
+ if (sizeof (struct foo { int a; double b; char *c; void *d; }))
+ (void) 0;
+ return sizeof (struct foo);
+}
+
+int
+main (void)
+{
+ int t, u;
+ t = sfoo ();
+ u = sizeof (struct foo);
+ /* With C90 scoping rules the new declaration of struct foo is in scope
+ above; with C99 it is local to the if.
+ */
+ if (t == u)
+ exit (0); /* C99 rules apply. */
+ else
+ abort (); /* C90 rules apply. */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-scope-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-scope-2.c
new file mode 100644
index 000000000..86ac272a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-scope-2.c
@@ -0,0 +1,71 @@
+/* Test for new block scopes in C99. Test for each new scope. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ struct foo { int i0; };
+ int a, b, c, d;
+ a = sizeof (struct foo);
+ if (b = sizeof (struct foo { int i0; int i1; }))
+ c = sizeof (struct foo { int i0; int i1; int i2; });
+ if (!(a <= b && b <= c))
+ abort ();
+ if ((b = sizeof (struct foo { int i0; int i1; })), 0)
+ c = sizeof (struct foo { int i0; int i1; int i2; });
+ else
+ d = sizeof (struct foo { int i0; int i1; int i2; int i3; });
+ if (!(a <= b && b <= d))
+ abort ();
+ switch (b = sizeof (struct foo { int i0; int i1; }))
+ default:
+ c = sizeof (struct foo { int i0; int i1; int i2; });
+ if (!(a <= b && b <= c))
+ abort ();
+ do
+ c = sizeof (struct foo { int i0; int i1; int i2; });
+ while ((b = sizeof (struct foo { int i0; int i1; })), 0);
+ if (!(a <= b && b <= c))
+ abort ();
+ d = 1;
+ while ((b = sizeof (struct foo { int i0; int i1; })), d)
+ (c = sizeof (struct foo { int i0; int i1; int i2; })), d--;
+ if (!(a <= b && b <= c))
+ abort ();
+ d = 1;
+ for ((b = sizeof (struct foo { int i0; int i1; })); d; d--)
+ c = sizeof (struct foo { int i0; int i1; int i2; });
+ if (!(a <= b && b <= c))
+ abort ();
+ d = 1;
+ for ((b = sizeof (struct foo { int i0; int i1; })); d; d--)
+ c = sizeof (struct foo);
+ if (!(a <= b && b == c))
+ abort ();
+ d = 1;
+ for (; (b = sizeof (struct foo { int i0; int i1; })), d; d--)
+ c = sizeof (struct foo { int i0; int i1; int i2; });
+ if (!(a <= b && b <= c))
+ abort ();
+ d = 1;
+ for (; (b = sizeof (struct foo { int i0; int i1; })), d; d--)
+ c = sizeof (struct foo);
+ if (!(a <= b && b == c))
+ abort ();
+ d = 1;
+ for (; d; (b = sizeof (struct foo { int i0; int i1; })), d--)
+ c = sizeof (struct foo { int i0; int i1; int i2; });
+ if (!(a <= b && b <= c))
+ abort ();
+ d = 1;
+ for (; d; (b = sizeof (struct foo { int i0; int i1; })), d--)
+ c = sizeof (struct foo);
+ if (!(a <= b && b == c))
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-static-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-static-1.c
new file mode 100644
index 000000000..a138f878d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-static-1.c
@@ -0,0 +1,35 @@
+/* It is a constraint violation for a static function to be declared
+ but not defined if it is used except in a sizeof expression whose
+ result is an integer constant. The use of the function simply
+ being unevaluated is not enough. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=iso9899:1999 -pedantic-errors" } */
+
+/* Constraint violation (trivial case, where function is used). */
+static void f0(void); /* { dg-error "used but never defined" } */
+void g0(void) { f0(); }
+
+/* Constraint violation. */
+static void f1(void); /* { dg-error "used but never defined" } */
+void g1(void) { if (0) { f1(); } }
+
+/* Constraint violation. */
+static int f2(void); /* { dg-error "used but never defined" } */
+void g2(void) { 0 ? f2() : 0; }
+
+/* OK. */
+static int f3(void);
+void g3(void) { sizeof(f3()); }
+
+/* OK (VM type, not VLA). */
+static int f4(void);
+void g4(void) { sizeof(int (*)[f4()]); }
+
+/* Constraint violation (VLA). */
+static int f5(void); /* { dg-error "used but never defined" "VLA" } */
+void g5(void) { sizeof(int [0 ? f5() : 1]); }
+
+/* OK (non-constant sizeof inside constant sizeof). */
+static int f6(void);
+void g6(void) { sizeof(sizeof(int [f6()])); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-static-assert-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-static-assert-1.c
new file mode 100644
index 000000000..23477360e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-static-assert-1.c
@@ -0,0 +1,5 @@
+/* Test for static assertions not in C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+_Static_assert (1, ""); /* { dg-error "ISO C99 does not support '_Static_assert'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-1.c
new file mode 100644
index 000000000..530d13025
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-1.c
@@ -0,0 +1,270 @@
+/* Verify that <stdint.h> is present and follows the C99 requirements.
+ If this test fails because of the header being missing on a
+ particular target, this indicates GCC has not been correctly
+ configured regarding what version of <stdint.h> to install or what
+ the <stdint.h> types are on that target. If GCC is wrapping a
+ system copy of the header and some tests fail because of bugs in
+ that copy, they should be fixed with fixincludes (and the bugs
+ reported to maintainer of that copy if still present in the latest
+ version). */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors -fhosted" } */
+/* { dg-require-effective-target ptr32plus } */
+
+#include <limits.h>
+#include <stdint.h>
+/* This and the later SIG_ATOMIC_* tests should be appropriately
+ conditioned for any freestanding targets with no <signal.h>. */
+#ifndef SIGNAL_SUPPRESS
+#include <signal.h>
+#endif
+
+/* Note that some of these conditions assume two's complement and no
+ padding bits; GCC only supports two's complement, and no supported
+ target has padding bits in any integer type of the standard
+ widths. */
+#define CHECK_SIGNED(TYPE) \
+ do { TYPE a; int b[(TYPE)-1 < 0 ? 1 : -1]; } while (0)
+#define CHECK_UNSIGNED(TYPE) \
+ do { TYPE a; int b[(TYPE)-1 < 0 ? -1 : 1]; } while (0)
+#define CHECK_WIDTH_EQUALS(TYPE, WIDTH) \
+ do { int a[sizeof(TYPE) * CHAR_BIT == (WIDTH) ? 1 : -1]; } while (0)
+#define CHECK_WIDTH_AT_LEAST(TYPE, WIDTH) \
+ do { int a[sizeof(TYPE) * CHAR_BIT >= (WIDTH) ? 1 : -1]; } while (0)
+#define CHECK_WIDTH_ORDER(TYPE1, TYPE2) \
+ do { int a[sizeof(TYPE2) >= sizeof(TYPE1) ? 1 : -1]; } while (0)
+#define CHECK_EXPR_TYPE(TYPE, EXPR) \
+ do { __typeof__(EXPR) a; __typeof__((TYPE)0 + 0) *b = &a; } while (0)
+#define UNSIGNED_MAX_COND(TYPE, EXPR) \
+ ((EXPR) == (TYPE)-1)
+#define SIGNED_MIN_MAX_COND(TYPE, MIN, MAX) \
+ ((MIN) == -(MAX)-1 \
+ && ((MAX) & 1) \
+ && ((((MAX) >> 1) + 1) >> (sizeof(TYPE) * CHAR_BIT - 2)) == 1)
+#define MIN_MAX_COND(TYPE, MIN, MAX) \
+ ((TYPE)-1 < 0 \
+ ? SIGNED_MIN_MAX_COND(TYPE, (MIN), (MAX)) \
+ : ((MIN) == 0 && UNSIGNED_MAX_COND(TYPE, (MAX))))
+#define CHECK_SIGNED_LIMITS(TYPE, MIN, MAX) \
+ CHECK_SIGNED(TYPE); \
+ CHECK_EXPR_TYPE(TYPE, (MIN)); \
+ CHECK_EXPR_TYPE(TYPE, (MAX)); \
+ do { int a[SIGNED_MIN_MAX_COND(TYPE, (MIN), (MAX)) ? 1 : -1]; } while (0)
+#define CHECK_SIGNED_LIMITS_2(TYPE, MIN, MAX, MINBD, MAXBD) \
+ CHECK_SIGNED(TYPE); \
+ CHECK_EXPR_TYPE(TYPE, (MIN)); \
+ CHECK_EXPR_TYPE(TYPE, (MAX)); \
+ do { int a[(SIGNED_MIN_MAX_COND(TYPE, (MIN), (MAX)) \
+ && (MIN) <= (MINBD) \
+ && (MAX) >= (MAXBD)) ? 1 : -1]; } while (0)
+#define CHECK_UNSIGNED_LIMITS(TYPE, MAX) \
+ CHECK_UNSIGNED(TYPE); \
+ CHECK_EXPR_TYPE(TYPE, (MAX)); \
+ do { int a[UNSIGNED_MAX_COND(TYPE, (MAX)) ? 1 : -1]; } while (0)
+#define CHECK_UNSIGNED_LIMITS_2(TYPE, MAX, MAXBD) \
+ CHECK_UNSIGNED(TYPE); \
+ CHECK_EXPR_TYPE(TYPE, (MAX)); \
+ do { int a[(UNSIGNED_MAX_COND(TYPE, (MAX)) \
+ && (MAX) >= (MAXBD)) ? 1 : -1]; } while (0)
+#define CHECK_LIMITS_2(TYPE, MIN, MAX, SMINBD, SMAXBD, UMAXBD) \
+ do { int a[(MIN_MAX_COND(TYPE, (MIN), (MAX)) \
+ && ((TYPE)-1 < 0 \
+ ? ((MIN) <= (SMINBD) && (MAX) >= (SMAXBD)) \
+ : (MAX) >= (UMAXBD))) ? 1 : -1]; } while (0)
+#define CHECK_CONSTS(TYPE, MACRO) \
+ CHECK_EXPR_TYPE(TYPE, MACRO(01)); \
+ CHECK_EXPR_TYPE(TYPE, MACRO(2)); \
+ CHECK_EXPR_TYPE(TYPE, MACRO(0x3)); \
+ do { int a[(MACRO(12) == 12 \
+ && MACRO(012) == 012 \
+ && MACRO(0x12) == 0x12) ? 1 : -1]; } while (0);
+
+void
+test_exact (void)
+{
+#ifdef INT8_MIN
+ CHECK_WIDTH_EQUALS(int8_t, 8);
+ CHECK_SIGNED_LIMITS(int8_t, INT8_MIN, INT8_MAX);
+#else
+ CHECK_WIDTH_AT_LEAST(int_least8_t, 9);
+#endif
+#ifdef INT16_MIN
+ CHECK_WIDTH_EQUALS(int16_t, 16);
+ CHECK_SIGNED_LIMITS(int16_t, INT16_MIN, INT16_MAX);
+#else
+ CHECK_WIDTH_AT_LEAST(int_least16_t, 17);
+#endif
+#ifdef INT32_MIN
+ CHECK_WIDTH_EQUALS(int32_t, 32);
+ CHECK_SIGNED_LIMITS(int32_t, INT32_MIN, INT32_MAX);
+#else
+ CHECK_WIDTH_AT_LEAST(int_least32_t, 33);
+#endif
+#ifdef INT64_MIN
+ CHECK_WIDTH_EQUALS(int64_t, 64);
+ CHECK_SIGNED_LIMITS(int64_t, INT64_MIN, INT64_MAX);
+#else
+ CHECK_WIDTH_AT_LEAST(int_least64_t, 65);
+#endif
+#ifdef UINT8_MAX
+ CHECK_WIDTH_EQUALS(uint8_t, 8);
+ CHECK_UNSIGNED_LIMITS(uint8_t, UINT8_MAX);
+#else
+ CHECK_WIDTH_AT_LEAST(uint_least8_t, 9);
+#endif
+#ifdef UINT16_MAX
+ CHECK_WIDTH_EQUALS(uint16_t, 16);
+ CHECK_UNSIGNED_LIMITS(uint16_t, UINT16_MAX);
+#else
+ CHECK_WIDTH_AT_LEAST(uint_least16_t, 17);
+#endif
+#ifdef UINT32_MAX
+ CHECK_WIDTH_EQUALS(uint32_t, 32);
+ CHECK_UNSIGNED_LIMITS(uint32_t, UINT32_MAX);
+#else
+ CHECK_WIDTH_AT_LEAST(uint_least32_t, 33);
+#endif
+#ifdef UINT64_MAX
+ CHECK_WIDTH_EQUALS(uint64_t, 64);
+ CHECK_UNSIGNED_LIMITS(uint64_t, UINT64_MAX);
+#else
+ CHECK_WIDTH_AT_LEAST(uint_least64_t, 65);
+#endif
+}
+
+void
+test_least (void)
+{
+ CHECK_WIDTH_AT_LEAST(int_least8_t, 8);
+ CHECK_WIDTH_ORDER(int_least8_t, int_fast8_t);
+ CHECK_SIGNED_LIMITS(int_least8_t, INT_LEAST8_MIN, INT_LEAST8_MAX);
+ CHECK_WIDTH_AT_LEAST(int_least16_t, 16);
+ CHECK_WIDTH_ORDER(int_least16_t, int_fast16_t);
+ CHECK_SIGNED_LIMITS(int_least16_t, INT_LEAST16_MIN, INT_LEAST16_MAX);
+ CHECK_WIDTH_AT_LEAST(int_least32_t, 32);
+ CHECK_WIDTH_ORDER(int_least32_t, int_fast32_t);
+ CHECK_SIGNED_LIMITS(int_least32_t, INT_LEAST32_MIN, INT_LEAST32_MAX);
+ CHECK_WIDTH_AT_LEAST(int_least64_t, 64);
+ CHECK_WIDTH_ORDER(int_least64_t, int_fast64_t);
+ CHECK_SIGNED_LIMITS(int_least64_t, INT_LEAST64_MIN, INT_LEAST64_MAX);
+ CHECK_WIDTH_AT_LEAST(uint_least8_t, 8);
+ CHECK_WIDTH_ORDER(uint_least8_t, uint_fast8_t);
+ CHECK_UNSIGNED_LIMITS(uint_least8_t, UINT_LEAST8_MAX);
+ CHECK_WIDTH_AT_LEAST(uint_least16_t, 16);
+ CHECK_WIDTH_ORDER(uint_least16_t, uint_fast16_t);
+ CHECK_UNSIGNED_LIMITS(uint_least16_t, UINT_LEAST16_MAX);
+ CHECK_WIDTH_AT_LEAST(uint_least32_t, 32);
+ CHECK_WIDTH_ORDER(uint_least32_t, uint_fast32_t);
+ CHECK_UNSIGNED_LIMITS(uint_least32_t, UINT_LEAST32_MAX);
+ CHECK_WIDTH_AT_LEAST(uint_least64_t, 64);
+ CHECK_WIDTH_ORDER(uint_least64_t, uint_fast64_t);
+ CHECK_UNSIGNED_LIMITS(uint_least64_t, UINT_LEAST64_MAX);
+}
+
+void
+test_fast (void)
+{
+ CHECK_WIDTH_AT_LEAST(int_fast8_t, 8);
+ CHECK_SIGNED_LIMITS(int_fast8_t, INT_FAST8_MIN, INT_FAST8_MAX);
+ CHECK_WIDTH_AT_LEAST(int_fast16_t, 16);
+ CHECK_SIGNED_LIMITS(int_fast16_t, INT_FAST16_MIN, INT_FAST16_MAX);
+ CHECK_WIDTH_AT_LEAST(int_fast32_t, 32);
+ CHECK_SIGNED_LIMITS(int_fast32_t, INT_FAST32_MIN, INT_FAST32_MAX);
+ CHECK_WIDTH_AT_LEAST(int_fast64_t, 64);
+ CHECK_SIGNED_LIMITS(int_fast64_t, INT_FAST64_MIN, INT_FAST64_MAX);
+ CHECK_WIDTH_AT_LEAST(uint_fast8_t, 8);
+ CHECK_UNSIGNED_LIMITS(uint_fast8_t, UINT_FAST8_MAX);
+ CHECK_WIDTH_AT_LEAST(uint_fast16_t, 16);
+ CHECK_UNSIGNED_LIMITS(uint_fast16_t, UINT_FAST16_MAX);
+ CHECK_WIDTH_AT_LEAST(uint_fast32_t, 32);
+ CHECK_UNSIGNED_LIMITS(uint_fast32_t, UINT_FAST32_MAX);
+ CHECK_WIDTH_AT_LEAST(uint_fast64_t, 64);
+ CHECK_UNSIGNED_LIMITS(uint_fast64_t, UINT_FAST64_MAX);
+}
+
+void
+test_ptr (void)
+{
+#ifdef INTPTR_MIN
+ CHECK_SIGNED_LIMITS_2(intptr_t, INTPTR_MIN, INTPTR_MAX, -0x7fff, 0x7fff);
+#endif
+#ifdef UINTPTR_MAX
+ CHECK_UNSIGNED_LIMITS_2(uintptr_t, UINTPTR_MAX, 0xffffU);
+#endif
+}
+
+void
+test_max (void)
+{
+ CHECK_WIDTH_AT_LEAST(intmax_t, 64);
+ CHECK_WIDTH_ORDER(long long, intmax_t);
+ CHECK_WIDTH_ORDER(int_fast8_t, intmax_t);
+ CHECK_WIDTH_ORDER(int_fast16_t, intmax_t);
+ CHECK_WIDTH_ORDER(int_fast32_t, intmax_t);
+ CHECK_WIDTH_ORDER(int_fast64_t, intmax_t);
+ CHECK_SIGNED_LIMITS(intmax_t, INTMAX_MIN, INTMAX_MAX);
+ CHECK_WIDTH_AT_LEAST(uintmax_t, 64);
+ CHECK_WIDTH_ORDER(unsigned long long, uintmax_t);
+ CHECK_WIDTH_ORDER(uint_fast8_t, uintmax_t);
+ CHECK_WIDTH_ORDER(uint_fast16_t, uintmax_t);
+ CHECK_WIDTH_ORDER(uint_fast32_t, uintmax_t);
+ CHECK_WIDTH_ORDER(uint_fast64_t, uintmax_t);
+ CHECK_UNSIGNED_LIMITS(uintmax_t, UINTMAX_MAX);
+}
+
+void
+test_misc_limits (void)
+{
+ CHECK_SIGNED_LIMITS_2(__PTRDIFF_TYPE__, PTRDIFF_MIN, PTRDIFF_MAX, -65535L, 65535L);
+#ifndef SIGNAL_SUPPRESS
+ CHECK_LIMITS_2(sig_atomic_t, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX, -127, 127, 255);
+#endif
+ CHECK_UNSIGNED_LIMITS_2(__SIZE_TYPE__, SIZE_MAX, 65535U);
+ CHECK_LIMITS_2(__WCHAR_TYPE__, WCHAR_MIN, WCHAR_MAX, -127, 127, 255);
+ CHECK_LIMITS_2(__WINT_TYPE__, WINT_MIN, WINT_MAX, -32767, 32767, 65535);
+}
+
+void
+test_constants (void)
+{
+ CHECK_CONSTS(int_least8_t, INT8_C);
+ CHECK_CONSTS(int_least16_t, INT16_C);
+ CHECK_CONSTS(int_least32_t, INT32_C);
+ CHECK_CONSTS(int_least64_t, INT64_C);
+ CHECK_CONSTS(intmax_t, INTMAX_C);
+ CHECK_CONSTS(uint_least8_t, UINT8_C);
+ CHECK_CONSTS(uint_least16_t, UINT16_C);
+ CHECK_CONSTS(uint_least32_t, UINT32_C);
+ CHECK_CONSTS(uint_least64_t, UINT64_C);
+ CHECK_CONSTS(uintmax_t, UINTMAX_C);
+#if INT8_C(12) != 12
+#error "INT8_C not usable in #if"
+#endif
+#if INT16_C(12) != 12
+#error "INT16_C not usable in #if"
+#endif
+#if INT32_C(12) != 12
+#error "INT32_C not usable in #if"
+#endif
+#if INT64_C(12) != 12
+#error "INT64_C not usable in #if"
+#endif
+#if INTMAX_C(12) != 12
+#error "INTMAX_C not usable in #if"
+#endif
+#if UINT8_C(12) != 12
+#error "UINT8_C not usable in #if"
+#endif
+#if UINT16_C(12) != 12
+#error "UINT16_C not usable in #if"
+#endif
+#if UINT32_C(12) != 12
+#error "UINT32_C not usable in #if"
+#endif
+#if UINT64_C(12) != 12
+#error "UINT64_C not usable in #if"
+#endif
+#if UINTMAX_C(12) != 12
+#error "UINTMAX_C not usable in #if"
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-2.c
new file mode 100644
index 000000000..1784b0c41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-2.c
@@ -0,0 +1,8 @@
+/* Verify that <stdint.h> is present and follows the C99 requirements.
+ Freestanding version. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors -ffreestanding" } */
+/* { dg-require-effective-target ptr32plus } */
+/* The test is that there are no diagnostics, so just include the
+ hosted version. */
+#include "c99-stdint-1.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-3.c
new file mode 100644
index 000000000..c42ac8b9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-3.c
@@ -0,0 +1,39 @@
+/* Verify that pairs of types in <stdint.h> are corresponding types
+ (requires no pointer sign warnings, so separate from
+ c99-stdint-1.c). */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -fhosted" } */
+
+#include <stdint.h>
+
+#define CHECK_CORRESPONDING(TYPE1, TYPE2) \
+ do { TYPE1 a; TYPE2 *b = &a; TYPE2 c; TYPE1 *d = &c; } while (0)
+
+void
+check_corresponding (void)
+{
+#if defined(INT8_MAX) && defined(UINT8_MAX)
+ CHECK_CORRESPONDING(int8_t, uint8_t);
+#endif
+#if defined(INT16_MAX) && defined(UINT16_MAX)
+ CHECK_CORRESPONDING(int16_t, uint16_t);
+#endif
+#if defined(INT32_MAX) && defined(UINT32_MAX)
+ CHECK_CORRESPONDING(int32_t, uint32_t);
+#endif
+#if defined(INT64_MAX) && defined(UINT64_MAX)
+ CHECK_CORRESPONDING(int64_t, uint64_t);
+#endif
+ CHECK_CORRESPONDING(int_least8_t, uint_least8_t);
+ CHECK_CORRESPONDING(int_least16_t, uint_least16_t);
+ CHECK_CORRESPONDING(int_least32_t, uint_least32_t);
+ CHECK_CORRESPONDING(int_least64_t, uint_least64_t);
+ CHECK_CORRESPONDING(int_fast8_t, uint_fast8_t);
+ CHECK_CORRESPONDING(int_fast16_t, uint_fast16_t);
+ CHECK_CORRESPONDING(int_fast32_t, uint_fast32_t);
+ CHECK_CORRESPONDING(int_fast64_t, uint_fast64_t);
+#if defined(INTPTR_MAX) && defined(UINTPTR_MAX)
+ CHECK_CORRESPONDING(intptr_t, uintptr_t);
+#endif
+ CHECK_CORRESPONDING(intmax_t, uintmax_t);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-4.c
new file mode 100644
index 000000000..469df8cd8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-4.c
@@ -0,0 +1,8 @@
+/* Verify that pairs of types in <stdint.h> are corresponding types.
+ Freestanding version. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -ffreestanding" } */
+
+/* The test is that there are no diagnostics, so just include the
+ hosted version. */
+#include "c99-stdint-3.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-5.c
new file mode 100644
index 000000000..9c224edc1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-5.c
@@ -0,0 +1,69 @@
+/* Verify that GCC's internal notions of types in <stdint.h> agree
+ with any system header (which GCC will use by default for hosted
+ compilations). */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#include <stdint.h>
+#ifndef SIGNAL_SUPPRESS
+#include <signal.h>
+#endif
+
+#define CHECK_TYPES(TYPE1, TYPE2) \
+ do { TYPE1 a; TYPE2 *b = &a; TYPE2 c; TYPE1 *d = &c; } while (0)
+
+void
+check_types (void)
+{
+#ifdef __INT8_TYPE__
+ CHECK_TYPES(__INT8_TYPE__, int8_t);
+#endif
+#ifdef __INT16_TYPE__
+ CHECK_TYPES(__INT16_TYPE__, int16_t);
+#endif
+#ifdef __INT32_TYPE__
+ CHECK_TYPES(__INT32_TYPE__, int32_t);
+#endif
+#ifdef __INT64_TYPE__
+ CHECK_TYPES(__INT64_TYPE__, int64_t);
+#endif
+#ifdef __UINT8_TYPE__
+ CHECK_TYPES(__UINT8_TYPE__, uint8_t);
+#endif
+#ifdef __UINT16_TYPE__
+ CHECK_TYPES(__UINT16_TYPE__, uint16_t);
+#endif
+#ifdef __UINT32_TYPE__
+ CHECK_TYPES(__UINT32_TYPE__, uint32_t);
+#endif
+#ifdef __UINT64_TYPE__
+ CHECK_TYPES(__UINT64_TYPE__, uint64_t);
+#endif
+ CHECK_TYPES(__INT_LEAST8_TYPE__, int_least8_t);
+ CHECK_TYPES(__INT_LEAST16_TYPE__, int_least16_t);
+ CHECK_TYPES(__INT_LEAST32_TYPE__, int_least32_t);
+ CHECK_TYPES(__INT_LEAST64_TYPE__, int_least64_t);
+ CHECK_TYPES(__UINT_LEAST8_TYPE__, uint_least8_t);
+ CHECK_TYPES(__UINT_LEAST16_TYPE__, uint_least16_t);
+ CHECK_TYPES(__UINT_LEAST32_TYPE__, uint_least32_t);
+ CHECK_TYPES(__UINT_LEAST64_TYPE__, uint_least64_t);
+ CHECK_TYPES(__INT_FAST8_TYPE__, int_fast8_t);
+ CHECK_TYPES(__INT_FAST16_TYPE__, int_fast16_t);
+ CHECK_TYPES(__INT_FAST32_TYPE__, int_fast32_t);
+ CHECK_TYPES(__INT_FAST64_TYPE__, int_fast64_t);
+ CHECK_TYPES(__UINT_FAST8_TYPE__, uint_fast8_t);
+ CHECK_TYPES(__UINT_FAST16_TYPE__, uint_fast16_t);
+ CHECK_TYPES(__UINT_FAST32_TYPE__, uint_fast32_t);
+ CHECK_TYPES(__UINT_FAST64_TYPE__, uint_fast64_t);
+#ifdef __INTPTR_TYPE__
+ CHECK_TYPES(__INTPTR_TYPE__, intptr_t);
+#endif
+#ifdef __UINTPTR_TYPE__
+ CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
+#endif
+ CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
+ CHECK_TYPES(__UINTMAX_TYPE__, uintmax_t);
+#ifndef SIGNAL_SUPPRESS
+ CHECK_TYPES(__SIG_ATOMIC_TYPE__, sig_atomic_t);
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-6.c
new file mode 100644
index 000000000..b5727eebb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-6.c
@@ -0,0 +1,75 @@
+/* Verify that GCC's internal notions of types in <stdint.h> agree
+ with any system <inttypes.h> header. */
+/* { dg-do compile { target inttypes_types } } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+/* { dg-options "-std=gnu99 -pedantic-errors -DNO_FAST_TYPES" { target *-*-solaris2.9* } } */
+
+#include <inttypes.h>
+#ifndef SIGNAL_SUPPRESS
+#include <signal.h>
+#endif
+
+#define CHECK_TYPES(TYPE1, TYPE2) \
+ do { TYPE1 a; TYPE2 *b = &a; TYPE2 c; TYPE1 *d = &c; } while (0)
+
+void
+check_types (void)
+{
+#ifdef __INT8_TYPE__
+ CHECK_TYPES(__INT8_TYPE__, int8_t);
+#endif
+#ifdef __INT16_TYPE__
+ CHECK_TYPES(__INT16_TYPE__, int16_t);
+#endif
+#ifdef __INT32_TYPE__
+ CHECK_TYPES(__INT32_TYPE__, int32_t);
+#endif
+#ifdef __INT64_TYPE__
+ CHECK_TYPES(__INT64_TYPE__, int64_t);
+#endif
+#ifdef __UINT8_TYPE__
+ CHECK_TYPES(__UINT8_TYPE__, uint8_t);
+#endif
+#ifdef __UINT16_TYPE__
+ CHECK_TYPES(__UINT16_TYPE__, uint16_t);
+#endif
+#ifdef __UINT32_TYPE__
+ CHECK_TYPES(__UINT32_TYPE__, uint32_t);
+#endif
+#ifdef __UINT64_TYPE__
+ CHECK_TYPES(__UINT64_TYPE__, uint64_t);
+#endif
+#ifndef NO_LEAST_TYPES
+ CHECK_TYPES(__INT_LEAST8_TYPE__, int_least8_t);
+ CHECK_TYPES(__INT_LEAST16_TYPE__, int_least16_t);
+ CHECK_TYPES(__INT_LEAST32_TYPE__, int_least32_t);
+ CHECK_TYPES(__INT_LEAST64_TYPE__, int_least64_t);
+ CHECK_TYPES(__UINT_LEAST8_TYPE__, uint_least8_t);
+ CHECK_TYPES(__UINT_LEAST16_TYPE__, uint_least16_t);
+ CHECK_TYPES(__UINT_LEAST32_TYPE__, uint_least32_t);
+ CHECK_TYPES(__UINT_LEAST64_TYPE__, uint_least64_t);
+#endif
+#ifndef NO_FAST_TYPES
+ CHECK_TYPES(__INT_FAST8_TYPE__, int_fast8_t);
+ CHECK_TYPES(__INT_FAST16_TYPE__, int_fast16_t);
+ CHECK_TYPES(__INT_FAST32_TYPE__, int_fast32_t);
+ CHECK_TYPES(__INT_FAST64_TYPE__, int_fast64_t);
+ CHECK_TYPES(__UINT_FAST8_TYPE__, uint_fast8_t);
+ CHECK_TYPES(__UINT_FAST16_TYPE__, uint_fast16_t);
+ CHECK_TYPES(__UINT_FAST32_TYPE__, uint_fast32_t);
+ CHECK_TYPES(__UINT_FAST64_TYPE__, uint_fast64_t);
+#endif
+#ifdef __INTPTR_TYPE__
+ CHECK_TYPES(__INTPTR_TYPE__, intptr_t);
+#endif
+#ifdef __UINTPTR_TYPE__
+ CHECK_TYPES(__UINTPTR_TYPE__, uintptr_t);
+#endif
+#ifndef NO_MAX_TYPES
+ CHECK_TYPES(__INTMAX_TYPE__, intmax_t);
+ CHECK_TYPES(__UINTMAX_TYPE__, uintmax_t);
+#endif
+#ifndef SIGNAL_SUPPRESS
+ CHECK_TYPES(__SIG_ATOMIC_TYPE__, sig_atomic_t);
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-7.c
new file mode 100644
index 000000000..777e895b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-7.c
@@ -0,0 +1,217 @@
+/* Verify that the limits defined in <stdint.h> are those GCC expects
+ internally to be defined and that they are usable in #if
+ conditions. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -fhosted" } */
+
+#include <stdint.h>
+
+/* Exact-width and pointer-holding types are optional. */
+#if defined(INT8_MIN) != defined(__INT8_TYPE__)
+#error "Unexpected INT8_MIN definedness"
+#endif
+#if defined(INT8_MAX) != defined(__INT8_TYPE__)
+#error "Unexpected INT8_MAX definedness"
+#endif
+#if defined(UINT8_MAX) != defined(__UINT8_TYPE__)
+#error "Unexpected UINT8_MAX definedness"
+#endif
+#if defined(INT16_MIN) != defined(__INT16_TYPE__)
+#error "Unexpected INT16_MIN definedness"
+#endif
+#if defined(INT16_MAX) != defined(__INT16_TYPE__)
+#error "Unexpected INT16_MAX definedness"
+#endif
+#if defined(UINT16_MAX) != defined(__UINT16_TYPE__)
+#error "Unexpected UINT16_MAX definedness"
+#endif
+#if defined(INT32_MIN) != defined(__INT32_TYPE__)
+#error "Unexpected INT32_MIN definedness"
+#endif
+#if defined(INT32_MAX) != defined(__INT32_TYPE__)
+#error "Unexpected INT32_MAX definedness"
+#endif
+#if defined(UINT32_MAX) != defined(__UINT32_TYPE__)
+#error "Unexpected UINT32_MAX definedness"
+#endif
+#if defined(INT64_MIN) != defined(__INT64_TYPE__)
+#error "Unexpected INT64_MIN definedness"
+#endif
+#if defined(INT64_MAX) != defined(__INT64_TYPE__)
+#error "Unexpected INT64_MAX definedness"
+#endif
+#if defined(UINT64_MAX) != defined(__UINT64_TYPE__)
+#error "Unexpected UINT64_MAX definedness"
+#endif
+#if defined(INTPTR_MIN) != defined(__INTPTR_TYPE__)
+#error "Unexpected INTPTR_MIN definedness"
+#endif
+#if defined(INTPTR_MAX) != defined(__INTPTR_TYPE__)
+#error "Unexpected INTPTR_MAX definedness"
+#endif
+#if defined(UINTPTR_MAX) != defined(__UINTPTR_TYPE__)
+#error "Unexpected UINTPTR_MAX definedness"
+#endif
+
+#if defined(INT8_MIN) && INT8_MIN != -__INT8_MAX__-1
+#error "INT8_MIN not usable in #if or wrong value"
+#endif
+#if defined(INT8_MAX) && INT8_MAX != __INT8_MAX__
+#error "INT8_MAX not usable in #if or wrong value"
+#endif
+#if defined(UINT8_MAX) && UINT8_MAX != __UINT8_MAX__
+#error "UINT8_MAX not usable in #if or wrong value"
+#endif
+#if defined(INT16_MIN) && INT16_MIN != -__INT16_MAX__-1
+#error "INT16_MIN not usable in #if or wrong value"
+#endif
+#if defined(INT16_MAX) && INT16_MAX != __INT16_MAX__
+#error "INT16_MAX not usable in #if or wrong value"
+#endif
+#if defined(UINT16_MAX) && UINT16_MAX != __UINT16_MAX__
+#error "UINT16_MAX not usable in #if or wrong value"
+#endif
+#if defined(INT32_MIN) && INT32_MIN != -__INT32_MAX__-1
+#error "INT32_MIN not usable in #if or wrong value"
+#endif
+#if defined(INT32_MAX) && INT32_MAX != __INT32_MAX__
+#error "INT32_MAX not usable in #if or wrong value"
+#endif
+#if defined(UINT32_MAX) && UINT32_MAX != __UINT32_MAX__
+#error "UINT32_MAX not usable in #if or wrong value"
+#endif
+#if defined(INT64_MIN) && INT64_MIN != -__INT64_MAX__-1
+#error "INT64_MIN not usable in #if or wrong value"
+#endif
+#if defined(INT64_MAX) && INT64_MAX != __INT64_MAX__
+#error "INT64_MAX not usable in #if or wrong value"
+#endif
+#if defined(UINT64_MAX) && UINT64_MAX != __UINT64_MAX__
+#error "UINT64_MAX not usable in #if or wrong value"
+#endif
+
+#if INT_LEAST8_MIN != -__INT_LEAST8_MAX__-1
+#error "INT_LEAST8_MIN not usable in #if or wrong value"
+#endif
+#if INT_LEAST8_MAX != __INT_LEAST8_MAX__
+#error "INT_LEAST8_MAX not usable in #if or wrong value"
+#endif
+#if UINT_LEAST8_MAX != __UINT_LEAST8_MAX__
+#error "UINT_LEAST8_MAX not usable in #if or wrong value"
+#endif
+#if INT_LEAST16_MIN != -__INT_LEAST16_MAX__-1
+#error "INT_LEAST16_MIN not usable in #if or wrong value"
+#endif
+#if INT_LEAST16_MAX != __INT_LEAST16_MAX__
+#error "INT_LEAST16_MAX not usable in #if or wrong value"
+#endif
+#if UINT_LEAST16_MAX != __UINT_LEAST16_MAX__
+#error "UINT_LEAST16_MAX not usable in #if or wrong value"
+#endif
+#if INT_LEAST32_MIN != -__INT_LEAST32_MAX__-1
+#error "INT_LEAST32_MIN not usable in #if or wrong value"
+#endif
+#if INT_LEAST32_MAX != __INT_LEAST32_MAX__
+#error "INT_LEAST32_MAX not usable in #if or wrong value"
+#endif
+#if UINT_LEAST32_MAX != __UINT_LEAST32_MAX__
+#error "UINT_LEAST32_MAX not usable in #if or wrong value"
+#endif
+#if INT_LEAST64_MIN != -__INT_LEAST64_MAX__-1
+#error "INT_LEAST64_MIN not usable in #if or wrong value"
+#endif
+#if INT_LEAST64_MAX != __INT_LEAST64_MAX__
+#error "INT_LEAST64_MAX not usable in #if or wrong value"
+#endif
+#if UINT_LEAST64_MAX != __UINT_LEAST64_MAX__
+#error "UINT_LEAST64_MAX not usable in #if or wrong value"
+#endif
+
+#if INT_FAST8_MIN != -__INT_FAST8_MAX__-1
+#error "INT_FAST8_MIN not usable in #if or wrong value"
+#endif
+#if INT_FAST8_MAX != __INT_FAST8_MAX__
+#error "INT_FAST8_MAX not usable in #if or wrong value"
+#endif
+#if UINT_FAST8_MAX != __UINT_FAST8_MAX__
+#error "UINT_FAST8_MAX not usable in #if or wrong value"
+#endif
+#if INT_FAST16_MIN != -__INT_FAST16_MAX__-1
+#error "INT_FAST16_MIN not usable in #if or wrong value"
+#endif
+#if INT_FAST16_MAX != __INT_FAST16_MAX__
+#error "INT_FAST16_MAX not usable in #if or wrong value"
+#endif
+#if UINT_FAST16_MAX != __UINT_FAST16_MAX__
+#error "UINT_FAST16_MAX not usable in #if or wrong value"
+#endif
+#if INT_FAST32_MIN != -__INT_FAST32_MAX__-1
+#error "INT_FAST32_MIN not usable in #if or wrong value"
+#endif
+#if INT_FAST32_MAX != __INT_FAST32_MAX__
+#error "INT_FAST32_MAX not usable in #if or wrong value"
+#endif
+#if UINT_FAST32_MAX != __UINT_FAST32_MAX__
+#error "UINT_FAST32_MAX not usable in #if or wrong value"
+#endif
+#if INT_FAST64_MIN != -__INT_FAST64_MAX__-1
+#error "INT_FAST64_MIN not usable in #if or wrong value"
+#endif
+#if INT_FAST64_MAX != __INT_FAST64_MAX__
+#error "INT_FAST64_MAX not usable in #if or wrong value"
+#endif
+#if UINT_FAST64_MAX != __UINT_FAST64_MAX__
+#error "UINT_FAST64_MAX not usable in #if or wrong value"
+#endif
+
+#if defined(INTPTR_MIN) && INTPTR_MIN != -__INTPTR_MAX__-1
+#error "INTPTR_MIN not usable in #if or wrong value"
+#endif
+#if defined(INTPTR_MAX) && INTPTR_MAX != __INTPTR_MAX__
+#error "INTPTR_MAX not usable in #if or wrong value"
+#endif
+#if defined(UINTPTR_MAX) && UINTPTR_MAX != __UINTPTR_MAX__
+#error "UINTPTR_MAX not usable in #if or wrong value"
+#endif
+
+#if INTMAX_MIN != -__INTMAX_MAX__-1
+#error "INTMAX_MIN not usable in #if or wrong value"
+#endif
+#if INTMAX_MAX != __INTMAX_MAX__
+#error "INTMAX_MAX not usable in #if or wrong value"
+#endif
+#if UINTMAX_MAX != __UINTMAX_MAX__
+#error "UINTMAX_MAX not usable in #if or wrong value"
+#endif
+
+#if PTRDIFF_MIN != -__PTRDIFF_MAX__-1
+#error "PTRDIFF_MIN not usable in #if or wrong value"
+#endif
+#if PTRDIFF_MAX != __PTRDIFF_MAX__
+#error "PTRDIFF_MAX not usable in #if or wrong value"
+#endif
+
+#if SIG_ATOMIC_MIN != __SIG_ATOMIC_MIN__
+#error "SIG_ATOMIC_MIN not usable in #if or wrong value"
+#endif
+#if SIG_ATOMIC_MAX != __SIG_ATOMIC_MAX__
+#error "SIG_ATOMIC_MAX not usable in #if or wrong value"
+#endif
+
+#if SIZE_MAX != __SIZE_MAX__
+#error "SIZE_MAX not usable in #if or wrong value"
+#endif
+
+#if WCHAR_MIN != __WCHAR_MIN__
+#error "WCHAR_MIN not usable in #if or wrong value"
+#endif
+#if WCHAR_MAX != __WCHAR_MAX__
+#error "WCHAR_MAX not usable in #if or wrong value"
+#endif
+
+#if WINT_MIN != __WINT_MIN__
+#error "WINT_MIN not usable in #if or wrong value"
+#endif
+#if WINT_MAX != __WINT_MAX__
+#error "WINT_MAX not usable in #if or wrong value"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-8.c
new file mode 100644
index 000000000..c64b3feb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-stdint-8.c
@@ -0,0 +1,9 @@
+/* Verify that the limits defined in <stdint.h> are those GCC expects
+ internally to be defined and that they are usable in #if
+ conditions. Freestanding version. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -ffreestanding" } */
+
+/* The test is that there are no diagnostics, so just include the
+ hosted version. */
+#include "c99-stdint-7.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-1.c
new file mode 100644
index 000000000..dd525317d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-1.c
@@ -0,0 +1,151 @@
+/* Test for handling of tags (6.7.2.3). */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+foo (void)
+{
+ /* Forward declarations of structs and unions are OK; those of enums are
+ not. */
+ {
+ struct s0;
+ struct s1 *x0;
+ union u0;
+ union u1 *x1;
+ enum e0; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "forward" "enum forward 1" { target *-*-* } 16 } */
+ enum e1 *x2; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "forward" "enum forward 2" { target *-*-* } 18 } */
+ /* GCC used to fail to diagnose a use of an enum inside its definition. */
+ enum e2 { E2A = sizeof (enum e2 *) }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "forward" "enum forward 3" { target *-*-* } 21 } */
+ }
+ /* A specific type shall have its content defined at most once. But we
+ may redeclare the tag in different scopes. */
+ {
+ struct s0 { int i; }; /* { dg-message "note: originally defined here" } */
+ {
+ struct s0 { long l; };
+ }
+ {
+ union s0 { long l; };
+ }
+ struct s0 { int i; }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "rede" "struct redef" { target *-*-* } 34 } */
+ union u0 { int i; }; /* { dg-message "note: originally defined here" } */
+ {
+ union u0 { long l; };
+ }
+ {
+ struct u0 { long l; };
+ }
+ union u0 { int i; }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "rede" "union redef" { target *-*-* } 43 } */
+ enum e0 { E0A }; /* { dg-message "note: originally defined here" } */
+ {
+ enum e0 { E0B };
+ }
+ {
+ struct e0 { long l; };
+ }
+ enum e0 { E0B }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "rede" "enum redef" { target *-*-* } 52 } */
+ }
+ /* Structure, union and enumerated types have a single namespace of tags. */
+ {
+ struct s0;
+ struct s1;
+ struct s2 { int i; };
+ struct s2;
+ struct s3 { int i; };
+ struct s2 sv;
+ union u0;
+ union u2 { int i; };
+ union u2;
+ union u2 uv;
+ enum e0 { E0A };
+ enum e1 { E1A };
+ /* None of the following are allowed; some were not detected by GCC. */
+ union s0; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 70 } */
+ union s1 { int i; }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 72 } */
+ union s2; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 74 } */
+ union s3 { int i; }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 76 } */
+ enum u0 { U0A }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 78 } */
+ enum u2 { U2A }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 80 } */
+ struct e0; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 82 } */
+ struct e1 { int i; }; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 84 } */
+ }
+ /* Explicit shadowing in inner scopes is OK, but references to the tag
+ that don't explicitly shadow it must (whether in declarations or
+ expressions) use the correct one of struct/union/enum. */
+ {
+ struct s0;
+ struct s1;
+ struct s2 { int i; };
+ struct s2;
+ struct s3 { int i; };
+ struct s2 sv;
+ union u0;
+ union u2 { int i; };
+ union u2;
+ union u2 uv;
+ enum e0 { E0A };
+ enum e1 { E1A };
+ {
+ union s0;
+ union s1;
+ union s2;
+ union s3;
+ struct u0;
+ struct u2;
+ struct e0;
+ union e1;
+ }
+ {
+ union s0 *x0; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 114 } */
+ int x1[sizeof (union s1 *)]; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 116 } */
+ struct t;
+ union s2 *x2;
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 119 } */
+ int x3[sizeof (union s3 *)]; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 121 } */
+ struct u;
+ enum u0 *y0; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong|forward" "wrong tag type" { target *-*-* } 124 } */
+ int y1[sizeof (enum u2 *)]; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong|forward" "wrong tag type" { target *-*-* } 126 } */
+ struct v;
+ struct e0 *z0; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 129 } */
+ int z1[sizeof (struct e1 *)]; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 131 } */
+ struct w;
+ }
+ /* When explicitly shadowed to be a tag of a different type, references
+ to the new type of tag must be accepted and those to the old type
+ rejected. */
+ {
+ union s0;
+ union s0 *x0;
+ union s1;
+ struct s1 *x1; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 142 } */
+ union s2;
+ union s2 *x2;
+ union s3;
+ struct s3 *x3; /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "wrong" "wrong tag type" { target *-*-* } 147 } */
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-2.c
new file mode 100644
index 000000000..22cf90e27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-2.c
@@ -0,0 +1,16 @@
+/* Test for handling of tags. A struct defined in an inner scope does
+ not match one declared in an outer scope. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s;
+struct t { struct s *p; } x;
+
+void
+f (void)
+{
+ /* This is a different struct s from the outer one. */
+ struct s { int a; } y;
+ x.p = &y; /* { dg-error "incompatible" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-3.c
new file mode 100644
index 000000000..a492037b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tag-3.c
@@ -0,0 +1,59 @@
+/* Test for handling of tags. "const struct foo;" and similar does
+ not redeclare an existing tag. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* Plain "struct s;" always declares a tag: the same as one declared
+ in that scope, or shadowing one from an outer scope. */
+struct s0;
+struct s0 { int a; };
+struct s0;
+void f (void) { struct s0; }
+
+/* A declaration with a qualifier or storage class specifier declares
+ the tag if no other declaration of it is visible. */
+const union u0; /* { dg-warning "13:useless type qualifier in empty declaration" } */
+union u0 { long b; };
+
+extern struct s1; /* { dg-warning "15:useless storage class specifier in empty declaration" } */
+
+/* But if a declaration of the tag is visible, whether at the same
+ scope or an outer scope, the declaration specifies the same type as
+ the previous declaration and does not redeclare the tag (C99
+ 6.7.2.3#8). Thus, as it does not declare a declarator, a tag or
+ the members of an enumeration, it is a constraint violation. */
+
+struct s2 { char x; };
+const struct s2; /* { dg-error "14:empty declaration with type qualifier does not redeclare tag" } */
+
+union u1;
+extern union u1; /* { dg-error "14:empty declaration with storage class specifier does not redeclare tag" } */
+
+union u2 { long b; };
+void g(void) { const union u2; } /* { dg-error "28:empty declaration with type qualifier does not redeclare tag" } */
+
+/* And it does not redeclare the tag either if the outer tag is the
+ wrong kind of tag. This also yields an error for the reference to
+ the wrong kind of tag in addition to the pedwarn for the empty
+ declaration. */
+
+union u3 { float v; };
+void h(void) { const struct u3; } /* { dg-error "29:'u3' defined as wrong kind of tag" } */
+/* { dg-error "29:empty declaration with type qualifier does not redeclare tag" "wrong tag empty" { target *-*-* } 42 } */
+
+/* However, such useless specifiers are OK if the contents of the tag
+ are being defined, or shadowed in an inner scope with the contents
+ included in the shadowing. */
+
+struct s3;
+const struct s3 { int a; }; /* { dg-warning "14:useless type qualifier in empty declaration" } */
+
+union u4;
+extern union u4 { int z; }; /* { dg-warning "14:useless storage class specifier in empty declaration" } */
+
+enum e0 { E0 };
+void i(void) { const enum e0 { E1 }; } /* { dg-warning "32:useless type qualifier in empty declaration" } */
+
+union u5 { int p; };
+void j(void) { extern struct u5 { int q; }; } /* { dg-warning "30:useless storage class specifier in empty declaration" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-1.c
new file mode 100644
index 000000000..c7d848c7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-1.c
@@ -0,0 +1,248 @@
+/* Test for <tgmath.h> in C99. */
+/* Origin: Matt Austern <austern@apple.com>
+/* { dg-do preprocess { target c99_runtime } } */
+/* { dg-options "-std=iso9899:1999" } */
+/* { dg-add-options c99_runtime } */
+
+/* Test that tgmath defines the macros it's supposed to. */
+#include <tgmath.h>
+
+#ifndef acos
+#error acos undefined
+#endif
+
+#ifndef asin
+#error asin undefined
+#endif
+
+#ifndef atan
+#error atan undefined
+#endif
+
+#ifndef acosh
+#error acosh undefined
+#endif
+
+#ifndef asinh
+#error asinh undefined
+#endif
+
+#ifndef atanh
+#error atanh undefined
+#endif
+
+#ifndef cos
+#error cos undefined
+#endif
+
+#ifndef sin
+#error sin undefined
+#endif
+
+#ifndef tan
+#error tan undefined
+#endif
+
+#ifndef cosh
+#error cosh undefined
+#endif
+
+#ifndef sinh
+#error sinh undefined
+#endif
+
+#ifndef tanh
+#error tanh undefined
+#endif
+
+#ifndef exp
+#error exp undefined
+#endif
+
+#ifndef log
+#error log undefined
+#endif
+
+#ifndef pow
+#error pow undefined
+#endif
+
+#ifndef sqrt
+#error sqrt undefined
+#endif
+
+#ifndef fabs
+#error fabs undefined
+#endif
+
+#ifndef atan2
+#error atan2 undefined
+#endif
+
+#ifndef cbrt
+#error cbrt undefined
+#endif
+
+#ifndef ceil
+#error ceil undefined
+#endif
+
+#ifndef copysign
+#error copysign undefined
+#endif
+
+#ifndef erf
+#error erf undefined
+#endif
+
+#ifndef erfc
+#error erfc undefined
+#endif
+
+#ifndef exp2
+#error exp2 undefined
+#endif
+
+#ifndef expm1
+#error expm1 undefined
+#endif
+
+#ifndef fdim
+#error fdim undefined
+#endif
+
+#ifndef floor
+#error floor undefined
+#endif
+
+#ifndef fma
+#error fma undefined
+#endif
+
+#ifndef fmax
+#error fmax undefined
+#endif
+
+#ifndef fmin
+#error fmin undefined
+#endif
+
+#ifndef fmod
+#error fmod undefined
+#endif
+
+#ifndef frexp
+#error frexp undefined
+#endif
+
+#ifndef hypot
+#error hypot undefined
+#endif
+
+#ifndef ilogb
+#error ilogb undefined
+#endif
+
+#ifndef ldexp
+#error ldexp undefined
+#endif
+
+#ifndef lgamma
+#error lgamma undefined
+#endif
+
+#ifndef llrint
+#error llrint undefined
+#endif
+
+#ifndef llround
+#error llround undefined
+#endif
+
+#ifndef log10
+#error log10 undefined
+#endif
+
+#ifndef log1p
+#error log1p undefined
+#endif
+
+#ifndef log2
+#error log2 undefined
+#endif
+
+#ifndef logb
+#error logb undefined
+#endif
+
+#ifndef lrint
+#error lrint undefined
+#endif
+
+#ifndef lround
+#error lround undefined
+#endif
+
+#ifndef nearbyint
+#error nearbyint undefined
+#endif
+
+#ifndef nextafter
+#error nextafter undefined
+#endif
+
+#ifndef nexttoward
+#error nexttoward undefined
+#endif
+
+#ifndef remainder
+#error remainder undefined
+#endif
+
+#ifndef remquo
+#error remquo undefined
+#endif
+
+#ifndef rint
+#error rint undefined
+#endif
+
+#ifndef round
+#error round undefined
+#endif
+
+#ifndef scalbn
+#error scalbn undefined
+#endif
+
+#ifndef scalbln
+#error scalbln undefined
+#endif
+
+#ifndef tgamma
+#error tgamma undefined
+#endif
+
+#ifndef trunc
+#error trunc undefined
+#endif
+
+#ifndef carg
+#error carg undefined
+#endif
+
+#ifndef cimag
+#error cimag undefined
+#endif
+
+#ifndef conj
+#error conj undefined
+#endif
+
+#ifndef cproj
+#error cproj undefined
+#endif
+
+#ifndef creal
+#error creal undefined
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-2.c
new file mode 100644
index 000000000..d4f1f87cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-2.c
@@ -0,0 +1,15 @@
+/* Test for <tgmath.h> in C99. */
+/* Origin: Matt Austern <austern@apple.com>
+/* { dg-do compile { target c99_runtime } } */
+/* { dg-options "-std=iso9899:1999" } */
+/* { dg-add-options c99_runtime } */
+
+/* Test that invoking type-generic sin on a float invokes sinf. */
+#include <tgmath.h>
+
+float foo(float x)
+{
+ return sin(x);
+}
+
+/* { dg-final { scan-assembler "sinf" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-3.c
new file mode 100644
index 000000000..3e9830427
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-3.c
@@ -0,0 +1,15 @@
+/* Test for <tgmath.h> in C99. */
+/* Origin: Matt Austern <austern@apple.com>
+/* { dg-do compile { target c99_runtime } } */
+/* { dg-options "-std=iso9899:1999" } */
+/* { dg-add-options c99_runtime } */
+
+/* Test that invoking type-generic exp on a complex invokes cexp. */
+#include <tgmath.h>
+
+complex double foo(complex double x)
+{
+ return exp(x);
+}
+
+/* { dg-final { scan-assembler "cexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-4.c
new file mode 100644
index 000000000..d8dc043c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-tgmath-4.c
@@ -0,0 +1,15 @@
+/* Test for <tgmath.h> in C99. */
+/* Origin: Matt Austern <austern@apple.com>
+/* { dg-do compile { target c99_runtime } } */
+/* { dg-options "-std=iso9899:1999" } */
+/* { dg-add-options c99_runtime } */
+
+/* Test that invoking type-generic pow on complex float invokes cpowf. */
+#include <tgmath.h>
+
+complex double foo(complex float x, float y)
+{
+ return pow(x, y);
+}
+
+/* { dg-final { scan-assembler "cpowf" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-thread-local-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-thread-local-1.c
new file mode 100644
index 000000000..ff531252c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-thread-local-1.c
@@ -0,0 +1,5 @@
+/* Test for _Thread_local: not in C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+static _Thread_local int x; /* { dg-error "_Thread_local" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-typedef-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-typedef-1.c
new file mode 100644
index 000000000..8aacb3bc2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-typedef-1.c
@@ -0,0 +1,6 @@
+/* Test typedef redeclaration not permitted in C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef int TI; /* { dg-message "previous declaration" } */
+typedef int TI; /* { dg-error "redefinition of typedef" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-typespec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-typespec-1.c
new file mode 100644
index 000000000..a72335e4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-typespec-1.c
@@ -0,0 +1,1164 @@
+/* Test for valid and invalid combinations of type specifiers in C99.
+ Similar to typespec-1.c but with -pedantic-errors.
+ Includes _Complex, but not _Imaginary (expected to be removed in TC2). */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+typedef char type;
+void *x0;
+char *x1;
+short *x2;
+int *x3;
+long *x4;
+float *x5;
+double *x6;
+signed *x7;
+unsigned *x8;
+_Bool *x9;
+_Complex *x10; /* { dg-error "" "_Complex" } */
+type *x11;
+void void *x12; /* { dg-error "" "void void" } */
+void char *x13; /* { dg-error "" "void char" } */
+void short *x14; /* { dg-error "" "void short" } */
+void int *x15; /* { dg-error "" "void int" } */
+void long *x16; /* { dg-error "" "void long" } */
+void float *x17; /* { dg-error "" "void float" } */
+void double *x18; /* { dg-error "" "void double" } */
+void signed *x19; /* { dg-error "" "void signed" } */
+void unsigned *x20; /* { dg-error "" "void unsigned" } */
+void _Bool *x21; /* { dg-error "" "void _Bool" } */
+void _Complex *x22; /* { dg-error "" "void _Complex" } */
+char void *x23; /* { dg-error "" "char void" } */
+char char *x24; /* { dg-error "" "char char" } */
+char short *x25; /* { dg-error "" "char short" } */
+char int *x26; /* { dg-error "" "char int" } */
+char long *x27; /* { dg-error "" "char long" } */
+char float *x28; /* { dg-error "" "char float" } */
+char double *x29; /* { dg-error "" "char double" } */
+char signed *x30;
+char unsigned *x31;
+char _Bool *x32; /* { dg-error "" "char _Bool" } */
+char _Complex *x33; /* { dg-error "" "char _Complex" } */
+short void *x34; /* { dg-error "" "short void" } */
+short char *x35; /* { dg-error "" "short char" } */
+short short *x36; /* { dg-error "" "short short" } */
+short int *x37;
+short long *x38; /* { dg-error "" "short long" } */
+short float *x39; /* { dg-error "" "short float" } */
+short double *x40; /* { dg-error "" "short double" } */
+short signed *x41;
+short unsigned *x42;
+short _Bool *x43; /* { dg-error "" "short _Bool" } */
+short _Complex *x44; /* { dg-error "" "short _Complex" } */
+int void *x45; /* { dg-error "" "int void" } */
+int char *x46; /* { dg-error "" "int char" } */
+int short *x47;
+int int *x48; /* { dg-error "" "int int" } */
+int long *x49;
+int float *x50; /* { dg-error "" "int float" } */
+int double *x51; /* { dg-error "" "int double" } */
+int signed *x52;
+int unsigned *x53;
+int _Bool *x54; /* { dg-error "" "int _Bool" } */
+int _Complex *x55; /* { dg-error "" "int _Complex" } */
+long void *x56; /* { dg-error "" "long void" } */
+long char *x57; /* { dg-error "" "long char" } */
+long short *x58; /* { dg-error "" "long short" } */
+long int *x59;
+long long *x60;
+long float *x61; /* { dg-error "" "long float" } */
+long double *x62;
+long signed *x63;
+long unsigned *x64;
+long _Bool *x65; /* { dg-error "" "long _Bool" } */
+long _Complex *x66; /* { dg-error "" "long _Complex" } */
+float void *x67; /* { dg-error "" "float void" } */
+float char *x68; /* { dg-error "" "float char" } */
+float short *x69; /* { dg-error "" "float short" } */
+float int *x70; /* { dg-error "" "float int" } */
+float long *x71; /* { dg-error "" "float long" } */
+float float *x72; /* { dg-error "" "float float" } */
+float double *x73; /* { dg-error "" "float double" } */
+float signed *x74; /* { dg-error "" "float signed" } */
+float unsigned *x75; /* { dg-error "" "float unsigned" } */
+float _Bool *x76; /* { dg-error "" "float _Bool" } */
+float _Complex *x77;
+double void *x78; /* { dg-error "" "double void" } */
+double char *x79; /* { dg-error "" "double char" } */
+double short *x80; /* { dg-error "" "double short" } */
+double int *x81; /* { dg-error "" "double int" } */
+double long *x82;
+double float *x83; /* { dg-error "" "double float" } */
+double double *x84; /* { dg-error "" "double double" } */
+double signed *x85; /* { dg-error "" "double signed" } */
+double unsigned *x86; /* { dg-error "" "double unsigned" } */
+double _Bool *x87; /* { dg-error "" "double _Bool" } */
+double _Complex *x88;
+signed void *x89; /* { dg-error "" "signed void" } */
+signed char *x90;
+signed short *x91;
+signed int *x92;
+signed long *x93;
+signed float *x94; /* { dg-error "" "signed float" } */
+signed double *x95; /* { dg-error "" "signed double" } */
+signed signed *x96; /* { dg-error "" "signed signed" } */
+signed unsigned *x97; /* { dg-error "" "signed unsigned" } */
+signed _Bool *x98; /* { dg-error "" "signed _Bool" } */
+signed _Complex *x99; /* { dg-error "" "signed _Complex" } */
+unsigned void *x100; /* { dg-error "" "unsigned void" } */
+unsigned char *x101;
+unsigned short *x102;
+unsigned int *x103;
+unsigned long *x104;
+unsigned float *x105; /* { dg-error "" "unsigned float" } */
+unsigned double *x106; /* { dg-error "" "unsigned double" } */
+unsigned signed *x107; /* { dg-error "" "unsigned signed" } */
+unsigned unsigned *x108; /* { dg-error "" "unsigned unsigned" } */
+unsigned _Bool *x109; /* { dg-error "" "unsigned _Bool" } */
+unsigned _Complex *x110; /* { dg-error "" "unsigned _Complex" } */
+_Bool void *x111; /* { dg-error "" "_Bool void" } */
+_Bool char *x112; /* { dg-error "" "_Bool char" } */
+_Bool short *x113; /* { dg-error "" "_Bool short" } */
+_Bool int *x114; /* { dg-error "" "_Bool int" } */
+_Bool long *x115; /* { dg-error "" "_Bool long" } */
+_Bool float *x116; /* { dg-error "" "_Bool float" } */
+_Bool double *x117; /* { dg-error "" "_Bool double" } */
+_Bool signed *x118; /* { dg-error "" "_Bool signed" } */
+_Bool unsigned *x119; /* { dg-error "" "_Bool unsigned" } */
+_Bool _Bool *x120; /* { dg-error "" "_Bool _Bool" } */
+_Bool _Complex *x121; /* { dg-error "" "_Bool _Complex" } */
+_Complex void *x122; /* { dg-error "" "_Complex void" } */
+_Complex char *x123; /* { dg-error "" "_Complex char" } */
+_Complex short *x124; /* { dg-error "" "_Complex short" } */
+_Complex int *x125; /* { dg-error "" "_Complex int" } */
+_Complex long *x126; /* { dg-error "" "_Complex long" } */
+_Complex float *x127;
+_Complex double *x128;
+_Complex signed *x129; /* { dg-error "" "_Complex signed" } */
+_Complex unsigned *x130; /* { dg-error "" "_Complex unsigned" } */
+_Complex _Bool *x131; /* { dg-error "" "_Complex _Bool" } */
+_Complex _Complex *x132; /* { dg-error "" "_Complex _Complex" } */
+type void *x133; /* { dg-error "" "type void" } */
+type char *x134; /* { dg-error "" "type char" } */
+type short *x135; /* { dg-error "" "type short" } */
+type int *x136; /* { dg-error "" "type int" } */
+type long *x137; /* { dg-error "" "type long" } */
+type float *x138; /* { dg-error "" "type float" } */
+type double *x139; /* { dg-error "" "type double" } */
+type signed *x140; /* { dg-error "" "type signed" } */
+type unsigned *x141; /* { dg-error "" "type unsigned" } */
+type _Bool *x142; /* { dg-error "" "type _Bool" } */
+type _Complex *x143; /* { dg-error "" "type _Complex" } */
+char signed void *x144; /* { dg-error "" "char signed void" } */
+char signed char *x145; /* { dg-error "" "char signed char" } */
+char signed short *x146; /* { dg-error "" "char signed short" } */
+char signed int *x147; /* { dg-error "" "char signed int" } */
+char signed long *x148; /* { dg-error "" "char signed long" } */
+char signed float *x149; /* { dg-error "" "char signed float" } */
+char signed double *x150; /* { dg-error "" "char signed double" } */
+char signed signed *x151; /* { dg-error "" "char signed signed" } */
+char signed unsigned *x152; /* { dg-error "" "char signed unsigned" } */
+char signed _Bool *x153; /* { dg-error "" "char signed _Bool" } */
+char signed _Complex *x154; /* { dg-error "" "char signed _Complex" } */
+char unsigned void *x155; /* { dg-error "" "char unsigned void" } */
+char unsigned char *x156; /* { dg-error "" "char unsigned char" } */
+char unsigned short *x157; /* { dg-error "" "char unsigned short" } */
+char unsigned int *x158; /* { dg-error "" "char unsigned int" } */
+char unsigned long *x159; /* { dg-error "" "char unsigned long" } */
+char unsigned float *x160; /* { dg-error "" "char unsigned float" } */
+char unsigned double *x161; /* { dg-error "" "char unsigned double" } */
+char unsigned signed *x162; /* { dg-error "" "char unsigned signed" } */
+char unsigned unsigned *x163; /* { dg-error "" "char unsigned unsigned" } */
+char unsigned _Bool *x164; /* { dg-error "" "char unsigned _Bool" } */
+char unsigned _Complex *x165; /* { dg-error "" "char unsigned _Complex" } */
+short int void *x166; /* { dg-error "" "short int void" } */
+short int char *x167; /* { dg-error "" "short int char" } */
+short int short *x168; /* { dg-error "" "short int short" } */
+short int int *x169; /* { dg-error "" "short int int" } */
+short int long *x170; /* { dg-error "" "short int long" } */
+short int float *x171; /* { dg-error "" "short int float" } */
+short int double *x172; /* { dg-error "" "short int double" } */
+short int signed *x173;
+short int unsigned *x174;
+short int _Bool *x175; /* { dg-error "" "short int _Bool" } */
+short int _Complex *x176; /* { dg-error "" "short int _Complex" } */
+short signed void *x177; /* { dg-error "" "short signed void" } */
+short signed char *x178; /* { dg-error "" "short signed char" } */
+short signed short *x179; /* { dg-error "" "short signed short" } */
+short signed int *x180;
+short signed long *x181; /* { dg-error "" "short signed long" } */
+short signed float *x182; /* { dg-error "" "short signed float" } */
+short signed double *x183; /* { dg-error "" "short signed double" } */
+short signed signed *x184; /* { dg-error "" "short signed signed" } */
+short signed unsigned *x185; /* { dg-error "" "short signed unsigned" } */
+short signed _Bool *x186; /* { dg-error "" "short signed _Bool" } */
+short signed _Complex *x187; /* { dg-error "" "short signed _Complex" } */
+short unsigned void *x188; /* { dg-error "" "short unsigned void" } */
+short unsigned char *x189; /* { dg-error "" "short unsigned char" } */
+short unsigned short *x190; /* { dg-error "" "short unsigned short" } */
+short unsigned int *x191;
+short unsigned long *x192; /* { dg-error "" "short unsigned long" } */
+short unsigned float *x193; /* { dg-error "" "short unsigned float" } */
+short unsigned double *x194; /* { dg-error "" "short unsigned double" } */
+short unsigned signed *x195; /* { dg-error "" "short unsigned signed" } */
+short unsigned unsigned *x196; /* { dg-error "" "short unsigned unsigned" } */
+short unsigned _Bool *x197; /* { dg-error "" "short unsigned _Bool" } */
+short unsigned _Complex *x198; /* { dg-error "" "short unsigned _Complex" } */
+int short void *x199; /* { dg-error "" "int short void" } */
+int short char *x200; /* { dg-error "" "int short char" } */
+int short short *x201; /* { dg-error "" "int short short" } */
+int short int *x202; /* { dg-error "" "int short int" } */
+int short long *x203; /* { dg-error "" "int short long" } */
+int short float *x204; /* { dg-error "" "int short float" } */
+int short double *x205; /* { dg-error "" "int short double" } */
+int short signed *x206;
+int short unsigned *x207;
+int short _Bool *x208; /* { dg-error "" "int short _Bool" } */
+int short _Complex *x209; /* { dg-error "" "int short _Complex" } */
+int long void *x210; /* { dg-error "" "int long void" } */
+int long char *x211; /* { dg-error "" "int long char" } */
+int long short *x212; /* { dg-error "" "int long short" } */
+int long int *x213; /* { dg-error "" "int long int" } */
+int long long *x214;
+int long float *x215; /* { dg-error "" "int long float" } */
+int long double *x216; /* { dg-error "" "int long double" } */
+int long signed *x217;
+int long unsigned *x218;
+int long _Bool *x219; /* { dg-error "" "int long _Bool" } */
+int long _Complex *x220; /* { dg-error "" "int long _Complex" } */
+int signed void *x221; /* { dg-error "" "int signed void" } */
+int signed char *x222; /* { dg-error "" "int signed char" } */
+int signed short *x223;
+int signed int *x224; /* { dg-error "" "int signed int" } */
+int signed long *x225;
+int signed float *x226; /* { dg-error "" "int signed float" } */
+int signed double *x227; /* { dg-error "" "int signed double" } */
+int signed signed *x228; /* { dg-error "" "int signed signed" } */
+int signed unsigned *x229; /* { dg-error "" "int signed unsigned" } */
+int signed _Bool *x230; /* { dg-error "" "int signed _Bool" } */
+int signed _Complex *x231; /* { dg-error "" "int signed _Complex" } */
+int unsigned void *x232; /* { dg-error "" "int unsigned void" } */
+int unsigned char *x233; /* { dg-error "" "int unsigned char" } */
+int unsigned short *x234;
+int unsigned int *x235; /* { dg-error "" "int unsigned int" } */
+int unsigned long *x236;
+int unsigned float *x237; /* { dg-error "" "int unsigned float" } */
+int unsigned double *x238; /* { dg-error "" "int unsigned double" } */
+int unsigned signed *x239; /* { dg-error "" "int unsigned signed" } */
+int unsigned unsigned *x240; /* { dg-error "" "int unsigned unsigned" } */
+int unsigned _Bool *x241; /* { dg-error "" "int unsigned _Bool" } */
+int unsigned _Complex *x242; /* { dg-error "" "int unsigned _Complex" } */
+long int void *x243; /* { dg-error "" "long int void" } */
+long int char *x244; /* { dg-error "" "long int char" } */
+long int short *x245; /* { dg-error "" "long int short" } */
+long int int *x246; /* { dg-error "" "long int int" } */
+long int long *x247;
+long int float *x248; /* { dg-error "" "long int float" } */
+long int double *x249; /* { dg-error "" "long int double" } */
+long int signed *x250;
+long int unsigned *x251;
+long int _Bool *x252; /* { dg-error "" "long int _Bool" } */
+long int _Complex *x253; /* { dg-error "" "long int _Complex" } */
+long long void *x254; /* { dg-error "" "long long void" } */
+long long char *x255; /* { dg-error "" "long long char" } */
+long long short *x256; /* { dg-error "" "long long short" } */
+long long int *x257;
+long long long *x258; /* { dg-error "" "long long long" } */
+long long float *x259; /* { dg-error "" "long long float" } */
+long long double *x260; /* { dg-error "" "long long double" } */
+long long signed *x261;
+long long unsigned *x262;
+long long _Bool *x263; /* { dg-error "" "long long _Bool" } */
+long long _Complex *x264; /* { dg-error "" "long long _Complex" } */
+long double void *x265; /* { dg-error "" "long double void" } */
+long double char *x266; /* { dg-error "" "long double char" } */
+long double short *x267; /* { dg-error "" "long double short" } */
+long double int *x268; /* { dg-error "" "long double int" } */
+long double long *x269; /* { dg-error "" "long double long" } */
+long double float *x270; /* { dg-error "" "long double float" } */
+long double double *x271; /* { dg-error "" "long double double" } */
+long double signed *x272; /* { dg-error "" "long double signed" } */
+long double unsigned *x273; /* { dg-error "" "long double unsigned" } */
+long double _Bool *x274; /* { dg-error "" "long double _Bool" } */
+long double _Complex *x275;
+long signed void *x276; /* { dg-error "" "long signed void" } */
+long signed char *x277; /* { dg-error "" "long signed char" } */
+long signed short *x278; /* { dg-error "" "long signed short" } */
+long signed int *x279;
+long signed long *x280;
+long signed float *x281; /* { dg-error "" "long signed float" } */
+long signed double *x282; /* { dg-error "" "long signed double" } */
+long signed signed *x283; /* { dg-error "" "long signed signed" } */
+long signed unsigned *x284; /* { dg-error "" "long signed unsigned" } */
+long signed _Bool *x285; /* { dg-error "" "long signed _Bool" } */
+long signed _Complex *x286; /* { dg-error "" "long signed _Complex" } */
+long unsigned void *x287; /* { dg-error "" "long unsigned void" } */
+long unsigned char *x288; /* { dg-error "" "long unsigned char" } */
+long unsigned short *x289; /* { dg-error "" "long unsigned short" } */
+long unsigned int *x290;
+long unsigned long *x291;
+long unsigned float *x292; /* { dg-error "" "long unsigned float" } */
+long unsigned double *x293; /* { dg-error "" "long unsigned double" } */
+long unsigned signed *x294; /* { dg-error "" "long unsigned signed" } */
+long unsigned unsigned *x295; /* { dg-error "" "long unsigned unsigned" } */
+long unsigned _Bool *x296; /* { dg-error "" "long unsigned _Bool" } */
+long unsigned _Complex *x297; /* { dg-error "" "long unsigned _Complex" } */
+long _Complex void *x298; /* { dg-error "" "long _Complex void" } */
+long _Complex char *x299; /* { dg-error "" "long _Complex char" } */
+long _Complex short *x300; /* { dg-error "" "long _Complex short" } */
+long _Complex int *x301; /* { dg-error "" "long _Complex int" } */
+long _Complex long *x302; /* { dg-error "" "long _Complex long" } */
+long _Complex float *x303; /* { dg-error "" "long _Complex float" } */
+long _Complex double *x304;
+long _Complex signed *x305; /* { dg-error "" "long _Complex signed" } */
+long _Complex unsigned *x306; /* { dg-error "" "long _Complex unsigned" } */
+long _Complex _Bool *x307; /* { dg-error "" "long _Complex _Bool" } */
+long _Complex _Complex *x308; /* { dg-error "" "long _Complex _Complex" } */
+float _Complex void *x309; /* { dg-error "" "float _Complex void" } */
+float _Complex char *x310; /* { dg-error "" "float _Complex char" } */
+float _Complex short *x311; /* { dg-error "" "float _Complex short" } */
+float _Complex int *x312; /* { dg-error "" "float _Complex int" } */
+float _Complex long *x313; /* { dg-error "" "float _Complex long" } */
+float _Complex float *x314; /* { dg-error "" "float _Complex float" } */
+float _Complex double *x315; /* { dg-error "" "float _Complex double" } */
+float _Complex signed *x316; /* { dg-error "" "float _Complex signed" } */
+float _Complex unsigned *x317; /* { dg-error "" "float _Complex unsigned" } */
+float _Complex _Bool *x318; /* { dg-error "" "float _Complex _Bool" } */
+float _Complex _Complex *x319; /* { dg-error "" "float _Complex _Complex" } */
+double long void *x320; /* { dg-error "" "double long void" } */
+double long char *x321; /* { dg-error "" "double long char" } */
+double long short *x322; /* { dg-error "" "double long short" } */
+double long int *x323; /* { dg-error "" "double long int" } */
+double long long *x324; /* { dg-error "" "double long long" } */
+double long float *x325; /* { dg-error "" "double long float" } */
+double long double *x326; /* { dg-error "" "double long double" } */
+double long signed *x327; /* { dg-error "" "double long signed" } */
+double long unsigned *x328; /* { dg-error "" "double long unsigned" } */
+double long _Bool *x329; /* { dg-error "" "double long _Bool" } */
+double long _Complex *x330;
+double _Complex void *x331; /* { dg-error "" "double _Complex void" } */
+double _Complex char *x332; /* { dg-error "" "double _Complex char" } */
+double _Complex short *x333; /* { dg-error "" "double _Complex short" } */
+double _Complex int *x334; /* { dg-error "" "double _Complex int" } */
+double _Complex long *x335;
+double _Complex float *x336; /* { dg-error "" "double _Complex float" } */
+double _Complex double *x337; /* { dg-error "" "double _Complex double" } */
+double _Complex signed *x338; /* { dg-error "" "double _Complex signed" } */
+double _Complex unsigned *x339; /* { dg-error "" "double _Complex unsigned" } */
+double _Complex _Bool *x340; /* { dg-error "" "double _Complex _Bool" } */
+double _Complex _Complex *x341; /* { dg-error "" "double _Complex _Complex" } */
+signed char void *x342; /* { dg-error "" "signed char void" } */
+signed char char *x343; /* { dg-error "" "signed char char" } */
+signed char short *x344; /* { dg-error "" "signed char short" } */
+signed char int *x345; /* { dg-error "" "signed char int" } */
+signed char long *x346; /* { dg-error "" "signed char long" } */
+signed char float *x347; /* { dg-error "" "signed char float" } */
+signed char double *x348; /* { dg-error "" "signed char double" } */
+signed char signed *x349; /* { dg-error "" "signed char signed" } */
+signed char unsigned *x350; /* { dg-error "" "signed char unsigned" } */
+signed char _Bool *x351; /* { dg-error "" "signed char _Bool" } */
+signed char _Complex *x352; /* { dg-error "" "signed char _Complex" } */
+signed short void *x353; /* { dg-error "" "signed short void" } */
+signed short char *x354; /* { dg-error "" "signed short char" } */
+signed short short *x355; /* { dg-error "" "signed short short" } */
+signed short int *x356;
+signed short long *x357; /* { dg-error "" "signed short long" } */
+signed short float *x358; /* { dg-error "" "signed short float" } */
+signed short double *x359; /* { dg-error "" "signed short double" } */
+signed short signed *x360; /* { dg-error "" "signed short signed" } */
+signed short unsigned *x361; /* { dg-error "" "signed short unsigned" } */
+signed short _Bool *x362; /* { dg-error "" "signed short _Bool" } */
+signed short _Complex *x363; /* { dg-error "" "signed short _Complex" } */
+signed int void *x364; /* { dg-error "" "signed int void" } */
+signed int char *x365; /* { dg-error "" "signed int char" } */
+signed int short *x366;
+signed int int *x367; /* { dg-error "" "signed int int" } */
+signed int long *x368;
+signed int float *x369; /* { dg-error "" "signed int float" } */
+signed int double *x370; /* { dg-error "" "signed int double" } */
+signed int signed *x371; /* { dg-error "" "signed int signed" } */
+signed int unsigned *x372; /* { dg-error "" "signed int unsigned" } */
+signed int _Bool *x373; /* { dg-error "" "signed int _Bool" } */
+signed int _Complex *x374; /* { dg-error "" "signed int _Complex" } */
+signed long void *x375; /* { dg-error "" "signed long void" } */
+signed long char *x376; /* { dg-error "" "signed long char" } */
+signed long short *x377; /* { dg-error "" "signed long short" } */
+signed long int *x378;
+signed long long *x379;
+signed long float *x380; /* { dg-error "" "signed long float" } */
+signed long double *x381; /* { dg-error "" "signed long double" } */
+signed long signed *x382; /* { dg-error "" "signed long signed" } */
+signed long unsigned *x383; /* { dg-error "" "signed long unsigned" } */
+signed long _Bool *x384; /* { dg-error "" "signed long _Bool" } */
+signed long _Complex *x385; /* { dg-error "" "signed long _Complex" } */
+unsigned char void *x386; /* { dg-error "" "unsigned char void" } */
+unsigned char char *x387; /* { dg-error "" "unsigned char char" } */
+unsigned char short *x388; /* { dg-error "" "unsigned char short" } */
+unsigned char int *x389; /* { dg-error "" "unsigned char int" } */
+unsigned char long *x390; /* { dg-error "" "unsigned char long" } */
+unsigned char float *x391; /* { dg-error "" "unsigned char float" } */
+unsigned char double *x392; /* { dg-error "" "unsigned char double" } */
+unsigned char signed *x393; /* { dg-error "" "unsigned char signed" } */
+unsigned char unsigned *x394; /* { dg-error "" "unsigned char unsigned" } */
+unsigned char _Bool *x395; /* { dg-error "" "unsigned char _Bool" } */
+unsigned char _Complex *x396; /* { dg-error "" "unsigned char _Complex" } */
+unsigned short void *x397; /* { dg-error "" "unsigned short void" } */
+unsigned short char *x398; /* { dg-error "" "unsigned short char" } */
+unsigned short short *x399; /* { dg-error "" "unsigned short short" } */
+unsigned short int *x400;
+unsigned short long *x401; /* { dg-error "" "unsigned short long" } */
+unsigned short float *x402; /* { dg-error "" "unsigned short float" } */
+unsigned short double *x403; /* { dg-error "" "unsigned short double" } */
+unsigned short signed *x404; /* { dg-error "" "unsigned short signed" } */
+unsigned short unsigned *x405; /* { dg-error "" "unsigned short unsigned" } */
+unsigned short _Bool *x406; /* { dg-error "" "unsigned short _Bool" } */
+unsigned short _Complex *x407; /* { dg-error "" "unsigned short _Complex" } */
+unsigned int void *x408; /* { dg-error "" "unsigned int void" } */
+unsigned int char *x409; /* { dg-error "" "unsigned int char" } */
+unsigned int short *x410;
+unsigned int int *x411; /* { dg-error "" "unsigned int int" } */
+unsigned int long *x412;
+unsigned int float *x413; /* { dg-error "" "unsigned int float" } */
+unsigned int double *x414; /* { dg-error "" "unsigned int double" } */
+unsigned int signed *x415; /* { dg-error "" "unsigned int signed" } */
+unsigned int unsigned *x416; /* { dg-error "" "unsigned int unsigned" } */
+unsigned int _Bool *x417; /* { dg-error "" "unsigned int _Bool" } */
+unsigned int _Complex *x418; /* { dg-error "" "unsigned int _Complex" } */
+unsigned long void *x419; /* { dg-error "" "unsigned long void" } */
+unsigned long char *x420; /* { dg-error "" "unsigned long char" } */
+unsigned long short *x421; /* { dg-error "" "unsigned long short" } */
+unsigned long int *x422;
+unsigned long long *x423;
+unsigned long float *x424; /* { dg-error "" "unsigned long float" } */
+unsigned long double *x425; /* { dg-error "" "unsigned long double" } */
+unsigned long signed *x426; /* { dg-error "" "unsigned long signed" } */
+unsigned long unsigned *x427; /* { dg-error "" "unsigned long unsigned" } */
+unsigned long _Bool *x428; /* { dg-error "" "unsigned long _Bool" } */
+unsigned long _Complex *x429; /* { dg-error "" "unsigned long _Complex" } */
+_Complex long void *x430; /* { dg-error "" "_Complex long void" } */
+_Complex long char *x431; /* { dg-error "" "_Complex long char" } */
+_Complex long short *x432; /* { dg-error "" "_Complex long short" } */
+_Complex long int *x433; /* { dg-error "" "_Complex long int" } */
+_Complex long long *x434; /* { dg-error "" "_Complex long long" } */
+_Complex long float *x435; /* { dg-error "" "_Complex long float" } */
+_Complex long double *x436;
+_Complex long signed *x437; /* { dg-error "" "_Complex long signed" } */
+_Complex long unsigned *x438; /* { dg-error "" "_Complex long unsigned" } */
+_Complex long _Bool *x439; /* { dg-error "" "_Complex long _Bool" } */
+_Complex long _Complex *x440; /* { dg-error "" "_Complex long _Complex" } */
+_Complex float void *x441; /* { dg-error "" "_Complex float void" } */
+_Complex float char *x442; /* { dg-error "" "_Complex float char" } */
+_Complex float short *x443; /* { dg-error "" "_Complex float short" } */
+_Complex float int *x444; /* { dg-error "" "_Complex float int" } */
+_Complex float long *x445; /* { dg-error "" "_Complex float long" } */
+_Complex float float *x446; /* { dg-error "" "_Complex float float" } */
+_Complex float double *x447; /* { dg-error "" "_Complex float double" } */
+_Complex float signed *x448; /* { dg-error "" "_Complex float signed" } */
+_Complex float unsigned *x449; /* { dg-error "" "_Complex float unsigned" } */
+_Complex float _Bool *x450; /* { dg-error "" "_Complex float _Bool" } */
+_Complex float _Complex *x451; /* { dg-error "" "_Complex float _Complex" } */
+_Complex double void *x452; /* { dg-error "" "_Complex double void" } */
+_Complex double char *x453; /* { dg-error "" "_Complex double char" } */
+_Complex double short *x454; /* { dg-error "" "_Complex double short" } */
+_Complex double int *x455; /* { dg-error "" "_Complex double int" } */
+_Complex double long *x456;
+_Complex double float *x457; /* { dg-error "" "_Complex double float" } */
+_Complex double double *x458; /* { dg-error "" "_Complex double double" } */
+_Complex double signed *x459; /* { dg-error "" "_Complex double signed" } */
+_Complex double unsigned *x460; /* { dg-error "" "_Complex double unsigned" } */
+_Complex double _Bool *x461; /* { dg-error "" "_Complex double _Bool" } */
+_Complex double _Complex *x462; /* { dg-error "" "_Complex double _Complex" } */
+short int signed void *x463; /* { dg-error "" "short int signed void" } */
+short int signed char *x464; /* { dg-error "" "short int signed char" } */
+short int signed short *x465; /* { dg-error "" "short int signed short" } */
+short int signed int *x466; /* { dg-error "" "short int signed int" } */
+short int signed long *x467; /* { dg-error "" "short int signed long" } */
+short int signed float *x468; /* { dg-error "" "short int signed float" } */
+short int signed double *x469; /* { dg-error "" "short int signed double" } */
+short int signed signed *x470; /* { dg-error "" "short int signed signed" } */
+short int signed unsigned *x471; /* { dg-error "" "short int signed unsigned" } */
+short int signed _Bool *x472; /* { dg-error "" "short int signed _Bool" } */
+short int signed _Complex *x473; /* { dg-error "" "short int signed _Complex" } */
+short int unsigned void *x474; /* { dg-error "" "short int unsigned void" } */
+short int unsigned char *x475; /* { dg-error "" "short int unsigned char" } */
+short int unsigned short *x476; /* { dg-error "" "short int unsigned short" } */
+short int unsigned int *x477; /* { dg-error "" "short int unsigned int" } */
+short int unsigned long *x478; /* { dg-error "" "short int unsigned long" } */
+short int unsigned float *x479; /* { dg-error "" "short int unsigned float" } */
+short int unsigned double *x480; /* { dg-error "" "short int unsigned double" } */
+short int unsigned signed *x481; /* { dg-error "" "short int unsigned signed" } */
+short int unsigned unsigned *x482; /* { dg-error "" "short int unsigned unsigned" } */
+short int unsigned _Bool *x483; /* { dg-error "" "short int unsigned _Bool" } */
+short int unsigned _Complex *x484; /* { dg-error "" "short int unsigned _Complex" } */
+short signed int void *x485; /* { dg-error "" "short signed int void" } */
+short signed int char *x486; /* { dg-error "" "short signed int char" } */
+short signed int short *x487; /* { dg-error "" "short signed int short" } */
+short signed int int *x488; /* { dg-error "" "short signed int int" } */
+short signed int long *x489; /* { dg-error "" "short signed int long" } */
+short signed int float *x490; /* { dg-error "" "short signed int float" } */
+short signed int double *x491; /* { dg-error "" "short signed int double" } */
+short signed int signed *x492; /* { dg-error "" "short signed int signed" } */
+short signed int unsigned *x493; /* { dg-error "" "short signed int unsigned" } */
+short signed int _Bool *x494; /* { dg-error "" "short signed int _Bool" } */
+short signed int _Complex *x495; /* { dg-error "" "short signed int _Complex" } */
+short unsigned int void *x496; /* { dg-error "" "short unsigned int void" } */
+short unsigned int char *x497; /* { dg-error "" "short unsigned int char" } */
+short unsigned int short *x498; /* { dg-error "" "short unsigned int short" } */
+short unsigned int int *x499; /* { dg-error "" "short unsigned int int" } */
+short unsigned int long *x500; /* { dg-error "" "short unsigned int long" } */
+short unsigned int float *x501; /* { dg-error "" "short unsigned int float" } */
+short unsigned int double *x502; /* { dg-error "" "short unsigned int double" } */
+short unsigned int signed *x503; /* { dg-error "" "short unsigned int signed" } */
+short unsigned int unsigned *x504; /* { dg-error "" "short unsigned int unsigned" } */
+short unsigned int _Bool *x505; /* { dg-error "" "short unsigned int _Bool" } */
+short unsigned int _Complex *x506; /* { dg-error "" "short unsigned int _Complex" } */
+int short signed void *x507; /* { dg-error "" "int short signed void" } */
+int short signed char *x508; /* { dg-error "" "int short signed char" } */
+int short signed short *x509; /* { dg-error "" "int short signed short" } */
+int short signed int *x510; /* { dg-error "" "int short signed int" } */
+int short signed long *x511; /* { dg-error "" "int short signed long" } */
+int short signed float *x512; /* { dg-error "" "int short signed float" } */
+int short signed double *x513; /* { dg-error "" "int short signed double" } */
+int short signed signed *x514; /* { dg-error "" "int short signed signed" } */
+int short signed unsigned *x515; /* { dg-error "" "int short signed unsigned" } */
+int short signed _Bool *x516; /* { dg-error "" "int short signed _Bool" } */
+int short signed _Complex *x517; /* { dg-error "" "int short signed _Complex" } */
+int short unsigned void *x518; /* { dg-error "" "int short unsigned void" } */
+int short unsigned char *x519; /* { dg-error "" "int short unsigned char" } */
+int short unsigned short *x520; /* { dg-error "" "int short unsigned short" } */
+int short unsigned int *x521; /* { dg-error "" "int short unsigned int" } */
+int short unsigned long *x522; /* { dg-error "" "int short unsigned long" } */
+int short unsigned float *x523; /* { dg-error "" "int short unsigned float" } */
+int short unsigned double *x524; /* { dg-error "" "int short unsigned double" } */
+int short unsigned signed *x525; /* { dg-error "" "int short unsigned signed" } */
+int short unsigned unsigned *x526; /* { dg-error "" "int short unsigned unsigned" } */
+int short unsigned _Bool *x527; /* { dg-error "" "int short unsigned _Bool" } */
+int short unsigned _Complex *x528; /* { dg-error "" "int short unsigned _Complex" } */
+int long long void *x529; /* { dg-error "" "int long long void" } */
+int long long char *x530; /* { dg-error "" "int long long char" } */
+int long long short *x531; /* { dg-error "" "int long long short" } */
+int long long int *x532; /* { dg-error "" "int long long int" } */
+int long long long *x533; /* { dg-error "" "int long long long" } */
+int long long float *x534; /* { dg-error "" "int long long float" } */
+int long long double *x535; /* { dg-error "" "int long long double" } */
+int long long signed *x536;
+int long long unsigned *x537;
+int long long _Bool *x538; /* { dg-error "" "int long long _Bool" } */
+int long long _Complex *x539; /* { dg-error "" "int long long _Complex" } */
+int long signed void *x540; /* { dg-error "" "int long signed void" } */
+int long signed char *x541; /* { dg-error "" "int long signed char" } */
+int long signed short *x542; /* { dg-error "" "int long signed short" } */
+int long signed int *x543; /* { dg-error "" "int long signed int" } */
+int long signed long *x544;
+int long signed float *x545; /* { dg-error "" "int long signed float" } */
+int long signed double *x546; /* { dg-error "" "int long signed double" } */
+int long signed signed *x547; /* { dg-error "" "int long signed signed" } */
+int long signed unsigned *x548; /* { dg-error "" "int long signed unsigned" } */
+int long signed _Bool *x549; /* { dg-error "" "int long signed _Bool" } */
+int long signed _Complex *x550; /* { dg-error "" "int long signed _Complex" } */
+int long unsigned void *x551; /* { dg-error "" "int long unsigned void" } */
+int long unsigned char *x552; /* { dg-error "" "int long unsigned char" } */
+int long unsigned short *x553; /* { dg-error "" "int long unsigned short" } */
+int long unsigned int *x554; /* { dg-error "" "int long unsigned int" } */
+int long unsigned long *x555;
+int long unsigned float *x556; /* { dg-error "" "int long unsigned float" } */
+int long unsigned double *x557; /* { dg-error "" "int long unsigned double" } */
+int long unsigned signed *x558; /* { dg-error "" "int long unsigned signed" } */
+int long unsigned unsigned *x559; /* { dg-error "" "int long unsigned unsigned" } */
+int long unsigned _Bool *x560; /* { dg-error "" "int long unsigned _Bool" } */
+int long unsigned _Complex *x561; /* { dg-error "" "int long unsigned _Complex" } */
+int signed short void *x562; /* { dg-error "" "int signed short void" } */
+int signed short char *x563; /* { dg-error "" "int signed short char" } */
+int signed short short *x564; /* { dg-error "" "int signed short short" } */
+int signed short int *x565; /* { dg-error "" "int signed short int" } */
+int signed short long *x566; /* { dg-error "" "int signed short long" } */
+int signed short float *x567; /* { dg-error "" "int signed short float" } */
+int signed short double *x568; /* { dg-error "" "int signed short double" } */
+int signed short signed *x569; /* { dg-error "" "int signed short signed" } */
+int signed short unsigned *x570; /* { dg-error "" "int signed short unsigned" } */
+int signed short _Bool *x571; /* { dg-error "" "int signed short _Bool" } */
+int signed short _Complex *x572; /* { dg-error "" "int signed short _Complex" } */
+int signed long void *x573; /* { dg-error "" "int signed long void" } */
+int signed long char *x574; /* { dg-error "" "int signed long char" } */
+int signed long short *x575; /* { dg-error "" "int signed long short" } */
+int signed long int *x576; /* { dg-error "" "int signed long int" } */
+int signed long long *x577;
+int signed long float *x578; /* { dg-error "" "int signed long float" } */
+int signed long double *x579; /* { dg-error "" "int signed long double" } */
+int signed long signed *x580; /* { dg-error "" "int signed long signed" } */
+int signed long unsigned *x581; /* { dg-error "" "int signed long unsigned" } */
+int signed long _Bool *x582; /* { dg-error "" "int signed long _Bool" } */
+int signed long _Complex *x583; /* { dg-error "" "int signed long _Complex" } */
+int unsigned short void *x584; /* { dg-error "" "int unsigned short void" } */
+int unsigned short char *x585; /* { dg-error "" "int unsigned short char" } */
+int unsigned short short *x586; /* { dg-error "" "int unsigned short short" } */
+int unsigned short int *x587; /* { dg-error "" "int unsigned short int" } */
+int unsigned short long *x588; /* { dg-error "" "int unsigned short long" } */
+int unsigned short float *x589; /* { dg-error "" "int unsigned short float" } */
+int unsigned short double *x590; /* { dg-error "" "int unsigned short double" } */
+int unsigned short signed *x591; /* { dg-error "" "int unsigned short signed" } */
+int unsigned short unsigned *x592; /* { dg-error "" "int unsigned short unsigned" } */
+int unsigned short _Bool *x593; /* { dg-error "" "int unsigned short _Bool" } */
+int unsigned short _Complex *x594; /* { dg-error "" "int unsigned short _Complex" } */
+int unsigned long void *x595; /* { dg-error "" "int unsigned long void" } */
+int unsigned long char *x596; /* { dg-error "" "int unsigned long char" } */
+int unsigned long short *x597; /* { dg-error "" "int unsigned long short" } */
+int unsigned long int *x598; /* { dg-error "" "int unsigned long int" } */
+int unsigned long long *x599;
+int unsigned long float *x600; /* { dg-error "" "int unsigned long float" } */
+int unsigned long double *x601; /* { dg-error "" "int unsigned long double" } */
+int unsigned long signed *x602; /* { dg-error "" "int unsigned long signed" } */
+int unsigned long unsigned *x603; /* { dg-error "" "int unsigned long unsigned" } */
+int unsigned long _Bool *x604; /* { dg-error "" "int unsigned long _Bool" } */
+int unsigned long _Complex *x605; /* { dg-error "" "int unsigned long _Complex" } */
+long int long void *x606; /* { dg-error "" "long int long void" } */
+long int long char *x607; /* { dg-error "" "long int long char" } */
+long int long short *x608; /* { dg-error "" "long int long short" } */
+long int long int *x609; /* { dg-error "" "long int long int" } */
+long int long long *x610; /* { dg-error "" "long int long long" } */
+long int long float *x611; /* { dg-error "" "long int long float" } */
+long int long double *x612; /* { dg-error "" "long int long double" } */
+long int long signed *x613;
+long int long unsigned *x614;
+long int long _Bool *x615; /* { dg-error "" "long int long _Bool" } */
+long int long _Complex *x616; /* { dg-error "" "long int long _Complex" } */
+long int signed void *x617; /* { dg-error "" "long int signed void" } */
+long int signed char *x618; /* { dg-error "" "long int signed char" } */
+long int signed short *x619; /* { dg-error "" "long int signed short" } */
+long int signed int *x620; /* { dg-error "" "long int signed int" } */
+long int signed long *x621;
+long int signed float *x622; /* { dg-error "" "long int signed float" } */
+long int signed double *x623; /* { dg-error "" "long int signed double" } */
+long int signed signed *x624; /* { dg-error "" "long int signed signed" } */
+long int signed unsigned *x625; /* { dg-error "" "long int signed unsigned" } */
+long int signed _Bool *x626; /* { dg-error "" "long int signed _Bool" } */
+long int signed _Complex *x627; /* { dg-error "" "long int signed _Complex" } */
+long int unsigned void *x628; /* { dg-error "" "long int unsigned void" } */
+long int unsigned char *x629; /* { dg-error "" "long int unsigned char" } */
+long int unsigned short *x630; /* { dg-error "" "long int unsigned short" } */
+long int unsigned int *x631; /* { dg-error "" "long int unsigned int" } */
+long int unsigned long *x632;
+long int unsigned float *x633; /* { dg-error "" "long int unsigned float" } */
+long int unsigned double *x634; /* { dg-error "" "long int unsigned double" } */
+long int unsigned signed *x635; /* { dg-error "" "long int unsigned signed" } */
+long int unsigned unsigned *x636; /* { dg-error "" "long int unsigned unsigned" } */
+long int unsigned _Bool *x637; /* { dg-error "" "long int unsigned _Bool" } */
+long int unsigned _Complex *x638; /* { dg-error "" "long int unsigned _Complex" } */
+long long int void *x639; /* { dg-error "" "long long int void" } */
+long long int char *x640; /* { dg-error "" "long long int char" } */
+long long int short *x641; /* { dg-error "" "long long int short" } */
+long long int int *x642; /* { dg-error "" "long long int int" } */
+long long int long *x643; /* { dg-error "" "long long int long" } */
+long long int float *x644; /* { dg-error "" "long long int float" } */
+long long int double *x645; /* { dg-error "" "long long int double" } */
+long long int signed *x646;
+long long int unsigned *x647;
+long long int _Bool *x648; /* { dg-error "" "long long int _Bool" } */
+long long int _Complex *x649; /* { dg-error "" "long long int _Complex" } */
+long long signed void *x650; /* { dg-error "" "long long signed void" } */
+long long signed char *x651; /* { dg-error "" "long long signed char" } */
+long long signed short *x652; /* { dg-error "" "long long signed short" } */
+long long signed int *x653;
+long long signed long *x654; /* { dg-error "" "long long signed long" } */
+long long signed float *x655; /* { dg-error "" "long long signed float" } */
+long long signed double *x656; /* { dg-error "" "long long signed double" } */
+long long signed signed *x657; /* { dg-error "" "long long signed signed" } */
+long long signed unsigned *x658; /* { dg-error "" "long long signed unsigned" } */
+long long signed _Bool *x659; /* { dg-error "" "long long signed _Bool" } */
+long long signed _Complex *x660; /* { dg-error "" "long long signed _Complex" } */
+long long unsigned void *x661; /* { dg-error "" "long long unsigned void" } */
+long long unsigned char *x662; /* { dg-error "" "long long unsigned char" } */
+long long unsigned short *x663; /* { dg-error "" "long long unsigned short" } */
+long long unsigned int *x664;
+long long unsigned long *x665; /* { dg-error "" "long long unsigned long" } */
+long long unsigned float *x666; /* { dg-error "" "long long unsigned float" } */
+long long unsigned double *x667; /* { dg-error "" "long long unsigned double" } */
+long long unsigned signed *x668; /* { dg-error "" "long long unsigned signed" } */
+long long unsigned unsigned *x669; /* { dg-error "" "long long unsigned unsigned" } */
+long long unsigned _Bool *x670; /* { dg-error "" "long long unsigned _Bool" } */
+long long unsigned _Complex *x671; /* { dg-error "" "long long unsigned _Complex" } */
+long double _Complex void *x672; /* { dg-error "" "long double _Complex void" } */
+long double _Complex char *x673; /* { dg-error "" "long double _Complex char" } */
+long double _Complex short *x674; /* { dg-error "" "long double _Complex short" } */
+long double _Complex int *x675; /* { dg-error "" "long double _Complex int" } */
+long double _Complex long *x676; /* { dg-error "" "long double _Complex long" } */
+long double _Complex float *x677; /* { dg-error "" "long double _Complex float" } */
+long double _Complex double *x678; /* { dg-error "" "long double _Complex double" } */
+long double _Complex signed *x679; /* { dg-error "" "long double _Complex signed" } */
+long double _Complex unsigned *x680; /* { dg-error "" "long double _Complex unsigned" } */
+long double _Complex _Bool *x681; /* { dg-error "" "long double _Complex _Bool" } */
+long double _Complex _Complex *x682; /* { dg-error "" "long double _Complex _Complex" } */
+long signed int void *x683; /* { dg-error "" "long signed int void" } */
+long signed int char *x684; /* { dg-error "" "long signed int char" } */
+long signed int short *x685; /* { dg-error "" "long signed int short" } */
+long signed int int *x686; /* { dg-error "" "long signed int int" } */
+long signed int long *x687;
+long signed int float *x688; /* { dg-error "" "long signed int float" } */
+long signed int double *x689; /* { dg-error "" "long signed int double" } */
+long signed int signed *x690; /* { dg-error "" "long signed int signed" } */
+long signed int unsigned *x691; /* { dg-error "" "long signed int unsigned" } */
+long signed int _Bool *x692; /* { dg-error "" "long signed int _Bool" } */
+long signed int _Complex *x693; /* { dg-error "" "long signed int _Complex" } */
+long signed long void *x694; /* { dg-error "" "long signed long void" } */
+long signed long char *x695; /* { dg-error "" "long signed long char" } */
+long signed long short *x696; /* { dg-error "" "long signed long short" } */
+long signed long int *x697;
+long signed long long *x698; /* { dg-error "" "long signed long long" } */
+long signed long float *x699; /* { dg-error "" "long signed long float" } */
+long signed long double *x700; /* { dg-error "" "long signed long double" } */
+long signed long signed *x701; /* { dg-error "" "long signed long signed" } */
+long signed long unsigned *x702; /* { dg-error "" "long signed long unsigned" } */
+long signed long _Bool *x703; /* { dg-error "" "long signed long _Bool" } */
+long signed long _Complex *x704; /* { dg-error "" "long signed long _Complex" } */
+long unsigned int void *x705; /* { dg-error "" "long unsigned int void" } */
+long unsigned int char *x706; /* { dg-error "" "long unsigned int char" } */
+long unsigned int short *x707; /* { dg-error "" "long unsigned int short" } */
+long unsigned int int *x708; /* { dg-error "" "long unsigned int int" } */
+long unsigned int long *x709;
+long unsigned int float *x710; /* { dg-error "" "long unsigned int float" } */
+long unsigned int double *x711; /* { dg-error "" "long unsigned int double" } */
+long unsigned int signed *x712; /* { dg-error "" "long unsigned int signed" } */
+long unsigned int unsigned *x713; /* { dg-error "" "long unsigned int unsigned" } */
+long unsigned int _Bool *x714; /* { dg-error "" "long unsigned int _Bool" } */
+long unsigned int _Complex *x715; /* { dg-error "" "long unsigned int _Complex" } */
+long unsigned long void *x716; /* { dg-error "" "long unsigned long void" } */
+long unsigned long char *x717; /* { dg-error "" "long unsigned long char" } */
+long unsigned long short *x718; /* { dg-error "" "long unsigned long short" } */
+long unsigned long int *x719;
+long unsigned long long *x720; /* { dg-error "" "long unsigned long long" } */
+long unsigned long float *x721; /* { dg-error "" "long unsigned long float" } */
+long unsigned long double *x722; /* { dg-error "" "long unsigned long double" } */
+long unsigned long signed *x723; /* { dg-error "" "long unsigned long signed" } */
+long unsigned long unsigned *x724; /* { dg-error "" "long unsigned long unsigned" } */
+long unsigned long _Bool *x725; /* { dg-error "" "long unsigned long _Bool" } */
+long unsigned long _Complex *x726; /* { dg-error "" "long unsigned long _Complex" } */
+long _Complex double void *x727; /* { dg-error "" "long _Complex double void" } */
+long _Complex double char *x728; /* { dg-error "" "long _Complex double char" } */
+long _Complex double short *x729; /* { dg-error "" "long _Complex double short" } */
+long _Complex double int *x730; /* { dg-error "" "long _Complex double int" } */
+long _Complex double long *x731; /* { dg-error "" "long _Complex double long" } */
+long _Complex double float *x732; /* { dg-error "" "long _Complex double float" } */
+long _Complex double double *x733; /* { dg-error "" "long _Complex double double" } */
+long _Complex double signed *x734; /* { dg-error "" "long _Complex double signed" } */
+long _Complex double unsigned *x735; /* { dg-error "" "long _Complex double unsigned" } */
+long _Complex double _Bool *x736; /* { dg-error "" "long _Complex double _Bool" } */
+long _Complex double _Complex *x737; /* { dg-error "" "long _Complex double _Complex" } */
+double long _Complex void *x738; /* { dg-error "" "double long _Complex void" } */
+double long _Complex char *x739; /* { dg-error "" "double long _Complex char" } */
+double long _Complex short *x740; /* { dg-error "" "double long _Complex short" } */
+double long _Complex int *x741; /* { dg-error "" "double long _Complex int" } */
+double long _Complex long *x742; /* { dg-error "" "double long _Complex long" } */
+double long _Complex float *x743; /* { dg-error "" "double long _Complex float" } */
+double long _Complex double *x744; /* { dg-error "" "double long _Complex double" } */
+double long _Complex signed *x745; /* { dg-error "" "double long _Complex signed" } */
+double long _Complex unsigned *x746; /* { dg-error "" "double long _Complex unsigned" } */
+double long _Complex _Bool *x747; /* { dg-error "" "double long _Complex _Bool" } */
+double long _Complex _Complex *x748; /* { dg-error "" "double long _Complex _Complex" } */
+double _Complex long void *x749; /* { dg-error "" "double _Complex long void" } */
+double _Complex long char *x750; /* { dg-error "" "double _Complex long char" } */
+double _Complex long short *x751; /* { dg-error "" "double _Complex long short" } */
+double _Complex long int *x752; /* { dg-error "" "double _Complex long int" } */
+double _Complex long long *x753; /* { dg-error "" "double _Complex long long" } */
+double _Complex long float *x754; /* { dg-error "" "double _Complex long float" } */
+double _Complex long double *x755; /* { dg-error "" "double _Complex long double" } */
+double _Complex long signed *x756; /* { dg-error "" "double _Complex long signed" } */
+double _Complex long unsigned *x757; /* { dg-error "" "double _Complex long unsigned" } */
+double _Complex long _Bool *x758; /* { dg-error "" "double _Complex long _Bool" } */
+double _Complex long _Complex *x759; /* { dg-error "" "double _Complex long _Complex" } */
+signed short int void *x760; /* { dg-error "" "signed short int void" } */
+signed short int char *x761; /* { dg-error "" "signed short int char" } */
+signed short int short *x762; /* { dg-error "" "signed short int short" } */
+signed short int int *x763; /* { dg-error "" "signed short int int" } */
+signed short int long *x764; /* { dg-error "" "signed short int long" } */
+signed short int float *x765; /* { dg-error "" "signed short int float" } */
+signed short int double *x766; /* { dg-error "" "signed short int double" } */
+signed short int signed *x767; /* { dg-error "" "signed short int signed" } */
+signed short int unsigned *x768; /* { dg-error "" "signed short int unsigned" } */
+signed short int _Bool *x769; /* { dg-error "" "signed short int _Bool" } */
+signed short int _Complex *x770; /* { dg-error "" "signed short int _Complex" } */
+signed int short void *x771; /* { dg-error "" "signed int short void" } */
+signed int short char *x772; /* { dg-error "" "signed int short char" } */
+signed int short short *x773; /* { dg-error "" "signed int short short" } */
+signed int short int *x774; /* { dg-error "" "signed int short int" } */
+signed int short long *x775; /* { dg-error "" "signed int short long" } */
+signed int short float *x776; /* { dg-error "" "signed int short float" } */
+signed int short double *x777; /* { dg-error "" "signed int short double" } */
+signed int short signed *x778; /* { dg-error "" "signed int short signed" } */
+signed int short unsigned *x779; /* { dg-error "" "signed int short unsigned" } */
+signed int short _Bool *x780; /* { dg-error "" "signed int short _Bool" } */
+signed int short _Complex *x781; /* { dg-error "" "signed int short _Complex" } */
+signed int long void *x782; /* { dg-error "" "signed int long void" } */
+signed int long char *x783; /* { dg-error "" "signed int long char" } */
+signed int long short *x784; /* { dg-error "" "signed int long short" } */
+signed int long int *x785; /* { dg-error "" "signed int long int" } */
+signed int long long *x786;
+signed int long float *x787; /* { dg-error "" "signed int long float" } */
+signed int long double *x788; /* { dg-error "" "signed int long double" } */
+signed int long signed *x789; /* { dg-error "" "signed int long signed" } */
+signed int long unsigned *x790; /* { dg-error "" "signed int long unsigned" } */
+signed int long _Bool *x791; /* { dg-error "" "signed int long _Bool" } */
+signed int long _Complex *x792; /* { dg-error "" "signed int long _Complex" } */
+signed long int void *x793; /* { dg-error "" "signed long int void" } */
+signed long int char *x794; /* { dg-error "" "signed long int char" } */
+signed long int short *x795; /* { dg-error "" "signed long int short" } */
+signed long int int *x796; /* { dg-error "" "signed long int int" } */
+signed long int long *x797;
+signed long int float *x798; /* { dg-error "" "signed long int float" } */
+signed long int double *x799; /* { dg-error "" "signed long int double" } */
+signed long int signed *x800; /* { dg-error "" "signed long int signed" } */
+signed long int unsigned *x801; /* { dg-error "" "signed long int unsigned" } */
+signed long int _Bool *x802; /* { dg-error "" "signed long int _Bool" } */
+signed long int _Complex *x803; /* { dg-error "" "signed long int _Complex" } */
+signed long long void *x804; /* { dg-error "" "signed long long void" } */
+signed long long char *x805; /* { dg-error "" "signed long long char" } */
+signed long long short *x806; /* { dg-error "" "signed long long short" } */
+signed long long int *x807;
+signed long long long *x808; /* { dg-error "" "signed long long long" } */
+signed long long float *x809; /* { dg-error "" "signed long long float" } */
+signed long long double *x810; /* { dg-error "" "signed long long double" } */
+signed long long signed *x811; /* { dg-error "" "signed long long signed" } */
+signed long long unsigned *x812; /* { dg-error "" "signed long long unsigned" } */
+signed long long _Bool *x813; /* { dg-error "" "signed long long _Bool" } */
+signed long long _Complex *x814; /* { dg-error "" "signed long long _Complex" } */
+unsigned short int void *x815; /* { dg-error "" "unsigned short int void" } */
+unsigned short int char *x816; /* { dg-error "" "unsigned short int char" } */
+unsigned short int short *x817; /* { dg-error "" "unsigned short int short" } */
+unsigned short int int *x818; /* { dg-error "" "unsigned short int int" } */
+unsigned short int long *x819; /* { dg-error "" "unsigned short int long" } */
+unsigned short int float *x820; /* { dg-error "" "unsigned short int float" } */
+unsigned short int double *x821; /* { dg-error "" "unsigned short int double" } */
+unsigned short int signed *x822; /* { dg-error "" "unsigned short int signed" } */
+unsigned short int unsigned *x823; /* { dg-error "" "unsigned short int unsigned" } */
+unsigned short int _Bool *x824; /* { dg-error "" "unsigned short int _Bool" } */
+unsigned short int _Complex *x825; /* { dg-error "" "unsigned short int _Complex" } */
+unsigned int short void *x826; /* { dg-error "" "unsigned int short void" } */
+unsigned int short char *x827; /* { dg-error "" "unsigned int short char" } */
+unsigned int short short *x828; /* { dg-error "" "unsigned int short short" } */
+unsigned int short int *x829; /* { dg-error "" "unsigned int short int" } */
+unsigned int short long *x830; /* { dg-error "" "unsigned int short long" } */
+unsigned int short float *x831; /* { dg-error "" "unsigned int short float" } */
+unsigned int short double *x832; /* { dg-error "" "unsigned int short double" } */
+unsigned int short signed *x833; /* { dg-error "" "unsigned int short signed" } */
+unsigned int short unsigned *x834; /* { dg-error "" "unsigned int short unsigned" } */
+unsigned int short _Bool *x835; /* { dg-error "" "unsigned int short _Bool" } */
+unsigned int short _Complex *x836; /* { dg-error "" "unsigned int short _Complex" } */
+unsigned int long void *x837; /* { dg-error "" "unsigned int long void" } */
+unsigned int long char *x838; /* { dg-error "" "unsigned int long char" } */
+unsigned int long short *x839; /* { dg-error "" "unsigned int long short" } */
+unsigned int long int *x840; /* { dg-error "" "unsigned int long int" } */
+unsigned int long long *x841;
+unsigned int long float *x842; /* { dg-error "" "unsigned int long float" } */
+unsigned int long double *x843; /* { dg-error "" "unsigned int long double" } */
+unsigned int long signed *x844; /* { dg-error "" "unsigned int long signed" } */
+unsigned int long unsigned *x845; /* { dg-error "" "unsigned int long unsigned" } */
+unsigned int long _Bool *x846; /* { dg-error "" "unsigned int long _Bool" } */
+unsigned int long _Complex *x847; /* { dg-error "" "unsigned int long _Complex" } */
+unsigned long int void *x848; /* { dg-error "" "unsigned long int void" } */
+unsigned long int char *x849; /* { dg-error "" "unsigned long int char" } */
+unsigned long int short *x850; /* { dg-error "" "unsigned long int short" } */
+unsigned long int int *x851; /* { dg-error "" "unsigned long int int" } */
+unsigned long int long *x852;
+unsigned long int float *x853; /* { dg-error "" "unsigned long int float" } */
+unsigned long int double *x854; /* { dg-error "" "unsigned long int double" } */
+unsigned long int signed *x855; /* { dg-error "" "unsigned long int signed" } */
+unsigned long int unsigned *x856; /* { dg-error "" "unsigned long int unsigned" } */
+unsigned long int _Bool *x857; /* { dg-error "" "unsigned long int _Bool" } */
+unsigned long int _Complex *x858; /* { dg-error "" "unsigned long int _Complex" } */
+unsigned long long void *x859; /* { dg-error "" "unsigned long long void" } */
+unsigned long long char *x860; /* { dg-error "" "unsigned long long char" } */
+unsigned long long short *x861; /* { dg-error "" "unsigned long long short" } */
+unsigned long long int *x862;
+unsigned long long long *x863; /* { dg-error "" "unsigned long long long" } */
+unsigned long long float *x864; /* { dg-error "" "unsigned long long float" } */
+unsigned long long double *x865; /* { dg-error "" "unsigned long long double" } */
+unsigned long long signed *x866; /* { dg-error "" "unsigned long long signed" } */
+unsigned long long unsigned *x867; /* { dg-error "" "unsigned long long unsigned" } */
+unsigned long long _Bool *x868; /* { dg-error "" "unsigned long long _Bool" } */
+unsigned long long _Complex *x869; /* { dg-error "" "unsigned long long _Complex" } */
+_Complex long double void *x870; /* { dg-error "" "_Complex long double void" } */
+_Complex long double char *x871; /* { dg-error "" "_Complex long double char" } */
+_Complex long double short *x872; /* { dg-error "" "_Complex long double short" } */
+_Complex long double int *x873; /* { dg-error "" "_Complex long double int" } */
+_Complex long double long *x874; /* { dg-error "" "_Complex long double long" } */
+_Complex long double float *x875; /* { dg-error "" "_Complex long double float" } */
+_Complex long double double *x876; /* { dg-error "" "_Complex long double double" } */
+_Complex long double signed *x877; /* { dg-error "" "_Complex long double signed" } */
+_Complex long double unsigned *x878; /* { dg-error "" "_Complex long double unsigned" } */
+_Complex long double _Bool *x879; /* { dg-error "" "_Complex long double _Bool" } */
+_Complex long double _Complex *x880; /* { dg-error "" "_Complex long double _Complex" } */
+_Complex double long void *x881; /* { dg-error "" "_Complex double long void" } */
+_Complex double long char *x882; /* { dg-error "" "_Complex double long char" } */
+_Complex double long short *x883; /* { dg-error "" "_Complex double long short" } */
+_Complex double long int *x884; /* { dg-error "" "_Complex double long int" } */
+_Complex double long long *x885; /* { dg-error "" "_Complex double long long" } */
+_Complex double long float *x886; /* { dg-error "" "_Complex double long float" } */
+_Complex double long double *x887; /* { dg-error "" "_Complex double long double" } */
+_Complex double long signed *x888; /* { dg-error "" "_Complex double long signed" } */
+_Complex double long unsigned *x889; /* { dg-error "" "_Complex double long unsigned" } */
+_Complex double long _Bool *x890; /* { dg-error "" "_Complex double long _Bool" } */
+_Complex double long _Complex *x891; /* { dg-error "" "_Complex double long _Complex" } */
+int long long signed void *x892; /* { dg-error "" "int long long signed void" } */
+int long long signed char *x893; /* { dg-error "" "int long long signed char" } */
+int long long signed short *x894; /* { dg-error "" "int long long signed short" } */
+int long long signed int *x895; /* { dg-error "" "int long long signed int" } */
+int long long signed long *x896; /* { dg-error "" "int long long signed long" } */
+int long long signed float *x897; /* { dg-error "" "int long long signed float" } */
+int long long signed double *x898; /* { dg-error "" "int long long signed double" } */
+int long long signed signed *x899; /* { dg-error "" "int long long signed signed" } */
+int long long signed unsigned *x900; /* { dg-error "" "int long long signed unsigned" } */
+int long long signed _Bool *x901; /* { dg-error "" "int long long signed _Bool" } */
+int long long signed _Complex *x902; /* { dg-error "" "int long long signed _Complex" } */
+int long long unsigned void *x903; /* { dg-error "" "int long long unsigned void" } */
+int long long unsigned char *x904; /* { dg-error "" "int long long unsigned char" } */
+int long long unsigned short *x905; /* { dg-error "" "int long long unsigned short" } */
+int long long unsigned int *x906; /* { dg-error "" "int long long unsigned int" } */
+int long long unsigned long *x907; /* { dg-error "" "int long long unsigned long" } */
+int long long unsigned float *x908; /* { dg-error "" "int long long unsigned float" } */
+int long long unsigned double *x909; /* { dg-error "" "int long long unsigned double" } */
+int long long unsigned signed *x910; /* { dg-error "" "int long long unsigned signed" } */
+int long long unsigned unsigned *x911; /* { dg-error "" "int long long unsigned unsigned" } */
+int long long unsigned _Bool *x912; /* { dg-error "" "int long long unsigned _Bool" } */
+int long long unsigned _Complex *x913; /* { dg-error "" "int long long unsigned _Complex" } */
+int long signed long void *x914; /* { dg-error "" "int long signed long void" } */
+int long signed long char *x915; /* { dg-error "" "int long signed long char" } */
+int long signed long short *x916; /* { dg-error "" "int long signed long short" } */
+int long signed long int *x917; /* { dg-error "" "int long signed long int" } */
+int long signed long long *x918; /* { dg-error "" "int long signed long long" } */
+int long signed long float *x919; /* { dg-error "" "int long signed long float" } */
+int long signed long double *x920; /* { dg-error "" "int long signed long double" } */
+int long signed long signed *x921; /* { dg-error "" "int long signed long signed" } */
+int long signed long unsigned *x922; /* { dg-error "" "int long signed long unsigned" } */
+int long signed long _Bool *x923; /* { dg-error "" "int long signed long _Bool" } */
+int long signed long _Complex *x924; /* { dg-error "" "int long signed long _Complex" } */
+int long unsigned long void *x925; /* { dg-error "" "int long unsigned long void" } */
+int long unsigned long char *x926; /* { dg-error "" "int long unsigned long char" } */
+int long unsigned long short *x927; /* { dg-error "" "int long unsigned long short" } */
+int long unsigned long int *x928; /* { dg-error "" "int long unsigned long int" } */
+int long unsigned long long *x929; /* { dg-error "" "int long unsigned long long" } */
+int long unsigned long float *x930; /* { dg-error "" "int long unsigned long float" } */
+int long unsigned long double *x931; /* { dg-error "" "int long unsigned long double" } */
+int long unsigned long signed *x932; /* { dg-error "" "int long unsigned long signed" } */
+int long unsigned long unsigned *x933; /* { dg-error "" "int long unsigned long unsigned" } */
+int long unsigned long _Bool *x934; /* { dg-error "" "int long unsigned long _Bool" } */
+int long unsigned long _Complex *x935; /* { dg-error "" "int long unsigned long _Complex" } */
+int signed long long void *x936; /* { dg-error "" "int signed long long void" } */
+int signed long long char *x937; /* { dg-error "" "int signed long long char" } */
+int signed long long short *x938; /* { dg-error "" "int signed long long short" } */
+int signed long long int *x939; /* { dg-error "" "int signed long long int" } */
+int signed long long long *x940; /* { dg-error "" "int signed long long long" } */
+int signed long long float *x941; /* { dg-error "" "int signed long long float" } */
+int signed long long double *x942; /* { dg-error "" "int signed long long double" } */
+int signed long long signed *x943; /* { dg-error "" "int signed long long signed" } */
+int signed long long unsigned *x944; /* { dg-error "" "int signed long long unsigned" } */
+int signed long long _Bool *x945; /* { dg-error "" "int signed long long _Bool" } */
+int signed long long _Complex *x946; /* { dg-error "" "int signed long long _Complex" } */
+int unsigned long long void *x947; /* { dg-error "" "int unsigned long long void" } */
+int unsigned long long char *x948; /* { dg-error "" "int unsigned long long char" } */
+int unsigned long long short *x949; /* { dg-error "" "int unsigned long long short" } */
+int unsigned long long int *x950; /* { dg-error "" "int unsigned long long int" } */
+int unsigned long long long *x951; /* { dg-error "" "int unsigned long long long" } */
+int unsigned long long float *x952; /* { dg-error "" "int unsigned long long float" } */
+int unsigned long long double *x953; /* { dg-error "" "int unsigned long long double" } */
+int unsigned long long signed *x954; /* { dg-error "" "int unsigned long long signed" } */
+int unsigned long long unsigned *x955; /* { dg-error "" "int unsigned long long unsigned" } */
+int unsigned long long _Bool *x956; /* { dg-error "" "int unsigned long long _Bool" } */
+int unsigned long long _Complex *x957; /* { dg-error "" "int unsigned long long _Complex" } */
+long int long signed void *x958; /* { dg-error "" "long int long signed void" } */
+long int long signed char *x959; /* { dg-error "" "long int long signed char" } */
+long int long signed short *x960; /* { dg-error "" "long int long signed short" } */
+long int long signed int *x961; /* { dg-error "" "long int long signed int" } */
+long int long signed long *x962; /* { dg-error "" "long int long signed long" } */
+long int long signed float *x963; /* { dg-error "" "long int long signed float" } */
+long int long signed double *x964; /* { dg-error "" "long int long signed double" } */
+long int long signed signed *x965; /* { dg-error "" "long int long signed signed" } */
+long int long signed unsigned *x966; /* { dg-error "" "long int long signed unsigned" } */
+long int long signed _Bool *x967; /* { dg-error "" "long int long signed _Bool" } */
+long int long signed _Complex *x968; /* { dg-error "" "long int long signed _Complex" } */
+long int long unsigned void *x969; /* { dg-error "" "long int long unsigned void" } */
+long int long unsigned char *x970; /* { dg-error "" "long int long unsigned char" } */
+long int long unsigned short *x971; /* { dg-error "" "long int long unsigned short" } */
+long int long unsigned int *x972; /* { dg-error "" "long int long unsigned int" } */
+long int long unsigned long *x973; /* { dg-error "" "long int long unsigned long" } */
+long int long unsigned float *x974; /* { dg-error "" "long int long unsigned float" } */
+long int long unsigned double *x975; /* { dg-error "" "long int long unsigned double" } */
+long int long unsigned signed *x976; /* { dg-error "" "long int long unsigned signed" } */
+long int long unsigned unsigned *x977; /* { dg-error "" "long int long unsigned unsigned" } */
+long int long unsigned _Bool *x978; /* { dg-error "" "long int long unsigned _Bool" } */
+long int long unsigned _Complex *x979; /* { dg-error "" "long int long unsigned _Complex" } */
+long int signed long void *x980; /* { dg-error "" "long int signed long void" } */
+long int signed long char *x981; /* { dg-error "" "long int signed long char" } */
+long int signed long short *x982; /* { dg-error "" "long int signed long short" } */
+long int signed long int *x983; /* { dg-error "" "long int signed long int" } */
+long int signed long long *x984; /* { dg-error "" "long int signed long long" } */
+long int signed long float *x985; /* { dg-error "" "long int signed long float" } */
+long int signed long double *x986; /* { dg-error "" "long int signed long double" } */
+long int signed long signed *x987; /* { dg-error "" "long int signed long signed" } */
+long int signed long unsigned *x988; /* { dg-error "" "long int signed long unsigned" } */
+long int signed long _Bool *x989; /* { dg-error "" "long int signed long _Bool" } */
+long int signed long _Complex *x990; /* { dg-error "" "long int signed long _Complex" } */
+long int unsigned long void *x991; /* { dg-error "" "long int unsigned long void" } */
+long int unsigned long char *x992; /* { dg-error "" "long int unsigned long char" } */
+long int unsigned long short *x993; /* { dg-error "" "long int unsigned long short" } */
+long int unsigned long int *x994; /* { dg-error "" "long int unsigned long int" } */
+long int unsigned long long *x995; /* { dg-error "" "long int unsigned long long" } */
+long int unsigned long float *x996; /* { dg-error "" "long int unsigned long float" } */
+long int unsigned long double *x997; /* { dg-error "" "long int unsigned long double" } */
+long int unsigned long signed *x998; /* { dg-error "" "long int unsigned long signed" } */
+long int unsigned long unsigned *x999; /* { dg-error "" "long int unsigned long unsigned" } */
+long int unsigned long _Bool *x1000; /* { dg-error "" "long int unsigned long _Bool" } */
+long int unsigned long _Complex *x1001; /* { dg-error "" "long int unsigned long _Complex" } */
+long long int signed void *x1002; /* { dg-error "" "long long int signed void" } */
+long long int signed char *x1003; /* { dg-error "" "long long int signed char" } */
+long long int signed short *x1004; /* { dg-error "" "long long int signed short" } */
+long long int signed int *x1005; /* { dg-error "" "long long int signed int" } */
+long long int signed long *x1006; /* { dg-error "" "long long int signed long" } */
+long long int signed float *x1007; /* { dg-error "" "long long int signed float" } */
+long long int signed double *x1008; /* { dg-error "" "long long int signed double" } */
+long long int signed signed *x1009; /* { dg-error "" "long long int signed signed" } */
+long long int signed unsigned *x1010; /* { dg-error "" "long long int signed unsigned" } */
+long long int signed _Bool *x1011; /* { dg-error "" "long long int signed _Bool" } */
+long long int signed _Complex *x1012; /* { dg-error "" "long long int signed _Complex" } */
+long long int unsigned void *x1013; /* { dg-error "" "long long int unsigned void" } */
+long long int unsigned char *x1014; /* { dg-error "" "long long int unsigned char" } */
+long long int unsigned short *x1015; /* { dg-error "" "long long int unsigned short" } */
+long long int unsigned int *x1016; /* { dg-error "" "long long int unsigned int" } */
+long long int unsigned long *x1017; /* { dg-error "" "long long int unsigned long" } */
+long long int unsigned float *x1018; /* { dg-error "" "long long int unsigned float" } */
+long long int unsigned double *x1019; /* { dg-error "" "long long int unsigned double" } */
+long long int unsigned signed *x1020; /* { dg-error "" "long long int unsigned signed" } */
+long long int unsigned unsigned *x1021; /* { dg-error "" "long long int unsigned unsigned" } */
+long long int unsigned _Bool *x1022; /* { dg-error "" "long long int unsigned _Bool" } */
+long long int unsigned _Complex *x1023; /* { dg-error "" "long long int unsigned _Complex" } */
+long long signed int void *x1024; /* { dg-error "" "long long signed int void" } */
+long long signed int char *x1025; /* { dg-error "" "long long signed int char" } */
+long long signed int short *x1026; /* { dg-error "" "long long signed int short" } */
+long long signed int int *x1027; /* { dg-error "" "long long signed int int" } */
+long long signed int long *x1028; /* { dg-error "" "long long signed int long" } */
+long long signed int float *x1029; /* { dg-error "" "long long signed int float" } */
+long long signed int double *x1030; /* { dg-error "" "long long signed int double" } */
+long long signed int signed *x1031; /* { dg-error "" "long long signed int signed" } */
+long long signed int unsigned *x1032; /* { dg-error "" "long long signed int unsigned" } */
+long long signed int _Bool *x1033; /* { dg-error "" "long long signed int _Bool" } */
+long long signed int _Complex *x1034; /* { dg-error "" "long long signed int _Complex" } */
+long long unsigned int void *x1035; /* { dg-error "" "long long unsigned int void" } */
+long long unsigned int char *x1036; /* { dg-error "" "long long unsigned int char" } */
+long long unsigned int short *x1037; /* { dg-error "" "long long unsigned int short" } */
+long long unsigned int int *x1038; /* { dg-error "" "long long unsigned int int" } */
+long long unsigned int long *x1039; /* { dg-error "" "long long unsigned int long" } */
+long long unsigned int float *x1040; /* { dg-error "" "long long unsigned int float" } */
+long long unsigned int double *x1041; /* { dg-error "" "long long unsigned int double" } */
+long long unsigned int signed *x1042; /* { dg-error "" "long long unsigned int signed" } */
+long long unsigned int unsigned *x1043; /* { dg-error "" "long long unsigned int unsigned" } */
+long long unsigned int _Bool *x1044; /* { dg-error "" "long long unsigned int _Bool" } */
+long long unsigned int _Complex *x1045; /* { dg-error "" "long long unsigned int _Complex" } */
+long signed int long void *x1046; /* { dg-error "" "long signed int long void" } */
+long signed int long char *x1047; /* { dg-error "" "long signed int long char" } */
+long signed int long short *x1048; /* { dg-error "" "long signed int long short" } */
+long signed int long int *x1049; /* { dg-error "" "long signed int long int" } */
+long signed int long long *x1050; /* { dg-error "" "long signed int long long" } */
+long signed int long float *x1051; /* { dg-error "" "long signed int long float" } */
+long signed int long double *x1052; /* { dg-error "" "long signed int long double" } */
+long signed int long signed *x1053; /* { dg-error "" "long signed int long signed" } */
+long signed int long unsigned *x1054; /* { dg-error "" "long signed int long unsigned" } */
+long signed int long _Bool *x1055; /* { dg-error "" "long signed int long _Bool" } */
+long signed int long _Complex *x1056; /* { dg-error "" "long signed int long _Complex" } */
+long signed long int void *x1057; /* { dg-error "" "long signed long int void" } */
+long signed long int char *x1058; /* { dg-error "" "long signed long int char" } */
+long signed long int short *x1059; /* { dg-error "" "long signed long int short" } */
+long signed long int int *x1060; /* { dg-error "" "long signed long int int" } */
+long signed long int long *x1061; /* { dg-error "" "long signed long int long" } */
+long signed long int float *x1062; /* { dg-error "" "long signed long int float" } */
+long signed long int double *x1063; /* { dg-error "" "long signed long int double" } */
+long signed long int signed *x1064; /* { dg-error "" "long signed long int signed" } */
+long signed long int unsigned *x1065; /* { dg-error "" "long signed long int unsigned" } */
+long signed long int _Bool *x1066; /* { dg-error "" "long signed long int _Bool" } */
+long signed long int _Complex *x1067; /* { dg-error "" "long signed long int _Complex" } */
+long unsigned int long void *x1068; /* { dg-error "" "long unsigned int long void" } */
+long unsigned int long char *x1069; /* { dg-error "" "long unsigned int long char" } */
+long unsigned int long short *x1070; /* { dg-error "" "long unsigned int long short" } */
+long unsigned int long int *x1071; /* { dg-error "" "long unsigned int long int" } */
+long unsigned int long long *x1072; /* { dg-error "" "long unsigned int long long" } */
+long unsigned int long float *x1073; /* { dg-error "" "long unsigned int long float" } */
+long unsigned int long double *x1074; /* { dg-error "" "long unsigned int long double" } */
+long unsigned int long signed *x1075; /* { dg-error "" "long unsigned int long signed" } */
+long unsigned int long unsigned *x1076; /* { dg-error "" "long unsigned int long unsigned" } */
+long unsigned int long _Bool *x1077; /* { dg-error "" "long unsigned int long _Bool" } */
+long unsigned int long _Complex *x1078; /* { dg-error "" "long unsigned int long _Complex" } */
+long unsigned long int void *x1079; /* { dg-error "" "long unsigned long int void" } */
+long unsigned long int char *x1080; /* { dg-error "" "long unsigned long int char" } */
+long unsigned long int short *x1081; /* { dg-error "" "long unsigned long int short" } */
+long unsigned long int int *x1082; /* { dg-error "" "long unsigned long int int" } */
+long unsigned long int long *x1083; /* { dg-error "" "long unsigned long int long" } */
+long unsigned long int float *x1084; /* { dg-error "" "long unsigned long int float" } */
+long unsigned long int double *x1085; /* { dg-error "" "long unsigned long int double" } */
+long unsigned long int signed *x1086; /* { dg-error "" "long unsigned long int signed" } */
+long unsigned long int unsigned *x1087; /* { dg-error "" "long unsigned long int unsigned" } */
+long unsigned long int _Bool *x1088; /* { dg-error "" "long unsigned long int _Bool" } */
+long unsigned long int _Complex *x1089; /* { dg-error "" "long unsigned long int _Complex" } */
+signed int long long void *x1090; /* { dg-error "" "signed int long long void" } */
+signed int long long char *x1091; /* { dg-error "" "signed int long long char" } */
+signed int long long short *x1092; /* { dg-error "" "signed int long long short" } */
+signed int long long int *x1093; /* { dg-error "" "signed int long long int" } */
+signed int long long long *x1094; /* { dg-error "" "signed int long long long" } */
+signed int long long float *x1095; /* { dg-error "" "signed int long long float" } */
+signed int long long double *x1096; /* { dg-error "" "signed int long long double" } */
+signed int long long signed *x1097; /* { dg-error "" "signed int long long signed" } */
+signed int long long unsigned *x1098; /* { dg-error "" "signed int long long unsigned" } */
+signed int long long _Bool *x1099; /* { dg-error "" "signed int long long _Bool" } */
+signed int long long _Complex *x1100; /* { dg-error "" "signed int long long _Complex" } */
+signed long int long void *x1101; /* { dg-error "" "signed long int long void" } */
+signed long int long char *x1102; /* { dg-error "" "signed long int long char" } */
+signed long int long short *x1103; /* { dg-error "" "signed long int long short" } */
+signed long int long int *x1104; /* { dg-error "" "signed long int long int" } */
+signed long int long long *x1105; /* { dg-error "" "signed long int long long" } */
+signed long int long float *x1106; /* { dg-error "" "signed long int long float" } */
+signed long int long double *x1107; /* { dg-error "" "signed long int long double" } */
+signed long int long signed *x1108; /* { dg-error "" "signed long int long signed" } */
+signed long int long unsigned *x1109; /* { dg-error "" "signed long int long unsigned" } */
+signed long int long _Bool *x1110; /* { dg-error "" "signed long int long _Bool" } */
+signed long int long _Complex *x1111; /* { dg-error "" "signed long int long _Complex" } */
+signed long long int void *x1112; /* { dg-error "" "signed long long int void" } */
+signed long long int char *x1113; /* { dg-error "" "signed long long int char" } */
+signed long long int short *x1114; /* { dg-error "" "signed long long int short" } */
+signed long long int int *x1115; /* { dg-error "" "signed long long int int" } */
+signed long long int long *x1116; /* { dg-error "" "signed long long int long" } */
+signed long long int float *x1117; /* { dg-error "" "signed long long int float" } */
+signed long long int double *x1118; /* { dg-error "" "signed long long int double" } */
+signed long long int signed *x1119; /* { dg-error "" "signed long long int signed" } */
+signed long long int unsigned *x1120; /* { dg-error "" "signed long long int unsigned" } */
+signed long long int _Bool *x1121; /* { dg-error "" "signed long long int _Bool" } */
+signed long long int _Complex *x1122; /* { dg-error "" "signed long long int _Complex" } */
+unsigned int long long void *x1123; /* { dg-error "" "unsigned int long long void" } */
+unsigned int long long char *x1124; /* { dg-error "" "unsigned int long long char" } */
+unsigned int long long short *x1125; /* { dg-error "" "unsigned int long long short" } */
+unsigned int long long int *x1126; /* { dg-error "" "unsigned int long long int" } */
+unsigned int long long long *x1127; /* { dg-error "" "unsigned int long long long" } */
+unsigned int long long float *x1128; /* { dg-error "" "unsigned int long long float" } */
+unsigned int long long double *x1129; /* { dg-error "" "unsigned int long long double" } */
+unsigned int long long signed *x1130; /* { dg-error "" "unsigned int long long signed" } */
+unsigned int long long unsigned *x1131; /* { dg-error "" "unsigned int long long unsigned" } */
+unsigned int long long _Bool *x1132; /* { dg-error "" "unsigned int long long _Bool" } */
+unsigned int long long _Complex *x1133; /* { dg-error "" "unsigned int long long _Complex" } */
+unsigned long int long void *x1134; /* { dg-error "" "unsigned long int long void" } */
+unsigned long int long char *x1135; /* { dg-error "" "unsigned long int long char" } */
+unsigned long int long short *x1136; /* { dg-error "" "unsigned long int long short" } */
+unsigned long int long int *x1137; /* { dg-error "" "unsigned long int long int" } */
+unsigned long int long long *x1138; /* { dg-error "" "unsigned long int long long" } */
+unsigned long int long float *x1139; /* { dg-error "" "unsigned long int long float" } */
+unsigned long int long double *x1140; /* { dg-error "" "unsigned long int long double" } */
+unsigned long int long signed *x1141; /* { dg-error "" "unsigned long int long signed" } */
+unsigned long int long unsigned *x1142; /* { dg-error "" "unsigned long int long unsigned" } */
+unsigned long int long _Bool *x1143; /* { dg-error "" "unsigned long int long _Bool" } */
+unsigned long int long _Complex *x1144; /* { dg-error "" "unsigned long int long _Complex" } */
+unsigned long long int void *x1145; /* { dg-error "" "unsigned long long int void" } */
+unsigned long long int char *x1146; /* { dg-error "" "unsigned long long int char" } */
+unsigned long long int short *x1147; /* { dg-error "" "unsigned long long int short" } */
+unsigned long long int int *x1148; /* { dg-error "" "unsigned long long int int" } */
+unsigned long long int long *x1149; /* { dg-error "" "unsigned long long int long" } */
+unsigned long long int float *x1150; /* { dg-error "" "unsigned long long int float" } */
+unsigned long long int double *x1151; /* { dg-error "" "unsigned long long int double" } */
+unsigned long long int signed *x1152; /* { dg-error "" "unsigned long long int signed" } */
+unsigned long long int unsigned *x1153; /* { dg-error "" "unsigned long long int unsigned" } */
+unsigned long long int _Bool *x1154; /* { dg-error "" "unsigned long long int _Bool" } */
+unsigned long long int _Complex *x1155; /* { dg-error "" "unsigned long long int _Complex" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-version-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-version-1.c
new file mode 100644
index 000000000..b99d54c7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-version-1.c
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C99. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 199901L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-1.c
new file mode 100644
index 000000000..4a3a0f8e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-1.c
@@ -0,0 +1,12 @@
+/* Origin: PR 3467 */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+tdef (int n)
+{
+ typedef int A[n]; /* { dg-bogus "forbids variable length array" } */
+ A a;
+ A *p;
+ p = &a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-2.c
new file mode 100644
index 000000000..de15c73c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-2.c
@@ -0,0 +1,107 @@
+/* Test composite type of VLA and fixed-size array: should be the
+ fixed-size type. Bug 22192. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+/* Test that the given expression (of pointer-to-array type) points to
+ the right sort of array. */
+#define TEST_FIXED_SIZE(a) do { static int x[sizeof(*(a))]; (void)x; } while (0)
+#define TEST_VLA(a) do { (void)sizeof(*(a)); (void)(1 ? (a) : (__typeof__(**(a)) (*)[1])0); (void)(1 ? (a) : (__typeof__(**(a)) (*)[2])0); } while (0)
+#define TEST_INCOMPLETE(a) do { __typeof__(*(a)) x = { 0 }; (void)x; (void)(1 ? a : (__typeof__(**(a)) (*)[1])0); (void)(1 ? a : (__typeof__(**(a)) (*)[2])0); } while (0)
+
+#define TEST_COMP_FIX(a, b) TEST_FIXED_SIZE(i ? a : b)
+#define TEST_COMP_VLA(a, b) TEST_VLA(i ? a : b)
+#define TEST_COMP_INC(a, b) TEST_INCOMPLETE(i ? a : b)
+
+void
+foo (int i, int j)
+{
+ typedef int I;
+ int (*pf)[2];
+ int (*pv)[i];
+ int (*pi)[];
+ I (*pfI)[2];
+ I (*pvI)[i];
+ I (*piI)[];
+ TEST_COMP_FIX(pf, pf);
+ TEST_COMP_FIX(pf, pv);
+ TEST_COMP_FIX(pf, pi);
+ TEST_COMP_FIX(pf, pfI);
+ TEST_COMP_FIX(pf, pvI);
+ TEST_COMP_FIX(pf, piI);
+ TEST_COMP_FIX(pv, pf);
+ TEST_COMP_VLA(pv, pv);
+ TEST_COMP_VLA(pv, pi);
+ TEST_COMP_FIX(pv, pfI);
+ TEST_COMP_VLA(pv, pvI);
+ TEST_COMP_VLA(pv, piI);
+ TEST_COMP_FIX(pi, pf);
+ TEST_COMP_VLA(pi, pv);
+ TEST_COMP_INC(pi, pi);
+ TEST_COMP_FIX(pi, pfI);
+ TEST_COMP_VLA(pi, pvI);
+ TEST_COMP_INC(pi, piI);
+ TEST_COMP_FIX(pfI, pf);
+ TEST_COMP_FIX(pfI, pv);
+ TEST_COMP_FIX(pfI, pi);
+ TEST_COMP_FIX(pfI, pfI);
+ TEST_COMP_FIX(pfI, pvI);
+ TEST_COMP_FIX(pfI, piI);
+ TEST_COMP_FIX(pvI, pf);
+ TEST_COMP_VLA(pvI, pv);
+ TEST_COMP_VLA(pvI, pi);
+ TEST_COMP_FIX(pvI, pfI);
+ TEST_COMP_VLA(pvI, pvI);
+ TEST_COMP_VLA(pvI, piI);
+ TEST_COMP_FIX(piI, pf);
+ TEST_COMP_VLA(piI, pv);
+ TEST_COMP_INC(piI, pi);
+ TEST_COMP_FIX(piI, pfI);
+ TEST_COMP_VLA(piI, pvI);
+ TEST_COMP_INC(piI, piI);
+ typedef int (*Ti)[i];
+ typedef int (*Tj)[j];
+ Ti (*qf)[2];
+ Ti (*qv)[i];
+ Ti (*qi)[];
+ Tj (*rf)[2];
+ Tj (*rv)[j];
+ Tj (*ri)[];
+ TEST_COMP_FIX(qf, qf);
+ TEST_COMP_FIX(qf, qv);
+ TEST_COMP_FIX(qf, qi);
+ TEST_COMP_FIX(qf, rf);
+ TEST_COMP_FIX(qf, rv);
+ TEST_COMP_FIX(qf, ri);
+ TEST_COMP_FIX(qv, qf);
+ TEST_COMP_VLA(qv, qv);
+ TEST_COMP_VLA(qv, qi);
+ TEST_COMP_FIX(qv, rf);
+ TEST_COMP_VLA(qv, rv);
+ TEST_COMP_VLA(qv, ri);
+ TEST_COMP_FIX(qi, qf);
+ TEST_COMP_VLA(qi, qv);
+ TEST_COMP_INC(qi, qi);
+ TEST_COMP_FIX(qi, rf);
+ TEST_COMP_VLA(qi, rv);
+ TEST_COMP_INC(qi, ri);
+ TEST_COMP_FIX(rf, qf);
+ TEST_COMP_FIX(rf, qv);
+ TEST_COMP_FIX(rf, qi);
+ TEST_COMP_FIX(rf, rf);
+ TEST_COMP_FIX(rf, rv);
+ TEST_COMP_FIX(rf, ri);
+ TEST_COMP_FIX(rv, qf);
+ TEST_COMP_VLA(rv, qv);
+ TEST_COMP_VLA(rv, qi);
+ TEST_COMP_FIX(rv, rf);
+ TEST_COMP_VLA(rv, rv);
+ TEST_COMP_VLA(rv, ri);
+ TEST_COMP_FIX(ri, qf);
+ TEST_COMP_VLA(ri, qv);
+ TEST_COMP_INC(ri, qi);
+ TEST_COMP_FIX(ri, rf);
+ TEST_COMP_VLA(ri, rv);
+ TEST_COMP_INC(ri, ri);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-1.c
new file mode 100644
index 000000000..0747475e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-1.c
@@ -0,0 +1,309 @@
+/* Test for labels and VM declarations: bug 12913.
+ goto statements must not jump into the scope of VM declarations.
+
+ This tests all combinations of label and goto locations in a given
+ function.
+
+ c99-vla-jump-1.c tests with just that label and goto, VLAs.
+ c99-vla-jump-2.c tests with many other labels and gotos, VLAs.
+ c99-vla-jump-3.c tests with just that label and goto, VM.
+ c99-vla-jump-4.c tests with many other labels and gotos, VM.
+ c99-vla-jump-5.c tests with switch statements. */
+
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void fa0 (int n) { goto a; a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa1 (int n) { goto a; { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "21:jump into scope of identifier with variably modified type" } */
+void fa2 (int n) { goto a; { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "21:jump into scope of identifier with variably modified type" } */
+void fa3 (int n) { goto a; { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "21:jump into scope of identifier with variably modified type" } */
+void fa4 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "21:jump into scope of identifier with variably modified type" } */
+void fa5 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "21:jump into scope of identifier with variably modified type" } */
+void fa6 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa7 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa8 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa9 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa10 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa11 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa12 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa13 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa14 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa15 (int n) { goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa16 (int n) { a: goto a; { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa17 (int n) { a:{ int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa18 (int n) { { int b[n]; goto a; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa19 (int n) { { int b[n]; goto a; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa20 (int n) { { int b[n]; goto a; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa21 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa22 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa23 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa24 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa25 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa26 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa27 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa28 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa29 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa30 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa31 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa32 (int n) { { int b[n]; goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa33 (int n) { { int b[n]; a: goto a; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa34 (int n) { a:{ int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa35 (int n) { { int b[n]; a:{ int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa36 (int n) { { int b[n]; { int c[n]; goto a; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa37 (int n) { { int b[n]; { int c[n]; goto a; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa38 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa39 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa40 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa41 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa42 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa43 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa44 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa45 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa46 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa47 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa48 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa49 (int n) { { int b[n]; { int c[n]; goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa50 (int n) { { int b[n]; { int c[n]; a: goto a; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa51 (int n) { a:{ int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa52 (int n) { { int b[n]; a:{ int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa53 (int n) { { int b[n]; { int c[n]; a:0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa54 (int n) { { int b[n]; { int c[n]; 0;} goto a; a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa55 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa56 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa57 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa58 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa59 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa60 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa61 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa62 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa63 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa64 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa65 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa66 (int n) { { int b[n]; { int c[n]; 0;} goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa67 (int n) { { int b[n]; { int c[n]; 0;} a: goto a; { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa68 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa69 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa70 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa71 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa72 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa73 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa74 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa75 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa76 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa77 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa78 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa79 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa80 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa81 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa82 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa83 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa84 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a: goto a; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa85 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa86 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa87 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa88 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa89 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa90 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa91 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa92 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa93 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa94 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa95 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa96 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa97 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa98 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa99 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa100 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa101 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a: goto a; ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa102 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa103 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa104 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa105 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa106 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa107 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa108 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa109 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa110 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa111 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa112 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa113 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa114 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa115 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa116 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa117 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa118 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a: goto a; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa119 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa120 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa121 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa122 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa123 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa124 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa125 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa126 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa127 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa128 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa129 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa130 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa131 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa132 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa133 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa134 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa135 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a: goto a; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa136 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa137 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa138 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa139 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa140 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa141 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa142 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa143 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa144 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa145 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa146 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa147 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa148 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; }
+void fa149 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa150 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa151 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa152 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a: goto a; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa153 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa154 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa155 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa156 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa157 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa158 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa159 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa160 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa161 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa162 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa163 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa164 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa165 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; }
+void fa166 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa167 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa168 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa169 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a: goto a; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa170 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa171 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa172 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa173 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa174 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa175 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa176 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa177 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa178 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa179 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa180 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa181 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa182 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; }
+void fa183 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa184 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa185 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa186 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a: goto a; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa187 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa188 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa189 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa190 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa191 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa192 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa193 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa194 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa195 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa196 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa197 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa198 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa199 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; }
+void fa200 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa201 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa202 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa203 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a: goto a; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa204 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa205 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa206 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa207 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa208 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa209 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa210 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa211 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa212 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa213 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa214 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa215 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; goto a; ; int i[n]; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa216 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; a:; int i[n]; 0;}; ; int j[n]; 0; }
+void fa217 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; a:0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa218 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; a:; int j[n]; 0; }
+void fa219 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; goto a; ; int i[n]; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa220 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a: goto a; ; int i[n]; 0;}; ; int j[n]; 0; }
+void fa221 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; }
+void fa222 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa223 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa224 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa225 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa226 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa227 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa228 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; }
+void fa229 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; }
+void fa230 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa231 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; }
+void fa232 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; goto a; 0;}; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa233 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; goto a; 0;}; ; int j[n]; 0; }
+void fa234 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; a:0;}; ; int j[n]; 0; }
+void fa235 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; a:; int j[n]; 0; }
+void fa236 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; goto a; 0;}; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa237 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a: goto a; 0;}; ; int j[n]; 0; }
+void fa238 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; }
+void fa239 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa240 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa241 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa242 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa243 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa244 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa245 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; }
+void fa246 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa247 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa248 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa249 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa250 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa251 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; goto a; ; int j[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa252 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; a:; int j[n]; 0; }
+void fa253 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; goto a; ; int j[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa254 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a: goto a; ; int j[n]; 0; }
+void fa255 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; }
+void fa256 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa257 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa258 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa259 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa260 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa261 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa262 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; }
+void fa263 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa264 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa265 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa266 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa267 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa268 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa269 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; goto a; 0; }
+void fa270 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; goto a; a:0; }
+void fa271 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a: goto a; 0; }
+void fa272 (int n) { a:{ int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; }
+void fa273 (int n) { { int b[n]; a:{ int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa274 (int n) { { int b[n]; { int c[n]; a:0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa275 (int n) { { int b[n]; { int c[n]; 0;} a:{ int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa276 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; a:0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa277 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} a:; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa278 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; a:0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa279 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; a:{ int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; }
+void fa280 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; a:{ int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa281 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; a:0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa282 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; a:{ int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa283 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; a:0;}; ; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa284 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; a:; int i[n]; 0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa285 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; a:0;}; ; int j[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fa286 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; a:; int j[n]; 0; goto a; }
+void fa287 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; a:0; goto a; }
+void fa288 (int n) { { int b[n]; { int c[n]; 0;} { int d[n]; 0;} ; int e[n]; 0;}; { int f[n]; { int g[n]; 0;}; { int h[n]; 0;}; ; int i[n]; 0;}; ; int j[n]; 0;a: goto a; }
+
+/* Match extra informative notes. */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-2.c
new file mode 100644
index 000000000..afea11692
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-2.c
@@ -0,0 +1,309 @@
+/* Test for labels and VM declarations: bug 12913.
+ goto statements must not jump into the scope of VM declarations.
+
+ This tests all combinations of label and goto locations in a given
+ function.
+
+ c99-vla-jump-1.c tests with just that label and goto, VLAs.
+ c99-vla-jump-2.c tests with many other labels and gotos, VLAs.
+ c99-vla-jump-3.c tests with just that label and goto, VM.
+ c99-vla-jump-4.c tests with many other labels and gotos, VM.
+ c99-vla-jump-5.c tests with switch statements. */
+
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void fb0 (int n) { p0A:goto p0A; goto a; a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb1 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb2 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb3 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb4 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb5 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb6 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb7 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb8 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb9 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb10 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb11 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb12 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb13 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb14 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb15 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb16 (int n) { a: goto a; P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb17 (int n) { a:{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb18 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb19 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb20 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb21 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb22 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb23 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb24 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb25 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb26 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb27 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb28 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb29 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb30 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb31 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb32 (int n) { P0A:goto P0A;{ int b[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb33 (int n) { P0A:goto P0A;{ int b[n]; a: goto a; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb34 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb35 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb36 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb37 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb38 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb39 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb40 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb41 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb42 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb43 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb44 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb45 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb46 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb47 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb48 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb49 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb50 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a: goto a; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb51 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb52 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb53 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb54 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb55 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb56 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb57 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb58 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb59 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb60 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb61 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb62 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb63 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb64 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb65 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb66 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb67 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a: goto a; P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb68 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb69 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb70 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb71 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb72 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb73 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb74 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb75 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb76 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb77 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb78 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb79 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb80 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb81 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb82 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb83 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb84 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a: goto a; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb85 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb86 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb87 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb88 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb89 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb90 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb91 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb92 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb93 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb94 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb95 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb96 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb97 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb98 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb99 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb100 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb101 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a: goto a; P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb102 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb103 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb104 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb105 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb106 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb107 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb108 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb109 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb110 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb111 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb112 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb113 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb114 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb115 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb116 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb117 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb118 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a: goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb119 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb120 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb121 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb122 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb123 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb124 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb125 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb126 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb127 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb128 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb129 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb130 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb131 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb132 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb133 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb134 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb135 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a: goto a; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb136 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb137 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb138 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb139 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb140 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb141 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb142 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb143 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb144 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb145 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb146 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb147 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb148 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb149 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb150 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb151 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb152 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a: goto a; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb153 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb154 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb155 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb156 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb157 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb158 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb159 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb160 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb161 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb162 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb163 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb164 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb165 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb166 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb167 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb168 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb169 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a: goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb170 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb171 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb172 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb173 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb174 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb175 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb176 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb177 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb178 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb179 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb180 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb181 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb182 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb183 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb184 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb185 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb186 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a: goto a; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb187 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb188 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb189 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb190 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb191 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb192 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb193 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb194 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb195 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb196 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb197 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb198 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb199 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb200 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb201 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb202 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb203 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a: goto a; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb204 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb205 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb206 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb207 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb208 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb209 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb210 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb211 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb212 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb213 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb214 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb215 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb216 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb217 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb218 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb219 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb220 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a: goto a; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb221 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb222 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb223 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb224 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb225 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb226 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb227 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb228 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb229 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb230 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb231 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb232 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb233 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb234 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb235 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb236 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb237 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a: goto a; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb238 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb239 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb240 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb241 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb242 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb243 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb244 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb245 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb246 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb247 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb248 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb249 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb250 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb251 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb252 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; a:; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb253 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; int j[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb254 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a: goto a; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fb255 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; }
+void fb256 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb257 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb258 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb259 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb260 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb261 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb262 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; }
+void fb263 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb264 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb265 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb266 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb267 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb268 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb269 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; }
+void fb270 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; p03A:goto p03A; goto a; a:0;P03B:goto P03B; }
+void fb271 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a: goto a; P03A:goto P03A;0;P03B:goto P03B; }
+void fb272 (int n) { a:{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; }
+void fb273 (int n) { P0A:goto P0A;{ int b[n]; a:{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb274 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; a:0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb275 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} a:{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb276 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; a:0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb277 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} a:; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb278 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; a:0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb279 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; a:{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; }
+void fb280 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; a:{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb281 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; a:0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb282 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; a:{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb283 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; a:0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb284 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; a:; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb285 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; a:0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fb286 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; a:; int j[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; }
+void fb287 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; a:0;p03B:goto p03B; goto a; P03B:goto P03B; }
+void fb288 (int n) { P0A:goto P0A;{ int b[n]; P01A:goto P01A;{ int c[n]; P012A:goto P012A;0;} P01B:goto P01B;{ int d[n]; P013A:goto P013A;0;} P01C:goto P01C;; int e[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ int f[n]; P02A:goto P02A;{ int g[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ int h[n]; P025A:goto P025A;0;}; P02C:goto P02C;; int i[n]; P026A:goto P026A;0;}; P0C:goto P0C;; int j[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; }
+
+/* Match extra informative notes. */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-3.c
new file mode 100644
index 000000000..f7cb6ac63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-3.c
@@ -0,0 +1,309 @@
+/* Test for labels and VM declarations: bug 12913.
+ goto statements must not jump into the scope of VM declarations.
+
+ This tests all combinations of label and goto locations in a given
+ function.
+
+ c99-vla-jump-1.c tests with just that label and goto, VLAs.
+ c99-vla-jump-2.c tests with many other labels and gotos, VLAs.
+ c99-vla-jump-3.c tests with just that label and goto, VM.
+ c99-vla-jump-4.c tests with many other labels and gotos, VM.
+ c99-vla-jump-5.c tests with switch statements. */
+
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void fc0 (int n) { goto a; a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc1 (int n) { goto a; { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc2 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc3 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc4 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc5 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc6 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc7 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc8 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc9 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc10 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc11 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc12 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc13 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc14 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc15 (int n) { goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc16 (int n) { a: goto a; { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc17 (int n) { a:{ typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc18 (int n) { { typedef int (*b)[n]; goto a; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc19 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc20 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc21 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc22 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc23 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc24 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc25 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc26 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc27 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc28 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc29 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc30 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc31 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc32 (int n) { { typedef int (*b)[n]; goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc33 (int n) { { typedef int (*b)[n]; a: goto a; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc34 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc35 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc36 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc37 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc38 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc39 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc40 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc41 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc42 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc43 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc44 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc45 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc46 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc47 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc48 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc49 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc50 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a: goto a; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc51 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc52 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc53 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc54 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc55 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc56 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc57 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc58 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc59 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc60 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc61 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc62 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc63 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc64 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc65 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc66 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc67 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a: goto a; { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc68 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc69 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc70 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc71 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc72 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc73 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc74 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc75 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc76 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc77 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc78 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc79 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc80 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc81 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc82 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc83 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc84 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a: goto a; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc85 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc86 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc87 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc88 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc89 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc90 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc91 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc92 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc93 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc94 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc95 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc96 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc97 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc98 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc99 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc100 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc101 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a: goto a; ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc102 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc103 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc104 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc105 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc106 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc107 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc108 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc109 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc110 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc111 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc112 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc113 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc114 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc115 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc116 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc117 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc118 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a: goto a; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc119 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc120 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc121 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc122 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc123 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc124 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc125 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc126 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc127 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc128 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc129 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc130 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc131 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc132 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc133 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc134 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc135 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a: goto a; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc136 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc137 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc138 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc139 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc140 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc141 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc142 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc143 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc144 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc145 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc146 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc147 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc148 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc149 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc150 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc151 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc152 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a: goto a; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc153 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc154 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc155 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc156 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc157 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc158 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc159 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc160 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc161 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc162 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc163 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc164 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc165 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc166 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc167 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc168 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc169 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a: goto a; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc170 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc171 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc172 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc173 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc174 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc175 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc176 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc177 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc178 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc179 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc180 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc181 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc182 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc183 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc184 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc185 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc186 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a: goto a; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc187 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc188 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc189 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc190 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc191 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc192 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc193 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc194 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc195 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc196 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc197 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc198 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc199 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc200 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc201 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc202 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc203 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a: goto a; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc204 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc205 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc206 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc207 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc208 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc209 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc210 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc211 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc212 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc213 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc214 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc215 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc216 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc217 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc218 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc219 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc220 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a: goto a; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; }
+void fc221 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; }
+void fc222 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc223 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc224 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc225 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc226 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc227 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc228 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; }
+void fc229 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; }
+void fc230 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc231 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; }
+void fc232 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc233 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; 0; }
+void fc234 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; a:0;}; ; typedef int (*j)[n]; 0; }
+void fc235 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; a:; typedef int (*j)[n]; 0; }
+void fc236 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; goto a; 0;}; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc237 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a: goto a; 0;}; ; typedef int (*j)[n]; 0; }
+void fc238 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; }
+void fc239 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc240 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc241 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc242 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc243 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc244 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc245 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; }
+void fc246 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc247 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc248 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc249 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc250 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc251 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; goto a; ; typedef int (*j)[n]; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc252 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; a:; typedef int (*j)[n]; 0; }
+void fc253 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; goto a; ; typedef int (*j)[n]; a:0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc254 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a: goto a; ; typedef int (*j)[n]; 0; }
+void fc255 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; }
+void fc256 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc257 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc258 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc259 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc260 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc261 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc262 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; }
+void fc263 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc264 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc265 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc266 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc267 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc268 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; goto a; 0; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc269 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; goto a; 0; }
+void fc270 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; goto a; a:0; }
+void fc271 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a: goto a; 0; }
+void fc272 (int n) { a:{ typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; }
+void fc273 (int n) { { typedef int (*b)[n]; a:{ typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc274 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; a:0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc275 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} a:{ typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc276 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; a:0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc277 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} a:; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc278 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; a:0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc279 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; a:{ typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; }
+void fc280 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; a:{ typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc281 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; a:0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc282 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; a:{ typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc283 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; a:0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc284 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; a:; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc285 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; a:0;}; ; typedef int (*j)[n]; 0; goto a; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fc286 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; a:; typedef int (*j)[n]; 0; goto a; }
+void fc287 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; a:0; goto a; }
+void fc288 (int n) { { typedef int (*b)[n]; { typedef int (*c)[n]; 0;} { typedef int (*d)[n]; 0;} ; typedef int (*e)[n]; 0;}; { typedef int (*f)[n]; { typedef int (*g)[n]; 0;}; { typedef int (*h)[n]; 0;}; ; typedef int (*i)[n]; 0;}; ; typedef int (*j)[n]; 0;a: goto a; }
+
+/* Match extra informative notes. */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-4.c
new file mode 100644
index 000000000..6f0060e66
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-4.c
@@ -0,0 +1,309 @@
+/* Test for labels and VM declarations: bug 12913.
+ goto statements must not jump into the scope of VM declarations.
+
+ This tests all combinations of label and goto locations in a given
+ function.
+
+ c99-vla-jump-1.c tests with just that label and goto, VLAs.
+ c99-vla-jump-2.c tests with many other labels and gotos, VLAs.
+ c99-vla-jump-3.c tests with just that label and goto, VM.
+ c99-vla-jump-4.c tests with many other labels and gotos, VM.
+ c99-vla-jump-5.c tests with switch statements. */
+
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void fd0 (int n) { p0A:goto p0A; goto a; a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd1 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd2 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd3 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd4 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd5 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd6 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd7 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd8 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd9 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd10 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd11 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd12 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd13 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd14 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd15 (int n) { p0A:goto p0A; goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd16 (int n) { a: goto a; P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd17 (int n) { a:{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd18 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd19 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd20 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd21 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd22 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd23 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd24 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd25 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd26 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd27 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd28 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd29 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd30 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd31 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd32 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; p01A:goto p01A; goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd33 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a: goto a; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd34 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd35 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd36 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd37 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd38 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd39 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd40 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd41 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd42 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd43 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd44 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd45 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd46 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd47 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd48 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd49 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; p012A:goto p012A; goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd50 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a: goto a; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd51 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd52 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd53 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd54 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd55 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd56 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd57 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd58 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd59 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd60 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd61 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd62 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd63 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd64 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd65 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd66 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} p01B:goto p01B; goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd67 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a: goto a; P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd68 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd69 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd70 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd71 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd72 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd73 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd74 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd75 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd76 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd77 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd78 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd79 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd80 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd81 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd82 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd83 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; p013A:goto p013A; goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd84 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a: goto a; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd85 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd86 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd87 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd88 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd89 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd90 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd91 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd92 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd93 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd94 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd95 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd96 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd97 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd98 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd99 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd100 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} p01C:goto p01C; goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd101 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a: goto a; P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd102 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd103 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd104 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd105 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd106 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd107 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd108 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd109 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd110 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd111 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd112 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd113 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd114 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd115 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd116 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd117 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; p014A:goto p014A; goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd118 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a: goto a; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd119 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd120 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd121 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd122 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd123 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd124 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd125 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd126 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd127 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd128 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd129 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd130 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd131 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd132 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd133 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd134 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; p0B:goto p0B; goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd135 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a: goto a; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd136 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd137 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd138 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd139 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd140 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd141 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd142 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd143 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd144 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd145 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd146 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd147 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd148 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd149 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd150 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd151 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; p02A:goto p02A; goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd152 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a: goto a; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd153 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd154 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd155 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd156 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd157 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd158 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd159 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd160 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd161 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd162 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd163 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd164 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd165 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd166 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd167 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd168 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; p024A:goto p024A; goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd169 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a: goto a; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd170 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd171 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd172 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd173 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd174 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd175 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd176 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd177 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd178 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd179 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd180 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd181 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd182 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd183 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd184 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd185 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; p02B:goto p02B; goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd186 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a: goto a; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd187 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd188 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd189 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd190 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd191 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd192 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd193 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd194 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd195 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd196 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd197 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd198 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd199 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd200 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd201 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd202 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; p025A:goto p025A; goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd203 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a: goto a; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd204 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd205 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd206 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd207 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd208 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd209 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd210 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd211 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd212 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd213 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd214 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd215 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd216 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd217 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd218 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd219 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; p02C:goto p02C; goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd220 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a: goto a; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd221 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd222 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd223 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd224 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd225 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd226 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd227 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd228 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd229 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd230 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd231 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd232 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd233 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd234 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd235 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd236 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; p026A:goto p026A; goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd237 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a: goto a; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd238 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd239 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd240 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd241 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd242 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd243 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd244 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd245 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd246 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd247 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd248 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd249 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd250 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd251 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd252 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; a:; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd253 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; p0C:goto p0C; goto a; P0C:goto P0C;; typedef int (*j)[n]; a:0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd254 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a: goto a; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;P03B:goto P03B; }
+void fd255 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; }
+void fd256 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd257 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd258 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd259 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd260 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd261 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd262 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; }
+void fd263 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd264 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd265 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd266 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd267 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd268 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd269 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; p03A:goto p03A; goto a; P03A:goto P03A;0;P03B:goto P03B; }
+void fd270 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; p03A:goto p03A; goto a; a:0;P03B:goto P03B; }
+void fd271 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a: goto a; P03A:goto P03A;0;P03B:goto P03B; }
+void fd272 (int n) { a:{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; }
+void fd273 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; a:{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd274 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; a:0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd275 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} a:{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd276 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; a:0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd277 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} a:; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd278 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; a:0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd279 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; a:{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; }
+void fd280 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; a:{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd281 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; a:0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd282 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; a:{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd283 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; a:0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd284 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; a:; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd285 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; a:0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; } /* { dg-error "jump into scope of identifier with variably modified type" } */
+void fd286 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; a:; typedef int (*j)[n]; P03A:goto P03A;0;p03B:goto p03B; goto a; P03B:goto P03B; }
+void fd287 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; a:0;p03B:goto p03B; goto a; P03B:goto P03B; }
+void fd288 (int n) { P0A:goto P0A;{ typedef int (*b)[n]; P01A:goto P01A;{ typedef int (*c)[n]; P012A:goto P012A;0;} P01B:goto P01B;{ typedef int (*d)[n]; P013A:goto P013A;0;} P01C:goto P01C;; typedef int (*e)[n]; P014A:goto P014A;0;}; P0B:goto P0B;{ typedef int (*f)[n]; P02A:goto P02A;{ typedef int (*g)[n]; P024A:goto P024A;0;}; P02B:goto P02B;{ typedef int (*h)[n]; P025A:goto P025A;0;}; P02C:goto P02C;; typedef int (*i)[n]; P026A:goto P026A;0;}; P0C:goto P0C;; typedef int (*j)[n]; P03A:goto P03A;0;a: goto a; P03B:goto P03B; }
+
+/* Match extra informative notes. */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-5.c
new file mode 100644
index 000000000..fc5e04d1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/c99-vla-jump-5.c
@@ -0,0 +1,34 @@
+/* Test for labels and VM declarations: bug 12913.
+ switch statements must not jump into the scope of VM declarations.
+
+ c99-vla-jump-1.c tests with just that label and goto, VLAs.
+ c99-vla-jump-2.c tests with many other labels and gotos, VLAs.
+ c99-vla-jump-3.c tests with just that label and goto, VM.
+ c99-vla-jump-4.c tests with many other labels and gotos, VM.
+ c99-vla-jump-5.c tests with switch statements. */
+
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+void
+f (int a, int b)
+{
+ switch (a) {
+ int v[b];
+ case 2: /* { dg-error "switch jumps into scope of identifier with variably modified type" } */
+ default: /* { dg-error "switch jumps into scope of identifier with variably modified type" } */
+ switch (a)
+ {
+ case 4:
+ { int z[b]; }
+ default:
+ ;
+ int w[b];
+ }
+ }
+}
+
+/* Match extra informative notes. */
+/* { dg-message "note: switch starts here" "note: starts" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "note: declared" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/call-diag-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/call-diag-1.c
new file mode 100644
index 000000000..884baa0d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/call-diag-1.c
@@ -0,0 +1,9 @@
+/* The warning for calling through a non-compatible type must not
+ disable the normal diagnostics from comparing the argument list
+ against the type of the called expression. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void foo (void);
+void bar (void) { ((long (*)(int))foo) (); } /* { dg-error "too few arguments to function" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/call-diag-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/call-diag-2.c
new file mode 100644
index 000000000..c34252cd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/call-diag-2.c
@@ -0,0 +1,15 @@
+/* Test diagnostics for calling function returning qualified void or
+ other incomplete type other than void. PR 35210. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+const void f_cv (void);
+struct s f_s (void);
+void f_v (void);
+
+void g1 (void) { f_cv (); } /* { dg-error "qualified void" } */
+void g2 (void) { f_s (); } /* { dg-error "invalid use of undefined type" } */
+void g3 (void) { ((const void (*) (void)) f_v) (); } /* { dg-error "qualified void" } */
+/* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } 12 } */
+void g4 (void) { ((struct s (*) (void)) f_v) (), (void) 0; } /* { dg-error "invalid use of undefined type" } */
+/* { dg-warning "function called through a non-compatible type" "cast" { target *-*-* } 14 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/case-const-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/case-const-1.c
new file mode 100644
index 000000000..ba39d0961
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/case-const-1.c
@@ -0,0 +1,15 @@
+/* Test for case labels not integer constant expressions but folding
+ to integer constants (used in Linux kernel, PR 39613). */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern int i;
+void
+f (int c)
+{
+ switch (c)
+ {
+ case (1 ? 1 : i):
+ ;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/case-const-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/case-const-2.c
new file mode 100644
index 000000000..9c119b04d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/case-const-2.c
@@ -0,0 +1,15 @@
+/* Test for case labels not integer constant expressions but folding
+ to integer constants (used in Linux kernel, PR 39613). */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+extern int i;
+void
+f (int c)
+{
+ switch (c)
+ {
+ case (1 ? 1 : i): /* { dg-warning "case label is not an integer constant expression" } */
+ ;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/case-const-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/case-const-3.c
new file mode 100644
index 000000000..7224cca47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/case-const-3.c
@@ -0,0 +1,15 @@
+/* Test for case labels not integer constant expressions but folding
+ to integer constants (used in Linux kernel, PR 39613). */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+extern int i;
+void
+f (int c)
+{
+ switch (c)
+ {
+ case (1 ? 1 : i): /* { dg-error "case label is not an integer constant expression" } */
+ ;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-1.c
new file mode 100644
index 000000000..7b12ad9f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-1.c
@@ -0,0 +1,41 @@
+/* Test diagnostics for bad or doubtful casts. Test with no special
+ options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+struct s { int a; } sv;
+union u { int a; } uv;
+int i;
+long l;
+char c;
+void *p;
+float fv;
+
+void
+f (void)
+{
+ (int []) p; /* { dg-error "cast specifies array type" } */
+ (int ()) p; /* { dg-error "cast specifies function type" } */
+ (struct s) sv;
+ (union u) uv;
+ (struct s) i; /* { dg-error "conversion to non-scalar type requested" } */
+ (union u) i;
+ (union u) l; /* { dg-error "cast to union type from type not present in union" } */
+ (int) sv; /* { dg-error "aggregate value used where an integer was expected" } */
+ (int) uv; /* { dg-error "aggregate value used where an integer was expected" } */
+ (float) sv; /* { dg-error "aggregate value used where a float was expected" } */
+ (float) uv; /* { dg-error "aggregate value used where a float was expected" } */
+ (_Complex double) sv; /* { dg-error "aggregate value used where a complex was expected" } */
+ (_Complex double) uv; /* { dg-error "aggregate value used where a complex was expected" } */
+ (void *) sv; /* { dg-error "cannot convert to a pointer type" } */
+ (void *) uv; /* { dg-error "cannot convert to a pointer type" } */
+ (_Bool) sv; /* { dg-error "used struct type value where scalar is required" } */
+ (_Bool) uv; /* { dg-error "used union type value where scalar is required" } */
+ (void) sv;
+ (const void) uv;
+ (void *) c; /* { dg-warning "cast to pointer from integer of different size" } */
+ (void *) (char) 1;
+ (char) p; /* { dg-warning "cast from pointer to integer of different size" } */
+ (char) (void *) 1; /* { dg-warning "cast from pointer to integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-2.c
new file mode 100644
index 000000000..f7f58f8a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-2.c
@@ -0,0 +1,41 @@
+/* Test diagnostics for bad or doubtful casts. Test with
+ -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+struct s { int a; } sv;
+union u { int a; } uv;
+int i;
+long l;
+char c;
+void *p;
+float fv;
+
+void
+f (void)
+{
+ (int []) p; /* { dg-error "cast specifies array type" } */
+ (int ()) p; /* { dg-error "cast specifies function type" } */
+ (struct s) sv; /* { dg-warning "ISO C forbids casting nonscalar to the same type" } */
+ (union u) uv; /* { dg-warning "ISO C forbids casting nonscalar to the same type" } */
+ (struct s) i; /* { dg-error "conversion to non-scalar type requested" } */
+ (union u) i; /* { dg-warning "ISO C forbids casts to union type" } */
+ (union u) l; /* { dg-error "cast to union type from type not present in union" } */
+ (int) sv; /* { dg-error "aggregate value used where an integer was expected" } */
+ (int) uv; /* { dg-error "aggregate value used where an integer was expected" } */
+ (float) sv; /* { dg-error "aggregate value used where a float was expected" } */
+ (float) uv; /* { dg-error "aggregate value used where a float was expected" } */
+ (_Complex double) sv; /* { dg-error "aggregate value used where a complex was expected" } */
+ (_Complex double) uv; /* { dg-error "aggregate value used where a complex was expected" } */
+ (void *) sv; /* { dg-error "cannot convert to a pointer type" } */
+ (void *) uv; /* { dg-error "cannot convert to a pointer type" } */
+ (_Bool) sv; /* { dg-error "used struct type value where scalar is required" } */
+ (_Bool) uv; /* { dg-error "used union type value where scalar is required" } */
+ (void) sv;
+ (const void) uv;
+ (void *) c; /* { dg-warning "cast to pointer from integer of different size" } */
+ (void *) (char) 1;
+ (char) p; /* { dg-warning "cast from pointer to integer of different size" } */
+ (char) (void *) 1; /* { dg-warning "cast from pointer to integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-3.c
new file mode 100644
index 000000000..40d3c88c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-3.c
@@ -0,0 +1,41 @@
+/* Test diagnostics for bad or doubtful casts. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+struct s { int a; } sv;
+union u { int a; } uv;
+int i;
+long l;
+char c;
+void *p;
+float fv;
+
+void
+f (void)
+{
+ (int []) p; /* { dg-error "cast specifies array type" } */
+ (int ()) p; /* { dg-error "cast specifies function type" } */
+ (struct s) sv; /* { dg-error "ISO C forbids casting nonscalar to the same type" } */
+ (union u) uv; /* { dg-error "ISO C forbids casting nonscalar to the same type" } */
+ (struct s) i; /* { dg-error "conversion to non-scalar type requested" } */
+ (union u) i; /* { dg-error "ISO C forbids casts to union type" } */
+ (union u) l; /* { dg-error "cast to union type from type not present in union" } */
+ (int) sv; /* { dg-error "aggregate value used where an integer was expected" } */
+ (int) uv; /* { dg-error "aggregate value used where an integer was expected" } */
+ (float) sv; /* { dg-error "aggregate value used where a float was expected" } */
+ (float) uv; /* { dg-error "aggregate value used where a float was expected" } */
+ (_Complex double) sv; /* { dg-error "aggregate value used where a complex was expected" } */
+ (_Complex double) uv; /* { dg-error "aggregate value used where a complex was expected" } */
+ (void *) sv; /* { dg-error "cannot convert to a pointer type" } */
+ (void *) uv; /* { dg-error "cannot convert to a pointer type" } */
+ (_Bool) sv; /* { dg-error "used struct type value where scalar is required" } */
+ (_Bool) uv; /* { dg-error "used union type value where scalar is required" } */
+ (void) sv;
+ (const void) uv;
+ (void *) c; /* { dg-warning "cast to pointer from integer of different size" } */
+ (void *) (char) 1;
+ (char) p; /* { dg-warning "cast from pointer to integer of different size" } */
+ (char) (void *) 1; /* { dg-warning "cast from pointer to integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-4.c
new file mode 100644
index 000000000..ebc84c11c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-4.c
@@ -0,0 +1,13 @@
+/* Test warnings when casting from a constant integer to pointer.
+ Test with -pedantic-errors. */
+/* Origin: Carlos O'Donell <carlos@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+extern int i;
+char c;
+void
+f (void)
+{
+ c = (char)&i; /* { dg-warning "cast from pointer to integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-function-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-function-1.c
new file mode 100644
index 000000000..ab42db119
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-function-1.c
@@ -0,0 +1,49 @@
+/* PR c/12085 */
+/* Origin: David Hollenberg <dhollen@mosis.org> */
+
+/* Verify that the compiler doesn't inline a function at
+ a calling point where it is viewed with a different
+ prototype than the actual one. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int foo1(int);
+int foo2();
+
+typedef struct {
+ double d;
+ int a;
+} str_t;
+
+void bar(double d, int i, str_t s)
+{
+ d = ((double (*) (int)) foo1) (i); /* { dg-warning "7:non-compatible|abort" } */
+ i = ((int (*) (double)) foo1) (d); /* { dg-warning "7:non-compatible|abort" } */
+ s = ((str_t (*) (int)) foo1) (i); /* { dg-warning "7:non-compatible|abort" } */
+ ((void (*) (int)) foo1) (d); /* { dg-warning "non-compatible|abort" } */
+ i = ((int (*) (int)) foo1) (i); /* { dg-bogus "non-compatible|abort" } */
+ (void) foo1 (i); /* { dg-bogus "non-compatible|abort" } */
+
+ d = ((double (*) (int)) foo2) (i); /* { dg-warning "7:non-compatible|abort" } */
+ i = ((int (*) (double)) foo2) (d); /* { dg-bogus "non-compatible|abort" } */
+ s = ((str_t (*) (int)) foo2) (i); /* { dg-warning "non-compatible|abort" } */
+ ((void (*) (int)) foo2) (d); /* { dg-warning "non-compatible|abort" } */
+ i = ((int (*) (int)) foo2) (i); /* { dg-bogus "non-compatible|abort" } */
+ (void) foo2 (i); /* { dg-bogus "non-compatible|abort" } */
+}
+
+int foo1(int arg)
+{
+ /* Prevent the function from becoming const and thus DCEd. */
+ __asm volatile ("" : "+r" (arg));
+ return arg;
+}
+
+int foo2(arg)
+ int arg;
+{
+ /* Prevent the function from becoming const and thus DCEd. */
+ __asm volatile ("" : "+r" (arg));
+ return arg;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-lvalue-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-lvalue-1.c
new file mode 100644
index 000000000..4e84804e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-lvalue-1.c
@@ -0,0 +1,13 @@
+/* Test for deprecation of casts as lvalues. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int x;
+
+void
+foo (void)
+{
+ (char) x = 1; /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "lvalue" "cast as lvalue" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-lvalue-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-lvalue-2.c
new file mode 100644
index 000000000..d4db4bd6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-lvalue-2.c
@@ -0,0 +1,13 @@
+/* Test for error on casts as lvalues. Casts to same type. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int x;
+
+void
+foo (void)
+{
+ (int) x = 1; /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "lvalue" "cast as lvalue" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-pretty-print-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-pretty-print-1.c
new file mode 100644
index 000000000..b9da56674
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-pretty-print-1.c
@@ -0,0 +1,12 @@
+/* Test pretty-printing of casts. Should not depend on whether
+ NOP_EXPR or CONVERT_EXPR is used. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int i;
+void
+f (void)
+{
+ ((unsigned int)i)(); /* { dg-error "called object '\\(unsigned int\\)i' is not a function" } */
+ ((char)i)(); /* { dg-error "called object '\\(char\\)i' is not a function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-1.c
new file mode 100644
index 000000000..407d138d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-1.c
@@ -0,0 +1,30 @@
+/* Incorrect `cast discards `const'' warnings. There should be warnings
+ in bad_cast and bad_assign; bad_assign gets the correct warning, but
+ good_cast may get the warning instead of bad_cast.
+ gcc 2.7.2.3 passes, egcs-1.1.2 and egcs-ss-19990428 fail.
+ http://gcc.gnu.org/ml/gcc-bugs/1998-08/msg00645.html */
+/* { dg-do compile } */
+/* { dg-options "-Wcast-qual" } */
+void
+good_cast(const void *bar)
+{
+ (char *const *)bar; /* { dg-bogus "cast discards" "discarding `const' warning" } */
+}
+
+void
+bad_cast(const void *bar)
+{
+ (const char **)bar; /* { dg-warning "cast discards" "discarding `const' warning" } */
+}
+
+void
+good_assign(const void *bar)
+{
+ char *const *foo = bar; /* { dg-bogus "initialization discards" "discarding `const' warning" } */
+}
+
+void
+bad_assign(const void *bar)
+{
+ const char **foo = bar; /* { dg-warning "initialization discards" "discarding `const' warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-2.c
new file mode 100644
index 000000000..5fd2b854d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-2.c
@@ -0,0 +1,34 @@
+/* Test whether the -Wcast-qual handles cv-qualified functions correctly. */
+/* { dg-do compile } */
+/* { dg-options "-Wcast-qual" } */
+
+typedef int (intfn_t) (int);
+typedef void (voidfn_t) (void);
+
+typedef const intfn_t *constfn_t;
+typedef volatile voidfn_t *noreturnfn_t;
+
+intfn_t intfn;
+const intfn_t constfn;
+voidfn_t voidfn;
+volatile voidfn_t noreturnfn;
+
+intfn_t *i1 = intfn;
+intfn_t *i2 = (intfn_t *) intfn;
+intfn_t *i3 = constfn;
+intfn_t *i4 = (intfn_t *) constfn; /* { dg-bogus "discards qualifier" } */
+
+constfn_t p1 = intfn; /* { dg-warning "makes '__attribute__..const..' qualified function" } */
+constfn_t p2 = (constfn_t) intfn; /* { dg-warning "adds '__attribute__..const..' qualifier" } */
+constfn_t p3 = constfn;
+constfn_t p4 = (constfn_t) constfn;
+
+voidfn_t *v1 = voidfn;
+voidfn_t *v2 = (voidfn_t *) voidfn;
+voidfn_t *v3 = noreturnfn;
+voidfn_t *v4 = (voidfn_t *) noreturnfn; /* { dg-bogus "discards qualifier" } */
+
+noreturnfn_t n1 = voidfn; /* { dg-warning "makes '__attribute__..noreturn..' qualified function" } */
+noreturnfn_t n2 = (noreturnfn_t) voidfn; /* { dg-warning "adds '__attribute__..noreturn..' qualifier" } */
+noreturnfn_t n3 = noreturnfn;
+noreturnfn_t n4 = (noreturnfn_t) noreturnfn;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-3.c
new file mode 100644
index 000000000..50dabab47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cast-qual-3.c
@@ -0,0 +1,11 @@
+/* PR 55383 */
+/* { dg-do compile } */
+/* { dg-options "-Wcast-qual" } */
+
+void set(void*);
+
+int foo(int argc)
+{
+ volatile double val;
+ set((void*)&val); /* { dg-warning "cast discards .volatile. qualifier" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cdce1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cdce1.c
new file mode 100644
index 000000000..2123f7fd8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cdce1.c
@@ -0,0 +1,81 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-final { scan-tree-dump "cdce1.c:17: note: function call is shrink-wrapped into error conditions\." "cdce" } } */
+/* { dg-final { cleanup-tree-dump "cdce" } } */
+/* { dg-require-effective-target large_double } */
+
+#include <stdlib.h>
+#include <math.h>
+#include <errno.h>
+int total_err_count = 0;
+double foo_opt (int x, double y) __attribute__((noinline));
+double foo_opt (int x, double y)
+{
+ double yy = 0;
+ errno = 0;
+ yy = pow (x, y * y);
+ return 0;
+}
+
+double foo (int x, double y) __attribute__((noinline));
+double foo (int x, double y)
+{
+ double yy = 0;
+ errno = 0;
+ yy = pow (x, y * y);
+ return yy;
+}
+
+int test (double (*fp)(int x, double y))
+{
+ int i,x;
+
+ x = 127;
+ for (i = 30; i < 300; i++)
+ {
+ fp (x, i);
+ if (errno)
+ total_err_count ++;
+ }
+
+ x = -300;
+ for (i = 100; i < 300; i++)
+ {
+ fp (x, i);
+ if (errno)
+ total_err_count ++;
+ }
+
+ x = 65577;
+ for (i = 60; i < 200; i++)
+ {
+ fp (x, i);
+ if (errno)
+ total_err_count ++;
+ }
+
+ x = 65577 * 127;
+ for (i = 1; i < 100; i++)
+ {
+ fp (x, i);
+ if (errno)
+ total_err_count ++;
+ }
+
+ return total_err_count;
+}
+
+int main ()
+{
+ int en1, en2;
+ total_err_count = 0;
+ en1 = test (foo_opt);
+ total_err_count = 0;
+ en2 = test (foo);
+
+ if (en1 != en2)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cdce2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cdce2.c
new file mode 100644
index 000000000..a461ce7ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cdce2.c
@@ -0,0 +1,55 @@
+/* { dg-do run } */
+/* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
+/* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details -lm" } */
+/* { dg-final { scan-tree-dump "cdce2.c:16: note: function call is shrink-wrapped into error conditions\." "cdce" } }*/
+/* { dg-final { cleanup-tree-dump "cdce" } } */
+
+#include <stdlib.h>
+#include <math.h>
+#include <errno.h>
+int total_err_count = 0;
+double foo_opt (double y) __attribute__((noinline));
+double foo_opt (double y)
+{
+ double yy = 0;
+ errno = 0;
+ yy = log (y);
+ return 0;
+}
+
+double foo (double y) __attribute__((noinline));
+double foo (double y)
+{
+ double yy = 0;
+ errno = 0;
+ yy = log (y);
+ return yy;
+}
+
+int test (double (*fp) (double y))
+{
+ int i,x;
+ for (i = -100; i < 100; i++)
+ {
+ fp (i);
+ if (errno)
+ total_err_count ++;
+ }
+
+ return total_err_count;
+}
+
+int main ()
+{
+ int en1, en2;
+ double yy;
+ total_err_count = 0;
+ en1 = test (foo_opt);
+ total_err_count = 0;
+ en2 = test (foo);
+
+ if (en1 != en2)
+ abort();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/char-compare.c b/gcc-4.9/gcc/testsuite/gcc.dg/char-compare.c
new file mode 100644
index 000000000..f8b2fb968
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/char-compare.c
@@ -0,0 +1,23 @@
+/* PR rtl-optimization/23241 */
+/* Origin: Josh Conner <jconner@apple.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort(void);
+
+struct fbs {
+ unsigned char uc;
+} fbs1 = {255};
+
+void fn(struct fbs *fbs_ptr)
+{
+ if ((fbs_ptr->uc != 255) && (fbs_ptr->uc != 0))
+ abort();
+}
+
+int main(void)
+{
+ fn(&fbs1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm1.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm1.c
new file mode 100644
index 000000000..dfd140186
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler ".ascii bar" } }
+ { dg-final { scan-assembler ".ascii foo" } }
+ */
+extern int x, y;
+
+asm (".ascii bar");
+
+int foo (void)
+{
+ __asm__ (".ascii foo");
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm2.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm2.c
new file mode 100644
index 000000000..a9a9c011b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm2.c
@@ -0,0 +1,16 @@
+/* Test for execution character set encoding errors.
+ If we ever get a good way to test error recovery
+ the string "foobar" should be translated. */
+/* { dg-do compile } */
+/* { dg-require-iconv "IBM1047" } */
+asm (not_a_string); /* { dg-error "(parse error|syntax error|expected string literal) before" "not_a_string" } */
+char x[] = "foobar";
+
+void foo (void)
+{
+ char *y;
+ asm (not_a_string2); /* { dg-error "(parse error|syntax error|expected string literal) before" "not_a_string" } */
+
+#define FOO "walrus"
+ y = FOO;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm3.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm3.c
new file mode 100644
index 000000000..842bd5cfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm3.c
@@ -0,0 +1,33 @@
+/* Test for complex asm statements. Make sure it compiles
+ then test for some of the asm statements not being translated. */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler "std" } }
+ { dg-final { scan-assembler "cld" } }
+ { dg-final { scan-assembler "rep" } }
+ { dg-final { scan-assembler "movsb" } } */
+#define size_t int
+void *
+memmove (void *__dest, __const void *__src, size_t __n)
+{
+ register unsigned long int __d0, __d1, __d2;
+ if (__dest < __src)
+ __asm__ __volatile__
+ ("cld\n\t"
+ "rep\n\t"
+ "movsb"
+ : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
+ : "0" (__n), "1" (__src), "2" (__dest)
+ : "memory");
+ else
+ __asm__ __volatile__
+ ("std\n\t"
+ "rep\n\t"
+ "movsb\n\t"
+ "cld"
+ : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
+ : "0" (__n), "1" (__n - 1 + (const char *) __src),
+ "2" (__n - 1 + (char *) __dest)
+ : "memory");
+ return __dest;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm4.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm4.c
new file mode 100644
index 000000000..59c8d59ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm4.c
@@ -0,0 +1,10 @@
+/* Simple asm test. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler "foo" } } */
+extern int bar;
+
+int main (void)
+{
+ asm ("foo %0" : "=r" (bar));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm5.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm5.c
new file mode 100644
index 000000000..a4bb01401
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm5.c
@@ -0,0 +1,8 @@
+/* Test for string translation. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler-not "translate" } } */
+void foo (void)
+{
+ asm ("xx" : : "r"("translate") : "cc");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm6.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm6.c
new file mode 100644
index 000000000..ae2ec485d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/asm6.c
@@ -0,0 +1,13 @@
+/* Test for string translation. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler "foo" } } */
+int main()
+{
+ unsigned long int *ptr;
+ ptr = ((unsigned long int *)
+ ( { void *stack_ptr;
+ __asm__ __volatile__ ( "foo %0" : "=r" (stack_ptr) );
+ (stack_ptr); } ) );
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/attribute1.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/attribute1.c
new file mode 100644
index 000000000..799630030
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/attribute1.c
@@ -0,0 +1,10 @@
+/* Test for attribute non-translation. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler "foo" } } */
+int walrus __attribute__ ((section (".foo")));
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/attribute2.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/attribute2.c
new file mode 100644
index 000000000..427e94979
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/attribute2.c
@@ -0,0 +1,8 @@
+/* Test to make sure that invalid attributes aren't translated.
+ If error recovery is ever testable then "foobar" should be
+ translated. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ */
+int foo __attribute__ ((walrus)); /* { dg-warning "walrus" "ignored" } */
+char x[] = "foobar";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/builtin1.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/builtin1.c
new file mode 100644
index 000000000..753049c96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/builtin1.c
@@ -0,0 +1,26 @@
+/* isdigit(c) can be optimized to ((unsigned)c) - '0' <= 9, but only if
+ we know the correct value of '0'. PR 18785. */
+
+/* { dg-do run } */
+/* { dg-require-iconv "IBM1047" } */
+/* { dg-options "-O2 -fno-inline -fexec-charset=IBM1047" } */
+
+extern int isdigit(int);
+extern void abort(void);
+
+static int str1(void) { return '1'; }
+static int strA(void) { return 'A'; }
+
+int
+main(void)
+{
+ if (!isdigit('1'))
+ abort();
+ if (isdigit('A'))
+ abort();
+ if (!isdigit(str1()))
+ abort();
+ if (isdigit(strA()))
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/builtin2.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/builtin2.c
new file mode 100644
index 000000000..bfe9a20e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/builtin2.c
@@ -0,0 +1,32 @@
+/* Ensure that transformations of *printf are performed correctly
+ regardless of -fexec-charset. See PR 25120. */
+
+/* { dg-do compile } */
+/* { dg-require-iconv "IBM1047" } */
+/* { dg-options "-O2 -fexec-charset=IBM1047" } */
+/* { dg-final { scan-assembler-not "printf" } } */
+/* { dg-final { scan-assembler-not "fprintf" } } */
+/* { dg-final { scan-assembler-not "sprintf" } } */
+
+#include <stdio.h>
+
+void foo (char *dst, const char *src)
+{
+ printf ("\n");
+ printf ("hello world\n");
+ printf ("%s", "\n");
+ printf ("%s", "hello world\n");
+ printf ("%c", '\n');
+ printf ("%s\n", "hello world");
+ printf ("%s\n", src);
+
+ fprintf (stdout, "\n");
+ fprintf (stdout, "hello world\n");
+ fprintf (stdout, "%s", "\n");
+ fprintf (stdout, "%s", "hello world\n");
+ fprintf (stdout, "%c", '\n');
+ fprintf (stdout, "%s", src);
+
+ sprintf (dst, "hello world\n");
+ sprintf (dst, "%s", src);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/charset.exp b/gcc-4.9/gcc/testsuite/gcc.dg/charset/charset.exp
new file mode 100644
index 000000000..b75dfabad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/charset.exp
@@ -0,0 +1,44 @@
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the 'dg.exp' driver.
+
+# There's a bunch of headers we need.
+if [is_remote host] {
+ foreach header [glob -nocomplain $srcdir/$subdir/*.{h,def} ] {
+ remote_download host $header
+ }
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib target-supports.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CHARSETCFLAGS
+if ![info exists DEFAULT_CHARSETCFLAGS] then {
+ set DEFAULT_CHARSETCFLAGS "-fexec-charset=IBM1047"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \
+ "" $DEFAULT_CHARSETCFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/extern.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/extern.c
new file mode 100644
index 000000000..05a0c3e42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/extern.c
@@ -0,0 +1,11 @@
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler-not "abcdefghijklmnopqrstuvwxyz" } } */
+
+extern char *bar;
+
+extern void foo (void)
+{
+ char str[]="abcdefghijklmnopqrstuvwxyz";
+ bar = str;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/function.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/function.c
new file mode 100644
index 000000000..5aba6511b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/function.c
@@ -0,0 +1,10 @@
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler-not "\"foobar\"" } } */
+
+const char *str;
+
+void foobar (void)
+{
+ str = __FUNCTION__;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/charset/string.c b/gcc-4.9/gcc/testsuite/gcc.dg/charset/string.c
new file mode 100644
index 000000000..f720773dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/charset/string.c
@@ -0,0 +1,5 @@
+/* Simple character translation test. */
+/* { dg-do compile }
+ { dg-require-iconv "IBM1047" }
+ { dg-final { scan-assembler-not "string foobar" } } */
+char *foo = "string foobar";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp
new file mode 100644
index 000000000..61085fd8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp
@@ -0,0 +1,71 @@
+# Copyright (C) 2013-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Written by Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+
+load_lib gcc-dg.exp
+load_lib lto.exp
+
+if { ![check_effective_target_cilkplus] } {
+ return;
+}
+
+set library_var [get_multilibs]
+# Pointing the ld_library_path to the Cilk Runtime library binaries.
+append ld_library_path ":${library_var}/libcilkrts/.libs"
+set_ld_library_path_env_vars
+
+global TEST_EXTRA_LIBS
+set TEST_EXTRA_LIBS "-L${library_var}/libcilkrts/.libs"
+
+dg-init
+
+# Run the tests that are shared with C++.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/PS/*.c]] " -ftree-vectorize -fcilkplus -std=c99" " "
+# Run the C-only tests.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] \
+ "-ftree-vectorize -fcilkplus -std=c99" " "
+
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O1 -fcilkplus" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O2 -fcilkplus" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -O3 -fcilkplus" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -g -fcilkplus" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -g -O2 -ftree-vectorize -fcilkplus" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -std=c99" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -O2 -std=c99" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -O3 -std=c99" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/AN/*.c]] " -fcilkplus -g -O0 -std=c99" " "
+
+if { [check_libcilkrts_available] } {
+ dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -g " " "
+ dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O1 " " "
+ dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O2 -std=c99 " " "
+ dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O2 -ftree-vectorize " " "
+ dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O3 -g " " "
+ if { [check_effective_target_lto] } {
+ dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/CK/*.c]] " -O3 -flto -g " " "
+ }
+}
+
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] " -g" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] " -O3 -std=c99" " "
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cilk-plus/SE/*.c]] " -O3 -g" " "
+
+dg-finish
+
+unset TEST_EXTRA_LIBS
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/for1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/for1.c
new file mode 100644
index 000000000..4fb534286
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/for1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+int *a, *b, *c;
+
+void foo()
+{
+ int i, j;
+ // The initialization shall declare or initialize a *SINGLE* variable.
+#pragma simd
+ for (i=0, j=5; i < 1000; i++) // { dg-error "expected ';' before ','" }
+ a[i] = b[j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/for2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/for2.c
new file mode 100644
index 000000000..285f35a50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/for2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcilkplus" } */
+
+int *a, *b;
+
+void foo()
+{
+#pragma simd
+ for (const int ci=0; ci<1000; ++ci) /* { dg-error "increment of read-only var\|invalid controlling\|invalid increment\|assignment of read" } */
+ a[ci] = b[ci];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c
new file mode 100644
index 000000000..95e6b2d44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump-openmp.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus -fopenmp" } */
+/* { dg-require-effective-target fopenmp } */
+
+int *a, *b, c;
+
+void foo()
+{
+#pragma simd
+ for (int i=0; i < 1000; ++i)
+ {
+ a[i] = b[i];
+ if (c == 5)
+ return; /* { dg-error "invalid branch to/from a Cilk Plus structured block" } */
+ }
+}
+
+void bar()
+{
+#pragma simd
+ for (int i=0; i < 1000; ++i)
+ {
+ lab:
+ a[i] = b[i];
+ }
+ if (c == 6)
+ goto lab; /* { dg-error "invalid entry to Cilk Plus structured block" } */
+}
+
+void baz()
+{
+ bad1:
+ #pragma omp parallel
+ goto bad1; /* { dg-error "invalid branch to/from an OpenMP structured block" } */
+
+ goto bad2; /* { dg-error "invalid entry to OpenMP structured block" } */
+ #pragma omp parallel
+ {
+ bad2: ;
+ }
+
+ #pragma omp parallel
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c
new file mode 100644
index 000000000..9ec3293cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cilk-plus/jump.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+int *a, *b, c;
+
+void foo()
+{
+#pragma simd
+ for (int i=0; i < 1000; ++i)
+ {
+ a[i] = b[i];
+ if (c == 5)
+ return; /* { dg-error "invalid branch to.from a Cilk" } */
+ }
+}
+
+void bar()
+{
+#pragma simd
+ for (int i=0; i < 1000; ++i)
+ {
+ lab:
+ a[i] = b[i];
+ }
+ if (c == 6)
+ goto lab; /* { dg-error "invalid entry to Cilk Plus" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-1.c
new file mode 100644
index 000000000..48b82646e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+/* Validate expected warnings and errors. */
+
+#define U __attribute__((unused))
+#define C(x) __attribute__((cleanup(x)))
+
+static int f1(void *x U) { return 0; }
+static void f2() { }
+static void f3(void) { } /* { dg-message "note: declared here" } */
+static void f4(void *x U) { }
+static void f5(int *x U) { }
+static void f6(double *x U) { } /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */
+static void f7(const int *x U) { }
+static void f8(const int *x U, int y U) { } /* { dg-message "note: declared here" } */
+static void f9(int x U) { } /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */
+
+void test(void)
+{
+ int o1 C(f1);
+ int o2 C(f2);
+ int o3 C(f3); /* { dg-error "too many arguments" } */
+ int o4 C(f4);
+ int o5 C(f5);
+ int o6 C(f6); /* { dg-warning "incompatible pointer type" } */
+ int o7 C(f7);
+ int o8 C(f8); /* { dg-error "too few arguments" } */
+ int o9 C(f9); /* { dg-warning "from pointer without a cast" } */
+ int o10 U C(undef); /* { dg-error "not a function" } */
+ int o11 U C(o1); /* { dg-error "not a function" } */
+ int o12 U C("f1"); /* { dg-error "not an identifier" } */
+ static int o13 U C(f1); /* { dg-warning "attribute ignored" } */
+}
+
+int o14 C(f1); /* { dg-warning "attribute ignored" } */
+void t15(int o U C(f1)) {} /* { dg-warning "attribute ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-10.c
new file mode 100644
index 000000000..16035b1ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-10.c
@@ -0,0 +1,116 @@
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
+/* Verify that cleanups work with exception handling through signal frames
+ on alternate stack. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+int count;
+char *null;
+
+static void counter (void *p __attribute__((unused)))
+{
+ ++count;
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ if (count != 2)
+ abort ();
+ exit (0);
+}
+
+static int __attribute__((noinline)) fn5 ()
+{
+ char dummy __attribute__((cleanup (counter)));
+ force_unwind ();
+ return 0;
+}
+
+static void fn4 (int sig, siginfo_t *info, void *ctx)
+{
+ char dummy __attribute__((cleanup (counter)));
+ fn5 ();
+ null = NULL;
+}
+
+static void fn3 ()
+{
+ abort ();
+}
+
+static int __attribute__((noinline)) fn2 ()
+{
+ *null = 0;
+ fn3 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn1 ()
+{
+ stack_t ss;
+ struct sigaction s;
+
+ ss.ss_size = 4 * sysconf (_SC_PAGESIZE);
+ if (ss.ss_size < SIGSTKSZ)
+ ss.ss_size = SIGSTKSZ;
+ ss.ss_sp = malloc (ss.ss_size);
+ if (ss.ss_sp == NULL)
+ exit (1);
+ ss.ss_flags = 0;
+ if (sigaltstack (&ss, NULL) < 0)
+ exit (1);
+
+ sigemptyset (&s.sa_mask);
+ s.sa_sigaction = fn4;
+ s.sa_flags = SA_RESETHAND | SA_ONSTACK;
+ sigaction (SIGSEGV, &s, NULL);
+ sigaction (SIGBUS, &s, NULL);
+ fn2 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn0 ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ fn1 ();
+ null = 0;
+ return 0;
+}
+
+int main()
+{
+ fn0 ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-11.c
new file mode 100644
index 000000000..ccc61ed41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-11.c
@@ -0,0 +1,116 @@
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
+/* Verify that cleanups work with exception handling through realtime signal
+ frames on alternate stack. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+int count;
+char *null;
+
+static void counter (void *p __attribute__((unused)))
+{
+ ++count;
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ if (count != 2)
+ abort ();
+ exit (0);
+}
+
+static int __attribute__((noinline)) fn5 ()
+{
+ char dummy __attribute__((cleanup (counter)));
+ force_unwind ();
+ return 0;
+}
+
+static void fn4 (int sig, siginfo_t *info, void *ctx)
+{
+ char dummy __attribute__((cleanup (counter)));
+ fn5 ();
+ null = NULL;
+}
+
+static void fn3 ()
+{
+ abort ();
+}
+
+static int __attribute__((noinline)) fn2 ()
+{
+ *null = 0;
+ fn3 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn1 ()
+{
+ stack_t ss;
+ struct sigaction s;
+
+ ss.ss_size = 4 * sysconf (_SC_PAGESIZE);
+ if (ss.ss_size < SIGSTKSZ)
+ ss.ss_size = SIGSTKSZ;
+ ss.ss_sp = malloc (ss.ss_size);
+ if (ss.ss_sp == NULL)
+ exit (1);
+ ss.ss_flags = 0;
+ if (sigaltstack (&ss, NULL) < 0)
+ exit (1);
+
+ sigemptyset (&s.sa_mask);
+ s.sa_sigaction = fn4;
+ s.sa_flags = SA_RESETHAND | SA_ONSTACK | SA_SIGINFO;
+ sigaction (SIGSEGV, &s, NULL);
+ sigaction (SIGBUS, &s, NULL);
+ fn2 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn0 ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ fn1 ();
+ null = 0;
+ return 0;
+}
+
+int main()
+{
+ fn0 ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-12.c
new file mode 100644
index 000000000..90de90ac8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-12.c
@@ -0,0 +1,69 @@
+/* PR middle-end/32758 */
+/* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */
+/* { dg-do run } */
+/* { dg-options "-O2 -fexceptions" } */
+/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
+/* Verify unwind info in presence of alloca. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <string.h>
+
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind (void)
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+__attribute__((noinline))
+void foo (void *x __attribute__((unused)))
+{
+ force_unwind ();
+}
+
+__attribute__((noinline))
+int bar (unsigned int x)
+{
+ void *y = __builtin_alloca (x);
+ foo (y);
+ return 1;
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ exit (0);
+}
+
+__attribute__((noinline))
+static void doit ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ bar (1024);
+}
+
+int main ()
+{
+ doit ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-13.c
new file mode 100644
index 000000000..5a0d4c69f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-13.c
@@ -0,0 +1,332 @@
+/* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */
+/* { dg-do run } */
+/* { dg-options "-fexceptions" } */
+/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
+/* Verify DW_OP_* handling in the unwinder. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* #define OP_addr(x) 0x06, ... */
+#define OP_deref 0x06,
+#define SLEB128(x) (x)&0x7f /* Assume here the value is -0x40 ... 0x3f. */
+#define ULEB128(x) (x)&0x7f /* Assume here the value is 0 ... 0x7f. */
+#define VAL1(x) (x)&0xff
+#if defined (__BIG_ENDIAN__)
+#define VAL2(x) ((x)>>8)&0xff,(x)&0xff
+#define VAL4(x) ((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff
+#define VAL8(x) ((x)>>56)&0xff,((x)>>48)&0xff,((x)>>40)&0xff,((x)>>32)&0xff,((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff
+#elif defined(__LITTLE_ENDIAN__) || defined(__x86_64__) || defined(__i386__)
+#define VAL2(x) (x)&0xff,((x)>>8)&0xff
+#define VAL4(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff
+#define VAL8(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff,((x)>>32)&0xff,((x)>>40)&0xff,((x)>>48)&0xff,((x)>>56)&0xff
+#endif
+#define OP_const1u(x) 0x08,VAL1(x),
+#define OP_const1s(x) 0x09,VAL1(x),
+#define OP_const2u(x) 0x0a,VAL2(x),
+#define OP_const2s(x) 0x0b,VAL2(x),
+#define OP_const4u(x) 0x0c,VAL4(x),
+#define OP_const4s(x) 0x0d,VAL4(x),
+#define OP_const8u(x) 0x0e,VAL8(x),
+#define OP_const8s(x) 0x0f,VAL8(x),
+#define OP_constu(x) 0x10,ULEB128(x),
+#define OP_consts(x) 0x11,SLEB128(x),
+#define OP_dup 0x12,
+#define OP_drop 0x13,
+#define OP_over 0x14,
+#define OP_pick(x) 0x15,VAL1(x),
+#define OP_swap 0x16,
+#define OP_rot 0x17,
+#define OP_xderef 0x18,
+#define OP_abs 0x19,
+#define OP_and 0x1a,
+#define OP_div 0x1b,
+#define OP_minus 0x1c,
+#define OP_mod 0x1d,
+#define OP_mul 0x1e,
+#define OP_neg 0x1f,
+#define OP_not 0x20,
+#define OP_or 0x21,
+#define OP_plus 0x22,
+#define OP_plus_uconst(x) 0x23,ULEB128(x),
+#define OP_shl 0x24,
+#define OP_shr 0x25,
+#define OP_shra 0x26,
+#define OP_xor 0x27,
+#define OP_bra(x) 0x28,VAL2(x),
+#define OP_eq 0x29,
+#define OP_ge 0x2a,
+#define OP_gt 0x2b,
+#define OP_le 0x2c,
+#define OP_lt 0x2d,
+#define OP_ne 0x2e,
+#define OP_skip(x) 0x2f,VAL2(x),
+#define OP_lit0 0x30,
+#define OP_lit1 0x31,
+#define OP_lit2 0x32,
+#define OP_lit3 0x33,
+#define OP_lit4 0x34,
+#define OP_lit5 0x35,
+#define OP_lit6 0x36,
+#define OP_lit7 0x37,
+#define OP_lit8 0x38,
+#define OP_lit9 0x39,
+#define OP_lit10 0x3a,
+#define OP_lit11 0x3b,
+#define OP_lit12 0x3c,
+#define OP_lit13 0x3d,
+#define OP_lit14 0x3e,
+#define OP_lit15 0x3f,
+#define OP_lit16 0x40,
+#define OP_lit17 0x41,
+#define OP_lit18 0x42,
+#define OP_lit19 0x43,
+#define OP_lit20 0x44,
+#define OP_lit21 0x45,
+#define OP_lit22 0x46,
+#define OP_lit23 0x47,
+#define OP_lit24 0x48,
+#define OP_lit25 0x49,
+#define OP_lit26 0x4a,
+#define OP_lit27 0x4b,
+#define OP_lit28 0x4c,
+#define OP_lit29 0x4d,
+#define OP_lit30 0x4e,
+#define OP_lit31 0x4f,
+#define OP_reg0 0x50,
+#define OP_reg1 0x51,
+#define OP_reg2 0x52,
+#define OP_reg3 0x53,
+#define OP_reg4 0x54,
+#define OP_reg5 0x55,
+#define OP_reg6 0x56,
+#define OP_reg7 0x57,
+#define OP_reg8 0x58,
+#define OP_reg9 0x59,
+#define OP_reg10 0x5a,
+#define OP_reg11 0x5b,
+#define OP_reg12 0x5c,
+#define OP_reg13 0x5d,
+#define OP_reg14 0x5e,
+#define OP_reg15 0x5f,
+#define OP_reg16 0x60,
+#define OP_reg17 0x61,
+#define OP_reg18 0x62,
+#define OP_reg19 0x63,
+#define OP_reg20 0x64,
+#define OP_reg21 0x65,
+#define OP_reg22 0x66,
+#define OP_reg23 0x67,
+#define OP_reg24 0x68,
+#define OP_reg25 0x69,
+#define OP_reg26 0x6a,
+#define OP_reg27 0x6b,
+#define OP_reg28 0x6c,
+#define OP_reg29 0x6d,
+#define OP_reg30 0x6e,
+#define OP_reg31 0x6f,
+#define OP_breg0(x) 0x70,SLEB128(x),
+#define OP_breg1(x) 0x71,SLEB128(x),
+#define OP_breg2(x) 0x72,SLEB128(x),
+#define OP_breg3(x) 0x73,SLEB128(x),
+#define OP_breg4(x) 0x74,SLEB128(x),
+#define OP_breg5(x) 0x75,SLEB128(x),
+#define OP_breg6(x) 0x76,SLEB128(x),
+#define OP_breg7(x) 0x77,SLEB128(x),
+#define OP_breg8(x) 0x78,SLEB128(x),
+#define OP_breg9(x) 0x79,SLEB128(x),
+#define OP_breg10(x) 0x7a,SLEB128(x),
+#define OP_breg11(x) 0x7b,SLEB128(x),
+#define OP_breg12(x) 0x7c,SLEB128(x),
+#define OP_breg13(x) 0x7d,SLEB128(x),
+#define OP_breg14(x) 0x7e,SLEB128(x),
+#define OP_breg15(x) 0x7f,SLEB128(x),
+#define OP_breg16(x) 0x80,SLEB128(x),
+#define OP_breg17(x) 0x81,SLEB128(x),
+#define OP_breg18(x) 0x82,SLEB128(x),
+#define OP_breg19(x) 0x83,SLEB128(x),
+#define OP_breg20(x) 0x84,SLEB128(x),
+#define OP_breg21(x) 0x85,SLEB128(x),
+#define OP_breg22(x) 0x86,SLEB128(x),
+#define OP_breg23(x) 0x87,SLEB128(x),
+#define OP_breg24(x) 0x88,SLEB128(x),
+#define OP_breg25(x) 0x89,SLEB128(x),
+#define OP_breg26(x) 0x8a,SLEB128(x),
+#define OP_breg27(x) 0x8b,SLEB128(x),
+#define OP_breg28(x) 0x8c,SLEB128(x),
+#define OP_breg29(x) 0x8d,SLEB128(x),
+#define OP_breg30(x) 0x8e,SLEB128(x),
+#define OP_breg31(x) 0x8f,SLEB128(x),
+#define OP_regx(x) 0x90,SLEB128(x),
+#define OP_fbreg(x) 0x91,SLEB128(x),
+#define OP_bregx(x,y) 0x92,ULEB128(x),SLEB128(y),
+#define OP_piece(x) 0x93,ULEB128(x),
+#define OP_deref_size(x) 0x94,VAL1(x),
+#define OP_xderef_size(x) 0x95,VAL1(x),
+#define OP_nop 0x96,
+#define OP_nop_termination 0x96
+#define OP_push_object_address 0x97,
+#define OP_call2(x) 0x98,VAL2(x),
+#define OP_call4(x) 0x99,VAL4(x),
+/* #define OP_call_ref(x) 0x9a,... */
+#define OP_form_tls_address(x) 0x9b,
+#define OP_call_frame_cfa 0x9c,
+#define OP_bit_piece(x) 0x9d,ULEB128(x),
+/* #define OP_implicit_value(x...) 0x9e,... */
+#define OP_stack_value 0x9f,
+#define OP_GNU_push_tls_address 0xe0,
+/* #define OP_GNU_encoded_addr(x...) 0xf1, */
+
+#define ASSERT_TOS_NON0 OP_bra(3) OP_skip(-3)
+#define ASSERT_TOS_0 OP_lit0 OP_eq ASSERT_TOS_NON0
+
+/* Initially there is CFA value on the stack, we want to
+ keep it there at the end. */
+#define CFI_PROGRAM \
+OP_lit0 OP_nop ASSERT_TOS_0 \
+OP_lit1 ASSERT_TOS_NON0 \
+OP_lit1 OP_const1u(1) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_const2u(16) OP_eq ASSERT_TOS_NON0 \
+OP_lit31 OP_const4u(31) OP_ne ASSERT_TOS_0 \
+OP_lit1 OP_neg OP_const1s(-1) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_neg OP_const2s(-16) OP_ne ASSERT_TOS_0 \
+OP_lit31 OP_const4s(-31) OP_neg OP_ne ASSERT_TOS_0 \
+OP_lit7 OP_dup OP_plus_uconst(2) OP_lit9 OP_eq ASSERT_TOS_NON0 \
+ OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_lit20 OP_lit1 OP_drop OP_lit20 OP_eq ASSERT_TOS_NON0 \
+OP_lit17 OP_lit19 OP_over OP_lit17 OP_eq ASSERT_TOS_NON0 \
+ OP_lit19 OP_eq ASSERT_TOS_NON0 OP_lit17 OP_eq ASSERT_TOS_NON0 \
+OP_lit1 OP_lit2 OP_lit3 OP_lit4 OP_pick(2) OP_lit2 OP_eq ASSERT_TOS_NON0\
+ OP_lit4 OP_eq ASSERT_TOS_NON0 OP_lit3 OP_eq ASSERT_TOS_NON0 \
+ OP_pick(0) OP_lit2 OP_eq ASSERT_TOS_NON0 \
+ OP_lit2 OP_eq ASSERT_TOS_NON0 OP_lit1 OP_eq ASSERT_TOS_NON0 \
+OP_lit6 OP_lit12 OP_swap OP_lit6 OP_eq ASSERT_TOS_NON0 \
+ OP_lit12 OP_eq ASSERT_TOS_NON0 \
+OP_lit7 OP_lit8 OP_lit9 OP_rot OP_lit8 OP_eq ASSERT_TOS_NON0 \
+ OP_lit7 OP_eq ASSERT_TOS_NON0 OP_lit9 OP_eq ASSERT_TOS_NON0 \
+OP_lit7 OP_abs OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-123) OP_abs OP_const1u(123) OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_and OP_lit2 OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_or OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_lit17 OP_lit2 OP_minus OP_lit15 OP_eq ASSERT_TOS_NON0 \
+/* Divide is signed truncating toward zero. */ \
+OP_const1s(-6) OP_const1s(-2) OP_div OP_lit3 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-7) OP_const1s(3) OP_div OP_const1s(-2) \
+ OP_eq ASSERT_TOS_NON0 \
+/* Modulo is unsigned. */ \
+OP_const1s(-6) OP_const1s(-4) OP_mod OP_const1s(-6) \
+ OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit4 OP_mod OP_lit2 OP_eq ASSERT_TOS_NON0 \
+OP_lit6 OP_const1s(-4) OP_mod OP_lit6 OP_eq ASSERT_TOS_NON0 \
+/* Signed modulo can be implemented using "over over div mul minus". */\
+OP_const1s(-6) OP_const1s(-4) OP_over OP_over OP_div OP_mul OP_minus \
+ OP_const1s(-2) OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-7) OP_lit3 OP_over OP_over OP_div OP_mul OP_minus \
+ OP_const1s(-1) OP_eq ASSERT_TOS_NON0 \
+OP_lit7 OP_const1s(-3) OP_over OP_over OP_div OP_mul OP_minus \
+ OP_lit1 OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit31 OP_plus_uconst(1) OP_mul OP_const2u(512) \
+ OP_eq ASSERT_TOS_NON0 \
+OP_lit5 OP_not OP_lit31 OP_and OP_lit26 OP_eq ASSERT_TOS_NON0 \
+OP_lit12 OP_lit31 OP_plus OP_const1u(43) OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit2 OP_plus OP_const1s(-4) OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_plus_uconst(3) OP_const1s(-3) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit4 OP_shl OP_const2u(256) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit3 OP_shr OP_lit2 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-16) OP_lit3 OP_shra OP_const1s(-2) OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_xor OP_lit5 OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_le ASSERT_TOS_NON0 \
+OP_lit3 OP_lit3 OP_le ASSERT_TOS_NON0 \
+OP_lit6 OP_lit3 OP_le ASSERT_TOS_0 \
+OP_lit3 OP_lit6 OP_lt ASSERT_TOS_NON0 \
+OP_lit3 OP_lit3 OP_lt ASSERT_TOS_0 \
+OP_lit6 OP_lit3 OP_lt ASSERT_TOS_0 \
+OP_lit3 OP_lit6 OP_ge ASSERT_TOS_0 \
+OP_lit3 OP_lit3 OP_ge ASSERT_TOS_NON0 \
+OP_lit6 OP_lit3 OP_ge ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_gt ASSERT_TOS_0 \
+OP_lit3 OP_lit3 OP_gt ASSERT_TOS_0 \
+OP_lit6 OP_lit3 OP_gt ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit1 OP_shr OP_lit0 OP_gt ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit1 OP_shra OP_lit0 OP_lt ASSERT_TOS_NON0
+
+#define CFI_ESCAPE_VAL_2(VALUES...) #VALUES
+#define CFI_ESCAPE_VAL_1(VALUES...) CFI_ESCAPE_VAL_2(VALUES)
+#define CFI_ESCAPE_VAL(VALUES...) CFI_ESCAPE_VAL_1(VALUES)
+#define CFI_ESCAPE do { } while (0)
+#define CFI_ARCH_PROGRAM OP_nop_termination
+#ifdef __GCC_HAVE_DWARF2_CFI_ASM
+#if defined (__x86_64__)
+#undef CFI_ESCAPE
+#undef CFI_ARCH_PROGRAM
+#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit8 OP_minus OP_nop_termination
+unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM };
+extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1];
+/* DW_CFA_expression %rip, uleb128(l2-l1), l1: program DW_OP_lit8 DW_OP_minus DW_OP_nop l2: */
+#define CFI_ESCAPE \
+ asm volatile (".cfi_escape 0x10, 0x10, (%P0&0x7f)+0x80, %P0>>7, " \
+ CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \
+ : : "i" (sizeof (cfi_arch_program)))
+#elif defined (__i386__)
+#undef CFI_ESCAPE
+#undef CFI_ARCH_PROGRAM
+#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit4 OP_minus OP_nop_termination
+unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM };
+extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1];
+/* DW_CFA_expression %eip, uleb128(l2-l1), l1: program DW_OP_lit4 DW_OP_minus DW_OP_nop l2: */
+#define CFI_ESCAPE \
+ asm volatile (".cfi_escape 0x10, 8, (%P0&0x7f)+0x80, %P0>>7, " \
+ CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \
+ : : "i" (sizeof (cfi_arch_program)))
+#endif
+#endif
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ exit (0);
+}
+
+__attribute__((noinline)) static void callme ()
+{
+ CFI_ESCAPE;
+ force_unwind ();
+}
+
+__attribute__((noinline)) static void doit ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ callme ();
+}
+
+int main()
+{
+ doit ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-2.c
new file mode 100644
index 000000000..2c798023c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-2.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "" } */
+/* Verify that cleanup works in the most basic of ways. */
+
+extern void exit(int);
+extern void abort(void);
+
+static void handler(void *p __attribute__((unused)))
+{
+ exit (0);
+}
+
+static void doit(void)
+{
+ int x __attribute__((cleanup (handler)));
+}
+
+int main()
+{
+ doit ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-3.c
new file mode 100644
index 000000000..b5b01fd59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-3.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-options "" } */
+/* Verify that the cleanup handler receives the proper contents
+ of the variable. */
+
+extern void exit(int);
+extern void abort(void);
+
+static int expected;
+
+static void
+handler(int *p)
+{
+ if (*p != expected)
+ abort ();
+}
+
+static void __attribute__((noinline))
+bar(void)
+{
+}
+
+static void doit(int x, int y)
+{
+ int r __attribute__((cleanup (handler)));
+ if (x < y)
+ {
+ r = 0;
+ return;
+ }
+
+ bar();
+ r = x + y;
+}
+
+int main()
+{
+ expected = 0;
+ doit (1, 2);
+
+ expected = 3;
+ doit (2, 1);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-4.c
new file mode 100644
index 000000000..a5487553d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-4.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "" } */
+/* Verify cleanup execution on non-trivial exit from a block. */
+
+extern void exit(int);
+extern void abort(void);
+
+static int counter;
+
+static void
+handler(int *p)
+{
+ counter += *p;
+}
+
+static void __attribute__((noinline))
+bar(void)
+{
+}
+
+static void doit(int n, int n2)
+{
+ int i;
+ for (i = 0; i < n; ++i)
+ {
+ int dummy __attribute__((cleanup (handler))) = i;
+ if (i == n2)
+ break;
+ bar();
+ }
+}
+
+int main()
+{
+ doit (10, 6);
+ if (counter != 0 + 1 + 2 + 3 + 4 + 5 + 6)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-5.c
new file mode 100644
index 000000000..c335c1e44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-5.c
@@ -0,0 +1,53 @@
+/* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */
+/* { dg-do run } */
+/* { dg-options "-fexceptions" } */
+/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
+/* Verify that cleanups work with exception handling. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <string.h>
+
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ exit (0);
+}
+
+static void doit ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ force_unwind ();
+}
+
+int main()
+{
+ doit ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-6.c
new file mode 100644
index 000000000..4e3d53893
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-6.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+/* Verify that a cleanup marked "inline" gets inlined. */
+
+static inline void xyzzy(void *p __attribute__((unused)))
+{
+}
+
+void doit(void)
+{
+ int x __attribute__((cleanup (xyzzy)));
+}
+
+/* { dg-final { scan-assembler-not "xyzzy" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-7.c
new file mode 100644
index 000000000..eae3d5298
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-7.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "" } */
+/* Verify that the search for function happens in the proper scope. */
+
+extern void exit(int);
+extern void abort(void);
+
+int main()
+{
+ auto void xyzzy(void *p __attribute__((unused)))
+ {
+ exit (0);
+ }
+
+ auto void doit ()
+ {
+ int x __attribute__((cleanup (xyzzy)));
+ }
+
+ doit ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-8.c
new file mode 100644
index 000000000..553c0385d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-8.c
@@ -0,0 +1,99 @@
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
+/* Verify that cleanups work with exception handling through signal
+ frames. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+int count;
+char *null;
+
+static void counter (void *p __attribute__((unused)))
+{
+ ++count;
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ if (count != 2)
+ abort ();
+ exit (0);
+}
+
+static int __attribute__((noinline)) fn5 ()
+{
+ char dummy __attribute__((cleanup (counter)));
+ force_unwind ();
+ return 0;
+}
+
+static void fn4 (int sig)
+{
+ char dummy __attribute__((cleanup (counter)));
+ fn5 ();
+ null = NULL;
+}
+
+static void fn3 ()
+{
+ abort ();
+}
+
+static int __attribute__((noinline)) fn2 ()
+{
+ *null = 0;
+ fn3 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn1 ()
+{
+ signal (SIGSEGV, fn4);
+ signal (SIGBUS, fn4);
+ fn2 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn0 ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ fn1 ();
+ null = 0;
+ return 0;
+}
+
+int main()
+{
+ fn0 ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-9.c
new file mode 100644
index 000000000..fe2807234
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cleanup-9.c
@@ -0,0 +1,103 @@
+/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */
+/* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */
+/* Verify that cleanups work with exception handling through realtime
+ signal frames. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+int count;
+char *null;
+
+static void counter (void *p __attribute__((unused)))
+{
+ ++count;
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ if (count != 2)
+ abort ();
+ exit (0);
+}
+
+static int __attribute__((noinline)) fn5 ()
+{
+ char dummy __attribute__((cleanup (counter)));
+ force_unwind ();
+ return 0;
+}
+
+static void fn4 (int sig, siginfo_t *info, void *ctx)
+{
+ char dummy __attribute__((cleanup (counter)));
+ fn5 ();
+ null = NULL;
+}
+
+static void fn3 ()
+{
+ abort ();
+}
+
+static int __attribute__((noinline)) fn2 ()
+{
+ *null = 0;
+ fn3 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn1 ()
+{
+ struct sigaction s;
+ sigemptyset (&s.sa_mask);
+ s.sa_sigaction = fn4;
+ s.sa_flags = SA_RESETHAND | SA_SIGINFO;
+ sigaction (SIGSEGV, &s, NULL);
+ sigaction (SIGBUS, &s, NULL);
+ fn2 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn0 ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ fn1 ();
+ null = 0;
+ return 0;
+}
+
+int main()
+{
+ fn0 ();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-1.c
new file mode 100644
index 000000000..66afac87b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-1.c
@@ -0,0 +1,13 @@
+/* Test diagnostics for addresses of labels and computed gotos. Test
+ with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f (void)
+{
+ void *p = &&a;
+ goto *p;
+ a: ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-2.c
new file mode 100644
index 000000000..85b0049fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-2.c
@@ -0,0 +1,13 @@
+/* Test diagnostics for addresses of labels and computed gotos. Test
+ with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+void
+f (void)
+{
+ void *p = &&a; /* { dg-warning "taking the address of a label is non-standard" } */
+ goto *p; /* { dg-warning "ISO C forbids 'goto \\*expr;'" } */
+ a: ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-3.c
new file mode 100644
index 000000000..5a3b4d2ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/comp-goto-3.c
@@ -0,0 +1,13 @@
+/* Test diagnostics for addresses of labels and computed gotos. Test
+ with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+void
+f (void)
+{
+ void *p = &&a; /* { dg-error "taking the address of a label is non-standard" } */
+ goto *p; /* { dg-error "ISO C forbids 'goto \\*expr;'" } */
+ a: ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/comp-return-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/comp-return-1.c
new file mode 100644
index 000000000..82c398355
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/comp-return-1.c
@@ -0,0 +1,31 @@
+/* When merging a nonprototype definition of a function with a prior
+ prototype declaration, the composite type of the return types must
+ be formed rather than just copying the function type. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+
+typedef int a[];
+typedef int a5[5];
+typedef int a10[10];
+
+a *f1 ();
+a5 *f1 () { return 0; }
+
+a *f2 (void);
+a5 *f2 () { return 0; }
+
+a *f3 ();
+a5 *f3 (void) { return 0; }
+
+a *f4 (void);
+a5 *f4 (void) { return 0; }
+
+void
+g (void)
+{
+ a10 *x;
+ x = f1 (); /* { dg-error "incompatible" "f1" } */
+ x = f2 (); /* { dg-error "incompatible" "f2" } */
+ x = f3 (); /* { dg-error "incompatible" "f3" } */
+ x = f4 (); /* { dg-error "incompatible" "f4" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare1.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare1.c
new file mode 100644
index 000000000..17ba3ee20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare1.c
@@ -0,0 +1,41 @@
+/* Test for a bogus warning on comparison between signed and unsigned.
+ This was inspired by code in gcc. This testcase is identical to
+ compare9.c except that we use -fno-short-enums here and expect a
+ warning from case 4. */
+
+/* { dg-do compile } */
+/* { dg-options "-fno-short-enums -Wsign-compare" } */
+
+int tf = 1;
+
+/* This enumeration has an explicit negative value and is therefore signed. */
+enum mm1
+{
+ VOID, SI, DI, MAX = -1
+};
+
+/* This enumeration fits entirely in a signed int, but is unsigned anyway. */
+enum mm2
+{
+ VOID2, SI2, DI2, MAX2
+};
+
+int f(enum mm1 x)
+{
+ return x == (tf?DI:SI); /* { dg-bogus "signed and unsigned" "case 1" } */
+}
+
+int g(enum mm1 x)
+{
+ return x == (tf?DI:-1); /* { dg-bogus "signed and unsigned" "case 2" } */
+}
+
+int h(enum mm2 x)
+{
+ return x == (tf?DI2:SI2); /* { dg-bogus "signed and unsigned" "case 3" } */
+}
+
+int i(enum mm2 x)
+{
+ return x == (tf?DI2:-1); /* { dg-warning "signed and unsigned" "case 4" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare10.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare10.c
new file mode 100644
index 000000000..3b8af28bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare10.c
@@ -0,0 +1,16 @@
+/* Test for bogus -Wsign-compare warnings that appeared when not
+ folding operands before warning. */
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+int
+test_compare (int a, unsigned b)
+{
+ return (b > 8 * (a ? 4 : 8));
+}
+
+unsigned int
+test_conditional (int a, unsigned b, int c)
+{
+ return (c ? b : 8 * (a ? 4 : 8));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare2.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare2.c
new file mode 100644
index 000000000..0625eb9c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare2.c
@@ -0,0 +1,58 @@
+/* Test for a bogus warning on comparison between signed and unsigned.
+ This was inspired by code in gcc. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+int tf = 1;
+
+void f(int x, unsigned int y)
+{
+ /* ?: branches are constants. */
+ x > (tf?64:128); /* { dg-bogus "signed and unsigned" "case 1" } */
+ y > (tf?64:128); /* { dg-bogus "signed and unsigned" "case 2" } */
+
+ /* ?: branches are (recursively) constants. */
+ x > (tf?64:(tf?128:256)); /* { dg-bogus "signed and unsigned" "case 3" } */
+ y > (tf?64:(tf?128:256)); /* { dg-bogus "signed and unsigned" "case 4" } */
+
+ /* ?: branches are signed constants. */
+ x > (tf?64:-1); /* { dg-bogus "signed and unsigned" "case 5" } */
+ y > (tf?64:-1); /* { dg-warning "signed and unsigned" "case 6" } */
+
+ /* ?: branches are (recursively) signed constants. */
+ x > (tf?64:(tf?128:-1)); /* { dg-bogus "signed and unsigned" "case 7" } */
+ y > (tf?64:(tf?128:-1)); /* { dg-warning "signed and unsigned" "case 8" } */
+
+ /* Statement expression. */
+ x > ({tf; 64;}); /* { dg-bogus "signed and unsigned" "case 9" } */
+ y > ({tf; 64;}); /* { dg-bogus "signed and unsigned" "case 10" } */
+
+ /* Statement expression with recursive ?: . */
+ x > ({tf; tf?64:(tf?128:256);}); /* { dg-bogus "signed and unsigned" "case 11" } */
+ y > ({tf; tf?64:(tf?128:256);}); /* { dg-bogus "signed and unsigned" "case 12" } */
+
+ /* Statement expression with signed ?:. */
+ x > ({tf; tf?64:-1;}); /* { dg-bogus "signed and unsigned" "case 13" } */
+ y > ({tf; tf?64:-1;}); /* { dg-warning "signed and unsigned" "case 14" } */
+
+ /* Statement expression with recursive signed ?:. */
+ x > ({tf; tf?64:(tf?128:-1);}); /* { dg-bogus "signed and unsigned" "case 15" } */
+ y > ({tf; tf?64:(tf?128:-1);}); /* { dg-warning "signed and unsigned" "case 16" } */
+
+ /* ?: branches are constants. */
+ tf ? x : (tf?64:32); /* { dg-bogus "conditional expression" "case 17" } */
+ tf ? y : (tf?64:32); /* { dg-bogus "conditional expression" "case 18" } */
+
+ /* ?: branches are signed constants. */
+ tf ? x : (tf?64:-1); /* { dg-bogus "conditional expression" "case 19" } */
+ tf ? y : (tf?64:-1); /* { dg-warning "conditional expression" "case 20" } */
+
+ /* ?: branches are (recursively) constants. */
+ tf ? x : (tf?64:(tf?128:256)); /* { dg-bogus "conditional expression" "case 21" } */
+ tf ? y : (tf?64:(tf?128:256)); /* { dg-bogus "conditional expression" "case 22" } */
+
+ /* ?: branches are (recursively) signed constants. */
+ tf ? x : (tf?64:(tf?128:-1)); /* { dg-bogus "conditional expression" "case 23" } */
+ tf ? y : (tf?64:(tf?128:-1)); /* { dg-warning "conditional expression" "case 24" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare3.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare3.c
new file mode 100644
index 000000000..eda3faf27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare3.c
@@ -0,0 +1,59 @@
+/* Test for a bogus warning on comparison between signed and unsigned.
+ This was inspired by code in gcc. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+int tf = 1;
+
+void f(int x, unsigned int y)
+{
+ /* Test comparing conditional expressions containing truth values.
+ This can occur explicitly, or e.g. when (foo?2:(bar?1:0)) is
+ optimized into (foo?2:(bar!=0)). */
+ x > (tf?64:(tf!=x)); /* { dg-bogus "signed and unsigned" "case 1" } */
+ y > (tf?64:(tf!=x)); /* { dg-bogus "signed and unsigned" "case 2" } */
+ x > (tf?(tf!=x):64); /* { dg-bogus "signed and unsigned" "case 3" } */
+ y > (tf?(tf!=x):64); /* { dg-bogus "signed and unsigned" "case 4" } */
+
+ x > (tf?64:(tf==x)); /* { dg-bogus "signed and unsigned" "case 5" } */
+ y > (tf?64:(tf==x)); /* { dg-bogus "signed and unsigned" "case 6" } */
+ x > (tf?(tf==x):64); /* { dg-bogus "signed and unsigned" "case 7" } */
+ y > (tf?(tf==x):64); /* { dg-bogus "signed and unsigned" "case 8" } */
+
+ x > (tf?64:(tf>x)); /* { dg-bogus "signed and unsigned" "case 9" } */
+ y > (tf?64:(tf>x)); /* { dg-bogus "signed and unsigned" "case 10" } */
+ x > (tf?(tf>x):64); /* { dg-bogus "signed and unsigned" "case 11" } */
+ y > (tf?(tf>x):64); /* { dg-bogus "signed and unsigned" "case 12" } */
+
+ x < (tf?64:(tf<x)); /* { dg-bogus "signed and unsigned" "case 13" } */
+ y < (tf?64:(tf<x)); /* { dg-bogus "signed and unsigned" "case 14" } */
+ x < (tf?(tf<x):64); /* { dg-bogus "signed and unsigned" "case 15" } */
+ y < (tf?(tf<x):64); /* { dg-bogus "signed and unsigned" "case 16" } */
+
+ x > (tf?64:(tf>=x)); /* { dg-bogus "signed and unsigned" "case 17" } */
+ y > (tf?64:(tf>=x)); /* { dg-bogus "signed and unsigned" "case 18" } */
+ x > (tf?(tf>=x):64); /* { dg-bogus "signed and unsigned" "case 19" } */
+ y > (tf?(tf>=x):64); /* { dg-bogus "signed and unsigned" "case 20" } */
+
+ x > (tf?64:(tf<=x)); /* { dg-bogus "signed and unsigned" "case 21" } */
+ y > (tf?64:(tf<=x)); /* { dg-bogus "signed and unsigned" "case 22" } */
+ x > (tf?(tf<=x):64); /* { dg-bogus "signed and unsigned" "case 23" } */
+ y > (tf?(tf<=x):64); /* { dg-bogus "signed and unsigned" "case 24" } */
+
+ x > (tf?64:(tf&&x)); /* { dg-bogus "signed and unsigned" "case 25" } */
+ y > (tf?64:(tf&&x)); /* { dg-bogus "signed and unsigned" "case 26" } */
+ x > (tf?(tf&&x):64); /* { dg-bogus "signed and unsigned" "case 27" } */
+ y > (tf?(tf&&x):64); /* { dg-bogus "signed and unsigned" "case 28" } */
+
+ x > (tf?64:(tf||x)); /* { dg-bogus "signed and unsigned" "case 29" } */
+ y > (tf?64:(tf||x)); /* { dg-bogus "signed and unsigned" "case 30" } */
+ x > (tf?(tf||x):64); /* { dg-bogus "signed and unsigned" "case 31" } */
+ y > (tf?(tf||x):64); /* { dg-bogus "signed and unsigned" "case 32" } */
+
+ x > (tf?64:(!tf)); /* { dg-bogus "signed and unsigned" "case 33" } */
+ y > (tf?64:(!tf)); /* { dg-bogus "signed and unsigned" "case 34" } */
+ x > (tf?(!tf):64); /* { dg-bogus "signed and unsigned" "case 35" } */
+ y > (tf?(!tf):64); /* { dg-bogus "signed and unsigned" "case 36" } */
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare4.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare4.c
new file mode 100644
index 000000000..e5dad4d1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare4.c
@@ -0,0 +1,49 @@
+/* Test for a bogus warning on comparison between signed and unsigned.
+ Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 5/13/2001. */
+
+/* { dg-do compile } */
+/* { dg-options "-fshow-column -Wsign-compare -fstrict-overflow" } */
+
+extern void bar(void);
+
+int foo(int x, int y, unsigned u)
+{
+ /* A COMPOUND_EXPR is non-negative if the last element is known to
+ be non-negative. */
+ if (u < (bar(), -1)) /*{ dg-warning "9:signed and unsigned" "COMPOUND_EXPR" }*/
+ return x;
+ if (u < (bar(), 10))
+ return x;
+ if ((bar(), 10) < u)
+ return x;
+ if (u < (x ? (bar(),bar(),bar(),bar(),x==y) : 10))
+ return x;
+ if ((x ? 10 : (bar(),bar(),bar(),bar(),x==y)) < u)
+ return x;
+
+ /* Test an ABS_EXPR, which is by definition non-negative when
+ -fstrict-overflow is used. */
+ if (u < __builtin_abs(x))
+ return x;
+ if (__builtin_abs(x) < u)
+ return x;
+ if (u < (x ? __builtin_abs(x) : 10))
+ return x;
+ if ((x ? 10: __builtin_abs(x)) < u)
+ return x;
+
+ /* A MODIFY_EXPR is non-negative if the new value is known to be
+ non-negative. */
+ if (u < (x = -1)) /* { dg-warning "9:signed and unsigned" "MODIFY_EXPR" } */
+ return x;
+ if (u < (x = 10))
+ return x;
+ if ((x = 10) < u)
+ return x;
+ if (u < (x = (y ? (x==y) : 10)))
+ return x;
+ if ((x = (y ? 10 : (x==y))) < u)
+ return x;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare5.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare5.c
new file mode 100644
index 000000000..f19c575ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare5.c
@@ -0,0 +1,41 @@
+/* Test for a bogus warning on comparison between signed and unsigned.
+ Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/21/2001. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+extern void bar(void);
+
+int foo(int x, int y, unsigned u)
+{
+ /* A *_DIV_EXPR is non-negative if both operands are. */
+
+ if (u < ((x=-22)/33)) /* { dg-warning "signed and unsigned" "DIV_EXPR" } */
+ return x;
+
+ if (u < ((x=22)/33))
+ return x;
+
+ if (u < ((x=22)/(y=33)))
+ return x;
+
+ if (u < (((x&0x10000)?128:64) / ((y&0x10000)?8:4)))
+ return x;
+
+
+ /* A *_MOD_EXPR is non-negative if the first operand is. */
+
+ if (u < ((x=-22)%33)) /* { dg-warning "signed and unsigned" "MOD_EXPR" } */
+ return x;
+
+ if (u < ((x=22)%-33))
+ return x;
+
+ if (u < ((x==y)%-33))
+ return x;
+
+ if (u < (((x=22)/33)%-33))
+ return x;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare6.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare6.c
new file mode 100644
index 000000000..945d28239
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare6.c
@@ -0,0 +1,13 @@
+/* PR c/2098 */
+/* Test for a warning on comparison on out-of-range data. */
+/* { dg-do compile } */
+/* { dg-options "-Wtype-limits" } */
+
+signed char sc;
+unsigned char uc;
+
+void foo()
+{
+ if (sc == 10000) return; /* { dg-warning "always false" "signed" } */
+ if (uc == 10000) return; /* { dg-warning "always false" "unsigned" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare7.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare7.c
new file mode 100644
index 000000000..e2fbc04bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare7.c
@@ -0,0 +1,10 @@
+/* -Wall is not supposed to trigger -Wsign-compare for C. PR 10604.
+ See also g++.dg/warn/compare1.C. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+int f(unsigned a, int b)
+{
+ return a < b; /* { dg-bogus "signed and unsigned" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare8.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare8.c
new file mode 100644
index 000000000..d723c45a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare8.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+int
+f(unsigned short a1, unsigned short a2, unsigned int b)
+{
+ return ((a1+a2)|5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
+}
+
+int
+g(unsigned short a1, unsigned short a2, unsigned int b)
+{
+ return ((a1+a2)&5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
+}
+
+int
+h(unsigned short a1, unsigned short a2, unsigned int b)
+{
+ return ((a1+a2)^5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compare9.c b/gcc-4.9/gcc/testsuite/gcc.dg/compare9.c
new file mode 100644
index 000000000..02150cb1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compare9.c
@@ -0,0 +1,41 @@
+/* Test for a bogus warning on comparison between signed and unsigned.
+ This was inspired by code in gcc. This testcase is identical to
+ compare1.c except that we use -fshort-enums here and do not expect
+ a warning from case 4. */
+
+/* { dg-do compile } */
+/* { dg-options "-fshort-enums -Wsign-compare" } */
+
+int tf = 1;
+
+/* This enumeration has an explicit negative value and is therefore signed. */
+enum mm1
+{
+ VOID, SI, DI, MAX = -1
+};
+
+/* This enumeration fits entirely in a signed int, but is unsigned anyway. */
+enum mm2
+{
+ VOID2, SI2, DI2, MAX2
+};
+
+int f(enum mm1 x)
+{
+ return x == (tf?DI:SI); /* { dg-bogus "signed and unsigned" "case 1" } */
+}
+
+int g(enum mm1 x)
+{
+ return x == (tf?DI:-1); /* { dg-bogus "signed and unsigned" "case 2" } */
+}
+
+int h(enum mm2 x)
+{
+ return x == (tf?DI2:SI2); /* { dg-bogus "signed and unsigned" "case 3" } */
+}
+
+int i(enum mm2 x)
+{
+ return x == (tf?DI2:-1); /* { dg-bogus "signed and unsigned" "case 4" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/compat-common.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/compat-common.h
new file mode 100644
index 000000000..4b3fb9c14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/compat-common.h
@@ -0,0 +1,55 @@
+/* Several of the binary compatibility tests use these macros to
+ allow debugging the test or tracking down a failure by getting an
+ indication of whether each individual check passed or failed.
+ When DBG is defined, each check is shown by a dot (pass) or 'F'
+ (fail) rather than aborting as soon as a failure is detected. */
+
+#ifdef DBG
+#include <stdio.h>
+#define DEBUG_INIT setbuf (stdout, NULL);
+#define DEBUG_FPUTS(x) fputs (x, stdout)
+#define DEBUG_DOT putc ('.', stdout)
+#define DEBUG_NL putc ('\n', stdout)
+#define DEBUG_FAIL putc ('F', stdout); fails++
+#define DEBUG_CHECK { DEBUG_FAIL; } else { DEBUG_DOT; }
+#define DEBUG_FINI if (fails) DEBUG_FPUTS ("failed\n"); \
+ else DEBUG_FPUTS ("passed\n");
+#else
+#define DEBUG_INIT
+#define DEBUG_FPUTS(x)
+#define DEBUG_DOT
+#define DEBUG_NL
+#define DEBUG_FAIL abort ()
+#define DEBUG_CHECK abort ();
+#define DEBUG_FINI
+#endif
+
+#ifdef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+#define SKIP_COMPLEX_INT
+#endif
+#endif
+
+#ifndef SKIP_COMPLEX
+#ifdef __GNUC__
+#define CINT(x, y) (x + y * __extension__ 1i)
+#define CDBL(x, y) (x + y * __extension__ 1.0i)
+#else
+#ifdef __SUNPRO_C
+/* ??? Complex support without <complex.h>. */
+#else
+#include <complex.h>
+#endif
+#ifndef SKIP_COMPLEX_INT
+#define CINT(x, y) ((_Complex int) (x + y * _Complex_I))
+#endif
+#define CDBL(x, y) (x + y * _Complex_I)
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void abort (void);
+#else
+extern void abort (void);
+#endif
+extern int fails;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/compat.exp b/gcc-4.9/gcc/testsuite/gcc.dg/compat/compat.exp
new file mode 100644
index 000000000..ffb742ed3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/compat.exp
@@ -0,0 +1,86 @@
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# This file was written by Janis Johnson, <janis187@us.ibm.com>
+
+
+# Test interoperability of two compilers that follow the same ABI.
+#
+# Break simple tests into two pieces and see that they work when linked
+# together. If an alternate compiler is specified then the two main
+# pieces of each test are compiled with different compilers. The
+# alternate compiler must be installed, and is specified by defining
+# ALT_CC_UNDER_TEST in the environment.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+global GCC_UNDER_TEST
+global ALT_CC_UNDER_TEST
+global compat_save_gcc_under_test
+global compat_use_alt
+global compat_same_alt
+global compat_have_dfp
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib gcc.exp
+
+# Load the language-dependent compatibility support procedures.
+load_lib c-compat.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib compat.exp
+
+gcc_init
+
+# Save variables for the C compiler under test, which each test will
+# change a couple of times. This must be done after calling gcc-init.
+set compat_save_gcc_under_test $GCC_UNDER_TEST
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other compat tests running at the same time.
+set sid "c_compat"
+
+# Find out whether there is an alternate compiler to test. If the
+# variable is defined but is set to "same", that means we use the same
+# compiler twice, which is meaningful if the two parts of COMPAT_OPTIONS
+# are different.
+set compat_use_alt 0
+set compat_same_alt 0
+
+if [info exists ALT_CC_UNDER_TEST] then {
+ set compat_use_alt 1
+ if [string match "same" $ALT_CC_UNDER_TEST] then {
+ set compat_same_alt 1
+ }
+}
+
+compat_setup_dfp
+
+# Main loop.
+foreach src [lsort [find $srcdir/$subdir *_main.c]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+
+ compat-execute $src $sid $compat_use_alt
+}
+
+# Restore the original compiler under test.
+compat-use-tst-compiler
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_main.c
new file mode 100644
index 000000000..35c94aaea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_main.c
@@ -0,0 +1,12 @@
+/* Test passing function pointers. */
+
+extern void fnptr_by_value_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ fnptr_by_value_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_x.c
new file mode 100644
index 000000000..156a417a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_x.c
@@ -0,0 +1,162 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+typedef void (*fpi)(int);
+typedef void (*fpd)(double);
+
+extern void test1a (fpi);
+extern void test1b (fpi, int);
+extern void test1c (double, fpd);
+extern void test2a (fpi, fpd);
+extern void test2b (fpi, fpd, int);
+extern void test2c (fpi, int, fpd);
+extern void test2d (int, fpi, fpd);
+extern void test2e (fpi, fpd, int, double);
+extern void test2f (fpi, int, fpd, double);
+extern void test2g (fpi, int, double, fpd);
+extern void test2h (double, fpd, fpi, int);
+extern void test2i (double, fpd, int, fpi);
+extern void test2j (int, double, fpi, fpd);
+extern void testva (int, ...);
+
+int f1_val;
+double f2_val;
+
+void f1 (int i) { f1_val = i; }
+void f2 (double x) { f2_val = x; }
+
+void
+checki (int x, int v)
+{
+ if (x != v)
+ DEBUG_CHECK
+}
+
+void
+checkd (double x, double v)
+{
+ if (x != v)
+ DEBUG_CHECK
+}
+
+void
+testit (void)
+{
+ DEBUG_FPUTS ("test1a: ");
+ test1a (f1);
+ checki (f1_val, 1);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test1b: ");
+ test1b (f1, 2);
+ checki (f1_val, 2);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test1c: ");
+ test1c (3.0, f2);
+ checkd (f2_val, 3.0);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2a: ");
+ test2a (f1, f2);
+ checki (f1_val, 10);
+ checkd (f2_val, 10.0);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2b: ");
+ test2b (f1, f2, 11);
+ checki (f1_val, 11);
+ checkd (f2_val, 11.0);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2c: ");
+ test2c (f1, 12, f2);
+ checki (f1_val, 12);
+ checkd (f2_val, 12.0);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2d: ");
+ test2d (13, f1, f2);
+ checki (f1_val, 13);
+ checkd (f2_val, 13.0);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2e: ");
+ test2e (f1, f2, 14, 15.0);
+ checki (f1_val, 14);
+ checkd (f2_val, 15.0);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2f: ");
+ test2f (f1, 16, f2, 17.0);
+ checki (f1_val, 16);
+ checkd (f2_val, 17.0);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2g: ");
+ test2g (f1, 18, 19.0, f2);
+ checki (f1_val, 18);
+ checkd (f2_val, 19.0);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2h: ");
+ test2h (20.0, f2, f1, 21);
+ checkd (f2_val, 20.0);
+ checki (f1_val, 21);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2i: ");
+ test2i (22.0, f2, 23, f1);
+ checkd (f2_val, 22.0);
+ checki (f1_val, 23);
+ DEBUG_NL;
+ DEBUG_FPUTS ("test2j: ");
+ test2j (24, 25.0, f1, f2);
+ checki (f1_val, 24);
+ checkd (f2_val, 25.0);
+ if (test_va)
+ {
+ DEBUG_NL;
+ DEBUG_FPUTS ("testva: ");
+ testva (1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (2, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (3, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (4, f1, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (5, f1, f1, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (6, f1, f1, f1, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (7, f1, f1, f1, f1, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (8, f1, f1, f1, f1, f1, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (9, f1, f1, f1, f1, f1, f1, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (10, f1, f1, f1, f1, f1, f1, f1, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (11, f1, f1, f1, f1, f1, f1, f1, f1, f1, f1, f1);
+ DEBUG_NL;
+ DEBUG_FPUTS (" ");
+ testva (12, f1, f1, f1, f1, f1, f1, f1, f1, f1, f1, f1, f1);
+ }
+ DEBUG_NL;
+}
+
+void
+fnptr_by_value_1_x ()
+{
+ DEBUG_INIT
+ testit ();
+ DEBUG_FINI
+
+ if (fails != 0)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_y.c
new file mode 100644
index 000000000..1f6917cdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fnptr-by-value-1_y.c
@@ -0,0 +1,111 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+typedef void (*fpi)(int);
+typedef void (*fpd)(double);
+
+extern int f1_val;
+extern void checki (int, int);
+
+void
+test1a (fpi f)
+{
+ (*f)(1);
+}
+
+void
+test1b (fpi f, int i)
+{
+ (*f)(i);
+}
+
+void
+test1c (double x, fpd f)
+{
+ (*f)(x);
+}
+
+void
+test2a (fpi f1, fpd f2)
+{
+ (*f1)(10);
+ (*f2)(10.0);
+}
+
+void
+test2b (fpi f1, fpd f2, int i)
+{
+ (*f1)(i);
+ (*f2)((double)i);
+}
+
+void
+test2c (fpi f1, int i, fpd f2)
+{
+ (*f1)(i);
+ (*f2)((double)i);
+}
+
+void
+test2d (int i, fpi f1, fpd f2)
+{
+ (*f1)(i);
+ (*f2)((double)i);
+}
+
+void
+test2e (fpi f1, fpd f2, int i, double x)
+{
+ (*f1)(i);
+ (*f2)(x);
+}
+
+void
+test2f (fpi f1, int i, fpd f2, double x)
+{
+ (*f1)(i);
+ (*f2)(x);
+}
+
+void
+test2g (fpi f1, int i, double x, fpd f2)
+{
+ (*f1)(i);
+ (*f2)(x);
+}
+
+void
+test2h (double x, fpd f1, fpi f2, int i)
+{
+ (*f1)(x);
+ (*f2)(i);
+}
+
+void
+test2i (double x, fpd f1, int i, fpi f2)
+{
+ (*f1)(x);
+ (*f2)(i);
+}
+
+void
+test2j (int i, double x, fpi f1, fpd f2)
+{
+ (*f1)(i);
+ (*f2)(x);
+}
+
+void
+testva (int n, ...)
+{
+ int i;
+ va_list ap;
+ va_start (ap, n);
+ for (i = 0; i < n; i++)
+ {
+ fpi fp = va_arg (ap, fpi);
+ (*fp)(i);
+ checki (f1_val, i);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-check.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-check.h
new file mode 100644
index 000000000..bd3283b6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-check.h
@@ -0,0 +1,71 @@
+/* Function definitions that are used by multiple tests. */
+
+#define CHECKS(NAME,TYPEM) \
+void checkS##NAME##1 (S##NAME##1 x, TYPEM y) \
+{ if (x.a != y) DEBUG_CHECK } \
+void checkS##NAME##2 (S##NAME##2 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 ) DEBUG_CHECK } \
+void checkS##NAME##3 (S##NAME##3 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 ) \
+ DEBUG_CHECK } \
+void checkS##NAME##4 (S##NAME##4 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3) \
+ DEBUG_CHECK } \
+void checkS##NAME##5 (S##NAME##5 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4) DEBUG_CHECK } \
+void checkS##NAME##6 (S##NAME##6 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5) DEBUG_CHECK } \
+void checkS##NAME##7 (S##NAME##7 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6) \
+ DEBUG_CHECK } \
+void checkS##NAME##8 (S##NAME##8 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7) DEBUG_CHECK } \
+void checkS##NAME##9 (S##NAME##9 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7 || x.i != y+8) DEBUG_CHECK } \
+void checkS##NAME##10 (S##NAME##10 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7 || x.i != y+8 || x.j != y+9) \
+ DEBUG_CHECK } \
+void checkS##NAME##11 (S##NAME##11 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7 || x.i != y+8 || x.j != y+9 \
+ || x.k != y+10) DEBUG_CHECK } \
+void checkS##NAME##12 (S##NAME##12 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7 || x.i != y+8 || x.j != y+9 \
+ || x.k != y+10 || x.l != y+11) DEBUG_CHECK } \
+void checkS##NAME##13 (S##NAME##13 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7 || x.i != y+8 || x.j != y+9 \
+ || x.k != y+10 || x.l != y+11 || x.m != y+12) \
+ DEBUG_CHECK } \
+void checkS##NAME##14 (S##NAME##14 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7 || x.i != y+8 || x.j != y+9 \
+ || x.k != y+10 || x.l != y+11 || x.m != y+12 \
+ || x.n != y+13) DEBUG_CHECK } \
+void checkS##NAME##15 (S##NAME##15 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7 || x.i != y+8 || x.j != y+9 \
+ || x.k != y+10 || x.l != y+11 || x.m != y+12 \
+ || x.n != y+13 || x.o != y+14) DEBUG_CHECK } \
+void checkS##NAME##16 (S##NAME##16 x, TYPEM y) \
+{ if (x.a != y || x.b != y+1 || x.c != y+2 || x.d != y+3 \
+ || x.e != y+4 || x.f != y+5 || x.g != y+6 \
+ || x.h != y+7 || x.i != y+8 || x.j != y+9 \
+ || x.k != y+10 || x.l != y+11 || x.m != y+12 \
+ || x.n != y+13 || x.o != y+14 || x.p != y+15) \
+ DEBUG_CHECK }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-defs.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-defs.h
new file mode 100644
index 000000000..67d63f23b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-defs.h
@@ -0,0 +1,43 @@
+/* Type definitions that are used by multiple tests. */
+
+#define DEFS(NAME,TYPEM) \
+typedef struct { TYPEM a; } S##NAME##1; \
+typedef struct { TYPEM a; TYPEM b; } S##NAME##2; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; } S##NAME##3; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; } \
+ S##NAME##4; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; } \
+ S##NAME##5; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; } S##NAME##6; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; } S##NAME##7; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; } S##NAME##8; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; TYPEM i; } \
+ S##NAME##9; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; TYPEM i; TYPEM j; } \
+ S##NAME##10; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; TYPEM i; TYPEM j; \
+ TYPEM k; } S##NAME##11; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; TYPEM i; TYPEM j; \
+ TYPEM k; TYPEM l; } S##NAME##12; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; TYPEM i; TYPEM j; \
+ TYPEM k; TYPEM l; TYPEM m; } S##NAME##13; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; TYPEM i; TYPEM j; \
+ TYPEM k; TYPEM l; TYPEM m; TYPEM n; } \
+ S##NAME##14; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; TYPEM i; TYPEM j; \
+ TYPEM k; TYPEM l; TYPEM m; TYPEM n; TYPEM o; } \
+ S##NAME##15; \
+typedef struct { TYPEM a; TYPEM b; TYPEM c; TYPEM d; TYPEM e; \
+ TYPEM f; TYPEM g; TYPEM h; TYPEM i; TYPEM j; \
+ TYPEM k; TYPEM l; TYPEM m; TYPEM n; TYPEM o; \
+ TYPEM p; } S##NAME##16;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-init.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-init.h
new file mode 100644
index 000000000..46a0cef1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-init.h
@@ -0,0 +1,54 @@
+/* Function definitions that are used by multiple tests. */
+
+#define INITS(NAME,TYPEM) \
+void initS##NAME##1 (S##NAME##1 *p, TYPEM y) \
+{ p->a = y; } \
+void initS##NAME##2 (S##NAME##2 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; } \
+void initS##NAME##3 (S##NAME##3 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; } \
+void initS##NAME##4 (S##NAME##4 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; } \
+void initS##NAME##5 (S##NAME##5 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; } \
+void initS##NAME##6 (S##NAME##6 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; } \
+void initS##NAME##7 (S##NAME##7 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; } \
+void initS##NAME##8 (S##NAME##8 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; } \
+void initS##NAME##9 (S##NAME##9 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; p->i = y+8; } \
+void initS##NAME##10 (S##NAME##10 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; p->i = y+8; p->j = y+9; } \
+void initS##NAME##11 (S##NAME##11 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; p->i = y+8; p->j = y+9; \
+ p->k = y+10; } \
+void initS##NAME##12 (S##NAME##12 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; p->i = y+8; p->j = y+9; \
+ p->k = y+10; p->l = y+11; } \
+void initS##NAME##13 (S##NAME##13 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; p->i = y+8; p->j = y+9; \
+ p->k = y+10; p->l = y+11; p->m = y+12; } \
+void initS##NAME##14 (S##NAME##14 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; p->i = y+8; p->j = y+9; \
+ p->k = y+10; p->l = y+11; p->m = y+12; p->n = y+13; } \
+void initS##NAME##15 (S##NAME##15 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; p->i = y+8; p->j = y+9; \
+ p->k = y+10; p->l = y+11; p->m = y+12; p->n = y+13; \
+ p->o = y+14; } \
+void initS##NAME##16 (S##NAME##16 *p, TYPEM y) \
+{ p->a = y; p->b = y+1; p->c = y+2; p->d = y+3; p->e = y+4; \
+ p->f = y+5; p->g = y+6; p->h = y+7; p->i = y+8; p->j = y+9; \
+ p->k = y+10; p->l = y+11; p->m = y+12; p->n = y+13; \
+ p->o = y+14; p->p = y+15; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-x.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-x.h
new file mode 100644
index 000000000..876f1b355
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-x.h
@@ -0,0 +1,136 @@
+#define TEST(TYPE,MTYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, MTYPE x); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, (MTYPE)1); \
+ init##TYPE ( &g2s##TYPE, (MTYPE)2); \
+ init##TYPE ( &g3s##TYPE, (MTYPE)3); \
+ init##TYPE ( &g4s##TYPE, (MTYPE)4); \
+ init##TYPE ( &g5s##TYPE, (MTYPE)5); \
+ init##TYPE ( &g6s##TYPE, (MTYPE)6); \
+ init##TYPE ( &g7s##TYPE, (MTYPE)7); \
+ init##TYPE ( &g8s##TYPE, (MTYPE)8); \
+ init##TYPE ( &g9s##TYPE, (MTYPE)9); \
+ init##TYPE (&g10s##TYPE, (MTYPE)10); \
+ init##TYPE (&g11s##TYPE, (MTYPE)11); \
+ init##TYPE (&g12s##TYPE, (MTYPE)12); \
+ init##TYPE (&g13s##TYPE, (MTYPE)13); \
+ init##TYPE (&g14s##TYPE, (MTYPE)14); \
+ init##TYPE (&g15s##TYPE, (MTYPE)15); \
+ init##TYPE (&g16s##TYPE, (MTYPE)16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-y.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-y.h
new file mode 100644
index 000000000..49fccdd09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-y.h
@@ -0,0 +1,69 @@
+#define TEST(TYPE,TYPE2) \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void check##TYPE (TYPE x, TYPE2 y); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, (TYPE2)1); \
+ check##TYPE ( g2s##TYPE, (TYPE2)2); \
+ check##TYPE ( g3s##TYPE, (TYPE2)3); \
+ check##TYPE ( g4s##TYPE, (TYPE2)4); \
+ check##TYPE ( g5s##TYPE, (TYPE2)5); \
+ check##TYPE ( g6s##TYPE, (TYPE2)6); \
+ check##TYPE ( g7s##TYPE, (TYPE2)7); \
+ check##TYPE ( g8s##TYPE, (TYPE2)8); \
+ check##TYPE ( g9s##TYPE, (TYPE2)9); \
+ check##TYPE ( g10s##TYPE, (TYPE2)10); \
+ check##TYPE ( g11s##TYPE, (TYPE2)11); \
+ check##TYPE ( g12s##TYPE, (TYPE2)12); \
+ check##TYPE ( g13s##TYPE, (TYPE2)13); \
+ check##TYPE ( g14s##TYPE, (TYPE2)14); \
+ check##TYPE ( g15s##TYPE, (TYPE2)15); \
+ check##TYPE ( g16s##TYPE, (TYPE2)16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, (TYPE2)1); \
+ check##TYPE (s2, (TYPE2)2); \
+ check##TYPE (s3, (TYPE2)3); \
+ check##TYPE (s4, (TYPE2)4); \
+ check##TYPE (s5, (TYPE2)5); \
+ check##TYPE (s6, (TYPE2)6); \
+ check##TYPE (s7, (TYPE2)7); \
+ check##TYPE (s8, (TYPE2)8); \
+ check##TYPE (s9, (TYPE2)9); \
+ check##TYPE (s10, (TYPE2)10); \
+ check##TYPE (s11, (TYPE2)11); \
+ check##TYPE (s12, (TYPE2)12); \
+ check##TYPE (s13, (TYPE2)13); \
+ check##TYPE (s14, (TYPE2)14); \
+ check##TYPE (s15, (TYPE2)15); \
+ check##TYPE (s16, (TYPE2)16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, (TYPE2)i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-check.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-check.h
new file mode 100644
index 000000000..c00f70547
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-check.h
@@ -0,0 +1,27 @@
+/* Function definitions that are used by multiple tests. */
+
+void checkSfd (Sfd x, double y)
+{ if (x.f != y || x.d != y+1) DEBUG_CHECK }
+void checkSfl (Sfl x, double y)
+{ if (x.f != y || x.l != y+1) DEBUG_CHECK }
+void checkSdf (Sdf x, double y)
+{ if (x.d != y || x.f != y+1) DEBUG_CHECK }
+void checkSdl (Sdl x, double y)
+{ if (x.d != y || x.l != y+1) DEBUG_CHECK }
+void checkSlf (Slf x, double y)
+{ if (x.l != y || x.f != y+1) DEBUG_CHECK }
+void checkSld (Sld x, double y)
+{ if (x.l != y || x.d != y+1) DEBUG_CHECK }
+
+void checkSfdl (Sfdl x, double y)
+{ if (x.f != y || x.d != y+1 || x.l != y+2) DEBUG_CHECK }
+void checkSfld (Sfld x, double y)
+{ if (x.f != y || x.l != y+1 || x.d != y+2) DEBUG_CHECK }
+void checkSdfl (Sdfl x, double y)
+{ if (x.d != y || x.f != y+1 || x.l != y+2) DEBUG_CHECK }
+void checkSdlf (Sdlf x, double y)
+{ if (x.d != y || x.l != y+1 || x.f != y+2) DEBUG_CHECK }
+void checkSlfd (Slfd x, double y)
+{ if (x.l != y || x.f != y+1 || x.d != y+2) DEBUG_CHECK }
+void checkSldf (Sldf x, double y)
+{ if (x.l != y || x.d != y+1 || x.f != y+2) DEBUG_CHECK }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-defs.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-defs.h
new file mode 100644
index 000000000..be387a70a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-defs.h
@@ -0,0 +1,15 @@
+/* Type definitions that are used by multiple tests. */
+
+typedef struct { float f; double d; } Sfd;
+typedef struct { float f; long double l; } Sfl;
+typedef struct { double d; float f; } Sdf;
+typedef struct { double d; long double l; } Sdl;
+typedef struct { long double l; float f; } Slf;
+typedef struct { long double l; double d; } Sld;
+
+typedef struct { float f; double d; long double l; } Sfdl;
+typedef struct { float f; long double l; double d; } Sfld;
+typedef struct { double d; float f; long double l; } Sdfl;
+typedef struct { double d; long double l; float f; } Sdlf;
+typedef struct { long double l; float f; double d; } Slfd;
+typedef struct { long double l; double d; float f; } Sldf;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-init.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-init.h
new file mode 100644
index 000000000..35fe77e00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/fp2-struct-init.h
@@ -0,0 +1,27 @@
+/* Function definitions that are used by multiple tests. */
+
+void initSfd (Sfd *p, double y)
+{ p->f = y; p->d = y+1; }
+void initSfl (Sfl *p, double y)
+{ p->f = y; p->l = y+1; }
+void initSdf (Sdf *p, double y)
+{ p->d = y; p->f = y+1; }
+void initSdl (Sdl *p, double y)
+{ p->d = y; p->l = y+1; }
+void initSlf (Slf *p, double y)
+{ p->l = y; p->f = y+1; }
+void initSld (Sld *p, double y)
+{ p->l = y; p->d = y+1; }
+
+void initSfdl (Sfdl *p, double y)
+{ p->f = y; p->d = y+1; p->l = y+2; }
+void initSfld (Sfld *p, double y)
+{ p->f = y; p->l = y+1; p->d = y+2; }
+void initSdfl (Sdfl *p, double y)
+{ p->d = y; p->f = y+1; p->l = y+2; }
+void initSdlf (Sdlf *p, double y)
+{ p->d = y; p->l = y+1; p->f = y+2; }
+void initSlfd (Slfd *p, double y)
+{ p->l = y; p->f = y+1; p->d = y+2; }
+void initSldf (Sldf *p, double y)
+{ p->l = y; p->d = y+1; p->f = y+2; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random.c
new file mode 100644
index 000000000..c4b06db67
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random.c
@@ -0,0 +1,265 @@
+/* Copyright (C) 1995, 2004 Free Software Foundation
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA. */
+
+/*
+ * This is derived from the Berkeley source:
+ * @(#)random.c 5.5 (Berkeley) 7/6/88
+ * It was reworked for the GNU C Library by Roland McGrath.
+ * Rewritten to use reentrant functions by Ulrich Drepper, 1995.
+ */
+
+/*
+ Copyright (C) 1983 Regents of the University of California.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.*/
+
+#include <limits.h>
+#include <stdlib.h>
+#include "generate-random.h"
+
+
+/* An improved random number generation package. In addition to the standard
+ rand()/srand() like interface, this package also has a special state info
+ interface. The initstate() routine is called with a seed, an array of
+ bytes, and a count of how many bytes are being passed in; this array is
+ then initialized to contain information for random number generation with
+ that much state information. Good sizes for the amount of state
+ information are 32, 64, 128, and 256 bytes. The state can be switched by
+ calling the setstate() function with the same array as was initialized
+ with initstate(). By default, the package runs with 128 bytes of state
+ information and generates far better random numbers than a linear
+ congruential generator. If the amount of state information is less than
+ 32 bytes, a simple linear congruential R.N.G. is used. Internally, the
+ state information is treated as an array of longs; the zeroth element of
+ the array is the type of R.N.G. being used (small integer); the remainder
+ of the array is the state information for the R.N.G. Thus, 32 bytes of
+ state information will give 7 longs worth of state information, which will
+ allow a degree seven polynomial. (Note: The zeroth word of state
+ information also has some other information stored in it; see setstate
+ for details). The random number generation technique is a linear feedback
+ shift register approach, employing trinomials (since there are fewer terms
+ to sum up that way). In this approach, the least significant bit of all
+ the numbers in the state table will act as a linear feedback shift register,
+ and will have period 2^deg - 1 (where deg is the degree of the polynomial
+ being used, assuming that the polynomial is irreducible and primitive).
+ The higher order bits will have longer periods, since their values are
+ also influenced by pseudo-random carries out of the lower bits. The
+ total period of the generator is approximately deg*(2**deg - 1); thus
+ doubling the amount of state information has a vast influence on the
+ period of the generator. Note: The deg*(2**deg - 1) is an approximation
+ only good for large deg, when the period of the shift register is the
+ dominant factor. With deg equal to seven, the period is actually much
+ longer than the 7*(2**7 - 1) predicted by this formula. */
+
+
+
+/* For each of the currently supported random number generators, we have a
+ break value on the amount of state information (you need at least this many
+ bytes of state info to support this random number generator), a degree for
+ the polynomial (actually a trinomial) that the R.N.G. is based on, and
+ separation between the two lower order coefficients of the trinomial. */
+
+/* Linear congruential. */
+#define TYPE_0 0
+#define BREAK_0 8
+#define DEG_0 0
+#define SEP_0 0
+
+/* x**7 + x**3 + 1. */
+#define TYPE_1 1
+#define BREAK_1 32
+#define DEG_1 7
+#define SEP_1 3
+
+/* x**15 + x + 1. */
+#define TYPE_2 2
+#define BREAK_2 64
+#define DEG_2 15
+#define SEP_2 1
+
+/* x**31 + x**3 + 1. */
+#define TYPE_3 3
+#define BREAK_3 128
+#define DEG_3 31
+#define SEP_3 3
+
+/* x**63 + x + 1. */
+#define TYPE_4 4
+#define BREAK_4 256
+#define DEG_4 63
+#define SEP_4 1
+
+
+/* Array versions of the above information to make code run faster.
+ Relies on fact that TYPE_i == i. */
+
+#define MAX_TYPES 5 /* Max number of types above. */
+
+
+/* Initially, everything is set up as if from:
+ initstate(1, randtbl, 128);
+ Note that this initialization takes advantage of the fact that srandom
+ advances the front and rear pointers 10*rand_deg times, and hence the
+ rear pointer which starts at 0 will also end up at zero; thus the zeroth
+ element of the state information, which contains info about the current
+ position of the rear pointer is just
+ (MAX_TYPES * (rptr - state)) + TYPE_3 == TYPE_3. */
+
+static int randtbl[DEG_3 + 1] =
+ {
+ TYPE_3,
+
+ -1726662223, 379960547, 1735697613, 1040273694, 1313901226,
+ 1627687941, -179304937, -2073333483, 1780058412, -1989503057,
+ -615974602, 344556628, 939512070, -1249116260, 1507946756,
+ -812545463, 154635395, 1388815473, -1926676823, 525320961,
+ -1009028674, 968117788, -123449607, 1284210865, 435012392,
+ -2017506339, -911064859, -370259173, 1132637927, 1398500161,
+ -205601318,
+ };
+
+
+static struct generate_random_data unsafe_state =
+ {
+/* FPTR and RPTR are two pointers into the state info, a front and a rear
+ pointer. These two pointers are always rand_sep places aparts, as they
+ cycle through the state information. (Yes, this does mean we could get
+ away with just one pointer, but the code for random is more efficient
+ this way). The pointers are left positioned as they would be from the call:
+ initstate(1, randtbl, 128);
+ (The position of the rear pointer, rptr, is really 0 (as explained above
+ in the initialization of randtbl) because the state table pointer is set
+ to point to randtbl[1] (as explained below).) */
+
+ &randtbl[SEP_3 + 1], /* fptr */
+ &randtbl[1], /* rptr */
+
+/* The following things are the pointer to the state information table,
+ the type of the current generator, the degree of the current polynomial
+ being used, and the separation between the two pointers.
+ Note that for efficiency of random, we remember the first location of
+ the state information, not the zeroth. Hence it is valid to access
+ state[-1], which is used to store the type of the R.N.G.
+ Also, we remember the last location, since this is more efficient than
+ indexing every time to find the address of the last element to see if
+ the front and rear pointers have wrapped. */
+
+ &randtbl[1], /* state */
+
+ TYPE_3, /* rand_type */
+ DEG_3, /* rand_deg */
+ SEP_3, /* rand_sep */
+
+ &randtbl[sizeof (randtbl) / sizeof (randtbl[0])] /* end_ptr */
+};
+
+/* Initialize the random number generator based on the given seed. If the
+ type is the trivial no-state-information type, just remember the seed.
+ Otherwise, initializes state[] based on the given "seed" via a linear
+ congruential generator. Then, the pointers are set to known locations
+ that are exactly rand_sep places apart. Lastly, it cycles the state
+ information a given number of times to get rid of any initial dependencies
+ introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
+ for default usage relies on values produced by this routine. */
+void
+generate_srandom (unsigned int x)
+{
+ (void) generate_srandom_r (x, &unsafe_state);
+}
+
+/* Initialize the state information in the given array of N bytes for
+ future random number generation. Based on the number of bytes we
+ are given, and the break values for the different R.N.G.'s, we choose
+ the best (largest) one we can and set things up for it. srandom is
+ then called to initialize the state information. Note that on return
+ from srandom, we set state[-1] to be the type multiplexed with the current
+ value of the rear pointer; this is so successive calls to initstate won't
+ lose this information and will be able to restart with setstate.
+ Note: The first thing we do is save the current state, if any, just like
+ setstate so that it doesn't matter when initstate is called.
+ Returns a pointer to the old state. */
+char *
+generate_initstate (unsigned int seed, char *arg_state, size_t n)
+{
+ int *ostate;
+
+ ostate = &unsafe_state.state[-1];
+ generate_initstate_r (seed, arg_state, n, &unsafe_state);
+ return (char *) ostate;
+}
+
+/* Restore the state from the given state array.
+ Note: It is important that we also remember the locations of the pointers
+ in the current state information, and restore the locations of the pointers
+ from the old state information. This is done by multiplexing the pointer
+ location into the zeroth word of the state information. Note that due
+ to the order in which things are done, it is OK to call setstate with the
+ same state as the current state
+ Returns a pointer to the old state information. */
+char *
+generate_setstate (char *arg_state)
+{
+ int *ostate;
+
+ ostate = &unsafe_state.state[-1];
+ if (generate_setstate_r (arg_state, &unsafe_state) < 0)
+ ostate = NULL;
+ return (char *) ostate;
+}
+
+/* If we are using the trivial TYPE_0 R.N.G., just do the old linear
+ congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
+ same in all the other cases due to all the global variables that have been
+ set up. The basic operation is to add the number at the rear pointer into
+ the one at the front pointer. Then both pointers are advanced to the next
+ location cyclically in the table. The value returned is the sum generated,
+ reduced to 31 bits by throwing away the "least random" low bit.
+ Note: The code takes advantage of the fact that both the front and
+ rear pointers can't wrap on the same call by not testing the rear
+ pointer if the front one has wrapped. Returns a 31-bit random number. */
+
+long int
+generate_random (void)
+{
+ int retval;
+ (void) generate_random_r (&unsafe_state, &retval);
+ return retval;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random.h
new file mode 100644
index 000000000..e14f526bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2004 Free Software Foundation
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA. */
+
+struct generate_random_data
+ {
+ int *fptr, *rptr, *state;
+ int rand_type, rand_deg, rand_sep;
+ int *end_ptr;
+ };
+
+extern void generate_srandom (unsigned int);
+extern char *generate_initstate (unsigned int, char *, size_t);
+extern char *generate_setstate (char *);
+extern long int generate_random (void);
+extern int generate_random_r (struct generate_random_data *, int *);
+extern int generate_srandom_r (unsigned int, struct generate_random_data *);
+extern int generate_initstate_r (unsigned int, char *, size_t,
+ struct generate_random_data *);
+extern int generate_setstate_r (char *, struct generate_random_data *);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random_r.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random_r.c
new file mode 100644
index 000000000..6e83f3596
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/generate-random_r.c
@@ -0,0 +1,385 @@
+/*
+ Copyright (C) 1995, 2004 Free Software Foundation
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA. */
+
+/*
+ Copyright (C) 1983 Regents of the University of California.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 4. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.*/
+
+/*
+ * This is derived from the Berkeley source:
+ * @(#)random.c 5.5 (Berkeley) 7/6/88
+ * It was reworked for the GNU C Library by Roland McGrath.
+ * Rewritten to be reentrant by Ulrich Drepper, 1995
+ */
+
+#include <limits.h>
+#include <stdlib.h>
+#include "generate-random.h"
+
+
+/* An improved random number generation package. In addition to the standard
+ rand()/srand() like interface, this package also has a special state info
+ interface. The initstate() routine is called with a seed, an array of
+ bytes, and a count of how many bytes are being passed in; this array is
+ then initialized to contain information for random number generation with
+ that much state information. Good sizes for the amount of state
+ information are 32, 64, 128, and 256 bytes. The state can be switched by
+ calling the setstate() function with the same array as was initialized
+ with initstate(). By default, the package runs with 128 bytes of state
+ information and generates far better random numbers than a linear
+ congruential generator. If the amount of state information is less than
+ 32 bytes, a simple linear congruential R.N.G. is used. Internally, the
+ state information is treated as an array of longs; the zeroth element of
+ the array is the type of R.N.G. being used (small integer); the remainder
+ of the array is the state information for the R.N.G. Thus, 32 bytes of
+ state information will give 7 longs worth of state information, which will
+ allow a degree seven polynomial. (Note: The zeroth word of state
+ information also has some other information stored in it; see setstate
+ for details). The random number generation technique is a linear feedback
+ shift register approach, employing trinomials (since there are fewer terms
+ to sum up that way). In this approach, the least significant bit of all
+ the numbers in the state table will act as a linear feedback shift register,
+ and will have period 2^deg - 1 (where deg is the degree of the polynomial
+ being used, assuming that the polynomial is irreducible and primitive).
+ The higher order bits will have longer periods, since their values are
+ also influenced by pseudo-random carries out of the lower bits. The
+ total period of the generator is approximately deg*(2**deg - 1); thus
+ doubling the amount of state information has a vast influence on the
+ period of the generator. Note: The deg*(2**deg - 1) is an approximation
+ only good for large deg, when the period of the shift register is the
+ dominant factor. With deg equal to seven, the period is actually much
+ longer than the 7*(2**7 - 1) predicted by this formula. */
+
+
+
+/* For each of the currently supported random number generators, we have a
+ break value on the amount of state information (you need at least this many
+ bytes of state info to support this random number generator), a degree for
+ the polynomial (actually a trinomial) that the R.N.G. is based on, and
+ separation between the two lower order coefficients of the trinomial. */
+
+/* Linear congruential. */
+#define TYPE_0 0
+#define BREAK_0 8
+#define DEG_0 0
+#define SEP_0 0
+
+/* x**7 + x**3 + 1. */
+#define TYPE_1 1
+#define BREAK_1 32
+#define DEG_1 7
+#define SEP_1 3
+
+/* x**15 + x + 1. */
+#define TYPE_2 2
+#define BREAK_2 64
+#define DEG_2 15
+#define SEP_2 1
+
+/* x**31 + x**3 + 1. */
+#define TYPE_3 3
+#define BREAK_3 128
+#define DEG_3 31
+#define SEP_3 3
+
+/* x**63 + x + 1. */
+#define TYPE_4 4
+#define BREAK_4 256
+#define DEG_4 63
+#define SEP_4 1
+
+
+/* Array versions of the above information to make code run faster.
+ Relies on fact that TYPE_i == i. */
+
+#define MAX_TYPES 5 /* Max number of types above. */
+
+struct random_poly_info
+{
+ int seps[MAX_TYPES];
+ int degrees[MAX_TYPES];
+};
+
+static const struct random_poly_info random_poly_info =
+{
+ { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 },
+ { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }
+};
+
+
+
+
+/* Initialize the random number generator based on the given seed. If the
+ type is the trivial no-state-information type, just remember the seed.
+ Otherwise, initializes state[] based on the given "seed" via a linear
+ congruential generator. Then, the pointers are set to known locations
+ that are exactly rand_sep places apart. Lastly, it cycles the state
+ information a given number of times to get rid of any initial dependencies
+ introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
+ for default usage relies on values produced by this routine. */
+int
+generate_srandom_r (unsigned int seed, struct generate_random_data *buf)
+{
+ int type;
+ int *state;
+ long int i;
+ long int word;
+ int *dst;
+ int kc;
+
+ if (buf == NULL)
+ goto fail;
+ type = buf->rand_type;
+ if ((unsigned int) type >= MAX_TYPES)
+ goto fail;
+
+ state = buf->state;
+ /* We must make sure the seed is not 0. Take arbitrarily 1 in this case. */
+ if (seed == 0)
+ seed = 1;
+ state[0] = seed;
+ if (type == TYPE_0)
+ goto done;
+
+ dst = state;
+ word = seed;
+ kc = buf->rand_deg;
+ for (i = 1; i < kc; ++i)
+ {
+ /* This does:
+ state[i] = (16807 * state[i - 1]) % 2147483647;
+ but avoids overflowing 31 bits. */
+ long int hi = word / 127773;
+ long int lo = word % 127773;
+ word = 16807 * lo - 2836 * hi;
+ if (word < 0)
+ word += 2147483647;
+ *++dst = word;
+ }
+
+ buf->fptr = &state[buf->rand_sep];
+ buf->rptr = &state[0];
+ kc *= 10;
+ while (--kc >= 0)
+ {
+ int discard;
+ (void) generate_random_r (buf, &discard);
+ }
+
+ done:
+ return 0;
+
+ fail:
+ return -1;
+}
+
+/* Initialize the state information in the given array of N bytes for
+ future random number generation. Based on the number of bytes we
+ are given, and the break values for the different R.N.G.'s, we choose
+ the best (largest) one we can and set things up for it. srandom is
+ then called to initialize the state information. Note that on return
+ from srandom, we set state[-1] to be the type multiplexed with the current
+ value of the rear pointer; this is so successive calls to initstate won't
+ lose this information and will be able to restart with setstate.
+ Note: The first thing we do is save the current state, if any, just like
+ setstate so that it doesn't matter when initstate is called.
+ Returns a pointer to the old state. */
+int
+generate_initstate_r (unsigned int seed, char *arg_state, size_t n,
+ struct generate_random_data *buf)
+{
+ int type;
+ int degree;
+ int separation;
+ int *state;
+
+ if (buf == NULL)
+ goto fail;
+
+ if (n >= BREAK_3)
+ type = n < BREAK_4 ? TYPE_3 : TYPE_4;
+ else if (n < BREAK_1)
+ {
+ if (n < BREAK_0)
+ {
+ goto fail;
+ }
+ type = TYPE_0;
+ }
+ else
+ type = n < BREAK_2 ? TYPE_1 : TYPE_2;
+
+ degree = random_poly_info.degrees[type];
+ separation = random_poly_info.seps[type];
+
+ buf->rand_type = type;
+ buf->rand_sep = separation;
+ buf->rand_deg = degree;
+ state = &((int *) arg_state)[1]; /* First location. */
+ /* Must set END_PTR before srandom. */
+ buf->end_ptr = &state[degree];
+
+ buf->state = state;
+
+ generate_srandom_r (seed, buf);
+
+ state[-1] = TYPE_0;
+ if (type != TYPE_0)
+ state[-1] = (buf->rptr - state) * MAX_TYPES + type;
+
+ return 0;
+
+ fail:
+ return -1;
+}
+
+/* Restore the state from the given state array.
+ Note: It is important that we also remember the locations of the pointers
+ in the current state information, and restore the locations of the pointers
+ from the old state information. This is done by multiplexing the pointer
+ location into the zeroth word of the state information. Note that due
+ to the order in which things are done, it is OK to call setstate with the
+ same state as the current state
+ Returns a pointer to the old state information. */
+int
+generate_setstate_r (char *arg_state, struct generate_random_data *buf)
+{
+ int *new_state = 1 + (int *) arg_state;
+ int type;
+ int old_type;
+ int *old_state;
+ int degree;
+ int separation;
+
+ if (arg_state == NULL || buf == NULL)
+ goto fail;
+
+ old_type = buf->rand_type;
+ old_state = buf->state;
+ if (old_type == TYPE_0)
+ old_state[-1] = TYPE_0;
+ else
+ old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
+
+ type = new_state[-1] % MAX_TYPES;
+ if (type < TYPE_0 || type > TYPE_4)
+ goto fail;
+
+ buf->rand_deg = degree = random_poly_info.degrees[type];
+ buf->rand_sep = separation = random_poly_info.seps[type];
+ buf->rand_type = type;
+
+ if (type != TYPE_0)
+ {
+ int rear = new_state[-1] / MAX_TYPES;
+ buf->rptr = &new_state[rear];
+ buf->fptr = &new_state[(rear + separation) % degree];
+ }
+ buf->state = new_state;
+ /* Set end_ptr too. */
+ buf->end_ptr = &new_state[degree];
+
+ return 0;
+
+ fail:
+ return -1;
+}
+
+/* If we are using the trivial TYPE_0 R.N.G., just do the old linear
+ congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
+ same in all the other cases due to all the global variables that have been
+ set up. The basic operation is to add the number at the rear pointer into
+ the one at the front pointer. Then both pointers are advanced to the next
+ location cyclically in the table. The value returned is the sum generated,
+ reduced to 31 bits by throwing away the "least random" low bit.
+ Note: The code takes advantage of the fact that both the front and
+ rear pointers can't wrap on the same call by not testing the rear
+ pointer if the front one has wrapped. Returns a 31-bit random number. */
+
+int
+generate_random_r (struct generate_random_data *buf, int *result)
+{
+ int *state;
+
+ if (buf == NULL || result == NULL)
+ goto fail;
+
+ state = buf->state;
+
+ if (buf->rand_type == TYPE_0)
+ {
+ int val = state[0];
+ val = ((state[0] * 1103515245) + 12345) & 0x7fffffff;
+ state[0] = val;
+ *result = val;
+ }
+ else
+ {
+ int *fptr = buf->fptr;
+ int *rptr = buf->rptr;
+ int *end_ptr = buf->end_ptr;
+ int val;
+
+ val = *fptr += *rptr;
+ /* Chucking least random bit. */
+ *result = (val >> 1) & 0x7fffffff;
+ ++fptr;
+ if (fptr >= end_ptr)
+ {
+ fptr = state;
+ ++rptr;
+ }
+ else
+ {
+ ++rptr;
+ if (rptr >= end_ptr)
+ rptr = state;
+ }
+ buf->fptr = fptr;
+ buf->rptr = rptr;
+ }
+ return 0;
+
+ fail:
+ return -1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-check.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-check.h
new file mode 100644
index 000000000..248ffb215
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-check.h
@@ -0,0 +1,37 @@
+/* Function definitions that are used by multiple tests. */
+
+void checkScd (Scd x, int i)
+{ if (x.c != (char)i || x.d != (double)i+1) DEBUG_CHECK }
+void checkScdc (Scdc x, int i)
+{ if (x.c != (char)i || x.d != (double)i+1 || x.b != (char)i+2) DEBUG_CHECK }
+void checkSd (Sd x, int i)
+{ if (x.d != (double)i) DEBUG_CHECK }
+void checkSdi (Sdi x, int i)
+{ if (x.d != (double)i || x.i != i+1) DEBUG_CHECK }
+void checkScsds (Scsds x, int i)
+{ if (x.c != (char)i || x.sd.d != (double)i+1) DEBUG_CHECK }
+void checkScsdsc (Scsdsc x, int i)
+{ if (x.c != (char)i || x.sd.d != (double)i+1 || x.b != (char)i+2) DEBUG_CHECK }
+void checkScsdis (Scsdis x, int i)
+{ if (x.c != (char)i || x.sdi.d != (double)i+1 || x.sdi.i != i+2) DEBUG_CHECK }
+void checkScsdisc (Scsdisc x, int i)
+{ if (x.c != (char)i || x.sdi.d != (double)i+1 || x.sdi.i != i+2
+ || x.b != (char)i+3) DEBUG_CHECK }
+void checkSsds (Ssds x, int i)
+{ if (x.sd.d != (double)i) DEBUG_CHECK }
+void checkSsdsc (Ssdsc x, int i)
+{ if (x.sd.d != (double)i || x.c != (char)i+1) DEBUG_CHECK }
+void checkScssdss (Scssdss x, int i)
+{ if (x.c != (char)i || x.ssds.sd.d != (double)i+1) DEBUG_CHECK }
+void checkScssdssc (Scssdssc x, int i)
+{ if (x.c != (char)i || x.ssds.sd.d != (double)i+1
+ || x.b != (char)i+2) DEBUG_CHECK }
+
+void checkSfi (Sfi x, int i)
+{ if (x.f != (float)i || x.i != i+1) DEBUG_CHECK }
+void checkSfii (Sfii x, int i)
+{ if (x.f != (float)i || x.i1 != i+1 || x.i2 != i+2) DEBUG_CHECK }
+void checkSfifi (Sfifi x, int i)
+{ if (x.fi.f != (float)i || x.fi.i != i+1) DEBUG_CHECK }
+void checkSfiifii (Sfiifii x, int i)
+{ if (x.fii.f != (float)i || x.fii.i1 != i+1 || x.fii.i2 != i+2) DEBUG_CHECK }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-defs.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-defs.h
new file mode 100644
index 000000000..9a313790f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-defs.h
@@ -0,0 +1,19 @@
+/* Type definitions that are used by multiple tests. */
+
+typedef struct { char c; double d; } Scd;
+typedef struct { char c; double d; char b; } Scdc;
+typedef struct { double d; } Sd;
+typedef struct { double d; int i; } Sdi;
+typedef struct { char c; Sd sd; } Scsds;
+typedef struct { char c; Sd sd; char b; } Scsdsc;
+typedef struct { char c; Sdi sdi; } Scsdis;
+typedef struct { char c; Sdi sdi; char b; } Scsdisc;
+typedef struct { Sd sd; } Ssds;
+typedef struct { Sd sd; char c; } Ssdsc;
+typedef struct { char c; Ssds ssds; } Scssdss;
+typedef struct { char c; Ssds ssds; char b; } Scssdssc;
+
+typedef struct { float f; int i; } Sfi;
+typedef struct { float f; int i1; int i2; } Sfii;
+typedef struct { float f; int i; Sfi fi; } Sfifi;
+typedef struct { float f; int i1; int i2; Sfii fii; } Sfiifii;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-init.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-init.h
new file mode 100644
index 000000000..b11fc2404
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/mixed-struct-init.h
@@ -0,0 +1,35 @@
+/* Function definitions that are used by multiple tests. */
+
+void initScd (Scd *p, int i)
+{ p->c = (char)i; p->d = (double)i+1; }
+void initScdc (Scdc *p, int i)
+{ p->c = (char)i; p->d = (double)i+1; p->b = (char)i+2; }
+void initSd (Sd *p, int i)
+{ p->d = (double)i; }
+void initSdi (Sdi *p, int i)
+{ p->d = (double)i; p->i = i+1; }
+void initScsds (Scsds *p, int i)
+{ p->c = (char)i; p->sd.d = (double)i+1; }
+void initScsdsc (Scsdsc *p, int i)
+{ p->c = (char)i; p->sd.d = (double)i+1; p->b = (char)i+2; }
+void initScsdis (Scsdis *p, int i)
+{ p->c = (char)i; p->sdi.d = (double)i+1; p->sdi.i = i+2; }
+void initScsdisc (Scsdisc *p, int i)
+{ p->c = (char)i; p->sdi.d = (double)i+1; p->sdi.i = i+2; p->b = (char)i+3; }
+void initSsds (Ssds *p, int i)
+{ p->sd.d = (double)i; }
+void initSsdsc (Ssdsc *p, int i)
+{ p->sd.d = (double)i; p->c = (char)i+1; }
+void initScssdss (Scssdss *p, int i)
+{ p->c = (char)i; p->ssds.sd.d = (double)i+1; }
+void initScssdssc (Scssdssc *p, int i)
+{ p->c = (char)i; p->ssds.sd.d = (double)i+1; p->b = (char)i+2; }
+
+void initSfi (Sfi *x, int i)
+{ x->f = (float)i; x->i = i+1; }
+void initSfii (Sfii *x, int i)
+{ x->f = (float)i; x->i1 = i+1; x->i2 = i+2; }
+void initSfifi (Sfifi *x, int i)
+{ x->fi.f = (float)i; x->fi.i = i+1; }
+void initSfiifii (Sfiifii *x, int i)
+{ x->fii.f = (float)i; x->fii.i1 = i+1; x->fii.i2 = i+2; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_main.c
new file mode 100644
index 000000000..8f221083c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_main.c
@@ -0,0 +1,18 @@
+/* PR target/38736 */
+/* { dg-skip-if "attribute ((aligned))" { ! { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target avx_runtime } */
+
+/* Test compatibility of attribute ((aligned)) with and without -mavx. */
+
+extern int aligned_x (void);
+extern int aligned_y_avx (void);
+extern void abort (void);
+
+int
+main ()
+{
+ if (aligned_x () != aligned_y_avx ())
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_x.c
new file mode 100644
index 000000000..aeab257aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_x.c
@@ -0,0 +1,15 @@
+/* PR target/38736 */
+/* { dg-options "-O2" } */
+
+struct alignment_test_struct
+{
+ char space[4] __attribute__((__aligned__));
+};
+
+extern int aligned_x (void);
+
+int
+aligned_x (void)
+{
+ return __alignof__(struct alignment_test_struct);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_y.c
new file mode 100644
index 000000000..7e46afa8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/pr38736_y.c
@@ -0,0 +1,6 @@
+/* PR target/38736 */
+/* { dg-options "-O2 -mavx" } */
+
+#define aligned_x aligned_y_avx
+
+#include "pr38736_x.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_main.c
new file mode 100644
index 000000000..5272a379f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_main.c
@@ -0,0 +1,13 @@
+/* Test passing scalars by value. This test includes scalar types that
+ are supported by va_arg. */
+
+extern void scalar_by_value_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_by_value_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c
new file mode 100644
index 000000000..3bfa76644
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_x.c
@@ -0,0 +1,180 @@
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16); \
+extern void testva##NAME (int n, ...); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v + INITVAL) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+test2_##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08) \
+{ \
+ test##NAME (x01, g02##NAME, x02, g04##NAME, \
+ x03, g06##NAME, x04, g08##NAME, \
+ x05, g10##NAME, x06, g12##NAME, \
+ x07, g14##NAME, x08, g16##NAME); \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test: "); \
+ test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, g16##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##NAME (1, \
+ g01##NAME); \
+ DEBUG_NL; \
+ testva##NAME (2, \
+ g01##NAME, g02##NAME); \
+ DEBUG_NL; \
+ testva##NAME (3, \
+ g01##NAME, g02##NAME, g03##NAME); \
+ DEBUG_NL; \
+ testva##NAME (4, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME); \
+ DEBUG_NL; \
+ testva##NAME (5, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME); \
+ DEBUG_NL; \
+ testva##NAME (6, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME); \
+ DEBUG_NL; \
+ testva##NAME (7, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME); \
+ DEBUG_NL; \
+ testva##NAME (8, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME); \
+ DEBUG_NL; \
+ testva##NAME (9, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME); \
+ DEBUG_NL; \
+ testva##NAME (10, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME); \
+ DEBUG_NL; \
+ testva##NAME (11, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME); \
+ DEBUG_NL; \
+ testva##NAME (12, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME); \
+ DEBUG_NL; \
+ testva##NAME (13, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME); \
+ DEBUG_NL; \
+ testva##NAME (14, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME); \
+ DEBUG_NL; \
+ testva##NAME (15, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME); \
+ DEBUG_NL; \
+ testva##NAME (16, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, g16##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME, \
+ g09##NAME, g11##NAME, g13##NAME, g15##NAME); \
+ DEBUG_NL; \
+}
+
+T(ui, unsigned int, 51)
+T(si, int, (-55))
+T(ul, unsigned long, 61)
+T(sl, long, (-66))
+T(ull, unsigned long long, 71)
+T(sll, long long, (-77))
+T(d, double, 91.0)
+T(ld, long double, 92.0)
+
+#undef T
+
+void
+scalar_by_value_1_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+T(ui)
+T(si)
+T(ul)
+T(sl)
+T(ull)
+T(sll)
+T(d)
+T(ld)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_y.c
new file mode 100644
index 000000000..73f3de0e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-1_y.c
@@ -0,0 +1,94 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1); \
+ check##NAME (g02##NAME, 2); \
+ check##NAME (g03##NAME, 3); \
+ check##NAME (g04##NAME, 4); \
+ check##NAME (g05##NAME, 5); \
+ check##NAME (g06##NAME, 6); \
+ check##NAME (g07##NAME, 7); \
+ check##NAME (g08##NAME, 8); \
+ check##NAME (g09##NAME, 9); \
+ check##NAME (g10##NAME, 10); \
+ check##NAME (g11##NAME, 11); \
+ check##NAME (g12##NAME, 12); \
+ check##NAME (g13##NAME, 13); \
+ check##NAME (g14##NAME, 14); \
+ check##NAME (g15##NAME, 15); \
+ check##NAME (g16##NAME, 16); \
+} \
+ \
+void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16) \
+{ \
+ check##NAME (x01, 1); \
+ check##NAME (x02, 2); \
+ check##NAME (x03, 3); \
+ check##NAME (x04, 4); \
+ check##NAME (x05, 5); \
+ check##NAME (x06, 6); \
+ check##NAME (x07, 7); \
+ check##NAME (x08, 8); \
+ check##NAME (x09, 9); \
+ check##NAME (x10, 10); \
+ check##NAME (x11, 11); \
+ check##NAME (x12, 12); \
+ check##NAME (x13, 13); \
+ check##NAME (x14, 14); \
+ check##NAME (x15, 15); \
+ check##NAME (x16, 16); \
+} \
+ \
+void \
+testva##NAME (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##NAME (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(ui, unsigned int, 51)
+T(si, int, (-55))
+T(ul, unsigned long, 61)
+T(sl, long, (-66))
+T(ull, unsigned long long, 71)
+T(sll, long long, (-77))
+T(d, double, 91.0)
+T(ld, long double, 92.0)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_main.c
new file mode 100644
index 000000000..8426b7894
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_main.c
@@ -0,0 +1,15 @@
+/* Test passing scalars by value. This test includes scalar types that
+ are not supported by va_arg; since they require casts to pass to a
+ function with a variable argument list, testing them with variable
+ arguments is not interesting. */
+
+extern void scalar_by_value_2_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_by_value_2_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c
new file mode 100644
index 000000000..48ea1d997
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_x.c
@@ -0,0 +1,100 @@
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v + INITVAL) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+test2_##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08) \
+{ \
+ test##NAME (x01, g02##NAME, x02, g04##NAME, \
+ x03, g06##NAME, x04, g08##NAME, \
+ x05, g10##NAME, x06, g12##NAME, \
+ x07, g14##NAME, x08, g16##NAME); \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test: "); \
+ test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, g16##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME, \
+ g09##NAME, g11##NAME, g13##NAME, g15##NAME); \
+ DEBUG_NL; \
+}
+
+T(c, char, 21)
+T(uc, unsigned char, 22)
+T(sc, signed char, (-33))
+T(us, unsigned short, 41)
+T(ss, short, (-44))
+T(f, float, 90.0)
+
+#undef T
+
+void
+scalar_by_value_2_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+T(c)
+T(uc)
+T(sc)
+T(us)
+T(ss)
+T(f)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_y.c
new file mode 100644
index 000000000..2eea6135d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-2_y.c
@@ -0,0 +1,69 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1); \
+ check##NAME (g02##NAME, 2); \
+ check##NAME (g03##NAME, 3); \
+ check##NAME (g04##NAME, 4); \
+ check##NAME (g05##NAME, 5); \
+ check##NAME (g06##NAME, 6); \
+ check##NAME (g07##NAME, 7); \
+ check##NAME (g08##NAME, 8); \
+ check##NAME (g09##NAME, 9); \
+ check##NAME (g10##NAME, 10); \
+ check##NAME (g11##NAME, 11); \
+ check##NAME (g12##NAME, 12); \
+ check##NAME (g13##NAME, 13); \
+ check##NAME (g14##NAME, 14); \
+ check##NAME (g15##NAME, 15); \
+ check##NAME (g16##NAME, 16); \
+} \
+ \
+void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16) \
+{ \
+ check##NAME (x01, 1); \
+ check##NAME (x02, 2); \
+ check##NAME (x03, 3); \
+ check##NAME (x04, 4); \
+ check##NAME (x05, 5); \
+ check##NAME (x06, 6); \
+ check##NAME (x07, 7); \
+ check##NAME (x08, 8); \
+ check##NAME (x09, 9); \
+ check##NAME (x10, 10); \
+ check##NAME (x11, 11); \
+ check##NAME (x12, 12); \
+ check##NAME (x13, 13); \
+ check##NAME (x14, 14); \
+ check##NAME (x15, 15); \
+ check##NAME (x16, 16); \
+}
+
+T(c, char, 21)
+T(uc, unsigned char, 22)
+T(sc, signed char, (-33))
+T(us, unsigned short, 41)
+T(ss, short, (-44))
+T(f, float, 90.0)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_main.c
new file mode 100644
index 000000000..307e6ccb6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_main.c
@@ -0,0 +1,14 @@
+/* Test passing scalars by value. This test includes _Complex types
+ whose real and imaginary parts can be used in variable-length
+ argument lists. */
+
+extern void scalar_by_value_3_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_by_value_3_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c
new file mode 100644
index 000000000..e63f5fd38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_x.c
@@ -0,0 +1,182 @@
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16); \
+extern void testva##NAME (int n, ...); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v + INITVAL) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+test2_##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08) \
+{ \
+ test##NAME (x01, g02##NAME, x02, g04##NAME, \
+ x03, g06##NAME, x04, g08##NAME, \
+ x05, g10##NAME, x06, g12##NAME, \
+ x07, g14##NAME, x08, g16##NAME); \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test: "); \
+ test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, g16##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##NAME (1, \
+ g01##NAME); \
+ DEBUG_NL; \
+ testva##NAME (2, \
+ g01##NAME, g02##NAME); \
+ DEBUG_NL; \
+ testva##NAME (3, \
+ g01##NAME, g02##NAME, g03##NAME); \
+ DEBUG_NL; \
+ testva##NAME (4, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME); \
+ DEBUG_NL; \
+ testva##NAME (5, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME); \
+ DEBUG_NL; \
+ testva##NAME (6, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME); \
+ DEBUG_NL; \
+ testva##NAME (7, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME); \
+ DEBUG_NL; \
+ testva##NAME (8, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME); \
+ DEBUG_NL; \
+ testva##NAME (9, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME); \
+ DEBUG_NL; \
+ testva##NAME (10, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME); \
+ DEBUG_NL; \
+ testva##NAME (11, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME); \
+ DEBUG_NL; \
+ testva##NAME (12, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME); \
+ DEBUG_NL; \
+ testva##NAME (13, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME); \
+ DEBUG_NL; \
+ testva##NAME (14, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME); \
+ DEBUG_NL; \
+ testva##NAME (15, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME); \
+ DEBUG_NL; \
+ testva##NAME (16, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, g16##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME, \
+ g09##NAME, g11##NAME, g13##NAME, g15##NAME); \
+ DEBUG_NL; \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(ci, _Complex int, CINT (2, 3))
+T(cl, _Complex long, CINT (3, 4))
+T(cll, _Complex long long, CINT (5, 6))
+#endif
+T(cd, _Complex double, CDBL (7.0, 8.0))
+T(cld, _Complex long double, CDBL (8.0, 9.0))
+#endif
+
+#undef T
+
+void
+scalar_by_value_3_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(ci)
+T(cl)
+T(cll)
+#endif
+T(cd)
+T(cld)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c
new file mode 100644
index 000000000..d470ef605
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-3_y.c
@@ -0,0 +1,95 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1); \
+ check##NAME (g02##NAME, 2); \
+ check##NAME (g03##NAME, 3); \
+ check##NAME (g04##NAME, 4); \
+ check##NAME (g05##NAME, 5); \
+ check##NAME (g06##NAME, 6); \
+ check##NAME (g07##NAME, 7); \
+ check##NAME (g08##NAME, 8); \
+ check##NAME (g09##NAME, 9); \
+ check##NAME (g10##NAME, 10); \
+ check##NAME (g11##NAME, 11); \
+ check##NAME (g12##NAME, 12); \
+ check##NAME (g13##NAME, 13); \
+ check##NAME (g14##NAME, 14); \
+ check##NAME (g15##NAME, 15); \
+ check##NAME (g16##NAME, 16); \
+} \
+ \
+void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16) \
+{ \
+ check##NAME (x01, 1); \
+ check##NAME (x02, 2); \
+ check##NAME (x03, 3); \
+ check##NAME (x04, 4); \
+ check##NAME (x05, 5); \
+ check##NAME (x06, 6); \
+ check##NAME (x07, 7); \
+ check##NAME (x08, 8); \
+ check##NAME (x09, 9); \
+ check##NAME (x10, 10); \
+ check##NAME (x11, 11); \
+ check##NAME (x12, 12); \
+ check##NAME (x13, 13); \
+ check##NAME (x14, 14); \
+ check##NAME (x15, 15); \
+ check##NAME (x16, 16); \
+} \
+ \
+void \
+testva##NAME (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##NAME (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(ci, _Complex int, CINT (2, 3))
+T(cl, _Complex long, CINT (3, 4))
+T(cll, _Complex long long, CINT (5, 6))
+#endif
+T(cd, _Complex double, CDBL (7.0, 8.0))
+T(cld, _Complex long double, CDBL (8.0, 9.0))
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_main.c
new file mode 100644
index 000000000..8164b4428
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_main.c
@@ -0,0 +1,14 @@
+/* Test passing scalars by value. This test includes _Complex types
+ whose real and imaginary parts cannot be used in variable-length
+ argument lists. */
+
+extern void scalar_by_value_4_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_by_value_4_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c
new file mode 100644
index 000000000..a4e73c9fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_x.c
@@ -0,0 +1,102 @@
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v + INITVAL) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+test2_##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08) \
+{ \
+ test##NAME (x01, g02##NAME, x02, g04##NAME, \
+ x03, g06##NAME, x04, g08##NAME, \
+ x05, g10##NAME, x06, g12##NAME, \
+ x07, g14##NAME, x08, g16##NAME); \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test: "); \
+ test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, g16##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME, \
+ g09##NAME, g11##NAME, g13##NAME, g15##NAME); \
+ DEBUG_NL; \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(cc, _Complex char, CINT (0, 1))
+T(cs, _Complex short, CINT (1, 2))
+#endif
+T(cf, _Complex float, CDBL (6.0, 7.0))
+#endif
+
+#undef T
+
+void
+scalar_by_value_4_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(cc)
+T(cs)
+#endif
+T(cf)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c
new file mode 100644
index 000000000..e0fa70539
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-4_y.c
@@ -0,0 +1,76 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1); \
+ check##NAME (g02##NAME, 2); \
+ check##NAME (g03##NAME, 3); \
+ check##NAME (g04##NAME, 4); \
+ check##NAME (g05##NAME, 5); \
+ check##NAME (g06##NAME, 6); \
+ check##NAME (g07##NAME, 7); \
+ check##NAME (g08##NAME, 8); \
+ check##NAME (g09##NAME, 9); \
+ check##NAME (g10##NAME, 10); \
+ check##NAME (g11##NAME, 11); \
+ check##NAME (g12##NAME, 12); \
+ check##NAME (g13##NAME, 13); \
+ check##NAME (g14##NAME, 14); \
+ check##NAME (g15##NAME, 15); \
+ check##NAME (g16##NAME, 16); \
+} \
+ \
+void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16) \
+{ \
+ check##NAME (x01, 1); \
+ check##NAME (x02, 2); \
+ check##NAME (x03, 3); \
+ check##NAME (x04, 4); \
+ check##NAME (x05, 5); \
+ check##NAME (x06, 6); \
+ check##NAME (x07, 7); \
+ check##NAME (x08, 8); \
+ check##NAME (x09, 9); \
+ check##NAME (x10, 10); \
+ check##NAME (x11, 11); \
+ check##NAME (x12, 12); \
+ check##NAME (x13, 13); \
+ check##NAME (x14, 14); \
+ check##NAME (x15, 15); \
+ check##NAME (x16, 16); \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(cc, _Complex char, CINT (0, 1))
+T(cs, _Complex short, CINT (1, 2))
+#endif
+T(cf, _Complex float, CDBL (6.0, 7.0))
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c
new file mode 100644
index 000000000..1c336d81a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5.c
@@ -0,0 +1,22 @@
+TEST_FUNCS (longlong_i, long long, int,
+ 1234LL, -987)
+TEST_FUNCS (longlong_d, long long, double,
+ 1234LL, -987.0)
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+TEST_FUNCS (complexint_i, _Complex int, int,
+ 1234 + 567i, -987)
+TEST_FUNCS (complexint_d, _Complex int, double,
+ 1234 + 567i, -987.0)
+#endif
+TEST_FUNCS (complexdouble_i, _Complex double, int,
+ 1234.0 + 567.0i, -987)
+TEST_FUNCS (complexdouble_d, _Complex double, double,
+ 1234.0 + 567.0i, -987.0)
+#ifndef SKIP_COMPLEX_INT
+TEST_FUNCS (complexlonglong_i, _Complex long long, int,
+ 1234LL + 567LLi, -987)
+TEST_FUNCS (complexlonglong_d, _Complex long long, double,
+ 1234LL + 567LLi, -987.0)
+#endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c
new file mode 100644
index 000000000..d29597e3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_main.c
@@ -0,0 +1,32 @@
+/* Test that function args can be passed in various positions to both fixed
+ and variable arg functions. */
+/* { dg-options "-O" } */
+
+extern void exit (int);
+extern void longlong_i_doit (void);
+extern void longlong_d_doit (void);
+extern void complexint_i_doit (void);
+extern void complexint_d_doit (void);
+extern void complexdouble_i_doit (void);
+extern void complexdouble_d_doit (void);
+extern void complexlonglong_i_doit (void);
+extern void complexlonglong_d_doit (void);
+
+int main (void)
+{
+ longlong_i_doit ();
+ longlong_d_doit ();
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+ complexint_i_doit ();
+ complexint_d_doit ();
+#endif
+ complexdouble_i_doit ();
+ complexdouble_d_doit ();
+#ifndef SKIP_COMPLEX_INT
+ complexlonglong_i_doit ();
+ complexlonglong_d_doit ();
+#endif
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_x.c
new file mode 100644
index 000000000..5266bdf67
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_x.c
@@ -0,0 +1,2 @@
+#include "scalar-by-value-x.h"
+#include "scalar-by-value-5.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_y.c
new file mode 100644
index 000000000..78d985a24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-5_y.c
@@ -0,0 +1,2 @@
+#include "scalar-by-value-y.h"
+#include "scalar-by-value-5.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c
new file mode 100644
index 000000000..af65398f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6.c
@@ -0,0 +1,6 @@
+TEST_FUNCS (longdouble_i, long double, int, d, -987)
+TEST_FUNCS (longdouble_d, long double, double, d, -987.0)
+#ifndef SKIP_COMPLEX
+TEST_FUNCS (complexlongdouble_i, _Complex long double, int, cd, -987)
+TEST_FUNCS (complexlongdouble_d, _Complex long double, double, cd, -987.0)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c
new file mode 100644
index 000000000..f6b3c1d8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_main.c
@@ -0,0 +1,23 @@
+/* Test that function args can be passed in various positions to both fixed
+ and variable arg functions. */
+/* { dg-options "-O" } */
+/* { dg-options "-O -mlong-double-128" { target powerpc*-*-* } } */
+
+extern void exit (int);
+extern void longdouble_i_doit (void);
+extern void longdouble_d_doit (void);
+#ifndef SKIP_COMPLEX
+extern void complexlongdouble_i_doit (void);
+extern void complexlongdouble_d_doit (void);
+#endif
+
+int main (void)
+{
+ longdouble_i_doit ();
+ longdouble_d_doit ();
+#ifndef SKIP_COMPLEX
+ complexlongdouble_i_doit ();
+ complexlongdouble_d_doit ();
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c
new file mode 100644
index 000000000..27aa48fbe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_x.c
@@ -0,0 +1,8 @@
+#include "scalar-by-value-x.h"
+
+extern long double d;
+#ifndef SKIP_COMPLEX
+extern _Complex long double cd;
+#endif
+
+#include "scalar-by-value-6.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c
new file mode 100644
index 000000000..2e9aed282
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-6_y.c
@@ -0,0 +1,8 @@
+#include "scalar-by-value-y.h"
+
+long double d = 1234.0L + 0x0.abcdp-70L;
+#ifndef SKIP_COMPLEX
+_Complex long double cd = 234.0L + 0x0.abcp-70L + 567.0Li +0x0defp-70Li;
+#endif
+
+#include "scalar-by-value-6.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_main.c
new file mode 100644
index 000000000..7f81d6a37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_main.c
@@ -0,0 +1,15 @@
+/* Test passing scalars by value. This test includes scalar types that
+ are supported by va_arg. */
+
+/* { dg-require-compat-dfp "" } */
+
+extern void scalar_by_value_dfp_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_by_value_dfp_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_x.c
new file mode 100644
index 000000000..8f55671c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_x.c
@@ -0,0 +1,170 @@
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16); \
+extern void testva##NAME (int n, ...); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v + INITVAL) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+test2_##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08) \
+{ \
+ test##NAME (x01, g02##NAME, x02, g04##NAME, \
+ x03, g06##NAME, x04, g08##NAME, \
+ x05, g10##NAME, x06, g12##NAME, \
+ x07, g14##NAME, x08, g16##NAME); \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test: "); \
+ test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, g16##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##NAME (1, \
+ g01##NAME); \
+ DEBUG_NL; \
+ testva##NAME (2, \
+ g01##NAME, g02##NAME); \
+ DEBUG_NL; \
+ testva##NAME (3, \
+ g01##NAME, g02##NAME, g03##NAME); \
+ DEBUG_NL; \
+ testva##NAME (4, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME); \
+ DEBUG_NL; \
+ testva##NAME (5, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME); \
+ DEBUG_NL; \
+ testva##NAME (6, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME); \
+ DEBUG_NL; \
+ testva##NAME (7, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME); \
+ DEBUG_NL; \
+ testva##NAME (8, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME); \
+ DEBUG_NL; \
+ testva##NAME (9, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME); \
+ DEBUG_NL; \
+ testva##NAME (10, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME); \
+ DEBUG_NL; \
+ testva##NAME (11, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME); \
+ DEBUG_NL; \
+ testva##NAME (12, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME); \
+ DEBUG_NL; \
+ testva##NAME (13, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME); \
+ DEBUG_NL; \
+ testva##NAME (14, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME); \
+ DEBUG_NL; \
+ testva##NAME (15, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME); \
+ DEBUG_NL; \
+ testva##NAME (16, \
+ g01##NAME, g02##NAME, g03##NAME, g04##NAME, \
+ g05##NAME, g06##NAME, g07##NAME, g08##NAME, \
+ g09##NAME, g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, g16##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME, \
+ g09##NAME, g11##NAME, g13##NAME, g15##NAME); \
+ DEBUG_NL; \
+}
+
+T(d32, _Decimal32, 1.2df)
+T(d64, _Decimal64, 12.34dd)
+T(d128, _Decimal128, 123.456dl)
+
+#undef T
+
+void
+scalar_by_value_dfp_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+T(d32)
+T(d64)
+T(d128)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_y.c
new file mode 100644
index 000000000..9b1f49f69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-dfp_y.c
@@ -0,0 +1,89 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1); \
+ check##NAME (g02##NAME, 2); \
+ check##NAME (g03##NAME, 3); \
+ check##NAME (g04##NAME, 4); \
+ check##NAME (g05##NAME, 5); \
+ check##NAME (g06##NAME, 6); \
+ check##NAME (g07##NAME, 7); \
+ check##NAME (g08##NAME, 8); \
+ check##NAME (g09##NAME, 9); \
+ check##NAME (g10##NAME, 10); \
+ check##NAME (g11##NAME, 11); \
+ check##NAME (g12##NAME, 12); \
+ check##NAME (g13##NAME, 13); \
+ check##NAME (g14##NAME, 14); \
+ check##NAME (g15##NAME, 15); \
+ check##NAME (g16##NAME, 16); \
+} \
+ \
+void \
+test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
+ TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
+ TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
+ TYPE x13, TYPE x14, TYPE x15, TYPE x16) \
+{ \
+ check##NAME (x01, 1); \
+ check##NAME (x02, 2); \
+ check##NAME (x03, 3); \
+ check##NAME (x04, 4); \
+ check##NAME (x05, 5); \
+ check##NAME (x06, 6); \
+ check##NAME (x07, 7); \
+ check##NAME (x08, 8); \
+ check##NAME (x09, 9); \
+ check##NAME (x10, 10); \
+ check##NAME (x11, 11); \
+ check##NAME (x12, 12); \
+ check##NAME (x13, 13); \
+ check##NAME (x14, 14); \
+ check##NAME (x15, 15); \
+ check##NAME (x16, 16); \
+} \
+ \
+void \
+testva##NAME (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##NAME (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(d32, _Decimal32, 1.2df)
+T(d64, _Decimal64, 12.34dd)
+T(d128, _Decimal128, 123.456dl)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-x.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-x.h
new file mode 100644
index 000000000..f0ac216ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-x.h
@@ -0,0 +1,77 @@
+#if DEBUG
+#include <stdio.h>
+#define DBG(x) fputs (x, stdout); fflush (stdout);
+#else
+#define DBG(x)
+#endif
+
+#define TEST_FUNCS(NAME, TYPE, PADT, VAL, VAL2) \
+extern void NAME##_f0 (TYPE a, PADT b); \
+extern void NAME##_f1 (PADT z0, TYPE a, PADT b); \
+extern void NAME##_f2 (PADT z0, PADT z1, TYPE a, PADT b); \
+extern void NAME##_f3 (PADT z0, PADT z1, PADT z2, TYPE a, PADT b); \
+extern void NAME##_f4 (PADT z0, PADT z1, PADT z2, PADT z3, TYPE a, \
+ PADT b); \
+extern void NAME##_f5 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
+ TYPE a, PADT b); \
+extern void NAME##_f6 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
+ PADT z5, TYPE a, PADT b); \
+extern void NAME##_f7 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
+ PADT z5, PADT z6, TYPE a, PADT b); \
+extern void NAME##_f8 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
+ PADT z5, PADT z6, PADT z7, TYPE a, PADT b); \
+extern void NAME##_f9 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, \
+ PADT z5, PADT z6, PADT z7, PADT z8, TYPE a, \
+ PADT b); \
+extern void NAME##_fv (int n, ...); \
+ \
+void NAME##_doit (void) \
+{ \
+ NAME##_f0 (VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f1 ((PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f2 ((PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f3 ((PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f4 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f5 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f6 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f7 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f8 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_f9 ((PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (1, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (2, (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (3, (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (4, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (5, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (6, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (7, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("."); \
+ NAME##_fv (8, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, (PADT) 0, \
+ (PADT) 0, (PADT) 0, (PADT) 0, VAL, VAL2); \
+ DBG ("\n"); \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h
new file mode 100644
index 000000000..e181a7e34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-by-value-y.h
@@ -0,0 +1,277 @@
+extern void abort (void);
+
+#ifdef __GNUC__
+#define va_list __builtin_va_list
+#define va_start __builtin_va_start
+#define va_arg __builtin_va_arg
+#define va_end __builtin_va_end
+#else
+#include <stdarg.h>
+#endif
+
+#if USE_MEMCMP
+/* For comparing vectors. */
+#define TEST_FUNCS(NAME, TYPE, PADT, VAL, VAL2) \
+void NAME##_f0 (TYPE a, PADT b) \
+{ \
+ if (memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f1 (PADT z0, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f2 (PADT z0, PADT z1, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f3 (PADT z0, PADT z1, PADT z2, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f4 (PADT z0, PADT z1, PADT z2, PADT z3, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f5 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, TYPE a, \
+ PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f6 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
+ TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || z5 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f7 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
+ PADT z6, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || z5 != (PADT) 0 \
+ || z6 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f8 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
+ PADT z6, PADT z7, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || z5 != (PADT) 0 \
+ || z6 != (PADT) 0 \
+ || z7 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f9 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
+ PADT z6, PADT z7, PADT z8, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || z5 != (PADT) 0 \
+ || z6 != (PADT) 0 \
+ || z7 != (PADT) 0 \
+ || z8 != (PADT) 0 \
+ || memcmp (&a, &VAL, sizeof (a)) != 0 || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_fv (int n, ...) \
+{ \
+ va_list ap; \
+ TYPE x; \
+ va_start (ap, n); \
+ \
+ while (n-- != 0) \
+ if (va_arg (ap, PADT) != (PADT) 0) \
+ abort (); \
+ \
+ x = va_arg (ap, TYPE); \
+ if (memcmp (&x, &VAL, sizeof (x)) != 0 ) \
+ abort (); \
+ \
+ if (va_arg (ap, PADT) != VAL2) \
+ abort (); \
+ \
+ va_end (ap); \
+}
+
+#else
+
+#define TEST_FUNCS(NAME, TYPE, PADT, VAL, VAL2) \
+void NAME##_f0 (TYPE a, PADT b) \
+{ \
+ if (a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f1 (PADT z0, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f2 (PADT z0, PADT z1, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f3 (PADT z0, PADT z1, PADT z2, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f4 (PADT z0, PADT z1, PADT z2, PADT z3, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f5 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, TYPE a, \
+ PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f6 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
+ TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || z5 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f7 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
+ PADT z6, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || z5 != (PADT) 0 \
+ || z6 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f8 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
+ PADT z6, PADT z7, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || z5 != (PADT) 0 \
+ || z6 != (PADT) 0 \
+ || z7 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_f9 (PADT z0, PADT z1, PADT z2, PADT z3, PADT z4, PADT z5, \
+ PADT z6, PADT z7, PADT z8, TYPE a, PADT b) \
+{ \
+ if (z0 != (PADT) 0 \
+ || z1 != (PADT) 0 \
+ || z2 != (PADT) 0 \
+ || z3 != (PADT) 0 \
+ || z4 != (PADT) 0 \
+ || z5 != (PADT) 0 \
+ || z6 != (PADT) 0 \
+ || z7 != (PADT) 0 \
+ || z8 != (PADT) 0 \
+ || a != VAL || b != VAL2) \
+ abort (); \
+} \
+ \
+void NAME##_fv (int n, ...) \
+{ \
+ va_list ap; \
+ \
+ va_start (ap, n); \
+ \
+ while (n-- != 0) \
+ if (va_arg (ap, PADT) != (PADT) 0) \
+ abort (); \
+ \
+ if (va_arg (ap, TYPE) != VAL) \
+ abort (); \
+ \
+ if (va_arg (ap, PADT) != VAL2) \
+ abort (); \
+ \
+ va_end (ap); \
+}
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_main.c
new file mode 100644
index 000000000..0a27f5416
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_main.c
@@ -0,0 +1,13 @@
+/* Test function return values. This test includes scalar types that
+ are supported by va_arg. */
+
+extern void scalar_return_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_return_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c
new file mode 100644
index 000000000..5556f9510
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_x.c
@@ -0,0 +1,119 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern TYPE test0##NAME (void); \
+extern TYPE test1##NAME (TYPE); \
+extern TYPE testva##NAME (int n, ...); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##NAME (); \
+ check##NAME (rslt, g01##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##NAME (g01##NAME); \
+ check##NAME (rslt, g01##NAME); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" testva:"); \
+ rslt = testva##NAME (1, g01##NAME); \
+ check##NAME (rslt, g01##NAME); \
+ rslt = testva##NAME (5, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME); \
+ check##NAME (rslt, g05##NAME); \
+ rslt = testva##NAME (9, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME, g06##NAME, \
+ g07##NAME, g08##NAME, g09##NAME); \
+ check##NAME (rslt, g09##NAME); \
+ rslt = testva##NAME (16, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME, g06##NAME, \
+ g07##NAME, g08##NAME, g09##NAME, \
+ g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, \
+ g16##NAME); \
+ check##NAME (rslt, g16##NAME); \
+ } \
+ DEBUG_NL; \
+}
+
+T(ui, unsigned int, 51)
+T(si, int, (-55))
+T(ul, unsigned long, 61)
+T(sl, long, (-66))
+T(ull, unsigned long long, 71)
+T(sll, long long, (-77))
+T(d, double, 91.0)
+T(ld, long double, 92.0)
+
+#undef T
+
+void
+scalar_return_1_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+T(ui)
+T(si)
+T(ul)
+T(sl)
+T(ull)
+T(sll)
+T(d)
+T(ld)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_y.c
new file mode 100644
index 000000000..f913dbbb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-1_y.c
@@ -0,0 +1,72 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1+INITVAL); \
+ check##NAME (g02##NAME, 2+INITVAL); \
+ check##NAME (g03##NAME, 3+INITVAL); \
+ check##NAME (g04##NAME, 4+INITVAL); \
+ check##NAME (g05##NAME, 5+INITVAL); \
+ check##NAME (g06##NAME, 6+INITVAL); \
+ check##NAME (g07##NAME, 7+INITVAL); \
+ check##NAME (g08##NAME, 8+INITVAL); \
+ check##NAME (g09##NAME, 9+INITVAL); \
+ check##NAME (g10##NAME, 10+INITVAL); \
+ check##NAME (g11##NAME, 11+INITVAL); \
+ check##NAME (g12##NAME, 12+INITVAL); \
+ check##NAME (g13##NAME, 13+INITVAL); \
+ check##NAME (g14##NAME, 14+INITVAL); \
+ check##NAME (g15##NAME, 15+INITVAL); \
+ check##NAME (g16##NAME, 16+INITVAL); \
+} \
+ \
+TYPE \
+test0##NAME (void) \
+{ \
+ return g01##NAME; \
+} \
+ \
+TYPE \
+test1##NAME (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##NAME (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(ui, unsigned int, 51)
+T(si, int, (-55))
+T(ul, unsigned long, 61)
+T(sl, long, (-66))
+T(ull, unsigned long long, 71)
+T(sll, long long, (-77))
+T(d, double, 91.0)
+T(ld, long double, 92.0)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_main.c
new file mode 100644
index 000000000..11a5e5044
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_main.c
@@ -0,0 +1,13 @@
+/* Test function return values. This test includes scalar types that
+ are not supported by va_arg. */
+
+extern void scalar_return_2_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_return_2_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c
new file mode 100644
index 000000000..f864d4c96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_x.c
@@ -0,0 +1,86 @@
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern TYPE test0##NAME (void); \
+extern TYPE test1##NAME (TYPE); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##NAME (); \
+ check##NAME (rslt, g01##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##NAME (g01##NAME); \
+ check##NAME (rslt, g01##NAME); \
+ DEBUG_NL; \
+}
+
+T(c, char, 21)
+T(uc, unsigned char, 22)
+T(sc, signed char, (-33))
+T(us, unsigned short, 41)
+T(ss, short, (-44))
+T(f, float, 90.0)
+
+#undef T
+
+void
+scalar_return_2_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+T(c)
+T(uc)
+T(sc)
+T(us)
+T(ss)
+T(f)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_y.c
new file mode 100644
index 000000000..485165c71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-2_y.c
@@ -0,0 +1,63 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1+INITVAL); \
+ check##NAME (g02##NAME, 2+INITVAL); \
+ check##NAME (g03##NAME, 3+INITVAL); \
+ check##NAME (g04##NAME, 4+INITVAL); \
+ check##NAME (g05##NAME, 5+INITVAL); \
+ check##NAME (g06##NAME, 6+INITVAL); \
+ check##NAME (g07##NAME, 7+INITVAL); \
+ check##NAME (g08##NAME, 8+INITVAL); \
+ check##NAME (g09##NAME, 9+INITVAL); \
+ check##NAME (g10##NAME, 10+INITVAL); \
+ check##NAME (g11##NAME, 11+INITVAL); \
+ check##NAME (g12##NAME, 12+INITVAL); \
+ check##NAME (g13##NAME, 13+INITVAL); \
+ check##NAME (g14##NAME, 14+INITVAL); \
+ check##NAME (g15##NAME, 15+INITVAL); \
+ check##NAME (g16##NAME, 16+INITVAL); \
+} \
+ \
+TYPE \
+test0##NAME (void) \
+{ \
+ return g01##NAME; \
+} \
+ \
+TYPE \
+test1##NAME (TYPE x01) \
+{ \
+ return x01; \
+}
+
+T(c, char, 21)
+T(uc, unsigned char, 22)
+T(sc, signed char, (-33))
+T(us, unsigned short, 41)
+T(ss, short, (-44))
+T(f, float, 90.0)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_main.c
new file mode 100644
index 000000000..8f2738be6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_main.c
@@ -0,0 +1,14 @@
+/* Test function return values. This test includes _Complex types
+ whose real and imaginary parts can be used in variable-length
+ argument lists. */
+
+extern void scalar_return_3_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_return_3_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c
new file mode 100644
index 000000000..5b33ce880
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_x.c
@@ -0,0 +1,121 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern TYPE test0##NAME (void); \
+extern TYPE test1##NAME (TYPE); \
+extern TYPE testva##NAME (int n, ...); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##NAME (); \
+ check##NAME (rslt, g01##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##NAME (g01##NAME); \
+ check##NAME (rslt, g01##NAME); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##NAME (1, g01##NAME); \
+ check##NAME (rslt, g01##NAME); \
+ rslt = testva##NAME (5, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME); \
+ check##NAME (rslt, g05##NAME); \
+ rslt = testva##NAME (9, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME, g06##NAME, \
+ g07##NAME, g08##NAME, g09##NAME); \
+ check##NAME (rslt, g09##NAME); \
+ rslt = testva##NAME (16, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME, g06##NAME, \
+ g07##NAME, g08##NAME, g09##NAME, \
+ g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, \
+ g16##NAME); \
+ check##NAME (rslt, g16##NAME); \
+ } \
+ DEBUG_NL; \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(ci, _Complex int, CINT (2, 3))
+T(cl, _Complex long, CINT (3, 4))
+T(cll, _Complex long long, CINT (4, 5))
+#endif
+T(cd, _Complex double, CDBL (2.0, 3.0))
+T(cld, _Complex long double, CDBL (3.0, 4.0))
+#endif
+
+#undef T
+
+void
+scalar_return_3_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(ci)
+T(cl)
+T(cll)
+#endif
+T(cd)
+T(cld)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
new file mode 100644
index 000000000..245c4c571
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-3_y.c
@@ -0,0 +1,73 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1+INITVAL); \
+ check##NAME (g02##NAME, 2+INITVAL); \
+ check##NAME (g03##NAME, 3+INITVAL); \
+ check##NAME (g04##NAME, 4+INITVAL); \
+ check##NAME (g05##NAME, 5+INITVAL); \
+ check##NAME (g06##NAME, 6+INITVAL); \
+ check##NAME (g07##NAME, 7+INITVAL); \
+ check##NAME (g08##NAME, 8+INITVAL); \
+ check##NAME (g09##NAME, 9+INITVAL); \
+ check##NAME (g10##NAME, 10+INITVAL); \
+ check##NAME (g11##NAME, 11+INITVAL); \
+ check##NAME (g12##NAME, 12+INITVAL); \
+ check##NAME (g13##NAME, 13+INITVAL); \
+ check##NAME (g14##NAME, 14+INITVAL); \
+ check##NAME (g15##NAME, 15+INITVAL); \
+ check##NAME (g16##NAME, 16+INITVAL); \
+} \
+ \
+TYPE \
+test0##NAME (void) \
+{ \
+ return g01##NAME; \
+} \
+ \
+TYPE \
+test1##NAME (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##NAME (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(ci, _Complex int, CINT (2, 3))
+T(cl, _Complex long, CINT (3, 4))
+T(cll, _Complex long long, CINT (4, 5))
+#endif
+T(cd, _Complex double, CDBL (2.0, 3.0))
+T(cld, _Complex long double, CDBL (3.0, 4.0))
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_main.c
new file mode 100644
index 000000000..2bcfa0487
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_main.c
@@ -0,0 +1,14 @@
+/* Test function return values. This test includes _Complex types
+ whose real and imaginary parts cannot be used in variable-length
+ argument lists. */
+
+extern void scalar_return_4_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_return_4_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c
new file mode 100644
index 000000000..50305be4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_x.c
@@ -0,0 +1,70 @@
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern TYPE test0##NAME (void); \
+extern TYPE test1##NAME (TYPE); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##NAME (); \
+ check##NAME (rslt, g01##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##NAME (g01##NAME); \
+ check##NAME (rslt, g01##NAME); \
+ DEBUG_NL; \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(cc, _Complex char, CINT (0, 1))
+T(cs, _Complex short, CINT (1 + 2))
+#endif
+T(cf, _Complex float, CDBL (1.0, 2.0))
+#endif
+
+#undef T
+
+void
+scalar_return_4_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(cc)
+T(cs)
+#endif
+T(cf)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c
new file mode 100644
index 000000000..3c9685697
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-4_y.c
@@ -0,0 +1,46 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1+INITVAL); \
+} \
+ \
+TYPE \
+test0##NAME (void) \
+{ \
+ return g01##NAME; \
+} \
+ \
+TYPE \
+test1##NAME (TYPE x01) \
+{ \
+ return x01; \
+}
+
+#ifndef SKIP_COMPLEX
+#ifndef SKIP_COMPLEX_INT
+T(cc, _Complex char, CINT (0, 1))
+T(cs, _Complex short, CINT (1, 2))
+#endif
+T(cf, _Complex float, CDBL (1.0, 2.0))
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_main.c
new file mode 100644
index 000000000..eeb62869f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_main.c
@@ -0,0 +1,15 @@
+/* Test function return values. This test includes scalar types that
+ are supported by va_arg. */
+
+/* { dg-require-compat-dfp "" } */
+
+extern void scalar_return_dfp_x(void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ scalar_return_dfp_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_x.c
new file mode 100644
index 000000000..aee0a9717
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_x.c
@@ -0,0 +1,109 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(NAME, TYPE, INITVAL) \
+TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void init##NAME (TYPE *p, TYPE v); \
+extern void checkg##NAME (void); \
+extern TYPE test0##NAME (void); \
+extern TYPE test1##NAME (TYPE); \
+extern TYPE testva##NAME (int n, ...); \
+ \
+void \
+check##NAME (TYPE x, TYPE v) \
+{ \
+ if (x != v) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+testit##NAME (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME (&g01##NAME, 1); \
+ init##NAME (&g02##NAME, 2); \
+ init##NAME (&g03##NAME, 3); \
+ init##NAME (&g04##NAME, 4); \
+ init##NAME (&g05##NAME, 5); \
+ init##NAME (&g06##NAME, 6); \
+ init##NAME (&g07##NAME, 7); \
+ init##NAME (&g08##NAME, 8); \
+ init##NAME (&g09##NAME, 9); \
+ init##NAME (&g10##NAME, 10); \
+ init##NAME (&g11##NAME, 11); \
+ init##NAME (&g12##NAME, 12); \
+ init##NAME (&g13##NAME, 13); \
+ init##NAME (&g14##NAME, 14); \
+ init##NAME (&g15##NAME, 15); \
+ init##NAME (&g16##NAME, 16); \
+ checkg##NAME (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##NAME (); \
+ check##NAME (rslt, g01##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##NAME (g01##NAME); \
+ check##NAME (rslt, g01##NAME); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME); \
+ DEBUG_FPUTS (" testva:"); \
+ rslt = testva##NAME (1, g01##NAME); \
+ check##NAME (rslt, g01##NAME); \
+ rslt = testva##NAME (5, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME); \
+ check##NAME (rslt, g05##NAME); \
+ rslt = testva##NAME (9, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME, g06##NAME, \
+ g07##NAME, g08##NAME, g09##NAME); \
+ check##NAME (rslt, g09##NAME); \
+ rslt = testva##NAME (16, g01##NAME, g02##NAME, g03##NAME, \
+ g04##NAME, g05##NAME, g06##NAME, \
+ g07##NAME, g08##NAME, g09##NAME, \
+ g10##NAME, g11##NAME, g12##NAME, \
+ g13##NAME, g14##NAME, g15##NAME, \
+ g16##NAME); \
+ check##NAME (rslt, g16##NAME); \
+ } \
+ DEBUG_NL; \
+}
+
+T(d32, _Decimal32, 1.2df)
+T(d64, _Decimal64, 12.34dd)
+T(d128, _Decimal128, 123.456dl)
+
+#undef T
+
+void
+scalar_return_dfp_x ()
+{
+DEBUG_INIT
+
+#define T(NAME) testit##NAME ();
+
+T(d32)
+T(d64)
+T(d128)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_y.c
new file mode 100644
index 000000000..5fd9373fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/scalar-return-dfp_y.c
@@ -0,0 +1,67 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#define T(NAME, TYPE, INITVAL) \
+extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
+extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
+extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
+extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
+ \
+extern void check##NAME (TYPE x, TYPE v); \
+ \
+void \
+init##NAME (TYPE *p, TYPE v) \
+{ \
+ *p = v + INITVAL; \
+} \
+ \
+void \
+checkg##NAME (void) \
+{ \
+ check##NAME (g01##NAME, 1+INITVAL); \
+ check##NAME (g02##NAME, 2+INITVAL); \
+ check##NAME (g03##NAME, 3+INITVAL); \
+ check##NAME (g04##NAME, 4+INITVAL); \
+ check##NAME (g05##NAME, 5+INITVAL); \
+ check##NAME (g06##NAME, 6+INITVAL); \
+ check##NAME (g07##NAME, 7+INITVAL); \
+ check##NAME (g08##NAME, 8+INITVAL); \
+ check##NAME (g09##NAME, 9+INITVAL); \
+ check##NAME (g10##NAME, 10+INITVAL); \
+ check##NAME (g11##NAME, 11+INITVAL); \
+ check##NAME (g12##NAME, 12+INITVAL); \
+ check##NAME (g13##NAME, 13+INITVAL); \
+ check##NAME (g14##NAME, 14+INITVAL); \
+ check##NAME (g15##NAME, 15+INITVAL); \
+ check##NAME (g16##NAME, 16+INITVAL); \
+} \
+ \
+TYPE \
+test0##NAME (void) \
+{ \
+ return g01##NAME; \
+} \
+ \
+TYPE \
+test1##NAME (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##NAME (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(d32, _Decimal32, 1.2df)
+T(d64, _Decimal64, 12.34dd)
+T(d128, _Decimal128, 123.456dl)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_main.c
new file mode 100644
index 000000000..68e9f8f09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_main.c
@@ -0,0 +1,12 @@
+/* Check that sdata qualification doesn't produce out-of-range relocations
+ and that compilers agree on the way these declarations are handled. */
+
+extern void sdata_1_x (void);
+extern void exit (int);
+
+int
+main ()
+{
+ sdata_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_x.c
new file mode 100644
index 000000000..fc7b8cef3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_x.c
@@ -0,0 +1,25 @@
+#include "sdata-section.h"
+
+struct s { int x; int y[4]; };
+extern struct s small_struct SDATA_SECTION;
+
+/* Test "load address" operations. */
+int *xaddr (void) { return &small_struct.x; }
+int *yaddr (int i) { return &small_struct.y[i]; }
+
+void sdata_1_x (void)
+{
+ int i;
+
+ /* Test direct accesses. */
+ small_struct.x = 5;
+ for (i = 0; i < 4; i++)
+ small_struct.y[i] = i + 42;
+
+ if (*xaddr () != 5)
+ abort ();
+
+ for (i = 0; i < 4; i++)
+ if (*yaddr (i) != i + 42)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_y.c
new file mode 100644
index 000000000..8bc878a85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-1_y.c
@@ -0,0 +1,4 @@
+#include "sdata-section.h"
+
+struct s { int x; int y[4]; };
+struct s small_struct SDATA_SECTION;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-section.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-section.h
new file mode 100644
index 000000000..15be84386
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/sdata-section.h
@@ -0,0 +1,7 @@
+#if defined (__mips) && !defined(SKIP_ATTRIBUTE)
+#define SDATA_SECTION __attribute__((__section__(".sdata")))
+#else
+#define SDATA_SECTION
+#endif
+
+extern void abort (void);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-check.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-check.h
new file mode 100644
index 000000000..85b334c44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-check.h
@@ -0,0 +1,29 @@
+/* Function definitions that are used by multiple tests. */
+
+void checkSc (Sc x, int i) { if (x.c != (char)i) DEBUG_CHECK }
+void checkSs (Ss x, int i) { if (x.s != i) DEBUG_CHECK }
+void checkSi (Si x, int i) { if (x.i != i) DEBUG_CHECK }
+void checkSsc (Ssc x, int i)
+{ if (x.s != i || x.c != (char)i+1) DEBUG_CHECK }
+void checkScs (Scs x, int i)
+{ if (x.c != (char)i || x.s != i+1) DEBUG_CHECK }
+void checkSsi (Ssi x, int i)
+{ if (x.s != i || x.i != i+1) DEBUG_CHECK }
+void checkSis (Sis x, int i)
+{ if (x.i != i || x.s != i+1) DEBUG_CHECK }
+void checkSic (Sic x, int i)
+{ if (x.i != i || x.c != (char)i+1) DEBUG_CHECK }
+void checkSci (Sci x, int i)
+{ if (x.c != (char)i || x.i != i+1) DEBUG_CHECK }
+void checkScsi (Scsi x, int i)
+{ if (x.c != (char)i || x.s != i+1 || x.i != i+2) DEBUG_CHECK }
+void checkScis (Scis x, int i)
+{ if (x.c != (char)i || x.i != i+1 || x.s != i+2) DEBUG_CHECK }
+void checkSsci (Ssci x, int i)
+{ if (x.s != i || x.c != (char)i+1 || x.i != i+2) DEBUG_CHECK }
+void checkSsic (Ssic x, int i)
+{ if (x.s != i || x.i != i+1 || x.c != (char)i+2) DEBUG_CHECK }
+void checkSisc (Sisc x, int i)
+{ if (x.i != i || x.s != i+1 || x.c != (char)i+2) DEBUG_CHECK }
+void checkSics (Sics x, int i)
+{ if (x.i != i || x.c != (char)i+1 || x.s != i+2) DEBUG_CHECK }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-defs.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-defs.h
new file mode 100644
index 000000000..1a46b26e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-defs.h
@@ -0,0 +1,17 @@
+/* Type definitions that are used by multiple tests. */
+
+typedef struct { char c; } Sc;
+typedef struct { short s; } Ss;
+typedef struct { int i; } Si;
+typedef struct { short s; char c; } Ssc;
+typedef struct { char c; short s; } Scs;
+typedef struct { int i; char c; } Sic;
+typedef struct { char c; int i; } Sci;
+typedef struct { short s; int i; } Ssi;
+typedef struct { int i; short s; } Sis;
+typedef struct { char c; short s; int i; } Scsi;
+typedef struct { char c; int i; short s; } Scis;
+typedef struct { short s; char c; int i; } Ssci;
+typedef struct { short s; int i; char c; } Ssic;
+typedef struct { int i; short s; char c; } Sisc;
+typedef struct { int i; char c; short s; } Sics;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-init.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-init.h
new file mode 100644
index 000000000..97009b6ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/small-struct-init.h
@@ -0,0 +1,17 @@
+/* Function definitions that are used by multiple tests. */
+
+void initSc (Sc *p, int i) { p->c = (char)i; }
+void initSs (Ss *p, int i) { p->s = i; }
+void initSi (Si *p, int i) { p->i = i; }
+void initSsc (Ssc *p, int i) { p->s = i; p->c = (char)i+1; }
+void initScs (Scs *p, int i) { p->c = (char)i; p->s = i+1; }
+void initSsi (Ssi *p, int i) { p->s = i; p->i = i+1; }
+void initSis (Sis *p, int i) { p->i = i; p->s = i+1; }
+void initSic (Sic *p, int i) { p->i = i; p->c = (char)i+1; }
+void initSci (Sci *p, int i) { p->c = (char)i; p->i = i+1; }
+void initScsi (Scsi *p, int i) { p->c = (char)i; p->s = i+1; p->i = i+2; }
+void initScis (Scis *p, int i) { p->c = (char)i; p->i = i+1; p->s = i+2; }
+void initSsci (Ssci *p, int i) { p->s = i; p->c = (char)i+1; p->i = i+2; }
+void initSsic (Ssic *p, int i) { p->s = i; p->i = i+1; p->c = (char)i+2; }
+void initSisc (Sisc *p, int i) { p->i = i; p->s = i+1; p->c = (char)i+2; }
+void initSics (Sics *p, int i) { p->i = i; p->c = (char)i+1; p->s = i+2; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1.h
new file mode 100644
index 000000000..d9006c741
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1.h
@@ -0,0 +1,180 @@
+/* Define several variants of a struct for which the alignment differs
+ between powerpc64-linux and powerpc64-aix. This might be interesting
+ for other targets as well. */
+
+#define DESC_orig "original"
+struct B1_orig {
+ char c;
+ double d;
+};
+
+struct A2_orig {
+ double d;
+};
+
+struct B2_orig {
+ char c;
+ struct A2_orig a2;
+};
+
+struct A3_orig {
+ double d;
+ int i;
+};
+
+struct B3_orig {
+ char c;
+ struct A3_orig a3;
+};
+
+#ifndef SKIP_ATTRIBUTE
+#define DESC_p_all "packed attribute for all"
+struct B1_p_all {
+ char c;
+ double d;
+} __attribute__ ((packed));
+
+struct A2_p_all {
+ double d;
+} __attribute__ ((packed));
+
+struct B2_p_all {
+ char c;
+ struct A2_p_all a2;
+} __attribute__ ((packed));
+
+struct A3_p_all {
+ double d;
+ int i;
+} __attribute__ ((packed));
+
+struct B3_p_all {
+ char c;
+ struct A3_p_all a3;
+} __attribute__ ((packed));
+
+#define DESC_p_inner "packed attribute for inner"
+struct B1_p_inner {
+ char c;
+ double d;
+};
+
+struct A2_p_inner {
+ double d;
+} __attribute__ ((packed));
+
+struct B2_p_inner {
+ char c;
+ struct A2_p_inner a2;
+};
+
+struct A3_p_inner {
+ double d;
+ int i;
+} __attribute__ ((packed));
+
+struct B3_p_inner {
+ char c;
+ struct A3_p_inner a3;
+};
+
+#define DESC_p_outer "packed attribute for outer"
+struct B1_p_outer {
+ char c;
+ double d;
+} __attribute__ ((packed));
+
+struct A2_p_outer {
+ double d;
+};
+
+struct B2_p_outer {
+ char c;
+ struct A2_p_outer a2;
+} __attribute__ ((packed));
+
+struct A3_p_outer {
+ double d;
+ int i;
+};
+
+struct B3_p_outer {
+ char c;
+ struct A3_p_outer a3;
+} __attribute__ ((packed));
+
+#define DESC_a_max "maximum useful struct alignment for all"
+struct B1_a_max {
+ char c;
+ double d;
+} __attribute__ ((aligned));
+
+struct A2_a_max {
+ double d;
+} __attribute__ ((aligned));
+
+struct B2_a_max {
+ char c;
+ struct A2_a_max a2;
+} __attribute__ ((aligned));
+
+struct A3_a_max {
+ double d;
+ int i;
+} __attribute__ ((aligned));
+
+struct B3_a_max {
+ char c;
+ struct A3_a_max a3;
+} __attribute__ ((aligned));
+
+#define DESC_m_outer_p_inner "maximum alignment for outer, packed inner"
+struct B1_m_outer_p_inner {
+ char c;
+ double d;
+} __attribute__ ((aligned)) __attribute__ ((packed));
+
+struct A2_m_outer_p_inner {
+ double d;
+} __attribute__ ((packed));
+
+struct B2_m_outer_p_inner {
+ char c;
+ struct A2_m_outer_p_inner a2;
+} __attribute__ ((aligned));
+
+struct A3_m_outer_p_inner {
+ double d;
+ int i;
+} __attribute__ ((packed));
+
+struct B3_m_outer_p_inner {
+ char c;
+ struct A3_m_outer_p_inner a3;
+} __attribute__ ((aligned));
+
+#define DESC_m_inner_p_outer "maximum alignment for inner, packed outer"
+struct B1_m_inner_p_outer {
+ char c;
+ double d;
+} __attribute__ ((aligned)) __attribute__ ((packed));
+
+struct A2_m_inner_p_outer {
+ double d;
+} __attribute__ ((aligned));
+
+struct B2_m_inner_p_outer {
+ char c;
+ struct A2_m_inner_p_outer a2;
+} __attribute__ ((packed));
+
+struct A3_m_inner_p_outer {
+ double d;
+ int i;
+} __attribute__ ((aligned));
+
+struct B3_m_inner_p_outer {
+ char c;
+ struct A3_m_inner_p_outer a3;
+} __attribute__ ((packed));
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_main.c
new file mode 100644
index 000000000..0b7f27bea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_main.c
@@ -0,0 +1,13 @@
+/* Test compatibility of structure layout and alignment for structs
+ which contain doubles. The original structs here are from PR 10645. */
+
+extern void struct_align_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_align_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
new file mode 100644
index 000000000..939db9d21
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
@@ -0,0 +1,110 @@
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "compat-common.h"
+#include "struct-align-1.h"
+
+#define SETUP(NAME,V1,V2,V3) \
+char v1_##NAME = V1; \
+double v2_##NAME = V2; \
+int v3_##NAME = V3; \
+ \
+struct B1_##NAME b1_##NAME = { V1, V2 }; \
+struct B2_##NAME b2_##NAME = { V1, { V2 } }; \
+struct B3_##NAME b3_##NAME = { V1, { V2, V3 } }; \
+ \
+struct B1_##NAME ab1_##NAME[2] = \
+ { { V1, V2 }, { V1, V2 } }; \
+struct B2_##NAME ab2_##NAME[2] = \
+ { { V1, { V2 } }, { V1, { V2 } } }; \
+struct B3_##NAME ab3_##NAME[2] = \
+ { { V1, { V2, V3 } }, { V1, { V2, V3 } } }; \
+ \
+extern void test_##NAME (void); \
+extern void checkp1_##NAME (struct B1_##NAME *); \
+extern void checkp2_##NAME (struct B2_##NAME *); \
+extern void checkp3_##NAME (struct B3_##NAME *); \
+extern void checkg1_##NAME (void); \
+extern void checkg2_##NAME (void); \
+extern void checkg3_##NAME (void); \
+ \
+void \
+pass1_##NAME (struct B1_##NAME s) \
+{ \
+ checkp1_##NAME (&s); \
+} \
+ \
+void \
+pass2_##NAME (struct B2_##NAME s) \
+{ \
+ checkp2_##NAME (&s); \
+} \
+ \
+void \
+pass3_##NAME (struct B3_##NAME s) \
+{ \
+ checkp3_##NAME (&s); \
+} \
+ \
+struct B1_##NAME \
+return1_##NAME (void) \
+{ \
+ return ab1_##NAME[0]; \
+} \
+ \
+struct B2_##NAME \
+return2_##NAME (void) \
+{ \
+ return ab2_##NAME[0]; \
+} \
+ \
+struct B3_##NAME \
+return3_##NAME (void) \
+{ \
+ return ab3_##NAME[0]; \
+}
+
+#define CHECK(NAME) test_##NAME()
+
+#if __INT_MAX__ > 32767
+SETUP (orig, 49, 1.0, 111111)
+#else
+SETUP (orig, 49, 1.0, 1111)
+#endif
+#ifndef SKIP_ATTRIBUTE
+#if __INT_MAX__ > 32767
+SETUP (p_all, 50, 2.0, 222222)
+SETUP (p_inner, 51, 3.0, 333333)
+SETUP (p_outer, 52, 4.0, 444444)
+SETUP (a_max, 53, 5.0, 555555)
+SETUP (m_outer_p_inner, 54, 6.0, 666666)
+SETUP (m_inner_p_outer, 55, 7.0, 777777)
+#else
+SETUP (p_all, 50, 2.0, 2222)
+SETUP (p_inner, 51, 3.0, 3333)
+SETUP (p_outer, 52, 4.0, 4444)
+SETUP (a_max, 53, 5.0, 5555)
+SETUP (m_outer_p_inner, 54, 6.0, 6666)
+SETUP (m_inner_p_outer, 55, 7.0, 7777)
+#endif
+#endif
+
+void
+struct_align_1_x (void)
+{
+ DEBUG_INIT
+
+ CHECK (orig);
+#ifndef SKIP_ATTRIBUTE
+ CHECK (p_all);
+ CHECK (p_inner);
+ CHECK (p_outer);
+ CHECK (a_max);
+ CHECK (m_outer_p_inner);
+ CHECK (m_inner_p_outer);
+#endif
+
+ DEBUG_FINI
+
+ if (fails != 0)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c
new file mode 100644
index 000000000..77cb09880
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c
@@ -0,0 +1,92 @@
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "compat-common.h"
+#include "struct-align-1.h"
+
+#define TEST(NAME) \
+extern char v1_##NAME; \
+extern double v2_##NAME; \
+extern int v3_##NAME; \
+ \
+extern struct B1_##NAME b1_##NAME, ab1_##NAME[2]; \
+extern struct B2_##NAME b2_##NAME, ab2_##NAME[2]; \
+extern struct B3_##NAME b3_##NAME, ab3_##NAME[2]; \
+ \
+extern void pass1_##NAME (struct B1_##NAME); \
+extern void pass2_##NAME (struct B2_##NAME); \
+extern void pass3_##NAME (struct B3_##NAME); \
+extern struct B1_##NAME return1_##NAME (void); \
+extern struct B2_##NAME return2_##NAME (void); \
+extern struct B3_##NAME return3_##NAME (void); \
+ \
+void \
+checkp1_##NAME (struct B1_##NAME *p) \
+{ \
+ if (p->c != v1_##NAME) \
+ DEBUG_CHECK; \
+ if (p->d != v2_##NAME) \
+ DEBUG_CHECK; \
+} \
+ \
+void \
+checkp2_##NAME (struct B2_##NAME *p) \
+{ \
+ if (p->c != v1_##NAME) \
+ DEBUG_CHECK; \
+ if (p->a2.d != v2_##NAME) \
+ DEBUG_CHECK; \
+} \
+ \
+void \
+checkp3_##NAME (struct B3_##NAME *p) \
+{ \
+ if (p->c != v1_##NAME) \
+ DEBUG_CHECK; \
+ if (p->a3.d != v2_##NAME) \
+ DEBUG_CHECK; \
+ if (p->a3.i != v3_##NAME) \
+ DEBUG_CHECK; \
+} \
+ \
+void \
+test_##NAME (void) \
+{ \
+ struct B1_##NAME s1; \
+ struct B2_##NAME s2; \
+ struct B3_##NAME s3; \
+ DEBUG_FPUTS (DESC_##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" global variable"); \
+ checkp1_##NAME (&b1_##NAME); \
+ checkp2_##NAME (&b2_##NAME); \
+ checkp3_##NAME (&b3_##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" global array"); \
+ checkp1_##NAME (&ab1_##NAME[1]); \
+ checkp2_##NAME (&ab2_##NAME[1]); \
+ checkp3_##NAME (&ab3_##NAME[1]); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" argument"); \
+ pass1_##NAME (b1_##NAME); \
+ pass2_##NAME (b2_##NAME); \
+ pass3_##NAME (b3_##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" function result"); \
+ s1 = return1_##NAME (); \
+ checkp1_##NAME (&s1); \
+ s2 = return2_##NAME (); \
+ checkp2_##NAME (&s2); \
+ s3 = return3_##NAME (); \
+ checkp3_##NAME (&s3); \
+ DEBUG_NL; \
+}
+
+TEST (orig)
+#ifndef SKIP_ATTRIBUTE
+TEST (p_all)
+TEST (p_inner)
+TEST (p_outer)
+TEST (a_max)
+TEST (m_outer_p_inner)
+TEST (m_inner_p_outer)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2.h
new file mode 100644
index 000000000..f94fe57e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2.h
@@ -0,0 +1,75 @@
+/* Define several variants of struct epoll_event from the Linux kernel,
+ specifying various attributes that affect alignment and size.
+
+ This test was developed for systems for which int is 32 bits and
+ long long is 64 bits; it might need to be disabled for systems where
+ either of those is not true. */
+
+#define DESC_orig "original"
+struct epoll_event_orig {
+ unsigned int events;
+ unsigned long long data;
+};
+
+#ifndef SKIP_ATTRIBUTE
+#define DESC_structmax "maximum useful struct alignment"
+struct epoll_event_structmax {
+ unsigned int events;
+ unsigned long long data;
+} __attribute__ ((aligned));
+
+
+#define DESC_struct4 "4-byte struct alignment"
+struct epoll_event_struct4 {
+ unsigned int events;
+ unsigned long long data;
+} __attribute__ ((aligned(4)));
+
+#define DESC_struct8 "8-byte struct alignment"
+struct epoll_event_struct8 {
+ unsigned int events;
+ unsigned long long data;
+} __attribute__ ((aligned(8)));
+
+#define DESC_data4 "4-byte alignment for data"
+struct epoll_event_data4 {
+ unsigned int events;
+ unsigned long long data __attribute__ ((aligned(4)));
+};
+
+#define DESC_data8 "8-byte alignment for data"
+struct epoll_event_data8 {
+ unsigned int events;
+ unsigned long long data __attribute__ ((aligned(8)));
+};
+
+#define DESC_p "packed attribute"
+struct epoll_event_p {
+ unsigned int events;
+ unsigned long long data;
+} __attribute__ ((packed));
+
+#define DESC_pstruct4 "packed attribute, 4-byte struct alignment"
+struct epoll_event_pstruct4 {
+ unsigned int events;
+ unsigned long long data;
+} __attribute__ ((packed)) __attribute__ ((aligned(4)));
+
+#define DESC_pstruct8 "packed attribute, 8-byte struct alignment"
+struct epoll_event_pstruct8 {
+ unsigned int events;
+ unsigned long long data;
+} __attribute__ ((packed)) __attribute__ ((aligned(8)));
+
+#define DESC_pdata4 "packed attribute, 4-byte alignment for data"
+struct epoll_event_pdata4 {
+ unsigned int events;
+ unsigned long long data __attribute__ ((aligned(4)));
+} __attribute__ ((packed));
+
+#define DESC_pdata8 "packed attribute, 8-byte alignment for data"
+struct epoll_event_pdata8 {
+ unsigned int events;
+ unsigned long long data __attribute__ ((aligned(8)));
+} __attribute__ ((packed));
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_main.c
new file mode 100644
index 000000000..b1dece1b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_main.c
@@ -0,0 +1,14 @@
+/* Test compatibility of structure layout and alignment for a struct
+ containing an int and a long long, with various combinations of
+ packed and aligned attributes. The struct is from the Linux kernel. */
+
+extern void struct_align_2_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_align_2_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_x.c
new file mode 100644
index 000000000..6bfc22268
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_x.c
@@ -0,0 +1,87 @@
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+/* Disable this test for 16-bit targets. */
+
+#include <limits.h>
+
+#if !(defined __GNUC__) || (INT_MAX > 32767)
+
+#include "compat-common.h"
+#include "struct-align-2.h"
+
+#define SETUP(NAME,V1,V2,V3) \
+struct outer_##NAME { \
+ int i; \
+ struct epoll_event_##NAME ee; \
+}; \
+ \
+unsigned int v1_##NAME = V1; \
+unsigned int v2_##NAME = V2; \
+unsigned long long v3_##NAME = V3; \
+ \
+struct outer_##NAME s_##NAME[2] = \
+ { {V1, { V2, V3 } }, { V1, { V2, V3 } } }; \
+ \
+extern void test_##NAME (void); \
+extern void checkp_##NAME (struct outer_##NAME *); \
+extern void checkg_##NAME (void); \
+ \
+void \
+pass_##NAME (struct outer_##NAME s) \
+{ \
+ checkp_##NAME (&s); \
+} \
+ \
+struct outer_##NAME \
+return_##NAME (void) \
+{ \
+ return s_##NAME[0]; \
+}
+
+#define CHECK(NAME) \
+ test_##NAME()
+
+SETUP (orig,101, 102, 0x0101010101010101ULL)
+#ifndef SKIP_ATTRIBUTE
+SETUP (structmax, 103, 104, 0x1212121212121212ULL)
+SETUP (struct4, 105, 106, 0x2323232323232323ULL)
+SETUP (struct8, 107, 108, 0x3434343434343434ULL)
+SETUP (data4, 109, 110, 0x4545454545454545ULL)
+SETUP (data8, 111, 112, 0x5656565656565656ULL)
+SETUP (p, 113, 114, 0x6767676767676767ULL)
+SETUP (pstruct4, 115, 116, 0x7878787878787878ULL)
+SETUP (pstruct8, 117, 118, 0x8989898989898989ULL)
+SETUP (pdata4, 119, 120, 0x9A9A9A9A9A9A9A9AULL)
+SETUP (pdata8, 121, 122, 0xABABABABABABABABULL)
+#endif
+
+void
+struct_align_2_x (void)
+{
+ DEBUG_INIT
+
+ CHECK (orig);
+#ifndef SKIP_ATTRIBUTE
+ CHECK (structmax);
+ CHECK (struct4);
+ CHECK (struct8);
+ CHECK (data4);
+ CHECK (data8);
+ CHECK (p);
+ CHECK (pstruct4);
+ CHECK (pstruct8);
+ CHECK (pdata4);
+ CHECK (pdata8);
+#endif
+
+ DEBUG_FINI
+
+ if (fails != 0)
+ abort ();
+}
+
+#else
+
+void struct_align_2_x (void) {}
+
+#endif /* INT_MAX */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_y.c
new file mode 100644
index 000000000..2727015a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-align-2_y.c
@@ -0,0 +1,75 @@
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+/* Disable this test for 16-bit targets. */
+
+#include <limits.h>
+
+#if !(defined __GNUC__) || (INT_MAX > 32767)
+
+#include "compat-common.h"
+#include "struct-align-2.h"
+
+#define TEST(NAME) \
+struct outer_##NAME { \
+ int i; \
+ struct epoll_event_##NAME ee; \
+}; \
+ \
+extern unsigned int v1_##NAME; \
+extern unsigned int v2_##NAME; \
+extern unsigned long long v3_##NAME; \
+ \
+extern struct outer_##NAME s_##NAME[2]; \
+ \
+extern void pass_##NAME (struct outer_##NAME); \
+extern struct outer_##NAME return_##NAME (void); \
+ \
+void \
+checkp_##NAME (struct outer_##NAME *p) \
+{ \
+ if (p->i != v1_##NAME) \
+ DEBUG_CHECK; \
+ if (p->ee.events != v2_##NAME) \
+ DEBUG_CHECK; \
+ if (p->ee.data != v3_##NAME) \
+ DEBUG_CHECK; \
+} \
+ \
+void \
+test_##NAME (void) \
+{ \
+ struct outer_##NAME s; \
+ DEBUG_FPUTS (DESC_##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" global array"); \
+ checkp_##NAME (&s_##NAME[0]); \
+ checkp_##NAME (&s_##NAME[1]); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" argument"); \
+ pass_##NAME (s_##NAME[0]); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" function result"); \
+ s = return_##NAME (); \
+ checkp_##NAME (&s); \
+ DEBUG_NL; \
+}
+
+TEST (orig)
+#ifndef SKIP_ATTRIBUTE
+TEST (structmax)
+TEST (struct4)
+TEST (struct8)
+TEST (data4)
+TEST (data8)
+TEST (p)
+TEST (pstruct4)
+TEST (pstruct8)
+TEST (pdata4)
+TEST (pdata8)
+#endif
+
+#else
+
+int i; /* prevent compiling an empty file */
+
+#endif /* INT_MAX */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_main.c
new file mode 100644
index 000000000..e41b93c57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are floating
+ point scalars. */
+
+extern void struct_by_value_10_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_10_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c
new file mode 100644
index 000000000..5954104aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_x.c
@@ -0,0 +1,184 @@
+#include "compat-common.h"
+
+#include "fp2-struct-defs.h"
+#include "fp2-struct-check.h"
+
+#define TEST(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, double x); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, (double)1); \
+ init##TYPE ( &g2s##TYPE, (double)2); \
+ init##TYPE ( &g3s##TYPE, (double)3); \
+ init##TYPE ( &g4s##TYPE, (double)4); \
+ init##TYPE ( &g5s##TYPE, (double)5); \
+ init##TYPE ( &g6s##TYPE, (double)6); \
+ init##TYPE ( &g7s##TYPE, (double)7); \
+ init##TYPE ( &g8s##TYPE, (double)8); \
+ init##TYPE ( &g9s##TYPE, (double)9); \
+ init##TYPE (&g10s##TYPE, (double)10); \
+ init##TYPE (&g11s##TYPE, (double)11); \
+ init##TYPE (&g12s##TYPE, (double)12); \
+ init##TYPE (&g13s##TYPE, (double)13); \
+ init##TYPE (&g14s##TYPE, (double)14); \
+ init##TYPE (&g15s##TYPE, (double)15); \
+ init##TYPE (&g16s##TYPE, (double)16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+TEST(Sfd)
+TEST(Sfl)
+TEST(Sdf)
+TEST(Sdl)
+TEST(Slf)
+TEST(Sld)
+TEST(Sfdl)
+TEST(Sfld)
+TEST(Sdfl)
+TEST(Sdlf)
+TEST(Slfd)
+TEST(Sldf)
+
+#undef T
+
+void
+struct_by_value_10_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Sfd)
+T(Sfl)
+T(Sdf)
+T(Sdl)
+T(Slf)
+T(Sld)
+T(Sfdl)
+T(Sfld)
+T(Sdfl)
+T(Sdlf)
+T(Slfd)
+T(Sldf)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_y.c
new file mode 100644
index 000000000..6c9589d02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-10_y.c
@@ -0,0 +1,95 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp2-struct-defs.h"
+#include "fp2-struct-init.h"
+
+#define TEST(TYPE) \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void check##TYPE (TYPE x, double y); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, (double)1); \
+ check##TYPE ( g2s##TYPE, (double)2); \
+ check##TYPE ( g3s##TYPE, (double)3); \
+ check##TYPE ( g4s##TYPE, (double)4); \
+ check##TYPE ( g5s##TYPE, (double)5); \
+ check##TYPE ( g6s##TYPE, (double)6); \
+ check##TYPE ( g7s##TYPE, (double)7); \
+ check##TYPE ( g8s##TYPE, (double)8); \
+ check##TYPE ( g9s##TYPE, (double)9); \
+ check##TYPE ( g10s##TYPE, (double)10); \
+ check##TYPE ( g11s##TYPE, (double)11); \
+ check##TYPE ( g12s##TYPE, (double)12); \
+ check##TYPE ( g13s##TYPE, (double)13); \
+ check##TYPE ( g14s##TYPE, (double)14); \
+ check##TYPE ( g15s##TYPE, (double)15); \
+ check##TYPE ( g16s##TYPE, (double)16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, (double)1); \
+ check##TYPE (s2, (double)2); \
+ check##TYPE (s3, (double)3); \
+ check##TYPE (s4, (double)4); \
+ check##TYPE (s5, (double)5); \
+ check##TYPE (s6, (double)6); \
+ check##TYPE (s7, (double)7); \
+ check##TYPE (s8, (double)8); \
+ check##TYPE (s9, (double)9); \
+ check##TYPE (s10, (double)10); \
+ check##TYPE (s11, (double)11); \
+ check##TYPE (s12, (double)12); \
+ check##TYPE (s13, (double)13); \
+ check##TYPE (s14, (double)14); \
+ check##TYPE (s15, (double)15); \
+ check##TYPE (s16, (double)16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, (double)i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+TEST(Sfd)
+TEST(Sfl)
+TEST(Sdf)
+TEST(Sdl)
+TEST(Slf)
+TEST(Sld)
+TEST(Sfdl)
+TEST(Sfld)
+TEST(Sdfl)
+TEST(Sdlf)
+TEST(Slfd)
+TEST(Sldf)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_main.c
new file mode 100644
index 000000000..400e94c2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex char. */
+
+extern void struct_by_value_11_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_11_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c
new file mode 100644
index 000000000..cea1ac096
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_x.c
@@ -0,0 +1,63 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(cc, _Complex char)
+CHECKS(cc, _Complex char)
+
+TEST(Scc1, _Complex char)
+TEST(Scc2, _Complex char)
+TEST(Scc3, _Complex char)
+TEST(Scc4, _Complex char)
+TEST(Scc5, _Complex char)
+TEST(Scc6, _Complex char)
+TEST(Scc7, _Complex char)
+TEST(Scc8, _Complex char)
+TEST(Scc9, _Complex char)
+TEST(Scc10, _Complex char)
+TEST(Scc11, _Complex char)
+TEST(Scc12, _Complex char)
+TEST(Scc13, _Complex char)
+TEST(Scc14, _Complex char)
+TEST(Scc15, _Complex char)
+TEST(Scc16, _Complex char)
+#endif
+
+#undef T
+
+void
+struct_by_value_11_x ()
+{
+#ifndef SKIP_COMPLEX_INT
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Scc1, _Complex char)
+T(Scc2, _Complex char)
+T(Scc3, _Complex char)
+T(Scc4, _Complex char)
+T(Scc5, _Complex char)
+T(Scc6, _Complex char)
+T(Scc7, _Complex char)
+T(Scc8, _Complex char)
+T(Scc9, _Complex char)
+T(Scc10, _Complex char)
+T(Scc11, _Complex char)
+T(Scc12, _Complex char)
+T(Scc13, _Complex char)
+T(Scc14, _Complex char)
+T(Scc15, _Complex char)
+T(Scc16, _Complex char)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_y.c
new file mode 100644
index 000000000..c4e47fc35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-11_y.c
@@ -0,0 +1,35 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(cc,_Complex char)
+INITS(cc, _Complex char)
+
+TEST(Scc1, _Complex char)
+TEST(Scc2, _Complex char)
+TEST(Scc3, _Complex char)
+TEST(Scc4, _Complex char)
+TEST(Scc5, _Complex char)
+TEST(Scc6, _Complex char)
+TEST(Scc7, _Complex char)
+TEST(Scc8, _Complex char)
+TEST(Scc9, _Complex char)
+TEST(Scc10, _Complex char)
+TEST(Scc11, _Complex char)
+TEST(Scc12, _Complex char)
+TEST(Scc13, _Complex char)
+TEST(Scc14, _Complex char)
+TEST(Scc15, _Complex char)
+TEST(Scc16, _Complex char)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_main.c
new file mode 100644
index 000000000..ab4faac09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex short. */
+
+extern void struct_by_value_12_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_12_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c
new file mode 100644
index 000000000..925ce9270
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_x.c
@@ -0,0 +1,63 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(cs, _Complex short)
+CHECKS(cs, _Complex short)
+
+TEST(Scs1, _Complex short)
+TEST(Scs2, _Complex short)
+TEST(Scs3, _Complex short)
+TEST(Scs4, _Complex short)
+TEST(Scs5, _Complex short)
+TEST(Scs6, _Complex short)
+TEST(Scs7, _Complex short)
+TEST(Scs8, _Complex short)
+TEST(Scs9, _Complex short)
+TEST(Scs10, _Complex short)
+TEST(Scs11, _Complex short)
+TEST(Scs12, _Complex short)
+TEST(Scs13, _Complex short)
+TEST(Scs14, _Complex short)
+TEST(Scs15, _Complex short)
+TEST(Scs16, _Complex short)
+#endif
+
+#undef T
+
+void
+struct_by_value_12_x ()
+{
+#ifndef SKIP_COMPLEX_INT
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Scs1, _Complex short)
+T(Scs2, _Complex short)
+T(Scs3, _Complex short)
+T(Scs4, _Complex short)
+T(Scs5, _Complex short)
+T(Scs6, _Complex short)
+T(Scs7, _Complex short)
+T(Scs8, _Complex short)
+T(Scs9, _Complex short)
+T(Scs10, _Complex short)
+T(Scs11, _Complex short)
+T(Scs12, _Complex short)
+T(Scs13, _Complex short)
+T(Scs14, _Complex short)
+T(Scs15, _Complex short)
+T(Scs16, _Complex short)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_y.c
new file mode 100644
index 000000000..2e8e393ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-12_y.c
@@ -0,0 +1,35 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(cs,_Complex short)
+INITS(cs, _Complex short)
+
+TEST(Scs1, _Complex short)
+TEST(Scs2, _Complex short)
+TEST(Scs3, _Complex short)
+TEST(Scs4, _Complex short)
+TEST(Scs5, _Complex short)
+TEST(Scs6, _Complex short)
+TEST(Scs7, _Complex short)
+TEST(Scs8, _Complex short)
+TEST(Scs9, _Complex short)
+TEST(Scs10, _Complex short)
+TEST(Scs11, _Complex short)
+TEST(Scs12, _Complex short)
+TEST(Scs13, _Complex short)
+TEST(Scs14, _Complex short)
+TEST(Scs15, _Complex short)
+TEST(Scs16, _Complex short)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_main.c
new file mode 100644
index 000000000..b853bb88e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are type
+ _Complex int. */
+
+extern void struct_by_value_l3_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_13_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c
new file mode 100644
index 000000000..f27222f2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c
@@ -0,0 +1,63 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(ci, _Complex int)
+CHECKS(ci, _Complex int)
+
+TEST(Sci1, _Complex int)
+TEST(Sci2, _Complex int)
+TEST(Sci3, _Complex int)
+TEST(Sci4, _Complex int)
+TEST(Sci5, _Complex int)
+TEST(Sci6, _Complex int)
+TEST(Sci7, _Complex int)
+TEST(Sci8, _Complex int)
+TEST(Sci9, _Complex int)
+TEST(Sci10, _Complex int)
+TEST(Sci11, _Complex int)
+TEST(Sci12, _Complex int)
+TEST(Sci13, _Complex int)
+TEST(Sci14, _Complex int)
+TEST(Sci15, _Complex int)
+TEST(Sci16, _Complex int)
+#endif
+
+#undef T
+
+void
+struct_by_value_13_x ()
+{
+#ifndef SKIP_COMPLEX_INT
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Sci1, _Complex int)
+T(Sci2, _Complex int)
+T(Sci3, _Complex int)
+T(Sci4, _Complex int)
+T(Sci5, _Complex int)
+T(Sci6, _Complex int)
+T(Sci7, _Complex int)
+T(Sci8, _Complex int)
+T(Sci9, _Complex int)
+T(Sci10, _Complex int)
+T(Sci11, _Complex int)
+T(Sci12, _Complex int)
+T(Sci13, _Complex int)
+T(Sci14, _Complex int)
+T(Sci15, _Complex int)
+T(Sci16, _Complex int)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_y.c
new file mode 100644
index 000000000..7a3657e0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-13_y.c
@@ -0,0 +1,35 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(ci,_Complex int)
+INITS(ci, _Complex int)
+
+TEST(Sci1, _Complex int)
+TEST(Sci2, _Complex int)
+TEST(Sci3, _Complex int)
+TEST(Sci4, _Complex int)
+TEST(Sci5, _Complex int)
+TEST(Sci6, _Complex int)
+TEST(Sci7, _Complex int)
+TEST(Sci8, _Complex int)
+TEST(Sci9, _Complex int)
+TEST(Sci10, _Complex int)
+TEST(Sci11, _Complex int)
+TEST(Sci12, _Complex int)
+TEST(Sci13, _Complex int)
+TEST(Sci14, _Complex int)
+TEST(Sci15, _Complex int)
+TEST(Sci16, _Complex int)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_main.c
new file mode 100644
index 000000000..a332e93b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex long. */
+
+extern void struct_by_value_14_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_14_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c
new file mode 100644
index 000000000..bb8db7072
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_x.c
@@ -0,0 +1,63 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(cl, _Complex long)
+CHECKS(cl, _Complex long)
+
+TEST(Scl1, _Complex long)
+TEST(Scl2, _Complex long)
+TEST(Scl3, _Complex long)
+TEST(Scl4, _Complex long)
+TEST(Scl5, _Complex long)
+TEST(Scl6, _Complex long)
+TEST(Scl7, _Complex long)
+TEST(Scl8, _Complex long)
+TEST(Scl9, _Complex long)
+TEST(Scl10, _Complex long)
+TEST(Scl11, _Complex long)
+TEST(Scl12, _Complex long)
+TEST(Scl13, _Complex long)
+TEST(Scl14, _Complex long)
+TEST(Scl15, _Complex long)
+TEST(Scl16, _Complex long)
+#endif
+
+#undef T
+
+void
+struct_by_value_14_x ()
+{
+#ifndef SKIP_COMPLEX_INT
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Scl1, _Complex long)
+T(Scl2, _Complex long)
+T(Scl3, _Complex long)
+T(Scl4, _Complex long)
+T(Scl5, _Complex long)
+T(Scl6, _Complex long)
+T(Scl7, _Complex long)
+T(Scl8, _Complex long)
+T(Scl9, _Complex long)
+T(Scl10, _Complex long)
+T(Scl11, _Complex long)
+T(Scl12, _Complex long)
+T(Scl13, _Complex long)
+T(Scl14, _Complex long)
+T(Scl15, _Complex long)
+T(Scl16, _Complex long)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_y.c
new file mode 100644
index 000000000..5abd063ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-14_y.c
@@ -0,0 +1,35 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(cl,_Complex long)
+INITS(cl, _Complex long)
+
+TEST(Scl1, _Complex long)
+TEST(Scl2, _Complex long)
+TEST(Scl3, _Complex long)
+TEST(Scl4, _Complex long)
+TEST(Scl5, _Complex long)
+TEST(Scl6, _Complex long)
+TEST(Scl7, _Complex long)
+TEST(Scl8, _Complex long)
+TEST(Scl9, _Complex long)
+TEST(Scl10, _Complex long)
+TEST(Scl11, _Complex long)
+TEST(Scl12, _Complex long)
+TEST(Scl13, _Complex long)
+TEST(Scl14, _Complex long)
+TEST(Scl15, _Complex long)
+TEST(Scl16, _Complex long)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_main.c
new file mode 100644
index 000000000..6e5d8e0f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex long long. */
+
+extern void struct_by_value_15_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_15_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c
new file mode 100644
index 000000000..4409c9668
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_x.c
@@ -0,0 +1,63 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(cll, _Complex long long)
+CHECKS(cll, _Complex long long)
+
+TEST(Scll1, _Complex long long)
+TEST(Scll2, _Complex long long)
+TEST(Scll3, _Complex long long)
+TEST(Scll4, _Complex long long)
+TEST(Scll5, _Complex long long)
+TEST(Scll6, _Complex long long)
+TEST(Scll7, _Complex long long)
+TEST(Scll8, _Complex long long)
+TEST(Scll9, _Complex long long)
+TEST(Scll10, _Complex long long)
+TEST(Scll11, _Complex long long)
+TEST(Scll12, _Complex long long)
+TEST(Scll13, _Complex long long)
+TEST(Scll14, _Complex long long)
+TEST(Scll15, _Complex long long)
+TEST(Scll16, _Complex long long)
+#endif
+
+#undef T
+
+void
+struct_by_value_15_x ()
+{
+#ifndef SKIP_COMPLEX_INT
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Scll1, _Complex long long)
+T(Scll2, _Complex long long)
+T(Scll3, _Complex long long)
+T(Scll4, _Complex long long)
+T(Scll5, _Complex long long)
+T(Scll6, _Complex long long)
+T(Scll7, _Complex long long)
+T(Scll8, _Complex long long)
+T(Scll9, _Complex long long)
+T(Scll10, _Complex long long)
+T(Scll11, _Complex long long)
+T(Scll12, _Complex long long)
+T(Scll13, _Complex long long)
+T(Scll14, _Complex long long)
+T(Scll15, _Complex long long)
+T(Scll16, _Complex long long)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_y.c
new file mode 100644
index 000000000..a5fec4fdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-15_y.c
@@ -0,0 +1,35 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX_INT
+DEFS(cll,_Complex long long)
+INITS(cll, _Complex long long)
+
+TEST(Scll1, _Complex long long)
+TEST(Scll2, _Complex long long)
+TEST(Scll3, _Complex long long)
+TEST(Scll4, _Complex long long)
+TEST(Scll5, _Complex long long)
+TEST(Scll6, _Complex long long)
+TEST(Scll7, _Complex long long)
+TEST(Scll8, _Complex long long)
+TEST(Scll9, _Complex long long)
+TEST(Scll10, _Complex long long)
+TEST(Scll11, _Complex long long)
+TEST(Scll12, _Complex long long)
+TEST(Scll13, _Complex long long)
+TEST(Scll14, _Complex long long)
+TEST(Scll15, _Complex long long)
+TEST(Scll16, _Complex long long)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_main.c
new file mode 100644
index 000000000..ecd60d1e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_main.c
@@ -0,0 +1,15 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex float. */
+/* { dg-skip-if "Program too big" { "avr-*-*" } { "*" } { "" } } */
+
+extern void struct_by_value_16_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_16_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
new file mode 100644
index 000000000..05e36fe26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_x.c
@@ -0,0 +1,55 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cf, _Complex float)
+CHECKS(cf, _Complex float)
+
+TEST(Scf1, _Complex float)
+TEST(Scf2, _Complex float)
+TEST(Scf3, _Complex float)
+TEST(Scf4, _Complex float)
+TEST(Scf5, _Complex float)
+TEST(Scf6, _Complex float)
+TEST(Scf7, _Complex float)
+TEST(Scf8, _Complex float)
+TEST(Scf9, _Complex float)
+TEST(Scf10, _Complex float)
+TEST(Scf11, _Complex float)
+TEST(Scf12, _Complex float)
+#endif
+
+#undef T
+
+void
+struct_by_value_16_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+#ifndef SKIP_COMPLEX
+T(Scf1, _Complex float)
+T(Scf2, _Complex float)
+T(Scf3, _Complex float)
+T(Scf4, _Complex float)
+T(Scf5, _Complex float)
+T(Scf6, _Complex float)
+T(Scf7, _Complex float)
+T(Scf8, _Complex float)
+T(Scf9, _Complex float)
+T(Scf10, _Complex float)
+T(Scf11, _Complex float)
+T(Scf12, _Complex float)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c
new file mode 100644
index 000000000..ce99a68a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16_y.c
@@ -0,0 +1,31 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cf,_Complex float)
+INITS(cf, _Complex float)
+
+TEST(Scf1, _Complex float)
+TEST(Scf2, _Complex float)
+TEST(Scf3, _Complex float)
+TEST(Scf4, _Complex float)
+TEST(Scf5, _Complex float)
+TEST(Scf6, _Complex float)
+TEST(Scf7, _Complex float)
+TEST(Scf8, _Complex float)
+TEST(Scf9, _Complex float)
+TEST(Scf10, _Complex float)
+TEST(Scf11, _Complex float)
+TEST(Scf12, _Complex float)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_main.c
new file mode 100644
index 000000000..6a71d15b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex float. */
+
+extern void struct_by_value_16_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_16a_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
new file mode 100644
index 000000000..f563f6ea9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_x.c
@@ -0,0 +1,39 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cf, _Complex float)
+CHECKS(cf, _Complex float)
+
+TEST(Scf13, _Complex float)
+TEST(Scf14, _Complex float)
+TEST(Scf15, _Complex float)
+TEST(Scf16, _Complex float)
+#endif
+
+#undef T
+
+void
+struct_by_value_16a_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+#ifndef SKIP_COMPLEX
+T(Scf13, _Complex float)
+T(Scf14, _Complex float)
+T(Scf15, _Complex float)
+T(Scf16, _Complex float)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c
new file mode 100644
index 000000000..0575b3c1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-16a_y.c
@@ -0,0 +1,23 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cf,_Complex float)
+INITS(cf, _Complex float)
+
+TEST(Scf13, _Complex float)
+TEST(Scf14, _Complex float)
+TEST(Scf15, _Complex float)
+TEST(Scf16, _Complex float)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_main.c
new file mode 100644
index 000000000..8787877e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_main.c
@@ -0,0 +1,15 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex double. */
+/* { dg-skip-if "Program too big" { "avr-*-*" } { "*" } { "" } } */
+
+extern void struct_by_value_17_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_17_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
new file mode 100644
index 000000000..8c2704522
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_x.c
@@ -0,0 +1,55 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cd, _Complex double)
+CHECKS(cd, _Complex double)
+
+TEST(Scd1, _Complex double)
+TEST(Scd2, _Complex double)
+TEST(Scd3, _Complex double)
+TEST(Scd4, _Complex double)
+TEST(Scd5, _Complex double)
+TEST(Scd6, _Complex double)
+TEST(Scd7, _Complex double)
+TEST(Scd8, _Complex double)
+TEST(Scd9, _Complex double)
+TEST(Scd10, _Complex double)
+TEST(Scd11, _Complex double)
+TEST(Scd12, _Complex double)
+#endif
+
+#undef T
+
+void
+struct_by_value_17_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+#ifndef SKIP_COMPLEX
+T(Scd1, _Complex double)
+T(Scd2, _Complex double)
+T(Scd3, _Complex double)
+T(Scd4, _Complex double)
+T(Scd5, _Complex double)
+T(Scd6, _Complex double)
+T(Scd7, _Complex double)
+T(Scd8, _Complex double)
+T(Scd9, _Complex double)
+T(Scd10, _Complex double)
+T(Scd11, _Complex double)
+T(Scd12, _Complex double)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c
new file mode 100644
index 000000000..d05ff8407
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17_y.c
@@ -0,0 +1,31 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cd,_Complex double)
+INITS(cd, _Complex double)
+
+TEST(Scd1, _Complex double)
+TEST(Scd2, _Complex double)
+TEST(Scd3, _Complex double)
+TEST(Scd4, _Complex double)
+TEST(Scd5, _Complex double)
+TEST(Scd6, _Complex double)
+TEST(Scd7, _Complex double)
+TEST(Scd8, _Complex double)
+TEST(Scd9, _Complex double)
+TEST(Scd10, _Complex double)
+TEST(Scd11, _Complex double)
+TEST(Scd12, _Complex double)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_main.c
new file mode 100644
index 000000000..1db00215f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex double. */
+
+extern void struct_by_value_17_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_17a_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c
new file mode 100644
index 000000000..804b5c255
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_x.c
@@ -0,0 +1,39 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cd, _Complex double)
+CHECKS(cd, _Complex double)
+
+TEST(Scd13, _Complex double)
+TEST(Scd14, _Complex double)
+TEST(Scd15, _Complex double)
+TEST(Scd16, _Complex double)
+#endif
+
+#undef T
+
+void
+struct_by_value_17a_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+#ifndef SKIP_COMPLEX
+T(Scd13, _Complex double)
+T(Scd14, _Complex double)
+T(Scd15, _Complex double)
+T(Scd16, _Complex double)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c
new file mode 100644
index 000000000..3119e5448
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-17a_y.c
@@ -0,0 +1,23 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cd,_Complex double)
+INITS(cd, _Complex double)
+
+TEST(Scd13, _Complex double)
+TEST(Scd14, _Complex double)
+TEST(Scd15, _Complex double)
+TEST(Scd16, _Complex double)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_main.c
new file mode 100644
index 000000000..0ecc66041
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_main.c
@@ -0,0 +1,15 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex long double. */
+/* { dg-skip-if "Program too big" { "avr-*-*" } { "*" } { "" } } */
+
+extern void struct_by_value_18_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_18_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
new file mode 100644
index 000000000..aa10a6e1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_x.c
@@ -0,0 +1,55 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cld, _Complex long double)
+CHECKS(cld, _Complex long double)
+
+TEST(Scld1, _Complex long double)
+TEST(Scld2, _Complex long double)
+TEST(Scld3, _Complex long double)
+TEST(Scld4, _Complex long double)
+TEST(Scld5, _Complex long double)
+TEST(Scld6, _Complex long double)
+TEST(Scld7, _Complex long double)
+TEST(Scld8, _Complex long double)
+TEST(Scld9, _Complex long double)
+TEST(Scld10, _Complex long double)
+TEST(Scld11, _Complex long double)
+TEST(Scld12, _Complex long double)
+#endif
+
+#undef T
+
+void
+struct_by_value_18_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+#ifndef SKIP_COMPLEX
+T(Scld1, _Complex long double)
+T(Scld2, _Complex long double)
+T(Scld3, _Complex long double)
+T(Scld4, _Complex long double)
+T(Scld5, _Complex long double)
+T(Scld6, _Complex long double)
+T(Scld7, _Complex long double)
+T(Scld8, _Complex long double)
+T(Scld9, _Complex long double)
+T(Scld10, _Complex long double)
+T(Scld11, _Complex long double)
+T(Scld12, _Complex long double)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c
new file mode 100644
index 000000000..d98debb6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18_y.c
@@ -0,0 +1,31 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cld,_Complex long double)
+INITS(cld, _Complex long double)
+
+TEST(Scld1, _Complex long double)
+TEST(Scld2, _Complex long double)
+TEST(Scld3, _Complex long double)
+TEST(Scld4, _Complex long double)
+TEST(Scld5, _Complex long double)
+TEST(Scld6, _Complex long double)
+TEST(Scld7, _Complex long double)
+TEST(Scld8, _Complex long double)
+TEST(Scld9, _Complex long double)
+TEST(Scld10, _Complex long double)
+TEST(Scld11, _Complex long double)
+TEST(Scld12, _Complex long double)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_main.c
new file mode 100644
index 000000000..5b9dfd983
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are of type
+ _Complex long double. */
+
+extern void struct_by_value_18_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_18a_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c
new file mode 100644
index 000000000..986c4dded
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_x.c
@@ -0,0 +1,39 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cld, _Complex long double)
+CHECKS(cld, _Complex long double)
+
+TEST(Scld13, _Complex long double)
+TEST(Scld14, _Complex long double)
+TEST(Scld15, _Complex long double)
+TEST(Scld16, _Complex long double)
+#endif
+
+#undef T
+
+void
+struct_by_value_18a_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+#ifndef SKIP_COMPLEX
+T(Scld13, _Complex long double)
+T(Scld14, _Complex long double)
+T(Scld15, _Complex long double)
+T(Scld16, _Complex long double)
+#endif
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c
new file mode 100644
index 000000000..12ac53418
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-18a_y.c
@@ -0,0 +1,23 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+#ifndef SKIP_COMPLEX
+DEFS(cld,_Complex long double)
+INITS(cld, _Complex long double)
+
+TEST(Scld13, _Complex long double)
+TEST(Scld14, _Complex long double)
+TEST(Scld15, _Complex long double)
+TEST(Scld16, _Complex long double)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_main.c
new file mode 100644
index 000000000..b0eed4c3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_main.c
@@ -0,0 +1,17 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list. Struct members are char, int, double,
+ and other structs containing these types. This test was written in
+ response to a layout change for such structs for powerpc64-linux,
+ but this test only checks similar structs that are not affected by
+ that break in compatibility. */
+
+extern void struct_by_value_19_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_19_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_x.c
new file mode 100644
index 000000000..4ccedfde3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_x.c
@@ -0,0 +1,178 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, 1); \
+ init##TYPE ( &g2s##TYPE, 2); \
+ init##TYPE ( &g3s##TYPE, 3); \
+ init##TYPE ( &g4s##TYPE, 4); \
+ init##TYPE ( &g5s##TYPE, 5); \
+ init##TYPE ( &g6s##TYPE, 6); \
+ init##TYPE ( &g7s##TYPE, 7); \
+ init##TYPE ( &g8s##TYPE, 8); \
+ init##TYPE ( &g9s##TYPE, 9); \
+ init##TYPE (&g10s##TYPE, 10); \
+ init##TYPE (&g11s##TYPE, 11); \
+ init##TYPE (&g12s##TYPE, 12); \
+ init##TYPE (&g13s##TYPE, 13); \
+ init##TYPE (&g14s##TYPE, 14); \
+ init##TYPE (&g15s##TYPE, 15); \
+ init##TYPE (&g16s##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2:"); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
+
+#undef T
+
+void
+struct_by_value_19_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c
new file mode 100644
index 000000000..036c6b618
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c
@@ -0,0 +1,104 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "mixed-struct-defs.h"
+
+extern void checkScd (Scd x, int i);
+extern void checkScdc (Scdc x, int i);
+extern void checkSd (Sd x, int i);
+extern void checkSdi (Sdi x, int i);
+extern void checkScsds (Scsds x, int i);
+extern void checkScsdsc (Scsdsc x, int i);
+extern void checkScsdis (Scsdis x, int i);
+extern void checkScsdisc (Scsdisc x, int i);
+extern void checkSsds (Ssds x, int i);
+extern void checkSsdsc (Ssdsc x, int i);
+extern void checkScssdss (Scssdss x, int i);
+extern void checkScssdssc (Scssdssc x, int i);
+
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, 1); \
+ check##TYPE ( g2s##TYPE, 2); \
+ check##TYPE ( g3s##TYPE, 3); \
+ check##TYPE ( g4s##TYPE, 4); \
+ check##TYPE ( g5s##TYPE, 5); \
+ check##TYPE ( g6s##TYPE, 6); \
+ check##TYPE ( g7s##TYPE, 7); \
+ check##TYPE ( g8s##TYPE, 8); \
+ check##TYPE ( g9s##TYPE, 9); \
+ check##TYPE ( g10s##TYPE, 10); \
+ check##TYPE ( g11s##TYPE, 11); \
+ check##TYPE ( g12s##TYPE, 12); \
+ check##TYPE ( g13s##TYPE, 13); \
+ check##TYPE ( g14s##TYPE, 14); \
+ check##TYPE ( g15s##TYPE, 15); \
+ check##TYPE ( g16s##TYPE, 16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, 1); \
+ check##TYPE (s2, 2); \
+ check##TYPE (s3, 3); \
+ check##TYPE (s4, 4); \
+ check##TYPE (s5, 5); \
+ check##TYPE (s6, 6); \
+ check##TYPE (s7, 7); \
+ check##TYPE (s8, 8); \
+ check##TYPE (s9, 9); \
+ check##TYPE (s10, 10); \
+ check##TYPE (s11, 11); \
+ check##TYPE (s12, 12); \
+ check##TYPE (s13, 13); \
+ check##TYPE (s14, 14); \
+ check##TYPE (s15, 15); \
+ check##TYPE (s16, 16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_main.c
new file mode 100644
index 000000000..d2f9de505
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_main.c
@@ -0,0 +1,12 @@
+/* Test structure passing by value, using a test from gcc.dg.
+ Each struct that is passed contains an array of unsigned char. */
+
+extern void struct_by_value_1_x (void);
+extern void exit (int);
+
+int
+main ()
+{
+ struct_by_value_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_x.c
new file mode 100644
index 000000000..67ac16d1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_x.c
@@ -0,0 +1,69 @@
+#define T(N) \
+struct S##N { unsigned char i[N]; }; \
+struct S##N g1s##N, g2s##N, g3s##N; \
+ \
+extern void init##N (struct S##N *p, int i); \
+extern void checkg##N (void); \
+extern void test##N (struct S##N s1, \
+ struct S##N s2, struct S##N s3); \
+ \
+void \
+check##N (struct S##N x, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ if (x.i[j] != i + j) abort (); \
+} \
+ \
+void \
+test2_##N (struct S##N s1, struct S##N s2) \
+{ \
+ test##N (s1, g2s##N, s2); \
+} \
+ \
+void \
+testit##N (void) \
+{ \
+ init##N (&g1s##N, 64); \
+ init##N (&g2s##N, 128); \
+ init##N (&g3s##N, 192); \
+ checkg##N (); \
+ test##N (g1s##N, g2s##N, g3s##N); \
+ test2_##N (g1s##N, g3s##N); \
+}
+
+extern void abort (void);
+
+#ifndef SKIP_ZERO_ARRAY
+T(0)
+#endif
+T(1) T(2) T(3) T(4) T(5) T(6) T(7)
+T(8) T(9) T(10) T(11) T(12) T(13) T(14) T(15)
+T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23)
+T(24) T(25) T(26) T(27) T(28) T(29) T(30) T(31)
+T(32) T(33) T(34) T(35) T(36) T(37) T(38) T(39)
+T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47)
+T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55)
+T(56) T(57) T(58) T(59) T(60) T(61) T(62) T(63)
+
+#undef T
+
+void
+struct_by_value_1_x ()
+{
+#define T(N) testit##N ();
+
+#ifndef SKIP_ZERO_ARRAY
+T(0)
+#endif
+T(1) T(2) T(3) T(4) T(5) T(6) T(7)
+T(8) T(9) T(10) T(11) T(12) T(13) T(14) T(15)
+T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23)
+T(24) T(25) T(26) T(27) T(28) T(29) T(30) T(31)
+T(32) T(33) T(34) T(35) T(36) T(37) T(38) T(39)
+T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47)
+T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55)
+T(56) T(57) T(58) T(59) T(60) T(61) T(62) T(63)
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_y.c
new file mode 100644
index 000000000..8370dbac3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-1_y.c
@@ -0,0 +1,43 @@
+#define T(N) \
+struct S##N { unsigned char i[N]; }; \
+extern struct S##N g1s##N, g2s##N, g3s##N; \
+ \
+extern void check##N (struct S##N x, int i); \
+extern void test2_##N (struct S##N s1, struct S##N s2); \
+ \
+void \
+init##N (struct S##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ p->i[j] = i + j; \
+} \
+ \
+void \
+checkg##N (void) \
+{ \
+ check##N (g1s##N, 64); \
+ check##N (g2s##N, 128); \
+ check##N (g3s##N, 192); \
+} \
+ \
+void \
+test##N (struct S##N s1, struct S##N s2, \
+ struct S##N s3) \
+{ \
+ check##N (s1, 64); \
+ check##N (s2, 128); \
+ check##N (s3, 192); \
+}
+
+#ifndef SKIP_ZERO_ARRAY
+T(0)
+#endif
+T(1) T(2) T(3) T(4) T(5) T(6) T(7)
+T(8) T(9) T(10) T(11) T(12) T(13) T(14) T(15)
+T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23)
+T(24) T(25) T(26) T(27) T(28) T(29) T(30) T(31)
+T(32) T(33) T(34) T(35) T(36) T(37) T(38) T(39)
+T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47)
+T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55)
+T(56) T(57) T(58) T(59) T(60) T(61) T(62) T(63)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_main.c
new file mode 100644
index 000000000..64c8f27ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_main.c
@@ -0,0 +1,16 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list. Tested structs end with double.
+ This test was written in response to a layout change for such
+ structs for powerpc64-linux that breaks compatibility between
+ 3.3 and 3.4. */
+
+extern void struct_by_value_20_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_20_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_x.c
new file mode 100644
index 000000000..183e32dc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_x.c
@@ -0,0 +1,166 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, 1); \
+ init##TYPE ( &g2s##TYPE, 2); \
+ init##TYPE ( &g3s##TYPE, 3); \
+ init##TYPE ( &g4s##TYPE, 4); \
+ init##TYPE ( &g5s##TYPE, 5); \
+ init##TYPE ( &g6s##TYPE, 6); \
+ init##TYPE ( &g7s##TYPE, 7); \
+ init##TYPE ( &g8s##TYPE, 8); \
+ init##TYPE ( &g9s##TYPE, 9); \
+ init##TYPE (&g10s##TYPE, 10); \
+ init##TYPE (&g11s##TYPE, 11); \
+ init##TYPE (&g12s##TYPE, 12); \
+ init##TYPE (&g13s##TYPE, 13); \
+ init##TYPE (&g14s##TYPE, 14); \
+ init##TYPE (&g15s##TYPE, 15); \
+ init##TYPE (&g16s##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2:"); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
+
+#undef T
+
+void
+struct_by_value_20_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_y.c
new file mode 100644
index 000000000..1a4a6775d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-20_y.c
@@ -0,0 +1,98 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "mixed-struct-defs.h"
+
+extern void checkScd (Scd x, int i);
+extern void checkScdc (Scdc x, int i);
+extern void checkSd (Sd x, int i);
+extern void checkSdi (Sdi x, int i);
+extern void checkScsds (Scsds x, int i);
+extern void checkScsdsc (Scsdsc x, int i);
+extern void checkScsdis (Scsdis x, int i);
+extern void checkScsdisc (Scsdisc x, int i);
+extern void checkSsds (Ssds x, int i);
+extern void checkSsdsc (Ssdsc x, int i);
+extern void checkScssdss (Scssdss x, int i);
+extern void checkScssdssc (Scssdssc x, int i);
+
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, 1); \
+ check##TYPE ( g2s##TYPE, 2); \
+ check##TYPE ( g3s##TYPE, 3); \
+ check##TYPE ( g4s##TYPE, 4); \
+ check##TYPE ( g5s##TYPE, 5); \
+ check##TYPE ( g6s##TYPE, 6); \
+ check##TYPE ( g7s##TYPE, 7); \
+ check##TYPE ( g8s##TYPE, 8); \
+ check##TYPE ( g9s##TYPE, 9); \
+ check##TYPE ( g10s##TYPE, 10); \
+ check##TYPE ( g11s##TYPE, 11); \
+ check##TYPE ( g12s##TYPE, 12); \
+ check##TYPE ( g13s##TYPE, 13); \
+ check##TYPE ( g14s##TYPE, 14); \
+ check##TYPE ( g15s##TYPE, 15); \
+ check##TYPE ( g16s##TYPE, 16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, 1); \
+ check##TYPE (s2, 2); \
+ check##TYPE (s3, 3); \
+ check##TYPE (s4, 4); \
+ check##TYPE (s5, 5); \
+ check##TYPE (s6, 6); \
+ check##TYPE (s7, 7); \
+ check##TYPE (s8, 8); \
+ check##TYPE (s9, 9); \
+ check##TYPE (s10, 10); \
+ check##TYPE (s11, 11); \
+ check##TYPE (s12, 12); \
+ check##TYPE (s13, 13); \
+ check##TYPE (s14, 14); \
+ check##TYPE (s15, 15); \
+ check##TYPE (s16, 16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_main.c
new file mode 100644
index 000000000..b722bccd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_main.c
@@ -0,0 +1,13 @@
+/* Test function argument passing. This was written when correcting
+ a deviation from the ABI on SPARC64 between 3.3 and 3.4. */
+
+extern void struct_by_value_21_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_21_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_x.c
new file mode 100644
index 000000000..3b01ba86e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_x.c
@@ -0,0 +1,168 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, 1); \
+ init##TYPE ( &g2s##TYPE, 2); \
+ init##TYPE ( &g3s##TYPE, 3); \
+ init##TYPE ( &g4s##TYPE, 4); \
+ init##TYPE ( &g5s##TYPE, 5); \
+ init##TYPE ( &g6s##TYPE, 6); \
+ init##TYPE ( &g7s##TYPE, 7); \
+ init##TYPE ( &g8s##TYPE, 8); \
+ init##TYPE ( &g9s##TYPE, 9); \
+ init##TYPE (&g10s##TYPE, 10); \
+ init##TYPE (&g11s##TYPE, 11); \
+ init##TYPE (&g12s##TYPE, 12); \
+ init##TYPE (&g13s##TYPE, 13); \
+ init##TYPE (&g14s##TYPE, 14); \
+ init##TYPE (&g15s##TYPE, 15); \
+ init##TYPE (&g16s##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2:"); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Sfi)
+T(Sfii)
+T(Sfifi)
+T(Sfiifii)
+
+#undef T
+
+void
+struct_by_value_21_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Sfi)
+T(Sfii)
+T(Sfifi)
+T(Sfiifii)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_y.c
new file mode 100644
index 000000000..fc06d9d4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-21_y.c
@@ -0,0 +1,86 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern void check##TYPE (TYPE x, int i); \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, 1); \
+ check##TYPE ( g2s##TYPE, 2); \
+ check##TYPE ( g3s##TYPE, 3); \
+ check##TYPE ( g4s##TYPE, 4); \
+ check##TYPE ( g5s##TYPE, 5); \
+ check##TYPE ( g6s##TYPE, 6); \
+ check##TYPE ( g7s##TYPE, 7); \
+ check##TYPE ( g8s##TYPE, 8); \
+ check##TYPE ( g9s##TYPE, 9); \
+ check##TYPE ( g10s##TYPE, 10); \
+ check##TYPE ( g11s##TYPE, 11); \
+ check##TYPE ( g12s##TYPE, 12); \
+ check##TYPE ( g13s##TYPE, 13); \
+ check##TYPE ( g14s##TYPE, 14); \
+ check##TYPE ( g15s##TYPE, 15); \
+ check##TYPE ( g16s##TYPE, 16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, 1); \
+ check##TYPE (s2, 2); \
+ check##TYPE (s3, 3); \
+ check##TYPE (s4, 4); \
+ check##TYPE (s5, 5); \
+ check##TYPE (s6, 6); \
+ check##TYPE (s7, 7); \
+ check##TYPE (s8, 8); \
+ check##TYPE (s9, 9); \
+ check##TYPE (s10, 10); \
+ check##TYPE (s11, 11); \
+ check##TYPE (s12, 12); \
+ check##TYPE (s13, 13); \
+ check##TYPE (s14, 14); \
+ check##TYPE (s15, 15); \
+ check##TYPE (s16, 16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(Sfi)
+T(Sfii)
+T(Sfifi)
+T(Sfiifii)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c
new file mode 100644
index 000000000..1fd2eba1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_main.c
@@ -0,0 +1,20 @@
+/* Test variable sized function argument passing.
+ GCC 3.2 and earlier is incompatible with GCC 3.3+ on x86-64,
+ the latter passes variable sized arguments by reference while
+ the former doesn't.
+ See http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01830.html */
+
+#ifndef SKIP_VLA_IN_STRUCT
+extern void struct_by_value_22_x (void);
+#endif
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+#ifndef SKIP_VLA_IN_STRUCT
+ struct_by_value_22_x ();
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c
new file mode 100644
index 000000000..6f1cdc860
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_x.c
@@ -0,0 +1,83 @@
+#ifndef SKIP_VLA_IN_STRUCT
+
+#ifndef T
+#include "compat-common.h"
+#include "mixed-struct-defs.h"
+#include "mixed-struct-init.h"
+
+#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST) \
+extern void testva##NAME (int n, ...); \
+ \
+void \
+testit##NAME (int n) \
+{ \
+ struct S { FIELDS TYPE a[n]; } s; \
+ int i; \
+ FIELDINIT; \
+ for (i = 0; i < n; ++i) \
+ s.a[i] = 12 + n - i; \
+ testva##NAME (n, s, n, s); \
+}
+
+#include "struct-by-value-22_x.c"
+
+#undef T
+
+void
+struct_by_value_22_x ()
+{
+ int n;
+DEBUG_INIT
+
+#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST) testit##NAME (n);
+
+ for (n = 0; n < 16; ++n)
+ {
+#include "struct-by-value-22_x.c"
+ DEBUG_NL;
+ }
+ for (; n < 110; n += 13)
+ {
+#include "struct-by-value-22_x.c"
+ DEBUG_NL;
+ }
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+}
+
+#else
+
+#define S(NAME, FIELDS, FIELDINIT, FIELDTEST) \
+ T(c##NAME, FIELDS, char, FIELDINIT, FIELDTEST) \
+ T(s##NAME, FIELDS, short, FIELDINIT, FIELDTEST) \
+ T(u##NAME, FIELDS, unsigned, FIELDINIT, FIELDTEST) \
+ T(d##NAME, FIELDS, double, FIELDINIT, FIELDTEST)
+S(E, , do {} while (0), DEBUG_DOT)
+S(n, int n;, s.n = n, if (s.n != n) DEBUG_CHECK)
+#define U(TYPE) \
+S(TYPE, TYPE s;, init##TYPE (&s.s, n), check##TYPE (s.s, n))
+U(Scd)
+U(Scdc)
+U(Sd)
+U(Sdi)
+U(Scsds)
+U(Scsdsc)
+U(Scsdis)
+U(Scsdisc)
+U(Ssds)
+U(Ssdsc)
+U(Scssdss)
+U(Scssdssc)
+U(Sfi)
+U(Sfii)
+U(Sfifi)
+U(Sfiifii)
+#undef S
+#undef U
+
+#endif
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c
new file mode 100644
index 000000000..ea5dec226
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-22_y.c
@@ -0,0 +1,41 @@
+#include <stdarg.h>
+#include "compat-common.h"
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#ifndef SKIP_VLA_IN_STRUCT
+#define T(NAME, FIELDS, TYPE, FIELDINIT, FIELDTEST) \
+void \
+testva##NAME (int n, ...) \
+{ \
+ va_list ap; \
+ if (test_va) \
+ { \
+ struct S { FIELDS TYPE a[n]; } s; \
+ int fail = 0, i, j; \
+ \
+ va_start (ap, n); \
+ for (j = 0; j < 2; ++j) \
+ { \
+ s = va_arg (ap, struct S); \
+ for (i = 0; i < n; ++i) \
+ if (s.a[i] != 12 + n - i) \
+ ++fail; \
+ if (fail) \
+ { DEBUG_FAIL; } \
+ if (!j && va_arg (ap, int) != n) \
+ { DEBUG_FAIL; } \
+ FIELDTEST; \
+ } \
+ va_end (ap); \
+ } \
+}
+
+#include "struct-by-value-22_x.c"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_main.c
new file mode 100644
index 000000000..8cb6fc078
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list.
+ This test is based on one contributed by Alan Modra. */
+
+extern void struct_by_value_2_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_2_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c
new file mode 100644
index 000000000..57c6da0c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_x.c
@@ -0,0 +1,233 @@
+#include "compat-common.h"
+
+#define T(N, NAME, TYPE) \
+struct S##NAME##N { TYPE i[N]; }; \
+struct S##NAME##N g1s##NAME##N, g2s##NAME##N; \
+struct S##NAME##N g3s##NAME##N, g4s##NAME##N; \
+struct S##NAME##N g5s##NAME##N, g6s##NAME##N; \
+struct S##NAME##N g7s##NAME##N, g8s##NAME##N; \
+struct S##NAME##N g9s##NAME##N, g10s##NAME##N; \
+struct S##NAME##N g11s##NAME##N, g12s##NAME##N; \
+struct S##NAME##N g13s##NAME##N, g14s##NAME##N; \
+struct S##NAME##N g15s##NAME##N, g16s##NAME##N; \
+ \
+extern void init##NAME##N (struct S##NAME##N *p, int i); \
+extern void checkg##NAME##N (void); \
+extern void \
+test##NAME##N (struct S##NAME##N s1, struct S##NAME##N s2, \
+ struct S##NAME##N s3, struct S##NAME##N s4, \
+ struct S##NAME##N s5, struct S##NAME##N s6, \
+ struct S##NAME##N s7, struct S##NAME##N s8, \
+ struct S##NAME##N s9, struct S##NAME##N s10, \
+ struct S##NAME##N s11, struct S##NAME##N s12, \
+ struct S##NAME##N s13, struct S##NAME##N s14, \
+ struct S##NAME##N s15, struct S##NAME##N s16); \
+extern void testva##NAME##N (int n, ...); \
+extern void \
+test2_##NAME##N (struct S##NAME##N s1, struct S##NAME##N s2, \
+ struct S##NAME##N s3, struct S##NAME##N s4, \
+ struct S##NAME##N s5, struct S##NAME##N s6, \
+ struct S##NAME##N s7, struct S##NAME##N s8); \
+ \
+void \
+check##NAME##N (struct S##NAME##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ if (p->i[j] != (TYPE) (i + j)) \
+ DEBUG_CHECK \
+} \
+ \
+void \
+test2_##NAME##N (struct S##NAME##N s1, struct S##NAME##N s2, \
+ struct S##NAME##N s3, struct S##NAME##N s4, \
+ struct S##NAME##N s5, struct S##NAME##N s6, \
+ struct S##NAME##N s7, struct S##NAME##N s8) \
+{ \
+ test##NAME##N (s1, g2s##NAME##N, s2, g4s##NAME##N, \
+ s3, g6s##NAME##N, s4, g8s##NAME##N, \
+ s5, g10s##NAME##N, s6, g12s##NAME##N, \
+ s7, g14s##NAME##N, s8, g16s##NAME##N); \
+} \
+ \
+void \
+testit##NAME##N (void) \
+{ \
+ DEBUG_FPUTS (#NAME "[" #N "]"); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME##N ( &g1s##NAME##N, 1*16); \
+ init##NAME##N ( &g2s##NAME##N, 2*16); \
+ init##NAME##N ( &g3s##NAME##N, 3*16); \
+ init##NAME##N ( &g4s##NAME##N, 4*16); \
+ init##NAME##N ( &g5s##NAME##N, 5*16); \
+ init##NAME##N ( &g6s##NAME##N, 6*16); \
+ init##NAME##N ( &g7s##NAME##N, 7*16); \
+ init##NAME##N ( &g8s##NAME##N, 8*16); \
+ init##NAME##N ( &g9s##NAME##N, 9*16); \
+ init##NAME##N (&g10s##NAME##N, 10*16); \
+ init##NAME##N (&g11s##NAME##N, 11*16); \
+ init##NAME##N (&g12s##NAME##N, 12*16); \
+ init##NAME##N (&g13s##NAME##N, 13*16); \
+ init##NAME##N (&g14s##NAME##N, 14*16); \
+ init##NAME##N (&g15s##NAME##N, 15*16); \
+ init##NAME##N (&g16s##NAME##N, 16*16); \
+ checkg##NAME##N (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME "[" #N "]"); \
+ DEBUG_FPUTS (" test: "); \
+ test##NAME##N (g1s##NAME##N, g2s##NAME##N, \
+ g3s##NAME##N, g4s##NAME##N, \
+ g5s##NAME##N, g6s##NAME##N, \
+ g7s##NAME##N, g8s##NAME##N, \
+ g9s##NAME##N, g10s##NAME##N, \
+ g11s##NAME##N, g12s##NAME##N, \
+ g13s##NAME##N, g14s##NAME##N, \
+ g15s##NAME##N, g16s##NAME##N); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME "[" #N "]"); \
+ DEBUG_FPUTS (" testva:"); \
+ testva##NAME##N (16, \
+ g1s##NAME##N, g2s##NAME##N, \
+ g3s##NAME##N, g4s##NAME##N, \
+ g5s##NAME##N, g6s##NAME##N, \
+ g7s##NAME##N, g8s##NAME##N, \
+ g9s##NAME##N, g10s##NAME##N, \
+ g11s##NAME##N, g12s##NAME##N, \
+ g13s##NAME##N, g14s##NAME##N, \
+ g15s##NAME##N, g16s##NAME##N); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME "[" #N "]"); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##NAME##N (g1s##NAME##N, g3s##NAME##N, \
+ g5s##NAME##N, g7s##NAME##N, \
+ g9s##NAME##N, g11s##NAME##N, \
+ g13s##NAME##N, g15s##NAME##N); \
+ DEBUG_NL; \
+}
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, uc, unsigned char)
+#endif
+T(1, uc, unsigned char)
+T(2, uc, unsigned char)
+T(3, uc, unsigned char)
+T(4, uc, unsigned char)
+T(5, uc, unsigned char)
+T(6, uc, unsigned char)
+T(7, uc, unsigned char)
+T(8, uc, unsigned char)
+T(9, uc, unsigned char)
+T(10, uc, unsigned char)
+T(11, uc, unsigned char)
+T(12, uc, unsigned char)
+T(13, uc, unsigned char)
+T(14, uc, unsigned char)
+T(15, uc, unsigned char)
+#ifndef SKIP_ZERO_ARRAY
+T(0, us, unsigned short)
+#endif
+T(1, us, unsigned short)
+T(2, us, unsigned short)
+T(3, us, unsigned short)
+T(4, us, unsigned short)
+T(5, us, unsigned short)
+T(6, us, unsigned short)
+T(7, us, unsigned short)
+T(8, us, unsigned short)
+T(9, us, unsigned short)
+T(10, us, unsigned short)
+T(11, us, unsigned short)
+T(12, us, unsigned short)
+T(13, us, unsigned short)
+T(14, us, unsigned short)
+T(15, us, unsigned short)
+#ifndef SKIP_ZERO_ARRAY
+T(0, ui, unsigned int)
+#endif
+T(1, ui, unsigned int)
+T(2, ui, unsigned int)
+T(3, ui, unsigned int)
+T(4, ui, unsigned int)
+T(5, ui, unsigned int)
+T(6, ui, unsigned int)
+T(7, ui, unsigned int)
+T(8, ui, unsigned int)
+T(9, ui, unsigned int)
+T(10, ui, unsigned int)
+T(11, ui, unsigned int)
+T(12, ui, unsigned int)
+T(13, ui, unsigned int)
+T(14, ui, unsigned int)
+T(15, ui, unsigned int)
+
+#undef T
+
+void
+struct_by_value_2_x ()
+{
+DEBUG_INIT
+
+#define T(N, NAME, TYPE) testit##NAME##N ();
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, uc, unsigned char)
+#endif
+T(1, uc, unsigned char)
+T(2, uc, unsigned char)
+T(3, uc, unsigned char)
+T(4, uc, unsigned char)
+T(5, uc, unsigned char)
+T(6, uc, unsigned char)
+T(7, uc, unsigned char)
+T(8, uc, unsigned char)
+T(9, uc, unsigned char)
+T(10, uc, unsigned char)
+T(11, uc, unsigned char)
+T(12, uc, unsigned char)
+T(13, uc, unsigned char)
+T(14, uc, unsigned char)
+T(15, uc, unsigned char)
+#ifndef SKIP_ZERO_ARRAY
+T(0, us, unsigned short)
+#endif
+T(1, us, unsigned short)
+T(2, us, unsigned short)
+T(3, us, unsigned short)
+T(4, us, unsigned short)
+T(5, us, unsigned short)
+T(6, us, unsigned short)
+T(7, us, unsigned short)
+T(8, us, unsigned short)
+T(9, us, unsigned short)
+T(10, us, unsigned short)
+T(11, us, unsigned short)
+T(12, us, unsigned short)
+T(13, us, unsigned short)
+T(14, us, unsigned short)
+T(15, us, unsigned short)
+#ifndef SKIP_ZERO_ARRAY
+T(0, ui, unsigned int)
+#endif
+T(1, ui, unsigned int)
+T(2, ui, unsigned int)
+T(3, ui, unsigned int)
+T(4, ui, unsigned int)
+T(5, ui, unsigned int)
+T(6, ui, unsigned int)
+T(7, ui, unsigned int)
+T(8, ui, unsigned int)
+T(9, ui, unsigned int)
+T(10, ui, unsigned int)
+T(11, ui, unsigned int)
+T(12, ui, unsigned int)
+T(13, ui, unsigned int)
+T(14, ui, unsigned int)
+T(15, ui, unsigned int)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_y.c
new file mode 100644
index 000000000..3b203fab2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-2_y.c
@@ -0,0 +1,157 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(N, NAME, TYPE) \
+struct S##NAME##N { TYPE i[N]; }; \
+ \
+extern struct S##NAME##N g1s##NAME##N, g2s##NAME##N; \
+extern struct S##NAME##N g3s##NAME##N, g4s##NAME##N; \
+extern struct S##NAME##N g5s##NAME##N, g6s##NAME##N; \
+extern struct S##NAME##N g7s##NAME##N, g8s##NAME##N; \
+extern struct S##NAME##N g9s##NAME##N, g10s##NAME##N; \
+extern struct S##NAME##N g11s##NAME##N, g12s##NAME##N; \
+extern struct S##NAME##N g13s##NAME##N, g14s##NAME##N; \
+extern struct S##NAME##N g15s##NAME##N, g16s##NAME##N; \
+ \
+extern void check##NAME##N (struct S##NAME##N *p, int i); \
+extern void \
+test2_##NAME##N (struct S##NAME##N s1, struct S##NAME##N s2, \
+ struct S##NAME##N s3, struct S##NAME##N s4, \
+ struct S##NAME##N s5, struct S##NAME##N s6, \
+ struct S##NAME##N s7, struct S##NAME##N s8); \
+ \
+void \
+init##NAME##N (struct S##NAME##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ p->i[j] = i + j; \
+} \
+ \
+void \
+checkg##NAME##N (void) \
+{ \
+ check##NAME##N ( &g1s##NAME##N, 1*16); \
+ check##NAME##N ( &g2s##NAME##N, 2*16); \
+ check##NAME##N ( &g3s##NAME##N, 3*16); \
+ check##NAME##N ( &g4s##NAME##N, 4*16); \
+ check##NAME##N ( &g5s##NAME##N, 5*16); \
+ check##NAME##N ( &g6s##NAME##N, 6*16); \
+ check##NAME##N ( &g7s##NAME##N, 7*16); \
+ check##NAME##N ( &g8s##NAME##N, 8*16); \
+ check##NAME##N ( &g9s##NAME##N, 9*16); \
+ check##NAME##N (&g10s##NAME##N, 10*16); \
+ check##NAME##N (&g11s##NAME##N, 11*16); \
+ check##NAME##N (&g12s##NAME##N, 12*16); \
+ check##NAME##N (&g13s##NAME##N, 13*16); \
+ check##NAME##N (&g14s##NAME##N, 14*16); \
+ check##NAME##N (&g15s##NAME##N, 15*16); \
+ check##NAME##N (&g16s##NAME##N, 16*16); \
+} \
+ \
+void \
+test##NAME##N (struct S##NAME##N s1, struct S##NAME##N s2, \
+ struct S##NAME##N s3, struct S##NAME##N s4, \
+ struct S##NAME##N s5, struct S##NAME##N s6, \
+ struct S##NAME##N s7, struct S##NAME##N s8, \
+ struct S##NAME##N s9, struct S##NAME##N s10, \
+ struct S##NAME##N s11, struct S##NAME##N s12, \
+ struct S##NAME##N s13, struct S##NAME##N s14, \
+ struct S##NAME##N s15, struct S##NAME##N s16) \
+{ \
+ check##NAME##N (&s1, 1*16); \
+ check##NAME##N (&s2, 2*16); \
+ check##NAME##N (&s3, 3*16); \
+ check##NAME##N (&s4, 4*16); \
+ check##NAME##N (&s5, 5*16); \
+ check##NAME##N (&s6, 6*16); \
+ check##NAME##N (&s7, 7*16); \
+ check##NAME##N (&s8, 8*16); \
+ check##NAME##N (&s9, 9*16); \
+ check##NAME##N (&s10, 10*16); \
+ check##NAME##N (&s11, 11*16); \
+ check##NAME##N (&s12, 12*16); \
+ check##NAME##N (&s13, 13*16); \
+ check##NAME##N (&s14, 14*16); \
+ check##NAME##N (&s15, 15*16); \
+ check##NAME##N (&s16, 16*16); \
+} \
+ \
+void \
+testva##NAME##N (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ struct S##NAME##N t = va_arg (ap, struct S##NAME##N); \
+ check##NAME##N (&t, (i+1)*16); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, uc, unsigned char)
+#endif
+T(1, uc, unsigned char)
+T(2, uc, unsigned char)
+T(3, uc, unsigned char)
+T(4, uc, unsigned char)
+T(5, uc, unsigned char)
+T(6, uc, unsigned char)
+T(7, uc, unsigned char)
+T(8, uc, unsigned char)
+T(9, uc, unsigned char)
+T(10, uc, unsigned char)
+T(11, uc, unsigned char)
+T(12, uc, unsigned char)
+T(13, uc, unsigned char)
+T(14, uc, unsigned char)
+T(15, uc, unsigned char)
+#ifndef SKIP_ZERO_ARRAY
+T(0, us, unsigned short)
+#endif
+T(1, us, unsigned short)
+T(2, us, unsigned short)
+T(3, us, unsigned short)
+T(4, us, unsigned short)
+T(5, us, unsigned short)
+T(6, us, unsigned short)
+T(7, us, unsigned short)
+T(8, us, unsigned short)
+T(9, us, unsigned short)
+T(10, us, unsigned short)
+T(11, us, unsigned short)
+T(12, us, unsigned short)
+T(13, us, unsigned short)
+T(14, us, unsigned short)
+T(15, us, unsigned short)
+#ifndef SKIP_ZERO_ARRAY
+T(0, ui, unsigned int)
+#endif
+T(1, ui, unsigned int)
+T(2, ui, unsigned int)
+T(3, ui, unsigned int)
+T(4, ui, unsigned int)
+T(5, ui, unsigned int)
+T(6, ui, unsigned int)
+T(7, ui, unsigned int)
+T(8, ui, unsigned int)
+T(9, ui, unsigned int)
+T(10, ui, unsigned int)
+T(11, ui, unsigned int)
+T(12, ui, unsigned int)
+T(13, ui, unsigned int)
+T(14, ui, unsigned int)
+T(15, ui, unsigned int)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_main.c
new file mode 100644
index 000000000..0b7206895
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_main.c
@@ -0,0 +1,15 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list. All struct members are scalar
+ integral types, and the structs are "small": 1, 2, 4, 8, and 12
+ bytes for LP64. */
+
+extern void struct_by_value_3_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_3_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c
new file mode 100644
index 000000000..38e5b546a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_x.c
@@ -0,0 +1,190 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, 1); \
+ init##TYPE ( &g2s##TYPE, 2); \
+ init##TYPE ( &g3s##TYPE, 3); \
+ init##TYPE ( &g4s##TYPE, 4); \
+ init##TYPE ( &g5s##TYPE, 5); \
+ init##TYPE ( &g6s##TYPE, 6); \
+ init##TYPE ( &g7s##TYPE, 7); \
+ init##TYPE ( &g8s##TYPE, 8); \
+ init##TYPE ( &g9s##TYPE, 9); \
+ init##TYPE (&g10s##TYPE, 10); \
+ init##TYPE (&g11s##TYPE, 11); \
+ init##TYPE (&g12s##TYPE, 12); \
+ init##TYPE (&g13s##TYPE, 13); \
+ init##TYPE (&g14s##TYPE, 14); \
+ init##TYPE (&g15s##TYPE, 15); \
+ init##TYPE (&g16s##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2:"); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+#include "small-struct-defs.h"
+#include "small-struct-check.h"
+
+T(Sc)
+T(Ss)
+T(Si)
+T(Scs)
+T(Ssc)
+T(Sic)
+T(Sci)
+T(Ssi)
+T(Sis)
+T(Scsi)
+T(Scis)
+T(Ssci)
+T(Ssic)
+T(Sisc)
+T(Sics)
+
+#undef T
+
+void
+struct_by_value_3_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Sc)
+T(Ss)
+T(Si)
+T(Scs)
+T(Ssc)
+T(Sic)
+T(Sci)
+T(Ssi)
+T(Sis)
+T(Scsi)
+T(Scis)
+T(Ssci)
+T(Ssic)
+T(Sisc)
+T(Sics)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_y.c
new file mode 100644
index 000000000..d5a31c9d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-3_y.c
@@ -0,0 +1,113 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "small-struct-defs.h"
+
+extern void checkSc (Sc x, int i);
+extern void checkSs (Ss x, int i);
+extern void checkSi (Si x, int i);
+extern void checkSsc (Ssc x, int i);
+extern void checkScs (Scs x, int i);
+extern void checkSsi (Ssi x, int i);
+extern void checkSis (Sis x, int i);
+extern void checkSic (Sic x, int i);
+extern void checkSci (Sci x, int i);
+extern void checkScsi (Scsi x, int i);
+extern void checkScis (Scis x, int i);
+extern void checkSsci (Ssci x, int i);
+extern void checkSsic (Ssic x, int i);
+extern void checkSisc (Sisc x, int i);
+extern void checkSics (Sics x, int i);
+
+#include "small-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, 1); \
+ check##TYPE ( g2s##TYPE, 2); \
+ check##TYPE ( g3s##TYPE, 3); \
+ check##TYPE ( g4s##TYPE, 4); \
+ check##TYPE ( g5s##TYPE, 5); \
+ check##TYPE ( g6s##TYPE, 6); \
+ check##TYPE ( g7s##TYPE, 7); \
+ check##TYPE ( g8s##TYPE, 8); \
+ check##TYPE ( g9s##TYPE, 9); \
+ check##TYPE ( g10s##TYPE, 10); \
+ check##TYPE ( g11s##TYPE, 11); \
+ check##TYPE ( g12s##TYPE, 12); \
+ check##TYPE ( g13s##TYPE, 13); \
+ check##TYPE ( g14s##TYPE, 14); \
+ check##TYPE ( g15s##TYPE, 15); \
+ check##TYPE ( g16s##TYPE, 16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, 1); \
+ check##TYPE (s2, 2); \
+ check##TYPE (s3, 3); \
+ check##TYPE (s4, 4); \
+ check##TYPE (s5, 5); \
+ check##TYPE (s6, 6); \
+ check##TYPE (s7, 7); \
+ check##TYPE (s8, 8); \
+ check##TYPE (s9, 9); \
+ check##TYPE (s10, 10); \
+ check##TYPE (s11, 11); \
+ check##TYPE (s12, 12); \
+ check##TYPE (s13, 13); \
+ check##TYPE (s14, 14); \
+ check##TYPE (s15, 15); \
+ check##TYPE (s16, 16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(Sc)
+T(Ss)
+T(Si)
+T(Ssc)
+T(Scs)
+T(Sic)
+T(Sci)
+T(Ssi)
+T(Sis)
+T(Scsi)
+T(Scis)
+T(Ssci)
+T(Ssic)
+T(Sisc)
+T(Sics)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_main.c
new file mode 100644
index 000000000..570eddc5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list. Each struct contains an array
+ of small structs with a single member. */
+
+extern void struct_by_value_4_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_4_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c
new file mode 100644
index 000000000..def20ce8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_x.c
@@ -0,0 +1,257 @@
+#include "compat-common.h"
+
+#define T(N, TYPE) \
+struct S##TYPE##N { TYPE i[N]; }; \
+ \
+struct S##TYPE##N g1s##TYPE##N, g2s##TYPE##N; \
+struct S##TYPE##N g3s##TYPE##N, g4s##TYPE##N; \
+struct S##TYPE##N g5s##TYPE##N, g6s##TYPE##N; \
+struct S##TYPE##N g7s##TYPE##N, g8s##TYPE##N; \
+struct S##TYPE##N g9s##TYPE##N, g10s##TYPE##N; \
+struct S##TYPE##N g11s##TYPE##N, g12s##TYPE##N; \
+struct S##TYPE##N g13s##TYPE##N, g14s##TYPE##N; \
+struct S##TYPE##N g15s##TYPE##N, g16s##TYPE##N; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE##N (void); \
+extern void \
+test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8, \
+ struct S##TYPE##N s9, struct S##TYPE##N s10, \
+ struct S##TYPE##N s11, struct S##TYPE##N s12, \
+ struct S##TYPE##N s13, struct S##TYPE##N s14, \
+ struct S##TYPE##N s15, struct S##TYPE##N s16); \
+extern void testva##TYPE##N (int n, ...); \
+ \
+ \
+void \
+init##TYPE##N (struct S##TYPE##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ init##TYPE(&p->i[j], i+j); \
+} \
+ \
+void \
+check##TYPE##N (struct S##TYPE##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ check##TYPE(p->i[j], i+j); \
+} \
+ \
+void \
+test2_##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8) \
+{ \
+ test##TYPE##N (s1, g2s##TYPE##N, s2, g4s##TYPE##N, \
+ s3, g6s##TYPE##N, s4, g8s##TYPE##N, \
+ s5, g10s##TYPE##N, s6, g12s##TYPE##N, \
+ s7, g14s##TYPE##N, s8, g16s##TYPE##N); \
+} \
+ \
+void \
+testit##TYPE##N (void) \
+{ \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE##N ( &g1s##TYPE##N, 1*16); \
+ init##TYPE##N ( &g2s##TYPE##N, 2*16); \
+ init##TYPE##N ( &g3s##TYPE##N, 3*16); \
+ init##TYPE##N ( &g4s##TYPE##N, 4*16); \
+ init##TYPE##N ( &g5s##TYPE##N, 5*16); \
+ init##TYPE##N ( &g6s##TYPE##N, 6*16); \
+ init##TYPE##N ( &g7s##TYPE##N, 7*16); \
+ init##TYPE##N ( &g8s##TYPE##N, 8*16); \
+ init##TYPE##N ( &g9s##TYPE##N, 9*16); \
+ init##TYPE##N (&g10s##TYPE##N, 10*16); \
+ init##TYPE##N (&g11s##TYPE##N, 11*16); \
+ init##TYPE##N (&g12s##TYPE##N, 12*16); \
+ init##TYPE##N (&g13s##TYPE##N, 13*16); \
+ init##TYPE##N (&g14s##TYPE##N, 14*16); \
+ init##TYPE##N (&g15s##TYPE##N, 15*16); \
+ init##TYPE##N (&g16s##TYPE##N, 16*16); \
+ checkg##TYPE##N (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE##N (g1s##TYPE##N, g2s##TYPE##N, \
+ g3s##TYPE##N, g4s##TYPE##N, \
+ g5s##TYPE##N, g6s##TYPE##N, \
+ g7s##TYPE##N, g8s##TYPE##N, \
+ g9s##TYPE##N, g10s##TYPE##N, \
+ g11s##TYPE##N, g12s##TYPE##N, \
+ g13s##TYPE##N, g14s##TYPE##N, \
+ g15s##TYPE##N, g16s##TYPE##N); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" testva:"); \
+ testva##TYPE##N (16, \
+ g1s##TYPE##N, g2s##TYPE##N, \
+ g3s##TYPE##N, g4s##TYPE##N, \
+ g5s##TYPE##N, g6s##TYPE##N, \
+ g7s##TYPE##N, g8s##TYPE##N, \
+ g9s##TYPE##N, g10s##TYPE##N, \
+ g11s##TYPE##N, g12s##TYPE##N, \
+ g13s##TYPE##N, g14s##TYPE##N, \
+ g15s##TYPE##N, g16s##TYPE##N); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##TYPE##N (g1s##TYPE##N, g3s##TYPE##N, \
+ g5s##TYPE##N, g7s##TYPE##N, \
+ g9s##TYPE##N, g11s##TYPE##N, \
+ g13s##TYPE##N, g15s##TYPE##N); \
+ DEBUG_NL; \
+}
+
+typedef struct { char c; } Sc;
+typedef struct { short s; } Ss;
+typedef struct { int i; } Si;
+typedef struct { short s; char c; } Ssc;
+typedef struct { int i; short s; } Sis;
+typedef struct { char c; short s; int i; } Scsi;
+typedef struct { char c; int i; short s; } Scis;
+
+void checkSc (Sc x, int i) { if (x.c != i/16) DEBUG_CHECK }
+void checkSs (Ss x, int i) { if (x.s != i) DEBUG_CHECK }
+void checkSi (Si x, int i) { if (x.i != i) DEBUG_CHECK }
+void checkSsc (Ssc x, int i)
+{ if (x.s != i || x.c != (i/16)+1) DEBUG_CHECK }
+void checkSis (Sis x, int i)
+{ if (x.i != i || x.s != i+1) DEBUG_CHECK }
+void checkScsi (Scsi x, int i)
+{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) DEBUG_CHECK }
+void checkScis (Scis x, int i)
+{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) DEBUG_CHECK }
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Sc)
+#endif
+T(1, Sc)
+T(2, Sc)
+T(3, Sc)
+T(4, Sc)
+T(5, Sc)
+T(6, Sc)
+T(7, Sc)
+T(8, Sc)
+T(9, Sc)
+T(10, Sc)
+T(11, Sc)
+T(12, Sc)
+T(13, Sc)
+T(14, Sc)
+T(15, Sc)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Ss)
+#endif
+T(1, Ss)
+T(2, Ss)
+T(3, Ss)
+T(4, Ss)
+T(5, Ss)
+T(6, Ss)
+T(7, Ss)
+T(8, Ss)
+T(9, Ss)
+T(10, Ss)
+T(11, Ss)
+T(12, Ss)
+T(13, Ss)
+T(14, Ss)
+T(15, Ss)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Si)
+#endif
+T(1, Si)
+T(2, Si)
+T(3, Si)
+T(4, Si)
+T(5, Si)
+T(6, Si)
+T(7, Si)
+T(8, Si)
+T(9, Si)
+T(10, Si)
+T(11, Si)
+T(12, Si)
+T(13, Si)
+T(14, Si)
+T(15, Si)
+
+#undef T
+
+void
+struct_by_value_4_x ()
+{
+DEBUG_INIT
+
+#define T(N, TYPE) testit##TYPE##N ();
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Sc)
+#endif
+T(1, Sc)
+T(2, Sc)
+T(3, Sc)
+T(4, Sc)
+T(5, Sc)
+T(6, Sc)
+T(7, Sc)
+T(8, Sc)
+T(9, Sc)
+T(10, Sc)
+T(11, Sc)
+T(12, Sc)
+T(13, Sc)
+T(14, Sc)
+T(15, Sc)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Ss)
+#endif
+T(1, Ss)
+T(2, Ss)
+T(3, Ss)
+T(4, Ss)
+T(5, Ss)
+T(6, Ss)
+T(7, Ss)
+T(8, Ss)
+T(9, Ss)
+T(10, Ss)
+T(11, Ss)
+T(12, Ss)
+T(13, Ss)
+T(14, Ss)
+T(15, Ss)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Si)
+#endif
+T(1, Si)
+T(2, Si)
+T(3, Si)
+T(4, Si)
+T(5, Si)
+T(6, Si)
+T(7, Si)
+T(8, Si)
+T(9, Si)
+T(10, Si)
+T(11, Si)
+T(12, Si)
+T(13, Si)
+T(14, Si)
+T(15, Si)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_y.c
new file mode 100644
index 000000000..fe1b09577
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-4_y.c
@@ -0,0 +1,162 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+typedef struct { char c; } Sc;
+typedef struct { short s; } Ss;
+typedef struct { int i; } Si;
+typedef struct { short s; char c; } Ssc;
+typedef struct { int i; short s; } Sis;
+typedef struct { char c; short s; int i; } Scsi;
+typedef struct { char c; int i; short s; } Scis;
+
+void initSc (Sc *p, int i) { p->c = i/16; }
+void initSs (Ss *p, int i) { p->s = i; }
+void initSi (Si *p, int i) { p->i = i; }
+void initSsc (Ssc *p, int i) { p->s = i; p->c = (i/16)+1; }
+void initSis (Sis *p, int i) { p->i = i; p->s = i+1; }
+void initScsi (Scsi *p, int i) { p->c = i/16; p->s = i+1; p->i = i+2; }
+void initScis (Scis *p, int i) { p->c = i/16; p->i = i+1; p->s = i+2; }
+
+#define T(N, TYPE) \
+struct S##TYPE##N { TYPE i[N]; }; \
+ \
+extern struct S##TYPE##N g1s##TYPE##N, g2s##TYPE##N; \
+extern struct S##TYPE##N g3s##TYPE##N, g4s##TYPE##N; \
+extern struct S##TYPE##N g5s##TYPE##N, g6s##TYPE##N; \
+extern struct S##TYPE##N g7s##TYPE##N, g8s##TYPE##N; \
+extern struct S##TYPE##N g9s##TYPE##N, g10s##TYPE##N; \
+extern struct S##TYPE##N g11s##TYPE##N, g12s##TYPE##N; \
+extern struct S##TYPE##N g13s##TYPE##N, g14s##TYPE##N; \
+extern struct S##TYPE##N g15s##TYPE##N, g16s##TYPE##N; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+extern void \
+check##TYPE##N (struct S##TYPE##N *p, int i); \
+ \
+void \
+checkg##TYPE##N (void) \
+{ \
+ check##TYPE##N ( &g1s##TYPE##N, 1*16); \
+ check##TYPE##N ( &g2s##TYPE##N, 2*16); \
+ check##TYPE##N ( &g3s##TYPE##N, 3*16); \
+ check##TYPE##N ( &g4s##TYPE##N, 4*16); \
+ check##TYPE##N ( &g5s##TYPE##N, 5*16); \
+ check##TYPE##N ( &g6s##TYPE##N, 6*16); \
+ check##TYPE##N ( &g7s##TYPE##N, 7*16); \
+ check##TYPE##N ( &g8s##TYPE##N, 8*16); \
+ check##TYPE##N ( &g9s##TYPE##N, 9*16); \
+ check##TYPE##N (&g10s##TYPE##N, 10*16); \
+ check##TYPE##N (&g11s##TYPE##N, 11*16); \
+ check##TYPE##N (&g12s##TYPE##N, 12*16); \
+ check##TYPE##N (&g13s##TYPE##N, 13*16); \
+ check##TYPE##N (&g14s##TYPE##N, 14*16); \
+ check##TYPE##N (&g15s##TYPE##N, 15*16); \
+ check##TYPE##N (&g16s##TYPE##N, 16*16); \
+} \
+ \
+void \
+test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8, \
+ struct S##TYPE##N s9, struct S##TYPE##N s10, \
+ struct S##TYPE##N s11, struct S##TYPE##N s12, \
+ struct S##TYPE##N s13, struct S##TYPE##N s14, \
+ struct S##TYPE##N s15, struct S##TYPE##N s16) \
+{ \
+ check##TYPE##N (&s1, 1*16); \
+ check##TYPE##N (&s2, 2*16); \
+ check##TYPE##N (&s3, 3*16); \
+ check##TYPE##N (&s4, 4*16); \
+ check##TYPE##N (&s5, 5*16); \
+ check##TYPE##N (&s6, 6*16); \
+ check##TYPE##N (&s7, 7*16); \
+ check##TYPE##N (&s8, 8*16); \
+ check##TYPE##N (&s9, 9*16); \
+ check##TYPE##N (&s10, 10*16); \
+ check##TYPE##N (&s11, 11*16); \
+ check##TYPE##N (&s12, 12*16); \
+ check##TYPE##N (&s13, 13*16); \
+ check##TYPE##N (&s14, 14*16); \
+ check##TYPE##N (&s15, 15*16); \
+ check##TYPE##N (&s16, 16*16); \
+} \
+ \
+void \
+testva##TYPE##N (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ struct S##TYPE##N t = va_arg (ap, struct S##TYPE##N); \
+ check##TYPE##N (&t, (i+1)*16); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Sc)
+#endif
+T(1, Sc)
+T(2, Sc)
+T(3, Sc)
+T(4, Sc)
+T(5, Sc)
+T(6, Sc)
+T(7, Sc)
+T(8, Sc)
+T(9, Sc)
+T(10, Sc)
+T(11, Sc)
+T(12, Sc)
+T(13, Sc)
+T(14, Sc)
+T(15, Sc)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Ss)
+#endif
+T(1, Ss)
+T(2, Ss)
+T(3, Ss)
+T(4, Ss)
+T(5, Ss)
+T(6, Ss)
+T(7, Ss)
+T(8, Ss)
+T(9, Ss)
+T(10, Ss)
+T(11, Ss)
+T(12, Ss)
+T(13, Ss)
+T(14, Ss)
+T(15, Ss)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Si)
+#endif
+T(1, Si)
+T(2, Si)
+T(3, Si)
+T(4, Si)
+T(5, Si)
+T(6, Si)
+T(7, Si)
+T(8, Si)
+T(9, Si)
+T(10, Si)
+T(11, Si)
+T(12, Si)
+T(13, Si)
+T(14, Si)
+T(15, Si)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_main.c
new file mode 100644
index 000000000..d6f9eff25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are float
+ scalars. */
+
+extern void struct_by_value_5a_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_5a_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_x.c
new file mode 100644
index 000000000..90738a7a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_x.c
@@ -0,0 +1,43 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+DEFS(f, float)
+CHECKS(f, float)
+
+TEST(Sf1, float)
+TEST(Sf2, float)
+TEST(Sf3, float)
+TEST(Sf4, float)
+TEST(Sf5, float)
+TEST(Sf6, float)
+TEST(Sf7, float)
+TEST(Sf8, float)
+
+#undef T
+
+void
+struct_by_value_5a_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Sf1, float)
+T(Sf2, float)
+T(Sf3, float)
+T(Sf4, float)
+T(Sf5, float)
+T(Sf6, float)
+T(Sf7, float)
+T(Sf8, float)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_y.c
new file mode 100644
index 000000000..9ac1f9134
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5a_y.c
@@ -0,0 +1,25 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+DEFS(f,float)
+INITS(f, float)
+
+TEST(Sf1, float)
+TEST(Sf2, float)
+TEST(Sf3, float)
+TEST(Sf4, float)
+TEST(Sf5, float)
+TEST(Sf6, float)
+TEST(Sf7, float)
+TEST(Sf8, float)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_main.c
new file mode 100644
index 000000000..dcb5f27ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are float
+ scalars. */
+
+extern void struct_by_value_5b_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_5b_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_x.c
new file mode 100644
index 000000000..3c3715587
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_x.c
@@ -0,0 +1,43 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+DEFS(f, float)
+CHECKS(f, float)
+
+TEST(Sf9, float)
+TEST(Sf10, float)
+TEST(Sf11, float)
+TEST(Sf12, float)
+TEST(Sf13, float)
+TEST(Sf14, float)
+TEST(Sf15, float)
+TEST(Sf16, float)
+
+#undef T
+
+void
+struct_by_value_5b_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Sf9, float)
+T(Sf10, float)
+T(Sf11, float)
+T(Sf12, float)
+T(Sf13, float)
+T(Sf14, float)
+T(Sf15, float)
+T(Sf16, float)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c
new file mode 100644
index 000000000..cedc16607
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c
@@ -0,0 +1,25 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+DEFS(f,float)
+INITS(f, float)
+
+TEST(Sf9, float)
+TEST(Sf10, float)
+TEST(Sf11, float)
+TEST(Sf12, float)
+TEST(Sf13, float)
+TEST(Sf14, float)
+TEST(Sf15, float)
+TEST(Sf16, float)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_main.c
new file mode 100644
index 000000000..609c1d673
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are double
+ scalars. */
+
+extern void struct_by_value_6a_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_6a_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_x.c
new file mode 100644
index 000000000..e6852d9c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_x.c
@@ -0,0 +1,43 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+DEFS(d, double)
+CHECKS(d, double)
+
+TEST(Sd1, double)
+TEST(Sd2, double)
+TEST(Sd3, double)
+TEST(Sd4, double)
+TEST(Sd5, double)
+TEST(Sd6, double)
+TEST(Sd7, double)
+TEST(Sd8, double)
+
+#undef T
+
+void
+struct_by_value_6a_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Sd1, double)
+T(Sd2, double)
+T(Sd3, double)
+T(Sd4, double)
+T(Sd5, double)
+T(Sd6, double)
+T(Sd7, double)
+T(Sd8, double)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_y.c
new file mode 100644
index 000000000..8684b53c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6a_y.c
@@ -0,0 +1,25 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+DEFS(d, double)
+INITS(d, double)
+
+TEST(Sd1, double)
+TEST(Sd2, double)
+TEST(Sd3, double)
+TEST(Sd4, double)
+TEST(Sd5, double)
+TEST(Sd6, double)
+TEST(Sd7, double)
+TEST(Sd8, double)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_main.c
new file mode 100644
index 000000000..ff1722171
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are double
+ scalars. */
+
+extern void struct_by_value_6b_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_6b_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_x.c
new file mode 100644
index 000000000..5b285c9c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_x.c
@@ -0,0 +1,43 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+DEFS(d, double)
+CHECKS(d, double)
+
+TEST(Sd9, double)
+TEST(Sd10, double)
+TEST(Sd11, double)
+TEST(Sd12, double)
+TEST(Sd13, double)
+TEST(Sd14, double)
+TEST(Sd15, double)
+TEST(Sd16, double)
+
+#undef T
+
+void
+struct_by_value_6b_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Sd9, double)
+T(Sd10, double)
+T(Sd11, double)
+T(Sd12, double)
+T(Sd13, double)
+T(Sd14, double)
+T(Sd15, double)
+T(Sd16, double)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_y.c
new file mode 100644
index 000000000..c568761b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-6b_y.c
@@ -0,0 +1,25 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+DEFS(d, double)
+INITS(d, double)
+
+TEST(Sd9, double)
+TEST(Sd10, double)
+TEST(Sd11, double)
+TEST(Sd12, double)
+TEST(Sd13, double)
+TEST(Sd14, double)
+TEST(Sd15, double)
+TEST(Sd16, double)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_main.c
new file mode 100644
index 000000000..8379dc563
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are long double
+ scalars. */
+
+extern void struct_by_value_7a_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_7a_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_x.c
new file mode 100644
index 000000000..9818c3c22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_x.c
@@ -0,0 +1,43 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+DEFS(ld, long double)
+CHECKS(ld, long double)
+
+TEST(Sld1, long double)
+TEST(Sld2, long double)
+TEST(Sld3, long double)
+TEST(Sld4, long double)
+TEST(Sld5, long double)
+TEST(Sld6, long double)
+TEST(Sld7, long double)
+TEST(Sld8, long double)
+
+#undef T
+
+void
+struct_by_value_7a_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Sld1, long double)
+T(Sld2, long double)
+T(Sld3, long double)
+T(Sld4, long double)
+T(Sld5, long double)
+T(Sld6, long double)
+T(Sld7, long double)
+T(Sld8, long double)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_y.c
new file mode 100644
index 000000000..cb53df89d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7a_y.c
@@ -0,0 +1,25 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+DEFS(ld, long double)
+INITS(ld, long double)
+
+TEST(Sld1, long double)
+TEST(Sld2, long double)
+TEST(Sld3, long double)
+TEST(Sld4, long double)
+TEST(Sld5, long double)
+TEST(Sld6, long double)
+TEST(Sld7, long double)
+TEST(Sld8, long double)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_main.c
new file mode 100644
index 000000000..5d6908bfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument lists. All struct members are long double
+ scalars. */
+
+extern void struct_by_value_7b_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_7b_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_x.c
new file mode 100644
index 000000000..508ff6165
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_x.c
@@ -0,0 +1,43 @@
+#include "compat-common.h"
+
+#include "fp-struct-defs.h"
+#include "fp-struct-check.h"
+#include "fp-struct-test-by-value-x.h"
+
+DEFS(ld, long double)
+CHECKS(ld, long double)
+
+TEST(Sld9, long double)
+TEST(Sld10, long double)
+TEST(Sld11, long double)
+TEST(Sld12, long double)
+TEST(Sld13, long double)
+TEST(Sld14, long double)
+TEST(Sld15, long double)
+TEST(Sld16, long double)
+
+#undef T
+
+void
+struct_by_value_7b_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE, MTYPE) testit##TYPE ();
+
+T(Sld9, long double)
+T(Sld10, long double)
+T(Sld11, long double)
+T(Sld12, long double)
+T(Sld13, long double)
+T(Sld14, long double)
+T(Sld15, long double)
+T(Sld16, long double)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_y.c
new file mode 100644
index 000000000..cc70a7d29
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-7b_y.c
@@ -0,0 +1,25 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "fp-struct-defs.h"
+#include "fp-struct-init.h"
+#include "fp-struct-test-by-value-y.h"
+
+DEFS(ld, long double)
+INITS(ld, long double)
+
+TEST(Sld9, long double)
+TEST(Sld10, long double)
+TEST(Sld11, long double)
+TEST(Sld12, long double)
+TEST(Sld13, long double)
+TEST(Sld14, long double)
+TEST(Sld15, long double)
+TEST(Sld16, long double)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_main.c
new file mode 100644
index 000000000..cc094fcc9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list. Each struct contains an array
+ of small structs with two scalar members. */
+
+extern void struct_by_value_8_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_8_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c
new file mode 100644
index 000000000..5a376fd38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_x.c
@@ -0,0 +1,221 @@
+#include "compat-common.h"
+
+#define T(N, TYPE) \
+struct S##TYPE##N { TYPE i[N]; }; \
+ \
+struct S##TYPE##N g1s##TYPE##N, g2s##TYPE##N; \
+struct S##TYPE##N g3s##TYPE##N, g4s##TYPE##N; \
+struct S##TYPE##N g5s##TYPE##N, g6s##TYPE##N; \
+struct S##TYPE##N g7s##TYPE##N, g8s##TYPE##N; \
+struct S##TYPE##N g9s##TYPE##N, g10s##TYPE##N; \
+struct S##TYPE##N g11s##TYPE##N, g12s##TYPE##N; \
+struct S##TYPE##N g13s##TYPE##N, g14s##TYPE##N; \
+struct S##TYPE##N g15s##TYPE##N, g16s##TYPE##N; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE##N (void); \
+extern void \
+test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8, \
+ struct S##TYPE##N s9, struct S##TYPE##N s10, \
+ struct S##TYPE##N s11, struct S##TYPE##N s12, \
+ struct S##TYPE##N s13, struct S##TYPE##N s14, \
+ struct S##TYPE##N s15, struct S##TYPE##N s16); \
+extern void testva##TYPE##N (int n, ...); \
+ \
+ \
+void \
+init##TYPE##N (struct S##TYPE##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ init##TYPE(&p->i[j], i+j); \
+} \
+ \
+void \
+check##TYPE##N (struct S##TYPE##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ check##TYPE(p->i[j], i+j); \
+} \
+ \
+void \
+test2_##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8) \
+{ \
+ test##TYPE##N (s1, g2s##TYPE##N, s2, g4s##TYPE##N, \
+ s3, g6s##TYPE##N, s4, g8s##TYPE##N, \
+ s5, g10s##TYPE##N, s6, g12s##TYPE##N, \
+ s7, g14s##TYPE##N, s8, g16s##TYPE##N); \
+} \
+ \
+void \
+testit##TYPE##N (void) \
+{ \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE##N ( &g1s##TYPE##N, 1*16); \
+ init##TYPE##N ( &g2s##TYPE##N, 2*16); \
+ init##TYPE##N ( &g3s##TYPE##N, 3*16); \
+ init##TYPE##N ( &g4s##TYPE##N, 4*16); \
+ init##TYPE##N ( &g5s##TYPE##N, 5*16); \
+ init##TYPE##N ( &g6s##TYPE##N, 6*16); \
+ init##TYPE##N ( &g7s##TYPE##N, 7*16); \
+ init##TYPE##N ( &g8s##TYPE##N, 8*16); \
+ init##TYPE##N ( &g9s##TYPE##N, 9*16); \
+ init##TYPE##N (&g10s##TYPE##N, 10*16); \
+ init##TYPE##N (&g11s##TYPE##N, 11*16); \
+ init##TYPE##N (&g12s##TYPE##N, 12*16); \
+ init##TYPE##N (&g13s##TYPE##N, 13*16); \
+ init##TYPE##N (&g14s##TYPE##N, 14*16); \
+ init##TYPE##N (&g15s##TYPE##N, 15*16); \
+ init##TYPE##N (&g16s##TYPE##N, 16*16); \
+ checkg##TYPE##N (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE##N (g1s##TYPE##N, g2s##TYPE##N, \
+ g3s##TYPE##N, g4s##TYPE##N, \
+ g5s##TYPE##N, g6s##TYPE##N, \
+ g7s##TYPE##N, g8s##TYPE##N, \
+ g9s##TYPE##N, g10s##TYPE##N, \
+ g11s##TYPE##N, g12s##TYPE##N, \
+ g13s##TYPE##N, g14s##TYPE##N, \
+ g15s##TYPE##N, g16s##TYPE##N); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" testva:"); \
+ testva##TYPE##N (16, \
+ g1s##TYPE##N, g2s##TYPE##N, \
+ g3s##TYPE##N, g4s##TYPE##N, \
+ g5s##TYPE##N, g6s##TYPE##N, \
+ g7s##TYPE##N, g8s##TYPE##N, \
+ g9s##TYPE##N, g10s##TYPE##N, \
+ g11s##TYPE##N, g12s##TYPE##N, \
+ g13s##TYPE##N, g14s##TYPE##N, \
+ g15s##TYPE##N, g16s##TYPE##N); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##TYPE##N (g1s##TYPE##N, g3s##TYPE##N, \
+ g5s##TYPE##N, g7s##TYPE##N, \
+ g9s##TYPE##N, g11s##TYPE##N, \
+ g13s##TYPE##N, g15s##TYPE##N); \
+ DEBUG_NL; \
+}
+
+typedef struct { char c; } Sc;
+typedef struct { short s; } Ss;
+typedef struct { int i; } Si;
+typedef struct { short s; char c; } Ssc;
+typedef struct { int i; short s; } Sis;
+typedef struct { char c; short s; int i; } Scsi;
+typedef struct { char c; int i; short s; } Scis;
+
+void checkSc (Sc x, int i) { if (x.c != i/16) DEBUG_CHECK }
+void checkSs (Ss x, int i) { if (x.s != i) DEBUG_CHECK }
+void checkSi (Si x, int i) { if (x.i != i) DEBUG_CHECK }
+void checkSsc (Ssc x, int i)
+{ if (x.s != i || x.c != (i/16)+1) DEBUG_CHECK }
+void checkSis (Sis x, int i)
+{ if (x.i != i || x.s != i+1) DEBUG_CHECK }
+void checkScsi (Scsi x, int i)
+{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) DEBUG_CHECK }
+void checkScis (Scis x, int i)
+{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) DEBUG_CHECK }
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Ssc)
+#endif
+T(1, Ssc)
+T(2, Ssc)
+T(3, Ssc)
+T(4, Ssc)
+T(5, Ssc)
+T(6, Ssc)
+T(7, Ssc)
+T(8, Ssc)
+T(9, Ssc)
+T(10, Ssc)
+T(11, Ssc)
+T(12, Ssc)
+T(13, Ssc)
+T(14, Ssc)
+T(15, Ssc)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Sis)
+#endif
+T(1, Sis)
+T(2, Sis)
+T(3, Sis)
+T(4, Sis)
+T(5, Sis)
+T(6, Sis)
+T(7, Sis)
+T(8, Sis)
+T(9, Sis)
+T(10, Sis)
+T(11, Sis)
+T(12, Sis)
+T(13, Sis)
+T(14, Sis)
+T(15, Sis)
+
+#undef T
+
+void
+struct_by_value_8_x ()
+{
+DEBUG_INIT
+
+#define T(N, TYPE) testit##TYPE##N ();
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Ssc)
+#endif
+T(1, Ssc)
+T(2, Ssc)
+T(3, Ssc)
+T(4, Ssc)
+T(5, Ssc)
+T(6, Ssc)
+T(7, Ssc)
+T(8, Ssc)
+T(9, Ssc)
+T(10, Ssc)
+T(11, Ssc)
+T(12, Ssc)
+T(13, Ssc)
+T(14, Ssc)
+T(15, Ssc)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Sis)
+#endif
+T(1, Sis)
+T(2, Sis)
+T(3, Sis)
+T(4, Sis)
+T(5, Sis)
+T(6, Sis)
+T(7, Sis)
+T(8, Sis)
+T(9, Sis)
+T(10, Sis)
+T(11, Sis)
+T(12, Sis)
+T(13, Sis)
+T(14, Sis)
+T(15, Sis)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_y.c
new file mode 100644
index 000000000..b246fd448
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-8_y.c
@@ -0,0 +1,144 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+typedef struct { char c; } Sc;
+typedef struct { short s; } Ss;
+typedef struct { int i; } Si;
+typedef struct { short s; char c; } Ssc;
+typedef struct { int i; short s; } Sis;
+typedef struct { char c; short s; int i; } Scsi;
+typedef struct { char c; int i; short s; } Scis;
+
+void initSc (Sc *p, int i) { p->c = i/16; }
+void initSs (Ss *p, int i) { p->s = i; }
+void initSi (Si *p, int i) { p->i = i; }
+void initSsc (Ssc *p, int i) { p->s = i; p->c = (i/16)+1; }
+void initSis (Sis *p, int i) { p->i = i; p->s = i+1; }
+void initScsi (Scsi *p, int i) { p->c = i/16; p->s = i+1; p->i = i+2; }
+void initScis (Scis *p, int i) { p->c = i/16; p->i = i+1; p->s = i+2; }
+
+#define T(N, TYPE) \
+struct S##TYPE##N { TYPE i[N]; }; \
+ \
+extern struct S##TYPE##N g1s##TYPE##N, g2s##TYPE##N; \
+extern struct S##TYPE##N g3s##TYPE##N, g4s##TYPE##N; \
+extern struct S##TYPE##N g5s##TYPE##N, g6s##TYPE##N; \
+extern struct S##TYPE##N g7s##TYPE##N, g8s##TYPE##N; \
+extern struct S##TYPE##N g9s##TYPE##N, g10s##TYPE##N; \
+extern struct S##TYPE##N g11s##TYPE##N, g12s##TYPE##N; \
+extern struct S##TYPE##N g13s##TYPE##N, g14s##TYPE##N; \
+extern struct S##TYPE##N g15s##TYPE##N, g16s##TYPE##N; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+extern void \
+check##TYPE##N (struct S##TYPE##N *p, int i); \
+ \
+void \
+checkg##TYPE##N (void) \
+{ \
+ check##TYPE##N ( &g1s##TYPE##N, 1*16); \
+ check##TYPE##N ( &g2s##TYPE##N, 2*16); \
+ check##TYPE##N ( &g3s##TYPE##N, 3*16); \
+ check##TYPE##N ( &g4s##TYPE##N, 4*16); \
+ check##TYPE##N ( &g5s##TYPE##N, 5*16); \
+ check##TYPE##N ( &g6s##TYPE##N, 6*16); \
+ check##TYPE##N ( &g7s##TYPE##N, 7*16); \
+ check##TYPE##N ( &g8s##TYPE##N, 8*16); \
+ check##TYPE##N ( &g9s##TYPE##N, 9*16); \
+ check##TYPE##N (&g10s##TYPE##N, 10*16); \
+ check##TYPE##N (&g11s##TYPE##N, 11*16); \
+ check##TYPE##N (&g12s##TYPE##N, 12*16); \
+ check##TYPE##N (&g13s##TYPE##N, 13*16); \
+ check##TYPE##N (&g14s##TYPE##N, 14*16); \
+ check##TYPE##N (&g15s##TYPE##N, 15*16); \
+ check##TYPE##N (&g16s##TYPE##N, 16*16); \
+} \
+ \
+void \
+test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8, \
+ struct S##TYPE##N s9, struct S##TYPE##N s10, \
+ struct S##TYPE##N s11, struct S##TYPE##N s12, \
+ struct S##TYPE##N s13, struct S##TYPE##N s14, \
+ struct S##TYPE##N s15, struct S##TYPE##N s16) \
+{ \
+ check##TYPE##N (&s1, 1*16); \
+ check##TYPE##N (&s2, 2*16); \
+ check##TYPE##N (&s3, 3*16); \
+ check##TYPE##N (&s4, 4*16); \
+ check##TYPE##N (&s5, 5*16); \
+ check##TYPE##N (&s6, 6*16); \
+ check##TYPE##N (&s7, 7*16); \
+ check##TYPE##N (&s8, 8*16); \
+ check##TYPE##N (&s9, 9*16); \
+ check##TYPE##N (&s10, 10*16); \
+ check##TYPE##N (&s11, 11*16); \
+ check##TYPE##N (&s12, 12*16); \
+ check##TYPE##N (&s13, 13*16); \
+ check##TYPE##N (&s14, 14*16); \
+ check##TYPE##N (&s15, 15*16); \
+ check##TYPE##N (&s16, 16*16); \
+} \
+ \
+void \
+testva##TYPE##N (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ struct S##TYPE##N t = va_arg (ap, struct S##TYPE##N); \
+ check##TYPE##N (&t, (i+1)*16); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Ssc)
+#endif
+T(1, Ssc)
+T(2, Ssc)
+T(3, Ssc)
+T(4, Ssc)
+T(5, Ssc)
+T(6, Ssc)
+T(7, Ssc)
+T(8, Ssc)
+T(9, Ssc)
+T(10, Ssc)
+T(11, Ssc)
+T(12, Ssc)
+T(13, Ssc)
+T(14, Ssc)
+T(15, Ssc)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Sis)
+#endif
+T(1, Sis)
+T(2, Sis)
+T(3, Sis)
+T(4, Sis)
+T(5, Sis)
+T(6, Sis)
+T(7, Sis)
+T(8, Sis)
+T(9, Sis)
+T(10, Sis)
+T(11, Sis)
+T(12, Sis)
+T(13, Sis)
+T(14, Sis)
+T(15, Sis)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_main.c
new file mode 100644
index 000000000..942de1355
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_main.c
@@ -0,0 +1,14 @@
+/* Test structures passed by value, including to a function with a
+ variable-length argument list. Each struct contains an array
+ of small structs, each with three scalar members. */
+
+extern void struct_by_value_9_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_by_value_9_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c
new file mode 100644
index 000000000..5bbef770a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_x.c
@@ -0,0 +1,224 @@
+#include "compat-common.h"
+
+#define T(N, TYPE) \
+struct S##TYPE##N { TYPE i[N]; }; \
+ \
+struct S##TYPE##N g1s##TYPE##N, g2s##TYPE##N; \
+struct S##TYPE##N g3s##TYPE##N, g4s##TYPE##N; \
+struct S##TYPE##N g5s##TYPE##N, g6s##TYPE##N; \
+struct S##TYPE##N g7s##TYPE##N, g8s##TYPE##N; \
+struct S##TYPE##N g9s##TYPE##N, g10s##TYPE##N; \
+struct S##TYPE##N g11s##TYPE##N, g12s##TYPE##N; \
+struct S##TYPE##N g13s##TYPE##N, g14s##TYPE##N; \
+struct S##TYPE##N g15s##TYPE##N, g16s##TYPE##N; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE##N (void); \
+extern void \
+test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8, \
+ struct S##TYPE##N s9, struct S##TYPE##N s10, \
+ struct S##TYPE##N s11, struct S##TYPE##N s12, \
+ struct S##TYPE##N s13, struct S##TYPE##N s14, \
+ struct S##TYPE##N s15, struct S##TYPE##N s16); \
+extern void testva##TYPE##N (int n, ...); \
+ \
+ \
+void \
+init##TYPE##N (struct S##TYPE##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ init##TYPE(&p->i[j], i+j); \
+} \
+ \
+void \
+check##TYPE##N (struct S##TYPE##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ check##TYPE(p->i[j], i+j); \
+} \
+ \
+void \
+test2_##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8) \
+{ \
+ test##TYPE##N (s1, g2s##TYPE##N, s2, g4s##TYPE##N, \
+ s3, g6s##TYPE##N, s4, g8s##TYPE##N, \
+ s5, g10s##TYPE##N, s6, g12s##TYPE##N, \
+ s7, g14s##TYPE##N, s8, g16s##TYPE##N); \
+} \
+ \
+void \
+testit##TYPE##N (void) \
+{ \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE##N ( &g1s##TYPE##N, 1*16); \
+ init##TYPE##N ( &g2s##TYPE##N, 2*16); \
+ init##TYPE##N ( &g3s##TYPE##N, 3*16); \
+ init##TYPE##N ( &g4s##TYPE##N, 4*16); \
+ init##TYPE##N ( &g5s##TYPE##N, 5*16); \
+ init##TYPE##N ( &g6s##TYPE##N, 6*16); \
+ init##TYPE##N ( &g7s##TYPE##N, 7*16); \
+ init##TYPE##N ( &g8s##TYPE##N, 8*16); \
+ init##TYPE##N ( &g9s##TYPE##N, 9*16); \
+ init##TYPE##N (&g10s##TYPE##N, 10*16); \
+ init##TYPE##N (&g11s##TYPE##N, 11*16); \
+ init##TYPE##N (&g12s##TYPE##N, 12*16); \
+ init##TYPE##N (&g13s##TYPE##N, 13*16); \
+ init##TYPE##N (&g14s##TYPE##N, 14*16); \
+ init##TYPE##N (&g15s##TYPE##N, 15*16); \
+ init##TYPE##N (&g16s##TYPE##N, 16*16); \
+ checkg##TYPE##N (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE##N (g1s##TYPE##N, g2s##TYPE##N, \
+ g3s##TYPE##N, g4s##TYPE##N, \
+ g5s##TYPE##N, g6s##TYPE##N, \
+ g7s##TYPE##N, g8s##TYPE##N, \
+ g9s##TYPE##N, g10s##TYPE##N, \
+ g11s##TYPE##N, g12s##TYPE##N, \
+ g13s##TYPE##N, g14s##TYPE##N, \
+ g15s##TYPE##N, g16s##TYPE##N); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE##N (16, \
+ g1s##TYPE##N, g2s##TYPE##N, \
+ g3s##TYPE##N, g4s##TYPE##N, \
+ g5s##TYPE##N, g6s##TYPE##N, \
+ g7s##TYPE##N, g8s##TYPE##N, \
+ g9s##TYPE##N, g10s##TYPE##N, \
+ g11s##TYPE##N, g12s##TYPE##N, \
+ g13s##TYPE##N, g14s##TYPE##N, \
+ g15s##TYPE##N, g16s##TYPE##N); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE "[" #N "]"); \
+ DEBUG_FPUTS (" test2: "); \
+ test2_##TYPE##N (g1s##TYPE##N, g3s##TYPE##N, \
+ g5s##TYPE##N, g7s##TYPE##N, \
+ g9s##TYPE##N, g11s##TYPE##N, \
+ g13s##TYPE##N, g15s##TYPE##N); \
+ DEBUG_NL; \
+}
+
+typedef struct { char c; } Sc;
+typedef struct { short s; } Ss;
+typedef struct { int i; } Si;
+typedef struct { short s; char c; } Ssc;
+typedef struct { int i; short s; } Sis;
+typedef struct { char c; short s; int i; } Scsi;
+typedef struct { char c; int i; short s; } Scis;
+
+extern void abort (void);
+
+void checkSc (Sc x, int i) { if (x.c != i/16) DEBUG_CHECK }
+void checkSs (Ss x, int i) { if (x.s != i) DEBUG_CHECK }
+void checkSi (Si x, int i) { if (x.i != i) DEBUG_CHECK }
+void checkSsc (Ssc x, int i)
+{ if (x.s != i || x.c != (i/16)+1) DEBUG_CHECK }
+void checkSis (Sis x, int i)
+{ if (x.i != i || x.s != i+1) DEBUG_CHECK }
+void checkScsi (Scsi x, int i)
+{ if (x.c != i/16 || x.s != i+1 || x.i != i+2) DEBUG_CHECK }
+void checkScis (Scis x, int i)
+{ if (x.c != i/16 || x.i != i+1 || x.s != i+2) DEBUG_CHECK }
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Scsi)
+#endif
+T(1, Scsi)
+T(2, Scsi)
+T(3, Scsi)
+T(4, Scsi)
+T(5, Scsi)
+T(6, Scsi)
+T(7, Scsi)
+T(8, Scsi)
+T(9, Scsi)
+T(10, Scsi)
+T(11, Scsi)
+T(12, Scsi)
+T(13, Scsi)
+T(14, Scsi)
+T(15, Scsi)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Scis)
+#endif
+T(1, Scis)
+T(2, Scis)
+T(3, Scis)
+T(4, Scis)
+T(5, Scis)
+T(6, Scis)
+T(7, Scis)
+T(8, Scis)
+T(9, Scis)
+T(10, Scis)
+T(11, Scis)
+T(12, Scis)
+T(13, Scis)
+T(14, Scis)
+T(15, Scis)
+
+#undef T
+
+void
+struct_by_value_9_x ()
+{
+DEBUG_INIT
+
+#define T(N, TYPE) testit##TYPE##N ();
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Scsi)
+#endif
+T(1, Scsi)
+T(2, Scsi)
+T(3, Scsi)
+T(4, Scsi)
+T(5, Scsi)
+T(6, Scsi)
+T(7, Scsi)
+T(8, Scsi)
+T(9, Scsi)
+T(10, Scsi)
+T(11, Scsi)
+T(12, Scsi)
+T(13, Scsi)
+T(14, Scsi)
+T(15, Scsi)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Scis)
+#endif
+T(1, Scis)
+T(2, Scis)
+T(3, Scis)
+T(4, Scis)
+T(5, Scis)
+T(6, Scis)
+T(7, Scis)
+T(8, Scis)
+T(9, Scis)
+T(10, Scis)
+T(11, Scis)
+T(12, Scis)
+T(13, Scis)
+T(14, Scis)
+T(15, Scis)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_y.c
new file mode 100644
index 000000000..0f6521800
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-by-value-9_y.c
@@ -0,0 +1,144 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+typedef struct { char c; } Sc;
+typedef struct { short s; } Ss;
+typedef struct { int i; } Si;
+typedef struct { short s; char c; } Ssc;
+typedef struct { int i; short s; } Sis;
+typedef struct { char c; short s; int i; } Scsi;
+typedef struct { char c; int i; short s; } Scis;
+
+void initSc (Sc *p, int i) { p->c = i/16; }
+void initSs (Ss *p, int i) { p->s = i; }
+void initSi (Si *p, int i) { p->i = i; }
+void initSsc (Ssc *p, int i) { p->s = i; p->c = (i/16)+1; }
+void initSis (Sis *p, int i) { p->i = i; p->s = i+1; }
+void initScsi (Scsi *p, int i) { p->c = i/16; p->s = i+1; p->i = i+2; }
+void initScis (Scis *p, int i) { p->c = i/16; p->i = i+1; p->s = i+2; }
+
+#define T(N, TYPE) \
+struct S##TYPE##N { TYPE i[N]; }; \
+ \
+extern struct S##TYPE##N g1s##TYPE##N, g2s##TYPE##N; \
+extern struct S##TYPE##N g3s##TYPE##N, g4s##TYPE##N; \
+extern struct S##TYPE##N g5s##TYPE##N, g6s##TYPE##N; \
+extern struct S##TYPE##N g7s##TYPE##N, g8s##TYPE##N; \
+extern struct S##TYPE##N g9s##TYPE##N, g10s##TYPE##N; \
+extern struct S##TYPE##N g11s##TYPE##N, g12s##TYPE##N; \
+extern struct S##TYPE##N g13s##TYPE##N, g14s##TYPE##N; \
+extern struct S##TYPE##N g15s##TYPE##N, g16s##TYPE##N; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+extern void \
+check##TYPE##N (struct S##TYPE##N *p, int i); \
+ \
+void \
+checkg##TYPE##N (void) \
+{ \
+ check##TYPE##N ( &g1s##TYPE##N, 1*16); \
+ check##TYPE##N ( &g2s##TYPE##N, 2*16); \
+ check##TYPE##N ( &g3s##TYPE##N, 3*16); \
+ check##TYPE##N ( &g4s##TYPE##N, 4*16); \
+ check##TYPE##N ( &g5s##TYPE##N, 5*16); \
+ check##TYPE##N ( &g6s##TYPE##N, 6*16); \
+ check##TYPE##N ( &g7s##TYPE##N, 7*16); \
+ check##TYPE##N ( &g8s##TYPE##N, 8*16); \
+ check##TYPE##N ( &g9s##TYPE##N, 9*16); \
+ check##TYPE##N (&g10s##TYPE##N, 10*16); \
+ check##TYPE##N (&g11s##TYPE##N, 11*16); \
+ check##TYPE##N (&g12s##TYPE##N, 12*16); \
+ check##TYPE##N (&g13s##TYPE##N, 13*16); \
+ check##TYPE##N (&g14s##TYPE##N, 14*16); \
+ check##TYPE##N (&g15s##TYPE##N, 15*16); \
+ check##TYPE##N (&g16s##TYPE##N, 16*16); \
+} \
+ \
+void \
+test##TYPE##N (struct S##TYPE##N s1, struct S##TYPE##N s2, \
+ struct S##TYPE##N s3, struct S##TYPE##N s4, \
+ struct S##TYPE##N s5, struct S##TYPE##N s6, \
+ struct S##TYPE##N s7, struct S##TYPE##N s8, \
+ struct S##TYPE##N s9, struct S##TYPE##N s10, \
+ struct S##TYPE##N s11, struct S##TYPE##N s12, \
+ struct S##TYPE##N s13, struct S##TYPE##N s14, \
+ struct S##TYPE##N s15, struct S##TYPE##N s16) \
+{ \
+ check##TYPE##N (&s1, 1*16); \
+ check##TYPE##N (&s2, 2*16); \
+ check##TYPE##N (&s3, 3*16); \
+ check##TYPE##N (&s4, 4*16); \
+ check##TYPE##N (&s5, 5*16); \
+ check##TYPE##N (&s6, 6*16); \
+ check##TYPE##N (&s7, 7*16); \
+ check##TYPE##N (&s8, 8*16); \
+ check##TYPE##N (&s9, 9*16); \
+ check##TYPE##N (&s10, 10*16); \
+ check##TYPE##N (&s11, 11*16); \
+ check##TYPE##N (&s12, 12*16); \
+ check##TYPE##N (&s13, 13*16); \
+ check##TYPE##N (&s14, 14*16); \
+ check##TYPE##N (&s15, 15*16); \
+ check##TYPE##N (&s16, 16*16); \
+} \
+ \
+void \
+testva##TYPE##N (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ struct S##TYPE##N t = va_arg (ap, struct S##TYPE##N); \
+ check##TYPE##N (&t, (i+1)*16); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, Scsi)
+#endif
+T(1, Scsi)
+T(2, Scsi)
+T(3, Scsi)
+T(4, Scsi)
+T(5, Scsi)
+T(6, Scsi)
+T(7, Scsi)
+T(8, Scsi)
+T(9, Scsi)
+T(10, Scsi)
+T(11, Scsi)
+T(12, Scsi)
+T(13, Scsi)
+T(14, Scsi)
+T(15, Scsi)
+#ifndef SKIP_ZERO_ARRAY
+T(0, Scis)
+#endif
+T(1, Scis)
+T(2, Scis)
+T(3, Scis)
+T(4, Scis)
+T(5, Scis)
+T(6, Scis)
+T(7, Scis)
+T(8, Scis)
+T(9, Scis)
+T(10, Scis)
+T(11, Scis)
+T(12, Scis)
+T(13, Scis)
+T(14, Scis)
+T(15, Scis)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1.h
new file mode 100644
index 000000000..8b5393774
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1.h
@@ -0,0 +1,17 @@
+#include <complex.h>
+
+struct st
+{
+ int s1;
+ float complex x;
+ int s2;
+};
+
+typedef struct { float r, i; } _complex;
+
+struct stc
+{
+ int s1;
+ _complex x;
+ int s2;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_main.c
new file mode 100644
index 000000000..92e886acf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_main.c
@@ -0,0 +1,21 @@
+/* { dg-options "-O" } */
+
+#ifdef __x86_64__
+/* Test function argument passing. PR target/15302. */
+
+extern void struct_complex_1_x (void);
+extern void exit (int);
+
+int
+main ()
+{
+ struct_complex_1_x ();
+ exit (0);
+}
+#else
+int
+main ()
+{
+ return 0;
+}
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
new file mode 100644
index 000000000..0c6723948
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
@@ -0,0 +1,33 @@
+/* { dg-options "-O -Wno-psabi" } */
+
+
+#ifdef __x86_64__
+#include "struct-complex-1.h"
+
+struct st st1;
+struct stc st2;
+
+extern void foo ();
+extern void bar ();
+
+int
+struct_complex_1_x ()
+{
+ st1.s1 = 1;
+ st1.s2 = 2;
+ __real__ st1.x = 2;
+ __imag__ st1.x = 4;
+ st2.s1 = 1;
+ st2.s2 = 2;
+ st2.x.r = 2;
+ st2.x.i = 4;
+ foo (st1);
+ foo (st2);
+ bar (st1);
+ bar (st2);
+ return 0;
+}
+#else
+int dummy_x;
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_y.c
new file mode 100644
index 000000000..858e6a9da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-1_y.c
@@ -0,0 +1,24 @@
+/* { dg-options "-O -Wno-psabi" } */
+
+#ifdef __x86_64__
+#include <stdlib.h>
+#include "struct-complex-1.h"
+
+void
+bar(struct st x)
+{
+ if (x.s1 != 1 || x.s2 != 2
+ || __real__ x.x != 2 || __imag__ x.x != 4)
+ abort ();
+}
+
+void
+foo(struct stc x)
+{
+ if (x.s1 != 1 || x.s2 != 2 || x.x.r != 2 || x.x.i != 4)
+ abort ();
+}
+#else
+int dummy_y;
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2.h
new file mode 100644
index 000000000..1fd1e86c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2.h
@@ -0,0 +1,15 @@
+#include <complex.h>
+
+struct st
+{
+ int s1;
+ float complex x;
+};
+
+typedef struct { float r, i; } _complex;
+
+struct stc
+{
+ int s1;
+ _complex x;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_main.c
new file mode 100644
index 000000000..74eae6242
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_main.c
@@ -0,0 +1,21 @@
+/* { dg-options "-O" } */
+
+#ifdef __x86_64__
+/* Test function argument passing. PR target/39678. */
+
+extern void struct_complex_2_x (void);
+extern void exit (int);
+
+int
+main ()
+{
+ struct_complex_2_x ();
+ exit (0);
+}
+#else
+int
+main ()
+{
+ return 0;
+}
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
new file mode 100644
index 000000000..2fb9826eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
@@ -0,0 +1,30 @@
+/* { dg-options "-O -Wno-psabi" } */
+
+
+#ifdef __x86_64__
+#include "struct-complex-2.h"
+
+struct st st1;
+struct stc st2;
+
+extern void foo ();
+extern void bar ();
+
+int
+struct_complex_2_x ()
+{
+ st1.s1 = 1;
+ __real__ st1.x = 2;
+ __imag__ st1.x = 4;
+ st2.s1 = 1;
+ st2.x.r = 2;
+ st2.x.i = 4;
+ foo (st1);
+ foo (st2);
+ bar (st1);
+ bar (st2);
+ return 0;
+}
+#else
+int dummy_x;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_y.c
new file mode 100644
index 000000000..54a72fa43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-complex-2_y.c
@@ -0,0 +1,23 @@
+/* { dg-options "-O -Wno-psabi" } */
+
+#ifdef __x86_64__
+#include <stdlib.h>
+#include "struct-complex-2.h"
+
+void
+bar(struct st x)
+{
+ if (x.s1 != 1
+ || __real__ x.x != 2 || __imag__ x.x != 4)
+ abort ();
+}
+
+void
+foo(struct stc x)
+{
+ if (x.s1 != 1 || x.x.r != 2 || x.x.i != 4)
+ abort ();
+}
+#else
+int dummy_y;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp
new file mode 100644
index 000000000..e49cc714c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp
@@ -0,0 +1,130 @@
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# This file was written by Jakub Jelinek, <jakub@redhat.com>
+# Based on compat.exp writte by Janis Johnson, <janis187@us.ibm.com>
+
+
+# Test interoperability of two compilers that follow the same ABI.
+#
+# Break simple tests into two pieces and see that they work when linked
+# together. If an alternate compiler is specified then the two main
+# pieces of each test are compiled with different compilers. The
+# alternate compiler must be installed, and is specified by defining
+# ALT_CC_UNDER_TEST in the environment.
+#
+# struct-layout-1 are generated structure layout interoperability tests,
+# so a generator first needs to be compiled on host, run there and the
+# generated tests then compiled on build and executed on target.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+global GCC_UNDER_TEST
+global compat_save_gcc_under_test
+global compat_use_alt
+global compat_same_alt
+global compat_have_dfp
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib gcc.exp
+load_lib target-libpath.exp
+
+# Load the language-dependent compabibility support procedures.
+load_lib c-compat.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib compat.exp
+
+gcc_init
+
+# Save variables for the C compiler under test, which each test will
+# change a couple of times. This must be done after calling gcc-init.
+set compat_save_gcc_under_test $GCC_UNDER_TEST
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other compat tests running at the same time.
+set sid "c_compat"
+
+# Find out whether there is an alternate compiler to test. If the
+# variable is defined but is set to "same", that means we use the same
+# compiler twice, which is meaningful if the two parts of COMPAT_OPTIONS
+# are different.
+set compat_use_alt 0
+set compat_same_alt 0
+
+if [info exists ALT_CC_UNDER_TEST] then {
+ set compat_use_alt 1
+ if [string match "same" $ALT_CC_UNDER_TEST] then {
+ set compat_same_alt 1
+ }
+}
+
+compat_setup_dfp
+
+if { $compat_have_dfp == 0 } {
+ set skip_dfp "-DSKIP_DECIMAL_FLOAT"
+} else {
+ set skip_dfp ""
+}
+
+set tstobjdir "$tmpdir/gcc.dg-struct-layout-1"
+set generator "$tmpdir/gcc.dg-struct-layout-1_generate.exe"
+
+set generator_src "$srcdir/$subdir/struct-layout-1_generate.c"
+set generator_src "$generator_src $srcdir/$subdir/generate-random.c"
+set generator_src "$generator_src $srcdir/$subdir/generate-random_r.c"
+set generator_cmd "-o $generator $skip_dfp $generator_src"
+
+# Temporarily switch to the environment for the host compiler.
+restore_ld_library_path_env_vars
+set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"]
+set status [lindex $status 0]
+set_ld_library_path_env_vars
+
+if { $status == 0 } then {
+ file delete -force $tstobjdir
+ file mkdir $tstobjdir
+ set generator_args "-s $srcdir/$subdir -d $tstobjdir"
+ if [info exists env(RUN_ALL_COMPAT_TESTS) ] then {
+ set generator_args "$generator_args -n 15000"
+ }
+ if [check_effective_target_short_enums] then {
+ set generator_args "-e $generator_args"
+ }
+ set status [remote_exec host "$generator $generator_args"]
+ set status [lindex $status 0]
+ if { $status == 0 } then {
+ foreach src [lsort [find $tstobjdir *_main.c]] {
+ # If we're only testing specific files and this isn't one
+ # of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+
+ compat-execute $src $sid $compat_use_alt
+ }
+ } else {
+ warning "Could not execute gcc.dg/compat/struct-layout-1 generator"
+ }
+} else {
+ warning "Could not compile gcc.dg/compat/struct-layout-1 generator"
+}
+
+# Restore the original compiler under test.
+compat-use-tst-compiler
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1.h
new file mode 100644
index 000000000..82ac9f82c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1.h
@@ -0,0 +1,787 @@
+#include <limits.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "compat-common.h"
+
+#ifndef SKIP_ATTRIBUTE
+# include "vector-defs.h"
+#else
+typedef int qi;
+typedef int hi;
+typedef int si;
+typedef int di;
+typedef float sf;
+typedef float df;
+typedef int v8qi;
+typedef int v16qi;
+typedef int v2hi;
+typedef int v4hi;
+typedef int v8hi;
+typedef int v2si;
+typedef int v4si;
+typedef int v1di;
+typedef int v2di;
+typedef int v2sf;
+typedef int v4sf;
+typedef int v16sf;
+typedef int v2df;
+typedef int u8qi;
+typedef int u16qi;
+typedef int u2hi;
+typedef int u4hi;
+typedef int u8hi;
+typedef int u2si;
+typedef int u4si;
+typedef int u1di;
+typedef int u2di;
+typedef int u2sf;
+typedef int u4sf;
+typedef int u16sf;
+typedef int u2df;
+#endif
+#if (defined __i386__ || defined __x86_64__) && !defined SKIP_ATTRIBUTE
+# ifdef __MMX__
+typedef int __m64 __attribute__ ((__vector_size__ (8)));
+# else
+typedef int __m64;
+# endif
+# ifdef __SSE__
+typedef float __m128 __attribute__ ((__vector_size__ (16)));
+# else
+typedef int __m128;
+# endif
+#else
+typedef int __m64;
+typedef int __m128;
+#endif
+#if defined (__uClinux__)
+/* The maximum achievable alignment on uClinux is usually 16 bytes. */
+#define v16sf v4sf
+#define u16sf u4sf
+#endif
+
+#define FLDS_MAX 32
+extern struct Info
+{
+ int nfields, nbitfields;
+ void *sp, *a0p, *a3p;
+ void *flds[FLDS_MAX];
+ size_t sz, sizes[FLDS_MAX];
+ size_t als, ala0, ala3, aligns[FLDS_MAX];
+} info;
+
+extern int intarray[256];
+extern int fn0 (void), fn1 (void), fn2 (void), fn3 (void), fn4 (void);
+extern int fn5 (void), fn6 (void), fn7 (void), fn8 (void), fn9 (void);
+
+#ifdef DBG
+#define FAIL(n, m) printf ("fail %d.%d\n", n, m), ++fails
+#else
+#define FAIL(n, m) ++fails
+#endif
+
+#ifdef SKIP_ATTRIBUTE
+# define __attribute__(x)
+#endif
+#define atal __attribute__((aligned))
+#define atpa __attribute__((packed))
+#define atalpa __attribute__((aligned, packed))
+#define atpaal __attribute__((packed, aligned))
+#define atal1 __attribute__((aligned (1)))
+#define atal2 __attribute__((aligned (2)))
+#define atal4 __attribute__((aligned (4)))
+#define atal8 __attribute__((aligned (8)))
+#define atal16 __attribute__((aligned (16)))
+#define atal1pa __attribute__((aligned (1), packed))
+#define atal2pa __attribute__((aligned (2), packed))
+#define atal4pa __attribute__((aligned (4), packed))
+#define atal8pa __attribute__((aligned (8), packed))
+#define atal16pa __attribute__((aligned (16), packed))
+#define atpaal1 __attribute__((packed, aligned (1)))
+#define atpaal2 __attribute__((packed, aligned (2)))
+#define atpaal4 __attribute__((packed, aligned (4)))
+#define atpaal8 __attribute__((packed, aligned (8)))
+#define atpaal16 __attribute__((packed, aligned (16)))
+
+#if UCHAR_MAX == 255 && USHORT_MAX == 65535 && UINT_MAX == 4294967295U \
+ && ULLONG_MAX == 18446744073709551615ULL
+/* For ILP32 and LP64 targets, assume float is at least 32-bit
+ and double plus long double at least 64-bit. */
+# define atalx1 atal1
+# define atalx2 atal2
+# define atalx4 atal4
+# define atalx8 atal8
+# define atalx16 atal16
+# define atalx1pa atal1pa
+# define atalx2pa atal2pa
+# define atalx4pa atal4pa
+# define atalx8pa atal8pa
+# define atalx16pa atal16pa
+# define atpaalx1 atpaal1
+# define atpaalx2 atpaal2
+# define atpaalx4 atpaal4
+# define atpaalx8 atpaal8
+# define atpaalx16 atpaal16
+# if ULONG_MAX > 4294967295UL
+# define ataly8 atal8
+# define ataly8pa atal8pa
+# define atpaaly8 atpaal8
+# define ataly16 atal16
+# define ataly16pa atal16pa
+# define atpaaly16 atpaal16
+# else
+# define ataly8
+# define ataly8pa
+# define atpaaly8
+# define ataly16
+# define ataly16pa
+# define atpaaly16
+# endif
+#else
+# define atalx1
+# define atalx2
+# define atalx4
+# define atalx8
+# define atalx16
+# define atalx1pa
+# define atalx2pa
+# define atalx4pa
+# define atalx8pa
+# define atalx16pa
+# define atpaalx1
+# define atpaalx2
+# define atpaalx4
+# define atpaalx8
+# define atpaalx16
+# define ataly8
+# define ataly8pa
+# define atpaaly8
+# define ataly16
+# define ataly16pa
+# define atpaaly16
+#endif
+
+#define atQI __attribute__((mode (QI)))
+#define atHI __attribute__((mode (HI)))
+#define atSI __attribute__((mode (SI)))
+#define atDI __attribute__((mode (DI)))
+
+enum E0 { e0_0 };
+enum E1 { e1_0, e1_1 };
+enum E2 { e2_m3 = -3, e2_m2, e2_m1, e2_0, e2_1, e2_2, e2_3 };
+enum E3 { e3_m127 = -127, e3_m126, e3_m125, e3_0 = 0, e3_125 = 125, e3_126, e3_127 };
+enum E4 { e4_0, e4_1, e4_2, e4_3, e4_253 = 253, e4_254, e4_255 };
+enum E5 { e5_m32767 = -32767, e5_m32766, e5_m32765, e5_0 = 0, e5_32765 = 32765, e5_32766, e5_32767 };
+enum E6 { e6_0, e6_1, e6_2, e6_3, e6_65533 = 65533, e6_65534, e6_65535 };
+enum E7 { e7_m2147483647 = -2147483647, e7_m2147483646, e7_m2147483645,
+ e7_0, e7_2147483645 = 2147483645, e7_2147483646, e7_2147483647 };
+enum E8 { e8_0, e8_1, e8_2, e8_3, e8_4294967293 = 4294967293U, e8_4294967294, e8_4294967295 };
+enum E9 { e9_m1099511627775 = -1099511627775LL, e9_m1099511627774, e9_m1099511627773,
+ e9_0, e9_1099511627773 = 1099511627773LL, e9_1099511627774, e9_1099511627775 };
+
+typedef char Tchar;
+typedef signed char Tschar;
+typedef unsigned char Tuchar;
+typedef short int Tshort;
+typedef unsigned short int Tushort;
+typedef int Tint;
+typedef unsigned int Tuint;
+typedef long int Tlong;
+typedef unsigned long int Tulong;
+typedef long long int Tllong;
+typedef unsigned long long int Tullong;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Tcchar;
+typedef _Complex signed char Tcschar;
+typedef _Complex unsigned char Tcuchar;
+typedef _Complex short int Tcshort;
+typedef _Complex unsigned short int Tcushort;
+typedef _Complex int Tcint;
+typedef _Complex unsigned int Tcuint;
+typedef _Complex long int Tclong;
+typedef _Complex unsigned long int Tculong;
+typedef _Complex long long int Tcllong;
+typedef _Complex unsigned long long int Tcullong;
+#endif
+typedef float Tfloat;
+typedef double Tdouble;
+typedef long double Tldouble;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 TDecimal32;
+typedef _Decimal64 TDecimal64;
+typedef _Decimal128 TDecimal128;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Tcfloat;
+typedef _Complex double Tcdouble;
+typedef _Complex long double Tcldouble;
+#endif
+typedef bool Tbool;
+typedef enum E0 TE0;
+typedef enum E1 TE1;
+typedef enum E2 TE2;
+typedef enum E3 TE3;
+typedef enum E4 TE4;
+typedef enum E5 TE5;
+typedef enum E6 TE6;
+typedef enum E7 TE7;
+typedef enum E8 TE8;
+typedef enum E9 TE9;
+typedef void *Tptr;
+typedef char *Tcptr;
+typedef int *Tiptr;
+typedef char Talchar atal;
+typedef signed char Talschar atal;
+typedef unsigned char Taluchar atal;
+typedef short int Talshort atal;
+typedef unsigned short int Talushort atal;
+typedef int Talint atal;
+typedef unsigned int Taluint atal;
+typedef long int Tallong atal;
+typedef unsigned long int Talulong atal;
+typedef long long int Talllong atal;
+typedef unsigned long long int Talullong atal;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Talcchar atal;
+typedef _Complex signed char Talcschar atal;
+typedef _Complex unsigned char Talcuchar atal;
+typedef _Complex short int Talcshort atal;
+typedef _Complex unsigned short int Talcushort atal;
+typedef _Complex int Talcint atal;
+typedef _Complex unsigned int Talcuint atal;
+typedef _Complex long int Talclong atal;
+typedef _Complex unsigned long int Talculong atal;
+typedef _Complex long long int Talcllong atal;
+typedef _Complex unsigned long long int Talcullong atal;
+#endif
+typedef float Talfloat atal;
+typedef double Taldouble atal;
+typedef long double Talldouble atal;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 TalDecimal32 atal;
+typedef _Decimal64 TalDecimal64 atal;
+typedef _Decimal128 TalDecimal128 atal;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Talcfloat atal;
+typedef _Complex double Talcdouble atal;
+typedef _Complex long double Talcldouble atal;
+#endif
+typedef bool Talbool atal;
+typedef enum E0 TalE0 atal;
+typedef enum E1 TalE1 atal;
+typedef enum E2 TalE2 atal;
+typedef enum E3 TalE3 atal;
+typedef enum E4 TalE4 atal;
+typedef enum E5 TalE5 atal;
+typedef enum E6 TalE6 atal;
+typedef enum E7 TalE7 atal;
+typedef enum E8 TalE8 atal;
+typedef enum E9 TalE9 atal;
+typedef void *Talptr atal;
+typedef char *Talcptr atal;
+typedef int *Taliptr atal;
+typedef char Tal1char atal1;
+typedef signed char Tal1schar atal1;
+typedef unsigned char Tal1uchar atal1;
+typedef short int Tal1short atal1;
+typedef unsigned short int Tal1ushort atal1;
+typedef int Tal1int atal1;
+typedef unsigned int Tal1uint atal1;
+typedef long int Tal1long atal1;
+typedef unsigned long int Tal1ulong atal1;
+typedef long long int Tal1llong atal1;
+typedef unsigned long long int Tal1ullong atal1;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Tal1cchar atal1;
+typedef _Complex signed char Tal1cschar atal1;
+typedef _Complex unsigned char Tal1cuchar atal1;
+typedef _Complex short int Tal1cshort atal1;
+typedef _Complex unsigned short int Tal1cushort atal1;
+typedef _Complex int Tal1cint atal1;
+typedef _Complex unsigned int Tal1cuint atal1;
+typedef _Complex long int Tal1clong atal1;
+typedef _Complex unsigned long int Tal1culong atal1;
+typedef _Complex long long int Tal1cllong atal1;
+typedef _Complex unsigned long long int Tal1cullong atal1;
+#endif
+typedef float Tal1float atal1;
+typedef double Tal1double atal1;
+typedef long double Tal1ldouble atal1;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 Tal1Decimal32 atal1;
+typedef _Decimal64 Tal1Decimal64 atal1;
+typedef _Decimal128 Tal1Decimal128 atal1;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Tal1cfloat atal1;
+typedef _Complex double Tal1cdouble atal1;
+typedef _Complex long double Tal1cldouble atal1;
+#endif
+typedef bool Tal1bool atal1;
+typedef enum E0 Tal1E0 atal1;
+typedef enum E1 Tal1E1 atal1;
+typedef enum E2 Tal1E2 atal1;
+typedef enum E3 Tal1E3 atal1;
+typedef enum E4 Tal1E4 atal1;
+typedef enum E5 Tal1E5 atal1;
+typedef enum E6 Tal1E6 atal1;
+typedef enum E7 Tal1E7 atal1;
+typedef enum E8 Tal1E8 atal1;
+typedef enum E9 Tal1E9 atal1;
+typedef void *Tal1ptr atal1;
+typedef char *Tal1cptr atal1;
+typedef int *Tal1iptr atal1;
+typedef char Tal2char atal2;
+typedef signed char Tal2schar atal2;
+typedef unsigned char Tal2uchar atal2;
+typedef short int Tal2short atal2;
+typedef unsigned short int Tal2ushort atal2;
+typedef int Tal2int atal2;
+typedef unsigned int Tal2uint atal2;
+typedef long int Tal2long atal2;
+typedef unsigned long int Tal2ulong atal2;
+typedef long long int Tal2llong atal2;
+typedef unsigned long long int Tal2ullong atal2;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Tal2cchar atal2;
+typedef _Complex signed char Tal2cschar atal2;
+typedef _Complex unsigned char Tal2cuchar atal2;
+typedef _Complex short int Tal2cshort atal2;
+typedef _Complex unsigned short int Tal2cushort atal2;
+typedef _Complex int Tal2cint atal2;
+typedef _Complex unsigned int Tal2cuint atal2;
+typedef _Complex long int Tal2clong atal2;
+typedef _Complex unsigned long int Tal2culong atal2;
+typedef _Complex long long int Tal2cllong atal2;
+typedef _Complex unsigned long long int Tal2cullong atal2;
+#endif
+typedef float Tal2float atal2;
+typedef double Tal2double atal2;
+typedef long double Tal2ldouble atal2;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 Tal2Decimal32 atal2;
+typedef _Decimal64 Tal2Decimal64 atal2;
+typedef _Decimal128 Tal2Decimal128 atal2;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Tal2cfloat atal2;
+typedef _Complex double Tal2cdouble atal2;
+typedef _Complex long double Tal2cldouble atal2;
+#endif
+typedef bool Tal2bool atal2;
+typedef enum E0 Tal2E0 atal2;
+typedef enum E1 Tal2E1 atal2;
+typedef enum E2 Tal2E2 atal2;
+typedef enum E3 Tal2E3 atal2;
+typedef enum E4 Tal2E4 atal2;
+typedef enum E5 Tal2E5 atal2;
+typedef enum E6 Tal2E6 atal2;
+typedef enum E7 Tal2E7 atal2;
+typedef enum E8 Tal2E8 atal2;
+typedef enum E9 Tal2E9 atal2;
+typedef void *Tal2ptr atal2;
+typedef char *Tal2cptr atal2;
+typedef int *Tal2iptr atal2;
+typedef char Tal4char atal4;
+typedef signed char Tal4schar atal4;
+typedef unsigned char Tal4uchar atal4;
+typedef short int Tal4short atal4;
+typedef unsigned short int Tal4ushort atal4;
+typedef int Tal4int atal4;
+typedef unsigned int Tal4uint atal4;
+typedef long int Tal4long atal4;
+typedef unsigned long int Tal4ulong atal4;
+typedef long long int Tal4llong atal4;
+typedef unsigned long long int Tal4ullong atal4;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Tal4cchar atal4;
+typedef _Complex signed char Tal4cschar atal4;
+typedef _Complex unsigned char Tal4cuchar atal4;
+typedef _Complex short int Tal4cshort atal4;
+typedef _Complex unsigned short int Tal4cushort atal4;
+typedef _Complex int Tal4cint atal4;
+typedef _Complex unsigned int Tal4cuint atal4;
+typedef _Complex long int Tal4clong atal4;
+typedef _Complex unsigned long int Tal4culong atal4;
+typedef _Complex long long int Tal4cllong atal4;
+typedef _Complex unsigned long long int Tal4cullong atal4;
+#endif
+typedef float Tal4float atal4;
+typedef double Tal4double atal4;
+typedef long double Tal4ldouble atal4;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 Tal4Decimal32 atal4;
+typedef _Decimal64 Tal4Decimal64 atal4;
+typedef _Decimal128 Tal4Decimal128 atal4;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Tal4cfloat atal4;
+typedef _Complex double Tal4cdouble atal4;
+typedef _Complex long double Tal4cldouble atal4;
+#endif
+typedef bool Tal4bool atal4;
+typedef enum E0 Tal4E0 atal4;
+typedef enum E1 Tal4E1 atal4;
+typedef enum E2 Tal4E2 atal4;
+typedef enum E3 Tal4E3 atal4;
+typedef enum E4 Tal4E4 atal4;
+typedef enum E5 Tal4E5 atal4;
+typedef enum E6 Tal4E6 atal4;
+typedef enum E7 Tal4E7 atal4;
+typedef enum E8 Tal4E8 atal4;
+typedef enum E9 Tal4E9 atal4;
+typedef void *Tal4ptr atal4;
+typedef char *Tal4cptr atal4;
+typedef int *Tal4iptr atal4;
+typedef char Tal8char atal8;
+typedef signed char Tal8schar atal8;
+typedef unsigned char Tal8uchar atal8;
+typedef short int Tal8short atal8;
+typedef unsigned short int Tal8ushort atal8;
+typedef int Tal8int atal8;
+typedef unsigned int Tal8uint atal8;
+typedef long int Tal8long atal8;
+typedef unsigned long int Tal8ulong atal8;
+typedef long long int Tal8llong atal8;
+typedef unsigned long long int Tal8ullong atal8;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Tal8cchar atal8;
+typedef _Complex signed char Tal8cschar atal8;
+typedef _Complex unsigned char Tal8cuchar atal8;
+typedef _Complex short int Tal8cshort atal8;
+typedef _Complex unsigned short int Tal8cushort atal8;
+typedef _Complex int Tal8cint atal8;
+typedef _Complex unsigned int Tal8cuint atal8;
+typedef _Complex long int Tal8clong atal8;
+typedef _Complex unsigned long int Tal8culong atal8;
+typedef _Complex long long int Tal8cllong atal8;
+typedef _Complex unsigned long long int Tal8cullong atal8;
+#endif
+typedef float Tal8float atal8;
+typedef double Tal8double atal8;
+typedef long double Tal8ldouble atal8;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 Tal8Decimal32 atal8;
+typedef _Decimal64 Tal8Decimal64 atal8;
+typedef _Decimal128 Tal8Decimal128 atal8;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Tal8cfloat atal8;
+typedef _Complex double Tal8cdouble atal8;
+typedef _Complex long double Tal8cldouble atal8;
+#endif
+typedef bool Tal8bool atal8;
+typedef enum E0 Tal8E0 atal8;
+typedef enum E1 Tal8E1 atal8;
+typedef enum E2 Tal8E2 atal8;
+typedef enum E3 Tal8E3 atal8;
+typedef enum E4 Tal8E4 atal8;
+typedef enum E5 Tal8E5 atal8;
+typedef enum E6 Tal8E6 atal8;
+typedef enum E7 Tal8E7 atal8;
+typedef enum E8 Tal8E8 atal8;
+typedef enum E9 Tal8E9 atal8;
+typedef void *Tal8ptr atal8;
+typedef char *Tal8cptr atal8;
+typedef int *Tal8iptr atal8;
+typedef char Tal16char atal16;
+typedef signed char Tal16schar atal16;
+typedef unsigned char Tal16uchar atal16;
+typedef short int Tal16short atal16;
+typedef unsigned short int Tal16ushort atal16;
+typedef int Tal16int atal16;
+typedef unsigned int Tal16uint atal16;
+typedef long int Tal16long atal16;
+typedef unsigned long int Tal16ulong atal16;
+typedef long long int Tal16llong atal16;
+typedef unsigned long long int Tal16ullong atal16;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Tal16cchar atal16;
+typedef _Complex signed char Tal16cschar atal16;
+typedef _Complex unsigned char Tal16cuchar atal16;
+typedef _Complex short int Tal16cshort atal16;
+typedef _Complex unsigned short int Tal16cushort atal16;
+typedef _Complex int Tal16cint atal16;
+typedef _Complex unsigned int Tal16cuint atal16;
+typedef _Complex long int Tal16clong atal16;
+typedef _Complex unsigned long int Tal16culong atal16;
+typedef _Complex long long int Tal16cllong atal16;
+typedef _Complex unsigned long long int Tal16cullong atal16;
+#endif
+typedef float Tal16float atal16;
+typedef double Tal16double atal16;
+typedef long double Tal16ldouble atal16;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 Tal16Decimal32 atal16;
+typedef _Decimal64 Tal16Decimal64 atal16;
+typedef _Decimal128 Tal16Decimal128 atal16;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Tal16cfloat atal16;
+typedef _Complex double Tal16cdouble atal16;
+typedef _Complex long double Tal16cldouble atal16;
+#endif
+typedef bool Tal16bool atal16;
+typedef enum E0 Tal16E0 atal16;
+typedef enum E1 Tal16E1 atal16;
+typedef enum E2 Tal16E2 atal16;
+typedef enum E3 Tal16E3 atal16;
+typedef enum E4 Tal16E4 atal16;
+typedef enum E5 Tal16E5 atal16;
+typedef enum E6 Tal16E6 atal16;
+typedef enum E7 Tal16E7 atal16;
+typedef enum E8 Tal16E8 atal16;
+typedef enum E9 Tal16E9 atal16;
+typedef void *Tal16ptr atal16;
+typedef char *Tal16cptr atal16;
+typedef int *Tal16iptr atal16;
+typedef char Talx1char atalx1;
+typedef signed char Talx1schar atalx1;
+typedef unsigned char Talx1uchar atalx1;
+typedef short int Talx1short atalx1;
+typedef unsigned short int Talx1ushort atalx1;
+typedef int Talx1int atalx1;
+typedef unsigned int Talx1uint atalx1;
+typedef long int Talx1long atalx1;
+typedef unsigned long int Talx1ulong atalx1;
+typedef long long int Talx1llong atalx1;
+typedef unsigned long long int Talx1ullong atalx1;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Talx1cchar atalx1;
+typedef _Complex signed char Talx1cschar atalx1;
+typedef _Complex unsigned char Talx1cuchar atalx1;
+typedef _Complex short int Talx1cshort atalx1;
+typedef _Complex unsigned short int Talx1cushort atalx1;
+typedef _Complex int Talx1cint atalx1;
+typedef _Complex unsigned int Talx1cuint atalx1;
+typedef _Complex long int Talx1clong atalx1;
+typedef _Complex unsigned long int Talx1culong atalx1;
+typedef _Complex long long int Talx1cllong atalx1;
+typedef _Complex unsigned long long int Talx1cullong atalx1;
+#endif
+typedef float Talx1float atalx1;
+typedef double Talx1double atalx1;
+typedef long double Talx1ldouble atalx1;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 Talx1Decimal32 atalx1;
+typedef _Decimal64 Talx1Decimal64 atalx1;
+typedef _Decimal128 Talx1Decimal128 atalx1;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Talx1cfloat atalx1;
+typedef _Complex double Talx1cdouble atalx1;
+typedef _Complex long double Talx1cldouble atalx1;
+#endif
+typedef bool Talx1bool atalx1;
+typedef enum E0 Talx1E0 atalx1;
+typedef enum E1 Talx1E1 atalx1;
+typedef enum E2 Talx1E2 atalx1;
+typedef enum E3 Talx1E3 atalx1;
+typedef enum E4 Talx1E4 atalx1;
+typedef enum E5 Talx1E5 atalx1;
+typedef enum E6 Talx1E6 atalx1;
+typedef enum E7 Talx1E7 atalx1;
+typedef enum E8 Talx1E8 atalx1;
+typedef enum E9 Talx1E9 atalx1;
+typedef void *Talx1ptr atalx1;
+typedef char *Talx1cptr atalx1;
+typedef int *Talx1iptr atalx1;
+typedef short int Talx2short atalx2;
+typedef unsigned short int Talx2ushort atalx2;
+typedef int Talx2int atalx2;
+typedef unsigned int Talx2uint atalx2;
+typedef long int Talx2long atalx2;
+typedef unsigned long int Talx2ulong atalx2;
+typedef long long int Talx2llong atalx2;
+typedef unsigned long long int Talx2ullong atalx2;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex char Talx2cchar atalx2;
+typedef _Complex signed char Talx2cschar atalx2;
+typedef _Complex unsigned char Talx2cuchar atalx2;
+typedef _Complex short int Talx2cshort atalx2;
+typedef _Complex unsigned short int Talx2cushort atalx2;
+typedef _Complex int Talx2cint atalx2;
+typedef _Complex unsigned int Talx2cuint atalx2;
+typedef _Complex long int Talx2clong atalx2;
+typedef _Complex unsigned long int Talx2culong atalx2;
+typedef _Complex long long int Talx2cllong atalx2;
+typedef _Complex unsigned long long int Talx2cullong atalx2;
+#endif
+typedef float Talx2float atalx2;
+typedef double Talx2double atalx2;
+typedef long double Talx2ldouble atalx2;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 Talx2Decimal32 atalx2;
+typedef _Decimal64 Talx2Decimal64 atalx2;
+typedef _Decimal128 Talx2Decimal128 atalx2;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Talx2cfloat atalx2;
+typedef _Complex double Talx2cdouble atalx2;
+typedef _Complex long double Talx2cldouble atalx2;
+#endif
+typedef enum E0 Talx2E0 atalx2;
+typedef enum E1 Talx2E1 atalx2;
+typedef enum E2 Talx2E2 atalx2;
+typedef enum E3 Talx2E3 atalx2;
+typedef enum E4 Talx2E4 atalx2;
+typedef enum E5 Talx2E5 atalx2;
+typedef enum E6 Talx2E6 atalx2;
+typedef enum E7 Talx2E7 atalx2;
+typedef enum E8 Talx2E8 atalx2;
+typedef enum E9 Talx2E9 atalx2;
+typedef void *Talx2ptr atalx2;
+typedef char *Talx2cptr atalx2;
+typedef int *Talx2iptr atalx2;
+typedef int Talx4int atalx4;
+typedef unsigned int Talx4uint atalx4;
+typedef long int Talx4long atalx4;
+typedef unsigned long int Talx4ulong atalx4;
+typedef long long int Talx4llong atalx4;
+typedef unsigned long long int Talx4ullong atalx4;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex short int Talx4cshort atalx4;
+typedef _Complex unsigned short int Talx4cushort atalx4;
+typedef _Complex int Talx4cint atalx4;
+typedef _Complex unsigned int Talx4cuint atalx4;
+typedef _Complex long int Talx4clong atalx4;
+typedef _Complex unsigned long int Talx4culong atalx4;
+typedef _Complex long long int Talx4cllong atalx4;
+typedef _Complex unsigned long long int Talx4cullong atalx4;
+#endif
+typedef float Talx4float atalx4;
+typedef double Talx4double atalx4;
+typedef long double Talx4ldouble atalx4;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal32 Talx4Decimal32 atalx4;
+typedef _Decimal64 Talx4Decimal64 atalx4;
+typedef _Decimal128 Talx4Decimal128 atalx4;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Talx4cfloat atalx4;
+typedef _Complex double Talx4cdouble atalx4;
+typedef _Complex long double Talx4cldouble atalx4;
+#endif
+typedef enum E0 Talx4E0 atalx4;
+typedef enum E1 Talx4E1 atalx4;
+typedef enum E2 Talx4E2 atalx4;
+typedef enum E3 Talx4E3 atalx4;
+typedef enum E4 Talx4E4 atalx4;
+typedef enum E5 Talx4E5 atalx4;
+typedef enum E6 Talx4E6 atalx4;
+typedef enum E7 Talx4E7 atalx4;
+typedef enum E8 Talx4E8 atalx4;
+typedef enum E9 Talx4E9 atalx4;
+typedef void *Talx4ptr atalx4;
+typedef char *Talx4cptr atalx4;
+typedef int *Talx4iptr atalx4;
+typedef long int Taly8long ataly8;
+typedef unsigned long int Taly8ulong ataly8;
+typedef long long int Talx8llong atalx8;
+typedef unsigned long long int Talx8ullong atalx8;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex int Talx8cint atalx8;
+typedef _Complex unsigned int Talx8cuint atalx8;
+typedef _Complex long int Talx8clong atalx8;
+typedef _Complex unsigned long int Talx8culong atalx8;
+typedef _Complex long long int Talx8cllong atalx8;
+typedef _Complex unsigned long long int Talx8cullong atalx8;
+#endif
+typedef double Talx8double atalx8;
+typedef long double Talx8ldouble atalx8;
+#ifndef SKIP_DECIMAL_FLOAT
+typedef _Decimal64 Talx8Decimal64 atalx8;
+typedef _Decimal128 Talx8Decimal128 atalx8;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex float Talx8cfloat atalx8;
+typedef _Complex double Talx8cdouble atalx8;
+typedef _Complex long double Talx8cldouble atalx8;
+#endif
+typedef void *Taly8ptr ataly8;
+typedef char *Taly8cptr ataly8;
+typedef int *Taly8iptr ataly8;
+#ifndef SKIP_COMPLEX_INT
+typedef _Complex long int Taly16clong ataly16;
+typedef _Complex unsigned long int Taly16culong ataly16;
+typedef _Complex long long int Talx16cllong atalx16;
+typedef _Complex unsigned long long int Talx16cullong atalx16;
+#endif
+#ifndef SKIP_COMPLEX
+typedef _Complex double Talx16cdouble atalx16;
+typedef _Complex long double Talx16cldouble atalx16;
+#endif
+typedef int (*Tfnptr) (void);
+
+/* Bitfield macros. In C, it is invalid to use numbers larger
+ than type's bitsize, but we don't know the size when generating
+ the testcases. */
+#define BN8(n) ((((n) - 1) & 7) + 1)
+#define BN16(n) ((((n) - 1) & 15) + 1)
+#define BN32(n) ((((n) - 1) & 31) + 1)
+#define BN64(n) ((((n) - 1) & 63) + 1)
+#define BCN(n) BN8 (n)
+#if USHRT_MAX == 255
+# define BSN(n) BN8 (n)
+#elif USHRT_MAX == 65535
+# define BSN(n) BN16 (n)
+#elif USHRT_MAX == 4294967295U
+# define BSN(n) BN32 (n)
+#elif USHRT_MAX == 18446744073709551615ULL
+# define BSN(n) BN64 (n)
+#endif
+#if UINT_MAX == 255
+# define BIN(n) BN8 (n)
+#elif UINT_MAX == 65535
+# define BIN(n) BN16 (n)
+#elif UINT_MAX == 4294967295U
+# define BIN(n) BN32 (n)
+#elif UINT_MAX == 18446744073709551615ULL
+# define BIN(n) BN64 (n)
+#endif
+#if ULONG_MAX == 255
+# define BLN(n) BN8 (n)
+#elif ULONG_MAX == 65535
+# define BLN(n) BN16 (n)
+#elif ULONG_MAX == 4294967295U
+# define BLN(n) BN32 (n)
+#elif ULONG_MAX == 18446744073709551615ULL
+# define BLN(n) BN64 (n)
+#endif
+#if ULONG_MAX == 255
+# define BLN(n) BN8 (n)
+#elif ULONG_MAX == 65535
+# define BLN(n) BN16 (n)
+#elif ULONG_MAX == 4294967295U
+# define BLN(n) BN32 (n)
+#elif ULONG_MAX == 18446744073709551615ULL
+# define BLN(n) BN64 (n)
+#endif
+#if !defined ULLONG_MAX && defined __LONG_LONG_MAX__
+# define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
+#endif
+#if ULLONG_MAX == 255
+# define BQN(n) BN8 (n)
+#elif ULLONG_MAX == 65535
+# define BQN(n) BN16 (n)
+#elif ULLONG_MAX == 4294967295U
+# define BQN(n) BN32 (n)
+#elif ULLONG_MAX == 18446744073709551615ULL
+# define BQN(n) BN64 (n)
+#endif
+
+#define T(n, fields, ops) TX(n, struct, , fields, ({ ops });)
+#define U(n, fields, ops) TX(n, union, , fields, ({ ops });)
+#ifdef SKIP_COMPLEX_INT
+#define TXCI(n, type, attrs, fields, ops)
+#define TCI(n, fields, ops)
+#define UCI(n, fields, ops)
+#else
+#define TXCI(n, type, attrs, fields, ops) TX(n, type, attrs, fields, ({ ops });)
+#define TCI(n, fields, ops) TX(n, struct, , fields, ({ ops });)
+#define UCI(n, fields, ops) TX(n, union, , fields, ({ ops });)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
new file mode 100644
index 000000000..b6ae34e00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
@@ -0,0 +1,2087 @@
+/* Structure layout test generator.
+ Copyright (C) 2004, 2005, 2007, 2008, 2009, 2011, 2012
+ Free Software Foundation, Inc.
+ Contributed by Jakub Jelinek <jakub@redhat.com>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+
+/* Compile with gcc -o struct-layout-1_generate{,.c} generate_random{,_r}.c */
+
+/* N.B. -- This program cannot use libiberty as that will not work
+ when testing an installed compiler. */
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stddef.h>
+/* We use our own pseudo-random number generator, so that it gives the same
+ values on all hosts. */
+#include "generate-random.h"
+
+#if LLONG_MAX != 9223372036854775807LL && __LONG_LONG_MAX__ != 9223372036854775807LL
+# error Need 64-bit long long
+#endif
+
+#if defined __MSVCRT__
+#define COMPAT_PRLL "I64"
+#else
+#define COMPAT_PRLL "ll"
+#endif
+
+const char *dg_options[] = {
+"/* { dg-options \"%s-I%s\" } */\n",
+"/* { dg-options \"%s-I%s -Wno-abi\" } */\n",
+"/* { dg-options \"%s-I%s -mno-mmx -Wno-abi\" { target i?86-*-* x86_64-*-* } } */\n",
+"/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* powerpc*-*-darwin* } } */\n",
+"/* { dg-options \"%s-I%s -mno-mmx -fno-common -Wno-abi\" { target i?86-*-darwin* x86_64-*-darwin* } } */\n",
+"/* { dg-options \"%s-I%s -mno-base-addresses\" { target mmix-*-* } } */\n",
+"/* { dg-options \"%s-I%s -mlongcalls -mtext-section-literals\" { target xtensa*-*-* } } */\n"
+#define NDG_OPTIONS (sizeof (dg_options) / sizeof (dg_options[0]))
+};
+
+typedef unsigned int hashval_t;
+
+enum TYPE
+{
+ TYPE_INT,
+ TYPE_UINT,
+ TYPE_CINT,
+ TYPE_CUINT,
+ TYPE_FLOAT,
+ TYPE_CFLOAT,
+ TYPE_DEC_FLOAT,
+ TYPE_SENUM,
+ TYPE_UENUM,
+ TYPE_PTR,
+ TYPE_FNPTR,
+ TYPE_OTHER
+};
+
+struct types
+{
+ const char *name;
+ enum TYPE type;
+ unsigned long long int maxval;
+ char bitfld;
+};
+
+struct types base_types[] = {
+/* As we don't know whether char will be signed or not, just limit ourselves
+ to unsigned values less than maximum signed char value. */
+{ "char", TYPE_UINT, 127, 'C' },
+{ "signed char", TYPE_INT, 127, 'C' },
+{ "unsigned char", TYPE_UINT, 255, 'C' },
+{ "short int", TYPE_INT, 32767, 'S' },
+{ "unsigned short int", TYPE_UINT, 65535, 'S' },
+{ "int", TYPE_INT, 2147483647, 'I' },
+{ "unsigned int", TYPE_UINT, 4294967295U, 'I' },
+{ "long int", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "unsigned long int", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "long long int", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "unsigned long long int", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "bool", TYPE_UINT, 1, 'B' },
+{ "void *", TYPE_PTR, 0, 0 },
+{ "char *", TYPE_PTR, 0, 0 },
+{ "int *", TYPE_PTR, 0, 0 },
+{ "float", TYPE_FLOAT, 0, 0 },
+{ "double", TYPE_FLOAT, 0, 0 },
+{ "long double", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "_Decimal32", TYPE_DEC_FLOAT, 0, 0 },
+{ "_Decimal64", TYPE_DEC_FLOAT, 0, 0 },
+{ "_Decimal128", TYPE_DEC_FLOAT, 0, 0 },
+#define NTYPES1 21
+#else
+#define NTYPES1 18
+#endif
+{ "Tchar", TYPE_UINT, 127, 'C' },
+{ "Tschar", TYPE_INT, 127, 'C' },
+{ "Tuchar", TYPE_UINT, 255, 'C' },
+{ "Tshort", TYPE_INT, 32767, 'S' },
+{ "Tushort", TYPE_UINT, 65535, 'S' },
+{ "Tint", TYPE_INT, 2147483647, 'I' },
+{ "Tuint", TYPE_UINT, 4294967295U, 'I' },
+{ "Tlong", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Tulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Tllong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Tullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Tbool", TYPE_UINT, 1, 'B' },
+{ "size_t", TYPE_UINT, 18446744073709551615ULL, 0 },
+{ "Tptr", TYPE_PTR, 0, 0 },
+{ "Tcptr", TYPE_PTR, 0, 0 },
+{ "Tiptr", TYPE_PTR, 0, 0 },
+{ "Tfnptr", TYPE_FNPTR, 0, 0 },
+{ "Tfloat", TYPE_FLOAT, 0, 0 },
+{ "Tdouble", TYPE_FLOAT, 0, 0 },
+{ "Tldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "TDecimal32", TYPE_DEC_FLOAT, 0, 0 },
+{ "TDecimal64", TYPE_DEC_FLOAT, 0, 0 },
+{ "TDecimal128", TYPE_DEC_FLOAT, 0, 0 },
+#endif
+{ "enum E0", TYPE_UENUM, 0, ' ' },
+{ "enum E1", TYPE_UENUM, 1, ' ' },
+{ "enum E2", TYPE_SENUM, 3, ' ' },
+{ "enum E3", TYPE_SENUM, 127, ' ' },
+{ "enum E4", TYPE_UENUM, 255, ' ' },
+{ "enum E5", TYPE_SENUM, 32767, ' ' },
+{ "enum E6", TYPE_UENUM, 65535, ' ' },
+{ "enum E7", TYPE_SENUM, 2147483647, ' ' },
+{ "enum E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "enum E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "TE0", TYPE_UENUM, 0, ' ' },
+{ "TE1", TYPE_UENUM, 1, ' ' },
+{ "TE2", TYPE_SENUM, 3, ' ' },
+{ "TE3", TYPE_SENUM, 127, ' ' },
+{ "TE4", TYPE_UENUM, 255, ' ' },
+{ "TE5", TYPE_SENUM, 32767, ' ' },
+{ "TE6", TYPE_UENUM, 65535, ' ' },
+{ "TE7", TYPE_SENUM, 2147483647, ' ' },
+{ "TE8", TYPE_UENUM, 4294967295U, ' ' },
+{ "TE9", TYPE_SENUM, 1099511627775LL, ' ' },
+/* vector-defs.h typedefs */
+{ "qi", TYPE_INT, 127, 0 },
+{ "hi", TYPE_INT, 32767, 0 },
+{ "si", TYPE_INT, 2147483647, 0 },
+{ "di", TYPE_INT, 9223372036854775807LL, 0 },
+{ "sf", TYPE_FLOAT, 0, 0 },
+{ "df", TYPE_FLOAT, 0, 0 }
+#define NTYPES2 (sizeof (base_types) / sizeof (base_types[0]))
+};
+struct types complex_types[] = {
+{ "_Complex char", TYPE_CUINT, 127, 0 },
+{ "_Complex signed char", TYPE_CINT, 127, 0 },
+{ "_Complex unsigned char", TYPE_CUINT, 255, 0 },
+{ "_Complex short int", TYPE_CINT, 32767, 0 },
+{ "_Complex unsigned short int", TYPE_CUINT, 65535, 0 },
+{ "_Complex int", TYPE_CINT, 2147483647, 0 },
+{ "_Complex unsigned int", TYPE_CUINT, 4294967295U, 0 },
+{ "_Complex long int", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "_Complex unsigned long int", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "_Complex long long int", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "_Complex unsigned long long int", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "_Complex float", TYPE_CFLOAT, 0, 0 },
+{ "_Complex double", TYPE_CFLOAT, 0, 0 },
+{ "_Complex long double", TYPE_CFLOAT, 0, 0 },
+{ "Tcchar", TYPE_CUINT, 127, 0 },
+{ "Tcschar", TYPE_CINT, 127, 0 },
+{ "Tcuchar", TYPE_CUINT, 255, 0 },
+{ "Tcshort", TYPE_CINT, 32767, 0 },
+{ "Tcushort", TYPE_CUINT, 65535, 0 },
+{ "Tcint", TYPE_CINT, 2147483647, 0 },
+{ "Tcuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Tclong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tculong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tcllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tcullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tcfloat", TYPE_CFLOAT, 0, 0 },
+{ "Tcdouble", TYPE_CFLOAT, 0, 0 },
+{ "Tcldouble", TYPE_CFLOAT, 0, 0 }
+#define NCTYPES2 (sizeof (complex_types) / sizeof (complex_types[0]))
+};
+struct types vector_types[] = {
+/* vector-defs.h typedefs */
+{ "v8qi", TYPE_OTHER, 0, 0 },
+{ "v16qi", TYPE_OTHER, 0, 0 },
+{ "v32qi", TYPE_OTHER, 0, 0 },
+{ "v2hi", TYPE_OTHER, 0, 0 },
+{ "v4hi", TYPE_OTHER, 0, 0 },
+{ "v8hi", TYPE_OTHER, 0, 0 },
+{ "v16hi", TYPE_OTHER, 0, 0 },
+{ "v2si", TYPE_OTHER, 0, 0 },
+{ "v4si", TYPE_OTHER, 0, 0 },
+{ "v8si", TYPE_OTHER, 0, 0 },
+{ "v1di", TYPE_OTHER, 0, 0 },
+{ "v2di", TYPE_OTHER, 0, 0 },
+{ "v4di", TYPE_OTHER, 0, 0 },
+{ "v2sf", TYPE_OTHER, 0, 0 },
+{ "v4sf", TYPE_OTHER, 0, 0 },
+{ "v8sf", TYPE_OTHER, 0, 0 },
+{ "v16sf", TYPE_OTHER, 0, 0 },
+{ "v2df", TYPE_OTHER, 0, 0 },
+{ "v4df", TYPE_OTHER, 0, 0 },
+{ "u8qi", TYPE_OTHER, 0, 0 },
+{ "u16qi", TYPE_OTHER, 0, 0 },
+{ "u32qi", TYPE_OTHER, 0, 0 },
+{ "u2hi", TYPE_OTHER, 0, 0 },
+{ "u4hi", TYPE_OTHER, 0, 0 },
+{ "u8hi", TYPE_OTHER, 0, 0 },
+{ "u16hi", TYPE_OTHER, 0, 0 },
+{ "u2si", TYPE_OTHER, 0, 0 },
+{ "u4si", TYPE_OTHER, 0, 0 },
+{ "u8si", TYPE_OTHER, 0, 0 },
+{ "u1di", TYPE_OTHER, 0, 0 },
+{ "u2di", TYPE_OTHER, 0, 0 },
+{ "u4di", TYPE_OTHER, 0, 0 },
+{ "u2sf", TYPE_OTHER, 0, 0 },
+{ "u4sf", TYPE_OTHER, 0, 0 },
+{ "u8sf", TYPE_OTHER, 0, 0 },
+{ "u16sf", TYPE_OTHER, 0, 0 },
+{ "u2df", TYPE_OTHER, 0, 0 },
+{ "u4df", TYPE_OTHER, 0, 0 },
+{ "__m64", TYPE_OTHER, 0, 0 },
+{ "__m128", TYPE_OTHER, 0, 0 }
+#define NVTYPES2 (sizeof (vector_types) / sizeof (vector_types[0]))
+};
+struct types attrib_types[] = {
+{ "Talchar", TYPE_UINT, 127, 'C' },
+{ "Talschar", TYPE_INT, 127, 'C' },
+{ "Taluchar", TYPE_UINT, 255, 'C' },
+{ "Talshort", TYPE_INT, 32767, 'S' },
+{ "Talushort", TYPE_UINT, 65535, 'S' },
+{ "Talint", TYPE_INT, 2147483647, 'I' },
+{ "Taluint", TYPE_UINT, 4294967295U, 'I' },
+{ "Tallong", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talllong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talbool", TYPE_UINT, 1, 'B' },
+{ "Talptr", TYPE_PTR, 0, 0 },
+{ "Talcptr", TYPE_PTR, 0, 0 },
+{ "Taliptr", TYPE_PTR, 0, 0 },
+{ "Talfloat", TYPE_FLOAT, 0, 0 },
+{ "Taldouble", TYPE_FLOAT, 0, 0 },
+{ "Talldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "TalDecimal32", TYPE_DEC_FLOAT, 0, 0 },
+{ "TalDecimal64", TYPE_DEC_FLOAT, 0, 0 },
+{ "TalDecimal128", TYPE_DEC_FLOAT, 0, 0 },
+#endif
+{ "TalE0", TYPE_UENUM, 0, ' ' },
+{ "TalE1", TYPE_UENUM, 1, ' ' },
+{ "TalE2", TYPE_SENUM, 3, ' ' },
+{ "TalE3", TYPE_SENUM, 127, ' ' },
+{ "TalE4", TYPE_UENUM, 255, ' ' },
+{ "TalE5", TYPE_SENUM, 32767, ' ' },
+{ "TalE6", TYPE_UENUM, 65535, ' ' },
+{ "TalE7", TYPE_SENUM, 2147483647, ' ' },
+{ "TalE8", TYPE_UENUM, 4294967295U, ' ' },
+{ "TalE9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Tal1char", TYPE_UINT, 127, 'C' },
+{ "Tal1schar", TYPE_INT, 127, 'C' },
+{ "Tal1uchar", TYPE_UINT, 255, 'C' },
+{ "Tal1short", TYPE_INT, 32767, 'S' },
+{ "Tal1ushort", TYPE_UINT, 65535, 'S' },
+{ "Tal1int", TYPE_INT, 2147483647, 'I' },
+{ "Tal1uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Tal1long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Tal1ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Tal1llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Tal1ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Tal1bool", TYPE_UINT, 1, 'B' },
+{ "Tal1ptr", TYPE_PTR, 0, 0 },
+{ "Tal1cptr", TYPE_PTR, 0, 0 },
+{ "Tal1iptr", TYPE_PTR, 0, 0 },
+{ "Tal1float", TYPE_FLOAT, 0, 0 },
+{ "Tal1double", TYPE_FLOAT, 0, 0 },
+{ "Tal1ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Tal1Decimal32", TYPE_DEC_FLOAT, 0, 0},
+{ "Tal1Decimal64", TYPE_DEC_FLOAT, 0, 0},
+{ "Tal1Decimal128", TYPE_DEC_FLOAT, 0, 0},
+#endif
+{ "Tal1E0", TYPE_UENUM, 0, ' ' },
+{ "Tal1E1", TYPE_UENUM, 1, ' ' },
+{ "Tal1E2", TYPE_SENUM, 3, ' ' },
+{ "Tal1E3", TYPE_SENUM, 127, ' ' },
+{ "Tal1E4", TYPE_UENUM, 255, ' ' },
+{ "Tal1E5", TYPE_SENUM, 32767, ' ' },
+{ "Tal1E6", TYPE_UENUM, 65535, ' ' },
+{ "Tal1E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Tal1E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Tal1E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Tal2char", TYPE_UINT, 127, 'C' },
+{ "Tal2schar", TYPE_INT, 127, 'C' },
+{ "Tal2uchar", TYPE_UINT, 255, 'C' },
+{ "Tal2short", TYPE_INT, 32767, 'S' },
+{ "Tal2ushort", TYPE_UINT, 65535, 'S' },
+{ "Tal2int", TYPE_INT, 2147483647, 'I' },
+{ "Tal2uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Tal2long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Tal2ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Tal2llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Tal2ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Tal2bool", TYPE_UINT, 1, 'B' },
+{ "Tal2ptr", TYPE_PTR, 0, 0 },
+{ "Tal2cptr", TYPE_PTR, 0, 0 },
+{ "Tal2iptr", TYPE_PTR, 0, 0 },
+{ "Tal2float", TYPE_FLOAT, 0, 0 },
+{ "Tal2double", TYPE_FLOAT, 0, 0 },
+{ "Tal2ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Tal2Decimal32", TYPE_DEC_FLOAT, 0, 0 },
+{ "Tal2Decimal64", TYPE_DEC_FLOAT, 0, 0 },
+{ "Tal2Decimal128", TYPE_DEC_FLOAT, 0, 0 },
+#endif
+{ "Tal2E0", TYPE_UENUM, 0, ' ' },
+{ "Tal2E1", TYPE_UENUM, 1, ' ' },
+{ "Tal2E2", TYPE_SENUM, 3, ' ' },
+{ "Tal2E3", TYPE_SENUM, 127, ' ' },
+{ "Tal2E4", TYPE_UENUM, 255, ' ' },
+{ "Tal2E5", TYPE_SENUM, 32767, ' ' },
+{ "Tal2E6", TYPE_UENUM, 65535, ' ' },
+{ "Tal2E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Tal2E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Tal2E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Tal4char", TYPE_UINT, 127, 'C' },
+{ "Tal4schar", TYPE_INT, 127, 'C' },
+{ "Tal4uchar", TYPE_UINT, 255, 'C' },
+{ "Tal4short", TYPE_INT, 32767, 'S' },
+{ "Tal4ushort", TYPE_UINT, 65535, 'S' },
+{ "Tal4int", TYPE_INT, 2147483647, 'I' },
+{ "Tal4uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Tal4long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Tal4ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Tal4llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Tal4ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Tal4bool", TYPE_UINT, 1, 'B' },
+{ "Tal4ptr", TYPE_PTR, 0, 0 },
+{ "Tal4cptr", TYPE_PTR, 0, 0 },
+{ "Tal4iptr", TYPE_PTR, 0, 0 },
+{ "Tal4float", TYPE_FLOAT, 0, 0 },
+{ "Tal4double", TYPE_FLOAT, 0, 0 },
+{ "Tal4ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Tal4Decimal32", TYPE_DEC_FLOAT, 0, 0 },
+{ "Tal4Decimal64", TYPE_DEC_FLOAT, 0, 0 },
+{ "Tal4Decimal128", TYPE_DEC_FLOAT, 0, 0 },
+#endif
+{ "Tal4E0", TYPE_UENUM, 0, ' ' },
+{ "Tal4E1", TYPE_UENUM, 1, ' ' },
+{ "Tal4E2", TYPE_SENUM, 3, ' ' },
+{ "Tal4E3", TYPE_SENUM, 127, ' ' },
+{ "Tal4E4", TYPE_UENUM, 255, ' ' },
+{ "Tal4E5", TYPE_SENUM, 32767, ' ' },
+{ "Tal4E6", TYPE_UENUM, 65535, ' ' },
+{ "Tal4E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Tal4E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Tal4E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Tal8char", TYPE_UINT, 127, 'C' },
+{ "Tal8schar", TYPE_INT, 127, 'C' },
+{ "Tal8uchar", TYPE_UINT, 255, 'C' },
+{ "Tal8short", TYPE_INT, 32767, 'S' },
+{ "Tal8ushort", TYPE_UINT, 65535, 'S' },
+{ "Tal8int", TYPE_INT, 2147483647, 'I' },
+{ "Tal8uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Tal8long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Tal8ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Tal8llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Tal8ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Tal8bool", TYPE_UINT, 1, 'B' },
+{ "Tal8ptr", TYPE_PTR, 0, 0 },
+{ "Tal8cptr", TYPE_PTR, 0, 0 },
+{ "Tal8iptr", TYPE_PTR, 0, 0 },
+{ "Tal8float", TYPE_FLOAT, 0, 0 },
+{ "Tal8double", TYPE_FLOAT, 0, 0 },
+{ "Tal8ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Tal8Decimal32", TYPE_DEC_FLOAT, 0, 0 },
+{ "Tal8Decimal64", TYPE_DEC_FLOAT, 0, 0 },
+{ "Tal8Decimal128", TYPE_DEC_FLOAT, 0, 0 },
+#endif
+{ "Tal8E0", TYPE_UENUM, 0, ' ' },
+{ "Tal8E1", TYPE_UENUM, 1, ' ' },
+{ "Tal8E2", TYPE_SENUM, 3, ' ' },
+{ "Tal8E3", TYPE_SENUM, 127, ' ' },
+{ "Tal8E4", TYPE_UENUM, 255, ' ' },
+{ "Tal8E5", TYPE_SENUM, 32767, ' ' },
+{ "Tal8E6", TYPE_UENUM, 65535, ' ' },
+{ "Tal8E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Tal8E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Tal8E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Tal16char", TYPE_UINT, 127, 'C' },
+{ "Tal16schar", TYPE_INT, 127, 'C' },
+{ "Tal16uchar", TYPE_UINT, 255, 'C' },
+{ "Tal16short", TYPE_INT, 32767, 'S' },
+{ "Tal16ushort", TYPE_UINT, 65535, 'S' },
+{ "Tal16int", TYPE_INT, 2147483647, 'I' },
+{ "Tal16uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Tal16long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Tal16ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Tal16llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Tal16ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Tal16bool", TYPE_UINT, 1, 'B' },
+{ "Tal16ptr", TYPE_PTR, 0, 0 },
+{ "Tal16cptr", TYPE_PTR, 0, 0 },
+{ "Tal16iptr", TYPE_PTR, 0, 0 },
+{ "Tal16float", TYPE_FLOAT, 0, 0 },
+{ "Tal16double", TYPE_FLOAT, 0, 0 },
+{ "Tal16ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Tal16Decimal32", TYPE_DEC_FLOAT, 0, 0 },
+{ "Tal16Decimal64", TYPE_DEC_FLOAT, 0, 0 },
+{ "Tal16Decimal128", TYPE_DEC_FLOAT, 0, 0 },
+#endif
+{ "Tal16E0", TYPE_UENUM, 0, ' ' },
+{ "Tal16E1", TYPE_UENUM, 1, ' ' },
+{ "Tal16E2", TYPE_SENUM, 3, ' ' },
+{ "Tal16E3", TYPE_SENUM, 127, ' ' },
+{ "Tal16E4", TYPE_UENUM, 255, ' ' },
+{ "Tal16E5", TYPE_SENUM, 32767, ' ' },
+{ "Tal16E6", TYPE_UENUM, 65535, ' ' },
+{ "Tal16E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Tal16E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Tal16E9", TYPE_SENUM, 1099511627775LL, ' ' }
+#define NATYPES2 (sizeof (attrib_types) / sizeof (attrib_types[0]))
+};
+struct types complex_attrib_types[] = {
+{ "Talcchar", TYPE_CUINT, 127, 0 },
+{ "Talcschar", TYPE_CINT, 127, 0 },
+{ "Talcuchar", TYPE_CUINT, 255, 0 },
+{ "Talcshort", TYPE_CINT, 32767, 0 },
+{ "Talcushort", TYPE_CUINT, 65535, 0 },
+{ "Talcint", TYPE_CINT, 2147483647, 0 },
+{ "Talcuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talclong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talculong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talcllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talcullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talcfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talcdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talcldouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal1cchar", TYPE_CUINT, 127, 0 },
+{ "Tal1cschar", TYPE_CINT, 127, 0 },
+{ "Tal1cuchar", TYPE_CUINT, 255, 0 },
+{ "Tal1cshort", TYPE_CINT, 32767, 0 },
+{ "Tal1cushort", TYPE_CUINT, 65535, 0 },
+{ "Tal1cint", TYPE_CINT, 2147483647, 0 },
+{ "Tal1cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Tal1clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal1culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal1cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal1cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal1cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Tal1cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal1cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal2cchar", TYPE_CUINT, 127, 0 },
+{ "Tal2cschar", TYPE_CINT, 127, 0 },
+{ "Tal2cuchar", TYPE_CUINT, 255, 0 },
+{ "Tal2cshort", TYPE_CINT, 32767, 0 },
+{ "Tal2cushort", TYPE_CUINT, 65535, 0 },
+{ "Tal2cint", TYPE_CINT, 2147483647, 0 },
+{ "Tal2cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Tal2clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal2culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal2cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal2cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal2cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Tal2cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal2cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal4cchar", TYPE_CUINT, 127, 0 },
+{ "Tal4cschar", TYPE_CINT, 127, 0 },
+{ "Tal4cuchar", TYPE_CUINT, 255, 0 },
+{ "Tal4cshort", TYPE_CINT, 32767, 0 },
+{ "Tal4cushort", TYPE_CUINT, 65535, 0 },
+{ "Tal4cint", TYPE_CINT, 2147483647, 0 },
+{ "Tal4cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Tal4clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal4culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal4cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal4cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal4cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Tal4cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal4cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal8cchar", TYPE_CUINT, 127, 0 },
+{ "Tal8cschar", TYPE_CINT, 127, 0 },
+{ "Tal8cuchar", TYPE_CUINT, 255, 0 },
+{ "Tal8cshort", TYPE_CINT, 32767, 0 },
+{ "Tal8cushort", TYPE_CUINT, 65535, 0 },
+{ "Tal8cint", TYPE_CINT, 2147483647, 0 },
+{ "Tal8cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Tal8clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal8culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal8cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal8cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal8cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Tal8cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal8cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal16cchar", TYPE_CUINT, 127, 0 },
+{ "Tal16cschar", TYPE_CINT, 127, 0 },
+{ "Tal16cuchar", TYPE_CUINT, 255, 0 },
+{ "Tal16cshort", TYPE_CINT, 32767, 0 },
+{ "Tal16cushort", TYPE_CUINT, 65535, 0 },
+{ "Tal16cint", TYPE_CINT, 2147483647, 0 },
+{ "Tal16cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Tal16clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal16culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal16cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Tal16cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Tal16cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Tal16cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Tal16cldouble", TYPE_CFLOAT, 0, 0 }
+#define NCATYPES2 (sizeof (complex_attrib_types) / sizeof (complex_attrib_types[0]))
+};
+struct types attrib_array_types[] = {
+{ "Talx1char", TYPE_UINT, 127, 'C' },
+{ "Talx1schar", TYPE_INT, 127, 'C' },
+{ "Talx1uchar", TYPE_UINT, 255, 'C' },
+{ "Talx1short", TYPE_INT, 32767, 'S' },
+{ "Talx1ushort", TYPE_UINT, 65535, 'S' },
+{ "Talx1int", TYPE_INT, 2147483647, 'I' },
+{ "Talx1uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx1long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx1ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx1llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx1ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx1bool", TYPE_UINT, 1, 'B' },
+{ "Talx1ptr", TYPE_PTR, 0, 0 },
+{ "Talx1cptr", TYPE_PTR, 0, 0 },
+{ "Talx1iptr", TYPE_PTR, 0, 0 },
+{ "Talx1float", TYPE_FLOAT, 0, 0 },
+{ "Talx1double", TYPE_FLOAT, 0, 0 },
+{ "Talx1ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Talx1Decimal32", TYPE_DEC_FLOAT, 0 ,0 },
+{ "Talx1Decimal64", TYPE_DEC_FLOAT, 0 ,0 },
+{ "Talx1Decimal128", TYPE_DEC_FLOAT, 0 ,0 },
+#endif
+{ "Talx1E0", TYPE_UENUM, 0, ' ' },
+{ "Talx1E1", TYPE_UENUM, 1, ' ' },
+{ "Talx1E2", TYPE_SENUM, 3, ' ' },
+{ "Talx1E3", TYPE_SENUM, 127, ' ' },
+{ "Talx1E4", TYPE_UENUM, 255, ' ' },
+{ "Talx1E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx1E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx1E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx1E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx1E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Talx2short", TYPE_INT, 32767, 'S' },
+{ "Talx2ushort", TYPE_UINT, 65535, 'S' },
+{ "Talx2int", TYPE_INT, 2147483647, 'I' },
+{ "Talx2uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx2long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx2ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx2llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx2ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx2ptr", TYPE_PTR, 0, 0 },
+{ "Talx2cptr", TYPE_PTR, 0, 0 },
+{ "Talx2iptr", TYPE_PTR, 0, 0 },
+{ "Talx2float", TYPE_FLOAT, 0, 0 },
+{ "Talx2double", TYPE_FLOAT, 0, 0 },
+{ "Talx2ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Talx2Decimal32", TYPE_DEC_FLOAT, 0 , 0 },
+{ "Talx2Decimal64", TYPE_DEC_FLOAT, 0 , 0 },
+{ "Talx2Decimal128", TYPE_DEC_FLOAT, 0 , 0 },
+#endif
+{ "Talx2E0", TYPE_UENUM, 0, ' ' },
+{ "Talx2E1", TYPE_UENUM, 1, ' ' },
+{ "Talx2E2", TYPE_SENUM, 3, ' ' },
+{ "Talx2E3", TYPE_SENUM, 127, ' ' },
+{ "Talx2E4", TYPE_UENUM, 255, ' ' },
+{ "Talx2E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx2E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx2E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx2E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx2E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Talx4int", TYPE_INT, 2147483647, 'I' },
+{ "Talx4uint", TYPE_UINT, 4294967295U, 'I' },
+{ "Talx4long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Talx4ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx4llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx4ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Talx4ptr", TYPE_PTR, 0, 0 },
+{ "Talx4cptr", TYPE_PTR, 0, 0 },
+{ "Talx4iptr", TYPE_PTR, 0, 0 },
+{ "Talx4float", TYPE_FLOAT, 0, 0 },
+{ "Talx4double", TYPE_FLOAT, 0, 0 },
+{ "Talx4ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Talx4Decimal32", TYPE_DEC_FLOAT, 0 , 0 },
+{ "Talx4Decimal64", TYPE_DEC_FLOAT, 0 , 0 },
+{ "Talx4Decimal128", TYPE_DEC_FLOAT, 0 , 0 },
+#endif
+{ "Talx4E0", TYPE_UENUM, 0, ' ' },
+{ "Talx4E1", TYPE_UENUM, 1, ' ' },
+{ "Talx4E2", TYPE_SENUM, 3, ' ' },
+{ "Talx4E3", TYPE_SENUM, 127, ' ' },
+{ "Talx4E4", TYPE_UENUM, 255, ' ' },
+{ "Talx4E5", TYPE_SENUM, 32767, ' ' },
+{ "Talx4E6", TYPE_UENUM, 65535, ' ' },
+{ "Talx4E7", TYPE_SENUM, 2147483647, ' ' },
+{ "Talx4E8", TYPE_UENUM, 4294967295U, ' ' },
+{ "Talx4E9", TYPE_SENUM, 1099511627775LL, ' ' },
+{ "Taly8long", TYPE_INT, 9223372036854775807LL, 'L' },
+{ "Taly8ulong", TYPE_UINT, 18446744073709551615ULL, 'L' },
+{ "Talx8llong", TYPE_INT, 9223372036854775807LL, 'Q' },
+{ "Talx8ullong", TYPE_UINT, 18446744073709551615ULL, 'Q' },
+{ "Taly8ptr", TYPE_PTR, 0, 0 },
+{ "Taly8cptr", TYPE_PTR, 0, 0 },
+{ "Taly8iptr", TYPE_PTR, 0, 0 },
+{ "Talx8double", TYPE_FLOAT, 0, 0 },
+{ "Talx8ldouble", TYPE_FLOAT, 0, 0 },
+#ifndef SKIP_DECIMAL_FLOAT
+{ "Talx8Decimal64", TYPE_DEC_FLOAT, 0, 0 },
+{ "Talx8Decimal128", TYPE_DEC_FLOAT, 0, 0 }
+#endif
+#define NAATYPES2 (sizeof (attrib_array_types) / sizeof (attrib_array_types[0]))
+};
+struct types complex_attrib_array_types[] = {
+{ "Talx1cchar", TYPE_CUINT, 127, 0 },
+{ "Talx1cschar", TYPE_CINT, 127, 0 },
+{ "Talx1cuchar", TYPE_CUINT, 255, 0 },
+{ "Talx1cshort", TYPE_CINT, 32767, 0 },
+{ "Talx1cushort", TYPE_CUINT, 65535, 0 },
+{ "Talx1cint", TYPE_CINT, 2147483647, 0 },
+{ "Talx1cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talx1clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx1culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx1cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx1cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx1cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talx1cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx1cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx2cchar", TYPE_CUINT, 127, 0 },
+{ "Talx2cschar", TYPE_CINT, 127, 0 },
+{ "Talx2cuchar", TYPE_CUINT, 255, 0 },
+{ "Talx2cshort", TYPE_CINT, 32767, 0 },
+{ "Talx2cushort", TYPE_CUINT, 65535, 0 },
+{ "Talx2cint", TYPE_CINT, 2147483647, 0 },
+{ "Talx2cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talx2clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx2culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx2cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx2cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx2cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talx2cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx2cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx4cshort", TYPE_CINT, 32767, 0 },
+{ "Talx4cushort", TYPE_CUINT, 65535, 0 },
+{ "Talx4cint", TYPE_CINT, 2147483647, 0 },
+{ "Talx4cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talx4clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx4culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx4cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx4cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx4cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talx4cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx4cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx8cint", TYPE_CINT, 2147483647, 0 },
+{ "Talx8cuint", TYPE_CUINT, 4294967295U, 0 },
+{ "Talx8clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx8culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx8cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx8cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx8cfloat", TYPE_CFLOAT, 0, 0 },
+{ "Talx8cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx8cldouble", TYPE_CFLOAT, 0, 0 },
+{ "Taly16clong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Taly16culong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx16cllong", TYPE_CINT, 9223372036854775807LL, 0 },
+{ "Talx16cullong", TYPE_CUINT, 18446744073709551615ULL, 0 },
+{ "Talx16cdouble", TYPE_CFLOAT, 0, 0 },
+{ "Talx16cldouble", TYPE_CFLOAT, 0, 0 }
+#define NCAATYPES2 (sizeof (complex_attrib_array_types) / sizeof (complex_attrib_array_types[0]))
+};
+
+struct types bitfld_types[NTYPES2];
+int n_bitfld_types;
+struct types aligned_bitfld_types[NATYPES2];
+int n_aligned_bitfld_types;
+
+const char *attributes[] = {
+"atal",
+"atpa",
+"atal1",
+"atal2",
+"atal4",
+"atal8",
+"atal16",
+#define NATTRIBS1 7
+"atalpa",
+"atpaal",
+"atal1pa",
+"atal2pa",
+"atal4pa",
+"atal8pa",
+"atal16pa",
+"atpaal1",
+"atpaal2",
+"atpaal4",
+"atpaal8",
+"atpaal16"
+#define NATTRIBS2 (sizeof (attributes) / sizeof (attributes[0]))
+};
+
+enum ETYPE
+{
+ ETYPE_TYPE,
+ ETYPE_ARRAY,
+ ETYPE_BITFLD,
+ ETYPE_STRUCT,
+ ETYPE_UNION,
+ ETYPE_STRUCT_ARRAY,
+ ETYPE_UNION_ARRAY
+};
+
+struct entry
+{
+#ifdef __GNUC__
+ enum ETYPE etype : 8;
+#else
+ unsigned char etype;
+#endif
+ unsigned short len;
+ unsigned char arr_len;
+ struct types *type;
+ const char *attrib;
+ /* Used to chain together entries in the hash table. */
+ struct entry *next;
+};
+
+/* A prime number giving the number of slots in the hash table. */
+#define HASH_SIZE 32749
+static struct entry *hash_table[HASH_SIZE];
+
+static int idx, limidx, output_one, short_enums;
+static const char *destdir;
+static const char *srcdir;
+static const char *srcdir_safe;
+FILE *outfile;
+
+void
+switchfiles (int fields)
+{
+ static int filecnt;
+ static char *destbuf, *destptr;
+ int i;
+
+ ++filecnt;
+ if (outfile)
+ fclose (outfile);
+ if (output_one)
+ {
+ outfile = stdout;
+ return;
+ }
+ if (destbuf == NULL)
+ {
+ size_t len = strlen (destdir);
+ destbuf = malloc (len + 20);
+ if (!destbuf)
+ abort ();
+ memcpy (destbuf, destdir, len);
+ if (!len || destbuf[len - 1] != '/')
+ destbuf[len++] = '/';
+ destptr = destbuf + len;
+ }
+ sprintf (destptr, "t%03d_main.c", filecnt);
+ outfile = fopen (destbuf, "w");
+ if (outfile == NULL)
+ {
+ fail:
+ fputs ("failed to create test files\n", stderr);
+ exit (1);
+ }
+ fprintf (outfile, "/* { dg-require-effective-target int32plus } */\n");
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "", srcdir_safe);
+ fprintf (outfile, "/* { dg-prune-output \".*-Wno-abi.*\" } */\n");
+ fprintf (outfile, "/* { dg-prune-output \".*Offset of packed bit-field.*\" } */\n");
+ fprintf (outfile, "\
+#include \"struct-layout-1.h\"\n\
+\n\
+#define TX(n, type, attrs, fields, ops) extern void test##n (void);\n\
+#include \"t%03d_test.h\"\n\
+#undef TX\n\
+\n\
+int main (void)\n\
+{\n\
+#define TX(n, type, attrs, fields, ops) test##n ();\n\
+#include \"t%03d_test.h\"\n\
+#undef TX\n\
+ if (fails)\n\
+ {\n\
+ fflush (stdout);\n\
+ abort ();\n\
+ }\n\
+ exit (0);\n\
+}\n", filecnt, filecnt);
+ fclose (outfile);
+ sprintf (destptr, "t%03d_x.c", filecnt);
+ outfile = fopen (destbuf, "w");
+ if (outfile == NULL)
+ goto fail;
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "-w ", srcdir_safe);
+ fprintf (outfile, "\
+#include \"struct-layout-1_x1.h\"\n\
+#include \"t%03d_test.h\"\n\
+#include \"struct-layout-1_x2.h\"\n\
+#include \"t%03d_test.h\"\n", filecnt, filecnt);
+ fclose (outfile);
+ sprintf (destptr, "t%03d_y.c", filecnt);
+ outfile = fopen (destbuf, "w");
+ if (outfile == NULL)
+ goto fail;
+ for (i = 0; i < NDG_OPTIONS; i++)
+ fprintf (outfile, dg_options[i], "-w ", srcdir_safe);
+ fprintf (outfile, "\
+#include \"struct-layout-1_y1.h\"\n\
+#include \"t%03d_test.h\"\n\
+#include \"struct-layout-1_y2.h\"\n\
+#include \"t%03d_test.h\"\n", filecnt, filecnt);
+ fclose (outfile);
+ sprintf (destptr, "t%03d_test.h", filecnt);
+ outfile = fopen (destbuf, "w");
+ if (outfile == NULL)
+ goto fail;
+ if (fields <= 2)
+ limidx = idx + 300;
+ else if (fields <= 4)
+ limidx = idx + 200;
+ else if (fields <= 6)
+ limidx = idx + 100;
+ else
+ limidx = idx + 50;
+}
+
+unsigned long long int
+getrandll (void)
+{
+ unsigned long long int ret;
+ ret = generate_random () & 0xffffff;
+ ret |= (generate_random () & 0xffffffLL) << 24;
+ ret |= ((unsigned long long int) generate_random ()) << 48;
+ return ret;
+}
+
+int
+subfield (struct entry *e, char *letter)
+{
+ int i, type;
+ char buf[20];
+ const char *p;
+ switch (e[0].etype)
+ {
+ case ETYPE_STRUCT:
+ case ETYPE_UNION:
+ case ETYPE_STRUCT_ARRAY:
+ case ETYPE_UNION_ARRAY:
+ type = e[0].attrib ? 1 + (generate_random () & 3) : 0;
+ if (e[0].etype == ETYPE_STRUCT || e[0].etype == ETYPE_STRUCT_ARRAY)
+ p = "struct";
+ else
+ p = "union";
+ if (e[0].etype == ETYPE_STRUCT_ARRAY || e[0].etype == ETYPE_UNION_ARRAY)
+ {
+ if (e[0].arr_len == 255)
+ snprintf (buf, 20, "%c[]", *letter);
+ else
+ snprintf (buf, 20, "%c[%d]", *letter, e[0].arr_len);
+ /* If this is an array type, do not put aligned attributes on
+ elements. Aligning elements to a value greater than their
+ size will result in a compiler error. */
+ if (type == 1
+ && ((strncmp (e[0].attrib, "atal", 4) == 0)
+ || strncmp (e[0].attrib, "atpaal", 6) == 0))
+ type = 2;
+ }
+ else
+ {
+ buf[0] = *letter;
+ buf[1] = '\0';
+ }
+ ++*letter;
+ switch (type)
+ {
+ case 0:
+ case 3:
+ case 4:
+ fprintf (outfile, "%s{", p);
+ break;
+ case 1:
+ fprintf (outfile, "%s %s{", e[0].attrib, p);
+ break;
+ case 2:
+ fprintf (outfile, "%s %s{", p, e[0].attrib);
+ break;
+ }
+
+ for (i = 1; i <= e[0].len; )
+ i += subfield (e + i, letter);
+
+ switch (type)
+ {
+ case 0:
+ case 1:
+ case 2:
+ fprintf (outfile, "}%s;", buf);
+ break;
+ case 3:
+ fprintf (outfile, "}%s %s;", e[0].attrib, buf);
+ break;
+ case 4:
+ fprintf (outfile, "}%s %s;", buf, e[0].attrib);
+ break;
+ }
+ return 1 + e[0].len;
+ case ETYPE_TYPE:
+ case ETYPE_ARRAY:
+ if (e[0].etype == ETYPE_ARRAY)
+ {
+ if (e[0].arr_len == 255)
+ snprintf (buf, 20, "%c[]", *letter);
+ else
+ snprintf (buf, 20, "%c[%d]", *letter, e[0].arr_len);
+ }
+ else
+ {
+ buf[0] = *letter;
+ buf[1] = '\0';
+ }
+ ++*letter;
+ if (e[0].attrib)
+ {
+ /* If this is an array type, do not put aligned attributes on
+ elements. Aligning elements to a value greater than their
+ size will result in a compiler error. */
+ if (e[0].etype == ETYPE_ARRAY
+ && ((strncmp (e[0].attrib, "atal", 4) == 0)
+ || strncmp (e[0].attrib, "atpaal", 6) == 0))
+ type = 2;
+ else
+ type = generate_random () % 3;
+ switch (type)
+ {
+ case 0:
+ fprintf (outfile, "%s %s %s;", e[0].attrib, e[0].type->name,
+ buf);
+ break;
+ case 1:
+ fprintf (outfile, "%s %s %s;", e[0].type->name, e[0].attrib,
+ buf);
+ break;
+ case 2:
+ fprintf (outfile, "%s %s %s;", e[0].type->name, buf,
+ e[0].attrib);
+ break;
+ }
+ }
+ else
+ fprintf (outfile, "%s %s;", e[0].type->name, buf);
+ return 1;
+ case ETYPE_BITFLD:
+ if (e[0].len == 0)
+ {
+ if (e[0].attrib)
+ switch (generate_random () % 3)
+ {
+ case 0:
+ fprintf (outfile, "%s %s:0;", e[0].attrib, e[0].type->name);
+ break;
+ case 1:
+ fprintf (outfile, "%s %s:0;", e[0].type->name, e[0].attrib);
+ break;
+ case 2:
+ fprintf (outfile, "%s:0 %s;", e[0].type->name, e[0].attrib);
+ break;
+ }
+ else
+ fprintf (outfile, "%s:0;", e[0].type->name);
+ ++*letter;
+ return 1;
+ }
+ switch (e[0].type->bitfld)
+ {
+ case 'C':
+ case 'S':
+ case 'I':
+ case 'L':
+ case 'Q':
+ snprintf (buf, 20, "B%cN(%d)", e[0].type->bitfld, e[0].len);
+ break;
+ case 'B':
+ case ' ':
+ snprintf (buf, 20, "%d", e[0].len);
+ break;
+ default:
+ abort ();
+ }
+ if (e[0].attrib)
+ switch (generate_random () % 3)
+ {
+ case 0:
+ fprintf (outfile, "%s %s %c:%s;", e[0].attrib, e[0].type->name,
+ *letter, buf);
+ break;
+ case 1:
+ fprintf (outfile, "%s %s %c:%s;", e[0].type->name, e[0].attrib,
+ *letter, buf);
+ break;
+ case 2:
+ fprintf (outfile, "%s %c:%s %s;", e[0].type->name, *letter,
+ buf, e[0].attrib);
+ break;
+ }
+ else
+ fprintf (outfile, "%s %c:%s;", e[0].type->name, *letter, buf);
+ ++*letter;
+ return 1;
+ default:
+ abort ();
+ }
+}
+
+char namebuf[1024];
+
+void
+output_FNB (char mode, struct entry *e)
+{
+ unsigned long long int l1, l2, m;
+ int signs = 0;
+#ifndef SKIP_DECIMAL_FLOAT
+ int suffix = 0;
+ char DEC_SUFFIX[3][3]={"DF","DD","DL"};
+#endif
+
+ const char *p, *q;
+
+ if (e->type->type == TYPE_OTHER)
+ {
+ if (mode == 'B')
+ abort ();
+ fprintf (outfile, "N(%d,%s)", idx, namebuf);
+ return;
+ }
+ fprintf (outfile, "%c(%d,%s,", mode, idx, namebuf);
+ l1 = getrandll ();
+ l2 = getrandll ();
+ switch (e->type->type)
+ {
+ case TYPE_INT:
+ signs = generate_random () & 3;
+ m = e->type->maxval;
+ if (mode == 'B')
+ m &= e->len > 1 ? (1ULL << (e->len - 1)) - 1 : 1;
+ l1 &= m;
+ l2 &= m;
+ fprintf (outfile, "%s%" COMPAT_PRLL "u%s,%s%" COMPAT_PRLL "u%s",
+ (signs & 1) ? "-" : "", l1, l1 > 2147483647 ? "LL" : "",
+ (signs & 2) ? "-" : "", l2, l2 > 2147483647 ? "LL" : "");
+ break;
+ case TYPE_UINT:
+ m = e->type->maxval;
+ if (mode == 'B')
+ m &= (1ULL << e->len) - 1;
+ l1 &= m;
+ l2 &= m;
+ fprintf (outfile, "%" COMPAT_PRLL "uU%s,%" COMPAT_PRLL "uU%s",
+ l1, l1 > 4294967295U ? "LL" : "",
+ l2, l2 > 4294967295U ? "LL" : "");
+ break;
+ case TYPE_FLOAT:
+ l1 &= 0xffffff;
+ l2 &= 0xffffff;
+ signs = generate_random () & 3;
+ fprintf (outfile, "%s%f,%s%f", (signs & 1) ? "-" : "",
+ ((double) l1) / 64, (signs & 2) ? "-" : "", ((double) l2) / 64);
+ break;
+#ifndef SKIP_DECIMAL_FLOAT
+ case TYPE_DEC_FLOAT:
+ l1 &= 0xffffff;
+ l2 &= 0xffffff;
+ signs = generate_random () & 3;
+
+ /* Get the suffix of Decimal Floting Points per
+ e->type->name. Distinguish these three DFP types by
+ e->type->name. */
+ if (strstr(e->type->name, "Decimal32")) suffix=0;
+ else if (strstr(e->type->name, "Decimal64")) suffix=1;
+ else if (strstr(e->type->name, "Decimal128")) suffix=2;
+ else
+ abort ();
+
+ /* Formatted input/output specifiers for DFP types have not been
+ implemented in GLIBC. %f here used in fprintf is just to
+ dump the numbers to outfile. */
+ fprintf (outfile, "%s%f%s,%s%f%s",
+ (signs & 1) ? "-" : "", ((double) l1) / 64, DEC_SUFFIX[suffix],
+ (signs & 2) ? "-" : "", ((double) l2) / 64, DEC_SUFFIX[suffix]);
+ break;
+#endif
+ case TYPE_CINT:
+ signs = generate_random () & 3;
+ l1 &= e->type->maxval;
+ l2 &= e->type->maxval;
+ fprintf (outfile,
+ "CINT(%s%" COMPAT_PRLL "u%s,%s%" COMPAT_PRLL "u%s),",
+ (signs & 1) ? "-" : "", l1, l1 > 2147483647 ? "LL" : "",
+ (signs & 2) ? "-" : "", l2, l2 > 2147483647 ? "LL" : "");
+ signs = generate_random () & 3;
+ l1 = getrandll ();
+ l2 = getrandll ();
+ l1 &= e->type->maxval;
+ l2 &= e->type->maxval;
+ fprintf (outfile,
+ "CINT(%s%" COMPAT_PRLL "u%s,%s%" COMPAT_PRLL "u%s)",
+ (signs & 1) ? "-" : "", l1, l1 > 2147483647 ? "LL" : "",
+ (signs & 2) ? "-" : "", l2, l2 > 2147483647 ? "LL" : "");
+ break;
+ case TYPE_CUINT:
+ l1 &= e->type->maxval;
+ l2 &= e->type->maxval;
+ fprintf (outfile,
+ "CINT(%" COMPAT_PRLL "uU%s,%" COMPAT_PRLL "uU%s),",
+ l1, l1 > 4294967295U ? "LL" : "",
+ l2, l2 > 4294967295U ? "LL" : "");
+ l1 = getrandll ();
+ l2 = getrandll ();
+ l1 &= e->type->maxval;
+ l2 &= e->type->maxval;
+ fprintf (outfile,
+ "CINT(%" COMPAT_PRLL "uU%s,%" COMPAT_PRLL "uU%s)",
+ l1, l1 > 4294967295U ? "LL" : "",
+ l2, l2 > 4294967295U ? "LL" : "");
+ break;
+ case TYPE_CFLOAT:
+ l1 &= 0xffffff;
+ l2 &= 0xffffff;
+ signs = generate_random () & 3;
+ fprintf (outfile, "CDBL(%s%f,%s%f),",
+ (signs & 1) ? "-" : "", ((double) l1) / 64,
+ (signs & 2) ? "-" : "", ((double) l2) / 64);
+ l1 = getrandll ();
+ l2 = getrandll ();
+ l1 &= 0xffffff;
+ l2 &= 0xffffff;
+ signs = generate_random () & 3;
+ fprintf (outfile, "CDBL(%s%f,%s%f)",
+ (signs & 1) ? "-" : "", ((double) l1) / 64,
+ (signs & 2) ? "-" : "", ((double) l2) / 64);
+ break;
+ case TYPE_UENUM:
+ if (e->type->maxval == 0)
+ fputs ("e0_0,e0_0", outfile);
+ else if (e->type->maxval == 1)
+ fprintf (outfile, "e1_%" COMPAT_PRLL "d,e1_%" COMPAT_PRLL "d",
+ l1 & 1, l2 & 1);
+ else
+ {
+ p = strchr (e->type->name, '\0');
+ while (--p >= e->type->name && *p >= '0' && *p <= '9');
+ p++;
+ l1 %= 7;
+ l2 %= 7;
+ if (l1 > 3)
+ l1 += e->type->maxval - 6;
+ if (l2 > 3)
+ l2 += e->type->maxval - 6;
+ fprintf (outfile, "e%s_%" COMPAT_PRLL "d,e%s_%" COMPAT_PRLL "d",
+ p, l1, p, l2);
+ }
+ break;
+ case TYPE_SENUM:
+ p = strchr (e->type->name, '\0');
+ while (--p >= e->type->name && *p >= '0' && *p <= '9');
+ p++;
+ l1 %= 7;
+ l2 %= 7;
+ fprintf (outfile, "e%s_%s%" COMPAT_PRLL "d,e%s_%s%" COMPAT_PRLL "d",
+ p, l1 < 3 ? "m" : "",
+ l1 == 3 ? 0LL : e->type->maxval - (l1 & 3),
+ p, l2 < 3 ? "m" : "",
+ l2 == 3 ? 0LL : e->type->maxval - (l2 & 3));
+ break;
+ case TYPE_PTR:
+ l1 %= 256;
+ l2 %= 256;
+ fprintf (outfile,
+ "(%s)&intarray[%" COMPAT_PRLL "d], (%s)&intarray[%" COMPAT_PRLL "d]",
+ e->type->name, l1, e->type->name, l2);
+ break;
+ case TYPE_FNPTR:
+ l1 %= 10;
+ l2 %= 10;
+ fprintf (outfile, "fn%" COMPAT_PRLL "d,fn%" COMPAT_PRLL "d", l1, l2);
+ break;
+ default:
+ abort ();
+ }
+ fputs (")", outfile);
+}
+
+int
+subvalues (struct entry *e, char *p, char *letter)
+{
+ int i, j;
+ char *q;
+ if (p >= namebuf + sizeof (namebuf) - 32)
+ abort ();
+ p[0] = *letter;
+ p[1] = '\0';
+ q = p + 1;
+ switch (e[0].etype)
+ {
+ case ETYPE_STRUCT_ARRAY:
+ case ETYPE_UNION_ARRAY:
+ if (e[0].arr_len == 0 || e[0].arr_len == 255)
+ {
+ *letter += 1 + e[0].len;
+ return 1 + e[0].len;
+ }
+ i = generate_random () % e[0].arr_len;
+ snprintf (p, sizeof (namebuf) - (p - namebuf) - 1,
+ "%c[%d]", *letter, i);
+ q = strchr (p, '\0');
+ /* FALLTHROUGH */
+ case ETYPE_STRUCT:
+ case ETYPE_UNION:
+ *q++ = '.';
+ ++*letter;
+ for (i = 1; i <= e[0].len; )
+ {
+ i += subvalues (e + i, q, letter);
+ if (e[0].etype == ETYPE_UNION || e[0].etype == ETYPE_UNION_ARRAY)
+ {
+ *letter += e[0].len - i + 1;
+ break;
+ }
+ }
+ return 1 + e[0].len;
+ case ETYPE_TYPE:
+ ++*letter;
+ output_FNB ('F', e);
+ return 1;
+ case ETYPE_ARRAY:
+ if (e[0].arr_len == 0 || e[0].arr_len == 255)
+ {
+ ++*letter;
+ return 1;
+ }
+ i = generate_random () % e[0].arr_len;
+ snprintf (p, sizeof (namebuf) - (p - namebuf),
+ "%c[%d]", *letter, i);
+ output_FNB ('F', e);
+ if ((generate_random () & 7) == 0)
+ {
+ j = generate_random () % e[0].arr_len;
+ if (i != j)
+ {
+ snprintf (p, sizeof (namebuf) - (p - namebuf),
+ "%c[%d]", *letter, j);
+ output_FNB ('F', e);
+ }
+ }
+ ++*letter;
+ return 1;
+ case ETYPE_BITFLD:
+ ++*letter;
+ if (e[0].len != 0)
+ output_FNB ('B', e);
+ return 1;
+ }
+}
+
+/* DERIVED FROM:
+--------------------------------------------------------------------
+lookup2.c, by Bob Jenkins, December 1996, Public Domain.
+hash(), hash2(), hash3, and mix() are externally useful functions.
+Routines to test the hash are included if SELF_TEST is defined.
+You can use this free for any purpose. It has no warranty.
+--------------------------------------------------------------------
+*/
+
+/*
+--------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly.
+For every delta with one or two bit set, and the deltas of all three
+ high bits or all three low bits, whether the original value of a,b,c
+ is almost all zero or is uniformly distributed,
+* If mix() is run forward or backward, at least 32 bits in a,b,c
+ have at least 1/4 probability of changing.
+* If mix() is run forward, every bit of c will change between 1/3 and
+ 2/3 of the time. (Well, 22/100 and 78/100 for some 2-bit deltas.)
+mix() was built out of 36 single-cycle latency instructions in a
+ structure that could supported 2x parallelism, like so:
+ a -= b;
+ a -= c; x = (c>>13);
+ b -= c; a ^= x;
+ b -= a; x = (a<<8);
+ c -= a; b ^= x;
+ c -= b; x = (b>>13);
+ ...
+ Unfortunately, superscalar Pentiums and Sparcs can't take advantage
+ of that parallelism. They've also turned some of those single-cycle
+ latency instructions into multi-cycle latency instructions. Still,
+ this is the fastest good hash I could find. There were about 2^^68
+ to choose from. I only looked at a billion or so.
+--------------------------------------------------------------------
+*/
+/* same, but slower, works on systems that might have 8 byte hashval_t's */
+#define mix(a,b,c) \
+{ \
+ a -= b; a -= c; a ^= (c>>13); \
+ b -= c; b -= a; b ^= (a<< 8); \
+ c -= a; c -= b; c ^= ((b&0xffffffff)>>13); \
+ a -= b; a -= c; a ^= ((c&0xffffffff)>>12); \
+ b -= c; b -= a; b = (b ^ (a<<16)) & 0xffffffff; \
+ c -= a; c -= b; c = (c ^ (b>> 5)) & 0xffffffff; \
+ a -= b; a -= c; a = (a ^ (c>> 3)) & 0xffffffff; \
+ b -= c; b -= a; b = (b ^ (a<<10)) & 0xffffffff; \
+ c -= a; c -= b; c = (c ^ (b>>15)) & 0xffffffff; \
+}
+
+/*
+--------------------------------------------------------------------
+hash() -- hash a variable-length key into a 32-bit value
+ k : the key (the unaligned variable-length array of bytes)
+ len : the length of the key, counting by bytes
+ level : can be any 4-byte value
+Returns a 32-bit value. Every bit of the key affects every bit of
+the return value. Every 1-bit and 2-bit delta achieves avalanche.
+About 36+6len instructions.
+
+The best hash table sizes are powers of 2. There is no need to do
+mod a prime (mod is sooo slow!). If you need less than 32 bits,
+use a bitmask. For example, if you need only 10 bits, do
+ h = (h & hashmask(10));
+In which case, the hash table should have hashsize(10) elements.
+
+If you are hashing n strings (ub1 **)k, do it like this:
+ for (i=0, h=0; i<n; ++i) h = hash( k[i], len[i], h);
+
+By Bob Jenkins, 1996. bob_jenkins@burtleburtle.net. You may use this
+code any way you wish, private, educational, or commercial. It's free.
+
+See http://burtleburtle.net/bob/hash/evahash.html
+Use for hash table lookup, or anything where one collision in 2^32 is
+acceptable. Do NOT use for cryptographic purposes.
+--------------------------------------------------------------------
+*/
+
+static hashval_t
+iterative_hash (const void *k_in /* the key */,
+ register size_t length /* the length of the key */,
+ register hashval_t initval /* the previous hash, or
+ an arbitrary value */)
+{
+ register const unsigned char *k = (const unsigned char *)k_in;
+ register hashval_t a,b,c,len;
+
+ /* Set up the internal state */
+ len = length;
+ a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
+ c = initval; /* the previous hash value */
+
+ /*---------------------------------------- handle most of the key */
+ while (len >= 12)
+ {
+ a += (k[0] +((hashval_t)k[1]<<8) +((hashval_t)k[2]<<16) +((hashval_t)k[3]<<24));
+ b += (k[4] +((hashval_t)k[5]<<8) +((hashval_t)k[6]<<16) +((hashval_t)k[7]<<24));
+ c += (k[8] +((hashval_t)k[9]<<8) +((hashval_t)k[10]<<16)+((hashval_t)k[11]<<24));
+ mix(a,b,c);
+ k += 12; len -= 12;
+ }
+
+ /*------------------------------------- handle the last 11 bytes */
+ c += length;
+ switch(len) /* all the case statements fall through */
+ {
+ case 11: c+=((hashval_t)k[10]<<24);
+ case 10: c+=((hashval_t)k[9]<<16);
+ case 9 : c+=((hashval_t)k[8]<<8);
+ /* the first byte of c is reserved for the length */
+ case 8 : b+=((hashval_t)k[7]<<24);
+ case 7 : b+=((hashval_t)k[6]<<16);
+ case 6 : b+=((hashval_t)k[5]<<8);
+ case 5 : b+=k[4];
+ case 4 : a+=((hashval_t)k[3]<<24);
+ case 3 : a+=((hashval_t)k[2]<<16);
+ case 2 : a+=((hashval_t)k[1]<<8);
+ case 1 : a+=k[0];
+ /* case 0: nothing left to add */
+ }
+ mix(a,b,c);
+ /*-------------------------------------------- report the result */
+ return c;
+}
+
+hashval_t
+e_hash (const void *a)
+{
+ const struct entry *e = a;
+ hashval_t ret = 0;
+ int i;
+
+ if (e[0].etype != ETYPE_STRUCT && e[0].etype != ETYPE_UNION)
+ abort ();
+ for (i = 0; i <= e[0].len; ++i)
+ {
+ int attriblen;
+ ret = iterative_hash (&e[i], offsetof (struct entry, attrib), ret);
+ attriblen = e[i].attrib ? strlen (e[i].attrib) : -1;
+ ret = iterative_hash (&attriblen, sizeof (int), ret);
+ if (e[i].attrib)
+ ret = iterative_hash (e[i].attrib, attriblen, ret);
+ }
+ return ret;
+}
+
+int
+e_eq (const void *a, const void *b)
+{
+ const struct entry *ea = a, *eb = b;
+ int i;
+ if (ea[0].etype != ETYPE_STRUCT && ea[0].etype != ETYPE_UNION)
+ abort ();
+ if (ea[0].len != eb[0].len)
+ return 0;
+ for (i = 0; i <= ea[0].len; ++i)
+ {
+ if (ea[i].etype != eb[i].etype
+ || ea[i].len != eb[i].len
+ || ea[i].arr_len != eb[i].arr_len
+ || ea[i].type != eb[i].type)
+ return 0;
+ if ((ea[i].attrib == NULL) ^ (eb[i].attrib == NULL))
+ return 0;
+ if (ea[i].attrib && strcmp (ea[i].attrib, eb[i].attrib) != 0)
+ return 0;
+ }
+ return 1;
+}
+
+static int
+e_exists (const struct entry *e)
+{
+ struct entry *h;
+ hashval_t hval;
+
+ hval = e_hash (e);
+ for (h = hash_table[hval % HASH_SIZE]; h; h = h->next)
+ if (e_eq (e, h))
+ return 1;
+ return 0;
+}
+
+static void
+e_insert (struct entry *e)
+{
+ hashval_t hval;
+
+ hval = e_hash (e);
+ e->next = hash_table[hval % HASH_SIZE];
+ hash_table[hval % HASH_SIZE] = e;
+}
+
+void
+output (struct entry *e)
+{
+ int i;
+ char c;
+ struct entry *n;
+ const char *skip_cint = "";
+
+ if (e[0].etype != ETYPE_STRUCT && e[0].etype != ETYPE_UNION)
+ abort ();
+
+ if (e_exists (e))
+ return;
+
+ n = (struct entry *) malloc ((e[0].len + 1) * sizeof (struct entry));
+ memcpy (n, e, (e[0].len + 1) * sizeof (struct entry));
+ e_insert (n);
+
+ if (idx == limidx)
+ switchfiles (e[0].len);
+
+ for (i = 1; i <= e[0].len; ++i)
+ if ((e[i].etype == ETYPE_TYPE || e[i].etype == ETYPE_ARRAY)
+ && (e[i].type->type == TYPE_CINT || e[i].type->type == TYPE_CUINT))
+ break;
+ if (i <= e[0].len)
+ skip_cint = "CI";
+ if (e[0].attrib)
+ fprintf (outfile, (generate_random () & 1)
+ ? "TX%s(%d,%s %s,," : "TX%s(%d,%s,%s,", skip_cint,
+ idx, e[0].etype == ETYPE_STRUCT ? "struct" : "union",
+ e[0].attrib);
+ else if (e[0].etype == ETYPE_STRUCT)
+ fprintf (outfile, "T%s(%d,", skip_cint, idx);
+ else
+ fprintf (outfile, "U%s(%d,", skip_cint, idx);
+ c = 'a';
+ for (i = 1; i <= e[0].len; )
+ i += subfield (e + i, &c);
+ fputs (",", outfile);
+ c = 'a';
+ for (i = 1; i <= e[0].len; )
+ {
+ i += subvalues (e + i, namebuf, &c);
+ if (e[0].etype == ETYPE_UNION)
+ break;
+ }
+ fputs (")\n", outfile);
+ if (output_one && idx == limidx)
+ exit (0);
+ ++idx;
+}
+
+enum FEATURE
+{
+ FEATURE_VECTOR = 1,
+ FEATURE_COMPLEX = 2,
+ FEATURE_ALIGNEDPACKED = 4,
+ FEATURE_ZEROARRAY = 8,
+ FEATURE_ZEROBITFLD = 16,
+ ALL_FEATURES = FEATURE_COMPLEX | FEATURE_VECTOR | FEATURE_ZEROARRAY
+ | FEATURE_ALIGNEDPACKED | FEATURE_ZEROBITFLD
+};
+
+void
+singles (enum FEATURE features)
+{
+ struct entry e[2];
+ int i;
+ memset (e, 0, sizeof (e));
+ e[0].etype = ETYPE_STRUCT;
+ output (e);
+ e[0].etype = ETYPE_UNION;
+ output (e);
+ for (i = 0;
+ i < ((features & FEATURE_ALIGNEDPACKED) ? NATTRIBS2 : NATTRIBS1);
+ ++i)
+ {
+ e[0].attrib = attributes[i];
+ e[0].etype = ETYPE_STRUCT;
+ output (e);
+ e[0].etype = ETYPE_UNION;
+ output (e);
+ }
+ e[0].len = 1;
+ e[0].attrib = NULL;
+ for (i = 0; i < NTYPES2; ++i)
+ {
+ e[0].etype = ETYPE_STRUCT;
+ e[1].etype = ETYPE_TYPE;
+ e[1].type = &base_types[i];
+ output (e);
+ e[0].etype = ETYPE_UNION;
+ output (e);
+ }
+ if (features & FEATURE_COMPLEX)
+ for (i = 0; i < NCTYPES2; ++i)
+ {
+ e[0].etype = ETYPE_STRUCT;
+ e[1].etype = ETYPE_TYPE;
+ e[1].type = &complex_types[i];
+ output (e);
+ e[0].etype = ETYPE_UNION;
+ output (e);
+ }
+ if (features & FEATURE_VECTOR)
+ for (i = 0; i < NVTYPES2; ++i)
+ {
+ e[0].etype = ETYPE_STRUCT;
+ e[1].etype = ETYPE_TYPE;
+ e[1].type = &vector_types[i];
+ output (e);
+ e[0].etype = ETYPE_UNION;
+ output (e);
+ }
+}
+
+void
+choose_type (enum FEATURE features, struct entry *e, int r, int in_array)
+{
+ int i;
+
+ i = NTYPES2 - NTYPES1;
+ if (features & FEATURE_COMPLEX)
+ i += NCTYPES2;
+ if (features & FEATURE_VECTOR)
+ i += NVTYPES2;
+ if ((r & 3) == 0)
+ {
+ if (in_array)
+ {
+ i += NAATYPES2;
+ if (features & FEATURE_COMPLEX)
+ i += NCAATYPES2;
+ }
+ else
+ {
+ i += NATYPES2;
+ if (features & FEATURE_COMPLEX)
+ i += NCATYPES2;
+ }
+ }
+ r >>= 2;
+ r %= i;
+ if (r < NTYPES2 - NTYPES1)
+ e->type = &base_types[r + NTYPES1];
+ r -= NTYPES2 - NTYPES1;
+ if (e->type == NULL && (features & FEATURE_COMPLEX))
+ {
+ if (r < NCTYPES2)
+ e->type = &complex_types[r];
+ r -= NCTYPES2;
+ }
+ if (e->type == NULL && (features & FEATURE_VECTOR))
+ {
+ if (r < NVTYPES2)
+ e->type = &vector_types[r];
+ r -= NVTYPES2;
+ }
+ if (e->type == NULL && !in_array)
+ {
+ if (r < NATYPES2)
+ e->type = &attrib_types[r];
+ r -= NATYPES2;
+ }
+ if (e->type == NULL && !in_array && (features & FEATURE_COMPLEX))
+ {
+ if (r < NCATYPES2)
+ e->type = &complex_attrib_types[r];
+ r -= NCATYPES2;
+ }
+ if (e->type == NULL && in_array)
+ {
+ if (r < NAATYPES2)
+ e->type = &attrib_array_types[r];
+ r -= NAATYPES2;
+ }
+ if (e->type == NULL && in_array && (features & FEATURE_COMPLEX))
+ {
+ if (r < NCAATYPES2)
+ e->type = &complex_attrib_array_types[r];
+ r -= NCAATYPES2;
+ }
+ if (e->type == NULL)
+ abort ();
+}
+
+/* This is from gcc.c-torture/execute/builtin-bitops-1.c. */
+static int
+my_ffsll (unsigned long long x)
+{
+ int i;
+ if (x == 0)
+ return 0;
+ /* We've tested LLONG_MAX for 64 bits so this should be safe. */
+ for (i = 0; i < 64; i++)
+ if (x & (1ULL << i))
+ break;
+ return i + 1;
+}
+
+void
+generate_fields (enum FEATURE features, struct entry *e, struct entry *parent,
+ int len)
+{
+ int r, i, j, ret = 1, n, incr, sametype;
+
+ for (n = 0; n < len; n += incr)
+ {
+ r = generate_random ();
+ /* 50% ETYPE_TYPE base_types NTYPES1
+ 12.5% ETYPE_TYPE other
+ 12.5% ETYPE_ARRAY
+ 12.5% ETYPE_BITFLD
+ 12.5% ETYPE_STRUCT|ETYPE_UNION|ETYPE_STRUCT_ARRAY|ETYPE_UNION_ARRAY */
+ i = (r & 7);
+ r >>= 3;
+ incr = 1;
+ switch (i)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ e[n].etype = ETYPE_TYPE;
+ e[n].type = &base_types[r % NTYPES1];
+ break;
+ case 4:
+ e[n].etype = ETYPE_TYPE;
+ choose_type (features, &e[n], r, 0);
+ break;
+ case 5:
+ e[n].etype = ETYPE_ARRAY;
+ i = r & 1;
+ r >>= 1;
+ if (i)
+ e[n].type = &base_types[r % NTYPES1];
+ else
+ choose_type (features, &e[n], r, 1);
+ r = generate_random ();
+ if ((features & FEATURE_ZEROARRAY) && (r & 3) == 0)
+ {
+ e[n].arr_len = 0;
+ if (n == len - 1 && (r & 4)
+ && (parent->etype == ETYPE_STRUCT
+ || parent->etype == ETYPE_STRUCT_ARRAY))
+ {
+ int k;
+ for (k = 0; k < n; ++k)
+ if (e[k].etype != ETYPE_BITFLD || e[k].len)
+ {
+ e[n].arr_len = 255;
+ break;
+ }
+ }
+ }
+ else if ((r & 3) != 3)
+ e[n].arr_len = (r >> 2) & 7;
+ else
+ e[n].arr_len = (r >> 2) & 31;
+ break;
+ case 6:
+ sametype = 1;
+ switch (r & 7)
+ {
+ case 0:
+ case 1:
+ case 2:
+ break;
+ case 3:
+ case 4:
+ case 5:
+ incr = 1 + (r >> 3) % (len - n);
+ break;
+ case 6:
+ case 7:
+ sametype = 0;
+ incr = 1 + (r >> 3) % (len - n);
+ break;
+ }
+ for (j = n; j < n + incr; ++j)
+ {
+ int mi, ma;
+
+ e[j].etype = ETYPE_BITFLD;
+ if (j == n || !sametype)
+ {
+ int k;
+ r = generate_random ();
+ k = r & 3;
+ r >>= 2;
+ if (!k)
+ e[j].type
+ = &aligned_bitfld_types[r % n_aligned_bitfld_types];
+ else
+ e[j].type
+ = &bitfld_types[r % n_bitfld_types];
+ }
+ else
+ e[j].type = e[n].type;
+ r = generate_random ();
+ mi = 0;
+ ma = 0;
+ switch (e[j].type->bitfld)
+ {
+ case 'C': ma = 8; break;
+ case 'S': ma = 16; break;
+ case 'I': ma = 32; break;
+ case 'L':
+ case 'Q': ma = 64; break;
+ case 'B': ma = 1; break;
+ case ' ':
+ if (e[j].type->type == TYPE_UENUM)
+ mi = my_ffsll (e[j].type->maxval + 1) - 1;
+ else if (e[j].type->type == TYPE_SENUM)
+ mi = my_ffsll (e[j].type->maxval + 1);
+ else
+ abort ();
+ if (!mi)
+ mi = 1;
+ if (mi > 32)
+ ma = 64;
+ else if (mi > 16 || !short_enums)
+ ma = 32;
+ else if (mi > 8)
+ ma = 16;
+ else
+ ma = 8;
+ break;
+ default:
+ abort ();
+ }
+ e[j].len = ma + 1;
+ if (sametype && (r & 3) == 0 && ma > 1)
+ {
+ int sum = 0, k;
+ for (k = n; k < j; ++k)
+ sum += e[k].len;
+ sum %= ma;
+ e[j].len = sum ? ma - sum : ma;
+ }
+ r >>= 2;
+ if (! (features & FEATURE_ZEROBITFLD) && mi == 0)
+ mi = 1;
+ if (e[j].len < mi || e[j].len > ma)
+ e[j].len = mi + (r % (ma + 1 - mi));
+ r >>= 6;
+ if ((features & FEATURE_ZEROBITFLD) && (r & 3) == 0
+ && mi == 0)
+ e[j].len = 0;
+ }
+ break;
+ case 7:
+ switch (r & 7)
+ {
+ case 0:
+ case 1:
+ case 2:
+ e[n].etype = ETYPE_STRUCT;
+ break;
+ case 3:
+ case 4:
+ e[n].etype = ETYPE_UNION;
+ break;
+ case 5:
+ case 6:
+ e[n].etype = ETYPE_STRUCT_ARRAY;
+ break;
+ case 7:
+ e[n].etype = ETYPE_UNION_ARRAY;
+ break;
+ }
+ r >>= 3;
+ e[n].len = r % (len - n);
+ incr = 1 + e[n].len;
+ generate_fields (features, &e[n + 1], &e[n], e[n].len);
+ if (e[n].etype == ETYPE_STRUCT_ARRAY
+ || e[n].etype == ETYPE_UNION_ARRAY)
+ {
+ r = generate_random ();
+ if ((features & FEATURE_ZEROARRAY) && (r & 3) == 0)
+ {
+ e[n].arr_len = 0;
+ if (n + incr == len && (r & 4)
+ && (parent->etype == ETYPE_STRUCT
+ || parent->etype == ETYPE_STRUCT_ARRAY))
+ {
+ int k;
+ for (k = 0; k < n; ++k)
+ if (e[k].etype != ETYPE_BITFLD || e[k].len)
+ {
+ e[n].arr_len = 255;
+ break;
+ }
+ }
+ }
+ else if ((r & 3) != 3)
+ e[n].arr_len = (r >> 2) & 7;
+ else
+ e[n].arr_len = (r >> 2) & 31;
+ }
+ break;
+ }
+ r = generate_random ();
+ if ((r & 7) == 0)
+ {
+ r >>= 3;
+ i = (features & FEATURE_ALIGNEDPACKED) ? NATTRIBS2 : NATTRIBS1;
+ e[n].attrib = attributes[r % i];
+ if (! (features & FEATURE_ALIGNEDPACKED)
+ && strcmp (e[n].attrib, "atpa") == 0
+ && ((e[n].type >= &attrib_types[0]
+ && e[n].type < &attrib_types[NATYPES2])
+ || (e[n].type >= &complex_attrib_types[0]
+ && e[n].type < &complex_attrib_types[NCATYPES2])
+ || (e[n].type >= &attrib_array_types[0]
+ && e[n].type < &attrib_array_types[NAATYPES2])
+ || (e[n].type >= &complex_attrib_array_types[0]
+ && e[n].type < &complex_attrib_array_types[NAATYPES2])
+ || (e[n].type >= &aligned_bitfld_types[0]
+ && e[n].type < &aligned_bitfld_types[n_aligned_bitfld_types])))
+ e[n].attrib = NULL;
+ }
+ }
+}
+
+void
+generate_random_tests (enum FEATURE features, int len)
+{
+ struct entry e[len + 1];
+ int i, r;
+ if (len > 'z' - 'a' + 1)
+ abort ();
+ memset (e, 0, sizeof (e));
+ r = generate_random ();
+ if ((r & 7) == 0)
+ e[0].etype = ETYPE_UNION;
+ else
+ e[0].etype = ETYPE_STRUCT;
+ r >>= 3;
+ e[0].len = len;
+ if ((r & 31) == 0)
+ {
+ r >>= 5;
+ if (features & FEATURE_ALIGNEDPACKED)
+ r %= NATTRIBS2;
+ else
+ r %= NATTRIBS1;
+ e[0].attrib = attributes[r];
+ }
+ generate_fields (features, &e[1], &e[0], len);
+ output (e);
+}
+
+struct { const char *name; enum FEATURE f; }
+features[] = {
+{ "normal", 0 },
+{ "complex", FEATURE_COMPLEX },
+{ "vector", FEATURE_VECTOR },
+{ "[0] :0", FEATURE_ZEROARRAY | FEATURE_ZEROBITFLD },
+{ "complex vector [0]",
+ FEATURE_COMPLEX | FEATURE_VECTOR | FEATURE_ZEROARRAY },
+{ "aligned packed complex vector [0] :0",
+ FEATURE_COMPLEX | FEATURE_VECTOR | FEATURE_ZEROARRAY
+ | FEATURE_ALIGNEDPACKED | FEATURE_ZEROBITFLD },
+};
+
+int
+main (int argc, char **argv)
+{
+ int i, j, count, c, n = 3000;
+ char *optarg;
+
+ if (sizeof (int) != 4 || sizeof (long long) != 8)
+ return 1;
+
+ i = 1;
+ while (i < argc)
+ {
+ c = '\0';
+ if (argv[i][0] == '-' && argv[i][2] == '\0')
+ c = argv[i][1];
+ optarg = argv[i + 1];
+ if (!optarg)
+ goto usage;
+ switch (c)
+ {
+ case 'n':
+ n = atoi (optarg);
+ break;
+ case 'd':
+ destdir = optarg;
+ break;
+ case 's':
+ srcdir = optarg;
+ break;
+ case 'i':
+ output_one = 1;
+ limidx = atoi (optarg);
+ break;
+ case 'e':
+ short_enums = 1;
+ i--;
+ break;
+ default:
+ fprintf (stderr, "unrecognized option %s\n", argv[i]);
+ goto usage;
+ }
+ i += 2;
+ }
+
+ if (output_one)
+ {
+ outfile = fopen ("/dev/null", "w");
+ if (outfile == NULL)
+ {
+ fputs ("could not open /dev/null", stderr);
+ return 1;
+ }
+ n = limidx + 1;
+ }
+
+ if (destdir == NULL && !output_one)
+ {
+ usage:
+ fprintf (stderr, "Usage:\n\
+%s [-e] [-s srcdir -d destdir] [-n count] [-i idx]\n\
+Either -s srcdir -d destdir or -i idx must be used\n", argv[0]);
+ return 1;
+ }
+
+ if (srcdir == NULL && !output_one)
+ goto usage;
+
+ if (srcdir != NULL)
+ {
+ const char *s = srcdir;
+ char *ss, *t;
+ t = ss = malloc (strlen (srcdir) + 1);
+ if (!ss)
+ abort ();
+ do {
+ if (*s == '\\')
+ *t++ = '/';
+ else
+ *t++ = *s;
+ } while (*s++);
+ srcdir_safe = ss;
+ }
+
+ for (i = 0; i < NTYPES2; ++i)
+ if (base_types[i].bitfld)
+ bitfld_types[n_bitfld_types++] = base_types[i];
+ for (i = 0; i < NATYPES2; ++i)
+ if (attrib_types[i].bitfld)
+ aligned_bitfld_types[n_aligned_bitfld_types++] = attrib_types[i];
+ for (i = 0; i < sizeof (features) / sizeof (features[0]); ++i)
+ {
+ int startidx = idx;
+ if (! output_one)
+ limidx = idx;
+ if (!i)
+ count = 200;
+ else
+ count = 20;
+ for (j = 1; j <= 9; ++j)
+ while (idx < startidx + j * count)
+ generate_random_tests (features[i].f, j);
+ while (idx < startidx + count * 10)
+ generate_random_tests (features[i].f, 10 + (generate_random () % 16));
+ }
+ for (i = 0; n > 3000 && i < sizeof (features) / sizeof (features[0]); ++i)
+ {
+ int startidx;
+ startidx = idx;
+ if (! output_one)
+ limidx = idx;
+ singles (features[i].f);
+ if (!i)
+ {
+ count = 1000;
+ while (idx < startidx + 1000)
+ generate_random_tests (features[i].f, 1);
+ }
+ else
+ {
+ startidx = idx;
+ count = 100;
+ while (idx < startidx + 100)
+ generate_random_tests (features[i].f, 1);
+ }
+ startidx = idx;
+ for (j = 2; j <= 9; ++j)
+ while (idx < startidx + (j - 1) * count)
+ generate_random_tests (features[i].f, j);
+ while (idx < startidx + count * 9)
+ generate_random_tests (features[i].f, 10 + (generate_random () % 16));
+ }
+ if (! output_one)
+ limidx = idx;
+ while (idx < n)
+ generate_random_tests (ALL_FEATURES, 1 + (generate_random () % 25));
+ fclose (outfile);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
new file mode 100644
index 000000000..b59453e0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
@@ -0,0 +1,17 @@
+/* { dg-prune-output ".*-Wno-abi.*" } */
+
+#include "struct-layout-1.h"
+
+#define TX(n, type, attrs, fields, ops) extern void test##n (void);
+#include "struct-layout-1_test.h"
+#undef TX
+
+int main (void)
+{
+#define TX(n, type, attrs, fields, ops) test##n ();
+#include "struct-layout-1_test.h"
+#undef TX
+ if (fails)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h
new file mode 100644
index 000000000..affddcaef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_test.h
@@ -0,0 +1 @@
+T(0,enum E2 a:7;,B(0,a,e2_m1,e2_0))
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x.c
new file mode 100644
index 000000000..02c885c62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x.c
@@ -0,0 +1,5 @@
+/* { dg-options "-w" } */
+#include "struct-layout-1_x1.h"
+#include "struct-layout-1_test.h"
+#include "struct-layout-1_x2.h"
+#include "struct-layout-1_test.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x1.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x1.h
new file mode 100644
index 000000000..0c7696fa7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x1.h
@@ -0,0 +1,68 @@
+#include "struct-layout-1.h"
+
+struct Info info;
+int fails;
+int intarray[256];
+int fn0 (void) { return 0; }
+int fn1 (void) { return 1; }
+int fn2 (void) { return 2; }
+int fn3 (void) { return 3; }
+int fn4 (void) { return 4; }
+int fn5 (void) { return 5; }
+int fn6 (void) { return 6; }
+int fn7 (void) { return 7; }
+int fn8 (void) { return 8; }
+int fn9 (void) { return 9; }
+
+/* This macro is intended for fields where their
+ addresses/sizes/alignments and value passing should be checked. */
+#define F(n, x, v, w) \
+ info.flds[i] = &s##n.x; \
+ info.sizes[i] = sizeof (s##n.x); \
+ info.aligns[i] = __alignof__ (s##n.x); \
+ s##n.x = v; \
+ a##n[2].x = w; \
+ ++i;
+/* This macro is for fields where just their addresses/sizes/alignments
+ should be checked. */
+#define N(n, x) \
+ info.flds[i] = &s##n.x; \
+ info.sizes[i] = sizeof (s##n.x); \
+ info.aligns[i] = __alignof__ (s##n.x); \
+ ++i;
+/* This macro is for fields where just value passing should be checked. */
+#define B(n, x, v, w) \
+ s##n.x = v; \
+ a##n[2].x = w; \
+ ++j;
+#define TX(n, type, attrs, fields, ops) \
+type S##n { fields } attrs; \
+type S##n s##n; \
+extern type S##n a##n[5]; \
+extern type S##n check##n (type S##n, type S##n *, \
+ type S##n); \
+extern void check##n##va (int i, ...); \
+extern void checkx##n (type S##n); \
+void test##n (void) \
+{ \
+ int i, j; \
+ memset (&s##n, '\0', sizeof (s##n)); \
+ memset (a##n, '\0', sizeof (a##n)); \
+ memset (&info, '\0', sizeof (info)); \
+ info.sp = &s##n; \
+ info.a0p = &a##n[0]; \
+ info.a3p = &a##n[3]; \
+ info.sz = sizeof (s##n); \
+ info.als = __alignof__ (s##n); \
+ info.ala0 = __alignof__ (a##n[0]); \
+ info.ala3 = __alignof__ (a##n[3]); \
+ if (((long) &a##n[3]) & (info.als - 1)) \
+ FAIL (n, 1); \
+ i = 0; j = 0; \
+ ops \
+ info.nfields = i; \
+ info.nbitfields = j; \
+ checkx##n (check##n (s##n, &a##n[1], a##n[2])); \
+ check##n##va (1, 1.0, s##n, 2LL, a##n[2], a##n[2]); \
+ check##n##va (2, s##n, s##n, 2.0L, a##n[2], s##n); \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x2.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x2.h
new file mode 100644
index 000000000..907a2c959
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_x2.h
@@ -0,0 +1,14 @@
+#undef F
+#undef N
+#undef B
+#undef TX
+#define F(n, x, v, w) \
+ if (arg.x != s##n.x) FAIL (n, 30);
+#define N(n, x)
+#define B(n, x, v, w) \
+ if (arg.x != s##n.x) FAIL (n, 30);
+#define TX(n, type, attrs, fields, ops) \
+void checkx##n (type S##n arg) \
+{ \
+ ops \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y.c
new file mode 100644
index 000000000..ed95f5a50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y.c
@@ -0,0 +1,5 @@
+/* { dg-options "-w" } */
+#include "struct-layout-1_y1.h"
+#include "struct-layout-1_test.h"
+#include "struct-layout-1_y2.h"
+#include "struct-layout-1_test.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y1.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y1.h
new file mode 100644
index 000000000..9a5d2468a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y1.h
@@ -0,0 +1,76 @@
+#include "struct-layout-1.h"
+
+#define F(n, x, v, w) \
+ if (info.flds[i] != &s##n.x) \
+ FAIL (n, 50); \
+ if (info.sizes[i] != sizeof (s##n.x)) \
+ FAIL (n, 51); \
+ if (info.aligns[i] != __alignof__ (s##n.x)) \
+ FAIL (n, 52); \
+ if (s##n.x != (__typeof__ (s##n.x)) v) \
+ FAIL (n, 53); \
+ if (a##n[2].x != (__typeof__ (s##n.x)) w) \
+ FAIL (n, 54); \
+ if (arg0.x != s##n.x) \
+ FAIL (n, 55); \
+ if (arg2.x != a##n[2].x) \
+ FAIL (n, 56); \
+ ret.x = s##n.x; \
+ ++i;
+#define N(n, x) \
+ if (info.flds[i] != &s##n.x) \
+ FAIL (n, 50); \
+ if (info.sizes[i] != sizeof (s##n.x)) \
+ FAIL (n, 51); \
+ if (info.aligns[i] != __alignof__ (s##n.x)) \
+ FAIL (n, 52); \
+ ++i;
+#define B(n, x, v, w) \
+ b1.x = v; b2.x = w; \
+ if (s##n.x != b1.x) \
+ FAIL (n, 53); \
+ if (a##n[2].x != b2.x) \
+ FAIL (n, 54); \
+ if (arg0.x != s##n.x) \
+ FAIL (n, 55); \
+ if (arg2.x != a##n[2].x) \
+ FAIL (n, 56); \
+ ret.x = s##n.x; \
+ ++j;
+#define TX(n, type, attrs, fields, ops) \
+type S##n { fields } attrs; \
+extern type S##n s##n; \
+type S##n a##n[5]; \
+type S##n \
+check##n (type S##n arg0, type S##n *arg1, type S##n arg2) \
+{ \
+ type S##n ret; \
+ type S##n b1, b2; \
+ int i, j; \
+ \
+ memset (&ret, 0, sizeof (ret)); \
+ memset (&b1, 0, sizeof (b1)); \
+ memset (&b2, 0, sizeof (b2)); \
+ if (info.sp != &s##n) \
+ FAIL (n, 10); \
+ if (info.a0p != &a##n[0]) \
+ FAIL (n, 11); \
+ if (info.a3p != &a##n[3]) \
+ FAIL (n, 12); \
+ if (info.sz != sizeof (s##n)) \
+ FAIL (n, 13); \
+ if (info.als != __alignof__ (s##n)) \
+ FAIL (n, 14); \
+ if (info.ala0 != __alignof__ (a##n[0])) \
+ FAIL (n, 15); \
+ if (info.ala3 != __alignof__ (a##n[3])) \
+ FAIL (n, 16); \
+ if (arg1 != &a##n[1]) \
+ FAIL (n, 17); \
+ i = 0; j = 0; \
+ ops \
+ if (i != info.nfields || j != info.nbitfields) \
+ FAIL (n, 18); \
+ \
+ return ret; \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y2.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y2.h
new file mode 100644
index 000000000..02a341e1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-layout-1_y2.h
@@ -0,0 +1,69 @@
+#undef F
+#undef N
+#undef B
+#undef TX
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define F(n, x, v, w) \
+ if (p->x != arg.x) FAIL (n, 74);
+#define N(n, x)
+#define B(n, x, v, w) \
+ if (p->x != arg.x) FAIL (n, 74);
+#define TX(n, type, attrs, fields, ops) \
+void \
+check##n##va (int z, ...) \
+{ \
+ type S##n arg, *p; \
+ va_list ap; \
+ int i; \
+ \
+ if (test_va) \
+ { \
+ va_start (ap, z); \
+ for (i = 0; i < 5; ++i) \
+ { \
+ p = NULL; \
+ switch ((z << 4) | i) \
+ { \
+ case 0x10: \
+ if (va_arg (ap, double) != 1.0) \
+ FAIL (n, 70); \
+ break; \
+ case 0x12: \
+ if (va_arg (ap, long long) != 2LL) \
+ FAIL (n, 71); \
+ break; \
+ case 0x22: \
+ if (va_arg (ap, long double) != 2.0L) \
+ FAIL (n, 72); \
+ break; \
+ case 0x11: \
+ case 0x20: \
+ case 0x21: \
+ case 0x24: \
+ p = &s##n; \
+ arg = va_arg (ap, type S##n); \
+ break; \
+ case 0x13: \
+ case 0x14: \
+ case 0x23: \
+ p = &a##n[2]; \
+ arg = va_arg (ap, type S##n); \
+ break; \
+ default: \
+ FAIL (n, 73); \
+ break; \
+ } \
+ if (p) \
+ { \
+ ops \
+ } \
+ } \
+ va_end (ap); \
+ } \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_main.c
new file mode 100644
index 000000000..fca68286c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_main.c
@@ -0,0 +1,13 @@
+/* Test function return values. For this test, all struct members are
+ scalar floating point types. */
+
+extern void struct_return_10_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_return_10_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c
new file mode 100644
index 000000000..d1531b179
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_x.c
@@ -0,0 +1,119 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, double y); \
+extern void checkg##TYPE (void); \
+extern TYPE test0##TYPE (void); \
+extern TYPE test1##TYPE (TYPE); \
+extern TYPE testva##TYPE (int n, ...); \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE (&g01##TYPE, 1.0); \
+ init##TYPE (&g02##TYPE, 2.0); \
+ init##TYPE (&g03##TYPE, 3.0); \
+ init##TYPE (&g04##TYPE, 4.0); \
+ init##TYPE (&g05##TYPE, 5.0); \
+ init##TYPE (&g06##TYPE, 6.0); \
+ init##TYPE (&g07##TYPE, 7.0); \
+ init##TYPE (&g08##TYPE, 8.0); \
+ init##TYPE (&g09##TYPE, 9.0); \
+ init##TYPE (&g10##TYPE, 10.0); \
+ init##TYPE (&g11##TYPE, 11.0); \
+ init##TYPE (&g12##TYPE, 12.0); \
+ init##TYPE (&g13##TYPE, 13.0); \
+ init##TYPE (&g14##TYPE, 14.0); \
+ init##TYPE (&g15##TYPE, 15.0); \
+ init##TYPE (&g16##TYPE, 16.0); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##TYPE (); \
+ check##TYPE (rslt, 1.0); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##TYPE (g01##TYPE); \
+ check##TYPE (rslt, 1.0); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ rslt = testva##TYPE (1, g01##TYPE); \
+ check##TYPE (rslt, 1.0); \
+ rslt = testva##TYPE (5, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE); \
+ check##TYPE (rslt, 5.0); \
+ rslt = testva##TYPE (9, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE); \
+ check##TYPE (rslt, 9.0); \
+ rslt = testva##TYPE (16, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE, g10##TYPE, \
+ g11##TYPE, g12##TYPE, \
+ g13##TYPE, g14##TYPE, \
+ g15##TYPE, g16##TYPE); \
+ check##TYPE (rslt, 16.0); \
+ DEBUG_NL; \
+}
+
+#include "fp2-struct-defs.h"
+#include "fp2-struct-check.h"
+
+T(Sfd)
+T(Sfl)
+T(Sdf)
+T(Sdl)
+T(Slf)
+T(Sld)
+T(Sfdl)
+T(Sfld)
+T(Sdfl)
+T(Sdlf)
+T(Slfd)
+T(Sldf)
+
+#undef T
+
+void
+struct_return_10_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Sfd);
+T(Sfl);
+T(Sdf);
+T(Sdl);
+T(Slf);
+T(Sld);
+T(Sfdl);
+T(Sfld);
+T(Sdfl);
+T(Sdlf);
+T(Slfd);
+T(Sldf);
+
+DEBUG_FINI
+
+if (fails != 0)
+ return;
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_y.c
new file mode 100644
index 000000000..dcc0b93c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-10_y.c
@@ -0,0 +1,79 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+
+#include "fp2-struct-defs.h"
+#include "fp2-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void check##TYPE (TYPE x, double y); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE (g01##TYPE, 1.0); \
+ check##TYPE (g02##TYPE, 2.0); \
+ check##TYPE (g03##TYPE, 3.0); \
+ check##TYPE (g04##TYPE, 4.0); \
+ check##TYPE (g05##TYPE, 5.0); \
+ check##TYPE (g06##TYPE, 6.0); \
+ check##TYPE (g07##TYPE, 7.0); \
+ check##TYPE (g08##TYPE, 8.0); \
+ check##TYPE (g09##TYPE, 9.0); \
+ check##TYPE (g10##TYPE, 10.0); \
+ check##TYPE (g11##TYPE, 11.0); \
+ check##TYPE (g12##TYPE, 12.0); \
+ check##TYPE (g13##TYPE, 13.0); \
+ check##TYPE (g14##TYPE, 14.0); \
+ check##TYPE (g15##TYPE, 15.0); \
+ check##TYPE (g16##TYPE, 16.0); \
+} \
+ \
+TYPE \
+test0##TYPE (void) \
+{ \
+ return g01##TYPE; \
+} \
+ \
+TYPE \
+test1##TYPE (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ if (1) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ rslt = va_arg (ap, TYPE); \
+ } \
+ va_end (ap); \
+ } \
+ return rslt; \
+}
+
+T(Sfd)
+T(Sfl)
+T(Sdf)
+T(Sdl)
+T(Slf)
+T(Sld)
+T(Sfdl)
+T(Sfld)
+T(Sdfl)
+T(Sdlf)
+T(Slfd)
+T(Sldf)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_main.c
new file mode 100644
index 000000000..65d8365ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_main.c
@@ -0,0 +1,16 @@
+/* Test function return values. Struct members are char, int, double,
+ and other structs containing these types. This test was written in
+ response to a layout change for such structs for powerpc64-linux,
+ but this test only checks similar structs that are not affected by
+ that break in compatibility. */
+
+extern void struct_return_19_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_return_19_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_x.c
new file mode 100644
index 000000000..0085a9f68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_x.c
@@ -0,0 +1,122 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(TYPE) \
+TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern TYPE test0##TYPE (void); \
+extern TYPE test1##TYPE (TYPE); \
+extern TYPE testva##TYPE (int n, ...); \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE (&g01##TYPE, 1); \
+ init##TYPE (&g02##TYPE, 2); \
+ init##TYPE (&g03##TYPE, 3); \
+ init##TYPE (&g04##TYPE, 4); \
+ init##TYPE (&g05##TYPE, 5); \
+ init##TYPE (&g06##TYPE, 6); \
+ init##TYPE (&g07##TYPE, 7); \
+ init##TYPE (&g08##TYPE, 8); \
+ init##TYPE (&g09##TYPE, 9); \
+ init##TYPE (&g10##TYPE, 10); \
+ init##TYPE (&g11##TYPE, 11); \
+ init##TYPE (&g12##TYPE, 12); \
+ init##TYPE (&g13##TYPE, 13); \
+ init##TYPE (&g14##TYPE, 14); \
+ init##TYPE (&g15##TYPE, 15); \
+ init##TYPE (&g16##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##TYPE (); \
+ check##TYPE (rslt, 1); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##TYPE (g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##TYPE (1, g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ rslt = testva##TYPE (5, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE); \
+ check##TYPE (rslt, 5); \
+ rslt = testva##TYPE (9, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE); \
+ check##TYPE (rslt, 9); \
+ rslt = testva##TYPE (16, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE, g10##TYPE, \
+ g11##TYPE, g12##TYPE, \
+ g13##TYPE, g14##TYPE, \
+ g15##TYPE, g16##TYPE); \
+ check##TYPE (rslt, 16); \
+ } \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
+
+#undef T
+
+void
+struct_return_19_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_y.c
new file mode 100644
index 000000000..6bbbb62cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-19_y.c
@@ -0,0 +1,70 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE (g01##TYPE, 1); \
+ check##TYPE (g02##TYPE, 2); \
+ check##TYPE (g03##TYPE, 3); \
+ check##TYPE (g04##TYPE, 4); \
+ check##TYPE (g05##TYPE, 5); \
+ check##TYPE (g06##TYPE, 6); \
+ check##TYPE (g07##TYPE, 7); \
+ check##TYPE (g08##TYPE, 8); \
+ check##TYPE (g09##TYPE, 9); \
+ check##TYPE (g10##TYPE, 10); \
+ check##TYPE (g11##TYPE, 11); \
+ check##TYPE (g12##TYPE, 12); \
+ check##TYPE (g13##TYPE, 13); \
+ check##TYPE (g14##TYPE, 14); \
+ check##TYPE (g15##TYPE, 15); \
+ check##TYPE (g16##TYPE, 16); \
+} \
+ \
+TYPE \
+test0##TYPE (void) \
+{ \
+ return g01##TYPE; \
+} \
+ \
+TYPE \
+test1##TYPE (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(Scdc)
+T(Sd)
+T(Sdi)
+T(Scsdsc)
+T(Scsdis)
+T(Scsdisc)
+T(Ssds)
+T(Ssdsc)
+T(Scssdssc)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_main.c
new file mode 100644
index 000000000..7f928ba82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_main.c
@@ -0,0 +1,14 @@
+/* Test function return values. Tested structs end with double. This
+ was written in response to a layout change for such structs for
+ powerpc64-linux that breaks compatibility between 3.3 and 3.4. */
+
+extern void struct_return_20_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_return_20_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_x.c
new file mode 100644
index 000000000..be7139f7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_x.c
@@ -0,0 +1,110 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(TYPE) \
+TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern TYPE test0##TYPE (void); \
+extern TYPE test1##TYPE (TYPE); \
+extern TYPE testva##TYPE (int n, ...); \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE (&g01##TYPE, 1); \
+ init##TYPE (&g02##TYPE, 2); \
+ init##TYPE (&g03##TYPE, 3); \
+ init##TYPE (&g04##TYPE, 4); \
+ init##TYPE (&g05##TYPE, 5); \
+ init##TYPE (&g06##TYPE, 6); \
+ init##TYPE (&g07##TYPE, 7); \
+ init##TYPE (&g08##TYPE, 8); \
+ init##TYPE (&g09##TYPE, 9); \
+ init##TYPE (&g10##TYPE, 10); \
+ init##TYPE (&g11##TYPE, 11); \
+ init##TYPE (&g12##TYPE, 12); \
+ init##TYPE (&g13##TYPE, 13); \
+ init##TYPE (&g14##TYPE, 14); \
+ init##TYPE (&g15##TYPE, 15); \
+ init##TYPE (&g16##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##TYPE (); \
+ check##TYPE (rslt, 1); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##TYPE (g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##TYPE (1, g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ rslt = testva##TYPE (5, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE); \
+ check##TYPE (rslt, 5); \
+ rslt = testva##TYPE (9, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE); \
+ check##TYPE (rslt, 9); \
+ rslt = testva##TYPE (16, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE, g10##TYPE, \
+ g11##TYPE, g12##TYPE, \
+ g13##TYPE, g14##TYPE, \
+ g15##TYPE, g16##TYPE); \
+ check##TYPE (rslt, 16); \
+ } \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
+
+#undef T
+
+void
+struct_return_20_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_y.c
new file mode 100644
index 000000000..2c1c33426
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-20_y.c
@@ -0,0 +1,64 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE (g01##TYPE, 1); \
+ check##TYPE (g02##TYPE, 2); \
+ check##TYPE (g03##TYPE, 3); \
+ check##TYPE (g04##TYPE, 4); \
+ check##TYPE (g05##TYPE, 5); \
+ check##TYPE (g06##TYPE, 6); \
+ check##TYPE (g07##TYPE, 7); \
+ check##TYPE (g08##TYPE, 8); \
+ check##TYPE (g09##TYPE, 9); \
+ check##TYPE (g10##TYPE, 10); \
+ check##TYPE (g11##TYPE, 11); \
+ check##TYPE (g12##TYPE, 12); \
+ check##TYPE (g13##TYPE, 13); \
+ check##TYPE (g14##TYPE, 14); \
+ check##TYPE (g15##TYPE, 15); \
+ check##TYPE (g16##TYPE, 16); \
+} \
+ \
+TYPE \
+test0##TYPE (void) \
+{ \
+ return g01##TYPE; \
+} \
+ \
+TYPE \
+test1##TYPE (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(Scd)
+T(Scsds)
+T(Scssdss)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_main.c
new file mode 100644
index 000000000..34e0ab429
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_main.c
@@ -0,0 +1,13 @@
+/* Test function return values. This was written when correcting
+ a deviation from the ABI on SPARC64 between 3.3 and 3.4. */
+
+extern void struct_return_21_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_return_21_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_x.c
new file mode 100644
index 000000000..721deff03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_x.c
@@ -0,0 +1,112 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(TYPE) \
+TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern TYPE test0##TYPE (void); \
+extern TYPE test1##TYPE (TYPE); \
+extern TYPE testva##TYPE (int n, ...); \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE (&g01##TYPE, 1); \
+ init##TYPE (&g02##TYPE, 2); \
+ init##TYPE (&g03##TYPE, 3); \
+ init##TYPE (&g04##TYPE, 4); \
+ init##TYPE (&g05##TYPE, 5); \
+ init##TYPE (&g06##TYPE, 6); \
+ init##TYPE (&g07##TYPE, 7); \
+ init##TYPE (&g08##TYPE, 8); \
+ init##TYPE (&g09##TYPE, 9); \
+ init##TYPE (&g10##TYPE, 10); \
+ init##TYPE (&g11##TYPE, 11); \
+ init##TYPE (&g12##TYPE, 12); \
+ init##TYPE (&g13##TYPE, 13); \
+ init##TYPE (&g14##TYPE, 14); \
+ init##TYPE (&g15##TYPE, 15); \
+ init##TYPE (&g16##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##TYPE (); \
+ check##TYPE (rslt, 1); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##TYPE (g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##TYPE (1, g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ rslt = testva##TYPE (5, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE); \
+ check##TYPE (rslt, 5); \
+ rslt = testva##TYPE (9, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE); \
+ check##TYPE (rslt, 9); \
+ rslt = testva##TYPE (16, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE, g10##TYPE, \
+ g11##TYPE, g12##TYPE, \
+ g13##TYPE, g14##TYPE, \
+ g15##TYPE, g16##TYPE); \
+ check##TYPE (rslt, 16); \
+ } \
+ DEBUG_NL; \
+}
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-check.h"
+
+T(Sfi)
+T(Sfii)
+T(Sfifi)
+T(Sfiifii)
+
+#undef T
+
+void
+struct_return_21_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Sfi)
+T(Sfii)
+T(Sfifi)
+T(Sfiifii)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c
new file mode 100644
index 000000000..b44d7f58e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-21_y.c
@@ -0,0 +1,65 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#include "mixed-struct-defs.h"
+#include "mixed-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE (g01##TYPE, 1); \
+ check##TYPE (g02##TYPE, 2); \
+ check##TYPE (g03##TYPE, 3); \
+ check##TYPE (g04##TYPE, 4); \
+ check##TYPE (g05##TYPE, 5); \
+ check##TYPE (g06##TYPE, 6); \
+ check##TYPE (g07##TYPE, 7); \
+ check##TYPE (g08##TYPE, 8); \
+ check##TYPE (g09##TYPE, 9); \
+ check##TYPE (g10##TYPE, 10); \
+ check##TYPE (g11##TYPE, 11); \
+ check##TYPE (g12##TYPE, 12); \
+ check##TYPE (g13##TYPE, 13); \
+ check##TYPE (g14##TYPE, 14); \
+ check##TYPE (g15##TYPE, 15); \
+ check##TYPE (g16##TYPE, 16); \
+} \
+ \
+TYPE \
+test0##TYPE (void) \
+{ \
+ return g01##TYPE; \
+} \
+ \
+TYPE \
+test1##TYPE (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(Sfi)
+T(Sfii)
+T(Sfifi)
+T(Sfiifii)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_main.c
new file mode 100644
index 000000000..22a1f6ef7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_main.c
@@ -0,0 +1,13 @@
+/* Test function return values. This test includes structs that are
+ arrays of unsigned integral scalars. */
+
+extern void struct_return_2_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_return_2_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_x.c
new file mode 100644
index 000000000..590c30aa9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_x.c
@@ -0,0 +1,229 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(N, NAME, TYPE) \
+struct S##NAME##N { TYPE i[N]; }; \
+struct S##NAME##N g1s##NAME##N, g2s##NAME##N; \
+struct S##NAME##N g3s##NAME##N, g4s##NAME##N; \
+struct S##NAME##N g5s##NAME##N, g6s##NAME##N; \
+struct S##NAME##N g7s##NAME##N, g8s##NAME##N; \
+struct S##NAME##N g9s##NAME##N, g10s##NAME##N; \
+struct S##NAME##N g11s##NAME##N, g12s##NAME##N; \
+struct S##NAME##N g13s##NAME##N, g14s##NAME##N; \
+struct S##NAME##N g15s##NAME##N, g16s##NAME##N; \
+ \
+extern void init##NAME##N (struct S##NAME##N *p, int i); \
+extern void checkg##NAME##N (void); \
+extern struct S##NAME##N test0##NAME##N (void); \
+extern struct S##NAME##N test1##NAME##N (struct S##NAME##N); \
+extern struct S##NAME##N testva##NAME##N (int n, ...); \
+ \
+void \
+check##NAME##N (struct S##NAME##N *p, int i) \
+{ \
+ int j; \
+ DEBUG_DOT; \
+ for (j = 0; j < N; j++) \
+ if (p->i[j] != (TYPE) (i + j)) \
+ { \
+ DEBUG_FAIL; \
+ } \
+} \
+ \
+void \
+testit##NAME##N (void) \
+{ \
+ struct S##NAME##N rslt; \
+ DEBUG_FPUTS (#NAME "[" #N "]"); \
+ DEBUG_FPUTS (" init: "); \
+ init##NAME##N ( &g1s##NAME##N, 1*16); \
+ init##NAME##N ( &g2s##NAME##N, 2*16); \
+ init##NAME##N ( &g3s##NAME##N, 3*16); \
+ init##NAME##N ( &g4s##NAME##N, 4*16); \
+ init##NAME##N ( &g5s##NAME##N, 5*16); \
+ init##NAME##N ( &g6s##NAME##N, 6*16); \
+ init##NAME##N ( &g7s##NAME##N, 7*16); \
+ init##NAME##N ( &g8s##NAME##N, 8*16); \
+ init##NAME##N ( &g9s##NAME##N, 9*16); \
+ init##NAME##N (&g10s##NAME##N, 10*16); \
+ init##NAME##N (&g11s##NAME##N, 11*16); \
+ init##NAME##N (&g12s##NAME##N, 12*16); \
+ init##NAME##N (&g13s##NAME##N, 13*16); \
+ init##NAME##N (&g14s##NAME##N, 14*16); \
+ init##NAME##N (&g15s##NAME##N, 15*16); \
+ init##NAME##N (&g16s##NAME##N, 16*16); \
+ checkg##NAME##N (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME "[" #N "]"); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##NAME##N (); \
+ check##NAME##N (&rslt, 1*16); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME "[" #N "]"); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##NAME##N (g1s##NAME##N); \
+ check##NAME##N (&rslt, 1*16); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#NAME "[" #N "]"); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##NAME##N (1, g1s##NAME##N); \
+ check##NAME##N (&rslt, 1*16); \
+ rslt = testva##NAME##N (5, \
+ g1s##NAME##N, g2s##NAME##N, \
+ g3s##NAME##N, g4s##NAME##N, \
+ g5s##NAME##N); \
+ check##NAME##N (&rslt, 5*16); \
+ rslt = testva##NAME##N (9, \
+ g1s##NAME##N, g2s##NAME##N, \
+ g3s##NAME##N, g4s##NAME##N, \
+ g5s##NAME##N, g6s##NAME##N, \
+ g7s##NAME##N, g8s##NAME##N, \
+ g9s##NAME##N); \
+ check##NAME##N (&rslt, 9*16); \
+ rslt = testva##NAME##N (16, \
+ g1s##NAME##N, g2s##NAME##N, \
+ g3s##NAME##N, g4s##NAME##N, \
+ g5s##NAME##N, g6s##NAME##N, \
+ g7s##NAME##N, g8s##NAME##N, \
+ g9s##NAME##N, g10s##NAME##N, \
+ g11s##NAME##N, g12s##NAME##N, \
+ g13s##NAME##N, g14s##NAME##N, \
+ g15s##NAME##N, g16s##NAME##N); \
+ check##NAME##N (&rslt, 16*16); \
+ } \
+ DEBUG_NL; \
+}
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, uc, unsigned char)
+#endif
+T(1, uc, unsigned char)
+T(2, uc, unsigned char)
+T(3, uc, unsigned char)
+T(4, uc, unsigned char)
+T(5, uc, unsigned char)
+T(6, uc, unsigned char)
+T(7, uc, unsigned char)
+T(8, uc, unsigned char)
+T(9, uc, unsigned char)
+T(10, uc, unsigned char)
+T(11, uc, unsigned char)
+T(12, uc, unsigned char)
+T(13, uc, unsigned char)
+T(14, uc, unsigned char)
+T(15, uc, unsigned char)
+#ifndef SKIP_ZERO_ARRAY
+T(0, us, unsigned short)
+#endif
+T(1, us, unsigned short)
+T(2, us, unsigned short)
+T(3, us, unsigned short)
+T(4, us, unsigned short)
+T(5, us, unsigned short)
+T(6, us, unsigned short)
+T(7, us, unsigned short)
+T(8, us, unsigned short)
+T(9, us, unsigned short)
+T(10, us, unsigned short)
+T(11, us, unsigned short)
+T(12, us, unsigned short)
+T(13, us, unsigned short)
+T(14, us, unsigned short)
+T(15, us, unsigned short)
+#ifndef SKIP_ZERO_ARRAY
+T(0, ui, unsigned int)
+#endif
+T(1, ui, unsigned int)
+T(2, ui, unsigned int)
+T(3, ui, unsigned int)
+T(4, ui, unsigned int)
+T(5, ui, unsigned int)
+T(6, ui, unsigned int)
+T(7, ui, unsigned int)
+T(8, ui, unsigned int)
+T(9, ui, unsigned int)
+T(10, ui, unsigned int)
+T(11, ui, unsigned int)
+T(12, ui, unsigned int)
+T(13, ui, unsigned int)
+T(14, ui, unsigned int)
+T(15, ui, unsigned int)
+
+#undef T
+
+void
+struct_return_2_x ()
+{
+DEBUG_INIT
+
+#define T(N, NAME, TYPE) testit##NAME##N ();
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, uc, unsigned char)
+#endif
+T(1, uc, unsigned char)
+T(2, uc, unsigned char)
+T(3, uc, unsigned char)
+T(4, uc, unsigned char)
+T(5, uc, unsigned char)
+T(6, uc, unsigned char)
+T(7, uc, unsigned char)
+T(8, uc, unsigned char)
+T(9, uc, unsigned char)
+T(10, uc, unsigned char)
+T(11, uc, unsigned char)
+T(12, uc, unsigned char)
+T(13, uc, unsigned char)
+T(14, uc, unsigned char)
+T(15, uc, unsigned char)
+#ifndef SKIP_ZERO_ARRAY
+T(0, us, unsigned short)
+#endif
+T(1, us, unsigned short)
+T(2, us, unsigned short)
+T(3, us, unsigned short)
+T(4, us, unsigned short)
+T(5, us, unsigned short)
+T(6, us, unsigned short)
+T(7, us, unsigned short)
+T(8, us, unsigned short)
+T(9, us, unsigned short)
+T(10, us, unsigned short)
+T(11, us, unsigned short)
+T(12, us, unsigned short)
+T(13, us, unsigned short)
+T(14, us, unsigned short)
+T(15, us, unsigned short)
+#ifndef SKIP_ZERO_ARRAY
+T(0, ui, unsigned int)
+#endif
+T(1, ui, unsigned int)
+T(2, ui, unsigned int)
+T(3, ui, unsigned int)
+T(4, ui, unsigned int)
+T(5, ui, unsigned int)
+T(6, ui, unsigned int)
+T(7, ui, unsigned int)
+T(8, ui, unsigned int)
+T(9, ui, unsigned int)
+T(10, ui, unsigned int)
+T(11, ui, unsigned int)
+T(12, ui, unsigned int)
+T(13, ui, unsigned int)
+T(14, ui, unsigned int)
+T(15, ui, unsigned int)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_y.c
new file mode 100644
index 000000000..7d7df8ef6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-2_y.c
@@ -0,0 +1,126 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#define T(N, NAME, TYPE) \
+struct S##NAME##N { TYPE i[N]; }; \
+ \
+extern struct S##NAME##N g1s##NAME##N, g2s##NAME##N; \
+extern struct S##NAME##N g3s##NAME##N, g4s##NAME##N; \
+extern struct S##NAME##N g5s##NAME##N, g6s##NAME##N; \
+extern struct S##NAME##N g7s##NAME##N, g8s##NAME##N; \
+extern struct S##NAME##N g9s##NAME##N, g10s##NAME##N; \
+extern struct S##NAME##N g11s##NAME##N, g12s##NAME##N; \
+extern struct S##NAME##N g13s##NAME##N, g14s##NAME##N; \
+extern struct S##NAME##N g15s##NAME##N, g16s##NAME##N; \
+ \
+extern void check##NAME##N (struct S##NAME##N *p, int i); \
+ \
+void \
+init##NAME##N (struct S##NAME##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ p->i[j] = i + j; \
+} \
+ \
+void \
+checkg##NAME##N (void) \
+{ \
+ check##NAME##N ( &g1s##NAME##N, 1*16); \
+ check##NAME##N ( &g2s##NAME##N, 2*16); \
+ check##NAME##N ( &g3s##NAME##N, 3*16); \
+ check##NAME##N ( &g4s##NAME##N, 4*16); \
+ check##NAME##N ( &g5s##NAME##N, 5*16); \
+ check##NAME##N ( &g6s##NAME##N, 6*16); \
+ check##NAME##N ( &g7s##NAME##N, 7*16); \
+ check##NAME##N ( &g8s##NAME##N, 8*16); \
+ check##NAME##N ( &g9s##NAME##N, 9*16); \
+ check##NAME##N (&g10s##NAME##N, 10*16); \
+ check##NAME##N (&g11s##NAME##N, 11*16); \
+ check##NAME##N (&g12s##NAME##N, 12*16); \
+ check##NAME##N (&g13s##NAME##N, 13*16); \
+ check##NAME##N (&g14s##NAME##N, 14*16); \
+ check##NAME##N (&g15s##NAME##N, 15*16); \
+ check##NAME##N (&g16s##NAME##N, 16*16); \
+} \
+ \
+struct S##NAME##N \
+test0##NAME##N (void) \
+{ \
+ return g1s##NAME##N; \
+} \
+ \
+struct S##NAME##N \
+test1##NAME##N (struct S##NAME##N x01) \
+{ \
+ return x01; \
+} \
+ \
+struct S##NAME##N \
+testva##NAME##N (int n, ...) \
+{ \
+ int i; \
+ struct S##NAME##N rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, struct S##NAME##N); \
+ va_end (ap); \
+ return rslt; \
+}
+
+#ifndef SKIP_ZERO_ARRAY
+T(0, uc, unsigned char)
+#endif
+T(1, uc, unsigned char)
+T(2, uc, unsigned char)
+T(3, uc, unsigned char)
+T(4, uc, unsigned char)
+T(5, uc, unsigned char)
+T(6, uc, unsigned char)
+T(7, uc, unsigned char)
+T(8, uc, unsigned char)
+T(9, uc, unsigned char)
+T(10, uc, unsigned char)
+T(11, uc, unsigned char)
+T(12, uc, unsigned char)
+T(13, uc, unsigned char)
+T(14, uc, unsigned char)
+T(15, uc, unsigned char)
+#ifndef SKIP_ZERO_ARRAY
+T(0, us, unsigned short)
+#endif
+T(1, us, unsigned short)
+T(2, us, unsigned short)
+T(3, us, unsigned short)
+T(4, us, unsigned short)
+T(5, us, unsigned short)
+T(6, us, unsigned short)
+T(7, us, unsigned short)
+T(8, us, unsigned short)
+T(9, us, unsigned short)
+T(10, us, unsigned short)
+T(11, us, unsigned short)
+T(12, us, unsigned short)
+T(13, us, unsigned short)
+T(14, us, unsigned short)
+T(15, us, unsigned short)
+#ifndef SKIP_ZERO_ARRAY
+T(0, ui, unsigned int)
+#endif
+T(1, ui, unsigned int)
+T(2, ui, unsigned int)
+T(3, ui, unsigned int)
+T(4, ui, unsigned int)
+T(5, ui, unsigned int)
+T(6, ui, unsigned int)
+T(7, ui, unsigned int)
+T(8, ui, unsigned int)
+T(9, ui, unsigned int)
+T(10, ui, unsigned int)
+T(11, ui, unsigned int)
+T(12, ui, unsigned int)
+T(13, ui, unsigned int)
+T(14, ui, unsigned int)
+T(15, ui, unsigned int)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_main.c
new file mode 100644
index 000000000..83f0d119a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_main.c
@@ -0,0 +1,14 @@
+/* Test function return values. For this test, all struct members are
+ scalar integral types and the structs are "small": 1, 2, 4, 8, and 12
+ bytes for LP64. */
+
+extern void struct_return_3_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ struct_return_3_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_x.c
new file mode 100644
index 000000000..e985f91e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_x.c
@@ -0,0 +1,134 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(TYPE) \
+TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern TYPE test0##TYPE (void); \
+extern TYPE test1##TYPE (TYPE); \
+extern TYPE testva##TYPE (int n, ...); \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE (&g01##TYPE, 1); \
+ init##TYPE (&g02##TYPE, 2); \
+ init##TYPE (&g03##TYPE, 3); \
+ init##TYPE (&g04##TYPE, 4); \
+ init##TYPE (&g05##TYPE, 5); \
+ init##TYPE (&g06##TYPE, 6); \
+ init##TYPE (&g07##TYPE, 7); \
+ init##TYPE (&g08##TYPE, 8); \
+ init##TYPE (&g09##TYPE, 9); \
+ init##TYPE (&g10##TYPE, 10); \
+ init##TYPE (&g11##TYPE, 11); \
+ init##TYPE (&g12##TYPE, 12); \
+ init##TYPE (&g13##TYPE, 13); \
+ init##TYPE (&g14##TYPE, 14); \
+ init##TYPE (&g15##TYPE, 15); \
+ init##TYPE (&g16##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##TYPE (); \
+ check##TYPE (rslt, 1); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##TYPE (g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##TYPE (1, g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ rslt = testva##TYPE (5, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE); \
+ check##TYPE (rslt, 5); \
+ rslt = testva##TYPE (9, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE); \
+ check##TYPE (rslt, 9); \
+ rslt = testva##TYPE (16, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE, g10##TYPE, \
+ g11##TYPE, g12##TYPE, \
+ g13##TYPE, g14##TYPE, \
+ g15##TYPE, g16##TYPE); \
+ check##TYPE (rslt, 16); \
+ } \
+ DEBUG_NL; \
+}
+
+#include "small-struct-defs.h"
+#include "small-struct-check.h"
+
+T(Sc)
+T(Ss)
+T(Si)
+T(Scs)
+T(Ssc)
+T(Sic)
+T(Sci)
+T(Ssi)
+T(Sis)
+T(Scsi)
+T(Scis)
+T(Ssci)
+T(Ssic)
+T(Sisc)
+T(Sics)
+
+#undef T
+
+void
+struct_return_3_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Sc)
+T(Ss)
+T(Si)
+T(Scs)
+T(Ssc)
+T(Sic)
+T(Sci)
+T(Ssi)
+T(Sis)
+T(Scsi)
+T(Scis)
+T(Ssci)
+T(Ssic)
+T(Sisc)
+T(Sics)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_y.c
new file mode 100644
index 000000000..dbd471351
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/struct-return-3_y.c
@@ -0,0 +1,76 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#include "small-struct-defs.h"
+#include "small-struct-init.h"
+
+#define T(TYPE) \
+extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE (g01##TYPE, 1); \
+ check##TYPE (g02##TYPE, 2); \
+ check##TYPE (g03##TYPE, 3); \
+ check##TYPE (g04##TYPE, 4); \
+ check##TYPE (g05##TYPE, 5); \
+ check##TYPE (g06##TYPE, 6); \
+ check##TYPE (g07##TYPE, 7); \
+ check##TYPE (g08##TYPE, 8); \
+ check##TYPE (g09##TYPE, 9); \
+ check##TYPE (g10##TYPE, 10); \
+ check##TYPE (g11##TYPE, 11); \
+ check##TYPE (g12##TYPE, 12); \
+ check##TYPE (g13##TYPE, 13); \
+ check##TYPE (g14##TYPE, 14); \
+ check##TYPE (g15##TYPE, 15); \
+ check##TYPE (g16##TYPE, 16); \
+} \
+ \
+TYPE \
+test0##TYPE (void) \
+{ \
+ return g01##TYPE; \
+} \
+ \
+TYPE \
+test1##TYPE (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(Sc)
+T(Ss)
+T(Si)
+T(Scs)
+T(Ssc)
+T(Sic)
+T(Sci)
+T(Ssi)
+T(Sis)
+T(Scsi)
+T(Scis)
+T(Ssci)
+T(Ssic)
+T(Sisc)
+T(Sics)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_main.c
new file mode 100644
index 000000000..cd9065920
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_main.c
@@ -0,0 +1,13 @@
+/* Test function argument passing. This was written when correcting
+ a deviation from the ABI on SPARC64 between 3.3 and 3.4. */
+
+extern void union_by_value_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ union_by_value_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c
new file mode 100644
index 000000000..a3efd4ed7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c
@@ -0,0 +1,180 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, 1); \
+ init##TYPE ( &g2s##TYPE, 2); \
+ init##TYPE ( &g3s##TYPE, 3); \
+ init##TYPE ( &g4s##TYPE, 4); \
+ init##TYPE ( &g5s##TYPE, 5); \
+ init##TYPE ( &g6s##TYPE, 6); \
+ init##TYPE ( &g7s##TYPE, 7); \
+ init##TYPE ( &g8s##TYPE, 8); \
+ init##TYPE ( &g9s##TYPE, 9); \
+ init##TYPE (&g10s##TYPE, 10); \
+ init##TYPE (&g11s##TYPE, 11); \
+ init##TYPE (&g12s##TYPE, 12); \
+ init##TYPE (&g13s##TYPE, 13); \
+ init##TYPE (&g14s##TYPE, 14); \
+ init##TYPE (&g15s##TYPE, 15); \
+ init##TYPE (&g16s##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2:"); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+#include "union-defs.h"
+#include "union-check.h"
+
+T(Ucs)
+T(Uci)
+T(Ucl)
+T(Ucll)
+T(Usi)
+T(Usl)
+T(Usll)
+T(Uil)
+T(Uill)
+T(Ulll)
+
+#undef T
+
+void
+union_by_value_1_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Ucs)
+T(Uci)
+T(Ucl)
+T(Ucll)
+T(Usi)
+T(Usl)
+T(Usll)
+T(Uil)
+T(Uill)
+T(Ulll)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_y.c
new file mode 100644
index 000000000..b17613e99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-by-value-1_y.c
@@ -0,0 +1,92 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#include "union-defs.h"
+#include "union-init.h"
+
+#define T(TYPE) \
+extern void check##TYPE (TYPE x, int i); \
+extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE ( g1s##TYPE, 1); \
+ check##TYPE ( g2s##TYPE, 2); \
+ check##TYPE ( g3s##TYPE, 3); \
+ check##TYPE ( g4s##TYPE, 4); \
+ check##TYPE ( g5s##TYPE, 5); \
+ check##TYPE ( g6s##TYPE, 6); \
+ check##TYPE ( g7s##TYPE, 7); \
+ check##TYPE ( g8s##TYPE, 8); \
+ check##TYPE ( g9s##TYPE, 9); \
+ check##TYPE ( g10s##TYPE, 10); \
+ check##TYPE ( g11s##TYPE, 11); \
+ check##TYPE ( g12s##TYPE, 12); \
+ check##TYPE ( g13s##TYPE, 13); \
+ check##TYPE ( g14s##TYPE, 14); \
+ check##TYPE ( g15s##TYPE, 15); \
+ check##TYPE ( g16s##TYPE, 16); \
+} \
+ \
+void \
+test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8, \
+ TYPE s9, TYPE s10, TYPE s11, TYPE s12, \
+ TYPE s13, TYPE s14, TYPE s15, TYPE s16) \
+{ \
+ check##TYPE (s1, 1); \
+ check##TYPE (s2, 2); \
+ check##TYPE (s3, 3); \
+ check##TYPE (s4, 4); \
+ check##TYPE (s5, 5); \
+ check##TYPE (s6, 6); \
+ check##TYPE (s7, 7); \
+ check##TYPE (s8, 8); \
+ check##TYPE (s9, 9); \
+ check##TYPE (s10, 10); \
+ check##TYPE (s11, 11); \
+ check##TYPE (s12, 12); \
+ check##TYPE (s13, 13); \
+ check##TYPE (s14, 14); \
+ check##TYPE (s15, 15); \
+ check##TYPE (s16, 16); \
+} \
+ \
+void \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ if (test_va) \
+ { \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ { \
+ TYPE t = va_arg (ap, TYPE); \
+ check##TYPE (t, i+1); \
+ } \
+ va_end (ap); \
+ } \
+}
+
+T(Ucs)
+T(Uci)
+T(Ucl)
+T(Ucll)
+T(Usi)
+T(Usl)
+T(Usll)
+T(Uil)
+T(Uill)
+T(Ulll)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-check.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-check.h
new file mode 100644
index 000000000..b5157814d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-check.h
@@ -0,0 +1,34 @@
+/* Function definitions that are used by multiple tests. */
+
+#define CHECK_CHAR(TYPE) \
+ void check##TYPE (TYPE p, int i) \
+ { if (p.c != (char)i) DEBUG_CHECK }
+
+CHECK_CHAR(Ucs)
+CHECK_CHAR(Uci)
+CHECK_CHAR(Ucl)
+CHECK_CHAR(Ucll)
+
+
+#define CHECK_SHORT(TYPE) \
+ void check##TYPE (TYPE p, int i) \
+ { if (p.s != (short)i) DEBUG_CHECK }
+
+CHECK_SHORT(Usi)
+CHECK_SHORT(Usl)
+CHECK_SHORT(Usll)
+
+
+#define CHECK_INT(TYPE) \
+ void check##TYPE (TYPE p, int i) \
+ { if (p.i != i) DEBUG_CHECK }
+
+CHECK_INT(Uil)
+CHECK_INT(Uill)
+
+
+#define CHECK_LONG(TYPE) \
+ void check##TYPE (TYPE p, int i) \
+ { if (p.l != (long)i) DEBUG_CHECK }
+
+CHECK_LONG(Ulll)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-defs.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-defs.h
new file mode 100644
index 000000000..887cd6da8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-defs.h
@@ -0,0 +1,15 @@
+/* Type definitions that are used by multiple tests. */
+
+typedef union { char c; short s; } Ucs;
+typedef union { char c; int i; } Uci;
+typedef union { char c; long l; } Ucl;
+typedef union { char c; long long ll; } Ucll;
+
+typedef union { short s; int i; } Usi;
+typedef union { short s; long l; } Usl;
+typedef union { short s; long long ll; } Usll;
+
+typedef union { int i; long l; } Uil;
+typedef union { int i; long long ll; } Uill;
+
+typedef union { long l; long long ll; } Ulll;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-init.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-init.h
new file mode 100644
index 000000000..5add7b4a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-init.h
@@ -0,0 +1,34 @@
+/* Function definitions that are used by multiple tests. */
+
+#define INIT_CHAR(TYPE) \
+ void init##TYPE (TYPE *p, int i) \
+ { p->c = (char)i; }
+
+INIT_CHAR(Ucs)
+INIT_CHAR(Uci)
+INIT_CHAR(Ucl)
+INIT_CHAR(Ucll)
+
+
+#define INIT_SHORT(TYPE) \
+ void init##TYPE (TYPE *p, int i) \
+ { p->s = (short)i; }
+
+INIT_SHORT(Usi)
+INIT_SHORT(Usl)
+INIT_SHORT(Usll)
+
+
+#define INIT_INT(TYPE) \
+ void init##TYPE (TYPE *p, int i) \
+ { p->i = i; }
+
+INIT_INT(Uil)
+INIT_INT(Uill)
+
+
+#define INIT_LONG(TYPE) \
+ void init##TYPE (TYPE *p, int i) \
+ { p->l = (long)i; }
+
+INIT_LONG(Ulll)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1.h
new file mode 100644
index 000000000..56d80cbfb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1.h
@@ -0,0 +1,17 @@
+#include <xmmintrin.h>
+
+typedef struct
+{
+ __m128 x;
+} SS_struct_mi128;
+
+typedef union
+{
+ __m128 x;
+} SS_union_mi128;
+
+typedef union
+{
+ __m128 x;
+ unsigned long long u[2];
+} union_mi128;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c
new file mode 100644
index 000000000..59e68d96c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c
@@ -0,0 +1,15 @@
+/* { dg-skip-if "test SSE2 support" { ! { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-O" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+/* Test function argument passing. PR target/15301. */
+
+extern void union_m128_1_x (void);
+extern void exit (int);
+
+int
+main ()
+{
+ union_m128_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
new file mode 100644
index 000000000..1f92303d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
@@ -0,0 +1,24 @@
+/* { dg-options "-O -msse2" } */
+
+#include "union-m128-1.h"
+
+SS_union_mi128 un;
+SS_struct_mi128 st;
+
+extern void bar ();
+extern void foo ();
+
+void
+union_m128_1_x ()
+{
+ union_mi128 x;
+
+ x.u [0] = 0x123456789abcedf0LL;
+ x.u [1] = 0xfedcba9876543210LL;
+ un.x = x.x;
+ st.x = x.x;
+ bar(un);
+ bar(st);
+ foo(un);
+ foo(st);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c
new file mode 100644
index 000000000..be9d6e8f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c
@@ -0,0 +1,27 @@
+/* { dg-options "-O -msse2" } */
+
+#include <stdlib.h>
+
+#include "union-m128-1.h"
+
+void
+bar (SS_union_mi128 un)
+{
+ union_mi128 x;
+
+ x.x = un.x;
+ if (x.u [0] != 0x123456789abcedf0LL
+ || x.u [1] != 0xfedcba9876543210LL)
+ abort ();
+}
+
+void
+foo (SS_struct_mi128 st)
+{
+ union_mi128 x;
+
+ x.x = st.x;
+ if (x.u [0] != 0x123456789abcedf0LL
+ || x.u [1] != 0xfedcba9876543210LL)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_main.c
new file mode 100644
index 000000000..edf15166b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_main.c
@@ -0,0 +1,13 @@
+/* Test function return values. This was written when correcting
+ a deviation from the ABI on SPARC64 between 3.3 and 3.4. */
+
+extern void union_return_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ union_return_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_x.c
new file mode 100644
index 000000000..761f000aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_x.c
@@ -0,0 +1,124 @@
+#include "compat-common.h"
+
+#ifdef SKIP_VA
+const int test_va = 0;
+#else
+const int test_va = 1;
+#endif
+
+#define T(TYPE) \
+TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern TYPE test0##TYPE (void); \
+extern TYPE test1##TYPE (TYPE); \
+extern TYPE testva##TYPE (int n, ...); \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ TYPE rslt; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE (&g01##TYPE, 1); \
+ init##TYPE (&g02##TYPE, 2); \
+ init##TYPE (&g03##TYPE, 3); \
+ init##TYPE (&g04##TYPE, 4); \
+ init##TYPE (&g05##TYPE, 5); \
+ init##TYPE (&g06##TYPE, 6); \
+ init##TYPE (&g07##TYPE, 7); \
+ init##TYPE (&g08##TYPE, 8); \
+ init##TYPE (&g09##TYPE, 9); \
+ init##TYPE (&g10##TYPE, 10); \
+ init##TYPE (&g11##TYPE, 11); \
+ init##TYPE (&g12##TYPE, 12); \
+ init##TYPE (&g13##TYPE, 13); \
+ init##TYPE (&g14##TYPE, 14); \
+ init##TYPE (&g15##TYPE, 15); \
+ init##TYPE (&g16##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test0: "); \
+ rslt = test0##TYPE (); \
+ check##TYPE (rslt, 1); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test1: "); \
+ rslt = test1##TYPE (g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ if (test_va) \
+ { \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva: "); \
+ rslt = testva##TYPE (1, g01##TYPE); \
+ check##TYPE (rslt, 1); \
+ rslt = testva##TYPE (5, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE); \
+ check##TYPE (rslt, 5); \
+ rslt = testva##TYPE (9, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE); \
+ check##TYPE (rslt, 9); \
+ rslt = testva##TYPE (16, g01##TYPE, g02##TYPE, \
+ g03##TYPE, g04##TYPE, \
+ g05##TYPE, g06##TYPE, \
+ g07##TYPE, g08##TYPE, \
+ g09##TYPE, g10##TYPE, \
+ g11##TYPE, g12##TYPE, \
+ g13##TYPE, g14##TYPE, \
+ g15##TYPE, g16##TYPE); \
+ check##TYPE (rslt, 16); \
+ } \
+ DEBUG_NL; \
+}
+
+#include "union-defs.h"
+#include "union-check.h"
+
+T(Ucs)
+T(Uci)
+T(Ucl)
+T(Ucll)
+T(Usi)
+T(Usl)
+T(Usll)
+T(Uil)
+T(Uill)
+T(Ulll)
+
+#undef T
+
+void
+union_return_1_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Ucs)
+T(Uci)
+T(Ucl)
+T(Ucll)
+T(Usi)
+T(Usl)
+T(Usll)
+T(Uil)
+T(Uill)
+T(Ulll)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_y.c
new file mode 100644
index 000000000..9eaa9777e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/union-return-1_y.c
@@ -0,0 +1,71 @@
+#include <stdarg.h>
+
+#include "compat-common.h"
+
+#include "union-defs.h"
+#include "union-init.h"
+
+#define T(TYPE) \
+extern TYPE g01##TYPE, g02##TYPE, g03##TYPE, g04##TYPE; \
+extern TYPE g05##TYPE, g06##TYPE, g07##TYPE, g08##TYPE; \
+extern TYPE g09##TYPE, g10##TYPE, g11##TYPE, g12##TYPE; \
+extern TYPE g13##TYPE, g14##TYPE, g15##TYPE, g16##TYPE; \
+ \
+extern void check##TYPE (TYPE x, int i); \
+ \
+void \
+checkg##TYPE (void) \
+{ \
+ check##TYPE (g01##TYPE, 1); \
+ check##TYPE (g02##TYPE, 2); \
+ check##TYPE (g03##TYPE, 3); \
+ check##TYPE (g04##TYPE, 4); \
+ check##TYPE (g05##TYPE, 5); \
+ check##TYPE (g06##TYPE, 6); \
+ check##TYPE (g07##TYPE, 7); \
+ check##TYPE (g08##TYPE, 8); \
+ check##TYPE (g09##TYPE, 9); \
+ check##TYPE (g10##TYPE, 10); \
+ check##TYPE (g11##TYPE, 11); \
+ check##TYPE (g12##TYPE, 12); \
+ check##TYPE (g13##TYPE, 13); \
+ check##TYPE (g14##TYPE, 14); \
+ check##TYPE (g15##TYPE, 15); \
+ check##TYPE (g16##TYPE, 16); \
+} \
+ \
+TYPE \
+test0##TYPE (void) \
+{ \
+ return g01##TYPE; \
+} \
+ \
+TYPE \
+test1##TYPE (TYPE x01) \
+{ \
+ return x01; \
+} \
+ \
+TYPE \
+testva##TYPE (int n, ...) \
+{ \
+ int i; \
+ TYPE rslt; \
+ va_list ap; \
+ va_start (ap, n); \
+ for (i = 0; i < n; i++) \
+ rslt = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return rslt; \
+}
+
+T(Ucs)
+T(Uci)
+T(Ucl)
+T(Ucll)
+T(Usi)
+T(Usl)
+T(Usll)
+T(Uil)
+T(Uill)
+T(Ulll)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_main.c
new file mode 100644
index 000000000..6c995e7c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_main.c
@@ -0,0 +1,14 @@
+/* Test compatibility of vector types: layout between separately-compiled
+ modules, parameter passing, and function return. This test uses
+ vectors of integer values. */
+
+extern void vector_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ vector_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_x.c
new file mode 100644
index 000000000..29a8170d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_x.c
@@ -0,0 +1,51 @@
+/* { dg-options "-w" } */
+/* { dg-options "-w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
+
+#ifndef SKIP_ATTRIBUTE
+
+#include "compat-common.h"
+#include "vector-defs.h"
+#include "vector-setup.h"
+
+SETUP (8, qi);
+SETUP (16, qi);
+SETUP (32, qi);
+SETUP (2, hi);
+SETUP (4, hi);
+SETUP (8, hi);
+SETUP (16, hi);
+SETUP (2, si);
+SETUP (4, si);
+SETUP (8, si);
+SETUP (1, di);
+SETUP (2, di);
+SETUP (4, di);
+
+#endif
+
+void
+vector_1_x (void)
+{
+#ifndef SKIP_ATTRIBUTE
+ DEBUG_INIT
+
+ CHECK (8, qi);
+ CHECK (16, qi);
+ CHECK (32, qi);
+ CHECK (2, hi);
+ CHECK (4, hi);
+ CHECK (8, hi);
+ CHECK (16, hi);
+ CHECK (2, si);
+ CHECK (4, si);
+ CHECK (8, si);
+ CHECK (1, di);
+ CHECK (2, di);
+ CHECK (4, di);
+
+ DEBUG_FINI
+
+ if (fails != 0)
+ abort ();
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_y.c
new file mode 100644
index 000000000..284b98c71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1_y.c
@@ -0,0 +1,24 @@
+/* { dg-options "-w" } */
+/* { dg-options "-w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
+
+#ifndef SKIP_ATTRIBUTE
+
+#include "compat-common.h"
+#include "vector-defs.h"
+#include "vector-check.h"
+
+TEST (8, qi, 101)
+TEST (16, qi, 101)
+TEST (32, qi, 90)
+TEST (2, hi, 201)
+TEST (4, hi, 202)
+TEST (8, hi, 203)
+TEST (16, hi, 203)
+TEST (2, si, 301)
+TEST (4, si, 302)
+TEST (8, si, 303)
+TEST (1, di, 401)
+TEST (2, di, 402)
+TEST (4, di, 403)
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_main.c
new file mode 100644
index 000000000..608f5dd9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_main.c
@@ -0,0 +1,17 @@
+/* { dg-skip-if "test SSE2 vector" { ! { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse2_runtime } */
+
+/* Test compatibility of vector types: layout between separately-compiled
+ modules, parameter passing, and function return. This test uses
+ vectors of integer values. */
+
+extern void vector_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ vector_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_x.c
new file mode 100644
index 000000000..1d39cec31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_x.c
@@ -0,0 +1,3 @@
+/* { dg-options "-w -Wno-psabi -mno-mmx -msse2" } */
+
+#include "vector-1_x.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_y.c
new file mode 100644
index 000000000..53b1a7ffe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1a_y.c
@@ -0,0 +1,3 @@
+/* { dg-options "-w -Wno-psabi -mno-mmx -msse2" } */
+
+#include "vector-1_y.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_main.c
new file mode 100644
index 000000000..427e8caf3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_main.c
@@ -0,0 +1,17 @@
+/* { dg-skip-if "test AVX vector" { ! { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target avx_runtime } */
+
+/* Test compatibility of vector types: layout between separately-compiled
+ modules, parameter passing, and function return. This test uses
+ vectors of integer values. */
+
+extern void vector_1_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ vector_1_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_x.c
new file mode 100644
index 000000000..f3f76ec39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_x.c
@@ -0,0 +1,3 @@
+/* { dg-options "-w -Wno-psabi -mno-mmx -mavx" } */
+
+#include "vector-1_x.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_y.c
new file mode 100644
index 000000000..105282cac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-1b_y.c
@@ -0,0 +1,3 @@
+/* { dg-options "-w -Wno-psabi -mno-mmx -mavx" } */
+
+#include "vector-1_y.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_main.c
new file mode 100644
index 000000000..37f36fe0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_main.c
@@ -0,0 +1,14 @@
+/* Test compatibility of vector types: layout between separately-compiled
+ modules, parameter passing, and function return. This test uses
+ vectors of floating points values. */
+
+extern void vector_2_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ vector_2_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_x.c
new file mode 100644
index 000000000..899a3ab11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_x.c
@@ -0,0 +1,38 @@
+/* { dg-options "-w" } */
+/* { dg-options "-w -mno-mmx -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
+
+
+#ifndef SKIP_ATTRIBUTE
+
+#include "compat-common.h"
+#include "vector-defs.h"
+#include "vector-setup.h"
+
+SETUP (2, sf);
+SETUP (4, sf);
+SETUP (16, sf);
+SETUP (8, sf);
+SETUP (2, df);
+SETUP (4, df);
+
+#endif
+
+void
+vector_2_x (void)
+{
+#ifndef SKIP_ATTRIBUTE
+ DEBUG_INIT
+
+ CHECK (2, sf);
+ CHECK (4, sf);
+ CHECK (8, sf);
+ CHECK (16, sf);
+ CHECK (4, df);
+ CHECK (2, df);
+
+ DEBUG_FINI
+
+ if (fails != 0)
+ abort ();
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_y.c
new file mode 100644
index 000000000..a5ab241af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2_y.c
@@ -0,0 +1,17 @@
+/* { dg-options "-w" } */
+/* { dg-options "-w -mno-mmx -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
+
+#ifndef SKIP_ATTRIBUTE
+
+#include "compat-common.h"
+#include "vector-defs.h"
+#include "vector-check.h"
+
+TEST (2, sf, 301.0)
+TEST (4, sf, 302.0)
+TEST (8, sf, 303.0)
+TEST (16, sf, 304.0)
+TEST (2, df, 402.0)
+TEST (4, df, 402.0)
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_main.c
new file mode 100644
index 000000000..e957faf90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_main.c
@@ -0,0 +1,17 @@
+/* { dg-skip-if "test SSE2 support" { ! { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse2_runtime } */
+
+/* Test compatibility of vector types: layout between separately-compiled
+ modules, parameter passing, and function return. This test uses
+ vectors of floating points values. */
+
+extern void vector_2_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ vector_2_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_x.c
new file mode 100644
index 000000000..fb62bb8c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_x.c
@@ -0,0 +1,3 @@
+/* { dg-options "-w -Wno-psabi -mno-mmx -msse2" } */
+
+#include "vector-2_x.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_y.c
new file mode 100644
index 000000000..7cdd195c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2a_y.c
@@ -0,0 +1,3 @@
+/* { dg-options "-w -Wno-psabi -mno-mmx -msse2" } */
+
+#include "vector-2_y.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_main.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_main.c
new file mode 100644
index 000000000..2c1957642
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_main.c
@@ -0,0 +1,17 @@
+/* { dg-skip-if "test AVX support" { ! { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target avx_runtime } */
+
+/* Test compatibility of vector types: layout between separately-compiled
+ modules, parameter passing, and function return. This test uses
+ vectors of floating points values. */
+
+extern void vector_2_x (void);
+extern void exit (int);
+int fails;
+
+int
+main ()
+{
+ vector_2_x ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_x.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_x.c
new file mode 100644
index 000000000..71b36bea7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_x.c
@@ -0,0 +1,3 @@
+/* { dg-options "-w -Wno-psabi -mno-mmx -mavx" } */
+
+#include "vector-2_x.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_y.c b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_y.c
new file mode 100644
index 000000000..9c114bb14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-2b_y.c
@@ -0,0 +1,3 @@
+/* { dg-options "-w -Wno-psabi -mno-mmx -mavx" } */
+
+#include "vector-2_y.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-check.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-check.h
new file mode 100644
index 000000000..2d586d287
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-check.h
@@ -0,0 +1,64 @@
+#define TEST(NUM,TMODE,VAL) \
+extern v##NUM##TMODE g_v##NUM##TMODE; \
+extern TMODE g_##TMODE; \
+ \
+extern void pass_v##NUM##TMODE (v##NUM##TMODE); \
+extern v##NUM##TMODE return_v##NUM##TMODE (void); \
+ \
+void \
+checkp_##NUM##TMODE (TMODE *p) \
+{ \
+ int i; \
+ for (i = 0; i < NUM; i++) \
+ { \
+ if (p[i] != g_##TMODE + i) \
+ DEBUG_CHECK; \
+ } \
+} \
+ \
+void \
+checkg_##NUM##TMODE (void) \
+{ \
+ u##NUM##TMODE u; \
+ TMODE *p = u.a; \
+ \
+ u.v = g_v##NUM##TMODE; \
+ checkp_##NUM##TMODE (p); \
+} \
+ \
+void \
+init_##NUM##TMODE (void) \
+{ \
+ int i; \
+ u##NUM##TMODE u; \
+ g_##TMODE = VAL; \
+ for (i = 0; i < NUM; i++) \
+ u.a[i] = VAL + i; \
+ g_v##NUM##TMODE = u.v; \
+} \
+ \
+void \
+test_v##NUM##TMODE (void) \
+{ \
+ v##NUM##TMODE v; \
+ u##NUM##TMODE u; \
+ TMODE *p = u.a; \
+ \
+ DEBUG_FPUTS ("v" #NUM #TMODE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" global variable:"); \
+ init_##NUM##TMODE (); \
+ checkg_##NUM##TMODE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" pass global variable:"); \
+ pass_v##NUM##TMODE (g_v##NUM##TMODE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" pass local variable:"); \
+ v = g_v##NUM##TMODE; \
+ pass_v##NUM##TMODE (v); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" function return:"); \
+ u.v = return_v##NUM##TMODE (); \
+ checkp_##NUM##TMODE (p); \
+ DEBUG_NL; \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-defs.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-defs.h
new file mode 100644
index 000000000..f2f050527
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-defs.h
@@ -0,0 +1,90 @@
+/* This includes all of the vector modes that are recognized by
+ c_common_type_for_mode. */
+
+typedef int __attribute__((mode(QI))) qi;
+typedef int __attribute__((mode(HI))) hi;
+typedef int __attribute__((mode(SI))) si;
+typedef int __attribute__((mode(DI))) di;
+typedef float __attribute__((mode(SF))) sf;
+#if ((__SIZEOF_DOUBLE__ >= 8) || (__SIZEOF_LONG_DOUBLE__ >= 8))
+typedef float __attribute__((mode(DF))) df;
+#else
+typedef float __attribute__((mode(SF))) df;
+#endif
+
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 5)
+
+typedef qi __attribute__((vector_size (8))) v8qi;
+typedef qi __attribute__((vector_size (16))) v16qi;
+
+typedef hi __attribute__((vector_size (4))) v2hi;
+typedef hi __attribute__((vector_size (8))) v4hi;
+typedef hi __attribute__((vector_size (16))) v8hi;
+
+typedef si __attribute__((vector_size (8))) v2si;
+typedef si __attribute__((vector_size (16))) v4si;
+
+typedef di __attribute__((vector_size (8))) v1di;
+typedef di __attribute__((vector_size (16))) v2di;
+
+typedef sf __attribute__((vector_size (8))) v2sf;
+typedef sf __attribute__((vector_size (16))) v4sf;
+typedef sf __attribute__((vector_size (64))) v16sf;
+
+typedef df __attribute__((vector_size (16))) v2df;
+
+#else
+
+typedef int __attribute__((mode(V8QI))) v8qi;
+typedef int __attribute__((mode(V16QI))) v16qi;
+
+typedef int __attribute__((mode(V2HI))) v2hi;
+typedef int __attribute__((mode(V4HI))) v4hi;
+typedef int __attribute__((mode(V8HI))) v8hi;
+
+typedef int __attribute__((mode(V2SI))) v2si;
+typedef int __attribute__((mode(V4SI))) v4si;
+
+typedef int __attribute__((mode(V1DI))) v1di;
+typedef int __attribute__((mode(V2DI))) v2di;
+
+typedef float __attribute__((mode(V2SF))) v2sf;
+typedef float __attribute__((mode(V4SF))) v4sf;
+typedef float __attribute__((mode(V16SF))) v16sf;
+
+typedef float __attribute__((mode(V2DF))) v2df;
+
+#endif
+
+typedef qi __attribute__((vector_size (32))) v32qi;
+typedef hi __attribute__((vector_size (32))) v16hi;
+typedef si __attribute__((vector_size (32))) v8si;
+typedef di __attribute__((vector_size (32))) v4di;
+typedef sf __attribute__((vector_size (32))) v8sf;
+typedef df __attribute__((vector_size (32))) v4df;
+
+typedef union U32QI { v32qi v; qi a[32]; } u32qi;
+typedef union U16HI { v16hi v; hi a[16]; } u16hi;
+typedef union U8SI { v8si v; si a[8]; } u8si;
+typedef union U4DI { v4di v; di a[4]; } u4di;
+typedef union U8SF { v8sf v; sf a[8]; } u8sf;
+typedef union U4DF { v4df v; df a[4]; } u4df;
+
+typedef union U8QI { v8qi v; qi a[8]; } u8qi;
+typedef union U16QI { v16qi v; qi a[16]; } u16qi;
+
+typedef union U2HI { v2hi v; hi a[2]; } u2hi;
+typedef union U4HI { v4hi v; hi a[4]; } u4hi;
+typedef union U8HI { v8hi v; hi a[8]; } u8hi;
+
+typedef union U2SI { v2si v; si a[2]; } u2si;
+typedef union U4SI { v4si v; si a[4]; } u4si;
+
+typedef union U1DI { v1di v; di a[1]; } u1di;
+typedef union U2DI { v2di v; di a[2]; } u2di;
+
+typedef union U2SF { v2sf v; sf a[2]; } u2sf;
+typedef union U4SF { v4sf v; sf a[4]; } u4sf;
+typedef union U16SF { v16sf v; sf a[16]; } u16sf;
+
+typedef union U2DF { v2df v; df a[2]; } u2df;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-setup.h b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-setup.h
new file mode 100644
index 000000000..60419f851
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compat/vector-setup.h
@@ -0,0 +1,28 @@
+#define SETUP(NUM,TMODE) \
+v##NUM##TMODE g_v##NUM##TMODE; \
+TMODE g_##TMODE; \
+ \
+extern void test_v##NUM##TMODE (void); \
+extern void checkp_##NUM##TMODE (TMODE *); \
+ \
+void \
+pass_v##NUM##TMODE (v##NUM##TMODE v) \
+{ \
+ u##NUM##TMODE u; \
+ int j; \
+ TMODE a[NUM]; \
+ \
+ u.v = v; \
+ for (j = 0; j < NUM; j++) \
+ a[j] = u.a[j]; \
+ checkp_##NUM##TMODE (a); \
+} \
+ \
+v##NUM##TMODE \
+return_v##NUM##TMODE (void) \
+{ \
+ return g_v##NUM##TMODE; \
+}
+
+#define CHECK(NUM,TMODE) \
+ test_v##NUM##TMODE()
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/complete-port.c b/gcc-4.9/gcc/testsuite/gcc.dg/complete-port.c
new file mode 100644
index 000000000..c8ebcc10e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/complete-port.c
@@ -0,0 +1,96 @@
+/* This small program uses all the arithmetic operators that may
+ generate calls to library routines which must be implemented in
+ port-specific assembly language. */
+/* { dg-do link } */
+
+#include <stddef.h>
+
+int foo ();
+double dfoo ();
+void discard (int);
+void ddiscard (double);
+
+int
+main (void)
+{
+ int a = foo (), b = foo ();
+ unsigned int au = foo (), bu = foo ();
+ float af = dfoo (), bf = dfoo ();
+ double ad = dfoo (), bd = dfoo ();
+
+ discard (a * b);
+ discard (a / b);
+ discard (a % b);
+
+ discard (au / bu);
+ discard (au % bu);
+
+ discard (a >> b);
+ discard (a << b);
+
+ discard (au >> bu);
+ discard (au << bu);
+
+ ddiscard (ad + bd);
+ ddiscard (ad - bd);
+ ddiscard (ad * bd);
+ ddiscard (ad / bd);
+ ddiscard (-ad);
+
+ ddiscard (af + bf);
+ ddiscard (af - bf);
+ ddiscard (af * bf);
+ ddiscard (af / bf);
+ ddiscard (-af);
+
+ discard ((int) ad);
+ discard ((int) af);
+
+ ddiscard ((double) a);
+ ddiscard ((float) a);
+ ddiscard ((float) ad);
+
+ discard (ad == bd);
+ discard (ad < bd);
+ discard (ad > bd);
+ discard (ad != bd);
+ discard (ad <= bd);
+ discard (ad >= bd);
+
+ discard (af == bf);
+ discard (af < bf);
+ discard (af > bf);
+ discard (af != bf);
+ discard (af <= bf);
+ discard (af >= bf);
+
+ return 0;
+}
+
+void
+discard (x)
+ int x __attribute__((__unused__));
+{}
+
+void
+ddiscard (x)
+ double x __attribute__((__unused__));
+{}
+
+int
+foo ()
+{
+ static int table[] = {20, 69, 4, 12};
+ static int idx;
+
+ return table[idx++];
+}
+
+double
+dfoo ()
+{
+ static double table[] = {20.4, 69.96, 4.4, 202.202};
+ static int idx;
+
+ return table[idx++];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/complex-1.c
new file mode 100644
index 000000000..7153433d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/complex-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+
+/* Verify that the 6th complex floating-point argument is
+ correctly passed as unnamed argument on SPARC64. */
+
+extern void abort(void);
+
+void foo(long arg1, long arg2, long arg3, long arg4, long arg5, ...)
+{
+ __builtin_va_list ap;
+ _Complex float cf;
+
+ __builtin_va_start(ap, arg5);
+ cf = __builtin_va_arg(ap, _Complex float);
+ __builtin_va_end(ap);
+
+ if (__imag__ cf != 2.0f)
+ abort();
+}
+
+int bar(long arg1, long arg2, long arg3, long arg4, long arg5, _Complex float arg6)
+{
+ foo(arg1, arg2, arg3, arg4, arg5, arg6);
+ return 0;
+}
+
+int main(void)
+{
+ return bar(0, 0, 0, 0, 0, 2.0fi);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/complex-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/complex-2.c
new file mode 100644
index 000000000..85adcde2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/complex-2.c
@@ -0,0 +1,7 @@
+/* Allow complex types in system headers even with -std=iso9899:1990
+ -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#include "complex-2.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/complex-2.h b/gcc-4.9/gcc/testsuite/gcc.dg/complex-2.h
new file mode 100644
index 000000000..752d7f26d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/complex-2.h
@@ -0,0 +1,6 @@
+/* Allow complex types in system headers even with -std=iso9899:1990
+ -pedantic-errors. Header file. */
+
+#pragma GCC system_header
+
+_Complex double x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/complex-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/complex-3.c
new file mode 100644
index 000000000..54ec82c0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/complex-3.c
@@ -0,0 +1,25 @@
+/* Verify that rtl expansion cleanup doesn't get too aggressive about
+ code dealing with complex CONCATs. */
+/* { dg-do run } */
+/* { dg-options "-O -fno-tree-sra" } */
+
+extern void abort (void);
+extern void exit (int);
+
+__complex__ float foo (void)
+{
+ __complex__ float f[1];
+ __real__ f[0] = 1;
+ __imag__ f[0] = 1;
+ f[0] = __builtin_conjf (f[0]);
+ return f[0];
+}
+
+int main (void)
+{
+ __complex__ double d[1];
+ d[0] = foo ();
+ if (__real__ d[0] != 1 || __imag__ d[0] != -1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/complex-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/complex-4.c
new file mode 100644
index 000000000..6becd3b94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/complex-4.c
@@ -0,0 +1,7 @@
+/* PR c/22393 */
+/* { dg-options "-O -std=gnu99" } */
+
+__complex__ double foo (__complex__ double x)
+{
+ return 1.0 / x * -1.0i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/complex-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/complex-5.c
new file mode 100644
index 000000000..ffedefea3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/complex-5.c
@@ -0,0 +1,55 @@
+/* PR middle-end/33088 */
+/* Origin: Joseph S. Myers <jsm28@gcc.gnu.org> */
+
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
+/* { dg-options "-std=c99 -O -ffloat-store -lm" } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+volatile int x[1024];
+
+void __attribute__((noinline))
+fill_stack (void)
+{
+ volatile int y[1024];
+ int i;
+ for (i = 0; i < 1024; i++)
+ y[i] = 0x7ff00000;
+ for (i = 0; i < 1024; i++)
+ x[i] = y[i];
+}
+
+volatile _Complex double vc;
+
+void __attribute__((noinline))
+use_complex (_Complex double c)
+{
+ vc = c;
+}
+
+double t0, t1, t2, t3;
+
+#define USE_COMPLEX(X, R, C) \
+ do { __real__ X = R; __imag__ X = C; use_complex (X); } while (0)
+
+void __attribute__((noinline))
+use_stack (void)
+{
+ _Complex double a, b, c, d;
+ USE_COMPLEX (a, t0, t1);
+ USE_COMPLEX (b, t1, t2);
+ USE_COMPLEX (c, t2, t3);
+ USE_COMPLEX (d, t3, t0);
+}
+
+int
+main (void)
+{
+ fill_stack ();
+ feclearexcept (FE_INVALID);
+ use_stack ();
+ if (fetestexcept (FE_INVALID))
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compound-literal-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/compound-literal-1.c
new file mode 100644
index 000000000..9b3b24e25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compound-literal-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+/* PR c/43248 */
+
+__extension__ int foo(__SIZE_TYPE__ i)
+{
+ i ? : (void *){}; /* { dg-error "" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/compound-lvalue-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/compound-lvalue-1.c
new file mode 100644
index 000000000..30ed58ff8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/compound-lvalue-1.c
@@ -0,0 +1,13 @@
+/* Test for deprecation of compound expressions as lvalues. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int x, y;
+
+void
+foo (void)
+{
+ (x, y) = 1; /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "lvalue" "compound expression as lvalue" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/concat.c b/gcc-4.9/gcc/testsuite/gcc.dg/concat.c
new file mode 100644
index 000000000..0b9d6f6a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/concat.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+/* Test we output an error for concatenation of artificial strings.
+
+ Neil Booth, 10 Dec 2001. */
+
+void foo ()
+{
+ char s1[] = __FUNCTION__"."; /* { dg-error "(parse|syntax|expected|invalid|array)" } */
+ char s2[] = __PRETTY_FUNCTION__".";/* { dg-error "(parse|syntax|expected|invalid|array)" } */
+ char s3[] = "."__FUNCTION__; /* { dg-error "(parse|syntax|expected|invalid)" } */
+ char s4[] = "."__PRETTY_FUNCTION__;/* { dg-error "(parse|syntax|expected|invalid)" } */
+ char s5[] = ".""."; /* No error. */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/concat2.c b/gcc-4.9/gcc/testsuite/gcc.dg/concat2.c
new file mode 100644
index 000000000..1e9240066
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/concat2.c
@@ -0,0 +1,16 @@
+/* PR c/3581 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Intended as a compile-time test for string literal concatenation.
+ The fact that the string isn't actually used in the resulting program
+ should allow this to compile for any target. */
+
+#define e0 "a"
+#define e1 e0 e0 e0 e0 e0 e0 e0 e0 e0 e0
+#define e2 e1 e1 e1 e1 e1 e1 e1 e1 e1 e1
+#define e3 e2 e2 e2 e2 e2 e2 e2 e2 e2 e2
+#define e4 e3 e3 e3 e3 e3 e3 e3 e3 e3 e3
+#define e5 e4 e4 e4 e4 e4 e4 e4 e4 e4 e4
+
+void foo() { (void)(e5); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cond-constqual-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cond-constqual-1.c
new file mode 100644
index 000000000..3354c7214
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cond-constqual-1.c
@@ -0,0 +1,15 @@
+/* Test for const qualification of type of conditional expression. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int foo (int) __attribute__ ((const));
+const int i;
+
+void
+test (void)
+{
+ __typeof__ (1 ? foo (0) : 0) texpr;
+ __typeof__ (1 ? i : 0) texpr2;
+ texpr = 0; /* { dg-bogus "read-only variable" "conditional expression with call to const function" } */
+ texpr2 = 0; /* { dg-error "read-only variable" "conditional expression with const variable" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cond-lvalue-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cond-lvalue-1.c
new file mode 100644
index 000000000..f2605af6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cond-lvalue-1.c
@@ -0,0 +1,13 @@
+/* Test for deprecation of conditional expressions as lvalues. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int x, y, z;
+
+void
+foo (void)
+{
+ (x ? y : z) = 1; /* { dg-bogus "warning" "warning in place of error" } */
+}
+/* { dg-error "lvalue" "conditional expression as lvalue" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/const-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/const-1.c
new file mode 100644
index 000000000..a5b2b1677
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/const-1.c
@@ -0,0 +1,57 @@
+/* { dg-do compile { target nonpic } } */
+/* { dg-options "-O2 -Wsuggest-attribute=const" } */
+
+extern int extern_const(int a) __attribute__ ((const));
+
+/* Trivial. */
+int
+foo1(int a) /* { dg-bogus "normally" "detect const candidate" } */
+{ /* { dg-warning "const" "detect const candidate" { target *-*-* } "8" } */
+ return extern_const (a);
+}
+
+/* Loops known to be normally and extern const calls should be safe. */
+
+int __attribute__ ((noinline))
+foo2(int n) /* { dg-bogus "normally" "detect const candidate" } */
+{ /* { dg-warning "const" "detect const candidate" { target *-*-* } "16" } */
+ int ret = 0;
+ int i;
+ for (i=0; i<n; i++)
+ ret+=extern_const (i);
+ return ret;
+}
+
+/* No warning here; we can work it by ourselves. */
+static int __attribute__ ((noinline))
+foo2b(int n)
+{
+ int ret = 0;
+ int i;
+ for (i=0; i<n; i++)
+ ret+=extern_const (i);
+ return ret;
+}
+
+/* Unbounded loops are not safe. */
+static int __attribute__ ((noinline))
+foo3(unsigned int n) /* { dg-warning "const\[^\n\]* normally" "detect const candidate" } */
+{
+ int ret = 0;
+ unsigned int i;
+ for (i=0; extern_const (i+n); n++)
+ ret+=extern_const (i);
+ return ret;
+}
+
+int
+foo4(int n) /* { dg-warning "const\[^\n\]* normally" "detect const candidate" } */
+{
+ return foo3(n) + foo2b(n);
+}
+
+int
+foo5(int n) /* { dg-bogus "normally" "detect const candidate" } */
+{ /* { dg-warning "const" "detect const candidate" { target *-*-* } "54" } */
+ return foo2(n);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/const-elim-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/const-elim-1.c
new file mode 100644
index 000000000..c9c57a278
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/const-elim-1.c
@@ -0,0 +1,48 @@
+/* Verify that constants in memory, referenced only by dead code,
+ are not emitted to the object file.
+ FIXME: Not presently possible to apply -pedantic to code with
+ complex constants in it. The __extension__ should shut up the
+ warning but doesn't. (Hard to fix -- the lexer is not aware of
+ the parser's state.) */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=c99" } */
+/* { dg-final { scan-assembler-not "L\\\$?C\[^A-Z\]" } } */
+
+#define I (__extension__ 1.0iF)
+
+struct S { int a; double b[2]; void *c; };
+
+extern void use_str(const char *);
+extern void use_S(const struct S *);
+extern void use_cplx(__complex__ double);
+
+static inline int
+returns_23(void) { return 23; }
+
+void
+test1(void)
+{
+ if (returns_23() == 23)
+ return;
+
+ use_str("waltz, nymph, for quick jigs vex bud");
+ use_S(&(const struct S){12, {3.1415, 2.1828}, 0 });
+ use_cplx(3.1415 + 2.1828*I);
+}
+
+void
+test2(void)
+{
+ const char *str = "pack my box with five dozen liquor jugs";
+ const struct S S = { 23, { 1.414, 1.618 }, 0 };
+ const __complex__ double cplx = 1.414 + 1.618*I;
+
+ if (returns_23() == 23)
+ return;
+
+ use_str(str);
+ use_S(&S);
+ use_cplx(cplx);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/const-elim-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/const-elim-2.c
new file mode 100644
index 000000000..ce55ba1c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/const-elim-2.c
@@ -0,0 +1,10 @@
+/* The string constant in this test case should be emitted exactly once. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "hi there" 1 } } */
+
+static inline int returns_23() { return 23; }
+
+const char *test1(void) { if (returns_23()) return 0; return "hi there"; }
+const char *test2(void) { return "hi there"; }
+const char *test3(void) { return "hi there"; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/const-float128-ped.c b/gcc-4.9/gcc/testsuite/gcc.dg/const-float128-ped.c
new file mode 100644
index 000000000..6a6b6223c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/const-float128-ped.c
@@ -0,0 +1,5 @@
+/* Test 'q' suffix with -pedantic on __float128 type constants. */
+/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-pedantic" } */
+
+__float128 a = 123.456789q; /* { dg-warning "non-standard suffix on floating constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/const-float128.c b/gcc-4.9/gcc/testsuite/gcc.dg/const-float128.c
new file mode 100644
index 000000000..116e4597b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/const-float128.c
@@ -0,0 +1,6 @@
+/* Test 'q' and 'Q' suffixes on __float128 type constants. */
+/* { dg-do compile { target ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "" } */
+
+__float128 a = 123.456789q;
+__float128 b = 123.456789Q;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/const-float80-ped.c b/gcc-4.9/gcc/testsuite/gcc.dg/const-float80-ped.c
new file mode 100644
index 000000000..d1cf316dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/const-float80-ped.c
@@ -0,0 +1,5 @@
+/* Test 'w' suffix with -pedantic on __float80 type constants. */
+/* { dg-do compile { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "-pedantic" } */
+
+__float80 a = 123.456789w; /* { dg-warning "non-standard suffix on floating constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/const-float80.c b/gcc-4.9/gcc/testsuite/gcc.dg/const-float80.c
new file mode 100644
index 000000000..8ec771f8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/const-float80.c
@@ -0,0 +1,6 @@
+/* Test 'w' and 'W' suffixes on __float80 type constants. */
+/* { dg-do compile { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+
+__float80 a = 123.456789W;
+__float80 b = 123.456789w;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/const-uniq-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/const-uniq-1.c
new file mode 100644
index 000000000..497efed8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/const-uniq-1.c
@@ -0,0 +1,24 @@
+/* Verify that the 2 constant initializers are uniquized. */
+
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-gimple" } */
+
+int lookup1 (int i)
+{
+ /* We use vectors long enough that piece-wise initialization is not
+ reasonably preferable even for size (when including the constant
+ vectors for initialization) for any target. */
+ int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+ return a[i];
+}
+
+int lookup2 (int i)
+{
+ int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+ return a[i+1];
+}
+
+/* { dg-final { scan-tree-dump-times "L\\\$?C\\\.*0" 2 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/constructor-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/constructor-1.c
new file mode 100644
index 000000000..1095a455c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/constructor-1.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+/* The ipa-split pass pulls the body of the if(!x) block
+ into a separate function to make foo a better inlining
+ candidate. Make sure this new function isn't also run
+ as a static constructor. */
+
+#include <stdlib.h>
+
+int x, y;
+
+void __attribute__((noinline))
+bar(void)
+{
+ y++;
+}
+
+void __attribute__((constructor))
+foo(void)
+{
+ if (!x)
+ {
+ bar();
+ y++;
+ }
+}
+
+int main()
+{
+ x = 1;
+ foo();
+ foo();
+ if (y != 2)
+ abort();
+ exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/conv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/conv-1.c
new file mode 100644
index 000000000..07e41a6ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/conv-1.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2000 Free Software Foundation.
+
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do compile } */
+
+double
+foo (unsigned long var)
+{
+ return var;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/conv-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/conv-2.c
new file mode 100644
index 000000000..388dee3d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/conv-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-Wpointer-sign" } */
+
+void f1(long *); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */
+void f2(unsigned long *); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */
+
+int main()
+{
+ long *lp;
+ unsigned long *ulp;
+ char *cp;
+ unsigned char *ucp;
+ signed char *scp;
+
+ ulp = lp; /* { dg-warning " pointer targets in assignment differ in signedness" } */
+ lp = ulp; /* { dg-warning " pointer targets in assignment differ in signedness" } */
+ f1(ulp); /* { dg-warning " differ in signedness" } */
+ f2(lp); /* { dg-warning " differ in signedness" } */
+
+ cp = ucp; /* { dg-warning " pointer targets in assignment differ in signedness" } */
+ cp = scp; /* { dg-warning " pointer targets in assignment differ in signedness" } */
+ ucp = scp; /* { dg-warning " pointer targets in assignment differ in signedness" } */
+ ucp = cp; /* { dg-warning " pointer targets in assignment differ in signedness" } */
+ scp = ucp; /* { dg-warning " pointer targets in assignment differ in signedness" } */
+ scp = cp; /* { dg-warning " pointer targets in assignment differ in signedness" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/conv-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/conv-3.c
new file mode 100644
index 000000000..3b4f4309d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/conv-3.c
@@ -0,0 +1,18 @@
+/* PR middle-end/19100 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort (void);
+
+int test (int v)
+{
+ return ((signed char) (v ? 0x100 : 0)) ? 17 : 18;
+}
+
+int main()
+{
+ if (test (2) != 18)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/#cmdlne-M-2.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/#cmdlne-M-2.h
new file mode 100644
index 000000000..40a8c178f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/#cmdlne-M-2.h
@@ -0,0 +1 @@
+/* empty */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c
new file mode 100644
index 000000000..32d2a816e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c
@@ -0,0 +1,13 @@
+/* Test for proper disabling of macros within their own expansions. */
+/* { dg-do compile } */
+
+/* The following is a trick to evaluate a complex boolean expression
+ at compile time, inspired by autoconf 2.13's sizeof-detection. */
+
+enum { a = 4, f = 3 };
+
+#define a1(y) (y+2)
+#define a2(y) a1(y)+1
+#define f a+f
+
+char array[(a2(f)) == 10 ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19930510-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19930510-1.c
new file mode 100644
index 000000000..62c120674
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19930510-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+extern void exit (int);
+
+#define ugly 3
+#ugly "foobar" 3 /* { dg-error "invalid" "invalid directive" } */
+int main() { exit (0); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1.c
new file mode 100644
index 000000000..a79b2f548
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1.c
@@ -0,0 +1,20 @@
+/* { dg-do preprocess } */
+/* PR 4713 */
+
+/* dg.exp doesn't read the header files for magic comments. */
+/* { dg-error "unterminated comment" "" { target *-*-* } 4 } */
+/* { dg-error "unterminated comment" "header error" { target *-*-* } 8 } */
+
+#include "19940712-1.h"
+/* { dg-message "" "In file included from:" { target *-*-* } 0 } */
+#include "19940712-1a.h"
+#include "19940712-1b.h"
+
+/* comment start in comment error
+/* in a .c file */
+
+int main ()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1.h
new file mode 100644
index 000000000..183821334
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1.h
@@ -0,0 +1,10 @@
+/* comment start in comment error
+/* in a .h file */
+
+#if 0
+#endif /* comment start in comment error
+/* after a cpp directive */
+
+/* comment start in comment error
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1a.h
new file mode 100644
index 000000000..55ab6b844
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1a.h
@@ -0,0 +1,4 @@
+/* spanning a .h file */
+
+#if 0
+#endif /* comment start in comment error
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1b.h
new file mode 100644
index 000000000..d75156c04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19940712-1b.h
@@ -0,0 +1,2 @@
+/* spanning a .h file */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19951025-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19951025-1.c
new file mode 100644
index 000000000..b817b68c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19951025-1.c
@@ -0,0 +1,4 @@
+/* { dg-do preprocess } */
+/* { dg-error "include expects" "include" { target *-*-* } 4 } */
+/* { dg-error "newline at end" "newline" { target *-*-* } 4 } */
+#include /\
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19951227-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19951227-1.c
new file mode 100644
index 000000000..da2f6d851
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19951227-1.c
@@ -0,0 +1,3 @@
+/* { dg-do preprocess } */
+#if 0xe-1 /* { dg-error "invalid suffix" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19960224-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19960224-1.c
new file mode 100644
index 000000000..5efc62769
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19960224-1.c
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+
+#if 0
+#if 0
+#endif \
+\
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990119-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990119-1.c
new file mode 100644
index 000000000..10a7baae3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990119-1.c
@@ -0,0 +1,9 @@
+/* This checks for two things:
+ - an obscure corner case in the standard rules for __LINE__
+ - regression of an associated bug in cpplib where the semicolon got lost */
+/* { dg-do compile } */
+
+enum { i = __LINE__\
+};
+
+char array[i == 6 ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990228-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990228-1.c
new file mode 100644
index 000000000..acae1169a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990228-1.c
@@ -0,0 +1,21 @@
+/* Regression test for cpp. The following input may cause core dumps
+ or # line markers in the middle of the line. */
+/* { dg-do preprocess } */
+
+#define foo(string, arg) bar(2, string, arg)
+
+foo ("\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+\
+",
+NULL);
+
+/* { dg-final { scan-file-not 19990228-1.i "\[^\\n\]#" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990407-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990407-1.c
new file mode 100644
index 000000000..d6da8d656
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990407-1.c
@@ -0,0 +1,19 @@
+/* Regression test for a cpplib macro-expansion bug where
+ `@' becomes `@@' when stringified. */
+
+/* { dg-do run } */
+
+#include <string.h>
+#include <stdlib.h>
+
+#define STR(x) #x
+
+char *a = STR(@foo), *b = "@foo";
+
+int
+main(void)
+{
+ if (strcmp (a, b))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990409-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990409-1.c
new file mode 100644
index 000000000..d7f5e2852
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990409-1.c
@@ -0,0 +1,6 @@
+/* Test that __LINE__ works when embedded in a macro. */
+/* { dg-do compile } */
+
+#define XLINE __LINE__
+
+char array[XLINE == __LINE__ ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990413-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990413-1.c
new file mode 100644
index 000000000..17d8441e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19990413-1.c
@@ -0,0 +1,13 @@
+/* Verify that cpp doesn't screw up the line numbering when a macro argument
+ extends over multiple lines. */
+/* { dg-do compile } */
+
+#define FOO(x) /* nothing */
+
+void
+func(void)
+{
+ FOO(i
+ = 4)
+ else; /* { dg-error "'else' without a previous 'if'" "error on this line" { target *-*-* } { 12 } } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000127-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000127-1.c
new file mode 100644
index 000000000..467ad2c3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000127-1.c
@@ -0,0 +1,139 @@
+/* { dg-do compile } */
+
+/* Test for core dump in the preprocessor. Originally exposed by
+ XEmacs, but this has been synthesized from scratch. */
+
+#define foo(bar) bar
+
+int x =
+foo(
+ /*
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+
+ */
+ 2);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000129-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000129-1.c
new file mode 100644
index 000000000..878002bee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000129-1.c
@@ -0,0 +1,15 @@
+/* Regression test for trigraph warnings. Under certain conditions we
+ got the line numbers wrong.
+ Originally exposed by XEmacs and reported by Martin Buchholz
+ <martin@xemacs.org>; this test case is synthetic. */
+
+/* { dg-do preprocess } */
+/* { dg-options -Wall } */
+
+#define some_macro \
+ blah \
+ blah \
+ blah \
+ blah
+
+??> /* { dg-warning "trigraph ..." "trigraph encountered" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000207-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000207-1.c
new file mode 100644
index 000000000..931cc0d47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000207-1.c
@@ -0,0 +1,16 @@
+/* { dg-do preprocess } */
+
+/* Test for proper handling of unary minus in #if. */
+
+#if !(-1)
+#error Error /* { dg-bogus "Error" "case !(-1)" } */
+#endif
+
+#if !-1
+#error Error /* { dg-bogus "Error" "case !-1" } */
+#endif
+
+#if -1
+#else
+#error Error /* { dg-bogus "Error" "case -1" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000207-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000207-2.c
new file mode 100644
index 000000000..fbdf39e14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000207-2.c
@@ -0,0 +1,16 @@
+/* { dg-do preprocess } */
+
+/* Test for proper handling of unary plus in #if. */
+
+#if !(+1)
+#error Error /* { dg-bogus "Error" "case !(+1)" } */
+#endif
+
+#if !+1
+#error Error /* { dg-bogus "Error" "case !+1" } */
+#endif
+
+#if +1
+#else
+#error Error /* { dg-bogus "Error" "case +1" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000209-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000209-1.c
new file mode 100644
index 000000000..fe7105857
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000209-1.c
@@ -0,0 +1,34 @@
+/* { dg-do preprocess } */
+
+/* Tests for line numbering around function-like macro calls.
+ Bug found by Mark Mitchell. */
+
+#define f(x) x
+#define g f
+
+f (3);
+#error here /* { dg-error "here" "case 0" } */
+
+f
+ (3);
+#error here /* { dg-error "here" "case 1" } */
+
+(f
+ )(3);
+#error here /* { dg-error "here" "case 2" } */
+
+g
+ (3);
+#error here /* { dg-error "here" "case 3" } */
+
+(g
+ )(3);
+#error here /* { dg-error "here" "case 4" } */
+
+f /* some
+ text */ (3);
+#error here /* { dg-error "here" "case 5" } */
+
+(g /* some
+ text */ )(3);
+#error here /* { dg-error "here" "case 6" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000209-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000209-2.c
new file mode 100644
index 000000000..6a9198f64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000209-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+/* Distilled from glibc sources. Tests preprocessor corner cases.
+ Since it uses rest args, we must turn off -pedantic-errors. */
+
+#define NO_PAREN(rest...) rest
+#define DEFINE_CATEGORY(category, items) \
+const int _nl_value_type_##category[] = { NO_PAREN items }
+
+DEFINE_CATEGORY
+(
+ LC_COLLATE,
+ (
+ 1,
+ 2,
+ 3,
+ ));
+
+DEFINE_CATEGORY(LC_CTYPE, (1, 2, 3));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000301-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000301-1.c
new file mode 100644
index 000000000..85645b062
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000301-1.c
@@ -0,0 +1,3 @@
+/* { dg-do preprocess } */
+/* Test for crash with indented empty definitions. */
+ #define _LIBC_LIMITS_H_ /* nothing */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000419-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000419-1.c
new file mode 100644
index 000000000..c4400ee6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000419-1.c
@@ -0,0 +1,15 @@
+/* Test for erroneous deletion of the entire macro expansion when pruning
+ \r escapes. Problem noted by DJ Delorie <dj@delorie.com>; test case
+ distilled from GNU libc header files. */
+/* { dg-do preprocess } */
+
+#define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
+#define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define __ASMNAME2(prefix, cname) __STRING (prefix) cname
+#define __STRING(x) #x
+
+__REDIRECT (a, b, c)
+__ASMNAME2 (__USER_LABEL_PREFIX__, harumph)
+
+/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 11 } */
+/* { dg-bogus "used without args" "no args, 1" { target *-*-* } 12 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000519-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000519-1.c
new file mode 100644
index 000000000..7cd7daa3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000519-1.c
@@ -0,0 +1,11 @@
+/* Regression test for preprocessor crash.
+ Reported by Mathias Froehlich <frohlich@na.uni-tuebingen.de>. */
+/* { dg-do preprocess } */
+/* { dg-options "-ansi" } */
+#define foo
+
+#define __CAT__(a,b,c,d) a##b##c##d
+#define CAT(a,b,c,d) __CAT__(a,b,c,d)
+
+#define bar CAT(,foo,bar,)
+bar
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000529-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000529-1.c
new file mode 100644
index 000000000..6343a81fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000529-1.c
@@ -0,0 +1,14 @@
+/* Regression test for bug with macro expansion on #if lines -
+ exposed by glibc. */
+/* { dg-do compile } */
+
+# define SHLIB_COMPAT(lib, introduced, obsoleted) \
+ (!(ABI_##lib##_##obsoleted - 0) \
+ || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0)))
+
+#if 0
+bad
+#elif SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+int
+#endif
+x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000625-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000625-1.c
new file mode 100644
index 000000000..01ce98bf6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000625-1.c
@@ -0,0 +1,17 @@
+
+/* Regression test for paste corner cases. Distilled from
+ syscall stub logic in glibc. */
+
+/* { dg-do compile } */
+
+#define ENTRY(name) name##:
+#define socket bind
+
+int
+main(void)
+{
+ goto socket;
+
+ ENTRY(socket) /* { dg-error "valid preprocessing token" "" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000627-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000627-1.c
new file mode 100644
index 000000000..dc0173244
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000627-1.c
@@ -0,0 +1,10 @@
+/* Test for spurious warnings with backslashes in perverse locations.
+ Bug exposed by Plumhall. */
+/* { dg-do compile } */
+
+extern int bar;
+
+#def\
+ine foo bar
+
+int main(void) { return foo; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1.c
new file mode 100644
index 000000000..41b84108c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1.c
@@ -0,0 +1,5 @@
+/* Test if #line commands are generated properly even when header
+ includes self. */
+/* { dg-do compile } */
+#include "20000628-1.h"
+int main(void) { return a + b + c; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1.h
new file mode 100644
index 000000000..2b2fb479e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1.h
@@ -0,0 +1,8 @@
+/* Test if #line commands are generated properly even when header
+ includes self. */
+#include "20000628-1a.h"
+#ifndef t20000628_1_h
+#define t20000628_1_h 1
+#include "20000628-1.h"
+#include "20000628-1a.h"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1a.h
new file mode 100644
index 000000000..0fdc46d58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000628-1a.h
@@ -0,0 +1,15 @@
+/* Included from 20000628-1.h. This header is supposed to be seen
+ exactly three times. */
+
+#if !defined A
+#define A
+int a;
+#elif !defined B
+#define B
+int b;
+#elif !defined C
+#define C
+int c;
+#else
+#error Included a fourth time
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000725-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000725-1.c
new file mode 100644
index 000000000..6fa72e454
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20000725-1.c
@@ -0,0 +1,3 @@
+/* { dg-do preprocess } */
+
+#define foo(x, y, defined) bar(x, y, defined)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20020927-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20020927-1.c
new file mode 100644
index 000000000..91f89518a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20020927-1.c
@@ -0,0 +1,91 @@
+/* Test case for buffer overflow bug in token stringification.
+ See PR preprocessor/8055 for details.
+ Reported by Alexander N. Kabaev <ak03@gte.com>.
+ Test case written by Zack Weinberg <zack@codesourcery.com>. */
+
+/* { dg-do preprocess } */
+
+#define S(x) #x
+
+/* Fill up one internal buffer with data. */
+S(1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 1234567890123456789012345678901234567890123456789012345678901234567890
+ 12345678901234567890123456789012345678901234567890123456789012345)
+
+/* When stringify_arg() was called with an empty macro argument, it would
+ advance the buffer pointer by one but fail to check for running past the
+ end of the buffer. We can only know where the end of the buffer is to
+ within about eight bytes, so do this sixteen times to be sure of hitting
+ it. */
+
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+S()
+
+/* Now allocate more memory in the buffer, which should provoke a crash. */
+
+S(abcdefghijklmnopqrstuvwxyz)
+S(abcdefghijklmnopqrstuvwxyz)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20050215-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20050215-1.c
new file mode 100644
index 000000000..e5aaf220e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/20050215-1.c
@@ -0,0 +1,10 @@
+/* Testcase for memory corruption bug in macro processing.
+ See PR preprocessor/19077 for details. */
+
+/* { dg-do compile } */
+/* { dg-options "-g3" } */
+#define FOO(a,b,c,d,e) a b c d e \
+" " \
+" " \
+" "
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h
new file mode 100644
index 000000000..4259c3718
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h
@@ -0,0 +1,4 @@
+/* Used by gcc.dg/cpp/isysroot-2.c to test isysroot. */
+void foo()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c
new file mode 100644
index 000000000..69b3aae3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wmissingdirs.c
@@ -0,0 +1,7 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99 -I /jolly/well/better/not/exist -Wmissing-include-dirs" } */
+
+/* Test that -Wmissing-include-dirs issues a warning when a specified
+ directory does not exist. Source Ben Elliston, 2004-05-13. */
+
+/* { dg-warning "No such file or directory" "-Wmissing-include-dirs" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wsignprom.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wsignprom.c
new file mode 100644
index 000000000..87d422b79
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wsignprom.c
@@ -0,0 +1,26 @@
+/* { dg-do preprocess } */
+/* { dg-options "-Wall" } */
+
+/* Test that -Wall emits the warnings about integer promotion changing
+ the sign of an operand. */
+
+#if -1 > 0U /* { dg-warning "5:changes sign when promoted" } */
+#endif
+
+#if 0U + -1 /* { dg-warning "10:changes sign when promoted" } */
+#endif
+
+#if 0U * -1 /* { dg-warning "10:changes sign when promoted" } */
+#endif
+
+#if 1U / -2 /* { dg-warning "10:changes sign when promoted" } */
+#endif
+
+#if -1 % 1U /* { dg-warning "5:changes sign when promoted" } */
+#endif
+
+#if 1 ? 0U : -1 /* { dg-warning "14:changes sign when promoted" } */
+#endif
+
+#if 1 ? -1 : 0U /* { dg-warning "9:changes sign when promoted" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c
new file mode 100644
index 000000000..8d61f2841
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wtrigraphs-2.c
@@ -0,0 +1,20 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -Wtrigraphs" } */
+
+/* Test warnings for trigraphs in comments, with trigraphs enabled.
+ Neil Booth. 4 May 2003. */
+
+/* { dg-bogus "converted" } Test ??< ??= a few ??/ random things in
+ { dg-warning "converted" } some ??/
+ { dg-bogus "converted" } ??< comments. */
+
+// { dg-bogus "converted" } More ??/ comment ??> tests.
+
+// { dg-warning "converted" } Another ??/
+ Test
+
+// { dg-warning "converted" } And another with space after ??/
+ the escape
+
+// { dg-bogus "converted" } A tricky one ??/\
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c
new file mode 100644
index 000000000..d4be2040c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wtrigraphs.c
@@ -0,0 +1,27 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99 -Wtrigraphs" } */
+
+/* Test we don't double warn for trigraphs immediately after preceding
+ text. Source Neil Booth. 22 Nov 2000. */
+
+abcdef??< /* { dg-warning "ignored" } */
+123456??> /* { dg-warning "ignored" } */
++??= /* { dg-warning "ignored" } */
+
+/* Test we warn of escaped newlines only in comments. Source Neil
+ Booth. 4 May 2003. */
+
+/* { dg-bogus "ignored" } Test ??< ??= a few ??/ random things in
+ { dg-warning "ignored" } some ??/
+ { dg-bogus "ignored" } ??< comments. */
+
+// { dg-bogus "ignored" } More ??/ comment ??> tests.
+
+// { dg-warning "ignored" } Another ??/
+ Test
+
+// { dg-warning "ignored" } And another with space after ??/
+ the escape
+
+// { dg-bogus "ignored" } A tricky one ??/\
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c
new file mode 100644
index 000000000..4f6a04be4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunknown-pragmas-1.c
@@ -0,0 +1,29 @@
+/* Copyright 2003 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wunknown-pragmas" } */
+
+/* Make sure we get warnings in the expected lines. */
+
+#pragma unknown1 /* { dg-warning "unknown1" "unknown1" } */
+
+#define COMMA ,
+#define FOO(x) x
+#define BAR(x) _Pragma("unknown_before") x
+#define BAZ(x) x _Pragma("unknown_after")
+
+int _Pragma("unknown2") bar1; /* { dg-warning "unknown2" "unknown2" } */
+
+FOO(int _Pragma("unknown3") bar2); /* { dg-warning "unknown3" "unknown3" } */
+
+int BAR(bar3); /* { dg-warning "unknown_before" "unknown_before 1" } */
+
+BAR(int bar4); /* { dg-warning "unknown_before" "unknown_before 2" } */
+
+int BAZ(bar5); /* { dg-warning "unknown_after" "unknown_after 1" } */
+
+int BAZ(bar6;) /* { dg-warning "unknown_after" "unknown_after 2" } */
+
+FOO(int bar7; _Pragma("unknown4")) /* { dg-warning "unknown4" "unknown4" } */
+
+#pragma unknown5 /* { dg-warning "unknown5" "unknown5" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunused.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunused.c
new file mode 100644
index 000000000..ac363ad04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunused.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* Duplicate command line options should not warn. */
+/* { dg-options "-Wunused-macros -Dfoo -Dfoo" } */
+
+/* Test everything related to -Wunused-macros.
+
+ Source: Neil Booth, 23 Jul 2002. */
+
+#include "Wunused.h"
+
+#define used1 /* { dg-bogus "used" } */
+#define used2 /* { dg-bogus "used" } */
+#define used3 /* { dg-bogus "used" } */
+#define used4 used4 /* { dg-bogus "used" } */
+
+#define unused5 /* { dg-warning "used" } */
+#define unused6 /* { dg-warning "used" } */
+#define unused7() /* { dg-warning "used" } */
+
+#if defined used1
+#endif
+#ifdef used2
+#endif
+#ifndef used3
+#endif
+used4
+
+unused7 /* This does not count as a use. */
+
+#if 0
+unused5 /* This does not count as a use. */
+#endif
+#undef unused5
+
+#define unused6
+unused6
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunused.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunused.h
new file mode 100644
index 000000000..8b54412bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wunused.h
@@ -0,0 +1 @@
+#define unused_but_ok
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c
new file mode 100644
index 000000000..b034aacd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Werror" } */
+
+#define f(x,...) /* { dg-error "variadic" } */
+#define g(x,y...) /* { dg-error "variadic" } */
+int not_empty;
+/* { dg-message "warnings being treated as errors" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c
new file mode 100644
index 000000000..f72e311f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-2.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Werror -Wno-variadic-macros" } */
+
+#define f(x,...) /* { dg-bogus "variadic" } */
+#define g(x,y...) /* { dg-bogus "variadic" } */
+int not_empty;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c
new file mode 100644
index 000000000..0317c3c6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Werror" } */
+
+#define f(x,...)
+#define g(x,y...) /* { dg-error "variadic" } */
+int not_empty;
+/* { dg-message "warnings being treated as errors" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c
new file mode 100644
index 000000000..428365e0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/Wvariadic-4.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Werror -Wno-variadic-macros" } */
+
+#define f(x,...)
+#define g(x,y...)
+int not_empty;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma1.c
new file mode 100644
index 000000000..0f211a985
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma1.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests the _Pragma operator. Contributed by Neil Booth 1 Nov 2000. */
+
+/* Within the preprocessor, the easy pragma to test is "poison". */
+
+#pragma GCC poison p1
+p1 /* { dg-error "poisoned" } */
+
+/* Standard use of _Pragma. */
+_Pragma ("GCC poison p2")
+p2 /* { dg-error "poisoned" } */
+
+/* Don't interpret _Pragmas in directives. The standard is not clear
+ on this, but I think this makes most sense. */
+#if 1 _Pragma (L"GCC poison p3") /* { dg-error "missing binary operator" } */
+p3
+#endif
+
+#define M1 _Pragma ("GCC poison p4")
+p4 /* No problem; not yet poisoned. */
+#define M2(x) _Pragma (#x)
+
+/* Now test macro expansion with embedded _Pragmas. */
+M1 p4 /* { dg-error "poisoned" } */
+M2 (GCC poison p5) p5 /* { dg-error "poisoned" } */
+
+/* Not interpreting _Pragma in directives means they don't nest. */
+_Pragma ("_Pragma (\"GCC poison p6\") GCC poison p7")
+p6
+p7
+
+/* Check we ignore them in false conditionals. */
+#if 0
+_Pragma ("GCC poison p8")
+#endif
+p8 /* No problem. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma2.c
new file mode 100644
index 000000000..24c4457ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma2.c
@@ -0,0 +1,13 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Don't allow directives in a _Pragma string. */
+
+/* Contributed by Neil Booth 14 Nov 2000. */
+
+_Pragma("#define test")
+
+#ifdef test
+#error Do not allow directives in _Pragma strings
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma3.c
new file mode 100644
index 000000000..7d1b42aab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma3.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Pragma buffers have a NULL "inc" member, which we would dereference
+ when getting a file's date and time.
+
+ Based on PR 7526. 14 Aug 2002. */
+
+#define GCC_PRAGMA(x) _Pragma (#x)
+GCC_PRAGMA(GCC dependency "mi1c.h")
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma4.c
new file mode 100644
index 000000000..f6f43d6b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma4.c
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+
+/* Based on Debian GNATS PR 157416. 3 Sep 2002. */
+
+#define b foo _Pragma ("bar") baz
+a b c
+
+/* { dg-final { scan-file "_Pragma4.i" "(^|\\n)#pragma bar($|\\n)" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma5.c
new file mode 100644
index 000000000..141d56b9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma5.c
@@ -0,0 +1,10 @@
+/* { dg-do preprocess } */
+
+/* Based on Debian GNATS PR 8524. 17 Nov 2002. */
+
+#define ALPHA(A) alpha_ ## A
+#define BETA(B) beta_ ## B
+#define GAMMA(C) _Pragma("moose") ALPHA(C) BETA(C)
+GAMMA(baz);
+
+/* { dg-final { scan-file "_Pragma5.i" "alpha_baz beta_baz;" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma6.c
new file mode 100644
index 000000000..7f3f7763e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma6.c
@@ -0,0 +1,10 @@
+/* PR c/27747 */
+/* This is supposed to succeed only if
+ the target doesn't define HANDLE_PRAGMA_PACK_WITH_EXPANSION. */
+/* { dg-do compile { target { ! { *-*-solaris2* } } } } */
+
+#define push bar
+#define foo _Pragma ("pack(push)")
+foo
+int i;
+#pragma pack(pop)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma7.c
new file mode 100644
index 000000000..a7a5b1bcb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/_Pragma7.c
@@ -0,0 +1,14 @@
+/*
+ Origin: PR preprocessor/53469
+ { dg-do compile }
+ */
+
+#define STRINGIFY(x) #x
+#define TEST(x) \
+ _Pragma(STRINGIFY(GCC diagnostic ignored "-Wunused-local-typedefs")) \
+ typedef int myint;
+
+void bar ()
+{
+ TEST(myint)
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/arith-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/arith-1.c
new file mode 100644
index 000000000..99e3cd7be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/arith-1.c
@@ -0,0 +1,257 @@
+/* Preprocessor arithmetic semantic tests. */
+
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+/* Source: Neil Booth, 25 May 2002. */
+
+/* The file tests all aspects of preprocessor arithmetic that are
+ independent of target precision. */
+
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+/* Test || operator and its short circuiting. */
+#if 0 || 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 5 || 0
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 0 || 1
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1 || 4
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1 || (8 / 0) /* { dg-bogus "division by zero" } */
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1 || (1 << 256) /* { dg-bogus "overflow" } */
+#endif
+
+/* Test && operator and its short circuiting. */
+#if (0 && 0) || (0 && 1) || (1 && 0)
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1 && 2
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 0 && (8 / 0)/* { dg-bogus "division by zero" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 0 && (1 << 256) /* { dg-bogus "overflow" } */
+#endif
+
+/* Test == and != operators, and their signedness. */
+#if 1 == 0 || 0 == 1 || 20 != 0x014 || 142 != 0216
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (1 == 1) - 2 > 0 || (1U != 1U) - 2 > 0
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test ? : operator, its short circuiting, and its signedness. */
+#if (1 ? 3: 5) != 3 || (0 ? 3: 5) != 5
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1 ? 0: 1 / 0 /* { dg-bogus "division by zero" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 0 ? 1 / 0: 0 /* { dg-bogus "division by zero" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 0 ? (1 << 256): 0 /* { dg-bogus "overflow" } */
+#endif
+
+#if 1 ? 0: (1 << 256) /* { dg-bogus "overflow" } */
+#endif
+
+/* Test unary + and its signedness. */
+
+#if 23 != +23 || 23 != + +23
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (+1 - 2) > 0 || (+1U - 2) < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test unary - and its signedness. */
+
+#if -1 + 1 != 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -1 >= 0 || -1U <= 0
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test unary ! and its signedness. */
+#if !5 != 0 || !1 != 0 || !0 != 1
+# error /* { dg-bogus "error" } */
+#endif
+
+#if !5 - 1 > 0 || !5U - 1 > 0
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test unary ~ and its signedness. */
+#if ~0 != -1 || ~~5 != 5 || ~-2 != 1
+# error /* { dg-bogus "error" } */
+#endif
+
+#if ~5 > 0 || ~5U < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test comparison operators and their signedness. */
+#if 1 >= 1 && 2 >= 1 && -1 >= -1 && -1 >= -2 && 1 >= -1 && 1 >= -2 \
+ && !(-2 >= -1) && !(2 >= 3) && -1U >= 2 && !(-1 >= 1)
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if ((1 > 0) - 2) > 0 || ((1U > 0) - 2) > 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if !(1 > 1) && 2 > 1 && !(-1 > -1) && -1 > -2 && 1 > -1 && 1 > -2 \
+ && !(-2 > -1) && !(2 > 3) && -1U > 2 && !(-1 > 1)
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if ((1 >= 0) - 2) > 0 || ((1U >= 0) - 2) > 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1 <= 1 && !(2 <= 1) && -1 <= -1 && !(-1 <= -2) && !(1 <= -1) && !(1 <= -2) \
+ && -2 <= -1 && 2 <= 3 && !(-1U <= 2) && -1 <= 1
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if ((1 <= 0) - 2) > 0 || ((1U <= 0) - 2) > 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if !(1 < 1) && !(2 < 1) && !(-1 < -1) && !(-1 < -2) && !(1 < -1) && !(1 < -2) \
+ && -2 < -1 && 2 < 3 && !(-1U < 2) && -1 < 1
+#else
+# error /* { dg-bogus "error" } */
+#endif
+
+#if ((1 < 0) - 2) > 0 || ((1U < 0) - 2) > 0
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test bitwise operators and their signedness. */
+#if (3 & 7) != 3 || (-1 & 34) != 34
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (3 & 7) - 20 > 0 || (3 & 7U) - 20 < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (3 | 5) != 7 || (-1 | 34) != -1
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (3 | 7) - 20 > 0 || (3 | 7U) - 20 < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (7 ^ 5) != 2 || (-1 ^ 34) != ~34
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (3 ^ 7) - 20 > 0 || (3 ^ 7U) - 20 < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test shifts and their signedness. */
+#if 3 << 2 != 12 || 3 << -2 != 0 || -1 << 1 != -2
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 5 >> 1 != 2 || 5 >> -2 != 20 || -5 >> 1 != -3
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (5 >> 2) - 2 >= 0 || (5U >> 2) - 2 <= 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (5 << 1) - 20 >= 0 || (5U << 1) - 20 <= 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 0
+/* Test min / max and their signedness. */
+#if (3 >? 2) != 3 || (-3 >? -2) != -2
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (3 <? 2) != 2 || (-3 <? -2) != -3
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (3 >? 2) - 4 >= 0 || (3 >? 2U) - 4 <= 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (3 <? 2) - 4 >= 0 || (3 <? 2U) - 4 <= 0
+# error /* { dg-bogus "error" } */
+#endif
+#endif
+
+/* Test *, / and % and their signedness. */
+#if 3 * 2 != 6 || 3 * -2 != -6 || -2 * 3 != -6 || -2 * -3 != 6
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 3 * 2 - 7 >= 0 || 3 * 2U - 7 < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 5 / 2 != 2 || -325 / 50 != -6 || 53 / -4 != -13 || -55 / -12 != 4
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 3 / 2 - 7 >= 0 || 3 / 2U - 7 < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 5 % 2 != 1 || -325 % 50 != -25 || 53 % -4 != 1 || -55 % -12 != -7
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 3 % 2 - 7 >= 0 || 3U % 2 - 7 < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test , and its signedness. */
+#if (1, 2) != 2 || (2, 1) != 1
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (1, 2) - 3 >= 0 || (1, 2U) - 3 <= 0 || (1U, 2) - 3 >= 0
+# error /* { dg-bogus "error" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/arith-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/arith-3.c
new file mode 100644
index 000000000..2f94e9811
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/arith-3.c
@@ -0,0 +1,447 @@
+/* Preprocessor arithmetic semantic tests. */
+
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+/* Source: Neil Booth, 26 May 2002. */
+
+/* The file tests overflow warnings for, and values of, preprocessor
+ arithmetic that are dependent on target precision.
+
+ Please keep changes to arith-2.c and arith-3.c in sync. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -fshow-column" } */
+
+#include <limits.h>
+
+#define APPEND2(NUM, SUFF) NUM ## SUFF
+#define APPEND(NUM, SUFF) APPEND2(NUM, SUFF)
+
+#define TARGET_UTYPE_MAX ULLONG_MAX
+
+/* The tests in this file depend only on the macros defined in this
+ #if block. Note that it is no good calculating these values, as
+ the intent is to test both the preprocessor's number parser and
+ arithmetic. */
+#if TARGET_UTYPE_MAX == 65535ULL
+
+# define TARG_PRECISION 16
+# define MAX_INT 32767
+# define MAX_UINT 65535
+
+# define TARG_MAX_HEX 0x7fff
+# define TARG_MAX_OCT 077777
+# define TARG_MAX_PLUS_1 32768L
+# define TARG_MAX_PLUS_1_U 32768UL
+# define TARG_MAX_PLUS_1_HEX 0x8000
+# define TARG_MAX_PLUS_1_OCT 0100000
+# define UTARG_MAX_HEX 0xffff
+# define UTARG_MAX_OCT 0177777
+# define UTARG_MAX_PLUS_1 65536L
+# define UTARG_MAX_PLUS_1_HEX 0x10000
+# define UTARG_MAX_PLUS_1_OCT 0200000
+
+# define TARG_LOWPART_PLUS_1 256L
+# define TARG_LOWPART_PLUS_1_U 256UL
+
+ /* Division and modulo; anything that uses the high half in both
+ dividend and divisor. */
+# define LONG_UDIVISION 61234UL / 260L
+# define LONG_UDIVISION_ANSWER 235
+# define LONG_SDIVISION -15000L / 299L
+# define LONG_SDIVISION_ANSWER -50
+# define LONG_UMODULO 61234UL % 260L
+# define LONG_UMODULO_ANSWER 134
+# define LONG_SMODULO -15000L % 299L
+# define LONG_SMODULO_ANSWER -50
+
+#elif TARGET_UTYPE_MAX == 4294967295ULL
+
+# define TARG_PRECISION 32
+# define MAX_INT 2147483647
+# define MAX_UINT 4294967295
+
+# define TARG_MAX_HEX 0x7fffffff
+# define TARG_MAX_OCT 017777777777
+# define TARG_MAX_PLUS_1 2147483648L
+# define TARG_MAX_PLUS_1_U 2147483648UL
+# define TARG_MAX_PLUS_1_HEX 0x80000000
+# define TARG_MAX_PLUS_1_OCT 020000000000
+# define UTARG_MAX_HEX 0xffffffff
+# define UTARG_MAX_OCT 037777777777
+# define UTARG_MAX_PLUS_1 4294967296L
+# define UTARG_MAX_PLUS_1_HEX 0x100000000
+# define UTARG_MAX_PLUS_1_OCT 040000000000
+
+# define TARG_LOWPART_PLUS_1 65536
+# define TARG_LOWPART_PLUS_1_U 65536UL
+
+ /* Division and modulo; anything that uses the high half in both
+ dividend and divisor. */
+# define LONG_UDIVISION 268335456UL / 70000L
+# define LONG_UDIVISION_ANSWER 3833
+# define LONG_SDIVISION -368335456L / 123456L
+# define LONG_SDIVISION_ANSWER -2983
+# define LONG_UMODULO 268335456UL % 70000L
+# define LONG_UMODULO_ANSWER 25456
+# define LONG_SMODULO -368335456L % 123456L
+# define LONG_SMODULO_ANSWER -66208
+
+#elif TARGET_UTYPE_MAX == 18446744073709551615ULL
+
+# define TARG_PRECISION 64
+# define MAX_INT 9223372036854775807
+# define MAX_UINT 18446744073709551615
+
+# define TARG_MAX_HEX 0x7fffffffffffffff
+# define TARG_MAX_OCT 0777777777777777777777
+# define TARG_MAX_PLUS_1 9223372036854775808L
+# define TARG_MAX_PLUS_1_U 9223372036854775808UL
+# define TARG_MAX_PLUS_1_HEX 0x8000000000000000
+# define TARG_MAX_PLUS_1_OCT 01000000000000000000000
+# define UTARG_MAX_HEX 0xffffffffffffffff
+# define UTARG_MAX_OCT 01777777777777777777777
+# define UTARG_MAX_PLUS_1 18446744073709551616L
+# define UTARG_MAX_PLUS_1_HEX 0x10000000000000000
+# define UTARG_MAX_PLUS_1_OCT 02000000000000000000000
+
+# define TARG_LOWPART_PLUS_1 4294967296
+# define TARG_LOWPART_PLUS_1_U 4294967296U
+
+ /* Division and modulo; anything that uses the high half in both
+ dividend and divisor. */
+# define LONG_UDIVISION 235184372088832UL / 17279869184L
+# define LONG_UDIVISION_ANSWER 13610
+# define LONG_SDIVISION -234582345927345L / 12345678901L
+# define LONG_SDIVISION_ANSWER -19001
+# define LONG_UMODULO 235184372088832UL % 17279869184L
+# define LONG_UMODULO_ANSWER 5352494592L
+# define LONG_SMODULO -234582345927345L % 12345678901L
+# define LONG_SMODULO_ANSWER -2101129444L
+
+#else
+
+# error Please extend the macros here so that this file tests your target
+
+#endif
+
+/* Create more macros based on the above. */
+#define TARG_PART_BITS (TARG_PRECISION / 2)
+#define TARG_MIN (-TARG_MAX - 1)
+#define TARG_MAX APPEND (MAX_INT, L)
+#define TARG_MAX_U APPEND (MAX_INT, UL)
+#define UTARG_MAX APPEND (MAX_UINT, L)
+#define UTARG_MAX_U APPEND (MAX_UINT, UL)
+
+/* And now the tests. */
+
+#if TARG_MAX /* { dg-bogus "so large" } */
+#endif
+#if TARG_MAX_PLUS_1_HEX /* { dg-bogus "so large" } */
+#endif
+#if TARG_MAX_PLUS_1_OCT /* { dg-bogus "so large" } */
+#endif
+
+#if UTARG_MAX /* { dg-warning "so large" } */
+#endif
+#if UTARG_MAX_PLUS_1 /* { dg-warning "too large" } */
+#endif
+#if UTARG_MAX_PLUS_1_HEX /* { dg-warning "too large" } */
+#endif
+#if UTARG_MAX_HEX /* { dg-bogus "too large" } */
+#endif
+#if UTARG_MAX_PLUS_1_OCT /* { dg-warning "too large" } */
+#endif
+#if UTARG_MAX_OCT /* { dg-bogus "too large" } */
+#endif
+
+#if TARG_MAX < 0 || TARG_MAX_PLUS_1 < 0 /* { dg-warning "so large" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if UTARG_MAX_HEX < 0 || TARG_MAX_HEX < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if UTARG_MAX_OCT < 0 || TARG_MAX_OCT < 0
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -1 != UTARG_MAX_U
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+
+/* Test each operator correctly warns of overflow conditions, and
+ gives the right answer. */
+
+/* Binary +. */
+#if TARG_MAX + 1 != TARG_MIN /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -TARG_MAX + -2 != TARG_MAX /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -TARG_MAX + -1 != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MAX_U + 1 != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -TARG_MAX_U + -2 != TARG_MAX /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+
+/* Binary -. */
+#if TARG_MAX - -1 != TARG_MIN /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -TARG_MAX - 2 != TARG_MAX /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -TARG_MAX - 1 != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MAX_U - -1 != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -TARG_MAX_U - 2 != TARG_MAX /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+
+
+/* Binary *. */
+#if TARG_LOWPART_PLUS_1 * (TARG_LOWPART_PLUS_1 >> 1) != TARG_MIN /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (TARG_LOWPART_PLUS_1 >> 1) * TARG_LOWPART_PLUS_1 != TARG_MIN /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (TARG_LOWPART_PLUS_1 << 1) * (TARG_LOWPART_PLUS_1 + 1) != (TARG_LOWPART_PLUS_1 << 1) /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MAX * 1 != TARG_MAX /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (TARG_MAX >> 1) * 2 != TARG_MAX - 1 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (TARG_LOWPART_PLUS_1_U + 61) * (TARG_LOWPART_PLUS_1 << 1) != 61 * (TARG_LOWPART_PLUS_1 << 1) /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (TARG_LOWPART_PLUS_1 >> 1) * TARG_LOWPART_PLUS_1_U != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1 * TARG_MIN != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+
+/* Binary /. */
+#if TARG_MIN / -1 != TARG_MIN /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MIN / 1 != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -TARG_MAX_PLUS_1_U / -1 != 0 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -5 / (2 - 2) /* { dg-error "13:division by zero" } */
+#endif
+
+#if LONG_UDIVISION != LONG_UDIVISION_ANSWER
+# error /* { dg-bogus "error" } */
+#endif
+
+#if LONG_SDIVISION != LONG_SDIVISION_ANSWER
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Binary %. Cannot overflow. */
+#if -5 % (2 - 2) /* { dg-error "13:division by zero" } */
+#endif
+
+#if TARG_MIN % 1 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if LONG_UMODULO != LONG_UMODULO_ANSWER
+# error /* { dg-bogus "error" } */
+#endif
+
+#if LONG_SMODULO != LONG_SMODULO_ANSWER
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 234 % -1U != 234
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MIN % -1U != TARG_MIN
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Binary << and Binary >>, the latter cannot overflow. */
+#if -1 >> 3 != -1 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MAX >> 3 != TARG_MAX / 8 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 0 << 256 != 0 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1 << 256 != 0 /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if 1U << 256 != 0 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MAX << 1 != -2 /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MAX_U << 1 != -2 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_LOWPART_PLUS_1 << TARG_PART_BITS != 0 /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_LOWPART_PLUS_1 << (TARG_PART_BITS - 1) != TARG_MIN /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_LOWPART_PLUS_1_U << (TARG_PART_BITS - 1) != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_LOWPART_PLUS_1 << (TARG_PART_BITS - 2) != (TARG_MAX_PLUS_1_U >> 1) /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+/* Test how the sign bit is handled. */
+#if (TARG_MIN << 1) != 0 /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (TARG_MAX_PLUS_1_U << 1) != 0 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (TARG_MIN >> 1) != 3U << (TARG_PRECISION - 2) /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if (TARG_MAX_PLUS_1_U >> 1) != 1 << (TARG_PRECISION - 2) /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+/* Unary -. It can overflow in just one case. */
+#if -TARG_MIN != TARG_MIN /* { dg-warning "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if - -TARG_MAX != TARG_MAX /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+
+/* Unary +, ~, and !. They cannot overflow. */
+#if +TARG_MAX != TARG_MAX /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if !TARG_MAX + !TARG_MIN != 0 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if ~TARG_MAX , ~TARG_MIN != TARG_MAX /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+
+/* Bitwise &, ^, |. They cannot overflow. */
+#if (TARG_MAX & -1), (TARG_MIN & -1) != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MAX | -1, (TARG_MIN | -1) != -1 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if TARG_MAX ^ -1, (TARG_MIN ^ -1) != TARG_MAX /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+
+/* Comparison operators. They cannot overflow. */
+#if -1 <= TARG_MAX, (TARG_MIN <= 1) != 1 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -1 >= TARG_MAX, (TARG_MIN >= 1) != 0 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -1 < TARG_MAX, (TARG_MIN < 1) != 1 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -1 > TARG_MAX, (TARG_MIN > 1) != 0 /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+
+
+
+/* Comma and ? : operators. They cannot overflow. */
+#if -1, TARG_MAX, TARG_MIN != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
+
+#if -1 ? TARG_MAX: TARG_MAX, 0 ? 1: TARG_MIN != TARG_MIN /* { dg-bogus "overflow" } */
+# error /* { dg-bogus "error" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assembl2.S b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assembl2.S
new file mode 100644
index 000000000..848024cff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assembl2.S
@@ -0,0 +1,19 @@
+/* Copyright (C) 2000-2014 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Source: Bug report of Jonathan Larmour. Tweaked for test suite by
+ Neil Booth, 17 Jan 2000. */
+
+/* We would not test the buffer->was_skipping variable when skipping,
+ meaning that some false directives confused CPP. */
+
+#if 0
+ # foo
+ # fee
+ # fie
+ # foe
+ # fum
+#elif 0
+ # bundy
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assembler.S b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assembler.S
new file mode 100644
index 000000000..7069b7b50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assembler.S
@@ -0,0 +1,26 @@
+/* Regression test - in assembly language, # may have some significance
+ other than 'stringize macro argument' and therefore must be preserved
+ in the output, and should not be warned about. */
+
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+#define foo() mov r0, #5 /* { dg-bogus "not followed" "spurious warning" } */
+
+entry:
+ foo()
+
+/* Check we don't EOF on an unknown directive. */
+#unknown directive
+#error a later diagnostic /* { dg-error "diagnostic" } */
+
+/*
+ { dg-final { if ![file exists 20000510-1.i] { return } } }
+ { dg-final { set tmp [grep 20000510-1.i # line] } }
+ { dg-final { if {[string length $tmp] > 0} \{ } }
+ { dg-final { pass "20000510-1.S: # preservation" } }
+ { dg-final { \} else \{ } }
+ { dg-final { fail "20000510-1.S: # preservation" } }
+ { dg-final { \} } }
+*/
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert1.c
new file mode 100644
index 000000000..d1446105c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert1.c
@@ -0,0 +1,46 @@
+/* Basic tests of the #assert preprocessor extension. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-deprecated" } */
+
+#define def unused expansion
+#define fail int fail
+
+#assert abc (def)
+#assert abc (ghi)
+#assert abc (jkl)
+#assert space ( s p a c e )
+
+/* Basic: */
+#if !#abc (def) || !#abc (ghi) || !#abc (jkl)
+fail
+#endif
+
+/* any answer for #abc */
+#if !#abc
+fail
+#endif
+
+/* internal whitespace is collapsed,
+ external whitespace is deleted */
+#if !#space (s p a c e) || !#space ( s p a c e ) || #space (space)
+fail
+#endif
+
+/* removing assertions */
+#unassert abc (jkl)
+#if !#abc || !#abc (def) || !#abc (ghi) || #abc (jkl)
+fail
+#endif
+
+#unassert abc
+#if #abc || #abc (def) || #abc (ghi) || #abc (jkl)
+fail
+#endif
+
+int gobble
+
+/* make sure it can succeed too.
+ also check space before open paren isn't significant */
+#if #space(s p a c e)
+;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert2.c
new file mode 100644
index 000000000..12b11b78e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert2.c
@@ -0,0 +1,24 @@
+/* Malformed assertion tests. */
+/* { dg-do preprocess } */
+/* { dg-options "-fshow-column -Wno-deprecated" } */
+
+#assert /* { dg-error "without predicate" "assert w/o predicate" } */
+#assert % /* { dg-error "9:an identifier" "assert punctuation" } */
+#assert 12 /* { dg-error "9:an identifier" "assert number" } */
+#assert abc /* { dg-error "9:missing" "assert w/o answer" } */
+
+#if # /* { dg-error "without predicate" "test w/o predicate" } */
+#endif
+
+#if #% /* { dg-error "6:an identifier" "test punctuation" } */
+#endif
+
+#if #12 /* { dg-error "6:an identifier" "test number" } */
+#endif
+
+#if #abc
+#error /* { dg-bogus "error" "test w/o answer" } */
+#endif
+
+#if #abc[def] /* { dg-error "9:is not valid" "test with malformed answer" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert3.c
new file mode 100644
index 000000000..9010ecebd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert3.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-A abc=def -A abc\(ghi\) \"-Aabc = jkl\" -A abc=mno -A -abc=mno -Wno-deprecated" } */
+
+/* Test -A command line syntax. Source Neil Booth. 31 Oct 2000. */
+
+#if !#abc (def) || !#abc (ghi) || !#abc (jkl) || #abc(mno)
+#error Command line -A assertions
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert4.c
new file mode 100644
index 000000000..92e3dba5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/assert4.c
@@ -0,0 +1,384 @@
+/* Copyright (C) 2003, 2006, 2008, 2009, 2011, 2012
+ Free Software Foundation, Inc.
+
+ Test builtin preprocessor assertions.
+ By Kaveh Ghazi <ghazi@caip.rutgers.edu>. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-ansi -Wno-deprecated" } */
+
+/* Check for #system assertions. */
+
+#if defined __linux__
+# if !#system(linux) || !#system(unix) || !#system(posix)
+# error
+# endif
+#elif #system(linux)
+# error
+#endif
+
+#if defined __gnu_hurd__
+# if !#system(gnu) || !#system(unix) || !#system(posix) || !#system(mach)
+# error
+# endif
+#elif #system(gnu)
+# error
+#endif
+
+#if defined __FreeBSD__
+# if !#system(FreeBSD) || !#system(unix) || !#system(bsd)
+# error
+# endif
+#elif #system(FreeBSD)
+# error
+#endif
+
+#if defined __NetBSD__
+# if !#system(NetBSD) || !#system(unix) || !#system(bsd)
+# error
+# endif
+#elif #system(NetBSD)
+# error
+#endif
+
+#if defined __OpenBSD__
+# if !#system(OpenBSD) || !#system(unix) || !#system(bsd)
+# error
+# endif
+#elif #system(OpenBSD)
+# error
+#endif
+
+#if defined __svr4__ || defined __SYSTYPE_SVR4__
+# if !#system(svr4) || !#system(unix)
+# error
+# endif
+#elif #system(svr4)
+# error
+#endif
+
+#if defined __hpux__
+# if !#system(hpux) || !#system(unix)
+# error
+# endif
+#elif #system(hpux)
+# error
+#endif
+
+#if defined _AIX
+# if !#system(aix) || !#system(unix)
+# error
+# endif
+#elif #system(aix)
+# error
+#endif
+
+#if defined __lynx__
+# if !#system(lynx) || !#system(unix)
+# error
+# endif
+#elif #system(lynx)
+# error
+#endif
+
+#if ( defined __unix__ && !defined __CYGWIN__ ) || defined _AIX \
+ || defined __vxworks
+# if !#system(unix)
+# error
+# endif
+#elif #system(unix)
+# error
+#endif
+
+#if defined __rtems__
+# if !#system(rtems)
+# error
+# endif
+#elif #system(rtems)
+# error
+#endif
+
+#if defined __vms__
+# if !#system(vms)
+# error
+# endif
+#elif #system(vms)
+# error
+#endif
+
+#if defined __mvs__
+# if !#system(mvs)
+# error
+# endif
+#elif #system(mvs)
+# error
+#endif
+
+#if defined __MSDOS__
+# if !#system(msdos)
+# error
+# endif
+#elif #system(msdos)
+# error
+#endif
+
+#if defined __WINNT__ || defined __CYGWIN__
+# if !#system(winnt)
+# error
+# endif
+#elif #system(winnt)
+# error
+#endif
+
+
+/* Check for #cpu and #machine assertions. */
+
+#if defined __alpha__
+# if !#cpu(alpha) || !#machine(alpha) \
+ || (defined __alpha_cix__ && !#cpu(cix)) \
+ || (!defined __alpha_cix__ && #cpu(cix)) \
+ || (defined __alpha_fix__ && !#cpu(fix)) \
+ || (!defined __alpha_fix__ && #cpu(fix)) \
+ || (defined __alpha_bwx__ && !#cpu(bwx)) \
+ || (!defined __alpha_bwx__ && #cpu(bwx)) \
+ || (defined __alpha_max__ && !#cpu(max)) \
+ || (!defined __alpha_max__ && #cpu(max)) \
+ || (defined __alpha_ev6__ && !#cpu(ev6)) \
+ || (!defined __alpha_ev6__ && #cpu(ev6)) \
+ || (defined __alpha_ev5__ && !#cpu(ev5)) \
+ || (!defined __alpha_ev5__ && #cpu(ev5)) \
+ || (defined __alpha_ev4__ && !#cpu(ev4)) \
+ || (!defined __alpha_ev4__ && #cpu(ev4))
+# error
+# endif
+#elif #cpu(alpha) || #machine(alpha) || #cpu(cix) || #cpu(fix) || #cpu(bwx) \
+ || #cpu(max) || #cpu(ev6) || #cpu(ev5) || #cpu(ev4)
+# error
+#endif
+
+#if defined __arm__
+# if !#cpu(arm) || !#machine(arm)
+# error
+# endif
+#elif #cpu(arm) || #machine(arm)
+# error
+#endif
+
+#if defined __cris__
+# if !#cpu(cris) || !#machine(cris)
+# error
+# endif
+#elif #cpu(cris) || #machine(cris)
+# error
+#endif
+
+#if defined __fr30__
+# if !#cpu(fr30) || !#machine(fr30)
+# error
+# endif
+#elif #cpu(fr30) || #machine(fr30)
+# error
+#endif
+
+#if defined __frv__
+# if !#cpu(frv) || !#machine(frv)
+# error
+# endif
+#elif #cpu(frv) || #machine(frv)
+# error
+#endif
+
+#if defined __H8300__
+# if !#cpu(h8300) || !#machine(h8300) \
+ || (defined __H8300__ && (!#cpu(h8300) || !#machine(h8300))) \
+ || (defined __H8300H__ && (!#cpu(h8300h) || !#machine(h8300h))) \
+ || (!defined __H8300H__ && (#cpu(h8300h) || #machine(h8300h))) \
+ || (defined __H8300S__ && (!#cpu(h8300s) || !#machine(h8300s))) \
+ || (!defined __H8300S__ && (#cpu(h8300s) || #machine(h8300s)))
+# error
+# endif
+#elif #cpu(h8300) || #machine(h8300) || #cpu(h8300h) || #machine(h8300h) || \
+ #cpu(h8300s) || #machine(h8300s)
+# error
+#endif
+
+#if defined __hppa__
+# if !#cpu(hppa) || !#machine(hppa)
+# error
+# endif
+#elif #cpu(hppa) || #machine(hppa)
+# error
+#endif
+
+#if defined __i370__
+# if !#cpu(i370) || !#machine(i370)
+# error
+# endif
+#elif #cpu(i370) || #machine(i370)
+# error
+#endif
+
+#if defined __x86_64__
+# if !#cpu(x86_64) || !#machine(x86_64)
+# error
+# endif
+#elif #cpu(x86_64) || #machine(x86_64)
+# error
+#endif
+
+#if defined __i386__
+# if !#cpu(i386) || !#machine(i386)
+# error
+# endif
+#elif #cpu(i386) || #machine(i386)
+# error
+#endif
+
+#if defined __ia64__
+# if !#cpu(ia64) || !#machine(ia64)
+# error
+# endif
+#elif #cpu(ia64) || #machine(ia64)
+# error
+#endif
+
+#if defined __iq2000__
+# if !#cpu(iq2000) || !#machine(iq2000)
+# error
+# endif
+#elif #cpu(iq2000) || #machine(iq2000)
+# error
+#endif
+
+#if defined __M32R__
+# if !#cpu(m32r) || !#machine(m32r)
+# error
+# endif
+#elif #cpu(m32r) || #machine(m32r)
+# error
+#endif
+
+#if defined __m68k__
+# if !#cpu(m68k) || !#machine(m68k)
+# error
+# endif
+#elif #cpu(m68k) || #machine(m68k)
+# error
+#endif
+
+#if defined __mcore__
+# if !#cpu(mcore) || !#machine(mcore)
+# error
+# endif
+#elif #cpu(mcore) || #machine(mcore)
+# error
+#endif
+
+#if defined __mips__
+# if !#cpu(mips)
+# error
+# endif
+#elif #cpu(mips) || #machine(mips)
+# error
+#endif
+
+#if defined __mn10300__
+# if !#cpu(mn10300) || !#machine(mn10300)
+# error
+# endif
+#elif #cpu(mn10300) || #machine(mn10300)
+# error
+#endif
+
+#if defined __pdp11__
+# if !#cpu(pdp11) || !#machine(pdp11)
+# error
+# endif
+#elif #cpu(pdp11) || #machine(pdp11)
+# error
+#endif
+
+#if defined __powerpc__ || defined __PPC__
+# if defined __powerpc64__
+# if (#cpu(powerpc) || #machine(powerpc) \
+ || !#cpu(powerpc64) || !#machine(powerpc64))
+# error
+# endif
+# else
+# if (!#cpu(powerpc) || !#machine(powerpc) \
+ || #cpu(powerpc64) || #machine(powerpc64))
+# error
+# endif
+# endif
+#elif (#cpu(powerpc) || #machine(powerpc) \
+ || #cpu(powerpc64) || #machine(powerpc64))
+# error
+#endif
+
+#if defined __rs6000__
+# if !#cpu(rs6000) || !#machine(rs6000)
+# error
+# endif
+#elif #cpu(rs6000) || #machine(rs6000)
+# error
+#endif
+
+#if defined __s390__
+# if !#cpu(s390) || !#machine(s390)
+# error
+# endif
+#elif #cpu(s390) || #machine(s390)
+# error
+#endif
+
+#if defined __sh__
+# if !#cpu(sh) || !#machine(sh)
+# error
+# endif
+#elif #cpu(sh) || #machine(sh)
+# error
+#endif
+
+#if defined __sparc__
+# if (defined __arch64__ \
+ && (!#cpu(sparc64) || !#machine(sparc64) || #cpu(sparc) || #machine(sparc)))
+ || (!defined __arch64__ \
+ && (#cpu(sparc64) || #machine(sparc64) || !#cpu(sparc) || !#machine(sparc)))
+# error
+# endif
+#elif #cpu(sparc64) || #machine(sparc64) || #cpu(sparc) || #machine(sparc)
+# error
+#endif
+
+#if defined __xstormy16__
+# if !#cpu(xstormy16) || !#machine(xstormy16)
+# error
+# endif
+#elif #cpu(xstormy16) || #machine(xstormy16)
+# error
+#endif
+
+#if defined __v850__
+# if !#cpu(v850) || !#machine(v850)
+# error
+# endif
+#elif #cpu(v850) || #machine(v850)
+# error
+#endif
+
+#if defined __vax__
+# if !#cpu(vax) || !#machine(vax)
+# error
+# endif
+#elif #cpu(vax) || #machine(vax)
+# error
+#endif
+
+#if defined __XTENSA__
+# if !#cpu(xtensa) || !#machine(xtensa)
+# error
+# endif
+#elif #cpu(xtensa) || #machine(xtensa)
+# error
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c
new file mode 100644
index 000000000..3591f9c08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/avoidpaste1.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-ansi" } */
+
+/* This tests that we avoid accidental pasting only before and after
+ macros and arguments, and not when the tokens are already pasted
+ in the souce file (e.g. "::" in a C source file).
+
+ Neil Booth, 28 Jan 2001. */
+
+#define f(x) x
+#define g
+#define tricky 1.0e ## -1
+
+/* This should preprocess as
+
+:: : : : : :^: 1.0e- 1
+: : : .. . 0 0 .
+
+It relies on the fact that even when preprocessing C we bother to separate
+the colons of C++'s :: operator. If we confine this behavior to C++
+in future, this test needs to change. */
+
+:: :g: :f(): :f(^): tricky
+:f(:): .. .__INCLUDE_LEVEL__ __INCLUDE_LEVEL__. /* Check builtins, too. */
+
+/* { dg-final { scan-file avoidpaste1.i ":: : : : : :\\^: 1.0e- 1" } }
+ { dg-final { scan-file avoidpaste1.i ": : : \\\.\\\. \\\. 0 0 \\\." } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/avoidpaste2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/avoidpaste2.c
new file mode 100644
index 000000000..dc5bbc7f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/avoidpaste2.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-ansi" } */
+
+/* This tests that we avoid accidental pasting, as well as gratuitous
+ space insertion, in various nasty places _inside_ a macro's
+ replacement list: on either side of a paste, and on either side of
+ an argument. It also tests that we don't pass empty macro leading
+ whitespace to the next line - this problem use to break Emacs
+ preprocessor abuse.
+
+ Neil Booth, 1 Feb 2001. */
+
+#define EMPTY_WITH_LEADING_SPACE
+#define f(x, y) :x: -y##> -##y>
+#define g(x, y) :x: :y##2 2##y:
+
+/* This should preprocess as
+
+: : : - > - >
+:2: :22 22:
+
+We used to get a space at the start of the line. */
+
+ EMPTY_WITH_LEADING_SPACE
+f(:,)
+g(2, 2)
+
+/* { dg-final { scan-file avoidpaste2.i "(^|\\n): : : - > - >" } }
+ { dg-final { scan-file avoidpaste2.i "(^|\\n):2: :22 22:" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/backslash.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/backslash.c
new file mode 100644
index 000000000..f1b094a0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/backslash.c
@@ -0,0 +1,21 @@
+/* Test backslash newline with and without trailing spaces. */
+
+#define alpha(a, b, c) \
+ a, \
+ b, \
+ c
+
+/* Note the trailing whitespace on the next three lines. */
+#define beta(a, b, c) \
+ a, \
+ b, \
+ c
+
+/* { dg-warning "separated by space" "space" { target *-*-* } 9 } */
+/* { dg-warning "separated by space" "tab" { target *-*-* } 10 } */
+/* { dg-warning "separated by space" "space and tab" { target *-*-* } 11 } */
+
+int x[] = {
+ alpha(1, 2, 3),
+ beta(4, 5, 6)
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/backslash2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/backslash2.c
new file mode 100644
index 000000000..65142d930
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/backslash2.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test warnings for backslash-space-newline.
+ Source: Neil Booth. 6 Dec 2000. */
+
+foo \
+bar
+/* { dg-warning "separated by space" "" { target *-*-* } 8 } */
+
+/* foo \
+ bar */
+/* { dg-bogus "separated by space" "" { target *-*-* } 12 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c89-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c89-pedantic.c
new file mode 100644
index 000000000..3b7f6dd02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c89-pedantic.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c89 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=c89 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "long long" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c89.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c89.c
new file mode 100644
index 000000000..8c5fd28a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c89.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c89" } */
+
+/* This file is for testing the preprocessor in -std=c89 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-empty-macro-args.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-empty-macro-args.c
new file mode 100644
index 000000000..e90f8e6cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-empty-macro-args.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -pedantic" } */
+
+#define f(a,b) f2(a,,b)
+#define f2(a,b,c) a; b; c;
+#define f3(a) a
+
+#define g() p()
+
+void p(void) {}
+
+
+void foo(void)
+{
+ f(p(),p()); /* { dg-warning "macro f2 argument 2: empty macro arguments are undefined" } */
+ f2(p(),,p()); /* { dg-warning "macro f2 argument 2: empty macro arguments are undefined" } */
+ f3(); /* { dg-warning "macro f3 argument 1: empty macro arguments are undefined" } */
+ g();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-if-comma-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-if-comma-1.c
new file mode 100644
index 000000000..c00403f16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-if-comma-1.c
@@ -0,0 +1,11 @@
+/* Test for commas in constant expressions in #if: not permitted in C90
+ but permitted in unevaluated subexpressions in C99. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#if (1, 2) /* { dg-error "comma" "evaluated comma" } */
+#endif
+
+#if 1 || (1, 2) /* { dg-error "comma" "unevaluated comma" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-pedantic.c
new file mode 100644
index 000000000..3d6c82fc8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90-pedantic.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c90 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=c90 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "long long" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90.c
new file mode 100644
index 000000000..d8656c364
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c90.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c90" } */
+
+/* This file is for testing the preprocessor in -std=c90 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c94-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c94-pedantic.c
new file mode 100644
index 000000000..1c1216449
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c94-pedantic.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:199409 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=iso9899:199409
+ -pedantic mode. Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "long long" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c94.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c94.c
new file mode 100644
index 000000000..d7a5e75da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c94.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:199409" } */
+
+/* This file is for testing the preprocessor in -std=iso9899:199409 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c
new file mode 100644
index 000000000..e1e0c61ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic" } */
+
+#define f(a,b) f2(a,,b)
+#define f2(a,b,c) a; b; c;
+#define f3(a) a
+
+#define g() p()
+
+void p(void) {}
+
+
+void foo(void)
+{
+ f(p(),p());
+ f2(p(),,p());
+ f3();
+ g();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c
new file mode 100644
index 000000000..44c49c995
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-hexfloat-3.c
@@ -0,0 +1,6 @@
+/* Test for hex floating point constants: in C99 only. Compiler test. */
+/* Origin: Michael Matz <matz@suse.de> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+double d = 0x.2p2; /* { dg-bogus "radix 16" "bogus C99 hex float error" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-if-comma-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-if-comma-1.c
new file mode 100644
index 000000000..cb8eb6f73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-if-comma-1.c
@@ -0,0 +1,11 @@
+/* Test for commas in constant expressions in #if: not permitted in C90
+ but permitted in unevaluated subexpressions in C99. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#if (1, 2) /* { dg-error "comma" "evaluated comma" } */
+#endif
+
+#if 1 || (1, 2)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-pedantic.c
new file mode 100644
index 000000000..0128a323c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99-pedantic.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=c99 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99.c
new file mode 100644
index 000000000..b74ff6387
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/c99.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99" } */
+
+/* This file is for testing the preprocessor in -std=c99 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-2.c
new file mode 100644
index 000000000..59fa500e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-2.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-fsigned-char" } */
+
+/* Crosscompiling from i686-linux (32-bit) to x86_64-linux (64-bit)
+ gave extra warnings on the two assignments:
+ warning: large integer implicitly truncated to unsigned type
+ warning: overflow in implicit constant conversion
+ This test has been added as a regression test after fixing the bug
+ by Andreas Jaeger, 23 Nov 2001. */
+int
+main (void)
+{
+ signed char c = '\xff';
+ unsigned char d = '\xff';
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-3.c
new file mode 100644
index 000000000..7c1966391
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-3.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options -Wno-multichar } */
+
+/* This tests values and signedness of multichar charconsts.
+
+ Neil Booth, 5 May 2002. */
+
+#include <limits.h>
+
+extern void abort (void);
+
+int main ()
+{
+ /* These tests require at least 2-byte ints. 8-) */
+#if INT_MAX > 127
+ int scale = (int) (unsigned char) -1 + 1;
+
+ if ('ab' != (int) ((unsigned char) 'a' * scale + (unsigned char) 'b'))
+ abort ();
+
+ if ('\234b' != (int) ((unsigned char) '\234' * scale + (unsigned char) 'b'))
+ abort ();
+
+ if ('b\234' != (int) ((unsigned char) 'b' * scale + (unsigned char) '\234'))
+ abort ();
+ /* Multichar charconsts have type int and should be signed. */
+#if INT_MAX == 32767
+# if '\234a' > 0
+# error Preprocessor charconsts 1
+# endif
+ if ('\234a' > 0)
+ abort ();
+#elif INT_MAX == 2147483647
+# if '\234aaa' > 0
+# error Preprocessor charconsts 2
+# endif
+ if ('\234aaa' > 0)
+ abort ();
+#elif INT_MAX == 9223372036854775807
+# if '\234aaaaaaa' > 0
+# error Preprocessor charconsts 3
+# endif
+ if ('\234aaaaaaa' > 0)
+ abort ();
+#endif
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-4.c
new file mode 100644
index 000000000..aae33d35e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst-4.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-multichar -fsigned-char" } */
+
+/* This tests how overly-long multichar charconsts are truncated, and
+ whether "short" multichar charconsts are incorrectly sign extended
+ (regardless of char signedness). Preprocessor is used so that we
+ have only one place where the too long warning is generated, so
+ that the test works for all targets.
+
+ Neil Booth, 8 May 2002. */
+
+#include <limits.h>
+
+extern void abort (void);
+
+#if INT_MAX == 32767
+# define LONG_CHARCONST '!\234a'
+# define SHORT_CHARCONST '\234a'
+# define POS_CHARCONST '\1'
+#elif INT_MAX == 2147483647
+# define LONG_CHARCONST '!\234abc'
+# define SHORT_CHARCONST '\234abc'
+# define POS_CHARCONST '\234a'
+#elif INT_MAX == 9223372036854775807
+# define LONG_CHARCONST '!\234abcdefg'
+# define SHORT_CHARCONST '\234abcdefg'
+# define POS_CHARCONST '\234a'
+#else
+/* Target int size not handled, do something that won't fail. */
+# define LONG_CHARCONST '\234a'
+# define SHORT_CHARCONST '\234a'
+# define POS_CHARCONST '\1'
+#endif
+
+#if POS_CHARCONST < 0
+# error Charconst incorrectly sign-extended
+#endif
+
+#if LONG_CHARCONST != SHORT_CHARCONST /* { dg-warning "too long" "" } */
+# error Overly long charconst truncates wrongly for preprocessor
+#endif
+
+int main ()
+{
+ if (POS_CHARCONST < 0)
+ abort ();
+ if (LONG_CHARCONST != SHORT_CHARCONST) /* { dg-warning "too long" "" } */
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst.c
new file mode 100644
index 000000000..8934d6a67
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/charconst.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+/* This tests various diagnostics about character constants, for both
+ the preprocessor and the compiler.
+
+ Neil Booth, 22 May 2001. */
+
+#if '' /* { dg-error "empty" "empty charconst" } */
+#endif
+#if L'' /* { dg-error "empty" "empty wide charconst" } */
+#endif
+#if 'very long' /* { dg-warning "too long" "long charconst" } */
+#endif
+#if L'very long' /* { dg-warning "too long" "long wide charconst" } */
+#endif
+/* Don't do this test for L'ab'; it depends upon sizeof (wchar_t). */
+#if 'ab' /* { dg-warning "multi-char" "multi-character" } */
+#endif
+
+void foo ()
+{
+ int c;
+ __WCHAR_TYPE__ w;
+
+ c = ''; /* { dg-error "empty" "empty charconst" } */
+ w = L''; /* { dg-error "empty" "empty wide charconst" } */
+
+ c = 'very long'; /* { dg-warning "too long" "long charconst" } */
+ w = L'very long'; /* { dg-warning "too long" "long wide charconst" } */
+
+ c = 'ab'; /* { dg-warning "multi-char" "multi-char" } */
+ /* Wide charconsts cannot contain more than one wide character. */
+ w = L'ab'; /* { dg-warning "too long" "multi-char wide" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C.c
new file mode 100644
index 000000000..2dafec253
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options -C } */
+
+/* Test -C doesn't fail with #define. #define is the tricky case,
+ being the only directive that remembers its comments.
+
+ -C treats comments as tokens in their own right, so e.g. comment at
+ the beginning of a directive turns it into a non-directive. */
+
+#define simple no comments
+
+#define/**/obj_like/**/(some)/**/thing/**/
+#define fun_like(/**/x/**/,/**/y/**/)/**/
+/**/#define not_a_macro
+
+#if !defined simple || !defined obj_like || !defined fun_like
+#error Missed some macros with -C
+#endif
+
+#ifdef not_a_macro
+#error not_a_macro is!
+#endif
+
+/* Check obj_like doesn't expect arguments, and fun_like does. */
+obj_like
+fun_like (foo, bar)
+
+/* Check OK to redefine fun_like without comments in the params. */
+#define fun_like(x, y)/**/
+
+/* Check comments in macros in directives are OK. */
+#define ZERO 0 /* A trailing comment. */
+
+#if ZERO
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C2.c
new file mode 100644
index 000000000..be046704c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C2.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-C" } */
+
+/* This tests that C++ comments are either dropped, or converted to C
+ comments in macro expansions. The + in the regexp stops it from
+ matching itself 8-)
+
+ Neil Booth, 9 Oct 2001. */
+
+#define ZERO 0 // A comment
+
+ZERO:
+
+/* { dg-final { scan-file-not cmdlne-C2.i "c+omment:" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C3.c
new file mode 100644
index 000000000..86a942216
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-C3.c
@@ -0,0 +1,13 @@
+/* { dg-do preprocess } */
+/* { dg-options "-C -P" } */
+
+#define macro(X) X
+
+macro(
+// Comment1
+x
+// Comment2
+);
+
+/* { dg-final { scan-file cmdlne-C3.i "\\\*\\\/ x \\\/\\\*" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2#.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2#.h
new file mode 100644
index 000000000..40a8c178f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2#.h
@@ -0,0 +1 @@
+/* empty */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2.c
new file mode 100644
index 000000000..6479822f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M-2.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-M" } */
+
+/* Test that dependency output suppresses warnings by implying -w. */
+
+#include "#cmdlne-M-2.h"
+#include "cmdlne-M-2#.h"
+
+/* { dg-final { scan-file cmdlne-M-2.i "(^|\\n)cmdlne-M-2.o:" } }
+ { dg-final { scan-file cmdlne-M-2.i "cmdlne-M-2.c" } }
+ { dg-final { scan-file cmdlne-M-2.i "\\\\#cmdlne-M-2.h" } }
+ { dg-final { scan-file cmdlne-M-2.i "cmdlne-M-2\\\\#.h" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M.c
new file mode 100644
index 000000000..4eb6407cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-M.c
@@ -0,0 +1,8 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-M" } */
+
+/* Test that dependency output suppresses warnings by implying -w. */
+
+#warning bogus /* { dg-bogus "warning" "warning not suppressed" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-P.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-P.c
new file mode 100644
index 000000000..faadf9fbf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-P.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-P" } */
+
+/* Test that we don't stair-step output with -P. Source: Neil Booth,
+ 18 Dec 2000. */
+
+int x = 1;
+
+/* { dg-final { scan-file cmdlne-P.i "(^|\n)int x = 1;($|\n)" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c
new file mode 100644
index 000000000..d1a3b8f09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-M.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dD -M" } */
+
+/* Test -dD -M does not fail. It should print just
+ the Makefile rule with dependencies. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { scan-file-not cmdlne-dD-M.i "(^|\\n)#define foo bar($|\\n)" } }
+ { dg-final { scan-file-not cmdlne-dD-M.i "variable" } }
+ { dg-final { scan-file cmdlne-dD-M.i "(^|\n)cmdlne-dD-M\[^\\n\]*:( *\\\\\\n)?\[^\\n\]*cmdlne-dD-M.c" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-dM.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-dM.c
new file mode 100644
index 000000000..9e3c732d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD-dM.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dD -dM" } */
+
+/* Test -dD -dM does not fail. It should give the same output
+ as plain -dM. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { scan-file cmdlne-dD-dM.i "(^|\\n)#define foo bar($|\\n)" } }
+ { dg-final { scan-file-not cmdlne-dD-dM.i "variable" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD.c
new file mode 100644
index 000000000..59d521195
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dD.c
@@ -0,0 +1,12 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options -dD } */
+
+/* Test -dD does not fail. */
+
+#define objlike obj like
+#define funlike(like) fun like
+#define funlike2(fun, like) fun ## like
+#define varargs(x, ...) x #x __VA_ARGS__
+#define gnu_varargs(x, y...) x ## y
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-C.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-C.c
new file mode 100644
index 000000000..6b4bfee22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-C.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc. */
+/* PR 13726 */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dI -C" } */
+
+#include "cmdlne-dI-C.h" /* #include comment */
+/* comment 2 */
+
+/* { dg-final { scan-file cmdlne-dI-C.i "#include c+omment" } } */
+/* { dg-final { scan-file cmdlne-dI-C.i "header file c+omment" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-C.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-C.h
new file mode 100644
index 000000000..5021488e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-C.h
@@ -0,0 +1 @@
+/* header file comment */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c
new file mode 100644
index 000000000..db08a72b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dI -M" } */
+
+/* Test -dI -M does not fail. It should print just
+ the Makefile rule with dependencies. */
+
+#define foo bar
+#include "cmdlne-dI-M.h"
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { scan-file-not cmdlne-dI-M.i "(^|\\n)#define foo bar($|\\n)" } }
+ { dg-final { scan-file-not cmdlne-dI-M.i "variable" } }
+ { dg-final { scan-file cmdlne-dI-M.i "(^|\\n)cmdlne-dI-M\[^\\n\]*:( *\\\\\\n)?\[^\\n\]*cmdlne-dI-M.c" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.h
new file mode 100644
index 000000000..cbaf810a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.h
@@ -0,0 +1,2 @@
+#define baz baz
+int othervar;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c
new file mode 100644
index 000000000..0cd901104
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dM -M" } */
+
+/* Test -dM -M does not fail. It should print both the
+ #define lines and a Makefile rule with dependencies. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)#define foo bar($|\\n)" } }
+ { dg-final { scan-file-not cmdlne-dM-M.i "variable" } }
+ { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)cmdlne-dM-M\[^\\n\]*:( *\\\\\\n)?\[^\\n\]*cmdlne-dM-M.c"} } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-dD.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-dD.c
new file mode 100644
index 000000000..66ec7dd9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-dD.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dM -dD" } */
+
+/* Test -dM -dD does not fail. It should give the same output
+ as plain -dD. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { scan-file cmdlne-dM-dD.i "(^|\\n)#define foo bar($|\\n)" } }
+ { dg-final { scan-file cmdlne-dM-dD.i "variable" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM.c
new file mode 100644
index 000000000..98660f8f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dM.c
@@ -0,0 +1,12 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options -dM } */
+
+/* Test -dM does not fail. */
+
+#define objlike obj like
+#define funlike(like) fun like
+#define funlike2(fun, like) fun ## like
+#define varargs(x, ...) x #x #__VA_ARGS__ __VA_ARGS__
+#define gnu_varargs(x, y...) #y x ## y y
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dN-M.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dN-M.c
new file mode 100644
index 000000000..2182e370c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dN-M.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dN -M" } */
+
+/* Test -dN -M does not fail. It should print just
+ the Makefile rule with dependencies. */
+
+#define foo bar
+#define funlike(like) fun like
+int variable;
+
+/* { dg-final { scan-file-not cmdlne-dN-M.i "(^|\\n)#define foo" } }
+ { dg-final { scan-file-not cmdlne-dN-M.i "variable" } }
+ { dg-final { scan-file cmdlne-dN-M.i "(^|\\n)cmdlne-dN-M\[^\\n\]*:( *\\\\\\n)?\[^\\n\]*cmdlne-dN-M.c" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-1.c
new file mode 100644
index 000000000..129e48bf8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-1.c
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-1.i "^\n*#undef A\n*$" } } */
+#ifdef A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-10.c
new file mode 100644
index 000000000..31398a762
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-10.c
@@ -0,0 +1,7 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-10.i "^\n*C\n+#define B C\n+#define A B\n*$" } } */
+/* This file deliberately has no final newline. */
+#define A B
+#define B C
+A
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-11.c
new file mode 100644
index 000000000..1c0128bb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-11.c
@@ -0,0 +1,7 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-11.i "^\n*\n*$" } } */
+#define A B
+#if 0
+A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-12.c
new file mode 100644
index 000000000..54620a57e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-12.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-12.i "^\n*#define A 1\n*$" } } */
+#define A 1
+#if A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-13.c
new file mode 100644
index 000000000..45ce532b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-13.c
@@ -0,0 +1,7 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-13.i "^\n*#undef A\n*$" } } */
+#ifdef A
+#endif
+#ifdef A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-14.c
new file mode 100644
index 000000000..4fe96a4d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-14.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-14.i "^\n*B\n+#define A B\n+B\n*$" } } */
+#define A B
+A
+A
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-15.c
new file mode 100644
index 000000000..2df0b62f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-15.c
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-15.i "^\n*\n*$" } } */
+#if A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-16.c
new file mode 100644
index 000000000..41a9a9110
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-16.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-options "-nostdinc -P -dU -std=c89" { target *-*-solaris2.* } } */
+/* { dg-final { scan-file cmdlne-dU-16.i "^\n*#define __STDC__ 1\n*$" } } */
+#ifdef __STDC__
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-17.c
new file mode 100644
index 000000000..fd608e1d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-17.c
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-options "-nostdinc -P -dU -std=c89" { target *-*-solaris2.* } } */
+/* { dg-final { scan-file cmdlne-dU-17.i "^\n*1\n+#define __STDC__ 1\n*$" } } */
+__STDC__
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-18.c
new file mode 100644
index 000000000..97104845d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-18.c
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-18.i "^\n*x 1 y\n+#define A 1\n*$" } } */
+#define A 1
+x A y
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-19.c
new file mode 100644
index 000000000..c6c3af356
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-19.c
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-19.i "^\n*B\n+#define A B\n+#undef A\n*$" } } */
+#define A B
+A
+#undef A
+#ifdef A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-2.c
new file mode 100644
index 000000000..dffdd2ba9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-2.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-2.i "^\n*#define A *\n*$" } } */
+#define A
+#ifdef A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-20.c
new file mode 100644
index 000000000..065b807ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-20.c
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-20.i "^\n*A B\n*$" } } */
+#define A(x) x
+A B
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-21.c
new file mode 100644
index 000000000..1fefe542c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-21.c
@@ -0,0 +1,9 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-21.i "^\n*hello There\n+#define ASTRING There\n+#define MACROARGS\\(A\\) A\n+#undef BSTRING\n*$" } } */
+#define ASTRING There
+#define MACROARGS(A) A
+MACROARGS(hello) ASTRING
+#ifdef BSTRING
+bye
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-22.c
new file mode 100644
index 000000000..fe100ceb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-22.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-22.i "^\n*#undef AAA\n+AAA is undefined\n+#undef BBB\n+BBB is undefined\n+#undef CCC\n+CCC is undefined\n*$" } } */
+#ifndef AAA
+AAA is undefined
+#endif
+
+#ifndef BBB
+BBB is undefined
+#endif
+
+#ifndef CCC
+CCC is undefined
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-23.c
new file mode 100644
index 000000000..c99a43b08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-23.c
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-P -dU" } */
+/* { dg-final { scan-file-not cmdlne-dU-23.i "__FILE__" } } */
+#ifdef __FILE__
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-3.c
new file mode 100644
index 000000000..a26fc9881
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-3.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-3.i "^\n*#define A B\n*$" } } */
+#define A B
+#ifndef A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-4.c
new file mode 100644
index 000000000..aa3d853a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-4.c
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-4.i "^\n*#undef A\n*$" } } */
+#if defined(A)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-5.c
new file mode 100644
index 000000000..bfae850de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-5.c
@@ -0,0 +1,7 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-5.i "^\n*#undef A\n*$" } } */
+#ifdef A
+#ifdef B
+#endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-6.c
new file mode 100644
index 000000000..e2c801df3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-6.c
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-6.i "^\n*#undef A\n+#define A *\n*$" } } */
+#ifdef A
+#endif
+#define A
+#ifdef A
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-7.c
new file mode 100644
index 000000000..030917844
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-7.c
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-7.i "^\n*B\n+#define A B\n+C\n+#define A C\n*$" } } */
+#define A B
+A
+#undef A
+#define A C
+A
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-8.c
new file mode 100644
index 000000000..da97fabed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-8.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-8.i "^\n*B D\n+#define A\\(x\\) B x\n+#define C D\n*$" } } */
+#define A(x) B x
+#define C D
+A(C)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-9.c
new file mode 100644
index 000000000..bd0f0edfe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cmdlne-dU-9.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -P -dU" } */
+/* { dg-final { scan-file cmdlne-dU-9.i "^\n*C\n+#define B C\n+#define A B\n*$" } } */
+#define A B
+#define B C
+A
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c
new file mode 100644
index 000000000..80d8b7892
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-1.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 2007 Free Software Foundation
+ Contributed by Ollie Wild <aaw@google.com> */
+
+/* { dg-do preprocess } */
+
+/* Tests __COUNTER__ macro is correctly expanded. */
+
+#define counter __COUNTER__
+
+#if __COUNTER__ != 0
+#error __COUNTER__ != 0
+#endif
+
+#if counter != 1
+#error counter != 1
+#endif
+
+#if __COUNTER__ != 2
+#error __COUNTER__ != 2
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-2.c
new file mode 100644
index 000000000..7d6578d9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-2.c
@@ -0,0 +1,14 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+/* { dg-do preprocess } */
+/* { dg-options -fdirectives-only } */
+
+/* Tests __COUNTER__ macro expansion is disabled inside directives with
+ -fdirectives-only. */
+
+#ifdef __COUNTER__ /* Macro not expanded. */
+#endif
+
+#if __COUNTER__ == 0 /* { dg-error "__COUNTER__ expanded inside directive with -fdirectives-only" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-3.c
new file mode 100644
index 000000000..3b1824f25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/counter-3.c
@@ -0,0 +1,10 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fdirectives-only -fpreprocessed" } */
+
+/* Tests __COUNTER__ macro expansion is enabled outside directives with
+ -fdirectives-only. */
+
+int zero = __COUNTER__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cpp.exp b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cpp.exp
new file mode 100644
index 000000000..7dd65e569
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cpp.exp
@@ -0,0 +1,48 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# There's a bunch of headers we need.
+if [is_remote host] {
+ foreach header [glob -nocomplain $srcdir/$subdir/*.{h,def} ] {
+ remote_download host $header
+ }
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \
+ "" $DEFAULT_CFLAGS
+
+# C/C++ common tests.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/cpp/*.{c,S} ]] \
+ " -Wc++-compat " ""
+
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom1.c
new file mode 100644
index 000000000..8e254ff75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom1.c
@@ -0,0 +1,11 @@
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic -std=gnu89" } */
+
+/* You can't do this in your own code... */
+// C++ comment is not in C89 { dg-warning "style comment|reported only once" "good warning" }
+
+/* ...but we don't bitch about it more than once. */
+// C++ comment is not in C89 { dg-bogus "style comment" "bad warning" }
+
+/* { dg-final { scan-file-not cxxcom1.i "is not in C89" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom2.c
new file mode 100644
index 000000000..0dbb8f2fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom2.c
@@ -0,0 +1,7 @@
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic -std=c89 -Wall" } */
+
+#include "cxxcom2.h"
+
+/* { dg-final { scan-file-not cxxcom2.i "is not in C89" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom2.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom2.h
new file mode 100644
index 000000000..546b8fd92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/cxxcom2.h
@@ -0,0 +1,4 @@
+/* A system header may contain C++ comments irrespective of mode. */
+#pragma GCC system_header
+// C++ comment is not in C89 { dg-bogus "style comment" "bad warning" }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/defined.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/defined.c
new file mode 100644
index 000000000..9a60bdd5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/defined.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests behavior of the defined operator. */
+
+/* Source: Neil Booth, 29 Oct 2000, Zack Weinberg 11 Dec 2000. */
+
+#define defined /* { dg-error "defined" } */
+
+/* No diagnostics, though you could argue there should be. */
+#if defined defined
+#error defined is defined!
+#endif
+
+#define is_Z_defined defined Z
+
+#if defined Z
+#error Z is not defined
+#endif
+
+/* The behavior of "defined" when it comes from a macro expansion is
+ now documented. */
+#if is_Z_defined
+#error Macro expanding into defined operator test 1
+#endif
+
+#define Z
+
+#if !defined Z
+#error Z is defined
+#endif
+
+#if !is_Z_defined
+#error Macro expanding into defined operator test 2
+#endif
+
+#undef is_Z_defined
+#undef Z
+
+/* Do all the tests over again with the () form of defined. */
+
+/* No diagnostics, though you could argue there should be. */
+#if defined(defined)
+#error defined is defined!
+#endif
+
+#define is_Z_defined defined ( Z )
+
+#if defined(Z)
+#error Z is not defined
+#endif
+
+/* The behavior of "defined" when it comes from a macro expansion is
+ now documented. */
+#if is_Z_defined
+#error Macro expanding into defined operator test 1
+#endif
+
+#define Z
+
+#if !defined(Z)
+#error Z is defined
+#endif
+
+#if !is_Z_defined
+#error Macro expanding into defined operator test 2
+#endif
+
+/* Use of defined in different contexts. */
+
+#define bad1 defined
+#if !bad1 Z /* { dg-warning "may not be portable" } */
+#error Z is defined
+#endif
+
+#if !bad1 (Z) /* { dg-warning "may not be portable" } */
+#error Z is defined
+#endif
+
+#define bad2 defined (Z
+#if !bad2) /* { dg-warning "may not be portable" } */
+#error Z is defined
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraph1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraph1.c
new file mode 100644
index 000000000..e098d68da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraph1.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:199409" } */
+
+/* Just simple check that digraphs are on under c94, for both
+ preprocessor and compiler. digraphs.c is the general test. */
+
+%:define glue
+#ifndef glue
+#error glue not defined!
+#endif
+
+int main (int argc, char *argv<::>)
+<%
+ return 0;
+%>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraph2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraph2.c
new file mode 100644
index 000000000..293cafa49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraph2.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c89" } */
+
+/* Just simple check that digraphs are not on in c89, for both
+ preprocessor and compiler. digraphs.c is the general test. */
+
+int main (int argc, char *argv[])
+{
+ return 0;
+%> /* { dg-error "parse error|syntax error|expected" } */
+
+/* Place this after main () so we get to test both the compiler above
+ and the preprocessor below. */
+%:define glue /* { dg-error "expected declaration" } */
+#ifdef glue
+#error glue is defined!
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraphs.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraphs.c
new file mode 100644
index 000000000..49a1bcd86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/digraphs.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+/* Fully test the 6 digraphs under c99 assumptions. Four are pasted,
+ to check that digraph pasting works. */
+
+extern int strcmp (const char *, const char *);
+extern void abort (void);
+extern int puts (const char *);
+#define err(str) do { puts(str); abort(); } while (0)
+
+%:define glue(x, y) x %:%: y /* #define glue(x, y) x ## y. */
+#ifndef glue
+#error glue not defined!
+#endif
+%:define str(x) %:x /* #define str(x) #x */
+
+int main (int argc, char *argv<::>) /* argv[] */
+glue (<, %) /* { */
+ /* di_str[] = */
+ const char di_str glue(<, :)glue(:, >) = str(%:%:<::><%%>%:);
+
+ /* Check the glue macro actually pastes, and that the spelling of
+ all digraphs is preserved. */
+ if (glue(str, cmp) (di_str, "%:%:<::><%%>%:"))
+ err ("Digraph spelling not preserved!");
+
+ return 0;
+glue (%, >) /* } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-1.c
new file mode 100644
index 000000000..3c2261683
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-1.c
@@ -0,0 +1,73 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+/* { dg-do preprocess } */
+/* { dg-options -fdirectives-only } */
+
+/* Tests scan_translation_unit_directives_only()'s handling of corner cases. */
+
+/* Ignore directives inside block comments...
+#error directive inside block comment
+*/
+
+// Escaped newline doesn't terminate line comment \
+#error directive inside line comment
+
+/* A comment canot start inside a string. */
+const char *c1 = "/*";
+#define NOT_IN_COMMENT
+const char *c2 = "*/";
+#ifndef NOT_IN_COMMENT
+#error Comment started inside a string literal
+#endif
+
+/* Escaped newline handling. */
+int i; \
+#error ignored escaped newline
+ \
+ \
+#define BOL
+#ifndef BOL
+#error escaped newline did not preserve beginning of line
+#endif
+
+/* Handles \\ properly at the end of a string. */
+"string ends in \\"/*
+#error Missed string terminator.
+*/
+
+/* Handles macro expansion in preprocessing directives. */
+#define HEADER "dir-only-1.h"
+#include HEADER
+#ifndef GOT_HEADER
+#error Failed to include header.
+#endif
+
+/\
+*
+#define IN_COMMENT
+*/
+#ifdef IN_COMMENT
+#error Escaped newline breaks block comment initiator.
+#endif
+
+/*
+*\
+/
+#define NOT_IN_COMMENT2
+/**/
+#ifndef NOT_IN_COMMENT2
+#error Escaped newline breaks block comment terminator.
+#endif
+
+/* Test escaped newline inside character escape sequence. */
+"\\
+\"/*
+#error Missed string terminator
+*/
+
+/* Block comments don't mask trailing preprocessing
+ directive. */ #define NOT_MASKED
+#ifndef NOT_MASKED
+#error Comment masks trailing directive.
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-1.h
new file mode 100644
index 000000000..96dbcc048
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-1.h
@@ -0,0 +1,3 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+#define GOT_HEADER
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-2.c
new file mode 100644
index 000000000..489b4d6ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-2.c
@@ -0,0 +1,12 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fpreprocessed -fdirectives-only -DNOT_SET" } */
+
+/* Tests -fdirectives-only + -fpreprocessed. */
+
+/* Check this is not defined. */
+#ifdef NOT_SET
+#error Command line macro not disabled.
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3.c
new file mode 100644
index 000000000..e6eaa0180
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3.c
@@ -0,0 +1,13 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fdirectives-only -H" } */
+/* { dg-message "dir-only-3a\.h\n\[^\n\]*dir-only-3b\.h\n\[^\n\]*dir-only-3a\.h\n" "include guard check" { target *-*-* } 0 } */
+
+/* Tests include guards. */
+
+#include "dir-only-3a.h"
+#include "dir-only-3b.h"
+#include "dir-only-3b.h"
+#include "dir-only-3a.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3a.h
new file mode 100644
index 000000000..6644bbfb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3a.h
@@ -0,0 +1,8 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+extern int outside_guard
+
+#ifndef DIR_ONLY_3A_H
+#define DIR_ONLY_3A_H
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3b.h
new file mode 100644
index 000000000..4edaa7b6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-3b.h
@@ -0,0 +1,9 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+#ifndef DIR_ONLY_3B_H
+#define DIR_ONLY_3B_H
+
+extern int inside guard;
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-4.c
new file mode 100644
index 000000000..a7b5f048f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-4.c
@@ -0,0 +1,6 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fdirectives-only -Wunused-macros" } */
+/* { dg-error "-fdirectives-only is incompatible with -Wunused_macros\n" "-Wunused-macros check" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-5.c
new file mode 100644
index 000000000..643a4d7ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-5.c
@@ -0,0 +1,6 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fdirectives-only -traditional" } */
+/* { dg-error "-fdirectives-only is incompatible with -traditional\n" "-traditional check" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-6.c
new file mode 100644
index 000000000..0023205fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/dir-only-6.c
@@ -0,0 +1,7 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+ Contributed by Ollie Wild <aaw@google.com>. */
+
+/* { dg-do preprocess } */
+/* { dg-options -fdirectives-only } */
+
+/* { dg-error "unterminated comment" }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/direct2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/direct2.c
new file mode 100644
index 000000000..1ce40bfb5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/direct2.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com> */
+
+/* Test of prohibition on directives which result from macro expansion.
+ See also direct2s.c */
+
+/*
+ { dg-options "-ftrack-macro-expansion=0" }
+ { dg-do compile } */
+
+#define HASH #
+#define HASHDEFINE #define
+#define HASHINCLUDE #include
+
+HASH include "somerandomfile" /*{ dg-error "stray" "non-include" }*/
+/*{ dg-bogus "No such" "don't execute non-include" { target *-*-* } 15 }*/
+int resync_parser_1; /*{ dg-error "parse|syntax|expected" "" { target *-*-* } 15 }*/
+
+HASHINCLUDE <somerandomfile> /*{ dg-error "stray|expected" "non-include 2" }*/
+/*{ dg-bogus "No such" "don't execute non-include 2" { target *-*-* } 19 }*/
+int resync_parser_2;
+
+void g1 ()
+{
+HASH define X 1 /* { dg-error "stray|unknown|expected" "# from macro" } */
+ int resync_parser_3;
+}
+
+void g2 ()
+{
+HASHDEFINE Y 1 /* { dg-error "stray|unknown|expected" "#define from macro" } */
+ int resync_parser_4;
+}
+
+#pragma GCC dependency "direct2.c"
+#
+
+void f ()
+{
+ int i = X; /* { dg-error "undeclared|for each" "no macro X" } */
+ int j = Y; /* { dg-error "undeclared|for each" "no macro Y" } */
+}
+
+#define slashstar /##*
+#define starslash *##/
+
+slashstar starslash /* { dg-error "parse error|syntax error|expected" "not a comment" } */
+/* { dg-error "does not give" "paste warning(s)" { target *-*-* } 47 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/direct2s.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/direct2s.c
new file mode 100644
index 000000000..592321419
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/direct2s.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com> */
+
+/* Test of prohibition on directives which result from macro
+ expansion. Same as direct2.c, with -save-temps applied; results
+ should be identical. */
+
+/* { dg-do compile } */
+/* { dg-options "-save-temps -ansi -pedantic-errors -ftrack-macro-expansion=0" } */
+
+#define HASH #
+#define HASHDEFINE #define
+#define HASHINCLUDE #include
+
+HASH include "somerandomfile" /*{ dg-error "stray" "non-include" }*/
+/*{ dg-bogus "No such" "don't execute non-include" { target *-*-* } 15 }*/
+int resync_parser_1; /*{ dg-error "parse|syntax|expected" "" { target *-*-* } 15 }*/
+
+HASHINCLUDE <somerandomfile> /*{ dg-error "stray|expected" "non-include 2" }*/
+/*{ dg-bogus "No such" "don't execute non-include 2" { target *-*-* } 18 }*/
+int resync_parser_2;
+
+void g1 ()
+{
+HASH define X 1 /* { dg-error "stray|unknown|expected" "# from macro" } */
+ int resync_parser_3;
+}
+
+void g2 ()
+{
+HASHDEFINE Y 1 /* { dg-error "stray|unknown|expected" "#define from macro" } */
+ int resync_parser_4;
+}
+
+#pragma GCC dependency "direct2.c"
+#
+
+void f ()
+{
+ int i = X; /* { dg-error "undeclared|for each" "no macro X" } */
+ int j = Y; /* { dg-error "undeclared|for each" "no macro Y" } */
+}
+
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/directiv.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/directiv.c
new file mode 100644
index 000000000..aafe2ec10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/directiv.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options -pedantic } */
+
+/* Tests general directive syntax, and directive error recovery. */
+
+
+/* Test directive name is not expanded. */
+#define foo define
+#foo EMPTY /* { dg-error "invalid" } */
+
+/* Test # must be first on line. */
+EMPTY #define bar
+#ifdef bar
+#error bar is defined
+#endif
+
+/* Test form feed and vertical tab warn pedantically, see 6.10
+ paragraph 5. Tab is OK. */
+# define something /* { dg-warning "form feed" } */
+#define something_else /* { dg-warning "vertical tab" } */
+ #define some thing /* Tab OK, as is form feed before #. */
+
+/* Our friend the null directive OK? */
+#
+
+/* Check newlines end directives, even in function-like macro
+ invocations. 6.10 paragraph 1.
+
+ Note that the #if is still treated as a conditional, so there
+ should be no errors about #endif without #if. */
+#define func(x) x
+#if func ( /* { dg-error "unterminated argument" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/empty-include.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/empty-include.c
new file mode 100644
index 000000000..6b6c0753f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/empty-include.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2004 Free Software Foundation, Inc.
+ * Contributed and written by Nathanael Nerode.
+ *
+ * GCC 3.4 would attempt to open stdin as the included file
+ * (PR 17610), causing a sort of hang.
+ *
+ * We should get an error.
+ */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fshow-column" } */
+#include "" /* { dg-error "10:empty" "error on empty filename in include" } */
+int x; /* Otherwise we have an empty file and get more errors. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif-pedantic1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif-pedantic1.c
new file mode 100644
index 000000000..c97e32907
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif-pedantic1.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic -Wno-endif-labels" } */
+
+/* Tests combinations of -pedantic and -Wno-endif-labels; see extratokens2.c
+ for more general tests. */
+
+/* Source: Phil Edwards, 25 Mar 2002. Copied from extratokens2.c and
+ modified. */
+
+#if 1
+#if 0
+#else foo /* { dg-bogus "extra tokens" "bad warning" } */
+#endif / /* { dg-bogus "extra tokens" "bad warning" } */
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c
new file mode 100644
index 000000000..55cc5eb66
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-Wno-endif-labels -pedantic-errors" } */
+
+/* Tests combinations of -pedantic and -Wno-endif-labels; see extratokens2.c
+ for more general tests. */
+
+/* Source: Phil Edwards, 25 Mar 2002. Copied from endif-pedantic1.c and
+ modified. */
+
+#if 1
+#if 0
+#else foo /* { dg-error "extra tokens" "tokens after #else" } */
+#endif / /* { dg-error "extra tokens" "tokens after #endif" } */
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif.c
new file mode 100644
index 000000000..efea52c46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test case for PR preprocessor/6386 by Andreas Schwab. We'd back up
+ over the CPP_EOF token (indicating not a funlike macro invocation)
+ in the header file, which would then be passed through as a real
+ EOF, leading to an early exit (and therefore bogus complaint about
+ unterminated #if). */
+
+#define S(x)
+#if 1
+#include "endif.h"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif.h
new file mode 100644
index 000000000..37622491d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/endif.h
@@ -0,0 +1 @@
+S
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/error-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/error-1.c
new file mode 100644
index 000000000..1bc6a3f6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/error-1.c
@@ -0,0 +1,5 @@
+/* Test that error messages include "error:" in the text. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do preprocess } */
+
+/* { dg-error "unterminated comment" }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape-1.c
new file mode 100644
index 000000000..0f5c11e9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape-1.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+/* This tests various diagnostics about escape sequences, for both
+ the preprocessor and the compiler.
+
+ Neil Booth, 22 May 2001. */
+
+#if '\x' /* { dg-error "no following" "\x with no digits" } */
+#endif
+#if '\x400' /* { dg-error "out of range" "\x out of range" } */
+#endif
+#if '\x0ff' /* { dg-bogus "out of range" "\x out of range" } */
+#endif
+#if '\400' /* { dg-error "out of range" "\x out of range" } */
+#endif
+#if '\377' /* { dg-bogus "out of range" "bogus \x out of range" } */
+#endif
+#if '\177' != 0x7f /* { dg-bogus "out of range" "bogus \x out of range" } */
+#error bad octal /* { dg-bogus "bad" "bad octal evaluation" } */
+#endif
+#if '\0377' /* { dg-warning "multi" "too long octal" } */
+#endif
+#if '\p' /* { dg-error "unknown escape" "unknown escape seq" } */
+#endif
+
+void foo ()
+{
+ int c;
+
+ c = '\x'; /* { dg-error "no following" "\x with no digits" } */
+ c = '\x100'; /* { dg-error "out of range" "\x out of range" } */
+ c = '\x0ff'; /* { dg-bogus "out of range" "\x out of range" } */
+ c = '\400'; /* { dg-error "out of range" "\x out of range" } */
+ c = '\377'; /* { dg-bogus "out of range" "bogus \x out of range" } */
+ c = '\0377'; /* { dg-warning "multi" "too long octal" } */
+ c = '\p'; /* { dg-error "unknown escape" "unknown escape seq" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape-2.c
new file mode 100644
index 000000000..902fad3a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape-2.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-pedantic -std=c99" } */
+
+/* This tests various diagnostics with -pedantic about escape
+ sequences, for both the preprocessor and the compiler.
+
+ Neil Booth, 22 May 2001. */
+
+#if '\e' /* { dg-warning "non-ISO" "non-ISO \\e" } */
+#endif
+#if L'\u00a0' /* { dg-bogus "unknown" "\\u is known in C99" } */
+#endif
+
+void foo ()
+{
+ int c = '\E'; /* { dg-warning "non-ISO" "non-ISO \\E" } */
+ c = L'\u00a0'; /* { dg-bogus "unknown" "\\u is known in C99" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape.c
new file mode 100644
index 000000000..e7d5e08dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/escape.c
@@ -0,0 +1,25 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional -std=c89" } */
+
+/* This tests various diagnostics with -Wtraditioanl about escape
+ sequences, for both the preprocessor and the compiler.
+
+ Neil Booth, 22 May 2001. */
+
+#if '\a' /* { dg-warning "traditional" "traditional bell" } */
+#endif
+#if '\x1a' != 26 /* { dg-warning "traditional" "traditional hex" } */
+ #error bad hex /* { dg-bogus "bad" "bad hexadecimal evaluation" } */
+#endif
+#if L'\u00a1' /* { dg-warning "only valid" "\u is unknown in C89" } */
+#endif
+
+void foo ()
+{
+ int c = '\a'; /* { dg-warning "traditional" "traditional bell" } */
+
+ c = '\xa1'; /* { dg-warning "traditional" "traditional hex" } */
+ c = L'\u00a1'; /* { dg-warning "only valid" "\u is unknown in C89" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/expr-overflow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/expr-overflow-1.c
new file mode 100644
index 000000000..8a67aaa6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/expr-overflow-1.c
@@ -0,0 +1,44 @@
+/* Test overflow in preprocessor arithmetic. PR 55715. */
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99" } */
+
+#include <stdint.h>
+
+#if -1 - INTMAX_MIN
+#endif
+
+#if 0 - INTMAX_MIN /* { dg-warning "overflow" } */
+#endif
+
+#if 1 * INTMAX_MIN
+#endif
+
+#if -1 * INTMAX_MIN /* { dg-warning "overflow" } */
+#endif
+
+#if 0 * INTMAX_MIN
+#endif
+
+#if -INTMAX_MIN /* { dg-warning "overflow" } */
+#endif
+
+#if +INTMAX_MIN
+#endif
+
+#if INTMAX_MIN / 1
+#endif
+
+#if INTMAX_MIN / -1 /* { dg-warning "overflow" } */
+#endif
+
+#if UINTMAX_MAX * UINTMAX_MAX
+#endif
+
+#if UINTMAX_MAX / -1
+#endif
+
+#if UINTMAX_MAX + INTMAX_MAX
+#endif
+
+#if UINTMAX_MAX - INTMAX_MIN
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/expr.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/expr.c
new file mode 100644
index 000000000..532bd6812
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/expr.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test we get signedness of ?: operator correct. We would skip
+ evaluation of one argument, and might therefore not transfer its
+ unsignedness to the result. */
+
+/* Neil Booth, 19 Jul 2002. */
+
+#if (1 ? -2: 0 + 1U) < 0
+#error /* { dg-bogus "error" } */
+#endif
+
+#if (0 ? 0 + 1U: -2) < 0
+#error /* { dg-bogus "error" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/extratokens.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/extratokens.c
new file mode 100644
index 000000000..11d094af5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/extratokens.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-Wno-deprecated" } */
+
+/* Tests all directives that do not permit excess tokens at the end of
+ the line. */
+
+/* Source: Neil Booth, 4 Dec 2000. The combination of separate test
+ cases. */
+
+#ifdef foo bar /* { dg-warning "extra tokens" "tokens after #ifdef" } */
+#endif
+
+#ifndef foo bar /* { dg-warning "extra tokens" "tokens after #ifndef" } */
+#endif
+
+#if 1
+#if 0
+#else foo /* { dg-warning "extra tokens" "tokens after #else" } */
+#endif / /* { dg-warning "extra tokens" "tokens after #endif" } */
+#endif
+
+#undef foo bar /* { dg-warning "extra tokens" "tokens after #undef" } */
+
+#assert foo(bar) bar /* { dg-warning "extra tokens" "tokens after #assert" } */
+
+#unassert foo(bar) b /* { dg-warning "extra tokens" "tokens after #unassert" } */
+
+#include "mi1c.h" bar /* { dg-warning "extra tokens" "tokens after #include" } */
+
+#ident "something" bar /* { dg-warning "extra tokens" "tokens after #ident" } */
+
+# 36 "file.c" 3
+
+/* ... but in a system header, it's acceptable. */
+#ifdef KERNEL
+#endif KERNEL /* { dg-bogus "extra tokens" "bad warning" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/extratokens2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/extratokens2.c
new file mode 100644
index 000000000..8e69a96c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/extratokens2.c
@@ -0,0 +1,22 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-Wno-endif-labels" } */
+
+/* Tests that -Wno-endif-labels correctly disables the checks done by
+ default (and tested in extratokens.c). */
+
+/* Source: Phil Edwards, 21 Mar 2002. Copied from extratokens.c and
+ modified. */
+
+#if 1
+#if 0
+#else foo /* { dg-bogus "extra tokens" "bad warning" } */
+#endif / /* { dg-bogus "extra tokens" "bad warning" } */
+#endif
+
+# 36 "file.c" 3
+
+/* ... but in a system header, it's acceptable. */
+#ifdef KERNEL
+#endif KERNEL /* { dg-bogus "extra tokens" "bad warning" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/fpreprocessed.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/fpreprocessed.c
new file mode 100644
index 000000000..53d298f53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/fpreprocessed.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options -fpreprocessed } */
+
+/* Source: Jason Merrill, 19 Nov 2001. We'd try and back up a token
+ and move to a non-existent token run with -fpreprocessed on a file
+ without a leading # line. */
+
+foo
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/A.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/A.h
new file mode 100644
index 000000000..557372951
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/A.h
@@ -0,0 +1 @@
+#import <OneSub/C.h>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/B.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/B.h
new file mode 100644
index 000000000..557372951
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/B.h
@@ -0,0 +1 @@
+#import <OneSub/C.h>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/C.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/C.h
new file mode 100644
index 000000000..5afd8050c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/C.h
@@ -0,0 +1,4 @@
+#ifdef ONESUB_C_INCLUDED
+#error should only be imported once
+#endif
+#define ONESUB_C_INCLUDED 1
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Headers/one-includeSubs.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Headers/one-includeSubs.h
new file mode 100644
index 000000000..adaeb95ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/frame/one.framework/Headers/one-includeSubs.h
@@ -0,0 +1,2 @@
+#import <OneSub/A.h>
+#import <OneSub/B.h>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc89-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc89-pedantic.c
new file mode 100644
index 000000000..2749ad739
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc89-pedantic.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu89 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=gnu89 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "long long" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc89.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc89.c
new file mode 100644
index 000000000..b655ead02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc89.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu89" } */
+
+/* This file is for testing the preprocessor in -std=gnu89 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc99-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc99-pedantic.c
new file mode 100644
index 000000000..9e3550d3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc99-pedantic.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=gnu99 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc99.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc99.c
new file mode 100644
index 000000000..5e2ee29c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/gnuc99.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99" } */
+
+/* This file is for testing the preprocessor in -std=gnu99 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/hash1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/hash1.c
new file mode 100644
index 000000000..a4c4b3516
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/hash1.c
@@ -0,0 +1,9 @@
+/* Test for proper handling of # in object-like macros.
+ From Linux kernel. */
+/* { dg-do preprocess } */
+
+#define FIXUP .section ".fixup",#alloc,#execinstr
+
+FIXUP
+
+/* { dg-bogus "not followed by" "object-like #" { target *-*-* } 3 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ident-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ident-1.c
new file mode 100644
index 000000000..da6e516d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ident-1.c
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+/* { dg-options "-Wno-deprecated" } */ /* shut off -pedantic */
+
+/* Based on PR 16999 */
+
+#ident "this is an ident"
+
+/* { dg-final { scan-file "ident-1.i" "(^|\\n)#ident \"this is an ident\"($|\\n)" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ident.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ident.c
new file mode 100644
index 000000000..5477cbe10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ident.c
@@ -0,0 +1,7 @@
+/* Test #ident. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-deprecated" } */ /* shut off -pedantic */
+
+#ident "this is an ident"
+
+int dummy(void) { return 12; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-1.c
new file mode 100644
index 000000000..c30f21561
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-1.c
@@ -0,0 +1,41 @@
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic-errors" } */
+
+#if 0xa != 10
+#error 0xa != 10 /* { dg-bogus "#error" "normal conversion" } */
+#endif
+
+#if 077 != 63
+#error 077 != 63 /* { dg-bogus "#error" "normal conversion" } */
+#endif
+
+#if 12wrt /* { dg-error "invalid suffix" "invalid number" } */
+#endif
+
+#if 0abc /* { dg-error "invalid suffix" "invalid number" } */
+#endif
+
+#if 42abc /* { dg-error "invalid suffix" "invalid number" } */
+#endif
+
+#if 0xabc != 2748
+#error 0xabc /* { dg-bogus "#error" "normal conversion" } */
+#endif
+
+#if 1.2 /* { dg-error "loating constant" "floating point in #if" } */
+#endif
+
+#if 4uu /* { dg-error "invalid suffix" "too many suffixes" } */
+#endif
+
+#if 124123231lll /* { dg-error "invalid suffix" "too many suffixes" } */
+#endif
+
+#if 1234lul /* { dg-error "invalid suffix" "u between ls" } */
+#endif
+
+#if 099 /* { dg-error "invalid digit" "decimal in octal constant" } */
+#endif
+
+#if 0xfffffffffffffffff /* { dg-error "integer constant" "range error" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-2.c
new file mode 100644
index 000000000..dc136b456
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-2.c
@@ -0,0 +1,28 @@
+/* { dg-do preprocess } */
+/* { dg-options -pedantic-errors } */
+
+#if 'a' != 'a' || '\001' != 1 || '\x12' != 0x12
+#error a,1,0x12 /* { dg-bogus "#error" "basic charconst recognition" } */
+#endif
+
+#if 'a' != L'a'
+#error L'a' /* { dg-bogus "error" "wide charconst recognition 1" } */
+#endif
+
+#if L'\xfeed' != 0xfeed && L'\xfeed' != (0xfeed - 0x10000)
+#error 0xfeed /* { dg-bogus "error" "wide charconst recognition 2" } */
+#endif
+
+#if L'\x1234' != 0x1234
+#error 0x1234 /* { dg-bogus "error" "wide charconst recognition 3" } */
+#endif
+
+/* The 'character constant (is )?too long' message is produced by 16-bit targets. */
+#if 'abcd' /* { dg-warning "(multi-character character constant)|(character constant (is )?too long)" "multi-character charconst" } */
+#endif
+
+#if 'abcdefghi' /* { dg-warning "character constant (is )?too long" "charconst too long" } */
+#endif
+
+#if '' /* { dg-error "empty character constant" "empty charconst" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-4.c
new file mode 100644
index 000000000..fbab9efc1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-4.c
@@ -0,0 +1,8 @@
+/* Regression test for proper error message. The token name isn't
+ NUL terminated, so we would print garbage after it. */
+/* { dg-do compile } */
+
+#if 1 += 2 /* { dg-error "is not valid" "+= in if" } */
+syntax_error
+#endif
+int foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-5.c
new file mode 100644
index 000000000..8238a12ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-5.c
@@ -0,0 +1,9 @@
+/* Regression test: #ifdef 0 should not crash. Problem noted by
+ Jakub Jelinek <jakub@redhat.com>. */
+/* { dg-do preprocess } */
+
+#ifdef 0 /* { dg-error "macro names" } */
+#endif
+
+#ifndef 0 /* { dg-error "macro names" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-cexp.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-cexp.c
new file mode 100644
index 000000000..1ebd11929
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-cexp.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+
+/* Test the ? : opearator, for precedence and both true and false. */
+
+#if 1 ? 1 ? 2 : 0 : 0
+#error OK /* { dg-error "OK" "nested ? :" } */
+#endif
+
+#if ((0) ? (1) ? (2) : (3) : (4) ? (5): (6)) == 5
+#error OK /* { dg-error "OK" "nested ? : with parens" } */
+#endif
+
+#if 2: /* { dg-error "':' without" "immediate :" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-div.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-div.c
new file mode 100644
index 000000000..4e4216812
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-div.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+
+/* Test that this preprocesses without error. */
+
+#if (-1)/2
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-mop.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-mop.c
new file mode 100644
index 000000000..119c7392e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-mop.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Source: Neil Booth. */
+
+/* Various illegal expressions with missing components. */
+
+#if /* { dg-error "no expression" "empty #if" } */
+#endif
+
+#if ~ /* { dg-error "no right op" "no unary operand" } */
+#endif
+
+#if 3 + * 6 + 4 /* { dg-error "no right op" "no right operand" } */
+#endif
+
+#if 2 ~2 /* { dg-error "missing bin" "no binary operator" } */
+#endif
+
+#if 1 + 2 (3) /* { dg-error "missing bin" "immediate then open paren" } */
+#endif
+
+#if (2) 4 * 2 /* { dg-error "missing bin" "close paren then immediate" } */
+#endif
+
+#if == 2 /* { dg-error "no left op" } */
+#endif
+
+#if (==2) /* { dg-error "no left op" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-mpar.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-mpar.c
new file mode 100644
index 000000000..45dd78b1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-mpar.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* Test various combinations of missing parentheses give the correct
+ missing parenthesis message. */
+
+/* { dg-do preprocess } */
+#if (1 /* { dg-error "5:missing '\\)'" "missing ')' no. 1" } */
+#endif
+
+#if 2 * (3 + 4 /* { dg-error "9:missing '\\)'" "missing ')' no. 2" } */
+#endif
+
+#if (2)) /* { dg-error "8:missing '\\('" "missing '(' no. 1" } */
+#endif
+
+#if ) /* { dg-error "5:missing '\\('" "missing '(' no. 2" } */
+#endif
+
+#if 4) /* { dg-error "6:missing '\\('" "missing '(' no. 3" } */
+#endif
+
+#if ( /* { dg-error "5:missing '\\)'" "missing ')' no. 3" } */
+#endif
+
+#if ((2 + 3) + 5 /* { dg-error "5:missing '\\)'" "missing ')' no. 3" } */
+#endif
+
+#if ((2 + 3 + 5 /* { dg-error "6:missing '\\)'" "missing ')' no. 3" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-oppr.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-oppr.c
new file mode 100644
index 000000000..a46a815cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-oppr.c
@@ -0,0 +1,92 @@
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc. */
+
+/* Test the full range of preprocessor operator precedence. Each
+ operator is tested with one of immediately higher precedence to
+ verify it is of strictly lower precedence. To avoid complications,
+ each test uses just those two operators. Occasionally this assumes
+ correct operation of if-then-else, so the first tests verify this. */
+
+/* { dg-do preprocess } */
+
+/* Ensure correct functioning of if-then-else. */
+#if 1
+#else
+#error #else block evaluated for true conditional
+#endif
+
+#if 0
+#error #if block evaluated for false conditional
+#else
+#endif
+
+/* : strictly higher than ?. This would give a syntax error otherwise. */
+#if 0 ? 0 : 1 ? 1 : 1
+#endif
+
+/* || strictly higher than ?:. */
+#if 1 ? 0: 0 || 1
+#error operator ?: has higher precedence than operator ||
+#endif
+
+/* && strictly higher than ||. */
+#if 1 || 0 && 0
+#else
+#error operator || has higher precedence than operator &&
+#endif
+
+/* | strictly higher than &&. */
+#if 0 && 0 | 1
+#error operator && has higher precedence than operator |
+#endif
+
+/* ^ strictly higher than |. */
+#if 1 | 0 ^ 1
+#else
+#error operator | has higher precedence than operator ^
+#endif
+
+/* & strictly higher than ^. */
+#if 1 ^ 0 & 0
+#else
+#error operator ^ has higher precedence than operator &
+#endif
+
+/* == (!=) strictly higher than &. */
+#if 0 & 0 == 0
+#error operator & has higher precedence than operator ==
+#endif
+
+/* < (>, <=, >=) strictly higher than == (!=). */
+
+#if 0 == 0 < 0
+#else
+#error operator == has higher precedence than operator <
+#endif
+
+/* << (>>) strictly higher than < (>, <=, >=). */
+#if 1 < 1 << 1
+#else
+#error operator < has higher precedence than operator <<
+#endif
+
+/* Binary + (-) strictly higher than << (>>). */
+#if 0 << 0 + 1
+#error operator << has higher precedence than binary +
+#endif
+
+/* Binary * (/, %) strictly higher than binary + (-). */
+#if 1 + 0 * 0
+#else
+#error binary + has higher precedence than binary *
+#endif
+
+/* Unary operators (!, ~, -, +) strictly higher than binary * (/, %).
+ Equality is hard to detect because of right-associativity. */
+#if ~1 * 0
+#error binary * has higher precedence than operator ~
+#endif
+
+/* () > Unary. Unfortunately this requires an additional operator. */
+#if -(1 - 1)
+#error unary - has higher precedence than operator ()
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-oppr2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-oppr2.c
new file mode 100644
index 000000000..bcfe7cca2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-oppr2.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc. */
+
+/* Another test of operator precedence. */
+
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+#if 1 ? 2 : 3 , 0
+#error
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-paren.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-paren.c
new file mode 100644
index 000000000..407a302b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-paren.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* These now use "!=" rather than "<" to increase chance of failure. */
+#if 16 * (1) + 4 != 20
+#error /* { dg-bogus "error" "with paren" } */
+#endif
+
+#if 16 * 1 + 4 != 20
+#error /* { dg-bogus "error" "without paren" } */
+#endif
+
+#if () /* { dg-error "expression between" "empty paren" } */
+#endif
+
+#if (1) == 1
+#error /* { dg-error "" "simple parens no. 1" } */
+#endif
+
+#if (2)
+#error /* { dg-error "" "simple parens no. 2" } */
+#endif
+
+#if 3 == (3)
+#error /* { dg-error "" "simple parens no. 3" } */
+#endif
+
+#if (((-1) + 8)) == ((+2) * ((3)) - -1)
+#error /* { dg-error "" "nested parentheses" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-sc.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-sc.c
new file mode 100644
index 000000000..1607669f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-sc.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test that all operators correctly short circuit. */
+
+#if (2 || 3 / 0) != 1
+#error /* { dg-bogus "error" "|| short circuit" } */
+#endif
+
+#if 0 && 3 / 0
+#error /* { dg-bogus "error" "&& short circuit" } */
+#endif
+
+#if 1 ? 0 : 3 / 0
+#error /* { dg-bogus "error" "? : right short circuit" } */
+#endif
+
+#if 0 ? 3 / 0 : 2
+#else
+#error /* { dg-bogus "error" "? : left short circuit" } */
+#endif
+
+#if -1 ? 0 && 3 / 0 : 3 / 0 + 5 == 5
+#error /* { dg-bogus "error" "nested short circuiting" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-shift.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-shift.c
new file mode 100644
index 000000000..a55420a79
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-shift.c
@@ -0,0 +1,22 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test shift operators. */
+
+#if 1 << 4 != 16
+#error /* { dg-bogus "error" "<< +ve shift" } */
+#endif
+
+#if 19 >> 2 != 4
+#error /* { dg-bogus "error" ">> +ve shift" } */
+#endif
+
+#if 17 << -2 != 17 >> 2
+#error /* { dg-bogus "error" "<< -ve shift" } */
+#endif
+
+#if 25 >> -2 != 25 << 2
+#error /* { dg-bogus "error" ">> -ve shift" } */
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-unary.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-unary.c
new file mode 100644
index 000000000..f5442afe8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/if-unary.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test the various unary operators. */
+
+#if 1 + + + 1 /* allow multiple unary sign operators :) */
+#endif
+
+#if 8 - +3 != +4 + +1
+#error /* { dg-bogus "error" "unary +" } */
+#endif
+
+#if -2 - -1 != -1
+#error /* { dg-bogus "error" "unary -" } */
+#endif
+
+#if ~0 != -1
+#error /* { dg-bogus "error" "unary ~" } */
+#endif
+
+#if !0 && (!1 == 0) && !!1 != 1
+#error /* { dg-bogus "error" "unary !" } */
+#endif
+
+#if ~~8 != 8
+#error /* { dg-bogus "error" "double unary ~" } */
+#endif
+
+#if 5 + +!-4 != 5
+#error /* { dg-bogus "error" "compound unary +, !, -" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import1.c
new file mode 100644
index 000000000..07130f014
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import1.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2003, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-Wno-deprecated" } */
+
+/* This tests that our eagerness to apply the multiple include guard
+ optimization to the #import doesn't stop us marking the file
+ once-only.
+
+ Neil Booth, 2 August 2003. */
+
+#include "import1.h"
+#import "import1.h"
+#undef IMPORT1_H
+#define BUG
+#include "import1.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import1.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import1.h
new file mode 100644
index 000000000..936c525eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import1.h
@@ -0,0 +1,6 @@
+#ifndef IMPORT1_H
+#define IMPORT1_H
+#ifdef BUG
+#error Should not happen
+#endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import2.c
new file mode 100644
index 000000000..99b987551
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import2.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2003, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-Wno-deprecated" } */
+
+/* This tests that the file is only included once
+ Neil Booth, 2 August 2003. */
+
+#include "import2.h"
+#import "import2.h"
+#include "import2.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import2.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import2.h
new file mode 100644
index 000000000..c6a0fa597
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/import2.h
@@ -0,0 +1,4 @@
+#ifdef BUG
+#error Should not happen!
+#endif
+#define BUG
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/foo.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/foo.h
new file mode 100644
index 000000000..ec770476c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/foo.h
@@ -0,0 +1 @@
+extern int a;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20348-aux.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20348-aux.h
new file mode 100644
index 000000000..1f04c7569
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20348-aux.h
@@ -0,0 +1 @@
+#include "pr20348.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20348.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20348.h
new file mode 100644
index 000000000..810bb36d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20348.h
@@ -0,0 +1,9 @@
+#ifndef MIDDLE
+# ifndef INC_PR20348_H_SEEN
+# define INC_PR20348_H_SEEN
+# else
+# error inc/pr20348.h included twice before MIDDLE definition
+# endif
+#else
+# error inc/pr20348.h included after MIDDLE definition
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20356-aux.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20356-aux.h
new file mode 100644
index 000000000..3f4a67f8e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20356-aux.h
@@ -0,0 +1 @@
+#include "pr20356.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20356.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20356.h
new file mode 100644
index 000000000..582925739
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pr20356.h
@@ -0,0 +1,6 @@
+#ifndef INC_PR20356_H
+# define INC_PR20356_H
+#endif
+#ifndef PR20356_H
+# include_next <pr20356.h>
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pragma-once-1a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pragma-once-1a.h
new file mode 100644
index 000000000..7de641216
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/inc/pragma-once-1a.h
@@ -0,0 +1,6 @@
+#ifndef _A_H_
+#define _A_H_
+
+#include "../pragma-once-1b.h"
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include1.c
new file mode 100644
index 000000000..a0a54e005
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include1.c
@@ -0,0 +1,13 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests that "#include MACRO" works. */
+
+/* Source: Neil Booth, 29 Oct 2000. */
+
+#define MACRO "mi1c.h"
+#include MACRO
+#ifndef CPP_MIC_H
+#error #include MACRO does not work
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include2.c
new file mode 100644
index 000000000..de34255ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include2.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests that #include does not allow the terminating '>' or '"' to be
+ escaped, as per the standard. */
+
+/* Source: Neil Booth, 4 Nov 2000. */
+
+#include <silly\>> /* { dg-error "extra tokens" "" } */
+
+/* These error is No such file or directory, just once. However, this
+ message is locale-dependent, so don't test for it. */
+/* { dg-error "silly" "" { target *-*-* } 0 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include2a.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include2a.c
new file mode 100644
index 000000000..9370d0944
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include2a.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests that #include does not allow the terminating '>' or '"' to be
+ escaped, as per the standard. */
+
+/* Source: Neil Booth, 4 Nov 2000. */
+
+#include "silly\"" /* { dg-error "extra tokens" "" } */
+
+/* These error is No such file or directory, just once. However, this
+ message is locale-dependent, so don't test for it. */
+/* { dg-error "silly" "silly" { target *-*-* } 0 } */
+/* { dg-error "missing" "missing" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include3.c
new file mode 100644
index 000000000..8bea2b78e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include3.c
@@ -0,0 +1,7 @@
+/* Unpatched, this file would include "inc/ foo.h" (note the space) */
+
+#define PREINC_XSTR(str) #str
+#define PREINC_STR(str) PREINC_XSTR(str)
+#define COMP_INC(comp,file) PREINC_STR(comp/file)
+
+#include COMP_INC(inc, foo.h)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include4.c
new file mode 100644
index 000000000..d5e7fee88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include4.c
@@ -0,0 +1,14 @@
+/* Preprocessing tokens are always formed according to a greedy algorithm,
+ so "#include <stddef.h" must be interpreted as a sequence of tokens,
+ of which the "h" then gets macro expanded. Likewise the other
+ examples. */
+
+#define h h>
+#include <stddef.h
+#undef h
+
+#define foo stddef.h>
+#include <foo
+
+#include <foo /*
+> */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include5.c
new file mode 100644
index 000000000..9bbc2878d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include5.c
@@ -0,0 +1,9 @@
+/* Test #include directives with macros expanding to empty. */
+
+#define EMPTY_OBJ
+#define EMPTY_FUNC()
+
+#include <stddef.h> EMPTY_OBJ
+#include <stddef.h> EMPTY_FUNC()
+#include "stddef.h" EMPTY_OBJ
+#include "stddef.h" EMPTY_FUNC()
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include6.c
new file mode 100644
index 000000000..c76a3fe71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include6.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99" } */
+
+#include <stddef.h>
+#include "stddef.h"
+#include L"stddef.h" /* { dg-error "include expects" } */
+#include u"stddef.h" /* { dg-error "include expects" } */
+#include U"stddef.h" /* { dg-error "include expects" } */
+#include u8"stddef.h" /* { dg-error "include expects" } */
+#include R"(stddef.h)" /* { dg-error "include expects" } */
+#include LR"(stddef.h)" /* { dg-error "include expects" } */
+#include uR"(stddef.h)" /* { dg-error "include expects" } */
+#include UR"(stddef.h)" /* { dg-error "include expects" } */
+#include u8R"(stddef.h)" /* { dg-error "include expects" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include7.c
new file mode 100644
index 000000000..0e95601f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/include7.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "-I \"\"" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/isysroot-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/isysroot-1.c
new file mode 100644
index 000000000..7263ce415
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/isysroot-1.c
@@ -0,0 +1,10 @@
+/* { dg-options "-isysroot ${srcdir}/gcc.dg/cpp" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+#include <stdio.h>
+int main()
+{
+ /* Special stdio.h supplies function foo. */
+ void (*x)(void) = foo;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/isysroot-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/isysroot-2.c
new file mode 100644
index 000000000..346d4093c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/isysroot-2.c
@@ -0,0 +1,10 @@
+/* { dg-options "-isysroot ${srcdir}/gcc.dg/cpp" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+#include <Carbon/Carbon.h>
+int main()
+{
+ /* Special Carbon.h supplies function foo. */
+ void (*x)(void) = foo;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexident.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexident.c
new file mode 100644
index 000000000..fdf54a2e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexident.c
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-trigraphs -fdollars-in-identifiers" } */
+
+/* Test lexing of identifiers. */
+
+/* Escaped newlines, _ and $ in identifiers. */
+#def\
+\
+ine foo_
+
+#d\
+ef??/
+in\
+e b\
+a$r
+
+#ifndef foo_
+#error foo_
+#endif
+
+#ifndef ba$r
+#error ba$r
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexnum.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexnum.c
new file mode 100644
index 000000000..7df155408
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexnum.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "-trigraphs" } */
+
+/* Test lexing of numbers. */
+
+extern int puts (const char *);
+extern void abort (void);
+#define err(str) do { puts(str); abort(); } while (0)
+
+/* Escaped newlines. */
+#define foo 12\
+3\
+\
+4??/
+5
+
+#if foo != 12345
+#error foo
+#endif
+
+int main (int argc, char *argv[])
+{
+ double a = 5.;
+ double x = .5;
+
+/* Decimal points, including initially and immediately before and
+ after an escaped newline. */
+ if (a != 5)
+ err ("a");
+ if (x != .\
+5)
+ err ("x != .5");
+ x = 25\
+.\
+6;
+ if (x != 25.6)
+ err ("x != 25.6");
+
+ /* Test exponentials and their signs. A buggy lexer is more likely
+ to fail the compile, but never mind. */
+ if (250 != 25e+1 || 250 != 25e1 || 250 != 2500e-1)
+ err ("exponentials");
+
+ /* Todo: p exponentials, and how to test preprocessing number
+ tokenisation? */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexstrng.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexstrng.c
new file mode 100644
index 000000000..b03533003
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/lexstrng.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "-trigraphs" } */
+
+/* Test lexing of strings and character constants. */
+
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ int
+#endif
+typedef __WCHAR_TYPE__ wchar_t;
+
+extern int strcmp (const char *, const char *);
+extern int puts (const char *);
+extern void abort (void);
+#define err(str) do { puts(str); abort(); } while (0)
+
+/* Escaped newlines. */
+const char *str1 = "s\
+t\
+\
+r??/
+ 1";
+
+const char x = '\
+??/
+b';
+
+/* Test escaped terminators. */
+const char *term = "\"\\\"\\";
+const char termc = '\'';
+const char *terms = "'";
+
+/* Test wide strings and chars are lexed. */
+const wchar_t wchar = L'w';
+const wchar_t* wstring = L"wide string";
+
+/* Test all 9 trigraphs embedded in a string. Test trigraphs do not
+ survive an embedded backslash newline. Test trigraphs preceded by
+ a '?' are still noticed. */
+const char *t = "??/\??<??>??=??)??\
+(??(??!??'??-???=???/
+?-";
+
+int main (int argc, char *argv[])
+{
+ if (strcmp (str1, "str 1"))
+ err ("str1");
+
+ if (x != 'b')
+ err ("b");
+
+ /* We have to split the string up to avoid trigraph replacement
+ here. Split the 2 trigraphs after both 1 and 2 ?s; just doing
+ this exposed a bug in the initial release of the tokenized lexer. */
+ if (strcmp (t, "\\{}#]?" "?([|^~?#??" "-"))
+ err ("Embedded trigraphs");
+
+ if (term[0] != '"' || term[1] != '\\' || term[2] != '"'
+ || term[3] != '\\' || term[4] != '\0')
+ err ("Escaped string terminators");
+
+ if (termc != terms[0])
+ err ("Escaped character constant terminator");
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line1.c
new file mode 100644
index 000000000..b13c1229d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line1.c
@@ -0,0 +1,12 @@
+/* Copyright (C) 2000, 2003 Free Software Foundation.
+
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do preprocess } */
+
+/* The line number below must be just a few lines greater than the
+ actual line number. */
+#line 10 "baz"
+wibble
+
+/* { dg-final { scan-file line1.i baz } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line2.c
new file mode 100644
index 000000000..5ee0e04be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line2.c
@@ -0,0 +1,13 @@
+/* Copyright (C) 2000 Free Software Foundation.
+
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do preprocess } */
+
+#line 1
+#line 0
+#line 2
+#line 32768
+
+/* { dg-error "out of range" "line # too low" { target *-*-* } 1 } */
+/* { dg-error "out of range" "line # too high" { target *-*-* } 2 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line3.c
new file mode 100644
index 000000000..4b40e4a6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line3.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-Wwrite-strings" } */
+/* The purpose of this test is to ensure that line numbers in diagnostics
+ are accurate after macros whose arguments contain newlines and are
+ substituted multiple times. The semicolons are on separate lines because
+ #line can only correct numbering on line boundaries. */
+#define one(x) x
+#define two(x) x x
+#define four(x) two(x) two(x)
+
+int
+main(void)
+{
+ char *A;
+
+ A = "text"; /* { dg-warning "discards 'const' qualifier" "case zero" } */
+ A = one("text" /* { dg-warning "discards 'const' qualifier" "case one" } */
+ "text")
+ ;
+ A = two("text" /* { dg-warning "discards 'const' qualifier" "case two" } */
+ "text")
+ ;
+ A = four("text" /* { dg-warning "discards 'const' qualifier" "case four" } */
+ "text")
+ ;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line4.c
new file mode 100644
index 000000000..84dbf9623
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line4.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+/* Test #line with and without macros for the line number. */
+
+extern void abort (void);
+
+#define L 90
+
+#line 44
+enum { i = __LINE__ };
+
+#line L
+enum { j = __LINE__ };
+
+#line 16 /* N.B. the _next_ line is line 16. */
+
+char array1[i == 44 ? 1 : -1];
+char array2[j == 90 ? 1 : -1];
+char array3[__LINE__ == 19 ? 1 : -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line5.c
new file mode 100644
index 000000000..4cad6a171
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line5.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fpreprocessed" } */
+
+/* Source: Neil Booth, 16 Sep 2001.
+
+ This file, with an indented line marker, is not possible without
+ user editing of preprocessed output, or the user using
+ -fpreprocessed on raw source. Nevertheless, we should not
+ segfault. This is a test that we don't back up two tokens in
+ cpplib.c - one to back up over the number, and one when we
+ recognize that it's not a valid directive in preprocessed input. */
+
+ # 1 "foo.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line6.c
new file mode 100644
index 000000000..c59ea3af7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line6.c
@@ -0,0 +1,7 @@
+/* PR 28079 */
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+#line 18446744073709551616 /* { dg-warning "line number out of range" } */
+
+#line 12312312312435 /* { dg-warning "line number out of range" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line7.c
new file mode 100644
index 000000000..754727e88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line7.c
@@ -0,0 +1,19 @@
+/* Test #line syntax, including macro expansion and empty macros. PR
+ 39647. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+#define EMPTY_OBJ
+#define EMPTY_FUNC()
+
+#define A 12 "line7.c"
+#line A
+
+#line EMPTY_OBJ /* { dg-error "unexpected end of file" } */
+#line X /* { dg-error "is not a positive integer" } */
+#line 16 16 /* { dg-error "is not a valid filename" } */
+
+#line 18 "line7.c" EMPTY_OBJ
+#line 19 "line7.c" EMPTY_FUNC()
+#line 20 "line7.c" foo /* { dg-error "extra tokens at end" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line8.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line8.c
new file mode 100644
index 000000000..5aeb26ca3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/line8.c
@@ -0,0 +1,10 @@
+/* Test that "" is not specially interpreted as "<stdin>" in a #line
+ directive. PR 39646. */
+
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+extern int x;
+
+#line 24 ""
+extern char z[sizeof __FILE__ == 1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-dir-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-dir-1.c
new file mode 100644
index 000000000..002c47f5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-dir-1.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Source: Neil Booth, 26 Feb 2002.
+
+ Test that we allow directives in macro arguments. */
+
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#define f(x) x
+extern void abort (void);
+
+int main ()
+{
+ if (f (
+#if f(1) /* True. */
+ 0)) /* False. */
+#else
+ 1))
+#endif
+ abort ();
+
+ /* Outer f expands to original definition, f in argument expands
+ to new definition, so result is: if (1 != 2 - 1). */
+ if (1 != f(2
+#undef f
+#define f - 1
+ f))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-dir-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-dir-2.c
new file mode 100644
index 000000000..b31ab3bee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-dir-2.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Source: Neil Booth, 26 Feb 2002.
+
+ Test that we allow directives in macro arguments. */
+
+/* { dg-do preprocess } */
+
+#define f(x) x
+
+f (
+#if 1 /* { dg-error "not portable" } */
+1)
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c
new file mode 100644
index 000000000..6b0a279dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c
@@ -0,0 +1 @@
+/* Test no newline at eof warning when Mac line ending is used*/ /* { dg-do compile } */ int main() { return 0; } \ No newline at end of file
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom1.c
new file mode 100644
index 000000000..2e01911c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom1.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC" } */
+
+/* This tests to make sure that comments are ignored between # and the
+ directive name when the -CC option is used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#/**/define def passed
+
+def
+
+/* { dg-final { scan-file maccom1.i "(^|\\n)passed" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom2.c
new file mode 100644
index 000000000..a448082e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom2.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC" } */
+
+/* This tests to make sure that comments between the #define directive
+ and the macro identifier are ignored (i.e. treated like whitespace)
+ when the -CC option is used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define/**/def passed
+
+def
+
+/* { dg-final { scan-file maccom2.i "(^|\n)passed" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom3.c
new file mode 100644
index 000000000..580c52c06
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom3.c
@@ -0,0 +1,13 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC" } */
+
+/* This tests to make sure that comments in the definition of a macro
+ parameter list are ignored when the -CC option is used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define def(x /**/, y) passed
+
+def(x,y)
+
+/* { dg-final { scan-file maccom3.i "(^|\n)passed" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom4.c
new file mode 100644
index 000000000..54806c154
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom4.c
@@ -0,0 +1,17 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC" } */
+
+/* This tests to make sure the comment is saved in the macro and copied
+ to the output file when the macro is expanded when the -CC option is
+ used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define def /* passed */
+
+def
+
+/*
+ /* The + in the regexp prevents it from matching itself. */
+ { dg-final { scan-file maccom4.i "p+assed" } }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom5.c
new file mode 100644
index 000000000..b01a045e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom5.c
@@ -0,0 +1,18 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC" } */
+
+/* This tests to make sure that C++ comments are converted to C comments
+ when saved in the macro and copied to the output file when the macro
+ is expanded when the -CC option is used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define def // passed
+
+def:
+
+/*
+ /* The + in the regexp prevents it from matching itself. */
+ { dg-final { scan-file maccom5.i "p+assed" } }
+ { dg-final { scan-file-not maccom5.i "p+assed:" } }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom6.c
new file mode 100644
index 000000000..09ca87d4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/maccom6.c
@@ -0,0 +1,20 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC" } */
+
+/* This tests to make sure that expressions function properly
+ when used with macros containing comments and the -CC option
+ is being used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define ONE 1 /* one */
+#define TWO 2 /* two */
+#define THREE 3 /* three */
+
+#if (ONE + TWO) != THREE
+failed
+#else
+passed
+#endif
+
+/* { dg-final { scan-file maccom6.i "(^|\n)passed" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-1.c
new file mode 100644
index 000000000..28ef7955c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-1.c
@@ -0,0 +1,19 @@
+/*
+ { dg-options "-ftrack-macro-expansion=1" }
+ { dg-do compile }
+*/
+
+#define OPERATE(OPRD1, OPRT, OPRD2) \
+do \
+{ \
+ OPRD1 OPRT OPRD2; /* { dg-message "definition" }*/ \
+} while (0)
+
+#define SHIFTL(A,B) \
+ OPERATE (A,<<,B) /* { dg-error "invalid operands" } */
+
+void
+foo ()
+{
+ SHIFTL (0.1,0.2); /* { dg-message "in expansion of macro \[^\n\r\]SHIFTL" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-2.c
new file mode 100644
index 000000000..2367765cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-2.c
@@ -0,0 +1,20 @@
+/*
+ { dg-options "-ftrack-macro-expansion=1" }
+ { dg-do compile }
+*/
+
+#define OPERATE(OPRD1, OPRT, OPRD2) \
+ OPRD1 OPRT OPRD2; /* { dg-message "in definition of macro 'OPERATE'" } */
+
+#define SHIFTL(A,B) \
+ OPERATE (A,<<,B) /* { dg-message "invalid operands to binary <<" } */
+
+#define MULT(A) \
+ SHIFTL (A,1) /* { dg-message "in expansion of macro 'SHIFTL'" } */
+
+void
+foo ()
+{
+ MULT (1.0); /* { dg-message "in expansion of macro 'MULT'" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-3.c
new file mode 100644
index 000000000..b47726d6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-3.c
@@ -0,0 +1,12 @@
+/*
+ { dg-options "-fshow-column -ftrack-macro-expansion=1" }
+ { dg-do compile }
+ */
+
+#define SQUARE(A) A * A /* { dg-message "in definition of macro 'SQUARE'" } */
+
+void
+foo()
+{
+ SQUARE (1 << 0.1); /* { dg-error "16:invalid operands to binary <<" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-4.c
new file mode 100644
index 000000000..401b846cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-4.c
@@ -0,0 +1,13 @@
+/*
+ { dg-options "-fshow-column -ftrack-macro-expansion=2" }
+ { dg-do compile }
+ */
+
+#define SQUARE(A) A * A /* { dg-message "in definition of macro 'SQUARE'" } */
+
+void
+foo()
+{
+ SQUARE (1 << 0.1); /* { dg-message "13:invalid operands to binary <<" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-5.c
new file mode 100644
index 000000000..abe456ceb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-5.c
@@ -0,0 +1,18 @@
+/*
+ { dg-options "-fshow-column -ftrack-macro-expansion" }
+ { dg-do compile }
+ */
+
+#define PASTED var ## iable /* { dg-error "'variable' undeclared" } */
+#define call_foo(p1, p2) \
+ foo (p1, \
+ p2); /* { dg-message "in definition of macro 'call_foo'" } */
+
+void foo(int, char);
+
+void
+bar()
+{
+ call_foo(1,PASTED); /* { dg-message "in expansion of macro 'PASTED'" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro1.c
new file mode 100644
index 000000000..e7235f577
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro1.c
@@ -0,0 +1,128 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+
+/* Tests various macro abuse is correctly expanded. */
+
+extern int puts (const char *);
+extern void abort (void);
+extern int strcmp(const char *s1, const char *s2);
+
+#define err(str) do { puts(str); abort(); } while (0)
+#define j(x, y) x + y
+#define k(x, y) j(x + 2, y +
+#define glue(x, y) x ## y
+#define xglue(x, y) glue(x, y)
+
+/* Functions called when macros are left unexpanded. */
+int q(int x) {return x + 40;}
+int B(int x) {return x + 20;}
+int foo(int x) {return x + 10;}
+int bar(int x, int y) {return x + y;}
+int baz(int x, int y) {return x + y;}
+int toupper(int x) {return x + 32;}
+int M(int x) {return x * 2;}
+
+int main (int argc, char *argv[])
+{
+#define q(x) x
+ if (q(q)(2) != 42)
+ err ("q");
+
+#define A(x) B(x)
+ if (A(A(2)) != 42)
+ err ("A");
+
+#define E(x) A x
+#define F (22)
+ if (E(F) != 42)
+ err ("E(F)");
+
+#define COMMA ,
+#define NASTY(a) j(a 37)
+ if (NASTY (5 COMMA) != 42)
+ err ("NASTY");
+
+#define bar(x, y) foo(x(y, 0))
+#define apply(x, y) foo(x(y, 22))
+#define bam bar
+ if (bar(bar, 32) != 42) /* foo(bar(32, 0)). */
+ err ("bar bar");
+ if (bar(bam, 32) != 42) /* Same. */
+ err ("bar bam");
+ if (apply(bar, baz) != 42) /* foo(foo(baz(22, 0))). */
+ err ("apply bar baz");
+
+ /* Taken from glibc. */
+#define __tobody(c, f) f (c)
+#define toupper(c) __tobody (c, toupper)
+ if (toupper (10) != 42) /* toupper (10). */
+ err ("toupper");
+
+ /* This tests that M gets expanded the right no. of times. Too many
+ times, and we get excess "2 +"s and the wrong sum. Derived from
+ nested stpcpy in dggettext.c. */
+#define M(x) 2 + M(x)
+#define stpcpy(a) M(a)
+ if (stpcpy (stpcpy (9)) != 42) /* 2 + M (2 + M (9)) */
+ err ("stpcpy");
+
+ /* Another test derived from nested stpcpy's of dggettext.c. Uses
+ macro A(x) and function B(x) as defined above. The problem was
+ the same - excess "1 +"s and the wrong sum. */
+#define B(x) 1 + B(x)
+#define C(x) A(x)
+ if (C(B(0)) != 42) /* 1 + B (1 + B (0)) */
+ err ("C");
+
+ /* More tests derived from gcc itself - the use of XEXP and COST.
+ These first two should both expand to the same thing. */
+ {
+ int insn = 6, i = 2, b = 2;
+#define XEXP(RTX, N) (RTX * N + 2)
+#define PATTERN(INSN) XEXP(INSN, 3)
+ if (XEXP (PATTERN (insn), i) != 42) /* ((insn * 3 + 2) * i + 2) */
+ err ("XEXP (PATTERN)");
+ if (XEXP (XEXP (insn, 3), i) != 42) /* ((insn * 3 + 2) * i + 2) */
+ err ("XEXP (XEXP)");
+
+#define COST(X) XEXP (XEXP (X, 4), 4)
+ if (COST (b) != 42) /* ((b * 4 + 2) * 4 + 2) */
+ err ("COST");
+ }
+
+ /* This tests macro recursion and expand-after-paste. */
+#define FORTYTWO "forty"
+#define TWO TWO "-two"
+ if (strcmp (glue(FORTY, TWO), "forty"))
+ err ("glue");
+ if (strcmp (xglue(FORTY, TWO), "forty-two"))
+ err ("xglue");
+
+ /* Test ability to call macro over multiple logical lines. */
+ if (q
+ (42) != 42
+ || q (
+ 42) != 42
+ || q (42
+ ) != 42
+ || q
+ (
+ 42
+ )
+ != 42)
+ err ("q over multiple lines");
+
+ /* Corner case. Test that macro expansion is turned off for later
+ q, when not at start but at end of argument context, and supplied
+ with the '(' necessary for expansion. */
+ if (q(1 + q)(1) != 42) /* 1 + q(1) */
+ err ("Nested q");
+
+ /* This looks like it has too many ')', but it hasn't. */
+ if (k(1, 4) 35) != 42)
+ err ("k");
+
+ /* Phew! */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro10.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro10.c
new file mode 100644
index 000000000..20d4911e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro10.c
@@ -0,0 +1,25 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Source: Neil Booth, 23 Sep 2001.
+
+ A tricky, pathological corner case we used to get wrong. Expansion
+ should go as follows. The asterisk indicates the token has "blue
+ paint" can no longer be macro expanded. We used to lose that
+ information when parsing arguments and dropping to the lexer to get
+ the ')'.
+
+ foo )
+ bar foo* )
+ func (foo* )
+ foo*
+
+ If we try and expand the final foo, we get an "unterminated
+ argument list invoking macro <func>" error. If we do the right
+ thing and leave it as is, no diagnostics are emitted. */
+
+#define func(x) x
+#define bar func(
+#define foo bar foo
+foo )
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro11.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro11.c
new file mode 100644
index 000000000..b131223b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro11.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Source: Neil Booth, 2 Oct 2001.
+
+ Tests that we clear the disabled flag that is set by the
+ macro-defined-to-itself optimization (the optimization might not be
+ worth it). */
+
+#define foo foo
+#undef foo
+#define foo 1
+#if !foo
+#error foo still disabled!
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro2.c
new file mode 100644
index 000000000..2265a2b4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro2.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests the argument context get set at the lower level if we drop
+ contexts whilst parsing arguments. This would enter an infinite
+ loop in is_macro_disabled previously. */
+
+#define A Something
+#define B C
+#define C K(
+#define K(S) S
+#define T B A )
+T /* Expands to <Something>. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro3.c
new file mode 100644
index 000000000..e6a5ffc1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro3.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+/* First two tests sourced from a bug report of Thomas Pornin.
+ Varargs test source Jamie Lokier.
+ All adapted for the testsuite by Neil Booth, Oct 2000. */
+
+/* Tests various macro abuse is correctly expanded. */
+static int d = 4;
+#define c(x) d
+#define d(x) c(2)
+
+#if 0
+/* This macro chain above sucks up the whole file once it starts, so
+ I've commented it out. The example is left for idle amusement :-) */
+#define a(x) b(
+#define b(x) a(
+#endif
+
+#define apply(...) apply2 (__VA_ARGS__)
+#define half(x) ((x) / 2)
+#define apply2(f,x) f (x)
+
+extern void abort (void);
+extern void exit (int);
+
+int main()
+{
+ /* Expands to c(2) then d. */
+ if (c(c)(c) != 4)
+ abort ();
+
+ if (apply (half, 200) != 100)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro4.c
new file mode 100644
index 000000000..ceaf8ddbf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro4.c
@@ -0,0 +1,13 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test source Neil Booth. */
+
+#define glue(x, y) x ## y
+#define xglue(x, y) glue (x, y)
+
+/* Should expand to glue (1, 2), then 12. */
+#if glue (xgl, ue) (1, 2) != 12
+#error glue macro
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro5.c
new file mode 100644
index 000000000..9e226b871
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro5.c
@@ -0,0 +1,24 @@
+/* { dg-do preprocess } */
+
+/* Test source Robert Lipe, with minor modifications for the testsuite
+ by Neil Booth. 29 Oct 2000. */
+
+#define _VA_ARGS_0() 42
+#define _L_0() (
+#define _R_0() )
+
+#define __VA_ARGLIST(argc,list) \
+ _VA_ARGS_##argc list
+
+#define _CAT_LIST(argc,list1,list2) \
+ _L_##argc list1 _R_##argc list2
+
+#define _VA_ARGLIST(argc,list1,list2) \
+ __VA_ARGLIST(argc, \
+ _CAT_LIST(argc, list1, list2))
+
+#define BLAH(a) _VA_ARGLIST(a, (), ())
+
+#if BLAH (0) != 42
+#error Simulated varargs macros
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro6.c
new file mode 100644
index 000000000..0fe52ee43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro6.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+
+/* Test that, when a macro expansion spills into the source file, we
+ expand macros we suck in from there, as the standard clearly states
+ they are not nested.
+
+ Submitter: Neil Booth, with minor modifications to the originals. 3
+ Dec 2000.
+ Source: PR 962 and Thomas Pornin. */
+
+extern void abort (void);
+int e = 10, f = 100;
+
+#define e(n) 4 + n
+#define X e
+#define f(x) x
+#define h(x) x + f
+
+int
+main ()
+{
+ if (X(X) != 14) /* Should expand to "4 + e". */
+ abort ();
+
+ if (X(X(f)) != 108) /* Should expand to "4 + 4 + f". */
+ abort ();
+
+ if (h(e)(h(e)) != 120) /* Should expand to "e + e + f". */
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro7.c
new file mode 100644
index 000000000..6f2c67c10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro7.c
@@ -0,0 +1,10 @@
+/* { dg-do preprocess } */
+
+/* Test we don't complain about directives in macro expansions when
+ looking for the '(' of a function-like macro.
+
+ Submitter: Neil Booth. 3 Mar 2000. */
+
+#define f(x) x
+f
+#define g
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro8.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro8.c
new file mode 100644
index 000000000..f49b0be9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro8.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options -std=gnu89 } */
+
+/* GCC 2.95.2 used to get the following variable argument macro
+ expansions wrong.
+
+ Source: Neil Booth, from PR 3852 with persmission. 31 Jul 2001. */
+
+#define TEST_WORSE(args...) (5, ## args)
+#define TEST_BAD(foo, args...) (2, (foo), ## args)
+
+extern void abort ();
+
+static int add (int a, int b)
+{
+ return a + b;
+}
+
+int main ()
+{
+ /* Would expand to a single closing parenthesis, maybe because of
+ the "no args requires space" brokenness. */
+ if (TEST_WORSE () != 5)
+ abort ();
+ /* The macro would expand to (0, (0) with a missing closing parenthesis. */
+ if (add TEST_BAD (5) != 7)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro9.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro9.c
new file mode 100644
index 000000000..ef9e3697e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macro9.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+/* Source: Neil Booth, 15 Sep 2001.
+
+ A silly test to check that if a function-like macro name is
+ immediately followed by a directive, then we process the directive
+ properly. */
+
+#define main()
+int main
+#define mainbody () { return 0; }
+mainbody
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macspace1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macspace1.c
new file mode 100644
index 000000000..d8578448b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macspace1.c
@@ -0,0 +1,63 @@
+/* PR preprocessor/19475 */
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+#define a! /* { dg-warning "missing whitespace" } */
+#define b" /* { dg-warning "missing whitespace" } */
+#define c# /* { dg-warning "missing whitespace" } */
+#define d% /* { dg-warning "missing whitespace" } */
+#define e& /* { dg-warning "missing whitespace" } */
+#define f' /* { dg-warning "missing whitespace" } */
+#define g) /* { dg-warning "missing whitespace" } */
+#define h* /* { dg-warning "missing whitespace" } */
+#define i+ /* { dg-warning "missing whitespace" } */
+#define j, /* { dg-warning "missing whitespace" } */
+#define k- /* { dg-warning "missing whitespace" } */
+#define l. /* { dg-warning "missing whitespace" } */
+#define m/ /* { dg-warning "missing whitespace" } */
+#define n: /* { dg-warning "missing whitespace" } */
+#define o; /* { dg-warning "missing whitespace" } */
+#define p< /* { dg-warning "missing whitespace" } */
+#define q= /* { dg-warning "missing whitespace" } */
+#define r> /* { dg-warning "missing whitespace" } */
+#define s? /* { dg-warning "missing whitespace" } */
+#define t[ /* { dg-warning "missing whitespace" } */
+#define u] /* { dg-warning "missing whitespace" } */
+#define v^ /* { dg-warning "missing whitespace" } */
+#define w{ /* { dg-warning "missing whitespace" } */
+#define x| /* { dg-warning "missing whitespace" } */
+#define y} /* { dg-warning "missing whitespace" } */
+#define z~ /* { dg-warning "missing whitespace" } */
+#define A>> /* { dg-warning "missing whitespace" } */
+#define B<< /* { dg-warning "missing whitespace" } */
+#define E&& /* { dg-warning "missing whitespace" } */
+#define F|| /* { dg-warning "missing whitespace" } */
+#define G== /* { dg-warning "missing whitespace" } */
+#define H!= /* { dg-warning "missing whitespace" } */
+#define I>= /* { dg-warning "missing whitespace" } */
+#define J<= /* { dg-warning "missing whitespace" } */
+#define K+= /* { dg-warning "missing whitespace" } */
+#define L-= /* { dg-warning "missing whitespace" } */
+#define M*= /* { dg-warning "missing whitespace" } */
+#define N/= /* { dg-warning "missing whitespace" } */
+#define O%= /* { dg-warning "missing whitespace" } */
+#define P&= /* { dg-warning "missing whitespace" } */
+#define Q|= /* { dg-warning "missing whitespace" } */
+#define R^= /* { dg-warning "missing whitespace" } */
+#define S>>= /* { dg-warning "missing whitespace" } */
+#define T<<= /* { dg-warning "missing whitespace" } */
+#define W... /* { dg-warning "missing whitespace" } */
+#define X++ /* { dg-warning "missing whitespace" } */
+#define Y-- /* { dg-warning "missing whitespace" } */
+#define Z-> /* { dg-warning "missing whitespace" } */
+#define aa:: /* { dg-warning "missing whitespace" } */
+#define ab->* /* { dg-warning "missing whitespace" } */
+#define ac.* /* { dg-warning "missing whitespace" } */
+#define ad\x /* { dg-warning "missing whitespace" } */
+#define ae\\x /* { dg-warning "missing whitespace" } */
+#define af'1' /* { dg-warning "missing whitespace" } */
+#define ag"abc" /* { dg-warning "missing whitespace" } */
+
+int dummy;
+/* { dg-error "missing terminating" "" { target *-*-* } 6 } */
+/* { dg-error "missing terminating" "" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macspace2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macspace2.c
new file mode 100644
index 000000000..6e6be96b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macspace2.c
@@ -0,0 +1,63 @@
+/* PR preprocessor/19475 */
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#define a! /* { dg-error "requires whitespace" } */
+#define b" /* { dg-error "requires whitespace" } */
+#define c# /* { dg-error "requires whitespace" } */
+#define d% /* { dg-error "requires whitespace" } */
+#define e& /* { dg-error "requires whitespace" } */
+#define f' /* { dg-error "requires whitespace" } */
+#define g) /* { dg-error "requires whitespace" } */
+#define h* /* { dg-error "requires whitespace" } */
+#define i+ /* { dg-error "requires whitespace" } */
+#define j, /* { dg-error "requires whitespace" } */
+#define k- /* { dg-error "requires whitespace" } */
+#define l. /* { dg-error "requires whitespace" } */
+#define m/ /* { dg-error "requires whitespace" } */
+#define n: /* { dg-error "requires whitespace" } */
+#define o; /* { dg-error "requires whitespace" } */
+#define p< /* { dg-error "requires whitespace" } */
+#define q= /* { dg-error "requires whitespace" } */
+#define r> /* { dg-error "requires whitespace" } */
+#define s? /* { dg-error "requires whitespace" } */
+#define t[ /* { dg-error "requires whitespace" } */
+#define u] /* { dg-error "requires whitespace" } */
+#define v^ /* { dg-error "requires whitespace" } */
+#define w{ /* { dg-error "requires whitespace" } */
+#define x| /* { dg-error "requires whitespace" } */
+#define y} /* { dg-error "requires whitespace" } */
+#define z~ /* { dg-error "requires whitespace" } */
+#define A>> /* { dg-error "requires whitespace" } */
+#define B<< /* { dg-error "requires whitespace" } */
+#define E&& /* { dg-error "requires whitespace" } */
+#define F|| /* { dg-error "requires whitespace" } */
+#define G== /* { dg-error "requires whitespace" } */
+#define H!= /* { dg-error "requires whitespace" } */
+#define I>= /* { dg-error "requires whitespace" } */
+#define J<= /* { dg-error "requires whitespace" } */
+#define K+= /* { dg-error "requires whitespace" } */
+#define L-= /* { dg-error "requires whitespace" } */
+#define M*= /* { dg-error "requires whitespace" } */
+#define N/= /* { dg-error "requires whitespace" } */
+#define O%= /* { dg-error "requires whitespace" } */
+#define P&= /* { dg-error "requires whitespace" } */
+#define Q|= /* { dg-error "requires whitespace" } */
+#define R^= /* { dg-error "requires whitespace" } */
+#define S>>= /* { dg-error "requires whitespace" } */
+#define T<<= /* { dg-error "requires whitespace" } */
+#define W... /* { dg-error "requires whitespace" } */
+#define X++ /* { dg-error "requires whitespace" } */
+#define Y-- /* { dg-error "requires whitespace" } */
+#define Z-> /* { dg-error "requires whitespace" } */
+#define aa:: /* { dg-error "requires whitespace" } */
+#define ab->* /* { dg-error "requires whitespace" } */
+#define ac.* /* { dg-error "requires whitespace" } */
+#define ad\x /* { dg-error "requires whitespace" } */
+#define ae\\x /* { dg-error "requires whitespace" } */
+#define af'1' /* { dg-error "requires whitespace" } */
+#define ag"abc" /* { dg-error "requires whitespace" } */
+
+int dummy;
+/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 6 } */
+/* { dg-error "missing terminating" "missing-terminating" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macsyntx.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macsyntx.c
new file mode 100644
index 000000000..495921efa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/macsyntx.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic -std=gnu99" } */
+
+/* Tests macro syntax, for both definition and invocation, including:-
+
+ o Full range of macro definition semantics.
+ o No. of arguments supplied to function-like macros.
+ o Odd GNU rest args behavior.
+ o Macro arguments do not flow into the rest of the file. */
+
+
+/* Test basic macro definition syntax. The macros are all called
+ "foo" deliberately to provoke an (excess) redefinition warning in
+ case the macros succeed in being entered in the macro hash table
+ despite being an error.
+
+ Split a couple of the lines to check that the errors appear on the
+ right line (i.e. are associated with the correct token). */
+
+#define ; /* { dg-error "identifier" } */
+#define SEMI; /* { dg-warning "space" } */
+#define foo(X /* { dg-error "missing" } */
+#define foo\
+(X,) /* { dg-error "parameter name" } */
+#define foo(, X) /* { dg-error "parameter name" } */
+#define foo(X, X) /* { dg-error "duplicate" } */
+#define foo(X Y) /* { dg-error "comma" } */
+#define foo(() /* { dg-error "may not appear" } */
+#define foo(..., X) /* { dg-error "missing" } */
+#define foo \
+__VA_ARGS__ /* { dg-warning "__VA_ARGS__" } */
+#define goo(__VA_ARGS__) /* { dg-warning "__VA_ARGS__" } */
+#define hoo(...) __VA_ARGS__ /* OK. */
+#define __VA_ARGS__ /* { dg-warning "__VA_ARGS__" } */
+__VA_ARGS__ /* { dg-warning "__VA_ARGS__" } */
+
+/* test # of supplied arguments. */
+#define none()
+#define one(x)
+#define two(x, y)
+#define var0(...)
+#define var1(x, ...)
+none() /* OK. */
+none(ichi) /* { dg-error "passed 1" } */
+one() /* OK. */
+one(ichi) /* OK. */
+one(ichi\
+, ni) /* { dg-error "passed 2" } */
+two(ichi) /* { dg-error "requires 2" } */
+var0() /* OK. */
+var0(ichi) /* OK. */
+var1() /* { dg-warning "rest arguments to be used" } */
+var1(ichi) /* { dg-warning "rest arguments to be used" } */
+var1(ichi, ni) /* OK. */
+
+/* This tests two oddities of GNU rest args - omitting a comma is OK,
+ and backtracking a token on pasting an empty rest args. */
+#define rest(x, y...) x ## y /* { dg-warning "ISO C" } */
+rest(ichi,) /* OK. */
+rest(ichi) /* { dg-warning "rest arguments to be used" } */
+#if 23 != rest(2, 3) /* OK, no warning. */
+#error 23 != 23 !!
+#endif
+
+/* Test that we don't allow arguments to flow into the rest of the
+ file. */
+#define half_invocation do_nowt(2
+#define do_nowt(x) x
+half_invocation ) /* OK. */
+do_nowt (half_invocation)) /* { dg-error "unterminated argument" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1.c
new file mode 100644
index 000000000..0cfedad2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1.c
@@ -0,0 +1,39 @@
+/* Test "ignore redundant include" facility.
+
+ We must test with C and C++ comments, and null directives, outside
+ the guard conditional; also, we test guarding with #ifndef and #if
+ !defined. -H is used because cpp might confuse the issue by
+ optimizing out #line markers. This test only passes if each of the
+ headers is read exactly once.
+
+ The disgusting regexp in the dg-error line, when stuck into
+ dg.exp's compiler-output regexp, matches the correct -H output and
+ only the correct -H output. It has to be all on one line because
+ otherwise it will not be interpreted all in one unit. */
+
+/* { dg-do compile }
+ { dg-options "-H" }
+ { dg-message "mi1c\.h\n\[^\n\]*mi1cc\.h\n\[^\n\]*mi1nd\.h\n\[^\n\]*mi1ndp\.h\n\[^\n\]*mi1x\.h" "redundant include check" { target *-*-* } 0 } */
+
+#include "mi1c.h"
+#include "mi1c.h"
+#include "mi1c.h"
+
+#include "mi1cc.h"
+#include "mi1cc.h"
+
+#include "mi1nd.h"
+#include "mi1nd.h"
+
+#include "mi1ndp.h"
+#include "mi1ndp.h"
+
+#define MIX_H
+#include "mi1x.h"
+#include "mi1x.h"
+
+int
+main (void)
+{
+ return a + b + c + d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1c.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1c.h
new file mode 100644
index 000000000..2956286eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1c.h
@@ -0,0 +1,12 @@
+/* Redundant header include test with C comments at top. */
+# /* And a null directive at the top. */
+
+#ifndef CPP_MIC_H
+#define CPP_MIC_H
+
+int a;
+
+#endif
+
+# /* And at the end, too! */
+/* And at the end too! */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1cc.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1cc.h
new file mode 100644
index 000000000..46a38cded
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1cc.h
@@ -0,0 +1,10 @@
+// Redundant header include test with C comments at top.
+
+#ifndef CPP_MICC_H
+#define CPP_MICC_H
+
+int b;
+
+#endif
+
+// And at the end too!
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1nd.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1nd.h
new file mode 100644
index 000000000..c14c1a3c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1nd.h
@@ -0,0 +1,8 @@
+/* Redundant include check with #if !defined. */
+
+#if !defined CPP_MIND_H
+#define CPP_MIND_H
+
+int c;
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1ndp.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1ndp.h
new file mode 100644
index 000000000..b84202c6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1ndp.h
@@ -0,0 +1,7 @@
+#if !defined ( CPP_MINDP_H)
+#define CPP_MINDP_H
+
+/* Redundant include check with #if !defined and parentheses. */
+int d;
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1x.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1x.h
new file mode 100644
index 000000000..a317cf852
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi1x.h
@@ -0,0 +1,9 @@
+/* This header is never to have its contents visible, but it should
+ still receive the optimization. */
+
+#ifndef MIX_H
+#define MIX_H
+
+#define main wibble
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2.c
new file mode 100644
index 000000000..916d5a949
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2.c
@@ -0,0 +1,12 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+/* { dg-do compile } */
+
+#include "mi2a.h"
+#include "mi2b.h"
+
+int main (void)
+{
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2a.h
new file mode 100644
index 000000000..e3f53b6cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2a.h
@@ -0,0 +1,5 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+
+#include "mi2c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2b.h
new file mode 100644
index 000000000..1d9a8b9b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2b.h
@@ -0,0 +1,6 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+
+#define need_x
+#include "mi2c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2c.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2c.h
new file mode 100644
index 000000000..521792bee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi2c.h
@@ -0,0 +1,15 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+#ifdef need_x
+#undef need_x
+#ifndef have_x
+#define have_x
+extern int x;
+#endif
+#endif
+
+#ifndef t_h
+#define t_h
+extern int y;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.c
new file mode 100644
index 000000000..f33fd7887
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.c
@@ -0,0 +1,20 @@
+/* Another test case for over-eager multiple include optimization.
+ This one distilled from glibc's setlocale.c and categories.def. */
+/* { dg-do compile } */
+
+#define X a
+#include "mi3.def"
+#undef X
+
+#define X b
+#include "mi3.def"
+#undef X
+
+#include "mi3.h"
+#include "mi3.h" /* The second include declares variable c. */
+
+int
+main(void)
+{
+ return a + b + c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.def b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.def
new file mode 100644
index 000000000..375d9c7fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.def
@@ -0,0 +1,10 @@
+/* Another test case for over-eager multiple include optimization.
+ This one distilled from glibc's setlocale.c and categories.def.
+ The #ifdef block doesn't cover the entire file, so it must not be
+ taken for a reinclude guard. */
+
+#ifndef NO_POSTLOAD
+#define NO_POSTLOAD NULL
+#endif
+
+int X;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.h
new file mode 100644
index 000000000..8774fcf48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi3.h
@@ -0,0 +1,7 @@
+/* Another test case for over-eager multiple include optimization. */
+
+#ifndef GUARD
+#define GUARD
+#elif 1 /* #elif kills optimisation */
+int c;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi4.c
new file mode 100644
index 000000000..c886cc2c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi4.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Undefining a macro guard and re-including the file used to confuse
+ file caching in cppfiles.c, and attempt to open a bad fd. */
+
+#include "mi1c.h"
+#undef CPP_MIC_H
+#include "mi1c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi5.c
new file mode 100644
index 000000000..09f4f5c0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi5.c
@@ -0,0 +1,13 @@
+/* Test "ignore redundant include" facility, with -C on.
+
+ The disgusting regexp in the dg-error line, when stuck into
+ dg.exp's compiler-output regexp, matches the correct -H output and
+ only the correct -H output. It has to be all on one line because
+ otherwise it will not be interpreted all in one unit. */
+
+/* { dg-do preprocess }
+ { dg-options "-nostdinc -H -C" }
+ { dg-message "mi1c\.h" "redundant include check with -C" { target *-*-* } 0 } */
+
+#include "mi1c.h"
+#include "mi1c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6.c
new file mode 100644
index 000000000..c3af2d3f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6.c
@@ -0,0 +1,61 @@
+/* Another test case for over-eager multiple include optimization,
+ where the leading "#if !defined" expression is obtained partially,
+ or wholly, from macros. Neil Booth, 30 Sep 2001. */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern void abort (void);
+
+/* Each include file should not be subject to MI optimisation, since
+ macro definitions can change. Each header increments the variable
+ VAR if it is defined.
+
+ The first set of inclusions gets the headers into CPP's cache, but
+ does nothing since VAR is not defined. The second set should each
+ increment VAR, since none of the initial set should have been
+ flagged as optimizable. */
+
+#define EMPTYL
+#define EMPTYR
+#define NOT !
+#define DEFINED defined (guard)
+#define NOT_DEFINED ! defined (guard)
+
+#include "mi6a.h"
+#include "mi6b.h"
+#include "mi6c.h"
+#include "mi6d.h"
+#include "mi6e.h"
+
+/* Define the macro guard, and redefine the macros to something that
+ forces compilation of the conditional blocks. */
+#define guard
+#undef EMPTYL
+#define EMPTYL 1 ||
+#undef EMPTYR
+#define EMPTYR || 1
+#undef NOT
+#define NOT
+#undef DEFINED
+#define DEFINED 0
+#undef NOT_DEFINED
+#define NOT_DEFINED 1
+
+#define VAR five
+
+int
+main(void)
+{
+ unsigned int five = 0;
+
+#include "mi6a.h"
+#include "mi6b.h"
+#include "mi6c.h"
+#include "mi6d.h"
+#include "mi6e.h"
+
+ if (five != 5)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6a.h
new file mode 100644
index 000000000..68a2fce47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6a.h
@@ -0,0 +1,5 @@
+#if NOT_DEFINED
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6b.h
new file mode 100644
index 000000000..d2fe8be17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6b.h
@@ -0,0 +1,5 @@
+#if NOT defined (guard)
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6c.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6c.h
new file mode 100644
index 000000000..d19cb5433
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6c.h
@@ -0,0 +1,5 @@
+#if !DEFINED
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6d.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6d.h
new file mode 100644
index 000000000..a1eabba8e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6d.h
@@ -0,0 +1,5 @@
+#if EMPTYL !defined (guard)
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6e.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6e.h
new file mode 100644
index 000000000..26ba71514
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi6e.h
@@ -0,0 +1,5 @@
+#if !defined (guard) EMPTYR
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c
new file mode 100644
index 000000000..415186cba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c
@@ -0,0 +1,19 @@
+/* Test "ignore redundant include" facility.
+
+ -H is used because cpp might confuse the issue by optimizing out
+ #line markers. This test only passes if the headers is read
+ twice.
+
+ The disgusting regexp in the dg-error line, when stuck into
+ dg.exp's compiler-output regexp, matches the correct -H output and
+ only the correct -H output. It has to be all on one line because
+ otherwise it will not be interpreted all in one unit. */
+
+/* { dg-do preprocess }
+ { dg-options "-H" }
+ { dg-message "mi7a\.h\n\[^\n\]*mi7a\.h\n\[^\n\]*mi7b\.h\n\[^\n\]*mi7b\.h" "redundant include check" { target *-*-* } 0 } */
+
+#include "mi7a.h"
+#include "mi7a.h"
+#include "mi7b.h"
+#include "mi7b.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7a.h
new file mode 100644
index 000000000..0c701d7e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7a.h
@@ -0,0 +1,4 @@
+:
+#ifndef GUARD1
+#define GUARD1
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7b.h
new file mode 100644
index 000000000..1747e5482
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7b.h
@@ -0,0 +1,4 @@
+#ifndef GUARD2
+#define GUARD2
+#endif
+:
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8.c
new file mode 100644
index 000000000..1999918de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8.c
@@ -0,0 +1,8 @@
+/* Test multiple include guards suggestions. */
+
+/* { dg-do preprocess }
+ { dg-options "-H" }
+ { dg-message "mi8a\.h\n\[^\n\]*mi8c\.h\n\[^\n\]*mi8b\.h\n\[^\n\]*mi8d\.h\nMultiple include guards may be useful for:\n\[^\n\]*mi8a\.h\n\[^\n\]*mi8d\.h\n" "" { target *-*-* } 0 } */
+
+#include "mi8a.h"
+#include "mi8b.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8a.h
new file mode 100644
index 000000000..893d9ff13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8a.h
@@ -0,0 +1 @@
+#include "mi8c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8b.h
new file mode 100644
index 000000000..8e3482ce7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8b.h
@@ -0,0 +1,4 @@
+#ifndef GUARDB
+#define GUARDB
+#include "mi8d.h"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8c.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8c.h
new file mode 100644
index 000000000..08c5cab94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8c.h
@@ -0,0 +1,4 @@
+#ifndef GUARDC
+#define GUARDC
+/* Empty */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8d.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8d.h
new file mode 100644
index 000000000..710cecca9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi8d.h
@@ -0,0 +1 @@
+/* Empty */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-1.c
new file mode 100644
index 000000000..a597a4696
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-1.c
@@ -0,0 +1,10 @@
+/* Test that missing headers are fatal errors. PR 15638. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#include "nonexistent.h"
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
+
+/* This declaration should not receive any diagnostic. */
+foo bar;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-MD.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-MD.c
new file mode 100644
index 000000000..793fb179b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-MD.c
@@ -0,0 +1,10 @@
+/* Test that missing user headers are fatal errors with -MD. PR 28435. */
+/* { dg-do compile } */
+/* { dg-options "-MD" } */
+
+#include "nonexistent.h"
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
+
+/* This declaration should not receive any diagnostic. */
+foo bar;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-MMD.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-MMD.c
new file mode 100644
index 000000000..bba85ede9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-header-MMD.c
@@ -0,0 +1,10 @@
+/* Test that missing user headers are fatal errors with -MMD. PR 28435. */
+/* { dg-do compile } */
+/* { dg-options "-MMD" } */
+
+#include "nonexistent.h"
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
+
+/* This declaration should not receive any diagnostic. */
+foo bar;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-sysheader-MD.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-sysheader-MD.c
new file mode 100644
index 000000000..2983f2d58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-sysheader-MD.c
@@ -0,0 +1,10 @@
+/* Test that missing system headers are fatal errors with -MD. PR 28435. */
+/* { dg-do compile } */
+/* { dg-options "-MD" } */
+
+#include <nonexistent.h>
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
+
+/* This declaration should not receive any diagnostic. */
+foo bar;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-sysheader-MMD.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-sysheader-MMD.c
new file mode 100644
index 000000000..351228661
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/missing-sysheader-MMD.c
@@ -0,0 +1,10 @@
+/* Test that missing system headers are fatal errors with -MMD. PR 28435. */
+/* { dg-do compile } */
+/* { dg-options "-MMD" } */
+
+#include <nonexistent.h>
+/* { dg-message "nonexistent.h" "nonexistent.h" { target *-*-* } 0 } */
+/* { dg-message "terminated" "terminated" { target *-*-* } 0 } */
+
+/* This declaration should not receive any diagnostic. */
+foo bar;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/multiline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/multiline-2.c
new file mode 100644
index 000000000..6a674b4dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/multiline-2.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+/* Test that multi-line tokens are rejected by the compiler. Source:
+ Neil Booth. */
+
+const char *p = "line 1
+"
+""; /* The compiler front end sees this. */
+
+/* { dg-error "missing term" "multiline strings" { target *-*-* } 8 } */
+/* { dg-error "missing term" "multiline strings" { target *-*-* } 9 } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/multiline.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/multiline.c
new file mode 100644
index 000000000..970cf2faa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/multiline.c
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. */
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -C" } */
+/* Test that multi-line tokens are recognized by cpp0 as being
+ multiline . Source: Neil Booth, 17 Dec 2000. */
+/* Line 1
+ Line 2
+ Line 3
+ Line 4
+*/
+"line 1
+ line 2
+ line 3
+ line 4"
+L"line 1
+ line 2
+ line 3
+ line 4"
+/* Nowhere in the output of this file should there be a blank line.
+ We check for that in the .i file.
+ { dg-final { scan-file-not multiline.i "(^|\\n)\\n" } } */
+/* { dg-warning "missing term" "multiline strings" { target *-*-* } 11 } */
+/* { dg-warning "missing term" "multiline strings" { target *-*-* } 14 } */
+/* { dg-warning "missing term" "multiline strings" { target *-*-* } 15 } */
+/* { dg-warning "missing term" "multiline strings" { target *-*-* } 18 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-1.c
new file mode 100644
index 000000000..b20f235ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-1.c
@@ -0,0 +1,34 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+
+\u00AA
+\u00B7
+\u0F43 /* { dg-warning "not in NFC" } */
+a\u05B8\u05B9\u05B9\u05BBb
+ a\u05BB\u05B9\u05B8\u05B9b /* { dg-warning "not in NFC" } */
+\u09CB
+\u09C7\u09BE /* { dg-warning "not in NFC" } */
+\u0B4B
+\u0B47\u0B3E /* { dg-warning "not in NFC" } */
+\u0BCA
+\u0BC6\u0BBE /* { dg-warning "not in NFC" } */
+\u0BCB
+\u0BC7\u0BBE /* { dg-warning "not in NFC" } */
+\u0CCA
+\u0CC6\u0CC2 /* { dg-warning "not in NFC" } */
+\u0D4A
+\u0D46\u0D3E /* { dg-warning "not in NFC" } */
+\u0D4B
+\u0D47\u0D3E /* { dg-warning "not in NFC" } */
+
+K
+\u212A /* { dg-warning "not in NFC" } */
+
+\u03AC
+\u1F71 /* { dg-warning "not in NFC" } */
+
+\uAC00
+\u1100\u1161 /* { dg-warning "not in NFC" } */
+\uAC01
+\u1100\u1161\u11A8 /* { dg-warning "not in NFC" } */
+\uAC00\u11A8 /* { dg-warning "not in NFC" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-2.c
new file mode 100644
index 000000000..6f2f49564
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-2.c
@@ -0,0 +1,34 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -fextended-identifiers -Wnormalized=nfkc" } */
+
+\u00AA /* { dg-warning "not in NFKC" } */
+\u00B7
+\u0F43 /* { dg-warning "not in NFC" } */
+a\u05B8\u05B9\u05B9\u05BBb
+ a\u05BB\u05B9\u05B8\u05B9b /* { dg-warning "not in NFC" } */
+\u09CB
+\u09C7\u09BE /* { dg-warning "not in NFC" } */
+\u0B4B
+\u0B47\u0B3E /* { dg-warning "not in NFC" } */
+\u0BCA
+\u0BC6\u0BBE /* { dg-warning "not in NFC" } */
+\u0BCB
+\u0BC7\u0BBE /* { dg-warning "not in NFC" } */
+\u0CCA
+\u0CC6\u0CC2 /* { dg-warning "not in NFC" } */
+\u0D4A
+\u0D46\u0D3E /* { dg-warning "not in NFC" } */
+\u0D4B
+\u0D47\u0D3E /* { dg-warning "not in NFC" } */
+
+K
+\u212A /* { dg-warning "not in NFC" } */
+
+\u03AC
+\u1F71 /* { dg-warning "not in NFC" } */
+
+\uAC00
+\u1100\u1161 /* { dg-warning "not in NFC" } */
+\uAC01
+\u1100\u1161\u11A8 /* { dg-warning "not in NFC" } */
+\uAC00\u11A8 /* { dg-warning "not in NFC" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-4.c
new file mode 100644
index 000000000..0040c03aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/normalize-4.c
@@ -0,0 +1,34 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -fextended-identifiers -Wnormalized=none" } */
+
+\u00AA
+\u00B7
+\u0F43
+a\u05B8\u05B9\u05B9\u05BBb
+ a\u05BB\u05B9\u05B8\u05B9b
+\u09CB
+\u09C7\u09BE
+\u0B4B
+\u0B47\u0B3E
+\u0BCA
+\u0BC6\u0BBE
+\u0BCB
+\u0BC7\u0BBE
+\u0CCA
+\u0CC6\u0CC2
+\u0D4A
+\u0D46\u0D3E
+\u0D4B
+\u0D47\u0D3E
+
+K
+\u212A
+
+\u03AC
+\u1F71
+
+\uAC00
+\u1100\u1161
+\uAC01
+\u1100\u1161\u11A8
+\uAC00\u11A8
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste1.c
new file mode 100644
index 000000000..7b07f740c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste1.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test operator ## semantics. */
+
+#define bad1 ## owt /* { dg-error "cannot" "## at objlike start" } */
+#define bad2 owt ## /* { dg-error "cannot" "## at objlike end" } */
+#define bad3(x) ## x /* { dg-error "cannot" "## at funlike start" } */
+#define bad4(x) x ## /* { dg-error "cannot" "## at funlike end" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste10.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste10.c
new file mode 100644
index 000000000..ab3cb9050
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste10.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+/* This testcase used to produce a bogus "invalid paste" warning, owing
+ to not clearing a PASTE_LEFT flag. */
+
+#define strcpy(src) __strcpy_small (src)
+
+#define __strcpy_small(src) src
+
+#define tprintf(format, args...) sprintf(format, ## args)
+
+strcpy(tprintf("<%s>", test))
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste11.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste11.c
new file mode 100644
index 000000000..e3860ebb7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste11.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test correct pasting of identifiers and numbers. We can paste any
+ number, as long as no '.', '-' or '+' appears in its spelling. */
+
+#define glue(x, y) x ## y
+
+glue (ident, 12) /* OK. */
+glue (ident, 12e3) /* OK. */
+glue (ident, 12e+3) /* { dg-error "valid preprocessing tok" } */
+glue (ident, 12e-3) /* { dg-error "valid preprocessing tok" } */
+glue (ident, 1.2) /* { dg-error "valid preprocessing tok" } */
+glue (ident, .12) /* { dg-error "valid preprocessing tok" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste12-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste12-2.c
new file mode 100644
index 000000000..6e2e4f105
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste12-2.c
@@ -0,0 +1,11 @@
+/*
+ { dg-options "-ftrack-macro-expansion=2" }
+ { dg-do preprocess }
+ */
+
+/* Test correct diagnostics when pasting in #include.
+ Source: PR preprocessor/6780. */
+
+#define inc2(a,b) <##a.b> /* { dg-error "pasting \"<\" and \"stdio\" does not" } */
+#define INC(X) inc2(X,h)
+#include INC(stdio)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste12.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste12.c
new file mode 100644
index 000000000..3e0f7b959
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste12.c
@@ -0,0 +1,11 @@
+/*
+ { dg-options "-ftrack-macro-expansion=0" }
+ { dg-do preprocess }
+*/
+
+/* Test correct diagnostics when pasting in #include.
+ Source: PR preprocessor/6780. */
+
+#define inc2(a,b) <##a.b>
+#define INC(X) inc2(X,h)
+#include INC(stdio) /* { dg-error "pasting \"<\" and \"stdio\" does not" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste13.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste13.c
new file mode 100644
index 000000000..f0f4fd894
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste13.c
@@ -0,0 +1,12 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/*
+ { dg-options "-ftrack-macro-expansion=0" }
+ { dg-do preprocess }
+*/
+
+/* This used to be recognized as a comment when lexing after pasting
+ spellings. Neil Booth, 9 Oct 2002. */
+
+#define a /##/=
+a /* { dg-error "valid preprocessing tok" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste14-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste14-2.c
new file mode 100644
index 000000000..3b23ada3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste14-2.c
@@ -0,0 +1,11 @@
+/* PR preprocessor/28709 */
+/*
+ { dg-options "-ftrack-macro-expansion=2" }
+ { dg-do preprocess }
+*/
+
+#define foo - ## >> /* { dg-error "pasting \"-\" and \">>\"" } */
+foo
+#define bar = ## == /* { dg-error "pasting \"=\" and \"==\"" } */
+bar
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste14.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste14.c
new file mode 100644
index 000000000..043d5e580
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste14.c
@@ -0,0 +1,10 @@
+/* PR preprocessor/28709 */
+/*
+ { dg-options "-ftrack-macro-expansion=0" }
+ { dg-do preprocess }
+*/
+
+#define foo - ## >>
+foo /* { dg-error "pasting \"-\" and \">>\"" } */
+#define bar = ## ==
+bar /* { dg-error "pasting \"=\" and \"==\"" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste15.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste15.c
new file mode 100644
index 000000000..9d4ec3631
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste15.c
@@ -0,0 +1,15 @@
+/* PR preprocessor/20077 */
+/* { dg-do preprocess } */
+
+#define a a ## ## /* { dg-error "end of a macro expansion" } */
+#define b() b ## ## /* { dg-error "end of a macro expansion" } */
+#define c c ## /* { dg-error "end of a macro expansion" } */
+#define d() d ## /* { dg-error "end of a macro expansion" } */
+
+
+#define e ## ## e /* { dg-error "end of a macro expansion" } */
+#define f() ## ## f /* { dg-error "end of a macro expansion" } */
+#define g ## g /* { dg-error "end of a macro expansion" } */
+#define h() ## h /* { dg-error "end of a macro expansion" } */
+#define i ## /* { dg-error "end of a macro expansion" } */
+#define j() ## /* { dg-error "end of a macro expansion" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste16.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste16.c
new file mode 100644
index 000000000..11aca2b60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste16.c
@@ -0,0 +1,6 @@
+/* Test multiple consecutive ## tokens. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+#define cat(x,y) x##########y
+int abcd;
+int *p = &cat(ab,cd);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste17.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste17.c
new file mode 100644
index 000000000..9c6506ff8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste17.c
@@ -0,0 +1,8 @@
+ /* { dg-options "-ftrack-macro-expansion=2" } */
+/* { dg-do preprocess } */
+
+#define do_paste 1.0e ## -1
+
+do_paste
+
+/* { dg-final {scan-file paste17.i "1.0e- 1" } }*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste18.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste18.c
new file mode 100644
index 000000000..2888144cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste18.c
@@ -0,0 +1,16 @@
+/*
+ { dg-options "-ftrack-macro-expansion=2" }
+ { dg-do compile }
+ */
+
+struct x {
+ int i;
+};
+struct x x;
+
+#define TEST(X) x.##X /* { dg-error "pasting\[^\n\r\]*does not give\[^\n\r\]*token" } */
+
+void foo (void)
+{
+ TEST(i) = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste2.c
new file mode 100644
index 000000000..788e4eb51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste2.c
@@ -0,0 +1,118 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+/* Test ## behavior and corner cases thoroughly. The macro expander
+ failed many of these during development. */
+
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ int
+#endif
+typedef __WCHAR_TYPE__ wchar_t;
+
+extern int strcmp (const char *, const char *);
+extern int puts (const char *);
+extern void abort (void);
+#define err(str) do { puts(str); abort(); } while (0)
+
+#define EMPTY
+#define str(x) #x
+#define xstr(x) str(x)
+#define glue(x, y) x ## y
+#define xglue(x, y) glue (x, y)
+#define glue3(x, y, z) x ## y ## z
+#define glue_var(x, ...) x ## __VA_ARGS__
+
+#define __muldi3 __NDW(mul, 3 = 50)
+#define __NDW(a,b) __ ## a ## di ## b
+#define m3 NDW()
+#define NDW(x) m3 ## x = 50
+#define five 5
+#define fifty int fif ## ty
+
+/* Defines a function called glue, returning what it is passed. */
+int glue (glue,) (int x)
+{
+ return x;
+}
+
+int main ()
+{
+ /* m3 and __muldi3 would sometimes cause an infinite loop. Ensure
+ we only expand fifty once. */
+ fifty = 50, m3, __muldi3;
+
+ /* General glue and macro expanding test. */
+ int five0 = xglue (glue (fi, ve), 0);
+
+ /* Tests only first and last tokens are pasted, and pasting to form
+ the != operator. Should expand to: if (five0 != 50). */
+ if (glue3 (fi, ve0 !,= glue (EMPTY 5, 0)))
+ err ("five0 != 50");
+
+ /* Test varags pasting, and pasting to form the >> operator. */
+ if (glue_var(50 >, > 1 != 25))
+ err ("Operator >> pasting");
+
+ /* The LHS should not attempt to expand twice, and thus becomes a
+ call to the function glue. */
+ if (glue (gl, ue) (12) != 12)
+ err ("Recursive macros");
+
+ /* Test placemarker pasting. The glued lines should all appear
+ neatly in the same column and below each other, though we don't
+ test that here. */
+ {
+ int glue3(a, b, ) = 1, glue3(a,,) = 1;
+ glue3(a, , b)++;
+ glue3(, a, b)++;
+ glue3(,a,)++;
+ glue3(,,a)++;
+ if (a != 3 || ab != 3 glue3(,,))
+ err ("Placemarker pasting");
+ }
+
+ /* Test that macros in arguments are not expanded. */
+ {
+ int glue (EMPTY,1) = 123, glue (T, EMPTY) = 123;
+ if (EMPTY1 != 123 || TEMPTY != 123)
+ err ("Pasted arguments macro expanding");
+ }
+
+ /* Test various paste combinations. */
+ {
+ const wchar_t* wc_array = glue(L, "wide string");
+ wchar_t wc = glue(L, 'w');
+ const char * hh = xstr(xglue(glue(%, :), glue(%, :)));
+ int array glue (<, :) 1 glue (:, >) = glue(<, %) 1 glue(%, >);
+ int x = 4;
+
+ if (array[0] != 1)
+ err ("Digraph pasting");
+
+ x glue (>>, =) 1; /* 2 */
+ x glue (<<, =) 1; /* 4 */
+ x glue (*, =) 2; /* 8 */
+ x glue (+, =) 100; /* 108 */
+ x glue (-, =) 50; /* 58 */
+ x glue (/, =) 2; /* 29 */
+ x glue (%, =) 20; /* 9 */
+ x glue (&, =) 254; /* 8 */
+ x glue (|, =) 16; /* 24 */
+ x glue (^, =) 18; /* 10 */
+
+ if (x != 10 || 0 glue (>, =) 1 glue (|, |) 1 glue (<, =) 0)
+ err ("Various operator pasting");
+ if (strcmp (hh, "%:%:"))
+ err ("Pasted digraph spelling");
+ if ((glue (., 1) glue (!, =) .1))
+ err ("Pasted numbers 1");
+ /* glue3 here will only work if we paste left-to-right. If a
+ future implementation does not do this, change the test. */
+ if (glue3 (1.0e, +, 1) != 10.0)
+ err ("Pasted numbers 2");
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste3.c
new file mode 100644
index 000000000..0c9c52de3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste3.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+#define plus +
+
+void foo()
+{
+ int a, b = 1;
+
+ /* The correct "a = 1 + ++b" will compile.
+ The incorrect "a = 1 +++b" won't. */
+ a = 1 plus++b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste4.c
new file mode 100644
index 000000000..dfc455ded
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste4.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+/* { dg-do compile } */
+/* { dg-options -save-temps } */
+
+/* Since 1.0e and + form the pasted token, 1 is a separate token and
+ so should be output with a preceding space. The old preprocessor
+ gets this wrong. We use -save-temps to avoid direct use of the
+ integrated preprocessor. */
+
+#define glue(x, y) x ## y
+
+int main ()
+{
+ double d = glue (1.0e, +1); /* { dg-error "exponent|parse error|syntax error|expected" } */
+ return 0;
+}
+
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste5.c
new file mode 100644
index 000000000..fd0406674
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste5.c
@@ -0,0 +1,24 @@
+/* Regression test for bug in convoluted situation involving token paste
+ plus function-like macros used outside function context. It may be
+ easier to understand if you mentally replace 'struct' with 'A'
+ throughout this file; 'struct' is used only to get the code to compile
+ when preprocessed correctly.
+
+ The original problem was seen in the Linux kernel and reported by
+ Jakub Jelinek <jakub@redhat.com>; this test is synthetic. */
+
+/* { dg-do compile } */
+
+#define glue(a,b) a##b
+#define struct(x) B(x)
+#define E(x) struct x
+#define FG (22)
+
+extern void B(int);
+
+void foo(void)
+{
+ E(glue(F,*)) dummy; /* { dg-error "valid preprocessing token" } */
+
+ E(glue(F,G)) ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste6.c
new file mode 100644
index 000000000..a4e70e450
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste6.c
@@ -0,0 +1,15 @@
+/* Regression test for paste appearing at the beginning of a set of
+ actual arguments. Original bug exposed by Linux kernel. Problem
+ reported by Jakub Jelinek <jakub@redhat.com>. */
+
+/*
+ { dg-options "-ftrack-macro-expansion=0" }
+ { dg-do compile }
+*/
+
+extern int foo(int x);
+
+#define bar(x) foo(x)
+#define baz(x) bar(##x)
+
+int quux(int y) { return baz(y); } /* { dg-error "valid preprocessing" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c
new file mode 100644
index 000000000..ce29db847
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste7.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+#define D_2 1, 2
+#define C_2(X, I0, I1) X##_a = I0, X##_b = I1
+#define B_2(X, I) C_2(X, I)
+#define A(N, X) B_##N (X, D_##N)
+
+extern void abort(void);
+extern void exit(int);
+
+int x_a, x_b;
+
+int main(void)
+{
+ A(2, x);
+ if (x_a != 1 || x_b != 2)
+ abort();
+ exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste8-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste8-2.c
new file mode 100644
index 000000000..c037e99e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste8-2.c
@@ -0,0 +1,15 @@
+/* { dg-do preprocess } */
+/* { dg-options "-ftrack-macro-expansion=2" } */
+
+int foo(int, ...);
+
+#define a(x, y...) foo(x, ##y)
+a(1)
+a(1, 2, 3)
+#define b(x, y, z...) foo(x, ##y) /* { dg-error "valid preprocessing token" } */
+b(1, 2, 3)
+#define c(x, y, z...) foo(x, ##z)
+c(1, 2)
+c(1, 2, 3)
+#define d(x) fo(##x) /* { dg-error "valid preprocessing token" } */
+d(1)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste8.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste8.c
new file mode 100644
index 000000000..db1416c12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste8.c
@@ -0,0 +1,15 @@
+/* { dg-do preprocess } */
+/* { dg-options "-ftrack-macro-expansion=0" } */
+
+int foo(int, ...);
+
+#define a(x, y...) foo(x, ##y)
+a(1)
+a(1, 2, 3)
+#define b(x, y, z...) foo(x, ##y)
+b(1, 2, 3) /* { dg-error "valid preprocessing token" } */
+#define c(x, y, z...) foo(x, ##z)
+c(1, 2)
+c(1, 2, 3)
+#define d(x) fo(##x)
+d(1) /* { dg-error "valid preprocessing token" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste9.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste9.c
new file mode 100644
index 000000000..35c86b4e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/paste9.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "" } */
+
+/* Apparently older preprocessors used to fail this test. */
+
+#include <string.h>
+
+extern void abort (void);
+
+#define S(str, args...) " " str "\n", ##args
+
+int
+main()
+{
+ const char *s = S("foo");
+
+ if (strchr (s, '\n') == NULL)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/poison.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/poison.c
new file mode 100644
index 000000000..f85405c09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/poison.c
@@ -0,0 +1,24 @@
+/* { dg-do preprocess } */
+
+#pragma GCC poison foo
+foo /* { dg-error "foo" "use of foo" } */
+#pragma GCC poison foo2 foo3
+foo2 /* { dg-error "foo2" "use of foo2" } */
+foo3 /* { dg-error "foo3" "use of foo3" } */
+#pragma GCC poison foo4 foo5
+foo4 /* { dg-error "foo4" "use of foo4" } */
+foo5 /* { dg-error "foo5" "use of foo5" } */
+#pragma GCC poison +++ /* { dg-error "invalid" "poison non-identifier" } */
+#define foo6 123
+#pragma GCC poison foo6 /* { dg-warning "foo6" "poison defined macro" } */
+#define foo6 345 /* { dg-error "foo6" "def of foo6" } */
+#define foo6 456 /* { dg-error "foo6" "redef of foo6" } */
+#ifdef foo6 /* { dg-error "foo6" "#ifdef foo6" } */
+#error hey! foo6 defined!
+#endif
+#if defined(foo6) /* { dg-error "foo6" "#if defined foo6" } */
+#error foo6 still defined!
+#else
+foo6 /* { dg-error "foo6" "use of foo6" } */
+#endif
+#pragma GCC poison
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20348.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20348.c
new file mode 100644
index 000000000..f75f14290
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20348.c
@@ -0,0 +1,16 @@
+/* PR preprocessor/20348 */
+/* { dg-do compile } */
+/* { dg-options "-I$srcdir/gcc.dg/cpp -I$srcdir/gcc.dg/cpp/inc" } */
+
+#include <pr20348-aux.h>
+#define MIDDLE
+#include <pr20348.h>
+
+#ifndef PR20348_H_SEEN
+# error pr20348.h not included after MIDDLE definition
+#endif
+#ifndef INC_PR20348_H_SEEN
+# error inc/pr20348.h not included before MIDDLE definition
+#endif
+
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20348.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20348.h
new file mode 100644
index 000000000..97ef80edb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20348.h
@@ -0,0 +1,9 @@
+#ifdef MIDDLE
+# ifndef PR20348_H_SEEN
+# define PR20348_H_SEEN
+# else
+# error pr20348.h included twice after MIDDLE definition
+# endif
+#else
+# error pr20348.h included before MIDDLE definition
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20356.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20356.c
new file mode 100644
index 000000000..469ab0c0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20356.c
@@ -0,0 +1,14 @@
+/* PR preprocessor/20356 */
+/* { dg-do compile } */
+/* { dg-options "-I$srcdir/gcc.dg/cpp -I$srcdir/gcc.dg/cpp/inc" } */
+
+#include <pr20356-aux.h>
+
+#ifndef PR20356_H
+# error PR20356_H not defined
+#endif
+#ifndef INC_PR20356_H
+# error INC_PR20356_H not defined
+#endif
+
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20356.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20356.h
new file mode 100644
index 000000000..a3f289145
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr20356.h
@@ -0,0 +1,5 @@
+#ifndef PR20356_H
+# define PR20356_H
+#else
+# include_next <pr20356.h>
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr22168-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr22168-2.c
new file mode 100644
index 000000000..c1e308dfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr22168-2.c
@@ -0,0 +1,12 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc. */
+/* PR preprocessor/22168 */
+
+/* { dg-do preprocess }
+ { dg-options -Wdeprecated } */
+#if #foo(bar) /* { dg-warning "deprecated" } */
+int x;
+#else
+int y;
+#endif
+#assert zzz(a) /* { dg-warning "deprecated" } */
+#unassert yyy /* { dg-warning "deprecated" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr22168.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr22168.c
new file mode 100644
index 000000000..fecb972f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr22168.c
@@ -0,0 +1,12 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc. */
+/* PR preprocessor/22168 */
+
+/* { dg-do preprocess }
+ { dg-options -pedantic } */
+#if #foo(bar) /* { dg-warning "GCC extension" } */
+int x;
+#else
+int y;
+#endif
+#assert zzz(a) /* { dg-warning "GCC extension" } */
+#unassert yyy /* { dg-warning "GCC extension" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr27777.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr27777.c
new file mode 100644
index 000000000..89258b95e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr27777.c
@@ -0,0 +1,8 @@
+/* PR preprocessor/27777 */
+/* { dg-do preprocess } */
+/* { dg-options { -trigraphs -Wall } } */
+
+#error "BUG??!"
+
+/* { dg-error "BUG" "" { target *-*-* } 5 } */
+/* { dg-warning "trigraph" "" { target *-*-* } 5 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28165.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28165.c
new file mode 100644
index 000000000..71c7c1dba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28165.c
@@ -0,0 +1,6 @@
+/* Copyright (C) 2007 Free Software Foundation, Inc. */
+/* PR preprocessor/28165 */
+
+/* { dg-do preprocess } */
+#pragma GCC system_header /* { dg-warning "system_header" "ignored" } */
+_Pragma ("GCC system_header") /* { dg-warning "system_header" "ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28227.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28227.c
new file mode 100644
index 000000000..3b70dd539
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28227.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2007 Free Software Foundation, Inc. */
+/* PR preprocessor/28227 */
+
+/* { dg-do preprocess } */
+#ifdef defined
+#endif
+#ifndef defined
+#endif
+
+int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28709.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28709.c
new file mode 100644
index 000000000..25d7cc297
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr28709.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc. */
+/* PR preprocessor/28709 */
+
+/* { dg-options "-ftrack-macro-expansion=0" }
+ { dg-do compile } */
+
+#define foo - ## >>
+foo;
+/* { dg-error "expected identifier.*'-'" "expected" { target *-*-* } 8 } */
+/* { dg-error pasting "pasting" { target *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr29612-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr29612-1.c
new file mode 100644
index 000000000..f840c3823
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr29612-1.c
@@ -0,0 +1,15 @@
+/* PR preprocessor/29612 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+# 6 "pr29612-1.c"
+
+int foo (void) { return 'ab'; } /* { dg-warning "multi-character" } */
+
+# 1 "foo.h" 1 3
+
+int bar (void) { return 'ab'; } /* No warning in system header. */
+
+# 14 "pr29612-1.c" 2
+
+int baz (void) { return 'ab'; } /* { dg-warning "multi-character" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr29612-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr29612-2.c
new file mode 100644
index 000000000..fff10a843
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr29612-2.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/29612 */
+/* { dg-do preprocess } */
+/* { dg-options "-Wtraditional" } */
+
+# 6 "pr29612-2.c"
+
+#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#endif
+
+# 1 "foo.h" 1 3
+
+#if 1U
+#endif /* No warning in system header. */
+
+# 16 "pr29612-2.c" 2
+
+#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr30786.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr30786.c
new file mode 100644
index 000000000..2c3610847
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr30786.c
@@ -0,0 +1,9 @@
+/* PR preprocessor/30786 - _Pragma at end of file should not ICE */
+/* { dg-do compile } */
+
+/* { dg-error "parenthesized" "parenthesized" { target *-*-* } 9 } */
+/* { dg-error "expected" "expected" { target *-*-* } 9 } */
+
+int x;
+
+_Pragma
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr30805.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr30805.c
new file mode 100644
index 000000000..bdfce45e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr30805.c
@@ -0,0 +1,6 @@
+/* PR preprocessor/30805 - ICE while token pasting. */
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu89" } */
+
+#define A(x,...) x##,##__VA_ARGS__
+A(1)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr32868.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr32868.c
new file mode 100644
index 000000000..ea896214c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr32868.c
@@ -0,0 +1,6 @@
+/* PR preprocessor/32868. It is ok to redefine __STDC_FORMAT_MACROS. */
+
+/* { dg-do preprocess } */
+
+#define __STDC_FORMAT_MACROS 1
+#define __STDC_FORMAT_MACROS 1
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr32974.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr32974.c
new file mode 100644
index 000000000..cec6a9e0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr32974.c
@@ -0,0 +1,6 @@
+/* PR preprocessor/32974 - don't warn for extra tokens in pragma dependency */
+/* { dg-do compile } */
+
+#pragma GCC dependency "pr32974.c" extra tokens are ok
+
+int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr33415.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr33415.c
new file mode 100644
index 000000000..28ffe2372
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr33415.c
@@ -0,0 +1,6 @@
+ /* Test case for PR 33415. Note that the first bytes of this file
+ are a UTF-8 BOM. */
+
+/* { dg-do compile } */
+
+int f(void) { return 5; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr33466.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr33466.c
new file mode 100644
index 000000000..8ddb37c8e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr33466.c
@@ -0,0 +1,64 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* Test various invalid constant float suffixes made up of letters of
+ valid suffixes. These are invalid regardless of whether the target
+ compiler supports decimal float or fixed-point types. */
+
+long double rh = 0.5rh; /* { dg-error "invalid suffix" } */
+long double rl = 0.5rl; /* { dg-error "invalid suffix" } */
+long double rll = 0.5rll; /* { dg-error "invalid suffix" } */
+long double kh = 0.5kh; /* { dg-error "invalid suffix" } */
+long double kl = 0.5kl; /* { dg-error "invalid suffix" } */
+long double kll = 0.5kll; /* { dg-error "invalid suffix" } */
+long double ru = 0.5ru; /* { dg-error "invalid suffix" } */
+long double urh = 0.5urh; /* { dg-error "invalid suffix" } */
+long double hur = 0.5hur; /* { dg-error "invalid suffix" } */
+long double hru = 0.5hru; /* { dg-error "invalid suffix" } */
+long double ruh = 0.5ruh; /* { dg-error "invalid suffix" } */
+long double rhu = 0.5rhu; /* { dg-error "invalid suffix" } */
+long double url = 0.5url; /* { dg-error "invalid suffix" } */
+long double lur = 0.5lur; /* { dg-error "invalid suffix" } */
+long double lru = 0.5lru; /* { dg-error "invalid suffix" } */
+long double rul = 0.5rul; /* { dg-error "invalid suffix" } */
+long double rlu = 0.5rlu; /* { dg-error "invalid suffix" } */
+long double urll = 0.5urll; /* { dg-error "invalid suffix" } */
+long double llur = 0.5llur; /* { dg-error "invalid suffix" } */
+long double llru = 0.5llru; /* { dg-error "invalid suffix" } */
+long double rull = 0.5rull; /* { dg-error "invalid suffix" } */
+long double rllu = 0.5rllu; /* { dg-error "invalid suffix" } */
+long double ku = 0.5ku; /* { dg-error "invalid suffix" } */
+long double ukh = 0.5ukh; /* { dg-error "invalid suffix" } */
+long double huk = 0.5huk; /* { dg-error "invalid suffix" } */
+long double hku = 0.5hku; /* { dg-error "invalid suffix" } */
+long double kuh = 0.5kuh; /* { dg-error "invalid suffix" } */
+long double khu = 0.5khu; /* { dg-error "invalid suffix" } */
+long double ukl = 0.5ukl; /* { dg-error "invalid suffix" } */
+long double luk = 0.5luk; /* { dg-error "invalid suffix" } */
+long double lku = 0.5lku; /* { dg-error "invalid suffix" } */
+long double kul = 0.5kul; /* { dg-error "invalid suffix" } */
+long double klu = 0.5klu; /* { dg-error "invalid suffix" } */
+long double ukll = 0.5ukll; /* { dg-error "invalid suffix" } */
+long double lluk = 0.5lluk; /* { dg-error "invalid suffix" } */
+long double llku = 0.5llku; /* { dg-error "invalid suffix" } */
+long double kull = 0.5kull; /* { dg-error "invalid suffix" } */
+long double kllu = 0.5kllu; /* { dg-error "invalid suffix" } */
+long double ld = 0.5ld; /* { dg-error "invalid suffix" } */
+long double fd = 0.5fd; /* { dg-error "invalid suffix" } */
+long double dk = 0.5dk; /* { dg-error "invalid suffix" } */
+long double dr = 0.5dr; /* { dg-error "invalid suffix" } */
+long double ddw = 0.5ddw; /* { dg-error "invalid suffix" } */
+long double ddq = 0.5ddq; /* { dg-error "invalid suffix" } */
+long double ddl = 0.5ddl; /* { dg-error "invalid suffix" } */
+long double ddf = 0.5ddf; /* { dg-error "invalid suffix" } */
+long double ddd = 0.5ddd; /* { dg-error "invalid suffix" } */
+long double dw = 0.5dw; /* { dg-error "invalid suffix" } */
+long double dq = 0.5dq; /* { dg-error "invalid suffix" } */
+long double wd = 0.5wd; /* { dg-error "invalid suffix" } */
+long double qd = 0.5qd; /* { dg-error "invalid suffix" } */
+long double wdd = 0.5wdd; /* { dg-error "invalid suffix" } */
+long double qdd = 0.5qdd; /* { dg-error "invalid suffix" } */
+long double ldd = 0.5ldd; /* { dg-error "invalid suffix" } */
+long double fdd = 0.5fdd; /* { dg-error "invalid suffix" } */
+long double ddi = 0.5ddi; /* { dg-error "invalid suffix" } */
+long double idd = 0.5idd; /* { dg-error "invalid suffix" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34602.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34602.c
new file mode 100644
index 000000000..343c0917a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34602.c
@@ -0,0 +1,6 @@
+/* PR preprocessor/34602 - no internal error trying to spell EOF. */
+/* { dg-do preprocess } */
+
+/* { dg-error "unexpected end" "" { target *-*-* } 6 } */
+
+#line
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34692.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34692.c
new file mode 100644
index 000000000..bcb0ca33d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34692.c
@@ -0,0 +1,35 @@
+/* PR preprocessor/34692 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "vara" } } */
+/* { dg-final { scan-hidden "varb" } } */
+/* { dg-final { scan-hidden "varc" } } */
+/* { dg-final { scan-hidden "vard" } } */
+/* { dg-final { scan-assembler "a b cde f g h" } } */
+
+#define FOO(y, x) y #x
+#define BAR(x) x
+#define BAZ(x) x
+FOO (const char *vara =,
+a
+#pragma GCC visibility push(hidden)
+b
+#pragma GCC visibility push(hidden)
+cde f g h);
+int varb = 6;
+#pragma GCC visibility pop
+#pragma GCC visibility pop
+FOO (
+BAR (
+#pragma GCC visibility push(hidden)
+const) char *varc =,);
+#pragma GCC visibility pop
+FOO (
+BAR (
+BAZ (
+#pragma GCC visibility push(hidden)
+#pragma GCC visibility push(hidden)
+const) char) *vard =,);
+#pragma GCC visibility pop
+#pragma GCC visibility pop
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34859.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34859.c
new file mode 100644
index 000000000..0fb90994e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr34859.c
@@ -0,0 +1,10 @@
+/* PR c++/34859.
+ It is ok to redefine __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS. */
+
+/* { dg-do preprocess } */
+
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_CONSTANT_MACROS 1
+
+#define __STDC_LIMIT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr35313.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr35313.c
new file mode 100644
index 000000000..e12636e0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr35313.c
@@ -0,0 +1,11 @@
+/* Test two failing cases for libcpp parser. From PRs 35313, 36088*/
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+extern int x;
+
+#if 0 ? 3,4 : 2
+#endif
+
+#if 1 ? 0 : 1 ? 1/0 : 1/0
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr35322.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr35322.c
new file mode 100644
index 000000000..1af9605ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr35322.c
@@ -0,0 +1,4 @@
+/* Test case for PR 35322 -- _Pragma ICE. */
+
+/* { dg-do preprocess } */
+_Pragma("GCC dependency") /* { dg-error "#pragma dependency expects" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr36320.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr36320.c
new file mode 100644
index 000000000..d136a69b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr36320.c
@@ -0,0 +1,8 @@
+/* PR 36320 - #elif still requires valid expression. */
+
+/* { dg-do preprocess } */
+
+int z;
+#if 1
+#elif /* { dg-error "with no expression" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr36674.i b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr36674.i
new file mode 100644
index 000000000..9362d5a40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr36674.i
@@ -0,0 +1,12 @@
+/* PR cpp/36674 #include location is offset by one row in errors from preprocessed files */
+/* { dg-do compile } */
+/* { dg-options "-fshow-column" } */
+# 1 "gcc/testsuite/gcc.dg/pr36674.c"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 1 "gcc/testsuite/gcc.dg/pr36674.c"
+# 1 "gcc/testsuite/gcc.dg/pr36674.h" 1
+not_declared_yet();
+# 1 "gcc/testsuite/gcc.dg/pr36674.c" 2
+/* { dg-message "file included from \[^\n\]*pr36674.c:1:" "correct include line" { target *-*-* } 0 } */
+/* { dg-message "pr36674.h:1:1: warning: data definition has no type or storage class" "correct warning" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr43195.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr43195.c
new file mode 100644
index 000000000..a239fc17b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr43195.c
@@ -0,0 +1,6 @@
+/* PR preprocessor/43195 */
+/* { dg-do preprocess } */
+/* { dg-options "-H" } */
+/* { dg-message "pr43195\.h\n" "" { target *-*-* } 0 } */
+#include "pr43195.h"
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr43195.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr43195.h
new file mode 100644
index 000000000..6f70f09be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr43195.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-2.c
new file mode 100644
index 000000000..5ed10d020
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-2.c
@@ -0,0 +1,28 @@
+/* PR 7263: __extension__ keyword doesn't suppress warning on LL or ULL constants. */
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -pedantic-errors" } */
+#include "pr7263-2.h"
+unsigned long long /* { dg-error "ISO C90 does not support .long long." } */
+bar ()
+{
+ return BIG_EXT;
+}
+
+unsigned long long /* { dg-error "ISO C90 does not support .long long." } */
+bar2 ()
+{
+ return 0x1b27da572ef3cd86ULL; /* { dg-error "use of C99 long long integer constant" } */
+}
+
+
+unsigned long long /* { dg-error "ISO C90 does not support .long long." } */
+bar3 ()
+{
+ return __extension__ (0x1b27da572ef3cd86ULL);
+}
+
+__extension__ unsigned long long
+bar4 ()
+{
+ return BIG;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-2.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-2.h
new file mode 100644
index 000000000..54f1757c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-2.h
@@ -0,0 +1,4 @@
+#define BIG_EXT __extension__(0x1b27da572ef3cd86ULL)
+
+#define BIG 0x1b27da572ef3cd86ULL
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-3.c
new file mode 100644
index 000000000..225b65975
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-3.c
@@ -0,0 +1,19 @@
+/* PR 7263: __extension__ keyword doesn't suppress warning on LL or ULL constants. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors -ftrack-macro-expansion=0" } */
+#include "pr7263-3.h"
+__complex__ bar () /* { dg-error "ISO C does not support plain .complex. meaning .double complex." } */
+{
+ return _Complex_I_ext;
+}
+
+__extension__ __complex__
+bar2 ()
+{
+ return _Complex_I;
+}
+
+__complex__ bar3 () /* { dg-error "ISO C does not support plain .complex. meaning .double complex." } */
+{
+ return _Complex_I; /* { dg-error "imaginary constants are a GCC extension" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-3.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-3.h
new file mode 100644
index 000000000..ad6690e2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pr7263-3.h
@@ -0,0 +1,3 @@
+#define _Complex_I_ext (__extension__ 1.0iF)
+
+#define _Complex_I (1.0iF)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-1.c
new file mode 100644
index 000000000..7fab02541
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-1.c
@@ -0,0 +1,13 @@
+/* Verify that preprocessor does not insert redundant newlines
+ after #pragma */
+/* { dg-do compile } */
+int
+main ()
+{
+#pragma unknown
+ {
+ error;
+ /* { dg-error "undeclared" "undeclared-variable message" { target *-*-* } { 9 } } */
+ /* { dg-message "function it appears in" "reminder message" { target *-*-* } { 9 } } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-2.c
new file mode 100644
index 000000000..921f4e5eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-2.c
@@ -0,0 +1,16 @@
+/* Verify that preprocessor does not insert redundant newlines
+ after #pragma, also check this for #include, #define and #undef */
+/* { dg-do compile } */
+/* { dg-options "-dD" } */
+#include <stdio.h>
+
+#undef unknow_def
+
+int main () {
+
+#pragma unknown
+ {}
+ error;
+ /* { dg-error "undeclared" "undeclared-variable message" { target *-*-* } { 13 } } */
+ /* { dg-message "function it appears in" "reminder message" { target *-*-* } { 13 } } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-3.c
new file mode 100644
index 000000000..53daee766
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-3.c
@@ -0,0 +1,40 @@
+/*
+ { dg-options "-fopenmp" }
+ { dg-do preprocess }
+ { dg-require-effective-target fopenmp }
+ */
+
+void foo (void)
+{
+ int i1, j1, k1;
+#define p parallel
+#define P(x) private (x##1)
+#define S(x) shared (x##1)
+#define F(x) firstprivate (x##1)
+#pragma omp \
+ p \
+ P(i) \
+ S(j) \
+ F(k)
+ ;
+}
+
+/*
+ The bug here was that we had a line like:
+ # 33554432 "../../gcc/testsuite/gcc.dg/cpp/pragma-3.c"
+
+ Before line:
+
+ #pragma omp parallel private (i1) shared (j1) firstprivate (k1)
+
+ Note the very big integer there. Normally we should just have
+ this:
+
+ # 13 "../../gcc/testsuite/gcc.dg/cpp/pragma-3.c"
+ #pragma omp parallel private (i1) shared (j1) firstprivate (k1)
+
+ So let's check that we have no line with a number of 3 or more
+ digit after #:
+
+ { dg-final { scan-file-not pragma-3.i "# \[0-9\]{3} \[^\n\r\]*pragma-3.c" } }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-diagnostic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-diagnostic-1.c
new file mode 100644
index 000000000..add7360c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-diagnostic-1.c
@@ -0,0 +1,32 @@
+/*
+ { dg-options "-Wuninitialized -ftrack-macro-expansion=0" }
+ { dg-do compile }
+*/
+
+void f (unsigned);
+
+#define CODE_WITH_WARNING \
+ int a; \
+ f (a)
+
+#pragma GCC diagnostic ignored "-Wuninitialized"
+
+void
+g (void)
+{
+ CODE_WITH_WARNING;
+}
+
+#pragma GCC diagnostic push
+
+#pragma GCC diagnostic error "-Wuninitialized"
+
+void
+h (void)
+{
+ CODE_WITH_WARNING; /* { dg-error "uninitialized" } */
+}
+
+/*
+ { dg-message "some warnings being treated as errors" "" {target *-*-*} 0 }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-diagnostic-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-diagnostic-2.c
new file mode 100644
index 000000000..38fc77c47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-diagnostic-2.c
@@ -0,0 +1,28 @@
+/*
+ { dg-options "-Wuninitialized -ftrack-macro-expansion=2" }
+ { dg-do compile }
+*/
+
+void f (unsigned);
+
+#define CODE_WITH_WARNING \
+ int a; /* { dg-message "was declared here" } */ \
+ f (a) /* { dg-warning "used uninitialized" } */
+
+#pragma GCC diagnostic ignored "-Wuninitialized"
+
+void
+g (void)
+{
+ CODE_WITH_WARNING;
+}
+
+#pragma GCC diagnostic push
+
+#pragma GCC diagnostic error "-Wuninitialized"
+
+void
+h (void)
+{
+ CODE_WITH_WARNING; /* { dg-message "in expansion of macro 'CODE_WITH_WARNING'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-float-const-decimal64-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-float-const-decimal64-1.c
new file mode 100644
index 000000000..633383899
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-float-const-decimal64-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile { target { ! dfp } } } */
+/* { dg-options "-std=gnu99 -Wunknown-pragmas" } */
+
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "not supported on this target" } */
+double d = 1.0;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1.c
new file mode 100644
index 000000000..23e24b8c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1.c
@@ -0,0 +1,8 @@
+/* PR preprocessor/15167 */
+/* Origin: Roland Meub <Roland.Meub@Tenovis.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-I." } */
+
+#include "inc/pragma-once-1a.h"
+#include "pragma-once-1d.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1b.h
new file mode 100644
index 000000000..9c17db4dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1b.h
@@ -0,0 +1,8 @@
+#ifndef _B_H_
+#define _B_H_
+
+#pragma once
+
+#include "pragma-once-1c.h"
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1c.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1c.h
new file mode 100644
index 000000000..cd50024f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1c.h
@@ -0,0 +1,6 @@
+#ifndef _C_H_
+#define _C_H_
+
+#include "pragma-once-1b.h"
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1d.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1d.h
new file mode 100644
index 000000000..0c5db2dc7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-once-1d.h
@@ -0,0 +1,6 @@
+#ifndef _D_H_
+#define _D_H_
+
+#include "pragma-once-1b.h"
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-pop_macro-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-pop_macro-1.c
new file mode 100644
index 000000000..c9a904864
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/pragma-pop_macro-1.c
@@ -0,0 +1,12 @@
+/* PR preprocessor/35061 */
+/* Do nothing if there is nothing on the macro stack to pop. */
+
+/* { dg-do preprocess } */
+
+#define X 1
+/* # pragma push_macro("X") */
+# undef X
+# pragma pop_macro("X")
+#ifdef X
+#error X is defined
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef1.c
new file mode 100644
index 000000000..a5fe2bacc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef1.c
@@ -0,0 +1,19 @@
+/* Test for redefining macros with insignificant (i.e. whitespace)
+ differences. */
+
+/* { dg-do preprocess } */
+
+#define foo bar
+#define /* x */ foo /* x */ bar /* x */
+
+#define quux(thud) a one and a thud and a two
+#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two
+#define quux(thud) a one and a thud and a two /* bah */
+
+/* { dg-bogus "redefined" "foo redefined" { target *-*-* } 7 } */
+/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 10 } */
+/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 11 } */
+
+/* { dg-bogus "previous def" "foo prev def" { target *-*-* } 6 } */
+/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 9 } */
+/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef2.c
new file mode 100644
index 000000000..1dbc10033
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef2.c
@@ -0,0 +1,31 @@
+/* Test for redefining macros with significant differences. */
+
+/* { dg-do preprocess }
+ { dg-options "-ansi -Wall" } */
+
+#define mac(a, b) (a) + (b)
+#define mac(a, b) (a) * (b)
+#define mac(a, b) (a) * (x)
+#define mac(a, g) (a) * (x)
+
+#define ro(x) foo x bar
+#define ro(x, b) foo x bar
+
+#define va(a...) a
+#define va(...) __VA_ARGS__
+
+#define foo(x) x
+#define foo(x)x /* { dg-bogus "redefined" "redefined foo" } */
+
+/* { dg-warning "redefined" "redef mac" { target *-*-* } 7 }
+ { dg-warning "redefined" "redef mac" { target *-*-* } 8 }
+ { dg-warning "redefined" "redef mac" { target *-*-* } 9 }
+ { dg-warning "redefined" "redef ro" { target *-*-* } 12 }
+ { dg-warning "redefined" "redef va" { target *-*-* } 15 }
+
+ { dg-message "previous" "prev def mac" { target *-*-* } 6 }
+ { dg-message "previous" "prev def mac" { target *-*-* } 7 }
+ { dg-message "previous" "prev def mac" { target *-*-* } 8 }
+ { dg-message "previous" "prev def ro" { target *-*-* } 11 }
+ { dg-message "previous" "prev def va" { target *-*-* } 14 }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef3.c
new file mode 100644
index 000000000..1c541a45b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef3.c
@@ -0,0 +1,21 @@
+/* Test for redefining macros with mismatch token count (and the oddity). */
+
+/* { dg-do preprocess } */
+/* { dg-options "-DC -DD=1 -DE" } */
+
+#define A
+#define A 1
+#define B 2 3
+#define B 2
+#define C 1
+#define D 1 2
+#define E
+
+/* { dg-warning "redefined" "redef A" { target *-*-* } 7 }
+ { dg-warning "redefined" "redef B" { target *-*-* } 9 }
+ { dg-warning "redefined" "redef D" { target *-*-* } 11 }
+ { dg-warning "redefined" "redef E" { target *-*-* } 12 }
+ { dg-message "previous" "prev def A" { target *-*-* } 6 }
+ { dg-message "previous" "prev def B" { target *-*-* } 8 }
+ { dg-message "previous" "prev def D/E" { target *-*-* } 0 }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef4.c
new file mode 100644
index 000000000..b34635b2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/redef4.c
@@ -0,0 +1,499 @@
+/* Test redefinitions differing only in the spelling of paste and
+ stringify tokens, whitespace around them, or the number of
+ consecutive paste tokens. */
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+#define str(x) #x /* { dg-message "previous definition" } */
+#define str(x) %: x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) #x /* { dg-message "previous definition" } */
+#define str(x) # x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) #x /* { dg-message "previous definition" } */
+#define str(x) %: x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) %:x /* { dg-message "previous definition" } */
+#define str(x) #x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) %:x /* { dg-message "previous definition" } */
+#define str(x) %: x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) %:x /* { dg-message "previous definition" } */
+#define str(x) # x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) %:x /* { dg-message "previous definition" } */
+#define str(x) %: x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) # x /* { dg-message "previous definition" } */
+#define str(x) #x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) # x /* { dg-message "previous definition" } */
+#define str(x) %: x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) # x /* { dg-message "previous definition" } */
+#define str(x) %: x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) %: x /* { dg-message "previous definition" } */
+#define str(x) #x /* { dg-warning "redefined" } */
+#undef str
+#define str(x) %: x /* { dg-message "previous definition" } */
+#define str(x) # x /* { dg-warning "redefined" } */
+#undef str
+
+#define str(x) #x
+#define str(x) #x
+#undef str
+#define str(x) # x
+#define str(x) # x
+#undef str
+#define str(x) %: x
+#define str(x) %: x
+#undef str
+#define str(x) %: x
+#define str(x) %: x
+#undef str
+
+#define astr(x) a#x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a#x /* { dg-message "previous definition" } */
+#define astr(x) a# x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a#x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a#x /* { dg-message "previous definition" } */
+#define astr(x) a #x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a#x /* { dg-message "previous definition" } */
+#define astr(x) a %:x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a#x /* { dg-message "previous definition" } */
+#define astr(x) a # x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a#x /* { dg-message "previous definition" } */
+#define astr(x) a %: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%:x /* { dg-message "previous definition" } */
+#define astr(x) a#x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%:x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%:x /* { dg-message "previous definition" } */
+#define astr(x) a# x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%:x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%:x /* { dg-message "previous definition" } */
+#define astr(x) a #x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%:x /* { dg-message "previous definition" } */
+#define astr(x) a %:x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%:x /* { dg-message "previous definition" } */
+#define astr(x) a # x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%:x /* { dg-message "previous definition" } */
+#define astr(x) a %: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a# x /* { dg-message "previous definition" } */
+#define astr(x) a#x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a# x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a# x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a# x /* { dg-message "previous definition" } */
+#define astr(x) a #x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a# x /* { dg-message "previous definition" } */
+#define astr(x) a %:x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a# x /* { dg-message "previous definition" } */
+#define astr(x) a # x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a# x /* { dg-message "previous definition" } */
+#define astr(x) a %: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%: x /* { dg-message "previous definition" } */
+#define astr(x) a#x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%: x /* { dg-message "previous definition" } */
+#define astr(x) a# x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%: x /* { dg-message "previous definition" } */
+#define astr(x) a #x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%: x /* { dg-message "previous definition" } */
+#define astr(x) a %:x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%: x /* { dg-message "previous definition" } */
+#define astr(x) a # x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a%: x /* { dg-message "previous definition" } */
+#define astr(x) a %: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a #x /* { dg-message "previous definition" } */
+#define astr(x) a#x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a #x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a #x /* { dg-message "previous definition" } */
+#define astr(x) a# x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a #x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a #x /* { dg-message "previous definition" } */
+#define astr(x) a %:x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a #x /* { dg-message "previous definition" } */
+#define astr(x) a # x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a #x /* { dg-message "previous definition" } */
+#define astr(x) a %: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %:x /* { dg-message "previous definition" } */
+#define astr(x) a#x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %:x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %:x /* { dg-message "previous definition" } */
+#define astr(x) a# x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %:x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %:x /* { dg-message "previous definition" } */
+#define astr(x) a #x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %:x /* { dg-message "previous definition" } */
+#define astr(x) a # x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %:x /* { dg-message "previous definition" } */
+#define astr(x) a %: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a # x /* { dg-message "previous definition" } */
+#define astr(x) a#x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a # x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a # x /* { dg-message "previous definition" } */
+#define astr(x) a# x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a # x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a # x /* { dg-message "previous definition" } */
+#define astr(x) a #x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a # x /* { dg-message "previous definition" } */
+#define astr(x) a %:x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a # x /* { dg-message "previous definition" } */
+#define astr(x) a %: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %: x /* { dg-message "previous definition" } */
+#define astr(x) a#x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %: x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %: x /* { dg-message "previous definition" } */
+#define astr(x) a# x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %: x /* { dg-message "previous definition" } */
+#define astr(x) a%: x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %: x /* { dg-message "previous definition" } */
+#define astr(x) a #x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %: x /* { dg-message "previous definition" } */
+#define astr(x) a %:x /* { dg-warning "redefined" } */
+#undef astr
+#define astr(x) a %: x /* { dg-message "previous definition" } */
+#define astr(x) a # x /* { dg-warning "redefined" } */
+#undef astr
+
+#define astr(x) a#x
+#define astr(x) a#x
+#undef astr
+#define astr(x) a# x
+#define astr(x) a# x
+#undef astr
+#define astr(x) a%: x
+#define astr(x) a%: x
+#undef astr
+#define astr(x) a%: x
+#define astr(x) a%: x
+#undef astr
+#define astr(x) a #x
+#define astr(x) a #x
+#undef astr
+#define astr(x) a %:x
+#define astr(x) a %:x
+#undef astr
+#define astr(x) a # x
+#define astr(x) a # x
+#undef astr
+#define astr(x) a %: x
+#define astr(x) a %: x
+#undef astr
+
+#define cat(x,y) x##y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x##y /* { dg-message "previous definition" } */
+#define cat(x,y) x## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x##y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x##y /* { dg-message "previous definition" } */
+#define cat(x,y) x ##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x##y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x##y /* { dg-message "previous definition" } */
+#define cat(x,y) x ## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x##y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x ##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x ## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x## y /* { dg-message "previous definition" } */
+#define cat(x,y) x##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x## y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x## y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x## y /* { dg-message "previous definition" } */
+#define cat(x,y) x ##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x## y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x## y /* { dg-message "previous definition" } */
+#define cat(x,y) x ## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x## y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x ##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x ## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x%:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ##y /* { dg-message "previous definition" } */
+#define cat(x,y) x##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ##y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ##y /* { dg-message "previous definition" } */
+#define cat(x,y) x## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ##y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ##y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ##y /* { dg-message "previous definition" } */
+#define cat(x,y) x ## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ##y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x ##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x ## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%:y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ## y /* { dg-message "previous definition" } */
+#define cat(x,y) x##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ## y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ## y /* { dg-message "previous definition" } */
+#define cat(x,y) x## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ## y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ## y /* { dg-message "previous definition" } */
+#define cat(x,y) x ##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ## y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x ## y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x## y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x%:%: y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x ##y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x %:%:y /* { dg-warning "redefined" } */
+#undef cat
+#define cat(x,y) x %:%: y /* { dg-message "previous definition" } */
+#define cat(x,y) x ## y /* { dg-warning "redefined" } */
+#undef cat
+
+#define cat(x,y) x##y
+#define cat(x,y) x##y
+#undef cat
+#define cat(x,y) x## y
+#define cat(x,y) x## y
+#undef cat
+#define cat(x,y) x%:%: y
+#define cat(x,y) x%:%: y
+#undef cat
+#define cat(x,y) x%:%: y
+#define cat(x,y) x%:%: y
+#undef cat
+#define cat(x,y) x ##y
+#define cat(x,y) x ##y
+#undef cat
+#define cat(x,y) x %:%:y
+#define cat(x,y) x %:%:y
+#undef cat
+#define cat(x,y) x ## y
+#define cat(x,y) x ## y
+#undef cat
+#define cat(x,y) x %:%: y
+#define cat(x,y) x %:%: y
+#undef cat
+
+#define cat3(x,y,z) x##y##z /* { dg-message "previous definition" } */
+#define cat3(x,y,z) x##y####z /* { dg-warning "redefined" } */
+#undef cat3
+
+#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */
+#define cat3(x,y,z) x####y##z /* { dg-warning "redefined" } */
+#undef cat3
+
+#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */
+#define cat3(x,y,z) x##y## ##z /* { dg-warning "redefined" } */
+#undef cat3
+
+#define cat3(x,y,z) x##y####z /* { dg-message "previous definition" } */
+#define cat3(x,y,z) x##y##%:%:z /* { dg-warning "redefined" } */
+#undef cat3
+
+#define cat3(x,y,z) x##y######## ####z /* { dg-message "previous definition" } */
+#define cat3(x,y,z) x##y############z /* { dg-warning "redefined" } */
+#undef cat3
+
+#define cat3(x,y,z) x##y############z /* { dg-message "previous definition" } */
+#define cat3(x,y,z) x##y########%:%:##z /* { dg-warning "redefined" } */
+#undef cat3
+
+#define cat3(x,y,z) x##y##z
+#define cat3(x,y,z) x##y##z
+#undef cat3
+
+#define cat3(x,y,z) x##y####z
+#define cat3(x,y,z) x##y####z
+#undef cat3
+
+#define cat3(x,y,z) x####y##z
+#define cat3(x,y,z) x####y##z
+#undef cat3
+
+#define cat3(x,y,z) x##y## ##z
+#define cat3(x,y,z) x##y## ##z
+#undef cat3
+
+#define cat3(x,y,z) x##y##%:%:z
+#define cat3(x,y,z) x##y##%:%:z
+#undef cat3
+
+#define cat3(x,y,z) x##y######## ####z
+#define cat3(x,y,z) x##y######## ####z
+#undef cat3
+
+#define cat3(x,y,z) x##y############z
+#define cat3(x,y,z) x##y############z
+#undef cat3
+
+#define cat3(x,y,z) x##y########%:%:##z
+#define cat3(x,y,z) x##y########%:%:##z
+#undef cat3
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/separate-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/separate-1.c
new file mode 100644
index 000000000..33d910b3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/separate-1.c
@@ -0,0 +1,17 @@
+/* Copyright 2003 Free Software Foundation. */
+
+/* { dg-do compile } */
+/* { dg-options "-save-temps" } */
+
+/* Make sure we report errors in the right line, even if separate
+ preprocessing is used. */
+
+#define FOO()
+
+int FOO(
+ ), bar; /* { dg-error "parse error|syntax error|expected" "error on this line" } */
+
+int baz FOO /* { dg-error "parse error|syntax error|expected" "error on this line" } */
+;
+
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/skipping.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/skipping.c
new file mode 100644
index 000000000..b8daa890b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/skipping.c
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests expansion of macros whilst skipping false conditionals. */
+
+/* Source: Neil Booth, 29 Oct 2000. */
+
+#define F()
+#define TRUE 1
+
+#if 0
+F( /* No diagnostic: don't even try to expand it. */
+#endif
+
+#if 0
+#elif TRUE /* Expand this, even though we were skipping. */
+#else
+#error Macros not expanded in #elif
+#endif
+
+/* Check we don't warn about bad identifiers when skipping. */
+#if 0
+#define foo __VA_ARGS__ /* { dg-bogus "warned about identifier" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/skipping2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/skipping2.c
new file mode 100644
index 000000000..14dafc01e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/skipping2.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests that excess tokens in skipped conditional blocks don't warn. */
+
+/* Source: Neil Booth, 25 Jul 2001. */
+
+#if 0
+#if foo
+#else foo /* { dg-bogus "extra tokens" "extra tokens in skipped block" } */
+#endif foo /* { dg-bogus "extra tokens" "extra tokens in skipped block" } */
+#endif bar /* { dg-error "extra tokens" "tokens after #endif" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/spacing1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/spacing1.c
new file mode 100644
index 000000000..c21a6b515
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/spacing1.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-P" } */
+
+/* This tests correct spacing of macro expansion output, as well as
+ the line it falls on. This is quite subtle; it involves newlines
+ within macro arguments becoming spaces, but not if it turns out to
+ not be a macro invocation. Also, multiple macro invocations spread
+ across many lines.
+
+ Neil Booth, 1 Dec 2000, 23 Sep 2001. */
+
+/* The actual location of the expansion of a multi-line macro
+ invocation is not defined: we might consider them to be in the same
+ line as the initial token of the invocation, or as the final token
+ of the invocation, or even anything in between. We choose to make
+ it the initial token, such that everything that is in a logical
+ line ends up in a single line after preprocessing.
+
+ Alexandre Oliva, Sept 13, 2003. */
+
+#define str(x) #x
+#define f(x) x
+#define glue(x, y) x ## y
+#define EMPTY
+/* These are based on PR 4492, we mustn't lose padding tokens when
+ scanning ahead for a '(' and failing to find it. */
+#define A(x) B x
+#define B(x)
+#define C A
+#define D() A
+
+/* The correct output is shown here. Note the spaces, and the way
+ everything after the invocation of f appears on the same line.
+
+ 44 ;
+B Q B Q A Q A:
+f
+bar
+A
+bad
+g "1 2" bam baz
+
+*/
+
+glue (EMPTY 4, 4) EMPTY;
+A(Q) C(Q) D()Q D():
+f
+bar
+A
+bad
+f (g) str
+(
+1
+2
+) f
+(bam) baz
+
+/* { dg-final { scan-file spacing1.i " 44 ;" } }
+ { dg-final { scan-file spacing1.i "B Q B Q A Q A:" } }
+ { dg-final { scan-file-not spacing1.i "f\[^\n\]*bar" } }
+ { dg-final { scan-file spacing1.i "(^|\n)bar" } }
+ { dg-final { scan-file spacing1.i "(^|\n)A($|\n)" } }
+ { dg-final { scan-file spacing1.i "(^|\n)bad($|\n)" } }
+ { dg-final { scan-file spacing1.i "g \"1 2\" bam baz" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/spacing2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/spacing2.c
new file mode 100644
index 000000000..6cfa5a3d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/spacing2.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2001, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* We used to output an unnecessary leading space, leading to Emacs
+ confusion with its Makefile abuse.
+
+ Neil Booth, 12 Oct 2001. */
+
+#define EMPTY
+#define foo bar
+
+a = EMPTY
+foo.. /* No leading space on output. */
+
+/* { dg-final { scan-file spacing2.i "(^|\n)bar\.\." } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify1.c
new file mode 100644
index 000000000..35355401a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify1.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test operator # semantics. */
+
+#define OK1 # /* No problem. */
+#define OK2(x) x#x /* No problem. */
+#define bad1(x) # /* { dg-error "followed by a macro parameter" "#1" } */
+#define bad2(x) #y /* { dg-error "followed by a macro parameter" "#2" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify2.c
new file mode 100644
index 000000000..c24220c70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify2.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+/* Tests a whole bunch of things are correctly stringified. */
+
+extern int strcmp (const char *, const char *);
+extern int puts (const char *);
+extern void abort (void);
+#define err(str) do { puts(str); abort(); } while (0)
+
+#define str(x) #x
+#define xstr(x) str(x)
+#define strvar(...) #__VA_ARGS__
+
+#define glibc_str(x) glibc_str2 (w, x)
+#define glibc_str2(w, x) #x
+#define ver GLIBC_2.2
+
+int main (int argc, char *argv[])
+{
+ str (\); /* { dg-warning "valid string" "str(\\)" } */
+ str (\\); /* OK. */
+ str (\\\); /* { dg-warning "valid string" "str(\\\\\\)" } */
+
+ /* This also serves as a useful test of the value of __INCLUDE_LEVEL. */
+ if (strcmp (xstr (__INCLUDE_LEVEL__), "0"))
+ err ("macro expansion");
+
+ if (strcmp(str (__INCLUDE_LEVEL__), "__INCLUDE_LEVEL__"))
+ err ("macro name");
+
+ if (strcmp(str(), "") || strcmp(str( ), ""))
+ err ("empty string");
+
+ if (strcmp(str ("s\n"), "\"s\\n\""))
+ err ("quoted string");
+
+ if (strcmp (str (a € b), "a \200 b"))
+ err ("unprintable char");
+
+ if (strcmp (str ( a b@ c ), "a b@ c"))
+ err ("internal whitespace");
+
+ if (strcmp (str(a \n), "a \n"))
+ err ("backslash token");
+
+ if (strcmp (strvar (foo, bar), "foo, bar"))
+ err ("variable arguments");
+
+ if (strcmp (glibc_str (ver), "GLIBC_2.2"))
+ err ("whitespace");
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify3.c
new file mode 100644
index 000000000..5d76b5e75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify3.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+
+/* Tests we stringify without inserting a space. GCC 2.95.x and
+ earlier would insert a bogus space before bar in the string, simply
+ because a space was there in the invocation.
+
+ Neil Booth, 24 Sep 2001. */
+
+extern int strcmp (const char *, const char *);
+extern int puts (const char *);
+extern void abort (void);
+#define err(str) do { puts(str); abort(); } while (0)
+
+#define str(x) #x
+#define xstr(x) str(x)
+#define glibc_hack(x, y) x@y
+
+int main (int argc, char *argv[])
+{
+ /* The space before "bar" here is vital. */
+ char a[] = xstr(glibc_hack(foo, bar));
+
+ if (strcmp (a, "foo@bar"))
+ err ("stringification without spaces");
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify4.c
new file mode 100644
index 000000000..b8b2f11e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify4.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* Tests we stringify without changing unprintable characts.
+
+ Andrew Pinski */
+
+extern int strcmp (const char *, const char *);
+extern int puts (const char *);
+extern void abort (void);
+#define err(str) do { puts(str); abort(); } while (0)
+
+
+#define S(X) S2(X)
+#define S2(X) #X
+#define TAB " " /* Note there is a tab character here. */
+
+int main (int argc, char *argv[])
+{
+ /* The space before "bar" here is vital. */
+ char a[] = S(S(TAB));
+
+ if (strcmp (a, "\"\\\" \\\"\""))
+ err ("stringification caused octal");
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify5.c
new file mode 100644
index 000000000..f56468281
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strify5.c
@@ -0,0 +1,1260 @@
+/* Test handling of spaces and empty macro expansions in
+ stringifying. PR 31869. */
+/* { dg-do run } */
+
+extern int strcmp (const char *, const char *);
+extern int puts (const char *);
+extern void abort (void);
+extern void exit (int);
+#define err(str) do { puts (str); abort (); } while (0)
+
+#define s(x) #x
+#define v(x, r) if (strcmp (s(x), r)) err (#x)
+
+#define EOA /* empty */
+#define EFA() /* empty */
+#define EOB EFA()EFA()
+#define EOC EFA()EOA
+#define EFB() EFA()EFA()
+#define EFC() EFA()EOA
+#define ARG(x) x
+#define SOA EOA EOA
+#define SOB ARG(EFB() EOA)
+#define SOC ARG(SOA)
+#define SFA() EOA EOA
+#define SFB() ARG(EFB() EOA)
+#define SFC() ARG(SOA)
+#define SAa(x) x EOA
+#define SAb(x) x EOB
+#define SAc(x) x EOC
+#define SAd(x) x EFA()
+#define SAe(x) x EFB()
+#define SAf(x) x EFC()
+#define SBa(x) EOA x
+#define SBb(x) EOB x
+#define SBc(x) EOC x
+#define SBd(x) SFA()x
+#define SBe(x) SFB()x
+#define SBf(x) SFC()x
+
+void
+check0 (void)
+{
+ v(||, "||");
+ v(|EOA|, "||");
+ v(|EOB|, "||");
+ v(|EOC|, "||");
+ v(|EFA()|, "||");
+ v(|EFB()|, "||");
+ v(|EFC()|, "||");
+}
+
+void
+check1 (void)
+{
+ v(|SBa(|), "| |");
+ v(|SBb(|), "| |");
+ v(|SBc(|), "| |");
+ v(|SBd(|), "| |");
+ v(|SBe(|), "| |");
+ v(|SBf(|), "| |");
+ v(| |, "| |");
+ v(| SBa(|), "| |");
+ v(| SBb(|), "| |");
+ v(| SBc(|), "| |");
+ v(| SBd(|), "| |");
+ v(| SBe(|), "| |");
+ v(| SBf(|), "| |");
+ v(|EFA()SBa(|), "| |");
+ v(|EFA()SBb(|), "| |");
+ v(|EFA()SBc(|), "| |");
+ v(|EFA()SBd(|), "| |");
+ v(|EFA()SBe(|), "| |");
+ v(|EFA()SBf(|), "| |");
+ v(|EFB()SBa(|), "| |");
+ v(|EFB()SBb(|), "| |");
+ v(|EFB()SBc(|), "| |");
+ v(|EFB()SBd(|), "| |");
+ v(|EFB()SBe(|), "| |");
+ v(|EFB()SBf(|), "| |");
+ v(|EFC()SBa(|), "| |");
+ v(|EFC()SBb(|), "| |");
+ v(|EFC()SBc(|), "| |");
+ v(|EFC()SBd(|), "| |");
+ v(|EFC()SBe(|), "| |");
+ v(|EFC()SBf(|), "| |");
+ v(| EOA|, "| |");
+ v(| EOB|, "| |");
+ v(| EOC|, "| |");
+ v(| EFA()|, "| |");
+ v(| EFA()SBa(|), "| |");
+ v(| EFA()SBb(|), "| |");
+ v(| EFA()SBc(|), "| |");
+ v(| EFA()SBd(|), "| |");
+ v(| EFA()SBe(|), "| |");
+ v(| EFA()SBf(|), "| |");
+ v(| EFB()|, "| |");
+ v(| EFB()SBa(|), "| |");
+ v(| EFB()SBb(|), "| |");
+ v(| EFB()SBc(|), "| |");
+ v(| EFB()SBd(|), "| |");
+ v(| EFB()SBe(|), "| |");
+ v(| EFB()SBf(|), "| |");
+ v(| EFC()|, "| |");
+ v(| EFC()SBa(|), "| |");
+ v(| EFC()SBb(|), "| |");
+ v(| EFC()SBc(|), "| |");
+ v(| EFC()SBd(|), "| |");
+ v(| EFC()SBe(|), "| |");
+ v(| EFC()SBf(|), "| |");
+ v(|EOA |, "| |");
+ v(|EOA SBa(|), "| |");
+ v(|EOA SBb(|), "| |");
+ v(|EOA SBc(|), "| |");
+ v(|EOA SBd(|), "| |");
+ v(|EOA SBe(|), "| |");
+ v(|EOA SBf(|), "| |");
+ v(|EOB |, "| |");
+ v(|EOB SBa(|), "| |");
+ v(|EOB SBb(|), "| |");
+ v(|EOB SBc(|), "| |");
+ v(|EOB SBd(|), "| |");
+ v(|EOB SBe(|), "| |");
+ v(|EOB SBf(|), "| |");
+ v(|EOC |, "| |");
+ v(|EOC SBa(|), "| |");
+ v(|EOC SBb(|), "| |");
+ v(|EOC SBc(|), "| |");
+ v(|EOC SBd(|), "| |");
+ v(|EOC SBe(|), "| |");
+ v(|EOC SBf(|), "| |");
+ v(|EFA() |, "| |");
+ v(|EFA() SBa(|), "| |");
+ v(|EFA() SBb(|), "| |");
+ v(|EFA() SBc(|), "| |");
+ v(|EFA() SBd(|), "| |");
+ v(|EFA() SBe(|), "| |");
+ v(|EFA() SBf(|), "| |");
+ v(|EFB() |, "| |");
+ v(|EFB() SBa(|), "| |");
+ v(|EFB() SBb(|), "| |");
+ v(|EFB() SBc(|), "| |");
+ v(|EFB() SBd(|), "| |");
+ v(|EFB() SBe(|), "| |");
+ v(|EFB() SBf(|), "| |");
+ v(|EFC() |, "| |");
+ v(|EFC() SBa(|), "| |");
+ v(|EFC() SBb(|), "| |");
+ v(|EFC() SBc(|), "| |");
+ v(|EFC() SBd(|), "| |");
+ v(|EFC() SBe(|), "| |");
+ v(|EFC() SBf(|), "| |");
+ v(| EOA |, "| |");
+ v(| EOA SBa(|), "| |");
+ v(| EOA SBb(|), "| |");
+ v(| EOA SBc(|), "| |");
+ v(| EOA SBd(|), "| |");
+ v(| EOA SBe(|), "| |");
+ v(| EOA SBf(|), "| |");
+ v(| EOB |, "| |");
+ v(| EOB SBa(|), "| |");
+ v(| EOB SBb(|), "| |");
+ v(| EOB SBc(|), "| |");
+ v(| EOB SBd(|), "| |");
+ v(| EOB SBe(|), "| |");
+ v(| EOB SBf(|), "| |");
+ v(| EOC |, "| |");
+ v(| EOC SBa(|), "| |");
+ v(| EOC SBb(|), "| |");
+ v(| EOC SBc(|), "| |");
+ v(| EOC SBd(|), "| |");
+ v(| EOC SBe(|), "| |");
+ v(| EOC SBf(|), "| |");
+ v(| EFA() |, "| |");
+ v(| EFA() SBa(|), "| |");
+ v(| EFA() SBb(|), "| |");
+ v(| EFA() SBc(|), "| |");
+ v(| EFA() SBd(|), "| |");
+ v(| EFA() SBe(|), "| |");
+ v(| EFA() SBf(|), "| |");
+ v(| EFB() |, "| |");
+ v(| EFB() SBa(|), "| |");
+ v(| EFB() SBb(|), "| |");
+ v(| EFB() SBc(|), "| |");
+ v(| EFB() SBd(|), "| |");
+ v(| EFB() SBe(|), "| |");
+ v(| EFB() SBf(|), "| |");
+ v(| EFC() |, "| |");
+ v(| EFC() SBa(|), "| |");
+ v(| EFC() SBb(|), "| |");
+ v(| EFC() SBc(|), "| |");
+ v(| EFC() SBd(|), "| |");
+ v(| EFC() SBe(|), "| |");
+ v(| EFC() SBf(|), "| |");
+}
+
+void
+check2 (void)
+{
+ v(SAa(|)|, "| |");
+ v(SAa(|)SBa(|), "| |");
+ v(SAa(|)SBb(|), "| |");
+ v(SAa(|)SBc(|), "| |");
+ v(SAa(|)SBd(|), "| |");
+ v(SAa(|)SBe(|), "| |");
+ v(SAa(|)SBf(|), "| |");
+ v(SAa(|) |, "| |");
+ v(SAa(|) SBa(|), "| |");
+ v(SAa(|) SBb(|), "| |");
+ v(SAa(|) SBc(|), "| |");
+ v(SAa(|) SBd(|), "| |");
+ v(SAa(|) SBe(|), "| |");
+ v(SAa(|) SBf(|), "| |");
+ v(SAa(|)EOA|, "| |");
+ v(SAa(|)EOB|, "| |");
+ v(SAa(|)EOC|, "| |");
+ v(SAa(|)EFA()|, "| |");
+ v(SAa(|)EFA()SBa(|), "| |");
+ v(SAa(|)EFA()SBb(|), "| |");
+ v(SAa(|)EFA()SBc(|), "| |");
+ v(SAa(|)EFA()SBd(|), "| |");
+ v(SAa(|)EFA()SBe(|), "| |");
+ v(SAa(|)EFA()SBf(|), "| |");
+ v(SAa(|)EFB()|, "| |");
+ v(SAa(|)EFB()SBa(|), "| |");
+ v(SAa(|)EFB()SBb(|), "| |");
+ v(SAa(|)EFB()SBc(|), "| |");
+ v(SAa(|)EFB()SBd(|), "| |");
+ v(SAa(|)EFB()SBe(|), "| |");
+ v(SAa(|)EFB()SBf(|), "| |");
+ v(SAa(|)EFC()|, "| |");
+ v(SAa(|)EFC()SBa(|), "| |");
+ v(SAa(|)EFC()SBb(|), "| |");
+ v(SAa(|)EFC()SBc(|), "| |");
+ v(SAa(|)EFC()SBd(|), "| |");
+ v(SAa(|)EFC()SBe(|), "| |");
+ v(SAa(|)EFC()SBf(|), "| |");
+ v(SAa(|) EOA|, "| |");
+ v(SAa(|) EOB|, "| |");
+ v(SAa(|) EOC|, "| |");
+ v(SAa(|) EFA()|, "| |");
+ v(SAa(|) EFA()SBa(|), "| |");
+ v(SAa(|) EFA()SBb(|), "| |");
+ v(SAa(|) EFA()SBc(|), "| |");
+ v(SAa(|) EFA()SBd(|), "| |");
+ v(SAa(|) EFA()SBe(|), "| |");
+ v(SAa(|) EFA()SBf(|), "| |");
+ v(SAa(|) EFB()|, "| |");
+ v(SAa(|) EFB()SBa(|), "| |");
+ v(SAa(|) EFB()SBb(|), "| |");
+ v(SAa(|) EFB()SBc(|), "| |");
+ v(SAa(|) EFB()SBd(|), "| |");
+ v(SAa(|) EFB()SBe(|), "| |");
+ v(SAa(|) EFB()SBf(|), "| |");
+ v(SAa(|) EFC()|, "| |");
+ v(SAa(|) EFC()SBa(|), "| |");
+ v(SAa(|) EFC()SBb(|), "| |");
+ v(SAa(|) EFC()SBc(|), "| |");
+ v(SAa(|) EFC()SBd(|), "| |");
+ v(SAa(|) EFC()SBe(|), "| |");
+ v(SAa(|) EFC()SBf(|), "| |");
+ v(SAa(|)EOA |, "| |");
+ v(SAa(|)EOA SBa(|), "| |");
+ v(SAa(|)EOA SBb(|), "| |");
+ v(SAa(|)EOA SBc(|), "| |");
+ v(SAa(|)EOA SBd(|), "| |");
+ v(SAa(|)EOA SBe(|), "| |");
+ v(SAa(|)EOA SBf(|), "| |");
+ v(SAa(|)EOB |, "| |");
+ v(SAa(|)EOB SBa(|), "| |");
+ v(SAa(|)EOB SBb(|), "| |");
+ v(SAa(|)EOB SBc(|), "| |");
+ v(SAa(|)EOB SBd(|), "| |");
+ v(SAa(|)EOB SBe(|), "| |");
+ v(SAa(|)EOB SBf(|), "| |");
+ v(SAa(|)EOC |, "| |");
+ v(SAa(|)EOC SBa(|), "| |");
+ v(SAa(|)EOC SBb(|), "| |");
+ v(SAa(|)EOC SBc(|), "| |");
+ v(SAa(|)EOC SBd(|), "| |");
+ v(SAa(|)EOC SBe(|), "| |");
+ v(SAa(|)EOC SBf(|), "| |");
+ v(SAa(|)EFA() |, "| |");
+ v(SAa(|)EFA() SBa(|), "| |");
+ v(SAa(|)EFA() SBb(|), "| |");
+ v(SAa(|)EFA() SBc(|), "| |");
+ v(SAa(|)EFA() SBd(|), "| |");
+ v(SAa(|)EFA() SBe(|), "| |");
+ v(SAa(|)EFA() SBf(|), "| |");
+ v(SAa(|)EFB() |, "| |");
+ v(SAa(|)EFB() SBa(|), "| |");
+ v(SAa(|)EFB() SBb(|), "| |");
+ v(SAa(|)EFB() SBc(|), "| |");
+ v(SAa(|)EFB() SBd(|), "| |");
+ v(SAa(|)EFB() SBe(|), "| |");
+ v(SAa(|)EFB() SBf(|), "| |");
+ v(SAa(|)EFC() |, "| |");
+ v(SAa(|)EFC() SBa(|), "| |");
+ v(SAa(|)EFC() SBb(|), "| |");
+ v(SAa(|)EFC() SBc(|), "| |");
+ v(SAa(|)EFC() SBd(|), "| |");
+ v(SAa(|)EFC() SBe(|), "| |");
+ v(SAa(|)EFC() SBf(|), "| |");
+ v(SAa(|) EOA |, "| |");
+ v(SAa(|) EOA SBa(|), "| |");
+ v(SAa(|) EOA SBb(|), "| |");
+ v(SAa(|) EOA SBc(|), "| |");
+ v(SAa(|) EOA SBd(|), "| |");
+ v(SAa(|) EOA SBe(|), "| |");
+ v(SAa(|) EOA SBf(|), "| |");
+ v(SAa(|) EOB |, "| |");
+ v(SAa(|) EOB SBa(|), "| |");
+ v(SAa(|) EOB SBb(|), "| |");
+ v(SAa(|) EOB SBc(|), "| |");
+ v(SAa(|) EOB SBd(|), "| |");
+ v(SAa(|) EOB SBe(|), "| |");
+ v(SAa(|) EOB SBf(|), "| |");
+ v(SAa(|) EOC |, "| |");
+ v(SAa(|) EOC SBa(|), "| |");
+ v(SAa(|) EOC SBb(|), "| |");
+ v(SAa(|) EOC SBc(|), "| |");
+ v(SAa(|) EOC SBd(|), "| |");
+ v(SAa(|) EOC SBe(|), "| |");
+ v(SAa(|) EOC SBf(|), "| |");
+ v(SAa(|) EFA() |, "| |");
+ v(SAa(|) EFA() SBa(|), "| |");
+ v(SAa(|) EFA() SBb(|), "| |");
+ v(SAa(|) EFA() SBc(|), "| |");
+ v(SAa(|) EFA() SBd(|), "| |");
+ v(SAa(|) EFA() SBe(|), "| |");
+ v(SAa(|) EFA() SBf(|), "| |");
+ v(SAa(|) EFB() |, "| |");
+ v(SAa(|) EFB() SBa(|), "| |");
+ v(SAa(|) EFB() SBb(|), "| |");
+ v(SAa(|) EFB() SBc(|), "| |");
+ v(SAa(|) EFB() SBd(|), "| |");
+ v(SAa(|) EFB() SBe(|), "| |");
+ v(SAa(|) EFB() SBf(|), "| |");
+ v(SAa(|) EFC() |, "| |");
+ v(SAa(|) EFC() SBa(|), "| |");
+ v(SAa(|) EFC() SBb(|), "| |");
+ v(SAa(|) EFC() SBc(|), "| |");
+ v(SAa(|) EFC() SBd(|), "| |");
+ v(SAa(|) EFC() SBe(|), "| |");
+ v(SAa(|) EFC() SBf(|), "| |");
+}
+
+void
+check3 (void)
+{
+ v(SAb(|)|, "| |");
+ v(SAb(|)SBa(|), "| |");
+ v(SAb(|)SBb(|), "| |");
+ v(SAb(|)SBc(|), "| |");
+ v(SAb(|)SBd(|), "| |");
+ v(SAb(|)SBe(|), "| |");
+ v(SAb(|)SBf(|), "| |");
+ v(SAb(|) |, "| |");
+ v(SAb(|) SBa(|), "| |");
+ v(SAb(|) SBb(|), "| |");
+ v(SAb(|) SBc(|), "| |");
+ v(SAb(|) SBd(|), "| |");
+ v(SAb(|) SBe(|), "| |");
+ v(SAb(|) SBf(|), "| |");
+ v(SAb(|)EOA|, "| |");
+ v(SAb(|)EOB|, "| |");
+ v(SAb(|)EOC|, "| |");
+ v(SAb(|)EFA()|, "| |");
+ v(SAb(|)EFA()SBa(|), "| |");
+ v(SAb(|)EFA()SBb(|), "| |");
+ v(SAb(|)EFA()SBc(|), "| |");
+ v(SAb(|)EFA()SBd(|), "| |");
+ v(SAb(|)EFA()SBe(|), "| |");
+ v(SAb(|)EFA()SBf(|), "| |");
+ v(SAb(|)EFB()|, "| |");
+ v(SAb(|)EFB()SBa(|), "| |");
+ v(SAb(|)EFB()SBb(|), "| |");
+ v(SAb(|)EFB()SBc(|), "| |");
+ v(SAb(|)EFB()SBd(|), "| |");
+ v(SAb(|)EFB()SBe(|), "| |");
+ v(SAb(|)EFB()SBf(|), "| |");
+ v(SAb(|)EFC()|, "| |");
+ v(SAb(|)EFC()SBa(|), "| |");
+ v(SAb(|)EFC()SBb(|), "| |");
+ v(SAb(|)EFC()SBc(|), "| |");
+ v(SAb(|)EFC()SBd(|), "| |");
+ v(SAb(|)EFC()SBe(|), "| |");
+ v(SAb(|)EFC()SBf(|), "| |");
+ v(SAb(|) EOA|, "| |");
+ v(SAb(|) EOB|, "| |");
+ v(SAb(|) EOC|, "| |");
+ v(SAb(|) EFA()|, "| |");
+ v(SAb(|) EFA()SBa(|), "| |");
+ v(SAb(|) EFA()SBb(|), "| |");
+ v(SAb(|) EFA()SBc(|), "| |");
+ v(SAb(|) EFA()SBd(|), "| |");
+ v(SAb(|) EFA()SBe(|), "| |");
+ v(SAb(|) EFA()SBf(|), "| |");
+ v(SAb(|) EFB()|, "| |");
+ v(SAb(|) EFB()SBa(|), "| |");
+ v(SAb(|) EFB()SBb(|), "| |");
+ v(SAb(|) EFB()SBc(|), "| |");
+ v(SAb(|) EFB()SBd(|), "| |");
+ v(SAb(|) EFB()SBe(|), "| |");
+ v(SAb(|) EFB()SBf(|), "| |");
+ v(SAb(|) EFC()|, "| |");
+ v(SAb(|) EFC()SBa(|), "| |");
+ v(SAb(|) EFC()SBb(|), "| |");
+ v(SAb(|) EFC()SBc(|), "| |");
+ v(SAb(|) EFC()SBd(|), "| |");
+ v(SAb(|) EFC()SBe(|), "| |");
+ v(SAb(|) EFC()SBf(|), "| |");
+ v(SAb(|)EOA |, "| |");
+ v(SAb(|)EOA SBa(|), "| |");
+ v(SAb(|)EOA SBb(|), "| |");
+ v(SAb(|)EOA SBc(|), "| |");
+ v(SAb(|)EOA SBd(|), "| |");
+ v(SAb(|)EOA SBe(|), "| |");
+ v(SAb(|)EOA SBf(|), "| |");
+ v(SAb(|)EOB |, "| |");
+ v(SAb(|)EOB SBa(|), "| |");
+ v(SAb(|)EOB SBb(|), "| |");
+ v(SAb(|)EOB SBc(|), "| |");
+ v(SAb(|)EOB SBd(|), "| |");
+ v(SAb(|)EOB SBe(|), "| |");
+ v(SAb(|)EOB SBf(|), "| |");
+ v(SAb(|)EOC |, "| |");
+ v(SAb(|)EOC SBa(|), "| |");
+ v(SAb(|)EOC SBb(|), "| |");
+ v(SAb(|)EOC SBc(|), "| |");
+ v(SAb(|)EOC SBd(|), "| |");
+ v(SAb(|)EOC SBe(|), "| |");
+ v(SAb(|)EOC SBf(|), "| |");
+ v(SAb(|)EFA() |, "| |");
+ v(SAb(|)EFA() SBa(|), "| |");
+ v(SAb(|)EFA() SBb(|), "| |");
+ v(SAb(|)EFA() SBc(|), "| |");
+ v(SAb(|)EFA() SBd(|), "| |");
+ v(SAb(|)EFA() SBe(|), "| |");
+ v(SAb(|)EFA() SBf(|), "| |");
+ v(SAb(|)EFB() |, "| |");
+ v(SAb(|)EFB() SBa(|), "| |");
+ v(SAb(|)EFB() SBb(|), "| |");
+ v(SAb(|)EFB() SBc(|), "| |");
+ v(SAb(|)EFB() SBd(|), "| |");
+ v(SAb(|)EFB() SBe(|), "| |");
+ v(SAb(|)EFB() SBf(|), "| |");
+ v(SAb(|)EFC() |, "| |");
+ v(SAb(|)EFC() SBa(|), "| |");
+ v(SAb(|)EFC() SBb(|), "| |");
+ v(SAb(|)EFC() SBc(|), "| |");
+ v(SAb(|)EFC() SBd(|), "| |");
+ v(SAb(|)EFC() SBe(|), "| |");
+ v(SAb(|)EFC() SBf(|), "| |");
+ v(SAb(|) EOA |, "| |");
+ v(SAb(|) EOA SBa(|), "| |");
+ v(SAb(|) EOA SBb(|), "| |");
+ v(SAb(|) EOA SBc(|), "| |");
+ v(SAb(|) EOA SBd(|), "| |");
+ v(SAb(|) EOA SBe(|), "| |");
+ v(SAb(|) EOA SBf(|), "| |");
+ v(SAb(|) EOB |, "| |");
+ v(SAb(|) EOB SBa(|), "| |");
+ v(SAb(|) EOB SBb(|), "| |");
+ v(SAb(|) EOB SBc(|), "| |");
+ v(SAb(|) EOB SBd(|), "| |");
+ v(SAb(|) EOB SBe(|), "| |");
+ v(SAb(|) EOB SBf(|), "| |");
+ v(SAb(|) EOC |, "| |");
+ v(SAb(|) EOC SBa(|), "| |");
+ v(SAb(|) EOC SBb(|), "| |");
+ v(SAb(|) EOC SBc(|), "| |");
+ v(SAb(|) EOC SBd(|), "| |");
+ v(SAb(|) EOC SBe(|), "| |");
+ v(SAb(|) EOC SBf(|), "| |");
+ v(SAb(|) EFA() |, "| |");
+ v(SAb(|) EFA() SBa(|), "| |");
+ v(SAb(|) EFA() SBb(|), "| |");
+ v(SAb(|) EFA() SBc(|), "| |");
+ v(SAb(|) EFA() SBd(|), "| |");
+ v(SAb(|) EFA() SBe(|), "| |");
+ v(SAb(|) EFA() SBf(|), "| |");
+ v(SAb(|) EFB() |, "| |");
+ v(SAb(|) EFB() SBa(|), "| |");
+ v(SAb(|) EFB() SBb(|), "| |");
+ v(SAb(|) EFB() SBc(|), "| |");
+ v(SAb(|) EFB() SBd(|), "| |");
+ v(SAb(|) EFB() SBe(|), "| |");
+ v(SAb(|) EFB() SBf(|), "| |");
+ v(SAb(|) EFC() |, "| |");
+ v(SAb(|) EFC() SBa(|), "| |");
+ v(SAb(|) EFC() SBb(|), "| |");
+ v(SAb(|) EFC() SBc(|), "| |");
+ v(SAb(|) EFC() SBd(|), "| |");
+ v(SAb(|) EFC() SBe(|), "| |");
+ v(SAb(|) EFC() SBf(|), "| |");
+}
+
+void
+check4 (void)
+{
+ v(SAc(|)|, "| |");
+ v(SAc(|)SBa(|), "| |");
+ v(SAc(|)SBb(|), "| |");
+ v(SAc(|)SBc(|), "| |");
+ v(SAc(|)SBd(|), "| |");
+ v(SAc(|)SBe(|), "| |");
+ v(SAc(|)SBf(|), "| |");
+ v(SAc(|) |, "| |");
+ v(SAc(|) SBa(|), "| |");
+ v(SAc(|) SBb(|), "| |");
+ v(SAc(|) SBc(|), "| |");
+ v(SAc(|) SBd(|), "| |");
+ v(SAc(|) SBe(|), "| |");
+ v(SAc(|) SBf(|), "| |");
+ v(SAc(|)EOA|, "| |");
+ v(SAc(|)EOB|, "| |");
+ v(SAc(|)EOC|, "| |");
+ v(SAc(|)EFA()|, "| |");
+ v(SAc(|)EFA()SBa(|), "| |");
+ v(SAc(|)EFA()SBb(|), "| |");
+ v(SAc(|)EFA()SBc(|), "| |");
+ v(SAc(|)EFA()SBd(|), "| |");
+ v(SAc(|)EFA()SBe(|), "| |");
+ v(SAc(|)EFA()SBf(|), "| |");
+ v(SAc(|)EFB()|, "| |");
+ v(SAc(|)EFB()SBa(|), "| |");
+ v(SAc(|)EFB()SBb(|), "| |");
+ v(SAc(|)EFB()SBc(|), "| |");
+ v(SAc(|)EFB()SBd(|), "| |");
+ v(SAc(|)EFB()SBe(|), "| |");
+ v(SAc(|)EFB()SBf(|), "| |");
+ v(SAc(|)EFC()|, "| |");
+ v(SAc(|)EFC()SBa(|), "| |");
+ v(SAc(|)EFC()SBb(|), "| |");
+ v(SAc(|)EFC()SBc(|), "| |");
+ v(SAc(|)EFC()SBd(|), "| |");
+ v(SAc(|)EFC()SBe(|), "| |");
+ v(SAc(|)EFC()SBf(|), "| |");
+ v(SAc(|) EOA|, "| |");
+ v(SAc(|) EOB|, "| |");
+ v(SAc(|) EOC|, "| |");
+ v(SAc(|) EFA()|, "| |");
+ v(SAc(|) EFA()SBa(|), "| |");
+ v(SAc(|) EFA()SBb(|), "| |");
+ v(SAc(|) EFA()SBc(|), "| |");
+ v(SAc(|) EFA()SBd(|), "| |");
+ v(SAc(|) EFA()SBe(|), "| |");
+ v(SAc(|) EFA()SBf(|), "| |");
+ v(SAc(|) EFB()|, "| |");
+ v(SAc(|) EFB()SBa(|), "| |");
+ v(SAc(|) EFB()SBb(|), "| |");
+ v(SAc(|) EFB()SBc(|), "| |");
+ v(SAc(|) EFB()SBd(|), "| |");
+ v(SAc(|) EFB()SBe(|), "| |");
+ v(SAc(|) EFB()SBf(|), "| |");
+ v(SAc(|) EFC()|, "| |");
+ v(SAc(|) EFC()SBa(|), "| |");
+ v(SAc(|) EFC()SBb(|), "| |");
+ v(SAc(|) EFC()SBc(|), "| |");
+ v(SAc(|) EFC()SBd(|), "| |");
+ v(SAc(|) EFC()SBe(|), "| |");
+ v(SAc(|) EFC()SBf(|), "| |");
+ v(SAc(|)EOA |, "| |");
+ v(SAc(|)EOA SBa(|), "| |");
+ v(SAc(|)EOA SBb(|), "| |");
+ v(SAc(|)EOA SBc(|), "| |");
+ v(SAc(|)EOA SBd(|), "| |");
+ v(SAc(|)EOA SBe(|), "| |");
+ v(SAc(|)EOA SBf(|), "| |");
+ v(SAc(|)EOB |, "| |");
+ v(SAc(|)EOB SBa(|), "| |");
+ v(SAc(|)EOB SBb(|), "| |");
+ v(SAc(|)EOB SBc(|), "| |");
+ v(SAc(|)EOB SBd(|), "| |");
+ v(SAc(|)EOB SBe(|), "| |");
+ v(SAc(|)EOB SBf(|), "| |");
+ v(SAc(|)EOC |, "| |");
+ v(SAc(|)EOC SBa(|), "| |");
+ v(SAc(|)EOC SBb(|), "| |");
+ v(SAc(|)EOC SBc(|), "| |");
+ v(SAc(|)EOC SBd(|), "| |");
+ v(SAc(|)EOC SBe(|), "| |");
+ v(SAc(|)EOC SBf(|), "| |");
+ v(SAc(|)EFA() |, "| |");
+ v(SAc(|)EFA() SBa(|), "| |");
+ v(SAc(|)EFA() SBb(|), "| |");
+ v(SAc(|)EFA() SBc(|), "| |");
+ v(SAc(|)EFA() SBd(|), "| |");
+ v(SAc(|)EFA() SBe(|), "| |");
+ v(SAc(|)EFA() SBf(|), "| |");
+ v(SAc(|)EFB() |, "| |");
+ v(SAc(|)EFB() SBa(|), "| |");
+ v(SAc(|)EFB() SBb(|), "| |");
+ v(SAc(|)EFB() SBc(|), "| |");
+ v(SAc(|)EFB() SBd(|), "| |");
+ v(SAc(|)EFB() SBe(|), "| |");
+ v(SAc(|)EFB() SBf(|), "| |");
+ v(SAc(|)EFC() |, "| |");
+ v(SAc(|)EFC() SBa(|), "| |");
+ v(SAc(|)EFC() SBb(|), "| |");
+ v(SAc(|)EFC() SBc(|), "| |");
+ v(SAc(|)EFC() SBd(|), "| |");
+ v(SAc(|)EFC() SBe(|), "| |");
+ v(SAc(|)EFC() SBf(|), "| |");
+ v(SAc(|) EOA |, "| |");
+ v(SAc(|) EOA SBa(|), "| |");
+ v(SAc(|) EOA SBb(|), "| |");
+ v(SAc(|) EOA SBc(|), "| |");
+ v(SAc(|) EOA SBd(|), "| |");
+ v(SAc(|) EOA SBe(|), "| |");
+ v(SAc(|) EOA SBf(|), "| |");
+ v(SAc(|) EOB |, "| |");
+ v(SAc(|) EOB SBa(|), "| |");
+ v(SAc(|) EOB SBb(|), "| |");
+ v(SAc(|) EOB SBc(|), "| |");
+ v(SAc(|) EOB SBd(|), "| |");
+ v(SAc(|) EOB SBe(|), "| |");
+ v(SAc(|) EOB SBf(|), "| |");
+ v(SAc(|) EOC |, "| |");
+ v(SAc(|) EOC SBa(|), "| |");
+ v(SAc(|) EOC SBb(|), "| |");
+ v(SAc(|) EOC SBc(|), "| |");
+ v(SAc(|) EOC SBd(|), "| |");
+ v(SAc(|) EOC SBe(|), "| |");
+ v(SAc(|) EOC SBf(|), "| |");
+ v(SAc(|) EFA() |, "| |");
+ v(SAc(|) EFA() SBa(|), "| |");
+ v(SAc(|) EFA() SBb(|), "| |");
+ v(SAc(|) EFA() SBc(|), "| |");
+ v(SAc(|) EFA() SBd(|), "| |");
+ v(SAc(|) EFA() SBe(|), "| |");
+ v(SAc(|) EFA() SBf(|), "| |");
+ v(SAc(|) EFB() |, "| |");
+ v(SAc(|) EFB() SBa(|), "| |");
+ v(SAc(|) EFB() SBb(|), "| |");
+ v(SAc(|) EFB() SBc(|), "| |");
+ v(SAc(|) EFB() SBd(|), "| |");
+ v(SAc(|) EFB() SBe(|), "| |");
+ v(SAc(|) EFB() SBf(|), "| |");
+ v(SAc(|) EFC() |, "| |");
+ v(SAc(|) EFC() SBa(|), "| |");
+ v(SAc(|) EFC() SBb(|), "| |");
+ v(SAc(|) EFC() SBc(|), "| |");
+ v(SAc(|) EFC() SBd(|), "| |");
+ v(SAc(|) EFC() SBe(|), "| |");
+ v(SAc(|) EFC() SBf(|), "| |");
+ v(SAc(|)|, "| |");
+ v(SAc(|)SBa(|), "| |");
+ v(SAc(|)SBb(|), "| |");
+ v(SAc(|)SBc(|), "| |");
+ v(SAc(|)SBd(|), "| |");
+ v(SAc(|)SBe(|), "| |");
+ v(SAc(|)SBf(|), "| |");
+ v(SAc(|) |, "| |");
+ v(SAc(|) SBa(|), "| |");
+ v(SAc(|) SBb(|), "| |");
+ v(SAc(|) SBc(|), "| |");
+ v(SAc(|) SBd(|), "| |");
+ v(SAc(|) SBe(|), "| |");
+ v(SAc(|) SBf(|), "| |");
+ v(SAc(|)EOA|, "| |");
+ v(SAc(|)EOB|, "| |");
+ v(SAc(|)EOC|, "| |");
+ v(SAc(|)EFA()|, "| |");
+ v(SAc(|)EFA()SBa(|), "| |");
+ v(SAc(|)EFA()SBb(|), "| |");
+ v(SAc(|)EFA()SBc(|), "| |");
+ v(SAc(|)EFA()SBd(|), "| |");
+ v(SAc(|)EFA()SBe(|), "| |");
+ v(SAc(|)EFA()SBf(|), "| |");
+ v(SAc(|)EFB()|, "| |");
+ v(SAc(|)EFB()SBa(|), "| |");
+ v(SAc(|)EFB()SBb(|), "| |");
+ v(SAc(|)EFB()SBc(|), "| |");
+ v(SAc(|)EFB()SBd(|), "| |");
+ v(SAc(|)EFB()SBe(|), "| |");
+ v(SAc(|)EFB()SBf(|), "| |");
+ v(SAc(|)EFC()|, "| |");
+ v(SAc(|)EFC()SBa(|), "| |");
+ v(SAc(|)EFC()SBb(|), "| |");
+ v(SAc(|)EFC()SBc(|), "| |");
+ v(SAc(|)EFC()SBd(|), "| |");
+ v(SAc(|)EFC()SBe(|), "| |");
+ v(SAc(|)EFC()SBf(|), "| |");
+ v(SAc(|) EOA|, "| |");
+ v(SAc(|) EOB|, "| |");
+ v(SAc(|) EOC|, "| |");
+ v(SAc(|) EFA()|, "| |");
+ v(SAc(|) EFA()SBa(|), "| |");
+ v(SAc(|) EFA()SBb(|), "| |");
+ v(SAc(|) EFA()SBc(|), "| |");
+ v(SAc(|) EFA()SBd(|), "| |");
+ v(SAc(|) EFA()SBe(|), "| |");
+ v(SAc(|) EFA()SBf(|), "| |");
+ v(SAc(|) EFB()|, "| |");
+ v(SAc(|) EFB()SBa(|), "| |");
+ v(SAc(|) EFB()SBb(|), "| |");
+ v(SAc(|) EFB()SBc(|), "| |");
+ v(SAc(|) EFB()SBd(|), "| |");
+ v(SAc(|) EFB()SBe(|), "| |");
+ v(SAc(|) EFB()SBf(|), "| |");
+ v(SAc(|) EFC()|, "| |");
+ v(SAc(|) EFC()SBa(|), "| |");
+ v(SAc(|) EFC()SBb(|), "| |");
+ v(SAc(|) EFC()SBc(|), "| |");
+ v(SAc(|) EFC()SBd(|), "| |");
+ v(SAc(|) EFC()SBe(|), "| |");
+ v(SAc(|) EFC()SBf(|), "| |");
+ v(SAc(|)EOA |, "| |");
+ v(SAc(|)EOA SBa(|), "| |");
+ v(SAc(|)EOA SBb(|), "| |");
+ v(SAc(|)EOA SBc(|), "| |");
+ v(SAc(|)EOA SBd(|), "| |");
+ v(SAc(|)EOA SBe(|), "| |");
+ v(SAc(|)EOA SBf(|), "| |");
+ v(SAc(|)EOB |, "| |");
+ v(SAc(|)EOB SBa(|), "| |");
+ v(SAc(|)EOB SBb(|), "| |");
+ v(SAc(|)EOB SBc(|), "| |");
+ v(SAc(|)EOB SBd(|), "| |");
+ v(SAc(|)EOB SBe(|), "| |");
+ v(SAc(|)EOB SBf(|), "| |");
+ v(SAc(|)EOC |, "| |");
+ v(SAc(|)EOC SBa(|), "| |");
+ v(SAc(|)EOC SBb(|), "| |");
+ v(SAc(|)EOC SBc(|), "| |");
+ v(SAc(|)EOC SBd(|), "| |");
+ v(SAc(|)EOC SBe(|), "| |");
+ v(SAc(|)EOC SBf(|), "| |");
+ v(SAc(|)EFA() |, "| |");
+ v(SAc(|)EFA() SBa(|), "| |");
+ v(SAc(|)EFA() SBb(|), "| |");
+ v(SAc(|)EFA() SBc(|), "| |");
+ v(SAc(|)EFA() SBd(|), "| |");
+ v(SAc(|)EFA() SBe(|), "| |");
+ v(SAc(|)EFA() SBf(|), "| |");
+ v(SAc(|)EFB() |, "| |");
+ v(SAc(|)EFB() SBa(|), "| |");
+ v(SAc(|)EFB() SBb(|), "| |");
+ v(SAc(|)EFB() SBc(|), "| |");
+ v(SAc(|)EFB() SBd(|), "| |");
+ v(SAc(|)EFB() SBe(|), "| |");
+ v(SAc(|)EFB() SBf(|), "| |");
+ v(SAc(|)EFC() |, "| |");
+ v(SAc(|)EFC() SBa(|), "| |");
+ v(SAc(|)EFC() SBb(|), "| |");
+ v(SAc(|)EFC() SBc(|), "| |");
+ v(SAc(|)EFC() SBd(|), "| |");
+ v(SAc(|)EFC() SBe(|), "| |");
+ v(SAc(|)EFC() SBf(|), "| |");
+ v(SAc(|) EOA |, "| |");
+ v(SAc(|) EOA SBa(|), "| |");
+ v(SAc(|) EOA SBb(|), "| |");
+ v(SAc(|) EOA SBc(|), "| |");
+ v(SAc(|) EOA SBd(|), "| |");
+ v(SAc(|) EOA SBe(|), "| |");
+ v(SAc(|) EOA SBf(|), "| |");
+ v(SAc(|) EOB |, "| |");
+ v(SAc(|) EOB SBa(|), "| |");
+ v(SAc(|) EOB SBb(|), "| |");
+ v(SAc(|) EOB SBc(|), "| |");
+ v(SAc(|) EOB SBd(|), "| |");
+ v(SAc(|) EOB SBe(|), "| |");
+ v(SAc(|) EOB SBf(|), "| |");
+ v(SAc(|) EOC |, "| |");
+ v(SAc(|) EOC SBa(|), "| |");
+ v(SAc(|) EOC SBb(|), "| |");
+ v(SAc(|) EOC SBc(|), "| |");
+ v(SAc(|) EOC SBd(|), "| |");
+ v(SAc(|) EOC SBe(|), "| |");
+ v(SAc(|) EOC SBf(|), "| |");
+ v(SAc(|) EFA() |, "| |");
+ v(SAc(|) EFA() SBa(|), "| |");
+ v(SAc(|) EFA() SBb(|), "| |");
+ v(SAc(|) EFA() SBc(|), "| |");
+ v(SAc(|) EFA() SBd(|), "| |");
+ v(SAc(|) EFA() SBe(|), "| |");
+ v(SAc(|) EFA() SBf(|), "| |");
+ v(SAc(|) EFB() |, "| |");
+ v(SAc(|) EFB() SBa(|), "| |");
+ v(SAc(|) EFB() SBb(|), "| |");
+ v(SAc(|) EFB() SBc(|), "| |");
+ v(SAc(|) EFB() SBd(|), "| |");
+ v(SAc(|) EFB() SBe(|), "| |");
+ v(SAc(|) EFB() SBf(|), "| |");
+ v(SAc(|) EFC() |, "| |");
+ v(SAc(|) EFC() SBa(|), "| |");
+ v(SAc(|) EFC() SBb(|), "| |");
+ v(SAc(|) EFC() SBc(|), "| |");
+ v(SAc(|) EFC() SBd(|), "| |");
+ v(SAc(|) EFC() SBe(|), "| |");
+ v(SAc(|) EFC() SBf(|), "| |");
+}
+
+void
+check5 (void)
+{
+ v(SAd(|)|, "| |");
+ v(SAd(|)SBa(|), "| |");
+ v(SAd(|)SBb(|), "| |");
+ v(SAd(|)SBc(|), "| |");
+ v(SAd(|)SBd(|), "| |");
+ v(SAd(|)SBe(|), "| |");
+ v(SAd(|)SBf(|), "| |");
+ v(SAd(|) |, "| |");
+ v(SAd(|) SBa(|), "| |");
+ v(SAd(|) SBb(|), "| |");
+ v(SAd(|) SBc(|), "| |");
+ v(SAd(|) SBd(|), "| |");
+ v(SAd(|) SBe(|), "| |");
+ v(SAd(|) SBf(|), "| |");
+ v(SAd(|)EOA|, "| |");
+ v(SAd(|)EOB|, "| |");
+ v(SAd(|)EOC|, "| |");
+ v(SAd(|)EFA()|, "| |");
+ v(SAd(|)EFA()SBa(|), "| |");
+ v(SAd(|)EFA()SBb(|), "| |");
+ v(SAd(|)EFA()SBc(|), "| |");
+ v(SAd(|)EFA()SBd(|), "| |");
+ v(SAd(|)EFA()SBe(|), "| |");
+ v(SAd(|)EFA()SBf(|), "| |");
+ v(SAd(|)EFB()|, "| |");
+ v(SAd(|)EFB()SBa(|), "| |");
+ v(SAd(|)EFB()SBb(|), "| |");
+ v(SAd(|)EFB()SBc(|), "| |");
+ v(SAd(|)EFB()SBd(|), "| |");
+ v(SAd(|)EFB()SBe(|), "| |");
+ v(SAd(|)EFB()SBf(|), "| |");
+ v(SAd(|)EFC()|, "| |");
+ v(SAd(|)EFC()SBa(|), "| |");
+ v(SAd(|)EFC()SBb(|), "| |");
+ v(SAd(|)EFC()SBc(|), "| |");
+ v(SAd(|)EFC()SBd(|), "| |");
+ v(SAd(|)EFC()SBe(|), "| |");
+ v(SAd(|)EFC()SBf(|), "| |");
+ v(SAd(|) EOA|, "| |");
+ v(SAd(|) EOB|, "| |");
+ v(SAd(|) EOC|, "| |");
+ v(SAd(|) EFA()|, "| |");
+ v(SAd(|) EFA()SBa(|), "| |");
+ v(SAd(|) EFA()SBb(|), "| |");
+ v(SAd(|) EFA()SBc(|), "| |");
+ v(SAd(|) EFA()SBd(|), "| |");
+ v(SAd(|) EFA()SBe(|), "| |");
+ v(SAd(|) EFA()SBf(|), "| |");
+ v(SAd(|) EFB()|, "| |");
+ v(SAd(|) EFB()SBa(|), "| |");
+ v(SAd(|) EFB()SBb(|), "| |");
+ v(SAd(|) EFB()SBc(|), "| |");
+ v(SAd(|) EFB()SBd(|), "| |");
+ v(SAd(|) EFB()SBe(|), "| |");
+ v(SAd(|) EFB()SBf(|), "| |");
+ v(SAd(|) EFC()|, "| |");
+ v(SAd(|) EFC()SBa(|), "| |");
+ v(SAd(|) EFC()SBb(|), "| |");
+ v(SAd(|) EFC()SBc(|), "| |");
+ v(SAd(|) EFC()SBd(|), "| |");
+ v(SAd(|) EFC()SBe(|), "| |");
+ v(SAd(|) EFC()SBf(|), "| |");
+ v(SAd(|)EOA |, "| |");
+ v(SAd(|)EOA SBa(|), "| |");
+ v(SAd(|)EOA SBb(|), "| |");
+ v(SAd(|)EOA SBc(|), "| |");
+ v(SAd(|)EOA SBd(|), "| |");
+ v(SAd(|)EOA SBe(|), "| |");
+ v(SAd(|)EOA SBf(|), "| |");
+ v(SAd(|)EOB |, "| |");
+ v(SAd(|)EOB SBa(|), "| |");
+ v(SAd(|)EOB SBb(|), "| |");
+ v(SAd(|)EOB SBc(|), "| |");
+ v(SAd(|)EOB SBd(|), "| |");
+ v(SAd(|)EOB SBe(|), "| |");
+ v(SAd(|)EOB SBf(|), "| |");
+ v(SAd(|)EOC |, "| |");
+ v(SAd(|)EOC SBa(|), "| |");
+ v(SAd(|)EOC SBb(|), "| |");
+ v(SAd(|)EOC SBc(|), "| |");
+ v(SAd(|)EOC SBd(|), "| |");
+ v(SAd(|)EOC SBe(|), "| |");
+ v(SAd(|)EOC SBf(|), "| |");
+ v(SAd(|)EFA() |, "| |");
+ v(SAd(|)EFA() SBa(|), "| |");
+ v(SAd(|)EFA() SBb(|), "| |");
+ v(SAd(|)EFA() SBc(|), "| |");
+ v(SAd(|)EFA() SBd(|), "| |");
+ v(SAd(|)EFA() SBe(|), "| |");
+ v(SAd(|)EFA() SBf(|), "| |");
+ v(SAd(|)EFB() |, "| |");
+ v(SAd(|)EFB() SBa(|), "| |");
+ v(SAd(|)EFB() SBb(|), "| |");
+ v(SAd(|)EFB() SBc(|), "| |");
+ v(SAd(|)EFB() SBd(|), "| |");
+ v(SAd(|)EFB() SBe(|), "| |");
+ v(SAd(|)EFB() SBf(|), "| |");
+ v(SAd(|)EFC() |, "| |");
+ v(SAd(|)EFC() SBa(|), "| |");
+ v(SAd(|)EFC() SBb(|), "| |");
+ v(SAd(|)EFC() SBc(|), "| |");
+ v(SAd(|)EFC() SBd(|), "| |");
+ v(SAd(|)EFC() SBe(|), "| |");
+ v(SAd(|)EFC() SBf(|), "| |");
+ v(SAd(|) EOA |, "| |");
+ v(SAd(|) EOA SBa(|), "| |");
+ v(SAd(|) EOA SBb(|), "| |");
+ v(SAd(|) EOA SBc(|), "| |");
+ v(SAd(|) EOA SBd(|), "| |");
+ v(SAd(|) EOA SBe(|), "| |");
+ v(SAd(|) EOA SBf(|), "| |");
+ v(SAd(|) EOB |, "| |");
+ v(SAd(|) EOB SBa(|), "| |");
+ v(SAd(|) EOB SBb(|), "| |");
+ v(SAd(|) EOB SBc(|), "| |");
+ v(SAd(|) EOB SBd(|), "| |");
+ v(SAd(|) EOB SBe(|), "| |");
+ v(SAd(|) EOB SBf(|), "| |");
+ v(SAd(|) EOC |, "| |");
+ v(SAd(|) EOC SBa(|), "| |");
+ v(SAd(|) EOC SBb(|), "| |");
+ v(SAd(|) EOC SBc(|), "| |");
+ v(SAd(|) EOC SBd(|), "| |");
+ v(SAd(|) EOC SBe(|), "| |");
+ v(SAd(|) EOC SBf(|), "| |");
+ v(SAd(|) EFA() |, "| |");
+ v(SAd(|) EFA() SBa(|), "| |");
+ v(SAd(|) EFA() SBb(|), "| |");
+ v(SAd(|) EFA() SBc(|), "| |");
+ v(SAd(|) EFA() SBd(|), "| |");
+ v(SAd(|) EFA() SBe(|), "| |");
+ v(SAd(|) EFA() SBf(|), "| |");
+ v(SAd(|) EFB() |, "| |");
+ v(SAd(|) EFB() SBa(|), "| |");
+ v(SAd(|) EFB() SBb(|), "| |");
+ v(SAd(|) EFB() SBc(|), "| |");
+ v(SAd(|) EFB() SBd(|), "| |");
+ v(SAd(|) EFB() SBe(|), "| |");
+ v(SAd(|) EFB() SBf(|), "| |");
+ v(SAd(|) EFC() |, "| |");
+ v(SAd(|) EFC() SBa(|), "| |");
+ v(SAd(|) EFC() SBb(|), "| |");
+ v(SAd(|) EFC() SBc(|), "| |");
+ v(SAd(|) EFC() SBd(|), "| |");
+ v(SAd(|) EFC() SBe(|), "| |");
+ v(SAd(|) EFC() SBf(|), "| |");
+}
+
+void
+check6 (void)
+{
+ v(SAe(|)|, "| |");
+ v(SAe(|)SBa(|), "| |");
+ v(SAe(|)SBb(|), "| |");
+ v(SAe(|)SBc(|), "| |");
+ v(SAe(|)SBd(|), "| |");
+ v(SAe(|)SBe(|), "| |");
+ v(SAe(|)SBf(|), "| |");
+ v(SAe(|) |, "| |");
+ v(SAe(|) SBa(|), "| |");
+ v(SAe(|) SBb(|), "| |");
+ v(SAe(|) SBc(|), "| |");
+ v(SAe(|) SBd(|), "| |");
+ v(SAe(|) SBe(|), "| |");
+ v(SAe(|) SBf(|), "| |");
+ v(SAe(|)EOA|, "| |");
+ v(SAe(|)EOB|, "| |");
+ v(SAe(|)EOC|, "| |");
+ v(SAe(|)EFA()|, "| |");
+ v(SAe(|)EFA()SBa(|), "| |");
+ v(SAe(|)EFA()SBb(|), "| |");
+ v(SAe(|)EFA()SBc(|), "| |");
+ v(SAe(|)EFA()SBd(|), "| |");
+ v(SAe(|)EFA()SBe(|), "| |");
+ v(SAe(|)EFA()SBf(|), "| |");
+ v(SAe(|)EFB()|, "| |");
+ v(SAe(|)EFB()SBa(|), "| |");
+ v(SAe(|)EFB()SBb(|), "| |");
+ v(SAe(|)EFB()SBc(|), "| |");
+ v(SAe(|)EFB()SBd(|), "| |");
+ v(SAe(|)EFB()SBe(|), "| |");
+ v(SAe(|)EFB()SBf(|), "| |");
+ v(SAe(|)EFC()|, "| |");
+ v(SAe(|)EFC()SBa(|), "| |");
+ v(SAe(|)EFC()SBb(|), "| |");
+ v(SAe(|)EFC()SBc(|), "| |");
+ v(SAe(|)EFC()SBd(|), "| |");
+ v(SAe(|)EFC()SBe(|), "| |");
+ v(SAe(|)EFC()SBf(|), "| |");
+ v(SAe(|) EOA|, "| |");
+ v(SAe(|) EOB|, "| |");
+ v(SAe(|) EOC|, "| |");
+ v(SAe(|) EFA()|, "| |");
+ v(SAe(|) EFA()SBa(|), "| |");
+ v(SAe(|) EFA()SBb(|), "| |");
+ v(SAe(|) EFA()SBc(|), "| |");
+ v(SAe(|) EFA()SBd(|), "| |");
+ v(SAe(|) EFA()SBe(|), "| |");
+ v(SAe(|) EFA()SBf(|), "| |");
+ v(SAe(|) EFB()|, "| |");
+ v(SAe(|) EFB()SBa(|), "| |");
+ v(SAe(|) EFB()SBb(|), "| |");
+ v(SAe(|) EFB()SBc(|), "| |");
+ v(SAe(|) EFB()SBd(|), "| |");
+ v(SAe(|) EFB()SBe(|), "| |");
+ v(SAe(|) EFB()SBf(|), "| |");
+ v(SAe(|) EFC()|, "| |");
+ v(SAe(|) EFC()SBa(|), "| |");
+ v(SAe(|) EFC()SBb(|), "| |");
+ v(SAe(|) EFC()SBc(|), "| |");
+ v(SAe(|) EFC()SBd(|), "| |");
+ v(SAe(|) EFC()SBe(|), "| |");
+ v(SAe(|) EFC()SBf(|), "| |");
+ v(SAe(|)EOA |, "| |");
+ v(SAe(|)EOA SBa(|), "| |");
+ v(SAe(|)EOA SBb(|), "| |");
+ v(SAe(|)EOA SBc(|), "| |");
+ v(SAe(|)EOA SBd(|), "| |");
+ v(SAe(|)EOA SBe(|), "| |");
+ v(SAe(|)EOA SBf(|), "| |");
+ v(SAe(|)EOB |, "| |");
+ v(SAe(|)EOB SBa(|), "| |");
+ v(SAe(|)EOB SBb(|), "| |");
+ v(SAe(|)EOB SBc(|), "| |");
+ v(SAe(|)EOB SBd(|), "| |");
+ v(SAe(|)EOB SBe(|), "| |");
+ v(SAe(|)EOB SBf(|), "| |");
+ v(SAe(|)EOC |, "| |");
+ v(SAe(|)EOC SBa(|), "| |");
+ v(SAe(|)EOC SBb(|), "| |");
+ v(SAe(|)EOC SBc(|), "| |");
+ v(SAe(|)EOC SBd(|), "| |");
+ v(SAe(|)EOC SBe(|), "| |");
+ v(SAe(|)EOC SBf(|), "| |");
+ v(SAe(|)EFA() |, "| |");
+ v(SAe(|)EFA() SBa(|), "| |");
+ v(SAe(|)EFA() SBb(|), "| |");
+ v(SAe(|)EFA() SBc(|), "| |");
+ v(SAe(|)EFA() SBd(|), "| |");
+ v(SAe(|)EFA() SBe(|), "| |");
+ v(SAe(|)EFA() SBf(|), "| |");
+ v(SAe(|)EFB() |, "| |");
+ v(SAe(|)EFB() SBa(|), "| |");
+ v(SAe(|)EFB() SBb(|), "| |");
+ v(SAe(|)EFB() SBc(|), "| |");
+ v(SAe(|)EFB() SBd(|), "| |");
+ v(SAe(|)EFB() SBe(|), "| |");
+ v(SAe(|)EFB() SBf(|), "| |");
+ v(SAe(|)EFC() |, "| |");
+ v(SAe(|)EFC() SBa(|), "| |");
+ v(SAe(|)EFC() SBb(|), "| |");
+ v(SAe(|)EFC() SBc(|), "| |");
+ v(SAe(|)EFC() SBd(|), "| |");
+ v(SAe(|)EFC() SBe(|), "| |");
+ v(SAe(|)EFC() SBf(|), "| |");
+ v(SAe(|) EOA |, "| |");
+ v(SAe(|) EOA SBa(|), "| |");
+ v(SAe(|) EOA SBb(|), "| |");
+ v(SAe(|) EOA SBc(|), "| |");
+ v(SAe(|) EOA SBd(|), "| |");
+ v(SAe(|) EOA SBe(|), "| |");
+ v(SAe(|) EOA SBf(|), "| |");
+ v(SAe(|) EOB |, "| |");
+ v(SAe(|) EOB SBa(|), "| |");
+ v(SAe(|) EOB SBb(|), "| |");
+ v(SAe(|) EOB SBc(|), "| |");
+ v(SAe(|) EOB SBd(|), "| |");
+ v(SAe(|) EOB SBe(|), "| |");
+ v(SAe(|) EOB SBf(|), "| |");
+ v(SAe(|) EOC |, "| |");
+ v(SAe(|) EOC SBa(|), "| |");
+ v(SAe(|) EOC SBb(|), "| |");
+ v(SAe(|) EOC SBc(|), "| |");
+ v(SAe(|) EOC SBd(|), "| |");
+ v(SAe(|) EOC SBe(|), "| |");
+ v(SAe(|) EOC SBf(|), "| |");
+ v(SAe(|) EFA() |, "| |");
+ v(SAe(|) EFA() SBa(|), "| |");
+ v(SAe(|) EFA() SBb(|), "| |");
+ v(SAe(|) EFA() SBc(|), "| |");
+ v(SAe(|) EFA() SBd(|), "| |");
+ v(SAe(|) EFA() SBe(|), "| |");
+ v(SAe(|) EFA() SBf(|), "| |");
+ v(SAe(|) EFB() |, "| |");
+ v(SAe(|) EFB() SBa(|), "| |");
+ v(SAe(|) EFB() SBb(|), "| |");
+ v(SAe(|) EFB() SBc(|), "| |");
+ v(SAe(|) EFB() SBd(|), "| |");
+ v(SAe(|) EFB() SBe(|), "| |");
+ v(SAe(|) EFB() SBf(|), "| |");
+ v(SAe(|) EFC() |, "| |");
+ v(SAe(|) EFC() SBa(|), "| |");
+ v(SAe(|) EFC() SBb(|), "| |");
+ v(SAe(|) EFC() SBc(|), "| |");
+ v(SAe(|) EFC() SBd(|), "| |");
+ v(SAe(|) EFC() SBe(|), "| |");
+ v(SAe(|) EFC() SBf(|), "| |");
+}
+
+void
+check7 (void)
+{
+ v(SAf(|)|, "| |");
+ v(SAf(|)SBa(|), "| |");
+ v(SAf(|)SBb(|), "| |");
+ v(SAf(|)SBc(|), "| |");
+ v(SAf(|)SBd(|), "| |");
+ v(SAf(|)SBe(|), "| |");
+ v(SAf(|)SBf(|), "| |");
+ v(SAf(|) |, "| |");
+ v(SAf(|) SBa(|), "| |");
+ v(SAf(|) SBb(|), "| |");
+ v(SAf(|) SBc(|), "| |");
+ v(SAf(|) SBd(|), "| |");
+ v(SAf(|) SBe(|), "| |");
+ v(SAf(|) SBf(|), "| |");
+ v(SAf(|)EOA|, "| |");
+ v(SAf(|)EOB|, "| |");
+ v(SAf(|)EOC|, "| |");
+ v(SAf(|)EFA()|, "| |");
+ v(SAf(|)EFA()SBa(|), "| |");
+ v(SAf(|)EFA()SBb(|), "| |");
+ v(SAf(|)EFA()SBc(|), "| |");
+ v(SAf(|)EFA()SBd(|), "| |");
+ v(SAf(|)EFA()SBe(|), "| |");
+ v(SAf(|)EFA()SBf(|), "| |");
+ v(SAf(|)EFB()|, "| |");
+ v(SAf(|)EFB()SBa(|), "| |");
+ v(SAf(|)EFB()SBb(|), "| |");
+ v(SAf(|)EFB()SBc(|), "| |");
+ v(SAf(|)EFB()SBd(|), "| |");
+ v(SAf(|)EFB()SBe(|), "| |");
+ v(SAf(|)EFB()SBf(|), "| |");
+ v(SAf(|)EFC()|, "| |");
+ v(SAf(|)EFC()SBa(|), "| |");
+ v(SAf(|)EFC()SBb(|), "| |");
+ v(SAf(|)EFC()SBc(|), "| |");
+ v(SAf(|)EFC()SBd(|), "| |");
+ v(SAf(|)EFC()SBe(|), "| |");
+ v(SAf(|)EFC()SBf(|), "| |");
+ v(SAf(|) EOA|, "| |");
+ v(SAf(|) EOB|, "| |");
+ v(SAf(|) EOC|, "| |");
+ v(SAf(|) EFA()|, "| |");
+ v(SAf(|) EFA()SBa(|), "| |");
+ v(SAf(|) EFA()SBb(|), "| |");
+ v(SAf(|) EFA()SBc(|), "| |");
+ v(SAf(|) EFA()SBd(|), "| |");
+ v(SAf(|) EFA()SBe(|), "| |");
+ v(SAf(|) EFA()SBf(|), "| |");
+ v(SAf(|) EFB()|, "| |");
+ v(SAf(|) EFB()SBa(|), "| |");
+ v(SAf(|) EFB()SBb(|), "| |");
+ v(SAf(|) EFB()SBc(|), "| |");
+ v(SAf(|) EFB()SBd(|), "| |");
+ v(SAf(|) EFB()SBe(|), "| |");
+ v(SAf(|) EFB()SBf(|), "| |");
+ v(SAf(|) EFC()|, "| |");
+ v(SAf(|) EFC()SBa(|), "| |");
+ v(SAf(|) EFC()SBb(|), "| |");
+ v(SAf(|) EFC()SBc(|), "| |");
+ v(SAf(|) EFC()SBd(|), "| |");
+ v(SAf(|) EFC()SBe(|), "| |");
+ v(SAf(|) EFC()SBf(|), "| |");
+ v(SAf(|)EOA |, "| |");
+ v(SAf(|)EOA SBa(|), "| |");
+ v(SAf(|)EOA SBb(|), "| |");
+ v(SAf(|)EOA SBc(|), "| |");
+ v(SAf(|)EOA SBd(|), "| |");
+ v(SAf(|)EOA SBe(|), "| |");
+ v(SAf(|)EOA SBf(|), "| |");
+ v(SAf(|)EOB |, "| |");
+ v(SAf(|)EOB SBa(|), "| |");
+ v(SAf(|)EOB SBb(|), "| |");
+ v(SAf(|)EOB SBc(|), "| |");
+ v(SAf(|)EOB SBd(|), "| |");
+ v(SAf(|)EOB SBe(|), "| |");
+ v(SAf(|)EOB SBf(|), "| |");
+ v(SAf(|)EOC |, "| |");
+ v(SAf(|)EOC SBa(|), "| |");
+ v(SAf(|)EOC SBb(|), "| |");
+ v(SAf(|)EOC SBc(|), "| |");
+ v(SAf(|)EOC SBd(|), "| |");
+ v(SAf(|)EOC SBe(|), "| |");
+ v(SAf(|)EOC SBf(|), "| |");
+ v(SAf(|)EFA() |, "| |");
+ v(SAf(|)EFA() SBa(|), "| |");
+ v(SAf(|)EFA() SBb(|), "| |");
+ v(SAf(|)EFA() SBc(|), "| |");
+ v(SAf(|)EFA() SBd(|), "| |");
+ v(SAf(|)EFA() SBe(|), "| |");
+ v(SAf(|)EFA() SBf(|), "| |");
+ v(SAf(|)EFB() |, "| |");
+ v(SAf(|)EFB() SBa(|), "| |");
+ v(SAf(|)EFB() SBb(|), "| |");
+ v(SAf(|)EFB() SBc(|), "| |");
+ v(SAf(|)EFB() SBd(|), "| |");
+ v(SAf(|)EFB() SBe(|), "| |");
+ v(SAf(|)EFB() SBf(|), "| |");
+ v(SAf(|)EFC() |, "| |");
+ v(SAf(|)EFC() SBa(|), "| |");
+ v(SAf(|)EFC() SBb(|), "| |");
+ v(SAf(|)EFC() SBc(|), "| |");
+ v(SAf(|)EFC() SBd(|), "| |");
+ v(SAf(|)EFC() SBe(|), "| |");
+ v(SAf(|)EFC() SBf(|), "| |");
+ v(SAf(|) EOA |, "| |");
+ v(SAf(|) EOA SBa(|), "| |");
+ v(SAf(|) EOA SBb(|), "| |");
+ v(SAf(|) EOA SBc(|), "| |");
+ v(SAf(|) EOA SBd(|), "| |");
+ v(SAf(|) EOA SBe(|), "| |");
+ v(SAf(|) EOA SBf(|), "| |");
+ v(SAf(|) EOB |, "| |");
+ v(SAf(|) EOB SBa(|), "| |");
+ v(SAf(|) EOB SBb(|), "| |");
+ v(SAf(|) EOB SBc(|), "| |");
+ v(SAf(|) EOB SBd(|), "| |");
+ v(SAf(|) EOB SBe(|), "| |");
+ v(SAf(|) EOB SBf(|), "| |");
+ v(SAf(|) EOC |, "| |");
+ v(SAf(|) EOC SBa(|), "| |");
+ v(SAf(|) EOC SBb(|), "| |");
+ v(SAf(|) EOC SBc(|), "| |");
+ v(SAf(|) EOC SBd(|), "| |");
+ v(SAf(|) EOC SBe(|), "| |");
+ v(SAf(|) EOC SBf(|), "| |");
+ v(SAf(|) EFA() |, "| |");
+ v(SAf(|) EFA() SBa(|), "| |");
+ v(SAf(|) EFA() SBb(|), "| |");
+ v(SAf(|) EFA() SBc(|), "| |");
+ v(SAf(|) EFA() SBd(|), "| |");
+ v(SAf(|) EFA() SBe(|), "| |");
+ v(SAf(|) EFA() SBf(|), "| |");
+ v(SAf(|) EFB() |, "| |");
+ v(SAf(|) EFB() SBa(|), "| |");
+ v(SAf(|) EFB() SBb(|), "| |");
+ v(SAf(|) EFB() SBc(|), "| |");
+ v(SAf(|) EFB() SBd(|), "| |");
+ v(SAf(|) EFB() SBe(|), "| |");
+ v(SAf(|) EFB() SBf(|), "| |");
+ v(SAf(|) EFC() |, "| |");
+ v(SAf(|) EFC() SBa(|), "| |");
+ v(SAf(|) EFC() SBb(|), "| |");
+ v(SAf(|) EFC() SBc(|), "| |");
+ v(SAf(|) EFC() SBd(|), "| |");
+ v(SAf(|) EFC() SBe(|), "| |");
+ v(SAf(|) EFC() SBf(|), "| |");
+}
+
+int
+main (void)
+{
+ check0 ();
+ check1 ();
+ check2 ();
+ check3 ();
+ check4 ();
+ check5 ();
+ check6 ();
+ check7 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strp1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strp1.c
new file mode 100644
index 000000000..096d968c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strp1.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+
+/* Regression test for stringizing and token pasting.
+ We got internal escape markers in the strings. */
+
+#include <string.h>
+#include <stdlib.h>
+
+#define S(x) _S(x)
+#define _S(x) #x
+
+#define I 1
+static const char s1[] = S(I.1);
+static const char t1[] = "1.1";
+
+#define f h
+#define h(a) a+f
+static const char s2[] = S( f(1)(2) );
+static const char t2[] = "1+h(2)";
+
+#undef I
+#undef f
+#undef h
+
+int
+main(void)
+{
+ if (strcmp (s1, t1))
+ abort ();
+
+ if (strcmp (s2, t2))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strp2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strp2.c
new file mode 100644
index 000000000..d1fcd9182
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/strp2.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+/* Test for odd corner cases in stringizing/pasting.
+ Taken more or less verbatim from C99 section 6.10.3.3. */
+
+#include <stdlib.h>
+#include <string.h>
+
+#define hash_hash # ## #
+#define mkstr(a) # a
+#define in_between(a) mkstr(a)
+#define join(c, d) in_between(c hash_hash d)
+
+const char p[] = join(x, y);
+const char q[] = "x ## y";
+
+int
+main (void)
+{
+ if (strcmp (p, q))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/subframework1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/subframework1.c
new file mode 100644
index 000000000..35d64d7fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/subframework1.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2004 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess { target *-*-darwin* } } */
+/* { dg-options "-Wno-deprecated -F$srcdir/gcc.dg/cpp/frame" } */
+
+/* Contributed by Robert Bowdidge <bowdidge@apple.com> */
+/* include a file from a subframework that will import two files that
+ both look at the same file. Make sure we only include that file once;
+ if so, the program will compile fine. If not, we'll get redefinition
+ errors */
+
+#include <one/one-includeSubs.h>
+#ifndef ONESUB_C_INCLUDED
+#error C.h not included
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr.c
new file mode 100644
index 000000000..310d5d0d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr.c
@@ -0,0 +1,13 @@
+/* Test for proper suppression of warnings in system headers,
+ and only in system headers. */
+/* FRAGILITY WARNING: The only way we have to distinguish the good error
+ from the bad error is that the good error is on line 4 and the bad is
+ on line 5 (of their respective files). dg.exp doesn't have any way to
+ condition error matchers on the file they're in. */
+
+/* { dg-do preprocess } */
+/* { dg-error "include_next" "good error" { target *-*-* } 4 } */
+
+#include "syshdr1.h"
+/* { dg-message "" "In file included from:" { target *-*-* } 0 } */
+#include "syshdr2.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr.h
new file mode 100644
index 000000000..3f546aa52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr.h
@@ -0,0 +1,10 @@
+/* Indented to avoid "suggest hiding ..." warnings. */
+ #pragma GCC system_header
+
+#define sys_uint 1U
+#define sys_str(x) x
+#define sys_foo(x, y...) bar (x, ##y)
+
+#define sys_uint 1U
+#define sys_fl 1.0f
+#define sys_ld 1.0L
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr1.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr1.h
new file mode 100644
index 000000000..310f39b5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr1.h
@@ -0,0 +1,4 @@
+/* This file should generate an error because #include_next is not a
+ standard directive. */
+
+#include_next <stdio.h>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr2.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr2.h
new file mode 100644
index 000000000..0140fdac1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr2.h
@@ -0,0 +1,5 @@
+/* This file would generate an error because of #include_next, but the
+ #pragma marks it a system header, so the error is suppressed. */
+
+#pragma GCC system_header
+#include_next <stdio.h>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr3.c
new file mode 100644
index 000000000..15749ff99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr3.c
@@ -0,0 +1,16 @@
+/* Contributed by Dodji Seketeli <dodji@redhat.com> */
+/* Origin: PR preprocessor/7263 */
+/* { dg-options "-pedantic -std=c89 -ftrack-macro-expansion=1" } */
+/* { dg-do compile } */
+
+/* This tests the proprer suppression of warning coming from macro
+ defined in system headers and expanded in a non-system header
+ location. */
+#include "syshdr3.h"
+
+static _Complex float c = _Complex_I + _Complex_I; /* These macros are defined in
+ system header so we should
+ have no warning here. */
+U_LL u = ONE_ULL; /* Likewise here. */
+
+unsigned long long v = 1ULL; /* { dg-warning "long long" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr3.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr3.h
new file mode 100644
index 000000000..e5d502a24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/syshdr3.h
@@ -0,0 +1,7 @@
+#pragma GCC system_header
+
+#define _Complex __complex__
+#define _Complex_I 1.0iF
+
+#define U_LL unsigned long long
+#define ONE_ULL 1ULL
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/sysmac1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/sysmac1.c
new file mode 100644
index 000000000..cc8469e18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/sysmac1.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99 -pedantic -Wtraditional -ftrack-macro-expansion=0" } */
+
+/* Tests diagnostics are suppressed for some macros defined in system
+ headers. */
+
+/* Source: Neil Booth, 15 Jan 2001. */
+
+#include "syshdr.h"
+
+#define uint 1U
+#define str(x) x
+#define foo(x, y...) bar(x, ##y) /* { dg-warning "named variadic macros" } */
+
+#if uint /* { dg-warning "traditional C rejects" } */
+#endif
+#if sys_uint /* { dg-bogus "traditional C rejects" } */
+#endif
+
+(str); /* { dg-warning "used with arguments" } */
+(sys_str); /* { dg-bogus "used with arguments" } */
+
+foo (one_arg); /* { dg-warning "requires rest arguments" } */
+sys_foo (one_arg); /* { dg-bogus "requires rest arguments" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/sysmac2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/sysmac2.c
new file mode 100644
index 000000000..cdba668a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/sysmac2.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic -Wtraditional -ftrack-macro-expansion=0" } */
+
+/* Tests diagnostics are suppressed for some macros defined in system
+ headers. */
+
+/* Source: Neil Booth, 15 Jan 2001. */
+
+#include "syshdr.h"
+
+#define uint 1U
+#define fl 1.0f
+#define ld 1.0L
+
+int
+main ()
+{
+ int u1 = uint; /* { dg-warning "traditional C rejects" } */
+ int u2 = sys_uint; /* { dg-bogus "traditional C rejects" } */
+ float f1 = fl; /* { dg-warning "traditional C rejects" } */
+ float f2 = sys_fl; /* { dg-bogus "traditional C rejects" } */
+ long double ld1 = ld; /* { dg-warning "traditional C rejects" } */
+ long double l2 = sys_ld; /* { dg-bogus "traditional C rejects" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c
new file mode 100644
index 000000000..1dd827663
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-paste.c
@@ -0,0 +1,19 @@
+/* Test for proper comment elimination semantics from cpplib's -traditional.
+ This should compile and link with compiled with `gcc -traditional-cpp'.
+ Test case by Jason R. Thorpe <thorpej@zembu.com>. */
+
+/* { dg-do compile } */
+/* { dg-options "-traditional-cpp" } */
+
+extern int printf (const char *, ...);
+
+#define A(name) X/**/name
+
+#define B(name) \
+void A(Y/**/name)() { A(name)(); }
+
+void Xhello() { printf("hello world\n"); }
+
+B(hello)
+
+int main() { XYhello(); return (0); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn1.c
new file mode 100644
index 000000000..37b5efe5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn1.c
@@ -0,0 +1,39 @@
+/* Test for warnings about nontraditional directives. */
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic -Wtraditional" } */
+
+/* Block 1: K+R directives should have the # indented. */
+
+#define foo bar /* { dg-bogus "indented" "^#kandr" } */
+# define foo bar /* { dg-bogus "indented" "^# kandr" } */
+ #define foo bar /* { dg-warning "indented" "^ #kandr" } */
+ # define foo bar /* { dg-warning "indented" "^ # kandr" } */
+
+/* Block 2: C89 directives should not have the # indented. */
+
+#pragma whatever /* { dg-warning "indented" "^#c89" } */
+# pragma whatever /* { dg-warning "indented" "^# c89" } */
+ #pragma whatever /* { dg-bogus "indented" "^ #c89" } */
+ # pragma whatever /* { dg-bogus "indented" "^ # c89" } */
+
+/* Block 3: Extensions should not have the # indented,
+ _and_ they should get a -pedantic warning. */
+
+#assert foo(bar) /* { dg-warning "indented" "^#ext" } */
+# assert bar(baz) /* { dg-warning "indented" "^# ext" } */
+ #assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */
+ # assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */
+
+/* We warn of #elif regardless of whether we're skipping or not, and
+ do not warn about indentaion. */
+#if 0
+#if 1
+#elif 1 /* { dg-warning "#elif" "#elif skipping" } */
+#endif
+#elif 0 /* { dg-warning "#elif" "#elif not skipping" } */
+#endif
+
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 22 } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 23 } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 24 } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 25 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn2.c
new file mode 100644
index 000000000..85b624761
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn2.c
@@ -0,0 +1,18 @@
+/* K+R rejects use of function-like macros in non-function context.
+ ANSI C explicitly permits this (the macro is not expanded).
+
+ We should not warn about this during pre-expansion of arguments,
+ since traditional preprocessors don't do pre-expansion, and we get
+ the warning anyway during the re-scan pass if and only if it is
+ appropriate. */
+
+/* { dg-do preprocess } */
+/* { dg-options -Wtraditional } */
+
+#define f(x) x
+#define g(x) x / 2
+#define h(a, b) a(b)
+f(g) (3) /* { dg-bogus "must be used with arguments" } */
+f 2 /* { dg-warning "must be used with arguments" } */
+f(g) 3 /* { dg-warning "must be used with arguments" } */
+h(f, 3) /* { dg-bogus "must be used with arguments" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn3.c
new file mode 100644
index 000000000..33517188c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn3.c
@@ -0,0 +1,61 @@
+/* Test for warnings about nontraditional directives inside the unused
+ clauses of #if statements. Extensions do _not_ receive pedantic
+ warnings inside unused clauses because they are often hidden this
+ way on purpose. However they do still require indentation for K&R. */
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic -Wtraditional" } */
+
+#if 1
+
+/* Block 1: K+R directives should have the # indented to warn. */
+
+#define foo bar /* { dg-bogus "indented" "^#kandr" } */
+# define foo bar /* { dg-bogus "indented" "^# kandr" } */
+ #define foo bar /* { dg-warning "indented" "^ #kandr" } */
+ # define foo bar /* { dg-warning "indented" "^ # kandr" } */
+
+/* Block 2: C89 directives should not have the # indented to warn. */
+
+#pragma whatever /* { dg-warning "indented" "^#c89" } */
+# pragma whatever /* { dg-warning "indented" "^# c89" } */
+ #pragma whatever /* { dg-bogus "indented" "^ #c89" } */
+ # pragma whatever /* { dg-bogus "indented" "^ # c89" } */
+
+/* Block 3: Extensions should not have the # indented to warn, _and_
+ they should get a -pedantic warning. */
+
+#assert foo(bar) /* { dg-warning "indented" "^#ext" } */
+# assert bar(baz) /* { dg-warning "indented" "^# ext" } */
+ #assert baz(quux) /* { dg-bogus "indented" "^ #ext" } */
+ # assert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */
+
+#else
+
+/* Block 1: K+R directives should have the # indented to warn. */
+
+#undef foo bar /* { dg-bogus "indented" "^#kandr" } */
+# undef foo bar /* { dg-bogus "indented" "^# kandr" } */
+ #undef foo bar /* { dg-warning "indented" "^ #kandr" } */
+ # undef foo bar /* { dg-warning "indented" "^ # kandr" } */
+
+/* Block 2: C89 directives should not have the # indented to warn. */
+
+#error whatever /* { dg-warning "indented" "^#c89" } */
+# error whatever /* { dg-warning "indented" "^# c89" } */
+ #error whatever /* { dg-bogus "indented" "^ #c89" } */
+ # error whatever /* { dg-bogus "indented" "^ # c89" } */
+
+/* Block 3: Extensions should not have the # indented to warn, and
+ they should _not_ get a -pedantic warning. */
+
+#unassert foo(bar) /* { dg-warning "indented" "^#ext" } */
+# unassert bar(baz) /* { dg-warning "indented" "^# ext" } */
+ #unassert baz(quux) /* { dg-bogus "indented" "^ #ext" } */
+ # unassert quux(weeble) /* { dg-bogus "indented" "^ # ext" } */
+
+#endif
+
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 27 } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 28 } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 29 } */
+/* { dg-warning "GCC extension" "extension warning" { target *-*-* } 30 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn4.c
new file mode 100644
index 000000000..f5b5779bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn4.c
@@ -0,0 +1,26 @@
+/* Test for -Wtraditional warnings on integer constant suffixes.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do preprocess } */
+/* { dg-options "-Wtraditional" } */
+
+#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#endif
+#if 1u /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+#endif
+#if 1L
+#endif
+#if 1l
+#endif
+
+# 17 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+#if 1U
+#endif
+#if 1u
+#endif
+#if 1L
+#endif
+#if 1l
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn5.c
new file mode 100644
index 000000000..6867b88c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn5.c
@@ -0,0 +1,14 @@
+/* Test for -Wtraditional warnings on the unary plus operator.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do preprocess } */
+/* { dg-options "-Wtraditional" } */
+
+#if +1 /* { dg-warning "unary plus operator" "unary plus operator" } */
+#endif
+
+# 11 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+#if +1
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn6.c
new file mode 100644
index 000000000..d95409ef8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/tr-warn6.c
@@ -0,0 +1,27 @@
+/* Test for -Wtraditional warnings for stringification of macro args.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 9/8/2000. */
+/* { dg-do preprocess } */
+/* { dg-options "-Wtraditional" } */
+
+#define foo1(h) sdf "h3" fds "h" /* { dg-warning "macro argument \"h\" would be stringified" "traditional stringification" } */
+#define foo2(h2) sdf "h2" fds "h3" /* { dg-warning "macro argument \"h2\" would be stringified" "traditional stringification" } */
+#define foo3(h3) sdf "h2" fds "h3" /* { dg-warning "macro argument \"h3\" would be stringified" "traditional stringification" } */
+#define foo4(h) sdf 'h3' fds 'h' /* { dg-warning "macro argument \"h\" would be stringified" "traditional stringification" } */
+#define foo5(h2) sdf 'h2' fds 'h3' /* { dg-warning "macro argument \"h2\" would be stringified" "traditional stringification" } */
+#define foo6(h3) sdf 'h2' fds 'h3' /* { dg-warning "macro argument \"h3\" would be stringified" "traditional stringification" } */
+#define foo7(AA, hello, world, EEE) sdf "A B hello C,world,DhelloE F" fds EEE /* { dg-warning "macro argument \"hello\" would be stringified" "traditional stringification" } */
+
+/* Catch the second warning from the above line. */
+/* { dg-warning "macro argument \"world\" would be stringified" "traditional stringification second warning" { target *-*-* } 13 } */
+
+# 19 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+#define bar1(h) sdf "h3" fds "h"
+#define bar2(h2) sdf "h2" fds "h3"
+#define bar3(h3) sdf "h2" fds "h3"
+#define bar4(h) sdf 'h3' fds 'h'
+#define bar5(h2) sdf 'h2' fds 'h3'
+#define bar6(h3) sdf 'h2' fds 'h3'
+#define bar7(AA, hello, world, EEE) sdf "A B hello C,world,DhelloE F" fds EEE
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c
new file mode 100644
index 000000000..403d617f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/Wunused.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-Wunused-macros -traditional-cpp" } */
+
+/* Test everything related to -Wunused-macros.
+
+ Source: Neil Booth, 23 Jul 2002. */
+
+#include "Wunused.h"
+
+#define used1 /* { dg-bogus "used" } */
+#define used2 /* { dg-bogus "used" } */
+#define used3 /* { dg-bogus "used" } */
+#define used4 something /* { dg-bogus "used" } */
+
+#define unused5 /* { dg-warning "used" } */
+#define unused6 /* { dg-warning "used" } */
+#define unused7() /* { dg-warning "used" } */
+
+#if defined used1
+#endif
+#ifdef used2
+#endif
+#ifndef used3
+#endif
+used4
+
+unused7; /* This does not count as a use. */
+
+#if 0
+unused5 /* This does not count as a use. */
+#endif
+
+#undef unused5
+#define unused6
+unused6
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/Wunused.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/Wunused.h
new file mode 100644
index 000000000..8b54412bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/Wunused.h
@@ -0,0 +1 @@
+#define unused_but_ok
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/__STDC__.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/__STDC__.c
new file mode 100644
index 000000000..b25bcb9aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/__STDC__.c
@@ -0,0 +1,7 @@
+/* Test that __STDC__ is not defined. */
+
+/* { dg-do preprocess } */
+
+#if defined __STDC__
+# error __STDC__ defined /* { dg-bogus "__STDC__" "__STDC__ defined" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/argcount.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/argcount.c
new file mode 100644
index 000000000..208cd44b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/argcount.c
@@ -0,0 +1,21 @@
+/* Test that we correctly complain about an invalid number of macro
+ arguments. */
+
+/* { dg-do preprocess } */
+
+#define f(x) x
+#define g(x, y) x y
+#define h()
+
+f(); /* { dg-bogus "requires 1" "no arg is 1 empty arg" } */
+f( ); /* { dg-bogus "macro" "1 arg to 1 param macro" } */
+f(1,); /* { dg-error "passed 2" "2 args to 1 param macro" } */
+f(1,2); /* { dg-error "passed 2" "2 args to 1 param macro" } */
+h(); /* { dg-bogus "macro" "no arg to 1 param macro" } */
+h( ); /* { dg-error "passed 1" "1 arg to 0 param macro" } */
+h(1,2); /* { dg-error "passed 2" "2 args to 0 param macro" } */
+g(); /* { dg-error "requires 2" "0 args to 2 param macro" } */
+g( ); /* { dg-error "requires 2" "1 args to 2 param macro" } */
+g( ,2); /* { dg-bogus "requires 2" "2 args to 2 param macro" } */
+g(,); /* { dg-bogus "requires 2" "2 args to 2 param macro" } */
+g(1,2,3); /* { dg-error "passed 3" "3 args to 2 param macro" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assembler.S b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assembler.S
new file mode 100644
index 000000000..75bb62841
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assembler.S
@@ -0,0 +1,29 @@
+/* Regression test - in assembly language, # may have some significance
+ other than 'stringize macro argument' and therefore must be preserved
+ in the output, and should not be warned about. */
+
+/* { dg-do preprocess } */
+
+#ifndef FOO
+#1 /* Once caused a bogus unterminated #ifndef. */
+#endif
+
+#define foo() mov r0, #5 /* { dg-bogus "not followed" "spurious warning" } */
+
+entry:
+ foo()
+
+/* Check we don't EOF on an unknown directive. */
+#unknown directive
+#error a later diagnostic /* { dg-error "diagnostic" } */
+
+/*
+ { dg-final { if ![file exists 20000510-1.i] { return } } }
+ { dg-final { set tmp [grep 20000510-1.i # line] } }
+ { dg-final { if {[string length $tmp] > 0} \{ } }
+ { dg-final { pass "20000510-1.S: # preservation" } }
+ { dg-final { \} else \{ } }
+ { dg-final { fail "20000510-1.S: # preservation" } }
+ { dg-final { \} } }
+*/
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert1.c
new file mode 100644
index 000000000..d1446105c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert1.c
@@ -0,0 +1,46 @@
+/* Basic tests of the #assert preprocessor extension. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-deprecated" } */
+
+#define def unused expansion
+#define fail int fail
+
+#assert abc (def)
+#assert abc (ghi)
+#assert abc (jkl)
+#assert space ( s p a c e )
+
+/* Basic: */
+#if !#abc (def) || !#abc (ghi) || !#abc (jkl)
+fail
+#endif
+
+/* any answer for #abc */
+#if !#abc
+fail
+#endif
+
+/* internal whitespace is collapsed,
+ external whitespace is deleted */
+#if !#space (s p a c e) || !#space ( s p a c e ) || #space (space)
+fail
+#endif
+
+/* removing assertions */
+#unassert abc (jkl)
+#if !#abc || !#abc (def) || !#abc (ghi) || #abc (jkl)
+fail
+#endif
+
+#unassert abc
+#if #abc || #abc (def) || #abc (ghi) || #abc (jkl)
+fail
+#endif
+
+int gobble
+
+/* make sure it can succeed too.
+ also check space before open paren isn't significant */
+#if #space(s p a c e)
+;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert2.c
new file mode 100644
index 000000000..4aa0b9944
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert2.c
@@ -0,0 +1,24 @@
+/* Malformed assertion tests. */
+/* { dg-do preprocess } */
+/* { dg-options "-Wno-deprecated" } */
+
+#assert /* { dg-error "without predicate" "assert w/o predicate" } */
+#assert % /* { dg-error "an identifier" "assert punctuation" } */
+#assert 12 /* { dg-error "an identifier" "assert number" } */
+#assert abc /* { dg-error "missing" "assert w/o answer" } */
+
+#if # /* { dg-error "without predicate" "test w/o predicate" } */
+#endif
+
+#if #% /* { dg-error "an identifier" "test punctuation" } */
+#endif
+
+#if #12 /* { dg-error "an identifier" "test number" } */
+#endif
+
+#if #abc
+#error /* { dg-bogus "error" "test w/o answer" } */
+#endif
+
+#if #abc[def] /* { dg-error "not valid in" "bad syntax" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert3.c
new file mode 100644
index 000000000..9010ecebd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/assert3.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000, 2008 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-A abc=def -A abc\(ghi\) \"-Aabc = jkl\" -A abc=mno -A -abc=mno -Wno-deprecated" } */
+
+/* Test -A command line syntax. Source Neil Booth. 31 Oct 2000. */
+
+#if !#abc (def) || !#abc (ghi) || !#abc (jkl) || #abc(mno)
+#error Command line -A assertions
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/builtins.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/builtins.c
new file mode 100644
index 000000000..74798bbb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/builtins.c
@@ -0,0 +1,54 @@
+/* Test that builtin-macros are OK. */
+
+/* { dg-do run } */
+
+#include "builtins.h"
+
+void abort (void);
+char *strstr (const char *, const char *);
+int strcmp (const char *, const char *);
+
+#define LINE __LINE__
+
+#if __LINE__ != 13
+# error __LINE__ part 1 /* { dg-bogus "__LINE__" } */
+#endif
+
+#if \
+ __LINE__ != 18
+# error __LINE__ part 2 /* { dg-bogus "__LINE__" } */
+#endif
+
+#if LINE != 22
+# error __LINE__ part 3 /* { dg-bogus "__LINE__" } */
+#endif
+
+#if __INCLUDE_LEVEL != 0
+# error __INCLUDE_LEVEL__ /* { dg-bogus "__INCLUDE_LEVEL__" } */
+#endif
+
+#if !defined (__TIME__)
+# error __TIME__ /* { dg-bogus "__TIME__" } */
+#endif
+
+#if !defined (__DATE__)
+# error __DATE__ /* { dg-bogus "__DATE__" } */
+#endif
+
+
+int main ()
+{
+ /* level is defined in builtins.h. */
+ if (level != 1)
+ abort ();
+
+ if (!strstr (__FILE__, "builtins.c"))
+ abort ();
+
+ if (!strcmp (__BASE_FILE__, "builtins.c"))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-require-host-local "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/builtins.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/builtins.h
new file mode 100644
index 000000000..9f2b9a014
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/builtins.h
@@ -0,0 +1 @@
+int level = __INCLUDE_LEVEL__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-C.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-C.c
new file mode 100644
index 000000000..ff67ddbdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-C.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-C -traditional-cpp" } */
+
+/* Test -C doesn't fail with #define. #define is the tricky case,
+ being the only directive that remembers its comments.
+
+ -C treats comments as tokens in their own right, so e.g. comment at
+ the beginning of a directive turns it into a non-directive. */
+
+#define simple no comments
+
+#define/**/obj_like/**/(some)/**/thing/**/
+#define fun_like(/**/x/**/,/**/y/**/)/**/
+/**/#define not_a_macro
+
+#if !defined simple || !defined obj_like || !defined fun_like
+#error Missed some macros with -C
+#endif
+
+#ifdef not_a_macro
+#error not_a_macro is!
+#endif
+
+/* Check obj_like doesn't expect arguments, and fun_like does. */
+obj_like
+fun_like (foo, bar)
+
+/* Check OK to redefine fun_like without comments in the params. */
+#define fun_like(x, y)/**/
+
+/* Check comments in macros in directives are OK. */
+#define ZERO 0 /* A trailing comment. */
+
+#if ZERO
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-C2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-C2.c
new file mode 100644
index 000000000..96bd371a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-C2.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-C -traditional-cpp" } */
+
+/* Test that comments are actually written out
+
+ Neil Booth, 24 Jun 2002. */
+
+/* { dg-final { scan-file cmdlne-C2.i "dg-final" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-dD.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-dD.c
new file mode 100644
index 000000000..1e4c8c867
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-dD.c
@@ -0,0 +1,9 @@
+/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dD -traditional-cpp" } */
+
+/* Test -dD does not fail. */
+
+#define objlike obj like
+#define funlike(like) fun like
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-dM.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-dM.c
new file mode 100644
index 000000000..0fb5bd9dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/cmdlne-dM.c
@@ -0,0 +1,9 @@
+/* Copyright (C) 2000, 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-dM -traditional-cpp" } */
+
+/* Test -dM does not fail. */
+
+#define objlike obj like
+#define funlike(like) fun like
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment-2.c
new file mode 100644
index 000000000..8d54e3a0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment-2.c
@@ -0,0 +1,11 @@
+/* Test for warning of nested comments. */
+
+/* { dg-do preprocess } */
+
+/* { dg-options "-traditional-cpp -Wcomments" }
+
+/* /* */ /* { dg-warning "within comment" } */
+
+/*
+
+ /* { dg-warning "within comment" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c
new file mode 100644
index 000000000..e2710ad56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment-3.c
@@ -0,0 +1,6 @@
+/* Test we don't accept C++ comments. */
+
+/* { dg-do preprocess } */
+
+#if 0
+#endif // /* { dg-warning "extra tokens" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment.c
new file mode 100644
index 000000000..971a78a6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/comment.c
@@ -0,0 +1,5 @@
+/* Test for warning of unterminated comment. */
+
+/* { dg-do preprocess } */
+
+/* { dg-error "unterminated comment" }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/define.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/define.c
new file mode 100644
index 000000000..d83288df2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/define.c
@@ -0,0 +1,2 @@
+/* { dg-do preprocess } */
+/* { dg-options "-traditional-cpp -DDEFINE1DEFINE -DDEFINE2DEFIN=" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/defined.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/defined.c
new file mode 100644
index 000000000..5fa1d93b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/defined.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests tradcpp0 with defined. The defined operator in traditional C
+ works just the same as the defined operator in Standard C. */
+
+/* Source: Zack Weinberg, glibc, Neil Booth 11 Dec 2000. */
+
+#if defined REGPARMS
+#error REGPARMS should not be defined
+#endif
+
+#define REGPARMS 1
+#if !defined REGPARMS
+#error REGPARMS should be defined
+#endif
+
+#define defined /* { dg-error "defined" } */
+
+/* No diagnostics, though you could argue there should be. */
+#if defined defined
+#error defined is defined!
+#endif
+
+#define is_Z_defined defined Z
+
+#if defined Z
+#error Z is not defined
+#endif
+
+/* The behavior of "defined" when it comes from a macro expansion is
+ now documented. */
+#if is_Z_defined
+#error Macro expanding into defined operator test 1
+#endif
+
+#define Z
+
+#if !defined Z
+#error Z is defined
+#endif
+
+#if !is_Z_defined
+#error Macro expanding into defined operator test 2
+#endif
+
+#undef is_Z_defined
+#undef Z
+
+/* Do all the tests over again with the () form of defined. */
+
+/* No diagnostics, though you could argue there should be. */
+#if defined(defined)
+#error defined is defined!
+#endif
+
+#define is_Z_defined defined ( Z )
+
+#if defined(Z)
+#error Z is not defined
+#endif
+
+/* The behavior of "defined" when it comes from a macro expansion is
+ now documented. */
+#if is_Z_defined
+#error Macro expanding into defined operator test 1
+#endif
+
+#define Z
+
+#if !defined(Z)
+#error Z is defined
+#endif
+
+#if !is_Z_defined
+#error Macro expanding into defined operator test 2
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/directive.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/directive.c
new file mode 100644
index 000000000..ee7ebcab0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/directive.c
@@ -0,0 +1,23 @@
+/* Test for some basic aspects of -traditional directive processing. */
+
+/* { dg-do preprocess } */
+
+#define HASH #
+HASH
+
+/* There is a #error directive. */
+
+#error bad /* { dg-error "bad" } */
+
+/* Directives with their #s indented are not recognized. */
+ #if 0 /* { dg-bogus "unterminated" } */
+
+#wrong /* { dg-error "invalid" } */
+
+#define foo 2
+#define bar + 3
+#define foobar 6
+
+#if foo/**/bar != 5
+# error Comments in directive is a separator /* { dg-bogus "error" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/escaped-eof.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/escaped-eof.c
new file mode 100644
index 000000000..2c9c185b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/escaped-eof.c
@@ -0,0 +1,6 @@
+/* Test for warning of escaped EOF. */
+
+/* { dg-do preprocess } */
+
+/* { dg-warning "backslash-new" "escaped EOF warning" { target *-*-* } 6 } */
+\
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/escaped-nl.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/escaped-nl.c
new file mode 100644
index 000000000..be8cc53fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/escaped-nl.c
@@ -0,0 +1,10 @@
+/* Test escaped newlines at start of macro definition are properly
+ skipped (buglet in skip_whitespace () in cpptrad.c). */
+
+/* { dg-do preprocess } */
+
+#define NUM \
+100
+#if NUM != 100
+# error NUM not defined properly /* { dg-bogus "error" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-2.c
new file mode 100644
index 000000000..edcf2abf2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-2.c
@@ -0,0 +1,23 @@
+/* Test that nested commas and parentheses in macro arguments are
+ OK. */
+
+/* { dg-do preprocess } */
+
+#define f(x) x
+#define g(x, y) x y
+
+#if f((1)) != 1
+# error /* { dg-bogus "error" "nested parens 1" } */
+#endif
+
+#if f((1, 2)) != 2
+# error /* { dg-bogus "error" "nested comma 1" } */
+#endif
+
+#if g(, (1)) != 1
+# error /* { dg-bogus "error" "nested parens 2" } */
+#endif
+
+#if g((1, 2), + 3) != 5
+# error /* { dg-bogus "error" "nested comma 2" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c
new file mode 100644
index 000000000..5300afba7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-3.c
@@ -0,0 +1,12 @@
+/* Test that function-like macros are restricted to directives, and
+ that unterminated ones are warned about. */
+
+/* { dg-do preprocess } */
+
+#define f(x) x
+
+#if 2 f(/* { dg-error "unterminated" "unterminated macro in directive" } */
+)
+#endif
+
+f( /* { dg-error "unterminated" "unterminated macro" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-4.c
new file mode 100644
index 000000000..fcc65a8d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-4.c
@@ -0,0 +1,26 @@
+/* Test that undefined names evaluate to zero, that macros after a
+ funlike macro are expanded, and that if it is a '(' the funlike
+ macro is not treated as such. */
+
+/* { dg-do run } */
+
+extern void abort (void);
+
+#define f(x) x
+
+int main ()
+{
+#if f(1) == f /**/ (/**/1/**/)
+ int x;
+#endif
+
+ x = 0;
+ if (f
+ /**/ (
+ /**/ 0/**/
+ /**/)
+ )
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c
new file mode 100644
index 000000000..f60a6ea78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike-5.c
@@ -0,0 +1,10 @@
+/* Test function like macro. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* {do-do preprocess } */
+/* { dg-options "-traditional-cpp -E -dD" } */
+int __srget (char *);
+#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
+#define getc(fp) __sgetc(fp)
+#define getchar() getc(stdin)
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c
new file mode 100644
index 000000000..db550d53c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c
@@ -0,0 +1,25 @@
+/* Test that undefined names evaluate to zero, that macros after a
+ funlike macro are expanded, and that if it is a '(' the funlike
+ macro is not treated as such. */
+
+/* { dg-do preprocess } */
+
+#define f(x) x
+#define h != 0
+#define i
+#define paren (
+
+#if f != 0
+# error /* { dg-bogus "error" "undefined name" } */
+#endif
+
+#if f h
+# error /* { dg-bogus "error" "h not expanded" } */
+#endif
+
+#if f i
+# error /* { dg-bogus "error" "empty macro" } */
+#endif
+
+#if f paren 6) /* { dg-error "missing binary" "macro-expanded parenthesis" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/hash.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/hash.c
new file mode 100644
index 000000000..8108c89fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/hash.c
@@ -0,0 +1,14 @@
+/* Test for erroneously thinking comments are token-pastes.
+ From XFree86 4.0. */
+/* { dg-do preprocess } */
+
+#ifndef foo
+#define foo /**/
+#endif
+
+#ifndef foo
+#define foo /* as nothing */
+#endif
+
+/* { dg-bogus "(start|end) of macro" "paste at end" { target *-*-* } 7 } */
+/* { dg-bogus "(start|end) of macro" "comment at end" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/include.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/include.c
new file mode 100644
index 000000000..94d25f815
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/include.c
@@ -0,0 +1,12 @@
+/* Copyright (c) 2002 Free Software Foundation Inc. */
+
+/* Test that macros are not expanded in the <> quotes of #inlcude. */
+
+/* vxWorksCommon.h uses the "#" operator to construct the name of an
+ include file, thus making the file incompatible with -traditional-cpp.
+ Newlib uses ## when including stdlib.h as of 2007-09-07. */
+/* { dg-do preprocess { target { { ! vxworks_kernel } && { ! newlib } } } } */
+
+#define __STDC__ 1 /* Stop complaints about non-ISO compilers. */
+#define stdlib 1
+#include <stdlib.h> /* { dg-bogus "o such file or directory" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/literals-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/literals-1.c
new file mode 100644
index 000000000..15c8030fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/literals-1.c
@@ -0,0 +1,28 @@
+/* Test that (what looks like) comments are not recognized in literals
+ and that quotes within quotes do not confused the preprocessor. */
+
+/* { dg-do run } */
+
+extern void abort (void);
+
+int main ()
+{
+ const char *str1 = "/*";
+ const char *str2 = "'";
+
+ if (str1[0] != '/' || str1[1] != '*' || str1[2] != '\0')
+ abort ();
+
+ if (str2[0] != '\'' || str2[1] != '\0')
+ abort ();
+
+#if '"' != '\"'
+# error /* { dg-bogus "error" "double quote in charconst" } */
+#endif
+
+#if !'\''
+# error quote /* { dg-bogus "quote" "quote in charconst" } */
+#endif
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c
new file mode 100644
index 000000000..b471772f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/literals-2.c
@@ -0,0 +1,8 @@
+/* Test that unterminated quotes in CPP expressions are
+ recognized. */
+
+/* { dg-do preprocess } */
+/* { dg-warning "missing terminating" "bad charconst" { target *-*-* } 7 } */
+/* { dg-error "not valid" "bad charconst" { target *-*-* } 7 } */
+#if 'x
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom1.c
new file mode 100644
index 000000000..28602a51a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom1.c
@@ -0,0 +1,13 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC -traditional-cpp" } */
+
+/* This tests to make sure that comments are ignored between # and the
+ directive name when the -CC option is used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#/**/define def passed
+
+def
+
+/* { dg-final { scan-file maccom1.i "(^|\n)passed" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom2.c
new file mode 100644
index 000000000..068c357c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom2.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC -traditional-cpp" } */
+
+/* This tests to make sure that comments between the #define directive
+ and the macro identifier are ignored (i.e. treated like whitespace)
+ when the -CC option is used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define/**/def passed
+
+def
+
+/* { dg-final { scan-file maccom2.i "(^|\n)passed" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom3.c
new file mode 100644
index 000000000..a6eb3f854
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom3.c
@@ -0,0 +1,13 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC -traditional-cpp" } */
+
+/* This tests to make sure that comments in the definition of a macro
+ parameter list are ignored when the -CC option is used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define def(x /**/, y) passed
+
+def(x,y)
+
+/* { dg-final { scan-file maccom3.i "(^|\n)passed" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom4.c
new file mode 100644
index 000000000..eac52da0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom4.c
@@ -0,0 +1,17 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC -traditional-cpp" } */
+
+/* This tests to make sure the comment is saved in the macro and copied
+ to the output file when the macro is expanded when the -CC option is
+ used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define def /* passed */
+
+def
+
+/*
+ /* The + in the regexp prevents it from matching itself. */
+ { dg-final { scan-file maccom4.i "p+assed" } }
+*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom6.c
new file mode 100644
index 000000000..baf5e980d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/maccom6.c
@@ -0,0 +1,20 @@
+/* { dg-do preprocess } */
+/* { dg-options "-CC -traditional-cpp" } */
+
+/* This tests to make sure that expressions function properly
+ when used with macros containing comments and the -CC option
+ is being used.
+
+ Jason R. Thorpe, 6 Apr 2002 */
+
+#define ONE 1 /* one */
+#define TWO 2 /* two */
+#define THREE 3 /* three */
+
+#if (ONE + TWO) != THREE
+failed
+#else
+passed
+#endif
+
+/* { dg-final { scan-file maccom6.i "(^|\n)passed" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/macro.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/macro.c
new file mode 100644
index 000000000..164b4ecfe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/macro.c
@@ -0,0 +1,11 @@
+/* Test that varargs are rejected, and that we don't complain about
+ macro args in skipped blocks. */
+
+/* { dg-do preprocess } */
+
+#define f(x)
+#define g(x, y...) /* { dg-error "macro parameter list" } */
+
+#if 0
+#define f(a,b) /* { dg-bogus "passed 2 arguments" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/macroargs.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/macroargs.c
new file mode 100644
index 000000000..c5f91d9f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/macroargs.c
@@ -0,0 +1,43 @@
+/* Test that whitespace in arguments is preserved, and that each
+ newline in macro arguments become a space. */
+
+/* { dg-do run } */
+
+#define f(x, y) "x y"
+#define g(x) x
+
+extern void abort (void);
+
+void testquoting ()
+{
+ const char *str1 = f("a", "\"a\"");
+ const char *str2 = f( \t, " \t");
+
+ if (strcmp (str1, "\"a\" \"\\\"a\\\"\""))
+ abort ();
+ if (strcmp (str2, " \t \" \\t\""))
+ abort ();
+}
+
+int main ()
+{
+ const char *str1 = f( foo ,bar);
+ const char *str2 = f(
+foo
+,bar);
+
+ if (strcmp (str1, " foo bar"))
+ abort ();
+
+ if (strcmp (str1, str2))
+ abort ();
+
+ /* Verify that quoted state is preserved over a newline. */
+ if (strcmp (g /* { dg-bogus "unterminated 2" } */ ("1
+, 2"), "1 , 2"))
+ abort ();
+
+ testquoting ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1.c
new file mode 100644
index 000000000..4004d2183
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1.c
@@ -0,0 +1,36 @@
+/* Test "ignore redundant include" facility.
+
+ We must test with C comments, and null directives, outside
+ the guard conditional; also, we test guarding with #ifndef and #if
+ !defined. -H is used because cpp might confuse the issue by
+ optimizing out #line markers. This test only passes if each of the
+ headers is read exactly once.
+
+ The disgusting regexp in the dg-error line, when stuck into
+ dg.exp's compiler-output regexp, matches the correct -H output and
+ only the correct -H output. It has to be all on one line because
+ otherwise it will not be interpreted all in one unit. */
+
+/* { dg-do compile }
+ { dg-options "-H -traditional-cpp" }
+ { dg-message "mi1c\.h\n\[^\n\]*mi1nd\.h\n\[^\n\]*mi1ndp\.h\n\[^\n\]*mi1x\.h" "redundant include check" { target *-*-* } 0 } */
+
+#include "mi1c.h"
+#include "mi1c.h"
+#include "mi1c.h"
+
+#include "mi1nd.h"
+#include "mi1nd.h"
+
+#include "mi1ndp.h"
+#include "mi1ndp.h"
+
+#define MIX_H
+#include "mi1x.h"
+#include "mi1x.h"
+
+int
+main (void)
+{
+ return a + c + d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1c.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1c.h
new file mode 100644
index 000000000..2956286eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1c.h
@@ -0,0 +1,12 @@
+/* Redundant header include test with C comments at top. */
+# /* And a null directive at the top. */
+
+#ifndef CPP_MIC_H
+#define CPP_MIC_H
+
+int a;
+
+#endif
+
+# /* And at the end, too! */
+/* And at the end too! */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1nd.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1nd.h
new file mode 100644
index 000000000..c14c1a3c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1nd.h
@@ -0,0 +1,8 @@
+/* Redundant include check with #if !defined. */
+
+#if !defined CPP_MIND_H
+#define CPP_MIND_H
+
+int c;
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1ndp.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1ndp.h
new file mode 100644
index 000000000..b84202c6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1ndp.h
@@ -0,0 +1,7 @@
+#if !defined ( CPP_MINDP_H)
+#define CPP_MINDP_H
+
+/* Redundant include check with #if !defined and parentheses. */
+int d;
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1x.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1x.h
new file mode 100644
index 000000000..a317cf852
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi1x.h
@@ -0,0 +1,9 @@
+/* This header is never to have its contents visible, but it should
+ still receive the optimization. */
+
+#ifndef MIX_H
+#define MIX_H
+
+#define main wibble
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2.c
new file mode 100644
index 000000000..916d5a949
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2.c
@@ -0,0 +1,12 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+/* { dg-do compile } */
+
+#include "mi2a.h"
+#include "mi2b.h"
+
+int main (void)
+{
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2a.h
new file mode 100644
index 000000000..e3f53b6cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2a.h
@@ -0,0 +1,5 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+
+#include "mi2c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2b.h
new file mode 100644
index 000000000..1d9a8b9b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2b.h
@@ -0,0 +1,6 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+
+#define need_x
+#include "mi2c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2c.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2c.h
new file mode 100644
index 000000000..521792bee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi2c.h
@@ -0,0 +1,15 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+#ifdef need_x
+#undef need_x
+#ifndef have_x
+#define have_x
+extern int x;
+#endif
+#endif
+
+#ifndef t_h
+#define t_h
+extern int y;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.c
new file mode 100644
index 000000000..f33fd7887
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.c
@@ -0,0 +1,20 @@
+/* Another test case for over-eager multiple include optimization.
+ This one distilled from glibc's setlocale.c and categories.def. */
+/* { dg-do compile } */
+
+#define X a
+#include "mi3.def"
+#undef X
+
+#define X b
+#include "mi3.def"
+#undef X
+
+#include "mi3.h"
+#include "mi3.h" /* The second include declares variable c. */
+
+int
+main(void)
+{
+ return a + b + c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.def b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.def
new file mode 100644
index 000000000..375d9c7fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.def
@@ -0,0 +1,10 @@
+/* Another test case for over-eager multiple include optimization.
+ This one distilled from glibc's setlocale.c and categories.def.
+ The #ifdef block doesn't cover the entire file, so it must not be
+ taken for a reinclude guard. */
+
+#ifndef NO_POSTLOAD
+#define NO_POSTLOAD NULL
+#endif
+
+int X;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.h
new file mode 100644
index 000000000..8774fcf48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi3.h
@@ -0,0 +1,7 @@
+/* Another test case for over-eager multiple include optimization. */
+
+#ifndef GUARD
+#define GUARD
+#elif 1 /* #elif kills optimisation */
+int c;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi4.c
new file mode 100644
index 000000000..c886cc2c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi4.c
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Undefining a macro guard and re-including the file used to confuse
+ file caching in cppfiles.c, and attempt to open a bad fd. */
+
+#include "mi1c.h"
+#undef CPP_MIC_H
+#include "mi1c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi5.c
new file mode 100644
index 000000000..ece38b5a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi5.c
@@ -0,0 +1,13 @@
+/* Test "ignore redundant include" facility, with -C on.
+
+ The disgusting regexp in the dg-error line, when stuck into
+ dg.exp's compiler-output regexp, matches the correct -H output and
+ only the correct -H output. It has to be all on one line because
+ otherwise it will not be interpreted all in one unit. */
+
+/* { dg-do preprocess }
+ { dg-options "-H -C -traditional-cpp" }
+ { dg-message "mi1c\.h" "redundant include check with -C" { target *-*-* } 0 } */
+
+#include "mi1c.h"
+#include "mi1c.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6.c
new file mode 100644
index 000000000..c3af2d3f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6.c
@@ -0,0 +1,61 @@
+/* Another test case for over-eager multiple include optimization,
+ where the leading "#if !defined" expression is obtained partially,
+ or wholly, from macros. Neil Booth, 30 Sep 2001. */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern void abort (void);
+
+/* Each include file should not be subject to MI optimisation, since
+ macro definitions can change. Each header increments the variable
+ VAR if it is defined.
+
+ The first set of inclusions gets the headers into CPP's cache, but
+ does nothing since VAR is not defined. The second set should each
+ increment VAR, since none of the initial set should have been
+ flagged as optimizable. */
+
+#define EMPTYL
+#define EMPTYR
+#define NOT !
+#define DEFINED defined (guard)
+#define NOT_DEFINED ! defined (guard)
+
+#include "mi6a.h"
+#include "mi6b.h"
+#include "mi6c.h"
+#include "mi6d.h"
+#include "mi6e.h"
+
+/* Define the macro guard, and redefine the macros to something that
+ forces compilation of the conditional blocks. */
+#define guard
+#undef EMPTYL
+#define EMPTYL 1 ||
+#undef EMPTYR
+#define EMPTYR || 1
+#undef NOT
+#define NOT
+#undef DEFINED
+#define DEFINED 0
+#undef NOT_DEFINED
+#define NOT_DEFINED 1
+
+#define VAR five
+
+int
+main(void)
+{
+ unsigned int five = 0;
+
+#include "mi6a.h"
+#include "mi6b.h"
+#include "mi6c.h"
+#include "mi6d.h"
+#include "mi6e.h"
+
+ if (five != 5)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6a.h
new file mode 100644
index 000000000..68a2fce47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6a.h
@@ -0,0 +1,5 @@
+#if NOT_DEFINED
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6b.h
new file mode 100644
index 000000000..d2fe8be17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6b.h
@@ -0,0 +1,5 @@
+#if NOT defined (guard)
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6c.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6c.h
new file mode 100644
index 000000000..d19cb5433
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6c.h
@@ -0,0 +1,5 @@
+#if !DEFINED
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6d.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6d.h
new file mode 100644
index 000000000..a1eabba8e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6d.h
@@ -0,0 +1,5 @@
+#if EMPTYL !defined (guard)
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6e.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6e.h
new file mode 100644
index 000000000..26ba71514
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi6e.h
@@ -0,0 +1,5 @@
+#if !defined (guard) EMPTYR
+ #ifdef VAR
+ VAR++;
+ #endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7.c
new file mode 100644
index 000000000..d980586f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7.c
@@ -0,0 +1,19 @@
+/* Test "ignore redundant include" facility.
+
+ -H is used because cpp might confuse the issue by optimizing out
+ #line markers. This test only passes if the headers is read
+ twice.
+
+ The disgusting regexp in the dg-error line, when stuck into
+ dg.exp's compiler-output regexp, matches the correct -H output and
+ only the correct -H output. It has to be all on one line because
+ otherwise it will not be interpreted all in one unit. */
+
+/* { dg-do preprocess }
+ { dg-options "-H -traditional-cpp" }
+ { dg-message "mi7a\.h\n\[^\n\]*mi7a\.h\n\[^\n\]*mi7b\.h\n\[^\n\]*mi7b\.h" "redundant include check" { target *-*-* } 0 } */
+
+#include "mi7a.h"
+#include "mi7a.h"
+#include "mi7b.h"
+#include "mi7b.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7a.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7a.h
new file mode 100644
index 000000000..0c701d7e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7a.h
@@ -0,0 +1,4 @@
+:
+#ifndef GUARD1
+#define GUARD1
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7b.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7b.h
new file mode 100644
index 000000000..1747e5482
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/mi7b.h
@@ -0,0 +1,4 @@
+#ifndef GUARD2
+#define GUARD2
+#endif
+:
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/null-drctv.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/null-drctv.c
new file mode 100644
index 000000000..99fd251f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/null-drctv.c
@@ -0,0 +1,6 @@
+/* Test that the null directive doesn't swallow the following line. */
+
+/* { dg-do preprocess } */
+
+#
+#error OK /* { dg-error "OK" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/num-sign.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/num-sign.c
new file mode 100644
index 000000000..64f12c072
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/num-sign.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+/* Tests that traditional numbers are signed, unless otherwise
+ specified. This test assumes a 32 bit target.
+
+ Neil Booth, 5 Aug 2001. Inspired by PR 3824. */
+
+#if 0xffffffffffffffff >= 0
+# error 0xffffffffffffffff /* { dg-bogus "0xffffffffffffffff" "0xffffffffffffffff positive" } */
+#endif
+
+#if 0xffffffffffffffffU <= 0
+# error 0xffffffffffffffffU /* { dg-bogus "0xffffffffffffffffU" "0xffffffffffffffffU negative" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/paste.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/paste.c
new file mode 100644
index 000000000..9b83fd30f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/paste.c
@@ -0,0 +1,18 @@
+/* Test for proper comment elimination semantics from cpplib's -traditional.
+ This should compile and link with compiled with `gcc -traditional-cpp'.
+ Test case by Jason R. Thorpe <thorpej@zembu.com>. */
+
+/* { dg-do compile } */
+
+extern int printf (const char *, ...);
+
+#define A(name) X/**/name
+
+#define B(name) \
+void A(Y/**/name)() { A(name)(); }
+
+void Xhello() { printf("hello world\n"); }
+
+B(hello)
+
+int main() { XYhello(); return (0); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/quote.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/quote.c
new file mode 100644
index 000000000..f8e61700f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/quote.c
@@ -0,0 +1,6 @@
+/* Test that unterminated quotes are OK when only preprocessing. */
+
+/* { dg-do preprocess } */
+
+/* { dg-bogus "unterminated" } */ 'x
+/* { dg-bogus "unterminated" } */ "x
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c
new file mode 100644
index 000000000..b5fd7af7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-1.c
@@ -0,0 +1,10 @@
+/* Test for warning of and recovery from recursion in object-like
+ macros. */
+
+/* { dg-do preprocess } */
+
+#define foo foo
+foo /* { dg-error "detected recursion" } */
+
+#define bar a bar b
+bar /* { dg-error "detected recursion" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c
new file mode 100644
index 000000000..5c6550fae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c
@@ -0,0 +1,16 @@
+/* Test for warning of and recovery from recursion in function-like
+ macros. */
+
+/* { dg-do preprocess } */
+
+#define foo() foo()
+foo(); /* { dg-error "detected recursion" } */
+
+#define bar() bar baz() bar
+bar(); /* { dg-bogus "detected recursion" } */
+
+#define baz() foo()
+baz(); /* { dg-error "detected recursion" } */
+
+#define a(x) x(a)
+a(a); /* { dg-error "detected recursion" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-3.c
new file mode 100644
index 000000000..91485ae5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/recurse-3.c
@@ -0,0 +1,25 @@
+/* Tests that macros that look recursive but are not are accepted. */
+
+/* { dg-do preprocess } */
+
+#define g(x) x
+g(g(g(g(g(g(g)))))); /* { dg-bogus "detected recursion" } */
+
+/* This macro gets longer with each loop, to thwart tests for
+ recursion based on length. */
+#define f(a,b,c,d,e,f,g,h,i) a(b,c,d,e,f,g,h,i,2 3 4 5)
+f(f,f,f,f,f,f,f,f,f) /* { dg-bogus "detected recursion" } */
+
+/* The above cases should be enough, but this is taken from cccp
+ sources so let's try it too. */
+#define foo(x,y) bar (x (y,0), y)
+foo (foo, baz); /* { dg-bogus "detected recursion" } */
+
+#define mac mac/**/ro
+mac /* { dg-bogus "detected recursion" } */
+
+#define mac2 mac2
+"mac2" /* { dg-bogus "detected recursion" } */
+
+#define macro "macro
+macro mac2 /* { dg-bogus "detected recursion" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/redef1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/redef1.c
new file mode 100644
index 000000000..ce5dde0bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/redef1.c
@@ -0,0 +1,36 @@
+/* Test for redefining traditional macros with insignificant
+ (i.e. whitespace) differences. */
+
+/* { dg-do preprocess } */
+
+
+#define foo bar
+#define /* x */ foo /* x */ bar /* x */
+
+#define quux(thud) a one and a thud and a two
+#define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two
+#define quux(thud) a one and a thud and a two /* bah */
+
+#define f(x, y)x "x y z" y
+#define f(x, y) x "x y z" y
+
+#define baz() whiz bang
+#define baz() whiz bang
+
+#define g foo
+#undef g
+#define g
+
+/* { dg-bogus "redefined" "foo redefined" { target *-*-* } 8 } */
+/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 11 } */
+/* { dg-bogus "redefined" "quux redefined" { target *-*-* } 12 } */
+/* { dg-bogus "redefined" "f redefined" { target *-*-* } 15 } */
+/* { dg-bogus "redefined" "baz redefined" { target *-*-* } 18 } */
+/* { dg-bogus "redefined" "g redefined" { target *-*-* } 22 } */
+
+/* { dg-bogus "previous def" "foo prev def" { target *-*-* } 7 } */
+/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 10 } */
+/* { dg-bogus "previous def" "quux prev def" { target *-*-* } 11 } */
+/* { dg-bogus "previous def" "f prev def" { target *-*-* } 14 } */
+/* { dg-bogus "previous def" "baz prev def" { target *-*-* } 17 } */
+/* { dg-bogus "previous def" "g prev def" { target *-*-* } 20 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/redef2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/redef2.c
new file mode 100644
index 000000000..5fcd5eb32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/redef2.c
@@ -0,0 +1,32 @@
+/* Test for redefining traditional macros with significant differences. */
+
+/* { dg-do preprocess } */
+
+#define foo bar /* { dg-message "previous def" "foo prev def" } */
+#define foo barr /* { dg-warning "redefined" "foo redefined" } */
+
+#undef foo
+#define foo bar /* { dg-message "previous def" "foo prev def 2" } */
+#define foo() bar /* { dg-warning "redefined" "foo redefined 2" } */
+
+#undef foo
+#define foo() bar /* { dg-message "previous def" "foo prev def" } */
+#define foo() barr /* { dg-warning "redefined" "foo redefined" } */
+
+#define quux(thud) a thud b /* { dg-message "previous def" "quux prev def" } */
+#define quux(thu) a thud b /* { dg-warning "redefined" "quux redefined" } */
+
+#define bar(x, y) x+y /* { dg-message "previous def" "bar prev def" } */
+#define bar(x, y) x+x /* { dg-warning "redefined" "bar redefined" } */
+
+#define bat(x, y) x+y /* { dg-message "previous def" "bat prev def" } */
+#define bat(x, y) x+ y /* { dg-warning "redefined" "bat redefined" } */
+
+#define baz(x, y) x+y /* { dg-message "previous def" "baz prev def" } */
+#define baz(x, y) x +y /* { dg-warning "redefined" "baz redefined" } */
+
+#define f(x, y) "x y" /* { dg-message "previous def" "f prev def" } */
+#define f(x, y) "x y" /* { dg-warning "redefined" "f redefined" } */
+
+#define g(x, y) 'x' /* { dg-message "previous def" "g prev def" } */
+#define g(x, y) ' x' /* { dg-warning "redefined" "g redefined" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/strify.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/strify.c
new file mode 100644
index 000000000..d97a43970
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/strify.c
@@ -0,0 +1,18 @@
+/* Test whether traditional stringify works. */
+/* { dg-do run } */
+
+#define foo(a, b) c="a"; d="b";
+
+extern void abort ();
+extern void exit (int);
+
+int main ()
+{
+ char *c, *d;
+
+ foo (p,q);
+ if (c[0] != 'p' || d[0] != 'q')
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/trad.exp b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/trad.exp
new file mode 100644
index 000000000..c00a17c9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/trad.exp
@@ -0,0 +1,43 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# There's a bunch of headers we need.
+if [is_remote host] {
+ foreach header [glob -nocomplain $srcdir/$subdir/*.{h,def} ] {
+ remote_download host $header
+ }
+}
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_TRADCPPFLAGS
+if ![info exists DEFAULT_TRADCPPFLAGS] then {
+ set DEFAULT_TRADCPPFLAGS " -traditional-cpp"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_TRADCPPFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/uchar.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/uchar.c
new file mode 100644
index 000000000..8ea54a1f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/uchar.c
@@ -0,0 +1,8 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-funsigned-char -fsigned-char -traditional-cpp" } */
+
+#if defined (__CHAR_UNSIGNED__)
+# error __CHAR_UNSIGNED__ defined
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/xwin1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/xwin1.c
new file mode 100644
index 000000000..21220d1db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/xwin1.c
@@ -0,0 +1,13 @@
+/* XWindows (as of 4.3) does some pretty strange things with cpp.
+ This tests one of them; the leading comments are supposed to be
+ eaten by the preprocessor; but the 'directives' after them are
+ supposed to be retained as text, not processed, so that imake's cpp
+ can be run on the output!
+ { dg-do preprocess }
+*/
+
+/**/#if 0
+passed
+/**/#endif
+
+/* { dg-final { scan-file xwin1.i "(^|\n)#if 0" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trigraphs.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trigraphs.c
new file mode 100644
index 000000000..3ec5ed721
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trigraphs.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-ansi" } */
+
+extern void abort (void);
+
+/* Basic tests for trigraph conversion.
+ All of them are here, but not in all possible contexts. *??/
+/
+
+??=include <stdio.h>
+
+??=define TWELVE 1??/
+2
+
+static const char str??(??) = "0123456789??/n";
+
+int
+main(void)
+??<
+ unsigned char x = 5;
+
+ if (sizeof str != TWELVE)
+ abort ();
+
+ /* Test ^=, the only multi-character token to come from trigraphs. */
+ x ??'= 3;
+ if (x != 6)
+ abort ();
+
+ if ((5 ??! 3) != 7)
+ abort ();
+
+ return 0;
+??>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/uchar-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/uchar-1.c
new file mode 100644
index 000000000..3483e3281
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/uchar-1.c
@@ -0,0 +1,8 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-funsigned-char -fsigned-char" } */
+
+#if defined (__CHAR_UNSIGNED__)
+# error __CHAR_UNSIGNED__ defined
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/uchar-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/uchar-3.c
new file mode 100644
index 000000000..41b987f5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/uchar-3.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-funsigned-char -fpreprocessed" } */
+
+/* Source: Ziemowit Laski. -fpreprocessed doesn't define macros, but
+ CPP would interpret charconsts based upon whether __CHAR_UNSIGNED__
+ was defined. */
+
+int foo()
+{
+ char f = 0x83;
+ if (f == '\x83') /* { dg-bogus "always false" } */
+ f = 0;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-1.c
new file mode 100644
index 000000000..3fad08831
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-1.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+void abort (void);
+
+#define \u00C0 1
+#define \u00C1 2
+#define \U000000C2 3
+#define wh\u00ff 4
+#define a\u00c4b\u0441\U000003b4e 5
+
+int main (void)
+{
+
+ if (\u00C0 != 1)
+ abort ();
+ if (\u00c1 != 2)
+ abort ();
+ if (\u00C2 != 3)
+ abort ();
+ if (wh\u00ff != 4)
+ abort ();
+ if (a\u00c4b\u0441\U000003b4e != 5)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-2.c
new file mode 100644
index 000000000..6719c783f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-2.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+#include <stdlib.h>
+#include <string.h>
+
+#define str(t) #t
+
+int main (void)
+{
+ const char s[] = str (\u30b2);
+
+ if (strcmp (s, "\u30b2") != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-3.c
new file mode 100644
index 000000000..6389b7ebf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+
+#define paste(x, y) x ## y
+
+int paste(\u00aa, \u0531) = 3;
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-4.c
new file mode 100644
index 000000000..6a6699b94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-4.c
@@ -0,0 +1,17 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+
+\u00AA
+\u00AB /* { dg-error "not valid in an identifier" } */
+\u00B6 /* { dg-error "not valid in an identifier" } */
+\u00BA
+\u00C0
+\u00D6
+\u0384
+
+\u0669 /* { dg-error "not valid at the start of an identifier" } */
+A\u0669
+0\u00BA
+0\u0669
+\u0E59 /* { dg-error "not valid at the start of an identifier" } */
+A\u0E59
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-5.c
new file mode 100644
index 000000000..cdccd3cdf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-5.c
@@ -0,0 +1,17 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -pedantic -fextended-identifiers" } */
+
+\u00AA
+\u00AB /* { dg-error "not valid in an identifier" } */
+\u00B6 /* { dg-error "not valid in an identifier" } */
+\u00BA
+\u00C0
+\u00D6
+\u0384 /* { dg-error "not valid in an identifier" } */
+
+\u0669 /* { dg-error "not valid at the start of an identifier" } */
+A\u0669
+0\u00BA
+0\u0669
+\u0E59 /* { dg-error "not valid at the start of an identifier" } */
+A\u0E59
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-6.c
new file mode 100644
index 000000000..9ee0858dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-6.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89" } */
+#define a b(
+#define b(x) q
+int a\u00aa);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-7.c
new file mode 100644
index 000000000..93404225d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-7.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+#define a b(
+#define b(x) q
+int a\U0000000z );
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-8.c
new file mode 100644
index 000000000..1f0379a5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-8.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+/* Test that -std=c99 does not enable extended identifiers while the
+ feature is experimental; remove this test after audit of all
+ identifier uses in the compiler. */
+#define a b(
+#define b(x) q
+int a\u00aa);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-9.c
new file mode 100644
index 000000000..8dc43458e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucnid-9.c
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -pedantic -fextended-identifiers" } */
+
+\u2160
+\u2182
+\u3007
+\u3021
+\u3029
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucs.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucs.c
new file mode 100644
index 000000000..3f3d97edf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/ucs.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+/* This tests universal character sequences.
+
+ Neil Booth, 22 May 2001.
+ Richard Henderson, 3 Apr 2002. */
+
+#include <limits.h>
+
+#define unsigned +0
+#define int +0
+#define char +1
+#define short +2
+#define long +3
+
+#if __WCHAR_TYPE__ == 0
+# define WCHAR_MAX INT_MAX
+#elif __WCHAR_TYPE__ == 1
+# define WCHAR_MAX CHAR_MAX
+#elif __WCHAR_TYPE__ == 2
+# define WCHAR_MAX SHRT_MAX
+#elif __WCHAR_TYPE__ == 3
+# define WCHAR_MAX LONG_MAX
+#else
+# error wacky wchar_t
+#endif
+
+#undef unsigned
+#undef int
+#undef char
+#undef short
+#undef long
+
+#if L'\u1234' != 0x1234
+#error bad short ucs /* { dg-bogus "bad" "bad u1234 evaluation" } */
+#endif
+
+#if WCHAR_MAX >= 0x7ffffff
+# if L'\U1234abcd' != 0x1234abcd
+# error bad long ucs /* { dg-bogus "bad" "bad U1234abcd evaluation" } */
+# endif
+#endif
+
+void foo ()
+{
+ int c;
+
+ c = L'\ubad'; /* { dg-error "incomplete" "incomplete UCN 1" } */
+ c = L"\U1234"[0]; /* { dg-error "incomplete" "incompete UCN 2" } */
+
+ c = L'\u000x'; /* { dg-error "incomplete" "non-hex digit in UCN" } */
+ /* If sizeof(HOST_WIDE_INT) > sizeof(wchar_t), we can get a multi-character
+ constant warning even for wide characters. */
+ /* { dg-warning "too long|multi-character" "" { target *-*-* } 54 } */
+
+ c = '\u0024'; /* { dg-bogus "invalid" "0024 is a valid UCN" } */
+ c = "\u0040"[0]; /* { dg-bogus "invalid" "0040 is a valid UCN" } */
+ c = L'\u00a0'; /* { dg-bogus "invalid" "00a0 is a valid UCN" } */
+ c = '\U00000060'; /* { dg-bogus "invalid" "0060 is a valid UCN" } */
+
+ c = '\u0025'; /* { dg-error "not a valid" "0025 invalid UCN" } */
+ c = L"\uD800"[0]; /* { dg-error "not a valid" "D800 invalid UCN" } */
+ c = L'\U0000DFFF'; /* { dg-error "not a valid" "DFFF invalid UCN" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc1.c
new file mode 100644
index 000000000..18c306fc8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc1.c
@@ -0,0 +1,14 @@
+/* Tests for un-terminated conditionals: 1. */
+/* { dg-do preprocess } */
+
+#if 1 /* { dg-error "unterminated" "unterminated #if" } */
+
+#ifdef notdef /* { dg-bogus "unterminated" "nested terminated #ifdef" } */
+
+blah blah blah
+
+#endif
+
+more text
+
+/* oops! */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc2.c
new file mode 100644
index 000000000..976d2b181
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc2.c
@@ -0,0 +1,12 @@
+/* Tests for unterminated conditionals: 2. */
+/* { dg-do preprocess } */
+
+#ifdef __sparc__ /* { dg-error "unterminated" "unterminated if-elif-elif..." } */
+sparc
+#elif defined __powerpc__
+ppc
+#elif defined __i386__
+i386
+#elif defined __vax__
+vax
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc3.c
new file mode 100644
index 000000000..d5f16f738
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc3.c
@@ -0,0 +1,5 @@
+/* Tests for unterminated conditionals: 3. */
+/* { dg-do preprocess } */
+
+#if 1 /* { dg-error "#else" "unterminated #else" } */
+#else
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc4.c
new file mode 100644
index 000000000..10c49e9d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/unc4.c
@@ -0,0 +1,39 @@
+/* { dg-do preprocess } */
+
+/* Tests for un-terminated conditional diagnostics.
+ Copyright (c) 1999 Free Software Foundation.
+ Contributed by Zack Weinberg, who made it up all by himself. */
+
+#endif /* { dg-error "#endif" "#endif without #if" } */
+
+#else /* { dg-error "#else" "#else without #if" } */
+#endif /* { dg-error "#endif" "#endif after #else without #if" } */
+
+#elif 0 /* { dg-error "#elif" "#elif without #if" } */
+#endif /* { dg-error "#endif" "#endif after #else without #if" } */
+
+#if 1 /* { dg-bogus "unterminated" "terminated true conditional" } */
+blah
+#endif
+
+#if 0 /* { dg-bogus "unterminated" "terminated false conditional" } */
+ignored
+#endif
+
+/* We shouldn't see unbalanced conditionals inside #if'ed out #includes. */
+#if 0
+#include "unc1.c"
+#endif
+
+/* The ifdef below should not get an error just because there's a bad if
+ inside the included file.
+ The odd dg-error tag on the include matches the "In file included from"
+ message. */
+#define FOO
+#ifdef FOO /* { dg-bogus "unterminated" "nested unterm" } */
+#include "unc1.c" /* { dg-message "file included from" "" { target *-*-* } 0 } */
+#endif
+
+/* dg.exp doesn't read the included files for tags, so we have to
+ do them explicitly here. */
+/* { dg-error "#if" "unc1.c: unterminated #if" { target *-*-* } 4 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/undef-opt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/undef-opt-1.c
new file mode 100644
index 000000000..99c524662
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/undef-opt-1.c
@@ -0,0 +1,8 @@
+/* Test -undef. A bug in its handling broke glibc builds because
+ "linux" was wrongly defined. */
+/* { dg-do preprocess } */
+/* { dg-options "-undef" } */
+
+#ifdef linux
+#error -undef broken
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/undef2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/undef2.c
new file mode 100644
index 000000000..5614e039b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/undef2.c
@@ -0,0 +1,23 @@
+/* C99 6.10.8 para 4: None of [the predefined macro names] shall be
+ the subject of a #define or an #undef preprocessing directive. */
+
+/* { dg-do preprocess } */
+
+#undef __DATE__ /* { dg-warning "undefining" "__DATE__" } */
+#undef __TIME__ /* { dg-warning "undefining" "__TIME__" } */
+#undef __FILE__ /* { dg-warning "undefining" "__FILE__" } */
+#undef __LINE__ /* { dg-warning "undefining" "__LINE__" } */
+#undef __STDC__ /* { dg-warning "undefining" "__STDC__" } */
+
+/* These should be protected from #undef, but aren't, because they
+ are set with normal #define commands - and on top of that, some
+ of them are library properties, outside our control. To consider:
+ warn about undefining/redefining any identifier beginning with
+ __STDC_ .
+
+ __STDC_HOSTED__
+ __STDC_VERSION__
+ __STDC_IEC_559__
+ __STDC_IEC_559_COMPLEX__
+ __STDC_ISO_10646__
+ */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h
new file mode 100644
index 000000000..c674e89f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h
@@ -0,0 +1,4 @@
+/* Used by gcc.dg/cpp/isysroot-1.c to test isysroot. */
+void foo()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/utf8-5byte-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/utf8-5byte-1.c
new file mode 100644
index 000000000..7f96a5684
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/utf8-5byte-1.c
@@ -0,0 +1,17 @@
+/* Test for bug in conversions from 5-byte UTF-8 sequences in
+ cpplib. */
+/* { dg-do run { target { 4byte_wchar_t } } } */
+/* { dg-options "-std=gnu99" } */
+
+extern void abort (void);
+extern void exit (int);
+
+__WCHAR_TYPE__ ws[] = L"û¿¿¿¿";
+
+int
+main (void)
+{
+ if (ws[0] != L'\U03FFFFFF' || ws[1] != 0)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg1.c
new file mode 100644
index 000000000..38bf56bd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg1.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options -w } */
+
+/* count() used to give 1 owing to a buggy test for varargs. */
+#define count(y...) count1 ( , ##y)
+#define count1(y...) count2 (y,1,0)
+#define count2(_,x0,n,y...) n
+#if count() != 0 || count(A) != 1
+#error Incorrect vararg argument counts
+#endif
+
+/* Test for changed behavior of the GNU varargs extension.
+ ##args, where args is a rest argument which received zero tokens,
+ used to delete the previous sequence of nonwhitespace characters.
+ Now it deletes the previous token. */
+
+#include <string.h>
+
+#define S(str, args...) " " str "\n", ##args
+
+int
+main()
+{
+ const char *s = S("foo");
+ return strchr (s, '\n') == NULL;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg2.c
new file mode 100644
index 000000000..2b2b0335c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg2.c
@@ -0,0 +1,131 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99" } */
+
+/* Jamie's varargs macros from hell. Not for the faint of heart.
+ Great tests that C99 and GNU varargs give identical results.
+ Adapted to the testsuite by Neil Booth, 1 Nov 2000. */
+
+/* Permission is granted to use, copy, modify and distribute this file
+ freely for any purpose whatsoever. This file is free software, and
+ there's no warranty.
+
+ -- Jamie Lokier <jamie.lokier@cern.ch>, 25/Sep/2000. */
+
+#define dup3(x) x,x,x
+
+/* Count elements in a list (0 to 10 max). */
+#define gnu_count(y...) _gnu_count1 ( , ##y)
+#define _gnu_count1(y...) _gnu_count2 (y,10,9,8,7,6,5,4,3,2,1,0)
+#define _gnu_count2(_,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,n,ys...) n
+
+/* Tail of a list. */
+#define gnu_tail(y...) _gnu_tail (y)
+#define _gnu_tail(x,y...) y
+
+/* Repeat N times. */
+#define gnu_repeat(n, x) gnu_tail (_gnu_repeat (n, x))
+#define _gnu_repeat(n, x) _gnu_repeat_##n (x)
+#define _gnu_repeat_0(x)
+#define _gnu_repeat_1(x) ,x
+#define _gnu_repeat_2(x) ,x,x
+#define _gnu_repeat_3(x) ,x,x,x
+#define _gnu_repeat_4(x) ,x,x,x,x
+#define _gnu_repeat_5(x) ,x,x,x,x,x
+
+#define _gnu_keep(xs...) xs
+#define _gnu_discard(xs...)
+#define _gnu_split_r(n,xs...) _gnu_split_rd (n,_gnu_keep,_gnu_discard xs)
+#define _gnu_split_d(n,xs...) _gnu_split_rd (n,_gnu_discard,_gnu_keep xs)
+#define _gnu_split_rd(n,xs...) _gnu_split_##n (xs)
+#define _gnu_split_0(a,b,xs...) a() b(xs)
+#define _gnu_split_1(a,b,x0,xs...) a(x0) b(xs)
+#define _gnu_split_2(a,b,x0,x1,xs...) a(x0,x1) b(xs)
+#define _gnu_split_3(a,b,x0,x1,x2,xs...) a(x0,x1,x2) b(xs)
+#define _gnu_split_4(a,b,x0,x1,x2,x3,xs...) a(x0,x1,x2,x3) b(xs)
+#define _gnu_split_5(a,b,x0,x1,x2,x3,x4,xs...) a(x0,x1,x2,x3,x4) b(xs)
+
+/* List manipulations. Surprise: index zero is the rightmost element. */
+#define gnu_take(n, xs...) \
+ _gnu_split_d (_gnu_count1 ( , ## xs), _gnu_repeat (n, _gnu_error) , ## xs)
+#define gnu_drop(n, xs...) \
+ _gnu_split_d (n,,_gnu_split_r (_gnu_count1 ( , ## xs), _gnu_repeat (n, _gnu_error) , ## xs))
+#define gnu_index(pos, xs...) gnu_take (1, gnu_drop (pos , ## xs))
+
+/* C99 __VA_ARGS__ versions */
+#define c99_count(...) _c99_count1 ( , ##__VA_ARGS__)/* If only ## worked.*/
+#define _c99_count1(...) _c99_count2 (__VA_ARGS__,10,9,8,7,6,5,4,3,2,1,0)
+#define _c99_count2(_,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,n,...) n
+
+#define c99_tail(...) _c99_tail (__VA_ARGS__)
+#define _c99_tail(x,...) __VA_ARGS__
+
+/* Repeat N times. */
+#define c99_repeat(n, x) c99_tail (_c99_repeat (n, x))
+#define _c99_repeat(n, x) _c99_repeat_##n (x)
+#define _c99_repeat_0(x)
+#define _c99_repeat_1(x) ,x
+#define _c99_repeat_2(x) ,x,x
+#define _c99_repeat_3(x) ,x,x,x
+#define _c99_repeat_4(x) ,x,x,x,x
+#define _c99_repeat_5(x) ,x,x,x,x,x
+
+#define _c99_keep(...) __VA_ARGS__
+#define _c99_discard(...)
+#define _c99_split_r(n,...) _c99_split_rd(n,_c99_keep,_c99_discard __VA_ARGS__)
+#define _c99_split_d(n,...) _c99_split_rd(n,_c99_discard,_c99_keep __VA_ARGS__)
+#define _c99_split_rd(n,...) _c99_split_##n (__VA_ARGS__)
+#define _c99_split_0(a,b,...) a() b(__VA_ARGS__)
+#define _c99_split_1(a,b,x0,...) a(x0) b(__VA_ARGS__)
+#define _c99_split_2(a,b,x0,x1,...) a(x0,x1) b(__VA_ARGS__)
+#define _c99_split_3(a,b,x0,x1,x2,...) a(x0,x1,x2) b(__VA_ARGS__)
+#define _c99_split_4(a,b,x0,x1,x2,x3,...) a(x0,x1,x2,x3) b(__VA_ARGS__)
+#define _c99_split_5(a,b,x0,x1,x2,x3,x4,...) a(x0,x1,x2,x3,x4) b(__VA_ARGS__)
+
+/* List manipulations. Surprise: index zero is the rightmost element. */
+#define c99_take(n, ...) \
+ _c99_split_d (_c99_count1 ( , ## __VA_ARGS__), _c99_repeat (n, _c99_error) , ## __VA_ARGS__)
+#define c99_drop(n, ...) \
+ _c99_split_d (n,,_c99_split_r (_c99_count1 ( , ## __VA_ARGS__), _c99_repeat (n, _c99_error) , ## __VA_ARGS__))
+#define c99_index(pos, ...) c99_take (1, c99_drop (pos , ## __VA_ARGS__))
+
+/************** Expansions **************/
+
+/* Correct answers are 0, 0, 1, 2, 10. */
+#if _gnu_count1 () != 0 || gnu_count () != 0 || gnu_count (A) != 1 \
+ || gnu_count (,) != 2 || gnu_count (A, B, C, D, E, F, G, H, I, J) != 10
+#error gnu_count
+#endif
+
+/* Correct answers are empty, 'x'. */
+#if gnu_repeat (0, 'x') gnu_repeat (1, 'x') != 'x'
+#error gnu_repeat
+#endif
+
+/* Correct answers are "e", "b", "a", empty. */
+#if gnu_index (0, 'a', 'b', 'c', 'd', 'e') != 'e' \
+ || gnu_index (3, 'a', 'b', 'c', 'd', 'e') != 'b' \
+ || gnu_index (4, 'a', 'b', 'c', 'd', 'e') != 'a' \
+ gnu_index (5, 'a', 'b', 'c', 'd', 'e')
+#error gnu_index
+#endif
+
+/************* C99 tests *************/
+
+/* The answers are 0, 0, 1, 2, 10 as for the non-C99 version. */
+#if _c99_count1 () != 0 || c99_count () != 0 || c99_count (A) != 1 \
+ || c99_count (,) != 2 || c99_count (A, B, C, D, E, F, G, H, I, J) != 10
+#error c99_count
+#endif
+
+/* Correct answers are empty, 'x'. */
+#if c99_repeat (0, 'x') c99_repeat (1, 'x') != 'x'
+#error c99_repeat
+#endif
+
+/* Correct answers are "e", "b", "a", empty. */
+#if c99_index (0, 'a', 'b', 'c', 'd', 'e') != 'e' \
+ || c99_index (3, 'a', 'b', 'c', 'd', 'e') != 'b' \
+ || c99_index (4, 'a', 'b', 'c', 'd', 'e') != 'a' \
+ c99_index (5, 'a', 'b', 'c', 'd', 'e')
+#error gnu_index
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg3.c
new file mode 100644
index 000000000..b17afd89e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg3.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99" } */
+
+/* Source: Neil Booth, 6 Aug 2002.
+
+ Tests that we DTRT with varargs commas for a single-parameter macro
+ when in standards-conforming mode. */
+
+#define f(...) , ## __VA_ARGS__
+
+/* The comma from f's expansion should be retained (standards
+ conforming mode only). Tests that it isn't in non-standards mode
+ include macro8.c and vararg1.c. */
+#if 2 f() 3 /* { dg-bogus "missing binary operator" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg4.c
new file mode 100644
index 000000000..460cebf28
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/vararg4.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options -std=gnu99 } */
+
+/* Source: Neil Booth, 6 Aug 2002.
+
+ Tests that we DTRT with varargs commas. */
+
+#define g(a, ...) a , ## __VA_ARGS__
+
+/* The comma from g's expansion should be retained. */
+#if g (2, ) 3 /* { dg-bogus "missing binary operator" } */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/very-long-comment.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/very-long-comment.c
new file mode 100644
index 000000000..88d8eb936
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/very-long-comment.c
@@ -0,0 +1,14 @@
+/*
+This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment. This is a really long comment.
+ */
+/* This testcase for PR 20907 is a bit finicky about the placement of
+ comment so avoid editing the text above here. */
+/* { dg-options "-Wall" } */
+/* { dg-do compile } */
+#warning test warning /* { dg-warning "test warning" } */
+#include <stdio.h>
+int main()
+{
+ printf("This is line %d\n", __LINE__);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments-2.c
new file mode 100644
index 000000000..492b99cb9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments-2.c
@@ -0,0 +1,7 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=comments" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+/* /* */ // { dg-error "\"\.\*\" within comment .-Werror=comment." }
+
+// \
+ // { dg-error "multi-line comment .-Werror=comment." "multi-line" { target *-*-* } 6 }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments-3.c
new file mode 100644
index 000000000..639fa1015
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments-3.c
@@ -0,0 +1,7 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=comment" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+/* /* */ // { dg-error "\"\.\*\" within comment .-Werror=comment." }
+
+// \
+ // { dg-error "multi-line comment .-Werror=comment." "multi-line" { target *-*-* } 6 }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments.c
new file mode 100644
index 000000000..1cdf75cf2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-comments.c
@@ -0,0 +1,7 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wcomments" }
+
+/* /* */ // { dg-warning "\"\.\*\" within comment .-Wcomment." }
+
+// \
+ // { dg-warning "multi-line comment .-Wcomment." "multi-line" { target *-*-* } 6 }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-cxx-compat-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-cxx-compat-2.c
new file mode 100644
index 000000000..69c4cfa0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-cxx-compat-2.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=c++-compat" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#define not ! // { dg-error "identifier \"not\" is a special operator name in C\\+\\+ .-Werror=c\\+\\+-compat." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-cxx-compat.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-cxx-compat.c
new file mode 100644
index 000000000..2e7b25932
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-cxx-compat.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wc++-compat" }
+
+#define not ! // { dg-warning "identifier \"not\" is a special operator name in C\\+\\+ .-Wc\\+\\+-compat." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-deprecated-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-deprecated-2.c
new file mode 100644
index 000000000..8bd608ab7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-deprecated-2.c
@@ -0,0 +1,7 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=deprecated" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#assert x(x) // { dg-error "#assert is a deprecated GCC extension .-Werror=deprecated." }
+
+#if #x(x) // { dg-error "assertions are a deprecated extension .-Werror=deprecated." }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-deprecated.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-deprecated.c
new file mode 100644
index 000000000..84214b1f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-deprecated.c
@@ -0,0 +1,7 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wdeprecated" }
+
+#assert x(x) // { dg-warning "#assert is a deprecated GCC extension .-Wdeprecated." }
+
+#if #x(x) // { dg-warning "assertions are a deprecated extension .-Wdeprecated." }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-long-long-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-long-long-2.c
new file mode 100644
index 000000000..7b074a37c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-long-long-2.c
@@ -0,0 +1,6 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wtraditional -Werror=long-long" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#if 0LL // { dg-error "traditional C rejects the \"LL\" suffix .-Werror=long-long." }
+ // { dg-error "use of C99 long long integer constant .-Werror=long-long." "use long long" { target *-*-* } 4 }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-long-long.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-long-long.c
new file mode 100644
index 000000000..e86f9a628
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-long-long.c
@@ -0,0 +1,6 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wtraditional -Wlong-long" }
+
+#if 0LL // { dg-warning "traditional C rejects the \"LL\" suffix .-Wlong-long." }
+ // { dg-warning "use of C99 long long integer constant .-Wlong-long." "use long long" { target *-*-* } 4 }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-multichar-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-multichar-2.c
new file mode 100644
index 000000000..5b5a0cc37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-multichar-2.c
@@ -0,0 +1,5 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=multichar" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#if 'ab' // { dg-error "multi-character character constant .-Werror=multichar." }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-multichar.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-multichar.c
new file mode 100644
index 000000000..9188a1586
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-multichar.c
@@ -0,0 +1,5 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wmultichar" }
+
+#if 'ab' // { dg-warning "multi-character character constant .-Wmultichar." }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-1.c
new file mode 100644
index 000000000..fe1c57530
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-1.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -fextended-identifiers -Wnormalized=nfc" }
+
+\u0F43 // { dg-warning "`.U00000f43' is not in NFC .-Wnormalized=." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-2.c
new file mode 100644
index 000000000..f1fb96833
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-2.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -fextended-identifiers -Wnormalized=nfkc" }
+
+\u00AA // { dg-warning "`.U000000aa' is not in NFKC .-Wnormalized=." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c
new file mode 100644
index 000000000..43ea76a0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-normalized-3.c
@@ -0,0 +1,5 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -fextended-identifiers -Werror=normalized=" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+ // { dg-prune-output ".*-Werror=normalized=: set -Wnormalized=nfc.*" }
+\u0F43 // { dg-error "`.U00000f43' is not in NFC .-Werror=normalized=." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c
new file mode 100644
index 000000000..e6b209c1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c
@@ -0,0 +1,18 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=builtin-macro-redefined" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#ifndef __TIME__
+#error "__TIME__ builtin is not defined"
+// { dg-bogus "__TIME__ builtin is not defined" "no-time" { target *-*-* } 5 }
+#endif
+
+#define __TIME__ "X" // { dg-error "\"__TIME__\" redefined .-Werror=builtin-macro-redefined." }
+
+#define __TIME__ "Y" // { dg-bogus "-Wbuiltin-macro-redefined" }
+ // { dg-warning "\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } 11 }
+ // { dg-message "previous definition" "previous-1" { target *-*-* } 9 }
+
+#define X "X"
+#define X "Y" // { dg-bogus "-Wbuiltin-macro-redefined" }
+ // { dg-warning "\"X\" redefined" "not-builtin-2" { target *-*-* } 16 }
+ // { dg-message "previous definition" "previous-2" { target *-*-* } 15 }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-redefined.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-redefined.c
new file mode 100644
index 000000000..1d3e7fc3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-redefined.c
@@ -0,0 +1,18 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wbuiltin-macro-redefined" }
+
+#ifndef __TIME__
+#error "__TIME__ builtin is not defined"
+// { dg-bogus "__TIME__ builtin is not defined" "no-time" { target *-*-* } 5 }
+#endif
+
+#define __TIME__ "X" // { dg-warning "\"__TIME__\" redefined .-Wbuiltin-macro-redefined." }
+
+#define __TIME__ "Y" // { dg-bogus "-Wbuiltin-macro-redefined" }
+ // { dg-warning "\"__TIME__\" redefined" "not-builtin-1" { target *-*-* } 11 }
+ // { dg-message "previous definition" "previous-1" { target *-*-* } 9 }
+
+#define X "X"
+#define X "Y" // { dg-bogus "-Wbuiltin-macro-redefined" }
+ // { dg-warning "\"X\" redefined" "not-builtin-2" { target *-*-* } 16 }
+ // { dg-message "previous definition" "previous-2" { target *-*-* } 15 }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-traditional-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-traditional-2.c
new file mode 100644
index 000000000..05477afef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-traditional-2.c
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=traditional -Wno-deprecated -Wno-long-long" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#assert x(x) // { dg-error "suggest hiding #assert from traditional C with an indented # .-Werror=traditional." }
+
+ #define X X // { dg-error "traditional C ignores #define with the # indented .-Werror=traditional." }
+
+#if 0
+#elif 1 // { dg-error "suggest not using #elif in traditional C .-Werror=traditional." }
+#endif
+
+#define f(X) X
+int f; // { dg-error "function-like macro \"f\" must be used with arguments in traditional C .-Werror=traditional." }
+
+#if 0U // { dg-error "traditional C rejects the \"U\" suffix .-Werror=traditional." }
+#endif
+
+#if +1 // { dg-error " traditional C rejects the unary plus operator .-Werror=traditional." }
+#endif
+
+char *x = "\x0"; // { dg-error "the meaning of '.x' is different in traditional C .-Werror=traditional." }
+char *y = "\a"; // { dg-error "the meaning of '.a' is different in traditional C .-Werror=traditional." }
+char *z = "\u0F43"; // { dg-error "the meaning of '.u' is different in traditional C .-Werror=traditional." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-traditional.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-traditional.c
new file mode 100644
index 000000000..f72f6db69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-traditional.c
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wtraditional -Wno-deprecated -Wno-long-long" }
+
+#assert x(x) // { dg-warning "suggest hiding #assert from traditional C with an indented # .-Wtraditional." }
+
+ #define X X // { dg-warning "traditional C ignores #define with the # indented .-Wtraditional." }
+
+#if 0
+#elif 1 // { dg-warning "suggest not using #elif in traditional C .-Wtraditional." }
+#endif
+
+#define f(X) X
+int f; // { dg-warning "function-like macro \"f\" must be used with arguments in traditional C .-Wtraditional." }
+
+#if 0U // { dg-warning "traditional C rejects the \"U\" suffix .-Wtraditional." }
+#endif
+
+#if +1 // { dg-warning " traditional C rejects the unary plus operator .-Wtraditional." }
+#endif
+
+char *x = "\x0"; // { dg-warning "the meaning of '.x' is different in traditional C .-Wtraditional." }
+char *y = "\a"; // { dg-warning "the meaning of '.a' is different in traditional C .-Wtraditional." }
+char *z = "\u0F43"; // { dg-warning "the meaning of '.u' is different in traditional C .-Wtraditional." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-1.c
new file mode 100644
index 000000000..4f3779df2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-1.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -trigraphs -Wtrigraphs" }
+
+??= // { dg-warning "trigraph \\?\\?= converted to # .-Wtrigraphs." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-2.c
new file mode 100644
index 000000000..ff87ae549
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-2.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wtrigraphs" }
+
+??= // { dg-warning "trigraph \\?\\?= ignored, use -trigraphs to enable .-Wtrigraphs." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-3.c
new file mode 100644
index 000000000..e7537c868
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-3.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -trigraphs -Werror=trigraphs" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+??= // { dg-error "trigraph \\?\\?= converted to # .-Werror=trigraphs." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-4.c
new file mode 100644
index 000000000..d8333d4c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-trigraphs-4.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=trigraphs" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+??= // { dg-error "trigraph \\?\\?= ignored, use -trigraphs to enable .-Werror=trigraphs." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-undef-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-undef-2.c
new file mode 100644
index 000000000..15fdde95c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-undef-2.c
@@ -0,0 +1,5 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=undef" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#if x // { dg-error "\"x\" is not defined .-Werror=undef." }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-undef.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-undef.c
new file mode 100644
index 000000000..dd4524d81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-undef.c
@@ -0,0 +1,5 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wundef" }
+
+#if x // { dg-warning "\"x\" is not defined .-Wundef." }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c
new file mode 100644
index 000000000..d7fe145c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-unused-macros-2.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Werror=unused-macros" }
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#define X X // { dg-error "macro \"X\" is not used .-Werror=unused-macros." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c
new file mode 100644
index 000000000..e1ce94eee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-unused-macros.c
@@ -0,0 +1,4 @@
+// { dg-do preprocess }
+// { dg-options "-std=gnu99 -fdiagnostics-show-option -Wunused-macros" }
+
+#define X X // { dg-warning "macro \"X\" is not used .-Wunused-macros." }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-variadic-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-variadic-2.c
new file mode 100644
index 000000000..1a266cd24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-variadic-2.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-ansi -fdiagnostics-show-option -pedantic -Werror=variadic-macros" } */
+/* { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#define F(...) X /* { dg-error "anonymous variadic macros were introduced in C99 .-Werror=variadic-macros." } */
+
+#define G(X...) X /* { dg-error "ISO C does not permit named variadic macros .-Werror=variadic-macros." } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-variadic.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-variadic.c
new file mode 100644
index 000000000..ba66c9018
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/warn-variadic.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-ansi -fdiagnostics-show-option -pedantic -Wvariadic-macros" } */
+
+#define F(...) X /* { dg-warning "anonymous variadic macros were introduced in C99 .-Wvariadic-macros." } */
+
+#define G(X...) X /* { dg-warning "ISO C does not permit named variadic macros .-Wvariadic-macros." } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/wchar-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/wchar-1.c
new file mode 100644
index 000000000..ac9b38b80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/wchar-1.c
@@ -0,0 +1,24 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "-w" } */
+
+/* Source: Neil Booth, 24 Feb 2002.
+
+ Test if compiler and preprocessor agree on signeness of wide
+ chars. */
+
+int main ()
+{
+ __WCHAR_TYPE__ c = -1;
+
+#if L'\x0' - 1 < 0
+ if (c > 0)
+ abort ();
+#else
+ if (c < 0)
+ abort ();
+#endif
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/widestr1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/widestr1.c
new file mode 100644
index 000000000..0b68201b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/widestr1.c
@@ -0,0 +1,9 @@
+/* Copyright (C) 2000, 2001 Free Software Foundation.
+
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do preprocess } */
+
+#line 1 L"foo" /* { dg-error "not a valid filename" "wide string in #line" } */
+#include L"stdio.h" /* { dg-error "expects" "wide string in #include" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c b/gcc-4.9/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c
new file mode 100644
index 000000000..fe143b9ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cproj-fails-with-broken-glibc.c
@@ -0,0 +1,25 @@
+/* Copyright (C) 2010 Free Software Foundation.
+
+ Check the runtime behavior of the C library's cproj() function and
+ whether it follows the standard. Versions of GLIBC through 2.11.1
+ had an incorrect implementation which will conflict with GCC's
+ builtin cproj(). GLIBC 2.12+ should be okay.
+
+ Origin: Kaveh R. Ghazi, April 20, 2010. */
+
+/* { dg-do run } */
+/* { dg-options "-fno-builtin-cproj" } */
+/* { dg-add-options c99_runtime } */
+/* { dg-require-effective-target c99_runtime } */
+
+extern void abort(void);
+extern void exit(int);
+double _Complex cproj(double _Complex);
+
+int main (void)
+{
+ if (cproj (2+3i) != 2+3i)
+ abort();
+
+ exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ctor1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ctor1.c
new file mode 100644
index 000000000..6c1cd72cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ctor1.c
@@ -0,0 +1,10 @@
+/* Related to PR c++/38410.
+ We shouldn't write out a static variable for an all-zero aggregate
+ initializer. The variable named C.0 was created by
+ gimplify_init_constructor. */
+/* { dg-final { scan-assembler-not "C\\.0" } } */
+
+int main()
+{
+ int a[] = { 0,0 };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-20040809-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-20040809-2.c
new file mode 100644
index 000000000..a38f75f26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-20040809-2.c
@@ -0,0 +1,15 @@
+/* Test dead code strip support. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-symbols" } */
+
+int
+main ()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler ".stabd.46,0,0" } } */
+/* { dg-final { scan-assembler ".stabd.78,0,0" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-20040812-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-20040812-1.c
new file mode 100644
index 000000000..4ae8657ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-20040812-1.c
@@ -0,0 +1,24 @@
+/* Test dead code strip support. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+
+const char my_version_string[] __attribute__((__used__))
+ = "Do not remove this string\n";
+
+ static int
+ __attribute__((__used__))
+ static_debug_routine()
+{
+ int i;
+ i = 42;
+}
+
+int
+main ()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler ".no_dead_strip _my_version_string" } } */
+/* { dg-final { scan-assembler ".no_dead_strip _static_debug_routine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-1.c
new file mode 100644
index 000000000..b9565e721
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-1.c
@@ -0,0 +1,28 @@
+/* Test whether the __builtin__CFStringMakeConstantString
+ "function" fails gracefully when handed a non-constant
+ argument. This will only work on MacOS X 10.1.2 and later. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-mconstant-cfstrings" } */
+
+typedef const struct __CFString *CFStringRef;
+
+#ifdef __CONSTANT_CFSTRINGS__
+#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString (STR))
+#else
+#error __CONSTANT_CFSTRINGS__ not defined
+#endif
+
+extern int cond;
+extern const char *func(void);
+
+const CFStringRef s0 = CFSTR("Hello" "there");
+
+int main(void) {
+ CFStringRef s1 = CFSTR("Str1");
+ CFStringRef s2 = CFSTR(cond? "Str2": "Str3"); /* { dg-error "CFString literal expression is not a string constant" } */
+ CFStringRef s3 = CFSTR(func()); /* { dg-error "CFString literal expression is not a string constant" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-2.c
new file mode 100644
index 000000000..1c724b25c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-2.c
@@ -0,0 +1,12 @@
+/* Test whether the __builtin__CFStringMakeConstantString
+ "function" fails gracefully when used without the
+ -mconstant-cfstrings flag. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-mno-constant-cfstrings" } */
+
+typedef const struct __CFString *CFStringRef;
+
+const CFStringRef S = ((CFStringRef)__builtin___CFStringMakeConstantString("Testing"));
+/* { dg-error "built-in" "built-in function .* requires .* flag" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-format-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-format-1.c
new file mode 100644
index 000000000..6eec43876
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-cfstring-format-1.c
@@ -0,0 +1,36 @@
+/* Check CFString format extensions. */
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-Wall" } */
+
+extern int printf (const char *fmt, ...);
+
+typedef const struct __CFString * CFStringRef;
+
+#ifdef __CONSTANT_CFSTRINGS__
+#define CFSTR(cStr) ((CFStringRef) __builtin___CFStringMakeConstantString ("" cStr ""))
+#else
+#error requires CFString
+#endif
+
+int s1 (CFStringRef fmt, ...) __attribute__((format(CFString, 1, 2))) ; /* OK */
+int s2 (int a, CFStringRef fmt, ... ) __attribute__((format(__CFString__, 2, 3))) ; /* OK */
+
+int s2a (int a, CFStringRef fmt, ... ) __attribute__((format(CFString, 2, 2))) ; /* { dg-error "format string argument follows the args to be formatted" } */
+
+int s3 (const char *fmt, ... ) __attribute__((format(__CFString__, 1, 2))) ; /* { dg-error "format argument should be a .CFString. reference but a string was found" } */
+int s4 (CFStringRef fmt, ... ) __attribute__((format(printf, 1, 2))) ; /* { dg-error "found a .CFStringRef. but the format argument should be a string" } */
+
+char *s5 (char dum, char *fmt1, ... ) __attribute__((format_arg(2))) ; /* OK */
+CFStringRef s6 (CFStringRef dum, CFStringRef fmt1, ... ) __attribute__((format_arg(2))) ; /* OK */
+
+char *s7 (int dum, void *fmt1, ... ) __attribute__((format_arg(2))) ; /* { dg-error "format string argument is not a string type" } */
+int s8 (CFStringRef dum, CFStringRef fmt1, ... ) __attribute__((format_arg(2))) ; /* { dg-error "function does not return string type" } */
+
+void foo (void)
+{
+ CFStringRef notchk = CFSTR ("here is an unchecked %d %s string");
+ s1 (notchk, 5, 6, 7);
+ printf("this one is checked %d %s", 3, 4, 5); /* { dg-warning "format .%s. expects argument of type .char .., but argument 3 has type .int." } */
+ /* { dg-warning "too many arguments for format" "" { target *-*-* } 33 } */
+ printf(s5 (1, "and so is this %d %d %s", 3, 4, "hey", 6), 5, 6, 12);/* { dg-warning "format .%s. expects argument of type .char .., but argument 4 has type .int." } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-comm.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-comm.c
new file mode 100644
index 000000000..a743fc6d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-comm.c
@@ -0,0 +1,4 @@
+/* { dg-do compile { target *-*-darwin[912]* } } */
+/* { dg-final { scan-assembler ".comm\[ \t\]_foo,1,15" } } */
+
+char foo __attribute__ ((aligned(32768)));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-1.c
new file mode 100644
index 000000000..60761577e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-1.c
@@ -0,0 +1,11 @@
+/* Test Darwin linker option -all_load. */
+/* Developed by Devang Patel <dpatel@apple.com>. */
+
+/* { dg-options "-all_load" } */
+/* { dg-do link { target *-*-darwin* } } */
+
+int main()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-2.c
new file mode 100644
index 000000000..5de19524f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-2.c
@@ -0,0 +1,11 @@
+/* Test Darwin linker option -bind_at_load. */
+/* Developed by Devang Patel <dpatel@apple.com>. */
+
+/* { dg-options "-bind_at_load" } */
+/* { dg-do link { target *-*-darwin* } } */
+
+int main()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040809-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040809-1.c
new file mode 100644
index 000000000..c54a4aa0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040809-1.c
@@ -0,0 +1,13 @@
+/* Test -dead_strip support. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-dead_strip" } */
+
+
+int
+main ()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040809-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040809-2.c
new file mode 100644
index 000000000..73d788db0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040809-2.c
@@ -0,0 +1,12 @@
+/* Test -no_dead_strip_inits_and_terms support. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-no_dead_strip_inits_and_terms" } */
+
+int
+main ()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c
new file mode 100644
index 000000000..b90328be9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-1.c
@@ -0,0 +1,13 @@
+/* Test -segaddr. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-segaddr __DATA 4000" } */
+
+
+int
+main ()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c
new file mode 100644
index 000000000..51f5ae830
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-2.c
@@ -0,0 +1,13 @@
+/* Test -segs_read_only_addr. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-segs_read_only_addr 4000 -dynamiclib" } */
+
+
+int
+main ()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c
new file mode 100644
index 000000000..ca8928bd8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-20040828-3.c
@@ -0,0 +1,13 @@
+/* Test -segs_read_write_addr. */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-segs_read_only_addr 4000 -segs_read_write_addr 8000 -dynamiclib" } */
+
+
+int
+main ()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-3.c
new file mode 100644
index 000000000..e3efacaba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-3.c
@@ -0,0 +1,12 @@
+
+/* Test Darwin linker option -arch_errors_fatal. */
+/* Developed by Devang Patel <dpatel@apple.com>. */
+
+/* { dg-options "-arch_errors_fatal" } */
+/* { dg-do link { target *-*-darwin* } } */
+
+int main()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-4.c
new file mode 100644
index 000000000..5cac36ccf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-4.c
@@ -0,0 +1,11 @@
+/* Test Darwin linker option -bundle. */
+/* Developed by Devang Patel <dpatel@apple.com>. */
+
+/* { dg-options "-bundle" } */
+/* { dg-do link { target *-*-darwin* } } */
+
+int main()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-5.c
new file mode 100644
index 000000000..0540f92bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-ld-5.c
@@ -0,0 +1,11 @@
+/* Test Darwin linker option -dynamic. */
+/* Developed by Devang Patel <dpatel@apple.com>. */
+
+/* { dg-options "-dynamic" } */
+/* { dg-do link { target *-*-darwin* } } */
+
+int main()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-1.c
new file mode 100644
index 000000000..d8a3243bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-1.c
@@ -0,0 +1,11 @@
+/* Basic test for -mmacosx-version-min switch on Darwin. */
+/* { dg-options "-mmacosx-version-min=10.1" } */
+/* { dg-do run { target *-*-darwin* } } */
+
+int main(void)
+{
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1010
+ fail me;
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-2.c
new file mode 100644
index 000000000..fd4975a52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-2.c
@@ -0,0 +1,11 @@
+/* Basic test for -mmacosx-version-min switch on Darwin. */
+/* { dg-options "-mmacosx-version-min=10.1 -mmacosx-version-min=10.3" } */
+/* { dg-do run { target *-*-darwin* } } */
+
+int main(void)
+{
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1030
+ fail me;
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-3.c
new file mode 100644
index 000000000..d0c5934b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-minversion-3.c
@@ -0,0 +1,11 @@
+/* Test that most-minor versions greater than 9 work. */
+/* { dg-options "-mmacosx-version-min=10.4.10" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+int main(void)
+{
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1040
+ fail me;
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-sections.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-sections.c
new file mode 100644
index 000000000..79d48bd7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-sections.c
@@ -0,0 +1,73 @@
+/* { dg-do compile {target *-*-darwin* } } */
+/* { dg-options "-std=c99 -w" } */
+
+/* This has been designed to give the same section usage for
+ -m32 and -m64 - so don't put any ints or longs in it ... */
+
+/* A zero-sized object. */
+typedef struct _empty {} e_s;
+
+/* These should go in .comm */
+char ub;
+e_s ea;
+/* { dg-final { scan-assembler ".comm\[\t \]_ub,1" } } */
+/* { dg-final { scan-assembler ".comm\[\t \]_ea,1" } } */
+
+/* These should go into .data */
+char a = 0;
+short b = 0;
+/* { dg-final { scan-assembler ".globl _a.*.data.*.space\[\t \]1" } } */
+/* { dg-final { scan-assembler ".globl _b.*.data.*.space\[\t \]2" } } */
+
+/* These should go into __pu_bssN */
+long long d = 0;
+float e = 0;
+double f = 0;
+long double g = 0.L;
+long long al_256 __attribute__((aligned (256))) = 0;
+/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss3,_d,8,3" } } */
+/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss2,_e,4,2" } } */
+/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss3,_f,8,3" } } */
+/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss4,_g,16,4" } } */
+/* { dg-final { scan-assembler ".zerofill __DATA,__pu_bss8,_al_256,8,8" } } */
+
+/* This should go into __zo_bss0 */
+static e_s sea;
+/* { dg-final { scan-assembler ".zerofill __DATA,__zo_bss0,_sea,1" } } */
+
+/* These should go into .static_data */
+static char sa ;
+static short sb ;
+/* { dg-final { scan-assembler ".static_data.*_sa:.*.space\[\t \]1" } } */
+/* { dg-final { scan-assembler ".static_data.*_sb:.*.space\[\t \]2" } } */
+
+/* These should go into _bssN */
+static long long sd;
+static float se ;
+static double sf ;
+static long double sg;
+static long long sal_256 __attribute__((aligned (2048)));
+/* { dg-final { scan-assembler ".zerofill __DATA,__bss3,_sd,8,3" } } */
+/* { dg-final { scan-assembler ".zerofill __DATA,__bss2,_se,4,2" } } */
+/* { dg-final { scan-assembler ".zerofill __DATA,__bss3,_sf,8,3" } } */
+/* { dg-final { scan-assembler ".zerofill __DATA,__bss4,_sg,16,4" } } */
+/* { dg-final { scan-assembler ".zerofill __DATA,__bss11,_sal_256,8,11" } } */
+
+long long foo (int x)
+{
+ e_s *s;
+ a += x + sa;
+ b += a + sb;
+ d += b + sd;
+ e += d + se;
+ f += e + sf;
+ g += f + sg;
+
+ s = &ea;
+ s = &sea;
+
+ b += al_256;
+ b += sal_256;
+
+ return (long long) sd + b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-segaddr.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-segaddr.c
new file mode 100644
index 000000000..526db77bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-segaddr.c
@@ -0,0 +1,19 @@
+/* Check that -segaddr gets through and works. */
+/* { dg-do run { target *-*-darwin* } } */
+/* { dg-options "-O0 -segaddr __TEST 0x200000 -fno-pie" { target { *-*-darwin* && { ! lp64 } } } } */
+/* { dg-options "-O0 -segaddr __TEST 0x110000000 -fno-pie" { target { *-*-darwin* && lp64 } } } */
+
+extern void abort ();
+
+int t __attribute__((section("__TEST,__test")));
+
+int main (void)
+{
+#ifdef __LP64__
+ if ((unsigned long long) &t != 0x110000000ULL)
+#else
+ if ((unsigned long) &t != 0x200000UL)
+#endif
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-version-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-version-1.c
new file mode 100644
index 000000000..11cfceff3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-version-1.c
@@ -0,0 +1,10 @@
+/* Basic test of the -mmacosx-version-min option. */
+
+/* { dg-options "-mmacosx-version-min=10.1" } */
+/* { dg-do link { target *-*-darwin* } } */
+
+int main()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-1.c
new file mode 100644
index 000000000..16b7024fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-require-weak "" } */
+/* { dg-options "-fno-common -fno-asynchronous-unwind-tables" } */
+
+/* { dg-final { scan-assembler "weak_reference _a" } } */
+/* { dg-final { scan-assembler-not "weak_\[a-z \t\]*_b" } } */
+
+extern void a (void) __attribute__((weak_import));
+extern void b (void) __attribute__((weak_import));
+
+void b(void)
+{
+ a();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-2.c
new file mode 100644
index 000000000..1c9817222
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-require-weak "" } */
+
+/* { dg-final { scan-assembler "weak_reference _foo" } } */
+
+extern int foo __attribute__((weak_import));
+
+int main(void)
+{
+ if (&foo)
+ return foo;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-3.c
new file mode 100644
index 000000000..77ab980b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakimport-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fno-asynchronous-unwind-tables" } */
+/* { dg-require-weak "" } */
+
+/* { dg-final { scan-assembler-not "coalesced" } } */
+
+extern void foo(void) __attribute__((weak_import));
+
+void foo(void)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakref-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakref-1.c
new file mode 100644
index 000000000..22a3cc079
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/darwin-weakref-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile { target *-*-darwin* } } */
+// { dg-require-weak "" }
+// { dg-options "-O2" }
+// { dg-options "-O2 -mmacosx-version-min=10.2" { target { powerpc-*-darwin* } } }
+/* { dg-final { scan-assembler "weak_reference _wv1" } } */
+/* { dg-final { scan-assembler "weak_reference _wf1" } } */
+/* { dg-final { scan-assembler-not "weak_reference _w.2" } } */
+
+
+typedef int vtype;
+
+extern vtype wv1;
+static vtype Wv1a __attribute__((weakref ("wv1")));
+vtype *pv1a = &Wv1a;
+
+extern vtype wv2;
+static vtype Wv2a __attribute__((weakref ("wv2")));
+vtype *pv2a = &wv2;
+
+typedef void ftype(void);
+
+extern ftype wf1;
+static ftype Wf1a __attribute__((weakref ("wf1")));
+ftype *pf1a = &Wf1a;
+
+extern ftype wf2;
+static ftype Wf2a __attribute__((weakref ("wf2")));
+ftype *pf2a = &wf2;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20000503-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20000503-1.c
new file mode 100644
index 000000000..27d3c55dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20000503-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+/* Distilled from GCC's stmt.c. Caused abort in dwarf-1 code. */
+
+static void
+expand_nl_goto_receiver ()
+{
+{
+static struct elims {int from, to;} elim_regs[] = {{ 16, 7}, { 16, 6}, { 20, 7},{ 20, 6}};
+ int i;
+
+ for (i = 0; i < sizeof elim_regs / sizeof elim_regs[0]; i++)
+ if (elim_regs[i].from == 16 && elim_regs[i].to == 6)
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20010207-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20010207-1.c
new file mode 100644
index 000000000..513d7a433
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20010207-1.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+extern inline int f1 (void) {return f2();}
+int f3 (void) {return f1();}
+int f1 (void) {return 0;}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20011223-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20011223-1.c
new file mode 100644
index 000000000..f8d70abce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20011223-1.c
@@ -0,0 +1,11 @@
+/* Origin: PR c/5163 from aj@suse.de. */
+/* { dg-do compile } */
+
+extern int bar (int);
+
+int
+foo (void)
+{
+ extern int bar (int);
+ return bar (5);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020104-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020104-2.c
new file mode 100644
index 000000000..854d17448
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020104-2.c
@@ -0,0 +1,9 @@
+/* This testcase used to fail because outlining_inline_function was called
+ too early, before rtl was generated. */
+/* { dg-do compile } */
+
+int foo (const int *x)
+{
+ char a[*x];
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020220-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020220-1.c
new file mode 100644
index 000000000..07109e86a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020220-1.c
@@ -0,0 +1,31 @@
+/* PR debug/4461
+ This testcase failed to link in Dwarf-2 because
+ constant -4.0 in constant pool was never referenced by anything
+ but Dwarf-2 location descriptor. */
+/* { dg-do run } */
+
+void __attribute__((noinline))
+foo (const char *x __attribute__((unused)),
+ __complex__ long double y __attribute__((unused)),
+ __complex__ long double z __attribute__((unused)))
+{
+}
+
+void
+bar (void)
+{
+ foo ("",
+ __builtin_conjl (({ __complex__ long double r;
+ __real__ r = 3.0;
+ __imag__ r = -4.0;
+ r; })),
+ ({ __complex__ long double s;
+ __real__ s = 3.0;
+ __imag__ s = 4.0;
+ s; }));
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020224-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020224-1.c
new file mode 100644
index 000000000..968b5655b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020224-1.c
@@ -0,0 +1,71 @@
+/* { dg-options "-g3 -O" } */
+/* { dg-do compile } */
+
+/* Here's the deal: f4 is inlined into main, f3 is inlined into f4, f2 is
+ inlined into f1. The DIE of main should contain DW_TAG_inlined_subroutines
+ children for f4, f3, f2 and f1. Also, there should be a DIE representing
+ and out of line instance of f4, aside the DIE representing its abstract
+ instance.
+ We used to fail to emit debugging info for t1, because it was moved
+ inside the (inlined) block of f1, marked as abstract, then we'd crash. */
+
+#define UNUSED __attribute__((unused))
+#define EXT __extension__
+
+int undef(void);
+
+inline static void
+f1 (int i UNUSED)
+{
+}
+
+inline static void
+f2 (void)
+{
+ f1 (EXT ({ int t1 UNUSED; undef (); }));
+}
+
+inline static void
+f3 (void)
+{
+ int v1 UNUSED;
+ int v2 UNUSED;
+
+ EXT ({ int t2 UNUSED; if (0) undef (); 0; })
+ && EXT ({ int t3 UNUSED; if (0) undef (); 0; });
+
+ if (1)
+ {
+ undef ();
+ if (1)
+ f2 ();
+ }
+
+ {
+ undef ();
+ }
+}
+
+inline static void
+f4 (void)
+{
+ EXT ({ undef (); 1; }) && EXT ({ int t4 UNUSED = ({ 1; }); 1; });
+
+ { }
+
+ EXT ({ int t5 UNUSED; if (0) undef (); 0; });
+
+ f4 ();
+
+ undef ();
+ f3 ();
+
+ return;
+}
+
+int
+main ()
+{
+ int foo = 1;
+ f4 ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020327-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020327-1.c
new file mode 100644
index 000000000..49d00a16c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20020327-1.c
@@ -0,0 +1,12 @@
+/* { dg-do link } */
+
+#ifndef __powerpc64__
+/* Fails on powerpc64-linux due to the function Letext using a global
+ .Letext symbol that conflicts with .Letext emitted by gcc with
+ -gstabs. Some day the linker will be fixed to not require global
+ "dot" syms, but for now disable this test entirely for powerpc64.
+ Using xfail doesn't work, nor does dg-excess-errors because some
+ combinations of command line options won't cause this test to fail. */
+void Letext (void) { }
+#endif
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20030605-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20030605-1.c
new file mode 100644
index 000000000..548faaf5a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20030605-1.c
@@ -0,0 +1,7 @@
+/* Verify we don't ICE on statement-expressions. */
+/* { dg-do compile } */
+
+void foo(void)
+{
+ char buf[({ 4; })];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20031231-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20031231-1.c
new file mode 100644
index 000000000..fa20260b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20031231-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+/* We used to fail because GCC didn't expect always inline to be inlined at
+ -O0. */
+typedef union tree_node *tree;
+typedef struct c_pretty_print_info c_pretty_printer;
+
+
+void pp_c_string_literal (c_pretty_printer *, tree);
+
+
+static __inline__ __attribute__((always_inline)) void
+pp_c_shift_expression (c_pretty_printer *pp, tree e)
+{
+}
+
+static void
+pp_c_relational_expression (c_pretty_printer *pp, tree e)
+{
+ pp_c_shift_expression (pp, e);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20041023-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20041023-1.c
new file mode 100644
index 000000000..12b7cb9a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20041023-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+static void
+foo (unsigned char x)
+{
+ unsigned char a[5 + x];
+}
+
+void
+bar (void)
+{
+ foo (80);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20041219-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20041219-1.c
new file mode 100644
index 000000000..6a62bb95b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20041219-1.c
@@ -0,0 +1,8 @@
+/* PR 18067 */
+/* { dg-do compile } */
+
+void foo(int i)
+{
+ const int j=i+1;
+ int a[1][j*j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/20050907-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20050907-1.c
new file mode 100644
index 000000000..0112ff7d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/20050907-1.c
@@ -0,0 +1,24 @@
+/* PR 23190 */
+/* Well, collateral damage from a proposed patch fixing 23190. We'd emit
+ debug info for multilib_exclusions_raw without emitting the variable
+ itself, leading to link errors. This reduced form is filed as PR 23777,
+ for not eliminating things soon enough. */
+/* { dg-do link } */
+
+static const char *const multilib_exclusions_raw[] = { 0 };
+
+void __attribute__((noinline)) f(char *const *p)
+{
+ __asm__ ("" : : "g"(p) : "memory");
+}
+
+void g (char **o)
+{
+ const char *const *q = multilib_exclusions_raw;
+
+ f (o);
+ while (*q++)
+ f (o);
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-1.c
new file mode 100644
index 000000000..bc526612f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-1.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+typedef float FloatVect __attribute__((__vector_size__(16)));
+static FloatVect Foo = { 250000000.0, 0.0, 0.0, 0.0 };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-2.c
new file mode 100644
index 000000000..7b9c24403
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-2.c
@@ -0,0 +1,2 @@
+/* { dg-do compile } */
+static __complex__ int x = 3.0;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-3.c
new file mode 100644
index 000000000..2e9db490c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/const-3.c
@@ -0,0 +1,7 @@
+/* Make sure we don't emit strings just because of debug information
+ for string initializers. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+/* { dg-final { scan-assembler-not "dontgenerate" } } */
+static const char *p = "dontgenerate1";
+static const char *q[2] = { 0, "dontgenerate2" };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/crash1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/crash1.c
new file mode 100644
index 000000000..259e259f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/crash1.c
@@ -0,0 +1,8 @@
+/* PR c/14492 */
+/* { dg-options "" } */
+
+int main() {
+ double d = 1.0;
+ char x[(int) d];
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-1.c
new file mode 100644
index 000000000..35b5c91b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-1.c
@@ -0,0 +1,34 @@
+/* Verify that the scheduler does not discard the lexical block. */
+/* { dg-do compile } */
+/* { dg-options "-dA" } */
+/* On MIPS targets that support conditional moves, the optimal
+ implementation of this function is:
+
+ l[wd] tmp,p
+ li $2,2
+ jr $31
+ movz $2,$0,tmp
+
+ After if-conversion, we have a conditional move into a pseudo P
+ followed a copy of P into the return register ($2). P is associated
+ with xyzzy, so if-conversion is behaving as expected, and has not lost
+ the variable association. The destination of the second instruction
+ is associated with the function return value. Combine then combines
+ these two instructions, removing the last use of P and xyzzy.
+
+ Everything is behaving as expected in this scenario, so we avoid
+ using conditional moves for this test. */
+/* { dg-options "-dA -fno-if-conversion" { target mips*-*-* } } */
+/* { dg-final { scan-assembler "xyzzy" } } */
+
+long p;
+
+long foo(void)
+{
+ {
+ long xyzzy = 0;
+ if (p)
+ xyzzy = 2;
+ return xyzzy;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-2.c
new file mode 100644
index 000000000..1e86f2fc7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-2.c
@@ -0,0 +1,24 @@
+/* Verify that the scheduler does not discard the lexical block. */
+/* { dg-do compile } */
+/* { dg-options "-dA" } */
+/* See the comment in debug-1.c. */
+/* { dg-options "-dA -fno-if-conversion" { target mips*-*-* } } */
+/* { dg-final { scan-assembler "xyzzy" } } */
+
+long p;
+
+long foo(void)
+{
+ if (1)
+ {
+ long xyzzy = 0;
+ if (p)
+ xyzzy = 2;
+ return xyzzy;
+ }
+ else
+ {
+ int x = 0;
+ return x;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-3.c
new file mode 100644
index 000000000..e2b7a4b18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-3.c
@@ -0,0 +1,35 @@
+/* This testcase failed, because scope containing baz was deleted
+ (spanned 0 basic blocks) and DWARF-2 couldn't find baz origin. */
+/* { dg-do compile } */
+/* { dg-require-effective-target trampolines } */
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar (struct A *x)
+{
+ return x->c - x->b;
+}
+
+void fnptr (void (*fn) (void));
+
+void
+foo (void)
+{
+ struct A e;
+
+ {
+ void baz (void)
+ {
+ bar (&e);
+ }
+ fnptr (baz);
+ }
+ {
+ struct A *f;
+
+ f = &e;
+ if (f->c - f->a > f->d - f->a)
+ f->c = f->d;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c
new file mode 100644
index 000000000..62e824a54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-4.c
@@ -0,0 +1,26 @@
+/* This testcase failed, because scope containing baz was not emitted
+ (doesn't contain any instructions) and DWARF-2 couldn't find baz origin. */
+/* { dg-do compile } */
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar (struct A *x)
+{
+ return x->c - x->b;
+}
+
+void
+foo (void)
+{
+ struct A e;
+
+ {
+ int baz (void)
+ {
+ return bar (&e);
+ }
+ }
+ if (e.c - e.a > e.d - e.a)
+ e.c = e.d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-5.c
new file mode 100644
index 000000000..f66b861c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-5.c
@@ -0,0 +1,47 @@
+/* This testcase failed, because scope containing baz was deleted
+ (spanned 0 basic blocks) and DWARF-2 couldn't find baz origin. */
+/* { dg-do compile } */
+/* { dg-require-effective-target trampolines } */
+
+extern void abort (void);
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar (struct A *x)
+{
+ return x->c - x->b;
+}
+
+static int
+bar2 (struct A *x)
+{
+ int a = x->c - x->b;
+ x->c += 26;
+ return a;
+}
+
+void fnptr (void (*fn) (void));
+
+void
+foo (void)
+{
+ struct A e;
+
+ if (bar2 (&e) < 0)
+ abort ();
+ {
+ void baz (void)
+ {
+ bar (&e);
+ }
+ fnptr (baz);
+ }
+ {
+ struct A *f;
+
+ f = &e;
+ if (f->c - f->a > f->d - f->a)
+ f->c = f->d;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-6.c
new file mode 100644
index 000000000..4fe680df0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-6.c
@@ -0,0 +1,38 @@
+/* Verify that bb-reorder re-inserts nested scopes properly. */
+/* { dg-do compile } */
+/* { dg-options "-dA" } */
+/* { dg-final { scan-assembler "xyzzy" } } */
+
+extern void abort (void);
+
+struct A { char *a, *b, *c, *d; };
+
+static int
+bar2 (struct A *x)
+{
+ int a = x->c - x->b;
+ x->c += 26;
+ return a;
+}
+
+void fnptr (int *);
+
+void
+foo (void)
+{
+ struct A e;
+
+ if (bar2 (&e) < 0)
+ abort ();
+ {
+ int xyzzy;
+ fnptr (&xyzzy);
+ }
+ {
+ struct A *f;
+
+ f = &e;
+ if (f->c - f->a > f->d - f->a)
+ f->c = f->d;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-7.c
new file mode 100644
index 000000000..d424e91f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug-7.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-dA" } */
+/* PR debug/12934. */
+
+static inline int foo ()
+{
+ return 42;
+}
+
+void bar (int *);
+
+void baz ()
+{
+ int a[foo ()];
+ bar (a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug.exp b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug.exp
new file mode 100644
index 000000000..e25d2d2b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/debug.exp
@@ -0,0 +1,31 @@
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+
+gcc-dg-debug-runtest gcc_target_compile trivial.c [list -O -O3] \
+ [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]]
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-1.c
new file mode 100644
index 000000000..4ca98e2f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+/* Copyright (C) 2000 Free Software Foundation */
+/* Contributed by Alexandre Oliva <aoliva@cygnus.com> */
+
+static int foo () { return 0; }
+
+void bar () {
+ int foo ();
+ int foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-2.c
new file mode 100644
index 000000000..0c3cee1a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+/* Copyright (C) 2000 Free Software Foundation */
+/* Contributed by Alexandre Oliva <aoliva@redhat.com> */
+
+inline double fx (double x)
+{
+ return 3 * x;
+}
+
+main ()
+{
+ double a = 0, fx (double), foo ();
+ fx (a);
+ if (a != 3)
+ foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-3.c
new file mode 100644
index 000000000..f0c129c60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-3.c
@@ -0,0 +1,13 @@
+/* Test -feliminate-dwarf2-dups */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-feliminate-dwarf2-dups" } */
+
+#include "dwarf2-3.h"
+
+int main()
+{
+ struct point p;
+ p.x = 0;
+ p.y = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-3.h b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-3.h
new file mode 100644
index 000000000..26ad0bace
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2-3.h
@@ -0,0 +1,9 @@
+/* Test -feliminate-dwarf2-dups */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+struct point
+{
+ int x;
+ int y;
+};
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c
new file mode 100644
index 000000000..4e40aea4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c
@@ -0,0 +1,15 @@
+/* Test that .debug_aranges and .debug_ranges do not have an entry for the
+ text section if nothing went in there. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-require-effective-target function_sections } */
+/* { dg-options "-gdwarf -ffunction-sections -w -dA" } */
+/* { dg-final { scan-assembler-not "\\.Letext0-\\.Ltext0" } } */
+/* { dg-final { scan-assembler-not "\\.Ltext0\[^\n\r\]*Offset 0x0" } } */
+/* { dg-final { scan-assembler "DW_AT_ranges" } } */
+
+int
+f (void)
+{
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c
new file mode 100644
index 000000000..3773e1c83
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/asm-line1.c
@@ -0,0 +1,20 @@
+/* PR debug/50983 */
+/* { dg-do compile { target *-*-gnu* } } */
+/* { dg-options "-O0 -gdwarf" } */
+/* { dg-final { scan-assembler "is_stmt 1" } } */
+
+int i;
+void f() __attribute ((section ("foo")));
+void f() { if (i) ++i; else --i; }
+
+void fun()
+{
+ return;
+}
+
+int main()
+{
+ f();
+ fun();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/c99-typedef1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/c99-typedef1.c
new file mode 100644
index 000000000..c1ca1ebb6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/c99-typedef1.c
@@ -0,0 +1,9 @@
+// { dg-options "-std=iso9899:1999 -gdwarf" }
+
+void f() {
+ int n = 3;
+ typedef int T[n++];
+
+ T t;
+ t[0] = 7;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/const-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/const-2.c
new file mode 100644
index 000000000..b139122fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/const-2.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target powerpc_altivec_ok } } */
+/* { dg-options "-O -gdwarf -dA -maltivec" } */
+/* { dg-final { scan-assembler "DW_AT_const_value" } } */
+
+typedef float FloatVect __attribute__((__vector_size__(16)));
+static FloatVect Foo = { 250000000.0, 0.0, 0.0, 0.0 };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c
new file mode 100644
index 000000000..e7d199d1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/const-2b.c
@@ -0,0 +1,7 @@
+/* { dg-do compile { target i386*-*-* } } */
+/* { dg-options "-O -gdwarf -dA -msse" } */
+/* { dg-require-effective-target sse } */
+/* { dg-final { scan-assembler "DW_AT_const_value" } } */
+
+typedef float FloatVect __attribute__((__vector_size__(16)));
+static FloatVect Foo = { 250000000.0, 0.0, 0.0, 0.0 };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c
new file mode 100644
index 000000000..b77f7b1bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c
@@ -0,0 +1,18 @@
+/* HAVE_AS_DWARF2_DEBUG_LINE macro needs to be defined to pass the unittest.
+ However, dg cannot access it, so we restrict to GNU targets. */
+/* { dg-do compile { target *-*-gnu* } } */
+/* { dg-options "-O0 -gdwarf" } */
+/* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])?\n" } } */
+/* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])? discriminator 2\n" } } */
+/* { dg-final { scan-assembler "loc \[0-9] 11 \[0-9]( is_stmt \[0-9])? discriminator 1\n" } } */
+
+int foo(int n) {
+ int i, ret = 0;
+ for (i = 0; i < n; i++) {
+ if (i % 10 == 1)
+ ret++;
+ else
+ ret--;
+ }
+ return ret;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c
new file mode 100644
index 000000000..d9c01d07d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c
@@ -0,0 +1,8 @@
+/* Test that these two options can work together. */
+/* { dg-options "-gdwarf-4 -dA -feliminate-dwarf2-dups -fdebug-types-section" } */
+/* { dg-final { scan-assembler "DW.dups_types\.h\[^)\]*. DW_TAG_typedef" } } */
+/* { dg-final { scan-assembler "DW_TAG_type_unit" } } */
+
+#include "dups-types.h"
+
+A2 a;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h
new file mode 100644
index 000000000..99b7d907c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h
@@ -0,0 +1,10 @@
+struct A
+{
+ int i;
+ int j;
+};
+
+typedef struct A A2;
+extern A2 a;
+
+A2 f(A2);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c
new file mode 100644
index 000000000..23f959673
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char1.c
@@ -0,0 +1,13 @@
+/* PR debug/7241 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA" } */
+/* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */
+/* { dg-final { scan-assembler "0x\[68\]\[ \t\]+\[#@;!/|\]+\[ \t\]+DW_AT_encoding" } } */
+/* { dg-final { scan-assembler-not "0x\[57\]\[ \t\]+\[#@;!/|\]+\[ \t\]+DW_AT_encoding" } } */
+
+char a;
+const char b;
+signed char c;
+volatile signed char d;
+unsigned char e;
+volatile const unsigned char f;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c
new file mode 100644
index 000000000..4a4bd438c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char2.c
@@ -0,0 +1,13 @@
+/* PR debug/7241 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA" } */
+/* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */
+/* { dg-final { scan-assembler "0x\[68\]\[ \t\]+\[#@;!/|\]+\[ \t\]+DW_AT_encoding" } } */
+/* { dg-final { scan-assembler-not "0x\[57\]\[ \t\]+\[#@;!/|\]+\[ \t\]+DW_AT_encoding" } } */
+
+const char a;
+char b;
+volatile signed char c;
+signed char d;
+const volatile unsigned char e;
+unsigned char f;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c
new file mode 100644
index 000000000..4ff201f13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-char3.c
@@ -0,0 +1,8 @@
+/* PR debug/7241 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA" } */
+/* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */
+/* { dg-final { scan-assembler "0x\[68\]\[ \t\]+\[#@;!/|\]+\[ \t\]+DW_AT_encoding" } } */
+/* { dg-final { scan-assembler-not "0x\[57\]\[ \t\]+\[#@;!/|\]+\[ \t\]+DW_AT_encoding" } } */
+
+const char *p = "abc";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c
new file mode 100644
index 000000000..951380f12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-dfp.c
@@ -0,0 +1,16 @@
+/* Verify the DWARF encoding of C99 decimal floating point types. */
+
+/* { dg-do compile */
+/* { dg-require-effective-target dfp } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+/* { dg-final { scan-assembler "0x10.*DW_AT_encoding" } } */
+/* { dg-final { scan-assembler "0x4.*DW_AT_byte_size" } } */
+/* { dg-final { scan-assembler "0x8.*DW_AT_byte_size" } } */
+/* { dg-final { scan-assembler "0x10.*DW_AT_byte_size" } } */
+
+void foo ()
+{
+ _Decimal32 f = 1.5df;
+ _Decimal64 d = 1.5dd;
+ _Decimal128 l = 1.5dl;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die1.c
new file mode 100644
index 000000000..9ca84e757
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die1.c
@@ -0,0 +1,8 @@
+/* Verify that inline function never actually inlined has no abstract DIE. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA" } */
+/* { dg-final { scan-assembler-not "DW_AT_inline" } } */
+inline int t()
+{
+}
+int (*q)()=t;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die2.c
new file mode 100644
index 000000000..746ab031b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die2.c
@@ -0,0 +1,7 @@
+/* Verify that inline function never actually emit has no DIE. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+/* { dg-final { scan-assembler-not "CIE Version" } } */
+static inline int t()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die3.c
new file mode 100644
index 000000000..2b071fc9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die3.c
@@ -0,0 +1,11 @@
+/* Verify that extern inline function never actually inlined has no abstract DIE. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+/* { dg-final { scan-assembler-not "DW_AT_inline" } } */
+extern inline int t()
+{
+}
+int (*q)()=t;
+int t()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die5.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die5.c
new file mode 100644
index 000000000..68985b71f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die5.c
@@ -0,0 +1,12 @@
+/* Inlined inline function must have abstract DIE */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA -fpreprocessed" } */
+/* { dg-final { scan-assembler "3.*DW_AT_inline" } } */
+#1 "test.h"
+inline int t()
+{
+}
+int q()
+{
+ t();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die6.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die6.c
new file mode 100644
index 000000000..ff0d6798d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die6.c
@@ -0,0 +1,12 @@
+/* not inline inline function must not have abstract DIE */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-inline -gdwarf -dA -fpreprocessed" } */
+/* { dg-final { scan-assembler-not "DW_AT_inline" } } */
+#1 "test.h"
+inline int t()
+{
+}
+int q()
+{
+ t();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die7.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die7.c
new file mode 100644
index 000000000..88d78e233
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-die7.c
@@ -0,0 +1,14 @@
+/* Inlined non-inline function must have abstract DIE */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA -fpreprocessed" } */
+/* { dg-final { scan-assembler "1.*DW_AT_inline" } } */
+#1 "test.h"
+void f(void);
+static int t()
+{
+ f();
+}
+int q()
+{
+ t();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-file1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-file1.c
new file mode 100644
index 000000000..b75395557
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-file1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA" } */
+/* { dg-final { scan-assembler "File Entry:|.file" } } */
+/* Verify that a file entry is output for this file. Only systems that
+ do not define HAVE_AS_DWARF2_DEBUG_LINE will put out "File Entry:",
+ but systems that do define HAVE_AS_DWARF2_DEBUG_LINE will put out a
+ ".file" so we check for either. */
+
+int bar = 3;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c
new file mode 100644
index 000000000..a028d1484
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-float.c
@@ -0,0 +1,15 @@
+/* Verify the DWARF encoding of C99 floating point types. */
+
+/* { dg-do compile */
+/* { dg-options "-O0 -gdwarf -dA" } */
+/* { dg-final { scan-assembler "0x4.*DW_AT_encoding" } } */
+/* { dg-final { scan-assembler "0x4.*DW_AT_byte_size" } } */
+/* { dg-final { scan-assembler "0x8.*DW_AT_byte_size" } } */
+/* { dg-final { scan-assembler "0x10.*DW_AT_byte_size" } } */
+
+void foo ()
+{
+ float f = 1.5f;
+ double d = 1.5;
+ long double l = 1.5l;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-merge.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-merge.c
new file mode 100644
index 000000000..15e09b116
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-merge.c
@@ -0,0 +1,10 @@
+/* Verify that mergeable strings are used in the CU DIE. */
+/* { dg-do compile } */
+/* { dg-require-effective-target string_merging } */
+/* { dg-options "-O2 -gdwarf -dA" } */
+/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C" } } */
+/* { dg-final { scan-assembler-not "GNU C\[^\\n\\r\]*DW_AT_producer" } } */
+
+void func (void)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-uninit.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-uninit.c
new file mode 100644
index 000000000..d871bab0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf-uninit.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA" } */
+/* { dg-final { scan-assembler "DW_TAG_variable" } } */
+/* PR debug/21828 */
+
+static int i;
+int main() {
+ i += 3;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro.c
new file mode 100644
index 000000000..fd61296b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro.c
@@ -0,0 +1,13 @@
+/* Test to make sure the mcaro info includes a start file command for the main source */
+/* { dg-do compile } */
+/* { dg-options "-g3 -gdwarf -dA -fverbose-asm" } */
+/* { dg-final { scan-assembler "Start new file" } } */
+
+#define ADD(x) (M + x)
+
+int main (void)
+{
+#define N 28
+#define M 42
+ return ADD(N);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c
new file mode 100644
index 000000000..3dfa2908e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-macro2.c
@@ -0,0 +1,7 @@
+/* Test to make sure the macro info includes the predefined macros with line number 0. */
+/* { dg-do compile } */
+/* { dg-options "-g3 -gdwarf -dA -fverbose-asm" } */
+/* { dg-final { scan-assembler "At line number 0" } } */
+
+#define FOO 1
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp
new file mode 100644
index 000000000..a8ba0f48e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp
@@ -0,0 +1,43 @@
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+set comp_output [gcc_target_compile \
+ "$srcdir/$subdir/../trivial.c" "trivial.S" assembly \
+ "additional_flags=-gdwarf"]
+if { ! [string match "*: target system does not support the * debug format*" \
+ $comp_output] } {
+ remove-build-file "trivial.S"
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\] $srcdir/c-c++-common/dwarf2/*.c]] \
+ "" $DEFAULT_CFLAGS
+}
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
new file mode 100644
index 000000000..810788ae6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
@@ -0,0 +1,84 @@
+// { dg-do compile }
+// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=any" }
+// { dg-final { scan-assembler "timespec.*DW_AT_name" } }
+// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
+// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
+// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } }
+// { dg-final { scan-assembler "it_interval.*DW_AT_name" } }
+// { dg-final { scan-assembler "it_value.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_var_head_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_var_head_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_var_head_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } }
+# 1 "fesd-any.c"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 1 "fesd-any.c"
+
+//#include "time.h"
+# 1 "time.h" 1 3 4
+struct timespec
+ {
+ long int tv_sec;
+ long int tv_nsec;
+ };
+
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+
+# 6 "fesd-any.c" 2
+
+struct timespec base_var8;
+struct itimerspec *base_var9;
+
+#include "fesd-any.h"
+
+struct gstruct_head_ordy_defn_var_base base_var1;
+struct gstruct_base_ordy_defn_var_base base_var2;
+
+int base_function() {
+ return 0
++ base_var1.field_head_ordy_defn_var_base
++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base
++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base
++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base
++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base
+;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.h b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.h
new file mode 100644
index 000000000..a7146b65e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.h
@@ -0,0 +1,19 @@
+#include "fesd.h"
+
+struct gstruct_base_ordy_decl_not;
+struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; };
+
+struct gstruct_base_ordy_decl_ref_base;
+struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; };
+struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; };
+struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; };
+struct gstruct_base_ordy_defn_var_base {
+ struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc;
+ struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref;
+ struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr;
+ struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld;
+ struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc;
+ struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref;
+ struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr;
+ struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
new file mode 100644
index 000000000..aefcb8715
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
@@ -0,0 +1,83 @@
+// { dg-do compile }
+// { dg-options "-gdwarf -dA -femit-struct-debug-baseonly" }
+// { dg-final { scan-assembler "timespec.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
+// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "it_interval.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "it_value.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } }
+# 1 "fesd-baseonly.c"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 1 "fesd-baseonly.c"
+
+//#include "time.h"
+# 1 "time.h" 1 3 4
+struct timespec
+ {
+ long int tv_sec;
+ long int tv_nsec;
+ };
+
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+
+# 6 "fesd-baseonly.c" 2
+
+struct timespec base_var8;
+struct itimerspec *base_var9;
+
+#include "fesd-baseonly.h"
+
+struct gstruct_head_ordy_defn_var_base base_var1;
+struct gstruct_base_ordy_defn_var_base base_var2;
+
+int base_function() {
+ return 0
++ base_var1.field_head_ordy_defn_var_base
++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base
++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base
++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base
++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base
+;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.h b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.h
new file mode 100644
index 000000000..a7146b65e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.h
@@ -0,0 +1,19 @@
+#include "fesd.h"
+
+struct gstruct_base_ordy_decl_not;
+struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; };
+
+struct gstruct_base_ordy_decl_ref_base;
+struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; };
+struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; };
+struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; };
+struct gstruct_base_ordy_defn_var_base {
+ struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc;
+ struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref;
+ struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr;
+ struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld;
+ struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc;
+ struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref;
+ struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr;
+ struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
new file mode 100644
index 000000000..193c05d61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
@@ -0,0 +1,84 @@
+// { dg-do compile }
+// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=none" }
+// { dg-final { scan-assembler "timespec.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
+// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "it_interval.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "it_value.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } }
+# 1 "fesd-none.c"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 1 "fesd-none.c"
+
+//#include "time.h"
+# 1 "time.h" 1 3 4
+struct timespec
+ {
+ long int tv_sec;
+ long int tv_nsec;
+ };
+
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+
+# 6 "fesd-none.c" 2
+
+struct timespec base_var8;
+struct itimerspec *base_var9;
+
+#include "fesd-none.h"
+
+struct gstruct_head_ordy_defn_var_base base_var1;
+struct gstruct_base_ordy_defn_var_base base_var2;
+
+int base_function() {
+ return 0
++ base_var1.field_head_ordy_defn_var_base
++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base
++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base
++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base
++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base
+;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.h b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.h
new file mode 100644
index 000000000..a7146b65e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.h
@@ -0,0 +1,19 @@
+#include "fesd.h"
+
+struct gstruct_base_ordy_decl_not;
+struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; };
+
+struct gstruct_base_ordy_decl_ref_base;
+struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; };
+struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; };
+struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; };
+struct gstruct_base_ordy_defn_var_base {
+ struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc;
+ struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref;
+ struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr;
+ struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld;
+ struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc;
+ struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref;
+ struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr;
+ struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
new file mode 100644
index 000000000..ebbfc3667
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
@@ -0,0 +1,83 @@
+// { dg-do compile }
+// { dg-options "-gdwarf -dA -femit-struct-debug-reduced" }
+// { dg-final { scan-assembler "timespec.*DW_AT_name" } }
+// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
+// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
+// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } }
+// { dg-final { scan-assembler "it_interval.*DW_AT_name" } }
+// { dg-final { scan-assembler "it_value.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } }
+# 1 "fesd-reduced.c"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 1 "fesd-reduced.c"
+
+//#include "time.h"
+# 1 "time.h" 1 3 4
+struct timespec
+ {
+ long int tv_sec;
+ long int tv_nsec;
+ };
+
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+
+# 6 "fesd-reduced.c" 2
+
+struct timespec base_var8;
+struct itimerspec *base_var9;
+
+#include "fesd-reduced.h"
+
+struct gstruct_head_ordy_defn_var_base base_var1;
+struct gstruct_base_ordy_defn_var_base base_var2;
+
+int base_function() {
+ return 0
++ base_var1.field_head_ordy_defn_var_base
++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base
++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base
++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base
++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base
+;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.h b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.h
new file mode 100644
index 000000000..a7146b65e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.h
@@ -0,0 +1,19 @@
+#include "fesd.h"
+
+struct gstruct_base_ordy_decl_not;
+struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; };
+
+struct gstruct_base_ordy_decl_ref_base;
+struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; };
+struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; };
+struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; };
+struct gstruct_base_ordy_defn_var_base {
+ struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc;
+ struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref;
+ struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr;
+ struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld;
+ struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc;
+ struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref;
+ struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr;
+ struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
new file mode 100644
index 000000000..ad0a44a95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
@@ -0,0 +1,83 @@
+// { dg-do compile }
+// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=sys" }
+// { dg-final { scan-assembler "timespec.*DW_AT_name" } }
+// { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
+// { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
+// { dg-final { scan-assembler "itimerspec.*DW_AT_name" } }
+// { dg-final { scan-assembler "it_interval.*DW_AT_name" } }
+// { dg-final { scan-assembler "it_value.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_head.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_head_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "gstruct_head_ordy_decl_ref_head.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler-not "field_head_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_ptr_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field_base_ordy_defn_fld_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_defn_var_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field1_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_inc.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ref.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_ptr.*DW_AT_name" } }
+// { dg-final { scan-assembler "field2_base_ordy_defn_var_base_fld.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_head_ordy_decl_ref_base.*DW_AT_name" } }
+// { dg-final { scan-assembler "gstruct_base_ordy_decl_ref_base.*DW_AT_name" } }
+# 1 "fesd-sys.c"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 1 "fesd-sys.c"
+
+//#include "time.h"
+# 1 "time.h" 1 3 4
+struct timespec
+ {
+ long int tv_sec;
+ long int tv_nsec;
+ };
+
+struct itimerspec
+ {
+ struct timespec it_interval;
+ struct timespec it_value;
+ };
+
+# 6 "fesd-sys.c" 2
+
+struct timespec base_var8;
+struct itimerspec *base_var9;
+
+#include "fesd-sys.h"
+
+struct gstruct_head_ordy_defn_var_base base_var1;
+struct gstruct_base_ordy_defn_var_base base_var2;
+
+int base_function() {
+ return 0
++ base_var1.field_head_ordy_defn_var_base
++ base_var2.field1_base_ordy_defn_var_base_ptr->field_head_ordy_defn_ptr_base
++ base_var2.field1_base_ordy_defn_var_base_fld.field_head_ordy_defn_fld_base
++ base_var2.field2_base_ordy_defn_var_base_ptr->field_base_ordy_defn_ptr_base
++ base_var2.field2_base_ordy_defn_var_base_fld.field_base_ordy_defn_fld_base
+;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.h b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.h
new file mode 100644
index 000000000..a7146b65e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.h
@@ -0,0 +1,19 @@
+#include "fesd.h"
+
+struct gstruct_base_ordy_decl_not;
+struct gstruct_base_ordy_defn_not { int field_base_ordy_defn_not; };
+
+struct gstruct_base_ordy_decl_ref_base;
+struct gstruct_base_ordy_defn_ref_base { int field_base_ordy_defn_ref_base; };
+struct gstruct_base_ordy_defn_ptr_base { int field_base_ordy_defn_ptr_base; };
+struct gstruct_base_ordy_defn_fld_base { int field_base_ordy_defn_fld_base; };
+struct gstruct_base_ordy_defn_var_base {
+ struct gstruct_head_ordy_decl_ref_base *field1_base_ordy_defn_var_base_inc;
+ struct gstruct_head_ordy_defn_ref_base *field1_base_ordy_defn_var_base_ref;
+ struct gstruct_head_ordy_defn_ptr_base *field1_base_ordy_defn_var_base_ptr;
+ struct gstruct_head_ordy_defn_fld_base field1_base_ordy_defn_var_base_fld;
+ struct gstruct_base_ordy_decl_ref_base *field2_base_ordy_defn_var_base_inc;
+ struct gstruct_base_ordy_defn_ref_base *field2_base_ordy_defn_var_base_ref;
+ struct gstruct_base_ordy_defn_ptr_base *field2_base_ordy_defn_var_base_ptr;
+ struct gstruct_base_ordy_defn_fld_base field2_base_ordy_defn_var_base_fld;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd.h b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd.h
new file mode 100644
index 000000000..46b24f5e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/fesd.h
@@ -0,0 +1,36 @@
+/*
+where from: base = matching base; head = other header
+what kind: ordy = ordinary struct; tmpl = template struct
+definition: decl = incomplete declaration; defn = full definition
+how used: not = not used; ref = by ref; ptr = through pointer;
+ fld = as field; var = as variable
+from where: base = from base; head = other header
+*/
+
+struct gstruct_head_ordy_decl_not;
+struct gstruct_head_ordy_defn_not { int field_head_ordy_defn_not; };
+
+struct gstruct_head_ordy_decl_ref_head;
+struct gstruct_head_ordy_defn_ref_head { int field_head_ordy_defn_ref_head; };
+struct gstruct_head_ordy_defn_ptr_head { int field_head_ordy_defn_ptr_head; };
+struct gstruct_head_ordy_defn_fld_head { int field_head_ordy_defn_fld_head; };
+struct gstruct_head_ordy_defn_var_head {
+ struct gstruct_head_ordy_decl_ref_head *field_head_ordy_defn_var_head_inc;
+ struct gstruct_head_ordy_defn_ref_head *field_head_ordy_defn_var_head_ref;
+ struct gstruct_head_ordy_defn_ptr_head *field_head_ordy_defn_var_head_ptr;
+ struct gstruct_head_ordy_defn_fld_head field_head_ordy_defn_var_head_fld;
+};
+extern struct gstruct_head_ordy_defn_var_head head_var1;
+
+struct gstruct_head_ordy_decl_ref_base;
+struct gstruct_head_ordy_defn_ref_base { int field_head_ordy_defn_ref_base; };
+struct gstruct_head_ordy_defn_ptr_base { int field_head_ordy_defn_ptr_base; };
+struct gstruct_head_ordy_defn_fld_base { int field_head_ordy_defn_fld_base; };
+struct gstruct_head_ordy_defn_var_base { int field_head_ordy_defn_var_base; };
+
+inline int head_function() {
+ return 0
++ head_var1.field_head_ordy_defn_var_head_ptr->field_head_ordy_defn_ptr_head
++ head_var1.field_head_ordy_defn_var_head_fld.field_head_ordy_defn_fld_head
+;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c
new file mode 100644
index 000000000..431b429de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/global-used-types.c
@@ -0,0 +1,14 @@
+/*
+ Contributed by Dodji Seketeli <dodji@redhat.com>
+ { dg-options "-gdwarf -dA -fno-merge-debug-strings" }
+ { dg-do compile }
+ { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_enumeration_type" 1 } }
+ { dg-final { scan-assembler-times "DIE \\(0x\[^\n\]*\\) DW_TAG_enumerator" 2 } }
+ { dg-final { scan-assembler-times "ascii \"a.0\"\[\t \]+\[^\n\]*DW_AT_name" 1 } }
+ { dg-final { scan-assembler-times "ascii \"b.0\"\[\t \]+\[^\n\]*DW_AT_name" 1 } }
+ */
+
+enum { a, b };
+
+int v = a;
+char s[b];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline1.c
new file mode 100644
index 000000000..bd7f7b986
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+void e(int);
+__attribute__ ((always_inline)) inline int
+t(int function_parameter)
+{
+ e(function_parameter);
+}
+
+void test (int function_parameter2)
+{
+ t(function_parameter2);
+}
+
+/* Verify that we get both function_parameter and function_parameter2 declared
+ in test. Overall we should have 3 variables with location defined (also
+ function_parameter in offline copy of t. */
+/* { dg-final { scan-assembler-times " DW_AT_location" 3 } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c
new file mode 100644
index 000000000..b1947699e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c
@@ -0,0 +1,70 @@
+/* Contributed by Dodji Seketeli <dodji@redhat.com>
+ Origin: PR debug/37801
+
+ Abstract instances (DW_TAG_subroutines having the DW_AT_inline attribute)
+ of second and first were having a DW_TAG_lexical_block DIE wrongly
+ representing the inlined calls to third (in second) and to
+ second (in first). At the same time, main didn't have children
+ DW_TAG_inlined_subroutine DIEs representing the inlined calls to
+ first, second and third.
+
+ The ideal goal here is to test that we have no superfluous
+ DW_TAG_lexical_block DIE anymore, that abstract instances DIEs have
+ no descendant DIE with a DW_AT_abstract_origin attribute, and that main has
+ properly nested DW_TAG_inlined_subroutine DIEs for third, second and first.
+*/
+
+/* { dg-options "-O -g3 -gdwarf -dA" } */
+/* { dg-do compile } */
+
+/* There are 6 inlined subroutines:
+ - One for each subroutine inlined into main, that's 3.
+ - One for earch subroutine inline into the out of line instances
+ of third, second and first. */
+/* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) DW_TAG_inlined_subroutine" 6 } } */
+
+/* Likewise we should have 6 DW_TAG_lexical_block DIEs:
+ - One for each subroutine inlined into main, so that's 3.
+ - One for each subroutine inlined in the out of line instances
+ of third, second and first, that's 3.
+*/
+/* { dg-final { scan-assembler-times "\\(DIE \\(\[^\n\]*\\) DW_TAG_lexical_block" 6 } } */
+
+
+/* There are 3 DW_AT_inline attributes: one per abstract inline instance.
+ The value of the attribute must be 0x3, meaning the function was
+ actually inlined. */
+/* { dg-final { scan-assembler-times "(?:byte|data1)\[^\n\]*0x3\[^\n\]* DW_AT_inline" 3 } } */
+
+volatile int *a;
+
+inline void
+third (int arg3)
+{
+ int var3 = arg3;
+ a[0] = var3;
+}
+
+inline void
+second (int arg2)
+{
+ int var2 = arg2;
+ third (var2+1);
+}
+
+inline void
+first (int arg1)
+{
+ int var1 = arg1;
+ second (var1+1);
+}
+
+int
+main ()
+{
+ int some_int = 1;
+ first (some_int);
+ return 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
new file mode 100644
index 000000000..baa2f66e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
@@ -0,0 +1,25 @@
+/* Verify that only one DW_AT_const_value is emitted for baz,
+ not for baz abstract DIE and again inside of
+ DW_TAG_inlined_subroutine. */
+/* { dg-options "-O2 -gdwarf -dA -fmerge-all-constants" } */
+/* { dg-do compile } */
+/* { dg-final { scan-assembler-times " DW_AT_const_value" 1 } } */
+
+struct A { const long i; const long j; };
+
+static inline long
+foo (void)
+{
+ const struct A baz = { .i = 2, .j = 21 };
+ /* We must make sure that baz isn't optimized away before inlining,
+ otherwise its initializer is also lost. */
+ const struct A *p = &baz;
+ asm volatile ("" : : : "memory");
+ return baz.i * baz.j;
+}
+
+int
+main ()
+{
+ return foo () - 42;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/ipa-cp1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/ipa-cp1.c
new file mode 100644
index 000000000..395c54418
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/ipa-cp1.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA" } */
+void q(int p);
+static void
+t(int constant_propagated_par)
+{
+ int local_var = constant_propagated_par + 1;
+ q(local_var);
+ q(local_var);
+ q(local_var);
+ q(local_var);
+ q(local_var);
+ q(local_var);
+ q(local_var);
+ q(local_var);
+ q(local_var);
+ q(local_var);
+ q(local_var);
+}
+main()
+{
+ t(5);
+ t(5);
+ t(5);
+ t(5);
+ t(5);
+ t(5);
+ t(5);
+}
+/* { dg-final { scan-assembler "local_var" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/omp-fesdr.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/omp-fesdr.c
new file mode 100644
index 000000000..d7b03192b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/omp-fesdr.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fopenmp } */
+/* { dg-options "-g -fopenmp -gdwarf-2 -femit-struct-debug-reduced" } */
+
+struct aa
+{
+ int a;
+};
+
+int
+f7 (void)
+{
+ int v7i = 6, v7j = 7, v7k = 9, v7l = 0, v7n = 0, v7o = 1;
+
+ #pragma omp parallel
+ {
+ #pragma omp master
+ v7o++;
+ #pragma omp for private (v7i) firstprivate (v7k) reduction (+:v7l)
+ for (v7n = 0; v7n < 3; v7n++)
+ {
+ int v7m = v7j + v7k;
+ v7i = 8;
+ v7l++;
+ }
+ }
+
+ return v7i + v7j + v7k + v7l + v7n;
+}
+
+int
+main (void)
+{
+ f7 ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-1.c
new file mode 100644
index 000000000..e818263a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-1.c
@@ -0,0 +1,32 @@
+/* PR debug/29609 */
+/* Verify that breakpoint on the break is hit. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+
+void abort (void);
+
+int
+foo (void)
+{
+ int a, i;
+
+ for (i = 1; i <= 10; i++)
+ {
+ if (i < 3)
+ a = 1;
+ else
+ break;
+ a = 5;
+ }
+ return a;
+}
+
+int
+main (void)
+{
+ if (foo () != 5)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr29609-1.c:18" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c
new file mode 100644
index 000000000..463d3cc58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr29609-2.c
@@ -0,0 +1,53 @@
+/* PR debug/29609 */
+/* Verify that breakpoint on both goto failure; stmts is hit. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+
+extern void abort (void);
+int x;
+
+int
+foo (void)
+{
+ return 0 ^ x;
+}
+
+int
+bar (void)
+{
+ return 1 ^ x;
+}
+
+int
+baz (void)
+{
+ int c;
+
+ if (!foo ())
+ goto failure;
+
+ if (!bar ())
+ goto failure;
+
+ return 0;
+
+failure:
+ return 1;
+}
+
+int
+main (void)
+{
+ if (baz () != 1)
+ abort ();
+ x = 1;
+ if (baz () != 1)
+ abort ();
+ x = 2;
+ if (baz () != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr29609-2.c:27" } } */
+/* { dg-final { scan-assembler "pr29609-2.c:30" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr31230.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr31230.c
new file mode 100644
index 000000000..36d55bf30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr31230.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -dA --param ggc-min-expand=0 --param ggc-min-heapsize=0" } */
+/* { dg-final { scan-assembler-times "DIE.*DW_TAG_array_type" 1 } } */
+/* { dg-final { scan-assembler-times "DIE.*DW_TAG_subrange_type" 1 } } */
+
+void f1 (void)
+{
+ char buffer1[100];
+}
+
+int f2 (void)
+{
+ return 0;
+}
+
+void f3 (void)
+{
+ char buffer2[100];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-1.c
new file mode 100644
index 000000000..d84ce26ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-1.c
@@ -0,0 +1,22 @@
+/* PR debug/36690 */
+/* Verify that break func is hit. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+
+int i;
+
+void
+func (void)
+{
+ while (i == 1)
+ i = 0;
+}
+
+int
+main (void)
+{
+ func ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr36690-1.c:11" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-2.c
new file mode 100644
index 000000000..0927e7465
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-2.c
@@ -0,0 +1,39 @@
+/* PR debug/36690 */
+/* Verify that breakpoint can be put on goto f1, it is hit and
+ varz at that spot is defined and contains 5. Nowhere else
+ in the function should be varz in the scope. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+
+int cnt;
+
+void
+bar (int i)
+{
+ cnt += i;
+}
+
+void
+foo (int i)
+{
+ if (!i)
+ bar (0);
+ else
+ {
+ static int varz = 5;
+ goto f1;
+ }
+ bar (1);
+f1:
+ bar (2);
+}
+
+int
+main (void)
+{
+ foo (0);
+ foo (1);
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr36690-2.c:24" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-3.c
new file mode 100644
index 000000000..bc492f2c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr36690-3.c
@@ -0,0 +1,53 @@
+/* PR debug/36690 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+
+int cnt;
+
+void
+bar (int i)
+{
+ cnt += i;
+}
+
+void
+foo (int i, int j)
+{
+ if (j)
+ {
+ bar (i + 1);
+ goto f1;
+ }
+ bar (i + 2);
+ goto f2;
+f1:
+ if (i > 10)
+ goto f3;
+f2:
+ if (i > 40)
+ goto f4;
+ else
+ goto f5;
+f3:
+ bar (i);
+f4:
+ bar (i);
+f5:
+ bar (i);
+}
+
+int
+main (void)
+{
+ foo (0, 1);
+ foo (11, 1);
+ foo (21, 0);
+ foo (41, 0);
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr36690-3.c:19" } } */
+/* { dg-final { scan-assembler "pr36690-3.c:22" } } */
+/* { dg-final { scan-assembler "pr36690-3.c:25" } } */
+/* { dg-final { scan-assembler "pr36690-3.c:28" } } */
+/* { dg-final { scan-assembler "pr36690-3.c:30" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr37616.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr37616.c
new file mode 100644
index 000000000..016dbc948
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr37616.c
@@ -0,0 +1,41 @@
+/* PR debug/37616 */
+/* Test that one can put breakpoints onto continue, exitlab and break
+ and actually see program reaching those breakpoints. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+
+extern void abort (void);
+
+int
+foo (int parm)
+{
+ int varj, varm;
+
+ for (varj = 0; varj < 10; varj++)
+ {
+ if (varj == 5)
+ continue;
+ if (varj == 7 && !parm)
+ goto exitlab;
+ if (varj == 9)
+ break;
+ varm = varj;
+ }
+
+exitlab:
+ return varm;
+}
+
+int
+main (void)
+{
+ if (foo (0) != 6)
+ abort ();
+ if (foo (1) != 8)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "pr37616.c:17" } } */
+/* { dg-final { scan-assembler "pr37616.c:19" } } */
+/* { dg-final { scan-assembler "pr37616.c:21" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr37726.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr37726.c
new file mode 100644
index 000000000..622fbcf64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr37726.c
@@ -0,0 +1,25 @@
+/* PR debug/37726 */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+int foo (int parm)
+{
+ int var = 0;
+ int bar (void)
+ {
+ return parm + var;
+ }
+ parm++;
+ var++;
+ return bar ();
+}
+
+int
+main (void)
+{
+ return foo (4) - 6;
+}
+
+/* Both parm and var variables should be in debug info for both foo and bar. */
+/* { dg-final { scan-assembler-times "\"parm\[^\n\]*\"\[^\n\]*DW_AT_name" 2 } } */
+/* { dg-final { scan-assembler-times "\"var\[^\n\]*\"\[^\n\]*DW_AT_name" 2 } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c
new file mode 100644
index 000000000..4e856ec09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(a,b)
+int varh;A(1,
+
+
+
+ 2)int vari;
+int varj;
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c
new file mode 100644
index 000000000..e416b0f90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c
@@ -0,0 +1,9 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-1.c"
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c
new file mode 100644
index 000000000..46f57e670
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(a,b)
+int varh;/*
+
+Some multi-line comment.
+
+ */int vari;
+int varj;
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c
new file mode 100644
index 000000000..409f79f85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c
@@ -0,0 +1,9 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-3.c"
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c
new file mode 100644
index 000000000..de5a1cc13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c
@@ -0,0 +1,17 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(x) vari x
+#define vari(x)
+#define B , varj
+int A(B) ;
+
+/* We want to check that both vari and varj have the same line
+ number. */
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xa|10)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xa|10)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c
new file mode 100644
index 000000000..340cb3835
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c
@@ -0,0 +1,11 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-5.c"
+
+/* We want to check that both vari and varj have the same line
+ number. */
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xa|10)?\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xa|10)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c
new file mode 100644
index 000000000..872ed7da6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c
@@ -0,0 +1,14 @@
+/* PR preprocessor/41543 */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+#include <stdarg.h>
+
+int
+foo (va_list ap)
+{
+ return va_arg (ap, int);
+}
+
+/* { dg-final { scan-assembler-not "DW_AT_decl_file\[^\\r\\n\]*\(pr41543\.i\)" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c
new file mode 100644
index 000000000..90ae5cd88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c
@@ -0,0 +1,18 @@
+/* PR debug/41695 */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -O2 -dA -fno-merge-debug-strings" } */
+
+int bar (int);
+
+void
+foo (void)
+{
+ int b = 0;
+ b = bar (b);
+ b = bar (b);
+ b = bar (b);
+ b = bar (b);
+ bar (b);
+}
+
+/* { dg-final { scan-assembler-not "LVL(\[0-9\]+)-\[^1\]\[^\\r\\n\]*Location list begin address\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*LVL\\1-1-" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr43237.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr43237.c
new file mode 100644
index 000000000..8db254392
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr43237.c
@@ -0,0 +1,31 @@
+/* PR debug/43237 */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -O2 -dA -fno-merge-debug-strings" } */
+
+struct S
+{
+ int *a;
+ int b;
+ int **c;
+ int d;
+};
+
+void foo (struct S *);
+void bar (struct S *);
+
+int
+baz (void)
+{
+ struct S s;
+ foo (&s);
+ {
+ int a[s.b];
+ int *c[s.d];
+ s.a = a;
+ s.c = c;
+ bar (&s);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "LLST\[^\\r\\n\]*DW_AT_upper_bound" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-1.c
new file mode 100644
index 000000000..a859ac91a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-save-temps -gdwarf -dA" } */
+
+typedef struct _Harry { int dummy; } Harry_t;
+Harry_t harry;
+
+/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*(DW_AT_name: \"Harry_t\"|\"Harry_t..\"\[^\\r\\n\]*DW_AT_name)" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-2.c
new file mode 100644
index 000000000..dfbfa2fed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-save-temps -gdwarf -dA" } */
+
+typedef const struct _Harry { int dummy; } Harry_t;
+Harry_t harry;
+
+/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*(DW_AT_name: \"Harry_t\"|\"Harry_t..\"\[^\\r\\n\]*DW_AT_name)" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-3.c
new file mode 100644
index 000000000..c8039ef6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-3.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-save-temps -gdwarf -dA" } */
+
+typedef struct _Harry { int dummy; } Harry_t;
+const Harry_t harry[5];
+
+/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*(DW_AT_name: \"Harry_t\"|\"Harry_t..\"\[^\\r\\n\]*DW_AT_name)" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-4.c
new file mode 100644
index 000000000..bd2351bd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr47939-4.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-save-temps -gdwarf -dA" } */
+
+typedef const struct _Harry { int dummy; } Harry_t;
+Harry_t harry[10];
+
+/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*(DW_AT_name: \"Harry_t\"|\"Harry_t..\"\[^\\r\\n\]*DW_AT_name)" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr49871.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr49871.c
new file mode 100644
index 000000000..f5b03ea92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr49871.c
@@ -0,0 +1,13 @@
+/* PR debug/49871 */
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-gdwarf-3 -dA -fno-merge-debug-strings" } */
+
+struct S
+{
+ char a[1 << 16];
+ int b;
+} s;
+
+/* { dg-final { scan-assembler "\\(DW_AT_data_member_location\\)\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\\(DW_FORM_udata\\)" } } */
+/* { dg-final { scan-assembler-not "\\(DW_AT_data_member_location\\)\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\\(DW_FORM_data\[48\]\\)" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c
new file mode 100644
index 000000000..62b389ee9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c
@@ -0,0 +1,13 @@
+/* PR debug/51410 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA -fno-merge-debug-strings" } */
+
+int x;
+
+int
+foo (void)
+{
+ return x;
+}
+
+/* { dg-final { scan-assembler-times "\\(DIE\[^\\r\\n\]*DW_TAG_variable\\)" 1 } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c
new file mode 100644
index 000000000..0ec3e84d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/pr53948.c
@@ -0,0 +1,10 @@
+/* Test that we have line information for the line
+ with local variable initializations. */
+/* { dg-options "-O0 -gdwarf -dA" } */
+/* { dg-final { scan-assembler ".loc 1 8 0|\[#/!\]\[ \t\]+line 8" } } */
+
+
+int f (register int a, register int b) {
+ register int x = b, y = a;
+ return x + y; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/short-circuit.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/short-circuit.c
new file mode 100644
index 000000000..4fa199c0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/short-circuit.c
@@ -0,0 +1,108 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -gdwarf -dA" } */
+
+#define True 1
+#define False 0
+
+_Bool F1 (_Bool B1, _Bool B2)
+{
+ _Bool R;
+
+ if (B1
+ && B2)
+ R = True;
+ else
+ R = False;
+ return R;
+}
+
+_Bool F2 (_Bool B1, _Bool B2)
+{
+ _Bool R;
+
+ R = B1
+ && B2;
+ return R;
+}
+
+_Bool F3 (_Bool B1, _Bool B2)
+{
+ _Bool R = False;
+
+ if (B1
+ && B2)
+ R = True;
+ return R;
+}
+
+_Bool F4 (_Bool B1, _Bool B2)
+{
+ _Bool R = False;
+
+ if (B1
+ || B2)
+ ;
+ else
+ R = True;
+ return R;
+}
+
+_Bool F5 (_Bool B1, _Bool B2)
+{
+ _Bool R = False;
+
+ if (!(B1
+ && B2))
+ R = True;
+ return R;
+}
+
+_Bool F8 (_Bool B1, _Bool B2, _Bool B3, _Bool B4, _Bool B5, _Bool B6,
+ _Bool B7, _Bool B8)
+{
+ _Bool R;
+
+ if ((B1
+ || B2)
+ && B3
+ && !(B4
+ || B5)
+ && (B6
+ || (B7
+ && B8)))
+ R = True;
+ else
+ R = False;
+ return R;
+}
+
+/* { dg-final { scan-assembler "short-circuit.c:11" } } */
+/* { dg-final { scan-assembler "short-circuit.c:12" } } */
+/* { dg-final { scan-assembler "short-circuit.c:13" } } */
+/* { dg-final { scan-assembler "short-circuit.c:15" } } */
+
+/* { dg-final { scan-assembler "short-circuit.c:23" } } */
+/* { dg-final { scan-assembler "short-circuit.c:24" } } */
+
+/* { dg-final { scan-assembler "short-circuit.c:32" } } */
+/* { dg-final { scan-assembler "short-circuit.c:33" } } */
+/* { dg-final { scan-assembler "short-circuit.c:34" } } */
+
+/* { dg-final { scan-assembler "short-circuit.c:42" } } */
+/* { dg-final { scan-assembler "short-circuit.c:43" } } */
+/* { dg-final { scan-assembler "short-circuit.c:46" } } */
+
+/* { dg-final { scan-assembler "short-circuit.c:54" } } */
+/* { dg-final { scan-assembler "short-circuit.c:55" } } */
+/* { dg-final { scan-assembler "short-circuit.c:56" } } */
+
+/* { dg-final { scan-assembler "short-circuit.c:65" } } */
+/* { dg-final { scan-assembler "short-circuit.c:66" } } */
+/* { dg-final { scan-assembler "short-circuit.c:67" } } */
+/* { dg-final { scan-assembler "short-circuit.c:68" } } */
+/* { dg-final { scan-assembler "short-circuit.c:69" } } */
+/* { dg-final { scan-assembler "short-circuit.c:70" } } */
+/* { dg-final { scan-assembler "short-circuit.c:71" } } */
+/* { dg-final { scan-assembler "short-circuit.c:72" } } */
+/* { dg-final { scan-assembler "short-circuit.c:73" } } */
+/* { dg-final { scan-assembler "short-circuit.c:75" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/static1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/static1.c
new file mode 100644
index 000000000..bdc118ddc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/static1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf" } */
+void
+main(void)
+{
+ static int unused_local_var;
+}
+/* { dg-final { scan-assembler "unused_local_var" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/struct-loc1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/struct-loc1.c
new file mode 100644
index 000000000..bf893ee86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/struct-loc1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-gdwarf -O0 -dA -fno-merge-debug-strings" } */
+
+struct foo;
+struct foo *obj;
+struct foo
+{
+ int x;
+};
+
+int
+main ()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler "DW_TAG_structure_type\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"foo\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?6\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c
new file mode 100644
index 000000000..297d244e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c
@@ -0,0 +1,10 @@
+/* PR 23190 */
+/* { dg-do compile }
+/* { dg-options "-gdwarf -dA -fno-merge-debug-strings" } */
+/* { dg-final { scan-assembler "xyzzy\[^\\n\\r\]+DW_AT_name" } } */
+
+void f(void)
+{
+ static int xyzzy;
+ xyzzy += 3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/var2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/var2.c
new file mode 100644
index 000000000..72aef4180
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/var2.c
@@ -0,0 +1,14 @@
+/* PR 23190 */
+/* { dg-do compile }
+/* { dg-options "-O2 -gdwarf -dA" } */
+/* { dg-final { scan-assembler "DW_OP_addr\[\\n\\r\]+\[^\\n\\r\]+foo" } } */
+/* { dg-final { scan-assembler "DW_OP_addr\[\\n\\r\]+\[^\\n\\r\]+bar" } } */
+
+static int foo;
+int bar;
+int main(void)
+{
+ foo += 3;
+ bar *= 5;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/enum-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/enum-1.c
new file mode 100644
index 000000000..7681e9b52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/enum-1.c
@@ -0,0 +1,16 @@
+/* Verify that used enums are output. */
+/* { dg-do compile } */
+/* { dg-final { scan-assembler "JTI_MAX" } } */
+
+int var;
+
+enum java_tree_index
+{
+ JTI_MAX
+};
+
+void function (void)
+{
+ var = JTI_MAX;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr16676.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr16676.c
new file mode 100644
index 000000000..a9758858f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr16676.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+
+void foo (void) {
+ void nested () {}
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr26881.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr26881.c
new file mode 100644
index 000000000..156a2c455
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr26881.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-g -O0" } */
+int
+main (int argc, char **argv)
+{
+ if (0)
+ {
+ static union
+ {
+ }
+ u;
+ typedef char tt;
+ static tt c[8];
+ return c[0] == 0x01 && c[1] == 0x02;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29558.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29558.c
new file mode 100644
index 000000000..99386b335
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29558.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+
+void stpi_unpack_16_1(int length, unsigned char *out, unsigned char bit)
+{
+ unsigned char tempin;
+ unsigned char temp[16];
+ for (bit = 128; length > 0; length--) {
+ if (tempin & 128)
+ temp[0] |= bit;
+ else
+ {
+ *out++ = temp[1];
+ *out++ = temp[2];
+ *out++ = temp[3];
+ *out++ = temp[4];
+ *out++ = temp[5];
+ *out++ = temp[6];
+ *out++ = temp[7];
+ *out++ = temp[9];
+ *out++ = temp[10];
+ *out++ = temp[11];
+ *out++ = temp[12];
+ *out++ = temp[13];
+ *out++ = temp[14];
+ *out++ = temp[15];
+ __builtin_memset (temp, 0, 16);
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29609-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29609-1.c
new file mode 100644
index 000000000..85069ebd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29609-1.c
@@ -0,0 +1,33 @@
+/* PR debug/29609 */
+/* Verify that breakpoint on the break is hit.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+extern void abort (void);
+
+int
+foo (void)
+{
+ int a, i;
+
+ for (i = 1; i <= 10; i++)
+ {
+ if (i < 3)
+ a = 1;
+ else
+ break;
+ a = 5;
+ }
+ return a;
+}
+
+int
+main (void)
+{
+ if (foo () != 5)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29609-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29609-2.c
new file mode 100644
index 000000000..1ae1a738d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr29609-2.c
@@ -0,0 +1,53 @@
+/* PR debug/29609 */
+/* Verify that breakpoint on both goto failure; stmts is hit.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+extern void abort (void);
+int x;
+
+int
+foo (void)
+{
+ return 0 ^ x;
+}
+
+int
+bar (void)
+{
+ return 1 ^ x;
+}
+
+int
+baz (void)
+{
+ int c;
+
+ if (!foo ())
+ goto failure;
+
+ if (!bar ())
+ goto failure;
+
+ return 0;
+
+failure:
+ return 1;
+}
+
+int
+main (void)
+{
+ if (baz () != 1)
+ abort ();
+ x = 1;
+ if (baz () != 1)
+ abort ();
+ x = 2;
+ if (baz () != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr32610.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr32610.c
new file mode 100644
index 000000000..d1dae1d38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr32610.c
@@ -0,0 +1,14 @@
+/* PR debug/32610 */
+/* { dg-do compile } */
+
+inline void
+foo (int x)
+{
+ double (*arr)[x];
+}
+
+void
+bar (void)
+{
+ foo (1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr33316.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr33316.c
new file mode 100644
index 000000000..d43478bb5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr33316.c
@@ -0,0 +1,15 @@
+/* PR debug/33316 */
+
+int
+foo (void *x, int y)
+{
+ const struct { int d[y]; } *a = x;
+ return a[0].d[0];
+}
+
+int
+bar (void *x, int y)
+{
+ const struct S { int d[y]; } *a = x;
+ return a[0].d[0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr35154.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr35154.c
new file mode 100644
index 000000000..fa658be2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr35154.c
@@ -0,0 +1,34 @@
+/* Test to make sure that stabs for C symbols that go into .comm have the
+ proper structure. These should be lettered G for the struct that gives
+ the name to the .comm, and should be V or S for .lcomm symbols. */
+
+static char i_outer;
+struct {
+ char f1;
+ char f2;
+} opta;
+struct {
+ char f1;
+ char f2;
+} optb;
+
+int
+main()
+{
+ static char i_inner[2];
+ i_inner[0] = 'a'; i_inner[1] = 'b';
+ opta.f1 = 'c';
+ opta.f2 = 'd';
+ optb.f1 = 'C';
+ optb.f2 = 'D';
+ i_outer = 'e';
+/* { dg-do compile } */
+/* { dg-skip-if "No stabs" { mmix-*-* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* } { "*" } { "" } } */
+/* { dg-skip-if "stabs only" { *-*-* } { "*" } { "-gstabs" } } */
+ return 0;
+}
+
+/* { dg-final { scan-assembler ".stabs.*i_inner:V" } } */
+/* { dg-final { scan-assembler ".stabs.*i_outer:S" } } */
+/* { dg-final { scan-assembler ".stabs.*opta:G" } } */
+/* { dg-final { scan-assembler ".stabs.*optb:G" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-1.c
new file mode 100644
index 000000000..e3c913b6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-1.c
@@ -0,0 +1,23 @@
+/* PR debug/36690 */
+/* Verify that break func is hit.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+int i;
+
+void
+func (void)
+{
+ while (i == 1)
+ i = 0;
+}
+
+int
+main (void)
+{
+ func ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-2.c
new file mode 100644
index 000000000..ddda18cf7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-2.c
@@ -0,0 +1,40 @@
+/* PR debug/36690 */
+/* Verify that breakpoint can be put on goto f1, it is hit and
+ varz at that spot is defined and contains 5. Nowhere else
+ in the function should be varz in the scope.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+int cnt;
+
+void
+bar (int i)
+{
+ cnt += i;
+}
+
+void
+foo (int i)
+{
+ if (!i)
+ bar (0);
+ else
+ {
+ static int varz = 5;
+ goto f1;
+ }
+ bar (1);
+f1:
+ bar (2);
+}
+
+int
+main (void)
+{
+ foo (0);
+ foo (1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-3.c
new file mode 100644
index 000000000..62d3494da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr36690-3.c
@@ -0,0 +1,47 @@
+/* PR debug/36690 */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+int cnt;
+
+void
+bar (int i)
+{
+ cnt += i;
+}
+
+void
+foo (int i, int j)
+{
+ if (j)
+ {
+ bar (i + 1);
+ goto f1;
+ }
+ bar (i + 2);
+ goto f2;
+f1:
+ if (i > 10)
+ goto f3;
+f2:
+ if (i > 40)
+ goto f4;
+ else
+ goto f5;
+f3:
+ bar (i);
+f4:
+ bar (i);
+f5:
+ bar (i);
+}
+
+int
+main (void)
+{
+ foo (0, 1);
+ foo (11, 1);
+ foo (21, 0);
+ foo (41, 0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr37616.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr37616.c
new file mode 100644
index 000000000..3bbaebbdf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr37616.c
@@ -0,0 +1,40 @@
+/* PR debug/37616 */
+/* Test that one can put breakpoints onto continue, exitlab and break
+ and actually see program reaching those breakpoints.
+ This version of the test just checks that it can be compiled, linked
+ and executed, further testing is done in corresponding gcc.dg/dwarf2/
+ test and hopefully in gdb testsuite. */
+/* { dg-do run } */
+/* { dg-options "-O0 -g -dA" } */
+
+extern void abort (void);
+
+int
+foo (int parm)
+{
+ int varj, varm;
+
+ for (varj = 0; varj < 10; varj++)
+ {
+ if (varj == 5)
+ continue;
+ if (varj == 7 && !parm)
+ goto exitlab;
+ if (varj == 9)
+ break;
+ varm = varj;
+ }
+
+exitlab:
+ return varm;
+}
+
+int
+main (void)
+{
+ if (foo (0) != 6)
+ abort ();
+ if (foo (1) != 8)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr39412.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr39412.c
new file mode 100644
index 000000000..71b7b5e21
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr39412.c
@@ -0,0 +1,16 @@
+/* PR debug/39412 */
+/* { dg-do compile } */
+
+struct S { int i; };
+
+inline void
+bar (const void *x, unsigned long y)
+{
+ const union { struct S a[y]; } *u = x;
+}
+
+void
+foo (const void *x, unsigned long y)
+{
+ bar (x, y);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41264-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41264-1.c
new file mode 100644
index 000000000..7d03e51ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41264-1.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-attributes" } */
+
+#if (__SIZEOF_INT__ <= 2)
+typedef unsigned long hashval_t;
+#else
+typedef unsigned int hashval_t;
+#endif
+static hashval_t __attribute__((always_inline))
+iterative_hash_host_wide_int (long val, hashval_t val2)
+{
+ hashval_t a = (hashval_t) val;
+ int zero = 0;
+ hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 8 + zero));
+
+ a -= b; a -= val2; a ^= (val2>>13);
+ b -= val2; b -= a; b ^= (a<< 8);
+ val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13);
+ a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12);
+ b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff;
+ val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff;
+ a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff;
+ b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff;
+ val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff;
+ return val2;
+}
+
+hashval_t
+bla (int nunits, int mode)
+{
+ hashval_t hashcode = 0;
+
+
+ hashcode = iterative_hash_host_wide_int (14, hashcode);
+ hashcode = iterative_hash_host_wide_int (nunits, hashcode);
+ hashcode = iterative_hash_host_wide_int (mode, hashcode);
+ if (nunits)
+ return 0;
+ else
+ return hashcode;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41343-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41343-1.c
new file mode 100644
index 000000000..6d5638038
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41343-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+#define X(new,old) int i ## new = i ## old + i ## old;
+#define Y(pfx) X(pfx ## 1, pfx) \
+ X(pfx ## 2, pfx ## 1) \
+ X(pfx ## 3, pfx ## 2) \
+ X(pfx ## 4, pfx ## 3) \
+ X(pfx ## 5, pfx ## 4) \
+ X(pfx ## 6, pfx ## 5) \
+ X(pfx ## 7, pfx ## 6) \
+ X(pfx ## 8, pfx ## 7) \
+ X(pfx ## 9, pfx ## 8)
+
+void foo (int i1)
+{
+ Y(1)
+ Y(11)
+ Y(111)
+ asm ("" : : "X" (i1));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41717.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41717.c
new file mode 100644
index 000000000..21250883a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41717.c
@@ -0,0 +1,10 @@
+/* PR debug/41717 */
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ _Complex float v[1], w;
+ v[1] = 0.0f + 0.8fi;
+ w = __builtin_conjf (v[1] * v[1]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41893-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41893-1.c
new file mode 100644
index 000000000..6da30708e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41893-1.c
@@ -0,0 +1,16 @@
+/* PR debug/41893 */
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -fwhole-program -O" } */
+/* { dg-additional-sources "pr41893-2.c" } */
+
+struct S { int v; };
+struct S s;
+
+void __attribute__((externally_visible))
+func1 (void)
+{
+ struct S *p = &s;
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41893-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41893-2.c
new file mode 100644
index 000000000..f967875f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr41893-2.c
@@ -0,0 +1,10 @@
+/* PR debug/41893 */
+/* { dg-do compile } */
+
+extern struct S s;
+
+void
+func2 (void)
+{
+ &s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr42244.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr42244.c
new file mode 100644
index 000000000..ff2542873
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr42244.c
@@ -0,0 +1,13 @@
+/* PR debug/42444 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fmodulo-sched -ffloat-store" } */
+
+extern int a, b;
+
+double
+foo (double x)
+{
+ for (; a > b; a--)
+ x *= (double) a;
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr42767.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr42767.c
new file mode 100644
index 000000000..1f0e25fe5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr42767.c
@@ -0,0 +1,18 @@
+/* PR debug/42767 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -g" } */
+
+struct lineno_cache_entry
+{
+ unsigned long size;
+};
+_bfd_link_section_stabs (struct lineno_cache_entry * stabsec)
+{
+ unsigned long count;
+ unsigned char *sym;
+ unsigned char *symend;
+ unsigned long skip;
+ count = stabsec->size / 12;
+ for (; sym < symend; sym += 1);
+ stabsec->size = (count - skip) * 12;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr43972.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr43972.c
new file mode 100644
index 000000000..5fcf1e0e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr43972.c
@@ -0,0 +1,29 @@
+/* PR debug/43972 */
+/* { dg-do compile } */
+/* { dg-options "-g -w" } */
+/* { dg-options "-g -fpic -w" { target fpic } } */
+
+struct { int *b1; } *f1 ();
+short v1[1];
+struct S { int b2; };
+void
+foo (struct S *a1, union { char *b3; unsigned *b4; int *b5; } *a2)
+{
+ int d;
+ switch (d)
+ {
+ case 0:
+ {
+ int c = a1->b2, i;
+ if (f1 () == 0)
+ *a2->b3++ = 2;
+ else if (((long) (f1 () - f1 ())) ^ ((long) f1 ()->b1 - ((long) f1 () & 8)))
+ *a2->b3++ = (long) f1 - ((long) f1 () & 0xff);
+ else
+ *a2->b4++ = (long) f1;
+ for (i = 0; i < c; i++)
+ *a2->b5++ = (long) v1;
+ foo (a1, a2);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr45849.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr45849.c
new file mode 100644
index 000000000..93279b708
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr45849.c
@@ -0,0 +1,31 @@
+/* PR debug/45849 */
+/* { dg-do compile } */
+/* { dg-options "-g -Wno-uninitialized" } */
+
+extern void bar (void);
+
+void
+foo (long repllen, char *rp)
+{
+ char *matchend;
+ char *scan;
+ long len;
+ char *matchstart;
+ char *text;
+ char *t;
+
+ repllen--;
+
+ for (;;)
+ {
+ matchstart = t + rp[0];
+ matchend = rp;
+ len = matchstart - text + repllen * (matchend - matchstart);
+ while (len)
+ ;
+ for (scan = text; scan != rp; scan++)
+ bar ();
+ if (matchstart)
+ text = matchend;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr46409.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr46409.c
new file mode 100644
index 000000000..066cb67ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr46409.c
@@ -0,0 +1,9 @@
+/* PR debug/46409 */
+/* { dg-options "-g" } */
+
+int
+foo (int (*x) (unsigned long long), unsigned long long y)
+{
+ unsigned int z = x (y);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr46782.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr46782.c
new file mode 100644
index 000000000..1603b0922
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr46782.c
@@ -0,0 +1,11 @@
+/* PR debug/46782 */
+/* { dg-do compile } */
+/* { dg-options "-w -O0 -fvar-tracking -fcompare-debug" } */
+
+void foo (int i)
+{
+ if (i)
+ i++;
+ while (i)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr47498.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr47498.c
new file mode 100644
index 000000000..6bf1484cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr47498.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsched2-use-superblocks -fcompare-debug" } */
+
+int bar(void *);
+
+void foo (void *p)
+{
+ int i = 1;
+ while (i)
+ i = bar (p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr47501.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr47501.c
new file mode 100644
index 000000000..3bfb5acc7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr47501.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fmodulo-sched -fcompare-debug" } */
+
+void
+foo (void)
+{
+ unsigned numlen;
+ unsigned foldlen;
+ for (; foldlen; foldlen -= numlen)
+ foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49032.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49032.c
new file mode 100644
index 000000000..3985040d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49032.c
@@ -0,0 +1,11 @@
+/* PR debug/49032 */
+/* { dg-do link } */
+
+static int s = 42;
+
+int
+main ()
+{
+ int *l[18] = { &s, &s, &s, &s, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49294.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49294.c
new file mode 100644
index 000000000..86b53bd56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49294.c
@@ -0,0 +1,15 @@
+/* PR debug/49294 */
+/* { dg-do compile } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+
+typedef __attribute__ ((vector_size ((8) * sizeof (short)))) short V;
+
+int k;
+V v;
+
+void
+foo (void)
+{
+ V w = { k, k, k, k, k, k, k, k };
+ V x = v >> w;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49522.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49522.c
new file mode 100644
index 000000000..3fa3bfb0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr49522.c
@@ -0,0 +1,41 @@
+/* PR debug/49522 */
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug" } */
+
+int val1 = 0L;
+volatile int val2 = 7L;
+long long val3;
+int *ptr = &val1;
+
+static int
+func1 ()
+{
+ return 0;
+}
+
+static short int
+func2 (short int a, unsigned int b)
+{
+ return !b ? a : a >> b;
+}
+
+static unsigned long long
+func3 (unsigned long long a, unsigned long long b)
+{
+ return !b ? a : a % b;
+}
+
+void
+func4 (unsigned short arg1, int arg2)
+{
+ for (arg2 = 0; arg2 < 2; arg2++)
+ {
+ *ptr = func3 (func3 (10, func2 (val3, val2)), val3);
+ for (arg1 = -14; arg1 > 14; arg1 = func1 ())
+ {
+ *ptr = -1;
+ if (foo ())
+ ;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr55730.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr55730.c
new file mode 100644
index 000000000..073d83d75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr55730.c
@@ -0,0 +1,24 @@
+/* PR debug/55730 */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+union U
+{
+ float f;
+ int i;
+};
+
+void
+foo (unsigned short *x, unsigned char y)
+{
+ unsigned char g;
+ union U u;
+ if (u.i < 0)
+ g = 0;
+ else
+ {
+ u.f = u.f * (255.0F / 256.0F) + 32768.0F;
+ g = (unsigned char) u.i;
+ }
+ *x = (g << 8) | y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr57351.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr57351.c
new file mode 100644
index 000000000..972f3e9eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/pr57351.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon } */
+/* { dg-options "-std=c99 -Os -g -march=armv7-a" } */
+/* { dg-add-options arm_neon } */
+
+typedef unsigned int size_t;
+typedef int ptrdiff_t;
+typedef signed char int8_t ;
+typedef signed long long int64_t;
+typedef int8_t GFC_INTEGER_1;
+typedef GFC_INTEGER_1 GFC_LOGICAL_1;
+typedef int64_t GFC_INTEGER_8;
+typedef GFC_INTEGER_8 GFC_LOGICAL_8;
+typedef ptrdiff_t index_type;
+typedef struct descriptor_dimension
+{
+ index_type lower_bound;
+ index_type _ubound;
+}
+descriptor_dimension;
+typedef struct { GFC_LOGICAL_1 *base_addr; size_t offset; index_type dtype; descriptor_dimension dim[7];} gfc_array_l1;
+typedef struct { GFC_LOGICAL_8 *base_addr; size_t offset; index_type dtype; descriptor_dimension dim[7];} gfc_array_l8;
+void
+all_l8 (gfc_array_l8 * const restrict retarray,
+ gfc_array_l1 * const restrict array,
+ const index_type * const restrict pdim)
+{
+ GFC_LOGICAL_8 * restrict dest;
+ index_type n;
+ index_type len;
+ index_type delta;
+ index_type dim;
+ dim = (*pdim) - 1;
+ len = ((array)->dim[dim]._ubound + 1 - (array)->dim[dim].lower_bound);
+ for (n = 0; n < dim; n++)
+ {
+ const GFC_LOGICAL_1 * restrict src;
+ GFC_LOGICAL_8 result;
+ {
+ result = 1;
+ {
+ for (n = 0; n < len; n++, src += delta)
+ {
+ if (! *src)
+ {
+ result = 0;
+ break;
+ }
+ }
+ *dest = result;
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-1.c
new file mode 100644
index 000000000..14a453e04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-1.c
@@ -0,0 +1,352 @@
+/* Test for multiple declarations and composite types. As in bug
+ 13801. Test no problems in debug information generation. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int IA[];
+typedef int A10[10];
+
+/* Test all combinations of: a variable declared at file scope (no
+ type specifiers, or extern, or static), or just inside a function
+ (with extern), redeclared in an inner scope (with extern), and
+ redeclared in an inner scope when the previous declaration is
+ hidden (with extern, and not if the original declaration was
+ static). Test three times: incomplete variable types; pointers to
+ incomplete types; functions returning such pointers.
+
+ This test only includes the valid code cases, to test debug info
+ generation. (Incomplete static at file scope is not permitted by
+ ISO C, but is accepted by GCC as an extension without
+ -pedantic.) */
+
+A10 a5;
+void
+f5 (void)
+{
+ sizeof(a5);
+ {
+ extern IA a5;
+ sizeof(a5);
+ {
+ int a5;
+ {
+ extern A10 a5;
+ sizeof(a5);
+ }
+ }
+ sizeof(a5);
+ }
+ sizeof(a5);
+}
+extern A10 a5;
+
+A10 a7;
+void
+f7 (void)
+{
+ sizeof(a7);
+ {
+ extern A10 a7;
+ sizeof(a7);
+ {
+ int a7;
+ {
+ extern A10 a7;
+ sizeof(a7);
+ }
+ }
+ sizeof(a7);
+ }
+ sizeof(a7);
+}
+extern A10 a7;
+
+extern A10 a13;
+void
+f13 (void)
+{
+ sizeof(a13);
+ {
+ extern IA a13;
+ sizeof(a13);
+ {
+ int a13;
+ {
+ extern A10 a13;
+ sizeof(a13);
+ }
+ }
+ sizeof(a13);
+ }
+ sizeof(a13);
+}
+extern A10 a13;
+
+extern A10 a15;
+void
+f15 (void)
+{
+ sizeof(a15);
+ {
+ extern A10 a15;
+ sizeof(a15);
+ {
+ int a15;
+ {
+ extern A10 a15;
+ sizeof(a15);
+ }
+ }
+ sizeof(a15);
+ }
+ sizeof(a15);
+}
+extern A10 a15;
+
+
+static A10 a18;
+void
+f18 (void)
+{
+ sizeof(a18);
+ {
+ extern IA a18;
+ sizeof(a18);
+ }
+ sizeof(a18);
+}
+extern A10 a18;
+
+static A10 a19;
+void
+f19 (void)
+{
+ sizeof(a19);
+ {
+ extern A10 a19;
+ sizeof(a19);
+ }
+ sizeof(a19);
+}
+extern A10 a19;
+
+A10 *b5;
+void
+g5 (void)
+{
+ sizeof(*b5);
+ {
+ extern IA *b5;
+ sizeof(*b5);
+ {
+ int b5;
+ {
+ extern A10 *b5;
+ sizeof(*b5);
+ }
+ }
+ sizeof(*b5);
+ }
+ sizeof(*b5);
+}
+extern A10 *b5;
+
+A10 *b7;
+void
+g7 (void)
+{
+ sizeof(*b7);
+ {
+ extern A10 *b7;
+ sizeof(*b7);
+ {
+ int b7;
+ {
+ extern A10 *b7;
+ sizeof(*b7);
+ }
+ }
+ sizeof(*b7);
+ }
+ sizeof(*b7);
+}
+extern A10 *b7;
+
+extern A10 *b13;
+void
+g13 (void)
+{
+ sizeof(*b13);
+ {
+ extern IA *b13;
+ sizeof(*b13);
+ {
+ int b13;
+ {
+ extern A10 *b13;
+ sizeof(*b13);
+ }
+ }
+ sizeof(*b13);
+ }
+ sizeof(*b13);
+}
+extern A10 *b13;
+
+extern A10 *b15;
+void
+g15 (void)
+{
+ sizeof(*b15);
+ {
+ extern A10 *b15;
+ sizeof(*b15);
+ {
+ int b15;
+ {
+ extern A10 *b15;
+ sizeof(*b15);
+ }
+ }
+ sizeof(*b15);
+ }
+ sizeof(*b15);
+}
+extern A10 *b15;
+
+static A10 *b18;
+void
+g18 (void)
+{
+ sizeof(*b18);
+ {
+ extern IA *b18;
+ sizeof(*b18);
+ }
+ sizeof(*b18);
+}
+extern A10 *b18;
+
+static A10 *b19;
+void
+g19 (void)
+{
+ sizeof(*b19);
+ {
+ extern A10 *b19;
+ sizeof(*b19);
+ }
+ sizeof(*b19);
+}
+extern A10 *b19;
+
+A10 *c5 (void);
+void
+h5 (void)
+{
+ sizeof(*c5());
+ {
+ extern IA *c5 (void);
+ sizeof(*c5());
+ {
+ int c5;
+ {
+ extern A10 *c5 (void);
+ sizeof(*c5());
+ }
+ }
+ sizeof(*c5());
+ }
+ sizeof(*c5());
+}
+A10 *c5 (void) { return 0; }
+
+A10 *c7 (void);
+void
+h7 (void)
+{
+ sizeof(*c7());
+ {
+ extern A10 *c7 (void);
+ sizeof(*c7());
+ {
+ int c7;
+ {
+ extern A10 *c7 (void);
+ sizeof(*c7());
+ }
+ }
+ sizeof(*c7());
+ }
+ sizeof(*c7());
+}
+A10 *c7 (void) { return 0; }
+
+extern A10 *c13 (void);
+void
+h13 (void)
+{
+ sizeof(*c13());
+ {
+ extern IA *c13 (void);
+ sizeof(*c13());
+ {
+ int c13;
+ {
+ extern A10 *c13 (void);
+ sizeof(*c13());
+ }
+ }
+ sizeof(*c13());
+ }
+ sizeof(*c13());
+}
+extern A10 *c13 (void) { return 0; }
+
+extern A10 *c15 (void);
+void
+h15 (void)
+{
+ sizeof(*c15());
+ {
+ extern A10 *c15 (void);
+ sizeof(*c15());
+ {
+ int c15;
+ {
+ extern A10 *c15 (void);
+ sizeof(*c15());
+ }
+ }
+ sizeof(*c15());
+ }
+ sizeof(*c15());
+}
+extern A10 *c15 (void) { return 0; }
+
+static A10 *c18 (void);
+void
+h18 (void)
+{
+ sizeof(*c18());
+ {
+ extern IA *c18 (void);
+ sizeof(*c18());
+ }
+ sizeof(*c18());
+}
+static A10 *c18 (void) { return 0; }
+
+static A10 *c19 (void);
+void
+h19 (void)
+{
+ sizeof(*c19());
+ {
+ extern A10 *c19 (void);
+ sizeof(*c19());
+ }
+ sizeof(*c19());
+}
+static A10 *c19 (void) { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c
new file mode 100644
index 000000000..2bf661fdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-2.c
@@ -0,0 +1,24 @@
+/* Test for multiple declarations and composite types. As in bug
+ 13801. Illustrates how bug causes correct code to be wrongly
+ diagnosed. Debug test: avoid ICE. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int IA[];
+typedef int A5[5];
+typedef int A10[10];
+
+A10 array10;
+
+A5 *ap;
+void
+f (void)
+{
+ int ap;
+ {
+ extern IA *ap;
+ /* This assignment is valid. */
+ ap = &array10;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-3.c
new file mode 100644
index 000000000..3f0c053a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-3.c
@@ -0,0 +1,12 @@
+/* Test for multiple declarations and composite types. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int y[];
+void
+g (void)
+{
+ extern int y[1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-4.c
new file mode 100644
index 000000000..aac4ee7d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-4.c
@@ -0,0 +1,12 @@
+/* Test for multiple declarations and composite types. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+static int y[];
+void
+g (void)
+{
+ extern int y[1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-5.c
new file mode 100644
index 000000000..b915b3fdf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/redecl-5.c
@@ -0,0 +1,31 @@
+/* Test for multiple declarations and composite types, as in bug
+ 13801. Test types saved from outer scopes are up to date. Debug
+ test. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int x[];
+
+void
+f (void)
+{
+ extern int x[];
+}
+
+int x[10];
+
+void
+g (void)
+{
+ int x;
+ {
+ extern int x[10];
+ }
+}
+
+void
+h (void)
+{
+ sizeof (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/tls-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/tls-1.c
new file mode 100644
index 000000000..a9431ef00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/tls-1.c
@@ -0,0 +1,19 @@
+/* Test that optimized out __thread var doesn't have its location
+ referenced in debug info. */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+static __thread int vara;
+
+int
+foo (int b)
+{
+ return vara + b;
+}
+
+int
+main (void)
+{
+ return foo (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/trivial.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/trivial.c
new file mode 100644
index 000000000..5b125eca9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/trivial.c
@@ -0,0 +1,6 @@
+/* { dg-do run } */
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-1.c
new file mode 100644
index 000000000..414083a09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-1.c
@@ -0,0 +1,34 @@
+/* https://bugzilla.redhat.com/show_bug.cgi?id=521991#c5
+
+ Distilled from Linux XFS source code. foo, inlined into bar, ends
+ up with debug stmts referencing the addressable variable b.
+ Optimization made it non-addressable, and then completely optimized
+ away, before we got a chance to rename (and discard) the occurrence
+ in the debug stmt. When we did, we crashed, attempting to rename
+ an unreference variable. */
+
+/* { dg-do compile } */
+
+static inline int
+foo (void *x, unsigned y)
+{
+ unsigned z = *(unsigned long *) x % y;
+ *(unsigned long *) x = *(unsigned long *) x / y;
+ return z;
+}
+
+struct S
+{
+ unsigned t;
+};
+
+void
+bar (struct S *x, int *y)
+{
+ int a = 0;
+ unsigned long b = x->t;
+ foo (&b, x->t);
+ for (;; a++)
+ if (b)
+ *y = 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-2.c
new file mode 100644
index 000000000..5d44262ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+static int
+bar (void *a, unsigned int b, int n)
+{
+ int c = *(unsigned long *) a % b;
+ *(unsigned long *) a = (int) (*(unsigned long *) a) / b;
+ return c;
+}
+
+int
+foo (unsigned long x, int *y, int z)
+{
+ int level;
+ for (level = 0; level < *y; level++)
+ {
+ bar (&x, z, sizeof (x));
+ if (x)
+ return *y - 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-3.c
new file mode 100644
index 000000000..7d014f1bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/vta-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+int
+foo (void)
+{
+ union { char e[8]; int i; } a, b;
+ char *c, *d;
+ unsigned int i;
+ c = a.e;
+ d = &b.e[sizeof (int) - 1];
+ for (i = 0; i < sizeof (int); i++)
+ {
+ *d = *c++;
+ --d;
+ }
+ return b.i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-1.c
new file mode 100644
index 000000000..348bb92eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-1.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+
+ Source: Neil Booth, 12 Feb 2002.
+
+ In the declaration of proc, x must be parsed as a typedef name (C99
+ 6.7.5.3 p11. Also see C89 DR #009, which was erroneously omitted
+ from C99, and resubmitted as DR #249: if in a parameter
+ declaration, an identifier can be read as a typedef name or a
+ paramter name, it is read as a typedef name). */
+
+/* { dg-do compile } */
+
+typedef int x;
+typedef int y;
+int proc(int (x)); /* x is a typedef, param to proc is a function. */
+int proc2(int x); /* x is an identifier, param is an int. */
+
+/* Parameter to proc3 is unnamed, with type a function that returns
+ int and takes a single argument of type function with one int
+ parameter returning int. In particular, proc3 is not a function
+ that takes a parameter y that is a function with one int parameter
+ returning int. 8-) */
+int proc3(int (y (x)));
+
+int main ()
+{
+ proc (proc2); /* { dg-bogus "integer from pointer" } */
+ return proc3 (proc); /* { dg-bogus "incompatible pointer type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-10.c
new file mode 100644
index 000000000..ec4259bfd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-10.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+void
+f4(const foo x) /* { dg-error "10:unknown type name" } */
+{}
+
+void
+f5(foo x, int i) /* { dg-error "4:unknown type name" } */
+{}
+
+void
+f6(char c, foo x, ...) /* { dg-error "12:unknown type name" } */
+{}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-2.c
new file mode 100644
index 000000000..40d744c92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-2.c
@@ -0,0 +1,16 @@
+/* PR c/7411 */
+/* Contributed by Christian Ehrhardt */
+/* Added extra line-breaks to check that diagnostics refer to correct token.
+ --Per Bothner. */
+/* { dg-do compile } */
+
+void foo(void)
+{
+ char
+ c /* { dg-message "note: previous declaration" } */
+ ;
+ int i;
+ int
+ c /* { dg-error "conflicting types" } */
+ = i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-3.c
new file mode 100644
index 000000000..cba0b906d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-3.c
@@ -0,0 +1,5 @@
+/* PR c/9928 */
+/* { dg-do compile } */
+
+enum { CODES }; /* { dg-message "note: previous definition" } */
+enum { CODES }; /* { dg-error "conflicting types|redeclaration of enumerator" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-4.c
new file mode 100644
index 000000000..ce640c99c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-4.c
@@ -0,0 +1,10 @@
+/* Redeclaration of parameters is an error. PR 13728. */
+/* { dg-do compile } */
+
+void f (int fred, /* { dg-message "note: previous definition" "" } */
+ int fred); /* { dg-error "redefinition of parameter" "" } */
+
+void f2 (int fred, /* { dg-message "note: previous definition" "" } */
+ int fred) /* { dg-error "redefinition of parameter" "" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-5.c
new file mode 100644
index 000000000..9b7782464
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-5.c
@@ -0,0 +1,20 @@
+/* PR c/14114 */
+/* Origin: <snyder@fnal.gov> */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+/* This used to fail because the compiler thought that the
+ declaration of 'c' from 'b' was shadowing that from 'a'. */
+
+void a()
+{
+ void c();
+ c();
+}
+
+void b()
+{
+ void c();
+}
+
+void c() {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-6.c
new file mode 100644
index 000000000..0fd45d3c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-6.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+extern int var;
+
+int foo1(void)
+{
+ extern int var;
+
+ var += 1;
+}
+
+int foo2(void)
+{
+ var += 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-7.c
new file mode 100644
index 000000000..14b67baef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-7.c
@@ -0,0 +1,6 @@
+/* Test diagnostic for array defaulting to one element. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int a[]; /* { dg-warning "array 'a' assumed to have one element" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-8.c
new file mode 100644
index 000000000..485065b7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-8.c
@@ -0,0 +1,10 @@
+/* Test diagnostics for duplicate typedefs. Basic diagnostics. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -pedantic-errors" } */
+
+typedef int I; /* { dg-message "note: previous declaration of 'I' was here" } */
+typedef int I; /* { dg-error "redefinition of typedef 'I'" } */
+
+typedef int I1; /* { dg-message "note: previous declaration of 'I1' was here" } */
+typedef long I1; /* { dg-error "conflicting types for 'I1'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-9.c
new file mode 100644
index 000000000..83793a9a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-9.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+w *x; /* { dg-error "unknown type name 'w'" } */
+
+int z; /* { dg-message "previous declaration of 'z'" } */
+y /* { dg-error "unknown type name 'y'" } */
+ * z; /* { dg-error "conflicting " } */
+
+int f1()
+{
+ int d, e;
+ d * e; /* { dg-bogus "unknown type name 'd'" } */
+ g * h; /* { dg-error "unknown type name 'g'" } */
+ g i; /* { dg-error "unknown type name 'g'" } */
+}
+
+typedef int a;
+
+int f2()
+{
+b: a: ; /* { dg-bogus "a label can only be part of a statement" } */
+c: d e; /* { dg-error "a label can only be part of a statement" } */
+/* { dg-error "unknown type name 'd'" "unknown type name" { target *-*-* } 23 } */
+ ;
+}
+
+void *f3()
+{
+ return x; /* { dg-bogus "'x' undeclared" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-global-ext.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-global-ext.c
new file mode 100644
index 000000000..97ffa7c2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-global-ext.c
@@ -0,0 +1,13 @@
+int merror = 0;
+extern int merror;
+
+void mtherr (int code)
+{
+ merror = code + 1;
+}
+
+int main()
+{
+ mtherr(7);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-1.c
new file mode 100644
index 000000000..5767c3b08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-1.c
@@ -0,0 +1,8 @@
+/* Data definition with no type or storage class should receive a
+ pedwarn, rather than a warning which becomes an error with
+ -pedantic. Test with no options. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+foo(); /* { dg-warning "data definition has no type or storage class" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-2.c
new file mode 100644
index 000000000..ab628949b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-2.c
@@ -0,0 +1,8 @@
+/* Data definition with no type or storage class should receive a
+ pedwarn, rather than a warning which becomes an error with
+ -pedantic. Test with -pedantic. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+foo(); /* { dg-warning "data definition has no type or storage class" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-3.c
new file mode 100644
index 000000000..8fb03ea4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/decl-nospec-3.c
@@ -0,0 +1,8 @@
+/* Data definition with no type or storage class should receive a
+ pedwarn, rather than a warning which becomes an error with
+ -pedantic. Test with -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+foo(); /* { dg-error "data definition has no type or storage class" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c
new file mode 100644
index 000000000..c19f1074e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-1.c
@@ -0,0 +1,27 @@
+/* Test declaration specifiers. Test cases that used to be handled in
+ a loop in grokdeclarator. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+typedef int t;
+
+/* These should all be diagnosed, but only once, not for every
+ identifier declared. */
+struct s0 int x0, /* { dg-error "two or more data types" } */
+x1;
+
+char union u0 x2, /* { dg-error "two or more data types" } */
+x3;
+
+enum e0 struct s1 x4, /* { dg-error "two or more data types" } */
+x5;
+
+short short x6, /* { dg-error "duplicate" } */
+x7;
+
+t int x8, /* { dg-error "two or more data types" } */
+x9;
+
+long long long x10, /* { dg-error "long long long" } */
+x11;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-10.c
new file mode 100644
index 000000000..e6572bd82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-10.c
@@ -0,0 +1,47 @@
+/* Test declaration specifiers. Test various checks on storage class
+ and function specifiers that depend on information about the
+ declaration, not just the specifiers. Test with -pedantic. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+auto void f0 (void) {} /* { dg-warning "function definition declared 'auto'" } */
+register void f1 (void) {} /* { dg-error "function definition declared 'register'" } */
+typedef void f2 (void) {} /* { dg-error "function definition declared 'typedef'" } */
+
+void f3 (auto int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f4 (extern int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f5 (register int);
+void f6 (static int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f7 (typedef int); /* { dg-error "storage class specified for unnamed parameter" } */
+
+auto int x; /* { dg-error "file-scope declaration of 'x' specifies 'auto'" } */
+register int y; /* { dg-warning "file-scope declaration of 'y' specifies 'register'" } */
+
+void h (void) { extern void x (void) {} } /* { dg-error "nested function 'x' declared 'extern'" } */
+/* { dg-warning "ISO C forbids nested functions" "nested" { target *-*-* } 21 } */
+
+void
+g (void)
+{
+ void a; /* { dg-error "variable or field 'a' declared void" } */
+ const void b; /* { dg-error "variable or field 'b' declared void" } */
+ static void c; /* { dg-error "variable or field 'c' declared void" } */
+}
+
+void p;
+const void p1;
+extern void q;
+extern const void q1;
+static void r; /* { dg-error "variable or field 'r' declared void" } */
+static const void r1; /* { dg-error "variable or field 'r1' declared void" } */
+
+register void f8 (void); /* { dg-error "invalid storage class for function 'f8'" } */
+/* { dg-warning "file-scope declaration of 'f8' specifies 'register'" "register function" { target *-*-* } 39 } */
+
+void i (void) { auto void y (void) {} } /* { dg-warning "ISO C forbids nested functions" } */
+/* { dg-warning "function definition declared 'auto'" "nested" { target *-*-* } 42 } */
+
+inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */
+
+/* { dg-message "error: register name not specified for 'y'" "not specified" { target *-*-* } 19 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-11.c
new file mode 100644
index 000000000..9dfe63f99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-11.c
@@ -0,0 +1,47 @@
+/* Test declaration specifiers. Test various checks on storage class
+ and function specifiers that depend on information about the
+ declaration, not just the specifiers. Test with -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+auto void f0 (void) {} /* { dg-error "function definition declared 'auto'" } */
+register void f1 (void) {} /* { dg-error "function definition declared 'register'" } */
+typedef void f2 (void) {} /* { dg-error "function definition declared 'typedef'" } */
+
+void f3 (auto int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f4 (extern int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f5 (register int);
+void f6 (static int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f7 (typedef int); /* { dg-error "storage class specified for unnamed parameter" } */
+
+auto int x; /* { dg-error "file-scope declaration of 'x' specifies 'auto'" } */
+register int y; /* { dg-error "file-scope declaration of 'y' specifies 'register'" } */
+
+void h (void) { extern void x (void) {} } /* { dg-error "nested function 'x' declared 'extern'" } */
+/* { dg-error "ISO C forbids nested functions" "nested" { target *-*-* } 21 } */
+
+void
+g (void)
+{
+ void a; /* { dg-error "variable or field 'a' declared void" } */
+ const void b; /* { dg-error "variable or field 'b' declared void" } */
+ static void c; /* { dg-error "variable or field 'c' declared void" } */
+}
+
+void p;
+const void p1;
+extern void q;
+extern const void q1;
+static void r; /* { dg-error "variable or field 'r' declared void" } */
+static const void r1; /* { dg-error "variable or field 'r1' declared void" } */
+
+register void f8 (void); /* { dg-error "invalid storage class for function 'f8'" } */
+/* { dg-error "file-scope declaration of 'f8' specifies 'register'" "register function" { target *-*-* } 39 } */
+
+void i (void) { auto void y (void) {} } /* { dg-error "ISO C forbids nested functions" } */
+/* { dg-error "function definition declared 'auto'" "nested" { target *-*-* } 42 } */
+
+inline int main (void) { return 0; } /* { dg-error "cannot inline function 'main'" } */
+
+/* { dg-message "error: register name not specified for 'y'" "" { target *-*-* } 19 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-12.c
new file mode 100644
index 000000000..66c153740
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-12.c
@@ -0,0 +1,6 @@
+/* Test type qualifier in empty declaration: OK but useless. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+const struct foo; /* { dg-warning "useless type qualifier in empty declaration" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-13.c
new file mode 100644
index 000000000..a325c0d88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-13.c
@@ -0,0 +1,86 @@
+/* Test declaration specifiers. Test messages for bad type
+ specifiers. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -pedantic" } */
+
+/* typeof should act much like typedef, so the following are
+ invalid. */
+typeof(double) long x0; /* { dg-error "two or more data types in declaration specifiers" } */
+typeof(double) _Complex x1; /* { dg-error "two or more data types in declaration specifiers" } */
+
+/* The following is erroneous, and used to get a bogus message about
+ complex integer types. */
+typedef double D;
+D _Complex x2; /* { dg-error "two or more data types in declaration specifiers" } */
+
+/* The following empty declarations should have problems in their type
+ specifiers diagnosed, not just the general problem that they are
+ empty declarations. */
+long short; /* { dg-error "both 'long' and 'short' in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 20 } */
+_Complex double; /* { dg-warning "ISO C90 does not support complex types" } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 22 } */
+_Complex; /* { dg-warning "ISO C90 does not support complex types" } */
+/* { dg-warning "ISO C does not support plain 'complex' meaning 'double complex'" "ISO C" { target *-*-* } 24 } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 24 } */
+_Complex int; /* { dg-warning "ISO C90 does not support complex types" } */
+/* { dg-warning "ISO C does not support complex integer types" "ISO C" { target *-*-* } 27 } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 27 } */
+
+/* Specific messages for each invalid combination. (That some message
+ is given when appropriate for a larger collection of combinations
+ of type specifiers is tested in *typespec*.c.) */
+
+long double long x3; /* { dg-error "both 'long long' and 'double' in declaration specifiers" } */
+short long x4; /* { dg-error "both 'long' and 'short' in declaration specifiers" } */
+void long x5; /* { dg-error "both 'long' and 'void' in declaration specifiers" } */
+_Bool long x6; /* { dg-error "both 'long' and '_Bool' in declaration specifiers" } */
+char long x7; /* { dg-error "both 'long' and 'char' in declaration specifiers" } */
+float long x8; /* { dg-error "both 'long' and 'float' in declaration specifiers" } */
+long short x9; /* { dg-error "both 'long' and 'short' in declaration specifiers" } */
+void short x10; /* { dg-error "both 'short' and 'void' in declaration specifiers" } */
+_Bool short x11; /* { dg-error "both 'short' and '_Bool' in declaration specifiers" } */
+char short x12; /* { dg-error "both 'short' and 'char' in declaration specifiers" } */
+float short x13; /* { dg-error "both 'short' and 'float' in declaration specifiers" } */
+double short x14; /* { dg-error "both 'short' and 'double' in declaration specifiers" } */
+unsigned signed x15; /* { dg-error "both 'signed' and 'unsigned' in declaration specifiers" } */
+void signed x16; /* { dg-error "both 'signed' and 'void' in declaration specifiers" } */
+_Bool signed x17; /* { dg-error "both 'signed' and '_Bool' in declaration specifiers" } */
+float signed x18; /* { dg-error "both 'signed' and 'float' in declaration specifiers" } */
+double signed x19; /* { dg-error "both 'signed' and 'double' in declaration specifiers" } */
+signed unsigned x20; /* { dg-error "both 'signed' and 'unsigned' in declaration specifiers" } */
+void unsigned x21; /* { dg-error "both 'unsigned' and 'void' in declaration specifiers" } */
+_Bool unsigned x22; /* { dg-error "both 'unsigned' and '_Bool' in declaration specifiers" } */
+float unsigned x23; /* { dg-error "both 'unsigned' and 'float' in declaration specifiers" } */
+double unsigned x24; /* { dg-error "both 'unsigned' and 'double' in declaration specifiers" } */
+void _Complex x25; /* { dg-error "both 'complex' and 'void' in declaration specifiers" } */
+/* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } 57 } */
+_Bool _Complex x26; /* { dg-error "both 'complex' and '_Bool' in declaration specifiers" } */
+/* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } 59 } */
+
+long void x27; /* { dg-error "both 'long' and 'void' in declaration specifiers" } */
+short void x28; /* { dg-error "both 'short' and 'void' in declaration specifiers" } */
+signed void x29; /* { dg-error "both 'signed' and 'void' in declaration specifiers" } */
+unsigned void x30; /* { dg-error "both 'unsigned' and 'void' in declaration specifiers" } */
+_Complex void x31; /* { dg-error "both 'complex' and 'void' in declaration specifiers" } */
+/* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } 66 } */
+/* { dg-warning "ISO C does not support plain 'complex' meaning 'double complex'" "complex" { target *-*-* } 66 } */
+long _Bool x32; /* { dg-error "both 'long' and '_Bool' in declaration specifiers" } */
+short _Bool x33; /* { dg-error "both 'short' and '_Bool' in declaration specifiers" } */
+signed _Bool x34; /* { dg-error "both 'signed' and '_Bool' in declaration specifiers" } */
+unsigned _Bool x35; /* { dg-error "both 'unsigned' and '_Bool' in declaration specifiers" } */
+_Complex _Bool x36; /* { dg-error "both 'complex' and '_Bool' in declaration specifiers" } */
+/* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } 73 } */
+/* { dg-warning "ISO C does not support plain 'complex' meaning 'double complex'" "complex" { target *-*-* } 73 } */
+long char x37; /* { dg-error "both 'long' and 'char' in declaration specifiers" } */
+short char x38; /* { dg-error "both 'short' and 'char' in declaration specifiers" } */
+long float x39; /* { dg-error "both 'long' and 'float' in declaration specifiers" } */
+short float x40; /* { dg-error "both 'short' and 'float' in declaration specifiers" } */
+signed float x41; /* { dg-error "both 'signed' and 'float' in declaration specifiers" } */
+unsigned float x42; /* { dg-error "both 'unsigned' and 'float' in declaration specifiers" } */
+long long double x43; /* { dg-error "both 'long long' and 'double' in declaration specifiers" } */
+/* { dg-warning "ISO C90 does not support 'long long'" "C90" { target *-*-* } 82 } */
+short double x44; /* { dg-error "both 'short' and 'double' in declaration specifiers" } */
+signed double x45; /* { dg-error "both 'signed' and 'double' in declaration specifiers" } */
+unsigned double x46; /* { dg-error "both 'unsigned' and 'double' in declaration specifiers" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-14.c
new file mode 100644
index 000000000..d8ec78c9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-14.c
@@ -0,0 +1,11 @@
+/* Test that "typeof(struct foo)" and similar as declaration
+ specifiers act like typedef. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typeof(struct foo); /* { dg-warning "useless type name in empty declaration" } */
+
+struct bar { int a; } x;
+
+typeof(x); /* { dg-warning "useless type name in empty declaration" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-15.c
new file mode 100644
index 000000000..dc3da61c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-15.c
@@ -0,0 +1,12 @@
+/* Test diagnostic for empty declarations in old-style parameter
+ declarations. Test with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+void
+f (a, b)
+ int; /* { dg-warning "empty declaration" } */
+ register; /* { dg-warning "empty declaration" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-16.c
new file mode 100644
index 000000000..598623930
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-16.c
@@ -0,0 +1,12 @@
+/* Test diagnostic for empty declarations in old-style parameter
+ declarations. Test with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -pedantic" } */
+
+void
+f (a, b)
+ int; /* { dg-warning "empty declaration" } */
+ register; /* { dg-warning "empty declaration" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-17.c
new file mode 100644
index 000000000..d27faa1b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-17.c
@@ -0,0 +1,12 @@
+/* Test diagnostic for empty declarations in old-style parameter
+ declarations. Test with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -pedantic-errors" } */
+
+void
+f (a, b)
+ int; /* { dg-error "empty declaration" } */
+ register; /* { dg-error "empty declaration" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-18.c
new file mode 100644
index 000000000..dd4c262d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-18.c
@@ -0,0 +1,100 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+static t1 *a; /* { dg-error "unknown type name 't1'" } */
+
+int z; /* { dg-message "previous declaration of 'z'" } */
+typedef t2 *z; /* { dg-error "unknown type name 't2'" } */
+/* { dg-error "'z' redeclared " "redeclared" { target *-*-* } 7 } */
+
+extern t3 p1(void); /* { dg-error "unknown type name 't3'" } */
+int p2(const t4 x); /* { dg-error "unknown type name 't4'" } */
+int p3(const t1 x); /* { dg-error "unknown type name 't1'" } */ /* dup??? */
+int p4(t5 (*x)(void)); /* { dg-error "unknown type name 't5'" } */
+int p5(t6 *); /* { dg-error "unknown type name 't6'" } */
+int p6(t7 x); /* { dg-error "unknown type name 't7'" } */
+int p7(t8[]); /* { dg-error "unknown type name 't8'" } */
+int p8(int, t9); /* { dg-error "unknown type name 't9'" } */
+
+struct s {
+ const t1 a; /* { dg-error "unknown type name 't1'" } */ /* dup??? */
+ const t10 b; /* { dg-error "unknown type name 't10'" } */
+ int b; /* { dg-error "duplicate member" } */
+};
+
+typeof (z) c1;
+typeof (x1) c2; /* { dg-error "undeclared" "undeclared" } */
+typeof (const t11) c3; /* { dg-error "unknown type name 't11'" } */
+typeof (t12 *) c3; /* { dg-error "unknown type name 't12'" "t12" { xfail *-*-* } } */
+/* { dg-bogus "unknown type name 'x1'" unknown"" { target *-*-* } 26 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 28 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 28 } */
+
+int recover1;
+
+int s0 = sizeof (z);
+int s1 = sizeof (x2); /* { dg-error "undeclared" "undeclared" } */
+int s2 = sizeof (const t13); /* { dg-error "unknown type name 't13'" } */
+int s3 = sizeof (t14 *); /* { dg-error "unknown type name 't14'" "t14" { xfail *-*-* } } */
+
+int recover2;
+
+/* { dg-bogus "unknown type name 'x2'" "unknown" { target *-*-* } 36 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 38 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 38 } */
+
+int a0 = __alignof__ (z);
+int a1 = __alignof__ (x3); /* { dg-error "undeclared" } */
+int a2 = __alignof__ (const t15); /* { dg-error "unknown type name 't15'" } */
+int a3 = __alignof__ (t16 *); /* { dg-error "unknown type name 't16'" "t16" { xfail *-*-* } } */
+
+int recover3;
+
+/* { dg-bogus "unknown type name 'x3'" "" { target *-*-* } 47 } */
+/* { dg-bogus "undeclared" "undeclared" { xfail *-*-* } 49 } */
+/* { dg-bogus "expected expression before" "expected" { xfail *-*-* } 49 } */
+
+
+/* Cannot detect (undefd_type *) or (undefd_type (*) because it would
+ require 3 tokens of lookahead (same as above). */
+
+const char *f1()
+{
+ return (const t17) "abc"; /* { dg-error "unknown type name 't17'" "t17" } */
+/* { dg-bogus "expected" "expected" { target *-*-* } 63 } */
+}
+
+const char *f2()
+{
+ return (const t18 *) "abc"; /* { dg-error "unknown type name 't18'" "t18" } */
+/* { dg-bogus "expected" "expected" { target *-*-* } 69 } */
+}
+
+
+/* The parser has problems distinguishing semantic and syntactic errors,
+ so it emits a wrong "expected ')'" error here. */
+
+void *f3(int x)
+{
+ return (void *) ((void *(*)(t19)) f3); /* { dg-error "unknown type name 't19'" "t19" } */
+/* { dg-bogus "expected" "expected" { xfail *-*-* } 79 } */
+}
+
+const void *f4()
+{
+ return &((const t20){1}); /* { dg-error "unknown type name 't20'" } */
+/* { dg-bogus "return discards 'const'" "discards" { target *-*-* } 85 } */
+/* { dg-bogus "expected" "expected" { target *-*-* } 85 } */
+}
+
+int f5(__builtin_va_list ap)
+{
+ int x = __builtin_va_arg (ap, t21); /* { dg-error "unknown type name 't21'" } */
+ int y = __builtin_va_arg (ap, const t22); /* { dg-error "unknown type name 't22'" } */
+}
+
+int f6(void)
+{
+ return __builtin_offsetof (t23, field); /* { dg-error "unknown type name 't23'" "t23" } */
+/* { dg-bogus "request for member" "request" { target *-*-* } 98 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-2.c
new file mode 100644
index 000000000..f2c535ad8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-2.c
@@ -0,0 +1,14 @@
+/* Test declaration specifiers. Test cases that used to be handled in
+ a loop in grokdeclarator. Pedantic cases. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -pedantic" } */
+
+/* These should all be diagnosed, but only once, not for every
+ identifier declared. */
+
+const const int x0, /* { dg-warning "duplicate" } */
+x1;
+
+long long x2, /* { dg-warning "long long" } */
+x3;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3-Wextra.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3-Wextra.c
new file mode 100644
index 000000000..66378cc71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3-Wextra.c
@@ -0,0 +1,32 @@
+/* See declspec-3.c . Test -Wold-style-declaration is enabled by -Wextra. */
+/* { dg-do compile } */
+/* { dg-options "-Wextra" } */
+
+static int x0;
+int static x1; /* { dg-warning "not at beginning" } */
+
+extern int x2;
+int extern x3; /* { dg-warning "not at beginning" } */
+
+typedef int x4;
+int typedef x5; /* { dg-warning "not at beginning" } */
+
+void g (int);
+
+void
+f (void)
+{
+ auto int x6 = 0;
+ int auto x7 = 0; /* { dg-warning "not at beginning" } */
+ register int x8 = 0;
+ int register x9 = 0; /* { dg-warning "not at beginning" } */
+ g (x6 + x7 + x8 + x9);
+}
+
+const static int x10; /* { dg-warning "not at beginning" } */
+
+/* Attributes are OK before storage class specifiers, since some
+ attributes are like such specifiers themselves. */
+
+__attribute__((format(printf, 1, 2))) static void h (const char *, ...);
+__attribute__((format(printf, 1, 2))) void static i (const char *, ...); /* { dg-warning "not at beginning" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3-no.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3-no.c
new file mode 100644
index 000000000..678b4f2d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3-no.c
@@ -0,0 +1,32 @@
+/* See declspec-3.c . Test disabling -Wold-style-declaration. */
+/* { dg-do compile } */
+/* { dg-options "-Wextra -Wno-old-style-declaration" } */
+
+static int x0;
+int static x1; /* { dg-bogus "not at beginning" } */
+
+extern int x2;
+int extern x3; /* { dg-bogus "not at beginning" } */
+
+typedef int x4;
+int typedef x5; /* { dg-bogus "not at beginning" } */
+
+void g (int);
+
+void
+f (void)
+{
+ auto int x6 = 0;
+ int auto x7 = 0; /* { dg-bogus "not at beginning" } */
+ register int x8 = 0;
+ int register x9 = 0; /* { dg-bogus "not at beginning" } */
+ g (x6 + x7 + x8 + x9);
+}
+
+const static int x10; /* { dg-bogus "not at beginning" } */
+
+/* Attributes are OK before storage class specifiers, since some
+ attributes are like such specifiers themselves. */
+
+__attribute__((format(printf, 1, 2))) static void h (const char *, ...);
+__attribute__((format(printf, 1, 2))) void static i (const char *, ...); /* { dg-bogus "not at beginning" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3.c
new file mode 100644
index 000000000..95052a986
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-3.c
@@ -0,0 +1,34 @@
+/* Test declaration specifiers. Test diagnosis of storage class
+ specifiers not at start. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-Wold-style-declaration" } */
+
+static int x0;
+int static x1; /* { dg-warning "not at beginning" } */
+
+extern int x2;
+int extern x3; /* { dg-warning "not at beginning" } */
+
+typedef int x4;
+int typedef x5; /* { dg-warning "not at beginning" } */
+
+void g (int);
+
+void
+f (void)
+{
+ auto int x6 = 0;
+ int auto x7 = 0; /* { dg-warning "not at beginning" } */
+ register int x8 = 0;
+ int register x9 = 0; /* { dg-warning "not at beginning" } */
+ g (x6 + x7 + x8 + x9);
+}
+
+const static int x10; /* { dg-warning "not at beginning" } */
+
+/* Attributes are OK before storage class specifiers, since some
+ attributes are like such specifiers themselves. */
+
+__attribute__((format(printf, 1, 2))) static void h (const char *, ...);
+__attribute__((format(printf, 1, 2))) void static i (const char *, ...); /* { dg-warning "not at beginning" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-4.c
new file mode 100644
index 000000000..eb692ca2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-4.c
@@ -0,0 +1,43 @@
+/* Test declaration specifiers. Test empty declarations. Test with
+ no special options. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* If a declaration does not declare a declarator, it must declare a
+ tag or the members of an enumeration, and must only contain one
+ type specifier. */
+
+typedef int T;
+
+struct s0;
+union u0;
+enum e0; /* A GNU extension. */
+enum { E0 };
+enum e1 { E1 };
+
+/* Not declaring anything (pedwarns). */
+struct { int a; }; /* { dg-warning "unnamed struct/union that defines no instances" } */
+int; /* { dg-warning "useless type name in empty declaration" } */
+long; /* { dg-warning "useless type name in empty declaration" } */
+T; /* { dg-warning "useless type name in empty declaration" } */
+static const; /* { dg-warning "useless storage class specifier in empty declaration" } */
+/* { dg-warning "empty declaration" "static const" { target *-*-* } 24 } */
+union { long b; }; /* { dg-warning "unnamed struct/union that defines no instances" } */
+
+/* Multiple type names (errors). */
+struct s1 int; /* { dg-error "two or more data types in declaration specifiers" } */
+char union u1; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "char union" { target *-*-* } 30 } */
+double enum { E2 }; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "double enum" { target *-*-* } 32 } */
+T struct s2; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "T struct" { target *-*-* } 34 } */
+long union u2; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 36 } */
+struct s3 short; /* { dg-error "two or more data types in declaration specifiers" } */
+union u3 signed; /* { dg-error "two or more data types in declaration specifiers" } */
+unsigned struct s4; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 40 } */
+_Complex enum { E3 }; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 42 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-5.c
new file mode 100644
index 000000000..e44412e01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-5.c
@@ -0,0 +1,45 @@
+/* Test declaration specifiers. Test empty declarations. Test with
+ -pedantic. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+/* If a declaration does not declare a declarator, it must declare a
+ tag or the members of an enumeration, and must only contain one
+ type specifier. */
+
+typedef int T;
+
+struct s0;
+union u0;
+enum e0; /* { dg-warning "ISO C forbids forward references" } */
+enum { E0 };
+enum e1 { E1 };
+
+/* Not declaring anything (pedwarns). */
+struct { int a; }; /* { dg-warning "unnamed struct/union that defines no instances" } */
+int; /* { dg-warning "useless type name in empty declaration" } */
+long; /* { dg-warning "useless type name in empty declaration" } */
+T; /* { dg-warning "useless type name in empty declaration" } */
+static const; /* { dg-warning "useless storage class specifier in empty declaration" } */
+/* { dg-warning "empty declaration" "static const" { target *-*-* } 24 } */
+union { long b; }; /* { dg-warning "unnamed struct/union that defines no instances" } */
+
+/* Multiple type names (errors). */
+struct s1 int; /* { dg-error "two or more data types in declaration specifiers" } */
+char union u1; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "char union" { target *-*-* } 30 } */
+double enum { E2 }; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "double enum" { target *-*-* } 32 } */
+T struct s2; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "T struct" { target *-*-* } 34 } */
+long union u2; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 36 } */
+struct s3 short; /* { dg-error "two or more data types in declaration specifiers" } */
+union u3 signed; /* { dg-error "two or more data types in declaration specifiers" } */
+unsigned struct s4; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 40 } */
+_Complex enum { E3 }; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-warning "useless type name in empty declaration" "empty" { target *-*-* } 42 } */
+/* { dg-warning "ISO C90 does not support complex types" "C90" { target *-*-* } 42 } */
+/* { dg-warning "ISO C does not support plain 'complex' meaning 'double complex'" "ISO C" { target *-*-* } 42 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-6.c
new file mode 100644
index 000000000..a20aa94cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-6.c
@@ -0,0 +1,45 @@
+/* Test declaration specifiers. Test empty declarations. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+/* If a declaration does not declare a declarator, it must declare a
+ tag or the members of an enumeration, and must only contain one
+ type specifier. */
+
+typedef int T;
+
+struct s0;
+union u0;
+enum e0; /* { dg-error "ISO C forbids forward references" } */
+enum { E0 };
+enum e1 { E1 };
+
+/* Not declaring anything (pedwarns). */
+struct { int a; }; /* { dg-error "unnamed struct/union that defines no instances" } */
+int; /* { dg-error "useless type name in empty declaration" } */
+long; /* { dg-error "useless type name in empty declaration" } */
+T; /* { dg-error "useless type name in empty declaration" } */
+static const; /* { dg-warning "useless storage class specifier in empty declaration" } */
+/* { dg-error "empty declaration" "static const" { target *-*-* } 24 } */
+union { long b; }; /* { dg-error "unnamed struct/union that defines no instances" } */
+
+/* Multiple type names (errors). */
+struct s1 int; /* { dg-error "two or more data types in declaration specifiers" } */
+char union u1; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-error "useless type name in empty declaration" "char union" { target *-*-* } 30 } */
+double enum { E2 }; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-error "useless type name in empty declaration" "double enum" { target *-*-* } 32 } */
+T struct s2; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-error "useless type name in empty declaration" "T struct" { target *-*-* } 34 } */
+long union u2; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-error "useless type name in empty declaration" "empty" { target *-*-* } 36 } */
+struct s3 short; /* { dg-error "two or more data types in declaration specifiers" } */
+union u3 signed; /* { dg-error "two or more data types in declaration specifiers" } */
+unsigned struct s4; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-error "useless type name in empty declaration" "empty" { target *-*-* } 40 } */
+_Complex enum { E3 }; /* { dg-error "two or more data types in declaration specifiers" } */
+/* { dg-error "useless type name in empty declaration" "empty" { target *-*-* } 42 } */
+/* { dg-error "ISO C90 does not support complex types" "C90" { target *-*-* } 42 } */
+/* { dg-error "ISO C does not support plain 'complex' meaning 'double complex'" "ISO C" { target *-*-* } 42 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-7.c
new file mode 100644
index 000000000..370172468
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-7.c
@@ -0,0 +1,39 @@
+/* Test declaration specifiers. Test checks on storage class
+ specifiers that can be made at parse time rather than for each
+ declarator. Note that __thread is tested in
+ gcc.dg/tls/diag-*.c. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Duplicate specifiers. */
+
+inline inline void f0 (void),
+ f1 (void);
+
+static static int a, /* { dg-error "duplicate 'static'" } */
+ b;
+
+extern extern int c, /* { dg-error "duplicate 'extern'" } */
+ d;
+
+typedef typedef int e, /* { dg-error "duplicate 'typedef'" } */
+ f;
+
+void
+h (void)
+{
+ auto auto int p, /* { dg-error "duplicate 'auto'" } */
+ q;
+
+ register register int r, /* { dg-error "duplicate 'register'" } */
+ s;
+}
+
+/* Multiple specifiers. */
+
+static extern int x, /* { dg-error "multiple storage classes in declaration specifiers" } */
+ y;
+
+extern typedef long z, /* { dg-error "multiple storage classes in declaration specifiers" } */
+ w;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-8.c
new file mode 100644
index 000000000..e1061e85b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-8.c
@@ -0,0 +1,32 @@
+/* Test declaration specifiers. Test checks on storage class
+ specifiers and function specifiers in empty declarations. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* The constraints on storage class specifiers and function specifiers
+ must be met for empty declarations where they are useless. Thus
+ there may be only one storage class specifier (C90 6.5.1, C99
+ 6.7.1#2) and "inline" must not be used because the declaration is
+ not that of an identifier for a function (C99 6.7.4#1), and
+ "register" and "auto" must not be used at file scope (C90 6.7, C99
+ 6.9#2). */
+
+static static struct s; /* { dg-error "duplicate 'static'" } */
+/* { dg-warning "useless storage class specifier in empty declaration" "static static" { target *-*-* } 15 } */
+
+static extern struct t; /* { dg-error "multiple storage classes in declaration specifiers" } */
+/* { dg-warning "useless storage class specifier in empty declaration" "static extern" { target *-*-* } 18 } */
+
+inline union u; /* { dg-error "'inline' in empty declaration" } */
+
+auto struct v; /* { dg-error "'auto' in file-scope empty declaration" } */
+
+register struct w; /* { dg-error "'register' in file-scope empty declaration" } */
+
+void
+f (void)
+{
+ auto union p; /* { dg-warning "useless storage class specifier in empty declaration" } */
+ register struct q; /* { dg-warning "useless storage class specifier in empty declaration" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/declspec-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-9.c
new file mode 100644
index 000000000..7766ed6a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/declspec-9.c
@@ -0,0 +1,43 @@
+/* Test declaration specifiers. Test various checks on storage class
+ and function specifiers that depend on information about the
+ declaration, not just the specifiers. Test with no special
+ options. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+auto void f0 (void) {} /* { dg-warning "function definition declared 'auto'" } */
+register void f1 (void) {} /* { dg-error "function definition declared 'register'" } */
+typedef void f2 (void) {} /* { dg-error "function definition declared 'typedef'" } */
+
+void f3 (auto int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f4 (extern int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f5 (register int);
+void f6 (static int); /* { dg-error "storage class specified for unnamed parameter" } */
+void f7 (typedef int); /* { dg-error "storage class specified for unnamed parameter" } */
+
+auto int x; /* { dg-error "file-scope declaration of 'x' specifies 'auto'" } */
+register int y; /* { dg-error "register name not specified for 'y'" } */
+
+void h (void) { extern void x (void) {} } /* { dg-error "nested function 'x' declared 'extern'" } */
+
+void
+g (void)
+{
+ void a; /* { dg-error "variable or field 'a' declared void" } */
+ const void b; /* { dg-error "variable or field 'b' declared void" } */
+ static void c; /* { dg-error "variable or field 'c' declared void" } */
+}
+
+void p;
+const void p1;
+extern void q;
+extern const void q1;
+static void r; /* { dg-error "variable or field 'r' declared void" } */
+static const void r1; /* { dg-error "variable or field 'r1' declared void" } */
+
+register void f8 (void); /* { dg-error "invalid storage class for function 'f8'" } */
+
+void i (void) { auto void y (void) {} }
+
+inline int main (void) { return 0; } /* { dg-warning "cannot inline function 'main'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/delay-slot-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/delay-slot-1.c
new file mode 100644
index 000000000..bfc0273e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/delay-slot-1.c
@@ -0,0 +1,59 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mabi=64" { target { mips*-*-linux* && mips64 } } } */
+
+struct offset_v1 {
+ int k_uniqueness;
+};
+
+struct offset_v2 {
+ long v;
+} __attribute__ ((__packed__));
+
+struct reiserfs_key {
+ int k_objectid;
+ union {
+ struct offset_v1 k_offset_v1;
+ struct offset_v2 k_offset_v2;
+ } u;
+};
+
+struct item_head
+{
+ struct reiserfs_key ih_key;
+ int ih_version;
+};
+
+static void set_offset_v2_k_type(struct offset_v2 *v2)
+{
+ v2->v &= 1;
+}
+
+static void set_le_key_k_type (int version, struct reiserfs_key * key)
+{
+ version ? (key->u.k_offset_v1.k_uniqueness = 1)
+ : set_offset_v2_k_type(&(key->u.k_offset_v2));
+}
+
+static void set_le_ih_k_type (struct item_head * ih)
+{
+ set_le_key_k_type((__builtin_constant_p((ih)->ih_version) ? (ih)->ih_version : (ih)->ih_version), &(ih->ih_key));
+}
+
+void boo(struct item_head *ih, const char *body);
+
+void direct2indirect(void)
+{
+ struct item_head *p_le_ih;
+ struct item_head ind_ih;
+ unsigned int unfm_ptr;
+
+ if (__builtin_expect(32, 0)) __asm__ ("break");
+
+ set_le_ih_k_type (&ind_ih);
+
+ if (__builtin_constant_p(p_le_ih) ? 1 : 2) {
+ (__builtin_constant_p(__builtin_constant_p(1) == 1));
+ boo(&ind_ih, (char *)&unfm_ptr);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/delay-slot-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/delay-slot-2.c
new file mode 100644
index 000000000..79faf81c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/delay-slot-2.c
@@ -0,0 +1,116 @@
+/* PR rtl-optimization/51187 */
+/* Reported by Jurij Smakov <jurij@wooyd.org> */
+
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+
+extern int printf (__const char *__restrict __format, ...);
+extern void print_c_condition (const char *);
+
+enum decision_type
+{
+ DT_num_insns,
+ DT_mode, DT_code, DT_veclen,
+ DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe,
+ DT_const_int,
+ DT_veclen_ge, DT_dup, DT_pred, DT_c_test,
+ DT_accept_op, DT_accept_insn
+};
+
+struct decision_test
+{
+ struct decision_test *next;
+ enum decision_type type;
+
+ union
+ {
+ int num_insns;
+
+ struct
+ {
+ const char *name;
+ } pred;
+
+ const char *c_test;
+ int veclen;
+ int dup;
+ long intval;
+ int opno;
+
+ struct {
+ int code_number;
+ int lineno;
+ int num_clobbers_to_add;
+ } insn;
+ } u;
+};
+
+enum routine_type {
+ RECOG, SPLIT, PEEPHOLE2
+};
+
+void
+write_cond (struct decision_test *p, int depth,
+ enum routine_type subroutine_type)
+{
+ switch (p->type)
+ {
+ case DT_num_insns:
+ printf ("peep2_current_count >= %d", p->u.num_insns);
+ break;
+
+ case DT_code:
+ printf ("GET_CODE (x%d) == ", depth);
+ break;
+
+ case DT_veclen:
+ printf ("XVECLEN (x%d, 0) == %d", depth, p->u.veclen);
+ break;
+
+ case DT_elt_zero_int:
+ printf ("XINT (x%d, 0) == %d", depth, (int) p->u.intval);
+ break;
+
+ case DT_elt_one_int:
+ printf ("XINT (x%d, 1) == %d", depth, (int) p->u.intval);
+ break;
+
+ case DT_elt_zero_wide:
+ case DT_elt_zero_wide_safe:
+ printf ("XWINT (x%d, 0) == ", depth);
+ print_host_wide_int (p->u.intval);
+ break;
+
+ case DT_const_int:
+ printf ("x%d == const_int_rtx[MAX_SAVED_CONST_INT + (%d)]",
+ depth, (int) p->u.intval);
+ break;
+
+ case DT_veclen_ge:
+ printf ("XVECLEN (x%d, 0) >= %d", depth, p->u.veclen);
+ break;
+
+ case DT_dup:
+ printf ("rtx_equal_p (x%d, operands[%d])", depth, p->u.dup);
+ break;
+
+ case DT_pred:
+ printf ("%s (x%d)", p->u.pred.name, depth);
+ break;
+
+ case DT_c_test:
+ print_c_condition (p->u.c_test);
+ break;
+
+ case DT_accept_insn:
+ ((void)(__builtin_expect(!(subroutine_type == RECOG), 0) ? __builtin_unreachable(), 0 : 0));
+ ((void)(__builtin_expect(!(p->u.insn.num_clobbers_to_add), 0) ? __builtin_unreachable(), 0 : 0));
+ printf ("pnum_clobbers != NULL");
+ break;
+
+ default:
+ __builtin_unreachable();
+ }
+}
+
+/* { dg-final { scan-assembler "printf" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-2.c
new file mode 100644
index 000000000..c4ca8a272
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-2.c
@@ -0,0 +1,7 @@
+/* Test __attribute__((deprecated)). Test types without names. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct { int a; } __attribute__((deprecated)) x; /* { dg-warning "type is deprecated" } */
+typeof(x) y; /* { dg-warning "type is deprecated" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-3.c
new file mode 100644
index 000000000..2c35bb314
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-3.c
@@ -0,0 +1,11 @@
+/* Test __attribute__((deprecated)). Test merging with multiple
+ declarations. Bug 7425. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void func(void);
+void func(void) __attribute__((deprecated));
+
+void f(void) {
+ func(); /* { dg-warning "'func' is deprecated" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-4.c
new file mode 100644
index 000000000..f36dbdf9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-4.c
@@ -0,0 +1,88 @@
+/* Test __attribute__ ((deprecated("message"))) */
+/* { dg-do compile } */
+/* { dg-options "-Wdeprecated-declarations" } */
+
+typedef int INT1 __attribute__((deprecated("Please avoid INT1")));
+typedef INT1 INT2 __attribute__ ((__deprecated__("Please avoid INT2")));
+
+typedef INT1 INT1a; /* { dg-warning "'INT1' is deprecated: Please avoid INT1" "" } */
+typedef INT1 INT1b __attribute__ ((deprecated("Please avoid INT1b")));
+
+INT1 should_be_unavailable; /* { dg-warning "'INT1' is deprecated: Please avoid INT1" "" } */
+INT1a should_not_be_deprecated;
+
+INT1 f1(void) __attribute__ ((deprecated("Please avoid f1")));
+INT1 f2(void) { return 0; } /* { dg-warning "'INT1' is deprecated: Please avoid INT1" "" } */
+
+INT2 f3(void) __attribute__ ((__deprecated__("Please avoid f3")));
+INT2 f4(void) { return 0; } /* { dg-warning "'INT2' is deprecated: Please avoid INT2" "" } */
+int f5(INT2 x); /* { dg-warning "'INT2' is deprecated: Please avoid INT2" "" } */
+int f6(INT2 x) __attribute__ ((__deprecated__("Please avoid f6"))); /* { dg-warning "'INT2' is deprecated: Please avoid INT2" "" } */
+
+typedef enum {red, green, blue} Color __attribute__((deprecated("Please avoid Color")));
+
+int g1;
+int g2 __attribute__ ((deprecated("Please avoid g2")));
+int g3 __attribute__ ((__deprecated__("Please avoid g3")));
+Color k; /* { dg-warning "'Color' is deprecated .declared at \[^\n\]*: Please avoid Color" "" } */
+
+typedef struct {
+ int field1;
+ int field2 __attribute__ ((deprecated("Please avoid field2")));
+ int field3;
+ int field4 __attribute__ ((__deprecated__("Please avoid field4")));
+ union {
+ int field5;
+ int field6 __attribute__ ((deprecated("Please avoid field6")));
+ } u1;
+ int field7:1;
+ int field8:1 __attribute__ ((deprecated("Please avoid field8")));
+ union {
+ int field9;
+ int field10;
+ } u2 __attribute__ ((deprecated("Please avoid u2")));
+} S1;
+
+int func1()
+{
+ INT1 w; /* { dg-warning "'INT1' is deprecated: Please avoid INT1" "" } */
+ int x __attribute__ ((deprecated("Avoid x")));
+ int y __attribute__ ((__deprecated__("Bad y")));
+ int z;
+ int (*pf)() = f1; /* { dg-warning "'f1' is deprecated .declared at \[^\n\]*: Please avoid f1" "" } */
+
+ z = w + x + y + g1 + g2 + g3; /* { dg-warning "'x' is deprecated .declared at \[^\n\]*: Avoid x" "" } */
+ /* { dg-warning "'y' is deprecated .declared at \[^\n\]*: Bad y" "y" { target *-*-* } 54 } */
+ /* { dg-warning "'g2' is deprecated .declared at \[^\n\]*: Please avoid g2" "g2" { target *-*-* } 54 } */
+ /* { dg-warning "'g3' is deprecated .declared at \[^\n\]*: Please avoid g3" "g3" { target *-*-* } 54 } */
+ return f1(); /* { dg-warning "'f1' is deprecated .declared at \[^\n\]*: Please avoid f1" "" } */
+}
+
+int func2(S1 *p)
+{
+ S1 lp;
+
+ if (p->field1)
+ return p->field2; /* { dg-warning "'field2' is deprecated .declared at \[^\n\]*: Please avoid field2" "" } */
+ else if (lp.field4) /* { dg-warning "'field4' is deprecated .declared at \[^\n\]*: Please avoid field4" "" } */
+ return p->field3;
+
+ p->u1.field5 = g1 + p->field7;
+ p->u2.field9; /* { dg-warning "'u2' is deprecated .declared at \[^\n\]*: Please avoid u2" "" } */
+ return p->u1.field6 + p->field8; /* { dg-warning "'field6' is deprecated .declared at \[^\n\]*: Please avoid field6" "" } */
+ /* { dg-warning "'field8' is deprecated .declared at \[^\n\]*: Please avoid field8" "field8" { target *-*-* } 72 } */
+}
+
+struct SS1 {
+ int x;
+ INT1 y; /* { dg-warning "'INT1' is deprecated: Please avoid INT1" "" } */
+} __attribute__ ((deprecated("Please avoid SS1")));
+
+struct SS1 *p1; /* { dg-warning "'SS1' is deprecated .declared at \[^\n\]*: Please avoid SS1" "" } */
+
+struct __attribute__ ((__deprecated__("Please avoid SS2"))) SS2 {
+ int x;
+ INT1 y; /* { dg-warning "'INT1' is deprecated: Please avoid INT1" "" } */
+};
+
+struct SS2 *p2; /* { dg-warning "'SS2' is deprecated .declared at \[^\n\]*: Please avoid SS2" "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-5.c
new file mode 100644
index 000000000..133e60e40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-5.c
@@ -0,0 +1,7 @@
+/* Test __attribute__((deprecated)). Test types without names. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct { int a; } __attribute__((deprecated ("Do not use"))) x; /* { dg-warning "type is deprecated" } */
+typeof(x) y; /* { dg-warning "type is deprecated .declared at .*.: Do not use" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-6.c
new file mode 100644
index 000000000..874e1a68e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated-6.c
@@ -0,0 +1,11 @@
+/* Test __attribute__((deprecated)). Test merging with multiple
+ declarations. Bug 7425. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void func(void);
+void func(void) __attribute__((deprecated ("Do not use")));
+
+void f(void) {
+ func(); /* { dg-warning "'func' is deprecated .declared at .*.: Do not use" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/deprecated.c b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated.c
new file mode 100644
index 000000000..6ca95d42a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/deprecated.c
@@ -0,0 +1,117 @@
+/* Test __attribute__ ((deprecated)) */
+/* { dg-do compile } */
+/* { dg-options "-Wdeprecated-declarations" } */
+
+#if 1
+typedef int INT1 __attribute__((deprecated));
+typedef INT1 INT2 __attribute__ ((__deprecated__));
+
+typedef INT1 INT1a; /* { dg-warning "'INT1' is deprecated" "" } */
+typedef INT1 INT1b __attribute__ ((deprecated));
+
+INT1 should_be_unavailable; /* { dg-warning "'INT1' is deprecated" "" } */
+INT1a should_not_be_deprecated;
+
+INT1 f1(void) __attribute__ ((deprecated));
+INT1 f2(void) { return 0; } /* { dg-warning "'INT1' is deprecated" "" } */
+
+INT2 f3(void) __attribute__ ((__deprecated__));
+INT2 f4(void) { return 0; } /* { dg-warning "'INT2' is deprecated" "" } */
+int f5(INT2 x); /* { dg-warning "'INT2' is deprecated" "" } */
+int f6(INT2 x) __attribute__ ((__deprecated__)); /* { dg-warning "'INT2' is deprecated" "" } */
+
+typedef enum {red, green, blue} Color __attribute__((deprecated));
+
+int g1;
+int g2 __attribute__ ((deprecated));
+int g3 __attribute__ ((__deprecated__));
+Color k; /* { dg-warning "'Color' is deprecated" "" } */
+
+typedef struct {
+ int field1;
+ int field2 __attribute__ ((deprecated));
+ int field3;
+ int field4 __attribute__ ((__deprecated__));
+ union {
+ int field5;
+ int field6 __attribute__ ((deprecated));
+ } u1;
+ int field7:1;
+ int field8:1 __attribute__ ((deprecated));
+ union {
+ int field9;
+ int field10;
+ } u2 __attribute__ ((deprecated));
+} S1;
+
+int func1()
+{
+ INT1 w; /* { dg-warning "'INT1' is deprecated" "" } */
+ int x __attribute__ ((deprecated));
+ int y __attribute__ ((__deprecated__));
+ int z;
+ int (*pf)() = f1; /* { dg-warning "'f1' is deprecated" "" } */
+
+ z = w + x + y + g1 + g2 + g3; /* { dg-warning "'x' is deprecated" "" } */
+ /* { dg-warning "'y' is deprecated" "y" { target *-*-* } 55 } */
+ /* { dg-warning "'g2' is deprecated" "g2" { target *-*-* } 55 } */
+ /* { dg-warning "'g3' is deprecated" "g3" { target *-*-* } 55 } */
+ return f1(); /* { dg-warning "'f1' is deprecated" "f1" } */
+}
+
+int func2(S1 *p)
+{
+ S1 lp;
+
+ if (p->field1)
+ return p->field2; /* { dg-warning "'field2' is deprecated" "" } */
+ else if (lp.field4) /* { dg-warning "'field4' is deprecated" "" } */
+ return p->field3;
+
+ p->u1.field5 = g1 + p->field7;
+ p->u2.field9; /* { dg-warning "'u2' is deprecated" "" } */
+ return p->u1.field6 + p->field8; /* { dg-warning "'field6' is deprecated" "" } */
+ /* { dg-warning "'field8' is deprecated" "field8" { target *-*-* } 73 } */
+}
+
+struct SS1 {
+ int x;
+ INT1 y; /* { dg-warning "'INT1' is deprecated" "" } */
+} __attribute__ ((deprecated));
+
+struct SS1 *p1; /* { dg-warning "'SS1' is deprecated" "" } */
+
+struct __attribute__ ((__deprecated__)) SS2 {
+ int x;
+ INT1 y; /* { dg-warning "'INT1' is deprecated" "" } */
+};
+
+struct SS2 *p2; /* { dg-warning "'SS2' is deprecated" "" } */
+#endif
+
+#ifdef __cplusplus
+class T {
+ public:
+ void member1(int) __attribute__ ((deprecated));
+ void member2(INT1) __attribute__ ((__deprecated__));
+ int member3(T *);
+ int x;
+} __attribute__ ((deprecated));
+
+T *p2;
+
+inline void T::member1(int) {}
+
+int T::member2(T *p)
+{
+ p->member1(1); /* { xxdg-warning "'member1' is deprecated" "" } */
+ (*p).member1(2); /* { xxdg-warning "'member1' is deprecated" "" } */
+ p->member2(1); /* { xxdg-warning "'member2' is deprecated" "" } */
+ (*p).member2(2); /* { xxdg-warning "'member2' is deprecated" "" } */
+ p->member3(p);
+ (*p).member3(p);
+ return f1(); /* { xxdg-warning "'f1' is deprecated" "" } */
+}
+#endif
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/Wbad-function-cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/Wbad-function-cast-1.c
new file mode 100644
index 000000000..99d8f0655
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/Wbad-function-cast-1.c
@@ -0,0 +1,44 @@
+/* Test operation of -Wbad-function-cast. */
+/* Based on gcc.dg/Wbad-function-cast-1.c. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wbad-function-cast" } */
+
+int if1(void);
+char if2(void);
+long if3(void);
+float rf1(void);
+double rf2(void);
+_Decimal32 rf3(void);
+_Decimal64 rf4(void);
+_Decimal128 rf5(void);
+_Complex double cf(void);
+
+void
+foo(void)
+{
+ /* Casts to void types are always OK. */
+ (void)rf3();
+ (void)rf4();
+ (void)rf5();
+ (const void)rf3();
+ /* Casts to the same type or similar types are OK. */
+ (_Decimal32)rf1();
+ (_Decimal64)rf2();
+ (_Decimal128)rf3();
+ (_Decimal128)rf4();
+ (_Decimal128)rf5();
+ (float)rf3();
+ (double)rf4();
+ (long double)rf5();
+ /* Casts to types with different TREE_CODE (which is how this
+ warning has been defined) are not OK, except for casts to void
+ types. */
+ (_Decimal32)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Decimal32'" } */
+ (_Decimal64)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Decimal64'" } */
+ (_Decimal128)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Decimal128'" } */
+ (int)rf3(); /* { dg-warning "cast from function call of type '_Decimal32' to non-matching type 'int'" } */
+ (long)rf4(); /* { dg-warning "cast from function call of type '_Decimal64' to non-matching type 'long int'" } */
+ (long int)rf5(); /* { dg-warning "cast from function call of type '_Decimal128' to non-matching type 'long int'" } */
+ (_Decimal32)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Decimal32'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c
new file mode 100644
index 000000000..2436afc8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c
@@ -0,0 +1,46 @@
+/* Test messages for -Wtraditional-conversion
+ (based on gcc.dg/Wtraditional-conversion-2.c). */
+
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional-conversion" } */
+
+void fsi(signed int);
+void fd32(_Decimal32);
+void fd64(_Decimal64);
+void fd128(_Decimal128);
+
+struct s {
+ void (*fsi)(signed int);
+ void (*fd32)(_Decimal32);
+ void (*fd64)(_Decimal64);
+ void (*fd128)(_Decimal128);
+} x;
+
+signed int si;
+unsigned int ui;
+_Decimal32 d32;
+_Decimal64 d64;
+_Decimal128 d128;
+
+void
+g (void)
+{
+ fsi(d32); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
+ x.fsi(d32); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
+ fsi(d64); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
+ x.fsi(d64); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
+ fsi(d128); /* { dg-warning "passing argument 1 of 'fsi' as integer rather than floating due to prototype" } */
+ x.fsi(d128); /* { dg-warning "passing argument 1 of 'x.fsi' as integer rather than floating due to prototype" } */
+ fd32(si); /* { dg-warning "passing argument 1 of 'fd32' as floating rather than integer due to prototype" } */
+ x.fd32(si); /* { dg-warning "passing argument 1 of 'x.fd32' as floating rather than integer due to prototype" } */
+ fd64(ui); /* { dg-warning "passing argument 1 of 'fd64' as floating rather than integer due to prototype" } */
+ x.fd64(ui); /* { dg-warning "passing argument 1 of 'x.fd64' as floating rather than integer due to prototype" } */
+ fd128(si); /* { dg-warning "passing argument 1 of 'fd128' as floating rather than integer due to prototype" } */
+ x.fd128(ui); /* { dg-warning "passing argument 1 of 'x.fd128' as floating rather than integer due to prototype" } */
+ fd32(1.0); /* { dg-warning "passing argument 1 of 'fd32' as '_Decimal32' rather than 'double' due to prototype" } */
+ x.fd32(1.0); /* { dg-warning "passing argument 1 of 'x.fd32' as '_Decimal32' rather than 'double' due to prototype" } */
+ fd64(1.0); /* { dg-warning "passing argument 1 of 'fd64' as '_Decimal64' rather than 'double' due to prototype" } */
+ x.fd64(1.0); /* { dg-warning "passing argument 1 of 'x.fd64' as '_Decimal64' rather than 'double' due to prototype" } */
+ fd128(1.0); /* { dg-warning "passing argument 1 of 'fd128' as '_Decimal128' rather than 'double' due to prototype" } */
+ x.fd128(1.0); /* { dg-warning "passing argument 1 of 'x.fd128' as '_Decimal128' rather than 'double' due to prototype" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/altivec-types.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/altivec-types.c
new file mode 100644
index 000000000..e11ddc5e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/altivec-types.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */
+/* { dg-options "-maltivec" } */
+
+/* GNU extension: PowerPC AltiVec Built-in Functions.
+ These should be rejected as invalid AltiVec types. */
+
+__vector _Decimal32 vd32; /* { dg-error "AltiVec types" "" } */
+__vector _Decimal64 vd64; /* { dg-error "AltiVec types" "" } */
+__vector _Decimal128 vd128; /* { dg-error "AltiVec types" "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/builtin-complex.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/builtin-complex.c
new file mode 100644
index 000000000..6bb2ec738
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/builtin-complex.c
@@ -0,0 +1,10 @@
+/* Test __builtin_complex errors with DFP. */
+/* { dg-do compile } */
+
+_Decimal32 a, b;
+
+void
+f (void)
+{
+ __builtin_complex (a, b); /* { dg-error "not of real binary floating-point type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/cast-bad.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/cast-bad.c
new file mode 100644
index 000000000..e9e31ff30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/cast-bad.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+
+/* C99 6.5.4 Cast operators.
+ Test invalid casts involving decimal float. */
+
+struct s { _Decimal32 d32; } sv;
+union u { _Decimal32 d32; } uv;
+
+_Decimal32 d32;
+_Decimal64 d64;
+_Decimal128 d128;
+
+_Decimal32* d32p;
+_Decimal64* d64p;
+_Decimal128* d128p;
+
+void
+f (void)
+{
+ (_Decimal32 []) d32p; /* { dg-error "cast specifies array type" } */
+ (_Decimal32 ()) d32p; /* { dg-error "cast specifies function type" } */
+ (_Decimal64 []) d64p; /* { dg-error "cast specifies array type" } */
+ (_Decimal64 ()) d64p; /* { dg-error "cast specifies function type" } */
+ (_Decimal128 []) d128p; /* { dg-error "cast specifies array type" } */
+ (_Decimal128 ()) d128p; /* { dg-error "cast specifies function type" } */
+
+ (struct s) d32; /* { dg-error "conversion to non-scalar type requested" } */
+ (union u) d32;
+ (struct s) d64; /* { dg-error "conversion to non-scalar type requested" } */
+ (union u) d64; /* { dg-error "cast to union type from type not present in union" } */
+ (struct s) d128; /* { dg-error "conversion to non-scalar type requested" } */
+ (union u) d128; /* { dg-error "cast to union type from type not present in union" } */
+
+ (_Decimal32) sv; /* { dg-error "aggregate value used where a float was expected" } */
+ (_Decimal32) uv; /* { dg-error "aggregate value used where a float was expected" } */
+ (_Decimal64) sv; /* { dg-error "aggregate value used where a float was expected" } */
+ (_Decimal64) uv; /* { dg-error "aggregate value used where a float was expected" } */
+ (_Decimal128) sv; /* { dg-error "aggregate value used where a float was expected" } */
+ (_Decimal128) uv; /* { dg-error "aggregate value used where a float was expected" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/composite-type.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/composite-type.c
new file mode 100644
index 000000000..6bf35f5c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/composite-type.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wall -ftrack-macro-expansion=0" } */
+
+/* C99 6.2.7: Compatible type and composite type. */
+
+#define DECIMAL_COMPOSITE_DECL(TYPE) \
+ _Decimal##TYPE g1_##TYPE(); \
+ _Decimal##TYPE g2_##TYPE(); \
+ _Decimal##TYPE (*h1_##TYPE)[2]; \
+ _Decimal##TYPE (*h2_##TYPE)[3]; \
+ _Decimal##TYPE (*h3_##TYPE)[4]; \
+ _Decimal##TYPE f1_##TYPE(_Decimal##TYPE(*)()); \
+ _Decimal##TYPE f1_##TYPE(_Decimal##TYPE(*)(_Decimal##TYPE*)); \
+ _Decimal##TYPE f1_##TYPE (_Decimal##TYPE(*g)(_Decimal##TYPE*)) \
+ { \
+ _Decimal##TYPE d##TYPE; \
+ d##TYPE = ((_Decimal##TYPE (*) (_Decimal##TYPE*)) g)(&d##TYPE); \
+ d##TYPE = ((_Decimal##TYPE (*) ()) g); \
+ return d##TYPE; \
+ } \
+ _Decimal##TYPE f2_##TYPE(_Decimal##TYPE(*)[]); \
+ _Decimal##TYPE f2_##TYPE(_Decimal##TYPE(*)[3]);
+
+#define DECIMAL_COMPOSITE_TEST(TYPE) \
+do \
+{ \
+ _Decimal##TYPE d##TYPE; \
+ d##TYPE = f1_##TYPE(g1_##TYPE); \
+ d##TYPE = f1_##TYPE(g2_##TYPE); \
+ d##TYPE = f2_##TYPE(h1_##TYPE); \
+ d##TYPE = f2_##TYPE(h2_##TYPE); \
+ d##TYPE = f2_##TYPE(h3_##TYPE); \
+ (void) d##TYPE; \
+} while(0)
+
+DECIMAL_COMPOSITE_DECL(32); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 36 } */
+
+
+DECIMAL_COMPOSITE_DECL(64); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 40 } */
+
+
+DECIMAL_COMPOSITE_DECL(128); /* { dg-error "incompatible types when assigning to type '\[^\n\]*' from type '\[^\n\]*'" } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 44 } */
+
+
+int main()
+{
+ DECIMAL_COMPOSITE_TEST(32); /* { dg-warning "incompatible pointer type" } */
+ DECIMAL_COMPOSITE_TEST(64); /* { dg-warning "incompatible pointer type" } */
+ DECIMAL_COMPOSITE_TEST(128); /* { dg-warning "incompatible pointer type" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-c99.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-c99.c
new file mode 100644
index 000000000..6a48bf501
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-c99.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Wno-overflow" } */
+
+/* N1150 6: Constants.
+ C99 6.4.4.2: Floating constants. */
+
+_Decimal32 a = 1.1df; /* { dg-error "" } */
+_Decimal32 b = -.003DF; /* { dg-error "" } */
+_Decimal64 c = 11e-1dl; /* { dg-error "" } */
+_Decimal64 d = -.3DL; /* { dg-error "" } */
+_Decimal128 e = 000.3e0dl; /* { dg-error "" } */
+_Decimal128 f = 3000300030003e0DL; /* { dg-error "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-hex.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-hex.c
new file mode 100644
index 000000000..980eae012
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-hex.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+/* N1150 6: Constants.
+ C99 6.4.4.2: Floating constants.
+
+ The df, dd, dl, DF, DD and DL suffixes shall not be used in a
+ hexadecimal-floating-constant. */
+
+_Decimal32 bad1 = 0x1.0p1df; /* { dg-error "invalid suffix" "hexadecimal floating constant" } */
+_Decimal32 bad2 = 0x1.0p1DF; /* { dg-error "invalid suffix" "hexadecimal floating constant" } */
+_Decimal64 bad3 = 0x2.0p-2dd; /* { dg-error "invalid suffix" "hexadecimal floating constant" } */
+_Decimal64 bad4 = 0x2.0p2DD; /* { dg-error "invalid suffix" "hexadecimal floating constant" } */
+_Decimal128 bad5 = 0x3.0p3dl; /* { dg-error "invalid suffix" "hexadecimal floating constant" } */
+_Decimal128 bad6 = 0x3.0p3DL; /* { dg-error "invalid suffix" "hexadecimal floating constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-pedantic.c
new file mode 100644
index 000000000..be81b0fc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants-pedantic.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+/* N1150 6: Constants.
+ C99 6.4.4.2: Floating constants. */
+
+#include "dfp-dbg.h"
+
+_Decimal32 a = 1.1df; /* { dg-warning "GCC extension|ISO C" } */
+_Decimal32 b = -.003DF; /* { dg-warning "GCC extension|ISO C" } */
+_Decimal64 c = 11e-1dl; /* { dg-warning "GCC extension|ISO C" } */
+_Decimal64 d = -.3DL; /* { dg-warning "GCC extension|ISO C" } */
+_Decimal128 e = 000.3e0dl; /* { dg-warning "GCC extension|ISO C" } */
+_Decimal128 f = 3000300030003e0DL; /* { dg-warning "GCC extension|ISO C" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants.c
new file mode 100644
index 000000000..bb61ea335
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/constants.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+/* N1150 6: Constants.
+ C99 6.4.4.2: Floating constants. */
+
+_Decimal32 a = 1.1df;
+_Decimal32 b = -.003DF;
+_Decimal64 c = 11e-1dl;
+_Decimal64 d = -.3DL;
+_Decimal128 e = 000.3e0dl;
+_Decimal128 f = 3000300030003e0DL;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-complex.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-complex.c
new file mode 100644
index 000000000..76eef87cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-complex.c
@@ -0,0 +1,118 @@
+/* { dg-options "-O3" } */
+
+/* N1150 5.3 Conversions between decimal floating and complex.
+ C99 6.3.1.7 Conversions, arithmetic operands, real and complex. */
+
+#include "dfp-dbg.h"
+
+int
+main ()
+{
+ _Complex float cf;
+ _Complex double cd;
+ _Complex long double cld;
+
+ _Decimal32 d32;
+ _Decimal64 d64;
+ _Decimal128 d128;
+
+ cf = 2.0f * __extension__ 1i + 3.0f;
+ cd = 2.0 * __extension__ 1i + 3.0;
+ cld = 2.0l * __extension__ 1i + 3.0l;
+
+ /* Convert complex to decimal floating. */
+ d32 = cf;
+ d64 = cd;
+ d128 = cld;
+
+ if (d32 != 3.0DF)
+ FAILURE
+ if (d64 != 3.0dd)
+ FAILURE
+ if (d128 != 3.0dl)
+ FAILURE
+
+ /* Convert decimal floating to complex. */
+ d32 = 2.5DF;
+ d64 = 1.5DD;
+ d128 = 2.5DL;
+
+ cf = d32;
+ cd = d64;
+ cld = d128;
+
+ /* N1107 5.3 Conversions between decimal floating and complex.
+ When a value of decimal floating type converted to a complex
+ type, the real part of the complex result value is undermined
+ by the rules of conversions in N1107 5.2 and the imaginary part
+ of the complex result value is zero. */
+
+ if (__real__ cf != 2.5f)
+ FAILURE
+ if (__real__ cd !=1.5)
+ FAILURE
+ if (__real__ cld != 2.5)
+ FAILURE
+ if (__imag__ cf != 0.0f)
+ FAILURE
+ if (__imag__ cd != 0.0)
+ FAILURE
+ if (__imag__ cld != 0.0l)
+ FAILURE
+
+ /* Verify that the conversions from DFP types to complex is
+ determined by the rules of conversion to the real part. */
+
+ /* Convert _Decimal64 to _Complex float. */
+ d64 = 0.125dl;
+ cf = d64;
+ if (__real__ cf != 0.125f)
+ FAILURE
+ /* Convert _Decimal128 to _Complex double. */
+ d128 = 1.25E-7dl;
+ cd = d128;
+ if (__real__ cd != 1.25E-7)
+ FAILURE
+
+ /* Verify that conversion from complex to decimal floating types
+ results in the value of the real part converted to the result
+ type according to the rules of conversion between those types. */
+
+ /* Convert _Complex float to decimal float types. */
+ cf = 2.0f * __extension__ 1i + 2.25f;
+ d32 = cf;
+ d64 = cf;
+ d128 = cf;
+ if (d32 != 2.25DF)
+ FAILURE
+ if (d64 != 2.25DD)
+ FAILURE
+ if (d128 != 2.25DL)
+ FAILURE
+
+ /* Convert _Complex double to decimal float types. */
+ cd = 2.0 * __extension__ 1i + 1.25;
+ d32 = cd;
+ d64 = cd;
+ d128 = cd;
+ if (d32 != 1.25DF)
+ FAILURE
+ if (d64 != 1.25DD)
+ FAILURE
+ if (d128 != 1.25DL)
+ FAILURE
+
+ /* Convert _Complex long double to decimal float types. */
+ cld = 2.0l * __extension__ 1i + 0.0625l;
+ d32 = cld;
+ d64 = cld;
+ d128 = cld;
+ if (d32 != 0.0625DF)
+ FAILURE
+ if (d64 != 0.0625DD)
+ FAILURE
+ if (d128 != 0.0625DL)
+ FAILURE
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c
new file mode 100644
index 000000000..6727e800c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-dfp-round-thread.c
@@ -0,0 +1,494 @@
+/* { dg-options "-std=gnu99 -D_GNU_SOURCE -pthread" } */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
+
+/* N1150 5.2: Conversions among decimal floating types and between
+ decimal floating types and generic floating types.
+ C99 6.3.1.5(3) New.
+
+ Perform conversions between DFP types in which the assigned value
+ cannot be represented exactly in the result and must be rounded
+ correctly according to the current rounding mode.
+
+ Normally this would not be part of compiler testing, but conversions
+ are currently handled in libgcc via decNumber. */
+
+#include <pthread.h>
+#include <error.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stddef.h>
+#include "dfp-round.h"
+
+extern void abort (void);
+static __thread int failcnt = 0;
+
+/* Support compiling the test to report individual failures; default is
+ to abort as soon as a check fails. */
+#ifdef DBG
+#include <stdio.h>
+#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; }
+#else
+#define FAILURE abort ();
+#endif
+
+pthread_mutex_t mut1 = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t mut2 = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t mut3 = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t mut4 = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t mut5 = PTHREAD_MUTEX_INITIALIZER;
+pthread_cond_t cond1 = PTHREAD_COND_INITIALIZER;
+pthread_cond_t cond2 = PTHREAD_COND_INITIALIZER;
+pthread_cond_t cond3 = PTHREAD_COND_INITIALIZER;
+pthread_cond_t cond4 = PTHREAD_COND_INITIALIZER;
+pthread_cond_t cond5 = PTHREAD_COND_INITIALIZER;
+pthread_barrier_t bar1;
+pthread_barrier_t bar2;
+pthread_barrier_t bar3;
+pthread_barrier_t bar4;
+pthread_barrier_t bar5;
+
+__thread _Decimal32 d32;
+__thread _Decimal64 d64;
+__thread _Decimal128 d128;
+
+_Decimal32 d64_to_d32 (_Decimal64 d) { return d; }
+_Decimal64 d128_to_d64 (_Decimal128 d) { return d; }
+_Decimal32 d128_to_d32 (_Decimal128 d) { return d; }
+
+int
+do_d64_to_d32 (_Decimal64 orig, _Decimal32 exp)
+{
+ d64 = orig;
+ d32 = d64_to_d32 (d64);
+ return (d32 == exp);
+}
+
+int
+do_d128_to_d32 (_Decimal128 orig, _Decimal32 exp)
+{
+ d128 = orig;
+ d32 = d128_to_d32 (d128);
+ return (d32 == exp);
+}
+
+int
+do_d128_to_d64 (_Decimal128 orig, _Decimal64 exp)
+{
+ d128 = orig;
+ d64 = d128_to_d64 (d128);
+ return (d64 == exp);
+}
+
+void *
+downward (void *arg)
+{
+ int err;
+
+ DFP_SETROUND (FE_DEC_DOWNWARD);
+
+ err = pthread_mutex_lock (&mut1);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "downward: failed to lock");
+
+ err = pthread_barrier_wait (&bar1);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("downward: barrier_wait failed");
+ exit (1);
+ }
+
+ err = pthread_cond_wait (&cond1, &mut1);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "downward: failed to wait");
+
+ err = pthread_mutex_unlock (&mut1);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "downward: failed to unlock");
+
+ if (!do_d64_to_d32 (1.1111125dd, 1.111112df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111113df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111113df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111114df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111112df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111113df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111113df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111114df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111114dd)) FAILURE
+
+#ifdef DBG
+ if (failcnt)
+ printf ("downward: %d fails\n", failcnt);
+#endif
+ return (void *) (ptrdiff_t) failcnt;
+}
+
+void *
+tonearest (void *arg)
+{
+ int err;
+ DFP_SETROUND (FE_DEC_TONEAREST);
+
+ err = pthread_mutex_lock (&mut2);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "tonearest: failed to lock");
+
+ err = pthread_barrier_wait (&bar2);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("tonearest: barrier_wait failed");
+ exit (1);
+ }
+
+ err = pthread_cond_wait (&cond2, &mut2);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "tonearest: failed to wait");
+
+ err = pthread_mutex_unlock (&mut2);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "tonearest: failed to unlock");
+
+ if (!do_d64_to_d32 (1.1111125dd, 1.111112df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111114df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111112df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111114df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111112df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111114df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111112df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111114df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111114dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111114dd)) FAILURE
+
+#ifdef DBG
+ if (failcnt)
+ printf ("tonearest: %d fails\n", failcnt);
+#endif
+ return (void *) (ptrdiff_t) failcnt;
+}
+
+void *
+toneareastfromzero (void *arg)
+{
+ int err;
+ DFP_SETROUND (FE_DEC_TONEARESTFROMZERO);
+
+ err = pthread_mutex_lock (&mut3);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "toneareastfromzero: failed to lock");
+
+ err = pthread_barrier_wait (&bar3);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("toneareastfromzero: barrier_wait failed");
+ exit (1);
+ }
+
+ err = pthread_cond_wait (&cond3, &mut3);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "toneareastfromzero: failed to wait");
+
+ err = pthread_mutex_unlock (&mut3);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "toneareastfromzero: failed to unlock");
+
+ if (!do_d64_to_d32 (1.1111125dd, 1.111113df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111114df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111113df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111114df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111113df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111114df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111113df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111114df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111114dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111114dd)) FAILURE
+
+#ifdef DBG
+ if (failcnt)
+ printf ("toneareastfromzero: %d fails\n", failcnt);
+#endif
+ return (void *) (ptrdiff_t) failcnt;
+}
+
+void *
+towardzero (void *arg)
+{
+ int err;
+ DFP_SETROUND (FE_DEC_TOWARDZERO);
+
+ err = pthread_mutex_lock (&mut4);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "towardzero: failed to lock");
+
+ err = pthread_barrier_wait (&bar4);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("towardzero: barrier_wait failed");
+ exit (1);
+ }
+
+ err = pthread_cond_wait (&cond4, &mut4);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "towardzero: failed to wait");
+
+ err = pthread_mutex_unlock (&mut4);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "towardzero: failed to unlock");
+
+ if (!do_d64_to_d32 (1.1111125dd, 1.111112df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111113df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111112df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111113df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111112df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111113df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111112df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111113df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111113dd)) FAILURE
+
+#ifdef DBG
+ if (failcnt)
+ printf ("towardzero: %d fails\n", failcnt);
+#endif
+ return (void *) (ptrdiff_t) failcnt;
+}
+
+void *
+upward (void *arg)
+{
+ int err;
+ DFP_SETROUND (FE_DEC_UPWARD);
+
+ err = pthread_mutex_lock (&mut5);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "upward: failed to lock");
+
+ err = pthread_barrier_wait (&bar5);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("upward: barrier_wait failed");
+ exit (1);
+ }
+
+ err = pthread_cond_wait (&cond5, &mut5);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "upward: failed to wait");
+
+ err = pthread_mutex_unlock (&mut5);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "upward: failed to unlock");
+
+ if (!do_d64_to_d32 (1.1111125dd, 1.111113df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111114df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111112df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111113df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111113df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111114df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111112df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111113df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111114dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111113dd)) FAILURE
+
+#ifdef DBG
+ if (failcnt)
+ printf ("upward: %d fails\n", failcnt);
+#endif
+ return (void *) (ptrdiff_t) failcnt;
+}
+
+int
+main (void)
+{
+ int err;
+ int count = 0;
+ void *ret;
+ pthread_t down, up, tozero, fromzero, nearest;
+
+ if (pthread_barrier_init (&bar1, NULL, 2) != 0
+ || pthread_barrier_init (&bar2, NULL, 2) != 0
+ || pthread_barrier_init (&bar3, NULL, 2) != 0
+ || pthread_barrier_init (&bar4, NULL, 2) != 0
+ || pthread_barrier_init (&bar5, NULL, 2) != 0)
+ {
+ puts ("parent: failed to init barrier");
+ return 1;
+ }
+
+ if (pthread_create (&down, NULL, downward, NULL) != 0)
+ {
+ puts ("parent: failed to create");
+ return 1;
+ }
+
+ if (pthread_create (&nearest, NULL, tonearest, NULL) != 0)
+ {
+ puts ("create failed");
+ return 1;
+ }
+
+ if (pthread_create (&fromzero, NULL, toneareastfromzero, NULL) != 0)
+ {
+ puts ("create failed");
+ return 1;
+ }
+
+ if (pthread_create (&up, NULL, upward, NULL) != 0)
+ {
+ puts ("create failed");
+ return 1;
+ }
+
+ if (pthread_create (&tozero, NULL, towardzero, NULL) != 0)
+ {
+ puts ("create failed");
+ return 1;
+ }
+
+ err = pthread_barrier_wait (&bar1);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("parent: failed to wait barrier 1");
+ return 1;
+ }
+ err = pthread_barrier_wait (&bar2);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("parent: failed to wait barrier 2");
+ return 1;
+ }
+ err = pthread_barrier_wait (&bar3);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("parent: failed to wait barrier 3");
+ return 1;
+ }
+ err = pthread_barrier_wait (&bar4);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("parent: failed to wait barrier 4");
+ return 1;
+ }
+ err = pthread_barrier_wait (&bar5);
+ if (err != 0 && err != PTHREAD_BARRIER_SERIAL_THREAD)
+ {
+ puts ("parent: failed to wait barrier 5");
+ return 1;
+ }
+
+ err = pthread_mutex_lock (&mut1);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: lock failed");
+ err = pthread_mutex_lock (&mut2);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: lock failed");
+ err = pthread_mutex_lock (&mut3);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: lock failed");
+ err = pthread_mutex_lock (&mut4);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: lock failed");
+ err = pthread_mutex_lock (&mut5);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: lock failed");
+
+ err = pthread_cond_signal(&cond1);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: broadcast failed");
+ err = pthread_cond_signal(&cond2);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: broadcast failed");
+ err = pthread_cond_signal(&cond3);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: broadcast failed");
+ err = pthread_cond_signal(&cond4);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: broadcast failed");
+ err = pthread_cond_signal(&cond5);
+ if (err != 0)
+ error (EXIT_FAILURE, err, "parent: broadcast failed");
+
+ err = pthread_mutex_unlock (&mut1);
+ if (err != 0)
+ {
+ puts ("parent: failed to unlock");
+ return 1;
+ }
+ err = pthread_mutex_unlock (&mut2);
+ if (err != 0)
+ {
+ puts ("parent: failed to unlock");
+ return 1;
+ }
+ err = pthread_mutex_unlock (&mut3);
+ if (err != 0)
+ {
+ puts ("parent: failed to unlock");
+ return 1;
+ }
+ err = pthread_mutex_unlock (&mut4);
+ if (err != 0)
+ {
+ puts ("parent: failed to unlock");
+ return 1;
+ }
+ err = pthread_mutex_unlock (&mut5);
+ if (err != 0)
+ {
+ puts ("parent: failed to unlock");
+ return 1;
+ }
+
+ if (pthread_join (down, &ret) != 0)
+ {
+ puts ("pthread_join failed");
+ return 1;
+ }
+ count += (int) (ptrdiff_t) ret;
+
+ if (pthread_join (up, &ret) != 0)
+ {
+ puts ("pthread_join failed");
+ return 1;
+ }
+ count += (int) (ptrdiff_t) ret;
+
+ if (pthread_join (tozero, &ret) != 0)
+ {
+ puts ("pthread_join failed");
+ return 1;
+ }
+ count += (int) (ptrdiff_t) ret;
+
+ if (pthread_join (fromzero, &ret) != 0)
+ {
+ puts ("pthread_join failed");
+ return 1;
+ }
+ count += (int) (ptrdiff_t) ret;
+
+ if (pthread_join (nearest, &ret) != 0)
+ {
+ puts ("pthread_join failed");
+ return 1;
+ }
+ count += (int) (ptrdiff_t) ret;
+
+ if (count)
+ {
+#ifdef DBG
+ printf ("Total: %d fails\n", count);
+#endif
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c
new file mode 100644
index 000000000..e3781bfc9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c
@@ -0,0 +1,124 @@
+/* { dg-options "-O0" } */
+/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */
+
+/* N1150 5.2: Conversions among decimal floating types and between
+ decimal floating types and generic floating types.
+ C99 6.3.1.5(3) New.
+
+ Perform conversions between DFP types in which the assigned value
+ cannot be represented exactly in the result and must be rounded
+ correctly according to the current rounding mode.
+
+ Normally this would not be part of compiler testing, but conversions
+ are currently handled in libgcc via decNumber. */
+
+#include "dfp-dbg.h"
+#include "dfp-round.h"
+
+_Decimal32 d32;
+_Decimal64 d64;
+_Decimal128 d128;
+
+_Decimal32 d64_to_d32 (_Decimal64 d) { return d; }
+_Decimal64 d128_to_d64 (_Decimal128 d) { return d; }
+_Decimal32 d128_to_d32 (_Decimal128 d) { return d; }
+
+int
+do_d64_to_d32 (_Decimal64 orig, _Decimal32 exp)
+{
+ d64 = orig;
+ d32 = d64_to_d32 (d64);
+ return (d32 == exp);
+}
+
+int
+do_d128_to_d32 (_Decimal128 orig, _Decimal32 exp)
+{
+ d128 = orig;
+ d32 = d128_to_d32 (d128);
+ return (d32 == exp);
+}
+
+int
+do_d128_to_d64 (_Decimal128 orig, _Decimal64 exp)
+{
+ d128 = orig;
+ d64 = d128_to_d64 (d128);
+ return (d64 == exp);
+}
+
+int
+main ()
+{
+ DFP_SETROUND (FE_DEC_DOWNWARD);
+ if (!do_d64_to_d32 (1.1111125dd, 1.111112df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111113df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111113df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111114df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111112df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111113df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111113df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111114df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111114dd)) FAILURE
+
+ DFP_SETROUND (FE_DEC_TONEAREST);
+ if (!do_d64_to_d32 (1.1111125dd, 1.111112df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111114df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111112df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111114df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111112df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111114df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111112df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111114df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111114dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111114dd)) FAILURE
+
+ DFP_SETROUND (FE_DEC_TONEARESTFROMZERO);
+ if (!do_d64_to_d32 (1.1111125dd, 1.111113df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111114df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111113df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111114df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111113df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111114df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111113df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111114df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111114dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111114dd)) FAILURE
+
+ DFP_SETROUND (FE_DEC_TOWARDZERO);
+ if (!do_d64_to_d32 (1.1111125dd, 1.111112df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111113df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111112df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111113df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111112df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111113df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111112df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111113df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111113dd)) FAILURE
+
+ DFP_SETROUND (FE_DEC_UPWARD);
+ if (!do_d64_to_d32 (1.1111125dd, 1.111113df)) FAILURE
+ if (!do_d64_to_d32 (1.1111135dd, 1.111114df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111125dd, -1.111112df)) FAILURE
+ if (!do_d64_to_d32 (-1.1111135dd, -1.111113df)) FAILURE
+ if (!do_d128_to_d32 (1.1111125dl, 1.111113df)) FAILURE
+ if (!do_d128_to_d32 (1.1111135dl, 1.111114df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111125dl, -1.111112df)) FAILURE
+ if (!do_d128_to_d32 (-1.1111135dl, -1.111113df)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111125dl, 1.111111111111113dd)) FAILURE
+ if (!do_d128_to_d64 (1.1111111111111135dl, 1.111111111111114dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111112dd)) FAILURE
+ if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111113dd)) FAILURE
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/ctypes.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/ctypes.c
new file mode 100644
index 000000000..ca8fe954e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/ctypes.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+
+/* N1150 3: Decimal floating types.
+ C99 6.7.2: Type specifiers */
+
+/* Test for the existence of the types. */
+_Decimal32 sd1;
+_Decimal64 dd2;
+_Decimal128 td3;
+
+#define ARRAY_SIZE 7
+
+static _Decimal32 d32[ARRAY_SIZE];
+static _Decimal64 d64[ARRAY_SIZE];
+static _Decimal128 d128[ARRAY_SIZE];
+
+extern _Decimal32 ext_d32[ARRAY_SIZE];
+extern _Decimal64 ext_d64[ARRAY_SIZE];
+extern _Decimal128 ext_d128[ARRAY_SIZE];
+
+/* Test sizes for these types. */
+int ssize[sizeof (_Decimal32) == 4 ? 1 : -1];
+int dsize[sizeof (_Decimal64) == 8 ? 1 : -1];
+int tsize[sizeof (_Decimal128) == 16 ? 1 : -1];
+
+int salign = __alignof (_Decimal32);
+int dalign = __alignof (_Decimal64);
+int talign = __alignof (_Decimal128);
+
+/* sizeof operator applied on an array of DFP types is n times the
+ size of a single variable of this type. */
+
+int d32_array_size [sizeof(d32) == ARRAY_SIZE * sizeof(sd1) ? 1 : -1];
+int d64_array_size [sizeof(d64) == ARRAY_SIZE * sizeof(dd2) ? 1 : -1];
+int d128_array_size [sizeof(d128) == ARRAY_SIZE * sizeof(td3)? 1 : -1];
+
+/* Likewise for extern qualified arrays. */
+
+int ext_d32_array_size [sizeof(ext_d32) == ARRAY_SIZE * sizeof(sd1) ? 1 : -1];
+int ext_d64_array_size [sizeof(ext_d64) == ARRAY_SIZE * sizeof(dd2) ? 1 : -1];
+int ext_d128_array_size [sizeof(ext_d128) == ARRAY_SIZE * sizeof(td3)? 1 : -1];
+
+void f()
+{
+ _Decimal32 d32[ARRAY_SIZE];
+ _Decimal64 d64[ARRAY_SIZE];
+ _Decimal128 d128[ARRAY_SIZE];
+
+ int d32_array_size [sizeof(d32) == ARRAY_SIZE * sizeof(_Decimal32) ? 1 : -1];
+ int d64_array_size [sizeof(d64) == ARRAY_SIZE * sizeof(_Decimal64) ? 1 : -1];
+ int d128_array_size [sizeof(d128) == ARRAY_SIZE * sizeof(_Decimal128)? 1 : -1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/ddmode-ice.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/ddmode-ice.c
new file mode 100644
index 000000000..19f303801
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/ddmode-ice.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* This used to result in an ICE. */
+
+_Decimal64 y[258][258];
+_Decimal64 dd[258][258];
+_Decimal64 ry[258][258];
+_Decimal64
+foo (void)
+{
+ int i;
+ int j;
+ int m;
+ int im;
+ int jm;
+ int ip;
+ int jp;
+ int i2m;
+ int i1p;
+ _Decimal64 a;
+ _Decimal64 b;
+ _Decimal64 c;
+ _Decimal64 qi;
+ _Decimal64 qj;
+ _Decimal64 xx;
+ _Decimal64 yx;
+ _Decimal64 xy;
+ _Decimal64 yy;
+ _Decimal64 rel;
+ _Decimal64 qxx;
+ _Decimal64 qyy;
+ _Decimal64 qxy;
+ do
+ {
+ jp = j + 1;
+ for (i = i1p; i <= i2m; i++)
+ {
+ ip = i + 1;
+ yx = y[ip][j] - y[im][j];
+ yy = y[i][jp] - y[i][jm];
+ a = 0.25dd * (xy * xy + yy * yy);
+ b = 0.25dd * (xx * xx + yx * yx);
+ c = 0.125dd * (xx * xy + yx * yy);
+ qj = 0.0dd;
+ dd[i][m] = b + a * rel + b;
+ qxx = y[ip][j] - 2.0dd * y[i][j] + y[im][j];
+ qyy = y[i][jp] - 2.0dd * y[i][j] + y[i][jm];
+ qxy = y[ip][jp] - y[ip][jm] - y[im][jp] + y[im][jm];
+ ry[i][m] = a * qxx + b * qyy - c * qxy + yx * qi + yy * qj;
+ }
+ }
+ while (1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dec-eval-method-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dec-eval-method-2.c
new file mode 100644
index 000000000..b87f159bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dec-eval-method-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-D__STDC_WANT_DEC_FP__" } */
+
+/* N1107 4: Characteristics of decimal floating types <float.h>.
+ C99 5.2.4.2.2a[2] (New).
+
+ Verify that DEC_EVAL_METHOD is defined by float.h.
+ DEC_EVAL_METHOD in <float.h>. */
+
+#ifdef DEC_EVAL_METHOD
+#error DEC_EVAL_METHOD is defined before float.h is included
+#endif
+
+#include <float.h>
+
+#ifndef DEC_EVAL_METHOD
+#error DEC_EVAL_METHOD is not defined after float.h is included
+#endif
+
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dec-eval-method.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dec-eval-method.c
new file mode 100644
index 000000000..070a4033e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dec-eval-method.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1107 4: Characteristics of decimal floating types <float.h>.
+ C99 5.2.4.2.2a[2] (New).
+
+ Verify that __DEC_EVAL_METHOD__ is defined; it will be used to define
+ DEC_EVAL_METHOD in <float.h>. */
+
+int i;
+#ifndef __DEC_EVAL_METHOD__
+#error __DEC_EVAL_METHOD__ is not defined
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c
new file mode 100644
index 000000000..c72933f42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c
@@ -0,0 +1,47 @@
+/* N1150 4: Characteristics of decimal floating types <float.h>.
+ C99 5.2.4.2.2a[3]: New.
+
+ Verify constants about range of decimal float and three components of
+ decimal float defined in float.h. */
+
+/* Make sure we are exporting the right values to float.h. */
+#ifndef __STDC_WANT_DEC_FP__
+#define __STDC_WANT_DEC_FP__ 1
+#endif
+
+#include "dfp-dbg.h"
+#include <float.h>
+
+int main ()
+{
+ if (DEC32_MANT_DIG != 7) FAILURE
+ if (DEC64_MANT_DIG != 16) FAILURE
+ if (DEC128_MANT_DIG != 34) FAILURE
+
+ if (DEC32_MIN_EXP != -94) FAILURE
+ if (DEC64_MIN_EXP != -382) FAILURE
+ if (DEC128_MIN_EXP != -6142) FAILURE
+
+ if (DEC32_MAX_EXP != 97) FAILURE
+ if (DEC64_MAX_EXP != 385) FAILURE
+ if (DEC128_MAX_EXP != 6145) FAILURE
+
+ if (DEC32_MAX != 9.999999E96DF) FAILURE
+ if (DEC64_MAX != 9.999999999999999E384DD) FAILURE
+ if (DEC128_MAX != 9.999999999999999999999999999999999E6144DL) FAILURE
+
+ if (DEC32_EPSILON != 1E-6DF) FAILURE
+ if (DEC64_EPSILON != 1E-15DD) FAILURE
+ if (DEC128_EPSILON != 1E-33DL) FAILURE
+
+ if (DEC32_MIN != 1E-95DF) FAILURE
+ if (DEC64_MIN != 1E-383DD) FAILURE
+ if (DEC128_MIN != 1E-6143DL) FAILURE
+
+ if (DEC32_SUBNORMAL_MIN != 0.000001E-95DF) FAILURE
+ if (DEC64_SUBNORMAL_MIN != 0.000000000000001E-383DD) FAILURE
+ if (DEC128_SUBNORMAL_MIN != 0.000000000000000000000000000000001E-6143DL)
+ FAILURE
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-dbg.h b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-dbg.h
new file mode 100644
index 000000000..253a9d05f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-dbg.h
@@ -0,0 +1,12 @@
+#define EXTERN extern
+
+int failures;
+
+#ifdef DBG
+extern int printf (const char *, ...);
+#define FAILURE { printf ("failed at line %d\n", __LINE__); failures++; }
+#define FINISH if (failures != 0) __builtin_abort (); return 0;
+#else
+#define FAILURE __builtin_abort ();
+#define FINISH return 0;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-except.h b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-except.h
new file mode 100644
index 000000000..3ef97ff6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-except.h
@@ -0,0 +1,13 @@
+/* Use undocumented functions in libgcc to clear and test dummy floating
+ point exception flags. That functionality is in libgcc just for
+ testing purposes.
+
+ If fesetexcept and feclearexcept are available, use those instead. */
+
+/* Get names of exception flags. */
+#include <fenv.h>
+
+extern void __dfp_clear_except (int);
+#define DFP_CLEAR_EXCEPT(M) __dfp_clear_except(M)
+extern int __dfp_test_except (int);
+#define DFP_TEST_EXCEPT(M) __dfp_test_except(M)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-round.h b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-round.h
new file mode 100644
index 000000000..fc7fd5c23
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp-round.h
@@ -0,0 +1,22 @@
+/* This is very temporary; right now it gets functions in libgcc that
+ pass on the rounding mode to decNumber, but later it can be replaced
+ with Official Stuff. */
+
+#ifdef __DECIMAL_BID_FORMAT__
+#define FE_DEC_TONEAREST 0
+#define FE_DEC_DOWNWARD 1
+#define FE_DEC_UPWARD 2
+#define FE_DEC_TOWARDZERO 3
+#define FE_DEC_TONEARESTFROMZERO 4
+#else
+#define FE_DEC_DOWNWARD 0
+#define FE_DEC_TONEAREST 1
+#define FE_DEC_TONEARESTFROMZERO 2
+#define FE_DEC_TOWARDZERO 3
+#define FE_DEC_UPWARD 4
+#endif
+
+extern void __dfp_set_round (int);
+#define DFP_SETROUND(M) __dfp_set_round(M)
+extern int __dfp_get_round (void);
+#define DFP_GETROUND __dfp_get_round()
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp.exp b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp.exp
new file mode 100644
index 000000000..f96f1debd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/dfp.exp
@@ -0,0 +1,65 @@
+# Copyright (C) 2005-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Skip these tests for targets that don't support this extension.
+if { ![check_effective_target_dfp] } {
+ return;
+}
+
+# If the decimal float is supported in the compiler but not yet in the
+# runtime, treat all tests as compile-only.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+if { ![check_effective_target_dfprt] } {
+ verbose "dfp.exp: runtime support for decimal float does not exist" 2
+ set dg-do-what-default compile
+} else {
+ verbose "dfp.exp: runtime support for decimal float exists, use it" 2
+ set dg-do-what-default run
+}
+verbose "dfp.exp: dg-do-what-default is ${dg-do-what-default}" 2
+
+global DEFAULT_CFLAGS
+if [info exists DEFAULT_CFLAGS] then {
+ set save_default_cflags $DEFAULT_CFLAGS
+}
+
+# If a testcase doesn't have special options, use these.
+set DEFAULT_CFLAGS "-std=gnu99"
+
+# Initialize `dg'.
+dg-init
+
+# Main loop; run the C-only tests.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+# Run the tests that are shared with C++ testing.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/dfp/*c]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
+
+set dg-do-what-default ${save-dg-do-what-default}
+verbose "dfp.exp: dg-do-what-default is ${dg-do-what-default}" 2
+if [info exists save_default_cflags] {
+ set DEFAULT_CFLAGS $save_default_cflags
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-binop.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-binop.c
new file mode 100644
index 000000000..eb0da1b2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-binop.c
@@ -0,0 +1,105 @@
+/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */
+
+/* Touch tests that check for raising appropriate exceptions for binary
+ arithmetic operations on decimal float values. */
+
+#include "fe-check.h"
+
+volatile _Decimal32 a32, b32, c32;
+volatile _Decimal64 a64, b64, c64;
+volatile _Decimal128 a128, b128, c128;
+_Decimal32 inf32;
+_Decimal64 inf64;
+_Decimal128 inf128;
+
+BINOP (100, /, a32, 2.0df, b32, 0.df, c32, FE_DIVBYZERO)
+BINOP (101, /, a64, 2.0dd, b64, 0.dd, c64, FE_DIVBYZERO)
+BINOP (102, /, a128, 2.0dl, b128, 0.dl, c128, FE_DIVBYZERO)
+
+BINOP (200, /, a32, 0.df, b32, 0.df, c32, FE_INVALID)
+BINOP (201, /, a64, 0.dd, b64, 0.dd, c64, FE_INVALID)
+BINOP (202, /, a128, 0.dl, b128, 0.dl, c128, FE_INVALID)
+BINOP (203, /, a32, inf32, b32, inf32, c32, FE_INVALID)
+BINOP (204, /, a64, inf64, b64, inf64, c64, FE_INVALID)
+BINOP (205, /, a128, inf128, b128, inf128, c128, FE_INVALID)
+BINOP (206, *, a32, 0.df, b32, __builtin_infd32(), c32, FE_INVALID)
+BINOP (207, *, a32, __builtin_infd32(), b32, 0.df, c32, FE_INVALID)
+BINOP (208, *, a64, 0.df, b64, __builtin_infd64(), c64, FE_INVALID)
+BINOP (209, *, a64, __builtin_infd64(), b64, 0.df, c64, FE_INVALID)
+BINOP (210, *, a128, 0.df, b128, __builtin_infd128(), c128, FE_INVALID)
+BINOP (211, *, a128, __builtin_infd128(), b128, 0.df, c128, FE_INVALID)
+BINOP (212, +, a32, inf32, b32, -inf32, c32, FE_INVALID)
+BINOP (213, +, a64, inf64, b64, -inf64, c64, FE_INVALID)
+BINOP (214, +, a128, inf128, b128, -inf128, c128, FE_INVALID)
+BINOP (215, -, a32, inf32, b32, inf32, c32, FE_INVALID)
+BINOP (216, -, a64, inf64, b64, inf64, c64, FE_INVALID)
+BINOP (217, -, a128, inf128, b128, inf128, c128, FE_INVALID)
+
+BINOP (300, /, a32, 9.9e94df, b32, 1.e-3df, c32, FE_OVERFLOW|FE_INEXACT)
+BINOP (301, /, a64, 9.9e382dd, b64, 1.e-3dd, c64, FE_OVERFLOW|FE_INEXACT)
+BINOP (302, /, a128, 9.9e6142dl, b128, 1.e-3dl, c128, FE_OVERFLOW|FE_INEXACT)
+BINOP (303, +, a32, 9.9e96df, b32, 1.e96df, c32, FE_OVERFLOW|FE_INEXACT)
+BINOP (304, +, a64, 9.9e384dd, b64, 1.e384dd, c64, FE_OVERFLOW|FE_INEXACT)
+BINOP (305, +, a128, 9.9e6144dl, b128, 1.e6144dl, c128, FE_OVERFLOW|FE_INEXACT)
+
+BINOP (400, /, a32, 1.e-3df, b32, 9.9e94df, c32, FE_UNDERFLOW|FE_INEXACT)
+BINOP (401, /, a64, 1.e-3dd, b64, 9.9e382dd, c64, FE_UNDERFLOW|FE_INEXACT)
+BINOP (402, /, a128, 1.e-3dl, b128, 9.9e6142dl, c128, FE_UNDERFLOW|FE_INEXACT)
+BINOP (403, *, a32, 1.e-95df, b32, 1.e-7df, c32, FE_UNDERFLOW|FE_INEXACT)
+BINOP (404, *, a64, 1.e-383dd, b64, 1.e-16dd, c64, FE_UNDERFLOW|FE_INEXACT)
+BINOP (405, *, a128, 1.e-6143dl, b128, 1.e-34dl, c128, FE_UNDERFLOW|FE_INEXACT)
+
+BINOP (500, /, a32, 1.df, b32, 3.df, c32, FE_INEXACT)
+BINOP (501, /, a64, 1.dd, b64, 3.dd, c64, FE_INEXACT)
+BINOP (502, /, a128, 1.dl, b128, 3.dl, c128, FE_INEXACT)
+
+int
+main ()
+{
+ inf32 = __builtin_infd32();
+ inf64 = __builtin_infd64();
+ inf128 = __builtin_infd128();
+
+ binop_100 ();
+ binop_101 ();
+ binop_102 ();
+
+ binop_200 ();
+ binop_201 ();
+ binop_202 ();
+ binop_203 ();
+ binop_204 ();
+ binop_205 ();
+ binop_206 ();
+ binop_207 ();
+ binop_208 ();
+ binop_209 ();
+ binop_210 ();
+ binop_211 ();
+ binop_212 ();
+ binop_213 ();
+ binop_214 ();
+ binop_215 ();
+ binop_216 ();
+ binop_217 ();
+
+ binop_300 ();
+ binop_301 ();
+ binop_302 ();
+ binop_303 ();
+ binop_304 ();
+ binop_305 ();
+
+ binop_400 ();
+ binop_401 ();
+ binop_402 ();
+ binop_403 ();
+ binop_404 ();
+ binop_405 ();
+
+ binop_500 ();
+ binop_501 ();
+ binop_502 ();
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-check.h b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-check.h
new file mode 100644
index 000000000..9c5f0ff8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-check.h
@@ -0,0 +1,68 @@
+/* Common support for checking that appropriate floating point exceptions
+ are raised for decimal float operations. These tests are here to test
+ the software decimal float support in libgcc. */
+
+#include "dfp-dbg.h"
+#include "dfp-except.h"
+
+#if defined(DBG) || defined(DBG2)
+#include <stdio.h>
+#undef FAILURE
+#define FAILURE(NUM,KIND,EXCEPT) \
+ { printf ("failed for test %d: %s %s\n", NUM, KIND, EXCEPT); failures++; }
+#else
+#undef FAILURE
+#define FAILURE(N,K,E) __builtin_abort ();
+#endif
+
+/* This is useful when modifying the test to make sure that tests are
+ actually run. */
+#if defined(DBG2)
+#define SUCCESS(NUM,EXCEPT) \
+ { printf ("passed for test %d: %s\n", NUM, EXCEPT); }
+#else
+#define SUCCESS(N,E) ;
+#endif
+
+#define CHECKFLAG(NUM,EXCEPT,GOT,WANT) \
+ if ((WANT & EXCEPT) != (GOT & EXCEPT)) \
+ { \
+ if ((WANT & EXCEPT) != 0) \
+ FAILURE (NUM, "missing", #EXCEPT) \
+ else \
+ FAILURE (NUM, "unexpected", #EXCEPT) \
+ } \
+ else \
+ SUCCESS (NUM, #EXCEPT)
+
+void
+checkflags (int num, int want)
+{
+ int got = DFP_TEST_EXCEPT (FE_ALL_EXCEPT);
+ CHECKFLAG (num, FE_INVALID, got, want)
+ CHECKFLAG (num, FE_OVERFLOW, got, want)
+ CHECKFLAG (num, FE_UNDERFLOW, got, want)
+ CHECKFLAG (num, FE_DIVBYZERO, got, want)
+ CHECKFLAG (num, FE_INEXACT, got, want)
+}
+
+#define BINOP(NUM,OP,VAR1,VAL1,VAR2,VAL2,VAR3,EXCEPT) \
+void \
+binop_##NUM (void) \
+{ \
+ VAR1 = VAL1; \
+ VAR2 = VAL2; \
+ DFP_CLEAR_EXCEPT (FE_ALL_EXCEPT); \
+ VAR3 = VAR1 OP VAR2; \
+ checkflags (NUM, EXCEPT); \
+}
+
+#define CONVERT(NUM,FROM,TO,VALUE,EXCEPT) \
+void \
+convert_##NUM (void) \
+{ \
+ FROM = VALUE; \
+ DFP_CLEAR_EXCEPT (FE_ALL_EXCEPT); \
+ TO = FROM; \
+ checkflags (NUM, EXCEPT); \
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c
new file mode 100644
index 000000000..b6528029b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c
@@ -0,0 +1,40 @@
+/* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */
+
+/* Check that appropriate exceptions are raised for conversions involving
+ decimal float values. */
+
+#include "fe-check.h"
+
+volatile _Decimal32 d32;
+volatile _Decimal64 d64;
+volatile _Decimal128 d128;
+
+/* Conversions between decimal float types should raise an invalid
+ exception if the value doesn't fit, either because the value
+ is too large or the result can't hold the full precision. */
+
+CONVERT (100, d64, d32, 9.999999e96DD, 0)
+CONVERT (101, d64, d32, 10.000000e96DD, FE_INEXACT|FE_OVERFLOW)
+CONVERT (102, d64, d32, 1.1111111DD, FE_INEXACT)
+CONVERT (110, d128, d32, 9.999999e96DL, 0)
+CONVERT (111, d128, d32, 10.000000e96DL, FE_INEXACT|FE_OVERFLOW)
+CONVERT (112, d128, d32, 1.1111111DL, FE_INEXACT)
+CONVERT (120, d128, d64, 9.999999999999999E384DL, 0)
+CONVERT (121, d128, d64, 10.00000000000000E384DL, FE_INEXACT|FE_OVERFLOW)
+CONVERT (122, d128, d64, 1.1111111111111111DL, FE_INEXACT)
+
+int
+main ()
+{
+ convert_100 ();
+ convert_101 ();
+ convert_102 ();
+ convert_110 ();
+ convert_111 ();
+ convert_112 ();
+ convert_120 ();
+ convert_121 ();
+ convert_122 ();
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-2.c
new file mode 100644
index 000000000..63df1cbb6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-2.c
@@ -0,0 +1,33 @@
+/* { dg-options "-mno-hard-dfp" { target { s390*-*-* } } } */
+
+/* Check that appropriate exceptions are raised for BFP to DFP conversions.
+ The test only uses double and _Decimal32; tests for conversions to
+ _Decimal64 would need 128-bit long double. */
+
+#include "fe-check.h"
+
+volatile _Decimal32 d32;
+volatile double d;
+
+CONVERT (100, d, d32, 1.0e96, FE_INEXACT)
+CONVERT (101, d, d32, 1.0e97, FE_OVERFLOW|FE_INEXACT)
+CONVERT (102, d, d32, -1.0e96, FE_INEXACT)
+CONVERT (103, d, d32, -1.0e97, FE_OVERFLOW|FE_INEXACT)
+
+/* FIXME: These only result in fp exceptions when libbid is used.
+ libdecnumber doesn't work correctly. */
+CONVERT (104, d, d32, 1.0e-96, FE_UNDERFLOW|FE_INEXACT)
+CONVERT (105, d, d32, 0.00048828125, FE_INEXACT) /* exact power of 2 */
+
+int
+main ()
+{
+ convert_100 ();
+ convert_101 ();
+ convert_102 ();
+ convert_103 ();
+ convert_104 ();
+ convert_105 ();
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-3.c
new file mode 100644
index 000000000..5938edb94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/fe-convert-3.c
@@ -0,0 +1,45 @@
+/* Check that appropriate exceptions are raised for int to DFP conversions. */
+
+#include "fe-check.h"
+
+volatile _Decimal32 d32;
+volatile _Decimal64 d64;
+volatile signed int si;
+volatile unsigned int ui;
+volatile signed long long sll;
+volatile unsigned long long ull;
+
+CONVERT (100, si, d32, 9999999, 0)
+CONVERT (101, si, d32, 11111111, FE_INEXACT)
+CONVERT (102, si, d32, -9999999, 0)
+CONVERT (103, si, d32, -10000001, FE_INEXACT)
+CONVERT (110, ui, d32, 9999999, 0)
+CONVERT (111, ui, d32, 10000001, FE_INEXACT)
+CONVERT (200, sll, d64, 9999999999999999, 0)
+CONVERT (201, sll, d64, 10000000000000001, FE_INEXACT)
+CONVERT (202, sll, d64, -9999999999999999, 0)
+CONVERT (203, sll, d64, -10000000000000001, FE_INEXACT)
+CONVERT (210, ull, d64, 9999999999999999, 0)
+CONVERT (211, ull, d64, 10000000000000001, FE_INEXACT)
+
+int
+main ()
+{
+ if (sizeof (long long) != 16)
+ return 0;
+
+ convert_100 ();
+ convert_101 ();
+ convert_102 ();
+ convert_103 ();
+ convert_110 ();
+ convert_111 ();
+ convert_200 ();
+ convert_201 ();
+ convert_202 ();
+ convert_203 ();
+ convert_210 ();
+ convert_211 ();
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/float-constant-double.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/float-constant-double.c
new file mode 100644
index 000000000..52c5d7126
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/float-constant-double.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+/* Constant float values of type double in <float.h> are suffixed with L
+ and cast to double so they can be used within code that uses pragma
+ FLOAT_CONST_DECIMAL64. If they were not suffixed then use of the macro
+ would have them interpreted as _Decimal64, leading to errors when used
+ in expressions with other operands of type double. */
+
+#include <float.h>
+
+extern double a, b, c, d;
+
+void
+foo ()
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+ a = 0.1d * DBL_MAX;
+ b = DBL_EPSILON * 10.0d;
+ c = DBL_MIN * 200.0d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-c89.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-c89.c
new file mode 100644
index 000000000..8c96d60c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-c89.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89" } */
+
+/* Decimal float keywords are not recognized in C89 mode. */
+
+_Decimal32 x; /* { dg-error "" } */
+_Decimal64 y; /* { dg-error "" } */
+_Decimal128 z; /* { dg-error "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-c99.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-c99.c
new file mode 100644
index 000000000..8a62fb93e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-c99.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+/* Decimal float keywords are not recognized in C99 mode. */
+
+_Decimal32 x; /* { dg-error "" } */
+_Decimal64 y; /* { dg-error "" } */
+_Decimal128 z; /* { dg-error "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-ignored-c99.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-ignored-c99.c
new file mode 100644
index 000000000..a4258aaa8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-ignored-c99.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+/* Decimal float keywords are not reserved for c99. */
+
+int _Decimal32 (void)
+{
+ return 0;
+}
+
+int foo (int i)
+{
+ int _Decimal64 = i * 2;
+ return _Decimal64;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
new file mode 100644
index 000000000..bca51066b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+/* Decimal float is a GCC extension. */
+
+_Decimal32 x; /* { dg-warning "GCC extension|ISO C" } */
+_Decimal64 y; /* { dg-warning "GCC extension|ISO C" } */
+_Decimal128 z; /* { dg-warning "GCC extension|ISO C" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-reserved.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-reserved.c
new file mode 100644
index 000000000..1117ae8d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/keywords-reserved.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+/* N1150 3: Decimal floating types.
+ C99 6.4.1(2): Keywords.
+ Decimal float keywords cannot be used in other contexts. */
+
+int _Decimal32 (void) /* { dg-error "" } */
+{
+ return 0;
+}
+
+int foo (int i)
+{
+ int _Decimal64 = i * 2; /* { dg-error "" } */
+ return _Decimal64; /* { dg-error "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/operator-bitwise.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/operator-bitwise.c
new file mode 100644
index 000000000..f895a9705
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/operator-bitwise.c
@@ -0,0 +1,63 @@
+/* { dg-do compile } */
+
+/* C99 6.5.10: Bitwise AND operator.
+ C99 6.5.11: Bitwise exclusive OR operator.
+ C99 6.5.12: Bitwise inclusive OR operator.
+
+ Test that these operators do not accept decimal float operands. */
+
+#define OPERATE(OPRD1,OPRT,OPRD2) \
+do \
+{ \
+ OPRD1 OPRT OPRD2; \
+} while (0)
+
+
+
+#define DECIMAL_BITWISE_OPERATOR(OPRT,OPRD) \
+do \
+{ \
+OPERATE(OPRD,OPRT,1); \
+OPERATE(OPRD,OPRT,0); \
+OPERATE(OPRD,OPRT,0x15); \
+OPERATE(0,OPRT,OPRD); \
+OPERATE(1,OPRT,OPRD); \
+OPERATE(0x15,OPRT,OPRD); \
+} while (0)
+
+void operator_notfor_decimal()
+{
+ _Decimal32 d32;
+ _Decimal64 d64;
+ _Decimal128 d128;
+
+ /* C99 Section 6.5.7 Bitwise shift operators. Operands must have
+ integer type (which the decimal float types are not). */
+
+ d32 << 1; /* { dg-error "invalid operands to binary" } */
+ d32 >> 1; /* { dg-error "invalid operands to binary" } */
+ d64 << 1; /* { dg-error "invalid operands to binary" } */
+ d64 >> 1; /* { dg-error "invalid operands to binary" } */
+ d128 << 1; /* { dg-error "invalid operands to binary" } */
+ d128 >> 1; /* { dg-error "invalid operands to binary" } */
+
+ DECIMAL_BITWISE_OPERATOR(&,d32); /* { dg-error "invalid operands to binary" } */
+ DECIMAL_BITWISE_OPERATOR(&,d64); /* { dg-error "invalid operands to binary" } */
+ DECIMAL_BITWISE_OPERATOR(&,d128); /* { dg-error "invalid operands to binary" } */
+
+ /* C99 Section 6.5.{10,11,12} Bitwise operator. Constraints: Each of
+ the operands shall have integer type. DFP type is reject by compiler
+ when bitwise operation is performed. */
+
+ DECIMAL_BITWISE_OPERATOR(&,d32); /* { dg-error "invalid operands to binary" } */
+ DECIMAL_BITWISE_OPERATOR(&,d64); /* { dg-error "invalid operands to binary" } */
+ DECIMAL_BITWISE_OPERATOR(&,d128); /* { dg-error "invalid operands to binary" } */
+
+ DECIMAL_BITWISE_OPERATOR(|,d32); /* { dg-error "invalid operands to binary" } */
+ DECIMAL_BITWISE_OPERATOR(|,d64); /* { dg-error "invalid operands to binary" } */
+ DECIMAL_BITWISE_OPERATOR(|,d128); /* { dg-error "invalid operands to binary" } */
+
+ DECIMAL_BITWISE_OPERATOR(^,d32); /* { dg-error "invalid operands to binary" } */
+ DECIMAL_BITWISE_OPERATOR(^,d64); /* { dg-error "invalid operands to binary" } */
+ DECIMAL_BITWISE_OPERATOR(^,d128); /* { dg-error "invalid operands to binary" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr31344.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr31344.c
new file mode 100644
index 000000000..506eef450
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr31344.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-O" } */
+
+typedef struct
+{
+ unsigned char bits;
+} decNumber;
+
+typedef struct
+{
+ unsigned char bytes[1];
+} decimal32;
+
+extern decNumber *__decimal32ToNumber (const decimal32 *, decNumber *);
+extern void __host_to_ieee_32 (_Decimal32, decimal32 *);
+
+void
+foo (_Decimal32 arg)
+{
+ decNumber dn;
+ decimal32 d32;
+ __host_to_ieee_32 (arg, &d32);
+ __decimal32ToNumber (&d32, &dn);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr37435.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr37435.c
new file mode 100644
index 000000000..867fdd26b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr37435.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fPIC" } */
+
+volatile _Decimal32 d;
+volatile int i;
+
+void foo()
+{
+ d += i;
+ d += i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr41049.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr41049.c
new file mode 100644
index 000000000..6187481ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr41049.c
@@ -0,0 +1,562 @@
+/* { dg-options "-std=gnu99" } */
+
+/* The preferred exponent of the result of a conversion from an
+ integral type to a decimal float type is zero. A conversion at
+ either compile time or runtime should not change the number of
+ trailing zeroes. */
+
+#include "dfp-dbg.h"
+
+#define PASTE2(A,B) A ## B
+#define PASTE(A,B) PASTE2(A,B)
+
+#define TESTVAL_NEG(VAL,SUF,SIZE) \
+ x = PASTE(PASTE(VAL,.),SUF); \
+ si = VAL; \
+ sll = PASTE(VAL,LL); \
+ a = si; \
+ b = sll; \
+ c = VAL; \
+ d = PASTE(VAL,LL); \
+ if ((__builtin_memcmp ((void *)&x, (void *)&a, SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&b,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&c,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&d,SIZE) != 0)) \
+ FAILURE
+
+#define TESTVAL_NEG_BIG(VAL,SUF,SIZE) \
+ x = PASTE(PASTE(VAL,.),SUF); \
+ sll = PASTE(VAL,LL); \
+ a = sll; \
+ b = PASTE(VAL,LL); \
+ if ((__builtin_memcmp ((void *)&x, (void *)&a, SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&b,SIZE) != 0)) \
+ FAILURE
+
+#define TESTVAL_NONNEG(VAL,SUF,SIZE) \
+ x = PASTE(PASTE(VAL,.),SUF); \
+ si = VAL; \
+ ui = VAL; \
+ sll = PASTE(VAL,LL); \
+ ull = PASTE(VAL,ULL); \
+ a = si; \
+ b = sll; \
+ c = ui; \
+ d = ull; \
+ e = VAL; \
+ f = VAL; \
+ g = PASTE(VAL,LL); \
+ h = PASTE(VAL,ULL); \
+ if ((__builtin_memcmp ((void *)&x, (void *)&a, SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&b,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&c,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&d,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&e,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&f,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&g,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&x, (void *)&h,SIZE) != 0)) \
+ FAILURE
+
+#define TESTVAL_NONNEG_BIG(VAL,SUF,SIZE) \
+ x = PASTE(PASTE(VAL,.),SUF); \
+ sll = PASTE(VAL,LL); \
+ ull = PASTE(VAL,ULL); \
+ b = sll; \
+ d = ull; \
+ f = PASTE(VAL,LL); \
+ g = PASTE(VAL,ULL); \
+ if ((__builtin_memcmp ((void *)&x, (void *)&b, SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&d, (void *)&d,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&f, (void *)&d,SIZE) != 0) \
+ || (__builtin_memcmp ((void *)&g, (void *)&d,SIZE) != 0)) \
+ FAILURE
+
+#undef SUFFIX
+#define SUFFIX DF
+#undef TYPE
+#define TYPE _Decimal32
+
+void
+zeroes_32 (void)
+{
+ volatile TYPE x, a, b, c, d, e, f, g, h;
+ volatile int si;
+ volatile unsigned int ui;
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000000000, SUFFIX, sizeof (TYPE));
+
+ TESTVAL_NEG (0, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000000000, SUFFIX, sizeof (TYPE));
+}
+
+void
+round_32 (void)
+{
+ volatile TYPE x, a, b, c, d, e, f, g, h;
+ volatile int si;
+ volatile unsigned int ui;
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (10000049, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000050, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000051, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000001, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000002, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000003, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000004, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100000049, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100000051, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000006, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000007, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000008, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000009, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000010, SUFFIX, sizeof (TYPE));
+
+ TESTVAL_NEG (-10000049, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000050, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000051, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000001, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000002, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000003, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000004, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100000049, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100000051, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000006, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000007, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000008, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000009, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000010, SUFFIX, sizeof (TYPE));
+}
+
+#undef SUFFIX
+#define SUFFIX DD
+#undef TYPE
+#define TYPE _Decimal64
+
+void
+zeroes_64 (void)
+{
+ volatile TYPE x, a, b, c, d, e, f, g, h;
+ volatile int si;
+ volatile unsigned int ui;
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000000000, SUFFIX, sizeof (TYPE));
+
+ TESTVAL_NEG (0, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000000000, SUFFIX, sizeof (TYPE));
+}
+
+void
+round_64 (void)
+{
+ volatile TYPE x, a, b, c, d, e, f, g, h;
+ volatile int si;
+ volatile unsigned int ui;
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG_BIG (10000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000001, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000002, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000003, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000004, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000000049, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000000051, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000006, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000007, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000008, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000009, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000010, SUFFIX, sizeof (TYPE));
+
+ TESTVAL_NEG_BIG (-10000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000001, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000002, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000003, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000004, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000000049, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000000051, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000006, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000007, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000008, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000009, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000010, SUFFIX, sizeof (TYPE));
+}
+
+#undef SUFFIX
+#define SUFFIX DL
+#undef TYPE
+#define TYPE _Decimal128
+
+void
+zeroes_128 (void)
+{
+ volatile TYPE x, a, b, c, d, e, f, g, h;
+ volatile int si;
+ volatile unsigned int ui;
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (5000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (9000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (10000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (50000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (90000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (100000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (500000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (900000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG (1000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (10000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (50000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (90000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (100000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (500000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (900000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (1000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (5000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NONNEG_BIG (9000000000000000000, SUFFIX, sizeof (TYPE));
+
+ TESTVAL_NEG (0, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-5000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-9000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-10000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-50000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-90000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-100000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-500000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-900000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG (-1000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-10000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-50000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-90000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-100000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-500000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-900000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-1000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-5000000000000000000, SUFFIX, sizeof (TYPE));
+ TESTVAL_NEG_BIG (-9000000000000000000, SUFFIX, sizeof (TYPE));
+}
+
+
+int
+main ()
+{
+ zeroes_32 ();
+ zeroes_64 ();
+ zeroes_128 ();
+ round_32 ();
+ round_64 ();
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr48204.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr48204.c
new file mode 100644
index 000000000..7b421581e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr48204.c
@@ -0,0 +1,10 @@
+/* PR debug/48204 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-fre -g" } */
+
+void
+foo (void)
+{
+ float cf = 3.0f;
+ _Decimal64 d64 = cf;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr48928.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr48928.c
new file mode 100644
index 000000000..1fd363565
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr48928.c
@@ -0,0 +1,10 @@
+/* PR debug/48928 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+
+_Decimal32
+foo (_Decimal32 x)
+{
+ _Decimal32 y = (x + x) / (9.DF * x);
+ return y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr52140.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr52140.c
new file mode 100644
index 000000000..ca878f2d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pr52140.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* This used to result in an ICE. */
+
+int
+foo (_Decimal64 x, _Decimal64 y)
+{
+ return (x < y) || (x > y);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c
new file mode 100644
index 000000000..62d85b6d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c
@@ -0,0 +1,85 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Verify that the pragma has the expected result by using unsuffixed
+ float constants as operands in expressions that would mix binary and
+ decimal operands if the pragma had no effect, or the wrong effect. */
+
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+double a = 1.0 * 2.0dd;
+
+double
+f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double b = 2.0 * 3.0d;
+
+ {
+ double c = 3.0 * 4.0d;
+ b = b + c;
+ }
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ double d = 4.0 * 5.0dd;
+
+ b = b + d;
+ }
+
+ {
+ /* Default is OFF. */
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT
+ double e = 5.0 * 6.0d;
+ b = b + e;
+ }
+
+ return b;
+}
+
+double
+f2 (void)
+{
+ /* Use value from outer scope, which is ON. */
+ double b = 2.0 * 3.0dd;
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double c = 3.0 * 4.0d;
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ double d = 4.0 * 5.0dd;
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT
+ double e = 5.0 * 6.0d;
+
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ double f = 6.0 * 7.0dd;
+
+ b = a + b + c + d + e + f;
+ }
+ }
+ }
+ }
+ return b;
+}
+
+/* Use previous value from this scope, which is ON. */
+double f = 6.0 * 7.0dd;
+
+double
+f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double b = 2.0 * 3.0d;
+
+ return b + f;
+}
+
+/* Return to the state from this scope, which is ON. */
+double g = 7.0 + 8.0dd;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c
new file mode 100644
index 000000000..8bc49f771
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c
@@ -0,0 +1,86 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Verify that the pragma has the expected result by using unsuffixed
+ float constants as operands in expressions that would mix binary and
+ decimal operands if the pragma had no effect, or the wrong effect.
+ Use _Pragma rather than #pragma. */
+
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+double a = 1.0 * 2.0dd;
+
+double
+f1 (void)
+{
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
+ double b = 2.0 * 3.0d;
+
+ {
+ double c = 3.0 * 4.0d;
+ b = b + c;
+ }
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+ double d = 4.0 * 5.0dd;
+
+ b = b + d;
+ }
+
+ {
+ /* Default is OFF. */
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT")
+ double e = 5.0 * 6.0d;
+ b = b + e;
+ }
+
+ return b;
+}
+
+double
+f2 (void)
+{
+ /* Use value from outer scope, which is ON. */
+ double b = 2.0 * 3.0dd;
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
+ double c = 3.0 * 4.0d;
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+ double d = 4.0 * 5.0dd;
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT")
+ double e = 5.0 * 6.0d;
+
+ {
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 ON")
+ double f = 6.0 * 7.0dd;
+
+ b = a + b + c + d + e + f;
+ }
+ }
+ }
+ }
+ return b;
+}
+
+/* Use previous value from this scope, which is ON. */
+double f = 6.0 * 7.0dd;
+
+double
+f3 (void)
+{
+_Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF")
+ double b = 2.0 * 3.0d;
+
+ return b + f;
+}
+
+/* Return to the state from this scope, which is ON. */
+double g = 7.0 + 8.0dd;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c
new file mode 100644
index 000000000..195998670
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c
@@ -0,0 +1,83 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New). */
+
+/* Check that defining macros whose names are the same as the tokens used
+ in the pragma doesn't affect use of the pragma. */
+
+#define ON YES
+#define OFF NO
+#define DEFAULT NOPE
+#define STDC OFFICIAL
+#define FLOAT_CONST_DECIMAL64 NEW_PRAGMA
+
+double a;
+
+void
+f1a (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ a = 1.0dd + 2.0;
+}
+
+void
+f1b (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ a = 2.0d + 3.0;
+}
+
+void
+f1c (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT
+ a = 3.0d + 4.0;
+}
+
+/* Check that a macro can be used for the entire pragma. */
+
+#define PRAGMA(x) _Pragma (#x)
+#define DEFAULT_FLOAT_IS_DECIMAL PRAGMA(STDC FLOAT_CONST_DECIMAL64 ON)
+#define DEFAULT_FLOAT_IS_BINARY PRAGMA(STDC FLOAT_CONST_DECIMAL64 OFF)
+
+void
+f2a (void)
+{
+ DEFAULT_FLOAT_IS_DECIMAL
+ a = 5.0 * 6.0dd;
+}
+
+void
+f2b (void)
+{
+ DEFAULT_FLOAT_IS_BINARY
+ a = 6.0 * 7.0d;
+}
+
+/* _Pragma can be used with macros, including the use of a macro for the
+ switch. */
+
+#undef ON
+#undef OFF
+#undef DEFAULT
+#undef STDC
+#undef FLOAT_CONST_DECIMAL64
+
+#define SWITCH ON
+#define FLOAT_CONST_DECIMAL64(x) PRAGMA(STDC FLOAT_CONST_DECIMAL64 x)
+
+void
+f3a (void)
+{
+ FLOAT_CONST_DECIMAL64(SWITCH)
+ a = 1.0 * 7.0dd;
+}
+
+void
+f3b (void)
+{
+ FLOAT_CONST_DECIMAL64(OFF)
+ a = 1.0 + 2.0d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c
new file mode 100644
index 000000000..af0398daf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Check that malformed versions of pragma STDC FLOAT_CONST_DECIMAL64
+ are detected. */
+
+double a;
+
+void f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 /* { dg-warning "malformed" } */
+ a = 1.0;
+}
+
+void f2 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 DFP /* { dg-warning "malformed" } */
+ a = 2.0;
+}
+
+void f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON DFP /* { dg-warning "junk at end" } */
+ a = 3.0;
+}
+
+void f4 (void)
+{
+ _Pragma ( "STDC FLOAT_CONST_DECIMAL64" ) /* { dg-warning "malformed" } */
+ a = 1.0;
+}
+
+void f5 (void)
+{
+ _Pragma ( "STDC FLOAT_CONST_DECIMAL64 DFP" ) /* { dg-warning "malformed" } */
+ a = 2.0;
+}
+
+void f6 (void)
+{
+ _Pragma ( "STDC FLOAT_CONST_DECIMAL64 ON DFP" ) /* { dg-warning "junk at end" } */
+ a = 3.0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-5.c
new file mode 100644
index 000000000..75e9525dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-5.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Check that there is a pedantic warning for the use of pragma
+ STD FLOAT_CONST_DECIMAL64. */
+
+double a;
+
+void f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "ISO C" } */
+ a = 1.0;
+}
+
+void f2 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-warning "ISO C" } */
+ a = 2.0;
+}
+
+void f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT /* { dg-warning "ISO C" } */
+ a = 3.0;
+}
+
+void f4 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON") /* { dg-warning "ISO C" } */
+ a = 1.0;
+}
+
+void f5 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF") /* { dg-warning "ISO C" } */
+ a = 2.0;
+}
+
+void f6 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT") /* { dg-warning "ISO C" } */
+ a = 3.0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-6.c
new file mode 100644
index 000000000..03c1715be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-6.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Check that there is a pedantic error for the use of pragma
+ STD FLOAT_CONST_DECIMAL64. */
+
+double a;
+
+void f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "ISO C" } */
+ a = 1.0;
+}
+
+void f2 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-error "ISO C" } */
+ a = 2.0;
+}
+
+void f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 DEFAULT /* { dg-error "ISO C" } */
+ a = 3.0;
+}
+
+void f4 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 ON") /* { dg-error "ISO C" } */
+ a = 1.0;
+}
+
+void f5 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 OFF") /* { dg-error "ISO C" } */
+ a = 2.0;
+}
+
+void f6 (void)
+{
+ _Pragma ("STDC FLOAT_CONST_DECIMAL64 DEFAULT") /* { dg-error "ISO C" } */
+ a = 3.0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c
new file mode 100644
index 000000000..55e0d661c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Check that when pragma FLOAT_CONST_DECIMAL64 is in effect so that
+ unsuffixed constants are _Decimal64, invalid types are still reported
+ as invalid. */
+
+double
+f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double a = 0x1.0p1;
+ double b = 1.0i;
+
+ return a + b;
+}
+
+double
+f2 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ double a = 0x1.0p1dd; /* { dg-error "with hex" } */
+ double b = 1.0idd; /* { dg-error "invalid suffix" } */
+
+ return a + b;
+}
+
+double
+f3 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ double a = 0x1.0p1; /* Hex constant is not affected by pragma. */
+ double b = 1.0i; /* Imaginary constant is not affected by pragma. */
+
+ return a + b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c
new file mode 100644
index 000000000..39d38c1d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c
@@ -0,0 +1,174 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma.
+ C99 6.4.4.2a (New).
+
+ Pragma STDC FLOAT_CONST_DECIMAL64 "shall occur either outside external
+ declarations or preceding all explicit declarations and statements
+ inside a compound statement." */
+
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+
+#define MAX 200
+
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+
+double a;
+
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+
+struct S1 {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ int i;
+ int j;
+};
+
+struct S2 {
+ int i;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ int j;
+};
+
+struct S3 {
+ int i;
+ int j;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+};
+
+enum E1 {
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+ one,
+ two
+};
+
+enum E2 {
+ red,
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+ blue
+};
+
+enum E3 {
+ cat,
+ dog
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+};
+
+double
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-error "#pragma" } */
+b;
+
+double
+f1 (void)
+{
+#pragma STDC FLOAT_CONST_DECIMAL64 ON
+ return a;
+}
+
+double
+f2 (void)
+{
+ double b;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ b = 0.5;
+ return a + b;
+}
+
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+
+double
+f3 (void)
+{
+ typedef double b32;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ b32 b = 0.5;
+ return b;
+}
+
+double
+f4 (int i)
+{
+top:
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-warning "invalid location" } */
+ if (i == 0)
+ return a;
+ a *= 2.;
+ i = 0;
+ goto top;
+}
+
+double
+f5 (int i)
+{
+ a = a * i;
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF /* { dg-warning "invalid location" } */
+ return a * 2.;
+}
+
+double
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+f6 (void)
+{
+ return a;
+}
+
+double
+f7
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-error "#pragma" } */
+(void) /* { dg-error "before" } */
+{
+ return a;
+}
+
+double
+f8 (void)
+{
+ {
+#pragma STDC FLOAT_CONST_DECIMAL64 OFF
+ }
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ return a;
+}
+
+extern void foo9 (void *);
+
+double
+f9 (void)
+{
+ __label__ here;
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ foo9 (&&here);
+here:
+ return a;
+}
+
+double
+f10 (void)
+{
+ void foo10 (void)
+ {
+ a = 1.0;
+ }
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ return a;
+}
+
+double
+f11 (void)
+{
+ __extension__
+ struct A {
+ struct { char a; };
+ char b;
+ };
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ return a;
+}
+
+double
+f12 (void)
+{
+ __extension__ ({ a = 0.5; });
+#pragma STDC FLOAT_CONST_DECIMAL64 ON /* { dg-warning "invalid location" } */
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/struct-union.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/struct-union.c
new file mode 100644
index 000000000..956fdcf21
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/struct-union.c
@@ -0,0 +1,62 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+/* C99 6.5.2.3 Structure and union members.
+ If the first expression has qualified type, the result has the so-qualified
+ version of the type of the designated member. */
+
+struct s {_Decimal32 d32; const _Decimal64 d64;};
+struct sv { volatile _Decimal32 d32; volatile _Decimal64 d64; };
+union u
+{
+ const _Decimal64 d64;
+ _Decimal32 d32;
+ const struct s cs;
+};
+
+struct s s;
+struct sv sv;
+const struct s cs;
+
+union u u;
+const union u cu;
+
+struct s g (struct s s)
+{
+ return s;
+}
+
+union u h (union u u)
+{
+ return u;
+}
+
+void f()
+{
+ cs.d32 = 1.23dd; /* { dg-error "assignment of member 'd32' in read-only object" } */
+ cs.d64 = 1.23df; /* { dg-error "assignment of member 'd64' in read-only object" } */
+ s.d64 = 1.23df; /* { dg-error "assignment of read-only member" } */
+
+ s.d32 = 1.23dd;
+ u.d32 = 1.23dd;
+
+ u.d64 = 1.23df; /* { dg-error "assignment of read-only member" } */
+ u.cs.d32 = 1.23dd; /* { dg-error "assignment of member 'd32' in read-only object" } */
+ u.cs.d64 = 1.23df; /* { dg-error "assignment of member 'd64' in read-only object" } */
+
+ cu.d32 = 1.23dd; /* { dg-error "assignment of member 'd32' in read-only object" } */
+
+ cu.d64 = 1.23df; /* { dg-error "assignment of member 'd64' in read-only object" } */
+ cu.cs.d32 = 1.23dd; /* { dg-error "assignment of member 'd32' in read-only object" } */
+ cu.cs.d64 = 1.23df; /* { dg-error "assignment of member 'd64' in read-only object" } */
+
+ /* f().x is a valid postfix expression but is not an lvalue if
+ function f() returning a structure or union. */
+ g(s).d32 = 1.23dd; /* { dg-error "lvalue required" } */
+ h(u).d64 = 1.23df; /* { dg-error "lvalue required" } */
+
+ /* Test assignment to volatile structure members. */
+ sv.d32 = 1.1df;
+ sv.d64 = 1.1dd;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/typespec.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/typespec.c
new file mode 100644
index 000000000..a4545d5d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/typespec.c
@@ -0,0 +1,302 @@
+/* Test for valid and invalid combinations of type specifiers.
+ Based off gcc.dg/test-spec-1.c */
+/* { dg-do compile } */
+
+typedef char type;
+void _Decimal32 *x0; /* { dg-error "" "void _Decimal32" } */
+void _Decimal64 *x1; /* { dg-error "" "void _Decimal64" } */
+void _Decimal128 *x2; /* { dg-error "" "void _Decimal128" } */
+char _Decimal32 *x3; /* { dg-error "" "char _Decimal32" } */
+char _Decimal64 *x4; /* { dg-error "" "char _Decimal64" } */
+char _Decimal128 *x5; /* { dg-error "" "char _Decimal128" } */
+short _Decimal32 *x6; /* { dg-error "" "short _Decimal32" } */
+short _Decimal64 *x7; /* { dg-error "" "short _Decimal64" } */
+short _Decimal128 *x8; /* { dg-error "" "short _Decimal128" } */
+int _Decimal32 *x9; /* { dg-error "" "int _Decimal32" } */
+int _Decimal64 *x10; /* { dg-error "" "int _Decimal64" } */
+int _Decimal128 *x11; /* { dg-error "" "int _Decimal128" } */
+long _Decimal32 *x12; /* { dg-error "" "long _Decimal32" } */
+long _Decimal64 *x13; /* { dg-error "" "long _Decimal64" } */
+long _Decimal128 *x14; /* { dg-error "" "long _Decimal128" } */
+float _Decimal32 *x15; /* { dg-error "" "float _Decimal32" } */
+float _Decimal64 *x16; /* { dg-error "" "float _Decimal64" } */
+float _Decimal128 *x17; /* { dg-error "" "float _Decimal128" } */
+double _Decimal32 *x18; /* { dg-error "" "double _Decimal32" } */
+double _Decimal64 *x19; /* { dg-error "" "double _Decimal64" } */
+double _Decimal128 *x20; /* { dg-error "" "double _Decimal128" } */
+signed _Decimal32 *x21; /* { dg-error "" "signed _Decimal32" } */
+signed _Decimal64 *x22; /* { dg-error "" "signed _Decimal64" } */
+signed _Decimal128 *x23; /* { dg-error "" "signed _Decimal128" } */
+_Bool _Decimal32 *x24; /* { dg-error "" "_Bool _Decimal32" } */
+_Bool _Decimal64 *x25; /* { dg-error "" "_Bool _Decimal64" } */
+_Bool _Decimal128 *x26; /* { dg-error "" "_Bool _Decimal128" } */
+int _Decimal32 *x27; /* { dg-error "" "int _Decimal32" } */
+int _Decimal64 *x28; /* { dg-error "" "int _Decimal64" } */
+int _Decimal128 *x29; /* { dg-error "" "int _Decimal128" } */
+type _Decimal32 *x30; /* { dg-error "" "type _Decimal32" } */
+type _Decimal64 *x31; /* { dg-error "" "type _Decimal64" } */
+type _Decimal128 *x32; /* { dg-error "" "type _Decimal128" } */
+char signed _Decimal32 *x33; /* { dg-error "" "char signed _Decimal32" } */
+char signed _Decimal64 *x34; /* { dg-error "" "char signed _Decimal64" } */
+char signed _Decimal128 *x35; /* { dg-error "" "char signed _Decimal128" } */
+char unsigned _Decimal32 *x36; /* { dg-error "" "char unsigned _Decimal32" } */
+char unsigned _Decimal64 *x37; /* { dg-error "" "char unsigned _Decimal64" } */
+char unsigned _Decimal128 *x38; /* { dg-error "" "char unsigned _Decimal128" } */
+short _Decimal32 *x39; /* { dg-error "" "short _Decimal32" } */
+short _Decimal64 *x40; /* { dg-error "" "short _Decimal64" } */
+short _Decimal128 *x41; /* { dg-error "" "short _Decimal128" } */
+short signed _Decimal32 *x42; /* { dg-error "" "short signed _Decimal32" } */
+short signed _Decimal64 *x43; /* { dg-error "" "short signed _Decimal64" } */
+short signed _Decimal128 *x44; /* { dg-error "" "short signed _Decimal128" } */
+short unsigned _Decimal32 *x45; /* { dg-error "" "short unsigned _Decimal32" } */
+short unsigned _Decimal64 *x46; /* { dg-error "" "short unsigned _Decimal64" } */
+short unsigned _Decimal128 *x47; /* { dg-error "" "short unsigned _Decimal128" } */
+_Decimal32 short*x48; /* { dg-error "" "_Decimal32 short" } */
+_Decimal64 short*x49; /* { dg-error "" "_Decimal64 short" } */
+_Decimal128 short*x50; /* { dg-error "" "_Decimal128 short" } */
+_Decimal32 short signed*x51; /* { dg-error "" "_Decimal32 short signed" } */
+_Decimal64 short signed*x52; /* { dg-error "" "_Decimal64 short signed" } */
+_Decimal128 short signed*x53; /* { dg-error "" "_Decimal128 short signed" } */
+_Decimal32 short unsigned*x54; /* { dg-error "" "_Decimal32 short unsigned" } */
+_Decimal64 short unsigned*x55; /* { dg-error "" "_Decimal64 short unsigned" } */
+_Decimal128 short unsigned*x56; /* { dg-error "" "_Decimal128 short unsigned" } */
+_Decimal32 long*x57; /* { dg-error "" "_Decimal32 long" } */
+_Decimal64 long*x58; /* { dg-error "" "_Decimal64 long" } */
+_Decimal128 long*x59; /* { dg-error "" "_Decimal128 long" } */
+_Decimal32 long signed*x60; /* { dg-error "" "_Decimal32 long signed" } */
+_Decimal64 long signed*x61; /* { dg-error "" "_Decimal64 long signed" } */
+_Decimal128 long signed*x62; /* { dg-error "" "_Decimal128 long signed" } */
+_Decimal32 long unsigned*x63; /* { dg-error "" "_Decimal32 long unsigned" } */
+_Decimal64 long unsigned*x64; /* { dg-error "" "_Decimal64 long unsigned" } */
+_Decimal128 long unsigned*x65; /* { dg-error "" "_Decimal128 long unsigned" } */
+_Decimal32 signed long*x66; /* { dg-error "" "_Decimal32 signed long" } */
+_Decimal64 signed long*x67; /* { dg-error "" "_Decimal64 signed long" } */
+_Decimal128 signed long*x68; /* { dg-error "" "_Decimal128 signed long" } */
+_Decimal32 signed short*x69; /* { dg-error "" "_Decimal32 signed short" } */
+_Decimal64 signed short*x70; /* { dg-error "" "_Decimal64 signed short" } */
+_Decimal128 signed short*x71; /* { dg-error "" "_Decimal128 signed short" } */
+int signed _Decimal32 *x72; /* { dg-error "" "int signed _Decimal32" } */
+int signed _Decimal64 *x73; /* { dg-error "" "int signed _Decimal64" } */
+int signed _Decimal128 *x74; /* { dg-error "" "int signed _Decimal128" } */
+int unsigned _Decimal32 *x75; /* { dg-error "" "int unsigned _Decimal32" } */
+int unsigned _Decimal64 *x76; /* { dg-error "" "int unsigned _Decimal64" } */
+int unsigned _Decimal128 *x77; /* { dg-error "" "int unsigned _Decimal128" } */
+long int _Decimal32 *x78; /* { dg-error "" "long int _Decimal32" } */
+long int _Decimal64 *x79; /* { dg-error "" "long int _Decimal64" } */
+long int _Decimal128 *x80; /* { dg-error "" "long int _Decimal128" } */
+long long _Decimal32 *x81; /* { dg-error "" "long long _Decimal32" } */
+long long _Decimal64 *x82; /* { dg-error "" "long long _Decimal64" } */
+long long _Decimal128 *x83; /* { dg-error "" "long long _Decimal128" } */
+long double _Decimal32 *x84; /* { dg-error "" "long double _Decimal32" } */
+long double _Decimal64 *x85; /* { dg-error "" "long double _Decimal64" } */
+long double _Decimal128 *x86; /* { dg-error "" "long double _Decimal128" } */
+long signed _Decimal32 *x87; /* { dg-error "" "long signed _Decimal32" } */
+long signed _Decimal64 *x88; /* { dg-error "" "long signed _Decimal64" } */
+long signed _Decimal128 *x89; /* { dg-error "" "long signed _Decimal128" } */
+long unsigned _Decimal32 *x90; /* { dg-error "" "long unsigned _Decimal32" } */
+long unsigned _Decimal64 *x91; /* { dg-error "" "long unsigned _Decimal64" } */
+long unsigned _Decimal128 *x92; /* { dg-error "" "long unsigned _Decimal128" } */
+double long _Decimal32 *x93; /* { dg-error "" "double long _Decimal32" } */
+double long _Decimal64 *x94; /* { dg-error "" "double long _Decimal64" } */
+double long _Decimal128 *x95; /* { dg-error "" "double long _Decimal128" } */
+signed char _Decimal32 *x96; /* { dg-error "" "signed char _Decimal32" } */
+signed char _Decimal64 *x97; /* { dg-error "" "signed char _Decimal64" } */
+signed char _Decimal128 *x98; /* { dg-error "" "signed char _Decimal128" } */
+signed short _Decimal32 *x99; /* { dg-error "" "signed short _Decimal32" } */
+signed short _Decimal64 *x100; /* { dg-error "" "signed short _Decimal64" } */
+signed short _Decimal128 *x101; /* { dg-error "" "signed short _Decimal128" } */
+signed int _Decimal32 *x102; /* { dg-error "" "signed int _Decimal32" } */
+signed int _Decimal64 *x103; /* { dg-error "" "signed int _Decimal64" } */
+signed int _Decimal128 *x104; /* { dg-error "" "signed int _Decimal128" } */
+signed long _Decimal32 *105x; /* { dg-error "" "signed long _Decimal32" } */
+signed long _Decimal64 *x107; /* { dg-error "" "signed long _Decimal64" } \*/
+signed long _Decimal128 *x107; /* { dg-error "" "signed long _Decimal128" } \*/
+unsigned char _Decimal32 *x108; /* { dg-error "" "unsigned char _Decimal32" } */
+unsigned char _Decimal64 *x109; /* { dg-error "" "unsigned char _Decimal64" } */
+unsigned char _Decimal128 *x110; /* { dg-error "" "unsigned char _Decimal128" } */
+unsigned short _Decimal32 *x111; /* { dg-error "" "unsigned short _Decimal32" } */
+unsigned short _Decimal64 *x112; /* { dg-error "" "unsigned short _Decimal64" } */
+unsigned short _Decimal128 *x113; /* { dg-error "" "unsigned short _Decimal128" } */
+unsigned int _Decimal32 *x114; /* { dg-error "" "unsigned int _Decimal32" } */
+unsigned int _Decimal64 *x115; /* { dg-error "" "unsigned int _Decimal64" } */
+unsigned int _Decimal128 *x116; /* { dg-error "" "unsigned int _Decimal128" } */
+unsigned long _Decimal32 *x117; /* { dg-error "" "unsigned long _Decimal32" } */
+unsigned long _Decimal64 *x118; /* { dg-error "" "unsigned long _Decimal64" } */
+unsigned long _Decimal128 *x119; /* { dg-error "" "unsigned long _Decimal128" } */
+short int signed _Decimal32 *x120; /* { dg-error "" "short int signed _Decimal32" } */
+short int signed _Decimal64 *x121; /* { dg-error "" "short int signed _Decimal64" } */
+short int signed _Decimal128 *x122; /* { dg-error "" "short int signed _Decimal128" } */
+short int unsigned _Decimal32 *x123; /* { dg-error "" "short int unsigned _Decimal32" } */
+short int unsigned _Decimal64 *x124; /* { dg-error "" "short int unsigned _Decimal64" } */
+short int unsigned _Decimal128 *x125; /* { dg-error "" "short int unsigned _Decimal128" } */
+short signed int _Decimal32 *x126; /* { dg-error "" "short signed int _Decimal32" } */
+short signed int _Decimal64 *x127; /* { dg-error "" "short signed int _Decimal64" } */
+short signed int _Decimal128 *x128; /* { dg-error "" "short signed int _Decimal128" } */
+short unsigned int _Decimal32 *x129; /* { dg-error "" "short unsigned int _Decimal32" } */
+short unsigned int _Decimal64 *x130; /* { dg-error "" "short unsigned int _Decimal64" } */
+short unsigned int _Decimal128 *x131; /* { dg-error "" "short unsigned int _Decimal128" } */
+int short signed _Decimal32 *x132; /* { dg-error "" "int short signed _Decimal32" } */
+int short signed _Decimal64 *x133; /* { dg-error "" "int short signed _Decimal64" } */
+int short signed _Decimal128 *x134; /* { dg-error "" "int short signed _Decimal128" } */
+int short unsigned _Decimal32 *x135; /* { dg-error "" "int short unsigned _Decimal32" } */
+int short unsigned _Decimal64 *x136; /* { dg-error "" "int short unsigned _Decimal64" } */
+int short unsigned _Decimal128 *x137; /* { dg-error "" "int short unsigned _Decimal128" } */
+int long long _Decimal32 *x138; /* { dg-error "" "int long long _Decimal32" } */
+int long long _Decimal64 *x139; /* { dg-error "" "int long long _Decimal64" } */
+int long long _Decimal128 *x140; /* { dg-error "" "int long long _Decimal128" } */
+int long signed _Decimal32 *x141; /* { dg-error "" "int long signed _Decimal32" } */
+int long signed _Decimal64 *x142; /* { dg-error "" "int long signed _Decimal64" } */
+int long signed _Decimal128 *x143; /* { dg-error "" "int long signed _Decimal128" } */
+int long unsigned _Decimal32 *x144; /* { dg-error "" "int long unsigned _Decimal32" } */
+int long unsigned _Decimal64 *x145; /* { dg-error "" "int long unsigned _Decimal64" } */
+int long unsigned _Decimal128 *x146; /* { dg-error "" "int long unsigned _Decimal128" } */
+int signed short _Decimal32 *x147; /* { dg-error "" "int signed short _Decimal32" } */
+int signed short _Decimal64 *x148; /* { dg-error "" "int signed short _Decimal64" } */
+int signed short _Decimal128 *x149; /* { dg-error "" "int signed short _Decimal128" } */
+int signed long _Decimal32 *x150; /* { dg-error "" "int signed long _Decimal32" } */
+int signed long _Decimal64 *x151; /* { dg-error "" "int signed long _Decimal64" } */
+int signed long _Decimal128 *x152; /* { dg-error "" "int signed long _Decimal128" } */
+int unsigned short _Decimal32 *x153; /* { dg-error "" "int unsigned short _Decimal32" } */
+int unsigned short _Decimal64 *x154; /* { dg-error "" "int unsigned short _Decimal64" } */
+int unsigned short _Decimal128 *x155; /* { dg-error "" "int unsigned short _Decimal128" } */
+int unsigned long _Decimal32 *x156; /* { dg-error "" "int unsigned long _Decimal32" } */
+int unsigned long _Decimal64 *x157; /* { dg-error "" "int unsigned long _Decimal64" } */
+int unsigned long _Decimal128 *x158; /* { dg-error "" "int unsigned long _Decimal128" } */
+long int long _Decimal32 *x159; /* { dg-error "" "long int long _Decimal32" } */
+long int long _Decimal64 *x160; /* { dg-error "" "long int long _Decimal64" } */
+long int long _Decimal128 *x161; /* { dg-error "" "long int long _Decimal128" } */
+long int signed _Decimal32 *x162; /* { dg-error "" "long int signed _Decimal32" } */
+long int signed _Decimal64 *x163; /* { dg-error "" "long int signed _Decimal64" } */
+long int signed _Decimal128 *x164; /* { dg-error "" "long int signed _Decimal128" } */
+long int unsigned _Decimal32 *x165; /* { dg-error "" "long int unsigned _Decimal32" } */
+long int unsigned _Decimal64 *x166; /* { dg-error "" "long int unsigned _Decimal64" } */
+long int unsigned _Decimal128 *x167; /* { dg-error "" "long int unsigned _Decimal128" } */
+long long int _Decimal32 *x168; /* { dg-error "" "long long int _Decimal32" } */
+long long int _Decimal64 *x169; /* { dg-error "" "long long int _Decimal64" } */
+long long int _Decimal128 *x170; /* { dg-error "" "long long int _Decimal128" } */
+long long signed _Decimal32 *x171; /* { dg-error "" "long long signed _Decimal32" } */
+long long signed _Decimal64 *x172; /* { dg-error "" "long long signed _Decimal64" } */
+long long signed _Decimal128 *x172; /* { dg-error "" "long long signed _Decimal128" } */
+long long unsigned _Decimal32 *x175; /* { dg-error "" "long long unsigned _Decimal32" } */
+long long unsigned _Decimal64 *x176; /* { dg-error "" "long long unsigned _Decimal64" } */
+long long unsigned _Decimal128 *x177; /* { dg-error "" "long long unsigned _Decimal128" } */
+long signed int _Decimal32 *x178; /* { dg-error "" "long signed int _Decimal32" } */
+long signed int _Decimal64 *x179; /* { dg-error "" "long signed int _Decimal64" } */
+long signed int _Decimal128 *x180; /* { dg-error "" "long signed int _Decimal128" } */
+long unsigned int _Decimal32 *x181; /* { dg-error "" "long unsigned int _Decimal32" } */
+long unsigned int _Decimal64 *x182; /* { dg-error "" "long unsigned int _Decimal64" } */
+long unsigned int _Decimal128 *x183; /* { dg-error "" "long unsigned int _Decimal128" } */
+long unsigned long _Decimal32 *x184; /* { dg-error "" "long unsigned long _Decimal32" } */
+long unsigned long _Decimal64 *x185; /* { dg-error "" "long unsigned long _Decimal64" } */
+long unsigned long _Decimal128 *x186; /* { dg-error "" "long unsigned long _Decimal128" } */
+signed short int _Decimal32 *x187; /* { dg-error "" "signed short int _Decimal32" } */
+signed short int _Decimal64 *x188; /* { dg-error "" "signed short int _Decimal64" } */
+signed short int _Decimal128 *x189; /* { dg-error "" "signed short int _Decimal128" } */
+signed int short _Decimal32 *x190; /* { dg-error "" "signed int short _Decimal32" } */
+signed int short _Decimal64 *x191; /* { dg-error "" "signed int short _Decimal64" } */
+signed int short _Decimal128 *x191; /* { dg-error "" "signed int short _Decimal128" } */
+signed int long _Decimal32 *x192; /* { dg-error "" "signed int long _Decimal32" } */
+signed int long _Decimal64 *x193; /* { dg-error "" "signed int long _Decimal64" } */
+signed int long _Decimal128 *x194; /* { dg-error "" "signed int long _Decimal128" } */
+signed long int _Decimal32 *x195; /* { dg-error "" "signed long int _Decimal32" } */
+signed long int _Decimal64 *x196; /* { dg-error "" "signed long int _Decimal64" } */
+signed long int _Decimal128 *x197; /* { dg-error "" "signed long int _Decimal128" } */
+signed long long _Decimal32 *x198; /* { dg-error "" "signed long long _Decimal32" } */
+signed long long _Decimal64 *x199; /* { dg-error "" "signed long long _Decimal64" } */
+signed long long _Decimal128 *x200; /* { dg-error "" "signed long long _Decimal128" } */
+unsigned short int _Decimal32 *x201; /* { dg-error "" "unsigned short int _Decimal32" } */
+unsigned short int _Decimal64 *x202; /* { dg-error "" "unsigned short int _Decimal64" } */
+unsigned short int _Decimal128 *x203; /* { dg-error "" "unsigned short int _Decimal128" } */
+unsigned int short _Decimal32 *x204; /* { dg-error "" "unsigned int short _Decimal32" } */
+unsigned int short _Decimal64 *x205; /* { dg-error "" "unsigned int short _Decimal64" } */
+unsigned int short _Decimal128 *x206; /* { dg-error "" "unsigned int short _Decimal128" } */
+unsigned int long _Decimal32 *x207; /* { dg-error "" "unsigned int long _Decimal32" } */
+unsigned int long _Decimal64 *x208; /* { dg-error "" "unsigned int long _Decimal64" } */
+unsigned int long _Decimal128 *x209; /* { dg-error "" "unsigned int long _Decimal128" } */
+unsigned long int _Decimal32 *x210; /* { dg-error "" "unsigned long int _Decimal32" } */
+unsigned long int _Decimal64 *x211; /* { dg-error "" "unsigned long int _Decimal64" } */
+unsigned long int _Decimal128 *x212; /* { dg-error "" "unsigned long int _Decimal128" } */
+unsigned long long _Decimal32 *x213; /* { dg-error "" "unsigned long long _Decimal32" } */
+unsigned long long _Decimal64 *x214; /* { dg-error "" "unsigned long long _Decimal64" } */
+unsigned long long _Decimal128 *x215; /* { dg-error "" "unsigned long long _Decimal128" } */
+int long long signed _Decimal32 *x216; /* { dg-error "" "int long long signed _Decimal32" } */
+int long long signed _Decimal64 *x217; /* { dg-error "" "int long long signed _Decimal64" } */
+int long long signed _Decimal128 *x218; /* { dg-error "" "int long long signed _Decimal128" } */
+int long long unsigned _Decimal32 *x219; /* { dg-error "" "int long long unsigned _Decimal32" } */
+int long long unsigned _Decimal64 *x220; /* { dg-error "" "int long long unsigned _Decimal64" } */
+int long long unsigned _Decimal128 *x221; /* { dg-error "" "int long long unsigned _Decimal128" } */
+int long signed long _Decimal32 *x222; /* { dg-error "" "int long signed long _Decimal32" } */
+int long signed long _Decimal64 *x223; /* { dg-error "" "int long signed long _Decimal64" } */
+int long signed long _Decimal128 *x224; /* { dg-error "" "int long signed long _Decimal128" } */
+int long unsigned long _Decimal32 *x226; /* { dg-error "" "int long unsigned long _Decimal32" } */
+int long unsigned long _Decimal64 *x227; /* { dg-error "" "int long unsigned long _Decimal64" } */
+int long unsigned long _Decimal128 *x228; /* { dg-error "" "int long unsigned long _Decimal128" } */
+int signed long long _Decimal32 *x229; /* { dg-error "" "int signed long long _Decimal32" } */
+int signed long long _Decimal64 *x230; /* { dg-error "" "int signed long long _Decimal64" } */
+int signed long long _Decimal128 *x231; /* { dg-error "" "int signed long long _Decimal128" } */
+int unsigned long long _Decimal32 *x232; /* { dg-error "" "int unsigned long long _Decimal32" } */
+int unsigned long long _Decimal64 *x233; /* { dg-error "" "int unsigned long long _Decimal64" } */
+int unsigned long long _Decimal128 *x234; /* { dg-error "" "int unsigned long long _Decimal128" } */
+long int long signed _Decimal32 *x235; /* { dg-error "" "long int long signed _Decimal32" } */
+long int long signed _Decimal64 *x236; /* { dg-error "" "long int long signed _Decimal64" } */
+long int long signed _Decimal128 *x237; /* { dg-error "" "long int long signed _Decimal128" } */
+long int long unsigned _Decimal32 *x238; /* { dg-error "" "long int long unsigned _Decimal32" } */
+long int long unsigned _Decimal64 *x239; /* { dg-error "" "long int long unsigned _Decimal64" } */
+long int long unsigned _Decimal128 *x240; /* { dg-error "" "long int long unsigned _Decimal128" } */
+long int signed long _Decimal32 *x241; /* { dg-error "" "long int signed long _Decimal32" } */
+long int signed long _Decimal64 *x242; /* { dg-error "" "long int signed long _Decimal64" } */
+long int signed long _Decimal128 *x243; /* { dg-error "" "long int signed long _Decimal128" } */
+long int unsigned long _Decimal32 *x244; /* { dg-error "" "long int unsigned long _Decimal32" } */
+long int unsigned long _Decimal64 *x245; /* { dg-error "" "long int unsigned long _Decimal64" } */
+long int unsigned long _Decimal128 *x246; /* { dg-error "" "long int unsigned long _Decimal128" } */
+long long int signed _Decimal32 *x247; /* { dg-error "" "long long int signed _Decimal32" } */
+long long int signed _Decimal64 *x248; /* { dg-error "" "long long int signed _Decimal64" } */
+long long int signed _Decimal128 *x249; /* { dg-error "" "long long int signed _Decimal128" } */
+long long int unsigned _Decimal32 *x250; /* { dg-error "" "long long int unsigned _Decimal32" } */
+long long int unsigned _Decimal64 *x251; /* { dg-error "" "long long int unsigned _Decimal64" } */
+long long int unsigned _Decimal128 *x252; /* { dg-error "" "long long int unsigned _Decimal128" } */
+long long signed int _Decimal32 *x253; /* { dg-error "" "long long signed int _Decimal32" } */
+long long signed int _Decimal64 *x254; /* { dg-error "" "long long signed int _Decimal64" } */
+long long signed int _Decimal128 *x255; /* { dg-error "" "long long signed int _Decimal128" } */
+long long unsigned int _Decimal32 *x256; /* { dg-error "" "long long unsigned int _Decimal32" } */
+long long unsigned int _Decimal64 *x257; /* { dg-error "" "long long unsigned int _Decimal64" } */
+long long unsigned int _Decimal128 *x258; /* { dg-error "" "long long unsigned int _Decimal128" } */
+long signed int long _Decimal32 *x259; /* { dg-error "" "long signed int long _Decimal32" } */
+long signed int long _Decimal64 *x260; /* { dg-error "" "long signed int long _Decimal64" } */
+long signed int long _Decimal128 *x261; /* { dg-error "" "long signed int long _Decimal128" } */
+long signed long int _Decimal32 *x262; /* { dg-error "" "long signed long int _Decimal32" } */
+long signed long int _Decimal64 *x263; /* { dg-error "" "long signed long int _Decimal64" } */
+long signed long int _Decimal128 *x264; /* { dg-error "" "long signed long int _Decimal128" } */
+long unsigned int long _Decimal32 *x265; /* { dg-error "" "long unsigned int long _Decimal32" } */
+long unsigned int long _Decimal64 *x266; /* { dg-error "" "long unsigned int long _Decimal64" } */
+long unsigned int long _Decimal128 *x267; /* { dg-error "" "long unsigned int long _Decimal128" } */
+long unsigned long int _Decimal32 *x268; /* { dg-error "" "long unsigned long int _Decimal32" } */
+long unsigned long int _Decimal64 *x269; /* { dg-error "" "long unsigned long int _Decimal64" } */
+long unsigned long int _Decimal128 *x270; /* { dg-error "" "long unsigned long int _Decimal128" } */
+signed long long int _Decimal32 *x271; /* { dg-error "" "signed long long int _Decimal32" } */
+signed long long int _Decimal64 *x272; /* { dg-error "" "signed long long int _Decimal64" } */
+signed long long int _Decimal128 *x273; /* { dg-error "" "signed long long int _Decimal128" } */
+unsigned int long long _Decimal32 *x274; /* { dg-error "" "unsigned int long long _Decimal32" } */
+unsigned int long long _Decimal64 *x275; /* { dg-error "" "unsigned int long long _Decimal64" } */
+unsigned int long long _Decimal128 *x276; /* { dg-error "" "unsigned int long long _Decimal128" } */
+unsigned long int long _Decimal32 *x277; /* { dg-error "" "unsigned long int long _Decimal32" } */
+unsigned long int long _Decimal64 *x278; /* { dg-error "" "unsigned long int long _Decimal64" } */
+unsigned long int long _Decimal128 *x279; /* { dg-error "" "unsigned long int long _Decimal128" } */
+unsigned long long int _Decimal32 *x280; /* { dg-error "" "unsigned long long int _Decimal32" } */
+unsigned long long int _Decimal64 *x281; /* { dg-error "" "unsigned long long int _Decimal64" } */
+unsigned long long int _Decimal128 *x282; /* { dg-error "" "unsigned long long int _Decimal128" } */
+
+_Complex _Decimal32 *x283; /* { dg-error "" "_Complex _Decimal32" } */
+_Complex _Decimal64 *x284; /* { dg-error "" "_Complex _Decimal64" } */
+_Complex _Decimal128 *x285; /* { dg-error "" "_Complex _Decimal128" } */
+
+_Decimal32 _Complex *x286; /* { dg-error "" "_Decimal32 _Complex" } */
+_Decimal64 _Complex *x287; /* { dg-error "" "_Decimal64 _Complex" } */
+_Decimal128 _Complex *x288; /* { dg-error "" "_Decimal128 _Complex" } */
+
+unsigned _Decimal32 *x289; /* { dg-error "" "unsigned _Decimal32" } */
+unsigned _Decimal64 *x290; /* { dg-error "" "unsigned _Decimal64" } */
+unsigned _Decimal128 *x291; /* { dg-error "" "unsigned _Decimal128" } */
+signed _Decimal32 *x292; /* { dg-error "" "signed _Decimal32" } */
+signed _Decimal64 *x293; /* { dg-error "" "signed _Decimal64" } */
+signed _Decimal128 *x294; /* { dg-error "" "signed _Decimal128" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/union-init.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/union-init.c
new file mode 100644
index 000000000..6896ece99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/union-init.c
@@ -0,0 +1,58 @@
+/* Cast to union is a GNU C extension. */
+
+#include "dfp-dbg.h"
+
+union u
+{
+ _Decimal128 d128;
+ double d;
+};
+
+union n
+{
+ double d;
+ _Decimal64 d64;
+};
+
+int main ()
+{
+ static union u u1 = { 0.0dl };
+ static union u u2 = { 4.2dl };
+ static union u u4 = { 0.0 };
+
+ static union n n1 = { 2.2dd };
+ static union n n2 = { 3.25 };
+
+ _Decimal128 d128;
+ _Decimal64 d64;
+ double d;
+
+ if (u1.d128 != 0.0dl)
+ FAILURE
+
+ if (u2.d128 != 4.2dl)
+ FAILURE
+
+ /* cast decimal floating point to union type. */
+ d128 = 1.23dl;
+ d64 = 4.56dd;
+ d = 3.25;
+
+ u4 = (union u) d128;
+ if (u4.d128 != 1.23dl)
+ FAILURE
+
+ u4 = (union u) d;
+ if (u4.d != 3.25)
+ FAILURE
+
+ n1 = (union n) d64;
+ if (n1.d64 != 4.56dd)
+ FAILURE
+
+ n1 = (union n)d;
+ if (n1.d != 3.25)
+ FAILURE
+
+ FINISH
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c
new file mode 100644
index 000000000..7bd0f64f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+/* This used to result in an ICE. */
+
+extern _Decimal64 x;
+extern int i;
+
+void
+foo (void)
+{
+ if (x <= 2.0) /* { dg-error "mix operands" } */
+ i++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad.c
new file mode 100644
index 000000000..e14c7b20a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+
+/* N1150 5.4: Usual arithmetic conversions.
+ C99 6.3.1.8[1] (New).
+
+ Test arithmetic operators between decimal float types and generic
+ float types, which are not allowed. */
+
+extern _Decimal32 d32a, d32b;
+extern _Decimal64 d64a, d64b;
+extern _Decimal128 d128a, d128b;
+extern float f;
+extern double d;
+extern long double ld;
+
+extern signed int __attribute__ ((vector_size (16))) vi;
+
+extern _Complex float cf;
+extern _Complex double cd;
+extern _Complex long double cld;
+extern _Complex int ci;
+
+void
+foo (void)
+{
+ /* Mixed operations with decimal and generic float operands. */
+ d32a = d32b + f; /* { dg-error "" "error.*mix operands of decimal float" } */
+ d32a = f * d32b; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d32a *= f; /* { dg-error "" "error.* mix operands of decimal float" } */
+ f += d32b; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d64a = d32a + d; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d64a = d * d128a; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d64a -= d; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d128a = ld * d128b; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d128a = d64b + d; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d128a *= f; /* { dg-error "" "error.* mix operands of decimal float" } */
+
+ /* Mixed operations with decimal float and a vector type. */
+ d64a = d64b + vi; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d32a *= vi; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d128a = vi - d128b; /* { dg-error "" "error.* mix operands of decimal float" } */
+
+ /* Mixed operations with decimal float and Complex types. */
+ d32a += ci; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d64a = ci * d32a; /* { dg-error "" "error.* mix operands of decimal float" } */
+ cd = d64a * cd; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d128b = cld * d128b; /* { dg-error "" "error.* mix operands of decimal float" } */
+ d32a = cf * d32b; /* { dg-error "" "error.* mix operands of decimal float" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dfp/wtr-conversion-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/wtr-conversion-1.c
new file mode 100644
index 000000000..4eff00725
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dfp/wtr-conversion-1.c
@@ -0,0 +1,75 @@
+/* Test for -Wtraditional warnings on conversions by prototypes.
+ Note, gcc should omit these warnings in system header files.
+ Based on gcc.dg/wtr-conversion-1.c */
+
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+extern void foo_i (int);
+extern void foo_f (float);
+extern void foo_ld (long double);
+extern void foo_d32 (_Decimal32);
+extern void foo_d64 (_Decimal64);
+extern void foo_d128 (_Decimal128);
+
+extern int i;
+extern float f;
+extern long double ld;
+extern _Decimal32 d32;
+extern _Decimal64 d64;
+extern _Decimal128 d128;
+
+void
+testfunc1 ()
+{
+ foo_i (i);
+ foo_i (d32); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
+ foo_i (d64); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
+ foo_i (d128); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
+ foo_d32 (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
+ foo_d32 (f); /* { dg-warning "as '_Decimal32' rather than 'float'" "prototype conversion warning" } */
+ foo_d32 (ld); /* { dg-warning "as '_Decimal32' rather than 'long double'" "prototype conversion warning" } */
+ foo_d32 (d64); /* { dg-warning "as '_Decimal32' rather than '_Decimal64'" "prototype conversion warning" } */
+ foo_d32 (d128); /* { dg-warning "as '_Decimal32' rather than '_Decimal128'" "prototype conversion warning" } */
+ foo_d64 (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
+ foo_d64 (f); /* { dg-warning "as '_Decimal64' rather than 'float'" "prototype conversion warning" } */
+ foo_d64 (ld); /* { dg-warning "as '_Decimal64' rather than 'long double'" "prototype conversion warning" } */
+ foo_d64 (d32); /* { dg-bogus "as '_Decimal64' rather than '_Decimal32'" "prototype conversion warning" } */
+ foo_d64 (d128); /* { dg-warning "as '_Decimal64' rather than '_Decimal128'" "prototype conversion warning" } */
+ foo_d128 (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
+ foo_d128 (f); /* { dg-warning "as '_Decimal128' rather than 'float'" "prototype conversion warning" } */
+ foo_d128 (ld); /* { dg-warning "as '_Decimal128' rather than 'long double'" "prototype conversion warning" } */
+ foo_d128 (d32); /* { dg-bogus "as '_Decimal128' rather than '_Decimal32'" "prototype conversion warning" } */
+ foo_d128 (d64); /* { dg-bogus "as '_Decimal128' rather than '_Decimal64'" "prototype conversion warning" } */
+ foo_d128 (d128); /* { dg-bogus "as '_Decimal128' rather than '_Decimal'" "prototype conversion warning" } */
+}
+
+# 54 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+void
+testfunc2 ()
+{
+ foo_i (i);
+ foo_i (d32);
+ foo_i (d64);
+ foo_i (d128);
+ foo_d32 (i);
+ foo_d32 (f);
+ foo_d32 (ld);
+ foo_d32 (d32);
+ foo_d32 (d64);
+ foo_d32 (d128);
+ foo_d64 (i);
+ foo_d64 (f);
+ foo_d64 (ld);
+ foo_d64 (d32);
+ foo_d64 (d64);
+ foo_d64 (d128);
+ foo_d128 (i);
+ foo_d128 (f);
+ foo_d128 (ld);
+ foo_d128 (d32);
+ foo_d128 (d64);
+ foo_d128 (d128);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dg.exp b/gcc-4.9/gcc/testsuite/gcc.dg/dg.exp
new file mode 100644
index 000000000..7a56bdd29
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dg.exp
@@ -0,0 +1,40 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cSi\]]] \
+ "" $DEFAULT_CFLAGS
+
+# C/C++ common tests.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/*.\[cSi\]]] \
+ " -Wc++-compat " ""
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/di-longlong64-sync-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/di-longlong64-sync-1.c
new file mode 100644
index 000000000..b49acd27a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/di-longlong64-sync-1.c
@@ -0,0 +1,166 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-options "-std=gnu99" } */
+/* { dg-additional-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
+
+
+/* Test basic functionality of the intrinsics. The operations should
+ not be optimized away if no one checks the return values. */
+
+/* Based on ia64-sync-[12].c, but 1) long on ARM is 32 bit so use long long
+ (an explicit 64bit type maybe a better bet) and 2) Use values that cross
+ the 32bit boundary and cause carries since the actual maths are done as
+ pairs of 32 bit instructions. */
+
+/* Note: This file is #included by some of the ARM tests. */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern void *memcpy (void *, const void *, size_t);
+extern int memcmp (const void *, const void *, size_t);
+
+/* Temporary space where the work actually gets done. */
+static long long AL[24];
+/* Values copied into AL before we start. */
+static long long init_di[24] = { 0x100000002ll, 0x200000003ll, 0, 1,
+
+ 0x100000002ll, 0x100000002ll,
+ 0x100000002ll, 0x100000002ll,
+
+ 0, 0x1000e0de0000ll,
+ 42 , 0xc001c0de0000ll,
+
+ -1ll, 0, 0xff00ff0000ll, -1ll,
+
+ 0, 0x1000e0de0000ll,
+ 42 , 0xc001c0de0000ll,
+
+ -1ll, 0, 0xff00ff0000ll, -1ll};
+/* This is what should be in AL at the end. */
+static long long test_di[24] = { 0x1234567890ll, 0x1234567890ll, 1, 0,
+
+ 0x100000002ll, 0x100000002ll,
+ 0x100000002ll, 0x100000002ll,
+
+ 1, 0xc001c0de0000ll,
+ 20, 0x1000e0de0000ll,
+
+ 0x300000007ll , 0x500000009ll,
+ 0xf100ff0001ll, ~0xa00000007ll,
+
+ 1, 0xc001c0de0000ll,
+ 20, 0x1000e0de0000ll,
+
+ 0x300000007ll , 0x500000009ll,
+ 0xf100ff0001ll, ~0xa00000007ll };
+
+/* First check they work in terms of what they do to memory. */
+static void
+do_noret_di (void)
+{
+ __sync_val_compare_and_swap (AL+0, 0x100000002ll, 0x1234567890ll);
+ __sync_bool_compare_and_swap (AL+1, 0x200000003ll, 0x1234567890ll);
+ __sync_lock_test_and_set (AL+2, 1);
+ __sync_lock_release (AL+3);
+
+ /* The following tests should not change the value since the
+ original does NOT match. */
+ __sync_val_compare_and_swap (AL+4, 0x000000002ll, 0x1234567890ll);
+ __sync_val_compare_and_swap (AL+5, 0x100000000ll, 0x1234567890ll);
+ __sync_bool_compare_and_swap (AL+6, 0x000000002ll, 0x1234567890ll);
+ __sync_bool_compare_and_swap (AL+7, 0x100000000ll, 0x1234567890ll);
+
+ __sync_fetch_and_add (AL+8, 1);
+ __sync_fetch_and_add (AL+9, 0xb000e0000000ll); /* + to both halves & carry. */
+ __sync_fetch_and_sub (AL+10, 22);
+ __sync_fetch_and_sub (AL+11, 0xb000e0000000ll);
+
+ __sync_fetch_and_and (AL+12, 0x300000007ll);
+ __sync_fetch_and_or (AL+13, 0x500000009ll);
+ __sync_fetch_and_xor (AL+14, 0xe00000001ll);
+ __sync_fetch_and_nand (AL+15, 0xa00000007ll);
+
+ /* These should be the same as the fetch_and_* cases except for
+ return value. */
+ __sync_add_and_fetch (AL+16, 1);
+ /* add to both halves & carry. */
+ __sync_add_and_fetch (AL+17, 0xb000e0000000ll);
+ __sync_sub_and_fetch (AL+18, 22);
+ __sync_sub_and_fetch (AL+19, 0xb000e0000000ll);
+
+ __sync_and_and_fetch (AL+20, 0x300000007ll);
+ __sync_or_and_fetch (AL+21, 0x500000009ll);
+ __sync_xor_and_fetch (AL+22, 0xe00000001ll);
+ __sync_nand_and_fetch (AL+23, 0xa00000007ll);
+}
+
+/* Now check return values. */
+static void
+do_ret_di (void)
+{
+ if (__sync_val_compare_and_swap (AL+0, 0x100000002ll, 0x1234567890ll) !=
+ 0x100000002ll) abort ();
+ if (__sync_bool_compare_and_swap (AL+1, 0x200000003ll, 0x1234567890ll) !=
+ 1) abort ();
+ if (__sync_lock_test_and_set (AL+2, 1) != 0) abort ();
+ __sync_lock_release (AL+3); /* no return value, but keep to match results. */
+
+ /* The following tests should not change the value since the
+ original does NOT match. */
+ if (__sync_val_compare_and_swap (AL+4, 0x000000002ll, 0x1234567890ll) !=
+ 0x100000002ll) abort ();
+ if (__sync_val_compare_and_swap (AL+5, 0x100000000ll, 0x1234567890ll) !=
+ 0x100000002ll) abort ();
+ if (__sync_bool_compare_and_swap (AL+6, 0x000000002ll, 0x1234567890ll) !=
+ 0) abort ();
+ if (__sync_bool_compare_and_swap (AL+7, 0x100000000ll, 0x1234567890ll) !=
+ 0) abort ();
+
+ if (__sync_fetch_and_add (AL+8, 1) != 0) abort ();
+ if (__sync_fetch_and_add (AL+9, 0xb000e0000000ll) != 0x1000e0de0000ll) abort ();
+ if (__sync_fetch_and_sub (AL+10, 22) != 42) abort ();
+ if (__sync_fetch_and_sub (AL+11, 0xb000e0000000ll) != 0xc001c0de0000ll)
+ abort ();
+
+ if (__sync_fetch_and_and (AL+12, 0x300000007ll) != -1ll) abort ();
+ if (__sync_fetch_and_or (AL+13, 0x500000009ll) != 0) abort ();
+ if (__sync_fetch_and_xor (AL+14, 0xe00000001ll) != 0xff00ff0000ll) abort ();
+ if (__sync_fetch_and_nand (AL+15, 0xa00000007ll) != -1ll) abort ();
+
+ /* These should be the same as the fetch_and_* cases except for
+ return value. */
+ if (__sync_add_and_fetch (AL+16, 1) != 1) abort ();
+ if (__sync_add_and_fetch (AL+17, 0xb000e0000000ll) != 0xc001c0de0000ll)
+ abort ();
+ if (__sync_sub_and_fetch (AL+18, 22) != 20) abort ();
+ if (__sync_sub_and_fetch (AL+19, 0xb000e0000000ll) != 0x1000e0de0000ll)
+ abort ();
+
+ if (__sync_and_and_fetch (AL+20, 0x300000007ll) != 0x300000007ll) abort ();
+ if (__sync_or_and_fetch (AL+21, 0x500000009ll) != 0x500000009ll) abort ();
+ if (__sync_xor_and_fetch (AL+22, 0xe00000001ll) != 0xf100ff0001ll) abort ();
+ if (__sync_nand_and_fetch (AL+23, 0xa00000007ll) != ~0xa00000007ll) abort ();
+}
+
+int main ()
+{
+ memcpy (AL, init_di, sizeof (init_di));
+
+ do_noret_di ();
+
+ if (memcmp (AL, test_di, sizeof (test_di)))
+ abort ();
+
+ memcpy (AL, init_di, sizeof (init_di));
+
+ do_ret_di ();
+
+ if (memcmp (AL, test_di, sizeof (test_di)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/di-sync-multithread.c b/gcc-4.9/gcc/testsuite/gcc.dg/di-sync-multithread.c
new file mode 100644
index 000000000..493f1e272
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/di-sync-multithread.c
@@ -0,0 +1,213 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-require-effective-target pthread_h } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-pthread -std=gnu99" } */
+/* { dg-additional-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+/* test of long long atomic ops performed in parallel in 3 pthreads
+ david.gilbert@linaro.org */
+
+#include <pthread.h>
+#include <unistd.h>
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+/*#define DEBUGIT 1 */
+
+#ifdef DEBUGIT
+#include <stdio.h>
+
+#define DOABORT(x,...) {\
+ fprintf (stderr, x, __VA_ARGS__); fflush (stderr); abort ();\
+ }
+
+#else
+
+#define DOABORT(x,...) abort ();
+
+#endif
+
+/* Passed to each thread to describe which bits it is going to work on. */
+struct threadwork {
+ unsigned long long count; /* incremented each time the worker loops. */
+ unsigned int thread; /* ID */
+ unsigned int addlsb; /* 8 bit */
+ unsigned int logic1lsb; /* 5 bit */
+ unsigned int logic2lsb; /* 8 bit */
+};
+
+/* The shared word where all the atomic work is done. */
+static volatile long long workspace;
+
+/* A shared word to tell the workers to quit when non-0. */
+static long long doquit;
+
+extern void abort (void);
+
+/* Note this test doesn't test the return values much. */
+void*
+worker (void* data)
+{
+ struct threadwork *tw = (struct threadwork*)data;
+ long long add1bit = 1ll << tw->addlsb;
+ long long logic1bit = 1ll << tw->logic1lsb;
+ long long logic2bit = 1ll << tw->logic2lsb;
+
+ /* Clear the bits we use. */
+ __sync_and_and_fetch (&workspace, ~(0xffll * add1bit));
+ __sync_fetch_and_and (&workspace, ~(0x1fll * logic1bit));
+ __sync_fetch_and_and (&workspace, ~(0xffll * logic2bit));
+
+ do
+ {
+ long long tmp1, tmp2, tmp3;
+ /* OK, lets try and do some stuff to the workspace - by the end
+ of the main loop our area should be the same as it is now - i.e. 0. */
+
+ /* Push the arithmetic section up to 128 - one of the threads will
+ case this to carry across the 32bit boundary. */
+ for (tmp2 = 0; tmp2 < 64; tmp2++)
+ {
+ /* Add 2 using the two different adds. */
+ tmp1 = __sync_add_and_fetch (&workspace, add1bit);
+ tmp3 = __sync_fetch_and_add (&workspace, add1bit);
+
+ /* The value should be the intermediate add value in both cases. */
+ if ((tmp1 & (add1bit * 0xff)) != (tmp3 & (add1bit * 0xff)))
+ DOABORT ("Mismatch of add intermediates on thread %d "
+ "workspace=0x%llx tmp1=0x%llx "
+ "tmp2=0x%llx tmp3=0x%llx\n",
+ tw->thread, workspace, tmp1, tmp2, tmp3);
+ }
+
+ /* Set the logic bits. */
+ tmp2=__sync_or_and_fetch (&workspace,
+ 0x1fll * logic1bit | 0xffll * logic2bit);
+
+ /* Check the logic bits are set and the arithmetic value is correct. */
+ if ((tmp2 & (0x1fll * logic1bit | 0xffll * logic2bit
+ | 0xffll * add1bit))
+ != (0x1fll * logic1bit | 0xffll * logic2bit | 0x80ll * add1bit))
+ DOABORT ("Midloop check failed on thread %d "
+ "workspace=0x%llx tmp2=0x%llx "
+ "masktmp2=0x%llx expected=0x%llx\n",
+ tw->thread, workspace, tmp2,
+ tmp2 & (0x1fll * logic1bit | 0xffll * logic2bit |
+ 0xffll * add1bit),
+ (0x1fll * logic1bit | 0xffll * logic2bit | 0x80ll * add1bit));
+
+ /* Pull the arithmetic set back down to 0 - again this should cause a
+ carry across the 32bit boundary in one thread. */
+
+ for (tmp2 = 0; tmp2 < 64; tmp2++)
+ {
+ /* Subtract 2 using the two different subs. */
+ tmp1=__sync_sub_and_fetch (&workspace, add1bit);
+ tmp3=__sync_fetch_and_sub (&workspace, add1bit);
+
+ /* The value should be the intermediate sub value in both cases. */
+ if ((tmp1 & (add1bit * 0xff)) != (tmp3 & (add1bit * 0xff)))
+ DOABORT ("Mismatch of sub intermediates on thread %d "
+ "workspace=0x%llx tmp1=0x%llx "
+ "tmp2=0x%llx tmp3=0x%llx\n",
+ tw->thread, workspace, tmp1, tmp2, tmp3);
+ }
+
+
+ /* Clear the logic bits. */
+ __sync_fetch_and_xor (&workspace, 0x1fll * logic1bit);
+ tmp3=__sync_and_and_fetch (&workspace, ~(0xffll * logic2bit));
+
+ /* The logic bits and the arithmetic bits should be zero again. */
+ if (tmp3 & (0x1fll * logic1bit | 0xffll * logic2bit | 0xffll * add1bit))
+ DOABORT ("End of worker loop; bits none 0 on thread %d "
+ "workspace=0x%llx tmp3=0x%llx "
+ "mask=0x%llx maskedtmp3=0x%llx\n",
+ tw->thread, workspace, tmp3, (0x1fll * logic1bit |
+ 0xffll * logic2bit | 0xffll * add1bit),
+ tmp3 & (0x1fll * logic1bit | 0xffll * logic2bit | 0xffll * add1bit));
+
+ __sync_add_and_fetch (&tw->count, 1);
+ }
+ while (!__sync_bool_compare_and_swap (&doquit, 1, 1));
+
+ pthread_exit (0);
+}
+
+int
+main ()
+{
+ /* We have 3 threads doing three sets of operations, an 8 bit
+ arithmetic field, a 5 bit logic field and an 8 bit logic
+ field (just to pack them all in).
+
+ 6 5 4 4 3 2 1
+ 3 6 8 0 2 4 6 8 0
+ |...,...|...,...|...,...|...,...|...,...|...,...|...,...|...,...
+ - T0 -- T1 -- T2 --T2 -- T0 -*- T2-- T1-- T1 -***- T0-
+ logic2 logic2 arith log2 arith log1 log1 arith log1
+
+ */
+ unsigned int t;
+ long long tmp;
+ int err;
+
+ struct threadwork tw[3]={
+ { 0ll, 0, 27, 0, 56 },
+ { 0ll, 1, 8,16, 48 },
+ { 0ll, 2, 40,21, 35 }
+ };
+
+ pthread_t threads[3];
+
+ __sync_lock_release (&doquit);
+
+ /* Get the work space into a known value - All 1's. */
+ __sync_lock_release (&workspace); /* Now all 0. */
+ tmp = __sync_val_compare_and_swap (&workspace, 0, -1ll);
+ if (tmp!=0)
+ DOABORT ("Initial __sync_val_compare_and_swap wasn't 0 workspace=0x%llx "
+ "tmp=0x%llx\n", workspace,tmp);
+
+ for (t = 0; t < 3; t++)
+ {
+ err=pthread_create (&threads[t], NULL , worker, &tw[t]);
+ if (err) DOABORT ("pthread_create failed on thread %d with error %d\n",
+ t, err);
+ };
+
+#ifdef _WIN32
+ Sleep (5000);
+#else
+ sleep (5);
+#endif
+
+ /* Stop please. */
+ __sync_lock_test_and_set (&doquit, 1ll);
+
+ for (t = 0; t < 3; t++)
+ {
+ err=pthread_join (threads[t], NULL);
+ if (err)
+ DOABORT ("pthread_join failed on thread %d with error %d\n", t, err);
+ };
+
+ __sync_synchronize ();
+
+ /* OK, so all the workers have finished -
+ the workers should have zero'd their workspace, the unused areas
+ should still be 1. */
+ if (!__sync_bool_compare_and_swap (&workspace, 0x040000e0ll, 0))
+ DOABORT ("End of run workspace mismatch, got %llx\n", workspace);
+
+ /* All the workers should have done some work. */
+ for (t = 0; t < 3; t++)
+ {
+ if (tw[t].count == 0) DOABORT ("Worker %d gave 0 count\n", t);
+ };
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/div-compare-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/div-compare-1.c
new file mode 100644
index 000000000..61adafe14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/div-compare-1.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+extern void abort(void);
+
+typedef unsigned long long uint64;
+
+int very_large_value (uint64 t)
+{
+ return (t / 1000000000ULL) > 9223372037ULL;
+}
+
+int main(void)
+{
+ uint64 t = 0xC000000000000000ULL;
+
+ if (!very_large_value (t))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/div-double-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/div-double-1.c
new file mode 100644
index 000000000..f290ab067
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/div-double-1.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffinite-math-only" } */
+/* { dg-require-effective-target double64plus } */
+
+extern void abort (void);
+
+volatile double a = 2.002083e-146;
+volatile double b;
+
+int
+main()
+{
+ b = 1. / a;
+
+ if (b != (1. / 2.002083e-146))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/divbyzero.c b/gcc-4.9/gcc/testsuite/gcc.dg/divbyzero.c
new file mode 100644
index 000000000..607aa12d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/divbyzero.c
@@ -0,0 +1,21 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+/* Source: Neil Booth, Oct 22 2001. PR 150 - warn about division by
+ zero. */
+
+#define ZERO (4 - 6 + 2)
+
+int main (int argc, char *argv[])
+{
+ int w = argc % ZERO; /* { dg-warning "division by zero" } */
+ int x = argc / 0; /* { dg-warning "division by zero" } */
+ int y = argc / ZERO; /* { dg-warning "division by zero" } */
+
+ double z = 0.0 / 0.0 ; /* { dg-bogus "division by zero" } */
+ w = (ZERO ? y / ZERO : x); /* { dg-bogus "division by zero" } */
+ x = (ZERO ? argc % ZERO: x); /* { dg-bogus "division by zero" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-1.c
new file mode 100644
index 000000000..f823523b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target arm*-*-pe* } } */
+/* { dg-options -mno-nop-fun-dllimport } */
+
+__declspec (dllimport) void imp ();
+
+__declspec (dllexport) void _exp () { imp (); }
+
+/* { dg-final { scan-assembler "\.section\[ \t\]*.drectve\n\[^\n\]*-export:_exp.*__imp_imp" } } */
+/* { dg-final { scan-assembler-not "__imp__exp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-10.c
new file mode 100644
index 000000000..2f0c6ce31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-10.c
@@ -0,0 +1,54 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-10a.c" } */
+/* { dg-options "-w -O2 -std=gnu99 -fno-keep-inline-dllexport" } */
+/* { dg-prune-output .*undefined.* } */
+/* { dg-xfail-if "link failure expected" { *-*-* } } */
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called - except when -fno-keep-inline-dllexport.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-10a.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-10a.c
new file mode 100644
index 000000000..80caf3217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-10a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-11.c
new file mode 100644
index 000000000..5fa2e6f19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-11.c
@@ -0,0 +1,52 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-11a.c" } */
+/* { dg-options "-w -O2 -std=gnu89 -fkeep-inline-dllexport" } */
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called, when -fkeep-inline-dllexport is supplied.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-11a.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-11a.c
new file mode 100644
index 000000000..80caf3217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-11a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-12.c
new file mode 100644
index 000000000..4f8829964
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-12.c
@@ -0,0 +1,52 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-12a.c" } */
+/* { dg-options "-w -O2 -std=gnu99 -fkeep-inline-dllexport" } */
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called, when -fkeep-inline-dllexport is supplied.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-12a.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-12a.c
new file mode 100644
index 000000000..80caf3217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-12a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-2.c
new file mode 100644
index 000000000..3b8b60eee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-2.c
@@ -0,0 +1,22 @@
+/* These dllimport and dllexport appearing for a symbol.
+ The desired behavior is that if both dllimport
+ and dllexport appear (in either order) the result is dllexport.
+
+ Microsoft's MSVC 2.0 allows dllimport followed by dllexport for variables,
+ but does not allow dllexport followed by dllimport.
+
+ In C, it's ok to redeclare a variable so this works for variables
+ and functions. In C++, it only works for functions. */
+
+/* { dg-require-dll "" } */
+
+__declspec (dllimport) int foo1 ();
+__declspec (dllexport) int foo1 (); /* { dg-warning "previous dllimport ignored" } */
+__declspec (dllexport) int foo2 ();
+__declspec (dllimport) int foo2 (); /* { dg-warning "dllimport ignored" } */
+
+__declspec (dllimport) int bar1;
+__declspec (dllexport) int bar1; /* { dg-warning "previous dllimport ignored" } */
+
+__declspec (dllexport) int bar2;
+__declspec (dllimport) int bar2; /* { dg-warning "dllimport ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-3.c
new file mode 100644
index 000000000..f68758cca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-3.c
@@ -0,0 +1,18 @@
+/* Ensure dllexport overrides dllimport. */
+
+/* { dg-do compile { target arm*-*-pe* } } */
+/* { dg-do compile { target i?86-pc-cygwin } } */
+/* { dg-do compile { target i?86-*-mingw* x86_64-*-mingw*} } */
+
+__declspec (dllimport) int foo1 ();
+__declspec (dllexport) int foo1 (); /* { dg-warning "previous dllimport ignored" } */
+
+__declspec (dllexport) int foo2 ();
+__declspec (dllimport) int foo2 (); /* { dg-warning "dllimport ignored" } */
+
+__declspec (dllexport) int foo1 () { return foo2 (); }
+__declspec (dllexport) int foo2 () { return foo1 (); }
+
+/* { dg-final { scan-assembler "\.section\[ \t\]*.drectve\n.*-export:\[\\\\\"\]*foo2" } } */
+/* { dg-final { scan-assembler "-export:\[\\\\\"\]*foo1" } } */
+/* { dg-final { scan-assembler-not "(__imp_foo1|_imp__foo1|__imp_foo2|_imp__foo2)" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-4.c
new file mode 100644
index 000000000..e2d701b47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target arm*-*-pe* } } */
+/* { dg-do compile { target i?86-pc-cygwin } } */
+/* { dg-do compile { target i?86-*-mingw* x86_64-*-mingw* } } */
+
+__declspec (dllimport) int foo1;
+int foo1; /* { dg-warning "redeclared without dllimport" } */
+
+__declspec (dllimport) int foo2;
+int foo2 = 5; /* { dg-warning "redeclared without dllimport" } */
+
+int f () { return foo1 + foo2; }
+
+/* FIXME: We should scan the output of nm for this case. */
+/* { dg-final { scan-assembler "(foo2:)" } } */
+/* { dg-final { scan-assembler "(\.comm\[ \t_\]*foo1)" } } */
+/* { dg-final { scan-assembler-not "(__imp_|_imp__)" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-5.c
new file mode 100644
index 000000000..d28603b56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-5.c
@@ -0,0 +1,22 @@
+/* { dg-do compile { target i?86-pc-cygwin } } */
+/* { dg-do compile { target i?86-*-mingw* x86_64-*-mingw* } } */
+/* { dg-do compile { target arm*-*-pe* } } */
+
+/* { dg-options -mnop-fun-dllimport } */
+
+/* The dllimport attribute should be ignored for functions. */
+__declspec (dllimport) void dllimpfn ();
+
+/* The dllimport attribute should not be ignored for variables. */
+__declspec (dllimport) int dllimpvar;
+
+/* The dllexport attribute should not be ignored. */
+__declspec (dllexport) void dllexp ()
+{
+ dllimpfn ();
+ dllimpvar = 0;
+}
+
+/* { dg-final { scan-assembler-not "(__imp_dllimpfn|_imp__dllimpfn)" } } */
+/* { dg-final { scan-assembler "(__imp_dllimpvar|_imp__dllimpvar)" } } */
+/* { dg-final { scan-assembler "\.section\[ \t\]*.drectve\n\.*-export:\[\\\\\"\]*dllexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-6.c
new file mode 100644
index 000000000..7907f40d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-6.c
@@ -0,0 +1,52 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-6a.c" } */
+/* { dg-options "-w -O2 -std=gnu89" } */
+
+/* Test that inline functions declared "dllexport" appear in object
+ files, even if they are not called.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-6a.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-6a.c
new file mode 100644
index 000000000..80caf3217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-6a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-7.c
new file mode 100644
index 000000000..c3a5957ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-7.c
@@ -0,0 +1,52 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-7a.c" } */
+/* { dg-options "-w -O2 -std=gnu99" } */
+
+/* Test that inline functions declared "dllexport" appear in object
+ files, even if they are not called.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-7a.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-7a.c
new file mode 100644
index 000000000..80caf3217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-7a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-8.c
new file mode 100644
index 000000000..98afba8d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-8.c
@@ -0,0 +1,14 @@
+/* { dg-do compile { target i?86-pc-cygwin } } */
+/* { dg-do compile { target i?86-*-mingw* x86_64-*-mingw*} } */
+/* { dg-options "-O3 -fwhole-program" } */
+/* { dg-final { scan-assembler "foo1" } } */
+/* { dg-final { scan-assembler-not "foo2" } } */
+/* { dg-final { scan-assembler "doo1" } } */
+/* { dg-final { scan-assembler-not "doo2" } } */
+
+__declspec(dllexport) int doo1 = 2;
+int doo2 = 3;
+__declspec(dllexport) int foo1 (void) { return 0; }
+int foo2 (void) { return 1; }
+int main() { return 0; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-9.c
new file mode 100644
index 000000000..ae641d29d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-9.c
@@ -0,0 +1,54 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-9a.c" } */
+/* { dg-options "-w -O2 -std=gnu89 -fno-keep-inline-dllexport" } */
+/* { dg-prune-output .*undefined.* } */
+/* { dg-xfail-if "link failure expected" { *-*-* } } */
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called - except when -fno-keep-inline-dllexport.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dll-9a.c b/gcc-4.9/gcc/testsuite/gcc.dg/dll-9a.c
new file mode 100644
index 000000000..80caf3217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dll-9a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/do-empty.c b/gcc-4.9/gcc/testsuite/gcc.dg/do-empty.c
new file mode 100644
index 000000000..350261d48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/do-empty.c
@@ -0,0 +1,15 @@
+/* Test diagnostics for empty bodies in do / while. */
+/* { dg-do compile } */
+/* { dg-options "-Wempty-body" } */
+
+void
+f (int x)
+{
+ do
+ ; /* { dg-warning "empty body in" } */
+ while (x--);
+
+ do
+ {} /* { dg-bogus "empty body in" } */
+ while (++x < 10);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dollar.c b/gcc-4.9/gcc/testsuite/gcc.dg/dollar.c
new file mode 100644
index 000000000..43407f227
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dollar.c
@@ -0,0 +1,9 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options -fno-dollars-in-identifiers } */
+
+/* Test that -fno-dollars-in-identifiers is honoured.
+ Neil Booth, 17 May 2003. */
+
+int foobar$; /* { dg-error "stray '\\$'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/doloop-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/doloop-2.c
new file mode 100644
index 000000000..115ec742b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/doloop-2.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+extern void abort (void);
+unsigned global_iters;
+
+void bi_reverse(int len)
+{
+ do {
+ global_iters++;
+ } while (--len > 0);
+}
+
+int main()
+{
+ bi_reverse(5);
+ if (global_iters != 5)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
new file mode 100644
index 000000000..79c55ef84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
@@ -0,0 +1,16 @@
+/* Test for bogus diagnostics for dremf definition. Although this
+ definition is formally incorrect in ISO C, a GNU extension permits
+ a prototype followed by unpromoted types in a function definition,
+ so it should be permitted when the function is built in. Bug
+ 16666. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+float dremf (float, float);
+
+float
+dremf (x, y)
+ float x, y;
+{
+ return x + y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
new file mode 100644
index 000000000..980ead187
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
@@ -0,0 +1,18 @@
+/* Test for bogus diagnostics for dremf definition. Although this
+ definition is formally incorrect in ISO C, a GNU extension permits
+ a prototype followed by unpromoted types in a function definition,
+ so it should be permitted when the function is built in. Bug
+ 16666. Test with -pedantic, where the problem should still be
+ diagnosed. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+float dremf (float, float); /* { dg-warning "prototype declaration" } */
+
+float
+dremf (x, y)
+ float x; /* { dg-warning "promoted argument 'x' doesn't match prototype" } */
+ float y; /* { dg-warning "promoted argument 'y' doesn't match prototype" } */
+{
+ return x + y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
new file mode 100644
index 000000000..3934a64e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
@@ -0,0 +1,18 @@
+/* Test for bogus diagnostics for dremf definition. Although this
+ definition is formally incorrect in ISO C, a GNU extension permits
+ a prototype followed by unpromoted types in a function definition,
+ so it should be permitted when the function is built in. Bug
+ 16666. Test with -pedantic-errors, where the problem should still
+ be diagnosed. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+float dremf (float, float); /* { dg-error "prototype declaration" } */
+
+float
+dremf (x, y)
+ float x; /* { dg-error "promoted argument 'x' doesn't match prototype" } */
+ float y; /* { dg-error "promoted argument 'y' doesn't match prototype" } */
+{
+ return x + y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
new file mode 100644
index 000000000..b3a2c5ad5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
@@ -0,0 +1,13 @@
+/* Test for bogus diagnostics for dremf definition, as in bug 16666.
+ The GNU extension permitting a prototype to override the promotion
+ of old-style parameter declarations should only apply when the
+ prototype is visible, not for a built-in prototype. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+float
+dremf(x, y) /* { dg-warning "conflicting types for built-in function 'dremf'" } */
+ float x, y;
+{
+ return x + y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dse.c b/gcc-4.9/gcc/testsuite/gcc.dg/dse.c
new file mode 100644
index 000000000..4a859ae03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dse.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse-details" } */
+
+#define N 256
+
+struct
+{
+ int x;
+ int y;
+} S[100];
+
+int z[100];
+
+int
+foo (void)
+{
+ int i;
+ int x, y;
+
+ S[5].x = 0;
+ S[5].y = 0;
+
+ x = 5 + z[0];
+ y = z[0];
+
+ S[5].x = x;
+ S[5].y = y;
+}
+
+/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */
+/* { dg-final { cleanup-tree-dump "dse*" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/duff-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/duff-1.c
new file mode 100644
index 000000000..b718f6c05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/duff-1.c
@@ -0,0 +1,50 @@
+/* Duff's device is legal C; test to make sure the compiler
+ doesn't complain about it.
+
+ Jason Thorpe <thorpej@wasabisystems.com>
+ Derived from PR 3846. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+typedef __SIZE_TYPE__ size_t;
+extern int memcmp (const void *, const void *, size_t);
+
+void
+duffcpy (char *dst, const char *src, unsigned long size)
+{
+ switch (size & 3)
+ {
+ for (;;)
+ {
+ *dst++ = *src++;
+ case 3:
+ *dst++ = *src++;
+ case 2:
+ *dst++ = *src++;
+ case 1:
+ *dst++ = *src++;
+ case 0:
+ if (size <= 3)
+ break;
+ size -= 4;
+ }
+ }
+}
+
+const char testpat[] = "The quick brown fox jumped over the lazy dog.";
+
+int
+main()
+{
+ char buf[64];
+
+ duffcpy (buf, testpat, sizeof (testpat));
+ if (memcmp (buf, testpat, sizeof (testpat)) != 0)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/duff-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/duff-2.c
new file mode 100644
index 000000000..8b8923eb9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/duff-2.c
@@ -0,0 +1,60 @@
+/* Duff's device is legal C; test to make sure the compiler
+ doesn't complain about it.
+
+ Jason Thorpe <thorpej@wasabisystems.com>
+ Derived from the BSD Telnet Kerberos 4 checksum routine.
+ See also PR 5230. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+#if __INT_MAX__ >= 2147483647
+/* At least 32-bit integers. */
+typedef int type32;
+#else
+typedef long type32;
+#endif
+
+type32
+cksum (const unsigned char *src, unsigned long size)
+{
+ type32 ck = 0;
+
+ switch (size & 3)
+ {
+ while (size > 0)
+ {
+ case 0:
+ ck ^= (type32)*src++ << 24;
+ --size;
+ case 3:
+ ck ^= (type32)*src++ << 16;
+ --size;
+ case 2:
+ ck ^= (type32)*src++ << 8;
+ --size;
+ case 1:
+ ck ^= (type32)*src++;
+ --size;
+ }
+ }
+
+ return ck;
+}
+
+const char testpat[] = "The quick brown fox jumped over the lazy dog.";
+
+int
+main()
+{
+ type32 ck;
+
+ ck = cksum ((const unsigned char *) testpat, sizeof (testpat));
+ if (ck != 925902908)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/duff-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/duff-3.c
new file mode 100644
index 000000000..23cddeff9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/duff-3.c
@@ -0,0 +1,47 @@
+/* Duff's device is legal C; test to make sure the compiler
+ doesn't complain about it.
+
+ Jason Thorpe <thorpej@wasabisystems.com>
+ Derived from Tom Duff's original usenet message about the device. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+typedef __SIZE_TYPE__ size_t;
+extern int memcmp (const void *, const void *, size_t);
+
+void
+duffcpy (char *dst, const char *src, unsigned long size)
+{
+ unsigned long n = (size + 7) / 8;
+
+ switch (size % 8)
+ {
+ case 0: do { *dst++ = *src++;
+ case 7: *dst++ = *src++;
+ case 6: *dst++ = *src++;
+ case 5: *dst++ = *src++;
+ case 4: *dst++ = *src++;
+ case 3: *dst++ = *src++;
+ case 2: *dst++ = *src++;
+ case 1: *dst++ = *src++;
+ } while (--n > 0);
+ }
+}
+
+const char testpat[] = "The quick brown fox jumped over the lazy dog.";
+
+int
+main()
+{
+ char buf[64];
+
+ duffcpy (buf, testpat, sizeof (testpat));
+ if (memcmp (buf, testpat, sizeof (testpat)) != 0)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/duff-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/duff-4.c
new file mode 100644
index 000000000..7032285af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/duff-4.c
@@ -0,0 +1,60 @@
+/* Duff's device is legal C; test to make sure the compiler
+ doesn't complain about it.
+
+ Roger Sayle <roger@eyesopen.com>
+ Derived from duff-2.c. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+#if __INT_MAX__ >= 2147483647
+/* At least 32-bit integers. */
+typedef int type32;
+#else
+typedef long type32;
+#endif
+
+type32
+cksum (const unsigned char *src, unsigned long size)
+{
+ type32 ck = 0;
+
+ switch (size & 3)
+ {
+ do
+ {
+ case 0:
+ ck ^= (type32)*src++ << 24;
+ --size;
+ case 3:
+ ck ^= (type32)*src++ << 16;
+ --size;
+ case 2:
+ ck ^= (type32)*src++ << 8;
+ --size;
+ case 1:
+ ck ^= (type32)*src++;
+ --size;
+ }
+ while (size > 0);
+ }
+
+ return ck;
+}
+
+const char testpat[] = "The quick brown fox jumped over the lazy dog.";
+
+int
+main()
+{
+ type32 ck;
+
+ ck = cksum ((const unsigned char *) testpat, sizeof (testpat));
+ if (ck != 925902908)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dump-ada-spec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/dump-ada-spec-1.c
new file mode 100644
index 000000000..eb249e798
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dump-ada-spec-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-ada-spec" } */
+
+struct S
+{
+ int i;
+};
+
+/* { dg-final { scan-ada-spec "type S is record" } } */
+/* { dg-final { cleanup-ada-spec } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/dump-pass.c b/gcc-4.9/gcc/testsuite/gcc.dg/dump-pass.c
new file mode 100644
index 000000000..bcdf99ae0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/dump-pass.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-passes" } */
+
+unsigned res;
+
+void
+foo (unsigned code, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ res |= code & 1;
+}
+
+/* { dg-prune-output ".*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-1.c
new file mode 100644
index 000000000..239001c03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-1.c
@@ -0,0 +1,5 @@
+/* Test diagnostic for an empty source file. Test with no special
+ options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-2.c
new file mode 100644
index 000000000..8ce201c13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-2.c
@@ -0,0 +1,6 @@
+/* Test diagnostic for an empty source file. Test with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+/* { dg-warning "ISO C forbids an empty translation unit" "empty" { target *-*-* } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-3.c
new file mode 100644
index 000000000..0fd7be777
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/empty-source-3.c
@@ -0,0 +1,7 @@
+/* Test diagnostic for an empty source file. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+/* { dg-error "ISO C forbids an empty translation unit" "empty" { target *-*-* } 7 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/empty1.c b/gcc-4.9/gcc/testsuite/gcc.dg/empty1.c
new file mode 100644
index 000000000..89b2de1e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/empty1.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "" } */
+
+struct S { int : 0; };
+union U { int : 0; };
+
+int main () {
+ if (__alignof__ (struct S) != __alignof__ (union U))
+ return 1;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/empty2.c b/gcc-4.9/gcc/testsuite/gcc.dg/empty2.c
new file mode 100644
index 000000000..acc1ac8dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/empty2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+double d=0;
+
+struct A {} a; /* { dg-warning "struct has no members" } */
+
+void foo(struct A x)
+{
+ d=0;
+}
+
+void bar()
+{
+ if (d) foo(a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/enum-compat-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/enum-compat-1.c
new file mode 100644
index 000000000..5fb150cee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/enum-compat-1.c
@@ -0,0 +1,32 @@
+/* Test that enumerated types are only considered compatible when they
+ are the same type. PR c/6024. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk>, based on
+ PR c/6024 from Richard Earnshaw <rearnsha@arm.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Original test from PR c/6024. */
+enum e1 {a, b};
+enum e2 {c, d};
+
+void f(enum e1); /* { dg-error "prototype" "error at decl" } */
+
+void f(x)
+ enum e2 x; /* { dg-error "doesn't match prototype" } */
+{
+ return;
+}
+
+/* Other compatibility tests. */
+enum e3 { A };
+enum e4 { B };
+
+enum e3 v3;
+enum e4 *p = &v3; /* { dg-warning "incompatible" "incompatible pointer" } */
+enum e3 *q = &v3;
+
+void g(enum e3); /* { dg-message "note: previous declaration" "error at first decl" } */
+void g(enum e4); /* { dg-error "conflicting types" "error at second decl" } */
+
+void h(enum e3);
+void h(enum e3);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-1.c
new file mode 100644
index 000000000..205bb2372
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-1.c
@@ -0,0 +1,8 @@
+/* Test for enumeration constants not integer constant expressions but
+ folding to integer constants (used in Linux kernel,
+ <http://gcc.gnu.org/ml/gcc/2009-04/msg00677.html>). */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern int i;
+enum e { E = (1 ? 1 : i) };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-2.c
new file mode 100644
index 000000000..7e83a6ff4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-2.c
@@ -0,0 +1,8 @@
+/* Test for enumeration constants not integer constant expressions but
+ folding to integer constants (used in Linux kernel,
+ <http://gcc.gnu.org/ml/gcc/2009-04/msg00677.html>). */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+extern int i;
+enum e { E = (1 ? 1 : i) }; /* { dg-warning "not an integer constant expression" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-3.c
new file mode 100644
index 000000000..ab355cafe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/enum-const-3.c
@@ -0,0 +1,8 @@
+/* Test for enumeration constants not integer constant expressions but
+ folding to integer constants (used in Linux kernel,
+ <http://gcc.gnu.org/ml/gcc/2009-04/msg00677.html>). */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+extern int i;
+enum e { E = (1 ? 1 : i) }; /* { dg-error "not an integer constant expression" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/enum-incomplete-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/enum-incomplete-1.c
new file mode 100644
index 000000000..06c247c2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/enum-incomplete-1.c
@@ -0,0 +1,86 @@
+/* Test for uses of incomplete enum variables: should be allowed just
+ when incomplete structs are allowed. PR 32295. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern enum e ve;
+extern struct s vs;
+void *p;
+
+int
+f0 (int i)
+{
+ ve; /* { dg-error "incomplete" } */
+ vs; /* { dg-error "incomplete" } */
+ (void) ve;
+ (void) vs;
+ (void) (i ? ve : ve); /* { dg-error "incomplete" } */
+ (void) (i ? vs : vs); /* { dg-error "incomplete" } */
+ (void) (ve = ve); /* { dg-error "incomplete" } */
+ (void) (vs = vs); /* { dg-error "incomplete" } */
+ (void) ve, (void) ve;
+ (void) vs, (void) vs;
+ p = &ve;
+ p = &vs;
+ (void) sizeof (ve); /* { dg-error "incomplete" } */
+ (void) sizeof (vs); /* { dg-error "incomplete" } */
+ typeof (ve) *pe;
+ typeof (vs) *ps;
+ /* ??? alignof should probably not be accepted here. */
+ (void) __alignof (ve);
+ (void) __alignof (vs);
+ (void) (ve + i); /* { dg-error "incomplete" } */
+ (void) (i * ve); /* { dg-error "incomplete" } */
+ (void) (i / ve); /* { dg-error "incomplete" } */
+ (void) (ve - i); /* { dg-error "incomplete" } */
+ (void) (ve << i); /* { dg-error "incomplete" } */
+ (void) (i >> ve); /* { dg-error "incomplete" } */
+ (void) (ve < i); /* { dg-error "incomplete" } */
+ (void) (ve <= i); /* { dg-error "incomplete" } */
+ (void) (i > ve); /* { dg-error "incomplete" } */
+ (void) (i >= ve); /* { dg-error "incomplete" } */
+ (void) (ve == i); /* { dg-error "incomplete" } */
+ (void) (i != ve); /* { dg-error "incomplete" } */
+ (void) (ve & i); /* { dg-error "incomplete" } */
+ (void) (ve ^ i); /* { dg-error "incomplete" } */
+ (void) (i | ve); /* { dg-error "incomplete" } */
+ (void) (i && ve); /* { dg-error "incomplete" } */
+ (void) (ve || i); /* { dg-error "incomplete" } */
+ (void) -ve; /* { dg-error "incomplete" } */
+ (void) +ve; /* { dg-error "incomplete" } */
+ (void) ~ve; /* { dg-error "incomplete" } */
+ (void) !ve; /* { dg-error "incomplete" } */
+ (void) --ve; /* { dg-error "incomplete" } */
+ (void) ++ve; /* { dg-error "incomplete" } */
+ (void) ve--; /* { dg-error "incomplete" } */
+ (void) ve++; /* { dg-error "incomplete" } */
+ i = ve; /* { dg-error "incomplete" } */
+ i *= ve; /* { dg-error "incomplete" } */
+ i /= ve; /* { dg-error "incomplete" } */
+ i %= ve; /* { dg-error "incomplete" } */
+ i += ve; /* { dg-error "incomplete" } */
+ i -= ve; /* { dg-error "incomplete" } */
+ i <<= ve; /* { dg-error "incomplete" } */
+ i >>= ve; /* { dg-error "incomplete" } */
+ i &= ve; /* { dg-error "incomplete" } */
+ i ^= ve; /* { dg-error "incomplete" } */
+ i |= ve; /* { dg-error "incomplete" } */
+ (void) (ve ? 1 : 1); /* { dg-error "incomplete" } */
+ (void) (int) ve; /* { dg-error "incomplete" } */
+ f0 (ve); /* { dg-error "incomplete" } */
+ if (ve) /* { dg-error "incomplete" } */
+ ;
+ do
+ ;
+ while (ve); /* { dg-error "incomplete" } */
+ while (ve) /* { dg-error "incomplete" } */
+ ;
+ _Bool b = ve; /* { dg-error "incomplete" } */
+ float f = ve; /* { dg-error "incomplete" } */
+ switch (ve) /* { dg-error "incomplete" } */
+ ;
+ for (; ve;) /* { dg-error "incomplete" } */
+ ;
+ return ve; /* { dg-error "incomplete" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/enum1.c b/gcc-4.9/gcc/testsuite/gcc.dg/enum1.c
new file mode 100644
index 000000000..0f4587ff6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/enum1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu89" } */
+
+/* In standard C, enumeration constants always have type int. If they
+ are not representables are int, they're ill-formed. In GNU C, we
+ give such ill-formed constructs well-defined meaning. Make sure it
+ works. */
+
+#include <stdlib.h>
+
+enum foo
+{
+ foo1 = 0,
+ foo2 = 0xffffffffffffffffULL,
+ foo3 = 0xf0fffffffffffffeULL
+};
+
+int main ()
+{
+ if (sizeof (enum foo) != sizeof (unsigned long long))
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/enum2.c b/gcc-4.9/gcc/testsuite/gcc.dg/enum2.c
new file mode 100644
index 000000000..575cc5ce0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/enum2.c
@@ -0,0 +1,8 @@
+/* { dg-options "-fshort-enums" } */
+/* Check that "-fshort-enums" packs enumeration tyes into a minimal
+ number of bytes.. */
+
+enum e { e_1 };
+
+extern int i[sizeof (enum e)];
+int i[1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/enum3.c b/gcc-4.9/gcc/testsuite/gcc.dg/enum3.c
new file mode 100644
index 000000000..eebd6ca64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/enum3.c
@@ -0,0 +1,11 @@
+/* Test for non-integer enum values. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+enum e { E, F };
+enum e2 {
+ E1 = (void *)4, /* { dg-error "enumerator value for 'E1' is not an integer constant" } */
+ E2 = (enum e)F,
+ E3 = (_Bool)1
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/errno-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/errno-1.c
new file mode 100644
index 000000000..295deefbe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/errno-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include <errno.h>
+#include <stdlib.h>
+
+int main()
+{
+ void * volatile p;
+ errno = 0;
+ p = malloc (-1);
+ if (errno != 0)
+ do_not_optimize_away ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "do_not_optimize_away" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ext-elim-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ext-elim-1.c
new file mode 100644
index 000000000..5e899a235
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ext-elim-1.c
@@ -0,0 +1,39 @@
+/* PR rtl-optimization/51924 */
+/* Testcase by Zdenek Sojka <zsojka@seznam.cz> */
+
+/* { dg-do run } */
+/* { dg-options "-O -free -fno-rename-registers -ftree-vectorize -funroll-loops" } */
+
+typedef __UINT64_TYPE__ uint64_t;
+
+uint64_t __attribute__ ((noinline, noclone))
+bn_sub_words (uint64_t * r, const uint64_t * a, const uint64_t * b, int n)
+{
+ uint64_t t1, t2;
+ unsigned c = 0;
+
+ while (n)
+ {
+ t1 = a[0];
+ t2 = b[0];
+ r[0] = (t1 - t2 - c);
+ if (t1 != t2)
+ c = (t1 < t2);
+ a++;
+ b++;
+ r++;
+ n--;
+ }
+ return (c);
+}
+
+int
+main (void)
+{
+ uint64_t r[2];
+ uint64_t a[2] = { -1, -1 };
+ uint64_t b[2] = { 0, 0 };
+ if (bn_sub_words (r, a, b, 2) != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-1.c
new file mode 100644
index 000000000..74857cad1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-1.c
@@ -0,0 +1,7 @@
+/* Test diagnostic for extra semicolon outside a function. Test with
+ no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-2.c
new file mode 100644
index 000000000..2964ed557
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-2.c
@@ -0,0 +1,7 @@
+/* Test diagnostic for extra semicolon outside a function. Test with
+ -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+; /* { dg-warning "ISO C does not allow extra ';' outside of a function" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-3.c
new file mode 100644
index 000000000..53a420a5e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/extra-semi-3.c
@@ -0,0 +1,7 @@
+/* Test diagnostic for extra semicolon outside a function. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+; /* { dg-error "ISO C does not allow extra ';' outside of a function" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fail_always_inline.c b/gcc-4.9/gcc/testsuite/gcc.dg/fail_always_inline.c
new file mode 100644
index 000000000..4b196acb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fail_always_inline.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+extern __attribute__ ((always_inline)) void
+ bar() { } /* { dg-warning "function might not be inlinable" } */
+
+void
+f()
+{
+ bar();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fail_always_inline2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fail_always_inline2.c
new file mode 100644
index 000000000..863597f70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fail_always_inline2.c
@@ -0,0 +1,19 @@
+extern char *__realpath_alias (__const char *__restrict __name, char
+*__restrict __resolved) __asm__ ("" "realpath") __attribute__
+((__nothrow__)) __attribute__ ((__warn_unused_result__));
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__
+((__artificial__)) __attribute__ ((__warn_unused_result__)) char *
+__attribute__ ((__nothrow__)) realpath (__const char *__restrict __name,
+char *__restrict __resolved)
+{
+ return __realpath_alias (__name, __resolved);
+}
+
+char *
+realpath(path, resolved)
+ const char *path;
+ char *resolved;
+{
+ return (((void *)0));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/falign-labels-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/falign-labels-1.c
new file mode 100644
index 000000000..be277e4e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/falign-labels-1.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "-falign-labels=8" } */
+
+/* On ARMv7-A CPUs, this test resulted in incorrect code generation.
+ The code generated for the switch statement expected the jump table
+ to immediately follow the jump instruction, but -falign-labels
+ caused the label preceding the table to be aligned. */
+/* M68K and fido only support -falign-labels argument <= 2. */
+
+volatile int x;
+
+int main(void)
+{
+ int y;
+
+ x = 0;
+
+ switch(x)
+ {
+ case 0:
+ y = 2 * x;
+ break;
+ case 1:
+ y = -3 * x;
+ break;
+ case 2:
+ y = x + 5;
+ break;
+ case 3:
+ y = x - 7;
+ break;
+ default:
+ break;
+ }
+
+ x = y;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fastmath-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fastmath-1.c
new file mode 100644
index 000000000..4efe43004
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fastmath-1.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void abort (void);
+
+int foo ( float* dists, int k)
+{
+if ( ( dists [ 0 ] > 0 ) == ( dists [ 1 ] > 0 ) )
+ return k;
+return 0;
+}
+main() {
+ float dists[16] = { 0., 1., 1., 0., 0., -1., -1., 0.,
+ 1., 1., 1., -1., -1., 1., -1., -1. };
+ if ( foo(&dists[0], 1) +
+ foo(&dists[2], 2) +
+ foo(&dists[4], 4) +
+ foo(&dists[6], 8) +
+ foo(&dists[8], 16) +
+ foo(&dists[10], 32) +
+ foo(&dists[12], 64) +
+ foo(&dists[14], 128)
+ != 156)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fdata-sections-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fdata-sections-1.c
new file mode 100644
index 000000000..51686b921
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fdata-sections-1.c
@@ -0,0 +1,9 @@
+/* PR middle-end/15486 */
+/* Origin: Jonathan Larmour <jifl-bugzilla@jifvik.org> */
+
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-fdata-sections" } */
+
+int x;
+
+/* { dg-final { scan-assembler "comm" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/Wbad-function-cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/Wbad-function-cast-1.c
new file mode 100644
index 000000000..e23983396
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/Wbad-function-cast-1.c
@@ -0,0 +1,357 @@
+/* Test operation of -Wbad-function-cast. */
+/* Based on gcc.dg/Wbad-function-cast-1.c. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wbad-function-cast" } */
+
+int if1(void);
+char if2(void);
+long if3(void);
+_Complex double cf(void);
+
+
+#define FUNC(TYPE,NAME) \
+TYPE f ## NAME (void);
+
+FUNC (short _Fract, sf)
+FUNC (_Fract, f)
+FUNC (long _Fract, lf)
+FUNC (long long _Fract, llf)
+FUNC (unsigned short _Fract, usf)
+FUNC (unsigned _Fract, uf)
+FUNC (unsigned long _Fract, ulf)
+FUNC (unsigned long long _Fract, ullf)
+FUNC (_Sat short _Fract, Ssf)
+FUNC (_Sat _Fract, Sf)
+FUNC (_Sat long _Fract, Slf)
+FUNC (_Sat long long _Fract, Sllf)
+FUNC (_Sat unsigned short _Fract, Susf)
+FUNC (_Sat unsigned _Fract, Suf)
+FUNC (_Sat unsigned long _Fract, Sulf)
+FUNC (_Sat unsigned long long _Fract, Sullf)
+FUNC (short _Accum, sa)
+FUNC (_Accum, a)
+FUNC (long _Accum, la)
+FUNC (long long _Accum, lla)
+FUNC (unsigned short _Accum, usa)
+FUNC (unsigned _Accum, ua)
+FUNC (unsigned long _Accum, ula)
+FUNC (unsigned long long _Accum, ulla)
+FUNC (_Sat short _Accum, Ssa)
+FUNC (_Sat _Accum, Sa)
+FUNC (_Sat long _Accum, Sla)
+FUNC (_Sat long long _Accum, Slla)
+FUNC (_Sat unsigned short _Accum, Susa)
+FUNC (_Sat unsigned _Accum, Sua)
+FUNC (_Sat unsigned long _Accum, Sula)
+FUNC (_Sat unsigned long long _Accum, Sulla)
+
+void
+foo(void)
+{
+#define TEST(NAME) \
+ /* Casts to void types are always OK. */ \
+ (void) f ## NAME (); \
+ (const void) f ## NAME (); \
+ /* Casts to the same type or similar types are OK. */ \
+ (short _Fract) f ## NAME (); \
+ (_Fract) f ## NAME (); \
+ (long _Fract) f ## NAME (); \
+ (long long _Fract) f ## NAME (); \
+ (unsigned short _Fract) f ## NAME (); \
+ (unsigned _Fract) f ## NAME (); \
+ (unsigned long _Fract) f ## NAME (); \
+ (unsigned long long _Fract) f ## NAME (); \
+ (_Sat short _Fract) f ## NAME (); \
+ (_Sat _Fract) f ## NAME (); \
+ (_Sat long _Fract) f ## NAME (); \
+ (_Sat long long _Fract) f ## NAME (); \
+ (_Sat unsigned short _Fract) f ## NAME (); \
+ (_Sat unsigned _Fract) f ## NAME (); \
+ (_Sat unsigned long _Fract) f ## NAME (); \
+ (_Sat unsigned long long _Fract) f ## NAME (); \
+ (short _Accum) f ## NAME (); \
+ (_Accum) f ## NAME (); \
+ (long _Accum) f ## NAME (); \
+ (long long _Accum) f ## NAME (); \
+ (unsigned short _Accum) f ## NAME (); \
+ (unsigned _Accum) f ## NAME (); \
+ (unsigned long _Accum) f ## NAME (); \
+ (unsigned long long _Accum) f ## NAME (); \
+ (_Sat short _Accum) f ## NAME (); \
+ (_Sat _Accum) f ## NAME (); \
+ (_Sat long _Accum) f ## NAME (); \
+ (_Sat long long _Accum) f ## NAME (); \
+ (_Sat unsigned short _Accum) f ## NAME (); \
+ (_Sat unsigned _Accum) f ## NAME (); \
+ (_Sat unsigned long _Accum) f ## NAME (); \
+ (_Sat unsigned long long _Accum) f ## NAME (); \
+
+ TEST (sf);
+ TEST (f);
+ TEST (lf);
+ TEST (llf);
+ TEST (usf);
+ TEST (uf);
+ TEST (ulf);
+ TEST (ullf);
+ TEST (Ssf);
+ TEST (Sf);
+ TEST (Slf);
+ TEST (Sllf);
+ TEST (Susf);
+ TEST (Suf);
+ TEST (Sulf);
+ TEST (Sullf);
+ TEST (sa);
+ TEST (a);
+ TEST (la);
+ TEST (lla);
+ TEST (usa);
+ TEST (ua);
+ TEST (ula);
+ TEST (ulla);
+ TEST (Ssa);
+ TEST (Sa);
+ TEST (Sla);
+ TEST (Slla);
+ TEST (Susa);
+ TEST (Sua);
+ TEST (Sula);
+ TEST (Sulla);
+
+ /* Casts to types with different TREE_CODE (which is how this
+ warning has been defined) are not OK, except for casts to void
+ types. */
+ (short _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'short _Fract'" } */
+ (_Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Fract'" } */
+ (long _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'long _Fract'" } */
+ (long long _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'long long _Fract'" } */
+ (unsigned short _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'unsigned short _Fract'" } */
+ (unsigned _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'unsigned _Fract'" } */
+ (unsigned long _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'unsigned long _Fract'" } */
+ (unsigned long long _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'unsigned long long _Fract'" } */
+ (_Sat short _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat short _Fract'" } */
+ (_Sat _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat _Fract'" } */
+ (_Sat long _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat long _Fract'" } */
+ (_Sat long long _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat long long _Fract'" } */
+ (_Sat unsigned short _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat unsigned short _Fract'" } */
+ (_Sat unsigned _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat unsigned _Fract'" } */
+ (_Sat unsigned long _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat unsigned long _Fract'" } */
+ (_Sat unsigned long long _Fract)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat unsigned long long _Fract'" } */
+ (short _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'short _Accum'" } */
+ (_Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Accum'" } */
+ (long _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'long _Accum'" } */
+ (long long _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'long long _Accum'" } */
+ (unsigned short _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'unsigned short _Accum'" } */
+ (unsigned _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'unsigned _Accum'" } */
+ (unsigned long _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'unsigned long _Accum'" } */
+ (unsigned long long _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type 'unsigned long long _Accum'" } */
+ (_Sat short _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat short _Accum'" } */
+ (_Sat _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat _Accum'" } */
+ (_Sat long _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat long _Accum'" } */
+ (_Sat long long _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat long long _Accum'" } */
+ (_Sat unsigned short _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat unsigned short _Accum'" } */
+ (_Sat unsigned _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat unsigned _Accum'" } */
+ (_Sat unsigned long _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat unsigned long _Accum'" } */
+ (_Sat unsigned long long _Accum)if1(); /* { dg-warning "cast from function call of type 'int' to non-matching type '_Sat unsigned long long _Accum'" } */
+
+ (short _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'short _Fract'" } */
+ (_Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Fract'" } */
+ (long _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'long _Fract'" } */
+ (long long _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'long long _Fract'" } */
+ (unsigned short _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'unsigned short _Fract'" } */
+ (unsigned _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'unsigned _Fract'" } */
+ (unsigned long _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'unsigned long _Fract'" } */
+ (unsigned long long _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'unsigned long long _Fract'" } */
+ (_Sat short _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat short _Fract'" } */
+ (_Sat _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat _Fract'" } */
+ (_Sat long _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat long _Fract'" } */
+ (_Sat long long _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat long long _Fract'" } */
+ (_Sat unsigned short _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat unsigned short _Fract'" } */
+ (_Sat unsigned _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat unsigned _Fract'" } */
+ (_Sat unsigned long _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat unsigned long _Fract'" } */
+ (_Sat unsigned long long _Fract)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat unsigned long long _Fract'" } */
+ (short _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'short _Accum'" } */
+ (_Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Accum'" } */
+ (long _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'long _Accum'" } */
+ (long long _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'long long _Accum'" } */
+ (unsigned short _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'unsigned short _Accum'" } */
+ (unsigned _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'unsigned _Accum'" } */
+ (unsigned long _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'unsigned long _Accum'" } */
+ (unsigned long long _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type 'unsigned long long _Accum'" } */
+ (_Sat short _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat short _Accum'" } */
+ (_Sat _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat _Accum'" } */
+ (_Sat long _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat long _Accum'" } */
+ (_Sat long long _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat long long _Accum'" } */
+ (_Sat unsigned short _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat unsigned short _Accum'" } */
+ (_Sat unsigned _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat unsigned _Accum'" } */
+ (_Sat unsigned long _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat unsigned long _Accum'" } */
+ (_Sat unsigned long long _Accum)if2(); /* { dg-warning "cast from function call of type 'char' to non-matching type '_Sat unsigned long long _Accum'" } */
+
+ (short _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'short _Fract'" } */
+ (_Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Fract'" } */
+ (long _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'long _Fract'" } */
+ (long long _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'long long _Fract'" } */
+ (unsigned short _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'unsigned short _Fract'" } */
+ (unsigned _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'unsigned _Fract'" } */
+ (unsigned long _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'unsigned long _Fract'" } */
+ (unsigned long long _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'unsigned long long _Fract'" } */
+ (_Sat short _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat short _Fract'" } */
+ (_Sat _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat _Fract'" } */
+ (_Sat long _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat long _Fract'" } */
+ (_Sat long long _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat long long _Fract'" } */
+ (_Sat unsigned short _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat unsigned short _Fract'" } */
+ (_Sat unsigned _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat unsigned _Fract'" } */
+ (_Sat unsigned long _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat unsigned long _Fract'" } */
+ (_Sat unsigned long long _Fract)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat unsigned long long _Fract'" } */
+ (short _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'short _Accum'" } */
+ (_Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Accum'" } */
+ (long _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'long _Accum'" } */
+ (long long _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'long long _Accum'" } */
+ (unsigned short _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'unsigned short _Accum'" } */
+ (unsigned _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'unsigned _Accum'" } */
+ (unsigned long _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'unsigned long _Accum'" } */
+ (unsigned long long _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type 'unsigned long long _Accum'" } */
+ (_Sat short _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat short _Accum'" } */
+ (_Sat _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat _Accum'" } */
+ (_Sat long _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat long _Accum'" } */
+ (_Sat long long _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat long long _Accum'" } */
+ (_Sat unsigned short _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat unsigned short _Accum'" } */
+ (_Sat unsigned _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat unsigned _Accum'" } */
+ (_Sat unsigned long _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat unsigned long _Accum'" } */
+ (_Sat unsigned long long _Accum)if3(); /* { dg-warning "cast from function call of type 'long int' to non-matching type '_Sat unsigned long long _Accum'" } */
+
+ (short _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'short _Fract'" } */
+ (_Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Fract'" } */
+ (long _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'long _Fract'" } */
+ (long long _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'long long _Fract'" } */
+ (unsigned short _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'unsigned short _Fract'" } */
+ (unsigned _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'unsigned _Fract'" } */
+ (unsigned long _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'unsigned long _Fract'" } */
+ (unsigned long long _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'unsigned long long _Fract'" } */
+ (_Sat short _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat short _Fract'" } */
+ (_Sat _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat _Fract'" } */
+ (_Sat long _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat long _Fract'" } */
+ (_Sat long long _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat long long _Fract'" } */
+ (_Sat unsigned short _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat unsigned short _Fract'" } */
+ (_Sat unsigned _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat unsigned _Fract'" } */
+ (_Sat unsigned long _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat unsigned long _Fract'" } */
+ (_Sat unsigned long long _Fract)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat unsigned long long _Fract'" } */
+ (short _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'short _Accum'" } */
+ (_Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Accum'" } */
+ (long _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'long _Accum'" } */
+ (long long _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'long long _Accum'" } */
+ (unsigned short _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'unsigned short _Accum'" } */
+ (unsigned _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'unsigned _Accum'" } */
+ (unsigned long _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'unsigned long _Accum'" } */
+ (unsigned long long _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type 'unsigned long long _Accum'" } */
+ (_Sat short _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat short _Accum'" } */
+ (_Sat _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat _Accum'" } */
+ (_Sat long _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat long _Accum'" } */
+ (_Sat long long _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat long long _Accum'" } */
+ (_Sat unsigned short _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat unsigned short _Accum'" } */
+ (_Sat unsigned _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat unsigned _Accum'" } */
+ (_Sat unsigned long _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat unsigned long _Accum'" } */
+ (_Sat unsigned long long _Accum)cf(); /* { dg-warning "cast from function call of type 'complex double' to non-matching type '_Sat unsigned long long _Accum'" } */
+
+ (int)fsf(); /* { dg-warning "cast from function call of type 'short _Fract' to non-matching type 'int'" } */
+ (int)ff(); /* { dg-warning "cast from function call of type '_Fract' to non-matching type 'int'" } */
+ (int)flf(); /* { dg-warning "cast from function call of type 'long _Fract' to non-matching type 'int'" } */
+ (int)fllf(); /* { dg-warning "cast from function call of type 'long long _Fract' to non-matching type 'int'" } */
+ (int)fusf(); /* { dg-warning "cast from function call of type 'unsigned short _Fract' to non-matching type 'int'" } */
+ (int)fuf(); /* { dg-warning "cast from function call of type 'unsigned _Fract' to non-matching type 'int'" } */
+ (int)fulf(); /* { dg-warning "cast from function call of type 'unsigned long _Fract' to non-matching type 'int'" } */
+ (int)fullf(); /* { dg-warning "cast from function call of type 'unsigned long long _Fract' to non-matching type 'int'" } */
+ (int)fSsf(); /* { dg-warning "cast from function call of type '_Sat short _Fract' to non-matching type 'int'" } */
+ (int)fSf(); /* { dg-warning "cast from function call of type '_Sat _Fract' to non-matching type 'int'" } */
+ (int)fSlf(); /* { dg-warning "cast from function call of type '_Sat long _Fract' to non-matching type 'int'" } */
+ (int)fSllf(); /* { dg-warning "cast from function call of type '_Sat long long _Fract' to non-matching type 'int'" } */
+ (int)fSusf(); /* { dg-warning "cast from function call of type '_Sat unsigned short _Fract' to non-matching type 'int'" } */
+ (int)fSuf(); /* { dg-warning "cast from function call of type '_Sat unsigned _Fract' to non-matching type 'int'" } */
+ (int)fSulf(); /* { dg-warning "cast from function call of type '_Sat unsigned long _Fract' to non-matching type 'int'" } */
+ (int)fSullf(); /* { dg-warning "cast from function call of type '_Sat unsigned long long _Fract' to non-matching type 'int'" } */
+ (int)fsa(); /* { dg-warning "cast from function call of type 'short _Accum' to non-matching type 'int'" } */
+ (int)fa(); /* { dg-warning "cast from function call of type '_Accum' to non-matching type 'int'" } */
+ (int)fla(); /* { dg-warning "cast from function call of type 'long _Accum' to non-matching type 'int'" } */
+ (int)flla(); /* { dg-warning "cast from function call of type 'long long _Accum' to non-matching type 'int'" } */
+ (int)fusa(); /* { dg-warning "cast from function call of type 'unsigned short _Accum' to non-matching type 'int'" } */
+ (int)fua(); /* { dg-warning "cast from function call of type 'unsigned _Accum' to non-matching type 'int'" } */
+ (int)fula(); /* { dg-warning "cast from function call of type 'unsigned long _Accum' to non-matching type 'int'" } */
+ (int)fulla(); /* { dg-warning "cast from function call of type 'unsigned long long _Accum' to non-matching type 'int'" } */
+ (int)fSsa(); /* { dg-warning "cast from function call of type '_Sat short _Accum' to non-matching type 'int'" } */
+ (int)fSa(); /* { dg-warning "cast from function call of type '_Sat _Accum' to non-matching type 'int'" } */
+ (int)fSla(); /* { dg-warning "cast from function call of type '_Sat long _Accum' to non-matching type 'int'" } */
+ (int)fSlla(); /* { dg-warning "cast from function call of type '_Sat long long _Accum' to non-matching type 'int'" } */
+ (int)fSusa(); /* { dg-warning "cast from function call of type '_Sat unsigned short _Accum' to non-matching type 'int'" } */
+ (int)fSua(); /* { dg-warning "cast from function call of type '_Sat unsigned _Accum' to non-matching type 'int'" } */
+ (int)fSula(); /* { dg-warning "cast from function call of type '_Sat unsigned long _Accum' to non-matching type 'int'" } */
+ (int)fSulla(); /* { dg-warning "cast from function call of type '_Sat unsigned long long _Accum' to non-matching type 'int'" } */
+
+ (long)fsf(); /* { dg-warning "cast from function call of type 'short _Fract' to non-matching type 'long int'" } */
+ (long)ff(); /* { dg-warning "cast from function call of type '_Fract' to non-matching type 'long int'" } */
+ (long)flf(); /* { dg-warning "cast from function call of type 'long _Fract' to non-matching type 'long int'" } */
+ (long)fllf(); /* { dg-warning "cast from function call of type 'long long _Fract' to non-matching type 'long int'" } */
+ (long)fusf(); /* { dg-warning "cast from function call of type 'unsigned short _Fract' to non-matching type 'long int'" } */
+ (long)fuf(); /* { dg-warning "cast from function call of type 'unsigned _Fract' to non-matching type 'long int'" } */
+ (long)fulf(); /* { dg-warning "cast from function call of type 'unsigned long _Fract' to non-matching type 'long int'" } */
+ (long)fullf(); /* { dg-warning "cast from function call of type 'unsigned long long _Fract' to non-matching type 'long int'" } */
+ (long)fSsf(); /* { dg-warning "cast from function call of type '_Sat short _Fract' to non-matching type 'long int'" } */
+ (long)fSf(); /* { dg-warning "cast from function call of type '_Sat _Fract' to non-matching type 'long int'" } */
+ (long)fSlf(); /* { dg-warning "cast from function call of type '_Sat long _Fract' to non-matching type 'long int'" } */
+ (long)fSllf(); /* { dg-warning "cast from function call of type '_Sat long long _Fract' to non-matching type 'long int'" } */
+ (long)fSusf(); /* { dg-warning "cast from function call of type '_Sat unsigned short _Fract' to non-matching type 'long int'" } */
+ (long)fSuf(); /* { dg-warning "cast from function call of type '_Sat unsigned _Fract' to non-matching type 'long int'" } */
+ (long)fSulf(); /* { dg-warning "cast from function call of type '_Sat unsigned long _Fract' to non-matching type 'long int'" } */
+ (long)fSullf(); /* { dg-warning "cast from function call of type '_Sat unsigned long long _Fract' to non-matching type 'long int'" } */
+ (long)fsa(); /* { dg-warning "cast from function call of type 'short _Accum' to non-matching type 'long int'" } */
+ (long)fa(); /* { dg-warning "cast from function call of type '_Accum' to non-matching type 'long int'" } */
+ (long)fla(); /* { dg-warning "cast from function call of type 'long _Accum' to non-matching type 'long int'" } */
+ (long)flla(); /* { dg-warning "cast from function call of type 'long long _Accum' to non-matching type 'long int'" } */
+ (long)fusa(); /* { dg-warning "cast from function call of type 'unsigned short _Accum' to non-matching type 'long int'" } */
+ (long)fua(); /* { dg-warning "cast from function call of type 'unsigned _Accum' to non-matching type 'long int'" } */
+ (long)fula(); /* { dg-warning "cast from function call of type 'unsigned long _Accum' to non-matching type 'long int'" } */
+ (long)fulla(); /* { dg-warning "cast from function call of type 'unsigned long long _Accum' to non-matching type 'long int'" } */
+ (long)fSsa(); /* { dg-warning "cast from function call of type '_Sat short _Accum' to non-matching type 'long int'" } */
+ (long)fSa(); /* { dg-warning "cast from function call of type '_Sat _Accum' to non-matching type 'long int'" } */
+ (long)fSla(); /* { dg-warning "cast from function call of type '_Sat long _Accum' to non-matching type 'long int'" } */
+ (long)fSlla(); /* { dg-warning "cast from function call of type '_Sat long long _Accum' to non-matching type 'long int'" } */
+ (long)fSusa(); /* { dg-warning "cast from function call of type '_Sat unsigned short _Accum' to non-matching type 'long int'" } */
+ (long)fSua(); /* { dg-warning "cast from function call of type '_Sat unsigned _Accum' to non-matching type 'long int'" } */
+ (long)fSula(); /* { dg-warning "cast from function call of type '_Sat unsigned long _Accum' to non-matching type 'long int'" } */
+ (long)fSulla(); /* { dg-warning "cast from function call of type '_Sat unsigned long long _Accum' to non-matching type 'long int'" } */
+
+ (long int)fsf(); /* { dg-warning "cast from function call of type 'short _Fract' to non-matching type 'long int'" } */
+ (long int)ff(); /* { dg-warning "cast from function call of type '_Fract' to non-matching type 'long int'" } */
+ (long int)flf(); /* { dg-warning "cast from function call of type 'long _Fract' to non-matching type 'long int'" } */
+ (long int)fllf(); /* { dg-warning "cast from function call of type 'long long _Fract' to non-matching type 'long int'" } */
+ (long int)fusf(); /* { dg-warning "cast from function call of type 'unsigned short _Fract' to non-matching type 'long int'" } */
+ (long int)fuf(); /* { dg-warning "cast from function call of type 'unsigned _Fract' to non-matching type 'long int'" } */
+ (long int)fulf(); /* { dg-warning "cast from function call of type 'unsigned long _Fract' to non-matching type 'long int'" } */
+ (long int)fullf(); /* { dg-warning "cast from function call of type 'unsigned long long _Fract' to non-matching type 'long int'" } */
+ (long int)fSsf(); /* { dg-warning "cast from function call of type '_Sat short _Fract' to non-matching type 'long int'" } */
+ (long int)fSf(); /* { dg-warning "cast from function call of type '_Sat _Fract' to non-matching type 'long int'" } */
+ (long int)fSlf(); /* { dg-warning "cast from function call of type '_Sat long _Fract' to non-matching type 'long int'" } */
+ (long int)fSllf(); /* { dg-warning "cast from function call of type '_Sat long long _Fract' to non-matching type 'long int'" } */
+ (long int)fSusf(); /* { dg-warning "cast from function call of type '_Sat unsigned short _Fract' to non-matching type 'long int'" } */
+ (long int)fSuf(); /* { dg-warning "cast from function call of type '_Sat unsigned _Fract' to non-matching type 'long int'" } */
+ (long int)fSulf(); /* { dg-warning "cast from function call of type '_Sat unsigned long _Fract' to non-matching type 'long int'" } */
+ (long int)fSullf(); /* { dg-warning "cast from function call of type '_Sat unsigned long long _Fract' to non-matching type 'long int'" } */
+ (long int)fsa(); /* { dg-warning "cast from function call of type 'short _Accum' to non-matching type 'long int'" } */
+ (long int)fa(); /* { dg-warning "cast from function call of type '_Accum' to non-matching type 'long int'" } */
+ (long int)fla(); /* { dg-warning "cast from function call of type 'long _Accum' to non-matching type 'long int'" } */
+ (long int)flla(); /* { dg-warning "cast from function call of type 'long long _Accum' to non-matching type 'long int'" } */
+ (long int)fusa(); /* { dg-warning "cast from function call of type 'unsigned short _Accum' to non-matching type 'long int'" } */
+ (long int)fua(); /* { dg-warning "cast from function call of type 'unsigned _Accum' to non-matching type 'long int'" } */
+ (long int)fula(); /* { dg-warning "cast from function call of type 'unsigned long _Accum' to non-matching type 'long int'" } */
+ (long int)fulla(); /* { dg-warning "cast from function call of type 'unsigned long long _Accum' to non-matching type 'long int'" } */
+ (long int)fSsa(); /* { dg-warning "cast from function call of type '_Sat short _Accum' to non-matching type 'long int'" } */
+ (long int)fSa(); /* { dg-warning "cast from function call of type '_Sat _Accum' to non-matching type 'long int'" } */
+ (long int)fSla(); /* { dg-warning "cast from function call of type '_Sat long _Accum' to non-matching type 'long int'" } */
+ (long int)fSlla(); /* { dg-warning "cast from function call of type '_Sat long long _Accum' to non-matching type 'long int'" } */
+ (long int)fSusa(); /* { dg-warning "cast from function call of type '_Sat unsigned short _Accum' to non-matching type 'long int'" } */
+ (long int)fSua(); /* { dg-warning "cast from function call of type '_Sat unsigned _Accum' to non-matching type 'long int'" } */
+ (long int)fSula(); /* { dg-warning "cast from function call of type '_Sat unsigned long _Accum' to non-matching type 'long int'" } */
+ (long int)fSulla(); /* { dg-warning "cast from function call of type '_Sat unsigned long long _Accum' to non-matching type 'long int'" } */
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/addsub.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/addsub.c
new file mode 100644
index 000000000..c2ab38fd4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/addsub.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* Check if GCC generates warnings when overflows. */
+
+_Fract a0 = 0.5r + 0.5r; /* { dg-warning "overflow" } */
+_Fract a1 = 0.5r + 0.6r; /* { dg-warning "overflow" } */
+_Fract a2 = 0.5r + -0.6r;
+_Fract a3 = -0.5r + 0.6r;
+_Fract a4 = -0.5r + -0.5r;
+_Fract a5 = -0.5r + -0.6r; /* { dg-warning "overflow" } */
+_Fract a6 = 0.0r + __FRACT_MIN__;
+_Fract a7 = 0.1r + __FRACT_MIN__;
+_Fract a8 = -0.1r + __FRACT_MIN__; /* { dg-warning "overflow" } */
+_Fract a9 = 0.0r + __FRACT_MAX__;
+_Fract a10 = 0.1r + __FRACT_MAX__; /* { dg-warning "overflow" } */
+_Fract a11 = -0.1r + __FRACT_MAX__;
+
+_Fract b0 = 0.5r - 0.5r;
+_Fract b1 = 0.5r - 0.6r;
+_Fract b2 = 0.5r - -0.6r; /* { dg-warning "overflow" } */
+_Fract b3 = -0.5r - 0.6r; /* { dg-warning "overflow" } */
+_Fract b4 = -0.5r - -0.5r;
+_Fract b5 = -0.5r - -0.6r;
+_Fract b6 = 0.0r - __FRACT_MIN__; /* { dg-warning "overflow" } */
+_Fract b7 = 0.1r - __FRACT_MIN__; /* { dg-warning "overflow" } */
+_Fract b8 = -0.1r - __FRACT_MIN__;
+_Fract b9 = 0.0r - __FRACT_MAX__;
+_Fract b10 = 0.1r - __FRACT_MAX__;
+_Fract b11 = -0.1r - __FRACT_MAX__; /* { dg-warning "overflow" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allconv.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allconv.c
new file mode 100644
index 000000000..e0440dac2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allconv.c
@@ -0,0 +1,150 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.3 Conversions.
+
+ Check if all conversions are ok. */
+
+#define CONV(TYPE, NAME) \
+ float NAME ## _to_SF (TYPE a) { return a; } \
+ float Sat ## NAME ## _to_SF (_Sat TYPE a) { return a; } \
+ double NAME ## _to_DF (TYPE a) { return a; } \
+ double Sat ## NAME ## _to_DF (_Sat TYPE a) { return a; } \
+ TYPE SF_to_ ## NAME (float a) { return a; } \
+ _Sat TYPE SF_to_Sat ## NAME (float a) { return a; } \
+ TYPE DF_to_ ## NAME (double a) { return a; } \
+ _Sat TYPE DF_to_Sat ## NAME (double a) { return a; } \
+ signed char NAME ## _to_schar (TYPE a) { return a; } \
+ signed char Sat ## NAME ## _to_schar (_Sat TYPE a) { return a; } \
+ unsigned char NAME ## _to_uchar (TYPE a) { return a; } \
+ unsigned char Sat ## NAME ## _to_uchar (_Sat TYPE a) { return a; } \
+ short NAME ## _to_short (TYPE a) { return a; } \
+ short _Sat ## NAME ## _to_short (_Sat TYPE a) { return a; } \
+ unsigned short NAME ## _to_ushort (TYPE a) { return a; } \
+ unsigned short _Sat ## NAME ## _to_ushort (_Sat TYPE a) { return a; } \
+ int NAME ## _to_int (TYPE a) { return a; } \
+ int _Sat ## NAME ## _to_int (_Sat TYPE a) { return a; } \
+ unsigned int NAME ## _to_uint (TYPE a) { return a; } \
+ unsigned int _Sat ## NAME ## _to_uint (_Sat TYPE a) { return a; } \
+ long NAME ## _to_long (TYPE a) { return a; } \
+ unsigned long NAME ## _to_ulong (TYPE a) { return a; } \
+ long _Sat ## NAME ## _to_long (TYPE a) { return a; } \
+ unsigned long _Sat ## NAME ## _to_ulong (TYPE a) { return a; } \
+ long long NAME ## _to_longlong (TYPE a) { return a; } \
+ long long _Sat ## NAME ## _to_longlong (TYPE a) { return a; } \
+ unsigned long long NAME ## _to_ulonglong (TYPE a) { return a; } \
+ unsigned long long _Sat ## NAME ## _to_ulonglong (TYPE a) { return a; } \
+ TYPE schar_to_ ## NAME (signed char a) { return a; } \
+ _Sat TYPE schar_to_Sat ## NAME (signed char a) { return a; } \
+ TYPE uchar_to_ ## NAME (unsigned char a) { return a; } \
+ _Sat TYPE uchar_to_Sat ## NAME (unsigned char a) { return a; } \
+ TYPE short_to_ ## NAME (short a) { return a; } \
+ TYPE ushort_to_ ## NAME (unsigned short a) { return a; } \
+ TYPE int_to_ ## NAME (int a) { return a; } \
+ TYPE uint_to_ ## NAME (unsigned int a) { return a; } \
+ TYPE long_to_ ## NAME (long a) { return a; } \
+ TYPE ulong_to_ ## NAME (unsigned long a) { return a; } \
+ TYPE longlong_to_ ## NAME (long long a) { return a; } \
+ TYPE ulonglong_to_ ## NAME (unsigned long long a) { return a; } \
+ _Sat TYPE short_to_Sat ## NAME (short a) { return a; } \
+ _Sat TYPE ushort_to_Sat ## NAME (unsigned short a) { return a; } \
+ _Sat TYPE int_to_Sat ## NAME (int a) { return a; } \
+ _Sat TYPE uint_to_Sat ## NAME (unsigned int a) { return a; } \
+ _Sat TYPE long_to_Sat ## NAME (long a) { return a; } \
+ _Sat TYPE ulong_to_Sat ## NAME (unsigned long a) { return a; } \
+ _Sat TYPE longlong_to_Sat ## NAME (long long a) { return a; } \
+ _Sat TYPE ulonglong_to_Sat ## NAME (unsigned long long a) { return a; } \
+ TYPE SFR_to ## NAME (short _Fract a) { return a; } \
+ TYPE FR_to ## NAME (_Fract a) { return a; } \
+ TYPE LFR_to ## NAME (long _Fract a) { return a; } \
+ TYPE LLFR_to ## NAME (long long _Fract a) { return a; } \
+ TYPE USFR_to ## NAME (unsigned short _Fract a) { return a; } \
+ TYPE UFR_to ## NAME (unsigned _Fract a) { return a; } \
+ TYPE ULFR_to ## NAME (unsigned long _Fract a) { return a; } \
+ TYPE ULLFR_to ## NAME (unsigned long long _Fract a) { return a; } \
+ TYPE SAC_to ## NAME (short _Accum a) { return a; } \
+ TYPE AC_to ## NAME (_Accum a) { return a; } \
+ TYPE LAC_to ## NAME (long _Accum a) { return a; } \
+ TYPE LLAC_to ## NAME (long long _Accum a) { return a; } \
+ TYPE USAC_to ## NAME (unsigned short _Accum a) { return a; } \
+ TYPE UAC_to ## NAME (unsigned _Accum a) { return a; } \
+ TYPE ULAC_to ## NAME (unsigned long _Accum a) { return a; } \
+ TYPE ULLAC_to ## NAME (unsigned long long _Accum a) { return a; } \
+ TYPE SATSFR_to ## NAME (_Sat short _Fract a) { return a; } \
+ TYPE SATFR_to ## NAME (_Sat _Fract a) { return a; } \
+ TYPE SATLFR_to ## NAME (_Sat long _Fract a) { return a; } \
+ TYPE SATLLFR_to ## NAME (_Sat long long _Fract a) { return a; } \
+ TYPE SATUSFR_to ## NAME (_Sat unsigned short _Fract a) { return a; } \
+ TYPE SATUFR_to ## NAME (_Sat unsigned _Fract a) { return a; } \
+ TYPE SATULFR_to ## NAME (_Sat unsigned long _Fract a) { return a; } \
+ TYPE SATULLFR_to ## NAME (_Sat unsigned long long _Fract a) { return a; } \
+ TYPE SATSAC_to ## NAME (_Sat short _Accum a) { return a; } \
+ TYPE SATAC_to ## NAME (_Sat _Accum a) { return a; } \
+ TYPE SATLAC_to ## NAME (_Sat long _Accum a) { return a; } \
+ TYPE SATLLAC_to ## NAME (_Sat long long _Accum a) { return a; } \
+ TYPE SATUSAC_to ## NAME (_Sat unsigned short _Accum a) { return a; } \
+ TYPE SATUAC_to ## NAME (_Sat unsigned _Accum a) { return a; } \
+ TYPE SATULAC_to ## NAME (_Sat unsigned long _Accum a) { return a; } \
+ TYPE SATULLAC_to ## NAME (_Sat unsigned long long _Accum a) { return a; } \
+ _Sat TYPE SFR_to_SAT ## NAME (short _Fract a) { return a; } \
+ _Sat TYPE FR_to_SAT ## NAME (_Fract a) { return a; } \
+ _Sat TYPE LFR_to_SAT ## NAME (long _Fract a) { return a; } \
+ _Sat TYPE LLFR_to_SAT ## NAME (long long _Fract a) { return a; } \
+ _Sat TYPE USFR_to_SAT ## NAME (unsigned short _Fract a) { return a; } \
+ _Sat TYPE UFR_to_SAT ## NAME (unsigned _Fract a) { return a; } \
+ _Sat TYPE ULFR_to_SAT ## NAME (unsigned long _Fract a) { return a; } \
+ _Sat TYPE ULLFR_to_SAT ## NAME (unsigned long long _Fract a) { return a; } \
+ _Sat TYPE SAC_to_SAT ## NAME (short _Accum a) { return a; } \
+ _Sat TYPE AC_to_SAT ## NAME (_Accum a) { return a; } \
+ _Sat TYPE LAC_to_SAT ## NAME (long _Accum a) { return a; } \
+ _Sat TYPE LLAC_to_SAT ## NAME (long long _Accum a) { return a; } \
+ _Sat TYPE USAC_to_SAT ## NAME (unsigned short _Accum a) { return a; } \
+ _Sat TYPE UAC_to_SAT ## NAME (unsigned _Accum a) { return a; } \
+ _Sat TYPE ULAC_to_SAT ## NAME (unsigned long _Accum a) { return a; } \
+ _Sat TYPE ULLAC_to_SAT ## NAME (unsigned long long _Accum a) { return a; } \
+ _Sat TYPE SATSFR_to_SAT ## NAME (_Sat short _Fract a) { return a; } \
+ _Sat TYPE SATFR_to_SAT ## NAME (_Sat _Fract a) { return a; } \
+ _Sat TYPE SATLFR_to_SAT ## NAME (_Sat long _Fract a) { return a; } \
+ _Sat TYPE SATLLFR_to_SAT ## NAME (_Sat long long _Fract a) { return a; } \
+ _Sat TYPE SATUSFR_to_SAT ## NAME (_Sat unsigned short _Fract a) { return a; } \
+ _Sat TYPE SATUFR_to_SAT ## NAME (_Sat unsigned _Fract a) { return a; } \
+ _Sat TYPE SATULFR_to_SAT ## NAME (_Sat unsigned long _Fract a) { return a; } \
+ _Sat TYPE SATULLFR_to_SAT ## NAME (_Sat unsigned long long _Fract a) { return a; } \
+ _Sat TYPE SATSAC_to_SAT ## NAME (_Sat short _Accum a) { return a; } \
+ _Sat TYPE SATAC_to_SAT ## NAME (_Sat _Accum a) { return a; } \
+ _Sat TYPE SATLAC_to_SAT ## NAME (_Sat long _Accum a) { return a; } \
+ _Sat TYPE SATLLAC_to_SAT ## NAME (_Sat long long _Accum a) { return a; } \
+ _Sat TYPE SATUSAC_to_SAT ## NAME (_Sat unsigned short _Accum a) { return a; } \
+ _Sat TYPE SATUAC_to_SAT ## NAME (_Sat unsigned _Accum a) { return a; } \
+ _Sat TYPE SATULAC_to_SAT ## NAME (_Sat unsigned long _Accum a) { return a; } \
+ _Sat TYPE SATULLAC_to_SAT ## NAME (_Sat unsigned long long _Accum a) { return a; } \
+ _Complex int NAME ## _to_CI (TYPE a) { return a; } \
+ _Complex unsigned int NAME ## _to_CUI (TYPE a) { return a; } \
+ _Complex float NAME ## _to_CF (TYPE a) { return a; } \
+ _Complex double NAME ## _to_CD (TYPE a) { return a; } \
+ TYPE CI_to_ ## NAME (_Complex int a) { return a; } \
+ TYPE CUI_to_ ## NAME (_Complex unsigned int a) { return a; } \
+ TYPE CF_to_ ## NAME (_Complex float a) { return a; } \
+ TYPE CD_to_ ## NAME (_Complex double a) { return a; } \
+ _Sat TYPE CI_to_SAT ## NAME (_Complex int a) { return a; } \
+ _Sat TYPE CUI_to_SAT ## NAME (_Complex unsigned int a) { return a; } \
+ _Sat TYPE CF_to_SAT ## NAME (_Complex float a) { return a; } \
+ _Sat TYPE CD_to_SAT ## NAME (_Complex double a) { return a; }
+
+CONV(short _Fract, sf);
+CONV(_Fract, f);
+CONV(long _Fract, lf);
+CONV(long long _Fract, llf);
+CONV(unsigned short _Fract, usf);
+CONV(unsigned _Fract, uf);
+CONV(unsigned long _Fract, ulf);
+CONV(unsigned long long _Fract, ullf);
+
+CONV(short _Accum, sk);
+CONV(_Accum, k);
+CONV(long _Accum, lk);
+CONV(long long _Accum, llk);
+CONV(unsigned short _Accum, usk);
+CONV(unsigned _Accum, uk);
+CONV(unsigned long _Accum, ulk);
+CONV(unsigned long long _Accum, ullk);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allop-const.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allop-const.c
new file mode 100644
index 000000000..1cf859861
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allop-const.c
@@ -0,0 +1,147 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 6.5.7 - Bitwise shift operands.
+ C99 6.5.3 Unary operators.
+ C99 6.5.5 Multiplicative operators.
+ C99 6.5.6 Additive operators.
+ C99 6.5.7 Bitwise shift operators.
+ C99 6.5.8 Relational operators.
+ C99 6.5.9 Equality operators.
+ C99 6.5.16 Assignment operators.
+
+ Check if all operations on constants are ok. */
+
+#define ALLOPCONST(TYPE,NAME,POSTFIX) \
+ TYPE NAME ## plus = +0.1 ## POSTFIX; \
+ unsigned TYPE NAME ## u_plus = +0.1u ## POSTFIX; \
+ _Sat TYPE NAME ## sat_plus = +(_Sat TYPE)0.1 ## POSTFIX; \
+ _Sat unsigned TYPE NAME ## sat_u_plus = +(_Sat unsigned TYPE)0.1u ## POSTFIX; \
+ TYPE NAME ## neg = -0.1 ## POSTFIX; \
+ _Sat TYPE NAME ## sat_neg = -(_Sat TYPE)0.1 ## POSTFIX; \
+ _Sat unsigned TYPE NAME ## sat_u_neg = -(_Sat unsigned TYPE)0.1u ## POSTFIX; \
+ int NAME ## logneg1 = !0.1 ## POSTFIX; \
+ int NAME ## logneg1u = !0.1u ## POSTFIX; \
+ int NAME ## logneg2 = !0.0 ## POSTFIX; \
+ int NAME ## logneg2u = !0.0u ## POSTFIX; \
+ TYPE NAME ## add = 0.1 ## POSTFIX + 0.2 ## POSTFIX; \
+ unsigned TYPE NAME ## u_add = 0.1u ## POSTFIX + 0.2u ## POSTFIX; \
+ _Sat TYPE NAME ## sat_add = (_Sat TYPE)0.8 ## POSTFIX + 0.3 ## POSTFIX; \
+ _Sat unsigned TYPE NAME ## sat_u_add = (_Sat unsigned TYPE)0.8u ## POSTFIX + 0.3u ## POSTFIX; \
+ TYPE NAME ## sub = 0.1 ## POSTFIX - 0.2 ## POSTFIX; \
+ unsigned TYPE NAME ## u_sub = 0.2u ## POSTFIX - 0.1u ## POSTFIX; \
+ _Sat TYPE NAME ## sat_sub = (_Sat TYPE)0.1 ## POSTFIX - 0.2 ## POSTFIX; \
+ _Sat unsigned TYPE NAME ## sat_u_sub = (_Sat unsigned TYPE)0.1u ## POSTFIX - 0.2u ## POSTFIX; \
+ TYPE NAME ## mul = 0.1 ## POSTFIX * 0.2 ## POSTFIX; \
+ unsigned TYPE NAME ## u_mul = 0.1u ## POSTFIX * 0.2u ## POSTFIX; \
+ _Sat TYPE NAME ## sat_mul = (_Sat TYPE)0.1 ## POSTFIX * 0.2 ## POSTFIX; \
+ _Sat unsigned TYPE NAME ## sat_u_mul = (_Sat unsigned TYPE)0.1u ## POSTFIX * 0.2u ## POSTFIX; \
+ TYPE NAME ## div = 0.1 ## POSTFIX / 0.3 ## POSTFIX; \
+ unsigned TYPE NAME ## u_div = 0.1u ## POSTFIX / 0.3u ## POSTFIX; \
+ _Sat TYPE NAME ## sat_div = (_Sat TYPE)0.3 ## POSTFIX / 0.1 ## POSTFIX; \
+ _Sat unsigned TYPE NAME ## sat_u_div = (_Sat unsigned TYPE)0.3u ## POSTFIX / 0.1u ## POSTFIX; \
+ TYPE NAME ## shl = 0.1 ## POSTFIX << 3; \
+ unsigned TYPE NAME ## u_shl = 0.1u ## POSTFIX << 3; \
+ _Sat TYPE NAME ## sat_shl = (_Sat TYPE)0.8 ## POSTFIX << 3; \
+ _Sat unsigned TYPE NAME ## sat_u_shl = (_Sat unsigned TYPE)0.8u ## POSTFIX << 3; \
+ TYPE NAME ## shr = 0.1 ## POSTFIX >> 5; \
+ unsigned TYPE NAME ## u_shr = 0.1u ## POSTFIX >> 5; \
+ _Sat TYPE NAME ## sat_shr = (_Sat TYPE)0.1 ## POSTFIX >> 5; \
+ _Sat unsigned TYPE NAME ## sat_u_shr = (_Sat unsigned TYPE)0.1 ## POSTFIX >> 5; \
+ int NAME ## ne = 0.1 ## POSTFIX != 0.2 ## POSTFIX; \
+ int NAME ## u_ne = 0.1u ## POSTFIX != 0.2u ## POSTFIX; \
+ int NAME ## eq = 0.1 ## POSTFIX == 0.2 ## POSTFIX; \
+ int NAME ## u_eq = 0.1u ## POSTFIX == 0.2u ## POSTFIX; \
+ int NAME ## gt = 0.1 ## POSTFIX > 0.2 ## POSTFIX; \
+ int NAME ## u_gt = 0.1u ## POSTFIX > 0.2u ## POSTFIX; \
+ int NAME ## ge = 0.1 ## POSTFIX >= 0.2 ## POSTFIX; \
+ int NAME ## u_ge = 0.1u ## POSTFIX >= 0.2 ## POSTFIX; \
+ int NAME ## lt = 0.1 ## POSTFIX < 0.2 ## POSTFIX; \
+ int NAME ## u_lt = 0.1u ## POSTFIX < 0.2 ## POSTFIX; \
+ int NAME ## le = 0.1 ## POSTFIX <= 0.2 ## POSTFIX; \
+ int NAME ## u_le = 0.1u ## POSTFIX <= 0.2 ## POSTFIX; \
+ int NAME ## ne2 = 0.2 ## POSTFIX != 0.2 ## POSTFIX; \
+ int NAME ## u_ne2 = 0.2u ## POSTFIX != 0.2u ## POSTFIX; \
+ int NAME ## eq2 = 0.2 ## POSTFIX == 0.2 ## POSTFIX; \
+ int NAME ## u_eq2 = 0.2u ## POSTFIX == 0.2u ## POSTFIX; \
+ int NAME ## gt2 = 0.2 ## POSTFIX > 0.2 ## POSTFIX; \
+ int NAME ## u_gt2 = 0.2u ## POSTFIX > 0.2u ## POSTFIX; \
+ int NAME ## ge2 = 0.2 ## POSTFIX >= 0.2 ## POSTFIX; \
+ int NAME ## u_ge2 = 0.2u ## POSTFIX >= 0.2 ## POSTFIX; \
+ int NAME ## lt2 = 0.2 ## POSTFIX < 0.2 ## POSTFIX; \
+ int NAME ## u_lt2 = 0.2u ## POSTFIX < 0.2 ## POSTFIX; \
+ int NAME ## le2 = 0.2 ## POSTFIX <= 0.2 ## POSTFIX; \
+ int NAME ## u_le2 = 0.2u ## POSTFIX <= 0.2 ## POSTFIX; \
+ TYPE NAME ## hr_signed = 0.1hr; \
+ unsigned TYPE NAME ## hr_unsigned = 0.1hr; \
+ _Sat TYPE NAME ## hr_sat_signed = 0.1hr; \
+ _Sat unsigned TYPE NAME ## hr_sat_unsigned = 0.1hr; \
+ TYPE NAME ## r_signed = 0.1r; \
+ unsigned TYPE NAME ## r_unsigned = 0.1r; \
+ _Sat TYPE NAME ## r_sat_signed = 0.1r; \
+ _Sat unsigned TYPE NAME ## r_sat_unsigned = 0.1r; \
+ TYPE NAME ## lr_signed = 0.1lr; \
+ unsigned TYPE NAME ## lr_unsigned = 0.1lr; \
+ _Sat TYPE NAME ## lr_sat_signed = 0.1lr; \
+ _Sat unsigned TYPE NAME ## lr_sat_unsigned = 0.1lr; \
+ TYPE NAME ## llr_signed = 0.1llr; \
+ unsigned TYPE NAME ## llr_unsigned = 0.1llr; \
+ _Sat TYPE NAME ## llr_sat_signed = 0.1llr; \
+ _Sat unsigned TYPE NAME ## llr_sat_unsigned = 0.1llr; \
+ TYPE NAME ## uhr_signed = 0.1uhr; \
+ unsigned TYPE NAME ## uhr_unsigned = 0.1uhr; \
+ _Sat TYPE NAME ## uhr_sat_signed = 0.1uhr; \
+ _Sat unsigned TYPE NAME ## uhr_sat_unsigned = 0.1uhr; \
+ TYPE NAME ## ur_signed = 0.1ur; \
+ unsigned TYPE NAME ## ur_unsigned = 0.1ur; \
+ _Sat TYPE NAME ## ur_sat_signed = 0.1ur; \
+ _Sat unsigned TYPE NAME ## ur_sat_unsigned = 0.1ur; \
+ TYPE NAME ## ulr_signed = 0.1ulr; \
+ unsigned TYPE NAME ## ulr_unsigned = 0.1ulr; \
+ _Sat TYPE NAME ## ulr_sat_signed = 0.1ulr; \
+ _Sat unsigned TYPE NAME ## ulr_sat_unsigned = 0.1ulr; \
+ TYPE NAME ## ullr_signed = 0.1ullr; \
+ unsigned TYPE NAME ## ullr_unsigned = 0.1ullr; \
+ _Sat TYPE NAME ## ullr_sat_signed = 0.1ullr; \
+ _Sat unsigned TYPE NAME ## ullr_sat_unsigned = 0.1ullr; \
+ TYPE NAME ## hk_signed = 0.1hk; \
+ unsigned TYPE NAME ## hk_unsigned = 0.1hk; \
+ _Sat TYPE NAME ## hk_sat_signed = 5.1hk; \
+ _Sat unsigned TYPE NAME ## hk_sat_unsigned = 5.1hk; \
+ TYPE NAME ## k_signed = 0.1k; \
+ unsigned TYPE NAME ## k_unsigned = 0.1k; \
+ _Sat TYPE NAME ## k_sat_signed = 5.1k; \
+ _Sat unsigned TYPE NAME ## k_sat_unsigned = 5.1k; \
+ TYPE NAME ## lk_signed = 0.1lk; \
+ unsigned TYPE NAME ## lk_unsigned = 0.1lk; \
+ _Sat TYPE NAME ## lk_sat_signed = 5.1lk; \
+ _Sat unsigned TYPE NAME ## lk_sat_unsigned = 5.1lk; \
+ TYPE NAME ## llk_signed = 0.1llk; \
+ unsigned TYPE NAME ## llk_unsigned = 0.1llk; \
+ _Sat TYPE NAME ## llk_sat_signed = 5.1llk; \
+ _Sat unsigned TYPE NAME ## llk_sat_unsigned = 5.1llk; \
+ TYPE NAME ## uhk_signed = 0.1uhk; \
+ unsigned TYPE NAME ## uhk_unsigned = 0.1uhk; \
+ _Sat TYPE NAME ## uhk_sat_signed = 5.1uhk; \
+ _Sat unsigned TYPE NAME ## uhk_sat_unsigned = 5.1uhk; \
+ TYPE NAME ## uk_signed = 0.1uk; \
+ unsigned TYPE NAME ## uk_unsigned = 0.1uk; \
+ _Sat TYPE NAME ## uk_sat_signed = 5.1uk; \
+ _Sat unsigned TYPE NAME ## uk_sat_unsigned = 5.1uk; \
+ TYPE NAME ## ulk_signed = 0.1ulk; \
+ unsigned TYPE NAME ## ulk_unsigned = 0.1ulk; \
+ _Sat TYPE NAME ## ulk_sat_signed = 5.1ulk; \
+ _Sat unsigned TYPE NAME ## ulk_sat_unsigned = 5.1ulk; \
+ TYPE NAME ## ullk_signed = 0.1ullk; \
+ unsigned TYPE NAME ## ullk_unsigned = 0.1ullk; \
+ _Sat TYPE NAME ## ullk_sat_signed = 5.1ullk; \
+ _Sat unsigned TYPE NAME ## ullk_sat_unsigned = 5.1ullk; \
+
+ALLOPCONST(short _Fract, sf, hr);
+ALLOPCONST(_Fract, f, r);
+ALLOPCONST(long _Fract, lf, lr);
+ALLOPCONST(long long _Fract, llf, llr);
+ALLOPCONST(short _Accum, sa, hk);
+ALLOPCONST(_Accum, a, k);
+ALLOPCONST(long _Accum, la, lk);
+ALLOPCONST(long long _Accum, lla, llk);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allop.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allop.c
new file mode 100644
index 000000000..eb36c097c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/allop.c
@@ -0,0 +1,87 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 6.5.7 - Bitwise shift operands.
+ C99 6.5.3 Unary operators.
+ C99 6.5.5 Multiplicative operators.
+ C99 6.5.6 Additive operators.
+ C99 6.5.7 Bitwise shift operators.
+ C99 6.5.8 Relational operators.
+ C99 6.5.9 Equality operators.
+ C99 6.5.16 Assignment operators.
+
+ Check if all operations are ok. */
+
+void true();
+void false();
+
+#define ALLOP(TYPE,NAME) \
+ TYPE test1 ## NAME (TYPE a) { return +a; } \
+ TYPE test2 ## NAME (TYPE a) { return -a; } \
+ int test3 ## NAME (TYPE a) { return !a; } \
+ TYPE test4 ## NAME (TYPE a, TYPE b) { return a + b; } \
+ TYPE test5 ## NAME (TYPE a, TYPE b) { return a - b; } \
+ TYPE test6 ## NAME (TYPE a, TYPE b) { return a * b; } \
+ TYPE test7 ## NAME (TYPE a, TYPE b) { return a / b; } \
+ TYPE test8 ## NAME (TYPE a, TYPE b) { a += b; return a; } \
+ TYPE test9 ## NAME (TYPE a, TYPE b) { a -= b; return a; } \
+ TYPE test10 ## NAME (TYPE a, TYPE b) { a *= b; return a; } \
+ TYPE test11 ## NAME (TYPE a, TYPE b) { a /= b; return a; } \
+ TYPE test12 ## NAME (TYPE a, int b) { return a << b; } \
+ TYPE test13 ## NAME (TYPE a, int b) { return a >> b; } \
+ TYPE test14 ## NAME (TYPE a, int b) { a <<= b; return a; } \
+ TYPE test15 ## NAME (TYPE a, int b) { a >>= b; return a; } \
+ int test16 ## NAME (TYPE a, TYPE b) { return a == b; } \
+ int test17 ## NAME (TYPE a, TYPE b) { return a != b; } \
+ int test18 ## NAME (TYPE a, TYPE b) { return a < b; } \
+ int test19 ## NAME (TYPE a, TYPE b) { return a <= b; } \
+ int test20 ## NAME (TYPE a, TYPE b) { return a >= b; } \
+ int test21 ## NAME (TYPE a, TYPE b) { return a > b; } \
+ void test22 ## NAME (TYPE a, TYPE b) { if(a == b)true(); else false(); } \
+ void test23 ## NAME (TYPE a, TYPE b) { if(a != b)true(); else false(); } \
+ void test24 ## NAME (TYPE a, TYPE b) { if(a < b)true(); else false(); } \
+ void test25 ## NAME (TYPE a, TYPE b) { if(a <= b)true(); else false(); } \
+ void test26 ## NAME (TYPE a, TYPE b) { if(a >= b)true(); else false(); } \
+ void test27 ## NAME (TYPE a, TYPE b) { if(a > b)true(); else false(); } \
+ TYPE test28 ## NAME (TYPE a) { return ++a; } \
+ TYPE test29 ## NAME (TYPE a) { return --a; } \
+ TYPE test30 ## NAME (TYPE *a) { return ++(*a); } \
+ TYPE test31 ## NAME (TYPE *a) { return (*a)++; } \
+ TYPE test32 ## NAME (TYPE *a) { return --(*a); } \
+ TYPE test33 ## NAME (TYPE *a) { return (*a)--; }
+
+ALLOP(short _Fract, sf);
+ALLOP(_Fract, f);
+ALLOP(long _Fract, lf);
+ALLOP(long long _Fract, llf);
+ALLOP(short _Accum, sa);
+ALLOP(_Accum, a);
+ALLOP(long _Accum, la);
+ALLOP(long long _Accum, lla);
+
+ALLOP(unsigned short _Fract, usf);
+ALLOP(unsigned _Fract, uf);
+ALLOP(unsigned long _Fract, ulf);
+ALLOP(unsigned long long _Fract, ullf);
+ALLOP(unsigned short _Accum, usa);
+ALLOP(unsigned _Accum, ua);
+ALLOP(unsigned long _Accum, ula);
+ALLOP(unsigned long long _Accum, ulla);
+
+ALLOP(_Sat short _Fract, Ssf);
+ALLOP(_Sat _Fract, Sf);
+ALLOP(_Sat long _Fract, Slf);
+ALLOP(_Sat long long _Fract, Sllf);
+ALLOP(_Sat short _Accum, Ssa);
+ALLOP(_Sat _Accum, Sa);
+ALLOP(_Sat long _Accum, Sla);
+ALLOP(_Sat long long _Accum, Slla);
+
+ALLOP(_Sat unsigned short _Fract, Susf);
+ALLOP(_Sat unsigned _Fract, Suf);
+ALLOP(_Sat unsigned long _Fract, Sulf);
+ALLOP(_Sat unsigned long long _Fract, Sullf);
+ALLOP(_Sat unsigned short _Accum, Susa);
+ALLOP(_Sat unsigned _Accum, Sua);
+ALLOP(_Sat unsigned long _Accum, Sula);
+ALLOP(_Sat unsigned long long _Accum, Sulla);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/binary.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/binary.c
new file mode 100644
index 000000000..e2cb6ea25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/binary.c
@@ -0,0 +1,158 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 6.5.7 - Bitwise shift operands.
+ C99 6.5.5 Multiplicative operators.
+ C99 6.5.6 Additive operators.
+ C99 6.5.7 Bitwise shift operators.
+ C99 6.5.8 Relational operators.
+ C99 6.5.9 Equality operators.
+ C99 6.5.16 Assignment operators.
+
+ Check binary operators + - * / << >> < <= >= > == != += -= *= /= <<= >>=. */
+
+extern void abort (void);
+
+#define BINARY(TYPE,POSTFIX) \
+ { TYPE a = 0.5 ## POSTFIX; \
+ TYPE b = 0.25 ## POSTFIX; \
+ if (a + b != 0.75 ## POSTFIX) \
+ abort(); \
+ if (a - b != 0.25 ## POSTFIX) \
+ abort(); \
+ if (a * b != 0.125 ## POSTFIX) \
+ abort(); \
+ if (b / a != 0.5 ## POSTFIX) \
+ abort(); \
+ if (b << 1 != a) \
+ abort(); \
+ if (a >> 1 != b) \
+ abort(); \
+ if (a < b != 0) \
+ abort(); \
+ if (a <= b != 0) \
+ abort(); \
+ if (a > b != 1) \
+ abort(); \
+ if (a >= b != 1) \
+ abort(); \
+ if (a == b != 0) \
+ abort(); \
+ if (a != b != 1) \
+ abort(); \
+ a += b; \
+ if (a != 0.75 ## POSTFIX) \
+ abort(); \
+ a -= b; \
+ if (a != 0.5 ## POSTFIX) \
+ abort(); \
+ a *= b; \
+ if (a != 0.125 ## POSTFIX) \
+ abort(); \
+ a /= b; \
+ if (a != 0.5 ## POSTFIX) \
+ abort(); \
+ a >>= 2; \
+ if (a != 0.125 ## POSTFIX) \
+ abort(); \
+ a <<= 1; \
+ if (a != 0.25 ## POSTFIX) \
+ abort(); \
+ }
+
+#define FRACT_SAT_BINARY(TYPE,POSTFIX) \
+ { TYPE a = 0.7 ## POSTFIX; \
+ TYPE b = 0.9 ## POSTFIX; \
+ if (a + b != 1.0 ## POSTFIX) \
+ abort(); \
+ a = -0.7 ## POSTFIX; \
+ b = -0.9 ## POSTFIX; \
+ if (a + b != -0.5 ## POSTFIX - 0.5 ## POSTFIX) \
+ abort(); \
+ a = 0.7 ## POSTFIX; \
+ b = -0.9 ## POSTFIX; \
+ if (a - b != 1.0 ## POSTFIX) \
+ abort(); \
+ a = -0.7 ## POSTFIX; \
+ b = 0.9 ## POSTFIX; \
+ if (a - b != -0.5 ## POSTFIX - 0.5 ## POSTFIX) \
+ abort(); \
+ a = -0.5 ## POSTFIX - 0.5 ## POSTFIX; \
+ if (a * a != 1.0 ## POSTFIX) \
+ abort(); \
+ a = 0.8 ## POSTFIX; \
+ b = 0.5 ## POSTFIX; \
+ if (a / b != 1.0 ## POSTFIX) \
+ abort(); \
+ a = -0.8 ## POSTFIX; \
+ b = 0.5 ## POSTFIX; \
+ if (a / b != -0.5 ## POSTFIX - 0.5 ## POSTFIX) \
+ abort(); \
+ a = 0.1 ## POSTFIX; \
+ if (a << 4 != 1.0 ## POSTFIX) \
+ abort(); \
+ a = -0.8 ## POSTFIX; \
+ if (a << 4 != -0.5 ## POSTFIX - 0.5 ## POSTFIX) \
+ abort(); \
+ }
+
+#define FRACT_SAT_UNS_BINARY(TYPE,POSTFIX) \
+ { TYPE a = 0.7 ## POSTFIX; \
+ TYPE b = 0.9 ## POSTFIX; \
+ if (a + b != 1.0 ## POSTFIX) \
+ abort(); \
+ if (a - b != 0.0 ## POSTFIX) \
+ abort(); \
+ if (b / a != 1.0 ## POSTFIX) \
+ abort(); \
+ if (a << 1 != 1.0 ## POSTFIX) \
+ abort(); \
+ }
+
+int main ()
+{
+ BINARY(short _Fract, hr);
+ BINARY(_Fract, r);
+ BINARY(long _Fract, lr);
+ BINARY(long long _Fract, llr);
+ BINARY(unsigned short _Fract, uhr);
+ BINARY(unsigned _Fract, ur);
+ BINARY(unsigned long _Fract, ulr);
+ BINARY(unsigned long long _Fract, ullr);
+ BINARY(_Sat short _Fract, hr);
+ BINARY(_Sat _Fract, r);
+ BINARY(_Sat long _Fract, lr);
+ BINARY(_Sat long long _Fract, llr);
+ BINARY(_Sat unsigned short _Fract, uhr);
+ BINARY(_Sat unsigned _Fract, ur);
+ BINARY(_Sat unsigned long _Fract, ulr);
+ BINARY(_Sat unsigned long long _Fract, ullr);
+ BINARY(short _Accum, hk);
+ BINARY(_Accum, k);
+ BINARY(long _Accum, lk);
+ BINARY(long long _Accum, llk);
+ BINARY(unsigned short _Accum, uhk);
+ BINARY(unsigned _Accum, uk);
+ BINARY(unsigned long _Accum, ulk);
+ BINARY(unsigned long long _Accum, ullk);
+ BINARY(_Sat short _Accum, hk);
+ BINARY(_Sat _Accum, k);
+ BINARY(_Sat long _Accum, lk);
+ BINARY(_Sat long long _Accum, llk);
+ BINARY(_Sat unsigned short _Accum, uhk);
+ BINARY(_Sat unsigned _Accum, uk);
+ BINARY(_Sat unsigned long _Accum, ulk);
+ BINARY(_Sat unsigned long long _Accum, ullk);
+
+ FRACT_SAT_BINARY(_Sat short _Fract, hr);
+ FRACT_SAT_BINARY(_Sat _Fract, r);
+ FRACT_SAT_BINARY(_Sat long _Fract, lr);
+ FRACT_SAT_BINARY(_Sat long long _Fract, llr);
+
+ FRACT_SAT_UNS_BINARY(_Sat unsigned short _Fract, uhr);
+ FRACT_SAT_UNS_BINARY(_Sat unsigned _Fract, ur);
+ FRACT_SAT_UNS_BINARY(_Sat unsigned long _Fract, ulr);
+ FRACT_SAT_UNS_BINARY(_Sat unsigned long long _Fract, ullr);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/bit-complement.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/bit-complement.c
new file mode 100644
index 000000000..76c20d0d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/bit-complement.c
@@ -0,0 +1,76 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.3 Unary ~. */
+
+void test ()
+{
+ short _Fract sf;
+ _Fract f;
+ long _Fract lf;
+ long long _Fract llf;
+ unsigned short _Fract usf;
+ unsigned _Fract uf;
+ unsigned long _Fract ulf;
+ unsigned long long _Fract ullf;
+ _Sat short _Fract Ssf;
+ _Sat _Fract Sf;
+ _Sat long _Fract Slf;
+ _Sat long long _Fract Sllf;
+ _Sat unsigned short _Fract Susf;
+ _Sat unsigned _Fract Suf;
+ _Sat unsigned long _Fract Sulf;
+ _Sat unsigned long long _Fract Sullf;
+ short _Accum sa;
+ _Accum a;
+ long _Accum la;
+ long long _Accum lla;
+ unsigned short _Accum usa;
+ unsigned _Accum ua;
+ unsigned long _Accum ula;
+ unsigned long long _Accum ulla;
+ _Sat short _Accum Ssa;
+ _Sat _Accum Sa;
+ _Sat long _Accum Sla;
+ _Sat long long _Accum Slla;
+ _Sat unsigned short _Accum Susa;
+ _Sat unsigned _Accum Sua;
+ _Sat unsigned long _Accum Sula;
+ _Sat unsigned long long _Accum Sulla;
+
+ /* C99 Section 6.5.3.3 ~ shall have integer types. */
+
+ ~sf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~f; /* { dg-error "wrong type argument to bit-complement" } */
+ ~lf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~llf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~usf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~uf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~ulf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~ullf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Ssf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Slf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sllf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Susf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Suf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sulf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sullf; /* { dg-error "wrong type argument to bit-complement" } */
+ ~sa; /* { dg-error "wrong type argument to bit-complement" } */
+ ~a; /* { dg-error "wrong type argument to bit-complement" } */
+ ~la; /* { dg-error "wrong type argument to bit-complement" } */
+ ~lla; /* { dg-error "wrong type argument to bit-complement" } */
+ ~usa; /* { dg-error "wrong type argument to bit-complement" } */
+ ~ua; /* { dg-error "wrong type argument to bit-complement" } */
+ ~ula; /* { dg-error "wrong type argument to bit-complement" } */
+ ~ulla; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Ssa; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sa; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sla; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Slla; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Susa; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sua; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sula; /* { dg-error "wrong type argument to bit-complement" } */
+ ~Sulla; /* { dg-error "wrong type argument to bit-complement" } */
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/call-by-value.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/call-by-value.c
new file mode 100644
index 000000000..8b9d8225d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/call-by-value.c
@@ -0,0 +1,97 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.9.1(9) Function definitions; parameter has automatic storage.
+
+ Test that actual parameters are passed by value and that modifications
+ made within functions are lost on function return.
+
+ This test is copied from gcc.dg/dfp/ and changed for fixed-point types. */
+
+extern void abort (void);
+
+#define FOO_FUN(NAME,TYPE,VALUE) \
+int foo ## NAME (TYPE z) \
+{ \
+ z = z + VALUE; \
+}
+
+#define FOO_TEST(NAME,TYPE,VALUE) \
+ { \
+ TYPE NAME = VALUE; \
+ foo ## NAME (NAME); \
+ if (NAME != VALUE) \
+ abort (); \
+ }
+
+FOO_FUN (sf, short _Fract, 0.2hr)
+FOO_FUN (f, _Fract, 0.2r)
+FOO_FUN (lf, long _Fract, 0.2lr)
+FOO_FUN (llf, long long _Fract, 0.2llr)
+FOO_FUN (usf, unsigned short _Fract, 0.2uhr)
+FOO_FUN (uf, unsigned _Fract, 0.2ur)
+FOO_FUN (ulf, unsigned long _Fract, 0.2ulr)
+FOO_FUN (ullf, unsigned long long _Fract, 0.2ullr)
+FOO_FUN (Ssf, _Sat short _Fract, 0.2hr)
+FOO_FUN (Sf, _Sat _Fract, 0.2r)
+FOO_FUN (Slf, _Sat long _Fract, 0.2lr)
+FOO_FUN (Sllf, _Sat long long _Fract, 0.2llr)
+FOO_FUN (Susf, _Sat unsigned short _Fract, 0.2uhr)
+FOO_FUN (Suf, _Sat unsigned _Fract, 0.2ur)
+FOO_FUN (Sulf, _Sat unsigned long _Fract, 0.2ulr)
+FOO_FUN (Sullf, _Sat unsigned long long _Fract, 0.2ullr)
+FOO_FUN (sa, short _Accum, 0.2hk)
+FOO_FUN (a, _Accum, 0.2k)
+FOO_FUN (la, long _Accum, 0.2lk)
+FOO_FUN (lla, long long _Accum, 0.2llk)
+FOO_FUN (usa, unsigned short _Accum, 0.2uhk)
+FOO_FUN (ua, unsigned _Accum, 0.2uk)
+FOO_FUN (ula, unsigned long _Accum, 0.2ulk)
+FOO_FUN (ulla, unsigned long long _Accum, 0.2ullk)
+FOO_FUN (Ssa, _Sat short _Accum, 0.2hk)
+FOO_FUN (Sa, _Sat _Accum, 0.2k)
+FOO_FUN (Sla, _Sat long _Accum, 0.2lk)
+FOO_FUN (Slla, _Sat long long _Accum, 0.2llk)
+FOO_FUN (Susa, _Sat unsigned short _Accum, 0.2uhk)
+FOO_FUN (Sua, _Sat unsigned _Accum, 0.2uk)
+FOO_FUN (Sula, _Sat unsigned long _Accum, 0.2ulk)
+FOO_FUN (Sulla, _Sat unsigned long long _Accum, 0.2ullk)
+
+int
+main ()
+{
+ FOO_TEST (sf, short _Fract, 0.2hr)
+ FOO_TEST (f, _Fract, 0.2r)
+ FOO_TEST (lf, long _Fract, 0.2lr)
+ FOO_TEST (llf, long long _Fract, 0.2llr)
+ FOO_TEST (usf, unsigned short _Fract, 0.2uhr)
+ FOO_TEST (uf, unsigned _Fract, 0.2ur)
+ FOO_TEST (ulf, unsigned long _Fract, 0.2ulr)
+ FOO_TEST (ullf, unsigned long long _Fract, 0.2ullr)
+ FOO_TEST (Ssf, _Sat short _Fract, 0.2hr)
+ FOO_TEST (Sf, _Sat _Fract, 0.2r)
+ FOO_TEST (Slf, _Sat long _Fract, 0.2lr)
+ FOO_TEST (Sllf, _Sat long long _Fract, 0.2llr)
+ FOO_TEST (Susf, _Sat unsigned short _Fract, 0.2uhr)
+ FOO_TEST (Suf, _Sat unsigned _Fract, 0.2ur)
+ FOO_TEST (Sulf, _Sat unsigned long _Fract, 0.2ulr)
+ FOO_TEST (Sullf, _Sat unsigned long long _Fract, 0.2ullr)
+ FOO_TEST (sa, short _Accum, 0.2hk)
+ FOO_TEST (a, _Accum, 0.2k)
+ FOO_TEST (la, long _Accum, 0.2lk)
+ FOO_TEST (lla, long long _Accum, 0.2llk)
+ FOO_TEST (usa, unsigned short _Accum, 0.2uhk)
+ FOO_TEST (ua, unsigned _Accum, 0.2uk)
+ FOO_TEST (ula, unsigned long _Accum, 0.2ulk)
+ FOO_TEST (ulla, unsigned long long _Accum, 0.2ullk)
+ FOO_TEST (Ssa, _Sat short _Accum, 0.2hk)
+ FOO_TEST (Sa, _Sat _Accum, 0.2k)
+ FOO_TEST (Sla, _Sat long _Accum, 0.2lk)
+ FOO_TEST (Slla, _Sat long long _Accum, 0.2llk)
+ FOO_TEST (Susa, _Sat unsigned short _Accum, 0.2uhk)
+ FOO_TEST (Sua, _Sat unsigned _Accum, 0.2uk)
+ FOO_TEST (Sula, _Sat unsigned long _Accum, 0.2ulk)
+ FOO_TEST (Sulla, _Sat unsigned long long _Accum, 0.2ullk)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/cast-bad.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/cast-bad.c
new file mode 100644
index 000000000..ec8ea805a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/cast-bad.c
@@ -0,0 +1,279 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.4 Cast operators.
+
+ Test invalid casts involving fixed-point. */
+
+#define CAST(NAME,TYPE) \
+ struct s ## NAME { TYPE NAME; } as ## NAME; \
+ union u ## NAME { TYPE NAME; } au ## NAME; \
+ TYPE NAME; \
+ TYPE * NAME ## p;
+
+CAST (sf, short _Fract)
+CAST (f, _Fract)
+CAST (lf, long _Fract)
+CAST (llf, long long _Fract)
+CAST (usf, unsigned short _Fract)
+CAST (uf, unsigned _Fract)
+CAST (ulf, unsigned long _Fract)
+CAST (ullf, unsigned long long _Fract)
+CAST (Ssf, _Sat short _Fract)
+CAST (Sf, _Sat _Fract)
+CAST (Slf, _Sat long _Fract)
+CAST (Sllf, _Sat long long _Fract)
+CAST (Susf, _Sat unsigned short _Fract)
+CAST (Suf, _Sat unsigned _Fract)
+CAST (Sulf, _Sat unsigned long _Fract)
+CAST (Sullf, _Sat unsigned long long _Fract)
+CAST (sa, short _Accum)
+CAST (a, _Accum)
+CAST (la, long _Accum)
+CAST (lla, long long _Accum)
+CAST (usa, unsigned short _Accum)
+CAST (ua, unsigned _Accum)
+CAST (ula, unsigned long _Accum)
+CAST (ulla, unsigned long long _Accum)
+CAST (Ssa, _Sat short _Accum)
+CAST (Sa, _Sat _Accum)
+CAST (Sla, _Sat long _Accum)
+CAST (Slla, _Sat long long _Accum)
+CAST (Susa, _Sat unsigned short _Accum)
+CAST (Sua, _Sat unsigned _Accum)
+CAST (Sula, _Sat unsigned long _Accum)
+CAST (Sulla, _Sat unsigned long long _Accum)
+
+void
+test (void)
+{
+ (short _Fract []) sfp; /* { dg-error "cast specifies array type" } */
+ (_Fract []) fp; /* { dg-error "cast specifies array type" } */
+ (long _Fract []) lfp; /* { dg-error "cast specifies array type" } */
+ (long long _Fract []) llfp; /* { dg-error "cast specifies array type" } */
+ (unsigned short _Fract []) usfp; /* { dg-error "cast specifies array type" } */
+ (unsigned _Fract []) ufp; /* { dg-error "cast specifies array type" } */
+ (unsigned long _Fract []) ulfp; /* { dg-error "cast specifies array type" } */
+ (unsigned long long _Fract []) ullfp; /* { dg-error "cast specifies array type" } */
+ (_Sat short _Fract []) Ssfp; /* { dg-error "cast specifies array type" } */
+ (_Sat _Fract []) Sfp; /* { dg-error "cast specifies array type" } */
+ (_Sat long _Fract []) Slfp; /* { dg-error "cast specifies array type" } */
+ (_Sat long long _Fract []) Sllfp; /* { dg-error "cast specifies array type" } */
+ (_Sat unsigned short _Fract []) Susfp; /* { dg-error "cast specifies array type" } */
+ (_Sat unsigned _Fract []) Sufp; /* { dg-error "cast specifies array type" } */
+ (_Sat unsigned long _Fract []) Sulfp; /* { dg-error "cast specifies array type" } */
+ (_Sat unsigned long long _Fract []) Sullfp; /* { dg-error "cast specifies array type" } */
+ (short _Accum []) sap; /* { dg-error "cast specifies array type" } */
+ (_Accum []) ap; /* { dg-error "cast specifies array type" } */
+ (long _Accum []) lap; /* { dg-error "cast specifies array type" } */
+ (long long _Accum []) llap; /* { dg-error "cast specifies array type" } */
+ (unsigned short _Accum []) usap; /* { dg-error "cast specifies array type" } */
+ (unsigned _Accum []) uap; /* { dg-error "cast specifies array type" } */
+ (unsigned long _Accum []) ulap; /* { dg-error "cast specifies array type" } */
+ (unsigned long long _Accum []) ullap; /* { dg-error "cast specifies array type" } */
+ (_Sat short _Accum []) Ssap; /* { dg-error "cast specifies array type" } */
+ (_Sat _Accum []) Sap; /* { dg-error "cast specifies array type" } */
+ (_Sat long _Accum []) Slap; /* { dg-error "cast specifies array type" } */
+ (_Sat long long _Accum []) Sllap; /* { dg-error "cast specifies array type" } */
+ (_Sat unsigned short _Accum []) Susap; /* { dg-error "cast specifies array type" } */
+ (_Sat unsigned _Accum []) Suap; /* { dg-error "cast specifies array type" } */
+ (_Sat unsigned long _Accum []) Sulap; /* { dg-error "cast specifies array type" } */
+ (_Sat unsigned long long _Accum []) Sullap; /* { dg-error "cast specifies array type" } */
+
+ (short _Fract ()) sfp; /* { dg-error "cast specifies function type" } */
+ (_Fract ()) fp; /* { dg-error "cast specifies function type" } */
+ (long _Fract ()) lfp; /* { dg-error "cast specifies function type" } */
+ (long long _Fract ()) llfp; /* { dg-error "cast specifies function type" } */
+ (unsigned short _Fract ()) usfp; /* { dg-error "cast specifies function type" } */
+ (unsigned _Fract ()) ufp; /* { dg-error "cast specifies function type" } */
+ (unsigned long _Fract ()) ulfp; /* { dg-error "cast specifies function type" } */
+ (unsigned long long _Fract ()) ullfp; /* { dg-error "cast specifies function type" } */
+ (_Sat short _Fract ()) Ssfp; /* { dg-error "cast specifies function type" } */
+ (_Sat _Fract ()) Sfp; /* { dg-error "cast specifies function type" } */
+ (_Sat long _Fract ()) Slfp; /* { dg-error "cast specifies function type" } */
+ (_Sat long long _Fract ()) Sllfp; /* { dg-error "cast specifies function type" } */
+ (_Sat unsigned short _Fract ()) Susfp; /* { dg-error "cast specifies function type" } */
+ (_Sat unsigned _Fract ()) Sufp; /* { dg-error "cast specifies function type" } */
+ (_Sat unsigned long _Fract ()) Sulfp; /* { dg-error "cast specifies function type" } */
+ (_Sat unsigned long long _Fract ()) Sullfp; /* { dg-error "cast specifies function type" } */
+ (short _Accum ()) sap; /* { dg-error "cast specifies function type" } */
+ (_Accum ()) ap; /* { dg-error "cast specifies function type" } */
+ (long _Accum ()) lap; /* { dg-error "cast specifies function type" } */
+ (long long _Accum ()) llap; /* { dg-error "cast specifies function type" } */
+ (unsigned short _Accum ()) usap; /* { dg-error "cast specifies function type" } */
+ (unsigned _Accum ()) uap; /* { dg-error "cast specifies function type" } */
+ (unsigned long _Accum ()) ulap; /* { dg-error "cast specifies function type" } */
+ (unsigned long long _Accum ()) ullap; /* { dg-error "cast specifies function type" } */
+ (_Sat short _Accum ()) Ssap; /* { dg-error "cast specifies function type" } */
+ (_Sat _Accum ()) Sap; /* { dg-error "cast specifies function type" } */
+ (_Sat long _Accum ()) Slap; /* { dg-error "cast specifies function type" } */
+ (_Sat long long _Accum ()) Sllap; /* { dg-error "cast specifies function type" } */
+ (_Sat unsigned short _Accum ()) Susap; /* { dg-error "cast specifies function type" } */
+ (_Sat unsigned _Accum ()) Suap; /* { dg-error "cast specifies function type" } */
+ (_Sat unsigned long _Accum ()) Sulap; /* { dg-error "cast specifies function type" } */
+ (_Sat unsigned long long _Accum ()) Sullap; /* { dg-error "cast specifies function type" } */
+
+ (struct ssf) sf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sf) f; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct slf) lf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sllf) llf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct susf) usf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct suf) uf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sulf) ulf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sullf) ullf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSsf) Ssf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSf) Sf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSlf) Slf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSllf) Sllf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSusf) Susf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSuf) Suf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSulf) Sulf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSullf) Sullf; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct ssa) sa; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sa) a; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sla) la; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct slla) lla; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct susa) usa; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sua) ua; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sula) ula; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sulla) ulla; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSsa) Ssa; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSa) Sa; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSla) Sla; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSlla) Slla; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSusa) Susa; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSua) Sua; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSula) Sula; /* { dg-error "conversion to non-scalar type requested" } */
+ (struct sSulla) Sulla; /* { dg-error "conversion to non-scalar type requested" } */
+
+ (union usf) sf;
+ (union uf) f;
+ (union ulf) lf;
+ (union ullf) llf;
+ (union uusf) usf;
+ (union uuf) uf;
+ (union uulf) ulf;
+ (union uullf) ullf;
+ (union uSsf) Ssf;
+ (union uSf) Sf;
+ (union uSlf) Slf;
+ (union uSllf) Sllf;
+ (union uSusf) Susf;
+ (union uSuf) Suf;
+ (union uSulf) Sulf;
+ (union uSullf) Sullf;
+ (union usa) sa;
+ (union ua) a;
+ (union ula) la;
+ (union ulla) lla;
+ (union uusa) usa;
+ (union uua) ua;
+ (union uula) ula;
+ (union uulla) ulla;
+ (union uSsa) Ssa;
+ (union uSa) Sa;
+ (union uSla) Sla;
+ (union uSlla) Slla;
+ (union uSusa) Susa;
+ (union uSua) Sua;
+ (union uSula) Sula;
+ (union uSulla) Sulla;
+
+ (union usf) f; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) lf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) llf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) usf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) uf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) ulf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) ullf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Ssf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Slf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sllf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Susf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Suf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sulf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sullf; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) sa; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) a; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) la; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) lla; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) usa; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) ua; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) ula; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) ulla; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Ssa; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sa; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sla; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Slla; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Susa; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sua; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sula; /* { dg-error "cast to union type from type not present in union" } */
+ (union usf) Sulla; /* { dg-error "cast to union type from type not present in union" } */
+
+ (short _Fract) assf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Fract) asf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (long _Fract) aslf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (long long _Fract) asllf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned short _Fract) asusf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned _Fract) asuf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned long _Fract) asulf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned long long _Fract) asullf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat short _Fract) asSsf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat _Fract) asSf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat long _Fract) asSlf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat long long _Fract) asSllf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned short _Fract) asSusf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned _Fract) asSuf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned long _Fract) asSulf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned long long _Fract) asSullf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (short _Accum) assa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Accum) asa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (long _Accum) asla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (long long _Accum) aslla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned short _Accum) asusa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned _Accum) asua; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned long _Accum) asula; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned long long _Accum) asulla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat short _Accum) asSsa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat _Accum) asSa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat long _Accum) asSla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat long long _Accum) asSlla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned short _Accum) asSusa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned _Accum) asSua; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned long _Accum) asSula; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned long long _Accum) asSulla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+
+ (short _Fract) ausf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Fract) auf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (long _Fract) aulf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (long long _Fract) aullf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned short _Fract) auusf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned _Fract) auuf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned long _Fract) auulf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned long long _Fract) auullf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat short _Fract) auSsf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat _Fract) auSf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat long _Fract) auSlf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat long long _Fract) auSllf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned short _Fract) auSusf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned _Fract) auSuf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned long _Fract) auSulf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned long long _Fract) auSullf; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (short _Accum) ausa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Accum) aua; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (long _Accum) aula; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (long long _Accum) aulla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned short _Accum) auusa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned _Accum) auua; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned long _Accum) auula; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (unsigned long long _Accum) auulla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat short _Accum) auSsa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat _Accum) auSa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat long _Accum) auSla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat long long _Accum) auSlla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned short _Accum) auSusa; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned _Accum) auSua; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned long _Accum) auSula; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+ (_Sat unsigned long long _Accum) auSulla; /* { dg-error "aggregate value used where a fixed-point was expected" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/composite-type.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/composite-type.c
new file mode 100644
index 000000000..026bdaf56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/composite-type.c
@@ -0,0 +1,109 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -O -Wall -Wno-unused -ftrack-macro-expansion=0" } */
+
+/* C99 6.2.7: Compatible type and composite type. */
+
+#define FIXED_POINT_COMPOSITE_DECL(TYPE,NAME) \
+ TYPE g1_##NAME(); \
+ TYPE g2_##NAME(); \
+ TYPE (*h1_##NAME)[2]; \
+ TYPE (*h2_##NAME)[3]; \
+ TYPE (*h3_##NAME)[4]; \
+ TYPE f1_##NAME(TYPE(*)()); \
+ TYPE f1_##NAME(TYPE(*)(TYPE*)); \
+ TYPE f1_##NAME (TYPE(*g)(TYPE*)) \
+ { \
+ TYPE NAME; \
+ NAME = ((TYPE (*) (TYPE*)) g)(&NAME); \
+ NAME = ((TYPE (*) ()) g); \
+ return NAME; \
+ } \
+ TYPE f2_##NAME(TYPE(*)[]); \
+ TYPE f2_##NAME(TYPE(*)[3]);
+
+#define FIXED_POINT_COMPOSITE_TEST(TYPE, NAME) \
+do \
+{ \
+ TYPE NAME; \
+ NAME = f1_##NAME(g1_##NAME); \
+ NAME = f1_##NAME(g2_##NAME); \
+ NAME = f2_##NAME(h1_##NAME); \
+ NAME = f2_##NAME(h2_##NAME); \
+ NAME = f2_##NAME(h3_##NAME); \
+} while(0)
+
+FIXED_POINT_COMPOSITE_DECL(short _Fract, sf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Fract, f); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(long _Fract, lf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(long long _Fract, llf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(unsigned short _Fract, usf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(unsigned _Fract, uf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(unsigned long _Fract, ulf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(unsigned long long _Fract, ullf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat short _Fract, Ssf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat _Fract, Sf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat long _Fract, Slf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat long long _Fract, Sllf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat unsigned short _Fract, Susf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat unsigned _Fract, Suf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat unsigned long _Fract, Sulf); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat unsigned long long _Fract, Sullf); /* { dg-error "incompatible types when assigning" } */
+
+FIXED_POINT_COMPOSITE_DECL(short _Accum, sk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Accum, k); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(long _Accum, lk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(long long _Accum, llk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(unsigned short _Accum, usk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(unsigned _Accum, uk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(unsigned long _Accum, ulk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(unsigned long long _Accum, ullk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat short _Accum, Ssk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat _Accum, Sk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat long _Accum, Slk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat long long _Accum, Sllk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat unsigned short _Accum, Susk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat unsigned _Accum, Suk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat unsigned long _Accum, Sulk); /* { dg-error "incompatible types when assigning" } */
+FIXED_POINT_COMPOSITE_DECL(_Sat unsigned long long _Accum, Sullk); /* { dg-error "incompatible types when assigning" } */
+
+int main()
+{
+ FIXED_POINT_COMPOSITE_TEST(short _Fract, sf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Fract, f); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(long _Fract, lf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(long long _Fract, llf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(unsigned short _Fract, usf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(unsigned _Fract, uf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(unsigned long _Fract, ulf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(unsigned long long _Fract, ullf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat short _Fract, Ssf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat _Fract, Sf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat long _Fract, Slf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat long long _Fract, Sllf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat unsigned short _Fract, Susf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat unsigned _Fract, Suf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long _Fract, Sulf); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long long _Fract, Sullf); /* { dg-warning "incompatible pointer type" } */
+
+ FIXED_POINT_COMPOSITE_TEST(short _Accum, sk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Accum, k); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(long _Accum, lk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(long long _Accum, llk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(unsigned short _Accum, usk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(unsigned _Accum, uk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(unsigned long _Accum, ulk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(unsigned long long _Accum, ullk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat short _Accum, Ssk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat _Accum, Sk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat long _Accum, Slk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat long long _Accum, Sllk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat unsigned short _Accum, Susk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat unsigned _Accum, Suk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long _Accum, Sulk); /* { dg-warning "incompatible pointer type" } */
+ FIXED_POINT_COMPOSITE_TEST(_Sat unsigned long long _Accum, Sullk); /* { dg-warning "incompatible pointer type" } */
+
+ return 0;
+}
+
+/* Match all extra informative notes. */
+/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/const-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/const-1.c
new file mode 100644
index 000000000..5df0b4adc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/const-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 6.4.4 - Constants.
+
+ Check if the constant 1 is ok. */
+
+short _Fract sf = 1.0hr;
+_Fract f = 1.0r;
+long _Fract lf = 1.0lr;
+long long _Fract llf = 1.0llr;
+
+unsigned short _Fract usf = 1.0uhr;
+unsigned _Fract uf = 1.0ur;
+unsigned long _Fract ulf = 1.0ulr;
+unsigned long long _Fract ullf = 1.0ullr;
+
+short _Fract sfF = 1.0; /* { dg-warning "overflow" } */
+_Fract fF = 1.0; /* { dg-warning "overflow" } */
+long _Fract lfF = 1.0; /* { dg-warning "overflow" } */
+long long _Fract llfF = 1.0; /* { dg-warning "overflow" } */
+
+unsigned short _Fract usfF = 1.0; /* { dg-warning "overflow" } */
+unsigned _Fract ufF = 1.0; /* { dg-warning "overflow" } */
+unsigned long _Fract ulfF = 1.0; /* { dg-warning "overflow" } */
+unsigned long long _Fract ullfF = 1.0; /* { dg-warning "overflow" } */
+
+short _Fract sfI = 1; /* { dg-warning "overflow" } */
+_Fract fI = 1; /* { dg-warning "overflow" } */
+long _Fract lfI = 1; /* { dg-warning "overflow" } */
+long long _Fract llfI = 1; /* { dg-warning "overflow" } */
+
+unsigned short _Fract usfI = 1; /* { dg-warning "overflow" } */
+unsigned _Fract ufI = 1; /* { dg-warning "overflow" } */
+unsigned long _Fract ulfI = 1; /* { dg-warning "overflow" } */
+unsigned long long _Fract ullfI = 1; /* { dg-warning "overflow" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/constant.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/constant.c
new file mode 100644
index 000000000..18abb4501
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/constant.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 6.4.4.2a - Fixed-point constants (NEW CLAUSE).
+
+ Check if fixed-point constants are ok. */
+
+_Accum k0 = 0k;
+_Accum k1 = 9999.0e0k;
+_Accum k2 = 9999.0k;
+_Accum k3 = 9999k;
+_Accum k4 = 9999e0k;
+_Accum k5 = 09999k;
+_Accum k6 = 09999e0k;
+_Accum k7 = 09999.0e0k;
+_Accum k8 = 09999.0k;
+_Accum k9 = 0x270fp0k;
+_Accum k10 = 0x270f.0p0k;
+
+_Fract r0 = 0r;
+_Fract r1 = 0e0r;
+_Fract r2 = 0.0e0r;
+_Fract r3 = 0.1e0r;
+_Fract r4 = 0.0r;
+_Fract r5 = 0.1r;
+_Fract r6 = 0x0p0r;
+_Fract r7 = 0x0.0p0r;
+_Fract r8 = 0x0.1p0r;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/constants-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/constants-pedantic.c
new file mode 100644
index 000000000..9392381ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/constants-pedantic.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+/* N1169 6.4.4.2a - Fixed-point constants (NEW CLAUSE). */
+
+_Accum k0 = 0k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k1 = 9999.0e0k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k2 = 9999.0k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k3 = 9999k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k4 = 9999e0k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k5 = 09999k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k6 = 09999e0k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k7 = 09999.0e0k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k8 = 09999.0k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k9 = 0x270fp0k; /* { dg-warning "GCC extension|ISO C" } */
+_Accum k10 = 0x270f.0p0k; /* { dg-warning "GCC extension|ISO C" } */
+
+_Fract r0 = 0r; /* { dg-warning "GCC extension|ISO C" } */
+_Fract r1 = 0e0r; /* { dg-warning "GCC extension|ISO C" } */
+_Fract r2 = 0.0e0r; /* { dg-warning "GCC extension|ISO C" } */
+_Fract r3 = 0.1e0r; /* { dg-warning "GCC extension|ISO C" } */
+_Fract r4 = 0.0r; /* { dg-warning "GCC extension|ISO C" } */
+_Fract r5 = 0.1r; /* { dg-warning "GCC extension|ISO C" } */
+_Fract r6 = 0x0p0r; /* { dg-warning "GCC extension|ISO C" } */
+_Fract r7 = 0x0.0p0r; /* { dg-warning "GCC extension|ISO C" } */
+_Fract r8 = 0x0.1p0r; /* { dg-warning "GCC extension|ISO C" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-1.c
new file mode 100644
index 000000000..04adea88b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_CONV (short _Fract, hr);
+ ALL_CONV (_Fract, r);
+ ALL_CONV (long _Fract, lr);
+ ALL_CONV (long long _Fract, llr);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-2.c
new file mode 100644
index 000000000..fc5bc1fcb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-2.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_CONV (unsigned short _Fract, uhr);
+ ALL_CONV (unsigned _Fract, ur);
+ ALL_CONV (unsigned long _Fract, ulr);
+ ALL_CONV (unsigned long long _Fract, ullr);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-3.c
new file mode 100644
index 000000000..753c472a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-3.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_CONV (short _Accum, hk);
+ ALL_CONV (_Accum, k);
+ ALL_CONV (long _Accum, lk);
+ ALL_CONV (long long _Accum, llk);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-4.c
new file mode 100644
index 000000000..17c4e66eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-4.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_CONV (unsigned short _Accum, uhk);
+ ALL_CONV (unsigned _Accum, uk);
+ ALL_CONV (unsigned long _Accum, ulk);
+ ALL_CONV (unsigned long long _Accum, ullk);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-accum-neg.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-accum-neg.c
new file mode 100644
index 000000000..af9561042
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-accum-neg.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_ACCUM_CONV (short _Accum, hk);
+ ALL_ACCUM_CONV (_Accum, k);
+ ALL_ACCUM_CONV (long _Accum, lk);
+ ALL_ACCUM_CONV (long long _Accum, llk);
+ ALL_ACCUM_CONV (unsigned short _Accum, uhk);
+ ALL_ACCUM_CONV (unsigned _Accum, uk);
+ ALL_ACCUM_CONV (unsigned long _Accum, ulk);
+ ALL_ACCUM_CONV (unsigned long long _Accum, ullk);
+
+ NEG_CONV (short _Fract, hr);
+ NEG_CONV (_Fract, r);
+ NEG_CONV (long _Fract, lr);
+ NEG_CONV (long long _Fract, llr);
+ NEG_CONV (short _Accum, hk);
+ NEG_CONV (_Accum, k);
+ NEG_CONV (long _Accum, lk);
+ NEG_CONV (long long _Accum, llk);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-1.c
new file mode 100644
index 000000000..b36adab57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_CONV_FLOAT (short _Fract, hr);
+ ALL_CONV_FLOAT (_Fract, r);
+ ALL_CONV_FLOAT (long _Fract, lr);
+ ALL_CONV_FLOAT (long long _Fract, llr);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-2.c
new file mode 100644
index 000000000..2a3f3e95a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-2.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_CONV_FLOAT (unsigned short _Fract, uhr);
+ ALL_CONV_FLOAT (unsigned _Fract, ur);
+ ALL_CONV_FLOAT (unsigned long _Fract, ulr);
+ ALL_CONV_FLOAT (unsigned long long _Fract, ullr);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-3.c
new file mode 100644
index 000000000..9cad01091
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-3.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_CONV_FLOAT (short _Accum, hk);
+ ALL_CONV_FLOAT (_Accum, k);
+ ALL_CONV_FLOAT (long _Accum, lk);
+ ALL_CONV_FLOAT (long long _Accum, llk);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-4.c
new file mode 100644
index 000000000..c25a55c07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-float-4.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ ALL_CONV_FLOAT (unsigned short _Accum, uhk);
+ ALL_CONV_FLOAT (unsigned _Accum, uk);
+ ALL_CONV_FLOAT (unsigned long _Accum, ulk);
+ ALL_CONV_FLOAT (unsigned long long _Accum, ullk);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-sat.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-sat.c
new file mode 100644
index 000000000..278aa173b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert-sat.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.3 Conversions.
+
+ Check conversions involving fixed-point. */
+
+extern void abort (void);
+
+#include "convert.h"
+
+int main ()
+{
+ SAT_CONV1 (short _Accum, hk);
+ SAT_CONV1 (_Accum, k);
+ SAT_CONV1 (long _Accum, lk);
+ SAT_CONV1 (long long _Accum, llk);
+
+ SAT_CONV2 (unsigned short _Accum, uhk);
+ SAT_CONV2 (unsigned _Accum, uk);
+ SAT_CONV2 (unsigned long _Accum, ulk);
+ SAT_CONV2 (unsigned long long _Accum, ullk);
+
+ SAT_CONV3 (short _Fract, hr);
+ SAT_CONV3 (_Fract, r);
+ SAT_CONV3 (long _Fract, lr);
+ SAT_CONV3 (long long _Fract, llr);
+
+ SAT_CONV4 (signed char);
+ SAT_CONV4 (short);
+ SAT_CONV4 (int);
+ SAT_CONV4 (long);
+ SAT_CONV4 (long long);
+
+ SAT_CONV5 (unsigned char);
+ SAT_CONV5 (unsigned short);
+ SAT_CONV5 (unsigned int);
+ SAT_CONV5 (unsigned long);
+ SAT_CONV5 (unsigned long long);
+
+ SAT_CONV6 (float);
+ SAT_CONV6 (double);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert.h b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert.h
new file mode 100644
index 000000000..e4e68157a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/convert.h
@@ -0,0 +1,359 @@
+/* Check conversions involving fixed-point.
+ * Break up use-site into into manageable parts so that even embedded
+ * targets with restrictive resources can run them. */
+
+/* Fixed-point to fixed-point. */
+#define CONV(TYPE1,POSTFIX1,TYPE2,POSTFIX2) \
+ { \
+ TYPE1 a = 0.5 ## POSTFIX1; \
+ TYPE2 b = a; \
+ if (b != 0.5 ## POSTFIX2) \
+ abort(); \
+ }
+
+/* TYPE1 with VALUE1 to TYPE2 with VALUE2. */
+#define CONV2(TYPE1,VALUE1,TYPE2,VALUE2) \
+ { \
+ TYPE1 a = VALUE1; \
+ TYPE2 b = a; \
+ if (b != VALUE2) \
+ abort(); \
+ }
+
+/* Fixed-point to integer, and integer to fixed-point. */
+#define CONV_INT(TYPE1,POSTFIX1,TYPE2) \
+ { \
+ TYPE1 a = 0.5 ## POSTFIX1; \
+ TYPE2 b = a; \
+ TYPE2 c = 0; \
+ TYPE1 d = c; \
+ if (b != 0) \
+ abort(); \
+ if (d != 0.0 ## POSTFIX1) \
+ abort(); \
+ }
+
+/* Signed fixed-point to integer. */
+#define CONV_INT2(TYPE1,POSTFIX1,TYPE2) \
+ { \
+ TYPE1 a = -0.5 ## POSTFIX1; \
+ TYPE2 b = a; \
+ if (b != 0) \
+ abort(); \
+ a = -0.0 ## POSTFIX1; \
+ b = a; \
+ if (b != 0) \
+ abort(); \
+ a = +0.0 ## POSTFIX1; \
+ b = a; \
+ if (b != 0) \
+ abort(); \
+ a = +0.1 ## POSTFIX1; \
+ b = a; \
+ if (b != 0) \
+ abort(); \
+ a = -0.1 ## POSTFIX1; \
+ b = a; \
+ if (b != 0) \
+ abort(); \
+ }
+
+/* Signed fixed-point to signed integer. */
+#define CONV_INT3(TYPE1,POSTFIX1,TYPE2) \
+ { \
+ TYPE1 a = -0.5 ## POSTFIX1 - 0.5 ## POSTFIX1; \
+ TYPE2 b = a; \
+ if (b != -1) \
+ abort(); \
+ }
+
+/* Fixed-point to floating-point, and floating-point to fixed-point. */
+#define CONV_FLOAT(TYPE1,POSTFIX1,TYPE2) \
+ { \
+ TYPE1 a = 0.5 ## POSTFIX1; \
+ TYPE2 b = a; \
+ TYPE2 c = 0.25; \
+ TYPE1 d = c; \
+ if (b != 0.5) \
+ abort(); \
+ if (d != 0.25 ## POSTFIX1) \
+ abort(); \
+ }
+
+/* Accum to integer, and integer to accum. */
+#define CONV_ACCUM_INT(TYPE1,POSTFIX1,TYPE2) \
+ { \
+ TYPE1 a = 99.12345 ## POSTFIX1; \
+ TYPE2 b = a; \
+ TYPE2 c = 123; \
+ TYPE1 d = c; \
+ if (b != 99) \
+ abort(); \
+ if (d != 123.0 ## POSTFIX1) \
+ abort(); \
+ }
+
+#define ALL_CONV(TYPE,POSTFIX) \
+ CONV(TYPE, POSTFIX, short _Fract, hr) \
+ CONV(TYPE, POSTFIX, _Fract, r) \
+ CONV(TYPE, POSTFIX, long _Fract, lr) \
+ CONV(TYPE, POSTFIX, long long _Fract, llr) \
+ CONV(TYPE, POSTFIX, unsigned short _Fract, uhr) \
+ CONV(TYPE, POSTFIX, unsigned _Fract, ur) \
+ CONV(TYPE, POSTFIX, unsigned long _Fract, ulr) \
+ CONV(TYPE, POSTFIX, unsigned long long _Fract, ullr) \
+ CONV(TYPE, POSTFIX, short _Accum, hk) \
+ CONV(TYPE, POSTFIX, _Accum, k) \
+ CONV(TYPE, POSTFIX, long _Accum, lk) \
+ CONV(TYPE, POSTFIX, long long _Accum, llk) \
+ CONV(TYPE, POSTFIX, unsigned short _Accum, uhk) \
+ CONV(TYPE, POSTFIX, unsigned _Accum, uk) \
+ CONV(TYPE, POSTFIX, unsigned long _Accum, ulk) \
+ CONV(TYPE, POSTFIX, unsigned long long _Accum, ullk) \
+ CONV(_Sat TYPE, POSTFIX, short _Fract, hr) \
+ CONV(_Sat TYPE, POSTFIX, _Fract, r) \
+ CONV(_Sat TYPE, POSTFIX, long _Fract, lr) \
+ CONV(_Sat TYPE, POSTFIX, long long _Fract, llr) \
+ CONV(_Sat TYPE, POSTFIX, unsigned short _Fract, uhr) \
+ CONV(_Sat TYPE, POSTFIX, unsigned _Fract, ur) \
+ CONV(_Sat TYPE, POSTFIX, unsigned long _Fract, ulr) \
+ CONV(_Sat TYPE, POSTFIX, unsigned long long _Fract, ullr) \
+ CONV(_Sat TYPE, POSTFIX, short _Accum, hk) \
+ CONV(_Sat TYPE, POSTFIX, _Accum, k) \
+ CONV(_Sat TYPE, POSTFIX, long _Accum, lk) \
+ CONV(_Sat TYPE, POSTFIX, long long _Accum, llk) \
+ CONV(_Sat TYPE, POSTFIX, unsigned short _Accum, uhk) \
+ CONV(_Sat TYPE, POSTFIX, unsigned _Accum, uk) \
+ CONV(_Sat TYPE, POSTFIX, unsigned long _Accum, ulk) \
+ CONV(_Sat TYPE, POSTFIX, unsigned long long _Accum, ullk) \
+ CONV(TYPE, POSTFIX, _Sat short _Fract, hr) \
+ CONV(TYPE, POSTFIX, _Sat _Fract, r) \
+ CONV(TYPE, POSTFIX, _Sat long _Fract, lr) \
+ CONV(TYPE, POSTFIX, _Sat long long _Fract, llr) \
+ CONV(TYPE, POSTFIX, _Sat unsigned short _Fract, uhr) \
+ CONV(TYPE, POSTFIX, _Sat unsigned _Fract, ur) \
+ CONV(TYPE, POSTFIX, _Sat unsigned long _Fract, ulr) \
+ CONV(TYPE, POSTFIX, _Sat unsigned long long _Fract, ullr) \
+ CONV(TYPE, POSTFIX, _Sat short _Accum, hk) \
+ CONV(TYPE, POSTFIX, _Sat _Accum, k) \
+ CONV(TYPE, POSTFIX, _Sat long _Accum, lk) \
+ CONV(TYPE, POSTFIX, _Sat long long _Accum, llk) \
+ CONV(TYPE, POSTFIX, _Sat unsigned short _Accum, uhk) \
+ CONV(TYPE, POSTFIX, _Sat unsigned _Accum, uk) \
+ CONV(TYPE, POSTFIX, _Sat unsigned long _Accum, ulk) \
+ CONV(TYPE, POSTFIX, _Sat unsigned long long _Accum, ullk) \
+ CONV_INT(TYPE, POSTFIX, signed char) \
+ CONV_INT(TYPE, POSTFIX, short) \
+ CONV_INT(TYPE, POSTFIX, int) \
+ CONV_INT(TYPE, POSTFIX, long) \
+ CONV_INT(TYPE, POSTFIX, long long) \
+ CONV_INT(TYPE, POSTFIX, unsigned char) \
+ CONV_INT(TYPE, POSTFIX, unsigned short) \
+ CONV_INT(TYPE, POSTFIX, unsigned int) \
+ CONV_INT(TYPE, POSTFIX, unsigned long) \
+ CONV_INT(TYPE, POSTFIX, unsigned long long) \
+ CONV_INT(_Sat TYPE, POSTFIX, signed char) \
+ CONV_INT(_Sat TYPE, POSTFIX, short) \
+ CONV_INT(_Sat TYPE, POSTFIX, int) \
+ CONV_INT(_Sat TYPE, POSTFIX, long) \
+ CONV_INT(_Sat TYPE, POSTFIX, long long) \
+ CONV_INT(_Sat TYPE, POSTFIX, unsigned char) \
+ CONV_INT(_Sat TYPE, POSTFIX, unsigned short) \
+ CONV_INT(_Sat TYPE, POSTFIX, unsigned int) \
+ CONV_INT(_Sat TYPE, POSTFIX, unsigned long) \
+ CONV_INT(_Sat TYPE, POSTFIX, unsigned long long)
+
+#define ALL_CONV_FLOAT(TYPE,POSTFIX) \
+ CONV_FLOAT(TYPE, POSTFIX, float) \
+ CONV_FLOAT(TYPE, POSTFIX, double) \
+ CONV_FLOAT(_Sat TYPE, POSTFIX, float) \
+ CONV_FLOAT(_Sat TYPE, POSTFIX, double)
+
+#define ALL_ACCUM_CONV(TYPE,POSTFIX) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, signed char) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, short) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, int) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, long) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, long long) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, unsigned char) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, unsigned short) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, unsigned int) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, unsigned long) \
+ CONV_ACCUM_INT(TYPE, POSTFIX, unsigned long long) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, signed char) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, short) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, int) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, long) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, long long) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, unsigned char) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, unsigned short) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, unsigned int) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, unsigned long) \
+ CONV_ACCUM_INT(_Sat TYPE, POSTFIX, unsigned long long)
+
+#define NEG_CONV(TYPE,POSTFIX) \
+ CONV_INT2(TYPE, POSTFIX, signed char) \
+ CONV_INT2(TYPE, POSTFIX, short) \
+ CONV_INT2(TYPE, POSTFIX, int) \
+ CONV_INT2(TYPE, POSTFIX, long) \
+ CONV_INT2(TYPE, POSTFIX, long long) \
+ CONV_INT2(TYPE, POSTFIX, unsigned char) \
+ CONV_INT2(TYPE, POSTFIX, unsigned short) \
+ CONV_INT2(TYPE, POSTFIX, unsigned int) \
+ CONV_INT2(TYPE, POSTFIX, unsigned long) \
+ CONV_INT2(TYPE, POSTFIX, unsigned long long) \
+ CONV_INT3(TYPE, POSTFIX, signed char) \
+ CONV_INT3(TYPE, POSTFIX, short) \
+ CONV_INT3(TYPE, POSTFIX, int) \
+ CONV_INT3(TYPE, POSTFIX, long) \
+ CONV_INT3(TYPE, POSTFIX, long long)
+
+/* Signed accum to _Sat unsigned/signed fract. */
+#define SAT_CONV1(TYPE, POSTFIX) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, -3.2 ## POSTFIX, _Sat short _Fract, -0.5hr - 0.5hr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, -3.2 ## POSTFIX, _Sat _Fract, -0.5r - 0.5r) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, -3.2 ## POSTFIX, _Sat long _Fract, -0.5lr - 0.5lr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, -3.2 ## POSTFIX, _Sat long long _Fract, -0.5llr - 0.5llr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, -3.2 ## POSTFIX, _Sat unsigned short _Fract, 0.0uhr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, -3.2 ## POSTFIX, _Sat unsigned _Fract, 0.0ur) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, -3.2 ## POSTFIX, _Sat unsigned long _Fract, 0.0ulr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat unsigned long long _Fract, 1.0ullr) \
+ CONV2(TYPE, -3.2 ## POSTFIX, _Sat unsigned long long _Fract, 0.0ullr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, -1.0 ## POSTFIX, _Sat short _Fract, -0.5hr - 0.5hr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, -1.0 ## POSTFIX, _Sat _Fract, -0.5r - 0.5r) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, -1.0 ## POSTFIX, _Sat long _Fract, -0.5lr - 0.5lr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, -1.0 ## POSTFIX, _Sat long long _Fract, -0.5llr - 0.5llr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, -1.0 ## POSTFIX, _Sat unsigned short _Fract, 0.0uhr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, -1.0 ## POSTFIX, _Sat unsigned _Fract, 0.0ur) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, -1.0 ## POSTFIX, _Sat unsigned long _Fract, 0.0ulr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat unsigned long long _Fract, 1.0ullr) \
+ CONV2(TYPE, -1.0 ## POSTFIX, _Sat unsigned long long _Fract, 0.0ullr)
+
+/* Unsigned accum to _Sat unsigned/signed fract. */
+#define SAT_CONV2(TYPE, POSTFIX) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, 3.2 ## POSTFIX, _Sat unsigned long long _Fract, 1.0ullr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, 1.0 ## POSTFIX, _Sat unsigned long long _Fract, 1.0ullr)
+
+/* Signed fract to _Sat unsigned fract. */
+#define SAT_CONV3(TYPE, POSTFIX) \
+ CONV2(TYPE, -0.5 ## POSTFIX, _Sat unsigned short _Fract, 0.0uhr) \
+ CONV2(TYPE, -0.5 ## POSTFIX, _Sat unsigned _Fract, 0.0ur) \
+ CONV2(TYPE, -0.5 ## POSTFIX, _Sat unsigned long _Fract, 0.0ulr) \
+ CONV2(TYPE, -0.5 ## POSTFIX, _Sat unsigned long long _Fract, 0.0ullr)
+
+/* Signed integer to _Sat signed/unsigned fract. */
+#define SAT_CONV4(TYPE) \
+ CONV2(TYPE, 100, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, -100, _Sat short _Fract, -0.5hr - 0.5hr) \
+ CONV2(TYPE, 100, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, -100, _Sat _Fract, -0.5r - 0.5r) \
+ CONV2(TYPE, 100, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, -100, _Sat long _Fract, -0.5lr - 0.5lr) \
+ CONV2(TYPE, 100, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, -100, _Sat long long _Fract, -0.5llr - 0.5llr) \
+ CONV2(TYPE, 100, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, -100, _Sat unsigned short _Fract, 0.0uhr) \
+ CONV2(TYPE, 100, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, -100, _Sat unsigned _Fract, 0.0ur) \
+ CONV2(TYPE, 100, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, -100, _Sat unsigned long _Fract, 0.0ulr) \
+ CONV2(TYPE, 100, _Sat unsigned long long _Fract, 1.0ullr) \
+ CONV2(TYPE, -100, _Sat unsigned long long _Fract, 0.0ullr) \
+ CONV2(TYPE, 1, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, -1, _Sat short _Fract, -0.5hr - 0.5hr) \
+ CONV2(TYPE, 1, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, -1, _Sat _Fract, -0.5r - 0.5r) \
+ CONV2(TYPE, 1, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, -1, _Sat long _Fract, -0.5lr - 0.5lr) \
+ CONV2(TYPE, 1, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, -1, _Sat long long _Fract, -0.5llr - 0.5llr) \
+ CONV2(TYPE, 1, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, -1, _Sat unsigned short _Fract, 0.0uhr) \
+ CONV2(TYPE, 1, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, -1, _Sat unsigned _Fract, 0.0ur) \
+ CONV2(TYPE, 1, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, -1, _Sat unsigned long _Fract, 0.0ulr) \
+ CONV2(TYPE, 1, _Sat unsigned long long _Fract, 1.0ullr) \
+ CONV2(TYPE, -1, _Sat unsigned long long _Fract, 0.0ullr)
+
+/* Unsigned integer to _Sat signed/unsigned fract. */
+#define SAT_CONV5(TYPE) \
+ CONV2(TYPE, 100, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, 100, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, 100, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, 100, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, 100, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, 100, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, 100, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, 100, _Sat unsigned long long _Fract, 1.0ullr) \
+ CONV2(TYPE, 1, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, 1, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, 1, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, 1, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, 1, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, 1, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, 1, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, 1, _Sat unsigned long long _Fract, 1.0ullr)
+
+/* Floating-point to _Sat signed/unsigned fract. */
+#define SAT_CONV6(TYPE) \
+ CONV2(TYPE, 100.0, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, -100.0, _Sat short _Fract, -0.5hr - 0.5hr) \
+ CONV2(TYPE, 100.0, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, -100.0, _Sat _Fract, -0.5r - 0.5r) \
+ CONV2(TYPE, 100.0, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, -100.0, _Sat long _Fract, -0.5lr - 0.5lr) \
+ CONV2(TYPE, 100.0, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, -100.0, _Sat long long _Fract, -0.5llr - 0.5llr) \
+ CONV2(TYPE, 100.0, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, -100.0, _Sat unsigned short _Fract, 0.0uhr) \
+ CONV2(TYPE, 100.0, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, -100.0, _Sat unsigned _Fract, 0.0ur) \
+ CONV2(TYPE, 100.0, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, -100.0, _Sat unsigned long _Fract, 0.0ulr) \
+ CONV2(TYPE, 100.0, _Sat unsigned long long _Fract, 1.0ullr) \
+ CONV2(TYPE, -100.0, _Sat unsigned long long _Fract, 0.0ullr) \
+ CONV2(TYPE, 1.0, _Sat short _Fract, 1.0hr) \
+ CONV2(TYPE, -1.0, _Sat short _Fract, -0.5hr - 0.5hr) \
+ CONV2(TYPE, 1.0, _Sat _Fract, 1.0r) \
+ CONV2(TYPE, -1.0, _Sat _Fract, -0.5r - 0.5r) \
+ CONV2(TYPE, 1.0, _Sat long _Fract, 1.0lr) \
+ CONV2(TYPE, -1.0, _Sat long _Fract, -0.5lr - 0.5lr) \
+ CONV2(TYPE, 1.0, _Sat long long _Fract, 1.0llr) \
+ CONV2(TYPE, -1.0, _Sat long long _Fract, -0.5llr - 0.5llr) \
+ CONV2(TYPE, 1.0, _Sat unsigned short _Fract, 1.0uhr) \
+ CONV2(TYPE, -1.0, _Sat unsigned short _Fract, 0.0uhr) \
+ CONV2(TYPE, 1.0, _Sat unsigned _Fract, 1.0ur) \
+ CONV2(TYPE, -1.0, _Sat unsigned _Fract, 0.0ur) \
+ CONV2(TYPE, 1.0, _Sat unsigned long _Fract, 1.0ulr) \
+ CONV2(TYPE, -1.0, _Sat unsigned long _Fract, 0.0ulr) \
+ CONV2(TYPE, 1.0, _Sat unsigned long long _Fract, 1.0ullr) \
+ CONV2(TYPE, -1.0, _Sat unsigned long long _Fract, 0.0ullr)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/define.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/define.c
new file mode 100644
index 000000000..b66ade7e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/define.c
@@ -0,0 +1,158 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 7.18a.3 - Precision macros.
+
+ Check if defined fixed-point constants are ok. */
+
+#include <stdfix.h>
+
+short fract sf = SFRACT_MAX;
+fract f = FRACT_MAX;
+long fract lf = LFRACT_MAX;
+long long fract llf = LLFRACT_MAX;
+
+unsigned short fract usf = USFRACT_MAX;
+unsigned fract uf = UFRACT_MAX;
+unsigned long fract ulf = ULFRACT_MAX;
+unsigned long long fract ullf = ULLFRACT_MAX;
+
+sat short fract Ssf = SFRACT_MAX;
+sat fract Sf = FRACT_MAX;
+sat long fract Slf = LFRACT_MAX;
+sat long long fract Sllf = LLFRACT_MAX;
+
+sat unsigned short fract Susf = USFRACT_MAX;
+sat unsigned fract Suf = UFRACT_MAX;
+sat unsigned long fract Sulf = ULFRACT_MAX;
+sat unsigned long long fract Sullf = ULLFRACT_MAX;
+
+short fract sfm = SFRACT_MIN;
+fract fm = FRACT_MIN;
+long fract lfm = LFRACT_MIN;
+long long fract llfm = LLFRACT_MIN;
+
+unsigned short fract usfm = USFRACT_MIN;
+unsigned fract ufm = UFRACT_MIN;
+unsigned long fract ulfm = ULFRACT_MIN;
+unsigned long long fract ullfm = ULLFRACT_MIN;
+
+sat short fract Ssfm = SFRACT_MIN;
+sat fract Sfm = FRACT_MIN;
+sat long fract Slfm = LFRACT_MIN;
+sat long long fract Sllfm = LLFRACT_MIN;
+
+sat unsigned short fract Susfm = USFRACT_MIN;
+sat unsigned fract Sufm = UFRACT_MIN;
+sat unsigned long fract Sulfm = ULFRACT_MIN;
+sat unsigned long long fract Sullfm = ULLFRACT_MIN;
+
+short fract sfE = SFRACT_EPSILON;
+fract fE = FRACT_EPSILON;
+long fract lfE = LFRACT_EPSILON;
+long long fract llfE = LLFRACT_EPSILON;
+
+unsigned short fract usfE = USFRACT_EPSILON;
+unsigned fract ufE = UFRACT_EPSILON;
+unsigned long fract ulfE = ULFRACT_EPSILON;
+unsigned long long fract ullfE = ULLFRACT_EPSILON;
+
+sat short fract SsfE = SFRACT_EPSILON;
+sat fract SfE = FRACT_EPSILON;
+sat long fract SlfE = LFRACT_EPSILON;
+sat long long fract SllfE = LLFRACT_EPSILON;
+
+sat unsigned short fract SusfE = USFRACT_EPSILON;
+sat unsigned fract SufE = UFRACT_EPSILON;
+sat unsigned long fract SulfE = ULFRACT_EPSILON;
+sat unsigned long long fract SullfE = ULLFRACT_EPSILON;
+
+short accum sk = SACCUM_MAX;
+accum k = ACCUM_MAX;
+long accum lk = LACCUM_MAX;
+long long accum llk = LLACCUM_MAX;
+
+unsigned short accum usk = USACCUM_MAX;
+unsigned accum uk = UACCUM_MAX;
+unsigned long accum ulk = ULACCUM_MAX;
+unsigned long long accum ullk = ULLACCUM_MAX;
+
+sat short accum Ssk = SACCUM_MAX;
+sat accum Sk = ACCUM_MAX;
+sat long accum Slk = LACCUM_MAX;
+sat long long accum Sllk = LLACCUM_MAX;
+
+sat unsigned short accum Susk = USACCUM_MAX;
+sat unsigned accum Suk = UACCUM_MAX;
+sat unsigned long accum Sulk = ULACCUM_MAX;
+sat unsigned long long accum Sullk = ULLACCUM_MAX;
+
+short accum skm = SACCUM_MIN;
+accum km = ACCUM_MIN;
+long accum lkm = LACCUM_MIN;
+long long accum llkm = LLACCUM_MIN;
+
+unsigned short accum uskm = USACCUM_MIN;
+unsigned accum ukm = UACCUM_MIN;
+unsigned long accum ulkm = ULACCUM_MIN;
+unsigned long long accum ullkm = ULLACCUM_MIN;
+
+sat short accum Sskm = SACCUM_MIN;
+sat accum Skm = ACCUM_MIN;
+sat long accum Slkm = LACCUM_MIN;
+sat long long accum Sllkm = LLACCUM_MIN;
+
+sat unsigned short accum Suskm = USACCUM_MIN;
+sat unsigned accum Sukm = UACCUM_MIN;
+sat unsigned long accum Sulkm = ULACCUM_MIN;
+sat unsigned long long accum Sullkm = ULLACCUM_MIN;
+
+short accum skE = SACCUM_EPSILON;
+accum kE = ACCUM_EPSILON;
+long accum lkE = LACCUM_EPSILON;
+long long accum llkE = LLACCUM_EPSILON;
+
+unsigned short accum uskE = USACCUM_EPSILON;
+unsigned accum ukE = UACCUM_EPSILON;
+unsigned long accum ulkE = ULACCUM_EPSILON;
+unsigned long long accum ullkE = ULLACCUM_EPSILON;
+
+sat short accum SskE = SACCUM_EPSILON;
+sat accum SkE = ACCUM_EPSILON;
+sat long accum SlkE = LACCUM_EPSILON;
+sat long long accum SllkE = LLACCUM_EPSILON;
+
+sat unsigned short accum SuskE = USACCUM_EPSILON;
+sat unsigned accum SukE = UACCUM_EPSILON;
+sat unsigned long accum SulkE = ULACCUM_EPSILON;
+sat unsigned long long accum SullkE = ULLACCUM_EPSILON;
+
+int fbit_sf = SFRACT_FBIT;
+int fbit_f = FRACT_FBIT;
+int fbit_lf = LFRACT_FBIT;
+int fbit_llf = LLFRACT_FBIT;
+
+int fbit_usf = USFRACT_FBIT;
+int fbit_uf = UFRACT_FBIT;
+int fbit_ulf = ULFRACT_FBIT;
+int fbit_ullf = ULLFRACT_FBIT;
+
+int fbit_sk = SACCUM_FBIT;
+int fbit_k = ACCUM_FBIT;
+int fbit_lk = LACCUM_FBIT;
+int fbit_llk = LLACCUM_FBIT;
+
+int fbit_usk = USACCUM_FBIT;
+int fbit_uk = UACCUM_FBIT;
+int fbit_ulk = ULACCUM_FBIT;
+int fbit_ullk = ULLACCUM_FBIT;
+
+int ibit_sk = SACCUM_IBIT;
+int ibit_k = ACCUM_IBIT;
+int ibit_lk = LACCUM_IBIT;
+int ibit_llk = LLACCUM_IBIT;
+
+int ibit_usk = USACCUM_IBIT;
+int ibit_uk = UACCUM_IBIT;
+int ibit_ulk = ULACCUM_IBIT;
+int ibit_ullk = ULLACCUM_IBIT;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/fixed-point.exp b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/fixed-point.exp
new file mode 100644
index 000000000..77e7b7201
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/fixed-point.exp
@@ -0,0 +1,40 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Skip these tests for targets that don't support this extension.
+if { ![check_effective_target_fixed_point] } {
+ return;
+}
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-array.c
new file mode 100644
index 000000000..0d0e8c191
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-array.c
@@ -0,0 +1,102 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.2.2 Function calls.
+ Test passing array elements involving fixed-point types.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+/* A handful of functions that return the Nth argument of
+ an incoming array. */
+
+#define FUNC(TYPE,NAME) \
+TYPE NAME ## 0 (TYPE args[]) { return args[0]; } \
+TYPE NAME ## 1 (TYPE args[]) { return args[1]; } \
+TYPE NAME ## 2 (TYPE args[]) { return args[2]; } \
+TYPE NAME ## 3 (TYPE args[]) { return args[3]; } \
+TYPE NAME ## 4 (TYPE args[]) { return args[4]; } \
+TYPE NAME ## 5 (TYPE args[]) { return args[5]; }
+
+FUNC (short _Fract, sf)
+FUNC (_Fract, f)
+FUNC (long _Fract, lf)
+FUNC (long long _Fract, llf)
+FUNC (unsigned short _Fract, usf)
+FUNC (unsigned _Fract, uf)
+FUNC (unsigned long _Fract, ulf)
+FUNC (unsigned long long _Fract, ullf)
+FUNC (_Sat short _Fract, Ssf)
+FUNC (_Sat _Fract, Sf)
+FUNC (_Sat long _Fract, Slf)
+FUNC (_Sat long long _Fract, Sllf)
+FUNC (_Sat unsigned short _Fract, Susf)
+FUNC (_Sat unsigned _Fract, Suf)
+FUNC (_Sat unsigned long _Fract, Sulf)
+FUNC (_Sat unsigned long long _Fract, Sullf)
+FUNC (short _Accum, sa)
+FUNC (_Accum, a)
+FUNC (long _Accum, la)
+FUNC (long long _Accum, lla)
+FUNC (unsigned short _Accum, usa)
+FUNC (unsigned _Accum, ua)
+FUNC (unsigned long _Accum, ula)
+FUNC (unsigned long long _Accum, ulla)
+FUNC (_Sat short _Accum, Ssa)
+FUNC (_Sat _Accum, Sa)
+FUNC (_Sat long _Accum, Sla)
+FUNC (_Sat long long _Accum, Slla)
+FUNC (_Sat unsigned short _Accum, Susa)
+FUNC (_Sat unsigned _Accum, Sua)
+FUNC (_Sat unsigned long _Accum, Sula)
+FUNC (_Sat unsigned long long _Accum, Sulla)
+
+int main()
+{
+#define TEST(TYPE,NAME,PF) \
+ { \
+ TYPE NAME[] = { 0.0 ## PF, 0.1 ## PF, 0.2 ## PF, 0.3 ## PF, 0.4 ## PF, \
+ 0.5 ## PF }; \
+ if (NAME ## 0 (NAME) != 0.0 ## PF) abort (); \
+ if (NAME ## 1 (NAME) != 0.1 ## PF) abort (); \
+ if (NAME ## 2 (NAME) != 0.2 ## PF) abort (); \
+ if (NAME ## 3 (NAME) != 0.3 ## PF) abort (); \
+ if (NAME ## 4 (NAME) != 0.4 ## PF) abort (); \
+ if (NAME ## 5 (NAME) != 0.5 ## PF) abort (); \
+ }
+
+ TEST (short _Fract, sf, hr)
+ TEST (_Fract, f, r)
+ TEST (long _Fract, lf, lr)
+ TEST (long long _Fract, llf, llr)
+ TEST (unsigned short _Fract, usf, uhr)
+ TEST (unsigned _Fract, uf, ur)
+ TEST (unsigned long _Fract, ulf, ulr)
+ TEST (unsigned long long _Fract, ullf, ullr)
+ TEST (_Sat short _Fract, Ssf, hr)
+ TEST (_Sat _Fract, Sf, r)
+ TEST (_Sat long _Fract, Slf, lr)
+ TEST (_Sat long long _Fract, Sllf, llr)
+ TEST (_Sat unsigned short _Fract, Susf, uhr)
+ TEST (_Sat unsigned _Fract, Suf, ur)
+ TEST (_Sat unsigned long _Fract, Sulf, ulr)
+ TEST (_Sat unsigned long long _Fract, Sullf, ullr)
+ TEST (short _Accum, sa, hk)
+ TEST (_Accum, a, k)
+ TEST (long _Accum, la, lk)
+ TEST (long long _Accum, lla, llk)
+ TEST (unsigned short _Accum, usa, uhk)
+ TEST (unsigned _Accum, ua, uk)
+ TEST (unsigned long _Accum, ula, ulk)
+ TEST (unsigned long long _Accum, ulla, ullk)
+ TEST (_Sat short _Accum, Ssa, hk)
+ TEST (_Sat _Accum, Sa, k)
+ TEST (_Sat long _Accum, Sla, lk)
+ TEST (_Sat long long _Accum, Slla, llk)
+ TEST (_Sat unsigned short _Accum, Susa, uhk)
+ TEST (_Sat unsigned _Accum, Sua, uk)
+ TEST (_Sat unsigned long _Accum, Sula, ulk)
+ TEST (_Sat unsigned long long _Accum, Sulla, ullk)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-mixed.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-mixed.c
new file mode 100644
index 000000000..01930e450
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-mixed.c
@@ -0,0 +1,103 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.2.2 Function calls.
+ Test scalar passing and return values involving fixed-point types.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+/* A handful of functions that return the Nth argument of
+ an incoming array. */
+
+#define FUNC(TYPE,NAME) \
+TYPE NAME ## 0 (TYPE arg0, int arg1, unsigned arg2, float arg3, double arg4) \
+ { return arg0; } \
+TYPE NAME ## 1 (int arg0, TYPE arg1, unsigned arg2, float arg3, double arg4) \
+ { return arg1; } \
+TYPE NAME ## 2 (int arg0, unsigned arg1, TYPE arg2, float arg3, double arg4) \
+ { return arg2; } \
+TYPE NAME ## 3 (int arg0, unsigned arg1, float arg2, TYPE arg3, double arg4) \
+ { return arg3; } \
+TYPE NAME ## 4 (int arg0, unsigned arg1, float arg2, double arg3, TYPE arg4) \
+ { return arg4; }
+
+FUNC (short _Fract, sf)
+FUNC (_Fract, f)
+FUNC (long _Fract, lf)
+FUNC (long long _Fract, llf)
+FUNC (unsigned short _Fract, usf)
+FUNC (unsigned _Fract, uf)
+FUNC (unsigned long _Fract, ulf)
+FUNC (unsigned long long _Fract, ullf)
+FUNC (_Sat short _Fract, Ssf)
+FUNC (_Sat _Fract, Sf)
+FUNC (_Sat long _Fract, Slf)
+FUNC (_Sat long long _Fract, Sllf)
+FUNC (_Sat unsigned short _Fract, Susf)
+FUNC (_Sat unsigned _Fract, Suf)
+FUNC (_Sat unsigned long _Fract, Sulf)
+FUNC (_Sat unsigned long long _Fract, Sullf)
+FUNC (short _Accum, sa)
+FUNC (_Accum, a)
+FUNC (long _Accum, la)
+FUNC (long long _Accum, lla)
+FUNC (unsigned short _Accum, usa)
+FUNC (unsigned _Accum, ua)
+FUNC (unsigned long _Accum, ula)
+FUNC (unsigned long long _Accum, ulla)
+FUNC (_Sat short _Accum, Ssa)
+FUNC (_Sat _Accum, Sa)
+FUNC (_Sat long _Accum, Sla)
+FUNC (_Sat long long _Accum, Slla)
+FUNC (_Sat unsigned short _Accum, Susa)
+FUNC (_Sat unsigned _Accum, Sua)
+FUNC (_Sat unsigned long _Accum, Sula)
+FUNC (_Sat unsigned long long _Accum, Sulla)
+
+int main()
+{
+#define TEST(TYPE,NAME,PF) \
+ { \
+ if (NAME ## 0 (0.1 ## PF, -1, 1, 0.3f, 0.5) != 0.1 ## PF) abort (); \
+ if (NAME ## 1 (-1, 0.1 ## PF, 1, 0.3f, 0.5) != 0.1 ## PF) abort (); \
+ if (NAME ## 2 (-1, 1, 0.1 ## PF, 0.3f, 0.5) != 0.1 ## PF) abort (); \
+ if (NAME ## 3 (-1, 1, 0.3f, 0.1 ## PF, 0.5) != 0.1 ## PF) abort (); \
+ if (NAME ## 4 (-1, 1, 0.3f, 0.5, 0.1 ## PF) != 0.1 ## PF) abort (); \
+ }
+
+ TEST (short _Fract, sf, hr)
+ TEST (_Fract, f, r)
+ TEST (long _Fract, lf, lr)
+ TEST (long long _Fract, llf, llr)
+ TEST (unsigned short _Fract, usf, uhr)
+ TEST (unsigned _Fract, uf, ur)
+ TEST (unsigned long _Fract, ulf, ulr)
+ TEST (unsigned long long _Fract, ullf, ullr)
+ TEST (_Sat short _Fract, Ssf, hr)
+ TEST (_Sat _Fract, Sf, r)
+ TEST (_Sat long _Fract, Slf, lr)
+ TEST (_Sat long long _Fract, Sllf, llr)
+ TEST (_Sat unsigned short _Fract, Susf, uhr)
+ TEST (_Sat unsigned _Fract, Suf, ur)
+ TEST (_Sat unsigned long _Fract, Sulf, ulr)
+ TEST (_Sat unsigned long long _Fract, Sullf, ullr)
+ TEST (short _Accum, sa, hk)
+ TEST (_Accum, a, k)
+ TEST (long _Accum, la, lk)
+ TEST (long long _Accum, lla, llk)
+ TEST (unsigned short _Accum, usa, uhk)
+ TEST (unsigned _Accum, ua, uk)
+ TEST (unsigned long _Accum, ula, ulk)
+ TEST (unsigned long long _Accum, ulla, ullk)
+ TEST (_Sat short _Accum, Ssa, hk)
+ TEST (_Sat _Accum, Sa, k)
+ TEST (_Sat long _Accum, Sla, lk)
+ TEST (_Sat long long _Accum, Slla, llk)
+ TEST (_Sat unsigned short _Accum, Susa, uhk)
+ TEST (_Sat unsigned _Accum, Sua, uk)
+ TEST (_Sat unsigned long _Accum, Sula, ulk)
+ TEST (_Sat unsigned long long _Accum, Sulla, ullk)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-scalar.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-scalar.c
new file mode 100644
index 000000000..957b56281
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-scalar.c
@@ -0,0 +1,108 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.2.2 Function calls.
+ Test scalar passing and return values involving fixed-point types.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+/* A handful of functions that return the Nth argument of
+ an incoming array. */
+
+#define FUNC(TYPE,NAME) \
+TYPE NAME ## 0 (TYPE arg0, TYPE arg1, TYPE arg2, TYPE arg3, TYPE arg4) \
+ { return arg0; } \
+TYPE NAME ## 1 (TYPE arg0, TYPE arg1, TYPE arg2, TYPE arg3, TYPE arg4) \
+ { return arg1; } \
+TYPE NAME ## 2 (TYPE arg0, TYPE arg1, TYPE arg2, TYPE arg3, TYPE arg4) \
+ { return arg2; } \
+TYPE NAME ## 3 (TYPE arg0, TYPE arg1, TYPE arg2, TYPE arg3, TYPE arg4) \
+ { return arg3; } \
+TYPE NAME ## 4 (TYPE arg0, TYPE arg1, TYPE arg2, TYPE arg3, TYPE arg4) \
+ { return arg4; }
+
+FUNC (short _Fract, sf)
+FUNC (_Fract, f)
+FUNC (long _Fract, lf)
+FUNC (long long _Fract, llf)
+FUNC (unsigned short _Fract, usf)
+FUNC (unsigned _Fract, uf)
+FUNC (unsigned long _Fract, ulf)
+FUNC (unsigned long long _Fract, ullf)
+FUNC (_Sat short _Fract, Ssf)
+FUNC (_Sat _Fract, Sf)
+FUNC (_Sat long _Fract, Slf)
+FUNC (_Sat long long _Fract, Sllf)
+FUNC (_Sat unsigned short _Fract, Susf)
+FUNC (_Sat unsigned _Fract, Suf)
+FUNC (_Sat unsigned long _Fract, Sulf)
+FUNC (_Sat unsigned long long _Fract, Sullf)
+FUNC (short _Accum, sa)
+FUNC (_Accum, a)
+FUNC (long _Accum, la)
+FUNC (long long _Accum, lla)
+FUNC (unsigned short _Accum, usa)
+FUNC (unsigned _Accum, ua)
+FUNC (unsigned long _Accum, ula)
+FUNC (unsigned long long _Accum, ulla)
+FUNC (_Sat short _Accum, Ssa)
+FUNC (_Sat _Accum, Sa)
+FUNC (_Sat long _Accum, Sla)
+FUNC (_Sat long long _Accum, Slla)
+FUNC (_Sat unsigned short _Accum, Susa)
+FUNC (_Sat unsigned _Accum, Sua)
+FUNC (_Sat unsigned long _Accum, Sula)
+FUNC (_Sat unsigned long long _Accum, Sulla)
+
+int main()
+{
+#define TEST(TYPE,NAME,PF) \
+ { \
+ if (NAME ## 0 (0.1 ## PF, 0.2 ## PF, 0.3 ## PF, 0.4 ## PF, 0.5 ## PF) \
+ != 0.1 ## PF) abort (); \
+ if (NAME ## 1 (0.1 ## PF, 0.2 ## PF, 0.3 ## PF, 0.4 ## PF, 0.5 ## PF) \
+ != 0.2 ## PF) abort (); \
+ if (NAME ## 2 (0.1 ## PF, 0.2 ## PF, 0.3 ## PF, 0.4 ## PF, 0.5 ## PF) \
+ != 0.3 ## PF) abort (); \
+ if (NAME ## 3 (0.1 ## PF, 0.2 ## PF, 0.3 ## PF, 0.4 ## PF, 0.5 ## PF) \
+ != 0.4 ## PF) abort (); \
+ if (NAME ## 4 (0.1 ## PF, 0.2 ## PF, 0.3 ## PF, 0.4 ## PF, 0.5 ## PF) \
+ != 0.5 ## PF) abort (); \
+ }
+
+ TEST (short _Fract, sf, hr)
+ TEST (_Fract, f, r)
+ TEST (long _Fract, lf, lr)
+ TEST (long long _Fract, llf, llr)
+ TEST (unsigned short _Fract, usf, uhr)
+ TEST (unsigned _Fract, uf, ur)
+ TEST (unsigned long _Fract, ulf, ulr)
+ TEST (unsigned long long _Fract, ullf, ullr)
+ TEST (_Sat short _Fract, Ssf, hr)
+ TEST (_Sat _Fract, Sf, r)
+ TEST (_Sat long _Fract, Slf, lr)
+ TEST (_Sat long long _Fract, Sllf, llr)
+ TEST (_Sat unsigned short _Fract, Susf, uhr)
+ TEST (_Sat unsigned _Fract, Suf, ur)
+ TEST (_Sat unsigned long _Fract, Sulf, ulr)
+ TEST (_Sat unsigned long long _Fract, Sullf, ullr)
+ TEST (short _Accum, sa, hk)
+ TEST (_Accum, a, k)
+ TEST (long _Accum, la, lk)
+ TEST (long long _Accum, lla, llk)
+ TEST (unsigned short _Accum, usa, uhk)
+ TEST (unsigned _Accum, ua, uk)
+ TEST (unsigned long _Accum, ula, ulk)
+ TEST (unsigned long long _Accum, ulla, ullk)
+ TEST (_Sat short _Accum, Ssa, hk)
+ TEST (_Sat _Accum, Sa, k)
+ TEST (_Sat long _Accum, Sla, lk)
+ TEST (_Sat long long _Accum, Slla, llk)
+ TEST (_Sat unsigned short _Accum, Susa, uhk)
+ TEST (_Sat unsigned _Accum, Sua, uk)
+ TEST (_Sat unsigned long _Accum, Sula, ulk)
+ TEST (_Sat unsigned long long _Accum, Sulla, ullk)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-struct.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-struct.c
new file mode 100644
index 000000000..c75388863
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-struct.c
@@ -0,0 +1,191 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.2.2 Function calls.
+ Test structure passing and return values involving fixed-point types.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+struct example
+{
+ short _Fract sf;
+ char dummy1;
+ _Fract f;
+ char dummy2;
+ long _Fract lf;
+ char dummy3;
+ long long _Fract llf;
+ char dummy4;
+ unsigned short _Fract usf;
+ char dummy5;
+ unsigned _Fract uf;
+ char dummy6;
+ unsigned long _Fract ulf;
+ char dummy7;
+ unsigned long long _Fract ullf;
+ char dummy8;
+ _Sat short _Fract Ssf;
+ char dummy9;
+ _Sat _Fract Sf;
+ char dummy10;
+ _Sat long _Fract Slf;
+ char dummy11;
+ _Sat long long _Fract Sllf;
+ char dummy12;
+ _Sat unsigned short _Fract Susf;
+ char dummy13;
+ _Sat unsigned _Fract Suf;
+ char dummy14;
+ _Sat unsigned long _Fract Sulf;
+ char dummy15;
+ _Sat unsigned long long _Fract Sullf;
+ char dummy16;
+ short _Accum sa;
+ char dummya1;
+ _Accum a;
+ char dummya2;
+ long _Accum la;
+ char dummya3;
+ long long _Accum lla;
+ char dummya4;
+ unsigned short _Accum usa;
+ char dummya5;
+ unsigned _Accum ua;
+ char dummya6;
+ unsigned long _Accum ula;
+ char dummya7;
+ unsigned long long _Accum ulla;
+ char dummya8;
+ _Sat short _Accum Ssa;
+ char dummya9;
+ _Sat _Accum Sa;
+ char dummya10;
+ _Sat long _Accum Sla;
+ char dummya11;
+ _Sat long long _Accum Slla;
+ char dummya12;
+ _Sat unsigned short _Accum Susa;
+ char dummya13;
+ _Sat unsigned _Accum Sua;
+ char dummya14;
+ _Sat unsigned long _Accum Sula;
+ char dummya15;
+ _Sat unsigned long long _Accum Sulla;
+ char dummya16;
+} nums = { 0.1hr, 'a',
+ 0.2r, 'b',
+ 0.3lr, 'c',
+ 0.4llr, 'd',
+ 0.5uhr, 'e',
+ 0.6ur, 'f',
+ 0.7ulr, 'g',
+ 0.8ullr, 'h',
+ 0.11r, 'i',
+ 0.22r, 'j',
+ 0.33lr, 'k',
+ 0.44llr, 'l',
+ 0.55uhr, 'm',
+ 0.66ur, 'n',
+ 0.77ulr, 'o',
+ 0.88ullr, 'p',
+ 0.1hk, 'q',
+ 0.2k, 'r',
+ 0.3lk, 's',
+ 0.4llk, 't',
+ 0.5uhk, 'u',
+ 0.6uk, 'v',
+ 0.7ulk, 'w',
+ 0.8ullk, 'x',
+ 0.11k, 'y',
+ 0.22k, 'z',
+ 0.33lk, '0',
+ 0.44llk, '1',
+ 0.55uhk, '2',
+ 0.66uk, '3',
+ 0.77ulk, '4',
+ 0.88ullk, '5'
+ };
+
+/* A handful of functions that return the Nth argument of
+ an incoming array. */
+
+#define FUNC(TYPE,NAME) \
+TYPE NAME ## _func (struct example s) \
+ { return s. NAME; }
+
+FUNC (short _Fract, sf)
+FUNC (_Fract, f)
+FUNC (long _Fract, lf)
+FUNC (long long _Fract, llf)
+FUNC (unsigned short _Fract, usf)
+FUNC (unsigned _Fract, uf)
+FUNC (unsigned long _Fract, ulf)
+FUNC (unsigned long long _Fract, ullf)
+FUNC (_Sat short _Fract, Ssf)
+FUNC (_Sat _Fract, Sf)
+FUNC (_Sat long _Fract, Slf)
+FUNC (_Sat long long _Fract, Sllf)
+FUNC (_Sat unsigned short _Fract, Susf)
+FUNC (_Sat unsigned _Fract, Suf)
+FUNC (_Sat unsigned long _Fract, Sulf)
+FUNC (_Sat unsigned long long _Fract, Sullf)
+FUNC (short _Accum, sa)
+FUNC (_Accum, a)
+FUNC (long _Accum, la)
+FUNC (long long _Accum, lla)
+FUNC (unsigned short _Accum, usa)
+FUNC (unsigned _Accum, ua)
+FUNC (unsigned long _Accum, ula)
+FUNC (unsigned long long _Accum, ulla)
+FUNC (_Sat short _Accum, Ssa)
+FUNC (_Sat _Accum, Sa)
+FUNC (_Sat long _Accum, Sla)
+FUNC (_Sat long long _Accum, Slla)
+FUNC (_Sat unsigned short _Accum, Susa)
+FUNC (_Sat unsigned _Accum, Sua)
+FUNC (_Sat unsigned long _Accum, Sula)
+FUNC (_Sat unsigned long long _Accum, Sulla)
+
+int main()
+{
+#define TEST(TYPE,NAME,VALUE) \
+ { \
+ if (NAME ## _func (nums) != VALUE) abort (); \
+ }
+
+ TEST (short _Fract, sf, 0.1hr)
+ TEST (_Fract, f, 0.2r)
+ TEST (long _Fract, lf, 0.3lr)
+ TEST (long long _Fract, llf, 0.4llr)
+ TEST (unsigned short _Fract, usf, 0.5uhr)
+ TEST (unsigned _Fract, uf, 0.6ur)
+ TEST (unsigned long _Fract, ulf, 0.7ulr)
+ TEST (unsigned long long _Fract, ullf, 0.8ullr)
+ TEST (_Sat short _Fract, Ssf, 0.11hr)
+ TEST (_Sat _Fract, Sf, 0.22r)
+ TEST (_Sat long _Fract, Slf, 0.33lr)
+ TEST (_Sat long long _Fract, Sllf, 0.44llr)
+ TEST (_Sat unsigned short _Fract, Susf, 0.55uhr)
+ TEST (_Sat unsigned _Fract, Suf, 0.66ur)
+ TEST (_Sat unsigned long _Fract, Sulf, 0.77ulr)
+ TEST (_Sat unsigned long long _Fract, Sullf, 0.88ullr)
+ TEST (short _Accum, sa, 0.1hk)
+ TEST (_Accum, a, 0.2k)
+ TEST (long _Accum, la, 0.3lk)
+ TEST (long long _Accum, lla, 0.4llk)
+ TEST (unsigned short _Accum, usa, 0.5uhk)
+ TEST (unsigned _Accum, ua, 0.6uk)
+ TEST (unsigned long _Accum, ula, 0.7ulk)
+ TEST (unsigned long long _Accum, ulla, 0.8ullk)
+ TEST (_Sat short _Accum, Ssa, 0.11hk)
+ TEST (_Sat _Accum, Sa, 0.22k)
+ TEST (_Sat long _Accum, Sla, 0.33lk)
+ TEST (_Sat long long _Accum, Slla, 0.44llk)
+ TEST (_Sat unsigned short _Accum, Susa, 0.55uhk)
+ TEST (_Sat unsigned _Accum, Sua, 0.66uk)
+ TEST (_Sat unsigned long _Accum, Sula, 0.77ulk)
+ TEST (_Sat unsigned long long _Accum, Sulla, 0.88ullk)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg-mixed.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg-mixed.c
new file mode 100644
index 000000000..61a30e765
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg-mixed.c
@@ -0,0 +1,145 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.2.2 Function calls.
+ Test passing varargs of fixed-point types.
+ Based on the test from ../dfp/. */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+static int
+vararg_int (unsigned arg, ...)
+{
+ va_list ap;
+ int result_i;
+ va_start (ap, arg);
+ result_i = va_arg (ap, int);
+ return result_i;
+}
+
+static _Fract
+vararg_fract (unsigned arg, ...)
+{
+ va_list ap;
+ int result_i;
+ _Fract result_fr; \
+ va_start (ap, arg);
+ result_i = va_arg (ap, int);
+ result_fr = va_arg (ap, _Fract); \
+ return result_fr;
+}
+
+static int
+vararg_double (unsigned arg, ...)
+{
+ va_list ap;
+ int result_i;
+ _Fract result_fr; \
+ double result_d;
+ va_start (ap, arg);
+ result_i = va_arg (ap, int);
+ result_fr = va_arg (ap, _Fract); \
+ result_d = va_arg (ap, double); \
+ return result_d;
+}
+
+#define FUNC(TYPE, NAME) \
+static TYPE \
+vararg_ ## NAME (unsigned arg, ...) \
+{ \
+ va_list ap; \
+ int result_i; \
+ _Fract result_fr; \
+ double result_d; \
+ TYPE result; \
+ va_start (ap, arg); \
+ result_i = va_arg (ap, int); \
+ result_fr = va_arg (ap, _Fract); \
+ result_d = va_arg (ap, double); \
+ result = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return result; \
+}
+
+FUNC (short _Fract, sf)
+FUNC (_Fract, f)
+FUNC (long _Fract, lf)
+FUNC (long long _Fract, llf)
+FUNC (unsigned short _Fract, usf)
+FUNC (unsigned _Fract, uf)
+FUNC (unsigned long _Fract, ulf)
+FUNC (unsigned long long _Fract, ullf)
+FUNC (_Sat short _Fract, Ssf)
+FUNC (_Sat _Fract, Sf)
+FUNC (_Sat long _Fract, Slf)
+FUNC (_Sat long long _Fract, Sllf)
+FUNC (_Sat unsigned short _Fract, Susf)
+FUNC (_Sat unsigned _Fract, Suf)
+FUNC (_Sat unsigned long _Fract, Sulf)
+FUNC (_Sat unsigned long long _Fract, Sullf)
+FUNC (short _Accum, sa)
+FUNC (_Accum, a)
+FUNC (long _Accum, la)
+FUNC (long long _Accum, lla)
+FUNC (unsigned short _Accum, usa)
+FUNC (unsigned _Accum, ua)
+FUNC (unsigned long _Accum, ula)
+FUNC (unsigned long long _Accum, ulla)
+FUNC (_Sat short _Accum, Ssa)
+FUNC (_Sat _Accum, Sa)
+FUNC (_Sat long _Accum, Sla)
+FUNC (_Sat long long _Accum, Slla)
+FUNC (_Sat unsigned short _Accum, Susa)
+FUNC (_Sat unsigned _Accum, Sua)
+FUNC (_Sat unsigned long _Accum, Sula)
+FUNC (_Sat unsigned long long _Accum, Sulla)
+
+int main()
+{
+#define TEST(NAME,PF) \
+ if (vararg_int (0, 100, 0.9r, 55.0, 0.2 ## PF) != 100) \
+ abort (); \
+ if (vararg_fract (1, 100, 0.9r, 55.0, 0.2 ## PF) != 0.9r) \
+ abort (); \
+ if (vararg_double (2, 100, 0.9r, 55.0, 0.2 ## PF) != 55.0) \
+ abort (); \
+ if (vararg_ ## NAME (3, 100, 0.9r, 55.0, 0.2 ## PF) != 0.2 ## PF) \
+ abort (); \
+
+ TEST(sf, hr)
+ TEST(f, r)
+ TEST(lf, lr)
+ TEST(llf, llr)
+ TEST(usf, uhr)
+ TEST(uf, ur)
+ TEST(ulf, ulr)
+ TEST(ullf, ullr)
+ TEST(Ssf, hr)
+ TEST(Sf, r)
+ TEST(Slf, lr)
+ TEST(Sllf, llr)
+ TEST(Susf, uhr)
+ TEST(Suf, ur)
+ TEST(Sulf, ulr)
+ TEST(Sullf, ullr)
+ TEST(sa, hk)
+ TEST(a, k)
+ TEST(la, lk)
+ TEST(lla, llk)
+ TEST(usa, uhk)
+ TEST(ua, uk)
+ TEST(ula, ulk)
+ TEST(ulla, ullk)
+ TEST(Ssa, hk)
+ TEST(Sa, k)
+ TEST(Sla, lk)
+ TEST(Slla, llk)
+ TEST(Susa, uhk)
+ TEST(Sua, uk)
+ TEST(Sula, ulk)
+ TEST(Sulla, ullk)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg-size0.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg-size0.c
new file mode 100644
index 000000000..7c54e91b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg-size0.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.2.2 Function calls.
+ Based on the test from ../dfp/. */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+struct S1
+{
+ struct
+ {
+ _Fract e;
+ } b[0];
+};
+
+/* Test handling vararg parameters whose size is 0. */
+
+int check_var(int z,...)
+{
+ double d;
+ struct S1 s1;
+ long long result;
+ va_list ap;
+ va_start (ap, z);
+ d = va_arg (ap, double);
+ s1 = va_arg (ap, struct S1);
+ result = va_arg (ap, long long);
+ va_end (ap);
+ return (result == 2LL);
+
+}
+
+int
+main ()
+{
+ struct S1 s1;
+ struct S1 a1[5];
+
+ if (check_var(5, 1.0, s1, 2LL, a1[2], a1[2]) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg.c
new file mode 100644
index 000000000..9f517ae52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/func-vararg.c
@@ -0,0 +1,115 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.2.2 Function calls.
+ Test passing varargs of fixed-point types.
+ Based on the test from ../dfp/. */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+#define FUNC(TYPE, NAME) \
+static TYPE \
+vararg_ ## NAME (unsigned arg, ...) \
+{ \
+ int i; \
+ va_list ap; \
+ TYPE result; \
+ va_start (ap, arg); \
+ for (i = 0; i <= arg; i++) \
+ result = va_arg (ap, TYPE); \
+ va_end (ap); \
+ return result; \
+}
+
+FUNC (short _Fract, sf)
+FUNC (_Fract, f)
+FUNC (long _Fract, lf)
+FUNC (long long _Fract, llf)
+FUNC (unsigned short _Fract, usf)
+FUNC (unsigned _Fract, uf)
+FUNC (unsigned long _Fract, ulf)
+FUNC (unsigned long long _Fract, ullf)
+FUNC (_Sat short _Fract, Ssf)
+FUNC (_Sat _Fract, Sf)
+FUNC (_Sat long _Fract, Slf)
+FUNC (_Sat long long _Fract, Sllf)
+FUNC (_Sat unsigned short _Fract, Susf)
+FUNC (_Sat unsigned _Fract, Suf)
+FUNC (_Sat unsigned long _Fract, Sulf)
+FUNC (_Sat unsigned long long _Fract, Sullf)
+FUNC (short _Accum, sa)
+FUNC (_Accum, a)
+FUNC (long _Accum, la)
+FUNC (long long _Accum, lla)
+FUNC (unsigned short _Accum, usa)
+FUNC (unsigned _Accum, ua)
+FUNC (unsigned long _Accum, ula)
+FUNC (unsigned long long _Accum, ulla)
+FUNC (_Sat short _Accum, Ssa)
+FUNC (_Sat _Accum, Sa)
+FUNC (_Sat long _Accum, Sla)
+FUNC (_Sat long long _Accum, Slla)
+FUNC (_Sat unsigned short _Accum, Susa)
+FUNC (_Sat unsigned _Accum, Sua)
+FUNC (_Sat unsigned long _Accum, Sula)
+FUNC (_Sat unsigned long long _Accum, Sulla)
+
+int main()
+{
+#define TEST(NAME,PF) \
+ if (vararg_ ## NAME (0, 0.0 ## PF, 0.1 ## PF, 0.2 ## PF, 0.3 ## PF, \
+ 0.4 ## PF, 0.5 ## PF) != 0.0 ## PF) \
+ abort (); \
+ if (vararg_ ## NAME (1, 0.0 ## PF, 0.1 ## PF, 0.2 ## PF, 0.3 ## PF, \
+ 0.4 ## PF, 0.5 ## PF) != 0.1 ## PF) \
+ abort (); \
+ if (vararg_ ## NAME (2, 0.0 ## PF, 0.1 ## PF, 0.2 ## PF, 0.3 ## PF, \
+ 0.4 ## PF, 0.5 ## PF) != 0.2 ## PF) \
+ abort (); \
+ if (vararg_ ## NAME (3, 0.0 ## PF, 0.1 ## PF, 0.2 ## PF, 0.3 ## PF, \
+ 0.4 ## PF, 0.5 ## PF) != 0.3 ## PF) \
+ abort (); \
+ if (vararg_ ## NAME (4, 0.0 ## PF, 0.1 ## PF, 0.2 ## PF, 0.3 ## PF, \
+ 0.4 ## PF, 0.5 ## PF) != 0.4 ## PF) \
+ abort (); \
+ if (vararg_ ## NAME (5, 0.0 ## PF, 0.1 ## PF, 0.2 ## PF, 0.3 ## PF, \
+ 0.4 ## PF, 0.5 ## PF) != 0.5 ## PF) \
+ abort ();
+
+ TEST(sf, hr)
+ TEST(f, r)
+ TEST(lf, lr)
+ TEST(llf, llr)
+ TEST(usf, uhr)
+ TEST(uf, ur)
+ TEST(ulf, ulr)
+ TEST(ullf, ullr)
+ TEST(Ssf, hr)
+ TEST(Sf, r)
+ TEST(Slf, lr)
+ TEST(Sllf, llr)
+ TEST(Susf, uhr)
+ TEST(Suf, ur)
+ TEST(Sulf, ulr)
+ TEST(Sullf, ullr)
+ TEST(sa, hk)
+ TEST(a, k)
+ TEST(la, lk)
+ TEST(lla, llk)
+ TEST(usa, uhk)
+ TEST(ua, uk)
+ TEST(ula, ulk)
+ TEST(ulla, ullk)
+ TEST(Ssa, hk)
+ TEST(Sa, k)
+ TEST(Sla, lk)
+ TEST(Slla, llk)
+ TEST(Susa, uhk)
+ TEST(Sua, uk)
+ TEST(Sula, ulk)
+ TEST(Sulla, ullk)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/int-warning.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/int-warning.c
new file mode 100644
index 000000000..cf48e4ba2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/int-warning.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -O2" } */
+
+/* N1169 Conversion from fixed-point to integer.
+ Test if GCC warns when overflow or underflow. */
+
+signed char sc;
+unsigned char uc;
+
+void test()
+{
+ sc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */
+ sc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */
+ sc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */
+ sc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */
+ sc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */
+ sc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */
+ uc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */
+ uc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */
+ uc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */
+ uc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */
+ uc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */
+ uc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-c89.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-c89.c
new file mode 100644
index 000000000..df852148e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-c89.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89" } */
+
+/* Flixed-point keywords are not recognized in C89 mode. */
+
+_Fract w; /* { dg-error "" } */
+_Accum x; /* { dg-error "" } */
+_Sat _Fract y; /* { dg-error "" } */
+_Sat _Accum z; /* { dg-error "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-c99.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-c99.c
new file mode 100644
index 000000000..471e00446
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-c99.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+/* Fixed-point keywords are not recognized in C99 mode. */
+
+_Fract w; /* { dg-error "" } */
+_Accum x; /* { dg-error "" } */
+_Sat _Fract y; /* { dg-error "" } */
+_Sat _Fract z; /* { dg-error "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-ignored-c99.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-ignored-c99.c
new file mode 100644
index 000000000..c20b8e4ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-ignored-c99.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+/* Fixed-point keywords are not reserved for c99. */
+
+int _Fract (void)
+{
+ return 0;
+}
+
+int _Accum (void)
+{
+ return 0;
+}
+
+int _Sat (void)
+{
+ return 0;
+}
+
+int foo1 (int i)
+{
+ int _Fract = i * 2;
+ return _Fract;
+}
+
+int foo2 (int i)
+{
+ int _Accum = i * 2;
+ return _Accum;
+}
+
+int foo3 (int i)
+{
+ int _Sat = i * 2;
+ return _Sat;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-pedantic.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-pedantic.c
new file mode 100644
index 000000000..654710671
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-pedantic.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+/* Fixed-point is a GCC extension. */
+
+_Fract w; /* { dg-warning "GCC extension|ISO C" } */
+_Accum x; /* { dg-warning "GCC extension|ISO C" } */
+_Sat _Fract y; /* { dg-warning "GCC extension|ISO C" } */
+_Sat _Accum z; /* { dg-warning "GCC extension|ISO C" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c
new file mode 100644
index 000000000..63b634982
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/keywords-reserved.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 6.4.1: Keywords.
+ C99 6.4.1(2): Keywords.
+ Fixed-point keywords cannot be used in other contexts. */
+
+int _Fract (void) /* { dg-error "" } */
+{
+ return 0;
+}
+
+int _Accum (void) /* { dg-error "" } */
+{
+ return 0;
+}
+
+int _Sat (void) /* { dg-error "" } */
+{
+ return 0;
+}
+
+int foo1 (int i)
+{
+ int _Fract = i * 2; /* { dg-error "" } */
+ return _Fract; /* { dg-error "" } */
+}
+
+int foo2 (int i)
+{
+ int _Accum = i * 2; /* { dg-error "" } */
+ return _Accum; /* { dg-error "" } */
+}
+
+int foo3 (int i)
+{
+ int _Sat = i * 2; /* { dg-error "" } */
+ return _Sat; /* { dg-error "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/loop-index.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/loop-index.c
new file mode 100644
index 000000000..d7ed9116f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/loop-index.c
@@ -0,0 +1,91 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.8.5.2: The for statement.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+#define FUNC(TYPE,NAME,PF) \
+void \
+NAME (void) \
+{ \
+ TYPE d; \
+ int i; \
+ for (d = 0.1 ## PF, i = 0; d <= 0.8 ## PF; d += 0.1 ## PF) \
+ i++; \
+ if (i != 8) \
+ abort(); \
+}
+
+FUNC (short _Fract, sf, hr)
+FUNC (_Fract, f, r)
+FUNC (long _Fract, lf, lr)
+FUNC (long long _Fract, llf, llr)
+FUNC (unsigned short _Fract, usf, uhr)
+FUNC (unsigned _Fract, uf, ur)
+FUNC (unsigned long _Fract, ulf, ulr)
+FUNC (unsigned long long _Fract, ullf, ullr)
+FUNC (_Sat short _Fract, Ssf, hr)
+FUNC (_Sat _Fract, Sf, r)
+FUNC (_Sat long _Fract, Slf, lr)
+FUNC (_Sat long long _Fract, Sllf, llr)
+FUNC (_Sat unsigned short _Fract, Susf, uhr)
+FUNC (_Sat unsigned _Fract, Suf, ur)
+FUNC (_Sat unsigned long _Fract, Sulf, ulr)
+FUNC (_Sat unsigned long long _Fract, Sullf, ullr)
+FUNC (short _Accum, sa, hk)
+FUNC (_Accum, a, k)
+FUNC (long _Accum, la, lk)
+FUNC (long long _Accum, lla, llk)
+FUNC (unsigned short _Accum, usa, uhk)
+FUNC (unsigned _Accum, ua, uk)
+FUNC (unsigned long _Accum, ula, ulk)
+FUNC (unsigned long long _Accum, ulla, ullk)
+FUNC (_Sat short _Accum, Ssa, hk)
+FUNC (_Sat _Accum, Sa, k)
+FUNC (_Sat long _Accum, Sla, lk)
+FUNC (_Sat long long _Accum, Slla, llk)
+FUNC (_Sat unsigned short _Accum, Susa, uhk)
+FUNC (_Sat unsigned _Accum, Sua, uk)
+FUNC (_Sat unsigned long _Accum, Sula, ulk)
+FUNC (_Sat unsigned long long _Accum, Sulla, ullk)
+
+int
+main ()
+{
+ sf ();
+ f ();
+ lf ();
+ llf ();
+ usf ();
+ uf ();
+ ulf ();
+ ullf ();
+ Ssf ();
+ Sf ();
+ Slf ();
+ Sllf ();
+ Susf ();
+ Suf ();
+ Sulf ();
+ Sullf ();
+ sa ();
+ a ();
+ la ();
+ lla ();
+ usa ();
+ ua ();
+ ula ();
+ ulla ();
+ Ssa ();
+ Sa ();
+ Sla ();
+ Slla ();
+ Susa ();
+ Sua ();
+ Sula ();
+ Sulla ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/modes.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/modes.c
new file mode 100644
index 000000000..082b2b2c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/modes.c
@@ -0,0 +1,119 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+typedef _Fract qq __attribute__ ((mode (QQ)));
+typedef _Fract hq __attribute__ ((mode (HQ)));
+typedef _Fract sq __attribute__ ((mode (SQ)));
+typedef _Fract dq __attribute__ ((mode (DQ)));
+typedef unsigned _Fract uqq __attribute__ ((mode (UQQ)));
+typedef unsigned _Fract uhq __attribute__ ((mode (UHQ)));
+typedef unsigned _Fract usq __attribute__ ((mode (USQ)));
+typedef unsigned _Fract udq __attribute__ ((mode (UDQ)));
+typedef _Sat _Fract Sqq __attribute__ ((mode (QQ)));
+typedef _Sat _Fract Shq __attribute__ ((mode (HQ)));
+typedef _Sat _Fract Ssq __attribute__ ((mode (SQ)));
+typedef _Sat _Fract Sdq __attribute__ ((mode (DQ)));
+typedef _Sat unsigned _Fract Suqq __attribute__ ((mode (UQQ)));
+typedef _Sat unsigned _Fract Suhq __attribute__ ((mode (UHQ)));
+typedef _Sat unsigned _Fract Susq __attribute__ ((mode (USQ)));
+typedef _Sat unsigned _Fract Sudq __attribute__ ((mode (UDQ)));
+typedef _Accum ha __attribute__ ((mode (HA)));
+typedef _Accum sa __attribute__ ((mode (SA)));
+typedef _Accum da __attribute__ ((mode (DA)));
+typedef unsigned _Accum uha __attribute__ ((mode (UHA)));
+typedef unsigned _Accum usa __attribute__ ((mode (USA)));
+typedef unsigned _Accum uda __attribute__ ((mode (UDA)));
+typedef _Sat _Accum Sha __attribute__ ((mode (HA)));
+typedef _Sat _Accum Ssa __attribute__ ((mode (SA)));
+typedef _Sat _Accum Sda __attribute__ ((mode (DA)));
+typedef _Sat unsigned _Accum Suha __attribute__ ((mode (UHA)));
+typedef _Sat unsigned _Accum Susa __attribute__ ((mode (USA)));
+typedef _Sat unsigned _Accum Suda __attribute__ ((mode (UDA)));
+
+/* Not all platforms support TQ, UTQ, TA, UTA modes. */
+#if defined(__LP64__) && !defined(__hppa__)
+typedef _Fract tq __attribute__ ((mode (TQ)));
+typedef unsigned _Fract utq __attribute__ ((mode (UTQ)));
+typedef _Sat _Fract Stq __attribute__ ((mode (TQ)));
+typedef _Sat unsigned _Fract Sutq __attribute__ ((mode (UTQ)));
+typedef _Accum ta __attribute__ ((mode (TA)));
+typedef unsigned _Accum uta __attribute__ ((mode (UTA)));
+typedef _Sat _Accum Sta __attribute__ ((mode (TA)));
+typedef _Sat unsigned _Accum Suta __attribute__ ((mode (UTA)));
+
+int tqsize[sizeof (tq) == 16 ? 1 : -1];
+int utqsize[sizeof (utq) == 16 ? 1 : -1];
+int Stqsize[sizeof (Stq) == 16 ? 1 : -1];
+int Sutqsize[sizeof (Sutq) == 16 ? 1 : -1];
+int tasize[sizeof (ta) == 16 ? 1 : -1];
+int utasize[sizeof (uta) == 16 ? 1 : -1];
+int Stasize[sizeof (Sta) == 16 ? 1 : -1];
+int Sutasize[sizeof (Suta) == 16 ? 1 : -1];
+
+int tqalign = __alignof (tq);
+int utqalign = __alignof (utq);
+int Stqalign = __alignof (Stq);
+int Sutqalign = __alignof (Sutq);
+int taalign = __alignof (ta);
+int utaalign = __alignof (uta);
+int Staalign = __alignof (Sta);
+int Sutaalign = __alignof (Suta);
+#endif
+
+int qqsize[sizeof (qq) == 1 ? 1 : -1];
+int hqsize[sizeof (hq) == 2 ? 1 : -1];
+int sqsize[sizeof (sq) == 4 ? 1 : -1];
+int dqsize[sizeof (dq) == 8 ? 1 : -1];
+int uqqsize[sizeof (qq) == 1 ? 1 : -1];
+int uhqsize[sizeof (hq) == 2 ? 1 : -1];
+int usqsize[sizeof (sq) == 4 ? 1 : -1];
+int udqsize[sizeof (dq) == 8 ? 1 : -1];
+int Sqqsize[sizeof (Sqq) == 1 ? 1 : -1];
+int Shqsize[sizeof (Shq) == 2 ? 1 : -1];
+int Ssqsize[sizeof (Ssq) == 4 ? 1 : -1];
+int Sdqsize[sizeof (Sdq) == 8 ? 1 : -1];
+int Suqqsize[sizeof (Sqq) == 1 ? 1 : -1];
+int Suhqsize[sizeof (Shq) == 2 ? 1 : -1];
+int Susqsize[sizeof (Ssq) == 4 ? 1 : -1];
+int Sudqsize[sizeof (Sdq) == 8 ? 1 : -1];
+int hasize[sizeof (ha) == 2 ? 1 : -1];
+int sasize[sizeof (sa) == 4 ? 1 : -1];
+int dasize[sizeof (da) == 8 ? 1 : -1];
+int uhasize[sizeof (uha) == 2 ? 1 : -1];
+int usasize[sizeof (usa) == 4 ? 1 : -1];
+int udasize[sizeof (uda) == 8 ? 1 : -1];
+int Shasize[sizeof (Sha) == 2 ? 1 : -1];
+int Ssasize[sizeof (Ssa) == 4 ? 1 : -1];
+int Sdasize[sizeof (Sda) == 8 ? 1 : -1];
+int Suhasize[sizeof (Suha) == 2 ? 1 : -1];
+int Susasize[sizeof (Susa) == 4 ? 1 : -1];
+int Sudasize[sizeof (Suda) == 8 ? 1 : -1];
+
+int qqalign = __alignof (qq);
+int hqalign = __alignof (hq);
+int sqalign = __alignof (sq);
+int dqalign = __alignof (dq);
+int uqqalign = __alignof (uqq);
+int uhqalign = __alignof (uhq);
+int usqalign = __alignof (usq);
+int udqalign = __alignof (udq);
+int Sqqalign = __alignof (Sqq);
+int Shqalign = __alignof (Shq);
+int Ssqalign = __alignof (Ssq);
+int Sdqalign = __alignof (Sdq);
+int Suqqalign = __alignof (Suqq);
+int Suhqalign = __alignof (Suhq);
+int Susqalign = __alignof (Susq);
+int Sudqalign = __alignof (Sudq);
+int haalign = __alignof (ha);
+int saalign = __alignof (sa);
+int daalign = __alignof (da);
+int uhaalign = __alignof (uha);
+int usaalign = __alignof (usa);
+int udaalign = __alignof (uda);
+int Shaalign = __alignof (Sha);
+int Ssaalign = __alignof (Ssa);
+int Sdaalign = __alignof (Sda);
+int Suhaalign = __alignof (Suha);
+int Susaalign = __alignof (Susa);
+int Sudaalign = __alignof (Suda);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/muldiv-warning.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/muldiv-warning.c
new file mode 100644
index 000000000..4ac553139
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/muldiv-warning.c
@@ -0,0 +1,72 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* Check if GCC generates warnings when overflows for mul and div. */
+
+short _Fract sf0 = __SFRACT_MIN__ * __SFRACT_MIN__; /* { dg-warning "overflow" } */
+_Fract f0 = __FRACT_MIN__ * __FRACT_MIN__; /* { dg-warning "overflow" } */
+long _Fract lf0 = __LFRACT_MIN__ * __LFRACT_MIN__; /* { dg-warning "overflow" } */
+long long _Fract llf0 = __LLFRACT_MIN__ * __LLFRACT_MIN__; /* { dg-warning "overflow" } */
+short _Fract sf1 = __SFRACT_MAX__ * __SFRACT_MIN__;
+_Fract f1 = __FRACT_MAX__ * __FRACT_MIN__;
+long _Fract lf1 = __LFRACT_MAX__ * __LFRACT_MIN__;
+long long _Fract llf1 = __LLFRACT_MAX__ * __LLFRACT_MIN__;
+short _Fract sf2 = __SFRACT_MIN__ / __SFRACT_MIN__; /* { dg-warning "overflow" } */
+_Fract f2 = __FRACT_MIN__ / __FRACT_MIN__; /* { dg-warning "overflow" } */
+long _Fract lf2 = __LFRACT_MIN__ / __LFRACT_MIN__; /* { dg-warning "overflow" } */
+long long _Fract llf2 = __LLFRACT_MIN__ / __LLFRACT_MIN__; /* { dg-warning "overflow" } */
+short _Fract sf3 = __SFRACT_MAX__ / __SFRACT_MIN__;
+_Fract f3 = __FRACT_MAX__ / __FRACT_MIN__;
+long _Fract lf3 = __LFRACT_MAX__ / __LFRACT_MIN__;
+long long _Fract llf3 = __LLFRACT_MAX__ / __LLFRACT_MIN__;
+
+unsigned short _Fract usf0 = __USFRACT_MIN__ * __USFRACT_MIN__;
+unsigned _Fract uf0 = __UFRACT_MIN__ * __UFRACT_MIN__;
+unsigned long _Fract ulf0 = __ULFRACT_MIN__ * __ULFRACT_MIN__;
+unsigned long long _Fract ullf0 = __ULLFRACT_MIN__ * __ULLFRACT_MIN__;
+unsigned short _Fract usf1 = __USFRACT_MAX__ * __USFRACT_MIN__;
+unsigned _Fract uf1 = __UFRACT_MAX__ * __UFRACT_MIN__;
+unsigned long _Fract ulf1 = __ULFRACT_MAX__ * __ULFRACT_MIN__;
+unsigned long long _Fract ullf1 = __ULLFRACT_MAX__ * __ULLFRACT_MIN__;
+unsigned short _Fract usf2 = __USFRACT_MAX__ / __USFRACT_MAX__; /* { dg-warning "overflow" } */
+unsigned _Fract uf2 = __UFRACT_MAX__ / __UFRACT_MAX__; /* { dg-warning "overflow" } */
+unsigned long _Fract ulf2 = __ULFRACT_MAX__ / __ULFRACT_MAX__; /* { dg-warning "overflow" } */
+unsigned long long _Fract ullf2 = __ULLFRACT_MAX__ / __ULLFRACT_MAX__; /* { dg-warning "overflow" } */
+unsigned short _Fract usf3 = __USFRACT_MIN__ / __USFRACT_MAX__;
+unsigned _Fract uf3 = __UFRACT_MIN__ / __UFRACT_MAX__;
+unsigned long _Fract ulf3 = __ULFRACT_MIN__ / __ULFRACT_MAX__;
+unsigned long long _Fract ullf3 = __ULLFRACT_MIN__ / __ULLFRACT_MAX__;
+
+short _Accum sa0 = __SACCUM_MIN__ * __SACCUM_MIN__; /* { dg-warning "overflow" } */
+_Accum a0 = __ACCUM_MIN__ * __ACCUM_MIN__; /* { dg-warning "overflow" } */
+long _Accum la0 = __LACCUM_MIN__ * __LACCUM_MIN__; /* { dg-warning "overflow" } */
+long long _Accum lla0 = __LLACCUM_MIN__ * __LLACCUM_MIN__; /* { dg-warning "overflow" } */
+short _Accum sa1 = __SACCUM_MAX__ * 0.1hk;
+_Accum a1 = __ACCUM_MAX__ * 0.1k;
+long _Accum la1 = __LACCUM_MAX__ * 0.1lk;
+long long _Accum lla1 = __LLACCUM_MAX__ * 0.1llk;
+short _Accum sa2 = __SACCUM_MIN__ / 0.1hk; /* { dg-warning "overflow" } */
+_Accum a2 = __ACCUM_MIN__ / 0.1k; /* { dg-warning "overflow" } */
+long _Accum la2 = __LACCUM_MIN__ / 0.1lk; /* { dg-warning "overflow" } */
+long long _Accum lla2 = __LLACCUM_MIN__ / 0.1llk; /* { dg-warning "overflow" } */
+short _Accum sa3 = __SACCUM_MAX__ / __SACCUM_MIN__;
+_Accum a3 = __ACCUM_MAX__ / __ACCUM_MIN__;
+long _Accum la3 = __LACCUM_MAX__ / __LACCUM_MIN__;
+long long _Accum lla3 = __LLACCUM_MAX__ / __LLACCUM_MIN__;
+
+unsigned short _Accum usa0 = __USACCUM_MIN__ * __USACCUM_MIN__;
+unsigned _Accum ua0 = __UACCUM_MIN__ * __UACCUM_MIN__;
+unsigned long _Accum ula0 = __ULACCUM_MIN__ * __ULACCUM_MIN__;
+unsigned long long _Accum ulla0 = __ULLACCUM_MIN__ * __ULLACCUM_MIN__;
+unsigned short _Accum usa1 = __USACCUM_MAX__ * __USACCUM_MAX__; /* { dg-warning "overflow" } */
+unsigned _Accum ua1 = __UACCUM_MAX__ * __UACCUM_MAX__; /* { dg-warning "overflow" } */
+unsigned long _Accum ula1 = __ULACCUM_MAX__ * __ULACCUM_MAX__; /* { dg-warning "overflow" } */
+unsigned long long _Accum ulla1 = __ULLACCUM_MAX__ * __ULLACCUM_MAX__; /* { dg-warning "overflow" } */
+unsigned short _Accum usa2 = __USACCUM_MAX__ / 0.5hk; /* { dg-warning "overflow" } */
+unsigned _Accum ua2 = __UACCUM_MAX__ / 0.5k; /* { dg-warning "overflow" } */
+unsigned long _Accum ula2 = __ULACCUM_MAX__ / 0.5lk; /* { dg-warning "overflow" } */
+unsigned long long _Accum ulla2 = __ULLACCUM_MAX__ / 0.5llk; /* { dg-warning "overflow" } */
+unsigned short _Accum usa3 = __USACCUM_MIN__ / __USACCUM_MAX__;
+unsigned _Accum ua3 = __UACCUM_MIN__ / __UACCUM_MAX__;
+unsigned long _Accum ula3 = __ULACCUM_MIN__ / __ULACCUM_MAX__;
+unsigned long long _Accum ulla3 = __ULLACCUM_MIN__ / __ULLACCUM_MAX__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/noassoc.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/noassoc.c
new file mode 100644
index 000000000..5d134e158
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/noassoc.c
@@ -0,0 +1,53 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+extern void abort (void);
+
+/* Make sure GCC knows there is no associativity for saturating types. */
+
+/* Don't transform to (temp + (0.5r + 0.8r)) */
+_Sat _Fract add_test (_Sat _Fract temp)
+{
+ return temp + 0.5r + 0.8r;
+}
+
+/* Don't transform to (temp * ((-0.5r - 0.5r) * (-0.5r - 0.5r))) */
+_Sat _Fract mul_test (_Sat _Fract temp)
+{
+ return temp * (-0.5r - 0.5r) * (-0.5r - 0.5r);
+}
+
+/* Don't transform to ((temp1 + temp2) * 0.5r) */
+_Sat _Fract mul_add_test (_Sat _Fract temp1, _Sat _Fract temp2)
+{
+ return temp1 * 0.5r + temp2 * 0.5r;
+}
+
+/* Don't transform to ((temp1 - temp2) * 0.5r) */
+_Sat _Fract mul_sub_test (_Sat _Fract temp1, _Sat _Fract temp2)
+{
+ return temp1 * 0.5r - temp2 * 0.5r;
+}
+
+int main ()
+{
+ _Sat _Fract a;
+
+ a = add_test (-0.5r);
+ if (a != 0.8r)
+ abort ();
+
+ a = mul_test (0.1r);
+ if (a != 0.1r)
+ abort ();
+
+ a = mul_add_test (0.75r, 0.5r);
+ if (a != 0.625r)
+ abort ();
+
+ a = mul_sub_test (0.75r, -0.5r);
+ if (a != 0.625r)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-bitwise.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-bitwise.c
new file mode 100644
index 000000000..6ba817dca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-bitwise.c
@@ -0,0 +1,167 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -ftrack-macro-expansion=0" } */
+
+/* C99 6.5.10: Bitwise AND operator.
+ C99 6.5.11: Bitwise exclusive OR operator.
+ C99 6.5.12: Bitwise inclusive OR operator.
+
+ Test that these operators do not accept fixed-point operands.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+#define OPERATE(OPRD1,OPRT,OPRD2) \
+do \
+{ \
+ OPRD1 OPRT OPRD2; \
+} while (0)
+
+
+
+#define BITWISE_OPERATOR(OPRT,OPRD) \
+do \
+{ \
+OPERATE(OPRD,OPRT,1); \
+OPERATE(OPRD,OPRT,0); \
+OPERATE(OPRD,OPRT,0x15); \
+OPERATE(0,OPRT,OPRD); \
+OPERATE(1,OPRT,OPRD); \
+OPERATE(0x15,OPRT,OPRD); \
+} while (0)
+
+void operator_notfor_fixed_point()
+{
+ short _Fract sf;
+ _Fract f;
+ long _Fract lf;
+ long long _Fract llf;
+ unsigned short _Fract usf;
+ unsigned _Fract uf;
+ unsigned long _Fract ulf;
+ unsigned long long _Fract ullf;
+ _Sat short _Fract Ssf;
+ _Sat _Fract Sf;
+ _Sat long _Fract Slf;
+ _Sat long long _Fract Sllf;
+ _Sat unsigned short _Fract Susf;
+ _Sat unsigned _Fract Suf;
+ _Sat unsigned long _Fract Sulf;
+ _Sat unsigned long long _Fract Sullf;
+ short _Accum sa;
+ _Accum a;
+ long _Accum la;
+ long long _Accum lla;
+ unsigned short _Accum usa;
+ unsigned _Accum ua;
+ unsigned long _Accum ula;
+ unsigned long long _Accum ulla;
+ _Sat short _Accum Ssa;
+ _Sat _Accum Sa;
+ _Sat long _Accum Sla;
+ _Sat long long _Accum Slla;
+ _Sat unsigned short _Accum Susa;
+ _Sat unsigned _Accum Sua;
+ _Sat unsigned long _Accum Sula;
+ _Sat unsigned long long _Accum Sulla;
+
+ /* C99 Section 6.5.{10,11,12} Bitwise operator. Constraints: Each of
+ the operands shall have integer type. Fixed-point type is rejected
+ by compiler when bitwise operation is performed. */
+
+ BITWISE_OPERATOR(&,sf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,sf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,sf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,f); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,f); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,f); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,lf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,lf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,lf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,llf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,llf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,llf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,usf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,usf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,usf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,uf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,uf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,uf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,ulf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,ulf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,ulf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,ullf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,ullf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,ullf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Ssf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Ssf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Ssf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Slf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Slf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Slf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sllf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sllf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sllf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Susf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Susf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Susf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Suf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Suf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Suf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sulf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sulf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sulf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sullf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sullf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sullf); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,sa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,sa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,sa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,a); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,a); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,a); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,la); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,la); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,la); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,lla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,lla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,lla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,usa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,usa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,usa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,ua); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,ua); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,ua); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,ula); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,ula); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,ula); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,ulla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,ulla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,ulla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Ssa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Ssa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Ssa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Slla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Slla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Slla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Susa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Susa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Susa); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sua); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sua); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sua); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sula); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sula); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sula); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(&,Sulla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(|,Sulla); /* { dg-error "invalid operands to binary" } */
+ BITWISE_OPERATOR(^,Sulla); /* { dg-error "invalid operands to binary" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-comma.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-comma.c
new file mode 100644
index 000000000..2f1316cfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-comma.c
@@ -0,0 +1,98 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.5.17: Comma operator.
+ Test with fixed-point operands.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+#define FUNC(TYPE,NAME,PF) \
+volatile TYPE NAME ## a, NAME ## b, NAME ## c; \
+void \
+init_ ## NAME () \
+{ \
+ NAME ## b = 0.2 ## PF; \
+ NAME ## c = 0.3 ## PF; \
+}
+
+FUNC (short _Fract, sf, hr)
+FUNC (_Fract, f, r)
+FUNC (long _Fract, lf, lr)
+FUNC (long long _Fract, llf, llr)
+FUNC (unsigned short _Fract, usf, uhr)
+FUNC (unsigned _Fract, uf, ur)
+FUNC (unsigned long _Fract, ulf, ulr)
+FUNC (long long _Fract, ullf, ullr)
+FUNC (_Sat short _Fract, Ssf, hr)
+FUNC (_Sat _Fract, Sf, r)
+FUNC (_Sat long _Fract, Slf, lr)
+FUNC (_Sat long long _Fract, Sllf, llr)
+FUNC (_Sat unsigned short _Fract, Susf, uhr)
+FUNC (_Sat unsigned _Fract, Suf, ur)
+FUNC (_Sat unsigned long _Fract, Sulf, ulr)
+FUNC (_Sat long long _Fract, Sullf, ullr)
+FUNC (short _Accum, sa, hk)
+FUNC (_Accum, a, k)
+FUNC (long _Accum, la, lk)
+FUNC (long long _Accum, lla, llk)
+FUNC (unsigned short _Accum, usa, uhk)
+FUNC (unsigned _Accum, ua, uk)
+FUNC (unsigned long _Accum, ula, ulk)
+FUNC (long long _Accum, ulla, ullk)
+FUNC (_Sat short _Accum, Ssa, hk)
+FUNC (_Sat _Accum, Sa, k)
+FUNC (_Sat long _Accum, Sla, lk)
+FUNC (_Sat long long _Accum, Slla, llk)
+FUNC (_Sat unsigned short _Accum, Susa, uhk)
+FUNC (_Sat unsigned _Accum, Sua, uk)
+FUNC (_Sat unsigned long _Accum, Sula, ulk)
+FUNC (_Sat long long _Accum, Sulla, ullk)
+
+int
+main ()
+{
+#define TEST(NAME) \
+ init_ ## NAME (); \
+ NAME ## a = (NAME ## b, NAME ## c); \
+ if (NAME ## a != NAME ## c) \
+ abort (); \
+ NAME ## a = (NAME ## c, 123, NAME ## b); \
+ if (NAME ## a != NAME ## b) \
+ abort ();
+
+ TEST(sf)
+ TEST(f)
+ TEST(lf)
+ TEST(llf)
+ TEST(usf)
+ TEST(uf)
+ TEST(ulf)
+ TEST(ullf)
+ TEST(Ssf)
+ TEST(Sf)
+ TEST(Slf)
+ TEST(Sllf)
+ TEST(Susf)
+ TEST(Suf)
+ TEST(Sulf)
+ TEST(Sullf)
+ TEST(sa)
+ TEST(a)
+ TEST(la)
+ TEST(lla)
+ TEST(usa)
+ TEST(ua)
+ TEST(ula)
+ TEST(ulla)
+ TEST(Ssa)
+ TEST(Sa)
+ TEST(Sla)
+ TEST(Slla)
+ TEST(Susa)
+ TEST(Sua)
+ TEST(Sula)
+ TEST(Sulla)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-cond.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-cond.c
new file mode 100644
index 000000000..94b0de0a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-cond.c
@@ -0,0 +1,101 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O0" } */
+
+/* C99 6.5.15 Conditional operator.
+ Test with fixed-point operands.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+volatile int yes, no;
+
+#define FUNC(TYPE,NAME,PF) \
+volatile TYPE NAME ## a, NAME ## b, NAME ## c; \
+void \
+init_ ## NAME () \
+{ \
+ NAME ## b = 0.2 ## PF; \
+ NAME ## c = 0.3 ## PF; \
+ yes = 1; \
+ no = 0; \
+}
+
+FUNC (short _Fract, sf, hr)
+FUNC (_Fract, f, r)
+FUNC (long _Fract, lf, lr)
+FUNC (long long _Fract, llf, llr)
+FUNC (unsigned short _Fract, usf, uhr)
+FUNC (unsigned _Fract, uf, ur)
+FUNC (unsigned long _Fract, ulf, ulr)
+FUNC (long long _Fract, ullf, ullr)
+FUNC (_Sat short _Fract, Ssf, hr)
+FUNC (_Sat _Fract, Sf, r)
+FUNC (_Sat long _Fract, Slf, lr)
+FUNC (_Sat long long _Fract, Sllf, llr)
+FUNC (_Sat unsigned short _Fract, Susf, uhr)
+FUNC (_Sat unsigned _Fract, Suf, ur)
+FUNC (_Sat unsigned long _Fract, Sulf, ulr)
+FUNC (_Sat long long _Fract, Sullf, ullr)
+FUNC (short _Accum, sa, hk)
+FUNC (_Accum, a, k)
+FUNC (long _Accum, la, lk)
+FUNC (long long _Accum, lla, llk)
+FUNC (unsigned short _Accum, usa, uhk)
+FUNC (unsigned _Accum, ua, uk)
+FUNC (unsigned long _Accum, ula, ulk)
+FUNC (long long _Accum, ulla, ullk)
+FUNC (_Sat short _Accum, Ssa, hk)
+FUNC (_Sat _Accum, Sa, k)
+FUNC (_Sat long _Accum, Sla, lk)
+FUNC (_Sat long long _Accum, Slla, llk)
+FUNC (_Sat unsigned short _Accum, Susa, uhk)
+FUNC (_Sat unsigned _Accum, Sua, uk)
+FUNC (_Sat unsigned long _Accum, Sula, ulk)
+FUNC (_Sat long long _Accum, Sulla, ullk)
+
+int
+main ()
+{
+#define TEST(NAME) \
+ init_ ## NAME (); \
+ NAME ## a = yes ? NAME ## b : NAME ## c; \
+ if (NAME ## a != NAME ## b) \
+ abort (); \
+ NAME ## a = no ? NAME ## b : NAME ## c; \
+ if (NAME ## a != NAME ## c) \
+ abort ();
+
+ TEST(sf)
+ TEST(f)
+ TEST(lf)
+ TEST(llf)
+ TEST(usf)
+ TEST(uf)
+ TEST(ulf)
+ TEST(ullf)
+ TEST(Ssf)
+ TEST(Sf)
+ TEST(Slf)
+ TEST(Sllf)
+ TEST(Susf)
+ TEST(Suf)
+ TEST(Sulf)
+ TEST(Sullf)
+ TEST(sa)
+ TEST(a)
+ TEST(la)
+ TEST(lla)
+ TEST(usa)
+ TEST(ua)
+ TEST(ula)
+ TEST(ulla)
+ TEST(Ssa)
+ TEST(Sa)
+ TEST(Sla)
+ TEST(Slla)
+ TEST(Susa)
+ TEST(Sua)
+ TEST(Sula)
+ TEST(Sulla)
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-logical.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-logical.c
new file mode 100644
index 000000000..3873b2588
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-logical.c
@@ -0,0 +1,115 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 Logical AND operator.
+ C99 Logical OR operator.
+ Test with fixed-point operands.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+#define OPERATE(OPRD1,OPRT,OPRD2,RLT) \
+do \
+{ \
+ if (( (OPRD1) OPRT (OPRD2) )!= RLT) \
+ abort (); \
+} while (0)
+
+#define FIXED_POINT_LOGICAL(OPRD) \
+do \
+{ \
+ OPRD = 0.1; \
+ OPERATE(1,||,OPRD,1); \
+ OPERATE(0,||,OPRD,1); \
+ OPERATE(OPRD,||,1,1); \
+ OPERATE(OPRD,||,0,1); \
+ OPRD = 0; \
+ OPERATE(1,||,OPRD,1); \
+ OPERATE(0,||,OPRD,0); \
+ OPERATE(OPRD,||,1,1); \
+ OPERATE(OPRD,||,0,0); \
+ OPRD = 0.1; \
+ OPERATE(1,&&,OPRD,1); \
+ OPERATE(0,&&,OPRD,0); \
+ OPERATE(OPRD,&&,1,1); \
+ OPERATE(OPRD,&&,0,0); \
+ OPRD = 0; \
+ OPERATE(1,&&,OPRD,0); \
+ OPERATE(0,&&,OPRD,0); \
+ OPERATE(OPRD,&&,1,0); \
+ OPERATE(OPRD,&&,0,0); \
+} while (0)
+
+int
+main ()
+{
+ short _Fract sf;
+ _Fract f;
+ long _Fract lf;
+ long long _Fract llf;
+ unsigned short _Fract usf;
+ unsigned _Fract uf;
+ unsigned long _Fract ulf;
+ unsigned long long _Fract ullf;
+ _Sat short _Fract Ssf;
+ _Sat _Fract Sf;
+ _Sat long _Fract Slf;
+ _Sat long long _Fract Sllf;
+ _Sat unsigned short _Fract Susf;
+ _Sat unsigned _Fract Suf;
+ _Sat unsigned long _Fract Sulf;
+ _Sat unsigned long long _Fract Sullf;
+ short _Accum sa;
+ _Accum a;
+ long _Accum la;
+ long long _Accum lla;
+ unsigned short _Accum usa;
+ unsigned _Accum ua;
+ unsigned long _Accum ula;
+ unsigned long long _Accum ulla;
+ _Sat short _Accum Ssa;
+ _Sat _Accum Sa;
+ _Sat long _Accum Sla;
+ _Sat long long _Accum Slla;
+ _Sat unsigned short _Accum Susa;
+ _Sat unsigned _Accum Sua;
+ _Sat unsigned long _Accum Sula;
+ _Sat unsigned long long _Accum Sulla;
+
+ /* C99 Section 6.5.{13,14} Logical operator. Constraints Each of the
+ operands shall have scalar type. Fixed-point types would obey this. */
+ FIXED_POINT_LOGICAL (sf);
+ FIXED_POINT_LOGICAL (f);
+ FIXED_POINT_LOGICAL (lf);
+ FIXED_POINT_LOGICAL (llf);
+ FIXED_POINT_LOGICAL (usf);
+ FIXED_POINT_LOGICAL (uf);
+ FIXED_POINT_LOGICAL (ulf);
+ FIXED_POINT_LOGICAL (ullf);
+ FIXED_POINT_LOGICAL (Ssf);
+ FIXED_POINT_LOGICAL (Sf);
+ FIXED_POINT_LOGICAL (Slf);
+ FIXED_POINT_LOGICAL (Sllf);
+ FIXED_POINT_LOGICAL (Susf);
+ FIXED_POINT_LOGICAL (Suf);
+ FIXED_POINT_LOGICAL (Sulf);
+ FIXED_POINT_LOGICAL (Sullf);
+ FIXED_POINT_LOGICAL (sa);
+ FIXED_POINT_LOGICAL (a);
+ FIXED_POINT_LOGICAL (la);
+ FIXED_POINT_LOGICAL (lla);
+ FIXED_POINT_LOGICAL (usa);
+ FIXED_POINT_LOGICAL (ua);
+ FIXED_POINT_LOGICAL (ula);
+ FIXED_POINT_LOGICAL (ulla);
+ FIXED_POINT_LOGICAL (Ssa);
+ FIXED_POINT_LOGICAL (Sa);
+ FIXED_POINT_LOGICAL (Sla);
+ FIXED_POINT_LOGICAL (Slla);
+ FIXED_POINT_LOGICAL (Susa);
+ FIXED_POINT_LOGICAL (Sua);
+ FIXED_POINT_LOGICAL (Sula);
+ FIXED_POINT_LOGICAL (Sulla);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-unary.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-unary.c
new file mode 100644
index 000000000..5ad420b02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/operator-unary.c
@@ -0,0 +1,58 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.3 Unary operators & and *.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+#define UNARY_OPERATOR(TYPE,SUFFIX) \
+do \
+{ \
+ TYPE unary_d = 0.1 ## SUFFIX; \
+ TYPE* unary_dp; \
+ /* & operator. */ \
+ unary_dp = &(unary_d); \
+ /* * operator. */ \
+ unary_d = *(unary_dp); \
+} while (0)
+
+int
+main ()
+{
+ /* C99 6.5.3 Unary operators. */
+ UNARY_OPERATOR(short _Fract, hr);
+ UNARY_OPERATOR(_Fract, r);
+ UNARY_OPERATOR(long _Fract, lr);
+ UNARY_OPERATOR(long long _Fract, llr);
+ UNARY_OPERATOR(unsigned short _Fract, uhr);
+ UNARY_OPERATOR(unsigned _Fract, ur);
+ UNARY_OPERATOR(unsigned long _Fract, ulr);
+ UNARY_OPERATOR(unsigned long long _Fract, ullr);
+ UNARY_OPERATOR(_Sat short _Fract, hr);
+ UNARY_OPERATOR(_Sat _Fract, r);
+ UNARY_OPERATOR(_Sat long _Fract, lr);
+ UNARY_OPERATOR(_Sat long long _Fract, llr);
+ UNARY_OPERATOR(_Sat unsigned short _Fract, uhr);
+ UNARY_OPERATOR(_Sat unsigned _Fract, ur);
+ UNARY_OPERATOR(_Sat unsigned long _Fract, ulr);
+ UNARY_OPERATOR(_Sat unsigned long long _Fract, ullr);
+ UNARY_OPERATOR(short _Accum, hk);
+ UNARY_OPERATOR(_Accum, k);
+ UNARY_OPERATOR(long _Accum, lk);
+ UNARY_OPERATOR(long long _Accum, llk);
+ UNARY_OPERATOR(unsigned short _Accum, uhk);
+ UNARY_OPERATOR(unsigned _Accum, uk);
+ UNARY_OPERATOR(unsigned long _Accum, ulk);
+ UNARY_OPERATOR(unsigned long long _Accum, ullk);
+ UNARY_OPERATOR(_Sat short _Accum, hk);
+ UNARY_OPERATOR(_Sat _Accum, k);
+ UNARY_OPERATOR(_Sat long _Accum, lk);
+ UNARY_OPERATOR(_Sat long long _Accum, llk);
+ UNARY_OPERATOR(_Sat unsigned short _Accum, uhk);
+ UNARY_OPERATOR(_Sat unsigned _Accum, uk);
+ UNARY_OPERATOR(_Sat unsigned long _Accum, ulk);
+ UNARY_OPERATOR(_Sat unsigned long long _Accum, ullk);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/pr33466.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/pr33466.c
new file mode 100644
index 000000000..196db310b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/pr33466.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* The suffix for a fixed-point constant must use a specific order
+ for the pieces, and a long long length specifier must use the
+ same case (ll or LL).
+
+ These are invalid for all targets, not just those that support
+ fixed-point types. */
+
+long double lLr = 0.5lLr; /* { dg-error "invalid suffix" } */
+long double lLR = 0.5lLR; /* { dg-error "invalid suffix" } */
+long double Llr = 0.5Llr; /* { dg-error "invalid suffix" } */
+long double LlR = 0.5LlR; /* { dg-error "invalid suffix" } */
+long double ulLr = 0.5ulLr; /* { dg-error "invalid suffix" } */
+long double ulLR = 0.5ulLR; /* { dg-error "invalid suffix" } */
+long double uLlr = 0.5uLlr; /* { dg-error "invalid suffix" } */
+long double uLlR = 0.5uLlR; /* { dg-error "invalid suffix" } */
+long double UlLr = 0.5UlLr; /* { dg-error "invalid suffix" } */
+long double UlLR = 0.5UlLR; /* { dg-error "invalid suffix" } */
+long double ULlr = 0.5ULlr; /* { dg-error "invalid suffix" } */
+long double ULlR = 0.5ULlR; /* { dg-error "invalid suffix" } */
+long double lLk = 0.5lLk; /* { dg-error "invalid suffix" } */
+long double lLK = 0.5lLK; /* { dg-error "invalid suffix" } */
+long double Llk = 0.5Llk; /* { dg-error "invalid suffix" } */
+long double LlK = 0.5LlK; /* { dg-error "invalid suffix" } */
+long double ulLk = 0.5ulLk; /* { dg-error "invalid suffix" } */
+long double ulLK = 0.5ulLK; /* { dg-error "invalid suffix" } */
+long double uLlk = 0.5uLlk; /* { dg-error "invalid suffix" } */
+long double uLlK = 0.5uLlK; /* { dg-error "invalid suffix" } */
+long double UlLk = 0.5UlLk; /* { dg-error "invalid suffix" } */
+long double UlLK = 0.5UlLK; /* { dg-error "invalid suffix" } */
+long double ULlk = 0.5ULlk; /* { dg-error "invalid suffix" } */
+long double ULlK = 0.5ULlK; /* { dg-error "invalid suffix" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/struct-layout-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/struct-layout-1.c
new file mode 100644
index 000000000..b9a02f0c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/struct-layout-1.c
@@ -0,0 +1,77 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* This test is based on the test from ../dfp/. */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+struct S1
+{
+ long _Fract a[0];
+};
+
+struct S2
+{
+ struct
+ {
+ long _Fract e;
+ } b[0];
+};
+
+struct S3
+{
+ union
+ {
+ long _Fract c;
+ } a[0];
+};
+
+struct S4
+{
+ int a[0];
+ long _Fract b[0];
+};
+
+struct S5
+{
+ union
+ {
+ long _Fract c[0];
+ } a;
+};
+
+int check_var (int z, ...)
+{
+ long long result;
+ va_list ap;
+ va_start (ap, z);
+ va_arg (ap, struct S1);
+ result = va_arg (ap, long long);
+ va_end (ap);
+
+ return (result == 2LL);
+}
+
+int main ()
+{
+ struct S1 s1;
+ struct S2 s2;
+ struct S3 s3;
+ struct S4 s4;
+ struct S5 s5;
+
+ if (check_var (2, s1, 2LL) == 0)
+ abort ();
+ if (check_var (2, s2, 2LL) == 0)
+ abort ();
+ if (check_var (2, s3, 2LL) == 0)
+ abort ();
+ if (check_var (2, s4, 2LL) == 0)
+ abort ();
+ if (check_var (2, s5, 2LL) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/struct-union.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/struct-union.c
new file mode 100644
index 000000000..93ed260b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/struct-union.c
@@ -0,0 +1,63 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+/* C99 6.5.2.3 Structure and union members.
+ If the first expression has qualified type, the result has the so-qualified
+ version of the type of the designated member.
+ Based on the test from ../dfp/. */
+
+struct s {_Fract f; const long _Fract lf;};
+struct sv { volatile _Fract f; volatile long _Fract lf; };
+union u
+{
+ const long _Fract lf;
+ _Fract f;
+ const struct s cs;
+};
+
+struct s s;
+struct sv sv;
+const struct s cs;
+
+union u u;
+const union u cu;
+
+struct s g (struct s s)
+{
+ return s;
+}
+
+union u h (union u u)
+{
+ return u;
+}
+
+void f()
+{
+ cs.f = 0.1r; /* { dg-error "assignment of member 'f' in read-only object" } */
+ cs.lf = 0.2lr; /* { dg-error "assignment of member 'lf' in read-only object" } */
+ s.lf = 0.3lr; /* { dg-error "assignment of read-only member" } */
+
+ s.f = 0.4r;
+ u.f = 0.5r;
+
+ u.lf = 0.6lr; /* { dg-error "assignment of read-only member" } */
+ u.cs.f = 0.7r; /* { dg-error "assignment of member 'f' in read-only object" } */
+ u.cs.lf = 0.8lr; /* { dg-error "assignment of member 'lf' in read-only object" } */
+
+ cu.f = 0.9r; /* { dg-error "assignment of member 'f' in read-only object" } */
+
+ cu.lf = 0.01lr; /* { dg-error "assignment of member 'lf' in read-only object" } */
+ cu.cs.f = 0.02r; /* { dg-error "assignment of member 'f' in read-only object" } */
+ cu.cs.lf = 0.03lr; /* { dg-error "assignment of member 'lf' in read-only object" } */
+
+ /* f().x is a valid postfix expression but is not an lvalue if
+ function f() returning a structure or union. */
+ g(s).f = 0.04r; /* { dg-error "lvalue required" } */
+ h(u).lf = 0.05lr; /* { dg-error "lvalue required" } */
+
+ /* Test assignment to volatile structure members. */
+ sv.f = 0.06r;
+ sv.lf = 0.07lr;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/types.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/types.c
new file mode 100644
index 000000000..011345cf3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/types.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* N1169 6.3.1.3a - Fixed-point types (NEW CLAUSE).
+
+ Check if all types are ok. */
+
+short _Fract q0;
+_Fract q1;
+long _Fract q2;
+long long _Fract q3;
+unsigned short _Fract q4;
+unsigned _Fract q5;
+unsigned long _Fract q6;
+unsigned long long _Fract q7;
+_Sat short _Fract sq0;
+_Sat _Fract sq1;
+_Sat long _Fract sq2;
+_Sat long long _Fract sq3;
+_Sat unsigned short _Fract sq4;
+_Sat unsigned _Fract sq5;
+_Sat unsigned long _Fract sq6;
+_Sat unsigned long long _Fract sq7;
+
+short _Accum a0;
+_Accum a1;
+long _Accum a2;
+long long _Accum a3;
+unsigned short _Accum a4;
+unsigned _Accum a5;
+unsigned long _Accum a6;
+unsigned long long _Accum a7;
+_Sat short _Accum sa0;
+_Sat _Accum sa1;
+_Sat long _Accum sa2;
+_Sat long long _Accum sa3;
+_Sat unsigned short _Accum sa4;
+_Sat unsigned _Accum sa5;
+_Sat unsigned long _Accum sa6;
+_Sat unsigned long long _Accum sa7;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/typespec.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/typespec.c
new file mode 100644
index 000000000..9eaa29f84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/typespec.c
@@ -0,0 +1,303 @@
+/* Test for valid and invalid combinations of type specifiers.
+ Based off gcc.dg/test-spec-1.c */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+typedef char type;
+
+void _Fract *x0; /* { dg-error "" "void _Fract" } */
+char _Fract *x3; /* { dg-error "" "char _Fract" } */
+short _Fract *x6;
+int _Fract *x9; /* { dg-error "" "int _Fract" } */
+long _Fract *x12;
+float _Fract *x15; /* { dg-error "" "float _Fract" } */
+double _Fract *x18; /* { dg-error "" "double _Fract" } */
+signed _Fract *x21;
+_Bool _Fract *x24; /* { dg-error "" "_Bool _Fract" } */
+int _Fract *x27; /* { dg-error "" "int _Fract" } */
+type _Fract *x30; /* { dg-error "" "type _Fract" } */
+char signed _Fract *x33; /* { dg-error "" "char signed _Fract" } */
+char unsigned _Fract *x36; /* { dg-error "" "char unsigned _Fract" } */
+short _Fract *x39;
+short signed _Fract *x42;
+short unsigned _Fract *x45;
+_Fract short*x48;
+_Fract short signed*x51;
+_Fract short unsigned*x54;
+_Fract long*x57;
+_Fract long signed*x60;
+_Fract long unsigned*x63;
+_Fract signed long*x66;
+_Fract signed short*x69;
+int signed _Fract *x72; /* { dg-error "" "int signed _Fract" } */
+int unsigned _Fract *x75; /* { dg-error "" "int unsigned _Fract" } */
+long int _Fract *x78; /* { dg-error "" "long int _Fract" } */
+long long _Fract *x81;
+long double _Fract *x84; /* { dg-error "" "long double _Fract" } */
+long signed _Fract *x87;
+long unsigned _Fract *x90;
+double long _Fract *x93; /* { dg-error "" "double long _Fract" } */
+signed char _Fract *x96; /* { dg-error "" "signed char _Fract" } */
+signed short _Fract *x99;
+signed int _Fract *x102; /* { dg-error "" "signed int _Fract" } */
+signed long _Fract *x105;
+unsigned char _Fract *x108; /* { dg-error "" "unsigned char _Fract" } */
+unsigned short _Fract *x111;
+unsigned int _Fract *x114; /* { dg-error "" "unsigned int _Fract" } */
+unsigned long _Fract *x117;
+short int signed _Fract *x120; /* { dg-error "" "short int signed _Fract" } */
+short int unsigned _Fract *x123; /* { dg-error "" "short int unsigned _Fract" } */
+short signed int _Fract *x126; /* { dg-error "" "short signed int _Fract" } */
+short unsigned int _Fract *x129; /* { dg-error "" "short unsigned int _Fract" } */
+int short signed _Fract *x132; /* { dg-error "" "int short signed _Fract" } */
+int short unsigned _Fract *x135; /* { dg-error "" "int short unsigned _Fract" } */
+int long long _Fract *x138; /* { dg-error "" "int long long _Fract" } */
+int long signed _Fract *x141; /* { dg-error "" "int long signed _Fract" } */
+int long unsigned _Fract *x144; /* { dg-error "" "int long unsigned _Fract" } */
+int signed short _Fract *x147; /* { dg-error "" "int signed short _Fract" } */
+int signed long _Fract *x150; /* { dg-error "" "int signed long _Fract" } */
+int unsigned short _Fract *x153; /* { dg-error "" "int unsigned short _Fract" } */
+int unsigned long _Fract *x156; /* { dg-error "" "int unsigned long _Fract" } */
+long int long _Fract *x159; /* { dg-error "" "long int long _Fract" } */
+long int signed _Fract *x162; /* { dg-error "" "long int signed _Fract" } */
+long int unsigned _Fract *x165; /* { dg-error "" "long int unsigned _Fract" } */
+long long int _Fract *x168; /* { dg-error "" "long long int _Fract" } */
+long long signed _Fract *x171;
+long long unsigned _Fract *x175;
+long signed int _Fract *x178; /* { dg-error "" "long signed int _Fract" } */
+long unsigned int _Fract *x181; /* { dg-error "" "long unsigned int _Fract" } */
+long unsigned long _Fract *x184;
+signed short int _Fract *x187; /* { dg-error "" "signed short int _Fract" } */
+signed int short _Fract *x190; /* { dg-error "" "signed int short _Fract" } */
+signed int long _Fract *x192; /* { dg-error "" "signed int long _Fract" } */
+signed long int _Fract *x195; /* { dg-error "" "signed long int _Fract" } */
+signed long long _Fract *x198;
+unsigned short int _Fract *x201; /* { dg-error "" "unsigned short int _Fract" } */
+unsigned int short _Fract *x204; /* { dg-error "" "unsigned int short _Fract" } */
+unsigned int long _Fract *x207; /* { dg-error "" "unsigned int long _Fract" } */
+unsigned long int _Fract *x210; /* { dg-error "" "unsigned long int _Fract" } */
+unsigned long long _Fract *x213;
+int long long signed _Fract *x216; /* { dg-error "" "int long long signed _Fract" } */
+int long long unsigned _Fract *x219; /* { dg-error "" "int long long unsigned _Fract" } */
+int long signed long _Fract *x222; /* { dg-error "" "int long signed long _Fract" } */
+int long unsigned long _Fract *x226; /* { dg-error "" "int long unsigned long _Fract" } */
+int signed long long _Fract *x229; /* { dg-error "" "int signed long long _Fract" } */
+int unsigned long long _Fract *x232; /* { dg-error "" "int unsigned long long _Fract" } */
+long int long signed _Fract *x235; /* { dg-error "" "long int long signed _Fract" } */
+long int long unsigned _Fract *x238; /* { dg-error "" "long int long unsigned _Fract" } */
+long int signed long _Fract *x241; /* { dg-error "" "long int signed long _Fract" } */
+long int unsigned long _Fract *x244; /* { dg-error "" "long int unsigned long _Fract" } */
+long long int signed _Fract *x247; /* { dg-error "" "long long int signed _Fract" } */
+long long int unsigned _Fract *x250; /* { dg-error "" "long long int unsigned _Fract" } */
+long long signed int _Fract *x253; /* { dg-error "" "long long signed int _Fract" } */
+long long unsigned int _Fract *x256; /* { dg-error "" "long long unsigned int _Fract" } */
+long signed int long _Fract *x259; /* { dg-error "" "long signed int long _Fract" } */
+long signed long int _Fract *x262; /* { dg-error "" "long signed long int _Fract" } */
+long unsigned int long _Fract *x265; /* { dg-error "" "long unsigned int long _Fract" } */
+long unsigned long int _Fract *x268; /* { dg-error "" "long unsigned long int _Fract" } */
+signed long long int _Fract *x271; /* { dg-error "" "signed long long int _Fract" } */
+unsigned int long long _Fract *x274; /* { dg-error "" "unsigned int long long _Fract" } */
+unsigned long int long _Fract *x277; /* { dg-error "" "unsigned long int long _Fract" } */
+unsigned long long int _Fract *x280; /* { dg-error "" "unsigned long long int _Fract" } */
+_Complex _Fract *x283; /* { dg-error "" "_Complex _Fract" } */
+_Fract _Complex *x286; /* { dg-error "" "_Fract _Complex" } */
+unsigned _Fract *x289;
+signed _Fract *x292;
+
+void _Accum *k0; /* { dg-error "" "void _Accum" } */
+char _Accum *k3; /* { dg-error "" "char _Accum" } */
+short _Accum *k6;
+int _Accum *k9; /* { dg-error "" "int _Accum" } */
+long _Accum *k12;
+float _Accum *k15; /* { dg-error "" "float _Accum" } */
+double _Accum *k18; /* { dg-error "" "double _Accum" } */
+signed _Accum *k21;
+_Bool _Accum *k24; /* { dg-error "" "_Bool _Accum" } */
+int _Accum *k27; /* { dg-error "" "int _Accum" } */
+type _Accum *k30; /* { dg-error "" "type _Accum" } */
+char signed _Accum *k33; /* { dg-error "" "char signed _Accum" } */
+char unsigned _Accum *k36; /* { dg-error "" "char unsigned _Accum" } */
+short _Accum *k39;
+short signed _Accum *k42;
+short unsigned _Accum *k45;
+_Accum short*k48;
+_Accum short signed*k51;
+_Accum short unsigned*k54;
+_Accum long*k57;
+_Accum long signed*k60;
+_Accum long unsigned*k63;
+_Accum signed long*k66;
+_Accum signed short*k69;
+int signed _Accum *k72; /* { dg-error "" "int signed _Accum" } */
+int unsigned _Accum *k75; /* { dg-error "" "int unsigned _Accum" } */
+long int _Accum *k78; /* { dg-error "" "long int _Accum" } */
+long long _Accum *k81;
+long double _Accum *k84; /* { dg-error "" "long double _Accum" } */
+long signed _Accum *k87;
+long unsigned _Accum *k90;
+double long _Accum *k93; /* { dg-error "" "double long _Accum" } */
+signed char _Accum *k96; /* { dg-error "" "signed char _Accum" } */
+signed short _Accum *k99;
+signed int _Accum *k102; /* { dg-error "" "signed int _Accum" } */
+signed long _Accum *k105;
+unsigned char _Accum *k108; /* { dg-error "" "unsigned char _Accum" } */
+unsigned short _Accum *k111;
+unsigned int _Accum *k114; /* { dg-error "" "unsigned int _Accum" } */
+unsigned long _Accum *k117;
+short int signed _Accum *k120; /* { dg-error "" "short int signed _Accum" } */
+short int unsigned _Accum *k123; /* { dg-error "" "short int unsigned _Accum" } */
+short signed int _Accum *k126; /* { dg-error "" "short signed int _Accum" } */
+short unsigned int _Accum *k129; /* { dg-error "" "short unsigned int _Accum" } */
+int short signed _Accum *k132; /* { dg-error "" "int short signed _Accum" } */
+int short unsigned _Accum *k135; /* { dg-error "" "int short unsigned _Accum" } */
+int long long _Accum *k138; /* { dg-error "" "int long long _Accum" } */
+int long signed _Accum *k141; /* { dg-error "" "int long signed _Accum" } */
+int long unsigned _Accum *k144; /* { dg-error "" "int long unsigned _Accum" } */
+int signed short _Accum *k147; /* { dg-error "" "int signed short _Accum" } */
+int signed long _Accum *k150; /* { dg-error "" "int signed long _Accum" } */
+int unsigned short _Accum *k153; /* { dg-error "" "int unsigned short _Accum" } */
+int unsigned long _Accum *k156; /* { dg-error "" "int unsigned long _Accum" } */
+long int long _Accum *k159; /* { dg-error "" "long int long _Accum" } */
+long int signed _Accum *k162; /* { dg-error "" "long int signed _Accum" } */
+long int unsigned _Accum *k165; /* { dg-error "" "long int unsigned _Accum" } */
+long long int _Accum *k168; /* { dg-error "" "long long int _Accum" } */
+long long signed _Accum *k171;
+long long unsigned _Accum *k175;
+long signed int _Accum *k178; /* { dg-error "" "long signed int _Accum" } */
+long unsigned int _Accum *k181; /* { dg-error "" "long unsigned int _Accum" } */
+long unsigned long _Accum *k184;
+signed short int _Accum *k187; /* { dg-error "" "signed short int _Accum" } */
+signed int short _Accum *k190; /* { dg-error "" "signed int short _Accum" } */
+signed int long _Accum *k192; /* { dg-error "" "signed int long _Accum" } */
+signed long int _Accum *k195; /* { dg-error "" "signed long int _Accum" } */
+signed long long _Accum *k198;
+unsigned short int _Accum *k201; /* { dg-error "" "unsigned short int _Accum" } */
+unsigned int short _Accum *k204; /* { dg-error "" "unsigned int short _Accum" } */
+unsigned int long _Accum *k207; /* { dg-error "" "unsigned int long _Accum" } */
+unsigned long int _Accum *k210; /* { dg-error "" "unsigned long int _Accum" } */
+unsigned long long _Accum *k213;
+int long long signed _Accum *k216; /* { dg-error "" "int long long signed _Accum" } */
+int long long unsigned _Accum *k219; /* { dg-error "" "int long long unsigned _Accum" } */
+int long signed long _Accum *k222; /* { dg-error "" "int long signed long _Accum" } */
+int long unsigned long _Accum *k226; /* { dg-error "" "int long unsigned long _Accum" } */
+int signed long long _Accum *k229; /* { dg-error "" "int signed long long _Accum" } */
+int unsigned long long _Accum *k232; /* { dg-error "" "int unsigned long long _Accum" } */
+long int long signed _Accum *k235; /* { dg-error "" "long int long signed _Accum" } */
+long int long unsigned _Accum *k238; /* { dg-error "" "long int long unsigned _Accum" } */
+long int signed long _Accum *k241; /* { dg-error "" "long int signed long _Accum" } */
+long int unsigned long _Accum *k244; /* { dg-error "" "long int unsigned long _Accum" } */
+long long int signed _Accum *k247; /* { dg-error "" "long long int signed _Accum" } */
+long long int unsigned _Accum *k250; /* { dg-error "" "long long int unsigned _Accum" } */
+long long signed int _Accum *k253; /* { dg-error "" "long long signed int _Accum" } */
+long long unsigned int _Accum *k256; /* { dg-error "" "long long unsigned int _Accum" } */
+long signed int long _Accum *k259; /* { dg-error "" "long signed int long _Accum" } */
+long signed long int _Accum *k262; /* { dg-error "" "long signed long int _Accum" } */
+long unsigned int long _Accum *k265; /* { dg-error "" "long unsigned int long _Accum" } */
+long unsigned long int _Accum *k268; /* { dg-error "" "long unsigned long int _Accum" } */
+signed long long int _Accum *k271; /* { dg-error "" "signed long long int _Accum" } */
+unsigned int long long _Accum *k274; /* { dg-error "" "unsigned int long long _Accum" } */
+unsigned long int long _Accum *k277; /* { dg-error "" "unsigned long int long _Accum" } */
+unsigned long long int _Accum *k280; /* { dg-error "" "unsigned long long int _Accum" } */
+_Complex _Accum *k283; /* { dg-error "" "_Complex _Accum" } */
+_Accum _Complex *k286; /* { dg-error "" "_Accum _Complex" } */
+unsigned _Accum *k289;
+signed _Accum *k292;
+
+void _Sat *s0; /* { dg-error "" "void _Sat" } */
+char _Sat *s3; /* { dg-error "" "char _Sat" } */
+short _Sat *s6; /* { dg-error "" "short _Sat" } */
+int _Sat *s9; /* { dg-error "" "int _Sat" } */
+long _Sat *s12; /* { dg-error "" "long _Sat" } */
+float _Sat *s15; /* { dg-error "" "float _Sat" } */
+double _Sat *s18; /* { dg-error "" "double _Sat" } */
+signed _Sat *s21; /* { dg-error "" "signed _Sat" } */
+_Bool _Sat *s24; /* { dg-error "" "_Bool _Sat" } */
+int _Sat *s27; /* { dg-error "" "int _Sat" } */
+type _Sat *s30; /* { dg-error "" "type _Sat" } */
+char signed _Sat *s33; /* { dg-error "" "char signed _Sat" } */
+char unsigned _Sat *s36; /* { dg-error "" "char unsigned _Sat" } */
+short _Sat *s39; /* { dg-error "" "short _Sat" } */
+short signed _Sat *s42; /* { dg-error "" "short signed _Sat" } */
+short unsigned _Sat *s45; /* { dg-error "" "short unsigned _Sat" } */
+_Sat short*s48; /* { dg-error "" "_Sat short" } */
+_Sat short signed*s51; /* { dg-error "" "_Sat short signed" } */
+_Sat short unsigned*s54; /* { dg-error "" "_Sat short unsigned" } */
+_Sat long*s57; /* { dg-error "" "_Sat long" } */
+_Sat long signed*s60; /* { dg-error "" "_Sat long signed" } */
+_Sat long unsigned*s63; /* { dg-error "" "_Sat long unsigned" } */
+_Sat signed long*s66; /* { dg-error "" "_Sat signed long" } */
+_Sat signed short*s69; /* { dg-error "" "_Sat signed short" } */
+int signed _Sat *s72; /* { dg-error "" "int signed _Sat" } */
+int unsigned _Sat *s75; /* { dg-error "" "int unsigned _Sat" } */
+long int _Sat *s78; /* { dg-error "" "long int _Sat" } */
+long long _Sat *s81; /* { dg-error "" "long long _Sat" } */
+long double _Sat *s84; /* { dg-error "" "long double _Sat" } */
+long signed _Sat *s87; /* { dg-error "" "long signed _Sat" } */
+long unsigned _Sat *s90; /* { dg-error "" "long unsigned _Sat" } */
+double long _Sat *s93; /* { dg-error "" "double long _Sat" } */
+signed char _Sat *s96; /* { dg-error "" "signed char _Sat" } */
+signed short _Sat *s99; /* { dg-error "" "signed short _Sat" } */
+signed int _Sat *s102; /* { dg-error "" "signed int _Sat" } */
+signed long _Sat *s105; /* { dg-error "" "signed long _Sat" } */
+unsigned char _Sat *s108; /* { dg-error "" "unsigned char _Sat" } */
+unsigned short _Sat *s111; /* { dg-error "" "unsigned short _Sat" } */
+unsigned int _Sat *s114; /* { dg-error "" "unsigned int _Sat" } */
+unsigned long _Sat *s117; /* { dg-error "" "unsigned long _Sat" } */
+short int signed _Sat *s120; /* { dg-error "" "short int signed _Sat" } */
+short int unsigned _Sat *s123; /* { dg-error "" "short int unsigned _Sat" } */
+short signed int _Sat *s126; /* { dg-error "" "short signed int _Sat" } */
+short unsigned int _Sat *s129; /* { dg-error "" "short unsigned int _Sat" } */
+int short signed _Sat *s132; /* { dg-error "" "int short signed _Sat" } */
+int short unsigned _Sat *s135; /* { dg-error "" "int short unsigned _Sat" } */
+int long long _Sat *s138; /* { dg-error "" "int long long _Sat" } */
+int long signed _Sat *s141; /* { dg-error "" "int long signed _Sat" } */
+int long unsigned _Sat *s144; /* { dg-error "" "int long unsigned _Sat" } */
+int signed short _Sat *s147; /* { dg-error "" "int signed short _Sat" } */
+int signed long _Sat *s150; /* { dg-error "" "int signed long _Sat" } */
+int unsigned short _Sat *s153; /* { dg-error "" "int unsigned short _Sat" } */
+int unsigned long _Sat *s156; /* { dg-error "" "int unsigned long _Sat" } */
+long int long _Sat *s159; /* { dg-error "" "long int long _Sat" } */
+long int signed _Sat *s162; /* { dg-error "" "long int signed _Sat" } */
+long int unsigned _Sat *s165; /* { dg-error "" "long int unsigned _Sat" } */
+long long int _Sat *s168; /* { dg-error "" "long long int _Sat" } */
+long long signed _Sat *s171; /* { dg-error "" "long long signed _Sat" } */
+long long unsigned _Sat *s175; /* { dg-error "" "long long unsigned _Sat" } */
+long signed int _Sat *s178; /* { dg-error "" "long signed int _Sat" } */
+long unsigned int _Sat *s181; /* { dg-error "" "long unsigned int _Sat" } */
+long unsigned long _Sat *s184; /* { dg-error "" "long unsigned long _Sat" } */
+signed short int _Sat *s187; /* { dg-error "" "signed short int _Sat" } */
+signed int short _Sat *s190; /* { dg-error "" "signed int short _Sat" } */
+signed int long _Sat *s192; /* { dg-error "" "signed int long _Sat" } */
+signed long int _Sat *s195; /* { dg-error "" "signed long int _Sat" } */
+signed long long _Sat *s198; /* { dg-error "" "signed long long _Sat" } */
+unsigned short int _Sat *s201; /* { dg-error "" "unsigned short int _Sat" } */
+unsigned int short _Sat *s204; /* { dg-error "" "unsigned int short _Sat" } */
+unsigned int long _Sat *s207; /* { dg-error "" "unsigned int long _Sat" } */
+unsigned long int _Sat *s210; /* { dg-error "" "unsigned long int _Sat" } */
+unsigned long long _Sat *s213; /* { dg-error "" "unsigned long long _Sat" } */
+int long long signed _Sat *s216; /* { dg-error "" "int long long signed _Sat" } */
+int long long unsigned _Sat *s219; /* { dg-error "" "int long long unsigned _Sat" } */
+int long signed long _Sat *s222; /* { dg-error "" "int long signed long _Sat" } */
+int long unsigned long _Sat *s226; /* { dg-error "" "int long unsigned long _Sat" } */
+int signed long long _Sat *s229; /* { dg-error "" "int signed long long _Sat" } */
+int unsigned long long _Sat *s232; /* { dg-error "" "int unsigned long long _Sat" } */
+long int long signed _Sat *s235; /* { dg-error "" "long int long signed _Sat" } */
+long int long unsigned _Sat *s238; /* { dg-error "" "long int long unsigned _Sat" } */
+long int signed long _Sat *s241; /* { dg-error "" "long int signed long _Sat" } */
+long int unsigned long _Sat *s244; /* { dg-error "" "long int unsigned long _Sat" } */
+long long int signed _Sat *s247; /* { dg-error "" "long long int signed _Sat" } */
+long long int unsigned _Sat *s250; /* { dg-error "" "long long int unsigned _Sat" } */
+long long signed int _Sat *s253; /* { dg-error "" "long long signed int _Sat" } */
+long long unsigned int _Sat *s256; /* { dg-error "" "long long unsigned int _Sat" } */
+long signed int long _Sat *s259; /* { dg-error "" "long signed int long _Sat" } */
+long signed long int _Sat *s262; /* { dg-error "" "long signed long int _Sat" } */
+long unsigned int long _Sat *s265; /* { dg-error "" "long unsigned int long _Sat" } */
+long unsigned long int _Sat *s268; /* { dg-error "" "long unsigned long int _Sat" } */
+signed long long int _Sat *s271; /* { dg-error "" "signed long long int _Sat" } */
+unsigned int long long _Sat *s274; /* { dg-error "" "unsigned int long long _Sat" } */
+unsigned long int long _Sat *s277; /* { dg-error "" "unsigned long int long _Sat" } */
+unsigned long long int _Sat *s280; /* { dg-error "" "unsigned long long int _Sat" } */
+_Complex _Sat *s283; /* { dg-error "" "_Complex _Sat" } */
+_Sat _Complex *s286; /* { dg-error "" "_Sat _Complex" } */
+unsigned _Sat *s289; /* { dg-error "" "unsigned _Sat" } */
+signed _Sat *s292; /* { dg-error "" "signed _Sat" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/unary.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/unary.c
new file mode 100644
index 000000000..4e0954902
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/unary.c
@@ -0,0 +1,256 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* C99 6.5.3 Unary operators.
+
+ Check unary operators ++ -- + - !. */
+
+extern void abort (void);
+
+#define INCDEC(TYPE,POSTFIX) \
+ { TYPE a = 0.0 ## POSTFIX; \
+ if (a++ != 0.0 ## POSTFIX) \
+ abort(); \
+ if (a != 1.0 ## POSTFIX) \
+ abort(); \
+ if (a-- != 1.0 ## POSTFIX) \
+ abort(); \
+ if (a != 0.0 ## POSTFIX) \
+ abort(); \
+ if (++a != 1.0 ## POSTFIX) \
+ abort(); \
+ if (a != 1.0 ## POSTFIX) \
+ abort(); \
+ if (--a != 0.0 ## POSTFIX) \
+ abort(); \
+ if (a != 0.0 ## POSTFIX) \
+ abort(); \
+ }
+
+#define FRACT_INCDEC(TYPE,POSTFIX) \
+ { TYPE a = -0.5 ## POSTFIX; \
+ if (a++ != -0.5 ## POSTFIX) \
+ abort(); \
+ if (a != 0.5 ## POSTFIX) \
+ abort(); \
+ if (a-- != 0.5 ## POSTFIX) \
+ abort(); \
+ if (a != -0.5 ## POSTFIX) \
+ abort(); \
+ if (++a != 0.5 ## POSTFIX) \
+ abort(); \
+ if (a != 0.5 ## POSTFIX) \
+ abort(); \
+ if (--a != -0.5 ## POSTFIX) \
+ abort(); \
+ if (a != -0.5 ## POSTFIX) \
+ abort(); \
+ }
+
+#define FRACT_SAT_INCDEC(TYPE,POSTFIX) \
+ { TYPE a = 0.9 ## POSTFIX; \
+ if (++a != 1.0 ## POSTFIX) \
+ abort(); \
+ a = -0.1 ## POSTFIX; \
+ if (--a != -0.5 ## POSTFIX - 0.5 ## POSTFIX) \
+ abort(); \
+ }
+
+#define FRACT_SAT_UNS_INCDEC(TYPE,POSTFIX) \
+ { TYPE a = 0.9 ## POSTFIX; \
+ if (++a != 1.0 ## POSTFIX) \
+ abort(); \
+ a = 0.1 ## POSTFIX; \
+ if (--a != 0.0 ## POSTFIX) \
+ abort(); \
+ }
+
+#define PLUS(TYPE,POSTFIX) \
+ { TYPE a = 0.1 ## POSTFIX; \
+ if (+a != 0.1 ## POSTFIX) \
+ abort(); \
+ }
+
+#define NEG(TYPE,POSTFIX) \
+ { TYPE a = -0.1 ## POSTFIX; \
+ if (-a != 0.1 ## POSTFIX) \
+ abort(); \
+ }
+
+#define FRACT_SAT_NEG(TYPE,POSTFIX) \
+ { TYPE a = -0.5 ## POSTFIX - 0.5 ## POSTFIX; \
+ if (-a != 1.0 ## POSTFIX) \
+ abort(); \
+ }
+
+#define UNS_NEG(TYPE,POSTFIX) \
+ { TYPE a = 0.0 ## POSTFIX; \
+ if (-a != 0.0 ## POSTFIX) \
+ abort(); \
+ }
+
+#define FRACT_SAT_UNS_NEG(TYPE,POSTFIX) \
+ { TYPE a = 0.5 ## POSTFIX; \
+ if (-a != 0.0 ## POSTFIX) \
+ abort(); \
+ }
+
+#define LOGNEG(TYPE,POSTFIX) \
+ { TYPE a = 0.0 ## POSTFIX; \
+ TYPE b = 0.1 ## POSTFIX; \
+ if (!a != 1) \
+ abort(); \
+ if (!b != 0) \
+ abort(); \
+ }
+
+int main ()
+{
+ FRACT_INCDEC(short _Fract, hr);
+ FRACT_INCDEC(_Fract, r);
+ FRACT_INCDEC(long _Fract, lr);
+ FRACT_INCDEC(long long _Fract, llr);
+ FRACT_INCDEC(_Sat short _Fract, hr);
+ FRACT_INCDEC(_Sat _Fract, r);
+ FRACT_INCDEC(_Sat long _Fract, lr);
+ FRACT_INCDEC(_Sat long long _Fract, llr);
+
+ INCDEC(short _Accum, hk);
+ INCDEC(_Accum, k);
+ INCDEC(long _Accum, lk);
+ INCDEC(long long _Accum, llk);
+ INCDEC(unsigned short _Accum, uhk);
+ INCDEC(unsigned _Accum, uk);
+ INCDEC(unsigned long _Accum, ulk);
+ INCDEC(unsigned long long _Accum, ullk);
+ INCDEC(_Sat short _Accum, hk);
+ INCDEC(_Sat _Accum, k);
+ INCDEC(_Sat long _Accum, lk);
+ INCDEC(_Sat long long _Accum, llk);
+ INCDEC(_Sat unsigned short _Accum, uhk);
+ INCDEC(_Sat unsigned _Accum, uk);
+ INCDEC(_Sat unsigned long _Accum, ulk);
+ INCDEC(_Sat unsigned long long _Accum, ullk);
+
+ FRACT_SAT_INCDEC(_Sat short _Fract, hr);
+ FRACT_SAT_INCDEC(_Sat _Fract, r);
+ FRACT_SAT_INCDEC(_Sat long _Fract, lr);
+ FRACT_SAT_INCDEC(_Sat long long _Fract, llr);
+
+ FRACT_SAT_UNS_INCDEC(_Sat unsigned short _Fract, uhr);
+ FRACT_SAT_UNS_INCDEC(_Sat unsigned _Fract, ur);
+ FRACT_SAT_UNS_INCDEC(_Sat unsigned long _Fract, ulr);
+ FRACT_SAT_UNS_INCDEC(_Sat unsigned long long _Fract, ullr);
+
+ PLUS(short _Fract, hr);
+ PLUS(_Fract, r);
+ PLUS(long _Fract, lr);
+ PLUS(long long _Fract, llr);
+ PLUS(unsigned short _Fract, uhr);
+ PLUS(unsigned _Fract, ur);
+ PLUS(unsigned long _Fract, ulr);
+ PLUS(unsigned long long _Fract, ullr);
+ PLUS(_Sat short _Fract, hr);
+ PLUS(_Sat _Fract, r);
+ PLUS(_Sat long _Fract, lr);
+ PLUS(_Sat long long _Fract, llr);
+ PLUS(_Sat unsigned short _Fract, uhr);
+ PLUS(_Sat unsigned _Fract, ur);
+ PLUS(_Sat unsigned long _Fract, ulr);
+ PLUS(_Sat unsigned long long _Fract, ullr);
+ PLUS(short _Accum, hk);
+ PLUS(_Accum, k);
+ PLUS(long _Accum, lk);
+ PLUS(long long _Accum, llk);
+ PLUS(unsigned short _Accum, uhk);
+ PLUS(unsigned _Accum, uk);
+ PLUS(unsigned long _Accum, ulk);
+ PLUS(unsigned long long _Accum, ullk);
+ PLUS(_Sat short _Accum, hk);
+ PLUS(_Sat _Accum, k);
+ PLUS(_Sat long _Accum, lk);
+ PLUS(_Sat long long _Accum, llk);
+ PLUS(_Sat unsigned short _Accum, uhk);
+ PLUS(_Sat unsigned _Accum, uk);
+ PLUS(_Sat unsigned long _Accum, ulk);
+ PLUS(_Sat unsigned long long _Accum, ullk);
+
+ NEG(short _Fract, hr);
+ NEG(_Fract, r);
+ NEG(long _Fract, lr);
+ NEG(long long _Fract, llr);
+ NEG(_Sat short _Fract, hr);
+ NEG(_Sat _Fract, r);
+ NEG(_Sat long _Fract, lr);
+ NEG(_Sat long long _Fract, llr);
+ NEG(short _Accum, hk);
+ NEG(_Accum, k);
+ NEG(long _Accum, lk);
+ NEG(long long _Accum, llk);
+ NEG(_Sat short _Accum, hk);
+ NEG(_Sat _Accum, k);
+ NEG(_Sat long _Accum, lk);
+ NEG(_Sat long long _Accum, llk);
+
+ FRACT_SAT_NEG(_Sat short _Fract, hr);
+ FRACT_SAT_NEG(_Sat _Fract, r);
+ FRACT_SAT_NEG(_Sat long _Fract, lr);
+ FRACT_SAT_NEG(_Sat long long _Fract, llr);
+
+ UNS_NEG(short _Fract, hr);
+ UNS_NEG(_Fract, r);
+ UNS_NEG(long _Fract, lr);
+ UNS_NEG(long long _Fract, llr);
+ UNS_NEG(_Sat short _Fract, hr);
+ UNS_NEG(_Sat _Fract, r);
+ UNS_NEG(_Sat long _Fract, lr);
+ UNS_NEG(_Sat long long _Fract, llr);
+ UNS_NEG(short _Accum, hk);
+ UNS_NEG(_Accum, k);
+ UNS_NEG(long _Accum, lk);
+ UNS_NEG(long long _Accum, llk);
+ UNS_NEG(_Sat short _Accum, hk);
+ UNS_NEG(_Sat _Accum, k);
+ UNS_NEG(_Sat long _Accum, lk);
+ UNS_NEG(_Sat long long _Accum, llk);
+
+ FRACT_SAT_UNS_NEG(_Sat unsigned short _Fract, uhr);
+ FRACT_SAT_UNS_NEG(_Sat unsigned _Fract, ur);
+ FRACT_SAT_UNS_NEG(_Sat unsigned long _Fract, ulr);
+ FRACT_SAT_UNS_NEG(_Sat unsigned long long _Fract, ullr);
+
+ LOGNEG(short _Fract, hr);
+ LOGNEG(_Fract, r);
+ LOGNEG(long _Fract, lr);
+ LOGNEG(long long _Fract, llr);
+ LOGNEG(unsigned short _Fract, uhr);
+ LOGNEG(unsigned _Fract, ur);
+ LOGNEG(unsigned long _Fract, ulr);
+ LOGNEG(unsigned long long _Fract, ullr);
+ LOGNEG(_Sat short _Fract, hr);
+ LOGNEG(_Sat _Fract, r);
+ LOGNEG(_Sat long _Fract, lr);
+ LOGNEG(_Sat long long _Fract, llr);
+ LOGNEG(_Sat unsigned short _Fract, uhr);
+ LOGNEG(_Sat unsigned _Fract, ur);
+ LOGNEG(_Sat unsigned long _Fract, ulr);
+ LOGNEG(_Sat unsigned long long _Fract, ullr);
+ LOGNEG(short _Accum, hk);
+ LOGNEG(_Accum, k);
+ LOGNEG(long _Accum, lk);
+ LOGNEG(long long _Accum, llk);
+ LOGNEG(unsigned short _Accum, uhk);
+ LOGNEG(unsigned _Accum, uk);
+ LOGNEG(unsigned long _Accum, ulk);
+ LOGNEG(unsigned long long _Accum, ullk);
+ LOGNEG(_Sat short _Accum, hk);
+ LOGNEG(_Sat _Accum, k);
+ LOGNEG(_Sat long _Accum, lk);
+ LOGNEG(_Sat long long _Accum, llk);
+ LOGNEG(_Sat unsigned short _Accum, uhk);
+ LOGNEG(_Sat unsigned _Accum, uk);
+ LOGNEG(_Sat unsigned long _Accum, ulk);
+ LOGNEG(_Sat unsigned long long _Accum, ullk);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/union-init.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/union-init.c
new file mode 100644
index 000000000..126cc9e72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/union-init.c
@@ -0,0 +1,62 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+/* Cast to union is a GNU C extension.
+ Based on the test from ../dfp/. */
+
+extern void abort (void);
+
+union u
+{
+ long _Fract lf;
+ double d;
+};
+
+union n
+{
+ double d;
+ _Fract f;
+};
+
+int main ()
+{
+ static union u u1 = { 0.1lr };
+ static union u u2 = { 0.2lr };
+ static union u u4 = { 0.0 };
+
+ static union n n1 = { 0.3r };
+ static union n n2 = { 3.25 };
+
+ long _Fract lf;
+ _Fract f;
+ double d;
+
+ if (u1.lf != 0.1lr)
+ abort ();
+
+ if (u2.lf != 0.2lr)
+ abort ();
+
+ /* cast fixed-point to union type. */
+ lf = 0.4lr;
+ f = 0.5r;
+ d = 3.25;
+
+ u4 = (union u) lf;
+ if (u4.lf != 0.4lr)
+ abort ();
+
+ u4 = (union u) d;
+ if (u4.d != 3.25)
+ abort ();
+
+ n1 = (union n) f;
+ if (n1.f != 0.5r)
+ abort ();
+
+ n1 = (union n)d;
+ if (n1.d != 3.25)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/view-convert-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/view-convert-2.c
new file mode 100644
index 000000000..fbce5185e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/view-convert-2.c
@@ -0,0 +1,139 @@
+/* PR tree-optimization/56064 */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+void test_k (void)
+{
+ _Accum a;
+ __INT32_TYPE__ i = -__INT32_MAX__;
+
+ if (sizeof (a) != sizeof (i))
+ return;
+
+ __builtin_memcpy (&a, &i, sizeof (a));
+
+ if (a >= 0k)
+ abort();
+}
+
+void test_0k (void)
+{
+ _Accum a;
+ __INT32_TYPE__ i = 0;
+
+ if (sizeof (a) != sizeof (i))
+ return;
+
+ __builtin_memcpy (&a, &i, sizeof (a));
+
+ if (a != 0k)
+ abort();
+}
+
+
+void test_hr (void)
+{
+ short _Fract a;
+ __INT8_TYPE__ i = -__INT8_MAX__;
+
+ if (sizeof (a) != sizeof (i))
+ return;
+
+ __builtin_memcpy (&a, &i, sizeof (a));
+
+ if (a >= 0hr)
+ abort();
+}
+
+void test_0hr (void)
+{
+ short _Fract a;
+ __INT8_TYPE__ i = 0;
+
+ if (sizeof (a) != sizeof (i))
+ return;
+
+ __builtin_memcpy (&a, &i, sizeof (a));
+
+ if (a != 0hr)
+ abort();
+}
+
+
+void test_si (void)
+{
+ _Accum a = __ACCUM_MIN__;
+ __INT32_TYPE__ i;
+
+ if (sizeof (a) != sizeof (i))
+ return;
+
+ __builtin_memcpy (&i, &a, sizeof (i));
+
+ if (i >= 0)
+ abort();
+}
+
+void test_0si (void)
+{
+ _Accum a = 0;
+ __INT32_TYPE__ i;
+
+ if (sizeof (a) != sizeof (i))
+ return;
+
+ __builtin_memcpy (&i, &a, sizeof (i));
+
+ if (i != 0)
+ abort();
+}
+
+
+void test_qi (void)
+{
+ short _Fract a = __SFRACT_MIN__;
+ __INT8_TYPE__ i;
+
+ if (sizeof (a) != sizeof (i))
+ return;
+
+ __builtin_memcpy (&i, &a, sizeof (i));
+
+ if (i >= 0)
+ abort();
+}
+
+void test_0qi (void)
+{
+ short _Fract a = 0hr;
+ __INT8_TYPE__ i;
+
+ if (sizeof (a) != sizeof (i))
+ return;
+
+ __builtin_memcpy (&i, &a, sizeof (i));
+
+ if (i != 0)
+ abort();
+}
+
+
+int main (void)
+{
+ test_hr();
+ test_k();
+ test_qi();
+ test_si();
+
+ test_0hr();
+ test_0k();
+ test_0qi();
+ test_0si();
+
+ exit (0);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/view-convert.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/view-convert.c
new file mode 100644
index 000000000..d5d27b35e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixed-point/view-convert.c
@@ -0,0 +1,122 @@
+/* PR tree-optimization/56064 */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -O2 -fno-builtin-memcpy" } */
+
+extern void abort (void);
+extern void *memcpy (void*, const void*, __SIZE_TYPE__);
+
+#define f_pun_i(F, I, VAL) \
+ { \
+ I i1 = VAL; \
+ I i2 = VAL; \
+ F q1, q2; \
+ memcpy (&q1, &i1, sizeof (I)); \
+ __builtin_memcpy (&q2, &i2, sizeof (I)); \
+ if (q1 != q2) \
+ abort(); \
+ }
+
+#define i_pun_f(I, F, VAL) \
+ { \
+ F q1 = VAL; \
+ F q2 = VAL; \
+ I i1, i2; \
+ memcpy (&i1, &q1, sizeof (I)); \
+ __builtin_memcpy (&i2, &q2, sizeof (I)); \
+ if (i1 != i2) \
+ abort(); \
+ }
+
+
+void __attribute__((noinline))
+test8 (void)
+{
+#ifdef __INT8_TYPE__
+ if (sizeof (__INT8_TYPE__) == sizeof (short _Fract))
+ {
+#define TEST(X) f_pun_i (short _Fract, __INT8_TYPE__, __INT8_C (X))
+ TEST (123);
+ TEST (-123);
+#undef TEST
+
+#define TEST(X) i_pun_f (__INT8_TYPE__, short _Fract, X ## hr)
+ TEST (0.1234);
+ TEST (-0.987);
+#undef TEST
+ }
+#endif /* __INT8_TYPE__ */
+}
+
+
+void __attribute__((noinline))
+test16 (void)
+{
+#ifdef __INT16_TYPE__
+
+ if (sizeof (__INT16_TYPE__) == sizeof (_Fract))
+ {
+#define TEST(X) f_pun_i (_Fract, __INT16_TYPE__, __INT16_C (X))
+ TEST (0x4321);
+ TEST (-0x4321);
+ TEST (0x8000);
+#undef TEST
+
+#define TEST(X) i_pun_f (__INT16_TYPE__, _Fract, X ## r)
+ TEST (0.12345);
+ TEST (-0.98765);
+#undef TEST
+ }
+#endif /* __INT16_TYPE__ */
+}
+
+
+void __attribute__((noinline))
+test32 (void)
+{
+#ifdef __INT32_TYPE__
+ if (sizeof (__INT32_TYPE__) == sizeof (_Accum))
+ {
+#define TEST(X) f_pun_i (_Accum, __INT32_TYPE__, __INT32_C (X))
+ TEST (0x76543219);
+ TEST (-0x76543219);
+ TEST (0x80000000);
+#undef TEST
+
+#define TEST(X) i_pun_f (__INT32_TYPE__, _Accum, X ## k)
+ TEST (123.456789);
+ TEST (-123.456789);
+#undef TEST
+ }
+#endif /* __INT32_TYPE__ */
+}
+
+
+void __attribute__((noinline))
+test64 (void)
+{
+#ifdef __INT64_TYPE__
+ if (sizeof (__INT64_TYPE__) == sizeof (long _Accum))
+ {
+#define TEST(X) f_pun_i (long _Accum, __INT64_TYPE__, __INT64_C (X))
+ TEST (0x12345678abcdef01);
+ TEST (-0x12345678abcdef01);
+ TEST (0x8000000000000000);
+#undef TEST
+
+#define TEST(X) i_pun_f (__INT64_TYPE__, long _Accum, X ## lk)
+ TEST (123.456789);
+ TEST (-123.456789);
+#undef TEST
+ }
+#endif /* __INT64_TYPE__ */
+}
+
+int main()
+{
+ test8();
+ test16();
+ test32();
+ test64();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fixuns-trunc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fixuns-trunc-1.c
new file mode 100644
index 000000000..0d0942952
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fixuns-trunc-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+unsigned long foo(double d)
+{
+ return (unsigned long) d;
+}
+
+extern void abort(void);
+
+int main(void)
+{
+ double d;
+ unsigned long l;
+
+#ifdef __LP64__
+ d = 9223372036854775808.7;
+ l = 1LL << 63;
+
+ if (foo(d) != l)
+ abort();
+#endif
+
+ d = 122485.2;
+ l = 122485;
+
+ if (foo(d) != l)
+ abort();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/float-exact-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/float-exact-1.c
new file mode 100644
index 000000000..d22e70b35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/float-exact-1.c
@@ -0,0 +1,3178 @@
+/* Test exact conversion to binary floating-point types of
+ floating-point contents expressed in decimal. PR 21718. */
+/* { dg-do run } */
+/* { dg-options "-w" } */
+/* { dg-add-options ieee } */
+
+/* For float (if IEEE binary32), double (if IEEE binary64) and long
+ double (if IEEE binary64, x86 extended or IEEE binary128) we test
+ half-way values and numbers close to those half-way values. */
+
+#include <float.h>
+
+#if FLT_EVAL_METHOD == 0 \
+ && FLT_MANT_DIG == 24 \
+ && FLT_MIN_EXP == -125 \
+ && FLT_MAX_EXP == 128
+# define FLT_OK
+/* 0x0.8p-149 */
+static const float f1ae = 0, f1be = 0, f1ce = 0x1p-149f;
+static const float f1a =
+7.0064923216240853546186479164495806564013097093825788587853\
+4141944895541342930300743319094181060791015624999e-46f;
+static const float f1b =
+7.0064923216240853546186479164495806564013097093825788587853\
+4141944895541342930300743319094181060791015625e-46f;
+static const float f1c =
+7.0064923216240853546186479164495806564013097093825788587853\
+4141944895541342930300743319094181060791015625001e-46f;
+/* 0x1.8p-149 */
+static const float f2ae = 0x1p-149f, f2be = 0x2p-149f, f2ce = 0x2p-149f;
+static const float f2a =
+2.1019476964872256063855943749348741969203929128147736576356\
+02425834686624028790902229957282543182373046874999e-45f;
+static const float f2b =
+2.1019476964872256063855943749348741969203929128147736576356\
+02425834686624028790902229957282543182373046875e-45f;
+static const float f2c =
+2.1019476964872256063855943749348741969203929128147736576356\
+02425834686624028790902229957282543182373046875001e-45f;
+/* 0x1.000001p127 */
+static const float f3ae = 0x1p127f, f3be = 0x1p127f, f3ce = 0x1.000002p127f;
+static const float f3a =
+1.70141193601674033557522515689509748735999e+38f;
+static const float f3b =
+1.70141193601674033557522515689509748736e+38f;
+static const float f3c =
+1.70141193601674033557522515689509748736001e+38f;
+#endif
+
+#if (FLT_EVAL_METHOD == 0 || FLT_EVAL_METHOD == 1) \
+ && DBL_MANT_DIG == 53 \
+ && DBL_MIN_EXP == -1021 \
+ && DBL_MAX_EXP == 1024
+# define DBL_OK
+/* 0x0.8p-1074 */
+static const double d1ae = 0, d1be = 0, d1ce = 0x1p-1074;
+static const double d1a =
+2.4703282292062327208828439643411068618252990130716238221279\
+284125033775363510437593264991818081799618989828234772285886\
+546332835517796989819938739800539093906315035659515570226392\
+290858392449105184435931802849936536152500319370457678249219\
+365623669863658480757001585769269903706311928279558551332927\
+834338409351978015531246597263579574622766465272827220056374\
+006485499977096599470454020828166226237857393450736339007967\
+761930577506740176324673600968951340535537458516661134223766\
+678604162159680461914467291840300530057530849048765391711386\
+591646239524912623653881879636239373280423891018672348497668\
+235089863388587925628302755995657524455507255189313690836254\
+779186948667994968324049705821028513185451396213837722826145\
+437693412532098591327667236328124999e-324;
+static const double d1b =
+2.4703282292062327208828439643411068618252990130716238221279\
+284125033775363510437593264991818081799618989828234772285886\
+546332835517796989819938739800539093906315035659515570226392\
+290858392449105184435931802849936536152500319370457678249219\
+365623669863658480757001585769269903706311928279558551332927\
+834338409351978015531246597263579574622766465272827220056374\
+006485499977096599470454020828166226237857393450736339007967\
+761930577506740176324673600968951340535537458516661134223766\
+678604162159680461914467291840300530057530849048765391711386\
+591646239524912623653881879636239373280423891018672348497668\
+235089863388587925628302755995657524455507255189313690836254\
+779186948667994968324049705821028513185451396213837722826145\
+437693412532098591327667236328125e-324;
+static const double d1c =
+2.4703282292062327208828439643411068618252990130716238221279\
+284125033775363510437593264991818081799618989828234772285886\
+546332835517796989819938739800539093906315035659515570226392\
+290858392449105184435931802849936536152500319370457678249219\
+365623669863658480757001585769269903706311928279558551332927\
+834338409351978015531246597263579574622766465272827220056374\
+006485499977096599470454020828166226237857393450736339007967\
+761930577506740176324673600968951340535537458516661134223766\
+678604162159680461914467291840300530057530849048765391711386\
+591646239524912623653881879636239373280423891018672348497668\
+235089863388587925628302755995657524455507255189313690836254\
+779186948667994968324049705821028513185451396213837722826145\
+437693412532098591327667236328125001e-324;
+/* 0x1.8p-1074 */
+static const double d2ae = 0x1p-1074, d2be = 0x2p-1074, d2ce = 0x2p-1074;
+static const double d2a =
+7.4109846876186981626485318930233205854758970392148714663837\
+852375101326090531312779794975454245398856969484704316857659\
+638998506553390969459816219401617281718945106978546710679176\
+872575177347315553307795408549809608457500958111373034747658\
+096871009590975442271004757307809711118935784838675653998783\
+503015228055934046593739791790738723868299395818481660169122\
+019456499931289798411362062484498678713572180352209017023903\
+285791732520220528974020802906854021606612375549983402671300\
+035812486479041385743401875520901590172592547146296175134159\
+774938718574737870961645638908718119841271673056017045493004\
+705269590165763776884908267986972573366521765567941072508764\
+337560846003984904972149117463085539556354188641513168478436\
+313080237596295773983001708984374999e-324;
+static const double d2b =
+7.4109846876186981626485318930233205854758970392148714663837\
+852375101326090531312779794975454245398856969484704316857659\
+638998506553390969459816219401617281718945106978546710679176\
+872575177347315553307795408549809608457500958111373034747658\
+096871009590975442271004757307809711118935784838675653998783\
+503015228055934046593739791790738723868299395818481660169122\
+019456499931289798411362062484498678713572180352209017023903\
+285791732520220528974020802906854021606612375549983402671300\
+035812486479041385743401875520901590172592547146296175134159\
+774938718574737870961645638908718119841271673056017045493004\
+705269590165763776884908267986972573366521765567941072508764\
+337560846003984904972149117463085539556354188641513168478436\
+313080237596295773983001708984375e-324;
+static const double d2c =
+7.4109846876186981626485318930233205854758970392148714663837\
+852375101326090531312779794975454245398856969484704316857659\
+638998506553390969459816219401617281718945106978546710679176\
+872575177347315553307795408549809608457500958111373034747658\
+096871009590975442271004757307809711118935784838675653998783\
+503015228055934046593739791790738723868299395818481660169122\
+019456499931289798411362062484498678713572180352209017023903\
+285791732520220528974020802906854021606612375549983402671300\
+035812486479041385743401875520901590172592547146296175134159\
+774938718574737870961645638908718119841271673056017045493004\
+705269590165763776884908267986972573366521765567941072508764\
+337560846003984904972149117463085539556354188641513168478436\
+313080237596295773983001708984375001e-324;
+/* 0x1.00000000000008p1023 */
+static const double d3ae = 0x1p1023, d3be = 0x1p1023, d3ce = 0x1.0000000000001p1023;
+static const double d3a =
+8.9884656743115805365666807213050294962762414131308158973971\
+342756154045415486693752413698006024096935349884403114202125\
+541629105369684531108613657287705365884742938136589844238179\
+474556051429647415148697857438797685859063890851407391008830\
+874765563025951597582513936655578157348020066364210154316532\
+161708031999e+307;
+static const double d3b =
+8.9884656743115805365666807213050294962762414131308158973971\
+342756154045415486693752413698006024096935349884403114202125\
+541629105369684531108613657287705365884742938136589844238179\
+474556051429647415148697857438797685859063890851407391008830\
+874765563025951597582513936655578157348020066364210154316532\
+161708032e+307;
+static const double d3c =
+8.9884656743115805365666807213050294962762414131308158973971\
+342756154045415486693752413698006024096935349884403114202125\
+541629105369684531108613657287705365884742938136589844238179\
+474556051429647415148697857438797685859063890851407391008830\
+874765563025951597582513936655578157348020066364210154316532\
+161708032001e+307;
+#endif
+
+#if LDBL_MANT_DIG == 53 \
+ && LDBL_MIN_EXP == -1021 \
+ && LDBL_MAX_EXP == 1024
+# define LDBL_OK
+/* 0x0.8p-1074 */
+static const long double ld1ae = 0, ld1be = 0, ld1ce = 0x1p-1074L;
+static const long double ld1a =
+2.4703282292062327208828439643411068618252990130716238221279\
+284125033775363510437593264991818081799618989828234772285886\
+546332835517796989819938739800539093906315035659515570226392\
+290858392449105184435931802849936536152500319370457678249219\
+365623669863658480757001585769269903706311928279558551332927\
+834338409351978015531246597263579574622766465272827220056374\
+006485499977096599470454020828166226237857393450736339007967\
+761930577506740176324673600968951340535537458516661134223766\
+678604162159680461914467291840300530057530849048765391711386\
+591646239524912623653881879636239373280423891018672348497668\
+235089863388587925628302755995657524455507255189313690836254\
+779186948667994968324049705821028513185451396213837722826145\
+437693412532098591327667236328124999e-324L;
+static const long double ld1b =
+2.4703282292062327208828439643411068618252990130716238221279\
+284125033775363510437593264991818081799618989828234772285886\
+546332835517796989819938739800539093906315035659515570226392\
+290858392449105184435931802849936536152500319370457678249219\
+365623669863658480757001585769269903706311928279558551332927\
+834338409351978015531246597263579574622766465272827220056374\
+006485499977096599470454020828166226237857393450736339007967\
+761930577506740176324673600968951340535537458516661134223766\
+678604162159680461914467291840300530057530849048765391711386\
+591646239524912623653881879636239373280423891018672348497668\
+235089863388587925628302755995657524455507255189313690836254\
+779186948667994968324049705821028513185451396213837722826145\
+437693412532098591327667236328125e-324L;
+static const long double ld1c =
+2.4703282292062327208828439643411068618252990130716238221279\
+284125033775363510437593264991818081799618989828234772285886\
+546332835517796989819938739800539093906315035659515570226392\
+290858392449105184435931802849936536152500319370457678249219\
+365623669863658480757001585769269903706311928279558551332927\
+834338409351978015531246597263579574622766465272827220056374\
+006485499977096599470454020828166226237857393450736339007967\
+761930577506740176324673600968951340535537458516661134223766\
+678604162159680461914467291840300530057530849048765391711386\
+591646239524912623653881879636239373280423891018672348497668\
+235089863388587925628302755995657524455507255189313690836254\
+779186948667994968324049705821028513185451396213837722826145\
+437693412532098591327667236328125001e-324L;
+/* 0x1.8p-1074 */
+static const long double ld2ae = 0x1p-1074L, ld2be = 0x2p-1074L, ld2ce = 0x2p-1074L;
+static const long double ld2a =
+7.4109846876186981626485318930233205854758970392148714663837\
+852375101326090531312779794975454245398856969484704316857659\
+638998506553390969459816219401617281718945106978546710679176\
+872575177347315553307795408549809608457500958111373034747658\
+096871009590975442271004757307809711118935784838675653998783\
+503015228055934046593739791790738723868299395818481660169122\
+019456499931289798411362062484498678713572180352209017023903\
+285791732520220528974020802906854021606612375549983402671300\
+035812486479041385743401875520901590172592547146296175134159\
+774938718574737870961645638908718119841271673056017045493004\
+705269590165763776884908267986972573366521765567941072508764\
+337560846003984904972149117463085539556354188641513168478436\
+313080237596295773983001708984374999e-324L;
+static const long double ld2b =
+7.4109846876186981626485318930233205854758970392148714663837\
+852375101326090531312779794975454245398856969484704316857659\
+638998506553390969459816219401617281718945106978546710679176\
+872575177347315553307795408549809608457500958111373034747658\
+096871009590975442271004757307809711118935784838675653998783\
+503015228055934046593739791790738723868299395818481660169122\
+019456499931289798411362062484498678713572180352209017023903\
+285791732520220528974020802906854021606612375549983402671300\
+035812486479041385743401875520901590172592547146296175134159\
+774938718574737870961645638908718119841271673056017045493004\
+705269590165763776884908267986972573366521765567941072508764\
+337560846003984904972149117463085539556354188641513168478436\
+313080237596295773983001708984375e-324L;
+static const long double ld2c =
+7.4109846876186981626485318930233205854758970392148714663837\
+852375101326090531312779794975454245398856969484704316857659\
+638998506553390969459816219401617281718945106978546710679176\
+872575177347315553307795408549809608457500958111373034747658\
+096871009590975442271004757307809711118935784838675653998783\
+503015228055934046593739791790738723868299395818481660169122\
+019456499931289798411362062484498678713572180352209017023903\
+285791732520220528974020802906854021606612375549983402671300\
+035812486479041385743401875520901590172592547146296175134159\
+774938718574737870961645638908718119841271673056017045493004\
+705269590165763776884908267986972573366521765567941072508764\
+337560846003984904972149117463085539556354188641513168478436\
+313080237596295773983001708984375001e-324L;
+/* 0x1.00000000000008p1023 */
+static const long double ld3ae = 0x1p1023L, ld3be = 0x1p1023L, ld3ce = 0x1.0000000000001p1023L;
+static const long double ld3a =
+8.9884656743115805365666807213050294962762414131308158973971\
+342756154045415486693752413698006024096935349884403114202125\
+541629105369684531108613657287705365884742938136589844238179\
+474556051429647415148697857438797685859063890851407391008830\
+874765563025951597582513936655578157348020066364210154316532\
+161708031999e+307L;
+static const long double ld3b =
+8.9884656743115805365666807213050294962762414131308158973971\
+342756154045415486693752413698006024096935349884403114202125\
+541629105369684531108613657287705365884742938136589844238179\
+474556051429647415148697857438797685859063890851407391008830\
+874765563025951597582513936655578157348020066364210154316532\
+161708032e+307L;
+static const long double ld3c =
+8.9884656743115805365666807213050294962762414131308158973971\
+342756154045415486693752413698006024096935349884403114202125\
+541629105369684531108613657287705365884742938136589844238179\
+474556051429647415148697857438797685859063890851407391008830\
+874765563025951597582513936655578157348020066364210154316532\
+161708032001e+307L;
+#endif
+
+#if LDBL_MANT_DIG == 64 \
+ && LDBL_MIN_EXP == -16381 \
+ && LDBL_MAX_EXP == 16384
+# define LDBL_OK
+/* 0x0.8p-16445 */
+static const long double ld1ae = 0, ld1be = 0, ld1ce = 0x1p-16445L;
+static const long double ld1a =
+1.8225997659412373012642029668097099081995254078467816718604\
+902435141858443166988684047803543129136025986236736736017655\
+509834928163110160849867540377949045027419112905889658392846\
+126319028167798783107812829917053644701598967767636342956203\
+999770864055077592691915230273843577112246476529298591341071\
+313110337661777304220340396298768698441131694859514066773321\
+059786469060001083813361460161387168195154228027648977594276\
+496061276605855817438145692314650177569263750801566422892936\
+732834290416745265618525969943519916542939199731612507343012\
+297331882934352282118173551211985973294301787840335672389913\
+821098681464088756477802684228806339233239542587316254618680\
+197563613907079766830481997222017010585267442240109888818022\
+189543438116245170584546472752661417773021275082355242554950\
+776248474101880875363872607989624146320823364146896124171892\
+610744237622308266702265704492674694505399997330424978964704\
+335411125839490463131661420668167686151828553033363555080508\
+484934542727634080467233927879117726432283352324546435315312\
+937809651095964197873430398662003709663353962932921239516263\
+008572512558260093668527782388349282015308359304941505110445\
+043762021191469060607078792635897736408141163554429972292873\
+575169264387977130124003958599909776720759582995017519144111\
+001778329839793855454688442046155253818724410472281602421363\
+580613990749181808302947976045417884436271162664776148749463\
+202753814797191206392480969096910387729527305862739806702349\
+088455828380471306603628636563037414688265702108098430515297\
+645997107159687247830496686980315376091511219227376708389862\
+310190633134517040835432587726931910775044780329777051964574\
+763119639404235797665922677433332402402817037657141926646502\
+612388421085254756323737273178774331073924707711575555193153\
+421957126062196520952920611871114861423032687425262323243276\
+848595495133802591437804984986053892365334900647137137197585\
+161954823956838391108748154877098567190695813394392779995887\
+642254413740232692940887236351533691174492514884514265006822\
+752026136435469700291628942927286843274959781329315250417360\
+438115330104516894597449604875954147108010051910197388860417\
+003307595774863477182911525109554542883460240867674794470854\
+883815424039187014069246137704710366577005576311674384079810\
+437206511282792194562503036151028910065418370565117488062226\
+073975854919243439941741016447206284543777826080409075756028\
+194465562812076645422284670475730922346454505830553174377950\
+824178034708147037448871898963699023373821217419560423459358\
+846127232531421552826545954362386431279626917642725181802754\
+271134597856231805666129524101509582941585421888561296839474\
+232056474112935379177434928227554149402642893913492062781246\
+372611175305462271711931011635602039137701669573065960945871\
+579420683440097179831368317352157202215160682058878025153007\
+184185319863451652087375936651004559837502483808090613073982\
+264685620351993519454344577635257452328683726988824705474397\
+398247190812883071734743260426540123481791283782928972842466\
+595210269414219040901793935553872090377394005932597887081359\
+481915849178541128182923272843218513093012167744690818603663\
+862691727272565325057703378827553284852502067686026850339624\
+401046086817036618366842240024522042069888708534827471235203\
+998932259309110942367856287784097166420437430118381247339347\
+418156902369282431197735078016591613063918260343498992697002\
+033186558413655576703389208301203552157755701852051877927864\
+696515420369217703510602759815252574799728706795849558382877\
+392016396900560101736741462690753991602263974212137632508984\
+264559315540891383192361601189350414311358816980975697568561\
+515680971830107704152657284552920241862730125888825702301035\
+564615759615882010733764341109834449576907982406265803484111\
+303615971297609065271517286111839839646343815364461776394273\
+571391219315553915335300622295196577640884201524657614065743\
+729121754460652975075990012786021662416077757235487562550381\
+116824006014440438178253273174734436163638119532295383351135\
+543170811596051785036366846773285937845231974424475418970517\
+659179798069972876889488877627309887323737590814875050457317\
+809625163713227973229002908003491739085115971899606986738405\
+752463436186745107821032315480693516006251388789902053863235\
+071957895722121876262598833823352290042576488238120724072267\
+480348425637199003147760378463243043407534395221882144887315\
+875876025907739792297575795373506429192468470170038312050500\
+917665707583420927303790875332407805094505665159755210495266\
+485594187244922216154283213688032393939401426499517609275128\
+062067355172333120857796045387692492375534056470145301671359\
+016602832469675123108598588424022216759334733452626330303791\
+660952659036162827509451468771297954737165701921676834866994\
+084496268491510599580714458155026746676860790028899722645883\
+679435969902046442373108472951515492761911884847211825930115\
+654927539118088350255959445076757398298893380662248358210075\
+297702191186519614515280395341723177201383862827129721649638\
+274531314762377778754560119397123180107310216608157141828379\
+259328274508467371717057031104537750450228447941619684073375\
+630517322006118640290925241602376256334414376495602911265450\
+165889418372161719063670619610214632774542741157366426747861\
+054811449449004970132668146607323502760146957586465275981090\
+328336256381187450646030492071694516054712444513961269623339\
+705411366337817643269316717217432478812002049894979925260411\
+553651385384826214231392012841425936827944383266227115236029\
+717393064659821056467446870597828757433936024422511537561864\
+619865595955628070343780472634463916608440151554502790128417\
+277259492437005696576453717387309605129939526661181496994297\
+244693710437436581443653555343763817246961834486181294985455\
+884981266421533438177271809310897035958260776218253097858601\
+160643120653927024652834025146166356877731266566437231429061\
+099807825113272551869352908241073955695854354852545370793609\
+838167127357752579007490955536081388103461735071174567636929\
+060824172375010035497010614957197713919909924635906503348016\
+450952475530978921242656498701313530533991692867619886826204\
+706468476070943378163577235406861262755114909606255628375659\
+196050370661430148107216310635729360112021571291096278032076\
+401092225373270173950575377792566872113768085940991929655824\
+050914085013970861399015141010432835406337266746706727481946\
+196898882472095111505210339933002505227334750020285673634670\
+738458390159933494226851499935336922036551687169140582574153\
+726872453800858360764892975201757027862632615130256075468549\
+502839367841926212872731925042838691319757663382746471782087\
+828988857978192483595747889021081459460627705275735868618724\
+958783348362295106875556443770626864591972089881215465141073\
+516646930158996569747675806719463602045230325049794904894739\
+988312727573320971310488326486213061839843830003145873279435\
+454121817918269218294901387830156432148142381592864575229119\
+479029130050663564889172093067341444164942736885872753984012\
+865743421266470861425283889134636885790293235727017788606167\
+560012477186697069994213912998550931078617189790771376702549\
+055361745205232419031423044366971378594392952093464046441667\
+117613906203494872209149396518971207279263883566606774353236\
+255473603377861613942239543893894460581170658088042083661404\
+937465706659424639301296621963906278930754459296017486063079\
+582024995485338893699574289806529424673393810217577605952909\
+491283123179789154639057105774960699934999681018155749261864\
+012821574480758746632022143860041252142846691648490809250856\
+327057133540568617791625295314357533564192304930155735301757\
+457531580062662693966772497728335047637869054460240023262262\
+260698443946964564691259441706490611176164305693669515767804\
+836460521205954731752583848846525153811934541997962775215961\
+180346397456122329133421016560406277159258781706172834569862\
+946953007793254152187010227976038449980797987728559041018441\
+590564594738308310579014597893182017151615208050090318483536\
+106249131918576316944251537092347119867433735046169725181104\
+507590928834713669184230634083190791725243913641206256399101\
+550966117564795555149420011152858441084271411289366093158722\
+254752761637144762690747726313899449121995142565661043193165\
+353010677613760383307839362361625628371456344409245507081913\
+518237257141164239966660785903970075181826808229440731778746\
+830751045427285945936163931997929399708401851740705527023711\
+492262489476846435969872480702228386506357017948329114555484\
+164760105906717855684788039081591713778852802032849601308169\
+832017420608399347713424218434541771868442189843417628618330\
+607429739733739437863581804003482214082370567967330530446020\
+897773385726872912189813323094415093143437550397556262780011\
+208941731420098754319961419532567861629590267320403217607660\
+774125374101195389953895035347940170148097810952083736798564\
+420421622607993390894450932047257403433908665884124601384175\
+012387617430467934818665777122459487877479257747635172691688\
+471574765285820096075133353869554987216398800026453207557923\
+535966131756358352198875705382763163680830588056974671628368\
+719411827591592806044707764658145625683998557872894583705117\
+936257144994734815912058252772021032081682437093280526665192\
+728869800954748014250481042845426151143544474372887617562791\
+409866964806319608280819816846942058817381943129762034507591\
+367065185343216917751414811188645979508942996964383255432999\
+246119971295726296202396921903289017490293595312645036697141\
+581149988784499288560584613793415358537364677872496224892098\
+940856692342358755626519304557946447004033186014602147449599\
+351317079758304444877174136521487256811625263467410007624215\
+856145392339552689565690577293133060124853654497575571509576\
+408069646196646757505249296126372820539234090564691695806544\
+715766025588258581902342311480969412221466852421842650484494\
+063894865891424563992751226230317059592413191308470146226366\
+458233536657973376067140793776369412191789801225320255079444\
+592709005698858098716107025188986428347407279053266600044521\
+079987989879536957560131070100060050673537683871138182387904\
+590837539252425985326631955455857258818756188063697492342550\
+045277400125480079927908846850898283905756532829762950509886\
+991675925213188409911532242068610889478326451513981115020992\
+630395715520350039372702741107911736947893709538471200363740\
+669304116845653259038102180504837110789645359520309929381266\
+271463740502507456882882255788069710715770802338317704510793\
+279398576163709512326095306022330346997717688118726634628650\
+675984237916551201500684504118483305560295744746257951860545\
+390826531622290588364837980034428055971370065573420370270905\
+592141420051502465016793525150950140243606137664910359769114\
+512792293426708006440346732679574519594848136194781488696994\
+267355775509666977187349644291823026624985531726865131782364\
+428380093055155988532106121916567178604128111080322761213573\
+781334480667563871257352254033032675246444238637990062075058\
+819854494711379915549313390179300091783493496822950479766923\
+983305064901026858870340863556799948310622536592472509634484\
+910640735459644047154918467543140024764605449756679450446473\
+048922824617117723876384637412932380635306714345354710568410\
+140587435077620501285599837051978855056335305570615129711860\
+309387503970812843734718712815925040263182888714533431137355\
+255722368962836390856001176889513153529416105504464217522618\
+741534232432067776306691118141998014985541610448993152948945\
+865983354717289054861249734477980864059509622993770525110616\
+313865830823478927462500895844216364365499438449134659145333\
+799994034010282254566331595018205841080487728993632798168070\
+476921205941768965021887178681810499301253039335978279707627\
+295287697256489961179958946847840431902105306618594831078534\
+622089641993900896756734276531931450266972752637997248151974\
+2277811246822238899767398834228515624999e-4951L;
+static const long double ld1b =
+1.8225997659412373012642029668097099081995254078467816718604\
+902435141858443166988684047803543129136025986236736736017655\
+509834928163110160849867540377949045027419112905889658392846\
+126319028167798783107812829917053644701598967767636342956203\
+999770864055077592691915230273843577112246476529298591341071\
+313110337661777304220340396298768698441131694859514066773321\
+059786469060001083813361460161387168195154228027648977594276\
+496061276605855817438145692314650177569263750801566422892936\
+732834290416745265618525969943519916542939199731612507343012\
+297331882934352282118173551211985973294301787840335672389913\
+821098681464088756477802684228806339233239542587316254618680\
+197563613907079766830481997222017010585267442240109888818022\
+189543438116245170584546472752661417773021275082355242554950\
+776248474101880875363872607989624146320823364146896124171892\
+610744237622308266702265704492674694505399997330424978964704\
+335411125839490463131661420668167686151828553033363555080508\
+484934542727634080467233927879117726432283352324546435315312\
+937809651095964197873430398662003709663353962932921239516263\
+008572512558260093668527782388349282015308359304941505110445\
+043762021191469060607078792635897736408141163554429972292873\
+575169264387977130124003958599909776720759582995017519144111\
+001778329839793855454688442046155253818724410472281602421363\
+580613990749181808302947976045417884436271162664776148749463\
+202753814797191206392480969096910387729527305862739806702349\
+088455828380471306603628636563037414688265702108098430515297\
+645997107159687247830496686980315376091511219227376708389862\
+310190633134517040835432587726931910775044780329777051964574\
+763119639404235797665922677433332402402817037657141926646502\
+612388421085254756323737273178774331073924707711575555193153\
+421957126062196520952920611871114861423032687425262323243276\
+848595495133802591437804984986053892365334900647137137197585\
+161954823956838391108748154877098567190695813394392779995887\
+642254413740232692940887236351533691174492514884514265006822\
+752026136435469700291628942927286843274959781329315250417360\
+438115330104516894597449604875954147108010051910197388860417\
+003307595774863477182911525109554542883460240867674794470854\
+883815424039187014069246137704710366577005576311674384079810\
+437206511282792194562503036151028910065418370565117488062226\
+073975854919243439941741016447206284543777826080409075756028\
+194465562812076645422284670475730922346454505830553174377950\
+824178034708147037448871898963699023373821217419560423459358\
+846127232531421552826545954362386431279626917642725181802754\
+271134597856231805666129524101509582941585421888561296839474\
+232056474112935379177434928227554149402642893913492062781246\
+372611175305462271711931011635602039137701669573065960945871\
+579420683440097179831368317352157202215160682058878025153007\
+184185319863451652087375936651004559837502483808090613073982\
+264685620351993519454344577635257452328683726988824705474397\
+398247190812883071734743260426540123481791283782928972842466\
+595210269414219040901793935553872090377394005932597887081359\
+481915849178541128182923272843218513093012167744690818603663\
+862691727272565325057703378827553284852502067686026850339624\
+401046086817036618366842240024522042069888708534827471235203\
+998932259309110942367856287784097166420437430118381247339347\
+418156902369282431197735078016591613063918260343498992697002\
+033186558413655576703389208301203552157755701852051877927864\
+696515420369217703510602759815252574799728706795849558382877\
+392016396900560101736741462690753991602263974212137632508984\
+264559315540891383192361601189350414311358816980975697568561\
+515680971830107704152657284552920241862730125888825702301035\
+564615759615882010733764341109834449576907982406265803484111\
+303615971297609065271517286111839839646343815364461776394273\
+571391219315553915335300622295196577640884201524657614065743\
+729121754460652975075990012786021662416077757235487562550381\
+116824006014440438178253273174734436163638119532295383351135\
+543170811596051785036366846773285937845231974424475418970517\
+659179798069972876889488877627309887323737590814875050457317\
+809625163713227973229002908003491739085115971899606986738405\
+752463436186745107821032315480693516006251388789902053863235\
+071957895722121876262598833823352290042576488238120724072267\
+480348425637199003147760378463243043407534395221882144887315\
+875876025907739792297575795373506429192468470170038312050500\
+917665707583420927303790875332407805094505665159755210495266\
+485594187244922216154283213688032393939401426499517609275128\
+062067355172333120857796045387692492375534056470145301671359\
+016602832469675123108598588424022216759334733452626330303791\
+660952659036162827509451468771297954737165701921676834866994\
+084496268491510599580714458155026746676860790028899722645883\
+679435969902046442373108472951515492761911884847211825930115\
+654927539118088350255959445076757398298893380662248358210075\
+297702191186519614515280395341723177201383862827129721649638\
+274531314762377778754560119397123180107310216608157141828379\
+259328274508467371717057031104537750450228447941619684073375\
+630517322006118640290925241602376256334414376495602911265450\
+165889418372161719063670619610214632774542741157366426747861\
+054811449449004970132668146607323502760146957586465275981090\
+328336256381187450646030492071694516054712444513961269623339\
+705411366337817643269316717217432478812002049894979925260411\
+553651385384826214231392012841425936827944383266227115236029\
+717393064659821056467446870597828757433936024422511537561864\
+619865595955628070343780472634463916608440151554502790128417\
+277259492437005696576453717387309605129939526661181496994297\
+244693710437436581443653555343763817246961834486181294985455\
+884981266421533438177271809310897035958260776218253097858601\
+160643120653927024652834025146166356877731266566437231429061\
+099807825113272551869352908241073955695854354852545370793609\
+838167127357752579007490955536081388103461735071174567636929\
+060824172375010035497010614957197713919909924635906503348016\
+450952475530978921242656498701313530533991692867619886826204\
+706468476070943378163577235406861262755114909606255628375659\
+196050370661430148107216310635729360112021571291096278032076\
+401092225373270173950575377792566872113768085940991929655824\
+050914085013970861399015141010432835406337266746706727481946\
+196898882472095111505210339933002505227334750020285673634670\
+738458390159933494226851499935336922036551687169140582574153\
+726872453800858360764892975201757027862632615130256075468549\
+502839367841926212872731925042838691319757663382746471782087\
+828988857978192483595747889021081459460627705275735868618724\
+958783348362295106875556443770626864591972089881215465141073\
+516646930158996569747675806719463602045230325049794904894739\
+988312727573320971310488326486213061839843830003145873279435\
+454121817918269218294901387830156432148142381592864575229119\
+479029130050663564889172093067341444164942736885872753984012\
+865743421266470861425283889134636885790293235727017788606167\
+560012477186697069994213912998550931078617189790771376702549\
+055361745205232419031423044366971378594392952093464046441667\
+117613906203494872209149396518971207279263883566606774353236\
+255473603377861613942239543893894460581170658088042083661404\
+937465706659424639301296621963906278930754459296017486063079\
+582024995485338893699574289806529424673393810217577605952909\
+491283123179789154639057105774960699934999681018155749261864\
+012821574480758746632022143860041252142846691648490809250856\
+327057133540568617791625295314357533564192304930155735301757\
+457531580062662693966772497728335047637869054460240023262262\
+260698443946964564691259441706490611176164305693669515767804\
+836460521205954731752583848846525153811934541997962775215961\
+180346397456122329133421016560406277159258781706172834569862\
+946953007793254152187010227976038449980797987728559041018441\
+590564594738308310579014597893182017151615208050090318483536\
+106249131918576316944251537092347119867433735046169725181104\
+507590928834713669184230634083190791725243913641206256399101\
+550966117564795555149420011152858441084271411289366093158722\
+254752761637144762690747726313899449121995142565661043193165\
+353010677613760383307839362361625628371456344409245507081913\
+518237257141164239966660785903970075181826808229440731778746\
+830751045427285945936163931997929399708401851740705527023711\
+492262489476846435969872480702228386506357017948329114555484\
+164760105906717855684788039081591713778852802032849601308169\
+832017420608399347713424218434541771868442189843417628618330\
+607429739733739437863581804003482214082370567967330530446020\
+897773385726872912189813323094415093143437550397556262780011\
+208941731420098754319961419532567861629590267320403217607660\
+774125374101195389953895035347940170148097810952083736798564\
+420421622607993390894450932047257403433908665884124601384175\
+012387617430467934818665777122459487877479257747635172691688\
+471574765285820096075133353869554987216398800026453207557923\
+535966131756358352198875705382763163680830588056974671628368\
+719411827591592806044707764658145625683998557872894583705117\
+936257144994734815912058252772021032081682437093280526665192\
+728869800954748014250481042845426151143544474372887617562791\
+409866964806319608280819816846942058817381943129762034507591\
+367065185343216917751414811188645979508942996964383255432999\
+246119971295726296202396921903289017490293595312645036697141\
+581149988784499288560584613793415358537364677872496224892098\
+940856692342358755626519304557946447004033186014602147449599\
+351317079758304444877174136521487256811625263467410007624215\
+856145392339552689565690577293133060124853654497575571509576\
+408069646196646757505249296126372820539234090564691695806544\
+715766025588258581902342311480969412221466852421842650484494\
+063894865891424563992751226230317059592413191308470146226366\
+458233536657973376067140793776369412191789801225320255079444\
+592709005698858098716107025188986428347407279053266600044521\
+079987989879536957560131070100060050673537683871138182387904\
+590837539252425985326631955455857258818756188063697492342550\
+045277400125480079927908846850898283905756532829762950509886\
+991675925213188409911532242068610889478326451513981115020992\
+630395715520350039372702741107911736947893709538471200363740\
+669304116845653259038102180504837110789645359520309929381266\
+271463740502507456882882255788069710715770802338317704510793\
+279398576163709512326095306022330346997717688118726634628650\
+675984237916551201500684504118483305560295744746257951860545\
+390826531622290588364837980034428055971370065573420370270905\
+592141420051502465016793525150950140243606137664910359769114\
+512792293426708006440346732679574519594848136194781488696994\
+267355775509666977187349644291823026624985531726865131782364\
+428380093055155988532106121916567178604128111080322761213573\
+781334480667563871257352254033032675246444238637990062075058\
+819854494711379915549313390179300091783493496822950479766923\
+983305064901026858870340863556799948310622536592472509634484\
+910640735459644047154918467543140024764605449756679450446473\
+048922824617117723876384637412932380635306714345354710568410\
+140587435077620501285599837051978855056335305570615129711860\
+309387503970812843734718712815925040263182888714533431137355\
+255722368962836390856001176889513153529416105504464217522618\
+741534232432067776306691118141998014985541610448993152948945\
+865983354717289054861249734477980864059509622993770525110616\
+313865830823478927462500895844216364365499438449134659145333\
+799994034010282254566331595018205841080487728993632798168070\
+476921205941768965021887178681810499301253039335978279707627\
+295287697256489961179958946847840431902105306618594831078534\
+622089641993900896756734276531931450266972752637997248151974\
+2277811246822238899767398834228515625e-4951L;
+static const long double ld1c =
+1.8225997659412373012642029668097099081995254078467816718604\
+902435141858443166988684047803543129136025986236736736017655\
+509834928163110160849867540377949045027419112905889658392846\
+126319028167798783107812829917053644701598967767636342956203\
+999770864055077592691915230273843577112246476529298591341071\
+313110337661777304220340396298768698441131694859514066773321\
+059786469060001083813361460161387168195154228027648977594276\
+496061276605855817438145692314650177569263750801566422892936\
+732834290416745265618525969943519916542939199731612507343012\
+297331882934352282118173551211985973294301787840335672389913\
+821098681464088756477802684228806339233239542587316254618680\
+197563613907079766830481997222017010585267442240109888818022\
+189543438116245170584546472752661417773021275082355242554950\
+776248474101880875363872607989624146320823364146896124171892\
+610744237622308266702265704492674694505399997330424978964704\
+335411125839490463131661420668167686151828553033363555080508\
+484934542727634080467233927879117726432283352324546435315312\
+937809651095964197873430398662003709663353962932921239516263\
+008572512558260093668527782388349282015308359304941505110445\
+043762021191469060607078792635897736408141163554429972292873\
+575169264387977130124003958599909776720759582995017519144111\
+001778329839793855454688442046155253818724410472281602421363\
+580613990749181808302947976045417884436271162664776148749463\
+202753814797191206392480969096910387729527305862739806702349\
+088455828380471306603628636563037414688265702108098430515297\
+645997107159687247830496686980315376091511219227376708389862\
+310190633134517040835432587726931910775044780329777051964574\
+763119639404235797665922677433332402402817037657141926646502\
+612388421085254756323737273178774331073924707711575555193153\
+421957126062196520952920611871114861423032687425262323243276\
+848595495133802591437804984986053892365334900647137137197585\
+161954823956838391108748154877098567190695813394392779995887\
+642254413740232692940887236351533691174492514884514265006822\
+752026136435469700291628942927286843274959781329315250417360\
+438115330104516894597449604875954147108010051910197388860417\
+003307595774863477182911525109554542883460240867674794470854\
+883815424039187014069246137704710366577005576311674384079810\
+437206511282792194562503036151028910065418370565117488062226\
+073975854919243439941741016447206284543777826080409075756028\
+194465562812076645422284670475730922346454505830553174377950\
+824178034708147037448871898963699023373821217419560423459358\
+846127232531421552826545954362386431279626917642725181802754\
+271134597856231805666129524101509582941585421888561296839474\
+232056474112935379177434928227554149402642893913492062781246\
+372611175305462271711931011635602039137701669573065960945871\
+579420683440097179831368317352157202215160682058878025153007\
+184185319863451652087375936651004559837502483808090613073982\
+264685620351993519454344577635257452328683726988824705474397\
+398247190812883071734743260426540123481791283782928972842466\
+595210269414219040901793935553872090377394005932597887081359\
+481915849178541128182923272843218513093012167744690818603663\
+862691727272565325057703378827553284852502067686026850339624\
+401046086817036618366842240024522042069888708534827471235203\
+998932259309110942367856287784097166420437430118381247339347\
+418156902369282431197735078016591613063918260343498992697002\
+033186558413655576703389208301203552157755701852051877927864\
+696515420369217703510602759815252574799728706795849558382877\
+392016396900560101736741462690753991602263974212137632508984\
+264559315540891383192361601189350414311358816980975697568561\
+515680971830107704152657284552920241862730125888825702301035\
+564615759615882010733764341109834449576907982406265803484111\
+303615971297609065271517286111839839646343815364461776394273\
+571391219315553915335300622295196577640884201524657614065743\
+729121754460652975075990012786021662416077757235487562550381\
+116824006014440438178253273174734436163638119532295383351135\
+543170811596051785036366846773285937845231974424475418970517\
+659179798069972876889488877627309887323737590814875050457317\
+809625163713227973229002908003491739085115971899606986738405\
+752463436186745107821032315480693516006251388789902053863235\
+071957895722121876262598833823352290042576488238120724072267\
+480348425637199003147760378463243043407534395221882144887315\
+875876025907739792297575795373506429192468470170038312050500\
+917665707583420927303790875332407805094505665159755210495266\
+485594187244922216154283213688032393939401426499517609275128\
+062067355172333120857796045387692492375534056470145301671359\
+016602832469675123108598588424022216759334733452626330303791\
+660952659036162827509451468771297954737165701921676834866994\
+084496268491510599580714458155026746676860790028899722645883\
+679435969902046442373108472951515492761911884847211825930115\
+654927539118088350255959445076757398298893380662248358210075\
+297702191186519614515280395341723177201383862827129721649638\
+274531314762377778754560119397123180107310216608157141828379\
+259328274508467371717057031104537750450228447941619684073375\
+630517322006118640290925241602376256334414376495602911265450\
+165889418372161719063670619610214632774542741157366426747861\
+054811449449004970132668146607323502760146957586465275981090\
+328336256381187450646030492071694516054712444513961269623339\
+705411366337817643269316717217432478812002049894979925260411\
+553651385384826214231392012841425936827944383266227115236029\
+717393064659821056467446870597828757433936024422511537561864\
+619865595955628070343780472634463916608440151554502790128417\
+277259492437005696576453717387309605129939526661181496994297\
+244693710437436581443653555343763817246961834486181294985455\
+884981266421533438177271809310897035958260776218253097858601\
+160643120653927024652834025146166356877731266566437231429061\
+099807825113272551869352908241073955695854354852545370793609\
+838167127357752579007490955536081388103461735071174567636929\
+060824172375010035497010614957197713919909924635906503348016\
+450952475530978921242656498701313530533991692867619886826204\
+706468476070943378163577235406861262755114909606255628375659\
+196050370661430148107216310635729360112021571291096278032076\
+401092225373270173950575377792566872113768085940991929655824\
+050914085013970861399015141010432835406337266746706727481946\
+196898882472095111505210339933002505227334750020285673634670\
+738458390159933494226851499935336922036551687169140582574153\
+726872453800858360764892975201757027862632615130256075468549\
+502839367841926212872731925042838691319757663382746471782087\
+828988857978192483595747889021081459460627705275735868618724\
+958783348362295106875556443770626864591972089881215465141073\
+516646930158996569747675806719463602045230325049794904894739\
+988312727573320971310488326486213061839843830003145873279435\
+454121817918269218294901387830156432148142381592864575229119\
+479029130050663564889172093067341444164942736885872753984012\
+865743421266470861425283889134636885790293235727017788606167\
+560012477186697069994213912998550931078617189790771376702549\
+055361745205232419031423044366971378594392952093464046441667\
+117613906203494872209149396518971207279263883566606774353236\
+255473603377861613942239543893894460581170658088042083661404\
+937465706659424639301296621963906278930754459296017486063079\
+582024995485338893699574289806529424673393810217577605952909\
+491283123179789154639057105774960699934999681018155749261864\
+012821574480758746632022143860041252142846691648490809250856\
+327057133540568617791625295314357533564192304930155735301757\
+457531580062662693966772497728335047637869054460240023262262\
+260698443946964564691259441706490611176164305693669515767804\
+836460521205954731752583848846525153811934541997962775215961\
+180346397456122329133421016560406277159258781706172834569862\
+946953007793254152187010227976038449980797987728559041018441\
+590564594738308310579014597893182017151615208050090318483536\
+106249131918576316944251537092347119867433735046169725181104\
+507590928834713669184230634083190791725243913641206256399101\
+550966117564795555149420011152858441084271411289366093158722\
+254752761637144762690747726313899449121995142565661043193165\
+353010677613760383307839362361625628371456344409245507081913\
+518237257141164239966660785903970075181826808229440731778746\
+830751045427285945936163931997929399708401851740705527023711\
+492262489476846435969872480702228386506357017948329114555484\
+164760105906717855684788039081591713778852802032849601308169\
+832017420608399347713424218434541771868442189843417628618330\
+607429739733739437863581804003482214082370567967330530446020\
+897773385726872912189813323094415093143437550397556262780011\
+208941731420098754319961419532567861629590267320403217607660\
+774125374101195389953895035347940170148097810952083736798564\
+420421622607993390894450932047257403433908665884124601384175\
+012387617430467934818665777122459487877479257747635172691688\
+471574765285820096075133353869554987216398800026453207557923\
+535966131756358352198875705382763163680830588056974671628368\
+719411827591592806044707764658145625683998557872894583705117\
+936257144994734815912058252772021032081682437093280526665192\
+728869800954748014250481042845426151143544474372887617562791\
+409866964806319608280819816846942058817381943129762034507591\
+367065185343216917751414811188645979508942996964383255432999\
+246119971295726296202396921903289017490293595312645036697141\
+581149988784499288560584613793415358537364677872496224892098\
+940856692342358755626519304557946447004033186014602147449599\
+351317079758304444877174136521487256811625263467410007624215\
+856145392339552689565690577293133060124853654497575571509576\
+408069646196646757505249296126372820539234090564691695806544\
+715766025588258581902342311480969412221466852421842650484494\
+063894865891424563992751226230317059592413191308470146226366\
+458233536657973376067140793776369412191789801225320255079444\
+592709005698858098716107025188986428347407279053266600044521\
+079987989879536957560131070100060050673537683871138182387904\
+590837539252425985326631955455857258818756188063697492342550\
+045277400125480079927908846850898283905756532829762950509886\
+991675925213188409911532242068610889478326451513981115020992\
+630395715520350039372702741107911736947893709538471200363740\
+669304116845653259038102180504837110789645359520309929381266\
+271463740502507456882882255788069710715770802338317704510793\
+279398576163709512326095306022330346997717688118726634628650\
+675984237916551201500684504118483305560295744746257951860545\
+390826531622290588364837980034428055971370065573420370270905\
+592141420051502465016793525150950140243606137664910359769114\
+512792293426708006440346732679574519594848136194781488696994\
+267355775509666977187349644291823026624985531726865131782364\
+428380093055155988532106121916567178604128111080322761213573\
+781334480667563871257352254033032675246444238637990062075058\
+819854494711379915549313390179300091783493496822950479766923\
+983305064901026858870340863556799948310622536592472509634484\
+910640735459644047154918467543140024764605449756679450446473\
+048922824617117723876384637412932380635306714345354710568410\
+140587435077620501285599837051978855056335305570615129711860\
+309387503970812843734718712815925040263182888714533431137355\
+255722368962836390856001176889513153529416105504464217522618\
+741534232432067776306691118141998014985541610448993152948945\
+865983354717289054861249734477980864059509622993770525110616\
+313865830823478927462500895844216364365499438449134659145333\
+799994034010282254566331595018205841080487728993632798168070\
+476921205941768965021887178681810499301253039335978279707627\
+295287697256489961179958946847840431902105306618594831078534\
+622089641993900896756734276531931450266972752637997248151974\
+2277811246822238899767398834228515625001e-4951L;
+/* 0x1.8p-16445 */
+static const long double ld2ae = 0x1p-16445L, ld2be = 0x2p-16445L, ld2ce = 0x2p-16445L;
+static const long double ld2a =
+5.4677992978237119037926089004291297245985762235403450155814\
+707305425575329500966052143410629387408077958710210208052966\
+529504784489330482549602621133847135082257338717668975178538\
+378957084503396349323438489751160934104796903302909028868611\
+999312592165232778075745690821530731336739429587895774023213\
+939331012985331912661021188896306095323395084578542200319963\
+179359407180003251440084380484161504585462684082946932782829\
+488183829817567452314437076943950532707791252404699268678810\
+198502871250235796855577909830559749628817599194837522029036\
+891995648803056846354520653635957919882905363521007017169741\
+463296044392266269433408052686419017699718627761948763856040\
+592690841721239300491445991666051031755802326720329666454066\
+568630314348735511753639418257984253319063825247065727664852\
+328745422305642626091617823968872438962470092440688372515677\
+832232712866924800106797113478024083516199991991274936894113\
+006233377518471389394984262004503058455485659100090665241525\
+454803628182902241401701783637353179296850056973639305945938\
+813428953287892593620291195986011128990061888798763718548789\
+025717537674780281005583347165047846045925077914824515331335\
+131286063574407181821236377907693209224423490663289916878620\
+725507793163931390372011875799729330162278748985052557432333\
+005334989519381566364065326138465761456173231416844807264090\
+741841972247545424908843928136253653308813487994328446248389\
+608261444391573619177442907290731163188581917588219420107047\
+265367485141413919810885909689112244064797106324295291545892\
+937991321479061743491490060940946128274533657682130125169586\
+930571899403551122506297763180795732325134340989331155893724\
+289358918212707392997768032299997207208451112971425779939507\
+837165263255764268971211819536322993221774123134726665579460\
+265871378186589562858761835613344584269098062275786969729830\
+545786485401407774313414954958161677096004701941411411592755\
+485864471870515173326244464631295701572087440183178339987662\
+926763241220698078822661709054601073523477544653542795020468\
+256078409306409100874886828781860529824879343987945751252081\
+314345990313550683792348814627862441324030155730592166581251\
+009922787324590431548734575328663628650380722603024383412564\
+651446272117561042207738413114131099731016728935023152239431\
+311619533848376583687509108453086730196255111695352464186678\
+221927564757730319825223049341618853631333478241227227268084\
+583396688436229936266854011427192767039363517491659523133852\
+472534104124441112346615696891097070121463652258681270378076\
+538381697594264658479637863087159293838880752928175545408262\
+813403793568695416998388572304528748824756265665683890518422\
+696169422338806137532304784682662448207928681740476188343739\
+117833525916386815135793034906806117413105008719197882837614\
+738262050320291539494104952056471606645482046176634075459021\
+552555959590354956262127809953013679512507451424271839221946\
+794056861055980558363033732905772356986051180966474116423192\
+194741572438649215204229781279620370445373851348786918527399\
+785630808242657122705381806661616271132182017797793661244078\
+445747547535623384548769818529655539279036503234072455810991\
+588075181817695975173110136482659854557506203058080551018873\
+203138260451109855100526720073566126209666125604482413705611\
+996796777927332827103568863352291499261312290355143742018042\
+254470707107847293593205234049774839191754781030496978091006\
+099559675240966730110167624903610656473267105556155633783594\
+089546261107653110531808279445757724399186120387548675148632\
+176049190701680305210224388072261974806791922636412897526952\
+793677946622674149577084803568051242934076450942927092705684\
+547042915490323112457971853658760725588190377666477106903106\
+693847278847646032201293023329503348730723947218797410452333\
+910847913892827195814551858335519518939031446093385329182820\
+714173657946661746005901866885589732922652604573972842197231\
+187365263381958925227970038358064987248233271706462687651143\
+350472018043321314534759819524203308490914358596886150053406\
+629512434788155355109100540319857813535695923273426256911552\
+977539394209918630668466632881929661971212772444625151371953\
+428875491139683919687008724010475217255347915698820960215217\
+257390308560235323463096946442080548018754166369706161589705\
+215873687166365628787796501470056870127729464714362172216802\
+441045276911597009443281135389729130222603185665646434661947\
+627628077723219376892727386120519287577405410510114936151502\
+752997122750262781911372625997223415283516995479265631485799\
+456782561734766648462849641064097181818204279498552827825384\
+186202065516999362573388136163077477126602169410435905014077\
+049808497409025369325795765272066650278004200357878990911374\
+982857977108488482528354406313893864211497105765030504600982\
+253488805474531798742143374465080240030582370086699167937651\
+038307909706139327119325418854546478285735654541635477790346\
+964782617354265050767878335230272194896680141986745074630225\
+893106573559558843545841186025169531604151588481389164948914\
+823593944287133336263680358191369540321930649824471425485137\
+777984823525402115151171093313613251350685343824859052220126\
+891551966018355920872775724807128769003243129486808733796350\
+497668255116485157191011858830643898323628223472099280243583\
+164434348347014910398004439821970508280440872759395827943270\
+985008769143562351938091476215083548164137333541883808870019\
+116234099013452929807950151652297436436006149684939775781234\
+660954156154478642694176038524277810483833149798681345708089\
+152179193979463169402340611793486272301808073267534612685593\
+859596787866884211031341417903391749825320454663508370385251\
+831778477311017089729361152161928815389818579983544490982891\
+734081131312309744330960666031291451740885503458543884956367\
+654943799264600314531815427932691107874782328654759293575803\
+481929361961781073958502075438499070633193799699311694287183\
+299423475339817655608058724723221867087563064557636112380829\
+514501382073257737022472866608244164310385205213523702910787\
+182472517125030106491031844871593141759729773907719510044049\
+352857426592936763727969496103940591601975078602859660478614\
+119405428212830134490731706220583788265344728818766885126977\
+588151111984290444321648931907188080336064713873288834096229\
+203276676119810521851726133377700616341304257822975788967472\
+152742255041912584197045423031298506219011800240120182445838\
+590696647416285334515631019799007515682004250060857020904012\
+215375170479800482680554499806010766109655061507421747722461\
+180617361402575082294678925605271083587897845390768226405648\
+508518103525778638618195775128516073959272990148239415346263\
+486966573934577450787243667063244378381883115827207605856174\
+876350045086885320626669331311880593775916269643646395423220\
+549940790476989709243027420158390806135690975149384714684219\
+964938182719962913931464979458639185519531490009437619838306\
+362365453754807654884704163490469296444427144778593725687358\
+437087390151990694667516279202024332494828210657618261952038\
+597230263799412584275851667403910657370879707181053365818502\
+680037431560091209982641738995652793235851569372314130107647\
+166085235615697257094269133100914135783178856280392139325001\
+352841718610484616627448189556913621837791650699820323059708\
+766420810133584841826718631681683381743511974264126250984214\
+812397119978273917903889865891718836792263377888052458189238\
+746074986456016681098722869419588274020181430652732817858728\
+473849369539367463917171317324882099804999043054467247785592\
+038464723442276239896066431580123756428540074945472427752568\
+981171400621705853374875885943072600692576914790467205905272\
+372594740187988081900317493185005142913607163380720069786786\
+782095331840893694073778325119471833528492917081008547303414\
+509381563617864195257751546539575461435803625993888325647883\
+541039192368366987400263049681218831477776345118518503709588\
+840859023379762456561030683928115349942393963185677123055324\
+771693784214924931737043793679546051454845624150270955450608\
+318747395755728950832754611277041359602301205138509175543313\
+522772786504141007552691902249572375175731740923618769197304\
+652898352694386665448260033458575323252814233868098279476166\
+764258284911434288072243178941698347365985427696983129579496\
+059032032841281149923518087084876885114369033227736521245740\
+554711771423492719899982357711910225545480424688322195336240\
+492253136281857837808491795993788199125205555222116581071134\
+476787468430539307909617442106685159519071053844987343666452\
+494280317720153567054364117244775141336558406098548803924509\
+496052261825198043140272655303625315605326569530252885854991\
+822289219201218313590745412010446642247111703901991591338062\
+693320157180618736569439969283245279430312651192668788340033\
+626825194260296262959884258597703584888770801961209652822982\
+322376122303586169861685106043820510444293432856251210395693\
+261264867823980172683352796141772210301725997652373804152525\
+037162852291403804455997331367378463632437773242905518075065\
+414724295857460288225400061608664961649196400079359622673770\
+607898395269075056596627116148289491042491764170924014885106\
+158235482774778418134123293974436877051995673618683751115353\
+808771434984204447736174758316063096245047311279841579995578\
+186609402864244042751443128536278453430633423118662852688374\
+229600894418958824842459450540826176452145829389286103522774\
+101195556029650753254244433565937938526828990893149766298997\
+738359913887178888607190765709867052470880785937935110091424\
+743449966353497865681753841380246075612094033617488674676296\
+822570077027076266879557913673839341012099558043806442348798\
+053951239274913334631522409564461770434875790402230022872647\
+568436177018658068697071731879399180374560963492726714528729\
+224208938589940272515747888379118461617702271694075087419634\
+147298076764775745707026934442908236664400557265527951453482\
+191684597674273691978253678690951178777239573925410438679099\
+374700609973920128201422381329108236575369403675960765238333\
+778127017096574296148321075566959285042221837159799800133563\
+239963969638610872680393210300180152020613051613414547163713\
+772512617757277955979895866367571776456268564191092477027650\
+135832200376440239783726540552694851717269598489288851529660\
+975027775639565229734596726205832668434979354541943345062977\
+891187146561050118118108223323735210843681128615413601091222\
+007912350536959777114306541514511332368936078560929788143798\
+814391221507522370648646767364209132147312407014953113532379\
+838195728491128536978285918066991040993153064356179903885952\
+027952713749653604502053512355449916680887234238773855581636\
+172479594866871765094513940103284167914110196720261110812716\
+776424260154507395050380575452850420730818412994731079307343\
+538376880280124019321040198038723558784544408584344466090982\
+802067326529000931562048932875469079874956595180595395347093\
+285140279165467965596318365749701535812384333240968283640721\
+344003442002691613772056762099098025739332715913970186225176\
+459563484134139746647940170537900275350480490468851439300771\
+949915194703080576611022590670399844931867609777417528903454\
+731922206378932141464755402629420074293816349270038351339419\
+146768473851353171629153912238797141905920143036064131705230\
+421762305232861503856799511155936565169005916711845389135580\
+928162511912438531204156138447775120789548666143600293412065\
+767167106888509172568003530668539460588248316513392652567856\
+224602697296203328920073354425994044956624831346979458846837\
+597950064151867164583749203433942592178528868981311575331848\
+941597492470436782387502687532649093096498315347403977436001\
+399982102030846763698994785054617523241463186980898394504211\
+430763617825306895065661536045431497903759118007934839122881\
+885863091769469883539876840543521295706315919855784493235603\
+866268925981702690270202829595794350800918257913991744455922\
+6833433740466716699302196502685546874999e-4951L;
+static const long double ld2b =
+5.4677992978237119037926089004291297245985762235403450155814\
+707305425575329500966052143410629387408077958710210208052966\
+529504784489330482549602621133847135082257338717668975178538\
+378957084503396349323438489751160934104796903302909028868611\
+999312592165232778075745690821530731336739429587895774023213\
+939331012985331912661021188896306095323395084578542200319963\
+179359407180003251440084380484161504585462684082946932782829\
+488183829817567452314437076943950532707791252404699268678810\
+198502871250235796855577909830559749628817599194837522029036\
+891995648803056846354520653635957919882905363521007017169741\
+463296044392266269433408052686419017699718627761948763856040\
+592690841721239300491445991666051031755802326720329666454066\
+568630314348735511753639418257984253319063825247065727664852\
+328745422305642626091617823968872438962470092440688372515677\
+832232712866924800106797113478024083516199991991274936894113\
+006233377518471389394984262004503058455485659100090665241525\
+454803628182902241401701783637353179296850056973639305945938\
+813428953287892593620291195986011128990061888798763718548789\
+025717537674780281005583347165047846045925077914824515331335\
+131286063574407181821236377907693209224423490663289916878620\
+725507793163931390372011875799729330162278748985052557432333\
+005334989519381566364065326138465761456173231416844807264090\
+741841972247545424908843928136253653308813487994328446248389\
+608261444391573619177442907290731163188581917588219420107047\
+265367485141413919810885909689112244064797106324295291545892\
+937991321479061743491490060940946128274533657682130125169586\
+930571899403551122506297763180795732325134340989331155893724\
+289358918212707392997768032299997207208451112971425779939507\
+837165263255764268971211819536322993221774123134726665579460\
+265871378186589562858761835613344584269098062275786969729830\
+545786485401407774313414954958161677096004701941411411592755\
+485864471870515173326244464631295701572087440183178339987662\
+926763241220698078822661709054601073523477544653542795020468\
+256078409306409100874886828781860529824879343987945751252081\
+314345990313550683792348814627862441324030155730592166581251\
+009922787324590431548734575328663628650380722603024383412564\
+651446272117561042207738413114131099731016728935023152239431\
+311619533848376583687509108453086730196255111695352464186678\
+221927564757730319825223049341618853631333478241227227268084\
+583396688436229936266854011427192767039363517491659523133852\
+472534104124441112346615696891097070121463652258681270378076\
+538381697594264658479637863087159293838880752928175545408262\
+813403793568695416998388572304528748824756265665683890518422\
+696169422338806137532304784682662448207928681740476188343739\
+117833525916386815135793034906806117413105008719197882837614\
+738262050320291539494104952056471606645482046176634075459021\
+552555959590354956262127809953013679512507451424271839221946\
+794056861055980558363033732905772356986051180966474116423192\
+194741572438649215204229781279620370445373851348786918527399\
+785630808242657122705381806661616271132182017797793661244078\
+445747547535623384548769818529655539279036503234072455810991\
+588075181817695975173110136482659854557506203058080551018873\
+203138260451109855100526720073566126209666125604482413705611\
+996796777927332827103568863352291499261312290355143742018042\
+254470707107847293593205234049774839191754781030496978091006\
+099559675240966730110167624903610656473267105556155633783594\
+089546261107653110531808279445757724399186120387548675148632\
+176049190701680305210224388072261974806791922636412897526952\
+793677946622674149577084803568051242934076450942927092705684\
+547042915490323112457971853658760725588190377666477106903106\
+693847278847646032201293023329503348730723947218797410452333\
+910847913892827195814551858335519518939031446093385329182820\
+714173657946661746005901866885589732922652604573972842197231\
+187365263381958925227970038358064987248233271706462687651143\
+350472018043321314534759819524203308490914358596886150053406\
+629512434788155355109100540319857813535695923273426256911552\
+977539394209918630668466632881929661971212772444625151371953\
+428875491139683919687008724010475217255347915698820960215217\
+257390308560235323463096946442080548018754166369706161589705\
+215873687166365628787796501470056870127729464714362172216802\
+441045276911597009443281135389729130222603185665646434661947\
+627628077723219376892727386120519287577405410510114936151502\
+752997122750262781911372625997223415283516995479265631485799\
+456782561734766648462849641064097181818204279498552827825384\
+186202065516999362573388136163077477126602169410435905014077\
+049808497409025369325795765272066650278004200357878990911374\
+982857977108488482528354406313893864211497105765030504600982\
+253488805474531798742143374465080240030582370086699167937651\
+038307909706139327119325418854546478285735654541635477790346\
+964782617354265050767878335230272194896680141986745074630225\
+893106573559558843545841186025169531604151588481389164948914\
+823593944287133336263680358191369540321930649824471425485137\
+777984823525402115151171093313613251350685343824859052220126\
+891551966018355920872775724807128769003243129486808733796350\
+497668255116485157191011858830643898323628223472099280243583\
+164434348347014910398004439821970508280440872759395827943270\
+985008769143562351938091476215083548164137333541883808870019\
+116234099013452929807950151652297436436006149684939775781234\
+660954156154478642694176038524277810483833149798681345708089\
+152179193979463169402340611793486272301808073267534612685593\
+859596787866884211031341417903391749825320454663508370385251\
+831778477311017089729361152161928815389818579983544490982891\
+734081131312309744330960666031291451740885503458543884956367\
+654943799264600314531815427932691107874782328654759293575803\
+481929361961781073958502075438499070633193799699311694287183\
+299423475339817655608058724723221867087563064557636112380829\
+514501382073257737022472866608244164310385205213523702910787\
+182472517125030106491031844871593141759729773907719510044049\
+352857426592936763727969496103940591601975078602859660478614\
+119405428212830134490731706220583788265344728818766885126977\
+588151111984290444321648931907188080336064713873288834096229\
+203276676119810521851726133377700616341304257822975788967472\
+152742255041912584197045423031298506219011800240120182445838\
+590696647416285334515631019799007515682004250060857020904012\
+215375170479800482680554499806010766109655061507421747722461\
+180617361402575082294678925605271083587897845390768226405648\
+508518103525778638618195775128516073959272990148239415346263\
+486966573934577450787243667063244378381883115827207605856174\
+876350045086885320626669331311880593775916269643646395423220\
+549940790476989709243027420158390806135690975149384714684219\
+964938182719962913931464979458639185519531490009437619838306\
+362365453754807654884704163490469296444427144778593725687358\
+437087390151990694667516279202024332494828210657618261952038\
+597230263799412584275851667403910657370879707181053365818502\
+680037431560091209982641738995652793235851569372314130107647\
+166085235615697257094269133100914135783178856280392139325001\
+352841718610484616627448189556913621837791650699820323059708\
+766420810133584841826718631681683381743511974264126250984214\
+812397119978273917903889865891718836792263377888052458189238\
+746074986456016681098722869419588274020181430652732817858728\
+473849369539367463917171317324882099804999043054467247785592\
+038464723442276239896066431580123756428540074945472427752568\
+981171400621705853374875885943072600692576914790467205905272\
+372594740187988081900317493185005142913607163380720069786786\
+782095331840893694073778325119471833528492917081008547303414\
+509381563617864195257751546539575461435803625993888325647883\
+541039192368366987400263049681218831477776345118518503709588\
+840859023379762456561030683928115349942393963185677123055324\
+771693784214924931737043793679546051454845624150270955450608\
+318747395755728950832754611277041359602301205138509175543313\
+522772786504141007552691902249572375175731740923618769197304\
+652898352694386665448260033458575323252814233868098279476166\
+764258284911434288072243178941698347365985427696983129579496\
+059032032841281149923518087084876885114369033227736521245740\
+554711771423492719899982357711910225545480424688322195336240\
+492253136281857837808491795993788199125205555222116581071134\
+476787468430539307909617442106685159519071053844987343666452\
+494280317720153567054364117244775141336558406098548803924509\
+496052261825198043140272655303625315605326569530252885854991\
+822289219201218313590745412010446642247111703901991591338062\
+693320157180618736569439969283245279430312651192668788340033\
+626825194260296262959884258597703584888770801961209652822982\
+322376122303586169861685106043820510444293432856251210395693\
+261264867823980172683352796141772210301725997652373804152525\
+037162852291403804455997331367378463632437773242905518075065\
+414724295857460288225400061608664961649196400079359622673770\
+607898395269075056596627116148289491042491764170924014885106\
+158235482774778418134123293974436877051995673618683751115353\
+808771434984204447736174758316063096245047311279841579995578\
+186609402864244042751443128536278453430633423118662852688374\
+229600894418958824842459450540826176452145829389286103522774\
+101195556029650753254244433565937938526828990893149766298997\
+738359913887178888607190765709867052470880785937935110091424\
+743449966353497865681753841380246075612094033617488674676296\
+822570077027076266879557913673839341012099558043806442348798\
+053951239274913334631522409564461770434875790402230022872647\
+568436177018658068697071731879399180374560963492726714528729\
+224208938589940272515747888379118461617702271694075087419634\
+147298076764775745707026934442908236664400557265527951453482\
+191684597674273691978253678690951178777239573925410438679099\
+374700609973920128201422381329108236575369403675960765238333\
+778127017096574296148321075566959285042221837159799800133563\
+239963969638610872680393210300180152020613051613414547163713\
+772512617757277955979895866367571776456268564191092477027650\
+135832200376440239783726540552694851717269598489288851529660\
+975027775639565229734596726205832668434979354541943345062977\
+891187146561050118118108223323735210843681128615413601091222\
+007912350536959777114306541514511332368936078560929788143798\
+814391221507522370648646767364209132147312407014953113532379\
+838195728491128536978285918066991040993153064356179903885952\
+027952713749653604502053512355449916680887234238773855581636\
+172479594866871765094513940103284167914110196720261110812716\
+776424260154507395050380575452850420730818412994731079307343\
+538376880280124019321040198038723558784544408584344466090982\
+802067326529000931562048932875469079874956595180595395347093\
+285140279165467965596318365749701535812384333240968283640721\
+344003442002691613772056762099098025739332715913970186225176\
+459563484134139746647940170537900275350480490468851439300771\
+949915194703080576611022590670399844931867609777417528903454\
+731922206378932141464755402629420074293816349270038351339419\
+146768473851353171629153912238797141905920143036064131705230\
+421762305232861503856799511155936565169005916711845389135580\
+928162511912438531204156138447775120789548666143600293412065\
+767167106888509172568003530668539460588248316513392652567856\
+224602697296203328920073354425994044956624831346979458846837\
+597950064151867164583749203433942592178528868981311575331848\
+941597492470436782387502687532649093096498315347403977436001\
+399982102030846763698994785054617523241463186980898394504211\
+430763617825306895065661536045431497903759118007934839122881\
+885863091769469883539876840543521295706315919855784493235603\
+866268925981702690270202829595794350800918257913991744455922\
+6833433740466716699302196502685546875e-4951L;
+static const long double ld2c =
+5.4677992978237119037926089004291297245985762235403450155814\
+707305425575329500966052143410629387408077958710210208052966\
+529504784489330482549602621133847135082257338717668975178538\
+378957084503396349323438489751160934104796903302909028868611\
+999312592165232778075745690821530731336739429587895774023213\
+939331012985331912661021188896306095323395084578542200319963\
+179359407180003251440084380484161504585462684082946932782829\
+488183829817567452314437076943950532707791252404699268678810\
+198502871250235796855577909830559749628817599194837522029036\
+891995648803056846354520653635957919882905363521007017169741\
+463296044392266269433408052686419017699718627761948763856040\
+592690841721239300491445991666051031755802326720329666454066\
+568630314348735511753639418257984253319063825247065727664852\
+328745422305642626091617823968872438962470092440688372515677\
+832232712866924800106797113478024083516199991991274936894113\
+006233377518471389394984262004503058455485659100090665241525\
+454803628182902241401701783637353179296850056973639305945938\
+813428953287892593620291195986011128990061888798763718548789\
+025717537674780281005583347165047846045925077914824515331335\
+131286063574407181821236377907693209224423490663289916878620\
+725507793163931390372011875799729330162278748985052557432333\
+005334989519381566364065326138465761456173231416844807264090\
+741841972247545424908843928136253653308813487994328446248389\
+608261444391573619177442907290731163188581917588219420107047\
+265367485141413919810885909689112244064797106324295291545892\
+937991321479061743491490060940946128274533657682130125169586\
+930571899403551122506297763180795732325134340989331155893724\
+289358918212707392997768032299997207208451112971425779939507\
+837165263255764268971211819536322993221774123134726665579460\
+265871378186589562858761835613344584269098062275786969729830\
+545786485401407774313414954958161677096004701941411411592755\
+485864471870515173326244464631295701572087440183178339987662\
+926763241220698078822661709054601073523477544653542795020468\
+256078409306409100874886828781860529824879343987945751252081\
+314345990313550683792348814627862441324030155730592166581251\
+009922787324590431548734575328663628650380722603024383412564\
+651446272117561042207738413114131099731016728935023152239431\
+311619533848376583687509108453086730196255111695352464186678\
+221927564757730319825223049341618853631333478241227227268084\
+583396688436229936266854011427192767039363517491659523133852\
+472534104124441112346615696891097070121463652258681270378076\
+538381697594264658479637863087159293838880752928175545408262\
+813403793568695416998388572304528748824756265665683890518422\
+696169422338806137532304784682662448207928681740476188343739\
+117833525916386815135793034906806117413105008719197882837614\
+738262050320291539494104952056471606645482046176634075459021\
+552555959590354956262127809953013679512507451424271839221946\
+794056861055980558363033732905772356986051180966474116423192\
+194741572438649215204229781279620370445373851348786918527399\
+785630808242657122705381806661616271132182017797793661244078\
+445747547535623384548769818529655539279036503234072455810991\
+588075181817695975173110136482659854557506203058080551018873\
+203138260451109855100526720073566126209666125604482413705611\
+996796777927332827103568863352291499261312290355143742018042\
+254470707107847293593205234049774839191754781030496978091006\
+099559675240966730110167624903610656473267105556155633783594\
+089546261107653110531808279445757724399186120387548675148632\
+176049190701680305210224388072261974806791922636412897526952\
+793677946622674149577084803568051242934076450942927092705684\
+547042915490323112457971853658760725588190377666477106903106\
+693847278847646032201293023329503348730723947218797410452333\
+910847913892827195814551858335519518939031446093385329182820\
+714173657946661746005901866885589732922652604573972842197231\
+187365263381958925227970038358064987248233271706462687651143\
+350472018043321314534759819524203308490914358596886150053406\
+629512434788155355109100540319857813535695923273426256911552\
+977539394209918630668466632881929661971212772444625151371953\
+428875491139683919687008724010475217255347915698820960215217\
+257390308560235323463096946442080548018754166369706161589705\
+215873687166365628787796501470056870127729464714362172216802\
+441045276911597009443281135389729130222603185665646434661947\
+627628077723219376892727386120519287577405410510114936151502\
+752997122750262781911372625997223415283516995479265631485799\
+456782561734766648462849641064097181818204279498552827825384\
+186202065516999362573388136163077477126602169410435905014077\
+049808497409025369325795765272066650278004200357878990911374\
+982857977108488482528354406313893864211497105765030504600982\
+253488805474531798742143374465080240030582370086699167937651\
+038307909706139327119325418854546478285735654541635477790346\
+964782617354265050767878335230272194896680141986745074630225\
+893106573559558843545841186025169531604151588481389164948914\
+823593944287133336263680358191369540321930649824471425485137\
+777984823525402115151171093313613251350685343824859052220126\
+891551966018355920872775724807128769003243129486808733796350\
+497668255116485157191011858830643898323628223472099280243583\
+164434348347014910398004439821970508280440872759395827943270\
+985008769143562351938091476215083548164137333541883808870019\
+116234099013452929807950151652297436436006149684939775781234\
+660954156154478642694176038524277810483833149798681345708089\
+152179193979463169402340611793486272301808073267534612685593\
+859596787866884211031341417903391749825320454663508370385251\
+831778477311017089729361152161928815389818579983544490982891\
+734081131312309744330960666031291451740885503458543884956367\
+654943799264600314531815427932691107874782328654759293575803\
+481929361961781073958502075438499070633193799699311694287183\
+299423475339817655608058724723221867087563064557636112380829\
+514501382073257737022472866608244164310385205213523702910787\
+182472517125030106491031844871593141759729773907719510044049\
+352857426592936763727969496103940591601975078602859660478614\
+119405428212830134490731706220583788265344728818766885126977\
+588151111984290444321648931907188080336064713873288834096229\
+203276676119810521851726133377700616341304257822975788967472\
+152742255041912584197045423031298506219011800240120182445838\
+590696647416285334515631019799007515682004250060857020904012\
+215375170479800482680554499806010766109655061507421747722461\
+180617361402575082294678925605271083587897845390768226405648\
+508518103525778638618195775128516073959272990148239415346263\
+486966573934577450787243667063244378381883115827207605856174\
+876350045086885320626669331311880593775916269643646395423220\
+549940790476989709243027420158390806135690975149384714684219\
+964938182719962913931464979458639185519531490009437619838306\
+362365453754807654884704163490469296444427144778593725687358\
+437087390151990694667516279202024332494828210657618261952038\
+597230263799412584275851667403910657370879707181053365818502\
+680037431560091209982641738995652793235851569372314130107647\
+166085235615697257094269133100914135783178856280392139325001\
+352841718610484616627448189556913621837791650699820323059708\
+766420810133584841826718631681683381743511974264126250984214\
+812397119978273917903889865891718836792263377888052458189238\
+746074986456016681098722869419588274020181430652732817858728\
+473849369539367463917171317324882099804999043054467247785592\
+038464723442276239896066431580123756428540074945472427752568\
+981171400621705853374875885943072600692576914790467205905272\
+372594740187988081900317493185005142913607163380720069786786\
+782095331840893694073778325119471833528492917081008547303414\
+509381563617864195257751546539575461435803625993888325647883\
+541039192368366987400263049681218831477776345118518503709588\
+840859023379762456561030683928115349942393963185677123055324\
+771693784214924931737043793679546051454845624150270955450608\
+318747395755728950832754611277041359602301205138509175543313\
+522772786504141007552691902249572375175731740923618769197304\
+652898352694386665448260033458575323252814233868098279476166\
+764258284911434288072243178941698347365985427696983129579496\
+059032032841281149923518087084876885114369033227736521245740\
+554711771423492719899982357711910225545480424688322195336240\
+492253136281857837808491795993788199125205555222116581071134\
+476787468430539307909617442106685159519071053844987343666452\
+494280317720153567054364117244775141336558406098548803924509\
+496052261825198043140272655303625315605326569530252885854991\
+822289219201218313590745412010446642247111703901991591338062\
+693320157180618736569439969283245279430312651192668788340033\
+626825194260296262959884258597703584888770801961209652822982\
+322376122303586169861685106043820510444293432856251210395693\
+261264867823980172683352796141772210301725997652373804152525\
+037162852291403804455997331367378463632437773242905518075065\
+414724295857460288225400061608664961649196400079359622673770\
+607898395269075056596627116148289491042491764170924014885106\
+158235482774778418134123293974436877051995673618683751115353\
+808771434984204447736174758316063096245047311279841579995578\
+186609402864244042751443128536278453430633423118662852688374\
+229600894418958824842459450540826176452145829389286103522774\
+101195556029650753254244433565937938526828990893149766298997\
+738359913887178888607190765709867052470880785937935110091424\
+743449966353497865681753841380246075612094033617488674676296\
+822570077027076266879557913673839341012099558043806442348798\
+053951239274913334631522409564461770434875790402230022872647\
+568436177018658068697071731879399180374560963492726714528729\
+224208938589940272515747888379118461617702271694075087419634\
+147298076764775745707026934442908236664400557265527951453482\
+191684597674273691978253678690951178777239573925410438679099\
+374700609973920128201422381329108236575369403675960765238333\
+778127017096574296148321075566959285042221837159799800133563\
+239963969638610872680393210300180152020613051613414547163713\
+772512617757277955979895866367571776456268564191092477027650\
+135832200376440239783726540552694851717269598489288851529660\
+975027775639565229734596726205832668434979354541943345062977\
+891187146561050118118108223323735210843681128615413601091222\
+007912350536959777114306541514511332368936078560929788143798\
+814391221507522370648646767364209132147312407014953113532379\
+838195728491128536978285918066991040993153064356179903885952\
+027952713749653604502053512355449916680887234238773855581636\
+172479594866871765094513940103284167914110196720261110812716\
+776424260154507395050380575452850420730818412994731079307343\
+538376880280124019321040198038723558784544408584344466090982\
+802067326529000931562048932875469079874956595180595395347093\
+285140279165467965596318365749701535812384333240968283640721\
+344003442002691613772056762099098025739332715913970186225176\
+459563484134139746647940170537900275350480490468851439300771\
+949915194703080576611022590670399844931867609777417528903454\
+731922206378932141464755402629420074293816349270038351339419\
+146768473851353171629153912238797141905920143036064131705230\
+421762305232861503856799511155936565169005916711845389135580\
+928162511912438531204156138447775120789548666143600293412065\
+767167106888509172568003530668539460588248316513392652567856\
+224602697296203328920073354425994044956624831346979458846837\
+597950064151867164583749203433942592178528868981311575331848\
+941597492470436782387502687532649093096498315347403977436001\
+399982102030846763698994785054617523241463186980898394504211\
+430763617825306895065661536045431497903759118007934839122881\
+885863091769469883539876840543521295706315919855784493235603\
+866268925981702690270202829595794350800918257913991744455922\
+6833433740466716699302196502685546875001e-4951L;
+/* 0x1.0000000000000001p16383 */
+static const long double ld3ae = 0x1p16383L, ld3be = 0x1p16383L, ld3ce = 0x1.0000000000000002p16383L;
+static const long double ld3a =
+5.9486574767861588257512740011252202817891302594919813725251\
+295428739285541899832559628345030434759848834258858109152060\
+168394580447354320917546191141469316674407503401251826592118\
+529247805068466318759038608659253988075214874609536526621357\
+456531393890166762179915866732524251539065872543957371571521\
+983821811625262362379785274802094595537134203491628334800642\
+100552410980148340419844099304716014319891796892117978584065\
+642215994189779833796388294931075153217985342401232585488548\
+183499573356819649604353341808627018653300000165159821533158\
+398534762310007133107769480816106094590754928301890268526601\
+948012303315011492834812113743989351274355589970363438128551\
+573643438403526566620300559126131289478114044934210031633528\
+263569989916613277150372804081100885766846923338387335735275\
+815690693627425316500993091757924061275520326543377826484801\
+260850814410014200240706874882235908793464063722267631785502\
+588978890438298369667014685160756795261293064179236782450102\
+879817506411379585551974343148401888001113058696688771238532\
+123329163319380775763389985796856252232367435778523577763581\
+076318820356483011816956309162306010784749642144593052844981\
+144455778303480881727480293033710826466852650686573284449164\
+971550815761322623554550767170481569400661823142075309755585\
+825399262942161733431916879499819498306470556518202895225167\
+570891857833504708712937447726161123901897152190727519098753\
+173091256107155059564163182449945325514965354563242034921715\
+085079669416064946957897843700525314730377964740286745952320\
+848539618361767466769711132391357232984948881905511016501295\
+373458116601070538750219227472880922074079367616789330713051\
+392796054620611196686398104309732110578180612371988986941283\
+463409571752839755060102940634838880149410521082372514146698\
+949690555298417297141754693386954049385392552489950059242099\
+158790234260937921119976211248531759522503364724271154732450\
+580204158756703065275680503502538215181617861403909609765438\
+459404741896379126766756324776550060890489522385655907004761\
+103760380176704738464932582597767398552360992261748200224552\
+499221197984163362555822765637968034280918669504609870586242\
+062170049756721980421608552698712778507151233315121277695507\
+694932304894125095195395002291537339548463471343544834535084\
+385597125111888342671654244935921073610595930775193595237994\
+484405470453247603596164707279142831292696020597352513459682\
+982542490819269161229107183625537754125393689567083050306972\
+299472451409351528024124972676859164822379702549840869992122\
+109088558738008051503238314435613116752657081607929379237268\
+685258548361696557803717952234859306922044575896046034219495\
+078937310258307531674502149231702180717812559299741279722940\
+331553164095430990867607708187092707603492795672693661579813\
+722297206006600340954221573260854019342039503980256096723323\
+974619210941227998945120494044519820953637210732374225869479\
+681431453077746347270062554307578221973966755682727685671115\
+104598487346465589917255152859638133529840253249441154093766\
+468296435228729803156904942774237478111621919125582394448948\
+295406406844691902789160843785892192212760482854142616066966\
+061436483840059374641455624686877579416182709686546132337333\
+180030729666859995573465620394353524944034503194887839608451\
+069029644904642077575045157730600577875158390703330602738631\
+860629283284285902868412268522486164537842820453011183015531\
+669082023505889165928251243784395957824980999247118276540195\
+068956031183236585108415603897481193085040746824934727777986\
+761703484626902903260925660927239810711484175954901422619731\
+922057229492660554293614771979793133433085936212830723862399\
+334585740422370252249982159238980361966177481883090934546250\
+903836442278836769393445168381535656636696931116641217099763\
+249205106142470169654056239769609880390474141835446455366216\
+163044493526155530766380018725181852858797332884069215206429\
+253933800732703242020102754246055713369281324885855415528125\
+659581759080256206862639693790603663547070031814664699862085\
+124026740519096394950750536940374610036575208929959836461615\
+919280191863569472772191938255564055565023733812663112274784\
+824733213440763947293874467915896768018331324730250697015099\
+463062533087218087488410166157459583569488345783974179340987\
+151815108212218686575226398710276498737521494877861721916239\
+286780194943271811625644415312213945242110591353818534254974\
+082884162962499579444882831630967263044313008877192427542802\
+154833385005287431176015973444837288763406349559772586733139\
+508290944276618724455216038372331277739377332938820061159422\
+131545699737995079186343848189545551446309662717473667598998\
+332988069951307480469935653061211574846012803370905284012473\
+025318540210297839541696998136885534223864988557670674501375\
+244470147903967779423817060038384764935662497442963759653206\
+786432859777470896394181997456033131032688720696203667198626\
+404895099030068466008555612541561023366202324622483939422567\
+021914882845352467305687811236417567525816955182834161603932\
+993065869465459807593704095390354125514253872107415823725124\
+7263969181695999e+4931L;
+static const long double ld3b =
+5.9486574767861588257512740011252202817891302594919813725251\
+295428739285541899832559628345030434759848834258858109152060\
+168394580447354320917546191141469316674407503401251826592118\
+529247805068466318759038608659253988075214874609536526621357\
+456531393890166762179915866732524251539065872543957371571521\
+983821811625262362379785274802094595537134203491628334800642\
+100552410980148340419844099304716014319891796892117978584065\
+642215994189779833796388294931075153217985342401232585488548\
+183499573356819649604353341808627018653300000165159821533158\
+398534762310007133107769480816106094590754928301890268526601\
+948012303315011492834812113743989351274355589970363438128551\
+573643438403526566620300559126131289478114044934210031633528\
+263569989916613277150372804081100885766846923338387335735275\
+815690693627425316500993091757924061275520326543377826484801\
+260850814410014200240706874882235908793464063722267631785502\
+588978890438298369667014685160756795261293064179236782450102\
+879817506411379585551974343148401888001113058696688771238532\
+123329163319380775763389985796856252232367435778523577763581\
+076318820356483011816956309162306010784749642144593052844981\
+144455778303480881727480293033710826466852650686573284449164\
+971550815761322623554550767170481569400661823142075309755585\
+825399262942161733431916879499819498306470556518202895225167\
+570891857833504708712937447726161123901897152190727519098753\
+173091256107155059564163182449945325514965354563242034921715\
+085079669416064946957897843700525314730377964740286745952320\
+848539618361767466769711132391357232984948881905511016501295\
+373458116601070538750219227472880922074079367616789330713051\
+392796054620611196686398104309732110578180612371988986941283\
+463409571752839755060102940634838880149410521082372514146698\
+949690555298417297141754693386954049385392552489950059242099\
+158790234260937921119976211248531759522503364724271154732450\
+580204158756703065275680503502538215181617861403909609765438\
+459404741896379126766756324776550060890489522385655907004761\
+103760380176704738464932582597767398552360992261748200224552\
+499221197984163362555822765637968034280918669504609870586242\
+062170049756721980421608552698712778507151233315121277695507\
+694932304894125095195395002291537339548463471343544834535084\
+385597125111888342671654244935921073610595930775193595237994\
+484405470453247603596164707279142831292696020597352513459682\
+982542490819269161229107183625537754125393689567083050306972\
+299472451409351528024124972676859164822379702549840869992122\
+109088558738008051503238314435613116752657081607929379237268\
+685258548361696557803717952234859306922044575896046034219495\
+078937310258307531674502149231702180717812559299741279722940\
+331553164095430990867607708187092707603492795672693661579813\
+722297206006600340954221573260854019342039503980256096723323\
+974619210941227998945120494044519820953637210732374225869479\
+681431453077746347270062554307578221973966755682727685671115\
+104598487346465589917255152859638133529840253249441154093766\
+468296435228729803156904942774237478111621919125582394448948\
+295406406844691902789160843785892192212760482854142616066966\
+061436483840059374641455624686877579416182709686546132337333\
+180030729666859995573465620394353524944034503194887839608451\
+069029644904642077575045157730600577875158390703330602738631\
+860629283284285902868412268522486164537842820453011183015531\
+669082023505889165928251243784395957824980999247118276540195\
+068956031183236585108415603897481193085040746824934727777986\
+761703484626902903260925660927239810711484175954901422619731\
+922057229492660554293614771979793133433085936212830723862399\
+334585740422370252249982159238980361966177481883090934546250\
+903836442278836769393445168381535656636696931116641217099763\
+249205106142470169654056239769609880390474141835446455366216\
+163044493526155530766380018725181852858797332884069215206429\
+253933800732703242020102754246055713369281324885855415528125\
+659581759080256206862639693790603663547070031814664699862085\
+124026740519096394950750536940374610036575208929959836461615\
+919280191863569472772191938255564055565023733812663112274784\
+824733213440763947293874467915896768018331324730250697015099\
+463062533087218087488410166157459583569488345783974179340987\
+151815108212218686575226398710276498737521494877861721916239\
+286780194943271811625644415312213945242110591353818534254974\
+082884162962499579444882831630967263044313008877192427542802\
+154833385005287431176015973444837288763406349559772586733139\
+508290944276618724455216038372331277739377332938820061159422\
+131545699737995079186343848189545551446309662717473667598998\
+332988069951307480469935653061211574846012803370905284012473\
+025318540210297839541696998136885534223864988557670674501375\
+244470147903967779423817060038384764935662497442963759653206\
+786432859777470896394181997456033131032688720696203667198626\
+404895099030068466008555612541561023366202324622483939422567\
+021914882845352467305687811236417567525816955182834161603932\
+993065869465459807593704095390354125514253872107415823725124\
+7263969181696e+4931L;
+static const long double ld3c =
+5.9486574767861588257512740011252202817891302594919813725251\
+295428739285541899832559628345030434759848834258858109152060\
+168394580447354320917546191141469316674407503401251826592118\
+529247805068466318759038608659253988075214874609536526621357\
+456531393890166762179915866732524251539065872543957371571521\
+983821811625262362379785274802094595537134203491628334800642\
+100552410980148340419844099304716014319891796892117978584065\
+642215994189779833796388294931075153217985342401232585488548\
+183499573356819649604353341808627018653300000165159821533158\
+398534762310007133107769480816106094590754928301890268526601\
+948012303315011492834812113743989351274355589970363438128551\
+573643438403526566620300559126131289478114044934210031633528\
+263569989916613277150372804081100885766846923338387335735275\
+815690693627425316500993091757924061275520326543377826484801\
+260850814410014200240706874882235908793464063722267631785502\
+588978890438298369667014685160756795261293064179236782450102\
+879817506411379585551974343148401888001113058696688771238532\
+123329163319380775763389985796856252232367435778523577763581\
+076318820356483011816956309162306010784749642144593052844981\
+144455778303480881727480293033710826466852650686573284449164\
+971550815761322623554550767170481569400661823142075309755585\
+825399262942161733431916879499819498306470556518202895225167\
+570891857833504708712937447726161123901897152190727519098753\
+173091256107155059564163182449945325514965354563242034921715\
+085079669416064946957897843700525314730377964740286745952320\
+848539618361767466769711132391357232984948881905511016501295\
+373458116601070538750219227472880922074079367616789330713051\
+392796054620611196686398104309732110578180612371988986941283\
+463409571752839755060102940634838880149410521082372514146698\
+949690555298417297141754693386954049385392552489950059242099\
+158790234260937921119976211248531759522503364724271154732450\
+580204158756703065275680503502538215181617861403909609765438\
+459404741896379126766756324776550060890489522385655907004761\
+103760380176704738464932582597767398552360992261748200224552\
+499221197984163362555822765637968034280918669504609870586242\
+062170049756721980421608552698712778507151233315121277695507\
+694932304894125095195395002291537339548463471343544834535084\
+385597125111888342671654244935921073610595930775193595237994\
+484405470453247603596164707279142831292696020597352513459682\
+982542490819269161229107183625537754125393689567083050306972\
+299472451409351528024124972676859164822379702549840869992122\
+109088558738008051503238314435613116752657081607929379237268\
+685258548361696557803717952234859306922044575896046034219495\
+078937310258307531674502149231702180717812559299741279722940\
+331553164095430990867607708187092707603492795672693661579813\
+722297206006600340954221573260854019342039503980256096723323\
+974619210941227998945120494044519820953637210732374225869479\
+681431453077746347270062554307578221973966755682727685671115\
+104598487346465589917255152859638133529840253249441154093766\
+468296435228729803156904942774237478111621919125582394448948\
+295406406844691902789160843785892192212760482854142616066966\
+061436483840059374641455624686877579416182709686546132337333\
+180030729666859995573465620394353524944034503194887839608451\
+069029644904642077575045157730600577875158390703330602738631\
+860629283284285902868412268522486164537842820453011183015531\
+669082023505889165928251243784395957824980999247118276540195\
+068956031183236585108415603897481193085040746824934727777986\
+761703484626902903260925660927239810711484175954901422619731\
+922057229492660554293614771979793133433085936212830723862399\
+334585740422370252249982159238980361966177481883090934546250\
+903836442278836769393445168381535656636696931116641217099763\
+249205106142470169654056239769609880390474141835446455366216\
+163044493526155530766380018725181852858797332884069215206429\
+253933800732703242020102754246055713369281324885855415528125\
+659581759080256206862639693790603663547070031814664699862085\
+124026740519096394950750536940374610036575208929959836461615\
+919280191863569472772191938255564055565023733812663112274784\
+824733213440763947293874467915896768018331324730250697015099\
+463062533087218087488410166157459583569488345783974179340987\
+151815108212218686575226398710276498737521494877861721916239\
+286780194943271811625644415312213945242110591353818534254974\
+082884162962499579444882831630967263044313008877192427542802\
+154833385005287431176015973444837288763406349559772586733139\
+508290944276618724455216038372331277739377332938820061159422\
+131545699737995079186343848189545551446309662717473667598998\
+332988069951307480469935653061211574846012803370905284012473\
+025318540210297839541696998136885534223864988557670674501375\
+244470147903967779423817060038384764935662497442963759653206\
+786432859777470896394181997456033131032688720696203667198626\
+404895099030068466008555612541561023366202324622483939422567\
+021914882845352467305687811236417567525816955182834161603932\
+993065869465459807593704095390354125514253872107415823725124\
+7263969181696001e+4931L;
+#endif
+
+#if LDBL_MANT_DIG == 113 \
+ && LDBL_MIN_EXP == -16381 \
+ && LDBL_MAX_EXP == 16384
+# define LDBL_OK
+/* 0x0.8p-16494 */
+static const long double ld1ae = 0, ld1be = 0, ld1ce = 0x1p-16494L;
+static const long double ld1a =
+3.2375875597190125554622194791138232762497846690173405048449\
+421945985197700620596855088357456383249701279390707384240598\
+382936099431912710233425550359863089915213963553756674672083\
+673128192358701197242632527769951957277781260855740340354110\
+173441284912381364143945515141786687806740155311932822963199\
+131134959539539338316310328556057915323285980341541664226172\
+265348802632447238304822896568757017013159021750199744350376\
+278243566840330589397015778833566517337174685312047058426075\
+688036665697114219175258344917835835984013214761767520398571\
+735519302688914468501077605843338555214753050109407568139932\
+147308502166696009676987494125921676927574464221699654264839\
+192243410627511520570610765229732327315423820550872393685221\
+676561948307418196052769717057382723931306989375320957256133\
+838073129463951849807075348034900035402513943244599879584009\
+391110011261908615236154859382854977144106096407982738165117\
+693915685918231984764157652755343417097983676870433731452629\
+339981084526616826599425863049784138127555181662391766144738\
+159400253422795753041594932607700680306368857466952063923782\
+760519487592638820793893796669403574411398166619131986561877\
+034635197232626532239192571857518274939275861531537920777299\
+133535479548088762634002006634954143608168633852204577195463\
+389533233992867620995583241321034602255800668175356808869060\
+608582640890741203603916133682748118680676374951545690715916\
+241859799379894025137504643469040366684778763795442214328000\
+375999444991619403217748350277527106812175542863660436614910\
+135938862296156144947361864759321605496309393905421651264941\
+669606814994816518612155298709843817262034769175075602668866\
+926449523554218142013501373514352370369126244144449924971423\
+038024236058971106053649565799145071085840022305247663313482\
+714565918140785997808209749619683146844964283106915422726638\
+184861327711776708749278315100024436584176080783836115268999\
+055336294569042349971163039294272620322160728879610722678506\
+182344928526064885227397447578450046944618127903428943538029\
+386719288345854473283987116842451647036255801966780244103035\
+425445345127067921349083698736056197567752071915587544133815\
+717564310032485290205726480489464589999677885266171263493459\
+668963623768410922688414177814149693150024191921819721215688\
+114324591287371281400636455584825253000890602388603923710921\
+026880979879158388608823700222683123228822356907857261909150\
+626993825760416437415551396973489279578569909699853422995997\
+974315036153120383930698087773157253674975950409660938084071\
+173163693891122166282318691732176374528554627905530306369204\
+877964658806333996327938827344733821685425961846791581492287\
+250044047142934607523718654369478552373072400018635730811749\
+291666457582760812726851561001954207941547404866373158231367\
+986951247388733285659455982411993350593989550494594498447410\
+984783303191128659803467713819821511544998464785455306500918\
+241648925913966507036336000231915215026183799886938007038845\
+551916478649593272604688927931953165785101738164060543643192\
+949066412847647883846835866623820426428526541564774787007791\
+235843699657232847114093617412355486871810526396392792853731\
+390841657984518997639795008374280777823099107035223998600103\
+103211166230289241182380237703814248941627178152962100972452\
+217697144954497443279450919433943252592977710901289696002698\
+225209041938801190947812141758873162203113090284565687499100\
+109623665868340184032428667217835198069330185880779776269137\
+742366802202585247113480377505916462865316253065105837519292\
+805411191872195967066157363040364443666632564266439033866945\
+366496486863801221986778957510023272290593640187551645170603\
+215150911733580059874983597994671388176488814794186236946834\
+548816837468411497151813344980969677026131105901402313456769\
+561412278508799050185582199844418197980544632067644131002512\
+557755358307705356209461595354064971347590431926479961905129\
+785864961996560707071051177738535042777950247546470241655891\
+294428226271478689174637951663865529219133988782700199051475\
+108495188941141025360733690471601309904116260484264378352956\
+830972782977747351810451586166745640802378131466232692150196\
+132319386267589275314909450293562079332893638471814389025392\
+970579695249613486078445695214422379148991006996109216699215\
+721671648754881325271879493185438097033881789311707997697928\
+860866812849648616086569281093053695399558469641977866770538\
+476039621947215238679930485285585513808236992918733520331110\
+962448142457896209307561142289713638388281085340301520317159\
+297224995464365477734040179470355969363384621039467975256670\
+339354334892926205316491997244008324897517881293654265688813\
+283579663372924392043825371743576754041055802440187836850412\
+247984570221893156921757872572872036331343007592090605703195\
+088864753777199111760713027328198781654685927174063882187275\
+850263521274368447629947228263907797373221137688424821608129\
+731003236738630502344377228987961455961818623205503012858619\
+800521948637807438081069469400793496307826769301971342062597\
+391253779410607511754278887744936774785938056823221738917303\
+119592848951788560393540150358649310736020595310015728915288\
+289821678102453433273888879288862086153270028346900686360943\
+250522514297816412678213672667152836436597491522644579383191\
+851483036048273636234050603745735057899230038434384361744893\
+838050985090837220507663282503497932038372021626246900935334\
+781144388106031405650705176699646299475436084049881780196520\
+881623075256119318210664937469946410480660118598143375898298\
+965497205621170906772915413181530577151676241283182977713765\
+317889730886996471681592298058774155948285325398399674640645\
+566475947058303746531133735308766583802401453804232106737787\
+768035926272312574958173945816077962772826443125107145322971\
+087220172175473177449006473180221085709470643042801004189714\
+505520073568915195232936144169440163547568663500508335014169\
+425050712038101167190534305435310279534374364467455668392421\
+298604104431988622194699721632249712583483143417550152131186\
+288827131347662976240916448058011869761525369135147129192405\
+037216807405860168320999468074663117771890506566769628495813\
+837909047220874786467663205170561835819702362482274133227483\
+041342457179876653773960112367066273208176545656826800069574\
+547599816180234764485446735080683694920665668954370505715843\
+455110709594838989387382250502925336743830916124954071268053\
+817964873658921319164268375226716232666274830656557657055342\
+393552148933959057023293404027940528842591460490646295820755\
+765633076707491896621769767253619370462005760078938144396953\
+018925287611875441613896820035092167912718365454954166761481\
+511451950826683236776211829914518353242818636196417736206010\
+145109509967467266157037719712666871515644277723594273405669\
+093518586548079997818085130346801040781966074621669280188633\
+856299289656492439545033914935979634179552686396067914528336\
+924678729357419403624798426886422277256625046946795576781709\
+298737741510378578072199383561520569978396254537274419476511\
+983161908266152660163477408756159700314280122283281906103567\
+067156627222418787671312246698375736071215395722993294041012\
+744631560602983489316782773611740570974847045870362276861106\
+774130949410119612624380274679529647271294627526939490197641\
+645383447755544661714281218489998189691140343327976729279891\
+077101372792811842951182338559423852563331641533781432796742\
+873181364582071661749961126386895359760476172215209100274274\
+851619657020388051618654944574445941780637669570374280535432\
+399157923698778110534174856844986671232161320063786308144771\
+068130888985636449091787794632959555876880672773686838364706\
+122084832995722603440165161942472322987408003421165899848443\
+566885769845535074102932500939450142098799833145629484519298\
+622410092757836842296697186410137365818568152771850732591405\
+340248509247875448717161746544246407280913725135059228268131\
+453903691495906528862410006254958805237716723952273129715780\
+425223305517882562616830806755498203755676925741529569939445\
+043490046171854709456730491532189688306135861932534903184518\
+717706426178028900836080044604143054210332610482947502104703\
+032028463320549525316174330585387581543470878545616097381416\
+151451037487775797335749896735101048367502483255117772375025\
+269956476872153642623856062175536913321594213515989059505375\
+135183515207096576145781316398544325320022366962008554087665\
+201050763789833457082359181807492731245904330245198691471329\
+319324627030678762142685799400660305214140453863665517807185\
+105354694177602424937823924511789133225030926924236498557565\
+212794565582753399214908928688568628950225640472058381324292\
+866007645368390366981937596341868992912741319342960598330486\
+905946276235953206760977215407164729909506118583728562718724\
+235732515062300426080741679038098122641980345051854359908213\
+563779664847422505775922437272989231878912994048540484468227\
+199282393172540734295329890896755037903724644870572648941076\
+132423009124870700536763793881894969000042397318202298868940\
+530196108237639578098191879486398269734335286831689173606327\
+500405178476864790935386838169242131756729797688220656276969\
+434749140204830563840068728357383111109865861495106613619153\
+421725274090787422508800568671498311491210197298472420373359\
+044400631309819996507004167876832936101195902219429743174557\
+163362274547892397934880322990633165889175059124060202200452\
+648684577182821651588921716304707095995039972827781680978274\
+973838841958209215836456212939412000456040621743349981715350\
+305133662772937143899882197561295808685181679238411733642697\
+748892466944352640514849114619882270112386610376024527101889\
+119004382703622803911212700216792471528793241950356942780714\
+774957204475130171711488773121937363663487116301055073658645\
+980695862570269762957141239436916216723776945522480189876803\
+386123827956059851911061129713987960026363403936931196519733\
+447116468545744829997003979525368783485129837821983305137448\
+031689360764270759437872004895754351479890333865299565515706\
+690471030702230767978923298480584997256328135245813726407464\
+159230169328539541524724878662873185450510653764301207480799\
+488602832618557388369552461881286225098286358672257087829660\
+174231705350465091313887538950130611513878400895128618426154\
+417299623157313010877679890009181366178705821415173309356192\
+686429159835537275875876767919535369607142366878476025895389\
+279625854409611312402187942369446302119309705461187450803468\
+606366203101933821675974655441744883993796837164178911391575\
+751463591650231265941242686108002052587760190005508737394014\
+453031299745602214380618917954427803281262300931789525045703\
+809571995929933387196864877982754748535701000330924817431298\
+365273697561943437891318220691072831562717726798635382168915\
+187137325209768346284183473712613689334546294053718697897526\
+843398053681374508250012035211936425982389543291022583173280\
+985811169783438836113209408147936547458073361625570571955232\
+746103236016857123149307991441916732438322836596693687161268\
+151183603534413030099360835441935243365729307681545065674775\
+655582111435085683962037818795920337874290127531069511296530\
+746308404963763022896682861683252995925040540038039172626001\
+958340013361801588367655990575379797454237110701588716509764\
+759243657077584013289594787913434812509790293636440469725564\
+222946985585616708175959944099853232059130350099233608207347\
+955460820122006976717445739825352919058005528371183277021250\
+186916447745609162301667393077050176560656798672598371789181\
+232542195795945358691713761483976100058707499929103557275695\
+937295677892604799308353051124627278706035295473126217205599\
+530746756205492173148619619059839609108464715691924592576481\
+382126740168148453274964955074129767533813576349605298268179\
+068244338581354855186516322703199278802275718580352103754433\
+240982354636196477238624205575823556321375833700666021556412\
+182358152808745703724362178773168996492870519432472065091133\
+11767578124999e-4966L;
+static const long double ld1b =
+3.2375875597190125554622194791138232762497846690173405048449\
+421945985197700620596855088357456383249701279390707384240598\
+382936099431912710233425550359863089915213963553756674672083\
+673128192358701197242632527769951957277781260855740340354110\
+173441284912381364143945515141786687806740155311932822963199\
+131134959539539338316310328556057915323285980341541664226172\
+265348802632447238304822896568757017013159021750199744350376\
+278243566840330589397015778833566517337174685312047058426075\
+688036665697114219175258344917835835984013214761767520398571\
+735519302688914468501077605843338555214753050109407568139932\
+147308502166696009676987494125921676927574464221699654264839\
+192243410627511520570610765229732327315423820550872393685221\
+676561948307418196052769717057382723931306989375320957256133\
+838073129463951849807075348034900035402513943244599879584009\
+391110011261908615236154859382854977144106096407982738165117\
+693915685918231984764157652755343417097983676870433731452629\
+339981084526616826599425863049784138127555181662391766144738\
+159400253422795753041594932607700680306368857466952063923782\
+760519487592638820793893796669403574411398166619131986561877\
+034635197232626532239192571857518274939275861531537920777299\
+133535479548088762634002006634954143608168633852204577195463\
+389533233992867620995583241321034602255800668175356808869060\
+608582640890741203603916133682748118680676374951545690715916\
+241859799379894025137504643469040366684778763795442214328000\
+375999444991619403217748350277527106812175542863660436614910\
+135938862296156144947361864759321605496309393905421651264941\
+669606814994816518612155298709843817262034769175075602668866\
+926449523554218142013501373514352370369126244144449924971423\
+038024236058971106053649565799145071085840022305247663313482\
+714565918140785997808209749619683146844964283106915422726638\
+184861327711776708749278315100024436584176080783836115268999\
+055336294569042349971163039294272620322160728879610722678506\
+182344928526064885227397447578450046944618127903428943538029\
+386719288345854473283987116842451647036255801966780244103035\
+425445345127067921349083698736056197567752071915587544133815\
+717564310032485290205726480489464589999677885266171263493459\
+668963623768410922688414177814149693150024191921819721215688\
+114324591287371281400636455584825253000890602388603923710921\
+026880979879158388608823700222683123228822356907857261909150\
+626993825760416437415551396973489279578569909699853422995997\
+974315036153120383930698087773157253674975950409660938084071\
+173163693891122166282318691732176374528554627905530306369204\
+877964658806333996327938827344733821685425961846791581492287\
+250044047142934607523718654369478552373072400018635730811749\
+291666457582760812726851561001954207941547404866373158231367\
+986951247388733285659455982411993350593989550494594498447410\
+984783303191128659803467713819821511544998464785455306500918\
+241648925913966507036336000231915215026183799886938007038845\
+551916478649593272604688927931953165785101738164060543643192\
+949066412847647883846835866623820426428526541564774787007791\
+235843699657232847114093617412355486871810526396392792853731\
+390841657984518997639795008374280777823099107035223998600103\
+103211166230289241182380237703814248941627178152962100972452\
+217697144954497443279450919433943252592977710901289696002698\
+225209041938801190947812141758873162203113090284565687499100\
+109623665868340184032428667217835198069330185880779776269137\
+742366802202585247113480377505916462865316253065105837519292\
+805411191872195967066157363040364443666632564266439033866945\
+366496486863801221986778957510023272290593640187551645170603\
+215150911733580059874983597994671388176488814794186236946834\
+548816837468411497151813344980969677026131105901402313456769\
+561412278508799050185582199844418197980544632067644131002512\
+557755358307705356209461595354064971347590431926479961905129\
+785864961996560707071051177738535042777950247546470241655891\
+294428226271478689174637951663865529219133988782700199051475\
+108495188941141025360733690471601309904116260484264378352956\
+830972782977747351810451586166745640802378131466232692150196\
+132319386267589275314909450293562079332893638471814389025392\
+970579695249613486078445695214422379148991006996109216699215\
+721671648754881325271879493185438097033881789311707997697928\
+860866812849648616086569281093053695399558469641977866770538\
+476039621947215238679930485285585513808236992918733520331110\
+962448142457896209307561142289713638388281085340301520317159\
+297224995464365477734040179470355969363384621039467975256670\
+339354334892926205316491997244008324897517881293654265688813\
+283579663372924392043825371743576754041055802440187836850412\
+247984570221893156921757872572872036331343007592090605703195\
+088864753777199111760713027328198781654685927174063882187275\
+850263521274368447629947228263907797373221137688424821608129\
+731003236738630502344377228987961455961818623205503012858619\
+800521948637807438081069469400793496307826769301971342062597\
+391253779410607511754278887744936774785938056823221738917303\
+119592848951788560393540150358649310736020595310015728915288\
+289821678102453433273888879288862086153270028346900686360943\
+250522514297816412678213672667152836436597491522644579383191\
+851483036048273636234050603745735057899230038434384361744893\
+838050985090837220507663282503497932038372021626246900935334\
+781144388106031405650705176699646299475436084049881780196520\
+881623075256119318210664937469946410480660118598143375898298\
+965497205621170906772915413181530577151676241283182977713765\
+317889730886996471681592298058774155948285325398399674640645\
+566475947058303746531133735308766583802401453804232106737787\
+768035926272312574958173945816077962772826443125107145322971\
+087220172175473177449006473180221085709470643042801004189714\
+505520073568915195232936144169440163547568663500508335014169\
+425050712038101167190534305435310279534374364467455668392421\
+298604104431988622194699721632249712583483143417550152131186\
+288827131347662976240916448058011869761525369135147129192405\
+037216807405860168320999468074663117771890506566769628495813\
+837909047220874786467663205170561835819702362482274133227483\
+041342457179876653773960112367066273208176545656826800069574\
+547599816180234764485446735080683694920665668954370505715843\
+455110709594838989387382250502925336743830916124954071268053\
+817964873658921319164268375226716232666274830656557657055342\
+393552148933959057023293404027940528842591460490646295820755\
+765633076707491896621769767253619370462005760078938144396953\
+018925287611875441613896820035092167912718365454954166761481\
+511451950826683236776211829914518353242818636196417736206010\
+145109509967467266157037719712666871515644277723594273405669\
+093518586548079997818085130346801040781966074621669280188633\
+856299289656492439545033914935979634179552686396067914528336\
+924678729357419403624798426886422277256625046946795576781709\
+298737741510378578072199383561520569978396254537274419476511\
+983161908266152660163477408756159700314280122283281906103567\
+067156627222418787671312246698375736071215395722993294041012\
+744631560602983489316782773611740570974847045870362276861106\
+774130949410119612624380274679529647271294627526939490197641\
+645383447755544661714281218489998189691140343327976729279891\
+077101372792811842951182338559423852563331641533781432796742\
+873181364582071661749961126386895359760476172215209100274274\
+851619657020388051618654944574445941780637669570374280535432\
+399157923698778110534174856844986671232161320063786308144771\
+068130888985636449091787794632959555876880672773686838364706\
+122084832995722603440165161942472322987408003421165899848443\
+566885769845535074102932500939450142098799833145629484519298\
+622410092757836842296697186410137365818568152771850732591405\
+340248509247875448717161746544246407280913725135059228268131\
+453903691495906528862410006254958805237716723952273129715780\
+425223305517882562616830806755498203755676925741529569939445\
+043490046171854709456730491532189688306135861932534903184518\
+717706426178028900836080044604143054210332610482947502104703\
+032028463320549525316174330585387581543470878545616097381416\
+151451037487775797335749896735101048367502483255117772375025\
+269956476872153642623856062175536913321594213515989059505375\
+135183515207096576145781316398544325320022366962008554087665\
+201050763789833457082359181807492731245904330245198691471329\
+319324627030678762142685799400660305214140453863665517807185\
+105354694177602424937823924511789133225030926924236498557565\
+212794565582753399214908928688568628950225640472058381324292\
+866007645368390366981937596341868992912741319342960598330486\
+905946276235953206760977215407164729909506118583728562718724\
+235732515062300426080741679038098122641980345051854359908213\
+563779664847422505775922437272989231878912994048540484468227\
+199282393172540734295329890896755037903724644870572648941076\
+132423009124870700536763793881894969000042397318202298868940\
+530196108237639578098191879486398269734335286831689173606327\
+500405178476864790935386838169242131756729797688220656276969\
+434749140204830563840068728357383111109865861495106613619153\
+421725274090787422508800568671498311491210197298472420373359\
+044400631309819996507004167876832936101195902219429743174557\
+163362274547892397934880322990633165889175059124060202200452\
+648684577182821651588921716304707095995039972827781680978274\
+973838841958209215836456212939412000456040621743349981715350\
+305133662772937143899882197561295808685181679238411733642697\
+748892466944352640514849114619882270112386610376024527101889\
+119004382703622803911212700216792471528793241950356942780714\
+774957204475130171711488773121937363663487116301055073658645\
+980695862570269762957141239436916216723776945522480189876803\
+386123827956059851911061129713987960026363403936931196519733\
+447116468545744829997003979525368783485129837821983305137448\
+031689360764270759437872004895754351479890333865299565515706\
+690471030702230767978923298480584997256328135245813726407464\
+159230169328539541524724878662873185450510653764301207480799\
+488602832618557388369552461881286225098286358672257087829660\
+174231705350465091313887538950130611513878400895128618426154\
+417299623157313010877679890009181366178705821415173309356192\
+686429159835537275875876767919535369607142366878476025895389\
+279625854409611312402187942369446302119309705461187450803468\
+606366203101933821675974655441744883993796837164178911391575\
+751463591650231265941242686108002052587760190005508737394014\
+453031299745602214380618917954427803281262300931789525045703\
+809571995929933387196864877982754748535701000330924817431298\
+365273697561943437891318220691072831562717726798635382168915\
+187137325209768346284183473712613689334546294053718697897526\
+843398053681374508250012035211936425982389543291022583173280\
+985811169783438836113209408147936547458073361625570571955232\
+746103236016857123149307991441916732438322836596693687161268\
+151183603534413030099360835441935243365729307681545065674775\
+655582111435085683962037818795920337874290127531069511296530\
+746308404963763022896682861683252995925040540038039172626001\
+958340013361801588367655990575379797454237110701588716509764\
+759243657077584013289594787913434812509790293636440469725564\
+222946985585616708175959944099853232059130350099233608207347\
+955460820122006976717445739825352919058005528371183277021250\
+186916447745609162301667393077050176560656798672598371789181\
+232542195795945358691713761483976100058707499929103557275695\
+937295677892604799308353051124627278706035295473126217205599\
+530746756205492173148619619059839609108464715691924592576481\
+382126740168148453274964955074129767533813576349605298268179\
+068244338581354855186516322703199278802275718580352103754433\
+240982354636196477238624205575823556321375833700666021556412\
+182358152808745703724362178773168996492870519432472065091133\
+11767578125e-4966L;
+static const long double ld1c =
+3.2375875597190125554622194791138232762497846690173405048449\
+421945985197700620596855088357456383249701279390707384240598\
+382936099431912710233425550359863089915213963553756674672083\
+673128192358701197242632527769951957277781260855740340354110\
+173441284912381364143945515141786687806740155311932822963199\
+131134959539539338316310328556057915323285980341541664226172\
+265348802632447238304822896568757017013159021750199744350376\
+278243566840330589397015778833566517337174685312047058426075\
+688036665697114219175258344917835835984013214761767520398571\
+735519302688914468501077605843338555214753050109407568139932\
+147308502166696009676987494125921676927574464221699654264839\
+192243410627511520570610765229732327315423820550872393685221\
+676561948307418196052769717057382723931306989375320957256133\
+838073129463951849807075348034900035402513943244599879584009\
+391110011261908615236154859382854977144106096407982738165117\
+693915685918231984764157652755343417097983676870433731452629\
+339981084526616826599425863049784138127555181662391766144738\
+159400253422795753041594932607700680306368857466952063923782\
+760519487592638820793893796669403574411398166619131986561877\
+034635197232626532239192571857518274939275861531537920777299\
+133535479548088762634002006634954143608168633852204577195463\
+389533233992867620995583241321034602255800668175356808869060\
+608582640890741203603916133682748118680676374951545690715916\
+241859799379894025137504643469040366684778763795442214328000\
+375999444991619403217748350277527106812175542863660436614910\
+135938862296156144947361864759321605496309393905421651264941\
+669606814994816518612155298709843817262034769175075602668866\
+926449523554218142013501373514352370369126244144449924971423\
+038024236058971106053649565799145071085840022305247663313482\
+714565918140785997808209749619683146844964283106915422726638\
+184861327711776708749278315100024436584176080783836115268999\
+055336294569042349971163039294272620322160728879610722678506\
+182344928526064885227397447578450046944618127903428943538029\
+386719288345854473283987116842451647036255801966780244103035\
+425445345127067921349083698736056197567752071915587544133815\
+717564310032485290205726480489464589999677885266171263493459\
+668963623768410922688414177814149693150024191921819721215688\
+114324591287371281400636455584825253000890602388603923710921\
+026880979879158388608823700222683123228822356907857261909150\
+626993825760416437415551396973489279578569909699853422995997\
+974315036153120383930698087773157253674975950409660938084071\
+173163693891122166282318691732176374528554627905530306369204\
+877964658806333996327938827344733821685425961846791581492287\
+250044047142934607523718654369478552373072400018635730811749\
+291666457582760812726851561001954207941547404866373158231367\
+986951247388733285659455982411993350593989550494594498447410\
+984783303191128659803467713819821511544998464785455306500918\
+241648925913966507036336000231915215026183799886938007038845\
+551916478649593272604688927931953165785101738164060543643192\
+949066412847647883846835866623820426428526541564774787007791\
+235843699657232847114093617412355486871810526396392792853731\
+390841657984518997639795008374280777823099107035223998600103\
+103211166230289241182380237703814248941627178152962100972452\
+217697144954497443279450919433943252592977710901289696002698\
+225209041938801190947812141758873162203113090284565687499100\
+109623665868340184032428667217835198069330185880779776269137\
+742366802202585247113480377505916462865316253065105837519292\
+805411191872195967066157363040364443666632564266439033866945\
+366496486863801221986778957510023272290593640187551645170603\
+215150911733580059874983597994671388176488814794186236946834\
+548816837468411497151813344980969677026131105901402313456769\
+561412278508799050185582199844418197980544632067644131002512\
+557755358307705356209461595354064971347590431926479961905129\
+785864961996560707071051177738535042777950247546470241655891\
+294428226271478689174637951663865529219133988782700199051475\
+108495188941141025360733690471601309904116260484264378352956\
+830972782977747351810451586166745640802378131466232692150196\
+132319386267589275314909450293562079332893638471814389025392\
+970579695249613486078445695214422379148991006996109216699215\
+721671648754881325271879493185438097033881789311707997697928\
+860866812849648616086569281093053695399558469641977866770538\
+476039621947215238679930485285585513808236992918733520331110\
+962448142457896209307561142289713638388281085340301520317159\
+297224995464365477734040179470355969363384621039467975256670\
+339354334892926205316491997244008324897517881293654265688813\
+283579663372924392043825371743576754041055802440187836850412\
+247984570221893156921757872572872036331343007592090605703195\
+088864753777199111760713027328198781654685927174063882187275\
+850263521274368447629947228263907797373221137688424821608129\
+731003236738630502344377228987961455961818623205503012858619\
+800521948637807438081069469400793496307826769301971342062597\
+391253779410607511754278887744936774785938056823221738917303\
+119592848951788560393540150358649310736020595310015728915288\
+289821678102453433273888879288862086153270028346900686360943\
+250522514297816412678213672667152836436597491522644579383191\
+851483036048273636234050603745735057899230038434384361744893\
+838050985090837220507663282503497932038372021626246900935334\
+781144388106031405650705176699646299475436084049881780196520\
+881623075256119318210664937469946410480660118598143375898298\
+965497205621170906772915413181530577151676241283182977713765\
+317889730886996471681592298058774155948285325398399674640645\
+566475947058303746531133735308766583802401453804232106737787\
+768035926272312574958173945816077962772826443125107145322971\
+087220172175473177449006473180221085709470643042801004189714\
+505520073568915195232936144169440163547568663500508335014169\
+425050712038101167190534305435310279534374364467455668392421\
+298604104431988622194699721632249712583483143417550152131186\
+288827131347662976240916448058011869761525369135147129192405\
+037216807405860168320999468074663117771890506566769628495813\
+837909047220874786467663205170561835819702362482274133227483\
+041342457179876653773960112367066273208176545656826800069574\
+547599816180234764485446735080683694920665668954370505715843\
+455110709594838989387382250502925336743830916124954071268053\
+817964873658921319164268375226716232666274830656557657055342\
+393552148933959057023293404027940528842591460490646295820755\
+765633076707491896621769767253619370462005760078938144396953\
+018925287611875441613896820035092167912718365454954166761481\
+511451950826683236776211829914518353242818636196417736206010\
+145109509967467266157037719712666871515644277723594273405669\
+093518586548079997818085130346801040781966074621669280188633\
+856299289656492439545033914935979634179552686396067914528336\
+924678729357419403624798426886422277256625046946795576781709\
+298737741510378578072199383561520569978396254537274419476511\
+983161908266152660163477408756159700314280122283281906103567\
+067156627222418787671312246698375736071215395722993294041012\
+744631560602983489316782773611740570974847045870362276861106\
+774130949410119612624380274679529647271294627526939490197641\
+645383447755544661714281218489998189691140343327976729279891\
+077101372792811842951182338559423852563331641533781432796742\
+873181364582071661749961126386895359760476172215209100274274\
+851619657020388051618654944574445941780637669570374280535432\
+399157923698778110534174856844986671232161320063786308144771\
+068130888985636449091787794632959555876880672773686838364706\
+122084832995722603440165161942472322987408003421165899848443\
+566885769845535074102932500939450142098799833145629484519298\
+622410092757836842296697186410137365818568152771850732591405\
+340248509247875448717161746544246407280913725135059228268131\
+453903691495906528862410006254958805237716723952273129715780\
+425223305517882562616830806755498203755676925741529569939445\
+043490046171854709456730491532189688306135861932534903184518\
+717706426178028900836080044604143054210332610482947502104703\
+032028463320549525316174330585387581543470878545616097381416\
+151451037487775797335749896735101048367502483255117772375025\
+269956476872153642623856062175536913321594213515989059505375\
+135183515207096576145781316398544325320022366962008554087665\
+201050763789833457082359181807492731245904330245198691471329\
+319324627030678762142685799400660305214140453863665517807185\
+105354694177602424937823924511789133225030926924236498557565\
+212794565582753399214908928688568628950225640472058381324292\
+866007645368390366981937596341868992912741319342960598330486\
+905946276235953206760977215407164729909506118583728562718724\
+235732515062300426080741679038098122641980345051854359908213\
+563779664847422505775922437272989231878912994048540484468227\
+199282393172540734295329890896755037903724644870572648941076\
+132423009124870700536763793881894969000042397318202298868940\
+530196108237639578098191879486398269734335286831689173606327\
+500405178476864790935386838169242131756729797688220656276969\
+434749140204830563840068728357383111109865861495106613619153\
+421725274090787422508800568671498311491210197298472420373359\
+044400631309819996507004167876832936101195902219429743174557\
+163362274547892397934880322990633165889175059124060202200452\
+648684577182821651588921716304707095995039972827781680978274\
+973838841958209215836456212939412000456040621743349981715350\
+305133662772937143899882197561295808685181679238411733642697\
+748892466944352640514849114619882270112386610376024527101889\
+119004382703622803911212700216792471528793241950356942780714\
+774957204475130171711488773121937363663487116301055073658645\
+980695862570269762957141239436916216723776945522480189876803\
+386123827956059851911061129713987960026363403936931196519733\
+447116468545744829997003979525368783485129837821983305137448\
+031689360764270759437872004895754351479890333865299565515706\
+690471030702230767978923298480584997256328135245813726407464\
+159230169328539541524724878662873185450510653764301207480799\
+488602832618557388369552461881286225098286358672257087829660\
+174231705350465091313887538950130611513878400895128618426154\
+417299623157313010877679890009181366178705821415173309356192\
+686429159835537275875876767919535369607142366878476025895389\
+279625854409611312402187942369446302119309705461187450803468\
+606366203101933821675974655441744883993796837164178911391575\
+751463591650231265941242686108002052587760190005508737394014\
+453031299745602214380618917954427803281262300931789525045703\
+809571995929933387196864877982754748535701000330924817431298\
+365273697561943437891318220691072831562717726798635382168915\
+187137325209768346284183473712613689334546294053718697897526\
+843398053681374508250012035211936425982389543291022583173280\
+985811169783438836113209408147936547458073361625570571955232\
+746103236016857123149307991441916732438322836596693687161268\
+151183603534413030099360835441935243365729307681545065674775\
+655582111435085683962037818795920337874290127531069511296530\
+746308404963763022896682861683252995925040540038039172626001\
+958340013361801588367655990575379797454237110701588716509764\
+759243657077584013289594787913434812509790293636440469725564\
+222946985585616708175959944099853232059130350099233608207347\
+955460820122006976717445739825352919058005528371183277021250\
+186916447745609162301667393077050176560656798672598371789181\
+232542195795945358691713761483976100058707499929103557275695\
+937295677892604799308353051124627278706035295473126217205599\
+530746756205492173148619619059839609108464715691924592576481\
+382126740168148453274964955074129767533813576349605298268179\
+068244338581354855186516322703199278802275718580352103754433\
+240982354636196477238624205575823556321375833700666021556412\
+182358152808745703724362178773168996492870519432472065091133\
+11767578125001e-4966L;
+/* 0x1.8p-16494 */
+static const long double ld2ae = 0x1p-16494L, ld2be = 0x2p-16494L, ld2ce = 0x2p-16494L;
+static const long double ld2a =
+9.7127626791570376663866584373414698287493540070520215145348\
+265837955593101861790565265072369149749103838172122152721795\
+148808298295738130700276651079589269745641890661270024016251\
+019384577076103591727897583309855871833343782567221021062330\
+520323854737144092431836545425360063420220465935798468889597\
+393404878618618014948930985668173745969857941024624992678516\
+796046407897341714914468689706271051039477065250599233051128\
+834730700520991768191047336500699552011524055936141175278227\
+064109997091342657525775034753507507952039644285302561195715\
+206557908066743405503232817530015665644259150328222704419796\
+441925506500088029030962482377765030782723392665098962794517\
+576730231882534561711832295689196981946271461652617181055665\
+029685844922254588158309151172148171793920968125962871768401\
+514219388391855549421226044104700106207541829733799638752028\
+173330033785725845708464578148564931432318289223948214495353\
+081747057754695954292472958266030251293951030611301194357888\
+019943253579850479798277589149352414382665544987175298434214\
+478200760268387259124784797823102040919106572400856191771348\
+281558462777916462381681390008210723234194499857395959685631\
+103905591697879596717577715572554824817827584594613762331897\
+400606438644266287902006019904862430824505901556613731586390\
+168599701978602862986749723963103806767402004526070426607181\
+825747922672223610811748401048244356042029124854637072147748\
+725579398139682075412513930407121100054336291386326642984001\
+127998334974858209653245050832581320436526628590981309844730\
+407816586888468434842085594277964816488928181716264953794825\
+008820444984449555836465896129531451786104307525226808006600\
+779348570662654426040504120543057111107378732433349774914269\
+114072708176913318160948697397435213257520066915742989940448\
+143697754422357993424629248859049440534892849320746268179914\
+554583983135330126247834945300073309752528242351508345806997\
+166008883707127049913489117882817860966482186638832168035518\
+547034785578194655682192342735350140833854383710286830614088\
+160157865037563419851961350527354941108767405900340732309106\
+276336035381203764047251096208168592703256215746762632401447\
+152692930097455870617179441468393769999033655798513790480379\
+006890871305232768065242533442449079450072575765459163647064\
+342973773862113844201909366754475759002671807165811771132763\
+080642939637475165826471100668049369686467070723571785727451\
+880981477281249312246654190920467838735709729099560268987993\
+922945108459361151792094263319471761024927851228982814252213\
+519491081673366498846956075196529123585663883716590919107614\
+633893976419001988983816482034201465056277885540374744476861\
+750132141428803822571155963108435657119217200055907192435247\
+874999372748282438180554683005862623824642214599119474694103\
+960853742166199856978367947235980051781968651483783495342232\
+954349909573385979410403141459464534634995394356365919502754\
+724946777741899521109008000695745645078551399660814021116536\
+655749435948779817814066783795859497355305214492181630929578\
+847199238542943651540507599871461279285579624694324361023373\
+707531098971698541342280852237066460615431579189178378561194\
+172524973953556992919385025122842333469297321105671995800309\
+309633498690867723547140713111442746824881534458886302917356\
+653091434863492329838352758301829757778933132703869088008094\
+675627125816403572843436425276619486609339270853697062497300\
+328870997605020552097286001653505594207990557642339328807413\
+227100406607755741340441132517749388595948759195317512557878\
+416233575616587901198472089121093330999897692799317101600836\
+099489460591403665960336872530069816871780920562654935511809\
+645452735200740179624950793984014164529466444382558710840503\
+646450512405234491455440034942909031078393317704206940370308\
+684236835526397150556746599533254593941633896202932393007537\
+673266074923116068628384786062194914042771295779439885715389\
+357594885989682121213153533215605128333850742639410724967673\
+883284678814436067523913854991596587657401966348100597154425\
+325485566823423076082201071414803929712348781452793135058870\
+492918348933242055431354758500236922407134394398698076450588\
+396958158802767825944728350880686237998680915415443167076178\
+911739085748840458235337085643267137446973020988327650097647\
+165014946264643975815638479556314291101645367935123993093786\
+582600438548945848259707843279161086198675408925933600311615\
+428118865841645716039791455856756541424710978756200560993332\
+887344427373688627922683426869140915164843256020904560951477\
+891674986393096433202120538411067908090153863118403925770011\
+018063004678778615949475991732024974692553643880962797066439\
+850738990118773176131476115230730262123167407320563510551236\
+743953710665679470765273617718616108994029022776271817109585\
+266594261331597335282139081984596344964057781522191646561827\
+550790563823105342889841684791723392119663413065274464824389\
+193009710215891507033131686963884367885455869616509038575859\
+401565845913422314243208408202380488923480307905914026187792\
+173761338231822535262836663234810324357814170469665216751909\
+358778546855365681180620451075947932208061785930047186745864\
+869465034307360299821666637866586258459810085040702059082829\
+751567542893449238034641018001458509309792474567933738149575\
+554449108144820908702151811237205173697690115303153085234681\
+514152955272511661522989847510493796115116064878740702806004\
+343433164318094216952115530098938898426308252149645340589562\
+644869225768357954631994812409839231441980355794430127694896\
+896491616863512720318746239544591731455028723849548933141295\
+953669192660989415044776894176322467844855976195199023921936\
+699427841174911239593401205926299751407204361412696320213363\
+304107778816937724874521837448233888318479329375321435968913\
+261660516526419532347019419540663257128411929128403012569143\
+516560220706745585698808432508320490642705990501525005042508\
+275152136114303501571602916305930838603123093402367005177263\
+895812313295965866584099164896749137750449430252650456393558\
+866481394042988928722749344174035609284576107405441387577215\
+111650422217580504962998404223989353315671519700308885487441\
+513727141662624359402989615511685507459107087446822399682449\
+124027371539629961321880337101198819624529636970480400208723\
+642799448540704293456340205242051084761997006863111517147530\
+365332128784516968162146751508776010231492748374862213804161\
+453894620976763957492805125680148697998824491969672971166027\
+180656446801877171069880212083821586527774381471938887462267\
+296899230122475689865309301760858111386017280236814433190859\
+056775862835626324841690460105276503738155096364862500284444\
+534355852480049710328635489743555059728455908589253208618030\
+435328529902401798471113159138000614546932833170782820217007\
+280555759644239993454255391040403122345898223865007840565901\
+568897868969477318635101744807938902538658059188203743585010\
+774036188072258210874395280659266831769875140840386730345127\
+896213224531135734216598150684561709935188763611823258429535\
+949485724798457980490432226268479100942840366849845718310701\
+201469881667256363013936740095127208213646187168979882123038\
+233894681808950467950348320835221712924541137611086830583320\
+322392848230358837873140824038588941813883882580818470592924\
+936150343266633985142843655469994569073421029983930187839673\
+231304118378435528853547015678271557689994924601344298390228\
+619544093746214985249883379160686079281428516645627300822824\
+554858971061164154855964833723337825341913008711122841606297\
+197473771096334331602524570534960013696483960191358924434313\
+204392666956909347275363383898878667630642018321060515094118\
+366254498987167810320495485827416968962224010263497699545330\
+700657309536605222308797502818350426296399499436888453557895\
+867230278273510526890091559230412097455704458315552197774216\
+020745527743626346151485239632739221842741175405177684804394\
+361711074487719586587230018764876415713150171856819389147341\
+275669916553647687850492420266494611267030777224588709818335\
+130470138515564128370191474596569064918407585797604709553556\
+153119278534086702508240133812429162630997831448842506314109\
+096085389961648575948522991756162744630412635636848292144248\
+454353112463327392007249690205303145102507449765353317125075\
+809869430616460927871568186526610739964782640547967178516125\
+405550545621289728437343949195632975960067100886025662262995\
+603152291369500371247077545422478193737712990735596074413987\
+957973881092036286428057398201980915642421361590996553421555\
+316064082532807274813471773535367399675092780772709495672695\
+638383696748260197644726786065705886850676921416175143972878\
+598022936105171100945812789025606978738223958028881794991460\
+717838828707859620282931646221494189728518355751185688156172\
+707197545186901278242225037114294367925941035155563079724640\
+691338994542267517327767311818967695636738982145621453404681\
+597847179517622202885989672690265113711173934611717946823228\
+397269027374612101610291381645684907000127191954606896606821\
+590588324712918734294575638459194809203005860495067520818982\
+501215535430594372806160514507726395270189393064661968830908\
+304247420614491691520206185072149333329597584485319840857460\
+265175822272362267526401706014494934473630591895417261120077\
+133201893929459989521012503630498808303587706658289229523671\
+490086823643677193804640968971899497667525177372180606601357\
+946053731548464954766765148914121287985119918483345042934824\
+921516525874627647509368638818236001368121865230049945146050\
+915400988318811431699646592683887426055545037715235200928093\
+246677400833057921544547343859646810337159831128073581305667\
+357013148110868411733638100650377414586379725851070828342144\
+324871613425390515134466319365812090990461348903165220975937\
+942087587710809288871423718310748650171330836567440569630410\
+158371483868179555733183389141963880079090211810793589559200\
+341349405637234489991011938576106350455389513465949915412344\
+095068082292812278313616014687263054439671001595898696547120\
+071413092106692303936769895441754991768984405737441179222392\
+477690507985618624574174635988619556351531961292903622442398\
+465808497855672165108657385643858675294859076016771263488980\
+522695116051395273941662616850391834541635202685385855278463\
+251898869471939032633039670027544098536117464245519928068578\
+059287479506611827627630303758606108821427100635428077686167\
+838877563228833937206563827108338906357929116383562352410405\
+819098609305801465027923966325234651981390511492536734174727\
+254390774950693797823728058324006157763280570016526212182043\
+359093899236806643141856753863283409843786902795368575137111\
+428715987789800161590594633948264245607103000992774452293895\
+095821092685830313673954662073218494688153180395906146506745\
+561411975629305038852550421137841068003638882161156093692580\
+530194161044123524750036105635809277947168629873067749519842\
+957433509350316508339628224443809642374220084876711715865698\
+238309708050571369447923974325750197314968509790081061483804\
+453550810603239090298082506325805730097187923044635197024326\
+966746334305257051886113456387761013622870382593208533889592\
+238925214891289068690048585049758987775121620114117517878005\
+875020040085404765102967971726139392362711332104766149529294\
+277730971232752039868784363740304437529370880909321409176692\
+668840956756850124527879832299559696177391050297700824622043\
+866382460366020930152337219476058757174016585113549831063750\
+560749343236827486905002179231150529681970396017795115367543\
+697626587387836076075141284451928300176122499787310671827087\
+811887033677814397925059153373881836118105886419378651616798\
+592240268616476519445858857179518827325394147075773777729444\
+146380220504445359824894865222389302601440729048815894804537\
+204733015744064565559548968109597836406827155741056311263299\
+722947063908589431715872616727470668964127501101998064669236\
+547074458426237111173086536319506989478611558297416195273399\
+35302734374999e-4966L;
+static const long double ld2b =
+9.7127626791570376663866584373414698287493540070520215145348\
+265837955593101861790565265072369149749103838172122152721795\
+148808298295738130700276651079589269745641890661270024016251\
+019384577076103591727897583309855871833343782567221021062330\
+520323854737144092431836545425360063420220465935798468889597\
+393404878618618014948930985668173745969857941024624992678516\
+796046407897341714914468689706271051039477065250599233051128\
+834730700520991768191047336500699552011524055936141175278227\
+064109997091342657525775034753507507952039644285302561195715\
+206557908066743405503232817530015665644259150328222704419796\
+441925506500088029030962482377765030782723392665098962794517\
+576730231882534561711832295689196981946271461652617181055665\
+029685844922254588158309151172148171793920968125962871768401\
+514219388391855549421226044104700106207541829733799638752028\
+173330033785725845708464578148564931432318289223948214495353\
+081747057754695954292472958266030251293951030611301194357888\
+019943253579850479798277589149352414382665544987175298434214\
+478200760268387259124784797823102040919106572400856191771348\
+281558462777916462381681390008210723234194499857395959685631\
+103905591697879596717577715572554824817827584594613762331897\
+400606438644266287902006019904862430824505901556613731586390\
+168599701978602862986749723963103806767402004526070426607181\
+825747922672223610811748401048244356042029124854637072147748\
+725579398139682075412513930407121100054336291386326642984001\
+127998334974858209653245050832581320436526628590981309844730\
+407816586888468434842085594277964816488928181716264953794825\
+008820444984449555836465896129531451786104307525226808006600\
+779348570662654426040504120543057111107378732433349774914269\
+114072708176913318160948697397435213257520066915742989940448\
+143697754422357993424629248859049440534892849320746268179914\
+554583983135330126247834945300073309752528242351508345806997\
+166008883707127049913489117882817860966482186638832168035518\
+547034785578194655682192342735350140833854383710286830614088\
+160157865037563419851961350527354941108767405900340732309106\
+276336035381203764047251096208168592703256215746762632401447\
+152692930097455870617179441468393769999033655798513790480379\
+006890871305232768065242533442449079450072575765459163647064\
+342973773862113844201909366754475759002671807165811771132763\
+080642939637475165826471100668049369686467070723571785727451\
+880981477281249312246654190920467838735709729099560268987993\
+922945108459361151792094263319471761024927851228982814252213\
+519491081673366498846956075196529123585663883716590919107614\
+633893976419001988983816482034201465056277885540374744476861\
+750132141428803822571155963108435657119217200055907192435247\
+874999372748282438180554683005862623824642214599119474694103\
+960853742166199856978367947235980051781968651483783495342232\
+954349909573385979410403141459464534634995394356365919502754\
+724946777741899521109008000695745645078551399660814021116536\
+655749435948779817814066783795859497355305214492181630929578\
+847199238542943651540507599871461279285579624694324361023373\
+707531098971698541342280852237066460615431579189178378561194\
+172524973953556992919385025122842333469297321105671995800309\
+309633498690867723547140713111442746824881534458886302917356\
+653091434863492329838352758301829757778933132703869088008094\
+675627125816403572843436425276619486609339270853697062497300\
+328870997605020552097286001653505594207990557642339328807413\
+227100406607755741340441132517749388595948759195317512557878\
+416233575616587901198472089121093330999897692799317101600836\
+099489460591403665960336872530069816871780920562654935511809\
+645452735200740179624950793984014164529466444382558710840503\
+646450512405234491455440034942909031078393317704206940370308\
+684236835526397150556746599533254593941633896202932393007537\
+673266074923116068628384786062194914042771295779439885715389\
+357594885989682121213153533215605128333850742639410724967673\
+883284678814436067523913854991596587657401966348100597154425\
+325485566823423076082201071414803929712348781452793135058870\
+492918348933242055431354758500236922407134394398698076450588\
+396958158802767825944728350880686237998680915415443167076178\
+911739085748840458235337085643267137446973020988327650097647\
+165014946264643975815638479556314291101645367935123993093786\
+582600438548945848259707843279161086198675408925933600311615\
+428118865841645716039791455856756541424710978756200560993332\
+887344427373688627922683426869140915164843256020904560951477\
+891674986393096433202120538411067908090153863118403925770011\
+018063004678778615949475991732024974692553643880962797066439\
+850738990118773176131476115230730262123167407320563510551236\
+743953710665679470765273617718616108994029022776271817109585\
+266594261331597335282139081984596344964057781522191646561827\
+550790563823105342889841684791723392119663413065274464824389\
+193009710215891507033131686963884367885455869616509038575859\
+401565845913422314243208408202380488923480307905914026187792\
+173761338231822535262836663234810324357814170469665216751909\
+358778546855365681180620451075947932208061785930047186745864\
+869465034307360299821666637866586258459810085040702059082829\
+751567542893449238034641018001458509309792474567933738149575\
+554449108144820908702151811237205173697690115303153085234681\
+514152955272511661522989847510493796115116064878740702806004\
+343433164318094216952115530098938898426308252149645340589562\
+644869225768357954631994812409839231441980355794430127694896\
+896491616863512720318746239544591731455028723849548933141295\
+953669192660989415044776894176322467844855976195199023921936\
+699427841174911239593401205926299751407204361412696320213363\
+304107778816937724874521837448233888318479329375321435968913\
+261660516526419532347019419540663257128411929128403012569143\
+516560220706745585698808432508320490642705990501525005042508\
+275152136114303501571602916305930838603123093402367005177263\
+895812313295965866584099164896749137750449430252650456393558\
+866481394042988928722749344174035609284576107405441387577215\
+111650422217580504962998404223989353315671519700308885487441\
+513727141662624359402989615511685507459107087446822399682449\
+124027371539629961321880337101198819624529636970480400208723\
+642799448540704293456340205242051084761997006863111517147530\
+365332128784516968162146751508776010231492748374862213804161\
+453894620976763957492805125680148697998824491969672971166027\
+180656446801877171069880212083821586527774381471938887462267\
+296899230122475689865309301760858111386017280236814433190859\
+056775862835626324841690460105276503738155096364862500284444\
+534355852480049710328635489743555059728455908589253208618030\
+435328529902401798471113159138000614546932833170782820217007\
+280555759644239993454255391040403122345898223865007840565901\
+568897868969477318635101744807938902538658059188203743585010\
+774036188072258210874395280659266831769875140840386730345127\
+896213224531135734216598150684561709935188763611823258429535\
+949485724798457980490432226268479100942840366849845718310701\
+201469881667256363013936740095127208213646187168979882123038\
+233894681808950467950348320835221712924541137611086830583320\
+322392848230358837873140824038588941813883882580818470592924\
+936150343266633985142843655469994569073421029983930187839673\
+231304118378435528853547015678271557689994924601344298390228\
+619544093746214985249883379160686079281428516645627300822824\
+554858971061164154855964833723337825341913008711122841606297\
+197473771096334331602524570534960013696483960191358924434313\
+204392666956909347275363383898878667630642018321060515094118\
+366254498987167810320495485827416968962224010263497699545330\
+700657309536605222308797502818350426296399499436888453557895\
+867230278273510526890091559230412097455704458315552197774216\
+020745527743626346151485239632739221842741175405177684804394\
+361711074487719586587230018764876415713150171856819389147341\
+275669916553647687850492420266494611267030777224588709818335\
+130470138515564128370191474596569064918407585797604709553556\
+153119278534086702508240133812429162630997831448842506314109\
+096085389961648575948522991756162744630412635636848292144248\
+454353112463327392007249690205303145102507449765353317125075\
+809869430616460927871568186526610739964782640547967178516125\
+405550545621289728437343949195632975960067100886025662262995\
+603152291369500371247077545422478193737712990735596074413987\
+957973881092036286428057398201980915642421361590996553421555\
+316064082532807274813471773535367399675092780772709495672695\
+638383696748260197644726786065705886850676921416175143972878\
+598022936105171100945812789025606978738223958028881794991460\
+717838828707859620282931646221494189728518355751185688156172\
+707197545186901278242225037114294367925941035155563079724640\
+691338994542267517327767311818967695636738982145621453404681\
+597847179517622202885989672690265113711173934611717946823228\
+397269027374612101610291381645684907000127191954606896606821\
+590588324712918734294575638459194809203005860495067520818982\
+501215535430594372806160514507726395270189393064661968830908\
+304247420614491691520206185072149333329597584485319840857460\
+265175822272362267526401706014494934473630591895417261120077\
+133201893929459989521012503630498808303587706658289229523671\
+490086823643677193804640968971899497667525177372180606601357\
+946053731548464954766765148914121287985119918483345042934824\
+921516525874627647509368638818236001368121865230049945146050\
+915400988318811431699646592683887426055545037715235200928093\
+246677400833057921544547343859646810337159831128073581305667\
+357013148110868411733638100650377414586379725851070828342144\
+324871613425390515134466319365812090990461348903165220975937\
+942087587710809288871423718310748650171330836567440569630410\
+158371483868179555733183389141963880079090211810793589559200\
+341349405637234489991011938576106350455389513465949915412344\
+095068082292812278313616014687263054439671001595898696547120\
+071413092106692303936769895441754991768984405737441179222392\
+477690507985618624574174635988619556351531961292903622442398\
+465808497855672165108657385643858675294859076016771263488980\
+522695116051395273941662616850391834541635202685385855278463\
+251898869471939032633039670027544098536117464245519928068578\
+059287479506611827627630303758606108821427100635428077686167\
+838877563228833937206563827108338906357929116383562352410405\
+819098609305801465027923966325234651981390511492536734174727\
+254390774950693797823728058324006157763280570016526212182043\
+359093899236806643141856753863283409843786902795368575137111\
+428715987789800161590594633948264245607103000992774452293895\
+095821092685830313673954662073218494688153180395906146506745\
+561411975629305038852550421137841068003638882161156093692580\
+530194161044123524750036105635809277947168629873067749519842\
+957433509350316508339628224443809642374220084876711715865698\
+238309708050571369447923974325750197314968509790081061483804\
+453550810603239090298082506325805730097187923044635197024326\
+966746334305257051886113456387761013622870382593208533889592\
+238925214891289068690048585049758987775121620114117517878005\
+875020040085404765102967971726139392362711332104766149529294\
+277730971232752039868784363740304437529370880909321409176692\
+668840956756850124527879832299559696177391050297700824622043\
+866382460366020930152337219476058757174016585113549831063750\
+560749343236827486905002179231150529681970396017795115367543\
+697626587387836076075141284451928300176122499787310671827087\
+811887033677814397925059153373881836118105886419378651616798\
+592240268616476519445858857179518827325394147075773777729444\
+146380220504445359824894865222389302601440729048815894804537\
+204733015744064565559548968109597836406827155741056311263299\
+722947063908589431715872616727470668964127501101998064669236\
+547074458426237111173086536319506989478611558297416195273399\
+35302734375e-4966L;
+static const long double ld2c =
+9.7127626791570376663866584373414698287493540070520215145348\
+265837955593101861790565265072369149749103838172122152721795\
+148808298295738130700276651079589269745641890661270024016251\
+019384577076103591727897583309855871833343782567221021062330\
+520323854737144092431836545425360063420220465935798468889597\
+393404878618618014948930985668173745969857941024624992678516\
+796046407897341714914468689706271051039477065250599233051128\
+834730700520991768191047336500699552011524055936141175278227\
+064109997091342657525775034753507507952039644285302561195715\
+206557908066743405503232817530015665644259150328222704419796\
+441925506500088029030962482377765030782723392665098962794517\
+576730231882534561711832295689196981946271461652617181055665\
+029685844922254588158309151172148171793920968125962871768401\
+514219388391855549421226044104700106207541829733799638752028\
+173330033785725845708464578148564931432318289223948214495353\
+081747057754695954292472958266030251293951030611301194357888\
+019943253579850479798277589149352414382665544987175298434214\
+478200760268387259124784797823102040919106572400856191771348\
+281558462777916462381681390008210723234194499857395959685631\
+103905591697879596717577715572554824817827584594613762331897\
+400606438644266287902006019904862430824505901556613731586390\
+168599701978602862986749723963103806767402004526070426607181\
+825747922672223610811748401048244356042029124854637072147748\
+725579398139682075412513930407121100054336291386326642984001\
+127998334974858209653245050832581320436526628590981309844730\
+407816586888468434842085594277964816488928181716264953794825\
+008820444984449555836465896129531451786104307525226808006600\
+779348570662654426040504120543057111107378732433349774914269\
+114072708176913318160948697397435213257520066915742989940448\
+143697754422357993424629248859049440534892849320746268179914\
+554583983135330126247834945300073309752528242351508345806997\
+166008883707127049913489117882817860966482186638832168035518\
+547034785578194655682192342735350140833854383710286830614088\
+160157865037563419851961350527354941108767405900340732309106\
+276336035381203764047251096208168592703256215746762632401447\
+152692930097455870617179441468393769999033655798513790480379\
+006890871305232768065242533442449079450072575765459163647064\
+342973773862113844201909366754475759002671807165811771132763\
+080642939637475165826471100668049369686467070723571785727451\
+880981477281249312246654190920467838735709729099560268987993\
+922945108459361151792094263319471761024927851228982814252213\
+519491081673366498846956075196529123585663883716590919107614\
+633893976419001988983816482034201465056277885540374744476861\
+750132141428803822571155963108435657119217200055907192435247\
+874999372748282438180554683005862623824642214599119474694103\
+960853742166199856978367947235980051781968651483783495342232\
+954349909573385979410403141459464534634995394356365919502754\
+724946777741899521109008000695745645078551399660814021116536\
+655749435948779817814066783795859497355305214492181630929578\
+847199238542943651540507599871461279285579624694324361023373\
+707531098971698541342280852237066460615431579189178378561194\
+172524973953556992919385025122842333469297321105671995800309\
+309633498690867723547140713111442746824881534458886302917356\
+653091434863492329838352758301829757778933132703869088008094\
+675627125816403572843436425276619486609339270853697062497300\
+328870997605020552097286001653505594207990557642339328807413\
+227100406607755741340441132517749388595948759195317512557878\
+416233575616587901198472089121093330999897692799317101600836\
+099489460591403665960336872530069816871780920562654935511809\
+645452735200740179624950793984014164529466444382558710840503\
+646450512405234491455440034942909031078393317704206940370308\
+684236835526397150556746599533254593941633896202932393007537\
+673266074923116068628384786062194914042771295779439885715389\
+357594885989682121213153533215605128333850742639410724967673\
+883284678814436067523913854991596587657401966348100597154425\
+325485566823423076082201071414803929712348781452793135058870\
+492918348933242055431354758500236922407134394398698076450588\
+396958158802767825944728350880686237998680915415443167076178\
+911739085748840458235337085643267137446973020988327650097647\
+165014946264643975815638479556314291101645367935123993093786\
+582600438548945848259707843279161086198675408925933600311615\
+428118865841645716039791455856756541424710978756200560993332\
+887344427373688627922683426869140915164843256020904560951477\
+891674986393096433202120538411067908090153863118403925770011\
+018063004678778615949475991732024974692553643880962797066439\
+850738990118773176131476115230730262123167407320563510551236\
+743953710665679470765273617718616108994029022776271817109585\
+266594261331597335282139081984596344964057781522191646561827\
+550790563823105342889841684791723392119663413065274464824389\
+193009710215891507033131686963884367885455869616509038575859\
+401565845913422314243208408202380488923480307905914026187792\
+173761338231822535262836663234810324357814170469665216751909\
+358778546855365681180620451075947932208061785930047186745864\
+869465034307360299821666637866586258459810085040702059082829\
+751567542893449238034641018001458509309792474567933738149575\
+554449108144820908702151811237205173697690115303153085234681\
+514152955272511661522989847510493796115116064878740702806004\
+343433164318094216952115530098938898426308252149645340589562\
+644869225768357954631994812409839231441980355794430127694896\
+896491616863512720318746239544591731455028723849548933141295\
+953669192660989415044776894176322467844855976195199023921936\
+699427841174911239593401205926299751407204361412696320213363\
+304107778816937724874521837448233888318479329375321435968913\
+261660516526419532347019419540663257128411929128403012569143\
+516560220706745585698808432508320490642705990501525005042508\
+275152136114303501571602916305930838603123093402367005177263\
+895812313295965866584099164896749137750449430252650456393558\
+866481394042988928722749344174035609284576107405441387577215\
+111650422217580504962998404223989353315671519700308885487441\
+513727141662624359402989615511685507459107087446822399682449\
+124027371539629961321880337101198819624529636970480400208723\
+642799448540704293456340205242051084761997006863111517147530\
+365332128784516968162146751508776010231492748374862213804161\
+453894620976763957492805125680148697998824491969672971166027\
+180656446801877171069880212083821586527774381471938887462267\
+296899230122475689865309301760858111386017280236814433190859\
+056775862835626324841690460105276503738155096364862500284444\
+534355852480049710328635489743555059728455908589253208618030\
+435328529902401798471113159138000614546932833170782820217007\
+280555759644239993454255391040403122345898223865007840565901\
+568897868969477318635101744807938902538658059188203743585010\
+774036188072258210874395280659266831769875140840386730345127\
+896213224531135734216598150684561709935188763611823258429535\
+949485724798457980490432226268479100942840366849845718310701\
+201469881667256363013936740095127208213646187168979882123038\
+233894681808950467950348320835221712924541137611086830583320\
+322392848230358837873140824038588941813883882580818470592924\
+936150343266633985142843655469994569073421029983930187839673\
+231304118378435528853547015678271557689994924601344298390228\
+619544093746214985249883379160686079281428516645627300822824\
+554858971061164154855964833723337825341913008711122841606297\
+197473771096334331602524570534960013696483960191358924434313\
+204392666956909347275363383898878667630642018321060515094118\
+366254498987167810320495485827416968962224010263497699545330\
+700657309536605222308797502818350426296399499436888453557895\
+867230278273510526890091559230412097455704458315552197774216\
+020745527743626346151485239632739221842741175405177684804394\
+361711074487719586587230018764876415713150171856819389147341\
+275669916553647687850492420266494611267030777224588709818335\
+130470138515564128370191474596569064918407585797604709553556\
+153119278534086702508240133812429162630997831448842506314109\
+096085389961648575948522991756162744630412635636848292144248\
+454353112463327392007249690205303145102507449765353317125075\
+809869430616460927871568186526610739964782640547967178516125\
+405550545621289728437343949195632975960067100886025662262995\
+603152291369500371247077545422478193737712990735596074413987\
+957973881092036286428057398201980915642421361590996553421555\
+316064082532807274813471773535367399675092780772709495672695\
+638383696748260197644726786065705886850676921416175143972878\
+598022936105171100945812789025606978738223958028881794991460\
+717838828707859620282931646221494189728518355751185688156172\
+707197545186901278242225037114294367925941035155563079724640\
+691338994542267517327767311818967695636738982145621453404681\
+597847179517622202885989672690265113711173934611717946823228\
+397269027374612101610291381645684907000127191954606896606821\
+590588324712918734294575638459194809203005860495067520818982\
+501215535430594372806160514507726395270189393064661968830908\
+304247420614491691520206185072149333329597584485319840857460\
+265175822272362267526401706014494934473630591895417261120077\
+133201893929459989521012503630498808303587706658289229523671\
+490086823643677193804640968971899497667525177372180606601357\
+946053731548464954766765148914121287985119918483345042934824\
+921516525874627647509368638818236001368121865230049945146050\
+915400988318811431699646592683887426055545037715235200928093\
+246677400833057921544547343859646810337159831128073581305667\
+357013148110868411733638100650377414586379725851070828342144\
+324871613425390515134466319365812090990461348903165220975937\
+942087587710809288871423718310748650171330836567440569630410\
+158371483868179555733183389141963880079090211810793589559200\
+341349405637234489991011938576106350455389513465949915412344\
+095068082292812278313616014687263054439671001595898696547120\
+071413092106692303936769895441754991768984405737441179222392\
+477690507985618624574174635988619556351531961292903622442398\
+465808497855672165108657385643858675294859076016771263488980\
+522695116051395273941662616850391834541635202685385855278463\
+251898869471939032633039670027544098536117464245519928068578\
+059287479506611827627630303758606108821427100635428077686167\
+838877563228833937206563827108338906357929116383562352410405\
+819098609305801465027923966325234651981390511492536734174727\
+254390774950693797823728058324006157763280570016526212182043\
+359093899236806643141856753863283409843786902795368575137111\
+428715987789800161590594633948264245607103000992774452293895\
+095821092685830313673954662073218494688153180395906146506745\
+561411975629305038852550421137841068003638882161156093692580\
+530194161044123524750036105635809277947168629873067749519842\
+957433509350316508339628224443809642374220084876711715865698\
+238309708050571369447923974325750197314968509790081061483804\
+453550810603239090298082506325805730097187923044635197024326\
+966746334305257051886113456387761013622870382593208533889592\
+238925214891289068690048585049758987775121620114117517878005\
+875020040085404765102967971726139392362711332104766149529294\
+277730971232752039868784363740304437529370880909321409176692\
+668840956756850124527879832299559696177391050297700824622043\
+866382460366020930152337219476058757174016585113549831063750\
+560749343236827486905002179231150529681970396017795115367543\
+697626587387836076075141284451928300176122499787310671827087\
+811887033677814397925059153373881836118105886419378651616798\
+592240268616476519445858857179518827325394147075773777729444\
+146380220504445359824894865222389302601440729048815894804537\
+204733015744064565559548968109597836406827155741056311263299\
+722947063908589431715872616727470668964127501101998064669236\
+547074458426237111173086536319506989478611558297416195273399\
+35302734375001e-4966L;
+/* 0x1.00000000000000000000000000008p16383 */
+static const long double ld3ae = 0x1p16383L, ld3be = 0x1p16383L, ld3ce = 0x1.0000000000000000000000000001p16383L;
+static const long double ld3a =
+5.9486574767861588254287966331400362266521016077566321470782\
+537912717956830282749074200158904838100315216442070246474582\
+902003466452178519493817532236893426065414065500349426609921\
+035191682920005861156266113904955955975156868485667432573303\
+878926292023832306985858165533616318247459636179261303962505\
+904914506095247123433601806274279678546351097459236573913920\
+031119173565521719790447288258729779003490433862818295682642\
+966216118764004792730459319737327354906008978235133081179386\
+661103577408353480771246949457853166617701522167422003413661\
+284349262437896929014552545611813747697933241007066137144800\
+742052491919942298834913628182656296203230288447275444631994\
+418174246363265098248611943128819168942591708210157385631417\
+956400560296628065072016801065604053356267458749418972817500\
+860163920552394032596390414022010839803056885484295371329659\
+344624001094572196271168792142488910586863048428263135994222\
+918660801863635503541746352435642903327106245556596971697306\
+154375736529491499973297647239267168544491542059174479409314\
+453930981788080813637734358380528957486229480817553751111130\
+404254432007093360403147894746265072027252334199618554793914\
+408408563073872776198001518686536858983411123156743992398602\
+085226973929708268146742705557350571330511483380748376403472\
+416543579901056379914358020396036857647833383066531875675143\
+906511120597222727322243981995901699031025427175941279288823\
+868963521340475095965307606235778429805072284801680535137734\
+383642104178041358430293569208331406005130704155581295151191\
+023575851522079817808333970280354640050199344622016227349001\
+158400930280667186488774262251890453600109065837537684194570\
+764422774923245437306731669764159584659798151950637627762794\
+773771743234047950402370403351226180108444229650943701626484\
+199813157683590670152514287926030050893275989087988431157294\
+053225152320381185461962202878894704210605536874860744635921\
+856800920799848781308318732102232154544901177747472418520161\
+539850654183977571241391795912749098112352006092865789718049\
+308722403022684428414862730635213534446271587083620368851394\
+539053886621230946713996355227159995125430034494483477708852\
+290917108703653719242299789100268057863851224567265334616704\
+172517852701300018859009181286438758473871366303386211559752\
+189988549719766361306120241141163757479824826687017385967199\
+730649217746155593260923125994938678356692052428393066501806\
+030161358556419313420716683771612548240263459903320490075985\
+482955242306590857238462197972208846146747634114611463194143\
+127229709932188005016692926586196070737427116881065809283735\
+578248117685225847553587906225824731173075427424421056682930\
+008434666477496431516691881829440430197100204332606435934395\
+919650053069892524027974091575173698894803107552411683630872\
+565514028274910395383420510115859479233531504702656455261624\
+525121293886827716275308028935388238178963278225114817400178\
+138358373030159940110845417191798464503817960506134575572552\
+914585335913528444536373142082490326061583126796147603336390\
+503084982226891516248370317420733394038771780044922478150880\
+480334844447412365553656029955296322473008695074712792828366\
+405738282245039545396582938290818627301780773130202921675326\
+417583673495241569334204568141534153408474297319168484568799\
+451491133718839097374713416523361939237171154953070144389353\
+699828605993755613252573941610133829557167740458222617685028\
+690018342727148122013513056358815140027414679795450105000784\
+206522215604435223172005007036171570530334304897008809135848\
+675229547083561399988252552429769084290516103080260036003448\
+294799988351419108088251107290628711358276092795741489822211\
+879153727229891058795497426373608319405317602924241055836665\
+412584135657242160003706626205312971822953452930840783143003\
+733239017808969394445195220787737174218027747221253900890536\
+730326425051240764874006627032589076376990325467270006751475\
+463920721323985366812116303998245085483206258613663624851716\
+293180303624443281556295689730668616708901429287181381627670\
+203893651414675005136379365959571811951919653635887567699289\
+348324076406793991923217469674198904524716009847788439650157\
+995310043698774137542541699134940585662745702625097983274489\
+141416414789061652098131796728731652650516767112149192122453\
+562328802846445391417036742140146906572447511494124473885963\
+235217227016424204095604485308686968373890645296189932416571\
+281295736247619241329068636405743573306087991776733585972793\
+132869616481671565021096885870153734254648327143225051745267\
+530463119926261147612098111086806545372953526471421579845285\
+862975776235466663857936867536855924718593170503922894779577\
+706239977813334283740751103082483280516469722321753891088699\
+714361755511843803441649441302693703577359971743834932539197\
+595873998629500074441134301810890941848881837426270390549007\
+490141375766653241037340192392236932759127069111401216220596\
+540958515892047794438580629374176225297401789362125586732528\
+367695144980519774116001979888033796577336271850743828263427\
+598863925843301048044096576340652808516459551933515596083641\
+0468395384831999e+4931L;
+static const long double ld3b =
+5.9486574767861588254287966331400362266521016077566321470782\
+537912717956830282749074200158904838100315216442070246474582\
+902003466452178519493817532236893426065414065500349426609921\
+035191682920005861156266113904955955975156868485667432573303\
+878926292023832306985858165533616318247459636179261303962505\
+904914506095247123433601806274279678546351097459236573913920\
+031119173565521719790447288258729779003490433862818295682642\
+966216118764004792730459319737327354906008978235133081179386\
+661103577408353480771246949457853166617701522167422003413661\
+284349262437896929014552545611813747697933241007066137144800\
+742052491919942298834913628182656296203230288447275444631994\
+418174246363265098248611943128819168942591708210157385631417\
+956400560296628065072016801065604053356267458749418972817500\
+860163920552394032596390414022010839803056885484295371329659\
+344624001094572196271168792142488910586863048428263135994222\
+918660801863635503541746352435642903327106245556596971697306\
+154375736529491499973297647239267168544491542059174479409314\
+453930981788080813637734358380528957486229480817553751111130\
+404254432007093360403147894746265072027252334199618554793914\
+408408563073872776198001518686536858983411123156743992398602\
+085226973929708268146742705557350571330511483380748376403472\
+416543579901056379914358020396036857647833383066531875675143\
+906511120597222727322243981995901699031025427175941279288823\
+868963521340475095965307606235778429805072284801680535137734\
+383642104178041358430293569208331406005130704155581295151191\
+023575851522079817808333970280354640050199344622016227349001\
+158400930280667186488774262251890453600109065837537684194570\
+764422774923245437306731669764159584659798151950637627762794\
+773771743234047950402370403351226180108444229650943701626484\
+199813157683590670152514287926030050893275989087988431157294\
+053225152320381185461962202878894704210605536874860744635921\
+856800920799848781308318732102232154544901177747472418520161\
+539850654183977571241391795912749098112352006092865789718049\
+308722403022684428414862730635213534446271587083620368851394\
+539053886621230946713996355227159995125430034494483477708852\
+290917108703653719242299789100268057863851224567265334616704\
+172517852701300018859009181286438758473871366303386211559752\
+189988549719766361306120241141163757479824826687017385967199\
+730649217746155593260923125994938678356692052428393066501806\
+030161358556419313420716683771612548240263459903320490075985\
+482955242306590857238462197972208846146747634114611463194143\
+127229709932188005016692926586196070737427116881065809283735\
+578248117685225847553587906225824731173075427424421056682930\
+008434666477496431516691881829440430197100204332606435934395\
+919650053069892524027974091575173698894803107552411683630872\
+565514028274910395383420510115859479233531504702656455261624\
+525121293886827716275308028935388238178963278225114817400178\
+138358373030159940110845417191798464503817960506134575572552\
+914585335913528444536373142082490326061583126796147603336390\
+503084982226891516248370317420733394038771780044922478150880\
+480334844447412365553656029955296322473008695074712792828366\
+405738282245039545396582938290818627301780773130202921675326\
+417583673495241569334204568141534153408474297319168484568799\
+451491133718839097374713416523361939237171154953070144389353\
+699828605993755613252573941610133829557167740458222617685028\
+690018342727148122013513056358815140027414679795450105000784\
+206522215604435223172005007036171570530334304897008809135848\
+675229547083561399988252552429769084290516103080260036003448\
+294799988351419108088251107290628711358276092795741489822211\
+879153727229891058795497426373608319405317602924241055836665\
+412584135657242160003706626205312971822953452930840783143003\
+733239017808969394445195220787737174218027747221253900890536\
+730326425051240764874006627032589076376990325467270006751475\
+463920721323985366812116303998245085483206258613663624851716\
+293180303624443281556295689730668616708901429287181381627670\
+203893651414675005136379365959571811951919653635887567699289\
+348324076406793991923217469674198904524716009847788439650157\
+995310043698774137542541699134940585662745702625097983274489\
+141416414789061652098131796728731652650516767112149192122453\
+562328802846445391417036742140146906572447511494124473885963\
+235217227016424204095604485308686968373890645296189932416571\
+281295736247619241329068636405743573306087991776733585972793\
+132869616481671565021096885870153734254648327143225051745267\
+530463119926261147612098111086806545372953526471421579845285\
+862975776235466663857936867536855924718593170503922894779577\
+706239977813334283740751103082483280516469722321753891088699\
+714361755511843803441649441302693703577359971743834932539197\
+595873998629500074441134301810890941848881837426270390549007\
+490141375766653241037340192392236932759127069111401216220596\
+540958515892047794438580629374176225297401789362125586732528\
+367695144980519774116001979888033796577336271850743828263427\
+598863925843301048044096576340652808516459551933515596083641\
+0468395384832e+4931L;
+static const long double ld3c =
+5.9486574767861588254287966331400362266521016077566321470782\
+537912717956830282749074200158904838100315216442070246474582\
+902003466452178519493817532236893426065414065500349426609921\
+035191682920005861156266113904955955975156868485667432573303\
+878926292023832306985858165533616318247459636179261303962505\
+904914506095247123433601806274279678546351097459236573913920\
+031119173565521719790447288258729779003490433862818295682642\
+966216118764004792730459319737327354906008978235133081179386\
+661103577408353480771246949457853166617701522167422003413661\
+284349262437896929014552545611813747697933241007066137144800\
+742052491919942298834913628182656296203230288447275444631994\
+418174246363265098248611943128819168942591708210157385631417\
+956400560296628065072016801065604053356267458749418972817500\
+860163920552394032596390414022010839803056885484295371329659\
+344624001094572196271168792142488910586863048428263135994222\
+918660801863635503541746352435642903327106245556596971697306\
+154375736529491499973297647239267168544491542059174479409314\
+453930981788080813637734358380528957486229480817553751111130\
+404254432007093360403147894746265072027252334199618554793914\
+408408563073872776198001518686536858983411123156743992398602\
+085226973929708268146742705557350571330511483380748376403472\
+416543579901056379914358020396036857647833383066531875675143\
+906511120597222727322243981995901699031025427175941279288823\
+868963521340475095965307606235778429805072284801680535137734\
+383642104178041358430293569208331406005130704155581295151191\
+023575851522079817808333970280354640050199344622016227349001\
+158400930280667186488774262251890453600109065837537684194570\
+764422774923245437306731669764159584659798151950637627762794\
+773771743234047950402370403351226180108444229650943701626484\
+199813157683590670152514287926030050893275989087988431157294\
+053225152320381185461962202878894704210605536874860744635921\
+856800920799848781308318732102232154544901177747472418520161\
+539850654183977571241391795912749098112352006092865789718049\
+308722403022684428414862730635213534446271587083620368851394\
+539053886621230946713996355227159995125430034494483477708852\
+290917108703653719242299789100268057863851224567265334616704\
+172517852701300018859009181286438758473871366303386211559752\
+189988549719766361306120241141163757479824826687017385967199\
+730649217746155593260923125994938678356692052428393066501806\
+030161358556419313420716683771612548240263459903320490075985\
+482955242306590857238462197972208846146747634114611463194143\
+127229709932188005016692926586196070737427116881065809283735\
+578248117685225847553587906225824731173075427424421056682930\
+008434666477496431516691881829440430197100204332606435934395\
+919650053069892524027974091575173698894803107552411683630872\
+565514028274910395383420510115859479233531504702656455261624\
+525121293886827716275308028935388238178963278225114817400178\
+138358373030159940110845417191798464503817960506134575572552\
+914585335913528444536373142082490326061583126796147603336390\
+503084982226891516248370317420733394038771780044922478150880\
+480334844447412365553656029955296322473008695074712792828366\
+405738282245039545396582938290818627301780773130202921675326\
+417583673495241569334204568141534153408474297319168484568799\
+451491133718839097374713416523361939237171154953070144389353\
+699828605993755613252573941610133829557167740458222617685028\
+690018342727148122013513056358815140027414679795450105000784\
+206522215604435223172005007036171570530334304897008809135848\
+675229547083561399988252552429769084290516103080260036003448\
+294799988351419108088251107290628711358276092795741489822211\
+879153727229891058795497426373608319405317602924241055836665\
+412584135657242160003706626205312971822953452930840783143003\
+733239017808969394445195220787737174218027747221253900890536\
+730326425051240764874006627032589076376990325467270006751475\
+463920721323985366812116303998245085483206258613663624851716\
+293180303624443281556295689730668616708901429287181381627670\
+203893651414675005136379365959571811951919653635887567699289\
+348324076406793991923217469674198904524716009847788439650157\
+995310043698774137542541699134940585662745702625097983274489\
+141416414789061652098131796728731652650516767112149192122453\
+562328802846445391417036742140146906572447511494124473885963\
+235217227016424204095604485308686968373890645296189932416571\
+281295736247619241329068636405743573306087991776733585972793\
+132869616481671565021096885870153734254648327143225051745267\
+530463119926261147612098111086806545372953526471421579845285\
+862975776235466663857936867536855924718593170503922894779577\
+706239977813334283740751103082483280516469722321753891088699\
+714361755511843803441649441302693703577359971743834932539197\
+595873998629500074441134301810890941848881837426270390549007\
+490141375766653241037340192392236932759127069111401216220596\
+540958515892047794438580629374176225297401789362125586732528\
+367695144980519774116001979888033796577336271850743828263427\
+598863925843301048044096576340652808516459551933515596083641\
+0468395384832001e+4931L;
+#endif
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+#ifdef FLT_OK
+ if (f1a != f1ae
+ || f1b != f1be
+ || f1c != f1ce
+ || f2a != f2ae
+ || f2b != f2be
+ || f2c != f2ce
+ || f3a != f3ae
+ || f3b != f3be
+ || f3c != f3ce)
+ abort ();
+#endif
+#ifdef DBL_OK
+ if (d1a != d1ae
+ || d1b != d1be
+ || d1c != d1ce
+ || d2a != d2ae
+ || d2b != d2be
+ || d2c != d2ce
+ || d3a != d3ae
+ || d3b != d3be
+ || d3c != d3ce)
+ abort ();
+#endif
+#ifdef LDBL_OK
+ if (ld1a != ld1ae
+ || ld1b != ld1be
+ || ld1c != ld1ce
+ || ld2a != ld2ae
+ || ld2b != ld2be
+ || ld2c != ld2ce
+ || ld3a != ld3ae
+ || ld3b != ld3be
+ || ld3c != ld3ce)
+ abort ();
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/float-range-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-1.c
new file mode 100644
index 000000000..ddd7fd672
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-1.c
@@ -0,0 +1,15 @@
+/* Floating constants outside the range of their type should receive a
+ just a warning if the target supports infinities. Otherwise, a
+ pedwarn should be produced. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-ansi -pedantic-errors -Woverflow" } */
+/* { dg-skip-if "No Inf support" { spu-*-* } } */
+
+void
+f (void)
+{
+ float a = 1e+100000000f; /* { dg-warning "floating constant exceeds range of 'float'" "" } */
+ double b = 1e+100000000; /* { dg-warning "floating constant exceeds range of 'double'" } */
+ long double c = 1e+100000000l; /* { dg-warning "floating constant exceeds range of 'long double'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/float-range-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-2.c
new file mode 100644
index 000000000..d6c0b8a40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-2.c
@@ -0,0 +1,14 @@
+/* Floating constants outside the range of their type should receive a
+ pedwarn, not a warning. This includes INFINITY if the target does
+ not support infinities. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile { target vax-*-* pdp11-*-* } } */
+/* { dg-options "-ansi -pedantic-errors" } */
+
+void
+f (void)
+{
+ float a = __builtin_inff (); /* { dg-error "target format does not support infinity" } */
+ double b = __builtin_inf (); /* { dg-error "target format does not support infinity" } */
+ long double c = __builtin_infl (); /* { dg-error "target format does not support infinity" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/float-range-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-3.c
new file mode 100644
index 000000000..32bef98df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-3.c
@@ -0,0 +1,43 @@
+/* PR 23572 : warnings for out of range floating-point constants. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+/* { dg-skip-if "No Inf support" { spu-*-* } } */
+#include <math.h>
+
+#ifndef INFINITY
+#define INFINITY (__builtin_inff ())
+#endif
+
+void overflow(void)
+{
+ float f1 = 3.5E+38f; /* { dg-warning "floating constant exceeds range" } */
+ float f2 = -3.5E+38f; /* { dg-warning "floating constant exceeds range" } */
+ float f3 = INFINITY;
+ float f4 = -INFINITY;
+
+ double d1 = 1.9E+308; /* { dg-warning "floating constant exceeds range" } */
+ double d2 = -1.9E+308; /* { dg-warning "floating constant exceeds range" } */
+ double d3 = INFINITY;
+ double d4 = -INFINITY;
+}
+
+void underflow(void)
+{
+ float f11 = 3.3E-10000000000000000000f; /* { dg-warning "floating constant truncated to zero" } */
+ float f22 = -3.3E-10000000000000000000f; /* { dg-warning "floating constant truncated to zero" } */
+ float f1 = 3.3E-46f; /* { dg-warning "floating constant truncated to zero" } */
+ float f2 = -3.3E-46f; /* { dg-warning "floating constant truncated to zero" } */
+ float f3 = 0;
+ float f4 = -0;
+ float f5 = 0.0;
+ float f6 = -0.0;
+
+ double d11 = 3.3E-10000000000000000000; /* { dg-warning "floating constant truncated to zero" } */
+ double d22 = -3.3E-10000000000000000000; /* { dg-warning "floating constant truncated to zero" } */
+ double d1 = 1.4E-325; /* { dg-warning "floating constant truncated to zero" } */
+ double d2 = -1.4E-325; /* { dg-warning "floating constant truncated to zero" } */
+ double d3 = 0;
+ double d4 = -0;
+ double d5 = 0.0;
+ double d6 = -0.0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/float-range-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-4.c
new file mode 100644
index 000000000..a50a47d18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-4.c
@@ -0,0 +1,43 @@
+/* PR 23572 : warnings for out of range floating-point constants. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-overflow -std=c99" } */
+/* { dg-skip-if "No Inf support" { spu-*-* } } */
+#include <math.h>
+
+#ifndef INFINITY
+#define INFINITY (__builtin_inff ())
+#endif
+
+void overflow(void)
+{
+ float f1 = 3.5E+38f;
+ float f2 = -3.5E+38f;
+ float f3 = INFINITY;
+ float f4 = -INFINITY;
+
+ double d1 = 1.9E+308;
+ double d2 = -1.9E+308;
+ double d3 = INFINITY;
+ double d4 = -INFINITY;
+}
+
+void underflow(void)
+{
+ float f11 = 3.3E-10000000000000000000f;
+ float f22 = -3.3E-10000000000000000000f;
+ float f1 = 3.3E-46f;
+ float f2 = -3.3E-46f;
+ float f3 = 0;
+ float f4 = -0;
+ float f5 = 0.0;
+ float f6 = -0.0;
+
+ double d11 = 3.3E-10000000000000000000;
+ double d22 = -3.3E-10000000000000000000;
+ double d1 = 1.4E-325;
+ double d2 = -1.4E-325;
+ double d3 = 0;
+ double d4 = -0;
+ double d5 = 0.0;
+ double d6 = -0.0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/float-range-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-5.c
new file mode 100644
index 000000000..034f36058
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/float-range-5.c
@@ -0,0 +1,44 @@
+/* PR 23572 : warnings for out of range floating-point constants
+ Test that they are NOT pedantic warnings. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -std=c99" } */
+/* { dg-skip-if "No Inf support" { spu-*-* } } */
+#include <math.h>
+
+#ifndef INFINITY
+#define INFINITY (__builtin_inff ())
+#endif
+
+void overflow(void)
+{
+ float f1 = 3.5E+38f; /* { dg-warning "floating constant exceeds range" } */
+ float f2 = -3.5E+38f; /* { dg-warning "floating constant exceeds range" } */
+ float f3 = INFINITY;
+ float f4 = -INFINITY;
+
+ double d1 = 1.9E+308; /* { dg-warning "floating constant exceeds range" } */
+ double d2 = -1.9E+308; /* { dg-warning "floating constant exceeds range" } */
+ double d3 = INFINITY;
+ double d4 = -INFINITY;
+}
+
+void underflow(void)
+{
+ float f11 = 3.3E-10000000000000000000f; /* { dg-warning "floating constant truncated to zero" } */
+ float f22 = -3.3E-10000000000000000000f; /* { dg-warning "floating constant truncated to zero" } */
+ float f1 = 3.3E-46f; /* { dg-warning "floating constant truncated to zero" } */
+ float f2 = -3.3E-46f; /* { dg-warning "floating constant truncated to zero" } */
+ float f3 = 0;
+ float f4 = -0;
+ float f5 = 0.0;
+ float f6 = -0.0;
+
+ double d11 = 3.3E-10000000000000000000; /* { dg-warning "floating constant truncated to zero" } */
+ double d22 = -3.3E-10000000000000000000; /* { dg-warning "floating constant truncated to zero" } */
+ double d1 = 1.4E-325; /* { dg-warning "floating constant truncated to zero" } */
+ double d2 = -1.4E-325; /* { dg-warning "floating constant truncated to zero" } */
+ double d3 = 0;
+ double d4 = -0;
+ double d5 = 0.0;
+ double d6 = -0.0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-1.c
new file mode 100644
index 000000000..e8ecf6750
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fshow-column" } */
+
+double a = 1.ld; /* { dg-error "12:invalid suffix" } */
+double b = 1.fd; /* { dg-error "12:invalid suffix" } */
+double c = 1.di;
+double d = 1.dj;
+double e = 1.id;
+double f = 1.jd;
+double g = 1.ddd; /* { dg-error "12:invalid suffix" } */
+double h = 1.ldd; /* { dg-error "12:invalid suffix" } */
+double i = 1.dld; /* { dg-error "12:invalid suffix" } */
+double j = 1.ddl; /* { dg-error "12:invalid suffix" } */
+double k = 1.fdd; /* { dg-error "12:invalid suffix" } */
+double l = 1.dfd; /* { dg-error "12:invalid suffix" } */
+double m = 1.ddf; /* { dg-error "12:invalid suffix" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-2.c
new file mode 100644
index 000000000..d4d06ac88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-2.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* Check that d or D is recognized as a float constant suffix. */
+
+double d = 0.5d;
+double D = 0.5D;
+
+/* Check that d or D is recognized in a hexadecimal floating constant. */
+
+double hd1 = 0x1.8p1d;
+double hd2 = 0x1.p+1D;
+double hd3 = 0x0.8p-1d;
+
+/* Check that imaginary constant suffixes are still recognized with
+ only i, I, j, or J. */
+
+double i = 0.5i;
+double I = 0.5I;
+double j = 0.5j;
+double J = 0.5J;
+
+/* Check that imaginary constant suffixes are allowed with d or D. */
+
+double di = 0.5di;
+double dI = 0.5dI;
+double Di = 0.5Di;
+double DI = 0.5DI;
+double dj = 0.5dj;
+double dJ = 0.5dJ;
+double Dj = 0.5Dj;
+double DJ = 0.5DJ;
+double id = 0.5id;
+double iD = 0.5iD;
+double Id = 0.5Id;
+double ID = 0.5ID;
+double jd = 0.5jd;
+double jD = 0.5jD;
+double Jd = 0.5Jd;
+double JD = 0.5JD;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-double-pedantic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-double-pedantic-1.c
new file mode 100644
index 000000000..07827296d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-double-pedantic-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic" } */
+
+double a = 1.d; /* { dg-warning "double constant" } */
+double b = 1.D; /* { dg-warning "double constant" } */
+double c = 1.1e+2d; /* { dg-warning "double constant" } */
+
+double d = 1.di; /* { dg-warning "imaginary constants" } */
+double e = 1.dj; /* { dg-warning "imaginary constants" } */
+double f = 1.id; /* { dg-warning "imaginary constants" } */
+double g = 1.jd; /* { dg-warning "imaginary constants" } */
+
+double h = 0x1.5p1d; /* { dg-warning "double constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-double-pedantic-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-double-pedantic-2.c
new file mode 100644
index 000000000..316571f76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-double-pedantic-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+double a = 1.d; /* { dg-error "double constant" } */
+double b = 1.D; /* { dg-error "double constant" } */
+double c = 1.1e+2d; /* { dg-error "double constant" } */
+
+double d = 1.di; /* { dg-error "imaginary constants" } */
+double e = 1.dj; /* { dg-error "imaginary constants" } */
+double f = 1.id; /* { dg-error "imaginary constants" } */
+double g = 1.jd; /* { dg-error "imaginary constants" } */
+
+double h = 0x1.5p1d; /* { dg-error "double constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
new file mode 100644
index 000000000..d0d1c4c52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+double a = 1.dl; /* { dg-warning "decimal float" } */
+double b = 1.df; /* { dg-warning "decimal float" } */
+double c = 1.dd; /* { dg-warning "decimal float" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fnegate-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fnegate-1.c
new file mode 100644
index 000000000..ad0f4e09f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fnegate-1.c
@@ -0,0 +1,113 @@
+/* Copyright (C) 2002 Free Software Foundation.
+
+ Test floating point negation produces the expected results.
+
+ Written by Roger Sayle, 21st May 2002. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void abort ();
+
+
+double
+dneg (double x)
+{
+ return -x;
+}
+
+double
+dmult (double x)
+{
+ return -1.0 * x;
+}
+
+double
+ddiv (double x)
+{
+ return x / -1.0;
+}
+
+
+float
+fneg (float x)
+{
+ return -x;
+}
+
+float
+fmult (float x)
+{
+ return -1.0f * x;
+}
+
+float
+fdiv (float x)
+{
+ return x / -1.0f;
+}
+
+
+void
+ftest(float src, float dst)
+{
+ if (fneg (src) != dst)
+ abort ();
+
+ if (src != fneg (dst))
+ abort ();
+
+ if (fmult (src) != dst)
+ abort ();
+
+ if (src != fmult (dst))
+ abort ();
+
+ if (fdiv (src) != dst)
+ abort ();
+
+ if (src != fdiv(dst))
+ abort ();
+}
+
+void
+dtest(double src, double dst)
+{
+ if (dneg (src) != dst)
+ abort ();
+
+ if (src != dneg (dst))
+ abort ();
+
+ if (dmult (src) != dst)
+ abort ();
+
+ if (src != dmult (dst))
+ abort ();
+
+ if (ddiv (src) != dst)
+ abort ();
+
+ if (src != ddiv(dst))
+ abort ();
+}
+
+
+int
+main ()
+{
+ ftest (1.0f, -1.0f);
+ ftest (2.0f, -2.0f);
+ ftest (-3.0f, 3.0f);
+ ftest (0.0f, -0.0f);
+ ftest (-0.0f, 0.0f);
+
+ dtest (1.0, -1.0);
+ dtest (2.0, -2.0);
+ dtest (-3.0, 3.0);
+ dtest (0.0, -0.0);
+ dtest (-0.0, 0.0);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-1.c
new file mode 100644
index 000000000..2e69a2075
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fwrapv" } */
+#define ABS(x) (x > 0 ? x : -x)
+int f (int a, int b) {
+ if ((ABS(a) | b) != 0) return 1;
+ else return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-2.c
new file mode 100644
index 000000000..6291d7e53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-2.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -fwrapv" } */
+#include <limits.h>
+void exit (int);
+void abort ();
+#define ABS(x) (x > 0 ? x : -x)
+int f (int a) {
+ if (ABS(a) >= 0) return 1;
+ else return 0;
+}
+
+int main (int argc, char *argv[]) {
+ if (f(INT_MIN))
+ abort ();
+ else
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-3.c
new file mode 100644
index 000000000..d151a8d7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple -fwrapv" } */
+#define ABS(x) (x > 0 ? x : -x)
+int f (int a) {
+ return ABS (ABS(a));
+}
+
+/* { dg-final { scan-tree-dump-times "ABS" 1 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-4.c
new file mode 100644
index 000000000..8bf02a808
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-abs-4.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple -fwrapv" } */
+extern float fabsf (float);
+extern float cabsf (_Complex float);
+
+int f (float a) {
+ return fabsf(a) < 0.0;
+}
+
+int g (_Complex float a) {
+ return cabsf (a) < 0.0;
+}
+
+/* { dg-final { scan-tree-dump-times "ABS" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-addr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-addr-1.c
new file mode 100644
index 000000000..7323ffdab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-addr-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+int bar(char p1, char p2)
+{
+ return &p1 == &p2;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-alloca-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-alloca-1.c
new file mode 100644
index 000000000..93f28cfa1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-alloca-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-cfg" } */
+
+void *alloca (__SIZE_TYPE__);
+void link_error ();
+
+int main (int argc, char *argv[]) {
+ char *foo;
+ if ((foo = alloca(argc)) == 0)
+ link_error ();
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "link_error" 0 "cfg" } } */
+/* { dg-final { cleanup-tree-dump "cfg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-andxor-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-andxor-1.c
new file mode 100644
index 000000000..cc4657714
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-andxor-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a, int b)
+{
+ return (a ^ b) & a;
+}
+
+int test2(int c, int d)
+{
+ return (c ^ d) & d;
+}
+
+int test3(int e, int f)
+{
+ return e & (e ^ f);
+}
+
+int test4(int g, int h)
+{
+ return g & (h ^ g);
+}
+
+/* { dg-final { scan-tree-dump-times "~b \& a" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "~c \& d" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "~f \& e" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "~h \& g" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-1.c
new file mode 100644
index 000000000..f490b153b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-w -fdump-tree-original" } */
+
+char c1 __attribute__ ((aligned (1)));
+char c2 __attribute__ ((aligned (2)));
+char c4 __attribute__ ((aligned (4)));
+char c8 __attribute__ ((aligned (8)));
+unsigned f1(void)
+{
+ return 3 & (__SIZE_TYPE__)&c1;
+}
+
+unsigned f2(void)
+{
+ return 3 & (__SIZE_TYPE__)&c2;
+}
+
+unsigned f3(void)
+{
+ return 3 & (__SIZE_TYPE__)&c4;
+}
+
+unsigned f4(void)
+{
+ return 3 & (__SIZE_TYPE__)&c8;
+}
+
+/* { dg-final { scan-tree-dump-times "\&c1 \& 3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\&c2 \& 3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\&c4 \& 3" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "\&c8 \& 3" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 2 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-2.c
new file mode 100644
index 000000000..de2e67449
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-2.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+struct {
+ char c1;
+ char c2;
+ char c3;
+ char c4;
+} s __attribute__ ((aligned (4)));
+
+unsigned f1 (void)
+{
+ return 3 & (__SIZE_TYPE__)&s.c1;
+}
+
+unsigned f2 (void)
+{
+ return 3 & (__SIZE_TYPE__)&s.c2;
+}
+
+unsigned f3 (void)
+{
+ return 3 & (__SIZE_TYPE__)&s.c3;
+}
+
+unsigned f4 (void)
+{
+ return 3 & (__SIZE_TYPE__)&s.c4;
+}
+
+unsigned f5 (void)
+{
+ return 4 & (__SIZE_TYPE__)&s.c1;
+}
+
+/* { dg-final { scan-tree-dump-times "\& 3" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "\& 4" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 1" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 2" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 3" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-3.c
new file mode 100644
index 000000000..43d765bbf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-3.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+char c[4] __attribute__ ((aligned (4)));
+
+struct S {
+ char c1;
+ char c2;
+ char c3;
+ char c4;
+};
+
+int f1 (void)
+{
+ return 3 & (__SIZE_TYPE__)&c[1];
+}
+
+int f2 (void)
+{
+ return 3 & (__SIZE_TYPE__)&((struct S *)&c)->c2;
+}
+
+/* { dg-final { scan-tree-dump-times "\& 3" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 1" 2 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-4.c
new file mode 100644
index 000000000..dba83615d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-bitand-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-original" } */
+
+int foo (int i)
+{
+ return (i * 8) & 5;
+}
+
+unsigned bar (unsigned i)
+{
+ return (i * 6) & 5;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\&" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\\& 4;" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-1.c
new file mode 100644
index 000000000..8d53acd87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-1.c
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a, int b)
+{
+ return ~a == ~b;
+}
+
+int test2(int c, int d)
+{
+ return -c == -d;
+}
+
+int test3(int e)
+{
+ return -e == 5;
+}
+
+int test4(int f)
+{
+ return ~f == 5;
+}
+
+int test5(int g, int h)
+{
+ return ~g < ~h;
+}
+
+int test6(int i, int j)
+{
+ return ~i >= ~j;
+}
+
+int test7(int k)
+{
+ return ~k < 3;
+}
+
+int test8(int l)
+{
+ return ~l >= 2;
+}
+
+/* { dg-final { scan-tree-dump-times "b == a" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "c == d" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "e == -5" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "f == -6" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "h < g" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "j >= i" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "k >= -3" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "l < -2" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-2.c
new file mode 100644
index 000000000..15ea462d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-tail-merge -fdump-tree-vrp1" } */
+
+extern void abort (void);
+
+int a;
+
+int
+main(void)
+{
+ if (a * 1000 < 0)
+ abort ();
+ if (a * -43 > 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Removing basic block" 2 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-3.c
new file mode 100644
index 000000000..d38a945ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-3.c
@@ -0,0 +1,159 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cfg" } */
+
+#include <limits.h>
+
+void this_comparison_is_false (void);
+void this_comparison_is_true (void);
+void this_comparison_is_not_decidable (void);
+
+void bla1eq (int var)
+{
+ if (var + 10 == INT_MIN + 9)
+ this_comparison_is_false ();
+}
+
+void bla2eq (int var)
+{
+ if (var + 10 == INT_MIN + 10)
+ this_comparison_is_not_decidable ();
+}
+
+void bla3eq (int var)
+{
+ if (var - 10 == INT_MAX - 9)
+ this_comparison_is_false ();
+}
+
+void bla4eq (int var)
+{
+ if (var - 10 == INT_MAX - 10)
+ this_comparison_is_not_decidable ();
+}
+
+void bla1ne (int var)
+{
+ if (var + 10 != INT_MIN + 9)
+ this_comparison_is_true ();
+}
+
+void bla2ne (int var)
+{
+ if (var + 10 != INT_MIN + 10)
+ this_comparison_is_not_decidable ();
+}
+
+void bla3ne (int var)
+{
+ if (var - 10 != INT_MAX - 9)
+ this_comparison_is_true ();
+}
+
+void bla4ne (int var)
+{
+ if (var - 10 != INT_MAX - 10)
+ this_comparison_is_not_decidable ();
+}
+
+void bla1lt (int var)
+{
+ if (var + 10 < INT_MIN + 10)
+ this_comparison_is_false ();
+}
+
+void bla2lt (int var)
+{
+ if (var + 10 < INT_MIN + 11)
+ this_comparison_is_not_decidable ();
+}
+
+void bla3lt (int var)
+{
+ if (var - 10 < INT_MAX - 9)
+ this_comparison_is_true ();
+}
+
+void bla4lt (int var)
+{
+ if (var - 10 < INT_MAX - 10)
+ this_comparison_is_not_decidable ();
+}
+
+void bla1le (int var)
+{
+ if (var + 10 <= INT_MIN + 9)
+ this_comparison_is_false ();
+}
+
+void bla2le (int var)
+{
+ if (var + 10 <= INT_MIN + 10)
+ this_comparison_is_not_decidable ();
+}
+
+void bla3le (int var)
+{
+ if (var - 10 <= INT_MAX - 10)
+ this_comparison_is_true ();
+}
+
+void bla4le (int var)
+{
+ if (var - 10 <= INT_MAX - 11)
+ this_comparison_is_not_decidable ();
+}
+
+void bla1gt (int var)
+{
+ if (var + 10 > INT_MIN + 9)
+ this_comparison_is_true ();
+}
+
+void bla2gt (int var)
+{
+ if (var + 10 > INT_MIN + 10)
+ this_comparison_is_not_decidable ();
+}
+
+void bla3gt (int var)
+{
+ if (var - 10 > INT_MAX - 10)
+ this_comparison_is_false ();
+}
+
+void bla4gt (int var)
+{
+ if (var - 10 > INT_MAX - 11)
+ this_comparison_is_not_decidable ();
+}
+
+void bla1ge (int var)
+{
+ if (var + 10 >= INT_MIN + 10)
+ this_comparison_is_true ();
+}
+
+void bla2ge (int var)
+{
+ if (var + 10 >= INT_MIN + 11)
+ this_comparison_is_not_decidable ();
+}
+
+void bla3ge (int var)
+{
+ if (var - 11 >= INT_MAX - 10)
+ this_comparison_is_false ();
+}
+
+void bla4ge (int var)
+{
+ if (var - 10 >= INT_MAX - 10)
+ this_comparison_is_not_decidable ();
+}
+
+/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cfg" } } */
+/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cfg" } } */
+/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cfg" } } */
+/* { dg-final { scan-tree-dump-times "if " 12 "cfg" } } */
+
+/* { dg-final { cleanup-tree-dump "cfg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-4.c
new file mode 100644
index 000000000..d4bb64ad2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-4.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+int test1 (int a, int b)
+{
+ return a - b == a;
+}
+int test2 (int a, int b)
+{
+ return a + b == a;
+}
+int test3 (int a)
+{
+ return a + 5 == a;
+}
+int test4 (int a)
+{
+ return a - 5 == a;
+}
+
+/* { dg-final { scan-tree-dump-times "b == 0" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 2 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-5.c
new file mode 100644
index 000000000..9ec8c33f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-5.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+int test1 (int a)
+{
+ return 2 - a == a;
+}
+int test2 (int a)
+{
+ return 1 - a == a;
+}
+int test3 (int a)
+{
+ return 1 - a != a;
+}
+
+/* { dg-final { scan-tree-dump-times "return 2 - a == a" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return 1" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-6.c
new file mode 100644
index 000000000..7ddf6b44d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-6.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+char digs[] = "0123456789";
+int foo (void)
+{
+ int xlcbug = 1 / (&(digs + 5)[-2 + (_Bool) 1] == &digs[4] ? 1 : -1);
+ return xlcbug;
+}
+
+/* { dg-final { scan-tree-dump "xlcbug = 1;" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-7.c
new file mode 100644
index 000000000..8296751af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-compare-7.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef float vecf __attribute__((vector_size(8*sizeof(float))));
+
+long f(vecf *f1, vecf *f2){
+ return ((*f1 == *f2) < 0)[2];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-complex-1.c
new file mode 100644
index 000000000..a9ba0fd59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-complex-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -fdump-tree-original" } */
+
+_Complex float
+foo (_Complex float x)
+{
+ return __real x + 1.0iF * __imag x;
+}
+
+/* { dg-final { scan-tree-dump-times "COMPLEX_EXPR" 0 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-cond-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-cond-1.c
new file mode 100644
index 000000000..b6e8a0ec3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-cond-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+_Bool test1(int a, int b)
+{
+ return a ? b : 0;
+}
+
+_Bool test2(int c, int d)
+{
+ return c ? d : 1;
+}
+
+_Bool test3(int e, int f)
+{
+ return e ? 0 : f;
+}
+
+_Bool test4(int g, int h)
+{
+ return g ? 1 : h;
+}
+
+/* { dg-final { scan-tree-dump-times "a != 0 \&\& b != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "c == 0 \\|\\| d != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "e == 0 \&\& f != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "g == 0 \\? h != 0 : 1" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "g != 0 \\? 1 : h != 0" 0 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-convnotconv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-convnotconv-1.c
new file mode 100644
index 000000000..fc07903c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-convnotconv-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a)
+{
+ return ~(unsigned int)a;
+}
+
+unsigned int test2(unsigned int b)
+{
+ return ~(int)b;
+}
+
+/* { dg-final { scan-tree-dump-times "~a" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "~b" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-convround-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-convround-1.c
new file mode 100644
index 000000000..86612aa81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-convround-1.c
@@ -0,0 +1,30 @@
+/* PR middle-end/28473. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+extern double round(double);
+extern double floor(double);
+extern double ceil(double);
+
+unsigned long long test1(double x)
+{
+ return (unsigned long long) round(x);
+}
+
+unsigned long long test2(double x)
+{
+ return (unsigned long long) floor(x);
+}
+unsigned long long test3(double x)
+{
+ return (unsigned long long) ceil(x);
+}
+
+/* { dg-final { scan-tree-dump-times "__builtin_lround" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_llround" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_lfloor" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_llfloor" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_lceil" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_llceil" 0 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-cstvecshift.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-cstvecshift.c
new file mode 100644
index 000000000..51f42d42b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-cstvecshift.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+typedef int vec __attribute__ ((vector_size (4 * sizeof (int))));
+
+void f (vec *r)
+{
+ vec a = { 2, 3, 4, 5 };
+ *r = (a << 2) >> 1;
+}
+
+/* { dg-final { scan-tree-dump "{ 4, 6, 8, 10 }" "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-1.c
new file mode 100644
index 000000000..533908c30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-1.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-funsafe-math-optimizations -fdump-tree-gimple" } */
+
+float f(float x)
+{
+ return x/2 + x/3;
+}
+
+float g(float x)
+{
+ return 2/x + 3/x;
+}
+
+float h(float x)
+{
+ return x/2 - x/3;
+}
+
+float i(float x)
+{
+ return 2/x - 3/x;
+}
+
+/* f and h should be turned into multiplications,
+ the divisions in g and i should be grouped together. */
+
+/* { dg-final { scan-tree-dump-times " \\* " 2 "gimple" } } */
+/* { dg-final { scan-tree-dump-times " / " 2 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-2.c
new file mode 100644
index 000000000..bfd07d1c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-ffinite-math-only -fdump-tree-gimple" } */
+
+double f(double x)
+{
+ return x / x;
+}
+
+/* Division should be turned into 1.0. */
+
+/* { dg-final { scan-tree-dump-not " / " "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-3.c
new file mode 100644
index 000000000..2e78757fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-div-3.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-original" } */
+
+unsigned int
+apply_frontend_param (unsigned int spi_bias)
+{
+ static const int ppm = 8000;
+ spi_bias /= 1000ULL + ppm/1000;
+ return spi_bias;
+}
+
+/* Make sure we perform the division in the narrower type. */
+
+/* { dg-final { scan-tree-dump "spi_bias = spi_bias / 1008;" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqand-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqand-1.c
new file mode 100644
index 000000000..6ed5b6db0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqand-1.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/13827 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+unsigned foo (unsigned a, unsigned b)
+{
+ return (a & 0xff00) != (b & 0xff00);
+}
+
+unsigned bar (unsigned c, unsigned d)
+{
+ return (c & 0xff00) == (d & 0xff00);
+}
+
+/* { dg-final { scan-tree-dump-times "a \\^ b" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "c \\^ d" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandnot-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandnot-1.c
new file mode 100644
index 000000000..5ed65e893
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandnot-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+int test1(int a)
+{
+ return !(a & 4);
+}
+
+int test2(int b)
+{
+ return (b & 4) == 0;
+}
+
+int test3(int c)
+{
+ return ((c & 4) ^ 4) != 0;
+}
+
+int test4(int d)
+{
+ return ((d ^ 4) & 4) != 0;
+}
+
+int test5(int e)
+{
+ return (~e & 4) != 0;
+}
+
+/* { dg-final { scan-tree-dump-times "\\(a \& 4\\) == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(b \& 4\\) == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(c \& 4\\) == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(d \& 4\\) == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(e \& 4\\) == 0" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-1.c
new file mode 100644
index 000000000..055f398af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-1.c
@@ -0,0 +1,56 @@
+/* PR middle-end/21137 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+extern void foo();
+
+void test1(int a)
+{
+ if ((a >> 3) & 1)
+ foo ();
+}
+
+void test2(int b)
+{
+ if ((b >> 3) & 4)
+ foo ();
+}
+
+int test3(int c)
+{
+ return (c >> 3) & 1;
+}
+
+int test4(int d)
+{
+ return (d >> 3) & 4;
+}
+
+#if __INT_MAX__ == 32767
+#define INT_BITS 16
+#elif __INT_MAX__ == 2147483647
+#define INT_BITS 32
+#elif __INT_MAX__ == 9223372036854775807
+#define INT_BITS 64
+#else
+#error Please add support for your target here.
+#endif
+
+void test5(int e)
+{
+ if ((e >> (INT_BITS - 1)) & 64)
+ foo();
+}
+
+void test6(unsigned int f)
+{
+ if ((f >> (INT_BITS - 1)) & 64)
+ foo();
+}
+
+/* { dg-final { scan-tree-dump-times "\\(a \& 8\\) != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(b \& 32\\) != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "c >> 3 \& 1" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "d >> 3 \& 4" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "e < 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "if \\(0\\)" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-2.c
new file mode 100644
index 000000000..14ffb852d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-2.c
@@ -0,0 +1,22 @@
+/* PR middle-end/14752 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+void bar (void);
+
+void foo (unsigned int a)
+{
+ if ((a >> 2) & 1)
+ bar ();
+}
+
+void baz (unsigned int b)
+{
+ if ((~b >> 2) & 1)
+ bar ();
+}
+
+/* { dg-final { scan-tree-dump-times "\\(a \& 4\\) != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(b \& 4\\) == 0" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-3.c
new file mode 100644
index 000000000..5ed744ab5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqandshift-3.c
@@ -0,0 +1,29 @@
+/* PR middle-end/29726 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+void foo (void);
+#if(__SIZEOF_INT__ >= 4)
+int test1 (int a)
+#else
+int test1 (long a)
+#endif
+
+{
+ if ((a >> 3) & 134217728)
+ foo ();
+}
+
+#if(__SIZEOF_INT__ >= 4)
+int test2 (unsigned int b)
+#else
+int test2 (unsigned long b)
+#endif
+{
+ if ((b >> 3) & 134217728)
+ foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "\\(a \& 1073741824\\) != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(b \& 1073741824\\) != 0" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqcmplx-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqcmplx-1.c
new file mode 100644
index 000000000..32f4396ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqcmplx-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int foo(float x, float y)
+{
+ return (_Complex float)x == (_Complex float)y;
+}
+
+/* { dg-final { scan-tree-dump-times "x == y" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-1.c
new file mode 100644
index 000000000..d220e42bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a, int b)
+{
+ return (a ^ b) == 0;
+}
+
+int test2(int c, int d)
+{
+ return (c ^ d) != 0;
+}
+
+unsigned int test3(unsigned int e, unsigned int f)
+{
+ return (e ^ f) == 0;
+}
+
+unsigned int test4(unsigned int g, unsigned int h)
+{
+ return (g ^ h) != 0;
+}
+
+/* { dg-final { scan-tree-dump-times "a == b" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "c != d" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "e == f" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "g != h" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-2.c
new file mode 100644
index 000000000..ee5ec9fa5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-2.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a, int b)
+{
+ return (a ^ b) == a;
+}
+
+int test2(int c, int d)
+{
+ return (c ^ d) != c;
+}
+
+int test3(int e, int f)
+{
+ return (e ^ f) == f;
+}
+
+int test4(int g, int h)
+{
+ return (g ^ h) != h;
+}
+
+/* { dg-final { scan-tree-dump-times "b == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "d != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "e == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "g != 0" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-3.c
new file mode 100644
index 000000000..a087375ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-3.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a, int b)
+{
+ return (a ^ 2) == 2;
+}
+
+int test2(int c, int d)
+{
+ return (c ^ 4) != 4;
+}
+
+int test3(int e, int f)
+{
+ return (e ^ 2) == 6;
+}
+
+int test4(int g, int h)
+{
+ return (g ^ 6) != 4;
+}
+
+/* { dg-final { scan-tree-dump-times "a == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "c != 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "e == 4" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "g != 2" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-4.c
new file mode 100644
index 000000000..bdf31bc88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-eqxor-4.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a)
+{
+ return (a ^ 6) == 2;
+}
+
+int test2(int b, int c, int d)
+{
+ return (b ^ d) == (c ^ d);
+}
+
+int test3(int e, int f)
+{
+ return (e ^ 6) == (f ^ 4);
+}
+
+/* { dg-final { scan-tree-dump-times "a == 4" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "b == c" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "e \\^ 2" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-even-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-even-1.c
new file mode 100644
index 000000000..8e6539c92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-even-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+int test1(int a)
+{
+ return !(a & 1);
+}
+
+int test2(int b)
+{
+ return (b & 1) == 0;
+}
+
+int test3(int c)
+{
+ return (c & 1) ^ 1;
+}
+
+int test4(int d)
+{
+ return (d ^ 1) & 1;
+}
+
+int test5(int e)
+{
+ return ~e & 1;
+}
+
+/* { dg-final { scan-tree-dump-times "\\(a \& 1\\) == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(b \& 1\\) == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(c \& 1\\) == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(d \& 1\\) == 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(e \& 1\\) == 0" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-minus-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-minus-1.c
new file mode 100644
index 000000000..c0fb89a01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-minus-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-gimple" } */
+
+typedef int vec __attribute__((vector_size(2*sizeof(int))));
+
+void f(vec*x,vec*y){
+ *x -= *x / *y * *y;
+}
+void g(vec*x,vec*y,vec*z){
+ *x = -1 - *x;
+ *y = -*y - 1;
+ *z = -*z - 13;
+}
+
+/* { dg-final { scan-tree-dump-times "%" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "~" 2 "gimple"} } */
+/* { dg-final { scan-tree-dump-not "/" "gimple"} } */
+/* { dg-final { scan-tree-dump-not "\\\+" "gimple"} } */
+/* { dg-final { scan-tree-dump "{ -13, -13 }" "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-mod-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-mod-1.c
new file mode 100644
index 000000000..bd4322e2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-mod-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-fdump-tree-gimple -fstrict-overflow" } */
+
+#define ABS(x) (x > 0 ? x : -x)
+
+unsigned int f (unsigned int a) {
+ /* (unsigned)-8 is not a power of 2. */
+ return a % -8;
+}
+
+int g (int b) {
+ return ABS (b) % -8;
+}
+
+int h (int c) {
+ return ABS (c) % 8;
+}
+
+unsigned int k (unsigned int d) {
+ return d % 8;
+}
+
+/* { dg-final { scan-tree-dump "a % (4294967288|0x0fffffff8)" "gimple" } } */
+/* { dg-final { scan-tree-dump-times " & 7" 3 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-mulconj-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-mulconj-1.c
new file mode 100644
index 000000000..0e04653e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-mulconj-1.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/23452 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -fdump-tree-gimple" } */
+
+_Complex double foo(_Complex double z)
+{
+ return z * ~z;
+}
+
+_Complex int bar(_Complex int z)
+{
+ return z * ~z;
+}
+
+/* { dg-final { scan-tree-dump-times "CONJ_EXPR" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-nonneg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-nonneg-1.c
new file mode 100644
index 000000000..03dae358b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-nonneg-1.c
@@ -0,0 +1,10 @@
+/* PR middle-end/27488 */
+/* { dg-do compile } */
+
+extern double fabs(double x);
+extern double sinh(double x);
+
+void foo()
+{
+ fabs(sinh(0..)); /* { dg-error "decimal points" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-notunord.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-notunord.c
new file mode 100644
index 000000000..edfe3cd02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-notunord.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftrapping-math -fdump-tree-optimized" } */
+
+int f (double d)
+{
+ return !__builtin_isnan (d);
+}
+
+/* { dg-final { scan-tree-dump " ord " "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-overflow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-overflow-1.c
new file mode 100644
index 000000000..4f45b35ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-overflow-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-skip-if "No Inf support" { spu-*-* } } */
+/* { dg-options "-O -ftrapping-math" } */
+
+/* There should be exactly 2 +Inf in the assembly file. */
+
+float f1 = __FLT_MAX__ + __FLT_MAX__;
+
+float foo1(void)
+{
+ return __FLT_MAX__ + __FLT_MAX__;
+}
+
+float f2 = 1.0f/0.0f;
+
+float foo2(void)
+{
+ return 1.0f/0.0f;
+}
+
+/* { dg-final { scan-assembler-times "2139095040" 2 { target { ! mmix-*-* } } } } */
+/* { dg-final { scan-assembler-times "#7f800000" 2 { target mmix-*-* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-perm.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-perm.c
new file mode 100644
index 000000000..2270c7b0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-perm.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+typedef int veci __attribute__ ((vector_size (4 * sizeof (int))));
+
+void fun (veci *f, veci *g, veci *h, veci *i)
+{
+ veci m = { 7, 7, 4, 6 };
+ veci n = { 0, 1, 2, 3 };
+ veci p = { 1, 1, 7, 6 };
+ *i = __builtin_shuffle (*i, p, m);
+ *h = __builtin_shuffle (*h, *h, p);
+ *g = __builtin_shuffle (*f, *g, m);
+ *f = __builtin_shuffle (*f, *g, n);
+}
+
+/* { dg-final { scan-tree-dump "VEC_PERM_EXPR.*{ 3, 3, 0, 2 }" "ccp1" } } */
+/* { dg-final { scan-tree-dump "VEC_PERM_EXPR.*{ 1, 1, 3, 2 }" "ccp1" } } */
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 2 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusmult-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusmult-2.c
new file mode 100644
index 000000000..fd5376220
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusmult-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+int foo (int i)
+{
+ return 2 + i * 4;
+}
+
+/* We do _not_ want the above to be canonicalized to (i * 2 + 1) * 2. */
+
+int bar (int i)
+{
+ return 4 + i * 2;
+}
+
+/* But eventually this to be canonicalized to (i + 2) * 2. */
+
+/* { dg-final { scan-tree-dump "i \\\* 4 \\\+ 2" "original" } } */
+/* { dg-final { scan-tree-dump "\\\(i \\\+ 2\\\) \\\* 2" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusmult.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusmult.c
new file mode 100644
index 000000000..d584b9588
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusmult.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+int test1 (int a)
+{
+ return 2*a + 2*a;
+}
+
+int test2 (int a)
+{
+ return (a + a)*2;
+}
+
+/* { dg-final { scan-tree-dump-times "<a> \\\* 4" 2 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusnot-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusnot-1.c
new file mode 100644
index 000000000..81ddf46d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-plusnot-1.c
@@ -0,0 +1,30 @@
+/* PR middle-end/30322 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a)
+{
+ return a + ~a;
+}
+
+int test2(int b)
+{
+ return ~b + b;
+}
+
+unsigned int test3(unsigned int c)
+{
+ return c + ~c;
+}
+
+unsigned int test4(unsigned int d)
+{
+ return ~d + d;
+}
+
+/* { dg-final { scan-tree-dump-times "\\+ a" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\+ b" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\+ c" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\+ d" 0 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-reassoc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-reassoc-1.c
new file mode 100644
index 000000000..88d5dd89c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-reassoc-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -fdump-tree-original" } */
+
+double foo (double x)
+{
+ return (x + 0.5 - x - 0.5);
+}
+
+/* { dg-final { scan-tree-dump "return 0.0;" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-reassoc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-reassoc-2.c
new file mode 100644
index 000000000..e2dd100b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-reassoc-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-original" } */
+
+int foo (int i)
+{
+ return (i + 2) - (i + 1);
+}
+int bar (int i)
+{
+ return (i + 2) + ~i;
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-rotate-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-rotate-1.c
new file mode 100644
index 000000000..c04447fb3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-rotate-1.c
@@ -0,0 +1,74 @@
+/* PR middle-end/29749 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+#if __SCHAR_MAX__ == 127
+
+unsigned char
+e1 (unsigned char a)
+{
+ return a >> 5 | a << 3;
+}
+
+unsigned char
+e2 (unsigned char a)
+{
+ return (a & 0xe0) >> 5 | (a & 0x1f) << 3;
+}
+
+unsigned char
+e3 (unsigned char a)
+{
+ return ((a >> 5) & 0x07) | ((a << 3) & 0xf8);
+}
+
+#endif
+
+#if __SHRT_MAX__ == 32767
+
+unsigned short
+f1 (unsigned short a)
+{
+ return a >> 8 | a << 8;
+}
+
+unsigned short
+f2 (unsigned short a)
+{
+ return (a & 0xff00) >> 8 | (a & 0x00ff) << 8;
+}
+
+unsigned short
+f3 (unsigned short a)
+{
+ return ((a >> 8) & 0x00ff) | ((a << 8) & 0xff00);
+}
+
+#endif
+
+#if __INT_MAX__ == 2147483647
+
+unsigned int
+g1 (unsigned int a)
+{
+ return a >> 24 | a << 8;
+}
+
+unsigned int
+g2 (unsigned int a)
+{
+ return (a & 0xff000000) >> 24 | (a & 0x00ffffff) << 8;
+}
+
+unsigned int
+g3 (unsigned int a)
+{
+ return ((a >> 24) & 0x000000ff) | ((a << 8) & 0xffffff00U);
+}
+
+#endif
+
+int i;
+
+/* { dg-final { scan-tree-dump-times "&" 0 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-sub.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-sub.c
new file mode 100644
index 000000000..28a8dd51f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-sub.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-ffinite-math-only -fdump-tree-gimple" } */
+
+float f(float x)
+{
+ return x - x;
+}
+
+/* Substraction should be turned into 0. */
+
+/* { dg-final { scan-tree-dump-not " - " "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-xor-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-xor-1.c
new file mode 100644
index 000000000..52b1ac467
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-xor-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int f (int a, int b) {
+ return ~a ^ ~b;
+}
+
+unsigned int g (unsigned int a, unsigned int b) {
+ return ~a ^ ~b;
+}
+/* { dg-final { scan-tree-dump-times "a \\^ b" 2 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-xor-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-xor-2.c
new file mode 100644
index 000000000..35337c9c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-xor-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+int f (int a, int b) {
+ return ~(a ^ -(b + 1));
+}
+
+int g (int a, int b) {
+ return b ^ a;
+}
+
+unsigned int h (unsigned int a, unsigned int b) {
+ return ~(-(b + 1) ^ a);
+}
+
+/* { dg-final { scan-tree-dump-times "b \\^ a" 3 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-xorand-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-xorand-1.c
new file mode 100644
index 000000000..8d4265417
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-xorand-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a, int b)
+{
+ return (a & b) ^ a;
+}
+
+int test2(int c, int d)
+{
+ return (c & d) ^ d;
+}
+
+int test3(int e, int f)
+{
+ return e ^ (e & f);
+}
+
+int test4(int g, int h)
+{
+ return g ^ (h & g);
+}
+
+/* { dg-final { scan-tree-dump-times "~b \& a" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "~c \& d" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "~f \& e" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "~h \& g" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fold-xornot-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fold-xornot-1.c
new file mode 100644
index 000000000..c92095d08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fold-xornot-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int foo(int x)
+{
+ return ~(x ^ 4);
+}
+
+int bar(int y)
+{
+ return ~y ^ 4;
+}
+
+/* { dg-final { scan-tree-dump-times "x \\^ -5" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "y \\^ -5" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/foo.specs b/gcc-4.9/gcc/testsuite/gcc.dg/foo.specs
new file mode 100644
index 000000000..8819249fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/foo.specs
@@ -0,0 +1,2 @@
+*cppruntime:
++ %{tfoo: -DFOO}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/for-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/for-1.c
new file mode 100644
index 000000000..3df943976
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/for-1.c
@@ -0,0 +1,7 @@
+/* PR c/23439 */
+/* Origin: Serge Belyshev <belyshev@depni.sinp.msu.ru> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+# 0 "for-1.c"
+void foo() { for /* { dg-error "at end of input" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fork-instrumentation.c b/gcc-4.9/gcc/testsuite/gcc.dg/fork-instrumentation.c
new file mode 100644
index 000000000..bd9bf41cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fork-instrumentation.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -fprofile-generate" } */
+int fork(void);
+t()
+{
+ fork ();
+}
+/* { dg-final { scan-assembler "gcov_fork" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/array-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/array-1.c
new file mode 100644
index 000000000..14db56e03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/array-1.c
@@ -0,0 +1,41 @@
+/* Test for format checking of constant arrays. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat=2" } */
+
+#include "format.h"
+
+const char a1[] = "foo";
+const char a2[] = "foo%d";
+const char b1[3] = "foo";
+const char b2[1] = "1";
+static const char c1[] = "foo";
+static const char c2[] = "foo%d";
+char d[] = "foo";
+volatile const char e[] = "foo";
+
+void
+foo (int i, long l)
+{
+ const char p1[] = "bar";
+ const char p2[] = "bar%d";
+ static const char q1[] = "bar";
+ static const char q2[] = "bar%d";
+ printf (a1);
+ printf (a2, i);
+ printf (a2, l); /* { dg-warning "format" "wrong type with array" } */
+ printf (b1); /* { dg-warning "unterminated" "unterminated array" } */
+ printf (b2); /* { dg-warning "unterminated" "unterminated array" } */
+ printf (c1);
+ printf (c2, i);
+ printf (c2, l); /* { dg-warning "format" "wrong type with array" } */
+ printf (p1);
+ printf (p2, i);
+ printf (p2, l); /* { dg-warning "format" "wrong type with array" } */
+ printf (q1);
+ printf (q2, i);
+ printf (q2, l); /* { dg-warning "format" "wrong type with array" } */
+ /* Volatile or non-constant arrays must not be checked. */
+ printf (d); /* { dg-warning "not a string literal" "non-const" } */
+ printf ((const char *)e); /* { dg-warning "not a string literal" "volatile" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-1.c
new file mode 100644
index 000000000..d71834af7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-1.c
@@ -0,0 +1,80 @@
+/* Test for asm_fprintf formats. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+/* Magic identifier must be set before the attribute is used. */
+typedef long long __gcc_host_wide_int__;
+
+extern int asm_fprintf (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))) __attribute__ ((__nonnull__));
+
+void
+foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
+ int *n, short int *hn, long int l, unsigned long int ul,
+ long int *ln, long double ld, wint_t lc, wchar_t *ls, llong ll,
+ ullong ull, unsigned int *un, const int *cn, signed char *ss,
+ unsigned char *us, const signed char *css, unsigned int u1,
+ unsigned int u2)
+{
+ /* Acceptable C90 specifiers, flags and modifiers. */
+ asm_fprintf ("%%");
+ asm_fprintf ("%d%i%o%u%x%X%c%s%%", i, i, u, u, u, u, i, s);
+ asm_fprintf ("%ld%li%lo%lu%lx%lX", l, l, ul, ul, ul, ul);
+ asm_fprintf ("%lld%lli%llo%llu%llx%llX", ll, ll, ull, ull, ull, ull);
+ asm_fprintf ("%-d%-i%-o%-u%-x%-X%-c%-s", i, i, u, u, u, u, i, s);
+ asm_fprintf ("% d% i\n", i, i);
+ asm_fprintf ("%#o%#x%#X", u, u, u);
+ asm_fprintf ("%08d%08i%08o%08u%08x%08X", i, i, u, u, u, u);
+ asm_fprintf ("%d\n", i);
+ asm_fprintf ("%+d\n", i);
+ asm_fprintf ("%3d\n", i);
+ asm_fprintf ("%-3d\n", i);
+ asm_fprintf ("%.7d\n", i);
+ asm_fprintf ("%+9.4d\n", i);
+ asm_fprintf ("%.3ld\n", l);
+ asm_fprintf ("%d %lu\n", i, ul);
+
+ /* Extensions provided in asm_fprintf. */
+ asm_fprintf ("%O%R%I%L%U%@");
+ asm_fprintf ("%r", i);
+ asm_fprintf ("%wd%wi%wo%wu%wx%wX", ll, ll, ull, ull, ull, ull);
+
+ /* Standard specifiers not accepted in asm_fprintf. */
+ asm_fprintf ("%f\n", d); /* { dg-warning "format" "float" } */
+ asm_fprintf ("%e\n", d); /* { dg-warning "format" "float" } */
+ asm_fprintf ("%E\n", d); /* { dg-warning "format" "float" } */
+ asm_fprintf ("%g\n", d); /* { dg-warning "format" "float" } */
+ asm_fprintf ("%G\n", d); /* { dg-warning "format" "float" } */
+ asm_fprintf ("%p\n", p); /* { dg-warning "format" "pointer" } */
+ asm_fprintf ("%n\n", n); /* { dg-warning "format" "counter" } */
+ asm_fprintf ("%hd\n", i); /* { dg-warning "format" "conversion" } */
+
+ /* Various tests of bad argument types. */
+ asm_fprintf ("%d", l); /* { dg-warning "format" "bad argument types" } */
+ asm_fprintf ("%wd", l); /* { dg-warning "format" "bad argument types" } */
+ asm_fprintf ("%d", ll); /* { dg-warning "format" "bad argument types" } */
+ asm_fprintf ("%*d\n", i1, i); /* { dg-warning "format" "bad * argument types" } */
+ asm_fprintf ("%.*d\n", i2, i); /* { dg-warning "format" "bad * argument types" } */
+ asm_fprintf ("%*.*ld\n", i1, i2, l); /* { dg-warning "format" "bad * argument types" } */
+ asm_fprintf ("%ld", i); /* { dg-warning "format" "bad argument types" } */
+ asm_fprintf ("%s", n); /* { dg-warning "format" "bad argument types" } */
+
+ /* Wrong number of arguments. */
+ asm_fprintf ("%d%d", i); /* { dg-warning "matching" "wrong number of args" } */
+ asm_fprintf ("%d", i, i); /* { dg-warning "arguments" "wrong number of args" } */
+ /* Miscellaneous bogus constructions. */
+ asm_fprintf (""); /* { dg-warning "zero-length" "warning for empty format" } */
+ asm_fprintf ("\0"); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ asm_fprintf ("%d\0", i); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ asm_fprintf ("%d\0%d", i, i); /* { dg-warning "embedded|too many" "warning for embedded NUL" } */
+ asm_fprintf (NULL); /* { dg-warning "null" "null format string warning" } */
+ asm_fprintf ("%"); /* { dg-warning "trailing" "trailing % warning" } */
+ asm_fprintf ("%++d", i); /* { dg-warning "repeated" "repeated flag warning" } */
+ asm_fprintf ((const char *)L"foo"); /* { dg-warning "wide" "wide string" } */
+ asm_fprintf ("%s", (char *)0); /* { dg-warning "null" "%s with NULL" } */
+
+ /* Make sure we still get warnings for regular printf. */
+ printf ("%d\n", ll); /* { dg-warning "format" "bad argument types" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c
new file mode 100644
index 000000000..0cdd5abc7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-2.c
@@ -0,0 +1,9 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not used at all, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "'__gcc_host_wide_int__' is not defined as a type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c
new file mode 100644
index 000000000..c4cd39297
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-3.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not defined, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int __gcc_host_wide_int__);
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "'__gcc_host_wide_int__' is not defined as a type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c
new file mode 100644
index 000000000..111d1f275
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-4.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not a type, asm_fprintf. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "'__gcc_host_wide_int__' is not defined as a type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c
new file mode 100644
index 000000000..bb0e41c6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/asm_fprintf-5.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", bad type, asm_fprintf format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__asm_fprintf__, 1, 2))); /* { dg-error "'__gcc_host_wide_int__' is not defined as 'long' or 'long long'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-1.c
new file mode 100644
index 000000000..8b2f5b7a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-1.c
@@ -0,0 +1,10 @@
+/* Test for strftime format attributes: can't have first_arg_num != 0. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+extern void foo0 (const char *) __attribute__((__format__(gnu_attr___strftime__, 1, 0)));
+extern void foo1 (const char *, ...) __attribute__((__format__(gnu_attr___strftime__, 1, 2))); /* { dg-error "cannot format" "strftime first_arg_num != 0" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-2.c
new file mode 100644
index 000000000..f560ed06b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-2.c
@@ -0,0 +1,68 @@
+/* Test for format attributes: test use of __attribute__. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+extern void tformatprintf (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 2)));
+extern void tformat__printf__ (const char *, ...) __attribute__((format(gnu_attr___printf__, 1, 2)));
+extern void tformatscanf (const char *, ...) __attribute__((format(gnu_attr_scanf, 1, 2)));
+extern void tformat__scanf__ (const char *, ...) __attribute__((format(gnu_attr___scanf__, 1, 2)));
+extern void tformatstrftime (const char *) __attribute__((format(gnu_attr_strftime, 1, 0)));
+extern void tformat__strftime__ (const char *) __attribute__((format(gnu_attr___strftime__, 1, 0)));
+extern void tformatstrfmon (const char *, ...) __attribute__((format(strfmon, 1, 2)));
+extern void tformat__strfmon__ (const char *, ...) __attribute__((format(__strfmon__, 1, 2)));
+extern void t__format__printf (const char *, ...) __attribute__((__format__(gnu_attr_printf, 1, 2)));
+extern void t__format____printf__ (const char *, ...) __attribute__((__format__(gnu_attr___printf__, 1, 2)));
+extern void t__format__scanf (const char *, ...) __attribute__((__format__(gnu_attr_scanf, 1, 2)));
+extern void t__format____scanf__ (const char *, ...) __attribute__((__format__(gnu_attr___scanf__, 1, 2)));
+extern void t__format__strftime (const char *) __attribute__((__format__(gnu_attr_strftime, 1, 0)));
+extern void t__format____strftime__ (const char *) __attribute__((__format__(gnu_attr___strftime__, 1, 0)));
+extern void t__format__strfmon (const char *, ...) __attribute__((__format__(strfmon, 1, 2)));
+extern void t__format____strfmon__ (const char *, ...) __attribute__((__format__(__strfmon__, 1, 2)));
+
+extern char *tformat_arg (const char *) __attribute__((format_arg(1)));
+extern char *t__format_arg__ (const char *) __attribute__((__format_arg__(1)));
+
+void
+foo (int i, int *ip, double d)
+{
+ tformatprintf ("%d", i);
+ tformatprintf ("%"); /* { dg-warning "format" "attribute format printf" } */
+ tformat__printf__ ("%d", i);
+ tformat__printf__ ("%"); /* { dg-warning "format" "attribute format __printf__" } */
+ tformatscanf ("%d", ip);
+ tformatscanf ("%"); /* { dg-warning "format" "attribute format scanf" } */
+ tformat__scanf__ ("%d", ip);
+ tformat__scanf__ ("%"); /* { dg-warning "format" "attribute format __scanf__" } */
+ tformatstrftime ("%a");
+ tformatstrftime ("%"); /* { dg-warning "format" "attribute format strftime" } */
+ tformat__strftime__ ("%a");
+ tformat__strftime__ ("%"); /* { dg-warning "format" "attribute format __strftime__" } */
+ tformatstrfmon ("%n", d);
+ tformatstrfmon ("%"); /* { dg-warning "format" "attribute format strfmon" } */
+ tformat__strfmon__ ("%n", d);
+ tformat__strfmon__ ("%"); /* { dg-warning "format" "attribute format __strfmon__" } */
+ t__format__printf ("%d", i);
+ t__format__printf ("%"); /* { dg-warning "format" "attribute __format__ printf" } */
+ t__format____printf__ ("%d", i);
+ t__format____printf__ ("%"); /* { dg-warning "format" "attribute __format__ __printf__" } */
+ t__format__scanf ("%d", ip);
+ t__format__scanf ("%"); /* { dg-warning "format" "attribute __format__ scanf" } */
+ t__format____scanf__ ("%d", ip);
+ t__format____scanf__ ("%"); /* { dg-warning "format" "attribute __format__ __scanf__" } */
+ t__format__strftime ("%a");
+ t__format__strftime ("%"); /* { dg-warning "format" "attribute __format__ strftime" } */
+ t__format____strftime__ ("%a");
+ t__format____strftime__ ("%"); /* { dg-warning "format" "attribute __format__ __strftime__" } */
+ t__format__strfmon ("%n", d);
+ t__format__strfmon ("%"); /* { dg-warning "format" "attribute __format__ strfmon" } */
+ t__format____strfmon__ ("%n", d);
+ t__format____strfmon__ ("%"); /* { dg-warning "format" "attribute __format__ __strfmon__" } */
+ tformatprintf (tformat_arg ("%d"), i);
+ tformatprintf (tformat_arg ("%")); /* { dg-warning "format" "attribute format_arg" } */
+ tformatprintf (t__format_arg__ ("%d"), i);
+ tformatprintf (t__format_arg__ ("%")); /* { dg-warning "format" "attribute __format_arg__" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-3.c
new file mode 100644
index 000000000..bee5ff484
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-3.c
@@ -0,0 +1,71 @@
+/* Test for format attributes: test bad uses of __attribute__. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+/* Proper uses of the attributes. */
+extern void fa0 (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 2)));
+extern void fa1 (char *, ...) __attribute__((format(gnu_attr_printf, 1, 2)));
+extern char *fa2 (const char *) __attribute__((format_arg(1)));
+extern char *fa3 (char *) __attribute__((format_arg(1)));
+
+/* Uses with too few or too many arguments. */
+extern void fb0 (const char *, ...) __attribute__((format)); /* { dg-error "wrong number of arguments" "bad format" } */
+extern void fb1 (const char *, ...) __attribute__((format())); /* { dg-error "wrong number of arguments" "bad format" } */
+extern void fb2 (const char *, ...) __attribute__((format(gnu_attr_printf))); /* { dg-error "wrong number of arguments" "bad format" } */
+extern void fb3 (const char *, ...) __attribute__((format(gnu_attr_printf, 1))); /* { dg-error "wrong number of arguments" "bad format" } */
+extern void fb4 (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 2, 3))); /* { dg-error "wrong number of arguments" "bad format" } */
+
+extern void fc1 (const char *) __attribute__((format_arg)); /* { dg-error "wrong number of arguments" "bad format_arg" } */
+extern void fc2 (const char *) __attribute__((format_arg())); /* { dg-error "wrong number of arguments" "bad format_arg" } */
+extern void fc3 (const char *) __attribute__((format_arg(1, 2))); /* { dg-error "wrong number of arguments" "bad format_arg" } */
+
+/* These attributes presently only apply to declarations, not to types.
+ Eventually, they should be usable with declarators for function types
+ anywhere, but still not with structure/union/enum types. */
+struct s0 { int i; } __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on struct" } */
+union u0 { int i; } __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on union" } */
+enum e0 { E0V0 } __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on enum" } */
+
+struct s1 { int i; } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on struct" } */
+union u1 { int i; } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on union" } */
+enum e1 { E1V0 } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on enum" } */
+
+/* The format type must be an identifier, one of those recognized. */
+extern void fe0 (const char *, ...) __attribute__((format(12345, 1, 2))); /* { dg-error "format specifier" "non-id format" } */
+extern void fe1 (const char *, ...) __attribute__((format(nosuch, 1, 2))); /* { dg-warning "format function type" "unknown format" } */
+
+/* Both the numbers must be integer constant expressions. */
+extern void ff0 (const char *, ...) __attribute__((format(gnu_attr_printf, 3-2, (long long)(10/5))));
+int foo;
+extern void ff1 (const char *, ...) __attribute__((format(gnu_attr_printf, foo, 10/5))); /* { dg-error "invalid operand" "bad number" } */
+extern void ff2 (const char *, ...) __attribute__((format(gnu_attr_printf, 3-2, foo))); /* { dg-error "invalid operand" "bad number" } */
+extern char *ff3 (const char *) __attribute__((format_arg(3-2)));
+extern char *ff4 (const char *) __attribute__((format_arg(foo))); /* { dg-error "invalid operand" "bad format_arg number" } */
+
+/* The format string argument must precede the arguments to be formatted.
+ This includes if no parameter types are specified (which is not valid ISO
+ C for variadic functions). */
+extern void fg0 () __attribute__((format(gnu_attr_printf, 1, 2)));
+extern void fg1 () __attribute__((format(gnu_attr_printf, 1, 0)));
+extern void fg2 () __attribute__((format(gnu_attr_printf, 1, 1))); /* { dg-error "follows" "bad number order" } */
+extern void fg3 () __attribute__((format(gnu_attr_printf, 2, 1))); /* { dg-error "follows" "bad number order" } */
+
+/* The format string argument must be a string type, and the arguments to
+ be formatted must be the "...". */
+extern void fh0 (int, ...) __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "not a string" "format int string" } */
+extern void fh1 (signed char *, ...) __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "not a string" "signed char string" } */
+extern void fh2 (unsigned char *, ...) __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "not a string" "unsigned char string" } */
+extern void fh3 (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 3))); /* { dg-error "is not" "not ..." } */
+extern void fh4 (const char *, int, ...) __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "is not" "not ..." } */
+
+/* format_arg formats must take and return a string. */
+extern char *fi0 (int) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg int string" } */
+extern char *fi1 (signed char *) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg signed char string" } */
+extern char *fi2 (unsigned char *) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg unsigned char string" } */
+extern int fi3 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret int string" } */
+extern signed char *fi4 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret signed char string" } */
+extern unsigned char *fi5 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret unsigned char string" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-4.c
new file mode 100644
index 000000000..caeed93a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-4.c
@@ -0,0 +1,26 @@
+/* Test for format attributes: test use of __attribute__
+ in prefix attributes. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+extern __attribute__((format(gnu_attr_printf, 1, 2))) void tformatprintf0 (const char *, ...);
+extern void __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf1 (const char *, ...);
+extern void foo (void), __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf2 (const char *, ...);
+extern __attribute__((noreturn)) void bar (void), __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf3 (const char *, ...);
+
+void
+baz (int i, int *ip, double d)
+{
+ tformatprintf0 ("%d", i);
+ tformatprintf0 ("%"); /* { dg-warning "format" "attribute format printf case 0" } */
+ tformatprintf1 ("%d", i);
+ tformatprintf1 ("%"); /* { dg-warning "format" "attribute format printf case 1" } */
+ tformatprintf2 ("%d", i);
+ tformatprintf2 ("%"); /* { dg-warning "format" "attribute format printf case 2" } */
+ tformatprintf3 ("%d", i);
+ tformatprintf3 ("%"); /* { dg-warning "format" "attribute format printf case 3" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-5.c
new file mode 100644
index 000000000..36b119896
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-5.c
@@ -0,0 +1,28 @@
+/* Test for format attributes: test default attributes are silently ignored
+ when a function is redeclared in an inappropriate manner. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+/* We can't #include "format.h" here. */
+
+/* This scanf declaration is static, so can't be the system function. */
+static int scanf(const char *restrict, ...);
+
+/* This sscanf declaration doesn't have variable arguments, so isn't
+ compatible with a format attribute. */
+extern int sscanf(const char *restrict, const char *restrict, int *); /* { dg-warning "conflict" "conflict" } */
+
+void
+foo (const char *s, int *p)
+{
+ scanf("%ld", p); /* { dg-bogus "format" "static" } */
+ sscanf(s, "%ld", p); /* { dg-bogus "format" "wrong type" } */
+}
+
+/* Dummy definition of scanf. */
+static int
+scanf (const char *restrict fmt, ...)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-6.c
new file mode 100644
index 000000000..0f683223d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-6.c
@@ -0,0 +1,22 @@
+/* Test for format attributes: test default attributes are applied
+ to implicit declarations. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -Wformat" } */
+
+/* We can't #include "format.h" here. */
+
+/* Technically, none of the format functions should be implicitly declared;
+ either the implicit type is wrong, the function has variable arguments
+ or it requires a type declared in a header. However, some bad programming
+ practice uses implicit declarations of some of these functions.
+
+ Note that printf is not used in this test because of the declaration
+ of it as a built-in function. */
+
+void
+foo (const char *s, int *p)
+{
+ scanf("%ld", p); /* { dg-warning "format" "implicit scanf" } */
+ /* { dg-warning "implicit" "implicit decl warning" { target *-*-* } 20 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-7.c
new file mode 100644
index 000000000..c37044819
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/attr-7.c
@@ -0,0 +1,35 @@
+/* Test for format attributes: test applying them to types. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+__attribute__((format(gnu_attr_printf, 1, 2))) void (*tformatprintf0) (const char *, ...);
+void (*tformatprintf1) (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 2)));
+void (__attribute__((format(gnu_attr_printf, 1, 2))) *tformatprintf2) (const char *, ...);
+void (__attribute__((format(gnu_attr_printf, 1, 2))) ****tformatprintf3) (const char *, ...);
+
+char * (__attribute__((format_arg(1))) *tformat_arg) (const char *);
+
+void
+baz (int i)
+{
+ (*tformatprintf0) ("%d", i);
+ (*tformatprintf0) ((*tformat_arg) ("%d"), i);
+ (*tformatprintf0) ("%"); /* { dg-warning "format" "prefix" } */
+ (*tformatprintf0) ((*tformat_arg) ("%")); /* { dg-warning "format" "prefix" } */
+ (*tformatprintf1) ("%d", i);
+ (*tformatprintf1) ((*tformat_arg) ("%d"), i);
+ (*tformatprintf1) ("%"); /* { dg-warning "format" "postfix" } */
+ (*tformatprintf1) ((*tformat_arg) ("%")); /* { dg-warning "format" "postfix" } */
+ (*tformatprintf2) ("%d", i);
+ (*tformatprintf2) ((*tformat_arg) ("%d"), i);
+ (*tformatprintf2) ("%"); /* { dg-warning "format" "nested" } */
+ (*tformatprintf2) ((*tformat_arg) ("%")); /* { dg-warning "format" "nested" } */
+ (****tformatprintf3) ("%d", i);
+ (****tformatprintf3) ((*tformat_arg) ("%d"), i);
+ (****tformatprintf3) ("%"); /* { dg-warning "format" "nested 2" } */
+ (****tformatprintf3) ((*tformat_arg) ("%")); /* { dg-warning "format" "nested 2" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/bitfld-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/bitfld-1.c
new file mode 100644
index 000000000..e828ad97c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/bitfld-1.c
@@ -0,0 +1,51 @@
+/* Test for printf formats and bit-fields: bug 22421. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+/* { dg-require-effective-target int32plus } */
+
+#include "format.h"
+
+struct s {
+ unsigned int u1 : 1;
+ signed int s1 : 1;
+ unsigned int u15 : 15;
+ signed int s15 : 15;
+ unsigned int u16 : 16;
+ signed int s16 : 16;
+ unsigned long u31 : 31;
+ signed long s31 : 31;
+ unsigned long u32 : 32;
+ signed long s32 : 32;
+ unsigned long long u48 : 48;
+} x;
+
+void
+foo (void)
+{
+ printf ("%d%u", x.u1, x.u1);
+ printf ("%d%u", x.s1, x.s1);
+ printf ("%d%u", x.u15, x.u15);
+ printf ("%d%u", x.s15, x.s15);
+ printf ("%d%u", x.u16, x.u16);
+ printf ("%d%u", x.s16, x.s16);
+#if __INT_MAX__ > 32767
+ /* If integers are 16 bits, there doesn't seem to be a way of
+ printing these without getting an error. */
+ printf ("%d%u", x.u31, x.u31);
+ printf ("%d%u", x.s31, x.s31);
+#endif
+#if __LONG_MAX__ > 2147483647 && __INT_MAX__ >= 2147483647
+ /* If long is wider than 32 bits, the 32-bit bit-fields are int or
+ unsigned int or promote to those types. Otherwise, long is 32
+ bits and the bit-fields are of type plain long or unsigned
+ long. */
+ printf ("%d%u", x.u32, x.u32);
+ printf ("%d%u", x.s32, x.s32);
+#else
+ printf ("%ld%lu", x.u32, x.u32);
+ printf ("%ld%lu", x.s32, x.s32);
+#endif
+ printf ("%llu", x.u48); /* { dg-warning "has type '.*unsigned int:48'" } */
+ printf ("%llu", (unsigned long long)x.u48);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/branch-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/branch-1.c
new file mode 100644
index 000000000..cdff92762
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/branch-1.c
@@ -0,0 +1,27 @@
+/* Test for format checking of conditional expressions. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (long l, int nfoo)
+{
+ printf ((nfoo > 1) ? "%d foos" : "%d foo", nfoo);
+ printf ((l > 1) ? "%d foos" : "%d foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ printf ((l > 1) ? "%ld foos" : "%d foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ printf ((l > 1) ? "%d foos" : "%ld foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ /* Should allow one case to have extra arguments. */
+ printf ((nfoo > 1) ? "%d foos" : "1 foo", nfoo);
+ printf ((nfoo > 1) ? "many foos" : "1 foo", nfoo); /* { dg-warning "too many" "too many args in all branches" } */
+ printf ((nfoo > 1) ? "%d foos" : "", nfoo);
+ printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "1 foo" : "no foos"), nfoo);
+ printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%d foo" : "%d foos"), nfoo);
+ printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%d foo" : "%ld foos"), nfoo); /* { dg-warning "long int" "wrong type" } */
+ printf ((nfoo > 1) ? "%ld foos" : ((nfoo > 0) ? "%d foo" : "%d foos"), nfoo); /* { dg-warning "long int" "wrong type" } */
+ printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%ld foo" : "%d foos"), nfoo); /* { dg-warning "long int" "wrong type" } */
+ /* Extra arguments to NULL should be complained about. */
+ printf (NULL, "foo"); /* { dg-warning "too many" "NULL extra args" } */
+ /* { dg-warning "null" "null format arg" { target *-*-* } 25 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/builtin-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/builtin-1.c
new file mode 100644
index 000000000..ba1cab647
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/builtin-1.c
@@ -0,0 +1,22 @@
+/* Test for format extensions. Test that the __builtin functions get their
+ default attributes even with -ffreestanding.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat -ffreestanding" } */
+
+#include "format.h"
+
+void
+foo (int i)
+{
+ __builtin_fprintf (stdout, "%d", i);
+ __builtin_fprintf (stdout, "%ld", i); /* { dg-warning "format" "__builtin_fprintf" } */
+ __builtin_printf ("%d", i);
+ __builtin_printf ("%ld", i); /* { dg-warning "format" "__builtin_printf" } */
+
+ __builtin_fprintf_unlocked (stdout, "%d", i);
+ __builtin_fprintf_unlocked (stdout, "%ld", i); /* { dg-warning "format" "__builtin_fprintf_unlocked" } */
+ __builtin_printf_unlocked ("%d", i);
+ __builtin_printf_unlocked ("%ld", i); /* { dg-warning "format" "__builtin_printf_unlocked" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-1.c
new file mode 100644
index 000000000..93b7f80a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-1.c
@@ -0,0 +1,237 @@
+/* Test for printf formats. Formats using C90 features, including cases
+ where C90 specifies some aspect of the format to be ignored or where
+ the behavior is undefined.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
+ int *n, short int *hn, long int l, unsigned long int ul,
+ long int *ln, long double ld, wint_t lc, wchar_t *ls, llong ll,
+ ullong ull, unsigned int *un, const int *cn, signed char *ss,
+ unsigned char *us, const signed char *css, unsigned int u1,
+ unsigned int u2)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134). */
+ /* Basic sanity checks for the different components of a format. */
+ printf ("%d\n", i);
+ printf ("%+d\n", i);
+ printf ("%3d\n", i);
+ printf ("%-3d\n", i);
+ printf ("%.7d\n", i);
+ printf ("%+9.4d\n", i);
+ printf ("%.3ld\n", l);
+ printf ("%*d\n", i1, i);
+ printf ("%.*d\n", i2, i);
+ printf ("%*.*ld\n", i1, i2, l);
+ printf ("%d %lu\n", i, ul);
+ /* GCC has objected to the next one in the past, but it is a valid way
+ of specifying zero precision.
+ */
+ printf ("%.e\n", d); /* { dg-bogus "precision" "bogus precision warning" } */
+ /* Bogus use of width. */
+ printf ("%5n\n", n); /* { dg-warning "width" "width with %n" } */
+ /* Erroneous, ignored or pointless constructs with precision. */
+ /* Whether negative values for precision may be included in the format
+ string is not entirely clear; presume not, following Clive Feather's
+ proposed resolution to DR#220 against C99. In any case, such a
+ construct should be warned about.
+ */
+ printf ("%.-5d\n", i); /* { dg-warning "format|precision" "negative precision warning" } */
+ printf ("%.-*d\n", i); /* { dg-warning "format" "broken %.-*d format" } */
+ printf ("%.3c\n", i); /* { dg-warning "precision" "precision with %c" } */
+ printf ("%.3p\n", p); /* { dg-warning "precision" "precision with %p" } */
+ printf ("%.3n\n", n); /* { dg-warning "precision" "precision with %n" } */
+ /* Valid and invalid %% constructions. Some of the warning messages
+ are non-optimal, but they do detect the errorneous nature of the
+ format string.
+ */
+ printf ("%%");
+ printf ("%.3%"); /* { dg-warning "format" "bogus %%" } */
+ printf ("%-%"); /* { dg-warning "format" "bogus %%" } */
+ printf ("%-%\n"); /* { dg-warning "format" "bogus %%" } */
+ printf ("%5%\n"); /* { dg-warning "format" "bogus %%" } */
+ printf ("%h%\n"); /* { dg-warning "format" "bogus %%" } */
+ /* Valid and invalid %h, %l, %L constructions. */
+ printf ("%hd", i);
+ printf ("%hi", i);
+ /* Strictly, these parameters should be int or unsigned int according to
+ what unsigned short promotes to. However, GCC ignores sign
+ differences in format checking here, and this is relied on to get the
+ correct checking without print_char_table needing to know whether
+ int and short are the same size.
+ */
+ printf ("%ho%hu%hx%hX", u, u, u, u);
+ printf ("%hn", hn);
+ printf ("%hf", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%he", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hE", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hg", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hG", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hc", i); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hs", s); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hp", p); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */
+ printf ("%h."); /* { dg-warning "conversion" "bogus %h." } */
+ printf ("%ld%li%lo%lu%lx%lX", l, l, ul, ul, ul, ul);
+ printf ("%ln", ln);
+ printf ("%lf", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%le", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lE", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lg", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lG", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lp", p); /* { dg-warning "length|C" "bad use of %l" } */
+ /* These next two were added in C94, but should be objected to in C90.
+ For the first one, GCC has wanted wchar_t instead of the correct C94
+ and C99 wint_t.
+ */
+ printf ("%lc", lc); /* { dg-warning "length|C" "C90 bad use of %l" } */
+ printf ("%ls", ls); /* { dg-warning "length|C" "C90 bad use of %l" } */
+ /* These uses of %L are legitimate, though GCC has wrongly warned for
+ them in the past.
+ */
+ printf ("%Le%LE%Lf%Lg%LG", ld, ld, ld, ld, ld);
+ /* These next six are accepted by GCC as referring to long long,
+ but -pedantic correctly warns.
+ */
+ printf ("%Ld", ll); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Li", ll); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Lo", ull); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Lu", ull); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Lx", ull); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%LX", ull); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Lc", i); /* { dg-warning "length" "bad use of %L" } */
+ printf ("%Ls", s); /* { dg-warning "length" "bad use of %L" } */
+ printf ("%Lp", p); /* { dg-warning "length" "bad use of %L" } */
+ printf ("%Ln", n); /* { dg-warning "length" "bad use of %L" } */
+ /* Valid uses of each bare conversion. */
+ printf ("%d%i%o%u%x%X%f%e%E%g%G%c%s%p%n%%", i, i, u, u, u, u, d, d, d, d, d,
+ i, s, p, n);
+ /* Uses of the - flag (valid on all non-%, non-n conversions). */
+ printf ("%-d%-i%-o%-u%-x%-X%-f%-e%-E%-g%-G%-c%-s%-p", i, i, u, u, u, u,
+ d, d, d, d, d, i, s, p);
+ printf ("%-n", n); /* { dg-warning "flag" "bad use of %-n" } */
+ /* Uses of the + flag (valid on signed conversions only). */
+ printf ("%+d%+i%+f%+e%+E%+g%+G\n", i, i, d, d, d, d, d);
+ printf ("%+o", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+u", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+x", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+X", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+c", i); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+s", s); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+p", p); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+n", n); /* { dg-warning "flag" "bad use of + flag" } */
+ /* Uses of the space flag (valid on signed conversions only, and ignored
+ with +).
+ */
+ printf ("% +d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */
+ printf ("%+ d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */
+ printf ("% d% i% f% e% E% g% G\n", i, i, d, d, d, d, d);
+ printf ("% o", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% u", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% x", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% X", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% c", i); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% s", s); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% p", p); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% n", n); /* { dg-warning "flag" "bad use of space flag" } */
+ /* Uses of the # flag. */
+ printf ("%#o%#x%#X%#e%#E%#f%#g%#G", u, u, u, d, d, d, d, d);
+ printf ("%#d", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#i", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#u", u); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#c", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#s", s); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#p", p); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#n", n); /* { dg-warning "flag" "bad use of # flag" } */
+ /* Uses of the 0 flag. */
+ printf ("%08d%08i%08o%08u%08x%08X%08e%08E%08f%08g%08G", i, i, u, u, u, u,
+ d, d, d, d, d);
+ printf ("%0c", i); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0s", s); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0p", p); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0n", n); /* { dg-warning "flag" "bad use of 0 flag" } */
+ /* 0 flag ignored with precision for certain types, not others. */
+ printf ("%08.5d", i); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5i", i); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5o", u); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5u", u); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5x", u); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5X", u); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5f%08.5e%08.5E%08.5g%08.5G", d, d, d, d, d);
+ /* 0 flag ignored with - flag. */
+ printf ("%-08d", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08i", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08o", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08u", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08x", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08X", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08e", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08E", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08f", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08g", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08G", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ /* Various tests of bad argument types. */
+ printf ("%d", l); /* { dg-warning "format" "bad argument types" } */
+ printf ("%*.*d", l, i2, i); /* { dg-warning "field" "bad * argument types" } */
+ printf ("%*.*d", i1, l, i); /* { dg-warning "field" "bad * argument types" } */
+ printf ("%ld", i); /* { dg-warning "format" "bad argument types" } */
+ printf ("%s", n); /* { dg-warning "format" "bad argument types" } */
+ printf ("%p", i); /* { dg-warning "format" "bad argument types" } */
+ printf ("%n", p); /* { dg-warning "format" "bad argument types" } */
+ /* With -pedantic, we want some further checks for pointer targets:
+ %p should allow only pointers to void (possibly qualified) and
+ to character types (possibly qualified), but not function pointers
+ or pointers to other types. (Whether, in fact, character types are
+ allowed here is unclear; see thread on comp.std.c, July 2000 for
+ discussion of the requirements of rules on identical representation,
+ and of the application of the as if rule with the new va_arg
+ allowances in C99 to printf.) Likewise, we should warn if
+ pointer targets differ in signedness, except in some circumstances
+ for character pointers. (In C99 we should consider warning for
+ char * or unsigned char * being passed to %hhn, even if strictly
+ legitimate by the standard.)
+ */
+ printf ("%p", foo); /* { dg-warning "format" "bad argument types" } */
+ printf ("%n", un); /* { dg-warning "format" "bad argument types" } */
+ printf ("%p", n); /* { dg-warning "format" "bad argument types" } */
+ /* Allow character pointers with %p. */
+ printf ("%p%p%p%p", s, ss, us, css);
+ /* %s allows any character type. */
+ printf ("%s%s%s%s", s, ss, us, css);
+ /* Warning for void * arguments for %s is GCC's historical behavior,
+ and seems useful to keep, even if some standard versions might be
+ read to permit it.
+ */
+ printf ("%s", p); /* { dg-warning "format" "bad argument types" } */
+ /* The historical behavior is to allow signed / unsigned types
+ interchangeably as arguments. For values representable in both types,
+ such usage may be correct. For now preserve the behavior of GCC
+ in such cases.
+ */
+ printf ("%d", u);
+ /* Also allow the same for width and precision arguments. In the past,
+ GCC has been inconsistent and allowed unsigned for width but not
+ precision.
+ */
+ printf ("%*.*d", u1, u2, i);
+ /* Wrong number of arguments. */
+ printf ("%d%d", i); /* { dg-warning "matching" "wrong number of args" } */
+ printf ("%d", i, i); /* { dg-warning "arguments" "wrong number of args" } */
+ /* Miscellaneous bogus constructions. */
+ printf (""); /* { dg-warning "zero-length" "warning for empty format" } */
+ printf ("\0"); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ printf ("%d\0", i); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ printf ("%d\0%d", i, i); /* { dg-warning "embedded|too many" "warning for embedded NUL" } */
+ printf (NULL); /* { dg-warning "null" "null format string warning" } */
+ printf ("%"); /* { dg-warning "trailing" "trailing % warning" } */
+ printf ("%++d", i); /* { dg-warning "repeated" "repeated flag warning" } */
+ printf ("%n", cn); /* { dg-warning "constant" "%n with const" } */
+ printf ((const char *)L"foo"); /* { dg-warning "wide" "wide string" } */
+ printf ("%n", (int *)0); /* { dg-warning "null" "%n with NULL" } */
+ printf ("%s", (char *)0); /* { dg-warning "null" "%s with NULL" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-2.c
new file mode 100644
index 000000000..b9da764b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-2.c
@@ -0,0 +1,24 @@
+/* Test for printf formats. Formats using C99 features should be rejected
+ outside of C99 mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, double d, llong ll, intmax_t j, size_t z, ptrdiff_t t)
+{
+ /* Some tests already in c90-printf-1.c, e.g. %lf. */
+ /* The widths hh, ll, j, z, t are new. */
+ printf ("%hhd", i); /* { dg-warning "length|C" "%hh in C90" } */
+ printf ("%lld", ll); /* { dg-warning "length|C" "%ll in C90" } */
+ printf ("%jd", j); /* { dg-warning "length|C" "%j in C90" } */
+ printf ("%zu", z); /* { dg-warning "length|C" "%z in C90" } */
+ printf ("%td", t); /* { dg-warning "length|C" "%t in C90" } */
+ /* The formats F, a, A are new. */
+ printf ("%F", d); /* { dg-warning "C" "%F in C90" } */
+ printf ("%a", d); /* { dg-warning "C" "%a in C90" } */
+ printf ("%A", d); /* { dg-warning "C" "%A in C90" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-3.c
new file mode 100644
index 000000000..bf48f3114
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-printf-3.c
@@ -0,0 +1,42 @@
+/* Test for printf formats. Test that the C90 functions get their default
+ attributes in strict C90 mode, but the C99 and gettext functions
+ do not.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { ! *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, char *s, size_t n, va_list v0, va_list v1, va_list v2, va_list v3,
+ va_list v4, va_list v5, va_list v6, va_list v7, va_list v8)
+{
+ fprintf (stdout, "%d", i);
+ fprintf (stdout, "%ld", i); /* { dg-warning "format" "fprintf" } */
+ printf ("%d", i);
+ printf ("%ld", i); /* { dg-warning "format" "printf" } */
+ /* The "unlocked" functions shouldn't warn in c90 mode. */
+ fprintf_unlocked (stdout, "%ld", i); /* { dg-bogus "format" "fprintf_unlocked" } */
+ printf_unlocked ("%ld", i); /* { dg-bogus "format" "printf_unlocked" } */
+ sprintf (s, "%d", i);
+ sprintf (s, "%ld", i); /* { dg-warning "format" "sprintf" } */
+ vfprintf (stdout, "%d", v0);
+ vfprintf (stdout, "%Y", v1); /* { dg-warning "format" "vfprintf" } */
+ vprintf ("%d", v2);
+ vprintf ("%Y", v3); /* { dg-warning "format" "vprintf" } */
+ /* The following used to give a bogus warning. */
+ vprintf ("%*.*d", v8);
+ vsprintf (s, "%d", v4);
+ vsprintf (s, "%Y", v5); /* { dg-warning "format" "vsprintf" } */
+ snprintf (s, n, "%d", i);
+ snprintf (s, n, "%ld", i);
+ vsnprintf (s, n, "%d", v6);
+ vsnprintf (s, n, "%Y", v7);
+ printf (gettext ("%d"), i);
+ printf (gettext ("%ld"), i);
+ printf (dgettext ("", "%d"), i);
+ printf (dgettext ("", "%ld"), i);
+ printf (dcgettext ("", "%d", 0), i);
+ printf (dcgettext ("", "%ld", 0), i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-1.c
new file mode 100644
index 000000000..e4803f1f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-1.c
@@ -0,0 +1,119 @@
+/* Test for scanf formats. Formats using C90 features, including cases
+ where C90 specifies some aspect of the format to be ignored or where
+ the behavior is undefined.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp,
+ long int *lp, unsigned long int *ulp, float *fp, double *dp,
+ long double *ldp, char *s, signed char *ss, unsigned char *us,
+ void **pp, int *n, llong *llp, ullong *ullp, wchar_t *ls,
+ const int *cip, const int *cn, const char *cs, const void **ppc,
+ void *const *pcp, short int *hn, long int *ln, void *p, char **sp,
+ volatile void *ppv)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.2 (pages 134-138). */
+ /* Basic sanity checks for the different components of a format. */
+ scanf ("%d", ip);
+ scanf ("%*d");
+ scanf ("%3d", ip);
+ scanf ("%hd", hp);
+ scanf ("%3ld", lp);
+ scanf ("%*3d");
+ scanf ("%d %ld", ip, lp);
+ /* Valid and invalid %% constructions. */
+ scanf ("%%");
+ scanf ("%*%"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%*%\n"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%4%"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%4%\n"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%h%"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%h%\n"); /* { dg-warning "format" "bogus %%" } */
+ /* Valid, invalid and silly assignment-suppression constructions. */
+ scanf ("%*d%*i%*o%*u%*x%*X%*e%*E%*f%*g%*G%*s%*[abc]%*c%*p");
+ scanf ("%*2d%*8s%*3c");
+ scanf ("%*n", n); /* { dg-warning "suppress" "suppression of %n" } */
+ scanf ("%*hd"); /* { dg-warning "together" "suppression with length" } */
+ /* Valid, invalid and silly width constructions. */
+ scanf ("%2d%3i%4o%5u%6x%7X%8e%9E%10f%11g%12G%13s%14[abc]%15c%16p",
+ ip, ip, uip, uip, uip, uip, fp, fp, fp, fp, fp, s, s, s, pp);
+ scanf ("%0d", ip); /* { dg-warning "width" "warning for zero width" } */
+ scanf ("%3n", n); /* { dg-warning "width" "width with %n" } */
+ /* Valid and invalid %h, %l, %L constructions. */
+ scanf ("%hd%hi%ho%hu%hx%hX%hn", hp, hp, uhp, uhp, uhp, uhp, hn);
+ scanf ("%he", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hE", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hf", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hg", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hG", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hs", s); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%h[ac]", s); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hc", s); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hp", pp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */
+ scanf ("%h."); /* { dg-warning "conversion" "bogus %h" } */
+ scanf ("%ld%li%lo%lu%lx%lX%ln", lp, lp, ulp, ulp, ulp, ulp, ln);
+ scanf ("%le%lE%lf%lg%lG", dp, dp, dp, dp, dp);
+ scanf ("%lp", pp); /* { dg-warning "length" "bad use of %l" } */
+ /* These next three formats were added in C94. */
+ scanf ("%ls", ls); /* { dg-warning "length|C" "bad use of %l" } */
+ scanf ("%l[ac]", ls); /* { dg-warning "length|C" "bad use of %l" } */
+ scanf ("%lc", ls); /* { dg-warning "length|C" "bad use of %l" } */
+ scanf ("%Le%LE%Lf%Lg%LG", ldp, ldp, ldp, ldp, ldp);
+ scanf ("%Ld", llp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Li", llp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Lo", ullp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Lu", ullp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Lx", ullp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%LX", ullp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Ls", s); /* { dg-warning "length" "bad use of %L" } */
+ scanf ("%L[ac]", s); /* { dg-warning "length" "bad use of %L" } */
+ scanf ("%Lc", s); /* { dg-warning "length" "bad use of %L" } */
+ scanf ("%Lp", pp); /* { dg-warning "length" "bad use of %L" } */
+ scanf ("%Ln", n); /* { dg-warning "length" "bad use of %L" } */
+ /* Valid uses of each bare conversion. */
+ scanf ("%d%i%o%u%x%X%e%E%f%g%G%s%[abc]%c%p%n%%", ip, ip, uip, uip, uip,
+ uip, fp, fp, fp, fp, fp, s, s, s, pp, n);
+ /* Allow other character pointers with %s, %c, %[]. */
+ scanf ("%2s%3s%4c%5c%6[abc]%7[abc]", ss, us, ss, us, ss, us);
+ /* Further tests for %[]. */
+ scanf ("%[%d]%d", s, ip);
+ scanf ("%[^%d]%d", s, ip);
+ scanf ("%[]%d]%d", s, ip);
+ scanf ("%[^]%d]%d", s, ip);
+ scanf ("%[%d]%d", s, ip);
+ scanf ("%[]abcd", s); /* { dg-warning "no closing" "incomplete scanset" } */
+ /* Various tests of bad argument types. Some of these are only pedantic
+ warnings.
+ */
+ scanf ("%d", lp); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%d", uip); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%d", pp); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%p", ppc); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%p", ppv); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%s", n); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%s", p); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%p", p); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%p", sp); /* { dg-warning "format" "bad argument types" } */
+ /* Tests for writing into constant values. */
+ scanf ("%d", cip); /* { dg-warning "constant" "%d writing into const" } */
+ scanf ("%n", cn); /* { dg-warning "constant" "%n writing into const" } */
+ scanf ("%s", cs); /* { dg-warning "constant" "%s writing into const" } */
+ scanf ("%p", pcp); /* { dg-warning "constant" "%p writing into const" } */
+ /* Wrong number of arguments. */
+ scanf ("%d%d", ip); /* { dg-warning "matching" "wrong number of args" } */
+ scanf ("%d", ip, ip); /* { dg-warning "arguments" "wrong number of args" } */
+ /* Miscellaneous bogus constructions. */
+ scanf (""); /* { dg-warning "zero-length" "warning for empty format" } */
+ scanf ("\0"); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ scanf ("%d\0", ip); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ scanf ("%d\0%d", ip, ip); /* { dg-warning "embedded|too many" "warning for embedded NUL" } */
+ scanf (NULL); /* { dg-warning "null" "null format string warning" } */
+ scanf ("%"); /* { dg-warning "trailing" "trailing % warning" } */
+ scanf ("%d", (int *)0); /* { dg-warning "null" "writing into NULL" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-2.c
new file mode 100644
index 000000000..52c08921e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-2.c
@@ -0,0 +1,25 @@
+/* Test for scanf formats. Formats using C99 features should be rejected
+ outside of C99 mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (signed char *hhp, float *fp, llong *llp, intmax_t *jp,
+ size_t *zp, ptrdiff_t *tp)
+{
+ /* Some tests already in c90-scanf-1.c. */
+ /* The widths hh, ll, j, z, t are new. */
+ scanf ("%hhd", hhp); /* { dg-warning "length|C" "%hh in C90" } */
+ scanf ("%lld", llp); /* { dg-warning "length|C" "%ll in C90" } */
+ scanf ("%jd", jp); /* { dg-warning "length|C" "%j in C90" } */
+ scanf ("%zu", zp); /* { dg-warning "length|C" "%z in C90" } */
+ scanf ("%td", tp); /* { dg-warning "length|C" "%t in C90" } */
+ /* The formats F, a, A are new. */
+ scanf ("%F", fp); /* { dg-warning "C" "%F in C90" } */
+ scanf ("%a", fp); /* { dg-warning "C" "%a in C90" } */
+ scanf ("%A", fp); /* { dg-warning "C" "%A in C90" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-3.c
new file mode 100644
index 000000000..557070782
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-3.c
@@ -0,0 +1,19 @@
+/* Test for scanf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp)
+{
+ /* %a formats for allocation, only recognized in C90 mode, are a
+ GNU extension.
+ */
+ scanf ("%as", sp); /* { dg-warning "C" "%as" } */
+ scanf ("%aS", lsp); /* { dg-warning "C" "%aS" } */
+ scanf ("%a[bcd]", sp); /* { dg-warning "C" "%a[]" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-4.c
new file mode 100644
index 000000000..0a47f3f35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-4.c
@@ -0,0 +1,33 @@
+/* Test for scanf formats. Test that the C90 functions get their default
+ attributes in strict C90 mode, but the C99 and gettext functions
+ do not.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { ! *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
+ va_list v4, va_list v5)
+{
+ fscanf (stdin, "%d", ip);
+ fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
+ scanf ("%d", ip);
+ scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
+ sscanf (s, "%d", ip);
+ sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
+ vfscanf (stdin, "%d", v0);
+ vfscanf (stdin, "%Y", v1);
+ vscanf ("%d", v2);
+ vscanf ("%Y", v3);
+ vsscanf (s, "%d", v4);
+ vsscanf (s, "%Y", v5);
+ scanf (gettext ("%d"), ip);
+ scanf (gettext ("%ld"), ip);
+ scanf (dgettext ("", "%d"), ip);
+ scanf (dgettext ("", "%ld"), ip);
+ scanf (dcgettext ("", "%d", 0), ip);
+ scanf (dcgettext ("", "%ld", 0), ip);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-5.c
new file mode 100644
index 000000000..c94e25f22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-scanf-5.c
@@ -0,0 +1,19 @@
+/* Test for scanf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp)
+{
+ /* m assignment-allocation modifier, recognized in both C90
+ and C99 modes, is a POSIX and ISO/IEC WDTR 24731-2 extension. */
+ scanf ("%ms", sp); /* { dg-warning "C" "%ms" } */
+ scanf ("%mS", lsp); /* { dg-warning "C" "%mS" } */
+ scanf ("%mls", lsp); /* { dg-warning "C" "%mls" } */
+ scanf ("%m[bcd]", sp); /* { dg-warning "C" "%m[]" } */
+ scanf ("%ml[bcd]", lsp); /* { dg-warning "C" "%ml[]" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-strftime-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-strftime-1.c
new file mode 100644
index 000000000..1739f7b75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-strftime-1.c
@@ -0,0 +1,19 @@
+/* Test for strftime formats. Formats using C90 features. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.12.3.5 (pages 174-175). */
+ /* Formats which are Y2K-compliant (no 2-digit years). */
+ strftime (s, m, "%a%A%b%B%d%H%I%j%m%M%p%S%U%w%W%X%Y%Z%%", tp);
+ /* Formats with 2-digit years. */
+ strftime (s, m, "%y", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ /* Formats with 2-digit years in some locales. */
+ strftime (s, m, "%c", tp); /* { dg-warning "some locales" "2-digit year" } */
+ strftime (s, m, "%x", tp); /* { dg-warning "some locales" "2-digit year" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-strftime-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-strftime-2.c
new file mode 100644
index 000000000..8b8398ed9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c90-strftime-2.c
@@ -0,0 +1,31 @@
+/* Test for strftime formats. Rejection of formats using C99 features in
+ pedantic C90 mode. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ strftime (s, m, "%C", tp); /* { dg-warning "C" "%C not in C90" } */
+ strftime (s, m, "%D", tp); /* { dg-warning "C" "%D not in C90" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 13 } */
+ strftime (s, m, "%e", tp); /* { dg-warning "C" "%e not in C90" } */
+ strftime (s, m, "%F", tp); /* { dg-warning "C" "%F not in C90" } */
+ strftime (s, m, "%g", tp); /* { dg-warning "C" "%g not in C90" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 17 } */
+ strftime (s, m, "%G", tp); /* { dg-warning "C" "%G not in C90" } */
+ strftime (s, m, "%h", tp); /* { dg-warning "C" "%h not in C90" } */
+ strftime (s, m, "%n", tp); /* { dg-warning "C" "%n not in C90" } */
+ strftime (s, m, "%r", tp); /* { dg-warning "C" "%r not in C90" } */
+ strftime (s, m, "%R", tp); /* { dg-warning "C" "%R not in C90" } */
+ strftime (s, m, "%t", tp); /* { dg-warning "C" "%t not in C90" } */
+ strftime (s, m, "%T", tp); /* { dg-warning "C" "%T not in C90" } */
+ strftime (s, m, "%u", tp); /* { dg-warning "C" "%u not in C90" } */
+ strftime (s, m, "%V", tp); /* { dg-warning "C" "%V not in C90" } */
+ strftime (s, m, "%z", tp); /* { dg-warning "C" "%z not in C90" } */
+ strftime (s, m, "%EX", tp); /* { dg-warning "C" "%E not in C90" } */
+ strftime (s, m, "%OW", tp); /* { dg-warning "C" "%O not in C90" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c94-printf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c94-printf-1.c
new file mode 100644
index 000000000..9ffc8385e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c94-printf-1.c
@@ -0,0 +1,18 @@
+/* Test for printf formats. Changes in C94 to C90. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:199409 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (wint_t lc, wchar_t *ls)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134),
+ as amended by ISO/IEC 9899:1990/Amd.1:1995 (E) (pages 4-5).
+ We do not repeat here all the C90 format checks, but just verify
+ that %ls and %lc are accepted without warning.
+ */
+ printf ("%lc", lc);
+ printf ("%ls", ls);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c94-scanf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c94-scanf-1.c
new file mode 100644
index 000000000..1eaad7dbf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c94-scanf-1.c
@@ -0,0 +1,17 @@
+/* Test for scanf formats. Changes in C94 to C90. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:199409 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (wchar_t *ls)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.2 (pages 134-138),
+ as amended by ISO/IEC 9899:1990/Amd.1:1995 (E) (pages 5-6).
+ We do not repeat here all the C90 format checks, but just verify
+ that %ls, %lc, %l[] are accepted without warning.
+ */
+ scanf ("%lc%ls%l[abc]", ls, ls, ls);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-1.c
new file mode 100644
index 000000000..729e41c3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-1.c
@@ -0,0 +1,197 @@
+/* Test for printf formats. Formats using C99 features, including cases
+ where C99 specifies some aspect of the format to be ignored or where
+ the behavior is undefined.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, unsigned int u, double d, char *s, void *p, int *n,
+ long double ld, wint_t lc, wchar_t *ls, long long int ll,
+ unsigned long long int ull, signed char *ss, unsigned char *us,
+ long long int *lln, intmax_t j, uintmax_t uj, intmax_t *jn,
+ size_t z, signed_size_t sz, signed_size_t *zn,
+ ptrdiff_t t, ptrdiff_t *tn)
+{
+ /* See ISO/IEC 9899:1999 (E) subclause 7.19.6.1 (pages 273-281).
+ We do not repeat here most of the checks for correct C90 formats
+ or completely broken formats.
+ */
+ /* Valid and invalid %h, %hh, %l, %ll, %j, %z, %t, %L constructions. */
+ printf ("%hf", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hF", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%he", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hE", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hg", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hG", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%ha", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hA", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hc", i); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hs", s); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hp", p); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hhd%hhi%hho%hhu%hhx%hhX", i, i, u, u, u, u);
+ printf ("%hhn", ss);
+ printf ("%hhf", d); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhF", d); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhe", d); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhE", d); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhg", d); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhG", d); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hha", d); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhA", d); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhc", i); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhs", s); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%hhp", p); /* { dg-warning "length" "bad use of %hh" } */
+ printf ("%lc", lc);
+ printf ("%ls", ls);
+ printf ("%lf%lF%le%lE%lg%lG%la%lA", d, d, d, d, d, d, d, d);
+ printf ("%lp", p); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lld%lli%llo%llu%llx%llX", ll, ll, ull, ull, ull, ull);
+ printf ("%lln", lln);
+ printf ("%llf", d); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%llF", d); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%lle", d); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%llE", d); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%llg", d); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%llG", d); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%lla", d); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%llA", d); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%llc", i); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%lls", s); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%llp", p); /* { dg-warning "length" "bad use of %ll" } */
+ printf ("%jd%ji%jo%ju%jx%jX", j, j, uj, uj, uj, uj); /* { dg-bogus "length" "bogus %j warning" { target *-*-* } } */
+ printf ("%jn", jn); /* { dg-bogus "length" "bogus %j warning" { target *-*-* } } */
+ printf ("%jf", d); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%jF", d); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%je", d); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%jE", d); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%jg", d); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%jG", d); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%ja", d); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%jA", d); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%jc", i); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%js", s); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%jp", p); /* { dg-warning "length" "bad use of %j" } */
+ printf ("%zd%zi%zo%zu%zx%zX", sz, sz, z, z, z, z);
+ printf ("%zn", zn);
+ printf ("%zf", d); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%zF", d); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%ze", d); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%zE", d); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%zg", d); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%zG", d); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%za", d); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%zA", d); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%zc", i); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%zs", s); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%zp", p); /* { dg-warning "length" "bad use of %z" } */
+ printf ("%td%ti%to%tu%tx%tX", t, t, t, t, t, t);
+ printf ("%tn", tn);
+ printf ("%tf", d); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%tF", d); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%te", d); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%tE", d); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%tg", d); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%tG", d); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%ta", d); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%tA", d); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%tc", i); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%ts", s); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%tp", p); /* { dg-warning "length" "bad use of %t" } */
+ printf ("%Le%LE%Lf%LF%Lg%LG%La%LA", ld, ld, ld, ld, ld, ld, ld, ld);
+ /* These next six are accepted by GCC as referring to long long,
+ but -pedantic correctly warns.
+ */
+ printf ("%Ld", ll); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Li", ll); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Lo", ull); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Lu", ull); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Lx", ull); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%LX", ull); /* { dg-warning "does not support" "bad use of %L" } */
+ printf ("%Lc", i); /* { dg-warning "length" "bad use of %L" } */
+ printf ("%Ls", s); /* { dg-warning "length" "bad use of %L" } */
+ printf ("%Lp", p); /* { dg-warning "length" "bad use of %L" } */
+ printf ("%Ln", n); /* { dg-warning "length" "bad use of %L" } */
+ /* Valid uses of each bare conversion. */
+ printf ("%d%i%o%u%x%X%f%F%e%E%g%G%a%A%c%s%p%n%%", i, i, u, u, u, u,
+ d, d, d, d, d, d, d, d, i, s, p, n);
+ /* Uses of the - flag (valid on all non-%, non-n conversions). */
+ printf ("%-d%-i%-o%-u%-x%-X%-f%-F%-e%-E%-g%-G%-a%-A%-c%-s%-p", i, i,
+ u, u, u, u, d, d, d, d, d, d, d, d, i, s, p);
+ printf ("%-n", n); /* { dg-warning "flag" "bad use of %-n" } */
+ /* Uses of the + flag (valid on signed conversions only). */
+ printf ("%+d%+i%+f%+F%+e%+E%+g%+G%+a%+A\n", i, i, d, d, d, d, d, d, d, d);
+ printf ("%+o", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+u", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+x", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+X", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+c", i); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+s", s); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+p", p); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+n", n); /* { dg-warning "flag" "bad use of + flag" } */
+ /* Uses of the space flag (valid on signed conversions only, and ignored
+ with +).
+ */
+ printf ("% +d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */
+ printf ("%+ d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */
+ printf ("% d% i% f% F% e% E% g% G% a% A\n", i, i, d, d, d, d, d, d, d, d);
+ printf ("% o", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% u", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% x", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% X", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% c", i); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% s", s); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% p", p); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% n", n); /* { dg-warning "flag" "bad use of space flag" } */
+ /* Uses of the # flag. */
+ printf ("%#o%#x%#X%#e%#E%#f%#F%#g%#G%#a%#A", u, u, u, d, d, d, d,
+ d, d, d, d);
+ printf ("%#d", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#i", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#u", u); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#c", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#s", s); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#p", p); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#n", n); /* { dg-warning "flag" "bad use of # flag" } */
+ /* Uses of the 0 flag. */
+ printf ("%08d%08i%08o%08u%08x%08X%08e%08E%08f%08F%08g%08G%08a%08A", i, i,
+ u, u, u, u, d, d, d, d, d, d, d, d);
+ printf ("%0c", i); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0s", s); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0p", p); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0n", n); /* { dg-warning "flag" "bad use of 0 flag" } */
+ /* 0 flag ignored with precision for certain types, not others. */
+ printf ("%08.5d", i); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5i", i); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5o", u); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5u", u); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5x", u); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5X", u); /* { dg-warning "ignored" "0 flag ignored with precision" } */
+ printf ("%08.5f%08.5F%08.5e%08.5E%08.5g%08.5G%08.5a%08.5A",
+ d, d, d, d, d, d, d, d);
+ /* 0 flag ignored with - flag. */
+ printf ("%-08d", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08i", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08o", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08u", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08x", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08X", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08e", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08E", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08f", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08F", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08g", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08G", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08a", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08A", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ /* Various tests of bad argument types. Mostly covered in c90-printf-1.c;
+ here just test for pointer target sign with %hhn. (Probably allowed
+ by the standard, but a bad idea, so GCC should diagnose if what
+ is used is not signed char *.)
+ */
+ printf ("%hhn", s); /* { dg-warning "format" "%hhn plain char" } */
+ printf ("%hhn", us); /* { dg-warning "format" "%hhn unsigned char" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-2.c
new file mode 100644
index 000000000..9efcb0667
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-2.c
@@ -0,0 +1,32 @@
+/* Test for printf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, long long ll, size_t z, wint_t lc, wchar_t *ls)
+{
+ /* The length modifiers q, Z and L as applied to integer formats are
+ extensions.
+ */
+ printf ("%qd", ll); /* { dg-warning "C" "%q length" } */
+ printf ("%Ld", ll); /* { dg-warning "C" "%L length" } */
+ printf ("%Zd", z); /* { dg-warning "C" "%Z length" } */
+ /* The conversion specifiers C and S are X/Open extensions; the
+ conversion specifier m is a GNU extension.
+ */
+ printf ("%m"); /* { dg-warning "C" "printf %m" } */
+ printf ("%C", lc); /* { dg-warning "C" "printf %C" } */
+ printf ("%S", ls); /* { dg-warning "C" "printf %S" } */
+ /* The flag character ', and the use of operand number $ formats, are
+ X/Open extensions.
+ */
+ printf ("%'d", i); /* { dg-warning "C" "printf ' flag" } */
+ printf ("%1$d", i); /* { dg-warning "C" "printf $ format" } */
+ /* The flag character I is a GNU extension. */
+ printf ("%Id", i); /* { dg-warning "C" "printf I flag" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-3.c
new file mode 100644
index 000000000..2407bb603
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-printf-3.c
@@ -0,0 +1,39 @@
+/* Test for printf formats. Test that the C99 functions get their default
+ attributes in strict C99 mode, but the gettext functions do not.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { ! *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, char *s, size_t n, va_list v0, va_list v1, va_list v2, va_list v3,
+ va_list v4, va_list v5, va_list v6, va_list v7)
+{
+ fprintf (stdout, "%d", i);
+ fprintf (stdout, "%ld", i); /* { dg-warning "format" "fprintf" } */
+ printf ("%d", i);
+ printf ("%ld", i); /* { dg-warning "format" "printf" } */
+ /* The "unlocked" functions shouldn't warn in c99 mode. */
+ fprintf_unlocked (stdout, "%ld", i); /* { dg-bogus "format" "fprintf_unlocked" } */
+ printf_unlocked ("%ld", i); /* { dg-bogus "format" "printf_unlocked" } */
+ sprintf (s, "%d", i);
+ sprintf (s, "%ld", i); /* { dg-warning "format" "sprintf" } */
+ snprintf (s, n, "%d", i);
+ snprintf (s, n, "%ld", i); /* { dg-warning "format" "snprintf" } */
+ vfprintf (stdout, "%d", v0);
+ vfprintf (stdout, "%Y", v1); /* { dg-warning "format" "vfprintf" } */
+ vprintf ("%d", v0);
+ vprintf ("%Y", v1); /* { dg-warning "format" "vprintf" } */
+ vsprintf (s, "%d", v0);
+ vsprintf (s, "%Y", v1); /* { dg-warning "format" "vsprintf" } */
+ vsnprintf (s, n, "%d", v0);
+ vsnprintf (s, n, "%Y", v1); /* { dg-warning "format" "vsnprintf" } */
+ printf (gettext ("%d"), i);
+ printf (gettext ("%ld"), i);
+ printf (dgettext ("", "%d"), i);
+ printf (dgettext ("", "%ld"), i);
+ printf (dcgettext ("", "%d", 0), i);
+ printf (dcgettext ("", "%ld", 0), i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-1.c
new file mode 100644
index 000000000..7a8b3e245
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-1.c
@@ -0,0 +1,145 @@
+/* Test for scanf formats. Formats using C99 features, including cases
+ where C99 specifies some aspect of the format to be ignored or where
+ the behavior is undefined.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp,
+ signed char *hhp, unsigned char *uhhp, long int *lp,
+ unsigned long int *ulp, float *fp, double *dp, long double *ldp, char *s,
+ void **pp, int *n, long long *llp, unsigned long long *ullp, wchar_t *ls,
+ short int *hn, signed char *hhn, long int *ln, long long int *lln,
+ intmax_t *jp, uintmax_t *ujp, intmax_t *jn, size_t *zp,
+ signed_size_t *szp, signed_size_t *zn, ptrdiff_t *tp,
+ unsigned_ptrdiff_t *utp, ptrdiff_t *tn)
+{
+ /* See ISO/IEC 9899:1999 (E) subclause 7.19.6.2 (pages 281-288).
+ We do not repeat here most of the checks for correct C90 formats
+ or completely broken formats.
+ */
+ /* Valid, invalid and silly assignment-suppression
+ and width constructions.
+ */
+ scanf ("%*d%*i%*o%*u%*x%*X%*a%*A%*e%*E%*f%*F%*g%*G%*s%*[abc]%*c%*p");
+ scanf ("%*2d%*8s%*3c");
+ scanf ("%*n", n); /* { dg-warning "suppress" "suppression of %n" } */
+ scanf ("%*hd"); /* { dg-warning "together" "suppression with length" } */
+ scanf ("%2d%3i%4o%5u%6x%7X%8a%9A%10e%11E%12f%13F%14g%15G%16s%3[abc]%4c%5p",
+ ip, ip, uip, uip, uip, uip, fp, fp, fp, fp, fp, fp, fp, fp,
+ s, s, s, pp);
+ scanf ("%0d", ip); /* { dg-warning "width" "warning for zero width" } */
+ scanf ("%3n", n); /* { dg-warning "width" "width with %n" } */
+ /* Valid and invalid %h, %hh, %l, %ll, %j, %z, %t, %L constructions. */
+ scanf ("%hd%hi%ho%hu%hx%hX%hn", hp, hp, uhp, uhp, uhp, uhp, hn);
+ scanf ("%ha", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hA", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%he", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hE", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hf", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hF", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hg", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hG", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hs", s); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%h[ac]", s); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hc", s); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hp", pp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hhd%hhi%hho%hhu%hhx%hhX%hhn", hhp, hhp, uhhp, uhhp, uhhp, uhhp,
+ hhn);
+ scanf ("%hha", fp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhA", fp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhe", fp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhE", fp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhf", fp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhF", fp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhg", fp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhG", fp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhs", s); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hh[ac]", s); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhc", s); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%hhp", pp); /* { dg-warning "length" "bad use of %hh" } */
+ scanf ("%ld%li%lo%lu%lx%lX%ln", lp, lp, ulp, ulp, ulp, ulp, ln);
+ scanf ("%la%lA%le%lE%lf%lF%lg%lG", dp, dp, dp, dp, dp, dp, dp, dp);
+ scanf ("%lp", pp); /* { dg-warning "length" "bad use of %l" } */
+ scanf ("%ls", ls);
+ scanf ("%l[ac]", ls);
+ scanf ("%lc", ls);
+ scanf ("%lld%lli%llo%llu%llx%llX%lln", llp, llp, ullp, ullp, ullp, ullp,
+ lln);
+ scanf ("%lla", fp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%llA", fp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%lle", fp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%llE", fp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%llf", fp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%llF", fp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%llg", fp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%llG", fp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%lls", s); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%ll[ac]", s); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%llc", s); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%llp", pp); /* { dg-warning "length" "bad use of %ll" } */
+ scanf ("%jd%ji%jo%ju%jx%jX%jn", jp, jp, ujp, ujp, ujp, ujp, jn); /* { dg-bogus "length" "bogus %j warning" { target *-*-* } } */
+ scanf ("%ja", fp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%jA", fp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%je", fp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%jE", fp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%jf", fp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%jF", fp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%jg", fp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%jG", fp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%js", s); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%j[ac]", s); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%jc", s); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%jp", pp); /* { dg-warning "length" "bad use of %j" } */
+ scanf ("%zd%zi%zo%zu%zx%zX%zn", szp, szp, zp, zp, zp, zp, zn);
+ scanf ("%za", fp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zA", fp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%ze", fp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zE", fp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zf", fp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zF", fp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zg", fp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zG", fp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zs", s); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%z[ac]", s); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zc", s); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%zp", pp); /* { dg-warning "length" "bad use of %z" } */
+ scanf ("%td%ti%to%tu%tx%tX%tn", tp, tp, utp, utp, utp, utp, tn);
+ scanf ("%ta", fp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%tA", fp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%te", fp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%tE", fp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%tf", fp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%tF", fp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%tg", fp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%tG", fp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%ts", s); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%t[ac]", s); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%tc", s); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%tp", pp); /* { dg-warning "length" "bad use of %t" } */
+ scanf ("%La%LA%Le%LE%Lf%LF%Lg%LG", ldp, ldp, ldp, ldp, ldp, ldp, ldp, ldp);
+ scanf ("%Ld", llp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Li", llp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Lo", ullp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Lu", ullp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Lx", ullp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%LX", ullp); /* { dg-warning "does not support" "bad use of %L" } */
+ scanf ("%Ls", s); /* { dg-warning "length" "bad use of %L" } */
+ scanf ("%L[ac]", s); /* { dg-warning "length" "bad use of %L" } */
+ scanf ("%Lc", s); /* { dg-warning "length" "bad use of %L" } */
+ scanf ("%Lp", pp); /* { dg-warning "length" "bad use of %L" } */
+ scanf ("%Ln", n); /* { dg-warning "length" "bad use of %L" } */
+ /* Valid uses of each bare conversion. */
+ scanf ("%d%i%o%u%x%X%a%A%e%E%f%F%g%G%s%[abc]%c%p%n%%", ip, ip, uip, uip, uip,
+ uip, fp, fp, fp, fp, fp, fp, fp, fp, s, s, s, pp, n);
+ /* Assert that %as is not treated as an extension in C99 mode. */
+ scanf ("%as", fp);
+ scanf ("%a[", fp);
+ /* Tests for bad argument types: pointer target sign with %hh. */
+ scanf ("%hhd", uhhp); /* { dg-warning "format" "%hhd sign" } */
+ scanf ("%hhu", hhp); /* { dg-warning "format" "%hhu sign" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-2.c
new file mode 100644
index 000000000..eedf3e57c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-2.c
@@ -0,0 +1,26 @@
+/* Test for scanf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int *ip, long long int *llp, wchar_t *ls)
+{
+ /* The length modifiers q and L as applied to integer formats are
+ extensions.
+ */
+ scanf ("%qd", llp); /* { dg-warning "C" "%q length" } */
+ scanf ("%Ld", llp); /* { dg-warning "C" "%L length" } */
+ /* The conversion specifiers C and S are X/Open extensions. */
+ scanf ("%C", ls); /* { dg-warning "C" "scanf %C" } */
+ scanf ("%S", ls); /* { dg-warning "C" "scanf %S" } */
+ /* The use of operand number $ formats is an X/Open extension. */
+ scanf ("%1$d", ip); /* { dg-warning "C" "scanf $ format" } */
+ /* glibc also supports flags ' and I on scanf formats as an extension. */
+ scanf ("%'d", ip); /* { dg-warning "C" "scanf ' flag" } */
+ scanf ("%Id", ip); /* { dg-warning "C" "scanf I flag" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-3.c
new file mode 100644
index 000000000..091a3ea95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-3.c
@@ -0,0 +1,32 @@
+/* Test for scanf formats. Test that the C99 functions get their default
+ attributes in strict C99 mode, but the gettext functions do not.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
+ va_list v4, va_list v5)
+{
+ fscanf (stdin, "%d", ip);
+ fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
+ scanf ("%d", ip);
+ scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
+ sscanf (s, "%d", ip);
+ sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
+ vfscanf (stdin, "%d", v0);
+ vfscanf (stdin, "%Y", v1); /* { dg-warning "format" "vfscanf" } */
+ vscanf ("%d", v2);
+ vscanf ("%Y", v3); /* { dg-warning "format" "vscanf" } */
+ vsscanf (s, "%d", v4);
+ vsscanf (s, "%Y", v5); /* { dg-warning "format" "vsscanf" } */
+ scanf (gettext ("%d"), ip);
+ scanf (gettext ("%ld"), ip);
+ scanf (dgettext ("", "%d"), ip);
+ scanf (dgettext ("", "%ld"), ip);
+ scanf (dcgettext ("", "%d", 0), ip);
+ scanf (dcgettext ("", "%ld", 0), ip);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-4.c
new file mode 100644
index 000000000..9c7a5e4b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-scanf-4.c
@@ -0,0 +1,19 @@
+/* Test for scanf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp)
+{
+ /* m assignment-allocation modifier, recognized in both C90
+ and C99 modes, is a POSIX and ISO/IEC WDTR 24731-2 extension. */
+ scanf ("%ms", sp); /* { dg-warning "C" "%ms" } */
+ scanf ("%mS", lsp); /* { dg-warning "C" "%mS" } */
+ scanf ("%mls", lsp); /* { dg-warning "C" "%mls" } */
+ scanf ("%m[bcd]", sp); /* { dg-warning "C" "%m[]" } */
+ scanf ("%ml[bcd]", lsp); /* { dg-warning "C" "%ml[]" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-strftime-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-strftime-1.c
new file mode 100644
index 000000000..1730738df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-strftime-1.c
@@ -0,0 +1,97 @@
+/* Test for strftime formats. Formats using C99 features. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wformat-y2k" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.12.3.5 (pages 174-175). */
+ /* Formats which are Y2K-compliant (no 2-digit years). */
+ strftime (s, m, "%a%A%b%B%C%d%e%F%G%h%H%I%j%m%M%p%R%S%t%T%u%U%V%w%W%X%Y%z%Z%%", tp);
+ strftime (s, m, "%EC%EX%EY%Od%Oe%OH%OI%Om%OM%OS%Ou%OU%OV%Ow%OW", tp);
+ /* Formats with 2-digit years. */
+ strftime (s, m, "%D", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ strftime (s, m, "%g", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ strftime (s, m, "%y", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ strftime (s, m, "%Oy", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ /* Formats with 2-digit years in some locales. */
+ strftime (s, m, "%c", tp); /* { dg-warning "some locales" "2-digit year" } */
+ strftime (s, m, "%Ec", tp); /* { dg-warning "some locales" "2-digit year" } */
+ strftime (s, m, "%x", tp); /* { dg-warning "some locales" "2-digit year" } */
+ strftime (s, m, "%Ex", tp); /* { dg-warning "some locales" "2-digit year" } */
+ /* %Ey is explicitly an era offset not a 2-digit year; but in some
+ locales the E modifier may be ignored.
+ */
+ strftime (s, m, "%Ey", tp); /* { dg-warning "some locales" "2-digit year" } */
+ /* Bad uses of %E and %O. */
+ strftime (s, m, "%EEY", tp); /* { dg-warning "multiple|repeated" "multiple %E/%O" } */
+ strftime (s, m, "%EOy", tp); /* { dg-warning "multiple|together" "multiple %E/%O" } */
+ strftime (s, m, "%OEy", tp); /* { dg-warning "multiple|together" "multiple %E/%O" } */
+ strftime (s, m, "%OOV", tp); /* { dg-warning "multiple|repeated" "multiple %E/%O" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 31 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 32 } */
+ strftime (s, m, "%Ea", tp); /* { dg-warning "flag|modifier" "bad %Ea" } */
+ strftime (s, m, "%EA", tp); /* { dg-warning "flag|modifier" "bad %EA" } */
+ strftime (s, m, "%Eb", tp); /* { dg-warning "flag|modifier" "bad %Eb" } */
+ strftime (s, m, "%EB", tp); /* { dg-warning "flag|modifier" "bad %EB" } */
+ strftime (s, m, "%Ed", tp); /* { dg-warning "flag|modifier" "bad %Ed" } */
+ strftime (s, m, "%ED", tp); /* { dg-warning "flag|modifier" "bad %ED" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 41 } */
+ strftime (s, m, "%Ee", tp); /* { dg-warning "flag|modifier" "bad %Ee" } */
+ strftime (s, m, "%EF", tp); /* { dg-warning "flag|modifier" "bad %EF" } */
+ strftime (s, m, "%Eg", tp); /* { dg-warning "flag|modifier" "bad %Eg" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 45 } */
+ strftime (s, m, "%EG", tp); /* { dg-warning "flag|modifier" "bad %EG" } */
+ strftime (s, m, "%Eh", tp); /* { dg-warning "flag|modifier" "bad %Eh" } */
+ strftime (s, m, "%EH", tp); /* { dg-warning "flag|modifier" "bad %EH" } */
+ strftime (s, m, "%EI", tp); /* { dg-warning "flag|modifier" "bad %EI" } */
+ strftime (s, m, "%Ej", tp); /* { dg-warning "flag|modifier" "bad %Ej" } */
+ strftime (s, m, "%Em", tp); /* { dg-warning "flag|modifier" "bad %Em" } */
+ strftime (s, m, "%EM", tp); /* { dg-warning "flag|modifier" "bad %EM" } */
+ strftime (s, m, "%En", tp); /* { dg-warning "flag|modifier" "bad %En" } */
+ strftime (s, m, "%Ep", tp); /* { dg-warning "flag|modifier" "bad %Ep" } */
+ strftime (s, m, "%Er", tp); /* { dg-warning "flag|modifier" "bad %Er" } */
+ strftime (s, m, "%ER", tp); /* { dg-warning "flag|modifier" "bad %ER" } */
+ strftime (s, m, "%ES", tp); /* { dg-warning "flag|modifier" "bad %ES" } */
+ strftime (s, m, "%Et", tp); /* { dg-warning "flag|modifier" "bad %Et" } */
+ strftime (s, m, "%ET", tp); /* { dg-warning "flag|modifier" "bad %ET" } */
+ strftime (s, m, "%Eu", tp); /* { dg-warning "flag|modifier" "bad %Eu" } */
+ strftime (s, m, "%EU", tp); /* { dg-warning "flag|modifier" "bad %EU" } */
+ strftime (s, m, "%EV", tp); /* { dg-warning "flag|modifier" "bad %EV" } */
+ strftime (s, m, "%Ew", tp); /* { dg-warning "flag|modifier" "bad %Ew" } */
+ strftime (s, m, "%EW", tp); /* { dg-warning "flag|modifier" "bad %EW" } */
+ strftime (s, m, "%Ez", tp); /* { dg-warning "flag|modifier" "bad %Ez" } */
+ strftime (s, m, "%EZ", tp); /* { dg-warning "flag|modifier" "bad %EZ" } */
+ strftime (s, m, "%E%", tp); /* { dg-warning "flag|modifier" "bad %E%" } */
+ strftime (s, m, "%Oa", tp); /* { dg-warning "flag|modifier" "bad %Oa" } */
+ strftime (s, m, "%OA", tp); /* { dg-warning "flag|modifier" "bad %OA" } */
+ strftime (s, m, "%Ob", tp); /* { dg-warning "flag|modifier" "bad %Ob" } */
+ strftime (s, m, "%OB", tp); /* { dg-warning "flag|modifier" "bad %OB" } */
+ strftime (s, m, "%Oc", tp); /* { dg-warning "flag|modifier" "bad %Oc" } */
+ /* { dg-warning "in some locales" "2-digit year" { target *-*-* } 73 } */
+ strftime (s, m, "%OC", tp); /* { dg-warning "flag|modifier|C" "bad %OC" } */
+ strftime (s, m, "%OD", tp); /* { dg-warning "flag|modifier" "bad %OD" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 76 } */
+ strftime (s, m, "%OF", tp); /* { dg-warning "flag|modifier" "bad %OF" } */
+ strftime (s, m, "%Og", tp); /* { dg-warning "flag|modifier|C" "bad %Og" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 79 } */
+ strftime (s, m, "%OG", tp); /* { dg-warning "flag|modifier|C" "bad %OG" } */
+ strftime (s, m, "%Oh", tp); /* { dg-warning "flag|modifier" "bad %Oh" } */
+ strftime (s, m, "%Oj", tp); /* { dg-warning "flag|modifier|C" "bad %Oj" } */
+ strftime (s, m, "%On", tp); /* { dg-warning "flag|modifier" "bad %On" } */
+ strftime (s, m, "%Op", tp); /* { dg-warning "flag|modifier" "bad %Op" } */
+ strftime (s, m, "%Or", tp); /* { dg-warning "flag|modifier" "bad %Or" } */
+ strftime (s, m, "%OR", tp); /* { dg-warning "flag|modifier" "bad %OR" } */
+ strftime (s, m, "%Ot", tp); /* { dg-warning "flag|modifier" "bad %Ot" } */
+ strftime (s, m, "%OT", tp); /* { dg-warning "flag|modifier" "bad %OT" } */
+ strftime (s, m, "%Ox", tp); /* { dg-warning "flag|modifier" "bad %Ox" } */
+ /* { dg-warning "in some locales" "2-digit year" { target *-*-* } 90 } */
+ strftime (s, m, "%OX", tp); /* { dg-warning "flag|modifier" "bad %OX" } */
+ strftime (s, m, "%OY", tp); /* { dg-warning "flag|modifier|C" "bad %OY" } */
+ strftime (s, m, "%Oz", tp); /* { dg-warning "flag|modifier|C" "bad %Oz" } */
+ strftime (s, m, "%OZ", tp); /* { dg-warning "flag|modifier" "bad %OZ" } */
+ strftime (s, m, "%O%", tp); /* { dg-warning "flag|modifier" "bad %O%" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-strftime-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-strftime-2.c
new file mode 100644
index 000000000..747faa2c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/c99-strftime-2.c
@@ -0,0 +1,23 @@
+/* Test for strftime formats. Rejection of extensions in pedantic mode. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ /* %P is a lowercase version of %p. */
+ strftime (s, m, "%P", tp); /* { dg-warning "C" "strftime %P" } */
+ /* %k is %H but padded with a space rather than 0 if necessary. */
+ strftime (s, m, "%k", tp); /* { dg-warning "C" "strftime %k" } */
+ /* %l is %I but padded with a space rather than 0 if necessary. */
+ strftime (s, m, "%l", tp); /* { dg-warning "C" "strftime %l" } */
+ /* %s is the number of seconds since the Epoch. */
+ strftime (s, m, "%s", tp); /* { dg-warning "C" "strftime %s" } */
+ /* Extensions using %O already tested in c99-strftime-1.c. */
+ /* Width and flags are GNU extensions for strftime. */
+ strftime (s, m, "%20Y", tp); /* { dg-warning "C" "strftime width" } */
+ strftime (s, m, "%^A", tp); /* { dg-warning "C" "strftime flags" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/cast-1.c
new file mode 100644
index 000000000..5d1d47709
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/cast-1.c
@@ -0,0 +1,16 @@
+/* Test for strings cast through integer types: should not be treated
+ as format strings unless the types are of the same width as
+ pointers (intptr_t or similar). */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+void
+f (int x)
+{
+ printf("%s", x); /* { dg-warning "format" } */
+ printf((char *)(__UINTPTR_TYPE__)"%s", x); /* { dg-warning "format" } */
+ printf((char *)(char)"%s", x); /* { dg-warning "cast from pointer to integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/cmn-err-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/cmn-err-1.c
new file mode 100644
index 000000000..fd5ca59d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/cmn-err-1.c
@@ -0,0 +1,39 @@
+/* { dg-do compile { target *-*-solaris2.* } } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+void cmn_err_func (int level, char * format, ...)
+ __attribute__((format (cmn_err, 2, 3)));
+
+void cmn_err_func (int level, char * format, ...)
+{
+}
+
+const char *string = "foo";
+
+int main()
+{
+ int i = 1;
+ long l = 2;
+ llong ll = 3;
+
+ cmn_err_func (0, "%s", string);
+ cmn_err_func (0, "%d %D %o %O %x %X %u", i, i, i, i, i, i, i);
+ cmn_err_func (0, "%ld %lD %lo %lO %lx %lX %lu", l, l, l, l, l, l, l);
+ cmn_err_func (0, "%lld %llD %llo %llO %llx %llX %llu",
+ ll, ll, ll, ll, ll, ll, ll);
+ cmn_err_func (0, "%b %s", i, "\01Foo", string);
+ cmn_err_func (0, "%p", string);
+ cmn_err_func (0, "%16b", i, "\01Foo");
+
+ cmn_err_func (0, "%i", i); /* { dg-warning "unknown|too many" } */
+ cmn_err_func (0, "%d", l); /* { dg-warning "expects argument" } */
+ cmn_err_func (0, "%b"); /* { dg-warning "'int'" } */
+/* { dg-warning "'char \\*'" "" { target *-*-solaris2.* } 32 } */
+ cmn_err_func (0, "%b", i); /* { dg-warning "matching" } */
+ cmn_err_func (0, "%b", i, i); /* { dg-warning "expects argument" } */
+ cmn_err_func (0, "%b", string, i); /* { dg-warning "expects argument" } */
+ cmn_err_func (0, "%p", 3); /* { dg-warning "expects argument" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/dfp-printf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/dfp-printf-1.c
new file mode 100644
index 000000000..4453ad192
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/dfp-printf-1.c
@@ -0,0 +1,123 @@
+/* Test for printf formats for Decimal Floating Point types. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target dfp } */
+/* { dg-options "-Wformat" } */
+/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } { "*" } { "" } } */
+
+extern int printf (const char *restrict, ...);
+
+void
+foo (_Decimal32 x, _Decimal64 y, _Decimal128 z, int i, unsigned int j,
+ double d, char *p)
+{
+ /* See ISO/IEC DTR 24732 subclause 9.3 (currently Working Draft 5 from
+ 2005-03-06). */
+ /* Formatted input/output specifiers. */
+
+ /* Check lack of warnings for valid usage. */
+
+ printf ("%Hf\n", x);
+ printf ("%HF\n", x);
+ printf ("%He\n", x);
+ printf ("%HE\n", x);
+ printf ("%Hg\n", x);
+ printf ("%HG\n", x);
+
+ printf ("%Df\n", y);
+ printf ("%DF\n", y);
+ printf ("%De\n", y);
+ printf ("%DE\n", y);
+ printf ("%Dg\n", y);
+ printf ("%DG\n", y);
+
+ printf ("%DDf\n", z);
+ printf ("%DDF\n", z);
+ printf ("%DDe\n", z);
+ printf ("%DDE\n", z);
+ printf ("%DDg\n", z);
+ printf ("%DDG\n", z);
+
+ printf ("%DG%DDE%HF%DDe%He%HE%DF%DDF%De%DDG%HG%Df%Hg%DE%DDf%Dg%DDg%Hf\n",
+ y, z, x, z, x, x, y, z, y, z, x, y, x, y, z, y, z, x);
+
+ /* Check warnings for type mismatches. */
+
+ printf ("%Hf\n", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%HF\n", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%He\n", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%HE\n", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%Hg\n", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%HG\n", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%Hf\n", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%HF\n", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%He\n", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%HE\n", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%Hg\n", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ printf ("%HG\n", z); /* { dg-warning "expects argument" "bad use of %H" } */
+
+ printf ("%Df\n", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%DF\n", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%De\n", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%DE\n", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%Dg\n", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%DG\n", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%Df\n", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%DF\n", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%De\n", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%DE\n", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%Dg\n", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ printf ("%DG\n", z); /* { dg-warning "expects argument" "bad use of %D" } */
+
+ printf ("%DDf\n", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDF\n", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDe\n", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDE\n", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDg\n", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDG\n", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDf\n", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDF\n", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDe\n", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDE\n", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDg\n", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ printf ("%DDG\n", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+
+ /* Check for warnings for bad use of H, D, and DD length specifiers. */
+
+ printf ("%Hd\n", i); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Hi\n", i); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Ho\n", j); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Hu\n", j); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Hx\n", j); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%HX\n", j); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Ha\n", d); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%HA\n", d); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Hc\n", i); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Hs\n", p); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Hp\n", p); /* { dg-warning "length" "bad use of %H" } */
+ printf ("%Hn\n", p); /* { dg-warning "length" "bad use of %H" } */
+
+ /* Sanity checks for flags, field width, and precision in formats for
+ DFP types. */
+
+ printf ("%-Hf\n", x);
+ printf ("%+HF\n", x);
+ printf ("% He\n", x);
+ printf ("%#HE\n", x);
+ printf ("%0Hg\n", x);
+ printf ("%#0HG\n", x);
+
+ printf ("%0#Df\n", y);
+ printf ("%0DF\n", y);
+ printf ("%#De\n", y);
+ printf ("%-#DE\n", y);
+ printf ("%-#0Dg\n", y); /* { dg-warning "flag ignored" "ignore flag" } */
+ printf ("%0+ DG\n", y); /* { dg-warning "flag ignored" "ignore flag" } */
+
+ printf ("%DDf\n", z);
+ printf ("%0DDF\n", z);
+ printf ("%#0DDe\n", z);
+ printf ("%+DDE\n", z);
+ printf ("%0-#DDg\n", z); /* { dg-warning "flag ignored" "ignore flag" } */
+ printf ("% DDG\n", z);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/dfp-scanf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/dfp-scanf-1.c
new file mode 100644
index 000000000..ffa12a803
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/dfp-scanf-1.c
@@ -0,0 +1,99 @@
+/* Test for scanf formats for Decimal Floating Point types. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target dfp } */
+/* { dg-options "-Wformat" } */
+/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } } */
+
+#include "format.h"
+
+void
+voo (_Decimal32 *x, _Decimal64 *y, _Decimal128 *z, int *i, unsigned int *j,
+ double *d, char **p)
+{
+ /* See ISO/IEC DTR 24732 subclause 9.3 (currently Working Draft 5 from
+ 2005-03-06). */
+ /* Formatted input/output specifiers. */
+
+ /* Check lack of warnings for valid usage. */
+
+ scanf ("%Hf", x);
+ scanf ("%HF", x);
+ scanf ("%He", x);
+ scanf ("%HE", x);
+ scanf ("%Hg", x);
+ scanf ("%HG", x);
+
+ scanf ("%Df", y);
+ scanf ("%DF", y);
+ scanf ("%De", y);
+ scanf ("%DE", y);
+ scanf ("%Dg", y);
+ scanf ("%DG", y);
+
+ scanf ("%DDf", z);
+ scanf ("%DDF", z);
+ scanf ("%DDe", z);
+ scanf ("%DDE", z);
+ scanf ("%DDg", z);
+ scanf ("%DDG", z);
+
+ scanf ("%DG%DDE%HF%DDe%He%HE%DF%DDF%De%DDG%HG%Df%Hg%DE%DDf%Dg%DDg%Hf\n",
+ y, z, x, z, x, x, y, z, y, z, x, y, x, y, z, y, z, x);
+
+ /* Check warnings for type mismatches. */
+
+ scanf ("%Hf", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%HF", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%He", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%HE", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%Hg", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%HG", y); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%Hf", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%HF", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%He", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%HE", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%Hg", z); /* { dg-warning "expects argument" "bad use of %H" } */
+ scanf ("%HG", z); /* { dg-warning "expects argument" "bad use of %H" } */
+
+ scanf ("%Df", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%DF", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%De", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%DE", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%Dg", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%DG", x); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%Df", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%DF", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%De", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%DE", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%Dg", z); /* { dg-warning "expects argument" "bad use of %D" } */
+ scanf ("%DG", z); /* { dg-warning "expects argument" "bad use of %D" } */
+
+ scanf ("%DDf", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDF", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDe", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDE", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDg", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDG", x); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDf", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDF", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDe", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDE", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDg", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+ scanf ("%DDG", y); /* { dg-warning "expects argument" "bad use of %DD" } */
+
+ /* Check for warnings for bad use of H, D, and DD length specifiers. */
+
+ scanf ("%Hd\n", i); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Hi\n", i); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Ho\n", j); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Hu\n", j); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Hx\n", j); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%HX\n", j); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Ha\n", d); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%HA\n", d); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Hc\n", i); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Hs\n", p); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Hp\n", p); /* { dg-warning "length" "bad use of %H" } */
+ scanf ("%Hn\n", p); /* { dg-warning "length" "bad use of %H" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/diag-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/diag-1.c
new file mode 100644
index 000000000..998e35b9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/diag-1.c
@@ -0,0 +1,18 @@
+/* Test for format diagnostics. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (double d)
+{
+ /* This should get a message referring to `hh', not to `H'. */
+ printf ("%hhf", d); /* { dg-warning "hh" "%hhf warning" } */
+ /* This should get a message referring to `ll', not to `q'. */
+ printf ("%llf", d); /* { dg-warning "ll" "%llf warning" } */
+ /* This should get a message referring to 'size_t', not to
+ 'unsigned int' or similar. */
+ printf ("%zu", d); /* { dg-warning "size_t" "size_t format warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/diag-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/diag-2.c
new file mode 100644
index 000000000..e7578d3f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/diag-2.c
@@ -0,0 +1,13 @@
+/* Test for format diagnostics. Proper type names (bug 1027). */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (double d)
+{
+ printf ("%s", &d); /* { dg-warning "char \\*" "correct arg type" } */
+ scanf ("%zu", &d); /* { dg-warning "size_t \\*" "correct arg type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/errmk-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/errmk-1.c
new file mode 100644
index 000000000..77630ab0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/errmk-1.c
@@ -0,0 +1,12 @@
+/* Test for format checking not giving tree checking errors. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+void
+foo (int t)
+{
+ printf ("%*d", u, t); /* { dg-error "undeclared|function" "u undeclared error" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-1.c
new file mode 100644
index 000000000..3b020892a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-1.c
@@ -0,0 +1,126 @@
+/* Test for format extensions beyond the C standard and X/Open standard.
+ Test for printf formats.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll,
+ unsigned long long int ull, int i, unsigned int u, double d,
+ char *s, void *p, wchar_t *ls, wint_t lc, int *n, long int l)
+{
+ /* As an extension, GCC allows the BSD length "q" for integer formats.
+ This is largely obsoleted in C99 by %j, %ll and PRId64.
+ */
+ printf ("%qd%qi%qo%qu%qx%qX%qn", q, q, uq, uq, uq, uq, qn);
+ printf ("%qf", d); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qF", d); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qe", d); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qE", d); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qg", d); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qG", d); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qa", d); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qA", d); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qc", i); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qs", s); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qp", p); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qC", lc); /* { dg-warning "length" "bad use of %q" } */
+ printf ("%qS", ls); /* { dg-warning "length" "bad use of %q" } */
+ /* With a bad length GCC wants some argument, any argument,
+ to devour with the format conversion, as a synchronisation heuristic.
+ This may get improved later.
+ */
+ printf ("%qm", i); /* { dg-warning "length" "bad use of %q" } */
+ /* As an extension, GCC allows the length "Z" as a synonym for "z".
+ This was an extension predating C99 which should now be considered
+ deprecated; use the standard "z" instead.
+ */
+ printf ("%Zd%Zi%Zo%Zu%Zx%ZX", z, z, z, z, z, z);
+ printf ("%Zn", zn);
+ printf ("%Zf", d); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%ZF", d); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%Ze", d); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%ZE", d); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%Zg", d); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%ZG", d); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%Za", d); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%ZA", d); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%Zc", i); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%Zs", s); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%Zp", p); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%ZC", lc); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%ZS", ls); /* { dg-warning "length" "bad use of %Z" } */
+ printf ("%Zm", i); /* { dg-warning "length" "bad use of %Z" } */
+ /* As an extension, GCC allows the length "L" on integer formats
+ (but not %n) as a synonym for "ll".
+ This should be considered deprecated.
+ */
+ printf ("%Ld%Li%Lo%Lu%Lx%LX", ll, ll, ull, ull, ull, ull);
+ /* As an extension, derived from syslog, GCC allows the conversion
+ specifier "m" for formatting strerror(errno). This may be used
+ with width, precision and the "-" flag, the same as %s.
+ */
+ printf ("%m%3m%.4m%5.6m");
+ printf ("%*m", i);
+ printf ("%.*m", i);
+ printf ("%*.*m", i, i);
+ printf ("%3.*m", i);
+ printf ("%*.4m", i);
+ printf ("%-m");
+ printf ("%+m"); /* { dg-warning "flag" "bad %+m" } */
+ printf ("% m"); /* { dg-warning "flag" "bad % m" } */
+ printf ("%#m"); /* { dg-warning "flag" "bad %#m" } */
+ printf ("%0m"); /* { dg-warning "flag" "bad %0m" } */
+ printf ("%'m"); /* { dg-warning "flag" "bad %'m" } */
+ printf ("%hm", i); /* { dg-warning "length" "bad %hm" } */
+ printf ("%hhm", i); /* { dg-warning "length" "bad %hhm" } */
+ printf ("%lm", i); /* { dg-warning "length" "bad %lm" } */
+ printf ("%llm", i); /* { dg-warning "length" "bad %llm" } */
+ printf ("%jm", i); /* { dg-warning "length" "bad %jm" } */
+ printf ("%zm", i); /* { dg-warning "length" "bad %zm" } */
+ printf ("%tm", i); /* { dg-warning "length" "bad %tm" } */
+ printf ("%Lm", i); /* { dg-warning "length" "bad %Lm" } */
+ printf ("%qm", i); /* { dg-warning "length" "bad %qm" } */
+ printf ("%Zm", i); /* { dg-warning "length" "bad %Zm" } */
+ /* It should be OK to mix %m formats with $ operand number formats. */
+ printf ("%2$ld%m%1$d", i, l);
+ /* Likewise, %m formats with width and precision should not have an
+ operand number for the %m itself.
+ */
+ printf ("%*2$.*1$m", i, i);
+ printf ("%1$*2$.*1$m", i, i); /* { dg-warning "no argument" "printf %1\$m" } */
+ /* As an extension, glibc includes the "I" flag for decimal
+ formats, to output using the locale's digits (e.g. in Arabic).
+ In GCC, we require this to be in the standard place for flags, though
+ glibc allows it also after width or precision.
+ */
+ printf ("%Id%Ii%Iu", i, i, u);
+ printf ("%Io", u); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%Ix", u); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%IX", u); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%In", n); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%If", d);
+ printf ("%IF", d);
+ printf ("%Ie", d);
+ printf ("%IE", d);
+ printf ("%Ig", d);
+ printf ("%IG", d);
+ printf ("%Ia", d); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%IA", d); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%Ic", i); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%Is", s); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%Ip", p); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%IC", lc); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%IS", ls); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%Im"); /* { dg-warning "flag" "bad use of I flag" } */
+
+ /* As an extension, GCC does format checking on "unlocked"
+ i.e. thread unsafe versions of these functions. */
+ fprintf_unlocked (stdout, "%d", i);
+ fprintf_unlocked (stdout, "%ld", i); /* { dg-warning "format" "fprintf_unlocked" } */
+ printf_unlocked ("%d", i);
+ printf_unlocked ("%ld", i); /* { dg-warning "format" "printf_unlocked" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-2.c
new file mode 100644
index 000000000..466991b59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-2.c
@@ -0,0 +1,73 @@
+/* Test for format extensions beyond the C standard and X/Open standard.
+ Test for scanf formats.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (quad_t *qp, u_quad_t *uqp, quad_t *qn, long long int *llp,
+ unsigned long long int *ullp, float *fp, char *s, void **pp, wchar_t *ls,
+ int *ip, unsigned int *up)
+{
+ /* As an extension, GCC allows the BSD length "q" for integer formats.
+ This is largely obsoleted in C99 by %j, %ll and SCNd64.
+ */
+ scanf ("%qd%qi%qo%qu%qx%qX%qn", qp, qp, uqp, uqp, uqp, uqp, qn);
+ scanf ("%qf", fp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qF", fp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qe", fp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qE", fp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qg", fp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qG", fp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qa", fp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qA", fp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qs", s); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%q[abc]", s); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qc", s); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qp", pp); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qC", ls); /* { dg-warning "length" "bad use of %q" } */
+ scanf ("%qS", ls); /* { dg-warning "length" "bad use of %q" } */
+ /* As an extension, GCC allows the length "L" on integer formats
+ (but not %n) as a synonym for "ll".
+ This should be considered deprecated.
+ */
+ scanf ("%Ld%Li%Lo%Lu%Lx%LX", llp, llp, ullp, ullp, ullp, ullp);
+ /* glibc also supports flags ' and I on scanf formats. The ' flag applies
+ to all formats scanning decimal values; the I flag only to decimal integer
+ formats.
+ */
+ scanf ("%'d%'i%'u%'a%'A%'e%'E%'f%'F%'g%'G", ip, ip, up, fp, fp, fp, fp,
+ fp, fp, fp, fp);
+ scanf ("%'o", up); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'x", up); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'X", up); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'n", ip); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'s", s); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'[abc]", s); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'c", s); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'p", pp); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'C", ls); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%'S", ls); /* { dg-warning "flag" "bad use of ' flag" } */
+ scanf ("%Id%Ii%Iu", ip, ip, up);
+ scanf ("%Ia", fp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%IA", fp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%Ie", fp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%IE", fp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%If", fp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%IF", fp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%Ig", fp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%IG", fp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%Io", up); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%Ix", up); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%IX", up); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%In", ip); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%Is", s); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%I[abc]", s); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%Ic", s); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%Ip", pp); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%IC", ls); /* { dg-warning "flag" "bad use of I flag" } */
+ scanf ("%IS", ls); /* { dg-warning "flag" "bad use of I flag" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-3.c
new file mode 100644
index 000000000..937e11212
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-3.c
@@ -0,0 +1,216 @@
+/* Test for format extensions beyond the C standard and X/Open standard.
+ Test for strftime formats.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-y2k" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ /* GCC accepts the "-", "_" and "0" flags to control padding on numeric
+ formats. It also accepts width on these formats.
+ */
+ /* Basic tests of parts on their own. */
+ strftime (s, m, "%5C%-C%_C%0C", tp);
+ /* Correct usages. */
+ strftime (s, m, "%-5C%_5C%05C%-5d%_5d%05d%-5e%_5e%05e%-5G%_5G%05G", tp);
+ strftime (s, m, "%-5H%_5H%05H%-5I%_5I%05I%-5j%_5j%05j%-5m%_5m%05m", tp);
+ strftime (s, m, "%-5M%_5M%05M%-5S%_5S%05S%-5u%_5u%05u%-5U%_5U%05U", tp);
+ strftime (s, m, "%-5V%_5V%05V%-5w%_5w%05w%-5W%_5W%05W%-5Y%_5Y%05Y", tp);
+ /* Correct usages with GNU extension conversion characters. */
+ strftime (s, m, "%-5k%_5k%05k%-5l%_5l%05l%-20s%_20s%020s", tp);
+ /* Correct usages with Y2K problems. */
+ strftime (s, m, "%-5g%_5g%05g%-5y%_5y%05y", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ /* Incorrect usages. */
+ strftime (s, m, "%5a", tp); /* { dg-warning "width" "bad %a" } */
+ strftime (s, m, "%-a", tp); /* { dg-warning "flag" "bad %a" } */
+ strftime (s, m, "%_a", tp); /* { dg-warning "flag" "bad %a" } */
+ strftime (s, m, "%0a", tp); /* { dg-warning "flag" "bad %a" } */
+ strftime (s, m, "%5A", tp); /* { dg-warning "width" "bad %A" } */
+ strftime (s, m, "%-A", tp); /* { dg-warning "flag" "bad %A" } */
+ strftime (s, m, "%_A", tp); /* { dg-warning "flag" "bad %A" } */
+ strftime (s, m, "%0A", tp); /* { dg-warning "flag" "bad %A" } */
+ strftime (s, m, "%5b", tp); /* { dg-warning "width" "bad %b" } */
+ strftime (s, m, "%-b", tp); /* { dg-warning "flag" "bad %b" } */
+ strftime (s, m, "%_b", tp); /* { dg-warning "flag" "bad %b" } */
+ strftime (s, m, "%0b", tp); /* { dg-warning "flag" "bad %b" } */
+ strftime (s, m, "%5B", tp); /* { dg-warning "width" "bad %B" } */
+ strftime (s, m, "%-B", tp); /* { dg-warning "flag" "bad %B" } */
+ strftime (s, m, "%_B", tp); /* { dg-warning "flag" "bad %B" } */
+ strftime (s, m, "%0B", tp); /* { dg-warning "flag" "bad %B" } */
+ strftime (s, m, "%5F", tp); /* { dg-warning "width" "bad %F" } */
+ strftime (s, m, "%-F", tp); /* { dg-warning "flag" "bad %F" } */
+ strftime (s, m, "%_F", tp); /* { dg-warning "flag" "bad %F" } */
+ strftime (s, m, "%0F", tp); /* { dg-warning "flag" "bad %F" } */
+ strftime (s, m, "%5h", tp); /* { dg-warning "width" "bad %h" } */
+ strftime (s, m, "%-h", tp); /* { dg-warning "flag" "bad %h" } */
+ strftime (s, m, "%_h", tp); /* { dg-warning "flag" "bad %h" } */
+ strftime (s, m, "%0h", tp); /* { dg-warning "flag" "bad %h" } */
+ strftime (s, m, "%5n", tp); /* { dg-warning "width" "bad %n" } */
+ strftime (s, m, "%-n", tp); /* { dg-warning "flag" "bad %n" } */
+ strftime (s, m, "%_n", tp); /* { dg-warning "flag" "bad %n" } */
+ strftime (s, m, "%0n", tp); /* { dg-warning "flag" "bad %n" } */
+ strftime (s, m, "%5p", tp); /* { dg-warning "width" "bad %p" } */
+ strftime (s, m, "%-p", tp); /* { dg-warning "flag" "bad %p" } */
+ strftime (s, m, "%_p", tp); /* { dg-warning "flag" "bad %p" } */
+ strftime (s, m, "%0p", tp); /* { dg-warning "flag" "bad %p" } */
+ strftime (s, m, "%5r", tp); /* { dg-warning "width" "bad %r" } */
+ strftime (s, m, "%-r", tp); /* { dg-warning "flag" "bad %r" } */
+ strftime (s, m, "%_r", tp); /* { dg-warning "flag" "bad %r" } */
+ strftime (s, m, "%0r", tp); /* { dg-warning "flag" "bad %r" } */
+ strftime (s, m, "%5R", tp); /* { dg-warning "width" "bad %R" } */
+ strftime (s, m, "%-R", tp); /* { dg-warning "flag" "bad %R" } */
+ strftime (s, m, "%_R", tp); /* { dg-warning "flag" "bad %R" } */
+ strftime (s, m, "%0R", tp); /* { dg-warning "flag" "bad %R" } */
+ strftime (s, m, "%5t", tp); /* { dg-warning "width" "bad %t" } */
+ strftime (s, m, "%-t", tp); /* { dg-warning "flag" "bad %t" } */
+ strftime (s, m, "%_t", tp); /* { dg-warning "flag" "bad %t" } */
+ strftime (s, m, "%0t", tp); /* { dg-warning "flag" "bad %t" } */
+ strftime (s, m, "%5T", tp); /* { dg-warning "width" "bad %T" } */
+ strftime (s, m, "%-T", tp); /* { dg-warning "flag" "bad %T" } */
+ strftime (s, m, "%_T", tp); /* { dg-warning "flag" "bad %T" } */
+ strftime (s, m, "%0T", tp); /* { dg-warning "flag" "bad %T" } */
+ strftime (s, m, "%5X", tp); /* { dg-warning "width" "bad %X" } */
+ strftime (s, m, "%-X", tp); /* { dg-warning "flag" "bad %X" } */
+ strftime (s, m, "%_X", tp); /* { dg-warning "flag" "bad %X" } */
+ strftime (s, m, "%0X", tp); /* { dg-warning "flag" "bad %X" } */
+ strftime (s, m, "%5z", tp); /* { dg-warning "width" "bad %z" } */
+ strftime (s, m, "%-z", tp); /* { dg-warning "flag" "bad %z" } */
+ strftime (s, m, "%_z", tp); /* { dg-warning "flag" "bad %z" } */
+ strftime (s, m, "%0z", tp); /* { dg-warning "flag" "bad %z" } */
+ strftime (s, m, "%5Z", tp); /* { dg-warning "width" "bad %Z" } */
+ strftime (s, m, "%-Z", tp); /* { dg-warning "flag" "bad %Z" } */
+ strftime (s, m, "%_Z", tp); /* { dg-warning "flag" "bad %Z" } */
+ strftime (s, m, "%0Z", tp); /* { dg-warning "flag" "bad %Z" } */
+ /* Incorrect usages with Y2K problems. */
+ strftime (s, m, "%5c", tp); /* { dg-warning "width" "bad %c" } */
+ strftime (s, m, "%-c", tp); /* { dg-warning "flag" "bad %c" } */
+ strftime (s, m, "%_c", tp); /* { dg-warning "flag" "bad %c" } */
+ strftime (s, m, "%0c", tp); /* { dg-warning "flag" "bad %c" } */
+ strftime (s, m, "%5D", tp); /* { dg-warning "width" "bad %D" } */
+ strftime (s, m, "%-D", tp); /* { dg-warning "flag" "bad %D" } */
+ strftime (s, m, "%_D", tp); /* { dg-warning "flag" "bad %D" } */
+ strftime (s, m, "%0D", tp); /* { dg-warning "flag" "bad %D" } */
+ strftime (s, m, "%5x", tp); /* { dg-warning "width" "bad %x" } */
+ strftime (s, m, "%-x", tp); /* { dg-warning "flag" "bad %x" } */
+ strftime (s, m, "%_x", tp); /* { dg-warning "flag" "bad %x" } */
+ strftime (s, m, "%0x", tp); /* { dg-warning "flag" "bad %x" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 89 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 90 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 91 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 92 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 93 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 94 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 95 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 96 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 97 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 98 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 99 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 100 } */
+ /* Incorrect usages with GNU extension conversion characters. */
+ strftime (s, m, "%5P", tp); /* { dg-warning "width" "bad %P" } */
+ strftime (s, m, "%-P", tp); /* { dg-warning "flag" "bad %P" } */
+ strftime (s, m, "%_P", tp); /* { dg-warning "flag" "bad %P" } */
+ strftime (s, m, "%0P", tp); /* { dg-warning "flag" "bad %P" } */
+ /* The "^" and "#" flags control the case of the output.
+ ^ (uppercase) makes sense on aAbBhZ; # (change case) makes sense
+ on the same and on p.
+ */
+ strftime (s, m, "%^a%#a%^A%#A%^b%#b%^B%#B%^h%#h%^Z%#Z%#p", tp);
+ /* Bad usages. */
+ strftime (s, m, "%^C", tp); /* { dg-warning "flag" "bad %C" } */
+ strftime (s, m, "%#C", tp); /* { dg-warning "flag" "bad %C" } */
+ strftime (s, m, "%^d", tp); /* { dg-warning "flag" "bad %d" } */
+ strftime (s, m, "%#d", tp); /* { dg-warning "flag" "bad %d" } */
+ strftime (s, m, "%^e", tp); /* { dg-warning "flag" "bad %e" } */
+ strftime (s, m, "%#e", tp); /* { dg-warning "flag" "bad %e" } */
+ strftime (s, m, "%^F", tp); /* { dg-warning "flag" "bad %F" } */
+ strftime (s, m, "%#F", tp); /* { dg-warning "flag" "bad %F" } */
+ strftime (s, m, "%^G", tp); /* { dg-warning "flag" "bad %G" } */
+ strftime (s, m, "%#G", tp); /* { dg-warning "flag" "bad %G" } */
+ strftime (s, m, "%^H", tp); /* { dg-warning "flag" "bad %H" } */
+ strftime (s, m, "%#H", tp); /* { dg-warning "flag" "bad %H" } */
+ strftime (s, m, "%^I", tp); /* { dg-warning "flag" "bad %I" } */
+ strftime (s, m, "%#I", tp); /* { dg-warning "flag" "bad %I" } */
+ strftime (s, m, "%^j", tp); /* { dg-warning "flag" "bad %j" } */
+ strftime (s, m, "%#j", tp); /* { dg-warning "flag" "bad %j" } */
+ strftime (s, m, "%^m", tp); /* { dg-warning "flag" "bad %m" } */
+ strftime (s, m, "%#m", tp); /* { dg-warning "flag" "bad %m" } */
+ strftime (s, m, "%^M", tp); /* { dg-warning "flag" "bad %M" } */
+ strftime (s, m, "%#M", tp); /* { dg-warning "flag" "bad %M" } */
+ strftime (s, m, "%^n", tp); /* { dg-warning "flag" "bad %n" } */
+ strftime (s, m, "%#n", tp); /* { dg-warning "flag" "bad %n" } */
+ strftime (s, m, "%^p", tp); /* { dg-warning "flag" "bad %p" } */
+ strftime (s, m, "%^r", tp); /* { dg-warning "flag" "bad %r" } */
+ strftime (s, m, "%#r", tp); /* { dg-warning "flag" "bad %r" } */
+ strftime (s, m, "%^R", tp); /* { dg-warning "flag" "bad %R" } */
+ strftime (s, m, "%#R", tp); /* { dg-warning "flag" "bad %R" } */
+ strftime (s, m, "%^S", tp); /* { dg-warning "flag" "bad %S" } */
+ strftime (s, m, "%#S", tp); /* { dg-warning "flag" "bad %S" } */
+ strftime (s, m, "%^t", tp); /* { dg-warning "flag" "bad %t" } */
+ strftime (s, m, "%#t", tp); /* { dg-warning "flag" "bad %t" } */
+ strftime (s, m, "%^T", tp); /* { dg-warning "flag" "bad %T" } */
+ strftime (s, m, "%#T", tp); /* { dg-warning "flag" "bad %T" } */
+ strftime (s, m, "%^u", tp); /* { dg-warning "flag" "bad %u" } */
+ strftime (s, m, "%#u", tp); /* { dg-warning "flag" "bad %u" } */
+ strftime (s, m, "%^U", tp); /* { dg-warning "flag" "bad %U" } */
+ strftime (s, m, "%#U", tp); /* { dg-warning "flag" "bad %U" } */
+ strftime (s, m, "%^V", tp); /* { dg-warning "flag" "bad %V" } */
+ strftime (s, m, "%#V", tp); /* { dg-warning "flag" "bad %V" } */
+ strftime (s, m, "%^w", tp); /* { dg-warning "flag" "bad %w" } */
+ strftime (s, m, "%#w", tp); /* { dg-warning "flag" "bad %w" } */
+ strftime (s, m, "%^W", tp); /* { dg-warning "flag" "bad %W" } */
+ strftime (s, m, "%#W", tp); /* { dg-warning "flag" "bad %W" } */
+ strftime (s, m, "%^X", tp); /* { dg-warning "flag" "bad %X" } */
+ strftime (s, m, "%#X", tp); /* { dg-warning "flag" "bad %X" } */
+ strftime (s, m, "%^Y", tp); /* { dg-warning "flag" "bad %Y" } */
+ strftime (s, m, "%#Y", tp); /* { dg-warning "flag" "bad %Y" } */
+ strftime (s, m, "%^z", tp); /* { dg-warning "flag" "bad %z" } */
+ strftime (s, m, "%#z", tp); /* { dg-warning "flag" "bad %z" } */
+ strftime (s, m, "%^P", tp); /* { dg-warning "flag" "bad %P" } */
+ strftime (s, m, "%#P", tp); /* { dg-warning "flag" "bad %P" } */
+ strftime (s, m, "%^k", tp); /* { dg-warning "flag" "bad %k" } */
+ strftime (s, m, "%#k", tp); /* { dg-warning "flag" "bad %k" } */
+ strftime (s, m, "%^l", tp); /* { dg-warning "flag" "bad %l" } */
+ strftime (s, m, "%#l", tp); /* { dg-warning "flag" "bad %l" } */
+ strftime (s, m, "%^s", tp); /* { dg-warning "flag" "bad %s" } */
+ strftime (s, m, "%#s", tp); /* { dg-warning "flag" "bad %s" } */
+ /* Bad usages with Y2K problems. */
+ strftime (s, m, "%^c", tp); /* { dg-warning "flag" "bad %c" } */
+ strftime (s, m, "%#c", tp); /* { dg-warning "flag" "bad %c" } */
+ strftime (s, m, "%^D", tp); /* { dg-warning "flag" "bad %D" } */
+ strftime (s, m, "%#D", tp); /* { dg-warning "flag" "bad %D" } */
+ strftime (s, m, "%^g", tp); /* { dg-warning "flag" "bad %g" } */
+ strftime (s, m, "%#g", tp); /* { dg-warning "flag" "bad %g" } */
+ strftime (s, m, "%^x", tp); /* { dg-warning "flag" "bad %x" } */
+ strftime (s, m, "%#x", tp); /* { dg-warning "flag" "bad %x" } */
+ strftime (s, m, "%^y", tp); /* { dg-warning "flag" "bad %y" } */
+ strftime (s, m, "%#y", tp); /* { dg-warning "flag" "bad %y" } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 182 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 183 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 184 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 185 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 186 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 187 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 188 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 189 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 190 } */
+ /* { dg-warning "only last 2" "2-digit year" { target *-*-* } 191 } */
+ /* GCC also accepts the glibc format extensions %P, %k, %l, %s. */
+ strftime (s, m, "%P%k%l%s", tp);
+ /* GCC also accepts the glibc extension of the "O" modifier on some
+ more formats. The cases where it is rejected altogether are
+ covered in c99-strftime-1.c, except for the extension %P.
+ */
+ strftime (s, m, "%OC%Og%OG%Oj%OY%Oz%Ok%Ol%Os", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ strftime (s, m, "%OP", tp); /* { dg-warning "flag|modifier" "bad %OP" } */
+ /* The "-", "_" and "0" flags are mutually exclusive. */
+ strftime (s, m, "%-_5C", tp); /* { dg-warning "flag" "bad %-_" } */
+ strftime (s, m, "%-05C", tp); /* { dg-warning "flag" "bad %-0" } */
+ strftime (s, m, "%_05C", tp); /* { dg-warning "flag" "bad %_0" } */
+ /* The "#" and "^" flags are mutually exclusive. */
+ strftime (s, m, "%^#a", tp); /* { dg-warning "flag" "bad %^#" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-4.c
new file mode 100644
index 000000000..c11c0ada7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-4.c
@@ -0,0 +1,18 @@
+/* Test for scanf formats. %a extensions. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp)
+{
+ /* %a formats for allocation, only recognized in C90 mode, are a
+ GNU extension. Followed by other characters, %a is not treated
+ specially.
+ */
+ scanf ("%as", sp);
+ scanf ("%aS", lsp);
+ scanf ("%a[bcd]", sp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-5.c
new file mode 100644
index 000000000..eebc7faa3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-5.c
@@ -0,0 +1,17 @@
+/* Test for gettext default attributes. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, long l)
+{
+ printf (gettext ("%d"), i);
+ printf (gettext ("%ld"), i); /* { dg-warning "format" "gettext" } */
+ printf (dgettext ("", "%d"), i);
+ printf (dgettext ("", "%ld"), i); /* { dg-warning "format" "dgettext" } */
+ printf (dcgettext ("", "%d", 0), i);
+ printf (dcgettext ("", "%ld", 0), i); /* { dg-warning "format" "dcgettext" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-6.c
new file mode 100644
index 000000000..08d24cbf7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-6.c
@@ -0,0 +1,47 @@
+/* Test for format extensions. Test that the C99 functions get their
+ default attributes in gnu89 mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, char *s, size_t n, int *ip, va_list v0, va_list v1, va_list v2,
+ va_list v3, va_list v4, va_list v5, va_list v6, va_list v7, va_list v8,
+ va_list v9, va_list v10, va_list v11, va_list v12, va_list v13)
+{
+ fprintf (stdout, "%d", i);
+ fprintf (stdout, "%ld", i); /* { dg-warning "format" "fprintf" } */
+ printf ("%d", i);
+ printf ("%ld", i); /* { dg-warning "format" "printf" } */
+ fprintf_unlocked (stdout, "%d", i);
+ fprintf_unlocked (stdout, "%ld", i); /* { dg-warning "format" "fprintf_unlocked" } */
+ printf_unlocked ("%d", i);
+ printf_unlocked ("%ld", i); /* { dg-warning "format" "printf_unlocked" } */
+ sprintf (s, "%d", i);
+ sprintf (s, "%ld", i); /* { dg-warning "format" "sprintf" } */
+ snprintf (s, n, "%d", i);
+ snprintf (s, n, "%ld", i); /* { dg-warning "format" "snprintf" } */
+ vfprintf (stdout, "%d", v0);
+ vfprintf (stdout, "%Y", v1); /* { dg-warning "format" "vfprintf" } */
+ vprintf ("%d", v2);
+ vprintf ("%Y", v3); /* { dg-warning "format" "vprintf" } */
+ vsprintf (s, "%d", v4);
+ vsprintf (s, "%Y", v5); /* { dg-warning "format" "vsprintf" } */
+ vsnprintf (s, n, "%d", v6);
+ vsnprintf (s, n, "%Y", v7); /* { dg-warning "format" "vsnprintf" } */
+ fscanf (stdin, "%d", ip);
+ fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
+ scanf ("%d", ip);
+ scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
+ sscanf (s, "%d", ip);
+ sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
+ vfscanf (stdin, "%d", v8);
+ vfscanf (stdin, "%Y", v9); /* { dg-warning "format" "vfscanf" } */
+ vscanf ("%d", v10);
+ vscanf ("%Y", v11); /* { dg-warning "format" "vscanf" } */
+ vsscanf (s, "%d", v12);
+ vsscanf (s, "%Y", v13); /* { dg-warning "format" "vsscanf" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-7.c
new file mode 100644
index 000000000..d9bd0e8ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-7.c
@@ -0,0 +1,85 @@
+/* Test for scanf formats. %a and %m extensions. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp, int *ip, float *fp, void **pp, double *dp)
+{
+ /* %a formats for allocation, only recognized in C90 mode, are a
+ GNU extension. Followed by other characters, %a is not treated
+ specially.
+ */
+ scanf ("%as", sp);
+ scanf ("%aS", lsp);
+ scanf ("%las", dp);
+ scanf ("%la", lsp); /* { dg-warning "but argument 2 has type" } */
+ scanf ("%las", lsp); /* { dg-warning "but argument 2 has type" } */
+ scanf ("%a[bcd]", sp);
+ scanf ("%la[bcd]", dp);
+ scanf ("%*as");
+ scanf ("%*aS");
+ scanf ("%*las"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*a[bcd]");
+ scanf ("%*la[bcd]"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%10as", sp);
+ scanf ("%5aS", lsp);
+ scanf ("%9las", dp);
+ scanf ("%25a[bcd]", sp);
+ scanf ("%48la[bcd]", dp);
+ scanf ("%*10as");
+ scanf ("%*5aS");
+ scanf ("%*9las"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*25a[bcd]");
+ scanf ("%*48la[bcd]"); /* { dg-warning "assignment suppression and length modifier" } */
+
+ /* m assignment-allocation modifier, recognized in both C90
+ and C99 modes, is a POSIX and ISO/IEC WDTR 24731-2 extension. */
+ scanf ("%ms", sp);
+ scanf ("%mS", lsp);
+ scanf ("%mls", lsp);
+ scanf ("%m[bcd]", sp);
+ scanf ("%ml[bcd]", lsp);
+ scanf ("%mc", sp);
+ scanf ("%mlc", lsp);
+ scanf ("%mC", lsp);
+ scanf ("%*ms");
+ scanf ("%*mS");
+ scanf ("%*mls"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*m[bcd]");
+ scanf ("%*ml[bcd]"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*mc");
+ scanf ("%*mlc"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*mC");
+ scanf ("%10ms", sp);
+ scanf ("%5mS", lsp);
+ scanf ("%9mls", lsp);
+ scanf ("%25m[bcd]", sp);
+ scanf ("%41ml[bcd]", lsp);
+ scanf ("%131mc", sp);
+ scanf ("%27mlc", lsp);
+ scanf ("%2mC", lsp);
+ scanf ("%*10ms");
+ scanf ("%*5mS");
+ scanf ("%*9mls"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*25m[bcd]");
+ scanf ("%*41ml[bcd]"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*131mc");
+ scanf ("%*27mlc"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*2mC");
+
+ scanf ("%md", ip); /* { dg-warning "flag used with" } */
+ scanf ("%mi", ip); /* { dg-warning "flag used with" } */
+ scanf ("%mo", ip); /* { dg-warning "flag used with" } */
+ scanf ("%mu", ip); /* { dg-warning "flag used with" } */
+ scanf ("%mx", ip); /* { dg-warning "flag used with" } */
+ scanf ("%me", fp); /* { dg-warning "flag used with" } */
+ scanf ("%mf", fp); /* { dg-warning "flag used with" } */
+ scanf ("%mg", fp); /* { dg-warning "flag used with" } */
+ scanf ("%mp", pp); /* { dg-warning "flag used with" } */
+
+ scanf ("%mas", sp); /* { dg-warning "flag together" } */
+ scanf ("%maS", lsp); /* { dg-warning "flag together" } */
+ scanf ("%ma[bcd]", sp); /* { dg-warning "flag together" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-8.c
new file mode 100644
index 000000000..b50cc81d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ext-8.c
@@ -0,0 +1,56 @@
+/* Test for scanf formats. %m extensions. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp, int *ip, float *fp, void **pp)
+{
+ /* m assignment-allocation modifier, recognized in both C90
+ and C99 modes, is a POSIX and ISO/IEC WDTR 24731-2 extension. */
+ scanf ("%ms", sp);
+ scanf ("%mS", lsp);
+ scanf ("%mls", lsp);
+ scanf ("%m[bcd]", sp);
+ scanf ("%ml[bcd]", lsp);
+ scanf ("%mc", sp);
+ scanf ("%mlc", lsp);
+ scanf ("%mC", lsp);
+ scanf ("%*ms");
+ scanf ("%*mS");
+ scanf ("%*mls"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*m[bcd]");
+ scanf ("%*ml[bcd]"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*mc");
+ scanf ("%*mlc"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*mC");
+ scanf ("%10ms", sp);
+ scanf ("%5mS", lsp);
+ scanf ("%9mls", lsp);
+ scanf ("%25m[bcd]", sp);
+ scanf ("%41ml[bcd]", lsp);
+ scanf ("%131mc", sp);
+ scanf ("%27mlc", lsp);
+ scanf ("%2mC", lsp);
+ scanf ("%*10ms");
+ scanf ("%*5mS");
+ scanf ("%*9mls"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*25m[bcd]");
+ scanf ("%*41ml[bcd]"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*131mc");
+ scanf ("%*27mlc"); /* { dg-warning "assignment suppression and length modifier" } */
+ scanf ("%*2mC");
+
+ scanf ("%md", ip); /* { dg-warning "flag used with" } */
+ scanf ("%mi", ip); /* { dg-warning "flag used with" } */
+ scanf ("%mo", ip); /* { dg-warning "flag used with" } */
+ scanf ("%mu", ip); /* { dg-warning "flag used with" } */
+ scanf ("%mx", ip); /* { dg-warning "flag used with" } */
+ scanf ("%ma", fp); /* { dg-warning "flag used with" } */
+ scanf ("%mA", fp); /* { dg-warning "flag used with" } */
+ scanf ("%me", fp); /* { dg-warning "flag used with" } */
+ scanf ("%mf", fp); /* { dg-warning "flag used with" } */
+ scanf ("%mg", fp); /* { dg-warning "flag used with" } */
+ scanf ("%mp", pp); /* { dg-warning "flag used with" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/few-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/few-1.c
new file mode 100644
index 000000000..cf411409b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/few-1.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -Wformat" } */
+
+int f(int *ip, char *cp)
+{
+ __builtin_printf ("%*.*s");
+/* { dg-warning "field width specifier '\\*' expects a matching 'int' argument" "width" { target *-*-* } 6 } */
+/* { dg-warning "field precision specifier '\\.\\*' expects a matching 'int' argument" "precision" { target *-*-* } 6 } */
+/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "format" { target *-*-* } 6 } */
+ __builtin_printf ("%*.*s", ip, *cp);
+/* { dg-warning "field width specifier '\\*' expects argument of type 'int'" "width" { target *-*-* } 10 } */
+/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "format" { target *-*-* } 10 } */
+ __builtin_printf ("%s %i", ip, ip);
+/* { dg-warning "format '%s' expects argument of type 'char \\*'" "char" { target *-*-* } 13 } */
+/* { dg-warning "format '%i' expects argument of type 'int'" "int" { target *-*-* } 13 } */
+ __builtin_printf ("%s %i", cp);
+/* { dg-warning "format '%i' expects a matching 'int' argument" "" { target *-*-* } 16 } */
+ __builtin_printf ("%lc");
+/* { dg-warning "format '%lc' expects a matching 'wint_t' argument" "" { target *-*-* } 18 } */
+ __builtin_printf ("%lc", cp);
+/* { dg-warning "format '%lc' expects argument of type 'wint_t'" "" { target *-*-* } 20 } */
+ __builtin_scanf ("%s");
+/* { dg-warning "format '%s' expects a matching 'char \\*' argument" "" { target *-*-* } 22 } */
+ __builtin_scanf ("%i", cp);
+/* { dg-warning "format '%i' expects argument of type 'int \\*'" "" { target *-*-* } 24 } */
+ __builtin_scanf ("%lc");
+/* { dg-warning "format '%lc' expects a matching 'wchar_t \\*' argument" "" { target *-*-* } 26 } */
+ __builtin_scanf ("%lc", cp);
+/* { dg-warning "format '%lc' expects argument of type 'wchar_t \\*'" "" { target *-*-* } 28 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/format.exp b/gcc-4.9/gcc/testsuite/gcc.dg/format/format.exp
new file mode 100644
index 000000000..9d8a289a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/format.exp
@@ -0,0 +1,34 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Don't run this directory with any default CFLAGS, but run tests with
+# and without -DWIDE.
+
+# Need to copy the format.h header.
+if [is_remote host] {
+ remote_download host $srcdir/$subdir/format.h
+}
+
+load_lib gcc-dg.exp
+load_lib torture-options.exp
+
+torture-init
+set-torture-options [list { } { -DWIDE } ]
+
+dg-init
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] ""
+torture-finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/format.h b/gcc-4.9/gcc/testsuite/gcc.dg/format/format.h
new file mode 100644
index 000000000..a99927e3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/format.h
@@ -0,0 +1,192 @@
+/* Format checking tests: common header. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+
+/* DONT_GNU_PROTOTYPE */
+#if defined (_WIN32) && !defined (__CYGWIN__)
+#if !defined (USE_SYSTEM_FORMATS)
+#define gnu_attr_printf gnu_printf
+#define gnu_attr___printf__ __gnu_printf__
+#define gnu_attr_scanf gnu_scanf
+#define gnu_attr___scanf__ __gnu_scanf__
+#define gnu_attr_strftime gnu_strftime
+#define gnu_attr___strftime__ __gnu_strftime__
+#endif
+#endif
+
+#ifndef gnu_attr_printf
+#define gnu_attr_printf printf
+#define gnu_attr___printf__ __printf__
+#define gnu_attr_scanf scanf
+#define gnu_attr___scanf__ __scanf__
+#define gnu_attr_strftime strftime
+#define gnu_attr___strftime__ __strftime__
+#endif
+
+#if !defined (USE_SYSTEM_FORMATS)
+#define USE_PRINTF(FMTPOS, WILDARG) __attribute__((format(gnu_printf, FMTPOS, WILDARG))) __attribute__((nonnull (FMTPOS)))
+#define USE_SCANF(FMTPOS, WILDARG) __attribute__((format(gnu_scanf, FMTPOS, WILDARG))) __attribute__((nonnull (FMTPOS)))
+#define USE_STRFTIME(FMTPOS) __attribute__((__format__(gnu_strftime, FMTPOS, 0))) __attribute__((nonnull (FMTPOS)))
+#else
+#define USE_PRINTF(FMTPOS, WILDARG)
+#define USE_SCANF(FMTPOS, WILDARG)
+#define USE_STRFTIME(FMTPOS)
+#endif
+
+#include <stdarg.h>
+#include <stddef.h>
+
+#ifndef _WINT_T
+#ifndef __WINT_TYPE__
+#define __WINT_TYPE__ unsigned int
+#endif
+typedef __WINT_TYPE__ wint_t;
+#endif
+
+#ifdef _WIN64
+/* Kludges to get types corresponding to size_t and ptrdiff_t. */
+#define unsigned signed
+typedef signed int signed_size_t __attribute__ ((mode (DI)));
+/* We also use this type to approximate ssize_t. */
+typedef signed int ssize_t __attribute__ ((mode (DI)));
+#undef unsigned
+#define signed /* Type might or might not have explicit 'signed'. */
+typedef unsigned int unsigned_ptrdiff_t __attribute__ ((mode (DI)));
+#undef signed
+
+__extension__ typedef int llong __attribute__ ((mode (DI)));
+__extension__ typedef unsigned int ullong __attribute__ ((mode (DI)));
+#else
+/* Kludges to get types corresponding to size_t and ptrdiff_t. */
+#define unsigned signed
+typedef __SIZE_TYPE__ signed_size_t;
+/* We also use this type to approximate ssize_t. */
+typedef __SIZE_TYPE__ ssize_t;
+#undef unsigned
+#define signed /* Type might or might not have explicit 'signed'. */
+typedef unsigned __PTRDIFF_TYPE__ unsigned_ptrdiff_t;
+#undef signed
+
+__extension__ typedef long long int llong;
+__extension__ typedef unsigned long long int ullong;
+#endif
+
+/* %q formats want a "quad"; GCC considers this to be a long long. */
+typedef llong quad_t;
+typedef ullong u_quad_t;
+
+__extension__ typedef __INTMAX_TYPE__ intmax_t;
+__extension__ typedef __UINTMAX_TYPE__ uintmax_t;
+
+#if __STDC_VERSION__ < 199901L && !defined(restrict)
+#define restrict /* "restrict" not in old C standard. */
+#endif
+
+/* This may not be correct in the particular case, but allows the
+ prototypes to be declared, and we don't try to link.
+*/
+typedef struct _FILE FILE;
+extern FILE *stdin;
+extern FILE *stdout;
+
+extern int fprintf (FILE *restrict, const char *restrict, ...);
+extern int printf (const char *restrict, ...);
+extern int fprintf_unlocked (FILE *restrict, const char *restrict, ...);
+extern int printf_unlocked (const char *restrict, ...);
+extern int sprintf (char *restrict, const char *restrict, ...);
+extern int vfprintf (FILE *restrict, const char *restrict, va_list);
+extern int vprintf (const char *restrict, va_list);
+extern int vsprintf (char *restrict, const char *restrict, va_list);
+extern int snprintf (char *restrict, size_t, const char *restrict, ...);
+extern int vsnprintf (char *restrict, size_t, const char *restrict, va_list);
+
+extern int fscanf (FILE *restrict, const char *restrict, ...);
+extern int scanf (const char *restrict, ...);
+extern int sscanf (const char *restrict, const char *restrict, ...);
+extern int vfscanf (FILE *restrict, const char *restrict, va_list);
+extern int vscanf (const char *restrict, va_list);
+extern int vsscanf (const char *restrict, const char *restrict, va_list);
+
+extern char *gettext (const char *);
+extern char *dgettext (const char *, const char *);
+extern char *dcgettext (const char *, const char *, int);
+
+struct tm;
+
+extern size_t strftime (char *restrict, size_t, const char *restrict,
+ const struct tm *restrict);
+
+extern ssize_t strfmon (char *restrict, size_t, const char *restrict, ...);
+
+/* Mingw specific part. */
+#if !defined (USE_SYSTEM_FORMATS) && defined(_WIN32) && !defined(DONT_GNU_PROTOTYPE)
+
+extern USE_PRINTF(2,3) int fprintf_gnu (FILE *restrict, const char *restrict, ...);
+#undef fprintf
+#define fprintf fprintf_gnu
+
+extern USE_PRINTF(1,2) int printf_gnu (const char *restrict, ...);
+#undef printf
+#define printf printf_gnu
+
+extern USE_PRINTF(2,3) int fprintf_unlocked_gnu (FILE *restrict, const char *restrict, ...);
+#undef fprintf_unlocked
+#define fprintf_unlocked fprintf_unlocked_gnu
+
+extern USE_PRINTF(1,2)int printf_unlocked_gnu (const char *restrict, ...);
+#undef printf_unlocked
+#define printf_unlocked printf_unlocked_gnu
+
+extern USE_PRINTF(2,3) int sprintf_gnu (char *restrict, const char *restrict, ...);
+#undef sprintf
+#define sprintf sprintf_gnu
+
+extern USE_PRINTF(2,0) int vfprintf_gnu (FILE *restrict, const char *restrict, va_list);
+#undef vsprintf
+#define vsprintf vsprintf_gnu
+
+extern USE_PRINTF(1,0) int vprintf_gnu (const char *restrict, va_list);
+#undef vprintf
+#define vprintf vprintf_gnu
+
+extern USE_PRINTF(2,0) int vsprintf_gnu (char *restrict, const char *restrict, va_list);
+#undef vsprintf
+#define vsprintf vsprintf_gnu
+
+extern USE_PRINTF(3,4) int snprintf_gnu (char *restrict, size_t, const char *restrict, ...);
+#undef snprintf
+#define snprintf snprintf_gnu
+
+extern USE_PRINTF(3,0) int vsnprintf_gnu (char *restrict, size_t, const char *restrict, va_list);
+#undef vsnprintf
+#define vsnprintf vsnprintf_gnu
+
+extern USE_SCANF(2,3) int fscanf_gnu (FILE *restrict, const char *restrict, ...);
+#undef fscanf
+#define fscanf fscanf_gnu
+
+extern USE_SCANF(1,2) int scanf_gnu (const char *restrict, ...);
+#undef scanf
+#define scanf scanf_gnu
+
+extern USE_SCANF(2,3) int sscanf_gnu (const char *restrict, const char *restrict, ...);
+#undef sscanf
+#define sscanf sscanf_gnu
+
+extern USE_SCANF(2,0) int vfscanf_gnu (FILE *restrict, const char *restrict, va_list);
+#undef vfscanf
+#define vfscanf vfscanf_gnu
+
+extern USE_SCANF(1,0) int vscanf_gnu (const char *restrict, va_list);
+#undef vscanf
+#define vscanf vscanf_gnu
+
+extern USE_SCANF(2,0) int vsscanf_gnu (const char *restrict, const char *restrict, va_list);
+#undef vsscanf
+#define vsscanf vsscanf_gnu
+
+extern USE_STRFTIME(3) size_t strftime_gnu (char *restrict, size_t, const char *restrict,
+ const struct tm *restrict);
+#undef strftime
+#define strftime strftime_gnu
+
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-1.c
new file mode 100644
index 000000000..953c944b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-1.c
@@ -0,0 +1,218 @@
+/* Test for GCC diagnositc formats. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+#define ATTRIBUTE_DIAG(F) __attribute__ ((__format__ (F, 1, 2))) __attribute__ ((__nonnull__));
+
+/* Magic identifiers must be set before the attribute is used. */
+
+typedef long long __gcc_host_wide_int__;
+
+typedef struct location_s
+{
+ const char *file;
+ int line;
+} location_t;
+
+union tree_node;
+typedef union tree_node *tree;
+
+extern int diag (const char *, ...) ATTRIBUTE_DIAG(__gcc_diag__);
+extern int tdiag (const char *, ...) ATTRIBUTE_DIAG(__gcc_tdiag__);
+extern int cdiag (const char *, ...) ATTRIBUTE_DIAG(__gcc_cdiag__);
+extern int cxxdiag (const char *, ...) ATTRIBUTE_DIAG(__gcc_cxxdiag__);
+
+void
+foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
+ int *n, short int *hn, long int l, unsigned long int ul,
+ long int *ln, long double ld, wint_t lc, wchar_t *ls, llong ll,
+ ullong ull, unsigned int *un, const int *cn, signed char *ss,
+ unsigned char *us, const signed char *css, unsigned int u1,
+ unsigned int u2, location_t *loc, tree t1, union tree_node *t2,
+ tree *t3, tree t4[])
+{
+ /* Acceptable C90 specifiers, flags and modifiers. */
+ diag ("%%");
+ tdiag ("%%");
+ cdiag ("%%");
+ cxxdiag ("%%");
+ diag ("%d%i%o%u%x%c%s%p%%", i, i, u, u, u, i, s, p);
+ tdiag ("%d%i%o%u%x%c%s%p%%", i, i, u, u, u, i, s, p);
+ cdiag ("%d%i%o%u%x%c%s%p%%", i, i, u, u, u, i, s, p);
+ cxxdiag ("%d%i%o%u%x%c%s%p%%", i, i, u, u, u, i, s, p);
+ diag ("%qd%qi%qo%qu%qx%qc%qs%qp%<%%%'%>", i, i, u, u, u, i, s, p);
+ tdiag ("%qd%qi%qo%qu%qx%qc%qs%qp%<%%%'%>", i, i, u, u, u, i, s, p);
+ cdiag ("%qd%qi%qo%qu%qx%qc%qs%qp%<%%%'%>", i, i, u, u, u, i, s, p);
+ cxxdiag ("%qd%qi%qo%qu%qx%qc%qs%qp%<%%%'%>", i, i, u, u, u, i, s, p);
+ diag ("%ld%li%lo%lu%lx", l, l, ul, ul, ul);
+ tdiag ("%ld%li%lo%lu%lx", l, l, ul, ul, ul);
+ cdiag ("%ld%li%lo%lu%lx", l, l, ul, ul, ul);
+ cxxdiag ("%ld%li%lo%lu%lx", l, l, ul, ul, ul);
+ diag ("%lld%lli%llo%llu%llx", ll, ll, ull, ull, ull);
+ tdiag ("%lld%lli%llo%llu%llx", ll, ll, ull, ull, ull);
+ cdiag ("%lld%lli%llo%llu%llx", ll, ll, ull, ull, ull);
+ cxxdiag ("%lld%lli%llo%llu%llx", ll, ll, ull, ull, ull);
+ diag ("%wd%wi%wo%wu%wx", ll, ll, ull, ull, ull);
+ tdiag ("%wd%wi%wo%wu%wx", ll, ll, ull, ull, ull);
+ cdiag ("%wd%wi%wo%wu%wx", ll, ll, ull, ull, ull);
+ cxxdiag ("%wd%wi%wo%wu%wx", ll, ll, ull, ull, ull);
+ diag ("%.*s", i, s);
+ tdiag ("%.*s", i, s);
+ cdiag ("%.*s", i, s);
+ cxxdiag ("%.*s", i, s);
+
+ /* Extensions provided in the diagnostic framework. */
+ diag ("%m");
+ tdiag ("%m");
+ cdiag ("%m");
+ cxxdiag ("%m");
+
+ tdiag ("%D%F%T%V", t1, t1, t1, t1);
+ tdiag ("%+D%+F%+T%+V", t1, t1, t1, t1);
+ tdiag ("%q+D%q+F%q+T%q+V", t1, t1, t1, t1);
+ tdiag ("%D%D%D%D", t1, t2, *t3, t4[5]);
+ cdiag ("%D%F%T%V", t1, t1, t1, t1);
+ cdiag ("%+D%+F%+T%+V", t1, t1, t1, t1);
+ cdiag ("%q+D%q+F%q+T%q+V", t1, t1, t1, t1);
+ cdiag ("%D%D%D%D", t1, t2, *t3, t4[5]);
+ cdiag ("%E", t1);
+ cxxdiag ("%A%D%E%F%T%V", t1, t1, t1, t1, t1, t1);
+ cxxdiag ("%D%D%D%D", t1, t2, *t3, t4[5]);
+ cxxdiag ("%#A%#D%#E%#F%#T%#V", t1, t1, t1, t1, t1, t1);
+ cxxdiag ("%+A%+D%+E%+F%+T%+V", t1, t1, t1, t1, t1, t1);
+ cxxdiag ("%+#A%+#D%+#E%+#F%+#T%+#V", t1, t1, t1, t1, t1, t1);
+ cxxdiag ("%C%L%O%P%Q", i, i, i, i, i);
+
+ tdiag ("%v%qv%#v", i, i, i);
+ cdiag ("%v%qv%#v", i, i, i);
+ cxxdiag ("%v%qv%#v", i, i, i);
+
+ /* Bad stuff with extensions. */
+ diag ("%m", i); /* { dg-warning "format" "extra arg" } */
+ tdiag ("%m", i); /* { dg-warning "format" "extra arg" } */
+ cdiag ("%m", i); /* { dg-warning "format" "extra arg" } */
+ cxxdiag ("%m", i); /* { dg-warning "format" "extra arg" } */
+ diag ("%#m"); /* { dg-warning "format" "bogus modifier" } */
+ tdiag ("%#m"); /* { dg-warning "format" "bogus modifier" } */
+ cdiag ("%#m"); /* { dg-warning "format" "bogus modifier" } */
+ cxxdiag ("%#m"); /* { dg-warning "format" "bogus modifier" } */
+ diag ("%+m"); /* { dg-warning "format" "bogus modifier" } */
+ tdiag ("%+m"); /* { dg-warning "format" "bogus modifier" } */
+ cdiag ("%+m"); /* { dg-warning "format" "bogus modifier" } */
+ cxxdiag ("%+m"); /* { dg-warning "format" "bogus modifier" } */
+ diag ("%D", t1); /* { dg-warning "format" "bogus tree" } */
+ tdiag ("%A", t1); /* { dg-warning "format" "bogus tree" } */
+ tdiag ("%E", t1);
+ tdiag ("%#D", t1); /* { dg-warning "format" "bogus modifier" } */
+ cdiag ("%A", t1); /* { dg-warning "format" "bogus tree" } */
+ cdiag ("%#D", t1); /* { dg-warning "format" "bogus modifier" } */
+ cdiag ("%+D", t1);
+ cxxdiag ("%C"); /* { dg-warning "format" "missing arg" } */
+ cxxdiag ("%C", l); /* { dg-warning "format" "wrong arg" } */
+ cxxdiag ("%C", i, i); /* { dg-warning "format" "extra arg" } */
+ cxxdiag ("%#C", i); /* { dg-warning "format" "bogus modifier" } */
+ cxxdiag ("%+C", i); /* { dg-warning "format" "bogus modifier" } */
+ tdiag ("%D"); /* { dg-warning "format" "missing arg" } */
+ cdiag ("%D"); /* { dg-warning "format" "missing arg" } */
+ cxxdiag ("%D"); /* { dg-warning "format" "missing arg" } */
+ tdiag ("%D", i); /* { dg-warning "format" "wrong arg" } */
+ cdiag ("%D", i); /* { dg-warning "format" "wrong arg" } */
+ cxxdiag ("%D", i); /* { dg-warning "format" "wrong arg" } */
+ tdiag ("%D", t1, t1); /* { dg-warning "format" "extra arg" } */
+ cdiag ("%D", t1, t1); /* { dg-warning "format" "extra arg" } */
+ cxxdiag ("%D", t1, t1); /* { dg-warning "format" "extra arg" } */
+
+ tdiag ("%V", i); /* { dg-warning "format" "wrong arg" } */
+ cdiag ("%V", i); /* { dg-warning "format" "wrong arg" } */
+ cxxdiag ("%V", i); /* { dg-warning "format" "wrong arg" } */
+
+ tdiag ("%v", t1); /* { dg-warning "format" "wrong arg" } */
+ cdiag ("%v", t1); /* { dg-warning "format" "wrong arg" } */
+ cxxdiag ("%v", t1); /* { dg-warning "format" "wrong arg" } */
+
+ /* Standard specifiers not accepted in the diagnostic framework. */
+ diag ("%X\n", u); /* { dg-warning "format" "HEX" } */
+ diag ("%f\n", d); /* { dg-warning "format" "float" } */
+ diag ("%e\n", d); /* { dg-warning "format" "float" } */
+ diag ("%E\n", d); /* { dg-warning "format" "float" } */
+ diag ("%g\n", d); /* { dg-warning "format" "float" } */
+ diag ("%G\n", d); /* { dg-warning "format" "float" } */
+ diag ("%n\n", n); /* { dg-warning "format" "counter" } */
+ diag ("%hd\n", i); /* { dg-warning "format" "conversion" } */
+
+ /* Various tests of bad argument types. */
+ diag ("%-d", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%-d", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%-d", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%-d", i); /* { dg-warning "format" "bad flag" } */
+ diag ("% d", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("% d", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("% d", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("% d", i); /* { dg-warning "format" "bad flag" } */
+ diag ("%#o", u); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%#o", u); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%#o", u); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%#o", u); /* { dg-warning "format" "bad flag" } */
+ diag ("%0d", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%0d", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%0d", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%0d", i); /* { dg-warning "format" "bad flag" } */
+ diag ("%08d", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%08d", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%08d", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%08d", i); /* { dg-warning "format" "bad flag" } */
+ diag ("%+d\n", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%+d\n", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%+d\n", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%+d\n", i); /* { dg-warning "format" "bad flag" } */
+ diag ("%3d\n", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%3d\n", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%3d\n", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%3d\n", i); /* { dg-warning "format" "bad flag" } */
+ diag ("%-3d\n", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%-3d\n", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%-3d\n", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%-3d\n", i); /* { dg-warning "format" "bad flag" } */
+ diag ("%.7d\n", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%.7d\n", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%.7d\n", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%.7d\n", i); /* { dg-warning "format" "bad flag" } */
+ diag ("%+9.4d\n", i); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%+9.4d\n", i); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%+9.4d\n", i); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%+9.4d\n", i); /* { dg-warning "format" "bad flag" } */
+ diag ("%.3ld\n", l); /* { dg-warning "format" "bad flag" } */
+ tdiag ("%.3ld\n", l); /* { dg-warning "format" "bad flag" } */
+ cdiag ("%.3ld\n", l); /* { dg-warning "format" "bad flag" } */
+ cxxdiag ("%.3ld\n", l); /* { dg-warning "format" "bad flag" } */
+ diag ("%d %lu\n", i, ul);
+ diag ("%d", l); /* { dg-warning "format" "bad argument types" } */
+ diag ("%wd", l); /* { dg-warning "format" "bad argument types" } */
+ diag ("%d", ll); /* { dg-warning "format" "bad argument types" } */
+ diag ("%*s", i, s); /* { dg-warning "format" "bad * argument types" } */
+ diag ("%*.*s", i, i, s); /* { dg-warning "format" "bad * argument types" } */
+ diag ("%*d\n", i1, i); /* { dg-warning "format" "bad * argument types" } */
+ diag ("%.*d\n", i2, i); /* { dg-warning "format" "bad * argument types" } */
+ diag ("%*.*ld\n", i1, i2, l); /* { dg-warning "format" "bad * argument types" } */
+ diag ("%ld", i); /* { dg-warning "format" "bad argument types" } */
+ diag ("%s", n); /* { dg-warning "format" "bad argument types" } */
+
+ /* Wrong number of arguments. */
+ diag ("%d%d", i); /* { dg-warning "matching" "wrong number of args" } */
+ diag ("%d", i, i); /* { dg-warning "arguments" "wrong number of args" } */
+ /* Miscellaneous bogus constructions. */
+ diag (""); /* { dg-warning "zero-length" "warning for empty format" } */
+ diag ("\0"); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ diag ("%d\0", i); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ diag ("%d\0%d", i, i); /* { dg-warning "embedded|too many" "warning for embedded NUL" } */
+ diag (NULL); /* { dg-warning "null" "null format string warning" } */
+ diag ("%"); /* { dg-warning "trailing" "trailing % warning" } */
+ diag ((const char *)L"foo"); /* { dg-warning "wide" "wide string" } */
+ diag ("%s", (char *)0); /* { dg-warning "null" "%s with NULL" } */
+
+ /* Make sure we still get warnings for regular printf. */
+ printf ("%d\n", ll); /* { dg-warning "format" "bad argument types" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-2.c
new file mode 100644
index 000000000..60c6835da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-2.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int tree);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-3.c
new file mode 100644
index 000000000..8d2ac61a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-3.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int tree;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "'tree' is not defined as a type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-4.c
new file mode 100644
index 000000000..9b2396219
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-4.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test "tree", not
+ a pointer type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int tree;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "'tree' is not defined as a pointer type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-5.c
new file mode 100644
index 000000000..f8f12d68c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-5.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "location_t", not defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int location_t);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-6.c
new file mode 100644
index 000000000..3f704e6f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-6.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "location_t", not a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int location_t;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "'location_t' is not defined as a type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-7.c
new file mode 100644
index 000000000..fccf5d240
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-7.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not defined. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+void foo (int __gcc_host_wide_int__);
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2)));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-8.c
new file mode 100644
index 000000000..6715ee33e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-8.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", not a type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "'__gcc_host_wide_int__' is not defined as a type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-9.c
new file mode 100644
index 000000000..8daeb58a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_diag-9.c
@@ -0,0 +1,10 @@
+/* Test for ICE handling internal formats: bug 20740. The code did
+ not check that, if the required typedef names had been used as
+ identifiers, they were defined to suitable types. Test
+ "__gcc_host_wide_int__", bad type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef int __gcc_host_wide_int__;
+void bar (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))); /* { dg-error "'__gcc_host_wide_int__' is not defined as 'long' or 'long long'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_gfc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_gfc-1.c
new file mode 100644
index 000000000..7e079b776
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_gfc-1.c
@@ -0,0 +1,32 @@
+/* Test for gcc_gfc formats. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+/* Magic identifier must be set before the attribute is used. */
+typedef struct locus locus;
+
+extern int gfc_warn (const char *, ...) __attribute__ ((__format__ (__gcc_gfc__, 1, 2))) __attribute__ ((__nonnull__));
+
+void
+foo (unsigned int u, int i, char *s, unsigned long int ul, long int l,
+ llong ll, locus *loc)
+{
+ /* Acceptable C90 specifiers, flags and modifiers. */
+ gfc_warn ("%%");
+ gfc_warn ("%u%d%i%c%s%%", u, i, i, i, s);
+ gfc_warn ("%lu%ld%li%%", ul, l, l);
+
+ /* Extensions provided in gfc_warn. */
+ gfc_warn ("%C");
+ gfc_warn ("%L", loc);
+
+ /* Various tests of bad argument types. */
+ gfc_warn ("%d", l); /* { dg-warning "format" "bad argument types" } */
+ gfc_warn ("%d", ll); /* { dg-warning "format" "bad argument types" } */
+ gfc_warn ("%s", &i); /* { dg-warning "format" "bad argument types" } */
+ gfc_warn ("%L", &i); /* { dg-warning "format" "bad argument types" } */
+ gfc_warn ("%C", i); /* { dg-warning "format" "too many arguments" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_gfc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_gfc-2.c
new file mode 100644
index 000000000..f3095fa29
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/gcc_gfc-2.c
@@ -0,0 +1,13 @@
+/* PR c/35436 */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+typedef void locus[1]; /* { dg-error "array of void" } */
+
+void foo(const char*, ...)
+ __attribute__((__format__(__gcc_gfc__, 1, 2))); /* { dg-error "locus" } */
+
+void bar()
+{
+ foo("%L", 0); /* { dg-warning "format" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-1.c
new file mode 100644
index 000000000..3d4b99124
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-1.c
@@ -0,0 +1,39 @@
+/* Test for warnings for missing format attributes. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#include "format.h"
+
+void
+foo (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vprintf (fmt, ap); /* { dg-warning "candidate" "printf attribute warning" } */
+ va_end (ap);
+}
+
+void
+bar (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" } */
+ va_end (ap);
+}
+
+__attribute__((__format__(gnu_attr___printf__, 1, 2))) void
+foo2 (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vprintf (fmt, ap);
+ va_end (ap);
+}
+
+void
+vfoo (const char *fmt, va_list arg)
+{
+ vprintf (fmt, arg); /* { dg-warning "candidate" "printf attribute warning 2" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-2.c
new file mode 100644
index 000000000..241b22d2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-2.c
@@ -0,0 +1,16 @@
+/* Test for warnings for missing format attributes. Don't warn if no
+ relevant parameters for a format attribute; see c/1017. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#include "format.h"
+
+void
+foo (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ vprintf ("Foo %s bar %s", ap); /* { dg-bogus "candidate" "bogus printf attribute warning" } */
+ va_end (ap);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-3.c
new file mode 100644
index 000000000..e9cf19d1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-3.c
@@ -0,0 +1,27 @@
+/* Test warnings for missing format attributes on function pointers. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+typedef void (*noattr_t) (const char *, ...);
+typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t;
+
+typedef void (*vnoattr_t) (const char *, va_list);
+typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t;
+
+void
+foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
+{
+ noattr_t na1 = na;
+ noattr_t na2 = a; /* { dg-warning "candidate" "initialization warning" } */
+ attr_t a1 = na;
+ attr_t a2 = a;
+
+ vnoattr_t vna1 = vna;
+ vnoattr_t vna2 = va; /* { dg-warning "candidate" "initialization warning" } */
+ vattr_t va1 = vna;
+ vattr_t va2 = va;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-4.c
new file mode 100644
index 000000000..f6cfd64cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-4.c
@@ -0,0 +1,33 @@
+/* Test warnings for missing format attributes on function pointers. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+typedef void (*noattr_t) (const char *, ...);
+typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t;
+
+typedef void (*vnoattr_t) (const char *, va_list);
+typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t;
+
+void
+foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
+{
+ noattr_t na1, na2;
+ attr_t a1, a2;
+
+ vnoattr_t vna1, vna2;
+ vattr_t va1, va2;
+
+ na1 = na;
+ na2 = a; /* { dg-warning "candidate" "assignment warning" } */
+ a1 = na;
+ a2 = a;
+
+ vna1 = vna;
+ vna2 = va; /* { dg-warning "candidate" "assignment warning" } */
+ va1 = vna;
+ va1 = va;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-5.c
new file mode 100644
index 000000000..1706e369b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-5.c
@@ -0,0 +1,49 @@
+/* Test warnings for missing format attributes on function pointers. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+typedef void (*noattr_t) (const char *, ...);
+typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t;
+
+typedef void (*vnoattr_t) (const char *, va_list);
+typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t;
+
+noattr_t
+foo1 (noattr_t na, attr_t a, int i)
+{
+ if (i)
+ return na;
+ else
+ return a; /* { dg-warning "candidate" "return type warning" } */
+}
+
+attr_t
+foo2 (noattr_t na, attr_t a, int i)
+{
+ if (i)
+ return na;
+ else
+ return a;
+}
+
+vnoattr_t
+foo3 (vnoattr_t vna, vattr_t va, int i)
+{
+ if (i)
+ return vna;
+ else
+ return va; /* { dg-warning "candidate" "return type warning" } */
+}
+
+vattr_t
+foo4 (vnoattr_t vna, vattr_t va, int i)
+{
+ if (i)
+ return vna;
+ else
+ return va;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-6.c
new file mode 100644
index 000000000..77e287465
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/miss-6.c
@@ -0,0 +1,32 @@
+/* Test warnings for missing format attributes on function pointers. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+typedef void (*noattr_t) (const char *, ...);
+typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t;
+
+typedef void (*vnoattr_t) (const char *, va_list);
+typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t;
+
+extern void foo1 (noattr_t);
+extern void foo2 (attr_t);
+extern void foo3 (vnoattr_t);
+extern void foo4 (vattr_t);
+
+void
+foo (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
+{
+ foo1 (na);
+ foo1 (a); /* { dg-warning "candidate" "parameter passing warning" } */
+ foo2 (na);
+ foo2 (a);
+
+ foo3 (vna);
+ foo3 (va); /* { dg-warning "candidate" "parameter passing warning" } */
+ foo4 (vna);
+ foo4 (va);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format1.c
new file mode 100644
index 000000000..e8f739dce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format1.c
@@ -0,0 +1,23 @@
+/* Test for printf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode. But allowed by -Wno-pedantic-ms-format.
+*/
+/* Origin: Kai Tietz <kai.tietz@onevision.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wno-pedantic-ms-format" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+enum en1 { A=0, B=1 };
+typedef enum { _A=0, _B=1 } en2;
+
+void
+foo (int i, long l, long long ll, size_t z, enum en1 e1, en2 e2)
+{
+ printf ("%I32d", i);
+ printf ("%I32d", l);
+ printf ("%I32d", e1);
+ printf ("%I32d", e2);
+ printf ("%I64x", ll);
+ printf ("%Ix", z);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format2.c
new file mode 100644
index 000000000..5c950522a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format2.c
@@ -0,0 +1,23 @@
+/* Test for printf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode. But allowed by -Wno-pedantic-ms-format.
+*/
+/* Origin: Kai Tietz <kai.tietz@onevision.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wno-pedantic-ms-format" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+#ifdef _WIN64
+#define XXX "%I64x"
+#else
+#define XXX "%I32x"
+#endif
+
+void
+foo (float f, double d, void *p)
+{
+ printf (XXX, p); /* { dg-warning "format" "bad argument types" } */
+ printf ("%I32x", f); /* { dg-warning "format" "bad argument types" } */
+ printf ("%I64x", d); /* { dg-warning "format" "bad argument types" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format3.c
new file mode 100644
index 000000000..806ddb60b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-format3.c
@@ -0,0 +1,20 @@
+/* Test for printf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode. But allowed by -Wno-pedantic-ms-format.
+*/
+/* Tests for specific MS types, origin: Ozkan Sezer <sezeroz@gmail.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wno-pedantic-ms-format" } */
+
+#define USE_SYSTEM_FORMATS
+#define WIN32_LEAN_AND_MEAN
+#include "format.h"
+#include <windows.h>
+
+void foo (LONG_PTR l, ULONG_PTR u, DWORD_PTR d, UINT_PTR p, SIZE_T s)
+{
+ printf ("%Id\n", l);
+ printf ("%Iu\n", u);
+ printf ("%Iu\n", d);
+ printf ("%Iu\n", p);
+ printf ("%Iu\n", s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-warnI64-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-warnI64-1.c
new file mode 100644
index 000000000..b5d31d2fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms-warnI64-1.c
@@ -0,0 +1,28 @@
+/* Test for printf formats. Test for ISO C warnings with MS "I64"
+ extension.*/
+
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wno-long-long" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (long long ll, unsigned long long ull, long long *lln,
+ long long *llp, unsigned long long *ullp)
+{
+ printf ("%I64d", ll); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64d" } */
+ printf ("%I64i", ll); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64i" } */
+ printf ("%I64o", ull); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64o" } */
+ printf ("%I64u", ull); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64u" } */
+ printf ("%I64x", ull); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64x" } */
+ printf ("%I64X", ull); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64X" } */
+ printf ("%I64n", lln); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64n" } */
+ scanf ("%I64d", llp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64d" } */
+ scanf ("%I64i", llp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64i" } */
+ scanf ("%I64o", ullp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64o" } */
+ scanf ("%I64u", ullp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64u" } */
+ scanf ("%I64x", ullp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64x" } */
+ scanf ("%I64X", ullp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64X" } */
+ scanf ("%I64n", llp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64n" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_array-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_array-1.c
new file mode 100644
index 000000000..b34506830
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_array-1.c
@@ -0,0 +1,42 @@
+/* Test for format checking of constant arrays. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat=2" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+const char a1[] = "foo";
+const char a2[] = "foo%d";
+const char b1[3] = "foo";
+const char b2[1] = "1";
+static const char c1[] = "foo";
+static const char c2[] = "foo%d";
+char d[] = "foo";
+volatile const char e[] = "foo";
+
+void
+foo (int i, long l)
+{
+ const char p1[] = "bar";
+ const char p2[] = "bar%d";
+ static const char q1[] = "bar";
+ static const char q2[] = "bar%d";
+ printf (a1);
+ printf (a2, i);
+ printf (a2, l); /* { dg-warning "format" "wrong type with array" } */
+ printf (b1); /* { dg-warning "unterminated" "unterminated array" } */
+ printf (b2); /* { dg-warning "unterminated" "unterminated array" } */
+ printf (c1);
+ printf (c2, i);
+ printf (c2, l); /* { dg-warning "format" "wrong type with array" } */
+ printf (p1);
+ printf (p2, i);
+ printf (p2, l); /* { dg-warning "format" "wrong type with array" } */
+ printf (q1);
+ printf (q2, i);
+ printf (q2, l); /* { dg-warning "format" "wrong type with array" } */
+ /* Volatile or non-constant arrays must not be checked. */
+ printf (d); /* { dg-warning "not a string literal" "non-const" } */
+ printf ((const char *)e); /* { dg-warning "not a string literal" "volatile" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-1.c
new file mode 100644
index 000000000..90709bb1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-1.c
@@ -0,0 +1,10 @@
+/* Test for strftime format attributes: can't have first_arg_num != 0. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+extern void foo0 (const char *) __attribute__((__format__(__ms_strftime__, 1, 0)));
+extern void foo1 (const char *, ...) __attribute__((__format__(__ms_strftime__, 1, 2))); /* { dg-error "cannot format" "strftime first_arg_num != 0" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-2.c
new file mode 100644
index 000000000..9a9ce0fe3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-2.c
@@ -0,0 +1,68 @@
+/* Test for format attributes: test use of __attribute__. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+extern void tformatprintf (const char *, ...) __attribute__((format(ms_printf, 1, 2)));
+extern void tformat__printf__ (const char *, ...) __attribute__((format(__ms_printf__, 1, 2)));
+extern void tformatscanf (const char *, ...) __attribute__((format(ms_scanf, 1, 2)));
+extern void tformat__scanf__ (const char *, ...) __attribute__((format(__ms_scanf__, 1, 2)));
+extern void tformatstrftime (const char *) __attribute__((format(ms_strftime, 1, 0)));
+extern void tformat__strftime__ (const char *) __attribute__((format(__ms_strftime__, 1, 0)));
+extern void tformatstrfmon (const char *, ...) __attribute__((format(strfmon, 1, 2)));
+extern void tformat__strfmon__ (const char *, ...) __attribute__((format(__strfmon__, 1, 2)));
+extern void t__format__printf (const char *, ...) __attribute__((__format__(ms_printf, 1, 2)));
+extern void t__format____printf__ (const char *, ...) __attribute__((__format__(__ms_printf__, 1, 2)));
+extern void t__format__scanf (const char *, ...) __attribute__((__format__(ms_scanf, 1, 2)));
+extern void t__format____scanf__ (const char *, ...) __attribute__((__format__(__ms_scanf__, 1, 2)));
+extern void t__format__strftime (const char *) __attribute__((__format__(ms_strftime, 1, 0)));
+extern void t__format____strftime__ (const char *) __attribute__((__format__(__ms_strftime__, 1, 0)));
+extern void t__format__strfmon (const char *, ...) __attribute__((__format__(strfmon, 1, 2)));
+extern void t__format____strfmon__ (const char *, ...) __attribute__((__format__(__strfmon__, 1, 2)));
+
+extern char *tformat_arg (const char *) __attribute__((format_arg(1)));
+extern char *t__format_arg__ (const char *) __attribute__((__format_arg__(1)));
+
+void
+foo (int i, int *ip, double d)
+{
+ tformatprintf ("%d", i);
+ tformatprintf ("%"); /* { dg-warning "format" "attribute format printf" } */
+ tformat__printf__ ("%d", i);
+ tformat__printf__ ("%"); /* { dg-warning "format" "attribute format __printf__" } */
+ tformatscanf ("%d", ip);
+ tformatscanf ("%"); /* { dg-warning "format" "attribute format scanf" } */
+ tformat__scanf__ ("%d", ip);
+ tformat__scanf__ ("%"); /* { dg-warning "format" "attribute format __scanf__" } */
+ tformatstrftime ("%a");
+ tformatstrftime ("%"); /* { dg-warning "format" "attribute format strftime" } */
+ tformat__strftime__ ("%a");
+ tformat__strftime__ ("%"); /* { dg-warning "format" "attribute format __strftime__" } */
+ tformatstrfmon ("%n", d);
+ tformatstrfmon ("%"); /* { dg-warning "format" "attribute format strfmon" } */
+ tformat__strfmon__ ("%n", d);
+ tformat__strfmon__ ("%"); /* { dg-warning "format" "attribute format __strfmon__" } */
+ t__format__printf ("%d", i);
+ t__format__printf ("%"); /* { dg-warning "format" "attribute __format__ printf" } */
+ t__format____printf__ ("%d", i);
+ t__format____printf__ ("%"); /* { dg-warning "format" "attribute __format__ __printf__" } */
+ t__format__scanf ("%d", ip);
+ t__format__scanf ("%"); /* { dg-warning "format" "attribute __format__ scanf" } */
+ t__format____scanf__ ("%d", ip);
+ t__format____scanf__ ("%"); /* { dg-warning "format" "attribute __format__ __scanf__" } */
+ t__format__strftime ("%a");
+ t__format__strftime ("%"); /* { dg-warning "format" "attribute __format__ strftime" } */
+ t__format____strftime__ ("%a");
+ t__format____strftime__ ("%"); /* { dg-warning "format" "attribute __format__ __strftime__" } */
+ t__format__strfmon ("%n", d);
+ t__format__strfmon ("%"); /* { dg-warning "format" "attribute __format__ strfmon" } */
+ t__format____strfmon__ ("%n", d);
+ t__format____strfmon__ ("%"); /* { dg-warning "format" "attribute __format__ __strfmon__" } */
+ tformatprintf (tformat_arg ("%d"), i);
+ tformatprintf (tformat_arg ("%")); /* { dg-warning "format" "attribute format_arg" } */
+ tformatprintf (t__format_arg__ ("%d"), i);
+ tformatprintf (t__format_arg__ ("%")); /* { dg-warning "format" "attribute __format_arg__" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-3.c
new file mode 100644
index 000000000..5341dd816
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-3.c
@@ -0,0 +1,71 @@
+/* Test for format attributes: test bad uses of __attribute__. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+/* Proper uses of the attributes. */
+extern void fa0 (const char *, ...) __attribute__((format(ms_printf, 1, 2)));
+extern void fa1 (char *, ...) __attribute__((format(ms_printf, 1, 2)));
+extern char *fa2 (const char *) __attribute__((format_arg(1)));
+extern char *fa3 (char *) __attribute__((format_arg(1)));
+
+/* Uses with too few or too many arguments. */
+extern void fb0 (const char *, ...) __attribute__((format)); /* { dg-error "wrong number of arguments" "bad format" } */
+extern void fb1 (const char *, ...) __attribute__((format())); /* { dg-error "wrong number of arguments" "bad format" } */
+extern void fb2 (const char *, ...) __attribute__((format(ms_printf))); /* { dg-error "wrong number of arguments" "bad format" } */
+extern void fb3 (const char *, ...) __attribute__((format(ms_printf, 1))); /* { dg-error "wrong number of arguments" "bad format" } */
+extern void fb4 (const char *, ...) __attribute__((format(ms_printf, 1, 2, 3))); /* { dg-error "wrong number of arguments" "bad format" } */
+
+extern void fc1 (const char *) __attribute__((format_arg)); /* { dg-error "wrong number of arguments" "bad format_arg" } */
+extern void fc2 (const char *) __attribute__((format_arg())); /* { dg-error "wrong number of arguments" "bad format_arg" } */
+extern void fc3 (const char *) __attribute__((format_arg(1, 2))); /* { dg-error "wrong number of arguments" "bad format_arg" } */
+
+/* These attributes presently only apply to declarations, not to types.
+ Eventually, they should be usable with declarators for function types
+ anywhere, but still not with structure/union/enum types. */
+struct s0 { int i; } __attribute__((format(ms_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on struct" } */
+union u0 { int i; } __attribute__((format(ms_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on union" } */
+enum e0 { E0V0 } __attribute__((format(ms_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on enum" } */
+
+struct s1 { int i; } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on struct" } */
+union u1 { int i; } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on union" } */
+enum e1 { E1V0 } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on enum" } */
+
+/* The format type must be an identifier, one of those recognized. */
+extern void fe0 (const char *, ...) __attribute__((format(12345, 1, 2))); /* { dg-error "format specifier" "non-id format" } */
+extern void fe1 (const char *, ...) __attribute__((format(nosuch, 1, 2))); /* { dg-warning "format function type" "unknown format" } */
+
+/* Both the numbers must be integer constant expressions. */
+extern void ff0 (const char *, ...) __attribute__((format(ms_printf, 3-2, (long long)(10/5))));
+int foo;
+extern void ff1 (const char *, ...) __attribute__((format(ms_printf, foo, 10/5))); /* { dg-error "invalid operand" "bad number" } */
+extern void ff2 (const char *, ...) __attribute__((format(ms_printf, 3-2, foo))); /* { dg-error "invalid operand" "bad number" } */
+extern char *ff3 (const char *) __attribute__((format_arg(3-2)));
+extern char *ff4 (const char *) __attribute__((format_arg(foo))); /* { dg-error "invalid operand" "bad format_arg number" } */
+
+/* The format string argument must precede the arguments to be formatted.
+ This includes if no parameter types are specified (which is not valid ISO
+ C for variadic functions). */
+extern void fg0 () __attribute__((format(ms_printf, 1, 2)));
+extern void fg1 () __attribute__((format(ms_printf, 1, 0)));
+extern void fg2 () __attribute__((format(ms_printf, 1, 1))); /* { dg-error "follows" "bad number order" } */
+extern void fg3 () __attribute__((format(ms_printf, 2, 1))); /* { dg-error "follows" "bad number order" } */
+
+/* The format string argument must be a string type, and the arguments to
+ be formatted must be the "...". */
+extern void fh0 (int, ...) __attribute__((format(ms_printf, 1, 2))); /* { dg-error "not a string" "format int string" } */
+extern void fh1 (signed char *, ...) __attribute__((format(ms_printf, 1, 2))); /* { dg-error "not a string" "signed char string" } */
+extern void fh2 (unsigned char *, ...) __attribute__((format(ms_printf, 1, 2))); /* { dg-error "not a string" "unsigned char string" } */
+extern void fh3 (const char *, ...) __attribute__((format(ms_printf, 1, 3))); /* { dg-error "is not" "not ..." } */
+extern void fh4 (const char *, int, ...) __attribute__((format(ms_printf, 1, 2))); /* { dg-error "is not" "not ..." } */
+
+/* format_arg formats must take and return a string. */
+extern char *fi0 (int) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg int string" } */
+extern char *fi1 (signed char *) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg signed char string" } */
+extern char *fi2 (unsigned char *) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg unsigned char string" } */
+extern int fi3 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret int string" } */
+extern signed char *fi4 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret signed char string" } */
+extern unsigned char *fi5 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret unsigned char string" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-4.c
new file mode 100644
index 000000000..45f09ef22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-4.c
@@ -0,0 +1,26 @@
+/* Test for format attributes: test use of __attribute__
+ in prefix attributes. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+extern __attribute__((format(ms_printf, 1, 2))) void tformatprintf0 (const char *, ...);
+extern void __attribute__((format(ms_printf, 1, 2))) tformatprintf1 (const char *, ...);
+extern void foo (void), __attribute__((format(ms_printf, 1, 2))) tformatprintf2 (const char *, ...);
+extern __attribute__((noreturn)) void bar (void), __attribute__((format(ms_printf, 1, 2))) tformatprintf3 (const char *, ...);
+
+void
+baz (int i, int *ip, double d)
+{
+ tformatprintf0 ("%d", i);
+ tformatprintf0 ("%"); /* { dg-warning "format" "attribute format printf case 0" } */
+ tformatprintf1 ("%d", i);
+ tformatprintf1 ("%"); /* { dg-warning "format" "attribute format printf case 1" } */
+ tformatprintf2 ("%d", i);
+ tformatprintf2 ("%"); /* { dg-warning "format" "attribute format printf case 2" } */
+ tformatprintf3 ("%d", i);
+ tformatprintf3 ("%"); /* { dg-warning "format" "attribute format printf case 3" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-7.c
new file mode 100644
index 000000000..b169e2c3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_attr-7.c
@@ -0,0 +1,35 @@
+/* Test for format attributes: test applying them to types. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+__attribute__((format(ms_printf, 1, 2))) void (*tformatprintf0) (const char *, ...);
+void (*tformatprintf1) (const char *, ...) __attribute__((format(ms_printf, 1, 2)));
+void (__attribute__((format(ms_printf, 1, 2))) *tformatprintf2) (const char *, ...);
+void (__attribute__((format(ms_printf, 1, 2))) ****tformatprintf3) (const char *, ...);
+
+char * (__attribute__((format_arg(1))) *tformat_arg) (const char *);
+
+void
+baz (int i)
+{
+ (*tformatprintf0) ("%d", i);
+ (*tformatprintf0) ((*tformat_arg) ("%d"), i);
+ (*tformatprintf0) ("%"); /* { dg-warning "format" "prefix" } */
+ (*tformatprintf0) ((*tformat_arg) ("%")); /* { dg-warning "format" "prefix" } */
+ (*tformatprintf1) ("%d", i);
+ (*tformatprintf1) ((*tformat_arg) ("%d"), i);
+ (*tformatprintf1) ("%"); /* { dg-warning "format" "postfix" } */
+ (*tformatprintf1) ((*tformat_arg) ("%")); /* { dg-warning "format" "postfix" } */
+ (*tformatprintf2) ("%d", i);
+ (*tformatprintf2) ((*tformat_arg) ("%d"), i);
+ (*tformatprintf2) ("%"); /* { dg-warning "format" "nested" } */
+ (*tformatprintf2) ((*tformat_arg) ("%")); /* { dg-warning "format" "nested" } */
+ (****tformatprintf3) ("%d", i);
+ (****tformatprintf3) ((*tformat_arg) ("%d"), i);
+ (****tformatprintf3) ("%"); /* { dg-warning "format" "nested 2" } */
+ (****tformatprintf3) ((*tformat_arg) ("%")); /* { dg-warning "format" "nested 2" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_bitfld-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_bitfld-1.c
new file mode 100644
index 000000000..83eb2fec6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_bitfld-1.c
@@ -0,0 +1,52 @@
+/* Test for printf formats and bit-fields: bug 22421. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+/* { dg-require-effective-target int32plus } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+struct s {
+ unsigned int u1 : 1;
+ signed int s1 : 1;
+ unsigned int u15 : 15;
+ signed int s15 : 15;
+ unsigned int u16 : 16;
+ signed int s16 : 16;
+ unsigned long u31 : 31;
+ signed long s31 : 31;
+ unsigned long u32 : 32;
+ signed long s32 : 32;
+ unsigned long long u48 : 48;
+} x;
+
+void
+foo (void)
+{
+ printf ("%d%u", x.u1, x.u1);
+ printf ("%d%u", x.s1, x.s1);
+ printf ("%d%u", x.u15, x.u15);
+ printf ("%d%u", x.s15, x.s15);
+ printf ("%d%u", x.u16, x.u16);
+ printf ("%d%u", x.s16, x.s16);
+#if __INT_MAX__ > 32767
+ /* If integers are 16 bits, there doesn't seem to be a way of
+ printing these without getting an error. */
+ printf ("%d%u", x.u31, x.u31);
+ printf ("%d%u", x.s31, x.s31);
+#endif
+#if __LONG_MAX__ > 2147483647 && __INT_MAX__ >= 2147483647
+ /* If long is wider than 32 bits, the 32-bit bit-fields are int or
+ unsigned int or promote to those types. Otherwise, long is 32
+ bits and the bit-fields are of type plain long or unsigned
+ long. */
+ printf ("%d%u", x.u32, x.u32);
+ printf ("%d%u", x.s32, x.s32);
+#else
+ printf ("%ld%lu", x.u32, x.u32);
+ printf ("%ld%lu", x.s32, x.s32);
+#endif
+ printf ("%I64u", x.u48); /* { dg-warning "has type '.*unsigned int:48'" } */
+ printf ("%I64u", (unsigned long long)x.u48);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_branch-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_branch-1.c
new file mode 100644
index 000000000..fe3f80e57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_branch-1.c
@@ -0,0 +1,28 @@
+/* Test for format checking of conditional expressions. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (long l, int nfoo)
+{
+ printf ((nfoo > 1) ? "%d foos" : "%d foo", nfoo);
+ printf ((l > 1) ? "%d foos" : "%d foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ printf ((l > 1) ? "%ld foos" : "%d foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ printf ((l > 1) ? "%d foos" : "%ld foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ /* Should allow one case to have extra arguments. */
+ printf ((nfoo > 1) ? "%d foos" : "1 foo", nfoo);
+ printf ((nfoo > 1) ? "many foos" : "1 foo", nfoo); /* { dg-warning "too many" "too many args in all branches" } */
+ printf ((nfoo > 1) ? "%d foos" : "", nfoo);
+ printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "1 foo" : "no foos"), nfoo);
+ printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%d foo" : "%d foos"), nfoo);
+ printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%d foo" : "%ld foos"), nfoo); /* { dg-warning "long int" "wrong type" } */
+ printf ((nfoo > 1) ? "%ld foos" : ((nfoo > 0) ? "%d foo" : "%d foos"), nfoo); /* { dg-warning "long int" "wrong type" } */
+ printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%ld foo" : "%d foos"), nfoo); /* { dg-warning "long int" "wrong type" } */
+ /* Extra arguments to NULL should be complained about. */
+ printf (NULL, "foo"); /* { dg-warning "too many" "NULL extra args" } */
+ /* { dg-warning "null" "null format arg" { target *-*-* } 26 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-1.c
new file mode 100644
index 000000000..d2c839f61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-1.c
@@ -0,0 +1,184 @@
+/* Test for printf formats. Formats using C90 features, including cases
+ where C90 specifies some aspect of the format to be ignored or where
+ the behavior is undefined.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p,
+ int *n, short int *hn, long int l, unsigned long int ul,
+ long int *ln, long double ld, wint_t lc, wchar_t *ls, llong ll,
+ ullong ull, unsigned int *un, const int *cn, signed char *ss,
+ unsigned char *us, const signed char *css, unsigned int u1,
+ unsigned int u2)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134). */
+ /* Basic sanity checks for the different components of a format. */
+ printf ("%d\n", i);
+ printf ("%+d\n", i);
+ printf ("%3d\n", i);
+ printf ("%-3d\n", i);
+ printf ("%*d\n", i1, i);
+ printf ("%d %lu\n", i, ul);
+ /* Bogus use of width. */
+ printf ("%5n\n", n); /* { dg-warning "width" "width with %n" } */
+ /* Valid and invalid %% constructions. Some of the warning messages
+ are non-optimal, but they do detect the errorneous nature of the
+ format string.
+ */
+ printf ("%%");
+ printf ("%-%"); /* { dg-warning "format" "bogus %%" } */
+ printf ("%-%\n"); /* { dg-warning "format" "bogus %%" } */
+ printf ("%5%\n"); /* { dg-warning "format" "bogus %%" } */
+ printf ("%h%\n"); /* { dg-warning "format" "bogus %%" } */
+ /* Valid and invalid %h, %l, %L constructions. */
+ printf ("%hd", i);
+ printf ("%hi", i);
+ /* Strictly, these parameters should be int or unsigned int according to
+ what unsigned short promotes to. However, GCC ignores sign
+ differences in format checking here, and this is relied on to get the
+ correct checking without print_char_table needing to know whether
+ int and short are the same size.
+ */
+ printf ("%ho%hu%hx%hX", u, u, u, u);
+ printf ("%hn", hn);
+ printf ("%hf", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%he", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hE", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hg", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hG", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hc", i);
+ printf ("%hs", hn);
+ printf ("%hp", p); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */
+ printf ("%ld%li%lo%lu%lx%lX", l, l, ul, ul, ul, ul);
+ printf ("%ln", ln);
+ printf ("%lf", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%le", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lE", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lg", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lG", d); /* { dg-warning "length|C" "bad use of %l" } */
+ printf ("%lp", p); /* { dg-warning "length|C" "bad use of %l" } */
+ /* These next two were added in C94, but should be objected to in C90.
+ For the first one, GCC has wanted wchar_t instead of the correct C94
+ and C99 wint_t.
+ */
+ printf ("%lc", lc); /* { dg-warning "length|C" "C90 bad use of %l" } */
+ printf ("%ls", ls); /* { dg-warning "length|C" "C90 bad use of %l" } */
+ /* Valid uses of each bare conversion. */
+ printf ("%d%i%o%u%x%X%f%e%E%g%G%c%s%p%n%%", i, i, u, u, u, u, d, d, d, d, d,
+ i, s, p, n);
+ /* Uses of the - flag (valid on all non-%, non-n conversions). */
+ printf ("%-d%-i%-o%-u%-x%-X%-f%-e%-E%-g%-G%-c%-s%-p", i, i, u, u, u, u,
+ d, d, d, d, d, i, s, p);
+ printf ("%-n", n); /* { dg-warning "flag" "bad use of %-n" } */
+ /* Uses of the + flag (valid on signed conversions only). */
+ printf ("%+d%+i%+f%+e%+E%+g%+G\n", i, i, d, d, d, d, d);
+ printf ("%+o", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+u", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+x", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+X", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+c", i); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+s", s); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+p", p); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+n", n); /* { dg-warning "flag" "bad use of + flag" } */
+ /* Uses of the space flag (valid on signed conversions only, and ignored
+ with +).
+ */
+ printf ("% +d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */
+ printf ("%+ d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */
+ printf ("% d% i% f% e% E% g% G\n", i, i, d, d, d, d, d);
+ printf ("% o", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% u", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% x", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% X", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% c", i); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% s", s); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% p", p); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% n", n); /* { dg-warning "flag" "bad use of space flag" } */
+ /* Uses of the # flag. */
+ printf ("%#o%#x%#X%#e%#E%#f%#g%#G", u, u, u, d, d, d, d, d);
+ printf ("%#d", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#i", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#u", u); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#c", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#s", s); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#p", p); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#n", n); /* { dg-warning "flag" "bad use of # flag" } */
+ /* Uses of the 0 flag. */
+ printf ("%08d%08i%08o%08u%08x%08X%08e%08E%08f%08g%08G", i, i, u, u, u, u,
+ d, d, d, d, d);
+ printf ("%0c", i); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0s", s); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0p", p); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0n", n); /* { dg-warning "flag" "bad use of 0 flag" } */
+ /* 0 flag ignored with - flag. */
+ printf ("%-08d", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08i", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08o", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08u", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08x", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08X", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08e", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08E", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08f", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08g", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08G", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ /* Various tests of bad argument types. */
+ printf ("%d", l); /* { dg-warning "format" "bad argument types" } */
+ printf ("%ld", i); /* { dg-warning "format" "bad argument types" } */
+ printf ("%s", n); /* { dg-warning "format" "bad argument types" } */
+ printf ("%p", i); /* { dg-warning "format" "bad argument types" } */
+ printf ("%n", p); /* { dg-warning "format" "bad argument types" } */
+ /* With -pedantic, we want some further checks for pointer targets:
+ %p should allow only pointers to void (possibly qualified) and
+ to character types (possibly qualified), but not function pointers
+ or pointers to other types. (Whether, in fact, character types are
+ allowed here is unclear; see thread on comp.std.c, July 2000 for
+ discussion of the requirements of rules on identical representation,
+ and of the application of the as if rule with the new va_arg
+ allowances in C99 to printf.) Likewise, we should warn if
+ pointer targets differ in signedness, except in some circumstances
+ for character pointers. (In C99 we should consider warning for
+ char * or unsigned char * being passed to %hhn, even if strictly
+ legitimate by the standard.)
+ */
+ printf ("%p", foo); /* { dg-warning "format" "bad argument types" } */
+ printf ("%n", un); /* { dg-warning "format" "bad argument types" } */
+ printf ("%p", n); /* { dg-warning "format" "bad argument types" } */
+ /* Allow character pointers with %p. */
+ printf ("%p%p%p%p", s, ss, us, css);
+ /* %s allows any character type. */
+ printf ("%s%s%s%s", s, ss, us, css);
+ /* Warning for void * arguments for %s is GCC's historical behavior,
+ and seems useful to keep, even if some standard versions might be
+ read to permit it.
+ */
+ printf ("%s", p); /* { dg-warning "format" "bad argument types" } */
+ /* The historical behavior is to allow signed / unsigned types
+ interchangeably as arguments. For values representable in both types,
+ such usage may be correct. For now preserve the behavior of GCC
+ in such cases.
+ */
+ printf ("%d", u);
+ /* Wrong number of arguments. */
+ printf ("%d%d", i); /* { dg-warning "matching" "wrong number of args" } */
+ printf ("%d", i, i); /* { dg-warning "arguments" "wrong number of args" } */
+ /* Miscellaneous bogus constructions. */
+ printf (""); /* { dg-warning "zero-length" "warning for empty format" } */
+ printf ("\0"); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ printf ("%d\0", i); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ printf ("%d\0%d", i, i); /* { dg-warning "embedded|too many" "warning for embedded NUL" } */
+ printf (NULL); /* { dg-warning "null" "null format string warning" } */
+ printf ("%"); /* { dg-warning "trailing" "trailing % warning" } */
+ printf ("%++d", i); /* { dg-warning "repeated" "repeated flag warning" } */
+ printf ("%n", cn); /* { dg-warning "constant" "%n with const" } */
+ printf ((const char *)L"foo"); /* { dg-warning "wide" "wide string" } */
+ printf ("%n", (int *)0); /* { dg-warning "null" "%n with NULL" } */
+ printf ("%s", (char *)0); /* { dg-warning "null" "%s with NULL" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-2.c
new file mode 100644
index 000000000..b53955881
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-2.c
@@ -0,0 +1,25 @@
+/* Test for printf formats. Formats using C99 features should be rejected
+ outside of C99 mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i, double d, llong ll, intmax_t j, size_t z, ptrdiff_t t)
+{
+ /* Some tests already in c90-printf-1.c, e.g. %lf. */
+ /* The widths hh, ll, j, z, t are new. */
+ printf ("%hhd", i); /* { dg-warning "unknown|format" "%hh is unsupported" } */
+ printf ("%I64d", ll); /* { dg-warning "length|C" "%I64 in C90" } */
+ printf ("%jd", j); /* { dg-warning "unknown|format" "%j is unsupported" } */
+ printf ("%zu", z); /* { dg-warning "unknown|format" "%z is unsupported" } */
+ printf ("%td", t); /* { dg-warning "unknown|format" "%t is unsupported" } */
+ /* The formats F, a, A are new. */
+ printf ("%F", d); /* { dg-warning "unknown|format" "%F is unsupported" } */
+ printf ("%a", d); /* { dg-warning "unknown|format" "%a is unsupported" } */
+ printf ("%A", d); /* { dg-warning "unknown|format" "%A is unsupported" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-3.c
new file mode 100644
index 000000000..8e4b19a77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-printf-3.c
@@ -0,0 +1,43 @@
+/* Test for printf formats. Test that the C90 functions get their default
+ attributes in strict C90 mode, but the C99 and gettext functions
+ do not.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i, char *s, size_t n, va_list v0, va_list v1, va_list v2, va_list v3,
+ va_list v4, va_list v5, va_list v6, va_list v7, va_list v8)
+{
+ fprintf (stdout, "%d", i);
+ fprintf (stdout, "%ld", i); /* { dg-warning "format" "fprintf" } */
+ printf ("%d", i);
+ printf ("%ld", i); /* { dg-warning "format" "printf" } */
+ /* The "unlocked" functions shouldn't warn in c90 mode. */
+ fprintf_unlocked (stdout, "%ld", i);
+ printf_unlocked ("%ld", i);
+ sprintf (s, "%d", i);
+ sprintf (s, "%ld", i); /* { dg-warning "format" "sprintf" } */
+ vfprintf (stdout, "%d", v0);
+ vfprintf (stdout, "%Y", v1); /* { dg-warning "format" "vfprintf" } */
+ vprintf ("%d", v2);
+ vprintf ("%Y", v3); /* { dg-warning "format" "vprintf" } */
+ /* The following used to give a bogus warning. */
+ vprintf ("%*.*d", v8); /* { dg-bogus "format" "vprintf" } */
+ vsprintf (s, "%d", v4);
+ vsprintf (s, "%Y", v5); /* { dg-warning "format" "Y is invalid" } */
+ snprintf (s, n, "%d", i);
+ snprintf (s, n, "%ld", i);
+ vsnprintf (s, n, "%d", v6);
+ vsnprintf (s, n, "%Y", v7);
+ printf (gettext ("%d"), i);
+ printf (gettext ("%ld"), i);
+ printf (dgettext ("", "%d"), i);
+ printf (dgettext ("", "%ld"), i);
+ printf (dcgettext ("", "%d", 0), i);
+ printf (dcgettext ("", "%ld", 0), i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-1.c
new file mode 100644
index 000000000..f52ed20ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-1.c
@@ -0,0 +1,119 @@
+/* Test for scanf formats. Formats using C90 features, including cases
+ where C90 specifies some aspect of the format to be ignored or where
+ the behavior is undefined.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp,
+ long int *lp, unsigned long int *ulp, float *fp, double *dp,
+ long double *ldp, char *s, signed char *ss, unsigned char *us,
+ void **pp, int *n, llong *llp, ullong *ullp, wchar_t *ls,
+ const int *cip, const int *cn, const char *cs, const void **ppc,
+ void *const *pcp, short int *hn, long int *ln, void *p, char **sp,
+ volatile void *ppv)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.2 (pages 134-138). */
+ /* Basic sanity checks for the different components of a format. */
+ scanf ("%d", ip);
+ scanf ("%*d");
+ scanf ("%3d", ip);
+ scanf ("%hd", hp);
+ scanf ("%3ld", lp);
+ scanf ("%*3d");
+ scanf ("%d %ld", ip, lp);
+ /* Valid and invalid %% constructions. */
+ scanf ("%%");
+ scanf ("%*%"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%*%\n"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%4%"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%4%\n"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%h%"); /* { dg-warning "format" "bogus %%" } */
+ scanf ("%h%\n"); /* { dg-warning "format" "bogus %%" } */
+ /* Valid, invalid and silly assignment-suppression constructions. */
+ scanf ("%*d%*i%*o%*u%*x%*X%*e%*E%*f%*g%*G%*s%*[abc]%*c%*p");
+ scanf ("%*2d%*8s%*3c");
+ scanf ("%*n", n); /* { dg-warning "suppress" "suppression of %n" } */
+ scanf ("%*hd"); /* { dg-warning "together" "suppression with length" } */
+ /* Valid, invalid and silly width constructions. */
+ scanf ("%2d%3i%4o%5u%6x%7X%8e%9E%10f%11g%12G%13s%14[abc]%15c%16p",
+ ip, ip, uip, uip, uip, uip, fp, fp, fp, fp, fp, s, s, s, pp);
+ scanf ("%0d", ip); /* { dg-warning "width" "warning for zero width" } */
+ scanf ("%3n", n); /* { dg-warning "width" "width with %n" } */
+ /* Valid and invalid %h, %l, %L constructions. */
+ scanf ("%hd%hi%ho%hu%hx%hX%hn", hp, hp, uhp, uhp, uhp, uhp, hn);
+ scanf ("%he", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hE", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hf", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hg", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hG", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hs", hp);
+ scanf ("%h[ac]", s); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hc", hp);
+ scanf ("%hp", pp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */
+ scanf ("%h."); /* { dg-warning "conversion" "bogus %h" } */
+ scanf ("%ld%li%lo%lu%lx%lX%ln", lp, lp, ulp, ulp, ulp, ulp, ln);
+ scanf ("%le%lE%lf%lg%lG", dp, dp, dp, dp, dp);
+ scanf ("%lp", pp); /* { dg-warning "length" "bad use of %l" } */
+ /* These next three formats were added in C94. */
+ scanf ("%ls", ls); /* { dg-warning "length|C" "bad use of %l" } */
+ scanf ("%l[ac]", ls); /* { dg-warning "length|C" "bad use of %l" } */
+ scanf ("%lc", ls); /* { dg-warning "length|C" "bad use of %l" } */
+ scanf ("%Ld", llp); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%Li", llp); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%Lo", ullp); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%Lu", ullp); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%Lx", ullp); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%LX", ullp); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%Ls", s); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%L[ac]", s); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%Lc", s); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%Lp", pp); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ scanf ("%Ln", n); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ /* Valid uses of each bare conversion. */
+ scanf ("%d%i%o%u%x%X%e%E%f%g%G%s%[abc]%c%p%n%%", ip, ip, uip, uip, uip,
+ uip, fp, fp, fp, fp, fp, s, s, s, pp, n);
+ /* Allow other character pointers with %s, %c, %[]. */
+ scanf ("%2s%3s%4c%5c%6[abc]%7[abc]", ss, us, ss, us, ss, us);
+ /* Further tests for %[]. */
+ scanf ("%[%d]%d", s, ip);
+ scanf ("%[^%d]%d", s, ip);
+ scanf ("%[]%d]%d", s, ip);
+ scanf ("%[^]%d]%d", s, ip);
+ scanf ("%[%d]%d", s, ip);
+ scanf ("%[]abcd", s); /* { dg-warning "no closing" "incomplete scanset" } */
+ /* Various tests of bad argument types. Some of these are only pedantic
+ warnings.
+ */
+ scanf ("%d", lp); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%d", uip); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%d", pp); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%p", ppc); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%p", ppv); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%s", n); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%s", p); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%p", p); /* { dg-warning "format" "bad argument types" } */
+ scanf ("%p", sp); /* { dg-warning "format" "bad argument types" } */
+ /* Tests for writing into constant values. */
+ scanf ("%d", cip); /* { dg-warning "constant" "%d writing into const" } */
+ scanf ("%n", cn); /* { dg-warning "constant" "%n writing into const" } */
+ scanf ("%s", cs); /* { dg-warning "constant" "%s writing into const" } */
+ scanf ("%p", pcp); /* { dg-warning "constant" "%p writing into const" } */
+ /* Wrong number of arguments. */
+ scanf ("%d%d", ip); /* { dg-warning "matching" "wrong number of args" } */
+ scanf ("%d", ip, ip); /* { dg-warning "arguments" "wrong number of args" } */
+ /* Miscellaneous bogus constructions. */
+ scanf (""); /* { dg-warning "zero-length" "warning for empty format" } */
+ scanf ("\0"); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ scanf ("%d\0", ip); /* { dg-warning "embedded" "warning for embedded NUL" } */
+ scanf ("%d\0%d", ip, ip); /* { dg-warning "embedded|too many" "warning for embedded NUL" } */
+ scanf (NULL); /* { dg-warning "null" "null format string warning" } */
+ scanf ("%"); /* { dg-warning "trailing" "trailing % warning" } */
+ scanf ("%d", (int *)0); /* { dg-warning "null" "writing into NULL" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-2.c
new file mode 100644
index 000000000..b55122792
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-2.c
@@ -0,0 +1,26 @@
+/* Test for scanf formats. Formats using C99 features should be rejected
+ outside of C99 mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (signed char *hhp, float *fp, llong *llp, intmax_t *jp,
+ size_t *zp, ptrdiff_t *tp)
+{
+ /* Some tests already in c90-scanf-1.c. */
+ /* The widths hh, ll, j, z, t are new. */
+ scanf ("%hhd", hhp); /* { dg-warning "unknown|format" "%hh is unsupported" } */
+ scanf ("%I64d", llp); /* { dg-warning "length|C" "%I64 in C90" } */
+ scanf ("%jd", jp); /* { dg-warning "unknown|format" "%j is unsupported" } */
+ scanf ("%zu", zp); /* { dg-warning "unknown|format" "%z is unsupported" } */
+ scanf ("%td", tp); /* { dg-warning "unknown|format" "%t is unsupported" } */
+ /* The formats F, a, A are new. */
+ scanf ("%F", fp); /* { dg-warning "unknown|format" "%F is unsupported" } */
+ scanf ("%a", fp); /* { dg-warning "unknown|format" "%a is unsupported" } */
+ scanf ("%A", fp); /* { dg-warning "unknown|format" "%A is unsupported" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-3.c
new file mode 100644
index 000000000..b9d3e38bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-3.c
@@ -0,0 +1,20 @@
+/* Test for scanf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp)
+{
+ /* %a formats for allocation, only recognized in C90 mode, are a
+ GNU extension.
+ */
+ scanf ("%as", sp); /* { dg-warning "flag" "%as is unsupported" } */
+ scanf ("%aS", lsp); /* { dg-warning "format|flag" "%aS is unsupported" } */
+ scanf ("%a[bcd]", sp); /* { dg-warning "flag" "%a[] is unsupported" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-4.c
new file mode 100644
index 000000000..4b1fda7ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-4.c
@@ -0,0 +1,31 @@
+/* Test for scanf formats. Test that the C90 functions get their default
+ attributes in strict C90 mode, but the C99 and gettext functions
+ do not.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
+ va_list v4, va_list v5)
+{
+ fscanf (stdin, "%d", ip);
+ fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
+ scanf ("%d", ip);
+ scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
+ sscanf (s, "%d", ip);
+ sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
+ vfscanf (stdin, "%d", v0);
+ vscanf ("%d", v2);
+ vsscanf (s, "%d", v4);
+ scanf (gettext ("%d"), ip);
+ scanf (gettext ("%ld"), ip);
+ scanf (dgettext ("", "%d"), ip);
+ scanf (dgettext ("", "%ld"), ip);
+ scanf (dcgettext ("", "%d", 0), ip);
+ scanf (dcgettext ("", "%ld", 0), ip);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-5.c
new file mode 100644
index 000000000..c714689e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-scanf-5.c
@@ -0,0 +1,20 @@
+/* Test for scanf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp)
+{
+ /* m assignment-allocation modifier, recognized in both C90
+ and C99 modes, is a POSIX and ISO/IEC WDTR 24731-2 extension. */
+ scanf ("%ms", sp); /* { dg-warning "unknown|format" "%ms is unsupported" } */
+ scanf ("%mS", lsp); /* { dg-warning "unknown|format" "%mS is unsupported" } */
+ scanf ("%mls", lsp); /* { dg-warning "unknown|format" "%mls is unsupported" } */
+ scanf ("%m[bcd]", sp); /* { dg-warning "unknown|format" "%m[] is unsupported" } */
+ scanf ("%ml[bcd]", lsp); /* { dg-warning "unknown|format" "%ml[] is unsupported" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-strftime-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-strftime-1.c
new file mode 100644
index 000000000..34143c1b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-strftime-1.c
@@ -0,0 +1,20 @@
+/* Test for strftime formats. Formats using C90 features. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.12.3.5 (pages 174-175). */
+ /* Formats which are Y2K-compliant (no 2-digit years). */
+ strftime (s, m, "%a%A%b%B%d%H%I%j%m%M%p%S%U%w%W%X%Y%Z%%", tp);
+ /* Formats with 2-digit years. */
+ strftime (s, m, "%y", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ /* Formats with 2-digit years in some locales. */
+ strftime (s, m, "%c", tp); /* { dg-warning "some locales" "2-digit year" } */
+ strftime (s, m, "%x", tp); /* { dg-warning "some locales" "2-digit year" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-strftime-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-strftime-2.c
new file mode 100644
index 000000000..446f23533
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c90-strftime-2.c
@@ -0,0 +1,28 @@
+/* Test for strftime formats. Rejection of formats using C99 features in
+ pedantic C90 mode. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ strftime (s, m, "%C", tp); /* { dg-warning "format" "%C is unsupported" } */
+ strftime (s, m, "%D", tp); /* { dg-warning "format" "%D is unsupported" } */
+ strftime (s, m, "%e", tp); /* { dg-warning "format" "%e is unsupported" } */
+ strftime (s, m, "%F", tp); /* { dg-warning "format" "%F is unsupported" } */
+ strftime (s, m, "%g", tp); /* { dg-warning "format" "%g is unsupported" } */
+ strftime (s, m, "%G", tp); /* { dg-warning "format" "%G is unsupported" } */
+ strftime (s, m, "%h", tp); /* { dg-warning "format" "%h is unsupported" } */
+ strftime (s, m, "%n", tp); /* { dg-warning "format" "%n is unsupported" } */
+ strftime (s, m, "%r", tp); /* { dg-warning "format" "%r is unsupported" } */
+ strftime (s, m, "%R", tp); /* { dg-warning "format" "%R is unsupported" } */
+ strftime (s, m, "%t", tp); /* { dg-warning "format" "%t is unsupported" } */
+ strftime (s, m, "%T", tp); /* { dg-warning "format" "%T is unsupported" } */
+ strftime (s, m, "%u", tp); /* { dg-warning "format" "%u is unsupported" } */
+ strftime (s, m, "%V", tp); /* { dg-warning "format" "%V is unsupported" } */
+ strftime (s, m, "%z", tp); /* { dg-warning "C" "%z not in C90" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c94-printf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c94-printf-1.c
new file mode 100644
index 000000000..8a7a12e3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c94-printf-1.c
@@ -0,0 +1,19 @@
+/* Test for printf formats. Changes in C94 to C90. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:199409 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (wint_t lc, wchar_t *ls)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134),
+ as amended by ISO/IEC 9899:1990/Amd.1:1995 (E) (pages 4-5).
+ We do not repeat here all the C90 format checks, but just verify
+ that %ls and %lc are accepted without warning.
+ */
+ printf ("%lc", lc);
+ printf ("%ls", ls);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c94-scanf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c94-scanf-1.c
new file mode 100644
index 000000000..85b300f4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c94-scanf-1.c
@@ -0,0 +1,18 @@
+/* Test for scanf formats. Changes in C94 to C90. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:199409 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (wchar_t *ls)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.2 (pages 134-138),
+ as amended by ISO/IEC 9899:1990/Amd.1:1995 (E) (pages 5-6).
+ We do not repeat here all the C90 format checks, but just verify
+ that %ls, %lc, %l[] are accepted without warning.
+ */
+ scanf ("%lc%ls%l[abc]", ls, ls, ls);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-1.c
new file mode 100644
index 000000000..ad5634ceb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-1.c
@@ -0,0 +1,109 @@
+/* Test for printf formats. Formats using C99 features, including cases
+ where C99 specifies some aspect of the format to be ignored or where
+ the behavior is undefined.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i, unsigned int u, double d, char *s, void *p, int *n,
+ long double ld, wint_t lc, wchar_t *ls, long long int ll,
+ unsigned long long int ull, signed char *ss, unsigned char *us,
+ long long int *lln, intmax_t j, uintmax_t uj, intmax_t *jn,
+ size_t z, signed_size_t sz, signed_size_t *zn,
+ ptrdiff_t t, ptrdiff_t *tn)
+{
+ /* See ISO/IEC 9899:1999 (E) subclause 7.19.6.1 (pages 273-281).
+ We do not repeat here most of the checks for correct C90 formats
+ or completely broken formats.
+ */
+ /* Valid and invalid %h, %hh, %l, %j, %z, %t, %L constructions. */
+ printf ("%hf", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hF", d); /* { dg-warning "unknown|format" "bad use of %hF" } */
+ printf ("%he", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hE", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hg", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%hG", d); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%ha", d); /* { dg-warning "unknown|format" "bad use of %ha" } */
+ printf ("%hA", d); /* { dg-warning "unknown|format" "bad use of %hA" } */
+ printf ("%hc", i);
+ printf ("%hs", (short *)s);
+ printf ("%hp", p); /* { dg-warning "length" "bad use of %h" } */
+ printf ("%lc", lc);
+ printf ("%ls", ls);
+ printf ("%lp", p); /* { dg-warning "length|C" "bad use of %l" } */
+ /* Valid uses of each bare conversion. */
+ printf ("%d%i%o%u%x%X%f%e%E%g%G%c%s%p%n%%", i, i, u, u, u, u,
+ d, d, d, d, d, i, s, p, n);
+ /* Uses of the - flag (valid on all non-%, non-n conversions). */
+ printf ("%-d%-i%-o%-u%-x%-X%-f%-e%-E%-g%-G%-c%-s%-p", i, i,
+ u, u, u, u, d, d, d, d, d, i, s, p);
+ printf ("%-n", n); /* { dg-warning "flag" "bad use of %-n" } */
+ /* Uses of the + flag (valid on signed conversions only). */
+ printf ("%+d%+i%+f%+e%+E%+g%+G\n", i, i, d, d, d, d, d);
+ printf ("%+o", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+u", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+x", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+X", u); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+c", i); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+s", s); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+p", p); /* { dg-warning "flag" "bad use of + flag" } */
+ printf ("%+n", n); /* { dg-warning "flag" "bad use of + flag" } */
+ /* Uses of the space flag (valid on signed conversions only, and ignored
+ with +).
+ */
+ printf ("% +d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */
+ printf ("%+ d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */
+ printf ("% d% i% f% e% E% g% G\n", i, i, d, d, d, d, d);
+ printf ("% o", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% u", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% x", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% X", u); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% c", i); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% s", s); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% p", p); /* { dg-warning "flag" "bad use of space flag" } */
+ printf ("% n", n); /* { dg-warning "flag" "bad use of space flag" } */
+ /* Uses of the # flag. */
+ printf ("%#o%#x%#X%#e%#E%#f%#g%#G", u, u, u, d, d, d,
+ d, d);
+ printf ("%#d", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#i", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#u", u); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#c", i); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#s", s); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#p", p); /* { dg-warning "flag" "bad use of # flag" } */
+ printf ("%#n", n); /* { dg-warning "flag" "bad use of # flag" } */
+ /* Uses of the 0 flag. */
+ printf ("%08d%08i%08o%08u%08x%08X%08e%08E%08f%08g%08G", i, i,
+ u, u, u, u, d, d, d, d, d);
+ printf ("%0c", i); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0s", s); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0p", p); /* { dg-warning "flag" "bad use of 0 flag" } */
+ printf ("%0n", n); /* { dg-warning "flag" "bad use of 0 flag" } */
+ /* 0 flag ignored with - flag. */
+ printf ("%-08d", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08i", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08o", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08u", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08x", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08X", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08e", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08E", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08f", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08F", d); /* { dg-warning "unknown|format" "0 flag ignored with - flag" } */
+ printf ("%-08g", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08G", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */
+ printf ("%-08a", d); /* { dg-warning "unknown|format" "0 flag ignored with - flag" } */
+ printf ("%-08A", d); /* { dg-warning "unknown|format" "0 flag ignored with - flag" } */
+ /* Various tests of bad argument types. Mostly covered in c90-printf-1.c;
+ here just test for pointer target sign with %hhn. (Probably allowed
+ by the standard, but a bad idea, so GCC should diagnose if what
+ is used is not signed char *.)
+ */
+ printf ("%hhn", s); /* { dg-warning "unknown|format" "%hhn is unsupported" } */
+ printf ("%hhn", us); /* { dg-warning "unknown|format" "%hhn is unsupported" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-2.c
new file mode 100644
index 000000000..0a4d3160d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-2.c
@@ -0,0 +1,32 @@
+/* Test for printf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i, long long ll, size_t z, wint_t lc, wchar_t *ls)
+{
+ /* The length modifiers q, Z and L as applied to integer formats are
+ extensions.
+ */
+ printf ("%qd", ll); /* { dg-warning "unknown|format" "%q length is unsupported" } */
+ printf ("%Ld", ll); /* { dg-warning "unknown|format" "%L length is unsupported" } */
+ printf ("%Zd", z); /* { dg-warning "unknown|format" "%Z length is unsupported" } */
+ /* The conversion specifiers C and S are X/Open extensions; the
+ conversion specifier m is a GNU extension.
+ */
+ printf ("%m"); /* { dg-warning "unknown" "printf %m is unsupported" } */
+ printf ("%C", lc); /* { dg-warning "C" "printf %C" } */
+ printf ("%S", ls); /* { dg-warning "C" "printf %S" } */
+ /* The flag character ', and the use of operand number $ formats, are
+ X/Open extensions.
+ */
+ printf ("%'d", i); /* { dg-warning "C" "printf ' flag" } */
+ printf ("%1$d", i); /* { dg-warning "C" "printf $ format" } */
+ printf ("%Ix", z); /* { dg-warning "C" "printf I format" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-3.c
new file mode 100644
index 000000000..d8c51eaa0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-printf-3.c
@@ -0,0 +1,40 @@
+/* Test for printf formats. Test that the C99 functions get their default
+ attributes in strict C99 mode, but the gettext functions do not.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i, char *s, size_t n, va_list v0, va_list v1, va_list v2, va_list v3,
+ va_list v4, va_list v5, va_list v6, va_list v7)
+{
+ fprintf (stdout, "%d", i);
+ fprintf (stdout, "%ld", i); /* { dg-warning "format" "fprintf" } */
+ printf ("%d", i);
+ printf ("%ld", i); /* { dg-warning "format" "printf" } */
+ /* The "unlocked" functions shouldn't warn in c99 mode. */
+ fprintf_unlocked (stdout, "%ld", i);
+ printf_unlocked ("%ld", i);
+ sprintf (s, "%d", i);
+ sprintf (s, "%ld", i); /* { dg-warning "format" "sprintf" } */
+ snprintf (s, n, "%d", i);
+ snprintf (s, n, "%ld", i); /* { dg-warning "format" "snprintf" } */
+ vfprintf (stdout, "%d", v0);
+ vfprintf (stdout, "%Y", v1); /* { dg-warning "format" "vfprintf" } */
+ vprintf ("%d", v0);
+ vprintf ("%Y", v1); /* { dg-warning "format" "vprintf" } */
+ vsprintf (s, "%d", v0);
+ vsprintf (s, "%Y", v1); /* { dg-warning "format" "vsprintf" } */
+ vsnprintf (s, n, "%d", v0);
+ vsnprintf (s, n, "%Y", v1); /* { dg-warning "format" "vsnprintf" } */
+ printf (gettext ("%d"), i);
+ printf (gettext ("%ld"), (long) i);
+ printf (dgettext ("", "%d"), i);
+ printf (dgettext ("", "%ld"), (long) i);
+ printf (dcgettext ("", "%d", 0), i);
+ printf (dcgettext ("", "%ld", 0), (long) i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-1.c
new file mode 100644
index 000000000..f4ac706e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-1.c
@@ -0,0 +1,63 @@
+/* Test for scanf formats. Formats using C99 features, including cases
+ where C99 specifies some aspect of the format to be ignored or where
+ the behavior is undefined.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp,
+ signed char *hhp, unsigned char *uhhp, long int *lp,
+ unsigned long int *ulp, float *fp, double *dp, long double *ldp, char *s,
+ void **pp, int *n, long long *llp, unsigned long long *ullp, wchar_t *ls,
+ short int *hn, signed char *hhn, long int *ln, long long int *lln,
+ intmax_t *jp, uintmax_t *ujp, intmax_t *jn, size_t *zp,
+ signed_size_t *szp, signed_size_t *zn, ptrdiff_t *tp,
+ unsigned_ptrdiff_t *utp, ptrdiff_t *tn)
+{
+ /* See ISO/IEC 9899:1999 (E) subclause 7.19.6.2 (pages 281-288).
+ We do not repeat here most of the checks for correct C90 formats
+ or completely broken formats.
+ */
+ /* Valid, invalid and silly assignment-suppression
+ and width constructions.
+ */
+ scanf ("%*d%*i%*o%*u%*x%*X%*e%*E%*f%*g%*G%*s%*[abc]%*c%*p");
+ scanf ("%*2d%*8s%*3c");
+ scanf ("%*n", n); /* { dg-warning "suppress" "suppression of %n" } */
+ scanf ("%*hd"); /* { dg-warning "together" "suppression with length" } */
+ scanf ("%2d%3i%4o%5u%6x%7X%10e%11E%12f%14g%15G%16s%3[abc]%4c%5p",
+ ip, ip, uip, uip, uip, uip, fp, fp, fp, fp, fp,
+ s, s, s, pp);
+ scanf ("%0d", ip); /* { dg-warning "width" "warning for zero width" } */
+ scanf ("%3n", n); /* { dg-warning "width" "width with %n" } */
+ /* Valid and invalid %h, %hh, %l, %j, %z, %t, %L constructions. */
+ scanf ("%hd%hi%ho%hu%hx%hX%hn", hp, hp, uhp, uhp, uhp, uhp, hn);
+ scanf ("%he", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hE", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hf", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hg", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hG", fp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hs", hp);
+ scanf ("%h[ac]", s); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hc", (short *)s);
+ scanf ("%hp", pp); /* { dg-warning "length" "bad use of %h" } */
+ scanf ("%hhd", hhp); /* { dg-warning "unknown|format" "%hh is unsupported" } */
+ scanf ("%ld%li%lo%lu%lx%lX%ln", lp, lp, ulp, ulp, ulp, ulp, ln);
+ scanf ("%le%lE%lf%lg%lG", dp, dp, dp, dp, dp);
+ scanf ("%lp", pp); /* { dg-warning "length" "bad use of %l" } */
+ scanf ("%ls", ls);
+ scanf ("%l[ac]", ls);
+ scanf ("%lc", ls);
+ scanf ("%jd", jp); /* { dg-warning "unknown|format" "%j not supported" } */
+ scanf ("%zd", zp); /* { dg-warning "unknown|format" "%z not supported" } */
+ scanf ("%td", tp); /* { dg-warning "unknown|format" "%t not supported" } */
+ scanf ("%Lf", llp); /* { dg-warning "unknown|format" "bad use of %L is not supported" } */
+ /* Valid uses of each bare conversion. */
+ scanf ("%d%i%o%u%x%X%e%E%f%g%G%s%[abc]%c%p%n%%", ip, ip, uip, uip, uip,
+ uip, fp, fp, fp, fp, fp, s, s, s, pp, n);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-2.c
new file mode 100644
index 000000000..e16f5bfc3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-2.c
@@ -0,0 +1,27 @@
+/* Test for scanf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int *ip, long long int *llp, wchar_t *ls)
+{
+ /* The length modifiers q and L as applied to integer formats are
+ extensions.
+ */
+ scanf ("%qd", llp); /* { dg-warning "unknown|format" "%q is unsupported" } */
+ scanf ("%Ld", llp); /* { dg-warning "unknown|format" "%L is unsupported" } */
+ /* The conversion specifiers C and S are X/Open extensions. */
+ scanf ("%C", ls); /* { dg-warning "C" "scanf %C" } */
+ scanf ("%S", ls); /* { dg-warning "C" "scanf %S" } */
+ /* The use of operand number $ formats is an X/Open extension. */
+ scanf ("%1$d", ip); /* { dg-warning "C" "scanf $ format" } */
+ /* glibc also supports flags ' and I on scanf formats as an extension. */
+ scanf ("%'d", ip); /* { dg-warning "C" "scanf ' flag" } */
+ scanf ("%Id", (ssize_t *)ip); /* { dg-warning "C" "scanf I flag" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-3.c
new file mode 100644
index 000000000..cde2f3703
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-3.c
@@ -0,0 +1,33 @@
+/* Test for scanf formats. Test that the C99 functions get their default
+ attributes in strict C99 mode, but the gettext functions do not.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3,
+ va_list v4, va_list v5)
+{
+ fscanf (stdin, "%d", ip);
+ fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */
+ scanf ("%d", ip);
+ scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */
+ sscanf (s, "%d", ip);
+ sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */
+ vfscanf (stdin, "%d", v0);
+ vfscanf (stdin, "%Y", v1); /* { dg-warning "format" "vfscanf" } */
+ vscanf ("%d", v2);
+ vscanf ("%Y", v3); /* { dg-warning "format" "vscanf" } */
+ vsscanf (s, "%d", v4);
+ vsscanf (s, "%Y", v5); /* { dg-warning "format" "vsscanf" } */
+ scanf (gettext ("%d"), ip);
+ scanf (gettext ("%ld"), ip);
+ scanf (dgettext ("", "%d"), ip);
+ scanf (dgettext ("", "%ld"), ip);
+ scanf (dcgettext ("", "%d", 0), ip);
+ scanf (dcgettext ("", "%ld", 0), ip);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-4.c
new file mode 100644
index 000000000..bddc11dd1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-scanf-4.c
@@ -0,0 +1,20 @@
+/* Test for scanf formats. Formats using extensions to the standard
+ should be rejected in strict pedantic mode.
+*/
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char **sp, wchar_t **lsp)
+{
+ /* m assignment-allocation modifier, recognized in both C90
+ and C99 modes, is a POSIX and ISO/IEC WDTR 24731-2 extension. */
+ scanf ("%ms", sp); /* { dg-warning "unknown|format" "%ms is unsupported" } */
+ scanf ("%mS", lsp); /* { dg-warning "unknown|format" "%mS is unsupported" } */
+ scanf ("%mls", lsp); /* { dg-warning "unknown|format" "%mls is unsupported" } */
+ scanf ("%m[bcd]", sp); /* { dg-warning "unknown|format" "%m[] is unsupported" } */
+ scanf ("%ml[bcd]", lsp); /* { dg-warning "unknown|format" "%ml[] is unsupported" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-strftime-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-strftime-1.c
new file mode 100644
index 000000000..743972efa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-strftime-1.c
@@ -0,0 +1,20 @@
+/* Test for strftime formats. Formats using C99 features. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wformat-y2k" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.12.3.5 (pages 174-175). */
+ /* Formats which are Y2K-compliant (no 2-digit years). */
+ strftime (s, m, "%a%A%b%B%d%H%I%j%m%M%p%S%U%w%W%X%Y%z%Z%%", tp);
+ /* Formats with 2-digit years. */
+ strftime (s, m, "%y", tp); /* { dg-warning "only last 2" "2-digit year" } */
+ /* Formats with 2-digit years in some locales. */
+ strftime (s, m, "%c", tp); /* { dg-warning "some locales" "2-digit year" } */
+ strftime (s, m, "%x", tp); /* { dg-warning "some locales" "2-digit year" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-strftime-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-strftime-2.c
new file mode 100644
index 000000000..9a6ae3545
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_c99-strftime-2.c
@@ -0,0 +1,20 @@
+/* Test for strftime formats. Rejection of extensions in pedantic mode. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ /* %P is a lowercase version of %p. */
+ strftime (s, m, "%P", tp); /* { dg-warning "unknown" "strftime %P" } */
+ /* %k is %H but padded with a space rather than 0 if necessary. */
+ strftime (s, m, "%k", tp); /* { dg-warning "unknown" "strftime %k" } */
+ /* %l is %I but padded with a space rather than 0 if necessary. */
+ strftime (s, m, "%l", tp); /* { dg-warning "unknown" "strftime %l" } */
+ /* %s is the number of seconds since the Epoch. */
+ strftime (s, m, "%s", tp); /* { dg-warning "unknown" "strftime %s" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_cast-1.c
new file mode 100644
index 000000000..08659616e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_cast-1.c
@@ -0,0 +1,17 @@
+/* Test for strings cast through integer types: should not be treated
+ as format strings unless the types are of the same width as
+ pointers (intptr_t or similar). */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+f (int x)
+{
+ printf("%s", x); /* { dg-warning "format" } */
+ printf((char *)(size_t)"%s", x); /* { dg-warning "format" } */
+ printf((char *)(char)"%s", x); /* { dg-warning "cast from pointer to integer of different size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-1.c
new file mode 100644
index 000000000..b6c71c04f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-1.c
@@ -0,0 +1,40 @@
+/* Test for warnings for missing format attributes. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vprintf (fmt, ap); /* { dg-warning "candidate" "printf attribute warning" } */
+ va_end (ap);
+}
+
+void
+bar (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" } */
+ va_end (ap);
+}
+
+__attribute__((__format__(__ms_printf__, 1, 2))) void
+foo2 (const char *fmt, ...)
+{
+ va_list ap;
+ va_start (ap, fmt);
+ vprintf (fmt, ap);
+ va_end (ap);
+}
+
+void
+vfoo (const char *fmt, va_list arg)
+{
+ vprintf (fmt, arg); /* { dg-warning "candidate" "printf attribute warning 2" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-2.c
new file mode 100644
index 000000000..e0dd465f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-2.c
@@ -0,0 +1,17 @@
+/* Test for warnings for missing format attributes. Don't warn if no
+ relevant parameters for a format attribute; see c/1017. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ vprintf ("Foo %s bar %s", ap); /* { dg-bogus "candidate" "bogus printf attribute warning" } */
+ va_end (ap);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-3.c
new file mode 100644
index 000000000..cf41756c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-3.c
@@ -0,0 +1,27 @@
+/* Test warnings for missing format attributes on function pointers. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+typedef void (*noattr_t) (const char *, ...);
+typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t;
+
+typedef void (*vnoattr_t) (const char *, va_list);
+typedef vnoattr_t __attribute__ ((__format__(__ms_printf__, 1, 0))) vattr_t;
+
+void
+foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
+{
+ noattr_t na1 = na;
+ noattr_t na2 = a; /* { dg-warning "candidate" "initialization warning" } */
+ attr_t a1 = na;
+ attr_t a2 = a;
+
+ vnoattr_t vna1 = vna;
+ vnoattr_t vna2 = va; /* { dg-warning "candidate" "initialization warning" } */
+ vattr_t va1 = vna;
+ vattr_t va2 = va;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-4.c
new file mode 100644
index 000000000..faacf5ce4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-4.c
@@ -0,0 +1,33 @@
+/* Test warnings for missing format attributes on function pointers. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+typedef void (*noattr_t) (const char *, ...);
+typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t;
+
+typedef void (*vnoattr_t) (const char *, va_list);
+typedef vnoattr_t __attribute__ ((__format__(__ms_printf__, 1, 0))) vattr_t;
+
+void
+foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
+{
+ noattr_t na1, na2;
+ attr_t a1, a2;
+
+ vnoattr_t vna1, vna2;
+ vattr_t va1, va2;
+
+ na1 = na;
+ na2 = a; /* { dg-warning "candidate" "assignment warning" } */
+ a1 = na;
+ a2 = a;
+
+ vna1 = vna;
+ vna2 = va; /* { dg-warning "candidate" "assignment warning" } */
+ va1 = vna;
+ va1 = va;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-5.c
new file mode 100644
index 000000000..a9f54c3a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-5.c
@@ -0,0 +1,49 @@
+/* Test warnings for missing format attributes on function pointers. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+typedef void (*noattr_t) (const char *, ...);
+typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t;
+
+typedef void (*vnoattr_t) (const char *, va_list);
+typedef vnoattr_t __attribute__ ((__format__(__ms_printf__, 1, 0))) vattr_t;
+
+noattr_t
+foo1 (noattr_t na, attr_t a, int i)
+{
+ if (i)
+ return na;
+ else
+ return a; /* { dg-warning "candidate" "return type warning" } */
+}
+
+attr_t
+foo2 (noattr_t na, attr_t a, int i)
+{
+ if (i)
+ return na;
+ else
+ return a;
+}
+
+vnoattr_t
+foo3 (vnoattr_t vna, vattr_t va, int i)
+{
+ if (i)
+ return vna;
+ else
+ return va; /* { dg-warning "candidate" "return type warning" } */
+}
+
+vattr_t
+foo4 (vnoattr_t vna, vattr_t va, int i)
+{
+ if (i)
+ return vna;
+ else
+ return va;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-6.c
new file mode 100644
index 000000000..3e210deee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_miss-6.c
@@ -0,0 +1,32 @@
+/* Test warnings for missing format attributes on function pointers. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+typedef void (*noattr_t) (const char *, ...);
+typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t;
+
+typedef void (*vnoattr_t) (const char *, va_list);
+typedef vnoattr_t __attribute__ ((__format__(__ms_printf__, 1, 0))) vattr_t;
+
+extern void foo1 (noattr_t);
+extern void foo2 (attr_t);
+extern void foo3 (vnoattr_t);
+extern void foo4 (vattr_t);
+
+void
+foo (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va)
+{
+ foo1 (na);
+ foo1 (a); /* { dg-warning "candidate" "parameter passing warning" } */
+ foo2 (na);
+ foo2 (a);
+
+ foo3 (vna);
+ foo3 (va); /* { dg-warning "candidate" "parameter passing warning" } */
+ foo4 (vna);
+ foo4 (va);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-1.c
new file mode 100644
index 000000000..0936f5f6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-1.c
@@ -0,0 +1,51 @@
+/* Test for multiple format attributes. Test for printf and scanf attributes
+ together. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+/* If we specify multiple attributes for a single function, they should
+ all apply. This should apply whether they are on the same declaration
+ or on different declarations. */
+
+extern void my_vprintf_scanf (const char *, va_list, const char *, ...)
+ __attribute__((__format__(__ms_printf__, 1, 0)))
+ __attribute__((__format__(__ms_scanf__, 3, 4)));
+
+extern void my_vprintf_scanf2 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(__ms_scanf__, 3, 4)))
+ __attribute__((__format__(__ms_printf__, 1, 0)));
+
+extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(__ms_printf__, 1, 0)));
+extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(__ms_scanf__, 3, 4)));
+
+extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(__ms_scanf__, 3, 4)));
+extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(__ms_printf__, 1, 0)));
+
+void
+foo (va_list ap, int *ip, long *lp)
+{
+ my_vprintf_scanf ("%d", ap, "%d", ip);
+ my_vprintf_scanf ("%d", ap, "%ld", lp);
+ my_vprintf_scanf ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf2 ("%d", ap, "%d", ip);
+ my_vprintf_scanf2 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf2 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf2 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf3 ("%d", ap, "%d", ip);
+ my_vprintf_scanf3 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf3 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf3 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf4 ("%d", ap, "%d", ip);
+ my_vprintf_scanf4 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf4 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf4 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-2.c
new file mode 100644
index 000000000..47e20e4d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-2.c
@@ -0,0 +1,40 @@
+/* Test for multiple format attributes. Test for printf and scanf attributes
+ together, in different places on the declarations. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+/* If we specify multiple attributes for a single function, they should
+ all apply, wherever they are placed on the declarations. */
+
+extern __attribute__((__format__(__ms_printf__, 1, 0))) void
+ my_vprintf_scanf (const char *, va_list, const char *, ...)
+ __attribute__((__format__(__ms_scanf__, 3, 4)));
+
+extern void (__attribute__((__format__(__ms_printf__, 1, 0))) my_vprintf_scanf2)
+ (const char *, va_list, const char *, ...)
+ __attribute__((__format__(__ms_scanf__, 3, 4)));
+
+extern __attribute__((__format__(__ms_scanf__, 3, 4))) void
+ (__attribute__((__format__(__ms_printf__, 1, 0))) my_vprintf_scanf3)
+ (const char *, va_list, const char *, ...);
+
+void
+foo (va_list ap, int *ip, long *lp)
+{
+ my_vprintf_scanf ("%d", ap, "%d", ip);
+ my_vprintf_scanf ("%d", ap, "%ld", lp);
+ my_vprintf_scanf ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf2 ("%d", ap, "%d", ip);
+ my_vprintf_scanf2 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf2 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf2 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf3 ("%d", ap, "%d", ip);
+ my_vprintf_scanf3 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf3 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf3 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-3.c
new file mode 100644
index 000000000..1a247a7a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_multattr-3.c
@@ -0,0 +1,29 @@
+/* Test for multiple format_arg attributes. Test for both branches
+ getting checked. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+extern char *ngettext (const char *, const char *, unsigned long int)
+ __attribute__((__format_arg__(1))) __attribute__((__format_arg__(2)));
+
+void
+foo (long l, int nfoo)
+{
+ printf (ngettext ("%d foo", "%d foos", nfoo), nfoo);
+ printf (ngettext ("%d foo", "%d foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ printf (ngettext ("%d foo", "%ld foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ printf (ngettext ("%ld foo", "%d foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ /* Should allow one case to have extra arguments. */
+ printf (ngettext ("1 foo", "%d foos", nfoo), nfoo);
+ printf (ngettext ("1 foo", "many foos", nfoo), nfoo); /* { dg-warning "too many" "too many args in all branches" } */
+ printf (ngettext ("", "%d foos", nfoo), nfoo);
+ printf (ngettext ("1 foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo);
+ printf (ngettext ("%d foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo);
+ printf (ngettext ("%ld foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */
+ printf (ngettext ("%d foo", (nfoo > 0) ? "%ld foos" : "no foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */
+ printf (ngettext ("%d foo", (nfoo > 0) ? "%d foos" : "%ld foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-exargs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-exargs-1.c
new file mode 100644
index 000000000..659ca3e0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-exargs-1.c
@@ -0,0 +1,15 @@
+/* Test for warnings for extra format arguments being disabled by
+ -Wno-format-extra-args. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat -Wno-format-extra-args" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i)
+{
+ printf ("foo", i);
+ printf ("%1$d", i, i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-exargs-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-exargs-2.c
new file mode 100644
index 000000000..654241ddf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-exargs-2.c
@@ -0,0 +1,28 @@
+/* Test for warnings for extra format arguments being disabled by
+ -Wno-format-extra-args. Test which warnings still apply with $
+ operand numbers. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat -Wno-format-extra-args" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i, int *ip, va_list va)
+{
+ printf ("%3$d%1$d", i, i, i); /* { dg-warning "before used" "unused $ operand" } */
+ printf ("%2$d%1$d", i, i, i);
+ vprintf ("%3$d%1$d", va); /* { dg-warning "before used" "unused $ operand" } */
+ /* With scanf formats, gaps in the used arguments are allowed only if the
+ arguments are all pointers. In such a case, should only give the lesser
+ warning about unused arguments rather than the more serious one about
+ argument gaps. */
+ scanf ("%3$d%1$d", ip, ip, ip);
+ /* If there are non-pointer arguments unused at the end, this is also OK. */
+ scanf ("%3$d%1$d", ip, ip, ip, i);
+ scanf ("%3$d%1$d", ip, i, ip); /* { dg-warning "before used" "unused $ scanf non-pointer operand" } */
+ /* Can't check the arguments in the vscanf case, so should suppose the
+ lesser problem. */
+ vscanf ("%3$d%1$d", va);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-y2k-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-y2k-1.c
new file mode 100644
index 000000000..aed760aab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_no-y2k-1.c
@@ -0,0 +1,13 @@
+/* Test for warnings for Y2K problems not being on by default. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ strftime (s, m, "%y%c%x", tp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-1.c
new file mode 100644
index 000000000..b29c0080e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-1.c
@@ -0,0 +1,14 @@
+/* Test for warnings for non-string-literal formats. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-nonliteral" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s, size_t i)
+{
+ printf ((const char *)i, i); /* { dg-warning "argument types" "non-literal" } */
+ printf (s, i); /* { dg-warning "argument types" "non-literal" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-2.c
new file mode 100644
index 000000000..e60242187
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-2.c
@@ -0,0 +1,14 @@
+/* Test for warnings for non-string-literal formats. Test with -Wformat=2. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat=2" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s, size_t i)
+{
+ printf ((const char *)i, i); /* { dg-warning "argument types" "non-literal" } */
+ printf (s, i); /* { dg-warning "argument types" "non-literal" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-3.c
new file mode 100644
index 000000000..e8c8933bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nonlit-3.c
@@ -0,0 +1,13 @@
+/* Test for warnings for non-string-literal formats. Test for strftime formats. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-nonliteral" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp, char *fmt)
+{
+ strftime (s, m, fmt, tp); /* { dg-warning "format string" "non-literal" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nul-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nul-1.c
new file mode 100644
index 000000000..50bfd546d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nul-1.c
@@ -0,0 +1,15 @@
+/* Test diagnostics for suppressing contains nul
+ -Wformat. -Wformat. */
+/* Origin: Bruce Korb <bkorb@gnu.org> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-Wformat -Wno-format-contains-nul" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (void)
+{
+ static char const fmt[] = "x%s\0%s\n\0abc";
+ printf (fmt+4, fmt+8); /* { dg-bogus "embedded.*in format" "bogus embed warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nul-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nul-2.c
new file mode 100644
index 000000000..3dfc3c62f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_nul-2.c
@@ -0,0 +1,17 @@
+/* Test diagnostics for options used on their own without
+ -Wformat. -Wformat-. */
+/* Origin: Bruce Korb <bkorb@gnu.org> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-Wformat" } */
+
+/* { dg-warning "embedded .* in format" "ignored" { target *-*-* } 0 } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+fumble (void)
+{
+ static char const fmt[] = "x%s\0%s\n\0abc";
+ printf (fmt+4, fmt+8);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_null-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_null-1.c
new file mode 100644
index 000000000..91495016e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_null-1.c
@@ -0,0 +1,28 @@
+/* Test for some aspects of null format string handling. */
+/* Origin: Jason Thorpe <thorpej@wasabisystems.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+extern void my_printf (const char *, ...) __attribute__((format(ms_printf,1,2)));
+extern const char *my_format (const char *, const char *)
+ __attribute__((format_arg(2)));
+
+void
+foo (int i1)
+{
+ /* Warning about a null format string has been decoupled from the actual
+ format check. However, we still expect to be warned about any excess
+ arguments after a null format string. */
+ my_printf (NULL);
+ my_printf (NULL, i1); /* { dg-warning "too many" "null format with arguments" } */
+
+ my_printf (my_format ("", NULL));
+ my_printf (my_format ("", NULL), i1); /* { dg-warning "too many" "null format_arg with arguments" } */
+
+ /* While my_printf allows a null argument, dgettext does not, so we expect
+ a null argument warning here. */
+ my_printf (dgettext ("", NULL)); /* { dg-warning "null" "null format with dgettext" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_plus-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_plus-1.c
new file mode 100644
index 000000000..f6eba280a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_plus-1.c
@@ -0,0 +1,21 @@
+/* Test for printf formats using string literal plus constant.
+ */
+/* Origin: Jakub Jelinek <jakub@redhat.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat=2" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (int i)
+{
+ printf ("%%d\n" + 1, i);
+ printf (5 + "%.-*d%3d\n", i);
+ printf ("%d%d" + 2, i, i); /* { dg-warning "arguments" "wrong number of args" } */
+ printf (3 + "%d\n"); /* { dg-warning "zero-length" "zero-length string" } */
+ printf ("%d\n" + i, i); /* { dg-warning "not a string" "non-constant addend" } */
+ printf ("%d\n" + 10); /* { dg-warning "not a string" "too large addend" } */
+ printf ("%d\n" - 1, i); /* { dg-warning "not a string" "minus constant" } */
+ printf ("%d\n" + -1, i); /* { dg-warning "not a string" "negative addend" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_sec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_sec-1.c
new file mode 100644
index 000000000..5f6b76726
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_sec-1.c
@@ -0,0 +1,13 @@
+/* Test for security warning when non-literal format has no arguments. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-security" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (char *s)
+{
+ printf (s); /* { dg-warning "no format arguments" "security warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c
new file mode 100644
index 000000000..ac1294282
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c
@@ -0,0 +1,25 @@
+/* Test for warnings with possibly unnamed integer types. Bug 24329. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-Wformat" } */
+/* { dg-options "-Wformat -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+/* Definition of TItype follows same logic as in gcc.dg/titype-1.c,
+ but must be a #define to avoid giving the type a name. */
+#if (defined(__LP64__) && !defined(__hppa__)) || defined(__SPU__)
+#define TItype int __attribute__ ((mode (TI)))
+#else
+#define TItype long
+#endif
+
+void
+f (TItype x)
+{
+ printf("%d", x); /* { dg-warning "expects argument" } */
+ printf("%d", 141592653589793238462643383279502884197169399375105820974944); /* { dg-warning "expects argument" } */
+ /* { dg-warning "unsigned only|too large" "constant" { target *-*-* } 23 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_va-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_va-1.c
new file mode 100644
index 000000000..97d2979e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_va-1.c
@@ -0,0 +1,14 @@
+/* Test for strange warning in format checking. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-Wformat" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (void *p)
+{
+ printf ("%d", p); /* { dg-bogus "va_list" "wrong type in format warning" } */
+ /* { dg-warning "format" "format error" { target *-*-* } 12 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_zero-length-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_zero-length-1.c
new file mode 100644
index 000000000..d024458a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/ms_zero-length-1.c
@@ -0,0 +1,16 @@
+/* Test the -Wno-format-zero-length option, which suppresses warnings
+ about zero-length formats. */
+/* Origin: Jason Thorpe <thorpej@wasabisystems.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wno-format-zero-length" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (void)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134). */
+ /* Zero-length format strings are allowed. */
+ printf ("");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-1.c
new file mode 100644
index 000000000..c7404bedf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-1.c
@@ -0,0 +1,51 @@
+/* Test for multiple format attributes. Test for printf and scanf attributes
+ together. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+/* If we specify multiple attributes for a single function, they should
+ all apply. This should apply whether they are on the same declaration
+ or on different declarations. */
+
+extern void my_vprintf_scanf (const char *, va_list, const char *, ...)
+ __attribute__((__format__(gnu_attr___printf__, 1, 0)))
+ __attribute__((__format__(gnu_attr___scanf__, 3, 4)));
+
+extern void my_vprintf_scanf2 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(gnu_attr___scanf__, 3, 4)))
+ __attribute__((__format__(gnu_attr___printf__, 1, 0)));
+
+extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(gnu_attr___printf__, 1, 0)));
+extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(gnu_attr___scanf__, 3, 4)));
+
+extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(gnu_attr___scanf__, 3, 4)));
+extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...)
+ __attribute__((__format__(gnu_attr___printf__, 1, 0)));
+
+void
+foo (va_list ap, int *ip, long *lp)
+{
+ my_vprintf_scanf ("%d", ap, "%d", ip);
+ my_vprintf_scanf ("%d", ap, "%ld", lp);
+ my_vprintf_scanf ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf2 ("%d", ap, "%d", ip);
+ my_vprintf_scanf2 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf2 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf2 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf3 ("%d", ap, "%d", ip);
+ my_vprintf_scanf3 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf3 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf3 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf4 ("%d", ap, "%d", ip);
+ my_vprintf_scanf4 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf4 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf4 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-2.c
new file mode 100644
index 000000000..4011bf145
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-2.c
@@ -0,0 +1,40 @@
+/* Test for multiple format attributes. Test for printf and scanf attributes
+ together, in different places on the declarations. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+/* If we specify multiple attributes for a single function, they should
+ all apply, wherever they are placed on the declarations. */
+
+extern __attribute__((__format__(gnu_attr___printf__, 1, 0))) void
+ my_vprintf_scanf (const char *, va_list, const char *, ...)
+ __attribute__((__format__(gnu_attr___scanf__, 3, 4)));
+
+extern void (__attribute__((__format__(gnu_attr___printf__, 1, 0))) my_vprintf_scanf2)
+ (const char *, va_list, const char *, ...)
+ __attribute__((__format__(gnu_attr___scanf__, 3, 4)));
+
+extern __attribute__((__format__(gnu_attr___scanf__, 3, 4))) void
+ (__attribute__((__format__(gnu_attr___printf__, 1, 0))) my_vprintf_scanf3)
+ (const char *, va_list, const char *, ...);
+
+void
+foo (va_list ap, int *ip, long *lp)
+{
+ my_vprintf_scanf ("%d", ap, "%d", ip);
+ my_vprintf_scanf ("%d", ap, "%ld", lp);
+ my_vprintf_scanf ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf2 ("%d", ap, "%d", ip);
+ my_vprintf_scanf2 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf2 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf2 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+ my_vprintf_scanf3 ("%d", ap, "%d", ip);
+ my_vprintf_scanf3 ("%d", ap, "%ld", lp);
+ my_vprintf_scanf3 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */
+ my_vprintf_scanf3 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-3.c
new file mode 100644
index 000000000..1d4979a4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/multattr-3.c
@@ -0,0 +1,28 @@
+/* Test for multiple format_arg attributes. Test for both branches
+ getting checked. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+extern char *ngettext (const char *, const char *, unsigned long int)
+ __attribute__((__format_arg__(1))) __attribute__((__format_arg__(2)));
+
+void
+foo (long l, int nfoo)
+{
+ printf (ngettext ("%d foo", "%d foos", nfoo), nfoo);
+ printf (ngettext ("%d foo", "%d foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ printf (ngettext ("%d foo", "%ld foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ printf (ngettext ("%ld foo", "%d foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */
+ /* Should allow one case to have extra arguments. */
+ printf (ngettext ("1 foo", "%d foos", nfoo), nfoo);
+ printf (ngettext ("1 foo", "many foos", nfoo), nfoo); /* { dg-warning "too many" "too many args in all branches" } */
+ printf (ngettext ("", "%d foos", nfoo), nfoo);
+ printf (ngettext ("1 foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo);
+ printf (ngettext ("%d foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo);
+ printf (ngettext ("%ld foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */
+ printf (ngettext ("%d foo", (nfoo > 0) ? "%ld foos" : "no foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */
+ printf (ngettext ("%d foo", (nfoo > 0) ? "%d foos" : "%ld foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/no-exargs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/no-exargs-1.c
new file mode 100644
index 000000000..75247087f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/no-exargs-1.c
@@ -0,0 +1,14 @@
+/* Test for warnings for extra format arguments being disabled by
+ -Wno-format-extra-args. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat -Wno-format-extra-args" } */
+
+#include "format.h"
+
+void
+foo (int i)
+{
+ printf ("foo", i);
+ printf ("%1$d", i, i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/no-exargs-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/no-exargs-2.c
new file mode 100644
index 000000000..3fa928578
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/no-exargs-2.c
@@ -0,0 +1,27 @@
+/* Test for warnings for extra format arguments being disabled by
+ -Wno-format-extra-args. Test which warnings still apply with $
+ operand numbers. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat -Wno-format-extra-args" } */
+
+#include "format.h"
+
+void
+foo (int i, int *ip, va_list va)
+{
+ printf ("%3$d%1$d", i, i, i); /* { dg-warning "before used" "unused $ operand" } */
+ printf ("%2$d%1$d", i, i, i);
+ vprintf ("%3$d%1$d", va); /* { dg-warning "before used" "unused $ operand" } */
+ /* With scanf formats, gaps in the used arguments are allowed only if the
+ arguments are all pointers. In such a case, should only give the lesser
+ warning about unused arguments rather than the more serious one about
+ argument gaps. */
+ scanf ("%3$d%1$d", ip, ip, ip);
+ /* If there are non-pointer arguments unused at the end, this is also OK. */
+ scanf ("%3$d%1$d", ip, ip, ip, i);
+ scanf ("%3$d%1$d", ip, i, ip); /* { dg-warning "before used" "unused $ scanf non-pointer operand" } */
+ /* Can't check the arguments in the vscanf case, so should suppose the
+ lesser problem. */
+ vscanf ("%3$d%1$d", va);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/no-y2k-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/no-y2k-1.c
new file mode 100644
index 000000000..4dfd5a04e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/no-y2k-1.c
@@ -0,0 +1,12 @@
+/* Test for warnings for Y2K problems not being on by default. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp)
+{
+ strftime (s, m, "%y%c%x", tp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-1.c
new file mode 100644
index 000000000..af0cd3723
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-1.c
@@ -0,0 +1,13 @@
+/* Test for warnings for non-string-literal formats. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-nonliteral" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t i)
+{
+ printf ((const char *)i, i); /* { dg-warning "argument types" "non-literal" } */
+ printf (s, i); /* { dg-warning "argument types" "non-literal" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-2.c
new file mode 100644
index 000000000..2ca2e4803
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-2.c
@@ -0,0 +1,13 @@
+/* Test for warnings for non-string-literal formats. Test with -Wformat=2. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat=2" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t i)
+{
+ printf ((const char *)i, i); /* { dg-warning "argument types" "non-literal" } */
+ printf (s, i); /* { dg-warning "argument types" "non-literal" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-3.c
new file mode 100644
index 000000000..ce94c8c36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/nonlit-3.c
@@ -0,0 +1,12 @@
+/* Test for warnings for non-string-literal formats. Test for strftime formats. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-nonliteral" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m, const struct tm *tp, char *fmt)
+{
+ strftime (s, m, fmt, tp); /* { dg-warning "format string" "non-literal" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/nul-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/nul-1.c
new file mode 100644
index 000000000..c45453dba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/nul-1.c
@@ -0,0 +1,14 @@
+/* Test diagnostics for suppressing contains nul
+ -Wformat. -Wformat. */
+/* Origin: Bruce Korb <bkorb@gnu.org> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat -Wno-format-contains-nul" } */
+
+#include "format.h"
+
+void
+foo (void)
+{
+ static char const fmt[] = "x%s\0%s\n\0abc";
+ printf (fmt+4, fmt+8); /* { dg-bogus "embedded.*in format" "bogus embed warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/nul-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/nul-2.c
new file mode 100644
index 000000000..4c9159658
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/nul-2.c
@@ -0,0 +1,16 @@
+/* Test diagnostics for options used on their own without
+ -Wformat. -Wformat-. */
+/* Origin: Bruce Korb <bkorb@gnu.org> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+/* { dg-warning "embedded .* in format" "ignored" { target *-*-* } 0 } */
+
+#include "format.h"
+
+void
+fumble (void)
+{
+ static char const fmt[] = "x%s\0%s\n\0abc";
+ printf (fmt+4, fmt+8);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/null-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/null-1.c
new file mode 100644
index 000000000..ed714442b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/null-1.c
@@ -0,0 +1,28 @@
+/* Test for some aspects of null format string handling. */
+/* Origin: Jason Thorpe <thorpej@wasabisystems.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#define DONT_GNU_PROTOTYPE
+#include "format.h"
+
+extern void my_printf (const char *, ...) __attribute__((format(gnu_attr_printf,1,2)));
+extern const char *my_format (const char *, const char *)
+ __attribute__((format_arg(2)));
+
+void
+foo (int i1)
+{
+ /* Warning about a null format string has been decoupled from the actual
+ format check. However, we still expect to be warned about any excess
+ arguments after a null format string. */
+ my_printf (NULL);
+ my_printf (NULL, i1); /* { dg-warning "too many" "null format with arguments" } */
+
+ my_printf (my_format ("", NULL));
+ my_printf (my_format ("", NULL), i1); /* { dg-warning "too many" "null format_arg with arguments" } */
+
+ /* While my_printf allows a null argument, dgettext does not, so we expect
+ a null argument warning here. */
+ my_printf (dgettext ("", NULL)); /* { dg-warning "null" "null format with dgettext" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-1.c
new file mode 100644
index 000000000..f8f370448
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-1.c
@@ -0,0 +1,7 @@
+/* Test diagnostics for options used on their own without
+ -Wformat. -Wformat-extra-args. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat-extra-args" } */
+
+/* { dg-warning "-Wformat-extra-args ignored without -Wformat" "ignored" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-2.c
new file mode 100644
index 000000000..1ec9f0141
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-2.c
@@ -0,0 +1,7 @@
+/* Test diagnostics for options used on their own without
+ -Wformat. -Wformat-nonliteral. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat-nonliteral" } */
+
+/* { dg-warning "-Wformat-nonliteral ignored without -Wformat" "ignored" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-3.c
new file mode 100644
index 000000000..03f55e436
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-3.c
@@ -0,0 +1,7 @@
+/* Test diagnostics for options used on their own without
+ -Wformat. -Wformat-security. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat-security" } */
+
+/* { dg-warning "-Wformat-security ignored without -Wformat" "ignored" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-4.c
new file mode 100644
index 000000000..f02b6c094
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-4.c
@@ -0,0 +1,7 @@
+/* Test diagnostics for options used on their own without
+ -Wformat. -Wformat-y2k. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat-y2k" } */
+
+/* { dg-warning "-Wformat-y2k ignored without -Wformat" "ignored" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-5.c
new file mode 100644
index 000000000..3315e3358
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-5.c
@@ -0,0 +1,7 @@
+/* Test diagnostics for options used on their own without
+ -Wformat. -Wformat-zero-length. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat-zero-length" } */
+
+/* { dg-warning "-Wformat-zero-length ignored without -Wformat" "ignored" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-6.c
new file mode 100644
index 000000000..29dedfae5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/opt-6.c
@@ -0,0 +1,7 @@
+/* Test diagnostics for options used on their own without
+ -Wformat. -Wformat-contains-nul. */
+/* Origin: Bruce Korb <bkorb@gnu.org> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat-contains-nul" } */
+
+/* { dg-warning "-Wformat-contains-nul ignored without -Wformat" "ignored" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/plus-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/plus-1.c
new file mode 100644
index 000000000..02a213d41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/plus-1.c
@@ -0,0 +1,20 @@
+/* Test for printf formats using string literal plus constant.
+ */
+/* Origin: Jakub Jelinek <jakub@redhat.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat=2" } */
+
+#include "format.h"
+
+void
+foo (int i)
+{
+ printf ("%%d\n" + 1, i);
+ printf (5 + "%.-*d%3d\n", i);
+ printf ("%d%d" + 2, i, i); /* { dg-warning "arguments" "wrong number of args" } */
+ printf (3 + "%d\n"); /* { dg-warning "zero-length" "zero-length string" } */
+ printf ("%d\n" + i, i); /* { dg-warning "not a string" "non-constant addend" } */
+ printf ("%d\n" + 10); /* { dg-warning "not a string" "too large addend" } */
+ printf ("%d\n" - 1, i); /* { dg-warning "not a string" "minus constant" } */
+ printf ("%d\n" + -1, i); /* { dg-warning "not a string" "negative addend" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/sec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/sec-1.c
new file mode 100644
index 000000000..9189b51e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/sec-1.c
@@ -0,0 +1,12 @@
+/* Test for security warning when non-literal format has no arguments. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-security" } */
+
+#include "format.h"
+
+void
+foo (char *s)
+{
+ printf (s); /* { dg-warning "no format arguments" "security warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/sentinel-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/sentinel-1.c
new file mode 100644
index 000000000..0c8a2ac77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/sentinel-1.c
@@ -0,0 +1,73 @@
+/* Test for attribute sentinel. */
+/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include <stddef.h> /* For NULL, which must be (ptr)0. */
+
+extern int execl (const char *, const char *, ...);
+extern int execlp (const char *, const char *, ...);
+extern int execle (const char *, const char *, ...);
+extern char *envp[];
+
+#define ATTR __attribute__ ((__sentinel__))
+
+extern int a ATTR; /* { dg-warning "applies to function types" "sentinel" } */
+
+extern void foo1 (const char *, ...) ATTR; /* { dg-message "note: declared here" } */
+extern void foo2 (...) ATTR; /* { dg-error "ISO C requires|named arguments" "sentinel" } */
+extern void foo3 () ATTR; /* { dg-warning "named arguments" "sentinel" } */
+extern void foo4 (const char *, int) ATTR; /* { dg-warning "variadic functions" "sentinel" } */
+extern void foo5 (const char *, ...) __attribute__ ((__sentinel__(1)));
+extern void foo6 (const char *, ...) __attribute__ ((__sentinel__(5)));
+extern void foo7 (const char *, ...) __attribute__ ((__sentinel__(0)));
+extern void foo8 (const char *, ...) __attribute__ ((__sentinel__("a"))); /* { dg-warning "not an integer constant" "sentinel" } */
+extern void foo9 (const char *, ...) __attribute__ ((__sentinel__(-1))); /* { dg-warning "less than zero" "sentinel" } */
+extern void foo10 (const char *, ...) __attribute__ ((__sentinel__(1,3))); /* { dg-error "wrong number of arguments" "sentinel" } */
+
+extern void bar(void)
+{
+ foo1 (); /* { dg-error "not enough|too few arguments" "sentinel" } */
+ foo1 (NULL); /* { dg-warning "not enough" "sentinel" } */
+ foo1 ("a"); /* { dg-warning "not enough" "sentinel" } */
+ foo1 ("a", 1); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo1 ("a", 0); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo1 ("a", (void*)1); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo1 ("a", NULL, 1); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo1 ("a", NULL);
+
+ foo5 (NULL); /* { dg-warning "not enough" "sentinel" } */
+ foo5 (NULL, 1); /* { dg-warning "not enough" "sentinel" } */
+ foo5 ("a", NULL); /* { dg-warning "not enough" "sentinel" } */
+ foo5 ("a", NULL, 1);
+ foo5 ("a", 1, 2, 3, NULL); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo5 ("a", 1, 2, NULL, 3);
+ foo5 ("a", 1, NULL, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo5 ("a", NULL, 1, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo5 ("a", 0, 1, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */
+
+ foo6 ("a", 1, NULL); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", 1, NULL, 2); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", 1, NULL, 2, 3); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", NULL, 1, 2, 3); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", NULL, 1, 2, 3, 4); /* { dg-warning "not enough" "sentinel" } */
+ foo6 (NULL, 1, 2, 3, 4, 5); /* { dg-warning "not enough" "sentinel" } */
+ foo6 ("a", NULL, 1, 2, 3, 4, 5);
+ foo6 ("a", 0, NULL, 1, 2, 3, 4, 5);
+ foo6 ("a", 0, 1, 2, 3, 4, 5); /* { dg-warning "missing sentinel" "sentinel" } */
+ foo6 ("a", NULL, 1, 2, 3, 4, 5, 6); /* { dg-warning "missing sentinel" "sentinel" } */
+
+ foo7 ("a", 1, 2, 3, NULL);
+
+ execl ("/bin/ls", "/bin/ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */
+ execl ("/bin/ls", "/bin/ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */
+ execl ("/bin/ls", "/bin/ls", "-aFC", NULL);
+
+ execlp ("ls", "ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */
+ execlp ("ls", "ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */
+ execlp ("ls", "ls", "-aFC", NULL);
+
+ execle ("ls", "ls", "-aFC", ".", envp); /* { dg-warning "missing sentinel" "sentinel" } */
+ execle ("ls", "ls", "-aFC", ".", 0, envp); /* { dg-warning "missing sentinel" "sentinel" } */
+ execle ("ls", "ls", "-aFC", ".", NULL, envp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/strfmon-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/strfmon-1.c
new file mode 100644
index 000000000..934242a23
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/strfmon-1.c
@@ -0,0 +1,63 @@
+/* Test for strfmon format checking. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m, double d, long double ld)
+{
+ /* Examples of valid formats from Austin Group draft 7. */
+ strfmon (s, m, "%n", d);
+ strfmon (s, m, "%11n", d);
+ strfmon (s, m, "%#5n", d);
+ strfmon (s, m, "%=*#5n", d);
+ strfmon (s, m, "%=0#5n", d);
+ strfmon (s, m, "%^#5n", d);
+ strfmon (s, m, "%^#5.0n", d);
+ strfmon (s, m, "%^#5.4n", d);
+ strfmon (s, m, "%(#5n", d);
+ strfmon (s, m, "%!(#5n", d);
+ strfmon (s, m, "%-14#5.4n", d);
+ strfmon (s, m, "%14#5.4n", d);
+ /* Some more valid formats, including the GNU L length extension. */
+ strfmon (s, m, "abc%-11ndef%==i%%", d, d);
+ strfmon (s, m, "%%abc%-11ndef%==Li%=%i", d, ld, d);
+ strfmon (s, m, "%Li", ld);
+ strfmon (s, m, "%11Li", ld);
+ strfmon (s, m, "%#5Li", ld);
+ strfmon (s, m, "%=*#5Li", ld);
+ strfmon (s, m, "%=0#5Li", ld);
+ strfmon (s, m, "%^#5Li", ld);
+ strfmon (s, m, "%^#5.0Li", ld);
+ strfmon (s, m, "%^#5.4Li", ld);
+ strfmon (s, m, "%(#5Li", ld);
+ strfmon (s, m, "%!(#5Li", ld);
+ strfmon (s, m, "%-14#5.4Li", ld);
+ strfmon (s, m, "%14#5.4Li", ld);
+ /* Formats with the wrong types used. */
+ strfmon (s, m, "%Ln", d); /* { dg-warning "format" "wrong type" } */
+ strfmon (s, m, "%n", ld); /* { dg-warning "format" "wrong type" } */
+ /* The + and ( flags cannot be used together. */
+ strfmon (s, m, "%+(i", d); /* { dg-warning "flag" "+ and ( flags" } */
+ strfmon (s, m, "%(+i", d); /* { dg-warning "flag" "+ and ( flags" } */
+ /* Although empty precision is OK for printf, it isn't here. */
+ strfmon (s, m, "%#.5n", d); /* { dg-warning "empty" "empty left precision" } */
+ strfmon (s, m, "%#5.n", d); /* { dg-warning "empty" "empty right precision" } */
+ /* However, zero is a valid value for width and precisions. */
+ strfmon (s, m, "%0#0.0n", d);
+ /* Test bogus %% constructions. */
+ strfmon (s, m, "%^%"); /* { dg-warning "format" "bogus %%" } */
+ strfmon (s, m, "%!%\n"); /* { dg-warning "format" "bogus %%" } */
+ strfmon (s, m, "%5%\n"); /* { dg-warning "format" "bogus %%" } */
+ strfmon (s, m, "%.5%\n"); /* { dg-warning "format" "bogus %%" } */
+ strfmon (s, m, "%#5%\n"); /* { dg-warning "format" "bogus %%" } */
+ /* Miscellaneous bogus formats. */
+ strfmon (s, m, "%n%n", d); /* { dg-warning "matching" "too few args" } */
+ strfmon (s, m, ""); /* { dg-warning "zero-length" "empty" } */
+ strfmon (s, m, NULL); /* { dg-warning "null" "null format string" } */
+ strfmon (s, m, "%"); /* { dg-warning "trailing" "tailing %" } */
+ strfmon (s, m, "%n\0", d); /* { dg-warning "embedded" "embedded NUL" } */
+ strfmon (s, m, "%^^n", d); /* { dg-warning "repeated" "repeated flag" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/strfmon-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/strfmon-2.c
new file mode 100644
index 000000000..1ecef711d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/strfmon-2.c
@@ -0,0 +1,13 @@
+/* Test for strfmon format checking. Test for missing fill character
+ at end of format. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (char *s, size_t m)
+{
+ strfmon (s, m, "%="); /* { dg-warning "missing fill character at end" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/sys_format.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/sys_format.c
new file mode 100755
index 000000000..b69ae5bc5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/sys_format.c
@@ -0,0 +1,14 @@
+/* Test system default printf formatter specifiers. */
+/* Origin: Kai Tietz <KaiTietz.@onevision.com> */
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=gnu89" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+__attribute__((format(printf, 1, 2))) void foo (const char *, ...);
+
+void bar (long long v1, long v2, int v3)
+{
+ foo ("%I64d %I32d %ld %d\n", v1, v2, v2, v3);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/unnamed-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/unnamed-1.c
new file mode 100644
index 000000000..e54b06f36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/unnamed-1.c
@@ -0,0 +1,25 @@
+/* Test for warnings with possibly unnamed integer types. Bug 24329. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+/* { dg-options "-Wformat -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+
+#include "format.h"
+
+/* Definition of TItype follows same logic as in gcc.dg/titype-1.c,
+ but must be a #define to avoid giving the type a name. */
+#if (defined(__LP64__) && !defined(__hppa__)) || defined(__SPU__)
+#define TItype int __attribute__ ((mode (TI)))
+#else
+#define TItype long
+#endif
+
+void
+f (TItype x)
+{
+ printf("%d", x); /* { dg-warning "expects argument" } */
+ printf("%d", 141592653589793238462643383279502884197169399375105820974944); /* { dg-warning "expects argument" } */
+ /* { dg-warning "unsigned only|too large" "constant" { target *-*-* } 23 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/va-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/va-1.c
new file mode 100644
index 000000000..5f5eeab4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/va-1.c
@@ -0,0 +1,13 @@
+/* Test for strange warning in format checking. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+void
+foo (void *p)
+{
+ printf ("%d", p); /* { dg-bogus "va_list" "wrong type in format warning" } */
+ /* { dg-warning "format" "format error" { target *-*-* } 11 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/warnll-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/warnll-1.c
new file mode 100644
index 000000000..2d2277693
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/warnll-1.c
@@ -0,0 +1,45 @@
+/* Test for printf formats. C99 "long long" formats should be accepted with
+ -Wno-long-long.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wno-long-long" } */
+
+#include "format.h"
+
+void
+foo (long long ll, unsigned long long ull, long long *lln,
+ long long *llp, unsigned long long *ullp)
+{
+ /* Test for accepting standard "long long" formats. */
+ printf ("%lld%lli%llo%llu%llx%llX%lln", ll, ll, ull, ull, ull, ull, lln);
+ scanf ("%lld%lli%llo%llu%llx%llX%lln", llp, llp,
+ ullp, ullp, ullp, ullp, lln);
+ /* Use of "q" and "L" should still be warned about. */
+ printf ("%qd", ll); /* { dg-warning "C" "printf %qd" } */
+ printf ("%qi", ll); /* { dg-warning "C" "printf %qi" } */
+ printf ("%qo", ull); /* { dg-warning "C" "printf %qo" } */
+ printf ("%qu", ull); /* { dg-warning "C" "printf %qu" } */
+ printf ("%qx", ull); /* { dg-warning "C" "printf %qx" } */
+ printf ("%qX", ull); /* { dg-warning "C" "printf %qX" } */
+ printf ("%qn", lln); /* { dg-warning "C" "printf %qn" } */
+ printf ("%Ld", ll); /* { dg-warning "C" "printf %Ld" } */
+ printf ("%Li", ll); /* { dg-warning "C" "printf %Li" } */
+ printf ("%Lo", ull); /* { dg-warning "C" "printf %oL" } */
+ printf ("%Lu", ull); /* { dg-warning "C" "printf %Lu" } */
+ printf ("%Lx", ull); /* { dg-warning "C" "printf %Lx" } */
+ printf ("%LX", ull); /* { dg-warning "C" "printf %LX" } */
+ scanf ("%qd", llp); /* { dg-warning "C" "scanf %qd" } */
+ scanf ("%qi", llp); /* { dg-warning "C" "scanf %qi" } */
+ scanf ("%qo", ullp); /* { dg-warning "C" "scanf %qo" } */
+ scanf ("%qu", ullp); /* { dg-warning "C" "scanf %qu" } */
+ scanf ("%qx", ullp); /* { dg-warning "C" "scanf %qx" } */
+ scanf ("%qX", ullp); /* { dg-warning "C" "scanf %qX" } */
+ scanf ("%qn", lln); /* { dg-warning "C" "scanf %qn" } */
+ scanf ("%Ld", llp); /* { dg-warning "C" "scanf %Ld" } */
+ scanf ("%Li", llp); /* { dg-warning "C" "scanf %Li" } */
+ scanf ("%Lo", ullp); /* { dg-warning "C" "scanf %oL" } */
+ scanf ("%Lu", ullp); /* { dg-warning "C" "scanf %Lu" } */
+ scanf ("%Lx", ullp); /* { dg-warning "C" "scanf %Lx" } */
+ scanf ("%LX", ullp); /* { dg-warning "C" "scanf %LX" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-1.c
new file mode 100644
index 000000000..9b098fb1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-1.c
@@ -0,0 +1,125 @@
+/* Test for X/Open format extensions, as found in the
+ Single Unix Specification and in Austin Group draft 7.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i, unsigned int u, wint_t lc, wchar_t *ls, int *ip, double d,
+ char *s, void *p, int *n, long int l, int i2, float *fp, long int *lp,
+ va_list va)
+{
+ /* The conversion specifiers C and S, for both printf and scanf,
+ are X/Open extensions.
+ */
+ printf ("%C", lc);
+ printf ("%3C", lc);
+ printf ("%.3C", lc); /* { dg-warning "precision" "precision with %C" } */
+ printf ("%hC", lc); /* { dg-warning "length" "bad %hC" } */
+ printf ("%hhC", lc); /* { dg-warning "length" "bad %hhC" } */
+ printf ("%lC", lc); /* { dg-warning "length" "bad %lC" } */
+ printf ("%llC", lc); /* { dg-warning "length" "bad %llC" } */
+ printf ("%jC", lc); /* { dg-warning "length" "bad %jC" } */
+ printf ("%zC", lc); /* { dg-warning "length" "bad %zC" } */
+ printf ("%tC", lc); /* { dg-warning "length" "bad %tC" } */
+ printf ("%LC", lc); /* { dg-warning "length" "bad %LC" } */
+ printf ("%-C", lc);
+ printf ("%+C", lc); /* { dg-warning "flag" "bad %+C" } */
+ printf ("% C", lc); /* { dg-warning "flag" "bad % C" } */
+ printf ("%#C", lc); /* { dg-warning "flag" "bad %#C" } */
+ printf ("%0C", lc); /* { dg-warning "flag" "bad %0C" } */
+ printf ("%'C", lc); /* { dg-warning "flag" "bad %'C" } */
+ printf ("%S", ls);
+ printf ("%3S", ls);
+ printf ("%.3S", ls);
+ printf ("%hS", ls); /* { dg-warning "length" "bad %hS" } */
+ printf ("%hhS", ls); /* { dg-warning "length" "bad %hhS" } */
+ printf ("%lS", ls); /* { dg-warning "length" "bad %lS" } */
+ printf ("%llS", ls); /* { dg-warning "length" "bad %llS" } */
+ printf ("%jS", ls); /* { dg-warning "length" "bad %jS" } */
+ printf ("%zS", ls); /* { dg-warning "length" "bad %zS" } */
+ printf ("%tS", ls); /* { dg-warning "length" "bad %tS" } */
+ printf ("%LS", ls); /* { dg-warning "length" "bad %LS" } */
+ printf ("%-S", ls);
+ printf ("%+S", ls); /* { dg-warning "flag" "bad %+S" } */
+ printf ("% S", ls); /* { dg-warning "flag" "bad % S" } */
+ printf ("%#S", ls); /* { dg-warning "flag" "bad %#S" } */
+ printf ("%0S", ls); /* { dg-warning "flag" "bad %0S" } */
+ printf ("%'S", ls); /* { dg-warning "flag" "bad %'S" } */
+ scanf ("%C", ls);
+ scanf ("%S", ls);
+ scanf ("%*C%*S");
+ scanf ("%2C%3S", ls, ls);
+ scanf ("%hC", ls); /* { dg-warning "length" "bad %hC" } */
+ scanf ("%hhC", ls); /* { dg-warning "length" "bad %hhC" } */
+ scanf ("%lC", ls); /* { dg-warning "length" "bad %lC" } */
+ scanf ("%llC", ls); /* { dg-warning "length" "bad %llC" } */
+ scanf ("%jC", ls); /* { dg-warning "length" "bad %jC" } */
+ scanf ("%zC", ls); /* { dg-warning "length" "bad %zC" } */
+ scanf ("%tC", ls); /* { dg-warning "length" "bad %tC" } */
+ scanf ("%LC", ls); /* { dg-warning "length" "bad %LC" } */
+ scanf ("%hS", ls); /* { dg-warning "length" "bad %hS" } */
+ scanf ("%hhS", ls); /* { dg-warning "length" "bad %hhS" } */
+ scanf ("%lS", ls); /* { dg-warning "length" "bad %lS" } */
+ scanf ("%llS", ls); /* { dg-warning "length" "bad %llS" } */
+ scanf ("%jS", ls); /* { dg-warning "length" "bad %jS" } */
+ scanf ("%zS", ls); /* { dg-warning "length" "bad %zS" } */
+ scanf ("%tS", ls); /* { dg-warning "length" "bad %tS" } */
+ scanf ("%LS", ls); /* { dg-warning "length" "bad %LS" } */
+ /* In C99 mode (even with extensions), %aS is a floating point
+ format followed by an S.
+ */
+ scanf ("%aS", fp);
+ /* The printf flag character ' is an X/Open extension. */
+ printf ("%'d%'i%'u%'f%'F%'g%'G", i, i, u, d, d, d, d);
+ printf ("%'o", u); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'x", u); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'X", u); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'e", d); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'E", d); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'a", d); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'A", d); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'c", i); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'s", s); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'p", p); /* { dg-warning "flag" "bad use of ' flag" } */
+ printf ("%'n", n); /* { dg-warning "flag" "bad use of ' flag" } */
+ /* The use of operand number $ formats is an X/Open extension. */
+ scanf ("%1$d", ip);
+ printf ("%1$d", i);
+ printf ("%1$d", l); /* { dg-warning "arg 2|argument 2" "mismatched args with $ format" } */
+ printf ("%3$*2$.*1$ld", i2, i, l);
+ printf ("%4$ld%7$ld%5$d%6$d%3$d%1$d%2$d", i, i, i, l, i, i, l);
+ scanf ("%4$ld%7$ld%5$d%6$d%3$d%1$d%2$d", ip, ip, ip, lp, ip, ip, lp);
+ printf ("%1$d%d", i, i); /* { dg-warning "missing" "mixing $ and non-$ formats" } */
+ printf ("%%%1$d%%%2$d", i, i);
+ printf ("%d%2$d", i); /* { dg-warning "used after format" "mixing $ and non-$ formats" } */
+ printf ("%1$*d", i, i); /* { dg-warning "missing" "mixing $ and non-$ formats" } */
+ printf ("%*1$d", i); /* { dg-warning "missing" "mixing $ and non-$ formats" } */
+ scanf ("%1$d%d", ip, ip); /* { dg-warning "missing" "mixing $ and non-$ formats" } */
+ scanf ("%*f%%%1$d%%%2$d", ip, ip);
+ printf ("%2$d", i); /* { dg-warning "operand" "$ number too large" } */
+ printf ("%0$d", i); /* { dg-warning "operand" "$ number too small" } */
+ printf ("%3$d%1$d", i, i, i); /* { dg-warning "before used" "unused $ operand" } */
+ printf ("%2$d%1$d", i, i, i); /* { dg-warning "unused" "unused $ operand" } */
+ vprintf ("%3$d%1$d", va); /* { dg-warning "before used" "unused $ operand" } */
+ /* With scanf formats, gaps in the used arguments are allowed only if the
+ arguments are all pointers. In such a case, should only give the lesser
+ warning about unused arguments rather than the more serious one about
+ argument gaps. */
+ scanf ("%3$d%1$d", ip, ip, ip); /* { dg-bogus "before used" "unused $ scanf pointer operand" } */
+ /* { dg-warning "unused" "unused $ scanf pointer operand" { target *-*-* } 112 } */
+ /* If there are non-pointer arguments unused at the end, this is also OK. */
+ scanf ("%3$d%1$d", ip, ip, ip, i); /* { dg-bogus "before used" "unused $ scanf pointer operand" } */
+ /* { dg-warning "unused" "unused $ scanf pointer operand" { target *-*-* } 115 } */
+ scanf ("%3$d%1$d", ip, i, ip); /* { dg-warning "before used" "unused $ scanf non-pointer operand" } */
+ /* Can't check the arguments in the vscanf case, so should suppose the
+ lesser problem. */
+ vscanf ("%3$d%1$d", va); /* { dg-bogus "before used" "unused $ scanf pointer operand" } */
+ /* { dg-warning "unused" "unused $ scanf pointer operand" { target *-*-* } 120 } */
+ scanf ("%2$*d%1$d", ip, ip); /* { dg-warning "operand" "operand number with suppression" } */
+ printf ("%1$d%1$d", i);
+ scanf ("%1$d%1$d", ip); /* { dg-warning "more than once" "multiple use of scanf argument" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-2.c
new file mode 100644
index 000000000..4aee191ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-2.c
@@ -0,0 +1,21 @@
+/* Test for X/Open format extensions, as found in the
+ Single Unix Specification. Test for bug reported by
+ Pierre-Canalsat PETIT <pierrecanalsat.petit.canalsat@canal-plus.com>
+ in PR c/6547. The test for absence of a parameter for a * width was done
+ too early in the case of operand numbers and vprintf formats.
+*/
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void vbar (va_list, const char *) __attribute__((__format__(__printf__, 2, 0)));
+
+void
+foo (int i, int j, va_list va)
+{
+ printf("%2$*1$c", i, j);
+ printf("%2$*1$c %2$*1$c", i, j); /* { dg-bogus "matching" "bogus too few dollar" } */
+ vbar(va, "%*s"); /* { dg-bogus "matching" "bogus too few vprintf" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-3.c
new file mode 100644
index 000000000..5f78d77c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/xopen-3.c
@@ -0,0 +1,15 @@
+/* Test for warnings for $ operand numbers after ordinary formats.
+ Bug c/15444 from james-gcc-bugzilla-501qll3d at and dot org. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wformat" } */
+
+#include "format.h"
+
+void
+foo (int i)
+{
+ printf ("%d%2$d", i); /* { dg-warning "used after format" "mixing $ and non-$ formats" } */
+ printf ("%d%*1$d", i, i); /* { dg-warning "used after format" "mixing $ and non-$ formats" } */
+ printf ("%d%.*1$d", i, i); /* { dg-warning "used after format" "mixing $ and non-$ formats" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/z-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/z-1.c
new file mode 100644
index 000000000..7916201ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/z-1.c
@@ -0,0 +1,28 @@
+/* Test for bugs with %z and %Z formats. See PRs c/89, c/156, c/376. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+
+#include "format.h"
+
+size_t
+foo (void)
+{
+ size_t t;
+ scanf ("%zu", &t); /* { dg-bogus "length|format" "bogus scanf warning" } */
+ return t;
+}
+
+void
+bar (size_t t)
+{
+ printf ("%zu\n", t); /* { dg-bogus "format" "bogus printf warning" } */
+}
+
+/* The %Z printf format is an old GNU libc extension to do the same thing. */
+
+void
+baz (size_t t)
+{
+ printf ("%Zu\n", t); /* { dg-bogus "format" "bogus printf warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/format/zero-length-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/format/zero-length-1.c
new file mode 100644
index 000000000..4cf37f320
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/format/zero-length-1.c
@@ -0,0 +1,15 @@
+/* Test the -Wno-format-zero-length option, which suppresses warnings
+ about zero-length formats. */
+/* Origin: Jason Thorpe <thorpej@wasabisystems.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wno-format-zero-length" } */
+
+#include "format.h"
+
+void
+foo (void)
+{
+ /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134). */
+ /* Zero-length format strings are allowed. */
+ printf ("");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/framework-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/framework-1.c
new file mode 100644
index 000000000..7e6868329
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/framework-1.c
@@ -0,0 +1,4 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-F." } */
+
+#include <Carbon/Carbon.h>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/framework-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/framework-2.c
new file mode 100644
index 000000000..2d8669928
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/framework-2.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-F$srcdir/gcc.dg" } */
+
+#include <Foundation/Foundation.h>
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
+/* { dg-message "Foundation/Foundation.h" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/free-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/free-1.c
new file mode 100644
index 000000000..5496c84fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/free-1.c
@@ -0,0 +1,26 @@
+/* PR c/36970 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void free (void *);
+
+char *p, buf3[10], d;
+struct S { char a; int b; } *r;
+
+void foo (void)
+{
+ char buf[10], buf2[10], c;
+ static char buf4[10], e;
+ char *q = buf;
+ free (p);
+ free (q); /* { dg-warning "attempt to free a non-heap object" } */
+ free (buf2); /* { dg-warning "attempt to free a non-heap object" } */
+ free (&c); /* { dg-warning "attempt to free a non-heap object" } */
+ free (buf3); /* { dg-warning "attempt to free a non-heap object" } */
+ free (&d); /* { dg-warning "attempt to free a non-heap object" } */
+ free (buf4); /* { dg-warning "attempt to free a non-heap object" } */
+ free (&e); /* { dg-warning "attempt to free a non-heap object" } */
+ free (&r->a);
+ free ("abcd"); /* { dg-warning "attempt to free a non-heap object" } */
+ free (L"abcd"); /* { dg-warning "attempt to free a non-heap object" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/free-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/free-2.c
new file mode 100644
index 000000000..eb9465131
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/free-2.c
@@ -0,0 +1,26 @@
+/* PR c/36970 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+extern void free (void *);
+
+char *p, buf3[10], d;
+struct S { char a; int b; } *r;
+
+void foo (void)
+{
+ char buf[10], buf2[10], c;
+ static char buf4[10], e;
+ char *q = buf;
+ free (p);
+ free (q); /* At -O0 no warning is reported here. */
+ free (buf2); /* { dg-warning "attempt to free a non-heap object" } */
+ free (&c); /* { dg-warning "attempt to free a non-heap object" } */
+ free (buf3); /* { dg-warning "attempt to free a non-heap object" } */
+ free (&d); /* { dg-warning "attempt to free a non-heap object" } */
+ free (buf4); /* { dg-warning "attempt to free a non-heap object" } */
+ free (&e); /* { dg-warning "attempt to free a non-heap object" } */
+ free (&r->a);
+ free ("abcd"); /* { dg-warning "attempt to free a non-heap object" } */
+ free (L"abcd"); /* { dg-warning "attempt to free a non-heap object" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fshort-wchar.c b/gcc-4.9/gcc/testsuite/gcc.dg/fshort-wchar.c
new file mode 100644
index 000000000..bb6988167
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fshort-wchar.c
@@ -0,0 +1,21 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do run } */
+/* { dg-options "-fshort-wchar" } */
+/* { dg-options "-fshort-wchar -Wl,--no-wchar-size-warning" { target arm*-*-*eabi* } } */
+
+/* Source: Neil Booth, 10 Dec 2002.
+
+ Test that __WCHAR_MAX__ is correct with -fshort-wchar. */
+
+extern void abort (void);
+
+int main ()
+{
+ __WCHAR_TYPE__ w = ~(__WCHAR_TYPE__) 0;
+
+ if (w != __WCHAR_MAX__)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fstack-protector-strong.c b/gcc-4.9/gcc/testsuite/gcc.dg/fstack-protector-strong.c
new file mode 100644
index 000000000..7c232fff2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fstack-protector-strong.c
@@ -0,0 +1,134 @@
+/* Test that stack protection is done on chosen functions. */
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* rs6000-*-* s390x-*-* } } */
+/* { dg-options "-O2 -fstack-protector-strong" } */
+
+#include<string.h>
+
+extern int g0;
+extern int* pg0;
+int
+goo (int *);
+int
+hoo (int);
+
+/* Function frame address escaped function call. */
+int
+foo1 ()
+{
+ int i;
+ return goo (&i);
+}
+
+struct ArrayStruct
+{
+ int a;
+ int array[10];
+};
+
+struct AA
+{
+ int b;
+ struct ArrayStruct as;
+};
+
+/* Function frame contains array. */
+int
+foo2 ()
+{
+ struct AA aa;
+ int i;
+ for (i = 0; i < 10; ++i)
+ {
+ aa.as.array[i] = i * (i-1) + i / 2;
+ }
+ return aa.as.array[5];
+}
+
+/* Address computation based on a function frame address. */
+int
+foo3 ()
+{
+ int a;
+ int *p;
+ p = &a + 5;
+ return goo (p);
+}
+
+/* Address cast based on a function frame address. */
+int
+foo4 ()
+{
+ int a;
+ return goo (g0 << 2 ? (int *)(3 * (long)(void *)(&a)) : 0);
+}
+
+/* Address cast based on a local array. */
+int
+foo5 ()
+{
+ short array[10];
+ return goo ((int *)(array + 5));
+}
+
+struct BB
+{
+ int one;
+ int two;
+ int three;
+};
+
+/* Address computaton based on a function frame address.*/
+int
+foo6 ()
+{
+ struct BB bb;
+ return goo (&bb.one + sizeof(int));
+}
+
+/* Function frame address escaped via global variable. */
+int
+foo7 ()
+{
+ int a;
+ pg0 = &a;
+ goo (pg0);
+ return *pg0;
+}
+
+/* Check that this covers -fstack-protector. */
+int
+foo8 ()
+{
+ char base[100];
+ memcpy ((void *)base, (const void *)pg0, 105);
+ return (int)(base[32]);
+}
+
+/* Check that this covers -fstack-protector. */
+int
+foo9 ()
+{
+ char* p = __builtin_alloca (100);
+ return goo ((int *)(p + 50));
+}
+
+int
+global2 (struct BB* pbb);
+
+/* Address taken on struct. */
+int
+foo10 ()
+{
+ struct BB bb;
+ int i;
+ bb.one = global2 (&bb);
+ for (i = 0; i < 10; ++i)
+ {
+ bb.two = bb.one + bb.two;
+ bb.three = bb.one + bb.two + bb.three;
+ }
+ return bb.three;
+}
+
+/* { dg-final { scan-assembler-times "stack_chk_fail" 10 } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-1.c
new file mode 100644
index 000000000..86bd802cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-1.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ PR other/15526
+ Verify correct overflow checking with -ftrapv.
+
+ Written by Falk Hueffner, 20th May 2004. */
+
+/* { dg-do run } */
+/* { dg-options "-ftrapv" } */
+/* { dg-require-effective-target trapping } */
+
+__attribute__((noinline)) int
+mulv(int a, int b)
+{
+ return a * b;
+}
+
+int
+main()
+{
+ mulv( 0, 0);
+ mulv( 0, -1);
+ mulv(-1, 0);
+ mulv(-1, -1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-2.c
new file mode 100644
index 000000000..7d765747c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-2.c
@@ -0,0 +1,109 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ PR other/18665
+ Verify that -ftrapv doesn't produce bogus results
+ on 64-bit platforms.
+
+ Written by Eric Botcazou */
+
+/* { dg-do run } */
+/* { dg-options "-ftrapv" } */
+/* { dg-require-effective-target trapping } */
+
+extern void abort(void);
+extern long labs(long);
+
+int __attribute__((noinline))
+iabsv(int a)
+{
+ return abs(a);
+}
+
+int __attribute__((noinline))
+iaddv(int a, int b)
+{
+ return a + b;
+}
+
+int __attribute__((noinline))
+isubv(int a, int b)
+{
+ return a - b;
+}
+
+int __attribute__((noinline))
+imulv(int a, int b)
+{
+ return a * b;
+}
+
+int __attribute__((noinline))
+inegv(int a)
+{
+ return -a;
+}
+
+long __attribute__((noinline))
+labsv(long a)
+{
+ return labs(a);
+}
+
+long __attribute__((noinline))
+laddv(long a, long b)
+{
+ return a + b;
+}
+
+long __attribute__((noinline))
+lsubv(long a, long b)
+{
+ return a - b;
+}
+
+long __attribute__((noinline))
+lmulv(long a, long b)
+{
+ return a * b;
+}
+
+long __attribute__((noinline))
+lnegv(long a)
+{
+ return -a;
+}
+
+int main(void)
+{
+ if (iabsv (-1) != 1)
+ abort ();
+
+ if (iaddv (2,-3) != -1)
+ abort ();
+
+ if (isubv (2,3) != -1)
+ abort ();
+
+ if (imulv (-2,3) != -6)
+ abort ();
+
+ if (inegv (-1) != 1)
+ abort ();
+
+ if (labsv (-1L) != 1L)
+ abort ();
+
+ if (laddv (2L,-3L) != -1L)
+ abort ();
+
+ if (lsubv (2L,3L) != -1L)
+ abort ();
+
+ if (lmulv (-2L,3L) != -6L)
+ abort ();
+
+ if (lnegv (-1L) != 1L)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-3.c
new file mode 100644
index 000000000..e23059a07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ftrapv-3.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+/* { dg-options "-ftrapv" } */
+
+extern void abort (void);
+unsigned long
+foo (long i, long j)
+{
+ /* We may not fold this to (unsigned long)(i * j). */
+ return -(unsigned long)(i * -j);
+}
+int main()
+{
+ if (foo (-__LONG_MAX__ - 1, -1) != -(unsigned long)(-__LONG_MAX__ - 1))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/func-args-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/func-args-1.c
new file mode 100644
index 000000000..5f7b24535
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/func-args-1.c
@@ -0,0 +1,53 @@
+/* Test messages for wrong number of arguments to function. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f0(void); /* { dg-message "note: declared here" } */
+void f1(int); /* { dg-message "note: declared here" } */
+void f1v(int, ...); /* { dg-message "note: declared here" } */
+void f2(int, int); /* { dg-message "note: declared here" } */
+void f2v(int, int, ...); /* { dg-message "note: declared here" } */
+
+struct s {
+ void (*f0)(void);
+ void (*f1)(int);
+ void (*f1v)(int, ...);
+ void (*f2)(int, int);
+ void (*f2v)(int, int, ...);
+} x;
+
+void
+g (int a)
+{
+ f0();
+ x.f0();
+ f0(a); /* { dg-error "too many arguments to function 'f0'" } */
+ x.f0(a); /* { dg-error "too many arguments to function 'x.f0'" } */
+ f0(a, a); /* { dg-error "too many arguments to function 'f0'" } */
+ x.f0(a, a); /* { dg-error "too many arguments to function 'x.f0'" } */
+ f1(); /* { dg-error "too few arguments to function 'f1'" } */
+ x.f1(); /* { dg-error "too few arguments to function 'x.f1'" } */
+ f1(a);
+ x.f1(a);
+ f1(a, a); /* { dg-error "too many arguments to function 'f1'" } */
+ x.f1(a, a); /* { dg-error "too many arguments to function 'x.f1'" } */
+ f1v(); /* { dg-error "too few arguments to function 'f1v'" } */
+ x.f1v(); /* { dg-error "too few arguments to function 'x.f1v'" } */
+ f1v(a);
+ x.f1v(a);
+ f1v(a, a);
+ x.f1v(a, a);
+ f2(a); /* { dg-error "too few arguments to function 'f2'" } */
+ x.f2(a); /* { dg-error "too few arguments to function 'x.f2'" } */
+ f2(a, a);
+ x.f2(a, a);
+ f2(a, a, a); /* { dg-error "too many arguments to function 'f2'" } */
+ x.f2(a, a, a); /* { dg-error "too many arguments to function 'x.f2'" } */
+ f2v(a); /* { dg-error "too few arguments to function 'f2v'" } */
+ x.f2v(a); /* { dg-error "too few arguments to function 'x.f2v'" } */
+ f2v(a, a);
+ x.f2v(a, a);
+ f2v(a, a, a);
+ x.f2v(a, a, a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/func-args-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/func-args-2.c
new file mode 100644
index 000000000..a537f8956
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/func-args-2.c
@@ -0,0 +1,6 @@
+/* PR c/27420 */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+void foo();
+void foo(struct A a) {} /* { dg-error "incomplete type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/func-outside-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/func-outside-1.c
new file mode 100644
index 000000000..25c19c6f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/func-outside-1.c
@@ -0,0 +1,9 @@
+/* Test for rejection of __func__ outside a function (GNU extensions
+ are OK there). Test with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-fshow-column" } */
+
+const char *a = __func__; /* { dg-warning "17:'__func__' is not defined outside of function scope" "undef" } */
+const char *b = __FUNCTION__;
+const char *c = __PRETTY_FUNCTION__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/func-outside-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/func-outside-2.c
new file mode 100644
index 000000000..be3b0999e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/func-outside-2.c
@@ -0,0 +1,9 @@
+/* Test for rejection of __func__ outside a function (GNU extensions
+ are OK there). Test with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+const char *a = __func__; /* { dg-error "'__func__' is not defined outside of function scope" "undef" } */
+const char *b = __FUNCTION__;
+const char *c = __PRETTY_FUNCTION__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/func-ptr-conv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/func-ptr-conv-1.c
new file mode 100644
index 000000000..5c8a10134
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/func-ptr-conv-1.c
@@ -0,0 +1,56 @@
+/* Conversions between function and object pointers are not permitted
+ in any version of ISO C, even with casts, except for the special
+ case of converting a null pointer constant to function pointer
+ type. Likewise, comparisons between function and object pointers
+ are not permitted. PR c/11234. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+void f(void);
+
+void *v1 = f; /* { dg-warning "12:pointer" "bad conversion" } */
+void *v2 = &f; /* { dg-warning "12:pointer" "bad conversion" } */
+void *v3 = (void *)f; /* { dg-warning "12:pointer" "bad conversion" } */
+void *v4 = (void *)&f; /* { dg-warning "12:pointer" "bad conversion" } */
+void *v5;
+char *c1 = f; /* { dg-warning "12:pointer" "bad conversion" } */
+char *c2 = &f; /* { dg-warning "12:pointer" "bad conversion" } */
+char *c3 = (char *)f; /* { dg-warning "12:pointer" "bad conversion" } */
+char *c4 = (char *)&f; /* { dg-warning "12:pointer" "bad conversion" } */
+char *c5;
+void (*fp)(void);
+int a;
+
+void
+g(void)
+{
+ v5 = f; /* { dg-warning "6:pointer" "bad conversion" } */
+ v5 = &f; /* { dg-warning "6:pointer" "bad conversion" } */
+ v5 = (void *)f; /* { dg-warning "8:pointer" "bad conversion" } */
+ v5 = (void *)&f; /* { dg-warning "8:pointer" "bad conversion" } */
+ c5 = f; /* { dg-warning "6:pointer" "bad conversion" } */
+ c5 = &f; /* { dg-warning "6:pointer" "bad conversion" } */
+ c5 = (char *)f; /* { dg-warning "8:pointer" "bad conversion" } */
+ c5 = (char *)&f; /* { dg-warning "8:pointer" "bad conversion" } */
+ fp = v5; /* { dg-warning "6:pointer" "bad conversion" } */
+ fp = c5; /* { dg-warning "6:pointer" "bad conversion" } */
+ fp = (void (*)(void))v5; /* { dg-warning "8:pointer" "bad conversion" } */
+ fp = (void (*)(void))c5; /* { dg-warning "8:pointer" "bad conversion" } */
+ (a ? f : v3); /* { dg-warning "10:pointer" "bad conversion" } */
+ (a ? v2 : fp); /* { dg-warning "11:pointer" "bad conversion" } */
+ /* The following are OK. */
+ fp = 0;
+ fp = (void *)0;
+ fp = 0L;
+ fp = (void (*)(void))0;
+ fp = (void (*)(void))(void *)0;
+ (a ? f : 0);
+ (a ? f : (void *)0);
+ (a ? (void *)0 : fp);
+ (a ? 0 : fp);
+}
+
+/* The following are OK. */
+void (*fp2)(void) = 0;
+void (*fp3)(void) = (void *)0;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-attr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-attr-1.c
new file mode 100644
index 000000000..17249a0cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-attr-1.c
@@ -0,0 +1,14 @@
+/* The declarator in a function definition should be able to take the
+ form of an attributed function declarator, not just a plain
+ function declarator. This was formerly allowed by some of the code
+ but then the wrong constraint checks were made because other code
+ didn't recognise the declarator as being that of the function
+ definition. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk>. */
+
+int (__attribute__((const)) x) (a, b)
+ int a;
+ int b;
+{
+ return a + b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-storage-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-storage-1.c
new file mode 100644
index 000000000..9aa963a02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-storage-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void
+flarm(void)
+{
+ static void foo(); /* { dg-error "invalid storage class" } */
+
+ foo();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-var-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-var-1.c
new file mode 100644
index 000000000..63a56838a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-var-1.c
@@ -0,0 +1,10 @@
+/* Test ICE on defining function with a name previously declared as a
+ nonfunction. Bug 28299 from Bernhard Fischer
+ <aldot@gcc.gnu.org>. */
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-prototypes" } */
+
+extern __typeof(foo) foo __asm__(""); /* { dg-error "undeclared" } */
+/* { dg-message "note: previous declaration" "previous declaration" { target *-*-* } 7 } */
+void *foo (void) {} /* { dg-error "redeclared as different kind of symbol" } */
+/* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } 9 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-var-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-var-2.c
new file mode 100644
index 000000000..b3eb2ce6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/funcdef-var-2.c
@@ -0,0 +1,11 @@
+/* Test ICE on defining function with a name previously declared as a
+ nonfunction. Bug 28299 from Bernhard Fischer <aldot@gcc.gnu.org>.
+ Reduced testcase from Volker Reichelt <reichelt@gcc.gnu.org>. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-prototypes" } */
+
+int foo;
+/* { dg-message "note: previous declaration" "previous declaration" { target *-*-* } 8 } */
+void foo () {} /* { dg-error "redeclared as different kind of symbol" } */
+/* { dg-warning "no previous prototype" "no previous prototype" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/funcorder.c b/gcc-4.9/gcc/testsuite/gcc.dg/funcorder.c
new file mode 100644
index 000000000..0dec72c7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/funcorder.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funit-at-a-time" } */
+/* { dg-final { scan-assembler-not "link_error" } } */
+/* In unit-at-time the functions should be assembled in order
+ e q t main, so we realize that they are pure. */
+
+static int mem;
+static int e(void) __attribute__ ((noinline));
+static int q(void) __attribute__ ((noinline));
+static int t(void) __attribute__ ((noinline));
+main()
+{
+ return t();
+}
+static t()
+{
+ int r,e;
+ if (mem)
+ t();
+ e=mem;
+ r=q();
+ if (e!=mem)
+ link_error();
+ return r;
+}
+static int e()
+{
+ return 0;
+}
+static int q()
+{
+ int t=mem,r;
+ r=e();
+ if (t!=mem)
+ link_error();
+ return r;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/funroll-loops-all.c b/gcc-4.9/gcc/testsuite/gcc.dg/funroll-loops-all.c
new file mode 100644
index 000000000..9cdc90172
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/funroll-loops-all.c
@@ -0,0 +1,4 @@
+/* PR 17594 */
+/* { dg-do compile } */
+/* { dg-options "-funroll-loops-all" } */
+/* { dg-error "unrecognized command line option '-funroll-loops-all'" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fwrapv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/fwrapv-1.c
new file mode 100644
index 000000000..f7ddda4a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fwrapv-1.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Test that the -fwrapv command line option is accepted and disables
+ "unsafe" optimizations that rely on undefined arithmetic overflow.
+
+ Written by Roger Sayle, 24th March 2003. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fwrapv" } */
+
+#include <limits.h>
+
+extern void abort ();
+
+int test(int x)
+{
+ return (2*x)/2;
+}
+
+main()
+{
+ int x = INT_MAX;
+
+ if (test(x) == x)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fwrapv-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/fwrapv-2.c
new file mode 100644
index 000000000..cb4270e0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/fwrapv-2.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Test that the -fno-wrapv command line option is accepted and enables
+ "unsafe" optimizations that rely on undefined arithmetic overflow.
+
+ Written by Roger Sayle, 31st May 2003. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-wrapv" } */
+
+#include <limits.h>
+
+extern void abort ();
+
+int test(int x)
+{
+ return (2*x)/2;
+}
+
+main()
+{
+ int x = INT_MAX;
+
+ if (test(x) != x)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gcc-have-sync-compare-and-swap.c b/gcc-4.9/gcc/testsuite/gcc.dg/gcc-have-sync-compare-and-swap.c
new file mode 100644
index 000000000..5affeba19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gcc-have-sync-compare-and-swap.c
@@ -0,0 +1,62 @@
+/* { dg-do link } */
+/* MIPS only supports these built-in functions for non-MIPS16 mode, and
+ -mflip-mips16 will change the mode of some functions to be different
+ from the command-line setting. */
+/* { dg-skip-if "" { mips*-*-* } { "-mflip-mips16" } { "" } } */
+
+void f1()
+{
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
+ typedef int __attribute__ ((__mode__ (__QI__))) qi_int_type;
+ qi_int_type qi_int;
+ __sync_bool_compare_and_swap (&qi_int, (qi_int_type)0, (qi_int_type)1);
+#endif
+}
+
+void f2()
+{
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
+ typedef int __attribute__ ((__mode__ (__HI__))) hi_int_type;
+ hi_int_type hi_int;
+ __sync_bool_compare_and_swap (&hi_int, (hi_int_type)0, (hi_int_type)1);
+#endif
+}
+
+void f4()
+{
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+ typedef int __attribute__ ((__mode__ (__SI__))) si_int_type;
+ si_int_type si_int;
+ __sync_bool_compare_and_swap (&si_int, (si_int_type)0, (si_int_type)1);
+#endif
+}
+
+void f8()
+{
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+ typedef int __attribute__ ((__mode__ (__DI__))) di_int_type;
+ di_int_type di_int;
+ __sync_bool_compare_and_swap (&di_int, (di_int_type)0, (di_int_type)1);
+#endif
+}
+
+/* aligned (16): On S/390 16 byte compare and swap operations are only
+ available if the memory operand resides on a 16 byte boundary. */
+void f16()
+{
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
+ typedef int __attribute__ ((__mode__ (__TI__), aligned (16))) ti_int_type;
+ ti_int_type ti_int;
+ __sync_bool_compare_and_swap (&ti_int, (ti_int_type)0, (ti_int_type)1);
+#endif
+}
+
+int main()
+{
+ f1();
+ f2();
+ f4();
+ f8();
+ f16();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-1.c
new file mode 100644
index 000000000..0f0bb2142
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-1.c
@@ -0,0 +1,13 @@
+/* Test diagnostic for GNU extension: omitting middle term of
+ conditional expression. Test with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+int a, b, c;
+
+void
+f (void)
+{
+ c = (++a ? : b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-2.c
new file mode 100644
index 000000000..2e561e4b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-2.c
@@ -0,0 +1,13 @@
+/* Test diagnostic for GNU extension: omitting middle term of
+ conditional expression. Test with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+int a, b, c;
+
+void
+f (void)
+{
+ c = (++a ? : b); /* { dg-warning "ISO C forbids omitting the middle term of a \\?: expression" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-3.c
new file mode 100644
index 000000000..90555ad63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu-cond-expr-3.c
@@ -0,0 +1,13 @@
+/* Test diagnostic for GNU extension: omitting middle term of
+ conditional expression. Test with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+int a, b, c;
+
+void
+f (void)
+{
+ c = (++a ? : b); /* { dg-error "ISO C forbids omitting the middle term of a \\?: expression" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu11-version-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu11-version-1.c
new file mode 100644
index 000000000..56efbd43b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu11-version-1.c
@@ -0,0 +1,9 @@
+/* Test __STDC_VERSION__ for C11 with GNU extensions. Test -std=gnu11. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu11 -pedantic-errors" } */
+
+#if __STDC_VERSION__ == 201112L
+int i;
+#else
+#error "Bad __STDC_VERSION__."
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c
new file mode 100644
index 000000000..0cc14da59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c
@@ -0,0 +1,56 @@
+/* Test for constant expressions: GNU extensions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -pedantic-errors" } */
+
+int n;
+
+void
+f (void)
+{
+ int i = 0;
+ int a[n]; /* { dg-error "ISO C90 forbids variable length array" } */
+ enum e1 {
+ /* Integer constant expressions may not contain statement
+ expressions (not a permitted operand). */
+ E1 = (1 ? 0 : ({ 0; })), /* { dg-error "constant expression" } */
+ /* { dg-error "ISO C forbids braced-groups" "ISO" { target *-*-* } 16 } */
+ /* Real and imaginary parts act like other arithmetic
+ operators. */
+ E2 = __real__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
+ E3 = __real__ 0,
+ E4 = __imag__ (1 ? 0 : i++), /* { dg-error "constant" } */
+ E5 = __imag__ 0,
+ /* __alignof__ always constant. */
+ E6 = __alignof__ (int[n]), /* { dg-error "ISO C90 forbids variable length array" } */
+ E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */
+ /* __extension__ ignored for constant expression purposes. */
+ E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
+ E9 = __extension__ 0,
+ /* Conditional expressions with omitted arguments act like the
+ standard type. */
+ E10 = (1 ? : i++), /* { dg-error "constant expression" } */
+ /* { dg-error "ISO C forbids omitting" "ISO" { target *-*-* } 32 } */
+ E11 = (1 ? : 0) /* { dg-error "ISO C forbids omitting" } */
+ };
+ enum e2 {
+ /* Complex integer constants may be cast directly to integer
+ types, but not after further arithmetic on them. */
+ F1 = (int) (_Complex int) 2i, /* { dg-error "constant expression" } */
+ /* { dg-error "complex" "complex" { target *-*-* } 39 } */
+ /* { dg-error "imaginary" "imaginary" { target *-*-* } 39 } */
+ F2 = (int) +2i, /* { dg-error "constant expression" } */
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 42 } */
+ F3 = (int) (1 + 2i), /* { dg-error "constant expression" } */
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 44 } */
+ F4 = (int) 2i /* { dg-error "imaginary" } */
+ };
+ static double dr = __real__ (1.0 + 2.0i);
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 48 } */
+ static double di = __imag__ (1.0 + 2.0i);
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 50 } */
+ /* Statement expressions allowed in unevaluated subexpressions in
+ initializers in gnu99 but not gnu89. */
+ static int j = (1 ? 0 : ({ 0; })); /* { dg-error "constant expression" } */
+ /* { dg-error "braced" "ISO" { target *-*-* } 54 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-const-expr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-const-expr-2.c
new file mode 100644
index 000000000..fd4d18ed9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-const-expr-2.c
@@ -0,0 +1,26 @@
+/* Test for constant expressions: __builtin_choose_expr. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -pedantic-errors" } */
+
+#include <limits.h>
+
+int a, b, c;
+
+void
+f (void)
+{
+ /* __builtin_choose_expr acts exactly like the chosen argument for
+ all constant expression purposes. */
+ enum e {
+ E1 = __builtin_choose_expr (1, 1, ++b)
+ };
+ /* The first argument to __builtin_choose_expr must be an integer
+ constant expression. */
+ a = __builtin_choose_expr ((void *)0, b, c); /* { dg-error "constant" } */
+ a = __builtin_choose_expr (0 * (INT_MAX + 1), b, c); /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 21 } */
+ a = __builtin_choose_expr (1 / 0, 0, 0); /* { dg-warning "division by zero" } */
+ /* { dg-error "not a constant" "error" { target *-*-* } 23 } */
+ a = __builtin_choose_expr ((1 ? 1 : a), b, c); /* { dg-error "constant" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-dupqual-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-dupqual-1.c
new file mode 100644
index 000000000..9bd1db015
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-dupqual-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -Werror" } */
+
+typedef const int CI;
+const const int c1; /* { dg-bogus "duplicate" } */
+const CI c2; /* { dg-bogus "duplicate" } */
+const CI *c3; /* { dg-bogus "duplicate" } */
+
+typedef volatile int VI;
+volatile volatile int v1; /* { dg-bogus "duplicate" } */
+volatile VI v2; /* { dg-bogus "duplicate" } */
+volatile VI *v3; /* { dg-bogus "duplicate" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-1.c
new file mode 100644
index 000000000..07bf82353
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-1.c
@@ -0,0 +1,69 @@
+/* Test for GNU extensions to compound literals */
+/* Origin: Jakub Jelinek <jakub@redhat.com> */
+/* { dg-do run } */
+/* { dg-options "-std=gnu89" } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct A { int i; int j; int k[4]; };
+struct B { };
+struct C { int i; };
+struct D { int i; struct C j; };
+
+/* As a GNU extension, we allow initialization of objects with static storage
+ duration by compound literals. It is handled as if the object
+ was initialized only with the bracket enclosed list if compound literal's
+ and object types match. If the object being initialized has array type
+ of unknown size, the size is determined by compound literal's initializer
+ list, not by size of the compound literal. */
+
+struct A a = (struct A) { .j = 6, .k[2] = 12 };
+struct B b = (struct B) { };
+int c[] = (int []) { [2] = 6, 7, 8 };
+int d[] = (int [3]) { 1 };
+int e[2] = (int []) { 1, 2 };
+int f[2] = (int [2]) { 1 };
+struct C g[3] = { [2] = (struct C) { 13 }, [1] = (const struct C) { 12 } };
+struct D h = { .j = (struct C) { 15 }, .i = 14 };
+struct D i[2] = { [1].j = (const struct C) { 17 },
+ [0] = { 0, (struct C) { 16 } } };
+struct C j[2][3] = { [0 ... 1] = { [0 ... 2] = (struct C) { 26 } } };
+struct C k[3][2] = { [0 ... 2][0 ... 1] = (const struct C) { 27 } };
+
+int main (void)
+{
+ if (a.i || a.j != 6 || a.k[0] || a.k[1] || a.k[2] != 12 || a.k[3])
+ abort ();
+ if (c[0] || c[1] || c[2] != 6 || c[3] != 7 || c[4] != 8)
+ abort ();
+ if (sizeof (c) != 5 * sizeof (int))
+ abort ();
+ if (d[0] != 1 || d[1] || d[2])
+ abort ();
+ if (sizeof (d) != 3 * sizeof (int))
+ abort ();
+ if (e[0] != 1 || e[1] != 2)
+ abort ();
+ if (sizeof (e) != 2 * sizeof (int))
+ abort ();
+ if (f[0] != 1 || f[1])
+ abort ();
+ if (sizeof (f) != 2 * sizeof (int))
+ abort ();
+ if (g[0].i || g[1].i != 12 || g[2].i != 13)
+ abort ();
+ if (h.i != 14 || h.j.i != 15)
+ abort ();
+ if (i[0].i || i[0].j.i != 16 || i[1].i || i[1].j.i != 17)
+ abort ();
+ if (j[0][0].i != 26 || j[0][1].i != 26 || j[0][2].i != 26)
+ abort ();
+ if (j[1][0].i != 26 || j[1][1].i != 26 || j[1][2].i != 26)
+ abort ();
+ if (k[0][0].i != 27 || k[0][1].i != 27 || k[1][0].i != 27)
+ abort ();
+ if (k[1][1].i != 27 || k[2][0].i != 27 || k[2][1].i != 27)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-2.c
new file mode 100644
index 000000000..ce966ec89
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-2.c
@@ -0,0 +1,25 @@
+/* Test whether __compound_literal.* objects are not emitted unless
+ they are actually needed. */
+/* Origin: Jakub Jelinek <jakub@redhat.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -O2" } */
+/* { dg-final { scan-assembler-not "__compound_literal" } } */
+
+struct A { int i; int j; int k[4]; };
+struct B { };
+struct C { int i; };
+struct D { int i; struct C j; };
+
+struct A a = (struct A) { .j = 6, .k[2] = 12 };
+struct B b = (struct B) { };
+int c[] = (int []) { [2] = 6, 7, 8 };
+int d[] = (int [3]) { 1 };
+int e[2] = (int []) { 1, 2 };
+int f[2] = (int [2]) { 1 };
+struct C g[3] = { [2] = (struct C) { 13 }, [1] = (const struct C) { 12 } };
+struct D h = { .j = (struct C) { 15 }, .i = 14 };
+struct D i[2] = { [1].j = (const struct C) { 17 },
+ [0] = { 0, (struct C) { 16 } } };
+static const int *j = 1 ? (const int *) 0 : & (const int) { 26 };
+int k = (int) sizeof ((int [6]) { 1, 2, 3, 4, 5, 6 }) + 4;
+int l = (int) sizeof ((struct C) { 16 });
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-3.c
new file mode 100644
index 000000000..bd4283ec8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-3.c
@@ -0,0 +1,18 @@
+/* PR 11527 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+typedef struct smrdd_memory_blocks_s
+{
+ int blocks;
+ int block[];
+} smrdd_memory_blocks_t;
+
+const smrdd_memory_blocks_t smrdd_memory_blocks =
+{
+ 3,
+ {
+ [5] = 5,
+ [1] = 2,
+ }
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-4.c
new file mode 100644
index 000000000..15e9cdb35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu89-init-4.c
@@ -0,0 +1,12 @@
+/* Test for GNU extensions to compound literals are giving the correct array bounds */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -W -Wall -O2" } */
+
+int a[] = (int[4]){1, 1, 2};
+int f(void)
+{
+ int sum = 0; int i;
+ for(i = 0;i<4;i++)
+ sum = a[i];
+ return sum;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c
new file mode 100644
index 000000000..e05211462
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c
@@ -0,0 +1,56 @@
+/* Test for constant expressions: GNU extensions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu90 -pedantic-errors" } */
+
+int n;
+
+void
+f (void)
+{
+ int i = 0;
+ int a[n]; /* { dg-error "ISO C90 forbids variable length array" } */
+ enum e1 {
+ /* Integer constant expressions may not contain statement
+ expressions (not a permitted operand). */
+ E1 = (1 ? 0 : ({ 0; })), /* { dg-error "constant expression" } */
+ /* { dg-error "ISO C forbids braced-groups" "ISO" { target *-*-* } 16 } */
+ /* Real and imaginary parts act like other arithmetic
+ operators. */
+ E2 = __real__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
+ E3 = __real__ 0,
+ E4 = __imag__ (1 ? 0 : i++), /* { dg-error "constant" } */
+ E5 = __imag__ 0,
+ /* __alignof__ always constant. */
+ E6 = __alignof__ (int[n]), /* { dg-error "ISO C90 forbids variable length array" } */
+ E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */
+ /* __extension__ ignored for constant expression purposes. */
+ E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
+ E9 = __extension__ 0,
+ /* Conditional expressions with omitted arguments act like the
+ standard type. */
+ E10 = (1 ? : i++), /* { dg-error "constant expression" } */
+ /* { dg-error "ISO C forbids omitting" "ISO" { target *-*-* } 32 } */
+ E11 = (1 ? : 0) /* { dg-error "ISO C forbids omitting" } */
+ };
+ enum e2 {
+ /* Complex integer constants may be cast directly to integer
+ types, but not after further arithmetic on them. */
+ F1 = (int) (_Complex int) 2i, /* { dg-error "constant expression" } */
+ /* { dg-error "complex" "complex" { target *-*-* } 39 } */
+ /* { dg-error "imaginary" "imaginary" { target *-*-* } 39 } */
+ F2 = (int) +2i, /* { dg-error "constant expression" } */
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 42 } */
+ F3 = (int) (1 + 2i), /* { dg-error "constant expression" } */
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 44 } */
+ F4 = (int) 2i /* { dg-error "imaginary" } */
+ };
+ static double dr = __real__ (1.0 + 2.0i);
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 48 } */
+ static double di = __imag__ (1.0 + 2.0i);
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 50 } */
+ /* Statement expressions allowed in unevaluated subexpressions in
+ initializers in gnu99 but not gnu89. */
+ static int j = (1 ? 0 : ({ 0; })); /* { dg-error "constant expression" } */
+ /* { dg-error "braced" "ISO" { target *-*-* } 54 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c
new file mode 100644
index 000000000..da7076ff8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c
@@ -0,0 +1,56 @@
+/* Test for constant expressions: GNU extensions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+int n;
+
+void
+f (void)
+{
+ int i = 0;
+ int a[n];
+ enum e1 {
+ /* Integer constant expressions may not contain statement
+ expressions (not a permitted operand). */
+ E1 = (1 ? 0 : ({ 0; })), /* { dg-error "constant expression" } */
+ /* { dg-error "ISO C forbids braced-groups" "ISO" { target *-*-* } 16 } */
+ /* Real and imaginary parts act like other arithmetic
+ operators. */
+ E2 = __real__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
+ E3 = __real__ 0,
+ E4 = __imag__ (1 ? 0 : i++), /* { dg-error "constant" } */
+ E5 = __imag__ 0,
+ /* __alignof__ always constant. */
+ E6 = __alignof__ (int[n]),
+ E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */
+ /* __extension__ ignored for constant expression purposes. */
+ E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */
+ E9 = __extension__ 0,
+ /* Conditional expressions with omitted arguments act like the
+ standard type. */
+ E10 = (1 ? : i++), /* { dg-error "constant expression" } */
+ /* { dg-error "ISO C forbids omitting" "ISO" { target *-*-* } 32 } */
+ E11 = (1 ? : 0) /* { dg-error "ISO C forbids omitting" } */
+ };
+ enum e2 {
+ /* Complex integer constants may be cast directly to integer
+ types, but not after further arithmetic on them. */
+ F1 = (int) (_Complex int) 2i, /* { dg-error "constant expression" } */
+ /* { dg-error "complex" "complex" { target *-*-* } 39 } */
+ /* { dg-error "imaginary" "imaginary" { target *-*-* } 39 } */
+ F2 = (int) +2i, /* { dg-error "constant expression" } */
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 42 } */
+ F3 = (int) (1 + 2i), /* { dg-error "constant expression" } */
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 44 } */
+ F4 = (int) 2i /* { dg-error "imaginary" } */
+ };
+ static double dr = __real__ (1.0 + 2.0i);
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 48 } */
+ static double di = __imag__ (1.0 + 2.0i);
+ /* { dg-error "imaginary" "ISO" { target *-*-* } 50 } */
+ /* Statement expressions allowed in unevaluated subexpressions in
+ initializers in gnu99 but not gnu89. */
+ static int j = (1 ? 0 : ({ 0; }));
+ /* { dg-error "braced" "ISO" { target *-*-* } 54 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-2.c
new file mode 100644
index 000000000..f9acef81a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-2.c
@@ -0,0 +1,26 @@
+/* Test for constant expressions: __builtin_choose_expr. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+#include <limits.h>
+
+int a, b, c;
+
+void
+f (void)
+{
+ /* __builtin_choose_expr acts exactly like the chosen argument for
+ all constant expression purposes. */
+ enum e {
+ E1 = __builtin_choose_expr (1, 1, ++b)
+ };
+ /* The first argument to __builtin_choose_expr must be an integer
+ constant expression. */
+ a = __builtin_choose_expr ((void *)0, b, c); /* { dg-error "constant" } */
+ a = __builtin_choose_expr (0 * (INT_MAX + 1), b, c); /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 21 } */
+ a = __builtin_choose_expr (1 / 0, 0, 0); /* { dg-warning "division by zero" } */
+ /* { dg-error "not a constant" "error" { target *-*-* } 23 } */
+ a = __builtin_choose_expr ((1 ? 1 : a), b, c); /* { dg-error "constant" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-3.c
new file mode 100644
index 000000000..aba7da542
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-3.c
@@ -0,0 +1,32 @@
+/* Test for constant expressions: cases involving VLAs and typeof. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+/* It appears address constants may contain casts to variably modified
+ types. Whether they should be permitted was discussed in
+ <http://groups.google.com/group/comp.std.c/msg/923eee5ab690fd98>
+ <LV7g2Vy3ARF$Ew9Q@romana.davros.org>; since static pointers to VLAs
+ are definitely permitted within functions and may be initialized
+ and such initialization involves implicit conversion to a variably
+ modified type, allowing explicit casts seems appropriate. Thus,
+ GCC allows them as long as the "evaluated" size expressions do not
+ contain the various operators not permitted to be evaluated in a
+ constant expression, and as long as the result is genuinely
+ constant (meaning that pointer arithmetic using the size of the VLA
+ is generally not permitted). */
+
+static int sa[100];
+
+int
+f (int m, int n)
+{
+ static int (*a1)[n] = &sa;
+ static int (*a2)[n] = (__typeof__(int (*)[n]))sa;
+ static int (*a3)[n] = (__typeof__(int (*)[(int){m++}]))sa; /* { dg-error "constant" } */
+ static int (*a4)[n] = (__typeof__((int (*)[n])sa))sa;
+ static int (*a5)[n] = (__typeof__((int (*)[m++])sa))sa; /* { dg-error "constant" } */
+ static int (*a6)[n] = (__typeof__((int (*)[100])(int (*)[m++])sa))sa;
+ static int (*a7)[n] = (__typeof__((int (*)[n])sa + m++))sa; /* { dg-error "constant" } */
+ return n;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-4.c
new file mode 100644
index 000000000..baaa63031
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-const-expr-4.c
@@ -0,0 +1,29 @@
+/* Test for constant expressions: cases involving VLAs and typeof, at
+ file scope. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+/* It appears address constants may contain casts to variably modified
+ types. Whether they should be permitted was discussed in
+ <http://groups.google.com/group/comp.std.c/msg/923eee5ab690fd98>
+ <LV7g2Vy3ARF$Ew9Q@romana.davros.org>; since static pointers to VLAs
+ are definitely permitted within functions and may be initialized
+ and such initialization involves implicit conversion to a variably
+ modified type, allowing explicit casts seems appropriate. Thus,
+ GCC allows them as long as the "evaluated" size expressions do not
+ contain the various operators not permitted to be evaluated in a
+ constant expression, and as long as the result is genuinely
+ constant (meaning that pointer arithmetic using the size of the VLA
+ is generally not permitted). */
+
+static int sa[100];
+int m;
+int n;
+
+static int (*a1)[] = &sa;
+static int (*a2)[] = (__typeof__(int (*)[n]))sa;
+static int (*a4)[] = (__typeof__((int (*)[n])sa))sa;
+static int (*a5)[] = (__typeof__((int (*)[m++])sa))sa; /* { dg-error "constant" } */
+static int (*a6)[] = (__typeof__((int (*)[100])(int (*)[m++])sa))sa;
+static int (*a7)[] = (__typeof__((int (*)[n])sa + m++))sa; /* { dg-error "constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-init-1.c
new file mode 100644
index 000000000..009c8515f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-init-1.c
@@ -0,0 +1,80 @@
+/* Test for GNU extensions to C99 designated initializers */
+/* Origin: Jakub Jelinek <jakub@redhat.com> */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern int memcmp (const void *, const void *, size_t);
+extern void abort (void);
+extern void exit (int);
+
+int a[][2][4] = { [2 ... 4][0 ... 1][2 ... 3] = 1, [2] = 2, [2][0][2] = 3 };
+struct E {};
+struct F { struct E H; };
+struct G { int I; struct E J; int K; };
+struct H { int I; struct F J; int K; };
+struct G k = { .J = {}, 1 };
+struct H l = { .J.H = {}, 2 };
+struct H m = { .J = {}, 3 };
+struct I { int J; int K[3]; int L; };
+struct M { int N; struct I O[3]; int P; };
+struct M n[] = { [0 ... 5].O[1 ... 2].K[0 ... 1] = 4, 5, 6, 7 };
+struct M o[] = { [0 ... 5].O = { [1 ... 2].K[0 ... 1] = 4 },
+ [5].O[2].K[2] = 5, 6, 7 };
+struct M p[] = { [0 ... 5].O[1 ... 2].K = { [0 ... 1] = 4 },
+ [5].O[2].K[2] = 5, 6, 7 };
+int q[3][3] = { [0 ... 1] = { [1 ... 2] = 23 }, [1][2] = 24 };
+int r[1] = { [0 ... 1 - 1] = 27 };
+
+int main (void)
+{
+ int x, y, z;
+
+ if (a[2][0][0] != 2 || a[2][0][2] != 3)
+ abort ();
+ a[2][0][0] = 0;
+ a[2][0][2] = 1;
+ for (x = 0; x <= 4; x++)
+ for (y = 0; y <= 1; y++)
+ for (z = 0; z <= 3; z++)
+ if (a[x][y][z] != (x >= 2 && z >= 2))
+ abort ();
+ if (k.I || l.I || m.I || k.K != 1 || l.K != 2 || m.K != 3)
+ abort ();
+ for (x = 0; x <= 5; x++)
+ {
+ if (n[x].N || n[x].O[0].J || n[x].O[0].L)
+ abort ();
+ for (y = 0; y <= 2; y++)
+ if (n[x].O[0].K[y])
+ abort ();
+ for (y = 1; y <= 2; y++)
+ {
+ if (n[x].O[y].J)
+ abort ();
+ if (n[x].O[y].K[0] != 4)
+ abort ();
+ if (n[x].O[y].K[1] != 4)
+ abort ();
+ if ((x < 5 || y < 2) && (n[x].O[y].K[2] || n[x].O[y].L))
+ abort ();
+ }
+ if (x < 5 && n[x].P)
+ abort ();
+ }
+ if (n[5].O[2].K[2] != 5 || n[5].O[2].L != 6 || n[5].P != 7)
+ abort ();
+ if (memcmp (n, o, sizeof (n)) || sizeof (n) != sizeof (o))
+ abort ();
+ if (memcmp (n, p, sizeof (n)) || sizeof (n) != sizeof (p))
+ abort ();
+ if (q[0][0] || q[0][1] != 23 || q[0][2] != 23)
+ abort ();
+ if (q[1][0] || q[1][1] != 23 || q[1][2] != 24)
+ abort ();
+ if (q[2][0] || q[2][1] || q[2][2])
+ abort ();
+ if (r[0] != 27)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-init-2.c
new file mode 100644
index 000000000..a4728a608
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-init-2.c
@@ -0,0 +1,11 @@
+/* Test for designated initializers: array designators must be of
+ integer type. Test for index ranges (GNU extension). */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+int a[] = { [(void *)0 ... 0] = 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "integer type|near init" "pointer designator" { target *-*-* } 7 } */
+
+int b[] = { [0 ... (void *)0] = 1 }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "integer type|near init" "pointer designator" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-static-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-static-1.c
new file mode 100644
index 000000000..3fece615e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gnu99-static-1.c
@@ -0,0 +1,30 @@
+/* It is a constraint violation for a static function to be declared
+ but not defined if it is used except in a sizeof expression whose
+ result is an integer constant. In GNU C, we need to consider
+ __typeof__ and __alignof__ as well. __alignof__ always returns a
+ constant, so static functions can always be used therein.
+ __typeof__ evaluates its argument iff it has variably modified
+ type. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -pedantic-errors" } */
+
+/* __alignof__, OK. */
+static int f0(void);
+void g0(void) { __alignof__(f0()); } /* { dg-error "__alignof__ \\(expression\\)" } */
+
+/* __typeof__ not variably modified, OK. */
+static int f1(void);
+void g1(void) { __typeof__(f1()) x; }
+
+/* __typeof__ variably modified, not OK. */
+static int f2(void); /* { dg-error "used but never defined" } */
+void g2(void) { __typeof__(int [f2()]) x; }
+
+/* __typeof__ variably modified, not OK. */
+static int f3(void); /* { dg-error "used but never defined" } */
+void g3(void) { __typeof__(int (*)[f3()]) x; }
+
+/* Integer sizeof of VM typeof, OK. */
+static int f4(void);
+void g4(void) { sizeof(__typeof__(int (*)[f3()])); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.1.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.1.1.c
new file mode 100644
index 000000000..f7f2924ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.1.1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+void
+a1 (int n, float *a, float *b)
+{
+ int i;
+#pragma omp parallel for
+ for (i = 1; i < n; i++) /* i is private by default */
+ b[i] = (a[i] + a[i - 1]) / 2.0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.10.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.10.1.c
new file mode 100644
index 000000000..750bc378c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.10.1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#include <stdio.h>
+void
+work1 ()
+{
+}
+
+void
+work2 ()
+{
+}
+void
+a10 ()
+{
+#pragma omp parallel
+ {
+#pragma omp single
+ printf ("Beginning work1.\n");
+ work1 ();
+#pragma omp single
+ printf ("Finishing work1.\n");
+#pragma omp single nowait
+ printf ("Finished work1 and beginning work2.\n");
+ work2 ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.12.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.12.1.c
new file mode 100644
index 000000000..fab948dd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.12.1.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+
+#include <stdio.h>
+extern float average (float, float, float);
+void
+a12 (float *x, float *xold, int n, float tol)
+{
+ int c, i, toobig;
+ float error, y;
+ c = 0;
+#pragma omp parallel
+ {
+ do
+ {
+#pragma omp for private(i)
+ for (i = 1; i < n - 1; ++i)
+ {
+ xold[i] = x[i];
+ }
+#pragma omp single
+ {
+ toobig = 0;
+ }
+#pragma omp for private(i,y,error) reduction(+:toobig)
+ for (i = 1; i < n - 1; ++i)
+ {
+ y = x[i];
+ x[i] = average (xold[i - 1], x[i], xold[i + 1]);
+ error = y - x[i];
+ if (error > tol || error < -tol)
+ ++toobig;
+ }
+#pragma omp master
+ {
+ ++c;
+ printf ("iteration %d, toobig=%d\n", c, toobig);
+ }
+ }
+ while (toobig > 0);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.13.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.13.1.c
new file mode 100644
index 000000000..cc0fcc25d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.13.1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+int dequeue (float *a);
+void work (int i, float *a);
+void
+a13 (float *x, float *y)
+{
+ int ix_next, iy_next;
+#pragma omp parallel shared(x, y) private(ix_next, iy_next)
+ {
+#pragma omp critical (xaxis)
+ ix_next = dequeue (x);
+ work (ix_next, x);
+#pragma omp critical (yaxis)
+ iy_next = dequeue (y);
+ work (iy_next, y);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.14.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.14.1.c
new file mode 100644
index 000000000..14a7ed0bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.14.1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+void
+a14 ()
+{
+ int i = 1;
+#pragma omp parallel sections
+ {
+#pragma omp section
+ {
+#pragma omp critical (name)
+ {
+#pragma omp parallel
+ {
+#pragma omp single
+ {
+ i++;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.17.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.17.1.c
new file mode 100644
index 000000000..c460f7566
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.17.1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+void
+a17_1_wrong ()
+{
+ union
+ {
+ int n;
+ float x;
+ } u;
+#pragma omp parallel
+ {
+#pragma omp atomic
+ u.n++;
+#pragma omp atomic
+ u.x += 1.0;
+/* Incorrect because the atomic constructs reference the same location
+ through incompatible types */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.17.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.17.2.c
new file mode 100644
index 000000000..aaaec7ea3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.17.2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+void
+a17_2_wrong ()
+{
+ int x;
+ int *i;
+ float *r;
+ i = &x;
+ r = (float *) &x;
+#pragma omp parallel
+ {
+#pragma omp atomic
+ *i += 1;
+#pragma omp atomic
+ *r += 1.0;
+/* Incorrect because the atomic constructs reference the same location
+ through incompatible types */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.20.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.20.1.c
new file mode 100644
index 000000000..d43e0cf45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.20.1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+void
+a20_wrong ()
+{
+ int a = 1;
+#pragma omp parallel
+ {
+ if (a != 0)
+#pragma omp flush(a) /* { dg-error "'#pragma omp flush' may only" } */
+/* incorrect as flush cannot be immediate substatement
+ of if statement */
+ if (a != 0)
+#pragma omp barrier /* { dg-error "'#pragma omp barrier' may only" } */
+/* incorrect as barrier cannot be immediate substatement
+ of if statement */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.20.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.20.2.c
new file mode 100644
index 000000000..4f1138356
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.20.2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+void
+a20 ()
+{
+ int a = 1;
+#pragma omp parallel
+ {
+ if (a != 0)
+ {
+#pragma omp flush(a)
+ }
+ if (a != 0)
+ {
+#pragma omp barrier
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.2.c
new file mode 100644
index 000000000..a9b81d0c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+void
+work (int i)
+{
+}
+
+void
+a21_wrong (int n)
+{
+ int i;
+#pragma omp for ordered
+ for (i = 0; i < n; i++)
+ {
+/* incorrect because an iteration may not execute more than one
+ ordered region */
+#pragma omp ordered
+ work (i);
+#pragma omp ordered
+ work (i + 1);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.3.c
new file mode 100644
index 000000000..4d1ed6a52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.21.3.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+void work (int);
+
+void
+a21_good (int n)
+{
+ int i;
+#pragma omp for ordered
+ for (i = 0; i < n; i++)
+ {
+ if (i <= 10)
+ {
+#pragma omp ordered
+ work (i);
+ }
+ if (i > 10)
+ {
+#pragma omp ordered
+ work (i + 1);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.1.c
new file mode 100644
index 000000000..e3586838a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+int counter = 0;
+#pragma omp threadprivate(counter)
+int
+increment_counter ()
+{
+ counter++;
+ return (counter);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.2.c
new file mode 100644
index 000000000..7a6e901a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.22.2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+int
+increment_counter_2 ()
+{
+ static int counter = 0;
+#pragma omp threadprivate(counter)
+ counter++;
+ return (counter);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
new file mode 100644
index 000000000..9d8baa37f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+extern int omp_get_num_threads (void);
+int x, y, t, z[1000];
+#pragma omp threadprivate(x)
+void
+a24 (int a)
+{
+ const int c = 1;
+ int i = 0;
+ int l = 0;
+#pragma omp parallel default(none) private(a) shared(z)
+ {
+ int j = omp_get_num_threads ();
+ /* O.K. - j is declared within parallel region */
+ /* O.K. - a is listed in private clause */
+ /* - z is listed in shared clause */
+ x = c; /* O.K. - x is threadprivate */
+ /* - c has const-qualified type */
+ z[i] = y;
+ /* { dg-error "'i' not specified" "" { target *-*-* } 21 } */
+ /* { dg-error "enclosing parallel" "" { target *-*-* } 13 } */
+ /* { dg-error "'y' not specified" "" { target *-*-* } 21 } */
+#pragma omp for firstprivate(y)
+ for (i = 0; i < 10; i++)
+ {
+ z[i] = y; /* O.K. - i is the loop iteration variable */
+ /* - y is listed in firstprivate clause */
+ }
+ z[l] = t;
+ /* { dg-error "'l' not specified" "" { target *-*-* } 31 } */
+ /* { dg-error "'t' not specified" "" { target *-*-* } 31 } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c
new file mode 100644
index 000000000..b655edc10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.26.2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -std=c99" } */
+
+int a;
+void
+g (int k)
+{
+ a = k; /* The global "a", not the private "a" in f */
+}
+
+void
+f (int n)
+{
+ int a = 0;
+#pragma omp parallel for private(a)
+ for (int i = 1; i < n; i++)
+ {
+ a = i;
+ g (a * 2); /* Private copy of "a" */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.27.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.27.1.c
new file mode 100644
index 000000000..faa6ac621
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.27.1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+void
+a27 ()
+{
+ int i, a;
+#pragma omp parallel private(a)
+ {
+#pragma omp parallel for private(a)
+ for (i = 0; i < 10; i++)
+ {
+ /* do work here */
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.30.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.30.1.c
new file mode 100644
index 000000000..e34be4c42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.30.1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+void
+a30 (int n, float *a, float *b)
+{
+ int i;
+#pragma omp parallel
+ {
+#pragma omp for lastprivate(i)
+ for (i = 0; i < n - 1; i++)
+ a[i] = b[i] + b[i + 1];
+ }
+ a[i] = b[i]; /* i == n-1 here */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.31.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.31.1.c
new file mode 100644
index 000000000..cbb3f60df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.31.1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+void
+a31_1 (float *x, int *y, int n)
+{
+ int i, b;
+ float a;
+ a = 0.0;
+ b = 0;
+#pragma omp parallel for private(i) shared(x, y, n) \
+ reduction(+:a) reduction(^:b)
+ for (i = 0; i < n; i++)
+ {
+ a += x[i];
+ b ^= y[i];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.31.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.31.2.c
new file mode 100644
index 000000000..f9da3f4fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.31.2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+void
+a31_2 (float *x, int *y, int n)
+{
+ int i, b, b_p;
+ float a, a_p;
+ a = 0.0;
+ b = 0;
+#pragma omp parallel shared(a, b, x, y, n) \
+ private(a_p, b_p)
+ {
+ a_p = 0.0;
+ b_p = 0;
+#pragma omp for private(i)
+ for (i = 0; i < n; i++)
+ {
+ a_p += x[i];
+ b_p ^= y[i];
+ }
+#pragma omp critical
+ {
+ a += a_p;
+ b ^= b_p;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c
new file mode 100644
index 000000000..d2cb316f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.32.1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+#include <stdlib.h>
+float *work;
+int size;
+float tol;
+void build (void);
+#pragma omp threadprivate(work,size,tol)
+void
+a32 (float t, int n)
+{
+ tol = t;
+ size = n;
+#pragma omp parallel copyin(tol,size)
+ {
+ build ();
+ }
+}
+void
+build ()
+{
+ int i;
+ work = (float *) malloc (sizeof (float) * size);
+ for (i = 0; i < size; ++i)
+ work[i] = tol;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.1.c
new file mode 100644
index 000000000..99c06da6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+#include <stdio.h>
+float x, y;
+#pragma omp threadprivate(x, y)
+void
+init (float a, float b)
+{
+#pragma omp single copyprivate(a,b,x,y)
+ {
+ scanf ("%f %f %f %f", &a, &b, &x, &y);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.2.c
new file mode 100644
index 000000000..a0da739dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.33.2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+#include <stdio.h>
+#include <stdlib.h>
+float
+read_next ()
+{
+ float *tmp;
+ float return_val;
+#pragma omp single copyprivate(tmp)
+ {
+ tmp = (float *) malloc (sizeof (float));
+ } /* copies the pointer only */
+#pragma omp master
+ {
+ scanf ("%f", tmp);
+ }
+#pragma omp barrier
+ return_val = *tmp;
+#pragma omp barrier
+#pragma omp single nowait
+ {
+ free (tmp);
+ }
+ return return_val;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.34.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.34.1.c
new file mode 100644
index 000000000..e5ae7a61e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.34.1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+void
+work (int i, int j)
+{
+}
+
+void
+good_nesting (int n)
+{
+ int i, j;
+#pragma omp parallel default(shared)
+ {
+#pragma omp for
+ for (i = 0; i < n; i++)
+ {
+#pragma omp parallel shared(i, n)
+ {
+#pragma omp for
+ for (j = 0; j < n; j++)
+ work (i, j);
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.34.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.34.2.c
new file mode 100644
index 000000000..7cc265fec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.34.2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+void
+work (int i, int j)
+{
+}
+
+void
+work1 (int i, int n)
+{
+ int j;
+#pragma omp parallel default(shared)
+ {
+#pragma omp for
+ for (j = 0; j < n; j++)
+ work (i, j);
+ }
+}
+void
+good_nesting2 (int n)
+{
+ int i;
+#pragma omp parallel default(shared)
+ {
+#pragma omp for
+ for (i = 0; i < n; i++)
+ work1 (i, n);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c
new file mode 100644
index 000000000..f2c4a672f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+void
+work (int i, int j)
+{
+}
+
+void
+wrong1 (int n)
+{
+#pragma omp parallel default(shared)
+ {
+ int i, j;
+#pragma omp for
+ for (i = 0; i < n; i++)
+ {
+ /* incorrect nesting of loop regions */
+#pragma omp for /* { dg-error "may not be closely nested" } */
+ for (j = 0; j < n; j++)
+ work (i, j);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.2.c
new file mode 100644
index 000000000..165c86e27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+void work (int, int);
+
+void
+work1 (int i, int n)
+{
+ int j;
+ /* incorrect nesting of loop regions */
+#pragma omp for
+ for (j = 0; j < n; j++)
+ work (i, j);
+}
+
+void
+wrong2 (int n)
+{
+#pragma omp parallel default(shared)
+ {
+ int i;
+#pragma omp for
+ for (i = 0; i < n; i++)
+ work1 (i, n);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c
new file mode 100644
index 000000000..64005b307
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.3.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+void work (int, int);
+
+void
+wrong3 (int n)
+{
+#pragma omp parallel default(shared)
+ {
+ int i;
+#pragma omp for
+ for (i = 0; i < n; i++)
+ {
+/* incorrect nesting of regions */
+#pragma omp single /* { dg-error "may not be closely nested" } */
+ work (i, 0);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c
new file mode 100644
index 000000000..5bb6b80b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.4.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+void
+wrong4 (int n)
+{
+#pragma omp parallel default(shared)
+ {
+ int i;
+#pragma omp for
+ for (i = 0; i < n; i++)
+ {
+ work (i, 0);
+ /* incorrect nesting of barrier region in a loop region */
+#pragma omp barrier /* { dg-error "may not be closely nested" } */
+ work (i, 1);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c
new file mode 100644
index 000000000..7b4aee1c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.5.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+void
+wrong5 (int n)
+{
+#pragma omp parallel
+ {
+#pragma omp critical
+ {
+ work (n, 0);
+/* incorrect nesting of barrier region in a critical region */
+#pragma omp barrier /* { dg-error "may not be closely nested" } */
+ work (n, 1);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c
new file mode 100644
index 000000000..d18188b17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.35.6.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+void
+wrong6 (int n)
+{
+#pragma omp parallel
+ {
+#pragma omp single
+ {
+ work (n, 0);
+/* incorrect nesting of barrier region in a single region */
+#pragma omp barrier /* { dg-error "may not be closely nested" } */
+ work (n, 1);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.37.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.37.1.c
new file mode 100644
index 000000000..3581ee27d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.37.1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+extern int omp_get_num_threads (void);
+void work (int i);
+void
+incorrect ()
+{
+ int np, i;
+ np = omp_get_num_threads (); /* misplaced */
+#pragma omp parallel for schedule(static)
+ for (i = 0; i < np; i++)
+ work (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.37.2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.37.2.c
new file mode 100644
index 000000000..64256c78d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.37.2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+extern int omp_get_thread_num (void);
+void work (int i);
+void
+correct ()
+{
+ int i;
+#pragma omp parallel private(i)
+ {
+ i = omp_get_thread_num ();
+ work (i);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c
new file mode 100644
index 000000000..eed21b367
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.8.1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+#include <math.h>
+void
+a8 (int n, int m, float *a, float *b, float *y, float *z)
+{
+ int i;
+#pragma omp parallel
+ {
+#pragma omp for nowait
+ for (i = 1; i < n; i++)
+ b[i] = (a[i] + a[i - 1]) / 2.0;
+#pragma omp for nowait
+ for (i = 0; i < m; i++)
+ y[i] = sqrt (z[i]);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.9.1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.9.1.c
new file mode 100644
index 000000000..45be33f16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/appendix-a/a.9.1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+void XAXIS ();
+void YAXIS ();
+void ZAXIS ();
+void
+a9 ()
+{
+#pragma omp parallel sections
+ {
+#pragma omp section
+ XAXIS ();
+#pragma omp section
+ YAXIS ();
+#pragma omp section
+ ZAXIS ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/asm-1.c
new file mode 100644
index 000000000..ced31f3b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/asm-1.c
@@ -0,0 +1,19 @@
+/* PR middle-end/30263 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+void
+foo (void)
+{
+ int s0, s1 = 5, s2 = 6;
+ int p0, p1, p2;
+ int f0 = 4, f1 = 5, f2 = 6;
+#pragma omp parallel shared (s0, s1, s2) private (p0, p1, p2) \
+ firstprivate (f0, f1, f2)
+ {
+ asm ("" : "=m" (p0) : "m" (p1), "mr" (p2));
+ if (omp_get_thread_num () == 0)
+ asm ("" : "=m" (s0) : "m" (s1), "mr" (s2));
+ asm ("" : "=m" (f0) : "m" (f1), "mr" (f2));
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/atomic-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/atomic-5.c
new file mode 100644
index 000000000..0ad9d3b48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/atomic-5.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+
+int x;
+const int y;
+int bar(void);
+
+void f1(void)
+{
+ register int z;
+
+ #pragma omp atomic
+ x %= 2; /* { dg-error "invalid operator" } */
+ #pragma omp atomic
+ x = x + 1;
+ #pragma omp atomic
+ x = 1; /* { dg-error "invalid form" } */
+ #pragma omp atomic
+ ++y; /* { dg-error "read-only variable" } */
+ #pragma omp atomic
+ y--; /* { dg-error "read-only variable" } */
+ #pragma omp atomic
+ y += 1; /* { dg-error "read-only variable" } */
+ #pragma omp atomic
+ z += 1; /* { dg-error "register variable" } */
+ #pragma omp atomic
+ bar(); /* { dg-error "invalid operator" } */
+ #pragma omp atomic
+ bar() += 1; /* { dg-error "lvalue required" } */
+ #pragma omp atomic a /* { dg-error "expected end of line" } */
+ x++;
+ #pragma omp atomic
+ ; /* { dg-error "expected expression" } */
+ #pragma omp atomic
+ #pragma omp atomic /* { dg-error "expected expression" } */
+ ;
+ /* Check that we didn't get stuck on the pragma eol marker. */
+ undef; /* { dg-error "" } */
+ /* { dg-message "undeclared identifier is reported only once" "reminder" { target *-*-* } 37 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/atomic-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/atomic-6.c
new file mode 100644
index 000000000..0d56becd8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/atomic-6.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+int x[10], z;
+double y[10];
+
+void f1(void)
+{
+ #pragma omp atomic
+ x[z] /= y[z];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/barrier-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/barrier-1.c
new file mode 100644
index 000000000..ef7c9afb1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/barrier-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-gimple" } */
+
+void f1(void)
+{
+ #pragma omp barrier
+}
+
+void f2(_Bool p)
+{
+ if (p)
+ {
+ #pragma omp barrier
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_barrier" 2 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/barrier-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/barrier-2.c
new file mode 100644
index 000000000..3787c35a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/barrier-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+void f1(void)
+{
+ #pragma omp barrier a /* { dg-error "expected end of line" } */
+}
+
+/* OpenMP 2.5, section 2.7.3:
+
+ Note that because the barrier construct does not have a C language
+ statement as part of its syntax, there are some restrictions on its
+ placement within a program. The barrier directive may only be placed
+ in the program at a position where ignoring or deleting the directive
+ would result in a program with correct syntax. */
+
+void f2(void)
+{
+ label: /* { dg-error "label at end of compound statement" } */
+ #pragma omp barrier
+}
+
+void f3(_Bool p)
+{
+ if (p)
+ #pragma omp barrier /* { dg-error "compound statements" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-1.c
new file mode 100644
index 000000000..dd7fe7783
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-1.c
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+void foo()
+{
+ bad1:
+ #pragma omp parallel
+ goto bad1; // { dg-error "invalid branch" }
+
+ goto bad2; // { dg-error "invalid entry" }
+ #pragma omp parallel
+ {
+ bad2: ;
+ }
+
+ #pragma omp parallel
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-10.c
new file mode 100644
index 000000000..76ee39745
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-10.c
@@ -0,0 +1,40 @@
+// { dg-do compile }
+
+void foo(int i)
+{
+ int j;
+ switch (i) // { dg-error "invalid entry" }
+ {
+ #pragma omp parallel
+ { case 0:; }
+ }
+ switch (i) // { dg-error "invalid entry" }
+ {
+ #pragma omp for
+ for (j = 0; j < 10; ++ j)
+ { case 1:; }
+ }
+ switch (i) // { dg-error "invalid entry" }
+ {
+ #pragma omp critical
+ { case 2:; }
+ }
+ switch (i) // { dg-error "invalid entry" }
+ {
+ #pragma omp master
+ { case 3:; }
+ }
+ switch (i) // { dg-error "invalid entry" }
+ {
+ #pragma omp sections
+ { case 4:;
+ #pragma omp section
+ { case 5:; }
+ }
+ }
+ switch (i) // { dg-error "invalid entry" }
+ {
+ #pragma omp ordered
+ { default:; }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-11.c
new file mode 100644
index 000000000..c2800061b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-11.c
@@ -0,0 +1,19 @@
+/* PR c++/24516 */
+/* { dg-do compile } */
+
+void
+bar (int *p)
+{
+ int m;
+#pragma omp parallel for
+ for (m = 0; m < 1000; ++m)
+ switch (p[m])
+ {
+ case 1:
+ p[m] = 2;
+ break;
+ default:
+ p[m] = 3;
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-2.c
new file mode 100644
index 000000000..4c56add57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-2.c
@@ -0,0 +1,32 @@
+// { dg-do compile }
+
+void foo()
+{
+ int i, j;
+
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ break; // { dg-error "break" }
+
+ bad1:
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ goto bad1; // { dg-error "invalid branch" }
+
+ goto bad2; // { dg-error "invalid entry" }
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ {
+ bad2: ;
+ }
+
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ for (j = 0; j < 10; ++j)
+ if (i == j)
+ break;
+
+ #pragma omp for
+ for (i = 0; i < 10; ++i)
+ continue;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-3.c
new file mode 100644
index 000000000..b4530e9d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-3.c
@@ -0,0 +1,58 @@
+// { dg-do compile }
+
+extern int test(int);
+void foo()
+{
+ int i;
+
+ for (i = 0; i < 10; ++i)
+ {
+ #pragma omp sections
+ {
+ continue; // { dg-error "invalid branch" }
+ }
+ }
+
+ #pragma omp sections
+ {
+ #pragma omp section
+ { bad1: ; }
+ #pragma omp section
+ goto bad1; // { dg-error "invalid branch" }
+ }
+
+ #pragma omp sections
+ {
+ goto bad2; // { dg-error "invalid branch" }
+ }
+ bad2:;
+
+ goto bad3; // { dg-error "invalid entry" }
+ #pragma omp sections
+ {
+ bad3: ;
+ }
+
+ #pragma omp sections
+ {
+ {
+ goto ok1;
+ ok1:;
+ }
+ #pragma omp section
+ for (i = 0; i < 10; ++i)
+ if (test(i))
+ break;
+ else
+ continue;
+
+ #pragma omp section
+ switch (i)
+ {
+ case 0:
+ break;
+ default:
+ test(i);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-4.c
new file mode 100644
index 000000000..61f490c00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-4.c
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+void foo()
+{
+ #pragma omp critical
+ {
+ return; // { dg-error "invalid branch" }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-5.c
new file mode 100644
index 000000000..741049fdd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-5.c
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+void foo()
+{
+ #pragma omp master
+ {
+ goto bad1; // { dg-error "invalid branch" }
+ }
+
+ #pragma omp master
+ {
+ bad1:
+ return; // { dg-error "invalid branch" }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-6.c
new file mode 100644
index 000000000..87e6392e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-6.c
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+void foo()
+{
+ #pragma omp ordered
+ {
+ return; // { dg-error "invalid branch" }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-7.c
new file mode 100644
index 000000000..2bc1cdb57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-7.c
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+void foo()
+{
+ int i, j;
+ for (i = 0; i < 10; ++i)
+ {
+ #pragma omp for
+ for (j = ({ continue; 0; }); // { dg-error "invalid branch" }
+ j < ({ continue; 10; }); // { dg-error "invalid branch" }
+ j += ({ continue; 1; })) // { dg-error "invalid branch" }
+ continue;
+
+ #pragma omp for
+ for (j = ({ break; 0; }); // { dg-error "invalid branch" }
+ j < ({ break; 10; }); // { dg-error "invalid branch" }
+ j += ({ break; 1; })) // { dg-error "invalid branch" }
+ break; // { dg-error "break" }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-8.c
new file mode 100644
index 000000000..3c717d927
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-8.c
@@ -0,0 +1,11 @@
+// { dg-do compile }
+// PR 24451
+
+int foo()
+{
+ int i;
+
+ #pragma omp parallel for
+ for (i = 0; i < 10; ++i)
+ return 0; // { dg-error "invalid branch" }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-9.c
new file mode 100644
index 000000000..9217cb749
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/block-9.c
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+void foo(int i)
+{
+ int j;
+ switch (i) // { dg-error "invalid entry" }
+ {
+ #pragma omp parallel
+ { case 0:; }
+ #pragma omp for
+ for (j = 0; j < 10; ++ j)
+ { case 1:; }
+ #pragma omp critical
+ { case 2:; }
+ #pragma omp master
+ { case 3:; }
+ #pragma omp sections
+ { case 4:;
+ #pragma omp section
+ { case 5:; }
+ }
+ #pragma omp ordered
+ { default:; }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/clause-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/clause-1.c
new file mode 100644
index 000000000..fc7d72b7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/clause-1.c
@@ -0,0 +1,94 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+#define p parallel
+
+extern void bar (void);
+extern char q[];
+int t;
+#pragma omp threadprivate (t)
+
+void
+foo (int x)
+{
+ char *pp;
+ struct S { int i; int j; } s;
+ char a[32];
+ double d;
+ int i;
+ const int c = 8;
+#pragma omp p shared (x, x) /* { dg-error "more than once" } */
+ ;
+#pragma omp p private (x) private (x) /* { dg-error "more than once" } */
+ ;
+#pragma omp p shared (x) firstprivate (x) /* { dg-error "more than once" } */
+ ;
+#pragma omp p firstprivate (x, x) /* { dg-error "more than once" } */
+ ;
+#pragma omp p for shared (x) lastprivate (x) /* { dg-error "more than" } */
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p for private (x) lastprivate (x) /* { dg-error "more than" } */
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p for lastprivate (x, x) /* { dg-error "more than once" } */
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp single private (x) copyprivate (x) /* { dg-error "more than" } */
+ ;
+#pragma omp p shared (bar) /* { dg-error "is not a variable" } */
+ ;
+#pragma omp p private (bar) /* { dg-error "is not a variable" } */
+ ;
+#pragma omp p firstprivate (bar) /* { dg-error "is not a variable" } */
+ ;
+#pragma omp p reduction (+:pp) /* { dg-error "user defined reduction not found for" } */
+ ;
+#pragma omp p reduction (*:s) /* { dg-error "user defined reduction not found for" } */
+ ;
+#pragma omp p reduction (-:a) /* { dg-error "user defined reduction not found for" } */
+ ;
+ d = 0;
+#pragma omp p reduction (*:d)
+ ;
+#pragma omp p reduction (|:d) /* { dg-error "has invalid type for" } */
+ ;
+#pragma omp p reduction (&&:d) /* { dg-error "has invalid type for" } */
+ ;
+#pragma omp p copyin (d) /* { dg-error "must be 'threadprivate'" } */
+ ;
+#pragma omp p copyin (x) /* { dg-error "must be 'threadprivate'" } */
+ ;
+#pragma omp p for firstprivate (x) lastprivate (x)
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p private (q) /* { dg-error "incomplete type" } */
+ ;
+#pragma omp p firstprivate (q) /* { dg-error "incomplete type" } */
+ ;
+#pragma omp p for lastprivate (q) /* { dg-error "incomplete type" } */
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p shared (t) /* { dg-error "predetermined 'threadprivate'" } */
+ ;
+#pragma omp p private (t) /* { dg-error "predetermined 'threadprivate'" } */
+ ;
+#pragma omp p firstprivate (t) /* { dg-error "predetermined 'threadpriv" } */
+ ;
+#pragma omp p for lastprivate (t) /* { dg-error "predetermined 'threadpr" } */
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p reduction (*:t) /* { dg-error "predetermined 'threadprivate" } */
+ ;
+#pragma omp p shared (c) /* { dg-error "predetermined 'shared'" } */
+ ;
+#pragma omp p private (c) /* { dg-error "predetermined 'shared'" } */
+ ;
+#pragma omp p firstprivate (c)
+ ;
+#pragma omp p for lastprivate (c) /* { dg-error "predetermined 'shared'" } */
+ for (i = 0; i < 10; i++)
+ ;
+#pragma omp p reduction (*:c) /* { dg-error "predetermined 'shared'" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/clause-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/clause-2.c
new file mode 100644
index 000000000..4b12fc8f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/clause-2.c
@@ -0,0 +1,23 @@
+/* PR c/34506 */
+/* { dg-do compile } */
+
+#define p parallel
+
+void
+foo (int x)
+{
+#pragma omp p num_threads (4) if (1) private (x)
+ ;
+#pragma omp p num_threads(4)if(1)private(x)
+ ;
+#pragma omp p num_threads (4), if (1) , private (x)
+ ;
+#pragma omp p num_threads(4),if(1),private(x)
+ ;
+#pragma omp p, num_threads (4), if (1), private (x) /* { dg-error "clause before" } */
+ ;
+#pragma omp p num_threads (4), if (1), private (x), /* { dg-error "clause before" } */
+ ;
+#pragma omp p num_threads (4), , if (1), private (x) /* { dg-error "clause before" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/collapse-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/collapse-1.c
new file mode 100644
index 000000000..89b76bb66
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/collapse-1.c
@@ -0,0 +1,92 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+int i, j, k;
+extern int foo (void);
+
+void
+f1 (void)
+{
+ #pragma omp for collapse (2)
+ for (i = 0; i < 5; i++)
+ ; /* { dg-error "not enough perfectly nested" } */
+ {
+ for (j = 0; j < 5; j++)
+ ;
+ }
+}
+
+void
+f2 (void)
+{
+ #pragma omp for collapse (2)
+ for (i = 0; i < 5; i++)
+ {
+ {
+ {
+ for (j = 0; j < 5; j++)
+ {
+ }
+ }
+ }
+ }
+}
+
+void
+f3 (void)
+{
+ #pragma omp for collapse (2)
+ for (i = 0; i < 5; i++)
+ {
+ int k = foo (); /* { dg-error "not enough perfectly nested" } */
+ {
+ {
+ for (j = 0; j < 5; j++)
+ {
+ }
+ }
+ }
+ }
+}
+
+void
+f4 (void)
+{
+ #pragma omp for collapse (2)
+ for (i = 0; i < 5; i++)
+ {
+ {
+ for (j = 0; j < 5; j++)
+ ;
+ foo (); /* { dg-error "collapsed loops not perfectly nested before" } */
+ }
+ }
+}
+
+void
+f5 (void)
+{
+ #pragma omp for collapse (2)
+ for (i = 0; i < 5; i++)
+ {
+ {
+ for (j = 0; j < 5; j++)
+ ;
+ }
+ foo (); /* { dg-error "collapsed loops not perfectly nested before" } */
+ }
+}
+
+void
+f6 (void)
+{
+ #pragma omp for collapse (2)
+ for (i = 0; i < 5; i++)
+ {
+ {
+ for (j = 0; j < 5; j++)
+ ;
+ }
+ }
+ foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/combined-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/combined-1.c
new file mode 100644
index 000000000..7e23c3256
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/combined-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fopenmp -fdump-tree-optimized" } */
+
+int a[10];
+int foo (void)
+{
+ int i;
+#pragma omp parallel for schedule(runtime)
+ for (i = 0; i < 10; i++)
+ a[i] = i;
+#pragma omp parallel
+#pragma omp for schedule(runtime)
+ for (i = 0; i < 10; i++)
+ a[i] = 10 - i;
+#pragma omp parallel
+ {
+#pragma omp for schedule(runtime)
+ for (i = 0; i < 10; i++)
+ a[i] = i;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_runtime" 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/complex-1.c
new file mode 100644
index 000000000..0858ac9d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/complex-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -O1" } */
+/* PR middle-end/30143 */
+
+
+int f (int n)
+{
+ int i;
+ _Complex float t;
+#pragma omp parallel
+ for (i = 1; i < n - 1; ++i)
+ t+=1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/copyin-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/copyin-1.c
new file mode 100644
index 000000000..117f82f81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/copyin-1.c
@@ -0,0 +1,27 @@
+// { dg-do compile }
+// { dg-require-effective-target tls }
+
+int i, j;
+
+#pragma omp threadprivate (i)
+
+void bar(void);
+void foo(void)
+{
+ int k;
+ extern int l;
+ extern int m;
+
+#pragma omp threadprivate (m)
+
+ #pragma omp parallel copyin(i)
+ bar();
+ #pragma omp parallel copyin(j) // { dg-error "threadprivate" }
+ bar();
+ #pragma omp parallel copyin(k) // { dg-error "threadprivate" }
+ bar();
+ #pragma omp parallel copyin(l) // { dg-error "threadprivate" }
+ bar();
+ #pragma omp parallel copyin(m)
+ bar();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-1.c
new file mode 100644
index 000000000..6f3348c88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (void)
+{
+ #pragma omp critical
+ bar(0);
+
+ /* Note that "name" is in its own namespace, thus this foo is not
+ the same as the function. */
+ #pragma omp critical(foo)
+ {
+ bar(1);
+ bar(2);
+ }
+
+ #pragma omp critical
+ #pragma omp critical(foo)
+ bar(3);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_critical_start" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_critical_end" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_critical_name_start" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_critical_name_end" 2 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-2.c
new file mode 100644
index 000000000..d1ba3963f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+void f1(void)
+{
+ #pragma omp critical a /* { dg-error "expected" } */
+ ;
+ #pragma omp critical ( /* { dg-error "expected identifier" } */
+ ;
+ #pragma omp critical (a /* { dg-error "expected .\\)." } */
+ ;
+ #pragma omp critical (a b) /* { dg-error "expected .\\)." } */
+} /* { dg-error "expected expression" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-3.c
new file mode 100644
index 000000000..c0046f571
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-3.c
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-options "-fopenmp -fdump-tree-ompexp" }
+
+void bar(void);
+void foo(void)
+{
+ #pragma omp critical (xyzzy)
+ bar();
+}
+
+// { dg-final { scan-tree-dump-times "\\&\\.gomp_critical_user_xyzzy" 2 "ompexp" } }
+// { dg-final { cleanup-tree-dump "ompexp" } }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-4.c
new file mode 100644
index 000000000..8d4f6a791
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/critical-4.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+
+extern void bar(int);
+
+void
+foo1 (void)
+{
+ #pragma omp critical
+ #pragma omp critical(foo)
+ #pragma omp critical(bar)
+ bar (0);
+}
+
+void
+foo2 (void)
+{
+ #pragma omp critical
+ #pragma omp critical /* { dg-error "with the same name" } */
+ bar (0);
+}
+
+void
+foo3 (void)
+{
+ #pragma omp critical(foo)
+ #pragma omp critical(foo) /* { dg-error "with the same name" } */
+ bar (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
new file mode 100644
index 000000000..259e2c0ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
@@ -0,0 +1,100 @@
+/* Test parsing of #pragma omp declare simd */
+/* { dg-do compile } */
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) \
+ linear (c : 4) simdlen (8) notinbranch
+#pragma omp declare simd uniform (c) aligned (b : 4 * sizeof (int)) linear (a \
+ : 4) simdlen (4) inbranch
+int f1 (int a, int *b, int c);
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int f2 (int a, int *b, int c)
+{
+ return a + *b + c;
+}
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (long long)) linear (c : 4) simdlen (8)
+__extension__
+long long f3 (long long a, long long *b, long long c);
+
+int
+f4 (int x)
+{
+ #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+ __extension__ __extension__ __extension__
+ extern int f5 (int a, int *b, int c);
+ {
+ x++;
+ #pragma omp declare simd simdlen (4) linear (c)
+ extern int f6 (int a, int *b, int c);
+ }
+ return x;
+}
+
+#pragma omp declare simd simdlen (16)
+int
+f7 (int x)
+{
+ #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+ extern int f8 (int a, int *b, int c);
+ return x;
+}
+
+int
+f9 (int x)
+{
+ if (x)
+ #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+ extern int f10 (int a, int *b, int c);
+ while (x < 10)
+ #pragma omp declare simd simdlen (8) aligned (b : 8 * sizeof (int))
+ extern int f11 (int a, int *b, int c);
+ return x;
+}
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int f12 (int c; int *b; int a; int a, int *b, int c);
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int
+f13 (int c; int *b; int a; int a, int *b, int c)
+{
+ return a + *b + c;
+}
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int
+f14 (a, b, c)
+ int a, c;
+ int *b;
+{
+ return a + *b + c;
+}
+
+#pragma omp declare simd uniform (a) aligned (b : 8 * sizeof (int)) linear (c : 4) simdlen (8)
+int
+f15 (int a, int *b, int c)
+{
+ return a + *b + c;
+}
+
+#pragma omp declare simd uniform (d) aligned (e : 8 * sizeof (int)) linear (f : 4) simdlen (8)
+int f15 (int d, int *e, int f);
+
+#pragma omp declare simd aligned (g : sizeof (*g)) linear (h : 2 * sizeof (g[0]) + sizeof (h)) simdlen (4)
+int f16 (long *g, int h);
+
+#pragma omp declare simd aligned (h : sizeof (*h)) linear (g : 2 * sizeof (h[0]) + sizeof (g)) simdlen (4)
+int f17 (int g, long *h)
+{
+ return g + h[0];
+}
+
+#pragma omp declare simd aligned (i : sizeof (*i)) linear (j : 2 * sizeof (i[0]) + sizeof (j)) simdlen (4)
+int
+f18 (j, i)
+ long *i;
+ int j;
+{
+ return j + i[0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/declare-simd-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/declare-simd-2.c
new file mode 100644
index 000000000..c0a42a2ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/declare-simd-2.c
@@ -0,0 +1,54 @@
+/* Test parsing of #pragma omp declare simd */
+/* { dg-do compile } */
+
+#pragma omp declare simd
+int a; /* { dg-error "not immediately followed by a function declaration or definition" } */
+
+#pragma omp declare simd
+int fn1 (int a), fn2 (int a); /* { dg-error "not immediately followed by a single function declaration or definition" } */
+
+#pragma omp declare simd
+int b, fn3 (int a); /* { dg-error "not immediately followed by a function declaration or definition" } */
+
+#pragma omp declare simd linear (a)
+int fn4 (int a), c; /* { dg-error "not immediately followed by a function declaration or definition" } */
+
+int t;
+
+#pragma omp declare simd
+#pragma omp declare simd
+#pragma omp threadprivate(t) /* { dg-error "must be followed by function declaration or definition or another" } */
+int fn5 (int a);
+
+#pragma omp declare simd inbranch notinbranch /* { dg-error "clause is incompatible with" } */
+int fn6 (int);
+
+#pragma omp declare simd aligned (a, b)
+int fn7 (int *a, int b[64]);
+
+#pragma omp declare simd aligned (a) /* { dg-error "neither a pointer nor an array" } */
+int fn8 (int a);
+
+#pragma omp declare simd aligned (c) /* { dg-error "neither a pointer nor an array" } */
+int fn9 (float c);
+
+#pragma omp declare simd aligned (d) /* { dg-error "neither a pointer nor an array" } */
+int fn10 (double d);
+
+struct D { int d; };
+
+#pragma omp declare simd aligned (e) /* { dg-error "neither a pointer nor an array" } */
+int fn11 (struct D e);
+
+#pragma omp declare simd linear(a:7) uniform(a) /* { dg-error "appears more than once" } */
+int f12 (int a);
+#pragma omp declare simd linear(a) linear(a) /* { dg-error "appears more than once" } */
+int f13 (int a);
+#pragma omp declare simd linear(a) linear(a:7) /* { dg-error "appears more than once" } */
+int f14 (int a);
+#pragma omp declare simd linear(a:6) linear(a:6)/* { dg-error "appears more than once" } */
+int f15 (int a);
+#pragma omp declare simd uniform(a) uniform(a) /* { dg-error "appears more than once" } */
+int f16 (int a);
+#pragma omp declare simd uniform(a) aligned (a: 32)
+int f17 (int *a);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/empty.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/empty.c
new file mode 100644
index 000000000..6a21c0460
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/empty.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fopenmp -fdump-tree-ompexp" } */
+
+main()
+{
+#pragma omp parallel
+ {;}
+}
+
+/* There should not be a GOMP_parallel_start call. */
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_start" 0 "ompexp"} } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/flush-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/flush-1.c
new file mode 100644
index 000000000..d1a4d4a5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/flush-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-gimple" } */
+
+void f1(void)
+{
+ #pragma omp flush
+}
+
+int x, y, z;
+
+void f2(_Bool p)
+{
+ if (p)
+ {
+ #pragma omp flush (x)
+ }
+ else
+ {
+ #pragma omp flush (x, y, z)
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "__sync_synchronize" 3 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/flush-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/flush-2.c
new file mode 100644
index 000000000..25878c85b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/flush-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-message "undeclared identifier is reported only once" "reminder" { target *-*-* } 0 } */
+void f1(void)
+{
+ #pragma omp flush a /* { dg-error "expected" } */
+ #pragma omp flush ( /* { dg-error "expected identifier" } */
+ #pragma omp flush (b /* { dg-error "undeclared|expected|for each" } */
+ #pragma omp flush (c d) /* { dg-error "undeclared|expected" } */
+ #pragma omp flush (e) /* { dg-error "undeclared" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-1.c
new file mode 100644
index 000000000..384293e82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-1.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fshow-column" } */
+
+void foo (int j, int k)
+{
+ int i;
+
+ /* Valid loops. */
+ #pragma omp for
+ for (i = 0; i < 10; i++)
+ baz (i);
+
+ #pragma omp for
+ for (i = j; i <= 10; i+=4)
+ baz (i);
+
+ #pragma omp for
+ for (i = j; i > 0; i = i - 1)
+ baz (j);
+
+ #pragma omp for
+ for (i = j; i >= k; i--)
+ baz (i);
+
+ /* Malformed parallel loops. */
+ #pragma omp for
+ i = 0; /* { dg-error "3:for statement expected" } */
+ for ( ; i < 10; )
+ {
+ baz (i);
+ i++;
+ }
+
+ #pragma omp for
+ for (i = 0; ; i--) /* { dg-error "missing controlling predicate" } */
+ {
+ if (i >= 10)
+ break; /* { dg-error "break" } */
+ baz (i);
+ }
+
+ #pragma omp for
+ for (i = 0; i < 10 && j > 4; i-=3) /* { dg-error "15:invalid controlling predicate" } */
+ baz (i);
+
+ #pragma omp for
+ for (i = 0; i < 10; i-=3, j+=2) /* { dg-error "27:invalid increment expression" } */
+ baz (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-10.c
new file mode 100644
index 000000000..f21404249
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-10.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+ int i;
+
+ #pragma omp for schedule(runtime) ordered
+ for (i = 0; i < n; ++i)
+ bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_ordered_runtime_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_ordered_runtime_next" 1 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-11.c
new file mode 100644
index 000000000..8c747cdb9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-11.c
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fopenmp" } */
+
+extern void baz (int);
+
+void foo (int j, int k)
+{
+ int i;
+
+ /* Valid loops. */
+ #pragma omp for
+ for (i = 0; i < 10; i++)
+ baz (i);
+
+ #pragma omp for
+ for (i = j; i <= 10; i+=4)
+ baz (i);
+
+ #pragma omp for
+ for (i = j; i > 0; i = i - 1)
+ baz (j);
+
+ #pragma omp for
+ for (i = j; i >= k; i--)
+ baz (i);
+
+ #pragma omp for
+ for (int l = j; l < 10; l++)
+ baz (l);
+
+ /* Malformed parallel loops. */
+ #pragma omp for
+ i = 0; /* { dg-error "for statement expected" } */
+ for ( ; i < 10; )
+ {
+ baz (i);
+ i++;
+ }
+
+ #pragma omp for
+ for (i = 0; ; i--) /* { dg-error "missing controlling predicate" } */
+ {
+ if (i >= 10)
+ break; /* { dg-error "break" } */
+ baz (i);
+ }
+
+ #pragma omp for
+ for (i = 0;
+ i < 10 && j > 4; /* { dg-error "invalid controlling predicate" } */
+ i-=3)
+ baz (i);
+
+ #pragma omp for
+ for (i = 0;
+ i < 10;
+ i-=3, j+=2) /* { dg-error "invalid increment expression" } */
+ baz (i);
+
+ int m = 0;
+ #pragma omp for
+ for (; m < 10; m++) /* { dg-error "expected" } */
+ baz (m);
+
+ m = 0;
+ #pragma omp for
+ for (int n = 0; m < 10; m++) /* { dg-error "invalid controlling predicate|invalid increment expression" } */
+ baz (m);
+
+ #pragma omp for
+ for (m = 0; m < 10; i++) /* { dg-error "invalid increment expression" } */
+ baz (m);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-12.c
new file mode 100644
index 000000000..98318d7d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-12.c
@@ -0,0 +1,12 @@
+int foo (void)
+{
+ int i, a;
+
+ a = 30;
+
+ #pragma omp parallel for lastprivate (a)
+ for (i = 0; i < 10; i++)
+ a = a + i;
+
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-13.c
new file mode 100644
index 000000000..607de49c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-13.c
@@ -0,0 +1,18 @@
+// At one point in development, a typo disabled the remapping of the
+// for iteration variable as private.
+
+// { dg-do compile }
+// { dg-options "-fopenmp -fdump-tree-ompexp" }
+
+extern void bar(int);
+void foo(void)
+{
+ int i;
+
+#pragma omp parallel for default(none)
+ for (i = 0; i < 10; i++)
+ bar(i);
+}
+
+// { dg-final { scan-tree-dump-times "omp_data_o" 0 "ompexp" } }
+// { dg-final { cleanup-tree-dump "ompexp" } }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-14.c
new file mode 100644
index 000000000..fb2641370
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-14.c
@@ -0,0 +1,19 @@
+// { dg-do compile }
+
+extern int printf (const char *, ...);
+extern void foo (int *);
+
+int main (void)
+{
+ double d = 6;
+ int i = 1, j = 6, k = 8;
+#pragma omp parallel shared(d) private(i) num_threads (4)
+ {
+ i = 4;
+#pragma omp for lastprivate(j)
+ for (j = 1; j <= k; j++)
+ printf ("%s %d %d %d %p %g\n", "Hello, World!", i, j, k, &j, d);
+ printf ("%s %d %g\n", "Hello, World!", i, d);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-15.c
new file mode 100644
index 000000000..28c2c926c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-15.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void foo()
+{
+ long n = 10;
+ int i;
+#pragma omp for
+ for (i=0; i < n; ++i) ;
+#pragma omp for
+ for (i=0; n > i; ++i) ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-16.c
new file mode 100644
index 000000000..2f221e4c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-16.c
@@ -0,0 +1,18 @@
+// PR 24703
+// { dg-do compile }
+
+void work(int);
+int work_param;
+int sphinx_omp_thread_count;
+int schedule_loop_cap;
+
+int measure_omp_parallel_for_dynamic (void)
+{
+ int j;
+
+#pragma omp parallel for schedule(dynamic)
+ for(j=0; j < sphinx_omp_thread_count * schedule_loop_cap; j++)
+ work(work_param);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-17.c
new file mode 100644
index 000000000..1c51f1a4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-17.c
@@ -0,0 +1,67 @@
+/* { dg-do compile } */
+extern int bar (int);
+
+void
+foo (void)
+{
+ int j, k = 1, l = 30, m = 4;
+ long int o = 4;
+ long long int p = 0;
+#pragma omp for
+ for (j = k; j <= l; j += m - 1)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j += (m - 1))
+ ;
+#pragma omp for
+ for (j = k; j <= l; j += bar (m - 1))
+ ;
+#pragma omp for
+ for (j = k; j <= l; j = j + m - 1)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j = j + (m - 1))
+ ;
+#pragma omp for
+ for (j = k; j <= l; j = j + bar (m - 1))
+ ;
+#pragma omp for
+ for (j = ({ int n; n = k; n; }); j <= l; j++)
+ ;
+#pragma omp for
+ for (j = k; j <= ({ int n; n = l; n; }); j++)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j += ({ int n; n = 1; n; }))
+ ;
+#pragma omp for
+ for (j = k; j <= l; j += m + 1)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j += o)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j = j + o)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j = o + 1 + j)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j = o + m + j)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j += o + p)
+ ;
+#pragma omp for
+ for (j = k; j <= l; j = j + o + p)
+ ;
+#pragma omp for
+ for (j = l; j >= k; j -= o)
+ ;
+#pragma omp for
+ for (j = l; j >= k; j -= p)
+ ;
+#pragma omp for
+ for (j = l; j >= k; j -= o + p)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-18.c
new file mode 100644
index 000000000..545f271c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-18.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fopenmp -fdump-tree-ompexp" } */
+
+void
+foo (int *a, int i)
+{
+ int j, k = 1, l = 30, m = 4;
+#pragma omp parallel for num_threads (3 * i) schedule (dynamic, i * 4)
+ for (j = 0; j <= l; j++)
+ a[j] = 1;
+#pragma omp parallel for num_threads (3 * i) schedule (dynamic, i * 4)
+ for (j = k; j <= l; j += (m - 1))
+ a[j] = 2;
+#pragma omp parallel for num_threads (3 * i) schedule (dynamic, 4)
+ for (j = 0; j <= l; j++)
+ a[j] = 3;
+#pragma omp parallel for num_threads (3 * i) schedule (dynamic, 4)
+ for (j = k; j <= l; j += (m - 1))
+ a[j] = 4;
+}
+
+void
+bar (int *a, int i)
+{
+ int j, k = 1, l = 30, m = 4;
+#pragma omp parallel for num_threads (3 * i) schedule (guided, i * 4)
+ for (j = 0; j <= l; j++)
+ a[j] = 1;
+#pragma omp parallel for num_threads (3 * i) schedule (guided, i * 4)
+ for (j = k; j <= l; j += (m - 1))
+ a[j] = 2;
+#pragma omp parallel for num_threads (3 * i) schedule (guided, 4)
+ for (j = 0; j <= l; j++)
+ a[j] = 3;
+#pragma omp parallel for num_threads (3 * i) schedule (guided, 4)
+ for (j = k; j <= l; j += (m - 1))
+ a[j] = 4;
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_dynamic_start" 4 "ompexp" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop_guided_start" 4 "ompexp" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-19.c
new file mode 100644
index 000000000..a202ba479
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-19.c
@@ -0,0 +1,21 @@
+/* Verify that if GOMP_parallel_loop_dynamic_start is used, variables
+ mentioned in the INIT, COND and INCR expressions aren't unnecessarily
+ copied to the omp_fn function. */
+/* { dg-do compile } */
+/* { dg-options "-O -fopenmp -fdump-tree-gimple" } */
+
+void foo (int *a, int i, int j, int k, int l, int m)
+{
+#pragma omp parallel for num_threads (3 * i) schedule (dynamic, i * 4)
+ for (j = 0; j <= (6 * l + 4 * k); j++)
+ a[j] = 1;
+#pragma omp parallel for num_threads (3 * i) schedule (dynamic, i * 4)
+ for (j = m; j <= l; j += (k + l - m))
+ a[j] = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "shared\\(a\\)" 2 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "shared\\(k\\)" 0 "gimple" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "shared\\(l\\)" 0 "gimple" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "shared\\(m\\)" 0 "gimple" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-2.c
new file mode 100644
index 000000000..37e5929af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+void foo()
+{
+ int i;
+
+ #pragma omp for nowait
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for nowait nowait /* { dg-error "too many" } */
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for ordered
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for ordered ordered /* { dg-error "too many" } */
+ for (i = 0; i < 10; ++i) ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-3.c
new file mode 100644
index 000000000..f3b0dbda7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-3.c
@@ -0,0 +1,62 @@
+// { dg-do compile }
+
+int bar ();
+
+void foo()
+{
+ int i;
+
+ #pragma omp for schedule // { dg-error "expected '\\('" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule static // { dg-error "expected '\\('" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( // { dg-error "invalid schedule kind" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( static // { dg-error "expected" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( static )
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( foo ) // { dg-error "invalid schedule kind" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( static 1 // { dg-error "expected" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( static 1 ) nowait // { dg-error "expected" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( static, 1 ) nowait
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( static, 1, 1 ) nowait // { dg-error "expected '\\)'" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( static, 1 + 1 ) nowait
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule ( static, 1.0 ) // { dg-error "expected integer expression" }
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule (dynamic)
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule (dynamic, bar ())
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule (guided)
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule (guided, bar ())
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule (runtime)
+ for (i = 0; i < 10; ++i) ;
+
+ #pragma omp for schedule (runtime, bar ()) // { dg-error "does not take" }
+ for (i = 0; i < 10; ++i) ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-4.c
new file mode 100644
index 000000000..fb6994ea2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+ int i;
+
+ #pragma omp for schedule(dynamic)
+ for (i = 0; i < n; ++i)
+ bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_dynamic_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_dynamic_next" 1 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-5.c
new file mode 100644
index 000000000..5912a4e55
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-5.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+ int i;
+
+ #pragma omp for schedule(guided)
+ for (i = 0; i < n; ++i)
+ bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_guided_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_guided_next" 1 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-6.c
new file mode 100644
index 000000000..100ee2c8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-6.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+ int i;
+
+ #pragma omp for schedule(runtime)
+ for (i = 0; i < n; ++i)
+ bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_runtime_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_runtime_next" 1 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-7.c
new file mode 100644
index 000000000..10763dc59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-7.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+ int i;
+
+ #pragma omp for schedule(static) ordered
+ for (i = 0; i < n; ++i)
+ bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_ordered_static_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_ordered_static_next" 1 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-8.c
new file mode 100644
index 000000000..1bc66c49a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-8.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+ int i;
+
+ #pragma omp for schedule(dynamic) ordered
+ for (i = 0; i < n; ++i)
+ bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_ordered_dynamic_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_ordered_dynamic_next" 1 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-9.c
new file mode 100644
index 000000000..af99e216e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/for-9.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (int n)
+{
+ int i;
+
+ #pragma omp for schedule(guided) ordered
+ for (i = 0; i < n; ++i)
+ bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_loop_ordered_guided_start" 1 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_loop_ordered_guided_next" 1 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/gomp.exp b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/gomp.exp
new file mode 100644
index 000000000..e6e849bd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/gomp.exp
@@ -0,0 +1,37 @@
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+if ![check_effective_target_fopenmp] {
+ return
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [concat \
+ [find $srcdir/$subdir *.c] \
+ [find $srcdir/c-c++-common/gomp *.c]]] "" "-fopenmp"
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-1.c
new file mode 100644
index 000000000..b04610d2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-1.c
@@ -0,0 +1,10 @@
+// { dg-do compile }
+
+#define N 10
+
+extern void bar(void);
+void foo(void)
+{
+ #pragma omp parallel num_threads(N)
+ bar();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-2.c
new file mode 100644
index 000000000..75d6490cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-2.c
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+#define p parallel
+#define s(x) shared(x##1, x##2)
+#define d(x) default(x)
+
+void bar(int, int, int, int);
+void foo(void)
+{
+ int a1, a2, b1, b2;
+
+ #pragma omp p s(a) s(b) d(none)
+ bar(a1, a2, b1, b2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-3.c
new file mode 100644
index 000000000..233d2edcd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-3.c
@@ -0,0 +1,26 @@
+/* PR preprocessor/27746 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-omplower" } */
+
+#define omp FOO
+#define p parallel
+#define omp_parallel _Pragma ("omp parallel")
+#define omp_p _Pragma ("omp p")
+
+void bar (void);
+
+void
+foo (void)
+{
+ #pragma omp parallel
+ bar ();
+ #pragma omp p
+ bar ();
+ omp_parallel
+ bar ();
+ omp_p
+ bar ();
+}
+
+/* { dg-final { scan-tree-dump-times "#pragma omp parallel" 4 "omplower" } } */
+/* { dg-final { cleanup-tree-dump "omplower" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-4.c
new file mode 100644
index 000000000..7d20f4cd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/macro-4.c
@@ -0,0 +1,29 @@
+/* PR preprocessor/27746 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -Wunknown-pragmas" } */
+
+#define p _Pragma ("omp parallel")
+#define omp_p _Pragma ("omp p")
+
+void bar (void);
+
+void
+foo (void)
+{
+#pragma omp p /* { dg-warning "ignoring #pragma omp _Pragma" } */
+ bar ();
+ omp_p /* { dg-warning "ignoring #pragma omp _Pragma" } */
+ bar ();
+}
+
+#define parallel serial
+#define omp_parallel _Pragma ("omp parallel")
+
+void
+baz (void)
+{
+#pragma omp parallel /* { dg-warning "ignoring #pragma omp serial" } */
+ bar ();
+ omp_parallel /* { dg-warning "ignoring #pragma omp serial" } */
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-1.c
new file mode 100644
index 000000000..2681c216a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+extern void bar(int);
+
+void foo (void)
+{
+ #pragma omp master
+ bar(0);
+
+ #pragma omp master
+ {
+ bar(1);
+ bar(2);
+ }
+
+ /* Yes, this is legal -- structured-block contains statement contains
+ openmp-construct contains master-construct. */
+ #pragma omp master
+ #pragma omp master
+ #pragma omp master
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-2.c
new file mode 100644
index 000000000..3b0bdfc90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void f1(void)
+{
+ #pragma omp master asdf /* { dg-error "expected" } */
+ #pragma omp master
+} /* { dg-error "expected expression" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-3.c
new file mode 100644
index 000000000..fee09ddd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/master-3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (void)
+{
+ #pragma omp master
+ bar(0);
+}
+
+/* { dg-final { scan-tree-dump-times "omp_get_thread_num" 1 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/nestedfn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/nestedfn-1.c
new file mode 100644
index 000000000..8532d8af1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/nestedfn-1.c
@@ -0,0 +1,53 @@
+/* This testcase violates the OpenMP requirements, as nested functions
+ access the original variables.
+ We test it just to make sure we don't ICE on it. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+extern void abort (void);
+extern int omp_get_thread_num ();
+extern void omp_set_dynamic (int);
+
+int
+main (void)
+{
+ int j = 0, k = 6, l = 7, m = 8;
+ void foo (void)
+ {
+ int i = 5;
+ int bar (void)
+ {
+ return i + 1 + (j > 100 ? 10000 : 0);
+ }
+#pragma omp sections private (i)
+ {
+#pragma omp section
+ {
+ i = 6;
+ if (bar () != 6)
+#pragma omp atomic
+ ++j;
+ }
+#pragma omp section
+ {
+ if (bar () != 6)
+#pragma omp atomic
+ ++j;
+ }
+ }
+ if (k != 6 || l != 7 || m != 8)
+#pragma omp atomic
+ ++j;
+ }
+ omp_set_dynamic (0);
+#pragma omp parallel num_threads (2) firstprivate (k) shared (l) private (m)
+ {
+ if (omp_get_thread_num () != 0)
+ k += omp_get_thread_num ();
+ m = 9;
+ foo ();
+ }
+ if (j)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/nesting-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/nesting-1.c
new file mode 100644
index 000000000..52fcda741
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/nesting-1.c
@@ -0,0 +1,239 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+f1 (void)
+{
+ int i, j;
+ #pragma omp for
+ for (i = 0; i < 3; i++)
+ {
+ #pragma omp for /* { dg-error "may not be closely nested" } */
+ for (j = 0; j < 3; j++)
+ ;
+ #pragma omp sections /* { dg-error "may not be closely nested" } */
+ {
+ ;
+ #pragma omp section
+ ;
+ }
+ #pragma omp single /* { dg-error "may not be closely nested" } */
+ ;
+ #pragma omp master /* { dg-error "may not be closely nested" } */
+ ;
+ #pragma omp barrier /* { dg-error "may not be closely nested" } */
+ }
+ #pragma omp sections
+ {
+ #pragma omp for /* { dg-error "may not be closely nested" } */
+ for (j = 0; j < 3; j++)
+ ;
+ }
+ #pragma omp sections
+ {
+ #pragma omp sections /* { dg-error "may not be closely nested" } */
+ {
+ ;
+ #pragma omp section
+ ;
+ }
+ }
+ #pragma omp sections
+ {
+ #pragma omp single /* { dg-error "may not be closely nested" } */
+ ;
+ }
+ #pragma omp sections
+ {
+ #pragma omp master /* { dg-error "may not be closely nested" } */
+ ;
+ }
+ #pragma omp sections
+ {
+ #pragma omp section
+ ;
+ }
+ #pragma omp sections
+ {
+ #pragma omp section
+ #pragma omp for /* { dg-error "may not be closely nested" } */
+ for (j = 0; j < 3; j++)
+ ;
+ }
+ #pragma omp sections
+ {
+ #pragma omp section
+ #pragma omp sections /* { dg-error "may not be closely nested" } */
+ {
+ ;
+ #pragma omp section
+ ;
+ }
+ }
+ #pragma omp sections
+ {
+ #pragma omp section
+ #pragma omp single /* { dg-error "may not be closely nested" } */
+ ;
+ }
+ #pragma omp sections
+ {
+ #pragma omp section
+ #pragma omp master /* { dg-error "may not be closely nested" } */
+ ;
+ }
+ #pragma omp single
+ {
+ #pragma omp for /* { dg-error "may not be closely nested" } */
+ for (j = 0; j < 3; j++)
+ ;
+ #pragma omp sections /* { dg-error "may not be closely nested" } */
+ {
+ ;
+ #pragma omp section
+ ;
+ }
+ #pragma omp single /* { dg-error "may not be closely nested" } */
+ ;
+ #pragma omp master /* { dg-error "may not be closely nested" } */
+ ;
+ #pragma omp barrier /* { dg-error "may not be closely nested" } */
+ }
+ #pragma omp master
+ {
+ #pragma omp for /* { dg-error "may not be closely nested" } */
+ for (j = 0; j < 3; j++)
+ ;
+ #pragma omp sections /* { dg-error "may not be closely nested" } */
+ {
+ ;
+ #pragma omp section
+ ;
+ }
+ #pragma omp single /* { dg-error "may not be closely nested" } */
+ ;
+ #pragma omp master
+ ;
+ #pragma omp barrier /* { dg-error "may not be closely nested" } */
+ }
+ #pragma omp task
+ {
+ #pragma omp for /* { dg-error "may not be closely nested" } */
+ for (j = 0; j < 3; j++)
+ ;
+ #pragma omp sections /* { dg-error "may not be closely nested" } */
+ {
+ ;
+ #pragma omp section
+ ;
+ }
+ #pragma omp single /* { dg-error "may not be closely nested" } */
+ ;
+ #pragma omp master /* { dg-error "may not be closely nested" } */
+ ;
+ #pragma omp barrier /* { dg-error "may not be closely nested" } */
+ }
+ #pragma omp parallel
+ {
+ #pragma omp for
+ for (j = 0; j < 3; j++)
+ ;
+ #pragma omp sections
+ {
+ ;
+ #pragma omp section
+ ;
+ }
+ #pragma omp single
+ ;
+ #pragma omp master
+ ;
+ #pragma omp barrier
+ }
+}
+
+void
+f2 (void)
+{
+ int i, j;
+ #pragma omp ordered
+ {
+ #pragma omp for /* { dg-error "may not be closely nested" } */
+ for (j = 0; j < 3; j++)
+ ;
+ #pragma omp sections /* { dg-error "may not be closely nested" } */
+ {
+ ;
+ #pragma omp section
+ ;
+ }
+ #pragma omp single /* { dg-error "may not be closely nested" } */
+ ;
+ #pragma omp master
+ ;
+ #pragma omp barrier /* { dg-error "may not be closely nested" } */
+ }
+}
+
+void
+f3 (void)
+{
+ #pragma omp critical
+ {
+ #pragma omp ordered /* { dg-error "may not be closely nested" } */
+ ;
+ }
+}
+
+void
+f4 (void)
+{
+ #pragma omp task
+ {
+ #pragma omp ordered /* { dg-error "may not be closely nested" } */
+ ;
+ }
+}
+
+void
+f5 (void)
+{
+ int i;
+ #pragma omp for
+ for (i = 0; i < 10; i++)
+ {
+ #pragma omp ordered /* { dg-error "must be closely nested" } */
+ ;
+ }
+ #pragma omp for ordered
+ for (i = 0; i < 10; i++)
+ {
+ #pragma omp ordered
+ ;
+ }
+}
+
+void
+f6 (void)
+{
+ #pragma omp critical (foo)
+ #pragma omp critical (bar)
+ ;
+ #pragma omp critical
+ #pragma omp critical (baz)
+ ;
+}
+
+void
+f7 (void)
+{
+ #pragma omp critical (foo2)
+ #pragma omp critical
+ ;
+ #pragma omp critical (bar)
+ #pragma omp critical (bar) /* { dg-error "may not be nested" } */
+ ;
+ #pragma omp critical
+ #pragma omp critical /* { dg-error "may not be nested" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/num-threads-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/num-threads-1.c
new file mode 100644
index 000000000..f792ef96b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/num-threads-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+extern void bar(void);
+void foo(void)
+{
+ #pragma omp parallel num_threads (0) /* { dg-warning "must be positive" } */
+ {
+ bar ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/omp-parallel-if.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/omp-parallel-if.c
new file mode 100644
index 000000000..ca06aeef9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/omp-parallel-if.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+extern int foo(void);
+extern void bar(void);
+
+int main ()
+{
+ /* Malformed uses of 'if' and 'num_threads'. */
+ #pragma omp parallel if (foo () > 10) if (foo () == 3) /* { dg-error "too many" } */
+ {
+ bar ();
+ }
+
+ #pragma omp parallel num_threads (3) num_threads (20) /* { dg-error "too many" } */
+ {
+ bar ();
+ }
+
+ /* Valid uses of 'if' and 'num_threads'. */
+ #pragma omp parallel if (foo () == 10) num_threads (foo ())
+ {
+ bar ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/openmp-simd-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/openmp-simd-1.c
new file mode 100644
index 000000000..e8e057a61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/openmp-simd-1.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp-simd -fdump-tree-original" } */
+
+#pragma omp declare simd
+float bar(float b) {
+ return b*b;
+}
+
+void foo(int n, float *a, float *b)
+{
+ int i;
+#pragma omp simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+#pragma omp for simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+#pragma omp distribute simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+#pragma omp distribute parallel for simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+#pragma omp parallel for simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+#pragma omp teams distribute simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+#pragma omp target teams distribute simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+#pragma omp teams distribute parallel for simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+#pragma omp target teams distribute parallel for simd
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+}
+
+/* { dg-final { scan-tree-dump-times "pragma omp simd" 9 "original" } } */
+/* { dg-final { scan-tree-dump-not "omp for" "original" } } */
+/* { dg-final { scan-tree-dump-not "omp distribute" "original" } } */
+/* { dg-final { scan-tree-dump-not "omp teams" "original" } } */
+/* { dg-final { scan-tree-dump-not "omp target" "original" } } */
+/* { dg-final { scan-tree-dump-not "omp parallel" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/openmp-simd-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/openmp-simd-2.c
new file mode 100644
index 000000000..94afced24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/openmp-simd-2.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp-simd -fdump-tree-original" } */
+
+extern void abort ();
+int a[1024] __attribute__((aligned (32))) = { 1 };
+struct S { int s; };
+#pragma omp declare reduction (+:struct S:omp_out.s += omp_in.s)
+#pragma omp declare reduction (foo:struct S:omp_out.s += omp_in.s)
+#pragma omp declare reduction (foo:int:omp_out += omp_in)
+
+__attribute__((noinline, noclone)) int
+foo (void)
+{
+ int i, u = 0;
+ struct S s, t;
+ s.s = 0; t.s = 0;
+ #pragma omp simd aligned(a : 32) reduction(+:s) reduction(foo:t, u)
+ for (i = 0; i < 1024; i++)
+ {
+ int x = a[i];
+ s.s += x;
+ t.s += x;
+ u += x;
+ }
+ if (t.s != s.s || u != s.s)
+ abort ();
+ return s.s;
+}
+
+
+void bar(int n, float *a, float *b)
+{
+ int i;
+#pragma omp parallel for simd num_threads(4) safelen(64)
+ for (i = 0; i < n ; i++)
+ a[i] = b[i];
+}
+
+/* { dg-final { scan-tree-dump-times "pragma omp simd reduction\\(u\\) reduction\\(t\\) reduction\\(\\+:s\\) aligned\\(a:32\\)" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "pragma omp simd safelen\\(64\\)" 1 "original" } } */
+/* { dg-final { scan-tree-dump-not "omp parallel" "original" } } */
+/* { dg-final { scan-tree-dump-not "omp for" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/ordered-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/ordered-1.c
new file mode 100644
index 000000000..de5e116eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/ordered-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-ompexp" } */
+
+extern void bar(int);
+
+void foo (void)
+{
+ #pragma omp ordered
+ bar(0);
+
+ #pragma omp ordered
+ {
+ bar(1);
+ bar(2);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "GOMP_ordered_start" 2 "ompexp" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_ordered_end" 2 "ompexp" } } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/ordered-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/ordered-2.c
new file mode 100644
index 000000000..2884b1026
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/ordered-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void f1(void)
+{
+ #pragma omp ordered asdf /* { dg-error "expected" } */
+ #pragma omp ordered
+} /* { dg-error "expected expression" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-1.c
new file mode 100644
index 000000000..c5c233b76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-1.c
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+void foo()
+{
+ int i;
+
+ #pragma omp parallel
+ {
+ #pragma omp parallel
+ {
+ #pragma omp parallel
+ {
+ i++;
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-2.c
new file mode 100644
index 000000000..68e577766
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-2.c
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+void foo()
+{
+ int i;
+
+ #pragma omp parallel default(none) // { dg-error "enclosing" }
+ {
+ #pragma omp parallel
+ {
+ #pragma omp parallel default(none) // { dg-error "enclosing" }
+ {
+ i++; // { dg-error "not specified" }
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-3.c
new file mode 100644
index 000000000..633d7ba59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-3.c
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+extern int printf (const char *, ...);
+
+int main (void)
+{
+ double d = 6;
+ int i = 1;
+#pragma omp parallel shared(d) private(i) num_threads (4 + i)
+ {
+ i = 4;
+ printf ("%s %d %g\n", "Hello, World!", i, d);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-4.c
new file mode 100644
index 000000000..b8cd174a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/parallel-4.c
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+extern void bar (void);
+
+int main (void)
+{
+ int i;
+#pragma omp parallel for nowait /* { dg-error "'nowait'" } */
+ for (i = 0; i < 10; i++)
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25874.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25874.c
new file mode 100644
index 000000000..2afd02ea3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25874.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O -fopenmp" } */
+
+void foo();
+
+inline void bar()
+{
+ int i;
+ for ( i=0; i<1; ++i )
+#pragma omp parallel
+ foo();
+}
+
+void baz()
+{
+#pragma omp parallel
+ bar();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25989.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25989.c
new file mode 100644
index 000000000..39bd4b77c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25989.c
@@ -0,0 +1,16 @@
+/* PR middle-end/25989 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+int
+main (void)
+{
+ int i, j;
+ float a, b = 1.0;
+
+#pragma omp parallel for schedule(guided,1) private(j)
+ for (i = 1; i <= 9; i++)
+ for (j = 1; j <= 9; j++)
+ a = b;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25990.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25990.c
new file mode 100644
index 000000000..e3c4562cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25990.c
@@ -0,0 +1,261 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -O2 -std=c99" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+typedef struct {
+ int _flags;
+} FILE;
+
+extern FILE *fopen (__const char *__restrict __filename,
+ __const char *__restrict __modes);
+extern size_t fread (void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __stream) ;
+extern int fclose (FILE *__stream);
+extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
+ size_t __n, FILE *__restrict __s) ;
+
+extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
+
+extern size_t strlen (__const char *__s)
+ __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
+ __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
+
+extern int __attribute__ ((__nothrow__)) atoi (__const char *__nptr);
+
+extern float cabsf (float _Complex __z) __attribute__ ((__nothrow__)); extern float __cabsf (float _Complex __z) __attribute__ ((__nothrow__));
+extern float sqrtf (float __x) __attribute__ ((__nothrow__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__));
+
+int main(int argc , char * argv[])
+{
+ int AA, BB, CC;
+ AA = 99;
+ BB = 99;
+ CC = (int)atoi(argv[3]);
+ int m,n,s;
+ int DD,EE,num_s;
+
+
+ float _Complex * restrict A;
+ A = malloc((AA) * (BB) * (CC) * sizeof(float _Complex));
+ int A_slice_stride;
+ A_slice_stride = (AA) * (BB) ;
+
+
+ float * restrict f;
+ f = malloc(CC * sizeof(float));
+
+
+
+ FILE *fp;
+
+ fp = fopen(argv[1],"rb");
+ fread(A,sizeof(float _Complex),AA * BB * CC,fp);
+ fclose(fp);
+
+ fp = fopen(argv[2],"rb");
+ fread(f,sizeof(float),CC,fp);
+ fclose(fp);
+
+
+ DD = (int)atoi(argv[4]);
+ EE = (int)atoi(argv[5]);
+
+ num_s = (EE - DD) + 1;
+
+
+
+ float * restrict INPUT;
+ INPUT = malloc(4 * 4 * sizeof(float));
+
+
+
+ int m_max = 99;
+ int n_max = 00;
+ float h = 0.1;
+ float FF = 10;
+
+ if ((__extension__ (__builtin_constant_p (5) && ((__builtin_constant_p (argv[6]) && strlen (argv[6]) < ((size_t) (5))) || (__builtin_constant_p ("plane") && strlen ("plane") < ((size_t) (5)))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (argv[6]) && __builtin_constant_p ("plane") && (__s1_len = strlen (argv[6]), __s2_len = strlen ("plane"), (!((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("plane") + 1) - (size_t)(const void *)("plane") == 1) || __s2_len >= 4)) ? __builtin_strcmp (argv[6], "plane") : (__builtin_constant_p (argv[6]) && ((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) && (__s1_len = strlen (argv[6]), __s1_len < 4) ? (__builtin_constant_p ("plane") && ((size_t)(const void *)(("plane") + 1) - (size_t)(const void *)("plane") == 1) ? __builtin_strcmp (argv[6], "plane") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("plane"); register int __result = (((__const unsigned char *) (__const char *) (argv[6]))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (argv[6]))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (argv[6]))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (argv[6]))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("plane") && ((size_t)(const void *)(("plane") + 1) - (size_t)(const void *)("plane") == 1) && (__s2_len = strlen ("plane"), __s2_len < 4) ? (__builtin_constant_p (argv[6]) && ((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) ? __builtin_strcmp (argv[6], "plane") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (argv[6]); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("plane"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("plane"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("plane"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("plane"))[3]); } } __result; }))) : __builtin_strcmp (argv[6], "plane")))); }) : (__extension__ (__builtin_constant_p (5) && ((__builtin_constant_p (argv[6]) && strlen (argv[6]) < ((size_t) (5))) || (__builtin_constant_p ("plane") && strlen ("plane") < ((size_t) (5)))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (argv[6]) && __builtin_constant_p ("plane") && (__s1_len = strlen (argv[6]), __s2_len = strlen ("plane"), (!((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("plane") + 1) - (size_t)(const void *)("plane") == 1) || __s2_len >= 4)) ? __builtin_strcmp (argv[6], "plane") : (__builtin_constant_p (argv[6]) && ((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) && (__s1_len = strlen (argv[6]), __s1_len < 4) ? (__builtin_constant_p ("plane") && ((size_t)(const void *)(("plane") + 1) - (size_t)(const void *)("plane") == 1) ? __builtin_strcmp (argv[6], "plane") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("plane"); register int __result = (((__const unsigned char *) (__const char *) (argv[6]))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (argv[6]))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (argv[6]))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (argv[6]))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("plane") && ((size_t)(const void *)(("plane") + 1) - (size_t)(const void *)("plane") == 1) && (__s2_len = strlen ("plane"), __s2_len < 4) ? (__builtin_constant_p (argv[6]) && ((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) ? __builtin_strcmp (argv[6], "plane") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (argv[6]); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("plane"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("plane"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("plane"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("plane"))[3]); } } __result; }))) : __builtin_strcmp (argv[6], "plane")))); }) : strncmp (argv[6], "plane", 5)))))==0) {
+ m_max = INPUT[ ( ((1)-1) + ( ((1)-1)*4 ))];
+ n_max = INPUT[ ( ((2)-1) + ( ((1)-1)*4 ))];
+ h = INPUT[ ( ((3)-1) + ( ((1)-1)*4 ))];
+ FF = INPUT[ ( ((4)-1) + ( ((1)-1)*4 ))];
+ }
+
+ if ((__extension__ (__builtin_constant_p (6) && ((__builtin_constant_p (argv[6]) && strlen (argv[6]) < ((size_t) (6))) || (__builtin_constant_p ("sphere") && strlen ("sphere") < ((size_t) (6)))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (argv[6]) && __builtin_constant_p ("sphere") && (__s1_len = strlen (argv[6]), __s2_len = strlen ("sphere"), (!((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("sphere") + 1) - (size_t)(const void *)("sphere") == 1) || __s2_len >= 4)) ? __builtin_strcmp (argv[6], "sphere") : (__builtin_constant_p (argv[6]) && ((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) && (__s1_len = strlen (argv[6]), __s1_len < 4) ? (__builtin_constant_p ("sphere") && ((size_t)(const void *)(("sphere") + 1) - (size_t)(const void *)("sphere") == 1) ? __builtin_strcmp (argv[6], "sphere") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("sphere"); register int __result = (((__const unsigned char *) (__const char *) (argv[6]))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (argv[6]))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (argv[6]))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (argv[6]))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("sphere") && ((size_t)(const void *)(("sphere") + 1) - (size_t)(const void *)("sphere") == 1) && (__s2_len = strlen ("sphere"), __s2_len < 4) ? (__builtin_constant_p (argv[6]) && ((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) ? __builtin_strcmp (argv[6], "sphere") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (argv[6]); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("sphere"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("sphere"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("sphere"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("sphere"))[3]); } } __result; }))) : __builtin_strcmp (argv[6], "sphere")))); }) : (__extension__ (__builtin_constant_p (6) && ((__builtin_constant_p (argv[6]) && strlen (argv[6]) < ((size_t) (6))) || (__builtin_constant_p ("sphere") && strlen ("sphere") < ((size_t) (6)))) ? __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (argv[6]) && __builtin_constant_p ("sphere") && (__s1_len = strlen (argv[6]), __s2_len = strlen ("sphere"), (!((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("sphere") + 1) - (size_t)(const void *)("sphere") == 1) || __s2_len >= 4)) ? __builtin_strcmp (argv[6], "sphere") : (__builtin_constant_p (argv[6]) && ((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) && (__s1_len = strlen (argv[6]), __s1_len < 4) ? (__builtin_constant_p ("sphere") && ((size_t)(const void *)(("sphere") + 1) - (size_t)(const void *)("sphere") == 1) ? __builtin_strcmp (argv[6], "sphere") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("sphere"); register int __result = (((__const unsigned char *) (__const char *) (argv[6]))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (argv[6]))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (argv[6]))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (argv[6]))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("sphere") && ((size_t)(const void *)(("sphere") + 1) - (size_t)(const void *)("sphere") == 1) && (__s2_len = strlen ("sphere"), __s2_len < 4) ? (__builtin_constant_p (argv[6]) && ((size_t)(const void *)((argv[6]) + 1) - (size_t)(const void *)(argv[6]) == 1) ? __builtin_strcmp (argv[6], "sphere") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (argv[6]); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("sphere"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("sphere"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("sphere"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("sphere"))[3]); } } __result; }))) : __builtin_strcmp (argv[6], "sphere")))); }) : strncmp (argv[6], "sphere", 6)))))==0) {
+ m_max = 181;
+ n_max = 361;
+ h = INPUT[ ( ((3)-1) + ( ((1)-1)*4 ))];
+ FF = INPUT[ ( ((4)-1) + ( ((1)-1)*4 ))];
+ }
+
+
+
+
+
+ float * restrict X;
+ X = malloc(m_max * n_max * sizeof(float));
+
+
+ float * restrict Y;
+ Y = malloc(m_max * n_max * sizeof(float));
+
+
+ float * restrict Z;
+ Z = malloc(m_max * n_max * sizeof(float));
+
+
+
+
+
+
+ float _Complex * restrict P;
+ P = malloc(m_max * n_max * sizeof(float _Complex));
+
+
+ float _Complex * restrict Ps;
+ Ps = malloc((m_max) * (n_max) * (num_s) * sizeof(float _Complex));
+ int Ps_slice_stride;
+ Ps_slice_stride = (m_max) * (n_max) ;
+
+
+ float GG;
+ float HH;
+
+
+
+
+ for ( n = 1 ; n <= 99 ; n++ ) {
+ for ( m = 1 ; m <= 99 ; m++ ) {
+
+
+
+
+
+ X[ ( ((m)-1) + ( ((n)-1)*m_max ))] = FF ;
+ Y[ ( ((m)-1) + ( ((n)-1)*m_max ))] = FF ;
+ Z[ ( ((m)-1) + ( ((n)-1)*m_max ))] = FF ;
+ }
+ }
+ int KK = atoi(argv[8]);
+ int LL = 3 * KK;
+
+
+ float * restrict MM;
+ MM = malloc(4 * LL * sizeof(float));
+ for ( n = 1 ; n <= n_max ; n++) {
+ for ( m = 1 ; m <= m_max ; m++) {
+ for ( s = 1 ; s <= num_s ; s++) {
+ Ps[ ( ((m)-1) + (((n)-1)*(m_max)) + (((s)-1)*(Ps_slice_stride)) ) ] = 0.0 + 0.0 * (__extension__ 1.0iF);
+ }
+ }
+ }
+
+
+ int liter ;
+
+#pragma omp parallel for private(m,liter,s)
+ for ( n = 1 ; n <= n_max ; n++) {
+ for ( m = 1 ; m <= m_max ; m++) {
+ for ( liter = 1 ; liter <= KK ; liter++ ) {
+ for ( s = 1 ; s <= num_s ; s++) {
+
+
+ int LM_column;
+ float NN[4];
+ float OO[4];
+ float PP[4];
+ float QQ[4];
+ float k;
+ int s_index;
+ float RR;
+
+ s_index = s + (DD -1);
+ RR = f[ ( (s_index)-1) ];
+ k = 99.0;
+
+ NN[1 -1] = X[ ( ((m)-1) + ( ((n)-1)*m_max ))];
+ NN[2 -1] = Y[ ( ((m)-1) + ( ((n)-1)*m_max ))];
+ NN[3 -1] = Z[ ( ((m)-1) + ( ((n)-1)*m_max ))];
+ NN[4 -1] = 1.0;
+
+ LM_column = ((liter -1) * 3) + 1;
+ OO[1 -1] = MM[ ( ((1)-1) + ( ((LM_column)-1)*4 ))];
+ OO[2 -1] = MM[ ( ((2)-1) + ( ((LM_column)-1)*4 ))];
+ OO[3 -1] = MM[ ( ((3)-1) + ( ((LM_column)-1)*4 ))];
+ OO[4 -1] = MM[ ( ((4)-1) + ( ((LM_column)-1)*4 ))];
+
+ LM_column = ((liter -1) * 3) + 2;
+ PP[1 -1] = MM[ ( ((1)-1) + ( ((LM_column)-1)*4 ))];
+ PP[2 -1] = MM[ ( ((2)-1) + ( ((LM_column)-1)*4 ))];
+ PP[3 -1] = MM[ ( ((3)-1) + ( ((LM_column)-1)*4 ))];
+ PP[4 -1] = MM[ ( ((4)-1) + ( ((LM_column)-1)*4 ))];
+
+ LM_column = ((liter -1) * 3) + 3;
+ QQ[1 -1] = MM[ ( ((1)-1) + ( ((LM_column)-1)*4 ))];
+ QQ[2 -1] = MM[ ( ((2)-1) + ( ((LM_column)-1)*4 ))];
+ QQ[3 -1] = MM[ ( ((3)-1) + ( ((LM_column)-1)*4 ))];
+ QQ[4 -1] = MM[ ( ((4)-1) + ( ((LM_column)-1)*4 ))];
+
+ }
+ }
+ }
+ }
+
+
+#pragma omp parallel for private(m)
+ for ( n = 1 ; n <= n_max ; n++) {
+ for ( m = 1 ; m <= m_max ; m++) {
+
+
+
+ int s;
+ float SSS;
+ float f1,f2,p1,p2,TT,h,FFF;
+ SSS = 0.0;
+ for ( s = 2 ; s <= num_s ; s++) {
+ f1 = f[ ( ((s-1) + (DD - 1))-1) ];
+ f2 = f[ ( ((s) + (DD - 1))-1) ];
+ p1 = cabsf(Ps[ ( ((m)-1) + (((n)-1)*(m_max)) + ((((s-1))-1)*(Ps_slice_stride)) ) ]) ;
+ p2 = cabsf(Ps[ ( ((m)-1) + (((n)-1)*(m_max)) + (((s)-1)*(Ps_slice_stride)) ) ]) ;
+
+ h = f2 - f1;
+
+ FFF = (f1 + f2) / 2.0;
+
+
+ TT = (1.0 / sqrtf(2.0)) * (((h * p1) + (0.5 * h * (p2 - p1))) * (1.0 / FFF));
+
+ SSS += TT;
+
+ }
+
+ P[ ( ((m)-1) + ( ((n)-1)*m_max ))] = SSS + ((__extension__ 1.0iF) * 0.0);
+ }
+ }
+
+
+
+
+
+ fp = fopen(argv[10],"wb");
+ fwrite(X,sizeof(float),m_max * n_max,fp);
+ fclose(fp);
+
+ fp = fopen(argv[11],"wb");
+ fwrite(Y,sizeof(float),m_max * n_max,fp);
+ fclose(fp);
+
+ fp = fopen(argv[12],"wb");
+ fwrite(Z,sizeof(float),m_max * n_max,fp);
+ fclose(fp);
+
+ fp = fopen(argv[13],"wb");
+ fwrite(P,sizeof(float _Complex),m_max * n_max,fp);
+ fclose(fp);
+
+
+
+ return(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25996.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25996.c
new file mode 100644
index 000000000..d58c9a1c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr25996.c
@@ -0,0 +1,32 @@
+/* PR c/25996 */
+
+void
+test1 (void)
+{
+#pragma omp for
+ for (i = 0; i < 1; ++i); /* { dg-error "undeclared|for each function" } */
+}
+
+void
+test2 (void)
+{
+ int i;
+#pragma omp for
+ for (i = j; i < 1; ++i); /* { dg-error "undeclared" } */
+}
+
+void
+test3 (void)
+{
+ int i;
+#pragma omp for
+ for (i = 0; i < j; ++i); /* { dg-error "undeclared|invalid controlling predicate" } */
+}
+
+void
+test4 (void)
+{
+ int i;
+#pragma omp for
+ for (i = 0; i < 10; i += j); /* { dg-error "undeclared|invalid increment expression" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr26412.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr26412.c
new file mode 100644
index 000000000..6baecfe68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr26412.c
@@ -0,0 +1,18 @@
+/* PR middle-end/26412 */
+/* { dg-do compile } */
+
+extern double a[];
+extern int b;
+
+double
+test (void)
+{
+ int i;
+ double c = 0;
+
+#pragma omp parallel for private(i) reduction(+:c)
+ for (i = 0; i < 10000; i++)
+ c += a[b];
+
+ return c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27328.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27328.c
new file mode 100644
index 000000000..afde738a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27328.c
@@ -0,0 +1,19 @@
+/* PR middle-end/27328 */
+/* { dg-do compile } */
+
+extern void baz (void) __attribute__((noreturn));
+
+void
+foo (void)
+{
+#pragma omp parallel
+ for (;;)
+ ;
+}
+
+void
+bar (void)
+{
+#pragma omp parallel
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27358.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27358.c
new file mode 100644
index 000000000..3451284e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27358.c
@@ -0,0 +1,8 @@
+/* PR c/27358 */
+/* { dg-do compile } */
+
+void foo(error i) /* { dg-error "" } */
+{
+#pragma omp parallel
+ i = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-1.c
new file mode 100644
index 000000000..f315b8bd3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-1.c
@@ -0,0 +1,23 @@
+/* PR middle-end/27388 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-omplower" } */
+
+int n, o;
+
+void
+foo (void)
+{
+#pragma omp parallel firstprivate (n)
+ {
+ int i;
+#pragma omp parallel for firstprivate (n)
+ for (i = 0; i < 10; i++)
+ ++n;
+#pragma omp atomic
+ o += n;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "shared\\\(i\\\)" 0 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "private\\\(i\\\)" 1 "omplower" } } */
+/* { dg-final { cleanup-tree-dump "omplower" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-2.c
new file mode 100644
index 000000000..da8a48d7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-2.c
@@ -0,0 +1,35 @@
+/* PR middle-end/27388 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-omplower" } */
+
+extern void baz (int);
+
+void
+foo (void)
+{
+ int i;
+#pragma omp parallel for shared (i)
+ for (i = 0; i < 2; i++)
+ baz (i);
+}
+
+void
+bar (void)
+{
+ int j = 0;
+#pragma omp parallel shared (j)
+ {
+ j++;
+#pragma omp for
+ for (j = 0; j < 2; j++)
+ baz (j);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "shared\\\(i\\\)\[^\\n\]*private\\\(i\\\)" 0 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "private\\\(i\\\)\[^\\n\]*shared\\\(i\\\)" 0 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "omp for\[^\\n\]*private\\\(i\\\)" 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "shared\\\(j\\\)\[^\\n\]*private\\\(j\\\)" 0 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "private\\\(j\\\)\[^\\n\]*shared\\\(j\\\)" 0 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "omp for\[^\\n\]*private\\\(j\\\)" 1 "omplower" } } */
+/* { dg-final { cleanup-tree-dump "omplower" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-3.c
new file mode 100644
index 000000000..2cddb23c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27388-3.c
@@ -0,0 +1,23 @@
+/* PR middle-end/27388 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-omplower" } */
+
+extern void bar (int);
+
+void
+foo (void)
+{
+ int i = 0, j = 0;
+#pragma omp parallel firstprivate (i) private (j)
+ {
+#pragma omp for
+ for (i = 0; i < 2; i++)
+ bar (i);
+#pragma omp for
+ for (j = 0; j < 2; j++)
+ bar (j);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "omp for\[^\\n\]*private" 2 "omplower" } } */
+/* { dg-final { cleanup-tree-dump "omplower" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27415.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27415.c
new file mode 100644
index 000000000..010a6c3e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27415.c
@@ -0,0 +1,50 @@
+/* PR middle-end/27415 */
+/* { dg-do compile } */
+
+void
+test1 (void)
+{
+ int i = 0;
+#pragma omp parallel
+#pragma omp for firstprivate (i) /* { dg-error "should not be firstprivate" } */
+ for (i = 0; i < 10; i++)
+ ;
+}
+
+void
+test2 (void)
+{
+ int i = 0;
+#pragma omp parallel for firstprivate (i) /* { dg-error "should not be firstprivate" } */
+ for (i = 0; i < 10; i++)
+ ;
+}
+
+void
+test3 (void)
+{
+ int i = 0;
+#pragma omp parallel
+#pragma omp for reduction (+:i) /* { dg-error "should not be reduction" } */
+ for (i = 0; i < 10; i++)
+ ;
+}
+
+void
+test4 (void)
+{
+ int i = 0;
+#pragma omp parallel for reduction (*:i) /* { dg-error "should not be reduction" } */
+ for (i = 0; i < 10; i++)
+ ;
+}
+
+void
+test5 (void)
+{
+ int i = 0;
+#pragma omp parallel firstprivate (i)
+#pragma omp for
+ for (i = 0; i < 10; i++)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27416.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27416.c
new file mode 100644
index 000000000..802402446
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27416.c
@@ -0,0 +1,31 @@
+/* PR middle-end/27416 */
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ int i = 0, j = 0;
+#pragma omp for firstprivate (j) /* { dg-error "is private in outer context" } */
+ for (i = 0; i < 10; i++)
+ j++;
+}
+
+int
+bar (void)
+{
+ int i, j;
+#pragma omp for lastprivate (j) /* { dg-error "is private in outer context" } */
+ for (i = 0; i < 10; i++)
+ j = i;
+ return j;
+}
+
+int
+baz (void)
+{
+ int i, j = 0;
+#pragma omp for reduction (+:j) /* { dg-error "is private in outer context" } */
+ for (i = 0; i < 10; i++)
+ j++;
+ return j;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27499.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27499.c
new file mode 100644
index 000000000..0de2e0686
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27499.c
@@ -0,0 +1,13 @@
+/* PR c/27499 */
+/* { dg-do compile } */
+
+extern void bar (unsigned int);
+
+void
+foo (void)
+{
+ unsigned int i;
+#pragma omp parallel for
+ for (i = 0; i < 64; ++i)
+ bar (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27573.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27573.c
new file mode 100644
index 000000000..239e9913c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr27573.c
@@ -0,0 +1,19 @@
+/* PR middle-end/27573 */
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O2 -fopenmp -fprofile-generate" } */
+
+extern int puts (const char *);
+
+int
+main (void)
+{
+ int i, j = 8;
+#pragma omp parallel
+ {
+ puts ("foo");
+ for (i = 1; i < j - 1; i++)
+ ;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29955.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29955.c
new file mode 100644
index 000000000..e49c11cae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29955.c
@@ -0,0 +1,14 @@
+/* PR c/29955 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -fexceptions" } */
+
+extern void bar (int);
+
+void
+foo (int n)
+{
+ int i;
+#pragma omp parallel for schedule(dynamic)
+ for (i = 0; i < n; i++)
+ bar (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-1.c
new file mode 100644
index 000000000..b587d81e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-1.c
@@ -0,0 +1,45 @@
+/* PR middle-end/29965 */
+/* Test that OpenMP construct bodies which never return don't cause ICEs. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+extern void baz (void) __attribute__ ((noreturn));
+
+static inline void
+foo (void)
+{
+#pragma omp parallel
+ for (;;)
+ ;
+}
+
+static inline void
+bar (void)
+{
+#pragma omp parallel
+ baz ();
+}
+
+void
+foo1 (void)
+{
+ foo ();
+}
+
+void
+foo2 (void)
+{
+ foo ();
+}
+
+void
+bar1 (void)
+{
+ bar ();
+}
+
+void
+bar2 (void)
+{
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-2.c
new file mode 100644
index 000000000..1bee4859d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-2.c
@@ -0,0 +1,98 @@
+/* PR middle-end/29965 */
+/* Test that OpenMP construct bodies which never return don't cause ICEs. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+extern void baz (void) __attribute__ ((noreturn));
+
+void
+foo1 (void)
+{
+#pragma omp sections
+ {
+ for (;;)
+ ;
+ }
+}
+
+void
+bar1 (void)
+{
+#pragma omp sections
+ {
+#pragma omp section
+ baz ();
+#pragma omp section
+ baz ();
+ }
+}
+
+void
+foo2 (void)
+{
+#pragma omp sections
+ {
+ ;
+#pragma omp section
+ for (;;)
+ ;
+ }
+}
+
+void
+bar2 (void)
+{
+#pragma omp sections
+ {
+#pragma omp section
+ baz ();
+#pragma omp section
+ ;
+ }
+}
+
+void
+foo3 (void)
+{
+#pragma omp parallel sections
+ {
+ for (;;)
+ ;
+ }
+}
+
+void
+bar3 (void)
+{
+#pragma omp parallel sections
+ {
+#pragma omp section
+ baz ();
+#pragma omp section
+ baz ();
+ }
+}
+
+void
+foo4 (void)
+{
+#pragma omp parallel sections
+ {
+ ;
+#pragma omp section
+ for (;;)
+ ;
+ }
+}
+
+void
+bar4 (void)
+{
+#pragma omp parallel sections
+ {
+#pragma omp section
+ baz ();
+#pragma omp section
+ ;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-3.c
new file mode 100644
index 000000000..5901f5f42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-3.c
@@ -0,0 +1,62 @@
+/* PR middle-end/29965 */
+/* Test that OpenMP construct bodies which never return don't cause ICEs. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+extern void baz (void) __attribute__ ((noreturn));
+
+void
+foo1 (void)
+{
+#pragma omp single
+ for (;;);
+}
+
+void
+bar1 (void)
+{
+#pragma omp single
+ baz ();
+}
+
+void
+foo2 (void)
+{
+#pragma omp master
+ for (;;);
+}
+
+void
+bar2 (void)
+{
+#pragma omp master
+ baz ();
+}
+
+void
+foo3 (void)
+{
+#pragma omp ordered
+ for (;;);
+}
+
+void
+bar3 (void)
+{
+#pragma omp ordered
+ baz ();
+}
+
+void
+foo4 (void)
+{
+#pragma omp critical
+ for (;;);
+}
+
+void
+bar4 (void)
+{
+#pragma omp critical
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-4.c
new file mode 100644
index 000000000..7416d8ec6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-4.c
@@ -0,0 +1,44 @@
+/* PR middle-end/29965 */
+/* Test that OpenMP construct bodies which never return don't cause ICEs. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+extern void baz (void) __attribute__ ((noreturn));
+
+void
+foo1 (void)
+{
+ int i;
+#pragma omp for schedule (dynamic)
+ for (i = 0; i < 2834; i++)
+ for (;;)
+ ;
+}
+
+void
+bar1 (void)
+{
+ int i;
+#pragma omp for schedule (dynamic)
+ for (i = 0; i < 2834; i++)
+ baz ();
+}
+
+void
+foo2 (void)
+{
+ int i;
+#pragma omp parallel for schedule (dynamic)
+ for (i = 0; i < 2834; i++)
+ for (;;)
+ ;
+}
+
+void
+bar2 (void)
+{
+ int i;
+#pragma omp parallel for schedule (dynamic)
+ for (i = 0; i < 2834; i++)
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-5.c
new file mode 100644
index 000000000..a948ec9dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-5.c
@@ -0,0 +1,44 @@
+/* PR middle-end/29965 */
+/* Test that OpenMP construct bodies which never return don't cause ICEs. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+extern void baz (void) __attribute__ ((noreturn));
+
+void
+foo1 (void)
+{
+ int i;
+#pragma omp for schedule (static)
+ for (i = 0; i < 2834; i++)
+ for (;;)
+ ;
+}
+
+void
+bar1 (void)
+{
+ int i;
+#pragma omp for schedule (static)
+ for (i = 0; i < 2834; i++)
+ baz ();
+}
+
+void
+foo2 (void)
+{
+ int i;
+#pragma omp parallel for schedule (static)
+ for (i = 0; i < 2834; i++)
+ for (;;)
+ ;
+}
+
+void
+bar2 (void)
+{
+ int i;
+#pragma omp parallel for schedule (static)
+ for (i = 0; i < 2834; i++)
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-6.c
new file mode 100644
index 000000000..6f6947836
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr29965-6.c
@@ -0,0 +1,44 @@
+/* PR middle-end/29965 */
+/* Test that OpenMP construct bodies which never return don't cause ICEs. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp" } */
+
+extern void baz (void) __attribute__ ((noreturn));
+
+void
+foo1 (void)
+{
+ int i;
+#pragma omp for schedule (static, 16)
+ for (i = 0; i < 2834; i++)
+ for (;;)
+ ;
+}
+
+void
+bar1 (void)
+{
+ int i;
+#pragma omp for schedule (static, 16)
+ for (i = 0; i < 2834; i++)
+ baz ();
+}
+
+void
+foo2 (void)
+{
+ int i;
+#pragma omp parallel for schedule (static, 16)
+ for (i = 0; i < 2834; i++)
+ for (;;)
+ ;
+}
+
+void
+bar2 (void)
+{
+ int i;
+#pragma omp parallel for schedule (static, 16)
+ for (i = 0; i < 2834; i++)
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr30421.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr30421.c
new file mode 100644
index 000000000..901ba3c13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr30421.c
@@ -0,0 +1,39 @@
+/* PR middle-end/30421 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -Wall" } */
+
+int
+foo ()
+{
+ int a = 0, i;
+
+#pragma omp parallel for firstprivate(a) lastprivate(a)
+ for (i = 0; i < 10; i++)
+ a += i;
+
+ return a;
+}
+
+int
+bar ()
+{
+ int a = 0, i;
+
+#pragma omp parallel for firstprivate(a) lastprivate(a) schedule(static, 2)
+ for (i = 0; i < 10; i++)
+ a += i;
+
+ return a;
+}
+
+int
+baz ()
+{
+ int a = 0, i;
+
+#pragma omp parallel for firstprivate(a) lastprivate(a) schedule(dynamic)
+ for (i = 0; i < 10; i++)
+ a += i;
+
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr30494.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr30494.c
new file mode 100644
index 000000000..6a042ce69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr30494.c
@@ -0,0 +1,30 @@
+/* PR middle-end/30494 */
+/* { dg-do compile } */
+
+int
+foo (int n)
+{
+ int i;
+#pragma omp for
+ for (i = 0; i < 6; i++)
+ {
+ int v[n], w[n * 3 + i];
+ v[0] = 1;
+ w[0] = 2;
+ }
+ return 0;
+}
+
+int
+bar (int n)
+{
+ int i;
+#pragma parallel omp for
+ for (i = 0; i < 6; i++)
+ {
+ int v[n], w[n * 3 + i];
+ v[0] = 1;
+ w[0] = 2;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr32468-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr32468-1.c
new file mode 100644
index 000000000..437241357
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr32468-1.c
@@ -0,0 +1,100 @@
+/* PR libgomp/32468 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */
+
+extern int printf (const char *, ...);
+extern int omp_get_thread_num (void), omp_get_num_threads (void);
+extern int bar (void);
+extern int baz (const char *, ...);
+
+void
+f1 (void)
+{
+#pragma omp parallel
+ {
+ baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp sections
+ {
+ #pragma omp section
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp section
+ printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+ }
+}
+
+void
+f2 (void)
+{
+#pragma omp parallel
+ {
+ #pragma omp sections
+ {
+ #pragma omp section
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp section
+ printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+ baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+}
+
+void
+f3 (void)
+{
+#pragma omp parallel
+ {
+ int bb = bar ();
+ #pragma omp sections
+ {
+ #pragma omp section
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp section
+ printf ("section2 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+ }
+}
+
+void
+f4 (void)
+{
+ int i;
+#pragma omp parallel
+ {
+ baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ #pragma omp for schedule (dynamic, 15)
+ for (i = 0; i < 10000; i++)
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+}
+
+void
+f5 (void)
+{
+ int i;
+#pragma omp parallel
+ {
+ #pragma omp for schedule (dynamic, 15)
+ for (i = 0; i < 10000; i++)
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ baz ("%d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+}
+
+void
+f6 (void)
+{
+ int i;
+#pragma omp parallel
+ {
+ int bb = bar ();
+ #pragma omp for schedule (runtime)
+ for (i = 0; i < 10000; i++)
+ printf ("section1 %d/%d\n", omp_get_thread_num (), omp_get_num_threads ());
+ }
+}
+
+/* There should not be a GOMP_parallel_{loop,sections}* call. */
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_loop" 0 "ompexp"} } */
+/* { dg-final { scan-tree-dump-times "GOMP_parallel_sections" 0 "ompexp"} } */
+/* { dg-final { cleanup-tree-dump "ompexp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34607.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34607.c
new file mode 100644
index 000000000..d64af282f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34607.c
@@ -0,0 +1,17 @@
+/* PR c++/34607 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -std=gnu99" } */
+void
+foo ()
+{
+#pragma omp for
+ for (int i =; i < 2; ++i) /* { dg-error "expected expression before" } */
+ ;
+#pragma omp for
+ for (T i = 54; i < 56; i++) /* { dg-error "unknown type name" } */
+ ;
+ T j; /* { dg-error "unknown type name" } */
+#pragma omp for
+ for (j = 1; j < 3; j++)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34610.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34610.c
new file mode 100644
index 000000000..85db164b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34610.c
@@ -0,0 +1,28 @@
+/* PR gcov-profile/34610 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-arcs -fopenmp" } */
+
+extern void bar (int);
+extern void baz (int) __attribute__((noreturn));
+
+void
+foo (int k)
+{
+ int i;
+#pragma omp for schedule(dynamic)
+ for (i = 0; i < 10; ++i)
+ bar (i);
+#pragma omp parallel for schedule(static)
+ for (i = 0; i < 10; ++i)
+ bar (i);
+#pragma omp parallel for schedule(static, 4)
+ for (i = 0; i < 10; ++i)
+ bar (i);
+ if (k)
+ #pragma omp for schedule(dynamic)
+ for (i = 0; i < 10; ++i)
+ baz (i);
+#pragma omp parallel
+ for (i = 0; i < 10; ++i)
+ bar (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34692.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34692.c
new file mode 100644
index 000000000..cc93914b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34692.c
@@ -0,0 +1,28 @@
+/* PR preprocessor/34692 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-gimple" } */
+/* { dg-final { scan-tree-dump-times "#pragma omp parallel" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "#pragma omp for private" 1 "gimple" } } */
+
+void
+foo (void)
+{
+ int i;
+#define FOO(y, x) y #x
+#define BAR(x) x
+#define BAZ(x) x
+FOO (for (i = 0; i < 10; i++) { const char *vara =,
+a
+#define P parallel
+#pragma omp P
+#undef P
+#define P for
+b
+#pragma omp P
+#undef P
+#define parallel atomic
+cde f g h);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34694.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34694.c
new file mode 100644
index 000000000..35cbf3340
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34694.c
@@ -0,0 +1,15 @@
+/* PR middle-end/34694 */
+/* { dg-do compile } */
+/* { dg-options "-O -fopenmp -Wall" } */
+
+int i;
+
+void
+foo ()
+{
+#pragma omp parallel
+ {
+ int j; /* { dg-message "note: 'j' was declared here" } */
+ i = j; /* { dg-warning "is used uninitialized" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34964.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34964.c
new file mode 100644
index 000000000..7800be1d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr34964.c
@@ -0,0 +1,6 @@
+/* PR c++/34964 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+char x[] = 0; /* { dg-error "invalid initializer" } */
+#pragma omp threadprivate (x)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35244.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35244.c
new file mode 100644
index 000000000..92d6a1c4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35244.c
@@ -0,0 +1,20 @@
+/* PR c++/35244 */
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+/* { dg-options "-fopenmp" } */
+
+int v1;
+typedef struct A A;
+typedef int i;
+#pragma omp threadprivate (i) /* { dg-error "expected identifier before" } */
+#pragma omp threadprivate (A) /* { dg-error "expected identifier before" } */
+#pragma omp threadprivate (v1)
+
+void foo ()
+{
+ static int v4;
+ {
+ static int v5;
+#pragma omp threadprivate (v4, v5)
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35438.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35438.c
new file mode 100644
index 000000000..a3ae7de0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35438.c
@@ -0,0 +1,6 @@
+/* PR c/35438 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void foo ();
+#pragma omp threadprivate(foo) /* { dg-error "is not a variable" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35439.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35439.c
new file mode 100644
index 000000000..1669a97a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35439.c
@@ -0,0 +1,6 @@
+/* PR c/35439 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void x[1]; /* { dg-error "array of voids" } */
+#pragma omp threadprivate(x)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35738.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35738.c
new file mode 100644
index 000000000..0b3866eae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35738.c
@@ -0,0 +1,18 @@
+/* PR c/35738 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void foo (void);
+
+void
+bar (void *p)
+{
+ int i = 0;
+ char q[10];
+#pragma omp atomic
+ i += q; /* { dg-warning "makes integer from pointer without a cast" } */
+#pragma omp atomic
+ i += foo; /* { dg-warning "makes integer from pointer without a cast" } */
+#pragma omp atomic
+ i += p; /* { dg-warning "makes integer from pointer without a cast" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35751.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35751.c
new file mode 100644
index 000000000..f7777a5b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35751.c
@@ -0,0 +1,34 @@
+/* PR c/35751 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo (int i)
+{
+ extern int a[i]; /* { dg-error "must have no linkage|storage size of" } */
+ static int b[i]; /* { dg-error "storage size of" } */
+
+#pragma omp parallel
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel shared (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel private (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+
+#pragma omp parallel firstprivate (a, b)
+ {
+ a[0] = 0;
+ b[0] = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35818.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35818.c
new file mode 100644
index 000000000..b2165eb39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr35818.c
@@ -0,0 +1,16 @@
+/* PR middle-end/35818 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+extern int a[];
+
+void
+foo (void)
+{
+#pragma omp parallel
+#pragma omp master
+ a[3] = 1;
+#pragma omp parallel shared(a)
+#pragma omp master
+ a[3] = 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr36790.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr36790.c
new file mode 100644
index 000000000..b3379f156
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr36790.c
@@ -0,0 +1,23 @@
+/* PR middle-end/36790 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo (char b)
+{
+}
+
+void
+bar (char b)
+{
+ foo (b);
+ #pragma omp task default (shared)
+ b = 0;
+}
+
+int
+main ()
+{
+ bar (0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr38633.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr38633.c
new file mode 100644
index 000000000..6c96bd1c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr38633.c
@@ -0,0 +1,14 @@
+/* PR middle-end/38633 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo ()
+{
+#pragma omp parallel
+ {
+ struct A { int i; } j;
+ j.i = 6;
+ j.i++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr38676.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr38676.c
new file mode 100644
index 000000000..cd9312028
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr38676.c
@@ -0,0 +1,19 @@
+/* PR middle-end/38676 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+int
+main ()
+{
+ int bar, foo = 1;
+#pragma omp parallel for shared(foo)
+ for (bar = 0; bar < 3; bar++)
+ {
+ switch (foo)
+ {
+ case 1:
+ break;
+ }
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr39495-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr39495-1.c
new file mode 100644
index 000000000..cc165ca52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr39495-1.c
@@ -0,0 +1,95 @@
+/* PR c/39495 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#define INT_MIN (-__INT_MAX__ - 1)
+#define INT_MAX __INT_MAX__
+#define UINT_MAX (2U * __INT_MAX__ + 1)
+
+int
+foo (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN + 1; i--)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i >= INT_MIN + 1; i--)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN; i--)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX - 1; i++)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i <= INT_MAX - 1; i++)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX; i++)
+ ;
+#pragma omp for
+ for (u = 6; u > 1; u--)
+ ;
+#pragma omp for
+ for (u = 6; u >= 1; u--)
+ ;
+#pragma omp for
+ for (u = 6; u > 0; u--)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX - 1; u++)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u <= UINT_MAX - 1; u++)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX; u++)
+ ;
+}
+
+int
+bar (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN + 1; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i >= INT_MIN + 1; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i > INT_MIN; i -= 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX - 1; i += 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i <= INT_MAX - 1; i += 2)
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i < INT_MAX; i += 2)
+ ;
+#pragma omp for
+ for (u = 6; u > 1; u -= 2)
+ ;
+#pragma omp for
+ for (u = 6; u >= 1; u -= 2)
+ ;
+#pragma omp for
+ for (u = 6; u > 0; u -= 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX - 1; u += 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u <= UINT_MAX - 1; u += 2)
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u < UINT_MAX; u += 2)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr39495-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr39495-2.c
new file mode 100644
index 000000000..a276c24ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr39495-2.c
@@ -0,0 +1,39 @@
+/* PR c/39495 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#define INT_MIN (-__INT_MAX__ - 1)
+#define INT_MAX __INT_MAX__
+#define UINT_MAX (2U * __INT_MAX__ + 1)
+
+int
+foo (void)
+{
+ int i;
+ unsigned int u;
+
+#pragma omp for
+ for (i = INT_MIN + 6; i != INT_MIN; i--) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (i = INT_MIN + 6; i == INT_MIN; i--) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i != INT_MAX; i++) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (i = INT_MAX - 6; i == INT_MAX; i++) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (u = 6; u != 0; u--) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (u = 6; u == 0; u--) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u != UINT_MAX; u++) /* { dg-error "invalid controlling predicate" } */
+ ;
+#pragma omp for
+ for (u = UINT_MAX - 6; u == UINT_MAX; u++) /* { dg-error "invalid controlling predicate" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr44085.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr44085.c
new file mode 100644
index 000000000..55462abe5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr44085.c
@@ -0,0 +1,27 @@
+/* PR middle-end/44085 */
+/* { dg-do compile } */
+/* { dg-require-effective-target tls_native } */
+/* { dg-options "-fopenmp" } */
+
+int thr1, thr2;
+#pragma omp threadprivate (thr1, thr2)
+
+void
+foo (void)
+{
+#pragma omp task untied /* { dg-error "enclosing task" } */
+ {
+ thr1++; /* { dg-error "used in untied task" } */
+ thr2 |= 4; /* { dg-error "used in untied task" } */
+ }
+}
+
+void
+bar (void)
+{
+#pragma omp task
+ {
+ thr1++;
+ thr2 |= 4;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr47963.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr47963.c
new file mode 100644
index 000000000..636a9542c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr47963.c
@@ -0,0 +1,11 @@
+/* PR c/47963 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void
+foo (float n)
+{
+ int A[n][n]; /* { dg-error "has non-integer type" } */
+#pragma omp parallel private(A)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr48591.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr48591.c
new file mode 100644
index 000000000..e6cb106d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr48591.c
@@ -0,0 +1,22 @@
+/* PR middle-end/48591 */
+/* { dg-do compile { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "-fopenmp" } */
+
+extern void abort (void);
+
+int
+main ()
+{
+ __float128 f = 0.0;
+ int i;
+ #pragma omp parallel for reduction(+:f)
+ for (i = 0; i < 128; i++)
+ f += 0.5Q;
+ if (f != 64.0Q)
+ abort ();
+ #pragma omp atomic
+ f += 8.5Q;
+ if (f != 72.5Q)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr48716.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr48716.c
new file mode 100644
index 000000000..3496e2f02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr48716.c
@@ -0,0 +1,24 @@
+/* PR c/48716 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+int
+main (void)
+{
+ #pragma omp parallel default(none)
+ {
+ static int s;
+ int t = 0;
+ #pragma omp atomic
+ s++;
+ t++;
+ }
+ #pragma omp task default(none)
+ {
+ static int s;
+ int t = 0;
+ #pragma omp atomic
+ s++;
+ t++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr49640.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr49640.c
new file mode 100644
index 000000000..6e0973864
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr49640.c
@@ -0,0 +1,29 @@
+/* PR middle-end/49640 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -fopenmp" } */
+
+void
+foo (int N, int M, int K, int P, int Q, int R, int i, int j, int k,
+ unsigned char x[P][Q][R], int y[N][M][K])
+{
+ int ii, jj, kk;
+
+#pragma omp parallel for private(ii,jj,kk)
+ for (ii = 0; ii < P; ++ii)
+ for (jj = 0; jj < Q; ++jj)
+ for (kk = 0; kk < R; ++kk)
+ y[i + ii][j + jj][k + kk] = x[ii][jj][kk];
+}
+
+void
+bar (int N, int M, int K, int P, int Q, int R, int i, int j, int k,
+ unsigned char x[P][Q][R], float y[N][M][K], float factor, float zero)
+{
+ int ii, jj, kk;
+
+#pragma omp parallel for private(ii,jj,kk)
+ for (ii = 0; ii < P; ++ii)
+ for (jj = 0; jj < Q; ++jj)
+ for (kk = 0; kk < R; ++kk)
+ y[i + ii][j + jj][k + kk] = factor * x[ii][jj][kk] + zero;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr51339.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr51339.c
new file mode 100644
index 000000000..198e4c13e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr51339.c
@@ -0,0 +1,15 @@
+/* PR c/51339 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+char g[] = "g";
+
+void
+foo (void)
+{
+#pragma omp parallel sections firstprivate (g) lastprivate (g)
+ {
+ #pragma omp section
+ g[0] = 'h';
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr53992.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr53992.c
new file mode 100644
index 000000000..4d5af3ce7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr53992.c
@@ -0,0 +1,21 @@
+/* PR middle-end/53992 */
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fopenmp" } */
+/* { dg-require-effective-target fgnu_tm } */
+
+int main() {
+ long data[10000];
+ long i, min=10000;
+ for (i=0; i<10000; i++) data[i] = -i;
+
+#pragma omp parallel for
+ for (i=0; i<10000; i++) {
+ __transaction_atomic
+ {
+ if (data[i] < min)
+ min = data[i];
+ }
+ }
+
+ return !(min == -9999);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr57412.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr57412.c
new file mode 100644
index 000000000..246f53239
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr57412.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+int thr;
+#pragma omp threadprivate (thr)
+int foo ()
+{
+ int l;
+#pragma omp parallel copyin (thr) reduction (||:l)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr58809.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr58809.c
new file mode 100644
index 000000000..5dc02f65a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr58809.c
@@ -0,0 +1,13 @@
+/* PR middle-end/58809 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -O" } */
+
+int i;
+#pragma omp threadprivate (i)
+
+void foo()
+{
+ _Complex int j;
+#pragma omp parallel copyin (i) reduction (&&:j)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr59669-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr59669-1.c
new file mode 100644
index 000000000..c72156d4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr59669-1.c
@@ -0,0 +1,9 @@
+/* PR middle-end/59669 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#pragma omp declare simd linear(a)
+void
+foo (int a)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr59669-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr59669-2.c
new file mode 100644
index 000000000..f6aad8998
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr59669-2.c
@@ -0,0 +1,9 @@
+/* PR middle-end/59669 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#pragma omp declare simd uniform(a) aligned(a:32)
+void
+bar (int *a)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr60534.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr60534.c
new file mode 100644
index 000000000..f8a6bdc1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/pr60534.c
@@ -0,0 +1,16 @@
+/* PR middle-end/60534 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -O -fno-tree-loop-optimize" } */
+
+extern int d[];
+
+int
+foo (int a)
+{
+ int c = 0;
+ int l;
+#pragma omp simd reduction(+: c)
+ for (l = 0; l < a; ++l)
+ c += d[l];
+ return c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/preprocess-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/preprocess-1.c
new file mode 100644
index 000000000..714c8404d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/preprocess-1.c
@@ -0,0 +1,16 @@
+/* { dg-do preprocess } */
+
+void foo (void)
+{
+ int i1, j1, k1;
+#define p parallel
+#define P(x) private (x##1)
+#define S(x) shared (x##1)
+#define F(x) firstprivate (x##1)
+#pragma omp p P(i) \
+ S(j) \
+ F(k)
+ ;
+}
+
+/* { dg-final { scan-file preprocess-1.i "(^|\n)#pragma omp parallel private \\(i1\\) shared \\(j1\\) firstprivate \\(k1\\)($|\n)" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-1.c
new file mode 100644
index 000000000..43704908e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-1.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+
+extern void bar(int);
+
+void f1(void)
+{
+ #pragma omp sections nowait
+ {
+ bar (1);
+ #pragma omp section
+ bar (2);
+ #pragma omp section
+ bar (3);
+ #pragma omp section
+ bar (4);
+ #pragma omp section
+ bar (5);
+ }
+}
+
+void f2(void)
+{
+ #pragma omp sections
+ {
+ #pragma omp section
+ {
+ bar (1);
+ bar (1);
+ }
+ #pragma omp section
+ bar (2);
+ #pragma omp section
+ bar (3);
+ #pragma omp section
+ bar (4);
+ #pragma omp section
+ bar (5);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-2.c
new file mode 100644
index 000000000..aabdfaf80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+extern void bar(int);
+void foo(void)
+{
+ #pragma omp sections
+ bar (0); // { dg-error "expected" }
+
+ #pragma omp sections
+ {
+ } // { dg-error "expected" }
+
+ #pragma omp sections
+ {
+ bar (1);
+ }
+
+ #pragma omp sections
+ {
+ #pragma omp section
+ bar(2);
+ bar(3); // { dg-error "expected" }
+ bar(4);
+ #pragma omp section
+ bar(5);
+ bar(6); // { dg-error "expected" }
+ bar(7);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-3.c
new file mode 100644
index 000000000..d8fb2a09d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-3.c
@@ -0,0 +1,15 @@
+
+// { dg-do compile }
+
+extern void bar (void);
+
+int main (void)
+{
+ #pragma omp parallel sections nowait /* { dg-error "'nowait'" } */
+ {
+ #pragma omp section
+ { bar(); }
+ #pragma omp section
+ { bar(); }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-4.c
new file mode 100644
index 000000000..62a2ecddf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sections-4.c
@@ -0,0 +1,13 @@
+/* PR c++/24613 */
+/* { dg-do compile } */
+
+#pragma omp section /* { dg-error "may only be used in" } */
+
+int i;
+
+void
+foo (void)
+{
+ #pragma omp section /* { dg-error "may only be used in" } */
+ i++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-1.c
new file mode 100644
index 000000000..90d389b72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-1.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+#include <stdlib.h>
+
+int thrglobalvar;
+#pragma omp threadprivate (thrglobalvar)
+int globalvar;
+const int constvar = 8;
+
+int
+foo (int x)
+{
+ return x;
+}
+
+int
+bar (int *x)
+{
+ return *x;
+}
+
+int
+main (void)
+{
+ static int thrlocvar;
+#pragma omp threadprivate (thrlocvar)
+ static int locvar;
+ static int *p;
+ int i, j, s, l;
+
+ p = malloc (sizeof (int));
+ if (p == NULL)
+ return 0;
+ *p = 7;
+ s = 6;
+ l = 0;
+#pragma omp parallel for /* { dg-error "enclosing parallel" } */ \
+ default (none) private (p) shared (s)
+ for (i = 0; i < 64; i++)
+ {
+ int k = foo (0); /* Predetermined - private (automatic var declared */
+ k++; /* in scope of construct). */
+ thrglobalvar++; /* Predetermined - threadprivate. */
+ thrlocvar++; /* Predetermined - threadprivate. */
+ foo (i); /* Predetermined - private (omp for loop variable). */
+ foo (constvar); /* Predetermined - shared (const qualified type). */
+ foo (*p); /* *p predetermined - shared (heap allocated */
+ (*p)++; /* storage). */
+ bar (p); /* Explicitly determined - private. */
+ foo (s); /* Explicitly determined - shared. */
+ globalvar++; /* { dg-error "not specified in" } */
+ locvar++; /* { dg-error "not specified in" } */
+ l++; /* { dg-error "not specified in" } */
+ for (j = 0; j < 2; j++); /* { dg-error "not specified in" } */
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-2.c
new file mode 100644
index 000000000..33bbb3bad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ int i;
+ int a[10];
+ #pragma omp parallel private (i) shared (a)
+ {
+ i = 1;
+ #pragma omp parallel shared (a, i)
+ {
+ #pragma omp master
+ i = 2;
+ #pragma omp parallel private (i) shared (a)
+ {
+ for (i = 0; i < 10; i++)
+ a[i] = i + 1;
+ }
+ #pragma omp master
+ i = 3;
+ }
+ i = 4;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-3.c
new file mode 100644
index 000000000..36f72e3ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/sharing-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+#define N 50
+#define CHUNKSIZE 5
+
+main ()
+{
+ int i, chunk;
+ float c[N];
+
+ chunk = CHUNKSIZE;
+#pragma omp parallel for shared (c, chunk) schedule (dynamic, chunk)
+ for (i = 0; i < N; i++)
+ c[i] = i;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-1.c
new file mode 100644
index 000000000..486b67a63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -fdump-tree-optimized -O3" } */
+
+/* Test that functions that have SIMD clone counterparts are not
+ cloned by IPA-cp. For example, special_add() below has SIMD clones
+ created for it. However, if IPA-cp later decides to clone a
+ specialization of special_add(x, 666) when analyzing fillit(), we
+ will forever keep the vectorizer from using the SIMD versions of
+ special_add in a loop.
+
+ If IPA-CP gets taught how to adjust the SIMD clones as well, this
+ test could be removed. */
+
+#pragma omp declare simd simdlen(4)
+static int __attribute__ ((noinline))
+special_add (int x, int y)
+{
+ if (y == 666)
+ return x + y + 123;
+ else
+ return x + y;
+}
+
+void fillit(int *tot)
+{
+ int i;
+
+ for (i=0; i < 10000; ++i)
+ tot[i] = special_add (i, 666);
+}
+
+/* { dg-final { scan-tree-dump-not "special_add.constprop" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-2.c
new file mode 100644
index 000000000..030ae6cb1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-2.c
@@ -0,0 +1,26 @@
+/* { dg-options "-fopenmp -fdump-tree-optimized -O" } */
+
+#pragma omp declare simd inbranch uniform(c) linear(b:66)
+#pragma omp declare simd notinbranch aligned(c:32)
+int addit(int a, int b, int *c)
+{
+ return a + b;
+}
+
+#pragma omp declare simd uniform(a) aligned(a:32) linear(k:1) notinbranch
+float setArray(float *a, float x, int k)
+{
+ a[k] = a[k] + x;
+ return a[k];
+}
+
+/* { dg-final { scan-tree-dump "_ZGVbN4ua32vl_setArray" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVbN4vvva32_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVbM4vl66u_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVcN8ua32vl_setArray" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVcN4vvva32_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVcM4vl66u_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVdN8ua32vl_setArray" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVdN8vvva32_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVdM8vl66u_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-3.c
new file mode 100644
index 000000000..98e767c3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-3.c
@@ -0,0 +1,18 @@
+/* { dg-options "-fopenmp -fdump-tree-optimized -O2" } */
+
+/* Test that if there is no *inbranch clauses, that both the masked and
+ the unmasked version are created. */
+
+#pragma omp declare simd
+int addit(int a, int b, int c)
+{
+ return a + b;
+}
+
+/* { dg-final { scan-tree-dump "_ZGVbN4vvv_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVbM4vvv_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVcN4vvv_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVcM4vvv_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVdN8vvv_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump "_ZGVdM8vvv_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-4.c
new file mode 100644
index 000000000..893f44e69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-4.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-fopenmp" } */
+
+#pragma omp declare simd simdlen(4) notinbranch
+int f2 (int a, int b)
+{
+ if (a > 5)
+ return a + b;
+ else
+ return a - b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-5.c
new file mode 100644
index 000000000..84785e148
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-5.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-fopenmp -w" } */
+
+/* ?? The -w above is to inhibit the following warning for now:
+ a.c:2:6: warning: AVX vector argument without AVX enabled changes
+ the ABI. */
+
+#pragma omp declare simd notinbranch simdlen(4)
+void foo (int *a)
+{
+ *a = 555;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-6.c
new file mode 100644
index 000000000..8818594bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-6.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-fopenmp" } */
+
+/* Test that array subscripts are properly adjusted. */
+
+int array[1000];
+#pragma omp declare simd notinbranch simdlen(4)
+void foo (int i)
+{
+ array[i] = 555;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-7.c
new file mode 100644
index 000000000..ef6fa113c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/simd-clones-7.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-fopenmp -w" } */
+
+int array[1000];
+
+#pragma omp declare simd notinbranch simdlen(4)
+void foo (int *a, int b)
+{
+ a[b] = 555;
+}
+
+#pragma omp declare simd notinbranch simdlen(4)
+void bar (int *a)
+{
+ *a = 555;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/static.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/static.c
new file mode 100644
index 000000000..8996d818b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/static.c
@@ -0,0 +1,14 @@
+static int bork;
+
+void bar(void);
+
+void foobar (void)
+{
+#pragma omp parallel
+ {
+#pragma omp for lastprivate(bork)
+ for (bork = 0; bork < 100; bork++) {
+ bar();
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/target-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/target-1.c
new file mode 100644
index 000000000..09e65bd31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/target-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+ bad1:
+ #pragma omp target
+ goto bad1; /* { dg-error "invalid branch" } */
+
+ goto bad2; /* { dg-error "invalid entry" } */
+ #pragma omp target
+ {
+ bad2: ;
+ }
+
+ #pragma omp target
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+
+ switch (x) /* { dg-error "invalid entry" } */
+ {
+ #pragma omp target
+ { case 0:; }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/target-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/target-2.c
new file mode 100644
index 000000000..546a1d0c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/target-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+void
+foo (int x, int y)
+{
+ bad1:
+ #pragma omp target data map(tofrom: y)
+ goto bad1; /* { dg-error "invalid branch" } */
+
+ goto bad2; /* { dg-error "invalid entry" } */
+ #pragma omp target data map(tofrom: y)
+ {
+ bad2: ;
+ }
+
+ #pragma omp target data map(tofrom: y)
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+
+ switch (x) /* { dg-error "invalid entry" } */
+ {
+ #pragma omp target data map(tofrom: y)
+ { case 0:; }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/taskgroup-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/taskgroup-1.c
new file mode 100644
index 000000000..e301efc19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/taskgroup-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+ bad1:
+ #pragma omp taskgroup
+ goto bad1; /* { dg-error "invalid branch" } */
+
+ goto bad2; /* { dg-error "invalid entry" } */
+ #pragma omp taskgroup
+ {
+ bad2: ;
+ }
+
+ #pragma omp taskgroup
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+
+ switch (x) /* { dg-error "invalid entry" } */
+ {
+ #pragma omp taskgroup
+ { case 0:; }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/teams-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/teams-1.c
new file mode 100644
index 000000000..73c00ded7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/teams-1.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+ bad1:
+ #pragma omp target teams
+ goto bad1; /* { dg-error "invalid branch" } */
+
+ goto bad2; /* { dg-error "invalid entry" } */
+ #pragma omp target teams
+ {
+ bad2: ;
+ }
+
+ #pragma omp target teams
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+
+ switch (x) /* { dg-error "invalid entry" } */
+ {
+ #pragma omp target teams
+ { case 0:; }
+ }
+}
+
+void
+bar (int x)
+{
+ bad1:
+ #pragma omp target
+ #pragma omp teams
+ goto bad1; /* { dg-error "invalid branch" } */
+
+ goto bad2; /* { dg-error "invalid entry" } */
+ #pragma omp target
+ #pragma omp teams
+ {
+ bad2: ;
+ }
+
+ #pragma omp target
+ #pragma omp teams
+ {
+ int i;
+ goto ok1;
+ for (i = 0; i < 10; ++i)
+ { ok1: break; }
+ }
+
+ switch (x) /* { dg-error "invalid entry" } */
+ {
+ #pragma omp target
+ #pragma omp teams
+ { case 0:; }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/tls-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/tls-1.c
new file mode 100644
index 000000000..9dc102e7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/tls-1.c
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// { dg-require-effective-target tls }
+
+int tp1;
+static int tp2;
+extern int tp3;
+
+int tp4 = 1;
+static int tp5 = 1;
+
+#pragma omp threadprivate (tp1, tp2, tp3, tp4, tp5)
+
+#pragma omp threadprivate (undef) // { dg-error "undeclared" }
+
+int tp6;
+int foo(void) { return tp6; }
+
+#pragma omp threadprivate (tp6) // { dg-error "after first use" }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/tls-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/tls-2.c
new file mode 100644
index 000000000..80275f908
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/tls-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+extern char buf[];
+#pragma omp threadprivate (buf) /* { dg-error "has incomplete type" } */
+
+void
+foo (void)
+{
+ int i;
+#pragma omp threadprivate (i) /* { dg-error "automatic variable" } */
+ i = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-1.c
new file mode 100644
index 000000000..4948a984f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-1.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+#pragma omp declare reduction (| : long int : omp_out |= omp_in) /* { dg-error "predeclared arithmetic type" } */
+#pragma omp declare reduction (+ : char : omp_out += omp_in) /* { dg-error "predeclared arithmetic type" } */
+typedef short T;
+#pragma omp declare reduction (min : T : omp_out += omp_in) /* { dg-error "predeclared arithmetic type" } */
+#pragma omp declare reduction (* : _Complex double : omp_out *= omp_in) /* { dg-error "predeclared arithmetic type" } */
+
+void
+foo (void)
+{
+ #pragma omp declare reduction (| : long int : omp_out |= omp_in) /* { dg-error "predeclared arithmetic type" } */
+ #pragma omp declare reduction (+ : char : omp_out += omp_in) /* { dg-error "predeclared arithmetic type" } */
+ #pragma omp declare reduction (min : T : omp_out += omp_in) /* { dg-error "predeclared arithmetic type" } */
+ #pragma omp declare reduction (* : _Complex double : omp_out *= omp_in) /* { dg-error "predeclared arithmetic type" } */
+}
+
+#pragma omp declare reduction (| : __typeof (foo) : omp_out |= omp_in) /* { dg-error "function or array" } */
+#pragma omp declare reduction (+ : char () : omp_out += omp_in) /* { dg-error "function or array" } */
+#pragma omp declare reduction (min : T[2] : omp_out += omp_in) /* { dg-error "function or array" } */
+
+void
+bar (void)
+{
+ #pragma omp declare reduction (| : __typeof (foo) : omp_out |= omp_in)/* { dg-error "function or array" } */
+ #pragma omp declare reduction (+ : char () : omp_out += omp_in) /* { dg-error "function or array" } */
+ #pragma omp declare reduction (min : T[2] : omp_out += omp_in) /* { dg-error "function or array" } */
+}
+
+struct A { int a; };
+#pragma omp declare reduction (| : const struct A : omp_out.a |= omp_in.a) /* { dg-error "const, volatile or restrict" } */
+#pragma omp declare reduction (+ : __const struct A : omp_out.a += omp_in.a) /* { dg-error "const, volatile or restrict" } */
+typedef volatile struct A T2;
+#pragma omp declare reduction (min : T2 : omp_out.a += omp_in.a) /* { dg-error "const, volatile or restrict" } */
+#pragma omp declare reduction (* : struct A *__restrict : omp_out->a *= omp_in->a)/* { dg-error "const, volatile or restrict" } */
+
+void
+baz (void)
+{
+ #pragma omp declare reduction (| : const struct A : omp_out.a |= omp_in.a) /* { dg-error "const, volatile or restrict" } */
+ #pragma omp declare reduction (+ : __const struct A : omp_out.a += omp_in.a) /* { dg-error "const, volatile or restrict" } */
+ typedef volatile struct A T3;
+ #pragma omp declare reduction (min : T3 : omp_out.a += omp_in.a) /* { dg-error "const, volatile or restrict" } */
+ #pragma omp declare reduction (* : struct A *__restrict : omp_out->a *= omp_in->a)/* { dg-error "const, volatile or restrict" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-2.c
new file mode 100644
index 000000000..87992d7c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-2.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+struct W { int w; };
+void init (struct W *, int, int *);
+int v;
+#pragma omp declare reduction (foo : long int : omp_out |= v) /* { dg-error "combiner refers to variable" } */
+#pragma omp declare reduction (foo : char : omp_out = v) /* { dg-error "combiner refers to variable" } */
+typedef short T;
+#pragma omp declare reduction (foo : T : omp_out += v) /* { dg-error "combiner refers to variable" } */
+#pragma omp declare reduction (foo : int : v *= omp_in) /* { dg-error "combiner refers to variable" } */
+#pragma omp declare reduction (foo : struct W : omp_out.w *= omp_in.w + v) /* { dg-error "combiner refers to variable" } */
+
+void
+foo (int v)
+{
+ #pragma omp declare reduction (foo : long int : omp_out |= v) /* { dg-error "combiner refers to variable" } */
+ #pragma omp declare reduction (foo : char : omp_out = v) /* { dg-error "combiner refers to variable" } */
+ #pragma omp declare reduction (foo : T : omp_out += v) /* { dg-error "combiner refers to variable" } */
+ #pragma omp declare reduction (foo : int : v *= omp_in) /* { dg-error "combiner refers to variable" } */
+ #pragma omp declare reduction (foo : struct W : omp_out.w *= omp_in.w + v) /* { dg-error "combiner refers to variable" } */
+}
+
+#pragma omp declare reduction (bar : long int : omp_out |= omp_in) initializer (omp_priv = v) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar : char : omp_out += omp_in) initializer (omp_priv = ((char) v)) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar : T : omp_out += omp_in) initializer (omp_priv = (short) v) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar : _Complex double : omp_out *= omp_in) initializer (omp_priv = (v)) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar : struct W : omp_out.w *= omp_in.w) initializer (omp_priv = { v } ) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar2 : struct W : omp_out.w *= omp_in.w) initializer (init (&omp_priv, v, (int *) 0)) /* { dg-error "initializer refers to variable" } */
+#pragma omp declare reduction (bar3 : struct W : omp_out.w *= omp_in.w) initializer (init (&omp_priv, 0, &v)) /* { dg-error "initializer refers to variable" } */
+
+void
+bar (int v)
+{
+ #pragma omp declare reduction (bar : long int : omp_out |= omp_in) initializer (omp_priv = v) /* { dg-error "initializer refers to variable" } */
+ #pragma omp declare reduction (bar : char : omp_out += omp_in) initializer (omp_priv = ((char) v)) /* { dg-error "initializer refers to variable" } */
+ #pragma omp declare reduction (bar : T : omp_out += omp_in) initializer (omp_priv = (short) v) /* { dg-error "initializer refers to variable" } */
+ #pragma omp declare reduction (bar : _Complex double : omp_out *= omp_in) initializer (omp_priv = (v)) /* { dg-error "initializer refers to variable" } */
+ #pragma omp declare reduction (bar : struct W : omp_out.w *= omp_in.w) initializer (omp_priv = { v }) /* { dg-error "initializer refers to variable" } */
+ #pragma omp declare reduction (bar2 : struct W : omp_out.w *= omp_in.w) initializer (init (&omp_priv, v, (int *) 0)) /* { dg-error "initializer refers to variable" } */
+ #pragma omp declare reduction (bar3 : struct W : omp_out.w *= omp_in.w) initializer (init (&omp_priv, 0, &v)) /* { dg-error "initializer refers to variable" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-3.c
new file mode 100644
index 000000000..bdfcce1d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-3.c
@@ -0,0 +1,77 @@
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+struct S { int s; };
+struct T { int t; };
+struct U { int u; };
+
+#pragma omp declare reduction (+: struct S: omp_out.s += omp_in.s)
+#pragma omp declare reduction (*: struct S: omp_out.s *= omp_in.s) \
+ initializer (omp_priv = {1})
+#pragma omp declare reduction (foo: struct S: omp_out.s += omp_in.s)
+
+void
+f1 ()
+{
+ struct S s, s2;
+ struct T t;
+ #pragma omp declare reduction (+: struct T: omp_out.t += omp_in.t)
+ #pragma omp parallel reduction (+: t) reduction (foo: s) reduction (*: s2)
+ s.s = 1, t.t = 1, s2.s = 2;
+ #pragma omp parallel reduction (+: s)
+ s.s = 1;
+}
+
+void bar (struct S *);
+
+void
+f2 ()
+{
+ #pragma omp declare reduction (foo: struct S: omp_out.s += omp_in.s) initializer (bar (&omp_priv))
+ #pragma omp declare reduction (bar: struct S: omp_out.s += omp_in.s) initializer (bar (&omp_orig)) /* { dg-error "one of the initializer call arguments should be" } */
+}
+
+#pragma omp declare reduction (+: struct U: omp_out.u *= omp_in.u) /* { dg-error "previous" } */
+#pragma omp declare reduction (+: struct U: omp_out.u += omp_in.u) /* { dg-error "redeclaration of" } */
+
+void
+f3 ()
+{
+ #pragma omp declare reduction (f3: struct U: omp_out.u *= omp_in.u) /* { dg-error "previous" } */
+ #pragma omp declare reduction (f3: struct U: omp_out.u += omp_in.u) /* { dg-error "redeclaration of" } */
+}
+
+struct V
+{
+ #pragma omp declare reduction (bar: struct S: omp_out.s *= omp_in.s) /* { dg-error "not at file or block scope" } */
+ #pragma omp declare reduction (bar: struct S: omp_out.s += omp_in.s) /* { dg-error "not at file or block scope" } */
+};
+
+#pragma omp declare reduction (n3: long: omp_out += omp_in) /* { dg-error "previous" } */
+#pragma omp declare reduction (n3: long int: omp_out += omp_in) /* { dg-error "redeclaration of" } */
+#pragma omp declare reduction (n3: short unsigned: omp_out += omp_in)
+#pragma omp declare reduction (n3: short int: omp_out += omp_in)
+
+void
+f4 (void)
+{
+ #pragma omp declare reduction (f4: long: omp_out += omp_in) /* { dg-error "previous" } */
+ #pragma omp declare reduction (f4: long int: omp_out += omp_in) /* { dg-error "redeclaration of" } */
+ #pragma omp declare reduction (f4: short unsigned: omp_out += omp_in)
+ #pragma omp declare reduction (f4: short int: omp_out += omp_in)
+}
+
+void
+f5 (void)
+{
+ #pragma omp declare reduction (+: struct S: omp_out.s += omp_in.s) initializer (omp_priv) /* { dg-error "expected" } */
+ #pragma omp declare reduction (+: struct T: omp_out.t += omp_in.t) initializer (omp_priv ()) /* { dg-error "expected" } */
+}
+
+void
+f6 (a, b)
+#pragma omp declare reduction (bar: struct S: omp_out.s *= omp_in.s) /* { dg-error "expected declaration specifiers before" } */
+ int a;
+ int b;
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-4.c
new file mode 100644
index 000000000..3758f91e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/udr-4.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+struct S;
+#pragma omp declare reduction (+:struct S:omp_out.s += omp_in.s) /* { dg-error "invalid use of undefined type" } */
+struct S { int s; };
+#pragma omp declare reduction (*:struct S:omp_out.s *= omp_in.s)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/uninit-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/uninit-1.c
new file mode 100644
index 000000000..223e617b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/uninit-1.c
@@ -0,0 +1,13 @@
+// PR 24612
+// { dg-do compile }
+// { dg-options "-O -Wuninitialized -fopenmp" }
+
+void foo()
+{
+ int i;
+#pragma omp parallel shared(i)
+ {
+ i = 0;
+ ++i;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-1.c
new file mode 100644
index 000000000..bb37f33e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-1.c
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+void foo(int n)
+{
+ int A[n];
+
+ #pragma omp parallel default(none) // { dg-error "enclosing" }
+ {
+ A[0] = 0; // { dg-error "'A' not specified" }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-2.c
new file mode 100644
index 000000000..fc18ffc57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-2.c
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+void foo(int n, int i)
+{
+ int A[n];
+
+ #pragma omp parallel private(A)
+ {
+ A[i] = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-3.c
new file mode 100644
index 000000000..b1677b833
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-3.c
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+void foo(int n, int i)
+{
+ int A[n];
+
+ #pragma omp parallel shared(A)
+ {
+ A[i] = sizeof(A);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-4.c
new file mode 100644
index 000000000..2c3c0aa43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-4.c
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+void foo(int n, int i)
+{
+ int A[n];
+
+ #pragma omp parallel firstprivate(A)
+ {
+ A[i] = 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-5.c
new file mode 100644
index 000000000..6c6d5517a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/gomp/vla-5.c
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+void foo(int n, int i)
+{
+ int A[n];
+
+ #pragma omp parallel sections lastprivate(A)
+ {
+ A[i] = 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-0.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-0.c
new file mode 100644
index 000000000..9bf97126d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-0.c
@@ -0,0 +1,46 @@
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 1000
+int a[N];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ int j;
+ int i;
+
+ /* This is not blocked as it is not profitable. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[j] = a[i] + 1;
+
+ return a[0];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, res;
+
+ for (i = 0; i < N; i++)
+ a[i] = i;
+
+ res = foo ();
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 1999)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "will be loop blocked" "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-1.c
new file mode 100644
index 000000000..d335345a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-1.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define MAX 100
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j;
+ int sum = 0;
+ int A[MAX * MAX];
+ int B[MAX * MAX];
+
+ /* These loops should be loop blocked. */
+ for (i = 0; i < MAX; i++)
+ for (j = 0; j < MAX; j++)
+ {
+ A[i*MAX + j] = j;
+ B[i*MAX + j] = j;
+ }
+
+ /* These loops should be loop blocked. */
+ for (i = 0; i < MAX; i++)
+ for (j = 0; j < MAX; j++)
+ A[i*MAX + j] += B[j*MAX + i];
+
+ /* These loops should be loop blocked. */
+ for(i = 0; i < MAX; i++)
+ for(j = 0; j < MAX; j++)
+ sum += A[i*MAX + j];
+
+#if DEBUG
+ fprintf (stderr, "sum = %d \n", sum);
+#endif
+
+ if (sum != 990000)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 3 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-3.c
new file mode 100644
index 000000000..3b9db31fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-3.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target size32plus } */
+/* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */
+/* { dg-timeout-factor 4.0 } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 24
+#define M 100
+
+int A[M][M][M], B[M][M], C[M][M];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ int i, j, k;
+
+ /* These loops contain too few iterations to be blocked by 64. */
+ for (i = 0; i < 24; i++)
+ for (j = 0; j < 24; j++)
+ for (k = 0; k < 24; k++)
+ A[i][j][k] = B[i][k] * C[k][j];
+
+ /* These loops should still be loop blocked. */
+ for (i = 0; i < M; i++)
+ for (j = 0; j < M; j++)
+ for (k = 0; k < M; k++)
+ A[i][j][k] = B[i][k] * C[k][j];
+
+ return A[0][0][0] + A[M-1][M-1][M-1];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < M; i++)
+ for (j = 0; j < M; j++)
+ {
+ B[i][j] = i;
+ C[i][j] = j;
+ }
+
+ res = foo ();
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 9801)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-4.c
new file mode 100644
index 000000000..c206bf824
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-4.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target size32plus } */
+/* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 24
+#define M 1000
+
+int A[M][M], B[M][M], C[M][M];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ int i, j, k;
+
+ /* This should NOT be blocked: each loop iterates only 24 times. */
+ for (i = 0; i < 24; i++)
+ for (j = 0; j < 24; j++)
+ for (k = 0; k < 24; k++)
+ A[i][j] = B[i][k] * C[k][j];
+
+ /* This should be blocked. */
+ for (i = 0; i < M; i++)
+ for (j = 0; j < M; j++)
+ for (k = 0; k < M; k++)
+ A[i][j] = B[i][k] * C[k][j];
+
+ return A[0][0] + A[M-1][M-1];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < M; i++)
+ for (j = 0; j < M; j++)
+ {
+ B[i][j] = i;
+ C[i][j] = j;
+ }
+
+ res = foo ();
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 998001)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-5.c
new file mode 100644
index 000000000..b577958c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-5.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 200
+
+int a[N][N];
+int b[N][N];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ int i, j;
+ int res = 0;
+
+ /* This loop nest should be blocked. */
+ for (j = 1; j < N; j++)
+ for (i = 0; i < N; i++)
+ a[i][j] = a[i][j-1] + b[i][j];
+
+ for (i = 0; i < N; i++)
+ res += a[i][i];
+
+ return res;
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ a[i][j] = i + j;
+ b[i][j] = i - j;
+ }
+
+ res = foo ();
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 1333300)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-6.c
new file mode 100644
index 000000000..8f250db51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-6.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 200
+int a[N][N];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ int i, j;
+ int res = 0;
+
+ /* Interchange is not legal for loops 0 and 1. */
+ for (i = 1; i < N; i++)
+ for (j = 1; j < N - 1; j++)
+ a[i][j] = a[i-1][j+1] * a[i-1][j+1] / 2;
+
+ for (i = 0; i < N; i++)
+ res += a[i][i];
+
+ return res;
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[i][j] = i + j;
+
+ res = foo ();
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 204007516)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 0 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-7.c
new file mode 100644
index 000000000..bf9c60f41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-7.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target size32plus } */
+/* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 200
+
+int A[N][N], B[N][N], C[N][N];
+
+static void __attribute__((noinline))
+matmult (void)
+{
+ int i, j, k;
+
+ /* This should be blocked. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ A[i][j] = 0;
+ for (k = 0; k < N; k++)
+ A[i][j] += B[i][k] * C[k][j];
+ }
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res = 0;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ B[i][j] = j;
+ C[i][j] = i;
+ }
+
+ matmult ();
+
+ for (i = 0; i < N; i++)
+ res += A[i][i];
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 529340000)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-8.c
new file mode 100644
index 000000000..4e2f358fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-8.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target size32plus } */
+/* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 200
+
+int A[N][N], B[N][N], C[N][N];
+
+static void __attribute__((noinline))
+matmult (void)
+{
+ int i, j, k;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ A[i][j] = 0;
+
+ /* This should be blocked. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ for (k = 0; k < N; k++)
+ A[i][j] += B[i][k] * C[k][j];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res = 0;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ B[i][j] = j;
+ C[i][j] = i;
+ }
+
+ matmult ();
+
+ for (i = 0; i < N; i++)
+ res += A[i][i];
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 529340000)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-pr47654.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-pr47654.c
new file mode 100644
index 000000000..9cdeb0c35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/block-pr47654.c
@@ -0,0 +1,25 @@
+int a[128][40];
+
+void __attribute__ ((noinline, noclone))
+foo (void)
+{
+ int i, j;
+ for (i = 0; i < 40; i++)
+ for (j = 0; j < 128; j++)
+ a[j][i] = 4;
+}
+
+int
+main ()
+{
+ int i, j;
+ foo ();
+ for (i = 0; i < 40; i++)
+ for (j = 0; j < 128; j++)
+ if (a[j][i] != 4)
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "will be loop blocked" "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/graphite.exp
new file mode 100644
index 000000000..615fc258a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/graphite.exp
@@ -0,0 +1,81 @@
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+if ![check_effective_target_fgraphite] {
+ return
+}
+
+# Remove VALUE from LIST_VARIABLE.
+proc lremove {list_variable value} {
+ upvar 1 $list_variable var
+ set idx [lsearch -exact $var $value]
+ set var [lreplace $var $idx $idx]
+}
+
+# The default action for a test is 'compile'. Save current default.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+
+# Initialize `dg'.
+dg-init
+
+set wait_to_run_files [lsort [glob -nocomplain $srcdir/$subdir/*.c ] ]
+set scop_files [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ]
+set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ]
+set run_id_files [lsort [glob -nocomplain $srcdir/$subdir/run-id-*.c ] ]
+set interchange_files [lsort [glob -nocomplain $srcdir/$subdir/interchange-*.c ] ]
+set block_files [lsort [glob -nocomplain $srcdir/$subdir/block-*.c ] ]
+set vect_files [lsort [glob -nocomplain $srcdir/$subdir/vect-*.c ] ]
+
+# Tests to be compiled.
+set dg-do-what-default compile
+dg-runtest $scop_files "" "-O2 -fgraphite -fdump-tree-graphite-all"
+dg-runtest $id_files "" "-O2 -fgraphite-identity -ffast-math"
+
+# Tests to be run.
+set dg-do-what-default run
+dg-runtest $run_id_files "" "-O2 -fgraphite-identity"
+dg-runtest $interchange_files "" "-O2 -floop-interchange -fno-loop-block -fno-loop-strip-mine -ffast-math -fdump-tree-graphite-all"
+dg-runtest $block_files "" "-O2 -floop-block -fno-loop-strip-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all"
+
+# Vectorizer tests, to be run or compiled, depending on target capabilities.
+global DEFAULT_VECTCFLAGS
+set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math"
+
+if [check_vect_support_and_set_flags] {
+ dg-runtest $vect_files "" $DEFAULT_VECTCFLAGS
+}
+
+# The default action for the rest of the files is 'compile'.
+set dg-do-what-default compile
+foreach f $scop_files {lremove wait_to_run_files $f}
+foreach f $id_files {lremove wait_to_run_files $f}
+foreach f $run_id_files {lremove wait_to_run_files $f}
+foreach f $interchange_files {lremove wait_to_run_files $f}
+foreach f $block_files {lremove wait_to_run_files $f}
+foreach f $vect_files {lremove wait_to_run_files $f}
+dg-runtest $wait_to_run_files "" "-ansi -pedantic-errors"
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-1.c
new file mode 100644
index 000000000..70b477a07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-1.c
@@ -0,0 +1,18 @@
+typedef int *lambda_vector;
+typedef lambda_vector *lambda_matrix;
+lambda_vector_add_mc (lambda_vector vec1, int const1,
+ lambda_vector vec2, int const2,
+ lambda_vector vec3, int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ vec3[i] = const1 * vec1[i] + const2 * vec2[i];
+}
+lambda_matrix_add_mc (lambda_matrix mat1, int const1,
+ lambda_matrix mat2, int const2,
+ lambda_matrix mat3, int m, int n)
+{
+ int i;
+ for (i = 0; i < m; i++)
+ lambda_vector_add_mc (mat1[i], const1, mat2[i], const2, mat3[i], n);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-10.c
new file mode 100644
index 000000000..8c2b88982
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-10.c
@@ -0,0 +1,15 @@
+int bar[100][100];
+
+int
+foo (int N, unsigned int J)
+{
+ int i, k;
+
+ for (k = 0; k < N; k++)
+ if (k != J)
+ for (i = 0; i < N; i++)
+ if (i != J)
+ bar[k][i] = 20;
+
+ return bar[N][J];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-11.c
new file mode 100644
index 000000000..387512c3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-11.c
@@ -0,0 +1,14 @@
+double
+foo (double x, double *cof)
+{
+ int i;
+ double tmp, value;
+
+ for (i = 10; i >= 0; i--)
+ {
+ value += cof[i] / tmp;
+ tmp -= 1.0;
+ }
+
+ return value;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-12.c
new file mode 100644
index 000000000..57857d1d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-12.c
@@ -0,0 +1,10 @@
+void
+foo (unsigned short x[])
+{
+ int i;
+ unsigned short *p = &x[2];
+ if (*p)
+ x += 2;
+ for (i = 2; i < 9; i++, ++x)
+ *x >>= 8;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-13.c
new file mode 100644
index 000000000..e921cd4e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-13.c
@@ -0,0 +1,11 @@
+void
+foo (int N, int k, int *fb)
+{
+ int i, j;
+ for (i = 1; i <= N; i++)
+ {
+ for (j = 1; j < i; j++)
+ k %= N;
+ bar (k);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-14.c
new file mode 100644
index 000000000..51ac4c1bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-14.c
@@ -0,0 +1,19 @@
+typedef struct {
+ int n;
+ float *a;
+} bar;
+
+float
+foo (bar *b)
+{
+ float c, d;
+ int j;
+
+ for (j = 0; (j < b->n); j++)
+ d += b->a[j];
+
+ for (j = 0; (j < b->n); j++)
+ c += b->a[j];
+
+ return d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-15.c
new file mode 100644
index 000000000..b57c20969
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-15.c
@@ -0,0 +1,120 @@
+/* { dg-require-effective-target int32plus } */
+
+typedef long unsigned int size_t;
+extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
+
+static void
+encode (words, low, hi)
+ long *words;
+ unsigned long low;
+ long hi;
+{
+ words[0] = ((low) & (((unsigned long) 1 << (sizeof(unsigned long) / 2)) - 1));
+ words[1] = ((unsigned long) (low) >> sizeof(unsigned long) / 2);
+ words[2] = ((hi) & (((unsigned long) 1 << (sizeof(unsigned long) / 2)) - 1));
+ words[3] = ((unsigned long) (hi) >> sizeof(unsigned long) / 2);
+}
+
+static void
+decode (words, low, hi)
+ long *words;
+ unsigned long *low;
+ long *hi;
+{
+ *low = words[0] + words[1] * ((unsigned long) 1 << sizeof(unsigned long) / 2);
+ *hi = words[2] + words[3] * ((unsigned long) 1 << sizeof(unsigned long) / 2);
+}
+
+int
+neg_double (l1, h1, lv, hv)
+ unsigned long l1;
+ long h1;
+ unsigned long *lv;
+ long *hv;
+{
+ if (l1 == 0)
+ {
+ *lv = 0;
+ *hv = - h1;
+ return (*hv & h1) < 0;
+ }
+ else
+ {
+ *lv = -l1;
+ *hv = ~h1;
+ return 0;
+ }
+}
+
+int
+add_double (l1, h1, l2, h2, lv, hv)
+ unsigned long l1, l2;
+ long h1, h2;
+ unsigned long *lv;
+ long *hv;
+{
+ unsigned long l;
+ long h;
+
+ l = l1 + l2;
+ h = h1 + h2 + (l < l1);
+
+ *lv = l;
+ *hv = h;
+ return ((~((h1) ^ (h2)) & ((h1) ^ (h))) < 0);
+}
+
+int
+mul_double (l1, h1, l2, h2, lv, hv)
+ unsigned long l1, l2;
+ long h1, h2;
+ unsigned long *lv;
+ long *hv;
+{
+ long arg1[4];
+ long arg2[4];
+ long prod[4 * 2];
+ unsigned long carry;
+ int i, j, k;
+ unsigned long toplow, neglow;
+ long tophigh, neghigh;
+
+ encode (arg1, l1, h1);
+ encode (arg2, l2, h2);
+
+ memset ((char *) prod, 0, sizeof prod);
+
+ for (i = 0; i < 4; i++)
+ {
+ carry = 0;
+ for (j = 0; j < 4; j++)
+ {
+ k = i + j;
+
+ carry += arg1[i] * arg2[j];
+
+ carry += prod[k];
+ prod[k] = ((carry) & (((unsigned long) 1 << (sizeof(unsigned long) / 2)) - 1));
+ carry = ((unsigned long) (carry) >> sizeof(unsigned long) / 2);
+ }
+ prod[i + 4] = carry;
+ }
+
+ decode (prod, lv, hv);
+
+
+
+ decode (prod + 4, &toplow, &tophigh);
+ if (h1 < 0)
+ {
+ neg_double (l2, h2, &neglow, &neghigh);
+ add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh);
+ }
+ if (h2 < 0)
+ {
+ neg_double (l1, h1, &neglow, &neghigh);
+ add_double (neglow, neghigh, toplow, tophigh, &toplow, &tophigh);
+ }
+ return (*hv < 0 ? ~(toplow & tophigh) : toplow | tophigh) != 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-16.c
new file mode 100644
index 000000000..faa685f80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-16.c
@@ -0,0 +1,44 @@
+int transformation[(2*19 - 1) * (2*19 - 1)][8];
+
+const int transformation2[8][2][2] = {
+ {{1, 0}, {0, 1}},
+ {{0, 1}, {-1, 0}},
+ {{-1, 0}, {0, -1}},
+ {{0, -1}, {1, 0}},
+ {{0, -1}, {-1, 0}},
+ {{-1, 0}, {0, 1}},
+ {{0, 1}, {1, 0}},
+ {{1, 0}, {0, -1}}
+};
+
+void
+transformation_init (void)
+{
+ int k;
+ int dx;
+ int dy;
+
+ for (k = 0; k < 8; k++)
+ {
+ for (dy = -19 + 1; dy <= 19 - 1; dy++)
+ {
+ for (dx = -19 + 1; dx <= 19 - 1; dx++)
+ {
+ int tx;
+ int ty;
+ do
+ {
+ *&tx =
+ transformation2[k][0][0] * (dx) +
+ transformation2[k][0][1] * (dy);
+ *&ty =
+ transformation2[k][1][0] * (dx) +
+ transformation2[k][1][1] * (dy);
+ }
+ while (0);
+ transformation[((dy + 19 - 1) * (2 * 19 - 1) +
+ (dx + 19 - 1))][k] = ((tx) * (19 + 1) + (ty));
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-17.c
new file mode 100644
index 000000000..c93c211e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-17.c
@@ -0,0 +1,21 @@
+typedef struct
+{
+ int offset_for_ref_frame[256];
+} seq_parameter_set_rbsp_t;
+
+typedef struct
+{
+ unsigned int num_ref_frames_in_pic_order_cnt_cycle;
+ int offset_for_ref_frame[1];
+ int auto_crop_right;
+} ImageParameters;
+
+ImageParameters *img;
+
+void GenerateSequenceParameterSet(seq_parameter_set_rbsp_t *sps)
+{
+ unsigned i;
+ for (i=0; i<img->num_ref_frames_in_pic_order_cnt_cycle; i++)
+ sps->offset_for_ref_frame[i] = img->offset_for_ref_frame[i];
+ error("foo");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-18.c
new file mode 100644
index 000000000..77628fa8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-18.c
@@ -0,0 +1,7 @@
+long do_hash (const char * lo, const char * hi)
+{
+ int val = 0;
+ for (; lo < hi; ++lo)
+ val = *lo;
+ return val;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-19.c
new file mode 100644
index 000000000..b0d626b81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-19.c
@@ -0,0 +1,6 @@
+void byte_insert_op1 (unsigned char *loc, unsigned char *end)
+{
+ register unsigned char *pto = end + 1 + 2;
+ while (end != loc)
+ *--pto = *--end;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-2.c
new file mode 100644
index 000000000..c11f6a283
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-2.c
@@ -0,0 +1,16 @@
+typedef _Complex float GFC_COMPLEX_4;
+matmul_c4 ()
+{
+ int x, n, count;
+ GFC_COMPLEX_4 * bbase_y;
+ GFC_COMPLEX_4 * dest_y;
+ GFC_COMPLEX_4 * abase_n;
+ GFC_COMPLEX_4 bbase_yn;
+
+ for (n = 0; n < count; n++)
+ {
+ bbase_yn = bbase_y[n];
+ for (x = 0; x < count; x++)
+ dest_y[x] += abase_n[x] * bbase_yn;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-20.c
new file mode 100644
index 000000000..7e0cf6dda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-20.c
@@ -0,0 +1,26 @@
+/* { dg-options "-O3 -fgraphite-identity -ffast-math" } */
+
+typedef enum
+{
+ I_SLICE,
+} SliceType;
+typedef struct
+{
+ int type;
+} ImageParameters;
+extern ImageParameters *img;
+int A[64], B[64], C[13][8][8], D[13][8][8];
+
+void
+foo (int q, int temp)
+{
+ int i, j, k;
+ for(k=0; k<13; k++)
+ for(j=0; j<8; j++)
+ for(i=0; i<8; i++)
+ {
+ if (img->type == I_SLICE)
+ C[k][j][i] = A[temp] << q;
+ D[k][j][i] = B[temp] << q;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-22.c
new file mode 100644
index 000000000..d82554215
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-22.c
@@ -0,0 +1,15 @@
+typedef float rvec[3];
+float calc_similar_ind (int nind, rvec x[])
+{
+ int i, j, d;
+ float m, tm, xd, rd;
+ for(j=0; j<nind; j++) {
+ i = x[j][0];
+ tm += m;
+ for(d=0 ; d<3; d++) {
+ xd = x[i][d] - x[i][d];
+ rd += m * xd;
+ }
+ }
+ return rd/tm;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-23.c
new file mode 100644
index 000000000..0f8a1f32f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-23.c
@@ -0,0 +1,22 @@
+double *ZV_entries (void);
+void SubMtx_fillRowZV (int irow)
+{
+ double *rowvec = ZV_entries ();
+ double *entries;
+ int ii, ipivot, jrow, kk, m;
+ int *pivotsizes;
+
+ SubMtx_blockDiagonalInfo (&pivotsizes);
+
+ for (jrow = ipivot = kk = 0; jrow <= irow; ipivot++)
+ {
+ m = pivotsizes[ipivot];
+ if (jrow <= irow && irow < jrow + m)
+ for (ii = jrow; ii < irow; ii++)
+ {
+ rowvec[2*ii] = entries[2*kk];
+ rowvec[2*ii+1] = entries[2*kk+1];
+ }
+ jrow += m;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-24.c
new file mode 100644
index 000000000..d4660694c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-24.c
@@ -0,0 +1,22 @@
+/* gcc.dg/tree-ssa/loadpre23.c used to ICE with Graphite. */
+
+struct {
+ int a;
+ int large[100];
+} x;
+
+int foo(int argc)
+{
+ int b;
+ int c;
+ int i;
+ int d, e;
+
+ for (i = 0; i < argc; i++)
+ {
+ e = x.a;
+ x.a = 9;
+ }
+ return d + e;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-25.c
new file mode 100644
index 000000000..b719972d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-25.c
@@ -0,0 +1,34 @@
+typedef struct
+{
+ int mvd[2][(16/4)][(16/4)][2];
+} Macroblock;
+typedef struct
+{
+ int part_size[8][2];
+} InputParameters;
+typedef struct
+{
+ Macroblock *mb_data;
+ short****** pred_mv;
+ short****** all_mv;
+} ImageParameters;
+extern InputParameters *input;
+extern ImageParameters *img;
+int writeMotionVector8x8 (void)
+{
+ int i, j, k, l, m;
+ int step_h = input->part_size[7][0];
+ int step_v = input->part_size[7][1];
+ Macroblock* currMB = &img->mb_data[9];
+ int refindex = 0;
+ short****** all_mv = img->all_mv;
+ short****** pred_mv = img->pred_mv;
+
+ for (k=0; k<2; k++)
+ {
+ int curr_mvd = all_mv[2][8][0][8][7][8] - pred_mv[2][7][0][8][7][0];
+ for (l=0; l < step_v; l++)
+ for (m=0; m < step_h; m++)
+ currMB->mvd[0][8][9][8] = curr_mvd;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-26.c
new file mode 100644
index 000000000..507d1590f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-26.c
@@ -0,0 +1,24 @@
+int find_sad_16x16(int *intra_mode)
+{
+ int current_intra_sad_2,best_intra_sad2;
+ int M1[16][16],M0[4][4][4][4],M3[4],M4[4][4];
+ int i,j,k;
+ int ii,jj;
+ int up_avail, left_avail, left_up_avail;
+ for (i=0;i<17;i++)
+ if (left_up_avail)
+ {
+ for (jj=0;jj<4;jj++)
+ for (ii=0;ii<4;ii++)
+ for (j=0;j<4;j++)
+ for (i=0;i<4;i++)
+ {
+ M0[i][ii][2][jj]=M3[0]-M3[1];
+ M0[i][ii][1][jj]=M3[2]+M3[3];
+ current_intra_sad_2 += abs(M0[i][ii][j][jj]);
+ }
+
+ if(current_intra_sad_2 < best_intra_sad2)
+ best_intra_sad2=current_intra_sad_2;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-27.c
new file mode 100644
index 000000000..d2d4cd36b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-27.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O2 -fgraphite-identity -flto" { target lto } } */
+
+typedef long ll;
+void foo (int n, ll *p)
+{
+ while (n--)
+ *p += *p;
+}
+
+typedef long long lll;
+void bar (int n, lll *p)
+{
+ while (n--)
+ *p += *p;
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-3.c
new file mode 100644
index 000000000..608c1c37c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-3.c
@@ -0,0 +1,11 @@
+struct {
+}
+mmaxloc0_4_i1 ()
+{
+ int dstride;
+ int *dest;
+ int rank;
+ int n;
+ for (n = 0; n < rank; n++)
+ dest[n * dstride] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-4.c
new file mode 100644
index 000000000..38f6738d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-4.c
@@ -0,0 +1,7 @@
+extern a[];
+g ()
+{
+ int i, b;
+ for (i = 0; i < 10; i++)
+ a[i] = (b == 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-5.c
new file mode 100644
index 000000000..93972d79e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-5.c
@@ -0,0 +1,15 @@
+void matmul_i1 ()
+{
+ int *abase;
+ int aystride;
+ int x, n, count, xcount;
+ int *dest_y;
+ int *abase_n;
+ for (n = 0; n < count; n++)
+ {
+ abase_n = abase + n * aystride;
+ for (x = 0; x < xcount; x++)
+ dest_y[x] += abase_n[x];
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-6.c
new file mode 100644
index 000000000..dd6fecda3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-6.c
@@ -0,0 +1,29 @@
+#define N 10000
+void foo (int);
+int test ()
+{
+ int a[N + 8];
+ unsigned i;
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i + 12;
+
+ if (i == 40)
+ a[i] = i;
+ else
+ a[i] = i+1;
+
+
+ a[i] = i + 12;
+ a[i] = a[i+1];
+ a[i] += a[i+2];
+ a[i] += a[i+3];
+ a[i] += a[i+4];
+ a[i] += a[i+5];
+ a[i] += a[i+6];
+
+ }
+
+ return a[20];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-7.c
new file mode 100644
index 000000000..9fa811d6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-7.c
@@ -0,0 +1,16 @@
+void foo (int *BM_tab)
+{
+ int *BM_tab_base;
+
+ BM_tab_base = BM_tab;
+ BM_tab += 0400;
+ while (BM_tab_base != BM_tab)
+ *--BM_tab = 6;
+}
+
+int main ()
+{
+ int BM_tab[0400];
+ foo (BM_tab);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-8.c
new file mode 100644
index 000000000..1a278c164
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-8.c
@@ -0,0 +1,14 @@
+int blah;
+foo()
+{
+ int i;
+
+ for (i=0 ; i< 7 ; i++)
+ {
+ if (i == 7 - 1)
+ blah = 0xfcc;
+ else
+ blah = 0xfee;
+ }
+ return blah;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-9.c
new file mode 100644
index 000000000..219953869
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-9.c
@@ -0,0 +1,26 @@
+typedef enum
+{
+ no_op,
+ jump
+}
+re_opcode_t;
+struct
+{
+}
+byte_register_info_type ()
+{
+ char *p;
+ for (;;)
+ switch ((re_opcode_t) p++)
+ {
+ case no_op:
+ {
+ for (; (p);)
+ ;
+ for (;;)
+ ;
+ }
+ case jump:
+ (p) += 2;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43351.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43351.c
new file mode 100644
index 000000000..0590584c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43351.c
@@ -0,0 +1,5 @@
+int foo(int i)
+{
+ if (i < 0) return 0;
+ for (; i < 10; i++);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43464-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43464-1.c
new file mode 100644
index 000000000..d5a835965
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43464-1.c
@@ -0,0 +1,18 @@
+typedef struct regnode
+{
+ char flags;
+} regnode;
+extern const unsigned char A[];
+
+char *foo (regnode *c, char *s, int norun)
+{
+ int uskip;
+ while (s + (uskip = A[*s]))
+ {
+ if ((c->flags || bar (c)) && norun)
+ goto got_it;
+ s += uskip;
+ }
+ got_it:
+ return s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43464.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43464.c
new file mode 100644
index 000000000..a8e67dc2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr43464.c
@@ -0,0 +1,63 @@
+typedef struct sv SV;
+typedef struct regnode
+{
+ char flags;
+} regnode;
+typedef struct regexp
+{
+} regexp;
+typedef struct cop
+{
+ SV *cop_warnings;
+} COP;
+extern const unsigned char PL_utf8skip[];
+extern char PL_dowarn;
+extern COP *volatile PL_curcop;
+char *
+S_find_byclass (regexp * prog, regnode * c, char *s, char *strend,
+ char *startpos, int norun)
+{
+ register long unsigned int uskip;
+ char *e;
+ switch (((c)->flags))
+ {
+ case 17:
+ {
+ while (s + (uskip = PL_utf8skip[*s]) <= strend)
+ {
+ if (c->flags || S_reginclass (c))
+ if (norun || S_regtry (prog, s))
+ goto got_it;
+ s += uskip;
+ }
+ unsigned long c, f;
+ long unsigned int len;
+ {
+ while (s <= e)
+ {
+ c = Perl_utf8n_to_uvuni (s, 13, &len,
+ (((PL_curcop->cop_warnings !=
+ ((SV *) ((void *) 0)))
+ && PL_dowarn)) ? 0 : 0x00FF);
+ if (c == 0 && (norun || S_regtry (prog, s)))
+ if (f != c && (norun || S_regtry (prog, s)))
+ goto got_it;
+ }
+ }
+ }
+ }
+got_it:
+ return s;
+}
+Perl_re_intuit_start (regexp * prog)
+{
+ S_find_byclass (prog, 0, 0, 0, 0, 1);
+}
+Perl_regexec_flags (register regexp * prog,
+ register char *strend)
+{
+ S_find_byclass (prog, 0, 0, strend, 0, 0);
+}
+S_regtry (regexp * prog, char *startpos)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr44676.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr44676.c
new file mode 100644
index 000000000..65821edba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr44676.c
@@ -0,0 +1,12 @@
+/* { dg-options "-O2 -fgraphite-identity -fprofile-generate" } */
+
+int
+extend_options (int h, int map, int x, int y, int dx)
+{
+ while (dx--)
+ {
+ if (x != dx && y != -x)
+ map++;
+ }
+ return map;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45230-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45230-1.c
new file mode 100644
index 000000000..ba14fe557
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45230-1.c
@@ -0,0 +1,140 @@
+/* Copyright (C) 2002 Free Software Foundation.
+
+ Test strncmp with various combinations of pointer alignments and lengths to
+ make sure any optimizations in the library are correct.
+
+ Written by Michael Meissner, March 9, 2002. */
+
+#include <string.h>
+#include <stddef.h>
+
+#ifndef MAX_OFFSET
+#define MAX_OFFSET (sizeof (long long))
+#endif
+
+#ifndef MAX_TEST
+#define MAX_TEST (8 * sizeof (long long))
+#endif
+
+#ifndef MAX_EXTRA
+#define MAX_EXTRA (sizeof (long long))
+#endif
+
+#define MAX_LENGTH (MAX_OFFSET + MAX_TEST + MAX_EXTRA)
+
+static union {
+ unsigned char buf[MAX_LENGTH];
+ long long align_int;
+ long double align_fp;
+} u1, u2;
+
+void
+test (const unsigned char *s1, const unsigned char *s2, size_t len, int expected)
+{
+ int value = strncmp ((char *) s1, (char *) s2, len);
+
+ if (expected < 0 && value >= 0)
+ __builtin_abort ();
+ else if (expected == 0 && value != 0)
+ __builtin_abort ();
+ else if (expected > 0 && value <= 0)
+ __builtin_abort ();
+}
+
+main ()
+{
+ size_t off1, off2, len, i;
+ unsigned char *buf1, *buf2;
+ unsigned char *mod1, *mod2;
+ unsigned char *p1, *p2;
+
+ for (off1 = 0; off1 < MAX_OFFSET; off1++)
+ for (off2 = 0; off2 < MAX_OFFSET; off2++)
+ for (len = 0; len < MAX_TEST; len++)
+ {
+ p1 = u1.buf;
+ for (i = 0; i < off1; i++)
+ *p1++ = '\0';
+
+ buf1 = p1;
+ for (i = 0; i < len; i++)
+ *p1++ = 'a';
+
+ mod1 = p1;
+ for (i = 0; i < MAX_EXTRA; i++)
+ *p1++ = 'x';
+
+ p2 = u2.buf;
+ for (i = 0; i < off2; i++)
+ *p2++ = '\0';
+
+ buf2 = p2;
+ for (i = 0; i < len; i++)
+ *p2++ = 'a';
+
+ mod2 = p2;
+ for (i = 0; i < MAX_EXTRA; i++)
+ *p2++ = 'x';
+
+ mod1[0] = '\0';
+ mod2[0] = '\0';
+ test (buf1, buf2, MAX_LENGTH, 0);
+ test (buf1, buf2, len, 0);
+
+ mod1[0] = 'a';
+ mod1[1] = '\0';
+ mod2[0] = '\0';
+ test (buf1, buf2, MAX_LENGTH, +1);
+ test (buf1, buf2, len, 0);
+
+ mod1[0] = '\0';
+ mod2[0] = 'a';
+ mod2[1] = '\0';
+ test (buf1, buf2, MAX_LENGTH, -1);
+ test (buf1, buf2, len, 0);
+
+ mod1[0] = 'b';
+ mod1[1] = '\0';
+ mod2[0] = 'c';
+ mod2[1] = '\0';
+ test (buf1, buf2, MAX_LENGTH, -1);
+ test (buf1, buf2, len, 0);
+
+ mod1[0] = 'c';
+ mod1[1] = '\0';
+ mod2[0] = 'b';
+ mod2[1] = '\0';
+ test (buf1, buf2, MAX_LENGTH, +1);
+ test (buf1, buf2, len, 0);
+
+ mod1[0] = 'b';
+ mod1[1] = '\0';
+ mod2[0] = (unsigned char)'\251';
+ mod2[1] = '\0';
+ test (buf1, buf2, MAX_LENGTH, -1);
+ test (buf1, buf2, len, 0);
+
+ mod1[0] = (unsigned char)'\251';
+ mod1[1] = '\0';
+ mod2[0] = 'b';
+ mod2[1] = '\0';
+ test (buf1, buf2, MAX_LENGTH, +1);
+ test (buf1, buf2, len, 0);
+
+ mod1[0] = (unsigned char)'\251';
+ mod1[1] = '\0';
+ mod2[0] = (unsigned char)'\252';
+ mod2[1] = '\0';
+ test (buf1, buf2, MAX_LENGTH, -1);
+ test (buf1, buf2, len, 0);
+
+ mod1[0] = (unsigned char)'\252';
+ mod1[1] = '\0';
+ mod2[0] = (unsigned char)'\251';
+ mod2[1] = '\0';
+ test (buf1, buf2, MAX_LENGTH, +1);
+ test (buf1, buf2, len, 0);
+ }
+
+ __builtin_exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45230.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45230.c
new file mode 100644
index 000000000..80f67697f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45230.c
@@ -0,0 +1,14 @@
+unsigned char buf[10];
+main ()
+{
+ unsigned off1, len, i;
+ unsigned char *p1;
+ for (len = 0; len < 8; len++)
+ {
+ p1 = buf;
+ for (i = 0; i < off1; i++)
+ *p1++ = '\0';
+ for (i = 0; i < len; i++)
+ *p1++ = 'a';
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45231.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45231.c
new file mode 100644
index 000000000..01e9a672e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr45231.c
@@ -0,0 +1,37 @@
+void
+f (n, ppt, xrot)
+{
+ int tileWidth;
+ int nlwSrc;
+ int srcx;
+ int v3, v4;
+ register unsigned long ca1, cx1, ca2, cx2;
+ unsigned long *pSrcLine;
+ register unsigned long *pDst;
+ register unsigned long *pSrc;
+ register unsigned long b, tmp;
+ unsigned long tileEndMask;
+ int v1, v2;
+ int tileEndPart;
+ int needFirst;
+ tileEndPart = 0;
+ v1 = tileEndPart << 5;
+ v2 = 32 - v1;
+ while (n--)
+ {
+ if ((srcx = (ppt - xrot) % tileWidth) < 0)
+ if (needFirst)
+ if (nlwSrc == 1)
+ {
+ tmp = b;
+ if (tileEndPart)
+ b = (*pSrc & tileEndMask) | (*pSrcLine >> v1);
+ }
+ if (tileEndPart)
+ b = (tmp << v1) | (b >> v2);
+ if (v4 != 32)
+ *pDst = (*pDst & ((tmp << v3) | (b >> v4) & ca1 ^ cx1)
+ ^ (((tmp << v3) | (b >> v4)) & ca2 ^ cx2));
+ *pDst = *pDst & tmp;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr46834.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr46834.c
new file mode 100644
index 000000000..8d89b8e3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr46834.c
@@ -0,0 +1,12 @@
+/* { dg-options "-O -fgraphite-identity -ffast-math -fno-tree-dce" } */
+
+void foo ()
+{
+ int M0[4][4], M3[4] = {};
+ int i=-1;
+ int ii, jj;
+ for (; i; i++)
+ for (jj = 0; jj < 4; jj++)
+ for (ii = 0; ii < 4; ii++)
+ M3[1] += __builtin_abs (M0[ii][0]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr46845.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr46845.c
new file mode 100644
index 000000000..45807217b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr46845.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O2 -ffast-math -fgraphite-identity -w -Wno-psabi" { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } */
+
+typedef float V2SF __attribute__ ((vector_size (128)));
+
+V2SF
+foo (int x, V2SF a)
+{
+ V2SF b;
+ if (x & 42)
+ b = a;
+ else
+ b = a + (V2SF) {1.0f/0.0f - 1.0f/0.0f, 1.0f/0.0f - 1.0f/0.0f};
+ while (x--)
+ a += b;
+
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr47046.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr47046.c
new file mode 100644
index 000000000..aba38ed5e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr47046.c
@@ -0,0 +1,13 @@
+void
+init_movntdqa (int *src)
+{
+ int i, j, sign = 1;
+
+ for (i = 0; i < 20; i++)
+ for (j = 0; j < 4; j++)
+ {
+ src[i * 4 + j] = j * i * i * sign;
+ sign = -sign;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr48648.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr48648.c
new file mode 100644
index 000000000..ff58ec23b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr48648.c
@@ -0,0 +1,21 @@
+/* { dg-options "-O -fgraphite-identity" } */
+
+void *foo(const void *a);
+
+void bug48648()
+{
+ unsigned char a[2];
+ long b;
+ int i;
+
+ for(i = 0; i < 2; i++) {
+ if (b <= 0)
+ a[i] = 0;
+ else if (b >= 8)
+ a[i] = 0;
+ else
+ a[i] = 0;
+ b -= 8;
+ }
+ foo(&a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr48805.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr48805.c
new file mode 100644
index 000000000..f13a828e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/id-pr48805.c
@@ -0,0 +1,20 @@
+void *A(const void *a);
+void C(void);
+
+static void B(unsigned short a[])
+{
+ long i, j, tmp;
+
+ for(i = 0; i < 3; i++) {
+ for(j = 1; j <= 3; j++)
+ tmp -= a[i - j];
+
+ a[i] = (unsigned short)(tmp >> 1);
+ }
+}
+void C(void)
+{
+ unsigned short a[3], b[3];
+ B(b + 1);
+ A(a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-0.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-0.c
new file mode 100644
index 000000000..8bc6e1326
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-0.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 1000
+int a[N][N];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ int j;
+ int i;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[j][i] = a[j][i] + 1;
+
+ return a[N-1][N-1];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[i][j] = 1;
+
+ a[N-1][N-1] = 12;
+ res = foo ();
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 13)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-1.c
new file mode 100644
index 000000000..b4559d132
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-1.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-1.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[1782225];
+
+static int __attribute__((noinline))
+foo (int N)
+{
+ int i, j;
+ double sum = 0.0;
+
+ /* These two loops should be interchanged. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ sum = sum + u[i + 1335 * j];
+
+ u[1336 * i] *= 2;
+ }
+
+ return sum + N + u[1336 * 2] + u[1336];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < 1782225; i++)
+ u[i] = 2;
+
+ res = foo (1335);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 3565793)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-10.c
new file mode 100644
index 000000000..51a46d623
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-10.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[1782225];
+
+static void __attribute__((noinline))
+foo (int N, int *res)
+{
+ int i, j;
+ double sum = 0.0;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum = sum + u[i + 1335 * j];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum = sum + u[i + 1335 * j];
+
+ *res = sum + N + u[1336 * 2] + u[1336];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, res;
+
+ for (i = 0; i < 1782225; i++)
+ u[i] = 2;
+
+ foo (1335, &res);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 7130239)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 2 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-11.c
new file mode 100644
index 000000000..491fda15c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-11.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[1782225];
+
+static void __attribute__((noinline))
+foo (int N, int *res)
+{
+ int i, j;
+ double sum = 0.0;
+
+ /* These two loops should be interchanged. */
+ for (i = 0; i < 1335; i++)
+ {
+ for (j = 0; j < 1335; j++)
+ sum = sum + u[i + 1335 * j];
+
+ u[1336 * i] *= 2;
+ }
+ *res = sum;
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, res;
+
+ for (i = 0; i < 1782225; i++)
+ u[i] = 2;
+
+ foo (1335, &res);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 3564450)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-12.c
new file mode 100644
index 000000000..fc27b4c53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-12.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 200
+
+int A[N][N], B[N][N], C[N][N];
+
+static int __attribute__((noinline))
+matmult (void)
+{
+ int i, j, k;
+
+ /* Loops J and K should be interchanged. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ A[i][j] = 0;
+ for (k = 0; k < N; k++)
+ A[i][j] += B[i][k] * C[k][j];
+ }
+
+ return A[0][0] + A[N-1][N-1];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ A[i][j] = 0;
+ B[i][j] = i - j;
+ C[i][j] = i + j;
+ }
+
+ res = matmult ();
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 2626800)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-13.c
new file mode 100644
index 000000000..a8bf23be5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-13.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-1.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[25];
+
+static int __attribute__((noinline))
+foo (int N)
+{
+ int i, j;
+ double sum = 0.0;
+
+ /* These two loops should be interchanged. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ sum = sum + u[i + 5 * j];
+
+ u[6 * i] *= 2;
+ }
+
+ return sum + N + u[6];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < 25; i++)
+ u[i] = 2;
+
+ res = foo (5);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 59)
+ abort ();
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-14.c
new file mode 100644
index 000000000..b0d93a18c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-14.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 200
+
+int A[N][N], B[N][N], C[N][N];
+
+static void __attribute__((noinline))
+matmult (void)
+{
+ int i, j, k;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ A[i][j] = 0;
+
+ /* Loops J and K should be interchanged. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ for (k = 0; k < N; k++)
+ A[i][j] += B[i][k] * C[k][j];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res = 0;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ B[i][j] = j;
+ C[i][j] = i;
+ }
+
+ matmult ();
+
+ for (i = 0; i < N; i++)
+ res += A[i][i];
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 529340000)
+ abort ();
+
+ return 0;
+}
+
+/* PRE destroys the perfect nest and we can't cope with that yet. */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-15.c
new file mode 100644
index 000000000..d154b743f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-15.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define NMAX 2000
+
+static int x[NMAX], a[NMAX][NMAX];
+
+static int __attribute__((noinline))
+mvt (long N)
+{
+ int i,j;
+
+ /* These two loops should be interchanged. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i] += a[j][i];
+
+ return x[1];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < NMAX; i++)
+ for (j = 0; j < NMAX; j++)
+ a[i][j] = j;
+
+ for (i = 0; i < NMAX; i++)
+ x[i] = i;
+
+ res = mvt (NMAX);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 2001)
+ abort ();
+
+ return 0;
+}
+
+/* PRE destroys the perfect nest and we can't cope with that yet. */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-16.c
new file mode 100644
index 000000000..0d07d8118
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-16.c
@@ -0,0 +1,22 @@
+void spread_i1 (int *rptr, int *sptr, int ncopies, int *extent, int rdelta, int m)
+{
+ int *dest;
+ int n;
+
+ while (m--)
+ {
+ dest = rptr;
+ for (n = 0; n < ncopies; n ++)
+ {
+ *dest = *sptr;
+ dest += rdelta;
+ }
+ if (extent [n])
+ if (n)
+ rptr ++;
+ }
+}
+
+int main() { return 0; }
+
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-2.c
new file mode 100644
index 000000000..2609a10eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-2.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-2.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[1782225];
+
+static void __attribute__((noinline))
+foo (int N, int *res)
+{
+ unsigned int i, j;
+ double sum = 0;
+
+ /* This loop should be converted to a perfect nest and
+ interchanged. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ sum = sum + u[i + 1335 * j];
+ if (j == N - 1)
+ u[1336 * i] *= 2;
+ }
+ }
+
+ *res = sum + N + u[1336 * 2] + u[1336];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < 1782225; i++)
+ u[i] = 2;
+
+ foo (1335, &res);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 3565793)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-3.c
new file mode 100644
index 000000000..141974924
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-3.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-3.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[1782225];
+
+static void __attribute__((noinline))
+foo (int N, int *res)
+{
+ int i, j;
+ double sum = 0;
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ sum = sum + u[i + 1335 * j];
+ }
+ }
+
+ *res = sum + N + u[1336 * 2] + u[1336];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < 1782225; i++)
+ u[i] = 2;
+
+ foo (1335, &res);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 3565789)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-4.c
new file mode 100644
index 000000000..f86391c7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-4.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-4.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[1782225];
+
+static int __attribute__((noinline))
+foo (int N, int *res)
+{
+ int i, j;
+ double sum = 0;
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum = sum + u[i + 1335 * j];
+
+ for (i = 0; i < N; i++)
+ u[1336 * i] *= 2;
+
+ *res = sum + N + u[1336 * 2] + u[1336];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < 1782225; i++)
+ u[i] = 2;
+
+ foo (1335, &res);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 3565793)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-5.c
new file mode 100644
index 000000000..1fbc8e6ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-5.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-5.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 100
+#define M 1111
+int A[N][M];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ int i, j;
+
+ for( i = 0; i < M; i++)
+ for( j = 0; j < N; j++)
+ A[j][i] = 5 * A[j][i];
+
+ return A[0][0] + A[N-1][M-1];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < M; j++)
+ A[i][j] = 2;
+
+ res = foo ();
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 20)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-6.c
new file mode 100644
index 000000000..9e189050e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-6.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-6.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 100
+#define M 200
+
+static int __attribute__((noinline))
+foo (int A[N][M])
+{
+ int i, j;
+
+ /* This loop should be interchanged. */
+ for(j = 0; j < M; j++)
+ for(i = 0; i < N; i++)
+ A[i][j] = A[i][j] + A[i][j];
+
+ return A[0][0] + A[N-1][M-1];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int A[N][M];
+ int i, j, res;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < M; j++)
+ A[i][j] = 2;
+
+ res = foo (A);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 8)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-7.c
new file mode 100644
index 000000000..b3710ad4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-7.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-8.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 111
+#define M 1111
+
+static int __attribute__((noinline))
+foo (double *a)
+{
+ int i,j;
+ int r = 0;
+
+ for (i = 0; i < N; ++i)
+ for (j = 0; j < M; ++j)
+ r += a[j * N + i];
+
+ return r;
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ double A[N*M];
+ int i, res;
+
+ for (i = 0; i < N*M; i++)
+ A[i] = 2;
+
+ res = foo (A);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 246642)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-8.c
new file mode 100644
index 000000000..ca99dbc13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-8.c
@@ -0,0 +1,86 @@
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+int B[4];
+int A[4][4][4][4];
+
+static int __attribute__((noinline))
+foo (void)
+{
+ int i, j, k, l;
+
+ /* Loops (L, J) are interchanged, and then loops (J and K) are
+ interchanged. The result is a nest starting with (K, J, L). */
+ for (l = 0; l < 4; l++)
+ {
+ for (k = 0; k < 4; k++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ for (i = 0; i < 2; i++)
+ {
+ B[i] = A[i][k][j][l] + A[3 - i][k][j][l];
+ B[3 - i] = A[i][k][j][l] - A[3 - i][k][j][l];
+ }
+ A[0][k][j][l] = B[0] + B[1];
+ A[2][k][j][l] = B[0] - B[1];
+ A[1][k][j][l] = B[3] + B[2];
+ A[3][k][j][l] = B[3] - B[2];
+ }
+
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ B[j] = A[i][k][j][l] + A[i][k][3 - j][l];
+ B[3 - j] = A[i][k][j][l] - A[i][k][3 - j][l];
+ }
+ A[i][k][0][l] = B[0] + B[1];
+ A[i][k][2][l] = B[0] - B[1];
+ A[i][k][1][l] = B[3] + B[2];
+ A[i][k][3][l] = B[3] - B[2];
+ }
+ }
+ }
+
+ return A[0][1][0][2] + A[0][3][0][3] + A[0][2][0][2] + A[0][1][0][1] + A[3][3][0][2];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, k, l, res;
+
+ for (i = 0; i < 4; i++)
+ B[i] = 2;
+
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
+ for (k = 0; k < 4; k++)
+ for (l = 0; l < 4; l++)
+ A[i][j][k][l] = i + j + k + l;
+
+ res = foo ();
+
+#if DEBUG
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
+ for (k = 0; k < 4; k++)
+ for (l = 0; l < 4; l++)
+ fprintf (stderr, "A[%d][%d][%d][%d] = %d \n", i, j, k, l, A[i][j][k][l]);
+
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 424)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 2 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-9.c
new file mode 100644
index 000000000..3f8e843ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-9.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 111
+#define M 111
+
+static int __attribute__((noinline))
+foo (int *x)
+{
+ int i, j;
+ int sum = 0;
+
+ for (j = 0; j < M; ++j)
+ for (i = 0; i < N; ++i)
+ sum += x[M * i + j];
+
+ return sum;
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int A[N*M];
+ int i, res;
+
+ for (i = 0; i < N*M; i++)
+ A[i] = 2;
+
+ res = foo (A);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 24642)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c
new file mode 100644
index 000000000..f446dbe62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c
@@ -0,0 +1,64 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define NMAX 2000
+
+static int x1[NMAX], x2[NMAX], a[NMAX][NMAX], y1[NMAX], y2[NMAX];
+
+static int __attribute__((noinline))
+mvt (long N)
+{
+
+ int i,j;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x1[i] = x1[i] + a[i][j] * y1[j];
+
+ /* These two loops should be interchanged. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x2[i] = x2[i] + a[j][i] * y2[j];
+
+ return x1[0] + x2[0];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < NMAX; i++)
+ for (j = 0; j < NMAX; j++)
+ a[i][j] = i + j;
+
+ for (i = 0; i < NMAX; i++)
+ {
+ x1[i] = 0;
+ x2[i] = 2*i;
+ y1[i] = 100 - i;
+ y2[i] = i;
+ }
+
+ res = mvt (NMAX);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 199900000)
+ abort ();
+
+ return 0;
+}
+
+/* PRE destroys the perfect nest and we can't cope with that yet. */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr18792.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr18792.c
new file mode 100644
index 000000000..4e93fe145
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr18792.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/18792 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-loop-linear" } */
+void put_atoms_in_triclinic_unitcell(float x[][3])
+{
+ int i=0,d;
+
+ while (x[i][3] < 0)
+ for (d=0; d<=3; d++)
+ x[i][d] = 0;
+
+ while (x[i][3] >= 0)
+ for (d=0; d<=3; d++)
+ x[i][d] = 0;
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr19910.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr19910.c
new file mode 100644
index 000000000..1ee0d213b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr19910.c
@@ -0,0 +1,16 @@
+/* Contributed by Volker Reichelt <reichelt@gcc.gnu.org>. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+int a[3];
+
+void foo()
+{
+ int i, j;
+
+ for (i = 1; i >= 0; --i)
+ for (j = i; j >= 0; --j)
+ a[i+j] = 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr20041110-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr20041110-1.c
new file mode 100644
index 000000000..825b2b41f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr20041110-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+/* This testcase was causing an ICE in building distance vectors because
+ we weren't ignoring the fact that one of the induction variables
+ involved in the dependence was outside of the loop. */
+extern int foo (int, int);
+int
+main (void)
+{
+ int a[50];
+ int b[50];
+ int i, j, k;
+ for (i = 4; i < 30; i++)
+ {
+ for (j = 3; j < 40; j++)
+ {
+ for (k = 9; k < 50; k++)
+ {
+ b[j] = a[i];
+ a[k] = b[i];
+ }
+ }
+ }
+ foo (a[i], b[i]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr20256.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr20256.c
new file mode 100644
index 000000000..29c8ebd14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr20256.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+/* { dg-require-effective-target size32plus } */
+
+int foo()
+{
+ int x[2][2], y[2];
+ int i, n, s;
+
+ /* This is a reduction: there is a scalar dependence that cannot be
+ removed by rewriting IVs. This code cannot and should not be
+ transformed into a perfect loop. */
+ for (n = 0; n < 2; n++)
+ {
+ s = 0;
+ for (i = 0; i < 2; i++)
+ s += x[n][i]*y[i];
+ s += 1;
+ }
+
+ return s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr23625.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr23625.c
new file mode 100644
index 000000000..aaeddb288
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr23625.c
@@ -0,0 +1,27 @@
+/* Test case for PR23625 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -ftree-loop-linear" } */
+
+typedef long INT32;
+void find_best_colors ()
+{
+int ic0, ic1, ic2;
+INT32 * bptr;
+INT32 dist1;
+INT32 dist2;
+INT32 xx1;
+for (ic0 = (1<<(5 -3))-1;ic0 >= 0;ic0--)
+{
+ for (ic1 = (1<<(6 -3))-1;ic1 >= 0;ic1--)
+ {
+ dist2 = dist1;
+ for (ic2 = (1<<(5 -3))-1;ic2 >= 0;ic2--)
+ {
+ *bptr = dist2;
+ bptr++;
+ }
+ dist1 += xx1;
+ }
+}
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr23820.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr23820.c
new file mode 100644
index 000000000..ee855e139
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr23820.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+int t [2][4];
+
+void foo (void)
+{
+ int i, j, k, v;
+ float e;
+ for (;;)
+ {
+ v = 0;
+ for (j = 0; j < 2; j ++)
+ {
+ for (k = 2; k < 4; k ++)
+ {
+ e = 0.0;
+ for (i = 0; i < 4; i ++)
+ e += t [j][i];
+ if (e)
+ v = j;
+ }
+ }
+ t [v][0] = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr24309.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr24309.c
new file mode 100644
index 000000000..b50e7a8ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr24309.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+float weight[10];
+void lsp_weight_quant(float *x, char *cdbk)
+{
+ int i,j;
+ float dist;
+ int best_id=0;
+ for (i=0;i<16;i++)
+ {
+ for (j=0;j<10;j++)
+ dist=dist+weight[j];
+ if (dist<0)
+ best_id=i;
+ }
+ x[j] = cdbk[best_id*10+j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr26435.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr26435.c
new file mode 100644
index 000000000..4e5e5f74d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr26435.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+/* { dg-require-effective-target size32plus } */
+
+int foo(int *p, int n)
+{
+ int i, j, k = 0;
+
+ /* This is a reduction: there is a scalar dependence that cannot be
+ removed by rewriting IVs. This code cannot and should not be
+ transformed into a perfect loop. */
+ for (i = 0; i < 2; ++i, p += n)
+ for (j = 0; j < 2; ++j)
+ k += p[j];
+
+ return k;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29330.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29330.c
new file mode 100644
index 000000000..dff420779
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29330.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/29330 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-linear -std=gnu99" } */
+
+int buf[2][2][2][2];
+
+void
+f (void)
+{
+ for (int a = 0; a < 2; ++a)
+ for (int b = 0; b < 2; ++b)
+ for (int c = 0; c < 2; ++c)
+ for (int d = 0; d < 2; ++d)
+ buf[a][b][c][d] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-1.c
new file mode 100644
index 000000000..e54007355
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-1.c
@@ -0,0 +1,44 @@
+/* PR tree-optimization/29581 */
+/* Origin: gcc.dg/vect/vect-85.c */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+extern void abort (void);
+
+#define N 16
+
+int main1 (int *a)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ k = i + N;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < N; j++)
+ if (a[j] != i + N - 1)
+ abort();
+
+ for (j = 0; j < N; j++)
+ if (b[j] != j + N)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[N] __attribute__ ((__aligned__(16)));
+
+ main1 (a);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-2.c
new file mode 100644
index 000000000..c99d78ce2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-2.c
@@ -0,0 +1,46 @@
+/* PR tree-optimization/29581 */
+/* Origin: gcc.dg/vect/vect-86.c */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+extern void abort (void);
+
+#define N 16
+
+int main1 (int n)
+{
+ int i, j, k;
+ int a[N], b[N];
+
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ k = i + n;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ abort();
+
+ for (i = 0; i < n; i++)
+ if (b[i] != i + n)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ main1 (N);
+ main1 (0);
+ main1 (1);
+ main1 (2);
+ main1 (N-1);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-3.c
new file mode 100644
index 000000000..c9d72ce28
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-3.c
@@ -0,0 +1,48 @@
+/* PR tree-optimization/29581 */
+/* Origin: gcc.dg/vect/vect-87.c */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+extern void abort (void);
+
+#define N 16
+
+int main1 (int n, int *a)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ k = i + n;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ abort();
+
+ for (j = 0; j < n; j++)
+ if (b[j] != j + n)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[N] __attribute__ ((__aligned__(16)));
+
+ main1 (N, a);
+ main1 (0, a);
+ main1 (1, a);
+ main1 (2, a);
+ main1 (N-1, a);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-4.c
new file mode 100644
index 000000000..c2d894c8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr29581-4.c
@@ -0,0 +1,48 @@
+/* PR tree-optimization/29581 */
+/* Origin: gcc.dg/vect/vect-88.c */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+extern void abort (void);
+
+#define N 16
+
+int main1 (int n, int *a)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ k = i + n;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ abort();
+
+ for (j = 0; j < n; j++)
+ if (b[j] != j + n)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[N+1] __attribute__ ((__aligned__(16)));
+
+ main1 (N, a+1);
+ main1 (0, a+1);
+ main1 (1, a+1);
+ main1 (2, a+1);
+ main1 (N-1, a+1);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr30565.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr30565.c
new file mode 100644
index 000000000..802b7c2aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr30565.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/30565 */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-pre -ftree-loop-linear" } */
+
+static double snrdef[32];
+void psycho_n1(double ltmin[2][32], int stereo)
+{
+ int i, k;
+
+ for (k = 0; k < stereo; k++)
+ for (i = 0; i < 32; i++)
+ ltmin[k][i] = snrdef[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr31183.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr31183.c
new file mode 100644
index 000000000..000d7b5bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr31183.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+int buf[256 * 9];
+int f()
+{
+ int i, j;
+
+ for (i = 0; i < 256; ++i)
+ for (j = 0; j < 8; ++j)
+ buf[j + 1] = buf[j] + 1;
+
+ return buf[10];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr33576.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr33576.c
new file mode 100644
index 000000000..2470762f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr33576.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+int a1[6][4][4];
+short b1[16];
+
+int c1;
+void CalculateQuantParam(void)
+{
+ int i, j, k, temp;
+
+ for(k=0; k<6; k++)
+ for(j=0; j<4; j++)
+ for(i=0; i<4; i++)
+ {
+ temp = (i<<2)+j;
+ a1[k][j][i] = c1/b1[temp];
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr33766.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr33766.c
new file mode 100644
index 000000000..47d3dd40d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr33766.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+float
+fxt1_quantize_ALPHA1()
+{
+ int j1;
+ int i;
+ float *tv;
+ for (j1 = 1; j1 < 2048; j1++) {
+ float e;
+ for (i = 1; i < 2048; i++)
+ e = tv[i];
+ if (e)
+ i = j1;
+ }
+ return tv[i];
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34016.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34016.c
new file mode 100644
index 000000000..5ca84bb62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34016.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/34016 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+extern void bar (double *);
+
+void foo (void)
+{
+ double gr[36];
+ int i, j;
+ for (i = 0; i <= 5; i++)
+ {
+ for (j = 0; j <= 5; j++)
+ gr[i + j * 6] = 0.0;
+ if (i <= 2)
+ gr[i + i * 6] = 1.0;
+ }
+ bar (gr);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34017.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34017.c
new file mode 100644
index 000000000..ee279b7c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34017.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+extern int s;
+
+void
+foo (int *x, int y, int z)
+{
+ int m, n;
+ int o;
+ int p = x[0];
+ o = s;
+ for (m = 0; m < s; m++)
+ for (n = 0; n < s; n++)
+ {
+ if (x[n] != p)
+ continue;
+ if (m > z)
+ z = m;
+ if (n < o)
+ o = n;
+ }
+ for (m = y; m <= z; m++)
+ {
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34123.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34123.c
new file mode 100644
index 000000000..81dbf3aac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr34123.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
+
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+
+static unsigned char sbox[256] = {
+};
+void MD2Transform (unsigned char state[16])
+{
+ unsigned char t = 0;
+ int i, j;
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < 2; j++)
+ t = (state[j] ^= sbox[t]);
+ t += i;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-1.c
new file mode 100644
index 000000000..2ba0c1b0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-1.c
@@ -0,0 +1,26 @@
+/* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */
+
+int a[100];
+
+int
+foo (int bar, int n, int k)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ if (i == k)
+ a[i] = bar;
+
+ return a[bar];
+}
+
+/* There should be no loops generated for this testcase, instead we
+ should generate the following:
+
+ | if (k >= 0 && k < n)
+ | a[k] = bar;
+
+*/
+
+/* { dg-final { scan-tree-dump-times "loop_1" 0 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-2.c
new file mode 100644
index 000000000..b406d1096
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-2.c
@@ -0,0 +1,44 @@
+/* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */
+
+int a[100];
+
+int
+foo (int bar, int n, int k)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ if (i == k)
+ a[i] = 1;
+ else
+ a[i] = i;
+
+ return a[bar];
+}
+
+/* We should generate the following:
+
+ | for (i = 0; i < min (n, k); i++)
+ | a[i] = i;
+ | if (k >= 0 && k < n)
+ | a[k] = 1;
+ | for (i = max(k+1,0); i < n; i++)
+ | a[i] = i;
+
+ XXX: At the moment we generate to protect loops that are executed zero times.
+
+ | if (0 < min (n, k) + 1)
+ | for (i = 0; i < min (n, k); i++)
+ | a[i] = i;
+ | if (k >= 0 && k < n)
+ | a[k] = 1;
+ | if (0 < max(n, k) + 1)
+ | for (i = max(k+1,0); i < n; i++)
+ | a[i] = i;
+
+*/
+
+
+/* { dg-final { scan-tree-dump-times "MIN_EXPR\[^\\n\\r]*;" 4 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "MAX_EXPR\[^\\n\\r]*;" 4 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-3.c
new file mode 100644
index 000000000..55a771aff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr35356-3.c
@@ -0,0 +1,40 @@
+/* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */
+
+
+int winner, numf2s;
+double **tds;
+double d, tsum;
+
+typedef struct {
+ double y;
+} xyz;
+
+xyz *Y;
+int ti;
+
+double
+match (void)
+{
+ int tj, tresult;
+
+ for (tj = 0; tj < numf2s; tj++)
+ if (tj == winner
+ && Y[tj].y > 0)
+ tsum += tds[ti][tj] * d;
+
+ return tsum;
+}
+
+/* There should be no loops generated for this testcase, instead we
+ should generate the following:
+
+ | if (winner >= 0 && winner < numf2s && Y[winner].y > 0)
+ | tsum += tds[ti][winner] * d;
+
+ For the moment this is XFAILed as this loop is not detected as a
+ SCoP by graphite: we depend on data in one of the conditions,
+ "Y[winner].y > 0". This could be fixed when we will use predicates
+ for such cases. */
+
+/* { dg-final { scan-tree-dump-times "loop_1" 0 "graphite" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr36287.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr36287.c
new file mode 100644
index 000000000..51b77c715
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr36287.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-linear" } */
+
+int tab[2][2];
+
+int foo ()
+{
+ int i, j, k;
+
+ for (i = 0; i < 2; ++i)
+ for (j = 0; j < 2; ++j)
+ for (k = 0; k < 2; ++k)
+ {}
+
+ for (i = 0; i < 2; ++i)
+ for (j = 0; j < 2; ++j)
+ if (i == 0)
+ tab[i][j] = 0;
+
+ return tab[0][1];
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37485.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37485.c
new file mode 100644
index 000000000..7432aaa2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37485.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O2 -floop-block -fno-loop-strip-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all" } */
+
+typedef unsigned char UChar;
+typedef int Int32;
+typedef unsigned int UInt32;
+
+void fallbackSort ( UInt32* fmap,
+ UInt32* eclass,
+ Int32 nblock,
+ Int32 verb )
+{
+ Int32 ftab[257];
+ Int32 ftabCopy[256];
+ Int32 H, i, j, k, l, r, cc, cc1;
+ Int32 nNotDone;
+ Int32 nBhtab;
+ UChar* eclass8 = (UChar*)eclass;
+
+ if (verb >= 4)
+ VPrintf0 ( " bucket sorting ...\n" );
+ for (i = 0; i < 257; i++) ftab[i] = 0;
+ for (i = 0; i < nblock; i++) ftab[eclass8[i]]++;
+ for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i];
+ for (i = 1; i < 257; i++) ftab[i] += ftab[i-1];
+
+ for (i = 0; i < nblock; i++) {
+ j = eclass8[i] + ftab [i];
+ }
+ AssertH ( j < 256, 1005 );
+}
+/* { dg-final { scan-tree-dump-times "Loop blocked" 1 "graphite" { xfail *-*-* }} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37684.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37684.c
new file mode 100644
index 000000000..ab5a68533
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37684.c
@@ -0,0 +1,67 @@
+/* { dg-options "-O2 -fdump-tree-graphite-all" } */
+
+typedef struct _IO_FILE FILE;
+struct _IO_marker {
+};
+enum __codecvt_result
+{
+ __codecvt_noconv
+};
+struct _IO_FILE {
+};
+extern struct _IO_FILE *stderr;
+
+typedef
+ struct {
+ unsigned int avail_in;
+ unsigned int avail_out;
+ void *state;
+ void *(*bzalloc)(void *,int,int);
+ void *opaque;
+ }
+ bz_stream;
+extern int BZ2_bzCompressInit (
+ bz_stream* strm,
+ int blockSize100k,
+ int verbosity,
+ int workFactor
+ );
+typedef unsigned char Bool;
+typedef int Int32;
+typedef unsigned int UInt32;
+
+typedef
+ struct {
+ Int32 mode;
+ Int32 state;
+ UInt32* arr1;
+ UInt32* arr2;
+ UInt32* ftab;
+ Int32 nblock;
+ Int32 nblockMAX;
+ Bool inUse[256];
+ Int32 blockNo;
+ }
+ EState;
+
+void prepare_new_block ( EState* s )
+{
+ Int32 i;
+ for (i = 0; i < 256; i++) s->inUse[i] = ((Bool)0);
+ s->blockNo++;
+}
+
+int BZ2_bzCompressInit
+ ( bz_stream* strm,
+ int blockSize100k,
+ int verbosity,
+ int workFactor )
+{
+ EState* s;
+ s = (strm->bzalloc)(strm->opaque,(sizeof(EState)),1);
+ if (s->arr1 == ((void *)0) || s->arr2 == ((void *)0) || s->ftab == ((void *)0)) {
+ }
+ prepare_new_block ( s );
+}
+
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37686.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37686.c
new file mode 100644
index 000000000..a5094bf97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37686.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-O3 -ftree-loop-linear" } */
+
+unsigned char inUse[256];
+unsigned char len[6][258];
+int code[6][258];
+unsigned int crc32Table[256] = { };
+ unsigned int getGlobalCRC (void) { }
+ int bsLive;
+void bsW (int n, unsigned int v) {
+ while (bsLive >= 8) {}
+ }
+ void hbAssignCodes (int * code, unsigned char * length, int minLen,
+int maxLen, int alphaSize) {
+ int n, vec, i;
+ for (n = minLen;n <= maxLen;n++)
+ for (i = 0; i < alphaSize;i++)
+ code[i] = vec;
+ }
+ void sendMTFValues (void) {
+ int v, t, i, j, gs, ge, totc, bt, bc, iter;
+ int nSelectors, alphaSize, minLen, maxLen, selCtr;
+ int nGroups, nBytes;
+ {
+ while (1)
+ {
+ break;
+ }
+ hbAssignCodes (&code[t][0], &len[t][0], minLen, maxLen, alphaSize);
+ unsigned char inUse16[16];
+ for (i = 0;i < 16;i++)
+ if (inUse16[i])
+ {
+ for (j = 0;j < 16;j++)
+ if (inUse[i * 16 + j]) { }
+ }
+ }
+ for (i = 0; i < nSelectors;i++) { }
+ for (t = 0; t < nGroups;t++)
+ {
+ int curr = len[t][0];
+ for (i = 0; i < alphaSize;i++)
+ while (curr < len[t][i]) { }
+ }
+ while (1)
+ for (i = gs; i <= ge;i++) { }
+ }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37828.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37828.c
new file mode 100644
index 000000000..df0ef7c0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37828.c
@@ -0,0 +1,25 @@
+/* { dg-options "-O2" } */
+
+typedef struct foo
+{
+ struct foo **Node;
+} foo;
+
+static int sort_and_split (foo **Root, foo **Finite, long first)
+{
+ foo *cd;
+ long i;
+ for (i = 0; i < first; i++)
+ cd->Node[i] = Finite[first+i];
+
+ sort_and_split(Root, Finite, first);
+ return (0);
+}
+
+
+void Build_foo(foo **Root, foo **Finite, foo **Infinite)
+{
+ long low, high;
+ while (sort_and_split(Root, Finite, low) == 0);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37883.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37883.c
new file mode 100644
index 000000000..9b386561c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37883.c
@@ -0,0 +1,11 @@
+/* { dg-options "-O3" } */
+
+void test_sort()
+{
+ char *base;
+ register char c, *i, *hi;
+
+ for (i = base; i < hi; i++)
+ *i++ = c;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37928.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37928.c
new file mode 100644
index 000000000..3c33f3a46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37928.c
@@ -0,0 +1,33 @@
+/* { dg-options "-O3" } */
+
+int get_state(int size, int *node, int *hash)
+{
+ int i=0;
+ while(hash[i])
+ {
+ if(node[hash[i]] == 0)
+ return hash[i]-1;
+ i++;
+ if(i==5)
+ i=0;
+ }
+ return -1;
+}
+
+void foo (int);
+
+int gate1(int size, int *node, int *hash)
+{
+ int i, j ;
+ int add_size=0;
+ for(i=0; i<size; i++)
+ {
+ j = get_state(size,node, hash);
+ if(j == -1)
+ {
+ add_size++;
+ }
+ }
+
+ foo (size+add_size);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37943.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37943.c
new file mode 100644
index 000000000..4513d12c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr37943.c
@@ -0,0 +1,33 @@
+/* { dg-options "-O3 -fgraphite-identity -fdump-tree-graphite-all" } */
+
+typedef struct
+{
+ int mode,state,num,state_out;
+ unsigned char* bits;
+ char *out;
+}test;
+unsigned char copy( test* s )
+{
+ while(1)
+ {
+ if (s->mode == 0) break;
+ if (s->state_out >= s->num) break;
+ *(s->out) = s->bits[s->state_out];
+ if (s->mode == 0) s->mode++;
+ }
+}
+unsigned char compress(test *in)
+{
+ unsigned char p_in, p_out;
+ while(1)
+ {
+ if (in->state == 1)
+ {
+ p_out |= copy(in);
+ if (in->state_out < in->num) break;
+ }
+ }
+ return p_in || p_out;
+}
+/* { dg-final { cleanup-tree-dump "graphite" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38073.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38073.c
new file mode 100644
index 000000000..9c48d8d09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38073.c
@@ -0,0 +1,9 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+test_seg(int a, int b)
+{
+ int i,r=1;
+ for(i=0; i<b ;i++)
+ r*=a;
+ return r;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38084.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38084.c
new file mode 100644
index 000000000..7193f9600
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38084.c
@@ -0,0 +1,31 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+typedef struct {
+ unsigned int avail_out;
+ void *state;
+} stream;
+
+typedef struct {
+ stream* test;
+ int num;
+} state_in;
+
+int test_in ( stream *test, int action )
+{
+ state_in* tst;
+ if (test == ((void *)0)) return (-2);
+ if (tst == ((void *)0)) return (-2);
+ if (tst->test != test) return (-2);
+ jump_here:
+ switch (tst->num) {
+ case 1:
+ return (-1);
+ case 2:
+ if (action == 0) {
+ }
+ if (action == 1) {
+ goto jump_here;
+ }
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38125.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38125.c
new file mode 100644
index 000000000..780e6f643
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38125.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+typedef struct sv TEST_SV;
+typedef struct av TEST_AV;
+typedef struct magic TEST_MAGIC;
+typedef struct xpvav TEST_XPVAV;
+struct sv
+{
+ void* sv_any;
+};
+struct av
+{
+ TEST_XPVAV* sv_any;
+};
+struct xpvav
+{
+ char* xav_array;
+ long int xav_fill;
+ long int xav_max;
+};
+struct magic {
+ TEST_SV* mg_obj;
+};
+extern TEST_SV PL_sv_undef;
+Perl_av_fill( register TEST_AV *av, int fill)
+{
+ TEST_MAGIC *mg;
+ int key = ((TEST_XPVAV*) (av)->sv_any)->xav_fill;
+ TEST_SV** ary = ((TEST_SV**)((TEST_XPVAV*) (av)->sv_any)->xav_array);
+ while (key < fill)
+ ary[++key] = &PL_sv_undef;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38409.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38409.c
new file mode 100644
index 000000000..5cdb4725d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38409.c
@@ -0,0 +1,24 @@
+/* { dg-options "-O2" } */
+
+typedef struct test input ;
+struct test
+{
+ int type ;
+ int symflag ;
+};
+Chv_copyEntriesToVector ( input *chv,double *dvec)
+{
+ double *entries ;
+ int mm, nent;
+ int first, i, k , stride ;
+ if ( ((chv)->type == 1) )
+ {
+ for ( i = 0 ; i < 10 ; i++)
+ {
+ dvec[2*mm] = entries[2*k] ;
+ k += stride ;
+ stride -= 2 ;
+ }
+ }
+ return(mm) ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38413.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38413.c
new file mode 100644
index 000000000..6c2b23a88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38413.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+static int qsz;
+
+void specqsort(base, n, size, compar)
+ char *base;
+{
+ register char c, *i, *j, *lo, *hi;
+ qsz = size;
+ for (i = base, hi = base + qsz; i < hi; )
+ {
+ *i++ = c;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38446.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38446.c
new file mode 100644
index 000000000..b7b346cd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38446.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+void copy_data()
+{
+ int ****source;
+ int ****dest;
+
+ int i, j, k, l;
+ for (i = 0; i < 10; i++)
+ for (k = 0; k < 2; k++)
+ for (l = 0; l < 65; l++)
+ source[i][j][k][l] = dest[i][j][k][l];
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38498.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38498.c
new file mode 100644
index 000000000..d20b4ae16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38498.c
@@ -0,0 +1,19 @@
+/* { dg-options "-O2" } */
+
+double test_vector (float **data, int rows, int cols, int vqrows,double epsilon, int maxiter,int **mean, int *map)
+{
+ int i, j, r, it;
+ double sqerr, prev_sqerr=0, t;
+ unsigned int *sel;
+ int *count;
+ for (it = 0;; it++)
+ {
+ if ((sqerr == 0.0) || (it >= maxiter-1) ||((it > 0) && ( ((prev_sqerr - sqerr) / prev_sqerr) < epsilon )) )
+ for (i = 0; i < vqrows; i++)
+ {
+ for (j = 0; j < cols; j++)
+ mean[i][j] = 0.0;
+ count[i] = 0;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38500.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38500.c
new file mode 100644
index 000000000..f5292d173
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38500.c
@@ -0,0 +1,29 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+typedef unsigned char U8;
+extern char test1;
+
+char *Perl_screaminstr (int, int, int);
+
+void
+Perl_re_intuit_start( int minlen, char *strend, unsigned int flags, int i)
+{
+ register int start_shift = 0;
+ register int end_shift = 0;
+ register char *s;
+ char *strbeg;
+ char *t;
+ if(i > 0)
+ goto success_at_start;
+ int end = 0;
+ int eshift = (test1 ? Perl_utf8_distance((U8*)strend,(U8*)s) : (U8*)strend - (U8*)s) - end;
+ if (end_shift < eshift)
+ end_shift = eshift;
+ restart:
+ s = Perl_screaminstr(start_shift + (s - strbeg), end_shift, 0);
+ while( t < strend - minlen){
+ }
+ success_at_start:
+ eshift = (test1 ? Perl_utf8_distance((U8*)strend,(U8*)s) : (U8*)strend - (U8*)s) - end;
+ goto restart;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38510.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38510.c
new file mode 100644
index 000000000..07ddb6ef1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38510.c
@@ -0,0 +1,40 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+typedef long int integer;
+typedef double doublereal;
+
+static int balanc_(nm, n, a, low, igh, scale)
+doublereal *a;
+{
+ integer a_dim1, a_offset, i__1, i__2;
+ integer iexc;
+ integer i__, j, k, l, m;
+ integer jj;
+goto L100;
+L20:
+if (j == m) {
+goto L50;
+}
+for (i__ = 1; i__ <= i__1; ++i__) {
+a[i__ + j * a_dim1] = a[i__ + m * a_dim1];
+}
+L50:
+switch ((int)iexc) {
+case 2: goto L130;
+}
+L100:
+for (jj = 1; jj <= i__1; ++jj) {
+goto L20;
+}
+L130:
+for (j = k; j <= i__1; ++j) {
+goto L20;
+}
+}
+
+int pymol_rg_(integer *nm, integer *n, doublereal *a, doublereal *wr,
+ doublereal *fv1,integer *ierr)
+{
+ integer a_dim1, a_offset, z_dim1, z_offset;
+ integer is1, is2;
+ balanc_(nm, n, &a[a_offset], &is1, &is2, &fv1[1]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38559.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38559.c
new file mode 100644
index 000000000..7f90a50ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38559.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O2" } */
+
+int test()
+{
+ int offset, len;
+ register char *mid;
+ register char *midend;
+ register char *bigend;
+ long unsigned int curlen;
+ if (offset + len > curlen) {
+ while (midend > mid)
+ *--bigend = *--midend;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38786.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38786.c
new file mode 100644
index 000000000..47df44789
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr38786.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+typedef struct
+{
+ int ****cofAC;
+} ImageParameters;
+typedef struct
+{
+ int ****cofAC;
+} RD_DATA;
+extern RD_DATA *rdopt;
+extern ImageParameters *img;
+dummy_slice_too_big (int bits_slice)
+{
+ int i, j, k, l;
+ for (j = 0; j < 4; j++)
+ for (k = 0; k < 2; k++)
+ for (l = 0; l < 65; l++)
+ img->cofAC[i][j][k][l] = rdopt->cofAC[i][j][k][l];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39260.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39260.c
new file mode 100644
index 000000000..066b5bde8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39260.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O2 -fgraphite-identity -ffast-math" } */
+
+VBR_encode_frame (int mode_gr, int channels_out, int max_bits[2][2])
+{
+ int max_nbits_ch[2][2];
+ int gr, ch;
+ for (gr = 0; gr < mode_gr; ++gr)
+ {
+ float f[2], s = 0;
+ for (ch = 0; ch < channels_out; ++ch)
+ if (max_nbits_ch[gr][ch] > 0)
+ s += f[ch];
+ for (ch = 0; ch < channels_out; ++ch)
+ if (s > 0)
+ max_nbits_ch[gr][ch] = 7680 * f[ch] / s;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39335.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39335.c
new file mode 100644
index 000000000..5b8fb5438
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39335.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O2" } */
+
+typedef unsigned char byte;
+typedef struct gx_device_s gx_device;
+typedef struct gs_devn_params_s gs_devn_params;
+typedef struct gs_devn_params_s {
+ struct compressed_color_list_s * compressed_color_list;
+} gs_devn_params_t;
+int devn_unpack_row(gx_device * dev, int num_comp,
+ gs_devn_params * pdevn_params, int width, byte * in,
+ byte * out)
+{
+ int i, comp_num, pixel_num;
+ if (pdevn_params->compressed_color_list == ((void *)0))
+ {
+ for (pixel_num = 0; pixel_num < width; pixel_num++)
+ for (i = 0; i < num_comp; i++)
+ *out++ = *in++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39335_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39335_1.c
new file mode 100644
index 000000000..dfa2465e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr39335_1.c
@@ -0,0 +1,9 @@
+/* { dg-options "-O2" } */
+
+void crash_me(int num1, int num2, char * in, char * out)
+{
+ int i, j;
+ for (j = 0; j < num1; j++)
+ for (i = 0; i < num2; i++)
+ *out++ = *in++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr40157.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr40157.c
new file mode 100644
index 000000000..513958fe5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr40157.c
@@ -0,0 +1,13 @@
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-O2 -fgraphite-identity -floop-block" } */
+
+int buffer[256*256];
+int main(void)
+{
+ int *dest = buffer;
+ int x, y;
+ for(x = 0; x < 256; x++)
+ for(y = 0; y < 256; y++)
+ *dest++ = 0;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr40281.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr40281.c
new file mode 100644
index 000000000..d242754a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr40281.c
@@ -0,0 +1,13 @@
+/* { dg-options "-O -fprefetch-loop-arrays -w" } */
+/* { dg-options "-O -fprefetch-loop-arrays -march=i686 -msse -w" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+void foo(int);
+void bar(int n)
+{
+ int a[2], i, j = 0;
+
+ for (i = 0; i < 2; i += j+1)
+ for (j = 0; j < (n ? 1 : 2); ++j)
+ foo(a[i] + a[j]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr41888.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr41888.c
new file mode 100644
index 000000000..45df7df28
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr41888.c
@@ -0,0 +1,17 @@
+/* { dg-options "-g -O2 -ftree-loop-distribution -fgraphite-identity" } */
+
+int
+foo (int *x)
+{
+ int a[10], b[10];
+ int i;
+ a[9] = 8;
+ b[9] = 8;
+ for (i = 0; i < 9; i++)
+ {
+ a[i] = *x++;
+ b[i] = 1;
+ }
+ b[i] = b[i] & !(a[i] ^ *x++);
+ return b[i] ? i + 1 : 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42205-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42205-1.c
new file mode 100644
index 000000000..413b9f7ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42205-1.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O1 -ffast-math -floop-interchange" } */
+
+int adler32(int adler, char *buf, int n)
+{
+ int sum = 0;
+ do {
+ adler += buf[0];
+ sum += adler;
+ adler += buf[1];
+ sum += adler;
+ adler += buf[2];
+ sum += adler;
+ adler += buf[3];
+ sum += adler;
+ } while (--n);
+ return adler | (sum << 16);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42205-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42205-2.c
new file mode 100644
index 000000000..595cedb90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42205-2.c
@@ -0,0 +1,11 @@
+/* { dg-options "-O1 -funsafe-math-optimizations -floop-interchange" } */
+
+double f(double x)
+{
+ double y = 0.0;
+ int i;
+ for (i = 0; i < 8; i++) {
+ y += x * i;
+ }
+ return y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42211.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42211.c
new file mode 100644
index 000000000..d8fb915f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42211.c
@@ -0,0 +1,22 @@
+/* { dg-options "-O3 -floop-interchange" } */
+
+typedef unsigned char uint8_t;
+
+void border_mirror(uint8_t *outer_img, int w, int h, int rb, int border)
+{
+ uint8_t *img = outer_img + border * rb + border;
+ int x, y;
+
+ for (y = -border; y < 0; y++) {
+ for (x = -border; x < 0; x++)
+ img[y*rb + x] = img[(-y)*rb + (-x)];
+
+ for (x = 0; x < w; x++)
+ img[y*rb + x] = img[(-y)*rb + x];
+ }
+}
+
+void border_mirror_480(uint8_t *outer_img)
+{
+ border_mirror(outer_img, 640, 480, 640 + 16*2, 16);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42221.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42221.c
new file mode 100644
index 000000000..da8daa1e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42221.c
@@ -0,0 +1,24 @@
+/* { dg-options "-Os -fgraphite-identity" } */
+
+static void b2w(unsigned int *out, const unsigned char *in, unsigned int len)
+{
+ const unsigned char *bpend = in + len;
+ for (; in != bpend; in += 4, ++out)
+ {
+ *out = (unsigned int) (in[0] ) |
+ (unsigned int) (in[3] << 24);
+ }
+}
+static void md4step(unsigned int state[4], const unsigned char *data)
+{
+ unsigned int A, X[16];
+ b2w(X, data, 64);
+ state[0] += A;
+}
+void md4sum(void)
+{
+ unsigned char final[128];
+ unsigned int state[4];
+ md4step(state, final);
+ md4step(state, final + 64);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42284.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42284.c
new file mode 100644
index 000000000..854c2514f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42284.c
@@ -0,0 +1,27 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+int
+huft_build (unsigned *b)
+{
+ int k;
+ for (k = 0; k <= 10; k++)
+ if (foo ());
+}
+int
+inflate_fixed ()
+{
+ int i;
+ unsigned l[288];
+ for (i = 0; i < 144; i++)
+ l[i] = 8;
+ for (; i < 256; i++)
+ l[i] = 9;
+ for (; i < 280; i++)
+ l[i] = 7;
+ for (; i < 288; i++)
+ l[i] = 8;
+ if ((i = huft_build (l)) != 0)
+ return i;
+ for (i = 0; i < 30; i++)
+ l[i] = 5;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42326.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42326.c
new file mode 100644
index 000000000..de5d56ec9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42326.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O1 -floop-parallelize-all" } */
+
+double lagrange(const double x[],
+ const double y[],
+ long n,
+ double xval)
+{
+ long i, j;
+ double yval = 0.;
+
+ for( i=0; i < n; i++ )
+ {
+ double l = 1.;
+ for( j=0; j < n; j++ )
+ if( i != j )
+ l *= (xval-x[j])/(x[i]-x[j]);
+ yval += y[i]*l;
+ }
+ return yval;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42521.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42521.c
new file mode 100644
index 000000000..2695df579
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42521.c
@@ -0,0 +1,18 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+extern int *A;
+extern int B[][4];
+
+void foo(int im, int jm, int cond)
+{
+ int i, j;
+ if (cond)
+ for (i = 0; i < 256; i++)
+ A[i] = 0;
+
+ for (i = 0; i < im; i++)
+ for (j = 1; j < jm; j++)
+ if (jm != 8 || j != jm >> 1)
+ B[j][0] ^= B[j-1][0];
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42530.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42530.c
new file mode 100644
index 000000000..c0fa299ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42530.c
@@ -0,0 +1,18 @@
+/* { dg-options "-O2 -g -ffast-math -floop-parallelize-all" } */
+
+int array[2][2];
+
+void foo(int *a)
+{
+ int i, j;
+ int sum, tmp = 0;
+
+ for (i=0; i<2; i++)
+ for (j=0; j<2; j++)
+ sum += array[i][j];
+
+ if (sum > 0) {
+ tmp = sum;
+ *a = tmp;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42729.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42729.c
new file mode 100644
index 000000000..a9f1e2dee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42729.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O1 -fgraphite-identity -fcompare-debug" } */
+
+int A[10];
+int *foo ()
+{
+ int *p1, *p2, i;
+ for (i = 0; i < 10; i++)
+ {
+ p1 = &A[i];
+ *p1 = 0;
+ }
+ p2 = p1;
+ return p2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42771.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42771.c
new file mode 100644
index 000000000..505fda7eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42771.c
@@ -0,0 +1,19 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+extern int *A;
+extern int B[][4];
+extern void bar(void);
+
+void foo(int im, int jm, int cond)
+{
+ int i, j;
+ if (cond) {
+ for (i = 0; i < 256; i++)
+ A[i] = 0;
+ bar();
+ }
+ for (i = 0; i < im; i++)
+ for (j = 1; j < jm; j++)
+ if (jm != 8 || j != jm >> 1)
+ B[j][0] ^= B[j-1][0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42914.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42914.c
new file mode 100644
index 000000000..606ee0871
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42914.c
@@ -0,0 +1,21 @@
+/* { dg-options "-O2 -g -ffast-math -fgraphite-identity" } */
+
+int find_sad_16x16(int *mode)
+{
+ int current, best;
+ int M1[16][16],M0[4][4][4][4],M3[4],M4[4][4];
+ int i,j,k;
+ int ii,jj;
+
+ for (jj=0;jj<4;jj++)
+ for (ii=0;ii<4;ii++)
+ for (j=0;j<4;j++)
+ for (j=0;j<4;j++)
+ current += abs(M0[i][ii][j][jj]);
+
+ if(current < best)
+ {
+ best = current;
+ *mode = k;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42917.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42917.c
new file mode 100644
index 000000000..eddff3b58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr42917.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-loop-linear -fcompare-debug" } */
+
+extern int A[];
+
+void
+foo ()
+{
+ int i, j;
+ for (i = 0; i < 4; i++)
+ for (j = 255; j >= 0; j--)
+ A[j] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43012.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43012.c
new file mode 100644
index 000000000..6d0f3b041
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43012.c
@@ -0,0 +1,74 @@
+/* This testcase is from PR43012.
+ You will need CLooG-PPL 0.15.8 or later to have this testcase fixed. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -floop-strip-mine" } */
+
+extern void abort (void);
+
+#ifdef DBG
+extern int printf (const char *, ...);
+#endif
+
+#define LAST_TOKEN 534
+#define FLOAT_FUNCT_TOKEN 64
+#define VECTOR_FUNCT_TOKEN 77
+#define COLOUR_KEY_TOKEN 89
+
+int Table[LAST_TOKEN];
+
+void
+pre_init_tokenizer ()
+{
+ int i;
+
+ for (i = 0; i < LAST_TOKEN; i++)
+ {
+ Table[i] = i;
+ if (i < FLOAT_FUNCT_TOKEN)
+ Table[i] = FLOAT_FUNCT_TOKEN;
+ else
+ {
+ if (i < VECTOR_FUNCT_TOKEN)
+ Table[i] = VECTOR_FUNCT_TOKEN;
+ else
+ {
+ if (i < COLOUR_KEY_TOKEN)
+ Table[i] = COLOUR_KEY_TOKEN;
+ }
+ }
+ }
+}
+
+void
+check ()
+{
+ int i;
+
+ for (i = 0; i < FLOAT_FUNCT_TOKEN; i++)
+ if (Table[i] != FLOAT_FUNCT_TOKEN)
+ abort ();
+ for (i = FLOAT_FUNCT_TOKEN; i < VECTOR_FUNCT_TOKEN; i++)
+ if (Table[i] != VECTOR_FUNCT_TOKEN)
+ abort ();
+ for (i = VECTOR_FUNCT_TOKEN; i < COLOUR_KEY_TOKEN; i++)
+ if (Table[i] != COLOUR_KEY_TOKEN)
+ abort ();
+ for (i = COLOUR_KEY_TOKEN; i < LAST_TOKEN; i++)
+ if (Table[i] != i)
+ abort ();
+}
+
+int
+main ()
+{
+ int i;
+
+ pre_init_tokenizer ();
+#ifdef DBG
+ for (i = 0; i < LAST_TOKEN; i++)
+ printf ("%3d: %d\n", i, Table[i]);
+#endif
+ check ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43083.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43083.c
new file mode 100644
index 000000000..afb97af94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43083.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+extern void baz(void);
+
+static inline int bar(void)
+{
+ int i;
+ for (i = 0; i < 10; i++) baz();
+}
+
+int foo(void)
+{
+ if (bar() != 0) return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43306.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43306.c
new file mode 100644
index 000000000..43195e489
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43306.c
@@ -0,0 +1,9 @@
+/* { dg-options "-O1 -fstrict-overflow -fgraphite-identity" } */
+
+void foo(int x[])
+{
+ int i, j;
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ x[i] = x[i*j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43567.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43567.c
new file mode 100644
index 000000000..1bb8042ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43567.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-inline -fno-tree-ch -ftree-loop-linear" } */
+
+extern void abort ();
+
+int
+test (int n, int *a)
+{
+ int i, j;
+
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j++)
+ a[j] = i + n;
+
+ if (a[0] != 31 || i + n - 1 != 31)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[16];
+ test (16, a);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43657.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43657.c
new file mode 100644
index 000000000..18afe1e1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr43657.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -ftree-loop-linear" } */
+
+extern void abort (void);
+
+#define K 32
+
+int cond_array[2*K][K];
+int a[K][K];
+int out[K];
+int check_result[K] = {2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+
+__attribute__ ((noinline)) void
+foo (int c)
+{
+ int res, i, j, k, next;
+
+ for (k = 0; k < K; k++)
+ {
+ res = 0;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ {
+ next = a[i][j];
+ res = c > cond_array[i+k][j] ? next : res;
+ }
+
+ out[k] = res;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ cond_array[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ a[i][j] = i+2;
+ }
+
+ foo(5);
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr44391.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr44391.c
new file mode 100644
index 000000000..de9889668
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr44391.c
@@ -0,0 +1,7 @@
+/* { dg-options "-Os -fgraphite-identity -ffast-math" } */
+
+void byte_insert_op1 (unsigned char *loc, unsigned char *end, unsigned *pto)
+{
+ while (end != loc)
+ *pto = *--end;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr45297.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr45297.c
new file mode 100644
index 000000000..faa653a57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr45297.c
@@ -0,0 +1,9 @@
+/* { dg-options "-Os -fgraphite-identity" } */
+
+void
+foo (int *p)
+{
+ int *q = p + 1024;
+ while (q != p)
+ *--q = *--q;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46168.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46168.c
new file mode 100644
index 000000000..28b48415d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46168.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-linear" } */
+
+int
+foo (int a[4096], int mi, int mj)
+{
+ int i, j, i16;
+ for (i = 0; i < mi; i++)
+ {
+ i16 = i + 16;
+ for (j = 0; j < mj; j++)
+ i16 = a[j] == i16;
+ }
+ return i16;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46185.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46185.c
new file mode 100644
index 000000000..36d46a41c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46185.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -floop-interchange -ffast-math -fno-ipa-cp" } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[1782225];
+
+static int __attribute__((noinline))
+foo (int N, int *res)
+{
+ int i, j;
+ double sum = 0;
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum = sum + u[i + 1335 * j];
+
+ for (i = 0; i < N; i++)
+ u[1336 * i] *= 2;
+
+ *res = sum + N + u[1336 * 2] + u[1336];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < 1782225; i++)
+ u[i] = 2;
+
+ foo (1335, &res);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 3565793)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46215.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46215.c
new file mode 100644
index 000000000..cf7b07f20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46215.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-overflow -fno-tree-ch -ftree-loop-linear" } */
+
+extern int y[], x1[], x2[];
+void
+foo (long n)
+{
+ int i, j;
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j += 2)
+ y[i] = x1[i + j] * x2[i + j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46404-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46404-1.c
new file mode 100644
index 000000000..c3e620cbc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46404-1.c
@@ -0,0 +1,27 @@
+/* { dg-options "-O -fgraphite-identity -fno-tree-scev-cprop" } */
+
+int
+huft_build (unsigned *b)
+{
+ int k;
+ for (k = 0; k <= 10; k++)
+ if (foo ());
+}
+int
+inflate_fixed ()
+{
+ int i;
+ unsigned l[288];
+ for (i = 0; i < 144; i++)
+ l[i] = 8;
+ for (; i < 256; i++)
+ l[i] = 9;
+ for (; i < 280; i++)
+ l[i] = 7;
+ for (; i < 288; i++)
+ l[i] = 8;
+ if ((i = huft_build (l)) != 0)
+ return i;
+ for (i = 0; i < 30; i++)
+ l[i] = 5;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46404.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46404.c
new file mode 100644
index 000000000..9bdde4a64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46404.c
@@ -0,0 +1,13 @@
+/* { dg-options "-O -fgraphite-identity -fno-tree-scev-cprop" } */
+
+int l[200];
+
+void
+foo (void)
+{
+ int i = 0;
+ for (; i < 100; i++)
+ ;
+ for (; i; i--)
+ l[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46761.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46761.c
new file mode 100644
index 000000000..f45398a2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46761.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "-O -fgraphite-identity" } */
+
+#define N 128
+
+int
+main ()
+{
+ int arr[N], i, s = 0;
+ for (i = 0; i < N; i++)
+ arr[i] = i;
+
+ for (i = 0; i < N; i++)
+ if (arr[i] != i)
+ __builtin_abort ();
+
+ for (i = 0; i < N; i++)
+ s += arr[i];
+ if (s != (N * (N - 1)) / 2)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46924.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46924.c
new file mode 100644
index 000000000..5788c2c00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46924.c
@@ -0,0 +1,18 @@
+/* { dg-options "-O -fgraphite-identity -ffast-math -fno-tree-loop-im" } */
+
+struct S
+{
+ int n;
+ float *a;
+};
+
+float foo (struct S *s)
+{
+ float f = 0, g=0;
+ int i;
+ for (i = 0; i < s->n; i++)
+ f += s->a[i];
+ for (i = 0; i < s->n; i++)
+ ;
+ return f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46966.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46966.c
new file mode 100644
index 000000000..bb55b71b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46966.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/46966 */
+/* { dg-do compile } */
+/* This test is too big for small targets. */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-O -floop-interchange -ffast-math -fno-tree-copy-prop -fno-tree-loop-im" } */
+
+int a[1000][1000];
+
+void foo ()
+{
+ int i, j;
+ for (i = 0; i < 1000; i++)
+ for (j = 0; j < 1000; j++)
+ a[i][j] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46970.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46970.c
new file mode 100644
index 000000000..b1ef7d62b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr46970.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-Os -ftree-loop-linear" } */
+
+#define N 16
+
+int
+main1 (int n, int *a)
+{
+ int i, j;
+
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j++)
+ a[j] = i + n;
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ __builtin_abort ();
+
+ return 0;
+}
+
+int
+main ()
+{
+ int a[N];
+ main1 (N, a);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr50561.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr50561.c
new file mode 100644
index 000000000..5fbad4a73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr50561.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-strip-mine" } */
+
+void f (unsigned *s)
+{
+ int n;
+ for (n = 0; n < 256; n++)
+ s[n] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr54094.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr54094.c
new file mode 100644
index 000000000..ee99110b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr54094.c
@@ -0,0 +1,10 @@
+/* { dg-options "-O2 -floop-parallelize-all -floop-nest-optimize" } */
+void dwt_deinterleave_h(int *a, int *b, int dn, int sn, int cas)
+{
+ int i;
+ for (i=0; i<sn; i++)
+ b[i]=a[2*i+cas];
+ for (i=0; i<dn; i++)
+ b[sn+i]=a[(2*i+1-cas)];
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-1.c
new file mode 100644
index 000000000..a58c090e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-1.c
@@ -0,0 +1,27 @@
+/* { dg-options "-Wl,--stack,12582912" { target *-*-mingw* *-*-cygwin* } } */
+/* { dg-require-effective-target size32plus } */
+
+void abort (void);
+
+void foo (int N)
+{
+ int i, j;
+ int x[1000][1000];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i][j] = i + j + 3;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ if (x[i][j] != i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ foo (1000);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-2.c
new file mode 100644
index 000000000..4a2361667
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-2.c
@@ -0,0 +1,35 @@
+int a[1] = {1};
+
+static int __attribute__((noinline))
+foo(int n)
+{
+ int i, c = 0;
+ for (i = 0; i < n; i++)
+ c += a[i];
+ return c;
+}
+
+int b[2] = {2, 3};
+
+static int __attribute__((noinline)) bar(int n)
+{
+ int i, c = 0;
+ for (i = 0; i < n; i++)
+ c += b[i];
+ return c;
+}
+
+extern void abort ();
+
+int main()
+{
+ if (foo(0) != 0
+ || foo(1) != 1
+ || bar(0) != 0
+ || bar(1) != 2
+ || bar(2) != 5)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-3.c
new file mode 100644
index 000000000..e708ba0bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-3.c
@@ -0,0 +1,24 @@
+extern void abort (void);
+
+__attribute__ ((noinline)) int
+foo (int *zzz, unsigned int kk)
+{
+ int a, b, d;
+
+ a = b = 0;
+ for (d = 0; d < 1000; d++)
+ {
+ if (kk != 0)
+ b = *zzz;
+ }
+
+ return b;
+}
+
+int
+main (void)
+{
+ if (foo (0, 0) != 0)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-4.c
new file mode 100644
index 000000000..143a449d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-4.c
@@ -0,0 +1,28 @@
+/* PR rtl-optimization/24899 */
+
+extern void abort (void);
+
+__attribute__ ((noinline)) int
+foo (int x, int y, int *z)
+{
+ int a, b, c, d;
+
+ a = b = 0;
+ for (d = 0; d < y; d++)
+ {
+ if (z)
+ b = d * *z;
+ for (c = 0; c < x; c++)
+ a += b;
+ }
+
+ return a;
+}
+
+int
+main (void)
+{
+ if (foo (3, 2, 0) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-5.c
new file mode 100644
index 000000000..9005c43fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-5.c
@@ -0,0 +1,54 @@
+/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model -fno-tree-scev-cprop -fgraphite-identity" } */
+/* { dg-require-effective-target vect_int } */
+
+/* gcc.dg/vect/no-scevccp-outer-22.c was miscompiled by Graphite.
+ Adding it here to always test it with Graphite. */
+
+#include <stdarg.h>
+
+extern void abort ();
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum;
+
+ if (n<=0)
+ return 0;
+
+ /* inner-loop index j used after the inner-loop */
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < n; j+=2) {
+ sum += j;
+ }
+ a[i] = sum + j;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j+=2)
+ sum += j;
+ if (a[i] != sum + j)
+ abort();
+ }
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-6.c
new file mode 100644
index 000000000..dafa7f8be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-6.c
@@ -0,0 +1,55 @@
+/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model -fno-tree-scev-cprop -fgraphite-identity" } */
+/* { dg-require-effective-target vect_int } */
+
+/* gcc.dg/vect/no-scevccp-outer-4.c was miscompiled by Graphite.
+ Adding it here to always test it with Graphite. */
+
+#include <stdarg.h>
+
+extern void abort ();
+#define N 40
+
+int a[N];
+
+/* induction variable k advances through inner and outer loops. */
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j,k=0;
+ int sum;
+
+ if (n<=0)
+ return 0;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < n; j+=2) {
+ sum += k++;
+ }
+ a[i] = sum + j;
+ }
+}
+
+int main (void)
+{
+ int i,j,k=0;
+ int sum;
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j+=2)
+ sum += k++;
+ if (a[i] != sum + j)
+ abort();
+ }
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c
new file mode 100644
index 000000000..d134b5c30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c
@@ -0,0 +1,37 @@
+/* Testcase extracted from test 183.equake in SPEC CPU2000. */
+double Ke[2], ds[2];
+
+void foo(double Ke[2], int i, double ds[], int column)
+{
+ double tt, ts;
+ int j;
+
+ for (j = 0; j < 2; j++)
+ {
+ ++column;
+ ts = ds[i];
+ if (i == j)
+ tt = 123;
+ else
+ tt = 0;
+ Ke[column] = Ke[column] + ts + tt;
+ }
+}
+
+extern void abort ();
+
+int
+main ()
+{
+ int i, j;
+
+ ds[0] = 1.0;
+ ds[1] = 1.0;
+
+ foo(Ke, 0, ds, -1);
+
+ if ((int) Ke[0] != 124)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c
new file mode 100644
index 000000000..81411f570
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c
@@ -0,0 +1,18 @@
+int
+movegt (int y, long long a)
+{
+ int i;
+ int ret = 0;
+ for (i = 0; i < y; i++)
+ if (a == -1LL << 33)
+ ret = -1;
+ return ret;
+}
+
+int
+main ()
+{
+ if (movegt (1, -1LL << 33) != -1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47593.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47593.c
new file mode 100644
index 000000000..16e77717a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47593.c
@@ -0,0 +1,29 @@
+/* { dg-options "-O2 -fgraphite-identity" } */
+
+struct Foo {
+ int **p;
+ int **q;
+};
+
+int __attribute__((noinline))
+bar (void)
+{
+ struct Foo f;
+ int j, i = 1;
+ char *p;
+ int *x = &i;
+ int *y = &j;
+ f.p = &y;
+ f.q = &x;
+ p = (char *)&f;
+ for (j = 0; j < sizeof (int *); ++j)
+ p++;
+ return ***(int ***)p;
+}
+extern void abort (void);
+int main()
+{
+ if (bar () != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47653.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47653.c
new file mode 100644
index 000000000..b62b891d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47653.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O -fstack-check=generic -ftree-pre -fgraphite-identity" } */
+
+int main ()
+{
+ int i, j;
+ int x[8][8];
+ for (i = 0; i < 8; i++)
+ for (j = i; j < 8; j++)
+ x[i][j] = 4;
+
+ for (i = 0; i < 8; i++)
+ for (j = i; j < 8; j++)
+ if (x[i][j] != 4)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47654.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47654.c
new file mode 100644
index 000000000..85b6e8b70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/run-id-pr47654.c
@@ -0,0 +1,24 @@
+/* { dg-options "-O -floop-strip-mine" } */
+
+int a[128][40];
+
+void __attribute__ ((noinline, noclone))
+foo (void)
+{
+ int i, j;
+ for (i = 0; i < 40; i++)
+ for (j = 0; j < 128; j++)
+ a[j][i] = 4;
+}
+
+int
+main ()
+{
+ int i, j;
+ foo ();
+ for (i = 0; i < 40; i++)
+ for (j = 0; j < 128; j++)
+ if (a[j][i] != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-0.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-0.c
new file mode 100644
index 000000000..958285f8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-0.c
@@ -0,0 +1,22 @@
+int foo (void);
+void bar (void);
+
+int toto()
+{
+ /* Scop 1. */
+ int i, j, k;
+ int a[201][100];
+ int b[100];
+ int N = foo ();
+
+ for (i = 0; i < 2*N+ 100; i++)
+ for (j = 0; j < 200; j++)
+ a[j][i] = a[j+1][10] + 2;
+
+ return a[3][5] + b[1];
+ /* End scop 1. */
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-1.c
new file mode 100644
index 000000000..0fa51493e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-1.c
@@ -0,0 +1,31 @@
+void bar (void);
+
+int toto()
+{
+ int i, j, k;
+ int a[101][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 100; j++)
+ a[j][i] = a[j+1][i-1] + 2;
+
+ b[i] = b[i-1] + 2;
+
+ bar ();
+
+ for (j = 1; j < 100; j++)
+ a[j][i] = a[j+1][i-1] + 2;
+
+ b[i] = a[i-1][i] + 2;
+
+ for (j = 1; j < 100; j++)
+ a[j][i] = a[j+1][i-1] + 2;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-10.c
new file mode 100644
index 000000000..139f4c114
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-10.c
@@ -0,0 +1,31 @@
+void bar (void);
+
+int toto()
+{
+ int i, j, k;
+ int a[100][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 100; j++)
+ b[i+j] = b[i+j-1] + 2;
+
+ if (i * 2 == i + 8)
+ bar ();
+ else
+ {
+ for (j = 1; j < 100; j++)
+ b[i+j] = b[i+j-1] + 2;
+ a[i][i] = 2;
+ }
+
+ for (k = 1; k < 100; k++)
+ b[i+k] = b[i+k-5] + 2;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-11.c
new file mode 100644
index 000000000..544b36bd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-11.c
@@ -0,0 +1,32 @@
+void bar ();
+
+int toto()
+{
+ int i,j, b;
+ int a[100];
+
+ if (i == 20)
+ {
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i;
+ b = 3;
+ bar();
+ }
+ else
+ {
+ if (i == 30)
+ {
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i;
+ b = 5;
+ }
+ }
+
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i;
+
+ return a[b];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-12.c
new file mode 100644
index 000000000..71d34b1db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-12.c
@@ -0,0 +1,36 @@
+void bar ();
+
+int toto()
+{
+ int i,j, b;
+ int a[100];
+
+ switch (i)
+ {
+
+ case 5:
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i + 12;
+ break;
+ case 8:
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i + 122;
+ break;
+ case 15:
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i + 12;
+ break;
+ case 18:
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i + 4;
+ break;
+ default:
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i + 3;
+ }
+
+ return a[b];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 5" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-13.c
new file mode 100644
index 000000000..b2ca5b400
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-13.c
@@ -0,0 +1,41 @@
+void bar ();
+
+int toto()
+{
+ int i,j, b;
+ int a[100];
+
+ if (i == 20)
+ {
+ b = 3;
+ goto B;
+ }
+ else
+ {
+ if (i == 30)
+ {
+ a[i] = b;
+
+
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i;
+
+ B:
+
+ for (j = 0; j <= 20; j++)
+ a[j+b] = b + i;
+
+ bar ();
+ }
+ else
+ {
+ a[i] = b + 3;
+ }
+ }
+
+
+ return a[b];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-14.c
new file mode 100644
index 000000000..867e293d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-14.c
@@ -0,0 +1,25 @@
+void bar ();
+
+int toto()
+{
+ int i,j, b;
+ int a[100];
+
+ for (j = 0; j <= 20; j++)
+ {
+ a[j] = b + i;
+
+ if (j * i == b)
+ break;
+
+ a[j+b] = b + i;
+ }
+
+ a[i] = b + 3;
+
+
+ return a[b];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-15.c
new file mode 100644
index 000000000..6b2c2bdc8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-15.c
@@ -0,0 +1,51 @@
+# define EXTERN(type, array) extern type array[]
+typedef unsigned char uch;
+typedef unsigned short ush;
+EXTERN(uch, window);
+EXTERN(ush, prev);
+#ifndef WSIZE
+# define WSIZE 0x8000
+#endif
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+#define MAX_DIST (WSIZE-MIN_LOOKAHEAD)
+#define near
+typedef unsigned IPos;
+unsigned near max_chain_length;
+extern unsigned near strstart;
+unsigned int near prev_length;
+#define NIL 0
+unsigned near good_match;
+int near nice_match;
+#define WMASK (WSIZE-1)
+int longest_match(IPos cur_match)
+{
+ unsigned chain_length = max_chain_length;
+ register uch *scan = window + strstart;
+ register uch *match;
+ register int len;
+ int best_len = prev_length;
+ IPos limit = strstart > (IPos)MAX_DIST ? strstart - (IPos)MAX_DIST : NIL;
+ register uch *strend = window + strstart + MAX_MATCH;
+ register uch scan_end = scan[best_len];
+ if (prev_length >= good_match) {
+ }
+ do {
+ if (match[best_len] != scan_end ||
+ *++match != scan[1]) continue;
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ scan < strend);
+ len = MAX_MATCH - (int)(strend - scan);
+ if (len > best_len) {
+ best_len = len;
+ if (len >= nice_match) break;
+ }
+ } while ((cur_match = prev[cur_match & WMASK]) > limit
+ && --chain_length != 0);
+ return best_len;
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-16.c
new file mode 100644
index 000000000..83cbb9698
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-16.c
@@ -0,0 +1,25 @@
+/* { dg-require-effective-target size32plus } */
+
+#define N 10000
+void foo (int);
+int test ()
+{
+ int a[N][N];
+ int b[N][N];
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[i][j] = i*j;
+
+ for (j = 1; j < N; j++)
+ for (i = 0; i < N; i++)
+ a[i][j] = a[i][j-1] + b[i][j];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ foo (a[i][j]);
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-17.c
new file mode 100644
index 000000000..a7dff5f6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-17.c
@@ -0,0 +1,24 @@
+/* { dg-require-effective-target size32plus } */
+
+#define N 10000
+void foo (int);
+int test ()
+{
+ int a[N][N];
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[i][j] = i*j;
+
+ for (i = 1; i < N; i++)
+ for (j = 1; j < (N-1) ; j++)
+ a[i][j] = a[i-1][j+1] * a[i-1][j+1]/2;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ foo (a[i][j]);
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-18.c
new file mode 100644
index 000000000..4c2a8cdf6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-18.c
@@ -0,0 +1,26 @@
+/* { dg-require-effective-target size32plus } */
+
+#define N 24
+#define M 1000
+
+float A[1000][1000], B[1000][1000], C[1000][1000];
+
+void test (void)
+{
+ int i, j, k;
+
+ /* These loops contain too few iterations for being strip-mined by 64. */
+ for (i = 0; i < 24; i++)
+ for (j = 0; j < 24; j++)
+ for (k = 0; k < 24; k++)
+ A[i][j] = B[i][k] * C[k][j];
+
+ /* These loops should still be strip mined. */
+ for (i = 0; i < 1000; i++)
+ for (j = 0; j < 1000; j++)
+ for (k = 0; k < 1000; k++)
+ A[i][j] = B[i][k] * C[k][j];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-19.c
new file mode 100644
index 000000000..cfbf40164
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-19.c
@@ -0,0 +1,34 @@
+typedef unsigned int __uint32_t;
+typedef __uint32_t __size_t;
+typedef __size_t size_t;
+struct demangle_component
+{
+ union
+ {
+ } u;
+};
+enum d_builtin_type_print
+{
+ D_PRINT_VOID
+};
+struct d_growable_string
+{
+ size_t alc;
+};
+d_growable_string_resize (struct d_growable_string *dgs, size_t need)
+{
+ size_t newalc;
+ newalc = dgs->alc > 0 ? dgs->alc : 2;
+ while (newalc < need)
+ newalc <<= 1;
+}
+d_growable_string_append_buffer (struct d_growable_string *dgs,
+ const char *s, size_t l)
+{
+ size_t need;
+ if (need > dgs->alc)
+ d_growable_string_resize (dgs, need);
+}
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 2 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-2.c
new file mode 100644
index 000000000..8378361c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-2.c
@@ -0,0 +1,39 @@
+void bar (void);
+
+int toto()
+{
+ int i, j, k;
+ int a[101][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 100; j++)
+ for (k = 1; k < 100; k++)
+ a[j][k] = a[j+1][i-1] + 2;
+
+ b[i] = b[i-1] + 2;
+
+ bar ();
+
+ for (j = 1; j < 100; j++)
+ a[j][i] = a[j+1][i-1] + 2;
+
+ b[i] = b[i-1] + 2;
+
+ bar ();
+
+ for (j = 1; j < 100; j++)
+ a[j][i] = a[j+1][i-1] + 2;
+
+ b[i] = a[i-1][i] + 2;
+
+ for (j = 1; j < 100; j++)
+ a[j][i] = a[j+1][i-1] + 2;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 4" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-20.c
new file mode 100644
index 000000000..f90b1746b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-20.c
@@ -0,0 +1,27 @@
+void bar (void);
+
+int toto()
+{
+ int i, j, k;
+ int a[101][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 100; j += i)
+ for (k = 1; k < 100; k++)
+ a[j][k] = a[j+1][i-1] + 2;
+
+ b[i] = b[i-1] + 2;
+
+ for (j = 1; j < 100; j++)
+ a[j][i] = a[j+1][i-1] + 2;
+
+ b[i] = b[i-1] + 2;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-21.c
new file mode 100644
index 000000000..1cbad5d8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-21.c
@@ -0,0 +1,31 @@
+#define N 10000
+void foo (int);
+int test ()
+{
+ int a[N+6];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i + 12;
+
+ if (i == 40)
+ a[i] = i;
+ else
+ a[i] = i+1;
+
+
+ a[i] = i + 12;
+ a[i] = a[i+1];
+ a[i] += a[i+2];
+ a[i] += a[i+3];
+ a[i] += a[i+4];
+ a[i] += a[i+5];
+ a[i] += a[i+6];
+
+ }
+
+ return a[20];
+}
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-22.c
new file mode 100644
index 000000000..b77be22b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-22.c
@@ -0,0 +1,21 @@
+double u[1782225];
+
+void foo(int N, int *res)
+{
+ int i;
+ double a, b;
+ double sum = 0.0;
+
+ for (i = 0; i < N; i++)
+ {
+ a = u[i];
+ u[i] = i * i;
+ b = u[i];
+ sum += a + b;
+ }
+
+ *res = sum + N;
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-3.c
new file mode 100644
index 000000000..18917c0ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-3.c
@@ -0,0 +1,28 @@
+int toto()
+{
+ int i, j, k;
+ int a[100][200];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 80; j++)
+ a[j][i] = a[j+1][2*i-1*j] + 12;
+
+ b[i] = b[i-1] + 10;
+
+ for (j = 1; j < 60; j++)
+ a[j][i] = a[j+1][i-1] + 8;
+
+ if (i == 23)
+ b[i] = a[i-1][i] + 6;
+
+ for (j = 1; j < 40; j++)
+ a[j][i] = a[j+1][i-1] + 4;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-4.c
new file mode 100644
index 000000000..4ab2d07f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-4.c
@@ -0,0 +1,29 @@
+void bar ();
+
+int toto()
+{
+ int i, j, k;
+ int a[100][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 80; j++)
+ a[j][i] = a[j+1][2*i-1*j] + 12;
+
+ b[i] = b[i-1] + 10;
+
+ for (j = 1; j < 60; j++)
+ a[j][i] = a[j+1][i-1] + 8;
+
+ bar ();
+
+ if (i == 23)
+ b[i] = a[i-1][i] + 6;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-5.c
new file mode 100644
index 000000000..4f4b45b49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-5.c
@@ -0,0 +1,35 @@
+void bar ();
+
+int toto()
+{
+ int i,j, b;
+ int a[100];
+
+ if (i == 20)
+ {
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i;
+ b = 3;
+ bar();
+ }
+ else
+ {
+ if (i == 30)
+ {
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i;
+ b = 5;
+ }
+ else
+ {
+ for (j = 0; j <= 20; j++)
+ a[j] = b + i;
+ b = 8;
+ }
+ }
+
+ return a[b];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-6.c
new file mode 100644
index 000000000..df208acb2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-6.c
@@ -0,0 +1,31 @@
+void bar (void);
+
+int toto()
+{
+ int i, j, k;
+ int a[100][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 100; j++)
+ b[i+j] = b[i+j-1] + 2;
+
+ if (i * 2 == i + 8)
+ b[i+k] = b[i+k-1] + 2;
+ else
+ {
+ for (k = 1; k < 100; k++)
+ b[i+k] = b[i+k-1] + 2;
+ bar ();
+ }
+
+ for (k = 1; k < 100; k++)
+ b[i+k] = b[i+k-5] + 2;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-7.c
new file mode 100644
index 000000000..c02748fa7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-7.c
@@ -0,0 +1,31 @@
+void bar (void);
+
+int toto()
+{
+ int i, j, k;
+ int a[100][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 100; j++)
+ b[i+j] = b[i+j-1] + 2;
+
+ if (i * 2 == i + 8)
+ {
+ bar ();
+ for (j = 1; j < 100; j++)
+ b[i+j] = b[i+j-1] + 2;
+ }
+ else
+ a[i][i] = 2;
+
+ for (k = 1; k < 100; k++)
+ b[i+k] = b[i+k-5] + 2;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 3" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-8.c
new file mode 100644
index 000000000..3f14e347a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-8.c
@@ -0,0 +1,31 @@
+int bar (void);
+
+int toto()
+{
+ int i, j, k;
+ int a[100][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 100; j++)
+ b[i+j] = b[i+j-1] + 2;
+
+ if (i * 2 == i + 8)
+ {
+ for (j = 1; j < 100; j++)
+ if (bar ())
+ b[i+j] = b[i+j-1] + 2;
+ }
+ else
+ a[i][i] = 2;
+
+ for (k = 1; k < 100; k++)
+ b[i+k] = b[i+k-5] + 2;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-9.c
new file mode 100644
index 000000000..a803d9217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-9.c
@@ -0,0 +1,27 @@
+void bar (void);
+
+int toto()
+{
+ int i, j, k;
+ int a[100][100];
+ int b[100];
+
+ for (i = 1; i < 100; i++)
+ {
+ for (j = 1; j < 100; j++)
+ b[i+j] = b[i+j-1] + 2;
+
+ if (i * 2 == i + 8)
+ bar ();
+ else
+ a[i][i] = 2;
+
+ for (k = 1; k < 100; k++)
+ b[i+k] = b[i+k-5] + 2;
+ }
+
+ return a[3][5] + b[1];
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-dsyr2k.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-dsyr2k.c
new file mode 100644
index 000000000..f5d1df1ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-dsyr2k.c
@@ -0,0 +1,21 @@
+#define NMAX 3000
+
+static double a[NMAX][NMAX], b[NMAX][NMAX], c[NMAX][NMAX];
+
+void dsyr2k(long N) {
+ int i,j,k;
+
+#pragma scop
+ for (i=0; i<N; i++) {
+ for (j=0; j<N; j++) {
+ for (k=j; k<N; k++) {
+ c[j][k] += a[i][j] * b[i][k] + b[i][j] * a[i][k];
+ }
+ }
+ }
+#pragma endscop
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite"} } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-dsyrk.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-dsyrk.c
new file mode 100644
index 000000000..a7bc5c498
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-dsyrk.c
@@ -0,0 +1,22 @@
+#define NMAX 3000
+#define MEASURE_TIME 1
+
+static double a[NMAX][NMAX], c[NMAX][NMAX];
+
+void dsyrk(long N)
+{
+ int i,j,k;
+
+#pragma scop
+ for (i=0; i<N; i++) {
+ for (j=0; j<N; j++) {
+ for (k=j; k<N; k++) {
+ c[j][k] += a[i][j] * a[i][k];
+ }
+ }
+ }
+#pragma endscop
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-matmult.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-matmult.c
new file mode 100644
index 000000000..018de2c4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-matmult.c
@@ -0,0 +1,20 @@
+/* { dg-require-effective-target size32plus } */
+
+float A[1000][1000], B[1000][1000], C[1000][1000];
+
+/* Multiply two n x n matrices A and B and store the result in C. */
+
+void matmult (int n)
+{
+ int i,j,k;
+
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j++)
+ for (k = 0; k < n; k++)
+ A[i][j] += B[i][k] * C[k][j];
+}
+
+/* This one fails because the number of iterations cannot be
+ determined anymore for the outermost loop. */
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-mvt.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-mvt.c
new file mode 100644
index 000000000..1181cdad0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-mvt.c
@@ -0,0 +1,24 @@
+#define NMAX 2000
+
+static double x1[NMAX], x2[NMAX], a[NMAX][NMAX], y_1[NMAX], y_2[NMAX];
+
+void mvt(long N) {
+
+ int i,j;
+
+ for (i=0; i<N; i++) {
+ for (j=0; j<N; j++) {
+ x1[i] = x1[i] + a[i][j] * y_1[j];
+ }
+ }
+
+ for (i=0; i<N; i++) {
+ for (j=0; j<N; j++) {
+ x2[i] = x2[i] + a[j][i] * y_2[j];
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-sor.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-sor.c
new file mode 100644
index 000000000..32c120731
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/scop-sor.c
@@ -0,0 +1,18 @@
+#define SIZE 10000
+
+static double P[SIZE][SIZE];
+
+void sor(int N1, int N2){
+ int i, j, k;
+
+#pragma scop
+ for(i=1; i<N1-1; i++) {
+ for(j=1; j<N2-1; j++) {
+ P[i][j] = (P[i][j] + P[i][j-1] + P[i][j+1] + P[i-1][j] + P[i+1][j]) / 5;
+ }
+ }
+#pragma endscop
+}
+
+/* { dg-final { scan-tree-dump-times "number of SCoPs: 1" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/vect-pr43423.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/vect-pr43423.c
new file mode 100644
index 000000000..bd685a651
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/vect-pr43423.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int a[100], b[100], c[100];
+
+void foo(int n, int mid)
+{
+ int i;
+ for(i=0; i<n; i++)
+ {
+ if (i < mid)
+ a[i] = a[i] + b[i];
+ else
+ a[i] = a[i] + c[i];
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/asm-1.c
new file mode 100644
index 000000000..e9cf4a167
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/asm-1.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+struct A { int x; unsigned short y; char z[64]; };
+
+void __attribute__((noinline))
+foo (struct A *p, char *q)
+{
+ int f = &p->z[p->y] - q;
+ asm volatile (NOP);
+ asm volatile (NOP : : "g" (f)); /* { dg-final { gdb-test 14 "f" "14" } } */
+ asm volatile ("" : : "g" (p), "g" (q));
+}
+
+int
+main ()
+{
+ struct A a;
+ __builtin_memset (&a, 0, sizeof a);
+ a.y = 26;
+ a.x = 12;
+ asm volatile ("" : : "r" (&a) : "memory");
+ foo (&a, &a.z[a.x]);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/bswaptest.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/bswaptest.c
new file mode 100644
index 000000000..38b9d981c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/bswaptest.c
@@ -0,0 +1,32 @@
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+volatile int vv;
+
+__attribute__((noclone, noinline)) long
+foo (long x)
+{
+ long f = __builtin_bswap64 (x);
+ long g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 12 "g" "f" } } */
+ return f;
+}
+
+__attribute__((noclone, noinline)) int
+bar (int x)
+{
+ int f = __builtin_bswap32 (x);
+ int g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 22 "g" "f" } } */
+ return f;
+}
+
+int
+main ()
+{
+ foo (0x123456789abcde0fUL);
+ bar (0x12345678);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/clztest.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/clztest.c
new file mode 100644
index 000000000..9428be30b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/clztest.c
@@ -0,0 +1,33 @@
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+volatile int vv;
+
+__attribute__((noinline, noclone)) long
+foo (long x)
+{
+ long f = __builtin_clzl (x);
+ long g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 12 "g" "f" } } */
+ return f;
+}
+
+__attribute__((noinline, noclone)) long
+bar (long x)
+{
+ long f = __builtin_clzl (x);
+ long g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 22 "g" "f" } } */
+ return f;
+}
+
+int
+main ()
+{
+ long x = vv;
+ foo (x + 0x123456UL);
+ bar (x + 0x7fffffffUL);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/csttest.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/csttest.c
new file mode 100644
index 000000000..4480c715e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/csttest.c
@@ -0,0 +1,63 @@
+/* PR debug/49676 */
+/* { dg-do run { target lp64 } } */
+/* { dg-options "-g" } */
+
+volatile int v;
+
+__attribute__((noinline, noclone))
+unsigned long long
+foo (unsigned long long x)
+{
+ unsigned long long a = x * (0x17ULL << 31); /* { dg-final { gdb-test 29 "a" "(0x17ULL << 31)" } } */
+ unsigned long long b = x * (0x7ULL << 33); /* { dg-final { gdb-test 29 "b" "(0x7ULL << 33)" } } */
+ unsigned long long c = x * (0x1ULL << 35); /* { dg-final { gdb-test 29 "c" "(0x1ULL << 35)" } } */
+ unsigned long long d = x * (0x17ULL << 15); /* { dg-final { gdb-test 29 "d" "(0x17ULL << 15)" } } */
+ unsigned long long e = x * (0x17ULL << 50); /* { dg-final { gdb-test 29 "e" "(0x17ULL << 50)" } } */
+ unsigned long long f = x * (0x37ULL << 31); /* { dg-final { gdb-test 29 "f" "(0x37ULL << 31)" } } */
+ unsigned long long g = x * (0x37ULL << 50); /* { dg-final { gdb-test 29 "g" "(0x37ULL << 50)" } } */
+ unsigned long long h = x * (0x1efULL << 33); /* { dg-final { gdb-test 29 "h" "(0x1efULL << 33)" } } */
+ unsigned long long i = x * (0x1efULL << 50); /* { dg-final { gdb-test 29 "i" "(0x1efULL << 50)" } } */
+ unsigned long long j = x * -(0x17ULL << 31); /* { dg-final { gdb-test 29 "j" "-(0x17ULL << 31)" } } */
+ unsigned long long k = x * -(0x7ULL << 33); /* { dg-final { gdb-test 29 "k" "-(0x7ULL << 33)" } } */
+ unsigned long long l = x * -(0x1ULL << 35); /* { dg-final { gdb-test 29 "l" "-(0x1ULL << 35)" } } */
+ unsigned long long m = x * -(0x17ULL << 15); /* { dg-final { gdb-test 29 "m" "-(0x17ULL << 15)" } } */
+ unsigned long long n = x * -(0x17ULL << 50); /* { dg-final { gdb-test 29 "n" "-(0x17ULL << 50)" } } */
+ unsigned long long o = x * -(0x37ULL << 31); /* { dg-final { gdb-test 29 "o" "-(0x37ULL << 31)" } } */
+ unsigned long long p = x * -(0x37ULL << 50); /* { dg-final { gdb-test 29 "p" "-(0x37ULL << 50)" } } */
+ unsigned long long q = x * -(0x1efULL << 33); /* { dg-final { gdb-test 29 "q" "-(0x1efULL << 33)" } } */
+ unsigned long long r = x * -(0x1efULL << 50); /* { dg-final { gdb-test 29 "r" "-(0x1efULL << 50)" } } */
+ v++;
+ return x;
+}
+
+__attribute__((noinline, noclone))
+unsigned long long
+bar (unsigned long long x)
+{
+ unsigned long long a = (x & 255) + (0x17ULL << 31); /* { dg-final { gdb-test 55 "a" "(0x17ULL << 31)" } } */
+ unsigned long long b = (x & 255) + (0x7ULL << 33); /* { dg-final { gdb-test 55 "b" "(0x7ULL << 33)" } } */
+ unsigned long long c = (x & 255) + (0x1ULL << 35); /* { dg-final { gdb-test 55 "c" "(0x1ULL << 35)" } } */
+ unsigned long long d = (x & 255) + (0x17ULL << 15); /* { dg-final { gdb-test 55 "d" "(0x17ULL << 15)" } } */
+ unsigned long long e = (x & 255) + (0x17ULL << 50); /* { dg-final { gdb-test 55 "e" "(0x17ULL << 50)" } } */
+ unsigned long long f = (x & 255) + (0x37ULL << 31); /* { dg-final { gdb-test 55 "f" "(0x37ULL << 31)" } } */
+ unsigned long long g = (x & 255) + (0x37ULL << 50); /* { dg-final { gdb-test 55 "g" "(0x37ULL << 50)" } } */
+ unsigned long long h = (x & 255) + (0x1efULL << 33); /* { dg-final { gdb-test 55 "h" "(0x1efULL << 33)" } } */
+ unsigned long long i = (x & 255) + (0x1efULL << 50); /* { dg-final { gdb-test 55 "i" "(0x1efULL << 50)" } } */
+ unsigned long long j = (x & 255) + -(0x17ULL << 31); /* { dg-final { gdb-test 55 "j" "-(0x17ULL << 31)" } } */
+ unsigned long long k = (x & 255) + -(0x7ULL << 33); /* { dg-final { gdb-test 55 "k" "-(0x7ULL << 33)" } } */
+ unsigned long long l = (x & 255) + -(0x1ULL << 35); /* { dg-final { gdb-test 55 "l" "-(0x1ULL << 35)" } } */
+ unsigned long long m = (x & 255) + -(0x17ULL << 15); /* { dg-final { gdb-test 55 "m" "-(0x17ULL << 15)" } } */
+ unsigned long long n = (x & 255) + -(0x17ULL << 50); /* { dg-final { gdb-test 55 "n" "-(0x17ULL << 50)" } } */
+ unsigned long long o = (x & 255) + -(0x37ULL << 31); /* { dg-final { gdb-test 55 "o" "-(0x37ULL << 31)" } } */
+ unsigned long long p = (x & 255) + -(0x37ULL << 50); /* { dg-final { gdb-test 55 "p" "-(0x37ULL << 50)" } } */
+ unsigned long long q = (x & 255) + -(0x1efULL << 33); /* { dg-final { gdb-test 55 "q" "-(0x1efULL << 33)" } } */
+ unsigned long long r = (x & 255) + -(0x1efULL << 50); /* { dg-final { gdb-test 55 "r" "-(0x1efULL << 50)" } } */
+ v++;
+ return x;
+}
+
+int
+main ()
+{
+ return foo (1) + bar (256) - 257;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/ctztest.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/ctztest.c
new file mode 100644
index 000000000..d243845ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/ctztest.c
@@ -0,0 +1,33 @@
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+volatile int vv;
+
+__attribute__((noinline, noclone)) long
+foo (long x)
+{
+ long f = __builtin_ctzl (x);
+ long g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 12 "g" "f" } } */
+ return f;
+}
+
+__attribute__((noinline, noclone)) long
+bar (long x)
+{
+ long f = __builtin_ctzl (x);
+ long g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 22 "g" "f" } } */
+ return f;
+}
+
+int
+main ()
+{
+ long x = vv;
+ foo (x + 0x1234560UL);
+ bar (x + 0x7fff8000UL);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/drap.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/drap.c
new file mode 100644
index 000000000..573bb39d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/drap.c
@@ -0,0 +1,30 @@
+/* { dg-do run { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-g -mforce-drap" } */
+
+volatile int v;
+
+__attribute__((noinline, noclone)) int
+bar (int a, int b)
+{
+#ifdef __x86_64__
+ asm volatile ("movq %%rsp, %%r10" : : : "r10");
+#else
+ asm volatile ("movl %%esp, %%ecx" : : : "ecx");
+#endif
+ return 0;
+}
+
+__attribute__((noinline, noclone)) int
+foo (int v0, int v1, int v2, int v3, int v4, int v5, int a, int b)
+{
+ __attribute__((aligned (32))) int c = bar (a, b);
+ v++; /* { dg-final { gdb-test 21 "a" "5" } } */
+ return a + b + c; /* { dg-final { gdb-test 22 "b" "6" } } */
+}
+
+int
+main (void)
+{
+ foo (0, 0, 0, 0, 0, 0, 5, 6);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/example.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/example.c
new file mode 100644
index 000000000..26d25c285
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/example.c
@@ -0,0 +1,138 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g" } */
+
+#define GUALITY_DONT_FORCE_LIVE_AFTER -1
+
+#ifndef STATIC_INLINE
+#define STATIC_INLINE /*static*/
+#endif
+
+#include "guality.h"
+
+#include <assert.h>
+
+/* Test the debug info for the functions used in the VTA
+ presentation at the GCC Summit 2008. */
+
+typedef struct list {
+ struct list *n;
+ int v;
+} elt, *node;
+
+STATIC_INLINE node
+find_val (node c, int v, node e)
+{
+ while (c < e)
+ {
+ GUALCHK (c);
+ GUALCHK (v);
+ GUALCHK (e);
+ if (c->v == v)
+ return c;
+ GUALCHK (c);
+ GUALCHK (v);
+ GUALCHK (e);
+ c++;
+ }
+ return NULL;
+}
+
+STATIC_INLINE node
+find_prev (node c, node w)
+{
+ while (c)
+ {
+ node o = c;
+ c = c->n;
+ GUALCHK (c);
+ GUALCHK (o);
+ GUALCHK (w);
+ if (c == w)
+ return o;
+ GUALCHK (c);
+ GUALCHK (o);
+ GUALCHK (w);
+ }
+ return NULL;
+}
+
+STATIC_INLINE node
+check_arr (node c, node e)
+{
+ if (c == e)
+ return NULL;
+ e--;
+ while (c < e)
+ {
+ GUALCHK (c);
+ GUALCHK (e);
+ if (c->v > (c+1)->v)
+ return c;
+ GUALCHK (c);
+ GUALCHK (e);
+ c++;
+ }
+ return NULL;
+}
+
+STATIC_INLINE node
+check_list (node c, node t)
+{
+ while (c != t)
+ {
+ node n = c->n;
+ GUALCHK (c);
+ GUALCHK (n);
+ GUALCHK (t);
+ if (c->v > n->v)
+ return c;
+ GUALCHK (c);
+ GUALCHK (n);
+ GUALCHK (t);
+ c = n;
+ }
+ return NULL;
+}
+
+struct list testme[] = {
+ { &testme[1], 2 },
+ { &testme[2], 3 },
+ { &testme[3], 5 },
+ { &testme[4], 7 },
+ { &testme[5], 11 },
+ { NULL, 13 },
+};
+
+int
+main (int argc, char *argv[])
+{
+ int n = sizeof (testme) / sizeof (*testme);
+ node first, last, begin, end, ret;
+
+ GUALCHKXPR (n);
+
+ begin = first = &testme[0];
+ last = &testme[n-1];
+ end = &testme[n];
+
+ GUALCHKXPR (first);
+ GUALCHKXPR (last);
+ GUALCHKXPR (begin);
+ GUALCHKXPR (end);
+
+ ret = find_val (begin, 13, end);
+ GUALCHK (ret);
+ assert (ret == last);
+
+ ret = find_prev (first, last);
+ GUALCHK (ret);
+ assert (ret == &testme[n-2]);
+
+ ret = check_arr (begin, end);
+ GUALCHK (ret);
+ assert (!ret);
+
+ ret = check_list (first, last);
+ GUALCHK (ret);
+ assert (!ret);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.c
new file mode 100644
index 000000000..d5d950fcd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.c
@@ -0,0 +1,28 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+/* Some silly sanity checking. */
+
+int
+main (int argc, char *argv[])
+{
+ int i = argc+1;
+ int j = argc-2;
+ int k = 5;
+
+ GUALCHKXPR (argc);
+ GUALCHKXPR (i);
+ GUALCHKXPR (j);
+ GUALCHKXPR (k);
+ GUALCHKXPR (&i);
+ GUALCHKFLA (argc);
+ GUALCHKFLA (i);
+ GUALCHKFLA (j);
+ GUALCHKXPR (i);
+ GUALCHKXPR (j);
+ GUALCHKXPRVAL ("k", 5, 1);
+ GUALCHKXPRVAL ("0x40", 64, 0);
+ /* GUALCHKXPRVAL ("0", 0, 0); *//* XFAIL */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp
new file mode 100644
index 000000000..5e714dd7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp
@@ -0,0 +1,58 @@
+# This harness is for tests that should be run at all optimisation levels.
+
+load_lib gcc-dg.exp
+load_lib gcc-gdb-test.exp
+
+# Disable on darwin until radr://7264615 is resolved.
+if { [istarget *-*-darwin*] } {
+ return
+}
+
+if { [istarget "powerpc-ibm-aix*"] } {
+ set torture_execute_xfail "powerpc-ibm-aix*"
+ return
+}
+
+proc check_guality {args} {
+ set result [eval check_compile guality_check executable $args "-g -O0"]
+ set lines [lindex $result 0]
+ set output [lindex $result 1]
+ set ret 0
+ if {[string match "" $lines]} {
+ set execout [gcc_load "./$output"]
+ set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout]
+ }
+ remote_file build delete $output
+ return $ret
+}
+
+dg-init
+
+global GDB
+if ![info exists ::env(GUALITY_GDB_NAME)] {
+ if [info exists GDB] {
+ set guality_gdb_name "$GDB"
+ } else {
+ set guality_gdb_name "[transform gdb]"
+ }
+ setenv GUALITY_GDB_NAME "$guality_gdb_name"
+}
+
+if {[check_guality "
+ #include \"$srcdir/$subdir/guality.h\"
+ volatile long int varl = 6;
+ int main (int argc, char *argv\[\])
+ {
+ GUALCHKVAL (varl);
+ return 0;
+ }
+"]} {
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] ""
+ gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/guality/*.c]] "-Wc++-compat"
+}
+
+if [info exists guality_gdb_name] {
+ unsetenv GUALITY_GDB_NAME
+}
+
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.h b/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.h
new file mode 100644
index 000000000..8b657f29f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.h
@@ -0,0 +1,377 @@
+/* Infrastructure to test the quality of debug information.
+ Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Contributed by Alexandre Oliva <aoliva@redhat.com>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <unistd.h>
+
+/* This is a first cut at checking that debug information matches
+ run-time. The idea is to annotate programs with GUALCHK* macros
+ that guide the tests.
+
+ In the current implementation, all of the macros expand to function
+ calls. On the one hand, this interferes with optimizations; on the
+ other hand, it establishes an optimization barrier and a clear
+ inspection point, where previous operations (as in the abstract
+ machine) should have been completed and have their effects visible,
+ and future operations shouldn't have started yet.
+
+ In the current implementation of guality_check(), we fork a child
+ process that runs gdb, attaches to the parent process (the one that
+ called guality_check), moves up one stack frame (to the caller of
+ guality_check) and then examines the given expression.
+
+ If it matches the expected value, we have a PASS. If it differs,
+ we have a FAILure. If it is missing, we'll have a FAIL or an
+ UNRESOLVED depending on whether the variable or expression might be
+ unavailable at that point, as indicated by the third argument.
+
+ We envision a future alternate implementation with two compilation
+ and execution cycles, say one that runs the program and uses the
+ macros to log expressions and expected values, another in which the
+ macros expand to nothing and the logs are used to guide a debug
+ session that tests the values. How to identify the inspection
+ points in the second case is yet to be determined. It is
+ recommended that GUALCHK* macros be by themselves in source lines,
+ so that __FILE__ and __LINE__ will be usable to identify them.
+*/
+
+/* This is the type we use to pass values to guality_check. */
+
+typedef intmax_t gualchk_t;
+
+/* Convert a pointer or integral type to the widest integral type,
+ as expected by guality_check. */
+
+#ifndef __cplusplus
+#define GUALCVT(val) \
+ ((gualchk_t)__builtin_choose_expr \
+ (__builtin_types_compatible_p (__typeof (val), gualchk_t), \
+ (val), \
+ __builtin_choose_expr \
+ (__builtin_classify_type (val) \
+ == __builtin_classify_type (&guality_skip), \
+ (uintptr_t)(val),(intptr_t)(val))))
+#else
+template <typename T>
+inline __attribute__((always_inline)) gualchk_t
+gualcvt (T *val)
+{
+ return (uintptr_t) val;
+}
+
+template <typename T>
+inline __attribute__((always_inline)) gualchk_t
+gualcvt (T val)
+{
+ return (intptr_t) val;
+}
+
+template <>
+inline __attribute__((always_inline)) gualchk_t
+gualcvt<gualchk_t> (gualchk_t val)
+{
+ return val;
+}
+
+#define GUALCVT(val) gualcvt (val)
+#endif
+
+/* Attach a debugger to the current process and verify that the string
+ EXPR, evaluated by the debugger, yields the gualchk_t number VAL.
+ If the debugger cannot compute the expression, say because the
+ variable is unavailable, this will count as an error, unless unkok
+ is nonzero. */
+
+#define GUALCHKXPRVAL(expr, val, unkok) \
+ guality_check ((expr), (val), (unkok))
+
+/* Check that a debugger knows that EXPR evaluates to the run-time
+ value of EXPR. Unknown values are marked as acceptable,
+ considering that EXPR may die right after this call. This will
+ affect the generated code in that EXPR will be evaluated and forced
+ to remain live at least until right before the call to
+ guality_check, although not necessarily after the call. */
+
+#define GUALCHKXPR(expr) \
+ GUALCHKXPRVAL (#expr, GUALCVT (expr), 1)
+
+/* Same as GUALCHKXPR, but issue an error if the variable is optimized
+ away. */
+
+#define GUALCHKVAL(expr) \
+ GUALCHKXPRVAL (#expr, GUALCVT (expr), 0)
+
+/* Check that a debugger knows that EXPR evaluates to the run-time
+ value of EXPR. Unknown values are marked as errors, because the
+ value of EXPR is forced to be available right after the call, for a
+ range of at least one instruction. This will affect the generated
+ code, in that EXPR *will* be evaluated before and preserved until
+ after the call to guality_check. */
+
+#define GUALCHKFLA(expr) do { \
+ __typeof(expr) volatile __preserve_after; \
+ __typeof(expr) __preserve_before = (expr); \
+ GUALCHKXPRVAL (#expr, GUALCVT (__preserve_before), 0); \
+ __preserve_after = __preserve_before; \
+ asm ("" : : "m" (__preserve_after)); \
+ } while (0)
+
+/* GUALCHK is the simplest way to assert that debug information for an
+ expression matches its run-time value. Whether to force the
+ expression live after the call, so as to flag incompleteness
+ errors, can be disabled by defining GUALITY_DONT_FORCE_LIVE_AFTER.
+ Setting it to -1, an error is issued for optimized out variables,
+ even though they are not forced live. */
+
+#if ! GUALITY_DONT_FORCE_LIVE_AFTER
+#define GUALCHK(var) GUALCHKFLA(var)
+#elif GUALITY_DONT_FORCE_LIVE_AFTER < 0
+#define GUALCHK(var) GUALCHKVAL(var)
+#else
+#define GUALCHK(var) GUALCHKXPR(var)
+#endif
+
+/* The name of the GDB program, with arguments to make it quiet. This
+ is GUALITY_GDB_DEFAULT GUALITY_GDB_ARGS by default, but it can be
+ overridden by setting the GUALITY_GDB environment variable, whereas
+ GUALITY_GDB_DEFAULT can be overridden by setting the
+ GUALITY_GDB_NAME environment variable. */
+
+static const char *guality_gdb_command;
+#define GUALITY_GDB_DEFAULT "gdb"
+#if defined(__unix)
+# define GUALITY_GDB_REDIRECT " > /dev/null 2>&1"
+#elif defined (_WIN32) || defined (MSDOS)
+# define GUALITY_GDB_REDIRECT " > nul"
+#else
+# define GUALITY_GDB_REDIRECT ""
+#endif
+#define GUALITY_GDB_ARGS " -nx -nw --quiet" GUALITY_GDB_REDIRECT
+
+/* Kinds of results communicated as exit status from child process
+ that runs gdb to the parent process that's being monitored. */
+
+enum guality_counter { PASS, INCORRECT, INCOMPLETE };
+
+/* Count of passes and errors. */
+
+static int guality_count[INCOMPLETE+1];
+
+/* If --guality-skip is given in the command line, all the monitoring,
+ forking and debugger-attaching action will be disabled. This is
+ useful to run the monitor program within a debugger. */
+
+static int guality_skip;
+
+/* This is a file descriptor to which we'll issue gdb commands to
+ probe and test. */
+FILE *guality_gdb_input;
+
+/* This holds the line number where we're supposed to set a
+ breakpoint. */
+int guality_breakpoint_line;
+
+/* GDB should set this to true once it's connected. */
+int volatile guality_attached;
+
+/* This function is the main guality program. It may actually be
+ defined as main, because we #define main to it afterwards. Because
+ of this wrapping, guality_main may not have an empty argument
+ list. */
+
+extern int guality_main (int argc, char *argv[]);
+
+static void __attribute__((noinline))
+guality_check (const char *name, gualchk_t value, int unknown_ok);
+
+/* Set things up, run guality_main, then print a summary and quit. */
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+ char *argv0 = argv[0];
+
+ guality_gdb_command = getenv ("GUALITY_GDB");
+ if (!guality_gdb_command)
+ {
+ guality_gdb_command = getenv ("GUALITY_GDB_NAME");
+ if (!guality_gdb_command)
+ guality_gdb_command = GUALITY_GDB_DEFAULT GUALITY_GDB_ARGS;
+ else
+ {
+ int len = strlen (guality_gdb_command) + sizeof (GUALITY_GDB_ARGS);
+ char *buf = (char *) __builtin_alloca (len);
+ strcpy (buf, guality_gdb_command);
+ strcat (buf, GUALITY_GDB_ARGS);
+ guality_gdb_command = buf;
+ }
+ }
+
+ for (i = 1; i < argc; i++)
+ if (strcmp (argv[i], "--guality-skip") == 0)
+ guality_skip = 1;
+ else
+ break;
+
+ if (!guality_skip)
+ {
+ guality_gdb_input = popen (guality_gdb_command, "w");
+ /* This call sets guality_breakpoint_line. */
+ guality_check (NULL, 0, 0);
+ if (!guality_gdb_input
+ || fprintf (guality_gdb_input, "\
+set height 0\n\
+attach %i\n\
+set guality_attached = 1\n\
+b %i\n\
+continue\n\
+", (int)getpid (), guality_breakpoint_line) <= 0
+ || fflush (guality_gdb_input))
+ {
+ perror ("gdb");
+ abort ();
+ }
+ }
+
+ argv[--i] = argv0;
+
+ guality_main (argc - i, argv + i);
+
+ i = guality_count[INCORRECT];
+
+ fprintf (stderr, "%s: %i PASS, %i FAIL, %i UNRESOLVED\n",
+ i ? "FAIL" : "PASS",
+ guality_count[PASS], guality_count[INCORRECT],
+ guality_count[INCOMPLETE]);
+
+ return i;
+}
+
+#define main guality_main
+
+/* Tell the GDB child process to evaluate NAME in the caller. If it
+ matches VALUE, we have a PASS; if it's unknown and UNKNOWN_OK, we
+ have an UNRESOLVED. Otherwise, it's a FAIL. */
+
+static void __attribute__((noinline))
+guality_check (const char *name, gualchk_t value, int unknown_ok)
+{
+ int result;
+
+ if (guality_skip)
+ return;
+
+ {
+ volatile gualchk_t xvalue = -1;
+ volatile int unavailable = 0;
+ if (name)
+ {
+ /* The sequence below cannot distinguish an optimized away
+ variable from one mapped to a non-lvalue zero. */
+ if (fprintf (guality_gdb_input, "\
+up\n\
+set $value1 = 0\n\
+set $value1 = (%s)\n\
+set $value2 = -1\n\
+set $value2 = (%s)\n\
+set $value3 = $value1 - 1\n\
+set $value4 = $value1 + 1\n\
+set $value3 = (%s)++\n\
+set $value4 = --(%s)\n\
+down\n\
+set xvalue = $value1\n\
+set unavailable = $value1 != $value2 ? -1 : $value3 != $value4 ? 1 : 0\n\
+continue\n\
+", name, name, name, name) <= 0
+ || fflush (guality_gdb_input))
+ {
+ perror ("gdb");
+ abort ();
+ }
+ else if (!guality_attached)
+ {
+ unsigned int timeout = 0;
+
+ /* Give GDB some more time to attach. Wrapping around a
+ 32-bit counter takes some seconds, it should be plenty
+ of time for GDB to get a chance to start up and attach,
+ but not long enough that, if GDB is unavailable or
+ broken, we'll take far too long to give up. */
+ while (--timeout && !guality_attached)
+ ;
+ if (!timeout && !guality_attached)
+ {
+ fprintf (stderr, "gdb: took too long to attach\n");
+ abort ();
+ }
+ }
+ }
+ else
+ {
+ guality_breakpoint_line = __LINE__ + 5;
+ return;
+ }
+ /* Do NOT add lines between the __LINE__ above and the line below,
+ without also adjusting the added constant to match. */
+ if (!unavailable || (unavailable > 0 && xvalue))
+ {
+ if (xvalue == value)
+ result = PASS;
+ else
+ result = INCORRECT;
+ }
+ else
+ result = INCOMPLETE;
+ asm ("" : : "X" (name), "X" (value), "X" (unknown_ok), "m" (xvalue));
+ switch (result)
+ {
+ case PASS:
+ fprintf (stderr, "PASS: %s is %lli\n", name, value);
+ break;
+ case INCORRECT:
+ fprintf (stderr, "FAIL: %s is %lli, not %lli\n", name, xvalue, value);
+ break;
+ case INCOMPLETE:
+ fprintf (stderr, "%s: %s is %s, expected %lli\n",
+ unknown_ok ? "UNRESOLVED" : "FAIL", name,
+ unavailable < 0 ? "not computable" : "optimized away", value);
+ result = unknown_ok ? INCOMPLETE : INCORRECT;
+ break;
+ default:
+ abort ();
+ }
+ }
+
+ switch (result)
+ {
+ case PASS:
+ case INCORRECT:
+ case INCOMPLETE:
+ ++guality_count[result];
+ break;
+
+ default:
+ abort ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/inline-params.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/inline-params.c
new file mode 100644
index 000000000..f4c5f1509
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/inline-params.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* IPA-SRA removes the arguments as dead, so we don't see their values, early
+ inlining inlines the functions too early to test the real IPA passes (such
+ as IPA-CP). */
+/* { dg-options "-g -fno-early-inlining -fno-ipa-sra" } */
+/* { dg-xfail-run-if "" { "*-*-*" } { "-O2" "-O3" "-Os" } } */
+
+#define GUALITY_DONT_FORCE_LIVE_AFTER -1
+
+#ifndef STATIC_INLINE
+#define STATIC_INLINE /*static*/
+#endif
+
+
+#include "guality.h"
+
+struct a{
+ struct b {int a;} b;
+ struct c{ int a;} c;
+};
+
+__attribute__ ((always_inline)) static inline void
+t1 (struct b *ab, int b)
+{
+ GUALCHKXPRVAL ("b", 0xbbb, 0);
+ GUALCHKVAL (ab);
+}
+__attribute__ ((always_inline)) static inline void
+t2 (struct c *ac, char *msg)
+{
+ GUALCHKVAL (ac);
+ GUALCHKVAL (msg);
+}
+__attribute__ ((always_inline)) static inline void
+t3 (struct a *a)
+{
+ t1(&a->b, 0xbbb);
+ t2(&a->c, "test");
+}
+struct a a={{0},{1}};
+int
+main (int argc, char *argv[])
+{
+ t3(&a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/nrv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/nrv-1.c
new file mode 100644
index 000000000..6e70050ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/nrv-1.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-g -fno-tree-sra" } */
+
+void abort (void);
+
+struct A
+{
+ int i[100];
+};
+
+struct A a1, a3;
+
+__attribute__((noinline)) struct A
+f ()
+{
+ struct A a2;
+ a2.i[0] = 42;
+ if (a3.i[0] != 0)
+ abort ();
+ a2.i[4] = 7; /* { dg-final { gdb-test 20 "a2.i\[0\]" "42" } } */
+ return a2;
+}
+
+int
+main ()
+{
+ a1 = f ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-1.c
new file mode 100644
index 000000000..480ad3c13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-1.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
+
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+__attribute__((noinline, noclone)) int
+sub (int a, int b)
+{
+ return a - b;
+}
+
+typedef struct { uintptr_t pa; uintptr_t pb; } fatp_t
+ __attribute__ ((aligned (2 * __alignof__ (uintptr_t))));
+
+__attribute__((noinline, noclone)) void
+foo (fatp_t str, int a, int b)
+{
+ int i = sub (a, b);
+ if (i == 0) /* BREAK */
+ i = sub (b, a);
+}
+
+int
+main (void)
+{
+ fatp_t ptr = { 31415927, 27182818 };
+ foo (ptr, 1, 2);
+ return 0;
+}
+
+/* { dg-final { gdb-test 20 "str.pa" "31415927" } } */
+/* { dg-final { gdb-test 20 "str.pb" "27182818" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-2.c
new file mode 100644
index 000000000..64678bd56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-2.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-g -fno-var-tracking-assignments" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O1" } } */
+
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+__attribute__((noinline, noclone)) int
+sub (int a, int b)
+{
+ return a - b;
+}
+
+typedef struct { uintptr_t pa; uintptr_t pb; } fatp_t
+ __attribute__ ((aligned (2 * __alignof__ (uintptr_t))));
+
+__attribute__((noinline, noclone)) void
+foo (fatp_t str, int a, int b)
+{
+ int i = sub (a, b);
+ if (i == 0) /* BREAK */
+ foo (str, a - 1, b);
+}
+
+int
+main (void)
+{
+ fatp_t ptr = { 31415927, 27182818 };
+ foo (ptr, 1, 2);
+ return 0;
+}
+
+/* { dg-final { gdb-test 20 "str.pa" "31415927" } } */
+/* { dg-final { gdb-test 20 "str.pb" "27182818" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-3.c
new file mode 100644
index 000000000..a3b5adb5a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-3.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O1" } } */
+
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+__attribute__((noinline, noclone)) int
+sub (int a, int b)
+{
+ return a - b;
+}
+
+typedef struct { uintptr_t pa; uintptr_t pb; } fatp_t
+ __attribute__ ((aligned (2 * __alignof__ (uintptr_t))));
+
+__attribute__((noinline, noclone)) void
+foo (fatp_t str, int a, int b)
+{
+ int i = sub (a, b);
+ if (i == 0) /* BREAK */
+ foo (str, a - 1, b);
+}
+
+int
+main (void)
+{
+ fatp_t ptr = { 31415927, 27182818 };
+ foo (ptr, 1, 2);
+ return 0;
+}
+
+/* { dg-final { gdb-test 20 "str.pa" "31415927" } } */
+/* { dg-final { gdb-test 20 "str.pb" "27182818" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-4.c
new file mode 100644
index 000000000..a76b251f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/param-4.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
+
+void
+foo (int i)
+{
+ int j = 0;
+ i = 1;
+ j = j + 1; /* BREAK */
+}
+
+int
+main (void)
+{
+ foo (0);
+ return 0;
+}
+
+/* { dg-final { gdb-test 10 "i" "1" } } */ \ No newline at end of file
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-1.c
new file mode 100644
index 000000000..ba7a6c279
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-1.c
@@ -0,0 +1,53 @@
+/* PR debug/36728 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+int a, b;
+
+int __attribute__((noinline))
+foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
+{
+ char *x = __builtin_alloca (arg7);
+ int __attribute__ ((aligned(32))) y;
+
+ y = 2;
+ asm (NOP : "=m" (y), "=m" (b) : "m" (y));
+ x[0] = 25;
+ asm (NOP : "=m" (x[0]), "=m" (a) : "m" (x[0]), "m" (b));
+ return y;
+}
+
+/* On s390(x) r2 and r3 are (depending on the optimization level) used
+ when adjusting the addresses in order to meet the alignment
+ requirements above. They usually hold the function arguments arg1
+ and arg2. So it is expected that these values are unavailable in
+ some of these tests. */
+
+/* { dg-final { gdb-test 16 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg3" "3" } } */
+/* { dg-final { gdb-test 16 "arg4" "4" } } */
+/* { dg-final { gdb-test 16 "arg5" "5" } } */
+/* { dg-final { gdb-test 16 "arg6" "6" } } */
+/* { dg-final { gdb-test 16 "arg7" "30" } } */
+/* { dg-final { gdb-test 16 "y" "2" } } */
+/* { dg-final { gdb-test 18 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 18 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 18 "arg3" "3" } } */
+/* { dg-final { gdb-test 18 "arg4" "4" } } */
+/* { dg-final { gdb-test 18 "arg5" "5" } } */
+/* { dg-final { gdb-test 18 "arg6" "6" } } */
+/* { dg-final { gdb-test 18 "arg7" "30" } } */
+/* { dg-final { gdb-test 18 "*x" "(char) 25" } } */
+/* { dg-final { gdb-test 18 "y" "2" } } */
+
+int
+main ()
+{
+ int l = 0;
+ asm ("" : "=r" (l) : "0" (l));
+ a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-2.c
new file mode 100644
index 000000000..6daa021c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-2.c
@@ -0,0 +1,53 @@
+/* PR debug/36728 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+int a, b;
+
+int __attribute__((noinline))
+foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
+{
+ char x[30];
+ int __attribute__ ((aligned(32))) y;
+
+ y = 2;
+ asm (NOP : "=m" (y), "=m" (b) : "m" (y));
+ x[0] = 25;
+ asm (NOP : "=m" (x[0]), "=m" (a) : "m" (x[0]), "m" (b));
+ return y;
+}
+
+/* On s390(x) r2 and r3 are (depending on the optimization level) used
+ when adjusting the addresses in order to meet the alignment
+ requirements above. They usually hold the function arguments arg1
+ and arg2. So it is expected that these values are unavailable in
+ some of these tests. */
+
+/* { dg-final { gdb-test 16 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg3" "3" } } */
+/* { dg-final { gdb-test 16 "arg4" "4" } } */
+/* { dg-final { gdb-test 16 "arg5" "5" } } */
+/* { dg-final { gdb-test 16 "arg6" "6" } } */
+/* { dg-final { gdb-test 16 "arg7" "30" } } */
+/* { dg-final { gdb-test 16 "y" "2" } } */
+/* { dg-final { gdb-test 18 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 18 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 18 "arg3" "3" } } */
+/* { dg-final { gdb-test 18 "arg4" "4" } } */
+/* { dg-final { gdb-test 18 "arg5" "5" } } */
+/* { dg-final { gdb-test 18 "arg6" "6" } } */
+/* { dg-final { gdb-test 18 "arg7" "30" } } */
+/* { dg-final { gdb-test 18 "*x" "(char) 25" } } */
+/* { dg-final { gdb-test 18 "y" "2" } } */
+
+int
+main ()
+{
+ int l = 0;
+ asm ("" : "=r" (l) : "0" (l));
+ a = foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c
new file mode 100644
index 000000000..bb2c0675d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-3.c
@@ -0,0 +1,51 @@
+/* PR debug/36728 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+int __attribute__((noinline))
+foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
+{
+ char *x = __builtin_alloca (arg7);
+ int __attribute__ ((aligned(32))) y;
+
+ y = 2;
+ asm (NOP : "=m" (y) : "m" (y));
+ x[0] = 25;
+ asm volatile (NOP : "=m" (x[0]) : "m" (x[0]));
+ return y;
+}
+
+/* On s390(x) r2 and r3 are (depending on the optimization level) used
+ when adjusting the addresses in order to meet the alignment
+ requirements above. They usually hold the function arguments arg1
+ and arg2. So it is expected that these values are unavailable in
+ some of these tests. */
+
+/* { dg-final { gdb-test 14 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 14 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 14 "arg3" "3" } } */
+/* { dg-final { gdb-test 14 "arg4" "4" } } */
+/* { dg-final { gdb-test 14 "arg5" "5" } } */
+/* { dg-final { gdb-test 14 "arg6" "6" } } */
+/* { dg-final { gdb-test 14 "arg7" "30" } } */
+/* { dg-final { gdb-test 14 "y" "2" } } */
+/* { dg-final { gdb-test 16 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg3" "3" } } */
+/* { dg-final { gdb-test 16 "arg4" "4" } } */
+/* { dg-final { gdb-test 16 "arg5" "5" } } */
+/* { dg-final { gdb-test 16 "arg6" "6" } } */
+/* { dg-final { gdb-test 16 "arg7" "30" } } */
+/* { dg-final { gdb-test 16 "*x" "(char) 25" } } */
+/* { dg-final { gdb-test 16 "y" "2" } } */
+
+int
+main ()
+{
+ int l = 0;
+ asm volatile ("" : "=r" (l) : "0" (l));
+ foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-4.c
new file mode 100644
index 000000000..fee79c49c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36728-4.c
@@ -0,0 +1,51 @@
+/* PR debug/36728 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+int __attribute__((noinline))
+foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
+{
+ char x[30];
+ int __attribute__ ((aligned(32))) y;
+
+ y = 2;
+ asm (NOP : "=m" (y) : "m" (y));
+ x[0] = 25;
+ asm volatile (NOP : "=m" (x[0]) : "m" (x[0]));
+ return y;
+}
+
+/* On s390(x) r2 and r3 are (depending on the optimization level) used
+ when adjusting the addresses in order to meet the alignment
+ requirements above. They usually hold the function arguments arg1
+ and arg2. So it is expected that these values are unavailable in
+ some of these tests. */
+
+/* { dg-final { gdb-test 14 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 14 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 14 "arg3" "3" } } */
+/* { dg-final { gdb-test 14 "arg4" "4" } } */
+/* { dg-final { gdb-test 14 "arg5" "5" } } */
+/* { dg-final { gdb-test 14 "arg6" "6" } } */
+/* { dg-final { gdb-test 14 "arg7" "30" } } */
+/* { dg-final { gdb-test 14 "y" "2" } } */
+/* { dg-final { gdb-test 16 "arg1" "1" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg2" "2" { target { ! "s390*-*-*" } } } } */
+/* { dg-final { gdb-test 16 "arg3" "3" } } */
+/* { dg-final { gdb-test 16 "arg4" "4" } } */
+/* { dg-final { gdb-test 16 "arg5" "5" } } */
+/* { dg-final { gdb-test 16 "arg6" "6" } } */
+/* { dg-final { gdb-test 16 "arg7" "30" } } */
+/* { dg-final { gdb-test 16 "*x" "(char) 25" } } */
+/* { dg-final { gdb-test 16 "y" "2" } } */
+
+int
+main ()
+{
+ int l = 0;
+ asm volatile ("" : "=r" (l) : "0" (l));
+ foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36977.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36977.c
new file mode 100644
index 000000000..3689fae8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr36977.c
@@ -0,0 +1,32 @@
+/* PR debug/36977 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
+
+void
+foo ()
+{
+}
+
+int
+main ()
+{
+ struct { char c[100]; } cbig;
+ struct { int i[800]; } ibig;
+ struct { long l[900]; } lbig;
+ struct { float f[200]; } fbig;
+ struct { double d[300]; } dbig;
+ struct { short s[400]; } sbig;
+
+ ibig.i[0] = 55; /* { dg-final { gdb-test 30 "ibig.i\[0\]" "55" } } */
+ ibig.i[100] = 5; /* { dg-final { gdb-test 30 "ibig.i\[100\]" "5" } } */
+ cbig.c[0] = '\0'; /* { dg-final { gdb-test 30 "cbig.c\[0\]" "'\\0'" } } */
+ cbig.c[99] = 'A'; /* { dg-final { gdb-test 30 "cbig.c\[99\]" "'A'" } } */
+ fbig.f[100] = 11.0; /* { dg-final { gdb-test 30 "fbig.f\[100\]" "11" } } */
+ dbig.d[202] = 9.0; /* { dg-final { gdb-test 30 "dbig.d\[202\]" "9" } } */
+ sbig.s[90] = 255; /* { dg-final { gdb-test 30 "sbig.s\[90\]" "255" } } */
+ lbig.l[333] = 999; /* { dg-final { gdb-test 30 "lbig.l\[333\]" "999" } } */
+
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41353-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41353-1.c
new file mode 100644
index 000000000..1d2cca787
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41353-1.c
@@ -0,0 +1,56 @@
+/* PR debug/41353 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+int vari __attribute__((used)) = 17, varj;
+
+__attribute__((noinline)) int
+f1 (void)
+{
+ /* { dg-final { gdb-test 17 "vari" "17" } } */
+ int vari1 = 2 * vari; /* { dg-final { gdb-test 17 "vari1" "2 * 17" } } */
+ int vari2 = 3 * vari; /* { dg-final { gdb-test 17 "vari2" "3 * 17" } } */
+ int vari3 = 2 * vari; /* { dg-final { gdb-test 17 "vari3" "2 * 17" } } */
+ int vari4 = 3 * vari; /* { dg-final { gdb-test 17 "vari4" "3 * 17" } } */
+ int vari5 = 4 * vari; /* { dg-final { gdb-test 17 "vari5" "4 * 17" } } */
+ int vari6 = 5 * vari; /* { dg-final { gdb-test 17 "vari6" "5 * 17" } } */
+ return varj;
+}
+
+__attribute__((noinline)) int
+f2 (int i, int j)
+{
+ j += i;
+ /* { dg-final { gdb-test 28 "i" "37" } } */
+ /* { dg-final { gdb-test 28 "j" "28 + 37" { xfail *-*-* } } } */
+ int i1 = 2 * i; /* { dg-final { gdb-test 28 "i1" "2 * 37" } } */
+ int i2 = 3 * i; /* { dg-final { gdb-test 28 "i2" "3 * 37" } } */
+ return j;
+}
+
+__attribute__((noinline)) int
+f3 (int i)
+{
+ asm volatile ("" : "+r" (i));
+ /* { dg-final { gdb-test 39 "i" "12" } } */
+ int i1 = 2 * i; /* { dg-final { gdb-test 39 "i1" "2 * 12" } } */
+ int i2 = 2 * i; /* { dg-final { gdb-test 39 "i2" "2 * 12" } } */
+ int i3 = 3 * i; /* { dg-final { gdb-test 39 "i3" "3 * 12" } } */
+ return i;
+}
+
+int (*volatile fnp1) (void) = f1;
+int (*volatile fnp2) (int, int) = f2;
+int (*volatile fnp3) (int) = f3;
+
+int
+main (int argc, char *argv[])
+{
+ asm volatile ("" : : "r" (&fnp1) : "memory");
+ asm volatile ("" : : "r" (&fnp2) : "memory");
+ asm volatile ("" : : "r" (&fnp3) : "memory");
+ fnp1 ();
+ fnp2 (37, 28);
+ fnp3 (12);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41353-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41353-2.c
new file mode 100644
index 000000000..0983bf4ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41353-2.c
@@ -0,0 +1,24 @@
+/* PR debug/41353 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+int varh;
+int vari __attribute__((used)) = 17, varj;
+
+__attribute__((noinline)) int
+f1 (void)
+{
+ int vari1 = 2 * vari; /* { dg-final { gdb-test 13 "vari1" "2 * 17" } } */
+ int vari2 = 3 * vari; /* { dg-final { gdb-test 13 "vari2" "3 * 17" } } */
+ return varj;
+}
+
+int (*volatile fnp1) (void) = f1;
+
+int
+main (int argc, char *argv[])
+{
+ asm volatile ("" : : "r" (&fnp1) : "memory");
+ fnp1 ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41404-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41404-1.c
new file mode 100644
index 000000000..59a8293e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41404-1.c
@@ -0,0 +1,41 @@
+/* PR debug/41404 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__ ((noinline))
+int bar1 (int i)
+{
+ const char *foo = "foo";
+ asm volatile ("" : "+r" (i) : : "memory");
+ i++; /* { dg-final { gdb-test 10 "*foo" "'f'" } } */
+ asm volatile ("" : "+r" (i) : : "memory");
+ foo = "bar";
+ asm volatile ("" : "+r" (i) : : "memory");
+ i++; /* { dg-final { gdb-test 14 "*foo" "'b'" } } */
+ asm volatile ("" : "+r" (i) : : "memory");
+ return i;
+}
+
+__attribute__ ((noinline))
+int bar2 (int i)
+{
+ const char *foo = "foo";
+ asm volatile ("" : "+r" (i) : : "memory");
+ i++; /* { dg-final { gdb-test 24 "*foo" "'f'" } } */
+ asm volatile ("" : "+r" (i) : : "memory");
+ return i;
+}
+
+__attribute__ ((noinline))
+const char *baz (int i)
+{
+ return i ? "foo" : "bar";
+}
+
+int
+main (void)
+{
+ bar1 (6);
+ bar2 (6);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41447-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41447-1.c
new file mode 100644
index 000000000..9bb28abe3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41447-1.c
@@ -0,0 +1,26 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+int a;
+
+int
+main (int argc, char *argv[])
+{
+ int tmp = a;
+ int tmp2 = a;
+ int tmp3;
+ int res;
+ GUALCHKVAL (a);
+ GUALCHKVAL (tmp);
+ GUALCHKVAL (tmp2);
+ a = 0;
+ tmp3 = tmp2;
+ GUALCHKVAL (a);
+ GUALCHKVAL (tmp);
+ GUALCHKVAL (tmp2);
+ GUALCHKVAL (tmp3);
+ res = tmp - tmp2 + 1;
+ return res;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41616-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41616-1.c
new file mode 100644
index 000000000..24f64ab08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr41616-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+inline int f(int *a)
+{
+ return *a;
+}
+
+int
+main(int argc, char *argv[])
+{
+ int b = -1;
+ GUALCHKVAL (b);
+ if (argc > 0)
+ b = -f(&b);
+ GUALCHKVAL (b);
+ return b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr42782.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr42782.c
new file mode 100644
index 000000000..6a880814a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr42782.c
@@ -0,0 +1,24 @@
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+void __attribute__ ((__noinline__))
+g (void)
+{
+ asm volatile ("");
+}
+
+int
+f (int a)
+{
+ g ();
+ GUALCHKVAL (a);
+ return a;
+}
+
+int
+main (int argc, char *argv[])
+{
+ f (argc + 2);
+ f (argc + 5);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43051-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43051-1.c
new file mode 100644
index 000000000..77325c97e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43051-1.c
@@ -0,0 +1,57 @@
+/* PR debug/43051 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+extern void abort (void);
+
+static void __attribute__ ((noinline))
+foo (const char *x, long long y, int z)
+{
+ asm volatile ("" : : "r" (x), "r" ((int) y), "r" (z) : "memory");
+}
+
+struct S
+{
+ struct S *n;
+ int v;
+};
+
+struct S a[10];
+
+struct S * __attribute__ ((noinline))
+bar (struct S *c, int v, struct S *e)
+{
+#ifdef __i386__
+ register int si asm ("esi"), di asm ("edi"), bx
+# if !defined (__pic__) && !defined (__APPLE__)
+ asm ("ebx")
+# endif
+ ;
+ asm volatile ("" : "=r" (si), "=r" (di), "=r" (bx));
+#endif
+ while (c < e)
+ {
+ foo ("c", (__UINTPTR_TYPE__) c, 0); /* { dg-final { gdb-test 34 "c" "\&a\[0\]" } } */
+ foo ("v", v, 1); /* { dg-final { gdb-test 35 "v" "1" } } */
+ foo ("e", (__UINTPTR_TYPE__) e, 2); /* { dg-final { gdb-test 36 "e" "\&a\[1\]" } } */
+ if (c->v == v)
+ return c;
+ foo ("c", (__UINTPTR_TYPE__) c, 3); /* { dg-final { gdb-test 39 "c" "\&a\[0\]" } } */
+ foo ("v", v, 4); /* { dg-final { gdb-test 40 "v" "1" } } */
+ foo ("e", (__UINTPTR_TYPE__) e, 5); /* { dg-final { gdb-test 41 "e" "\&a\[1\]" } } */
+ c++;
+ }
+#ifdef __i386__
+ asm volatile ("" : : "r" (si), "r" (di), "r" (bx));
+#endif
+ return 0;
+}
+
+int
+main ()
+{
+ asm volatile ("" : : "r" (&a[0]) : "memory");
+ if (bar (&a[a[0].v], a[0].v + 1, &a[a[0].v + 1]))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43077-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43077-1.c
new file mode 100644
index 000000000..d8d5eebe0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43077-1.c
@@ -0,0 +1,55 @@
+/* PR debug/43077 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+int varb;
+
+int __attribute__((noinline))
+fn1 (void)
+{
+ int vara = (varb == 3); /* { dg-final { gdb-test 11 "vara" "0" } } */
+ asm volatile ("" : : "g" (vara)); /* { dg-final { gdb-test 11 "varb" "2" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+fn2 (void)
+{
+ int vara = (varb == 3); /* { dg-final { gdb-test 19 "vara" "1" } } */
+ asm volatile ("" : : "g" (vara)); /* { dg-final { gdb-test 19 "varb" "3" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+foo (unsigned long *p, unsigned long *q)
+{
+ int ret;
+ asm volatile ("" : "=r" (ret), "=r" (*p), "=r" (*q) : "0" (1), "1" (2), "2" (3));
+ return ret;
+}
+
+int __attribute__((noinline))
+fn3 (void)
+{
+ unsigned long a = 0, b = 0, c = 0;
+ a = foo (&b, &c);
+ /* { dg-final { gdb-test 42 "a" "1" } } */
+ /* { dg-final { gdb-test 42 "b" "2" } } */
+ /* { dg-final { gdb-test 42 "c" "3" } } */
+ unsigned long vara = a; /* { dg-final { gdb-test 42 "vara" "1" } } */
+ unsigned long varb = b; /* { dg-final { gdb-test 42 "varb" "2" } } */
+ unsigned long varc = c; /* { dg-final { gdb-test 42 "varc" "3" } } */
+ asm volatile ("" : : "g" (vara), "g" (varb), "g" (varc));
+ return a;
+}
+
+int
+main (void)
+{
+ asm volatile ("" : "=r" (varb) : "0" (2));
+ fn1 ();
+ asm volatile ("" : "=r" (varb) : "0" (3));
+ fn2 ();
+ fn3 ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43177.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43177.c
new file mode 100644
index 000000000..563835b63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43177.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+void __attribute__((noinline))
+bar (long x)
+{
+ asm volatile ("" : : "r" (x) : "memory");
+}
+
+long __attribute__((noinline))
+foo (long x)
+{
+ long l = x + 3;
+ bar (l);/* { dg-final { gdb-test 15 "l" "10" } } */
+ bar (l);/* { dg-final { gdb-test 15 "x" "7" } } */
+ return l;
+}
+
+long __attribute__((noinline))
+baz (int x)
+{
+ long l = x + 3;
+ bar (l);/* { dg-final { gdb-test 24 "l" "10" } } */
+ bar (l);/* { dg-final { gdb-test 24 "x" "7" } } */
+ return l;
+}
+
+int
+main (void)
+{
+ int i;
+ asm volatile ("" : "=r" (i) : "0" (7));
+ foo (i);
+ baz (i);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43329-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43329-1.c
new file mode 100644
index 000000000..5e27adfca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43329-1.c
@@ -0,0 +1,52 @@
+/* PR debug/43329 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+static inline void
+foo (int argx)
+{
+ int varx = argx;
+ __asm__ volatile (NOP); /* { dg-final { gdb-test 12 "argx" "25" } } */
+ __asm__ volatile (NOP : : "g" (varx)); /* { dg-final { gdb-test 12 "varx" "25" } } */
+}
+
+int i;
+
+__attribute__((noinline))
+void baz (int x)
+{
+ asm volatile ("" : : "r" (x) : "memory");
+}
+
+static inline void
+bar (void)
+{
+ foo (25);
+ i = i + 2;
+ i = i * 2;
+ i = i - 4;
+ baz (i);
+ i = i * 2;
+ i = i >> 1;
+ i = i << 6;
+ baz (i);
+ i = i + 2;
+ i = i * 2;
+ i = i - 4;
+ baz (i);
+ i = i * 2;
+ i = i >> 6;
+ i = i << 1;
+ baz (i);
+}
+
+int
+main (void)
+{
+ __asm__ volatile ("" : "=r" (i) : "0" (0));
+ bar ();
+ bar ();
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43479.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43479.c
new file mode 100644
index 000000000..e0bc246cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43479.c
@@ -0,0 +1,33 @@
+/* PR debug/43479 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline)) void
+foo (int k, int l, int m, int n)
+{
+ l++;
+ {
+ int h = n;
+ {
+ int i = k;
+ k++; /* { dg-final { gdb-test 13 "i" "6" } } */
+ } /* { dg-final { gdb-test 13 "h" "9" } } */
+ /* { dg-final { gdb-test 13 "n" "9" } } */
+ {
+ int j = m;
+ m++; /* { dg-final { gdb-test 18 "j" "8" } } */
+ } /* { dg-final { gdb-test 18 "h" "9" } } */
+ /* { dg-final { gdb-test 12 "n" "9" } } */
+ }
+ asm volatile ("" : : "r" (k), "r" (l));
+ asm volatile ("" : : "r" (m), "r" (n));
+}
+
+int
+main (void)
+{
+ int q = 6;
+ asm ("" : "+r" (q));
+ foo (q, q + 1, q + 2, q + 3);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43593.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43593.c
new file mode 100644
index 000000000..d8cc41359
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr43593.c
@@ -0,0 +1,24 @@
+/* PR debug/43593 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+void __attribute__((noinline))
+bar (int *p)
+{
+ asm volatile ("" : : "r" (p) : "memory");
+}
+
+int __attribute__((noinline))
+foo (void)
+{
+ int i, *j = &i;
+ bar (j);
+ return 6 + i; /* { dg-final { gdb-test 16 "j" "&i" } } */
+}
+
+int
+main (void)
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-1.c
new file mode 100644
index 000000000..7cef8f628
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-1.c
@@ -0,0 +1,31 @@
+/* PR debug/45003 */
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+int __attribute__((noinline))
+foo (unsigned short *p)
+{
+ int a = *p;
+ asm volatile ("nop");
+ asm volatile ("nop" : : "D" (a)); /* { dg-final { gdb-test 10 "a" "0x8078" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+bar (short *p)
+{
+ unsigned int a = *p;
+ asm volatile ("nop");
+ asm volatile ("nop" : : "D" (a)); /* { dg-final { gdb-test 19 "a" "0xffff8078" } } */
+ return 0;
+}
+
+int
+main ()
+{
+ unsigned short us = 0x8078;
+ foo (&us);
+ short s = -32648;
+ bar (&s);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-2.c
new file mode 100644
index 000000000..dcdba237f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-2.c
@@ -0,0 +1,31 @@
+/* PR debug/45003 */
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+int __attribute__((noinline))
+foo (unsigned short *p)
+{
+ int a = *p;
+ asm volatile ("nop" : : "D" ((int) *p));
+ asm volatile ("nop" : : "D" ((int) *p)); /* { dg-final { gdb-test 10 "a" "0x8078" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+bar (short *p)
+{
+ unsigned int a = *p;
+ asm volatile ("nop" : : "D" ((unsigned int) *p));
+ asm volatile ("nop" : : "D" ((unsigned int) *p)); /* { dg-final { gdb-test 19 "a" "0xffff8078" } } */
+ return 0;
+}
+
+int
+main ()
+{
+ unsigned short us = 0x8078;
+ foo (&us);
+ short s = -32648;
+ bar (&s);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-3.c
new file mode 100644
index 000000000..3adc4f238
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45003-3.c
@@ -0,0 +1,31 @@
+/* PR debug/45003 */
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+int __attribute__((noinline))
+foo (unsigned short *p)
+{
+ int a = (short) *p;
+ asm volatile ("nop" : : "D" ((int) *p));
+ asm volatile ("nop" : : "D" ((int) *p)); /* { dg-final { gdb-test 10 "a" "-32648" } } */
+ return 0;
+}
+
+int __attribute__((noinline))
+bar (short *p)
+{
+ unsigned int a = (unsigned short) *p;
+ asm volatile ("nop" : : "D" ((unsigned int) *p));
+ asm volatile ("nop" : : "D" ((unsigned int) *p)); /* { dg-final { gdb-test 19 "a" "0x8078" } } */
+ return 0;
+}
+
+int
+main ()
+{
+ unsigned short us = 0x8078;
+ foo (&us);
+ short s = -32648;
+ bar (&s);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45882.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45882.c
new file mode 100644
index 000000000..5ca22d4f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr45882.c
@@ -0,0 +1,30 @@
+/* PR debug/45882 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+extern void abort (void);
+int a[1024];
+volatile short int v;
+
+__attribute__((noinline,noclone,used)) int
+foo (int i, int j)
+{
+ int b = i; /* { dg-final { gdb-test 16 "b" "7" } } */
+ int c = i + 4; /* { dg-final { gdb-test 16 "c" "11" } } */
+ int d = a[i]; /* { dg-final { gdb-test 16 "d" "112" } } */
+ int e = a[i + 6]; /* { dg-final { gdb-test 16 "e" "142" } } */
+ ++v;
+ return ++j;
+}
+
+int
+main (void)
+{
+ int l;
+ asm ("" : "=r" (l) : "0" (7));
+ a[7] = 112;
+ a[7 + 6] = 142;
+ if (foo (l, 7) != 8)
+ abort ();
+ return l - 7;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr48437.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr48437.c
new file mode 100644
index 000000000..5346baa0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr48437.c
@@ -0,0 +1,17 @@
+/* PR lto/48437 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+int i __attribute__((used));
+int main()
+{
+ volatile int i;
+ for (i = 3; i < 7; ++i)
+ {
+ extern int i;
+ asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test 14 "i" "0" } } */
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr48466.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr48466.c
new file mode 100644
index 000000000..8d5426a99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr48466.c
@@ -0,0 +1,41 @@
+/* PR debug/48466 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
+
+struct S { unsigned int a; unsigned int *b; };
+struct T { struct S a; struct S b; };
+struct U { const char *u; };
+int n[10];
+volatile int v;
+
+struct U
+foo (const char *s)
+{
+ struct U r;
+ r.u = s;
+ return r;
+}
+
+void
+bar (struct T *s, int a, int b)
+{
+ s->a.a = a;
+ s->a.b = &s->a.a;
+ s->b.a = b;
+ s->b.b = &s->b.a;
+}
+
+int
+main ()
+{
+ struct T t;
+ struct U x = foo ("this is x");
+ struct S y, z;
+ y.b = n; /* { dg-final { gdb-test 38 "t.a.a" "17" } } */
+ y.a = 0; /* { dg-final { gdb-test 38 "*t.a.b" "17" } } */
+ bar (&t, 17, 21); /* { dg-final { gdb-test 38 "t.b.a" "21" } } */
+ v++; /* { dg-final { gdb-test 38 "*t.b.b" "21" } } */
+ z = y;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr49888.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr49888.c
new file mode 100644
index 000000000..a0e26cf83
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr49888.c
@@ -0,0 +1,26 @@
+/* PR debug/49888 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+static int v;
+
+static void __attribute__((noinline, noclone))
+f (int *p)
+{
+ int c = *p;
+ v = c;
+ *p = 1; /* { dg-final { gdb-test 12 "!!c" "0" } } */
+ /* c may very well be optimized out at this point, so we test !c,
+ which will evaluate to the expected value. We just want to make
+ sure it doesn't remain bound to *p as it did before, in which
+ case !c would evaluate to 0. *p may also be regarded as aliasing
+ register saves, thus the !!c above. */
+ v = 0; /* { dg-final { gdb-test 18 "!c" "1" } } */
+}
+int
+main ()
+{
+ int a = 0;
+ f (&a);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54200.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54200.c
new file mode 100644
index 000000000..9b1718764
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54200.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/54200 */
+/* { dg-do run } */
+/* { dg-options "-g -fno-var-tracking-assignments" } */
+
+int o __attribute__((used));
+
+void bar (void) { o = 2; }
+
+int __attribute__((noinline,noclone))
+foo (int z, int x, int b)
+{
+ if (x == 1)
+ {
+ bar ();
+ return z;
+ }
+ else
+ {
+ int a = (x + z) + b;
+ return a; /* { dg-final { gdb-test 20 "z" "3" } } */
+ }
+}
+
+int main ()
+{
+ foo (3, 2, 1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-1.c
new file mode 100644
index 000000000..98afd45c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-1.c
@@ -0,0 +1,48 @@
+/* PR debug/54519 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline, noclone)) void
+fn1 (int x)
+{
+ __asm volatile ("" : "+r" (x) : : "memory");
+}
+
+static int
+fn2 (int x, int y, int z)
+{
+ int a = 8;
+ if (x != z)
+ {
+ fn1 (x);
+ fn1 (x); /* { dg-final { gdb-test 20 "x" "36" } } */
+ if (x == 36) /* { dg-final { gdb-test 20 "y" "25" } } */
+ fn1 (x); /* { dg-final { gdb-test 20 "z" "6" } } */
+ fn1 (x); /* { dg-final { gdb-test 23 "x" "98" } } */
+ if (x == 98) /* { dg-final { gdb-test 23 "y" "117" } } */
+ fn1 (x); /* { dg-final { gdb-test 23 "z" "8" } } */
+ fn1 (x);
+ fn1 (x + a);
+ }
+ return y;
+}
+
+__attribute__((noinline, noclone)) int
+fn3 (int x, int y)
+{
+ return fn2 (x, y, 6);
+}
+
+__attribute__((noinline, noclone)) int
+fn4 (int x, int y)
+{
+ return fn2 (x, y, 8);
+}
+
+int
+main ()
+{
+ fn3 (36, 25);
+ fn4 (98, 117);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-2.c
new file mode 100644
index 000000000..4ee3c9e2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-2.c
@@ -0,0 +1,45 @@
+/* PR debug/54519 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline, noclone)) void
+fn1 (int x)
+{
+ __asm volatile ("" : "+r" (x) : : "memory");
+}
+
+static int
+fn2 (int x, int y)
+{
+ if (y)
+ {
+ fn1 (x); /* { dg-final { gdb-test 17 "x" "6" } } */
+ fn1 (x); /* { dg-final { gdb-test 17 "y" "25" } } */
+ fn1 (x);
+ fn1 (x);
+ y = -2 + x;
+ y = y * y * y + y;
+ fn1 (x + y); /* { dg-final { gdb-test 22 "y" "68" } } */
+ }
+ return x;
+}
+
+__attribute__((noinline, noclone)) int
+fn3 (int x, int y)
+{
+ return fn2 (x, y) + y;
+}
+
+__attribute__((noinline, noclone)) int
+fn4 (int x, int y)
+{
+ return fn2 (x, y) + y;
+}
+
+int
+main ()
+{
+ fn3 (6, 25);
+ fn4 (4, 117);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-3.c
new file mode 100644
index 000000000..aa8369e15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-3.c
@@ -0,0 +1,42 @@
+/* PR debug/54519 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline, noclone)) void
+fn1 (int x)
+{
+ __asm volatile ("" : "+r" (x) : : "memory");
+}
+
+static int
+fn2 (int x, int y, int z)
+{
+ int a = 8;
+ if (x != z)
+ {
+ fn1 (x);
+ fn1 (x); /* { dg-final { gdb-test 20 "x" "36" } } */
+ if (x == 36) /* { dg-final { gdb-test 20 "y" "25" } } */
+ fn1 (x); /* { dg-final { gdb-test 20 "z" "6" } } */
+ fn1 (x); /* { dg-final { gdb-test 23 "x" "98" } } */
+ if (x == 98) /* { dg-final { gdb-test 23 "y" "117" } } */
+ fn1 (x); /* { dg-final { gdb-test 23 "z" "8" } } */
+ fn1 (x);
+ fn1 (x + a);
+ }
+ return y;
+}
+
+int (*p) (int, int, int) = fn2;
+
+int
+main ()
+{
+ __asm volatile ("" : : : "memory");
+ int (*q) (int, int, int) = p;
+ __asm volatile ("" : : : "memory");
+ q (36, 25, 6);
+ q (98, 117, 8);
+ q (0, 0, 0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-4.c
new file mode 100644
index 000000000..d2765d148
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-4.c
@@ -0,0 +1,39 @@
+/* PR debug/54519 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline, noclone)) void
+fn1 (int x)
+{
+ __asm volatile ("" : "+r" (x) : : "memory");
+}
+
+static int
+fn2 (int x, int y)
+{
+ if (y)
+ {
+ fn1 (x); /* { dg-final { gdb-test 17 "x" "6" } } */
+ fn1 (x); /* { dg-final { gdb-test 17 "y" "25" } } */
+ fn1 (x);
+ fn1 (x);
+ y = -2 + x;
+ y = y * y * y + y;
+ fn1 (x + y); /* { dg-final { gdb-test 22 "y" "68" } } */
+ }
+ return x;
+}
+
+int (*p) (int, int) = fn2;
+
+int
+main ()
+{
+ __asm volatile ("" : : : "memory");
+ int (*q) (int, int) = p;
+ __asm volatile ("" : : : "memory");
+ q (6, 25);
+ q (4, 117);
+ q (0, 0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-5.c
new file mode 100644
index 000000000..c64527a45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-5.c
@@ -0,0 +1,45 @@
+/* PR debug/54519 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline, noclone)) void
+fn1 (int x)
+{
+ __asm volatile ("" : "+r" (x) : : "memory");
+}
+
+static int
+fn2 (int x, int y)
+{
+ if (y)
+ {
+ fn1 (x); /* { dg-final { gdb-test 17 "x" "6" } } */
+ fn1 (x); /* { dg-final { gdb-test 17 "y" "25" } } */
+ fn1 (x);
+ fn1 (x);
+ y = -2 + x;
+ y = y * y * y + y;
+ fn1 (x + y); /* { dg-final { gdb-test 22 "y" "68" } } */
+ }
+ return x;
+}
+
+__attribute__((noinline, noclone)) int
+fn3 (int x, int y)
+{
+ return fn2 (x, y);
+}
+
+__attribute__((noinline, noclone)) int
+fn4 (int x, int y)
+{
+ return fn2 (x, y);
+}
+
+int
+main ()
+{
+ fn3 (6, 25);
+ fn4 (4, 117);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-6.c
new file mode 100644
index 000000000..836ab1f66
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-6.c
@@ -0,0 +1,27 @@
+/* PR debug/54519 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+static inline void
+f1 (int x, int y)
+{
+ asm volatile (NOP); /* { dg-final { gdb-test 11 "x" "2" } } */
+ asm volatile (NOP); /* { dg-final { gdb-test 11 "y" "0" } } */
+}
+
+static inline void
+f2 (int z)
+{
+ f1 (z, 0);
+ f1 (z, 1);
+}
+
+int
+main ()
+{
+ f2 (2);
+ f2 (3);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54551.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54551.c
new file mode 100644
index 000000000..4235f78ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54551.c
@@ -0,0 +1,28 @@
+/* PR debug/54551 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+void __attribute__((__noinline__))
+bar (void)
+{
+ asm volatile ("");
+}
+
+int __attribute__((__noinline__))
+foo (int x, int y, int z)
+{
+ if (x != z)
+ {
+ int a = z + 1;
+ bar (); /* { dg-final { gdb-test 18 "a" "4" } } */
+ bar (); /* { dg-final { gdb-test 18 "z" "3" } } */
+ }
+ return y;
+}
+
+int
+main ()
+{
+ foo (1, 2, 3);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54693-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54693-2.c
new file mode 100644
index 000000000..2810a75d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54693-2.c
@@ -0,0 +1,33 @@
+/* PR debug/54693 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+int v;
+
+__attribute__((noinline, noclone)) void
+bar (int i)
+{
+ v = i;
+ asm volatile ("" : : "r" (i) : "memory");
+}
+
+__attribute__((noinline, noclone)) void
+foo (int x, int y, int z)
+{
+ int i = 0;
+ while (x > 3 && y > 3 && z > 3)
+ { /* { dg-final { gdb-test 21 "i" "v + 1" } } */
+ /* { dg-final { gdb-test 21 "x" "10 - i" } } */
+ bar (i); /* { dg-final { gdb-test 21 "y" "20 - 2 * i" } } */
+ /* { dg-final { gdb-test 21 "z" "30 - 3 * i" } } */
+ i++, x--, y -= 2, z -= 3;
+ }
+}
+
+int
+main ()
+{
+ v = -1;
+ foo (10, 20, 30);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54693.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54693.c
new file mode 100644
index 000000000..b852c06ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54693.c
@@ -0,0 +1,29 @@
+/* PR debug/54693 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline, noclone)) void
+foo (char *str, char c)
+{
+ asm volatile ("" : : "r" (str), "r" (c) : "memory");
+ *str = c;
+}
+
+int
+main ()
+{
+ int i;
+ char c;
+ char arr[11];
+
+ for (i = 0; i < 10; i++)
+ {
+ c = 0x30 + i;
+ foo (&arr[i], c); /* { dg-final { gdb-test 22 "i" "c - 48" } } */
+ }
+ arr[10] = 0;
+
+ __builtin_printf ("arr = %s\n", arr);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54796.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54796.c
new file mode 100644
index 000000000..f58e5a02c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54796.c
@@ -0,0 +1,25 @@
+/* PR debug/54796 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline, noclone)) void
+bar (char *a, int b)
+{
+ __asm volatile ("" : "+r" (a), "+r" (b) : : "memory");
+}
+
+__attribute__((noinline, noclone)) void
+foo (int a, int b)
+{
+ int c = a;
+ char d[b]; /* { dg-final { gdb-test 17 "a" "5" } } */
+ bar (d, 2); /* { dg-final { gdb-test 17 "b" "6" } } */
+ bar (d, 4); /* { dg-final { gdb-test 17 "c" "5" } } */
+}
+
+int
+main ()
+{
+ foo (5, 6);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54970.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54970.c
new file mode 100644
index 000000000..a9b8c064d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54970.c
@@ -0,0 +1,47 @@
+/* PR debug/54970 */
+/* PR debug/54971 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+int
+main ()
+{
+ int a[] = { 1, 2, 3 }; /* { dg-final { gdb-test 15 "a\[0\]" "1" } } */
+ int *p = a + 2; /* { dg-final { gdb-test 15 "a\[1\]" "2" } } */
+ int *q = a + 1; /* { dg-final { gdb-test 15 "a\[2\]" "3" } } */
+ /* { dg-final { gdb-test 15 "*p" "3" } } */
+ asm volatile (NOP); /* { dg-final { gdb-test 15 "*q" "2" } } */
+ *p += 10; /* { dg-final { gdb-test 20 "a\[0\]" "1" } } */
+ /* { dg-final { gdb-test 20 "a\[1\]" "2" } } */
+ /* { dg-final { gdb-test 20 "a\[2\]" "13" } } */
+ /* { dg-final { gdb-test 20 "*p" "13" } } */
+ asm volatile (NOP); /* { dg-final { gdb-test 20 "*q" "2" } } */
+ *q += 10; /* { dg-final { gdb-test 25 "a\[0\]" "1" } } */
+ /* { dg-final { gdb-test 25 "a\[1\]" "12" } } */
+ /* { dg-final { gdb-test 25 "a\[2\]" "13" } } */
+ /* { dg-final { gdb-test 25 "*p" "13" } } */
+ asm volatile (NOP); /* { dg-final { gdb-test 25 "*q" "12" } } */
+ __builtin_memcpy (&a, (int [3]) { 4, 5, 6 }, sizeof (a));
+ /* { dg-final { gdb-test 31 "a\[0\]" "4" } } */
+ /* { dg-final { gdb-test 31 "a\[1\]" "5" } } */
+ /* { dg-final { gdb-test 31 "a\[2\]" "6" } } */
+ /* { dg-final { gdb-test 31 "*p" "6" } } */
+ asm volatile (NOP); /* { dg-final { gdb-test 31 "*q" "5" } } */
+ *p += 20; /* { dg-final { gdb-test 36 "a\[0\]" "4" } } */
+ /* { dg-final { gdb-test 36 "a\[1\]" "5" } } */
+ /* { dg-final { gdb-test 36 "a\[2\]" "26" } } */
+ /* { dg-final { gdb-test 36 "*p" "26" } } */
+ asm volatile (NOP); /* { dg-final { gdb-test 36 "*q" "5" } } */
+ *q += 20; /* { dg-final { gdb-test 45 "a\[0\]" "4" } } */
+ /* { dg-final { gdb-test 45 "a\[1\]" "25" } } */
+ /* { dg-final { gdb-test 45 "a\[2\]" "26" } } */
+ /* { dg-final { gdb-test 45 "*p" "26" } } */
+ /* { dg-final { gdb-test 45 "p\[-1\]" "25" } } */
+ /* { dg-final { gdb-test 45 "p\[-2\]" "4" } } */
+ /* { dg-final { gdb-test 45 "q\[-1\]" "4" } } */
+ /* { dg-final { gdb-test 45 "q\[1\]" "26" } } */
+ asm volatile (NOP); /* { dg-final { gdb-test 45 "*q" "25" } } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-1.c
new file mode 100644
index 000000000..4f02bc96e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-1.c
@@ -0,0 +1,29 @@
+/* PR debug/56154 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-additional-sources "pr56154-aux.c" } */
+
+#include "../nop.h"
+
+union U { int a, b; };
+volatile int z;
+
+__attribute__((noinline, noclone)) int
+foo (int fd, union U x)
+{
+ int result = x.a != 0;
+ if (fd != 0)
+ result = x.a == 0;
+ asm (NOP : : : "memory"); /* { dg-final { gdb-test pr56154-1.c:17 "x.a" "4" } } */
+ z = x.a;
+ x.a = 6;
+ asm (NOP : : : "memory"); /* { dg-final { gdb-test pr56154-1.c:20 "x.a" "6" } } */
+ return result;
+}
+
+void
+test_main (void)
+{
+ union U u = { .a = 4 };
+ foo (0, u);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-2.c
new file mode 100644
index 000000000..6c1d5d977
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-2.c
@@ -0,0 +1,39 @@
+/* PR debug/56154 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-additional-sources "pr56154-aux.c" } */
+
+#include "../nop.h"
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) int
+foo (int x)
+{
+ asm ("");
+ x++;
+ asm ("");
+ x++;
+ asm ("");
+ x++;
+ asm ("");
+ x++;
+ asm ("");
+ x++;
+ asm ("");
+ x++;
+ asm ("");
+ x++;
+ asm ("");
+ x++;
+ asm (NOP : : : "memory");
+ asm (NOP : : : "memory"); /* { dg-final { gdb-test pr56154-2.c:30 "x" "28" } } */
+ return x;
+}
+
+void
+test_main (void)
+{
+ if (foo (20) != 28)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-3.c
new file mode 100644
index 000000000..095dce9f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-3.c
@@ -0,0 +1,31 @@
+/* PR debug/56154 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-additional-sources "pr56154-aux.c" } */
+
+#include "../nop.h"
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) int
+foo (int x)
+{
+ x++;
+ x++;
+ x++;
+ x++;
+ x++;
+ x++;
+ x++;
+ x++;
+ asm (NOP : : : "memory");
+ asm (NOP : : : "memory"); /* { dg-final { gdb-test pr56154-3.c:22 "x" "28" } } */
+ return x;
+}
+
+void
+test_main (void)
+{
+ if (foo (20) != 28)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-4.c
new file mode 100644
index 000000000..bfe7338d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-4.c
@@ -0,0 +1,34 @@
+/* PR debug/56154 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+/* { dg-additional-sources "pr56154-aux.c" } */
+
+#include "../nop.h"
+
+extern void abort (void);
+
+volatile int z;
+
+__attribute__((noinline, noclone)) int
+foo (int x)
+{
+ z = 6;
+ x++;
+ x++;
+ x++;
+ x++;
+ x++;
+ x++;
+ x++;
+ x++;
+ asm (NOP : : : "memory");
+ asm (NOP : : : "memory"); /* { dg-final { gdb-test pr56154-4.c:25 "x" "28" } } */
+ return x;
+}
+
+void
+test_main (void)
+{
+ if (foo (20) != 28)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-aux.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-aux.c
new file mode 100644
index 000000000..131173cb3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr56154-aux.c
@@ -0,0 +1,11 @@
+/* PR debug/56154 */
+/* { dg-do compile } */
+
+extern void test_main (void);
+
+int
+main ()
+{
+ test_main ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-1.c
new file mode 100644
index 000000000..62ce881bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-1.c
@@ -0,0 +1,34 @@
+/* PR tree-optimization/58791 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+__attribute__((noinline, noclone)) int
+foo (int x, int y)
+{
+ _Bool a = x != 0;
+ _Bool b = y != 2;
+ _Bool c = a & b;
+ _Bool d = !c;
+ int ret;
+ if (c)
+ {
+ if (y < 3 || y > 4)
+ ret = 1;
+ else
+ ret = 0;
+ }
+ else
+ ret = 0;
+ asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr58791-1.c:25 "c & 1" "1" } } */
+ asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr58791-1.c:25 "d & 1" "0" } } */
+ return ret;
+}
+
+int
+main ()
+{
+ foo (1, 3);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-2.c
new file mode 100644
index 000000000..d7da69b48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-2.c
@@ -0,0 +1,36 @@
+/* PR tree-optimization/58791 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+__attribute__((noinline, noclone)) int
+foo (unsigned char c)
+{
+ int ret;
+ _Bool a, b, d, e, f;
+
+ a = c == 34;
+ b = c == 32;
+ d = a | b;
+ f = !d;
+ if (d)
+ ret = 1;
+ else
+ {
+ e = c <= 31;
+ ret = e;
+ }
+
+ asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr58791-2.c:27 "d & 1" "1" } } */
+ asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr58791-2.c:27 "f & 1" "0" } } */
+ return ret;
+}
+
+
+int
+main ()
+{
+ foo (32);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-3.c
new file mode 100644
index 000000000..6316ace56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-3.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/58791 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+__attribute__((noinline, noclone)) unsigned
+foo (unsigned a, unsigned b, unsigned c, unsigned d, unsigned e)
+{
+ unsigned f = b + c; /* { dg-final { gdb-test pr58791-3.c:19 "f" "5" } } */
+ unsigned g = a - f; /* { dg-final { gdb-test pr58791-3.c:19 "g" "24" } } */
+ unsigned h = d + e; /* { dg-final { gdb-test pr58791-3.c:19 "h" "9" } } */
+ unsigned i = g - h; /* { dg-final { gdb-test pr58791-3.c:19 "i" "15" } } */
+ unsigned j = f + 1; /* { dg-final { gdb-test pr58791-3.c:19 "j" "6" } } */
+ unsigned k = g + 1; /* { dg-final { gdb-test pr58791-3.c:19 "k" "25" } } */
+ unsigned l = h + 1; /* { dg-final { gdb-test pr58791-3.c:19 "l" "10" } } */
+ unsigned m = i + 1; /* { dg-final { gdb-test pr58791-3.c:19 "m" "16" } } */
+ asm volatile (NOP : : : "memory");
+ asm volatile (NOP : : : "memory");
+ return i;
+}
+
+int
+main ()
+{
+ foo (29, 2, 3, 4, 5);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-4.c
new file mode 100644
index 000000000..d988a9cfb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-4.c
@@ -0,0 +1,41 @@
+/* PR tree-optimization/58791 */
+/* { dg-do run } */
+/* { dg-options "-g -ffast-math" } */
+
+#include "../nop.h"
+
+__attribute__((noinline, noclone)) double
+foo (float a, float b, float c, float d, float l, double u)
+{
+ float e = a * d;
+ float f = d * e;
+ double g = (double) f;
+ double h = (double) b;
+ double i = g * h; /* { dg-final { gdb-test pr58791-4.c:32 "i" "486" { target { x86_64-*-* && lp64 } } } } */
+ double i2 = i + 1.0; /* { dg-final { gdb-test pr58791-4.c:32 "i2" "487" { target { x86_64-*-* && lp64 } } } } */
+ double j = i * 3.25;
+ double k = h + j;
+ float m = l * 8.75;
+ double n = (double) m;
+ double o = (double) a;
+ double p = n * o;
+ double q = h * p;
+ double r = q * 2.5;
+ double s = k - r;
+ double t = (double) c;
+ double v = o * u;
+ double w = o * v;
+ double x = h * w;
+ double y = h * x;
+ double z = y * 8.5;
+ asm volatile (NOP : : : "memory");
+ asm volatile (NOP : : : "memory");
+ return s - z;
+}
+
+int
+main ()
+{
+ foo (3.0f, 2.0f, -1.0f, 9.0f, 1.0f, 2.0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-5.c
new file mode 100644
index 000000000..c23776919
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr58791-5.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/58791 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+__attribute__((noinline, noclone)) unsigned int
+foo (unsigned int a0, unsigned int a1, unsigned int a2,
+ unsigned int a3, unsigned int a4)
+{
+ unsigned int b0, b1, b2, b3, b4, e;
+ /* this can be optimized to four additions... */
+ b4 = a4 + a3 + a2 + a1 + a0; /* { dg-final { gdb-test pr58791-5.c:20 "b4" "4681" } } */
+ b3 = a3 + a2 + a1 + a0; /* { dg-final { gdb-test pr58791-5.c:20 "b3" "585" } } */
+ b2 = a2 + a1 + a0; /* { dg-final { gdb-test pr58791-5.c:20 "b2" "73" } } */
+ b1 = a1 + a0; /* { dg-final { gdb-test pr58791-5.c:20 "b1" "9" } } */
+ /* This is actually 0 */
+ e = b4 - b3 + b2 - b1 - a4 - a2; /* { dg-final { gdb-test pr58791-5.c:20 "e" "0" } } */
+ asm volatile (NOP : : : "memory");
+ asm volatile (NOP : : : "memory");
+ return e;
+}
+
+int
+main ()
+{
+ foo (1, 8, 64, 512, 4096);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr59776.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr59776.c
new file mode 100644
index 000000000..382abb622
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr59776.c
@@ -0,0 +1,29 @@
+/* PR debug/59776 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../nop.h"
+
+struct S { float f, g; };
+
+__attribute__((noinline, noclone)) void
+foo (struct S *p)
+{
+ struct S s1, s2; /* { dg-final { gdb-test pr59776.c:17 "s1.f" "5.0" } } */
+ s1 = *p; /* { dg-final { gdb-test pr59776.c:17 "s1.g" "6.0" } } */
+ s2 = s1; /* { dg-final { gdb-test pr59776.c:17 "s2.f" "0.0" } } */
+ *(int *) &s2.f = 0; /* { dg-final { gdb-test pr59776.c:17 "s2.g" "6.0" } } */
+ asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr59776.c:20 "s1.f" "5.0" } } */
+ asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr59776.c:20 "s1.g" "6.0" } } */
+ s2 = s1; /* { dg-final { gdb-test pr59776.c:20 "s2.f" "5.0" } } */
+ asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr59776.c:20 "s2.g" "6.0" } } */
+ asm volatile (NOP : : : "memory");
+}
+
+int
+main ()
+{
+ struct S x = { 5.0f, 6.0f };
+ foo (&x);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/rotatetest.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/rotatetest.c
new file mode 100644
index 000000000..64f5340a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/rotatetest.c
@@ -0,0 +1,76 @@
+/* { dg-do run { target { x86_64-*-* && lp64 } } } */
+/* { dg-options "-g" } */
+
+volatile int vv;
+
+__attribute__((noclone, noinline)) long
+f1 (unsigned long x)
+{
+ long f = (x << 12) | (x >> (64 - 12));
+ long g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 12 "g" "f" } } */
+ return f;
+}
+
+__attribute__((noclone, noinline)) long
+f2 (unsigned long x, int y)
+{
+ long f = (x << y) | (x >> (64 - y));
+ long g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 22 "g" "f" } } */
+ return f;
+}
+
+__attribute__((noclone, noinline)) long
+f3 (unsigned long x, int y)
+{
+ long f = (x >> y) | (x << (64 - y));
+ long g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 32 "g" "f" } } */
+ return f;
+}
+
+__attribute__((noclone, noinline)) unsigned int
+f4 (unsigned int x)
+{
+ unsigned int f = (x << 12) | (x >> (32 - 12));
+ unsigned int g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 42 "g" "f" } } */
+ return f;
+}
+
+__attribute__((noclone, noinline)) unsigned int
+f5 (unsigned int x, int y)
+{
+ unsigned int f = (x << y) | (x >> (32 - y));
+ unsigned int g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 52 "g" "f" } } */
+ return f;
+}
+
+__attribute__((noclone, noinline)) unsigned int
+f6 (unsigned int x, int y)
+{
+ unsigned int f = (x >> y) | (x << (32 - y));
+ unsigned int g = f;
+ asm volatile ("" : "+r" (f));
+ vv++; /* { dg-final { gdb-test 62 "g" "f" } } */
+ return f;
+}
+
+int
+main ()
+{
+ f1 (0x123456789abcde0fUL);
+ f2 (0x123456789abcde0fUL, 18);
+ f3 (0x123456789abcde0fUL, 17);
+ f4 (0x12345678);
+ f5 (0x12345678, 18);
+ f6 (0x12345678, 17);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/sra-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/sra-1.c
new file mode 100644
index 000000000..e779d7ac8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/sra-1.c
@@ -0,0 +1,56 @@
+/* PR debug/43983 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+struct A { int i; int j; };
+struct B { int : 4; int i : 12; int j : 12; int : 4; };
+
+__attribute__((noinline)) void
+bar (int x)
+{
+ asm volatile ("" : : "r" (x) : "memory");
+}
+
+__attribute__((noinline)) int
+f1 (int k)
+{
+ struct A a = { 4, k + 6 };
+ asm ("" : "+r" (a.i));
+ a.j++;
+ bar (a.i); /* { dg-final { gdb-test 21 "a.i" "4" } } */
+ bar (a.j); /* { dg-final { gdb-test 21 "a.j" "14" } } */
+ return a.i + a.j;
+}
+
+__attribute__((noinline)) int
+f2 (int k)
+{
+ int a[2] = { 4, k + 6 };
+ asm ("" : "+r" (a[0]));
+ a[1]++;
+ bar (a[0]); /* { dg-final { gdb-test 32 "a\[0\]" "4" } } */
+ bar (a[1]); /* { dg-final { gdb-test 32 "a\[1\]" "14" } } */
+ return a[0] + a[1];
+}
+
+__attribute__((noinline)) int
+f3 (int k)
+{
+ struct B a = { 4, k + 6 };
+ asm ("" : "+r" (a.i));
+ a.j++;
+ bar (a.i); /* { dg-final { gdb-test 43 "a.i" "4" } } */
+ bar (a.j); /* { dg-final { gdb-test 43 "a.j" "14" } } */
+ return a.i + a.j;
+}
+
+int
+main (void)
+{
+ int k;
+ asm ("" : "=r" (k) : "0" (7));
+ f1 (k);
+ f2 (k);
+ f3 (k);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/vla-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/vla-1.c
new file mode 100644
index 000000000..651465428
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/vla-1.c
@@ -0,0 +1,37 @@
+/* PR debug/43150 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+void __attribute__((noinline))
+bar (short *p)
+{
+ __builtin_memset (p, '\0', 17 * sizeof (*p));
+ asm volatile ("" : : "r" (p) : "memory");
+}
+
+int __attribute__((noinline))
+f1 (int i)
+{
+ char a[i + 1];
+ a[0] = 5; /* { dg-final { gdb-test 17 "i" "5" } } */
+ return a[0]; /* { dg-final { gdb-test 17 "sizeof (a)" "6" } } */
+}
+
+int __attribute__((noinline))
+f2 (int i)
+{
+ short a[i * 2 + 7]; /* { dg-final { gdb-test 24 "i" "5" } } */
+ bar (a); /* { dg-final { gdb-test 24 "sizeof (a)" "17 * sizeof (short)" } } */
+ return a[i + 4];
+}
+
+int
+main ()
+{
+ volatile int j;
+ int i = 5;
+ asm volatile ("" : "=r" (i) : "0" (i));
+ j = f1 (i);
+ f2 (i);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/vla-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/guality/vla-2.c
new file mode 100644
index 000000000..6773775b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/vla-2.c
@@ -0,0 +1,55 @@
+/* PR debug/42801 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+void __attribute__((noinline))
+fn1 (int *x, int y)
+{
+ asm volatile ("" : : "rm" (x), "rm" (y) : "memory");
+}
+
+static inline __attribute__((always_inline)) int
+fn2 (int i)
+{
+ int a[i];
+ fn1 (a, i);
+ fn1 (a, i); /* { dg-final { gdb-test 16 "sizeof (a)" "5 * sizeof (int)" } } */
+ return i;
+}
+
+static inline __attribute__((always_inline)) int
+fn3 (int i)
+{
+ int a[i];
+ fn1 (a, i);
+ fn1 (a, i); /* { dg-final { gdb-test 25 "sizeof (a)" "6 * sizeof (int)" } } */
+ return i;
+}
+
+static inline __attribute__((always_inline)) int
+fn4 (int i)
+{
+ return fn3 (i);
+}
+
+int __attribute__((noinline))
+fn5 (void)
+{
+ return fn2 (5) + 1;
+}
+
+int __attribute__((noinline))
+fn6 (int i)
+{
+ return fn2 (i + 1) + fn4 (i + 2) + fn4 (i + 2) + 1;
+}
+
+int
+main (void)
+{
+ int x = 4;
+ asm volatile ("" : "+r" (x));
+ fn5 ();
+ fn6 (x);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bit-insn-ice.c b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bit-insn-ice.c
new file mode 100644
index 000000000..442dc4bb9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bit-insn-ice.c
@@ -0,0 +1,39 @@
+/* { dg-skip-if "" { "h8300*-*-*" } "*" "-msx*" } */
+/* ICE for bit instruction generation using 16-bit const */
+
+__extension__ struct st_mstp
+{
+ union
+ {
+ unsigned short WORD;
+ struct
+ {
+ unsigned char ACSE:1;
+ unsigned char _EXDMAC:1;
+ unsigned char _DMAC:1;
+ unsigned char _DTC:1;
+ unsigned char:2;
+ unsigned char _TMR23:1;
+ unsigned char _TMR01:1;
+ unsigned char:2;
+ unsigned char _DA:1;
+ unsigned char:1;
+ unsigned char _AD:1;
+ unsigned char:1;
+ unsigned char _TPUU:1;
+ unsigned char _TPUL:1;
+ } BIT;
+ } CRA;
+};
+#define MSTP (*(volatile struct st_mstp *)0xFFFDC8)
+#define MSTPA_EXDMA 0x4000
+#define MSTPA_AND 0xFEFF
+
+int
+main ()
+{
+ MSTP.CRA.WORD |= MSTPA_EXDMA;
+ MSTP.CRA.WORD ^= MSTPA_EXDMA;
+ MSTP.CRA.WORD &= MSTPA_AND;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bit-insn-ice2.c b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bit-insn-ice2.c
new file mode 100644
index 000000000..8b5f62875
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bit-insn-ice2.c
@@ -0,0 +1,15 @@
+/* { dg-skip-if "" { "h8300*-*-*" } "*" "-msx*" } */
+/* { dg-options "-O2" } */
+/* ICE for bit instruction generation using 16-bit const */
+
+#define MSTPCRA (*(volatile unsigned char*)0xFFFFC9)
+#define MSTPCRA2 (*(volatile unsigned char*)0xFFFDC8)
+
+int
+main (void)
+{
+ MSTPCRA = MSTPCRA2 & ~0x01;
+ MSTPCRA = MSTPCRA2 ^ ~0xFE;
+ MSTPCRA = MSTPCRA2 | ~0xFE;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bss-align-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bss-align-1.c
new file mode 100644
index 000000000..d6459e15f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-bss-align-1.c
@@ -0,0 +1,12 @@
+/* Make sure that the H8 backend does align zero initialized variables. */
+/* { dg-do compile { target h8300-*-* } } */
+/* { dg-options "" } */
+
+struct s {
+ char a, b;
+ long c;
+};
+
+struct s s = {0};
+
+/* { dg-final { scan-assembler ".align" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c
new file mode 100644
index 000000000..5fa60ec4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c
@@ -0,0 +1,19 @@
+/* Make sure that the H8 backend does not generate a div
+ instruction in a delay slot. */
+/* { dg-options "-Os" } */
+/* { dg-skip-if "" { "h8300*-*-*" } "*" "-msx*" } */
+/* { dg-final { scan-assembler-not "\tbra/s\t.*\n\tdiv*" } } */
+
+extern volatile unsigned long timer_ticks;
+#define timer_ms_elapsed(ticks) (((unsigned long)(timer_ticks-ticks))/10)
+unsigned long ticks;
+
+unsigned tst_read( unsigned char idx )
+{
+ switch( idx )
+ {
+ case 0x62: return timer_ms_elapsed(ticks);
+ case 0x61: return timer_ticks;
+ default: return 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/h8300-ice2.c b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-ice2.c
new file mode 100644
index 000000000..216ea34c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-ice2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* ICE for signed/unsigned long and signed char comparison */
+int main()
+{
+ unsigned long ul = 4;
+ long sl = 2;
+ signed char sch = -1;
+ if (ul <= sch);
+ return 0;
+ if (sl <= sch)
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/h8300-stack-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-stack-1.c
new file mode 100644
index 000000000..b63bde29c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/h8300-stack-1.c
@@ -0,0 +1,14 @@
+/* Make sure that the H8 backend does not generate a non-atomic stack
+ adjustment. */
+/* { dg-do compile { target h8300-*-* } } */
+/* { dg-options "" } */
+
+void foo (short, short, short, short, short, short);
+
+void
+bar ()
+{
+ foo (0, 0, 0, 0, 0, 0);
+}
+
+/* { dg-final { scan-assembler-not "addx" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/hex-round-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/hex-round-1.c
new file mode 100644
index 000000000..e1283cae3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/hex-round-1.c
@@ -0,0 +1,114 @@
+/* Test for hexadecimal float rounding: bug 21720. */
+/* { dg-do link } */
+/* { dg-options "-O -std=gnu99" } */
+/* { dg-skip-if "SPU float rounds towards zero" { spu-*-* } } */
+
+#include <float.h>
+
+extern void link_failure (void);
+
+int
+main (void)
+{
+#if FLT_RADIX == 2 && FLT_MANT_DIG == 24
+ if (0x1.0000011p0f == 1)
+ link_failure ();
+ if (0x1.00000101p0f == 1)
+ link_failure ();
+ if (0x1.000001001p0f == 1)
+ link_failure ();
+ if (0x1.0000010001p0f == 1)
+ link_failure ();
+ if (0x1.00000100001p0f == 1)
+ link_failure ();
+ if (0x1.000001000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.00000100000000000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.000001000000000000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+ if (0x1.0000010000000000000000000000000000000000000000000000001p0f == 1)
+ link_failure ();
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/hex-round-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/hex-round-2.c
new file mode 100644
index 000000000..af49536ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/hex-round-2.c
@@ -0,0 +1,115 @@
+/* Test for hexadecimal float rounding: bug 21720. Test with no "."
+ in number. */
+/* { dg-do link } */
+/* { dg-options "-O -std=gnu99" } */
+/* { dg-skip-if "SPU float rounds towards zero" { spu-*-* } } */
+
+#include <float.h>
+
+extern void link_failure (void);
+
+int
+main (void)
+{
+#if FLT_RADIX == 2 && FLT_MANT_DIG == 24
+ if (0x10000011p-28f == 1)
+ link_failure ();
+ if (0x100000101p-32f == 1)
+ link_failure ();
+ if (0x1000001001p-36f == 1)
+ link_failure ();
+ if (0x10000010001p-40f == 1)
+ link_failure ();
+ if (0x100000100001p-44f == 1)
+ link_failure ();
+ if (0x1000001000001p-48f == 1)
+ link_failure ();
+ if (0x10000010000001p-52f == 1)
+ link_failure ();
+ if (0x100000100000001p-56f == 1)
+ link_failure ();
+ if (0x1000001000000001p-60f == 1)
+ link_failure ();
+ if (0x10000010000000001p-64f == 1)
+ link_failure ();
+ if (0x100000100000000001p-68f == 1)
+ link_failure ();
+ if (0x1000001000000000001p-72f == 1)
+ link_failure ();
+ if (0x10000010000000000001p-76f == 1)
+ link_failure ();
+ if (0x100000100000000000001p-80f == 1)
+ link_failure ();
+ if (0x1000001000000000000001p-84f == 1)
+ link_failure ();
+ if (0x10000010000000000000001p-88f == 1)
+ link_failure ();
+ if (0x100000100000000000000001p-92f == 1)
+ link_failure ();
+ if (0x1000001000000000000000001p-96f == 1)
+ link_failure ();
+ if (0x10000010000000000000000001p-100f == 1)
+ link_failure ();
+ if (0x100000100000000000000000001p-104f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000001p-108f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000001p-112f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000001p-116f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000001p-120f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000001p-124f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000000001p-128f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000000001p-132f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000000001p-136f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000000000001p-140f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000000000001p-144f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000000000001p-148f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000000000000001p-152f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000000000000001p-156f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000000000000001p-160f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000000000000000001p-164f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000000000000000001p-168f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000000000000000001p-172f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000000000000000000001p-176f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000000000000000000001p-180f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000000000000000000001p-184f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000000000000000000000001p-188f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000000000000000000000001p-192f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000000000000000000000001p-196f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000000000000000000000000001p-200f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000000000000000000000000001p-204f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000000000000000000000000001p-208f == 1)
+ link_failure ();
+ if (0x100000100000000000000000000000000000000000000000000001p-212f == 1)
+ link_failure ();
+ if (0x1000001000000000000000000000000000000000000000000000001p-216f == 1)
+ link_failure ();
+ if (0x10000010000000000000000000000000000000000000000000000001p-220f == 1)
+ link_failure ();
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
new file mode 100644
index 000000000..f5b5302b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
@@ -0,0 +1,32 @@
+/* { dg-options "-Os -fdump-rtl-hoist" } */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { nonpic } } } } */
+/* { dg-final { cleanup-rtl-dump "hoist" } } */
+
+#define BUF 100
+int a[BUF];
+
+void com (int);
+void bar (int);
+
+int foo (int x, int y, int z)
+{
+ /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
+ because its rtx_cost is too small. */
+ if (z)
+ {
+ a[1] = a[0] + a[2];
+ a[2] = a[1] + a[3];
+ a[3] = a[2] + a[4];
+ a[4] = a[3] + a[5];
+ a[5] = a[4] + a[6];
+ a[6] = a[5] + a[7];
+ a[7] = a[6] + a[8];
+ com (x+y);
+ }
+ else
+ {
+ bar (x+y);
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
new file mode 100644
index 000000000..30408f318
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
@@ -0,0 +1,33 @@
+/* { dg-options "-Os -fdump-rtl-hoist" } */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+/* { dg-final { cleanup-rtl-dump "hoist" } } */
+
+#define BUF 100
+int a[BUF];
+
+void com (int);
+void bar (int);
+
+int foo (int x, int y, int z)
+{
+ /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
+ because its rtx_cost is too small. */
+ if (z)
+ {
+ a[1] = a[0];
+ a[2] = a[1];
+ a[3] = a[3];
+ a[4] = a[5];
+ a[5] = a[7];
+ a[6] = a[11];
+ a[7] = a[13];
+ a[8] = a[17];
+ com (x+y);
+ }
+ else
+ {
+ bar (x+y);
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c
new file mode 100644
index 000000000..b050f8982
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c
@@ -0,0 +1,33 @@
+/* { dg-options "-Os -fdump-rtl-hoist" } */
+/* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+/* { dg-final { cleanup-rtl-dump "hoist" } } */
+
+#define BUF 100
+int a[BUF];
+
+void com (int);
+void bar (int);
+
+int foo (int x, int y, int z)
+{
+ /* "x+y" won't be hoisted if "-fira-hoist-pressure" is disabled,
+ because its rtx_cost is too small. */
+ if (z)
+ {
+ a[1] = a[0] + a[2] + a[3] + a[4] + a[5] + a[6];
+ a[2] = a[1] + a[3] + a[5] + a[5] + a[6] + a[7];
+ a[3] = a[2] + a[5] + a[7] + a[6] + a[7] + a[8];
+ a[4] = a[3] + a[7] + a[11] + a[7] + a[8] + a[9];
+ a[5] = a[5] + a[11] + a[13] + a[8] + a[9] + a[10];
+ a[6] = a[7] + a[13] + a[17] + a[9] + a[10] + a[11];
+ a[7] = a[11] + a[17] + a[19] + a[10] + a[11] + a[12];
+ com (x+y);
+ }
+ else
+ {
+ bar (x+y);
+ }
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-1.c
new file mode 100644
index 000000000..2cfc144b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-1.c
@@ -0,0 +1,75 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-options } */
+/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
+
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+
+/* Test basic functionality of the intrinsics. The operations should
+ not be optimized away if no one checks the return values. */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern void *memcpy (void *, const void *, size_t);
+
+static int AI[12];
+static int init_noret_si[12] = { 0, 0, 0, 1, 0, 0, 0 , 0 , -1, 0, 0, -1 };
+static int test_noret_si[12] = { 1, 1, 1, 0, 1, 4, 22, -12, 7 , 8, 9, ~7 };
+
+static void
+do_noret_si (void)
+{
+ __sync_val_compare_and_swap(AI+0, 0, 1);
+ __sync_bool_compare_and_swap(AI+1, 0, 1);
+ __sync_lock_test_and_set(AI+2, 1);
+ __sync_lock_release(AI+3);
+
+ __sync_fetch_and_add(AI+4, 1);
+ __sync_fetch_and_add(AI+5, 4);
+ __sync_fetch_and_add(AI+6, 22);
+ __sync_fetch_and_sub(AI+7, 12);
+ __sync_fetch_and_and(AI+8, 7);
+ __sync_fetch_and_or(AI+9, 8);
+ __sync_fetch_and_xor(AI+10, 9);
+ __sync_fetch_and_nand(AI+11, 7);
+}
+
+static long AL[12];
+static long init_noret_di[12] = { 0, 0, 0, 1, 0, 0, 0 , 0 , -1, 0, 0, -1 };
+static long test_noret_di[12] = { 1, 1, 1, 0, 1, 4, 22, -12, 7 , 8, 9, ~7 };
+
+static void
+do_noret_di (void)
+{
+ __sync_val_compare_and_swap(AL+0, 0, 1);
+ __sync_bool_compare_and_swap(AL+1, 0, 1);
+ __sync_lock_test_and_set(AL+2, 1);
+ __sync_lock_release(AL+3);
+
+ __sync_fetch_and_add(AL+4, 1);
+ __sync_fetch_and_add(AL+5, 4);
+ __sync_fetch_and_add(AL+6, 22);
+ __sync_fetch_and_sub(AL+7, 12);
+ __sync_fetch_and_and(AL+8, 7);
+ __sync_fetch_and_or(AL+9, 8);
+ __sync_fetch_and_xor(AL+10, 9);
+ __sync_fetch_and_nand(AL+11, 7);
+}
+
+int main()
+{
+ memcpy(AI, init_noret_si, sizeof(init_noret_si));
+ memcpy(AL, init_noret_di, sizeof(init_noret_di));
+
+ do_noret_si ();
+ do_noret_di ();
+
+ if (memcmp (AI, test_noret_si, sizeof(test_noret_si)))
+ abort ();
+ if (memcmp (AL, test_noret_di, sizeof(test_noret_di)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-2.c
new file mode 100644
index 000000000..e6f4cad73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-2.c
@@ -0,0 +1,131 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-options } */
+/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
+
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
+
+/* Test basic functionality of the intrinsics. */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern void *memcpy (void *, const void *, size_t);
+
+static int AI[18];
+static int init_si[18] = { 0,0,0,1,0,0, 0,0 ,-1,0,0,-1,0,0 ,-1,0,0,-1 };
+static int test_si[18] = { 1,1,1,1,1,4,22,-12,7 ,8,9,~7,1,-12,7 ,8,9,~7 };
+
+static void
+do_si (void)
+{
+ if (__sync_val_compare_and_swap(AI+0, 0, 1) != 0)
+ abort ();
+ if (__sync_val_compare_and_swap(AI+0, 0, 1) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AI+1, 0, 1) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AI+1, 0, 1) != 0)
+ abort ();
+
+ if (__sync_lock_test_and_set(AI+2, 1) != 0)
+ abort ();
+
+ if (__sync_fetch_and_add(AI+4, 1) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AI+5, 4) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AI+6, 22) != 0)
+ abort ();
+ if (__sync_fetch_and_sub(AI+7, 12) != 0)
+ abort ();
+ if (__sync_fetch_and_and(AI+8, 7) != -1)
+ abort ();
+ if (__sync_fetch_and_or(AI+9, 8) != 0)
+ abort ();
+ if (__sync_fetch_and_xor(AI+10, 9) != 0)
+ abort ();
+ if (__sync_fetch_and_nand(AI+11, 7) != -1)
+ abort ();
+
+ if (__sync_add_and_fetch(AI+12, 1) != 1)
+ abort ();
+ if (__sync_sub_and_fetch(AI+13, 12) != -12)
+ abort ();
+ if (__sync_and_and_fetch(AI+14, 7) != 7)
+ abort ();
+ if (__sync_or_and_fetch(AI+15, 8) != 8)
+ abort ();
+ if (__sync_xor_and_fetch(AI+16, 9) != 9)
+ abort ();
+ if (__sync_nand_and_fetch(AI+17, 7) != ~7)
+ abort ();
+}
+
+static long AL[18];
+static long init_di[18] = { 0,0,0,1,0,0, 0,0 ,-1,0,0,-1,0,0 ,-1,0,0,-1 };
+static long test_di[18] = { 1,1,1,1,1,4,22,-12,7 ,8,9,~7,1,-12,7 ,8,9,~7 };
+
+static void
+do_di (void)
+{
+ if (__sync_val_compare_and_swap(AL+0, 0, 1) != 0)
+ abort ();
+ if (__sync_val_compare_and_swap(AL+0, 0, 1) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AL+1, 0, 1) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AL+1, 0, 1) != 0)
+ abort ();
+
+ if (__sync_lock_test_and_set(AL+2, 1) != 0)
+ abort ();
+
+ if (__sync_fetch_and_add(AL+4, 1) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AL+5, 4) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AL+6, 22) != 0)
+ abort ();
+ if (__sync_fetch_and_sub(AL+7, 12) != 0)
+ abort ();
+ if (__sync_fetch_and_and(AL+8, 7) != -1)
+ abort ();
+ if (__sync_fetch_and_or(AL+9, 8) != 0)
+ abort ();
+ if (__sync_fetch_and_xor(AL+10, 9) != 0)
+ abort ();
+ if (__sync_fetch_and_nand(AL+11, 7) != -1)
+ abort ();
+
+ if (__sync_add_and_fetch(AL+12, 1) != 1)
+ abort ();
+ if (__sync_sub_and_fetch(AL+13, 12) != -12)
+ abort ();
+ if (__sync_and_and_fetch(AL+14, 7) != 7)
+ abort ();
+ if (__sync_or_and_fetch(AL+15, 8) != 8)
+ abort ();
+ if (__sync_xor_and_fetch(AL+16, 9) != 9)
+ abort ();
+ if (__sync_nand_and_fetch(AL+17, 7) != ~7)
+ abort ();
+}
+
+int main()
+{
+ memcpy(AI, init_si, sizeof(init_si));
+ memcpy(AL, init_di, sizeof(init_di));
+
+ do_si ();
+ do_di ();
+
+ if (memcmp (AI, test_si, sizeof(test_si)))
+ abort ();
+ if (memcmp (AL, test_di, sizeof(test_di)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-3.c
new file mode 100644
index 000000000..621e90277
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-3.c
@@ -0,0 +1,80 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-options } */
+/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
+
+/* Test basic functionality of the intrinsics. */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern void *memcpy (void *, const void *, size_t);
+
+static int AI[4];
+static int init_si[4] = { -30,-30,-50,-50 };
+static int test_si[4] = { -115,-115,25,25 };
+
+static void
+do_si (void)
+{
+ if (__sync_val_compare_and_swap(AI+0, -30, -115) != -30)
+ abort ();
+ if (__sync_val_compare_and_swap(AI+0, -30, -115) != -115)
+ abort ();
+ if (__sync_bool_compare_and_swap(AI+1, -30, -115) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AI+1, -30, -115) != 0)
+ abort ();
+
+ if (__sync_val_compare_and_swap(AI+2, AI[2], 25) != -50)
+ abort ();
+ if (__sync_val_compare_and_swap(AI+2, AI[2], 25) != 25)
+ abort ();
+ if (__sync_bool_compare_and_swap(AI+3, AI[3], 25) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AI+3, AI[3], 25) != 1)
+ abort ();
+}
+
+static long AL[4];
+static long init_di[4] = { -30,-30,-50,-50 };
+static long test_di[4] = { -115,-115,25,25 };
+
+static void
+do_di (void)
+{
+ if (__sync_val_compare_and_swap(AL+0, -30, -115) != -30)
+ abort ();
+ if (__sync_val_compare_and_swap(AL+0, -30, -115) != -115)
+ abort ();
+ if (__sync_bool_compare_and_swap(AL+1, -30, -115) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AL+1, -30, -115) != 0)
+ abort ();
+
+ if (__sync_val_compare_and_swap(AL+2, AL[2], 25) != -50)
+ abort ();
+ if (__sync_val_compare_and_swap(AL+2, AL[2], 25) != 25)
+ abort ();
+ if (__sync_bool_compare_and_swap(AL+3, AL[3], 25) != 1)
+ abort ();
+ if (__sync_bool_compare_and_swap(AL+3, AL[3], 25) != 1)
+ abort ();
+}
+
+int main()
+{
+ memcpy(AI, init_si, sizeof(init_si));
+ memcpy(AL, init_di, sizeof(init_di));
+
+ do_si ();
+ do_di ();
+
+ if (memcmp (AI, test_si, sizeof(test_si)))
+ abort ();
+ if (memcmp (AL, test_di, sizeof(test_di)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-4.c
new file mode 100644
index 000000000..eec472f38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ia64-sync-4.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-options "-O2 -finline-functions" } */
+/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
+
+/* Test inlining __sync_bool_compare_and_swap. */
+
+#include <stdbool.h>
+
+static bool
+compare_and_swap(long *addr, long old, long new_val)
+{
+ return __sync_bool_compare_and_swap(addr, old, new_val);
+}
+
+void
+foo (long *address)
+{
+ long he_address = *address & ~1;
+ while (!compare_and_swap(address, he_address, he_address | 1))
+ he_address = *address & ~1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-1.c
new file mode 100644
index 000000000..bd5d037af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-1.c
@@ -0,0 +1,16 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess } */
+/* { dg-options "" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-2.c
new file mode 100644
index 000000000..5a28574ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-2.c
@@ -0,0 +1,23 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess } */
+/* { dg-options "-funsafe-math-optimizations" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
+
+#if __GCC_IEC_559 != 0
+# error "__GCC_IEC_559 != 0 with -funsafe-math-optimizations"
+#endif
+#if __GCC_IEC_559_COMPLEX != 0
+# error "__GCC_IEC_559_COMPLEX != 0 with -funsafe-math-optimizations"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-3.c
new file mode 100644
index 000000000..5eeb34503
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-3.c
@@ -0,0 +1,23 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess } */
+/* { dg-options "-freciprocal-math" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
+
+#if __GCC_IEC_559 != 0
+# error "__GCC_IEC_559 != 0 with -freciprocal-math"
+#endif
+#if __GCC_IEC_559_COMPLEX != 0
+# error "__GCC_IEC_559_COMPLEX != 0 with -freciprocal-math"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-4.c
new file mode 100644
index 000000000..7bf6b9c30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-4.c
@@ -0,0 +1,23 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess } */
+/* { dg-options "-ffinite-math-only" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
+
+#if __GCC_IEC_559 != 0
+# error "__GCC_IEC_559 != 0 with -ffinite-math-only"
+#endif
+#if __GCC_IEC_559_COMPLEX != 0
+# error "__GCC_IEC_559_COMPLEX != 0 with -ffinite-math-only"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-5.c
new file mode 100644
index 000000000..ea37474fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-5.c
@@ -0,0 +1,23 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess } */
+/* { dg-options "-fno-signed-zeros" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
+
+#if __GCC_IEC_559 != 0
+# error "__GCC_IEC_559 != 0 with -fno-signed-zeros"
+#endif
+#if __GCC_IEC_559_COMPLEX != 0
+# error "__GCC_IEC_559_COMPLEX != 0 with -fno-signed-zeros"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-6.c
new file mode 100644
index 000000000..e2be757f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-6.c
@@ -0,0 +1,23 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess } */
+/* { dg-options "-fsingle-precision-constant" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
+
+#if __GCC_IEC_559 != 0
+# error "__GCC_IEC_559 != 0 with -fsingle-precision-constant"
+#endif
+#if __GCC_IEC_559_COMPLEX != 0
+# error "__GCC_IEC_559_COMPLEX != 0 with -fsingle-precision-constant"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-7.c
new file mode 100644
index 000000000..3b1f79172
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-7.c
@@ -0,0 +1,20 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess } */
+/* { dg-options "-fcx-limited-range" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
+
+#if __GCC_IEC_559_COMPLEX != 0
+# error "__GCC_IEC_559_COMPLEX != 0 with -fcx-limited-range"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-8.c
new file mode 100644
index 000000000..1990b944d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-8.c
@@ -0,0 +1,20 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess } */
+/* { dg-options "-fcx-fortran-rules" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
+
+#if __GCC_IEC_559_COMPLEX != 0
+# error "__GCC_IEC_559_COMPLEX != 0 with -fcx-fortran-rules"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-9.c
new file mode 100644
index 000000000..6179a3bfe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iec-559-macros-9.c
@@ -0,0 +1,23 @@
+/* Test __GCC_IEC_559 and __GCC_IEC_559_COMPLEX macros values. */
+/* { dg-do preprocess { target i?86-*-linux* x86_64-*-linux* powerpc*-*-linux* } } */
+/* { dg-options "-std=c11" } */
+
+#ifndef __GCC_IEC_559
+# error "__GCC_IEC_559 not defined"
+#endif
+#ifndef __GCC_IEC_559_COMPLEX
+# error "__GCC_IEC_559_COMPLEX not defined"
+#endif
+#if __GCC_IEC_559_COMPLEX > __GCC_IEC_559
+# error "__GCC_IEC_559_COMPLEX > __GCC_IEC_559"
+#endif
+#if __GCC_IEC_559_COMPLEX < 0
+# error "__GCC_IEC_559_COMPLEX < 0"
+#endif
+
+#if __GCC_IEC_559 < 2
+# error "__GCC_IEC_559 < 2"
+#endif
+#if __GCC_IEC_559_COMPLEX < 2
+# error "__GCC_IEC_559_COMPLEX < 2"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/if-empty-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/if-empty-1.c
new file mode 100644
index 000000000..b29a6cb92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/if-empty-1.c
@@ -0,0 +1,23 @@
+/* Test diagnostics for empty bodies in if / else. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wempty-body" } */
+
+void
+f (int x)
+{
+ if (x)
+ ; /* { dg-warning "suggest braces around empty body in an" } */
+ if (x)
+ ; /* By design we don't warn in this case. */
+ else
+ (void)0;
+ if (x)
+ (void)0;
+ else
+ ; /* { dg-warning "suggest braces around empty body in an" } */
+ if (x)
+ (void)0;
+ else
+ (void)0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ifcvt-fabs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ifcvt-fabs-1.c
new file mode 100644
index 000000000..40c57d836
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ifcvt-fabs-1.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+/* { dg-options "-O -march=i686" { target { { i686-*-* x86_64-*-* } && ia32 } } } */
+
+extern void abort(void);
+
+float foo(float f)
+{
+ if (f < 0.0f)
+ f = -f;
+
+ return f;
+}
+
+int main(void)
+{
+ if (foo (-1.0f) != 1.0f)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ifelse-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ifelse-1.c
new file mode 100644
index 000000000..2dd2208b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ifelse-1.c
@@ -0,0 +1,21 @@
+/*
+{ dg-do compile }
+{ dg-options "-W -Wall" }
+*/
+
+
+extern int bar ();
+extern int com ();
+extern int baz ();
+void
+foo (a,b)
+ int a, b;
+{
+ if (a)
+ if (b)
+ bar ();
+ else
+ com (); /* { dg-bogus ".*warning.*" "bogus warning" } */
+ else
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ifelse-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ifelse-2.c
new file mode 100644
index 000000000..0210fcfa4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ifelse-2.c
@@ -0,0 +1,34 @@
+/*
+{ dg-do run }
+{ dg-options "-O2" }
+*/
+
+extern void abort (void);
+
+enum Status
+{
+ P_ON_LOWER = -4,
+ P_ON_UPPER = -2,
+ P_FREE = -1
+};
+
+void
+foo (enum Status *stat, double newUpper, double lower, double max)
+{
+ if (newUpper >= max)
+ *stat = P_FREE;
+ else if (newUpper == lower)
+ *stat = P_ON_LOWER;
+}
+
+int
+main ()
+{
+ enum Status stat = P_ON_UPPER;
+
+ foo (&stat, 5.0, -10.0, 10.0);
+
+ if (stat != P_ON_UPPER)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iftrap-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/iftrap-1.c
new file mode 100644
index 000000000..142782042
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iftrap-1.c
@@ -0,0 +1,38 @@
+/* Verify that we optimize to conditional traps. */
+/* { dg-options "-O" } */
+/* { dg-do compile { target rs6000-*-* powerpc*-*-* sparc*-*-* ia64-*-* } } */
+/* { dg-final { scan-assembler-not "^\t(trap|ta|break)\[ \t\]" } } */
+
+void f1(int p)
+{
+ if (p)
+ __builtin_trap();
+}
+
+void f2(int p)
+{
+ if (p)
+ __builtin_trap();
+ else
+ bar();
+}
+
+void f3(int p)
+{
+ if (p)
+ bar();
+ else
+ __builtin_trap();
+}
+
+void f4(int p, int q)
+{
+ if (p)
+ {
+ bar();
+ if (q)
+ bar();
+ }
+ else
+ __builtin_trap();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/iftrap-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/iftrap-2.c
new file mode 100644
index 000000000..8c9c0577c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/iftrap-2.c
@@ -0,0 +1,22 @@
+/* Verify that we optimize to conditional traps. */
+/* { dg-options "-O" } */
+/* { dg-do compile { target rs6000-*-* powerpc*-*-* sparc*-*-* ia64-*-* } } */
+/* { dg-final { scan-assembler-not "^\t(trap|ta|break)\[ \t\]" } } */
+
+extern void abort(void);
+
+void f1(int p)
+{
+ if (p)
+ __builtin_trap();
+ else
+ abort();
+}
+
+void f2(int p)
+{
+ if (p)
+ abort();
+ else
+ __builtin_trap();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/imag-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/imag-1.c
new file mode 100644
index 000000000..e07ef72e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/imag-1.c
@@ -0,0 +1,18 @@
+/* Test for __imag__ side effects; see PR 33192. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int i, j;
+ i = 1;
+ j = __imag__ ++i;
+ if (i != 2 || j != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-1.c
new file mode 100644
index 000000000..cc808b752
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-1.c
@@ -0,0 +1,45 @@
+/* Test diagnostics for various bad initializers. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void f(void);
+void g(void) = f; /* { dg-error "function 'g' is initialized like a variable" } */
+
+void h(a)
+ int a = 1; /* { dg-error "parameter 'a' is initialized" } */
+{
+ struct s x = { 0 }; /* { dg-error "variable 'x' has initializer but incomplete type" } */
+ /* { dg-warning "excess elements|near init" "excess" { target *-*-* } 12 } */
+ /* { dg-error "storage size" "size" { target *-*-* } 12 } */
+}
+
+char s[1] = "x";
+char s1[1] = { "x" };
+char t[1] = "xy"; /* { dg-warning "initializer-string for array of chars is too long" } */
+char t1[1] = { "xy" }; /* { dg-warning "initializer-string for array of chars is too long" } */
+char u[1] = { "x", "x" }; /* { dg-error "excess elements in char array initializer" } */
+/* { dg-error "near init" "near" { target *-*-* } 21 } */
+
+int i = { }; /* { dg-error "empty scalar initializer" } */
+/* { dg-error "near init" "near" { target *-*-* } 24 } */
+
+int j = { 1 };
+
+int k = { 1, 2 }; /* { dg-warning "excess elements in scalar initializer" } */
+/* { dg-warning "near init" "near" { target *-*-* } 29 } */
+
+int a1[1] = { [1] = 0 }; /* { dg-error "array index in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 32 } */
+int a2[1] = { [-1] = 0 }; /* { dg-error "array index in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 34 } */
+int a3[1] = { [0 ... 1] = 0 }; /* { dg-error "array index range in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 36 } */
+int a4[2] = { [1 ... 0] = 0 }; /* { dg-error "empty index range in initializer" } */
+/* { dg-error "near init" "near" { target *-*-* } 38 } */
+int a5[2] = { [0 ... 2] = 0 }; /* { dg-error "array index range in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 40 } */
+int a6[2] = { [-1 ... 1] = 0 }; /* { dg-error "array index in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 42 } */
+int a7[] = { [-1 ... 1] = 0 }; /* { dg-error "array index in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 44 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-2.c
new file mode 100644
index 000000000..1f0f78bc6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-2.c
@@ -0,0 +1,33 @@
+/* Test diagnostics for various bad initializers. Test cases with
+ standard syntax with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+void f(void);
+void g(void) = f; /* { dg-error "function 'g' is initialized like a variable" } */
+
+void h(a)
+ int a = 1; /* { dg-error "parameter 'a' is initialized" } */
+{
+ struct s x = { 0 }; /* { dg-error "variable 'x' has initializer but incomplete type" } */
+ /* { dg-warning "excess elements|near init" "near" { target *-*-* } 13 } */
+ /* { dg-error "storage size" "size" { target *-*-* } 13 } */
+}
+
+char s[1] = "x";
+char s1[1] = { "x" };
+char t[1] = "xy"; /* { dg-warning "initializer-string for array of chars is too long" } */
+char t1[1] = { "xy" }; /* { dg-warning "initializer-string for array of chars is too long" } */
+char u[1] = { "x", "x" }; /* { dg-error "excess elements in char array initializer" } */
+/* { dg-error "near init" "near" { target *-*-* } 22 } */
+
+int j = { 1 };
+
+int k = { 1, 2 }; /* { dg-warning "excess elements in scalar initializer" } */
+/* { dg-warning "near init" "near" { target *-*-* } 27 } */
+
+int a1[1] = { [1] = 0 }; /* { dg-error "array index in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 30 } */
+int a2[1] = { [-1] = 0 }; /* { dg-error "array index in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 32 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-3.c
new file mode 100644
index 000000000..109e65e3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-3.c
@@ -0,0 +1,33 @@
+/* Test diagnostics for various bad initializers. Test cases with
+ standard syntax with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+void f(void);
+void g(void) = f; /* { dg-error "function 'g' is initialized like a variable" } */
+
+void h(a)
+ int a = 1; /* { dg-error "parameter 'a' is initialized" } */
+{
+ struct s x = { 0 }; /* { dg-error "variable 'x' has initializer but incomplete type" } */
+ /* { dg-error "excess elements|near init" "near" { target *-*-* } 13 } */
+ /* { dg-error "storage size" "size" { target *-*-* } 13 } */
+}
+
+char s[1] = "x";
+char s1[1] = { "x" };
+char t[1] = "xy"; /* { dg-error "initializer-string for array of chars is too long" } */
+char t1[1] = { "xy" }; /* { dg-error "initializer-string for array of chars is too long" } */
+char u[1] = { "x", "x" }; /* { dg-error "excess elements in char array initializer" } */
+/* { dg-error "near init" "near" { target *-*-* } 22 } */
+
+int j = { 1 };
+
+int k = { 1, 2 }; /* { dg-error "excess elements in scalar initializer" } */
+/* { dg-error "near init" "near" { target *-*-* } 27 } */
+
+int a1[1] = { [1] = 0 }; /* { dg-error "array index in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 30 } */
+int a2[1] = { [-1] = 0 }; /* { dg-error "array index in initializer exceeds array bounds" } */
+/* { dg-error "near init" "near" { target *-*-* } 32 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-4.c
new file mode 100644
index 000000000..c8c11845c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-4.c
@@ -0,0 +1,5 @@
+/* PR c/25875 */
+/* Origin: Richard Guenther <rguenth@gcc.gnu.org> */
+/* { dg-do compile } */
+
+struct A { } a = (struct A) {{ (X)0 }}; /* { dg-error "no members|extra brace|near|undeclared|constant|compound|excess" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-5.c
new file mode 100644
index 000000000..18cee43b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-5.c
@@ -0,0 +1,5 @@
+/* PR c/28136 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int i = (struct A[]) {}; /* { dg-error "incomplete|empty|initialization" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-6.c
new file mode 100644
index 000000000..8235f5d96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-6.c
@@ -0,0 +1,12 @@
+/* ICE arising from bug computing composite type of zero-length array
+ types: PR 35433. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int* X;
+typedef int* Y;
+
+X (*p)[][0];
+Y (*q)[][0];
+
+typeof(*(0 ? p : q)) x = { 0 }; /* { dg-warning "excess elements in array initializer|near initialization" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-7.c
new file mode 100644
index 000000000..738ed6050
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-bad-7.c
@@ -0,0 +1,11 @@
+/* PR c/37724 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+struct f
+{
+ int *a;
+};
+
+char b[10];
+struct f g = {b}; /* { dg-warning "initialization from incompatible pointer type|near initialization for" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-1.c
new file mode 100644
index 000000000..52639c86b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-1.c
@@ -0,0 +1,19 @@
+/* Test obsolete forms of designated initializers. Test with default
+ warning options: valid forms are accepted, while ".member" without
+ "=" should not be (bug 16667). */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+struct s { int a; };
+struct s s0 = { .a = 1 };
+struct s s1 = { a: 1 };
+
+int x0[] = { [0] = 1 };
+int x1[] = { [0] 1 };
+
+/* Invalid syntax: multiple designators without "=". */
+int x2[2][2] = { [0][0] 1 }; /* { dg-error "syntax error|parse error|expected" } */
+
+
+/* Invalid syntax: C99-style structure designator without "=". */
+struct s s2 = { .a 1 }; /* { dg-error "syntax error|parse error|expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-2.c
new file mode 100644
index 000000000..4fbd45643
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-2.c
@@ -0,0 +1,11 @@
+/* Test obsolete forms of designated initializers. Test with
+ -pedantic. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+struct s { int a; };
+struct s s0 = { .a = 1 };
+struct s s1 = { a: 1 }; /* { dg-warning "obsolete use of designated initializer with ':'" } */
+
+int x0[] = { [0] = 1 };
+int x1[] = { [0] 1 }; /* { dg-warning "obsolete use of designated initializer without '='" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-3.c
new file mode 100644
index 000000000..e3fca6cdd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-desig-obs-3.c
@@ -0,0 +1,11 @@
+/* Test obsolete forms of designated initializers. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+struct s { int a; };
+struct s s0 = { .a = 1 };
+struct s s1 = { a: 1 }; /* { dg-error "obsolete use of designated initializer with ':'" } */
+
+int x0[] = { [0] = 1 };
+int x1[] = { [0] 1 }; /* { dg-error "obsolete use of designated initializer without '='" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-1.c
new file mode 100644
index 000000000..39a5174ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-1.c
@@ -0,0 +1,9 @@
+/* Test diagnostic for empty initializer braces. Test with no special
+ options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+struct s { int a; } x = { };
+
+struct s *p = &(struct s){ };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-2.c
new file mode 100644
index 000000000..597d72d37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-2.c
@@ -0,0 +1,9 @@
+/* Test diagnostic for empty initializer braces. Test with
+ -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+struct s { int a; } x = { }; /* { dg-warning "ISO C forbids empty initializer braces" } */
+
+struct s *p = &(struct s){ }; /* { dg-warning "ISO C forbids empty initializer braces" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-3.c
new file mode 100644
index 000000000..136931867
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-empty-3.c
@@ -0,0 +1,9 @@
+/* Test diagnostic for empty initializer braces. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+struct s { int a; } x = { }; /* { dg-error "ISO C forbids empty initializer braces" } */
+
+struct s *p = &(struct s){ }; /* { dg-error "ISO C forbids empty initializer braces" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-excess-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-excess-1.c
new file mode 100644
index 000000000..ade6fd085
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-excess-1.c
@@ -0,0 +1,48 @@
+/* Test for various cases of excess initializers for empty objects:
+ bug 21873. Various versions of GCC ICE, hang or loop repeating
+ diagnostics on various of these tests. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s0 { };
+struct s1 { int a; };
+struct s2 { int a; int b; };
+
+int a0[0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+int a1[0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+int a2[0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+int a3[1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+int a4[][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+int a5[][0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+int a6[][0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+int a7[][1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+
+struct s0 b0[0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b1[0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b2[0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b3[1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b4[][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b5[][0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b6[][0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b7[][1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b8[1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s0 b9[] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+
+struct s1 c0[0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s1 c1[0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s1 c2[0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s1 c3[1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s1 c4[][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s1 c5[][0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s1 c6[][0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s1 c7[][1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+
+struct s2 d0[0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s2 d1[0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s2 d2[0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s2 d3[1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s2 d4[][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s2 d5[][0][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s2 d6[][0][1] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
+struct s2 d7[][1][0] = { 1, 2 }; /* { dg-warning "excess elements|near init" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-string-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-string-1.c
new file mode 100644
index 000000000..ace3b3456
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-string-1.c
@@ -0,0 +1,59 @@
+/* String initializers for arrays must not be parenthesized. Bug
+ 11250 from h.b.furuseth at usit.uio.no. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+#include <stddef.h>
+
+char *a = "a";
+char *b = ("b");
+char *c = (("c"));
+
+char d[] = "d";
+char e[] = ("e"); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 14 } */
+char f[] = (("f")); /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 16 } */
+
+signed char g[] = { "d" };
+unsigned char h[] = { ("e") }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 20 } */
+signed char i[] = { (("f")) }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 22 } */
+
+
+struct s { char a[10]; int b; wchar_t c[10]; };
+
+struct s j = {
+ "j",
+ 1,
+ (L"j")
+}; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 32 } */
+struct s k = {
+ (("k")), /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 35 } */
+ 1,
+ L"k"
+};
+
+struct s l = {
+ .c = (L"l"), /* { dg-bogus "warning" "warning in place of error" } */
+ /* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 42 } */
+ .a = "l"
+};
+
+struct s m = {
+ .c = L"m",
+ .a = ("m")
+}; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 50 } */
+
+char *n = (char []){ "n" };
+
+char *o = (char []){ ("o") }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 55 } */
+
+wchar_t *p = (wchar_t [5]){ (L"p") }; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "parenthesized|near init" "paren array" { target *-*-* } 58 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-string-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-string-2.c
new file mode 100644
index 000000000..9efd44b3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-string-2.c
@@ -0,0 +1,57 @@
+/* Character arrays but not arrays of compatible enum type may be
+ initialized by narrow string literals. Arrays of type compatible
+ with wchar_t, including compatible enums, may be initialized by
+ wide string literals. Use -fshort-enums -fshort-wchar so the
+ relevant circumstances can be obtained portably; may still fail if
+ char, short and int do not all have distinct precisions. */
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-std=c99 -pedantic-errors -fshort-enums -fshort-wchar" } */
+
+#include <limits.h>
+#include <stddef.h>
+
+typedef enum { schar_min = SCHAR_MIN, schar_max = SCHAR_MAX } schar;
+typedef enum { uchar_max = UCHAR_MAX } uchar;
+typedef enum { shrt_min = SHRT_MIN, shrt_max = SHRT_MAX } sshrt;
+typedef enum { ushrt_max = USHRT_MAX } ushrt;
+
+char a0[] = "foo";
+const signed char a2[4] = "foo";
+volatile unsigned char a3[3] = "foo";
+wchar_t a4[] = L"foo";
+const wchar_t a5[3] = L"foo";
+volatile ushrt a6[] = L"foo";
+
+schar a7[] = "foo"; /* { dg-error "string constant" "a7" } */
+uchar a8[] = "foo"; /* { dg-error "string constant" "a8" } */
+const schar a9[] = "foo"; /* { dg-error "string constant" "a9" } */
+short a10[] = L"foo"; /* { dg-error "string constant" "a10" } */
+const sshrt a11[] = L"foo"; /* { dg-error "string constant" "a11" } */
+char a12[] = L"foo"; /* { dg-error "from wide string" "a12" } */
+wchar_t a13[] = "foo"; /* { dg-error "non-wide string" "a13" } */
+
+char b0[] = { "foo" };
+const signed char b2[4] = { "foo" };
+volatile unsigned char b3[3] = { "foo" };
+wchar_t b4[] = { L"foo" };
+const wchar_t b5[3] = { L"foo" };
+volatile ushrt b6[] = { L"foo" };
+
+schar b7[] = { "foo" }; /* { dg-error "string constant" "b7" } */
+uchar b8[] = { "foo" }; /* { dg-error "string constant" "b8" } */
+const schar b9[] = { "foo" }; /* { dg-error "string constant" "b9" } */
+short b10[] = { L"foo" }; /* { dg-error "string constant" "b10" } */
+const sshrt b11[] = { L"foo" }; /* { dg-error "string constant" "b11" } */
+char b12[] = { L"foo" }; /* { dg-error "from wide string" "b12" } */
+wchar_t b13[] = { "foo" }; /* { dg-error "non-wide string" "b13" } */
+
+struct s { signed char a[10]; int b; ushrt c[10]; };
+
+struct s c = { "foo", 0, L"bar" };
+struct s d = { .c = L"bar", .a = "foo" };
+
+ushrt *e = (ushrt [7]){ L"bar" };
+
+wchar_t f[5][5] = { L"foo", L"bar" };
+ushrt g[5][5] = { L"foo", L"bar" };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/init-undef-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/init-undef-1.c
new file mode 100644
index 000000000..b775889ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/init-undef-1.c
@@ -0,0 +1,8 @@
+/* Invalid initializers should not receive an "is not constant"
+ error. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int p = c; /* { dg-error "undeclared" } */
+struct s { int a; } x = { b }; /* { dg-error "undeclared" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/initpri1.c b/gcc-4.9/gcc/testsuite/gcc.dg/initpri1.c
new file mode 100644
index 000000000..794ea2b9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/initpri1.c
@@ -0,0 +1,62 @@
+/* { dg-do run { target init_priority } } */
+
+extern void abort ();
+
+int i;
+int j;
+
+void c1() __attribute__((constructor (500)));
+void c2() __attribute__((constructor (700)));
+void c3() __attribute__((constructor (600)));
+
+void c1() {
+ if (i++ != 0)
+ abort ();
+}
+
+void c2() {
+ if (i++ != 2)
+ abort ();
+}
+
+void c3() {
+ if (i++ != 1)
+ abort ();
+}
+
+void d1() __attribute__((destructor (500)));
+void d2() __attribute__((destructor (700)));
+void d3() __attribute__((destructor (600)));
+
+void d1() {
+ if (--i != 0)
+ abort ();
+}
+
+void d2() {
+ if (--i != 2)
+ abort ();
+}
+
+void d3() {
+ if (j != 2)
+ abort ();
+ if (--i != 1)
+ abort ();
+}
+
+void cd4() __attribute__((constructor (800), destructor (800)));
+
+void cd4() {
+ if (i != 3)
+ abort ();
+ ++j;
+}
+
+int main () {
+ if (i != 3)
+ return 1;
+ if (j != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/initpri2.c b/gcc-4.9/gcc/testsuite/gcc.dg/initpri2.c
new file mode 100644
index 000000000..fa9fda0d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/initpri2.c
@@ -0,0 +1,39 @@
+/* { dg-do compile { target init_priority } } */
+
+/* Priorities must be in the range [0, 65535]. */
+void c1()
+ __attribute__((constructor (-1))); /* { dg-error "priorities" } */
+void c2()
+ __attribute__((constructor (65536))); /* { dg-error "priorities" } */
+void d1()
+ __attribute__((destructor (-1))); /* { dg-error "priorities" } */
+void d2()
+ __attribute__((destructor (65536))); /* { dg-error "priorities" } */
+
+/* Priorities 0-100 are reserved for system libraries. */
+void c3()
+ __attribute__((constructor (50))); /* { dg-warning "reserved" } */
+void d3()
+ __attribute__((constructor (50))); /* { dg-warning "reserved" } */
+
+/* Priorities must be integral constants. */
+
+/* Pointers, even with constant values, are not allowed. */
+void c4()
+ __attribute__((constructor ((void*) 500))); /* { dg-error "priorities" } */
+void d4()
+ __attribute__((destructor ((void*) 500))); /* { dg-error "priorities" } */
+
+/* Integer variables are not allowed. */
+int i;
+void c5()
+ __attribute__((constructor ((i)))); /* { dg-error "priorities" } */
+void d5()
+ __attribute__((destructor ((i)))); /* { dg-error "priorities" } */
+
+/* Enumeration constants are allowed. */
+enum E { e = 500 };
+void c6()
+ __attribute__((constructor ((e))));
+void d6()
+ __attribute__((destructor ((e))));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/initpri3.c b/gcc-4.9/gcc/testsuite/gcc.dg/initpri3.c
new file mode 100644
index 000000000..1633da014
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/initpri3.c
@@ -0,0 +1,64 @@
+/* { dg-do run { target init_priority } } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -O3" } */
+
+extern void abort ();
+
+int i;
+int j;
+
+void c1() __attribute__((constructor (500)));
+void c2() __attribute__((constructor (700)));
+void c3() __attribute__((constructor (600)));
+
+void c1() {
+ if (i++ != 0)
+ abort ();
+}
+
+void c2() {
+ if (i++ != 2)
+ abort ();
+}
+
+void c3() {
+ if (i++ != 1)
+ abort ();
+}
+
+void d1() __attribute__((destructor (500)));
+void d2() __attribute__((destructor (700)));
+void d3() __attribute__((destructor (600)));
+
+void d1() {
+ if (--i != 0)
+ abort ();
+}
+
+void d2() {
+ if (--i != 2)
+ abort ();
+}
+
+void d3() {
+ if (j != 2)
+ abort ();
+ if (--i != 1)
+ abort ();
+}
+
+void cd4() __attribute__((constructor (800), destructor (800)));
+
+void cd4() {
+ if (i != 3)
+ abort ();
+ ++j;
+}
+
+int main () {
+ if (i != 3)
+ return 1;
+ if (j != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-1.c
new file mode 100644
index 000000000..4dce611d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-1.c
@@ -0,0 +1,28 @@
+/* Verify that DECL_INLINE gets copied between DECLs properly. */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+/* { dg-final { if [ istarget hppa*-*-* ] { scan-assembler-not "xyzzy?,%r" } else { scan-assembler-not "xyzzy" } } } */
+
+/* Test that declaration followed by definition inlines. */
+static inline int xyzzy0 (int);
+static int xyzzy0 (int x) { return x; }
+int test0 (void)
+{
+ return xyzzy0 (5);
+}
+
+/* Test that definition following declaration inlines. */
+static int xyzzy1 (int);
+static inline int xyzzy1 (int x) { return x; }
+int test1 (void)
+{
+ return xyzzy1 (5);
+}
+
+/* Test that redeclaration inside a function body inlines. */
+extern inline int xyzzy2 (int x) { return x; }
+int test2 (void)
+{
+ extern int xyzzy2 (int);
+ return xyzzy2 (5);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-10.c
new file mode 100644
index 000000000..f7a7592a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-10.c
@@ -0,0 +1,6 @@
+/* Test inline main, gnu99 mode, freestanding, -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -ffreestanding -pedantic-errors" } */
+
+inline int main (void) { return 1; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-11.c
new file mode 100644
index 000000000..dd07fdd11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-11.c
@@ -0,0 +1,14 @@
+/* Test misuses of inline. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* These should perhaps be hard errors, but are pedwarns at
+ present. */
+
+inline int a; /* { dg-warning "variable 'a' declared 'inline'" } */
+inline int (*b)(void); /* { dg-warning "variable 'b' declared 'inline'" } */
+typedef inline void c(void); /* { dg-warning "typedef 'c' declared 'inline'" } */
+typedef inline int d; /* { dg-warning "typedef 'd' declared 'inline'" } */
+void e(inline int f(void)); /* { dg-warning "parameter 'f' declared 'inline'" } */
+void g(inline int(void)); /* { dg-warning "parameter '\\({anonymous}\\)' declared 'inline'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-12.c
new file mode 100644
index 000000000..c28951763
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-12.c
@@ -0,0 +1,14 @@
+/* Test misuses of inline. -pedantic-errors test. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+/* These should perhaps be hard errors, but are pedwarns at
+ present. */
+
+inline int a; /* { dg-error "variable 'a' declared 'inline'" } */
+inline int (*b)(void); /* { dg-error "variable 'b' declared 'inline'" } */
+typedef inline void c(void); /* { dg-error "typedef 'c' declared 'inline'" } */
+typedef inline int d; /* { dg-error "typedef 'd' declared 'inline'" } */
+void e(inline int f(void)); /* { dg-error "parameter 'f' declared 'inline'" } */
+void g(inline int(void)); /* { dg-error "parameter '\\({anonymous}\\)' declared 'inline'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-13.c
new file mode 100644
index 000000000..62a898c3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-13.c
@@ -0,0 +1,56 @@
+/* Verify basic C99 inline functionality. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+/* { dg-final { scan-assembler-not "dontgenerate" } } */
+/* { dg-final { scan-assembler "func1" } } */
+/* { dg-final { scan-assembler "func2" } } */
+/* { dg-final { scan-assembler "func3" } } */
+/* { dg-final { scan-assembler "func4" } } */
+/* { dg-final { scan-assembler "func5" } } */
+/* { dg-final { scan-assembler "func6" } } */
+/* { dg-final { scan-assembler "func7" } } */
+/* { dg-final { scan-assembler "func8" } } */
+/* { dg-final { scan-assembler "func9" } } */
+
+inline int dontgenerate1 (void)
+{
+ return 1;
+}
+
+inline int dontgenerate2 (void);
+inline int dontgenerate2 (void)
+{
+ return 2;
+}
+
+inline int dontgenerate3 (void)
+{
+ return 3;
+}
+inline int dontgenerate3 (void);
+
+extern inline int func1 (void) { return 1; }
+
+extern inline int func2 (void);
+inline int func2 (void) { return 2; }
+
+inline int func3 (void) { return 3; }
+extern inline int func3 (void);
+
+inline int func4 (void);
+extern inline int func4 (void) { return 4; }
+
+extern inline int func5 (void) { return 5; }
+inline int func5 (void);
+
+extern int func6 (void);
+inline int func6 (void) { return 6; }
+
+inline int func7 (void) { return 7; }
+extern int func7 (void);
+
+inline int func8 (void);
+extern int func8 (void) { return 8; }
+
+extern int func9 (void) { return 9; }
+inline int func9 (void);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-14.c
new file mode 100644
index 000000000..b2bfb67c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-14.c
@@ -0,0 +1,23 @@
+/* Check that you can't redefine a C99 inline function. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+extern inline int func1 (void) /* { dg-message "note: previous definition" } */
+{
+ return 1;
+}
+
+inline int func1 (void) /* { dg-error "redefinition" } */
+{
+ return 1;
+}
+
+inline int func2 (void) /* { dg-message "note: previous definition" } */
+{
+ return 2;
+}
+
+inline int func2 (void) /* { dg-error "redefinition" } */
+{
+ return 2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-15.c
new file mode 100644
index 000000000..e66819115
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-15.c
@@ -0,0 +1,7 @@
+/* Check that an error message is produced when a C99 inline function
+ is never defined. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+extern inline int func1 (void); /* { dg-warning "never defined" } */
+inline int func2 (void); /* { dg-warning "never defined" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-16.c
new file mode 100644
index 000000000..4f9fe978b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-16.c
@@ -0,0 +1,22 @@
+/* { dg-do link } */
+/* { dg-options "-std=c99" } */
+
+static inline __SIZE_TYPE__
+func1(const volatile void * base, __SIZE_TYPE__ byteOffset)
+{
+ volatile __SIZE_TYPE__ *addr
+ = (volatile __SIZE_TYPE__ *)((__SIZE_TYPE__)base + byteOffset);
+ return *addr;
+}
+
+static inline __SIZE_TYPE__
+func2(__SIZE_TYPE__ data)
+{
+ return func1(&data, 0);
+}
+
+int main(int argc, char *argv[]) {
+ __SIZE_TYPE__ b = func2(argc);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-17.c
new file mode 100644
index 000000000..235ad8b00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-17.c
@@ -0,0 +1,24 @@
+/* Test __attribute__((gnu_inline)). */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+/* { dg-final { scan-assembler "func1" } } */
+/* { dg-final { scan-assembler-not "func2" } } */
+/* { dg-final { scan-assembler "func3" } } */
+/* { dg-final { scan-assembler "func4" } } */
+
+#if __STDC_VERSION__ >= 199901L
+# define inline __attribute__((gnu_inline)) inline
+#endif
+
+extern inline int func1 (void) { return 0; }
+inline int func1 (void) { return 1; }
+
+extern int func2 (void);
+extern inline int func2 (void) { return 2; }
+
+inline int func3 (void);
+inline int func3 (void) { return 3; }
+
+extern int func4 (void);
+extern inline int func4 (void) { return 4; }
+int func4 (void) { return 5; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-18.c
new file mode 100644
index 000000000..5a37195be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-18.c
@@ -0,0 +1,28 @@
+/* Test -fgnu89-extern-inline. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fgnu89-inline" } */
+/* { dg-final { scan-assembler "func1" } } */
+/* { dg-final { scan-assembler-not "func2" } } */
+/* { dg-final { scan-assembler "func3" } } */
+/* { dg-final { scan-assembler "func4" } } */
+
+#ifndef __GNUC_GNU_INLINE__
+#error __GNUC_GNU_INLINE__ is not defined
+#endif
+
+#ifdef __GNUC_STDC_INLINE__
+#error __GNUC_STDC_INLINE__ is defined
+#endif
+
+extern inline int func1 (void) { return 0; }
+inline int func1 (void) { return 1; }
+
+extern int func2 (void);
+extern inline int func2 (void) { return 2; }
+
+inline int func3 (void);
+inline int func3 (void) { return 3; }
+
+extern int func4 (void);
+extern inline int func4 (void) { return 4; }
+int func4 (void) { return 5; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-19.c
new file mode 100644
index 000000000..96dceb433
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-19.c
@@ -0,0 +1,28 @@
+/* Test -fgnu89-extern-inline. */
+/* { dg-do compile } */
+/* { dg-options "-fgnu89-inline" } */
+/* { dg-final { scan-assembler "func1" } } */
+/* { dg-final { scan-assembler-not "func2" } } */
+/* { dg-final { scan-assembler "func3" } } */
+/* { dg-final { scan-assembler "func4" } } */
+
+#ifndef __GNUC_GNU_INLINE__
+#error __GNUC_GNU_INLINE__ is not defined
+#endif
+
+#ifdef __GNUC_STDC_INLINE__
+#error __GNUC_STDC_INLINE__ is defined
+#endif
+
+extern inline int func1 (void) { return 0; }
+inline int func1 (void) { return 1; }
+
+extern int func2 (void);
+extern inline int func2 (void) { return 2; }
+
+inline int func3 (void);
+inline int func3 (void) { return 3; }
+
+extern int func4 (void);
+extern inline int func4 (void) { return 4; }
+int func4 (void) { return 5; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-2.c
new file mode 100644
index 000000000..6aceb7454
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-2.c
@@ -0,0 +1,18 @@
+/* Ensure that we continue to consider FOO local, even though
+ it has been deferred. */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O3 -finline-limit=0 -fpic" } */
+
+static int foo(void)
+{
+ return 3;
+}
+
+int bar(void)
+{
+ /* Call twice to avoid bypassing the limit for functions called once. */
+ return foo() + foo() + 1;
+}
+
+/* { dg-final { scan-assembler-not "PLT" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler-not "plt" { target powerpc*-*-* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-20.c
new file mode 100644
index 000000000..31354abca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-20.c
@@ -0,0 +1,64 @@
+/* Test -fno-gnu89-extern-inline. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fno-gnu89-inline" } */
+/* { dg-final { scan-assembler-not "dontgenerate" } } */
+/* { dg-final { scan-assembler "func1" } } */
+/* { dg-final { scan-assembler "func2" } } */
+/* { dg-final { scan-assembler "func3" } } */
+/* { dg-final { scan-assembler "func4" } } */
+/* { dg-final { scan-assembler "func5" } } */
+/* { dg-final { scan-assembler "func6" } } */
+/* { dg-final { scan-assembler "func7" } } */
+/* { dg-final { scan-assembler "func8" } } */
+/* { dg-final { scan-assembler "func9" } } */
+
+#ifdef __GNUC_GNU_INLINE__
+#error __GNUC_GNU_INLINE__ is defined
+#endif
+
+#ifndef __GNUC_STDC_INLINE__
+#error __GNUC_STDC_INLINE__ is not defined
+#endif
+
+inline int dontgenerate1 (void)
+{
+ return 1;
+}
+
+inline int dontgenerate2 (void);
+inline int dontgenerate2 (void)
+{
+ return 2;
+}
+
+inline int dontgenerate3 (void)
+{
+ return 3;
+}
+inline int dontgenerate3 (void);
+
+extern inline int func1 (void) { return 1; }
+
+extern inline int func2 (void);
+inline int func2 (void) { return 2; }
+
+inline int func3 (void) { return 3; }
+extern inline int func3 (void);
+
+inline int func4 (void);
+extern inline int func4 (void) { return 4; }
+
+extern inline int func5 (void) { return 5; }
+inline int func5 (void);
+
+extern int func6 (void);
+inline int func6 (void) { return 6; }
+
+inline int func7 (void) { return 7; }
+extern int func7 (void);
+
+inline int func8 (void);
+extern int func8 (void) { return 8; }
+
+extern int func9 (void) { return 9; }
+inline int func9 (void);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-21.c
new file mode 100644
index 000000000..c7f9a07b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-21.c
@@ -0,0 +1,4 @@
+/* Test -fno-gnu89-extern-inline. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -fno-gnu89-inline" } */
+/* { dg-error "only supported in GNU99 or C99 mode" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-22.c
new file mode 100644
index 000000000..1785e1ce6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-22.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-funit-at-a-time -Wno-attributes" } */
+/* Verify we can inline without a complete prototype and with promoted
+ arguments. See also PR32492. */
+__attribute__((always_inline)) void f1() {}
+__attribute__((always_inline)) void f2(char x) {}
+void f3() { f1(); f2(0); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-23.c
new file mode 100644
index 000000000..2829ecbf7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-23.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+/* Make sure we can inline a varargs function whose variable arguments
+ are not used. See PR32493. */
+#include <stddef.h>
+
+typedef __INTPTR_TYPE__ my_intptr_t;
+
+static inline __attribute__((always_inline)) void __check_printsym_format(const
+char *fmt, ...)
+{
+}
+static inline __attribute__((always_inline)) void print_symbol(const char *fmt,
+my_intptr_t addr)
+{
+ __check_printsym_format(fmt, "");
+}
+void do_initcalls(void **call)
+{
+ print_symbol(": %s()", (my_intptr_t) *call);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-24.c
new file mode 100644
index 000000000..d9758176c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-24.c
@@ -0,0 +1,28 @@
+/* Verify that gnu_inline inlines disregard inlining limits. */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern int foo (int);
+extern int baz (int);
+
+extern inline __attribute__((gnu_inline))
+int foo (int x)
+{
+ int i;
+ if (!__builtin_constant_p (x))
+ {
+#define B(n) baz (1##n) + baz (2##n) + baz (3##n) \
+ + baz (4##n) + baz (5##n) + baz (6##n)
+#define C(n) B(1##n) + B(2##n) + B(3##n) + B(4##n) + B(5##n) + B(6##n)
+#define D(n) C(1##n) + C(2##n) + C(3##n) + C(4##n) + C(5##n) + C(6##n)
+ return D(0) + D(1) + D(2) + D(3) + D(4)
+ + D(5) + D(6) + D(7) + D(8) + D(9);
+ }
+ return 0;
+}
+
+int
+main (void)
+{
+ return foo (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-25.c
new file mode 100644
index 000000000..8063d6cd5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-25.c
@@ -0,0 +1,145 @@
+/* PR c/35017 */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+static int a = 6;
+static const int b = 6;
+int c = 6;
+
+inline int
+fn1 (void)
+{
+ return a; /* { dg-error "used in inline" } */
+}
+
+inline int
+fn2 (void)
+{
+ return b; /* { dg-error "used in inline" } */
+}
+
+inline int
+fn3 (void)
+{
+ return c;
+}
+
+inline int
+fn4 (void)
+{
+ static int d = 6; /* { dg-error "declared in inline" } */
+ return d;
+}
+
+inline int
+fn5 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+inline int
+fn6 (void)
+{
+ int f = 6;
+ return f;
+}
+
+inline int
+fn7 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
+
+extern inline int
+fn8 (void)
+{
+ return a;
+}
+
+extern inline int
+fn9 (void)
+{
+ return b;
+}
+
+extern inline int
+fn10 (void)
+{
+ return c;
+}
+
+extern inline int
+fn11 (void)
+{
+ static int d = 6;
+ return d;
+}
+
+extern inline int
+fn12 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+extern inline int
+fn13 (void)
+{
+ int f = 6;
+ return f;
+}
+
+extern inline int
+fn14 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
+
+static inline int
+fn15 (void)
+{
+ return a;
+}
+
+static inline int
+fn16 (void)
+{
+ return b;
+}
+
+static inline int
+fn17 (void)
+{
+ return c;
+}
+
+static inline int
+fn18 (void)
+{
+ static int d = 6;
+ return d;
+}
+
+static inline int
+fn19 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+static inline int
+fn20 (void)
+{
+ int f = 6;
+ return f;
+}
+
+static inline int
+fn21 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-26.c
new file mode 100644
index 000000000..02f78bb94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-26.c
@@ -0,0 +1,145 @@
+/* PR c/35017 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+static int a = 6;
+static const int b = 6;
+int c = 6;
+
+inline int
+fn1 (void)
+{
+ return a; /* { dg-warning "used in inline" } */
+}
+
+inline int
+fn2 (void)
+{
+ return b; /* { dg-warning "used in inline" } */
+}
+
+inline int
+fn3 (void)
+{
+ return c;
+}
+
+inline int
+fn4 (void)
+{
+ static int d = 6; /* { dg-warning "declared in inline" } */
+ return d;
+}
+
+inline int
+fn5 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+inline int
+fn6 (void)
+{
+ int f = 6;
+ return f;
+}
+
+inline int
+fn7 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
+
+extern inline int
+fn8 (void)
+{
+ return a;
+}
+
+extern inline int
+fn9 (void)
+{
+ return b;
+}
+
+extern inline int
+fn10 (void)
+{
+ return c;
+}
+
+extern inline int
+fn11 (void)
+{
+ static int d = 6;
+ return d;
+}
+
+extern inline int
+fn12 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+extern inline int
+fn13 (void)
+{
+ int f = 6;
+ return f;
+}
+
+extern inline int
+fn14 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
+
+static inline int
+fn15 (void)
+{
+ return a;
+}
+
+static inline int
+fn16 (void)
+{
+ return b;
+}
+
+static inline int
+fn17 (void)
+{
+ return c;
+}
+
+static inline int
+fn18 (void)
+{
+ static int d = 6;
+ return d;
+}
+
+static inline int
+fn19 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+static inline int
+fn20 (void)
+{
+ int f = 6;
+ return f;
+}
+
+static inline int
+fn21 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-27.c
new file mode 100644
index 000000000..0ecfbcf5a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-27.c
@@ -0,0 +1,145 @@
+/* PR c/35017 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+static int a = 6;
+static const int b = 6;
+int c = 6;
+
+inline int
+fn1 (void)
+{
+ return a;
+}
+
+inline int
+fn2 (void)
+{
+ return b;
+}
+
+inline int
+fn3 (void)
+{
+ return c;
+}
+
+inline int
+fn4 (void)
+{
+ static int d = 6;
+ return d;
+}
+
+inline int
+fn5 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+inline int
+fn6 (void)
+{
+ int f = 6;
+ return f;
+}
+
+inline int
+fn7 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
+
+extern inline int
+fn8 (void)
+{
+ return a; /* { dg-warning "used in inline" } */
+}
+
+extern inline int
+fn9 (void)
+{
+ return b; /* { dg-warning "used in inline" } */
+}
+
+extern inline int
+fn10 (void)
+{
+ return c;
+}
+
+extern inline int
+fn11 (void)
+{
+ static int d = 6; /* { dg-warning "declared in inline" } */
+ return d;
+}
+
+extern inline int
+fn12 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+extern inline int
+fn13 (void)
+{
+ int f = 6;
+ return f;
+}
+
+extern inline int
+fn14 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
+
+static inline int
+fn15 (void)
+{
+ return a;
+}
+
+static inline int
+fn16 (void)
+{
+ return b;
+}
+
+static inline int
+fn17 (void)
+{
+ return c;
+}
+
+static inline int
+fn18 (void)
+{
+ static int d = 6;
+ return d;
+}
+
+static inline int
+fn19 (void)
+{
+ static const int e = 6;
+ return e;
+}
+
+static inline int
+fn20 (void)
+{
+ int f = 6;
+ return f;
+}
+
+static inline int
+fn21 (int i)
+{
+ static const char g[10] = "abcdefghij";
+ return g[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-28.c
new file mode 100644
index 000000000..20916aef9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-28.c
@@ -0,0 +1,28 @@
+/* PR c/36507 */
+/* { dg-do run } */
+/* { dg-options "-O0 -std=gnu89" } */
+
+int
+main (void)
+{
+ int i = 2;
+ auto inline int f1 (void)
+ {
+ return i;
+ }
+ inline int f2 (void)
+ {
+ return i;
+ }
+ auto inline int f3 (void);
+ auto inline int f3 (void)
+ {
+ return i;
+ }
+ auto inline int f4 (void);
+ inline int f4 (void)
+ {
+ return i;
+ }
+ return f1 () + f2 () + f3 () + f4 () - 8;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-29.c
new file mode 100644
index 000000000..77672f342
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-29.c
@@ -0,0 +1,28 @@
+/* PR c/36507 */
+/* { dg-do run } */
+/* { dg-options "-O0 -std=gnu99" } */
+
+int
+main (void)
+{
+ int i = 2;
+ auto inline int f1 (void)
+ {
+ return i;
+ }
+ inline int f2 (void)
+ {
+ return i;
+ }
+ auto inline int f3 (void);
+ auto inline int f3 (void)
+ {
+ return i;
+ }
+ auto inline int f4 (void);
+ inline int f4 (void)
+ {
+ return i;
+ }
+ return f1 () + f2 () + f3 () + f4 () - 8;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-3.c
new file mode 100644
index 000000000..a3de19306
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-3.c
@@ -0,0 +1,47 @@
+/* { dg-options "-O2 -funit-at-a-time" } */
+/* { dg-final { scan-assembler-not "big_function_2" } } */
+static void
+big_function_2(void);
+void
+big_function_1()
+{
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ big_function_2();
+}
+static void
+big_function_2()
+{
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+ while (t());
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-30.c
new file mode 100644
index 000000000..bb9b2b477
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-30.c
@@ -0,0 +1,28 @@
+/* PR c/36507 */
+/* { dg-do run } */
+/* { dg-options "-O0 -std=gnu99 -fgnu89-inline" } */
+
+int
+main (void)
+{
+ int i = 2;
+ auto inline int f1 (void)
+ {
+ return i;
+ }
+ inline int f2 (void)
+ {
+ return i;
+ }
+ auto inline int f3 (void);
+ auto inline int f3 (void)
+ {
+ return i;
+ }
+ auto inline int f4 (void);
+ inline int f4 (void)
+ {
+ return i;
+ }
+ return f1 () + f2 () + f3 () + f4 () - 8;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-31.c
new file mode 100644
index 000000000..1d9a2212e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-31.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+inline int f (void) { return 0; }
+
+void
+g (void)
+{
+ extern int f();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-32.c
new file mode 100644
index 000000000..bfcafd5db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-32.c
@@ -0,0 +1,11 @@
+/* { dg-do link } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+/* { dg-additional-sources inline-32a.c } */
+inline int f (void) { return 0; }
+
+int
+main (void)
+{
+ extern int f();
+ return f ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-32a.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-32a.c
new file mode 100644
index 000000000..a2bde0aac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-32a.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+int f (void) { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-33.c
new file mode 100644
index 000000000..d82ff7154
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-33.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+/* { dg-add-options bind_pic_locally } */
+
+int i;
+
+int foo ();
+
+main ()
+{
+ return foo (i);
+}
+
+int foo (i)
+ int i;
+{
+ return bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "bar" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-34.c
new file mode 100644
index 000000000..f257792c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-34.c
@@ -0,0 +1,19 @@
+/* Diagnostics for bad references to static objects and functions from
+ inline definitions must take account of declarations after the
+ definition which make it not an inline definition. PR 39556. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+static int a1;
+inline int f1 (void) { return a1; }
+int f1 (void);
+
+static int a2;
+inline int f2 (void) { return a2; }
+extern inline int f2 (void);
+
+inline void f3 (void) { static int a3; }
+void f3 (void);
+
+inline void f4 (void) { static int a4; }
+extern inline void f4 (void);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-35.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-35.c
new file mode 100644
index 000000000..ebbb8df2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-35.c
@@ -0,0 +1,19 @@
+/* A function definition of an inline function following a static
+ declaration does not make an inline definition in C99/C11 terms.
+ PR 57574. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+static int n;
+
+static inline int f1 (void);
+inline int f1 (void) { return n; }
+
+static int f2 (void);
+inline int f2 (void) { return n; }
+
+static inline int f3 (void);
+int f3 (void) { return n; }
+
+static int f4 (void);
+int f4 (void) { return n; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-4.c
new file mode 100644
index 000000000..2442f2d39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-4.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "big_static_inline" } } */
+
+extern void f(void);
+static inline void big_static_inline(void)
+{
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+ f(); f(); f(); f(); f(); f(); f(); f(); f(); f();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-5.c
new file mode 100644
index 000000000..d72fad656
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-5.c
@@ -0,0 +1,13 @@
+/* PR middle-end/13448 */
+
+/* { dg-options "-O3" } */
+
+void funct (const int n)
+{
+ n++; /* { dg-error "" } */
+}
+
+int main () {
+ funct (1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-6.c
new file mode 100644
index 000000000..81d6dc220
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-6.c
@@ -0,0 +1,6 @@
+/* Test duplicate inline, gnu89 mode. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+inline inline void f (void) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-7.c
new file mode 100644
index 000000000..b239a2046
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-7.c
@@ -0,0 +1,6 @@
+/* Test duplicate inline, gnu99 mode. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+inline inline void f (void) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-8.c
new file mode 100644
index 000000000..b4c0eb840
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-8.c
@@ -0,0 +1,6 @@
+/* Test inline main, gnu99 mode, hosted. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fhosted" } */
+
+inline int main (void); /* { dg-warning "cannot inline function 'main'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline-9.c
new file mode 100644
index 000000000..c8dda5360
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline-9.c
@@ -0,0 +1,6 @@
+/* Test inline main, gnu99 mode, hosted, -pedantic-errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fhosted -pedantic-errors" } */
+
+inline int main (void); /* { dg-error "cannot inline function 'main'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline1.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline1.c
new file mode 100644
index 000000000..c660fe314
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -std=gnu89" } */
+/* This test is expected to fail with an error for the redefinition of foo.
+ This violates the constraint of 6.9#3 (no more than one external definition
+ of an identifier with internal linkage in the same translation unit). */
+static inline int foo(void) { return 1; } /* { dg-message "note: previous definition of" } */
+static inline int foo(void) { return 0; } /* { dg-error "redefinition of" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline2.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline2.c
new file mode 100644
index 000000000..ede410492
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline2.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -std=gnu89" } */
+/* This test should compile successfully. */
+extern inline int foo (void) { return 0; }
+inline int foo (void) { return 1; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline3.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline3.c
new file mode 100644
index 000000000..d7fd8dba6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -std=gnu89" } */
+/* This testcase should fail since we're redefining foo in the same
+ translation unit. */
+extern inline int foo(void) { return 0; }
+inline int foo (void) { return 1; } /* { dg-message "note: previous definition of" } */
+int foo (void) { return 2; } /* { dg-error "redefinition of" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline4.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline4.c
new file mode 100644
index 000000000..64cea7515
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline4.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -std=gnu89" } */
+/* This testcase should fail since we're redefining foo in the same
+ translation unit. */
+int foo (void) { return 2; } /* { dg-message "note: previous definition of" } */
+extern inline int foo (void) { return 1; } /* { dg-error "redefinition of" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline5.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline5.c
new file mode 100644
index 000000000..40fb7cd91
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline5.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -std=gnu89" } */
+/* This testcase should fail since we're redefining foo in the same
+ translation unit. */
+extern inline int foo (void) { return 2; } /* { dg-message "note: previous definition of" } */
+extern inline int foo (void) { return 1; } /* { dg-error "redefinition of" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline6.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline6.c
new file mode 100644
index 000000000..3b9e3e99e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline6.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+static int i;
+extern int j;
+extern inline int func1 (void) {
+ return i++; /* { dg-warning "static" } */
+}
+extern inline int func2 (void) {
+ return j++;
+}
+inline int func3 (void)
+{
+ return i++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline7.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline7.c
new file mode 100644
index 000000000..54f3360b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline7.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+extern inline void func1 (void) {
+ static int i; /* { dg-warning "static" } */
+}
+inline void func3 (void)
+{
+ static int i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline_1.c
new file mode 100644
index 000000000..030138171
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline_1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline -fdisable-ipa-inline -Wno-attributes" } */
+int g;
+__attribute__((always_inline)) void bar (void)
+{
+ g++;
+}
+
+int foo (void)
+{
+ bar ();
+ return g;
+}
+
+int foo2 (void)
+{
+ bar();
+ return g + 1;
+}
+
+/* { dg-final { scan-tree-dump-times "bar" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline_2.c
new file mode 100644
index 000000000..e3b1df446
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline_2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=0:100 -fdisable-ipa-inline -Wno-attributes" } */
+int g;
+__attribute__((always_inline)) void bar (void)
+{
+ g++;
+}
+
+int foo (void)
+{
+ bar ();
+ return g;
+}
+
+int foo2 (void)
+{
+ bar();
+ return g + 1;
+}
+
+/* { dg-final { scan-tree-dump-times "bar" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline_3.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline_3.c
new file mode 100644
index 000000000..773c301a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline_3.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=foo,foo2 -fdisable-ipa-inline -Wno-attributes" } */
+int g;
+__attribute__((always_inline)) void bar (void)
+{
+ g++;
+}
+
+int foo (void)
+{
+ bar ();
+ return g;
+}
+
+int foo2 (void)
+{
+ bar();
+ return g + 1;
+}
+
+/* { dg-final { scan-tree-dump-times "bar" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/inline_4.c b/gcc-4.9/gcc/testsuite/gcc.dg/inline_4.c
new file mode 100644
index 000000000..dd4fadb48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/inline_4.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdisable-tree-einline=foo2 -fdisable-ipa-inline -Wno-attributes" } */
+int g;
+__attribute__((always_inline)) void bar (void)
+{
+ g++;
+}
+
+int foo (void)
+{
+ bar ();
+ return g;
+}
+
+int foo2 (void)
+{
+ bar();
+ return g + 1;
+}
+
+/* { dg-final { scan-tree-dump-times "bar" 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/instrument-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/instrument-1.c
new file mode 100644
index 000000000..1e2d8acc6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/instrument-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-finstrument-functions" } */
+
+void fn () { }
+
+/* { dg-final { scan-assembler "__cyg_profile_func_enter" } } */
+/* { dg-final { scan-assembler "__cyg_profile_func_exit" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/instrument-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/instrument-2.c
new file mode 100644
index 000000000..297a02da6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/instrument-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-finstrument-functions -finstrument-functions-exclude-function-list=fn" } */
+
+void fn () { }
+
+/* { dg-final { scan-assembler-not "__cyg_profile_func_enter" } } */
+/* { dg-final { scan-assembler-not "__cyg_profile_func_exit" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/instrument-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/instrument-3.c
new file mode 100644
index 000000000..c1a9c2a81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/instrument-3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-finstrument-functions -finstrument-functions-exclude-file-list=instrument-3" } */
+
+void fn () { }
+
+/* { dg-final { scan-assembler-not "__cyg_profile_func_enter" } } */
+/* { dg-final { scan-assembler-not "__cyg_profile_func_exit" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/intermod-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/intermod-1.c
new file mode 100644
index 000000000..9f8d19deb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/intermod-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-final { scan-assembler-not {foo[1-9]\.[0-9]} } } */
+
+/* Check that we don't get .0 suffixes on static variables when not using
+ intermodule analysis. */
+
+static int foo1;
+static int foo2 = 1;
+
+static void foo5(void) { }
+static void foo6(void);
+static void foo6(void) { }
+static void foo7(void);
+void foo7(void) { }
+
+void foo9(void)
+{
+ foo1 = 2;
+ foo2 = 3;
+ foo5();
+ foo6();
+ foo7();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/intmax_t-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/intmax_t-1.c
new file mode 100644
index 000000000..00b503c25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/intmax_t-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+/* { dg-error "" "" { target { { *arm*-*-*elf* xtensa*-*-elf* } || vxworks_kernel } } 0 } */
+
+/* Compile with -Wall to get a warning if built-in and system intmax_t don't
+ match. */
+
+#include <inttypes.h>
+
+__INTMAX_TYPE__ __im_t__;
+__UINTMAX_TYPE__ __uim_t__;
+intmax_t *im_t_p;
+uintmax_t *uim_t_p;
+
+void
+imt (void)
+{
+ im_t_p = &__im_t__;
+}
+
+void
+uimt (void)
+{
+ uim_t_p = &__uim_t__;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/invalid-call-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/invalid-call-1.c
new file mode 100644
index 000000000..7a2f6a07b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/invalid-call-1.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/29841 */
+/* Testcase by Khem Raj <raj.khem@gmail.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+typedef void (*fp)(void);
+extern char* bar(void* a1, int a2);
+extern char* mar(int n);
+char* cptr;
+
+void foo()
+{
+ cptr = mar(6);
+ ((char *(*)(void *,int (*)(void *,unsigned char **),char**))((fp)bar))(0,0,(void*)(0)); /* { dg-warning "function called through a non-compatible type" "non-compatible type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c
new file mode 100644
index 000000000..bb8e7aff2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ctor-empty-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-cgraph" } */
+static __attribute__((constructor))
+void empty_constructor()
+{
+}
+/* { dg-final { scan-ipa-dump "Reclaiming functions: empty_constructor" "cgraph" } } */
+/* { dg-final { cleanup-ipa-dump "cgraph" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-1.c
new file mode 100644
index 000000000..860b3e572
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-1.c
@@ -0,0 +1,27 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+
+extern void non_existent(int);
+
+static void hooray ()
+{
+ non_existent (1);
+}
+
+static void hiphip (void (*f)())
+{
+ non_existent (2);
+ f ();
+}
+
+int test (void)
+{
+ hiphip (hooray);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "indirect_call" "inline" } } */
+/* { dg-final { scan-ipa-dump "hooray\[^\\n\]*inline copy in test" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-2.c
new file mode 100644
index 000000000..117818d16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-2.c
@@ -0,0 +1,41 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */
+
+extern void non_existent(int);
+
+int __attribute__ ((noinline,noclone)) get_input(void)
+{
+ return 1;
+}
+
+static void hooray ()
+{
+ non_existent (1);
+}
+
+static void hip2 (void (*g)())
+{
+ non_existent (2);
+ g ();
+}
+
+static void hip1 (void (*f)(void (*)()), void (*g)())
+{
+ non_existent (2);
+ f (g);
+}
+
+int main (int argc, int *argv[])
+{
+ int i;
+
+ for (i = 0; i < get_input (); i++)
+ hip1 (hip2, hooray);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "hooray\[^\\n\]*inline copy in main" "inline" } } */
+/* { dg-final { scan-ipa-dump "hip2\[^\\n\]*inline copy in main" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-3.c
new file mode 100644
index 000000000..b39957162
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-3.c
@@ -0,0 +1,33 @@
+/* Verify that call declarations are not redirected according to indirect
+ inlining edges too early. */
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-early-inlining" } */
+
+extern void abort (void);
+
+int bar (int k)
+{
+ return k+2;
+}
+
+int baz (int k)
+{
+ return k+1;
+}
+
+static int foo (int (*p)(int), int i)
+{
+ return p (i+1);
+}
+
+int (*g)(int) = baz;
+
+int main (int argc, char *argv[])
+{
+ if (foo (bar, 0) != 3)
+ abort ();
+ if (foo (g, 1) != 3)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-4.c
new file mode 100644
index 000000000..71faae2c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-4.c
@@ -0,0 +1,221 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining" } */
+
+struct S
+{
+ int i;
+ void (*f)(struct S *);
+ unsigned u;
+};
+
+struct U
+{
+ struct U *next;
+ struct S s;
+ short a[8];
+};
+
+extern void non_existent(struct S *p, int);
+
+/* ----- 1 ----- */
+
+static void hooray1 (struct S *p)
+{
+ non_existent (p, 1);
+}
+
+static void hiphip1 (struct S *p)
+{
+ p->f (p);
+}
+
+int test1 (void)
+{
+ struct S s;
+ s.i = 1234;
+ s.f = hooray1;
+ s.u = 1001;
+ hiphip1 (&s);
+ return 0;
+}
+
+/* ----- 2 ----- */
+
+struct S *gp;
+
+static void hooray2 (struct S *p)
+{
+ non_existent (p, 2);
+}
+
+static void hip2 (struct S *p)
+{
+ p->f (p);
+}
+
+static void hiphip2 (struct S *p)
+{
+ hip2 (p);
+}
+
+int test2 (void)
+{
+ struct S *p = gp;
+ p->i = 2341;
+ p->f = hooray2;
+ p->u = 1002;
+ hiphip2 (p);
+ return 0;
+}
+
+/* ----- 3 ----- */
+
+static void hooray3 (struct S *p)
+{
+ non_existent (p, 2);
+}
+
+static void hip3 (struct S *p)
+{
+ p->f (p);
+}
+
+static __attribute__ ((flatten)) void hiphip3 (struct S *p)
+{
+ hip3 (p);
+}
+
+int test3 (void)
+{
+ struct S *p = gp;
+ p->i = 2341;
+ p->f = hooray3;
+ p->u = 1003;
+ hiphip3 (p);
+ return 0;
+}
+
+/* ----- 4 ----- */
+
+static void hooray4 (struct S *p)
+{
+ non_existent (p, 3);
+}
+
+static void hiphip4 (struct S s)
+{
+ s.f (&s);
+}
+
+int test4(void)
+{
+ struct S s;
+ s.i = 3412;
+ s.f = hooray4;
+ s.u = 1004;
+ hiphip4 (s);
+ return 0;
+}
+
+/* ----- 5 ----- */
+
+struct U *gu;
+
+static void hooray5 (struct S *p)
+{
+ non_existent (p, 5);
+}
+
+static void hip5 (struct S *p)
+{
+ p->f (p);
+}
+
+static void hiphip5 (struct U *u)
+{
+ hip5 (&u->s);
+}
+
+int test5 (void)
+{
+ struct U *u = gu;
+ u->next = u;
+ u->s.i = 9876;
+ u->s.f = hooray5;
+ u->s.u = 1005;
+ hiphip5 (u);
+ return 0;
+}
+
+/* ----- 6 ----- */
+
+static void hooray6 (struct S *p)
+{
+ non_existent (p, 6);
+}
+
+static void hip6 (struct S *p)
+{
+ p->f (p);
+}
+
+static __attribute__ ((flatten)) void hiphip6 (struct U *u)
+{
+ hip6 (&u->s);
+}
+
+int test6 (void)
+{
+ struct U *u = gu;
+ u->next = u;
+ u->s.i = 9876;
+ u->s.f = hooray6;
+ u->s.u = 1006;
+ hiphip6 (u);
+ return 0;
+}
+
+/* ----- 7 ----- */
+
+struct S **gdp;
+
+
+static void hooray7 (struct S *p)
+{
+ non_existent (p, 7);
+}
+
+static void hip7 (struct S *p)
+{
+ p->f (p);
+ gdp = &p;
+}
+
+static void hiphip7 (struct S *p)
+{
+ hip7 (p);
+ gdp = &p;
+}
+
+int test7 (void)
+{
+ struct S *p = gp;
+ p->i = 7341;
+ p->f = hooray7;
+ p->u = 1007;
+ hiphip7 (p);
+ return 0;
+}
+
+
+
+/* { dg-final { scan-ipa-dump "hooray1\[^\\n\]*inline copy in test1" "inline" } } */
+/* { dg-final { scan-ipa-dump "hooray2\[^\\n\]*inline copy in test2" "inline" } } */
+/* { dg-final { scan-ipa-dump "hooray3\[^\\n\]*inline copy in test3" "inline" } } */
+/* { dg-final { scan-ipa-dump "hooray4\[^\\n\]*inline copy in test4" "inline" { xfail { { hppa*-*-* } && { ! lp64 } } } } } */
+/* { dg-final { scan-ipa-dump "hooray5\[^\\n\]*inline copy in test5" "inline" } } */
+/* { dg-final { scan-ipa-dump "hooray6\[^\\n\]*inline copy in test6" "inline" } } */
+/* { dg-final { scan-ipa-dump "hooray7\[^\\n\]*inline copy in test7" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-5.c
new file mode 100644
index 000000000..8fb47caff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-5.c
@@ -0,0 +1,124 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do run } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining" } */
+
+extern void abort (void);
+
+struct S
+{
+ int i;
+ void (*f)(struct S *);
+ int j,k,l;
+};
+
+struct Z
+{
+ unsigned u;
+ void (*f)(struct Z *, int);
+ struct Z *next;
+};
+
+static struct Z *gz;
+static struct S *gs;
+static int gr = 111;
+char gc[1024];
+
+static __attribute__ ((noinline, noclone)) struct S *
+get_s (void)
+{
+ return (struct S *) &gc;
+}
+
+
+static void wrong_target_1 (struct S *s)
+{
+ abort ();
+}
+
+static void wrong_target_2 (struct S *s)
+{
+ abort ();
+}
+
+static void wrong_target_3 (struct S *s)
+{
+ abort ();
+}
+
+static void good_target (struct Z *z, int i)
+{
+ gr = 0;
+}
+
+static void good_target_3 (struct S *s)
+{
+ gr = 0;
+}
+
+static void g1 (struct S *s)
+{
+ struct Z *z = (struct Z*) s;
+ z->f (z, 8);
+}
+
+static void f1 (struct S *s)
+{
+ gz->f = good_target;
+ g1 (s);
+}
+
+static void g2 (struct Z *z)
+{
+ z->f (z, 8);
+}
+
+static void f2 (struct S *s)
+{
+ gz->f = good_target;
+ g2 ((struct Z*) s);
+}
+
+static void g3 (struct S *s)
+{
+ s->f (s);
+}
+
+static void h3 (struct Z *z)
+{
+ gs->f = good_target_3;
+ g3 ((struct S *) z);
+}
+
+static void f3 (struct S *s)
+{
+ h3 ((struct Z*) s);
+}
+
+int main (int argc, char **argv)
+{
+ struct S *s = get_s();
+ s->i = 5678;
+ s->f = wrong_target_1;
+ s->j = 1234;
+ gz = (struct Z *) s;
+ f1 (s);
+
+ s = get_s();
+ gz = (struct Z *) s;
+ s->i = 9999;
+ s->f = wrong_target_1;
+ f2 (s);
+
+ s = get_s();
+ gs = s;
+ s->i = 9999;
+ s->f = wrong_target_3;
+ f3 (s);
+
+ return gr;
+}
+
+
+/* { dg-final { scan-ipa-dump-not "wrong_target\[^\\n\]*inline copy in" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-6.c
new file mode 100644
index 000000000..5a9b759d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-6.c
@@ -0,0 +1,72 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do run } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining" } */
+
+extern void abort (void);
+
+struct S
+{
+ int i;
+ void (*f)(struct S *);
+ int j,k,l;
+};
+
+struct Z
+{
+ unsigned u;
+ void (*f)(struct Z *, int);
+ struct Z *next;
+};
+
+static struct S *gs;
+static int gr = 111;
+char gc[1024];
+
+static __attribute__ ((noinline, noclone)) struct S *
+get_s (void)
+{
+ return (struct S *) &gc;
+}
+
+static void wrong_target (struct S *s)
+{
+ abort ();
+}
+
+static void good_target (struct S *s)
+{
+ gr = 0;
+}
+
+static void g1 (struct S *s)
+{
+ s->f (s);
+}
+
+static void f2 (struct Z *z)
+{
+ gs->f = good_target;
+ g1 ((struct S *) z);
+}
+
+static inline __attribute__ ((flatten)) void f1 (struct S *s)
+{
+ f2 ((struct Z *) s);
+}
+
+int main (int argc, char **argv)
+{
+ struct S *s = get_s();
+ s->i = 5678;
+ s->f = wrong_target;
+ s->j = 1234;
+ gs = s;
+ f1 (s);
+
+ return gr;
+}
+
+
+/* { dg-final { scan-ipa-dump-not "wrong_target\[^\\n\]*inline copy in" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-7.c
new file mode 100644
index 000000000..c95d374d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/iinline-7.c
@@ -0,0 +1,157 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do run } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining" } */
+
+extern void abort (void);
+
+struct S
+{
+ int i;
+ void (*f)(struct S *);
+ int j,k,l;
+};
+
+struct U
+{
+ struct U *next;
+ struct S s;
+ short a[8];
+};
+
+struct Z
+{
+ unsigned u;
+ void (*f)(struct Z *, int);
+ struct Z *next;
+};
+
+static struct Z *gz;
+static struct U *gu;
+static int gr = 111;
+char gc[1024];
+
+static __attribute__ ((noinline, noclone)) struct U *
+get_u (void)
+{
+ return (struct U *) &gc;
+}
+
+static void wrong_target_1 (struct S *s)
+{
+ abort ();
+}
+
+static void wrong_target_2 (struct S *s)
+{
+ abort ();
+}
+
+static void wrong_target_3 (struct S *s)
+{
+ abort ();
+}
+
+static void wrong_target_4 (struct S *s)
+{
+ abort ();
+}
+
+static void good_target (struct Z *z, int i)
+{
+ gr = 0;
+}
+
+static void good_target_4 (struct S *s)
+{
+ gr = 0;
+}
+
+static void g1 (struct S *s)
+{
+ struct Z *z = (struct Z*) s;
+ z->f (z, 8);
+}
+
+static void f1 (struct U *u)
+{
+ gz->f = good_target;
+ g1 (&u->s);
+}
+
+static void g2 (struct Z *z)
+{
+ z->f (z, 8);
+}
+
+static void f2 (struct U *u)
+{
+ gz->f = good_target;
+ g2 ((struct Z*) &u->s);
+}
+
+static void h3 (struct Z *z)
+{
+ z->f (z, 8);
+}
+
+static void g3 (struct S *s)
+{
+ h3 ((struct Z*) s);
+}
+
+static void f3 (struct U *u)
+{
+ gz->f = good_target;
+ g3 (&u->s);
+}
+
+static void h4 (struct S *s)
+{
+ s->f (s);
+}
+
+static void g4 (struct U *u)
+{
+ h4 (&u->s);
+}
+
+static inline __attribute__ ((flatten)) void f4 (struct Z *z)
+{
+ gu->s.f = good_target_4;
+ g4 ((struct U *) z);
+}
+
+int main (int argc, char **argv)
+{
+ struct U *u = get_u ();
+ u->next = u;
+ u->s.i = 5678;
+ u->s.f = wrong_target_1;
+ u->s.j = 1234;
+ gz = (struct Z *) &u->s;
+ f1 (u);
+
+ u = get_u();
+ u->s.i = 9999;
+ u->s.f = wrong_target_2;
+ gz = (struct Z *) &u->s;
+ f2 (u);
+
+ u = get_u();
+ u->s.i = 9998;
+ u->s.f = wrong_target_3;
+ gz = (struct Z *) &u->s;
+ f3 (u);
+
+ u = get_u();
+ u->s.i = 9998;
+ u->s.f = wrong_target_4;
+ gu = u;
+ f4 ((struct Z *) u);
+ return gr;
+}
+
+
+/* { dg-final { scan-ipa-dump-not "wrong_target\[^\\n\]*inline copy in" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-1.c
new file mode 100644
index 000000000..c662682a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-1.c
@@ -0,0 +1,37 @@
+/* Verify that analysis of function parameters works as expected. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline" } */
+struct bah {int a,b,c,d,e;};
+static struct bah bah3={2,3,4,5,6};
+const static struct bah bah4={2,3,4,5,6};
+void test (int, struct bah *, struct bah, struct bah, int, struct bah, struct bah, struct bah);
+void foo (int invariant, struct bah invariant2)
+{
+ int i;
+ struct bah bah2={1,2,3,4,5};
+ struct bah bah5={1,2,3,4,5};
+ for (i = 0; i<10; i++)
+ {
+ bah5.a=i;
+ test (i, &bah2, bah2, bah3, invariant, invariant2, bah4, bah5);
+ }
+}
+/* op0 change on every invocation. */
+/* op1 is function invariant. */
+/* { dg-final { scan-ipa-dump-not "op0 is compile time invariant" "inline" } } */
+/* { dg-final { scan-ipa-dump-not "op0 change" "inline" } } */
+/* { dg-final { scan-ipa-dump "op1 is compile time invariant" "inline" } } */
+/* op2 is invariant within loop (we make assumption that function call does not afect it.). */
+/* { dg-final { scan-ipa-dump "op2 change 10.000000. of time" "inline" } } */
+/* op3 is invariant within loop (we make assumption that function call does not afect it.). */
+/* { dg-final { scan-ipa-dump "op3 change 10.000000. of time" "inline" } } */
+/* op4 is invariant within loop. */
+/* { dg-final { scan-ipa-dump "op4 change 10.000000. of time" "inline" } } */
+/* op5 is invariant within loop. */
+/* { dg-final { scan-ipa-dump "op5 change 10.000000. of time" "inline" } } */
+/* op6 is compile time invariant. */
+/* { dg-final { scan-ipa-dump "op6 is compile time invariant" "inline" } } */
+/* op7 change. */
+/* { dg-final { scan-ipa-dump-not "op7 is compile time invariant" "inline" } } */
+/* { dg-final { scan-ipa-dump-not "op7 change" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-2.c
new file mode 100644
index 000000000..376cf97e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-2.c
@@ -0,0 +1,33 @@
+/* Verify that logic combining probabilities works as expected. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
+
+struct bah {int a,b,d;};
+
+__attribute__ ((noinline))
+void test(int a,int b,int c,int d,int e)
+{
+ test3(a,b,c,d,e);
+}
+inline
+static void bar (int parm1, int parm2)
+{
+ int i;
+ for (i = 0; i<10; i++)
+ {
+ test (0,0,parm1,parm2,i);
+ }
+}
+void foo (int invariant)
+{
+ int i;
+ for (i = 0; i<10; i++)
+ {
+ bar (i, invariant);
+ }
+}
+/* After inlining bar into foo, op2 is invariant within inner loop. */
+/* { dg-final { scan-ipa-dump "op2 change 10.000000. of time" "inline" } } */
+/* After inlining bar into foo, op3 is invariant within both loops. */
+/* { dg-final { scan-ipa-dump "op3 change 1.000000. of time" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-3.c
new file mode 100644
index 000000000..d97f0c654
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-3.c
@@ -0,0 +1,25 @@
+/* Verify that do_work is detected as being loop invariant. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining" } */
+
+struct bah {int a,b,d;};
+
+static int do_work (struct bah s)
+{
+ return s.a*s.b/s.d;
+}
+int foo (int invariant)
+{
+ int i;
+ struct bah s = {invariant,invariant,invariant};
+ int sum = 0;
+ for (i = 0; i<10; i++)
+ {
+ sum += do_work (s);
+ }
+ return sum;
+}
+
+
+/* { dg-final { scan-ipa-dump "Scaling time by probability:0.100000" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-4.c
new file mode 100644
index 000000000..66019b30f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-4.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -c -fdump-ipa-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+
+void do_something (int shall_i_work)
+{
+ if (shall_i_work)
+ {
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ work_hard ();
+ }
+}
+int foo (int invariant)
+{
+ do_something (0);
+ do_something (1);
+}
+
+
+/* We should inline do_something(0), but not do_something (1). */
+/* { dg-final { scan-ipa-dump "Inlined 1 calls, eliminated 0 functions" "inline" } } */
+/* Call to work_hard should be detected as optimized out. */
+/* { dg-final { scan-ipa-dump-times "predicate: .false." 8 "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-5.c
new file mode 100644
index 000000000..d4b74104c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-5.c
@@ -0,0 +1,36 @@
+/* Check statements that are eliminated by inlining. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+struct a {int a,b,c,d,e;};
+
+void
+accessfield (struct a a)
+{
+ t(a.a);
+ /* Should compile as:
+ tmp = a.a
+ Will be eliminated by inlining
+ t (tmp); */
+ t2(&a);
+ t(a.a);
+ return;
+ /* Will be eliminated by inlining */
+}
+void
+accessreference (struct a *a)
+{
+ t(a->a);
+ /* Should compile as:
+ a.0_1 = a;
+ Will be eliminated by inlining
+ tmp = a.0_1->a;
+ 50% will be eliminated by inlining
+ t (tmp) */
+ t2(&a);
+ return;
+ /* Will be eliminated by inlining */
+}
+
+/* { dg-final { scan-ipa-dump-times "Will be eliminated" 4 "inline" { xfail { { hppa*-*-* } && { ! lp64 } } } } } */
+/* { dg-final { scan-ipa-dump-times "50. will be eliminated" 1 "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-6.c
new file mode 100644
index 000000000..d981bb006
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inline-6.c
@@ -0,0 +1,42 @@
+/* Check statements that are eliminated by inlining. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-inline-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
+static t(int a)
+{
+ if (a==1)
+ {
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo(); foo();
+ }
+ else if (a==2)
+ {
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar();
+ }
+ else
+ {
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr(); bagr();
+ }
+}
+main()
+{
+ t(1);
+ t(2);
+}
+/* Even if function is huge, inlining it will save code. */
+/* { dg-final { scan-ipa-dump-times "Inlined into" 2 "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c
new file mode 100644
index 000000000..9810e25c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-1.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+test (int a)
+{
+ int i;
+ for (i=0; i<a; i++)
+{
+ test2(a);
+ test2(a);
+}
+}
+m()
+{
+ test (10);
+}
+/* { dg-final { scan-ipa-dump "loop_iterations" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c
new file mode 100644
index 000000000..a06d72556
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-2.c
@@ -0,0 +1,13 @@
+/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+t(int s, void **p)
+{
+ int i;
+ for (i;i<10000;i+=s)
+ p[i]=0;
+}
+m(void **p)
+{
+ t (10, p);
+}
+/* { dg-final { scan-ipa-dump "loop_stride" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
new file mode 100644
index 000000000..110ae443c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/inlinehint-3.c
@@ -0,0 +1,37 @@
+/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
+void abort (void);
+int sum;
+int a[10];
+int
+scc_next (int c)
+{
+ int i;
+ for (i=0;i<c;i++)
+ a[i]=c;
+ scc_entry (c);
+}
+int
+scc_entry (int c)
+{
+ int i;
+ for (i=0;i<c;i++)
+ sum+=a[i];
+ if (c--)
+ scc_next (c);
+ return sum;
+}
+main()
+{
+ int sum;
+ int i;
+ for (i=0;i<10;i++)
+ scc_entry (i);
+ if (sum < 0)
+ abort ();
+ return 0;
+}
+/* { dg-final { scan-ipa-dump "in_scc" "inline" } } */
+/* { dg-final { scan-ipa-dump "same_scc" "inline" } } */
+/* Main is not in scc, the two functions are. */
+/* { dg-final { scan-ipa-dump-times "In SCC" 2 "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-1.c
new file mode 100644
index 000000000..3cc32da1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-1.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+#include <stdio.h>
+int g (int b, int c)
+{
+ printf ("%d %d\n", b, c);
+}
+int f (int a)
+{
+ /* Second parameter of g gets different values. */
+ if (a > 0)
+ g (a, 3);
+ else
+ g (a, 5);
+}
+int main ()
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 a with const 7" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-2.c
new file mode 100644
index 000000000..7f14d42a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+#include <stdio.h>
+int g (int b, int c)
+{
+ printf ("%d %d\n", b, c);
+}
+int f (int a)
+{
+ /* a is modified. */
+ if (a++ > 0)
+ g (a, 3);
+}
+int main ()
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 a with const 7" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-3.c
new file mode 100644
index 000000000..36fd50678
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-3.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+
+/* Double constants. */
+
+#include <stdio.h>
+void t(void);
+static int g (double b, double c)
+{
+ t();
+ return (int)(b+c);
+}
+static int f (double a)
+{
+ if (a > 0)
+ g (a, 3.1);
+ else
+ g (a, 3.1);
+}
+int main ()
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7.44);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 a with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of g" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 b with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .1 c with const 3" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-4.c
new file mode 100644
index 000000000..566b32971
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-4.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+#include <stdio.h>
+int g (int b, int c)
+{
+ printf ("%d %d\n", b, c);
+}
+int f (int a)
+{
+ /* First and second parameter of g gets different values. */
+
+ if (a > 0)
+ g (a, 3);
+ else
+ g (a+1, 5);
+}
+int main ()
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
+/* { dg-final { scan-ipa-dump-times "replacing param .0 a with const 7" 1 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-5.c
new file mode 100644
index 000000000..daa64fada
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-5.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+/* Float & short constants. */
+
+#include <stdio.h>
+int t(void);
+int g (float b, short c)
+{
+ t();
+ return c + (int)b;
+}
+int f (float a)
+{
+ int i, j = t();
+ /* a is modified. */
+ if (a++ > 0)
+ for (i = 0; i < j; i++)
+ g (a, 3);
+}
+int main ()
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7.6);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node" 3 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .1 c with const 3" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 a with const 7" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-6.c
new file mode 100644
index 000000000..c7d9b3738
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-6.c
@@ -0,0 +1,33 @@
+/* PR middle-end/29122 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fno-early-inlining" } */
+
+int
+dont_inline (int);
+
+int
+bar (int b, int c)
+{
+ return dont_inline (c);
+}
+
+int
+foo (int a)
+{
+ if (a++ > 0)
+ bar (a, 3);
+
+ foo (7);
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ foo (7);
+ return 0;
+}
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-7.c
new file mode 100644
index 000000000..271a34a3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-7.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+#include <stdio.h>
+void send_addr (int *);
+int g (int b, int c)
+{
+ printf ("%d %d\n", b, c);
+}
+int f (int a)
+{
+ if (a > 0)
+ g (a, 3);
+ else
+ g (a, 5);
+
+ send_addr (&a);
+}
+int main ()
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
+/* { dg-final { scan-ipa-dump-times "replacing param .. . with const 7" 1 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-8.c
new file mode 100644
index 000000000..d138cf263
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-8.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+#include <stdio.h>
+static int g (int b, int c)
+{
+ printf ("%d %d\n", b, c);
+}
+static int f (int a)
+{
+ /* Second parameter of g gets different values. */
+ if (a > 0)
+ g (a, 3);
+ else
+ g (a, 5);
+}
+int main ()
+{
+ f (7);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 a with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of g" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 b with const 7" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c
new file mode 100644
index 000000000..a56e71a4a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c
@@ -0,0 +1,50 @@
+/* { dg-do run } */
+/* { dg-options "-O -fipa-pta -fdump-ipa-pta-details" } */
+
+static int __attribute__((noinline))
+foo (int *p, int *q)
+{
+ *p = 2;
+ *q = 1;
+ return *p;
+}
+
+static int __attribute__((noinline))
+bar (int *p, int *q)
+{
+ *p = -2;
+ *q = -1;
+ return *p;
+}
+
+static int __attribute__((noinline,noclone))
+foobar (int foo_p)
+{
+ int a;
+ int (*fn)(int *, int *);
+ if (foo_p)
+ fn = foo;
+ else
+ fn = bar;
+ return (*fn)(&a, &a);
+}
+
+extern void abort (void);
+
+int main()
+{
+ if (foobar (1) != 1)
+ abort ();
+
+ return 0;
+}
+
+/* IPA PTA needs to handle indirect calls properly. Verify that
+ both bar and foo get a (and only a) in their arguments points-to sets. */
+
+/* { dg-final { scan-ipa-dump "fn_1 = { bar foo }" "pta" } } */
+/* { dg-final { scan-ipa-dump "bar.arg0 = { a }" "pta" } } */
+/* { dg-final { scan-ipa-dump "bar.arg1 = { a }" "pta" } } */
+/* { dg-final { scan-ipa-dump "foo.arg0 = { a }" "pta" } } */
+/* { dg-final { scan-ipa-dump "foo.arg1 = { a }" "pta" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c
new file mode 100644
index 000000000..81a3c53bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details" } */
+
+#include <stdarg.h>
+
+static void __attribute__((noinline,noclone))
+foo (int i, ...)
+{
+ va_list ap;
+ int *p;
+ va_start (ap, i);
+ p = va_arg (ap, int *);
+ *p = 1;
+ va_end (ap);
+}
+extern void abort (void);
+int main()
+{
+ int i = 0;
+ foo (0, &i);
+ if (i != 1)
+ abort ();
+ return 0;
+}
+
+/* Verify we properly handle variadic arguments and do not let escape
+ stuff through it. */
+
+/* { dg-final { scan-ipa-dump "ESCAPED = { (ESCAPED )?(NONLOCAL )?}" "pta" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-11.c
new file mode 100644
index 000000000..dadb16676
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-11.c
@@ -0,0 +1,36 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details" } */
+
+static int i;
+/* i should not escape here, p should point to i only. */
+/* { dg-final { scan-ipa-dump "p = { i }" "pta" } } */
+static int *p = &i;
+
+int j;
+/* q should point to j only. */
+/* { dg-final { scan-ipa-dump "q = { j }" "pta" } } */
+static int *q = &j;
+
+static int k;
+/* k should escape here, r should point to NONLOCAL, ESCAPED, k. */
+int *r = &k;
+/* { dg-final { scan-ipa-dump "r = { ESCAPED NONLOCAL k }" "pta" } } */
+
+int l;
+/* s should point to NONLOCAL, ESCAPED, l. */
+int *s = &l;
+/* { dg-final { scan-ipa-dump "s = { ESCAPED NONLOCAL l }" "pta" } } */
+
+/* Make p and q referenced so they do not get optimized out. */
+int foo() { return &p < &q; }
+
+int main()
+{
+ return 0;
+}
+
+/* It isn't clear if the escape if l is strictly necessary, if it were
+ we should have i, r and s in ESCAPED as well. */
+
+/* { dg-final { scan-ipa-dump "ESCAPED = { ESCAPED NONLOCAL l k }" "pta" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-12.c
new file mode 100644
index 000000000..1c773eed0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-12.c
@@ -0,0 +1,34 @@
+static int i, j;
+
+static void __attribute__((noinline,noclone))
+foo (void) { i = 1; }
+
+static void __attribute__((noinline,noclone))
+bar (void) { j = 1; }
+
+typedef void (*fn_t)(void);
+void escapeme (fn_t);
+fn_t getme (void);
+
+extern void link_error (void);
+
+int main()
+{
+ fn_t fn;
+ escapeme (foo);
+ fn = getme();
+
+ i = 0;
+ fn();
+ if (i != 1)
+ return 100;
+ j = 0;
+ fn();
+ if (j != 0)
+ link_error ();
+ bar();
+ if (j != 1)
+ return 200;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c
new file mode 100644
index 000000000..0f46e984b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c
@@ -0,0 +1,62 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2" } */
+
+static int x, y;
+
+static __attribute__((noinline,noclone)) void
+local (int *p)
+{
+ *p = 1;
+}
+
+static __attribute__((noinline,noclone)) void
+local_address_taken (int *p)
+{
+ *p = 1;
+}
+
+void *anyfn_global;
+
+/* Even though not referenced in this TU we should have added constraints
+ for the initializer. */
+/* { dg-final { scan-ipa-dump "ex = &local_address_taken" "pta" } } */
+void (*ex)(int *) = local_address_taken;
+
+extern void link_error (void);
+
+int main()
+{
+ void (*anyfn)(int *) = (void (*)(int *))(__SIZE_TYPE__)anyfn_global;
+ /* The following should cause local_address_taken to get &x
+ as argument, but not local. We shouldn't get &x added to
+ arbitrary special sub-vars of local_address_taken though,
+ a missed optimization currently.
+ As local_address_taken escapes the translation unit its
+ argument points-to set needs to include ESCAPED and NONLOCAL.
+ We shouldn't get the functions sub-vars in the ESCAPED solution
+ though, another missed-optimization. This also causes the functions
+ uses to be messed up even further. */
+ /* ??? As we don't expand the ESCAPED solution we either get x printed here
+ or not based on the phase of the moon. */
+ /* { dg-final { scan-ipa-dump "local_address_taken.arg0 = { ESCAPED NONLOCAL y x }" "pta" { xfail *-*-* } } } */
+ /* { dg-final { scan-ipa-dump "local_address_taken.clobber = { ESCAPED NONLOCAL y x }" "pta" { xfail *-*-* } } } */
+ /* { dg-final { scan-ipa-dump "local_address_taken.use = { }" "pta" { xfail *-*-* } } } */
+ /* ??? But make sure x really escaped. */
+ /* { dg-final { scan-ipa-dump "ESCAPED = {\[^\n\}\]* x \[^\n\}\]*}" "pta" } } */
+ (*anyfn) (&x);
+ x = 0;
+ local (&y);
+ /* Thus we should be able to disambiguate x against the call to local
+ and CSE the stored value. */
+ if (x != 0)
+ link_error ();
+ x = 1;
+ local_address_taken (&y);
+ /* As we are computing flow- and context-insensitive we may not
+ CSE the load of x here. */
+ /* { dg-final { scan-tree-dump " = x;" "fre2" } } */
+ return x;
+}
+
+/* { dg-final { cleanup-ipa-dump "pta" } } */
+/* { dg-final { cleanup-tree-dump "fre2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c
new file mode 100644
index 000000000..b62b08ff0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-14.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fipa-pta -fno-tree-fre -fno-tree-sra -fdump-ipa-pta-details" } */
+
+struct X {
+ int i;
+ void *p;
+};
+
+static void * __attribute__((noinline,noclone))
+foo(struct X *q, void *p)
+{
+ struct X b;
+ b.p = p;
+ *q = b;
+ return q->p;
+}
+extern void abort (void);
+int main()
+{
+ struct X a, c;
+ void *p;
+ a.p = (void *)&c;
+ p = foo(&a, &a);
+ /* { dg-final { scan-ipa-dump "foo.result = { NULL a\[^ \]* c\[^ \]* }" "pta" { target { ! keeps_null_pointer_checks } } } } */
+ /* { dg-final { scan-ipa-dump "foo.result = { NONLOCAL a\[^ \]* c\[^ \]* }" "pta" { target { keeps_null_pointer_checks } } } } */
+ ((struct X *)p)->p = (void *)0;
+ if (a.p != (void *)0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-15.c
new file mode 100644
index 000000000..77701ebd5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-15.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fipa-pta" } */
+
+struct Foo {
+ int *p;
+ int *q;
+};
+
+void __attribute__((noinline))
+bar (int **x)
+{
+ struct Foo *f = (struct Foo *)(x - 1);
+ *(f->p) = 0;
+}
+
+int foo(void)
+{
+ struct Foo f;
+ int i = 1, j = 2;
+ f.p = &i;
+ f.q = &j;
+ bar(&f.q);
+ return i;
+}
+
+extern void abort (void);
+int main()
+{
+ if (foo () != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c
new file mode 100644
index 000000000..ef4182632
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-16.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-sra -fipa-pta -fdump-ipa-pta" } */
+
+struct X
+{
+ long l1;
+ struct Y
+ {
+ long l2;
+ int *p;
+ } y;
+};
+int i;
+static int __attribute__((noinline))
+foo (struct X *x)
+{
+ struct Y y = x->y;
+ *y.p = 0;
+ i = 1;
+ return *y.p;
+}
+extern void abort (void);
+int main()
+{
+ struct X x;
+ x.y.p = &i;
+ if (foo(&x) != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "y.\[0-9\]*\\\+\[0-9\]* = { i }" "pta" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-17.c
new file mode 100644
index 000000000..443ed9d27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-17.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O -fipa-pta" } */
+
+static int i;
+extern int j __attribute__ ((alias ("i")));
+int *p = &j;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c
new file mode 100644
index 000000000..a6c7e4b47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-pta -fdump-ipa-pta-details" } */
+
+int (*fn)(int *);
+
+static int __attribute__((noinline,noclone))
+foo (int *p)
+{
+ return *p;
+}
+
+extern void bar (void);
+
+int main()
+{
+ fn = foo;
+ bar ();
+ return 0;
+}
+
+/* Make sure that when a local function escapes its argument points-to sets
+ are properly adjusted. */
+
+/* { dg-final { scan-ipa-dump "foo.arg0 = { ESCAPED NONLOCAL }" "pta" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c
new file mode 100644
index 000000000..47900809b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-3.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2-details" } */
+
+static int __attribute__((noinline,noclone))
+foo (int *p, int *q)
+{
+ *p = 1;
+ *q = 0;
+ return *p;
+}
+
+extern void abort (void);
+
+int main()
+{
+ int a, b;
+ if (foo (&a, &b) != 1)
+ abort ();
+ return 0;
+}
+
+/* Verify we can disambiguate *p and *q in foo. */
+
+/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
+/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */
+/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre2" } } */
+/* { dg-final { cleanup-tree-dump "fre2" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c
new file mode 100644
index 000000000..bf6fa281d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-4.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details -fdump-tree-fre2-details" } */
+
+int a, b;
+
+static int __attribute__((noinline,noclone))
+foo (int *p, int *q)
+{
+ int res;
+ *p = 1;
+ *q = 0;
+ res = *p;
+ a = 1;
+ b = 1;
+ return res;
+}
+
+extern void abort (void);
+
+int main()
+{
+ if (foo (&a, &b) != 1)
+ abort ();
+ return 0;
+}
+
+/* Verify we can disambiguate *p and *q in foo. */
+
+/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
+/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */
+/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre2" } } */
+/* { dg-final { cleanup-tree-dump "fre2" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-5.c
new file mode 100644
index 000000000..3359c534a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-5.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fipa-pta -fdump-ipa-pta-details" } */
+
+int **x;
+
+static int __attribute__((noinline,noclone))
+foo (int **q)
+{
+ int a = 1;
+ **q = 0;
+ *x = &a;
+ return **q;
+}
+
+extern void abort (void);
+int main()
+{
+ int b;
+ int *p = &b;
+ x = &p;
+ if (foo (&p) != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-6.c
new file mode 100644
index 000000000..aaa6090dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-6.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-O -fipa-pta -fdump-ipa-pta-details" } */
+
+static void __attribute__((noinline,noclone))
+foo (int *p)
+{
+ *p = 1;
+}
+
+extern void abort (void);
+
+int main()
+{
+ int i = 0;
+ foo (&i);
+ if (i != 1)
+ abort ();
+ return 0;
+}
+
+/* Verify we correctly compute the units ESCAPED set as empty but
+ still properly account for the store via *p in foo. */
+
+/* { dg-final { scan-ipa-dump "ESCAPED = { }" "pta" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-7.c
new file mode 100644
index 000000000..3cdfd63fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-7.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-early-inlining -fipa-pta" } */
+
+static void __attribute__((noinline,noclone))
+clobber_me (int *p, int how)
+{
+ *p = how;
+}
+
+/* When foo is inlined into main we have to make sure to adjust
+ main()s IPA CLOBBERED set according to the decl remappings
+ inlining does. */
+
+static int
+foo (void)
+{
+ int a = 0;
+ clobber_me (&a, 1);
+ return a;
+}
+
+extern void abort (void);
+
+int main()
+{
+ if (foo () != 1)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-8.c
new file mode 100644
index 000000000..5bedc9d8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-8.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-early-inlining -fipa-pta" } */
+
+static int *__attribute__((noinline,noclone))
+pass_me (int *p)
+{
+ return p;
+}
+
+/* When foo is inlined into main we have to make sure to adjust
+ main()s IPA CLOBBERED set according to the decl remappings
+ inlining does. */
+
+static int
+foo (void)
+{
+ int a = 0;
+ int *p = pass_me (&a);
+ *p = 1;
+ return a;
+}
+
+extern void abort (void);
+
+int main()
+{
+ if (foo () != 1)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-9.c
new file mode 100644
index 000000000..1a98da397
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-pta-9.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fipa-pta" } */
+
+static void __attribute__((noinline,noclone))
+foo (int *p, int *q)
+{
+ __builtin_memcpy (p, q, sizeof (int));
+}
+extern void abort (void);
+int main()
+{
+ int i = 0, j = 1;
+ foo (&i, &j);
+ if (i != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-1.c
new file mode 100644
index 000000000..2c05347c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-1.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */
+
+struct bovid
+{
+ float red;
+ int green;
+ void *blue;
+};
+
+extern int printf (const char *, ...);
+extern void abort (void);
+
+static int
+__attribute__((noinline))
+ox (struct bovid cow)
+{
+ if (cow.green != 6)
+ abort ();
+
+ printf ("green: %f\nblue: %p\nblue again: %p\n", cow.green,
+ cow.blue, cow.blue);
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ struct bovid cow;
+
+ cow.red = 7.4;
+ cow.green = 6;
+ cow.blue = &cow;
+
+ ox (cow);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "About to replace expr" 2 "eipa_sra" } } */
+/* { dg-final { cleanup-tree-dump "eipa_sra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
new file mode 100644
index 000000000..3437a81aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-2.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */
+
+struct bovid
+{
+ float red;
+ int green;
+ void *blue;
+};
+
+static int
+__attribute__((noinline))
+ox (struct bovid *cow)
+{
+ cow->red = cow->red + cow->green + cow->green;
+ return 0;
+}
+
+int something;
+
+static int
+__attribute__((noinline))
+ox_improved (struct bovid *calf)
+{
+ if (something > 0)
+ calf->red = calf->red + calf->green;
+ else
+ calf->red = calf->green + 87;
+ something = 77;
+ return 0;
+}
+
+
+int main (int argc, char *argv[])
+{
+ struct bovid cow;
+
+ cow.red = 7.4;
+ cow.green = 6;
+ cow.blue = &cow;
+
+ ox (&cow);
+
+ ox_improved (&cow);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "About to replace expr cow_.*D.->red with \\*ISRA" "eipa_sra" } } */
+/* { dg-final { scan-tree-dump "About to replace expr cow_.*D.->green with ISRA" "eipa_sra" } } */
+/* { dg-final { scan-tree-dump "About to replace expr calf_.*D.->red with \\*ISRA" "eipa_sra" } } */
+/* { dg-final { scan-tree-dump "About to replace expr calf_.*D.->green with ISRA" "eipa_sra" } } */
+/* { dg-final { cleanup-tree-dump "eipa_sra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-3.c
new file mode 100644
index 000000000..ac078c22d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-3.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */
+
+struct bovid
+{
+ float red;
+ int green;
+ void *blue;
+};
+
+extern void foo (float, void *, void *, long);
+
+static int
+__attribute__((noinline))
+ox (struct bovid cow, int z, struct bovid calf, long l)
+{
+ foo (cow.red, cow.blue, cow.blue, l);
+ return 0;
+}
+
+void caller (void)
+{
+ struct bovid cow, calf;
+
+ cow.red = 7.4;
+ cow.green = 6;
+ cow.blue = &cow;
+
+ calf.red = 8.4;
+ calf.green = 5;
+ calf.blue = &cow;
+
+ ox (cow,4,calf,2);
+ return;
+}
+
+/* { dg-final { scan-tree-dump "base: z, remove_param" "eipa_sra" } } */
+/* { dg-final { scan-tree-dump "base: calf, remove_param" "eipa_sra" } } */
+/* { dg-final { cleanup-tree-dump "eipa_sra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-4.c
new file mode 100644
index 000000000..f07706b92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-4.c
@@ -0,0 +1,68 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */
+
+static int
+__attribute__((noinline))
+ox (int *i)
+{
+ return *i+4**i;
+}
+
+int *holder;
+
+static int
+__attribute__((noinline))
+ox_ctrl_1 (int *j)
+{
+ holder = j;
+ return *j+4 * *j+1;
+}
+
+static void
+__attribute__((noinline))
+ox_ctrl_2 (int *k)
+{
+ *k = 8;
+}
+
+static int zzz[10];
+
+static int
+__attribute__((noinline))
+ox_improved (int recurse, int *l)
+{
+ int r = 0;
+
+ r = *l;
+
+ if (recurse)
+ {
+ if (recurse > 2)
+ l = &zzz[3];
+ else
+ l = zzz;
+
+ ox_improved (0, l);
+ }
+
+ return r;
+}
+
+void caller (void)
+{
+ int a = 1;
+ int b = 10;
+ int c;
+
+ ox (&a);
+ ox_ctrl_1 (&a);
+ ox_ctrl_2 (&a);
+ *holder = ox_improved (1, &b);
+ return;
+}
+
+/* { dg-final { scan-tree-dump "About to replace expr \\*i_.*D. with ISRA" "eipa_sra" } } */
+/* { dg-final { scan-tree-dump "About to replace expr \\*l_.*D. with ISRA" "eipa_sra" } } */
+/* { dg-final { scan-tree-dump-times "About to replace expr \*j_.*D. with ISRA" 0 "eipa_sra" } } */
+/* { dg-final { scan-tree-dump-times "About to replace expr \*k_.*D. with ISRA" 0 "eipa_sra" } } */
+/* { dg-final { cleanup-tree-dump "eipa_sra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-5.c
new file mode 100644
index 000000000..2fe4ee741
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-5.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */
+
+static int *
+__attribute__((noinline,used))
+ ox (int *i, int *j)
+{
+ return i;
+}
+
+int a;
+
+int *caller (void)
+{
+ int b = 10;
+
+ return ox (&a, &b);
+}
+/* { dg-final { scan-tree-dump-times "base: j, remove_param" 0 "eipa_sra" } } */
+/* { dg-final { cleanup-tree-dump "eipa_sra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c
new file mode 100644
index 000000000..487e72ef4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-slim" } */
+/* { dg-require-effective-target non_strict_align } */
+
+struct bovid
+{
+ float a;
+ int b;
+ struct bovid *next;
+};
+
+static int
+__attribute__((noinline))
+foo (struct bovid *cow, int i)
+{
+ i++;
+ if (cow->next)
+ foo (cow->next, i);
+ return i;
+}
+
+int main (int argc, char *argv[])
+{
+ struct bovid cow;
+
+ cow.a = 7.4;
+ cow.b = 6;
+ cow.next = (struct bovid *) 0;
+
+ return foo (&cow, 0);
+}
+
+/* { dg-final { scan-tree-dump-times "foo " 1 "eipa_sra" } } */
+/* { dg-final { cleanup-tree-dump "eipa_sra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-7.c
new file mode 100644
index 000000000..921334a4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-7.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+typedef unsigned int myint __attribute__((aligned(1)));
+
+typedef struct __attribute__((packed)) S {
+ unsigned a, b, c;
+} SS;
+
+typedef SS __attribute__((aligned(1))) SSS;
+
+
+static unsigned int __attribute__ ((noinline))
+get_a (SSS *p)
+{
+ return p->a;
+};
+
+static int __attribute__ ((noinline, noclone))
+foo (SS *p)
+{
+ int r = (int) get_a(p) + 2;
+ return r;
+}
+
+char buf[512];
+
+static SSS * __attribute__ ((noinline, noclone))
+get_sss (void)
+{
+ return (SSS *)(buf + 1);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ SSS *p = get_sss();
+ if (foo(p) != 2)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-8.c
new file mode 100644
index 000000000..9e6e40ac5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-8.c
@@ -0,0 +1,41 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+typedef unsigned int myint __attribute__((aligned(1)));
+
+typedef struct S {
+ unsigned a, b, c;
+} SS;
+
+typedef SS __attribute__((aligned(1))) SSS;
+
+
+static unsigned int __attribute__ ((noinline))
+get_a (SS s)
+{
+ return s.a;
+};
+
+static int __attribute__ ((noinline, noclone))
+foo (SSS *p)
+{
+ int r = (int) get_a(*p) + 2;
+ return r;
+}
+
+char buf[512];
+
+static SSS * __attribute__ ((noinline, noclone))
+get_sss (void)
+{
+ return (SSS *)(buf + 1);
+}
+
+int
+main(int argc, char *argv[])
+{
+ SSS *p = get_sss();
+ if (foo(p) != 2)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-9.c
new file mode 100644
index 000000000..c5468cfbb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa-sra-9.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+typedef unsigned int myint __attribute__((aligned(1)));
+
+typedef struct S {
+ unsigned a, b, c;
+} SS;
+
+typedef struct U {
+ SS s[2];
+} UU;
+
+typedef UU __attribute__((aligned(1))) UUU;
+
+static unsigned int __attribute__ ((noinline))
+get_a (SS s)
+{
+ return s.a;
+};
+
+static int __attribute__ ((noinline, noclone))
+foo (UUU *p)
+{
+ int r = (int) get_a(p->s[0]) + 2;
+ return r;
+}
+
+char buf[512];
+
+static UUU * __attribute__ ((noinline, noclone))
+get_uuu (void)
+{
+ return (UUU *)(buf + 1);
+}
+
+int
+main(int argc, char *argv[])
+{
+ UUU *p = get_uuu();
+ if (foo(p) != 2)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa.exp b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa.exp
new file mode 100644
index 000000000..3c3c600ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipa.exp
@@ -0,0 +1,35 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipacost-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
new file mode 100644
index 000000000..4fce41e82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipacost-1.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fipa-cp -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */
+
+int array[100];
+
+int t(int);
+
+static int
+i_can_be_propagated_fully (int *a)
+{
+ int i;
+ for (i=0;i<50;i++)
+ {
+ t(a[i]);
+ t(a[i+1]);
+ t(a[i+2]);
+ t(a[i+3]);
+ }
+}
+static int
+i_can_be_propagated_fully2 (int *a)
+{
+ i_can_be_propagated_fully (a);
+ i_can_be_propagated_fully (a);
+ i_can_be_propagated_fully (a);
+}
+static int
+i_can_not_be_propagated_fully (int *a)
+{
+ int i;
+ for (i=0;i<50;i++)
+ {
+ t(a[i]);
+ t(a[i+1]);
+ t(a[i+2]);
+ t(a[i+3]);
+ }
+}
+int
+i_can_not_be_propagated_fully2 (int *a)
+{
+ i_can_not_be_propagated_fully (a);
+ i_can_not_be_propagated_fully (a);
+ i_can_not_be_propagated_fully (a);
+}
+main()
+{
+ i_can_be_propagated_fully2 (array);
+ i_can_be_propagated_fully2 (array);
+ i_can_not_be_propagated_fully2 (array);
+ i_can_not_be_propagated_fully2 (array);
+}
+
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully2" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully/" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully2" "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully/" "cp" } } */
+/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 " "optimized" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipacost-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
new file mode 100644
index 000000000..ceb524e00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
@@ -0,0 +1,80 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */
+/* { dg-add-options bind_pic_locally } */
+
+int array[100];
+
+int t(int);
+
+static int
+i_can_be_propagated_fully (int *a)
+{
+ int i;
+ for (i=0;i<50;i++)
+ {
+ t(a[i]);
+ t(a[i+1]);
+ t(a[i+2]);
+ t(a[i+3]);
+ }
+}
+static int
+i_can_be_propagated_fully2 (int *a)
+{
+ i_can_be_propagated_fully (a);
+ i_can_be_propagated_fully (a);
+ i_can_be_propagated_fully (a);
+}
+static int
+i_can_not_be_propagated_fully (int *a)
+{
+ int i;
+ for (i=0;i<50;i++)
+ {
+ t(a[i]);
+ t(a[i+1]);
+ t(a[i+2]);
+ t(a[i+3]);
+ }
+}
+int
+i_can_not_be_propagated_fully2 (int *a)
+{
+ int i;
+ i_can_not_be_propagated_fully (a);
+ for (i=0;i<50;i++)
+ {
+ t(a[i] + 1);
+ t(a[i+1] + 1);
+ t(a[i+2] + 1);
+ t(a[i+3] + 1);
+ }
+ i_can_not_be_propagated_fully (a);
+ for (i=0;i<50;i++)
+ {
+ t(a[i] + 2);
+ t(a[i+1] + 2);
+ t(a[i+2] + 2);
+ t(a[i+3] + 2);
+ }
+ i_can_not_be_propagated_fully (a);
+}
+main()
+{
+ int i;
+ i_can_be_propagated_fully2 (array);
+ i_can_be_propagated_fully2 (array);
+
+ for (i = 0; i < 7; i++)
+ i_can_not_be_propagated_fully2 (array);
+ i_can_not_be_propagated_fully2 (array);
+}
+
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully2" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully/" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully2" "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully/" "cp" } } */
+/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully \\(" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 \\(" "optimized" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-1.c
new file mode 100644
index 000000000..a2ffd4202
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-1.c
@@ -0,0 +1,52 @@
+/* Test that IPA-CP is able to figure out that poth parameters a are constant 7
+ even though f and h recursively call each other and specialize them
+ accordinly. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+extern void use_stuff (int);
+
+static
+int g (int b, int c)
+{
+ int i;
+
+ for (i = 0; i < b; i++)
+ use_stuff (c);
+}
+
+static void f (int a, int x, int z);
+
+static void h (int z, int a)
+{
+ use_stuff (z);
+ f (a, 9, 10);
+
+}
+
+static void
+f (int a, int x, int z)
+{
+ if (z > 1)
+ g (a, x);
+ else
+ h (5, a);
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7, 8, argc);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of f.*for all known contexts" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 a with const 7" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-2.c
new file mode 100644
index 000000000..62f564f21
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-2.c
@@ -0,0 +1,99 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+extern int get_stuff (int);
+extern void do_stuff (int);
+extern void do_stuff2 (int);
+extern void do_other_stuff (void);
+extern int get_element (int, int, int);
+extern int adjust (int, int, int, int);
+
+extern int count;
+
+int
+foo (int s, int p)
+{
+ int c, r = 0;
+
+ for (c = 0 ; c < count; c++)
+ {
+ r += get_stuff (s);
+ /* The following is just something big that can go away. */
+ if (p != 0)
+ {
+ int a[64][64];
+ int i, j, k;
+
+ for (i = 0; i < 64; i++)
+ for (j = 0; j < 64; j++)
+ a[i][j] = get_element (p + c, i, j);
+
+ for (k = 0; k < 4; k++)
+ {
+ r = r / 2;
+
+ for (i = 1; i < 63; i++)
+ for (j = 62; j > 0; j--)
+ a[i][j] += adjust (a[i-1][j], a[i][j-1],
+ a[i+1][j], a[i][j+1]);
+
+ for (i = 4; i < 64; i += 4)
+ for (j = 4; j < 64; j += 4)
+ r += a[i][j] / 4;
+ }
+ }
+ }
+ return r;
+}
+
+int
+bar (int p, int q)
+{
+ if (q > 0)
+ do_stuff (q);
+ else
+ do_stuff (-q);
+
+ if (q % 2)
+ do_stuff2 (2 * q);
+ else
+ do_stuff2 (2 * (q + 1));
+
+ return foo (4, p);
+}
+
+int
+bah (int p, int q)
+{
+ int i, j;
+
+ while (q < -20)
+ q += get_stuff (-q);
+
+ for (i = 0; i < 36; i++)
+ for (j = 0; j < 36; j++)
+ do_stuff (get_stuff (q * i + 2));
+
+ bar (p, q);
+}
+
+int
+top1 (int q)
+{
+ do_other_stuff ();
+ return bah (0, q);
+}
+
+int
+top2 (int q)
+{
+ do_stuff (200);
+ do_other_stuff ();
+ return bah (16, q);
+}
+
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "replacing param .. p with const 0" 3 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 s with const 4" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-3.c
new file mode 100644
index 000000000..af4f50b27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-3.c
@@ -0,0 +1,70 @@
+/* Verify that IPA-CP can clone mark_cell without miscompiling it despite its
+ type_attributes. */
+/* { dg-do run } */
+/* { dg-options "-O3 -fdump-ipa-cp" } */
+
+
+struct PMC {
+ unsigned flags;
+};
+
+typedef struct Pcc_cell
+{
+ struct PMC *p;
+ long bla;
+ long type;
+} Pcc_cell;
+
+int gi;
+
+extern void abort ();
+extern void never_ever(int * interp, struct PMC *pmc)
+ __attribute__((noinline));
+
+void never_ever (int * interp, struct PMC *pmc)
+{
+ abort ();
+}
+
+static void mark_cell(int * interp, Pcc_cell *c)
+ __attribute__((__nonnull__(1)))
+ __attribute__((noinline));
+
+static void
+mark_cell(int * interp, Pcc_cell *c)
+{
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<14)))
+ never_ever(interp, c->p);
+}
+
+static void foo(int * interp, Pcc_cell *c)
+ __attribute__((noinline));
+
+static void
+foo(int * interp, Pcc_cell *c)
+{
+ mark_cell(interp, c);
+}
+
+static struct Pcc_cell *
+__attribute__((noinline,noclone))
+getnull(void)
+{
+ return (struct Pcc_cell *) 0;
+}
+
+
+int main()
+{
+ int i;
+
+ for (i = 0; i < 100; i++)
+ foo (&gi, getnull ());
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of mark_cell" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-4.c
new file mode 100644
index 000000000..462cade49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-4.c
@@ -0,0 +1,68 @@
+/* Test that IPA-CP is able to produce a pass-through jump function for the
+ call of g1 and g2 even though a is addressable. Also test that h is not
+ cloned. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+extern void use_stuff (int);
+extern void use_pointer (int *);
+
+static int
+h (int a, int b)
+{
+ int i;
+
+ for (i = 8; i <= b; i++)
+ use_stuff (a+8);
+}
+
+static int
+g1 (int a, int b)
+{
+ int i;
+
+ for (i = 0; i <= b; i++)
+ use_pointer (&a);
+ h (a, b);
+}
+
+static int
+g2 (int a, int b)
+{
+ int i;
+
+ for (i = 4; i <= b; i += 2)
+ use_stuff (a);
+}
+
+
+static void
+f (int a, int z)
+{
+ if (z > 1)
+ g1 (a, z);
+ else
+ g2 (a + 4, z);
+ use_pointer (&a);
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7, argc);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of g1.*for all known contexts" "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of g2.*for all known contexts" "cp" } } */
+/* { dg-final { scan-ipa-dump-not "Creating a specialized node of h.*for all known contexts" "cp" } } */
+/* { dg-final { scan-ipa-dump-times "replacing param .0 a with const 7" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param .0 a with const 11" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-1.c
new file mode 100644
index 000000000..b2e04f872
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-1.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+void *blah(int, void *);
+
+static void __attribute__ ((noinline))
+foo (struct S *p)
+{
+ int i, c = p->c;
+ int b = p->b;
+ void *v = (void *) p;
+
+ for (i= 0; i< c; i++)
+ v = blah(b + i, v);
+}
+
+void
+entry (void)
+{
+ struct S s;
+ s.a = 1;
+ s.b = 64;
+ s.c = 32;
+ foo (&s);
+}
+
+/* { dg-final { scan-ipa-dump "Creating a specialized node of foo.*for all known contexts" "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Aggregate replacements:" 2 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-2.c
new file mode 100644
index 000000000..7edfa408a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-2.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+void *blah(int, void *);
+
+static void __attribute__ ((noinline))
+foo (struct S *p)
+{
+ int i, c = p->c;
+ int b = p->b;
+ void *v = (void *) p;
+
+ for (i= 0; i< c; i++)
+ v = blah(b + i, v);
+}
+
+void
+entry (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = 1;
+ s.b = 64;
+ s.c = 32;
+ foo (&s);
+ }
+ s.c = 2;
+ foo (&s);
+}
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo/\[0-9\]*\\." 2 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Aggregate replacements:" 4 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-3.c
new file mode 100644
index 000000000..4c0a3e7c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-3.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+void *blah(int, void *);
+
+static void __attribute__ ((noinline))
+foo (int z, struct S *p)
+{
+ int i, c = p->c;
+ int b = p->b;
+ void *v = (void *) p;
+
+ for (i= 0; i< c; i++)
+ v = blah(b + i, v);
+}
+
+void
+entry (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = 1;
+ s.b = 64;
+ s.c = 32;
+ foo (i, &s);
+ }
+ s.c = 2;
+ foo (0, &s);
+}
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo/\[0-9\]*\\." 2 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Aggregate replacements: 1" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Aggregate replacements: 0" 2 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-4.c
new file mode 100644
index 000000000..1c1da4d68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-4.c
@@ -0,0 +1,62 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+void *blah(int, void *);
+
+static void __attribute__ ((noinline))
+foo (struct S *p)
+{
+ int i, c = p->c;
+ int b = p->b;
+ void *v = (void *) p;
+
+ for (i= 0; i< c; i++)
+ v = blah(b + i, v);
+}
+
+
+void
+entry1 (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = 1;
+ s.b = 64;
+ s.c = 32;
+ foo (&s);
+ }
+ s.c = 2;
+ foo (&s);
+}
+
+void
+entry2 (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = 6;
+ s.b = 64;
+ s.c = 32;
+ foo (&s);
+ }
+ s.c = 2;
+ foo (&s);
+}
+
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo/\[0-9\]*\\." 2 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Aggregate replacements:" 4 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-5.c
new file mode 100644
index 000000000..9f6ee5bee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-5.c
@@ -0,0 +1,68 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+void *blah(int, void *);
+
+static void __attribute__ ((noinline))
+foo (struct S *p)
+{
+ int i, c = p->c;
+ int b = p->b;
+ void *v = (void *) p;
+
+ for (i= 0; i< c; i++)
+ v = blah(b + i, v);
+}
+
+static void __attribute__ ((noinline))
+bar (struct S *p)
+{
+ foo (p);
+}
+
+void
+entry1 (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = 1;
+ s.b = 64;
+ s.c = 32;
+ bar (&s);
+ }
+ s.c = 2;
+ bar (&s);
+}
+
+void
+entry2 (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = 6;
+ s.b = 64;
+ s.c = 32;
+ foo (&s);
+ }
+ s.c = 2;
+ foo (&s);
+}
+
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo/\[0-9\]*\\." 2 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of bar/\[0-9\]*\\." 2 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Aggregate replacements:" 8 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-6.c
new file mode 100644
index 000000000..050e13bf5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-6.c
@@ -0,0 +1,75 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+void *blah(int, void *);
+
+static void __attribute__ ((noinline))
+foo (struct S *p)
+{
+ int i, c = p->c;
+ int b = p->b;
+ void *v = (void *) p;
+
+ for (i= 0; i< c; i++)
+ v = blah(b + i, v);
+}
+
+static void __attribute__ ((noinline))
+bar (struct S *p)
+{
+ foo (p);
+}
+
+static void __attribute__ ((noinline))
+bar_2 (struct S *p)
+{
+ foo (p);
+}
+
+void
+entry1 (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = 1;
+ s.b = 64;
+ s.c = 32;
+ bar (&s);
+ }
+ s.c = 2;
+ bar (&s);
+}
+
+void
+entry2 (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = 6;
+ s.b = 64;
+ s.c = 32;
+ bar_2 (&s);
+ }
+ s.c = 2;
+ foo (&s);
+}
+
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of foo/\[0-9\]*\\." 2 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Creating a specialized node of bar/\[0-9\]*\\." 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "Creating a specialized node of bar_2.*for all known contexts" "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Aggregate replacements:" 10 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-7.c
new file mode 100644
index 000000000..e85ca1a9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-7.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-ipa-cp-details -fdump-tree-optimized-slim" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+void *blah(int, void *);
+
+static void __attribute__ ((noinline)) foo (int x, int z, struct S *p);
+
+static void __attribute__ ((noinline))
+bar (int x, int z, struct S *p)
+{
+ foo (z, x, p);
+}
+
+static void __attribute__ ((noinline))
+foo (int x, int z, struct S *p)
+{
+ int i, c = p->c;
+ int b = p->b - z;
+ void *v = (void *) p;
+
+ if (z)
+ {
+ z--;
+ bar (z, x, p);
+ }
+ for (i = 0; i< c; i++)
+ v = blah(b + x + i, v);
+}
+
+void
+entry (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = c;
+ s.b = 64;
+ s.c = 32;
+ foo (4, i, &s);
+ }
+}
+/* { dg-final { scan-ipa-dump-times "Clone of bar" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "Clone of foo" 1 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { scan-tree-dump-not "->c;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c
new file mode 100644
index 000000000..5014ffd3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-8.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-ipa-sra -fdump-tree-optimized-slim" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+void *blah(int, void *);
+
+static void __attribute__ ((noinline)) foo (int x, int z, struct S *p);
+
+static void __attribute__ ((noinline))
+bar (int x, int z, struct S *p)
+{
+ p->b = 0;
+ foo (z, x, p);
+}
+
+static void __attribute__ ((noinline))
+foo (int x, int z, struct S *p)
+{
+ int i, c = p->c;
+ int b = p->b - z;
+ void *v = (void *) p;
+
+ if (z)
+ {
+ z--;
+ bar (z, x, p);
+ }
+ for (i = 0; i< c; i++)
+ v = blah(b + x + i, v);
+}
+
+void
+entry (int c)
+{
+ struct S s;
+ int i;
+
+ for (i = 0; i<c; i++)
+ {
+ s.a = c;
+ s.b = 64;
+ s.c = 32;
+ foo (4, i, &s);
+ }
+}
+/* { dg-final { scan-tree-dump "->b;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-9.c
new file mode 100644
index 000000000..e6b4b965f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-agg-9.c
@@ -0,0 +1,45 @@
+/* Verify that IPA-CP can make edges direct based on aggregate contents. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-early-inlining -fdump-ipa-cp -fdump-ipa-inline" } */
+
+struct S
+{
+ int i;
+ void (*f)(struct S *);
+ unsigned u;
+};
+
+struct U
+{
+ struct U *next;
+ struct S s;
+ short a[8];
+};
+
+extern void non_existent(struct S *p, int);
+
+static void hooray1 (struct S *p)
+{
+ non_existent (p, 1);
+}
+
+static __attribute__ ((noinline))
+void hiphip1 (struct S *p)
+{
+ p->f (p);
+}
+
+int test1 (void)
+{
+ struct S s;
+ s.i = 1234;
+ s.f = hooray1;
+ s.u = 1001;
+ hiphip1 (&s);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "ipa-prop: Discovered an indirect call to a known target" "cp" } } */
+/* { dg-final { scan-ipa-dump "hooray1\[^\\n\]*inline copy in hiphip1" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-ii-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-ii-1.c
new file mode 100644
index 000000000..9caa54beb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/ipcp-ii-1.c
@@ -0,0 +1,34 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
+
+extern void non_existent(int);
+extern void non_existent(int);
+
+static void hooray ()
+{
+ non_existent (1);
+}
+
+static void __attribute__ ((noinline)) hiphip (void (*f)())
+{
+ f ();
+}
+
+int __attribute__ ((noinline,noclone)) get_input(void)
+{
+ return 1;
+}
+
+int main (int argc, int *argv[])
+{
+ int i;
+
+ for (i = 0; i < get_input (); i++)
+ hiphip (hooray);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "hooray\[^\\n\]*inline copy in hiphip.constprop" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/noclone-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/noclone-1.c
new file mode 100644
index 000000000..118df3a00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/noclone-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+
+int global_1, global_2;
+
+__attribute__((__noclone__)) int g (int b, int c)
+ {
+ global_1 = b;
+ global_2 = c;
+}
+
+__attribute__((__noclone__)) int f (int a)
+{
+ /* Second parameter of g gets different values. */
+ if (a > 0)
+ g (a, 3);
+ else
+ g (a, 5);
+}
+
+int main ()
+{
+ f (7);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump-times "versioned function" 0 "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr42706.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr42706.c
new file mode 100644
index 000000000..9c5f43af3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr42706.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-early-inlining -fipa-sra" } */
+
+struct S
+{
+ float red;
+ int green;
+ void *blue;
+};
+
+extern int gi;
+static int foo ();
+
+int
+bar (void)
+{
+ foo ();
+ return 0;
+}
+
+static int
+foo (struct S s)
+{
+ gi = s.green;
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr45644.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr45644.c
new file mode 100644
index 000000000..3741020d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr45644.c
@@ -0,0 +1,36 @@
+/* Verify that we do not IPA-SRA bitfields. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort (void);
+
+struct S
+{
+ int j : 8;
+ int i : 24;
+ int l;
+};
+
+static int __attribute__((noinline)) foo (struct S *s)
+{
+ int z = s->i;
+ if (z != 777)
+ abort ();
+ return 0;
+}
+
+int __attribute__((noinline)) bar (struct S *s)
+{
+ return foo (s);
+}
+
+int main (int argc, char *argv[])
+{
+ struct S s;
+ s.j = 5;
+ s.i = 777;
+ s.l = -1;
+
+ return bar (&s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr48195.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr48195.c
new file mode 100644
index 000000000..2e38452d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr48195.c
@@ -0,0 +1,25 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -flto --param partial-inlining-entry-probability=101" } */
+/* { dg-require-effective-target lto } */
+
+extern void abort(void);
+
+int i;
+
+void __attribute__ ((constructor))
+c2 ()
+{
+ if (i)
+ abort ();
+}
+
+void __attribute__ ((destructor))
+d1 ()
+{
+ if (i)
+ abort ();
+}
+
+void main ()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr50744.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr50744.c
new file mode 100644
index 000000000..053534892
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr50744.c
@@ -0,0 +1,119 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-optimize-sibling-calls" } */
+
+extern int use_data (void *p_01, void *p_02, void *p_03, void *p_04, void *p_05,
+ void *p_06, void *p_07, void *p_08, void *p_09, void *p_10,
+ void *p_11, void *p_12, void *p_13, void *p_14, void *p_15,
+ void *p_16, void *p_17, void *p_18, void *p_19, void *p_20,
+ void *p_21, void *p_22, void *p_23, void *p_24, void *p_25,
+ void *p_26, void *p_27, void *p_28, void *p_29,
+ void *p_30);
+
+extern int idx (int i, int j, int n);
+
+struct stuff
+{
+ int decision;
+ int *a, *b, *c;
+ int res;
+};
+
+
+#define some_large_stuff(stuff, n) { \
+ int i, j, k; \
+ for (i = 0; i < n; i++) \
+ for (j = 0; j < n; j++) \
+ { \
+ int v = stuff->c[idx(i, j, n)]; \
+ for (k = 0; k < n; k++) \
+ v += stuff->a[idx(i, k, n)] * stuff->b[idx(k,j,n)]; \
+ stuff->c[idx(i, j, n)] = v; \
+ } \
+}
+
+#define recursion if (iter > 0) \
+ foo (stuff, iter - 1, (void *) -1, p_01, p_02, p_03, p_04, p_05, p_06, \
+ p_07, p_08, p_09, p_10, p_11, p_12, p_13, p_14, p_15, p_16, p_17, \
+ p_18, p_19, p_20, p_21, p_22, p_23, p_24, p_25, p_26, p_27, p_28, p_29); \
+ else \
+ foo (stuff, iter, p_01, p_02, p_03, p_04, p_05, p_06, p_07, p_08, p_09, \
+ p_10, p_11, p_12, p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20, \
+ p_21,p_22, p_23, p_24, p_25, p_26, p_27, p_28, p_29, p_30)
+
+void
+foo (struct stuff *stuff,
+ int iter,
+ void *p_01, void *p_02, void *p_03, void *p_04, void *p_05,
+ void *p_06, void *p_07, void *p_08, void *p_09, void *p_10,
+ void *p_11, void *p_12, void *p_13, void *p_14, void *p_15,
+ void *p_16, void *p_17, void *p_18, void *p_19, void *p_20,
+ void *p_21, void *p_22, void *p_23, void *p_24, void *p_25,
+ void *p_26, void *p_27, void *p_28, void *p_29, void *p_30)
+{
+ switch (stuff->decision)
+ {
+ case 0:
+ some_large_stuff (stuff, 83);
+ stuff->res =
+ use_data (p_01, p_02, p_03, p_04, p_05, p_06, p_07, p_08, p_09, p_10,
+ p_11, p_12, p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20,
+ p_21, p_22, p_23, p_24, p_25, p_26, p_27, p_28, p_29, p_30);
+ recursion;
+ break;
+
+ case 1:
+ some_large_stuff (stuff, 25);
+ stuff->res =
+ use_data (p_11, p_02, p_03, p_04, p_05, p_06, p_07, p_08, p_09, p_10,
+ p_21, p_12, p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20,
+ p_01, p_22, p_23, p_24, p_25, p_26, p_27, p_28, p_29, p_30);
+ recursion;
+ break;
+
+ case 3:
+ some_large_stuff (stuff, 139);
+ stuff->res =
+ use_data (p_01, p_12, p_03, p_04, p_05, p_06, p_07, p_08, p_09, p_10,
+ p_11, p_22, p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20,
+ p_21, p_02, p_23, p_24, p_25, p_26, p_27, p_28, p_29, p_30);
+ recursion;
+ break;
+
+ case 4:
+ some_large_stuff (stuff, 32);
+ stuff->res =
+ use_data (p_01, p_02, p_13, p_04, p_05, p_06, p_07, p_08, p_09, p_10,
+ p_11, p_12, p_23, p_14, p_15, p_16, p_17, p_18, p_19, p_20,
+ p_21, p_22, p_03, p_24, p_25, p_26, p_27, p_28, p_29, p_30);
+ recursion;
+ break;
+
+ case 5:
+ some_large_stuff (stuff, 205);
+ stuff->res =
+ use_data (p_01, p_02, p_03, p_04, p_15, p_06, p_07, p_08, p_09, p_10,
+ p_11, p_12, p_13, p_14, p_25, p_16, p_17, p_18, p_19, p_20,
+ p_21, p_22, p_23, p_24, p_05, p_26, p_27, p_28, p_29, p_30);
+ recursion;
+ break;
+
+ case 6:
+ some_large_stuff (stuff, 64);
+ stuff->res =
+ use_data (p_01, p_02, p_03, p_04, p_05, p_16, p_07, p_08, p_09, p_10,
+ p_11, p_12, p_13, p_14, p_15, p_26, p_17, p_18, p_19, p_20,
+ p_21, p_22, p_23, p_24, p_25, p_06, p_27, p_28, p_29, p_30);
+ recursion;
+ break;
+ }
+}
+
+#define NULL (void *)0
+
+void
+bar (struct stuff *stuff, int iter)
+{
+ foo (stuff, iter, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr51362.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr51362.c
new file mode 100644
index 000000000..e57dd5656
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr51362.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-cp -fipa-cp-clone" } */
+
+int
+baz (void)
+{
+ return 0;
+}
+
+int make_mess;
+
+__attribute__ ((noinline))
+int bar (int x, int (*f) (void))
+{
+ return f ();
+}
+
+int
+foo (void)
+{
+ return bar (1, baz);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr55260.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr55260.c
new file mode 100644
index 000000000..ef151b0a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr55260.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-inline -fipa-cp-clone" } */
+
+typedef struct {
+ int *ptr;
+ int len;
+} string;
+typedef struct {
+ string nantstr;
+ int *nant;
+} malv;
+typedef struct {
+ int *nor;
+} list_heads;
+int b;
+list_heads *fn1(string, int *, unsigned);
+void fn2(malv *p1, list_heads *p2, unsigned p3) {
+ string a = p1->nantstr;
+ fn1(a, p1->nant, p3);
+}
+
+void fn3(unsigned p1) { fn2(0, 0, p1); }
+
+list_heads *fn1(string p1, int *p2, unsigned p3) {
+ while (1) {
+ if (p3)
+ fn3(1);
+ if (b)
+ return 0;
+ fn3(1);
+ }
+}
+
+void fn5() {
+ list_heads c;
+ c.nor = 0;
+ fn2(0, &c, 1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr56988.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr56988.c
new file mode 100644
index 000000000..ab20159b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr56988.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+/* { dg-add-options bind_pic_locally } */
+
+struct S
+{
+ int a, b, c;
+};
+
+volatile int g;
+
+static void __attribute__ ((noinline, noclone))
+bar (struct S **p)
+{
+ g = 5;
+};
+
+static void __attribute__ ((noinline))
+foo (struct S *p)
+{
+ int i = p->a;
+ if (i != 1)
+ __builtin_abort ();
+ bar (&p);
+}
+
+int
+main (int argc, char *argv[])
+{
+ struct S s;
+ s.a = 1;
+ s.b = 64;
+ s.c = 32;
+ foo (&s);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57294.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57294.c
new file mode 100644
index 000000000..0871f3f41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57294.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void baz (void);
+int func ();
+
+static void
+bar (int a, int foo (void))
+{
+ baz ();
+ foo ();
+}
+
+void
+baz (void)
+{
+ bar (0, func);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57347.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57347.c
new file mode 100644
index 000000000..731b4868e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57347.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+struct S1 { int f0; int f1 : 10; int f2 : 13; };
+int i;
+int *j = &i;
+
+static void
+foo (struct S1 s)
+{
+ int *p;
+ int l[88];
+ int **pp = &p;
+ *pp = &l[1];
+ l[0] = 1;
+ *j = 1 && s.f2;
+}
+
+int
+main ()
+{
+ struct S1 s = { 0, 0, 1 };
+ foo (s);
+ if (i != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57358.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57358.c
new file mode 100644
index 000000000..c83396f4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57358.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct t { void (*func)(void*); };
+void test_func(struct t* a) __attribute__((optimize("O0")));
+void test_func(struct t* a)
+{
+ a->func(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57539.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57539.c
new file mode 100644
index 000000000..e02018eb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr57539.c
@@ -0,0 +1,218 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+typedef long unsigned int size_t;
+typedef struct
+{
+}
+box;
+typedef struct
+{
+}
+textpara_t;
+typedef struct _dtlink_s Dtlink_t;
+typedef struct _dtdisc_s Dtdisc_t;
+typedef struct _dtmethod_s Dtmethod_t;
+typedef struct _dt_s Dt_t;
+typedef void *(*Dtmemory_f) (Dt_t *, void *, size_t, Dtdisc_t *);
+typedef void *(*Dtsearch_f) (Dt_t *, void *, int);
+typedef void *(*Dtmake_f) (Dt_t *, void *, Dtdisc_t *);
+typedef void (*Dtfree_f) (Dt_t *, void *, Dtdisc_t *);
+typedef int (*Dtcompar_f) (Dt_t *, void *, void *, Dtdisc_t *);
+typedef unsigned int (*Dthash_f) (Dt_t *, void *, Dtdisc_t *);
+typedef int (*Dtevent_f) (Dt_t *, int, void *, Dtdisc_t *);
+struct _dtlink_s
+{
+ Dtlink_t *right;
+};
+struct _dtdisc_s
+{
+ int key;
+ int size;
+ int link;
+ Dtmake_f makef;
+ Dtfree_f freef;
+ Dtcompar_f comparf;
+ Dthash_f hashf;
+ Dtmemory_f memoryf;
+ Dtevent_f eventf;
+};
+struct _dt_s
+{
+ Dtsearch_f searchf;
+};
+extern Dtmethod_t *Dtobag;
+extern Dt_t *dtopen (Dtdisc_t *, Dtmethod_t *);
+extern Dtlink_t *dtflatten (Dt_t *);
+typedef struct Agobj_s Agobj_t;
+typedef struct Agraph_s Agraph_t;
+typedef struct Agnode_s Agnode_t;
+typedef struct Agedge_s Agedge_t;
+typedef struct Agdesc_s Agdesc_t;
+typedef struct Agdisc_s Agdisc_t;
+typedef struct Agrec_s Agrec_t;
+struct Agobj_s
+{
+ Agrec_t *data;
+};
+struct Agdesc_s
+{
+};
+extern Agraph_t *agopen (char *name, Agdesc_t desc, Agdisc_t * disc);
+extern Agnode_t *agfstnode (Agraph_t * g);
+extern Agnode_t *agnxtnode (Agraph_t * g, Agnode_t * n);
+extern Agedge_t *agedge (Agraph_t * g, Agnode_t * t, Agnode_t * h, char *name,
+ int createflag);
+extern Agedge_t *agfstout (Agraph_t * g, Agnode_t * n);
+extern Agedge_t *agnxtout (Agraph_t * g, Agedge_t * e);
+extern Agdesc_t Agdirected, Agstrictdirected, Agundirected,
+ Agstrictundirected;
+typedef struct Agraph_s graph_t;
+typedef struct Agnode_s node_t;
+typedef struct Agedge_s edge_t;
+typedef union inside_t
+{
+ unsigned short minlen;
+}
+Agedgeinfo_t;
+extern void *gmalloc (size_t);
+typedef enum
+{ AM_NONE, AM_VOR, AM_SCALE, AM_NSCALE, AM_SCALEXY, AM_PUSH, AM_PUSHPULL,
+ AM_ORTHO, AM_ORTHO_YX, AM_ORTHOXY, AM_ORTHOYX, AM_PORTHO, AM_PORTHO_YX,
+ AM_PORTHOXY, AM_PORTHOYX, AM_COMPRESS, AM_VPSC, AM_IPSEP, AM_PRISM }
+adjust_mode;
+typedef struct nitem
+{
+ Dtlink_t link;
+ int val;
+ node_t *cnode;
+ box bb;
+}
+nitem;
+typedef int (*distfn) (box *, box *);
+typedef int (*intersectfn) (nitem *, nitem *);
+static int
+cmpitem (Dt_t * d, int *p1, int *p2, Dtdisc_t * disc)
+{
+}
+static Dtdisc_t constr =
+ { __builtin_offsetof (nitem, val), sizeof (int), __builtin_offsetof (nitem,
+ link),
+((Dtmake_f) 0), ((Dtfree_f) 0), (Dtcompar_f) cmpitem, ((Dthash_f) 0), ((Dtmemory_f) 0),
+((Dtevent_f) 0) };
+static int
+distX (box * b1, box * b2)
+{
+}
+
+static int
+intersectY0 (nitem * p, nitem * q)
+{
+}
+
+static int
+intersectY (nitem * p, nitem * q)
+{
+}
+
+static void
+mapGraphs (graph_t * g, graph_t * cg, distfn dist)
+{
+ node_t *n;
+ edge_t *e;
+ edge_t *ce;
+ node_t *t;
+ node_t *h;
+ nitem *tp;
+ nitem *hp;
+ int delta;
+ for (n = agfstnode (g); n; n = agnxtnode (g, n))
+ {
+ for (e = agfstout (g, n); e; e = agnxtout (g, e))
+ {
+ delta = dist (&tp->bb, &hp->bb);
+ ce = agedge (cg, t, h, ((void *) 0), 1);
+ if ((((Agedgeinfo_t *) (((Agobj_t *) (ce))->data))->minlen) < delta)
+ {
+ if ((((Agedgeinfo_t *) (((Agobj_t *) (ce))->data))->minlen) ==
+ 0.0)
+ {
+ }
+ }
+ }
+ }
+}
+
+static graph_t *
+mkNConstraintG (graph_t * g, Dt_t * list, intersectfn intersect, distfn dist)
+{
+ nitem *p;
+ nitem *nxp;
+ edge_t *e;
+ graph_t *cg = agopen ("cg", Agstrictdirected, ((Agdisc_t *) 0));
+ for (p = (nitem *) dtflatten (list); p;
+ p = (nitem *) (((Dtlink_t *) ((Dtlink_t *) p))->right))
+ {
+ for (nxp = (nitem *) (((Dtlink_t *) ((Dtlink_t *) p))->right); nxp;
+ nxp = (nitem *) (((Dtlink_t *) ((Dtlink_t *) nxp))->right))
+ {
+ if (intersect (p, nxp))
+ {
+ e = agedge (cg, p->cnode, nxp->cnode, ((void *) 0), 1);
+ }
+ }} for (p = (nitem *) dtflatten (list); p;
+ p = (nitem *) (((Dtlink_t *) ((Dtlink_t *) p))->right))
+ {
+ }
+}
+
+static graph_t *
+mkConstraintG (graph_t * g, Dt_t * list, intersectfn intersect, distfn dist)
+{
+ graph_t *vg;
+ graph_t *cg = agopen ("cg", Agstrictdirected, ((Agdisc_t *) 0));
+ mapGraphs (vg, cg, dist);
+}
+
+static void
+constrainX (graph_t * g, nitem * nlist, int nnodes, intersectfn ifn,
+ int ortho)
+{
+ Dt_t *list = dtopen (&constr, Dtobag);
+ nitem *p = nlist;
+ graph_t *cg;
+ int i;
+ for (i = 0; i < nnodes; i++)
+ {
+ (*(((Dt_t *) (list))->searchf)) ((list), (void *) (p), 0000001);
+ p++;
+ } if (ortho)
+ cg = mkConstraintG (g, list, ifn, distX);
+ else
+ cg = mkNConstraintG (g, list, ifn, distX);
+}
+
+int
+cAdjust (graph_t * g, int mode)
+{
+ int ret, i, nnodes = agnnodes (g);
+ nitem *nlist = (nitem *) gmalloc ((nnodes) * sizeof (nitem));
+ node_t *n;
+ for (n = agfstnode (g); n; n = agnxtnode (g, n))
+ {
+ }
+ if (overlaps (nlist, nnodes))
+ {
+ switch ((adjust_mode) mode)
+ {
+ case AM_ORTHOXY:
+ constrainX (g, nlist, nnodes, intersectY, 1);
+ case AM_ORTHO:
+ constrainX (g, nlist, nnodes, intersectY0, 1);
+ constrainX (g, nlist, nnodes, intersectY, 1);
+ case AM_PORTHO:
+ default:
+ constrainX (g, nlist, nnodes, intersectY0, 0);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr58106.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr58106.c
new file mode 100644
index 000000000..b83353c4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr58106.c
@@ -0,0 +1,50 @@
+/* PR 58106 testcase. Verify that rdesc chain creating and lookup works with
+ recursive inlining and master clone creation. */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+typedef struct rtx_def *rtx;
+enum rtx_code {
+ LAST_AND_UNUSED_RTX_CODE};
+extern const char * const rtx_format[((int) LAST_AND_UNUSED_RTX_CODE)];
+struct rtx_def {
+ enum rtx_code code;
+};
+typedef int (*rtx_function) (rtx *, void *);
+extern int for_each_rtx (rtx *, rtx_function, void *);
+int
+replace_label (rtx *x, void *data)
+{
+ rtx l = *x;
+ if (l == (rtx) 0)
+ {
+ {
+ rtx new_c, new_l;
+ for_each_rtx (&new_c, replace_label, data);
+ }
+ }
+}
+static int
+for_each_rtx_1 (rtx exp, int n, rtx_function f, void *data)
+{
+ int result, i, j;
+ const char *format = (rtx_format[(int) (((enum rtx_code) (exp)->code))]);
+ rtx *x;
+ for (; format[n] != '\0'; n++)
+ {
+ switch (format[n])
+ {
+ case 'e':
+ result = (*f) (x, data);
+ {
+ result = for_each_rtx_1 (*x, i, f, data);
+ }
+ }
+ }
+}
+int
+for_each_rtx (rtx *x, rtx_function f, void *data)
+{
+ int i;
+ return for_each_rtx_1 (*x, i, f, data);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr58492.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr58492.c
new file mode 100644
index 000000000..79958d564
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr58492.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-pta" } */
+
+void f(int p, short q)
+{
+ f(0, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr59008.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr59008.c
new file mode 100644
index 000000000..b72967243
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr59008.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+typedef int (*funct)(int, int, int);
+
+extern int f(int, int, int);
+extern int g(int, int, int);
+extern int h(int, funct, funct);
+
+static int baz(int x, int y, int z)
+{
+ return x + y + z;
+}
+
+static int bar(int n, funct f1, funct f2)
+{
+ return h(n, f1, f2) + f1(0, 1, 2);
+}
+
+static int foo(int n, funct f1, funct f2)
+{
+ return bar(n, f1, f2) + f2(0, 1, 2);
+}
+
+int main(void)
+{
+ return foo(0, f, g)
+#ifndef ICE2
+ + foo(0, baz, g)
+#endif
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr59610.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr59610.c
new file mode 100644
index 000000000..fc0933441
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pr59610.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct A { int a; };
+extern void *y;
+
+__attribute__((optimize (0))) void
+foo (void *p, struct A x)
+{
+ foo (y, x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pure-const-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
new file mode 100644
index 000000000..f76dd87d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
@@ -0,0 +1,80 @@
+/* { dg-do compile { target nonpic } } */
+/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining" } */
+void abort (void);
+int error_code;
+static int val;
+__attribute__ ((noinline, noclone))
+static int
+i_am_pure1 (int a)
+{
+ if (a > 50)
+ abort ();
+ return a;
+}
+
+__attribute__ ((noinline, noclone))
+static int
+i_am_const2 (int a)
+{
+ return a+val;
+}
+
+__attribute__ ((noinline, noclone))
+int
+call_me(int a)
+{
+ return a;
+}
+
+inline int
+call_callback(int (*fn)(int), int a)
+{
+ return fn(a);
+}
+
+__attribute__ ((noinline, noclone))
+i_am_const3(int a)
+{
+ return call_callback (call_me, a);
+}
+
+__attribute__ ((noinline))
+explode_badly()
+{
+ error_code = 0xbad;
+ abort ();
+}
+
+__attribute__ ((noinline, noclone))
+i_am_pure4(int a)
+{
+ if (a > 50)
+ explode_badly ();
+ return a;
+}
+
+test()
+{
+ int s;
+ s = i_am_pure1(5);
+ s += i_am_pure1(5);
+ s += i_am_const2(5);
+ s += i_am_const2(5);
+ s += i_am_const3(5);
+ s += i_am_const3(5);
+ s += i_am_pure4(5);
+ s += i_am_pure4(5);
+ return s;
+}
+/* { dg-final { scan-tree-dump-times "i_am_pure1 .5" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "i_am_const2 .5" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "i_am_const3 .5" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "i_am_pure4 .5" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump "found to be looping pure: i_am_pure1" "local-pure-const1"} } */
+/* { dg-final { scan-tree-dump "found to be looping pure: i_am_pure4" "local-pure-const1"} } */
+/* { dg-final { scan-ipa-dump "found to be const: i_am_const2" "pure-const"} } */
+/* { dg-final { scan-ipa-dump "found to be const: i_am_const3" "pure-const"} } */
+/* { dg-final { cleanup-tree-dump "local-pure-const1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+/* { dg-final { cleanup-ipa-dump "pure-const" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pure-const-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pure-const-2.c
new file mode 100644
index 000000000..2dcca18c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/pure-const-2.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-tree-optimized" } */
+static __attribute__ ((noinline, noclone))
+int i_am_pure(char *c, int n)
+{
+ char *d=__builtin_alloca (n);
+ int i;
+ int sum;
+ for (i=0;i<n;i++)
+ d[i] = c[i];
+ for (i=0;i<n;i++)
+ d[i] *= c[n-i];
+ for (i=0;i<n;i++)
+ sum+=d[i];
+ if (sum)
+ __builtin_unreachable ();
+ return sum;
+}
+char array[11];
+int
+main(void)
+{
+ i_am_pure (array,5);
+ i_am_pure (array,11);
+ return 0;
+}
+/* { dg-final { scan-tree-dump "found to be pure: i_am_pure" "local-pure-const1"} } */
+/* { dg-final { scan-tree-dump-not "i_am_pure" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "local-pure-const1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-0.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-0.c
new file mode 100644
index 000000000..a9e434a86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-0.c
@@ -0,0 +1,30 @@
+/* Verify that indirect inlining machinery can remove references to functions
+ passed as parameters that are never used. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-early-inlining -fno-ipa-sra -fno-ipa-cp -fdump-ipa-inline -fdump-tree-optimized" } */
+
+extern int __attribute__ ((noinline, noclone, used))
+stuff (int i)
+{
+ return 0;
+}
+
+static void hooray ()
+{
+ stuff (1);
+}
+
+static int hiphip (void (*f)())
+{
+ return stuff (2);
+}
+
+int main (void)
+{
+ return hiphip (hooray);
+}
+
+/* { dg-final { scan-ipa-dump "ipa-prop: Removed a reference" "inline" } } */
+/* { dg-final { scan-tree-dump-not "hooray" "optimized" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-1a.c
new file mode 100644
index 000000000..9db2bd619
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-1a.c
@@ -0,0 +1,34 @@
+/* Verify that indirect inlining can also remove references of the functions it
+ discovers calls for. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-early-inlining -fno-ipa-cp -fdump-ipa-inline -fdump-tree-optimized" } */
+
+int global;
+
+void __attribute__ ((noinline, noclone, used))
+stuff (int i)
+{
+ global = i;
+}
+
+static void hooray ()
+{
+ stuff (1);
+}
+
+static void hiphip (void (*f)())
+{
+ stuff (2);
+ f ();
+}
+
+int main (void)
+{
+ hiphip (hooray);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "ipa-prop: Removed a reference" "inline" } } */
+/* { dg-final { scan-tree-dump-not "hooray" "optimized" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-1b.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-1b.c
new file mode 100644
index 000000000..a17cf4828
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-1b.c
@@ -0,0 +1,37 @@
+/* Verify that indirect inlining can also remove references of the functions it
+ discovers calls for, even when nodes being inlined are virtual IPA-CP
+ clones. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-early-inlining -fdump-ipa-cp-details -fdump-ipa-inline -fdump-tree-optimized" } */
+
+int global;
+
+void __attribute__ ((noinline, noclone, used))
+stuff (int i)
+{
+ global = i;
+}
+
+static void hooray ()
+{
+ stuff (1);
+}
+
+static void hiphip (void (*f)())
+{
+ stuff (2);
+ f ();
+}
+
+int main (void)
+{
+ hiphip (hooray);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "removing its cloning-created reference" "cp" } } */
+/* { dg-final { scan-ipa-dump "ipa-prop: Removed a reference" "inline" } } */
+/* { dg-final { scan-tree-dump-not "hooray" "optimized" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-2a.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-2a.c
new file mode 100644
index 000000000..1e0df2e84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-2a.c
@@ -0,0 +1,90 @@
+/* Verify that indirect inlining can also remove references of the functions it
+ discovers calls for. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-early-inlining -fno-ipa-cp -fdump-ipa-inline -fdump-tree-optimized" } */
+
+int global;
+
+void __attribute__ ((noinline, noclone, used))
+stuff (int i)
+{
+ global = i;
+}
+
+int __attribute__ ((noinline,noclone)) get_input(void)
+{
+ return 1;
+}
+
+static void
+hooray_1 ()
+{
+ stuff (1);
+}
+
+static inline void
+hip2_1 (void (*g)())
+{
+ int i;
+ g ();
+ /* Some stuff to make the function bigger so that hip1_1 gets inlined
+ fiorst. */
+ for (i = 0; i < get_input (); i++)
+ {
+ stuff (2);
+ stuff (2+2);
+ }
+}
+
+static inline void
+hip1_1 (void (*g)())
+{
+ hip2_1 (g);
+}
+
+static void
+hooray_2 ()
+{
+ stuff (1);
+}
+
+static inline void
+hip2_2 (void (*g)())
+{
+ g ();
+}
+
+static inline void
+hip1_2 (void (*g)())
+{
+ int i;
+
+ hip2_2 (g);
+
+ /* Some stuff to make the function bigger so that hip2_2 gets inlined
+ fiorst. */
+ for (i = 0; i < get_input (); i++)
+ {
+ stuff (2);
+ stuff (2+2);
+ }
+}
+
+
+int
+main (int argc, int *argv[])
+{
+ int i;
+
+ for (i = 0; i < get_input (); i++)
+ {
+ hip1_1 (hooray_1);
+ hip1_2 (hooray_2);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump-times "ipa-prop: Removed a reference" 2 "inline" } } */
+/* { dg-final { scan-tree-dump-not "hooray" "optimized" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-2b.c b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-2b.c
new file mode 100644
index 000000000..554f306d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ipa/remref-2b.c
@@ -0,0 +1,94 @@
+/* Verify that indirect inlining can also remove references of the functions it
+ discovers calls for, even when nodes being inlined are virtual IPA-CP
+ clones. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-early-inlining -fdump-ipa-cp-details -fdump-ipa-inline -fdump-tree-optimized" } */
+
+
+int global;
+
+void __attribute__ ((noinline, noclone, used))
+stuff (int i)
+{
+ global = i;
+}
+
+int __attribute__ ((noinline,noclone)) get_input(void)
+{
+ return 1;
+}
+
+static void
+hooray_1 ()
+{
+ stuff (1);
+}
+
+static inline void
+hip2_1 (void (*g)())
+{
+ int i;
+ g ();
+ /* Some stuff to make the function bigger so that hip1_1 gets inlined
+ fiorst. */
+ for (i = 0; i < get_input (); i++)
+ {
+ stuff (2);
+ stuff (2+2);
+ }
+}
+
+static inline void
+hip1_1 (void (*g)())
+{
+ hip2_1 (g);
+}
+
+static void
+hooray_2 ()
+{
+ stuff (1);
+}
+
+static inline void
+hip2_2 (void (*g)())
+{
+ g ();
+}
+
+static inline void
+hip1_2 (void (*g)())
+{
+ int i;
+
+ hip2_2 (g);
+
+ /* Some stuff to make the function bigger so that hip2_2 gets inlined
+ fiorst. */
+ for (i = 0; i < get_input (); i++)
+ {
+ stuff (2);
+ stuff (2+2);
+ }
+}
+
+int
+main (int argc, int *argv[])
+{
+ int i;
+
+ for (i = 0; i < get_input (); i++)
+ {
+ hip1_1 (hooray_1);
+ hip1_2 (hooray_2);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump-times "removing its cloning-created reference" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "ipa-prop: Removed a reference" "inline" } } */
+/* { dg-final { scan-ipa-dump-times "ipa-prop: Removing cloning-created reference" 2 "inline" } } */
+/* { dg-final { scan-tree-dump-not "hooray" "optimized" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
new file mode 100644
index 000000000..54d3e7615
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
@@ -0,0 +1,31 @@
+/* { dg-do compile { target { { x86_64-*-* && lp64 } || { powerpc*-*-* && lp64 } } } } */
+/* { dg-options "-O3 -fdump-rtl-ira -fdump-rtl-pro_and_epilogue" } */
+
+long __attribute__((noinline, noclone))
+foo (long a)
+{
+ return a + 5;
+}
+
+static long g;
+
+long __attribute__((noinline, noclone))
+bar (long a)
+{
+ long r;
+
+ if (a)
+ {
+ r = foo (a);
+ g = r + a;
+ }
+ else
+ r = a+1;
+ return r;
+}
+
+/* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
+/* { dg-final { scan-rtl-dump "Split live-range of register" "ira" } } */
+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
+/* { dg-final { cleanup-rtl-dump "ira" } } */
+/* { dg-final { cleanup-rtl-dump "pro_and_epilogue" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c
new file mode 100644
index 000000000..ed08494cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c
@@ -0,0 +1,36 @@
+/* { dg-do compile { target { { x86_64-*-* && lp64 } || { powerpc*-*-* && lp64 } } } } */
+/* { dg-options "-O3 -fdump-rtl-ira -fdump-rtl-pro_and_epilogue" } */
+
+long __attribute__((noinline, noclone))
+foo (long a)
+{
+ return a + 5;
+}
+
+static long g;
+
+long __attribute__((noinline, noclone))
+bar (long a)
+{
+ long r;
+
+ if (a)
+ {
+ r = a;
+ while (r < 500)
+ if (r % 2)
+ r = foo (r);
+ else
+ r = foo (r+1);
+ g = r + a;
+ }
+ else
+ r = g+1;
+ return r;
+}
+
+/* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
+/* { dg-final { scan-rtl-dump "Split live-range of register" "ira" } } */
+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
+/* { dg-final { cleanup-rtl-dump "ira" } } */
+/* { dg-final { cleanup-rtl-dump "pro_and_epilogue" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ivdep.c b/gcc-4.9/gcc/testsuite/gcc.dg/ivdep.c
new file mode 100644
index 000000000..23d51de9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ivdep.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+/* PR other/33426 */
+
+void foo(int n, int *a, int *b, int *c, int *d, int *e) {
+ int i, j;
+#pragma GCC ivdep
+ for (i = 0; ; ++i) { /* { dg-error "missing loop condition in loop with 'GCC ivdep' pragma before ';' token" } */
+ a[i] = b[i] + c[i];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/kpice1.c b/gcc-4.9/gcc/testsuite/gcc.dg/kpice1.c
new file mode 100644
index 000000000..be9179b03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/kpice1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target h8300-*-* } } */
+/* { dg-options "-ms -mn" } */
+
+void f(void) __attribute__((interrupt_handler));
+void g(void) { }
+void f(void) { g(); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/label-compound-stmt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/label-compound-stmt-1.c
new file mode 100644
index 000000000..71411631b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/label-compound-stmt-1.c
@@ -0,0 +1,7 @@
+/* Test that labels at ends of compound statements are hard errors. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f(void) { g: } /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "label|parse|syntax" "label at end of compound statement" { target *-*-* } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-1.c
new file mode 100644
index 000000000..3b33888d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-1.c
@@ -0,0 +1,17 @@
+/* Test diagnostics for label declarations. Test with no special
+ options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int b;
+
+void
+f (void)
+{
+ __label__ a, b, c, d;
+ __extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */
+ goto c; /* { dg-error "label 'c' used but not defined" } */
+ a: (void)0;
+ b: (void)0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-2.c
new file mode 100644
index 000000000..6706a706b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-2.c
@@ -0,0 +1,16 @@
+/* Test diagnostics for label declarations. Test with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+typedef int b;
+
+void
+f (void)
+{
+ __label__ a, b, c, d; /* { dg-warning "ISO C forbids label declarations" "label decls" { target *-*-* } 11 } */
+ __extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */
+ goto c; /* { dg-error "label 'c' used but not defined" } */
+ a: (void)0;
+ b: (void)0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-3.c
new file mode 100644
index 000000000..32daea87f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-3.c
@@ -0,0 +1,18 @@
+/* Test diagnostics for label declarations. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+typedef int b;
+
+void
+f (void)
+{
+ __label__ a, b, c, d;
+ __extension__ (void)&&d; /* { dg-error "label 'd' used but not defined" } */
+ /* { dg-error "ISO C forbids label declarations" "label decls" { target *-*-* } 12 } */
+ goto c; /* { dg-error "label 'c' used but not defined" } */
+ a: (void)0;
+ b: (void)0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-4.c
new file mode 100644
index 000000000..3cfe965fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/label-decl-4.c
@@ -0,0 +1,14 @@
+/* Test diagnostics for duplicate label declarations. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f (void)
+{
+ __label__ a, b, a; /* { dg-error "duplicate label declaration 'a'" } */
+ /* { dg-message "note: previous declaration of 'a' was here" "previous" { target *-*-* } 9 } */
+ __label__ c; /* { dg-message "note: previous declaration of 'c' was here" } */
+ __label__ c; /* { dg-error "duplicate label declaration 'c'" } */
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-2.c
new file mode 100644
index 000000000..bff2f8250
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-2.c
@@ -0,0 +1,7 @@
+/* PR c/25309 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+static char * name[] = {
+ [0x80000000] = "bar"
+ };
+/* { dg-error "too large" "" { target { { ! lp64 } && { ! llp64 } } } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-3.c
new file mode 100644
index 000000000..ea13b933a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-3.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+#include <limits.h>
+
+#if defined(__LP64__) || defined(_WIN64)
+#define DIM (UINT_MAX>>1)+1
+#else
+#define DIM 65536
+#endif
+
+int
+sub (int *a)
+{
+ return a[0];
+}
+
+int
+main (void)
+{
+ int a[DIM][DIM]; /* { dg-error "size of array 'a' is too large" } */
+ return sub (&a[0][0]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-4.c
new file mode 100644
index 000000000..f6099b915
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-4.c
@@ -0,0 +1,7 @@
+/* PR c/25309 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+static char * name[] = {
+ [0x80000000] = "bar"
+ };
+/* { dg-error "too large" "" { target { { ! lp64 } && { ! llp64 } } } 6 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-5.c
new file mode 100644
index 000000000..71ac47374
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-5.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-overflow" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern char a[((size_t)-1 >> 1) + 1]; /* { dg-error "too large" } */
+extern char b[((size_t)-1 >> 1)];
+extern int c[(((size_t)-1 >> 1) + 1) / sizeof(int)]; /* { dg-error "too large" } */
+extern int d[((size_t)-1 >> 1) / sizeof(int)];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-6.c
new file mode 100644
index 000000000..f7da47e93
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array-6.c
@@ -0,0 +1,6 @@
+/* PR c/57821 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+static char * name[] = {
+ [0x8000000000000000] = "bar"
+ }; /* { dg-error "too large" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array.c
new file mode 100644
index 000000000..6ea760669
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/large-size-array.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+#include <limits.h>
+
+#if defined(__LP64__) || defined(_WIN64)
+#define DIM UINT_MAX>>1
+#else
+#define DIM USHRT_MAX>>1
+#endif
+
+int
+sub (int *a)
+{
+ return a[0];
+}
+
+int
+main (void)
+{
+ int a[DIM][DIM]; /* { dg-error "size of array 'a' is too large" } */
+ return sub (&a[0][0]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lazy-ptr-test.c b/gcc-4.9/gcc/testsuite/gcc.dg/lazy-ptr-test.c
new file mode 100644
index 000000000..da66b518f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lazy-ptr-test.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target powerpc*-apple-darwin* } } */
+/* { dg-options "-S" } */
+
+void f () __attribute__((weak_import));
+
+typedef void PF (void);
+
+void f(void){};
+
+PF* g (void) { return f; }
+
+int main()
+{
+ (*g())();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "non_lazy_ptr" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/local1.c b/gcc-4.9/gcc/testsuite/gcc.dg/local1.c
new file mode 100644
index 000000000..e9f653bcc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/local1.c
@@ -0,0 +1,23 @@
+/* This is allowed, with the effect that the 'extern' declaration at block
+ scope refers to the same object as the 'static' declaration at file scope.
+
+ C90 6.1.2.2 [as corrected by TC1], C99 6.2.2:
+
+ For an identifier declared with the storage-class specifier
+ extern in a scope in which a prior declaration of that
+ identifier is visible, if the prior declaration specifies
+ internal or external linkage, the linkage of the identifier at
+ the later daclaration is the same as the linkage specified at
+ the prior declaration. If no prior declaration is visible,
+ or if the prior declaration specifies no linkage, then the
+ identifer has external linkage.
+
+ This is PR 14366. */
+
+static int i;
+
+extern int i;
+
+static void f() {
+ extern int i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/long-long-compare-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/long-long-compare-1.c
new file mode 100644
index 000000000..e05fcead2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/long-long-compare-1.c
@@ -0,0 +1,124 @@
+/* Problem noticed on SH for DImode comparison with constants.
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort(void);
+extern void exit(int);
+
+int test2(long long n)
+{
+ if (n < 2)
+ return 1;
+ return 0;
+}
+
+int test1(long long n)
+{
+ if (n < 1)
+ return 1;
+ return 0;
+}
+
+int test0(long long n)
+{
+ if (n < 0)
+ return 1;
+ return 0;
+}
+
+int test1n(long long n)
+{
+ if (n < -1LL)
+ return 1;
+ return 0;
+}
+
+int test2n(long long n)
+{
+ if (n < -2LL)
+ return 1;
+ return 0;
+}
+
+int main()
+{
+ if (test2n (-1LL))
+ abort ();
+
+ if (test2n (-2LL))
+ abort ();
+
+ if (test2n (0LL))
+ abort ();
+
+ if (test2n (1LL))
+ abort ();
+
+ if (test2n (2LL))
+ abort ();
+
+ if (test1n (-1LL))
+ abort ();
+
+ if (!test1n (-2LL))
+ abort ();
+
+ if (test1n (0LL))
+ abort ();
+
+ if (test1n (1LL))
+ abort ();
+
+ if (test1n (2LL))
+ abort ();
+
+ if (!test0 (-1LL))
+ abort ();
+
+ if (!test0 (-2LL))
+ abort ();
+
+ if (test0 (0LL))
+ abort ();
+
+ if (test0 (1LL))
+ abort ();
+
+ if (test0 (2LL))
+ abort ();
+
+ if (!test2 (-1LL))
+ abort ();
+
+ if (!test2 (-2LL))
+ abort ();
+
+ if (!test2 (0LL))
+ abort ();
+
+ if (!test2 (1LL))
+ abort ();
+
+ if (test2 (2LL))
+ abort ();
+
+ if (!test1 (-1LL))
+ abort ();
+
+ if (!test1 (-2LL))
+ abort ();
+
+ if (!test1 (0LL))
+ abort ();
+
+ if (test1 (1LL))
+ abort ();
+
+ if (test1 (2LL))
+ abort ();
+
+ exit (0);
+}
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/long-long-cst1.c b/gcc-4.9/gcc/testsuite/gcc.dg/long-long-cst1.c
new file mode 100644
index 000000000..800d6d64b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/long-long-cst1.c
@@ -0,0 +1,18 @@
+/* PR middle-end/27724 */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+extern void abort();
+
+struct st{
+ int _mark;
+};
+unsigned long long t = ((int)(__UINTPTR_TYPE__)&(((struct st*)16)->_mark) - 32);
+
+int main()
+{
+ if (t != (unsigned long long)(int)-16)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/long-long-typespec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/long-long-typespec-1.c
new file mode 100644
index 000000000..2ef2416f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/long-long-typespec-1.c
@@ -0,0 +1,828 @@
+/* Test for valid and invalid combinations of type specifiers in C90
+ with -Wno-long-long. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors -Wno-long-long" } */
+
+typedef char type;
+extern *x0;
+void *x1;
+char *x2;
+short *x3;
+int *x4;
+long *x5;
+float *x6;
+double *x7;
+signed *x8;
+unsigned *x9;
+type *x10;
+void void *x11; /* { dg-error "" "void void" } */
+void char *x12; /* { dg-error "" "void char" } */
+void short *x13; /* { dg-error "" "void short" } */
+void int *x14; /* { dg-error "" "void int" } */
+void long *x15; /* { dg-error "" "void long" } */
+void float *x16; /* { dg-error "" "void float" } */
+void double *x17; /* { dg-error "" "void double" } */
+void signed *x18; /* { dg-error "" "void signed" } */
+void unsigned *x19; /* { dg-error "" "void unsigned" } */
+char void *x20; /* { dg-error "" "char void" } */
+char char *x21; /* { dg-error "" "char char" } */
+char short *x22; /* { dg-error "" "char short" } */
+char int *x23; /* { dg-error "" "char int" } */
+char long *x24; /* { dg-error "" "char long" } */
+char float *x25; /* { dg-error "" "char float" } */
+char double *x26; /* { dg-error "" "char double" } */
+char signed *x27;
+char unsigned *x28;
+short void *x29; /* { dg-error "" "short void" } */
+short char *x30; /* { dg-error "" "short char" } */
+short short *x31; /* { dg-error "" "short short" } */
+short int *x32;
+short long *x33; /* { dg-error "" "short long" } */
+short float *x34; /* { dg-error "" "short float" } */
+short double *x35; /* { dg-error "" "short double" } */
+short signed *x36;
+short unsigned *x37;
+int void *x38; /* { dg-error "" "int void" } */
+int char *x39; /* { dg-error "" "int char" } */
+int short *x40;
+int int *x41; /* { dg-error "" "int int" } */
+int long *x42;
+int float *x43; /* { dg-error "" "int float" } */
+int double *x44; /* { dg-error "" "int double" } */
+int signed *x45;
+int unsigned *x46;
+long void *x47; /* { dg-error "" "long void" } */
+long char *x48; /* { dg-error "" "long char" } */
+long short *x49; /* { dg-error "" "long short" } */
+long int *x50;
+long long *x51;
+long float *x52; /* { dg-error "" "long float" } */
+long double *x53;
+long signed *x54;
+long unsigned *x55;
+float void *x56; /* { dg-error "" "float void" } */
+float char *x57; /* { dg-error "" "float char" } */
+float short *x58; /* { dg-error "" "float short" } */
+float int *x59; /* { dg-error "" "float int" } */
+float long *x60; /* { dg-error "" "float long" } */
+float float *x61; /* { dg-error "" "float float" } */
+float double *x62; /* { dg-error "" "float double" } */
+float signed *x63; /* { dg-error "" "float signed" } */
+float unsigned *x64; /* { dg-error "" "float unsigned" } */
+double void *x65; /* { dg-error "" "double void" } */
+double char *x66; /* { dg-error "" "double char" } */
+double short *x67; /* { dg-error "" "double short" } */
+double int *x68; /* { dg-error "" "double int" } */
+double long *x69;
+double float *x70; /* { dg-error "" "double float" } */
+double double *x71; /* { dg-error "" "double double" } */
+double signed *x72; /* { dg-error "" "double signed" } */
+double unsigned *x73; /* { dg-error "" "double unsigned" } */
+signed void *x74; /* { dg-error "" "signed void" } */
+signed char *x75;
+signed short *x76;
+signed int *x77;
+signed long *x78;
+signed float *x79; /* { dg-error "" "signed float" } */
+signed double *x80; /* { dg-error "" "signed double" } */
+signed signed *x81; /* { dg-error "" "signed signed" } */
+signed unsigned *x82; /* { dg-error "" "signed unsigned" } */
+unsigned void *x83; /* { dg-error "" "unsigned void" } */
+unsigned char *x84;
+unsigned short *x85;
+unsigned int *x86;
+unsigned long *x87;
+unsigned float *x88; /* { dg-error "" "unsigned float" } */
+unsigned double *x89; /* { dg-error "" "unsigned double" } */
+unsigned signed *x90; /* { dg-error "" "unsigned signed" } */
+unsigned unsigned *x91; /* { dg-error "" "unsigned unsigned" } */
+type void *x92; /* { dg-error "" "type void" } */
+type char *x93; /* { dg-error "" "type char" } */
+type short *x94; /* { dg-error "" "type short" } */
+type int *x95; /* { dg-error "" "type int" } */
+type long *x96; /* { dg-error "" "type long" } */
+type float *x97; /* { dg-error "" "type float" } */
+type double *x98; /* { dg-error "" "type double" } */
+type signed *x99; /* { dg-error "" "type signed" } */
+type unsigned *x100; /* { dg-error "" "type unsigned" } */
+char signed void *x101; /* { dg-error "" "char signed void" } */
+char signed char *x102; /* { dg-error "" "char signed char" } */
+char signed short *x103; /* { dg-error "" "char signed short" } */
+char signed int *x104; /* { dg-error "" "char signed int" } */
+char signed long *x105; /* { dg-error "" "char signed long" } */
+char signed float *x106; /* { dg-error "" "char signed float" } */
+char signed double *x107; /* { dg-error "" "char signed double" } */
+char signed signed *x108; /* { dg-error "" "char signed signed" } */
+char signed unsigned *x109; /* { dg-error "" "char signed unsigned" } */
+char unsigned void *x110; /* { dg-error "" "char unsigned void" } */
+char unsigned char *x111; /* { dg-error "" "char unsigned char" } */
+char unsigned short *x112; /* { dg-error "" "char unsigned short" } */
+char unsigned int *x113; /* { dg-error "" "char unsigned int" } */
+char unsigned long *x114; /* { dg-error "" "char unsigned long" } */
+char unsigned float *x115; /* { dg-error "" "char unsigned float" } */
+char unsigned double *x116; /* { dg-error "" "char unsigned double" } */
+char unsigned signed *x117; /* { dg-error "" "char unsigned signed" } */
+char unsigned unsigned *x118; /* { dg-error "" "char unsigned unsigned" } */
+short int void *x119; /* { dg-error "" "short int void" } */
+short int char *x120; /* { dg-error "" "short int char" } */
+short int short *x121; /* { dg-error "" "short int short" } */
+short int int *x122; /* { dg-error "" "short int int" } */
+short int long *x123; /* { dg-error "" "short int long" } */
+short int float *x124; /* { dg-error "" "short int float" } */
+short int double *x125; /* { dg-error "" "short int double" } */
+short int signed *x126;
+short int unsigned *x127;
+short signed void *x128; /* { dg-error "" "short signed void" } */
+short signed char *x129; /* { dg-error "" "short signed char" } */
+short signed short *x130; /* { dg-error "" "short signed short" } */
+short signed int *x131;
+short signed long *x132; /* { dg-error "" "short signed long" } */
+short signed float *x133; /* { dg-error "" "short signed float" } */
+short signed double *x134; /* { dg-error "" "short signed double" } */
+short signed signed *x135; /* { dg-error "" "short signed signed" } */
+short signed unsigned *x136; /* { dg-error "" "short signed unsigned" } */
+short unsigned void *x137; /* { dg-error "" "short unsigned void" } */
+short unsigned char *x138; /* { dg-error "" "short unsigned char" } */
+short unsigned short *x139; /* { dg-error "" "short unsigned short" } */
+short unsigned int *x140;
+short unsigned long *x141; /* { dg-error "" "short unsigned long" } */
+short unsigned float *x142; /* { dg-error "" "short unsigned float" } */
+short unsigned double *x143; /* { dg-error "" "short unsigned double" } */
+short unsigned signed *x144; /* { dg-error "" "short unsigned signed" } */
+short unsigned unsigned *x145; /* { dg-error "" "short unsigned unsigned" } */
+int short void *x146; /* { dg-error "" "int short void" } */
+int short char *x147; /* { dg-error "" "int short char" } */
+int short short *x148; /* { dg-error "" "int short short" } */
+int short int *x149; /* { dg-error "" "int short int" } */
+int short long *x150; /* { dg-error "" "int short long" } */
+int short float *x151; /* { dg-error "" "int short float" } */
+int short double *x152; /* { dg-error "" "int short double" } */
+int short signed *x153;
+int short unsigned *x154;
+int long void *x155; /* { dg-error "" "int long void" } */
+int long char *x156; /* { dg-error "" "int long char" } */
+int long short *x157; /* { dg-error "" "int long short" } */
+int long int *x158; /* { dg-error "" "int long int" } */
+int long long *x159;
+int long float *x160; /* { dg-error "" "int long float" } */
+int long double *x161; /* { dg-error "" "int long double" } */
+int long signed *x162;
+int long unsigned *x163;
+int signed void *x164; /* { dg-error "" "int signed void" } */
+int signed char *x165; /* { dg-error "" "int signed char" } */
+int signed short *x166;
+int signed int *x167; /* { dg-error "" "int signed int" } */
+int signed long *x168;
+int signed float *x169; /* { dg-error "" "int signed float" } */
+int signed double *x170; /* { dg-error "" "int signed double" } */
+int signed signed *x171; /* { dg-error "" "int signed signed" } */
+int signed unsigned *x172; /* { dg-error "" "int signed unsigned" } */
+int unsigned void *x173; /* { dg-error "" "int unsigned void" } */
+int unsigned char *x174; /* { dg-error "" "int unsigned char" } */
+int unsigned short *x175;
+int unsigned int *x176; /* { dg-error "" "int unsigned int" } */
+int unsigned long *x177;
+int unsigned float *x178; /* { dg-error "" "int unsigned float" } */
+int unsigned double *x179; /* { dg-error "" "int unsigned double" } */
+int unsigned signed *x180; /* { dg-error "" "int unsigned signed" } */
+int unsigned unsigned *x181; /* { dg-error "" "int unsigned unsigned" } */
+long int void *x182; /* { dg-error "" "long int void" } */
+long int char *x183; /* { dg-error "" "long int char" } */
+long int short *x184; /* { dg-error "" "long int short" } */
+long int int *x185; /* { dg-error "" "long int int" } */
+long int long *x186;
+long int float *x187; /* { dg-error "" "long int float" } */
+long int double *x188; /* { dg-error "" "long int double" } */
+long int signed *x189;
+long int unsigned *x190;
+long long void *x191; /* { dg-error "" "long long void" } */
+long long char *x192; /* { dg-error "" "long long char" } */
+long long short *x193; /* { dg-error "" "long long short" } */
+long long int *x194;
+long long long *x195; /* { dg-error "" "long long long" } */
+long long float *x196; /* { dg-error "" "long long float" } */
+long long double *x197; /* { dg-error "" "long long double" } */
+long long signed *x198;
+long long unsigned *x199;
+long double void *x200; /* { dg-error "" "long double void" } */
+long double char *x201; /* { dg-error "" "long double char" } */
+long double short *x202; /* { dg-error "" "long double short" } */
+long double int *x203; /* { dg-error "" "long double int" } */
+long double long *x204; /* { dg-error "" "long double long" } */
+long double float *x205; /* { dg-error "" "long double float" } */
+long double double *x206; /* { dg-error "" "long double double" } */
+long double signed *x207; /* { dg-error "" "long double signed" } */
+long double unsigned *x208; /* { dg-error "" "long double unsigned" } */
+long signed void *x209; /* { dg-error "" "long signed void" } */
+long signed char *x210; /* { dg-error "" "long signed char" } */
+long signed short *x211; /* { dg-error "" "long signed short" } */
+long signed int *x212;
+long signed long *x213;
+long signed float *x214; /* { dg-error "" "long signed float" } */
+long signed double *x215; /* { dg-error "" "long signed double" } */
+long signed signed *x216; /* { dg-error "" "long signed signed" } */
+long signed unsigned *x217; /* { dg-error "" "long signed unsigned" } */
+long unsigned void *x218; /* { dg-error "" "long unsigned void" } */
+long unsigned char *x219; /* { dg-error "" "long unsigned char" } */
+long unsigned short *x220; /* { dg-error "" "long unsigned short" } */
+long unsigned int *x221;
+long unsigned long *x222;
+long unsigned float *x223; /* { dg-error "" "long unsigned float" } */
+long unsigned double *x224; /* { dg-error "" "long unsigned double" } */
+long unsigned signed *x225; /* { dg-error "" "long unsigned signed" } */
+long unsigned unsigned *x226; /* { dg-error "" "long unsigned unsigned" } */
+double long void *x227; /* { dg-error "" "double long void" } */
+double long char *x228; /* { dg-error "" "double long char" } */
+double long short *x229; /* { dg-error "" "double long short" } */
+double long int *x230; /* { dg-error "" "double long int" } */
+double long long *x231; /* { dg-error "" "double long long" } */
+double long float *x232; /* { dg-error "" "double long float" } */
+double long double *x233; /* { dg-error "" "double long double" } */
+double long signed *x234; /* { dg-error "" "double long signed" } */
+double long unsigned *x235; /* { dg-error "" "double long unsigned" } */
+signed char void *x236; /* { dg-error "" "signed char void" } */
+signed char char *x237; /* { dg-error "" "signed char char" } */
+signed char short *x238; /* { dg-error "" "signed char short" } */
+signed char int *x239; /* { dg-error "" "signed char int" } */
+signed char long *x240; /* { dg-error "" "signed char long" } */
+signed char float *x241; /* { dg-error "" "signed char float" } */
+signed char double *x242; /* { dg-error "" "signed char double" } */
+signed char signed *x243; /* { dg-error "" "signed char signed" } */
+signed char unsigned *x244; /* { dg-error "" "signed char unsigned" } */
+signed short void *x245; /* { dg-error "" "signed short void" } */
+signed short char *x246; /* { dg-error "" "signed short char" } */
+signed short short *x247; /* { dg-error "" "signed short short" } */
+signed short int *x248;
+signed short long *x249; /* { dg-error "" "signed short long" } */
+signed short float *x250; /* { dg-error "" "signed short float" } */
+signed short double *x251; /* { dg-error "" "signed short double" } */
+signed short signed *x252; /* { dg-error "" "signed short signed" } */
+signed short unsigned *x253; /* { dg-error "" "signed short unsigned" } */
+signed int void *x254; /* { dg-error "" "signed int void" } */
+signed int char *x255; /* { dg-error "" "signed int char" } */
+signed int short *x256;
+signed int int *x257; /* { dg-error "" "signed int int" } */
+signed int long *x258;
+signed int float *x259; /* { dg-error "" "signed int float" } */
+signed int double *x260; /* { dg-error "" "signed int double" } */
+signed int signed *x261; /* { dg-error "" "signed int signed" } */
+signed int unsigned *x262; /* { dg-error "" "signed int unsigned" } */
+signed long void *x263; /* { dg-error "" "signed long void" } */
+signed long char *x264; /* { dg-error "" "signed long char" } */
+signed long short *x265; /* { dg-error "" "signed long short" } */
+signed long int *x266;
+signed long long *x267;
+signed long float *x268; /* { dg-error "" "signed long float" } */
+signed long double *x269; /* { dg-error "" "signed long double" } */
+signed long signed *x270; /* { dg-error "" "signed long signed" } */
+signed long unsigned *x271; /* { dg-error "" "signed long unsigned" } */
+unsigned char void *x272; /* { dg-error "" "unsigned char void" } */
+unsigned char char *x273; /* { dg-error "" "unsigned char char" } */
+unsigned char short *x274; /* { dg-error "" "unsigned char short" } */
+unsigned char int *x275; /* { dg-error "" "unsigned char int" } */
+unsigned char long *x276; /* { dg-error "" "unsigned char long" } */
+unsigned char float *x277; /* { dg-error "" "unsigned char float" } */
+unsigned char double *x278; /* { dg-error "" "unsigned char double" } */
+unsigned char signed *x279; /* { dg-error "" "unsigned char signed" } */
+unsigned char unsigned *x280; /* { dg-error "" "unsigned char unsigned" } */
+unsigned short void *x281; /* { dg-error "" "unsigned short void" } */
+unsigned short char *x282; /* { dg-error "" "unsigned short char" } */
+unsigned short short *x283; /* { dg-error "" "unsigned short short" } */
+unsigned short int *x284;
+unsigned short long *x285; /* { dg-error "" "unsigned short long" } */
+unsigned short float *x286; /* { dg-error "" "unsigned short float" } */
+unsigned short double *x287; /* { dg-error "" "unsigned short double" } */
+unsigned short signed *x288; /* { dg-error "" "unsigned short signed" } */
+unsigned short unsigned *x289; /* { dg-error "" "unsigned short unsigned" } */
+unsigned int void *x290; /* { dg-error "" "unsigned int void" } */
+unsigned int char *x291; /* { dg-error "" "unsigned int char" } */
+unsigned int short *x292;
+unsigned int int *x293; /* { dg-error "" "unsigned int int" } */
+unsigned int long *x294;
+unsigned int float *x295; /* { dg-error "" "unsigned int float" } */
+unsigned int double *x296; /* { dg-error "" "unsigned int double" } */
+unsigned int signed *x297; /* { dg-error "" "unsigned int signed" } */
+unsigned int unsigned *x298; /* { dg-error "" "unsigned int unsigned" } */
+unsigned long void *x299; /* { dg-error "" "unsigned long void" } */
+unsigned long char *x300; /* { dg-error "" "unsigned long char" } */
+unsigned long short *x301; /* { dg-error "" "unsigned long short" } */
+unsigned long int *x302;
+unsigned long long *x303;
+unsigned long float *x304; /* { dg-error "" "unsigned long float" } */
+unsigned long double *x305; /* { dg-error "" "unsigned long double" } */
+unsigned long signed *x306; /* { dg-error "" "unsigned long signed" } */
+unsigned long unsigned *x307; /* { dg-error "" "unsigned long unsigned" } */
+short int signed void *x308; /* { dg-error "" "short int signed void" } */
+short int signed char *x309; /* { dg-error "" "short int signed char" } */
+short int signed short *x310; /* { dg-error "" "short int signed short" } */
+short int signed int *x311; /* { dg-error "" "short int signed int" } */
+short int signed long *x312; /* { dg-error "" "short int signed long" } */
+short int signed float *x313; /* { dg-error "" "short int signed float" } */
+short int signed double *x314; /* { dg-error "" "short int signed double" } */
+short int signed signed *x315; /* { dg-error "" "short int signed signed" } */
+short int signed unsigned *x316; /* { dg-error "" "short int signed unsigned" } */
+short int unsigned void *x317; /* { dg-error "" "short int unsigned void" } */
+short int unsigned char *x318; /* { dg-error "" "short int unsigned char" } */
+short int unsigned short *x319; /* { dg-error "" "short int unsigned short" } */
+short int unsigned int *x320; /* { dg-error "" "short int unsigned int" } */
+short int unsigned long *x321; /* { dg-error "" "short int unsigned long" } */
+short int unsigned float *x322; /* { dg-error "" "short int unsigned float" } */
+short int unsigned double *x323; /* { dg-error "" "short int unsigned double" } */
+short int unsigned signed *x324; /* { dg-error "" "short int unsigned signed" } */
+short int unsigned unsigned *x325; /* { dg-error "" "short int unsigned unsigned" } */
+short signed int void *x326; /* { dg-error "" "short signed int void" } */
+short signed int char *x327; /* { dg-error "" "short signed int char" } */
+short signed int short *x328; /* { dg-error "" "short signed int short" } */
+short signed int int *x329; /* { dg-error "" "short signed int int" } */
+short signed int long *x330; /* { dg-error "" "short signed int long" } */
+short signed int float *x331; /* { dg-error "" "short signed int float" } */
+short signed int double *x332; /* { dg-error "" "short signed int double" } */
+short signed int signed *x333; /* { dg-error "" "short signed int signed" } */
+short signed int unsigned *x334; /* { dg-error "" "short signed int unsigned" } */
+short unsigned int void *x335; /* { dg-error "" "short unsigned int void" } */
+short unsigned int char *x336; /* { dg-error "" "short unsigned int char" } */
+short unsigned int short *x337; /* { dg-error "" "short unsigned int short" } */
+short unsigned int int *x338; /* { dg-error "" "short unsigned int int" } */
+short unsigned int long *x339; /* { dg-error "" "short unsigned int long" } */
+short unsigned int float *x340; /* { dg-error "" "short unsigned int float" } */
+short unsigned int double *x341; /* { dg-error "" "short unsigned int double" } */
+short unsigned int signed *x342; /* { dg-error "" "short unsigned int signed" } */
+short unsigned int unsigned *x343; /* { dg-error "" "short unsigned int unsigned" } */
+int short signed void *x344; /* { dg-error "" "int short signed void" } */
+int short signed char *x345; /* { dg-error "" "int short signed char" } */
+int short signed short *x346; /* { dg-error "" "int short signed short" } */
+int short signed int *x347; /* { dg-error "" "int short signed int" } */
+int short signed long *x348; /* { dg-error "" "int short signed long" } */
+int short signed float *x349; /* { dg-error "" "int short signed float" } */
+int short signed double *x350; /* { dg-error "" "int short signed double" } */
+int short signed signed *x351; /* { dg-error "" "int short signed signed" } */
+int short signed unsigned *x352; /* { dg-error "" "int short signed unsigned" } */
+int short unsigned void *x353; /* { dg-error "" "int short unsigned void" } */
+int short unsigned char *x354; /* { dg-error "" "int short unsigned char" } */
+int short unsigned short *x355; /* { dg-error "" "int short unsigned short" } */
+int short unsigned int *x356; /* { dg-error "" "int short unsigned int" } */
+int short unsigned long *x357; /* { dg-error "" "int short unsigned long" } */
+int short unsigned float *x358; /* { dg-error "" "int short unsigned float" } */
+int short unsigned double *x359; /* { dg-error "" "int short unsigned double" } */
+int short unsigned signed *x360; /* { dg-error "" "int short unsigned signed" } */
+int short unsigned unsigned *x361; /* { dg-error "" "int short unsigned unsigned" } */
+int long long void *x362; /* { dg-error "" "int long long void" } */
+int long long char *x363; /* { dg-error "" "int long long char" } */
+int long long short *x364; /* { dg-error "" "int long long short" } */
+int long long int *x365; /* { dg-error "" "int long long int" } */
+int long long long *x366; /* { dg-error "" "int long long long" } */
+int long long float *x367; /* { dg-error "" "int long long float" } */
+int long long double *x368; /* { dg-error "" "int long long double" } */
+int long long signed *x369;
+int long long unsigned *x370;
+int long signed void *x371; /* { dg-error "" "int long signed void" } */
+int long signed char *x372; /* { dg-error "" "int long signed char" } */
+int long signed short *x373; /* { dg-error "" "int long signed short" } */
+int long signed int *x374; /* { dg-error "" "int long signed int" } */
+int long signed long *x375;
+int long signed float *x376; /* { dg-error "" "int long signed float" } */
+int long signed double *x377; /* { dg-error "" "int long signed double" } */
+int long signed signed *x378; /* { dg-error "" "int long signed signed" } */
+int long signed unsigned *x379; /* { dg-error "" "int long signed unsigned" } */
+int long unsigned void *x380; /* { dg-error "" "int long unsigned void" } */
+int long unsigned char *x381; /* { dg-error "" "int long unsigned char" } */
+int long unsigned short *x382; /* { dg-error "" "int long unsigned short" } */
+int long unsigned int *x383; /* { dg-error "" "int long unsigned int" } */
+int long unsigned long *x384;
+int long unsigned float *x385; /* { dg-error "" "int long unsigned float" } */
+int long unsigned double *x386; /* { dg-error "" "int long unsigned double" } */
+int long unsigned signed *x387; /* { dg-error "" "int long unsigned signed" } */
+int long unsigned unsigned *x388; /* { dg-error "" "int long unsigned unsigned" } */
+int signed short void *x389; /* { dg-error "" "int signed short void" } */
+int signed short char *x390; /* { dg-error "" "int signed short char" } */
+int signed short short *x391; /* { dg-error "" "int signed short short" } */
+int signed short int *x392; /* { dg-error "" "int signed short int" } */
+int signed short long *x393; /* { dg-error "" "int signed short long" } */
+int signed short float *x394; /* { dg-error "" "int signed short float" } */
+int signed short double *x395; /* { dg-error "" "int signed short double" } */
+int signed short signed *x396; /* { dg-error "" "int signed short signed" } */
+int signed short unsigned *x397; /* { dg-error "" "int signed short unsigned" } */
+int signed long void *x398; /* { dg-error "" "int signed long void" } */
+int signed long char *x399; /* { dg-error "" "int signed long char" } */
+int signed long short *x400; /* { dg-error "" "int signed long short" } */
+int signed long int *x401; /* { dg-error "" "int signed long int" } */
+int signed long long *x402;
+int signed long float *x403; /* { dg-error "" "int signed long float" } */
+int signed long double *x404; /* { dg-error "" "int signed long double" } */
+int signed long signed *x405; /* { dg-error "" "int signed long signed" } */
+int signed long unsigned *x406; /* { dg-error "" "int signed long unsigned" } */
+int unsigned short void *x407; /* { dg-error "" "int unsigned short void" } */
+int unsigned short char *x408; /* { dg-error "" "int unsigned short char" } */
+int unsigned short short *x409; /* { dg-error "" "int unsigned short short" } */
+int unsigned short int *x410; /* { dg-error "" "int unsigned short int" } */
+int unsigned short long *x411; /* { dg-error "" "int unsigned short long" } */
+int unsigned short float *x412; /* { dg-error "" "int unsigned short float" } */
+int unsigned short double *x413; /* { dg-error "" "int unsigned short double" } */
+int unsigned short signed *x414; /* { dg-error "" "int unsigned short signed" } */
+int unsigned short unsigned *x415; /* { dg-error "" "int unsigned short unsigned" } */
+int unsigned long void *x416; /* { dg-error "" "int unsigned long void" } */
+int unsigned long char *x417; /* { dg-error "" "int unsigned long char" } */
+int unsigned long short *x418; /* { dg-error "" "int unsigned long short" } */
+int unsigned long int *x419; /* { dg-error "" "int unsigned long int" } */
+int unsigned long long *x420;
+int unsigned long float *x421; /* { dg-error "" "int unsigned long float" } */
+int unsigned long double *x422; /* { dg-error "" "int unsigned long double" } */
+int unsigned long signed *x423; /* { dg-error "" "int unsigned long signed" } */
+int unsigned long unsigned *x424; /* { dg-error "" "int unsigned long unsigned" } */
+long int long void *x425; /* { dg-error "" "long int long void" } */
+long int long char *x426; /* { dg-error "" "long int long char" } */
+long int long short *x427; /* { dg-error "" "long int long short" } */
+long int long int *x428; /* { dg-error "" "long int long int" } */
+long int long long *x429; /* { dg-error "" "long int long long" } */
+long int long float *x430; /* { dg-error "" "long int long float" } */
+long int long double *x431; /* { dg-error "" "long int long double" } */
+long int long signed *x432;
+long int long unsigned *x433;
+long int signed void *x434; /* { dg-error "" "long int signed void" } */
+long int signed char *x435; /* { dg-error "" "long int signed char" } */
+long int signed short *x436; /* { dg-error "" "long int signed short" } */
+long int signed int *x437; /* { dg-error "" "long int signed int" } */
+long int signed long *x438;
+long int signed float *x439; /* { dg-error "" "long int signed float" } */
+long int signed double *x440; /* { dg-error "" "long int signed double" } */
+long int signed signed *x441; /* { dg-error "" "long int signed signed" } */
+long int signed unsigned *x442; /* { dg-error "" "long int signed unsigned" } */
+long int unsigned void *x443; /* { dg-error "" "long int unsigned void" } */
+long int unsigned char *x444; /* { dg-error "" "long int unsigned char" } */
+long int unsigned short *x445; /* { dg-error "" "long int unsigned short" } */
+long int unsigned int *x446; /* { dg-error "" "long int unsigned int" } */
+long int unsigned long *x447;
+long int unsigned float *x448; /* { dg-error "" "long int unsigned float" } */
+long int unsigned double *x449; /* { dg-error "" "long int unsigned double" } */
+long int unsigned signed *x450; /* { dg-error "" "long int unsigned signed" } */
+long int unsigned unsigned *x451; /* { dg-error "" "long int unsigned unsigned" } */
+long long int void *x452; /* { dg-error "" "long long int void" } */
+long long int char *x453; /* { dg-error "" "long long int char" } */
+long long int short *x454; /* { dg-error "" "long long int short" } */
+long long int int *x455; /* { dg-error "" "long long int int" } */
+long long int long *x456; /* { dg-error "" "long long int long" } */
+long long int float *x457; /* { dg-error "" "long long int float" } */
+long long int double *x458; /* { dg-error "" "long long int double" } */
+long long int signed *x459;
+long long int unsigned *x460;
+long long signed void *x461; /* { dg-error "" "long long signed void" } */
+long long signed char *x462; /* { dg-error "" "long long signed char" } */
+long long signed short *x463; /* { dg-error "" "long long signed short" } */
+long long signed int *x464;
+long long signed long *x465; /* { dg-error "" "long long signed long" } */
+long long signed float *x466; /* { dg-error "" "long long signed float" } */
+long long signed double *x467; /* { dg-error "" "long long signed double" } */
+long long signed signed *x468; /* { dg-error "" "long long signed signed" } */
+long long signed unsigned *x469; /* { dg-error "" "long long signed unsigned" } */
+long long unsigned void *x470; /* { dg-error "" "long long unsigned void" } */
+long long unsigned char *x471; /* { dg-error "" "long long unsigned char" } */
+long long unsigned short *x472; /* { dg-error "" "long long unsigned short" } */
+long long unsigned int *x473;
+long long unsigned long *x474; /* { dg-error "" "long long unsigned long" } */
+long long unsigned float *x475; /* { dg-error "" "long long unsigned float" } */
+long long unsigned double *x476; /* { dg-error "" "long long unsigned double" } */
+long long unsigned signed *x477; /* { dg-error "" "long long unsigned signed" } */
+long long unsigned unsigned *x478; /* { dg-error "" "long long unsigned unsigned" } */
+long signed int void *x479; /* { dg-error "" "long signed int void" } */
+long signed int char *x480; /* { dg-error "" "long signed int char" } */
+long signed int short *x481; /* { dg-error "" "long signed int short" } */
+long signed int int *x482; /* { dg-error "" "long signed int int" } */
+long signed int long *x483;
+long signed int float *x484; /* { dg-error "" "long signed int float" } */
+long signed int double *x485; /* { dg-error "" "long signed int double" } */
+long signed int signed *x486; /* { dg-error "" "long signed int signed" } */
+long signed int unsigned *x487; /* { dg-error "" "long signed int unsigned" } */
+long signed long void *x488; /* { dg-error "" "long signed long void" } */
+long signed long char *x489; /* { dg-error "" "long signed long char" } */
+long signed long short *x490; /* { dg-error "" "long signed long short" } */
+long signed long int *x491;
+long signed long long *x492; /* { dg-error "" "long signed long long" } */
+long signed long float *x493; /* { dg-error "" "long signed long float" } */
+long signed long double *x494; /* { dg-error "" "long signed long double" } */
+long signed long signed *x495; /* { dg-error "" "long signed long signed" } */
+long signed long unsigned *x496; /* { dg-error "" "long signed long unsigned" } */
+long unsigned int void *x497; /* { dg-error "" "long unsigned int void" } */
+long unsigned int char *x498; /* { dg-error "" "long unsigned int char" } */
+long unsigned int short *x499; /* { dg-error "" "long unsigned int short" } */
+long unsigned int int *x500; /* { dg-error "" "long unsigned int int" } */
+long unsigned int long *x501;
+long unsigned int float *x502; /* { dg-error "" "long unsigned int float" } */
+long unsigned int double *x503; /* { dg-error "" "long unsigned int double" } */
+long unsigned int signed *x504; /* { dg-error "" "long unsigned int signed" } */
+long unsigned int unsigned *x505; /* { dg-error "" "long unsigned int unsigned" } */
+long unsigned long void *x506; /* { dg-error "" "long unsigned long void" } */
+long unsigned long char *x507; /* { dg-error "" "long unsigned long char" } */
+long unsigned long short *x508; /* { dg-error "" "long unsigned long short" } */
+long unsigned long int *x509;
+long unsigned long long *x510; /* { dg-error "" "long unsigned long long" } */
+long unsigned long float *x511; /* { dg-error "" "long unsigned long float" } */
+long unsigned long double *x512; /* { dg-error "" "long unsigned long double" } */
+long unsigned long signed *x513; /* { dg-error "" "long unsigned long signed" } */
+long unsigned long unsigned *x514; /* { dg-error "" "long unsigned long unsigned" } */
+signed short int void *x515; /* { dg-error "" "signed short int void" } */
+signed short int char *x516; /* { dg-error "" "signed short int char" } */
+signed short int short *x517; /* { dg-error "" "signed short int short" } */
+signed short int int *x518; /* { dg-error "" "signed short int int" } */
+signed short int long *x519; /* { dg-error "" "signed short int long" } */
+signed short int float *x520; /* { dg-error "" "signed short int float" } */
+signed short int double *x521; /* { dg-error "" "signed short int double" } */
+signed short int signed *x522; /* { dg-error "" "signed short int signed" } */
+signed short int unsigned *x523; /* { dg-error "" "signed short int unsigned" } */
+signed int short void *x524; /* { dg-error "" "signed int short void" } */
+signed int short char *x525; /* { dg-error "" "signed int short char" } */
+signed int short short *x526; /* { dg-error "" "signed int short short" } */
+signed int short int *x527; /* { dg-error "" "signed int short int" } */
+signed int short long *x528; /* { dg-error "" "signed int short long" } */
+signed int short float *x529; /* { dg-error "" "signed int short float" } */
+signed int short double *x530; /* { dg-error "" "signed int short double" } */
+signed int short signed *x531; /* { dg-error "" "signed int short signed" } */
+signed int short unsigned *x532; /* { dg-error "" "signed int short unsigned" } */
+signed int long void *x533; /* { dg-error "" "signed int long void" } */
+signed int long char *x534; /* { dg-error "" "signed int long char" } */
+signed int long short *x535; /* { dg-error "" "signed int long short" } */
+signed int long int *x536; /* { dg-error "" "signed int long int" } */
+signed int long long *x537;
+signed int long float *x538; /* { dg-error "" "signed int long float" } */
+signed int long double *x539; /* { dg-error "" "signed int long double" } */
+signed int long signed *x540; /* { dg-error "" "signed int long signed" } */
+signed int long unsigned *x541; /* { dg-error "" "signed int long unsigned" } */
+signed long int void *x542; /* { dg-error "" "signed long int void" } */
+signed long int char *x543; /* { dg-error "" "signed long int char" } */
+signed long int short *x544; /* { dg-error "" "signed long int short" } */
+signed long int int *x545; /* { dg-error "" "signed long int int" } */
+signed long int long *x546;
+signed long int float *x547; /* { dg-error "" "signed long int float" } */
+signed long int double *x548; /* { dg-error "" "signed long int double" } */
+signed long int signed *x549; /* { dg-error "" "signed long int signed" } */
+signed long int unsigned *x550; /* { dg-error "" "signed long int unsigned" } */
+signed long long void *x551; /* { dg-error "" "signed long long void" } */
+signed long long char *x552; /* { dg-error "" "signed long long char" } */
+signed long long short *x553; /* { dg-error "" "signed long long short" } */
+signed long long int *x554;
+signed long long long *x555; /* { dg-error "" "signed long long long" } */
+signed long long float *x556; /* { dg-error "" "signed long long float" } */
+signed long long double *x557; /* { dg-error "" "signed long long double" } */
+signed long long signed *x558; /* { dg-error "" "signed long long signed" } */
+signed long long unsigned *x559; /* { dg-error "" "signed long long unsigned" } */
+unsigned short int void *x560; /* { dg-error "" "unsigned short int void" } */
+unsigned short int char *x561; /* { dg-error "" "unsigned short int char" } */
+unsigned short int short *x562; /* { dg-error "" "unsigned short int short" } */
+unsigned short int int *x563; /* { dg-error "" "unsigned short int int" } */
+unsigned short int long *x564; /* { dg-error "" "unsigned short int long" } */
+unsigned short int float *x565; /* { dg-error "" "unsigned short int float" } */
+unsigned short int double *x566; /* { dg-error "" "unsigned short int double" } */
+unsigned short int signed *x567; /* { dg-error "" "unsigned short int signed" } */
+unsigned short int unsigned *x568; /* { dg-error "" "unsigned short int unsigned" } */
+unsigned int short void *x569; /* { dg-error "" "unsigned int short void" } */
+unsigned int short char *x570; /* { dg-error "" "unsigned int short char" } */
+unsigned int short short *x571; /* { dg-error "" "unsigned int short short" } */
+unsigned int short int *x572; /* { dg-error "" "unsigned int short int" } */
+unsigned int short long *x573; /* { dg-error "" "unsigned int short long" } */
+unsigned int short float *x574; /* { dg-error "" "unsigned int short float" } */
+unsigned int short double *x575; /* { dg-error "" "unsigned int short double" } */
+unsigned int short signed *x576; /* { dg-error "" "unsigned int short signed" } */
+unsigned int short unsigned *x577; /* { dg-error "" "unsigned int short unsigned" } */
+unsigned int long void *x578; /* { dg-error "" "unsigned int long void" } */
+unsigned int long char *x579; /* { dg-error "" "unsigned int long char" } */
+unsigned int long short *x580; /* { dg-error "" "unsigned int long short" } */
+unsigned int long int *x581; /* { dg-error "" "unsigned int long int" } */
+unsigned int long long *x582;
+unsigned int long float *x583; /* { dg-error "" "unsigned int long float" } */
+unsigned int long double *x584; /* { dg-error "" "unsigned int long double" } */
+unsigned int long signed *x585; /* { dg-error "" "unsigned int long signed" } */
+unsigned int long unsigned *x586; /* { dg-error "" "unsigned int long unsigned" } */
+unsigned long int void *x587; /* { dg-error "" "unsigned long int void" } */
+unsigned long int char *x588; /* { dg-error "" "unsigned long int char" } */
+unsigned long int short *x589; /* { dg-error "" "unsigned long int short" } */
+unsigned long int int *x590; /* { dg-error "" "unsigned long int int" } */
+unsigned long int long *x591;
+unsigned long int float *x592; /* { dg-error "" "unsigned long int float" } */
+unsigned long int double *x593; /* { dg-error "" "unsigned long int double" } */
+unsigned long int signed *x594; /* { dg-error "" "unsigned long int signed" } */
+unsigned long int unsigned *x595; /* { dg-error "" "unsigned long int unsigned" } */
+unsigned long long void *x596; /* { dg-error "" "unsigned long long void" } */
+unsigned long long char *x597; /* { dg-error "" "unsigned long long char" } */
+unsigned long long short *x598; /* { dg-error "" "unsigned long long short" } */
+unsigned long long int *x599;
+unsigned long long long *x600; /* { dg-error "" "unsigned long long long" } */
+unsigned long long float *x601; /* { dg-error "" "unsigned long long float" } */
+unsigned long long double *x602; /* { dg-error "" "unsigned long long double" } */
+unsigned long long signed *x603; /* { dg-error "" "unsigned long long signed" } */
+unsigned long long unsigned *x604; /* { dg-error "" "unsigned long long unsigned" } */
+int long long signed void *x605; /* { dg-error "" "int long long signed void" } */
+int long long signed char *x606; /* { dg-error "" "int long long signed char" } */
+int long long signed short *x607; /* { dg-error "" "int long long signed short" } */
+int long long signed int *x608; /* { dg-error "" "int long long signed int" } */
+int long long signed long *x609; /* { dg-error "" "int long long signed long" } */
+int long long signed float *x610; /* { dg-error "" "int long long signed float" } */
+int long long signed double *x611; /* { dg-error "" "int long long signed double" } */
+int long long signed signed *x612; /* { dg-error "" "int long long signed signed" } */
+int long long signed unsigned *x613; /* { dg-error "" "int long long signed unsigned" } */
+int long long unsigned void *x614; /* { dg-error "" "int long long unsigned void" } */
+int long long unsigned char *x615; /* { dg-error "" "int long long unsigned char" } */
+int long long unsigned short *x616; /* { dg-error "" "int long long unsigned short" } */
+int long long unsigned int *x617; /* { dg-error "" "int long long unsigned int" } */
+int long long unsigned long *x618; /* { dg-error "" "int long long unsigned long" } */
+int long long unsigned float *x619; /* { dg-error "" "int long long unsigned float" } */
+int long long unsigned double *x620; /* { dg-error "" "int long long unsigned double" } */
+int long long unsigned signed *x621; /* { dg-error "" "int long long unsigned signed" } */
+int long long unsigned unsigned *x622; /* { dg-error "" "int long long unsigned unsigned" } */
+int long signed long void *x623; /* { dg-error "" "int long signed long void" } */
+int long signed long char *x624; /* { dg-error "" "int long signed long char" } */
+int long signed long short *x625; /* { dg-error "" "int long signed long short" } */
+int long signed long int *x626; /* { dg-error "" "int long signed long int" } */
+int long signed long long *x627; /* { dg-error "" "int long signed long long" } */
+int long signed long float *x628; /* { dg-error "" "int long signed long float" } */
+int long signed long double *x629; /* { dg-error "" "int long signed long double" } */
+int long signed long signed *x630; /* { dg-error "" "int long signed long signed" } */
+int long signed long unsigned *x631; /* { dg-error "" "int long signed long unsigned" } */
+int long unsigned long void *x632; /* { dg-error "" "int long unsigned long void" } */
+int long unsigned long char *x633; /* { dg-error "" "int long unsigned long char" } */
+int long unsigned long short *x634; /* { dg-error "" "int long unsigned long short" } */
+int long unsigned long int *x635; /* { dg-error "" "int long unsigned long int" } */
+int long unsigned long long *x636; /* { dg-error "" "int long unsigned long long" } */
+int long unsigned long float *x637; /* { dg-error "" "int long unsigned long float" } */
+int long unsigned long double *x638; /* { dg-error "" "int long unsigned long double" } */
+int long unsigned long signed *x639; /* { dg-error "" "int long unsigned long signed" } */
+int long unsigned long unsigned *x640; /* { dg-error "" "int long unsigned long unsigned" } */
+int signed long long void *x641; /* { dg-error "" "int signed long long void" } */
+int signed long long char *x642; /* { dg-error "" "int signed long long char" } */
+int signed long long short *x643; /* { dg-error "" "int signed long long short" } */
+int signed long long int *x644; /* { dg-error "" "int signed long long int" } */
+int signed long long long *x645; /* { dg-error "" "int signed long long long" } */
+int signed long long float *x646; /* { dg-error "" "int signed long long float" } */
+int signed long long double *x647; /* { dg-error "" "int signed long long double" } */
+int signed long long signed *x648; /* { dg-error "" "int signed long long signed" } */
+int signed long long unsigned *x649; /* { dg-error "" "int signed long long unsigned" } */
+int unsigned long long void *x650; /* { dg-error "" "int unsigned long long void" } */
+int unsigned long long char *x651; /* { dg-error "" "int unsigned long long char" } */
+int unsigned long long short *x652; /* { dg-error "" "int unsigned long long short" } */
+int unsigned long long int *x653; /* { dg-error "" "int unsigned long long int" } */
+int unsigned long long long *x654; /* { dg-error "" "int unsigned long long long" } */
+int unsigned long long float *x655; /* { dg-error "" "int unsigned long long float" } */
+int unsigned long long double *x656; /* { dg-error "" "int unsigned long long double" } */
+int unsigned long long signed *x657; /* { dg-error "" "int unsigned long long signed" } */
+int unsigned long long unsigned *x658; /* { dg-error "" "int unsigned long long unsigned" } */
+long int long signed void *x659; /* { dg-error "" "long int long signed void" } */
+long int long signed char *x660; /* { dg-error "" "long int long signed char" } */
+long int long signed short *x661; /* { dg-error "" "long int long signed short" } */
+long int long signed int *x662; /* { dg-error "" "long int long signed int" } */
+long int long signed long *x663; /* { dg-error "" "long int long signed long" } */
+long int long signed float *x664; /* { dg-error "" "long int long signed float" } */
+long int long signed double *x665; /* { dg-error "" "long int long signed double" } */
+long int long signed signed *x666; /* { dg-error "" "long int long signed signed" } */
+long int long signed unsigned *x667; /* { dg-error "" "long int long signed unsigned" } */
+long int long unsigned void *x668; /* { dg-error "" "long int long unsigned void" } */
+long int long unsigned char *x669; /* { dg-error "" "long int long unsigned char" } */
+long int long unsigned short *x670; /* { dg-error "" "long int long unsigned short" } */
+long int long unsigned int *x671; /* { dg-error "" "long int long unsigned int" } */
+long int long unsigned long *x672; /* { dg-error "" "long int long unsigned long" } */
+long int long unsigned float *x673; /* { dg-error "" "long int long unsigned float" } */
+long int long unsigned double *x674; /* { dg-error "" "long int long unsigned double" } */
+long int long unsigned signed *x675; /* { dg-error "" "long int long unsigned signed" } */
+long int long unsigned unsigned *x676; /* { dg-error "" "long int long unsigned unsigned" } */
+long int signed long void *x677; /* { dg-error "" "long int signed long void" } */
+long int signed long char *x678; /* { dg-error "" "long int signed long char" } */
+long int signed long short *x679; /* { dg-error "" "long int signed long short" } */
+long int signed long int *x680; /* { dg-error "" "long int signed long int" } */
+long int signed long long *x681; /* { dg-error "" "long int signed long long" } */
+long int signed long float *x682; /* { dg-error "" "long int signed long float" } */
+long int signed long double *x683; /* { dg-error "" "long int signed long double" } */
+long int signed long signed *x684; /* { dg-error "" "long int signed long signed" } */
+long int signed long unsigned *x685; /* { dg-error "" "long int signed long unsigned" } */
+long int unsigned long void *x686; /* { dg-error "" "long int unsigned long void" } */
+long int unsigned long char *x687; /* { dg-error "" "long int unsigned long char" } */
+long int unsigned long short *x688; /* { dg-error "" "long int unsigned long short" } */
+long int unsigned long int *x689; /* { dg-error "" "long int unsigned long int" } */
+long int unsigned long long *x690; /* { dg-error "" "long int unsigned long long" } */
+long int unsigned long float *x691; /* { dg-error "" "long int unsigned long float" } */
+long int unsigned long double *x692; /* { dg-error "" "long int unsigned long double" } */
+long int unsigned long signed *x693; /* { dg-error "" "long int unsigned long signed" } */
+long int unsigned long unsigned *x694; /* { dg-error "" "long int unsigned long unsigned" } */
+long long int signed void *x695; /* { dg-error "" "long long int signed void" } */
+long long int signed char *x696; /* { dg-error "" "long long int signed char" } */
+long long int signed short *x697; /* { dg-error "" "long long int signed short" } */
+long long int signed int *x698; /* { dg-error "" "long long int signed int" } */
+long long int signed long *x699; /* { dg-error "" "long long int signed long" } */
+long long int signed float *x700; /* { dg-error "" "long long int signed float" } */
+long long int signed double *x701; /* { dg-error "" "long long int signed double" } */
+long long int signed signed *x702; /* { dg-error "" "long long int signed signed" } */
+long long int signed unsigned *x703; /* { dg-error "" "long long int signed unsigned" } */
+long long int unsigned void *x704; /* { dg-error "" "long long int unsigned void" } */
+long long int unsigned char *x705; /* { dg-error "" "long long int unsigned char" } */
+long long int unsigned short *x706; /* { dg-error "" "long long int unsigned short" } */
+long long int unsigned int *x707; /* { dg-error "" "long long int unsigned int" } */
+long long int unsigned long *x708; /* { dg-error "" "long long int unsigned long" } */
+long long int unsigned float *x709; /* { dg-error "" "long long int unsigned float" } */
+long long int unsigned double *x710; /* { dg-error "" "long long int unsigned double" } */
+long long int unsigned signed *x711; /* { dg-error "" "long long int unsigned signed" } */
+long long int unsigned unsigned *x712; /* { dg-error "" "long long int unsigned unsigned" } */
+long long signed int void *x713; /* { dg-error "" "long long signed int void" } */
+long long signed int char *x714; /* { dg-error "" "long long signed int char" } */
+long long signed int short *x715; /* { dg-error "" "long long signed int short" } */
+long long signed int int *x716; /* { dg-error "" "long long signed int int" } */
+long long signed int long *x717; /* { dg-error "" "long long signed int long" } */
+long long signed int float *x718; /* { dg-error "" "long long signed int float" } */
+long long signed int double *x719; /* { dg-error "" "long long signed int double" } */
+long long signed int signed *x720; /* { dg-error "" "long long signed int signed" } */
+long long signed int unsigned *x721; /* { dg-error "" "long long signed int unsigned" } */
+long long unsigned int void *x722; /* { dg-error "" "long long unsigned int void" } */
+long long unsigned int char *x723; /* { dg-error "" "long long unsigned int char" } */
+long long unsigned int short *x724; /* { dg-error "" "long long unsigned int short" } */
+long long unsigned int int *x725; /* { dg-error "" "long long unsigned int int" } */
+long long unsigned int long *x726; /* { dg-error "" "long long unsigned int long" } */
+long long unsigned int float *x727; /* { dg-error "" "long long unsigned int float" } */
+long long unsigned int double *x728; /* { dg-error "" "long long unsigned int double" } */
+long long unsigned int signed *x729; /* { dg-error "" "long long unsigned int signed" } */
+long long unsigned int unsigned *x730; /* { dg-error "" "long long unsigned int unsigned" } */
+long signed int long void *x731; /* { dg-error "" "long signed int long void" } */
+long signed int long char *x732; /* { dg-error "" "long signed int long char" } */
+long signed int long short *x733; /* { dg-error "" "long signed int long short" } */
+long signed int long int *x734; /* { dg-error "" "long signed int long int" } */
+long signed int long long *x735; /* { dg-error "" "long signed int long long" } */
+long signed int long float *x736; /* { dg-error "" "long signed int long float" } */
+long signed int long double *x737; /* { dg-error "" "long signed int long double" } */
+long signed int long signed *x738; /* { dg-error "" "long signed int long signed" } */
+long signed int long unsigned *x739; /* { dg-error "" "long signed int long unsigned" } */
+long signed long int void *x740; /* { dg-error "" "long signed long int void" } */
+long signed long int char *x741; /* { dg-error "" "long signed long int char" } */
+long signed long int short *x742; /* { dg-error "" "long signed long int short" } */
+long signed long int int *x743; /* { dg-error "" "long signed long int int" } */
+long signed long int long *x744; /* { dg-error "" "long signed long int long" } */
+long signed long int float *x745; /* { dg-error "" "long signed long int float" } */
+long signed long int double *x746; /* { dg-error "" "long signed long int double" } */
+long signed long int signed *x747; /* { dg-error "" "long signed long int signed" } */
+long signed long int unsigned *x748; /* { dg-error "" "long signed long int unsigned" } */
+long unsigned int long void *x749; /* { dg-error "" "long unsigned int long void" } */
+long unsigned int long char *x750; /* { dg-error "" "long unsigned int long char" } */
+long unsigned int long short *x751; /* { dg-error "" "long unsigned int long short" } */
+long unsigned int long int *x752; /* { dg-error "" "long unsigned int long int" } */
+long unsigned int long long *x753; /* { dg-error "" "long unsigned int long long" } */
+long unsigned int long float *x754; /* { dg-error "" "long unsigned int long float" } */
+long unsigned int long double *x755; /* { dg-error "" "long unsigned int long double" } */
+long unsigned int long signed *x756; /* { dg-error "" "long unsigned int long signed" } */
+long unsigned int long unsigned *x757; /* { dg-error "" "long unsigned int long unsigned" } */
+long unsigned long int void *x758; /* { dg-error "" "long unsigned long int void" } */
+long unsigned long int char *x759; /* { dg-error "" "long unsigned long int char" } */
+long unsigned long int short *x760; /* { dg-error "" "long unsigned long int short" } */
+long unsigned long int int *x761; /* { dg-error "" "long unsigned long int int" } */
+long unsigned long int long *x762; /* { dg-error "" "long unsigned long int long" } */
+long unsigned long int float *x763; /* { dg-error "" "long unsigned long int float" } */
+long unsigned long int double *x764; /* { dg-error "" "long unsigned long int double" } */
+long unsigned long int signed *x765; /* { dg-error "" "long unsigned long int signed" } */
+long unsigned long int unsigned *x766; /* { dg-error "" "long unsigned long int unsigned" } */
+signed int long long void *x767; /* { dg-error "" "signed int long long void" } */
+signed int long long char *x768; /* { dg-error "" "signed int long long char" } */
+signed int long long short *x769; /* { dg-error "" "signed int long long short" } */
+signed int long long int *x770; /* { dg-error "" "signed int long long int" } */
+signed int long long long *x771; /* { dg-error "" "signed int long long long" } */
+signed int long long float *x772; /* { dg-error "" "signed int long long float" } */
+signed int long long double *x773; /* { dg-error "" "signed int long long double" } */
+signed int long long signed *x774; /* { dg-error "" "signed int long long signed" } */
+signed int long long unsigned *x775; /* { dg-error "" "signed int long long unsigned" } */
+signed long int long void *x776; /* { dg-error "" "signed long int long void" } */
+signed long int long char *x777; /* { dg-error "" "signed long int long char" } */
+signed long int long short *x778; /* { dg-error "" "signed long int long short" } */
+signed long int long int *x779; /* { dg-error "" "signed long int long int" } */
+signed long int long long *x780; /* { dg-error "" "signed long int long long" } */
+signed long int long float *x781; /* { dg-error "" "signed long int long float" } */
+signed long int long double *x782; /* { dg-error "" "signed long int long double" } */
+signed long int long signed *x783; /* { dg-error "" "signed long int long signed" } */
+signed long int long unsigned *x784; /* { dg-error "" "signed long int long unsigned" } */
+signed long long int void *x785; /* { dg-error "" "signed long long int void" } */
+signed long long int char *x786; /* { dg-error "" "signed long long int char" } */
+signed long long int short *x787; /* { dg-error "" "signed long long int short" } */
+signed long long int int *x788; /* { dg-error "" "signed long long int int" } */
+signed long long int long *x789; /* { dg-error "" "signed long long int long" } */
+signed long long int float *x790; /* { dg-error "" "signed long long int float" } */
+signed long long int double *x791; /* { dg-error "" "signed long long int double" } */
+signed long long int signed *x792; /* { dg-error "" "signed long long int signed" } */
+signed long long int unsigned *x793; /* { dg-error "" "signed long long int unsigned" } */
+unsigned int long long void *x794; /* { dg-error "" "unsigned int long long void" } */
+unsigned int long long char *x795; /* { dg-error "" "unsigned int long long char" } */
+unsigned int long long short *x796; /* { dg-error "" "unsigned int long long short" } */
+unsigned int long long int *x797; /* { dg-error "" "unsigned int long long int" } */
+unsigned int long long long *x798; /* { dg-error "" "unsigned int long long long" } */
+unsigned int long long float *x799; /* { dg-error "" "unsigned int long long float" } */
+unsigned int long long double *x800; /* { dg-error "" "unsigned int long long double" } */
+unsigned int long long signed *x801; /* { dg-error "" "unsigned int long long signed" } */
+unsigned int long long unsigned *x802; /* { dg-error "" "unsigned int long long unsigned" } */
+unsigned long int long void *x803; /* { dg-error "" "unsigned long int long void" } */
+unsigned long int long char *x804; /* { dg-error "" "unsigned long int long char" } */
+unsigned long int long short *x805; /* { dg-error "" "unsigned long int long short" } */
+unsigned long int long int *x806; /* { dg-error "" "unsigned long int long int" } */
+unsigned long int long long *x807; /* { dg-error "" "unsigned long int long long" } */
+unsigned long int long float *x808; /* { dg-error "" "unsigned long int long float" } */
+unsigned long int long double *x809; /* { dg-error "" "unsigned long int long double" } */
+unsigned long int long signed *x810; /* { dg-error "" "unsigned long int long signed" } */
+unsigned long int long unsigned *x811; /* { dg-error "" "unsigned long int long unsigned" } */
+unsigned long long int void *x812; /* { dg-error "" "unsigned long long int void" } */
+unsigned long long int char *x813; /* { dg-error "" "unsigned long long int char" } */
+unsigned long long int short *x814; /* { dg-error "" "unsigned long long int short" } */
+unsigned long long int int *x815; /* { dg-error "" "unsigned long long int int" } */
+unsigned long long int long *x816; /* { dg-error "" "unsigned long long int long" } */
+unsigned long long int float *x817; /* { dg-error "" "unsigned long long int float" } */
+unsigned long long int double *x818; /* { dg-error "" "unsigned long long int double" } */
+unsigned long long int signed *x819; /* { dg-error "" "unsigned long long int signed" } */
+unsigned long long int unsigned *x820; /* { dg-error "" "unsigned long long int unsigned" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/loop-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/loop-1.c
new file mode 100644
index 000000000..a2c7fe642
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/loop-1.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 2000 Free Software Foundation.
+
+ Simplified from gcc/fold-const.c
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do compile } */
+
+void
+mul_double ()
+{
+ int i, j, *prod;
+
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ *prod = 0;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/loop-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/loop-2.c
new file mode 100644
index 000000000..fa96f8927
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/loop-2.c
@@ -0,0 +1,23 @@
+/* PR optimization/10171 */
+/* Bug: unroll_loop misoptimized the function so that we got
+ 0 iterations of the loop rather than the correct 1. */
+/* { dg-do run } */
+
+extern void abort (void);
+extern void exit (int);
+
+__inline__ int tag() { return 0; }
+
+void f ();
+
+int main() {
+ int i;
+ for (i = 0; i < (tag() ? 2 : 1); i++)
+ f();
+ abort ();
+}
+
+void f ()
+{
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/loop-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/loop-3.c
new file mode 100644
index 000000000..6bdb5ef56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/loop-3.c
@@ -0,0 +1,45 @@
+/* PR optimization/13985 */
+/* Copied from gcc.c-torture/compile/930621-1.c */
+
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-options "-O3 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#if defined(STACK_SIZE) && (STACK_SIZE < 65536)
+# define BYTEMEM_SIZE 10000L
+#endif
+
+#ifndef BYTEMEM_SIZE
+# define BYTEMEM_SIZE 45000L
+#endif
+
+int bytestart[5000 + 1];
+unsigned char modtext[400 + 1];
+unsigned char bytemem[2][BYTEMEM_SIZE + 1];
+
+long
+modlookup (int l)
+{
+ signed char c;
+ long j;
+ long k;
+ signed char w;
+ long p;
+ while (p != 0)
+ {
+ while ((k < bytestart[p + 2]) && (j <= l) && (modtext[j] == bytemem[w][k]))
+ {
+ k = k + 1;
+ j = j + 1;
+ }
+ if (k == bytestart[p + 2])
+ if (j > l)
+ c = 1;
+ else c = 4;
+ else if (j > l)
+ c = 3;
+ else if (modtext[j] < bytemem[w][k])
+ c = 0;
+ else c = 2;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/loop-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/loop-4.c
new file mode 100644
index 000000000..c83fd1c0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/loop-4.c
@@ -0,0 +1,25 @@
+/* PR optimization/11841 */
+/* Originator: Andrey Panov <panov@canopus.iacp.dvo.ru> */
+/* Reduced testcase by Volker Reichelt <reichelt@igpm.rwth-aachen.de> */
+
+/* Verify that the (old) loop unroller doesn't wrongly mark a pseudo
+ referenced in a note as local. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+int *a;
+
+int main()
+{
+ double d[6];
+ int i, j;
+
+ for (i=0; i<4; ++i)
+ for (j=0; j<3; ++j)
+ d[i+j] = 0;
+
+ a = &i;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/loop-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/loop-5.c
new file mode 100644
index 000000000..198823b19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/loop-5.c
@@ -0,0 +1,16 @@
+/* PR c/16180 */
+/* { dg-options "-O2" } */
+
+extern int b;
+int foo (int a)
+{
+ if (a)
+ {
+ b = 0;
+ for(;;)
+ goto L;
+ }
+ L:
+ for(;;)
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/loop-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/loop-6.c
new file mode 100644
index 000000000..653854eb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/loop-6.c
@@ -0,0 +1,25 @@
+/* PR optimization/18577 */
+/* Origin: Falk Hueffner <falk@debian.org> */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-all-loops" } */
+
+static float tfcos12[3];
+__attribute__((noinline)) double f(double x) { return x; }
+int g;
+
+int main(void)
+{
+ int i, j;
+ for (i = 0; i < 1; i++)
+ tfcos12[i] = 0.5;
+
+ for (i = 0; i < 1; i++)
+ {
+ tfcos12[i] = 0.5 * f(i);
+ for (j = 0; j < 12; j++)
+ g++;
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/loop-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/loop-7.c
new file mode 100644
index 000000000..0457add9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/loop-7.c
@@ -0,0 +1,16 @@
+/* PR rtl-optimization/31360 */
+
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
+
+void f(int *a)
+{
+ int i;
+ for (i = 0;i<100;i++)
+ a[i] = 0;
+}
+
+/* Load of 0 is moved out of the loop. */
+/* { dg-final { scan-rtl-dump-times "Decided" 1 "loop2_invariant" } } */
+/* { dg-final { cleanup-rtl-dump "loop2_invariant" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/loop-unswitch-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/loop-unswitch-1.c
new file mode 100644
index 000000000..930364c81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/loop-unswitch-1.c
@@ -0,0 +1,34 @@
+/* For PR rtl-optimization/27735 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funswitch-loops" } */
+
+void set_color(void);
+void xml_colorize_line(unsigned int *p, int state)
+{
+ int c;
+ switch(state)
+ {
+ case 1:
+ goto parse_tag;
+ case 2:
+ goto parse_comment;
+ }
+
+ for(;;)
+ {
+ c = *p;
+ if (c == '<' && state == 0)
+ {
+parse_comment: ;
+ while (*p != '\n')
+ state = 3;
+parse_tag: ;
+ while (*p != '\n')
+ state = 0;
+ set_color();
+ }
+ else
+ p++;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lower-subreg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lower-subreg-1.c
new file mode 100644
index 000000000..102ba22b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lower-subreg-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { ! { mips64 || { aarch64*-*-* arm*-*-* ia64-*-* sparc*-*-* spu-*-* tilegx-*-* } } } } } */
+/* { dg-options "-O -fdump-rtl-subreg1" } */
+/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && x32 } { "*" } { "" } } */
+/* { dg-require-effective-target ilp32 } */
+
+long long test (long long a, long long b) { return a | b; }
+
+/* { dg-final { scan-rtl-dump "Splitting reg" "subreg1" } } */
+/* { dg-final { cleanup-rtl-dump "subreg1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080908_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080908_0.c
new file mode 100644
index 000000000..3bc1c3a72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080908_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-do assemble } */
+void foo(void) {
+ char *bar;
+ int baz;
+ while (1)
+ {
+ if (baz)
+ {
+ baz = -baz;
+ do
+ *bar++ = 0;
+ while (++baz);
+ }
+ ++baz;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080917_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080917_0.c
new file mode 100644
index 000000000..ac0891081
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080917_0.c
@@ -0,0 +1,29 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-O2 -funsigned-char}} } */
+int
+foo (char *s, int flag)
+{
+ for (;;)
+ {
+ unsigned char c;
+ if (flag)
+ c = *s;
+ else
+ c = *s;
+ return c;
+ }
+}
+
+int
+baz (const char *s, int flag)
+{
+ for (;;)
+ {
+ unsigned char c;
+ if (flag)
+ c = *s;
+ else
+ c = *s;
+ return c;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080924_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080924_0.c
new file mode 100644
index 000000000..db7745077
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20080924_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-O2 -flto -funsigned-char}} } */
+typedef unsigned int size_t;
+foo (const char *src, unsigned char *dst, size_t size)
+{
+ int ch;
+ while ((ch = *src++) != '\0') {
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081024_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081024_0.c
new file mode 100644
index 000000000..9fa297abc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081024_0.c
@@ -0,0 +1,26 @@
+/* { dg-lto-do run } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+char *
+myprintf (const char *fmt, ...)
+{
+ va_list args;
+ static char buf[80];
+
+ va_start (args, fmt);
+ (void) vsnprintf (buf, sizeof (buf), fmt, args);
+ va_end (args);
+ return buf;
+}
+
+int
+main ()
+{
+ char *s;
+
+ s = myprintf ("%s: %d\n", "foo", 1);
+ return strcmp (s, "foo: 1\n") != 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081109_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081109_0.c
new file mode 100644
index 000000000..eaa25f673
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081109_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-w -flto}} } */
+void Foo(void) { char bar[1]; free(bar); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081111_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081111_0.c
new file mode 100644
index 000000000..899689c1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081111_0.c
@@ -0,0 +1,11 @@
+extern int mumble;
+extern void abort (void);
+extern void exit (int);
+
+int
+main ()
+{
+ if (++mumble != 42)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081111_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081111_1.c
new file mode 100644
index 000000000..2b7fee586
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081111_1.c
@@ -0,0 +1,7 @@
+int mumble = 41;
+
+int
+bar (void)
+{
+ return mumble;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081112_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081112_0.c
new file mode 100644
index 000000000..a90aa70b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081112_0.c
@@ -0,0 +1,14 @@
+extern void exit (int);
+extern void abort (void);
+
+extern void f ();
+extern int g ();
+
+int
+main ()
+{
+ f ();
+ if (g () != 42)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081112_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081112_1.c
new file mode 100644
index 000000000..2ba1cb940
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081112_1.c
@@ -0,0 +1,13 @@
+static int mumble;
+
+void
+f (void)
+{
+ mumble = 41;
+}
+
+int __attribute__((noinline))
+g (void)
+{
+ return ++mumble;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_0.c
new file mode 100644
index 000000000..c9f4c803f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_0.c
@@ -0,0 +1,32 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
+
+extern void abort (void);
+
+int f (void)
+{
+ return 1;
+}
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_1.c
new file mode 100644
index 000000000..62ffa5200
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_1.c
@@ -0,0 +1,11 @@
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + 1;
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_2.c
new file mode 100644
index 000000000..0ccecd736
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081115_2.c
@@ -0,0 +1,5 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_0.c
new file mode 100644
index 000000000..b37eb31a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_0.c
@@ -0,0 +1,28 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
+
+extern void abort (void);
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_1.c
new file mode 100644
index 000000000..f0a8c3c87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_1.c
@@ -0,0 +1,13 @@
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + f ();
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_2.c
new file mode 100644
index 000000000..32ce432a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081118_2.c
@@ -0,0 +1,11 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
+
+ __attribute__((noinline)) int
+f (void)
+{
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-1_0.c
new file mode 100644
index 000000000..e842b37f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-1_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -r -nostdlib}} } */
+extern int stat(void) __asm__("" "stat64");
+extern inline int stat(void) { }
+static void foo(void) { stat(); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-1_1.c
new file mode 100644
index 000000000..73d25000c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-1_1.c
@@ -0,0 +1,3 @@
+extern int stat(void) __asm__("" "stat64");
+extern inline int stat(void) { }
+static void foo(void) { stat(); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-2_0.c
new file mode 100644
index 000000000..e2e11d64b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-2_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib}} } */
+void bar(void) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-2_1.c
new file mode 100644
index 000000000..c81f8c7fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081120-2_1.c
@@ -0,0 +1,2 @@
+int mumble = 0;
+void foo(void) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081125_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081125_0.c
new file mode 100644
index 000000000..4b2e7191f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081125_0.c
@@ -0,0 +1,6 @@
+int foo (int);
+
+int main()
+{
+ return foo (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081125_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081125_1.c
new file mode 100644
index 000000000..1fcf4e7d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081125_1.c
@@ -0,0 +1,4 @@
+int foo (int x)
+{
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081126_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081126_0.c
new file mode 100644
index 000000000..9243da96a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081126_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+/* { dg-lto-options {{-flto -r -nostdlib}} } */
+
+int f(void) {
+ register int ri asm("edi");
+ return ri;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_0.c
new file mode 100644
index 000000000..b6896446d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_0.c
@@ -0,0 +1,33 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -flto -flto-partition=1to1} {-O0 -flto -flto-partition=1to1}} } */
+
+extern void abort (void);
+
+int
+f (void)
+{
+ return 1;
+}
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_1.c
new file mode 100644
index 000000000..f0a8c3c87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_1.c
@@ -0,0 +1,13 @@
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + f ();
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_2.c
new file mode 100644
index 000000000..bcf87a749
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-1_2.c
@@ -0,0 +1,7 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-2_0.c
new file mode 100644
index 000000000..fd021eb1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-2_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-options {{-O3 -flto -flto-partition=1to1}} } */
+
+/* Test that cross-TU inlining works. */
+
+extern void abort ();
+extern void exit (int);
+extern void *foo (void);
+
+int
+main ()
+{
+ if (foo () != __builtin_return_address (0))
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-2_1.c
new file mode 100644
index 000000000..f93e1fd02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081201-2_1.c
@@ -0,0 +1,5 @@
+void *
+foo (void)
+{
+ return __builtin_return_address (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-1_0.c
new file mode 100644
index 000000000..1bdb91f81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-options {{-flto -flto-partition=1to1 -O3}} } */
+
+extern void exit (int);
+extern void foo (void);
+
+int
+main ()
+{
+ foo ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-1_1.c
new file mode 100644
index 000000000..2f6777864
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-1_1.c
@@ -0,0 +1,10 @@
+static void __attribute__((noinline))
+bar (void)
+{
+}
+
+void
+foo (void)
+{
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-2_0.c
new file mode 100644
index 000000000..9d34f740b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-2_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-options {{-flto -flto-partition=1to1 -O3}} } */
+
+extern void exit (int);
+extern void *foo (void);
+
+void *p;
+
+int
+main ()
+{
+ p = foo ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-2_1.c
new file mode 100644
index 000000000..adb150245
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081202-2_1.c
@@ -0,0 +1,16 @@
+static void __attribute__((noinline))
+bar (void)
+{
+}
+
+void *
+foo (void)
+{
+ return bar;
+}
+
+void
+quxx (void)
+{
+ return bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-1_0.c
new file mode 100644
index 000000000..0c3849f61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-1_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC -r -nostdlib}} } */
+
+/* Tests for the absence during linking of:
+ lto1: error: type of 'i' does not match original declaration */
+
+const int i[1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-1_1.c
new file mode 100644
index 000000000..95761ea15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-1_1.c
@@ -0,0 +1,5 @@
+extern const int i[];
+
+int dummy(void) {
+ return i[0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-2_0.c
new file mode 100644
index 000000000..53446050f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081204-2_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+/* { dg-lto-options {{-w -flto -fPIC -r -nostdlib}} } */
+
+register int ri asm("edi");
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081210-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
new file mode 100644
index 000000000..34e0ec400
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
@@ -0,0 +1,23 @@
+#if defined(_LP64)
+typedef unsigned long int uintptr_t;
+#elif defined (_WIN64)
+typedef unsigned long long int uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+
+extern void srand (uintptr_t);
+
+inline void
+foo (uintptr_t seed)
+{
+ srand (seed * seed);
+}
+
+int
+main ()
+{
+ foo (0);
+ srand ((uintptr_t) (&foo));
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081212-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081212-1_0.c
new file mode 100644
index 000000000..acc001868
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081212-1_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-r -nostdlib}} } */
+int exported_var = 42;
+/* { dg-final { scan-symbol "exported_var" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_0.c
new file mode 100644
index 000000000..091647a01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_0.c
@@ -0,0 +1,12 @@
+/* { dg-require-alias "" } */
+#include "20081222_0.h"
+
+extern void abort (void);
+
+int
+main ()
+{
+ if (x () == 7)
+ return 0;
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_0.h b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_0.h
new file mode 100644
index 000000000..4c26f4616
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_0.h
@@ -0,0 +1 @@
+int x();
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_1.c
new file mode 100644
index 000000000..755eb9918
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081222_1.c
@@ -0,0 +1,20 @@
+#include "20081222_0.h"
+
+#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x) #x
+
+/* Actually, call "x" "INT_X", and make it hidden. */
+extern __typeof (x) x
+ __asm__ (ASMNAME ("INT_x"))
+ __attribute__ ((__visibility__ ("hidden")));
+
+int x ()
+{
+ return 7;
+}
+
+/* Make an externally-visible symbol "X" that's an alias for INT_x. */
+extern __typeof (x) EXT_x
+ __asm__ (ASMNAME ("x"))
+ __attribute__ ((__alias__ ("INT_x")));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_0.c
new file mode 100644
index 000000000..9f9afdf85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -r -nostdlib -fPIC}} } */
+#include "20081224_0.h"
+
+extern struct foo x;
+
+void f(void) {
+ x.x = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_0.h b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_0.h
new file mode 100644
index 000000000..7b62a0796
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_0.h
@@ -0,0 +1,3 @@
+typedef struct foo {
+ int x;
+} foo_t;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_1.c
new file mode 100644
index 000000000..3e1ff3410
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20081224_1.c
@@ -0,0 +1,2 @@
+#include "20081224_0.h"
+foo_t x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090116_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090116_0.c
new file mode 100644
index 000000000..4a8659699
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090116_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-O1 -flto -flto-partition=1to1 -fPIC}} } */
+/* { dg-extra-ld-options {-r -nostdlib -O0} } */
+
+int foo(void) {
+ int ret, i;
+ for (i = 0; i < 1; i++)
+ ret = 0;
+ for (i = 0; i < 1; i++)
+ ret = 1;
+ return ret;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090120_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090120_0.c
new file mode 100644
index 000000000..6c69a9918
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090120_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-options {{-flto -funsigned-char}} } */
+
+extern void abort ();
+
+char c = 0xff;
+
+int
+main ()
+{
+ int i = (unsigned) c;
+ if (i < 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090126-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090126-1_0.c
new file mode 100644
index 000000000..01a129940
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090126-1_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O0 -flto -flto-partition=1to1}} } */
+/* { dg-extra-ld-options {-r -nostdlib -O2 -flto -flto-partition=1to1} } */
+
+int main(int argc, char **argv) {
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090126-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090126-2_0.c
new file mode 100644
index 000000000..f75a05fec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090126-2_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-fPIC -O2 -flto -flto-partition=1to1}} } */
+/* { dg-extra-ld-options {-fno-PIC -r -nostdlib -O2 -flto -flto-partition=1to1} } */
+
+int main(int argc, char **argv) {
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090206-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
new file mode 100644
index 000000000..83d2c8607
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } { "*" } { "" } } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto -flto-partition=1to1 -msse2}} } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-suppress-ld-options {-fPIC -msse2} } */
+
+typedef short v8hi __attribute__((__vector_size__(16)));
+void func (void) {
+ v8hi x, y, z;
+ z = __builtin_ia32_paddw128 (x, y);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090206-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
new file mode 100644
index 000000000..40b71328f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
@@ -0,0 +1,19 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } { "*" } { "" } } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-flto -flto-partition=1to1 -fPIC}} } */
+/* { dg-suppress-ld-options {-fPIC} } */
+
+void func(int n) {
+ static int __thread v = 0;
+ int i;
+ for (i = 0; i < n; ++i) {
+ volatile int *p = &v;
+ volatile int x __attribute__ ((unused)) = *p;
+ }
+}
+
+int main(int argc, char **argv) {
+ func(argc);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090210_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090210_0.c
new file mode 100644
index 000000000..ce9dfac10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090210_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do run } */
+/* { dg-require-effective-target fpic } */
+/* { dg-suppress-ld-options {-fPIC} } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-extra-ld-options "-pthread" { target *-*-solaris2.9 } } */
+int foo (int x)
+{
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090210_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090210_1.c
new file mode 100644
index 000000000..960411972
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090210_1.c
@@ -0,0 +1,22 @@
+/* { dg-options "-fPIC" { target { ! sparc*-*-* } } } */
+static void
+f (int n)
+{
+ int i;
+ static int __thread value = 100;
+ for (i = 0; i < n; ++i)
+ {
+ volatile int *p = &value;
+ volatile int x __attribute__ ((unused)) = *p;
+ }
+}
+
+
+extern int foo (int);
+
+int
+main (int argc, char **argv)
+{
+ f (foo (4) + argc);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090213_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090213_0.c
new file mode 100644
index 000000000..6387a0e47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090213_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do run } */
+#include <stdio.h>
+
+extern int foo (int);
+
+main()
+{
+ int x = foo (10);
+ printf ("x is %d, foo is at 0x%p\n", x, foo);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090213_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090213_1.c
new file mode 100644
index 000000000..4a852efd1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090213_1.c
@@ -0,0 +1,6 @@
+int foo (int x)
+{
+ return x * 32;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-1_0.c
new file mode 100644
index 000000000..750c20275
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-1_0.c
@@ -0,0 +1,4 @@
+void inline set_mem_alias_set () __attribute__ ((always_inline));
+void emit_push_insn () {
+ set_mem_alias_set ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-1_1.c
new file mode 100644
index 000000000..7db2c85e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-1_1.c
@@ -0,0 +1,9 @@
+int main(void)
+{
+ return 0;
+}
+static void __attribute__ ((noinline)) get_mem_attrs () {
+}
+void inline __attribute__ ((always_inline)) set_mem_alias_set () {
+ get_mem_attrs ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-2_0.c
new file mode 100644
index 000000000..8857e7a6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-2_0.c
@@ -0,0 +1,3 @@
+void emit_push_insn () {
+ set_mem_alias_set ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-2_1.c
new file mode 100644
index 000000000..5e103cb03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218-2_1.c
@@ -0,0 +1,19 @@
+typedef struct {
+} mem_attrs;
+int main(void)
+{
+ return 0;
+}
+void *malloc(__SIZE_TYPE__ size);
+void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n);
+static mem_attrs * get_mem_attrs () {
+ void **slot;
+ *slot = malloc (3);
+ memcpy (*slot, 0, 3);
+}
+void set_mem_attributes () {
+ get_mem_attrs ();
+}
+void set_mem_alias_set () {
+ get_mem_attrs ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_0.c
new file mode 100644
index 000000000..c4390fa1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_0.c
@@ -0,0 +1,7 @@
+void __attribute__((noinline)) *foo1(void);
+void __attribute__((noinline)) *foo2(void);
+
+int main(void)
+{
+ return foo1() != foo2();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_1.c
new file mode 100644
index 000000000..c28b84ada
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_1.c
@@ -0,0 +1,6 @@
+void bar(void);
+void __attribute__((noinline)) *foo1 (void)
+{
+ bar();
+ return (void *) bar;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_2.c
new file mode 100644
index 000000000..e9f835f36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_2.c
@@ -0,0 +1,6 @@
+void bar(void);
+void __attribute__((noinline)) *foo2 (void)
+{
+ bar();
+ return (void *) bar;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_3.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_3.c
new file mode 100644
index 000000000..e1f4df614
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090218_3.c
@@ -0,0 +1,3 @@
+void bar(void)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090219_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090219_0.c
new file mode 100644
index 000000000..985c884ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090219_0.c
@@ -0,0 +1,29 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-O3 -flto -flto-partition=1to1 -fPIC -r -nostdlib}} } */
+
+struct Foo { int f1, f2, f3, f4, f5; };
+
+int x = 0;
+struct Foo *foo;
+
+inline void Bar(int n){
+ foo[x].f1 = 0;
+ foo[x].f2 = 0;
+ foo[x].f3 = 0;
+ foo[x].f4 = 0;
+ foo[x].f5 = n;
+}
+
+int ei[1];
+inline void Baz(int n) {
+ if (ei[n] == 1)
+ Bar (0);
+ else if (ei[n] == 0)
+ Bar (1);
+}
+
+void mumble(void) {
+ for (;;)
+ Baz (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090312_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090312_0.c
new file mode 100644
index 000000000..8aaad754c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090312_0.c
@@ -0,0 +1,43 @@
+/* { dg-lto-do link } */
+extern int **foo (void);
+extern void mumble (char*, char*, char*);
+
+static int *
+bar (char **sp)
+{
+ char *s = *sp, *rs = s;
+ int c;
+ while (*foo ()[c])
+ rs++;
+ while (c = *rs)
+ {
+ if (c || ((c == '"') || (c == '\'')))
+ {
+ if (c)
+ *rs++ = c;
+ else
+ mumble (0, "", "");
+ }
+ else if (c || (*foo ()[c] & 1))
+ *rs++ = c;
+ }
+ if (c)
+ mumble (0, "", "");
+}
+
+static void
+baz (char *s)
+{
+ char *args[100];
+ while (bar (&s))
+ {
+ mumble (args[0], "", "");
+ }
+}
+
+int
+main (void)
+{
+ baz ("");
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090312_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090312_1.c
new file mode 100644
index 000000000..882fb0f41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090312_1.c
@@ -0,0 +1,9 @@
+int **foo (void)
+{
+
+}
+
+void mumble (char* a, char* b , char* c)
+{
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090313_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090313_0.c
new file mode 100644
index 000000000..226e64713
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090313_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-options "-mcpu=v9" { target sparc*-*-* } } */
+/* { dg-require-effective-target sync_char_short } */
+void
+_cairo_clip_path_reference () {
+ int a;
+ __sync_fetch_and_add(&a, 1);
+}
+
+int main(void) {
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090706-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090706-1_0.c
new file mode 100644
index 000000000..7877fd350
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090706-1_0.c
@@ -0,0 +1,42 @@
+#include <stdarg.h>
+
+extern void abort (void);
+
+void foo (int size, ...)
+{
+ struct
+ {
+ struct
+ {
+ char x[size];
+ } e;
+ unsigned r;
+ } d;
+ va_list ap;
+ char c;
+ int i;
+
+ va_start (ap, size);
+ d = va_arg (ap, typeof (d));
+ c = d.e.x[3];
+ if (c != '3')
+ abort ();
+ if (d.r != 2602)
+ abort ();
+ va_end (ap);
+}
+
+int main (void)
+{
+ int z = 5, i;
+ struct { struct { char a[z]; } y; unsigned r; } x;
+
+ x.y.a[0] = '0';
+ x.y.a[1] = '1';
+ x.y.a[2] = '2';
+ x.y.a[3] = '3';
+ x.y.a[4] = '4';
+ x.r = 2602;
+ foo (z, x);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090706-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090706-2_0.c
new file mode 100644
index 000000000..69da98b5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090706-2_0.c
@@ -0,0 +1,16 @@
+extern void abort (void);
+
+int foo (int size)
+{
+ int a[size];
+ a[size - 10] = 42;
+ return a[size - 10] + size;
+}
+
+main()
+{
+ int x = foo (20);
+ if (x != 62)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090717_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090717_0.c
new file mode 100644
index 000000000..fe13bdf78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090717_0.c
@@ -0,0 +1,4 @@
+struct variable {
+ const char *string;
+};
+struct variable table[] = { };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090717_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090717_1.c
new file mode 100644
index 000000000..bda813821
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090717_1.c
@@ -0,0 +1,11 @@
+struct variable {
+ const char *string;
+};
+extern struct variable table[];
+int main(int argc, char *argv[])
+{
+ struct variable *p;
+ for(p = table; p->string; p++)
+ ;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090729_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090729_0.c
new file mode 100644
index 000000000..05ae74f87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090729_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-options "-w" } */
+
+double i;
+int j;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090729_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090729_1.c
new file mode 100644
index 000000000..0a5091ac2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090729_1.c
@@ -0,0 +1,4 @@
+double j;
+int i;
+int main () { return i; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090812_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090812_0.c
new file mode 100644
index 000000000..baf20f520
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090812_0.c
@@ -0,0 +1,11 @@
+struct X;
+struct Y
+{
+ struct X *p;
+ int i;
+};
+
+void foo (struct Y *p)
+{
+ p->i = 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090812_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090812_1.c
new file mode 100644
index 000000000..e91424492
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090812_1.c
@@ -0,0 +1,26 @@
+/* struct X is complete in this TU, this causes us to not merge Y and
+ thus assign different alias-sets to them. */
+struct X
+{
+ int i;
+};
+struct Y
+{
+ struct X *p;
+ int i;
+};
+extern void abort (void);
+extern void foo(struct Y *);
+int __attribute__((noinline)) bar(struct Y *p)
+{
+ p->i = 0;
+ foo (p);
+ return p->i;
+}
+int main()
+{
+ struct Y y;
+ if (bar (&y) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090914-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090914-1_0.c
new file mode 100644
index 000000000..ef9f7b351
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090914-1_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -g -fvar-tracking-assignments}} } */
+/* { dg-suppress-ld-options "-g -fvar-tracking-assignments" } */
+
+void foo()
+{
+ int hex = 0x4;
+}
+
+int main()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090914-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
new file mode 100644
index 000000000..d83ed377b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-do run } */
+/* { dg-skip-if "x86 only" { ! { x86_64-*-* i?86-*-* } } { "*" } { "" } } */
+/* { dg-skip-if "no .type" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "no @function" { *-*-mingw* *-*-cygwin* } { "*" } { "" } } */
+
+/* Doesn't work without this dummy function with -fwhopr. */
+int foo(void) { }
+
+asm(".text\n"
+ ".globl main\n"
+ "\t.type main,@function\n"
+ "main:\n"
+ "\txorl %eax, %eax\n"
+ "\tret\n");
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-1_0.c
new file mode 100644
index 000000000..f4316efbc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-1_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do run } */
+
+const int i[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-1_1.c
new file mode 100644
index 000000000..52eb8e78b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-1_1.c
@@ -0,0 +1,2 @@
+extern int i[10];
+int main () { return i[0]; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-2_0.c
new file mode 100644
index 000000000..d1485d671
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091005-2_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fstrict-aliasing -flto}} } */
+
+typedef struct { } t_commrec;
+typedef struct { } t_fft_c;
+void
+solve_pme(t_commrec *cr)
+{
+ t_fft_c *ptr;
+}
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-1_0.c
new file mode 100644
index 000000000..9b4356edc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-1_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-do link } */
+
+typedef void (*fnt) (void);
+void __attribute__((noinline)) bar (void) {}
+extern inline void check3 (void)
+{
+ bar ();
+}
+void test (void)
+{
+ const fnt pcheck3 = check3;
+ pcheck3 ();
+}
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-1_1.c
new file mode 100644
index 000000000..f82f82700
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-1_1.c
@@ -0,0 +1,2 @@
+extern void bar (void);
+void check3 (void) { bar (); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_0.c
new file mode 100644
index 000000000..abe12c40c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options "-w" } */
+
+extern int a[10];
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_1.c
new file mode 100644
index 000000000..581839344
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_1.c
@@ -0,0 +1 @@
+int a[16];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_2.c
new file mode 100644
index 000000000..a610b2b12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091006-2_2.c
@@ -0,0 +1 @@
+extern int a[14];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
new file mode 100644
index 000000000..83de8d322
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
@@ -0,0 +1,22 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto} {-fPIC -r -nostdlib -O2 -flto}} } */
+
+void * HeapAlloc(void*,unsigned int,unsigned long);
+
+typedef struct tagGdiFont GdiFont;
+
+typedef struct tagDC {
+ int xunused;
+ GdiFont *gdiFont;
+ unsigned int font_code_page;
+} DC;
+
+DC *alloc_dc_ptr( void *funcs, unsigned short magic )
+{
+ DC *dc;
+ if (!(dc = HeapAlloc( 0, 0, sizeof(*dc) ))) return ((void *)0);
+ dc->gdiFont = 0;
+ return dc;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
new file mode 100644
index 000000000..ff890dce4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
@@ -0,0 +1,112 @@
+/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* } { "*" } { "" } } */
+typedef struct HDC__ { int unused; } *HDC;
+typedef struct HFONT__ { int unused; } *HFONT;
+
+typedef struct
+{
+ unsigned int ciACP;
+} CHARSETINFO, *PCHARSETINFO, *LPCHARSETINFO;
+
+typedef struct tagTEXTMETRICW
+{
+ int tmCharSet;
+} TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
+
+struct gdi_obj_funcs
+{
+ void* (*pSelectObject)( void* handle, void* hdc );
+};
+
+typedef struct tagGdiFont GdiFont;
+
+typedef struct tagDC
+{
+ int xunused;
+ GdiFont *gdiFont;
+ unsigned int font_code_page;
+} DC;
+
+extern GdiFont* WineEngCreateFontInstance(DC*, HFONT);
+extern unsigned int WineEngGetTextCharsetInfo(GdiFont *font, void* fs, unsigned int flags);
+extern int WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW);
+extern void* alloc_gdi_handle( void *obj, unsigned short type, const struct gdi_obj_funcs *funcs );
+
+enum __wine_debug_class
+{
+ __WINE_DBCL_FIXME,
+ __WINE_DBCL_ERR,
+ __WINE_DBCL_WARN,
+ __WINE_DBCL_TRACE,
+
+ __WINE_DBCL_INIT = 7
+};
+
+struct __wine_debug_channel
+{
+ unsigned char flags;
+ char name[15];
+};
+
+extern int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func,
+ const char *format, ... ) __attribute__((format (printf,4,5)));
+
+static struct __wine_debug_channel __wine_dbch_font = { ~0, "font" };
+static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_font;
+
+static void* FONT_SelectObject( void* handle, void* hdc );
+
+static const struct gdi_obj_funcs font_funcs =
+{
+ FONT_SelectObject,
+};
+
+HFONT CreateFontIndirectW( const void *plf )
+{
+ return alloc_gdi_handle( 0, 6, &font_funcs );
+}
+
+static void update_font_code_page( DC *dc )
+{
+ CHARSETINFO csi;
+ int charset = (unsigned char)1;
+
+ if (dc->gdiFont)
+ charset = WineEngGetTextCharsetInfo( dc->gdiFont, ((void *)0), 0 );
+
+ if (TranslateCharsetInfo( ((void *)(unsigned long)((unsigned long)charset)), &csi, 1) )
+ dc->font_code_page = csi.ciACP;
+ else {
+ switch(charset) {
+ case (unsigned char)1:
+ dc->font_code_page = GetACP();
+ break;
+
+ case (unsigned char)246:
+ dc->font_code_page = 0;
+ break;
+
+ default:
+ do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_FIXME))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_FIXME; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "Can't find codepage for charset %d\n", charset); } } while(0);
+ dc->font_code_page = 0;
+ break;
+ }
+ }
+
+ do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_TRACE))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_TRACE; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "charset %d => cp %d\n", charset, dc->font_code_page); } } while(0);
+}
+
+static void* FONT_SelectObject( void* handle, void* hdc )
+{
+ DC *dc;
+
+ dc->gdiFont = WineEngCreateFontInstance( dc, handle );
+ update_font_code_page( dc );
+ return 0;
+}
+
+int GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
+{
+ DC * dc;
+ return WineEngGetTextMetrics(dc->gdiFont, metrics);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
new file mode 100644
index 000000000..60bd1defa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -0,0 +1,221 @@
+/* { dg-xfail-if "cast to pointer of different size" { "avr-*-*" x86_64-*-mingw* } { "*" } { "" } } */
+typedef struct HDC__ { int unused; } *HDC;
+typedef struct HFONT__ { int unused; } *HFONT;
+
+void* HeapAlloc(void*,unsigned int,unsigned long);
+
+typedef struct tagLOGFONTW
+{
+ int lfPitchAndFamily;
+ unsigned short lfFaceName[32];
+} LOGFONTW, *PLOGFONTW, *LPLOGFONTW;
+
+typedef struct tagGdiFont GdiFont;
+typedef struct tagDC DC;
+
+extern unsigned int WineEngGetFontData(GdiFont*, unsigned int, unsigned int, void*, unsigned int);
+
+struct list
+{
+ struct list *next;
+ struct list *prev;
+};
+
+typedef struct FT_FaceRec_
+{
+ signed long face_flags;
+} FT_FaceRec, *FT_Face;
+
+typedef struct { } GM;
+
+typedef struct { } FMAT2;
+
+typedef struct {
+ unsigned int hash;
+ LOGFONTW lf;
+ int can_use_bitmap;
+} FONT_DESC;
+
+
+
+typedef struct tagHFONTLIST {
+ struct list entry;
+ HFONT hfont;
+} HFONTLIST;
+
+typedef struct {
+ struct list entry;
+ void *face;
+ GdiFont *font;
+} CHILD_FONT;
+
+
+struct tagGdiFont {
+ struct list entry;
+ GM **gm;
+ struct list hfontlist;
+ struct list child_fonts;
+
+ FT_Face ft_face;
+ FONT_DESC font_desc;
+ long ppem;
+};
+
+
+
+static struct list gdi_font_list = { &(gdi_font_list), &(gdi_font_list) };
+
+
+
+
+static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph);
+static long load_VDMX(GdiFont*, long);
+
+extern int f1(void*,int);
+
+static FT_Face OpenFontFace(GdiFont *font, void *face, long width, long height)
+{
+ FT_Face ft_face;
+
+ font->ppem = load_VDMX(font, height);
+ if(font->ppem == 0)
+ font->ppem = f1(ft_face, height);
+ return ft_face;
+}
+
+
+static GdiFont *alloc_font(void)
+{
+ GdiFont *ret = HeapAlloc(0, 0x00000008, sizeof(*ret));
+ ret->gm = HeapAlloc(0, 0x00000008, sizeof(GM*));
+ return ret;
+}
+
+
+static long load_VDMX(GdiFont *font,long height)
+{
+ unsigned short hdr[3];
+
+ WineEngGetFontData(font, 0x42424242, 0, hdr, 6);
+ return 0;
+}
+
+static int fontcmp(const GdiFont *font, FONT_DESC *fd)
+{
+ if(font->font_desc.hash != fd->hash) return 1;
+ if(memcmp(&font->font_desc.lf, &fd->lf, __builtin_offsetof (LOGFONTW, lfFaceName))) return 1;
+ if(!font->font_desc.can_use_bitmap != !fd->can_use_bitmap) return 1;
+ return strcmpiW(font->font_desc.lf.lfFaceName, fd->lf.lfFaceName);
+}
+
+static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pmat, int can_use_bitmap)
+{
+ GdiFont *ret;
+ FONT_DESC fd;
+ HFONTLIST *hflist;
+ struct list *font_elem_ptr, *hfontlist_elem_ptr;
+
+ fd.lf = *plf;
+ fd.can_use_bitmap = can_use_bitmap;
+
+
+ for ((font_elem_ptr) = (&gdi_font_list)->next; (font_elem_ptr) != (&gdi_font_list); (font_elem_ptr) = (font_elem_ptr)->next) {
+ ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry)));
+ if(!fontcmp(ret, &fd)) {
+ if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue;
+ for ((hfontlist_elem_ptr) = (&ret->hfontlist)->next; (hfontlist_elem_ptr) != (&ret->hfontlist); (hfontlist_elem_ptr) = (hfontlist_elem_ptr)->next) {
+ hflist = ((struct tagHFONTLIST *)((char *)(hfontlist_elem_ptr) - (unsigned long)(&((struct tagHFONTLIST *)0)->entry)));
+ if(hflist->hfont == hfont)
+ return ret;
+ }
+ hflist = HeapAlloc(0, 0, sizeof(*hflist));
+ hflist->hfont = hfont;
+ return ret;
+ }
+ }
+
+ while(font_elem_ptr) {
+ ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry)));
+ if(!fontcmp(ret, &fd)) {
+ if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue;
+ hflist = HeapAlloc(0, 0, sizeof(*hflist));
+ hflist->hfont = hfont;
+ return ret;
+ }
+ }
+ return ((void *)0);
+}
+
+
+
+
+GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
+{
+ GdiFont *ret;
+ int can_use_bitmap;
+ LOGFONTW lf;
+ FMAT2 dcmat;
+
+ if((ret = find_in_cache(hfont, &lf, &dcmat, can_use_bitmap)) != ((void *)0))
+ return ret;
+ return alloc_font();
+}
+
+extern unsigned int f(void*,unsigned int g);
+
+static unsigned int get_glyph_index(void*font, unsigned int glyph)
+{
+ return f(font, glyph);
+}
+
+unsigned int WineEngGetGlyphOutline(GdiFont *incoming_font, unsigned int glyph, unsigned int format,
+ void* lpgm, unsigned int buflen, void* buf,
+ const void* lpmat)
+{
+ unsigned int glyph_index;
+
+ get_glyph_index_linked(incoming_font, glyph, &incoming_font, &glyph_index);
+ return 0;
+}
+
+static int load_child_font(GdiFont *font, CHILD_FONT *child)
+{
+ child->font = alloc_font();
+ child->font->ft_face = OpenFontFace(child->font, child->face, 0, -font->ppem);
+ if(!child->font->ft_face)
+ return 0;
+ return 1;
+}
+
+static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph)
+{
+ unsigned int g;
+ CHILD_FONT *child_font;
+
+ for ((child_font) = ((CHILD_FONT *)((char *)((&font->child_fonts)->next) - (unsigned long)(&((CHILD_FONT *)0)->entry))); &(child_font)->entry != (&font->child_fonts); (child_font) = ((CHILD_FONT *)((char *)((child_font)->entry.next) - (unsigned long)(&((CHILD_FONT *)0)->entry))))
+ {
+ if(!load_child_font(font, child_font))
+ continue;
+
+ g = get_glyph_index(child_font->font, c);
+ if(g) {
+ *glyph = g;
+ *linked_font = child_font->font;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+unsigned int WineEngGetFontData(GdiFont *font, unsigned int table, unsigned int offset, void* buf,
+ unsigned int cbData)
+{
+ unsigned long len;
+ load_sfnt_table(font->ft_face, table, offset, buf, &len);
+ return len;
+}
+
+int WineEngGetLinkedHFont(DC *dc, unsigned short c, HFONT *new_hfont, unsigned int *glyph) {
+ return get_glyph_index_linked(0, 0, 0, 0);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091014-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091014-1_0.c
new file mode 100644
index 000000000..be327aaff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091014-1_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+/* Empty file. See PR41173. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_0.c
new file mode 100644
index 000000000..1c11f6448
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_0.c
@@ -0,0 +1,6 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto} {-fPIC -r -nostdlib -O2 -flto -flto-partition=1to1}} } */
+
+#include "20091015-1_b.h"
+void diagnostic_initialize (FILE **stream) { *stream = stderr; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_1.c
new file mode 100644
index 000000000..c000518f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_1.c
@@ -0,0 +1,4 @@
+#include "20091015-1_a.h"
+#include "20091015-1_b.h"
+void ggc_print_common_statistics (FILE *stream) {
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
new file mode 100644
index 000000000..fd1068086
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
@@ -0,0 +1,5 @@
+#include "20091015-1_a.h"
+#include "20091015-1_b.h"
+void debug_optab_libfuncs (void) {
+foo (stderr, 4 );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_a.h b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_a.h
new file mode 100644
index 000000000..61e56c9a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_a.h
@@ -0,0 +1,2 @@
+struct _IO_FILE { int _flags;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_b.h b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_b.h
new file mode 100644
index 000000000..881390274
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091015-1_b.h
@@ -0,0 +1,2 @@
+typedef struct _IO_FILE FILE;
+extern struct _IO_FILE *stderr;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_0.c
new file mode 100644
index 000000000..b44c75a97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto}} } */
+
+typedef struct VEC_constructor_elt_gc { } VEC_constructor_elt_gc;
+#include "20091016-1_a.h"
+struct stmt_tree_s {
+ tree x_cur_stmt_list;
+};
+void *add_stmt (struct stmt_tree_s *x)
+{
+ return &x->x_cur_stmt_list;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_1.c
new file mode 100644
index 000000000..06389b8e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_1.c
@@ -0,0 +1,18 @@
+typedef struct VEC_constructor_elt_gcx { } VEC_constructor_elt_gc;
+#include "20091016-1_a.h"
+struct gcc_target {
+ void (* builtin_vec_perm) (tree*);
+};
+extern struct gcc_target targetm;
+void dwarf2out_begin_prologue (tree t)
+{
+ (*targetm.builtin_vec_perm) (&t);
+}
+struct die_arg_entry_struct {
+ tree arg;
+};
+void *gt_pch_p_20VEC_die_arg_entry_gc (struct die_arg_entry_struct *vec)
+{
+ return &(vec->arg);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_a.h b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_a.h
new file mode 100644
index 000000000..8eefed5cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091016-1_a.h
@@ -0,0 +1,6 @@
+typedef union tree_node *tree;
+union tree_node {
+ tree * use;
+ VEC_constructor_elt_gc *elts;
+};
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091017-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091017-1_0.c
new file mode 100644
index 000000000..ec4c62e4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091017-1_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int i;
+};
+extern void foo (void *);
+extern void abort (void);
+int main ()
+{
+ struct X *p;
+ foo(&p);
+ if (p != (struct X *)0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091017-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091017-1_1.c
new file mode 100644
index 000000000..23e5992bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091017-1_1.c
@@ -0,0 +1,6 @@
+struct X;
+void foo (void *q)
+{
+ struct X **p = (struct X **)q;
+ *p = (struct X *)0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-1_0.c
new file mode 100644
index 000000000..f9d8bf87d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-1_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+void cli_7unz (CSzAr db) { }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-1_1.c
new file mode 100644
index 000000000..899183a24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-1_1.c
@@ -0,0 +1,15 @@
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+typedef struct {
+ CSzAr db;
+} CSzArEx;
+int SzArEx_Init(CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+int SzArEx_GetFolderFullPackSize(const CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-2_0.c
new file mode 100644
index 000000000..21e596787
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-2_0.c
@@ -0,0 +1,19 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+typedef struct {
+ CSzAr db;
+} CSzArEx;
+int SzArEx_Init(CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+int SzArEx_GetFolderFullPackSize(const CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-2_1.c
new file mode 100644
index 000000000..9174f26c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-2_1.c
@@ -0,0 +1,5 @@
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+void cli_7unz (CSzAr db) { }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-3_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-3_0.c
new file mode 100644
index 000000000..441a7b91a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091020-3_0.c
@@ -0,0 +1,20 @@
+/* { dg-lto-do assemble } */
+
+typedef __SIZE_TYPE__ size_t;
+static int stack_dir;
+static void find_stack_direction ()
+{
+ static char *addr = ((void *)0);
+ auto char dummy;
+ if (addr == ((void *)0))
+ {
+ addr = &(dummy);
+ find_stack_direction ();
+ }
+}
+void * C_alloca (size_t size)
+{
+ if (stack_dir == 0)
+ find_stack_direction ();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091027-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091027-1_0.c
new file mode 100644
index 000000000..f2669fe0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091027-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options "-r -nostdlib" } */
+
+typedef struct _xmlDict xmlDict;
+struct _xmlDict {
+ int ref_counter;
+};
+void xmlDictCreate(void) {
+ xmlDict * dict;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091027-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091027-1_1.c
new file mode 100644
index 000000000..d92394cc5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091027-1_1.c
@@ -0,0 +1,9 @@
+typedef struct _xmlDict xmlDict;
+struct _xmlDoc {
+ struct _xmlDict *dict;
+};
+void xmlAddEntity(struct _xmlDoc *a) {
+ xmlDict * dict = a->dict;
+ xmlHashCreateDict(0, dict);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091209-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091209-1_0.c
new file mode 100644
index 000000000..5aa2fe0b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091209-1_0.c
@@ -0,0 +1,23 @@
+/* Stream an indirect edge in and out. */
+
+/* { dg-lto-do link } */
+/* { dg-lto-options {{ -O3 -fno-early-inlining -flto }} } */
+
+volatile int something;
+
+static void hooray ()
+{
+ something = 1;
+}
+
+static void hiphip (void (*f)())
+{
+ something = 2;
+ f ();
+}
+
+int main (int argc, int *argv[])
+{
+ hiphip (hooray);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091216-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091216-1_0.c
new file mode 100644
index 000000000..7bcf1f38d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20091216-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do run } */
+
+#include "../nop.h"
+
+asm (".globl start_\nstart_: " NOP);
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100103-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100103-1_0.c
new file mode 100644
index 000000000..8e1b48417
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100103-1_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-funsigned-char -flto} {-fsigned-char -flto}} } */
+
+char *foo;
+int main()
+{
+ foo = "bar";
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100103-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100103-2_0.c
new file mode 100644
index 000000000..1fb6a7b3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100103-2_0.c
@@ -0,0 +1,12 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O -flto -funsigned-char} {-O -flto -fsigned-char}} } */
+
+char p[32] = "";
+int main ()
+{
+ if (__builtin___strcpy_chk (p + 1, "vwxyz",
+ __builtin_object_size (p + 1, 0)) != p + 1)
+ __builtin_abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100104_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100104_0.c
new file mode 100644
index 000000000..c17e7682f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100104_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do assemble } */
+/* The problem with this testcase is that we were missing an undefined
+ reference to c_common_attribute_table. This can be tested with
+ GNUTARGET=plugin nm --plugin liblto_plugin.so 20100104_0.o
+ but we don't have support in the testsuite for doing it. */
+
+extern int c_common_attribute_table[];
+void *foobar = c_common_attribute_table;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100108_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100108_0.c
new file mode 100644
index 000000000..73f44ec05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100108_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do assemble } */
+/* The problem with this testcase is that we were missing an undefined
+ reference to flag_exceptions. This can be tested with
+ GNUTARGET=plugin nm --plugin liblto_plugin.so 20100108_0.o
+ but we don't have support in the testsuite for doing it. */
+
+extern int flag_exceptions;
+static int *foo = &flag_exceptions;
+int **bar = &foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100227-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100227-1_0.c
new file mode 100644
index 000000000..4145c7001
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100227-1_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options "-w" } */
+
+/* Make sure we do not ICE on the invalid re-declaration of s. */
+
+extern void f(void);
+const char *s = "Hello, world!";
+
+int main(void)
+{
+ f();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100227-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100227-1_1.c
new file mode 100644
index 000000000..a10ba0259
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100227-1_1.c
@@ -0,0 +1,8 @@
+extern int puts(const char *);
+extern const char s[];
+
+void f(void)
+{
+ puts(s);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-1_0.c
new file mode 100644
index 000000000..1963c1fee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-1_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-do run } */
+
+struct bar {int x;};
+extern struct bar foo(void);
+int main()
+{
+ struct bar x=foo();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-1_1.c
new file mode 100644
index 000000000..8b159d2cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-1_1.c
@@ -0,0 +1,7 @@
+typedef struct{int x;} bar;
+bar foo (void)
+{
+ bar x;
+ return x;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-2_0.c
new file mode 100644
index 000000000..f546757c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-2_0.c
@@ -0,0 +1,25 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O2 -flto -flto-partition=none} {-O2 -flto -flto-partition=1to1} {-O3 -flto -flto-partition=none} {-O3 -flto -flto-partition=1to1}} } */
+
+#include <stdio.h>
+
+typedef unsigned char uch;
+extern uch inbuf[];
+unsigned insize;
+char *progname;
+extern void read_error (void);
+int fill_inbuf(int eof_ok)
+{
+ if (insize == 0)
+ {
+ if (eof_ok)
+ return -1;
+ read_error();
+ }
+ return inbuf[0];
+}
+void read_error(void)
+{
+ fprintf(stderr, "\n%s: ", progname);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-2_1.c
new file mode 100644
index 000000000..546de6573
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100423-2_1.c
@@ -0,0 +1,20 @@
+typedef unsigned char uch;
+uch inbuf[8];
+extern unsigned insize;
+unsigned inptr;
+int to_stdout = 0;
+int force = 0;
+extern int fill_inbuf (int);
+int get_method(int in)
+{
+ char magic[2];
+ if (force && to_stdout)
+ magic[0] = (char)(inptr < insize ? inbuf[inptr++] : fill_inbuf(1));
+ else
+ magic[1] = (char)(inptr < insize ? inbuf[inptr++] : fill_inbuf(0));
+}
+int main()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100426_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100426_0.c
new file mode 100644
index 000000000..e1dc06f96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100426_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-r -nostdlib -flto -g}} } */
+
+long Perl_my_htonl (long l)
+{
+ union { } u;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100430-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100430-1_0.c
new file mode 100644
index 000000000..d2e79c629
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100430-1_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O2 -fprofile-arcs -flto -r -nostdlib}} } */
+
+void
+expand_stmt_with_iterators_1 (void)
+{
+ extern void expand_expr_stmt (void);
+ expand_expr_stmt ();
+}
+void
+iterator_expand (void)
+{
+ expand_stmt_with_iterators_1 ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100518_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100518_0.c
new file mode 100644
index 000000000..c0e9c8be2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100518_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+/* Forgot to steam in/out the number of labels for asm goto. PR44184. */
+
+extern int printf (__const char *__restrict __format, ...);
+
+int x = 1;
+int main ()
+{
+ asm goto ("decl %0; jnz %l[a]" :: "m"(x) : "memory" : a);
+ printf ("Hello world\n");
+a:
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-1_0.c
new file mode 100644
index 000000000..cc35c78cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-1_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options {-r -nostdlib} } */
+
+/* This file intentionally left empty. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-2_0.c
new file mode 100644
index 000000000..11bee496d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-2_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options {-r -nostdlib} } */
+
+int foo;
+int *i = &foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-3_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-3_0.c
new file mode 100644
index 000000000..3fc08fdbf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100603-3_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options {-r -nostdlib} } */
+
+int i = 42;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100709-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100709-1_0.c
new file mode 100644
index 000000000..33f38f6c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100709-1_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+
+struct X;
+struct Y {
+ struct X (*fnptr)(struct X);
+};
+struct Y foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100709-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100709-1_1.c
new file mode 100644
index 000000000..b970795c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100709-1_1.c
@@ -0,0 +1,11 @@
+struct X { int i; };
+struct Y {
+ struct X (*fnptr)(struct X);
+};
+extern struct Y foo;
+int main()
+{
+ struct X x;
+ foo.fnptr(x);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-1_0.c
new file mode 100644
index 000000000..ca9366f62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-1_0.c
@@ -0,0 +1,22 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int a;
+};
+
+typedef struct list_node *list;
+
+struct list_node {
+ list next;
+ struct X *value;
+};
+
+list f(void)
+{
+ return 0;
+}
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-1_1.c
new file mode 100644
index 000000000..789e88e7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-1_1.c
@@ -0,0 +1,15 @@
+struct X {
+ int b;
+};
+
+typedef struct list_node *list;
+
+struct list_node {
+ list next;
+ struct X *value;
+};
+
+list g(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-2_0.c
new file mode 100644
index 000000000..87b13b0de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-2_0.c
@@ -0,0 +1,23 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int a;
+};
+
+typedef struct list_node *list;
+
+struct list_node {
+ list next;
+ list *ptr;
+ struct X *value;
+};
+
+list f(list lst)
+{
+ return lst->next;
+}
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-2_1.c
new file mode 100644
index 000000000..b3a2cd06e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-2_1.c
@@ -0,0 +1,16 @@
+struct X {
+ int b;
+};
+
+typedef struct list_node *list;
+
+struct list_node {
+ list next;
+ list *ptr;
+ struct X *value;
+};
+
+list *g(list *ptr)
+{
+ return ptr;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-3_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-3_0.c
new file mode 100644
index 000000000..99c89ebd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-3_0.c
@@ -0,0 +1,24 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int a;
+};
+
+struct link {
+ struct list_node *next;
+};
+
+struct list_node {
+ struct link lnk;
+ struct X *value;
+};
+
+void f(struct list_node *lst)
+{
+ lst->lnk.next = 0;
+}
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-3_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-3_1.c
new file mode 100644
index 000000000..3d323813e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-3_1.c
@@ -0,0 +1,17 @@
+struct X {
+ int b;
+};
+
+struct link {
+ struct list_node *next;
+};
+
+struct list_node {
+ struct link lnk;
+ struct X *value;
+};
+
+void g(struct list_node *lst)
+{
+ lst->lnk.next = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-4_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-4_0.c
new file mode 100644
index 000000000..e7669552f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100720-4_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -fsigned-char} {-flto -funsigned-char}} } */
+
+char *a;
+int f;
+
+void
+foo (void)
+{
+ f = (*a != '-');
+}
+int main()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100722-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100722-1_0.c
new file mode 100644
index 000000000..275a03c25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100722-1_0.c
@@ -0,0 +1,6 @@
+/* { dg-lto-do run } */
+/* { dg-require-linker-plugin "" } */
+/* { dg-extra-ld-options "-fuse-linker-plugin" } */
+
+int main() { return 0; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100724-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100724-1_0.c
new file mode 100644
index 000000000..9651242ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100724-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+
+void baz(void)
+{
+ __builtin_abort ();
+}
+void foo(void)
+{
+ baz();
+}
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100724-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100724-1_1.c
new file mode 100644
index 000000000..dc101e60c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100724-1_1.c
@@ -0,0 +1,5 @@
+extern __attribute__((__noreturn__)) void baz(void);
+void bar(void)
+{
+ baz();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100825-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100825-1_0.c
new file mode 100644
index 000000000..67b5ce035
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20100825-1_0.c
@@ -0,0 +1,57 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O3 -flto } } } */
+
+typedef unsigned int UINT32;
+typedef unsigned long long UINT64;
+typedef struct { UINT64 w[2]; } UINT128;
+void _bid_to_dpd128 (UINT128 *, UINT128 *);
+static const int short_recip_scale[] = {
+ 1,
+ 65 - 64,
+ 69 - 64,
+ 71 - 64,
+ 75 - 64,
+ 78 - 64,
+ 81 - 64,
+ 85 - 64,
+ 88 - 64,
+ 91 - 64,
+ 95 - 64,
+ 98 - 64,
+ 101 - 64,
+ 105 - 64,
+ 108 - 64,
+ 111 - 64,
+ 115 - 64,
+ 118 - 64
+};
+
+void _bid_to_dpd128 (UINT128 *, UINT128 *);
+
+void
+_bid_to_dpd128 (UINT128 *pres, UINT128 *px) {
+ UINT128 res;
+ unsigned int comb;
+ UINT128 bcoeff;
+ UINT128 BH;
+ UINT64 BL, d109;
+ unsigned int amount;
+ UINT128 x = *px;
+
+ comb = (x.w[1] ) >> 46;
+ if ((comb & 0x1e000) == 0x1e000) {
+ res = x;
+ } else {
+ bcoeff.w[1] = (x.w[1] & 0x0001ffffffffffffull);
+ bcoeff.w[0] = x.w[0];
+ amount = 9;
+ BH.w[0] = (BH.w[0] >> amount) | (BH.w[1] << (64 - amount));
+ BL = bcoeff.w[0] - BH.w[0] * 1000000000000000000ull;
+ d109 = 0x3333333333333334ull;
+ { UINT64 CXH, CXL, CYH,CYL,PL,PH,PM,PM2; CXH = (BH.w[0]) >> 32; CXL = (UINT32)(BH.w[0]); CYH = (d109) >> 32; CYL = (UINT32)(d109); PM = CXH*CYL; PH = CXH*CYH; PL = CXL*CYL; PM2 = CXL*CYH; PH += (PM>>32); PM = (UINT64)((UINT32)PM)+PM2+(PL>>32); };
+ { UINT64 CXH, CXL, CYH,CYL,PL,PH,PM,PM2; CXH = (BL) >> 32; CXL = (UINT32)(BL); CYH = (d109) >> 32; CYL = (UINT32)(d109); PM = CXH*CYL; PH = CXH*CYH; PL = CXL*CYL; PM2 = CXL*CYH; PH += (PM>>32); PM = (UINT64)((UINT32)PM)+PM2+(PL>>32); };
+ }
+ *pres = res;
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-1_0.c
new file mode 100644
index 000000000..bad180b0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-1_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-do link } */
+
+static inline void
+bar (unsigned *u)
+{
+ __asm__ ("":"=r" (*u));
+}
+
+void
+foo (void)
+{
+ int i;
+ bar (&i);
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_0.c
new file mode 100644
index 000000000..249d0e079
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do link } */
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_1.c
new file mode 100644
index 000000000..887057db7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_1.c
@@ -0,0 +1,5 @@
+int foo (void)
+{
+ static int i;
+ return ++i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_2.c
new file mode 100644
index 000000000..4a97fe806
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101009-2_2.c
@@ -0,0 +1,5 @@
+int bar (void)
+{
+ static int i;
+ return ++i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101125-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101125-1_0.c
new file mode 100644
index 000000000..662dd243d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101125-1_0.c
@@ -0,0 +1,24 @@
+/* { dg-lto-do link } */
+
+struct X {
+ int i;
+};
+
+struct W {
+ struct U *p;
+ struct X *q;
+};
+
+struct U {
+ struct W a[1];
+};
+
+void foo(struct U *ptr)
+{
+ ptr->a[0].p = 0;
+}
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101125-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101125-1_1.c
new file mode 100644
index 000000000..2924e3f26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20101125-1_1.c
@@ -0,0 +1,17 @@
+struct X {
+ char i;
+};
+
+struct W {
+ struct U *p;
+ struct X *q;
+};
+
+struct U {
+ struct W a[1];
+};
+
+void bar(struct U *ptr)
+{
+ ptr->a[0].p = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20110201-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20110201-1_0.c
new file mode 100644
index 000000000..a00664928
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20110201-1_0.c
@@ -0,0 +1,29 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -O0 -flto } } } */
+/* { dg-extra-ld-options "-O2 -ffast-math -fuse-linker-plugin" } */
+/* { dg-require-linker-plugin "" } */
+
+/* We require a linker plugin because otherwise we'd need to link
+ against libm which we are not sure here has cabs on all targets.
+ This is because collect2 invokes ld on the -O0 object code
+ which does not have folded cabs. */
+
+double cabs(_Complex double);
+double __attribute__((used))
+foo (_Complex double x, int b)
+{
+ if (b)
+ x = 0;
+ return cabs(x);
+}
+
+/* We provide a dummy sqrt to avoid link failures on targets that do not
+ expand sqrt inline. Note that we do not link against libm in order
+ to ensure cabs is not satisfied by the library, but must be folded. */
+double __attribute__((used))
+sqrt (double x)
+{
+ return x;
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_0.c
new file mode 100644
index 000000000..486264066
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -flto } } } */
+/* { dg-require-linker-plugin "" } */
+/* { dg-extra-ld-options "-fuse-linker-plugin" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_1.c
new file mode 100644
index 000000000..a616c194f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_1.c
@@ -0,0 +1,3 @@
+/* { dg-options "-fno-lto" } */
+
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_2.c
new file mode 100644
index 000000000..048f715b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_2.c
@@ -0,0 +1 @@
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_3.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_3.c
new file mode 100644
index 000000000..9beed5950
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-1_3.c
@@ -0,0 +1,6 @@
+extern int i;
+
+int main()
+{
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-2_0.c
new file mode 100644
index 000000000..6b7f30e13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111207-2_0.c
@@ -0,0 +1,18 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -g -O -flto } } } */
+
+int
+test (void)
+{
+ int f (void);
+ return 0;
+}
+
+int
+main (void)
+{
+ int f (void);
+ int test (void);
+
+ return test ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111213-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111213-1_0.c
new file mode 100644
index 000000000..e6f54748a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20111213-1_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto -g } } } */
+/* { dg-extra-ld-options {-r -nostdlib} } */
+
+void gfc_be_parse_file (void)
+{
+ typedef enum builtin_type builtin_type;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_0.c
new file mode 100644
index 000000000..78cfdf77c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_0.c
@@ -0,0 +1,54 @@
+/* Make sure that by reference and by value aggregate jump functions do not get
+ mixed up.
+ ??? This testcase is invalid C and can only pass on specific platforms. */
+/* { dg-lto-do run } */
+/* { dg-skip-if "" { { sparc*-*-* } && ilp32 } { "*" } { "" } } */
+/* { dg-lto-options { {-O3 -fno-early-inlining -flto}} } */
+
+extern void abort (void);
+
+struct S
+{
+ int i;
+ void (*f)(struct S *);
+ int j;
+};
+
+struct E
+{
+ struct S *p;
+};
+
+struct S *gs;
+int gr = 111;
+char gc[1024];
+
+static __attribute__ ((noinline, noclone)) struct S *
+get_s (void)
+{
+ return (struct S *) &gc;
+}
+
+static void wrong_target (struct S *s)
+{
+ abort ();
+}
+
+void bar (struct S *s)
+{
+ s->f (s);
+}
+
+extern void foo (struct S *s);
+
+int main (int argc, char **argv)
+{
+ struct S *s = get_s();
+ gs = s;
+ s->i = 5678;
+ s->f = wrong_target;
+ s->j = 1234;
+ foo (s);
+
+ return gr;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_1.c
new file mode 100644
index 000000000..5c50861b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/20120723_1.c
@@ -0,0 +1,39 @@
+/* Make sure that by reference and by value aggregate jump functions do not get
+ mixed up. */
+
+extern void abort (void);
+
+struct S
+{
+ int i;
+ void (*f)(struct S *);
+ int j;
+};
+
+struct E
+{
+ struct S *p;
+};
+
+extern struct S *gs;
+extern int gr;
+extern char gc[1024];
+
+static __attribute__ ((noinline, noclone)) struct S *
+get_s (void)
+{
+ return (struct S *) &gc;
+}
+
+static void good_target (struct S *s)
+{
+ gr = 0;
+}
+
+extern void bar (struct E e);
+
+void foo (struct E e)
+{
+ gs->f = good_target;
+ bar (e);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/README b/gcc-4.9/gcc/testsuite/gcc.dg/lto/README
new file mode 100644
index 000000000..1a13dd92c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/README
@@ -0,0 +1,35 @@
+This directory contains tests for link-time optimization (LTO).
+Tests in this directory may span multiple files, so the naming of
+the files is significant.
+
+The name of every file must end with '_N' where N is an integer.
+All the files with the same name base and different _N suffixes
+will be compiled separately and linked together to form the final
+executable.
+
+By default, each set of files will be compiled with list of
+options listed in LTO_OPTIONS (../../lib/lto.exp), which can be
+overwritten in the shell environment or using the 'dg-lto-options'
+command in the main file of the set (i.e., the file with _0
+suffix).
+
+For example, given the files a_0.C a_1.C a_2.C, they will be
+compiled as:
+
+$ g++ -c <flags> a_0.C
+$ g++ -c <flags> a_1.C
+$ g++ -c <flags> a_2.C
+$ g++ -o <executable> a_0.o a_1.o a_2.o
+
+Tests that do not need more than one file are a special case
+where there is a single file named 'foo_0.C'.
+
+The only supported dg-lto-do option are 'assemble', 'run' and 'link'.
+Additionally, these can only be used in the main file. If
+'assemble' is used, only the individual object files are
+generated. If 'link' is used, the final executable is generated
+but not executed (in this case, function main() needs to exist
+but it does not need to do anything). If 'run' is used, the
+final executable is generated and the resulting binary executed.
+
+The default value for dg-lto-do is 'run'.
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_0.c
new file mode 100644
index 000000000..1e02f68f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_0.c
@@ -0,0 +1,29 @@
+/* { dg-lto-do run } */
+int first = 0;
+void abort (void);
+int second = 0;
+void callmealias (void)
+{
+ if (!first || !second)
+ abort ();
+}
+void callmefirst (void)
+{
+ if (first)
+ abort();
+ first = 1;
+}
+void callmesecond (void)
+{
+ if (!first)
+ abort();
+ if (second)
+ abort();
+ second = 1;
+}
+main()
+{
+ c();
+ b();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_1.c
new file mode 100644
index 000000000..67e6e1c1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_1.c
@@ -0,0 +1,7 @@
+extern void callmesecond();
+static void callmealias() __attribute__((weakref ("callmesecond")));
+
+b()
+{
+ callmealias();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_2.c
new file mode 100644
index 000000000..6f382f61e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/attr-weakref-1_2.c
@@ -0,0 +1,7 @@
+extern void callmefirst();
+static void callmealias() __attribute__((weakref ("callmefirst")));
+
+c()
+{
+ callmealias();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/const-uniq_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/const-uniq_0.c
new file mode 100644
index 000000000..1bbc7f45f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/const-uniq_0.c
@@ -0,0 +1,16 @@
+/* The 3 constant initializers should be uniquized. */
+
+/* { dg-lto-do run } */
+/* { dg-lto-options {{-Os -flto -flto-partition=none} {-Os -flto -flto-partition=1to1} } } */
+
+int lookup1 (int i)
+{
+ int a[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+ return a[i];
+}
+
+int lookup2 (int i)
+{
+ int a[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+ return a[i+1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/const-uniq_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/const-uniq_1.c
new file mode 100644
index 000000000..ee1505cc9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/const-uniq_1.c
@@ -0,0 +1,23 @@
+extern int lookup1 (int i);
+extern int lookup2 (int i);
+extern void abort (void);
+
+int lookup3 (int i)
+{
+ int a[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+ return a[i+2];
+}
+
+int main (void)
+{
+ if (lookup1(2) != 2)
+ abort ();
+
+ if (lookup2(2) != 3)
+ abort ();
+
+ if (lookup3(2) != 4)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipacp_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipacp_0.c
new file mode 100644
index 000000000..097c1c253
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipacp_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 -fipa-cp -fipa-cp-clone}} } */
+/* { dg-lto-do run } */
+
+/* Test that clonning happens and we unify declarations of a from both units. */
+const int a = 5;
+extern void clone_me (int *);
+
+int
+main(void)
+{
+ int i;
+ for (i=0;i<100;i++)
+ clone_me ((int *)&a);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipacp_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipacp_1.c
new file mode 100644
index 000000000..69c1ec6e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipacp_1.c
@@ -0,0 +1,12 @@
+void abort (void);
+extern int a;
+
+__attribute__ ((noinline))
+void
+clone_me (int *ptr)
+{
+ if (ptr != &a)
+ abort ();
+ if (!__builtin_constant_p (ptr != &a))
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference2_0.c
new file mode 100644
index 000000000..f7ae0b4e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference2_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 -fwhole-program}} } */
+/* { dg-lto-do run } */
+
+/* Verify that ipa-reference marks A as constant and we fold references
+ to a[1] and a[2] to &c and that we promote C to hidden vars shared across ltrans units. */
+void abort (void);
+int b,c,d,e,f;
+int *a[5]={&b,&c,&c,&e};
+void other_ltrans (void);
+main()
+{
+ other_ltrans ();
+ if (*(a[1])!=11)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference2_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference2_1.c
new file mode 100644
index 000000000..c7653b080
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference2_1.c
@@ -0,0 +1,13 @@
+void abort (void);
+extern int *a[5];
+extern int b,c,d,e,f;
+__attribute__ ((noinline, noclone))
+void
+other_ltrans (void)
+{
+ if (!__builtin_constant_p (a[1]==a[2]))
+ abort ();
+ if (a[1]!=a[2])
+ abort ();
+ *(a[1])=11;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference_0.c
new file mode 100644
index 000000000..f8970f0e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference_0.c
@@ -0,0 +1,26 @@
+/* { dg-lto-options {{ -O1 -flto -flto-partition=1to1 }} } */
+/* { dg-lto-do run } */
+
+/* Test that ipa-reference notice that get_val will not change since do_nothing does not
+ modify anything. This needs streaming cross file boundary summaries. */
+extern int get_val (void);
+extern int set_val (void);
+extern do_nothing (void);
+void abort (void);
+main()
+{
+ int a;
+ int b;
+ set_val ();
+ a = get_val ();
+ do_nothing();
+ b = get_val ();
+ if (a==b)
+ {
+ if (!__builtin_constant_p (a==b))
+ abort ();
+ return 0;
+ }
+ else
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference_1.c
new file mode 100644
index 000000000..c5d72faaf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/ipareference_1.c
@@ -0,0 +1,14 @@
+static int val;
+int set_val (void)
+{
+ val = 5;
+}
+int get_val (void)
+{
+ return val;
+}
+__attribute__ ((__noinline__))
+do_nothing ()
+{
+ asm volatile ("":::"memory");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/lto.exp b/gcc-4.9/gcc/testsuite/gcc.dg/lto/lto.exp
new file mode 100644
index 000000000..25862978b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/lto.exp
@@ -0,0 +1,59 @@
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Contributed by Diego Novillo <dnovillo@google.com>
+
+
+# Test link-time optimization across multiple files.
+#
+# Programs are broken into multiple files. Each one is compiled
+# separately with LTO information. The final executable is generated
+# by collecting all the generated object files using regular LTO or WHOPR.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib gcc.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib lto.exp
+
+# If LTO has not been enabled, bail.
+if { ![check_effective_target_lto] } {
+ return
+}
+
+gcc_init
+lto_init no-mathlib
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other lto tests running at the same time.
+set sid "c_lto"
+
+# Main loop.
+foreach src [lsort [find $srcdir/$subdir *_0.c]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+
+ lto-execute $src $sid
+}
+
+lto_finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/materialize-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/materialize-1_0.c
new file mode 100644
index 000000000..1751d65d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/materialize-1_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-options {{ -O3 -flto -flto-partition=1to1}} } */
+/* { dg-lto-do run } */
+extern void clone_me (int, int);
+int a=15;
+inline int inline_me ()
+{
+ clone_me (0,a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/materialize-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/materialize-1_1.c
new file mode 100644
index 000000000..ca080579f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/materialize-1_1.c
@@ -0,0 +1,22 @@
+int inline_me (void);
+extern int a;
+void abort (void);
+
+__attribute__ ((noinline))
+void
+clone_me (int c, int d)
+{
+ if (!c)
+ {
+ if (d!=a)
+ abort ();
+ }
+}
+int
+main(void)
+{
+ int i;
+ for (i=0;i<a;i++)
+ inline_me ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/noreturn-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/noreturn-1_0.c
new file mode 100644
index 000000000..7f493cd9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/noreturn-1_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options {{-O2 -flto -flto-partition=1to1} } } */
+
+void exit (int);
+__attribute__ ((noreturn))
+int
+call_me (void)
+{
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/noreturn-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/noreturn-1_1.c
new file mode 100644
index 000000000..cc2bcf8dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/noreturn-1_1.c
@@ -0,0 +1,6 @@
+int call_me (void);
+int
+main(void)
+{
+ return call_me ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr27898_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr27898_0.c
new file mode 100644
index 000000000..c7e23f35e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr27898_0.c
@@ -0,0 +1,8 @@
+/* PR c/27898 */
+/* { dg-lto-do link } */
+
+union u { struct { int i; }; };
+
+extern int foo (union u *);
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr27898_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr27898_1.c
new file mode 100644
index 000000000..110e0d9df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr27898_1.c
@@ -0,0 +1,3 @@
+union u { struct { int i; }; };
+
+extern int foo (union u *);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28706_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28706_0.c
new file mode 100644
index 000000000..aaa8940eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28706_0.c
@@ -0,0 +1,12 @@
+/* PR c/28706 */
+/* { dg-lto-do link } */
+
+struct A
+{
+ int i;
+} __attribute__((aligned (sizeof (long int))));
+
+extern void foo (struct A *);
+extern void foo (struct A *);
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28706_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28706_1.c
new file mode 100644
index 000000000..4550b6374
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28706_1.c
@@ -0,0 +1,9 @@
+/* PR c/28706 */
+
+struct A
+{
+ int i;
+} __attribute__((aligned (sizeof (long int))));
+
+extern void foo (struct A *);
+extern void foo (struct A *);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_0.c
new file mode 100644
index 000000000..dff029cad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_0.c
@@ -0,0 +1,16 @@
+/* PR c/28712 */
+/* { dg-lto-do link } */
+
+struct A;
+
+extern struct A *a;
+
+struct A { } __attribute__((packed));
+
+struct B __attribute__((aligned (sizeof (int))));
+
+extern struct B *b;
+
+struct B { int i; } __attribute__((packed));
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_1.c
new file mode 100644
index 000000000..8a322457f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_1.c
@@ -0,0 +1,12 @@
+/* PR c/28712 */
+struct A;
+
+extern struct A *a;
+
+struct A { } __attribute__((packed));
+
+struct B __attribute__((aligned (sizeof (int))));
+
+extern struct B *b;
+
+struct B { int i; } __attribute__((packed));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_2.c
new file mode 100644
index 000000000..1937e88b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr28712_2.c
@@ -0,0 +1,13 @@
+/* PR c/28712 */
+
+struct A;
+
+extern struct A *a;
+
+struct A { } __attribute__((packed));
+
+struct B __attribute__((aligned (sizeof (int))));
+
+extern struct B *b;
+
+struct B { int i; } __attribute__((packed));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr34989-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr34989-1_0.c
new file mode 100644
index 000000000..245486b6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr34989-1_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-do link } */
+
+extern struct globals *const ptr_to_globals;
+struct globals { };
+int syslogd_main(int argc, char **argv)
+{
+ (*(struct globals**)&ptr_to_globals) = 0;
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr34989-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr34989-1_1.c
new file mode 100644
index 000000000..59604b6e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr34989-1_1.c
@@ -0,0 +1 @@
+struct globals *const ptr_to_globals;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45721_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45721_0.c
new file mode 100644
index 000000000..8c5c05204
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45721_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do assemble } */
+void baz(void) {}
+void *y = (void *)baz;
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45721_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45721_1.c
new file mode 100644
index 000000000..05d854f9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45721_1.c
@@ -0,0 +1,2 @@
+static void bar(void) __attribute__ ((weakref("baz")));
+void *x = (void *)bar;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45736_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45736_0.c
new file mode 100644
index 000000000..860e239b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr45736_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -r -nostdlib -O}} } */
+
+extern void baz (void);
+
+static void __attribute__ ((constructor))
+bar (void)
+{
+ baz ();
+}
+
+void
+foo (void)
+{
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr46940_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr46940_0.c
new file mode 100644
index 000000000..89cb828fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr46940_0.c
@@ -0,0 +1,15 @@
+/* { dg-require-linker-plugin "" } */
+/* { dg-extra-ld-options "-fuse-linker-plugin" } */
+#include <stdio.h>
+
+#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x) #x
+
+extern __attribute__((visibility("hidden"))) void _moz_foo (void);
+extern __typeof (_moz_foo) _moz_foo __asm__ (ASMNAME ("INT__foo")) __attribute__((__visibility__("hidden"))) ;
+void _moz_foo(void)
+{
+ printf ("blah\n");
+}
+extern __typeof (_moz_foo) EXT__foo __asm__(ASMNAME ("_moz_foo")) __attribute__((__alias__("" "INT__foo")));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr46940_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr46940_1.c
new file mode 100644
index 000000000..924a09b7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr46940_1.c
@@ -0,0 +1,7 @@
+extern void _moz_foo (void);
+int
+main()
+{
+ _moz_foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47188_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47188_0.c
new file mode 100644
index 000000000..ac9e03167
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47188_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do assemble } */
+/* { dg-require-linker-plugin "" } */
+/* { dg-extra-ld-options "-fuse-linker-plugin -fwhole-program" } */
+int foo(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47188_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47188_1.c
new file mode 100644
index 000000000..f18f4db38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47188_1.c
@@ -0,0 +1,8 @@
+/* { dg-options "-fno-lto" } */
+
+extern int foo(void);
+
+int main(void)
+{
+ return foo();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47259_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47259_0.c
new file mode 100644
index 000000000..7900e5a8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47259_0.c
@@ -0,0 +1,12 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { x86_64-*-* } } { "*" } { "" } } */
+/* { dg-lto-options { { -O2 -flto -w } } } */
+
+register int r asm("esi");
+
+void foo(void)
+{
+ if (r)
+ __asm__("sar\t%0" : "+r" (r));
+ __asm__("sar\t%0" : "+r" (r));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47259_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47259_1.c
new file mode 100644
index 000000000..03bf89475
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47259_1.c
@@ -0,0 +1,9 @@
+/* { dg-options "-fno-lto" } */
+
+extern void foo(void);
+
+int main(void)
+{
+ foo();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47924_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47924_0.c
new file mode 100644
index 000000000..f7fdb44b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr47924_0.c
@@ -0,0 +1,19 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O2 -flto}} } */
+
+extern void link_error (void);
+short *p __attribute__((used));
+int i __attribute__((used));
+
+int main()
+{
+ if (i == 0)
+ return;
+
+ *p = 0;
+
+ if (i == 0)
+ link_error ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr48622_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr48622_0.c
new file mode 100644
index 000000000..ffb5f62d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr48622_0.c
@@ -0,0 +1,93 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O -flto -finline-small-functions -fno-early-inlining}} } */
+
+void abort(void);
+void exit(int);
+
+typedef unsigned int u8 __attribute__ ((mode (QI)));
+
+u8
+ashift_qi_0 (u8 n)
+{
+}
+
+u8
+ashift_qi_2 (u8 n)
+{
+}
+
+u8
+ashift_qi_3 (u8 n)
+{
+}
+
+u8
+ashift_qi_4 (u8 n)
+{
+}
+
+u8
+ashift_qi_5 (u8 n)
+{
+}
+
+u8
+ashift_qi_6 (u8 n)
+{
+}
+
+u8
+ashift_qi_7 (u8 n)
+{
+}
+
+u8
+lshiftrt_qi_0 (u8 n)
+{
+}
+
+u8
+lshiftrt_qi_4 (u8 n)
+{
+}
+
+u8
+lshiftrt_qi_5 (u8 n)
+{
+}
+
+u8
+lshiftrt_qi_7 (u8 n)
+{
+}
+
+int
+main ()
+{
+ if (ashift_qi_0 (0xff) != (u8) ((u8) 0xff << 0))
+ abort ();
+ if (ashift_qi_1 (0xff) != (u8) ((u8) 0xff << 1))
+ abort ();
+ if (ashift_qi_2 (0xff) != (u8) ((u8) 0xff << 2))
+ abort ();
+ if (ashift_qi_3 (0xff) != (u8) ((u8) 0xff << 3))
+ abort ();
+ if (ashift_qi_4 (0xff) != (u8) ((u8) 0xff << 4))
+ abort ();
+ if (ashift_qi_5 (0xff) != (u8) ((u8) 0xff << 5))
+ abort ();
+ if (ashift_qi_6 (0xff) != (u8) ((u8) 0xff << 6))
+ abort ();
+ if (ashift_qi_7 (0xff) != (u8) ((u8) 0xff << 7))
+ abort ();
+ if (lshiftrt_qi_0 (0xff) != (u8) ((u8) 0xff >> 0))
+ abort ();
+ if (lshiftrt_qi_4 (0xff) != (u8) ((u8) 0xff >> 4))
+ abort ();
+ if (lshiftrt_qi_5 (0xff) != (u8) ((u8) 0xff >> 5))
+ abort ();
+ if (lshiftrt_qi_7 (0xff) != (u8) ((u8) 0xff >> 7))
+ abort ();
+ exit (0);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr51572-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr51572-1_0.c
new file mode 100644
index 000000000..dfe529783
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr51572-1_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto -g } } } */
+
+typedef int T;
+void fn (void)
+{
+ static T t;
+}
+int main() {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52097_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52097_0.c
new file mode 100644
index 000000000..cd4af5d1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52097_0.c
@@ -0,0 +1,20 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O -flto -fexceptions -fnon-call-exceptions --param allow-store-data-races=0 } } } */
+
+typedef struct { unsigned int e0 : 16; } s1;
+typedef struct { unsigned int e0 : 16; } s2;
+typedef struct { s1 i1; s2 i2; } io;
+
+static io *i;
+
+void f1 (void)
+{
+ s1 x0;
+ i->i1 = x0;
+}
+
+int main ()
+{
+ f1 ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52634_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52634_0.c
new file mode 100644
index 000000000..a858cc1a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52634_0.c
@@ -0,0 +1,7 @@
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -r -nostdlib -flto-partition=1to1}} */
+extern int cfliteValueCallBacks;
+void baz (int *);
+int main () { baz(&cfliteValueCallBacks); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52634_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52634_1.c
new file mode 100644
index 000000000..af4c43980
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr52634_1.c
@@ -0,0 +1,6 @@
+int cfliteKeyCallBacks = 5;
+extern int cfliteValueCallBacks __attribute__((alias("cfliteKeyCallBacks")));
+void baz(void *ptr)
+{
+ asm volatile (""::"r"(ptr));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr53214_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr53214_0.c
new file mode 100644
index 000000000..e76d4dac4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr53214_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do run } */
+
+double a(double) __attribute__ ((optimize(1), used));
+double a(double r)
+{
+ return r;
+}
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr53470_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr53470_0.c
new file mode 100644
index 000000000..3c799f60c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr53470_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto } { -flto -g } } } */
+
+int main ()
+{
+ {
+ union A { } v;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54702_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54702_0.c
new file mode 100644
index 000000000..2242f50b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54702_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O2 -flto -w } } } */
+/* { dg-extra-ld-options { -r -nostdlib } } */
+
+#include <stdlib.h>
+void* f ()
+{
+ void* p = malloc (1);
+ return p;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54702_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54702_1.c
new file mode 100644
index 000000000..2afb0fbc0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54702_1.c
@@ -0,0 +1,16 @@
+int *b;
+void *d;
+int c;
+static int *f1 ();
+void f2 ()
+{
+ int *a = f1 (0);
+}
+
+int *f1 (j)
+{
+ b = malloc (0);
+ d = *malloc;
+ c = j;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54709_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54709_0.c
new file mode 100644
index 000000000..f3db5dcbb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54709_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-do link } */
+/* { dg-require-visibility "hidden" } */
+/* { dg-require-effective-target fpic } */
+/* { dg-extra-ld-options { -shared } } */
+/* { dg-lto-options { { -fPIC -fvisibility=hidden -flto } } } */
+
+void foo (void *p, void *q, unsigned s)
+{
+ __builtin_memcpy (p, q, s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54709_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54709_1.c
new file mode 100644
index 000000000..59c137d6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr54709_1.c
@@ -0,0 +1,5 @@
+void * memcpy (void *, void *, long);
+void bar (void *p, void *q, unsigned s)
+{
+ memcpy (p, q, s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55113_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55113_0.c
new file mode 100644
index 000000000..8ef11dc47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55113_0.c
@@ -0,0 +1,13 @@
+/* PR 55113 */
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto -fshort-double -O0 } } }*/
+/* { dg-skip-if "PR60410" { { x86_64-*-* i?86-*-* } && lp64 } } */
+
+int
+main(void)
+{
+ float a = 1.0;
+ float b = 2.0;
+ double f = a + b * 1e-12;
+ return (int)f - 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55525_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55525_0.c
new file mode 100644
index 000000000..7faaf806a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55525_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto -w } } } */
+
+char s[sizeof (char *)];
+int main(void)
+{
+ return strcmp(&s[1], "foo");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55525_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55525_1.c
new file mode 100644
index 000000000..3c3381780
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55525_1.c
@@ -0,0 +1 @@
+char *s = (char *) 0;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55660_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55660_0.c
new file mode 100644
index 000000000..7e7bb2fff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55660_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do run } */
+/* { dg-extra-ld-options { -funsigned-char } } */
+
+char n[3] = {'a','b','c'};
+int foo(char *x)
+{
+ if (*x == 'b')
+ return (int)*x;
+ *x = 'y';
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55660_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55660_1.c
new file mode 100644
index 000000000..a8c368bb9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55660_1.c
@@ -0,0 +1,15 @@
+extern int foo (char*);
+extern void abort (void);
+
+extern char n[3];
+
+int main ()
+{
+ int i, m = 0;
+ for (i = 0; i < 3; i++)
+ m += foo(&n[i]);
+
+ if (m != 'b')
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55703_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55703_0.c
new file mode 100644
index 000000000..1c4e04b3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr55703_0.c
@@ -0,0 +1,59 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -O2 -flto -fno-tree-copy-prop -fno-tree-dce } } } */
+
+int try (int num) {
+ __label__ lab1, lab2, lab3, lab4, lab5, lab6, default_lab;
+
+ void *do_switch (int num) {
+ switch(num) {
+ case 1:
+ return &&lab1;
+ case 2:
+ return &&lab2;
+ case 3:
+ return &&lab3;
+ case 4:
+ return &&lab4;
+ case 5:
+ return &&lab5;
+ case 6:
+ return &&lab6;
+ default:
+ return &&default_lab;
+ }
+ }
+
+ goto *do_switch (num);
+
+ lab1:
+ return 1;
+
+ lab2:
+ return 2;
+
+ lab3:
+ return 3;
+
+ lab4:
+ return 4;
+
+ lab5:
+ return 5;
+
+ lab6:
+ return 6;
+
+ default_lab:
+ return -1;
+}
+
+main()
+{
+ int i;
+ for (i = 1; i <= 6; i++)
+ {
+ if (try (i) != i)
+ __builtin_abort();
+ }
+ __builtin_exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56168_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56168_0.c
new file mode 100644
index 000000000..13f768e7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56168_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -flto -O -ffast-math -fno-builtin } } } */
+
+extern double pow(double, double);
+extern void abort (void);
+volatile double x = 1.0;
+int main(int argc, char **argv)
+{
+ double d1 = x;
+ double d2 = pow(d1, 1.0 / 3.0);
+ double d3 = d1 * d1;
+ if (d3 != 1.0 || d2 != 0.0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56168_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56168_1.c
new file mode 100644
index 000000000..560d0bda8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56168_1.c
@@ -0,0 +1,4 @@
+/* { dg-options "-fno-lto" } */
+
+double __attribute__((noinline,noclone))
+pow (double x, double y) { return 0.0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56297_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56297_0.c
new file mode 100644
index 000000000..5ed19da15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56297_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto -fno-common } } } */
+
+#if __x86_64__ || __i386__
+register int i asm("esp");
+#else
+extern int i;
+#endif
+
+int main(void)
+{
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56297_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56297_1.c
new file mode 100644
index 000000000..17e9c8c45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr56297_1.c
@@ -0,0 +1,5 @@
+#if __x86_64__ || __i386__
+register int i asm("esp");
+#else
+int i;
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr59323-2_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr59323-2_0.c
new file mode 100644
index 000000000..938a89d6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr59323-2_0.c
@@ -0,0 +1,37 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O2 -g -flto } } } */
+/* { dg-extra-ld-options { -r -nostdlib } } */
+
+extern void bar(void);
+
+int main(int argc, char **argv)
+{
+ int i;
+
+ if (argc == 1) {
+ extern void bar ();
+
+ bar();
+
+ {
+ extern void bar ();
+
+ asm goto ("" : : : : lab);
+lab:
+ ;
+ }
+ }
+
+ {
+ extern void bar ();
+
+ int foo(void)
+ {
+ return argv[0][0];
+ }
+
+ i = foo();
+ }
+
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr59323_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr59323_0.c
new file mode 100644
index 000000000..b59105891
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr59323_0.c
@@ -0,0 +1,37 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O2 -g -flto } } } */
+/* { dg-extra-ld-options { -r -nostdlib } } */
+
+extern void bar(void);
+
+int main(int argc, char **argv)
+{
+ int i;
+
+ if (argc == 1) {
+ enum { X };
+
+ bar();
+
+ {
+ enum { X };
+
+ asm goto ("" : : : : lab);
+lab:
+ ;
+ }
+ }
+
+ {
+ enum { X };
+
+ int foo(void)
+ {
+ return argv[0][0];
+ }
+
+ i = foo();
+ }
+
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_0.c
new file mode 100644
index 000000000..a22216db2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -O1 -flto } } } */
+/* { dg-extra-ld-options { -O0 } } */
+
+extern void fn2 (int);
+int a[1], b;
+
+int
+main ()
+{
+ fn2 (0);
+ if (b != 0 || a[b] != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_1.c
new file mode 100644
index 000000000..8c1259803
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_1.c
@@ -0,0 +1,4 @@
+void
+fn1 (int p)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_2.c
new file mode 100644
index 000000000..e1db02409
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60404_2.c
@@ -0,0 +1,9 @@
+extern int b;
+extern void fn1 (int);
+
+void
+fn2 (int p)
+{
+ b = p++;
+ fn1 (p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60461_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60461_0.c
new file mode 100644
index 000000000..cad6a8de8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60461_0.c
@@ -0,0 +1,37 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-Os -flto} } } */
+
+
+struct S
+{
+ int f1;
+ int f2;
+} a[1] = { {0, 0} };
+
+int b, c;
+
+static unsigned short fn1 (struct S);
+
+void
+fn2 ()
+{
+ for (; c;)
+ ;
+ b = 0;
+ fn1 (a[0]);
+}
+
+unsigned short
+fn1 (struct S p)
+{
+ if (p.f1)
+ fn2 ();
+ return 0;
+}
+
+int
+main ()
+{
+ fn2 ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/resolutions_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/resolutions_0.c
new file mode 100644
index 000000000..9e59cb069
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/resolutions_0.c
@@ -0,0 +1,10 @@
+/* { dg-require-linker-plugin "" } */
+/* { dg-extra-ld-options "-fuse-linker-plugin -O1" } */
+
+link_error()
+{
+}
+main()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/save-temps_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/save-temps_0.c
new file mode 100644
index 000000000..8af161958
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/save-temps_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-options {{ -O -flto -save-temps}} } */
+/* { dg-lto-do link } */
+
+int
+main (void)
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c
new file mode 100644
index 000000000..f622823dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem-3_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-options {{-flto}} } */
+/* { dg-lto-do link } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target fgnu_tm } */
+
+/* Test that we can build one object file with -fgnu-tm
+ (trans-mem-3_1.c), but do the final link of all objects without
+ -fgnu-tm. */
+
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c
new file mode 100644
index 000000000..4b7f7d751
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem-3_1.c
@@ -0,0 +1,10 @@
+/* { dg-options "-fgnu-tm" } */
+
+#include "trans-mem.h"
+
+extern int i;
+
+main()
+{
+ __transaction_atomic { i = 0; }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem.h b/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem.h
new file mode 100644
index 000000000..add5a297b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/trans-mem.h
@@ -0,0 +1,22 @@
+#include <stdint.h>
+
+/* Dummy declarations for common TM supporting functions. */
+
+/* These must be in sync with both libitm/libitm.h and the TM builtin
+ definitions in gcc/gtm-builtins.def. */
+
+#define noinline __attribute__((noinline,noclone,used))
+
+#ifdef __i386__
+/* Only for 32-bit x86. */
+# define ITM_REGPARM __attribute__((regparm(2)))
+#else
+# define ITM_REGPARM
+#endif
+
+ITM_REGPARM noinline uint32_t _ITM_beginTransaction(uint32_t a, ...) { asm(""); }
+ITM_REGPARM noinline void _ITM_commitTransaction (void) { asm(""); }
+ITM_REGPARM noinline void _ITM_WU4 (void *a, uint32_t b) { asm(""); }
+ITM_REGPARM noinline void _ITM_WU8 (void *a, uint64_t b) { asm(""); }
+noinline void _ITM_registerTMCloneTable (void) { asm(""); }
+noinline void _ITM_deregisterTMCloneTable (void) { asm(""); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-2.c
new file mode 100644
index 000000000..7f9372f30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-2.c
@@ -0,0 +1,48 @@
+/* Test diagnostic messages for invalid lvalues and non-modifiable
+ lvalues. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int a, b;
+
+void
+f0 (void)
+{
+ (a+b) = 1; /* { dg-error "lvalue required as left operand of assignment" } */
+ (a+b)++; /* { dg-error "lvalue required as increment operand" } */
+ ++(a+b); /* { dg-error "lvalue required as increment operand" } */
+ (a+b)--; /* { dg-error "lvalue required as decrement operand" } */
+ --(a+b); /* { dg-error "lvalue required as decrement operand" } */
+ &(a+b); /* { dg-error "lvalue required as unary '&' operand" } */
+}
+
+const int c;
+const struct { int x; } d;
+struct { const int x; } e;
+const int *f;
+
+void
+f1 (void)
+{
+ c = 1; /* { dg-error "assignment of read-only variable 'c'" } */
+ d.x = 1; /* { dg-error "assignment of member 'x' in read-only object" } */
+ e.x = 1; /* { dg-error "assignment of read-only member 'x'" } */
+ *f = 1; /* { dg-error "assignment of read-only location" } */
+ c++; /* { dg-error "increment of read-only variable 'c'" } */
+ d.x++; /* { dg-error "increment of member 'x' in read-only object" } */
+ e.x++; /* { dg-error "increment of read-only member 'x'" } */
+ (*f)++; /* { dg-error "increment of read-only location" } */
+ ++c; /* { dg-error "increment of read-only variable 'c'" } */
+ ++d.x; /* { dg-error "increment of member 'x' in read-only object" } */
+ ++e.x; /* { dg-error "increment of read-only member 'x'" } */
+ ++(*f); /* { dg-error "increment of read-only location" } */
+ c--; /* { dg-error "decrement of read-only variable 'c'" } */
+ d.x--; /* { dg-error "decrement of member 'x' in read-only object" } */
+ e.x--; /* { dg-error "decrement of read-only member 'x'" } */
+ (*f)--; /* { dg-error "decrement of read-only location" } */
+ --c; /* { dg-error "decrement of read-only variable 'c'" } */
+ --d.x; /* { dg-error "decrement of member 'x' in read-only object" } */
+ --e.x; /* { dg-error "decrement of read-only member 'x'" } */
+ --(*f); /* { dg-error "decrement of read-only location" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-3.c
new file mode 100644
index 000000000..6a500d4d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-3.c
@@ -0,0 +1,14 @@
+/* Test that assignment of a read-only variable that gets const-ness
+ from a read-only field is diagnosed. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s { const int a; } x;
+typeof (x.a) b;
+void
+f (void)
+{
+ x.a = 1; /* { dg-error "assignment of read-only member 'a'" } */
+ b = 1; /* { dg-error "assignment of read-only variable 'b'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-4.c
new file mode 100644
index 000000000..bc9290134
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-4.c
@@ -0,0 +1,8 @@
+/* PR c/27721 */
+/* { dg-do compile } */
+
+void foo()
+{
+ int i();
+ i += 0; /* { dg-error "lvalue required" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-5.c
new file mode 100644
index 000000000..514f35ed8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-5.c
@@ -0,0 +1,14 @@
+/* Test assignment to elements of a string literal is a warning, not
+ an error. PR 27676. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+void
+f (void)
+{
+ "foo"[0] = 0; /* { dg-warning "assignment of read-only location" } */
+ "foo"[0]++; /* { dg-warning "increment of read-only location" } */
+ "foo"[0]--; /* { dg-warning "decrement of read-only location" } */
+ ++"foo"[0]; /* { dg-warning "increment of read-only location" } */
+ --"foo"[0]; /* { dg-warning "decrement of read-only location" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-6.c
new file mode 100644
index 000000000..af69de4df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-6.c
@@ -0,0 +1,17 @@
+/* Test constraints on unary '&': PR 22367. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+
+extern void v;
+void f1 (void) { &v; } /* { dg-error "taking address of expression of type 'void'" } */
+
+extern void *pv;
+void f2 (void) { &*pv; } /* { dg-warning "dereferencing" } */
+/* { dg-error "taking address of expression of type 'void'" "C90 only error" { target *-*-* } 10 } */
+
+extern const void cv;
+void f3 (void) { &cv; }
+
+extern const void *pcv;
+void f4 (void) { &*pcv; } /* { dg-warning "dereferencing" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-7.c
new file mode 100644
index 000000000..37964e1cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue-7.c
@@ -0,0 +1,16 @@
+/* Test constraints on unary '&': PR 22367. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+extern void v;
+void f1 (void) { &v; } /* { dg-error "taking address of expression of type 'void'" } */
+
+extern void *pv;
+void f2 (void) { &*pv; } /* { dg-warning "dereferencing" } */
+
+extern const void cv;
+void f3 (void) { &cv; }
+
+extern const void *pcv;
+void f4 (void) { &*pcv; } /* { dg-warning "dereferencing" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lvalue1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue1.c
new file mode 100644
index 000000000..67b013078
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/lvalue1.c
@@ -0,0 +1,9 @@
+/* PR c/5225 */
+/* { dg-do compile } */
+
+int main()
+{
+ int i;
+ +i = 1; /* { dg-error "lvalue required as left operand of assignment" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/m-un-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/m-un-1.c
new file mode 100644
index 000000000..ad84d44ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/m-un-1.c
@@ -0,0 +1,37 @@
+/* m-un-1.c: "un" for "uninitialized" */
+
+/*
+From: Jim Wilson <wilson@cygnus.com>
+Date: Wed, 6 Jul 1994 13:11:47 -0700
+To: dje@cygnus.com
+Subject: Re: devo/gcc ChangeLog.fsf stmt.c
+Cc: cvs-gcc@cygnus.com, tege@cygnus.com
+
+ How about a test case? :-)
+
+Compile with -O -Wall and the broken compiler gives you:
+tmp.c:6: warning: `k' might be used uninitialized in this function
+The fixed compiler (and gcc 2.5.8) gives no warning.
+
+This happens to fix a performance regression in the code generated for
+while loops, but that is presumably much much harder to test for.
+*/
+
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+int
+sub ()
+{
+ int i = 0;
+ int j = 0;
+ int k; /* { dg-bogus "`k' might be used uninitialized" "uninitialized warning regression" } */
+
+ while (i == 0 && j == 0)
+ {
+ k = 10;
+ i = sub ();
+ }
+
+ return k;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/m-un-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/m-un-2.c
new file mode 100644
index 000000000..0b9662835
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/m-un-2.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-W -Wall" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void* malloc (size_t);
+extern void free (void*);
+extern void* realloc (void*, size_t);
+
+struct vtable {
+ void* (* _malloc) (size_t);
+ void (* _free) (void*);
+ void* (* _realloc) (void*, size_t);
+};
+
+struct vtable mtable = {
+ malloc,
+ free
+}; /* { dg-warning "missing initializer" "warning regression" { target *-*-* } {18} } */
+ /* { dg-message "declared here" "warning regression 2" { target *-*-* } {12} } */
+
+/* With designated initializers, we assume you meant to leave out the
+ initialization of any blank fields. */
+struct vtable mtable2 = {
+ ._malloc = malloc,
+ ._realloc = realloc
+};
+
+struct vtable mtable3 = {
+ ._free = free,
+ ._malloc = malloc,
+ ._realloc = realloc
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/macro-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/macro-1.c
new file mode 100644
index 000000000..e1d9d34cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/macro-1.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+
+short array[3] __attribute__ ((aligned (__BIGGEST_ALIGNMENT__)));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/macro-fusion-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/macro-fusion-1.c
new file mode 100644
index 000000000..b2d11423a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/macro-fusion-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -mtune=corei7 -fdump-rtl-sched2" } */
+
+int a[100];
+
+double bar (double sum)
+{
+ int i;
+ for (i = 0; i < 1000000; i++)
+ sum += (0.5 + (a[i%100] - 128));
+ return sum;
+}
+
+/* { dg-final { scan-rtl-dump-not "compare.*insn.*jump_insn.*jump_insn" "sched2" } } */
+/* { dg-final { cleanup-rtl-dump "sched2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/macro-fusion-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/macro-fusion-2.c
new file mode 100644
index 000000000..ad7489a73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/macro-fusion-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -mtune=corei7-avx -fdump-rtl-sched2" } */
+
+int a[100];
+
+double bar (double sum)
+{
+ int i = 100000;
+ while (i != 0)
+ {
+ sum += (0.5 + (a[i%100] - 128));
+ i--;
+ }
+ return sum;
+}
+
+/* { dg-final { scan-rtl-dump-not "compare.*insn.*jump_insn.*jump_insn" "sched2" } } */
+/* { dg-final { cleanup-rtl-dump "sched2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/mallign.c b/gcc-4.9/gcc/testsuite/gcc.dg/mallign.c
new file mode 100644
index 000000000..349cdaa34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/mallign.c
@@ -0,0 +1,15 @@
+/* Check that malloc's alignment honors what we trust it
+ minimally should. */
+
+/* { dg-do run } */
+/* { dg-options "-fno-builtin-malloc" } */
+
+#include <stdlib.h>
+typedef int word __attribute__((mode(word)));
+
+int main()
+{
+ if ((__UINTPTR_TYPE__)malloc (1) & (sizeof(word)-1))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/march-generic.c b/gcc-4.9/gcc/testsuite/gcc.dg/march-generic.c
new file mode 100644
index 000000000..7705a4163
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/march-generic.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target i?86-*-* } } */
+/* { dg-skip-if "" { *-*-* } { "-march=*" } { "" } } */
+/* { dg-options "-march=generic" } */
+/* { dg-error "generic CPU can be used only for -mtune" "" { target *-*-* } 0 } */
+/* { dg-bogus "march" "" { target *-*-* } 0 } */
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/march.c b/gcc-4.9/gcc/testsuite/gcc.dg/march.c
new file mode 100644
index 000000000..43478bc8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/march.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-march=*" } { "" } } */
+/* { dg-options "-march=foo" } */
+/* { dg-error "march" "" { target *-*-* } 0 } */
+/* { dg-bogus "mtune" "" { target *-*-* } 0 } */
+/* { dg-prune-output "note: valid arguments" } */
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/max-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/max-1.c
new file mode 100644
index 000000000..9823dca59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/max-1.c
@@ -0,0 +1,42 @@
+/* PR middle-end/18548 */
+/* Test case reduced by Andrew Pinski <pinskia@physics.uc.edu> */
+/* { dg-do run } */
+/* { dg-options "-O1 " } */
+/* Option -fno-tree-lrs removed By Andrew MacLeod since it is no longer
+ supported in the compiler beginning with GCC 4.3. */
+/* m32c has varying sized pointers */
+/* { dg-skip-if "" { "m32c-*-*" } { "*" } { "-mcpu=m32c" "-mcpu=m32cm" } } */
+
+__extension__ typedef __INTPTR_TYPE__ intptr_t;
+
+extern void abort (void);
+
+intptr_t fff[10];
+
+void f(intptr_t a, intptr_t b)
+{
+ intptr_t crcc = b;
+ intptr_t d = *((intptr_t*)(a+1));
+ int i;
+
+ a = d >= b? d:b;
+
+
+ for(i=0;i<10;i++)
+ fff[i] = a;
+}
+
+/* The variable a cannot be a local variable as we get better aliasing
+ now and decide that the store to a is dead. The better aliasing comes
+ from better representation of pointer arithmetic. */
+intptr_t a = 10;
+int main(void)
+{
+ int i;
+ f((intptr_t)(&a)-1,0);
+ for(i = 0;i<10;i++)
+ if (fff[i]!=10)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-1.c
new file mode 100644
index 000000000..0952a261a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* PR36598 AVR fail maybe due to cost metrics */
+/* { dg-final { scan-tree-dump-times "nasty_local\\." 0 "optimized" { xfail { "avr-*-*" } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+struct a {int a,b,c;} a;
+int test(struct a a)
+{
+struct a nasty_local;
+__builtin_memcpy (&nasty_local,&a, sizeof(a));
+return nasty_local.a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-2.c
new file mode 100644
index 000000000..24464abd4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-2.c
@@ -0,0 +1,25 @@
+/* PR middle-end/38454 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
+memcpy (void *__restrict dest, const void *__restrict src, size_t len)
+{
+ return __builtin___memcpy_chk (dest, /* { dg-warning "will always overflow destination buffer" } */
+ src, len, __builtin_object_size (dest, 0));
+}
+
+struct S { char buf[10]; } s;
+
+void
+foo (void)
+{
+ char buf[12];
+ char *p = buf + 4;
+ struct S *q = (struct S *) p;
+ memcpy (q, &s, sizeof (s));
+}
+
+/* { dg-final { scan-assembler "__memcpy_chk" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-3.c
new file mode 100644
index 000000000..3b5693b13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+/* { dg-require-effective-target non_strict_align } */
+
+int get_int(const void *p)
+{
+ int w;
+ __builtin_memcpy(&w, p, sizeof (int));
+ return w;
+}
+
+/* { dg-final { scan-tree-dump-not "memcpy" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-4.c
new file mode 100644
index 000000000..cff477a98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/memcpy-4.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-expand" } */
+
+#ifdef __mips
+__attribute__((nomips16))
+#endif
+void
+f1 (char *p)
+{
+ __builtin_memcpy (p, "12345", 5);
+}
+
+/* { dg-final { scan-rtl-dump "mem/u.*mem/u" "expand" { target mips*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/memmove-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/memmove-1.c
new file mode 100644
index 000000000..46918ee0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/memmove-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-times "memmove" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+static const char a[100]={1,2,3,4};
+char b[1000];
+int i,i1;
+static inline void
+__attribute__ ((always_inline))
+domem (void *dest, const void *src, int len)
+{
+ __builtin_memmove (dest, src, len);
+}
+t()
+{
+ domem (b,a,100);
+ domem (b+i1,(const void *)b,1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/memmove-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/memmove-2.c
new file mode 100644
index 000000000..9c691ef01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/memmove-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-times "memmove" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+char a[40];
+extern void bar (char *);
+
+void
+foo (void)
+{
+ char b[10];
+ __builtin_memmove (&a[0], &a[20], 20);
+ __builtin_memmove (&b[1], &a[25], 9);
+ bar (b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/memmove-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/memmove-3.c
new file mode 100644
index 000000000..98493b3d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/memmove-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-times "memmove" 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+char a[40];
+struct A { char a[30]; };
+
+void
+foo (struct A *p, char *q, char *r)
+{
+ char b[10];
+ __builtin_memmove (&a[1], &a[19], 20);
+ __builtin_memmove (&p->a[1], &p->a[9], 10);
+ __builtin_memmove (q, r, 9);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/memset-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/memset-1.c
new file mode 100644
index 000000000..677ae91bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/memset-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void warn_memset_zero_len (void)
+__attribute__((__warning__ ("memset used with constant zero length parameter;"
+ " this could be due to transposed parameters")));
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
+memset (void *dest, int ch, size_t len)
+{
+ if (__builtin_constant_p (len) && len == 0)
+ {
+ warn_memset_zero_len (); /* { dg-warning "memset used with constant zero" } */
+ return dest;
+ }
+ return __builtin_memset (dest, ch, len);
+}
+
+char buf[10];
+
+int
+main (void)
+{
+ memset (buf, sizeof (buf), 0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/merge-all-constants-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/merge-all-constants-1.c
new file mode 100644
index 000000000..5c9cd06e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/merge-all-constants-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-w -O2 -fmerge-all-constants" } */
+
+const char str1[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
+const char str2[38] = "0123456789abcdefghijklmnopqrstuvwxyz";
+const char str3[10] = "0123456789abcdefghijklmnopqrstuvwxyz";
+
+/* { dg-final { scan-assembler-not "\.rodata\.str" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/minmax-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/minmax-1.c
new file mode 100644
index 000000000..e279c0e20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/minmax-1.c
@@ -0,0 +1,83 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-original" } */
+
+/* Check that MIN-MAX and MAX-MIN combinations are folded. */
+
+extern void abort (void);
+
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+
+int f1(int a, int b)
+{
+ return MIN (MAX (a, b), b); /* == b */
+}
+
+int f2(int a, int b)
+{
+ return MAX (MIN (a, b), b); /* == b */
+}
+
+int f3(int a, int b)
+{
+ return MIN (MAX (b, a), b); /* == b */
+}
+
+int f4(int a, int b)
+{
+ return MAX (MIN (b, a), b); /* == b */
+}
+
+
+int g1(int a, int b)
+{
+ return MIN (a, MAX (a, b)); /* == a */
+}
+
+int g2(int a, int b)
+{
+ return MAX (a, MIN (a, b)); /* == a */
+}
+
+int g3(int a, int b)
+{
+ return MIN (a, MAX (b, a)); /* == a */
+}
+
+int g4(int a, int b)
+{
+ return MAX (a, MIN (b, a)); /* == a */
+}
+
+int main(void)
+{
+ if (f1 (1, 2) != 2)
+ abort ();
+
+ if (f2 (1, 2) != 2)
+ abort ();
+
+ if (f3 (1, 2) != 2)
+ abort ();
+
+ if (f4 (1, 2) != 2)
+ abort ();
+
+ if (g1 (1, 2) != 1)
+ abort ();
+
+ if (g2 (1, 2) != 1)
+ abort ();
+
+ if (g3 (1, 2) != 1)
+ abort ();
+
+ if (g4 (1, 2) != 1)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "MIN_EXPR" 0 "original"} } */
+/* { dg-final { scan-tree-dump-times "MAX_EXPR" 0 "original"} } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-1.c
new file mode 100644
index 000000000..b799b6b87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-1.c
@@ -0,0 +1,41 @@
+/* Test that expand can generate correct loads of misaligned data even on
+ strict alignment platforms. */
+
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort ();
+
+typedef unsigned int myint __attribute__((aligned(1)));
+
+unsigned int
+foo (myint *p)
+{
+ return *p;
+}
+
+#define cst (int) 0xdeadbeef
+#define NUM 8
+
+struct blah
+{
+ char c;
+ myint i[NUM];
+};
+
+struct blah g;
+
+int
+main (int argc, char **argv)
+{
+ int i, k;
+ for (k = 0; k < NUM; k++)
+ {
+ g.i[k] = cst;
+ i = foo (&g.i[k]);
+
+ if (i != cst)
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-2.c
new file mode 100644
index 000000000..7f6c6d19a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-2.c
@@ -0,0 +1,40 @@
+/* Test that expand can generate correct stores to misaligned data even on
+ strict alignment platforms. */
+
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort ();
+
+typedef unsigned int myint __attribute__((aligned(1)));
+
+void
+foo (myint *p, unsigned int i)
+{
+ *p = i;
+}
+
+#define cst (int) 0xdeadbeef
+#define NUM 8
+
+struct blah
+{
+ char c;
+ myint i[NUM];
+};
+
+struct blah g;
+
+int
+main (int argc, char **argv)
+{
+ int k;
+
+ for (k = 0; k < NUM; k++)
+ {
+ foo (&g.i[k], cst);
+ if (g.i[k] != cst)
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-3.c
new file mode 100644
index 000000000..5b1c7e7e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/misaligned-expand-3.c
@@ -0,0 +1,43 @@
+/* Test that expand can generate correct stores to misaligned data of complex
+ type even on strict alignment platforms. */
+
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort ();
+
+typedef _Complex float mycmplx __attribute__((aligned(1)));
+
+void
+foo (mycmplx *p, float r, float i)
+{
+ __real__ *p = r;
+ __imag__ *p = i;
+}
+
+#define cvr 3.2f
+#define cvi 2.5f
+#define NUM 8
+
+struct blah
+{
+ char c;
+ mycmplx x[NUM];
+} __attribute__((packed));
+
+struct blah g;
+
+int
+main (int argc, char **argv)
+{
+ int k;
+
+ for (k = 0; k < NUM; k++)
+ {
+ foo (&g.x[k], cvr, cvi);
+ if (__real__ g.x[k] != cvr
+ || __imag__ g.x[k] != cvi)
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/misc-column.c b/gcc-4.9/gcc/testsuite/gcc.dg/misc-column.c
new file mode 100644
index 000000000..e68300bfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/misc-column.c
@@ -0,0 +1,40 @@
+/* { dg-options "-fshow-column -Wall -Wfloat-equal -pedantic" } */
+
+int i, j;
+float a, b;
+
+int *p;
+struct {
+ int a;
+ char b;
+} *q;
+
+extern void bar();
+
+void foo (void)
+{
+ if (a == b) /* { dg-warning "9:comparing floating point with" } */
+ bar ();
+
+ if (p < q) /* { dg-warning "9:comparison of distinct pointer types" } */
+ bar ();
+
+ if (&p == 0) /* { dg-warning "10:comparison will always evaluate as 'false'" } */
+ bar();
+
+ if (p == 4) /* { dg-warning "9:comparison between pointer and integer" } */
+ bar();
+
+ if (p < 0) /* { dg-warning "9:ordered comparison of pointer with" } */
+ bar();
+
+ -q; /* { dg-error "3:wrong type argument to unary" } */
+
+ ~q; /* { dg-error "3:wrong type argument to bit" } */
+
+ ++*q; /* { dg-error "3:wrong type argument to increment" } */
+
+ i = j / 0; /* { dg-warning "9:division by zero" } */
+
+ i /= 0; /* { dg-warning "5:division by zero" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/mismatch-decl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/mismatch-decl-1.c
new file mode 100644
index 000000000..da4db0a57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/mismatch-decl-1.c
@@ -0,0 +1,22 @@
+/* This test assumes -fbuiltin and not -fansi to get "index" and "memchr" builtin DECLs. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* The bug this is testing is that if a new decl conflicts with an
+ explicit decl, you don't get the "changes type of builtin" message,
+ but if there was *also* a builtin, you *also* don't get the
+ "previous declaration was here" message, leaving you with no clue
+ where the previous declaration came from. */
+
+extern char foo(int,int); /* { dg-message "previous declaration of 'foo' was here" } */
+extern char *index(const char *,int); /* { dg-message "previous declaration of 'index' was here" } */
+
+/* This changes the type of "index", which is both a builtin and an
+ explicit decl. */
+int index; /* { dg-error "redeclared as different kind of symbol" } */
+
+/* This changes the type of "memchr", which is only a builtin. */
+int memchr; /* { dg-warning "built-in function 'memchr' declared as non-function" } */
+
+/* This changes the type of "foo", which is only an explicit decl. */
+int foo; /* { dg-error "redeclared as different kind of symbol" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/missing-field-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/missing-field-init-1.c
new file mode 100644
index 000000000..5f32b021f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/missing-field-init-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Wextra -Wno-missing-field-initializers -std=c99" } */
+
+struct s { int a, b, c; };
+struct s s1 = { 1, 2, 3 };
+struct s s2 = { 1, 2 }; /* { dg-bogus "missing initializer" } */
+struct s s3[] = { { 1, 2 }, { 4, 5 } }; /* { dg-bogus "missing initializer" } */
+struct s s4[] = { 1, 2, 3, 4, 5 }; /* { dg-bogus "missing initializer" } */
+struct s s5[] = { 1, 2, 3, 4, 5, 6 };
+struct s s6 = { .a = 1 }; /* { dg-bogus "missing initializer" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/missing-field-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/missing-field-init-2.c
new file mode 100644
index 000000000..c5a3f4903
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/missing-field-init-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-field-initializers -std=c99" } */
+
+struct s { int a, b, c; };
+struct s s1 = { 1, 2, 3 };
+struct s s2 = { 1, 2 }; /* { dg-warning "(missing initializer)|(near initialization)" } */
+struct s s3[] = { { 1, 2 }, { 4, 5 } }; /* { dg-warning "(missing initializer)|(near initialization)" } */
+struct s s4[] = { 1, 2, 3, 4, 5 }; /* { dg-warning "(missing initializer)|(near initialization)" } */
+struct s s5[] = { 1, 2, 3, 4, 5, 6 };
+/* Designated initializers produce no warning. */
+struct s s6 = { .a = 1 }; /* { dg-bogus "missing initializer" } */
+/* Allow zero-initializing with "= { 0 }". */
+struct s s7 = { 0 }; /* { dg-bogus "missing initializer" } */
+struct s s8 = { 1 }; /* { dg-warning "(missing initializer)|(near initialization)" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/mmix-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/mmix-1.c
new file mode 100644
index 000000000..802ae18ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/mmix-1.c
@@ -0,0 +1,42 @@
+/* Origin: <hp@bitrange.com>
+ Test that MMIX -mtoplevel-symbols cause a ":" to be prepended on the
+ right symbols and only there. */
+/* { dg-do compile { target mmix-*-* } } */
+/* { dg-options "-mtoplevel-symbols" } */
+
+static int static_variable = 1;
+int global_initialized_variable = 2;
+extern int extern_declared_variable;
+int common_variable;
+extern int extern_declared_function (void);
+static int static_function (void);
+
+int global_defined_function ()
+{
+ static int static_variable_in_function = 2009;
+ return
+ static_variable
+ + static_variable_in_function++
+ + global_initialized_variable
+ + common_variable
+ + extern_declared_function ()
+ + static_function ();
+}
+
+static int
+static_function (void)
+{
+ if (extern_declared_variable)
+ return 42;
+ else
+ return 42 + global_defined_function ();
+}
+
+/* { dg-final { scan-assembler-not ":static_variable" } } */
+/* { dg-final { scan-assembler-not "(^|\[^:\])global_initialized_variable" } } */
+/* { dg-final { scan-assembler-not "\[^:\]extern_declared_variable" } } */
+/* { dg-final { scan-assembler-not "\[^:\]common_variable" } } */
+/* { dg-final { scan-assembler-not "\[^:\]extern_declared_function" } } */
+/* { dg-final { scan-assembler-not ":static_function" } } */
+/* { dg-final { scan-assembler-not "(^|\[^:\])global_defined_function" } } */
+/* { dg-final { scan-assembler-not "\[^:\]extern_declared_variable" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/mtune.c b/gcc-4.9/gcc/testsuite/gcc.dg/mtune.c
new file mode 100644
index 000000000..9195fd1ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/mtune.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-mtune=*" } { "" } } */
+/* { dg-options "-mtune=foo" } */
+/* { dg-error "mtune" "mtune" { target *-*-* } 0 } */
+/* { dg-bogus "march" "march" { target *-*-* } 0 } */
+/* { dg-bogus "mcpu" "mcpu" { target *-*-* } 0 } */
+/* { dg-prune-output "note: valid arguments.*" } */
+int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-1.c
new file mode 100644
index 000000000..be7b3b856
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-1.c
@@ -0,0 +1,13 @@
+/* PR c/19978 : Test for duplicated warnings (unary operators). */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Woverflow" } */
+
+#include <limits.h>
+
+int
+g (void)
+{
+ return - - - - -INT_MIN; /* { dg-bogus "integer overflow in expression.*integer overflow in expression" } */
+ /* { dg-warning "integer overflow in expression" "" { target *-*-* } 10 } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-2.c
new file mode 100644
index 000000000..8a4e9e5c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-2.c
@@ -0,0 +1,12 @@
+/* PR c/19978 : Test for duplicated warnings (binary operators). */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Woverflow" } */
+
+#include <limits.h>
+
+int
+g1 (void)
+{
+ return INT_MAX + 1 - INT_MAX; /* { dg-bogus "integer overflow in expression.*integer overflow in expression" } */
+ /* { dg-warning "integer overflow in expression" "" { target *-*-* } 10 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-3.c
new file mode 100644
index 000000000..da19de508
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/multiple-overflow-warn-3.c
@@ -0,0 +1,13 @@
+/* PR 30465 : Test for duplicated warnings in a conversion. */
+/* { dg-do compile } */
+/* { dg-options "-Woverflow" } */
+
+short int
+g (void)
+{
+ short int wc = ((short int)1 << (8 * __SIZEOF_INT__ - 1)) - 1; /* { dg-bogus "overflow .* overflow" } */
+ /* { dg-warning "overflow" "" { target *-*-* } 8 } */
+ return wc;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/multiword-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/multiword-1.c
new file mode 100644
index 000000000..c08161791
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/multiword-1.c
@@ -0,0 +1,68 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+/* { dg-require-effective-target ilp32 } */
+
+typedef unsigned int u32;
+typedef unsigned long long u64;
+
+u64 __attribute__((noinline))
+foo (u32 high, u32 low)
+{
+ return ((u64)high << 32) | low;
+}
+
+u32 __attribute__((noinline))
+right (u64 t)
+{
+ return (u32)(t >> 32);
+}
+
+u64 __attribute__((noinline))
+left (u32 t)
+{
+ return (u64)t << 32;
+}
+
+u32 __attribute__((noinline))
+right2 (u64 t)
+{
+ return (u32)(t >> 40);
+}
+
+u64 __attribute__((noinline))
+left2 (u32 t)
+{
+ return (u64)t << 40;
+}
+
+u64 __attribute__((noinline))
+zeroextend (u32 t)
+{
+ return (u64)t;
+}
+
+extern void abort ();
+
+int
+main ()
+{
+ if (foo (13000, 12000) != 55834574860000ULL)
+ abort ();
+
+ if (right (55834574860000ULL) != 13000)
+ abort ();
+
+ if (left (13000) != 55834574848000ULL)
+ abort ();
+
+ if (right2 (55834574860000ULL) != 50)
+ abort ();
+
+ if (left2 (13000) != 14293651161088000ULL)
+ abort ();
+
+ if (zeroextend (13000) != 13000ULL)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nest.c b/gcc-4.9/gcc/testsuite/gcc.dg/nest.c
new file mode 100644
index 000000000..5734c11f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nest.c
@@ -0,0 +1,28 @@
+/* PR 5967, PR 7114 */
+/* { dg-do run } */
+/* { dg-require-profiling "-pg" } */
+/* { dg-options "-O2 -pg" } */
+/* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
+/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
+
+extern void abort (void);
+
+long foo (long x)
+{
+ long i, sum = 0;
+ long bar (long z) { return z * 2; }
+
+ for (i = 0; i < x; i++)
+ sum += bar (i);
+
+ return sum;
+}
+
+int main (void)
+{
+ if (foo(10) != 90)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-profile-file } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-calls-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-calls-1.c
new file mode 100644
index 000000000..500fed2fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-calls-1.c
@@ -0,0 +1,42 @@
+/* PR middle-end/24003 */
+/* Contributed by Eric Botcazou <ebotcazou@adacore.com> */
+
+/* { dg-do run } */
+/* { dg-options "-std=c99 -O -fno-inline" } */
+/* { dg-options "-std=c99 -O -fno-inline -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#include <limits.h>
+
+typedef unsigned long uns32_t;
+typedef unsigned long long uns64_t;
+
+extern void abort(void);
+
+uns32_t lo (uns64_t p)
+{
+ return (uns32_t)p;
+}
+
+uns64_t concat (uns32_t p1, uns32_t p2)
+{
+#if LLONG_MAX > 2147483647L
+ return ((uns64_t)p1 << 32) | p2;
+#else
+ return 0;
+#endif
+}
+
+uns64_t lshift32 (uns64_t p1, uns32_t p2)
+{
+ return concat (lo (p1), p2);
+}
+
+int main(void)
+{
+#if LLONG_MAX > 2147483647L
+ if (lshift32 (0xFFFFFFFF12345678ULL, 0x90ABCDEFUL) != 0x1234567890ABCDEFULL)
+ abort ();
+#endif
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-1.c
new file mode 100644
index 000000000..cb26e895e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-1.c
@@ -0,0 +1,35 @@
+/* Test for proper errors for break and continue in nested functions. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+foo (int a)
+{
+ switch (a) {
+ void bar1 (void) { break; } /* { dg-error "break statement" "break switch 1" } */
+ }
+ switch (a) {
+ case 0:
+ (void) 0;
+ void bar2 (void) { break; } /* { dg-error "break statement" "break switch 2" } */
+ }
+ while (1) {
+ void bar3 (void) { break; } /* { dg-error "break statement" "break while" } */
+ }
+ do {
+ void bar4 (void) { break; } /* { dg-error "break statement" "break do" } */
+ } while (1);
+ for (;;) {
+ void bar5 (void) { break; } /* { dg-error "break statement" "break for" } */
+ }
+ while (1) {
+ void bar6 (void) { continue; } /* { dg-error "continue statement" "continue while" } */
+ }
+ do {
+ void bar7 (void) { continue; } /* { dg-error "continue statement" "continue do" } */
+ } while (1);
+ for (;;) {
+ void bar8 (void) { continue; } /* { dg-error "continue statement" "continue for" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-2.c
new file mode 100644
index 000000000..14f14c67e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-2.c
@@ -0,0 +1,28 @@
+/* PR middle-end/18820 */
+/* Check that we reject nested functions as initializers
+ of static variables. */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct S {
+ void (*f)(int);
+};
+
+extern void baz(struct S *);
+extern void p(int);
+
+void foo(void)
+{
+ int u;
+
+ void bar(int val)
+ {
+ u = val;
+ }
+
+ static struct S s = { bar }; /* { dg-error "(is not constant)|(near initialization)" } */
+
+ baz(&s);
+ p(u);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-3.c
new file mode 100644
index 000000000..19e8a6155
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-3.c
@@ -0,0 +1,20 @@
+/* Undefined nested function should be a error, whether or not the
+ function is called. Bug 17807. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f (void)
+{
+ auto int fn (int); /* { dg-error "nested function 'fn' declared but never defined" } */
+ auto int fn2 (int); /* { dg-error "nested function 'fn2' declared but never defined" } */
+ sizeof(fn(1));
+}
+
+void
+h (void)
+{
+ auto int hn (int); /* { dg-error "nested function 'hn' declared but never defined" } */
+ hn (1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-4.c
new file mode 100644
index 000000000..36a8c405c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-4.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-pg" } */
+/* { dg-options "-pg -static" { target hppa*-*-hpux* } } */
+/* { dg-require-profiling "-pg" } */
+
+extern void abort(void);
+
+void foo(int i)
+{
+ void bar(void)
+ {
+ if (i != 2)
+ abort ();
+ }
+
+ bar();
+}
+
+int main(void)
+{
+ foo (2);
+ return 0;
+}
+
+/* { dg-final { cleanup-profile-file } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-5.c
new file mode 100644
index 000000000..3545f37e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-5.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fexceptions" } */
+/* PR28516: ICE generating ARM unwind directives for nested functions. */
+/* { dg-require-effective-target trampolines } */
+
+void ex(int (*)(void));
+void foo(int i)
+{
+ int bar(void)
+ {
+ return i;
+ }
+ ex(bar);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-6.c
new file mode 100644
index 000000000..3bae4db35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-6.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Winline" } */
+
+static inline int foo1 (int a)
+{ /* { dg-bogus "function not inlinable" } */
+ void bar1 (int b)
+ {}
+ return a;
+}
+
+int foo2 (int a)
+{
+ return foo1 (a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-7.c
new file mode 100644
index 000000000..764beb453
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-7.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+
+void foo (void)
+{
+ int a;
+
+ void bar (void)
+ {
+ a = 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "bar" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-8.c
new file mode 100644
index 000000000..ccec27d08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-func-8.c
@@ -0,0 +1,57 @@
+/* { dg-do run } */
+/* { dg-options "-O -fno-inline" } */
+
+extern void abort (void);
+
+/* Return 0 and clobber the static chain. */
+
+int
+zero (int n)
+{
+ int
+ nested (int m)
+ {
+ return m - n;
+ }
+
+ return nested (n);
+}
+
+/* Return the triple of ARG in a convoluted manner. */
+
+int
+triple (int arg)
+{
+ int
+ read_arg (void)
+ {
+ return arg;
+ }
+
+ int
+ parent (int nested_arg)
+ {
+ int
+ child1 (void)
+ {
+ return parent (zero (5));
+ }
+
+ int
+ child2 (void)
+ {
+ return nested_arg + read_arg ();
+ }
+
+ return (nested_arg == 0 ? 0 : child1 ()) + child2 ();
+ }
+
+ return parent (arg);
+}
+
+int main(void)
+{
+ if (triple (13) != 3 * 13)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nested-redef-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/nested-redef-1.c
new file mode 100644
index 000000000..a3786b0c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nested-redef-1.c
@@ -0,0 +1,44 @@
+/* Test diagnosis of nested tag redefinitions. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s0 {
+ struct s0 { int a; } x; /* { dg-error "nested redefinition of 'struct s0'" } */
+};
+
+struct s1 {
+ const struct s1 { int b; } x; /* { dg-error "nested redefinition of 'struct s1'" } */
+};
+
+struct s2 {
+ struct s2 { int c; } *x; /* { dg-error "nested redefinition of 'struct s2'" } */
+};
+
+struct s3 {
+ struct s4 {
+ struct s5 {
+ struct s3 { int a; } **x; /* { dg-error "nested redefinition of 'struct s3'" } */
+ } y;
+ } z;
+};
+
+struct s6;
+struct s6 { struct s6 *p; };
+
+union u0 {
+ union u0 { int c; } *x; /* { dg-error "nested redefinition of 'union u0'" } */
+};
+
+enum e0 {
+ E0 = sizeof(enum e0 { E1 }) /* { dg-error "nested redefinition of 'enum e0'" } */
+};
+
+enum e1 {
+ E2 = sizeof(enum e2 { E2 }), /* { dg-error "redeclaration of enumerator 'E2'" } */
+ /* { dg-message "note: previous definition" "previous E2" { target *-*-* } 38 } */
+ E3
+};
+
+enum e3;
+enum e3 { E4 = 0 };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-1.c
new file mode 100644
index 000000000..fdcf05459
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+/* Verify that these GNU extensions are recognized as keywords in
+ GNU89 mode. */
+
+int asm; /* { dg-error "before .asm." } */
+int inline; /* { dg-warning "empty declaration" } */
+/* { dg-error "empty declaration" "" { target *-*-* } 8 } */
+int typeof; /* { dg-error "before .typeof." } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-2.c
new file mode 100644
index 000000000..3cd41141d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89 -fno-asm" } */
+
+/* Verify that these GNU extensions are not recognized as keywords
+ when using -fno-asm in GNU89 mode. */
+
+int asm; /* { dg-bogus "before .asm." } */
+int inline; /* { dg-bogus "empty declaration" } */
+int typeof; /* { dg-bogus "before .typeof." } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-3.c
new file mode 100644
index 000000000..9c806e435
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-3.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* Verify that these GNU extensions are recognized as keywords in
+ GNU99 mode. */
+
+int asm; /* { dg-error "before .asm." } */
+int inline; /* { dg-warning "empty declaration" } */
+/* { dg-error "empty declaration" "" { target *-*-* } 8 } */
+int typeof; /* { dg-error "before .typeof." } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-4.c
new file mode 100644
index 000000000..c4c168780
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-asm-4.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fno-asm" } */
+
+/* Verify that the GNU extensions asm and typeof are not recognized as
+ keywords when using -fno-asm in GNU89 mode, but that inline (which
+ is a keyword in C99 but not C89) is recognized. */
+
+int asm; /* { dg-bogus "before .asm." } */
+int inline; /* { dg-warning "empty declaration" } */
+/* { dg-error "empty declaration" "" { target *-*-* } 9 } */
+int typeof; /* { dg-bogus "before .typeof." } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-1.c
new file mode 100644
index 000000000..b83b3ae80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of strict-overflow-1.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return i - 5 < 10;
+}
+
+/* { dg-final { scan-tree-dump "-[ ]*5" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-2.c
new file mode 100644
index 000000000..aec8960ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of strict-overflow-2.c. */
+
+/* We can only simplify the division when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return (i * 100) / 10;
+}
+
+/* { dg-final { scan-tree-dump "100" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-3.c
new file mode 100644
index 000000000..e34e9183c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of strict-overflow-3.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i, int j)
+{
+ return i + 100 < j + 1000;
+}
+
+/* { dg-final { scan-tree-dump "1000" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-4.c
new file mode 100644
index 000000000..c3b57bba0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of strict-overflow-4.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return i + 1 > i;
+}
+
+/* { dg-final { scan-tree-dump "\[^ \]*_.(\\\(D\\\))? (>|<) \[^ \]*_." "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-5.c
new file mode 100644
index 000000000..a63bf342b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-5.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Dual of strict-overflow-5.c. */
+
+/* We can only unroll when using strict overflow semantics. */
+
+int foo (int i)
+{
+ int index;
+ int r=0;
+
+ for (index = i; index <= i+4; index+=2)
+ r++;
+
+ return r;
+}
+
+/* { dg-final { scan-tree-dump-times "r = 3" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-6.c
new file mode 100644
index 000000000..43200bb20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. */
+
+/* VRP test. We can not simplify the conditional when not using
+ strict overflow semantics. We don't test this with
+ -fstrict-overflow because it turns into an infinite loop. That is
+ OK but it would also be OK to not do that. */
+
+int
+foo ()
+{
+ int i, bits;
+ for (i = 1, bits = 1; i > 0; i += i)
+ ++bits;
+ return bits;
+}
+
+/* { dg-final { scan-tree-dump "return bits" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-7.c
new file mode 100644
index 000000000..c237af984
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/no-strict-overflow-7.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of strict-overflow-6.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (char* p)
+{
+ return p + 1000 < p;
+}
+
+/* { dg-final { scan-tree-dump "\[+\]\[ \]*1000" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nodfp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/nodfp-1.c
new file mode 100644
index 000000000..55019d8c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nodfp-1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile { target {! dfp} } } */
+/* { dg-options "-std=gnu99" } */
+
+_Decimal32 x; /* { dg-error "not supported" "reject decimal float" } */
+_Decimal64 y; /* { dg-error "not supported" "reject decimal float" } */
+_Decimal128 z; /* { dg-error "not supported" "reject decimal float" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nofixed-point-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/nofixed-point-1.c
new file mode 100644
index 000000000..babbe5989
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nofixed-point-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile { target {! fixed_point} } } */
+/* { dg-options "-std=gnu99" } */
+
+_Fract w; /* { dg-error "not supported" "reject fixed-point" } */
+_Sat _Fract x; /* { dg-error "not supported" "reject fixed-point" } */
+_Accum y; /* { dg-error "not supported" "reject fixed-point" } */
+_Sat _Accum z; /* { dg-error "not supported" "reject fixed-point" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nofixed-point-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/nofixed-point-2.c
new file mode 100644
index 000000000..8442a1984
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nofixed-point-2.c
@@ -0,0 +1,29 @@
+/* PR inline-asm/39059 */
+/* { dg-do compile { target {! fixed_point} } } */
+/* { dg-options "-std=gnu99" } */
+
+void
+f1 (void)
+{
+ asm ("" : : "r" (0r)); /* { dg-error "not supported" "reject fixed-point" } */
+}
+
+__typeof (0r) /* { dg-error "not supported" "reject fixed-point" } */
+b2 (void) /* { dg-bogus "defaults to" } */
+{
+ return 0r; /* { dg-error "not supported" "reject fixed-point" } */
+}
+
+_Accum /* { dg-error "not supported" "reject fixed-point" } */
+f3 (void)
+{
+ return 0k; /* { dg-error "not supported" "reject fixed-point" } */
+}
+
+_Sat /* { dg-error "not supported" "reject fixed-point" } */
+f4 (void)
+{
+ return 0k; /* { dg-error "not supported" "reject fixed-point" } */
+}
+
+/* { dg-error "is used without" "" { target *-*-* } 23 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/non-local-goto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/non-local-goto-1.c
new file mode 100644
index 000000000..2bace076f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/non-local-goto-1.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int global;
+
+static foo(void) __attribute__((noinline));
+
+static foo(void)
+{
+ global = 1;
+}
+
+static bar(void)
+{
+ foo ();
+}
+
+int execute(int cmd)
+{
+ __label__ start;
+
+ void raise(void)
+ {
+ goto start;
+ }
+
+ int last;
+
+ bar ();
+
+ last = 0;
+
+start:
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/non-local-goto-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/non-local-goto-2.c
new file mode 100644
index 000000000..24ed650a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/non-local-goto-2.c
@@ -0,0 +1,57 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int global;
+
+static foo(void) __attribute__((noinline));
+
+static foo(void)
+{
+ global = 1;
+}
+
+static bar(void)
+{
+ foo ();
+ global = 0;
+}
+
+int execute(int cmd)
+{
+ __label__ start;
+
+ void raise(void)
+ {
+ goto start;
+ }
+
+ int last;
+
+ bar ();
+
+ last = 0;
+
+start:
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20000901-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20000901-1.c
new file mode 100644
index 000000000..ef5c3cbca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20000901-1.c
@@ -0,0 +1 @@
+struct foo bar[] = { {"baz"} }; /* { dg-error "array type has incomplete element type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20001228-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20001228-1.c
new file mode 100644
index 000000000..73a44a859
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20001228-1.c
@@ -0,0 +1,6 @@
+void rof(void)
+{
+ union { int a; } u;
+ for (u.a = 0; u; u.a++) /* { dg-error "used union" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20010425-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20010425-1.c
new file mode 100644
index 000000000..e36269e8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20010425-1.c
@@ -0,0 +1,9 @@
+__inline__ void bar(int x)
+{
+ (void)x;
+}
+
+void foo(void)
+{
+ bar(baz); /* { dg-error "undeclared|for each function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20010524-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20010524-1.c
new file mode 100644
index 000000000..95c5db15d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20010524-1.c
@@ -0,0 +1,2 @@
+int i = 7 / 0; /* { dg-error "not constant" } */
+ /* { dg-warning "division by zero" "div by zero" { target *-*-* } 1 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20011025-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20011025-1.c
new file mode 100644
index 000000000..51e60e5cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20011025-1.c
@@ -0,0 +1,5 @@
+double foo [] =
+{ &bar, /* { dg-error "undeclared|is not constant|near init" } */
+ (void *) 0 }; /* { dg-error "incompatible types|is not constant|near init" } */
+double baz [] =
+{ (void *) 0 }; /* { dg-error "incompatible types|is not constant|near init" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020130-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020130-1.c
new file mode 100644
index 000000000..d820e062e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020130-1.c
@@ -0,0 +1,9 @@
+/* Test for ICE when using typedef for bad type. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
+
+void
+foo (void)
+{
+ typedef int t[x]; /* { dg-error "undeclared|function" "x undeclared" } */
+ t bar;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020207-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020207-1.c
new file mode 100644
index 000000000..945eb1b1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020207-1.c
@@ -0,0 +1,32 @@
+/* This testcase ICEd because statement expression type was set, but was not
+ as used. */
+
+struct A {
+ unsigned int a, b, c;
+};
+
+extern void abort (void);
+extern void exit (int);
+
+struct A bar (void)
+{
+ return (struct A) { 176, 52, 31 };
+}
+
+void baz (struct A *a)
+{
+ if (a->a != 176 || a->b != 52 || a->c != 31)
+ abort ();
+}
+
+int main ()
+{
+ struct A d;
+
+ d = ({ { bar (); } }); /* { dg-error "void value" } */
+ d = ({ if (1) { bar (); } }); /* { dg-error "void value" } */
+ d = ({ while (0) { bar (); } }); /* { dg-error "void value" } */
+ d = ({ do { bar (); } while (0); }); /* { dg-error "void value" } */
+ baz (&d);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020213-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020213-1.c
new file mode 100644
index 000000000..41480f079
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020213-1.c
@@ -0,0 +1,34 @@
+/* PR c/5503
+ Test whether argument checking is done for fputs, bzero and bcmp. */
+typedef struct { int i; } FILE;
+typedef __SIZE_TYPE__ size_t;
+int fputs (const char *, FILE *);
+void bzero (void *, size_t);
+int bcmp (const void *, const void *, size_t);
+
+char buf[32];
+FILE *f;
+
+int main ()
+{
+ fputs ("foo"); /* { dg-error "too few" } */
+ fputs ("foo", "bar", "baz"); /* { dg-error "too many" } */
+ fputs (21, 43);
+ bzero (buf); /* { dg-error "too few" } */
+ bzero (21); /* { dg-error "too few" } */
+ bcmp (buf, buf + 16); /* { dg-error "too few" } */
+ bcmp (21); /* { dg-error "too few" } */
+ fputs ("foo", f);
+ bzero (buf, 32);
+ bcmp (buf, buf + 16, 16);
+ return 0;
+}
+
+/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 15 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */
+/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 16 } */
+/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 16 } */
+/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 18 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 6 } */
+/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 20 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 7 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020220-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020220-1.c
new file mode 100644
index 000000000..3063f422c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20020220-1.c
@@ -0,0 +1,12 @@
+/* PR c++/5713
+ Test that there are no ICEs after redeclaration error. */
+
+int foo (const char*, const char*);
+
+void bar (void)
+{
+ const char *s = "bar";
+ int i; /* { dg-message "note: previous declaration" } */
+ int size = 2;
+ int i = foo (s, s + size); /* { dg-error "redeclaration of" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20030818-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20030818-1.c
new file mode 100644
index 000000000..71b89ec6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20030818-1.c
@@ -0,0 +1,3 @@
+/* PR 11207. */
+
+char font8x8[256][8] = { [-1] = { 0 } }; /* { dg-error "array index|near init" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-1.c
new file mode 100644
index 000000000..dc5ab7a7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-1.c
@@ -0,0 +1,15 @@
+/* PR/11658 The error message was quite mysterious for gcc up to 3.4.x */
+
+struct a {
+ int x;
+};
+
+int bug_if(struct a a) { if (a) return 1; else return 0; } /* { dg-error "struct type" } */
+int bug_while(struct a a) { while (a); } /* { dg-error "struct type" } */
+int bug_do_while(struct a a) { do ; while (a); } /* { dg-error "struct type" } */
+int bug_for(struct a a) { for ( ; a; ) ; } /* { dg-error "struct type" } */
+int bug_or(struct a a) { return (a || 1); } /* { dg-error "struct type" } */
+int bug_and(struct a a) { return (a && 1); } /* { dg-error "struct type" } */
+int bug_cond(struct a a) { return (a ? 1 : 0); } /* { dg-error "struct type" } */
+int bug_cond2(struct a a) { return (a ? : 0); } /* { dg-error "struct type" } */
+int bug_bool(struct a a) { return (_Bool) a; } /* { dg-error "struct type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-2.c
new file mode 100644
index 000000000..5c8b22f02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-2.c
@@ -0,0 +1,15 @@
+/* PR/11658 The error message was quite mysterious for gcc up to 3.4.x */
+
+union a {
+ int x;
+};
+
+int bug_if(union a a) { if (a) return 1; else return 0; } /* { dg-error "union type" } */
+int bug_while(union a a) { while (a); } /* { dg-error "union type" } */
+int bug_do_while(union a a) { do ; while (a); } /* { dg-error "union type" } */
+int bug_for(union a a) { for ( ; a; ) ; } /* { dg-error "union type" } */
+int bug_or(union a a) { return (a || 1); } /* { dg-error "union type" } */
+int bug_and(union a a) { return (a && 1); } /* { dg-error "union type" } */
+int bug_cond(union a a) { return (a ? 1 : 0); } /* { dg-error "union type" } */
+int bug_cond2(union a a) { return (a ? : 0); } /* { dg-error "union type" } */
+int bug_bool(union a a) { return (_Bool) a; } /* { dg-error "union type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-3.c
new file mode 100644
index 000000000..5b90c3ee8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040203-3.c
@@ -0,0 +1,16 @@
+/* PR/11658 The error message was quite mysterious for gcc up to 3.4.x */
+/* { dg-options "-std=gnu89" } */
+
+struct s { char c[1]; };
+struct s f(void);
+
+int bug_if(void) { if (f().c) return 1; else return 0; } /* { dg-error "array that cannot be converted" } */
+int bug_while(void) { while (f().c); } /* { dg-error "array that cannot be converted" } */
+int bug_do_while(void) { do ; while (f().c); } /* { dg-error "array that cannot be converted" } */
+int bug_for(void) { for ( ; f().c; ) ; } /* { dg-error "array that cannot be converted" } */
+int bug_or(void) { return (f().c || 1); } /* { dg-error "array that cannot be converted" } */
+int bug_and(void) { return (f().c && 1); } /* { dg-error "array that cannot be converted" } */
+int bug_cond(void) { return (f().c ? 1 : 0); } /* { dg-error "array that cannot be converted" } */
+int bug_cond2(void) { return (f().c ? : 0); } /* { dg-error "array that cannot be converted" } */
+int bug_not(void) { return !f().c; } /* { dg-error "wrong type argument to unary exclamation mark" } */
+int bug_bool(void) { return (_Bool) f().c; } /* { dg-error "array that cannot be converted" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040629-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040629-1.c
new file mode 100644
index 000000000..ff00260a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20040629-1.c
@@ -0,0 +1,8 @@
+/* PR 16216 */
+
+void func()
+{
+ const char *pek; int i;
+ pek=__builtin_va_arg(ap,const char*); /* { dg-error "" } */
+}
+/* { dg-message "undeclared identifier is reported only once" "reminder" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20041207.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20041207.c
new file mode 100644
index 000000000..0d02da909
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20041207.c
@@ -0,0 +1,8 @@
+/* PR18867 - ICE on a switch controlling expressions with an
+ invalid type. Origin: Serge Belyshev <belyshev@lubercy.com> */
+
+void f()
+{
+ float x;
+ switch (x) {case 0: break;}; /* { dg-error "not an integer" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20050120-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20050120-1.c
new file mode 100644
index 000000000..4af84b6f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/20050120-1.c
@@ -0,0 +1,19 @@
+/* PR c/18946 */
+/* { dg-do compile } */
+/* { dg-options "-Wshadow" } */
+
+void bar (void)
+{
+ {
+ if (foo) /* { dg-error "undeclared|for each" } */
+ foo (); /* { dg-warning "shadows previous" } */
+ }
+}
+
+void baz (void)
+{
+ if (foo) /* { dg-error "undeclared" } */
+ {
+ int foo; /* { dg-warning "shadows previous" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920507-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920507-1.c
new file mode 100644
index 000000000..22b7b0a8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920507-1.c
@@ -0,0 +1,8 @@
+/* { dg-options "-ffat-lto-objects" } */
+int *
+x(void)
+{
+ register int *a asm("unknown_register"); /* { dg-error "invalid register" } */
+ int *v[1] = {a};
+ return v[0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920616-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920616-2.c
new file mode 100644
index 000000000..25f59434f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920616-2.c
@@ -0,0 +1 @@
+f(void a,...){} /* { dg-error "has incomplete type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920721-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920721-2.c
new file mode 100644
index 000000000..b21ff994e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920721-2.c
@@ -0,0 +1,6 @@
+void f(int n)
+{
+int s;
+for(s=0;s<n;s++)
+ s==5?1 n=1; /* { dg-error "parse error|syntax error|expected" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920824-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920824-1.c
new file mode 100644
index 000000000..bc8b19c3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920824-1.c
@@ -0,0 +1 @@
+struct s{struct s{int i;}x;}; /* { dg-error "nested redefinition" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920923-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920923-1.c
new file mode 100644
index 000000000..ccd1dc3a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/920923-1.c
@@ -0,0 +1,127 @@
+/* { dg-message "undeclared identifier is reported only once" "reminder for mmu_base" { target *-*-* } 0 } */
+typedef BYTE unsigned char; /* { dg-error "expected" } */
+typedef int item_n;
+typedef int perm_set;
+struct PENT { caddr_t v_addr; };/* { dg-error "unknown type name" } */
+typedef struct PENT prec;
+typedef struct PENT *prec_t;
+prec_t mem_hash;
+BYTE *mem_base; /* { dg-error "unknown type name" } */
+struct PTE {
+ BYTE *p_page; /* { dg-error "unknown type name" } */
+ perm_set p_perms;
+};
+typedef struct PTE pte;
+struct PTP {
+ union {
+ struct *PTP p_tablep; /* { dg-error "expected" } */
+ struct *PTE p_entry;
+ } u;
+ int valid;
+};
+typedef struct PTP (u.p_tablep);/* { dg-error "expected" } */
+int pfree=0;
+int pcount=0;
+
+void
+mmu_walk_find(va)
+caddr_t va; /* { dg-error "unknown type name" } */
+{
+ BYTE *page_addr; /* { dg-error "unknown type name" } */
+ if (mmu_base[Level1(va)]->valid==0x0) { /* { dg-error "undeclared" } */
+ l1_base = mmu_base[Level1(va)]->(u.p_tablep) = p_alloc(); /* { dg-error "expected|undeclared" } */
+ mmu_base[Level1(va)]->valid = 0x3;
+ for (idx=0; idx<LEVEL1_ENTRIES; idx++) /* { dg-error "undeclared" } */
+ l1_base[idx]->valid = 0x0;
+ goto build_level2;
+ } else
+ l1_base = mmu_base[Level1(va)]->(u.p_tablep); /* { dg-error "expected" } */
+
+ if (l1_base[Level2(va)]->valid==0x0) {
+ build_level2:
+ l2_base = l1_base[Level2(va)]->(u.p_tablep) = p_alloc(); /* { dg-error "expected|undeclared" } */
+ l1_base[Level2(va)]->valid = 0x3;
+ for (idx=0; idx<LEVEL2_ENTRIES; idx++) /* { dg-error "undeclared" } */
+ l2_base[idx]->valid=0x0;
+ goto build_page; /* { dg-error "used but not defined" } */
+ } else
+ l2_base = mmu_base[Level2(va)]->(u.p_tablep); /* { dg-error "expected" } */
+
+ page_addr = l2_base[Level2(va)]->valid;
+}
+
+void *
+a_translate(va_op, v_addr)
+int va_op;
+caddr_t v_addr; /* { dg-error "unknown type name" } */
+{
+ register prec_t bucket;
+ register caddr_t p_addr; /* { dg-error "unknown type name" } */
+ bucket = mem_hash+((((v_addr)>>ITEMBITS))&hash_mask); /* { dg-error "undeclared" } */
+ do {
+ if (bucket->v_addr == ((v_addr)>>ITEMBITS) { /* { dg-error "expected|undeclared|no member" } */
+ if(!(bucket->perm_set&va_op))
+ goto prot_fault;
+ return mem_base + v_addr;
+ }
+ } while((bucket++)->v_addr != ((caddr_t)0)); /* { dg-error "expected|undeclared|no member" } */
+
+ page_miss:
+ p_addr = (--bucket)->p_addr; /* { dg-error "no member" } */
+ page_type:
+ switch (p_addr) {
+ case BUCKET_FULL: /* { dg-error "undeclared" } */
+ enlarge_hash_table(mem_hash);
+ case((caddr_t)0): /* { dg-error "expected" } */
+ p_addr = fill_item_entry(va_op, v_addr);
+ goto page_type;
+ case((caddr_t)1): /* { dg-error "expected" } */
+ default:
+ ((void)(((0))?0:(__eprintf("Failed assertion`%s'at line%d of`%s'.\n",
+ "FALSE", 327, "b.c"), 0)));
+ }
+}
+
+void
+flush_hash(hasht, hash_size)
+prec_t hasht;
+int hash_size;
+{
+ register prec_t bucket;
+ register int idx;
+ bucket = hasht;
+ for(idx=(hash_size*3)-1; idx>=0; idx--) {
+ bucket->v_addr = ((caddr_t)0);/* { dg-error "undeclared|expected|no member" } */
+ bucket->p_addr = ((caddr_t)0);/* { dg-error "no member|expected" } */
+ bucket->perm_set = VA_EMPTY; /* { dg-error "undeclared|no member" } */
+ }
+}
+
+extern void *calloc(__SIZE_TYPE__, __SIZE_TYPE__);
+
+void
+init_mem()
+{
+ mem_base = (BYTE *) calloc(1024, (1<<13)); /* { dg-error "undeclared|expected" } */
+ ((void)((mem_base != (BYTE *)0) /* { dg-error "expected" } */
+ ? 0
+ : (__eprintf("Failed assertion`%s'at line%d of`%s'.\n",
+ "mem_base != (BYTE *)0", 366, "b.c"),
+ 0)));
+ hash_num = INIT_NUM_ENTRIES * 3; /* { dg-error "undeclared" } */
+ mem_hash = (prec_t) calloc(hash_num, sizeof(prec));
+ ((void)((mem_hash != (prec_t)0)
+ ? 0
+ : (__eprintf("Failed assertion`%s'at line%d of`%s'.\n",
+ "mem_hash != (prec_t)0", 370, "b.c"),
+ 0)));
+ flush_hash(mem_hash, 32);
+ build_ptables(mem_base, 1024*(1<<13)); /* { dg-bogus "integer overflow" "int smaller than 32 bits" { xfail int16 } } */
+}
+
+struct tm {
+ int tm_sec; int tm_min; int tm_hour;
+ int tm_mday;int tm_mon; int tm_year;
+ int tm_wday;int tm_yday;int tm_isdst;
+ char*tm_zone; long tm_gmtoff;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/921102-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/921102-1.c
new file mode 100644
index 000000000..ef04b1b2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/921102-1.c
@@ -0,0 +1 @@
+int x[]={[0.3 ... 4.6]9}; /* { dg-error "not of integer type|near init" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/921116-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/921116-1.c
new file mode 100644
index 000000000..890bbb634
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/921116-1.c
@@ -0,0 +1 @@
+void a (void x) {} /* { dg-error "has incomplete type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930301-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930301-1.c
new file mode 100644
index 000000000..afabd1513
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930301-1.c
@@ -0,0 +1,5 @@
+struct a *q;
+f()
+{
+ q++; /* { dg-error "pointer to" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930622-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930622-1.c
new file mode 100644
index 000000000..835e072c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930622-1.c
@@ -0,0 +1,6 @@
+f ()
+{
+ double b;
+ b = b * 10;
+ goto c; /* { dg-error "used but not defined" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930622-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930622-2.c
new file mode 100644
index 000000000..5e02d8951
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930622-2.c
@@ -0,0 +1,6 @@
+f ()
+{
+ int i;
+ for (i--) /* { dg-error "parse|syntax|expected" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930714-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930714-1.c
new file mode 100644
index 000000000..bdbc13394
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/930714-1.c
@@ -0,0 +1,25 @@
+typedef union _yystype
+{
+ int i;
+ int *iptr;
+ int (*ifunc)(int);
+ void (*vfunc)(int);
+}
+YYSTYPE;
+
+extern int f1(int k);
+
+void test()
+{
+ YYSTYPE a;
+ int (*iptr)(int);
+ int foo[5];
+
+ a = f1; /* { dg-error "incompatible types" } */
+ a = (YYSTYPE)f1;
+ a = (YYSTYPE)foo;
+ a = (YYSTYPE)(int *)foo;
+ iptr = f1;
+ a = iptr; /* { dg-error "incompatible types" } */
+ a = (YYSTYPE)iptr;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/931203-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/931203-1.c
new file mode 100644
index 000000000..0c6a9f2d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/931203-1.c
@@ -0,0 +1,11 @@
+typedef struct
+{
+ int x, y;
+} point_t;
+
+
+point_t
+f ()
+{
+ return 0; /* { dg-error "incompatible types" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/940112-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/940112-1.c
new file mode 100644
index 000000000..bb5e0f66c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/940112-1.c
@@ -0,0 +1,7 @@
+double
+f (int x)
+{
+ double e = 1;
+ e = 1;
+ return (e)
+} /* { dg-error "parse error|syntax error|expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/940227-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/940227-1.c
new file mode 100644
index 000000000..2e6d91393
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/940227-1.c
@@ -0,0 +1,5 @@
+struct font {
+ struct {
+ char *line,*ulmask;
+ } c[2];
+} character[1] = { { {"", ""}, {"", ""} } }; /* { dg-error "extra|near|excess" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/950825-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/950825-1.c
new file mode 100644
index 000000000..43dca2f10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/950825-1.c
@@ -0,0 +1,4 @@
+main()
+{
+return (struct x) {{y: 0}}; /* { dg-error "extra|near|excess|incompatible|invalid" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/950921-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/950921-1.c
new file mode 100644
index 000000000..f141d510b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/950921-1.c
@@ -0,0 +1,10 @@
+typedef enum
+{
+ a = (X) 0, /* { dg-error "undeclared|not integer|parse error|syntax error|expected" } */
+ b
+} c;
+
+typedef enum
+{
+ d = (X) 0 /* { dg-error "undeclared|not integer|parse error|syntax error|expected" } */
+} e;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/951123-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/951123-1.c
new file mode 100644
index 000000000..009d02b8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/951123-1.c
@@ -0,0 +1,2 @@
+struct S { int a; int b[2]; };
+struct S x = { 0, [0]; }; /* { dg-error "array index|near|parse|syntax|expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/971104-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/971104-1.c
new file mode 100644
index 000000000..722b71c78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/971104-1.c
@@ -0,0 +1,29 @@
+extern int printf(const char *, ...);
+typedef unsigned short ushort;
+struct sembuf {
+ ushort sem_num;
+ short sem_op;
+ short sem_flg;
+};
+union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+ struct seminfo *__buf;
+ void *__pad;
+};
+static union semun semctl_arg;
+static int semid;
+static void up(int sem){
+ struct sembuf sb;
+ sb.sem_num = (unsigned short) sem;
+ sb.sem_op = 1;
+ sb.sem_flg = 0x1000 ;
+ if(semop(semid, &sb, 1) == -1) error("up failure");
+ if(semctl(semid, sb.sem_num, 12 , semctl_arg) == 0)
+ printf("%s had processes sleeping on it!\n",
+ ({ "MUTEX ", "BARB_SEM 1", "BARB_SEM 2", "CUST_SEM 1",
+ "CUST_SEM 2", "WAIT_SEM 1", "WAIT_SEM 2", "WAIT_SEM 3",
+ "WAIT_SEM 4"} /* { dg-error "parse error|syntax error|expected" } */
+ [( sb.sem_num )]) ); /* { dg-error "expected" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/990416-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/990416-1.c
new file mode 100644
index 000000000..91801910b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/990416-1.c
@@ -0,0 +1,12 @@
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+typedef int word_type;
+
+static void
+copy_reg (unsigned int reg, frame_state *udata, /* { dg-error "unknown type name" } */
+ frame_state *target_udata) /* { dg-error "unknown type name" } */
+{
+ word_type *preg = ge_reg_addr (reg, udata, 0);
+ word_type *ptreg = ge_reg_addr (reg, target_udata, 0);
+
+ memcpy (ptreg, preg, __builtin_dwarf_reg_size (reg));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/const-ll-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/const-ll-1.c
new file mode 100644
index 000000000..cac3af6aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/const-ll-1.c
@@ -0,0 +1,24 @@
+/* Test for broken long long suffixes. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+
+/* The following are valid integer suffixes, according to C99:
+
+ no suffix
+ u or U
+ ul, uL, Ul or UL
+ ull, uLL, Ull or ULL
+ l or L
+ lu, lU, Lu or LU
+ llu, llU, LLu or LLU
+
+ The following are not but have been accepted by GCC in the past:
+
+ lul and case variants (the 'l's being separated by a 'u')
+ lL, Ll and variants with a 'u' (mixed case pair of 'l's)
+
+ (cpplib gets this right when processing #if expressions.)
+
+*/
+
+unsigned long long a = 1LUL; /* { dg-error "lul|LUL" "error for LUL suffix" } */
+long long b = 1Ll; /* { dg-error "Ll" "error for Ll suffix" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-1.c
new file mode 100644
index 000000000..773643b3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-1.c
@@ -0,0 +1,4 @@
+struct a
+{
+ struct b t; /* { dg-error "has incomplete type" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c
new file mode 100644
index 000000000..0c707e372
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-2.c
@@ -0,0 +1,12 @@
+/* Origin: <steven@gcc.gnu.org>
+ Make sure we do not ICE when the type in the function
+ argument list is incomplete (Bug 10602). */
+/* { dg-options "-w" } */
+
+int g95_type_for_mode (enum machine_mode);
+
+int
+g95_type_for_mode (enum machine_mode mode) /* { dg-error "incomplete type" } */
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-3.c
new file mode 100644
index 000000000..735ef465b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-3.c
@@ -0,0 +1,9 @@
+/* Both occurrences of "c" should get diagnostics. PR 12391. */
+typedef struct { int a; } b_t;
+
+int foo (void)
+{
+ b_t d;
+ struct b_t *c = &d; /* { dg-warning "incompatible pointer type" } */
+ c->a; /* { dg-error "incomplete type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-4.c
new file mode 100644
index 000000000..a4f47694d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-4.c
@@ -0,0 +1,4 @@
+void foo()
+{
+ enum E e; /* { dg-error "storage size" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-5.c
new file mode 100644
index 000000000..049c34a20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/incomplete-5.c
@@ -0,0 +1,8 @@
+/* ICE on unnamed field with incomplete enum type: PR 40032. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+struct A
+{
+ enum E : 8; /* { dg-warning "narrower than values of its type" } */
+ /* { dg-error "has incomplete type" "incomplete" { target *-*-* } 6 } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-1.c
new file mode 100644
index 000000000..007991b6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-1.c
@@ -0,0 +1,17 @@
+struct a
+{ double a, b, c; };
+
+struct b
+{
+ struct a arr[6];
+};
+
+static struct b a_b =
+{
+ {0,0,0},
+ {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */
+ {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */
+ {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */
+ {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */
+ {0,0,0}, /* { dg-error "extra brace|excess elements|near" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-2.c
new file mode 100644
index 000000000..b0699023a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-2.c
@@ -0,0 +1 @@
+int d[][] = { {1}, {2}, {3} }; /* { dg-error "incomplete element type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-3.c
new file mode 100644
index 000000000..fe9543522
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-3.c
@@ -0,0 +1,4 @@
+void die(void)
+{
+ char foo[BAR] = "1234"; /* { dg-error "undeclared|function|incomplete type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-4.c
new file mode 100644
index 000000000..782251fa3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-4.c
@@ -0,0 +1 @@
+struct a { char *b; } c[D]; /* { dg-error "undeclared" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-5.c
new file mode 100644
index 000000000..366397aef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/init-5.c
@@ -0,0 +1,4 @@
+/* Test for ICE after syntax error in initializer with range
+ designator: PR 35446. */
+
+int a[2][2] = { [0 ... 1] = { ; } }; /* { dg-error "expected expression" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c
new file mode 100644
index 000000000..d1d4b364b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/invalid_asm.c
@@ -0,0 +1,5 @@
+/* { dg-options "-ffat-lto-objects" } */
+asm_invalid_register_name()
+{
+ asm("":::"this_is_an_invalid_register_name"); /* { dg-error "unknown register" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/label-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/label-1.c
new file mode 100644
index 000000000..58d212f96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/label-1.c
@@ -0,0 +1,175 @@
+/* Test various diagnostics of ill-formed constructs involving labels. */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+extern void dummy(void);
+
+/* labels must be defined */
+void a(void)
+{
+ goto l; /* { dg-error "used but not defined" "no label" } */
+}
+
+/* warnings for labels defined but not used, or declared but not defined */
+void b(void)
+{
+ __label__ l;
+ l: /* { dg-warning "defined but not used" "no goto 1" } */
+ m: /* { dg-warning "defined but not used" "no goto 2" } */
+ dummy();
+}
+
+void c(void)
+{
+ __label__ l; /* { dg-warning "declared but not defined" "only __label__" } */
+ dummy();
+}
+
+/* can't have two labels with the same name in the same function */
+void d(void)
+{
+ l: dummy(); /* { dg-message "note: previous definition" "prev def same scope" } */
+ l: dummy(); /* { dg-error "duplicate label" "dup label same scope" } */
+ goto l;
+}
+
+/* even at different scopes */
+void e(void)
+{
+ l: dummy(); /* { dg-message "note: previous definition" "prev def diff scope" } */
+ {
+ l: dummy(); /* { dg-error "duplicate label" "dup label diff scope" } */
+ }
+ goto l;
+}
+
+/* but, with __label__, you can */
+void f(void)
+{
+ l: dummy();
+ {
+ __label__ l;
+ l: dummy(); /* { dg-warning "defined but not used" "unused shadow 1" } */
+ };
+ goto l; /* this reaches the outer l */
+}
+
+/* a __label__ is not visible outside its scope */
+void g(void)
+{
+ dummy();
+ {
+ __label__ l;
+ l: dummy();
+ goto l;
+ }
+ goto l; /* { dg-error "used but not defined" "label ref out of scope" } */
+}
+
+/* __label__ can appear at top level of a function, too...
+ ... but doesn't provide a definition of the label */
+void h(void)
+{
+ __label__ l;
+ dummy ();
+
+ goto l; /* { dg-error "used but not defined" "used, only __label__" } */
+}
+
+/* A nested function may not goto a label outside itself */
+void i(void)
+{
+ auto void nest(void);
+
+ l: nest();
+
+ void nest(void)
+ {
+ goto l; /* { dg-error "used but not defined" "nest use outer label" } */
+ }
+
+ goto l; /* reaches the outer l */
+}
+
+/* which means that a nested function may have its own label with the
+ same name as the outer function */
+void j(void)
+{
+ auto void nest(void);
+
+ l: nest();
+
+ void nest(void)
+ {
+ l: dummy(); /* { dg-warning "defined but not used" "nest label same name" } */
+ }
+
+ goto l; /* reaches the outer l */
+}
+
+/* and, turnabout, an outer function may not goto a label in a nested
+ function */
+void k(void)
+{
+ void nest(void)
+ {
+ l: dummy(); /* { dg-warning "defined but not used" "outer use nest label" } */
+ }
+
+ goto l; /* { dg-error "used but not defined" "outer use nest label" } */
+ nest();
+}
+
+/* not even with __label__ */
+void l(void)
+{
+ void nest(void)
+ {
+ __label__ l;
+ l: dummy(); /* { dg-warning "defined but not used" "outer use nest __label__" } */
+ }
+
+ goto l; /* { dg-error "used but not defined" "outer use nest __label__" } */
+ nest();
+}
+
+
+/* but if the outer label is declared with __label__, then a nested
+ function can goto that label (accomplishing a longjmp) */
+void m(void)
+{
+ __label__ l;
+ void nest(void) { goto l; }
+ nest();
+ dummy();
+ l:;
+}
+
+/* and that means the nested function cannot have its own label with
+ the same name as an outer label declared with __label__ */
+
+void n(void)
+{
+ __label__ l; /* { dg-message "note: previous declaration" "outer label decl" } */
+ void nest(void)
+ {
+ l: goto l; /* { dg-error "duplicate label" "inner label defn" } */
+ }
+
+ l:
+ nest();
+}
+
+/* unless the nested function uses __label__ too! */
+void o(void)
+{
+ __label__ l;
+ void nest(void)
+ {
+ __label__ l;
+ l: goto l;
+ }
+
+ l: goto l;
+ nest();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
new file mode 100644
index 000000000..6d4def7ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c
@@ -0,0 +1,14 @@
+/* Ensure that diagnostics for labels appear on the correct lineno.
+ by Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/23/2000. */
+
+void
+foo(int i)
+{
+ my_label: /* { dg-message "note: previous definition" "prev label" } */
+
+ i++;
+
+ my_label: /* { dg-error "duplicate label" "label lineno" } */
+
+ i++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/noncompile.exp b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/noncompile.exp
new file mode 100644
index 000000000..15460ef2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/noncompile.exp
@@ -0,0 +1,25 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Test error reporting.
+# Don't run this directory with any default CFLAGS, but do cycle through
+# torture options.
+
+load_lib gcc-dg.exp
+
+dg-init
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] ""
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
new file mode 100644
index 000000000..5f879c3f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
@@ -0,0 +1,11 @@
+/* Test that stray semicolon in old-style parameters is not
+ accepted. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f(a)
+ int a;; /* { dg-error "parse error|syntax error|expected declaration specifiers" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/old-style-parm-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/old-style-parm-2.c
new file mode 100644
index 000000000..1b156b770
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/old-style-parm-2.c
@@ -0,0 +1,11 @@
+/* Test that parameter without declaration specifiers in old-style
+ parameters is not accepted. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f(a)
+ a; /* { dg-error "parse error|syntax error|no type or storage class|expected declaration specifiers" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr23576.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr23576.c
new file mode 100644
index 000000000..384b0f68c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr23576.c
@@ -0,0 +1 @@
+struct ipr_path_entry path[0]; /* { dg-error "array type has incomplete element type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35444-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35444-1.c
new file mode 100644
index 000000000..f85588786
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35444-1.c
@@ -0,0 +1,3 @@
+/* PR 35444: ICE from pending VLA sizes in invalid parameter list. */
+void foo(int n, int a[n], int 0); /* { dg-error "expected" } */
+void bar() {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35444-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35444-2.c
new file mode 100644
index 000000000..43817b90d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35444-2.c
@@ -0,0 +1,4 @@
+/* PR 35444: ICE from pending VLA sizes in invalid parameter list.
+ Similar case to the PR, but with "..." before the syntax error. */
+void foo(int n, int a[n], ... 0); /* { dg-error "expected" } */
+void bar() {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c
new file mode 100644
index 000000000..9c31e9bb6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr35447-1.c
@@ -0,0 +1,7 @@
+/* ICE arising from preparing to enter a scope for a nested function
+ but never doing so. PR 35447. */
+
+void foo()
+{
+ ({ int i().; }); /* { dg-error "expected" } */
+} /* { dg-error "expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c
new file mode 100644
index 000000000..4f0744207
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c
@@ -0,0 +1,7 @@
+/* ICE from error_mark_node being wrapped in a C_MAYBE_CONST_EXPR. PR
+ 40033. */
+
+void foo()
+{
+ ({ 0,; }); /* { dg-error "expected" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr44517.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr44517.c
new file mode 100644
index 000000000..fa9a9df2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr44517.c
@@ -0,0 +1,18 @@
+/* PR c/44517: Improve diagnostic for misspelled typename in function declaration. */
+int f1(int x, pid_t y, long z, in t) {
+/* { dg-error "unknown type name 'pid_t'" "pid_t" { target *-*-* } 2 } */
+/* { dg-error "unknown type name 'in'" "in" { target *-*-* } 2 } */
+ return x + y + z + t;
+}
+
+int f2(int x, lon y, long z, ...){ /* { dg-error "unknown type name 'lon'" } */
+ return;
+}
+
+void f3(int n, int a[n], pid_t x); /* { dg-error "unknown type name 'pid_t'" } */
+void f4() {}
+void f5(int a, *b); /* { dg-error "expected declaration specifiers or" } */
+void f6(int a, b); /* { dg-error "unknown type name 'b'" } */
+void f7(int a, goto b); /* { dg-error "expected declaration specifiers or" } */
+void f8(int a, in goto); /* { dg-error "unknown type name 'in'" } */
+void f9(int a, in 1); /* { dg-error "unknown type name 'in'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr52290.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr52290.c
new file mode 100644
index 000000000..ac408fbd1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/pr52290.c
@@ -0,0 +1,3 @@
+/* { dg-error "undeclared here" "undeclared" { target *-*-* } 3 } */
+/* { dg-error "expected" "expected" { target *-*-* } 3 } */
+int f()[j]
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/redecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/redecl-1.c
new file mode 100644
index 000000000..732db0098
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/redecl-1.c
@@ -0,0 +1,9 @@
+/* Copyright 2000 Free Software Foundation */
+/* by Alexandre Oliva <aoliva@redhat.com> */
+
+int
+foo ()
+{
+ int bar; /* { dg-message "note: previous.*decl" "previous.*decl" } */
+ volatile int bar; /* { dg-error "conflicting type qualifiers" "conflicting type qualifiers" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/scope.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/scope.c
new file mode 100644
index 000000000..7f09c27cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/scope.c
@@ -0,0 +1,19 @@
+extern void abort (void);
+extern void exit (int);
+static int v = 3;
+
+f ()
+{
+ int v = 4;
+ {
+ extern int v; /* { dg-error "static" } */
+ if (v != 3)
+ abort ();
+ }
+}
+
+main ()
+{
+ f ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/undeclared-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/undeclared-1.c
new file mode 100644
index 000000000..5bb7c2a4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/undeclared-1.c
@@ -0,0 +1,8 @@
+/* Test for no ICE with an undeclared identifier in an enum in old-style
+ parameter decls. PR 12560. */
+/* { dg-options "-w" } */
+
+foo(c)
+ enum { a = b } c; /* { dg-error "undeclared|for each" } */
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/undeclared-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/undeclared-2.c
new file mode 100644
index 000000000..36cd0eaf1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/undeclared-2.c
@@ -0,0 +1,3 @@
+/* Invalid, but should not ICE. PRs 11944, 14734. */
+
+void foo(const int[i]); /* { dg-error "undeclared|for each" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
new file mode 100644
index 000000000..b8b7d3c31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
@@ -0,0 +1,8 @@
+#include <stdarg.h>
+
+f (int x, ...)
+{
+ va_list args;
+ va_start (args, bogus_variable); /* { dg-error "undeclared|for each function|not last named" } */
+ va_end (args);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/voidparam-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/voidparam-1.c
new file mode 100644
index 000000000..3378adddf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noncompile/voidparam-1.c
@@ -0,0 +1,17 @@
+/* Test for bad uses of 'void' in parameter lists. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+
+typedef const void cv;
+typedef volatile void vv;
+
+void foo0 (const void); /* { dg-error "parameter" "const void decl" } */
+void foo0a (cv); /* { dg-error "parameter" "const void decl" } */
+void foo1 (volatile void); /* { dg-error "parameter" "volatile void decl" } */
+void foo1a (vv); /* { dg-error "parameter" "volatile void decl" } */
+void foo2 (register void); /* { dg-error "parameter" "register void decl" } */
+
+void bar0 (const void) { } /* { dg-error "parameter" "const void defn" } */
+void bar0a (cv) { } /* { dg-error "parameter" "const void defn" } */
+void bar1 (volatile void) { } /* { dg-error "parameter" "volatile void defn" } */
+void bar1a (vv) { } /* { dg-error "parameter" "volatile void defn" } */
+void bar2 (register void) { } /* { dg-error "parameter" "register void defn" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-1.c
new file mode 100644
index 000000000..51a8a3373
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-1.c
@@ -0,0 +1,39 @@
+/* Test for the "nonnull" function attribute. */
+/* Origin: Jason Thorpe <thorpej@wasabisystems.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wnonnull" } */
+
+#include <stddef.h>
+
+extern void func1 (char *, char *, int) __attribute__((nonnull));
+
+extern void func2 (char *, char *) __attribute__((nonnull(1)));
+
+extern void func3 (char *, int, char *, int)
+ __attribute__((nonnull(1,3)));
+
+extern void func4 (char *, char *) __attribute__((nonnull(1)))
+ __attribute__((nonnull(2)));
+
+void
+foo (int i1, int i2, int i3, char *cp1, char *cp2, char *cp3)
+{
+ func1(cp1, cp2, i1);
+
+ func1(NULL, cp2, i1); /* { dg-warning "null" "null with argless nonnull 1" } */
+ func1(cp1, NULL, i1); /* { dg-warning "null" "null with argless nonnull 2" } */
+ func1(cp1, cp2, 0);
+
+ func2(cp1, NULL);
+ func2(NULL, cp1); /* { dg-warning "null" "null with single explicit nonnull" } */
+
+ func3(NULL, i2, cp3, i3); /* { dg-warning "null" "null with explicit nonnull 1" } */
+ func3(cp3, i2, NULL, i3); /* { dg-warning "null" "null with explicit nonnull 3" } */
+
+ func1(i1 ? cp1 : NULL, cp2, i3); /* { dg-warning "null" "null with cond expr rhs" } */
+ func1(i1 ? NULL : cp1, cp2, i3); /* { dg-warning "null" "null with cond expr lhs" } */
+ func1(i1 ? (i2 ? cp1 : NULL) : cp2, cp3, i3); /* { dg-warning "null" "null with nested cond expr" } */
+
+ func4(NULL, cp1); /* { dg-warning "null" "null with multiple attributes 1" } */
+ func4(cp1, NULL); /* { dg-warning "null" "null with multiple attributes 2" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-2.c
new file mode 100644
index 000000000..bd36d232d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-2.c
@@ -0,0 +1,16 @@
+/* Test for the invalid use of the "nonnull" function attribute. */
+/* Origin: Jason Thorpe <thorpej@wasabisystems.com> */
+/* { dg-do compile } */
+
+extern void func1 () __attribute__((nonnull)); /* { dg-error "without arguments" } */
+
+extern void func2 (char *) __attribute__((nonnull(2))); /* { dg-error "out-of-range operand" } */
+
+extern void func3 (char *) __attribute__((nonnull(foo))); /* { dg-error "invalid operand number" } */
+
+extern void func4 (int) __attribute__((nonnull(1))); /* { dg-error "references non-pointer" } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-3.c
new file mode 100644
index 000000000..040248c53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nonnull-3.c
@@ -0,0 +1,82 @@
+/* Test for the "nonnull" function attribute on builtins. Use the
+ "__builtin_" style below so we don't need prototypes. */
+/* Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> */
+/* { dg-do compile } */
+/* { dg-options "-Wnonnull" } */
+
+#include <stddef.h>
+
+void
+foo (void *p, char *s)
+{
+ __builtin_bzero (NULL, 0);
+ __builtin_bcopy (NULL, p, 0);
+ __builtin_bcopy (p, NULL, 0);
+ __builtin_bcmp (NULL, p, 0);
+ __builtin_bcmp (p, NULL, 0);
+ __builtin_index (NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_rindex (NULL, 16); /* { dg-warning "null" "null pointer check" } */
+
+ __builtin_memcpy (p, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_memcpy (NULL, p, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_memmove (p, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_memmove (NULL, p, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_memcmp (p, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_memcmp (NULL, p, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_memset (NULL, 0, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_mempcpy (p, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_mempcpy (NULL, p, 16); /* { dg-warning "null" "null pointer check" } */
+
+ __builtin_strcat (NULL, s); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strcat (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strncat (NULL, s, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strncat (s, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_stpcpy (NULL, s); /* { dg-warning "null" "null pointer check" } */
+ __builtin_stpcpy (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_stpncpy (NULL, s, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_stpncpy (s, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strcpy (NULL, s); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strcpy (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strncpy (NULL, s, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strncpy (s, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strcasecmp (NULL, s); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strcasecmp (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strncasecmp (NULL, s, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strncasecmp (s, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strcmp (NULL, s); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strcmp (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strncmp (NULL, s, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strncmp (s, NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strlen (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strstr (NULL, s); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strstr (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strpbrk (NULL, s); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strpbrk (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strspn (NULL, s); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strspn (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strchr (NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strrchr (NULL, 16); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strdup (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_strndup (NULL, 16); /* { dg-warning "null" "null pointer check" } */
+
+ __builtin_nan (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_nanf (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_nanl (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_nans (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_nansf (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_nansl (NULL); /* { dg-warning "null" "null pointer check" } */
+
+ __builtin_puts (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fputc (*s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fputs (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fputs (NULL, p); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fwrite (s, 16, 16, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fwrite (NULL, 16, 16, p); /* { dg-warning "null" "null pointer check" } */
+ __builtin_puts_unlocked (NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fputc_unlocked (*s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fputs_unlocked (s, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fputs_unlocked (NULL, p); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fwrite_unlocked (s, 16, 16, NULL); /* { dg-warning "null" "null pointer check" } */
+ __builtin_fwrite_unlocked (NULL, 16, 16, p); /* { dg-warning "null" "null pointer check" } */
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nop.h b/gcc-4.9/gcc/testsuite/gcc.dg/nop.h
new file mode 100644
index 000000000..a0c19a344
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nop.h
@@ -0,0 +1,7 @@
+#if defined (__ia64__) || defined (__s390__) || defined (__s390x__)
+#define NOP "nop 0"
+#elif defined (__MMIX__)
+#define NOP "swym 0"
+#else
+#define NOP "nop"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-1.c
new file mode 100644
index 000000000..a3796783a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-1.c
@@ -0,0 +1,59 @@
+/* Check for various valid and erroneous "noreturn" cases. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wmissing-noreturn" } */
+
+extern void exit (int);
+
+extern void foo1(void) __attribute__ ((__noreturn__));
+void
+foo1(void)
+{
+} /* { dg-warning "'noreturn' function does return" "detect falling off end of noreturn" } */
+
+extern void foo2(void) __attribute__ ((__noreturn__));
+void
+foo2(void)
+{
+ exit(0);
+} /* { dg-bogus "warning:" "this function should not get any warnings" } */
+
+extern void foo3(void);
+void
+foo3(void)
+{
+} /* { dg-bogus "warning:" "this function should not get any warnings" } */
+
+extern void foo4(void);
+void
+foo4(void) /* { dg-warning "candidate for attribute 'noreturn'" "detect noreturn candidate" } */
+{
+ exit(0);
+}
+
+extern void foo5(void) __attribute__ ((__noreturn__));
+void
+foo5(void)
+{
+ return; /* { dg-warning "'noreturn' has a 'return' statement" "detect invalid return" } */
+} /* { dg-warning "function does return" "detect return from noreturn" { target c } 37 } */
+
+extern void foo6(void);
+void
+foo6(void)
+{
+ return;
+} /* { dg-bogus "warning:" "this function should not get any warnings" } */
+
+extern void foo7(void);
+void
+foo7(void)
+{
+ foo6();
+} /* { dg-bogus "warning:" "this function should not get any warnings" } */
+
+extern void foo8(void) __attribute__ ((__noreturn__));
+void
+foo8(void)
+{
+ foo7();
+} /* { dg-warning "'noreturn' function does return" "detect return from tail call" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-2.c
new file mode 100644
index 000000000..4214de314
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-2.c
@@ -0,0 +1,12 @@
+/* Check for invalid "noreturn" warning. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wall" } */
+extern void abort (void) __attribute__ ((__noreturn__));
+
+void noreturn (int x) __attribute__ ((__noreturn__));
+
+void
+noreturn (int x)
+{
+ abort ();
+} /* { dg-bogus "does return" "noreturn does return" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-3.c
new file mode 100644
index 000000000..3e727d25f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-3.c
@@ -0,0 +1,10 @@
+/* Check for no "noreturn" warning in main. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wmissing-noreturn -fhosted" } */
+extern void exit (int) __attribute__ ((__noreturn__));
+
+int
+main (void)
+{
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-4.c
new file mode 100644
index 000000000..6fe144754
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-4.c
@@ -0,0 +1,10 @@
+/* Check for "noreturn" warning in main. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wmissing-noreturn -ffreestanding" } */
+extern void exit (int) __attribute__ ((__noreturn__));
+
+int
+main (void) /* { dg-warning "function might be candidate for attribute 'noreturn'" "warn for main" } */
+{
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-5.c
new file mode 100644
index 000000000..e69087a4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-5.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+/* Check that 'noreturn' and 'volatile extern' are compatible.
+ The testsuite uses -ansi -pedantic-errors by default, so this has
+ to override. */
+extern void xxx (int) __attribute__((noreturn));
+typedef void voidfn (int);
+__volatile extern voidfn xxx;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-6.c
new file mode 100644
index 000000000..eb1fd2437
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-6.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* Check for volatile behaviour. */
+extern int xxx (void);
+volatile extern int xxx (void); /* { dg-error "not compatible" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-7.c
new file mode 100644
index 000000000..fd2be2d56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-7.c
@@ -0,0 +1,42 @@
+/* PR optimization/13394 */
+/* Origin: Carlo Wood <carlo@gcc.gnu.org> */
+
+/* Verify that a bogus "function does return" warning is not issued
+ in presence of tail recursion within a noreturn function. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wreturn-type -Wmissing-noreturn" } */
+
+
+void f(void) __attribute__ ((__noreturn__));
+void _exit(int status) __attribute__ ((__noreturn__));
+
+int z = 0;
+
+void g() /* { dg-warning "might be candidate" } */
+{
+ if (++z > 10)
+ _exit(0);
+ g();
+}
+
+void f()
+{
+ if (++z > 10)
+ _exit(0);
+ f();
+} /* { dg-bogus "does return" } */
+
+int h() /* { dg-warning "might be candidate" } */
+{
+ if (++z > 10)
+ _exit(0);
+ return h();
+} /* { dg-bogus "end of non-void function" } */
+
+int k() /* { dg-warning "might be candidate" } */
+{
+ if (++z > 10)
+ _exit(0);
+ k();
+} /* { dg-warning "control reaches" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-8.c
new file mode 100644
index 000000000..1e75633c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/noreturn-8.c
@@ -0,0 +1,16 @@
+/* { dg-do run { target nonpic } } */
+/* { dg-options "-O2" } */
+void exit (int);
+void noreturn_autodetection_failed ();
+__attribute__ ((noinline))
+detect_noreturn ()
+{
+ exit (0);
+}
+int
+main (void)
+{
+ detect_noreturn ();
+ noreturn_autodetection_failed ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nrv1.c b/gcc-4.9/gcc/testsuite/gcc.dg/nrv1.c
new file mode 100644
index 000000000..ca700924a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nrv1.c
@@ -0,0 +1,28 @@
+/* Test that the NRV optimization doesn't cause a1 to change too soon. This
+ is equivalent to c++/19317. */
+/* { dg-do run } */
+
+void abort (void);
+
+struct A
+{
+ int i[100];
+};
+
+struct A a1;
+
+struct A f ()
+{
+ struct A a2;
+ a2.i[0] = 42;
+ /* a1.i[0] should still be 0 until we return. */
+ if (a1.i[0] != 0)
+ abort ();
+ return a2;
+}
+
+int main()
+{
+ a1 = f();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nrv2.c b/gcc-4.9/gcc/testsuite/gcc.dg/nrv2.c
new file mode 100644
index 000000000..e4d1f9aba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nrv2.c
@@ -0,0 +1,25 @@
+/* Test that the tree_nrv pass works by making sure that we don't generate
+ a memcpy. Throw in a bit of control flow to make its job a bit harder. */
+
+/* { dg-options "-O" } */
+
+struct A { int i[100]; };
+
+int b;
+
+struct A f ()
+{
+ struct A a;
+ if (b)
+ {
+ a.i[0] = 42;
+ return a;
+ }
+ else
+ {
+ a.i[42] = 1;
+ return a;
+ }
+}
+
+/* { dg-final { scan-assembler-not "memcpy" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nrv3.c b/gcc-4.9/gcc/testsuite/gcc.dg/nrv3.c
new file mode 100644
index 000000000..c28b8ec57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nrv3.c
@@ -0,0 +1,35 @@
+/* Verify that gimple-level NRV is occurring when values other than the
+ return slot are call-clobbered. */
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+#ifdef __SPU__
+/* SPU returns aggregates up to 1172 bytes in registers. */
+typedef struct { int x[300]; void *y; } S;
+#else
+typedef struct { int x[20]; void *y; } S;
+#endif
+typedef struct { int a; S b; } T;
+S nrv_candidate (void);
+void use_result (S, int);
+int *ptr;
+void foo (void)
+{
+ S result;
+ T result_arr[10][5];
+
+ int i;
+
+ ptr = &i;
+
+ /* i is call-clobbered for these calls, but result and result_arr
+ aren't. */
+ result = nrv_candidate ();
+ result_arr[3][4].b = nrv_candidate ();
+
+ use_result (result, i);
+ use_result (result_arr[3][4].b, i);
+}
+
+/* { dg-final { scan-tree-dump-times "return slot optimization" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nrv4.c b/gcc-4.9/gcc/testsuite/gcc.dg/nrv4.c
new file mode 100644
index 000000000..e213d860e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nrv4.c
@@ -0,0 +1,33 @@
+/* Verify that NRV optimizations are prohibited when the LHS is an
+ indirect reference to something that may be call-clobbered. */
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+typedef struct { int x[20]; void *y; } S;
+S nrv_candidate (void);
+void use_result (S);
+void make_escape (S *);
+S global_S;
+void foo (void)
+{
+ S *result;
+ S local_S;
+
+ /* We can't perform return slot optimization because global_S is
+ global and may be clobbered by nrv_candidate. */
+ result = &global_S;
+ *result = nrv_candidate ();
+ use_result (*result);
+
+ /* We can't perform return slot optimization because local_S is
+ call_clobbered (its address escapes prior to invoking
+ nrv_candidate). */
+ make_escape (&local_S);
+ result = &local_S;
+ *result = nrv_candidate ();
+ use_result (*result);
+}
+
+/* { dg-final { scan-tree-dump-times "return slot optimization" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/nrv5.c b/gcc-4.9/gcc/testsuite/gcc.dg/nrv5.c
new file mode 100644
index 000000000..629b0f329
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/nrv5.c
@@ -0,0 +1,28 @@
+/* Verify that NRV optimizations are prohibited when the LHS is
+ something that may be call-clobbered. */
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+typedef struct { int x[20]; void *y; } S;
+typedef struct { int a; S b; } T;
+S nrv_candidate (void);
+void use_result (S);
+void make_escape (S *);
+void foo (void)
+{
+ S result;
+ T result_arr[10][5];
+
+ make_escape (&result);
+ make_escape (&(result_arr[3][4].b));
+
+ /* Neither call should be allowed to use NRV optimization. */
+ result = nrv_candidate ();
+ result_arr[3][4].b = nrv_candidate ();
+
+ use_result (result);
+ use_result (result_arr[3][4].b);
+}
+
+/* { dg-final { scan-tree-dump-times "return slot optimization" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/null-pointer-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/null-pointer-1.c
new file mode 100644
index 000000000..8cc15c6d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/null-pointer-1.c
@@ -0,0 +1,20 @@
+/* PR c/13382 */
+/* Origin: Richard Hutchinson <richard.hutchinson@asa.co.uk> */
+
+/* Verify that the null initializer is converted to the right
+ pointer type. */
+
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct t
+{
+ int aMember;
+};
+
+struct t *const aPointer = 0;
+
+void foo()
+{
+ int anInt = (aPointer == 0) ? 0 : aPointer->aMember;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/old-style-asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-asm-1.c
new file mode 100644
index 000000000..8af007795
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-asm-1.c
@@ -0,0 +1,23 @@
+/* PR inline-asm/8832 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -dP" } */
+
+/* Verify that GCC doesn't optimize
+ old style asm instructions. */
+
+void foo(int v)
+{
+ if (v)
+ asm ("dummy1");
+
+ asm ("dummy2");
+
+ if (v)
+ asm ("dummy3");
+}
+
+/* The purpose of the test below is to check that there are two branches
+ in the generated code, supposedly corresponding to the if-statements.
+ It tries to check for jump_insn (set (pc) pattern, so that jump_insns
+ corresponding to return are not taken into account. */
+/* { dg-final { scan-assembler "jump_insn.*set \\(pc\\).*jump_insn.*set \\(pc\\)"} } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/old-style-param-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-param-1.c
new file mode 100644
index 000000000..1742069c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-param-1.c
@@ -0,0 +1,4 @@
+/* PR c/35750 */
+
+void foo(int[]);
+void foo(x) int x[](); {} /* { dg-error "array of functions" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-1.c
new file mode 100644
index 000000000..165ff9827
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-1.c
@@ -0,0 +1,13 @@
+/* Test for prototype followed by old-style definition, as in
+ dremf-type-compat-1.c but with a non-built-in function. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+float f (float, float);
+
+float
+f (x, y)
+ float x, y;
+{
+ return x + y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-2.c
new file mode 100644
index 000000000..e7e690e14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-2.c
@@ -0,0 +1,14 @@
+/* Test for prototype followed by old-style definition, as in
+ dremf-type-compat-2.c but with a non-built-in function. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+float f (float, float); /* { dg-warning "prototype declaration" } */
+
+float
+f (x, y)
+ float x; /* { dg-warning "promoted argument 'x' doesn't match prototype" } */
+ float y; /* { dg-warning "promoted argument 'y' doesn't match prototype" } */
+{
+ return x + y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-3.c
new file mode 100644
index 000000000..720367f2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-prom-3.c
@@ -0,0 +1,14 @@
+/* Test for prototype followed by old-style definition, as in
+ dremf-type-compat-3.c but with a non-built-in function. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+float f (float, float); /* { dg-error "prototype declaration" } */
+
+float
+f (x, y)
+ float x; /* { dg-error "promoted argument 'x' doesn't match prototype" } */
+ float y; /* { dg-error "promoted argument 'y' doesn't match prototype" } */
+{
+ return x + y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/old-style-then-proto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
new file mode 100644
index 000000000..7d76287b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
@@ -0,0 +1,44 @@
+/* Test for old-style definition followed by prototype declaration.
+ Mismatched qualifiers used to be wrongly forbidden. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f1() {}
+void f1(void); /* { dg-warning "prototype for 'f1' follows non-prototype definition" } */
+
+void f2() {} /* { dg-message "note: previous definition of 'f2' was here" } */
+void f2(int); /* { dg-error "prototype for 'f2' declares more arguments than previous old-style definition" } */
+
+void f3(a) int a; {} /* { dg-message "note: previous definition of 'f3' was here" } */
+void f3(void); /* { dg-error "prototype for 'f3' declares fewer arguments than previous old-style definition" } */
+
+void f4(a) int a; {}
+void f4(int); /* { dg-warning "prototype for 'f4' follows non-prototype definition" } */
+
+void f5(a) int a; {} /* { dg-message "note: previous definition of 'f5' was here" } */
+void f5(int, int); /* { dg-error "prototype for 'f5' declares more arguments than previous old-style definition" } */
+
+void f6(a) int a; {} /* { dg-message "note: previous definition of 'f6' was here" } */
+void f6(int, ...); /* { dg-error "conflicting types for 'f6'" } */
+
+void f7(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f7' was here" } */
+void f7(int); /* { dg-error "prototype for 'f7' declares fewer arguments than previous old-style definition" } */
+
+void f8(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f8' was here" } */
+void f8(int, ...); /* { dg-error "conflicting types for 'f8'" } */
+
+void f9(a, b) int a, b; {}
+void f9(int, int); /* { dg-warning "prototype for 'f9' follows non-prototype definition" } */
+
+void f10(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f10' was here" } */
+void f10(int, long); /* { dg-error "prototype for 'f10' declares argument 2 with incompatible type" } */
+
+void f11(a, b) int a, b; {} /* { dg-message "note: previous definition of 'f11' was here" } */
+void f11(long, int); /* { dg-error "prototype for 'f11' declares argument 1 with incompatible type" } */
+
+void f12(a, b) const int a; volatile int b; {}
+void f12(volatile int, const int); /* { dg-warning "prototype for 'f12' follows non-prototype definition" } */
+
+void f13(a) const int a[2][2]; {} /* { dg-message "note: previous definition of 'f13' was here" } */
+void f13(volatile int [2][2]); /* { dg-error "prototype for 'f13' declares argument 1 with incompatible type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapdi-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapdi-1.c
new file mode 100644
index 000000000..7d557f369
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapdi-1.c
@@ -0,0 +1,61 @@
+/* { dg-do compile { target arm*-*-* alpha*-*-* ia64*-*-* x86_64-*-* s390x-*-* powerpc*-*-* rs6000-*-* } } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -fdump-tree-bswap" } */
+
+#include <stdint.h>
+#define __const_swab64(x) ((uint64_t)( \
+ (((uint64_t)(x) & (uint64_t)0x00000000000000ffULL) << 56) | \
+ (((uint64_t)(x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
+ (((uint64_t)(x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
+ (((uint64_t)(x) & (uint64_t)0x00000000ff000000ULL) << 8) | \
+ (((uint64_t)(x) & (uint64_t)0x000000ff00000000ULL) >> 8) | \
+ (((uint64_t)(x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
+ (((uint64_t)(x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
+ (((uint64_t)(x) & (uint64_t)0xff00000000000000ULL) >> 56)))
+
+
+/* This byte swap implementation is used by the Linux kernel and the
+ GNU C library. */
+
+uint64_t
+swap64 (uint64_t in)
+{
+ return __const_swab64 (in);
+}
+
+/* This variant is currently used by libgcc. The difference is that
+ the bswap source and destination have a signed integer type which
+ requires a slightly higher search depth in order to dive through
+ the cast as well. */
+
+typedef int DItype __attribute__ ((mode (DI)));
+DItype
+swap64_b (DItype u)
+{
+ return ((((u) & 0xff00000000000000ull) >> 56)
+ | (((u) & 0x00ff000000000000ull) >> 40)
+ | (((u) & 0x0000ff0000000000ull) >> 24)
+ | (((u) & 0x000000ff00000000ull) >> 8)
+ | (((u) & 0x00000000ff000000ull) << 8)
+ | (((u) & 0x0000000000ff0000ull) << 24)
+ | (((u) & 0x000000000000ff00ull) << 40)
+ | (((u) & 0x00000000000000ffull) << 56));
+}
+
+/* The OpenSSL variant. */
+
+uint64_t
+swap64_c (uint64_t x)
+{
+ uint32_t a = x >> 32;
+ uint32_t b = (uint32_t) x;
+ return ((uint64_t) ((((((b)) >> (8)) | (((b)) << (32 - (8)))) & 0xff00ff00L)
+ | (((((b)) << (8)) | (((b)) >> (32 - (8)))) & 0x00ff00ffL)) << 32)
+ | (uint64_t) ((((((a)) >> (8)) | (((a)) << (32 - (8)))) & 0xff00ff00L)
+ | (((((a)) << (8)) | (((a)) >> (32 - (8)))) & 0x00ff00ffL));
+}
+
+
+/* { dg-final { scan-tree-dump-times "64 bit bswap implementation found at" 3 "bswap" } } */
+/* { dg-final { cleanup-tree-dump "bswap" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapdi-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapdi-2.c
new file mode 100644
index 000000000..6e2821db9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapdi-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile { target arm*-*-* alpha*-*-* ia64*-*-* x86_64-*-* s390x-*-* powerpc*-*-* rs6000-*-* } } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -fdump-tree-bswap" } */
+
+#include <stdint.h>
+
+/* A variant via unsigned short. */
+
+uint64_t
+swap64_c (uint64_t x)
+{
+ uint16_t a0 = x >> 48;
+ uint16_t a1 = x >> 32;
+ uint16_t a2 = x >> 16;
+ uint16_t a3 = x;
+
+ return ((uint64_t) (((a0 >> 8) & 0xff) | ((a0 << 8) & 0xff00)))
+ | ((uint64_t) (((a1 >> 8) & 0xff) | ((a1 << 8) & 0xff00)) << 16)
+ | ((uint64_t) (((a2 >> 8) & 0xff) | ((a2 << 8) & 0xff00)) << 32)
+ | ((uint64_t) (((a3 >> 8) & 0xff) | ((a3 << 8) & 0xff00)) << 48);
+}
+
+
+/* { dg-final { scan-tree-dump-times "64 bit bswap implementation found at" 1 "bswap" } } */
+/* { dg-final { cleanup-tree-dump "bswap" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapsi-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapsi-1.c
new file mode 100644
index 000000000..78238e309
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/optimize-bswapsi-1.c
@@ -0,0 +1,52 @@
+/* { dg-do compile { target arm*-*-* alpha*-*-* i?86-*-* powerpc*-*-* rs6000-*-* x86_64-*-* s390*-*-* } } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-O2 -fdump-tree-bswap" } */
+/* { dg-options "-O2 -fdump-tree-bswap -march=z900" { target s390-*-* } } */
+
+#include <stdint.h>
+
+#define __const_swab32(x) ((uint32_t)( \
+ (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \
+ (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \
+ (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \
+ (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
+
+/* This byte swap implementation is used by the Linux kernel and the
+ GNU C library. */
+
+uint32_t
+swap32_a (uint32_t in)
+{
+ return __const_swab32 (in);
+}
+
+/* The OpenSSH byte swap implementation. */
+uint32_t
+swap32_b (uint32_t in)
+{
+ uint32_t a;
+
+ a = (in << 16) | (in >> 16);
+ a = ((a & 0x00ff00ff) << 8) | ((a & 0xff00ff00) >> 8);
+
+ return a;
+}
+
+/* This variant is currently used by libgcc. The difference is that
+ the bswap source and destination have a signed integer type which
+ requires a slightly higher search depth in order to dive through
+ the cast as well. */
+
+typedef int SItype __attribute__ ((mode (SI)));
+
+SItype
+swap32_c (SItype u)
+{
+ return ((((u) & 0xff000000) >> 24)
+ | (((u) & 0x00ff0000) >> 8)
+ | (((u) & 0x0000ff00) << 8)
+ | (((u) & 0x000000ff) << 24));
+}
+
+/* { dg-final { scan-tree-dump-times "32 bit bswap implementation found at" 3 "bswap" } } */
+/* { dg-final { cleanup-tree-dump "bswap" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/opts-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/opts-1.c
new file mode 100644
index 000000000..3b90fe97d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/opts-1.c
@@ -0,0 +1,9 @@
+/* Test negative forms of various options are rejected. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-strict-aliasing=1 -Wno-strict-overflow=1 -fno-abi-version=1 -fno-lto-compression-level=1 -fno-tree-parallelize-loops=1" } */
+
+/* { dg-error "-fno-abi-version" "-fno-abi-version" { target *-*-* } 0 } */
+/* { dg-error "-fno-lto-compression-level" "-fno-lto-compression-level" { target *-*-* } 0 } */
+/* { dg-error "-fno-tree-parallelize-loops" "-fno-tree-parallelize-loops" { target *-*-* } 0 } */
+/* { dg-error "-Wno-strict-overflow" "-Wno-strict-overflow" { target *-*-* } 0 } */
+/* { dg-error "-Wno-strict-aliasing" "-Wno-strict-aliasing" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/opts-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/opts-2.c
new file mode 100644
index 000000000..f7683635a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/opts-2.c
@@ -0,0 +1,8 @@
+/* -O as an operand to another option should not take effect as an
+ optimization option. */
+/* { dg-do compile } */
+/* { dg-options "-I -O" } */
+
+#ifdef __OPTIMIZE__
+#error "__OPTIMIZE__ defined"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/opts-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/opts-3.c
new file mode 100644
index 000000000..50cd1db52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/opts-3.c
@@ -0,0 +1,7 @@
+/* Parameters of -Xassembler should not be interpreted as driver
+ options (and so cause the driver to exit prematurely, as in this
+ testcase, or have other unintended effects). */
+/* { dg-do compile } */
+/* { dg-options "-Xassembler -dumpmachine" } */
+
+int int x; /* { dg-error "two or more data types" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/opts-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/opts-4.c
new file mode 100644
index 000000000..11bfbed8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/opts-4.c
@@ -0,0 +1,9 @@
+/* --dump= should translate to -d with joined operand. */
+/* { dg-do compile } */
+/* { dg-options "--dump=a" } */
+
+void f (void)
+{
+}
+
+/* { dg-final { cleanup-rtl-dump "*" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/opts-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/opts-5.c
new file mode 100644
index 000000000..ab1e6f91d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/opts-5.c
@@ -0,0 +1,5 @@
+/* -fstack-limit should be rejected without an ICE. */
+/* { dg-do compile } */
+/* { dg-options "-fstack-limit" } */
+
+/* { dg-error "unrecognized command line option" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/opts-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/opts-6.c
new file mode 100644
index 000000000..b0441dc39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/opts-6.c
@@ -0,0 +1,6 @@
+/* Missing option arguments take precedence over wrong-language
+ warnings. */
+/* { dg-do compile } */
+/* { dg-options "-ftemplate-depth=" } */
+
+/* { dg-error "missing argument" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-1.c
new file mode 100644
index 000000000..0131c9da8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-1.c
@@ -0,0 +1,21 @@
+/* Test warning for ordered comparison pointer with null pointer constant. */
+/* Tested with no warning option. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+extern void z();
+void *p;
+
+void f() {
+ if (z >= 0)
+ z();
+ if (0 >= z)
+ z();
+ if (p >= (void*)0)
+ z();
+ if ((void*)0 >= p)
+ z();
+ if (z >= (void*)0) /* { dg-warning "distinct pointer types lacks a cast" } */
+ z();
+ if ((void*)0 >=z) /* { dg-warning "distinct pointer types lacks a cast" } */
+ z();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-2.c
new file mode 100644
index 000000000..a99d9c32f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-2.c
@@ -0,0 +1,21 @@
+/* Test warning for ordered comparison pointer with null pointer constant. */
+/* Tested with -pedantic. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+extern void z();
+void *p;
+
+void f() {
+ if (z >= 0) /* { dg-warning "ordered comparison of pointer with" } */
+ z();
+ if (0 >= z) /* { dg-warning "ordered comparison of pointer with" } */
+ z();
+ if (p >= (void*)0)
+ z();
+ if ((void*)0 >= p)
+ z();
+ if (z >= (void*)0) /* { dg-warning "distinct pointer types lacks a cast" } */
+ z();
+ if ((void*)0 >=z) /* { dg-warning "distinct pointer types lacks a cast" } */
+ z();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-3.c
new file mode 100644
index 000000000..2e4be4905
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-3.c
@@ -0,0 +1,21 @@
+/* Test warning for ordered comparison pointer with null pointer constant. */
+/* Test with -pedantic-errors. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+extern void z();
+void *p;
+
+void f() {
+ if ( z >= 0 ) /* { dg-error "ordered comparison of pointer with" } */
+ z();
+ if ( 0 >= z) /* { dg-error "ordered comparison of pointer with" } */
+ z();
+ if ( p >= (void*)0 )
+ z();
+ if ( (void*)0 >= p)
+ z();
+ if (z >= (void*)0) /* { dg-error "distinct pointer types lacks a cast" } */
+ z();
+ if ((void*)0 >=z) /* { dg-error "distinct pointer types lacks a cast" } */
+ z();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-4.c
new file mode 100644
index 000000000..ebe9eddf3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ordered-comparison-4.c
@@ -0,0 +1,21 @@
+/* Test warning for ordered comparison pointer with null pointer constant. */
+/* Test with -Wextra. */
+/* { dg-do compile } */
+/* { dg-options "-Wextra" } */
+extern void z();
+void *p;
+
+void f() {
+ if (z >= 0) /* { dg-warning "ordered comparison of pointer with" } */
+ z();
+ if (0 >= z) /* { dg-warning "ordered comparison of pointer with" } */
+ z();
+ if (p >= (void*)0) /* { dg-warning "ordered comparison of pointer with null pointer" } */
+ z();
+ if ((void*)0 >= p) /* { dg-warning "ordered comparison of pointer with null pointer" } */
+ z();
+ if (z >= (void*)0) /* { dg-warning "distinct pointer types lacks a cast" } */
+ z();
+ if ((void*)0 >=z) /* { dg-warning "distinct pointer types lacks a cast" } */
+ z();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/out-of-bounds-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/out-of-bounds-1.c
new file mode 100644
index 000000000..8cdf643eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/out-of-bounds-1.c
@@ -0,0 +1,13 @@
+/* PR rtl-optimization/33822 */
+/* Origin: Andrew Pinski <pinskia@gcc.gnu.org> */
+
+/* { dg-do compile } */
+/* { dg-options "-O -g" } */
+/* { dg-options "-O -g -mstrict-align" { target { powerpc*-*-linux* powerpc*-*-elf* } } } */
+
+void ProjectOverlay(const float localTextureAxis[2], char *lump)
+{
+ const void *d = &localTextureAxis;
+ int size = sizeof(float)*8 ;
+ __builtin_memcpy( &lump[ 0 ], d, size );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-1.c
new file mode 100644
index 000000000..db51a5ef1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-1.c
@@ -0,0 +1,25 @@
+/* PR optimization/13318 */
+/* Origin: <bremner@unb.ca> */
+/* Reduced testcase: Wolfgang Bangerth <bangerth@dealii.org> */
+
+/* Verify that the big multiplier doesn't cause an integer
+ overflow in the loop optimizer. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct S {
+ int key;
+ int rnext,rprev;
+};
+
+void foo(struct S* H)
+{
+ int i, k;
+ for (i=0; i<2; i++){
+ struct S* cell=H+k;
+ cell->key=i*(0xffffffffUL/2);
+ cell->rnext=k+(1-i);
+ cell->rprev=k+(1-i);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-2.c
new file mode 100644
index 000000000..23c22a65d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+/* PR c/24599 */
+
+int
+main (void)
+{
+ if ((_Bool)(__INT_MAX__ + 1)) /* { dg-warning "overflow in expression" } */
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-1.c
new file mode 100644
index 000000000..78909df36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-1.c
@@ -0,0 +1,124 @@
+/* Test for diagnostics for constant overflow. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+#include <limits.h>
+
+enum e {
+ E0 = INT_MAX,
+ /* Unsigned overflow wraps around. */
+ E1 = UINT_MAX + 1,
+ /* Overflow in an unevaluated part of an expression is OK (example
+ in the standard). */
+ E2 = 2 || 1 / 0,
+ E3 = 1 / 0, /* { dg-warning "10:division by zero" } */
+ /* { dg-error "3:enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */
+ /* But as in DR#031, the 1/0 in an evaluated subexpression means the
+ whole expression violates the constraints. */
+ E4 = 0 * (1 / 0), /* { dg-warning "15:division by zero" } */
+ /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { target *-*-* } 19 } */
+ E5 = INT_MAX + 1, /* { dg-warning "16:integer overflow in expression" } */
+ /* Again, overflow in evaluated subexpression. */
+ E6 = 0 * (INT_MAX + 1), /* { dg-warning "21:integer overflow in expression" } */
+ /* A cast does not constitute overflow in conversion. */
+ E7 = (char) INT_MAX
+};
+
+struct s {
+ int a;
+ int : 0 * (1 / 0); /* { dg-warning "16:division by zero" } */
+ /* { dg-error "not an integer constant" "22:integer constant" { target *-*-* } 30 } */
+ int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
+};
+
+void
+f (void)
+{
+ /* This expression is not required to be a constant expression, so
+ it should just involve undefined behavior at runtime. */
+ int c = INT_MAX + 1; /* { dg-warning "19:integer overflow in expression" } */
+}
+
+/* But this expression does need to be constant. */
+static int sc = INT_MAX + 1; /* { dg-warning "25:integer overflow in expression" } */
+
+/* The first two of these involve overflow, so are not null pointer
+ constants. The third has the overflow in an unevaluated
+ subexpression, so is a null pointer constant. */
+void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
+/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 49 } */
+void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */
+/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 51 } */
+/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 51 } */
+void *r = (1 ? 0 : INT_MAX+1);
+
+void
+g (int i)
+{
+ switch (i)
+ {
+ case 0 * (1/0): /* { dg-warning "division by zero" } */
+ /* { dg-error "case label does not reduce to an integer constant" "constant" { target *-*-* } 61 } */
+ ;
+ case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */
+ ;
+ }
+}
+
+int
+h (void)
+{
+ return INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+}
+
+int
+h1 (void)
+{
+ return INT_MAX + 1 - INT_MAX; /* { dg-warning "integer overflow in expression" } */
+}
+
+void fuc (unsigned char);
+void fsc (signed char);
+
+void
+h2 (void)
+{
+ fsc (SCHAR_MAX + 1);
+ fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fsc (UCHAR_MAX);
+ fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fuc (-1);
+ fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ fuc (SCHAR_MIN);
+ fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+}
+
+void fui (unsigned int);
+void fsi (signed int);
+
+int si;
+unsigned ui;
+
+void
+h2i (int x)
+{
+ /* For some reason, we only give certain warnings for implicit
+ conversions among values of the same precision with -Wconversion,
+ while we don't give others at all. */
+ fsi ((unsigned)INT_MAX + 1);
+ si = (unsigned)INT_MAX + 1;
+ si = x ? (unsigned)INT_MAX + 1 : 1;
+ fsi ((unsigned)INT_MAX + 2);
+ si = (unsigned)INT_MAX + 2;
+ si = x ? (unsigned)INT_MAX + 2 : 1;
+ fsi (UINT_MAX);
+ si = UINT_MAX;
+ fui (-1);
+ ui = -1;
+ ui = x ? -1 : 1U;
+ fui (INT_MIN);
+ ui = INT_MIN;
+ ui = x ? INT_MIN : 1U;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-2.c
new file mode 100644
index 000000000..f6595d508
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-2.c
@@ -0,0 +1,135 @@
+/* Test for diagnostics for constant overflow. Test with -Wtraditional-conversion. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Wtraditional-conversion" } */
+
+#include <limits.h>
+
+enum e {
+ E0 = INT_MAX,
+ /* Unsigned overflow wraps around. */
+ E1 = UINT_MAX + 1,
+ /* Overflow in an unevaluated part of an expression is OK (example
+ in the standard). */
+ E2 = 2 || 1 / 0,
+ E3 = 1 / 0, /* { dg-warning "division by zero" } */
+ /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */
+ /* But as in DR#031, the 1/0 in an evaluated subexpression means the
+ whole expression violates the constraints. */
+ E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */
+ /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { target *-*-* } 19 } */
+ E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */
+ /* Again, overflow in evaluated subexpression. */
+ E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */
+ /* A cast does not constitute overflow in conversion. */
+ E7 = (char) INT_MAX
+};
+
+struct s {
+ int a;
+ int : 0 * (1 / 0); /* { dg-warning "division by zero" } */
+ /* { dg-error "not an integer constant" "integer constant" { target *-*-* } 30 } */
+ int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
+};
+
+void
+f (void)
+{
+ /* This expression is not required to be a constant expression, so
+ it should just involve undefined behavior at runtime. */
+ int c = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+}
+
+/* But this expression does need to be constant. */
+static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+
+/* The first two of these involve overflow, so are not null pointer
+ constants. The third has the overflow in an unevaluated
+ subexpression, so is a null pointer constant. */
+void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
+/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 49 } */
+void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */
+/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 51 } */
+/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 51 } */
+void *r = (1 ? 0 : INT_MAX+1);
+
+void
+g (int i)
+{
+ switch (i)
+ {
+ case 0 * (1/0): /* { dg-warning "division by zero" } */
+ /* { dg-error "case label does not reduce to an integer constant" "constant" { target *-*-* } 61 } */
+ ;
+ case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */
+ ;
+ }
+}
+
+int
+h (void)
+{
+ return INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+}
+
+int
+h1 (void)
+{
+ return INT_MAX + 1 - INT_MAX; /* { dg-warning "integer overflow in expression" } */
+}
+
+void fuc (unsigned char);
+void fsc (signed char);
+
+void
+h2 (void)
+{
+ fsc (SCHAR_MAX + 1);
+ /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 87 } */
+ fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 89 } */
+ fsc (UCHAR_MAX);
+ /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 91 } */
+ fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ /* { dg-warning "passing argument 1 of 'fsc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 93 } */
+ fuc (-1);
+ /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 95 } */
+ fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 97 } */
+ fuc (SCHAR_MIN);
+ /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 99 } */
+ fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 101 } */
+ fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ /* { dg-warning "passing argument 1 of 'fuc' with different width due to prototype" "-Wtraditional-conversion" { target *-*-* } 103 } */
+}
+
+void fui (unsigned int);
+void fsi (signed int);
+
+int si;
+unsigned ui;
+
+void
+h2i (int x)
+{
+ /* For some reason, we only give certain warnings for implicit
+ conversions among values of the same precision with -Wtraditional-conversion,
+ while we don't give others at all. */
+ fsi ((unsigned)INT_MAX + 1); /* { dg-warning "passing argument 1 of 'fsi' as signed due to prototype" } */
+ si = (unsigned)INT_MAX + 1;
+ si = x ? (unsigned)INT_MAX + 1 : 1;
+ fsi ((unsigned)INT_MAX + 2); /* { dg-warning "passing argument 1 of 'fsi' as signed due to prototype" } */
+ si = (unsigned)INT_MAX + 2;
+ si = x ? (unsigned)INT_MAX + 2 : 1;
+ fsi (UINT_MAX); /* { dg-warning "passing argument 1 of 'fsi' as signed due to prototype" } */
+ si = UINT_MAX;
+ fui (-1);
+ /* { dg-warning "passing argument 1 of 'fui' as unsigned due to prototype" "-Wtraditional-conversion" { target *-*-* } 127 } */
+ ui = -1;
+ ui = x ? -1 : 1U;
+ fui (INT_MIN);
+ /* { dg-warning "passing argument 1 of 'fui' as unsigned due to prototype" "-Wtraditional-conversion" { target *-*-* } 131 } */
+ ui = INT_MIN;
+ ui = x ? INT_MIN : 1U;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-3.c
new file mode 100644
index 000000000..fae26d410
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-3.c
@@ -0,0 +1,131 @@
+/* Test for diagnostics for constant overflow. Test with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic" } */
+
+#include <limits.h>
+
+enum e {
+ E0 = INT_MAX,
+ /* Unsigned overflow wraps around. */
+ E1 = UINT_MAX + 1,
+ /* Overflow in an unevaluated part of an expression is OK (example
+ in the standard). */
+ E2 = 2 || 1 / 0,
+ E3 = 1 / 0, /* { dg-warning "division by zero" } */
+ /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */
+ /* But as in DR#031, the 1/0 in an evaluated subexpression means the
+ whole expression violates the constraints. */
+ E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */
+ /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { target *-*-* } 19 } */
+ E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */
+ /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 21 } */
+ /* Again, overflow in evaluated subexpression. */
+ E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */
+ /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 24 } */
+ /* A cast does not constitute overflow in conversion. */
+ E7 = (char) INT_MAX
+};
+
+struct s {
+ int a;
+ int : 0 * (1 / 0); /* { dg-warning "division by zero" } */
+ /* { dg-error "not an integer constant" "integer constant" { target *-*-* } 32 } */
+ int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
+ /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 34 } */
+};
+
+void
+f (void)
+{
+ /* This expression is not required to be a constant expression, so
+ it should just involve undefined behavior at runtime. */
+ int c = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+
+}
+
+/* But this expression does need to be constant. */
+static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+/* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 48 } */
+
+/* The first two of these involve overflow, so are not null pointer
+ constants. The third has the overflow in an unevaluated
+ subexpression, so is a null pointer constant. */
+void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
+/* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 54 } */
+/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 54 } */
+void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */
+/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 57 } */
+/* { dg-warning "initialization makes pointer from integer without a cast" "null" { target *-*-* } 57 } */
+void *r = (1 ? 0 : INT_MAX+1);
+
+void
+g (int i)
+{
+ switch (i)
+ {
+ case 0 * (1/0): /* { dg-warning "division by zero" } */
+ /* { dg-error "case label does not reduce to an integer constant" "constant" { target *-*-* } 67 } */
+ ;
+ case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */
+ /* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 70 } */
+ ;
+ }
+}
+
+int
+h (void)
+{
+ return INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+}
+
+int
+h1 (void)
+{
+ return INT_MAX + 1 - INT_MAX; /* { dg-warning "integer overflow in expression" } */
+}
+
+void fuc (unsigned char);
+void fsc (signed char);
+
+void
+h2 (void)
+{
+ fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */
+ fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fuc (-1);
+ fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ fuc (SCHAR_MIN);
+ fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+}
+
+void fui (unsigned int);
+void fsi (signed int);
+
+int si;
+unsigned ui;
+
+void
+h2i (int x)
+{
+ /* For some reason, we only give certain warnings for implicit
+ conversions among values of the same precision with -Wconversion,
+ while we don't give others at all. */
+ fsi ((unsigned)INT_MAX + 1);
+ si = (unsigned)INT_MAX + 1;
+ si = x ? (unsigned)INT_MAX + 1 : 1;
+ fsi ((unsigned)INT_MAX + 2);
+ si = (unsigned)INT_MAX + 2;
+ si = x ? (unsigned)INT_MAX + 2 : 1;
+ fsi (UINT_MAX);
+ si = UINT_MAX;
+ fui (-1);
+ ui = -1;
+ ui = x ? -1 : 1U;
+ fui (INT_MIN);
+ ui = INT_MIN;
+ ui = x ? INT_MIN : 1U;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-4.c
new file mode 100644
index 000000000..464533a36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-4.c
@@ -0,0 +1,131 @@
+/* Test for diagnostics for constant overflow. Test with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+#include <limits.h>
+
+enum e {
+ E0 = INT_MAX,
+ /* Unsigned overflow wraps around. */
+ E1 = UINT_MAX + 1,
+ /* Overflow in an unevaluated part of an expression is OK (example
+ in the standard). */
+ E2 = 2 || 1 / 0,
+ E3 = 1 / 0, /* { dg-warning "division by zero" } */
+ /* { dg-error "enumerator value for 'E3' is not an integer constant" "enum error" { target *-*-* } 15 } */
+ /* But as in DR#031, the 1/0 in an evaluated subexpression means the
+ whole expression violates the constraints. */
+ E4 = 0 * (1 / 0), /* { dg-warning "division by zero" } */
+ /* { dg-error "enumerator value for 'E4' is not an integer constant" "enum error" { target *-*-* } 19 } */
+ E5 = INT_MAX + 1, /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 21 } */
+ /* Again, overflow in evaluated subexpression. */
+ E6 = 0 * (INT_MAX + 1), /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 24 } */
+ /* A cast does not constitute overflow in conversion. */
+ E7 = (char) INT_MAX
+};
+
+struct s {
+ int a;
+ int : 0 * (1 / 0); /* { dg-warning "division by zero" } */
+ /* { dg-error "not an integer constant" "integer constant" { target *-*-* } 32 } */
+ int : 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 34 } */
+};
+
+void
+f (void)
+{
+ /* This expression is not required to be a constant expression, so
+ it should just involve undefined behavior at runtime. */
+ int c = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+
+}
+
+/* But this expression does need to be constant. */
+static int sc = INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 48 } */
+
+/* The first two of these involve overflow, so are not null pointer
+ constants. The third has the overflow in an unevaluated
+ subexpression, so is a null pointer constant. */
+void *p = 0 * (INT_MAX + 1); /* { dg-warning "integer overflow in expression" } */
+/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 54 } */
+/* { dg-error "initialization makes pointer from integer without a cast" "null" { target *-*-* } 54 } */
+void *q = 0 * (1 / 0); /* { dg-warning "division by zero" } */
+/* { dg-error "initializer element is not computable at load time" "constant" { target *-*-* } 57 } */
+/* { dg-error "initialization makes pointer from integer without a cast" "null" { target *-*-* } 57 } */
+void *r = (1 ? 0 : INT_MAX+1);
+
+void
+g (int i)
+{
+ switch (i)
+ {
+ case 0 * (1/0): /* { dg-warning "division by zero" } */
+ /* { dg-error "case label does not reduce to an integer constant" "constant" { target *-*-* } 67 } */
+ ;
+ case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */
+ /* { dg-error "overflow in constant expression" "constant" { target *-*-* } 70 } */
+ ;
+ }
+}
+
+int
+h (void)
+{
+ return INT_MAX + 1; /* { dg-warning "integer overflow in expression" } */
+}
+
+int
+h1 (void)
+{
+ return INT_MAX + 1 - INT_MAX; /* { dg-warning "integer overflow in expression" } */
+}
+
+void fuc (unsigned char);
+void fsc (signed char);
+
+void
+h2 (void)
+{
+ fsc (SCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fsc (SCHAR_MIN - 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fsc (UCHAR_MAX); /* { dg-warning "overflow in implicit constant conversion" } */
+ fsc (UCHAR_MAX + 1); /* { dg-warning "overflow in implicit constant conversion" } */
+ fuc (-1);
+ fuc (UCHAR_MAX + 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ fuc (SCHAR_MIN);
+ fuc (SCHAR_MIN - 1); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ fuc (-UCHAR_MAX); /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+}
+
+void fui (unsigned int);
+void fsi (signed int);
+
+int si;
+unsigned ui;
+
+void
+h2i (int x)
+{
+ /* For some reason, we only give certain warnings for implicit
+ conversions among values of the same precision with -Wconversion,
+ while we don't give others at all. */
+ fsi ((unsigned)INT_MAX + 1);
+ si = (unsigned)INT_MAX + 1;
+ si = x ? (unsigned)INT_MAX + 1 : 1;
+ fsi ((unsigned)INT_MAX + 2);
+ si = (unsigned)INT_MAX + 2;
+ si = x ? (unsigned)INT_MAX + 2 : 1;
+ fsi (UINT_MAX);
+ si = UINT_MAX;
+ fui (-1);
+ ui = -1;
+ ui = x ? -1 : 1U;
+ fui (INT_MIN);
+ ui = INT_MIN;
+ ui = x ? INT_MIN : 1U;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-5.c
new file mode 100644
index 000000000..472d4a7ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-5.c
@@ -0,0 +1,7 @@
+/* PR c/27273 */
+/* { dg-do compile } */
+/* { dg-options "-Woverflow" } */
+
+unsigned char rx_async(unsigned char p) {
+ return p & 512; /* { dg-warning "overflow in implicit constant conversion" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-6.c
new file mode 100644
index 000000000..b3bc73610
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-6.c
@@ -0,0 +1,18 @@
+/* Test non-constant operands in overflowed expressions. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Woverflow" } */
+
+#include <limits.h>
+
+int
+h1 (int x)
+{
+ return x * (0 * (INT_MAX + 1)); /* { dg-warning "integer overflow in expression" } */
+}
+
+int
+h2 (int x)
+{
+ return ((INT_MAX + 1) * 0) * x; /* { dg-warning "integer overflow in expression" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-7.c
new file mode 100644
index 000000000..7c0ce68df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-7.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+int f(char *device)
+{
+ return device == ((char *)0 + ~0UL); /* { dg-bogus "overflow" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-8.c
new file mode 100644
index 000000000..43ecda0a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/overflow-warn-8.c
@@ -0,0 +1,23 @@
+#include <limits.h>
+
+void foo (int j)
+{
+ int i1 = (int)(double)1.0 + INT_MAX; /* { dg-warning "integer overflow" } */
+ int i2 = (int)(double)1 + INT_MAX; /* { dg-warning "integer overflow" } */
+ int i3 = 1 + INT_MAX; /* { dg-warning "integer overflow" } */
+ int i4 = +1 + INT_MAX; /* { dg-warning "integer overflow" } */
+ int i5 = (int)((double)1.0 + INT_MAX);
+ int i6 = (double)1.0 + INT_MAX; /* { dg-warning "overflow in implicit constant" } */
+ int i7 = 0 ? (int)(double)1.0 + INT_MAX : 1;
+ int i8 = 1 ? 1 : (int)(double)1.0 + INT_MAX;
+ int i9 = j ? (int)(double)1.0 + INT_MAX : 1; /* { dg-warning "integer overflow" } */
+ unsigned int i10 = 0 ? (int)(double)1.0 + INT_MAX : 9U;
+ unsigned int i11 = 1 ? 9U : (int)(double)1.0 + INT_MAX;
+ unsigned int i12 = j ? (int)(double)1.0 + INT_MAX : 9U; /* { dg-warning "integer overflow" } */
+ int i13 = 1 || (int)(double)1.0 + INT_MAX < 0;
+ int i14 = 0 && (int)(double)1.0 + INT_MAX < 0;
+ int i15 = 0 || (int)(double)1.0 + INT_MAX < 0; /* { dg-warning "integer overflow" } */
+ int i16 = 1 && (int)(double)1.0 + INT_MAX < 0; /* { dg-warning "integer overflow" } */
+ int i17 = j || (int)(double)1.0 + INT_MAX < 0; /* { dg-warning "integer overflow" } */
+ int i18 = j && (int)(double)1.0 + INT_MAX < 0; /* { dg-warning "integer overflow" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-1.c
new file mode 100644
index 000000000..e019e7837
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-1.c
@@ -0,0 +1,154 @@
+/* Test semantics of #pragma pack.
+ Contributed by Mike Coleman <mcoleman2@kc.rr.com> */
+
+/* { dg-do compile { target { ! default_packed } } } */
+
+/* Mainly we're just testing whether pushing and popping seem to be
+ working correctly, and verifying the (alignment == 1) case, which
+ is really the only reason anyone would use this pragma anyway. */
+
+#include <stddef.h>
+
+/* generalized compile-time test expression */
+#define test(n, expr) int test_##n [(expr) ? 1 : -1]
+
+/* Round V down to multiple of A */
+#define floor(v,a) ((v) / (a) * (a))
+
+/* Offset of field with alignment A in structure S after a field P of
+ type PT */
+#define offset(s,p,pt,a) \
+ floor ((offsetof(struct s, p) + sizeof (pt) + (a) - 1), a)
+
+/* regular minimum */
+#define min(a,b) ((a) < (b) ? (a) : (b))
+
+/* Check that field A (type AT) followed by field B (type BT) are
+ packed according to P */
+#define test_pack(n, a, at, b, bt, p) \
+ test(n, offsetof (struct SNAME, b) \
+ == min (offset (SNAME,a,at,__alignof__(bt)), \
+ offset (SNAME,a,at,p)))
+
+/* Test offset of field F in structs s1 and s2 are the same. */
+#define test_offset(n, s1, s2, f) \
+ test (n, (offsetof(struct s1, f) == offsetof(struct s2, f)))
+
+#define SNAME s0
+#include "pack-test-1.h"
+
+#undef SNAME
+#define SNAME s1
+#pragma pack(push, p1, 1)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_pack(0, f0, char, f1, double, 1);
+ test_pack(1, f2, short, f3, double, 1);
+ test_pack(2, f4, int, f5, double, 1);
+}
+
+#undef SNAME
+#define SNAME s2
+#pragma pack(push, p2, 2)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_pack(0, f0, char, f1, double, 2);
+ test_pack(1, f2, short, f3, double, 2);
+ test_pack(2, f4, int, f5, double, 2);
+}
+
+#undef SNAME
+#define SNAME s3
+#pragma pack(push, p3, 4)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_pack(0, f0, char, f1, double, 4);
+ test_pack(1, f2, short, f3, double, 4);
+ test_pack(2, f4, int, f5, double, 4);
+}
+
+#undef SNAME
+#define SNAME s4
+#pragma pack(pop)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_pack(0, f0, char, f1, double, 2);
+ test_pack(1, f2, short, f3, double, 2);
+ test_pack(2, f4, int, f5, double, 2);
+}
+
+#undef SNAME
+#define SNAME s5
+#pragma pack(pop, p2)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_pack(0, f0, char, f1, double, 1);
+ test_pack(1, f2, short, f3, double, 1);
+ test_pack(2, f4, int, f5, double, 1);
+}
+
+#undef SNAME
+#define SNAME s6
+#pragma pack(pop, p1)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_offset (0, s0, SNAME, f0);
+ test_offset (1, s0, SNAME, f1);
+ test_offset (2, s0, SNAME, f2);
+ test_offset (3, s0, SNAME, f3);
+ test_offset (4, s0, SNAME, f4);
+ test_offset (5, s0, SNAME, f5);
+}
+
+#undef SNAME
+#define SNAME s7
+#pragma pack(1)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_pack(0, f0, char, f1, double, 1);
+ test_pack(1, f2, short, f3, double, 1);
+ test_pack(2, f4, int, f5, double, 1);
+}
+
+#undef SNAME
+#define SNAME s8
+#pragma pack(push, p2, 2)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_pack(0, f0, char, f1, double, 2);
+ test_pack(1, f2, short, f3, double, 2);
+ test_pack(2, f4, int, f5, double, 2);
+}
+
+#undef SNAME
+#define SNAME s9
+#pragma pack(pop)
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_pack(0, f0, char, f1, double, 1);
+ test_pack(1, f2, short, f3, double, 1);
+ test_pack(2, f4, int, f5, double, 1);
+}
+
+#undef SNAME
+#define SNAME s10
+#pragma pack()
+#include "pack-test-1.h"
+
+void SNAME() {
+ test_offset (0, s0, SNAME, f0);
+ test_offset (1, s0, SNAME, f1);
+ test_offset (2, s0, SNAME, f2);
+ test_offset (3, s0, SNAME, f3);
+ test_offset (4, s0, SNAME, f4);
+ test_offset (5, s0, SNAME, f5);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-1.h
new file mode 100644
index 000000000..f4889fabe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-1.h
@@ -0,0 +1,12 @@
+/* Helper file, included repeatedly by pack-test-1.c. */
+
+struct SNAME {
+ char f0;
+ double f1;
+ short f2;
+ double f3;
+ int f4;
+ double f5;
+ double f6;
+ double f7;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-2.c
new file mode 100644
index 000000000..5c2f6ae46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-2.c
@@ -0,0 +1,25 @@
+/* Tests for syntax checking of #pragma pack.
+ Contributed by Mike Coleman <mcoleman2@kc.rr.com> */
+
+/* { dg-do compile } */
+
+#pragma pack(pop) /* { dg-warning "without matching" } */
+
+#pragma pack(push)
+#pragma pack(pop) /* reset */
+
+#pragma pack(push, foo, 1)
+#pragma pack(pop, foo, 1) /* { dg-warning "malformed" } (/
+#pragma pack(pop) /* reset */
+
+#pragma pack(push, foo, 1)
+#pragma pack(pop, bar) /* { dg-warning "without matching" } */
+#pragma pack(pop) /* reset */
+
+#pragma pack(push, foo, 1)
+#pragma pack(pop)
+#pragma pack(pop, foo) /* { dg-warning "without matching" } */
+
+#pragma pack(push, foo, 3) /* { dg-warning "small power of two" } */
+
+extern int blah; /* prevent "ISO C forbids an empty translation unit" */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-3.c
new file mode 100644
index 000000000..8b0390378
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-3.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+ Contributed by Nathan Sidwell 15 Jul 2003 <nathan@codesourcery.com> */
+
+/* you should not be able to pack a typedef to a struct, only the
+ underlying struct can be packed. */
+
+/* ok */
+struct u1
+{
+ char field1;
+ short field2;
+ int field3;
+};
+
+/* ok */
+typedef struct p1 {
+ char field1;
+ short field2;
+ int field3;
+} __attribute__ ((packed)) p1_t1;
+
+/* ok */
+typedef struct __attribute__ ((packed)) p2 {
+ char field1;
+ short field2;
+ int field3;
+} p2_t1;
+
+int ary1[sizeof (struct p1) == sizeof (p1_t1) ? 1 : -1];
+int ary2[sizeof (struct p2) == sizeof (p2_t1) ? 1 : -1];
+int ary3[sizeof (struct p1) == sizeof (struct p2) ? 1 : -1];
+
+/* not ok */
+typedef struct u1 __attribute__ ((packed)) u1_t1; /* { dg-warning "attribute ignored" "" }*/
+typedef struct u1 u1_t2 __attribute__ ((packed)); /* { dg-warning "attribute ignored" "" }*/
+
+typedef struct p3 {
+ char field1;
+ short field2;
+ int field3;
+} p3_t1 __attribute__ ((packed)); /* { dg-warning "attribute ignored" "" }*/
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-4.c
new file mode 100644
index 000000000..1ad8ee4fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-4.c
@@ -0,0 +1,36 @@
+/* PR c/11885
+ Bug: flag4 was allocated into the same byte as the other flags.
+ { dg-options "" }
+ { dg-do run } */
+
+extern void abort (void);
+
+typedef unsigned char uint8_t;
+
+typedef struct {
+ uint8_t flag1:2;
+ uint8_t flag2:1;
+ uint8_t flag3:1;
+
+ uint8_t flag4;
+
+} __attribute__ ((packed)) MyType;
+
+int main (void)
+{
+ MyType a;
+ MyType *b = &a;
+
+ b->flag1 = 0;
+ b->flag2 = 0;
+ b->flag3 = 0;
+
+ b->flag4 = 0;
+
+ b->flag4++;
+
+ if (b->flag1 != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-5.c
new file mode 100644
index 000000000..3a52a002b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pack-test-5.c
@@ -0,0 +1,22 @@
+/* PR c/11446: packed on a struct takes precedence over aligned on the type
+ of a field. */
+/* { dg-do run } */
+/* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */
+
+extern void abort (void);
+
+struct A {
+ double d;
+} __attribute__ ((aligned));
+
+struct B {
+ char c;
+ struct A a;
+} __attribute__ ((packed));
+
+int main ()
+{
+ if (sizeof (struct B) != sizeof (char) + sizeof (struct A))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/packed-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/packed-array.c
new file mode 100644
index 000000000..b57f3ac03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/packed-array.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-inline" } */
+
+struct usb_interface_descriptor {
+ unsigned short wMaxPacketSize;
+ char e;
+} __attribute__ ((packed));
+
+struct usb_device {
+ int devnum;
+ struct usb_interface_descriptor if_desc[2];
+};
+
+extern int printf (const char *, ...);
+
+void foo (unsigned short a)
+{
+ printf ("%d\n", a);
+}
+
+struct usb_device ndev;
+
+void usb_set_maxpacket(int n)
+{
+ int i;
+
+ for(i=0; i<n;i++)
+ foo((&ndev)->if_desc[i].wMaxPacketSize);
+}
+
+int
+main()
+{
+ usb_set_maxpacket(2);
+ return 0;
+}
+
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/packed-vla.c b/gcc-4.9/gcc/testsuite/gcc.dg/packed-vla.c
new file mode 100644
index 000000000..04ccb9663
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/packed-vla.c
@@ -0,0 +1,31 @@
+/* PR middle-end/27945 */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+extern int printf (const char *, ...);
+extern void abort ();
+
+int func(int levels)
+{
+ struct bar {
+ unsigned char a;
+ int b[levels];
+ } __attribute__ ((__packed__)) bar;
+
+ struct foo {
+ unsigned char a;
+ int b[4];
+ } __attribute__ ((__packed__)) foo;
+
+ printf("foo %d\n", sizeof(foo));
+ printf("bar %d\n", sizeof(bar));
+
+ if (sizeof (foo) != sizeof (bar))
+ abort ();
+}
+
+int main()
+{
+ func(4);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-1.c
new file mode 100644
index 000000000..470636de9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-1.c
@@ -0,0 +1,26 @@
+/* Test GNU parameter forward declarations. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Valid uses. */
+int f1(int a; int a);
+int f2(int a; int a) { return 0; }
+int f3(int a; int a; int a);
+int f4(int a; int a; int a) { return 0; }
+int f5(int a; int (*x)[a], int a);
+int f6(int a; int (*x)[a], int a) { return 0; }
+int f7(int a; int (*x)[a]; int (*y)[x[1][2]], int (*x)[a], int a);
+int f8(int a; int (*x)[a]; int (*y)[x[1][2]], int (*x)[a], int a) { return 0; }
+
+/* Strange uses accepted by GCC 4.0 but not by 3.4 and probably not
+ desirable to accept. */
+int g1(int a;); /* { dg-error "just a forward declaration" "no parms" { xfail *-*-* } } */
+int g2(int a; __attribute__((unused))); /* { dg-error "just a forward declaration" "no parms" { xfail *-*-* } } */
+int g3(int;); /* { dg-error "just a forward declaration" "no parms" { xfail *-*-* } } */
+int g4(int, long;); /* { dg-error "just a forward declaration" "no parms" { xfail *-*-* } } */
+
+/* Invalid uses. */
+int h1(int a; int b); /* { dg-error "just a forward declaration" } */
+int h2(int; int b); /* { dg-error "just a forward declaration" } */
+int h3(int a; long a); /* { dg-error "conflicting types|previous definition|just a forward declaration" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-2.c
new file mode 100644
index 000000000..42db4b157
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-2.c
@@ -0,0 +1,8 @@
+/* Test GNU parameter forward declarations. Warning with
+ -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+int f1(int a; int a); /* { dg-warning "ISO C forbids forward parameter declarations" } */
+int f2(int a; int a) { return 0; } /* { dg-warning "ISO C forbids forward parameter declarations" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-3.c
new file mode 100644
index 000000000..7937532fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-3.c
@@ -0,0 +1,8 @@
+/* Test GNU parameter forward declarations. Error with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+int f1(int a; int a); /* { dg-error "ISO C forbids forward parameter declarations" } */
+int f2(int a; int a) { return 0; } /* { dg-error "ISO C forbids forward parameter declarations" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-4.c
new file mode 100644
index 000000000..a210092e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-forwdecl-4.c
@@ -0,0 +1,10 @@
+/* Test GNU parameter forward declarations. OK with
+ -Wredundant-decls. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wredundant-decls" } */
+
+int f1(int a; int a);
+int f2(int a; int a) { return 0; }
+int f3(int a; int a; int a);
+int f4(int a; int a; int a) { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-1.c
new file mode 100644
index 000000000..467c19abd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-1.c
@@ -0,0 +1,33 @@
+/* Test implicit function declarations and other odd declarations in
+ function prototypes. Bug 18239. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Implicit function declaration in attribute in definition (testcase
+ from bug). */
+int
+foo (int __attribute__ ((__mode__ (vector_size(8)))) i) /* { dg-warning "'__mode__' attribute ignored" } */
+{
+ return (long long) i;
+}
+
+/* Various other cases. */
+
+int f (int [sizeof(g())]);
+int f1 (int [sizeof(g1())]);
+
+int g () { return 1; }
+
+int
+h (int (*p)[sizeof(i())])
+{
+ int g2 (), g3 ();
+ return (*p)[0] + g3() + g2();
+}
+
+int i () { return 2; }
+
+int f2 (int [sizeof(g2())]);
+int f3 (int [sizeof(g3())]);
+int g3 () { return 4; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-2.c
new file mode 100644
index 000000000..22ea0c6e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-2.c
@@ -0,0 +1,7 @@
+/* Test implicit function declarations and other odd declarations in
+ function prototypes. Make sure that LABEL_DECLs don't occur. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int k (int [sizeof &&z]); /* { dg-error "label 'z' referenced outside of any function" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-3.c
new file mode 100644
index 000000000..b3941b92b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-impl-decl-3.c
@@ -0,0 +1,28 @@
+/* Like parm-impl-decl-1.c, but with -g. PR 43381. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+int
+foo (int __attribute__ ((__mode__ (vector_size(8)))) i) /* { dg-warning "'__mode__' attribute ignored" } */
+{
+ return (long long) i;
+}
+
+int f (int [sizeof(g())]);
+int f1 (int [sizeof(g1())]);
+
+int g () { return 1; }
+
+int
+h (int (*p)[sizeof(i())])
+{
+ int g2 (), g3 ();
+ return (*p)[0] + g3() + g2();
+}
+
+int i () { return 2; }
+
+int f2 (int [sizeof(g2())]);
+int f3 (int [sizeof(g3())]);
+int g3 () { return 4; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-incomplete-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-incomplete-1.c
new file mode 100644
index 000000000..83dca8253
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-incomplete-1.c
@@ -0,0 +1,28 @@
+/* Test warnings and errors for incomplete parameter types. Should
+ not be warned for in declarations that are not definitions: bug
+ 17881. Void types may be a special case, especially for unnamed
+ parameters and when qualified or with a storage class specifier;
+ see C90 6.5.4.3, DR#017 Q14, C90 TC1, DR#157, C99 J.2 (referencing
+ C99 6.7.5.3); the precise rules are unclear. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s;
+void f (struct s);
+void (*g)(struct s);
+struct t { void (*p)(struct s); };
+
+struct s { int b; };
+void h (struct s x) { }
+
+void j(struct t2); /* { dg-warning "'struct t2' declared inside parameter list" } */
+/* { dg-warning "its scope is only" "explanation" { target *-*-* } 19 } */
+
+union u;
+
+void v(union u x) { } /* { dg-error "parameter 1 \\('x'\\) has incomplete type" } */
+
+void p(void x); /* { dg-warning "parameter 1 \\('x'\\) has void type" } */
+
+void q(const void x); /* { dg-warning "parameter 1 \\('x'\\) has void type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parm-mismatch-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/parm-mismatch-1.c
new file mode 100644
index 000000000..8f62e122b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parm-mismatch-1.c
@@ -0,0 +1,18 @@
+/* Test diagnostics for parameter mismatches. Types that can't match
+ (). */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f0(); /* { dg-message "note: previous declaration of 'f0' was here" } */
+void f0(int, ...); /* { dg-error "conflicting types for 'f0'" } */
+/* { dg-message "note: a parameter list with an ellipsis can't match an empty parameter name list declaration" "note" { target *-*-* } 8 } */
+void f1(int, ...); /* { dg-message "note: previous declaration of 'f1' was here" } */
+void f1(); /* { dg-error "conflicting types for 'f1'" } */
+/* { dg-message "note: a parameter list with an ellipsis can't match an empty parameter name list declaration" "note" { target *-*-* } 11 } */
+void f2(); /* { dg-message "note: previous declaration of 'f2' was here" } */
+void f2(char); /* { dg-error "conflicting types for 'f2'" } */
+/* { dg-message "note: an argument type that has a default promotion can't match an empty parameter name list declaration" "note" { target *-*-* } 14 } */
+void f3(char); /* { dg-message "note: previous declaration of 'f3' was here" } */
+void f3(); /* { dg-error "conflicting types for 'f3'" } */
+/* { dg-message "note: an argument type that has a default promotion can't match an empty parameter name list declaration" "note" { target *-*-* } 17 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-decl-after-if.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-decl-after-if.c
new file mode 100644
index 000000000..f48e6dfc2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-decl-after-if.c
@@ -0,0 +1,11 @@
+/* Parse error recovery
+{ dg-do compile }
+{ dg-options "-fsyntax-only" }
+*/
+
+void f(x)
+{
+ if (x > 1)
+ int ret = 1; /* { dg-error "expected expression before 'int'" } */
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-decl-after-label.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-decl-after-label.c
new file mode 100644
index 000000000..f457c6a69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-decl-after-label.c
@@ -0,0 +1,17 @@
+/* PR 29062
+{ dg-do compile }
+{ dg-options "-fsyntax-only" }
+*/
+
+int f(x)
+{
+ if (x > 1)
+ {
+ goto finish;
+ }
+ return x;
+
+ finish:
+ int ret = 1; /* { dg-error "a label can only be part of a statement and a declaration is not a statement" } */
+ return ret;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-2.c
new file mode 100644
index 000000000..ce59af381
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-2.c
@@ -0,0 +1,13 @@
+/* PR 23722 */
+/* { dg-do compile } */
+/* { dg-options "-fsyntax-only" } */
+int f()
+{
+ if (1)
+ {
+ return 1;
+ else /* { dg-error "expected .\}. before 'else'" } */
+ {
+ }
+ }
+} /* { dg-error "expected identifier or '\\(' before .\}. token" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-3.c
new file mode 100644
index 000000000..13666f595
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-3.c
@@ -0,0 +1,11 @@
+/* PR 23722 */
+/* { dg-do compile } */
+/* { dg-options "-fsyntax-only" } */
+int f()
+{
+
+ else /* { dg-error "'else' without a previous 'if'" } */
+ {
+ return 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-4.c
new file mode 100644
index 000000000..617c3f3e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error-4.c
@@ -0,0 +1,14 @@
+/* PR 23722 */
+/* { dg-do compile } */
+/* { dg-options "-fsyntax-only" } */
+int f()
+{
+ if (1)
+ {
+ return 1;
+ }
+ else
+ {
+ else; /* { dg-error "'else' without a previous 'if'" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error.c
new file mode 100644
index 000000000..ca20bdf9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-else-error.c
@@ -0,0 +1,12 @@
+/* PR 23722 */
+/* { dg-do compile } */
+/* { dg-options "-fsyntax-only" } */
+int f()
+{
+ if (1)
+ {
+ return 1;
+ else /* { dg-error "expected .\}. before 'else'" } */
+ {
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-1.c
new file mode 100644
index 000000000..704786f4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-1.c
@@ -0,0 +1,10 @@
+/* PR c/28649 */
+/* { dg-do compile } */
+
+void foo()
+{
+ +; /* { dg-error "expected expression" } */
+ +; /* { dg-error "expected expression" } */
+}
+
+int +; /* { dg-error "expected identifier" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-2.c
new file mode 100644
index 000000000..7ab3cd7c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-2.c
@@ -0,0 +1,14 @@
+/* PR c/28649 */
+/* { dg-do compile } */
+
+void foo()
+{
+ +; /* { dg-error "expected expression" } */
+}
+
+int i;
+
+void bar()
+{
+ i++; /* { dg-bogus "undeclared" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-3.c
new file mode 100644
index 000000000..8e72b8170
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parse-error-3.c
@@ -0,0 +1,14 @@
+/* PR c/43384 */
+/* { dg-do compile } */
+
+void c_direct(par)
+ void *par = &&lab; /* { dg-error "is initialized|non-standard|outside of" } */
+{}
+
+void foo(p, q)
+ int *p = &q; /* { dg-error "initialized|undeclared" } */
+{}
+
+void bar(i)
+ int j = i; /* { dg-error "initialized|undeclared|no such parameter" } */
+{}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parser-pr28152-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/parser-pr28152-2.c
new file mode 100644
index 000000000..b1502257d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parser-pr28152-2.c
@@ -0,0 +1,11 @@
+/* PR 28152: error messages should mention __complex__ */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int
+main (void)
+{
+ __complex__ float z;
+
+ z = __complex__ (1.90000007326203904e+19, 0.0); /* { dg-error "__complex__" } */
+ z = __complex__ (1.0e+0, 0.0) / z; /* { dg-error "__complex__" "Complex" } */
+ /* { dg-error "at end of input" "end of input" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/parser-pr28152.c b/gcc-4.9/gcc/testsuite/gcc.dg/parser-pr28152.c
new file mode 100644
index 000000000..afb574bc5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/parser-pr28152.c
@@ -0,0 +1,11 @@
+/* PR 28152: error messages should mention _Complex */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int
+main (void)
+{
+ _Complex float z;
+
+ z = _Complex (1.90000007326203904e+19, 0.0); /* { dg-error "_Complex" } */
+ z = _Complex (1.0e+0, 0.0) / z; /* { dg-error "_Complex" "_Complex" } */
+ /* { dg-error "at end of input" "end of input" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/common-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/common-1.c
new file mode 100644
index 000000000..ec5731028
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/common-1.c
@@ -0,0 +1,3 @@
+#include "common-1.h"
+int foo2 = 3;
+int zz = 2;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/common-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/common-1.hs
new file mode 100644
index 000000000..971e1996a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/common-1.hs
@@ -0,0 +1,3 @@
+static int foo1 = 9;
+int foo2;
+extern int zz;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-1.c
new file mode 100644
index 000000000..79cea882d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-1.c
@@ -0,0 +1,9 @@
+/* Copyright (C) 2007 Free Software Foundation
+ Contributed by Ollie Wild <aaw@google.com> */
+
+#include "counter-1.h"
+
+int main(void)
+{
+ return __COUNTER__;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-1.hs
new file mode 100644
index 000000000..c3d2ce791
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-1.hs
@@ -0,0 +1,5 @@
+/* Copyright (C) 2007 Free Software Foundation
+ Contributed by Ollie Wild <aaw@google.com> */
+
+static unsigned offset[] = {__COUNTER__, __COUNTER__, __COUNTER__};
+#define counter __COUNTER__
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-2.c
new file mode 100644
index 000000000..14ce24909
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-2.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2007 Free Software Foundation
+ Contributed by Ollie Wild <aaw@google.com> */
+
+/* { dg-options "-I. -Winvalid-pch" } */
+
+#if __COUNTER__ != 0
+#error __COUNTER__ != 0
+#endif
+
+#include "counter-2.h" /* { dg-warning "not used because `__COUNTER__' is invalid" } */
+/* { dg-error "counter-2.h: No such file or directory" "no such file" { target *-*-* } 0 } */
+/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } 10 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
+
+int main(void)
+{
+ return __COUNTER__;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-2.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-2.hs
new file mode 100644
index 000000000..63b8a2b7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-2.hs
@@ -0,0 +1,4 @@
+/* Copyright (C) 2007 Free Software Foundation
+ Contributed by Ollie Wild <aaw@google.com> */
+
+static int i = __COUNTER__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-3.c
new file mode 100644
index 000000000..827920563
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-3.c
@@ -0,0 +1,13 @@
+/* Copyright (C) 2007 Free Software Foundation
+ Contributed by Ollie Wild <aaw@google.com> */
+
+#if __COUNTER__ != 0
+#error __COUNTER__ != 0
+#endif
+
+#include "counter-3.h"
+
+int main(void)
+{
+ return __COUNTER__;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-3.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-3.hs
new file mode 100644
index 000000000..19039c820
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/counter-3.hs
@@ -0,0 +1,4 @@
+/* Copyright (C) 2007 Free Software Foundation
+ Contributed by Ollie Wild <aaw@google.com> */
+
+#define counter __COUNTER__
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-1.c
new file mode 100644
index 000000000..9a3d6700d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-1.c
@@ -0,0 +1,4 @@
+#include "cpp-1.h"
+#if !defined(__GNUC__)
+panic! panic!
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-1.hs
new file mode 100644
index 000000000..6e25b021a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-1.hs
@@ -0,0 +1 @@
+/* Empty. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-2.c
new file mode 100644
index 000000000..aab84110e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-2.c
@@ -0,0 +1,4 @@
+/* { dg-options "-Wunknown-pragmas -I." } */
+#include "cpp-2.h"
+#pragma GCC poison not_used
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-2.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-2.hs
new file mode 100644
index 000000000..6e25b021a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-2.hs
@@ -0,0 +1 @@
+/* Empty. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3.c
new file mode 100644
index 000000000..25b5ca407
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3.c
@@ -0,0 +1,13 @@
+/* PR preprocessor/36649 */
+/* { dg-do compile } */
+/* { dg-options "-H -I." } */
+/* { dg-message "cpp-3.h\[^\n\]*(\n\[^\n\]*cpp-3.c)?\n\[^\n\]*cpp-3a.h\n\[^\n\]*cpp-3b.h" "" { target *-*-* } 0 } */
+
+#include "cpp-3.h"
+#include "cpp-3a.h"
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3.hs
new file mode 100644
index 000000000..728b1afc7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3.hs
@@ -0,0 +1,4 @@
+#ifndef CPP_3_H
+#define CPP_3_H
+/* empty */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3a.h b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3a.h
new file mode 100644
index 000000000..3788d1179
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3a.h
@@ -0,0 +1,4 @@
+#ifndef CPP_3A_H
+#define CPP_3A_H
+#include "cpp-3b.h"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3b.h b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3b.h
new file mode 100644
index 000000000..5cb0e8104
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/cpp-3b.h
@@ -0,0 +1,4 @@
+#ifndef CPP_3B_H
+#define CPP_3B_H
+/* empty */
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-1.c
new file mode 100644
index 000000000..5d6bb1d4a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-1.c
@@ -0,0 +1,2 @@
+#include "decl-1.h"
+int main(void) { return foo; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-1.hs
new file mode 100644
index 000000000..399f5d3e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-1.hs
@@ -0,0 +1 @@
+extern int foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-2.c
new file mode 100644
index 000000000..72b6538b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-2.c
@@ -0,0 +1,2 @@
+#include "decl-2.h"
+int main(void) { return fun (1, 2); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-2.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-2.hs
new file mode 100644
index 000000000..99c372690
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-2.hs
@@ -0,0 +1,3 @@
+extern int fun (int a, int b);
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-3.c
new file mode 100644
index 000000000..c12abbb1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-3.c
@@ -0,0 +1,11 @@
+#include "decl-3.h"
+
+foo_p bar (void)
+{
+ return foop;
+}
+
+struct foo *bar2 (void)
+{
+ return foop;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-3.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-3.hs
new file mode 100644
index 000000000..787d480f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-3.hs
@@ -0,0 +1,3 @@
+struct foo;
+typedef struct foo *foo_p;
+extern foo_p foop;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-4.c
new file mode 100644
index 000000000..61affdbc0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-4.c
@@ -0,0 +1,9 @@
+#include "decl-4.h"
+
+int bar (foo_p f)
+{
+ if (f->a + foop->a)
+ return f->c->b + foop->b;
+ else
+ return foop->c->b + f->a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-4.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-4.hs
new file mode 100644
index 000000000..3fb220032
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-4.hs
@@ -0,0 +1,7 @@
+typedef struct foo {
+ int a;
+ char b;
+ struct foo *c;
+} foo_s;
+typedef struct foo *foo_p;
+extern foo_p foop;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-5.c
new file mode 100644
index 000000000..705c2fe0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-5.c
@@ -0,0 +1,2 @@
+#include "decl-5.h"
+static int (*t)(void) = foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-5.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-5.hs
new file mode 100644
index 000000000..914983c49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/decl-5.hs
@@ -0,0 +1 @@
+extern int foo(void);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/empty.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/empty.c
new file mode 100644
index 000000000..7daa7ca7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/empty.c
@@ -0,0 +1,8 @@
+/* Yes, it's called "empty" because it has no contents at all.
+ Even this comment goes here, rather than in empty.h. */
+#include "empty.h"
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/empty.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/empty.hs
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/empty.hs
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/except-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/except-1.c
new file mode 100644
index 000000000..f81b098d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/except-1.c
@@ -0,0 +1,7 @@
+/* { dg-options "-fexceptions -I." } */
+#include "except-1.h"
+
+int main(void)
+{
+ return foo(1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/except-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/except-1.hs
new file mode 100644
index 000000000..33a893d15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/except-1.hs
@@ -0,0 +1,6 @@
+/* { dg-options "-fexceptions" } */
+extern inline int
+foo(int a)
+{
+ return a + 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/global-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/global-1.c
new file mode 100644
index 000000000..c1cff5f1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/global-1.c
@@ -0,0 +1,2 @@
+#include "global-1.h"
+const int bar = 3;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/global-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/global-1.hs
new file mode 100644
index 000000000..26efffcb2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/global-1.hs
@@ -0,0 +1 @@
+const int foo = 2;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/ident-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/ident-1.c
new file mode 100644
index 000000000..0b7881aa0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/ident-1.c
@@ -0,0 +1,2 @@
+#include "ident-1.h"
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/ident-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/ident-1.hs
new file mode 100644
index 000000000..421be43c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/ident-1.hs
@@ -0,0 +1 @@
+#ident "My true identity will never be revealed!"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1.c
new file mode 100644
index 000000000..b036217f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1.c
@@ -0,0 +1,21 @@
+/* { dg-options "-I. -I $srcdir/gcc.dg/pch -Wno-deprecated" } */
+#include "import-1.h"
+#include "import-1a.h"
+#import "import-1b.h"
+#include "import-1c.h"
+
+#ifndef IMPORT_1A
+IMPORT_1A not defined
+#endif
+
+#ifndef IMPORT_1B
+IMPORT_1B not defined
+#endif
+
+#ifndef IMPORT_1C
+IMPORT_1C not defined
+#endif
+
+#ifndef IMPORT_1
+IMPORT_1 not defined
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1.hs
new file mode 100644
index 000000000..a59099d44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1.hs
@@ -0,0 +1,5 @@
+/* { dg-options "-I. -I $srcdir/gcc.dg/pch -Wno-deprecated" } */
+#import "import-1a.h"
+#include "import-1b.h"
+#include "import-1c.h"
+#define IMPORT_1
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1a.h b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1a.h
new file mode 100644
index 000000000..d65336afe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1a.h
@@ -0,0 +1,5 @@
+#ifdef IMPORT_1A
+#error import-1a failure
+#endif
+#define IMPORT_1A
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1b.h b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1b.h
new file mode 100644
index 000000000..0dd0c9a9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1b.h
@@ -0,0 +1,4 @@
+#ifdef IMPORT_1B
+#error import-1b failure
+#endif
+#define IMPORT_1B
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1c.h b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1c.h
new file mode 100644
index 000000000..1c16356cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-1c.h
@@ -0,0 +1,6 @@
+#pragma once
+#ifdef IMPORT_1C
+#error import-1c failure
+#endif
+#define IMPORT_1C
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-2.c
new file mode 100644
index 000000000..c037e3d1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-2.c
@@ -0,0 +1,8 @@
+/* { dg-options "-I. -I $srcdir/gcc.dg/pch/include -Wno-deprecated" } */
+
+#include "import-2.h"
+#import "import-2b.h"
+
+int main(int argc, char **argv) {
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-2.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-2.hs
new file mode 100644
index 000000000..8a725de14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/import-2.hs
@@ -0,0 +1,4 @@
+/* { dg-options "-I $srcdir/gcc.dg/pch/include -Wno-deprecated" } */
+
+#import "import-2b.h"
+#import "import-2a.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/include/import-2a.h b/gcc-4.9/gcc/testsuite/gcc.dg/pch/include/import-2a.h
new file mode 100644
index 000000000..bb3250cf6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/include/import-2a.h
@@ -0,0 +1 @@
+#import "import-2b.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/include/import-2b.h b/gcc-4.9/gcc/testsuite/gcc.dg/pch/include/import-2b.h
new file mode 100644
index 000000000..ad10c6271
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/include/import-2b.h
@@ -0,0 +1 @@
+int dup = 9;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-1.c
new file mode 100644
index 000000000..38fad39c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-1.c
@@ -0,0 +1,10 @@
+#include "inline-1.h"
+int bar(int a, int b)
+{
+ return foo(a) + b;
+}
+
+int baz(void)
+{
+ return foo(3);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-1.hs
new file mode 100644
index 000000000..e8f1d6f13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-1.hs
@@ -0,0 +1,5 @@
+extern inline int
+foo(int a)
+{
+ return a * 2 + 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-2.c
new file mode 100644
index 000000000..59b238a3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-2.c
@@ -0,0 +1,12 @@
+#include "inline-2.h"
+extern inline char
+bar(int a)
+{
+ return foo(a)[0];
+}
+
+extern inline char
+baz(void)
+{
+ return foo(0)[0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-2.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-2.hs
new file mode 100644
index 000000000..7d90c63de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-2.hs
@@ -0,0 +1,5 @@
+extern inline const char *
+foo(int a)
+{
+ return "abcdefgh"+a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-3.c
new file mode 100644
index 000000000..fadaf0785
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-3.c
@@ -0,0 +1,5 @@
+#include "inline-3.h"
+unsigned bar(double d)
+{
+ foo (d);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-3.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-3.hs
new file mode 100644
index 000000000..ef2819ace
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-3.hs
@@ -0,0 +1,7 @@
+extern double rint(double);
+extern double fmod (double, double);
+static inline unsigned foo(double d) {
+ double a;
+ a = rint(d);
+ return (unsigned)(fmod(a, (double)0xFFFFFFFF) + ((d - a) * 0xFFFFFFFF));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-4.c
new file mode 100644
index 000000000..60e35aa62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-4.c
@@ -0,0 +1,6 @@
+#include "inline-4.h"
+extern int printf (const char *, ...);
+int main(void) {
+ printf (getstring());
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-4.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-4.hs
new file mode 100644
index 000000000..31a5069ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/inline-4.hs
@@ -0,0 +1,4 @@
+static inline char *getstring(void)
+{
+ return "hello";
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-1.c
new file mode 100644
index 000000000..70546bb09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-1.c
@@ -0,0 +1,6 @@
+#include "macro-1.h"
+
+int main(void)
+{
+ return DEFINED_VALUE + 1 - DEFINED_PARAM (3);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-1.hs
new file mode 100644
index 000000000..5d5b3f4ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-1.hs
@@ -0,0 +1,2 @@
+#define DEFINED_VALUE 3
+#define DEFINED_PARAM(x) (x+1)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-2.c
new file mode 100644
index 000000000..e2d965ff1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-2.c
@@ -0,0 +1,8 @@
+#define DEFINED_VALUE_2 3
+
+#include "macro-2.h"
+
+int main(void)
+{
+ return DEFINED_VALUE - DEFINED_VALUE_2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-2.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-2.hs
new file mode 100644
index 000000000..6152a84a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-2.hs
@@ -0,0 +1,2 @@
+#define DEFINED_VALUE 3
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-3.c
new file mode 100644
index 000000000..493d95498
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-3.c
@@ -0,0 +1,8 @@
+#define DEFINED_FUNC_2(x) (3 + (x))
+
+#include "macro-3.h"
+
+int main(void)
+{
+ return DEFINED_FUNC (1) - DEFINED_FUNC_2 (-1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-3.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-3.hs
new file mode 100644
index 000000000..d394792a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-3.hs
@@ -0,0 +1,2 @@
+#define DEFINED_FUNC(x) 3 - (x)
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-4.c
new file mode 100644
index 000000000..1c199fa6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-4.c
@@ -0,0 +1,8 @@
+#define DEFN aa + bb
+
+#include "macro-4.h"
+
+int foo(int aa, int bb)
+{
+ return DEFN;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-4.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-4.hs
new file mode 100644
index 000000000..5af162d63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/macro-4.hs
@@ -0,0 +1 @@
+/* No content! */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/pch.exp b/gcc-4.9/gcc/testsuite/gcc.dg/pch/pch.exp
new file mode 100644
index 000000000..818004db8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/pch.exp
@@ -0,0 +1,65 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite for precompiled header interaction,
+# that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib dg-pch.exp
+load_lib torture-options.exp
+
+# Initialize `dg'.
+dg-init
+torture-init
+set-torture-options $DG_TORTURE_OPTIONS
+pch-init
+
+set old_dg_do_what_default "${dg-do-what-default}"
+
+# Main loop.
+foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
+ global torture_without_loops
+
+ # We don't try to use the loop-optimizing options, since they are highly
+ # unlikely to make any difference to PCH. However, we do want to
+ # add -O0 -g, since users who want PCH usually want debugging and quick
+ # compiles.
+ dg-pch $subdir $test [concat [list {-O0 -g}] $torture_without_loops] ".h"
+}
+
+set test "largefile.c"
+set testh "largefile.hs"
+set f [open $test w]
+puts $f "/* { dg-timeout-factor 4.0 } */"
+set v 0
+for { set v 0 } { $v < 10000 } { incr v } {
+ puts $f "#define MACRO_${v} \"1234567890\" \"$v\""
+}
+puts $f "#include \"largefile.h\""
+close $f
+set f [open $testh w]
+close $f
+dg-pch $subdir $test [concat [list {-O0 -g}] $torture_without_loops] ".h"
+file delete $test
+file delete $testh
+
+set dg-do-what-default "$old_dg_do_what_default"
+
+# All done.
+pch-finish
+torture-finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/pushpop-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/pushpop-1.c
new file mode 100644
index 000000000..c093e575a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/pushpop-1.c
@@ -0,0 +1,11 @@
+#include "pushpop-1.hs"
+
+#if FOO != 2
+#error FOO != 2
+#endif
+#pragma pop_macro("FOO")
+
+#if FOO != 1
+#error FOR != 1
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/pushpop-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/pushpop-1.hs
new file mode 100644
index 000000000..e97a4f33a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/pushpop-1.hs
@@ -0,0 +1,5 @@
+#define FOO 1
+#pragma push_macro ("FOO")
+#undef FOO
+#define FOO 2
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/save-temps-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/save-temps-1.c
new file mode 100644
index 000000000..9a5e7223c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/save-temps-1.c
@@ -0,0 +1,9 @@
+/* { dg-options "-I. -save-temps" } */
+#include "save-temps-1.h"
+#ifndef T
+#error T not defined
+#endif
+#include <stddef.h>
+int x;
+
+/* { dg-final { cleanup-saved-temps ".s" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/save-temps-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/save-temps-1.hs
new file mode 100644
index 000000000..2fe5a3ee7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/save-temps-1.hs
@@ -0,0 +1,5 @@
+#define T 123
+int foo (void)
+{
+ return 3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-1.c
new file mode 100644
index 000000000..33a139120
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-1.c
@@ -0,0 +1,6 @@
+#include "static-1.h"
+static int bar(void)
+{
+ static int counter;
+ return counter++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-1.hs
new file mode 100644
index 000000000..08cc4395d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-1.hs
@@ -0,0 +1,5 @@
+static int foo(void)
+{
+ static int counter;
+ return counter++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-2.c
new file mode 100644
index 000000000..23e9af126
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-2.c
@@ -0,0 +1,6 @@
+#include "static-2.h"
+int bar(void)
+{
+ static int counter;
+ return counter++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-2.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-2.hs
new file mode 100644
index 000000000..08cc4395d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-2.hs
@@ -0,0 +1,5 @@
+static int foo(void)
+{
+ static int counter;
+ return counter++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-3.c
new file mode 100644
index 000000000..eae0ab078
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-3.c
@@ -0,0 +1,8 @@
+#include "static-3.h"
+int bar(int *a)
+{
+ int i, tot;
+ for (i = tot = 0; i < 100; i++)
+ tot += a[i];
+ return tot;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-3.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-3.hs
new file mode 100644
index 000000000..b881945f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/static-3.hs
@@ -0,0 +1,7 @@
+static int foo(int *a)
+{
+ int i, tot;
+ for (i = tot = 0; i < 100; i++)
+ tot += a[i];
+ return tot;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/struct-1.c
new file mode 100644
index 000000000..9559c07e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/struct-1.c
@@ -0,0 +1,16 @@
+#include "struct-1.h"
+
+struct ChainSearchRecord {
+ int identity;
+};
+typedef struct ChainSearchRecord ChainSearchRecord;
+void foo (ChainSearchPtr s)
+{
+#if(__SIZEOF_INT__ >= 4)
+ s->identity = 0x6a73616d;
+#else
+ s->identity = 0x616d;
+#endif
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/struct-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/struct-1.hs
new file mode 100644
index 000000000..055353a8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/struct-1.hs
@@ -0,0 +1,3 @@
+struct ChainSearchRecord;
+typedef struct ChainSearchRecord *ChainSearchPtr;
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/system-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/system-1.c
new file mode 100644
index 000000000..9fde1365d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/system-1.c
@@ -0,0 +1,6 @@
+#include "system-1.h"
+int main(void)
+{
+ puts ("hello world!");
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/system-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/system-1.hs
new file mode 100644
index 000000000..fbfff34ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/system-1.hs
@@ -0,0 +1,2 @@
+#include <stdio.h>
+#include <stdlib.h>
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1.c
new file mode 100644
index 000000000..d445c47d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1.c
@@ -0,0 +1,9 @@
+/* { dg-require-effective-target pch_supported_debug } */
+/* { dg-options "-I. -Winvalid-pch -g" } */
+
+#include "valid-1.h"/* { dg-warning "created with -gnone, but used with -g" } */
+/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */
+/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
+
+int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1.hs
new file mode 100644
index 000000000..20d9f65dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1.hs
@@ -0,0 +1,4 @@
+/* { dg-require-effective-target pch_supported_debug } */
+/* { dg-options "-I. -Winvalid-pch -g0" } */
+
+extern int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1b.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1b.c
new file mode 100644
index 000000000..3113d0f74
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1b.c
@@ -0,0 +1,6 @@
+/* { dg-require-effective-target pch_supported_debug } */
+/* { dg-options "-I. -Winvalid-pch -g0" } */
+
+#include "valid-1b.h"
+
+int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1b.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1b.hs
new file mode 100644
index 000000000..93b2256e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-1b.hs
@@ -0,0 +1,4 @@
+/* { dg-require-effective-target pch_supported_debug } */
+/* { dg-options "-I. -Winvalid-pch -g" } */
+
+extern int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-2.c
new file mode 100644
index 000000000..3d8cb1427
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-2.c
@@ -0,0 +1,7 @@
+/* { dg-options "-I. -Winvalid-pch -fexceptions" } */
+
+#include "valid-2.h" /* { dg-warning "settings for -fexceptions do not match" } */
+/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */
+/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
+int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-2.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-2.hs
new file mode 100644
index 000000000..2497af651
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-2.hs
@@ -0,0 +1 @@
+extern int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-4.c
new file mode 100644
index 000000000..e4419b570
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-4.c
@@ -0,0 +1,6 @@
+/* { dg-options "-I. -Winvalid-pch -Wtrigraphs" } */
+
+#include "valid-4.h"
+
+char * x = "??/"; /* { dg-warning "trigraph" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-4.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-4.hs
new file mode 100644
index 000000000..051c720ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-4.hs
@@ -0,0 +1 @@
+extern char * x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-5.c
new file mode 100644
index 000000000..4022d0458
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-5.c
@@ -0,0 +1,5 @@
+/* { dg-options "-I. -Winvalid-pch -pedantic-errors" } */
+
+#include "valid-5.h"
+
+int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-5.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-5.hs
new file mode 100644
index 000000000..2497af651
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-5.hs
@@ -0,0 +1 @@
+extern int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-6.c
new file mode 100644
index 000000000..f111c31ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-6.c
@@ -0,0 +1,5 @@
+/* { dg-options "-I. -Winvalid-pch -dH -pipe -fcond-mismatch" } */
+
+#include "valid-6.h"
+
+int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-6.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-6.hs
new file mode 100644
index 000000000..2497af651
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/valid-6.hs
@@ -0,0 +1 @@
+extern int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/warn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pch/warn-1.c
new file mode 100644
index 000000000..1d31cef05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/warn-1.c
@@ -0,0 +1,14 @@
+/* { dg-options "-I. -Winvalid-pch" } */
+
+#define DEFINED_VALUE 3
+
+#include "warn-1.h"/* { dg-warning "not used because .DEFINED_VALUE. is defined" } */
+/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */
+/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
+
+
+int main(void)
+{
+ return DEFINED_VALUE;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pch/warn-1.hs b/gcc-4.9/gcc/testsuite/gcc.dg/pch/warn-1.hs
new file mode 100644
index 000000000..460963f56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pch/warn-1.hs
@@ -0,0 +1,5 @@
+enum {
+ DEFINED_VALUE
+};
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pic-macro-define.c b/gcc-4.9/gcc/testsuite/gcc.dg/pic-macro-define.c
new file mode 100644
index 000000000..7bda6fedf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pic-macro-define.c
@@ -0,0 +1,10 @@
+/* { dg-do run { target "i?86-*-*-darwin" powerpc*-*-darwin* } } */
+/* { dg-options "-fPIC" } */
+
+#if defined __PIC__
+int main() {
+ return 0;
+}
+#else
+ error "NO __PIC__ DEFINED"
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pie-link.c b/gcc-4.9/gcc/testsuite/gcc.dg/pie-link.c
new file mode 100644
index 000000000..c16086cc1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pie-link.c
@@ -0,0 +1,7 @@
+/* { dg-do link { target pie } } */
+/* { dg-options "-fpie" } */
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/finish_unit-test-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/finish_unit-test-1.c
new file mode 100644
index 000000000..4cd8a40f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/finish_unit-test-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int main (int argc, char **argv)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c
new file mode 100644
index 000000000..c04d96d82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c
@@ -0,0 +1,41 @@
+/* This plugin creates a fake function in the FINISH_UNIT callback, in
+ * other words right after compilation of the translation unit.
+*/
+#include "gcc-plugin.h"
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "toplev.h"
+#include "basic-block.h"
+#include "pointer-set.h"
+#include "hash-table.h"
+#include "vec.h"
+#include "ggc.h"
+#include "basic-block.h"
+#include "tree-ssa-alias.h"
+#include "internal-fn.h"
+#include "gimple-fold.h"
+#include "tree-eh.h"
+#include "gimple-expr.h"
+#include "is-a.h"
+#include "gimple.h"
+#include "tree.h"
+#include "tree-pass.h"
+#include "intl.h"
+#include "cgraph.h"
+
+int plugin_is_GPL_compatible;
+
+static void finish_unit_callback (void *gcc_data, void *user_data)
+{
+ cgraph_build_static_cdtor ('I', NULL, DEFAULT_INIT_PRIORITY);
+}
+
+int plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+{
+ register_callback ("finish_unit", PLUGIN_FINISH_UNIT, &finish_unit_callback, NULL);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/ggcplug-test-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/ggcplug-test-1.c
new file mode 100644
index 000000000..74e68bb82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/ggcplug-test-1.c
@@ -0,0 +1,12 @@
+/* Test the ggcplug plugin. */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int main()
+{
+ int i=0, j=0;
+ for (i= 0; i<1000; i++)
+ if (i%8 == 0)
+ j++;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/ggcplug.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/ggcplug.c
new file mode 100644
index 000000000..d441528e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/ggcplug.c
@@ -0,0 +1,126 @@
+/* This plugin tests the GGC related plugin events. */
+/* { dg-options "-O" } */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "toplev.h"
+#include "basic-block.h"
+#include "pointer-set.h"
+#include "hash-table.h"
+#include "vec.h"
+#include "ggc.h"
+#include "basic-block.h"
+#include "tree-ssa-alias.h"
+#include "internal-fn.h"
+#include "gimple-fold.h"
+#include "tree-eh.h"
+#include "gimple-expr.h"
+#include "is-a.h"
+#include "gimple.h"
+#include "tree.h"
+#include "tree-pass.h"
+#include "intl.h"
+#include "gcc-plugin.h"
+#include "plugin-version.h"
+#include "diagnostic.h"
+
+int plugin_is_GPL_compatible;
+
+/* our callback is the same for all PLUGIN_GGC_START,
+ PLUGIN_GGC_MARKING, PLUGIN_GGC_END events; it just increments the
+ user_data which is an int */
+static void increment_callback (void *gcc_data, void *user_data);
+
+/* our counters are user_data */
+static int our_ggc_start_counter;
+static int our_ggc_end_counter;
+static int our_ggc_marking_counter;
+
+/* our empty GGC extra root table */
+static const struct ggc_root_tab our_xtratab[] = {
+ LAST_GGC_ROOT_TAB
+};
+
+
+/* The initialization routine exposed to and called by GCC. The spec of this
+ function is defined in gcc/gcc-plugin.h.
+
+ Note that this function needs to be named exactly "plugin_init". */
+int
+plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+{
+ const char *plugin_name = plugin_info->base_name;
+ int argc = plugin_info->argc;
+ int i = 0;
+ struct plugin_argument *argv = plugin_info->argv;
+ if (!plugin_default_version_check (version, &gcc_version))
+ return 1;
+ /* Process the plugin arguments. This plugin takes the following arguments:
+ count-ggc-start count-ggc-end count-ggc-mark */
+ for (i = 0; i < argc; ++i)
+ {
+ if (!strcmp (argv[i].key, "count-ggc-start"))
+ {
+ if (argv[i].value)
+ warning (0, G_ ("option '-fplugin-arg-%s-count-ggc-start=%s'"
+ " ignored (superfluous '=%s')"),
+ plugin_name, argv[i].value, argv[i].value);
+ else
+ register_callback ("ggcplug",
+ PLUGIN_GGC_START,
+ increment_callback,
+ (void *) &our_ggc_start_counter);
+ }
+ else if (!strcmp (argv[i].key, "count-ggc-end"))
+ {
+ if (argv[i].value)
+ warning (0, G_ ("option '-fplugin-arg-%s-count-ggc-end=%s'"
+ " ignored (superfluous '=%s')"),
+ plugin_name, argv[i].value, argv[i].value);
+ else
+ register_callback ("ggcplug",
+ PLUGIN_GGC_END,
+ increment_callback,
+ (void *) &our_ggc_end_counter);
+ }
+ else if (!strcmp (argv[i].key, "count-ggc-mark"))
+ {
+ if (argv[i].value)
+ warning (0, G_ ("option '-fplugin-arg-%s-count-ggc-mark=%s'"
+ " ignored (superfluous '=%s')"),
+ plugin_name, argv[i].value, argv[i].value);
+ else
+ register_callback ("ggcplug",
+ PLUGIN_GGC_MARKING,
+ increment_callback,
+ (void *) &our_ggc_marking_counter);
+ }
+ else if (!strcmp (argv[i].key, "test-extra-root"))
+ {
+ if (argv[i].value)
+ warning (0, G_ ("option '-fplugin-arg-%s-test-extra-root=%s'"
+ " ignored (superfluous '=%s')"),
+ plugin_name, argv[i].value, argv[i].value);
+ else
+ register_callback ("ggcplug",
+ PLUGIN_REGISTER_GGC_ROOTS,
+ NULL,
+ (void *) our_xtratab);
+ }
+ }
+ /* plugin initialization succeeded */
+ return 0;
+ }
+
+static void
+increment_callback (void *gcc_data, void *user_data)
+{
+ int *usercountptr = (int *) user_data;
+ gcc_assert (!gcc_data);
+ gcc_assert (user_data);
+ (*usercountptr)++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/one_time-test-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/one_time-test-1.c
new file mode 100644
index 000000000..a49ecb4af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/one_time-test-1.c
@@ -0,0 +1,8 @@
+/* Test that pass is inserted and invoked once. */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int main (int argc, char **argv)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
new file mode 100644
index 000000000..f80719a4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
@@ -0,0 +1,96 @@
+/* Plugin that prints message if it inserted (and invoked) more than once. */
+#include "config.h"
+#include "gcc-plugin.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree.h"
+#include "tm.h"
+#include "toplev.h"
+#include "pointer-set.h"
+#include "hash-table.h"
+#include "vec.h"
+#include "ggc.h"
+#include "basic-block.h"
+#include "tree-ssa-alias.h"
+#include "internal-fn.h"
+#include "gimple-fold.h"
+#include "tree-eh.h"
+#include "gimple-expr.h"
+#include "is-a.h"
+#include "gimple.h"
+#include "tree-pass.h"
+#include "intl.h"
+#include "context.h"
+
+int plugin_is_GPL_compatible;
+
+namespace {
+
+const pass_data pass_data_one_pass =
+{
+ GIMPLE_PASS, /* type */
+ "cfg", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
+};
+
+class one_pass : public gimple_opt_pass
+{
+public:
+ one_pass(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_one_pass, ctxt),
+ counter(0)
+ {}
+
+ /* opt_pass methods: */
+ bool gate ();
+ unsigned int execute ();
+
+private:
+ int counter;
+}; // class one_pass
+
+} // anon namespace
+
+bool one_pass::gate (void)
+{
+ return true;
+}
+
+unsigned int one_pass::execute ()
+{
+ if (counter > 0) {
+ printf ("Executed more than once \n");
+ }
+ counter++;
+ return 0;
+}
+
+gimple_opt_pass *
+make_one_pass (gcc::context *ctxt)
+{
+ return new one_pass (ctxt);
+}
+
+
+int plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+{
+ struct register_pass_info p;
+
+ p.pass = make_one_pass (g);
+ p.reference_pass_name = "cfg";
+ p.ref_pass_instance_number = 1;
+ p.pos_op = PASS_POS_INSERT_AFTER;
+
+ register_callback ("one_pass", PLUGIN_PASS_MANAGER_SETUP, NULL, &p);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugin.exp b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugin.exp
new file mode 100644
index 000000000..03ca4d145
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugin.exp
@@ -0,0 +1,82 @@
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Test the functionality of the GCC plugin support
+
+load_lib target-supports.exp
+load_lib gcc-dg.exp
+
+global TESTING_IN_BUILD_TREE
+global ENABLE_PLUGIN
+
+# The plugin testcases currently only work when the build tree is available.
+# Also check whether the host supports plugins.
+if { ![info exists TESTING_IN_BUILD_TREE] || ![info exists ENABLE_PLUGIN] } {
+ return
+}
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# The procedures in plugin-support.exp need these parameters.
+set default_flags $DEFAULT_CFLAGS
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load support procs.
+load_lib plugin-support.exp
+
+# Specify the plugin source file and the associated test files in a list.
+# plugin_test_list={ {plugin1 test1 test2 ...} {plugin2 test1 ...} ... }
+set plugin_test_list [list \
+ { selfassign.c self-assign-test-1.c self-assign-test-2.c } \
+ { ggcplug.c ggcplug-test-1.c } \
+ { one_time_plugin.c one_time-test-1.c } \
+ { start_unit_plugin.c start_unit-test-1.c } \
+ { finish_unit_plugin.c finish_unit-test-1.c } \
+]
+
+foreach plugin_test $plugin_test_list {
+ # Replace each source file with its full-path name
+ for {set i 0} {$i < [llength $plugin_test]} {incr i} {
+ set basename [lindex $plugin_test $i]
+ set plugin_test [lreplace $plugin_test $i $i $srcdir/$subdir/$basename]
+ }
+ set plugin_src [lindex $plugin_test 0]
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $plugin_src] then {
+ continue
+ }
+ set plugin_input_tests [lreplace $plugin_test 0 0]
+ plugin-test-execute $plugin_src $plugin_input_tests
+}
+
+# run the plugindir tests
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/plugindir*.\[cSi\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir1.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir1.c
new file mode 100644
index 000000000..72821ac98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir1.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-c -fplugin=foo" } */
+
+/* { dg-prune-output ".*inaccessible plugin file.*foo\.so expanded from short plugin name.*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir2.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir2.c
new file mode 100644
index 000000000..063b9d9e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir2.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-save-temps -c -fplugin=foo" } */
+
+/* { dg-prune-output ".*inaccessible plugin file.*foo\.so expanded from short plugin name.*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir3.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir3.c
new file mode 100644
index 000000000..9b1c004cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir3.c
@@ -0,0 +1,4 @@
+/* { dg-do preprocess } */
+/* { dg-options "-fplugin=foo" } */
+
+/* { dg-prune-output ".*inaccessible plugin file.*foo\.so expanded from short plugin name.*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir4.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir4.c
new file mode 100644
index 000000000..8f1cb8016
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/plugindir4.c
@@ -0,0 +1,4 @@
+/* { dg-do preprocess } */
+/* { dg-options "-iplugindir=my-plugindir -fplugin=foo" } */
+
+/* { dg-prune-output ".*inaccessible plugin file.*my-plugindir/foo\.so expanded from short plugin name.*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/self-assign-test-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/self-assign-test-1.c
new file mode 100644
index 000000000..f6dc5240f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/self-assign-test-1.c
@@ -0,0 +1,23 @@
+/* Test the self-assignemnt detection plugin. */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct Bar {
+ int b_;
+ int c_;
+};
+
+int g;
+
+int main()
+{
+ struct Bar *bar;
+ int x = x; /* { dg-warning "assigned to itself" } */
+ static int y;
+ struct Bar b_array[5];
+
+ b_array[x+g].b_ = b_array[x+g].b_; /* { dg-warning "self-assignment detected" } */
+ g = g; /* { dg-warning "assigned to itself" } */
+ y = y; /* { dg-warning "assigned to itself" } */
+ bar->b_ = bar->b_; /* { dg-warning "assigned to itself" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/self-assign-test-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/self-assign-test-2.c
new file mode 100644
index 000000000..2ede371a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/self-assign-test-2.c
@@ -0,0 +1,23 @@
+/* Test the self-assignemnt detection plugin with the 'disable' argument. */
+/* { dg-do compile } */
+/* { dg-options "-O -fplugin-arg-selfassign-disable" } */
+
+struct Bar {
+ int b_;
+ int c_;
+};
+
+int g;
+
+int main()
+{
+ struct Bar *bar;
+ int x = x; /* { dg-bogus "assigned to itself" } */
+ static int y;
+ struct Bar b_array[5];
+
+ b_array[x+g].b_ = b_array[x+g].b_; /* { dg-bogus "self-assignment detected" } */
+ g = g; /* { dg-bogus "assigned to itself" } */
+ y = y; /* { dg-bogus "assigned to itself" } */
+ bar->b_ = bar->b_; /* { dg-bogus "assigned to itself" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c
new file mode 100644
index 000000000..041f25dce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c
@@ -0,0 +1,402 @@
+/* This plugin contains an analysis pass that detects and warns about
+ self-assignment statements. */
+/* { dg-options "-O" } */
+
+#include "gcc-plugin.h"
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "stringpool.h"
+#include "toplev.h"
+#include "basic-block.h"
+#include "pointer-set.h"
+#include "hash-table.h"
+#include "vec.h"
+#include "ggc.h"
+#include "basic-block.h"
+#include "tree-ssa-alias.h"
+#include "internal-fn.h"
+#include "gimple-fold.h"
+#include "tree-eh.h"
+#include "gimple-expr.h"
+#include "is-a.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "tree.h"
+#include "tree-pass.h"
+#include "intl.h"
+#include "plugin-version.h"
+#include "diagnostic.h"
+#include "context.h"
+
+int plugin_is_GPL_compatible;
+
+/* Indicate whether to check overloaded operator '=', which is performed by
+ default. To disable it, use -fplugin-arg-NAME-no-check-operator-eq. */
+bool check_operator_eq = true;
+
+/* Given a rhs EXPR of a gimple assign statement, if it is
+ - SSA_NAME : returns its var decl, or, if it is a temp variable,
+ returns the rhs of its SSA def statement.
+ - VAR_DECL, PARM_DECL, FIELD_DECL, or a reference expression :
+ returns EXPR itself.
+ - any other expression : returns NULL_TREE. */
+
+static tree
+get_real_ref_rhs (tree expr)
+{
+ switch (TREE_CODE (expr))
+ {
+ case SSA_NAME:
+ {
+ /* Given a self-assign statement, say foo.x = foo.x,
+ the IR (after SSA) looks like:
+
+ D.1797_14 = foo.x;
+ foo.x ={v} D.1797_14;
+
+ So if the rhs EXPR is an SSA_NAME of a temp variable,
+ e.g. D.1797_14, we need to grab the rhs of its SSA def
+ statement (i.e. foo.x). */
+ tree vdecl = SSA_NAME_VAR (expr);
+ if ((!vdecl || DECL_ARTIFICIAL (vdecl))
+ && !gimple_nop_p (SSA_NAME_DEF_STMT (expr)))
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (expr);
+ /* We are only interested in an assignment with a single
+ rhs operand because if it is not, the original assignment
+ will not possibly be a self-assignment. */
+ if (gimple_assign_single_p (def_stmt))
+ return get_real_ref_rhs (gimple_assign_rhs1 (def_stmt));
+ else
+ return NULL_TREE;
+ }
+ else
+ return vdecl;
+ }
+ case VAR_DECL:
+ case PARM_DECL:
+ case FIELD_DECL:
+ case COMPONENT_REF:
+ case MEM_REF:
+ case ARRAY_REF:
+ return expr;
+ default:
+ return NULL_TREE;
+ }
+}
+
+/* Given an expression tree, EXPR, that may contains SSA names, returns an
+ equivalent tree with the SSA names converted to var/parm/field decls
+ so that it can be used with '%E' format modifier when emitting warning
+ messages.
+
+ This function currently only supports VAR/PARM/FIELD_DECL, reference
+ expressions (COMPONENT_REF, INDIRECT_REF, ARRAY_REF), integer constant,
+ and SSA_NAME. If EXPR contains any other tree nodes (e.g. an arithmetic
+ expression appears in array index), NULL_TREE is returned. */
+
+static tree
+get_non_ssa_expr (tree expr)
+{
+ if (!expr)
+ return NULL_TREE;
+ switch (TREE_CODE (expr))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case FIELD_DECL:
+ {
+ if (DECL_NAME (expr))
+ return expr;
+ else
+ return NULL_TREE;
+ }
+ case COMPONENT_REF:
+ {
+ tree base, orig_base = TREE_OPERAND (expr, 0);
+ tree component, orig_component = TREE_OPERAND (expr, 1);
+ base = get_non_ssa_expr (orig_base);
+ if (!base)
+ return NULL_TREE;
+ component = get_non_ssa_expr (orig_component);
+ if (!component)
+ return NULL_TREE;
+ /* If either BASE or COMPONENT is converted, build a new
+ component reference tree. */
+ if (base != orig_base || component != orig_component)
+ return build3 (COMPONENT_REF, TREE_TYPE (component),
+ base, component, NULL_TREE);
+ else
+ return expr;
+ }
+ case MEM_REF:
+ {
+ tree orig_base = TREE_OPERAND (expr, 0);
+ if (TREE_CODE (orig_base) == SSA_NAME)
+ {
+ tree base = get_non_ssa_expr (orig_base);
+ if (!base)
+ return NULL_TREE;
+ return fold_build2 (MEM_REF, TREE_TYPE (expr),
+ base, TREE_OPERAND (expr, 1));
+ }
+ return expr;
+ }
+ case ARRAY_REF:
+ {
+ tree array, orig_array = TREE_OPERAND (expr, 0);
+ tree index, orig_index = TREE_OPERAND (expr, 1);
+ array = get_non_ssa_expr (orig_array);
+ if (!array)
+ return NULL_TREE;
+ index = get_non_ssa_expr (orig_index);
+ if (!index)
+ return NULL_TREE;
+ /* If either ARRAY or INDEX is converted, build a new array
+ reference tree. */
+ if (array != orig_array || index != orig_index)
+ return build4 (ARRAY_REF, TREE_TYPE (expr), array, index,
+ TREE_OPERAND (expr, 2), TREE_OPERAND (expr, 3));
+ else
+ return expr;
+ }
+ case SSA_NAME:
+ {
+ tree vdecl = SSA_NAME_VAR (expr);
+ if ((!vdecl || DECL_ARTIFICIAL (vdecl))
+ && !gimple_nop_p (SSA_NAME_DEF_STMT (expr)))
+ {
+ gimple def_stmt = SSA_NAME_DEF_STMT (expr);
+ if (gimple_assign_single_p (def_stmt))
+ vdecl = gimple_assign_rhs1 (def_stmt);
+ }
+ return get_non_ssa_expr (vdecl);
+ }
+ case INTEGER_CST:
+ return expr;
+ default:
+ /* Return NULL_TREE for any other kind of tree nodes. */
+ return NULL_TREE;
+ }
+}
+
+/* Given the LHS and (real) RHS of a gimple assign statement, STMT, check if
+ they are the same. If so, print a warning message about self-assignment. */
+
+static void
+compare_and_warn (gimple stmt, tree lhs, tree rhs)
+{
+ if (operand_equal_p (lhs, rhs, OEP_PURE_SAME))
+ {
+ location_t location;
+ location = (gimple_has_location (stmt)
+ ? gimple_location (stmt)
+ : (DECL_P (lhs)
+ ? DECL_SOURCE_LOCATION (lhs)
+ : input_location));
+ /* If LHS contains any tree node not currently supported by
+ get_non_ssa_expr, simply emit a generic warning without
+ specifying LHS in the message. */
+ lhs = get_non_ssa_expr (lhs);
+ if (lhs)
+ warning_at (location, 0, G_("%qE is assigned to itself"), lhs);
+ else
+ warning_at (location, 0, G_("self-assignment detected"));
+ }
+}
+
+/* Check and warn if STMT is a self-assign statement. */
+
+static void
+warn_self_assign (gimple stmt)
+{
+ tree rhs, lhs;
+
+ /* Check assigment statement. */
+ if (gimple_assign_single_p (stmt))
+ {
+ rhs = get_real_ref_rhs (gimple_assign_rhs1 (stmt));
+ if (!rhs)
+ return;
+
+ lhs = gimple_assign_lhs (stmt);
+ if (TREE_CODE (lhs) == SSA_NAME)
+ {
+ lhs = SSA_NAME_VAR (lhs);
+ if (!lhs || DECL_ARTIFICIAL (lhs))
+ return;
+ }
+
+ compare_and_warn (stmt, lhs, rhs);
+ }
+ /* Check overloaded operator '=' (if enabled). */
+ else if (check_operator_eq && is_gimple_call (stmt))
+ {
+ tree fdecl = gimple_call_fndecl (stmt);
+ if (fdecl && (DECL_NAME (fdecl) == maybe_get_identifier ("operator=")))
+ {
+ /* If 'operator=' takes reference operands, the arguments will be
+ ADDR_EXPR trees. In this case, just remove the address-taken
+ operator before we compare the lhs and rhs. */
+ lhs = gimple_call_arg (stmt, 0);
+ if (TREE_CODE (lhs) == ADDR_EXPR)
+ lhs = TREE_OPERAND (lhs, 0);
+ rhs = gimple_call_arg (stmt, 1);
+ if (TREE_CODE (rhs) == ADDR_EXPR)
+ rhs = TREE_OPERAND (rhs, 0);
+
+ compare_and_warn (stmt, lhs, rhs);
+ }
+ }
+}
+
+/* Entry point for the self-assignment detection pass. */
+
+static unsigned int
+execute_warn_self_assign (void)
+{
+ gimple_stmt_iterator gsi;
+ basic_block bb;
+
+ FOR_EACH_BB_FN (bb, cfun)
+ {
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ warn_self_assign (gsi_stmt (gsi));
+ }
+
+ return 0;
+}
+
+/* Pass gate function. Currently always returns true. */
+
+static bool
+gate_warn_self_assign (void)
+{
+ return true;
+}
+
+namespace {
+
+const pass_data pass_data_warn_self_assign =
+{
+ GIMPLE_PASS, /* type */
+ "warn_self_assign", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_gate */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
+};
+
+class pass_warn_self_assign : public gimple_opt_pass
+{
+public:
+ pass_warn_self_assign(gcc::context *ctxt)
+ : gimple_opt_pass(pass_data_warn_self_assign, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ bool gate () { return gate_warn_self_assign (); }
+ unsigned int execute () { return execute_warn_self_assign (); }
+
+}; // class pass_warn_self_assign
+
+} // anon namespace
+
+static gimple_opt_pass *
+make_pass_warn_self_assign (gcc::context *ctxt)
+{
+ return new pass_warn_self_assign (ctxt);
+}
+
+/* The initialization routine exposed to and called by GCC. The spec of this
+ function is defined in gcc/gcc-plugin.h.
+
+ PLUGIN_NAME - name of the plugin (useful for error reporting)
+ ARGC - the size of the ARGV array
+ ARGV - an array of key-value argument pair
+
+ Returns 0 if initialization finishes successfully.
+
+ Note that this function needs to be named exactly "plugin_init". */
+
+int
+plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+{
+ struct register_pass_info pass_info;
+ const char *plugin_name = plugin_info->base_name;
+ int argc = plugin_info->argc;
+ struct plugin_argument *argv = plugin_info->argv;
+ bool enabled = true;
+ int i;
+
+ if (!plugin_default_version_check (version, &gcc_version))
+ return 1;
+
+ /* Self-assign detection should happen after SSA is constructed. */
+ pass_info.pass = make_pass_warn_self_assign (g);
+ pass_info.reference_pass_name = "ssa";
+ pass_info.ref_pass_instance_number = 1;
+ pass_info.pos_op = PASS_POS_INSERT_AFTER;
+
+ /* Process the plugin arguments. This plugin takes the following arguments:
+ check-operator-eq, no-check-operator-eq, enable, and disable.
+ By default, the analysis is enabled with 'operator=' checked. */
+ for (i = 0; i < argc; ++i)
+ {
+ if (!strcmp (argv[i].key, "check-operator-eq"))
+ {
+ if (argv[i].value)
+ warning (0, G_("option '-fplugin-arg-%s-check-operator-eq=%s'"
+ " ignored (superfluous '=%s')"),
+ plugin_name, argv[i].value, argv[i].value);
+ else
+ check_operator_eq = true;
+ }
+ else if (!strcmp (argv[i].key, "no-check-operator-eq"))
+ {
+ if (argv[i].value)
+ warning (0, G_("option '-fplugin-arg-%s-no-check-operator-eq=%s'"
+ " ignored (superfluous '=%s')"),
+ plugin_name, argv[i].value, argv[i].value);
+ else
+ check_operator_eq = false;
+ }
+ else if (!strcmp (argv[i].key, "enable"))
+ {
+ if (argv[i].value)
+ warning (0, G_("option '-fplugin-arg-%s-enable=%s' ignored"
+ " (superfluous '=%s')"),
+ plugin_name, argv[i].value, argv[i].value);
+ else
+ enabled = true;
+ }
+ else if (!strcmp (argv[i].key, "disable"))
+ {
+ if (argv[i].value)
+ warning (0, G_("option '-fplugin-arg-%s-disable=%s' ignored"
+ " (superfluous '=%s')"),
+ plugin_name, argv[i].value, argv[i].value);
+ else
+ enabled = false;
+ }
+ else
+ warning (0, G_("plugin %qs: unrecognized argument %qs ignored"),
+ plugin_name, argv[i].key);
+ }
+
+ /* Register this new pass with GCC if the analysis is enabled. */
+ if (enabled)
+ register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
+ &pass_info);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/start_unit-test-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/start_unit-test-1.c
new file mode 100644
index 000000000..4cd8a40f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/start_unit-test-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int main (int argc, char **argv)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c
new file mode 100644
index 000000000..e83476b63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/start_unit_plugin.c
@@ -0,0 +1,79 @@
+/* This plugin tests the correct operation of a PLUGIN_START_UNIT callback.
+ * By the time a PLUGIN_START_UNIT callback is invoked, the frontend
+ * initialization should have completed. At least the different *_type_nodes
+ * should have been created. This plugin creates an artificial global
+ * interger variable.
+ *
+*/
+#include "gcc-plugin.h"
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "stringpool.h"
+#include "toplev.h"
+#include "basic-block.h"
+#include "pointer-set.h"
+#include "hash-table.h"
+#include "vec.h"
+#include "ggc.h"
+#include "basic-block.h"
+#include "tree-ssa-alias.h"
+#include "internal-fn.h"
+#include "gimple-fold.h"
+#include "tree-eh.h"
+#include "gimple-expr.h"
+#include "is-a.h"
+#include "gimple.h"
+#include "tree.h"
+#include "tree-pass.h"
+#include "intl.h"
+
+int plugin_is_GPL_compatible;
+static tree fake_var = NULL;
+
+static bool
+gate_start_unit (void)
+{
+ return true;
+}
+
+static void start_unit_callback (void *gcc_data, void *user_data)
+{
+ if (integer_type_node) {
+ fake_var = build_decl (UNKNOWN_LOCATION, VAR_DECL,
+ get_identifier ("_fake_var_"),
+ integer_type_node);
+ TREE_PUBLIC (fake_var) = 1;
+ DECL_ARTIFICIAL (fake_var) = 1;
+ }
+}
+
+static void finish_unit_callback (void *gcc_data, void *user_data)
+{
+ if (fake_var == NULL) {
+ printf ("fake_var not created \n");
+ return;
+ }
+ if (TREE_CODE (fake_var) != VAR_DECL) {
+ printf ("fake_var not a VAR_DECL \n");
+ return;
+ }
+ if (TREE_CODE (TREE_TYPE (fake_var)) != INTEGER_TYPE) {
+ printf ("fake_var not INTEGER_TYPE \n");
+ return;
+ }
+ if (DECL_ARTIFICIAL (fake_var) == 0) {
+ printf ("fake_var not ARTIFICIAL \n");
+ return;
+ }
+}
+
+int plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+{
+ register_callback ("start_unit", PLUGIN_START_UNIT, &start_unit_callback, NULL);
+ register_callback ("finish_unit", PLUGIN_FINISH_UNIT, &finish_unit_callback, NULL);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-1.c
new file mode 100644
index 000000000..8bf6e285d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-1.c
@@ -0,0 +1,39 @@
+/* Test diagnostics for arithmetic on void and function pointers.
+ Test with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void *p;
+void (*f)(void);
+
+void
+g (void)
+{
+ p + 0;
+ p + 1;
+ 0 + p;
+ 1 + p;
+ p - 0;
+ p - 1;
+ p += 0;
+ p += 1;
+ p -= 0;
+ p -= 1;
+ f + 0;
+ f + 1;
+ 0 + f;
+ 1 + f;
+ f - 0;
+ f - 1;
+ f += 0;
+ f += 1;
+ f -= 0;
+ f -= 1;
+ p[0]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ 0[p]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ f[0]; /* { dg-error "subscripted value is pointer to function" } */
+ 0[f]; /* { dg-error "subscripted value is pointer to function" } */
+ p - p;
+ f - f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-10.c
new file mode 100644
index 000000000..52b1989ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-10.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+char *foo(char *p, __UINTPTR_TYPE__ i)
+{
+ return (char *)i + (__UINTPTR_TYPE__)p;
+}
+
+/* { dg-final { scan-tree-dump "p +" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-2.c
new file mode 100644
index 000000000..cda287c28
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-2.c
@@ -0,0 +1,41 @@
+/* Test diagnostics for arithmetic on void and function pointers.
+ Test with -Wpointer-arith. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wpointer-arith" } */
+
+void *p;
+void (*f)(void);
+
+void
+g (void)
+{
+ p + 0; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p + 1; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ 0 + p; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ 1 + p; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p - 0; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p - 1; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p += 0; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p += 1; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p -= 0; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p -= 1; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ f + 0; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f + 1; /* { dg-warning "pointer to a function used in arithmetic" } */
+ 0 + f; /* { dg-warning "pointer to a function used in arithmetic" } */
+ 1 + f; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f - 0; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f - 1; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f += 0; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f += 1; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f -= 0; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f -= 1; /* { dg-warning "pointer to a function used in arithmetic" } */
+ p[0]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ /* { dg-warning "pointer of type 'void \\*' used in arithmetic" "array 1" { target *-*-* } 33 } */
+ 0[p]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ /* { dg-warning "pointer of type 'void \\*' used in arithmetic" "array 1" { target *-*-* } 35 } */
+ f[0]; /* { dg-error "subscripted value is pointer to function" } */
+ 0[f]; /* { dg-error "subscripted value is pointer to function" } */
+ p - p; /* { dg-warning "pointer of type 'void \\*' used in subtraction" } */
+ f - f; /* { dg-warning "pointer to a function used in subtraction" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-3.c
new file mode 100644
index 000000000..bcfb2a4b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-3.c
@@ -0,0 +1,41 @@
+/* Test diagnostics for arithmetic on void and function pointers.
+ Test with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+void *p;
+void (*f)(void);
+
+void
+g (void)
+{
+ p + 0; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p + 1; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ 0 + p; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ 1 + p; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p - 0; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p - 1; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p += 0; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p += 1; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p -= 0; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ p -= 1; /* { dg-warning "pointer of type 'void \\*' used in arithmetic" } */
+ f + 0; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f + 1; /* { dg-warning "pointer to a function used in arithmetic" } */
+ 0 + f; /* { dg-warning "pointer to a function used in arithmetic" } */
+ 1 + f; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f - 0; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f - 1; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f += 0; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f += 1; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f -= 0; /* { dg-warning "pointer to a function used in arithmetic" } */
+ f -= 1; /* { dg-warning "pointer to a function used in arithmetic" } */
+ p[0]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ /* { dg-warning "pointer of type 'void \\*' used in arithmetic" "array 1" { target *-*-* } 33 } */
+ 0[p]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ /* { dg-warning "pointer of type 'void \\*' used in arithmetic" "array 1" { target *-*-* } 35 } */
+ f[0]; /* { dg-error "subscripted value is pointer to function" } */
+ 0[f]; /* { dg-error "subscripted value is pointer to function" } */
+ p - p; /* { dg-warning "pointer of type 'void \\*' used in subtraction" } */
+ f - f; /* { dg-warning "pointer to a function used in subtraction" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-4.c
new file mode 100644
index 000000000..daa5e0f5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-4.c
@@ -0,0 +1,41 @@
+/* Test diagnostics for arithmetic on void and function pointers.
+ Test with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+void *p;
+void (*f)(void);
+
+void
+g (void)
+{
+ p + 0; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ p + 1; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ 0 + p; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ 1 + p; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ p - 0; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ p - 1; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ p += 0; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ p += 1; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ p -= 0; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ p -= 1; /* { dg-error "pointer of type 'void \\*' used in arithmetic" } */
+ f + 0; /* { dg-error "pointer to a function used in arithmetic" } */
+ f + 1; /* { dg-error "pointer to a function used in arithmetic" } */
+ 0 + f; /* { dg-error "pointer to a function used in arithmetic" } */
+ 1 + f; /* { dg-error "pointer to a function used in arithmetic" } */
+ f - 0; /* { dg-error "pointer to a function used in arithmetic" } */
+ f - 1; /* { dg-error "pointer to a function used in arithmetic" } */
+ f += 0; /* { dg-error "pointer to a function used in arithmetic" } */
+ f += 1; /* { dg-error "pointer to a function used in arithmetic" } */
+ f -= 0; /* { dg-error "pointer to a function used in arithmetic" } */
+ f -= 1; /* { dg-error "pointer to a function used in arithmetic" } */
+ p[0]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ /* { dg-error "pointer of type 'void \\*' used in arithmetic" "array 1" { target *-*-* } 33 } */
+ 0[p]; /* { dg-warning "dereferencing 'void \\*' pointer" } */
+ /* { dg-error "pointer of type 'void \\*' used in arithmetic" "array 1" { target *-*-* } 35 } */
+ f[0]; /* { dg-error "subscripted value is pointer to function" } */
+ 0[f]; /* { dg-error "subscripted value is pointer to function" } */
+ p - p; /* { dg-error "pointer of type 'void \\*' used in subtraction" } */
+ f - f; /* { dg-error "pointer to a function used in subtraction" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-5.c
new file mode 100644
index 000000000..47564c049
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-5.c
@@ -0,0 +1,17 @@
+/* Test diagnostics for sizeof on void and function types. Test with
+ no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern const void v;
+void f(void);
+
+void
+g (void)
+{
+ sizeof (v);
+ sizeof (void);
+ sizeof (f);
+ sizeof (void (void));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-6.c
new file mode 100644
index 000000000..cf5f08b3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-6.c
@@ -0,0 +1,17 @@
+/* Test diagnostics for sizeof on void and function types. Test with
+ -Wpointer-arith. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wpointer-arith" } */
+
+extern const void v;
+void f(void);
+
+void
+g (void)
+{
+ sizeof (v); /* { dg-warning "invalid application of 'sizeof' to a void type" } */
+ sizeof (void); /* { dg-warning "invalid application of 'sizeof' to a void type" } */
+ sizeof (f); /* { dg-warning "invalid application of 'sizeof' to a function type" } */
+ sizeof (void (void)); /* { dg-warning "invalid application of 'sizeof' to a function type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-7.c
new file mode 100644
index 000000000..a65e42866
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-7.c
@@ -0,0 +1,17 @@
+/* Test diagnostics for sizeof on void and function types. Test with
+ -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+extern const void v;
+void f(void);
+
+void
+g (void)
+{
+ sizeof (v); /* { dg-warning "invalid application of 'sizeof' to a void type" } */
+ sizeof (void); /* { dg-warning "invalid application of 'sizeof' to a void type" } */
+ sizeof (f); /* { dg-warning "invalid application of 'sizeof' to a function type" } */
+ sizeof (void (void)); /* { dg-warning "invalid application of 'sizeof' to a function type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-8.c
new file mode 100644
index 000000000..5426b79e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-8.c
@@ -0,0 +1,17 @@
+/* Test diagnostics for sizeof on void and function types. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+extern const void v;
+void f(void);
+
+void
+g (void)
+{
+ sizeof (v); /* { dg-error "invalid application of 'sizeof' to a void type" } */
+ sizeof (void); /* { dg-error "invalid application of 'sizeof' to a void type" } */
+ sizeof (f); /* { dg-error "invalid application of 'sizeof' to a function type" } */
+ sizeof (void (void)); /* { dg-error "invalid application of 'sizeof' to a function type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-9.c
new file mode 100644
index 000000000..2d2611272
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pointer-arith-9.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void *foo(void)
+{
+ return (void *)0 - 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/postincr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/postincr-1.c
new file mode 100644
index 000000000..752cda40c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/postincr-1.c
@@ -0,0 +1,21 @@
+/* Simple test for proper postincrement semantics. */
+/* { dg-do run } */
+
+extern void abort (void);
+
+int i;
+int c;
+int *f ()
+{
+ ++c;
+ return &i;
+}
+
+int main ()
+{
+ int r;
+ r = (*f())++;
+ if (!(r == 0 && i == 1 && c == 1))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr10392-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr10392-1.c
new file mode 100644
index 000000000..8d599b8af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr10392-1.c
@@ -0,0 +1,63 @@
+/* PR optimization/10392
+ * Reporter: marcus@mc.pp.se
+ * Summary: [3.3/3.4 regression] [SH] optimizer generates faulty array indexing
+ * Description:
+ * The address calculation of an index operation on an array on the stack
+ * can _under some conditions_ get messed up completely
+ *
+ * Testcase tweaked by dank@kegel.com
+ * Problem only happens with -O2 -m4, so it should only happen on sh4,
+ * but what the heck, let's test other architectures, too.
+ * Not marked as xfail since it's a regression.
+*/
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -m4" { target sh4-*-* } } */
+extern void abort (void);
+const char *dont_optimize_function_away;
+
+const char *use(const char *str)
+{
+ dont_optimize_function_away = str;
+ if (str[0] != 'v')
+ abort();
+ if (str[1] < '1' || str[1] > '6')
+ abort();
+ if (str[2])
+ abort();
+ return str[2] ? "notused" : "v6";
+}
+
+const char *func(char *a, char *b)
+{
+ char buf[128];
+ unsigned char i;
+ const char *result;
+
+ char *item[] = {
+ "v1",
+ "v2",
+ };
+
+ buf[0] = 'v';
+ buf[1] = '3';
+ buf[2] = 0;
+
+ for (i = 0; i < 2; i++) {
+ /* bug is: following line passes wild pointer to use() on sh4 -O2 */
+ result = use(item[i]);
+
+ use(buf);
+ use(a);
+ use(b);
+ result = use(result);
+ }
+ return result;
+}
+
+int main()
+{
+ func("v4", "v5");
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr10474.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr10474.c
new file mode 100644
index 000000000..77ccc4606
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr10474.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { { x86_64-*-* && lp64 } || { powerpc*-*-* && lp64 } } } } */
+/* { dg-options "-O3 -fdump-rtl-pro_and_epilogue" } */
+
+void f(int *i)
+{
+ if (!i)
+ return;
+ else
+ {
+ __builtin_printf("Hi");
+ *i=0;
+ }
+}
+
+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
+/* { dg-final { cleanup-rtl-dump "pro_and_epilogue" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr11459-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr11459-1.c
new file mode 100644
index 000000000..1edd94f81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr11459-1.c
@@ -0,0 +1,6 @@
+/* -ansi -std=c99 should mean -std=c99, but the specs reordered the
+ options. Bug 11459. */
+/* { dg-do compile } */
+/* { dg-options "-ansi -std=c99 -pedantic" } */
+
+long long i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr11492.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr11492.c
new file mode 100644
index 000000000..866309953
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr11492.c
@@ -0,0 +1,12 @@
+/* PR11492 */
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+int main( void )
+{
+ unsigned int a;
+ unsigned char b;
+ for ( a = 0, b = 2; a > b * 100; a++ ) /* { dg-bogus "comparison between signed and unsigned integer" "" } */
+ { ; }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr11864-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr11864-1.c
new file mode 100644
index 000000000..b8d713419
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr11864-1.c
@@ -0,0 +1,42 @@
+/* PR optimization/11864
+ * Reporter: Kazumoto Kojima <kkojima@gcc.gnu.org>
+ * Summary: [3.3/3.4 regression] miscompiles zero extension and test
+ * Description:
+ * gcc-3.3/3.4 -O2 for sh target may miscompile the combination of zero extension
+ * and test if it's zero.
+ *
+ * Testcase tweaked by dank@kegel.com. Not marked as xfail because it's a regression.
+ */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort(void);
+
+int val = 0xff00;
+
+int f(void)
+{
+ return val;
+}
+
+unsigned char a[1];
+
+void foo(void)
+{
+ a[0] = f() & 255;
+
+ if (!a[0])
+ a[0] = f() & 255;
+
+ if (!a[0])
+ a[0] = 1 + (f() & 127);
+}
+
+int main(int argc, char **argv)
+{
+ foo();
+ if (!a[0])
+ abort();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr12603.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr12603.c
new file mode 100644
index 000000000..f7caef284
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr12603.c
@@ -0,0 +1,8 @@
+/* PR 12603: No return statement warning on function that never returns with -O3. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wall -Wextra -Wreturn-type" } */
+int
+this_function_never_returns ()
+{
+ for (;;);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr12625-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr12625-1.c
new file mode 100644
index 000000000..9ad9f2889
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr12625-1.c
@@ -0,0 +1,13 @@
+/* Warning for assignment used as truth-value should apply for
+ bit-fields. */
+/* Origin: bug 12625 from nomura at netapp.com */
+/* { dg-do compile } */
+/* { dg-options "-Wparentheses" } */
+
+static struct { int i:8; } s;
+
+void
+foo ()
+{
+ if (s.i = 0) ; /* { dg-warning "parentheses" "warning for bit-field" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr13519-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr13519-1.c
new file mode 100644
index 000000000..907165f5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr13519-1.c
@@ -0,0 +1,47 @@
+/* typeof applied to const+nonconst should be nonconst, as should
+ typeof applied to other arithmetic expressions. Bug 13519. */
+/* Origin: Debian bug report 208981
+ from Kalle Olavi Niemitalo <kon@iki.fi>, adapted to a testcase by
+ Joseph Myers <jsm@polyomino.org.uk>. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void fn(void)
+{
+ int n;
+ const int c;
+
+ { __typeof__(n) a1; a1=0; }
+ { __typeof__(c) a2; a2=0; } /* { dg-error "read-only" "correct error" } */
+ { __typeof__((int)n) a3; a3=0; }
+ { __typeof__((int)c) a4; a4=0; } /* { dg-bogus "read-only" "bogus error" { xfail *-*-* } } */
+ { __typeof__((const int)n) a5; a5=0; } /* { dg-error "read-only" "correct error" { xfail *-*-* } } */
+ { __typeof__((const int)c) a6; a6=0; } /* { dg-error "read-only" "correct error" } */
+ { __typeof__(0) a7; a7=0; }
+ { __typeof__(1) a8; a8=0; }
+
+ { __typeof__(n+n) b0; b0=0; }
+ { __typeof__(n+c) b1; b1=0; }
+ { __typeof__(c+n) b2; b2=0; }
+ { __typeof__(c+c) b3; b3=0; }
+
+ { __typeof__(0+n) c0; c0=0; }
+ { __typeof__(0+c) c1; c1=0; }
+ { __typeof__(n+0) c2; c2=0; }
+ { __typeof__(c+0) c3; c3=0; }
+
+ { __typeof__(1+n) d0; d0=0; }
+ { __typeof__(1+c) d1; d1=0; }
+ { __typeof__(n+1) d2; d2=0; }
+ { __typeof__(c+1) d3; d3=0; }
+
+ { __typeof__(((int)n)+((int)n)) e0; e0=0; }
+ { __typeof__(((int)n)+((int)c)) e1; e1=0; }
+ { __typeof__(((int)c)+((int)n)) e2; e2=0; }
+ { __typeof__(((int)c)+((int)c)) e3; e3=0; }
+
+ { __typeof__(((const int)n)+((const int)n)) f0; f0=0; }
+ { __typeof__(((const int)n)+((const int)c)) f1; f1=0; }
+ { __typeof__(((const int)c)+((const int)n)) f2; f2=0; }
+ { __typeof__(((const int)c)+((const int)c)) f3; f3=0; }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr13804-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr13804-1.c
new file mode 100644
index 000000000..436367828
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr13804-1.c
@@ -0,0 +1,28 @@
+/* Diagnostics for attempts to access a member not in a structure or
+ union should name the type involved. Bug 13804. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s0 { int a; };
+union u0 { long b; };
+typedef struct s0 S0;
+typedef union u0 U0;
+
+struct s0 x0;
+S0 x1;
+union u0 x2;
+U0 x3;
+struct s0 *x4;
+union u0 *x5;
+
+void
+f (void)
+{
+ x0.c; /* { dg-error "'struct s0' has no member named 'c'" } */
+ x1.c; /* { dg-error "'S0' has no member named 'c'" } */
+ x2.c; /* { dg-error "'union u0' has no member named 'c'" } */
+ x3.c; /* { dg-error "'U0' has no member named 'c'" } */
+ x4->c; /* { dg-error "'struct s0' has no member named 'c'" } */
+ x5->c; /* { dg-error "'union u0' has no member named 'c'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr14092-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr14092-1.c
new file mode 100644
index 000000000..61fc8f701
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr14092-1.c
@@ -0,0 +1,20 @@
+/* PR c/14092
+ * Origin: bonzini@gnu.org
+ * rejects-valid
+ */
+/* { dg-do compile } */
+
+/* Define this so that we are more portable. The testcase in the
+ PR failed on 64-bit hosts. */
+__extension__ typedef __INTPTR_TYPE__ intptr_t;
+
+typedef struct _PLCI {
+ unsigned char x;
+ unsigned char buf[1];
+} PLCI;
+
+void nl_ind(PLCI * plci)
+{
+ plci->x = -((intptr_t)(plci->buf)) & 3;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr14475.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr14475.c
new file mode 100644
index 000000000..4bad2b369
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr14475.c
@@ -0,0 +1,10 @@
+/* This used to ICE because there was no null check in
+ check_bitfield_type_and_width. */
+
+struct tree_common
+{
+ enum tree_code code : 8; /* { dg-error "ISO C forbids forward references to" "forward ref" } */
+ /* { dg-error "type of bit-field .code. is a GCC extension" "extension" { target *-*-* } 6 } */
+ /* { dg-warning "narrower than values of its type" "narrower" { target *-*-* } 6 } */
+ /* { dg-error "incomplete type" "incomplete" { target *-*-* } 6 } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr14649-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr14649-1.c
new file mode 100644
index 000000000..34f42f08f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr14649-1.c
@@ -0,0 +1,16 @@
+/* PR c/14649 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+double atan(double);
+
+const double pi = 4*atan(1.0); /* { dg-warning "not a constant expression" } */
+
+const double ok = 4*__builtin_atan(1.0);
+
+double foo()
+{
+ double ok2 = 4*atan(1.0);
+ return ok2;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr14765-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr14765-1.c
new file mode 100644
index 000000000..d2b341839
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr14765-1.c
@@ -0,0 +1,11 @@
+/* Empty statement expressions should get void type. Bug 14765 from
+ Serge Belyshev <belyshev@lubercy.com>. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int a;
+void fun ()
+{
+ a = 0;
+ a = ({}); /* { dg-error "not ignored" "void stmt expr" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr14796-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr14796-1.c
new file mode 100644
index 000000000..7ddc4fe34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr14796-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int f (int a) {
+ return (a << 3) << 6;
+}
+
+int g (int b) {
+ return (b >> 5) << 5;
+}
+
+unsigned long long h (unsigned long long c) {
+ return (c << 60) >> 60;
+}
+
+int l (int d) {
+ return (d << 6) >> 6;
+}
+
+/* { dg-final { scan-tree-dump "a << 9" "gimple" } } */
+/* { dg-final { scan-tree-dump "b & -32" "gimple" } } */
+/* { dg-final { scan-tree-dump "c & 15" "gimple" } } */
+/* { dg-final { scan-tree-dump "d << 6" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr14796-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr14796-2.c
new file mode 100644
index 000000000..c0a91dc95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr14796-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int f (int a) {
+ return (a << 31) << 6;
+}
+
+unsigned int g (unsigned int a) {
+ return (a >> 7) >> 25;
+}
+
+int h (int b) {
+ return (b >> 30) >> 30;
+}
+
+long long j (long long c) {
+ return (c >> 35) << 35;
+}
+/* { dg-final { scan-tree-dump-times "= 0" 2 "gimple" } } */
+/* { dg-final { scan-tree-dump "b >> 31" "gimple" } } */
+/* { dg-final { scan-tree-dump "c & -(34359738368|0x800000000)" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr14963.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr14963.c
new file mode 100644
index 000000000..5a494d4c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr14963.c
@@ -0,0 +1 @@
+X Y(Z); /* { dg-error "" "error before" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15236.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15236.c
new file mode 100644
index 000000000..b01a4e858
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15236.c
@@ -0,0 +1,9 @@
+/* PR 15236: pedantic switch modifies treatment of non-ISO compliant
+ enumerations. */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -pedantic-errors -Wconversion" } */
+typedef enum OMX_ERRORTYPE
+{
+ OMX_ErrorNone = 0,
+ OMX_ErrorInsufficientResources = 0x80001000 /* { dg-error "ISO C restricts enumerator values to range of .int." } */
+} OMX_ERRORTYPE;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15347.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15347.c
new file mode 100644
index 000000000..b95b0ea2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15347.c
@@ -0,0 +1,10 @@
+/* { dg-do link } */
+
+extern void link_error (void);
+int
+main ()
+{
+ if ("<12ers" + 1 == 0)
+ link_error ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15360-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15360-1.c
new file mode 100644
index 000000000..4f900d7ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15360-1.c
@@ -0,0 +1,24 @@
+/* Static declarations followed by extern are OK even if the extern
+ declaration is initialized. Bug 15360 from hozelda at
+ yahoo.com. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+static int a;
+static int a;
+extern int a;
+static int a;
+
+static int b;
+extern int b = 1; /* { dg-warning "initialized and declared" "extern init warning" } */
+static int b;
+static int b;
+
+static int c; /* { dg-message "note: previous declaration" "" } */
+int c; /* { dg-error "non-static" "correct error" } */
+
+static int d; /* { dg-message "note: previous declaration" "" } */
+int d = 1; /* { dg-error "non-static" "correct error" } */
+
+void foo (void) { extern int e = 1; } /* { dg-error "has both" "extern init in function" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15443-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15443-1.c
new file mode 100644
index 000000000..d6106b5b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15443-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+void f () __attribute__ ((__malloc__)); /* { dg-warning "ignored" } */
+
+int main ()
+{
+ /* This used to cause an ICE. */
+ f ();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15443-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15443-2.c
new file mode 100644
index 000000000..d97fa2573
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15443-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+struct foo {
+ int bar;
+};
+
+typedef struct foo* bar;
+void f () __attribute__ ((__malloc__)); /* { dg-warning "ignored" } */
+int g () __attribute__ ((__malloc__)); /* { dg-warning "ignored" } */
+int* h () __attribute__ ((__malloc__));
+void* i () __attribute__ ((__malloc__));
+
+struct foo j () __attribute__ ((__malloc__)); /* { dg-warning "ignored" } */
+struct foo* k () __attribute__ ((__malloc__));
+bar l () __attribute__((malloc));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15649-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15649-1.c
new file mode 100644
index 000000000..090209c91
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15649-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math -O2" } */
+
+double foo (double x)
+{
+ return __builtin_isgreater (x, 0.0) ? 0.0 : x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-1.c
new file mode 100644
index 000000000..5a75a1073
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-1.c
@@ -0,0 +1,23 @@
+/* Test diagnostics for old-style definition not matching prior
+ prototype are present and give correct location for that prototype
+ (bug 15698). Original test. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+int foobar ();
+
+int func (int blah)
+{
+ char *rindex();
+}
+
+int foobar ()
+{
+ return 0;
+}
+
+char *rindex(a, b)
+ register char *a, b; /* { dg-warning "argument 'a' doesn't match built-in prototype" } */
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-2.c
new file mode 100644
index 000000000..3ad60a9a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-2.c
@@ -0,0 +1,9 @@
+/* Test diagnostics for old-style definition not matching prior
+ prototype are present and give correct location for that prototype
+ (bug 15698). Prototype at inner scope. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void f() { void g(void); } /* { dg-error "prototype declaration" } */
+void g(a) int a; {} /* { dg-error "number of arguments doesn't match prototype" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-3.c
new file mode 100644
index 000000000..a7a35059c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-3.c
@@ -0,0 +1,11 @@
+/* Test diagnostics for old-style definition not matching prior
+ prototype are present and give correct location for that prototype
+ (bug 15698). Prototype not last declaration. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void f();
+void f(int); /* { dg-error "prototype declaration" } */
+void f();
+void f(a) long a; {} /* { dg-error "argument 'a' doesn't match prototype" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-4.c
new file mode 100644
index 000000000..f86a35124
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-4.c
@@ -0,0 +1,9 @@
+/* Test diagnostics for old-style definition not matching prior
+ prototype are present and give correct location for that prototype
+ (bug 15698). Unprototyped built-in function with user prototype. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+int isnan(void); /* { dg-error "prototype declaration" } */
+int isnan(a) int a; {} /* { dg-error "number of arguments doesn't match prototype" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-5.c
new file mode 100644
index 000000000..288404b4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-5.c
@@ -0,0 +1,10 @@
+/* Test diagnostics for old-style definition not matching prior
+ prototype are present and give correct location for that prototype
+ (bug 15698). Unprototyped built-in function with user prototype at
+ inner scope. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void f(void) { int isnan(void); } /* { dg-error "prototype declaration" } */
+int isnan(a) int a; {} /* { dg-error "number of arguments doesn't match prototype" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-6.c
new file mode 100644
index 000000000..efbc2e42d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-6.c
@@ -0,0 +1,9 @@
+/* Test diagnostics for old-style definition not matching prior
+ prototype are present and give correct location for that prototype
+ (bug 15698). Prototyped built-in function, wrong number of
+ arguments. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+char *strchr(a) const char *a; { return 0; } /* { dg-warning "number of arguments doesn't match built-in prototype" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-7.c
new file mode 100644
index 000000000..2393eac61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-7.c
@@ -0,0 +1,10 @@
+/* Test diagnostics for old-style definition not matching prior
+ prototype are present and give correct location for that prototype
+ (bug 15698). Prototyped built-in function, wrong number of
+ arguments, with explicit prototype as well. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+char *strchr(const char *, int); /* { dg-error "prototype declaration" } */
+char *strchr(a) const char *a; { return 0; } /* { dg-error "number of arguments doesn't match prototype" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-8.c
new file mode 100644
index 000000000..ee0c3ae46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15698-8.c
@@ -0,0 +1,11 @@
+/* Test diagnostics for old-style definition not matching prior
+ prototype are present and give correct location for that prototype
+ (bug 15698). Prototype refined at inner scope with only refinement
+ conflicting with definition. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+int f(int (*)[]);
+int g() { int f(int (*)[2]); } /* { dg-error "prototype declaration" } */
+int f(a) int (*a)[3]; { return 0; } /* { dg-error "argument 'a' doesn't match prototype" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15749-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15749-1.c
new file mode 100644
index 000000000..e78816f80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15749-1.c
@@ -0,0 +1,8 @@
+/* Flexible array misuses (that are accepted without -pedantic) should
+ be OK in system headers even with -pedantic-errors. PR 15749
+ from Tuomo dot Tikkanen at nokia dot com. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#include "pr15749-1.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15749-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr15749-1.h
new file mode 100644
index 000000000..db4a259fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15749-1.h
@@ -0,0 +1,28 @@
+/* Similar to c99-flex-array-3.c, but a system header so should not
+ have diagnostics even with -pedantic-errors. */
+
+#pragma GCC system_header
+
+struct flex { int a; int b[]; };
+union rf1 { struct flex a; int b; };
+union rf2 { int a; struct flex b; };
+union rf3 { int a; union rf1 b; };
+union rf4 { union rf2 a; int b; };
+
+struct t0 { struct flex a; };
+struct t1 { union rf1 a; };
+struct t2 { union rf2 a; };
+struct t3 { union rf3 a; };
+struct t4 { union rf4 a; };
+
+void f0 (struct flex[]);
+void f1 (union rf1[]);
+void f2 (union rf2[]);
+void f3 (union rf3[]);
+void f4 (union rf4[]);
+
+struct flex a0[1];
+union rf1 a1[1];
+union rf2 a2[1];
+union rf3 a3[1];
+union rf4 a4[1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-1.c
new file mode 100644
index 000000000..77e398e1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-1.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -fdump-tree-gimple" } */
+/* Test for folding abs(x) where appropriate. */
+#define abs(x) x > 0 ? x : -x
+extern double fabs (double);
+
+int a (int x) {
+ return (abs(x)) >= 0;
+}
+
+int b (int x) {
+ return (abs(x)) == 0;
+}
+
+int c (int x) {
+ return (abs(x)) != 0;
+}
+
+int d (int x) {
+ return 0 != (abs(x));
+}
+
+int e (int x) {
+ return 0 == (abs(x));
+}
+
+int f (int x) {
+ return 0 <= (abs(x));
+}
+
+int g (int x) {
+ return 0 > (abs(x));
+}
+
+int h (float x) {
+ return 0.0 > fabs(x);
+}
+
+int i (float x) {
+ return fabs(x) == -0.0;
+}
+/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-2.c
new file mode 100644
index 000000000..eb1608c64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple -ffast-math" } */
+/* Test for folding abs(x) where appropriate. */
+#define abs(x) x > 0 ? x : -x
+extern double fabs (double);
+
+int a (float x) {
+ return fabs(x) >= 0.0;
+}
+
+/* { dg-final { scan-tree-dump-times "ABS_EXPR" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-3.c
new file mode 100644
index 000000000..746f9660e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-skip-if "No NaN support" { spu-*-* } } */
+/* SH4 without -mieee defaults to -ffinite-math-only. */
+/* { dg-options "-fdump-tree-gimple -fno-finite-math-only" } */
+/* Test for folding abs(x) where appropriate. */
+#define abs(x) x > 0 ? x : -x
+extern double fabs (double);
+
+int a (float x) {
+ return fabs(x) >= 0.0;
+}
+
+/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-4.c
new file mode 100644
index 000000000..6549c7205
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15784-4.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int a (int x) {
+ return ~x + 1; /* -x */
+}
+
+int b (int x) {
+ return -x -1; /* ~x */
+}
+
+/* { dg-final { scan-tree-dump "~x_..D.;" "optimized" } } */
+/* { dg-final { scan-tree-dump "-x_..D.;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15785-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15785-1.c
new file mode 100644
index 000000000..47cd3d7b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15785-1.c
@@ -0,0 +1,42 @@
+/* { dg-do link } */
+
+extern void link_error ();
+
+void a (int x) {
+ if (~ (~x) - x)
+ link_error ();
+}
+void b (int x) {
+ if (- (-x) - x)
+ link_error ();
+}
+
+void c (int x) {
+ if (!(- (~x) - x))
+ link_error ();
+}
+
+void d (int x) {
+ if (!(~ (-x) - x))
+ link_error ();
+}
+
+void e (int x) {
+ if (x + ~(x - 1))
+ link_error ();
+}
+
+void f (int x) {
+ if (x + ~(x + (-1)))
+ link_error ();
+}
+
+int main (int argc, char *argv[]) {
+ a(argc);
+ b(argc);
+ c(argc);
+ d(argc);
+ e(argc);
+ f(argc);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr15825-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr15825-1.c
new file mode 100644
index 000000000..a4b46d444
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr15825-1.c
@@ -0,0 +1,18 @@
+/* PR middle-end/15825 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned int foo(long long high, int unsigned_p)
+{
+ int i;
+ if (high < 0)
+ if (!unsigned_p)
+ {
+ i = 1;
+ goto t;
+ }
+ i = 0;
+t:
+ return i;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr16194.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr16194.c
new file mode 100644
index 000000000..8b4492240
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr16194.c
@@ -0,0 +1,78 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+/* { dg-bogus "internal compiler error" "ICE" { target *-*-* } 0 } */
+
+#undef SKIP
+#define ASMDECL __asm (REG);
+#define CLOBBER_LIST : REG
+#define INP_CLOBBER_LIST : CLOBBER_LIST
+#if defined (__alpha__)
+# define REG "$1"
+#elif defined (__CRIS__) || defined (__sh__)
+# define REG "r10"
+#elif defined (__hppa__)
+# define REG "%r10"
+#elif defined (__i386__)
+# define REG "%eax"
+#elif defined (__MMIX__)
+# define REG "$8"
+#elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
+ || defined (__POWERPC__) || defined (PPC) || defined (_IBMR2)
+# define REG "6"
+#elif defined (__x86_64__)
+# define REG "rax"
+#elif defined (__m68k__)
+# define REG "%d0"
+#else
+/* Make this test harmless for any target not recognized above. */
+# define SKIP 1
+#endif
+
+#ifndef SKIP
+
+struct A
+{
+ int a;
+};
+
+struct B
+{
+ struct A b[3];
+};
+
+struct C
+{
+ struct B c;
+};
+
+void bug (void)
+{
+ register char* dst ASMDECL;
+ __asm__ ("":"=g"(*dst): : REG);
+}
+
+/* The tree optimizers currently prevent us from finding an overlap -
+ we end up using a copy of dst rather than dst.
+ But at least make sure we don't get an ICE. */
+void bug2 (void)
+{
+ register char* dst ASMDECL;
+ __asm__ ("": :"g"(*dst) CLOBBER_LIST);
+}
+
+void
+foo (void)
+{
+ register struct C *dst ASMDECL;
+ __asm__ ("" : "=g"(dst->c.b[1].a) INP_CLOBBER_LIST);
+}
+
+#else
+
+int main ()
+{
+ return 0;
+}
+
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr16302.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr16302.c
new file mode 100644
index 000000000..0daa513ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr16302.c
@@ -0,0 +1,76 @@
+/* PR 16302 */
+/* { dg-do compile } */
+/* { dg-options "-Wlogical-op" } */
+void bar (int);
+int
+foo (int argc, char *argv[])
+{
+ if (argc != 1 || argc != 2) return 1; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ if (argc < 0 && argc > 10) return 1; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ if (argc || !argc) return 1; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ if (argc && !argc) return 1; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ bar (argc != 1 || argc != 2); /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ bar (argc < 0 && argc > 10); /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ bar (argc || !argc); /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ bar (argc && !argc); /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ return (argc != 1 || argc != 2) ? 1 : 0 ; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ return (argc < 0 && argc > 10) ? 1 : 0; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ return (argc || !argc) ? 1 : 0; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ return (argc && !argc) ? 1 : 0; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+
+ if (argc == 2 && argc == 1) return 1; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ if (argc < 0 && argc > 10) return 1; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ if (argc || !argc) return 1; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ if (argc && !argc) return 1; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ bar (argc == 2 && argc == 1); /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ bar (argc < 0 && argc > 10); /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ bar (argc || !argc); /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ bar (argc && !argc); /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ return (argc == 2 && argc == 1) ? 1 : 0 ; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ return (argc < 0 && argc > 10) ? 1 : 0; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ return (argc || !argc) ? 1 : 0; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ return (argc && !argc) ? 1 : 0; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+
+ if (argc == 2 && argc == 1) return 1; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ if (argc < 0 && argc > 10) return 1; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ if (!argc || argc) return 1; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ if (!argc && argc) return 1; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ bar (argc == 2 && argc == 1); /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ bar (argc < 0 && argc > 10); /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ bar (!argc || argc); /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ bar (!argc && argc); /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ return (argc == 2 && argc == 1) ? 1 : 0 ; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ return (argc < 0 && argc > 10) ? 1 : 0; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+ return (!argc || argc) ? 1 : 0; /* { dg-warning "'or' of collectively exhaustive tests is always true" } */
+ return (!argc && argc) ? 1 : 0; /* { dg-warning "'and' of mutually exclusive tests is always false" } */
+
+ return 0;
+}
+
+int
+foo2 (int argc)
+{
+ if (5 != 1 || 5 != 2) return 1;
+ if (5 < 0 && 5 > 10) return 1;
+ if (1 || 0) return 1;
+ if (0 && 1) return 1;
+ if (2 || !2) return 1;
+ if (2 && !2) return 1;
+ if (!(!2) || !(2)) return 1;
+ if (!(!2) && !(2)) return 1;
+ bar (5 != 1 || 5 != 2);
+ bar (5 < 0 && 5 > 10);
+ bar (1 || 0);
+ bar (0 && 1);
+ bar (2 || !2);
+ bar (2 && !2);
+ return (5 != 1 || 5 != 2) ? 1 : 0 ;
+ return (5 < 0 && 5 > 10) ? 1 : 0;
+ return (1 || 0) ? 1 : 0 ;
+ return (0 && 1) ? 1 : 0;
+ return (2 || !2) ? 1 : 0;
+ return (2 && !2) ? 1 : 0;
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr16973.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr16973.c
new file mode 100644
index 000000000..e24c9f821
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr16973.c
@@ -0,0 +1,12 @@
+/* We were removing the label "a" because
+ we were removing the BB for it but forgot
+ to add back the label. */
+
+/* { dg-options "" } */
+
+void
+f (void)
+{
+ static __SIZE_TYPE__ x = &&a - &&b;
+ a : b : return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17024-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17024-1.c
new file mode 100644
index 000000000..d8bdf012b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17024-1.c
@@ -0,0 +1,15 @@
+/* PR middle-end/17024 */
+/* { dg-do compile } */
+/* { dg-options "-funsafe-math-optimizations" } */
+
+#define MAX2(a,b) (((a)>(b)) ? (a) : (b))
+
+void C(double);
+
+void i(int k)
+{
+ double c[1];
+ C(MAX2(0.,c[k]));
+ return;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17036-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17036-1.c
new file mode 100644
index 000000000..ea2c9caf6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17036-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+int main ()
+{
+ int R, N = 4;
+ unsigned int A = 2;
+ signed int B = 2;
+ ((B >> N) & 1) ? 1 : 0;
+ ((A >> N) & 1) ? 1 : 0;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17055-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17055-1.c
new file mode 100644
index 000000000..31037ab26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17055-1.c
@@ -0,0 +1,25 @@
+/* PR middle-end/17055. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
+
+/* This test used to abort, because we do an "integer" fold to zero, i.e.
+ x - x = (T)0 where T is the type of x. Unfortunately, fold_convert
+ was unable to convert integer_zero_node to the appropriate vector type. */
+
+typedef float v4sf __attribute__((vector_size(16)));
+typedef int v4si __attribute__((vector_size(16)));
+
+v4sf ivf, ovf;
+v4si ivi, ovi;
+
+void testf (void)
+{
+ ovf = ivf - ivf;
+}
+
+void testi (void)
+{
+ ovi = ivi - ivi;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17112-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17112-1.c
new file mode 100644
index 000000000..d43868fe0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17112-1.c
@@ -0,0 +1,33 @@
+/* PR middle-end/17112 */
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-O2" } */
+
+extern void abort(void);
+
+typedef struct {
+ int int24:24 __attribute__ ((packed));
+} myint24;
+
+myint24 x[3] = {
+ 0x123456,
+ 0x789abc,
+ 0xdef012
+};
+
+myint24 y[3]; // starts out as zeros
+
+void foo()
+{
+ y[1] = x[1];
+}
+
+int main()
+{
+ foo();
+
+ if (y[0].int24 != 0 || y[2].int24 != 0)
+ abort();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17188-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17188-1.c
new file mode 100644
index 000000000..522a14f7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17188-1.c
@@ -0,0 +1,31 @@
+/* A redefinition of an empty struct should be diagnosed the same as a
+ redefinition of any other tag, but formerly only s2 and s4 were
+ diagnosed. Bug 17188. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s0 { }; /* { dg-message "note: originally defined here" } */
+struct s0;
+struct s0 { }; /* { dg-error "redefinition of 'struct s0'" } */
+
+struct s1 { }; /* { dg-message "note: originally defined here" } */
+struct s1 { }; /* { dg-error "redefinition of 'struct s1'" } */
+
+struct s2 { int a : 1; }; /* { dg-message "note: originally defined here" } */
+struct s2 { int a : 1; }; /* { dg-error "redefinition of 'struct s2'" } */
+
+struct s3 { }; /* { dg-message "note: originally defined here" } */
+struct s3 { int a : 1; }; /* { dg-error "redefinition of 'struct s3'" } */
+
+struct s4 { int a : 1; }; /* { dg-message "note: originally defined here" } */
+struct s4 { }; /* { dg-error "redefinition of 'struct s4'" } */
+
+struct s5 { int a : 1; };
+struct s5;
+
+struct s6;
+struct s6 { int a : 1; };
+
+struct s7;
+struct s7 { };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17301-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17301-1.c
new file mode 100644
index 000000000..28968fbb2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17301-1.c
@@ -0,0 +1,11 @@
+/* Invalid use of __builtin_va_start should not cause an ICE. Bug
+ 17301. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int
+write_format (char *format, ...)
+{
+ __builtin_va_list p;
+ __builtin_va_start (p); /* { dg-error "too few arguments to function 'va_start'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17301-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17301-2.c
new file mode 100644
index 000000000..b91a2314b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17301-2.c
@@ -0,0 +1,9 @@
+/* Invalid use of __builtin_va_start should not cause an ICE. Bug
+ 17301. Case with no arguments. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void foo (char *format, ...)
+{
+ __builtin_va_start (); /* { dg-error "too few arguments to function '__builtin_va_start'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17319.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17319.c
new file mode 100644
index 000000000..5d39e4c57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17319.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+typedef unsigned long long HARD_REG_ELT_TYPE;
+typedef HARD_REG_ELT_TYPE HARD_REG_SET[2];
+static HARD_REG_SET newpat_used_regs;
+int try_combine (void)
+{
+ HARD_REG_ELT_TYPE *scan_tp_ = newpat_used_regs;
+ scan_tp_[0] = 0;
+ scan_tp_[1] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17322.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17322.c
new file mode 100644
index 000000000..705787273
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17322.c
@@ -0,0 +1,5 @@
+/* PR 17322 */
+
+struct s { int a; int b[1]; };
+struct s x;
+int *y = ((struct s *)&x.a)->b;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17424-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17424-1.c
new file mode 100644
index 000000000..893b4af13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17424-1.c
@@ -0,0 +1,5 @@
+/* Test for bug 17424: ICE for sizeof an undeclared variable. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+;int foezis = sizeof tni; /* { dg-error "'tni' undeclared" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17581-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17581-1.c
new file mode 100644
index 000000000..b63517c84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17581-1.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/17581 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort (void);
+
+int foo(int x)
+{
+ unsigned long long tmp = 0;
+
+ switch(x) {
+ case 21:
+ tmp |= 1;
+ tmp |= 2;
+ tmp |= 8;
+ break;
+ default:
+ break;
+ }
+
+ return (int)tmp;
+}
+
+int main()
+{
+ if (foo(21) != 11)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17635.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17635.c
new file mode 100644
index 000000000..d2154c3f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17635.c
@@ -0,0 +1,11 @@
+/* PR 17635 */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+void foo(int i)
+{
+ while (1)
+ if (i) ++i;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17730-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17730-1.c
new file mode 100644
index 000000000..8f70ad805
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17730-1.c
@@ -0,0 +1,5 @@
+/* Test formatting of message for invalid lvalue. Bug 17730. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+char *p = &'C'; /* { dg-error "lvalue required as unary '&' operand" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17844-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17844-1.c
new file mode 100644
index 000000000..d06bbb6d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17844-1.c
@@ -0,0 +1,20 @@
+/* -fshort-enums should affect only the type with which an enum is
+ compatible, not the type of the enumeration constants which should
+ still be int. Bug 17844. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-fshort-enums" } */
+
+enum e { A, B };
+
+enum e ev;
+unsigned char uv;
+enum e *ep = &uv;
+unsigned char *up = &ev;
+
+int i;
+__typeof__(A) te;
+int *ip = &te;
+__typeof__(B) *tep = &i;
+
+int x[((sizeof(A) == sizeof(int)) ? 1 : -1)];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr17957.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr17957.c
new file mode 100644
index 000000000..8e90003dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr17957.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
+__attribute__ ((vector_size (64))) unsigned char v1, v2, v3;
+void
+vadd (void)
+{
+ v1 = v2 + v3;
+}
+void
+test_add (void)
+{
+ vadd ();
+}
+void
+vsub (void)
+{
+ v1 = v2 - v3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18164.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18164.c
new file mode 100644
index 000000000..cc753bbf5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18164.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+void
+f (void)
+{
+ int x;
+ asm ("" : "" (x)); /* { dg-error "output operand constraint lacks" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-1.c
new file mode 100644
index 000000000..a37e77dac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-1.c
@@ -0,0 +1,111 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Wextra -O1" } */
+
+extern void *memset (void*, int, __SIZE_TYPE__);
+extern void abort (void);
+
+struct radix_tree_root {
+ unsigned int height;
+ struct radix_tree_node *rnode;
+};
+
+struct radix_tree_node {
+ unsigned int count;
+ void *slots[64];
+ unsigned long tags[2][2];
+};
+
+struct radix_tree_path {
+ struct radix_tree_node *node, **slot;
+ int offset;
+};
+
+static unsigned long height_to_maxindex[7] =
+{0, 63, 4095, 262143, 16777215, 1073741823, 4294967295};
+
+static inline void tag_clear(struct radix_tree_node *node, int tag, int offset)
+{
+ int nr;
+ volatile unsigned long *addr;
+#if(__SIZEOF_INT__ >= 4)
+ int mask;
+#else
+ long mask;
+#endif
+
+ nr = offset;
+ addr = &node->tags[tag][0];
+
+ addr += nr >> 5;
+ mask = 1 << (nr & 0x1f);
+ *addr &= ~mask;
+}
+
+void *radix_tree_tag_clear(struct radix_tree_root *root, unsigned long index, int tag)
+{
+ struct radix_tree_path path[7], *pathp = path;
+ unsigned int height, shift;
+ void *ret = 0;
+
+ height = root->height;
+ if (index > height_to_maxindex[height])
+ goto out;
+
+ shift = (height - 1) * 6;
+ pathp->node = 0;
+ pathp->slot = &root->rnode;
+
+ while (height > 0) {
+ int offset;
+
+ if (*pathp->slot == 0)
+ goto out;
+
+ offset = (index >> shift) & (64-1);
+ pathp[1].offset = offset;
+ pathp[1].node = *pathp[0].slot;
+ pathp[1].slot = (struct radix_tree_node **)
+ (pathp[1].node->slots + offset);
+ pathp++;
+ shift -= 6;
+ height--;
+ }
+
+ ret = *pathp[0].slot;
+ if (ret == 0)
+ goto out;
+
+ do {
+ int idx;
+
+ tag_clear(pathp[0].node, tag, pathp[0].offset);
+ for (idx = 0; idx < 2; idx++) {
+ if (pathp[0].node->tags[tag][idx])
+ goto out;
+ }
+ pathp--;
+ } while (pathp[0].node);
+out:
+ return ret;
+}
+
+int main ()
+{
+ struct radix_tree_root r;
+ struct radix_tree_node node;
+ void *p = (void *) 0xdeadbeef;
+
+ r.height = 1;
+ r.rnode = &node;
+
+ memset (&node, 0, sizeof (node));
+
+ node.count = 1;
+ node.slots [13] = p;
+
+ radix_tree_tag_clear (&r, 13, 1);
+
+ if (r.rnode->slots[13] != p)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-2.c
new file mode 100644
index 000000000..a3ff1de0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-2.c
@@ -0,0 +1,65 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Wextra -O1" } */
+
+extern void *memset (void*, int, __SIZE_TYPE__);
+extern void abort (void);
+
+struct radix_tree_root {
+ unsigned int height;
+ struct radix_tree_node *rnode;
+};
+
+struct radix_tree_node {
+ unsigned int count;
+ void *slots[64];
+ unsigned long tags[2];
+};
+
+struct radix_tree_path {
+ struct radix_tree_node *node, **slot;
+ int offset;
+};
+
+void radix_tree_tag_clear(struct radix_tree_root *root, unsigned long index)
+{
+ struct radix_tree_path path[7], *pathp = path;
+ unsigned int height, shift;
+ volatile unsigned long *addr;
+
+ height = root->height;
+
+ shift = (height - 1) * 6;
+ path[0].slot = &root->rnode;
+
+ while (height > 0) {
+ int offset;
+
+ offset = (index >> shift) & (64-1);
+ pathp[1].offset = offset;
+ pathp[1].node = *pathp[0].slot;
+ pathp[1].slot = (struct radix_tree_node **)
+ (pathp[1].node->slots + offset);
+ pathp++;
+ shift -= 6;
+ height--;
+ }
+
+ addr = &(pathp->node->tags[0]) + 1;
+ *addr = 574;
+}
+
+struct radix_tree_root r;
+struct radix_tree_node node;
+
+int main ()
+{
+ r.height = 1;
+ r.rnode = &node;
+
+ memset (&node, 0, sizeof (node));
+
+ node.count = 1;
+
+ radix_tree_tag_clear (&r, 13);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-3.c
new file mode 100644
index 000000000..869b1e914
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-3.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+void abort (void);
+
+void radix_tree_tag_clear (int *node)
+{
+ int *path[2], **pathp = path, height;
+ volatile int *addr;
+
+ height = 1;
+ pathp[0] = node;
+
+ while (height > 0) {
+ pathp[1] = pathp[0];
+ pathp++;
+ height--;
+ }
+
+ addr = pathp[0];
+ *addr = 1;
+}
+
+int main ()
+{
+ int n;
+ radix_tree_tag_clear (&n);
+ if (n != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-4.c
new file mode 100644
index 000000000..ad619377b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-4.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+void abort (void);
+
+int f(int i1243)
+{
+ int i[2], *i1 = i;
+ i[0] = 1;
+ volatile int *i2 = i1;
+ i2[1] = 1;
+ i1243 = 0;
+ return i2[1]+i2[0];
+}
+
+
+int main(void)
+{
+ if( f(100) != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-5.c
new file mode 100644
index 000000000..0ddb55f75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18241-5.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+void abort (void);
+
+int main ()
+{
+ int a;
+ volatile int *b = &a;
+ a = 1;
+ if (*b != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18479.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18479.c
new file mode 100644
index 000000000..493574e8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18479.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+struct __attribute__ ((visibility("default"))) Foo { int foo; }; /* { dg-warning "attribute ignored on types" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18501.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18501.c
new file mode 100644
index 000000000..8794486ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18501.c
@@ -0,0 +1,20 @@
+/* Expected uninitialized variable warning. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+unsigned bmp_iter_set ();
+int something (void);
+
+void
+bitmap_print_value_set (void)
+{
+ unsigned first; /* { dg-warning "may be used" "conditional in loop" { xfail *-*-* } } */
+
+ for (; bmp_iter_set (); )
+ {
+ if (!first)
+ something ();
+ first = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18502-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18502-1.c
new file mode 100644
index 000000000..038c8104a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18502-1.c
@@ -0,0 +1,7 @@
+/* Test that -trigraphs isn't reordered before -std=gnu99. Bug
+ 18502. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -trigraphs" } */
+
+int a??(2??);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18520-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18520-1.c
new file mode 100644
index 000000000..872d3a946
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18520-1.c
@@ -0,0 +1,11 @@
+/* PR middle-end/18520 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern int isnan (double __value) __attribute__ ((__const__));
+
+int gsl_isnan (const double x)
+{
+ return isnan(x);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-1.c
new file mode 100644
index 000000000..dc34f444e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-1.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-unit-at-a-time" } */
+
+int f(int i)
+{
+ static int g(); /* { dg-error "invalid storage class" } */
+ static int g() { return i; } /* { dg-error "invalid storage class" } */
+ return g();
+}
+
+int k (int i)
+{
+ static int g (); /* { dg-error "invalid storage class" } */
+ int g () {
+ return i;
+ }
+
+ return g ();
+}
+
+int l (int i)
+{
+ auto int g ();
+ static int g () { /* { dg-error "invalid storage class" } */
+ return i;
+ }
+
+ static int h () { /* { dg-error "invalid storage class" } */
+ return 3;
+ }
+ return g () + h ();
+}
+
+int m (int i)
+{
+ static g (); /* { dg-error "invalid storage class" } */
+ static g () { return i; } /* { dg-error "invalid storage class" } */
+ return g ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-2.c
new file mode 100644
index 000000000..7a52e807d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-2.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-funit-at-a-time" } */
+
+int f(int i)
+{
+ static int g(); /* { dg-error "invalid storage class" } */
+ static int g() { return i; } /* { dg-error "invalid storage class" } */
+ return g();
+}
+
+int k (int i)
+{
+ static int g (); /* { dg-error "invalid storage class" } */
+ int g () {
+ return i;
+ }
+
+ return g ();
+}
+
+int l (int i)
+{
+ auto int g ();
+ static int g () { /* { dg-error "invalid storage class" } */
+ return i;
+ }
+
+ static int h () { /* { dg-error "invalid storage class" } */
+ return 3;
+ }
+ return g () + h ();
+}
+
+int m (int i)
+{
+ static g (); /* { dg-error "invalid storage class" } */
+ static g () { return i; } /* { dg-error "invalid storage class" } */
+ return g ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-3.c
new file mode 100644
index 000000000..74a6e63b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18596-3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int foo ()
+{
+ static g () = 0; /* { dg-error "invalid storage class" } */
+ static int f () = 1; /* { dg-error "invalid storage class" } */
+ auto int h () = 0; /* { dg-error "initialized like a variable" } */
+ /* { dg-error "declared but never defined" "nested" { target *-*-* } 8 } */
+ static int i () = { 0 }; /* { dg-error "invalid storage class" } */
+ static int j () = /* { dg-error "invalid storage class" } */
+ { 0, 0.0 };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18628.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18628.c
new file mode 100644
index 000000000..d365075b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18628.c
@@ -0,0 +1,31 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+/* PR middle-end/18628 exposed a problem in which cse folded a load
+ from a jump table into the label that was the target of the branch.
+ Unfortunately, the indirect jump was moved to a different basic
+ block, and the LABEL_REF copied to the register wasn't enough to
+ keep the cfg from optimizing the otherwise-unused label away. So
+ we ended up with a dangling reference to the label. */
+
+int i;
+
+int main()
+{
+ for (;;)
+ {
+ switch (i)
+ {
+ case 0:
+ case 1:
+ return 1;
+
+ case 2:
+ case 3:
+ return 0;
+
+ case 5:
+ --i;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18725.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18725.c
new file mode 100644
index 000000000..0282d3b61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18725.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f (void)
+{
+ int x = 1;
+ asm ("" : "" (x), "" (x)); /* { dg-error "output operand constraint lacks" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18809-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18809-1.c
new file mode 100644
index 000000000..3b6e8cc18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18809-1.c
@@ -0,0 +1,10 @@
+/* PR c/18809 */
+/* Origin: Andrew Pinski <pinskia@gcc.gnu.org> */
+
+/* { dg-do compile } */
+
+void foo(enum E e) {} /* { dg-error "forward ref" "forward" } */
+ /* { dg-warning "declared" "declared" { target *-*-* } 6 } */
+ /* { dg-warning "scope" "scope" { target *-*-* } 6 } */
+ /* { dg-error "incomplete" "incomplete" { target *-*-* } 6 } */
+void bar() { foo(0); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18921-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18921-1.c
new file mode 100644
index 000000000..b8c91aa09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18921-1.c
@@ -0,0 +1,20 @@
+/* PR middle-end/18921 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int foo (int k)
+{
+ unsigned char j = 0;
+ (k ? 0 : j++) == -1;
+ return j;
+}
+
+int main ()
+{
+ if (!foo (0))
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18928-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18928-1.c
new file mode 100644
index 000000000..406b2fcab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18928-1.c
@@ -0,0 +1,20 @@
+/* PR rtl-optimization/18928 */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fPIC" } */
+
+const char *toHex( unsigned short u )
+{
+ static char hexVal[5];
+ int i = 3;
+ while ( i >= 0 ) {
+ unsigned short hex = (u & 0x000f);
+ if ( hex < 0x0a )
+ hexVal[i] = '0'+hex;
+ else
+ hexVal[i] = 'A'+(hex-0x0a);
+ i--;
+ }
+ hexVal[4] = '\0';
+ return hexVal;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr18963-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr18963-1.c
new file mode 100644
index 000000000..df43c6543
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr18963-1.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "" } */
+
+static int barf ();
+
+int foo ()
+{
+ auto int barf ();
+ int j = 4;
+
+ int barf () {
+ return j;
+ }
+
+ return barf ();
+}
+
+static int barf () {
+ return 3;
+}
+
+extern void exit (int);
+extern void abort ();
+
+int main (int argc, char *argv[]) {
+ if (foo () != 4)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19105.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19105.c
new file mode 100644
index 000000000..499aa8956
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19105.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/19105 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1-details" } */
+
+enum e
+{
+ a, b, c, d, e, f, g, h
+};
+
+int range1 (enum e v, int x)
+{
+ return x && v != c && v != d && v != e;
+}
+
+int range2 (enum e v, int x)
+{
+ return x && (v != c && v != d && v != e);
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests v_\[0-9\]*.D. -.2, 2. and -.3, 4.\[\n\r\]* into|Optimizing range tests v_\[0-9\]*.D. -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19340.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19340.c
new file mode 100644
index 000000000..c75d35d1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19340.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fschedule-insns2 -fsched2-use-superblocks" } */
+/* { dg-require-effective-target scheduling } */
+
+extern double f (double x);
+
+double g (int a)
+{
+ int b, c, d, e = 0;
+ double h;
+
+ for (d = 0; d < a; d++)
+ for (c = 0; c < a; c++)
+ b = 1;
+
+ h = (double) e / (double) a;
+
+ if (h)
+ {
+ h = 1.0 / h;
+ h = f (h);
+ }
+ else
+ h = 1.0;
+
+ return h;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19345.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19345.c
new file mode 100644
index 000000000..40c6de4d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19345.c
@@ -0,0 +1,12 @@
+/* We shouldn't crash trying to produce the inlined structure type die debug info. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -g" } */
+inline void bar(char a[], unsigned int l)
+{
+ asm volatile ("" :: "m" ( *(struct {char x[l]; } *)a));
+}
+
+void foo(void)
+{
+ bar (0, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19402-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19402-1.c
new file mode 100644
index 000000000..866ac63cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19402-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+float test_powif(float x)
+{
+ return __builtin_powif(x, -1)
+ + __builtin_powif(x, 0)
+ + __builtin_powif(x, 1)
+ + __builtin_powif(x, 2);
+}
+
+double test_powi(double x)
+{
+ return __builtin_powi(x, -1)
+ + __builtin_powi(x, 0)
+ + __builtin_powi(x, 1)
+ + __builtin_powi(x, 2);
+}
+
+long double test_powil(long double x)
+{
+ return __builtin_powil(x, -1)
+ + __builtin_powil(x, 0)
+ + __builtin_powil(x, 1)
+ + __builtin_powil(x, 2);
+}
+
+/* { dg-final { scan-assembler-not "__builtin_" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19402-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19402-2.c
new file mode 100644
index 000000000..1902227a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19402-2.c
@@ -0,0 +1,82 @@
+/* { dg-do run } */
+/* { dg-options "-fno-inline -Os" } */
+
+void abort(void);
+
+
+float powif(float x, int n)
+{
+ return __builtin_powif(x, n);
+}
+
+double powi(double x, int n)
+{
+ return __builtin_powi(x, n);
+}
+
+long double powil(long double x, int n)
+{
+ return __builtin_powil(x, n);
+}
+
+
+float powcif(float x)
+{
+ return __builtin_powif(x, 5);
+}
+
+double powci(double x)
+{
+ return __builtin_powi(x, 5);
+}
+
+long double powcil(long double x)
+{
+ return __builtin_powil(x, 5);
+}
+
+
+float powicf(int n)
+{
+ return __builtin_powif(2.0, n);
+}
+
+double powic(int n)
+{
+ return __builtin_powi(2.0, n);
+}
+
+long double powicl(int n)
+{
+ return __builtin_powil(2.0, n);
+}
+
+
+int main()
+{
+ if (__builtin_powi(1.0, 5) != 1.0)
+ abort();
+ if (__builtin_powif(1.0, 5) != 1.0)
+ abort();
+ if (__builtin_powil(1.0, 5) != 1.0)
+ abort();
+ if (powci(1.0) != 1.0)
+ abort();
+ if (powcif(1.0) != 1.0)
+ abort();
+ if (powcil(1.0) != 1.0)
+ abort();
+ if (powi(1.0, -5) != 1.0)
+ abort();
+ if (powif(1.0, -5) != 1.0)
+ abort();
+ if (powil(1.0, -5) != 1.0)
+ abort();
+ if (powic(1) != 2.0)
+ abort();
+ if (powicf(1) != 2.0)
+ abort();
+ if (powicl(1) != 2.0)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19633-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19633-1.c
new file mode 100644
index 000000000..c05e46aef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19633-1.c
@@ -0,0 +1,66 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+struct S
+{
+ int w, x, y, z;
+};
+
+struct T
+{
+ int r;
+ struct S s;
+};
+
+struct S bar (struct S x, struct S *y)
+{
+ y->w = 4;
+ return *y;
+}
+
+void
+foo (int a, struct T b)
+{
+ struct S x;
+ struct S *c = &x;
+ if (a)
+ c = &b.s;
+ b.s.w = 3;
+ /* This call should be marked as clobbering 'x' and 'b'. */
+ *c = bar (*c, c);
+ if (b.s.w == 3)
+ abort ();
+}
+
+float Y;
+
+struct S bar1 (struct S x, struct S y)
+{
+ Y = 4;
+ return x;
+}
+
+void
+foo1 (int a, struct T b)
+{
+ struct S x;
+ struct S *c = &x;
+ float z, *k = &z;
+ if (a)
+ c = &b.s;
+ b.s.w = 3;
+ /* This call should NOT be marked as clobbering 'x' and 'b'. */
+ x = bar1 (*c, *c);
+ if (b.s.w != 3)
+ link_error ();
+}
+
+int main ()
+{
+ struct T b;
+ foo (3, b);
+ foo1 (3, b);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19633.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19633.c
new file mode 100644
index 000000000..fda0df6c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19633.c
@@ -0,0 +1,49 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+struct S
+{
+ int w, x, y, z;
+};
+
+struct T
+{
+ int r;
+ struct S s;
+};
+
+void
+foo (int a, struct T b)
+{
+ struct S *c = 0;
+
+ if (a)
+ c = &b.s;
+
+ b.s.w = 3;
+
+ /* Since 'c' may be pointing to NULL here, we used to flag it as
+ pointing anywhere, which was forcing the aliaser to mark as
+ call-clobbered every other variable pointed-to by 'c' ('b' in
+ this case). This, in turn, caused the insertion of V_MAY_DEFs
+ for 'b' at this call-site, which prevented constant propagation
+ from 'b.s.w = 3' to 'if (b.s.w != 3)'. */
+ bar (*c, a);
+
+ if (b.s.w != 3)
+ link_error ();
+}
+
+int main ()
+{
+ struct T b;
+ foo (3, b);
+ return 0;
+}
+
+int X;
+
+int bar (struct S x, int i)
+{
+ X = 3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19967.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19967.c
new file mode 100644
index 000000000..85afeafe2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19967.c
@@ -0,0 +1,26 @@
+/* PR middle-end/19967
+ These functions mentioned below are supposed to return char *.
+ However, fold_builtin_... had bugs that caused the return types to
+ be const char *. */
+
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+char *strchr(const char *, int);
+char *strrchr(const char *, int);
+char *index(const char *, int);
+char *rindex(const char *, int);
+char *strpbrk(const char *, const char *);
+char *strstr(const char *, const char *);
+char *p;
+
+void
+f (void)
+{
+ p = strchr(__func__, 'f');
+ p = strrchr(__func__, 'f');
+ p = index(__func__, 'f');
+ p = rindex(__func__, 'f');
+ p = strpbrk(__func__, "f");
+ p = strstr(__func__, "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19984.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19984.c
new file mode 100644
index 000000000..5323c461f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19984.c
@@ -0,0 +1,17 @@
+/* PR c/19984 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=c99" } */
+
+
+double nan (const char *);
+
+const double nok = nan (""); /* { dg-warning "(not a constant)|(near initialization)" } */
+
+const double ok = __builtin_nan ("");
+
+double
+foo ()
+{
+ double ok2 = nan ("");
+ return ok2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr19988.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr19988.c
new file mode 100644
index 000000000..aa2fed139
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr19988.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized -fdump-tree-original" } */
+
+double foo(double x, double y)
+{
+ return ((x + 0.1234 * y) * (x - 0.1234 * y));
+}
+
+/* Keep positive constants during folding. */
+/* { dg-final { scan-tree-dump-times " 1.23" 2 "original" } } */
+/* CSE one multiplication. */
+/* { dg-final { scan-tree-dump-times " \\\* " 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20017.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20017.c
new file mode 100644
index 000000000..47c048fdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20017.c
@@ -0,0 +1,41 @@
+/* PR rtl-optimization/20017
+
+ After CSE/GCSE folds a switch statement to an unconditional jump,
+ cfg_cleanup did not remove a dead jump table, confusing the CFG
+ layout code later on. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+/* { dg-options "-O1 -march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+int
+foo (int *buf, int *p)
+{
+ int result;
+ const int *tmp;
+
+ if (*buf)
+ return 1;
+
+ result = 2;
+ *buf = 2;
+ tmp = buf;
+ switch (*tmp)
+ {
+ case 3:
+ case 4:
+ case 6:
+ case 14:
+ return 1;
+
+ case 0:
+ result = *p;
+
+ /* Fall through. */
+ default:
+ if (result)
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20054.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20054.c
new file mode 100644
index 000000000..292b856d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20054.c
@@ -0,0 +1,23 @@
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing" } */
+
+
+unsigned int *foo (void);
+
+char *
+bar (double *d)
+{
+ return (char *) (d + 1) - sizeof (unsigned int);
+}
+
+char
+baz (double x)
+{
+ unsigned int h = *foo ();
+ unsigned int l = *(unsigned int *) bar (&x);
+
+ return (h & ~0x80000000L) == 0x7FF00000 && l == 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20100.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20100.c
new file mode 100644
index 000000000..988fbda64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20100.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int func_pure (void) __attribute__ ((pure));
+void func_other (int);
+int global_int;
+void abort ();
+void func_other(int a)
+{
+ if (a != global_int)
+ abort ();
+ global_int++;
+}
+
+int func_pure(void)
+{
+ return global_int;
+}
+
+int
+func_loop (int arg)
+{
+ // global_int ++;
+ while (arg--)
+ func_other (func_pure ());
+}
+
+int main(void)
+{
+ func_loop(10);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20115-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20115-1.c
new file mode 100644
index 000000000..60313cd53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20115-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom1" } */
+
+extern int foo (void) __attribute__((pure));
+
+int bar()
+{
+ int a = foo ();
+ a += foo ();
+ return a;
+}
+
+/* Check that we only have one call to foo. */
+/* { dg-final { scan-tree-dump-times "foo" 1 "dom1" } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20115.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20115.c
new file mode 100644
index 000000000..cea4b4868
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20115.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int func_pure (void);
+void func_other (int);
+int global_int;
+int func_pure (void) { return global_int; }
+void func_other (int a)
+{
+ global_int = a + 1;
+}
+int f(void)
+{
+ int a;
+ a = func_pure();
+ func_other (a);
+ a = func_pure (); // We were removing this function call
+ return a;
+}
+void abort (void);
+
+int main(void)
+{
+ global_int = 10;
+ if (f() != 11)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20126.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20126.c
new file mode 100644
index 000000000..257832ab1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20126.c
@@ -0,0 +1,50 @@
+/* dg-do run */
+/* dg-options "-O2" */
+
+/* PR target/20126 was not really target-specific, but rather a loop's
+ failure to take into account the possibility that a DEST_ADDR giv
+ replacement might fail, such as when you attempt to replace a REG
+ with a PLUS in one of the register_operands of cmpstrqi_rex_1. */
+
+extern void abort (void);
+
+typedef struct { int a; char b[3]; } S;
+S c = { 2, "aa" }, d = { 2, "aa" };
+
+void *
+bar (const void *x, int y, int z)
+{
+ return (void *) 0;
+}
+
+int
+foo (S *x, S *y)
+{
+ const char *e, *f, *g;
+ int h;
+
+ h = y->a;
+ f = y->b;
+ e = x->b;
+
+ if (h == 1)
+ return bar (e, *f, x->a) != 0;
+
+ g = e + x->a - h;
+ while (e <= g)
+ {
+ const char *t = e + 1;
+ if (__builtin_memcmp (e, f, h) == 0)
+ return 1;
+ e = t;
+ }
+ return 0;
+}
+
+int
+main (void)
+{
+ if (foo (&c, &d) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20130-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20130-1.c
new file mode 100644
index 000000000..976372560
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20130-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+int z (int a) {
+ return a * -1;
+}
+
+int x (int a) {
+ return -1 * a;
+}
+
+int y (int a) {
+ return -(-1 * -a);
+}
+/* { dg-final { scan-tree-dump-times "-a" 3 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20216.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20216.c
new file mode 100644
index 000000000..1014ef3e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20216.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+static unsigned int *buffer;
+
+void FUNC (void)
+{
+ unsigned int *base;
+ int i, j;
+
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 1600000; j++)
+ *base++ = buffer[j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20245-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20245-1.c
new file mode 100644
index 000000000..51089c6e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20245-1.c
@@ -0,0 +1,5 @@
+/* Bug 20245: the parse error should not result in an ICE. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void foo() x; /* { dg-error "expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-1.c
new file mode 100644
index 000000000..4140397c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-1.c
@@ -0,0 +1,12 @@
+/* ICE with -Wstrict-prototypes and typeof an undeclared function.
+ Bug 20368. */
+/* { dg-do compile } */
+/* { dg-options "-Wstrict-prototypes" } */
+
+extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
+
+int
+f (x) /* { dg-warning "function declaration isn't a prototype" } */
+ float x;
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-2.c
new file mode 100644
index 000000000..7faded6bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-2.c
@@ -0,0 +1,12 @@
+/* ICE with -Wstrict-prototypes and typeof an undeclared function.
+ Bug 20368. Test with -Wmissing-prototypes. */
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-prototypes" } */
+
+extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
+
+int
+f (x) /* { dg-warning "no previous prototype for 'f'" } */
+ float x;
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-3.c
new file mode 100644
index 000000000..0d0ea6dfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20368-3.c
@@ -0,0 +1,12 @@
+/* ICE with -Wstrict-prototypes and typeof an undeclared function.
+ Bug 20368. Test with -Wmissing-declarations. */
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-declarations" } */
+
+extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
+
+int
+f (x) /* { dg-warning "no previous declaration for 'f'" } */
+ float x;
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20672-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20672-1.c
new file mode 100644
index 000000000..e47fef3fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20672-1.c
@@ -0,0 +1,7 @@
+/* EOF must cause an error inside a function, not just set parser->error.
+ Bug 20672. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+int main(void)
+{
+int a; /* { dg-error "expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-1.c
new file mode 100644
index 000000000..cfa8a29ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-1.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-wrapv -fstrict-overflow -fdump-tree-gimple" } */
+int f(int i)
+{
+ return (i - 2) > i;
+}
+
+int g(int i)
+{
+ return (i + 2) < i;
+}
+
+int h(int i)
+{
+ return (i + (-2)) > i;
+}
+
+int j(int i)
+{
+ return (i - (-2)) < i;
+}
+
+int x(double i)
+{
+ return (i - 2.0) > i;
+}
+
+int y(double i)
+{
+ return (i + 2.0) < i;
+}
+
+int z(double i)
+{
+ return (i + (-2.0)) > i;
+}
+/* { dg-final { scan-tree-dump-times " = 0" 7 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-2.c
new file mode 100644
index 000000000..4bbebfd5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fwrapv -fdump-tree-gimple" } */
+int f (int i)
+{
+ return (i - 2) > i;
+}
+
+int g (int i)
+{
+ return (i + 2) < i;
+}
+
+int h (double i)
+{
+ return (i + 2.0) <= i;
+}
+/* { dg-final { scan-tree-dump-times " = 0" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-3.c
new file mode 100644
index 000000000..84ecafef9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-3.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math -fno-wrapv -fstrict-overflow -fdump-tree-gimple" } */
+int f(int i)
+{
+ return (i - 2) <= i;
+}
+
+int g(int i)
+{
+ return (i + 2) >= i;
+}
+
+int h(int i)
+{
+ return (i + (-2)) <= i;
+}
+
+int x(double i)
+{
+ return (i - 2.0) <= i;
+}
+
+int y(double i)
+{
+ return (i + 2.0) >= i;
+}
+
+int z(double i)
+{
+ return (i + (-2.0)) <= i;
+}
+/* { dg-final { scan-tree-dump-times " = 1" 6 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-4.c
new file mode 100644
index 000000000..0240435fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-4.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-wrapv -fstrict-overflow -fdump-tree-gimple" } */
+int f(int i)
+{
+ return i < (i - 2);
+}
+
+int g(int i)
+{
+ return i > (i + 2);
+}
+
+int h(int i)
+{
+ return i < (i + (-2));
+}
+
+int j(int i)
+{
+ return i > (i - (-2));
+}
+
+int x(double i)
+{
+ return i < (i - 2.0);
+}
+
+int y(double i)
+{
+ return i > (i + 2.0);
+}
+
+int z(double i)
+{
+ return i < (i + (-2.0));
+}
+/* { dg-final { scan-tree-dump-times " = 0" 7 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-5.c
new file mode 100644
index 000000000..db94c7ba0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-5.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-fsignaling-nans -fwrapv -fdump-tree-gimple" } */
+int f(int i)
+{
+ return i < (i - 2);
+}
+
+int g(int i)
+{
+ return i > (i + 2);
+}
+
+int h (double i)
+{
+ return i >= i + 2.0;
+}
+
+int j (double i)
+{
+ return i > i + 2.0;
+}
+/* { dg-final { scan-tree-dump-times " = 0" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-6.c
new file mode 100644
index 000000000..65a8f1d56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr20922-6.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math -fno-wrapv -fstrict-overflow -fdump-tree-gimple" } */
+int f(int i)
+{
+ return i >= (i - 2);
+}
+
+int g(int i)
+{
+ return i <= (i + 2);
+}
+
+int h(int i)
+{
+ return i >= (i + (-2));
+}
+
+int x(double i)
+{
+ return i >= (i - 2.0);
+}
+
+int y(double i)
+{
+ return i <= (i + 2.0);
+}
+
+int z(double i)
+{
+ return i >= (i + (-2.0));
+}
+/* { dg-final { scan-tree-dump-times " = 1" 6 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21032.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21032.c
new file mode 100644
index 000000000..839a180ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21032.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized -frounding-math" } */
+
+void bar(float x);
+void foo(double x)
+{
+ bar(-x);
+}
+
+/* { dg-final { scan-tree-dump-not "-\\(float\\)" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21041.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21041.c
new file mode 100644
index 000000000..34ed14d1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21041.c
@@ -0,0 +1,42 @@
+
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fPIC" } */
+
+struct args
+{
+ short int matrix[8][8];
+ char **current;
+};
+
+int test (struct args *args, char *init, int a, int b)
+{
+ int i, j, k;
+
+ if (!args || a > b || a < 0)
+ return -1;
+
+ for (i = 0; i < 2; i++)
+ {
+ char *dest = *args->current;
+ char *p = dest;
+
+ for (j = 0; j < 8; j++)
+ *p++ = *init++;
+
+ for (k = 0; k < 8; k++)
+ {
+ short int *blockvals = &args->matrix[k][0];
+ dest[0] += blockvals[0];
+ dest[1] += blockvals[1];
+ dest[2] += blockvals[2];
+ dest[3] += blockvals[3];
+ dest[4] += blockvals[4];
+ dest[5] += blockvals[5];
+ dest[6] += blockvals[6];
+ dest[7] += blockvals[7];
+ }
+ }
+
+ return 1;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21085.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21085.c
new file mode 100644
index 000000000..6a51adb90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21085.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* This used to cause excessive use, or a stack overflow, depending on which
+ came first. */
+void foo (void)
+{
+ int maxstringlen = 1;
+ int limit = 0, maxblock = 0, maxblockrem = 0;
+ maxblockrem = (maxstringlen) % (2147483647 + 1); /* { dg-warning "overflow" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21282.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21282.c
new file mode 100644
index 000000000..427e39385
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21282.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+extern double floor (double);
+
+long foo (float f)
+{
+ return (long) floor (f);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21419.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21419.c
new file mode 100644
index 000000000..120ed7f14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21419.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+const int i = 0;
+
+void f(void)
+{
+ __asm__ __volatile__ ("" : "=m" (i)); /* { dg-error "read-only variable" } */
+
+}
+
+void g(const int set)
+{
+ __asm__ __volatile__ ("" : "=r" (set)); /* { dg-error "read-only parameter" } */
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21643.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21643.c
new file mode 100644
index 000000000..be5a15e98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21643.c
@@ -0,0 +1,90 @@
+/* PR tree-optimization/21643 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1-details" } */
+
+int
+f1 (unsigned char c)
+{
+ if (c == 0x22 || c == 0x20 || c < 0x20)
+ return 1;
+ return 0;
+}
+
+int
+f2 (unsigned char c)
+{
+ if (c == 0x22 || c <= 0x20)
+ return 1;
+ return 0;
+}
+
+int
+f3 (unsigned char c)
+{
+ if (c == 0x22)
+ return 1;
+ if (c == 0x20)
+ return 1;
+ if (c < 0x20)
+ return 1;
+ return 0;
+}
+
+int
+f4 (unsigned char c)
+{
+ if (c == 0x22 || c == 0x20 || c < 0x20)
+ return 2;
+ return 0;
+}
+
+int
+f5 (unsigned char c)
+{
+ if (c == 0x22 || c <= 0x20)
+ return 2;
+ return 0;
+}
+
+int
+f6 (unsigned char c)
+{
+ if (c == 0x22)
+ return 2;
+ if (c == 0x20)
+ return 2;
+ if (c < 0x20)
+ return 2;
+ return 0;
+}
+
+int
+f7 (unsigned char c)
+{
+ if (c != 0x22 && c != 0x20 && c >= 0x20)
+ return 0;
+ return 1;
+}
+
+int
+f8 (unsigned char c)
+{
+ if (c == 0x22 && c <= 0x20)
+ return 0;
+ return 1;
+}
+
+int
+f9 (unsigned char c)
+{
+ if (c == 0x22)
+ return 0;
+ if (c == 0x20)
+ return 0;
+ if (c < 0x20)
+ return 0;
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests c_\[0-9\]*.D. -.0, 31. and -.32, 32.\[\n\r\]* into" 6 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21709-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21709-1.c
new file mode 100644
index 000000000..0d6f20f32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21709-1.c
@@ -0,0 +1,6 @@
+/* PR middle-end/21709 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+double _Complex f(void) { return 1.0iF / 0.0; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21858.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21858.c
new file mode 100644
index 000000000..41cd240c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21858.c
@@ -0,0 +1,15 @@
+/* Fold used to create a GT_EXPR of pointer vs. integer types,
+ which caused us to ICE in VRP. */
+
+/* { dg-do compile } */
+/* { dg-options "-Os -w" } */
+
+unsigned int dsdblm_GetBlockAddress();
+void error_LocalAssert(void);
+int dsdblm_CreateBlock(unsigned int address)
+{
+ address = dsdblm_GetBlockAddress();
+ if (address >= (void*)0x00020000)
+ error_LocalAssert();
+ return address;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr21921.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr21921.c
new file mode 100644
index 000000000..d6a8a2a94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr21921.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -funsafe-math-optimizations" } */
+
+void
+Q (double *s, double h)
+{
+ int i;
+ if (h > 1)
+ h = h - 1;
+
+ for (i = 1; i < 3; i++)
+ if (s[i] / h > 0)
+ s[0] = h, s[i] = s[i] / h;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr22231.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr22231.c
new file mode 100644
index 000000000..210700684
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr22231.c
@@ -0,0 +1,7 @@
+/* Test case for PR 22231. -c and -MG are invalid together. */
+
+/* { dg-do compile } */
+/* { dg-options "-MG -MD -c" } */
+/* { dg-error "may only be used with -M" "-MG incompatible with -c" { target *-*-* } 0 } */
+
+int anything;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr22308-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr22308-1.c
new file mode 100644
index 000000000..2b3067577
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr22308-1.c
@@ -0,0 +1,13 @@
+/* Bug 22308: C_TYPE_FIELDS_READONLY not updated on type variants. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct foo s;
+volatile struct foo t;
+struct foo { const int z; };
+
+void
+bar (void)
+{
+ t = s; /* { dg-error "assignment of read-only variable 't'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr22311-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr22311-1.c
new file mode 100644
index 000000000..4eec5ce9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr22311-1.c
@@ -0,0 +1,6 @@
+/* Bug 22311: ICE with -fshort-enums on shortened operations. */
+/* { dg-do compile } */
+/* { dg-options "-fshort-enums" } */
+
+typedef enum { A = 1 } E;
+void f(E e, unsigned char c) { c |= e; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr22329.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr22329.c
new file mode 100644
index 000000000..94e32d695
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr22329.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+int f(int i)
+{
+ int k = 0;
+ if (i == 0)
+ k = i == 0;
+ return k;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr22335-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr22335-1.c
new file mode 100644
index 000000000..a2a760bfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr22335-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdelete-null-pointer-checks" } */
+int t(int *a)
+{
+ int i;
+ *a = 1;
+ i = a == 0;
+ return i;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr22335-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr22335-2.c
new file mode 100644
index 000000000..afba95521
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr22335-2.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+void abort(void) __attribute__((__noreturn__));
+typedef struct {
+ int container;
+} edge_iterator;
+struct ls_expr
+{
+ int index;
+ int stores;
+ struct ls_expr * next;
+};
+struct ls_expr * pre_ldst_mems;
+edge_iterator ei;
+void
+store_motion (void)
+{
+ struct ls_expr * ptr, **prev_next_ptr_ptr;
+ edge_iterator ei1;
+ edge_iterator ei2;
+ int a = ptr != ((void *)0);
+ for (ptr = pre_ldst_mems, prev_next_ptr_ptr = &pre_ldst_mems;
+ ptr != ((void *)0);
+ ptr = *prev_next_ptr_ptr)
+ if (!((ptr)->stores))
+ *prev_next_ptr_ptr = ptr->next;
+ else
+ prev_next_ptr_ptr = &ptr->next;
+
+ for (ptr = pre_ldst_mems; ptr != 0; ptr = ptr->next)
+ ;
+ ei1 = ei;
+ ei2 = ei1;
+ if (!ei2.container)
+ abort ();
+ ei2 = ei1;
+ if (!ei2.container)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr22356-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr22356-1.c
new file mode 100644
index 000000000..118b0b2d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr22356-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99" } */
+typedef _Complex float GFC_COMPLEX_4;
+void product_c4 (GFC_COMPLEX_4 *src, GFC_COMPLEX_4 *dest, int len)
+{
+ int n;
+ GFC_COMPLEX_4 result;
+ for (n = 0; n < len; n++, src += 1)
+ result *= *src;
+ *dest = result;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr22458-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr22458-1.c
new file mode 100644
index 000000000..8b8032c41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr22458-1.c
@@ -0,0 +1,4 @@
+/* { dg-error "expected declaration or statement" "" { target *-*-* } 0 } */
+void foo()
+{
+ __PRETTY_FUNCTION__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23049.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23049.c
new file mode 100644
index 000000000..e58cef8fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23049.c
@@ -0,0 +1,27 @@
+/* This was an ICE in fold where we tried to fold something like,
+
+ a = 0 == 0 ? 0 : 3988292384
+
+ after doing if-conversion for the vectorizer. Folding "0 == 0"
+ should have been done before calling fold on the whole rhs of
+ the above expression. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-O3 -ftree-vectorize" } */
+
+static unsigned short int crc_table[256];
+void AC3_encode_init(void)
+{
+ unsigned int c, n, k;
+ for(n=0; n<256; n++)
+ {
+ c = n << 8;
+ for (k = 0; k < 8; k++)
+ {
+ if (c & (1 << 15))
+ c = ((c << 1) & 0xffff) ^ (((1 << 0) | (1 << 2) | (1 << 15) | (1 << 16)) & 0xffff);
+ }
+ crc_table[n] = c;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23075.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23075.c
new file mode 100644
index 000000000..2d85fb065
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23075.c
@@ -0,0 +1,14 @@
+/* PR c/23075 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wreturn-type" } */
+
+int
+foo (void)
+{
+ return; /* { dg-warning "with no value" } */
+} /* { dg-bogus "control reaches end" } */
+
+int
+bar (void)
+{
+} /* { dg-warning "control reaches end" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23165.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23165.c
new file mode 100644
index 000000000..49194a146
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23165.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-Wempty-body" } */
+void foo (void)
+{
+ if (0)
+ a: ; /* { dg-warning "empty body in an" } */
+
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23200.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23200.c
new file mode 100644
index 000000000..56bf59c86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23200.c
@@ -0,0 +1,22 @@
+/* PR inline-asm/23200 */
+/* { dg-do compile { target nonpic } } */
+/* { dg-options "-O0" } */
+
+static char var;
+
+void
+foo (void)
+{
+ asm volatile ("" :: "i" (&var + 1));
+}
+
+typedef int T[];
+typedef T *P;
+
+int var2;
+
+void
+bar (void)
+{
+ asm volatile ("" :: "i"(&(*(P)&var2)[1]));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23295.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23295.c
new file mode 100644
index 000000000..0418964a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23295.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int foo(int i)
+{
+ return -i - 5;
+}
+
+/* { dg-final { scan-tree-dump "-5 - i" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23408.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23408.c
new file mode 100644
index 000000000..ca8193fba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23408.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" } */
+static __inline__ int f () { return g (); }
+int g () { return f (); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23470-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23470-1.c
new file mode 100644
index 000000000..2ddf6f2f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23470-1.c
@@ -0,0 +1,12 @@
+/* PR middle-end/23470 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -fdump-tree-original" } */
+
+int f(double a, double b)
+{
+ if (((a*a) + (b*b))<0)
+ link_error();
+}
+
+/* { dg-final { scan-tree-dump-times "if \\(0\\)" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23518.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23518.c
new file mode 100644
index 000000000..3c6bd2754
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23518.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/23518.
+ make_range used to transform a + 1 < 0 into a < -1 even when a is
+ signed and -fwrapv is given. Make sure that no longer happens. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fwrapv" } */
+
+#include <limits.h>
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int a = INT_MAX;
+ if ((a < 0) || (a + 1 < 0))
+ exit (0);
+
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23547.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23547.c
new file mode 100644
index 000000000..210fae7ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23547.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" } */
+void foo()
+{
+ void bar()
+ {
+ bar();
+ }
+}
+
+void foo1(int i)
+{
+ void bar (char c[1][i]) { }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23584.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23584.c
new file mode 100644
index 000000000..691a11956
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23584.c
@@ -0,0 +1,21 @@
+/* Regression test for PR middle-end/23584 */
+/* Verify that dereferencing an absolute address inside of a function
+ makes that function impure. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-ipa-pure-const" } */
+
+int test1 (void)
+{
+ return * (volatile int *) 0x1234;
+}
+
+int test2 (void)
+{
+ int local = * (volatile int *) 0x1234;
+ return local;
+}
+
+/* { dg-final { scan-ipa-dump-not "found to be pure: test1" "pure-const" } } */
+/* { dg-final { scan-ipa-dump-not "found to be pure: test2" "pure-const" } } */
+/* { dg-final { cleanup-ipa-dump "pure-const" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23623.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23623.c
new file mode 100644
index 000000000..7ba147018
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23623.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fstrict-volatile-bitfields -fdump-rtl-final" } */
+
+/* With -fstrict-volatile-bitfields, the volatile accesses to bf2.b
+ and bf3.b must do unsigned int reads/writes. The non-volatile
+ accesses to bf1.b are not so constrained. */
+
+extern struct
+{
+ unsigned int b : 1;
+ unsigned int : 31;
+} bf1;
+
+extern volatile struct
+{
+ unsigned int b : 1;
+ unsigned int : 31;
+} bf2;
+
+extern struct
+{
+ volatile unsigned int b : 1;
+ volatile unsigned int : 31;
+} bf3;
+
+void writeb(void)
+{
+ bf1.b = 1;
+ bf2.b = 1; /* volatile read + volatile write */
+ bf3.b = 1; /* volatile read + volatile write */
+}
+
+extern unsigned int x1, x2, x3;
+
+void readb(void)
+{
+ x1 = bf1.b;
+ x2 = bf2.b; /* volatile write */
+ x3 = bf3.b; /* volatile write */
+}
+
+/* There should be 6 volatile MEMs total, but scan-rtl-dump-times counts
+ the number of match variables and not the number of matches. Since
+ the parenthesized subexpression in the regexp introduces an extra match
+ variable, we need to give a count of 12 instead of 6 here. */
+/* { dg-final { scan-rtl-dump-times "mem/v(/.)*:SI" 12 "final" } } */
+/* { dg-final { cleanup-rtl-dump "final" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23818.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23818.c
new file mode 100644
index 000000000..be0bb9a01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23818.c
@@ -0,0 +1,33 @@
+/* PR tree-optimization/23818 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-dominator-opts" } */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+void
+foo (int p[100], int k, ...)
+{
+ int j, *q;
+ va_list ap;
+
+ va_start (ap, k);
+ q = va_arg (ap, int *);
+ for (j = 0; j < 100; j++)
+ q[j] = p[j] + 10;
+ va_end(ap);
+}
+
+int
+main (void)
+{
+ int buf[100], buf2[100], i;
+ for (i = 0; i < 100; i++)
+ buf[i] = i + 1;
+ foo (buf, 0, buf2);
+ for (i = 0; i < 100; i++)
+ if (buf2[i] != buf[i] + 10)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr23911.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr23911.c
new file mode 100644
index 000000000..b77dbaab9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr23911.c
@@ -0,0 +1,21 @@
+/* This was a missed optimization in tree constant propagation
+ that CSE would catch later on. */
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dce2" } */
+
+double _Complex *a;
+static const double _Complex b[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+void
+test (void)
+{
+ a[0] = b[0] + b[1];
+ a[1] = b[0] + b[1];
+ return;
+}
+
+/* After DCE2 which runs after FRE, the expressions should be fully
+ constant folded. There should be no loads from b left. */
+/* { dg-final { scan-tree-dump-times "__complex__ \\\(1.0e\\\+0, 0.0\\\)" 2 "dce2" } } */
+/* { dg-final { scan-tree-dump-times "= b" 0 "dce2" } } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24101-1.i b/gcc-4.9/gcc/testsuite/gcc.dg/pr24101-1.i
new file mode 100644
index 000000000..45c165539
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24101-1.i
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-ansi" } */
+
+# 1 "/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.0/include/stddef.h" 1 3 4
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24101-2.i b/gcc-4.9/gcc/testsuite/gcc.dg/pr24101-2.i
new file mode 100644
index 000000000..501382da4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24101-2.i
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-ansi" } */
+
+#
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24225.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24225.c
new file mode 100644
index 000000000..4161c31bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24225.c
@@ -0,0 +1,15 @@
+/* This was an ICE caused by the compiler-generated stack save/restore
+ statements around s[b]. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fprofile-arcs" } */
+
+int
+foo (int a, int b)
+{
+ if (a)
+ return 1;
+ {
+ int s [b];
+ return 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24367.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24367.c
new file mode 100644
index 000000000..648671909
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24367.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fPIC -funroll-loops" } */
+
+char *
+test (const char *parent, const char *child)
+{
+ static char rtn_path[1024];
+ char *s = rtn_path;
+ char *s_end = rtn_path + sizeof (rtn_path);
+ const char *s2 = child;
+
+ while (*s != '\0')
+ s++;
+ while ((s < s_end) && (*s2 != '\0'))
+ *s++ = *s2++;
+ return (rtn_path);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24445.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24445.c
new file mode 100644
index 000000000..f34784ced
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24445.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O1 -fpic" } */
+extern int *bar (void) __attribute__ ((__pure__));
+extern char *baz;
+void
+foo (void)
+{
+ baz = (char *) bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24561.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24561.c
new file mode 100644
index 000000000..20ac00e0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24561.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+/* { dg-final { scan-assembler "debug_hook" } } */
+static int debug_hook()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24600.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24600.c
new file mode 100644
index 000000000..62bb7cad6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24600.c
@@ -0,0 +1,16 @@
+/* This used to ICE on s390 due to a old-loop bug. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+char *strcpy (char *dest, const char *src);
+
+void test (char *Line, int len)
+{
+ int z;
+
+ for (z = 1; z <= len; z++)
+ if (Line[z - 1])
+ strcpy (Line + z + 1, Line);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24615.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24615.c
new file mode 100644
index 000000000..9e4291175
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24615.c
@@ -0,0 +1,27 @@
+
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-Os -fPIC" } */
+
+void *memset (void *, int, __SIZE_TYPE__);
+void *memcpy (void *, const void *, __SIZE_TYPE__);
+
+char *alloc (int);
+
+char *
+test (int type, int size, char *data, int len)
+{
+ char *block = alloc (size);
+ char *bp = block;
+
+ *bp++ = type;
+ switch (type)
+ {
+ case 0:
+ case 1:
+ memset (bp, type == 0 ? 0x00 : 0xff, size);
+ memcpy (bp, data, len);
+ }
+
+ return block;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24620.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24620.c
new file mode 100644
index 000000000..926a524d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24620.c
@@ -0,0 +1,27 @@
+/* This used to ICE due to a backend problem on s390. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct rgba
+{
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ unsigned char a;
+};
+
+void g (struct rgba);
+
+void f (void)
+{
+ struct rgba x;
+
+ x.r = 0;
+ x.g = 128;
+ x.b = 128;
+ x.a = 26;
+
+ g (x);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24683.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24683.c
new file mode 100644
index 000000000..23cb3ab4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24683.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fPIC" } */
+const int *block;
+void final(unsigned int j)
+{
+ unsigned int i;
+ const unsigned char *data = (const unsigned char *)"\0";
+ for (i = 0; i < 8; i++)
+ for (; j + 63 < 1; j += 64)
+ block = (const int *) &data[j];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr24820.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr24820.c
new file mode 100644
index 000000000..0482ca321
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr24820.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double floor (double);
+double bar (double sum)
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ sum += floor (0.5 + (i - 128));
+ return sum;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr25023.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr25023.c
new file mode 100644
index 000000000..58d962c29
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr25023.c
@@ -0,0 +1,12 @@
+/* PR debug/25023 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern unsigned char v;
+
+float
+foo (void)
+{
+ return v;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr25376.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr25376.c
new file mode 100644
index 000000000..3008b091d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr25376.c
@@ -0,0 +1,9 @@
+/* PR25376. Verify that a named section is honored. */
+/* { dg-require-named-sections "" } */
+
+void simple (void) __attribute__((section("my_named_section")));
+void simple (void)
+{
+}
+
+/* { dg-final { scan-assembler "my_named_section" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr25559.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr25559.c
new file mode 100644
index 000000000..7879a1558
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr25559.c
@@ -0,0 +1,10 @@
+/* PR c/25559 */
+/* { dg-do compile } */
+
+#define vs(n) __attribute__((vector_size (n)))
+int vs (-1) a; /* { dg-warning "attribute ignored" } */
+int vs (0) b; /* { dg-error "zero vector size" } */
+int vs (1) c; /* { dg-error "multiple of component size" } */
+int vs (sizeof (int) / 2) d; /* { dg-error "multiple of component size" } */
+int vs (sizeof (int)) e;
+int vs (sizeof (int) * 2) f;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr25682.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr25682.c
new file mode 100644
index 000000000..e8cab1d05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr25682.c
@@ -0,0 +1,28 @@
+/* PR c/25682 */
+/* { dg-do compile } */
+/* { dg-options "-ansi" } */
+/* Test whether we don't ICE on questionable constructs where offsetof
+ should have been used instead. */
+
+struct S
+{
+ char a[4];
+ int b;
+};
+
+char c[(char *) &((struct S *) 0)->b - (char *) 0]; /* { dg-warning "variably modified" } */
+char d[(__UINTPTR_TYPE__) &((struct S *) 8)->b]; /* { dg-warning "variably modified" } */
+char e[sizeof (c) == __builtin_offsetof (struct S, b) ? 1 : -1];
+char f[sizeof (d) == __builtin_offsetof (struct S, b) + 8 ? 1 : -1];
+
+extern void bar (char *, char *);
+
+void
+foo (void)
+{
+ char g[(char *) &((struct S *) 0)->b - (char *) 0];
+ char h[(__UINTPTR_TYPE__) &((struct S *) 8)->b];
+ char i[sizeof (g) == __builtin_offsetof (struct S, b) ? 1 : -1];
+ char j[sizeof (h) == __builtin_offsetof (struct S, b) + 8 ? 1 : -1];
+ bar (g, h);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr25795-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr25795-1.c
new file mode 100644
index 000000000..e568b2544
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr25795-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fwhole-program" } */
+/* { dg-final { scan-assembler-not "mystr" } } */
+
+
+extern const char *mystr; /* normally in a header */
+const char *mystr;
+main()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr25795.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr25795.c
new file mode 100644
index 000000000..decbe54e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr25795.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fwhole-program" } */
+/* { dg-final { scan-assembler "mystr" } } */
+
+
+extern const char *mystr; /* normally in a header */
+const char *mystr __attribute__ ((externally_visible));
+main()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr25805.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr25805.c
new file mode 100644
index 000000000..94133ddd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr25805.c
@@ -0,0 +1,21 @@
+/* When -fzero-initialized-in-bss was in effect, we used to only allocate
+ storage for d1.a. */
+/* { dg-do run } */
+/* { dg-options "" } */
+/* { dg-skip-if "packed attribute missing for d1" { "epiphany-*-*" } { "*" } { "" } } */
+extern void abort (void);
+extern void exit (int);
+
+struct { int a; int x[]; } d1 = { 0, 0 };
+int d2 = 0;
+
+int
+main ()
+{
+ d2 = 1;
+ if (sizeof (d1) != sizeof (int))
+ abort ();
+ if (d1.x[0] != 0)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26004.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26004.c
new file mode 100644
index 000000000..35e6a2feb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26004.c
@@ -0,0 +1,11 @@
+/* PR c/26004 */
+/* Bug: the return slot optimization was taking the address of s_3,
+ causing an error. */
+
+struct s_3 { short s[3]; } z_3, s_3;
+struct s_3 add_struct_3 (struct s_3 s){}
+wack_struct_3 (void)
+{
+ int i; register struct s_3 u = z_3;
+ u = add_struct_3 (u);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26427.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26427.c
new file mode 100644
index 000000000..add13ca20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26427.c
@@ -0,0 +1,24 @@
+/* { dg-warning "this target does not support" "" {target *86*-*-darwin* } 0 } */
+/* { dg-do run { target { *-*-darwin* } } } */
+/* { dg-options { -fsection-anchors -O } } */
+/* PR target/26427 */
+
+struct a {};
+static const int d = 1;
+static const struct a b = {};
+static const int c = 1;
+int f(const int *, const struct a *, const int*, const int*);
+
+int g(void) {
+ return f(&c, &b, &d, &c);
+}
+
+int f(const int *b, const struct a *c, const int *d, const int *e) {
+ return *b == *d;
+}
+
+int main(void) {
+ if (!g())
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c
new file mode 100644
index 000000000..71c16f207
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26570.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-generate -fprofile-use -fopt-info" } */
+
+unsigned test (unsigned a, unsigned b)
+{
+ return a / b;
+} /* { dg-message "note: \[^\n\]*execution counts estimated" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26632.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26632.c
new file mode 100644
index 000000000..1cc843ebd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26632.c
@@ -0,0 +1,14 @@
+/* PR middle-end/26632
+ We used to issue a warning for an implicit cast whose result is not
+ used. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+int g (void);
+long h (void);
+
+void
+f (void)
+{
+ 0 ? h () : g (); /* { dg-bogus "value computed is not used" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26717.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26717.c
new file mode 100644
index 000000000..d16b576ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26717.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math" } */
+_Complex float f (_Complex float a)
+{
+ _Complex float b = a / a;
+ return b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26719.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26719.c
new file mode 100644
index 000000000..3c87df17b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26719.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort (void);
+
+int table[32][256];
+
+int main(void)
+{
+ int i, j;
+
+ for (i = 0; i < 32; i++)
+ for (j = 0; j < 256; j++)
+ table[i][j] = ((signed char)j) * i;
+
+ if (table[9][132] != -1116)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26729-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26729-1.c
new file mode 100644
index 000000000..2f55ef7f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26729-1.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort(void);
+
+__attribute__((noinline))
+int f (unsigned short word) {
+ return (word & 0x1) && (((unsigned short) (word & 0x8000)) == 0x8000);
+}
+
+int main(void) {
+ if (!f(0x8001))
+ abort();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26865.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26865.c
new file mode 100644
index 000000000..d9f1fe0d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26865.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=c99" } */
+
+void
+foo (void)
+{
+ char *e = alloca (100); /* { dg-warning "implicit declaration|initialization makes" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26961-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26961-1.c
new file mode 100644
index 000000000..56907d89d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26961-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+long long foo(int i, int j)
+{
+ return i ? (long long)(!j) : 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr26983.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr26983.c
new file mode 100644
index 000000000..5e2120a1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr26983.c
@@ -0,0 +1,19 @@
+/* { dg-do link } */
+
+/* This used to cause a linker failure because GCC would output
+ assembler code referencing labels that it had not output. */
+
+void *jmpbuf[6];
+
+void
+foo (void)
+{
+ __builtin_setjmp (jmpbuf);
+}
+
+int
+main (void)
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27003.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27003.c
new file mode 100644
index 000000000..5e416f4c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27003.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+
+unsigned int
+foo (unsigned int x)
+{
+ unsigned int r = x;
+ while (--x)
+ r *= x;
+ return r;
+}
+
+unsigned long long
+bar (unsigned long long x)
+{
+ unsigned long long r = x;
+ while (--x)
+ r *= x;
+ return r;
+}
+
+extern void abort (void);
+
+int
+main (void)
+{
+ if (foo (5) != 120 || bar (5) != 120)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27095.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27095.c
new file mode 100644
index 000000000..8d2b47b77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27095.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* On MIPS, disable generating hints (R_MIPS_JALR) for PIC calls. In addition
+ to the load from the GOT this also contains the name of the function so for
+ each call the function name would appear twice. */
+/* { dg-options "-O2 -mno-relax-pic-calls" { target mips*-*-* } } */
+/* For epiphany, use -mshort-calls to avoid loading the address in two
+ steps using lowpart and highpart. */
+/* { dg-options "-O2 -mshort-calls" { target epiphany-*-* } } */
+
+extern void *memset (void *, int, __SIZE_TYPE__);
+extern __SIZE_TYPE__ strlen (const char *);
+
+int
+main (int argc, char **argv)
+{
+ char x[8] = "abc";
+ memset (x, argc, strlen (x));
+ return 0;
+}
+/* { dg-final { scan-assembler-not "(?n)strlen\(.*\n\)+.*strlen" { target { ! { powerpc*-*-darwin* hppa*-*-hpux* ia64-*-hpux* alpha*-*-* spu-*-* tic6x-*-* } } } } } */
+/* hppa*-*-hpux* has an IMPORT statement for strlen (plus the branch). */
+/* *-*-darwin* has something similar. */
+/* tic6x emits a comment at the point where the delayed branch happens. */
+/* { dg-final { scan-assembler-not "(?n)strlen\(.*\n\)+.*strlen\(.*\n\)+.*strlen" { target hppa*-*-hpux* tic6x-*-* } } } */
+/* { dg-final { scan-assembler-not "(?n)bl L_strlen\(.*\n\)+.*bl L_strlen" { target powerpc*-*-darwin* } } } */
+/* ia64-*-hpux* has a global statement, a type statement, and the branch. */
+/* { dg-final { scan-assembler-not "(?n)strlen\(.*\n\)+.*strlen\(.*\n\)+.*strlen\(.*\n\)+.*strlen" { target ia64-*-hpux* } } } */
+/* alpha-*-* has a GOT load and the call. */
+/* { dg-final { scan-assembler-not "(?n)jsr .*,strlen\(.*\n\)+.*jsr .*,strlen" { target alpha*-*-* } } } */
+/* spu-*-* has a branch hint and the call. */
+/* { dg-final { scan-assembler-not "(?n)brsl.*,strlen\(.*\n\)+.*brsl.*,strlen" { target spu-*-* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27132.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27132.c
new file mode 100644
index 000000000..272862a2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27132.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int foo(int i)
+{
+ return i - -1;
+}
+
+/* { dg-final { scan-tree-dump "i \\+ 1" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27150-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27150-1.c
new file mode 100644
index 000000000..5a00cf9f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27150-1.c
@@ -0,0 +1,14 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+extern int link_error ();
+int g(int f)
+{
+ int a = ((&f)!=0);
+ if (!a) link_error ();
+ return a;
+}
+
+int main()
+{
+ g(10);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27301.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27301.c
new file mode 100644
index 000000000..3b5a8f55b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27301.c
@@ -0,0 +1,15 @@
+/* PR c/27301 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu89" } */
+
+void
+foo (void *ptr, long n)
+{
+ __asm__ __volatile__ ("" :: "m" (({ struct { char x[n]; } *p = ptr; *p; })));
+}
+
+void
+bar (void *ptr, long n)
+{
+ __asm__ __volatile__ ("" :: "m" (*({ struct { char x[n]; } *p = ptr; p; })));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27314.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27314.c
new file mode 100644
index 000000000..d99be5eb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27314.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ffast-math" } */
+
+extern double floor (double);
+
+inline int bar (double x)
+{
+ return (int) floor (x);
+}
+
+int foo (int i)
+{
+ return bar (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27331.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27331.c
new file mode 100644
index 000000000..9b5c71e84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27331.c
@@ -0,0 +1,56 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+struct funny_match
+{
+ int this, other;
+};
+
+typedef struct rtx {
+ int code;
+} *rtx;
+
+extern rtx recog_operand[];
+extern int which_alternative;
+extern int nalternatives;
+
+int
+constrain_operands (insn_code_num, strict)
+ int insn_code_num;
+ int strict;
+{
+ char *constraints[10];
+ struct funny_match funny_match[10];
+ register int c;
+ int funny_match_index;
+
+ which_alternative = 0;
+
+ while (which_alternative < nalternatives)
+ {
+ register int opno;
+ register char *p = constraints[opno];
+ int lose = 0;
+ funny_match_index = 0;
+
+ while (*p && (c = *p++) != ',')
+ funny_match[funny_match_index++].other = c - '0';
+
+ if ((((recog_operand[opno])->code) == 12))
+ lose = 1;
+
+ if (!lose)
+ {
+ while (--funny_match_index >= 0)
+ recog_operand[funny_match[funny_match_index].other]
+ = recog_operand[funny_match[funny_match_index].this];
+ return 1;
+ }
+ which_alternative++;
+ }
+
+ if (strict == 0)
+ return constrain_operands (insn_code_num, -1);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27335.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27335.c
new file mode 100644
index 000000000..d08db30bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27335.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+extern void bar () __attribute__ ((noreturn));
+
+inline double
+baz (double *x, unsigned int y)
+{
+ if (y >= 6)
+ bar ();
+ return x[y];
+}
+
+double *a, *b;
+
+void
+foo ()
+{
+ unsigned int r, s, t;
+
+ for (r = 0; r < 2; r++)
+ for (t = 0; t < 2; t++)
+ {
+ for (s = 0; s < 3; s++)
+ b[r * 2 + t] += baz (a, 3 * s + t);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27363.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27363.c
new file mode 100644
index 000000000..40a3c6b35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27363.c
@@ -0,0 +1,39 @@
+/* PR27363. CSE was breaking on the arm store multiple insn used for
+ structure copies. */
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+extern void abort (void);
+
+struct snd_mask {
+ unsigned int bits[6];
+};
+
+static int __attribute__((noinline))
+snd_mask_refine(struct snd_mask *mask)
+{
+ struct snd_mask old;
+
+ old = *mask;
+ if (mask->bits[0]==0 && mask->bits[1]==0)
+ return 1;
+
+ return old.bits[0] != mask->bits[0];
+}
+
+int main(int argc, char *argv[])
+{
+ struct snd_mask mask;
+
+
+ mask.bits[0] = 23;
+ mask.bits[1] = 42;
+ mask.bits[2] = 0;
+ mask.bits[3] = 0;
+ mask.bits[4] = 0;
+ mask.bits[5] = 0;
+
+
+ if (snd_mask_refine(&mask))
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27382-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27382-1.c
new file mode 100644
index 000000000..0b25a7b38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27382-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+void foo()
+{
+ L:
+ !&&L;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27382-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27382-2.c
new file mode 100644
index 000000000..97365247e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27382-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+void foo()
+{
+ L:
+ &&L != 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27428-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27428-1.c
new file mode 100644
index 000000000..93a221c84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27428-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void foo()
+{
+ goto L;
+ if (0..) { L: ; } // { dg-error "too many decimal points" }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27528.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27528.c
new file mode 100644
index 000000000..4f33a31cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27528.c
@@ -0,0 +1,18 @@
+/* Check the warnings and errors generated for asm operands that aren't
+ obviously constant but that are constrained to be constants. */
+/* { dg-options "" } */
+/* { dg-error "impossible constraint" "" { target *-*-* } 13 } */
+/* { dg-error "impossible constraint" "" { target *-*-* } 14 } */
+/* { dg-error "impossible constraint" "" { target *-*-* } 15 } */
+/* { dg-error "impossible constraint" "" { target *-*-* } 16 } */
+int bar (int);
+void
+foo (int *x, int y)
+{
+ int constant = 0;
+ asm ("# %0" :: "i" (x)); /* { dg-warning "probably doesn't match" } */
+ asm ("# %0" :: "i" (bar (*x))); /* { dg-warning "probably doesn't match" } */
+ asm ("# %0" :: "i" (*x + 0x11)); /* { dg-warning "probably doesn't match" } */
+ asm ("# %0" :: "i" (constant)); /* { dg-warning "probably doesn't match" } */
+ asm ("# %0" :: "i" (y * 0)); /* folded */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27531-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27531-1.c
new file mode 100644
index 000000000..08e3f5ea2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27531-1.c
@@ -0,0 +1,114 @@
+/* PR target/27531 */
+/* This test case stressed the register allocator into reloading a LABEL_REF
+ on sparc, but didn't add a REG_LABEL note, ultimately causing the assembly
+ output to reference a label that had been eliminated. */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+typedef struct _IO_FILE FILE;
+char const *RCSname;
+void *Locks;
+void * Head;
+struct Revpairs{
+ struct Revpairs * rnext;
+};
+extern char *strchr(const char *s, int c);
+extern int fprintf(FILE *, const char *format, ...);
+static void getrevpairs (char*);
+static int branchflag;
+static struct Revpairs *revlist, *Revlst;
+
+extern int warn(const char *msg, char *argv);
+extern int error(const char *msg, int c, char *argv);
+extern int recentdate(void *foo, void *bar);
+
+char *t;
+int main (int argc, char **argv)
+{
+ FILE *out;
+ char *a, **newargv;
+ void *currdate;
+ int descflag, selectflag;
+ int onlylockflag;
+ int onlyRCSflag;
+ int shownames;
+ descflag = selectflag = shownames = 1;
+ onlylockflag = onlyRCSflag = 0;
+ while (a = *++argv, 0<--argc)
+ {
+ switch (*a++)
+ {
+ case 'L':
+ onlylockflag = 1;
+ case 'N':
+ shownames = 0;
+ case 'R':
+ t = a;
+ case 'b':
+ branchflag = 1;
+ case 'r':
+ getrevpairs(a);
+ }
+ if (onlylockflag && !Locks)
+ fprintf(out, "%s\n", RCSname);
+ if (shownames)
+ while( currdate)
+ recentdate(Head, currdate);
+ }
+}
+void getrevpairs(char *argv)
+{
+ char c;
+ struct Revpairs * nextrevpair;
+ int separator;
+ if (strchr(argv,':'))
+ separator = ':';
+ else
+ {
+ if (strchr(argv,'-') )
+ warn("`-' is obsolete in `-r%s'; use `:' instead", argv);
+ separator = '-';
+ }
+ for (;;)
+ {
+ nextrevpair->rnext = revlist;
+ for (;; c = *++argv)
+ {
+ switch (c)
+ {
+ default:
+ continue;
+ case ' ':
+ case '\t':
+ case '\n':
+ break;
+ case ':':
+ case '-':
+ if (c == separator)
+ continue;
+ }
+ break;
+ }
+ if (!c)
+ break;
+ error("missing `,' near `%c%s'", c, argv+1);
+ }
+}
+
+int warn(const char *msg, char *argv)
+{
+ t = 0; /* this function needs side-effects. */
+ return 0;
+}
+
+int error(const char *msg, int c, char *argv)
+{
+ t = 0; /* this function needs side-effects. */
+ return 0;
+}
+
+int recentdate(void *foo, void *bar)
+{
+ t = 0; /* this function needs side-effects. */
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27639.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27639.c
new file mode 100644
index 000000000..cb7b1429d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27639.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=c99" } */
+#if(__SIZEOF_INT__ >= 4)
+char heap[50000];
+#else
+char heap[32000];
+#endif
+int
+main ()
+{
+ for (unsigned ix = sizeof (heap); ix--;)
+ heap[ix] = ix;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27671-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27671-2.c
new file mode 100644
index 000000000..11dae10b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27671-2.c
@@ -0,0 +1,24 @@
+/* PR rtl-optimization/27671.
+ The combiner used to simplify "a ^ b == a" to "a" via
+ simplify_relational_operation_1 in simplify-rtx.c. */
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+/* { dg-options "-O1 -march=pentium4" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern void abort (void) __attribute__ ((noreturn));
+extern void exit (int) __attribute__ ((noreturn));
+
+static void __attribute__ ((noinline))
+bar (int k)
+{
+ int n = k % 2;
+ if (n == 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ bar (1);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27758.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27758.c
new file mode 100644
index 000000000..d385fc5c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27758.c
@@ -0,0 +1,24 @@
+/* PR target/27758 */
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O0 -fpic" } */
+
+typedef int (*fn) (void);
+
+static inline int
+foo (void)
+{
+ return 1;
+}
+
+fn
+test (void)
+{
+ return foo;
+}
+
+int
+main (void)
+{
+ fn f = test ();
+ return f () != 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27802-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27802-1.c
new file mode 100644
index 000000000..839459ac0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27802-1.c
@@ -0,0 +1,16 @@
+/* Noreturn functions returning FP types used to confuse reg-stack on x86. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+double bar1() __attribute__((noreturn));
+void foo1() { bar1(); }
+
+double bar2() __attribute__((noreturn));
+double foo2() { return bar2(); }
+
+void bar3() __attribute__((noreturn));
+double foo3() { bar3(); }
+
+double bar4() __attribute__((noreturn));
+double foo4() { bar4(); }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27861-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27861-1.c
new file mode 100644
index 000000000..cf269dc0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27861-1.c
@@ -0,0 +1,67 @@
+/* PR target/27861 */
+/* The following code used to cause an ICE during RTL expansion, as
+ expand shift was stripping the SUBREG of a rotate shift count, and
+ later producing a VAR_DECL tree whose DECL_RTL's mode didn't match
+ the VAR_DECL's type's mode. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef struct sim_state *SIM_DESC;
+typedef enum
+{
+ SIM_OPEN_STANDALONE, SIM_OPEN_DEBUG
+}
+SIM_RC;
+typedef unsigned int unsigned32 __attribute__ ((__mode__ (__SI__)));
+typedef unsigned int unsigned64 __attribute__ ((__mode__ (__DI__)));
+typedef unsigned32 unsigned_address;
+typedef unsigned_address address_word;
+static __inline__ unsigned64
+ __attribute__ ((__unused__)) ROTR64 (unsigned64 val, int shift)
+{
+ unsigned64 result;
+ result = (((val) >> (shift)) | ((val) << ((64) - (shift))));
+ return result;
+}
+typedef struct _sim_cpu sim_cpu;
+enum
+{
+ TRACE_MEMORY_IDX, TRACE_MODEL_IDX, TRACE_ALU_IDX, TRACE_CORE_IDX,
+};
+typedef struct _trace_data
+{
+ char trace_flags[32];
+}
+TRACE_DATA;
+typedef enum
+{
+ nr_watchpoint_types,
+}
+watchpoint_type;
+typedef struct _sim_watchpoints
+{
+ TRACE_DATA trace_data;
+}
+sim_cpu_base;
+struct _sim_cpu
+{
+ sim_cpu_base base;
+};
+struct sim_state
+{
+ sim_cpu cpu[1];
+};
+typedef address_word instruction_address;
+do_dror (SIM_DESC sd, instruction_address cia, int MY_INDEX, unsigned64 x,
+ unsigned64 y)
+{
+ unsigned64 result;
+ result = ROTR64 (x, y);
+ {
+ if ((((-1) & (1 << (TRACE_ALU_IDX))) != 0
+ && (((&(((&(sd)->cpu[0])))->base.trace_data))->
+ trace_flags)[TRACE_ALU_IDX] != 0))
+ trace_result_word1 (sd, ((&(sd)->cpu[0])), TRACE_ALU_IDX, (result));
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27953.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27953.c
new file mode 100644
index 000000000..8da92c1d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27953.c
@@ -0,0 +1,8 @@
+/* PR c/27953 */
+
+void foo(struct A a) {} /* { dg-warning "declared inside parameter list" "inside" } */
+/* { dg-warning "its scope is only" "scope" { target *-*-* } 3 } */
+/* { dg-error "incomplete type" "incomplete" { target *-*-* } 3 } */
+
+void foo() {} /* { dg-error "redefinition" "redef" } */
+/* { dg-message "note: previous definition" "previous" { target *-*-* } 3 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27959-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27959-2.c
new file mode 100644
index 000000000..65894756b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27959-2.c
@@ -0,0 +1,94 @@
+/* PR middle-end/27959 */
+/* { dg-do run { target { stdint_types } } } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=z990" { target s390*-*-* } } */
+
+#include <stdint.h>
+extern void abort (void);
+
+struct B
+{
+ unsigned int b1, b2, b3;
+ char b4;
+};
+
+struct C
+{
+ char c1;
+};
+
+struct D
+{
+ char *d1;
+ struct C **d2;
+ unsigned int d3;
+};
+
+void
+__attribute__((noinline))
+foo (void *x, struct B *y, unsigned int *z)
+{
+ if (x)
+ abort ();
+ if (y->b1 != 7 || y->b2 != 5 || y->b3 != 3 || y->b4)
+ abort ();
+ if (*z != 2)
+ abort ();
+}
+
+int
+__attribute__((noinline))
+baz (unsigned int *x, unsigned int y)
+{
+ asm volatile ("" : : "r" (&x), "r" (&y) : "memory");
+ return *x + y;
+}
+
+inline int bar (unsigned int *x, unsigned int y)
+{
+ if (y < *x)
+ return 0;
+ return baz (x, y);
+}
+
+unsigned int *
+__attribute__((noinline))
+test (struct D *x, unsigned int *y)
+{
+ struct B b;
+ uint32_t c;
+
+ bar (y, x->d3);
+ if ((*(x->d2))->c1)
+ c = ((uint32_t) x->d1[0]
+ + ((uint32_t) x->d1[1] << 8)
+ + ((uint32_t) x->d1[2] << 16)
+ + ((uint32_t) x->d1[3] << 24));
+ else
+ {
+ int32_t d;
+ ((char *) &d)[0] = x->d1[0];
+ ((char *) &d)[1] = x->d1[1];
+ ((char *) &d)[2] = x->d1[2];
+ ((char *) &d)[3] = x->d1[3];
+ c = d;
+ }
+ b.b4 = 0;
+ b.b1 = c / 10000L % 10000;
+ b.b2 = c / 100 % 100;
+ b.b3 = c % 100;
+ foo (0, &b, y);
+ return y;
+}
+
+int
+main (void)
+{
+ uint32_t x = 900070503;
+ unsigned int y = 2;
+ struct C c = { 0 }, *cptr = &c;
+ struct D d = { (char *) &x, &cptr, 0 };
+ if (test (&d, &y) != &y)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr27959.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr27959.c
new file mode 100644
index 000000000..f1fdda1b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr27959.c
@@ -0,0 +1,93 @@
+/* PR middle-end/27959 */
+/* { dg-do run { target { int32plus } } } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=z990" { target s390*-*-* } } */
+
+extern void abort (void);
+
+struct B
+{
+ unsigned int b1, b2, b3;
+ char b4;
+};
+
+struct C
+{
+ char c1;
+};
+
+struct D
+{
+ char *d1;
+ struct C **d2;
+ unsigned int d3;
+};
+
+void
+__attribute__((noinline))
+foo (void *x, struct B *y, unsigned int *z)
+{
+ if (x)
+ abort ();
+ if (y->b1 != 7 || y->b2 != 5 || y->b3 != 3 || y->b4)
+ abort ();
+ if (*z != 2)
+ abort ();
+}
+
+int
+__attribute__((noinline))
+baz (unsigned int *x, unsigned int y)
+{
+ asm volatile ("" : : "r" (&x), "r" (&y) : "memory");
+ return *x + y;
+}
+
+inline int bar (unsigned int *x, unsigned int y)
+{
+ if (y < *x)
+ return 0;
+ return baz (x, y);
+}
+
+unsigned int *
+__attribute__((noinline))
+test (struct D *x, unsigned int *y)
+{
+ struct B b;
+ unsigned int c;
+
+ bar (y, x->d3);
+ if ((*(x->d2))->c1)
+ c = ((unsigned char) x->d1[0]
+ + ((unsigned char) x->d1[1] << 8)
+ + ((unsigned char) x->d1[2] << 16)
+ + ((short) x->d1[3] << 24));
+ else
+ {
+ int d;
+ ((char *) &d)[0] = x->d1[0];
+ ((char *) &d)[1] = x->d1[1];
+ ((char *) &d)[2] = x->d1[2];
+ ((char *) &d)[3] = x->d1[3];
+ c = d;
+ }
+ b.b4 = 0;
+ b.b1 = c / 10000L % 10000;
+ b.b2 = c / 100 % 100;
+ b.b3 = c % 100;
+ foo (0, &b, y);
+ return y;
+}
+
+int
+main (void)
+{
+ unsigned int x = 900070503;
+ unsigned int y = 2;
+ struct C c = { 0 }, *cptr = &c;
+ struct D d = { (char *) &x, &cptr, 0 };
+ if (test (&d, &y) != &y)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28121.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28121.c
new file mode 100644
index 000000000..5cbf8f89e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28121.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+short
+GetCmd ()
+{
+ int c, c1;
+ for (c = 255; c == 255;)
+ {
+ c = GetMouseButton ();
+ if (c >= 0)
+ {
+ c = ParsePos (c, -1, 0);
+ c1 = ParsePos (c1, c, 1);
+ if (c == c1 && (c >= 0 || c == -10))
+ {
+ return c;
+ }
+ if (c >= 0 && c1 == -12)
+ {
+ return ((((((10) + 1) + 1)) + 1) << 7) | c;
+ }
+ c = 255;
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28162.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28162.c
new file mode 100644
index 000000000..8bd28ad24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28162.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void Lag_max_wght(float corr[], long wght_flg)
+{
+ float t0, max;
+ const float *ww;
+ long i;
+ if ( wght_flg > 0 ) {
+ for ( i = 143; i >= 20; i-- ) {
+ t0 = corr[ - i] * *ww--;
+ if ( t0 >= max )
+ max = t0;
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28187.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28187.c
new file mode 100644
index 000000000..bc3b62d33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28187.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vrp -fwrapv" } */
+
+extern void bar(int);
+void checkgroups(int last, int verbose)
+{
+ int window = 0;
+ int outstanding = 0;
+ while (window < last || outstanding) {
+ while (outstanding < 47 && window < last) {
+ if (window < last) {
+ outstanding++;
+ if (verbose)
+ bar(window);
+ bar(window++);
+ }
+ }
+ if (outstanding > 0)
+ bar(0);
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28243.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28243.c
new file mode 100644
index 000000000..12447a1c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28243.c
@@ -0,0 +1,53 @@
+/* PR rtl-optimization/28243 */
+/* Reported by Mike Frysinger <vapier@gentoo.org> */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -ftracer -fPIC" } */
+/* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } } */
+
+struct displayfuncs {
+ void (*init) ();
+} funcs;
+
+struct gpsdisplay {
+ struct displayfuncs *funcs;
+};
+
+static void PSMyArc(double cx, double cy, double radx, double rady, double sa,
+ double ta)
+{
+ double ea;
+ double temp;
+ ea = sa + ta;
+ while (sa < ea) {
+ temp = ((sa + 90) / 90) * 90;
+ PSDoArc(cx, sa, ea < temp ? ea : temp);
+ sa = temp;
+ }
+}
+
+static void PSDrawElipse()
+{
+ float cx;
+ float cy;
+ float radx;
+ float rady;
+ if (radx != rady)
+ PSMyArc(cx, cy, radx, rady, 0, 360);
+}
+
+static void PSDrawFillCircle()
+{
+ PSDrawElipse();
+}
+
+static struct displayfuncs psfuncs[] = {
+ PSDrawFillCircle
+};
+
+void _GPSDraw_CreateDisplay()
+{
+ struct gpsdisplay *gdisp;
+ gdisp->funcs = (void *)&psfuncs;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28322-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28322-2.c
new file mode 100644
index 000000000..89dd15390
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28322-2.c
@@ -0,0 +1,12 @@
+/* PR28322: ignore unknown -Wno-* if no warning is emitted. */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -Wno-foobar" } */
+
+int foo (void)
+{
+ int i = 1/0; /* { dg-warning "division by zero" } */
+ return i;
+}
+
+/* { dg-warning "unrecognized command line option .-Wno-foobar." "" { target *-*-* } 0 } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28322-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28322-3.c
new file mode 100644
index 000000000..e714a3cc6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28322-3.c
@@ -0,0 +1,10 @@
+/* PR28322: ignore unknown -Wno-* if no warning is emitted. */
+/* { dg-do compile } */
+/* { dg-options " -fno-foobar -mno-foobar" } */
+
+void foo(void)
+{
+ int i = 1;
+}
+/* { dg-message "unrecognized command line option .-fno-foobar." "f" { target *-*-* } 0 } */
+/* { dg-message "unrecognized command line option .-mno-foobar." "m" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28322.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28322.c
new file mode 100644
index 000000000..99872fca8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28322.c
@@ -0,0 +1,8 @@
+/* PR28322: ignore unknown -Wno-* if no warning is emitted. */
+/* { dg-do compile } */
+/* { dg-options " -Wno-foobar -Wno-div-by-zero" } */
+
+void foo(void)
+{
+ int i = 1/0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28402.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28402.c
new file mode 100644
index 000000000..1368ac723
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28402.c
@@ -0,0 +1,22 @@
+/* { dg-options "" } */
+typedef long long ll;
+typedef unsigned long long ull;
+
+int global;
+
+#define A(BASE, OP, AMT) \
+ ll BASE ## AMT (ll x) { return x OP AMT; } \
+ ull BASE ## AMT ## u (ull x) { return x OP AMT; }
+
+#define B(BASE, OP) \
+ A (BASE, OP, 1) \
+ A (BASE, OP, 10) \
+ A (BASE, OP, 31) \
+ A (BASE, OP, 33) \
+ A (BASE, OP, 61) \
+ A (BASE, OP, global)
+
+B (left, <<)
+B (right, >>)
+
+/* { dg-final { scan-assembler-not "__\[a-z\]*si3" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28419.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28419.c
new file mode 100644
index 000000000..a1aa4bfe8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28419.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+void foo()
+const char* p = __FUNCTION__; /* { dg-error "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28574.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28574.c
new file mode 100644
index 000000000..f5ff6c01d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28574.c
@@ -0,0 +1,74 @@
+/* On IA64 This test resulted in a missing jumptable and an undefined
+ reference to a label. Make sure we can compile and link it with
+ no undefs at -O2. */
+
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+typedef enum yasm_module_type {
+ YASM_MODULE_ARCH = 0,
+ YASM_MODULE_DBGFMT,
+ YASM_MODULE_OBJFMT,
+ YASM_MODULE_LISTFMT,
+ YASM_MODULE_OPTIMIZER
+} yasm_module_type;
+
+struct yasm_module {
+ const char *name;
+};
+
+typedef struct yasm_module yasm_arch_module;
+typedef struct yasm_module yasm_dbgfmt_module;
+typedef struct yasm_module yasm_objfmt_module;
+typedef struct yasm_module yasm_listfmt_module;
+typedef struct yasm_module yasm_optimizer_module;
+
+typedef struct module {
+ void *data;
+} module;
+
+static struct {
+ module *m;
+ int n;
+} module_types[] = {
+ {},
+};
+
+void
+yasm_list_modules(yasm_module_type type,
+ void (*printfunc) (const char *name))
+{
+ int i;
+ module *modules = module_types[type].m;
+ yasm_arch_module *arch;
+ yasm_dbgfmt_module *dbgfmt;
+ yasm_objfmt_module *objfmt;
+ yasm_listfmt_module *listfmt;
+ yasm_optimizer_module *optimizer;
+
+ for (i=0; i<2; i++) {
+ switch (type) {
+ case YASM_MODULE_ARCH:
+ arch = modules[i].data;
+ printfunc(arch->name);
+ break;
+ case YASM_MODULE_DBGFMT:
+ dbgfmt = modules[i].data;
+ printfunc(dbgfmt->name);
+ break;
+ case YASM_MODULE_OBJFMT:
+ objfmt = modules[i].data;
+ printfunc(objfmt->name);
+ break;
+ case YASM_MODULE_LISTFMT:
+ listfmt = modules[i].data;
+ printfunc(listfmt->name);
+ break;
+ case YASM_MODULE_OPTIMIZER:
+ optimizer = modules[i].data;
+ printfunc(optimizer->name);
+ }
+ }
+}
+
+main() {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28685-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28685-1.c
new file mode 100644
index 000000000..1d9d97ed6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28685-1.c
@@ -0,0 +1,50 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+/* Should produce <=. */
+int test1 (int a, int b)
+{
+ return (a < b || a == b);
+}
+
+/* Should produce <=. */
+int test2 (int a, int b)
+{
+ int lt = a < b;
+ int eq = a == b;
+
+ return (lt || eq);
+}
+
+/* Should produce <= (just deleting redundant test). */
+int test3 (int a, int b)
+{
+ int lt = a <= b;
+ int eq = a == b;
+
+ return (lt || eq);
+}
+
+/* Should produce <= (operands reversed to test the swap logic). */
+int test4 (int a, int b)
+{
+ int lt = a < b;
+ int eq = b == a;
+
+ return (lt || eq);
+}
+
+/* Should produce constant 0. */
+int test5 (int a, int b)
+{
+ int lt = a < b;
+ int eq = a == b;
+
+ return (lt && eq);
+}
+
+/* { dg-final { scan-tree-dump-times " <= " 4 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-not " < " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " == " "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28726.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28726.c
new file mode 100644
index 000000000..11232ac86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28726.c
@@ -0,0 +1,29 @@
+/* PR rtl-optimization/28726 */
+/* Origin: Sigurd Schneider <sg313d@gmail.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fsched2-use-superblocks" } */
+
+extern void abort (void);
+
+static double my_loop(void) __attribute__((noinline));
+
+static double my_loop(void)
+{
+ double retval = 0.0;
+ const unsigned char *start = "\005\b\000";
+ const unsigned char *const end = start + 2;
+
+ while (start < end)
+ retval += *start++;
+
+ return retval;
+}
+
+int main(void)
+{
+ if (my_loop() != 13.0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28755.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28755.c
new file mode 100644
index 000000000..9cd1330d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28755.c
@@ -0,0 +1,23 @@
+/* PR middle-end/28755 */
+/* { dg-do compile } */
+/* { dg-require-effective-target ptr32plus } */
+/* { dg-options "-Os" } */
+/* { dg-final { scan-assembler-times "2112543726\|7deadbee" 2 } } */
+
+struct S
+{
+ void *s1;
+ unsigned s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14;
+};
+
+const struct S array[] = {
+ { (void *) 0, 60, 640, 2112543726, 39682, 48, 16, 33, 10, 96, 2, 0, 0, 4 },
+ { (void *) 0, 60, 2112543726, 192, 18251, 16, 33, 10, 96, 2, 0, 0, 4, 212 }
+};
+
+void
+foo (struct S *x)
+{
+ x[0] = array[0];
+ x[5] = array[1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28796-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28796-1.c
new file mode 100644
index 000000000..077118a29
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28796-1.c
@@ -0,0 +1,62 @@
+/* { dg-do link } */
+/* { dg-options "-ffinite-math-only" } */
+
+extern void link_error(void);
+
+float f;
+double d;
+long double ld;
+
+int main()
+{
+ if (__builtin_isunordered (f, f) != 0)
+ link_error ();
+ if (__builtin_isunordered (d, d) != 0)
+ link_error ();
+ if (__builtin_isunordered (ld, ld) != 0)
+ link_error ();
+
+ if (__builtin_isnan (f) != 0)
+ link_error ();
+ if (__builtin_isnan (d) != 0)
+ link_error ();
+ if (__builtin_isnan (ld) != 0)
+ link_error ();
+ if (__builtin_isnanf (f) != 0)
+ link_error ();
+ if (__builtin_isnanl (ld) != 0)
+ link_error ();
+
+ if (__builtin_finite (f) != 1)
+ link_error ();
+ if (__builtin_finite (d) != 1)
+ link_error ();
+ if (__builtin_finite (ld) != 1)
+ link_error ();
+ if (__builtin_finitef (f) != 1)
+ link_error ();
+ if (__builtin_finitel (ld) != 1)
+ link_error ();
+
+ if (__builtin_isinf (f) != 0)
+ link_error ();
+ if (__builtin_isinf (d) != 0)
+ link_error ();
+ if (__builtin_isinf (ld) != 0)
+ link_error ();
+
+ if (__builtin_isfinite (f) != 1)
+ link_error ();
+ if (__builtin_isfinite (d) != 1)
+ link_error ();
+ if (__builtin_isfinite (ld) != 1)
+ link_error ();
+
+ if (f != f)
+ link_error ();
+ if (d != d)
+ link_error ();
+ if (ld != ld)
+ link_error ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28796-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28796-2.c
new file mode 100644
index 000000000..f56a5d4a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28796-2.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -funsafe-math-optimizations -fno-finite-math-only -DUNSAFE" } */
+/* { dg-add-options ieee } */
+/* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */
+
+#include "tg-tests.h"
+
+int main(void)
+{
+ return main_tests ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28888.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28888.c
new file mode 100644
index 000000000..c65a26a08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28888.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+static const unsigned char _c30[] =
+ "statistic of allocated integer registers:";
+Allocate__WriteStats (void)
+{
+ register int i0, i1, i2, i3, i4, i5;
+l0:i1 = (int) (i5 << 2);
+ if (i0)
+ i4 = i5;
+l1:i2 += i1;
+ if (i1)
+ goto l0;
+l3:i0 = i1 == 255;
+ i1++;
+ Out__LongInt ((int) i0, (int) 0);
+ i0 = i4 >= i1;
+ if (i0)
+ goto l3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28911.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28911.c
new file mode 100644
index 000000000..e1748f0fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28911.c
@@ -0,0 +1,13 @@
+/* PR target/28911
+ The following used to cause crash on m68k-elf because 0x80000000
+ was used as an SImode constant. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -m68000" { target m68k-*-* } } */
+
+_Complex float
+foo (float a)
+{
+ return __builtin_copysign (a != a, a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr28935.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr28935.c
new file mode 100644
index 000000000..9a0e70ecf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr28935.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-vectorize" } */
+
+int col[8];
+int extend_options(int w, int h, int *map, int x, int y, int index)
+{
+ int dx, dy;
+ for (dx = -1; dx <= +1; dx++)
+ {
+ int index = (dy < 0 ? 6-dx : dy > 0 ? 2+dx : 2*(1+dx));
+ if (x+dx >= 0 && x+dx < w && y+dy >= 0 && y+dy < h)
+ col[index] = map[(y+dy)*w+(x+dx)];
+ col[index] = -1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29091.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29091.c
new file mode 100644
index 000000000..6e06c63da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29091.c
@@ -0,0 +1,44 @@
+/* PR c/29091 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+__attribute__ ((vector_size (sizeof (int) * 4))) int a = { 1, 2 };
+int d = 3;
+__attribute__ ((vector_size (sizeof (int) * 4))) int b = { 4, 5, 6 };
+int e = 7;
+__attribute__ ((vector_size (sizeof (int) * 4))) int c = { };
+
+int
+main (void)
+{
+ int *p = (int *) &a;
+ if (p[0] != 1)
+ abort ();
+ if (p[1] != 2)
+ abort ();
+ if (p[2] != 0)
+ abort ();
+ if (p[3] != 0)
+ abort ();
+ p = (int *) &b;
+ if (p[0] != 4)
+ abort ();
+ if (p[1] != 5)
+ abort ();
+ if (p[2] != 6)
+ abort ();
+ if (p[3] != 0)
+ abort ();
+ p = (int *) &c;
+ if (p[0] != 0)
+ abort ();
+ if (p[1] != 0)
+ abort ();
+ if (p[2] != 0)
+ abort ();
+ if (p[3] != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29215.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29215.c
new file mode 100644
index 000000000..aa3f82ce0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29215.c
@@ -0,0 +1,33 @@
+/* PR middle-end/29215 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+char buf[5 * sizeof (int) + 1] __attribute__((aligned (__alignof__ (int))));
+
+static void
+foo (int arg1, int arg2, int arg3, int arg4, int arg5)
+{
+ __builtin_memcpy (buf, &arg1, sizeof (int));
+ __builtin_memcpy (buf + sizeof (int), &arg2, sizeof (int));
+ __builtin_memcpy (buf + 2 * sizeof (int), &arg3, sizeof (int));
+ __builtin_memcpy (buf + 3 * sizeof (int), &arg4, sizeof (int));
+ __builtin_memcpy (buf + 4 * sizeof (int), &arg5, sizeof (int));
+}
+
+int
+main (void)
+{
+ union { char buf[4]; int i; } u;
+ u.i = 0;
+ u.buf[0] = 'a';
+ u.buf[1] = 'b';
+ u.buf[2] = 'c';
+ u.buf[3] = 'd';
+ foo (u.i, u.i, u.i, u.i, u.i);
+ buf[5 * sizeof (int)] = '\0';
+ __builtin_puts (buf);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "memcpy" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29254.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29254.c
new file mode 100644
index 000000000..598b6bf7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29254.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Werror" } */
+
+list_compare (int * list1)
+{
+ if (list1)
+ value_compare ();
+}
+
+func1 (int * f){}
+
+value_compare (int * a)
+{
+ if (a)
+ list_compare (a);
+}
+
+func2 (const int * fb)
+{
+ func1 ((int *) fb); /* { dg-bogus "discards qualifiers" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29299.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29299.c
new file mode 100644
index 000000000..9049060fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29299.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+static int bof __attribute__((used));
+int foo()
+{
+ static int barbarbarbar __attribute__((used));
+};
+
+/* { dg-final { scan-assembler "barbarbarbar" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29521-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29521-2.c
new file mode 100644
index 000000000..734652c90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29521-2.c
@@ -0,0 +1,15 @@
+/* PR 29521 : warning for return with expression in function returning void */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+void func (void) { }
+
+void func2 (void)
+{
+ return func (); /* { dg-error "ISO C forbids 'return' with expression" } */
+}
+
+void func3 (void)
+{
+ return 1; /* { dg-error "'return' with a value" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29521.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29521.c
new file mode 100644
index 000000000..b6fb535fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29521.c
@@ -0,0 +1,15 @@
+/* PR 29521 : warning for return with expression in function returning void */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void func (void) { }
+
+void func2 (void)
+{
+ return func ();
+}
+
+void func3 (void)
+{
+ return 1; /* { dg-warning "'return' with a value" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29637.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29637.c
new file mode 100644
index 000000000..5dfee41b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29637.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/29637 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+typedef struct __attribute__ ((aligned (8)))
+{
+ short a, b, c, d;
+} A;
+
+typedef struct
+{
+ A a[24];
+} B;
+
+static const A b = { 0, 0, 1, -1 };
+
+void
+foo (B *x)
+{
+ int i;
+ for (i = 0; i <= 20; i += 4)
+ x->a[i] = b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29683.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29683.c
new file mode 100644
index 000000000..4bed679b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29683.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-options "-Os -fno-inline-functions" } */
+
+void abort (void);
+
+typedef struct {
+ int x[7];
+} agg7;
+
+typedef struct {
+ int mbr1;
+ int mbr2;
+} agg2;
+
+int expected = 31415;
+agg7 filler;
+
+int GetConst (agg7 filler, agg2 split)
+{
+ return expected;
+}
+
+void VerifyValues (agg7 filler, int last_reg, int first_stack, int second_stack)
+{
+ if (first_stack != 123 || second_stack != expected)
+ abort ();
+}
+
+void RunTest (agg2 a)
+{
+ int result;
+
+ result = GetConst (filler, a);
+ VerifyValues (filler, 0, a.mbr1, result);
+}
+
+int main(void)
+{
+ agg2 result = {123, 456};
+ RunTest (result);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29736.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29736.c
new file mode 100644
index 000000000..54eb9aaaa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29736.c
@@ -0,0 +1,13 @@
+/* PR c/29736 */
+
+int __attribute__ ((vector_size (8), vector_size (8))) v; /* { dg-error "invalid vector type" } */
+
+extern int __attribute__ ((vector_size (8))) w;
+int __attribute__ ((vector_size (8))) w;
+
+void
+foo ()
+{
+ v = v + v;
+ w = w + w;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29801.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29801.c
new file mode 100644
index 000000000..b61ae5142
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29801.c
@@ -0,0 +1,24 @@
+/* We used to crash in ccp here, because the initial constant value of 2
+ was changed to 5. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static const int a = 2;
+
+int test (int param)
+{
+ int *p = (int *) &a;
+
+ if (param)
+ *p = 5;
+
+ return a;
+}
+
+/* Check that we return the correct (unchanged) value. */
+
+/* { dg-final { scan-tree-dump-times "return 2" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 5" 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29921-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29921-2.c
new file mode 100644
index 000000000..8cf665eed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29921-2.c
@@ -0,0 +1,27 @@
+/* With -ffast-math, the latice value for sum2 used to change from NaN to
+ VARYING, in turn causing the lattice value of sum1 * sum2 change from
+ NaN to 0 (since sum1 is believed to be 0 at that moment, and
+ 0 * VARYING = 0 with -ffast-math), which caused an ICE. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+int
+foo (float *array, int end)
+{
+ int i;
+ float sum1, sum2;
+
+ sum2 = 0;
+ for (i = 0; i < end; i++)
+ sum2 = sum2+array[i];
+ sum2 = 1./sum2;
+ sum1 = 0.;
+ for (i = 0; i < end; i++)
+ sum1 = sum1+array[i];
+ sum1 = sum1 * sum2;
+ if (-10.0 / sum1 < 5.E-5)
+ end = 0;
+ return end;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr29921.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr29921.c
new file mode 100644
index 000000000..7689f54ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr29921.c
@@ -0,0 +1,20 @@
+/* With -ffast-math, the latice value for t changes from -0.0 to 0.0 in this
+ testcase. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double test (int param)
+{
+ double a = 0.0, b = -1.0, t;
+ int i;
+
+ for (i = 0; i < 100; i++)
+ {
+ t = a * b;
+ if (param)
+ b = 2.0;
+ }
+
+ return t;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30045.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30045.c
new file mode 100644
index 000000000..6dd22a1df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30045.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-inline" } */
+int f(int *a)
+{
+ int __attribute__((nonnull(1))) g(int *b)
+ {
+ int **c = &a;
+ if (b)
+ return *a + **c;
+ return *b;
+ }
+ if (a)
+ return g(a);
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30137-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30137-1.c
new file mode 100644
index 000000000..cf1b40634
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30137-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-w -fdump-tree-gimple" } */
+
+/* Things that should not be folded. */
+
+struct { long base; int tail; void * volatile ptr; } *s;
+int foo3 (void) { return s == &s; }
+int foo5 (void) { return s->ptr == s->ptr; }
+
+struct { union { int i; short s } u; } x;
+int foo6 (void) { return x.u.i == x.u.s; }
+
+void **p;
+int foo8 (void) { return p == &p; }
+int foo9 (void) { return *p == p; }
+int foo10 (void) { return *p == &p; }
+int foo11 (void) { return p != &p; }
+int foo12 (void) { return *p != p; }
+int foo13 (void) { return *p != &p; }
+
+/* { dg-final { scan-tree-dump-not "= 0;" "gimple" } } */
+/* { dg-final { scan-tree-dump-not "= 1;" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30137-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30137-2.c
new file mode 100644
index 000000000..53be1633b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30137-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-w -fdump-tree-gimple" } */
+
+/* Things that should be folded. */
+
+struct { long base; int tail; void * volatile ptr; } *s;
+int foo1a (void) { return (s == &s->base); }
+int foo1b (void) { return (&s->base == s); }
+int foo2 (void) { return ((void *)s == (void *) &s->base); }
+int foo4 (void) { return s->base == s->base; }
+int foo5 (void) { return &s->ptr == &s->ptr; }
+int foo6 (void) { return &s->ptr != &s->ptr; }
+int foo7 (void) { return &s->base != &s->ptr; }
+
+struct { union { int i; short s } u; } x;
+int foo8 (void) { return &x.u.i == &x.u.s; }
+
+/* { dg-final { scan-tree-dump-times "= 0" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "= 1" 7 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30172-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30172-1.c
new file mode 100644
index 000000000..2388a091c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30172-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-signed-zeros -ffinite-math-only -fdump-tree-gimple" } */
+
+_Complex double test1 (double x) { return x + 1.i; }
+_Complex double test2 (double x) { return 1 + x * 1.i; }
+_Complex double test3 (double x, double y) { return x + y * 1.i; }
+_Complex double test4 (double x, double y) { return (x + y * 1.i) * 1.i; }
+_Complex double test5 (double x, double y) { return (x + y * 1.i) * -1.i; }
+
+/* { dg-final { scan-tree-dump "COMPLEX_EXPR <x, 1.0e\\+0>" "gimple" } } */
+/* { dg-final { scan-tree-dump "COMPLEX_EXPR <1.0e\\+0, x>" "gimple" } } */
+/* { dg-final { scan-tree-dump "COMPLEX_EXPR <x, y>" "gimple" } } */
+/* { dg-final { scan-tree-dump "D.* = -y;\n.*COMPLEX_EXPR <D.*, x>" "gimple" } } */
+/* { dg-final { scan-tree-dump "D.* = -x;\n.*COMPLEX_EXPR <y, D.*>" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30189.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30189.c
new file mode 100644
index 000000000..6aa963e7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30189.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-g -O" } */
+
+extern void foo (void);
+
+static
+void baz (int i)
+{
+ foo ();
+ typedef char A[i];
+ struct { A b; } *x = 0;
+}
+
+void
+bar (i)
+{
+ baz (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30260.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30260.c
new file mode 100644
index 000000000..f7373176e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30260.c
@@ -0,0 +1,32 @@
+/* PR 30260 */
+/* { dg-do link } */
+/* { dg-options "-pedantic -O" } */
+#include <limits.h>
+
+enum A {
+ A1 = 0,
+ A2 = A1 - 1
+};
+enum B {
+ B1 = 0u,
+ B2 = B1 - 1 /* { dg-bogus "ISO C restricts enumerator values to range of 'int'" } */
+};
+int main(void)
+{
+ enum A a = -1;
+ enum B b = -1;
+
+ if (!(a < 0))
+ link_error ();
+ if (!(A2 < 0))
+ link_error ();
+ if (!(b < 0))
+ link_error ();
+ if (!(B2 < 0))
+ link_error ();
+
+ return 0;
+}
+
+enum E1 { e10 = INT_MAX, e11 }; /* { dg-error "overflow in enumeration values" } */
+enum E2 { e20 = (unsigned) INT_MAX, e21 }; /* { dg-error "overflow in enumeration values" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30286.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30286.c
new file mode 100644
index 000000000..d35eacd80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30286.c
@@ -0,0 +1,38 @@
+/* PR middle-end/30286 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftrapv" } */
+/* { dg-require-effective-target trapping } */
+
+extern void abort (void);
+struct S { struct S *s; };
+struct T { struct S *t[25]; };
+
+void
+__attribute__((noinline))
+foo (int i, struct T *x, struct S *y)
+{
+ int j;
+ for (j = 14; j > i; j--)
+ x->t[j] = y->s;
+}
+
+int
+main (void)
+{
+ struct S s;
+ struct T t;
+ int i;
+
+ s.s = &s;
+ __builtin_memset (&t, 0, sizeof (t));
+ foo (6, &t, &s);
+ for (i = 0; i < 25; i++)
+ if (t.t[i] != ((i > 6 && i <= 14) ? &s : (struct S *) 0))
+ abort ();
+ __builtin_memset (&t, 0, sizeof (t));
+ foo (-1, &t, &s);
+ for (i = 0; i < 25; i++)
+ if (t.t[i] != ((i >= 0 && i <= 14) ? &s : (struct S *) 0))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30360.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30360.c
new file mode 100644
index 000000000..4254c0a38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30360.c
@@ -0,0 +1,25 @@
+/* PR c/30360 */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* ia64-*-linux* s390*-*-linux* } } */
+/* { dg-options "-O2 -std=gnu99" } */
+
+#define I (__extension__ 1.0iF)
+#define H(x) asm ("" : "=m" (x) : "m" (x))
+extern void abort (void);
+
+int
+main (void)
+{
+ _Complex double a = 1.0 + 1.0 * I, b = 0.0, c;
+ H (a);
+ H (b);
+ c = a / b;
+ if (!__builtin_isinf (__real__ c) && !__builtin_isinf (__imag__ c))
+ abort ();
+ a = 0.0;
+ H (a);
+ H (b);
+ c = a / b;
+ if (!__builtin_isnan (__real__ c) || !__builtin_isnan (__imag__ c))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30457.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30457.c
new file mode 100644
index 000000000..d72f47c1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30457.c
@@ -0,0 +1,26 @@
+/* PR 30457 warn about va_start(ap, invalid) */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+/* Undefined by C99 7.15.1.4p4 (va_start):
+ "If the parameter parmN is declared with the register storage
+ class, with a function or array type, or with a type that is
+ not compatible with the type that results after application of
+ the default argument promotions, the behavior is undefined." */
+
+#include <stdarg.h>
+
+void foo(register short paramN, ...)
+{
+ va_list ap;
+
+ va_start(ap, paramN); /* { dg-warning "undefined behaviour when second parameter of 'va_start' is declared with 'register' storage" } */
+
+ /* Undefined by C99 7.15.1.1p2: */
+ (void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" "promoted" } */
+ /* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "int not char" { target *-*-* } 20 } */
+ /* { dg-message "note: if this code is reached, the program will abort" "will abort" { target *-*-* } 20 } */
+
+ va_end(ap);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30473.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30473.c
new file mode 100644
index 000000000..f01c1cc4a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30473.c
@@ -0,0 +1,13 @@
+/* PR middle-end/30473 */
+/* Make sure this doesn't ICE. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern int sprintf (char *, const char *, ...);
+
+void
+foo (char *buf1, char *buf2)
+{
+ sprintf (buf1, "%s", "abcde");
+ sprintf (buf2, "%s");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-2.c
new file mode 100644
index 000000000..aa3c117c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-2.c
@@ -0,0 +1,8 @@
+/* PR 30551 -Wmain is not enabled by default. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
+/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-3.c
new file mode 100644
index 000000000..121cfe873
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-3.c
@@ -0,0 +1,7 @@
+/* PR 30551 -Wmain is enabled by -pedantic-errors. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+/* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */
+void main(char a) {} /* { dg-error "first argument of .main. should be .int." "int" } */
+/* { dg-error ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-error "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-4.c
new file mode 100644
index 000000000..a025a660b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-4.c
@@ -0,0 +1,8 @@
+/* PR 30551 -Wmain is enabled by -pedantic-errors and can be disabled. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -Wno-main" } */
+
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
+/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-5.c
new file mode 100644
index 000000000..95685925a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-5.c
@@ -0,0 +1,7 @@
+/* PR 30551 -Wmain is enabled by -pedantic and can be disabled. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic -Wno-main" } */
+
+void main(char a) {} /* { dg-bogus "first argument of .main. should be .int." "int" } */
+/* { dg-bogus ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-bogus "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-6.c
new file mode 100644
index 000000000..ba4cefceb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551-6.c
@@ -0,0 +1,7 @@
+/* PR 30551 -Wmain is enabled by -pedantic. */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+/* { dg-skip-if "-Wmain not enabled with -pedantic on SPU" { spu-*-* } } */
+void main(char a) {} /* { dg-warning "first argument of .main. should be .int." "int" } */
+/* { dg-warning ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-warning "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30551.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551.c
new file mode 100644
index 000000000..68ecdedb3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30551.c
@@ -0,0 +1,7 @@
+/* PR 30551 -Wmain is enabled by -Wall. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+/* { dg-skip-if "-Wmain not enabled with -Wall on SPU" { spu-*-* } } */
+void main(char a) {} /* { dg-warning "first argument of .main. should be .int." "int" } */
+/* { dg-warning ".main. takes only zero or two arguments" "zero or two" { target *-*-* } 5 } */
+/* { dg-warning "return type of .main. is not .int." "return type" { target *-*-* } 5 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30643.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30643.c
new file mode 100644
index 000000000..67fe111a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30643.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "undefined" } } */
+
+/* Make sure we optimize all calls away. */
+
+extern void undefined (void);
+struct s { int a, b; };
+void bar (struct s *ps, int *p, int *__restrict__ rp, int *__restrict__ rq)
+{
+ ps->a = 0;
+ ps->b = 1;
+ if (ps->a != 0)
+ undefined ();
+ p[0] = 0;
+ p[1] = 1;
+ if (p[0] != 0)
+ undefined ();
+ rp[0] = 0;
+ rq[0] = 1;
+ if (rp[0] != 0)
+ undefined ();
+}
+int main (void) {
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr3074-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr3074-1.c
new file mode 100644
index 000000000..4716b79da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr3074-1.c
@@ -0,0 +1,9 @@
+/* PR middle-end/3074 */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+void foo(int a)
+{
+ 5 * (a == 1) | (a == 2); /* { dg-warning "no effect" "no effect" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30744-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30744-1.c
new file mode 100644
index 000000000..f08f3be17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30744-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+#include <stddef.h>
+
+typedef __INTPTR_TYPE__ my_intptr_t;
+
+typedef struct {
+ my_intptr_t unique;
+} G;
+
+void r(G* n)
+{
+ my_intptr_t p;
+ if (((G *) ((void *)((~(my_intptr_t)(p))))) != ((void *)0)) {
+ ((G *) ((void *)((~(my_intptr_t)(p)))))->unique = n->unique;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30762-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30762-1.c
new file mode 100644
index 000000000..75fb762d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30762-1.c
@@ -0,0 +1,18 @@
+/* PR c/30762 */
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -O3" } */
+/* { dg-additional-sources pr30762-2.c } */
+
+typedef struct { int i; } D;
+extern void foo (D);
+
+void
+bar (void)
+{
+ D d;
+ d.i = 1;
+ foo (d);
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30762-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30762-2.c
new file mode 100644
index 000000000..7e914ebfa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30762-2.c
@@ -0,0 +1,9 @@
+/* PR c/30762 */
+/* { dg-do compile } */
+
+typedef struct { int i; } D;
+
+void
+foo (D x)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30904.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30904.c
new file mode 100644
index 000000000..31ca0497f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30904.c
@@ -0,0 +1,18 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern int t;
+extern void link_error(void);
+int main (void)
+{
+ struct { unsigned int a : 7; } s;
+ s.a = t;
+ if (s.a >> 8)
+ link_error ();
+ if (s.a >> 9)
+ link_error ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30949.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30949.c
new file mode 100644
index 000000000..a3f6a1413
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30949.c
@@ -0,0 +1,11 @@
+/* PR30949 */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+int func (int x);
+void recv (int (* funcptr) (double x)); /* { dg-message "note: expected 'int .\\\*..double.' but argument is of type 'int .\\\*..int.'" } */
+void call (void)
+{
+ recv (func); /* { dg-error "passing argument 1 of 'recv' from incompatible pointer type" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30951.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30951.c
new file mode 100644
index 000000000..149b8ecaa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30951.c
@@ -0,0 +1,36 @@
+/* { dg-do link } */
+
+extern void link_error (void);
+
+void test (int x, unsigned int y)
+{
+ if (x + 5 == x)
+ link_error ();
+ if (x == x + 10)
+ link_error ();
+ if (y + 5 == y)
+ link_error ();
+ if (y == y + 10)
+ link_error ();
+ if (x + 5 != x)
+ ;
+ else
+ link_error ();
+ if (x != x + 10)
+ ;
+ else
+ link_error ();
+ if (y + 5 != y)
+ ;
+ else
+ link_error ();
+ if (y != y + 10)
+ ;
+ else
+ link_error ();
+}
+
+int main()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr30957-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr30957-1.c
new file mode 100644
index 000000000..65b98fa53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr30957-1.c
@@ -0,0 +1,37 @@
+/* { dg-do run { xfail *-*-* } } */
+/* We don't (and don't want to) perform this optimisation on soft-float
+ targets, where each addition is a library call. This test requires
+ -fassociative-math for enabling the variable-expansion as well as
+ -fsigned-zeros for honoring the sign of zero; but
+ they can not co-exist; also under -funsafe-math-optimizations, so we
+ expect it to fail. */
+/* { dg-require-effective-target hard_float } */
+/* { dg-options "-O2 -funroll-loops -funsafe-math-optimizations -fvariable-expansion-in-unroller -fdump-rtl-loop2_unroll" } */
+
+extern void abort (void);
+extern void exit (int);
+
+float __attribute__((noinline))
+foo (float d, int n)
+{
+ unsigned i;
+ float accum = d;
+
+ for (i = 0; i < n; i++)
+ accum += d;
+
+ return accum;
+}
+
+int
+main ()
+{
+ if (__builtin_copysignf (1.0, foo (0.0 / -5.0, 10)) != -1.0)
+ abort ();
+ exit (0);
+}
+
+/* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" } } */
+/* { dg-final { cleanup-rtl-dump "loop*" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31127.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31127.c
new file mode 100644
index 000000000..f45b10ed5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31127.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void ParseStringSidToSid(char *s, int* p) {
+ int i = 0;
+
+ while (*s) {
+ while (*s && *s != '-')
+ s++;
+ if (*s== '-')
+ s++;
+
+ p[i++] = *s;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-2.c
new file mode 100644
index 000000000..2449ac468
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-2.c
@@ -0,0 +1,7 @@
+/* PR middle-end/31490 */
+/* { dg-do compile } */
+/* { dg-options "-fpic" { target fpic } } */
+/* { dg-require-named-sections "" } */
+
+const char *const x __attribute__((section("foo"))) = "";
+const char *const g __attribute__((section("foo"))) = (const char *) 0;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-3.c
new file mode 100644
index 000000000..e7ccc677d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-3.c
@@ -0,0 +1,7 @@
+/* PR middle-end/31490 */
+/* { dg-do compile } */
+/* { dg-options "-fpic" { target fpic } } */
+/* { dg-require-named-sections "" } */
+
+const char *const x __attribute__((section("foo"))) = (const char *) 0;
+const char *const g __attribute__((section("foo"))) = "bar";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-4.c
new file mode 100644
index 000000000..cbfc68730
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31490-4.c
@@ -0,0 +1,10 @@
+/* PR middle-end/31490 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fpic" { target fpic } } */
+/* { dg-require-named-sections "" } */
+
+const char *const x __attribute__((section("foo"))) = "";
+const char *const g __attribute__((section("foo"))) = (const char *) 0;
+const char *const y __attribute__((section("bar"))) = (const char *) 0;
+const char *const h __attribute__((section("bar"))) = "bar";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31490.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31490.c
new file mode 100644
index 000000000..37731b3a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31490.c
@@ -0,0 +1,10 @@
+/* PR middle-end/31490 */
+/* { dg-do compile } */
+/* { dg-require-named-sections "" } */
+/* { dg-require-effective-target ptr32plus } */
+
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
+
+int cpu (void *attr) {}
+const uintptr_t x __attribute__((section("foo"))) = (uintptr_t)&cpu;
+const uintptr_t g __attribute__((section("foo"))) = 0;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31507-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31507-1.c
new file mode 100644
index 000000000..dbba1e1fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31507-1.c
@@ -0,0 +1,41 @@
+/* PR target/31507 */
+/* { dg-do run } */
+/* { dg-options "-Os -fno-omit-frame-pointer" } */
+
+extern void abort (void);
+
+__attribute__((noinline)) void
+foo (double d0, double d1, double d2, double d3,
+ double d4, double d5, double d6, double d7,
+ float f0, float f1, float f2, float f3,
+ char *p)
+{
+ if (d0 != 0 || d1 != 1 || d2 != 2 || d3 != 3)
+ abort ();
+ if (d4 != 4 || d5 != 5 || d6 != 6 || d7 != 7)
+ abort ();
+ if (f0 != 10 || f1 != 11 || f2 != 12 || f3 != 13)
+ abort ();
+ if (__builtin_memcmp (p, "foo", 4) != 0)
+ abort ();
+ __builtin_memcpy (p, "bar", 4);
+}
+
+__attribute__((noinline)) void
+bar (int x)
+{
+ char p[x];
+ if (x >= sizeof "foo")
+ __builtin_memcpy (p, "foo", 4);
+ foo (0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0,
+ 10.0f, 11.0f, 12.0f, 13.0f, p);
+ if (x >= sizeof "bar" && __builtin_memcmp (p, "bar", 4) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ bar (128);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31507-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31507-2.c
new file mode 100644
index 000000000..ee2388b7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31507-2.c
@@ -0,0 +1,14 @@
+/* PR target/31507 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fno-omit-frame-pointer" } */
+
+typedef int (*closure_test_type3)(float, float, float, float, float, float,
+ float, float, double, int, float, float, int,
+ float, float, int);
+int f (closure_test_type3 pcl)
+{
+ int res;
+ res = (pcl)
+ (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
+ 19.19, 21.21, 1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31529-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31529-1.c
new file mode 100644
index 000000000..7182e8fe6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31529-1.c
@@ -0,0 +1,10 @@
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto" } */
+/* { dg-additional-sources "pr31529-2.c" } */
+
+getline ()
+{
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31529-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31529-2.c
new file mode 100644
index 000000000..40d8ef868
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31529-2.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+extern __inline
+getline ()
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31847.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31847.c
new file mode 100644
index 000000000..4b945a994
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31847.c
@@ -0,0 +1,15 @@
+/* PR 31847 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-all" } */
+
+extern int bar(int);
+
+int foo()
+{
+ int a = 0;
+ return bar(a);
+}
+
+/* { dg-final { scan-tree-dump-not "Created value for " "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31866.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31866.c
new file mode 100644
index 000000000..4081c0e6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31866.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/31866 */
+/* { dg-do compile { target alpha*-*-* cris-*-* crisv32-*-* i?86-*-* mmix-*-* powerpc*-*-* rs6000-*-* x86_64-*-* } } */
+/* { dg-options "-O2" } */
+
+#if defined (__alpha__)
+# define REG "$1"
+#elif defined (__CRIS__)
+# define REG "r10"
+#elif defined (__i386__)
+# define REG "%eax"
+#elif defined (__MMIX__)
+# define REG "$8"
+#elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
+ || defined (__POWERPC__) || defined (PPC) || defined (_IBMR2)
+# define REG "6"
+#elif defined (__x86_64__)
+# define REG "rax"
+#endif
+
+long int
+foo (void)
+{
+ unsigned long int s;
+ long int a = (long int) 0;
+ register long int r asm (REG) = a;
+ asm ("" : "=r" (s) : "0" (r));
+ return s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr31959.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr31959.c
new file mode 100644
index 000000000..f8090f45c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr31959.c
@@ -0,0 +1,20 @@
+/* PR middle-end/31959 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -fguess-branch-probability" } */
+
+struct A { int i; };
+
+static inline struct A *
+bar (struct A *x)
+{
+ return x;
+}
+
+void *
+foo (struct A *x, int y)
+{
+ void *p = (void *) 0;
+ if (__builtin_expect (y >= 6, 0))
+ p = bar (x);
+ return p;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32041.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32041.c
new file mode 100644
index 000000000..60837b204
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32041.c
@@ -0,0 +1,12 @@
+/* PR c/32041 */
+/* { dg-do compile } */
+
+struct S
+{
+ int c;
+ struct { float f; } sa[2];
+};
+
+char a[__builtin_offsetof (struct S, sa->f)
+ == __builtin_offsetof (struct S, sa[0].f) ? 1 : -1];
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32061.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32061.c
new file mode 100644
index 000000000..dc1a916f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32061.c
@@ -0,0 +1,10 @@
+/* PR c/32061
+ { dg-do compile }
+ { dg-options "-Wlogical-op -Wall -Wextra" }
+*/
+#define FORCE 1
+#define FLAG 1
+int func (int resp, int flags)
+{
+ return (resp && (FORCE || (FLAG & flags)));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32069.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32069.c
new file mode 100644
index 000000000..2ec37c675
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32069.c
@@ -0,0 +1,7 @@
+/* { dg-do-compile } */
+/* { dg-options "-O0 -fsplit-wide-types" } */
+
+long long int segfault (long long int a, long long int b)
+{
+ return a ^ b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32135.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32135.c
new file mode 100644
index 000000000..445965644
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32135.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Warray-bounds -O2" } */
+struct PhaseEntryType
+{
+ char raw_field[50 + 1];
+};
+int
+ParsePhase (char in_cols[15][250], struct PhaseEntryType *P)
+{
+ __builtin_strncpy (P->raw_field, in_cols[2], 50);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32176.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32176.c
new file mode 100644
index 000000000..3017c34e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32176.c
@@ -0,0 +1,28 @@
+/* Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=i686 -msse" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+void foo (void)
+{
+ int i, m;
+ float xa[21];
+
+ m = 0;
+ while (1)
+ {
+ i = 0;
+ while (1)
+ {
+ if (xa[(long int)i] == xa[(long int)(i+m)])
+ _gfortran_abort ();
+ if (i == 10)
+ break;
+ i++;
+ }
+ if (m == 10)
+ break;
+ m++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32207.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32207.c
new file mode 100644
index 000000000..cf9bef809
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32207.c
@@ -0,0 +1,9 @@
+/* Test warning for comparison non-null address with null pointer constant. */
+/* Origin: Pawel Sikora <pluto@agmk.net> */
+/* { dg-do compile } */
+/* { dg-options "-Waddress" } */
+extern void z();
+
+void f() { if ( z ) z(); } /* { dg-warning "always evaluate as" } */
+void g() { if ( z != 0 ) z(); } /* { dg-warning "the comparison will always evaluate as 'true'" } */
+void h() { if ( z != (void*)0 ) z(); } /* { dg-warning "the comparison will always evaluate as 'true'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32293.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32293.c
new file mode 100644
index 000000000..fb1268ba1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32293.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned int _IDEC_glbround;
+unsigned int _IDEC_glbflags;
+typedef unsigned UINT32;
+typedef signed SINT32;
+typedef unsigned long long UINT64;
+typedef signed long long SINT64;
+typedef
+__attribute__ ((aligned(16)))
+ struct {
+ UINT64 w[2];
+ } UINT128;
+
+static __inline UINT64
+unpack_BID128 (UINT64 * psign_x, int *pexponent_x,
+ UINT128 * pcoefficient_x, UINT128 * px) {
+ UINT128 coeff;
+ UINT64 ex;
+ *psign_x = (px->w[1]) & 0x8000000000000000ull;
+ ex = (px->w[1]) >> 49;
+ *pexponent_x = ((int) ex) & 0x3fff;
+ return coeff.w[0] | coeff.w[1];
+}
+
+static __inline UINT32
+get_BID32 (UINT32 sgn, int expon, UINT64 coeff, int rmode,
+ unsigned *fpsc) {
+ UINT32 r;
+
+ if (((unsigned) expon) > 191) {
+ r = sgn | 0x78000000ul;
+ switch (rmode) {
+ case 0x00002:
+ if (sgn)
+ r = sgn | 0x77f8967f;
+ }
+ return r;
+ }
+ r = expon;
+ return r;
+}
+
+UINT32
+bid128_to_bid32 (UINT128 x)
+{
+ UINT128 *px;
+ UINT128 CX;
+ UINT64 sign_x;
+ UINT32 res;
+ int exponent_x = 0;
+ px = &x;
+ if (!unpack_BID128 (&sign_x, &exponent_x, &CX, px)) {
+ return(res);
+ }
+ res = get_BID32 ((UINT32) (sign_x >> 32),
+ exponent_x, CX.w[0], _IDEC_glbround, &_IDEC_glbflags);
+ return(res);;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32328.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32328.c
new file mode 100644
index 000000000..69b08fc4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32328.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct barstruct { char const* some_string; };
+
+void changethepointer(struct barstruct**);
+
+void baz()
+{
+ struct barstruct bar1;
+ struct barstruct* barptr = &bar1;
+ changethepointer(&barptr);
+ barptr->some_string = "Everything OK";
+}
+
+/* { dg-final { scan-tree-dump "Everything OK" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32338-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32338-1.c
new file mode 100644
index 000000000..6a79a8c22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32338-1.c
@@ -0,0 +1,47 @@
+/* PR target/32338 */
+/* { dg-do link } */
+/* { dg-options "-O2 -fno-omit-frame-pointer" } */
+
+struct S
+{
+};
+
+int
+__attribute__((noinline))
+foo (struct S *d)
+{
+ return 2;
+}
+
+int
+__attribute__((noinline))
+bar (struct S *d)
+{
+ return 4;
+}
+
+int
+__attribute__((noinline))
+fnl (char const *q)
+{
+ return __builtin_strlen (q);
+}
+
+int
+__attribute__((noinline))
+baz (struct S *d, char const *q)
+{
+ unsigned int len;
+ len = fnl (q);
+ if (len > 512)
+ return bar (d);
+ return foo (d);
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 30)
+ return baz ((void *) 0, "abcde");
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32338-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32338-2.c
new file mode 100644
index 000000000..81daddf6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32338-2.c
@@ -0,0 +1,47 @@
+/* PR target/32338 */
+/* { dg-do link } */
+/* { dg-options "-O2 -fno-omit-frame-pointer" } */
+
+struct S
+{
+};
+
+int
+__attribute__((noinline))
+foo (void)
+{
+ return 2;
+}
+
+int
+__attribute__((noinline))
+bar (void)
+{
+ return 4;
+}
+
+int
+__attribute__((noinline))
+fnl (void)
+{
+ return 6;
+}
+
+int
+__attribute__((noinline))
+baz (void)
+{
+ unsigned int len;
+ len = fnl ();
+ if (len > 512)
+ return bar ();
+ return foo ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 30)
+ return baz ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32370.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32370.c
new file mode 100644
index 000000000..fc3d724e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32370.c
@@ -0,0 +1,30 @@
+/* PR middle-end/32370 */
+/* { dg-do compile { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" { target ia64-*-* } } */
+/* { dg-options "-ffixed-esi" { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-mabi=sysv -ffixed-esi" { target x86_64-*-mingw* } } */
+
+#if (defined __i386__ || defined __x86_64__) && ! defined _WIN64
+# define C "=S"
+# define TYPE unsigned long
+#elif defined __ia64__ || defined _WIN64
+# define C "=a"
+# define TYPE unsigned long long
+#endif
+
+#ifdef _WIN64
+__extension__
+#endif
+unsigned int
+foo (TYPE port)
+{
+ unsigned int v;
+ __asm__ __volatile__ ("" : C (v) : "Nd" (port)); /* { dg-error "while reloading\|has impossible\|inconsistent operand constraints" } */
+ return v;
+}
+
+void
+bar (void)
+{
+ foo (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32374.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32374.c
new file mode 100644
index 000000000..de15d559f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32374.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern int *stderr;
+
+void f (int *, const char *, ...);
+
+void g (const char *conf_name)
+{
+ typedef struct
+ {
+ const char *label;
+ const int value;
+ } Section;
+
+ const Section sections[2] = { {"", 0}, {"", 1} };
+
+ f (stderr, "", "", conf_name, 0, sections[0]);
+ f (stderr, "", "", conf_name, 0, sections[0]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32450.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32450.c
new file mode 100644
index 000000000..9606e3021
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32450.c
@@ -0,0 +1,36 @@
+/* Contributed by Joost VandeVondele <jv244@cam.ac.uk> */
+
+/* { dg-do run } */
+/* { dg-require-profiling "-pg" } */
+/* { dg-options "-O2 -pg" } */
+/* { dg-options "-O2 -pg -mtune=core2" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
+
+extern void abort (void);
+
+int stack_pointer;
+
+void
+__attribute__((noinline))
+mystop ()
+{
+ abort ();
+}
+
+void
+__attribute__((noinline))
+add ()
+{
+ if (stack_pointer + 1 > 10)
+ mystop ();
+
+ stack_pointer = stack_pointer + 1;
+}
+
+int main ()
+{
+ add ();
+ return stack_pointer - 1;
+}
+
+/* { dg-final { cleanup-profile-file } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32559.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32559.c
new file mode 100644
index 000000000..fee1c9790
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32559.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int __attribute__((vector_size (8))) v;
+
+void foo()
+{
+ v += ~v;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32573.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32573.c
new file mode 100644
index 000000000..d6897fbc2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32573.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/32573 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int
+foo (void *x, long long *y)
+{
+ char a[256];
+ int i = 0;
+ long long b;
+ int c;
+ int d = 0;
+ int e = 0;
+ unsigned f = 0;
+ b = bar (x);
+ c = (unsigned) b;
+ while (d < b && d < 65557)
+ {
+ f = *(unsigned *) &a[0];
+ for (i = c - 4; i > 0; i--)
+ if (a[i + 0] == 0x50
+ && a[i + 1] == 0x4B
+ && a[i + 3] == 0x06)
+ {
+ e = 1;
+ break;
+ }
+ }
+ return !e;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32721.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32721.c
new file mode 100644
index 000000000..b62272b56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32721.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int spinlock[2];
+int main ()
+{
+volatile int * spinlock0;
+volatile int * spinlock1;
+spinlock0 = &spinlock[0];
+spinlock1 = &spinlock[1];
+
+*spinlock0 = 0;
+*spinlock1 = 0;
+ while (*spinlock0);
+}
+
+/* { dg-final { scan-tree-dump "={v} .*spinlock" "optimized" } } */
+/* { dg-final { scan-tree-dump "spinlock.* ={v}" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c
new file mode 100644
index 000000000..19a90195a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32773.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fprofile-use -fopt-info" } */
+/* { dg-options "-O -m4 -fprofile-use -fopt-info" { target sh-*-* } } */
+
+void foo (int *p)
+{
+ if (p)
+ *p = 0;
+} /* { dg-message "note: \[^\n\]*execution counts estimated" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-1.c
new file mode 100644
index 000000000..0f9f64ac7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-1.c
@@ -0,0 +1,47 @@
+/* PR middle-end/32912 */
+/* { dg-do run } */
+/* { dg-options "-O2 -w" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-additional-options "-msse" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
+
+extern void abort (void);
+
+typedef int __m128i __attribute__ ((__vector_size__ (16)));
+
+__m128i a, b, c, d, e, f;
+
+void
+foo (__m128i x)
+{
+ a = x ^ ~x;
+ b = ~x ^ x;
+ c = x | ~x;
+ d = ~x | x;
+ e = x & ~x;
+ f = ~x & x;
+}
+
+int
+main (void)
+{
+ union { __m128i v; int i[sizeof (__m128i) / sizeof (int)]; } u;
+ int i;
+
+ for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++)
+ u.i[i] = i * 49 - 36;
+ foo (u.v);
+#define check(x, val) \
+ u.v = (x); \
+ for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++) \
+ if (u.i[i] != (val)) \
+ abort ()
+
+ check (a, ~0);
+ check (b, ~0);
+ check (c, ~0);
+ check (d, ~0);
+ check (e, 0);
+ check (f, 0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-2.c
new file mode 100644
index 000000000..2e800784d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-2.c
@@ -0,0 +1,58 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -w" } */
+
+extern void abort (void);
+
+#if(__SIZEOF_INT__ >= 4)
+# define TYPE int
+# define TYPED(a) a
+
+#elif(__SIZEOF_INT__ > 2)
+# define TYPE long
+# define TYPED(a) a##L
+
+#else
+# define TYPE long long
+# define TYPED(a) a##LL
+#endif
+
+
+typedef TYPE __m128i __attribute__ ((__vector_size__ (16)));
+
+__m128i
+foo (void)
+{
+ __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
+ return x;
+}
+
+__m128i
+bar (void)
+{
+ __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
+ return ~x;
+}
+
+int
+main (void)
+{
+ union { __m128i v; TYPE i[sizeof (__m128i) / sizeof (TYPE)]; } u, v;
+ int i;
+
+ u.v = foo ();
+ v.v = bar ();
+ for (i = 0; i < sizeof (u.i) / sizeof (u.i[0]); i++)
+ {
+ if (u.i[i] != ~v.i[i])
+ abort ();
+
+ if (i < 3)
+ {
+ if (u.i[i] != (TYPED (0x11111111) << i))
+ abort ();
+ }
+ else if (u.i[i])
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-3.c
new file mode 100644
index 000000000..407ac524f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32912-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-w -O2 -fdump-tree-optimized" } */
+
+typedef int __m128i __attribute__ ((__vector_size__ (16)));
+
+__m128i
+bar (void)
+{
+ __m128i x = { 0x11111111, 0x22222222, 0x44444444 };
+ return ~x;
+}
+
+/* { dg-final { scan-tree-dump-not "~\{" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr32975.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr32975.c
new file mode 100644
index 000000000..8ddb0d8d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr32975.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/32975 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -finline-functions -fipa-cp" } */
+
+static int
+f0 (char *s0, char *s1)
+{
+ return __builtin_strlen (s0) > __builtin_strlen (s1);
+}
+
+int
+f1 (char *s, int j)
+{
+ if (f0 (s, ""))
+ return 1;
+ return j;
+}
+
+void
+f2 (char *s)
+{
+ f1 (s, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33007.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33007.c
new file mode 100644
index 000000000..26b22fdd3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33007.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -ftrapping-math" } */
+/* { dg-warning "-fassociative-math disabled" "" { target *-*-* } 1 } */
+
+long
+foo (int i)
+{
+ float x;
+ x = i;
+ return __builtin_lroundf (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33017.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33017.c
new file mode 100644
index 000000000..851fe71f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33017.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/33017 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+extern __SIZE_TYPE__ strlen (const char *);
+extern void abort (void);
+
+char *
+__attribute__((noinline))
+foo (const char *string)
+{
+ int len;
+ static char var[0x104];
+ int off;
+ len = strlen (string);
+ for (off = 0; off < 64; off++)
+ var[len + off + 2] = 0x57;
+ return var;
+}
+
+int
+main (void)
+{
+ char *p = foo ("abcd");
+ int i;
+ for (i = 0; i < 0x104; i++)
+ if (p[i] != ((i >= 6 && i < 70) ? 0x57 : 0))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33092.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33092.c
new file mode 100644
index 000000000..8f48fab5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33092.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-salias" } */
+int foo ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-1.c
new file mode 100644
index 000000000..d07c97eb7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-1.c
@@ -0,0 +1,54 @@
+/* PR tree-optimization/33136 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+struct S
+{
+ struct S *a;
+ int b;
+ float f;
+};
+
+static struct S s;
+
+static int *
+__attribute__((noinline, const))
+foo (void)
+{
+ return &s.b;
+}
+
+float
+__attribute__((noinline))
+bar (float *f)
+{
+ s.f = 1.0;
+ *f = 4.0;
+ return s.f;
+}
+
+int
+__attribute__((noinline))
+baz (int *x)
+{
+ s.b = 1;
+ *x = 4;
+ return s.b;
+}
+
+int
+t (void)
+{
+ float f = 8.0;
+ return bar (&f) + baz (foo ());
+}
+
+int
+main (void)
+{
+ if (t () != 5)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-2.c
new file mode 100644
index 000000000..760b5a06f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-2.c
@@ -0,0 +1,60 @@
+/* PR tree-optimization/33136 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+struct S
+{
+ void *a;
+ int b;
+ int *c;
+};
+static int d, e;
+
+static struct S s;
+
+static int *
+__attribute__((noinline, const))
+foo (void)
+{
+ return &s.b;
+}
+
+int *
+__attribute__((noinline))
+bar (int **f)
+{
+ s.c = &d;
+ *f = &e;
+ /* As nothing ever takes the address of any int * field in struct S,
+ the write to *f can't alias with the s.c field. */
+ return s.c;
+}
+
+int
+__attribute__((noinline))
+baz (int *x)
+{
+ s.b = 1;
+ *x = 4;
+ /* Function foo takes address of an int field in struct S,
+ so *x can alias with the s.b field (and it does in this testcase). */
+ return s.b;
+}
+
+int
+__attribute__((noinline))
+t (void)
+{
+ int *f = (int *) 0;
+ return 10 * (bar (&f) != &d) + baz (foo ());
+}
+
+int
+main (void)
+{
+ if (t () != 4)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-3.c
new file mode 100644
index 000000000..fcb5972eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33136-3.c
@@ -0,0 +1,60 @@
+/* PR tree-optimization/33136 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+struct S
+{
+ void *a;
+ int b[3];
+ double *c;
+};
+static double d, e;
+
+static struct S s;
+
+static int *
+__attribute__((noinline, const))
+foo (void)
+{
+ return (int *) &s.b;
+}
+
+double *
+__attribute__((noinline))
+bar (double **f)
+{
+ s.c = &d;
+ *f = &e;
+ /* As nothing ever takes the address of any double * field in struct S,
+ the write to *f can't alias with the s.c field. */
+ return s.c;
+}
+
+int
+__attribute__((noinline))
+baz (int *x)
+{
+ s.b[0] = 1;
+ *x = 4;
+ /* Function foo takes address of an int array field in struct S,
+ so *x can alias with the s.b field (and it does in this testcase). */
+ return s.b[0];
+}
+
+int
+__attribute__((noinline))
+t (void)
+{
+ double *f = (double *) 0;
+ return 10 * (bar (&f) != &d) + baz (foo ());
+}
+
+int
+main (void)
+{
+ if (t () != 4)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33238.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33238.c
new file mode 100644
index 000000000..0b399041a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33238.c
@@ -0,0 +1,12 @@
+/* PR c/33238 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+void
+reverse (void *x, int y, int z)
+{
+ struct { char w[z]; } *p = x, a;
+ int i, j;
+ for (i = y - 1, j = 0; j < y / 2; i--, j++)
+ ({ a = p[i]; p[i] = p[j]; p[j] = a; });
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-1.c
new file mode 100644
index 000000000..d646ff74d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-1.c
@@ -0,0 +1,25 @@
+/* PR tree-optimization/33434 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int k;
+
+void f1 (int a, int b)
+{
+ a = 1;
+ b = 1;
+ if (a)
+ while (b --)
+ k = 1;
+ else
+ if (b != 1)
+ __builtin_abort ();
+}
+
+int main (void)
+{
+ f1 (1, 1);
+ if (k != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-2.c
new file mode 100644
index 000000000..7dd614c0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-2.c
@@ -0,0 +1,26 @@
+/* PR tree-optimization/33434 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int k;
+
+void f1 (int a)
+{
+ int b;
+ a = 1;
+ b = 1;
+ if (a)
+ while (b --)
+ k = 1;
+ else
+ if (b != 1)
+ __builtin_abort ();
+}
+
+int main (void)
+{
+ f1 (1);
+ if (k != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-3.c
new file mode 100644
index 000000000..3e99451fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-3.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/33434 */
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+int k;
+
+void __attribute__((noinline)) f2 (int b)
+{
+ k = b - 1;
+}
+
+void f1 (int a, int b)
+{
+ f2 (b);
+ a = 1;
+ b = 1;
+ if (a)
+ while (b --)
+ k = 1;
+ else
+ if (b != 1)
+ __builtin_abort ();
+}
+
+int main (void)
+{
+ f1 (1, 1);
+ if (k != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-4.c
new file mode 100644
index 000000000..d34675fe4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33434-4.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/33434 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void *baz (void);
+
+static void *
+bar (void *x)
+{
+ x = baz ();
+ return x;
+}
+
+void *
+foo (void *x)
+{
+ return bar (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33619.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33619.c
new file mode 100644
index 000000000..8011e69e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33619.c
@@ -0,0 +1,45 @@
+/* PR tree-optimization/33619 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#ifdef __powerpc__
+# define REG1 __asm__ ("3")
+# define REG2 __asm__ ("4")
+#elif defined __x86_64__
+# define REG1 __asm__ ("rdi")
+# define REG2 __asm__ ("rsi")
+#else
+# define REG1
+# define REG2
+#endif
+
+static inline void
+bar (unsigned long x, int y)
+{
+ register unsigned long p1 REG1 = x;
+ register unsigned long p2 REG2 = y;
+ __asm__ volatile ("" : "=r" (p1), "=r" (p2) : "0" (p1), "1" (p2) : "memory");
+ if (p1 != 0xdeadUL || p2 != 0xbefUL)
+ __builtin_abort ();
+}
+
+__attribute__((const, noinline)) int
+baz (int x)
+{
+ return x;
+}
+
+__attribute__((noinline)) void
+foo (unsigned long *x, int y)
+{
+ unsigned long a = *x;
+ bar (a, baz (y));
+}
+
+int
+main (void)
+{
+ unsigned long a = 0xdeadUL;
+ foo (&a, 0xbefUL);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33644.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33644.c
new file mode 100644
index 000000000..f3f543cbe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33644.c
@@ -0,0 +1,19 @@
+/* PR rtl-optimization/33644 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftrapv" } */
+
+extern char *bar (const char *);
+
+int *m, *b;
+
+void foo (void)
+{
+ int *mv;
+ int p;
+ char a[17];
+
+ p = bar (a) - a;
+ for (mv = m; mv < b; mv++)
+ if (p && ((*mv & 7) != p))
+ *mv=0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33645-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33645-1.c
new file mode 100644
index 000000000..1ec8a2ff8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33645-1.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/33645 */
+/* { dg-do link } */
+/* { dg-options "-O2 -fno-unit-at-a-time" } */
+
+__attribute__((noinline)) int
+bar (int *x)
+{
+ return *x++;
+}
+
+int
+main ()
+{
+ static int var1_s;
+ static int *var1_t = &var1_s;
+
+ return bar (var1_t) != 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33645-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33645-2.c
new file mode 100644
index 000000000..3c4bcb060
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33645-2.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/33645 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funit-at-a-time" } */
+
+__attribute__((noinline)) int
+bar (int *x)
+{
+ return *x++;
+}
+
+int
+main ()
+{
+ static int var1_s;
+ static int *var1_t = &var1_s;
+
+ return bar (var1_t) != 0;
+}
+
+/* { dg-final { scan-assembler-not "var1_t" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33648.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33648.c
new file mode 100644
index 000000000..f5da55cd4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33648.c
@@ -0,0 +1,14 @@
+/* PR rtl-optimization/33648 */
+/* { dg-do compile } */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -fmodulo-sched -freorder-blocks-and-partition" } */
+
+unsigned res;
+
+void
+foo (unsigned code, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ res |= code & 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33653.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33653.c
new file mode 100644
index 000000000..91274c27e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33653.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-shorten" } */
+
+void f (volatile char *p)
+{
+ char c = p[0];
+}
+
+/* { dg-final { scan-rtl-dump "mem/v" "shorten" } } */
+/* { dg-final { cleanup-rtl-dump "shorten" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33666.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33666.c
new file mode 100644
index 000000000..1f27b136d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33666.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options { -std=c99 } } */
+
+/* This used to fail with type-checking enabled because we stripped
+ the inner conversion to unsigned int. */
+
+void __lock_get_list(void *dp)
+{
+ if (((__SIZE_TYPE__)dp + 1) & ~1ULL)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33667.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33667.c
new file mode 100644
index 000000000..676c4a46d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33667.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned long long int uint64_t;
+struct magic {
+ uint8_t mask_op;
+ union {
+ uint64_t _mask;
+ } _u;
+ union VALUETYPE {
+ uint16_t h;
+ } value;
+};
+void cvt_16(union VALUETYPE *p, const struct magic *m)
+{
+ if (m->_u._mask)
+ p->h %= (uint16_t) m->_u._mask;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33670.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33670.c
new file mode 100644
index 000000000..5232af965
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33670.c
@@ -0,0 +1,19 @@
+/* PR middle-end/33670 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsched-stalled-insns=0" } */
+
+struct B
+{
+ int p;
+ int n;
+};
+extern struct B ***b;
+extern int a;
+
+int
+foo (int d, int e)
+{
+ int c;
+ for (c = d; c <= e; c++)
+ b[a][c]->n = b[a][c]->p;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33673.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33673.c
new file mode 100644
index 000000000..d238d112c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33673.c
@@ -0,0 +1,43 @@
+/* PR rtl-optimization/33673 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fno-forward-propagate -fno-guess-branch-probability -fno-move-loop-invariants -fno-tree-dominator-opts -fno-tree-loop-optimize" } */
+
+extern int f1 (int);
+extern int f2 (int);
+
+extern int *a;
+
+static void
+find_reg (int n)
+{
+ int i, pass;
+ unsigned int used[2], used1[2];
+
+ int c = n ? f1 (a[1]) : f2 (a[1]);
+
+ for (i = 64, pass = 0; pass <= 1 && i >= 64; pass++)
+ {
+ if (pass == 1)
+ {
+ unsigned int *scan_tp_ = used;
+ unsigned int *scan_fp_ = used1;
+ int j;
+ for (j = 0; j < 2; j++)
+ *scan_tp_++ = *scan_fp_++;
+ }
+ for (i = 0; i < 64; i++)
+ {
+ int regno = i;
+ if (n == 0)
+ if (i == regno)
+ break;
+ }
+ }
+}
+
+void
+global_alloc ()
+{
+ find_reg (0);
+ find_reg (1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33676.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33676.c
new file mode 100644
index 000000000..79c830eab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33676.c
@@ -0,0 +1,51 @@
+/* { dg-do run } */
+/* { dg-options "-O0 -mtune=i386 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+__attribute__((noreturn,noinline)) void abrt (const char *fi, const char *fu)
+{
+ __builtin_abort ();
+}
+
+__attribute__((noinline)) int f (int k)
+{
+ return k;
+}
+
+__attribute__((noinline)) int g (int t, int k)
+{
+ int b;
+
+ switch (t)
+ {
+ case 0:
+ abrt (__FILE__, __FUNCTION__);
+
+ case 1:
+ b = f (k);
+ break;
+
+ case 2:
+ b = f (k);
+ break;
+
+ case 3:
+ b = f (k);
+ break;
+
+ case 4:
+ b = f (k);
+ break;
+
+ default:
+ abrt (__FILE__, __FUNCTION__);
+ }
+
+ return b;
+}
+
+int main (void)
+{
+ if (g (3, 1337) != 1337)
+ abrt (__FILE__, __FUNCTION__);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33691.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33691.c
new file mode 100644
index 000000000..93213610d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33691.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+/* ICEd with type-checking enabled. */
+
+unsigned int mgaSetTexImages(int i)
+{
+ return ((i | 0x40) & 0xffffffc0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33692.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33692.c
new file mode 100644
index 000000000..08ee332dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33692.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+/* We ICEd with type-checking enabled. */
+
+typedef struct { int i; } snd_pcm_info_t;
+typedef struct { snd_pcm_info_t info; } snd_pcm_shm_ctrl_t;
+void snd_pcm_info(snd_pcm_info_t *);
+int pcm_shm_cmd(volatile snd_pcm_shm_ctrl_t *ctrl)
+{
+ snd_pcm_info((snd_pcm_info_t *) &ctrl->info);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33693.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33693.c
new file mode 100644
index 000000000..147c164c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33693.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+/* This used to ICE with type-checking enabled. */
+
+unsigned long modify_field (unsigned long mask, long fieldval)
+{
+ return (~fieldval & ~mask);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33694.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33694.c
new file mode 100644
index 000000000..fa62b9eae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33694.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-ansi" } */
+
+/* This used to ICE with type-checking enabled. */
+
+__SIZE_TYPE__ cnfs_mapcntl(long pagesize)
+{
+ return ~(__SIZE_TYPE__)(pagesize - 1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33695.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33695.c
new file mode 100644
index 000000000..2d3ffbd66
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33695.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+/* We used to ICE with type-checking enabled. */
+
+unsigned int bfstages(int M, float *Utbl, int Ustride)
+{
+ return ((unsigned int) 1 << M) * Ustride;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33696.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33696.c
new file mode 100644
index 000000000..97bbfe8bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33696.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+/* This used to ICE with type-checking enabled. */
+
+typedef unsigned char uint8_t;
+typedef unsigned int uint_least32_t;
+extern int foo (long int __off);
+void write (uint_least32_t chunk_len)
+{
+ uint8_t tmp[4];
+ foo (-(long)chunk_len - sizeof(tmp));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33697.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33697.c
new file mode 100644
index 000000000..8c5edb658
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33697.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+/* We used to ICE for this with type-checking enabled. */
+
+typedef signed short gint16;
+typedef unsigned short guint16;
+gint16 dissect_old_pflog(gint16 rnr)
+{
+ return (guint16) ((guint16) ((guint16)rnr >> 8) | (guint16) ((guint16)rnr << 8));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33724.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33724.c
new file mode 100644
index 000000000..7e8eb5ddd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33724.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+/* We ICEd with type-checking enabled. */
+
+struct xt_entry_target {
+ char name[1];
+};
+struct ipt_entry {
+ unsigned char elems[1];
+};
+void match_different(const unsigned char *);
+int dump_entry(struct xt_entry_target *t)
+{
+ return __builtin_strcmp (t->name, "");
+}
+void is_same(const struct ipt_entry *a)
+{
+ match_different(a->elems);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33726.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33726.c
new file mode 100644
index 000000000..e87cbc565
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33726.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+/* We used to ICE here with type-checking enabled. */
+
+typedef unsigned int U032;
+typedef volatile struct X {
+ U032 Monochrome[1];
+ struct {
+ U032 WidthHeight;
+ } UnclippedRectangle[1];
+} RivaBitmap;
+void writel(void *);
+void rivafb_fillrect(RivaBitmap *bm)
+{
+ writel((void *)&bm->UnclippedRectangle[0].WidthHeight);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33742.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33742.c
new file mode 100644
index 000000000..b905d9dda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33742.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+typedef unsigned short ush;
+extern ush prev[];
+
+void fill_window ()
+{
+ register unsigned n, m;
+
+ for (n = 0; n < 32768; n++)
+ {
+ m = prev[n];
+ prev[n] = (ush) (m >= 0x8000 ? m - 0x8000 : 0);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33826.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33826.c
new file mode 100644
index 000000000..c091bbcdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33826.c
@@ -0,0 +1,48 @@
+/* Regression test for PR middle-end/33826 */
+/* Verify that recursive functions cannot be pure or const. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-options "-O1 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const" } */
+
+int recurese1 (int i)
+{
+ return recurse1 (i+1);
+}
+
+int recurse2a (int i)
+{
+ return recurse2b (i+1);
+}
+
+int recurse2b (int i)
+{
+ return recurse2a (i+1);
+}
+
+int norecurse1a (int i)
+{
+ return norecurse1b (i+1);
+}
+
+int norecurse1b (int i)
+{
+ return i+1;
+}
+
+/* { dg-final { scan-tree-dump "found to be const: norecurse1a" "local-pure-const1" } } */
+/* { dg-final { scan-tree-dump "found to be const: norecurse1b" "local-pure-const1" } } */
+/* { dg-final { scan-tree-dump-not "found to be pure: recurse1" "local-pure-const1" } } */
+/* { dg-final { scan-tree-dump-not "found to be pure: recurse2a" "local-pure-const1" } } */
+/* { dg-final { scan-tree-dump-not "found to be pure: recurse2b" "local-pure-const1" } } */
+/* { dg-final { scan-tree-dump-not "found to be const: recurse1" "local-pure-const1" } } */
+/* { dg-final { scan-tree-dump-not "found to be const: recurse2a" "local-pure-const1" } } */
+/* { dg-final { scan-tree-dump-not "found to be const: recurse2b" "local-pure-const1" } } */
+/* { dg-final { scan-ipa-dump-not "found to be pure: recurse1" "pure-const" } } */
+/* { dg-final { scan-ipa-dump-not "found to be pure: recurse2a" "pure-const" } } */
+/* { dg-final { scan-ipa-dump-not "found to be pure: recurse2b" "pure-const" } } */
+/* { dg-final { scan-ipa-dump-not "found to be const: recurse1" "pure-const" } } */
+/* { dg-final { scan-ipa-dump-not "found to be const: recurse2a" "pure-const" } } */
+/* { dg-final { scan-ipa-dump-not "found to be const: recurse2b" "pure-const" } } */
+/* { dg-final { cleanup-ipa-dump "pure-const" } } */
+/* { dg-final { cleanup-tree-dump "local-pure-const1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-0.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-0.h
new file mode 100644
index 000000000..21966c6ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-0.h
@@ -0,0 +1 @@
+char *pre_inc_base_file = __BASE_FILE__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-1.h
new file mode 100644
index 000000000..c7345aa58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-1.h
@@ -0,0 +1,2 @@
+#include "pr33919-2.h"
+char *inc_base_file = __BASE_FILE__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-2.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-2.h
new file mode 100644
index 000000000..3c2225762
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33919-2.h
@@ -0,0 +1 @@
+char *nested_inc_base_file = __BASE_FILE__;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33919.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33919.c
new file mode 100644
index 000000000..14ea3746c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33919.c
@@ -0,0 +1,26 @@
+/* PR preprocessor/pr33919 */
+/* { dg-do run } */
+/* { dg-options "-I . -include ${srcdir}/gcc.dg/pr33919-0.h" } */
+
+#include "pr33919-1.h"
+
+const char *base_file = __BASE_FILE__;
+
+extern int strcmp (const char *, const char *);
+extern void abort (void);
+
+int
+main ()
+{
+ if (!strcmp (pre_inc_base_file, "<command line>"))
+ abort ();
+ if (strcmp (pre_inc_base_file, __FILE__))
+ abort ();
+ if (strcmp (base_file, __FILE__))
+ abort ();
+ if (strcmp (inc_base_file, __FILE__))
+ abort ();
+ if (strcmp (nested_inc_base_file, __FILE__))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33923.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33923.c
new file mode 100644
index 000000000..d71e5578a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33923.c
@@ -0,0 +1,76 @@
+/* PR target/33923 */
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 --param max-partial-antic-length=0" } */
+
+static int pendingCommand;
+static int currentModifiers;
+typedef struct
+{
+ int (*updateKeys) (int *keyPressed);
+}
+ProtocolOperations;
+static const ProtocolOperations *protocol;
+brl_readCommand (void)
+{
+ unsigned long int keys;
+ int command;
+ int keyPressed;
+ unsigned char routingKeys[200];
+ int routingKeyCount;
+ signed char rightVerticalSensor;
+ if (pendingCommand != (-1))
+ {
+ return command;
+ }
+ if (!protocol->updateKeys (&keyPressed))
+ {
+ if (rightVerticalSensor >= 0)
+ keys |= 1;
+ if ((routingKeyCount == 0) && keys)
+ {
+ if (currentModifiers)
+ {
+ doChord:switch (keys);
+ }
+ else
+ {
+ doCharacter:
+ command = 0X2200;
+ if (keys & 0X01UL)
+ command |= 0001;
+ if (keys & 0X02UL)
+ command |= 0002;
+ if (keys & 0X04UL)
+ command |= 0004;
+ if (keys & 0X08UL)
+ command |= 0010;
+ if (keys & 0X10UL)
+ command |= 0020;
+ if (keys & 0X20UL)
+ command |= 0040;
+ if (currentModifiers & (0X0010 | 0X0200))
+ command |= 0100;
+ if (currentModifiers & 0X0040)
+ command |= 0200;
+ if (currentModifiers & 0X0100)
+ command |= 0X020000;
+ if (currentModifiers & 0X0400)
+ command |= 0X080000;
+ if (currentModifiers & 0X0800)
+ command |= 0X040000;
+ }
+ unsigned char key1 = routingKeys[0];
+ if (key1 == 0)
+ {
+ } else if (key1 == 1)
+ if (keys)
+ {
+ currentModifiers |= 0X0010;
+ goto doCharacter;
+ }
+ }
+ }
+ return command;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr33961.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr33961.c
new file mode 100644
index 000000000..43403ed30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr33961.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/33961 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-cselim" } */
+
+void decode(char *d, int len);
+
+void decode(char *d, int len) {
+ int i = len - 1;
+ while(i >= 0) {
+ d[i];
+ if(d[i] == 0)
+ d[i]=' ';
+ if(d[i] == 1)
+ d[i]='x';
+ i--;
+ }
+}
+
+int main(int argc, char **argv)
+{
+ decode("this bug is really weird", 24);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34003-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34003-1.c
new file mode 100644
index 000000000..ff97fe6d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34003-1.c
@@ -0,0 +1,8 @@
+/* PR bootstrap/34003 */
+/* { dg-do link } */
+/* { dg-options "-O0" } */
+/* { dg-additional-sources "pr34003-2.c" } */
+
+extern void foo (void);
+int bar (void) { foo (); return 1; }
+extern void foo (void);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34003-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34003-2.c
new file mode 100644
index 000000000..a5330567f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34003-2.c
@@ -0,0 +1,20 @@
+/* PR bootstrap/34003 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+extern void abort (void);
+
+int seen = 0;
+
+void foo (void)
+{
+ ++seen;
+}
+
+int main (void)
+{
+ extern int bar (void);
+ if (bar () != 1 || seen != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34027-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34027-1.c
new file mode 100644
index 000000000..8e8872a51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34027-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-optimized" } */
+
+unsigned long foobar(unsigned long ns)
+{
+ while(ns >= 10000L)
+ ns -= 10000L;
+ return ns;
+}
+
+/* This test was originally introduced to test that we transform
+ to ns % 10000. See the discussion of PR 32044 why we do not do
+ that anymore. */
+/* { dg-final { scan-tree-dump-times "%" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "/" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34027-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34027-2.c
new file mode 100644
index 000000000..70c4561d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34027-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+long foo(long n, long m)
+{
+ return n - (n / m) * m;
+}
+
+/* { dg-final { scan-tree-dump "n % m" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34088.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34088.c
new file mode 100644
index 000000000..88a635d2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34088.c
@@ -0,0 +1,24 @@
+/* PR middle-end/34088 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wall -Werror" } */
+
+int F0 (int);
+int F1 (int t) { return F0(t); }
+int F2 (int t) { return F0(t); }
+
+extern int X[];
+static inline int foo(int i)
+{
+ return X[i];
+}
+
+int bar(int* p)
+{
+ int i;
+
+ while ( ({ if (foo(*p) && foo(*p)); p; }) );
+
+ return i; /* { dg-error "is used uninitialized" } */
+}
+
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34171.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34171.c
new file mode 100644
index 000000000..6013a0de6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34171.c
@@ -0,0 +1,27 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+extern char coredump;
+extern void sigemptyset (char *);
+struct sigaction
+{
+ char sa_mask;
+};
+void doSignalsSetup (void)
+{
+ static const int signals[] = {
+ 1, 2, 3, 4, 6, 8, 11, 13, 14, 15, 30 , 31
+ };
+ unsigned int i, sig;
+ struct sigaction sa;
+ for (i = 0; i < sizeof (signals) / sizeof (int); i++)
+ {
+ sig = signals[i];
+ if (coredump &&
+ (sig == 4 || sig == 8 || sig == 11 || sig == 10))
+ continue;
+ sigemptyset (&sa.sa_mask);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34225.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34225.c
new file mode 100644
index 000000000..659e176ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34225.c
@@ -0,0 +1,61 @@
+/* PR target/34225 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fstack-protector" } */
+/* { dg-require-effective-target fstack_protector } */
+
+typedef __SIZE_TYPE__ size_t;
+extern int sscanf (const char *, const char *, ...);
+struct C
+{
+ char c[240];
+};
+struct O
+{
+ char **o;
+};
+struct P
+{
+ int p1;
+ char p2[256];
+ char p3[256];
+ char p4[256];
+};
+
+extern void *s;
+extern int f1 (char *, struct C *);
+extern void f2 (void *, const char *);
+extern void f3 (char *, const char *);
+extern int f4 (int, double *, int);
+
+int
+foo (char *a[], struct O *b, int c, int d, struct P *e, int f, int *h,
+ char *l)
+{
+ int i, g = 7, m = 0, n;
+ struct C j[150];
+ double *k[150];
+ char o[100];
+
+ if (f1 (o, &j[g]) < 0)
+ g++;
+
+ while (!m)
+ {
+ f2 (s, "xxx");
+ for (i = 0; i < f; i++)
+ if ((!b->o && __builtin_strncmp (l, "abcde", 5) == 0)
+ || (b->o && !b->o[c]))
+ {
+ *e[d].p4 = *e[d].p3 = *e[d].p2 = 0;
+ sscanf (l, "%s %s %[^\n]", e[d].p3, e[d].p2, e[d].p4);
+ }
+ for (n = 0; n < d; n++)
+ for (i = 0; i < g; i++)
+ {
+ f3 (a[i + 1], "foo");
+ if (f4 (h[i], k[i], e[n].p1) < 0)
+ f3 (a[i + 1], "bar");
+ }
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34233.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34233.c
new file mode 100644
index 000000000..1982efaa6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34233.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math" } */
+
+double foo(void)
+{
+ return __builtin_pow (0.0, -1.5);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34263.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34263.c
new file mode 100644
index 000000000..d389eade8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34263.c
@@ -0,0 +1,59 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* Same test as 990128-1.c. */
+
+extern int printf (const char *,...);
+extern void abort (void);
+
+struct s { struct s *n; } *p;
+struct s ss;
+#define MAX 10
+struct s sss[MAX];
+int count = 0;
+
+void sub( struct s *p, struct s **pp );
+int look( struct s *p, struct s **pp );
+
+main()
+{
+ struct s *pp;
+ struct s *next;
+ int i;
+
+ p = &ss;
+ next = p;
+ for ( i = 0; i < MAX; i++ ) {
+ next->n = &sss[i];
+ next = next->n;
+ }
+ next->n = 0;
+
+ sub( p, &pp );
+ if (count != MAX+2)
+ abort ();
+
+ return( 0 );
+}
+
+void sub( struct s *p, struct s **pp )
+{
+ for ( ; look( p, pp ); ) {
+ if ( p )
+ p = p->n;
+ else
+ break;
+ }
+}
+
+int look( struct s *p, struct s **pp )
+{
+ for ( ; p; p = p->n )
+ ;
+ *pp = p;
+ count++;
+ return( 1 );
+}
+
+/* { dg-final { scan-tree-dump "Cleaned-up latch block of loop with single BB" "optimized" { xfail { *-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34351.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34351.c
new file mode 100644
index 000000000..f40717082
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34351.c
@@ -0,0 +1,4 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-Wall" } */
+
+register int * volatile x asm ("ebx"); /* { dg-warning "optimization may eliminate reads and/or writes to register variables" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34457-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34457-1.c
new file mode 100644
index 000000000..3dca13df0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34457-1.c
@@ -0,0 +1,25 @@
+/* PR c/34457 */
+/* { dg-do link } */
+/* { dg-require-effective-target trampolines } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -O2" } */
+/* { dg-additional-sources "pr34457-2.c" } */
+
+
+typedef __SIZE_TYPE__ size_t;
+extern int printf (const char *, ...);
+extern void *memset (void *, int, size_t);
+
+int bar (int (*p)(), int q, void *r) {}
+
+int
+main(int argc, char **argv)
+{
+ struct s { int a; char b[argc]; };
+ int nested (struct s x) { return x.a + sizeof(x); }
+ struct s t;
+ memset (&t, 0, sizeof(t));
+ t.a = 123;
+ printf("%d\n", bar (nested, argc, &t));
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34457-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34457-2.c
new file mode 100644
index 000000000..8e251d3ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34457-2.c
@@ -0,0 +1,3 @@
+/* Additional file for PR c/34457. */
+
+int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34668-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34668-1.c
new file mode 100644
index 000000000..7e242c294
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34668-1.c
@@ -0,0 +1,22 @@
+/* PR c/34668 */
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -O2" } */
+/* { dg-additional-sources "pr34668-2.c" } */
+
+struct optab { unsigned code; };
+struct optab optab_table[1];
+
+void
+init_optab (struct optab *op)
+{
+ op->code = 0xdead;
+}
+
+void
+set_conv_libfunc (void)
+{
+ init_optab (&optab_table[0]);
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34668-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34668-2.c
new file mode 100644
index 000000000..fab8f173f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34668-2.c
@@ -0,0 +1,5 @@
+/* PR c/34668 */
+/* { dg-do compile } */
+
+struct optab { unsigned code; };
+extern struct optab optab_table[1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34825.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34825.c
new file mode 100644
index 000000000..40061bad6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34825.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O -funsafe-math-optimizations" } */
+
+double foo(double x, double y)
+{
+ return x == y ? x/y*x/y : 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34856.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34856.c
new file mode 100644
index 000000000..62041e248
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34856.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-O2 -maltivec" { target { powerpc*-*-linux* && powerpc_altivec_ok } } } */
+
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+#undef __vector
+#define __vector __attribute__ ((__vector_size__ (16)))
+
+typedef __vector signed char qword;
+typedef __vector uintptr_t VU;
+
+extern short g[192 + 16];
+
+void f (qword);
+
+void f1 (unsigned ctr)
+{
+ VU pin;
+
+ pin = (VU){(uintptr_t) &g[16]};
+ do
+ {
+ f ((qword) pin);
+ ctr--;
+ }
+ while (ctr);
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*GCC vector passed by reference.*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34965.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34965.c
new file mode 100644
index 000000000..381e46fae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34965.c
@@ -0,0 +1,13 @@
+/* PR c++/34965 */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int foo (int);
+
+void
+bar (int i, int j, double k)
+{
+ foo (i && j) (); /* { dg-error "\\(i != 0 \\&\\& j != 0\\)" } */
+ foo (!i || !j) (); /* { dg-error "\\(i == 0 \\|\\| j == 0\\)" } */
+ foo (!i == !j) (); /* { dg-error "\\(i != 0 \\^ j == 0\\)" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34969.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34969.c
new file mode 100644
index 000000000..02f7dd1aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34969.c
@@ -0,0 +1,15 @@
+/* PR middle-end/34969 */
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-cp -ffast-math" } */
+
+double
+foo (double x)
+{
+ return x * x;
+}
+
+double
+bar (void)
+{
+ return foo (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr34985.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr34985.c
new file mode 100644
index 000000000..56437509d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr34985.c
@@ -0,0 +1,9 @@
+/* PR34985: Warning "defined but not used" despite __attribute__((__used__)) */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Wextra -O2" } */
+static void xxyyzz (void);
+static void __attribute__((__used__)) xxyyzz(void)
+{
+}
+
+/* { dg-final { scan-assembler "xxyyzz" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35045.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35045.c
new file mode 100644
index 000000000..bcd01d751
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35045.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! nonpic } } } { "*" } { "" } } */
+/* { dg-options "-O2 -fgcse-after-reload" } */
+
+extern void abort (void);
+
+__attribute__((noinline)) __complex__ float
+give_neg1 (void)
+{
+ __complex__ float res;
+ __real__ res = -1.0;
+ __imag__ res = 1.0;
+ return res;
+}
+
+__attribute__((noinline)) __complex__ float
+mycacoshf (__complex__ float x)
+{
+ __complex__ float res;
+ res = give_neg1 ();
+
+ /* We have to use the positive branch. */
+ if (__real__ res < 0.0)
+ {
+ unsigned a,b,c,d,e,f;
+ res = -res;
+ asm __volatile__ ("" : "=r" (a), "=r" (b), "=r" (c), "=r" (d), "=r" (e), "=r" (f));
+ }
+ return res;
+}
+
+int main()
+{
+ __complex__ float res = mycacoshf(1.0);
+ if (__imag__ res >= 0.0)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35065.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35065.c
new file mode 100644
index 000000000..e5984ab0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35065.c
@@ -0,0 +1,228 @@
+/* PR debug/35065 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -funroll-loops" } */
+typedef int vlc_bool_t;
+typedef __SIZE_TYPE__ size_t;
+typedef struct vlc_object_t vlc_object_t;
+typedef long long int64_t;
+#if(__SIZEOF_INT__ >= 4)
+typedef unsigned int uint32_t;
+#else
+typedef unsigned long uint32_t;
+#endif
+typedef unsigned char uint8_t;
+typedef int64_t mtime_t;
+typedef uint32_t vlc_fourcc_t;
+typedef struct module_t module_t;
+typedef struct es_format_t es_format_t;
+typedef struct decoder_t decoder_t;
+typedef struct decoder_sys_t decoder_sys_t;
+typedef struct block_t block_t;
+extern void* malloc (size_t);
+enum vlc_module_properties {
+ VLC_MODULE_CB_OPEN, VLC_MODULE_CB_CLOSE, VLC_MODULE_NAME, };
+struct es_format_t {
+ vlc_fourcc_t i_codec;
+ int i_extra;
+ void *p_extra;
+};
+struct block_t {
+ block_t *p_next;
+ uint32_t i_flags;
+ mtime_t i_pts;
+ mtime_t i_dts;
+ size_t i_buffer;
+ uint8_t *p_buffer;
+};
+block_t* block_New(void*, size_t);
+block_t *nal_get_annexeb(decoder_t *, uint8_t *, int);
+block_t *block_ChainGather (block_t *);
+static inline block_t *block_Duplicate( block_t *p_block ) {
+ block_t *p_dup = block_New( ((void *)0), p_block->i_buffer );
+ p_dup->i_dts = p_block->i_dts;
+ p_dup->i_pts = p_block->i_pts;
+}
+static inline void block_ChainAppend( block_t **pp_list, block_t *p_block ) {
+ if( *pp_list == ((void *)0) ) {
+ }
+ else {
+ block_t *p = *pp_list;
+ while( p->p_next ) p = p->p_next;
+ p->p_next = p_block;
+ }
+}
+struct decoder_t {
+ decoder_sys_t * p_sys;
+ es_format_t fmt_in;
+};
+typedef struct bs_s {
+ uint8_t *p;
+ uint8_t *p_end;
+ int i_left;
+} bs_t;
+static inline uint32_t bs_read( bs_t *s, int i_count ) {
+ static uint32_t i_mask[33] = {
+ 0x00, 0x1fffffff,0x3fffffff,0x7fffffff,0xffffffff};
+ int i_shr;
+ uint32_t i_result = 0;
+ while( i_count > 0 ) {
+ if( s->p >= s->p_end ) {
+ break;
+ }
+ if( ( i_shr = s->i_left - i_count ) >= 0 ) {
+ i_result |= ( *s->p >> i_shr )&i_mask[i_count];
+ s->i_left -= i_count;
+ {
+ s->i_left = 8;
+ }
+ return( i_result );
+ }
+ {
+ i_result |= (*s->p&i_mask[s->i_left]) << -i_shr;
+ i_count -= s->i_left;
+ s->p++;
+ }
+ }
+}
+static inline uint32_t bs_read1( bs_t *s ) {
+ if( s->p < s->p_end ) {
+ unsigned int i_result;
+ s->i_left--;
+ i_result = ( *s->p >> s->i_left )&0x01;
+ if( s->i_left == 0 ) {
+ s->p++;
+ }
+ return i_result;
+ }
+ return 0;
+}
+int Open ( vlc_object_t * );
+void Close( vlc_object_t * );
+__attribute__((visibility("default"))) int vlc_entry__0_9_0f ( module_t *p_module ) {
+ {
+ module_t *p_submodule = p_module;
+ if (vlc_module_set (p_submodule, VLC_MODULE_CB_OPEN, (void *)(Open)) || vlc_module_set (p_submodule, VLC_MODULE_CB_CLOSE, (void *)(Close))) goto error;
+ }
+ error:
+ return -666;
+}
+typedef struct {
+ int i_nal_type;
+ int i_nal_ref_idc;
+ int i_frame_type;
+ int i_frame_num;
+ int i_bottom_field_flag;
+ int i_idr_pic_id;
+ int i_delta_pic_order_cnt0;
+} slice_t;
+struct decoder_sys_t {
+ vlc_bool_t b_slice;
+ block_t *p_frame;
+ vlc_bool_t b_sps;
+ vlc_bool_t b_pps;
+ vlc_bool_t b_header;
+ block_t *p_sps;
+ block_t *p_pps;
+ int i_pic_order_cnt_type;
+ slice_t slice;
+};
+enum { NAL_SLICE = 1, NAL_SLICE_IDR = 5, NAL_SPS = 7, NAL_AU_DELIMITER= 9 };
+static block_t *ParseNALBlock( decoder_t *, block_t * );
+int Open( vlc_object_t *p_this ) {
+ decoder_t *p_dec = (decoder_t*)p_this;
+ decoder_sys_t *p_sys;
+ if( p_dec->fmt_in.i_codec != ( ((uint32_t)'h') | ( ((uint32_t)'2') << 8 ) | ( ((uint32_t)'6') << 16 ) | ( ((uint32_t)'4') << 24 ) ) && ( p_dec->fmt_in.i_codec != ( ((uint32_t)'a') | ( ((uint32_t)'v') << 8 ) | ( ((uint32_t)'c') << 16 ) | ( ((uint32_t)'1') << 24 ) ) || p_dec->fmt_in.i_extra < 7 ) ) {
+ return -666;
+ }
+ if( ( p_dec->p_sys = p_sys = malloc( sizeof(decoder_sys_t) ) ) == ((void *)0) ) {
+ uint8_t *p = &((uint8_t*)p_dec->fmt_in.p_extra)[4];
+ int i_sps, i_pps;
+ int i;
+ i_sps = (*p++)&0x1f;
+ for( i = 0;
+ i < i_sps;
+ i++ ) {
+ int i_length = U16_AT( p );
+ block_t *p_sps = nal_get_annexeb( p_dec, p + 2, i_length );
+ ParseNALBlock( p_dec, p_sps );
+ }
+ }
+}
+static inline int bs_read_ue( bs_t *s ) {
+ int i = 0;
+ while( bs_read1( s ) == 0 && s->p < s->p_end && i < 32 ) {
+ i++;
+ }
+ return( ( 1 << i) - 1 + bs_read( s, i ) );
+}
+static inline int bs_read_se( bs_t *s ) {
+ int val = bs_read_ue( s );
+}
+block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag )
+{
+ decoder_sys_t *p_sys = p_dec->p_sys;
+ block_t *p_pic = ((void *)0);
+ const int i_nal_type = p_frag->p_buffer[4]&0x1f;
+ if( ( !p_sys->b_sps || !p_sys->b_pps ) && i_nal_type >= NAL_SLICE && i_nal_type <= NAL_SLICE_IDR ) {
+ }
+ else if( i_nal_type >= NAL_SLICE && i_nal_type <= NAL_SLICE_IDR ) {
+ int i_dec = 0, i_first_mb, i_slice_type;
+ slice_t slice;
+ bs_t s;
+ i_first_mb = bs_read_ue( &s );
+ switch( (i_slice_type = bs_read_ue( &s )) ) {
+ }
+ if( p_sys->i_pic_order_cnt_type == 0 ) {
+ slice.i_delta_pic_order_cnt0 = bs_read_se( &s );
+ }
+ if( slice.i_frame_num != p_sys->slice.i_frame_num
+ || slice.i_nal_ref_idc != p_sys->slice.i_nal_ref_idc )
+ if( (slice.i_bottom_field_flag != -1)
+ && (slice.i_bottom_field_flag != p_sys->slice.i_bottom_field_flag) )
+ if( p_sys->i_pic_order_cnt_type == 0 && ( slice.i_nal_type != p_sys->slice.i_nal_type || slice.i_idr_pic_id != p_sys->slice.i_idr_pic_id ) )
+ do {
+ if( !p_sys->b_header && p_sys->slice.i_frame_type != 0x0002)
+ break;
+ if( p_sys->slice.i_frame_type == 0x0002 && p_sys->p_sps && p_sys->p_pps ) {
+ block_t *p_sps = block_Duplicate( p_sys->p_sps );
+ block_t *p_pps = block_Duplicate( p_sys->p_pps );
+ p_sps->i_pts = p_sys->p_frame->i_pts;
+ block_ChainAppend( &p_sps, p_pps );
+ block_ChainAppend( &p_sps, p_sys->p_frame );
+ p_sys->b_header = 1;
+ p_pic = block_ChainGather( p_sps );
+ }
+ } while(0);
+ }
+ else if( i_nal_type == NAL_SPS ) {
+ bs_t s;
+ if( p_sys->i_pic_order_cnt_type == 0 ) {
+ }
+ else if( p_sys->i_pic_order_cnt_type == 1 ) {
+ int i_cycle;
+ i_cycle = bs_read_ue( &s );
+ while( i_cycle > 0 ) {
+ bs_read_se(&s );
+ }
+ }
+ bs_read_ue( &s );
+ if( p_sys->b_slice )
+ do {
+ if( !p_sys->b_header && p_sys->slice.i_frame_type != 0x0002)
+ break;
+ if( p_sys->slice.i_frame_type == 0x0002
+ && p_sys->p_sps && p_sys->p_pps )
+ {
+ block_t *p_sps = block_Duplicate( p_sys->p_sps );
+ block_t *p_pps = block_Duplicate( p_sys->p_pps );
+ p_sps->i_dts = p_sys->p_frame->i_dts;
+ p_sps->i_pts = p_sys->p_frame->i_pts;
+ block_ChainAppend( &p_sps, p_pps );
+ block_ChainAppend( &p_sps, p_sys->p_frame );
+ p_pic = block_ChainGather( p_sps );
+ }
+ p_pic->i_flags |= p_sys->slice.i_frame_type;
+ } while(0);
+ }
+ block_ChainAppend( &p_sys->p_frame, p_frag );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35258.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35258.c
new file mode 100644
index 000000000..d1c45a79d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35258.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+extern void abort(void);
+
+char str[9] = "1234";
+
+void
+bar (void)
+{
+ unsigned int temp;
+ char *p = &str[2];
+
+ memcpy (&temp, &str[1], 4);
+ memcpy (p, &temp, 4);
+ str[1] = '.';
+}
+
+int main()
+{
+ bar();
+ if (memcmp (str, "1.234", 5) != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35264.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35264.c
new file mode 100644
index 000000000..a332efc42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35264.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+extern void abort(void);
+long long __attribute__((noinline)) get(void)
+{
+ return -2;
+}
+long long __attribute__((noinline)) get(void);
+int __attribute__((noinline)) check(void)
+{
+ long long lcn;
+
+ lcn = get();
+ if (lcn >= 0 || lcn == -1)
+ return 0;
+
+ return -1;
+}
+int main()
+{
+ if (check() == 0)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35334.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35334.c
new file mode 100644
index 000000000..d4c642e34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35334.c
@@ -0,0 +1,22 @@
+/* PR c++/35334 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
+
+__complex__ unsigned int i;
+int j;
+char k;
+__complex__ double l;
+double m;
+float n;
+
+void
+foo ()
+{
+ ((__complex__ int)i)(); /* { dg-error "is not a function" } */
+ ((__complex__ int)j)(); /* { dg-error "is not a function" } */
+ ((__complex__ int)k)(); /* { dg-error "is not a function" } */
+ ((__complex__ long double)l)(); /* { dg-error "is not a function" } */
+ ((__complex__ long double)m)(); /* { dg-error "is not a function" } */
+ ((__complex__ long double)n)(); /* { dg-error "is not a function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35430.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35430.c
new file mode 100644
index 000000000..ab5e4cac8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35430.c
@@ -0,0 +1,10 @@
+/* PR c/35430 */
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+void
+foo (__complex__ int i)
+{
+ i == 0u;
+ i == ~1u; /* { dg-warning "comparison between signed and unsigned integer expressions" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35440.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35440.c
new file mode 100644
index 000000000..796d7e0a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35440.c
@@ -0,0 +1,12 @@
+/* PR c/35440 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+struct A {};
+struct B { int i; char j[2]; };
+
+void foo (void)
+{
+ (struct A){}(); /* { dg-error "called object" } */
+ (struct B){ .i = 2, .j[1] = 1 }(); /* { dg-error "called object" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35442.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35442.c
new file mode 100644
index 000000000..6534ba404
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35442.c
@@ -0,0 +1,15 @@
+/* PR c/35442 */
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
+/* { dg-options "-mabi=altivec" { target { { powerpc*-*-linux* } && ilp32 } } } */
+
+typedef char A __attribute__ ((vector_size (64)));
+typedef int B __attribute__ ((vector_size (64)));
+
+void
+foo (A a)
+{
+ ((B) a) (); /* { dg-error "is not a function" } */
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output "(.*GCC vector passed by reference.*|.*ABI for * passing parameters with.*)" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35443.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35443.c
new file mode 100644
index 000000000..5dfc299e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35443.c
@@ -0,0 +1,9 @@
+/* PR c/35443 */
+/* { dg-options "" } */
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
+
+void
+foo ()
+{
+ ({ int i; i; })(); /* { dg-error "is not a function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35445.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35445.c
new file mode 100644
index 000000000..cef309f41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35445.c
@@ -0,0 +1,6 @@
+/* PR c/35445 */
+/* { dg-do "compile" } */
+
+extern int i;
+extern int i; /* { dg-message "was here" } */
+int i[] = { 0 }; /* { dg-error "conflicting types" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35468.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35468.c
new file mode 100644
index 000000000..085c07307
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35468.c
@@ -0,0 +1,10 @@
+/* PR tree-optimization/35468 */
+/* { dg-do compile }*/
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+char *const f(void)
+{
+ char *const line = "/dev/ptyXX";
+ line[8] = 1;
+ return line;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35616.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35616.c
new file mode 100644
index 000000000..ad2c9e99e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35616.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+typedef void (*listener_fun)(
+ int a,
+ int b,
+ int c);
+
+struct data_t
+{
+ int a;
+
+ listener_fun listener;
+
+ int b;
+ int c;
+ int d;
+};
+
+extern void abort(void);
+void function_calling_listener (struct data_t data);
+
+void function_calling_listener (struct data_t data)
+{
+ data.listener(data.a, data.c, data.d);
+}
+
+void my_listener(int a, int b, int c)
+{
+ if (a != 42 || b != 44 || c != 45)
+ abort ();
+}
+
+int main()
+{
+ struct data_t d;
+ d.a = 42;
+ d.b = 43;
+ d.c = 44;
+ d.d = 45;
+ d.listener = my_listener;
+ function_calling_listener (d);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35635.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35635.c
new file mode 100644
index 000000000..86612d528
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35635.c
@@ -0,0 +1,90 @@
+/* PR 35635 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Wsign-conversion" } */
+
+struct unsigned_bit {
+ unsigned int x:1;
+} unsigned_bit;
+struct signed_bit {
+ int x:1;
+} signed_bit;
+int bar;
+int bar2;
+
+void func1()
+{
+ /* The result of boolean operators fits in unsiged int:1, thus do
+ not warn. */
+ unsigned_bit.x = (bar != 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar == 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar <= 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar >= 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar < 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar > 0); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = !bar; /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar || bar2); /* { dg-bogus "conversion" } */
+ unsigned_bit.x = (bar && bar2); /* { dg-bogus "conversion" } */
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ unsigned_bit.x = bar != 0 ? 1 : 0; /* { dg-bogus "conversion" } */
+ unsigned_bit.x = bar != 0 ? 1.0 : 0.0; /* { dg-bogus "conversion" } */
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ unsigned_bit.x = bar != 0 ? 2 : 0; /* { dg-warning "conversion" } */
+ unsigned_bit.x = bar != 0 ? 0 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+}
+
+void func2()
+{
+ signed char schar_x;
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ schar_x = bar != 0 ? 1 : 0; /* { dg-bogus "conversion" } */
+ schar_x = bar != 0 ? 2.0 : 10; /* { dg-bogus "conversion" } */
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ schar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
+ schar_x = bar != 0 ? (signed char) 1024: -1024; /* { dg-warning "conversion" } */
+}
+
+
+
+void func3()
+{
+ unsigned char uchar_x;
+
+ /* Both branches of ? fit in the destination, thus do not warn. */
+ uchar_x = bar != 0 ? 1 : 0;
+ uchar_x = bar != 0 ? 2.0 : 10;
+
+ /* At least one branch of ? does not fit in the destination, thus
+ warn. */
+ uchar_x = bar != 0 ? 2.1 : 10; /* { dg-warning "conversion" } */
+ uchar_x = bar != 0 /* { dg-warning "negative integer implicitly converted to unsigned type" } */
+ ? (unsigned char) 1024
+ : -1;
+}
+
+void func4()
+{
+ signed_bit.x = -1; /* { dg-bogus "conversion" } */
+ signed_bit.x = bar != 0 ? -1.0 : 0.0; /* { dg-bogus "conversion" } */
+ signed_bit.x = bar != 0 ? -1 : 0; /* { dg-bogus "conversion" } */
+
+
+ signed_bit.x = 1; /* { dg-warning "conversion" } */
+ signed_bit.x = (bar != 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar == 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar <= 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar >= 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar < 0); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar > 0); /* { dg-warning "conversion" } */
+ signed_bit.x = !bar; /* { dg-warning "conversion" } */
+ signed_bit.x = (bar || bar2); /* { dg-warning "conversion" } */
+ signed_bit.x = (bar && bar2); /* { dg-warning "conversion" } */
+ signed_bit.x = bar != 0 ? 1 : 0; /* { dg-warning "conversion" } */
+ signed_bit.x = bar != 0 ? 2 : 0; /* { dg-warning "conversion" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35701.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35701.c
new file mode 100644
index 000000000..414443097
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35701.c
@@ -0,0 +1,31 @@
+/* PR 35701 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Wsign-conversion" } */
+/* { dg-require-effective-target int32plus } */
+
+typedef struct _my_struct_t {
+ unsigned int small:1;
+ unsigned int big:31;
+} my_struct_t, *my_struct_p_t;
+
+void
+my_func1(unsigned int sm, unsigned int bi, my_struct_p_t msp)
+{
+ msp->small = sm; /* { dg-warning "conversion" } */
+ msp->big = bi; /* { dg-warning "conversion" } */
+}
+
+void
+my_func2(unsigned int sm, unsigned int bi, my_struct_p_t msp)
+{
+ msp->small = sm & 1U;
+ msp->big = bi & 0x7fffffffU;
+}
+
+unsigned short
+my_func3(unsigned int sm)
+{
+ unsigned short res;
+ res = sm & 0xff20U;
+ return res;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35729.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35729.c
new file mode 100644
index 000000000..a9cf2e105
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35729.c
@@ -0,0 +1,18 @@
+/* Target is restricted to x86 type architectures, so that we may
+ assume something about memory addressing modes. */
+
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && nonpic } } } */
+/* { dg-options "-Os -fdump-rtl-loop2_invariant" } */
+
+const volatile int g_361 = 3L;
+volatile int g_2 = 0L;
+void func_1 (void)
+{
+ for (g_2 = 0; g_2 > 10; g_2++)
+ {
+ int l_357 = g_361;
+ }
+}
+
+/* { dg-final { scan-rtl-dump-times "Decided to move invariant" 0 "loop2_invariant" } } */
+/* { dg-final { cleanup-rtl-dump "loop2_invariant" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35736.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35736.c
new file mode 100644
index 000000000..f411bb8a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35736.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+void foo()
+{
+ while (1)
+ for (;;({ continue; }))
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35742.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35742.c
new file mode 100644
index 000000000..609472792
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35742.c
@@ -0,0 +1,13 @@
+/* PR c/35742 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
+
+void
+foo ()
+{
+ for (;;)
+ ({break;})(); /* { dg-error "is not a function" } */
+ for (;;)
+ ({continue;})(); /* { dg-error "is not a function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35746.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35746.c
new file mode 100644
index 000000000..274f4a968
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35746.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+int foo(int i);
+
+void bar()
+{
+ __complex__ int i;
+ X j; /* { dg-error "unknown" } */
+ if (i = foo(j))
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr35899.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr35899.c
new file mode 100644
index 000000000..fca3a3d86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr35899.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/35899 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ int a = bar ();
+ return a;
+}
+
+void
+bar (void) /* { dg-warning "conflicting types for" } */
+{
+}
+
+/* { dg-message "note: previous implicit declaration" "" { target *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36015.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36015.c
new file mode 100644
index 000000000..fc3153559
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36015.c
@@ -0,0 +1,22 @@
+/* PR target/36015 */
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+/* { dg-options "-O0 -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+static int test ();
+
+int
+main (void)
+{
+ test (0, 1, 2, 3, 4, 5, 6, 7);
+ return 0;
+}
+
+static int
+test (int a, int b, int c, int d, int e, int f, int g, int h)
+{
+ if (a != 0 || b != 1 || c != 2 || d != 3
+ || e != 4 || f != 5 || g != 6 || h != 7)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36017.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36017.c
new file mode 100644
index 000000000..2af71e600
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36017.c
@@ -0,0 +1,29 @@
+/* PR rtl-optimization/36017 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern double sqrt (double);
+extern void abort (void);
+
+__attribute__((noinline)) double
+foo (double a)
+{
+ double b, c, d = 0.7;
+ if (a <= d)
+ b = sqrt (d * a);
+ else
+ {
+ c = (1.0 - d) * (1.0 - a);
+ b = c > 0 ? 1.0 - sqrt (c) : 1.0;
+ }
+ return b;
+}
+
+int
+main (void)
+{
+ double c = foo (0.5);
+ if (c > 0.5917)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36111.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36111.c
new file mode 100644
index 000000000..498c39e1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36111.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic" } */
+
+typedef struct {
+ int lock;
+ int pad0_;
+} mutex_t;
+
+static mutex_t main_arena;
+
+void __malloc_check_init()
+{
+ for(;;)
+ __asm__ __volatile__ ("": "+m"(main_arena.lock) );
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36194.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36194.c
new file mode 100644
index 000000000..070a944e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36194.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort (void);
+
+__attribute__ ((noinline)) void
+f (int i)
+{
+#if(__SIZEOF_INT__ >= 4)
+ if (i != 0x87654321)
+#else
+ if (i != 0x4321)
+#endif
+ abort ();
+ asm ("");
+}
+
+__attribute__ ((noinline)) void
+g (long long a)
+{
+ f (a);
+ asm ("");
+}
+
+main ()
+{
+ g (0x1234567887654321ll);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36224.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36224.c
new file mode 100644
index 000000000..6e23559d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36224.c
@@ -0,0 +1,249 @@
+/* { dg-do run } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+#ifndef ALIGN16
+#define ALIGN16 __attribute__((__aligned__(32)))
+#endif
+
+#define I16_B0 1
+#define I16_B1 23
+#define I16_B2 345
+#define I16_B3 6789
+#define I16_B4 1011
+#define I16_B5 -12
+#define I16_B6 1314
+#define I16_B7 -1516
+#define I16_B8 -1516
+#define I16_B9 1314
+#define I16_B10 -12
+#define I16_B11 1011
+#define I16_B12 6789
+#define I16_B13 345
+#define I16_B14 23
+#define I16_B15 1
+
+#define I16_C0 2
+#define I16_C1 31567
+#define I16_C2 1112
+#define I16_C3 13
+#define I16_C4 14
+#define I16_C5 15
+#define I16_C6 -16
+#define I16_C7 17
+#define I16_C8 2
+#define I16_C9 31567
+#define I16_C10 1112
+#define I16_C11 13
+#define I16_C12 14
+#define I16_C13 15
+#define I16_C14 -16
+#define I16_C15 17
+
+union ui2 {
+ int si[16];
+ unsigned int ui[16];
+};
+
+union us {
+ short ss[16];
+ unsigned short us[16];
+};
+
+static union ui2 i32_sa ALIGN16;
+static union ui2 i32_ua ALIGN16;
+
+static union us i16_b ALIGN16 = {
+ (short)I16_B0,
+ (short)I16_B1,
+ (short)I16_B2,
+ (short)I16_B3,
+ (short)I16_B4,
+ (short)I16_B5,
+ (short)I16_B6,
+ (short)I16_B7,
+ (short)I16_B8,
+ (short)I16_B9,
+ (short)I16_B10,
+ (short)I16_B11,
+ (short)I16_B12,
+ (short)I16_B13,
+ (short)I16_B14,
+ (short)I16_B15,
+};
+
+static union us i16_c ALIGN16 = {
+ (short)I16_C0,
+ (short)I16_C1,
+ (short)I16_C2,
+ (short)I16_C3,
+ (short)I16_C4,
+ (short)I16_C5,
+ (short)I16_C6,
+ (short)I16_C7,
+ (short)I16_C8,
+ (short)I16_C9,
+ (short)I16_C10,
+ (short)I16_C11,
+ (short)I16_C12,
+ (short)I16_C13,
+ (short)I16_C14,
+ (short)I16_C15,
+};
+
+static long i32_sr[16] ALIGN16 = {
+ ((int)I16_B0) * ((int)I16_C0),
+ ((int)I16_B1) * ((int)I16_C1),
+ ((int)I16_B2) * ((int)I16_C2),
+ ((int)I16_B3) * ((int)I16_C3),
+ ((int)I16_B4) * ((int)I16_C4),
+ ((int)I16_B5) * ((int)I16_C5),
+ ((int)I16_B6) * ((int)I16_C6),
+ ((int)I16_B7) * ((int)I16_C7),
+ ((int)I16_B8) * ((int)I16_C8),
+ ((int)I16_B9) * ((int)I16_C9),
+ ((int)I16_B10) * ((int)I16_C10),
+ ((int)I16_B11) * ((int)I16_C11),
+ ((int)I16_B12) * ((int)I16_C12),
+ ((int)I16_B13) * ((int)I16_C13),
+ ((int)I16_B14) * ((int)I16_C14),
+ ((int)I16_B15) * ((int)I16_C15),
+};
+
+static unsigned long i32_ur[16] ALIGN16 = {
+ ((unsigned int)(unsigned short)I16_B0) * ((unsigned int)(unsigned short)I16_C0),
+ ((unsigned int)(unsigned short)I16_B1) * ((unsigned int)(unsigned short)I16_C1),
+ ((unsigned int)(unsigned short)I16_B2) * ((unsigned int)(unsigned short)I16_C2),
+ ((unsigned int)(unsigned short)I16_B3) * ((unsigned int)(unsigned short)I16_C3),
+ ((unsigned int)(unsigned short)I16_B4) * ((unsigned int)(unsigned short)I16_C4),
+ ((unsigned int)(unsigned short)I16_B5) * ((unsigned int)(unsigned short)I16_C5),
+ ((unsigned int)(unsigned short)I16_B6) * ((unsigned int)(unsigned short)I16_C6),
+ ((unsigned int)(unsigned short)I16_B7) * ((unsigned int)(unsigned short)I16_C7),
+ ((unsigned int)(unsigned short)I16_B8) * ((unsigned int)(unsigned short)I16_C8),
+ ((unsigned int)(unsigned short)I16_B9) * ((unsigned int)(unsigned short)I16_C9),
+ ((unsigned int)(unsigned short)I16_B10) * ((unsigned int)(unsigned short)I16_C10),
+ ((unsigned int)(unsigned short)I16_B11) * ((unsigned int)(unsigned short)I16_C11),
+ ((unsigned int)(unsigned short)I16_B12) * ((unsigned int)(unsigned short)I16_C12),
+ ((unsigned int)(unsigned short)I16_B13) * ((unsigned int)(unsigned short)I16_C13),
+ ((unsigned int)(unsigned short)I16_B14) * ((unsigned int)(unsigned short)I16_C14),
+ ((unsigned int)(unsigned short)I16_B15) * ((unsigned int)(unsigned short)I16_C15),
+};
+
+#ifndef ALIGN32
+#define ALIGN32 __attribute__((__aligned__(32)))
+#endif
+
+#define I32_B0 1
+#define I32_B1 23
+#define I32_B2 345
+#define I32_B3 6789
+#define I32_B4 101112
+#define I32_B5 -13
+#define I32_B6 141516
+#define I32_B7 -1718
+
+#define I32_C0 2
+#define I32_C1 45678910
+#define I32_C2 1112
+#define I32_C3 13
+#define I32_C4 14
+#define I32_C5 15
+#define I32_C6 -16
+#define I32_C7 17
+
+union ul {
+ long sl[8];
+ unsigned long ul[8];
+};
+
+union ui {
+ int si[8];
+ unsigned int ui[8];
+};
+
+static union ul i64_sa ALIGN32;
+static union ul i64_ua ALIGN32;
+
+static union ui i32_b ALIGN32 = {
+ (int)I32_B0,
+ (int)I32_B1,
+ (int)I32_B2,
+ (int)I32_B3,
+ (int)I32_B4,
+ (int)I32_B5,
+ (int)I32_B6,
+ (int)I32_B7,
+};
+
+static union ui i32_c ALIGN32 = {
+ (int)I32_C0,
+ (int)I32_C1,
+ (int)I32_C2,
+ (int)I32_C3,
+ (int)I32_C4,
+ (int)I32_C5,
+ (int)I32_C6,
+ (int)I32_C7,
+};
+
+static long i64_sr[8] ALIGN32 = {
+ ((long)I32_B0) * ((long)I32_C0),
+ ((long)I32_B1) * ((long)I32_C1),
+ ((long)I32_B2) * ((long)I32_C2),
+ ((long)I32_B3) * ((long)I32_C3),
+ ((long)I32_B4) * ((long)I32_C4),
+ ((long)I32_B5) * ((long)I32_C5),
+ ((long)I32_B6) * ((long)I32_C6),
+ ((long)I32_B7) * ((long)I32_C7),
+};
+
+static unsigned long i64_ur[8] ALIGN32 = {
+ ((unsigned long)(unsigned)I32_B0) * ((unsigned long)(unsigned)I32_C0),
+ ((unsigned long)(unsigned)I32_B1) * ((unsigned long)(unsigned)I32_C1),
+ ((unsigned long)(unsigned)I32_B2) * ((unsigned long)(unsigned)I32_C2),
+ ((unsigned long)(unsigned)I32_B3) * ((unsigned long)(unsigned)I32_C3),
+ ((unsigned long)(unsigned)I32_B4) * ((unsigned long)(unsigned)I32_C4),
+ ((unsigned long)(unsigned)I32_B5) * ((unsigned long)(unsigned)I32_C5),
+ ((unsigned long)(unsigned)I32_B6) * ((unsigned long)(unsigned)I32_C6),
+ ((unsigned long)(unsigned)I32_B7) * ((unsigned long)(unsigned)I32_C7),
+};
+
+
+int main ()
+{
+ int i;
+
+ /* Signed 16x16 -> 32-bit tests */
+ for (i = 0; i < 16; i++)
+ i32_sa.si[i] = ((long)i16_b.ss[i]) * ((long)i16_c.ss[i]);
+
+ for (i = 0; i < 16; i++)
+ if (i32_sa.si[i] != i32_sr[i])
+ __builtin_abort ();
+
+ /* Unsigned 16x16 -> 32-bit tests */
+ for (i = 0; i < 16; i++)
+ i32_ua.ui[i] = ((long)i16_b.us[i]) * ((long)i16_c.us[i]);
+
+ for (i = 0; i < 16; i++)
+ if (i32_ua.ui[i] != i32_ur[i])
+ __builtin_abort ();
+
+ /* Signed 32x32 -> 64-bit tests */
+ for (i = 0; i < 8; i++)
+ i64_sa.sl[i] = ((long)i32_b.si[i]) * ((long)i32_c.si[i]);
+
+ for (i = 0; i < 8; i++)
+ if (i64_sa.sl[i] != i64_sr[i])
+ __builtin_abort ();
+
+ /* Unsigned 32x32 -> 64-bit tests */
+ for (i = 0; i < 8; i++)
+ i64_ua.ul[i] = ((long)i32_b.ui[i]) * ((long)i32_c.ui[i]);
+
+ for (i = 0; i < 8; i++)
+ if (i64_ua.ul[i] != i64_ur[i])
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36227.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36227.c
new file mode 100644
index 000000000..27fe00155
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36227.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-overflow=3" } */
+#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
+typedef unsigned long long ptrcast;
+#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
+typedef unsigned long ptrcast;
+#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
+typedef unsigned int ptrcast;
+#else
+#error Add target support here
+#endif
+
+volatile unsigned long *
+sat_add(volatile unsigned long *ptr, unsigned long i, volatile unsigned long *end)
+{
+ if ((ptrcast)ptr + i * sizeof(*ptr) > (ptrcast)ptr) /* { dg-bogus "pointer wraparound" } */
+ return ptr + i;
+ else
+ return end;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36300-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36300-1.c
new file mode 100644
index 000000000..e737ab7ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36300-1.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fwrapv" } */
+
+extern void abort (void);
+
+#define VALUE ((int)((long long)U1 * (long long)3) + 2)
+
+int main(void)
+{
+ long long Y, Y2;
+#if(__SIZEOF_INT__ >= 4)
+ int U1;
+#else
+ long U1;
+#endif
+ int t;
+ U1 = -2147483647-1;
+
+ Y = ((long long)(VALUE * VALUE) * 3);
+
+ t = VALUE;
+ Y2 = ((long long)(t * t) * 3);
+
+ if (Y != Y2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36300-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36300-2.c
new file mode 100644
index 000000000..954333268
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36300-2.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+#define VALUE (unsigned int)((int)((long long)U1 * (long long)3) + 2)
+
+int main(void)
+{
+ long long Y, Y2;
+#if(__SIZEOF_INT__ >= 4)
+ int U1;
+#else
+ long U1;
+#endif
+ unsigned int t;
+
+ U1 = -2147483647-1;
+
+ Y = ((long long)(int)(VALUE * VALUE) * 3);
+
+ t = VALUE;
+ Y2 = ((long long)(int)(t * t) * 3);
+
+ if (Y != Y2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36489.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36489.c
new file mode 100644
index 000000000..5cf221615
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36489.c
@@ -0,0 +1,22 @@
+/* PR c/36489 */
+/* { dg-do compile } */
+/* { dg-options "-Woverride-init" } */
+
+struct A { int a; int b[3]; };
+union B { int a; int b[3]; };
+int t1[10][10]
+ = { [1][2] = 11, [1][3] = 12 };
+int t2[10][10]
+ = { [1][2] = 11, [1] = { [3] = 12 } }; /* { dg-warning "initializ" } */
+int t3[10][10]
+ = { [1][2] = 11, [1][2] = 12 }; /* { dg-warning "initializ" } */
+struct A t4[2]
+ = { [0].b[0] = 1, [0].b[1] = 2, [0].b[2] = 3 };
+struct A t5[2]
+ = { [0].b[0] = 1, [0].b[1] = 2, [0].b = { 3 } }; /* { dg-warning "initializ" } */
+union B t6
+ = { .b[0] = 1, .b[1] = 2, .b[2] = 3 };
+union B t7
+ = { .b[0] = 1, .b[1] = 2, .b = { 2 } }; /* { dg-warning "initializ" } */
+union B t8
+ = { .b[0] = 1, .b[1] = 2, .b[1] = 3 }; /* { dg-warning "initializ" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36504.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36504.c
new file mode 100644
index 000000000..dbcf76648
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36504.c
@@ -0,0 +1,25 @@
+/* PR tree-optimization/36504 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fprefetch-loop-arrays -w" } */
+
+struct A { struct { int a; } b[8]; };
+struct B { int c; int d; };
+struct C { struct B d; };
+
+void bar (struct C *, int);
+
+struct B
+foo (struct C *p, struct A *e, int b)
+{
+ struct B q;
+ bar (p, e->b[b].a);
+ return q;
+}
+
+void
+baz (int b, struct A *e)
+{
+ struct C p;
+ for (; b; ++b)
+ p.d = foo (&p, e, b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36508.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36508.c
new file mode 100644
index 000000000..304899236
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36508.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/36508 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-pre" } */
+
+void
+foo (short *sp)
+{
+ int k;
+ k = 1;
+#define SP0 *sp++ = 1;
+ while (1)
+ {
+ if (k > 6)
+ break;
+ SP0
+ k++;
+ }
+ k = 1;
+ while (1)
+ {
+ if (k > 6)
+ break;
+ SP0
+ k++;
+ }
+#define SP1 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0 SP0
+#define SP2 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1 SP1
+ SP2
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36584.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36584.c
new file mode 100644
index 000000000..1b6e38ca4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36584.c
@@ -0,0 +1,267 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -lm" } */
+/* { dg-options "-O2 -msse2 -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target sse2_runtime { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern double fabs (double);
+extern void abort (void);
+
+const int MAX_ITERATIONS = 50;
+const double SMALL_ENOUGH = 1.0e-10;
+const double RELERROR = 1.0e-12;
+
+typedef struct p
+{
+ int ord;
+ double coef[7];
+}
+polynomial;
+
+static double
+polyeval (double x, int n, double *Coeffs)
+{
+ register int i;
+ double val;
+
+ val = Coeffs[n];
+ for (i = n - 1; i >= 0; i--)
+ val = val * x + Coeffs[i];
+
+ return (val);
+}
+
+static int
+regula_falsa (int order, double *coef, double a, double b, double *val)
+{
+ int its;
+ double fa, fb, x, fx, lfx;
+
+ fa = polyeval (a, order, coef);
+ fb = polyeval (b, order, coef);
+
+ if (fa * fb > 0.0)
+ return 0;
+
+ if (fabs (fa) < SMALL_ENOUGH)
+ {
+ *val = a;
+ return 1;
+ }
+
+ if (fabs (fb) < SMALL_ENOUGH)
+ {
+ *val = b;
+ return 1;
+ }
+
+ lfx = fa;
+
+ for (its = 0; its < MAX_ITERATIONS; its++)
+ {
+ x = (fb * a - fa * b) / (fb - fa);
+ fx = polyeval (x, order, coef);
+ if (fabs (x) > RELERROR)
+ {
+ if (fabs (fx / x) < RELERROR)
+ {
+ *val = x;
+ return 1;
+ }
+ }
+ else
+ {
+ if (fabs (fx) < RELERROR)
+ {
+ *val = x;
+ return 1;
+ }
+ }
+
+ if (fa < 0)
+ {
+ if (fx < 0)
+ {
+ a = x;
+ fa = fx;
+ if ((lfx * fx) > 0)
+ fb /= 2;
+ }
+ else
+ {
+ b = x;
+ fb = fx;
+ if ((lfx * fx) > 0)
+ fa /= 2;
+ }
+ }
+ else
+ {
+ if (fx < 0)
+ {
+ b = x;
+ fb = fx;
+ if ((lfx * fx) > 0)
+ fa /= 2;
+ }
+ else
+ {
+ a = x;
+ fa = fx;
+ if ((lfx * fx) > 0)
+ fb /= 2;
+ }
+ }
+
+ if (fabs (b - a) < RELERROR)
+ {
+ *val = x;
+ return 1;
+ }
+
+ lfx = fx;
+ }
+
+ return 0;
+}
+
+static int
+numchanges (int np, polynomial * sseq, double a)
+{
+ int changes;
+ double f, lf;
+ polynomial *s;
+ changes = 0;
+
+ lf = polyeval (a, sseq[0].ord, sseq[0].coef);
+
+ for (s = sseq + 1; s <= sseq + np; s++)
+ {
+ f = polyeval (a, s->ord, s->coef);
+ if (lf == 0.0 || lf * f < 0)
+ changes++;
+
+ lf = f;
+ }
+
+ return changes;
+}
+
+int
+sbisect (int np, polynomial * sseq, double min_value, double max_value,
+ int atmin, int atmax, double *roots)
+{
+ double mid;
+ int n1, n2, its, atmid;
+
+ if ((atmin - atmax) == 1)
+ {
+ if (regula_falsa (sseq->ord, sseq->coef, min_value, max_value, roots))
+ return 1;
+ else
+ {
+ for (its = 0; its < MAX_ITERATIONS; its++)
+ {
+ mid = (min_value + max_value) / 2;
+ atmid = numchanges (np, sseq, mid);
+ if ((atmid < atmax) || (atmid > atmin))
+ return 0;
+
+ if (fabs (mid) > RELERROR)
+ {
+ if (fabs ((max_value - min_value) / mid) < RELERROR)
+ {
+ roots[0] = mid;
+ return 1;
+ }
+ }
+ else
+ {
+ if (fabs (max_value - min_value) < RELERROR)
+ {
+ roots[0] = mid;
+ return 1;
+ }
+ }
+
+ if ((atmin - atmid) == 0)
+ min_value = mid;
+ else
+ max_value = mid;
+ }
+
+ roots[0] = mid;
+ return 1;
+ }
+ }
+
+ for (its = 0; its < MAX_ITERATIONS; its++)
+ {
+ mid = (min_value + max_value) / 2;
+ atmid = numchanges (np, sseq, mid);
+ if ((atmid < atmax) || (atmid > atmin))
+ return 0;
+
+ if (fabs (mid) > RELERROR)
+ {
+ if (fabs ((max_value - min_value) / mid) < RELERROR)
+ {
+ roots[0] = mid;
+ return 1;
+ }
+ }
+ else
+ {
+ if (fabs (max_value - min_value) < RELERROR)
+ {
+ roots[0] = mid;
+ return 1;
+ }
+ }
+
+ n1 = atmin - atmid;
+ n2 = atmid - atmax;
+
+ if ((n1 != 0) && (n2 != 0))
+ {
+ n1 = sbisect (np, sseq, min_value, mid, atmin, atmid, roots);
+ n2 = sbisect (np, sseq, mid, max_value, atmid, atmax, &roots[n1]);
+
+ return (n1 + n2);
+ }
+
+ if (n1 == 0)
+ min_value = mid;
+ else
+ max_value = mid;
+ }
+
+ roots[0] = mid;
+ return 1;
+}
+
+int
+main ()
+{
+ polynomial sseq[7] = {
+ {6, {0.15735259075109281, -5.1185263411378736, 1.8516070705868664,
+ 7.348009172322695, -2.2152395279161343, -2.7543325329350692, 1.0}},
+ {5, {-0.8530877235229789, 0.61720235686228875, 3.6740045861613475,
+ -1.4768263519440896, -2.2952771107792245, 1.0}},
+ {4, {0.13072124257049417, 2.2220687798791126, -1.6299431586726509,
+ -1.6718404582408546, 1.0}},
+ {3, {0.86776597575462633, -2.1051099695282511, -0.49008580100694688,
+ 1.0}},
+ {2, {-11.117984175064155, 10.89886635045883, 1.0}},
+ {1, {0.94453099602191237, -1.0}},
+ {0, {-0.068471716890574186}}
+ };
+
+ double roots[7];
+ int nroots;
+
+ nroots = sbisect (6, sseq, 0.0, 10000000.0, 5, 1, roots);
+ if (nroots != 4)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36774-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36774-1.c
new file mode 100644
index 000000000..10a5e5fb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36774-1.c
@@ -0,0 +1,9 @@
+/* Nested functions shouldn't produce warnings if defined before first use.
+ Bug 36774. Test with -Wmissing-prototypes. */
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-prototypes" } */
+
+int foo(int a) { /* { dg-warning "no previous prototype" } */
+ int bar(int b) { return b; } /* { dg-bogus "no previous prototype" } */
+ return bar(a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36774-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36774-2.c
new file mode 100644
index 000000000..bf394c9ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36774-2.c
@@ -0,0 +1,9 @@
+/* Nested functions shouldn't produce warnings if defined before first use.
+ Bug 36774. Test with -Wmissing-declarations. */
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-declarations" } */
+
+int foo(int a) { /* { dg-warning "no previous declaration" } */
+ int bar(int b) { return b; } /* { dg-bogus "no previous declaration" } */
+ return bar(a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-1.c
new file mode 100644
index 000000000..63438307e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+#include "pr36901-system.h"
+void foo(void)
+{
+ int s = sc;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-2.c
new file mode 100644
index 000000000..cee367d77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -w" } */
+#include "pr36901.h"
+void foo(void)
+{
+ int s = sc;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-3.c
new file mode 100644
index 000000000..1f3574214
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+#include "pr36901.h"
+void foo(void)
+{
+ int s = sc;
+}
+/* { dg-message "file included" "In file included" { target *-*-* } 0 } */
+/* { dg-error "ordered comparison of pointer with integer zero" "pedantic error" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-4.c
new file mode 100644
index 000000000..f1d261657
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-4.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -Wsystem-headers" } */
+#include "pr36901-system.h"
+void foo(void)
+{
+ int s = sc;
+}
+/* { dg-message "from " "In file included" { target *-*-* } 0 } */
+/* { dg-error "ordered comparison of pointer with integer zero" "pedantic error" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-system.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-system.h
new file mode 100644
index 000000000..6cc1e803d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901-system.h
@@ -0,0 +1,3 @@
+#pragma GCC system_header
+#include "pr36901.h"
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36901.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901.h
new file mode 100644
index 000000000..6022732aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36901.h
@@ -0,0 +1,6 @@
+#if defined(AVR) /* flag_delete_null_pointer_checks = 0 */
+int sc = (&sc >= 0);
+#else
+int sc = (&sc > 0);
+#endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36902.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36902.c
new file mode 100644
index 000000000..a065124ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36902.c
@@ -0,0 +1,61 @@
+/* PR middle-end/36902 Array bound warning with dead code after optimization */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Warray-bounds -Wall -Wextra" } */
+typedef unsigned char __u8;
+typedef unsigned short __u16;
+
+static inline unsigned char *
+foo(unsigned char * to, const unsigned char * from, int n)
+{
+ switch ( n )
+ {
+ case 3:
+ *to = *from;
+ break;
+ case 5:
+ to[4] = from [4];
+ break;
+ }
+ return to;
+}
+
+struct {
+ int size_of_select;
+ unsigned char pcr_select[4];
+} sel;
+
+int bar(void)
+{
+ static unsigned char buf[64];
+
+ sel.size_of_select = 3;
+ foo(buf, sel.pcr_select, sel.size_of_select);
+
+ return 1;
+}
+
+
+static inline unsigned char *
+foo2(unsigned char * to, const unsigned char * from, int n)
+{
+ switch ( n )
+ {
+ case 3:
+ *to = *from;
+ break;
+ case 5:
+ to[4] = from [4]; /* { dg-warning "array subscript is above array bounds" "" { xfail *-*-* } } */
+ break;
+ }
+ return to;
+}
+
+int baz(void)
+{
+ static unsigned char buf[64];
+
+ sel.size_of_select = 5;
+ foo2(buf, sel.pcr_select, sel.size_of_select);
+
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36991.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36991.c
new file mode 100644
index 000000000..d090ba105
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36991.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/36991 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef float V __attribute__ ((vector_size (16)));
+typedef union { V v[4][4]; } U;
+
+void
+foo (float x, float y, U *z)
+{
+ z->v[1][0] = z->v[0][1] = (V) { x, y, 0, 0 };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36997.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36997.c
new file mode 100644
index 000000000..13461b8a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36997.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target x86_64-*-* i?86-*-* } } */
+/* { dg-options "-std=c99 -msse2" } */
+
+typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));
+__m64 _mm_add_si64 (__m64 __m1, __m64 __m2)
+{
+ return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2); /* { dg-error "incompatible type" } */
+ /* { dg-message "note: expected '__vector.1. long long int' but argument is of type 'long long int'" "" { target *-*-* } 7 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr36998.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr36998.c
new file mode 100644
index 000000000..bf08ed123
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr36998.c
@@ -0,0 +1,24 @@
+/* PR rtl-optimization/36998 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fasynchronous-unwind-tables" } */
+/* { dg-options "-Os -mpreferred-stack-boundary=2 -fasynchronous-unwind-tables" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-fno-omit-frame-pointer" { target { avr-*-* } } } */
+
+void foo (const char *, ...) __attribute__ ((noreturn));
+int bar (const char *, ...);
+extern __SIZE_TYPE__ strlen (const char *);
+int baz (char *, char *, int, void *);
+
+void
+test (char *w, int x, char *y, char *z)
+{
+ char *p, b[32];
+ for (p = y; *p; p += strlen (p) + 1)
+ {
+ baz (w, p, x, z);
+ foo ("msg1 %s", b);
+ }
+ for (p = y; *p; p += strlen (p) + 1)
+ bar (" %s", p);
+ foo ("msg2 %s", b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37106-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37106-1.c
new file mode 100644
index 000000000..ff73b0b8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37106-1.c
@@ -0,0 +1,27 @@
+/* PR c/37106 */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+/* { dg-options "-O1 -fpic" { target fpic } } */
+
+#define SIZE 256
+float a[SIZE], b[SIZE], c[SIZE];
+
+void opt3 (void) __attribute__((__optimize__(3)));
+
+void
+opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] + c[i];
+}
+
+void
+not_opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] - c[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37106-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37106-2.c
new file mode 100644
index 000000000..81f061afa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37106-2.c
@@ -0,0 +1,27 @@
+/* PR c/37106 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-options "-O3 -fpic" { target fpic } } */
+
+#define SIZE 256
+float a[SIZE], b[SIZE], c[SIZE];
+
+void non_opt3 (void) __attribute__((__optimize__(1)));
+
+void
+not_opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] - c[i];
+}
+
+void
+opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] + c[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37156.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37156.c
new file mode 100644
index 000000000..e86f5950f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37156.c
@@ -0,0 +1,21 @@
+/* PR debug/37156 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+__attribute__ ((warning ("is experimental"))) int bar (int, int *, int *, int);
+
+long long foo (void)
+{
+ int n, m;
+ long long r;
+ bar (0, &n, &m, 0); /* { dg-warning "is experimental" } */
+ r = (long long) n;
+ return r;
+}
+
+void
+baz (int n)
+{
+ int o;
+ o = foo () - n;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37171.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37171.c
new file mode 100644
index 000000000..9be44dfaf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37171.c
@@ -0,0 +1,19 @@
+/* PR c/37171 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+unsigned int f1 (void) __attribute__((const));
+unsigned int f2 (void) __attribute__((__const));
+unsigned int f3 (void) __attribute__((__const__));
+
+unsigned int f4 (void)
+{
+ return f1 () + f1 () + f1 () + f1 ()
+ + f2 () + f2 () + f2 () + f2 ()
+ + f3 () + f3 () + f3 () + f3 ();
+}
+
+/* { dg-final { scan-tree-dump-times "= f1 \\(\\)" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= f2 \\(\\)" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= f3 \\(\\)" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37186.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37186.c
new file mode 100644
index 000000000..bf37757f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37186.c
@@ -0,0 +1,9 @@
+/* PR 37186 */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Werror -Wno-error=pointer-sign" } */
+
+int foo(signed char *); /* { dg-message "note: expected 'signed char \\*' but argument is of type 'unsigned char \\*'" } */
+int bar(unsigned char *p)
+{
+ return foo(p); /* { dg-warning "pointer targets in passing argument 1 of 'foo' differ in signedness" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37217.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37217.c
new file mode 100644
index 000000000..989eda2cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37217.c
@@ -0,0 +1,10 @@
+/* PR 37217 ICE with -Wconversion */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion" } */
+typedef struct Tcl_ResolvedVarInfo {
+ char *re_guts;
+} regex_t;
+void TclReComp(regex_t *re)
+{
+ if (re->re_guts == ((void *)0)) ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37261.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37261.c
new file mode 100644
index 000000000..a05ada148
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37261.c
@@ -0,0 +1,15 @@
+/* PR c/37261 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+unsigned
+foo (int x)
+{
+ unsigned a = ((x & 1) | 2) & 0x80000000; /* { dg-bogus "integer overflow in expression" } */
+ unsigned b = ((x & 2) | 2) & 0x80000000; /* { dg-bogus "integer overflow in expression" } */
+ unsigned c = ((x & 4) | 2) & 0x80000000; /* { dg-bogus "integer overflow in expression" } */
+ return a + b + c;
+}
+
+/* { dg-final { scan-tree-dump "return 0" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37289.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37289.c
new file mode 100644
index 000000000..61513c94e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37289.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+void f(unsigned long x);
+
+void g(long x)
+{
+ f((unsigned long)(-1-x)+1);
+}
+
+/* Make sure we do not lose the conversion. */
+
+/* { dg-final { scan-tree-dump "-\\\(long unsigned int\\\) x" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37303.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37303.c
new file mode 100644
index 000000000..bd9f4a8a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37303.c
@@ -0,0 +1,5 @@
+/* { dg-do compile { target *-*-elf* *-*-gnu* } } */
+/* { dg-options "-std=c99" }
+/* { dg-final { scan-assembler "rdata|rodata" } } */
+
+struct S { const int *x; } s = { (const int[]){1, 2, 3} };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37353.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37353.c
new file mode 100644
index 000000000..07d73d0eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37353.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/37353 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern double exp (double);
+
+#define A exp (arg);
+#define B A A A A A A A A A A
+#define C B B B B B B B B B B
+
+void
+foo (double arg)
+{
+ C
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37360.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37360.c
new file mode 100644
index 000000000..d2ca7f388
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37360.c
@@ -0,0 +1,21 @@
+/* PR rtl-optimization/37360 */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O3 -fPIC" } */
+
+typedef unsigned int UQItype __attribute__ ((mode (QI)));
+typedef unsigned int USItype __attribute__ ((mode (SI)));
+
+extern const UQItype __popcount_tab[256];
+extern int __popcountsi2 (USItype);
+
+int
+__popcountsi2 (USItype x)
+{
+ int i, ret = 0;
+
+ for (i = 0; i < (4 * 8); i += 8)
+ ret += __popcount_tab[(x >> i) & 0xff];
+
+ return ret;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37438.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37438.c
new file mode 100644
index 000000000..7365dc9e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37438.c
@@ -0,0 +1,21 @@
+/* PR target/37438 */
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+/* { dg-options "-Os -march=i486" { target { { i686-*-* x86_64-*-* } && ia32 } } } */
+
+extern int bar (unsigned long long int);
+extern int baz (const char *, unsigned int, unsigned short);
+
+int
+foo (unsigned long long int x)
+{
+ return (x & 0xff) | ((unsigned int) (x >> 12) & ~0xff);
+}
+
+int
+test (const char *v, unsigned int w, unsigned long long int x)
+{
+ unsigned short k;
+ k = ((bar (x) & 0xff) << 8) | (foo (x) & 0xff);
+ return baz (v, w, k);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37529.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37529.c
new file mode 100644
index 000000000..87361d5c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37529.c
@@ -0,0 +1,9 @@
+/* PR c/37529 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+
+void
+foo ()
+{
+ goto *; /* { dg-error "expected expression before" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37544.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37544.c
new file mode 100644
index 000000000..99979cef7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37544.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -msse2 -mtune=core2 -mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse2_runtime { target { i?86-*-* x86_64-*-* } } } */
+
+extern void abort (void);
+
+int main(void)
+{
+ double arr[1000];
+ double a, b;
+
+ int i;
+
+ for (i = 0; i < 1000; i++)
+ arr[i] = 4294967296.0 + (double)i;
+
+ a = arr[0];
+ b = (unsigned int)((unsigned long long int)a % 4294967296ULL);
+
+ if (b >= 4294967296.0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37561.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37561.c
new file mode 100644
index 000000000..3ad826329
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37561.c
@@ -0,0 +1,23 @@
+/* PR c++/37561 */
+/* { dg-do compile } */
+
+__extension__ __INTPTR_TYPE__ p;
+char q;
+
+void
+foo ()
+{
+ ((char *) p)++; /* { dg-error "lvalue" } */
+ ((char *) q)++; /* { dg-error "lvalue" } */
+ ((char *) p)--; /* { dg-error "lvalue" } */
+ ((char *) q)--; /* { dg-error "lvalue" } */
+ ++(char *) p; /* { dg-error "lvalue" } */
+ ++(char *) q; /* { dg-error "lvalue" } */
+ --(char *) p; /* { dg-error "lvalue" } */
+ --(char *) q; /* { dg-error "lvalue" } */
+}
+
+/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 11 } */
+/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 13 } */
+/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 15 } */
+/* { dg-warning "cast to pointer from integer of different size" "" { target *-*-* } 17 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37645.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37645.c
new file mode 100644
index 000000000..ac1e5a9d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37645.c
@@ -0,0 +1,5 @@
+/* PR c/37645 */
+/* { dg-do compile } */
+
+typedef int T __attribute__((__weakref__ ("U"))); /* { dg-warning "attribute ignored" } */
+void foo (int i __attribute__((__weakref__ ("j")))); /* { dg-warning "attribute ignored" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37663.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37663.c
new file mode 100644
index 000000000..cf482cbdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37663.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/37663 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fwrapv" } */
+/* { dg-require-effective-target int32plus } */
+
+extern void bar (void);
+
+void
+foo (int x)
+{
+ x = 1 >= x;
+ int y = -1885403717;
+ x = x + (x != y * y);
+ if (x)
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37772.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37772.c
new file mode 100644
index 000000000..26051c7e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37772.c
@@ -0,0 +1,20 @@
+/* PR c/37772 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+foo ()
+{
+ int i;
+ asm (); /* { dg-error "expected string literal before" } */
+ asm (1); /* { dg-error "expected string literal before" } */
+ asm (int); /* { dg-error "expected string literal before" } */
+ asm (: "=r" (i)); /* { dg-error "expected string literal before" } */
+ asm (1 : "=r" (i)); /* { dg-error "expected string literal before" } */
+ asm (int : "=r" (i)); /* { dg-error "expected string literal before" } */
+ asm (: : "r" (i)); /* { dg-error "expected string literal before" } */
+ asm (1 : : "r" (i)); /* { dg-error "expected string literal before" } */
+ asm (int : : "r" (i)); /* { dg-error "expected string literal before" } */
+ asm (: : : "memory"); /* { dg-error "expected string literal before" } */
+ asm (1 : : : "memory"); /* { dg-error "expected string literal before" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37858.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37858.c
new file mode 100644
index 000000000..f606d4a5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37858.c
@@ -0,0 +1,12 @@
+/* PR middle-end/37858 */
+/* ??? With -dv removed, this test is a bit silly. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-early_local_cleanups" } */
+
+int
+main (void)
+{
+ return 0;
+}
+
+/* { dg-final { cleanup-ipa-dump "early_local_cleanups" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37879.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37879.c
new file mode 100644
index 000000000..5dd252782
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37879.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/37879 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+static inline void bar (int) __attribute__ ((noreturn));
+void baz () __attribute__ ((noreturn));
+
+inline int
+foo (int i)
+{
+ return i;
+}
+
+int i = 23;
+static inline void
+bar (int j)
+{
+ if (j)
+ asm ("");
+} /* { dg-warning "does return" } */
+
+void
+baz ()
+{
+ int j;
+ bar (foo (j = i++));
+ asm ("");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37908.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37908.c
new file mode 100644
index 000000000..32946d1b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37908.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-options "-Wsync-nand" } */
+/* { dg-options "-Wsync-nand -march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-Wsync-nand -mcpu=v9" { target sparc*-*-* } } */
+
+
+extern void abort (void);
+
+int main (void)
+{
+
+ short xLoc;
+ short xIn, xOut, xExpect, i = 1;
+
+ xLoc = xIn = ~ (1 << i);
+ xExpect = ~ (xIn & 0x7F);
+
+ xOut = __sync_nand_and_fetch (&xLoc, 0x7F); /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" } */
+
+ if (xOut != xExpect)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr37985.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr37985.c
new file mode 100644
index 000000000..93e640b4a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr37985.c
@@ -0,0 +1,8 @@
+/* PR c37985 */
+/* { dg-do compile } */
+/* { dg-options " -Wall -Wextra " } */
+unsigned char foo(unsigned char a)
+{
+ a >> 2; /* { dg-warning "no effect" } */
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38140.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38140.c
new file mode 100644
index 000000000..35f601008
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38140.c
@@ -0,0 +1,10 @@
+/* PR middle-end/38140 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing" } */
+
+int foo (void *x)
+{
+ int (*fn) (int);
+ *(void **)&fn = x;
+ return fn (6);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38200.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38200.c
new file mode 100644
index 000000000..d5391bd88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38200.c
@@ -0,0 +1,16 @@
+/* PR middle-end/38200 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing" } */
+
+typedef int (*callptr) (void);
+int foo (void **x);
+void foo2 (callptr *);
+int (*foo_ptr) (void **x) = foo;
+
+void
+bar (void)
+{
+ void *ptr;
+ foo2 ((callptr *) &ptr);
+ *(void **) &foo_ptr = ptr;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-1.c
new file mode 100644
index 000000000..17b969c7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-1.c
@@ -0,0 +1,36 @@
+/* PR rtl-optimization/38245 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static inline int
+f1 (int si1, int si2)
+{
+ return si2 == 0 ? si1 : si1 / si2;
+}
+
+static inline unsigned long long
+f2 (unsigned long long ui1, unsigned long long ui2)
+{
+ return ui1 % ui2;
+}
+
+unsigned char g;
+volatile unsigned int h;
+
+void
+f3 (void)
+{
+ if (!((signed char) f1 (0, f2 (g, 2123)) - 1))
+ h;
+}
+
+int
+main (void)
+{
+ f3 ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "% 2123" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "0 / " "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-2.c
new file mode 100644
index 000000000..299829937
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-2.c
@@ -0,0 +1,110 @@
+/* PR rtl-optimization/38245 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+void
+f1 (unsigned int a)
+{
+ if (a != 28)
+ {
+ if (4 / a == 5)
+ link_error ();
+ }
+}
+
+void
+f2 (unsigned int a)
+{
+ if (4 / a == 5)
+ link_error ();
+}
+
+void
+f3 (unsigned int a)
+{
+ if (4 / (a & 0xff) == 5)
+ link_error ();
+}
+
+void
+f4 (unsigned int a, unsigned int b)
+{
+ if ((b & 3) / ((a & 0xff) + 1) == 5)
+ link_error ();
+}
+
+void
+f5 (int a)
+{
+ if (a != 28)
+ {
+ if (4 / a == 5)
+ link_error ();
+ }
+}
+
+void
+f6 (int a)
+{
+ if (4 / a == 5)
+ link_error ();
+}
+
+void
+f7 (int a)
+{
+ if (4 / (a & 0xff) == 5)
+ link_error ();
+}
+
+void
+f8 (int a, int b)
+{
+ if ((b & 3) / ((a & 0xff) + 1) == 5)
+ link_error ();
+}
+
+void
+f9 (int a, int b)
+{
+ if (b >= 4)
+ if ((a / b) == __INT_MAX__ / 2)
+ link_error ();
+}
+
+void
+f10 (unsigned int a, unsigned int b)
+{
+ if (b >= 16)
+ if ((a / b) == __INT_MAX__ / 4)
+ link_error ();
+}
+
+void
+f11 (int a, int b)
+{
+ if (b <= -32)
+ if ((a / b) == -__INT_MAX__ / 16)
+ link_error ();
+}
+
+void
+f12 (int a, int b)
+{
+ if (a >= -6 && a <= 4)
+ if ((a / b) == -7 || (a / b) == 7)
+ link_error ();
+}
+
+void
+f13 (unsigned int a, unsigned int b)
+{
+ if (a <= 4)
+ if ((a / b) == 5)
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-3.c
new file mode 100644
index 000000000..6ef8372a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-3.c
@@ -0,0 +1,112 @@
+/* PR rtl-optimization/38245 */
+/* { dg-do run } */
+/* { dg-additional-sources "pr38245-4.c" } */
+/* { dg-options "-O2" } */
+
+#include "pr38245-3.h"
+
+extern void abort (void);
+
+struct A { int i, j; union { short s[4]; long long l; }; char pad[512]; } a;
+int globv = 6;
+
+void __attribute__((noinline))
+f1 (void)
+{
+ a.s[2] = b1 (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f2 (void)
+{
+ a.s[2] = b2 (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f3 (void)
+{
+ struct B b = { 30, 31, { 32, 33 } };
+ a.s[2] = b3 (6, 7, 8, 9, 10, 11, 12, b, 14, b, 16, b, 18, 19, 20, 21,
+ 6, b, 8, b, 10, 11, 12, 13, 14, b, 16, b, 18, 19, 20, 21);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f4 (void)
+{
+ struct B b = { 30, 31, { 32, 33 } };
+ a.s[2] = b4 (6, 7, 8, 9, 10, 11, 12, b, 14, b, 16, b, 18, 19, 20, 21,
+ 6, b, 8, b, 10, 11, 12, 13, 14, b, 16, b, 18, 19, 20, 21);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f5 (void)
+{
+ a.s[2] = b5 (6.0, 7, 8, 9, 10, 11, 21.0, 22.0, 23.0);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f6 (void)
+{
+ a.s[2] = b6 (6.0, 7, 8, 9, 10, 11, 21.0, 22.0, 23.0);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f7 (void)
+{
+ a.s[2] = b7 (6, 7);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f8 (void)
+{
+ a.s[2] = b8 (6, 7);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f9 (void)
+{
+ a.s[2] = b9 (6, 7, 8, 9, 10, 11, 12);
+ a.l = 6;
+}
+
+void __attribute__((noinline))
+f10 (void)
+{
+ a.s[2] = b10 (6, 7, 8, 9, 10, 11, 12);
+ a.l = 6;
+}
+
+int
+main (void)
+{
+ char buf[256];
+ int i;
+ for (i = 0; i < (int) sizeof buf; i++)
+ buf[i] = i;
+ asm volatile ("" : : "r" (buf) : "memory");
+ f1 ();
+ f2 ();
+ f3 ();
+ f4 ();
+ f5 ();
+ f6 ();
+ f7 ();
+ f8 ();
+ f9 ();
+ f10 ();
+ asm volatile ("" : : "r" (buf) : "memory");
+ for (i = 0; i < (int) sizeof buf; i++)
+ if (buf[i] != (char) i)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-3.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-3.h
new file mode 100644
index 000000000..b1c2a0f67
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-3.h
@@ -0,0 +1,35 @@
+/* PR rtl-optimization/38245 */
+
+struct B { long a, b; char p[32]; };
+extern int globv;
+
+extern int b1 (long long, long, long, long, long, long, long, long,
+ long long, long, long, long, long, long, long, long,
+ long long, long, long, long, long, long, long, long,
+ long long, long, long, long, long, long, long, long)
+ __attribute__((pure, noinline));
+extern int b2 (long long, long, long, long, long, long, long, long,
+ long long, long, long, long, long, long, long, long,
+ long long, long, long, long, long, long, long, long,
+ long long, long, long, long, long, long, long, long)
+ __attribute__((const, noinline));
+extern int b3 (long long, long, long, long, long, long, long, struct B,
+ long long, struct B, long, struct B, long, long, long, long,
+ long long, struct B, long, struct B, long, long, long, long,
+ long long, struct B, long, struct B, long, long, long, long)
+ __attribute__((pure, noinline));
+extern int b4 (long long, long, long, long, long, long, long, struct B,
+ long long, struct B, long, struct B, long, long, long, long,
+ long long, struct B, long, struct B, long, long, long, long,
+ long long, struct B, long, struct B, long, long, long, long)
+ __attribute__((const, noinline));
+extern int b5 () __attribute__((pure, noinline));
+extern int b6 () __attribute__((const, noinline));
+extern int b7 (int, int)
+ __attribute__((pure, noinline));
+extern int b8 (int, int)
+ __attribute__((const, noinline));
+extern int b9 (int, int, int, int, int, int, int)
+ __attribute__((pure, noinline));
+extern int b10 (int, int, int, int, int, int, int)
+ __attribute__((const, noinline));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-4.c
new file mode 100644
index 000000000..c9b3d2d8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38245-4.c
@@ -0,0 +1,107 @@
+/* PR rtl-optimization/38245 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#include "pr38245-3.h"
+
+int
+b1 (long long a1, long a2, long a3, long a4,
+ long a5, long a6, long a7, long a8,
+ long long a9, long a10, long a11, long a12,
+ long a13, long a14, long a15, long a16,
+ long long a17, long a18, long a19, long a20,
+ long a21, long a22, long a23, long a24,
+ long long a25, long a26, long a27, long a28,
+ long a29, long a30, long a31, long a32)
+{
+ return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10
+ + a11 + a12 + a13 + a14 + a15 + a16 + a17 + a18 + a19 + a20
+ + a21 + a22 + a23 + a24 + a25 + a26 + a27 + a28 + a29 + a30
+ + a31 + a32 + globv;
+}
+
+int
+b2 (long long a1, long a2, long a3, long a4,
+ long a5, long a6, long a7, long a8,
+ long long a9, long a10, long a11, long a12,
+ long a13, long a14, long a15, long a16,
+ long long a17, long a18, long a19, long a20,
+ long a21, long a22, long a23, long a24,
+ long long a25, long a26, long a27, long a28,
+ long a29, long a30, long a31, long a32)
+{
+ return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10
+ + a11 + a12 + a13 + a14 + a15 + a16 + a17 + a18 + a19 + a20
+ + a21 + a22 + a23 + a24 + a25 + a26 + a27 + a28 + a29 + a30
+ + a31 + a32;
+}
+
+int
+b3 (long long a1, long a2, long a3, long a4,
+ long a5, long a6, long a7, struct B a8,
+ long long a9, struct B a10, long a11, struct B a12,
+ long a13, long a14, long a15, long a16,
+ long long a17, struct B a18, long a19, struct B a20,
+ long a21, long a22, long a23, long a24,
+ long long a25, struct B a26, long a27, struct B a28,
+ long a29, long a30, long a31, long a32)
+{
+ return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8.a + a9 + a10.a
+ + a11 + a12.a + a13 + a14 + a15 + a16 + a17 + a18.a + a19 + a20.a
+ + a21 + a22 + a23 + a24 + a25 + a26.a + a27 + a28.a + a29 + a30
+ + a31 + a32 + globv;
+}
+
+int
+b4 (long long a1, long a2, long a3, long a4,
+ long a5, long a6, long a7, struct B a8,
+ long long a9, struct B a10, long a11, struct B a12,
+ long a13, long a14, long a15, long a16,
+ long long a17, struct B a18, long a19, struct B a20,
+ long a21, long a22, long a23, long a24,
+ long long a25, struct B a26, long a27, struct B a28,
+ long a29, long a30, long a31, long a32)
+{
+ return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8.a + a9 + a10.a
+ + a11 + a12.a + a13 + a14 + a15 + a16 + a17 + a18.a + a19 + a20.a
+ + a21 + a22 + a23 + a24 + a25 + a26.a + a27 + a28.a + a29 + a30
+ + a31 + a32;
+}
+
+int
+b5 (double a1, int a2, int a3, int a4, int a5, int a6, double a7,
+ double a8, double a9)
+{
+ return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + globv;
+}
+
+int
+b6 (double a1, int a2, int a3, int a4, int a5, int a6, double a7,
+ double a8, double a9)
+{
+ return a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9;
+}
+
+int
+b7 (int a1, int a2)
+{
+ return a1 + a2 + globv;
+}
+
+int
+b8 (int a1, int a2)
+{
+ return a1 + a2;
+}
+
+int
+b9 (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
+{
+ return a1 + a2 + a3 + a4 + a5 + a6 + a7 + globv;
+}
+
+int
+b10 (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
+{
+ return a1 + a2 + a3 + a4 + a5 + a6 + a7;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38338.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38338.c
new file mode 100644
index 000000000..e8fcc3c45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38338.c
@@ -0,0 +1,18 @@
+/* PR middle-end/38338 */
+/* { dg-options "-O0" } */
+/* { dg-options "-O0 -fPIC" { target fpic } } */
+
+typedef void (*fnp) (void);
+
+static char
+foo (char x)
+{
+ return x;
+}
+
+static void *
+bar (char x)
+{
+ void *args = __builtin_apply_args ();
+ return __builtin_apply ((fnp) foo, args, sizeof (void *));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38364.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38364.c
new file mode 100644
index 000000000..6b22e9d78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38364.c
@@ -0,0 +1,80 @@
+/* PR middle-end/38364 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftrapv" } */
+/* { dg-require-effective-target trapping } */
+
+extern void abort (void);
+
+static inline short
+f1 (short x, short y)
+{
+ if (x > 0)
+ {
+ if (y > 0)
+ {
+ if (x > __SHRT_MAX__ / y)
+ return x;
+ }
+ else if (y < (-__SHRT_MAX__ - 1) / x)
+ return x;
+ }
+ else
+ {
+ if (y > 0)
+ {
+ if (x < (-__SHRT_MAX__ - 1) / y)
+ return x;
+ }
+ else if (x != 0 && y < __SHRT_MAX__ / x)
+ return x;
+ }
+ return x * y;
+}
+
+static inline signed char
+f2 (signed char x, signed char y)
+{
+ if (((x ^ y) & (((x ^ ((x ^ y) & (1 << (__CHAR_BIT__ - 1)))) - y) ^ y)) < 0)
+ return x;
+ return x - y;
+}
+
+unsigned int v;
+
+int
+f3 (int x, unsigned int y)
+{
+ f1 (1, 1);
+ return 1;
+}
+
+int
+f4 (unsigned short x)
+{
+ v = x;
+ return 1;
+}
+
+int
+f5 (int x)
+{
+ if (f2 (x, 1))
+ f1 (1, f4 (1));
+ return x;
+}
+
+int
+f6 (unsigned int x)
+{
+ f4 (x < (1 != f5 (0)));
+ return x;
+}
+
+int
+main (void)
+{
+ f6 (1);
+ if (v != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38615.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38615.c
new file mode 100644
index 000000000..8a818a11f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38615.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+int t;
+extern void abort (void);
+
+int f(int t, const int *a)
+{
+ const int b[] = { 1, 2, 3};
+ if (!t)
+ return f(1, b);
+ return b == a;
+}
+
+int main(void)
+{
+ if (f(0, 0))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38616.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38616.c
new file mode 100644
index 000000000..b4534b508
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38616.c
@@ -0,0 +1,14 @@
+/* PR middle-end/38616 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fstack-protector" } */
+/* { dg-require-effective-target fstack_protector } */
+
+#include <stdio.h>
+
+#define BUFFER "1234567890abcdefghijklmno"
+int main (void)
+{
+ char buffer[1024]="";
+ sprintf (buffer, "%s", BUFFER);
+ return strcmp (buffer, BUFFER);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38645.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38645.c
new file mode 100644
index 000000000..3268f2ac6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38645.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int foo()
+{
+ volatile int a[1];
+ int i, *p = (int*)a;
+
+ a[0] = 1;
+ for (i = 0; i < 1; ++i)
+ if (p[i])
+ return -1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "a.0. ={v} 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38700.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38700.c
new file mode 100644
index 000000000..ebece7f0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38700.c
@@ -0,0 +1,11 @@
+/* PR c/38700 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+int
+foo ()
+{
+ __UINTPTR_TYPE__ s = __builtin_expect ((__UINTPTR_TYPE__)&&L, 0);
+L:
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38902.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38902.c
new file mode 100644
index 000000000..d40652624
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38902.c
@@ -0,0 +1,131 @@
+/* PR target/38902 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fstack-protector" } */
+/* { dg-require-effective-target fstack_protector } */
+
+#ifdef DEBUG
+#include <stdio.h>
+#define debug(format, args...) printf (format , ## args)
+#else
+extern int sprintf (char *, const char *, ...);
+#define debug(format, args...)
+#endif
+
+extern void abort (void);
+
+/*
+
+Copyright (C) 2009 Canonical, Ltd.
+Author: Kees Cook <kees@ubuntu.com>
+License: GPLv3
+
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38616
+https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38902
+
+gcc -O2 -fstack-protector truncate.c -o truncate
+
+ Broken:
+
+ Only the first operation fails, so create a new function for each test.
+ Source must be local (literal or stack)
+
+ __builtin_memmove
+ __builtin_memcpy
+ __builtin_strcpy (optimized to __builtin_memcpy?)
+ sprintf (direct) (optmized to __builtin_strcpy?)
+ sprintf (via %s) (optmized to __builtin_strcpy?)
+
+ OK:
+ __builtin_strcat
+ sprintf (complex format)
+
+ */
+
+char *heap = "1234567890abcdefghijklmnopqrstuvwxyz";
+
+int failed = 0;
+
+#define CHECK(count, a...) \
+void test##count (void) \
+{ \
+ char *local = "1234567890abcdefghijklmnopqrstuvwxyz"; \
+ char buffer[1024]=""; \
+ a; \
+ if (__builtin_strcmp(buffer, heap) == 0) { \
+ debug("Okay(%d):\n\t%s\n", count, # a); \
+ } \
+ else { \
+ debug("Failed(%d):\n\t%s\n", count, # a); \
+ failed++; \
+ } \
+}
+
+
+CHECK( 0, __builtin_memcpy (buffer, "1234567890abcdefghijklmnopqrstuvwxyz", __builtin_strlen("1234567890abcdefghijklmnopqrstuvwxyz")+1); );
+CHECK( 1, __builtin_memcpy (buffer, local, __builtin_strlen(local)+1); );
+CHECK( 2, __builtin_memcpy (buffer, heap, __builtin_strlen(heap)+1); );
+
+CHECK( 3, __builtin_memmove (buffer, "1234567890abcdefghijklmnopqrstuvwxyz", __builtin_strlen("1234567890abcdefghijklmnopqrstuvwxyz")+1); );
+CHECK( 4, __builtin_memmove (buffer, local, __builtin_strlen(local)+1); );
+CHECK( 5, __builtin_memmove (buffer, heap, __builtin_strlen(heap)+1); );
+
+CHECK( 6, __builtin_strcpy (buffer, "1234567890abcdefghijklmnopqrstuvwxyz"); );
+CHECK( 7, __builtin_strcpy (buffer, local); );
+CHECK( 8, __builtin_strcpy (buffer, heap); );
+
+CHECK( 9, sprintf (buffer, "1234567890abcdefghijklmnopqrstuvwxyz"); );
+CHECK(10, sprintf (buffer, local); );
+CHECK(11, sprintf (buffer, heap); );
+
+CHECK(12, sprintf (buffer, "%s", "1234567890abcdefghijklmnopqrstuvwxyz"); );
+CHECK(13, sprintf (buffer, "%s", local); );
+CHECK(14, sprintf (buffer, "%s", heap); );
+
+CHECK(15, __builtin_strcat (buffer, "1234567890abcdefghijklmnopqrstuvwxyz"); );
+CHECK(16, __builtin_strcat (buffer, local); );
+CHECK(17, __builtin_strcat (buffer, heap); );
+
+void mongoose(void)
+{
+ char buffer[1024]="";
+ sprintf (buffer, "%s", "1234567890abcdefghijklmnopqrstuvwxyz");;
+ if (__builtin_strcmp(buffer, heap) == 0) {
+ debug("Okay(%d):\n\t%s\n", -1, "sprintf (buffer, \"%s\", \"1234567890abcdefghijklmnopqrstuvwxyz\");");
+ }
+ else {
+ debug("Failed(%d):\n\t%s\n", -1, "sprintf (buffer, \"%s\", \"1234567890abcdefghijklmnopqrstuvwxyz\");");
+ failed++;
+ }
+}
+
+int main (int argc, char *argv[])
+{
+ test0();
+ test1();
+ test2();
+ test3();
+ test4();
+ test5();
+ test6();
+ test7();
+ test8();
+ test9();
+ test10();
+ test11();
+
+ // wtf, why are these different?!
+ test12();
+ mongoose();
+
+ test13();
+ test14();
+ test15();
+ test16();
+ test17();
+
+ if (failed)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38932.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38932.c
new file mode 100644
index 000000000..4dfaffc77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38932.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* This variable needed only to exercise FRE instead of CCP. */
+unsigned char g;
+
+extern void abort();
+
+void f (long long int p)
+{
+ g = 255;
+ if (p >= (-9223372036854775807LL - 1) - (signed char) g)
+ p = 1;
+
+ if (p)
+ abort ();
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38934.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38934.c
new file mode 100644
index 000000000..c05742c5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38934.c
@@ -0,0 +1,19 @@
+/* PR middle-end/38934 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -w" } */
+
+/* This variable needed only to work around earlier optimizations than VRP. */
+unsigned char g;
+
+extern void abort ();
+
+void
+f (long long int p)
+{
+ g = 255;
+ if (p >= -9223372036854775808LL - (signed char) g)
+ p = 1;
+
+ if (p)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38957.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38957.c
new file mode 100644
index 000000000..f94cd7627
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38957.c
@@ -0,0 +1,16 @@
+/* PR c/38957 */
+/* { dg-do compile } */
+
+char *
+foo (void)
+{
+ char a[2];
+ return a+1; /* { dg-warning "returns address of local variable" } */
+}
+
+char *
+bar (void)
+{
+ char a[2];
+ return a; /* { dg-warning "returns address of local variable" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr38984.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr38984.c
new file mode 100644
index 000000000..3ccb0e492
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr38984.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-delete-null-pointer-checks -fdump-tree-optimized -fno-isolate-erroneous-paths-dereference" }
+ * */
+
+int f(int *p)
+{
+ int a = *p;
+ int *null = 0;
+ *null = 5;
+ return *p == a;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\*p" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-not "return 1" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39084.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39084.c
new file mode 100644
index 000000000..ff7314921
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39084.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct color { int i; }; /* { dg-message "note: originally defined here" } */
+static const struct color col;
+struct color * f(void)
+{
+ return (struct color *) &col;
+}
+
+struct color { int j; }; /* { dg-error "redefinition of" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39226.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39226.c
new file mode 100644
index 000000000..3d336360a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39226.c
@@ -0,0 +1,34 @@
+/* PR target/39226 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=cell -mminimal-toc" { target { powerpc*-*-* && lp64 } } } */
+
+#if (__SIZEOF_INT__ == 2)
+struct A
+{
+ char *a;
+ unsigned int b : 1;
+ unsigned int c : 15;
+};
+#else
+struct A
+{
+ char *a;
+ unsigned int b : 1;
+ unsigned int c : 31;
+};
+#endif
+
+struct B
+{
+ struct A *d;
+};
+
+void
+foo (struct B *x, unsigned long y)
+{
+ if (x->d[y].c)
+ return;
+ if (x->d[y].b)
+ x->d[y].a = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-1.c
new file mode 100644
index 000000000..5e3baec4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-1.c
@@ -0,0 +1,5 @@
+/* PR c/39323 */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+
+int foo __attribute__ ((aligned(1 << 29))) = 20; /* { dg-error "requested alignment is too large" } */
+typedef int __attribute__ ((aligned(1 << 29))) int29; /* { dg-error "requested alignment is too large" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-2.c
new file mode 100644
index 000000000..a87072973
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-2.c
@@ -0,0 +1,6 @@
+/* PR c/39323 */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+
+int bar __attribute__ ((aligned(1 << 28))) = 20;
+
+/* { dg-final { scan-assembler ".align\[ \t\]+(268435456|28)\[ \t\]*\n" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-3.c
new file mode 100644
index 000000000..b452d3c96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39323-3.c
@@ -0,0 +1,7 @@
+/* PR c/39323 */
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+
+typedef int __attribute__ ((aligned(1 << 28))) int28;
+int28 foo = 20;
+
+/* { dg-final { scan-assembler ".align\[ \t\]+(268435456|28)\[ \t\]*\n" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39343.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39343.c
new file mode 100644
index 000000000..70df59ef0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39343.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/39343 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+extern inline __attribute__ ((__always_inline__)) int
+foo (char *dest)
+{
+ return __builtin_object_size (dest, 1);
+}
+
+struct S
+{
+ union
+ {
+ struct { int a, b; char c, d; } f;
+ struct { struct { int a, b; char c, d[255]; } e; } g;
+ } u;
+};
+
+int
+main (void)
+{
+ struct S s;
+ if (foo (s.u.g.e.d) != 255)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39443.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39443.c
new file mode 100644
index 000000000..1baa63a99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39443.c
@@ -0,0 +1,18 @@
+/* PR middle-end/39443 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "memcmp" } } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern int memcmp (const void *s1, const void *s2, size_t n)
+ __attribute__ ((__nothrow__, __pure__));
+extern __typeof (memcmp) memcmp __asm__ ("memory_compare");
+
+int
+test (char *s, char *t, int cnt)
+{
+ if (__builtin_expect (cnt, 0))
+ return memcmp (s, t, cnt);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39453.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39453.c
new file mode 100644
index 000000000..66ecc3fa0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39453.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops" } */
+
+int foo(int k, int n)
+{
+ int i;
+ for (i = 0; i < n; i += 8) {
+ int j;
+ for (j = 0; j < n; j += 8) {
+ while (k < n) {
+ k += 8;
+ }
+ }
+ }
+ return k;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39455.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39455.c
new file mode 100644
index 000000000..8e8c67034
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39455.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/39455 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
+
+void
+foo (char *x, unsigned long y, unsigned char *z)
+{
+ unsigned int c[256], *d;
+
+ for (d = c + 1; d < c + 256; ++d)
+ *d += d[-1];
+ x[--c[z[y]]] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39464.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39464.c
new file mode 100644
index 000000000..cd745406d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39464.c
@@ -0,0 +1,19 @@
+/* PR c/39464 */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+typedef int T __attribute__((may_alias));
+typedef unsigned int U __attribute__((may_alias));
+
+void
+foo (void *p)
+{
+ T *a = (int *) p; /* { dg-warning "initialization from incompatible pointer type" } */
+ int *b = (T *) p; /* { dg-warning "initialization from incompatible pointer type" } */
+ U *c = (unsigned int *) p; /* { dg-warning "initialization from incompatible pointer type" } */
+ unsigned int *d = (U *) p; /* { dg-warning "initialization from incompatible pointer type" } */
+ (void) a;
+ (void) b;
+ (void) c;
+ (void) d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39565.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39565.c
new file mode 100644
index 000000000..9c14055a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39565.c
@@ -0,0 +1,48 @@
+/* PR39565: Static variable leaves undefined symbol in object file.
+ Variables codestrs_4 and codestrs_8 should not be undefined,
+ when this program is compiled at -O2. As a basic sanity test,
+ verify that this program compiles into an executable and runs. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+extern int strcmp (const char *, const char *);
+
+static const union codestrs_t_4 {
+ struct {
+ char str_2[sizeof ("Illegal opcode")];
+ };
+ char str[0];
+} codestrs_4 = { {"Illegal opcode"} };
+
+static const union codestrs_t_8 {
+ struct {
+ char str_12[sizeof ("Integer divide by zero")];
+ };
+ char str[0];
+} codestrs_8 = { {"Integer divide by zero"} };
+
+const char *
+psiginfo (int pinfo)
+{
+ const char *base = ((void *)0);
+
+ switch (pinfo)
+ {
+ case 4: base = codestrs_4.str; break;
+ case 8: base = codestrs_8.str; break;
+ }
+ return base;
+}
+
+int
+main (void)
+{
+ if (strcmp (psiginfo (4), codestrs_4.str))
+ abort ();
+ if (strcmp (psiginfo (8), codestrs_8.str))
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39666-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39666-1.c
new file mode 100644
index 000000000..f1ba499c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39666-1.c
@@ -0,0 +1,22 @@
+/* PR middle-end/39666 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+int
+foo (int i)
+{
+ int j;
+ switch (i)
+ {
+ case -__INT_MAX__ - 1 ... -1:
+ j = 6;
+ break;
+ case 0:
+ j = 5;
+ break;
+ case 1 ... __INT_MAX__:
+ j = 4;
+ break;
+ }
+ return j;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39666-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39666-2.c
new file mode 100644
index 000000000..9ca119b6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39666-2.c
@@ -0,0 +1,22 @@
+/* PR middle-end/39666 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+int
+foo (int i)
+{
+ int j;
+ switch (i)
+ {
+ case -__INT_MAX__ - 1 ... -1:
+ j = 6;
+ break;
+ case 0:
+ j = 5;
+ break;
+ case 2 ... __INT_MAX__:
+ j = 4;
+ break;
+ }
+ return j; /* { dg-warning "may be used uninitialized" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39712.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39712.c
new file mode 100644
index 000000000..9846e33cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39712.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+int is_table[2][16];
+int is_table_lsf[2][2][16];
+void compute_stereo()
+{
+ int (*is_tab)[16];
+ is_tab = is_table;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39794.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39794.c
new file mode 100644
index 000000000..2702ba79a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39794.c
@@ -0,0 +1,33 @@
+/* PR rtl-optimization/39794 */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+extern void abort ();
+
+void
+foo (int *a, int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ a[i] *= 2;
+ a[i + 1] = a[i - 1] + a[i - 2];
+ }
+}
+
+int a[16];
+int ref[16] = { 0, 1, 4, 2, 10, 12, 24, 44,
+ 72, 136, 232, 416, 736, 1296, 2304, 2032 };
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] = i;
+ foo (a + 2, 16 - 3);
+ for (i = 0; i < 16; i++)
+ if (ref[i] != a[i])
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39867.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39867.c
new file mode 100644
index 000000000..cb7972452
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39867.c
@@ -0,0 +1,12 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+int main (void)
+{
+ int exp = -1;
+ /* Wrong folding of the LHS to an unsigned MAX leads to 4294967295 != 2. */
+ if ((exp < 2 ? 2U : (unsigned int) exp) != 2)
+ link_error ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr39874.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr39874.c
new file mode 100644
index 000000000..ca4528310
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr39874.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern void func();
+
+void test1(char *signature)
+{
+ char ch = signature[0];
+ if (ch == 15 || ch == 3)
+ {
+ if (ch == 15) func();
+ }
+}
+
+
+void test2(char *signature)
+{
+ char ch = signature[0];
+ if (ch == 15 || ch == 3)
+ {
+ if (ch > 14) func();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times " == 15" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-not " == 3" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40031.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40031.c
new file mode 100644
index 000000000..f6f1f65a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40031.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fPIC" } */
+double c;
+double d;
+double *f(int a)
+{
+ if(a) return &c;
+ return &d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-1.c
new file mode 100644
index 000000000..a834a8a99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-1.c
@@ -0,0 +1,31 @@
+/* PR middle-end/40172 */
+/* { dg-do compile } */
+/* { dg-options "-Wall -W -Werror -Wlogical-op" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+
+extern int foo;
+extern int bar;
+extern int xxx;
+
+int
+test (void)
+{
+ if (((rtx) 0 != (rtx) 0) && xxx ? foo : bar)
+ return 1;
+ else if ((foo & 0) && xxx)
+ return 2;
+ else if (foo & 0)
+ return 3;
+ else if (0 && xxx)
+ return 4;
+ else if (0)
+ return 5;
+ if (((int) 0 != (int) 0) && bar ? foo : xxx)
+ return 6;
+ else if (0 != 0 && foo ? xxx : bar)
+ return 7;
+ else
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-2.c
new file mode 100644
index 000000000..17aabb8b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-2.c
@@ -0,0 +1,16 @@
+/* PR middle-end/40172 */
+/* { dg-do compile } */
+/* { dg-options "-Wall -W -Werror" } */
+
+extern int xxx;
+
+#define XXX xxx
+
+int
+test (void)
+{
+ if (!XXX && xxx)
+ return 4;
+ else
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-3.c
new file mode 100644
index 000000000..ea74fce37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40172-3.c
@@ -0,0 +1,17 @@
+/* PR middle-end/40172 */
+/* { dg-do compile */
+/* { dg-xfail-if "" { "*-*-*" } { "*" } { "" } } */
+/* { dg-options "-Wall -W -Werror -Wlogical-op" } */
+
+extern int xxx;
+
+#define XXX xxx
+
+int
+test (void)
+{
+ if (!XXX && xxx)
+ return 4;
+ else
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40209.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40209.c
new file mode 100644
index 000000000..afe131fc5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40209.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprofile-use -fopt-info" } */
+
+void process(const char *s);
+
+struct BaseHolder {
+ unsigned int base_;
+};
+
+void UInt2Str(struct BaseHolder *b, unsigned int x) {
+ static const char digit[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+ char buf[100];
+ int i = 100;
+ do {
+ buf[--i] = digit[x % b->base_];
+ x /= b->base_;
+ } while (x > 0);
+ process(buf);
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*\.gcda not found, execution counts estimated.*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-1.c
new file mode 100644
index 000000000..aae84c637
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-1.c
@@ -0,0 +1,24 @@
+/* PR middle-end/40340 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -Wno-system-headers" } */
+
+#include "pr40340.h"
+
+static inline
+__attribute__ ((always_inline))
+void
+test (char *p)
+{
+ memset (p, 0, 6);
+}
+
+int
+main (void)
+{
+ char buf[4];
+ test (buf);
+ return 0;
+}
+
+/* { dg-warning "will always overflow destination buffer" "" { target *-*-* } 10 } */
+/* { dg-message "file included" "In file included" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-2.c
new file mode 100644
index 000000000..a0d6e084e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-2.c
@@ -0,0 +1,16 @@
+/* PR middle-end/40340 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -Wno-system-headers" } */
+
+#include "pr40340.h"
+
+int
+main (void)
+{
+ char buf[4];
+ memset (buf, 0, 6);
+ return 0;
+}
+
+/* { dg-warning "will always overflow destination buffer" "" { target *-*-* } 10 } */
+/* { dg-message "file included" "In file included" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-3.c
new file mode 100644
index 000000000..5ef09e073
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-3.c
@@ -0,0 +1,15 @@
+/* PR middle-end/40340 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -Wno-system-headers" } */
+
+#define TEST2
+#include "pr40340.h"
+
+int
+main (void)
+{
+ test2 ();
+ return 0;
+}
+
+/* { dg-bogus "will always overflow destination buffer" "" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-4.c
new file mode 100644
index 000000000..d3f020cad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-4.c
@@ -0,0 +1,16 @@
+/* PR middle-end/40340 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -Wno-system-headers -g" } */
+
+#define TEST3
+#include "pr40340.h"
+
+int
+main (void)
+{
+ char buf[4];
+ test3 (buf);
+ return 0;
+}
+
+/* { dg-bogus "will always overflow destination buffer" "" { target *-*-* } 10 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-5.c
new file mode 100644
index 000000000..f50514c3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340-5.c
@@ -0,0 +1,17 @@
+/* PR middle-end/40340 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -Wsystem-headers -g" } */
+
+#define TEST3
+#include "pr40340.h"
+
+int
+main (void)
+{
+ char buf[4];
+ test3 (buf);
+ return 0;
+}
+
+/* { dg-warning "will always overflow destination buffer" "" { target *-*-* } 10 } */
+/* { dg-message "file included" "In file included" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40340.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340.h
new file mode 100644
index 000000000..174e076b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40340.h
@@ -0,0 +1,31 @@
+#pragma GCC system_header
+typedef __SIZE_TYPE__ size_t;
+extern void *memset (void *s, int c, size_t n)
+ __attribute__ ((nothrow, nonnull (1)));
+extern inline
+__attribute__ ((always_inline, artificial, gnu_inline, nothrow))
+void *
+memset (void *dest, int ch, size_t len)
+{
+ return __builtin___memset_chk (dest, ch, len,
+ __builtin_object_size (dest, 0));
+}
+
+#ifdef TEST2
+static void
+__attribute__ ((noinline))
+test2 (void)
+{
+ char buf[4];
+ memset (buf, 0, 6);
+}
+#endif
+
+#ifdef TEST3
+static inline void
+__attribute__ ((always_inline))
+test3 (char *p)
+{
+ memset (p, 0, 6);
+}
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40501.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40501.c
new file mode 100644
index 000000000..0e43e63c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40501.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target alpha*-*-* ia64*-*-* x86_64-*-* s390x-*-* } } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target lp64 } */
+
+/* PR middle-end/40501 */
+
+/* This once failed due to the bswap pass missing to add the type
+ casts of the signed argument and result to the proper unsigned
+ types. */
+
+typedef long int int64_t;
+
+int64_t
+swap64 (int64_t n)
+{
+ return (((n & (((int64_t) 0xff) )) << 56) |
+ ((n & (((int64_t) 0xff) << 8)) << 40) |
+ ((n & (((int64_t) 0xff) << 16)) << 24) |
+ ((n & (((int64_t) 0xff) << 24)) << 8) |
+ ((n & (((int64_t) 0xff) << 32)) >> 8) |
+ ((n & (((int64_t) 0xff) << 40)) >> 24) |
+ ((n & (((int64_t) 0xff) << 48)) >> 40) |
+ ((n & (((int64_t) 0xff) << 56)) >> 56));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40550.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40550.c
new file mode 100644
index 000000000..08951137d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40550.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-require-effective-target sse_runtime { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+typedef float v2sf __attribute__ ((vector_size (2 * sizeof(float))));
+
+static void test (void)
+{
+ v2sf a = {1.0, 0.0};
+ v2sf b = {0.0, 1.0};
+ v2sf d;
+ d = a + b;
+}
+
+int main ()
+{
+ test ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40669.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40669.c
new file mode 100644
index 000000000..cc6bbc9e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40669.c
@@ -0,0 +1,26 @@
+/* PR middle-end/40669 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double _Complex
+test (int d, int t, double *x, double *y, double *z, int n,
+ double _Complex (*fnp) (double))
+{
+ int m = n / 2;
+ double min = y[t], max = z[t], med = x[m * d + t];
+ double _Complex result = 0.0;
+
+ if (n == 0)
+ return 0.0;
+
+ if (min > med)
+ result += test (d, (t + 1) % d, x + (m + 1) * d, y, z, n - m - 1, fnp);
+ else if (max < med)
+ result += test (d, (t + 1) % d, x, y, z, m, fnp);
+ else
+ {
+ result += fnp (y[0] + x[m]);
+ result += test (d, (t + 1) % d, x + (m + 1) * d, y, z, n - m - 1, fnp);
+ }
+ return result;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40792.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40792.c
new file mode 100644
index 000000000..41f080e54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40792.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/40792 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void foo (int, char *, int *);
+
+void
+bar (int *a, int *b, ...)
+{
+ int c;
+ char d[256];
+ foo (*b, d, &c);
+}
+
+static int a, b;
+
+void
+baz (int c)
+{
+ bar (&a, &b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40861.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40861.c
new file mode 100644
index 000000000..1d955e616
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40861.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int foo(int i)
+{
+ return (1LL >> 128 * i) && i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40946.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40946.c
new file mode 100644
index 000000000..3fd804e56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40946.c
@@ -0,0 +1,33 @@
+/* PR middle-end/40946 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+struct A
+{
+ unsigned char a1[8];
+ unsigned short a2, a3, a4, a5, a6, a7;
+};
+
+int bar (void *, const char *, int);
+char *foo (void *, int);
+
+char *
+baz (const char *x, const char *y)
+{
+ int a = sizeof (struct A) + 2 * (__builtin_strlen (y)
+ + __builtin_strlen (x) + 24) + 16;
+ struct A *b = __builtin_malloc (a);
+ char *c;
+ int d;
+
+ b->a4 = sizeof (struct A);
+ c = ((char *) b) + b->a4;
+ d = ((char *) b) + a - c;
+ b->a2 = b->a3 = (unsigned short) bar (c, y, d); /* { dg-bogus "array subscript is above array bounds" } */
+ c += b->a2;
+ d = ((char *) b) + a - c;
+ b->a7 = b->a4 + b->a2;
+ b->a5 = b->a6 = (unsigned short) bar (c, x, d);
+ c = foo (b, a);
+ return c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40971.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40971.c
new file mode 100644
index 000000000..31dfd5e13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40971.c
@@ -0,0 +1,23 @@
+/* PR target/40971 */
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-protector -fno-strict-aliasing" } */
+/* { dg-require-effective-target fstack_protector } */
+
+extern void bar (char *);
+
+void
+foo (int f, long a)
+{
+ {
+ char d[32768];
+ bar (d);
+ }
+ double b = f;
+ while (a)
+ {
+ char c[sizeof (double)];
+ __builtin_memcpy (c, &b, sizeof (c));
+ if (*(double *) c != 2.0)
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr40989.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr40989.c
new file mode 100644
index 000000000..0fbc87082
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr40989.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Werror=implicit" } */
+int main() {
+ return pippo(); /* { dg-error "" } */
+}
+/* { dg-message "warnings being treated as errors" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41033.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41033.c
new file mode 100644
index 000000000..5043be2d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41033.c
@@ -0,0 +1,24 @@
+/* { dg-options "-O1 -fno-strict-aliasing" } */
+/* PR rtl-optimization/41033 */
+
+struct X {
+ int i;
+ int j;
+};
+
+int foo(struct X *p, struct X *q)
+{
+ p->j = 1;
+ q->i = 0;
+ return p->j;
+}
+
+extern void abort (void);
+
+int main()
+{
+ struct X x;
+ if (foo (&x, (struct X *)&x.j) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41123.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41123.c
new file mode 100644
index 000000000..076edb46e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41123.c
@@ -0,0 +1,46 @@
+/* PR middle-end/41123 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing" } */
+
+struct S { char a, b, c, d, e, f, g, h; };
+struct T { int a, b; };
+
+struct S
+f1 (float _Complex x)
+{
+ return *(struct S *) & x;
+}
+
+int
+f2 (float _Complex x)
+{
+ struct S f = f1 (x);
+ return f.b;
+}
+
+struct T
+f3 (float _Complex x)
+{
+ return *(struct T *) & x;
+}
+
+int
+f4 (float _Complex x)
+{
+ struct T f = f3 (x);
+ return f.a;
+}
+
+int
+f5 (float _Complex x)
+{
+ struct T f = f3 (x);
+ return f.b;
+}
+
+struct T
+f6 (float _Complex x)
+{
+ struct T f = f3 (x);
+ return f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41232.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41232.c
new file mode 100644
index 000000000..17ec54899
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41232.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -g" } */
+extern int atoi (const char *);
+extern int sprintf (char *, const char *, ...);
+void malloc_init() {
+ char *cptr;
+ char buf[1];
+ int tmbd = atoi(cptr);
+ if (tmbd > 0)
+ tmbd = (tmbd <= 124) ? tmbd : 124;
+ else
+ tmbd = 0;
+ sprintf(buf, "%d\n", tmbd);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41241.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41241.c
new file mode 100644
index 000000000..893353b9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41241.c
@@ -0,0 +1,35 @@
+/* PR bootstrap/41241 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug -g" } */
+/* { dg-options "-O2 -fcompare-debug -g -march=i586 -mtune=i586 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+typedef struct { int t1; int t2; int t3; } *T;
+typedef struct { int s; } S;
+
+int fn1 (int);
+int fn2 (int, int, int);
+int fn3 (void);
+
+static S
+bar ()
+{
+ S s = { 0 };
+ return s;
+}
+
+void
+foo (T x)
+{
+ int a, b, c, d, e;
+ T f, g;
+ S h;
+ a = x->t2;
+ fn1 (x->t1);
+ h = bar (b);
+ c = fn1 (e);
+ d = fn3 ();
+ f->t3 &= g->t3 |= fn2 (0, b, x->t1);
+ fn2 (0, c, d);
+ fn2 (0, e, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41248.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41248.c
new file mode 100644
index 000000000..0d5a74919
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41248.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+struct __gcov_var {
+ unsigned int offset;
+ unsigned int buffer[(1 << 10) + 1];
+} __gcov_var;
+unsigned int * gcov_write_words (unsigned int words) {
+ unsigned int *result;
+ result = &__gcov_var.buffer[__gcov_var.offset];
+ return result;
+}
+
+struct gcov_ctr_summary { };
+struct gcov_summary {
+ unsigned int checksum;
+ struct gcov_ctr_summary ctrs[1];
+};
+void __gcov_write_unsigned (unsigned int);
+void __gcov_write_summary (unsigned int tag,
+ const struct gcov_summary *summary)
+{
+ unsigned ix;
+ const struct gcov_ctr_summary *csum;
+ __gcov_write_unsigned (summary->checksum);
+ for (csum = summary->ctrs, ix = 1; ix--; csum++) { }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41295.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41295.c
new file mode 100644
index 000000000..fabff63c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41295.c
@@ -0,0 +1,91 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -g" } */
+
+enum reg_class
+{
+ BASE_REGS,
+ GENERAL_REGS,
+ LIM_REG_CLASSES
+};
+
+static __inline__ unsigned char
+hard_reg_set_subset_p (const unsigned long x[4], const unsigned long y[4])
+{
+ return ((x[0] & ~y[0]) == 0
+ && (x[1] & ~y[1]) == 0
+ && (x[2] & ~y[2]) == 0
+ && (x[3] & ~y[3]) == 0);
+}
+
+static __inline__ unsigned char
+hard_reg_set_equal_p (const unsigned long x[4], const unsigned long y[4])
+{
+ return x[0] == y[0]
+ && x[1] == y[1]
+ && x[2] == y[2]
+ && x[3] == y[3];
+}
+
+extern unsigned long reg_class_contents[(int) LIM_REG_CLASSES][4];
+extern int ira_important_classes_num;
+extern enum reg_class ira_important_classes[(int) LIM_REG_CLASSES];
+extern enum reg_class ira_reg_class_intersect[(int) LIM_REG_CLASSES][(int)
+ LIM_REG_CLASSES];
+extern unsigned char ira_reg_classes_intersect_p[(int) LIM_REG_CLASSES][(int)
+ LIM_REG_CLASSES];
+extern enum reg_class ira_reg_class_super_classes[(int) LIM_REG_CLASSES][(int)
+ LIM_REG_CLASSES];
+static unsigned long temp_hard_regset[4];
+
+static void
+setup_reg_class_relations (void)
+{
+ int i, cl1, cl2, cl3;
+ unsigned long temp_set2[4];
+ for (cl1 = 0; cl1 < (int) LIM_REG_CLASSES; cl1++)
+ {
+ ira_reg_class_super_classes[cl1][0] = LIM_REG_CLASSES;
+ for (cl2 = 0; cl2 < (int) LIM_REG_CLASSES; cl2++)
+ {
+ ira_reg_classes_intersect_p[cl1][cl2] = 0;
+ {
+ unsigned long *scan_tp_ = (temp_set2), *scan_fp_ =
+ (reg_class_contents[cl2]);
+ scan_tp_[1] = scan_fp_[1];
+ scan_tp_[2] = scan_fp_[2];
+ scan_tp_[3] = scan_fp_[3];
+ }
+ for (i = 0; i < ira_important_classes_num; i++)
+ {
+ cl3 = ira_important_classes[i];
+ {
+ unsigned long *scan_tp_ = (temp_hard_regset), *scan_fp_ =
+ (reg_class_contents[cl3]);
+ scan_tp_[0] = scan_fp_[0];
+ scan_tp_[1] = scan_fp_[1];
+ scan_tp_[3] = scan_fp_[3];
+ }
+ if (!hard_reg_set_subset_p (temp_hard_regset, temp_set2)
+ || (hard_reg_set_equal_p (temp_hard_regset, temp_set2)
+ && hard_reg_set_subset_p (reg_class_contents[cl3],
+ reg_class_contents[(int)
+ ira_reg_class_intersect
+ [cl1]
+ [cl2]])))
+ ira_reg_class_intersect[cl1][cl2] = (enum reg_class) cl3;
+ }
+ }
+ }
+}
+
+static void
+find_reg_class_closure (void)
+{
+ setup_reg_class_relations ();
+}
+
+void
+ira_init (void)
+{
+ find_reg_class_closure ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41340.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41340.c
new file mode 100644
index 000000000..439046af8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41340.c
@@ -0,0 +1,71 @@
+/* PR debug/41340 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -g -fcompare-debug" } */
+/* { dg-options "-O3 -g -fcompare-debug -march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-skip-if "no long pointers" { { ! ilp32 } && { ! lp64 } } } */
+
+typedef struct { int t; } *T;
+struct S1 { unsigned s1; };
+struct S2 { struct S1 s2; };
+struct S3 { unsigned s3; struct S2 **s4; };
+struct S5 { struct S2 *s5; };
+
+__extension__ typedef __INTPTR_TYPE__ ssize_t;
+
+extern void fn0 (void) __attribute__ ((__noreturn__));
+T fn6 (struct S3);
+void fn7 (void);
+
+static inline __attribute__((always_inline)) int
+fn1 (const struct S1 *x)
+{
+ return x->s1;
+}
+
+static inline __attribute__((always_inline)) int
+fn2 (const struct S1 *x, unsigned y)
+{
+ if (y >= x->s1)
+ fn0 ();
+ return 0;
+}
+
+static inline __attribute__((always_inline)) int
+fn3 (struct S3 x)
+{
+ return (x.s3 == fn1 (*x.s4 ? &(*x.s4)->s2 : 0));
+}
+
+static inline __attribute__((always_inline)) int
+fn4 (struct S3 x)
+{
+ return fn2 (&(*x.s4)->s2, x.s3);
+}
+
+int
+fn5 (struct S3 x, T *y)
+{
+ if (!fn3 (x))
+ {
+ *y = (T) (ssize_t) fn4 (x);
+ return 1;
+ }
+ return 0;
+}
+
+void
+test (struct S5 *x)
+{
+ struct S3 a;
+ T b;
+ unsigned char c = 0;
+ a.s4 = &x->s5;
+ while (fn5 (a, &b))
+ if (!(b->t & 8))
+ c = 1;
+ a.s4 = &x->s5;
+ while ((b = fn6 (a)))
+ ;
+ if (!c)
+ fn7 ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41345.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41345.c
new file mode 100644
index 000000000..b2c72c72f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41345.c
@@ -0,0 +1,15 @@
+/* PR bootstrap/41345 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+void
+foo (int *x)
+{
+ int a;
+ for (a = 0; a < 2; a++)
+ if (x[a])
+ goto lab;
+ __builtin_unreachable ();
+lab:;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41454.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41454.c
new file mode 100644
index 000000000..d8264bc63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41454.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-vrp" } */
+
+extern void abort (void);
+
+int main ()
+{
+ int BM_tab2[0400];
+ int *BM_tab = BM_tab2;
+ int *BM_tab_base;
+
+ BM_tab_base = BM_tab;
+ BM_tab += 0400;
+ while (BM_tab_base != BM_tab)
+ {
+ *--BM_tab = 6;
+ *--BM_tab = 6;
+ }
+ if (BM_tab2[0] != 6)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41470.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41470.c
new file mode 100644
index 000000000..1c029b481
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41470.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fexceptions" } */
+void *
+af (void *a)
+{
+ return a;
+}
+void
+bf (void)
+{
+ void *p;
+ {
+ int i = 1;
+ char v[i];
+ p = af (v);
+ }
+ cf (p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41488.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41488.c
new file mode 100644
index 000000000..c4bc42832
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41488.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sccp-scev" } */
+
+struct struct_t
+{
+ int* data;
+};
+
+void foo (struct struct_t* sp, int start, int end)
+{
+ int i;
+
+ for (i = 0; i+start < end; i++)
+ sp->data[i+start] = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Simplify PEELED_CHREC into POLYNOMIAL_CHREC" 1 "sccp" } } */
+/* { dg-final { cleanup-tree-dump "sccp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41551.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41551.c
new file mode 100644
index 000000000..2f2ad2be9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41551.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* Make sure we do not ICE. */
+
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
+
+int main(void)
+{
+ int var, *p = &var;
+ return (double)(uintptr_t)(p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41573.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41573.c
new file mode 100644
index 000000000..52961db8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41573.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+__inline __attribute__ ((__always_inline__)) char *
+strcpy (char *__dest, __const char *__src)
+{
+ return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
+}
+
+const char* get_attr(unsigned attr)
+{
+ static char tmp[256];
+
+ strcpy(tmp, "");
+ return tmp;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41574.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41574.c
new file mode 100644
index 000000000..f5ddcb2fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41574.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { arm*-*-* } } } */
+/* { dg-options "-O2 -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { ! arm*-*-* } } } */
+
+
+static const double one=1.0;
+
+double
+f(double x)
+{
+ return x*(one+x);
+}
+
+/* { dg-final { scan-rtl-dump-not "\\(plus:DF \\(mult:DF" "combine" } } */
+/* { dg-final { cleanup-rtl-dump "combine*" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41619.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41619.c
new file mode 100644
index 000000000..9c164e3a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41619.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-ira-share-save-slots" } */
+
+struct A {};
+
+int foo();
+
+struct A bar(double x)
+{
+ double y;
+ if (foo())
+ y = 1 / x;
+ return bar(y);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41643.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41643.c
new file mode 100644
index 000000000..7c0743da4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41643.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/41643 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+struct S { int a; };
+
+int
+f (struct S *x)
+{
+ int a = x->a;
+ if (a)
+ return f (x) + a;
+ else
+ return f (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41762.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41762.c
new file mode 100644
index 000000000..88d8172f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41762.c
@@ -0,0 +1,31 @@
+/* PR target/41762 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -fsched2-use-superblocks" } */
+/* { dg-options "-O2 -ftracer -fsched2-use-superblocks -fpic" { target fpic } } */
+
+extern __SIZE_TYPE__ strlen (const char *);
+extern int f1 (void *);
+extern char *f2 (void);
+extern void f3 (int, int);
+static char *a;
+char *b, *c, *d, *e;
+
+void
+foo (void)
+{
+ int f, g, h;
+ f = (a ? strlen (a) : strlen ("abcde"));
+ f += (b ? strlen (b) : 0);
+ f += (c ? strlen (c) : 0);
+ f += (d ? strlen (d) : 0);
+ f += (e ? strlen (e) : 0);
+ h = f1 (strlen);
+ g = strlen (a);
+ f3 (g, f);
+}
+
+void
+bar (void)
+{
+ a = f2 ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41783.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41783.c
new file mode 100644
index 000000000..cae066be6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41783.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-pre" } */
+int db[100];
+int a_global_var, fact;
+int main()
+{
+ int i,j=0;
+ do
+ {
+ for (i=0; i<100; ++i)
+ db[i] = i;
+ fact = a_global_var * i;
+ }
+ while (j++ < 100);
+}
+/* We want to have exactly one load (not two) from a_global_var,
+ and we want that load to be into a PRE temporary. */
+/* { dg-final { scan-tree-dump-times "= a_global_var;" 1 "pre" } } */
+/* { dg-final { scan-tree-dump "pretmp\[^\\n\]* = a_global_var;" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41837.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41837.c
new file mode 100644
index 000000000..f96c34735
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41837.c
@@ -0,0 +1,38 @@
+/* PR middle-end/41837 */
+/* { dg-do compile } */
+/* { dg-options "-fipa-struct-reorg -O -fwhole-program -fprofile-generate" } */
+
+typedef struct { int a, b; } T1;
+typedef struct S1 *T2;
+typedef struct S2 *T3;
+typedef struct S3 *T4;
+typedef struct S4 *T5;
+struct S4 { union { int c; } d; };
+struct S2 { int e; T2 f; int g; };
+typedef struct { T3 h; } T6;
+typedef struct { int i; } *T7;
+struct S3 { T6 j; T7 k; };
+
+void
+f1 (T4 x)
+{
+ if (!x->j.h->e)
+ f5 (x);
+}
+
+void
+f2 (void)
+{
+ f6 (f1);
+}
+
+void
+f3 (T5 x, T1 *y)
+{
+}
+
+void
+f4 (void)
+{
+ f7 (f3);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41841.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41841.c
new file mode 100644
index 000000000..595bc7592
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41841.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/41841 */
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-struct-reorg -fwhole-program -fipa-cp" } */
+
+typedef struct S *T;
+typedef struct { } *U;
+extern int f1 (void);
+
+static void
+f3 (U x, int y)
+{
+ T a = (T) x;
+ y && f1 ();
+}
+
+static void
+f2 (T x)
+{
+ f3 ((U) x, 1);
+}
+
+void *volatile a __attribute__((used)) = f2;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41842.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41842.c
new file mode 100644
index 000000000..2f2b7697b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41842.c
@@ -0,0 +1,9 @@
+/* PR c/41842 */
+/* { dg-do compile } */
+
+void
+f ()
+{
+ char x[g (h)]; /* { dg-error "undeclared" } */
+/* { dg-message "undeclared identifier is reported only once" "reminder" { target *-*-* } 7 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41935.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41935.c
new file mode 100644
index 000000000..e6a1b2867
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41935.c
@@ -0,0 +1,25 @@
+/* PR middle-end/41935 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+struct A { int a; int b[10]; };
+
+int
+foo (struct A *p)
+{
+ return __builtin_offsetof (struct A, b[p->a]);
+}
+
+int
+main ()
+{
+ struct A a;
+ a.a = 7;
+ if (foo (&a) != 7 * sizeof (int) + __builtin_offsetof (struct A, b))
+ abort ();
+ a.a = 2;
+ if (foo (&a) != 2 * sizeof (int) + __builtin_offsetof (struct A, b))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr41963.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr41963.c
new file mode 100644
index 000000000..408a3d24c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr41963.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern float fabsf(float);
+extern float sqrtf(float);
+
+static __attribute__((noinline)) void f (float *dst, float *src)
+{
+ int i, j;
+ for (i = 0; i < 2; i++)
+ {
+ float len;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ len = sqrtf (dst[0] * dst[0] + dst[1] * dst[1]);
+ if (len > 0.5f)
+ {
+ len = 1.0f / len;
+ dst[0] *= len;
+ dst[1] *= len;
+ }
+ }
+}
+
+extern void abort (void);
+
+int main()
+{
+ float dst[2], src[2];
+ src[0] = 2.0f;
+ src[1] = 5.0f;
+ f (dst, src);
+ if (fabsf (dst[0] * dst[0] + dst[1] * dst[1] - 1.0f) > 0.01f)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42078.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42078.c
new file mode 100644
index 000000000..8107ff555
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42078.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/42078 */
+/* { dg-do compile } */
+/* { dg-options "-g -O -ffast-math" } */
+
+double sqrt (double x);
+
+float
+foo (float x)
+{
+ float y = sqrt (x);
+ return x / y;
+}
+
+inline float
+bar (float x)
+{
+ float y = sqrt (x);
+ float a = y;
+ float b = y;
+ float c = y;
+ return x / y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42084.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42084.c
new file mode 100644
index 000000000..d5aad9642
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42084.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -fno-delete-null-pointer-checks" } */
+extern void abort (void);
+int g = 0;
+static int __attribute__((noinline)) f (long long a, long long b)
+{
+ int cmp;
+ cmp = a > b;
+ if (&g == 0)
+ cmp-=2;
+ else
+ cmp++;
+ return cmp;
+}
+
+int main (void)
+{
+ int ret = f (2, 1);
+ if (ret != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42215.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42215.c
new file mode 100644
index 000000000..e5a75bd30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42215.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+extern int A[];
+extern int B[];
+
+void f(int i)
+{
+ while (i-- > 0) {
+ A[i] = 0;
+ B[i] = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42245-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42245-2.c
new file mode 100644
index 000000000..48f9e0eb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42245-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling -fsel-sched-pipelining" } */
+
+int
+strictly_smaller_name (char *s, char *t)
+{
+ int ss, tt;
+ while ((*s != '\0') || (*t != '\0'))
+ {
+ if (*s == '\0')
+ ss = '*';
+ else
+ ss = *s++;
+ if (*t != '\0')
+ tt = *t;
+ if (ss == tt)
+ return 0;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42245.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42245.c
new file mode 100644
index 000000000..98dd1d067
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42245.c
@@ -0,0 +1,30 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling -fsel-sched-pipelining" } */
+
+extern int N_words;
+typedef struct DIS_node_struct DIS_node;
+typedef struct CON_list_struct CON_list;
+
+struct DIS_node_struct
+{
+ CON_list *cl;
+};
+
+void
+build_DIS_CON_tree (void)
+{
+ int w;
+ DIS_node *dnroot, *dn;
+ CON_list *child, *xchild;
+ for (w = 0; w < N_words; w++)
+ {
+ if (dnroot == ((void *) 0))
+ {
+ dnroot = dn;
+ for (child = dn->cl; child != ((void *) 0); child = xchild)
+ {
+ }
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42246.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42246.c
new file mode 100644
index 000000000..ee17a2112
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42246.c
@@ -0,0 +1,36 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops" } */
+
+typedef enum
+{
+ empty = 0, pawn = 1, knight = 2, king = 3, bishop = 5, rook = 6, queen = 7
+}
+PIECE;
+extern int p_values[15];
+extern int *last[65];
+int
+Quiesce (int alpha, int beta, int wtm, int ply)
+{
+ register int initial_alpha, value, delta;
+ register int *goodmv, *movep, moves = 0, *sortv, temp;
+ for (movep = last[ply - 1]; movep < last[ply]; movep++)
+ if (p_values[(((*movep) >> 15) & 7) + 7] +
+ p_values[(((*movep) >> 18) & 7) + 7] >= delta)
+ {
+ register int done;
+ register int *end = last[ply - 1] + moves - 1;
+ do
+ {
+ done = 1;
+ movep = last[ply - 1];
+ for (; movep < end; movep++, sortv++)
+ if (*sortv < *(sortv + 1))
+ {
+ *(movep + 1) = temp;
+ done = 0;
+ }
+ }
+ while (!done);
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42249.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42249.c
new file mode 100644
index 000000000..21708749d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42249.c
@@ -0,0 +1,37 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling -fsel-sched-pipelining" } */
+
+typedef struct TypHeader
+{
+ unsigned long size;
+ struct TypHeader **ptr;
+} *TypHandle;
+
+extern TypHandle NewBag (unsigned int type, unsigned long size);
+typedef unsigned long TypPoint32;
+
+TypHandle
+QuoPP (TypHandle hdL, TypHandle hdR)
+{
+ TypHandle hdC;
+ unsigned long degC;
+ TypPoint32 *ptC;
+ unsigned long degL;
+ TypPoint32 *ptL;
+ unsigned long degR;
+ TypPoint32 *ptR;
+ unsigned long p;
+
+ degL = ((hdL)->size) / sizeof (TypPoint32);
+ degR = ((hdR)->size) / sizeof (TypPoint32);
+ degC = degL < degR ? degR : degL;
+ hdC = NewBag (9, (unsigned long) (degC * sizeof (TypPoint32)));
+ ptC = (TypPoint32 *) ((TypHandle *) ((hdC)->ptr));
+
+ for (p = 0; p < degC; p++)
+ ptC[(((p) < (degR)) ? (ptR)[(p)] : (p))] =
+ ((((((p) < (degL)) ? (ptL)[(p)] : (p))) <
+ (degR)) ? (ptR)[((((p) < (degL)) ? (ptL)[(p)] : (p)))]
+ : ((((p) < (degL)) ? (ptL)[(p)] : (p))));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42250.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42250.c
new file mode 100644
index 000000000..3ba8e8413
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42250.c
@@ -0,0 +1,68 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-struct-reorg" } */
+
+extern double log10 (double __x);
+extern double ceil (double __x);
+extern double floor (double __x);
+extern void free (void *__ptr);
+extern void *my_malloc (unsigned int);
+extern int num_rr_nodes;
+static float get_cblock_trans (int *num_inputs_to_cblock,
+ int max_inputs_to_cblock,
+ float trans_cblock_to_lblock_buf,
+ float trans_sram_bit);
+static float trans_per_mux (int num_inputs, float trans_sram_bit);
+void
+count_routing_transistors (int num_switch, float R_minW_nmos,
+ float R_minW_pmos)
+{
+ int *num_inputs_to_cblock;
+ int iswitch, i, j, iseg, max_inputs_to_cblock;
+ float input_cblock_trans;
+ const float trans_sram_bit = 6.;
+ float trans_cblock_to_lblock_buf;
+ input_cblock_trans =
+ get_cblock_trans (num_inputs_to_cblock, max_inputs_to_cblock,
+ trans_cblock_to_lblock_buf, trans_sram_bit);
+}
+
+static float
+get_cblock_trans (int *num_inputs_to_cblock, int max_inputs_to_cblock,
+ float trans_cblock_to_lblock_buf, float trans_sram_bit)
+{
+ float *trans_per_cblock;
+ float trans_count;
+ int i, num_inputs;
+
+ trans_per_cblock =
+ (float *) my_malloc ((max_inputs_to_cblock + 1) * sizeof (float));
+ for (i = 1; i <= max_inputs_to_cblock; i++)
+ trans_per_cblock[i] =
+ trans_per_mux (i, trans_sram_bit) + trans_cblock_to_lblock_buf;
+ for (i = 0; i < num_rr_nodes; i++)
+ {
+ num_inputs = num_inputs_to_cblock[i];
+ trans_count += trans_per_cblock[num_inputs];
+ }
+ free (trans_per_cblock);
+ return (trans_count);
+}
+
+static float
+trans_per_mux (int num_inputs, float trans_sram_bit)
+{
+ int nlevels, ilevel, current_inps;
+ float ntrans = 0;
+
+ if (num_inputs <= 1)
+ return (0);
+ nlevels = ceil (log10 (num_inputs) / log10 (2.) - 0.00001);
+ current_inps = num_inputs;
+ for (ilevel = 1; ilevel <= nlevels; ilevel++)
+ {
+ ntrans += 2 * floor (current_inps / 2.);
+ current_inps = ceil (current_inps / 2.);
+ }
+ ntrans += trans_sram_bit * nlevels;
+ return (ntrans);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42388.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42388.c
new file mode 100644
index 000000000..ad97eb4d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42388.c
@@ -0,0 +1,67 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling -fmodulo-sched" } */
+
+enum rtx_code
+{
+ INSN, ADDR_VEC, ADDR_DIFF_VEC, CALL_INSN, CODE_LABEL, BARRIER, NOTE
+};
+typedef union rtunion_def
+{
+ int rtint;
+ char *rtstr;
+ struct rtx_def *rtx;
+ struct rtvec_def *rtvec;
+}
+rtunion;
+typedef struct rtx_def
+{
+ unsigned short code;
+ rtunion fld[1];
+}
+ *rtx;
+typedef struct rtvec_def
+{
+ unsigned num_elem;
+ rtunion elem[1];
+}
+ *rtvec;
+extern rtx emit_barrier (void);
+extern rtx emit_note (char *);
+
+static void
+copy_loop_body (rtx *map)
+{
+ int i;
+ rtx insn, copy;
+ rtx pat = copy->fld[3].rtx;
+
+ switch (insn->code)
+ {
+ case INSN:
+ if (insn->fld[7].rtx)
+ {
+ }
+ else if (pat->code == ADDR_VEC || pat->code == ADDR_DIFF_VEC)
+ {
+ int diff_vec_p = pat->code == ADDR_DIFF_VEC;
+ int len = pat->fld[diff_vec_p].rtvec->num_elem;
+ for (i = 0; i < len; i++)
+ pat->fld[diff_vec_p].rtvec->elem[i].rtx->fld[5].rtint++;
+ }
+ case CALL_INSN:
+ for (i = 0; i < 64; i++)
+ map[i] = 0;
+ case CODE_LABEL:
+ case BARRIER:
+ copy = emit_barrier ();
+ case NOTE:
+ copy = emit_note ("x");
+ }
+}
+void
+unroll_loop (int insn_count, rtx *map)
+{
+ if (insn_count > 50)
+ copy_loop_body (map);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42389.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42389.c
new file mode 100644
index 000000000..c398012f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42389.c
@@ -0,0 +1,87 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling -fsel-sched-pipelining -fsched-pressure" } */
+
+struct s_linked_f_pointer
+{
+ struct s_linked_f_pointer *next;
+ float *fptr;
+};
+struct s_trace
+{
+ int index;
+};
+struct s_rr_cost
+{
+ float base_cost;
+ float acc_cost;
+};
+extern int num_nets;
+extern struct s_trace **trace_head;
+extern struct s_rr_cost *rr_cost;
+struct s_rr_route
+{
+ float cost;
+};
+static int heap_tail;
+extern struct s_linked_f_pointer *rr_modified_head;
+extern struct s_rr_route *rr_route;
+
+void
+empty_heap (void)
+{
+ heap_tail = 1;
+}
+
+void
+reset_path_costs (void)
+{
+ struct s_linked_f_pointer *mod_ptr;
+ if (rr_modified_head != ((void *) 0))
+ {
+ mod_ptr = rr_modified_head;
+ while (mod_ptr->next != ((void *) 0))
+ {
+ *(mod_ptr->fptr) = 1.e30;
+ mod_ptr = mod_ptr->next;
+ }
+ rr_modified_head = ((void *) 0);
+ }
+}
+
+static void
+route_net (int inet)
+{
+ int i;
+ for (i = 1; i < inet; i++)
+ reset_path_costs ();
+ empty_heap ();
+ reset_path_costs ();
+}
+
+void
+pathfinder_update_one_cost (int inet, float pres_fac, float acc_fac)
+{
+ struct s_trace *tptr;
+ int inode = 0;
+
+ tptr = trace_head[inet];
+ inode = tptr->index;
+ rr_route[inode].cost = rr_cost[inode].base_cost + rr_cost[inode].acc_cost;
+}
+
+int
+try_route (int n, float x, float y)
+{
+ int inet, itry;
+ float pres_fac;
+ for (itry = 1; itry <= n; itry++)
+ {
+ for (inet = 0; inet < num_nets; inet++)
+ {
+ route_net (inet);
+ pathfinder_update_one_cost (inet, pres_fac, x);
+ }
+ pres_fac *= y;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42396.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42396.c
new file mode 100644
index 000000000..b3b7e4e2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42396.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -ftracer -fsched2-use-superblocks" } */
+
+static int i;
+extern void baz(int);
+void foo() { i = 3; }
+void bar() { baz(i ? 2 : 1); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42427.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42427.c
new file mode 100644
index 000000000..cb43dd2af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42427.c
@@ -0,0 +1,22 @@
+/* { dg-do assemble { target c99_runtime } } */
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions -fpeel-loops" } */
+/* { dg-add-options c99_runtime } */
+/* { dg-require-effective-target ilp32 } */
+
+#include <complex.h>
+
+extern double myabs (complex double);
+
+void
+test (double *help, complex double *wm, long nz)
+{
+ long k;
+ double znew;
+ double zold;
+ for (k = 0; k < nz; k++)
+ {
+ znew = myabs (wm[k]);
+ zold = help[k];
+ help[k] = znew;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42461.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42461.c
new file mode 100644
index 000000000..0518bfd97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42461.c
@@ -0,0 +1,14 @@
+/* PR rtl-optimization/42461 */
+/* Reported by Patrick Pelissier <patrick.pelissier@gmail.com> */
+
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern int link_failure (int) __attribute__ ((pure));
+
+int main (void)
+{
+ if (link_failure (0) < 1)
+ __builtin_unreachable ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42475.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42475.c
new file mode 100644
index 000000000..a5edffa78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42475.c
@@ -0,0 +1,28 @@
+/* PR rtl-optimization/42475 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef struct { float x, y; } B;
+typedef struct { float z; } C;
+typedef struct { B b; C c; } D;
+
+B
+foo (float x, float y)
+{
+ B b = { .x = x, .y = y };
+ return b;
+}
+
+B
+bar (B b, B y)
+{
+ return foo (y.x + b.x, b.y);
+}
+
+B
+baz (D p)
+{
+ D d = { };
+ B y = bar (foo (0, (p.c.z) / 2), d.b);
+ return y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42611.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42611.c
new file mode 100644
index 000000000..19e0b2bc0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42611.c
@@ -0,0 +1,19 @@
+/* PR other/42611 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#define L \
+ (sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__ \
+ : sizeof (__SIZE_TYPE__) == sizeof (short) ? __SHRT_MAX__ \
+ : sizeof (__SIZE_TYPE__) == sizeof (int) ? __INT_MAX__ \
+ : sizeof (__SIZE_TYPE__) == sizeof (long) ? __LONG_MAX__ \
+ : sizeof (__SIZE_TYPE__) == sizeof (long long) ? __LONG_LONG_MAX__ \
+ : __INTMAX_MAX__)
+struct S { int a; char b[L]; }; /* { dg-error "type .struct S. is too large" } */
+
+void
+foo (void)
+{
+ struct S s;
+ asm volatile ("" : : "r" (&s));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42629.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42629.c
new file mode 100644
index 000000000..a5eeb0cc1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42629.c
@@ -0,0 +1,29 @@
+/* This failed -fcompare-debug because register pressure computation
+ took debug insns into account. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fsched-pressure -fschedule-insns -fcompare-debug" } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int lzo_adler32(int adler, char *buf)
+{
+ int s1 = adler;
+ int s2 = adler;
+ s1 += buf[0];
+ s2 += s1;
+ s1 += buf[1];
+ s2 += s1;
+ s1 += buf[2];
+ s2 += s1;
+ s1 += buf[3];
+ s2 += s1;
+ s1 += buf[4];
+ s2 += s1;
+ s1 += buf[5];
+ s2 += s1;
+ s1 += buf[6];
+ s2 += s1;
+ s1 += buf[7];
+ s2 += s1;
+ return (s2 << 16) + s1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42630.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42630.c
new file mode 100644
index 000000000..5685637a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42630.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fvariable-expansion-in-unroller -funroll-loops -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int sum(int *buf, int len)
+{
+ int s = 0;
+ while (--len > 0) s += *buf++;
+ return s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42631.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42631.c
new file mode 100644
index 000000000..18fb67d1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42631.c
@@ -0,0 +1,24 @@
+/* The function below expands to a loop whose latch block starts with
+ a PHI node and the corresponding debug stmt. In RTL, there are no
+ PHI nodes, but the debug insn that references the incoming k
+ remains, even though one of the incoming edges has it
+ uninitialized. After unrolling, however, the debug insn becomes
+ unconditional, and this exposed a problem in the webizer. Because
+ DF doesn't combine the uses of an uninitialized pseudo into a
+ single UD chain, we created a separate web for each use.
+ Allocating separate registers or stack slots for each uninitialized
+ use is wasteful, but the problem became more apparent in
+ -fcompare-debug tests: register numbers went out of sync, and could
+ have caused codegen differences depending on whether or not the
+ debug insns were present. The fix was to arrange for web to
+ combine uninitialized uses into a single web. */
+
+/* { dg-do compile } */
+/* { dg-options "-g -O1 -funroll-loops -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+void foo()
+{
+ unsigned k;
+ while (--k > 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42662.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42662.c
new file mode 100644
index 000000000..6f416e826
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42662.c
@@ -0,0 +1,48 @@
+/* PR debug/42662 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+
+struct S { unsigned long s[17]; };
+
+static inline void
+foo (struct S *r, struct S *a, unsigned n)
+{
+ unsigned b = n / 8;
+ r->s[0] = (b >= 1 ? : a->s[1 - b]);
+}
+
+static inline void
+bar (struct S *r, struct S *a)
+{
+ r->s[0] = a->s[0] << 1;
+}
+
+static inline void
+baz (struct S *r, struct S *a, struct S *b)
+{
+ unsigned c = 0;
+ int i;
+ for (i = 0; i < 3; ++i)
+ {
+ unsigned long d = a->s[i];
+ long e = d + b->s[i];
+ if (c)
+ ++e == 0;
+ c = e < d;
+ r->s[i] = e;
+ }
+}
+
+void
+test (struct S *r, int s, int d)
+{
+ struct S u;
+ if (s)
+ {
+ bar (&u, r);
+ foo (r, r, 3);
+ baz (r, r, &u);
+ }
+ u.s[0] = d;
+ baz (r, r, &u);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42685.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42685.c
new file mode 100644
index 000000000..29d6381cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42685.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -funroll-loops -fcompare-debug" } */
+
+struct S {
+ int i;
+};
+
+extern void baz(int);
+
+static inline void bar(struct S *s)
+{
+ baz(s->i);
+}
+
+void foo(int *w, int cond, struct S *s)
+{
+ int i, n = 0;
+ while (*w++ != 0) n++;
+ for (i = 0; i < n; i++)
+ if (cond == 0)
+ bar(s + i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42715.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42715.c
new file mode 100644
index 000000000..72bdfc862
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42715.c
@@ -0,0 +1,59 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-fPIC -g -O2 -w" } */
+/* var-tracking failed to clobber the reg holding v at the asm insn,
+ so v ended up bound to an intermediate PIC expression. */
+
+struct A { unsigned a1; char a2[15]; };
+struct B { long b1; unsigned char b2; long b3; };
+struct C { void *c1; unsigned c2; unsigned c3; };
+
+static struct A v1;
+struct A *const v2 = &v1;
+
+static inline
+int foo (void)
+{
+ int *v;
+ __asm__ __volatile__ ("" : "=r" (v));
+ return v[1];
+}
+
+static void
+bar (struct C *x)
+{
+ if (x->c2 == x->c3 && x->c1)
+ f1 (foo (), x->c1, x->c3 * sizeof (x->c1[0]));
+}
+
+void
+baz (struct B *y)
+{
+ int i;
+ const char *j;
+ char *k;
+ char x[64];
+ for (i = 0; i < sizeof (struct B); i++, y)
+ {
+ switch (y->b2)
+ {
+ case 0x20:
+ if (__builtin_strchr (j, '='))
+ continue;
+ }
+ switch (y->b2)
+ {
+ case 0x80:
+ bar (&x);
+ f2 (y->b3);
+ case 0x2e:
+ case 0x4e:
+ break;
+ default:
+ if (v2->a1)
+ f2 (y->b2);
+ }
+ k[0] = '\0';
+ if (v2->a1)
+ f2 (y->b1);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42719.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42719.c
new file mode 100644
index 000000000..06adf52a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42719.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/42719 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int *v;
+
+void
+foo (int a)
+{
+ int i, j;
+ for (j = i = a; i != -1; j = i, i = v[i])
+ ;
+ v[j] = v[a];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42728.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42728.c
new file mode 100644
index 000000000..8bd7b06ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42728.c
@@ -0,0 +1,12 @@
+/* PR debug/42728 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+void
+foo (char *a)
+{
+ char *b;
+ for (; *a; a++)
+ a = b++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42889.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42889.c
new file mode 100644
index 000000000..b518b2057
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42889.c
@@ -0,0 +1,14 @@
+/* PR rtl-optimization/42889 */
+/* { dg-do compile } */
+/* { dg-options "-O -fgcse -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+extern int A[], B[];
+
+int
+foo (int x, int c, int i)
+{
+ if (A[i] && B[i])
+ x = x % ((c & 4) ? 8 : 4);
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42916.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42916.c
new file mode 100644
index 000000000..c2e69e361
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42916.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -funroll-loops -ftree-vectorize -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int seed;
+
+static inline int hash(const char *str)
+{
+ int h = seed++;
+ int i = 12;
+ while (i--)
+ h += (h << 3) ^ *str++;
+ return h;
+}
+
+void f(const char *str, int *h)
+{
+ int i = 6;
+ while (i--)
+ *h++ = hash(str);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42918.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42918.c
new file mode 100644
index 000000000..8a3eef5ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42918.c
@@ -0,0 +1,21 @@
+/* PR debug/42918 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug -ftracer" } */
+
+extern int fi (void);
+extern void fv (void);
+
+int
+f (int i, int j)
+{
+ if (!j)
+ {
+ fv ();
+ goto lab;
+ }
+ i = fi ();
+ if (i == j)
+ fv ();
+lab:
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr42963.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr42963.c
new file mode 100644
index 000000000..8664b0d84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr42963.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cfg" } */
+extern void foo (void);
+extern int i;
+void
+bar (void)
+{
+ switch (i)
+ {
+ case 0:
+ foo ();
+ break;
+ case 1:
+ break;
+ }
+
+
+ switch (i)
+ {
+ case 0:
+ foo ();
+ break;
+ case 1:
+ break;
+ }
+}
+/* { dg-final { scan-tree-dump-times "case 1:" 0 "cfg" } } */
+/* { dg-final { cleanup-tree-dump "cfg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43058.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43058.c
new file mode 100644
index 000000000..bba6f814a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43058.c
@@ -0,0 +1,21 @@
+/* PR debug/43058 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+/* { dg-timeout-factor 4 } */
+
+extern void *f1 (void *, void *, void *);
+extern void *f2 (const char *, int, int, int, void *(*) ());
+extern void *f3 (const char *);
+extern void *f4 (void *s);
+extern void *f5 (void *);
+
+void test (void)
+{
+#define X1 f1 (f2 ("a", 1, 0, 0, f5), \
+ f4 (({ const char *a = "b"; f3 (a); })), \
+ ({ const char *a = "c"; f3 (a); }));
+#define X2 X1 X1 X1 X1 X1 X1 X1 X1 X1 X1
+#define X3 X2 X2 X2 X2 X2 X2 X2 X2 X2 X2
+#define X4 X3 X3 X3 X3 X3 X3 X3 X3 X3 X3
+ X4 X4
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43082.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43082.c
new file mode 100644
index 000000000..a6e004616
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43082.c
@@ -0,0 +1,10 @@
+/* Test that the compiler does not crash when void expressions are
+ found inside conditional expressions. PR c/43082. */
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+ if (x ? (void)(0) : (void)(1)) /* { dg-error "void value not ignored as it ought to be" } */
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43084.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43084.c
new file mode 100644
index 000000000..df5510071
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43084.c
@@ -0,0 +1,17 @@
+/* PR debug/43084 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fipa-struct-reorg -fwhole-program -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+struct S
+{
+ int a;
+};
+
+int
+main ()
+{
+ struct S s;
+ struct S *p = &s;
+ return p->a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43139.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43139.c
new file mode 100644
index 000000000..4dc725bcc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43139.c
@@ -0,0 +1,59 @@
+/* PR target/43139 */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-g -O2 -fpic" } */
+
+typedef double T1[10];
+typedef double T2[10][10];
+typedef int T3[10];
+
+void __attribute__((noinline))
+fn1 (void)
+{
+ asm volatile ("" : : : "memory");
+}
+
+void __attribute__((noinline))
+fn2 (int x, ...)
+{
+ asm volatile ("" : : "r" (x) : "memory");
+}
+
+static void
+bar (double v, double w, double x, double y, double z)
+{
+ double a;
+ if (v / w < 200.0)
+ {
+ a = x + (y - x) * __builtin_exp (-v / w);
+ fn2 (0);
+ fn2 (1, a * 20.2 / z, z);
+ fn1 ();
+ }
+}
+
+static void
+baz (T2 u, T2 v, T2 t, T2 x, T1 y, T3 z, double q, int j, int k)
+{
+ int i = z[k];
+ if (u[i][j] > 0.0)
+ bar (q, x[i][j], v[i][j], t[i][j], y[i]);
+}
+
+static T2 a, b, c, d;
+static T1 e;
+static T3 f;
+
+void __attribute__((noinline))
+test (int j, int k, double q)
+{
+ baz (a, b, c, d, e, f, q, j, k);
+}
+
+int
+main (void)
+{
+ d[0][6] = 1.0;
+ a[0][6] = 2.0;
+ test (6, 7, 400.0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43157.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43157.c
new file mode 100644
index 000000000..c06f98ac0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43157.c
@@ -0,0 +1,20 @@
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-require-linker-plugin "" } */
+/* { dg-options "-O1 -flto -fuse-linker-plugin" } */
+
+#define LABEL3(pfx, x) # pfx x
+#define LABEL2(pfx, x) LABEL3(pfx, x)
+#define LABEL(x) LABEL2(__USER_LABEL_PREFIX__, x)
+
+unsigned int factorial_ (unsigned int) __asm__ (LABEL ("factorial"));
+
+unsigned int factorial (unsigned int i)
+{
+ return i > 1 ? i * factorial_ (i - 1) : 1;
+}
+
+int main (void)
+{
+ return factorial (5);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43211.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43211.c
new file mode 100644
index 000000000..1549619ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43211.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+struct T;
+
+struct S {
+ void (*bar)(struct S);
+};
+
+void bar(struct T t) {} /* { dg-error "" } */
+
+void foo(struct S *s)
+{
+ s->bar = bar;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43213.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43213.c
new file mode 100644
index 000000000..d12fb22b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43213.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+struct S {
+ int i;
+};
+
+struct S f(int i)
+{
+ return *(struct S *)&i;
+}
+
+/* { dg-final { scan-assembler-not "memmove" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43280.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43280.c
new file mode 100644
index 000000000..dfb369b5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43280.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-O2" } */
+
+#include <stdint.h>
+
+extern void abort (void);
+
+uint64_t __attribute__((noinline))
+byteswap64(uint64_t x)
+{
+ uint32_t a = x >> 32;
+ uint32_t b = (uint32_t) x;
+ return ((uint64_t) ((((((b)) >> (8)) | (((b)) << (32 - (8)))) & 0xff00ff00L)
+ | (((((b)) << (8)) | (((b)) >> (32 - (8)))) & 0x00ff00ffL)) << 32)
+ | (uint64_t) ((((((a)) >> (8)) | (((a)) << (32 - (8)))) & 0xff00ff00L)
+ | (((((a)) << (8)) | (((a)) >> (32 - (8)))) & 0x00ff00ffL));
+}
+
+int
+main ()
+{
+ uint64_t in = (uint64_t)0x01020304 << 32 | 0x05060708;
+ uint64_t cmp = (uint64_t)0x08070605 << 32 | 0x04030201;
+
+ if (cmp != byteswap64 (in))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43299.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43299.c
new file mode 100644
index 000000000..d71c89689
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43299.c
@@ -0,0 +1,28 @@
+/* PR debug/43299 */
+/* { dg-do assemble } */
+/* { dg-options "-g -O2" } */
+
+extern void *emit_insn (void *);
+
+__attribute__((noinline))
+void *gen_load_locked_si (void *x, void *y)
+{
+ return x;
+}
+
+__attribute__((noinline))
+void *gen_load_locked_di (void *x, void *y)
+{
+ return x;
+}
+
+void
+emit_load_locked (int mode, void *reg, void *mem)
+{
+ void * (*fn) (void *, void *) = ((void *)0);
+ if (mode == 9)
+ fn = gen_load_locked_si;
+ else if (mode == 10)
+ fn = gen_load_locked_di;
+ emit_insn (fn (reg, mem));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43300.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43300.c
new file mode 100644
index 000000000..a3d66fe70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43300.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -w" } */
+/* { dg-options "-Os -w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
+
+typedef float V2SF __attribute__ ((vector_size (128)));
+
+V2SF
+foo (int x, V2SF a)
+{
+ V2SF b;
+ if (x & 42)
+ b = a;
+ else
+ b = a + (V2SF) {1.0f/0.0f - 1.0f/0.0f, 1.0f/0.0f - 1.0f/0.0f};
+ while (x--)
+ a += b;
+
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43305.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43305.c
new file mode 100644
index 000000000..c8aeaf23c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43305.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -ffast-math" } */
+extern int ilogbl(long double);
+extern int printf(const char *format, ...);
+
+__attribute__((noinline, noclone))
+int foo(long double x)
+{
+ return ilogbl(x);
+}
+
+int main()
+{
+ printf("%d\n", foo(100));
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43317.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43317.c
new file mode 100644
index 000000000..cc5832aee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43317.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-struct-reorg -fwhole-program -g" } */
+
+extern void *malloc(__SIZE_TYPE__);
+
+struct S {
+ int i;
+};
+
+int main(int argc, char *argv[])
+{
+ int i = argc;
+ struct S *p = malloc(sizeof (struct S));
+ return p[i].i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43379.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43379.c
new file mode 100644
index 000000000..da4e6ba67
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43379.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -w" } */
+
+void *foo(int i, int *p)
+{
+lab:
+ if (p) *p = i;
+ goto *p;
+ return &&lab;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43402.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43402.c
new file mode 100644
index 000000000..e6ef2d7d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43402.c
@@ -0,0 +1,60 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -fno-inline" } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort (void);
+
+static int something;
+
+static int * converterData[2]={
+ &something, &something,
+};
+
+static struct {
+ const char *name;
+ int type;
+} const cnvNameType[] = {
+ { "bocu1", 1 },
+ { "utf7", 1 },
+ { "utf8", 1 }
+};
+
+
+const int * getAlgorithmicTypeFromName(const char *realName);
+const int *
+getAlgorithmicTypeFromName(const char *realName)
+{
+ unsigned mid, start, limit;
+ unsigned lastMid;
+ int result;
+ start = 0;
+ limit = sizeof(cnvNameType)/sizeof(cnvNameType[0]);
+ mid = limit;
+ lastMid = 0xffffffff;
+
+ for (;;) {
+ mid = (start + limit) / 2;
+ if (lastMid == mid) { /* Have we moved? */
+ break; /* We haven't moved, and it wasn't found. */
+ }
+ lastMid = mid;
+ result = __builtin_strcmp(realName, cnvNameType[mid].name);
+
+ if (result < 0) {
+ limit = mid;
+ } else if (result > 0) {
+ start = mid;
+ } else {
+ return converterData[cnvNameType[mid].type];
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ if (!getAlgorithmicTypeFromName ("utf8"))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43419.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43419.c
new file mode 100644
index 000000000..a4306f048
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43419.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+/* { dg-add-options ieee } */
+#include <math.h>
+
+extern void abort (void);
+void __attribute__((noinline)) f (double x)
+{
+ double pluszero = pow (x, 0.5);
+ double minuszero = sqrt (x);
+ if (signbit (pluszero) == signbit (minuszero))
+ abort ();
+}
+
+int main(void)
+{
+ f (-0.0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43513.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43513.c
new file mode 100644
index 000000000..78a037b59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43513.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp2" } */
+
+void bar (int *);
+void foo (char *, int);
+
+void
+foo3 ()
+{
+ const int kIterations = 10;
+ int results[kIterations];
+ int i;
+ bar (results);
+ for (i = 0; i < kIterations; i++)
+ foo ("%d ", results[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "alloca" 0 "ccp2"} } */
+/* { dg-final { cleanup-tree-dump "ccp2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43557-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43557-1.c
new file mode 100644
index 000000000..5ba467d01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43557-1.c
@@ -0,0 +1,19 @@
+/* PR debug/43557 */
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -g -O2" } */
+/* { dg-additional-sources "pr43557-2.c" } */
+
+struct S
+{
+ int v;
+} g;
+
+void
+f1 (void)
+{
+ struct S *s = &g;
+ s->v = 0;
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43557-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43557-2.c
new file mode 100644
index 000000000..890e68e15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43557-2.c
@@ -0,0 +1,10 @@
+/* PR debug/43557 */
+/* { dg-do compile } */
+
+extern struct S g;
+
+void
+f2 (void)
+{
+ &g;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43562.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43562.c
new file mode 100644
index 000000000..352c107a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43562.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O0" } */
+/* { dg-do compile } */
+
+extern unsigned foo (void);
+extern void bar (void);
+
+__attribute__ ((optimize ("O2")))
+void bak ()
+{
+ unsigned a;
+ while (1)
+ {
+ a = foo ();
+ while (a)
+ {
+ a &= 1;
+ bar ();
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43564.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43564.c
new file mode 100644
index 000000000..39e0f3ac3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43564.c
@@ -0,0 +1,16 @@
+/* { dg-options "-O0" } */
+/* { dg-do compile } */
+
+static inline __attribute__ ((__always_inline__))
+unsigned __clz (unsigned input)
+{
+ unsigned output;
+ __asm__ __volatile__ ("clz %0, %1":"=r" (output):"r" (input));
+}
+__attribute__ ((optimize ("O2")))
+void foo ()
+{
+ unsigned a;
+ unsigned b;
+ a = __clz (b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43643.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43643.c
new file mode 100644
index 000000000..b0c57c0a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43643.c
@@ -0,0 +1,25 @@
+/* Contributed by Jürgen Keil <jrgn.keil@googlemail.com> */
+
+/* { dg-do run } */
+/* { dg-require-profiling "-pg" } */
+/* { dg-options "-O2 -pg" } */
+/* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
+
+extern char *strdup (const char *);
+
+void
+func(char *a, char *b, char *c)
+{
+ strdup(a);
+ strdup(b);
+ strdup(c);
+}
+
+int
+main(void)
+{
+ func("a", "b", "c");
+ return 0;
+}
+
+/* { dg-final { cleanup-profile-file } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43670.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43670.c
new file mode 100644
index 000000000..19504b728
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43670.c
@@ -0,0 +1,30 @@
+/* PR debug/43670 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vrp -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+extern void abort (void);
+
+typedef struct { double T1; } S;
+
+void
+foo (void)
+{
+ int i, j;
+ double s;
+
+ S y[2][2];
+ S *x[2] = { y[0], y[1] };
+ S **p = x;
+
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ p[j][i].T1 = 1;
+
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ s = p[j][i].T1;
+
+ if (s != 1)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43730.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43730.c
new file mode 100644
index 000000000..0d91aef1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43730.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+extern int (isinfl)(long double);
+
+int
+bugfun(long double x, long double y)
+{
+ int result;
+
+ if (isinfl(x))
+ result = isinfl(y);
+ else
+ {
+ int kx, ky;
+ kx = ky = 1;
+ result = (kx == ky);
+ }
+ return (result);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-2.c
new file mode 100644
index 000000000..f00fff9fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int
+f (int c, int b, int d)
+{
+ int r, e;
+
+ if (c)
+ r = b + d;
+ else
+ {
+ e = b + d;
+ r = e;
+ }
+
+ return r;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
+/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-not "Invalid sum" "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-3.c
new file mode 100644
index 000000000..c4954e1bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-3.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+/* Commutative case. */
+
+int f(int c, int b, int d)
+{
+ int r, e;
+
+ if (c)
+ r = b + d;
+ else
+ {
+ e = d + b;
+ r = e;
+ }
+
+ return r;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
+/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-not "Invalid sum" "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-4.c
new file mode 100644
index 000000000..42adfeefe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43864-4.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+/* Different stmt order. */
+
+int f(int c, int b, int d)
+{
+ int r, r2, e;
+
+ if (c)
+ {
+ r = b + d;
+ r2 = d - b;
+ }
+ else
+ {
+ r2 = d - b;
+ e = d + b;
+ r = e;
+ }
+
+ return r - r2;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
+/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times " - " 2 "pre"} } */
+/* { dg-final { scan-tree-dump-not "Invalid sum" "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43864.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43864.c
new file mode 100644
index 000000000..8d1e989fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43864.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+extern void foo (char*, int);
+extern void mysprintf (char *, char *);
+extern void myfree (void *);
+extern int access (char *, int);
+extern int fopen (char *, int);
+
+char *
+hprofStartupp (char *outputFileName, char *ctx)
+{
+ char fileName[1000];
+ int fp;
+ mysprintf (fileName, outputFileName);
+ if (access (fileName, 1) == 0)
+ {
+ myfree (ctx);
+ return 0;
+ }
+
+ fp = fopen (fileName, 0);
+ if (fp == 0)
+ {
+ myfree (ctx);
+ return 0;
+ }
+
+ foo (outputFileName, fp);
+
+ return ctx;
+}
+
+/* { dg-final { scan-tree-dump-times "myfree \\(" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-not "Invalid sum" "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr43971.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr43971.c
new file mode 100644
index 000000000..9091fc273
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr43971.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fno-delete-null-pointer-checks" } */
+
+union ktime {
+ long tv64;
+};
+typedef union ktime ktime_t;
+ktime_t
+do_one_initcall(ktime_t rettime, ktime_t calltime)
+{
+ ktime_t delta;
+ delta = ({ (ktime_t){ .tv64 = (rettime).tv64 - (calltime).tv64 }; });
+ return delta;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44012.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44012.c
new file mode 100644
index 000000000..bd255ba08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44012.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fgcse" } */
+
+extern void fe ();
+
+extern int i;
+
+static inline void
+FX (void (*f) ())
+{
+ fe ();
+ (*f) ();
+}
+
+static inline void
+f4 ()
+{
+ for (;;)
+ switch (i)
+ {
+ case 306:
+ FX (&fe);
+ break;
+ default:
+ return;
+ }
+}
+
+static inline void
+f3 ()
+{
+ f4 ();
+ for (;;)
+ switch (i)
+ {
+ case 267:
+ FX (&f4);
+ break;
+ default:
+ return;
+ }
+}
+
+static inline void
+f2 ()
+{
+ f3 ();
+ while (i)
+ FX (&f3);
+}
+
+void
+f1 ()
+{
+ f2 ();
+ while (1)
+ FX (&f2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44023.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44023.c
new file mode 100644
index 000000000..344ca28c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44023.c
@@ -0,0 +1,48 @@
+/* PR debug/44023 */
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug -O2" } */
+/* { dg-options "-fcompare-debug -O2 -mcpu=ev67" { target alpha*-*-* } } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+void
+foo (unsigned f, long v, unsigned *w, unsigned a, unsigned b, unsigned e, unsigned c, unsigned d)
+{
+ unsigned h = v / 4, x[16];
+ while (f < h)
+ {
+ unsigned i;
+ f++;
+ a |= (a >> 30);
+ d = (d << 30) | ((unsigned) d >> 30);
+ c = (c << 30) | ((unsigned) c >> 30);
+ b = 30 | ((unsigned) b >> 30);
+ d += a = (a << 30) | ((unsigned) a >> 2);
+ c += ((d << 5) | (d >> 27)) + ((e & (a ^ b))) + 0x5a827999 + x[12];
+ a += (c & e);
+ c = 30 | ((unsigned) c);
+ i = x[5] ^ x[7] ^ x[8] ^ x[3];
+ x[5] = (i << 1) | ((unsigned) i >> 31);
+ i = x[6] ^ x[2] ^ x[14] ^ x[13];
+ x[6] = (i << 1) | (i >> 31);
+ b += (c | (c >> 5)) + (d ^ e) + 0x6ed9eba1 + (x[7] = (i << 1) | ((unsigned) i >> 31));
+ x[8] = i | 1;
+ e += (a | 5) + b + (i = x[9] ^ x[6], x[10] = (i << (unsigned) i));
+ e = 30 | ((unsigned) e >> 30);
+ i = x[12] ^ x[14] ^ x[12] ^ x[12], (x[12] = 1 | ((unsigned) i));
+ i = x[13] ^ x[5] ^ x[10], (x[13] = (i << (unsigned) 1));
+ i = x[2] ^ x[7] ^ x[12], (x[15] = i | ((unsigned) i >> 1));
+ i = x[2] ^ x[0] ^ x[13], (x[0] = (i << 1) | 31);
+ e = (e << 30) | 2;
+ i = x[14] ^ x[2] ^ x[15], (x[2] = i | 1);
+ x[3] = i | ((unsigned) i);
+ i = x[14] ^ x[12] ^ x[4], (x[4] = 1 | ((unsigned) i >> 1));
+ x[5] = i | 1;
+ e = (e << 30) | 30;
+ b += (5 | ((unsigned) e >> 5)) + 0x8f1bbcdc + (x[9] = (i | ((unsigned) i >> 1)));
+ i = x[2] ^ (x [10] = ((i << 1) | (i >> 1)));
+ x[13] = (i | ((unsigned) i >> 1));
+ (i = x[14] ^ x[0] ^ x[14], (x[14] = ((i << 1) | 31)));
+ a = *w += a;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44024.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44024.c
new file mode 100644
index 000000000..f5d72d55f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44024.c
@@ -0,0 +1,14 @@
+/* { dg-do link } */
+/* { dg-options "-fdelete-null-pointer-checks -fdump-tree-original" } */
+
+void foo();
+
+int main()
+{
+ if (foo == (void *)0)
+ link_error ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "foo" "original" { target { ! avr*-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44028.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44028.c
new file mode 100644
index 000000000..33452172b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44028.c
@@ -0,0 +1,22 @@
+/* PR debug/44028 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcompare-debug" } */
+/* { dg-options "-O3 -fsched-pressure -fschedule-insns -fcompare-debug" { target i?86-*-* x86_64-*-* } } */
+
+struct S { int val[16]; };
+
+static inline int
+bar (struct S x)
+{
+ long double pc = 0;
+ int i;
+ for (i = 0; i < 16; i++)
+ pc += x.val[i];
+ return pc;
+}
+
+int
+foo (struct S x)
+{
+ return bar (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44061.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44061.c
new file mode 100644
index 000000000..60a4260ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44061.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+int a[2];
+int foo (int q)
+{
+ if (__builtin_constant_p (q))
+ {
+ if (q == 4)
+ return a[4]; /* { dg-bogus "array subscript is above array bounds" } */
+ else
+ return a[0];
+ }
+ else
+ return a[q];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44136.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44136.c
new file mode 100644
index 000000000..31f192461
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44136.c
@@ -0,0 +1,27 @@
+/* PR debug/44136 */
+/* { dg-do compile } */
+/* { dg-options "-w -O2 -g" } */
+/* { dg-options "-w -Wno-psabi -O2 -g -mno-sse" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#define vector __attribute((vector_size(16)))
+vector float a;
+
+float
+foo (float b)
+{
+ vector float c = { 0, 0, 0, 0 };
+ vector float d = { 0, 0, 0, 0 };
+ d += c;
+ return ((float *)&c)[2];
+}
+
+float
+bar (vector float a, int b, vector float c)
+{
+ vector float e = c * a;
+ a = (vector float) { 0, 0, 0, 0 };
+ c = (vector float) { 0, 0, 0, 0 };
+ float d = ((float *)&a)[0];
+ float f = ((float *)&c)[0];
+ return d * f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44194-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44194-1.c
new file mode 100644
index 000000000..7e9d0aead
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44194-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile { target { { { { { { i?86-*-* x86_64-*-* } && x32 } || lp64 } && { ! s390*-*-* } } && { ! hppa*64*-*-* } } && { ! alpha*-*-* } } } } */
+/* { dg-options "-O2 -fdump-rtl-dse1 -fdump-rtl-final" } */
+
+/* Restrict to 64-bit targets since 32-bit targets usually return small
+ structures in memory. */
+
+struct ints { int a, b, c; } foo();
+void bar(int a, int b);
+
+void func() {
+ struct ints s = foo();
+ bar(s.a, s.b);
+}
+
+/* { dg-final { scan-rtl-dump "global deletions = (2|3)" "dse1" } } */
+/* { dg-final { cleanup-rtl-dump "dse1" } } */
+
+/* Here we want to ignore frame-related instructions, marked as insn/f,
+ that do things like store the link register to the stack. We also want
+ to treat insns the same regardless of whether they have a scheduling
+ :TI marker, so match both "insn " and "insn:". */
+/* { dg-final { scan-rtl-dump-not "insn\[: \]\[^\n\]*set \\(mem(?!\[^\n\]*scratch)" "final" } } */
+/* { dg-final { cleanup-rtl-dump "final" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44194-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44194-2.c
new file mode 100644
index 000000000..b127e1b33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44194-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-dse1" } */
+
+struct ints { int a, b, c; } foo();
+void bar(int a, int b);
+
+void func() {
+ volatile struct ints s = foo();
+ bar(s.a, s.b);
+}
+/* { dg-final { scan-rtl-dump "global deletions = 0" "dse1" } } */
+/* { dg-final { cleanup-rtl-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-1.c
new file mode 100644
index 000000000..28194e48f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -freciprocal-math -fdump-tree-ccp1" } */
+
+typedef double v2df __attribute__ ((vector_size (2 * sizeof (double))));
+
+void do_div (v2df *a, v2df *b)
+{
+ *a = *b / (v2df) { 2.0, 3.0 };
+}
+
+/* Constant folding should multiply *b by the reciprocals of the
+ vector elements. The fold does not take place for generic
+ vectors until the first CCP pass. The string " * " occurs 3
+ times: one multiply and two indirect parameters. */
+
+/* { dg-final { scan-tree-dump-times " \\\* " 3 "ccp1" } } */
+/* { dg-final { scan-tree-dump-times " / " 0 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-2.c
new file mode 100644
index 000000000..7e8581a2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -freciprocal-math -fdump-tree-original" } */
+
+void do_div (_Complex double *a, _Complex double *b)
+{
+ *a = *b / (4.0 - 5.0fi);
+}
+
+/* Constant folding should multiply *b by the reciprocal of 4 - 5i
+ = 4/41 + (5/41)i. */
+
+/* { dg-final { scan-tree-dump-times " \\\* " 1 "original" } } */
+/* { dg-final { scan-tree-dump-times " / " 0 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-3.c
new file mode 100644
index 000000000..a0eb35b1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44214-3.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp1" } */
+
+typedef double v2df __attribute__ ((vector_size (2 * sizeof (double))));
+
+void do_div (v2df *a, v2df *b)
+{
+ *a = *b / (v2df) { 2.0, 2.0 };
+}
+
+/* Since 2.0 has an exact reciprocal, constant folding should multiply *b
+ by the reciprocals of the vector elements. As a result there should be
+ one vector multiply and zero divides in the optimized code. The fold
+ does not take place for generic vectors until the first CCP pass. The
+ string " * " occurs 3 times: one multiply and two indirect parameters. */
+
+/* { dg-final { scan-tree-dump-times " \\\* " 3 "ccp1" } } */
+/* { dg-final { scan-tree-dump-times " / " 0 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44290-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44290-1.c
new file mode 100644
index 000000000..071a27104
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44290-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target arm*-*-* avr-*-* mcore-*-* rx-*-* spu-*-* } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static void __attribute__((naked))
+foo(void *from, void *to)
+{
+ asm volatile("dummy"::"r"(from), "r"(to));
+}
+
+unsigned int fie[2];
+
+void fum(void *to)
+{
+ foo(fie, to);
+}
+
+/* { dg-final { scan-tree-dump "foo \\\(void \\\* from, void \\\* to\\\)" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44290-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44290-2.c
new file mode 100644
index 000000000..1951a519d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44290-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target arm*-*-* avr-*-* mcore-*-* rx-*-* spu-*-* } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static unsigned long __attribute__((naked))
+foo (unsigned long base)
+{
+ asm volatile ("dummy");
+}
+unsigned long
+bar (void)
+{
+ static int start, set;
+
+ if (!set)
+ {
+ set = 1;
+ start = foo (0);
+ }
+
+ return foo (start);
+}
+
+/* { dg-final { scan-tree-dump "foo \\\(long unsigned int base\\\)" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44337.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44337.c
new file mode 100644
index 000000000..57e054924
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44337.c
@@ -0,0 +1,10 @@
+/* PR middle-end/44337 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-dce -fno-tree-dse -w" } */
+
+void
+foo (void)
+{
+ _Complex float v[1];
+ v[1] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44393.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44393.c
new file mode 100644
index 000000000..906d5932a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44393.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -ftree-loop-distribution" } */
+
+int i;
+void foo ()
+{
+ int **pp = 0, *p = 0;
+ while (--i)
+ {
+ *p++ = 0;
+ *pp++ = p;
+ }
+ i = *p;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44404.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44404.c
new file mode 100644
index 000000000..a0b4ceb98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44404.c
@@ -0,0 +1,35 @@
+/* PR rtl-optimization/44404
+ foo() used to be miscompiled on ARM due to a bug in auto-inc-dec.c,
+ which resulted in "strb r1, [r1], #-36". */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-unroll-loops" } */
+
+extern char *strcpy (char *, const char *);
+extern int strcmp (const char*, const char*);
+extern void abort (void);
+
+char buf[128];
+
+void __attribute__((noinline))
+bar (int a, const char *p)
+{
+ if (strcmp (p, "0123456789abcdefghijklmnopqrstuvwxyz") != 0)
+ abort ();
+}
+
+void __attribute__((noinline))
+foo (int a)
+{
+ if (a)
+ bar (0, buf);
+ strcpy (buf, "0123456789abcdefghijklmnopqrstuvwxyz");
+ bar (0, buf);
+}
+
+int
+main (void)
+{
+ foo (0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44485.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44485.c
new file mode 100644
index 000000000..82f05f8ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44485.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/44485 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -funsafe-math-optimizations" } */
+
+unsigned short b;
+int bar (unsigned);
+
+void
+baz (void)
+{
+ if (bar (0))
+ for (b = 0; b < 30; b++)
+ ;
+}
+
+int
+bar (unsigned z)
+{
+ unsigned short c;
+ for (; ; z += 1)
+l1:
+ if (z)
+ goto l2;
+l2:
+ for (z = 0; z < 9; z++)
+ if (z)
+ goto l1;
+ for (c = 0; c; c = (__UINTPTR_TYPE__) baz)
+ ;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44509.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44509.c
new file mode 100644
index 000000000..7c50bd0fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44509.c
@@ -0,0 +1,9 @@
+/* PR bootstrap/44509 */
+/* { dg-do compile } */
+/* { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" } */
+
+double
+foo (void)
+{
+ return __DBL_MAX__ - __FLT_MAX__;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44539.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44539.c
new file mode 100644
index 000000000..9cfff7a3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44539.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/44539 */
+/* { dg-do compile } */
+/* { dg-options "-ftracer -freorder-blocks -O2" } */
+
+void bar (int file);
+extern int baz (void);
+
+void noret1 ()
+{
+ bar (0);
+ __builtin_exit (0);
+}
+
+void noret2 ()
+{
+ __builtin_exit (0);
+}
+
+void bar (int i)
+{
+ if (baz ())
+ noret1 (i);
+}
+
+void foo (int i)
+{
+ if (~i) bar (i);
+ i ? noret1 () : noret2 ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44545.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44545.c
new file mode 100644
index 000000000..51983ef76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44545.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fnon-call-exceptions -ftrapv -fexceptions" } */
+int
+DrawChunk(int *tabSize, int x)
+{
+ const int numEnds = 10;
+ int ends[numEnds + 2];
+ if (*tabSize > 0) {
+ x -= 5;
+ x = (x + *tabSize) / *tabSize;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44606.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44606.c
new file mode 100644
index 000000000..392977553
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44606.c
@@ -0,0 +1,52 @@
+/* PR target/44606 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <stdio.h>
+
+extern void abort (void);
+
+ typedef struct _PixelPacket { unsigned char r, g, b; }
+ PixelPacket;
+#define ARRAYLEN(X) (sizeof(X)/sizeof(X[0]))
+PixelPacket q[6];
+#define COLS (ARRAYLEN(q) - 1)
+PixelPacket p[2*COLS + 22];
+#define Minify(POS, WEIGHT) do { \
+ total_r += (WEIGHT)*(p[POS].r); \
+ total_g += (WEIGHT)*(p[POS].g); \
+ total_b += (WEIGHT)*(p[POS].b); \
+} while (0)
+unsigned long columns = COLS;
+int main(void)
+{
+ static const unsigned char answers[COLS] = { 31, 32, 34, 35, 36 };
+ unsigned long x;
+ for (x = 0; x < sizeof(p)/sizeof(p[0]); x++) {
+ p[x].b = (x + 34) | 1;
+ }
+ for (x = 0; x < columns; x++) {
+ double total_r = 0, total_g = 0, total_b = 0;
+ double saved_r = 0, saved_g = 0, saved_b = 0;
+ Minify(2*x + 0, 3.0);
+ Minify(2*x + 1, 7.0);
+ Minify(2*x + 2, 7.0);
+ saved_r = total_r;
+ saved_g = total_g;
+ Minify(2*x + 11, 15.0);
+ Minify(2*x + 12, 7.0);
+ Minify(2*x + 18, 7.0);
+ Minify(2*x + 19, 15.0);
+ Minify(2*x + 20, 15.0);
+ Minify(2*x + 21, 7.0);
+ q[x].r = (unsigned char)(total_r/128.0 + 0.5);
+ q[x].g = (unsigned char)(total_g/128.0 + 0.5);
+ q[x].b = (unsigned char)(total_b/128.0 + 0.5);
+ fprintf(stderr, "r:%f g:%f b:%f\n", saved_r, saved_g, saved_b);
+ }
+ for (x = 0; x < COLS; x++) {
+ if (answers[x] != q[x].b)
+ abort();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44674.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44674.c
new file mode 100644
index 000000000..c71b49ea5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44674.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fprofile-generate" } */
+/* { dg-require-profiling "-fprofile-generate" } */
+
+void
+jumpfunc (void *p)
+{
+ void *l = &&jumplabel;
+jumplabel:
+ __builtin_memcpy (p, l, 1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44699.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44699.c
new file mode 100644
index 000000000..601cc78f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44699.c
@@ -0,0 +1,157 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+typedef long unsigned int size_t;
+typedef long int intmax_t;
+typedef long unsigned int uintmax_t;
+extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+extern const char *trim_filename (const char *);
+
+static __inline void *
+__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
+{
+ return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
+}
+
+typedef unsigned int hashval_t;
+typedef hashval_t (*htab_hash) (const void *);
+typedef int (*htab_eq) (const void *, const void *);
+typedef void (*htab_del) (void *);
+typedef int (*htab_trav) (void **, void *);
+typedef void *(*htab_alloc) (size_t, size_t);
+typedef void (*htab_free) (void *);
+
+typedef void *(*htab_alloc_with_arg) (void *, size_t, size_t);
+typedef void (*htab_free_with_arg) (void *, void *);
+struct htab {
+ htab_hash hash_f;
+ htab_eq eq_f;
+ htab_del del_f;
+ void ** entries;
+ size_t size;
+ size_t n_elements;
+ size_t n_deleted;
+ unsigned int searches;
+ unsigned int collisions;
+ htab_alloc alloc_f;
+ htab_free free_f;
+ void * alloc_arg;
+ htab_alloc_with_arg alloc_with_arg_f;
+ htab_free_with_arg free_with_arg_f;
+ unsigned int size_prime_index;
+};
+
+typedef struct htab *htab_t;
+enum insert_option {NO_INSERT, INSERT};
+extern void * htab_find (htab_t, const void *);
+extern void ** htab_find_slot (htab_t, const void *, enum insert_option);
+
+enum mode_class { MODE_RANDOM, MODE_CC, MODE_INT, MODE_PARTIAL_INT, MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_FLOAT, MODE_DECIMAL_FLOAT, MODE_COMPLEX_INT, MODE_COMPLEX_FLOAT, MODE_VECTOR_INT, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM, MODE_VECTOR_FLOAT, MAX_MODE_CLASS };
+
+static const char *const mode_class_names[MAX_MODE_CLASS] =
+{
+ "MODE_RANDOM", "MODE_CC", "MODE_INT", "MODE_PARTIAL_INT", "MODE_FRACT", "MODE_UFRACT", "MODE_ACCUM", "MODE_UACCUM", "MODE_FLOAT", "MODE_DECIMAL_FLOAT", "MODE_COMPLEX_INT", "MODE_COMPLEX_FLOAT", "MODE_VECTOR_INT", "MODE_VECTOR_FRACT", "MODE_VECTOR_UFRACT", "MODE_VECTOR_ACCUM", "MODE_VECTOR_UACCUM", "MODE_VECTOR_FLOAT"
+};
+struct mode_data
+{
+ struct mode_data *next;
+
+ const char *name;
+ enum mode_class cl;
+ unsigned int precision;
+ unsigned int bytesize;
+ unsigned int ncomponents;
+ unsigned int alignment;
+ const char *format;
+
+ struct mode_data *component;
+ struct mode_data *wider;
+ struct mode_data *wider_2x;
+
+ struct mode_data *contained;
+
+ struct mode_data *next_cont;
+
+ const char *file;
+ unsigned int line;
+ unsigned int counter;
+ unsigned int ibit;
+ unsigned int fbit;
+};
+
+static struct mode_data *modes[MAX_MODE_CLASS];
+static unsigned int n_modes[MAX_MODE_CLASS];
+static struct mode_data *void_mode;
+
+static const struct mode_data blank_mode = {
+ 0, "<unknown>", MAX_MODE_CLASS,
+ -1U, -1U, -1U, -1U,
+ 0, 0, 0, 0, 0, 0,
+ "<unknown>", 0, 0, 0, 0
+};
+
+static htab_t modes_by_name;
+
+static __inline__ struct mode_data *
+find_mode (const char *name)
+{
+ struct mode_data key;
+
+ key.name = name;
+ return (struct mode_data *) htab_find (modes_by_name, &key);
+}
+
+static struct mode_data *
+new_mode (enum mode_class cl, const char *name,
+ const char *file, unsigned int line)
+{
+ struct mode_data *m;
+ static unsigned int count = 0;
+
+ m = find_mode (name);
+ if (m)
+ {
+ error ("%s:%d: duplicate definition of mode \"%s\"",
+ trim_filename (file), line, name);
+ error ("%s:%d: previous definition here", m->file, m->line);
+ return m;
+ }
+
+ m = ((struct mode_data *) xmalloc (sizeof (struct mode_data)));
+ ((__builtin_object_size (m, 0) != (size_t) -1) ? __builtin___memcpy_chk (m, &blank_mode, sizeof (struct mode_data), __builtin_object_size (m, 0)) : __inline_memcpy_chk (m, &blank_mode, sizeof (struct mode_data)));
+ m->cl = cl;
+ m->name = name;
+ if (file)
+ m->file = trim_filename (file);
+ m->line = line;
+ m->counter = count++;
+
+ m->next = modes[cl];
+ modes[cl] = m;
+ n_modes[cl]++;
+
+ *htab_find_slot (modes_by_name, m, INSERT) = m;
+
+ return m;
+}
+
+static void
+make_int_mode (const char *name,
+ unsigned int precision, unsigned int bytesize,
+ const char *file, unsigned int line)
+{
+ struct mode_data *m = new_mode (MODE_INT, name, file, line);
+ m->bytesize = bytesize;
+ m->precision = precision;
+}
+
+static void
+create_modes (void)
+{
+make_int_mode ("HI", -1U, 2, "../../work/gcc/machmode.def", 182);
+}
+
+int
+main (int argc, char **argv)
+{
+ create_modes ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44838.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44838.c
new file mode 100644
index 000000000..61608ed0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44838.c
@@ -0,0 +1,33 @@
+/* PR rtl-optimization/44838 */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+extern void abort ();
+
+void
+foo (int *a, int n)
+{
+ int *lasta = a + n;
+ for (; a != lasta; a++)
+ {
+ *a *= 2;
+ a[1] = a[-1] + a[-2];
+ }
+}
+
+int a[16];
+int ref[16] = { 0, 1, 4, 2, 10, 12, 24, 44,
+ 72, 136, 232, 416, 736, 1296, 2304, 2032 };
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ a[i] = i;
+ foo (a + 2, 16 - 3);
+ for (i = 0; i < 16; i++)
+ if (ref[i] != a[i])
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44964.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44964.c
new file mode 100644
index 000000000..1df1bde07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44964.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fkeep-inline-functions -O" } */
+
+static inline __attribute__ ((const))
+void baz (int i)
+{
+}
+
+static __attribute__ ((always_inline))
+inline __attribute__ ((flatten))
+void bar (void)
+{
+ baz (0);
+}
+
+void
+foo (void)
+{
+ bar ();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44971.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44971.c
new file mode 100644
index 000000000..431445809
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44971.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug -w" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+typedef struct
+{
+ int default_screen;
+} *_XPrivint;
+typedef int FcBool;
+typedef struct
+{
+ struct _XftintInfo *next;
+} XftintInfo;
+int _XftintInfo;
+
+void _XftintInfoGet (int * dpy, FcBool createIfNecessary)
+{
+ int event_base;
+ &event_base
+ && dpy[createIfNecessary] != 0;
+}
+
+void _XftCloseint (int dpy, XftintInfo * info,XftintInfo * *prev)
+{
+ _XftintInfoGet (dpy, 0);
+ for (prev = &_XftintInfo; info = *prev; prev = &(*prev)->next)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr44974.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr44974.c
new file mode 100644
index 000000000..a16c55833
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr44974.c
@@ -0,0 +1,23 @@
+/* PR middle-end/44974 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-optimize-sibling-calls" } */
+
+extern void foo (int status) __attribute__ ((__noreturn__,__noinline__));
+extern void bar (int status) __attribute__ ((__noreturn__,__noinline__));
+extern void _Exit (int status) __attribute__ ((__noreturn__,__noinline__));
+
+void
+foo (int status)
+{
+ _Exit (status);
+}
+
+void
+_Exit (int status)
+{
+ bar (status);
+}
+
+/* { dg-final { scan-assembler "call\[^\n\]*_Exit" { target i?86-*-* x86_64-*-* ia64-*-* sparc*-*-* } } } */
+/* { dg-final { scan-assembler "bl\[^\n\]*_Exit" { target powerpc*-*-* } } } */
+/* { dg-final { scan-assembler "brasl\[^\n\]*_Exit" { target { s390*-*-* && lp64 } } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45055.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45055.c
new file mode 100644
index 000000000..899de5049
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45055.c
@@ -0,0 +1,42 @@
+/* PR debug/45055 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug" } */
+/* { dg-require-effective-target scheduling } */
+
+int colormap[10];
+
+extern int bar ();
+
+void
+foo (int *img, int fp, int y, int *ptr, int depth, int c, int t, int xm)
+{
+ int x, color, count;
+ for (; y; y--)
+ {
+ if (depth)
+ {
+ count = bar ();
+ for (x = xm; x; x--)
+ {
+ if (c != 1)
+ count = color = -1;
+ if (count == 0)
+ color = count = bar ();
+ if (color)
+ t = bar (fp);
+ *ptr++ = colormap[t];
+ }
+ }
+ switch (*img)
+ {
+ case 1:
+ bar ();
+ case 3:
+ case -1:
+ case -3:
+ bar ();
+ case -4:
+ bar ();
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45071.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45071.c
new file mode 100644
index 000000000..d1715db1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45071.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vrp -ftree-vectorize" } */
+
+struct A
+{
+ int i;
+};
+
+struct B
+{
+ struct A a;
+};
+
+extern void f4 (void *);
+
+inline void
+f3 (struct A *a)
+{
+ f4 (a);
+ while (a->i);
+}
+
+static inline void
+f2 (struct B *b)
+{
+ f3 (&b->a);
+}
+
+void
+f1 ()
+{
+ struct B *b = 0;
+ f2 (b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45079.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45079.c
new file mode 100644
index 000000000..1ef02ff78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45079.c
@@ -0,0 +1,10 @@
+/* PR c/45079 */
+/* { dg-do compile } */
+
+void
+foo (const char *p, int cond, int a, int b)
+{
+ p[cond ? a : b] = '\0'; /* { dg-error "assignment of read-only location" } */
+}
+
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45083.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45083.c
new file mode 100644
index 000000000..c9a4dbfe1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45083.c
@@ -0,0 +1,25 @@
+/* PR tree-optimization/45083 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+struct S { char *a; unsigned b; unsigned c; };
+extern int foo (const char *);
+extern void bar (int, int);
+
+static void
+baz (void)
+{
+ struct S cs[1]; /* { dg-message "was declared here" } */
+ switch (cs->b) /* { dg-warning "cs\[^\n\r\]*\\.b\[^\n\r\]*is used uninitialized" } */
+ {
+ case 101:
+ if (foo (cs->a)) /* { dg-warning "cs\[^\n\r\]*\\.a\[^\n\r\]*may be used uninitialized" } */
+ bar (cs->c, cs->b); /* { dg-warning "cs\[^\n\r\]*\\.c\[^\n\r\]*may be used uninitialized" } */
+ }
+}
+
+void
+test (void)
+{
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45101.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45101.c
new file mode 100644
index 000000000..d9615725a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45101.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/45101 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fgcse -fgcse-las" } */
+
+struct
+{
+ int i;
+} *s;
+
+extern void bar (void);
+
+void foo ()
+{
+ !s ? s->i++ : bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45105.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45105.c
new file mode 100644
index 000000000..a93a21f9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45105.c
@@ -0,0 +1,27 @@
+/* PR debug/45105 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fcompare-debug" } */
+
+extern int *baz (int *, int *);
+
+void
+bar (int *p1, int *p2)
+{
+ int n = *baz (0, 0);
+ p1[n] = p2[n];
+}
+
+void
+foo (int *p, int l)
+{
+ int a1[32];
+ int a2[32];
+ baz (a1, a2);
+ while (l)
+ {
+ if (l & 1)
+ p = baz (a2, p);
+ l--;
+ bar (a1, a2);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45107.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45107.c
new file mode 100644
index 000000000..05dbec321
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45107.c
@@ -0,0 +1,13 @@
+/* PR rtl-optimization/45107 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fgcse-las" } */
+
+extern void bar(int *);
+
+int foo (int *p)
+{
+ int i = *p;
+ if (i != 1)
+ bar(&i);
+ *p = i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45259.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45259.c
new file mode 100644
index 000000000..3b8d6bd17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45259.c
@@ -0,0 +1,43 @@
+/* PR debug/45259 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -w -fpic" { target fpic } } */
+/* { dg-options "-g -O2 -w" { target { ! fpic } } } */
+
+struct S { void (*bar) (long); };
+struct T { struct S *t; };
+int w;
+extern int baz (int);
+
+void
+foo (int x, int u, char *z)
+{
+ struct T *v;
+ static void *y[256] = { &&l1, &&l2 };
+ for (;;)
+ switch (x)
+ {
+ l2:
+ x = 9;
+ case 9:
+ goto *y[*z++];
+ case 10:
+ case 27:
+ case 54:
+ case 99:
+ case 100:
+ case 120:
+ case 122:
+ case 131:
+ case 132:
+ case 134:
+ case 141:
+ case 142:
+ v->t->bar (u);
+ v->t->bar (u);
+ case 143:
+ continue;
+ l1:
+ default:
+ baz (w);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-1.c
new file mode 100644
index 000000000..3b092cd13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O3 -fschedule-insns -fschedule-insns2 -fselective-scheduling2 -fsel-sched-pipelining -funroll-loops -fprefetch-loop-arrays" } */
+
+void main1 (float *pa, float *pc)
+{
+ int i;
+ float b[256];
+ float c[256];
+ for (i = 0; i < 256; i++)
+ b[i] = c[i] = pc[i];
+ for (i = 0; i < 256; i++)
+ pa[i] = b[i] * c[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-2.c
new file mode 100644
index 000000000..eed384717
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O1 -freorder-blocks -fschedule-insns2 -funswitch-loops -fselective-scheduling2 -fsel-sched-pipelining -funroll-all-loops" } */
+void
+foo1 (int *s)
+{
+ s[0] = s[1];
+ while (s[6] - s[8])
+ {
+ s[6] -= s[8];
+ if (s[8] || s[0])
+ {
+ s[3] += s[0];
+ s[4] += s[1];
+ }
+ s[7]++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-3.c
new file mode 100644
index 000000000..ce7879f86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45352-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O -fprofile-generate -fgcse -fno-gcse-lm -fgcse-sm -fno-ivopts -fno-tree-loop-im -ftree-pre -funroll-loops -fno-web -fschedule-insns2 -fselective-scheduling2 -fsel-sched-pipelining" } */
+
+extern volatile float f[];
+
+void foo (void)
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f[i] = 0;
+ for (i = 0; i < 100; i++)
+ f[i] = 0;
+ for (i = 0; i < 100; i++)
+ if (f[i])
+ __builtin_abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45352.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45352.c
new file mode 100644
index 000000000..75f9a2137
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45352.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-Os -fselective-scheduling2 -fsel-sched-pipelining -fprofile-generate" } */
+
+static inline void
+bmp_iter_next (int *bi, int *bit_no)
+{
+ *bi >>= 1;
+ *bit_no += 1;
+}
+
+int bmp_iter_set (int *bi, int *bit_no);
+void bitmap_initialize_stat (int, ...);
+void bitmap_clear (void);
+
+void
+df_md_alloc (int bi, int bb_index, void *bb_info)
+{
+ for (; bmp_iter_set (&bi, &bb_index); bmp_iter_next (&bi, &bb_index))
+
+ if (bb_info)
+ bitmap_clear ();
+ else
+ bitmap_initialize_stat (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45353.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45353.c
new file mode 100644
index 000000000..0d704f8d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45353.c
@@ -0,0 +1,10 @@
+/* PR rtl-optimization/45353 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fschedule-insns -fselective-scheduling" } */
+/* { dg-require-effective-target scheduling } */
+
+void
+foo ()
+{
+ __builtin_unreachable ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45415.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45415.c
new file mode 100644
index 000000000..12d9fc0f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45415.c
@@ -0,0 +1,68 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-dominator-opts" } */
+
+typedef unsigned long int st;
+typedef unsigned long long dt;
+typedef union
+{
+ dt d;
+ struct
+ {
+ st h, l;
+ }
+ s;
+} t_be;
+
+typedef union
+{
+ dt d;
+ struct
+ {
+ st l, h;
+ }
+ s;
+} t_le;
+
+#define df(f, t) \
+int \
+f (t afh, t bfh) \
+{ \
+ t hh; \
+ t hp, lp, dp, m; \
+ st ad, bd; \
+ int s; \
+ s = 0; \
+ ad = afh.s.h - afh.s.l; \
+ bd = bfh.s.l - bfh.s.h; \
+ if (bd > bfh.s.l) \
+ { \
+ bd = -bd; \
+ s = ~s; \
+ } \
+ lp.d = (dt) afh.s.l * bfh.s.l; \
+ hp.d = (dt) afh.s.h * bfh.s.h; \
+ dp.d = (dt) ad *bd; \
+ dp.d ^= s; \
+ hh.d = hp.d + hp.s.h + lp.s.h + dp.s.h; \
+ m.d = (dt) lp.s.h + hp.s.l + lp.s.l + dp.s.l; \
+ return hh.s.l + m.s.l; \
+}
+
+df(f_le, t_le)
+df(f_be, t_be)
+
+void abort (void);
+void exit (int);
+main ()
+{
+ t_be x;
+ x.s.h = 0x10000000U;
+ x.s.l = 0xe0000000U;
+ if (x.d == 0x10000000e0000000ULL
+ && f_be ((t_be) 0x100000000ULL, (t_be) 0x100000000ULL) != -1)
+ abort ();
+ if (x.d == 0xe000000010000000ULL
+ && f_le ((t_le) 0x100000000ULL, (t_le) 0x100000000ULL) != -1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45416.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45416.c
new file mode 100644
index 000000000..2f013ccd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45416.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-skip-if "Skip for Thumb1." { { arm*-*-* } && { arm_thumb1_ok } } { "*" } { "" } } */
+/* { dg-options "-O2" } */
+
+int foo(long long a)
+{
+ if (a & (long long) 0x400)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-assembler "andl" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } " */
+/* { dg-final { scan-assembler-not "setne" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } }" */
+/* { dg-final { scan-assembler "and|ubfx" { target arm*-*-* } } } */
+/* { dg-final { scan-assembler-not "moveq" { target arm*-*-* } } }" */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45449.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45449.c
new file mode 100644
index 000000000..116249740
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45449.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-pre -fno-tree-pta -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+struct S
+{
+};
+
+void
+baz (void)
+{
+ struct S s;
+ &s;
+}
+
+int bar (void);
+
+void
+foo (void)
+{
+ if (bar ())
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45461.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45461.c
new file mode 100644
index 000000000..7f287bd03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45461.c
@@ -0,0 +1,18 @@
+/* PR middle-end/45461 */
+/* { dg-do compile } */
+
+#include <stdarg.h>
+
+int
+foo (int i, ...)
+{
+ short e;
+ va_list ap;
+ va_start (ap, i);
+ e = va_arg (ap, short); /* { dg-warning "is promoted" "promoted" } */
+ va_end (ap);
+ return e;
+}
+
+/* { dg-message "note: \\(so you should pass" "should pass" {target *-*-* } 12 } */
+/* { dg-message "note: if this code" "if this code" {target *-*-* } 12 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45472.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45472.c
new file mode 100644
index 000000000..573e83d70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45472.c
@@ -0,0 +1,21 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O -fschedule-insns2 -fselective-scheduling2" } */
+
+struct S
+{
+ volatile long vl;
+ int i;
+};
+struct S s1, s2;
+
+void
+foo (int j, int c)
+{
+ int i;
+ for (i = 0; i <= j; i++)
+ {
+ if (c)
+ s2.vl += s1.vl;
+ s1 = s2;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45506.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45506.c
new file mode 100644
index 000000000..e934dc93c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45506.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-g -O -w" } */
+
+typedef unsigned _GCC_ATTR_ALIGN_u32t;
+typedef _GCC_ATTR_ALIGN_u32t _Uint32t __attribute__((__aligned__(4)));
+typedef int _Intptrt __attribute__((__mode__(__pointer__)));
+typedef unsigned int _Uintptrt __attribute__((__mode__(__pointer__)));
+typedef _Intptrt ptrdiff_t;
+typedef _Uintptrt uintptr_t;
+typedef _Uint32t Elf32_Word;
+typedef struct list_head list_head_t;
+
+struct list_head {
+ list_head_t *next;
+};
+
+struct object { };
+
+struct objlist {
+ struct object *object;
+};
+
+static uintptr_t ldd(void *frame) __attribute__((__used__));
+static list_head_t *_dl_all_objects_ptr;
+static void fini_array(struct object *const obj) {
+ if ((dynvec(obj,(unsigned)26)) != ((Elf32_Word)-1)) {
+ unsigned i;
+ const unsigned funcs = (dynvec(obj,(unsigned)28)) / 4;
+ const Elf32_Word fa = (dynvec(obj,(unsigned)26));
+ const int *const p = relative_relocp(obj);
+ for (i = (funcs ? (funcs - 1) : 0U); i != 0U; i--) {
+ void (*const func)(void) = (void *) p[i];
+ (*func)();
+ }
+ }
+}
+static void _do_exit_fini(void) {
+ const struct objlist *o;
+ for (((o)) = ((void *)(((list_head_t *)(_dl_all_objects_ptr))->next));
+ !((((o))) == ((void *)((list_head_t *)(_dl_all_objects_ptr))));
+ ((o)) = ((void *)(((list_head_t *)((o)))->next)))
+ fini_array (o->object);
+}
+static uintptr_t ldd (void *frame) {
+ atexit(_do_exit_fini);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45567.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45567.c
new file mode 100644
index 000000000..5bf464407
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45567.c
@@ -0,0 +1,9 @@
+/* PR middle-end/45567 */
+/* { dg-do compile } */
+/* { dg-options "-ftree-ter" } */
+
+unsigned
+foo (char c)
+{
+ return __builtin_popcountl ((unsigned long) c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45570.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45570.c
new file mode 100644
index 000000000..8a25951fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45570.c
@@ -0,0 +1,28 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O3 -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -ftracer" } */
+void
+parser_get_next_char (char c, int qm, char *p)
+{
+ int quote_mode = 0;
+ for (; *p; p++)
+ {
+ if (qm)
+ {
+ if (quote_mode == 0 && *p == '"' && *(p - 1))
+ {
+ quote_mode = 1;
+ continue;
+ }
+ if (quote_mode && *p == '"' && *(p - 1))
+ quote_mode = 0;
+ }
+ if (quote_mode == 0 && *p == c && *(p - 1))
+ break;
+ }
+}
+
+void
+parser_get_next_parameter (char *p)
+{
+ parser_get_next_char (':', 1, p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45652.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45652.c
new file mode 100644
index 000000000..8f55f0c8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45652.c
@@ -0,0 +1,39 @@
+/* { dg-do run { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling2" } */
+
+struct S {
+ double i[2];
+};
+
+void __attribute__ ((noinline)) checkcd (struct S x)
+{
+ if (x.i[0] != 7.0 || x.i[1] != 8.0)
+ __builtin_abort ();
+}
+
+void __attribute__ ((noinline)) testvacd (int n, ...)
+{
+ int i;
+ __builtin_va_list ap;
+ __builtin_va_start (ap, n);
+ for (i = 0; i < n; i++)
+ {
+ struct S t = __builtin_va_arg (ap, struct S);
+ checkcd (t);
+ }
+ __builtin_va_end (ap);
+}
+
+void
+testitcd (void)
+{
+ struct S x = { { 7.0, 8.0 } };
+ testvacd (2, x, x);
+}
+
+int
+main ()
+{
+ testitcd ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45733.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45733.c
new file mode 100644
index 000000000..5c83cd42c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45733.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-overflow -ftree-vectorize" } */
+
+typedef __INTPTR_TYPE__ intptr_t;
+
+intptr_t
+foo (void **p, int i)
+{
+ intptr_t x = 0;
+ while (i--)
+ x ^= (intptr_t) p[i];
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45750.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45750.c
new file mode 100644
index 000000000..22c471b70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45750.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct S
+{
+ int i;
+};
+
+int invalid[] = 0; /* { dg-error "invalid initializer" } */
+
+void foo (void)
+{
+ if (((struct S *)undeclared)->i); /* { dg-error "undeclared" } */
+}
+
+/* { dg-message "reported only once" "" { target *-*-* } 13 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45819.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45819.c
new file mode 100644
index 000000000..4979fd328
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45819.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -w" } */
+
+struct ehci_regs {
+ char x;
+ unsigned int port_status[0];
+} __attribute__ ((packed));
+
+struct ehci_hcd {
+ struct ehci_regs *regs;
+};
+
+int ehci_hub_control (struct ehci_hcd *ehci, int wIndex)
+{
+ unsigned int *status_reg = &ehci->regs->port_status[wIndex];
+ return *(volatile unsigned int *)status_reg;
+}
+
+/* { dg-final { scan-tree-dump "={v}" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45865.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45865.c
new file mode 100644
index 000000000..6edea3147
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45865.c
@@ -0,0 +1,28 @@
+/* PR rtl-optimization/45865 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+
+typedef union tree_node *tree;
+enum ix86_builtin_type {
+ IX86_BT_LAST_VECT,
+ IX86_BT_LAST_PTR
+};
+extern const enum ix86_builtin_type ix86_builtin_type_ptr_base[];
+extern tree build_qualified_type (tree, int);
+extern tree build_pointer_type (tree);
+tree
+ix86_get_builtin_type (enum ix86_builtin_type tcode, unsigned int index)
+{
+ tree type, itype;
+ int quals;
+ if (tcode <= IX86_BT_LAST_PTR)
+ quals = 0x0;
+ else
+ quals = 0x1;
+ itype = ix86_get_builtin_type (ix86_builtin_type_ptr_base[index],
+ index);
+ if (quals != 0x0)
+ itype = build_qualified_type (itype, quals);
+ type = build_pointer_type (itype);
+ return type;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr45991.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr45991.c
new file mode 100644
index 000000000..eefce4429
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr45991.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-overflow" } */
+
+struct S
+{
+ int i;
+};
+
+char A[64];
+
+void foo (char **dst, int i)
+{
+ char *p = A + 16;
+ while (i--)
+ {
+ int b = ((struct S *) (&p[i * 16 + 4]))->i;
+ char *c = A + i * 16;
+ dst[i] = c + b;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46088.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46088.c
new file mode 100644
index 000000000..c0ff920ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46088.c
@@ -0,0 +1,12 @@
+/* PR target/46088 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fnon-call-exceptions -fpeel-loops" } */
+
+extern void bar (void);
+
+void
+foo (int i)
+{
+ if (i >> 3)
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46130-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46130-1.c
new file mode 100644
index 000000000..a0a582d27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46130-1.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/46130 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+#include <stdarg.h>
+
+static void
+foo (va_list ap)
+{
+ va_arg (ap, char *)[0];
+}
+
+void
+bar (va_list ap)
+{
+ foo (ap);
+}
+
+void
+baz (va_list ap)
+{
+ foo (ap);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46130-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46130-2.c
new file mode 100644
index 000000000..991e5dd18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46130-2.c
@@ -0,0 +1,32 @@
+/* PR tree-optimization/46130 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+extern int bar (int);
+
+static int foo (int x)
+{
+ int z, w;
+ if (x <= 1024)
+ {
+ z = 16;
+ w = 17;
+ }
+ else
+ {
+ bar (bar (bar (bar (bar (bar (bar (bar (bar (16)))))))));
+ if (x > 131072)
+ w = 19;
+ else
+ w = 21;
+ z = 32;
+ }
+ w = w + 121;
+ return z;
+}
+
+int
+baz (int x)
+{
+ return foo (x + 6) + foo (x + 15) + foo (x + 24);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46165.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46165.c
new file mode 100644
index 000000000..a13300e7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46165.c
@@ -0,0 +1,11 @@
+/* PR tree-optimization/46165 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce" } */
+
+extern void foo (void) __attribute__((noreturn));
+void
+g (void)
+{
+ void (*f) (void) = foo;
+ f ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46171.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46171.c
new file mode 100644
index 000000000..f43cab025
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46171.c
@@ -0,0 +1,13 @@
+/* PR debug/46171 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-dce -g" } */
+
+double bard ();
+float barf (float);
+
+void
+foo (float f)
+{
+ f = barf (f);
+ double d = bard ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46177-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46177-2.c
new file mode 100644
index 000000000..91fd20e75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46177-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-copy-prop -ftree-loop-distribution" } */
+
+int A[30], B[30];
+
+void
+foo (int j)
+{
+ int i, k;
+ for (k = 0; k < 10; k++)
+ if (j)
+ {
+ for (; j < k; j++)
+ ;
+ for (i = 0; i < k; i++)
+ A[i] = B[i] = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46177.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46177.c
new file mode 100644
index 000000000..397e31634
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46177.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-copy-prop -ftree-loop-distribution" } */
+
+extern int A[];
+extern int B[];
+
+void
+foo (int j, int c)
+{
+ int i;
+
+ if (c)
+ for (i = 0; i < j; i++)
+ A[i] = B[i] = 0;
+
+ for (i = 0; i < j; i++)
+ A[i] = B[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46184.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46184.c
new file mode 100644
index 000000000..fafa7f463
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46184.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -fno-tree-copy-prop -fno-tree-dce" } */
+
+extern int A[], B[];
+
+void
+foo (int z)
+{
+ int j, i;
+ for (j = 0; j < 32; j++)
+ {
+ int curr_a = A[0];
+ for (i = 0; i < 16; i++)
+ curr_a = A[i] ? curr_a : z;
+ B[j] = curr_a;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46212.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46212.c
new file mode 100644
index 000000000..3329ed5f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46212.c
@@ -0,0 +1,24 @@
+/* PR rtl-optimization/46212 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -funroll-loops" } */
+/* { dg-options "-O3 -funroll-loops -march=i386" { target { { i686-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target int32plus } */
+
+static inline unsigned
+foo (void *x)
+{
+ unsigned y = *(volatile unsigned *) (x);
+ return (y >> 24) | ((y >> 8) & 0xff00) | ((y & 0xff00) << 8) | (y << 24);
+}
+
+void
+bar (void *x, void *y, int z)
+{
+ unsigned c;
+ while (z--)
+ {
+ c = foo (y);
+ *(unsigned *) x = (c & 0xf80000) >> 9 | (c & 0xf800) >> 6
+ | (c & 0xf8) >> 3 | (c & 0x80000000) >> 16;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46217.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46217.c
new file mode 100644
index 000000000..bb445bb23
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46217.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int foo(int a)
+{
+ int t;
+ *(volatile int *)&t = a;
+}
+
+/* { dg-final { scan-tree-dump "={v}" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46233.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46233.c
new file mode 100644
index 000000000..8916e4bdd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46233.c
@@ -0,0 +1,11 @@
+/* PR tree-optimization/46233 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-dce" } */
+
+int
+foo ()
+{
+ int i = 0;
+ while (1)
+ i += foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46251.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46251.c
new file mode 100644
index 000000000..0eeb29fda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46251.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math" } */
+
+void foo (long double *x)
+{
+ __builtin_sincosl (*x, x, x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46252.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46252.c
new file mode 100644
index 000000000..70bf21d6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46252.c
@@ -0,0 +1,15 @@
+/* PR debug/46252 */
+/* { dg-do compile } */
+/* { dg-options "-O -frerun-cse-after-loop -fno-tree-loop-optimize -funroll-loops -fcompare-debug" } */
+
+void
+foo (float *f)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ f[i] = i;
+ bar ();
+ for (i = 0; i < 4; i++)
+ if (f[i] != i)
+ __builtin_abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46255.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46255.c
new file mode 100644
index 000000000..3a1639085
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46255.c
@@ -0,0 +1,13 @@
+/* PR debug/46255 */
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-fcompare-debug -fprofile-generate -O" } */
+
+int bar (void);
+
+void
+foo (int i)
+{
+ while (i)
+ i = bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46288.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46288.c
new file mode 100644
index 000000000..24c8874fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46288.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-dce" } */
+
+void foo (int i)
+{
+ __builtin_expect (i, i);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46307.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46307.c
new file mode 100644
index 000000000..c308b5669
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46307.c
@@ -0,0 +1,14 @@
+/* PR debug/46307 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+double fma (double, double, double);
+
+double
+foo (double x, double y, double z)
+{
+ double a = x * y + z;
+ double b = __builtin_fma (x, y, z);
+ double c = fma (x, y, z);
+ return x / y / z;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46309-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46309-2.c
new file mode 100644
index 000000000..f407e6607
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46309-2.c
@@ -0,0 +1,147 @@
+/* PR tree-optimization/46309 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc-details" } */
+
+int foo (void);
+
+void
+f1 (int a)
+{
+ _Bool v1 = (a == 3);
+ _Bool v2 = (a == 1);
+ _Bool v3 = (a == 4);
+ _Bool v4 = (a == 2);
+ if (v1 || v2 || v3 || v4)
+ foo ();
+}
+
+void
+f2 (int a)
+{
+ _Bool v1 = (a == 1);
+ _Bool v2 = (a == 2);
+ _Bool v3 = (a == 3);
+ _Bool v4 = (a == 4);
+ if (v1 || v2 || v3 || v4)
+ foo ();
+}
+
+void
+f3 (unsigned int a)
+{
+ _Bool v1 = (a <= 31);
+ _Bool v2 = (a >= 64 && a <= 95);
+ _Bool v3 = (a >= 128 && a <= 159);
+ _Bool v4 = (a >= 192 && a <= 223);
+ if (v1 || v2 || v3 || v4)
+ foo ();
+}
+
+void
+f4 (int a)
+{
+ _Bool v1 = (a == 3);
+ _Bool v2 = (a == 1);
+ _Bool v3 = (a == 4);
+ _Bool v4 = (a == 2);
+ _Bool v5 = (a == 7);
+ _Bool v6 = (a == 5);
+ _Bool v7 = (a == 8);
+ _Bool v8 = (a == 6);
+ if (v1 || v2 || v3 || v4 || v5 || v6 || v7 || v8)
+ foo ();
+}
+
+void
+f5 (int a)
+{
+ _Bool v1 = (a != 3);
+ _Bool v2 = (a != 1);
+ _Bool v3 = (a != 4);
+ _Bool v4 = (a != 2);
+ _Bool v5 = (a != 7);
+ _Bool v6 = (a != 5);
+ _Bool v7 = (a != 8);
+ _Bool v8 = (a != 6);
+ if (v1 && v2 && v3 && v4 && v5 && v6 && v7 && v8)
+ foo ();
+}
+
+void
+f6 (int a)
+{
+ _Bool v1 = (a != 3);
+ _Bool v2 = (a != 1);
+ _Bool v3 = (a != 4);
+ _Bool v4 = (a != 2);
+ _Bool v5 = (a != 7);
+ _Bool v6 = (a != 5);
+ _Bool v7 = (a != 8);
+ _Bool v8 = (a != 6);
+ if ((v1 && v2 && v3 && v4) && (v5 && v6 && v7 && v8))
+ foo ();
+}
+
+int
+f7 (int a)
+{
+ _Bool v1 = (a == 3);
+ _Bool v2 = (a == 1);
+ _Bool v3 = (a == 4);
+ _Bool v4 = (a == 2);
+ _Bool v5 = (a == 7);
+ _Bool v6 = (a == 5);
+ _Bool v7 = (a == 8);
+ _Bool v8 = (a == 6);
+ return v1 || v2 || v3 || v4 || v5 || v6 || v7 || v8;
+}
+
+_Bool
+f8 (int a)
+{
+ _Bool v1 = (a == 3);
+ _Bool v2 = (a == 1);
+ _Bool v3 = (a == 4);
+ _Bool v4 = (a == 2);
+ _Bool v5 = (a == 7);
+ _Bool v6 = (a == 5);
+ _Bool v7 = (a == 8);
+ _Bool v8 = (a == 6);
+ return v1 || v2 || v3 || v4 || v5 || v6 || v7 || v8;
+}
+
+int
+f9 (int a)
+{
+ _Bool v1 = (a != 3);
+ _Bool v2 = (a != 1);
+ _Bool v3 = (a != 4);
+ _Bool v4 = (a != 2);
+ _Bool v5 = (a != 7);
+ _Bool v6 = (a != 5);
+ _Bool v7 = (a != 8);
+ _Bool v8 = (a != 6);
+ return v1 && v2 && v3 && v4 && v5 && v6 && v7 && v8;
+}
+
+_Bool
+f10 (int a)
+{
+ _Bool v1 = (a != 3);
+ _Bool v2 = (a != 1);
+ _Bool v3 = (a != 4);
+ _Bool v4 = (a != 2);
+ _Bool v5 = (a != 7);
+ _Bool v6 = (a != 5);
+ _Bool v7 = (a != 8);
+ _Bool v8 = (a != 6);
+ return v1 && v2 && v3 && v4 && v5 && v6 && v7 && v8;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 2 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.0, 31. and -.64, 95.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.128, 159. and -.192, 223.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2. and -.3, 3. and -.4, 4. and -.5, 5. and -.6, 6. and -.7, 7. and -.8, 8.\[\n\r\]* into" 7 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests \[^\r\n\]*_\[0-9\]* -.0, 31. and -.128, 159.\[\n\r\]* into" 1 "reassoc2" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46309.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46309.c
new file mode 100644
index 000000000..bec7350ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46309.c
@@ -0,0 +1,70 @@
+/* PR tree-optimization/46309 */
+/* { dg-do compile { target { { ! logical_op_short_circuit } || { mips*-*-* avr*-*-* } } } } */
+/* { dg-options "-O2 -fdump-tree-reassoc-details" } */
+/* The transformation depends on BRANCH_COST being greater than 1
+ (see the notes in the PR), so try to force that. */
+/* { dg-additional-options "-mtune=octeon2" { target mips*-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target avr*-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int
+f1 (int a)
+{
+ int v1 = (a == 3);
+ int v2 = (a == 1);
+ int v3 = (a == 4);
+ int v4 = (a == 2);
+ return v1 || v2 || v3 || v4;
+}
+
+int
+f2 (int a)
+{
+ int v1 = (a == 1);
+ int v2 = (a == 2);
+ int v3 = (a == 3);
+ int v4 = (a == 4);
+ return v1 || v2 || v3 || v4;
+}
+
+int
+f3 (int a)
+{
+ int v1 = (a == 3);
+ int v2 = (a == 1);
+ return v1 || v2;
+}
+
+int
+f4 (int a)
+{
+ int v1 = (a == 1);
+ int v2 = (a == 2);
+ return v1 || v2;
+}
+
+int
+f5 (unsigned int a)
+{
+ int v1 = (a <= 31);
+ int v2 = (a >= 64 && a <= 95);
+ return v1 || v2;
+}
+
+int
+f6 (unsigned int a)
+{
+ int v1 = (a <= 31);
+ int v2 = (a >= 64 && a <= 95);
+ int v3 = (a >= 128 && a <= 159);
+ int v4 = (a >= 192 && a <= 223);
+ return v1 || v2 || v3 || v4;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 2 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.3, 3.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.1, 1. and -.2, 2.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.0, 31. and -.64, 95.\[\n\r\]* into" 2 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests a_\[0-9\]*.D. -.128, 159. and -.192, 223.\[\n\r\]* into" 1 "reassoc1" } } */
+/* { dg-final { scan-tree-dump-times "Optimizing range tests \[^\r\n\]*_\[0-9\]* -.0, 31. and -.128, 159.\[\n\r\]* into" 1 "reassoc2" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46315.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46315.c
new file mode 100644
index 000000000..2349284e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46315.c
@@ -0,0 +1,37 @@
+/* PR rtl-optimization/46315 */
+/* Reported by Magnus Granberg <zorry@gentoo.org> */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-strict-overflow" } */
+
+extern void abort (void);
+
+static char const *
+parse_ranged (char const *s, int digits)
+{
+ int n = 0;
+ char const *lim = s + digits;
+ while (s < lim)
+ {
+ unsigned d = *s++ - '0';
+ if (9 < d)
+ return 0;
+ n = 10 * n + d;
+ }
+ return s && 0 <= n && n <= 59 ? s : 0;
+}
+
+int main(void)
+{
+ const char *s = "10092240";
+
+ s = parse_ranged (s, 2);
+ s = parse_ranged (s, 2);
+ s = parse_ranged (s, 2);
+ s = parse_ranged (s, 2);
+
+ if (!s || *s != '\0')
+ abort();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46355.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46355.c
new file mode 100644
index 000000000..e644ec584
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46355.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-distribution -fstrict-overflow" } */
+
+void
+foo (int *dest, int i, int u, int v)
+{
+ int j = i;
+ while (i)
+ {
+ dest[j--] = v;
+ dest[j--] = u;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46375.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46375.c
new file mode 100644
index 000000000..0126bc93d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46375.c
@@ -0,0 +1,16 @@
+/* PR debug/46375 */
+/* Reported by Zdenek Sojka <zsojka@seznam.cz> */
+/* { dg-do compile } */
+/* { dg-options "-fgcse -fno-tree-dominator-opts -fcompare-debug -O" } */
+
+void bar (void);
+
+void
+foo (int **pp)
+{
+ int *p = 0;
+ if (pp)
+ p = *pp;
+ if (p && *p)
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46387.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46387.c
new file mode 100644
index 000000000..e06bd3b10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46387.c
@@ -0,0 +1,32 @@
+/* PR debug/46387 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+
+struct S { double x; double y; short z; };
+int a = 0, b = 0, c;
+void bar (int, int, int);
+void baz (int *, int *, int *);
+
+void
+foo (struct S *v)
+{
+ int x, y, z;
+ if (!a && b != 0)
+ return;
+ if (v->z)
+ baz (&x, &y, &z);
+ else
+ {
+ x = v->x;
+ y = v->y;
+ }
+ x = x / (5 + 1);
+ y = y / (5 + 1);
+ if (x < 0)
+ x = 0;
+ if (x > c - 1)
+ x = c - 1;
+ if (b == 0)
+ bar (x, y, 1);
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46440.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46440.c
new file mode 100644
index 000000000..12a999703
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46440.c
@@ -0,0 +1,25 @@
+/* PR rtl-optimization/46440 */
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-protector -fno-tree-dominator-opts -fno-tree-fre" } */
+/* { dg-require-effective-target fstack_protector } */
+
+int i;
+
+void bar (char *);
+
+void
+foo (void)
+{
+ void *l;
+ char c[64];
+ bar (c);
+ i = 1;
+ if (i)
+ l = &&l1;
+ else
+ l = &&l2;
+ goto *l;
+l2:
+ __builtin_abort ();
+l1:;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46494.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46494.c
new file mode 100644
index 000000000..29f96856b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46494.c
@@ -0,0 +1,9 @@
+/* { dg-do compile }
+/* { dg-options "-O -fno-tree-ccp -fno-tree-fre -ftree-vrp" } */
+
+extern void foo (void) __attribute__((noreturn));
+void g (void)
+{
+ void (*f) (void) = foo;
+ f ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46499-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46499-1.c
new file mode 100644
index 000000000..9815272e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46499-1.c
@@ -0,0 +1,31 @@
+/* PR middle-end/46499 */
+/* { dg-do run } */
+/* { dg-options "-O -fno-omit-frame-pointer -fno-tree-ccp -fno-tree-dominator-opts -finline-small-functions" } */
+
+extern void abort (void);
+
+int count = 0;
+
+int
+foo (void)
+{
+ count++;
+ return 0;
+}
+
+int
+bar (void)
+{
+ count++;
+ return 0;
+}
+
+int
+main ()
+{
+ if ((foo () == 1) & (bar () == 1))
+ abort ();
+ if (count != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46499-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46499-2.c
new file mode 100644
index 000000000..c3a264816
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46499-2.c
@@ -0,0 +1,19 @@
+/* PR middle-end/46499 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-ccp -fno-tree-dominator-opts" } */
+
+extern void abort (void);
+
+static inline int
+foo (void)
+{
+ return 0;
+}
+
+int
+main ()
+{
+ if ((foo () == 1) & (foo () == 1))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46521.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46521.c
new file mode 100644
index 000000000..0c41c4328
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46521.c
@@ -0,0 +1,20 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-Os -fselective-scheduling2 -fsel-sched-pipelining -fprofile-generate -fno-early-inlining" } */
+
+static void bmp_iter_next (int *bi)
+{
+ *bi >>= 1;
+}
+
+int bmp_iter_set (int *, int);
+void bitmap_clear (void);
+void bitmap_initialize_stat (void);
+
+void df_md_alloc (int bi, int bb_index, int bb_info)
+{
+ for (; bmp_iter_set (&bi, bb_index); bmp_iter_next (&bi))
+ if (bb_info)
+ bitmap_clear ();
+ else
+ bitmap_initialize_stat ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46522.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46522.c
new file mode 100644
index 000000000..13a5aa9da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46522.c
@@ -0,0 +1,33 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O3 -fkeep-inline-functions -fsel-sched-pipelining -fselective-scheduling2 -funroll-loops" } */
+
+struct S
+{
+ unsigned i, j;
+};
+
+static inline void
+bar (struct S *s)
+{
+ if (s->i++ == 1)
+ {
+ s->i = 0;
+ s->j++;
+ }
+}
+
+void
+foo1 (struct S *s)
+{
+ bar (s);
+}
+
+void
+foo2 (struct S s1, struct S s2, int i)
+{
+ while (s1.i != s2.i) {
+ if (i)
+ *(unsigned *) 0 |= (1U << s1.i);
+ bar (&s1);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46571.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46571.c
new file mode 100644
index 000000000..435812210
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46571.c
@@ -0,0 +1,122 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug -w" } */
+
+typedef union tree_node *tree;
+typedef unsigned int source_location;
+enum tree_code
+{
+ MINUS_EXPR,
+ MULT_EXPR,
+};
+struct tree_omp_clause
+{
+ union omp_clause_subcode
+ {
+ enum tree_code reduction_code;
+ } subcode;
+};
+union tree_node
+{
+ struct tree_omp_clause omp_clause;
+};
+enum tree_index
+{
+ TI_ERROR_MARK,
+};
+typedef struct
+{
+ unsigned allocatable:1;
+ unsigned dimension:1;
+ unsigned codimension:1;
+ unsigned external:1;
+ unsigned optional:1;
+ unsigned pointer:1;
+ unsigned contiguous:1;
+ unsigned referenced:1;
+} symbol_attribute;
+typedef unsigned int gfc_char_t;
+typedef struct gfc_linebuf
+{
+ source_location location;
+} gfc_linebuf;
+typedef struct
+{
+ gfc_char_t *nextc;
+ gfc_linebuf *lb;
+} locus;
+typedef struct
+{
+ struct gfc_symbol *sym;
+ struct gfc_namelist *next;
+} gfc_namelist;
+enum
+{
+ OMP_LIST_PLUS,
+ OMP_LIST_REDUCTION_FIRST = OMP_LIST_PLUS,
+ OMP_LIST_MULT,
+ OMP_LIST_SUB,
+ OMP_LIST_NUM
+};
+typedef struct gfc_omp_clauses
+{
+ gfc_namelist *lists[OMP_LIST_NUM];
+} gfc_omp_clauses;
+typedef struct gfc_symbol
+{
+ symbol_attribute attr;
+} gfc_symbol;
+typedef struct gfc_code
+{
+ locus loc;
+ union
+ {
+ gfc_omp_clauses *omp_clauses;
+ } ext;
+} gfc_code;
+typedef struct
+{
+} stmtblock_t;
+
+static tree
+gfc_trans_omp_reduction_list (gfc_namelist * namelist, tree list,
+ enum tree_code reduction_code, locus where)
+{
+ for (; namelist != ((void *) 0); namelist = namelist->next)
+ if (namelist->sym->attr.referenced)
+ {
+ tree node = build_omp_clause (where.lb->location);
+ node->omp_clause.subcode.reduction_code = reduction_code;
+ gfc_trans_omp_array_reduction (namelist->sym, where);
+ }
+}
+
+static tree
+gfc_trans_omp_clauses (stmtblock_t * block, gfc_omp_clauses * clauses,
+ locus where)
+{
+ tree omp_clauses = (tree) ((void *) 0);
+ int list;
+ for (list = 0; list < OMP_LIST_NUM; list++)
+ {
+ gfc_namelist *n = clauses->lists[list];
+ enum tree_code reduction_code;
+ if (n == ((void *) 0))
+ continue;
+ switch (list)
+ {
+ case OMP_LIST_MULT:
+ reduction_code = MULT_EXPR;
+ break;
+ case OMP_LIST_SUB:
+ reduction_code = MINUS_EXPR;
+ }
+ gfc_trans_omp_reduction_list (n, omp_clauses, reduction_code, where);
+ }
+}
+
+void
+gfc_trans_omp_parallel_workshare (gfc_code * code)
+{
+ stmtblock_t block;
+ gfc_trans_omp_clauses (&block, code->ext.omp_clauses, code->loc);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46585.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46585.c
new file mode 100644
index 000000000..32befdfb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46585.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-fno-dce -fschedule-insns -fselective-scheduling" } */
+void
+foo (void)
+{
+ switch (0)
+ {
+ default:
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46614.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46614.c
new file mode 100644
index 000000000..92bcf4e01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46614.c
@@ -0,0 +1,57 @@
+/* PR rtl-optimization/46614 */
+/* { dg-do run } */
+/* { dg-options "-O -fno-rename-registers -fsched2-use-superblocks -fschedule-insns2 -funroll-loops" } */
+/* { dg-require-effective-target scheduling } */
+
+extern void abort (void);
+
+struct S
+{
+ unsigned char a;
+ unsigned char b;
+ unsigned int c;
+ unsigned int e;
+ unsigned char f;
+ unsigned int g;
+};
+
+void bar (struct S *x)
+{
+ int i;
+ struct S *p = x;
+ struct S r[16];
+ unsigned j;
+ for (i = 0; i < 16; i++)
+ {
+ r[i].c = p->b + p->c;
+ j = p->c + p->f;
+ r[i].a = j + p->b;
+ r[i].f = p->f + p->e;
+ r[i].g = p->b + p->c;
+ }
+ for (i = 0; i < 16; i++)
+ {
+ if (r[i].c != x[i].b + x[i].c
+ || r[i].a != x[i].c + x[i].f + x[i].b
+ || r[i].f != x[i].f + x[i].e
+ || r[i].g != x[i].b + x[i].c)
+ abort ();
+ }
+ for (i = 0; i < 16; i++)
+ {
+ r[i].b = p->c;
+ if (r[i].b != x[i].c)
+ abort ();
+ }
+}
+
+int
+main ()
+{
+ int i;
+ struct S x[16];
+ for (i = 0; i < 16; i++)
+ x[i].b = x[i].c = x[i].e = x[i].f = 5;
+ bar (x);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46620.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46620.c
new file mode 100644
index 000000000..8cc71ebbb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46620.c
@@ -0,0 +1,76 @@
+/* PR tree-optimization/46620 */
+/* SRA bitfield grouping used to lose track at padding bitfields in
+ the middle of a word. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <stdlib.h>
+
+struct PCT
+{
+ unsigned char pi1 : 4;
+ unsigned char pi2 : 3;
+ unsigned char pif : 5;
+
+ unsigned char sl : 2;
+ unsigned char uc : 1;
+ unsigned char st : 1;
+
+ unsigned char p : 1;
+ unsigned char cs : 1;
+ unsigned char ss : 1;
+
+ unsigned char pc : 3;
+ unsigned char dmv : 4;
+ unsigned char cv : 4;
+};
+
+struct rt
+{
+ struct rt* d;
+ void (*edo)(void * const);
+ short lId;
+ char dac;
+};
+
+struct pedr
+{
+ struct rt re;
+ struct PCT pc;
+ unsigned char mid;
+} ;
+
+void __attribute__((__noinline__))
+rei(struct rt* const me, unsigned short anId, void *ad )
+{
+ asm volatile ("");
+}
+
+void __attribute__((__noinline__))
+pedrdo(void * const p)
+{
+ asm volatile ("");
+}
+
+void __attribute__((__noinline__))
+pedri (struct pedr* const me, struct PCT ppc, unsigned char pmid)
+{
+ rei(&(me->re), 0x7604, 0);
+ me->pc = ppc;
+ me->mid = pmid;
+ (me)->re.edo = pedrdo;
+}
+
+int main()
+{
+ struct PCT ps;
+ struct pedr pm;
+
+ pm.pc.dmv = 0;
+ ps.dmv = 1;
+ pedri(&pm, ps, 32);
+
+ if (pm.pc.dmv != 1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46647.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46647.c
new file mode 100644
index 000000000..4510d695b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46647.c
@@ -0,0 +1,30 @@
+/* PR middle-end/46647 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int a;
+
+int
+func1 (void)
+{
+ __builtin_memset (&a, -1, sizeof (a));
+ return 0;
+}
+
+int
+func2 (void)
+{
+ __builtin_memset (&a, 123, sizeof (a));
+ return 0;
+}
+
+int
+func3 (void)
+{
+ __builtin_memset (&a, 0, sizeof (a));
+ return 0;
+}
+
+/* The xfail for avr, cris-* and crisv32-* is due to PR53535. */
+/* { dg-final { scan-tree-dump-not "memset" "optimized" { xfail avr-*-* cris-*-* crisv32-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46674.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46674.c
new file mode 100644
index 000000000..871b364c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46674.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2" } */
+
+#define LABEL3(pfx, x) # pfx x
+#define LABEL2(pfx, x) LABEL3(pfx, x)
+#define LABEL(x) LABEL2(__USER_LABEL_PREFIX__, x)
+
+int yum;
+void dessert (void) { ++yum; }
+extern void jelly (void) __asm__ (LABEL ("jelly2")) __attribute__ ((alias ("dessert"), weak));
+extern void wobbly (void) __attribute__ ((alias ("jelly2"), weak));
+
+/* { dg-final { scan-assembler "wobbly" } } */
+/* { dg-final { scan-assembler "jelly2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46675.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46675.c
new file mode 100644
index 000000000..7493f0e60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46675.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int j;
+
+void
+__attribute__((noinline))
+foo (int n)
+{
+ int npairs, i;
+ npairs = n - (-__INT_MAX__ - 1);
+
+ if (npairs > 0)
+ for (i = 0; i < npairs; i++)
+ j++;
+}
+
+int
+main ()
+{
+ foo (5 - __INT_MAX__ - 1);
+
+ if (j != 5)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46685.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46685.c
new file mode 100644
index 000000000..6277bcc2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46685.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target freorder } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -freorder-blocks-and-partition -fpic" } */
+
+__attribute__((noinline, noclone))
+void bar (void *x)
+{
+ asm volatile ("" : : "r" (x) : "memory");
+}
+
+__attribute__((noinline, noclone))
+void baz (void)
+{
+ asm volatile ("" : : : "memory");
+}
+
+__attribute__((noinline, noclone))
+int foo (int x)
+{
+ __label__ lab;
+ if (__builtin_expect (x, 0))
+ {
+ lab:
+ baz ();
+ return 2;
+ }
+ bar (&&lab);
+ return 1;
+}
+
+int
+main (void)
+{
+ int x, i;
+ asm volatile ("" : "=r" (x) : "0" (0));
+ for (i = 0; i < 1000000; i++)
+ foo (x);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-12.c
new file mode 100644
index 000000000..c383e878c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-12.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */
+
+#include <math.h>
+
+extern void abort (void);
+
+#define NVALS 6
+
+static double
+convert_it (double x)
+{
+ return pow (x, 1.0 / 3.0);
+}
+
+int
+main (int argc, char *argv[])
+{
+ double values[NVALS] = { 3.0, 1.95, 2.227, 729.0, 64.0, .0008797 };
+ double PREC = 0.999999;
+ unsigned i;
+
+ for (i = 0; i < NVALS; i++)
+ if (fabs (convert_it (values[i]) / cbrt (values[i])) < PREC)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-6.c
new file mode 100644
index 000000000..bcdaf90bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -lm -fno-ident" } */
+
+#include <math.h>
+
+int
+main (int argc, char *argv[])
+{
+ volatile double result;
+
+ result = pow (-0.0, 3.0);
+ result = pow (26.47, -2.0);
+ result = pow (0.0, 0.0);
+ result = pow (22.3, 1.0);
+ result = pow (33.2, -1.0);
+
+ return 0;
+}
+
+
+/* { dg-final { scan-assembler-not "pow" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-9.c
new file mode 100644
index 000000000..749697620
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46728-9.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math -fno-inline -fno-unroll-loops -lm" } */
+
+#include <math.h>
+
+extern void abort (void);
+
+#define NVALS 6
+
+static double
+convert_it (double x)
+{
+ return pow (x, 0.5);
+}
+
+int
+main (int argc, char *argv[])
+{
+ double values[NVALS] = { 3.0, 1.95, 2.227, 4.0, 256.0, .0008797 };
+ double PREC = 0.999999;
+ unsigned i;
+
+ for (i = 0; i < NVALS; i++)
+ if (fabs (convert_it (values[i]) / sqrt (values[i])) < PREC)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46771.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46771.c
new file mode 100644
index 000000000..e4413027c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46771.c
@@ -0,0 +1,19 @@
+/* PR debug/46771 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+unsigned char v[1600];
+
+unsigned char
+foo (unsigned char x)
+{
+ int i;
+ unsigned char a = x;
+ unsigned char b = x;
+ for (i = 0; i < 1600; i++)
+ a = a < v[i] ? v[i] : a;
+ for (i = 0; i < 1600; i++)
+ b = b > v[i] ? v[i] : b;
+ return a - b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46777.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46777.c
new file mode 100644
index 000000000..e9f40a080
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46777.c
@@ -0,0 +1,49 @@
+/* PR rtl-optimization/46777 */
+/* { dg-do compile } */
+/* { dg-options "-fgcse -O -fno-tree-dominator-opts -funroll-loops" } */
+
+struct S { char s[256]; };
+
+static inline int
+foo (int x, int y)
+{
+ switch (x)
+ {
+ case 1:
+ case 2:
+ return 3;
+ case 3:
+ case 4:
+ return 2;
+ case 5:
+ switch (y)
+ {
+ case 4:
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void
+bar (struct S *x, int *y, int *z, int **w)
+{
+ switch (*y ? x->s[*y] : foo (y[1], y[0]))
+ {
+ case 3:
+ if (y + 2 == z)
+ for (;;)
+ {
+ y += 2;
+ switch (*y ? x->s[*y] : foo (y[1], y[0]))
+ {
+ case 6:
+ break;
+ default:
+ *w = y;
+ }
+ if (y == z)
+ break;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46867.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46867.c
new file mode 100644
index 000000000..9225bce42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46867.c
@@ -0,0 +1,32 @@
+/* PR debug/46867 */
+/* { dg-do compile } */
+/* { dg-options "-O -g" } */
+
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+
+extern void *bar (void);
+
+void
+foo (int x, char *r1, char *r2, __INTPTR_TYPE__ *rp, char *t)
+{
+ char *tx = tx;
+ char **cc = bar ();
+ ptrdiff_t rx = r1 - r2;
+ for (;;)
+ {
+ char *cp1 = (char *) *rp;
+ char *cp2 = t;
+ char *s;
+ ptrdiff_t len = cp1 - tx + rx * (cp2 - cp1);
+ while (len)
+ ;
+ for (s = tx; s; s++)
+ ;
+ while (s)
+ if (s == cc[s - r1])
+ if (x)
+ bar ();
+ if (cp1)
+ tx = cp2;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46875.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46875.c
new file mode 100644
index 000000000..c601708dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46875.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-Os -fselective-scheduling2" } */
+
+long
+foo (int x, long *y)
+{
+ long a = 0;
+ switch (x)
+ {
+ case 0:
+ a = *y;
+ break;
+ case 1:
+ a = *y;
+ break;
+ case 2:
+ a = *y;
+ break;
+ case 3:
+ a = *y;
+ break;
+ case 4:
+ a = *y;
+ break;
+ }
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46878-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46878-1.c
new file mode 100644
index 000000000..f5b42de11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46878-1.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/46878 */
+/* Make sure this doesn't ICE. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct baz
+{
+ int *newp;
+};
+
+int
+get_ice (int *op, struct baz *ret)
+{
+ int *tmpp;
+ int c;
+ c = (__foo () != 1);
+ if (__bar ())
+ {
+ return (1);
+ }
+ if (c)
+ tmpp = op;
+ if (tmpp)
+ {
+ }
+ else if (c)
+ {
+ ret->newp = tmpp;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46893.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46893.c
new file mode 100644
index 000000000..ef97e2edf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46893.c
@@ -0,0 +1,13 @@
+/* PR debug/46893 */
+/* { dg-do compile } */
+/* { dg-options "-O -g" } */
+
+void
+foo (void)
+{
+ union { unsigned long long l; double d; } u = { 0x7ff0000000000000ULL };
+ double v = 0, w = -u.d;
+
+ if (w)
+ w = v;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr46909.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr46909.c
new file mode 100644
index 000000000..8bfaf0507
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr46909.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/46909 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern void abort ();
+
+int
+__attribute__ ((__noinline__))
+foo (unsigned int x)
+{
+ if (! (x == 4 || x == 6) || (x == 2 || x == 6))
+ return 1;
+ return -1;
+}
+
+/* { dg-final { scan-tree-dump-times "x_\[0-9\]+\\(D\\) != 4" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9\]+\\(D\\) != 6" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9\]+\\(D\\) == 2" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9\]+\\(D\\) == 6" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47028.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47028.c
new file mode 100644
index 000000000..3f80ff1c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47028.c
@@ -0,0 +1,19 @@
+/* PR rtl-optimization/47028 */
+/* { dg-do run } */
+/* { dg-options "-O -foptimize-sibling-calls -fno-forward-propagate -fno-tree-copy-prop -fno-tree-dominator-opts" } */
+
+int
+fib (int n)
+{
+ if (n <= 1)
+ return 1;
+ return fib (n - 2) + fib (n - 1);
+}
+
+int
+main (void)
+{
+ if (fib (5) != 8)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47086.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47086.c
new file mode 100644
index 000000000..71743fe4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47086.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fexceptions -fnon-call-exceptions -ftrapv" } */
+
+void
+foo ()
+{
+ int n = 0;
+ while (1)
+ {
+ int i[n % 1];
+ n++;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47201.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47201.c
new file mode 100644
index 000000000..11e1f2ade
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47201.c
@@ -0,0 +1,18 @@
+/* PR target/47201 */
+/* { dg-do compile } */
+/* { dg-options "-O -fpic -g" { target fpic } } */
+
+union U
+{
+ __UINTPTR_TYPE__ m;
+ float d;
+} u;
+
+int
+foo (void)
+{
+ union U v = {
+ (__UINTPTR_TYPE__)&u
+ };
+ return u.d == v.d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47276.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47276.c
new file mode 100644
index 000000000..9276b1a68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47276.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-require-visibility "" } */
+
+#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x) #x
+
+extern void syslog (int __pri, __const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern void vsyslog (int __pri, __const char *__fmt, int __ap)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+void
+__vsyslog(int pri, const char *fmt, int ap)
+{
+}
+void
+__syslog_chk(int pri, int flag, const char *fmt, ...)
+{
+}
+void
+__vsyslog_chk(int pri, int flag, const char *fmt, int ap)
+{
+}
+extern __typeof (__vsyslog_chk) __EI___vsyslog_chk __asm__("" ASMNAME ("__vsyslog_chk")); extern __typeof (__vsyslog_chk) __EI___vsyslog_chk __attribute__((alias ("" "__GI___vsyslog_chk")));
+void
+__syslog(int pri, const char *fmt, ...)
+{
+}
+extern __typeof (__syslog) syslog __attribute__ ((alias ("__syslog")));
+extern __typeof (syslog) __EI_syslog __asm__("" ASMNAME ("syslog")); extern __typeof (syslog) __EI_syslog __attribute__((alias ("" "__GI_syslog")));
+extern __typeof (__vsyslog) vsyslog __attribute__ ((alias ("__vsyslog")));
+extern __typeof (vsyslog) __EI_vsyslog __asm__("" ASMNAME ("vsyslog")); extern __typeof (vsyslog) __EI_vsyslog __attribute__((alias ("" "__GI_vsyslog")));
+extern __typeof (syslog) syslog __asm__ ("" ASMNAME ("__GI_syslog")) __attribute__ ((visibility ("hidden")));
+extern __typeof (vsyslog) vsyslog __asm__ ("" ASMNAME ("__GI_vsyslog")) __attribute__ ((visibility ("hidden")));
+extern __typeof (__vsyslog_chk) __vsyslog_chk __asm__ ("" ASMNAME ("__GI___vsyslog_chk")) __attribute__ ((visibility ("hidden")));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47369-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47369-1.c
new file mode 100644
index 000000000..117b03bfa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47369-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+
+struct FILE
+{
+ int x;
+};
+extern struct FILE __sF[];
+extern void bar (struct FILE *);
+void dlmalloc_stats() {
+ bar ((&__sF[2]));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47372-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47372-1.c
new file mode 100644
index 000000000..a2e5c5b41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47372-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC -g" } */
+
+typedef struct FILE FILE;
+int _fwalk(int (*)(FILE *));
+int __sflush(FILE *);
+int
+fflush(FILE *fp)
+{
+ return (_fwalk(__sflush));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47372-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47372-2.c
new file mode 100644
index 000000000..8addcdc5e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47372-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC -g" } */
+
+typedef unsigned short ush;
+typedef ush Pos;
+extern ush prev[];
+void fill_window( unsigned more, unsigned m)
+{
+ unsigned n;
+ for (n = 0; n < (unsigned)(1<<15); n++) {
+ (prev+0x8000)[n] = (Pos)(m >= 0x8000 ? m-0x8000 : 0);
+ }
+ for (n = 0; n < 0x8000; n++) {
+ prev[n] = (Pos)(m >= 0x8000 ? m-0x8000 : 0);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47381-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47381-1.c
new file mode 100644
index 000000000..738a89208
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47381-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef unsigned IPos;
+typedef unsigned char uch;
+extern uch window[];
+unsigned max_chain_length;
+unsigned strstart;
+int longest_match(IPos cur_match, int len, int best_len)
+{
+ unsigned chain_length = max_chain_length;
+ register uch *scan = window + strstart;
+ register uch *match;
+ register uch scan_end1 = scan[best_len-1];
+ register uch scan_end = scan[best_len];
+ do {
+ ;
+ match = window + cur_match;
+ if (match[best_len] != scan_end ||
+ match[best_len-1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) continue;
+ best_len = len;
+ } while ( --chain_length != 0);
+ return best_len;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47381-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47381-2.c
new file mode 100644
index 000000000..8aa7be720
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47381-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef unsigned long ulg;
+long block_start;
+typedef unsigned char uch;
+extern uch window[];
+ unsigned strstart;
+ulg flush_block (char *buf, ulg stored_len, int eof);
+ulg deflate()
+{
+ return flush_block(block_start >= 0L ? (char*)&window[(unsigned)block_start] : (char*)((void *)0), (long)strstart - block_start, (1));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47383.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47383.c
new file mode 100644
index 000000000..3e2b9ba18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47383.c
@@ -0,0 +1,31 @@
+/* { dg-do run { target fpic } } */
+/* { dg-options "-O2 -fPIC" } */
+
+static int heap[2*(256 +1+29)+1];
+static int heap_len;
+static int heap_max;
+void
+__attribute__ ((noinline))
+foo (int elems)
+{
+ int n, m;
+ int max_code = -1;
+ int node = elems;
+ heap_len = 0, heap_max = (2*(256 +1+29)+1);
+ for (n = 0; n < elems; n++)
+ heap[++heap_len] = max_code = n;
+ do {
+ n = heap[1];
+ heap[1] = heap[heap_len--];
+ m = heap[1];
+ heap[--heap_max] = n;
+ heap[--heap_max] = m;
+ } while (heap_len >= 2);
+}
+
+int
+main ()
+{
+ foo (286);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47391.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47391.c
new file mode 100644
index 000000000..5ec98f108
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47391.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/47391 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+const volatile int v = 1;
+int i = 0;
+
+void
+foo (void)
+{
+ i = v;
+}
+
+int
+main (void)
+{
+ foo ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "i = 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47443.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47443.c
new file mode 100644
index 000000000..fa7d6b98a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47443.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/47443 */
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-check=generic" } */
+
+static inline bar (char *c, int i)
+{
+ return c + i > c;
+}
+
+int foo ()
+{
+ char c[100];
+ return (bar (c, 1));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47446-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47446-1.c
new file mode 100644
index 000000000..38c9594a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47446-1.c
@@ -0,0 +1,40 @@
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+enum
+{
+ __GCONV_OK = 0,
+ __GCONV_NOCONV,
+ __GCONV_NODB,
+ __GCONV_NOMEM,
+ __GCONV_EMPTY_INPUT,
+ __GCONV_FULL_OUTPUT,
+ __GCONV_ILLEGAL_INPUT,
+ __GCONV_INCOMPLETE_INPUT,
+ __GCONV_ILLEGAL_DESCRIPTOR,
+ __GCONV_INTERNAL_ERROR
+};
+int
+foo (int result)
+{
+ int irreversible = 0;
+ switch (result)
+ {
+ case __GCONV_ILLEGAL_INPUT:
+ irreversible = -1L;
+ break;
+ case __GCONV_FULL_OUTPUT:
+ irreversible = -2L;
+ break;
+ case __GCONV_INCOMPLETE_INPUT:
+ irreversible = -3L;
+ break;
+ case __GCONV_EMPTY_INPUT:
+ case __GCONV_OK:
+ break;
+ default:
+ abort ();
+ }
+ return irreversible;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47446-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47446-2.c
new file mode 100644
index 000000000..5410c7f38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47446-2.c
@@ -0,0 +1,41 @@
+/* { dg-do assemble } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void abort (void);
+enum
+{
+ __GCONV_OK = 0,
+ __GCONV_NOCONV,
+ __GCONV_NODB,
+ __GCONV_NOMEM,
+ __GCONV_EMPTY_INPUT,
+ __GCONV_FULL_OUTPUT,
+ __GCONV_ILLEGAL_INPUT,
+ __GCONV_INCOMPLETE_INPUT,
+ __GCONV_ILLEGAL_DESCRIPTOR,
+ __GCONV_INTERNAL_ERROR
+};
+int
+foo (int result)
+{
+ int irreversible = 0;
+ switch (result)
+ {
+ case __GCONV_ILLEGAL_INPUT:
+ irreversible = -1L;
+ break;
+ case __GCONV_FULL_OUTPUT:
+ irreversible = -2L;
+ break;
+ case __GCONV_INCOMPLETE_INPUT:
+ irreversible = -3L;
+ break;
+ case __GCONV_EMPTY_INPUT:
+ case __GCONV_OK:
+ break;
+ default:
+ abort ();
+ }
+ return irreversible;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47555.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47555.c
new file mode 100644
index 000000000..d65265274
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47555.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define FILL_BACK *ptrRGB++=0; *ptrRGB++=0; *ptrRGB++=0;
+
+
+void uncompact(unsigned char* ptrRGB, const unsigned int* ptrSrc, const unsigned char* ptrRGBcompact, int line, int nbPixLeft)
+{
+
+#define BIT_2_RGB32 \
+ if ((v & 0x00000001)){ nbPixLeft--; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; } \
+ else{ FILL_BACK } \
+ v >>= 1;
+#define BIT_2_RGB16 \
+ if ((v16 & 0x0001)){ nbPixLeft--; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; } \
+ else{ FILL_BACK } \
+ v16 >>= 1;
+
+ int x;
+ unsigned int v, *ptrSrc32bits=(unsigned int*)ptrSrc;
+ unsigned short v16,*ptrSrc16bits;
+
+ for(x=0; x<line; x++) {
+ v = *ptrSrc32bits++;
+ BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
+ BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
+ BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
+ BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
+ }
+
+ ptrSrc16bits=(unsigned short *)ptrSrc32bits;
+ v16 = *ptrSrc16bits++;
+ BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16
+ BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47610.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47610.c
new file mode 100644
index 000000000..906af74f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47610.c
@@ -0,0 +1,8 @@
+/* PR middle-end/47610 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpic" { target fpic } } */
+struct S { const char *s; };
+const struct S s[] = { "s" };
+extern void foo (void (*) (void));
+static void bar (void) {}
+void baz () { foo (bar); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47684.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47684.c
new file mode 100644
index 000000000..7cda812dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47684.c
@@ -0,0 +1,21 @@
+/* PR debug/47684 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int in[8][4];
+int out[4];
+
+void
+foo (void)
+{
+ int sum = 1;
+ int i, j, k;
+ for (k = 0; k < 4; k++)
+ {
+ for (j = 0; j < 4; j++)
+ for (i = 0; i < 4; i++)
+ sum *= in[i + k][j];
+ out[k] = sum;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47727.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47727.c
new file mode 100644
index 000000000..1ce7c3601
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47727.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef void (*func_ptr) (void);
+static func_ptr __CTOR_END__[1] = { (func_ptr) 0 };
+static void __attribute__((used))
+__do_global_ctors_aux (void)
+{
+ func_ptr *p;
+ for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
+ (*p) ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47763.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47763.c
new file mode 100644
index 000000000..a5da2de3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47763.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-loops -fdump-rtl-web" } */
+
+foo()
+{
+}
+
+/* { dg-final { scan-rtl-dump-not "Web oldreg" "web" } } */
+/* { dg-final { cleanup-rtl-dump "web" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47766.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47766.c
new file mode 100644
index 000000000..50e2feeba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47766.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-protector" } */
+/* { dg-require-effective-target fstack_protector } */
+
+int
+parse_opt (int key)
+{
+ struct
+ {
+ int arg[key];
+ } reqdata;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c
new file mode 100644
index 000000000..0ee1aaee4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c
@@ -0,0 +1,13 @@
+/* Bug pr47793: Allow relative paths in profile-generate. */
+/* { dg-do run } */
+/* { dg-options "-O -fprofile-generate=./" } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-final { scan-file pr47793.gcda "."} } */
+
+int
+main(void)
+{
+ return 0;
+}
+
+/* { dg-final { cleanup-coverage-files } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47881.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47881.c
new file mode 100644
index 000000000..bad980625
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47881.c
@@ -0,0 +1,25 @@
+/* PR debug/47881 */
+/* { dg-do compile } */
+/* { dg-options "-O -fcompare-debug -fno-dce -funroll-loops -fno-web" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+extern int data[];
+
+int
+foo (int *t, int *f, int n)
+{
+ int i = 0, a, b, c, d;
+ while (data[*f] && n)
+ n--;
+ for (; i < n; i += 4)
+ {
+ a = data[*(f++) & 0x7f];
+ c = data[*(f++) & 0x7f];
+ c = data[*(f++) & 0x7f];
+ d = data[*(f++) & 0x7f];
+ if ((a & 0x80) || (b & 0x80) || (c & 0x80) || (d & 0x80))
+ return 1;
+ *(t++) = 16;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47893.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47893.c
new file mode 100644
index 000000000..86eb78d0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47893.c
@@ -0,0 +1,188 @@
+/* PR middle-end/47893 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=atom -fno-omit-frame-pointer -fno-strict-aliasing" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-skip-if "Too much RAM needed" { "avr-*-*" } { "*" } { "" } } */
+
+extern void abort (void);
+
+struct S
+{
+ unsigned s1:4, s2:2, s3:2, s4:2, s5:2, s6:1, s7:1, s8:1, s9:1, s10:1;
+ int s11:16; unsigned s12:4; int s13:16; unsigned s14:2;
+ int s15:16; unsigned s16:4; int s17:16; unsigned s18:2;
+};
+
+struct T
+{
+ unsigned t[3];
+};
+
+struct U
+{
+ unsigned u1, u2;
+};
+
+struct V;
+
+struct W
+{
+ char w1[24]; struct V *w2; unsigned w3; char w4[28912];
+ unsigned int w5; char w6[60];
+};
+
+struct X
+{
+ unsigned int x[2];
+};
+
+struct V
+{
+ int v1;
+ struct X v2[3];
+ char v3[28];
+};
+
+struct Y
+{
+ void *y1;
+ char y2[3076];
+ struct T y3[32];
+ char y4[1052];
+};
+
+volatile struct S v1 = { .s15 = -1, .s16 = 15, .s17 = -1, .s18 = 3 };
+
+__attribute__ ((noinline, noclone))
+int
+fn1 (int x)
+{
+ int r;
+ __asm__ volatile ("" : "=r" (r) : "0" (1), "r" (x) : "memory");
+ return r;
+}
+
+volatile int cnt;
+
+__attribute__ ((noinline, noclone))
+#ifdef __i386__
+__attribute__ ((regparm (2)))
+#endif
+struct S
+fn2 (struct Y *x, const struct X *y)
+{
+ if (++cnt > 1)
+ abort ();
+ __asm__ volatile ("" : : "r" (x), "r" (y) : "memory");
+ return v1;
+}
+
+__attribute__ ((noinline, noclone))
+void fn3 (void *x, unsigned y, const struct S *z, unsigned w)
+{
+ __asm__ volatile ("" : : "r" (x), "r" (y), "r" (z), "r" (w) : "memory");
+}
+
+volatile struct U v2;
+
+__attribute__ ((noinline, noclone))
+struct U
+fn4 (void *x, unsigned y)
+{
+ __asm__ volatile ("" : : "r" (x), "r" (y) : "memory");
+ return v2;
+}
+
+__attribute__ ((noinline, noclone))
+struct S
+fn5 (void *x)
+{
+ __asm__ volatile ("" : : "r" (x) : "memory");
+ return v1;
+}
+
+volatile struct T v3;
+
+__attribute__ ((noinline, noclone))
+struct T fn6 (void *x)
+{
+ __asm__ volatile ("" : : "r" (x) : "memory");
+ return v3;
+}
+
+__attribute__ ((noinline, noclone))
+struct T fn7 (void *x, unsigned y, unsigned z)
+{
+ __asm__ volatile ("" : : "r" (x), "r" (y), "r" (z) : "memory");
+ return v3;
+}
+
+static void
+fn8 (struct Y *x, const struct V *y)
+{
+ void *a = x->y1;
+ struct S b[4];
+ unsigned i, c;
+ c = fn1 (y->v1);
+ for (i = 0; i < c; i++)
+ b[i] = fn2 (x, &y->v2[i]);
+ fn3 (a, y->v1, b, c);
+}
+
+static inline void
+fn9 (void *x, struct S y __attribute__((unused)))
+{
+ fn4 (x, 8);
+}
+
+static void
+fn10 (struct Y *x)
+{
+ void *a = x->y1;
+ struct T b __attribute__((unused)) = fn6 (a);
+ fn9 (a, fn5 (a));
+}
+
+__attribute__((noinline, noclone))
+int
+fn11 (unsigned int x, void *y, const struct W *z,
+ unsigned int w, const char *v, const char *u)
+{
+ struct Y a, *t;
+ unsigned i;
+ t = &a;
+ __builtin_memset (t, 0, sizeof *t);
+ t->y1 = y;
+ if (x == 0)
+ {
+ if (z->w3 & 1)
+ fn10 (t);
+ for (i = 0; i < w; i++)
+ {
+ if (v[i] == 0)
+ t->y3[i] = fn7 (y, 0, u[i]);
+ else
+ return 0;
+ }
+ }
+ else
+ for (i = 0; i < w; i++)
+ t->y3[i] = fn7 (y, v[i], u[i]);
+ for (i = 0; i < z->w5; i++)
+ fn8 (t, &z->w2[i]);
+ return 0;
+}
+
+volatile int i;
+const char *volatile p = "";
+
+int
+main ()
+{
+ struct V v = { .v1 = 0 };
+ struct W w = { .w5 = 1, .w2 = &v };
+ fn11 (i + 1, (void *) p, &w, i, (const char *) p, (const char *) p);
+ if (cnt != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47899.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47899.c
new file mode 100644
index 000000000..c83bb85e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47899.c
@@ -0,0 +1,26 @@
+/* PR rtl-optimization/47899 */
+/* { dg-do compile } */
+/* { dg-options "-O -funroll-loops" } */
+
+extern unsigned int a, b, c;
+extern int d;
+
+static int
+foo (void)
+{
+lab:
+ if (b)
+ for (d = 0; d >= 0; d--)
+ if (a || c)
+ for (; c; c++)
+ ;
+ else
+ goto lab;
+}
+
+int
+main ()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47917.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47917.c
new file mode 100644
index 000000000..92bcf7966
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47917.c
@@ -0,0 +1,38 @@
+/* PR middle-end/47917 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern int snprintf (char *, __SIZE_TYPE__, const char *, ...);
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+extern void abort (void);
+
+char buf1[6], buf2[6], buf3[4], buf4[4];
+int i;
+
+int
+foo (void)
+{
+ int ret = snprintf (buf1, sizeof buf1, "abcde");
+ ret += snprintf (buf2, sizeof buf2, "abcdef") * 16;
+ ret += snprintf (buf3, sizeof buf3, "%s", i++ < 6 ? "abc" : "def") * 256;
+ ret += snprintf (buf4, sizeof buf4, "%s", i++ > 10 ? "abcde" : "defgh") * 4096;
+ return ret;
+}
+
+int
+main (void)
+{
+ if (foo () != 5 + 6 * 16 + 3 * 256 + 5 * 4096)
+ abort ();
+ if (memcmp (buf1, "abcde", 6) != 0
+ || memcmp (buf2, "abcde", 6) != 0
+ || memcmp (buf3, "abc", 4) != 0
+ || memcmp (buf4, "def", 4) != 0
+ || i != 2)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "snprintf" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "sprintf" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47991.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47991.c
new file mode 100644
index 000000000..688be5c02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47991.c
@@ -0,0 +1,25 @@
+/* PR debug/47991 */
+/* { dg-do compile } */
+/* { dg-options "-g -Os" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern inline __attribute__ ((__always_inline__))
+void *
+memset (void *x, int y, size_t z)
+{
+ return __builtin___memset_chk (x, y, z, __builtin_object_size (x, 0));
+}
+
+void
+foo (unsigned char *x, unsigned char *y, unsigned char *z,
+ unsigned char *w, unsigned int v, int u, int t)
+{
+ int i;
+ for (i = 0; i < t; i++)
+ {
+ memset (z, x[0], v);
+ memset (w, y[0], v);
+ x += u;
+ }
+ __builtin_memcpy (z, x, u);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48022-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48022-1.c
new file mode 100644
index 000000000..14eb55030
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48022-1.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/48022 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-overflow" } */
+
+int
+foo (const char *x)
+{
+ unsigned long l = 1;
+ const unsigned char *s = (const unsigned char *) (const char *) (x);
+ int r = s[0] - ((const unsigned char *) (const char *) ("/"))[0];
+ if (l > 0 && r == 0)
+ r = (s[1] - ((const unsigned char *) (const char *) ("/"))[1]);
+ return r;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48022-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48022-2.c
new file mode 100644
index 000000000..41fcb5338
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48022-2.c
@@ -0,0 +1,11 @@
+/* PR tree-optimization/48022 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-overflow" } */
+
+#include <string.h>
+
+int
+foo (const char *x)
+{
+ return strcmp (x, "/");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48067.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48067.c
new file mode 100644
index 000000000..779690918
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48067.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -fno-tree-forwprop -fno-tree-reassoc" } */
+/* { dg-options "-O2 -ffast-math -fno-tree-forwprop -fno-tree-reassoc -mfma4" { target x86_64-*-* i?86-*-* } } */
+
+float
+foo (float x, float cim)
+{
+ float c = x * cim;
+ float d = -c;
+ return c - d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48134.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48134.c
new file mode 100644
index 000000000..8dc5a6d0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48134.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-check=specific -fno-tree-dse -fno-tree-fre -fno-tree-loop-optimize -g" } */
+
+struct S
+{
+ int w, z;
+};
+struct T
+{
+ struct S s;
+};
+
+int i;
+
+static inline struct S
+bar (struct S x)
+{
+ i++;
+ return x;
+}
+
+int
+foo (struct T t, struct S s)
+{
+ struct S *c = &s;
+ if (i)
+ c = &t.s;
+ t.s.w = 3;
+ s = bar (*c);
+ return t.s.w;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48141.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48141.c
new file mode 100644
index 000000000..006f5cb14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48141.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/48141 */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+#define A i = 0;
+#define B A A A A A A A A A A
+#define C B B B B B B B B B B
+#define D C C C C C C C C C C
+#define E D D D D D D D D D D
+
+int
+foo (void)
+{
+ volatile int i = 0;
+ E E E E E E E E E E E
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48144.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48144.c
new file mode 100644
index 000000000..030202d06
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48144.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O -frerun-cse-after-loop -fschedule-insns2 -fselective-scheduling2 -fno-tree-ch -funroll-loops --param=max-sched-extend-regions-iters=2 --param=max-sched-region-blocks=15" } */
+extern void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n);
+
+void bar (void *, void *, void *);
+
+void foo
+ (void *p, char *data, unsigned data_len)
+{
+ int buffer[8];
+ int buf2[8];
+ unsigned i;
+ for (i = 0; i + 8 <= data_len; i += 8)
+ bar (p, buffer, data + i);
+ memcpy (buf2, data + i, data_len);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48156.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48156.c
new file mode 100644
index 000000000..7b4d529c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48156.c
@@ -0,0 +1,45 @@
+/* PR rtl-optimization/48156 */
+/* { dg-do run } */
+/* { dg-options "-O -fcrossjumping --param min-crossjump-insns=1" } */
+
+extern void abort (void);
+
+static int __attribute__ ((noinline, noclone))
+equals (int s1, int s2)
+{
+ return s1 == s2;
+}
+
+static int __attribute__ ((noinline, noclone))
+bar (void)
+{
+ return 1;
+}
+
+static void __attribute__ ((noinline, noclone))
+baz (int f, int j)
+{
+ if (f != 4 || j != 2)
+ abort ();
+}
+
+void
+foo (int x)
+{
+ int i = 0, j = bar ();
+
+ if (x == 1)
+ i = 2;
+
+ if (j && equals (i, j))
+ baz (8, i);
+ else
+ baz (4, i);
+}
+
+int
+main ()
+{
+ foo (1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48159-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48159-1.c
new file mode 100644
index 000000000..cd67e6385
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48159-1.c
@@ -0,0 +1,10 @@
+/* PR debug/48159 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcompare-debug" } */
+
+void
+foo (double x, int y, double *__restrict z, double *__restrict w)
+{
+ while (y--)
+ *z++ = (*w++ = 0) * x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48159-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48159-2.c
new file mode 100644
index 000000000..25596bf6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48159-2.c
@@ -0,0 +1,22 @@
+/* PR debug/48159 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fcompare-debug" } */
+
+int foo (int * __restrict__ ia, int * __restrict__ ib,
+ int * __restrict__ oxa, int * __restrict__ oxb)
+{
+ int i;
+ int oya[52], oyb[52];
+ for (i = 0; i < 52; i++)
+ {
+ int w1 = ia[i];
+ int w2 = oxa[i];
+ int w3 = ib[i];
+ int w4 = oxb[i];
+ int w5 = w1 + w2 + 5;
+ oya[i] = (w1 * w2) >> 10;
+ int w6 = w3 + w4 + 6;
+ oyb[i] = (w3 * w4) >> 10;
+ }
+ return oya[22] + oyb[21];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48186.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48186.c
new file mode 100644
index 000000000..5635f930d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48186.c
@@ -0,0 +1,5 @@
+/* PR tree-optimization/48186 */
+/* { dg-do compile } */
+/* { dg-options "-O --param hot-bb-frequency-fraction=0" } */
+
+void foo (void) { }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48189.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48189.c
new file mode 100644
index 000000000..86b995dc9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48189.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/48189 */
+/* { dg-do compile } */
+/* { dg-options "-O --param max-predicted-iterations=0" } */
+
+struct S { int s[8]; };
+
+void
+foo (int *x, struct S *y)
+{
+ int i;
+ for (i = 0; y[i].s[i]; i++)
+ *x++ = y[i].s[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48203.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48203.c
new file mode 100644
index 000000000..b4b2b084d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48203.c
@@ -0,0 +1,51 @@
+/* PR debug/48203 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+volatile int v;
+
+void
+foo (long a, long b, long c, long d, long e, long f, long g, long h,
+ long i, long j, long k, long l, long m, long n, long o, long p)
+{
+ long a2 = a;
+ long b2 = b;
+ long c2 = c;
+ long d2 = d;
+ long e2 = e;
+ long f2 = f;
+ long g2 = g;
+ long h2 = h;
+ long i2 = i;
+ long j2 = j;
+ long k2 = k;
+ long l2 = l;
+ long m2 = m;
+ long n2 = n;
+ long o2 = o;
+ long p2 = p;
+ v++;
+}
+
+void
+bar (int a, int b, int c, int d, int e, int f, int g, int h,
+ int i, int j, int k, int l, int m, int n, int o, int p)
+{
+ int a2 = a;
+ int b2 = b;
+ int c2 = c;
+ int d2 = d;
+ int e2 = e;
+ int f2 = f;
+ int g2 = g;
+ int h2 = h;
+ int i2 = i;
+ int j2 = j;
+ int k2 = k;
+ int l2 = l;
+ int m2 = m;
+ int n2 = n;
+ int o2 = o;
+ int p2 = p;
+ v++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48213.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48213.c
new file mode 100644
index 000000000..cf7d76fa0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48213.c
@@ -0,0 +1,14 @@
+/* PR target/48213 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+/* { dg-options "-g -O2 -fpic" { target fpic } } */
+
+struct S { int (*s) (void); };
+int bar (void);
+
+void
+foo (struct S *x)
+{
+ if (x->s != bar)
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48235.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48235.c
new file mode 100644
index 000000000..401624ec6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48235.c
@@ -0,0 +1,58 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O -fno-guess-branch-probability -fpeel-loops -freorder-blocks-and-partition -fschedule-insns2 -fsel-sched-pipelining -fselective-scheduling2" } */
+struct intC
+{
+ short x;
+ short y;
+};
+
+int size_x;
+
+static inline int
+TileDiffXY (int x, int y)
+{
+ return (y * size_x) + x;
+}
+
+struct HangarTileTable
+{
+ struct intC ti;
+ int hangar_num;
+};
+
+struct AirportSpec
+{
+ struct HangarTileTable *depot_table;
+ int size;
+};
+
+void Get ();
+struct AirportSpec dummy;
+
+static inline int
+GetRotatedTileFromOffset (int *a, struct intC tidc)
+{
+ if (!*a)
+ Get ();
+ switch (*a)
+ {
+ case 0:
+ return (tidc.y << size_x) + tidc.x;
+ case 1:
+ return TileDiffXY (tidc.y, dummy.size - tidc.x);
+ case 2:
+ return TileDiffXY (tidc.x, dummy.size - tidc.y);
+ case 3:
+ return TileDiffXY (dummy.size - 1, tidc.x);
+ }
+}
+
+int
+GetHangarNum (int *a)
+{
+ int i;
+ for (i = 0; i < dummy.size; i++)
+ if (GetRotatedTileFromOffset (a, dummy.depot_table[i].ti))
+ return dummy.depot_table[i].hangar_num;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-1.c
new file mode 100644
index 000000000..7a022eac8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-1.c
@@ -0,0 +1,48 @@
+/* PR middle-end/48335 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra" } */
+
+typedef long long T __attribute__((may_alias));
+
+struct S
+{
+ _Complex float d __attribute__((aligned (8)));
+};
+
+void bar (struct S);
+
+void
+f1 (T x)
+{
+ struct S s;
+ *(T *) &s.d = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f2 (int x)
+{
+ struct S s = { .d = 0.0f };
+ *(char *) &s.d = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f3 (int x)
+{
+ struct S s = { .d = 0.0f };
+ ((char *) &s.d)[2] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f4 (int x, int y)
+{
+ struct S s = { .d = 0.0f };
+ ((char *) &s.d)[y] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-2.c
new file mode 100644
index 000000000..a37c0797c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-2.c
@@ -0,0 +1,58 @@
+/* PR middle-end/48335 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra" } */
+
+typedef long long T __attribute__((may_alias, aligned (1)));
+typedef short U __attribute__((may_alias, aligned (1)));
+
+struct S
+{
+ _Complex float d __attribute__((aligned (8)));
+};
+
+void bar (struct S);
+
+void
+f1 (T x)
+{
+ struct S s;
+ *(T *) ((char *) &s.d + 1) = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f2 (int x)
+{
+ struct S s = { .d = 0.0f };
+ ((U *)((char *) &s.d + 1))[0] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f3 (int x)
+{
+ struct S s = { .d = 0.0f };
+ ((U *)((char *) &s.d + 1))[1] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f4 (int x)
+{
+ struct S s = { .d = 0.0f };
+ ((U *)((char *) &s.d + 1))[2] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f5 (int x)
+{
+ struct S s = { .d = 0.0f };
+ ((U *)((char *) &s.d + 1))[3] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-3.c
new file mode 100644
index 000000000..9041f591f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-3.c
@@ -0,0 +1,48 @@
+/* PR middle-end/48335 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra" } */
+
+typedef short U __attribute__((may_alias, aligned (1)));
+
+struct S
+{
+ double d;
+};
+
+void bar (struct S);
+
+void
+f1 (int x)
+{
+ struct S s = { .d = 0.0 };
+ ((U *)((char *) &s.d + 1))[0] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f2 (int x)
+{
+ struct S s = { .d = 0.0 };
+ ((U *)((char *) &s.d + 1))[1] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f3 (int x)
+{
+ struct S s = { .d = 0.0 };
+ ((U *)((char *) &s.d + 1))[2] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f4 (int x)
+{
+ struct S s = { .d = 0.0 };
+ ((U *)((char *) &s.d + 1))[3] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-4.c
new file mode 100644
index 000000000..98e9e1eec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-4.c
@@ -0,0 +1,39 @@
+/* PR middle-end/48335 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra" } */
+
+typedef short U __attribute__((may_alias, aligned (1)));
+
+struct S
+{
+ double d;
+};
+
+void bar (struct S);
+
+void
+f1 (int x)
+{
+ struct S s = { .d = 0.0 };
+ ((U *)((char *) &s.d + 1))[-1] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f2 (int x)
+{
+ struct S s = { .d = 0.0 };
+ ((U *)((char *) &s.d + 1))[-2] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
+
+void
+f3 (int x)
+{
+ struct S s = { .d = 0.0 };
+ ((U *)((char *) &s.d + 1))[5] = x;
+ __real__ s.d *= 7.0;
+ bar (s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-5.c
new file mode 100644
index 000000000..b1895484d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-5.c
@@ -0,0 +1,38 @@
+/* PR middle-end/48335 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra" } */
+
+typedef long long T __attribute__((may_alias));
+
+struct S
+{
+ _Complex float d __attribute__((aligned (8)));
+};
+
+int
+f1 (struct S x)
+{
+ struct S s = x;
+ return *(T *) &s.d;
+}
+
+int
+f2 (struct S x)
+{
+ struct S s = x;
+ return *(char *) &s.d;
+}
+
+int
+f3 (struct S x)
+{
+ struct S s = x;
+ return ((char *) &s.d)[2];
+}
+
+int
+f4 (struct S x, int y)
+{
+ struct S s = x;
+ return ((char *) &s.d)[y];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-6.c
new file mode 100644
index 000000000..769130cc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-6.c
@@ -0,0 +1,46 @@
+/* PR middle-end/48335 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra" } */
+
+typedef long long T __attribute__((may_alias, aligned (1)));
+typedef short U __attribute__((may_alias, aligned (1)));
+
+struct S
+{
+ _Complex float d __attribute__((aligned (8)));
+};
+
+T
+f1 (struct S x)
+{
+ struct S s = x;
+ return *(T *) ((char *) &s.d + 1);
+}
+
+int
+f2 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[0];
+}
+
+int
+f3 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[1];
+}
+
+int
+f4 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[2];
+}
+
+int
+f5 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[3];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-7.c
new file mode 100644
index 000000000..ddb15ee6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-7.c
@@ -0,0 +1,38 @@
+/* PR middle-end/48335 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra" } */
+
+typedef short U __attribute__((may_alias, aligned (1)));
+
+struct S
+{
+ double d;
+};
+
+int
+f1 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[0];
+}
+
+int
+f2 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[1];
+}
+
+int
+f3 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[2];
+}
+
+int
+f4 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[3];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-8.c
new file mode 100644
index 000000000..bb06c157f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48335-8.c
@@ -0,0 +1,31 @@
+/* PR middle-end/48335 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra" } */
+
+typedef short U __attribute__((may_alias, aligned (1)));
+
+struct S
+{
+ double d;
+};
+
+int
+f1 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[-1];
+}
+
+int
+f2 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[-2];
+}
+
+int
+f3 (struct S x)
+{
+ struct S s = x;
+ return ((U *)((char *) &s.d + 1))[5];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48374.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48374.c
new file mode 100644
index 000000000..24826d5f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48374.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O -fschedule-insns2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fselective-scheduling2 --param max-sched-extend-regions-iters=2" } */
+
+void foo (int y)
+{
+ switch (y)
+ {
+ case 3:
+ case 5:
+ case 7:
+ case 11:
+ break;
+ default:
+ __builtin_unreachable ();
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48442.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48442.c
new file mode 100644
index 000000000..88e3497b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48442.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-Os -fselective-scheduling2 --param max-sched-extend-regions-iters=100" } */
+void f (void)
+{
+ unsigned *a2;
+ int vertex2;
+ int c, x2, dx2, dy2, s2;
+ long m, b;
+ do
+ {
+ if (dx2)
+ dx2 = dx2 % dy2;
+ s2 = (dx2 / dy2);
+ }
+ while (vertex2);
+ for (;;)
+ {
+ c = x2;
+ a2 = 0;
+ if (c)
+ {
+ m = b << (c);
+ *a2 = (*a2 & ~m);
+ }
+ x2 += s2;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48524.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48524.c
new file mode 100644
index 000000000..d7e46a790
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48524.c
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+/* { dg-options "-specs=${srcdir}/gcc.dg/pr48524.spec -D_TEST_D" } */
+# ifdef _FOO
+# error works /* { dg-error "works" } */
+# endif
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48524.spec b/gcc-4.9/gcc/testsuite/gcc.dg/pr48524.spec
new file mode 100644
index 000000000..8569360ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48524.spec
@@ -0,0 +1,5 @@
+*cpp_options:
+%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
+ %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\
+ %{undef} %{save-temps*:-fpch-preprocess} %{D_TEST_D:-D_FOO}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48552-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48552-1.c
new file mode 100644
index 000000000..877c4c2a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48552-1.c
@@ -0,0 +1,53 @@
+/* PR c/48552 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct S;
+
+void
+f1 (void *x)
+{
+ __asm volatile ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */
+
+void
+f2 (void *x)
+{
+ __asm volatile ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */
+ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */
+void
+f3 (void *x)
+{
+ __asm volatile ("" : : "m" (*x)); /* { dg-warning "dereferencing" } */
+}
+
+void
+f4 (void *x)
+{
+ __asm volatile ("" : "=m" (*x)); /* { dg-warning "dereferencing" } */
+}
+
+void
+f5 (void *x)
+{
+ __asm volatile ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */
+
+void
+f6 (void *x)
+{
+ __asm volatile ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */
+ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */
+void
+f7 (struct S *x)
+{
+ __asm volatile ("" : : "r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */
+}
+
+void
+f8 (struct S *x)
+{
+ __asm volatile ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */
+} /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48552-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48552-2.c
new file mode 100644
index 000000000..a7969837b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48552-2.c
@@ -0,0 +1,53 @@
+/* PR c/48552 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct S;
+
+void
+f1 (void *x)
+{
+ __asm ("" : : "r" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 10 } */
+
+void
+f2 (void *x)
+{
+ __asm ("" : "=r" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 16 } */
+ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 16 } */
+void
+f3 (void *x)
+{
+ __asm ("" : : "m" (*x)); /* { dg-warning "dereferencing" } */
+}
+
+void
+f4 (void *x)
+{
+ __asm ("" : "=m" (*x)); /* { dg-warning "dereferencing" } */
+}
+
+void
+f5 (void *x)
+{
+ __asm ("" : : "g" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 34 } */
+
+void
+f6 (void *x)
+{
+ __asm ("" : "=g" (*x)); /* { dg-warning "dereferencing" "deref" } */
+} /* { dg-error "invalid use of void expression" "void expr" { target *-*-* } 40 } */
+ /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 40 } */
+void
+f7 (struct S *x)
+{
+ __asm ("" : : "r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" } */
+}
+
+void
+f8 (struct S *x)
+{
+ __asm ("" : "=r" (*x)); /* { dg-error "dereferencing pointer to incomplete type" "incomplete" } */
+} /* { dg-error "invalid lvalue in asm output 0" "invalid lvalue" { target *-*-* } 52 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48616.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48616.c
new file mode 100644
index 000000000..4517d7921
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48616.c
@@ -0,0 +1,135 @@
+/* PR tree-optimization/48616 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
+
+extern void abort (void);
+int a[4] __attribute__((aligned (32)));
+int b[4] __attribute__((aligned (32)));
+int c[4] __attribute__((aligned (32)));
+int d[4] __attribute__((aligned (32)));
+int e[4] __attribute__((aligned (32)));
+
+__attribute__((noinline, noclone))
+int
+foo (int x)
+{
+ asm ("" : "+r" (x));
+ return x;
+}
+
+__attribute__((noinline, noclone))
+void
+fn1 (int i)
+{
+ a[0] = b[0] << c[0];
+ a[1] = b[1] << c[1];
+ a[2] = b[2] << c[2];
+ a[3] = b[3] << c[3];
+ if (i)
+ {
+ d[0] = e[0] >> c[0];
+ d[1] = e[1] >> c[1];
+ d[2] = e[2] >> c[2];
+ d[3] = e[3] >> c[3];
+ }
+}
+
+__attribute__((noinline, noclone))
+void
+fn2 (int i)
+{
+ a[0] = b[0] << 1;
+ a[1] = b[1] << 2;
+ a[2] = b[2] << 3;
+ a[3] = b[3] << 4;
+ if (i)
+ {
+ d[0] = e[0] >> 1;
+ d[1] = e[1] >> 2;
+ d[2] = e[2] >> 3;
+ d[3] = e[3] >> 4;
+ }
+}
+
+__attribute__((noinline, noclone))
+void
+fn3 (int i, int j)
+{
+ int x = foo (j);
+ a[0] = b[0] << x;
+ a[1] = b[1] << x;
+ a[2] = b[2] << x;
+ a[3] = b[3] << x;
+ if (i)
+ {
+ d[0] = e[0] >> x;
+ d[1] = e[1] >> x;
+ d[2] = e[2] >> x;
+ d[3] = e[3] >> x;
+ }
+}
+
+__attribute__((noinline, noclone))
+void
+fn4 (int i)
+{
+ a[0] = b[0] << 1;
+ a[1] = b[1] << 1;
+ a[2] = b[2] << 1;
+ a[3] = b[3] << 1;
+ if (i)
+ {
+ d[0] = e[0] >> 1;
+ d[1] = e[1] >> 1;
+ d[2] = e[2] >> 1;
+ d[3] = e[3] >> 1;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ int *t;
+ for (i = 0; i < 4; i++)
+ {
+ b[i] = 32;
+ c[i] = i + 1;
+ e[i] = 32;
+ }
+ asm volatile ("" : : "r" (b) : "memory");
+ asm volatile ("" : : "r" (c) : "memory");
+ asm volatile ("" : "=r" (t) : "0" (d) : "memory");
+ fn1 (t != 0);
+ for (i = 0; i < 4; i++)
+ {
+ if (a[i] != (32 << (i + 1)) || d[i] != (32 >> (i + 1)))
+ abort ();
+ a[i] = 0;
+ d[i] = 0;
+ }
+ fn2 (t != 0);
+ for (i = 0; i < 4; i++)
+ {
+ if (a[i] != (32 << (i + 1)) || d[i] != (32 >> (i + 1)))
+ abort ();
+ a[i] = 0;
+ d[i] = 0;
+ }
+ fn3 (t != 0, t != 0);
+ for (i = 0; i < 4; i++)
+ {
+ if (a[i] != (32 << 1) || d[i] != (32 >> 1))
+ abort ();
+ a[i] = 0;
+ d[i] = 0;
+ }
+ fn4 (t != 0);
+ for (i = 0; i < 4; i++)
+ {
+ if (a[i] != (32 << 1) || d[i] != (32 >> 1))
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48685.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48685.c
new file mode 100644
index 000000000..36df0cc5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48685.c
@@ -0,0 +1,11 @@
+/* PR c/48685 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+main ()
+{
+ int v = 1;
+ (void) (1 == 2 ? (void) 0 : (v = 0));
+ return v;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48739-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48739-1.c
new file mode 100644
index 000000000..4dcdca977
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48739-1.c
@@ -0,0 +1,27 @@
+/* PR tree-optimization/48739 */
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O1 -ftree-parallelize-loops=2 -fno-tree-dominator-opts" } */
+
+extern int g;
+extern void bar (void);
+
+int
+foo (int x)
+{
+ int a, b, *c = (int *) 0;
+ for (a = 0; a < 10; ++a)
+ {
+ bar ();
+ for (b = 0; b < 5; ++b)
+ {
+ x = 0;
+ c = &x;
+ g = 1;
+ }
+ }
+ *c = x;
+ for (x = 0; x != 10; x++)
+ ;
+ return g;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48739-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48739-2.c
new file mode 100644
index 000000000..c79f4e86a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48739-2.c
@@ -0,0 +1,27 @@
+/* PR tree-optimization/48739 */
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O1 -ftree-parallelize-loops=2 -fno-tree-dominator-opts" } */
+
+extern int g, v[10];
+extern void bar (void);
+
+int
+foo (int x)
+{
+ int a, b, *c = (int *) 0;
+ for (a = 0; a < 10; ++a)
+ {
+ bar ();
+ for (b = 0; b < 5; ++b)
+ {
+ x = 0;
+ c = &x;
+ g = 1;
+ }
+ }
+ *c = x;
+ for (x = 0; x != 10; x++)
+ v[x] = x;
+ return g;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48768.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48768.c
new file mode 100644
index 000000000..0ab22ee3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48768.c
@@ -0,0 +1,39 @@
+/* PR debug/48768 */
+/* { dg-do compile } */
+/* { dg-options "-O -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int a, b;
+
+int
+bar (void)
+{
+ int i, j = 1;
+ for (i = 0; i != 10; i++)
+ {
+ lab:
+ if (i)
+ {
+ int *k = &j;
+ }
+ else if (j)
+ goto lab;
+ }
+ return 1;
+}
+
+inline int
+foo (int x)
+{
+ unsigned int c = x;
+ int d = x;
+ if (bar ())
+ for (; c; c++)
+ while (x >= 0)
+ if (foo (d) >= 0)
+ {
+ d = bar ();
+ a = b ? b : 1;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48770.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48770.c
new file mode 100644
index 000000000..446389d49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48770.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O -fprofile-arcs -fPIC -fno-dce -fno-forward-propagate" } */
+
+int test_goto2 (int f)
+{
+ int i;
+ for (i = 0; ({_Bool a = i < 10;a;}); i++)
+ {
+ if (i == f)
+ goto lab2;
+ }
+ return 4;
+lab2:
+ return 8;
+}
+
+int main ()
+{
+ test_goto2 (30);
+ return 0;
+}
+
+/* { dg-final { cleanup-coverage-files } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48774.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48774.c
new file mode 100644
index 000000000..91ce361cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48774.c
@@ -0,0 +1,38 @@
+/* PR target/48774 */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+extern void abort (void);
+unsigned long int s[24]
+ = { 12, ~1, 12, ~2, 12, ~4, 12, ~8, 12, ~16, 12, ~32,
+ 12, ~64, 12, ~128, 12, ~256, 12, ~512, 12, ~1024, 12, ~2048 };
+struct { int n; unsigned long *e[12]; } g
+ = { 12, { &s[0], &s[2], &s[4], &s[6], &s[8], &s[10], &s[12], &s[14],
+ &s[16], &s[18], &s[20], &s[22] } };
+int c[12];
+
+__attribute__((noinline, noclone)) void
+foo (void)
+{
+ int i, j;
+ for (i = 0; i < g.n; i++)
+ for (j = 0; j < g.n; j++)
+ {
+ if (i == j && j < g.e[0][0] && (g.e[i][1] & (1UL << j)))
+ abort ();
+ if (j < g.e[0][0] && (g.e[i][1] & (1UL << j)))
+ c[i]++;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ asm volatile ("" : "+m" (s), "+m" (g), "+m" (c));
+ foo ();
+ for (i = 0; i < 12; i++)
+ if (c[i] != 11)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48784-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48784-1.c
new file mode 100644
index 000000000..436d8c551
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48784-1.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+extern void abort (void);
+
+#pragma pack(1)
+volatile struct S0 {
+ signed a : 7;
+ unsigned b : 28; /* b can't be fetched with an aligned 32-bit access, */
+ /* but it certainly can be fetched with an unaligned access */
+} g = {0,0xfffffff};
+
+int main() {
+ unsigned b = g.b;
+ if (b != 0xfffffff)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48784-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48784-2.c
new file mode 100644
index 000000000..966cbdb96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48784-2.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fno-strict-volatile-bitfields" } */
+
+extern void abort (void);
+
+#pragma pack(1)
+volatile struct S0 {
+ signed a : 7;
+ unsigned b : 28; /* b can't be fetched with an aligned 32-bit access, */
+ /* but it certainly can be fetched with an unaligned access */
+} g = {0,0xfffffff};
+
+int main() {
+ unsigned b = g.b;
+ if (b != 0xfffffff)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48826.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48826.c
new file mode 100644
index 000000000..691f74f4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48826.c
@@ -0,0 +1,10 @@
+/* { dg-options "-O -g -w" } */
+
+void bar (int *);
+
+void
+foo ()
+{
+ int *const pc = __builtin_return_address (0);
+ bar (pc);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48837.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48837.c
new file mode 100644
index 000000000..ffc65b9dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48837.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/48837 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort (void);
+
+__attribute__((noinline))
+int baz(void)
+{
+ return 1;
+}
+
+inline const int *bar(const int *a, const int *b)
+{
+ return *a ? a : b;
+}
+
+int foo(int a, int b)
+{
+ return a || b ? baz() : foo(*bar(&a, &b), 1) + foo(1, 0);
+}
+
+int main(void)
+{
+ if (foo(0, 0) != 2)
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr48975.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr48975.c
new file mode 100644
index 000000000..58658d871
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr48975.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/48975 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fno-tree-slp-vectorize" } */
+
+static int
+foo (int x)
+{
+ return (x > 0) ? 0 : x + 1;
+}
+
+void
+bar (unsigned int x)
+{
+ int l = 1;
+lab:
+ while (x)
+ x = foo (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49000.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49000.c
new file mode 100644
index 000000000..32a1cdb35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49000.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/49000 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+static
+foo (int x, int y)
+{
+ return x * y;
+}
+
+static int
+bar (int *z)
+{
+ return *z;
+}
+
+void
+baz (void)
+{
+ int a = 42;
+ int *b = &a;
+ foo (bar (&a), 3);
+}
+
+void
+test (void)
+{
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49069.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49069.c
new file mode 100644
index 000000000..f0fe1f2f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49069.c
@@ -0,0 +1,15 @@
+/* PR target/49069 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fno-tree-forwprop -Wno-div-by-zero" } */
+
+int a;
+const unsigned long long b[1] = { 1ULL };
+extern void bar (int);
+
+void
+foo (void)
+{
+ for (a = 0; a == 1; a = 2)
+ ;
+ bar (b[0] == (a == 0 ? a : a / 0));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49120.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49120.c
new file mode 100644
index 000000000..1a65222cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49120.c
@@ -0,0 +1,11 @@
+/* PR c/49120 */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+int
+main ()
+{
+ int a = 1;
+ int c = ({ char b[a + 1]; b[0] = 0; b[0]; });
+ return c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49235.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49235.c
new file mode 100644
index 000000000..f1e589f75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49235.c
@@ -0,0 +1,25 @@
+/* PR rtl-optimization/49235 */
+/* { dg-do compile { target { int32plus } } } */
+/* { dg-options "-O -fno-delete-null-pointer-checks -fno-tree-scev-cprop -ftree-vectorize -fno-vect-cost-model -w" } */
+
+void
+foo (void)
+{
+ unsigned i;
+ unsigned *p = 0;
+ for (i = 0; i < 4; ++i)
+ *p++ = 0;
+ for (i = 0; i < 4; ++i)
+ *p++ = 0;
+}
+
+void
+bar (void)
+{
+ unsigned i;
+ unsigned *p = (unsigned *) (__UINTPTR_TYPE__) 0x12340000;
+ for (i = 0; i < 4; ++i)
+ *p++ = 0;
+ for (i = 0; i < 4; ++i)
+ *p++ = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49243.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49243.c
new file mode 100644
index 000000000..f896b05b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49243.c
@@ -0,0 +1,25 @@
+/* PR tree-optimization/49243 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Winline" } */
+
+extern unsigned long jb[];
+extern int my_setjmp(unsigned long jb[]) __attribute__((returns_twice));
+extern int decode(const char*);
+
+static inline int wrapper(const char **s_ptr) /* { dg-warning "(inlining failed|function 'wrapper' can never be inlined because it uses setjmp)" } */
+{
+ if (my_setjmp(jb) == 0) {
+ const char *s = *s_ptr;
+ while (decode(s) != 0)
+ *s_ptr = ++s;
+ return 0;
+ } else
+ return -1;
+}
+
+void parse(const char *data)
+{
+ const char *s = data;
+ if (!(wrapper(&s) == -1 && (s - data) == 1)) /* { dg-warning "called from here" } */
+ __builtin_abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49307.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49307.c
new file mode 100644
index 000000000..e05659a8e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49307.c
@@ -0,0 +1,21 @@
+/* PR target/49307 */
+/* { dg-do compile } */
+/* { dg-options "-O -fpic -fstack-protector" } */
+/* { dg-require-effective-target fpic } */
+/* { dg-require-effective-target fstack_protector } */
+
+extern void bar (char **pp, void *vp);
+extern void free (void *p);
+
+int
+foo (void)
+{
+ char *p;
+ char fext[128];
+
+ p = fext;
+ bar (&p, (void *)0);
+ if (p)
+ free (p);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49496.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49496.c
new file mode 100644
index 000000000..06563f3bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49496.c
@@ -0,0 +1,20 @@
+/* PR debug/49496 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcompare-debug" } */
+
+unsigned short u[8], s1[8], s2[8];
+
+void bar (unsigned short *);
+
+void
+foo (void)
+{
+ unsigned short e[8];
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int tmp = s1[i] * s2[i];
+ e[i] = (tmp & 0xffff0000) >> 16;
+ }
+ bar (e);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49544.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49544.c
new file mode 100644
index 000000000..52f79dd7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49544.c
@@ -0,0 +1,22 @@
+/* PR debug/49544 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+/* { dg-require-effective-target ptr32plus } */
+
+__extension__ typedef __PTRDIFF_TYPE__ ptr_t;
+
+int baz (int, int, void *);
+
+static inline __attribute__ ((always_inline)) long
+foo (int x, int y, void *z)
+{
+ if (y < 0)
+ return baz (x, y, z);
+ return 0;
+}
+
+long
+bar (long x, long y, long z)
+{
+ return foo (x, y, (void *) (ptr_t) z);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49602.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49602.c
new file mode 100644
index 000000000..bb8eeb0c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49602.c
@@ -0,0 +1,17 @@
+/* PR debug/49602 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+
+static void
+foo (int *x)
+{
+}
+
+void
+bar (int *x)
+{
+ int i;
+ for (i = 0; i == 1; ++i)
+ x = 0;
+ foo (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49619.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49619.c
new file mode 100644
index 000000000..d0a72a6ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49619.c
@@ -0,0 +1,13 @@
+/* PR rtl-optimization/49619 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-fre" } */
+
+extern int a, b;
+
+void
+foo (int x)
+{
+ a = 2;
+ b = 0;
+ b = (a && ((a = 1, 0 >= b) || (short) (x + (b & x))));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49696.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49696.c
new file mode 100644
index 000000000..8e5a018fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49696.c
@@ -0,0 +1,29 @@
+/* { dg-require-effective-target sync_char_short } */
+
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+
+void
+foo (short *x)
+{
+ __sync_val_compare_and_swap (x, 1, 0);
+ __sync_bool_compare_and_swap (x, 1, 0);
+ __sync_lock_test_and_set (x, 0);
+
+ __sync_fetch_and_add (x, 0);
+ __sync_fetch_and_add (x, 0);
+ __sync_fetch_and_add (x, 0);
+ __sync_fetch_and_sub (x, 0);
+ __sync_fetch_and_and (x, 0);
+ __sync_fetch_and_or (x, 0);
+ __sync_fetch_and_xor (x, 0);
+ __sync_fetch_and_nand (x, 0);
+
+ __sync_add_and_fetch (x, 0);
+ __sync_add_and_fetch (x, 0);
+ __sync_add_and_fetch (x, 0);
+ __sync_sub_and_fetch (x, 0);
+ __sync_and_and_fetch (x, 0);
+ __sync_or_and_fetch (x, 0);
+ __sync_xor_and_fetch (x, 0);
+ __sync_nand_and_fetch (x, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49705.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49705.c
new file mode 100644
index 000000000..0c326ae3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49705.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-overflow" } */
+
+struct glyph
+{
+ long foo, bar, baz;
+};
+
+extern int fatal (char const *, int, int);
+
+int
+check_image_width (int width, int height)
+{
+ if ((((((0 * (0 * 2 + width) - 1) < 0) ? - (~ (0 * (0 * 2 + width) + 0) == -1) - ((((0 * (0 * 2 + width) + 1) << (sizeof ((0 * 2 + width) + 0) * 8 - 2)) - 1) * 2 + 1) : (0 * (0 * 2 + width) + 0))) < 0 ? (2 < 0 ? width < ((((0 * (0 * 2 + width) - 1) < 0) ? - (~ (0 * (0 * 2 + width) + 0) == -1) - ((((0 * (0 * 2 + width) + 1) << (sizeof ((0 * 2 + width) + 0) * 8 - 2)) - 1) * 2 + 1) : (0 * (0 * 2 + width) + 0))) - 2 : ((((0 * (0 * 2 + width) - 1) < 0) ? ((((0 * (0 * 2 + width) + 1) << (sizeof ((0 * 2 + width) + 0) * 8 - 2)) - 1) * 2 + 1) : (0 * (0 * 2 + width) - 1))) - 2 < width) : width < 0 ? 2 <= width + 2 : 2 < 0 ? width <= width + 2 : width + 2 < 2)
+ || ((((((0 * (0 * height + (width + 2)) - 1) < 0) ? - (~ (0 * (0 * height + (width + 2)) + 0) == -1) - ((((0 * (0 * height + (width + 2)) + 1) << (sizeof ((0 * height + (width + 2)) + 0) * 8 - 2)) - 1) * 2 + 1) : (0 * (0 * height + (width + 2)) + 0))) == 0 && (((width + 2) < 0 && 0 < height) || (height < 0 && 0 < (width + 2)))) || (height < 0 ? ((width + 2) < 0 ? (width + 2) < ((((0 * (0 * height + (width + 2)) - 1) < 0) ? ((((0 * (0 * height + (width + 2)) + 1) << (sizeof ((0 * height + (width + 2)) + 0) * 8 - 2)) - 1) * 2 + 1) : (0 * (0 * height + (width + 2)) - 1))) / height : height == -1 ? 0 : ((((0 * (0 * height + (width + 2)) - 1) < 0) ? - (~ (0 * (0 * height + (width + 2)) + 0) == -1) - ((((0 * (0 * height + (width + 2)) + 1) << (sizeof ((0 * height + (width + 2)) + 0) * 8 - 2)) - 1) * 2 + 1) : (0 * (0 * height + (width + 2)) + 0))) / height < (width + 2)) : height == 0 ? 0 : ((width + 2) < 0 ? (width + 2) < ((((0 * (0 * height + (width + 2)) - 1) < 0) ? - (~ (0 * (0 * height + (width + 2)) + 0) == -1) - ((((0 * (0 * height + (width + 2)) + 1) << (sizeof ((0 * height + (width + 2)) + 0) * 8 - 2)) - 1) * 2 + 1) : (0 * (0 * height + (width + 2)) + 0))) / height : ((((0 * (0 * height + (width + 2)) - 1) < 0) ? ((((0 * (0 * height + (width + 2)) + 1) << (sizeof ((0 * height + (width + 2)) + 0) * 8 - 2)) - 1) * 2 + 1) : (0 * (0 * height + (width + 2)) - 1))) / height < (width + 2))))
+ || ((9223372036854775807L < 18446744073709551615UL ? 9223372036854775807L : 18446744073709551615UL) / sizeof (struct glyph)
+ < (width + 2) * height))
+ fatal ("screen size %dx%d too big", width, height);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49799.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49799.c
new file mode 100644
index 000000000..61ac261be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49799.c
@@ -0,0 +1,25 @@
+/* PR rtl-optimization/49799 */
+/* { dg-do assemble } */
+/* { dg-options "-O2 -w" } */
+
+static __inline int bar(int a)
+{
+ int tmp;
+
+ if (a <= 0) a ^= 0xFFFFFFFF;
+
+ return tmp - 1;
+}
+
+void foo(short *K)
+{
+ short tmp;
+ short *pptr, P[14];
+
+ pptr = P;
+ tmp = bar(*K);
+ *pptr = (*K << tmp) >> 16;
+
+ if (*P < tmp)
+ *K++ = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49860.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49860.c
new file mode 100644
index 000000000..faa5f1fd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49860.c
@@ -0,0 +1,21 @@
+/* { dg-do assemble } */
+/* { dg-options "-O3 -funroll-all-loops" } */
+
+extern char inbuf[];
+extern char outbuf[];
+extern unsigned insize;
+extern unsigned inptr;
+static int max_len;
+static int peek_bits;
+void build_tree() {
+ int len;
+ char *prefixp;
+ max_len = inbuf[inptr++];
+ peek_bits = ((max_len) <= (12) ? (max_len) : (12));
+ prefixp = &outbuf[1<<peek_bits];
+ for (len = 1;
+ len <= peek_bits;
+ len++) {
+ }
+ while (prefixp > outbuf) *--prefixp = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49948.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49948.c
new file mode 100644
index 000000000..8a26d8ede
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49948.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/49948 */
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O3 -ftree-parallelize-loops=2" } */
+
+extern int a, *b;
+int
+foo (void)
+{
+ int c, d = 8, *e[8], i;
+ if (a <= 7)
+ {
+ for (i = 0; i < 8; ++i)
+ e[i] = &c;
+ while (--d)
+ {
+ a = 0;
+ b = e[0];
+ }
+ return 0;
+ }
+ return b == &d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-1.c
new file mode 100644
index 000000000..902466110
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fsched2-use-superblocks -g" } */
+
+void x (int a)
+{
+ __label__ xlab;
+ void y (int b)
+ {
+ switch (b)
+ {
+ case 1:
+ goto xlab;
+ case 2:
+ goto xlab;
+ }
+ }
+ y (a);
+xlab:;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-2.c
new file mode 100644
index 000000000..e1ad6e97c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-omit-frame-pointer -fschedule-insns2 -fsched2-use-superblocks -g" } */
+/* { dg-require-effective-target scheduling } */
+
+int
+bar (int i)
+{
+ while (i)
+ if (i)
+ return i;
+}
+
+void
+foo ()
+{
+ bar (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-3.c
new file mode 100644
index 000000000..72930932f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr49994-3.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsched2-use-superblocks -g -w" } */
+/* { dg-options "-O2 -fsched2-use-superblocks -g -mbackchain" { target s390*-*-* } } */
+/* { dg-require-effective-target scheduling } */
+
+void *
+foo (int offset)
+{
+ switch (offset)
+ {
+ case 0:
+ return __builtin_return_address (0);
+ case 1:
+ return __builtin_return_address (1);
+ case 2:
+ return __builtin_return_address (2);
+ case 3:
+ return __builtin_return_address (3);
+ case 4:
+ return __builtin_return_address (4);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50017.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50017.c
new file mode 100644
index 000000000..feeb4d445
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50017.c
@@ -0,0 +1,21 @@
+/* PR debug/50017 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+struct S { int r, i; };
+
+void
+foo (struct S *x, int y)
+{
+ int i;
+ for (i = 1; i < y; i++)
+ {
+ struct S a, b, c;
+ a = x[0];
+ b = x[i];
+ c.r = a.r * b.r - a.i * b.i;
+ c.i = a.r * b.i + a.i * b.r;
+ x[i] = c;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50078.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50078.c
new file mode 100644
index 000000000..a8aee43fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50078.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/50078 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned nonvolvar[2];
+
+void
+test (int arg)
+{
+ unsigned v = *(volatile unsigned *) (&nonvolvar[arg]);
+ *(volatile unsigned *) (&nonvolvar[arg]) = v;
+}
+
+/* { dg-final { scan-assembler-times "movl\[^\n\r\]*nonvolvar" 2 { target { { i?86-*-* x86_64-*-* } && nonpic } } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50132.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50132.c
new file mode 100644
index 000000000..84a9c731f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50132.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fno-asynchronous-unwind-tables -g" } */
+
+void bar (long double n);
+
+void foo (int c)
+{
+ if (c)
+ bar (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50133.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50133.c
new file mode 100644
index 000000000..2c0f490cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50133.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/50133 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -fno-tree-loop-im" } */
+
+extern int A[], B[];
+
+void
+foo (int z)
+{
+ int j, i;
+ for (j = 0; j < 32; j++)
+ {
+ int a = A[0];
+ for (i = 0; i < 16; i++)
+ a = A[i] ? a : z;
+ B[j] = a;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50161.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50161.c
new file mode 100644
index 000000000..b76ff9a0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50161.c
@@ -0,0 +1,21 @@
+/* PR middle-end/50161 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-ter -funroll-loops" } */
+
+extern void abort (void);
+
+int
+main ()
+{
+ unsigned i;
+ unsigned long a[16];
+
+ for (i = 0; i < 16; i++)
+ a[i] = ~0UL;
+
+ for (i = 0; i < 16; i++)
+ if (__builtin_popcountl (a[i]) != sizeof (a[i]) * 8)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50193-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50193-1.c
new file mode 100644
index 000000000..6abc9c405
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50193-1.c
@@ -0,0 +1,10 @@
+/* PR 50193: ARM: ICE on a | (b << negative-constant) */
+/* Ensure that the compiler doesn't ICE. */
+
+/* { dg-options "-O2" } */
+
+int
+foo(int a, int b)
+{
+ return a | (b << -3); /* { dg-warning "left shift count is negative" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50205.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50205.c
new file mode 100644
index 000000000..ff523d07f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50205.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fno-cprop-registers -fno-dce -fno-forward-propagate -fselective-scheduling2 -funroll-loops -fno-web" } */
+extern int a[];
+
+void foo (void)
+{
+ int i;
+ for (i = 0; i < 199; i++)
+ {
+ if (a[i] != i)
+ __builtin_abort ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50251.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50251.c
new file mode 100644
index 000000000..f791aa882
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50251.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target { ! { x86_64-*-mingw* } } } } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-mpreferred-stack-boundary=12" { target x86_64-*-* } } */
+
+extern void bar (int*);
+
+char *p;
+
+int
+main ()
+{
+ int q;
+ p = __builtin_stack_save ();
+ bar (&q);
+ __builtin_stack_restore (p);
+ bar (&q);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50290.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50290.c
new file mode 100644
index 000000000..47680fd9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50290.c
@@ -0,0 +1,27 @@
+/* PR rtl-optimization/50290 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-loop-optimize -fno-tree-vrp -funroll-loops" } */
+
+static int
+bar (int t[], int b)
+{
+ int i;
+ for (i = 0; i < b; i++)
+ t[i] = i + (i > 0 ? t[i - 1] : 0);
+ return t[b - 1];
+}
+
+static int
+foo (int b)
+{
+ int x[b];
+ return bar (x, b);
+}
+
+int
+main ()
+{
+ if (foo (6) != 15)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50310-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50310-1.c
new file mode 100644
index 000000000..e82276677
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50310-1.c
@@ -0,0 +1,18 @@
+/* PR target/50310 */
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+/* { dg-options "-O3 -mavx -mno-avx2" { target avx_runtime } } */
+
+double s1[4], s2[4];
+long long e[4];
+
+int
+main ()
+{
+ int i;
+ asm volatile ("" : : : "memory");
+ for (i = 0; i < 4; i++)
+ e[i] = __builtin_isunordered (s1[i], s2[i]) && s1[i] != s2[i] ? -1 : 0;
+ asm volatile ("" : : : "memory");
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50310-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50310-2.c
new file mode 100644
index 000000000..29621729e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50310-2.c
@@ -0,0 +1,47 @@
+/* PR target/50310 */
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+/* { dg-options "-O3 -mavx" { target avx_runtime } } */
+
+double s1[4], s2[4], s3[64];
+
+int
+main (void)
+{
+ int i;
+ asm volatile ("" : : : "memory");
+ for (i = 0; i < 4; i++)
+ s3[0 * 4 + i] = __builtin_isgreater (s1[i], s2[i]) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[1 * 4 + i] = (!__builtin_isgreater (s1[i], s2[i])) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[2 * 4 + i] = __builtin_isgreaterequal (s1[i], s2[i]) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[3 * 4 + i] = (!__builtin_isgreaterequal (s1[i], s2[i])) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[4 * 4 + i] = __builtin_isless (s1[i], s2[i]) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[5 * 4 + i] = (!__builtin_isless (s1[i], s2[i])) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[6 * 4 + i] = __builtin_islessequal (s1[i], s2[i]) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[7 * 4 + i] = (!__builtin_islessequal (s1[i], s2[i])) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[8 * 4 + i] = __builtin_islessgreater (s1[i], s2[i]) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[9 * 4 + i] = (!__builtin_islessgreater (s1[i], s2[i])) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[10 * 4 + i] = __builtin_isunordered (s1[i], s2[i]) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[11 * 4 + i] = (!__builtin_isunordered (s1[i], s2[i])) ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[12 * 4 + i] = s1[i] > s2[i] ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[13 * 4 + i] = s1[i] >= s2[i] ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[14 * 4 + i] = s1[i] < s2[i] ? -1.0 : 0.0;
+ for (i = 0; i < 4; i++)
+ s3[15 * 4 + i] = s1[i] <= s2[i] ? -1.0 : 0.0;
+ asm volatile ("" : : : "memory");
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50340.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50340.c
new file mode 100644
index 000000000..18430366f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50340.c
@@ -0,0 +1,46 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O3 -fselective-scheduling2 -funroll-loops" } */
+extern int mode_size[];
+typedef unsigned HARD_REG_SET[ ((64 + 32 - 1) / 32) ];
+enum reload_type {
+ RELOAD_FOR_INPUT,
+ RELOAD_FOR_OUTPUT,
+ RELOAD_FOR_INSN,
+ RELOAD_FOR_INPUT_ADDRESS,
+ RELOAD_FOR_OUTPUT_ADDRESS,
+ RELOAD_FOR_OPERAND_ADDRESS,
+ RELOAD_FOR_OPADDR_ADDR,
+ RELOAD_OTHER,
+ RELOAD_FOR_OTHER_ADDRESS
+};
+static HARD_REG_SET reload_reg_used;
+static HARD_REG_SET reload_reg_used_in_input_addr[10];
+static HARD_REG_SET reload_reg_used_in_output_addr[10];
+static HARD_REG_SET reload_reg_used_in_input[10];
+static HARD_REG_SET reload_reg_used_in_output[10];
+static HARD_REG_SET reload_reg_used_in_op_addr;
+static HARD_REG_SET reload_reg_used_in_op_addr_reload;
+static HARD_REG_SET reload_reg_used_in_insn;
+static HARD_REG_SET reload_reg_used_in_other_addr;
+static HARD_REG_SET reload_reg_used_at_all;
+void __attribute__((cold)) mark_reload_reg_in_use (regno, opnum, type, mode)
+{
+ int nregs = regno ? 1 : mode_size[mode];
+ int i;
+ for (i = regno; i < nregs + regno; i++)
+ {
+ switch (type)
+ {
+ case RELOAD_OTHER: reload_reg_used[i / 32u] |= 1 << i % 32u; break;
+ case RELOAD_FOR_INPUT_ADDRESS: reload_reg_used_in_input_addr[opnum][i / 32u] |= 1 << i % 32u; break;
+ case RELOAD_FOR_OUTPUT_ADDRESS: reload_reg_used_in_output_addr[opnum][i / 32u] |= 1 << i % 32u; break;
+ case RELOAD_FOR_OPERAND_ADDRESS: reload_reg_used_in_op_addr[i / 32u] |= 1 << i % 32u; break;
+ case RELOAD_FOR_OPADDR_ADDR: reload_reg_used_in_op_addr_reload[i / 32u] |= 1 << i % 32u; break;
+ case RELOAD_FOR_OTHER_ADDRESS: reload_reg_used_in_other_addr[i / 32u] |= 1; break;
+ case RELOAD_FOR_INPUT: reload_reg_used_in_input[opnum][i / 32u] |= 1 << i % 32u; break;
+ case RELOAD_FOR_OUTPUT: reload_reg_used_in_output[opnum][i / 32u] |= 1 << i % 32u; break;
+ case RELOAD_FOR_INSN: reload_reg_used_in_insn[i / 32u] |= 1 << i % 32u;
+ }
+ reload_reg_used_at_all[i / 32u] |= 1 << i;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50527.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50527.c
new file mode 100644
index 000000000..824c3fc60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50527.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-options "-Os --param large-stack-frame=30 -Wno-pointer-to-int-cast" } */
+
+extern void abort (void);
+
+void __attribute__((noinline))
+bar (char *a)
+{
+}
+
+void __attribute__((noinline))
+foo (char *a, int b)
+{
+}
+
+void __attribute__((noinline))
+test_align (char *p, int aligned, unsigned int mask)
+{
+ int p_aligned = ((unsigned long int)p & mask) == 0;
+ if (aligned != p_aligned)
+ abort ();
+}
+
+int
+main ()
+{
+ const int kIterations = 4;
+ char results[kIterations];
+ int i;
+ unsigned int mask;
+
+ mask = 0xf;
+ test_align (results, ((unsigned long int)results & mask) == 0, mask);
+ mask = 0x7;
+ test_align (results, ((unsigned long int)results & mask) == 0, mask);
+ mask = 0x3;
+ test_align (results, ((unsigned long int)results & mask) == 0, mask);
+ mask = 0x1;
+ test_align (results, ((unsigned long int)results & mask) == 0, mask);
+
+ bar (results);
+ for (i = 0; i < kIterations; i++)
+ foo ("%d ", results[i]);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50571.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50571.c
new file mode 100644
index 000000000..3fb4310d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50571.c
@@ -0,0 +1,11 @@
+/* PR inline-asm/50571 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+static const int var[4] = { 1, 2, 3, 4 };
+
+void
+foo (void)
+{
+ __asm volatile ("" : : "m" (*(int *) var));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50604.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50604.c
new file mode 100644
index 000000000..1ab465a10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50604.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/50604 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include "strlenopt.h"
+
+typedef char T;
+extern const T s[];
+
+void
+foo (T *x)
+{
+ char *r = malloc (strlen (x));
+ strcpy (r, s);
+ strcat (r, x);
+ strcat (r, "/");
+}
+
+const T s[] = "abcdefghijklmnopq";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50613.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50613.c
new file mode 100644
index 000000000..27c6fba36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50613.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/50613 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-ccp" } */
+
+#include "strlenopt.h"
+
+char buf[26];
+
+static inline void
+bar (char *__restrict dest, const char *__restrict src)
+{
+ strcpy (dest, src);
+}
+
+void
+foo (char *p)
+{
+ if (strlen (p) < 50)
+ bar (buf, p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50717-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50717-1.c
new file mode 100644
index 000000000..afbe542a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50717-1.c
@@ -0,0 +1,26 @@
+/* PR tree-optimization/50717 */
+/* Ensure that widening multiply-and-accumulate is not used where integer
+ type promotion or users' casts should prevent it. */
+
+/* { dg-options "-O2 -fdump-tree-widening_mul" } */
+
+long long
+f (unsigned int a, char b, long long c)
+{
+ return (a * b) + c;
+}
+
+int
+g (short a, short b, int c)
+{
+ return (short)(a * b) + c;
+}
+
+int
+h (char a, char b, int c)
+{
+ return (char)(a * b) + c;
+}
+
+/* { dg-final { scan-tree-dump-times "WIDEN_MULT_PLUS_EXPR" 0 "widening_mul" } } */
+/* { dg-final { cleanup-tree-dump "widening_mul" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50763-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50763-2.c
new file mode 100644
index 000000000..a9d12e8f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50763-2.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef union tree_node *tree;
+
+struct tree_base
+{
+ int code;
+};
+
+struct tree_typed
+{
+ struct tree_base base;
+ tree type;
+};
+
+struct tree_common
+{
+ struct tree_typed typed;
+};
+
+struct tree_type_common
+{
+ tree main_variant;
+};
+
+union tree_node
+{
+ struct tree_base base;
+ struct tree_typed typed;
+ struct tree_type_common type_common;
+};
+
+int std_canonical_va_list_type (tree type)
+{
+ if (type->base.code)
+ type = type->typed.type;
+ else
+ if (type->typed.type->base.code)
+ type = type->typed.type;
+
+ if (type->type_common.main_variant)
+ return 1;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50763-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50763-5.c
new file mode 100644
index 000000000..e5952d09c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50763-5.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+struct inode
+{
+ unsigned short i_mode;
+ unsigned int i_flags;
+};
+
+static inline int
+is_sxid (unsigned int mode)
+{
+ return (mode & 0004000) || ((mode & 0002000) && (mode & 00010));
+};
+
+void
+gfs2_set_inode_flags (int ip, struct inode *inode)
+{
+ unsigned int flags = inode->i_flags;
+ if ((ip == 0) && !is_sxid (inode->i_mode))
+ inode->i_flags |= 4096;
+ inode->i_flags = flags;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50763.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50763.c
new file mode 100644
index 000000000..695b61c75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50763.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-pre" } */
+
+int bar (int i);
+
+void
+foo (int c, int d)
+{
+ if (bar (c))
+ bar (c);
+ d = 33;
+ while (c == d);
+}
+
+/* { dg-final { scan-tree-dump-times "== 33" 2 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50764.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50764.c
new file mode 100644
index 000000000..e3b8da867
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50764.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsched2-use-superblocks -ftree-tail-merge" } */
+
+typedef int aligned __attribute__ ((aligned (64)));
+extern void abort (void);
+
+int bar (void *p);
+
+void
+foo (void)
+{
+ char *p = __builtin_alloca (13);
+ aligned i;
+
+ if (bar (p) || bar (&i))
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50765.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50765.c
new file mode 100644
index 000000000..6e1c69747
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50765.c
@@ -0,0 +1,10 @@
+/* PR tree-optimization/50765 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-tree-dce" } */
+
+void
+foo (long *w, long *x, unsigned char *y, int z)
+{
+ for (; z < 429; z++)
+ w[z] = (-19 ^ y[z]) & x[z];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50827.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50827.c
new file mode 100644
index 000000000..5d258bfcf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50827.c
@@ -0,0 +1,17 @@
+/* PR debug/50827 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -funroll-loops" } */
+
+void
+foo (int w, int x, int *y, int *z)
+{
+ float f;
+ while (w--)
+ {
+ f = x;
+ if (y)
+ *y = (__INTPTR_TYPE__) y + w;
+ if (z)
+ *z = w;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50908-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50908-2.c
new file mode 100644
index 000000000..1c06da7b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50908-2.c
@@ -0,0 +1,80 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge -fno-short-enums" } */
+
+typedef struct rtx_def *rtx;
+enum debug_info_levels
+{
+ ARM_FLOAT_ABI_SOFT, ARM_FLOAT_ABI_SOFTFP, ARM_FLOAT_ABI_HARD
+};
+struct gcc_options
+{
+ int x_target_flags;
+};
+extern struct gcc_options global_options;
+extern int arm_arch_thumb2;
+enum rtx_code
+{
+ UNSPEC, UNSPEC_VOLATILE, ADDR_VEC, SET, CLOBBER, CALL, RETURN,
+ SIMPLE_RETURN, EH_RETURN, TRAP_IF, CONST_INT, CONST_FIXED, CONST_DOUBLE,
+ CONST_VECTOR, CONST_STRING, CONST, PC, REG, SCRATCH, SUBREG,
+ STRICT_LOW_PART, CONCAT, CONCATN, MEM, LABEL_REF, SYMBOL_REF, CC0,
+ IF_THEN_ELSE, COMPARE, PLUS, MINUS, NEG, MULT, SS_MULT, US_MULT, DIV,
+ SS_DIV, US_DIV, MOD, UDIV, UMOD, AND, IOR, XOR, NOT, ASHIFT, ROTATE,
+ ASHIFTRT, LSHIFTRT, ROTATERT, PRE_DEC, PRE_INC, POST_DEC, POST_INC,
+ PRE_MODIFY, POST_MODIFY, NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU,
+ UNORDERED, ORDERED, UNEQ, UNGE, UNGT, UNLE, UNLT, LTGT, SIGN_EXTEND,
+ ZERO_EXTEND, TRUNCATE, FLOAT_EXTEND, FLOAT_TRUNCATE, FLOAT, FIX,
+ UNSIGNED_FLOAT, UNSIGNED_FIX, SIGN_EXTRACT, ZERO_EXTRACT, HIGH, LO_SUM,
+ VEC_MERGE, VEC_SELECT, VEC_CONCAT, VEC_DUPLICATE, SS_PLUS, US_PLUS,
+ SS_MINUS, SS_NEG, US_NEG, SS_ABS, SS_ASHIFT, US_ASHIFT, US_MINUS,
+ SS_TRUNCATE, US_TRUNCATE, FMA, VAR_LOCATION, DEBUG_IMPLICIT_PTR,
+ ENTRY_VALUE, DEBUG_PARAMETER_REF, LAST_AND_UNUSED_RTX_CODE
+};
+union rtunion_def
+{
+};
+struct rtx_def
+{
+ enum rtx_code code:16;
+}
+builtin_info_type;
+enum constraint_num
+{
+ CONSTRAINT__UNKNOWN =
+ 0, CONSTRAINT_f, CONSTRAINT_t, CONSTRAINT_v, CONSTRAINT_w, CONSTRAINT_x,
+ CONSTRAINT_y, CONSTRAINT_z, CONSTRAINT_l, CONSTRAINT_h, CONSTRAINT_j,
+ CONSTRAINT_Pj, CONSTRAINT_PJ, CONSTRAINT_k, CONSTRAINT_b, CONSTRAINT_c,
+ CONSTRAINT_I, CONSTRAINT_J, CONSTRAINT_K, CONSTRAINT_L, CONSTRAINT_M,
+ CONSTRAINT_N, CONSTRAINT_O, CONSTRAINT_Pa, CONSTRAINT_Pb, CONSTRAINT_Pc,
+ CONSTRAINT_Pd, CONSTRAINT_Ps, CONSTRAINT_Pt, CONSTRAINT_Pu, CONSTRAINT_Pv,
+ CONSTRAINT_Pw, CONSTRAINT_Px, CONSTRAINT_Py, CONSTRAINT_G, CONSTRAINT_H,
+ CONSTRAINT_Dz, CONSTRAINT_Da, CONSTRAINT_Db, CONSTRAINT_Dc, CONSTRAINT_Di,
+ CONSTRAINT_Dn, CONSTRAINT_Dl, CONSTRAINT_DL, CONSTRAINT_Dv, CONSTRAINT_Dy,
+ CONSTRAINT_Ut, CONSTRAINT_Uv, CONSTRAINT_Uy, CONSTRAINT_Un, CONSTRAINT_Um,
+ CONSTRAINT_Us, CONSTRAINT_Uq, CONSTRAINT_Q, CONSTRAINT_Uu, CONSTRAINT_Uw,
+ CONSTRAINT__LIMIT
+};
+typedef struct VEC_char_base
+{
+}
+VEC_int_heap;
+static inline int
+satisfies_constraint_j (rtx op)
+{
+ long long ival = 0;
+ return ((((!((global_options.x_target_flags & (1 << 14)) != 0))
+ || arm_arch_thumb2) && arm_arch_thumb2))
+ && ((((enum rtx_code) (op)->code) == HIGH)
+ || ((((enum rtx_code) (op)->code) == CONST_INT)
+ && (((ival & 0xffff0000) == 0))));
+}
+
+int
+constraint_satisfied_p (rtx op, enum constraint_num c)
+{
+ switch (c)
+ {
+ case CONSTRAINT_j:
+ return satisfies_constraint_j (op);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50908-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50908-3.c
new file mode 100644
index 000000000..60db03dae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50908-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+extern int v1;
+extern int v2;
+
+void
+f ()
+{
+ if (v2 || v1)
+ (!(v1)) ? (void) 0 : (void) g ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr50908.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr50908.c
new file mode 100644
index 000000000..75341f8f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr50908.c
@@ -0,0 +1,175 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -ftree-tail-merge" } */
+
+enum Lisp_Type
+{
+ Lisp_Int0 = 0, Lisp_Int1 = 4, Lisp_Symbol = 2, Lisp_Misc = 3, Lisp_String =
+ 1, Lisp_Vectorlike = 5, Lisp_Cons = 6, Lisp_Float = 7,
+};
+typedef long Lisp_Object;
+enum pvec_type
+{
+ PVEC_NORMAL_VECTOR = 0, PVEC_PROCESS = 0x200, PVEC_FRAME =
+ 0x400, PVEC_COMPILED = 0x800, PVEC_WINDOW =
+ 0x1000, PVEC_WINDOW_CONFIGURATION = 0x2000, PVEC_SUBR =
+ 0x4000, PVEC_CHAR_TABLE = 0x8000, PVEC_BOOL_VECTOR =
+ 0x10000, PVEC_BUFFER = 0x20000, PVEC_HASH_TABLE = 0x40000, PVEC_TERMINAL =
+ 0x80000, PVEC_SUB_CHAR_TABLE = 0x100000, PVEC_FONT =
+ 0x200000, PVEC_OTHER = 0x400000, PVEC_TYPE_MASK = 0x7ffe00
+};
+struct Lisp_Vector
+{
+ unsigned long size;
+};
+struct Lisp_Char_Table
+{
+ Lisp_Object defalt;
+ Lisp_Object ascii;
+};
+struct Lisp_Sub_Char_Table
+{
+ Lisp_Object contents[1];
+};
+extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
+struct buffer_text
+{
+ unsigned char *beg;
+ long gpt_byte;
+ long gap_size;
+};
+struct buffer
+{
+ struct buffer_text *text;
+ struct region_cache *width_run_cache;
+ Lisp_Object tab_width;
+ Lisp_Object ctl_arrow;
+};
+extern struct buffer *current_buffer;
+extern Lisp_Object Vchar_width_table;
+struct frame
+{
+ long text_lines, text_cols;
+};
+struct window
+{
+ Lisp_Object frame;
+};
+extern Lisp_Object Vtruncate_partial_width_windows;
+extern struct Lisp_Char_Table *window_display_table (struct window *);
+struct position *
+compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos,
+ width, hscroll, tab_offset, win)
+ long from, fromvpos, fromhpos, to, tovpos, tohpos;
+ struct window *win;
+{
+ register long hpos = fromhpos;
+ register long pos;
+ long pos_byte;
+ register int c = 0;
+ register struct Lisp_Char_Table *dp = window_display_table (win);
+ long wide_column_end_hpos = 0;
+ long continuation_glyph_width;
+ while (1)
+ {
+ if (hpos > width)
+ {
+ int total_width = width + continuation_glyph_width;
+ if (!((Vtruncate_partial_width_windows) == (Qnil))
+ && (total_width <
+ (((void) 0,
+ (struct frame
+ *) ((long) (((win)->frame) & ~((((long) 1) << 3) -
+ 1)))))->text_cols))
+ {
+ if (pos <= to)
+ {
+ pos = find_before_next_newline (pos, to, 1);
+ }
+ if (wide_column_end_hpos > width)
+ {
+ hpos -= width;
+ }
+ }
+ }
+ else
+ {
+ Lisp_Object charvec;
+ c =
+ *(((((pos_byte)) >=
+ (current_buffer->text->gpt_byte) ? (current_buffer->text->
+ gap_size) : 0) +
+ ((pos_byte)) + (current_buffer->text->beg) - ((1))));
+ if (current_buffer->width_run_cache)
+ {
+ if (((((enum Lisp_Type) (((unsigned long) ((charvec))) &
+ ((((long) 1) << 3) - 1))) ==
+ Lisp_Vectorlike)
+ &&
+ !(((void) 0,
+ (struct Lisp_Vector
+ *) ((long) ((charvec) & ~((((long) 1) << 3) - 1))))->
+ size & ((((unsigned long) 1 << (64 - 1)) >> 1)))))
+ {
+ unsigned char *ptr;
+ int bytes, width, wide_column;
+ do
+ {
+ if ((!((*ptr) & 0x80) ? 1 : !((*ptr) & 0x20) ? 2 :
+ !((*ptr) & 0x10) ? 3 : !((*ptr) & 0x08) ? 4 : 5) !=
+ bytes)
+ width = bytes * 4;
+ else
+ {
+ if (dp != 0
+ &&
+ ((((enum
+ Lisp_Type) (((unsigned
+ long) (((((unsigned) (c) <
+ 0x80)
+ ? ((((dp)->ascii) ==
+ (Qnil)) ? (dp)->
+ defalt
+ : (((((enum
+ Lisp_Type)
+ (((unsigned
+ long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && !(((void) 0, (struct Lisp_Vector *) ((long) (((((unsigned) (c) < 0x80) ? ((((dp)->ascii) == (Qnil)) ? (dp)->defalt : (((((enum Lisp_Type) (((unsigned long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))) & ~((((long) 1) << 3) - 1))))->size & ((((unsigned long) 1 << (64 - 1)) >> 1)))))
+ width =
+ ((void) 0,
+ (struct Lisp_Vector
+ *) ((long) (((((unsigned) (c) <
+ 0x80) ? ((((dp)->ascii) ==
+ (Qnil)) ? (dp)->
+ defalt
+ : (((((enum
+ Lisp_Type) (((unsigned long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))) & ~((((long) 1) << 3) - 1))))->size;
+ else
+ width =
+ (((unsigned) (c) < 0x80) ? (c <
+ 0x20 ? (c ==
+ '\t'
+ ? ((((long)
+ (current_buffer->
+ tab_width))
+ >> (3 -
+ 1)))
+ : (c ==
+ '\n' ? 0
+ : (((current_buffer->ctl_arrow) == (Qnil)) ? 4 : 2))) : (c < 0x7f ? 1 : ((((current_buffer->ctl_arrow) == (Qnil)) ? 4 : 2)))) : (((long) ((((unsigned) (c) < 0x80) ? (
+ {
+ Lisp_Object
+ _val;
+ _val;}
+ ): char_table_ref ((Vchar_width_table), (c))))) >> (3 - 1)));
+ if (width > 1)
+ wide_column = width;
+ }
+ }
+ while (0);
+ if (wide_column)
+ wide_column_end_hpos = hpos + wide_column;
+ }
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51012-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51012-1.c
new file mode 100644
index 000000000..36c788bd5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51012-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-early-inlining -fno-ipa-cp" } */
+
+float baz (void)
+{
+ return 0;
+}
+
+static inline int bar (int (*ibaz) (void))
+{
+ return ibaz ();
+}
+
+void foo (void)
+{
+ bar((int (*)(void))baz);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51012-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51012-2.c
new file mode 100644
index 000000000..fcc8cea7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51012-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-early-inlining" } */
+
+float baz (void)
+{
+ return 0;
+}
+
+static inline int bar (int (*ibaz) (void))
+{
+ return ibaz ();
+}
+
+void foo (void)
+{
+ bar((int (*)(void))baz);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51034.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51034.c
new file mode 100644
index 000000000..c9b9c27c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51034.c
@@ -0,0 +1,14 @@
+/* PR c/51034 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+struct S;
+
+int
+main ()
+{
+ struct R { typeof (((struct W) {})) x; } r; /* { dg-error "invalid use of undefined type" } */
+ struct S { typeof (((struct S) {})) x; } s; /* { dg-error "invalid use of undefined type" } */
+ struct T { int x[sizeof ((struct T) {})]; } t;/* { dg-error "invalid use of undefined type" } */
+ struct U { int x[sizeof((struct V){})];} u; /* { dg-error "invalid use of undefined type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51039.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51039.c
new file mode 100644
index 000000000..863a6ff16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51039.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -finline-small-functions -fno-ipa-pure-const" } */
+
+float baz (void)
+{
+ return 0;
+}
+
+static inline int bar (int (*ibaz) (void))
+{
+ return ibaz ();
+}
+
+void foo (void)
+{
+ bar((int (*)(void))baz);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51261.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51261.c
new file mode 100644
index 000000000..b599a6b7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51261.c
@@ -0,0 +1,9 @@
+/* PR target/51261 */
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug" } */
+
+void
+foo (void *p, int n)
+{
+ __builtin_memset (p, 0xff, n);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51321.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51321.c
new file mode 100644
index 000000000..0e836cfe6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51321.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+int main ()
+{
+ return (__builtin_types_compatible_p (char[1][], char[1][1])); /* { dg-error "array type has incomplete element type" } */
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51408.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51408.c
new file mode 100644
index 000000000..2cc5cf967
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51408.c
@@ -0,0 +1,22 @@
+/* This testcase used to fail because of a bug in
+ arm.md:*minmax_arithsi. */
+
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+extern void abort (void);
+
+int __attribute__((noinline))
+foo (int a, int b)
+{
+ int max = (b > 0) ? b : 0;
+ return max - a;
+}
+
+int
+main (void)
+{
+ if (foo (3, -1) != -3)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51481.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51481.c
new file mode 100644
index 000000000..d883d475c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51481.c
@@ -0,0 +1,33 @@
+/* PR tree-optimization/51481 */
+/* { dg-do compile } */
+/* { dg-options "-O -fexceptions -fipa-cp -fipa-cp-clone" } */
+
+extern const unsigned short int **foo (void)
+ __attribute__ ((__nothrow__, __const__));
+struct S { unsigned short s1; int s2; };
+extern struct S *s[26];
+
+void
+bar (int x, struct S *y, ...)
+{
+ static struct S *t;
+ __builtin_va_list ap;
+ __builtin_va_start (ap, y);
+ if (t != s[7])
+ {
+ const char *p = "aAbBc";
+ t = s[7];
+ while ((*foo ())[(unsigned char) *p])
+ p++;
+ }
+ __builtin_printf (x == 0 ? "abc\n" : "def\n");
+ if (y != 0)
+ __builtin_printf ("ghi %d %d", y->s2, y->s1);
+ __builtin_va_end (ap);
+}
+
+void
+baz (char *x)
+{
+ bar (1, 0, x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51491-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51491-2.c
new file mode 100644
index 000000000..79adcf652
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51491-2.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp1" } */
+
+int g (int *);
+
+int
+f (int n)
+{
+ int tt = 0;
+ int t = 4;
+ {
+ int a[t
+ + (tt != 0 ? 6 : 0)
+ ];
+ tt = g (a);
+ {
+ int b[n];
+ tt += g (b);
+ if (n > 20)
+ tt += 148 * g (b);
+ tt += b[0];
+ }
+ tt += a[0];
+ }
+ {
+ int a[4];
+ tt += g (a);
+ tt += a[0];
+ }
+ return tt;
+}
+
+/* { dg-final { scan-tree-dump-times "CLOBBER" 2 "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51491.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51491.c
new file mode 100644
index 000000000..50aa55f7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51491.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-expand" } */
+
+
+int g(int*);
+
+int f(void)
+{
+ int tt = 0;
+ int t = 4;
+ {
+ int a[t];
+ tt = g(a);
+ tt += a[0];
+ }
+ {
+ int a[4];
+ tt += g(a);
+ tt += a[0];
+ }
+ return tt;
+}
+
+/* { dg-final { scan-rtl-dump-times "Partition" 1 "expand"} } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51505.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51505.c
new file mode 100644
index 000000000..dbcd3226d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51505.c
@@ -0,0 +1,19 @@
+/* PR rtl-optimization/51505 */
+/* { dg-do compile } */
+/* { dg-options "-O --param max-cse-insns=1" } */
+struct S
+{
+char a[256];
+};
+
+int bar(struct S, char[16]);
+
+void foo ()
+{
+ struct S u, s1, s2;
+ char e[256];
+ char i;
+ e[i] = ~s1.a[i] & s2.a[i];
+ if (bar(u, e))
+ __builtin_abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51519.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51519.c
new file mode 100644
index 000000000..3d5d3f243
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51519.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-guess-branch-probability -findirect-inlining" } */
+
+void fe (void);
+int i;
+
+static inline void
+FX (void (*f) (void))
+{
+ fe ();
+ (*f) ();
+}
+
+static inline void
+f4 ()
+{
+ if (i)
+ FX (fe);
+}
+
+static inline void
+f3 (void)
+{
+ f4 ();
+ if (i)
+ FX (f4);
+}
+
+static inline void
+f2 (void)
+{
+ FX (&f3);
+}
+
+void
+f1 (void)
+{
+ FX (&f2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51557.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51557.c
new file mode 100644
index 000000000..692cd00e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51557.c
@@ -0,0 +1,17 @@
+/* PR debug/51557 */
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-Os -fno-asynchronous-unwind-tables -g -fsel-sched-pipelining -fselective-scheduling2" } */
+
+extern int baz (void);
+extern void bar (int, int, int, int, int, int, int);
+
+void
+synth (int *values, int n_values, int ci, int s1, int v, int s2)
+{
+ while (--s1)
+ {
+ int r1 = values[s1];
+ int co = ci ? r1 : baz () < r1;
+ bar (0, n_values, s1, s2, v, co, 0);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51644.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51644.c
new file mode 100644
index 000000000..2038a0c4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51644.c
@@ -0,0 +1,33 @@
+/* PR middle-end/51644 */
+/* { dg-do compile } */
+/* { dg-options "-Wall -fexceptions" } */
+
+#include <stdarg.h>
+
+extern void baz (int, va_list) __attribute__ ((__noreturn__));
+
+__attribute__ ((__noreturn__))
+void
+foo (int s, ...)
+{
+ va_list ap;
+ va_start (ap, s);
+ baz (s, ap);
+ va_end (ap);
+} /* { dg-bogus "function does return" } */
+
+__attribute__ ((__noreturn__))
+void
+bar (int s, ...)
+{
+ va_list ap1;
+ va_start (ap1, s);
+ {
+ va_list ap2;
+ va_start (ap2, s);
+ baz (s, ap1);
+ baz (s, ap2);
+ va_end (ap2);
+ }
+ va_end (ap1);
+} /* { dg-bogus "function does return" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51683.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51683.c
new file mode 100644
index 000000000..f5a4a8be4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51683.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/51683 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static inline void *
+bar (void *p, void *q, int r)
+{
+ return __builtin_memcpy (p, q, r);
+}
+
+void *
+foo (void *p)
+{
+ return bar ((void *) 0x12345000, p, 256);
+}
+
+/* { dg-final { scan-tree-dump "memcpy" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51695.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51695.c
new file mode 100644
index 000000000..6eb45400b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51695.c
@@ -0,0 +1,52 @@
+/* PR debug/51695 */
+/* { dg-do compile { target { int32plus } } } */
+/* { dg-options "-O2 -g" } */
+
+typedef struct
+{
+ struct { unsigned int t1, t2, t3, t4, t5, t6; } t;
+ int p;
+ struct { double X, Y, Z; } r;
+} T;
+typedef struct { T *h; } S;
+
+static unsigned int v = 0x12345678;
+
+int
+foo (void)
+{
+ v = (v & 0x80000000) ? ((v << 1) ^ 0xa398655d) : (v << 1);
+ return 0;
+}
+
+double
+bar (void)
+{
+ unsigned int o;
+ v = (v & 0x80000000) ? ((v << 1) ^ 0xa398655d) : (v << 1);
+ o = v & 0xffff;
+ return (double) o / 32768.0;
+}
+
+int
+baz (void)
+{
+ foo ();
+ return 0;
+}
+
+void
+test (S *x)
+{
+ T *t = x->h;
+ t->t.t1 = foo ();
+ t->t.t2 = foo ();
+ t->t.t3 = foo ();
+ t->t.t4 = foo ();
+ t->t.t5 = foo ();
+ t->t.t6 = foo ();
+ t->p = baz ();
+ t->r.X = bar ();
+ t->r.Y = bar ();
+ t->r.Z = bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51721.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51721.c
new file mode 100644
index 000000000..b39adfb50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51721.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/51721 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Warray-bounds" } */
+
+static int a[10], b[10], c[10], d[10];
+
+unsigned int
+f (unsigned int v)
+{
+ return v == 17 ? 11 : v;
+}
+
+unsigned int
+g (unsigned int v)
+{
+ return v == 17 ? 17 : v;
+}
+
+void
+t (unsigned int s)
+{
+ if (s >> 1 == 0)
+ {
+ a[f (s)] = 0; /* { dg-bogus "array subscript is above array bounds" } */
+ a[f (s)] = 0; /* { dg-bogus "array subscript is above array bounds" } */
+ b[f (s)] = 0; /* { dg-bogus "array subscript is above array bounds" } */
+ c[g (s)] = 0; /* { dg-bogus "array subscript is above array bounds" } */
+ c[g (s)] = 0; /* { dg-bogus "array subscript is above array bounds" } */
+ d[f (s)] = 0; /* { dg-bogus "array subscript is above array bounds" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51762.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51762.c
new file mode 100644
index 000000000..9c59f338c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51762.c
@@ -0,0 +1,19 @@
+/* PR debug/51762 */
+/* { dg-do compile } */
+/* { dg-options "-g -Os -fomit-frame-pointer -fno-asynchronous-unwind-tables" } */
+
+void noret (void) __attribute__ ((noreturn));
+int bar (void);
+void baz (const char *);
+static int v = -1;
+
+void
+foo (void)
+{
+ if (bar () && v == -1)
+ {
+ baz ("baz");
+ noret ();
+ }
+ noret ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51796.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51796.c
new file mode 100644
index 000000000..c07ad1087
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51796.c
@@ -0,0 +1,15 @@
+/* PR bootstrap/51796 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fno-omit-frame-pointer -fno-tree-dominator-opts -fno-tree-fre -fno-tree-pre" } */
+
+typedef void (*entry_func) (void) __attribute__ ((noreturn));
+extern entry_func entry_addr;
+static void bsd_boot_entry (void)
+{
+ stop ();
+}
+void bsd_boot (void)
+{
+ entry_addr = (entry_func) bsd_boot_entry;
+ (*entry_addr) ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51821.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51821.c
new file mode 100644
index 000000000..f2571123f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51821.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99 -O2" } */
+/* { dg-additional-options "-msse" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
+
+extern void abort (void);
+
+unsigned int __attribute__((noinline))
+test (int shift_size)
+{
+ unsigned long long res = ~0;
+
+ return res << shift_size;
+}
+
+int
+main ()
+{
+ int dst = 32;
+
+ if (test (dst) != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51865.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51865.c
new file mode 100644
index 000000000..9b4595cce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51865.c
@@ -0,0 +1,25 @@
+/* PR tree-optimization/51865 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-pta" } */
+
+void fn (const char *, const char *) __attribute__ ((__noreturn__));
+int var;
+
+inline void
+foo (void)
+{
+ if (__builtin_expect (var != 0, 0))
+ fn ("a", "b");
+};
+
+void
+bar (void)
+{
+ foo ();
+};
+
+void
+baz (void)
+{
+ foo ();
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51867.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51867.c
new file mode 100644
index 000000000..3e669cf7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51867.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -fno-math-errno -fdump-rtl-expand" } */
+
+extern float sqrtf(float);
+
+float a(float x)
+{
+ return sqrtf(x);
+}
+float b(float x)
+{
+ return sqrtf(x);
+}
+/* Here the calls to sqrtf should be expanded into CALL_INSNs, rather than
+ fpu sqrtf rtl patterns. */
+/* { dg-final { scan-rtl-dump-times "call_insn" 2 "expand" } } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-12.c
new file mode 100644
index 000000000..1b25e296f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-12.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+__attribute__((pure)) int bar (int);
+__attribute__((pure)) int bar2 (int);
+void baz (int);
+
+int x, z;
+
+void
+foo (int y)
+{
+ int a = 0;
+ if (y == 6)
+ {
+ a += bar (7);
+ a += bar2 (6);
+ }
+ else
+ {
+ a += bar2 (6);
+ a += bar (7);
+ }
+ baz (a);
+}
+
+/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times "bar2 \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-16.c
new file mode 100644
index 000000000..3a84e9746
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-16.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+struct S {
+ int i;
+};
+
+extern struct S foo (void);
+extern int foo2 (void);
+
+struct S s;
+
+int bar (int c) {
+ int r;
+
+ if (c)
+ {
+ s = foo ();
+ r = foo2 ();
+ }
+ else
+ {
+ s = foo ();
+ r = foo2 ();
+ }
+
+ return r;
+}
+
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times "foo2 \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-17.c
new file mode 100644
index 000000000..806fe7b0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-17.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+struct S {
+ int i;
+};
+
+extern struct S foo (void);
+extern int foo2 (void);
+
+struct S s, s2;
+
+int bar (int c) {
+ int r;
+
+ if (c)
+ {
+ s = foo ();
+ r = foo2 ();
+ }
+ else
+ {
+ s2 = foo ();
+ r = foo2 ();
+ }
+
+ return r;
+}
+
+/* { dg-final { scan-tree-dump-times "foo \\(" 2 "pre"} } */
+/* { dg-final { scan-tree-dump-times "foo2 \\(" 2 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c
new file mode 100644
index 000000000..95629f122
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-18.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre -fno-tree-copy-prop -fno-tree-dominator-opts -fno-tree-copyrename" } */
+
+extern int foo (void);
+
+void bar (int c, int *p)
+{
+ int *q = p;
+
+ if (c)
+ *p = foo ();
+ else
+ *q = foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "foo \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-2.c
new file mode 100644
index 000000000..db385cba4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int bar (int);
+void baz (int);
+
+void
+foo (int y)
+{
+ int a;
+ if (y)
+ baz (bar (7) + 6);
+ else
+ baz (bar (7) + 6);
+}
+
+/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times "baz \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-3.c
new file mode 100644
index 000000000..be4b37432
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-3.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int bar (int);
+void baz (int);
+
+void
+foo (int y)
+{
+ int a;
+ if (y == 6)
+ a = bar (7) + 6;
+ else
+ a = bar (7) + 6;
+ baz (a);
+}
+
+/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-4.c
new file mode 100644
index 000000000..5cb47afdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int bar (int);
+void baz (int);
+
+int foo (int y)
+{
+ int a, b;
+ a = bar (7) + 6;
+ b = bar (7) + 6;
+ return a + b;
+}
+
+/* { dg-final { scan-tree-dump-times "bar \\(" 2 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-6.c
new file mode 100644
index 000000000..8362a1700
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-6.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+
+int bar (int);
+void baz (int);
+void bla (int);
+
+void
+foo (int y)
+{
+ int a;
+ if (y == 6)
+ {
+ bla (5);
+ a = bar (7);
+ }
+ else
+ {
+ bla (5);
+ a = bar (7);
+ }
+ baz (a);
+}
+
+/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-7.c
new file mode 100644
index 000000000..6c1d3209c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879-7.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int bar (int);
+
+int z;
+
+void
+foo (int y)
+{
+ if (y == 6)
+ z = 5;
+ else
+ z = 5;
+}
+
+/* { dg-final { scan-tree-dump-times "z = 5" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51879.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879.c
new file mode 100644
index 000000000..060624fd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51879.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int bar (int);
+void baz (int);
+
+void
+foo (int y)
+{
+ int a;
+ if (y == 6)
+ a = bar (7);
+ else
+ a = bar (7);
+ baz (a);
+}
+
+/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-1.c
new file mode 100644
index 000000000..d899771ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-1.c
@@ -0,0 +1,29 @@
+/* PR target/51957 */
+/* { dg-do link } */
+/* { dg-options "-O2 -g -fprofile-use" } */
+/* { dg-additional-sources "pr51957-2.c" } */
+
+int v[128];
+#include "pr51957-1.h"
+
+void
+foo (U *x)
+{
+ T *a = x->u;
+ while (1)
+ {
+ union R *b;
+ b = fn1 ();
+ if (b != w[0] && !(v[b->p->c] == 1))
+ {
+ fn2 (a->t, "foobar", b->p);
+ b = w[0];
+ }
+ if (b != w[0])
+ fn3 ();
+ if (w[0] && b != w[0])
+ fn4 (b->p);
+ if (b != w[0] && (v[b->p->c] == 1) && fn4 (b->p))
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-1.h
new file mode 100644
index 000000000..cfafb2cc5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-1.h
@@ -0,0 +1,9 @@
+union R { int c; union R *p; };
+extern union R *w[];
+typedef struct { int t; } T;
+typedef struct { void *u; } U;
+union R *fn1 (void);
+void fn2 (int, const char *, union R *);
+void fn3 (void);
+int fn4 (union R *);
+void foo (U *x);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-2.c
new file mode 100644
index 000000000..038921ea3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51957-2.c
@@ -0,0 +1,35 @@
+/* PR target/51957 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+#include "pr51957-1.h"
+
+union R *w[10];
+
+union R *
+fn1 (void)
+{
+ return (union R *) 0;
+}
+
+void
+fn2 (int x, const char *y, union R *z)
+{
+}
+
+void
+fn3 (void)
+{
+}
+
+int
+fn4 (union R *x)
+{
+ return 0;
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51990-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51990-2.c
new file mode 100644
index 000000000..1ced0a833
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51990-2.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int y;
+extern int foo (int, ...) __attribute__((pure));
+
+int
+zzz (char *s1, char *s2, int len, int *q, int c)
+{
+ int z = 5;
+ unsigned int i, b;
+ struct s { char a[z]; };
+ struct s x;
+ int y_tmp = 5;
+
+ for (i = 0; i < len; i++)
+ s1[i] = s2[i];
+
+ b = z & 0x3;
+
+ len += (b == 0 ? 0 : 1) + z;
+
+ *q = len;
+
+ if (c)
+ y_tmp = foo (z, x, x) + 4;
+
+ z = foo (z, x, x) + 4;
+ y = y_tmp;
+
+ return z;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr51990.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr51990.c
new file mode 100644
index 000000000..c7d1b5379
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr51990.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+zzz (char *s1, char *s2, int len, int *q)
+{
+ int z = 5;
+ unsigned int i, b;
+ struct s { char a[z]; };
+ struct s x;
+
+ extern int foo (int, ...) __attribute__((pure));
+
+ for (i = 0; i < len; i++)
+ s1[i] = s2[i];
+
+ b = z & 0x3;
+
+ len += (b == 0 ? 0 : 1) + z;
+
+ *q = len;
+ return foo (z, x, x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52045.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52045.c
new file mode 100644
index 000000000..888ddb6a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52045.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftracer -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce" } */
+
+char *vx;
+char buf[20];
+
+void
+foo (void)
+{
+ vx = __builtin___stpcpy_chk (buf, vx ? "gh" : "e", sizeof(buf));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52046.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52046.c
new file mode 100644
index 000000000..e72061f99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52046.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/52046 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fexceptions -fnon-call-exceptions" } */
+
+extern float a[], b[], c[], d[];
+extern int k[];
+
+void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 1024; ++i)
+ k[i] = (a[i] < b[i]) | (c[i] < d[i]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52086.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52086.c
new file mode 100644
index 000000000..a12e1ce79
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52086.c
@@ -0,0 +1,21 @@
+/* PR target/52086 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-fpic" { target fpic } } */
+
+struct S { char a; char b[100]; };
+int bar (void);
+int baz (int);
+
+void
+foo (struct S *x)
+{
+ if (bar () & 1)
+ {
+ char c = bar ();
+ baz (4);
+ x->a += c;
+ while (x->a)
+ x->b[c] = bar ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52132.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52132.c
new file mode 100644
index 000000000..ed1eb1bec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52132.c
@@ -0,0 +1,27 @@
+/* PR debug/52132 */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -O2 -g" } */
+
+#if (__SIZEOF_INT__ < __SIZEOF_FLOAT__) \
+ && (__SIZEOF_LONG__ == __SIZEOF_FLOAT__)
+#define int long
+#endif
+
+int l;
+void bar (void);
+
+void
+foo (int *x, float y)
+{
+ float b;
+ union { float f; int i; } u = { .f = y };
+#if (__SIZEOF_INT__ < __SIZEOF_FLOAT__)
+ u.i += 127L << 23;
+#else
+ u.i += 127 << 23;
+#endif
+ u.f = ((-1.0f / 3) * u.f + 2) * u.f - 2.0f / 3;
+ b = 0.5 * (u.f + l);
+ if (b >= *x)
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52134.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52134.c
new file mode 100644
index 000000000..44cb4a6f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52134.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+unsigned f(unsigned t)
+{
+ return (t*4)&-4;
+}
+int f1(int t)
+{
+ return (t*4)&-4;
+}
+
+/* { dg-final { scan-tree-dump-not "\\\&" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52139.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52139.c
new file mode 100644
index 000000000..bd654a2f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52139.c
@@ -0,0 +1,49 @@
+/* PR rtl-optimization/52139 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-dominator-opts -fno-tree-fre" } */
+/* { dg-additional-options "-fpic" { target fpic } } */
+
+void *p;
+
+void
+foo (int a)
+{
+ switch (a)
+ {
+ case 0:
+ a0:
+ case 1:
+ a1:
+ p = &&a1;
+ case 2:
+ a2:
+ p = &&a2;
+ case 3:
+ a3:
+ p = &&a3;
+ case 4:
+ a4:
+ p = &&a4;
+ case 5:
+ a5:
+ p = &&a5;
+ case 6:
+ a6:
+ p = &&a6;
+ case 7:
+ a7:
+ p = &&a7;
+ case 8:
+ a8:
+ p = &&a8;
+ case 9:
+ a9:
+ p = &&a9;
+ case 10:
+ a10:
+ p = &&a10;
+ default:
+ p = &&a0;
+ }
+ goto *p;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52210.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52210.c
new file mode 100644
index 000000000..c7ebeb608
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52210.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/52210 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void
+foo (long *x, long y, long z)
+{
+ long a = x[0];
+ long b = x[1];
+ x[0] = a & ~y;
+ x[1] = b & ~z;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52267.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52267.c
new file mode 100644
index 000000000..9ed88c0c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52267.c
@@ -0,0 +1,24 @@
+/* PR tree-optimization/52267 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int a, int b)
+{
+ if (a > 3 || a < 0)
+ return a;
+ a &= 3;
+ return a & 3;
+}
+
+int
+bar (int a)
+{
+ if (a & ~3)
+ return a;
+ return a & 3;
+}
+
+/* { dg-final { scan-tree-dump-not "& 3" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "& -4" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52283.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52283.c
new file mode 100644
index 000000000..070e71aa5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52283.c
@@ -0,0 +1,17 @@
+/* Test for case labels not integer constant expressions but folding
+ to integer constants (used in Linux kernel). */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+extern unsigned int u;
+
+void
+b (int c)
+{
+ switch (c)
+ {
+ case (int) (2 | ((4 < 8) ? 8 : u)): /* { dg-warning "case label is not an integer constant expression" } */
+ ;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52318.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52318.c
new file mode 100644
index 000000000..4f367aa1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52318.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/52318 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftracer -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce" } */
+
+int c;
+char *p;
+
+void
+foo (int i)
+{
+ char a[2];
+ char b[20];
+ p = __builtin___stpcpy_chk (a, "", 2);
+ p = __builtin___stpcpy_chk (&b[16], i ? "e" : "jkl", 4);
+ if (c)
+ foo (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52355.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52355.c
new file mode 100644
index 000000000..0a0271f5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52355.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+void f(char a[16][16][16])
+{
+ __asm volatile ("" : : "i" (&a[1][0][0] - &a[0][0][0]));
+}
+
+int main(void)
+{
+ char a[16][16][16];
+ f(a);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52445.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52445.c
new file mode 100644
index 000000000..0977821a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52445.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/52445 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-cselim -fdump-tree-cselim" } */
+
+void
+foo (char *buf, unsigned long len)
+{
+ buf[0] = '\n';
+ if (len > 1)
+ buf[1] = '\0'; /* We can't cselim "optimize" this, while
+ buf[0] doesn't trap, buf[1] could. */
+}
+
+/* { dg-final { scan-tree-dump-not "cstore\." "cselim" } } */
+/* { dg-final { cleanup-tree-dump "cselim" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52448.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52448.c
new file mode 100644
index 000000000..0aeb2130f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52448.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/52448 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-cselim -fdump-tree-cselim-details" } */
+
+extern void perhaps_free_something (void);
+
+void f1 (int *p, int a, int b, int cond, int cond2)
+{
+ *p = a;
+ if (cond)
+ perhaps_free_something ();
+ if (cond2)
+ *p = b;
+}
+
+void f2 (int *p, int a, int b, int *cond, int *cond2)
+{
+ int i;
+ *p = a;
+ for (i = 0; cond[i]; i++)
+ {
+ if (cond2[i])
+ *p = b;
+ perhaps_free_something ();
+ }
+}
+
+/* None of the above conditional stores might be made unconditional. */
+/* { dg-final { scan-tree-dump-not "cstore" "cselim" } } */
+/* { dg-final { cleanup-tree-dump "cselim" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52549.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52549.c
new file mode 100644
index 000000000..90936529d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52549.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+#if __SIZEOF_POINTER__ == __SIZEOF_LONG__
+_mark (long obj, int i, char *a)
+{
+ (char *)&(((long *)(obj)) [i]) - a;
+}
+#elif __SIZEOF_POINTER__ == __SIZEOF_INT__
+_mark (int obj, int i, char *a)
+{
+ (char *)&(((int *)(obj)) [i]) - a;
+}
+#elif __SIZEOF_POINTER__ == __SIZEOF_LONG_LONG__
+__extension__ _mark (long long obj, int i, char *a)
+{
+ (char *)&(((int *)(obj)) [i]) - a;
+}
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52578.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52578.c
new file mode 100644
index 000000000..0e668300f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52578.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+long bar (long i)
+{
+ return (long)((unsigned long)i + 2) - (long)i;
+}
+long foo (int i)
+{
+ return (long)((unsigned long)i + 2) - (long)i;
+}
+
+/* { dg-final { scan-tree-dump-times "return 2;" 2 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52592.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52592.c
new file mode 100644
index 000000000..b71eb628d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52592.c
@@ -0,0 +1,21 @@
+/* PR middle-end/52592 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -O2 -ffast-math" } */
+
+#define T(type, name) \
+type name (type); \
+__attribute__((cold)) \
+int f##name (type x) \
+{ \
+ return (int) name (x); \
+}
+
+T (double, round)
+T (float, roundf)
+T (long double, roundl)
+T (double, rint)
+T (float, rintf)
+T (long double, rintl)
+
+/* { dg-final { scan-assembler-not "__builtin_iround" } } */
+/* { dg-final { scan-assembler-not "__builtin_irint" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52691.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52691.c
new file mode 100644
index 000000000..7a2d7d8eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52691.c
@@ -0,0 +1,24 @@
+/* PR middle-end/52691 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#include <stdarg.h>
+
+int
+foo (int a, ...)
+{
+ int b = 0, c = 0;
+ va_list ap;
+ va_start (ap, a);
+ if (a > 1)
+ b = va_arg (ap, double);
+ if (a > 2)
+ c = va_arg (ap, long long);
+ va_end (ap);
+ return a + b + c;
+}
+
+/* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { powerpc*-*-darwin* powerpc*-*-aix* } } } } */
+/* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { powerpc*-*-linux* && lp64 } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52734.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52734.c
new file mode 100644
index 000000000..a6894954e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52734.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int bbb = 0;
+
+int __attribute__((noinline,noclone)) aaa(void)
+{
+ ++bbb;
+ return 0;
+}
+
+int __attribute__((noinline,noclone)) ccc(void)
+{
+ int ddd;
+ /* bbb == 0 */
+ if (aaa())
+ return bbb;
+
+ /* bbb == 1 */
+ ddd = bbb;
+ /* bbb == ddd == 1 */
+ if (aaa ())
+ return 0;
+ /* bbb == 2, ddd == 1 */
+
+ return ddd;
+}
+
+int main(void)
+{
+ if (ccc() != 1)
+ __builtin_abort();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52803.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52803.c
new file mode 100644
index 000000000..6774b0c6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52803.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-move-loop-invariants" } */
+
+int main () { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52808.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52808.c
new file mode 100644
index 000000000..b731cb401
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52808.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftracer" } */
+
+int **fn1 () __attribute__ ((__const__));
+int main ()
+{
+ int i;
+ i = 0;
+ for (;; i++)
+ if (*fn1 ()[i] && !'a' <= 0 && i <= 'z' || *fn1 ()[0] && 'a' <= 'z')
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52862.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52862.c
new file mode 100644
index 000000000..febe7a828
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52862.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+void ASMAtomicWritePtrVoid(const void *pv);
+void rtThreadDestroy(void)
+{
+ void * const pvTypeChecked = ((void *)0);
+ ASMAtomicWritePtrVoid((void *)(pvTypeChecked));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr52880.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr52880.c
new file mode 100644
index 000000000..5a83de84a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr52880.c
@@ -0,0 +1,10 @@
+/* PR c/52880 */
+/* { dg-do compile } */
+/* { dg-options "-Woverride-init" } */
+
+struct A { int a; int b; };
+struct B { struct A c; int d, e; };
+struct B f = { .c.a = 0, .e = 1, .d = 2, .c.b = 3 };
+struct C { int g; int h; };
+struct D { int i; struct C j; int k; };
+struct D l = { .j.g = 0, .k = 1, .i = 2, .j.h = 3 };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53060.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53060.c
new file mode 100644
index 000000000..503f05407
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53060.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int f(void) { return 2; }
+unsigned int g(void) { return 5; }
+unsigned int h = 1;
+
+typedef unsigned int vec __attribute__((vector_size(16)));
+
+vec i = { 1, 2, 3, 4};
+
+vec fv1(void) { return i + (h ? f() : g()); }
+vec fv2(void) { return (h ? f() : g()) + i; }
+
+int main()
+{
+ vec i, j;
+ j = fv1();
+ if (j[0] != 3) abort();
+ i = fv2();
+ if (i[0] != 3) abort();
+ return 0;
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*GCC vector returned by reference.*" } */
+/* { dg-prune-output "changes the ABI" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53153.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53153.c
new file mode 100644
index 000000000..8899e04e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53153.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void bar (void);
+
+/* Case 181 is not in the range for 'char'. */
+void
+foo1 (char *buf)
+{
+ int x = *buf;
+ switch (x)
+ {
+ case -76:
+ case 65:
+ case 181:
+ bar();
+ }
+}
+
+/* All cases are below the range of char. */
+void
+foo2 (char *buf)
+{
+ int x = *buf;
+ switch (x)
+ {
+ case -150:
+ case -140:
+ case -130:
+ bar();
+ }
+}
+
+/* All cases are above the range of char. */
+void
+foo3 (char *buf)
+{
+ int x = *buf;
+ switch (x)
+ {
+ case 130:
+ case 140:
+ case 150: /* This case is not in the range for 'char'. */
+ bar();
+ }
+}
+
+/* The bounding cases are partially out of range for char. */
+void
+foo4 (char *buf)
+{
+ int x = *buf;
+ switch (x)
+ {
+ case -130 ... -120:
+ case 100:
+ case 120 ... 130:
+ bar();
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53174.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53174.c
new file mode 100644
index 000000000..37c9390e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53174.c
@@ -0,0 +1,67 @@
+/* PR debug/53174 */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -g" } */
+
+int w, h;
+
+void
+bar (float (*x)[4], int y, int z)
+{
+ int a, b, c, d, e, f, g;
+
+ a = 2;
+ b = 2;
+ c = 274;
+ d = 274;
+ if (!z)
+ a = 12;
+ if (!y)
+ b = 12;
+ if (z + 266 >= h - 2)
+ c = 8 + h - z;
+ if (y + 266 >= w - 2)
+ d = 8 + w - y;
+ for (e = a; e < c; e++)
+ for (f = b, g = e * 276 + f; f < d; f++, g++)
+ {
+ float (*h)[4] = x + (g - 277);
+ float k = (*h)[0];
+ float l = (*h)[1];
+ float m = (*h)[2];
+ h++;
+ k += (*h)[0];
+ l += (*h)[1];
+ m += (*h)[2];
+ h++;
+ k += (*h)[0];
+ l += (*h)[1];
+ m += (*h)[2];
+ h += 274;
+ k += (*h)[0];
+ l += (*h)[1];
+ m += (*h)[2];
+ h += 2;
+ k += (*h)[0];
+ l += (*h)[1];
+ m += (*h)[2];
+ h += 274;
+ k += (*h)[0];
+ l += (*h)[1];
+ m += (*h)[2];
+ h++;
+ k += (*h)[0];
+ l += (*h)[1];
+ m += (*h)[2];
+ h++;
+ k += (*h)[0];
+ l += (*h)[1];
+ m += (*h)[2];
+ k *= 0.125f;
+ l *= 0.125f;
+ m *= 0.125f;
+ k = k + (x[g][1] - l);
+ m = m + (x[g][1] - l);
+ x[g][0] = k;
+ x[g][2] = m;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53196-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53196-1.c
new file mode 100644
index 000000000..b33e0432e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53196-1.c
@@ -0,0 +1,14 @@
+/* PR c/53196 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+extern int printf (const char *, ...);
+struct foo { int i; };
+
+int
+main ()
+{
+ struct foo f = (struct foo_typo) { }; /* { dg-error "invalid use of undefined type" } */
+ printf ("%d\n", f.i);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53196-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53196-2.c
new file mode 100644
index 000000000..efb6a82c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53196-2.c
@@ -0,0 +1,16 @@
+/* PR c/53196 */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+extern int printf (const char *, ...);
+struct foo { int i; };
+
+int
+main ()
+{
+ struct foo f = (struct foo_typo) { }; /* { dg-error "invalid use of undefined type" } */
+ printf ("%d\n", f.i);
+ return 0;
+}
+
+/* { dg-error "ISO C forbids empty initializer braces" "" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c
new file mode 100644
index 000000000..e1ca6f521
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c
@@ -0,0 +1,157 @@
+/* PR tree-optimization/53265 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+/* { dg-require-effective-target size32plus } */
+
+void bar (void *);
+int baz (int);
+
+void
+fn1 (void)
+{
+ unsigned int a[128];
+ int i;
+
+ for (i = 0; i < 128; ++i) /* { dg-message "note: containing loop" } */
+ a[i] = i * 0x02000001; /* { dg-warning "invokes undefined behavior" } */
+ bar (a);
+}
+
+void
+fn2 (void)
+{
+ unsigned long long a[128];
+ int i;
+
+ for (i = 0; i < 128; i++) /* { dg-message "note: containing loop" } */
+ a[i] = (i + 1LL) * 0x0123456789ABCDEFLL; /* { dg-warning "invokes undefined behavior" } */
+ bar (a);
+}
+
+void
+fn3 (void)
+{
+ unsigned char a[16], b[16], c[16];
+ int i;
+
+ bar (b);
+ for (i = 0; i < (int) (sizeof (a) / sizeof (a[0])); i++) /* { dg-message "note: containing loop" } */
+ {
+ c[i + 8] = b[i]; /* { dg-warning "invokes undefined behavior" } */
+ a[i + 8] = b[i + 8];
+ }
+ bar (a);
+ bar (c);
+}
+
+void
+fn4 (void)
+{
+ unsigned int *a[32], *o, i;
+
+ bar (a);
+ for (i = 0; i <= sizeof (a) / sizeof (a[0]); i++) /* { dg-message "note: containing loop" "" } */
+ {
+ o = a[i]; /* { dg-warning "invokes undefined behavior" "" } */
+ bar (o);
+ }
+}
+
+void
+fn5 (void)
+{
+ unsigned short a[23940];
+ unsigned int b[1140];
+ int j;
+
+ bar (b);
+ for (j = 0; j < 1140; j++) /* { dg-message "note: containing loop" } */
+ a[23940 + j - 950] = b[j]; /* { dg-warning "invokes undefined behavior" } */
+ bar (a);
+}
+
+void
+fn6 (void)
+{
+ double a[4][3], b[12];
+ int i;
+ bar (b);
+ for (i = 0; i < 12; i++) /* { dg-message "note: containing loop" } */
+ a[0][i] = b[i] / 10000.0; /* { dg-warning "invokes undefined behavior" } */
+ bar (a);
+}
+
+void
+fn7 (void)
+{
+ int a[16], b, c;
+ bar (a);
+ for (b = a[c = 0]; c < 16; b = a[++c]) /* { dg-warning "invokes undefined behavior" "" } */
+ baz (b);
+}
+
+/* { dg-message "note: containing loop" "" { target *-*-* } 89 } */
+
+const void *va, *vb, *vc, *vd, *ve;
+const void *vf[4];
+void
+fn8 (void)
+{
+ unsigned long i;
+ vf[0] = va; vf[1] = vb; vf[2] = vc; vf[3] = vd;
+ for (i = 0; i < (sizeof (vf) / sizeof (vf[0])); i++)
+ if (!vf[i])
+ vf[i] = ve;
+}
+
+int wa, wb[53][5], wc[53][5];
+
+void
+fn9 (void)
+{
+ int i, j, k;
+ for (i = 0; i < 53; i++)
+ for (j = 16 / (((wa & 1) != 0) ? 8 : 4); j > 0; j--)
+ {
+ int d = 1;
+ if (wb[i][j] == 0 || wc[i][1] != 0)
+ continue;
+ for (k = 0; k < j; k++)
+ if (wc[i + k][1])
+ {
+ d = 0;
+ break;
+ }
+ if (!d)
+ continue;
+ wc[i][j] = baz (0);
+ }
+}
+
+int xa[18];
+
+void
+fn10 (void)
+{
+ int i;
+ for (i = 16; i < 32; i++) /* { dg-message "note: containing loop" } */
+ xa[i] = 26; /* { dg-warning "invokes undefined behavior" } */
+}
+
+__attribute__((noinline)) static void
+fn11 (int x)
+{
+ int i = 1;
+ if (x > 1)
+ do
+ baz (i);
+ while (++i != x); /* { dg-bogus "invokes undefined behavior" } */
+}
+
+void
+fn12 (void)
+{
+ fn11 (1);
+ fn11 (1);
+ fn11 (1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53352.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53352.c
new file mode 100644
index 000000000..171bcd71e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53352.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+#include <stdlib.h>
+
+typedef union
+{
+ struct
+ {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ } parts;
+ unsigned long whole;
+} T;
+
+T *g_t;
+
+void bar (unsigned long x)
+{
+ if (x != 0)
+ abort ();
+}
+
+int main ()
+{
+ T one;
+ T two;
+ T tmp1, tmp2;
+
+ one.whole = 0xFFE0E0E0UL;
+ two.whole = 0xFF000000UL;
+ tmp1.parts = two.parts;
+ tmp2.parts = one.parts;
+ tmp2.parts.c = tmp1.parts.c;
+ one.parts = tmp2.parts;
+
+ g_t = &one;
+ bar (0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53358.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53358.c
new file mode 100644
index 000000000..494090a42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53358.c
@@ -0,0 +1,22 @@
+/* PR target/53358 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-fpic" { target fpic } } */
+/* { dg-additional-options "-mtune=pentium4" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+struct S { unsigned char s, t[17]; };
+int bar (void);
+
+void
+foo (struct S *x)
+{
+ unsigned char i, z;
+ if (bar ())
+ {
+ z = bar ();
+ bar ();
+ x->s += z;
+ for (i = 0; i < x->s; i++)
+ x->t[i] = bar ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53532.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53532.c
new file mode 100644
index 000000000..9caea40be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53532.c
@@ -0,0 +1,13 @@
+/* PR c/53532 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct S {};
+extern int foo (struct S);
+
+int
+main ()
+{
+ foo ((struct T) {}); /* { dg-error "invalid use of undefined type" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53550.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53550.c
new file mode 100644
index 000000000..1008f43a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53550.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/53550 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
+
+int *
+foo (int *x)
+{
+ int *a = x + 10, *b = x, *c = a;
+ while (b != c)
+ *--c = *b++;
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53701.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53701.c
new file mode 100644
index 000000000..15bf07d61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53701.c
@@ -0,0 +1,59 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O3 -fselective-scheduling2 -fsel-sched-pipelining" } */
+typedef unsigned short int uint16_t;
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
+typedef struct GFX_VTABLE
+{
+ int color_depth;
+ unsigned char *line[];
+}
+BITMAP;
+extern int _drawing_mode;
+extern BITMAP *_drawing_pattern;
+extern int _drawing_y_anchor;
+extern unsigned int _drawing_x_mask;
+extern unsigned int _drawing_y_mask;
+extern uintptr_t bmp_write_line (BITMAP *, int);
+ void
+_linear_hline15 (BITMAP * dst, int dx1, int dy, int dx2, int color)
+{
+ int w;
+ if (_drawing_mode == 0)
+ {
+ int x, curw;
+ unsigned short *sline =
+ (unsigned short *) (_drawing_pattern->
+ line[((dy) -
+ _drawing_y_anchor) & _drawing_y_mask]);
+ unsigned short *s;
+ unsigned short *d =
+ ((unsigned short *) (bmp_write_line (dst, dy)) + (dx1));
+ s = ((unsigned short *) (sline) + (x));
+ if (_drawing_mode == 2)
+ {
+ }
+ else if (_drawing_mode == 3)
+ {
+ do
+ {
+ w -= curw;
+ do
+ {
+ unsigned long c = (*(s));
+ if (!((unsigned long) (c) == 0x7C1F))
+ {
+ (*((uint16_t *) ((uintptr_t) (d))) = ((color)));
+ }
+ ((s)++);
+ }
+ while (--curw > 0);
+ s = sline;
+ curw =
+ (((w) <
+ ((int) _drawing_x_mask +
+ 1)) ? (w) : ((int) _drawing_x_mask + 1));
+ }
+ while (curw > 0);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53749.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53749.c
new file mode 100644
index 000000000..136b5b09c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53749.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+#define N 1024
+unsigned char a[N], b[N], c[N];
+
+void f1(void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ a[i] = b[i] * c[i];
+}
+
+void f2(void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ a[i] = b[i] * 2;
+}
+
+void f3(void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ a[i] = b[i] * 20;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53849.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53849.c
new file mode 100644
index 000000000..eddc45fd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53849.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fno-tree-loop-im" } */
+
+extern int *b, *e[8], d;
+
+void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 8; ++i)
+ while (--d)
+ e[i] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53881-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53881-1.c
new file mode 100644
index 000000000..435d938a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53881-1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int a, b;
+void
+fn1 ()
+{
+ int c;
+ switch (a)
+ {
+ case 8:
+ c = 0;
+ goto Label;
+ case 0:
+ case 1:
+Label:
+ break;
+ default:
+ b = 0;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53881-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53881-2.c
new file mode 100644
index 000000000..f6f8f8bcb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53881-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int a,b,c;
+void
+fn1 ()
+{
+ switch (a)
+ {
+ case 0:
+ case 10:
+ b=c;
+out_bcon:
+ break;
+ case 3:
+ goto out_bcon;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53887.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53887.c
new file mode 100644
index 000000000..b46126cd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53887.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+enum
+{ Failed, NoError, NoDiskette }
+a;
+int b, c;
+void
+fn1 ()
+{
+ if (c)
+ a << 1;
+ switch (b)
+ {
+ default:
+ a << 1;
+ case 0:
+ b = 0;
+ case 1:
+ case NoDiskette:
+ ;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53942.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53942.c
new file mode 100644
index 000000000..6a51d2673
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53942.c
@@ -0,0 +1,34 @@
+/* PR rtl-optimization/53942 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-mtune=pentium2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+struct S
+{
+ unsigned short w[3];
+ unsigned int x, y;
+};
+
+struct S *baz (void);
+
+__attribute__ ((noinline))
+static unsigned char
+foo (struct S *x, unsigned char y)
+{
+ unsigned char c = 0;
+ unsigned char v = x->w[0];
+ c |= v;
+ v = ((x->w[1]) & (1 << y)) ? 1 : 0;
+ c |= v << 1;
+ v = ((x->w[2]) & 0xff) & (1 << y);
+ c |= v << 2;
+ return c;
+}
+
+void
+bar (void)
+{
+ struct S *s = baz ();
+ s->x = foo (s, 6);
+ s->y = foo (s, 7);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54087.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54087.c
new file mode 100644
index 000000000..abb0af3d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54087.c
@@ -0,0 +1,18 @@
+/* PR54087. Verify __atomic_sub (val) uses __atomic_add (-val) if there is no
+ atomic_aub. */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler-times "xadd" 2 } } */
+
+
+int a;
+
+int f1(int p)
+{
+ return __atomic_sub_fetch(&a, p, __ATOMIC_SEQ_CST) == 0;
+}
+
+int f2(int p)
+{
+ return __atomic_fetch_sub(&a, p, __ATOMIC_SEQ_CST) - p == 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54113.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54113.c
new file mode 100644
index 000000000..4c68099b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54113.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-Wmissing-prototypes" } */
+
+inline int foo (void) { return 42; } /* { dg-bogus "no previous prototype" } */
+extern int foo(void);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54121.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54121.c
new file mode 100644
index 000000000..b9a208ea8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54121.c
@@ -0,0 +1,94 @@
+/* PR target/54121 */
+/* Reported by Jan Engelhardt <jengelh@inai.de> */
+
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-std=gnu99 -O -fPIC -fprofile-generate" } */
+
+typedef __SIZE_TYPE__ size_t;
+typedef unsigned char uint8_t;
+
+extern void *memcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
+
+typedef enum {
+ LZMA_OK = 0,
+ LZMA_STREAM_END = 1,
+ LZMA_NO_CHECK = 2,
+ LZMA_UNSUPPORTED_CHECK = 3,
+ LZMA_GET_CHECK = 4,
+ LZMA_MEM_ERROR = 5,
+ LZMA_MEMLIMIT_ERROR = 6,
+ LZMA_FORMAT_ERROR = 7,
+ LZMA_OPTIONS_ERROR = 8,
+ LZMA_DATA_ERROR = 9,
+ LZMA_BUF_ERROR = 10,
+ LZMA_PROG_ERROR = 11,
+} lzma_ret;
+
+typedef enum {
+ LZMA_RUN = 0,
+ LZMA_SYNC_FLUSH = 1,
+ LZMA_FULL_FLUSH = 2,
+ LZMA_FINISH = 3
+} lzma_action;
+
+typedef struct {
+ void *( *alloc)(void *opaque, size_t nmemb, size_t size);
+ void ( *free)(void *opaque, void *ptr);
+ void *opaque;
+} lzma_allocator;
+
+typedef struct lzma_coder_s lzma_coder;
+
+typedef struct lzma_next_coder_s lzma_next_coder;
+
+typedef struct lzma_filter_info_s lzma_filter_info;
+
+typedef lzma_ret (*lzma_init_function)(
+ lzma_next_coder *next, lzma_allocator *allocator,
+ const lzma_filter_info *filters);
+
+typedef lzma_ret (*lzma_code_function)(
+ lzma_coder *coder, lzma_allocator *allocator,
+ const uint8_t *restrict in, size_t *restrict in_pos,
+ size_t in_size, uint8_t *restrict out,
+ size_t *restrict out_pos, size_t out_size,
+ lzma_action action);
+
+typedef void (*lzma_end_function)(
+ lzma_coder *coder, lzma_allocator *allocator);
+
+typedef struct {
+ uint8_t *buf;
+ size_t pos;
+ size_t size;
+} lzma_dict;
+
+typedef struct {
+ lzma_coder *coder;
+ lzma_ret (*code)(lzma_coder *restrict coder,
+ lzma_dict *restrict dict, const uint8_t *restrict in,
+ size_t *restrict in_pos, size_t in_size);
+} lzma_lz_decoder;
+
+struct lzma_coder_s {
+ lzma_dict dict;
+ lzma_lz_decoder lz;
+};
+
+lzma_ret
+decode_buffer(lzma_coder *coder,
+ const uint8_t *restrict in, size_t *restrict in_pos,
+ size_t in_size, uint8_t *restrict out, size_t *restrict out_pos)
+{
+ while (1) {
+ const size_t dict_start = coder->dict.pos;
+ const lzma_ret ret
+ = coder->lz.code( coder->lz.coder, &coder->dict, in, in_pos, in_size);
+ const size_t copy_size = coder->dict.pos - dict_start;
+ memcpy(out + *out_pos, coder->dict.buf + dict_start, copy_size);
+ if (ret != LZMA_OK || coder->dict.pos < coder->dict.size)
+ return ret;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54355.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54355.c
new file mode 100644
index 000000000..0a0b7fa97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54355.c
@@ -0,0 +1,11 @@
+/* PR c/54355 */
+/* { dg-do compile } */
+
+void
+foo (int i)
+{
+ switch (i)
+ {
+ case 0: T x > /* { dg-error "(label|unknown type|expected)" } */
+ }
+} /* { dg-error "expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54363.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54363.c
new file mode 100644
index 000000000..aea0f9057
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54363.c
@@ -0,0 +1,12 @@
+/* PR c/54363 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+struct S { char **a; };
+
+void
+test (void)
+{
+ struct S b = { .a = (char **) { "a", "b" } }; /* { dg-warning "(initialization|excess elements)" } */
+ struct S c = { .a = (char *[]) { "a", "b" } };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54472.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54472.c
new file mode 100644
index 000000000..93952038e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54472.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O -fschedule-insns -fselective-scheduling" } */
+
+int main ()
+{
+ int a[3][3][3];
+ __builtin_memset (a, 0, sizeof a);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54669.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54669.c
new file mode 100644
index 000000000..3868ae691
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54669.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/54669 */
+/* Testcase by Zdenek Sojka <zsojka@seznam.cz> */
+
+/* { dg-compile } */
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */
+
+int a[10];
+
+void
+foo (void)
+{
+ int x;
+ int i;
+ for (i = 0; i < 1;)
+ {
+ int b[3];
+ for (i = 0; i < 1; i++)
+ b[i] = a[i];
+ if (&x)
+ a[0] = b[0];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54676.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54676.c
new file mode 100644
index 000000000..cb3a8a2d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54676.c
@@ -0,0 +1,27 @@
+/* PR tree-optimization/54676 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-ccp -fno-tree-copy-prop -fno-tree-fre -ftree-vrp" } */
+
+struct S
+{
+ int s:1;
+};
+
+struct S bar (void);
+
+#if __SIZEOF_INT__ < 4
+#define int __INT32_TYPE__
+#endif
+
+int a;
+
+void
+foo (int x)
+{
+ struct S s = bar ();
+ while (!a)
+ {
+ int l = 94967295;
+ a = x || (s.s &= l);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54782.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54782.c
new file mode 100644
index 000000000..161b043c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54782.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O -ffast-math -ftree-parallelize-loops=2 -g" } */
+
+struct S
+{
+ int n;
+ float *a;
+};
+
+int
+foo (struct S *s)
+{
+ float sum = 0;
+ int i;
+ for (i = 0; i < s->n; i++)
+ sum += s->a[i];
+ return sum;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54838.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54838.c
new file mode 100644
index 000000000..9ed92f9e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54838.c
@@ -0,0 +1,24 @@
+/* PR middle-end/54838 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-forward-propagate -ftracer" } */
+
+void bar (void);
+
+void
+foo (void *b, int *c)
+{
+again:
+ switch (*c)
+ {
+ case 1:
+ if (!b)
+ {
+ bar ();
+ return;
+ }
+ goto again;
+ case 3:
+ if (!b)
+ goto again;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54919.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54919.c
new file mode 100644
index 000000000..9f1affce2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54919.c
@@ -0,0 +1,27 @@
+/* PR tree-optimization/54919 */
+/* Testcase by Zdenek Sojka <zsojka@seznam.cz> */
+
+/* { dg-do run } */
+/* { dg-options "-O3 -ffast-math -funroll-loops -fvariable-expansion-in-unroller" } */
+
+int a[10];
+extern void abort(void) __attribute__((noreturn));
+
+int __attribute__((__noinline__, __noclone__))
+foo (void)
+{
+ double d;
+ int i;
+ for (i = 0, d = 0; i < 64; i++)
+ d--;
+ return (int) d;
+}
+
+int
+main (void)
+{
+ if (foo () != -64)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54921.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54921.c
new file mode 100644
index 000000000..897877aa0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54921.c
@@ -0,0 +1,32 @@
+/* PR rtl-optimization/54921 */
+/* { dg-do run } */
+/* { dg-options "-Os -fno-omit-frame-pointer -fsched2-use-superblocks -ftree-slp-vectorize" } */
+/* { dg-additional-options "-fstack-protector" { target fstack_protector } } */
+
+struct A
+{
+ int a;
+ char b[32];
+} a, b;
+
+__attribute__((noinline, noclone))
+struct A
+bar (int x)
+{
+ struct A r;
+ static int n;
+ r.a = ++n;
+ __builtin_memset (r.b, 0, sizeof (r.b));
+ r.b[0] = x;
+ return r;
+}
+
+int
+main ()
+{
+ a = bar (3);
+ b = bar (4);
+ if (a.a != 1 || a.b[0] != 3 || b.a != 2 || b.b[0] != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr54981.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr54981.c
new file mode 100644
index 000000000..aa77d60c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr54981.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-distribute-patterns -fcompare-debug" } */
+
+extern void bar(unsigned *, char *);
+
+void foo(char *s)
+{
+ unsigned i;
+ char t[2];
+
+ bar(&i, t);
+
+ for (i = 0; i < 2; i++)
+ s[i] = t[i];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55010.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55010.c
new file mode 100644
index 000000000..a3dc41d8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55010.c
@@ -0,0 +1,13 @@
+/* PR rtl-optimization/55010 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+long long int a;
+unsigned long long int b;
+
+void
+foo (void)
+{
+ a = (a < 0) / ((a -= b) ? b >= ((b = a) || 0) : 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55019.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55019.c
new file mode 100644
index 000000000..1548fb258
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55019.c
@@ -0,0 +1,41 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -funroll-loops" } */
+/* { dg-add-options ieee } */
+
+extern void exit (int);
+extern void abort (void);
+
+void
+compare (double a, double b)
+{
+ do
+ {
+ double s1 = __builtin_copysign ((double) 1.0, a);
+ double s2 = __builtin_copysign ((double) 1.0, b);
+
+ if (s1 != s2)
+ abort ();
+
+ if ((__builtin_isnan (a) != 0) != (__builtin_isnan (b) != 0))
+ abort ();
+
+ if ((a != b) != (__builtin_isnan (a) != 0))
+ abort ();
+ } while (0);
+}
+
+int
+main ()
+{
+ double a = 0.0;
+ double b = 0.0;
+ _Complex double cr = __builtin_complex (a, b);
+ static _Complex double cs = __builtin_complex (0.0, 0.0);
+
+ compare (__real__ cr, 0.0);
+ compare (__imag__ cr, 0.0);
+ compare (__real__ cs, 0.0);
+ compare (__imag__ cs, 0.0);
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55027.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55027.c
new file mode 100644
index 000000000..e72b8fc03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55027.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -fdump-tree-optimized-raw" } */
+
+typedef double v2df __attribute__ ((__vector_size__ (2 * sizeof (double))));
+
+void f (v2df *x)
+{
+ *x = 0 + 1 * *x;
+}
+
+/* { dg-final { scan-tree-dump-not "gimple_assign" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55094.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55094.c
new file mode 100644
index 000000000..c445b1a86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55094.c
@@ -0,0 +1,45 @@
+/* PR middle-end/55094 */
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug -Os" } */
+/* { dg-additional-options "-fomit-frame-pointer -fno-asynchronous-unwind-tables -mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern int fn (long);
+int v;
+
+int
+foo (int x, long *y)
+{
+ if (x)
+ {
+ fn (y[0]);
+ __builtin_trap ();
+ }
+ __builtin_trap ();
+}
+
+int
+bar (int x, long *y)
+{
+ if (x)
+ {
+ fn (y[0]);
+ v = 1;
+ __builtin_unreachable ();
+ }
+ v = 1;
+ __builtin_unreachable ();
+}
+
+int
+baz (int x, long *y)
+{
+ if (x)
+ {
+ fn (y[0]);
+ v = 1;
+ __builtin_unreachable ();
+ }
+ v = 1;
+ int w = 1;
+ __builtin_unreachable ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55110.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55110.c
new file mode 100644
index 000000000..2a031a529
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55110.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/55110 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize" } */
+
+int
+foo (int x)
+{
+ int a, b;
+ for (b = 0; b < 8; b++)
+ for (a = 0; a < 2; a++)
+ x /= 3;
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55122.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55122.c
new file mode 100644
index 000000000..a290ae001
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55122.c
@@ -0,0 +1,14 @@
+/* PR rtl-optimization/55122 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int i, a;
+unsigned long long b;
+
+void f(void)
+{
+ for(i = 0; i < 15; i++)
+ b *= b;
+
+ b *= a ? 0 : b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55150-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55150-1.c
new file mode 100644
index 000000000..e42066b60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55150-1.c
@@ -0,0 +1,73 @@
+/* PR middle-end/55150 */
+/* { dg-do compile } */
+/* { dg-options "-Os -g" } */
+/* { dg-require-effective-target int32plus } */
+
+typedef unsigned int KEY_TABLE_TYPE[(272 / 4)];
+ typedef unsigned int u32;
+ typedef unsigned char u8;
+ static const u32 Camellia_SBOX[][256] = {
+ };
+ static const u32 SIGMA[] = {
+ 0xa09e667f, 0x3bcc908b, 0xb67ae858, 0x4caa73b2, 0xc6ef372f, 0xe94f82be, 0x54ff53a5, 0xf1d36f1c, 0x10e527fa, 0xde682d1d, 0xb05688c2, 0xb3e6c1fd };
+ int Camellia_Ekeygen (int keyBitLength, const u8 * rawKey, KEY_TABLE_TYPE k) {
+ register u32 s0, s1, s2, s3;
+ k[0] = s0 = ( {
+ u32 r = *(const u32 *) (rawKey);
+ r;
+ }
+ );
+ k[2] = s2 = ( {
+ u32 r = *(const u32 *) (rawKey + 8);
+ r;
+ }
+ );
+ k[3] = s3 = ( {
+ u32 r = *(const u32 *) (rawKey + 12);
+ r;
+ }
+ );
+ if (keyBitLength != 128) {
+ k[8] = s0 = ( {
+ u32 r = *(const u32 *) (rawKey + 16);
+ r;
+ }
+ );
+ if (keyBitLength == 192) {
+ k[10] = s2 = ~s0;
+ k[11] = s3 = ~s1;
+ }
+ }
+ s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];
+ if (keyBitLength == 128) {
+ k[4] = s0, k[5] = s1, k[6] = s2, k[7] = s3;
+ }
+ else {
+ k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
+ s0 ^= k[8], s1 ^= k[9], s2 ^= k[10], s3 ^= k[11];
+ do {
+ register u32 _t0, _t1, _t2, _t3;
+ _t0 = s2 ^ ((SIGMA + 10))[0];
+ _t3 ^= Camellia_SBOX[3][(_t0 >> 8) & 0xff];
+ s1 ^= _t3;
+ }
+ while (0);
+ do {
+ u32 _t0 = s0 >> (32 - 30);
+ s2 = (s2 << 30) | (s3 >> (32 - 30));
+ s3 = (s3 << 30) | _t0;
+ }
+ while (0);
+ k[40] = s0, k[41] = s1, k[42] = s2, k[43] = s3;
+ k[64] = s1, k[65] = s2, k[66] = s3, k[67] = s0;
+ s0 = k[8], s1 = k[9], s2 = k[10], s3 = k[11];
+ k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3;
+ s0 = k[12], s1 = k[13], s2 = k[14], s3 = k[15];
+ do {
+ s1 = (s1 << 15) | (s2 >> (32 - 15));
+ }
+ while (0);
+ k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
+ k[44] = s1, k[45] = s2, k[46] = s3, k[47] = s0;
+ }
+ }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55150-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55150-2.c
new file mode 100644
index 000000000..1be769d37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55150-2.c
@@ -0,0 +1,54 @@
+/* PR middle-end/55150 */
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-Os -g -fPIC" } */
+
+typedef unsigned char DES_cblock[8];
+ typedef struct DES_ks {
+ }
+ DES_key_schedule;
+ void DES_ede3_cbcm_encrypt (const unsigned char *in, unsigned char *out, long length, DES_key_schedule * ks1, DES_key_schedule * ks2, DES_key_schedule * ks3, DES_cblock * ivec1, DES_cblock * ivec2, int enc) {
+ register unsigned long tout0, tout1, xor0, xor1, m0, m1;
+ register long l = length;
+ unsigned long tin[2];
+ unsigned char *iv1, *iv2;
+ iv1 = &(*ivec1)[0];
+ iv2 = &(*ivec2)[0];
+ if (enc) {
+ (m0 = ((unsigned long) (*((iv1)++))), m0 |= ((unsigned long) (*((iv1)++))) << 8L, m0 |= ((unsigned long) (*((iv1)++))) << 16L, m0 |= ((unsigned long) (*((iv1)++))) << 24L);
+ (m1 = ((unsigned long) (*((iv1)++))), m1 |= ((unsigned long) (*((iv1)++))) << 8L, m1 |= ((unsigned long) (*((iv1)++))) << 16L, m1 |= ((unsigned long) (*((iv1)++))) << 24L);
+ (tout0 = ((unsigned long) (*((iv2)++))), tout0 |= ((unsigned long) (*((iv2)++))) << 8L, tout0 |= ((unsigned long) (*((iv2)++))) << 16L, tout0 |= ((unsigned long) (*((iv2)++))) << 24L);
+ for (l -= 8;
+ l >= -7;
+ l -= 8) {
+ DES_encrypt1 (tin, ks3, 1);
+ DES_encrypt1 (tin, ks1, 1);
+ }
+ (*((iv1)++) = (unsigned char) (((m0)) & 0xff), *((iv1)++) = (unsigned char) (((m0) >> 8L) & 0xff), *((iv1)++) = (unsigned char) (((m0) >> 16L) & 0xff), *((iv1)++) = (unsigned char) (((m0) >> 24L) & 0xff));
+ (*((iv1)++) = (unsigned char) (((m1)) & 0xff), *((iv1)++) = (unsigned char) (((m1) >> 8L) & 0xff), *((iv1)++) = (unsigned char) (((m1) >> 16L) & 0xff), *((iv1)++) = (unsigned char) (((m1) >> 24L) & 0xff));
+ (*((iv2)++) = (unsigned char) (((tout0)) & 0xff), *((iv2)++) = (unsigned char) (((tout0) >> 8L) & 0xff), *((iv2)++) = (unsigned char) (((tout0) >> 16L) & 0xff), *((iv2)++) = (unsigned char) (((tout0) >> 24L) & 0xff));
+ }
+ else {
+ (m0 = ((unsigned long) (*((iv1)++))), m0 |= ((unsigned long) (*((iv1)++))) << 8L, m0 |= ((unsigned long) (*((iv1)++))) << 16L, m0 |= ((unsigned long) (*((iv1)++))) << 24L);
+ (xor1 = ((unsigned long) (*((iv2)++))), xor1 |= ((unsigned long) (*((iv2)++))) << 8L, xor1 |= ((unsigned long) (*((iv2)++))) << 16L, xor1 |= ((unsigned long) (*((iv2)++))) << 24L);
+ for (l -= 8;
+ l >= -7;
+ l -= 8) {
+ DES_encrypt1 (tin, ks3, 1);
+ if (l < 0) {
+ {
+ switch (l + 8) {
+ case 7: *(--(out)) = (unsigned char) (((tout1) >> 16L) & 0xff);
+ case 6: *(--(out)) = (unsigned char) (((tout1) >> 8L) & 0xff);
+ case 5: *(--(out)) = (unsigned char) (((tout1)) & 0xff);
+ case 4: *(--(out)) = (unsigned char) (((tout0) >> 24L) & 0xff);
+ case 1: *(--(out)) = (unsigned char) (((tout0)) & 0xff);
+ }
+ };
+ }
+ }
+ (*((iv1)++) = (unsigned char) (((m0)) & 0xff), *((iv1)++) = (unsigned char) (((m0) >> 8L) & 0xff), *((iv1)++) = (unsigned char) (((m0) >> 16L) & 0xff), *((iv1)++) = (unsigned char) (((m0) >> 24L) & 0xff));
+ (*((iv2)++) = (unsigned char) (((xor0)) & 0xff), *((iv2)++) = (unsigned char) (((xor0) >> 8L) & 0xff), *((iv2)++) = (unsigned char) (((xor0) >> 16L) & 0xff), *((iv2)++) = (unsigned char) (((xor0) >> 24L) & 0xff));
+ (*((iv2)++) = (unsigned char) (((xor1)) & 0xff), *((iv2)++) = (unsigned char) (((xor1) >> 8L) & 0xff), *((iv2)++) = (unsigned char) (((xor1) >> 16L) & 0xff), *((iv2)++) = (unsigned char) (((xor1) >> 24L) & 0xff));
+ }
+ }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55153.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55153.c
new file mode 100644
index 000000000..215090cc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55153.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/55153 */
+/* { dg-do compile } */
+/* { dg-options "-O -fsched2-use-superblocks -fschedule-insns2" } */
+/* { dg-require-effective-target scheduling } */
+
+extern int a[];
+
+void
+foo (void)
+{
+ __builtin_prefetch (a, 0, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55191.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55191.c
new file mode 100644
index 000000000..568425ce0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55191.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/55191 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int a, b;
+
+void f(void)
+{
+ b = a || b;
+
+ for(a = 0; a < 2; a++);
+ while(1);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55236.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55236.c
new file mode 100644
index 000000000..dc66c04c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55236.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/55236 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fwrapv" } */
+
+extern void abort ();
+
+__attribute__((noinline, noclone)) void
+foo (int i)
+{
+ if (i > 0)
+ abort ();
+ i = -i;
+ if (i < 0)
+ return;
+ abort ();
+}
+
+__attribute__((noinline, noclone)) void
+bar (int i)
+{
+ if (i > 0 || (-i) >= 0)
+ abort ();
+}
+
+int
+main ()
+{
+ foo (-__INT_MAX__ - 1);
+ bar (-__INT_MAX__ - 1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55430.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55430.c
new file mode 100644
index 000000000..ac56cacea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55430.c
@@ -0,0 +1,46 @@
+/* PR middle-end/55430 */
+/* { dg-do run { target mmap } } */
+/* { dg-options "-O2" } */
+
+#include <stddef.h>
+#include <stdio.h>
+#include <sys/mman.h>
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+#ifndef MAP_ANON
+#define MAP_ANON 0
+#endif
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+#include <stdlib.h>
+
+struct S
+{
+ unsigned int s1 : 8;
+ unsigned int s2 : 2;
+};
+
+__attribute__((noinline, noclone)) int
+foo (int x, int y, struct S *z, unsigned int w)
+{
+ if (z[y].s2 == x && z[y].s1 == w)
+ return 1;
+ return 0;
+}
+
+int
+main ()
+{
+ char *p = mmap (NULL, 131072, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (p == MAP_FAILED)
+ return 0;
+ if (munmap (p + 65536, 65536) < 0)
+ return 0;
+ if ((65536 / sizeof (struct S)) * sizeof (struct S) != 65536)
+ return 0;
+ struct S *s = (struct S *) (p + 65536);
+ return foo (0, 0, s - 1, 0) != 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55570.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55570.c
new file mode 100644
index 000000000..903bb033d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55570.c
@@ -0,0 +1,4 @@
+/* PR c/55570 */
+/* { dg-do compile } */
+
+char array[16] __attribute__((aligned (SOME_NOT_DEFINED_MACRO))); /* { dg-error "requested alignment is not an integer constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55702.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55702.c
new file mode 100644
index 000000000..8770a3758
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55702.c
@@ -0,0 +1,9 @@
+/* PR sanitizer/55702 */
+/* { dg-do compile { target { x86_64-*-linux* && lp64 } } } */
+/* { dg-options "-fsanitize=thread" } */
+
+void
+foo ()
+{
+ __builtin_return (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55831.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55831.c
new file mode 100644
index 000000000..ce7be63e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55831.c
@@ -0,0 +1,39 @@
+/* PR tree-optimization/55831 */
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-overflow -ftree-vectorize -Wno-unused-label" } */
+
+int g;
+short p, q;
+
+void
+foo (void)
+{
+ short a = p, b = q, i;
+
+ if (a)
+ {
+ label:
+ for (i = 0; i < 8; i++)
+ b ^= a++;
+
+ if (!b)
+ g = 0;
+ }
+}
+
+void
+bar (void)
+{
+ short a = p, b = q, i;
+
+ if (a)
+ {
+ label:
+ for (i = 0; i < 8; i++)
+ b ^= (a = a + 1);
+
+ if (!b)
+ g = 0;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55833.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55833.c
new file mode 100644
index 000000000..7a5c549d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55833.c
@@ -0,0 +1,28 @@
+/* PR rtl-optimization/55833 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int a, b, c;
+
+void foo()
+{
+ unsigned d, l, *p, k = 1;
+
+ if(bar())
+ {
+label:
+ if((a = a <= 0))
+ {
+ if(c)
+ d = b;
+
+ if (b || d ? l : k ? : 0)
+ a = d = 0;
+
+ goto label;
+ }
+ }
+
+ while(*p++)
+ goto label;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55838.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55838.c
new file mode 100644
index 000000000..d2d6e142b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55838.c
@@ -0,0 +1,13 @@
+/* PR rtl-optimization/55838 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+int a;
+unsigned char c;
+
+void
+f (void)
+{
+ while (c++ < 2)
+ c = a += 129;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr55940.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr55940.c
new file mode 100644
index 000000000..d046d0b69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr55940.c
@@ -0,0 +1,54 @@
+/* PR target/55940 */
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+/* { dg-additional-options "-mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+struct S { int s; unsigned long t; };
+
+__attribute__ ((noinline, noclone)) unsigned long long
+bar (struct S *x, unsigned long y)
+{
+ asm volatile ("" : : "r" (x), "r" (y) : "memory");
+ return x->s + y;
+}
+
+__attribute__ ((noinline, noclone)) unsigned long long
+foo (struct S *x, unsigned long y)
+{
+ unsigned long a;
+ if (__builtin_expect (((__UINTPTR_TYPE__) (x) + 0x1000U < 0x2000U), 0))
+ return ~0ULL;
+ if (__builtin_expect (x->s <= 0 || x->s > 9, 0))
+ return ~0ULL;
+ a = x->t >> 12;
+ if (y == a)
+ return ~0ULL;
+ if (x->s == 3)
+ return x->t + y * 4096;
+ return bar (x, y);
+}
+
+int va, vb, vc, vd;
+
+int
+main ()
+{
+ struct S s;
+ asm volatile ("" : : : "memory");
+ int a = va, b = vb, c = vc, d = vd;
+ asm volatile ("" : : : "memory");
+ int i;
+ for (i = 0; i < 64; i++)
+ if (foo ((struct S *) 0, 0) != ~0ULL)
+ __builtin_abort ();
+ s.s = 3;
+ s.t = 2 << 12;
+ if (foo (&s, 2) != ~0ULL)
+ __builtin_abort ();
+ if (foo (&s, 3) != (2 << 12) + 3 * 4096)
+ __builtin_abort ();
+ asm volatile ("" : : : "memory");
+ va = a; vb = b; vc = c; vd = d;
+ asm volatile ("" : : : "memory");
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56023.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56023.c
new file mode 100644
index 000000000..ae0117bc2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56023.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+void
+foo (char *c)
+{
+ unsigned int x = 0;
+ unsigned int i;
+
+ for (i = 0; c[i]; i++)
+ {
+ if (i >= 5 && x != 1)
+ break;
+ else if (c[i] == ' ')
+ x = i;
+ else if (c[i] == '/' && c[i + 1] != ' ' && i)
+ x = i + 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56035.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56035.c
new file mode 100644
index 000000000..4e3a77e19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56035.c
@@ -0,0 +1,35 @@
+/* PR tree-optimization/56035 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize -fcse-follow-jumps -fstrict-overflow" } */
+
+short a, c, *p;
+
+void
+f (void)
+{
+ int b;
+
+ if (c)
+ lbl1:
+ for (a = 0; a < 1; a++)
+ {
+ for (c = 0; c < 1; c++)
+ {
+ goto lbl1;
+ while (*p++)
+ lbl2:
+ ;
+ }
+ }
+
+ for (;; b++)
+ {
+ if (c)
+ goto lbl2;
+ lbl3:
+ for (c = 0; c < 9; c++)
+ for (c = -17; c < 2; c++)
+ if (*p)
+ goto lbl3;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56078.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56078.c
new file mode 100644
index 000000000..ba759f220
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56078.c
@@ -0,0 +1,25 @@
+/* PR c/56078 */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern int memcmp (const void *, const void *, size_t);
+extern void abort (void);
+
+struct T { int a; char b[]; };
+struct T t1 = { .a = 1, .b = "abcd", .b[0] = '2' };
+struct T t2 = { .a = 1, .b = "2bcd" };
+struct T t3 = { .a = 1, .b[2] = 'a' };
+struct T t4 = { .a = 1, .b = { '\0', '\0', 'a' } };
+struct T t5 = { .a = 1, .b = { [0] = 'a', [1] = 'b', [2] = 'c' } };
+struct T t6 = { .a = 1, .b[2] = 'c', .b[1] = 'x', .b[0] = 'a', .b[1] = 'b' };
+
+int
+main ()
+{
+ if (memcmp (t1.b, t2.b, sizeof ("abcd")) != 0
+ || memcmp (t3.b, t4.b, 3) != 0
+ || memcmp (t5.b, t6.b, 3) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56094.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56094.c
new file mode 100644
index 000000000..d22331193
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56094.c
@@ -0,0 +1,81 @@
+/* PR tree-optimization/56094 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fdump-tree-optimized-lineno" } */
+
+_Bool cond;
+
+int
+fn0 (unsigned char, unsigned long long, unsigned char,
+ unsigned char, signed short, unsigned int,
+ unsigned char *);
+
+extern void fn3 (unsigned char, unsigned char, unsigned char, unsigned char,
+ unsigned char, unsigned char, unsigned char, unsigned short);
+extern void fn7 (int);
+extern void fn8 (int);
+
+static __inline__ __attribute__ ((always_inline)) void
+fn1 (unsigned char arg0, unsigned char arg1, unsigned char arg2,
+ unsigned char arg3, unsigned char arg4, unsigned char arg5,
+ unsigned short arg6)
+{
+ asm volatile ("" :: "g" ((unsigned long long) arg0), "g" (arg1),
+ "g" (arg2), "g" (arg3), "g" (arg4), "g" (arg5),
+ "g" (arg6));
+ if (cond)
+ {
+ unsigned char loc0 = 0;
+ fn3 (loc0, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
+ }
+}
+
+static __inline__ __attribute__ ((always_inline)) void
+fn4 (unsigned int arg0, unsigned long long arg1)
+{
+ asm volatile ("" :: "g" (arg0), "g" (arg1));
+}
+
+static __inline__ __attribute__ ((always_inline)) void
+fn5 (unsigned int arg0, unsigned char arg1, unsigned int arg2,
+ unsigned char arg3)
+{
+ asm volatile ("" :: "g" (arg0), "g" (arg1),
+ "g" ((unsigned long long) arg2), "g" (arg3));
+}
+
+static __inline__ __attribute__ ((always_inline)) void
+fn6 (unsigned long long arg0, unsigned char arg1,
+ unsigned char arg2, signed short arg3,
+ unsigned int arg4, unsigned char * arg5)
+{
+ asm volatile ("" :: "g" (arg0), "g" ((unsigned long long) arg1),
+ "g" ((unsigned long long) arg2), "g" (arg3),
+ "g" (arg4), "g" (arg5));
+ if (cond)
+ {
+ unsigned char loc0 = 0;
+ fn0 (loc0, arg0, arg1, arg2, arg3, arg4, arg5);
+ }
+}
+
+unsigned char b[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa };
+unsigned int q = sizeof (b) / sizeof (b[0]);
+
+void
+foo ()
+{
+ int i;
+ for (i = 1; i <= 50; i++)
+ {
+ fn6 (i + 0x1234, i + 1, i + 0xa, i + 0x1234, q, b);
+ fn5 (i + 0xabcd, i << 1, i + 0x1234, i << 2);
+ fn7 (i + 0xdead);
+ fn8 (i + 0xdead);
+ fn1 (i, i + 1, i + 2, i + 3, i + 4, i + 5, i << 10);
+ fn4 (i + 0xfeed, i);
+ }
+}
+
+/* Verify no statements get the location of the foo () decl. */
+/* { dg-final { scan-tree-dump-not " : 65:1\\\]" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56098-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56098-1.c
new file mode 100644
index 000000000..c3b081a08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56098-1.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/56098 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+volatile int *p;
+
+void
+foo (int x)
+{
+ *p = 1;
+ if (x)
+ *p = 2;
+}
+
+/* { dg-final { scan-tree-dump-not "=\[^\n\r]*\\*p" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56098-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56098-2.c
new file mode 100644
index 000000000..3c967b525
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56098-2.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/56098 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fhoist-adjacent-loads -fdump-tree-optimized" } */
+
+struct S { volatile int i; volatile int j; };
+
+int
+bar (struct S *x, int y)
+{
+ int r;
+ if (y)
+ r = x->i;
+ else
+ r = x->j;
+ return r;
+}
+
+/* { dg-final { scan-tree-dump-not "r_\[0-9]* =.v. \[^\n\r]*;\[\n\r]* r_\[0-9]* =.v. " "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56117.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56117.c
new file mode 100644
index 000000000..242204815
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56117.c
@@ -0,0 +1,9 @@
+/* PR rtl-optimization/56117 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsched2-use-superblocks" } */
+
+void
+foo (void *p)
+{
+ __builtin_prefetch (p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56125.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56125.c
new file mode 100644
index 000000000..d1840a9a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56125.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/56125 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void abort (void);
+extern double fabs (double);
+
+__attribute__((cold)) double
+foo (double x, double n)
+{
+ double u = x / (n * n);
+ return u;
+}
+
+int
+main ()
+{
+ if (fabs (foo (29, 2) - 7.25) > 0.001)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56144.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56144.c
new file mode 100644
index 000000000..4b9822590
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56144.c
@@ -0,0 +1,35 @@
+/* PR rtl-optimization/56144 */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int a;
+union U0 { volatile unsigned f2, f4; };
+volatile int b;
+static union U0 c;
+volatile unsigned d, f;
+volatile int e, g, h, i, j, k, l, m, n, o, p;
+int
+main ()
+{
+ a = b;
+ a += c.f2;
+ a += c.f4;
+ unsigned q = h;
+ a += q;
+ q = g;
+ a += q;
+ a += f;
+ q = e;
+ a += q;
+ a += d;
+ a += 2L;
+ a += j;
+ a += i;
+ a += k;
+ a += p;
+ a += o;
+ a += n;
+ a += m;
+ a += l;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56167.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56167.c
new file mode 100644
index 000000000..fc377b475
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56167.c
@@ -0,0 +1,15 @@
+/* PR middle-end/56167 */
+/* { dg-do compile } */
+
+extern void foo (void) __attribute__ ((error (0))); /* { dg-warning "attribute ignored" } */
+extern void bar (void) __attribute__ ((warning (0))); /* { dg-warning "attribute ignored" } */
+int var __attribute__ ((error ("foo"))); /* { dg-warning "attribute ignored" } */
+
+int
+main ()
+{
+ foo ();
+ bar ();
+ var++;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56228.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56228.c
new file mode 100644
index 000000000..f1221b9d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56228.c
@@ -0,0 +1,17 @@
+/* PR target/56228 */
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+/* { dg-skip-if "accessing program memory with data memory address" { "avr-*-*" } { "*" } { "" } } */
+
+short a[14] = { 1, 2 };
+short b[15] = { 3, 4 };
+
+int
+foo ()
+{
+ void (*fna) (void) = (void (*) (void)) a;
+ void (*fnb) (void) = (void (*) (void)) b;
+ fna ();
+ fnb ();
+ return a[1] == b[1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56275.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56275.c
new file mode 100644
index 000000000..b901bb2b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56275.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+typedef long long v2tw __attribute__ ((vector_size (2 * sizeof (long long))));
+
+void tiger_block_v2 (long long in1, v2tw *res)
+{
+ v2tw i1 = { in1, in1 };
+
+ *res = i1 << 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56341-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56341-1.c
new file mode 100644
index 000000000..91cf80ba2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56341-1.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+extern void abort (void);
+
+struct test0
+{
+ unsigned char b1[2];
+} __attribute__((packed, aligned(2)));
+
+struct test1
+{
+ volatile unsigned long a1;
+ unsigned char b1[4];
+} __attribute__((packed, aligned(2)));
+
+struct test2
+{
+ struct test0 t0;
+ struct test1 t1;
+ struct test0 t2;
+} __attribute__((packed, aligned(2)));
+
+struct test2 xx;
+struct test2 *x1 = &xx;
+
+#define MAGIC 0x12345678
+
+void test0 (struct test2* x1)
+{
+ x1->t1.a1 = MAGIC;
+}
+
+int main()
+{
+ test0 (x1);
+ if (xx.t1.a1 != MAGIC)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56341-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56341-2.c
new file mode 100644
index 000000000..e6f6569f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56341-2.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-fno-strict-volatile-bitfields" } */
+
+extern void abort (void);
+
+struct test0
+{
+ unsigned char b1[2];
+} __attribute__((packed, aligned(2)));
+
+struct test1
+{
+ volatile unsigned long a1;
+ unsigned char b1[4];
+} __attribute__((packed, aligned(2)));
+
+struct test2
+{
+ struct test0 t0;
+ struct test1 t1;
+ struct test0 t2;
+} __attribute__((packed, aligned(2)));
+
+struct test2 xx;
+struct test2 *x1 = &xx;
+
+#define MAGIC 0x12345678
+
+void test0 (struct test2* x1)
+{
+ x1->t1.a1 = MAGIC;
+}
+
+int main()
+{
+ test0 (x1);
+ if (xx.t1.a1 != MAGIC)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56350.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56350.c
new file mode 100644
index 000000000..899a507ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56350.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/56350 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize" } */
+
+int a, b, c;
+
+void
+f (void)
+{
+ for (; c; c++)
+ for (b = 0; b < 2; b++)
+ a /= 8;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56355-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56355-1.c
new file mode 100644
index 000000000..08b9c2e71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56355-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wstrict-overflow=4" } */
+
+int
+f (int i)
+{
+ return __builtin_abs (i * i); /* { dg-warning "assuming signed overflow" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56396.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56396.c
new file mode 100644
index 000000000..160545b98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56396.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/56396 */
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fpic -g" } */
+
+struct S { char *s; int z; };
+struct T { int t; } *c, u;
+void bar (int, const char *);
+
+inline void *
+foo (void *x, char *y, int z)
+{
+ struct S s;
+ char b[256];
+ s.s = b;
+ s.z = __builtin___sprintf_chk (s.s, 1, __builtin_object_size (s.s, 2), "Require");
+ if (s.z < 0)
+ bar (u.t | c->t, "rls");
+ if (foo (x, s.s, s.z))
+ {
+ }
+ return (void *) 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56424.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56424.c
new file mode 100644
index 000000000..a724c640e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56424.c
@@ -0,0 +1,33 @@
+/* PR tree-optimization/56424 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fexceptions -fnon-call-exceptions" } */
+
+extern long double cosl (long double);
+extern long double sinl (long double);
+extern long double reml (long double, long double);
+
+long double my_cos (long double arg)
+{
+ return cosl (arg);
+}
+
+long double my_sin (long double arg)
+{
+ if (__builtin_fabs (arg) < 1.0)
+ return arg;
+
+ return sinl (arg);
+}
+
+long double my_cot (long double arg, long double cycle)
+{
+ long double t = reml (arg, cycle);
+ return my_cos (t) / my_sin (t);
+}
+
+long double my_tan (long double arg, long double cycle)
+{
+ long double t = reml (arg, cycle);
+ return my_sin (t) / my_cos (t);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56436.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56436.c
new file mode 100644
index 000000000..cae4d2a4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56436.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/56426 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int a, *c;
+
+void
+f (void)
+{
+ int b = 0;
+
+ for (a = 0;; a++)
+ if (--b)
+ {
+ if (a)
+ lbl:
+ a++;
+
+ c = &b;
+ goto lbl;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56466.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56466.c
new file mode 100644
index 000000000..9d9e27356
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56466.c
@@ -0,0 +1,31 @@
+/* PR rtl-optimization/56466 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -w -funroll-loops" } */
+
+int a, b, c;
+
+void
+f (void)
+{
+ for (; b; b++)
+ {
+ if (0)
+ for (; b < 0; b++)
+ if (1 % 0)
+ {
+ while (1)
+ {
+ a = 0;
+ lbl1:
+ c++;
+ }
+ lbl2:
+ ;
+ }
+
+ goto lbl1;
+ }
+
+ a = 0;
+ goto lbl2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56494.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56494.c
new file mode 100644
index 000000000..e73d674a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56494.c
@@ -0,0 +1,13 @@
+/* PR rtl-optimization/56494 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -w" } */
+
+char a;
+short b;
+void bar (int);
+
+void
+foo (void)
+{
+ bar ((!!b ? : (a *= a / 0)) >= (a = b));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56510.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56510.c
new file mode 100644
index 000000000..d018d7d4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56510.c
@@ -0,0 +1,38 @@
+/* PR debug/56510 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+__extension__ typedef __INTPTR_TYPE__ intptr_t;
+struct S { unsigned long s1; void **s2[0]; };
+void **a, **b, **c, **d, **e, **f;
+
+static void **
+baz (intptr_t x, intptr_t y)
+{
+ void **s = f;
+ *f = (void **) (y << 8 | (x & 0xff));
+ f += y + 1;
+ return s;
+}
+
+void bar (void);
+void
+foo (void)
+{
+ void **g = b[4];
+ a = b[2];
+ b = b[1];
+ g[2] = e;
+ void **h
+ = ((void **************************)
+ a)[1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][66];
+ void **i = ((struct S *) h)->s2[4];
+ d = baz (4, 3);
+ d[1] = b;
+ d[2] = a;
+ d[3] = bar;
+ b = d;
+ g[1] = i[2];
+ a = g;
+ ((void (*) (void)) (i[1])) ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56548.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56548.c
new file mode 100644
index 000000000..2aa61d9cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56548.c
@@ -0,0 +1,16 @@
+/* PR middle-end/56548 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-march=pentium3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+short
+foo (short x)
+{
+ int i;
+
+ for (i = 0; i < 3; i++)
+ if (x > 0)
+ x--;
+
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56809.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56809.c
new file mode 100644
index 000000000..3f1f3115c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56809.c
@@ -0,0 +1,32 @@
+/* PR target/56809 */
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+int
+foo (int mode, int i)
+{
+ int x;
+
+ switch (mode)
+ {
+ case 0:
+ x = i + 1;
+ break;
+ case 1:
+ x = i / 2;
+ break;
+ case 2:
+ x = i * 3;
+ break;
+ case 3:
+ x = i + 3;
+ break;
+ case 4:
+ x = i + 5;
+ break;
+ default:
+ x = i - 1;
+ }
+
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56824.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56824.c
new file mode 100644
index 000000000..d682d0a81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56824.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/56824 */
+/* { dg-do compile } */
+/* { dg-options "-Waggregate-return" } */
+
+struct S { int i; };
+struct S foo (void);
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Waggregate-return"
+
+int
+main ()
+{
+ foo ();
+ return 0;
+}
+
+#pragma GCC diagnostic pop
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56837.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56837.c
new file mode 100644
index 000000000..d665a6db7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56837.c
@@ -0,0 +1,67 @@
+/* Limit this test to selected targets with IEEE double, 8-byte long long,
+ supported 4x int vectors, 4-byte int. */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* powerpc*-*-* } } } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+/* { dg-additional-options "-msse2" { target ia32 } } */
+/* { dg-additional-options "-mvsx -maltivec" { target powerpc*-*-* } } */
+
+typedef int V __attribute__((__vector_size__ (16)));
+#define N 1024
+double d[N];
+long long int l[N];
+_Bool b[N];
+_Complex double c[N];
+V v[N];
+
+void
+fd (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ d[i] = 747708026454360457216.0;
+}
+
+void
+fl (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ l[i] = 0x7c7c7c7c7c7c7c7cULL;
+}
+
+void
+fb (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ b[i] = 1;
+}
+
+void
+fc (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ c[i] = 747708026454360457216.0 + 747708026454360457216.0i;
+}
+
+void
+fv (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ v[i] = (V) { 0x12121212, 0x12121212, 0x12121212, 0x12121212 };
+}
+
+/* Look for
+ __builtin_memset (&d, 68, 8192);
+ __builtin_memset (&l, 124, 8192);
+ __builtin_memset (&b, 1, 1024);
+ __builtin_memset (&c, 68, 16384);
+ __builtin_memset (&v, 18, 16384); */
+/* { dg-final { scan-tree-dump-times "memset ..d, 68, 8192.;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "memset ..l, 124, 8192.;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "memset ..b, 1, 1024.;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "memset ..c, 68, 16384.;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "memset ..v, 18, 16384.;" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56847.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56847.c
new file mode 100644
index 000000000..b94aae1d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56847.c
@@ -0,0 +1,12 @@
+/* PR rtl-optimization/56847 */
+/* { dg-do compile { target pie } } */
+/* { dg-options "-O2 -fpie" } */
+
+struct S { long int a, b; } e;
+__thread struct S s;
+
+void
+foo (void)
+{
+ s = e;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56890-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56890-1.c
new file mode 100644
index 000000000..93b2134e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56890-1.c
@@ -0,0 +1,15 @@
+/* PR target/56890 */
+/* Reported by Rainer Jung <rainer.jung@kippdata.de> */
+
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+unsigned int buggy(unsigned int min, unsigned int max)
+{
+ if (max < 16384) {
+ unsigned short num16 = 0;
+ num16 = min + (long) ((double) (max - min + 1.0) * (num16 / (65535 + 1.0)));
+ return num16;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56890-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56890-2.c
new file mode 100644
index 000000000..474327e9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56890-2.c
@@ -0,0 +1,19 @@
+/* PR target/56890 */
+/* Reported by Rainer Jung <rainer.jung@kippdata.de> */
+
+/* { dg-do assemble } */
+/* { dg-options "-O" } */
+
+unsigned int buggy(unsigned int min, unsigned int max)
+{
+ unsigned int number;
+ if (max < 16384) {
+ unsigned short num16;
+ num16 = min + (long) ((double) (max - min + 1.0) * (num16 / (65535 + 1.0)));
+ return num16;
+ }
+ else {
+ (number) = min + (long) ((double) (max - min + 1.0) * (number / (4294967295U + 1.0)));
+ }
+ return number;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56977.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56977.c
new file mode 100644
index 000000000..fde88afed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56977.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Og" } */
+
+__attribute__((__error__("error"))) void error ();
+
+void f (int i) {
+ if (__builtin_constant_p (i)) {
+ error ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56990.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56990.c
new file mode 100644
index 000000000..ecb6acef6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56990.c
@@ -0,0 +1,10 @@
+/* PR sanitizer/56990 */
+/* { dg-do compile { target { x86_64-*-linux* && lp64 } } } */
+/* { dg-options "-fsanitize=thread" } */
+
+struct S{};
+
+void foo(struct S *p)
+{
+ *p = (struct S){};
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56992.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56992.c
new file mode 100644
index 000000000..e945a18ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56992.c
@@ -0,0 +1,18 @@
+/* PR rtl-optimization/56992 */
+/* { dg-do compile } */
+/* { dg-options "-Og -g" } */
+
+inline int
+foo (const char *x)
+{
+ return __builtin_strlen (x);
+}
+
+int
+bar (const char *x, unsigned int *y)
+{
+ unsigned int l = foo (x);
+ if (l > 15)
+ l = 15;
+ *y = l;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-1.c
new file mode 100644
index 000000000..42458a106
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-1.c
@@ -0,0 +1,44 @@
+/* Test volatile access to unaligned field. */
+/* { dg-do run } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+extern void abort (void);
+
+#define test_type unsigned short
+#define MAGIC (unsigned short)0x102u
+
+typedef struct s{
+ unsigned char Prefix;
+ test_type Type;
+}__attribute((__packed__)) ss;
+
+volatile ss v;
+ss g;
+
+void __attribute__((noinline))
+foo (test_type u)
+{
+ v.Type = u;
+}
+
+test_type __attribute__((noinline))
+bar (void)
+{
+ return v.Type;
+}
+
+int main()
+{
+ test_type temp;
+ foo(MAGIC);
+ __builtin_memcpy(&g, (void *)&v, sizeof(g));
+ if (g.Type != MAGIC)
+ abort ();
+
+ g.Type = MAGIC;
+ __builtin_memcpy((void *)&v, &g, sizeof(v));
+ temp = bar();
+ if (temp != MAGIC)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-2.c
new file mode 100644
index 000000000..759a469bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-2.c
@@ -0,0 +1,45 @@
+/* Test volatile access to unaligned field. */
+/* { dg-do run } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+extern void abort (void);
+
+#define test_type unsigned int
+#define MAGIC 0x1020304u
+
+typedef struct s{
+ unsigned char Prefix;
+ test_type Type;
+}__attribute((__packed__)) ss;
+
+volatile ss v;
+ss g;
+
+void __attribute__((noinline))
+foo (test_type u)
+{
+ v.Type = u;
+}
+
+test_type __attribute__((noinline))
+bar (void)
+{
+ return v.Type;
+}
+
+int main()
+{
+ test_type temp;
+ foo(MAGIC);
+ __builtin_memcpy(&g, (void *)&v, sizeof(g));
+ if (g.Type != MAGIC)
+ abort ();
+
+ g.Type = MAGIC;
+ __builtin_memcpy((void *)&v, &g, sizeof(v));
+ temp = bar();
+ if (temp != MAGIC)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-3.c
new file mode 100644
index 000000000..3754b108a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-3.c
@@ -0,0 +1,44 @@
+/* Test volatile access to unaligned field. */
+/* { dg-do run } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+extern void abort (void);
+
+#define test_type unsigned long long
+#define MAGIC 0x102030405060708ull
+
+typedef struct s{
+ unsigned char Prefix;
+ test_type Type;
+}__attribute((__packed__)) ss;
+
+volatile ss v;
+ss g;
+
+void __attribute__((noinline))
+foo (test_type u)
+{
+ v.Type = u;
+}
+
+test_type __attribute__((noinline))
+bar (void)
+{
+ return v.Type;
+}
+
+int main()
+{
+ test_type temp;
+ foo(MAGIC);
+ __builtin_memcpy(&g, (void *)&v, sizeof(g));
+ if (g.Type != MAGIC)
+ abort ();
+
+ g.Type = MAGIC;
+ __builtin_memcpy((void *)&v, &g, sizeof(v));
+ temp = bar();
+ if (temp != MAGIC)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-4.c
new file mode 100644
index 000000000..38f6248d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56997-4.c
@@ -0,0 +1,23 @@
+/* Test volatile access to unaligned field. */
+/* { dg-do compile } */
+/* { dg-options "-fno-strict-volatile-bitfields -fdump-rtl-final" } */
+
+#define test_type unsigned short
+
+typedef struct s{
+ unsigned char Prefix[1];
+ volatile test_type Type;
+}__attribute((__packed__,__aligned__(4))) ss;
+
+extern volatile ss v;
+
+void
+foo (test_type u)
+{
+ v.Type = u;
+}
+
+/* The C++ memory model forbids data store race conditions outside the
+ unaligned data member, therefore only QI or HI access is allowed, no SI. */
+/* { dg-final { scan-rtl-dump-not "mem/v(/.)*:SI" "final" } } */
+/* { dg-final { cleanup-rtl-dump "final" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57104.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57104.c
new file mode 100644
index 000000000..3a7013bea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57104.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/57104 */
+/* { dg-do compile { target { x86_64-*-linux* && lp64 } } } */
+/* { dg-options "-fsanitize=thread" } */
+
+register int r asm ("r14");
+int v;
+
+int
+foo (void)
+{
+ return r + v;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57105.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57105.c
new file mode 100644
index 000000000..a968f5237
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57105.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-Os -fselective-scheduling2 -g" } */
+int bar (int);
+int *baz (int *);
+
+void
+foo (int a)
+{
+ while (bar (0))
+ {
+ int *c = baz (0);
+ if (a)
+ {
+ int i = *baz (c);
+ }
+ bar (*baz (c));
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57134.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57134.c
new file mode 100644
index 000000000..94ff0929c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57134.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mstrict-align" { target { powerpc*-*-linux* powerpc*-*-elf* } } } */
+
+#include <stdint.h>
+
+typedef struct {
+ int64_t counter;
+} atomic64_t;
+
+struct buffer_page {
+ void *a, *b;
+ atomic64_t entries;
+};
+
+static __inline__ __attribute__((always_inline)) int64_t
+atomic64_read(const atomic64_t *v)
+{
+ int64_t t;
+ __asm__ __volatile__("# %0, %1" : "=r"(t) : "m"(v->counter));
+ return t;
+}
+
+int rb_remove_pages(void *p)
+{
+ struct buffer_page *blah = (void *)((intptr_t) p & -4);
+ return atomic64_read(&blah->entries);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57149.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57149.c
new file mode 100644
index 000000000..ab4d5e408
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57149.c
@@ -0,0 +1,50 @@
+/* PR tree-optimization/57149 */
+/* { dg-do compile } */
+/* { dg-options "-Os -Wuninitialized" } */
+
+struct A { struct A *a, *b; };
+struct D { struct A e; };
+struct E { unsigned char f; struct { struct A e; } g; };
+struct F { struct E i[32]; };
+
+extern int fn0 (void);
+extern int fn1 (struct E *, struct D *);
+
+static inline __attribute__ ((always_inline)) int
+fn2 (const struct A *x)
+{
+ return x->a == x;
+}
+
+static int
+fn3 (struct E *x)
+{
+ struct D *l, *m;
+ int retval = retval;
+ if (fn2 (&x->g.e))
+ return 0;
+ for (l = (struct D *) x->g.e.a, m = (struct D *) l->e.a;
+ &l->e != &x->g.e;
+ l = m, m = (struct D *) m->e.a)
+ retval = fn1 (x, l);
+ return retval;
+}
+
+void
+fn4 (struct F *x, unsigned k)
+{
+ unsigned i;
+ for (i = 0; i < k; i++)
+ {
+ struct E *y = &x->i[i];
+ int err = -22;
+ err = fn3 (y);
+ if (y->f == 0)
+ {
+ if (err > 0)
+ err = fn0 ();
+ if (err < 0) /* { dg-bogus "may be used uninitialized in this function" } */
+ fn0 ();
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57154.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57154.c
new file mode 100644
index 000000000..6e436befe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57154.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fschedule-insns" } */
+/* { dg-require-effective-target scheduling } */
+
+#define PF_FROZEN 0x00010000
+#define likely(x) __builtin_expect(!!(x), 1)
+
+struct cur
+{
+ unsigned long flags;
+};
+struct cur *cur;
+
+unsigned long freeze_cnt;
+
+extern int foo(void *);
+extern int slow_path(void *);
+
+static inline int freezing(void *p)
+{
+ if (likely(!foo(&freeze_cnt)))
+ return 0;
+ return slow_path(p);
+}
+
+extern int blah(void);
+
+int testcase(int check_kthr_stop)
+{
+ int was_frozen = 0;
+
+ for (;;) {
+ if (!freezing(cur) ||
+ (check_kthr_stop && blah()))
+ cur->flags &= ~PF_FROZEN;
+
+ if (!(cur->flags & PF_FROZEN))
+ break;
+
+ was_frozen = 1;
+ }
+
+ return was_frozen;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57184.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57184.c
new file mode 100644
index 000000000..319d3fd53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57184.c
@@ -0,0 +1,13 @@
+/* PR debug/57184 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+struct S {};
+void bar (struct S *const);
+static struct S *const c = &(struct S) {};
+
+void
+foo (void)
+{
+ bar (c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57286.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57286.c
new file mode 100644
index 000000000..c6f453054
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57286.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+typedef int vec __attribute__ ((vector_size (4*sizeof(int))));
+void f (vec *x){
+ *x = (*x < 0) | 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57287-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57287-2.c
new file mode 100644
index 000000000..1ddf76c64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57287-2.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+#include <setjmp.h>
+
+struct node
+{
+ struct node *next;
+ char *name;
+} *list;
+
+struct node *list;
+struct node *head (void);
+
+jmp_buf *bar (void);
+
+int baz (void)
+{
+ struct node *n;
+ int varseen = 0;
+
+ list = head ();
+ for (n = list; n; n = n->next)
+ {
+ if (!varseen)
+ varseen = 1;
+
+ jmp_buf *buf = bar (); /* { dg-bogus "may be used uninitialized" "" } */
+ setjmp (*buf);
+ }
+
+ if (!varseen)
+ return 0;
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57287.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57287.c
new file mode 100644
index 000000000..72225b119
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57287.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+#include <setjmp.h>
+
+jmp_buf buf;
+
+void foo (int);
+void bar (int) __attribute__((leaf));
+
+void enumerate_locals (int indent)
+{
+ foo (0);
+ while (indent--)
+ {
+ int local_indent = 8 + (8 * indent);
+ if (local_indent != 8)
+ {
+ setjmp (buf);
+ bar (local_indent); /* { dg-bogus "may be used uninitialized" "" } */
+ }
+ }
+ foo (1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57300.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57300.c
new file mode 100644
index 000000000..13a272de5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57300.c
@@ -0,0 +1,21 @@
+/* PR rtl-optimization/57300 */
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-msse2" { target sse2_runtime } } */
+
+extern void abort (void);
+int a, b, d[10];
+long long c;
+
+int
+main ()
+{
+ int e;
+ for (e = 0; e < 10; e++)
+ d[e] = 1;
+ if (d[0])
+ c = a = (b == 0 || 1 % b);
+ if (a != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57518.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57518.c
new file mode 100644
index 000000000..94ef82db8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57518.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/57518 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-ira" } */
+
+char ip[10];
+int total;
+
+void foo() {
+ int t;
+
+ t = ip[2];
+ total = t & 0x3;
+}
+
+/* { dg-final { scan-rtl-dump-not "REG_EQUIV\[^\n\]*mem\[^\n\]*\"ip\".*subreg" "ira" } } */
+/* { dg-final { cleanup-rtl-dump "ira" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57662.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57662.c
new file mode 100644
index 000000000..7af845532
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57662.c
@@ -0,0 +1,47 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options " -O -fno-guess-branch-probability -fpeel-loops -freorder-blocks-and-partition -fschedule-insns2 -fsel-sched-pipelining -fselective-scheduling2 -ftree-pre" } */
+
+struct intC
+{
+ short x;
+ short y;
+};
+
+void Get(void);
+
+int size_x;
+
+struct
+{
+ int *depot_table;
+ struct intC *ti;
+ int size;
+} dummy;
+
+static inline int
+GetRotatedTileFromOffset (int *a, struct intC tidc)
+{
+ if (!*a)
+ Get ();
+ switch (*a)
+ {
+ case 0:
+ return (tidc.y << size_x) + tidc.x;
+ case 1:
+ return tidc.y + (dummy.size - tidc.x) * size_x;
+ case 2:
+ return tidc.x + (dummy.size - tidc.y) * size_x;
+ case 3:
+ return (dummy.size - tidc.x);
+ }
+ return 0;
+}
+
+int
+GetHangarNum (int *a, int i)
+{
+ while (dummy.size)
+ if (GetRotatedTileFromOffset (a, dummy.ti[i]))
+ return *dummy.depot_table;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57773.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57773.c
new file mode 100644
index 000000000..1c309506d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57773.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Wpedantic" } */
+
+enum e { A };
+struct { enum e b: 2; } s1;
+struct { signed char b: 2; } s2;
+struct { unsigned char b: 2; } s3;
+struct { short b: 2; } s4;
+struct { unsigned short b: 2; } s5;
+struct { long int b: 2; } s6;
+struct { unsigned long int b: 2; } s7;
+struct { long long int b: 2; } s8;
+struct { unsigned long long int b: 2; } s9;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57980.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57980.c
new file mode 100644
index 000000000..be83536c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57980.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/57980 */
+/* { dg-do compile } */
+/* { dg-options "-O -foptimize-sibling-calls -w" } */
+
+typedef int V __attribute__ ((vector_size (2 * sizeof (int))));
+extern V f (void);
+
+V
+bar (void)
+{
+ return -f ();
+}
+
+V
+foo (void)
+{
+ V v = { };
+ return v - f ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58010.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58010.c
new file mode 100644
index 000000000..a0fbd31f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58010.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funswitch-loops -ftree-vectorize" } */
+
+short a, b, c, d;
+
+void f(void)
+{
+ short e;
+
+ for(; e; e++)
+ for(; b; b++);
+
+ for(d = 0; d < 4; d++)
+ a ^= (e ^= 1) || c ? : e;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58145-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58145-1.c
new file mode 100644
index 000000000..0e236c045
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58145-1.c
@@ -0,0 +1,37 @@
+/* PR tree-optimization/58145 */
+/* { dg-do compile { target { int32plus } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct S { unsigned int data : 32; };
+struct T { unsigned int data; };
+volatile struct S s2;
+
+void
+f1 (int val)
+{
+ struct S s = { .data = val };
+ *(volatile struct S *) 0x880000UL = s;
+}
+
+void
+f2 (int val)
+{
+ struct T t = { .data = val };
+ *(volatile struct T *) 0x880000UL = t;
+}
+
+void
+f3 (int val)
+{
+ *(volatile unsigned int *) 0x880000UL = val;
+}
+
+void
+f4 (int val)
+{
+ struct S s = { .data = val };
+ s2 = s;
+}
+
+/* { dg-final { scan-tree-dump-times " ={v} " 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58145-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58145-2.c
new file mode 100644
index 000000000..840e98289
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58145-2.c
@@ -0,0 +1,51 @@
+/* PR tree-optimization/58145 */
+/* { dg-do compile { target { int32plus } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct S { unsigned int data : 32; };
+struct T { unsigned int data; };
+volatile struct S s2;
+
+static inline void
+f1 (int val)
+{
+ struct S s = { .data = val };
+ *(volatile struct S *) 0x880000UL = s;
+}
+
+static inline void
+f2 (int val)
+{
+ struct T t = { .data = val };
+ *(volatile struct T *) 0x880000UL = t;
+}
+
+static inline void
+f3 (int val)
+{
+ *(volatile unsigned int *) 0x880000UL = val;
+}
+
+static inline void
+f4 (int val)
+{
+ struct S s = { .data = val };
+ s2 = s;
+}
+
+void
+f5 (void)
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f1 (0);
+ for (i = 0; i < 100; i++)
+ f2 (0);
+ for (i = 0; i < 100; i++)
+ f3 (0);
+ for (i = 0; i < 100; i++)
+ f4 (0);
+}
+
+/* { dg-final { scan-tree-dump-times " ={v} " 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58346.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58346.c
new file mode 100644
index 000000000..b7940f6cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58346.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/58346 */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct U {};
+static struct U b[1] = { };
+extern void bar (struct U);
+
+void
+foo (void)
+{
+ bar (b[0]);
+}
+
+void
+baz (void)
+{
+ foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58432.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58432.c
new file mode 100644
index 000000000..22a720f14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58432.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O3 -fprofile-generate" } */
+
+struct {
+ int prefix;
+ int dir_idx;
+} *a;
+int b;
+void fn1() {
+ int *c, *d;
+ for (; b; b++)
+ if (d[b]) {
+ c[b] = d[b];
+ a[0].dir_idx = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58463.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58463.c
new file mode 100644
index 000000000..e2b441193
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58463.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-ealias-details -O2" } */
+
+typedef struct
+{
+ int data16;
+}
+list_data;
+void
+fn1 (list_data * p1)
+{
+ p1->data16 = p1->data16 & 1 & p1->data16 >> 1;
+}
+
+/* { dg-final { cleanup-tree-dump "ealias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58668.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58668.c
new file mode 100644
index 000000000..3e09508dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58668.c
@@ -0,0 +1,25 @@
+/* PR rtl-optimization/58668 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-mthumb" { target { { arm*-*-* } && arm_thumb2_ok } } } */
+
+void *fn1 (void *);
+void *fn2 (void *, const char *);
+void fn3 (void *);
+void fn4 (void *, int);
+
+void *
+test (void *x)
+{
+ void *a, *b;
+ if (!(a = fn1 (x)))
+ return (void *) 0;
+ if (!(b = fn2 (a, "w")))
+ {
+ fn3 (a);
+ return (void *) 0;
+ }
+ fn3 (a);
+ fn4 (b, 1);
+ return b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-1.c
new file mode 100644
index 000000000..94f56273f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-cddce1" } */
+
+int *
+fx (int *b, int *e)
+{
+ __SIZE_TYPE__ p = e - b;
+ /* The first forwprop pass should optimize this to return e; */
+ return b + p;
+}
+
+/* { dg-final { scan-tree-dump "return e" "cddce1" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-2.c
new file mode 100644
index 000000000..e0011e950
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-cddce1" } */
+
+__SIZE_TYPE__
+fx (char *a, __SIZE_TYPE__ sz)
+{
+ char *b = a + sz;
+ /* The first forwprop pass should optimize this to return sz; */
+ return b - a;
+}
+
+/* { dg-final { scan-tree-dump "return sz" "cddce1" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-3.c
new file mode 100644
index 000000000..f4e95e645
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58742-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-cddce1" } */
+
+int *
+fx (int *a, int sz)
+{
+ int *b = a + sz;
+ b = b - sz;
+ /* forwprop together with FRE should optimize this to return a; */
+ return b;
+}
+
+/* { dg-final { scan-tree-dump "return a" "cddce1" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58805.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58805.c
new file mode 100644
index 000000000..dda0e4bdf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58805.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */
+
+/* Type that matches the 'p' constraint. */
+#define TYPE void *
+
+static inline
+void bar (TYPE *r)
+{
+ TYPE t;
+ __asm__ ("" : "=&p" (t), "=p" (*r));
+}
+
+void
+foo (int n, TYPE *x, TYPE *y)
+{
+ if (n == 0)
+ bar (x);
+ else
+ bar (y);
+}
+
+/* { dg-final { scan-tree-dump-times "__asm__" 2 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr58981.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr58981.c
new file mode 100644
index 000000000..1c8293e49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr58981.c
@@ -0,0 +1,55 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-minline-all-stringops" { target { i?86-*-* x86_64-*-* } } } */
+
+extern void abort (void);
+
+#define MAX_OFFSET (sizeof (long long))
+#define MAX_COPY (8 * sizeof (long long))
+#define MAX_EXTRA (sizeof (long long))
+
+#define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA)
+
+static union {
+ char buf[MAX_LENGTH];
+ long long align_int;
+ long double align_fp;
+} u;
+
+char A[MAX_LENGTH];
+
+int
+main ()
+{
+ int off, len, i;
+ char *p, *q;
+
+ for (i = 0; i < MAX_LENGTH; i++)
+ A[i] = 'A';
+
+ for (off = 0; off < MAX_OFFSET; off++)
+ for (len = 1; len < MAX_COPY; len++)
+ {
+ for (i = 0; i < MAX_LENGTH; i++)
+ u.buf[i] = 'a';
+
+ p = __builtin_memcpy (u.buf + off, A, len);
+ if (p != u.buf + off)
+ abort ();
+
+ q = u.buf;
+ for (i = 0; i < off; i++, q++)
+ if (*q != 'a')
+ abort ();
+
+ for (i = 0; i < len; i++, q++)
+ if (*q != 'A')
+ abort ();
+
+ for (i = 0; i < MAX_EXTRA; i++, q++)
+ if (*q != 'a')
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59011.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59011.c
new file mode 100644
index 000000000..2fb8187ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59011.c
@@ -0,0 +1,22 @@
+/* PR middle-end/59011 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void
+foo (int m)
+{
+ int a[m];
+ void
+ bar (void)
+ {
+ {
+ int
+ baz (void)
+ {
+ return a[0];
+ }
+ }
+ a[0] = 42;
+ }
+ bar ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59020.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59020.c
new file mode 100644
index 000000000..696c9df9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59020.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/59020 */
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fmodulo-sched -fno-inline -march=corei7" } */
+
+int a, b, d;
+unsigned c;
+
+void f()
+{
+ unsigned q;
+ for(; a; a++)
+ if(((c %= d && 1) ? : 1) & 1)
+ for(; b; q++);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59261.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59261.c
new file mode 100644
index 000000000..6b912deb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59261.c
@@ -0,0 +1,17 @@
+/* PR middle-end/59261 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef signed char V __attribute__((vector_size (8)));
+
+void
+foo (V *a, V *b)
+{
+ *a = *b * 3;
+}
+
+void
+bar (V *a, V *b)
+{
+ *a = *b * 4;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59350-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59350-2.c
new file mode 100644
index 000000000..2fea85fcf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59350-2.c
@@ -0,0 +1,29 @@
+/* PR debug/59350 */
+
+/* { dg-do compile } */
+/* { dg-options "-O -g " } */
+
+typedef struct
+{
+ void *v;
+ int len;
+ int sign;
+} ZVALUE;
+
+extern int pred (ZVALUE);
+
+static unsigned long
+small_factor (ZVALUE z)
+{
+ if (z.len > 0)
+ return 0;
+
+ return pred (z) ? -1 : 0;
+}
+
+unsigned long
+zfactor (ZVALUE z)
+{
+ z.sign = 0;
+ return small_factor (z);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59350.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59350.c
new file mode 100644
index 000000000..fa632454a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59350.c
@@ -0,0 +1,82 @@
+/* PR debug/59350 */
+/* Testcase by Ryan Mansfield <rmansfield@qnx.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-O -g" } */
+
+typedef union
+{
+ char b[2];
+ short NotAnInteger;
+}
+mDNSOpaque16;
+typedef mDNSOpaque16 mDNSIPPort;
+typedef struct
+{
+}
+mDNSAddr;
+typedef struct DNSQuestion_struct DNSQuestion;
+typedef struct mDNS_struct mDNS;
+typedef struct __attribute__ ((__packed__))
+{
+ mDNSOpaque16 id;
+ mDNSOpaque16 flags;
+}
+
+DNSMessageHeader;
+typedef struct __attribute__ ((__packed__))
+{
+ DNSMessageHeader h;
+}
+
+DNSMessage;
+struct DNSQuestion_struct
+{
+ DNSQuestion *next;
+ long LastQTime;
+ mDNSOpaque16 TargetQID;
+};
+struct mDNS_struct
+{
+ long timenow;
+ DNSQuestion *Questions;
+};
+extern long mDNSPlatformOneSecond;
+typedef enum
+{
+ kDNSFlag0_QR_Mask = 0x80, kDNSFlag0_QR_Query = 0x00, kDNSFlag0_QR_Response =
+ 0x80, kDNSFlag0_OP_Mask = 0x78, kDNSFlag0_OP_StdQuery =
+ 0x00, kDNSFlag0_OP_Iquery = 0x08, kDNSFlag0_OP_Status =
+ 0x10, kDNSFlag0_OP_Unused3 = 0x18, kDNSFlag0_OP_Notify =
+ 0x20, kDNSFlag0_OP_Update = 0x28, kDNSFlag0_QROP_Mask =
+ kDNSFlag0_QR_Mask | kDNSFlag0_OP_Mask, kDNSFlag0_AA = 0x04, kDNSFlag0_TC =
+ 0x02, kDNSFlag0_RD = 0x01, kDNSFlag1_RA = 0x80, kDNSFlag1_Zero =
+ 0x40, kDNSFlag1_AD = 0x20, kDNSFlag1_CD = 0x10, kDNSFlag1_RC_Mask =
+ 0x0F, kDNSFlag1_RC_NoErr = 0x00, kDNSFlag1_RC_FormErr =
+ 0x01, kDNSFlag1_RC_ServFail = 0x02, kDNSFlag1_RC_NXDomain =
+ 0x03, kDNSFlag1_RC_NotImpl = 0x04, kDNSFlag1_RC_Refused =
+ 0x05, kDNSFlag1_RC_YXDomain = 0x06, kDNSFlag1_RC_YXRRSet =
+ 0x07, kDNSFlag1_RC_NXRRSet = 0x08, kDNSFlag1_RC_NotAuth =
+ 0x09, kDNSFlag1_RC_NotZone = 0x0A
+}
+TSIG_ErrorCode;
+void
+uDNS_ReceiveMsg (mDNS * const m, DNSMessage * const msg,
+ const char * const end, const mDNSAddr * const srcaddr,
+ const mDNSIPPort srcport)
+{
+ DNSQuestion *qptr;
+ char StdR = kDNSFlag0_QR_Response | kDNSFlag0_OP_StdQuery;
+ char QR_OP = (char) (msg->h.flags.b[0] & kDNSFlag0_QROP_Mask);
+ if (QR_OP == StdR)
+ {
+ if (uDNS_ReceiveTestQuestionResponse (m, msg, end, srcaddr, srcport))
+ return;
+ for (qptr = m->Questions; qptr; qptr = qptr->next)
+ if (msg->h.flags.b[0] & kDNSFlag0_TC
+ && ((qptr->TargetQID).NotAnInteger == (msg->h.id).NotAnInteger)
+ && m->timenow - qptr->LastQTime < (60 * mDNSPlatformOneSecond))
+ {
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59351.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59351.c
new file mode 100644
index 000000000..384058f40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59351.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Wpedantic" } */
+
+unsigned int
+foo (void)
+{
+ return sizeof ((int[]) {}); /* { dg-warning "ISO C forbids empty initializer braces" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c
new file mode 100644
index 000000000..114c1d383
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59418.c
@@ -0,0 +1,35 @@
+/* PR debug/59418 */
+/* Reported by Ryan Mansfield <rmansfield@qnx.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-Os -g" } */
+/* { dg-options "-march=armv7-a -mfloat-abi=hard -Os -g" { target arm*-*-* } } */
+
+extern int printf (const char *__format, ...);
+
+void
+foo (const char *pptr, int caplen)
+{
+ int type;
+ const char *tptr;
+ if (caplen < 4)
+ {
+ (void) printf ("foo");
+ return;
+ }
+ while (tptr < pptr)
+ {
+ switch (type)
+ {
+ case 0x01:
+ printf ("");
+ case 0x0b:
+ printf ("");
+ case 0x0e:
+ printf ("");
+ case 0x10:
+ printf ("%1.2fW", bar (tptr, caplen) / 1000.0);
+ }
+ }
+ printf ("foo");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59471.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59471.c
new file mode 100644
index 000000000..7f2a7870a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59471.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8x4_t
+__attribute__ ((__vector_size__ (4)));
+
+typedef unsigned short uint16x8_t
+__attribute__ ((__vector_size__ (16)));
+
+typedef unsigned int uint32x4_t
+__attribute__ ((__vector_size__ (16)));
+
+void
+foo (uint16x8_t *x, uint8x4_t *y)
+{
+ *y = (uint8x4_t) ((uint32x4_t) (*x))[0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59523.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59523.c
new file mode 100644
index 000000000..b523eaea8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59523.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/59523 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */
+
+int *
+foo (int a, int *b, int *c, int *d)
+{
+ int i, *r = __builtin_alloca (a * sizeof (int));
+ __builtin_memcpy (r, d, a * sizeof (int));
+ for (i = 0; i < 64; i++)
+ c[i] += b[i];
+ for (i = 0; i < a; i++)
+ if (r[i] == 0)
+ r[i] = 1;
+ return r;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59605-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59605-2.c
new file mode 100644
index 000000000..d7567accf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59605-2.c
@@ -0,0 +1,6 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-DMAX_COPY=1025" { target simulator } } */
+/* { dg-additional-options "-minline-stringops-dynamically" { target { i?86-*-* x86_64-*-* } } } */
+
+#include "pr59605.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59605.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59605.c
new file mode 100644
index 000000000..5f87c99b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59605.c
@@ -0,0 +1,57 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-minline-stringops-dynamically" { target { i?86-*-* x86_64-*-* } } } */
+
+extern void abort (void);
+
+#define MAX_OFFSET (sizeof (long long))
+#ifndef MAX_COPY
+#define MAX_COPY (1024 + 8192)
+#endif
+#define MAX_EXTRA (sizeof (long long))
+
+#define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA)
+
+static union {
+ char buf[MAX_LENGTH];
+ long long align_int;
+ long double align_fp;
+} u;
+
+char A[MAX_LENGTH];
+
+int
+main ()
+{
+ int off, len, i;
+ char *p, *q;
+
+ for (i = 0; i < MAX_LENGTH; i++)
+ A[i] = 'A';
+
+ for (off = 0; off < MAX_OFFSET; off++)
+ for (len = 1; len < MAX_COPY; len++)
+ {
+ for (i = 0; i < MAX_LENGTH; i++)
+ u.buf[i] = 'a';
+
+ p = __builtin_memcpy (u.buf + off, A, len);
+ if (p != u.buf + off)
+ abort ();
+
+ q = u.buf;
+ for (i = 0; i < off; i++, q++)
+ if (*q != 'a')
+ abort ();
+
+ for (i = 0; i < len; i++, q++)
+ if (*q != 'A')
+ abort ();
+
+ for (i = 0; i < MAX_EXTRA; i++, q++)
+ if (*q != 'a')
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59630.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59630.c
new file mode 100644
index 000000000..6a3c72552
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59630.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+_Bool foo()
+{
+ _Bool (*f)(int) = __builtin_abs; /* { dg-warning "" } */
+ return f(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59643.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59643.c
new file mode 100644
index 000000000..f4df5e5b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59643.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/59643 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-pcom-details" } */
+
+void
+foo (double *a, double *b, double *c, double d, double e, int n)
+{
+ int i;
+ for (i = 1; i < n - 1; i++)
+ a[i] = d * (b[i] + c[i] + a[i - 1] + a[i + 1]) + e * a[i];
+}
+
+/* { dg-final { scan-tree-dump-times "Before commoning:" 1 "pcom" } } */
+/* { dg-final { scan-tree-dump-times "Unrolling 2 times" 1 "pcom" } } */
+/* { dg-final { cleanup-tree-dump "pcom" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59670.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59670.c
new file mode 100644
index 000000000..a68253b4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59670.c
@@ -0,0 +1,15 @@
+/* PR middle-end/59670 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fopenmp-simd" } */
+
+int d[1024];
+
+int
+foo (int j, int b)
+{
+ int l, c = 0;
+#pragma omp simd reduction(+: c)
+ for (l = 0; l < b; ++l)
+ c += d[j + l];
+ return c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59722.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59722.c
new file mode 100644
index 000000000..7626fd22e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59722.c
@@ -0,0 +1,36 @@
+/* PR ipa/59722 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+
+extern void abrt (const char *, int) __attribute__((noreturn));
+void baz (int *, int *);
+
+static inline int
+bar (void)
+{
+ return 1;
+}
+
+static inline void
+foo (int *x, int y (void))
+{
+ while (1)
+ {
+ int a = 0;
+ if (*x)
+ {
+ baz (x, &a);
+ while (a && !y ())
+ ;
+ break;
+ }
+ abrt ("", 1);
+ }
+}
+
+void
+test (int x)
+{
+ foo (&x, bar);
+ foo (&x, bar);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59827.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59827.c
new file mode 100644
index 000000000..77e1e9ca2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59827.c
@@ -0,0 +1,15 @@
+/* PR middle-end/59827 */
+/* { dg-do compile } */
+
+int
+foo (int p[2][]) /* { dg-error "array type has incomplete element type" } */
+{
+ return p[0][0];
+}
+
+void
+bar (void)
+{
+ int p[2][1];
+ foo (p); /* { dg-error "type of formal parameter 1 is incomplete" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59846.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59846.c
new file mode 100644
index 000000000..b3dd0de9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59846.c
@@ -0,0 +1,39 @@
+/* PR c/59846 */
+/* { dg-do compile } */
+/* { dg-options "-Wlogical-op -Wtype-limits" } */
+
+_Bool
+fn1 (unsigned int p)
+{
+ return 0ULL > p; /* { dg-warning "15:comparison is always false due to limited range of data type" } */
+}
+
+_Bool
+fn2 (unsigned int p)
+{
+ return 0ULL <= p; /* { dg-warning "15:comparison is always true due to limited range of data type" } */
+}
+
+_Bool
+fn3 (unsigned int p)
+{
+ return p >= 0U; /* { dg-warning "12:comparison of unsigned expression >= 0 is always true" } */
+}
+
+_Bool
+fn4 (unsigned int p)
+{
+ return p < 0U; /* { dg-warning "12:comparison of unsigned expression < 0 is always false" } */
+}
+
+_Bool
+fn5 (_Bool p)
+{
+ return p || !p; /* { dg-warning "12:logical" } */
+}
+
+_Bool
+fn6 (_Bool p)
+{
+ return p && !p; /* { dg-warning "12:logical" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59860.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59860.c
new file mode 100644
index 000000000..6807d9c84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59860.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__nothrow__ , __leaf__))
+strcat (char *__restrict __dest, const char *__restrict __src)
+{
+ return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
+}
+static char raw_decode;
+void foo (char **argv, char *outfilename)
+{
+ if (**argv == 'r')
+ raw_decode = 1;
+ strcat (outfilename, raw_decode ? ".raw" : ".wav");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59871.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59871.c
new file mode 100644
index 000000000..c881aa198
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59871.c
@@ -0,0 +1,22 @@
+/* PR c/59871 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+extern int bar ();
+
+void
+foo (int *p, int i)
+{
+ p[0] = (bar (), 1, bar ()); /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ p[1] = (1, bar ()); /* { dg-warning "left-hand operand of comma expression has no effect" } */
+ bar (), 1, bar (); /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ bar (), 1; /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ 1, bar (); /* { dg-warning "left-hand operand of comma expression has no effect" } */
+ (bar (), 1); /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ bar (), 5 * i; /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ (bar (), 5 * i); /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), 7))))))); /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), 7)))))); /* { dg-warning "right-hand operand of comma expression has no effect" } */
+ bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (7, bar ())))))); /* { dg-warning "left-hand operand of comma expression has no effect" } */
+ (bar (), (bar (), (bar (), (bar (), (bar (), (bar (), (7, bar ()))))))); /* { dg-warning "left-hand operand of comma expression has no effect" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-1.c
new file mode 100644
index 000000000..3e60d37ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-1.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/59920 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+#include <setjmp.h>
+
+int bar (void);
+void baz (int);
+
+#define A { int x = bar (); if (setjmp (buf) == 0) baz (x); }
+#define B A A A A A A A A A A
+#define C B B B B B B B B B B
+
+extern jmp_buf buf;
+
+void
+foo (void)
+{
+ C C
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-2.c
new file mode 100644
index 000000000..bee554274
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-2.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/59920 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+void *bar (void **);
+void *baz (int, void **);
+
+#define A(n) \
+ { __label__ l1_##n, l2_##n, l3_##n; \
+ static void *a[] = { &&l1_##n, &&l2_##n, &&l3_##n };\
+ void *b = bar (a); \
+ goto *b; \
+ l1_##n: \
+ b = baz (1, a); \
+ goto *b; \
+ l2_##n: \
+ b = baz (2, a); \
+ goto *b; \
+ l3_##n:; \
+ }
+#define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) \
+ A(n##5) A(n##6) A(n##7) A(n##8) A(n##9)
+#define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) \
+ B(n##5) B(n##6) B(n##7) B(n##8) B(n##9)
+
+void
+foo (void)
+{
+ C(1)
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-3.c
new file mode 100644
index 000000000..2159504e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59920-3.c
@@ -0,0 +1,47 @@
+/* PR tree-optimization/59920 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+void *bar (void **);
+void *baz (int, void **);
+
+#define A(n) __label__ l##n;
+#define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) \
+ A(n##5) A(n##6) A(n##7) A(n##8) A(n##9)
+#define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) \
+ B(n##5) B(n##6) B(n##7) B(n##8) B(n##9)
+#define D C(1)
+
+int
+foo (void)
+{
+ D
+ int bar (int i)
+ {
+ switch (i)
+ {
+#undef A
+#define A(n) \
+ case n: goto l##n;
+ D
+ }
+ return i;
+ }
+ int w = 0;
+#undef A
+#define A(n) int w##n = 0;
+ D
+#undef A
+#define A(n) \
+ { l##n:; \
+ w##n += bar (10000 + n) - 10000; \
+ w##n += bar (10001 + n) - 10000; \
+ bar (n + 1); \
+ return w##n; \
+ }
+ D
+#undef A
+#define A(n) w += w##n;
+ D
+ return w;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59924.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59924.c
new file mode 100644
index 000000000..1d8d52fb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59924.c
@@ -0,0 +1,27 @@
+/* PR tree-optimization/59924 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -Wall" } */
+
+struct S { struct T *a; double b; struct S *c; };
+struct T { struct S *d; };
+extern void bar (double);
+
+void
+foo (struct S * x, int y, int z, int w)
+{
+ int e;
+ struct S *f;
+ for (f = x->a->d; f; f = f->c)
+ {
+ if (5 < w)
+ {
+ e = -w;
+ z = w;
+ }
+ }
+ if (y != 0 || z != 0)
+ {
+ double g = x->b + (double) e * (double) y; /* { dg-warning "may be used uninitialized in this function" } */
+ bar (g * g);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59940.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59940.c
new file mode 100644
index 000000000..b0fd17f50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59940.c
@@ -0,0 +1,27 @@
+/* PR c/59940 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion -Woverflow" } */
+
+int f (unsigned int);
+
+int
+g (void)
+{
+ int si = 12;
+ unsigned int ui = -1; /* { dg-warning "21:negative integer implicitly converted to unsigned type" } */
+ unsigned char uc;
+ ui = si; /* { dg-warning "8:conversion" } */
+ si = 0x80000000; /* { dg-warning "8:conversion of unsigned constant value to negative integer" } */
+ si = 3.2f; /* { dg-warning "8:conversion" } */
+ uc = 256; /* { dg-warning "8:large integer implicitly truncated to unsigned type" } */
+ si = 0x800000000; /* { dg-warning "8:overflow in implicit constant conversion" } */
+ return f (si) /* { dg-warning "13:conversion" } */
+ + f (si); /* { dg-warning "15:conversion" } */
+}
+
+int
+y (void)
+{
+ f (); /* { dg-error "3:too few arguments to function" } */
+ g (0xa); /* { dg-error "3:too many arguments to function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-1.c
new file mode 100644
index 000000000..4a369db48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-1.c
@@ -0,0 +1,14 @@
+/* PR c/59963 */
+/* { dg-do compile } */
+/* { dg-options "-Wdouble-promotion" } */
+
+extern void baz ();
+extern void qux (int, ...);
+
+void
+foo (float f)
+{
+ bar (f); /* { dg-warning "8:implicit conversion" } */
+ baz (f); /* { dg-warning "8:implicit conversion" } */
+ qux (42, f); /* { dg-warning "12:implicit conversion" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-2.c
new file mode 100644
index 000000000..ea0594681
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-2.c
@@ -0,0 +1,36 @@
+/* PR c/59963 */
+/* { dg-do compile } */
+/* { dg-options "-Woverflow -Wconversion" } */
+
+extern void bar (unsigned char);
+extern void bar8 (unsigned char, unsigned char, unsigned char, unsigned char,
+ unsigned char, unsigned char, unsigned char, unsigned char);
+extern void bazu (unsigned int, ...);
+extern void bazi (char, int);
+extern int f (short a, short b);
+
+int
+g (void)
+{
+ return f (0xffffffffL, /* { dg-warning "13:overflow in implicit constant conversion" } */
+ 0xffffffffL) /* { dg-warning "13:overflow in implicit constant conversion" } */
+ && f (0xffffffffL, /* { dg-warning "9:overflow in implicit constant conversion" } */
+ 0xffffffffL); /* { dg-warning "9:overflow in implicit constant conversion" } */
+}
+
+void
+foo (int i)
+{
+ bar (256); /* { dg-warning "8:large integer implicitly truncated to unsigned type" } */
+ bar (6.66f); /* { dg-warning "8:conversion" } */
+ bar8 (-1, /* { dg-warning "9:negative integer implicitly converted to unsigned type" } */
+ -2, /* { dg-warning "3:negative integer implicitly converted to unsigned type" } */
+ -3, /* { dg-warning "4:negative integer implicitly converted to unsigned type" } */
+ -4, /* { dg-warning "5:negative integer implicitly converted to unsigned type" } */
+ -5, /* { dg-warning "6:negative integer implicitly converted to unsigned type" } */
+ -6, /* { dg-warning "7:negative integer implicitly converted to unsigned type" } */
+ -7, /* { dg-warning "8:negative integer implicitly converted to unsigned type" } */
+ -8); /* { dg-warning "9:negative integer implicitly converted to unsigned type" } */
+ bazu (i, i); /* { dg-warning "9:conversion" } */
+ bazi (0x8, 0x80000000); /* { dg-warning "14:conversion of unsigned constant value to negative integer" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-3.c
new file mode 100644
index 000000000..eafa37473
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59963-3.c
@@ -0,0 +1,14 @@
+/* PR c/59963 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion" } */
+
+extern void foo (void *p);
+
+void
+bar (void)
+{
+ {
+ /* This must not ICE. */
+ int i __attribute__((cleanup (foo)));
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr59992.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr59992.c
new file mode 100644
index 000000000..5434a2fe9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr59992.c
@@ -0,0 +1,17 @@
+/* PR debug/59992 */
+/* { dg-do compile } */
+/* { dg-require-effective-target run_expensive_tests } */
+/* { dg-options "-O2 -g" } */
+/* { dg-timeout-factor 16.0 } */
+
+#define A(n) if (p[n]) { extern void foo##n (int, int, double, int, int); foo##n (p[n], 5, 8.0, p[n] + p[n + 1], 9); return; }
+#define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) A(n##5) A(n##6) A(n##7) A(n##8) A(n##9)
+#define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) B(n##5) B(n##6) B(n##7) B(n##8) B(n##9)
+#define D(n) C(n##0) C(n##1) C(n##2) C(n##3) C(n##4) C(n##5) C(n##6) C(n##7) C(n##8) C(n##9)
+#define E(n) D(n##0) D(n##1) D(n##2) D(n##3) D(n##4) D(n##5) D(n##6) D(n##7) D(n##8) D(n##9)
+
+void
+foo (int *p)
+{
+ E(1)
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60013.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60013.c
new file mode 100644
index 000000000..5c2ec517d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60013.c
@@ -0,0 +1,47 @@
+/* PR ipa/60013 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef long int jmp_buf[64];
+extern int _setjmp (jmp_buf) __attribute__ ((__nothrow__));
+struct S { int a, b, c; };
+extern struct S *baz (struct S *);
+static jmp_buf j;
+
+static inline int
+bar (int b, int d)
+{
+ return (b & d) < 0;
+}
+
+struct S *
+foo (int a, struct S *b, struct S *c, struct S *d)
+{
+ if (b->a == 0)
+ {
+ switch (a)
+ {
+ case 8:
+ return baz (b);
+ case 7:
+ bar (b->c, c->b);
+ return 0;
+ case 6:
+ case 5:
+ case 4:
+ return baz (c);
+ case 3:
+ case 2:
+ return baz (d);
+ }
+ return 0;
+ }
+ if (b->a == 1)
+ {
+ if (baz (c))
+ return c;
+ else if (_setjmp (j))
+ baz (b);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60036.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60036.c
new file mode 100644
index 000000000..07eb6ace9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60036.c
@@ -0,0 +1,28 @@
+/* PR c/60036 */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion" } */
+
+extern int fn (void);
+
+void
+foo (int i)
+{
+ unsigned int f = 9;
+
+ /* Don't warn on these. */
+ f += fn () || i;
+ f += fn () && i;
+ f += ! fn ();
+ f -= fn () == i;
+ f |= fn () != i;
+ f &= fn () < i;
+ f ^= fn () > i;
+ f &= fn () <= i;
+ f ^= fn () >= i;
+
+ /* But warn on the following. */
+ f += fn (); /* { dg-warning "conversion" } */
+ f += fn () | i; /* { dg-warning "conversion" } */
+ f += fn () & i; /* { dg-warning "conversion" } */
+ f += fn () ^ i; /* { dg-warning "conversion" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60087.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60087.c
new file mode 100644
index 000000000..9cdd58973
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60087.c
@@ -0,0 +1,14 @@
+/* PR c/60087 */
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare" } */
+
+void
+foo (unsigned int ui, int i)
+{
+ const unsigned char uc = 0;
+ _Bool b;
+ b = 0 != ~uc; /* { dg-warning "9:promoted ~unsigned is always non-zero" } */
+ b = 2 != ~uc; /* { dg-warning "9:comparison of promoted ~unsigned with constant" } */
+ b = uc == ~uc; /* { dg-warning "10:comparison of promoted ~unsigned with unsigned" } */
+ b = i == ui; /* { dg-warning "9:comparison between signed and unsigned integer expressions" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60195.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60195.c
new file mode 100644
index 000000000..0a50a30be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60195.c
@@ -0,0 +1,56 @@
+/* PR c/60195 */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -Wpedantic -Wall" } */
+
+typedef _Atomic int atomic_int;
+
+atomic_int
+fn1 (void)
+{
+ atomic_int y = 0;
+ return y;
+}
+
+atomic_int
+fn2 (void)
+{
+ atomic_int y = 0;
+ y;
+ return y;
+}
+
+atomic_int
+fn3 (void)
+{
+ atomic_int y = 0;
+ y++;
+ return y;
+}
+
+void
+fn4 (void)
+{
+ atomic_int y;
+ y = 0;
+ (void) y;
+}
+
+void
+fn5 (void)
+{
+ atomic_int y = 0; /* { dg-warning "unused variable" } */
+}
+
+void
+fn6 (void)
+{
+ atomic_int y; /* { dg-warning "set but not used" } */
+ y = 0;
+}
+
+void
+fn7 (void)
+{
+ atomic_int y = 0;
+ y++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60267.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60267.c
new file mode 100644
index 000000000..b6228fcef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60267.c
@@ -0,0 +1,14 @@
+/* PR c++/60267 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -save-temps" } */
+
+void
+foo (int *a, int *b, int *c)
+{
+ int i;
+#pragma GCC ivdep
+ for (i = 0; i < 64; i++)
+ a[i] = b[i] * c[i];
+}
+
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60485-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60485-1.c
new file mode 100644
index 000000000..2e5c2e5bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60485-1.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+struct S {
+ int *i[4];
+ int *p1;
+ int *p2;
+ int *p3;
+ int *p4;
+};
+int **b;
+int main()
+{
+ int i = 1;
+ struct S s;
+ s.p3 = &i;
+ int **p;
+ if (b)
+ p = b;
+ else
+ p = &s.i[2];
+ p += 4;
+ if (!b)
+ **p = 0;
+ if (i != 0)
+ abort ();
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60485-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60485-2.c
new file mode 100644
index 000000000..767e61d1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60485-2.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+struct S {
+ int *i[4];
+ int *p1;
+ int *p2;
+ int *p3;
+ int *p4;
+ int **x;
+};
+int **b;
+int main()
+{
+ int i = 1;
+ struct S s;
+ s.p3 = &i;
+ int **p;
+ if (b)
+ p = b;
+ else
+ p = &s.i[2];
+ p += 4;
+ /* prevert fowrprop from creating an offsetted sd constraint and
+ preserve the pointer offsetting constraint. */
+ s.x = p;
+ p = s.x;
+ if (!b)
+ {
+ int *z = *p;
+ /* z should point to i (and non-local/escaped). */
+ *z = 0;
+ }
+ if (i != 0)
+ abort ();
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60598.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60598.c
new file mode 100644
index 000000000..331e8bde2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60598.c
@@ -0,0 +1,26 @@
+/* PR target/60598 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-fpic" { target fpic } } */
+/* { dg-additional-options "-march=z196 -mtune=zEC12" { target s390*-*-* } } */
+
+struct S { unsigned a, b[32]; };
+
+void
+foo (struct S *x, struct S *y)
+{
+ unsigned a = y->a, i;
+ if (x == y)
+ for (i = 0; i < a - 1 - i; i++)
+ {
+ unsigned t = x->b[i];
+ x->b[i] = x->b[a - 1 - i];
+ x->b[a - 1 - i] = t;
+ }
+ else
+ {
+ x->a = a;
+ for (i = 0; i < a; i++)
+ x->b[i] = y->b[a - 1 - i];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr8715.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr8715.c
new file mode 100644
index 000000000..e45e77c09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr8715.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Wsign-compare -std=c99" } */
+
+#include <stdbool.h>
+
+int foo()
+{
+ unsigned char b = '1';
+
+ bool x = ~b; /* { dg-warning "promoted ~unsigned is always non-zero" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr8788-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr8788-1.c
new file mode 100644
index 000000000..74e169409
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr8788-1.c
@@ -0,0 +1,20 @@
+/* PR inline-asm/8788 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef struct {
+ long x[6];
+} myjmp_buf;
+
+typedef struct {
+ myjmp_buf regs;
+} my_stack;
+
+void switch_to_stack (my_stack *stack){
+ asm ( /* { dg-error "impossible constraint" } */
+/* { dg-warning "asm operand 1" "asm operand 1" { target *-*-* } 14 } */
+ "\n"
+ : "+r" (stack->regs)
+ );
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr8835-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr8835-1.c
new file mode 100644
index 000000000..6e3703baa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr8835-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+struct s {
+ char c;
+};
+
+struct s
+foo (void)
+{
+ struct s s = { 0 };
+ return s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr8927-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr8927-1.c
new file mode 100644
index 000000000..85add6a4a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr8927-1.c
@@ -0,0 +1,13 @@
+/* Bug 8927: undeclared identifiers should give an error on the line
+ of that identifier, not on the line of the next token. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+foo(void)
+{
+ bar /* { dg-error "undeclared" } */
+ /* { dg-message "undeclared identifier is reported only once" "reminder" { target *-*-* } 9 } */
+
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr9365-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr9365-1.c
new file mode 100644
index 000000000..1c3db2fed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr9365-1.c
@@ -0,0 +1,41 @@
+/* PR target/9365
+ * Origin: marcus@mc.pp.se
+ * Testcase tweaked by dank@kegel.com
+ * gcc 3.4 coverage by joern.rennecke@superh.com
+ * [3.3 regression] [SH] segfault in gen_far_branch (config/sh/sh.c)
+ * ice-on-valid-code
+ * Not marked as xfail since it's a regression
+*/
+/* { dg-do compile } */
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+
+
+void foo(int n, int *p)
+{
+ switch(n) {
+ case 100: case 110: case 120: case 130: case 140: case 150: case 160:
+ case 200: case 210: case 220: case 230: case 240: case 250: case 260:
+ case 300: case 310: case 320: case 330: case 340: case 350: case 360:
+ case 400: case 410: case 420: case 430: case 440: case 450: case 460:
+ case 500: case 510: case 520: case 530: case 540: case 550: case 560:
+ case 600: case 610: case 620: case 630: case 640: case 650: case 660:
+ case 700: case 710: case 720: case 730: case 740: case 750: case 760:
+ case 800: case 810: case 820: case 830: case 840: case 850: case 860:
+ case 900: case 910: case 920: case 930: case 940: case 950: case 960:
+ break;
+ default:
+ *p = n;
+ break;
+ }
+}
+
+int main(int argc, char **argv)
+{
+ int p;
+
+ (void) argv;
+
+ foo(argc, &p);
+
+ return p;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr9814-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr9814-1.c
new file mode 100644
index 000000000..51b79f783
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr9814-1.c
@@ -0,0 +1,107 @@
+/* PR tree-optimization/9814 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort(void);
+
+int test1(int x)
+{
+ if (x & 2)
+ x |= 2;
+ return x;
+}
+
+int test2(int x)
+{
+ if (!(x & 2))
+ x |= 2;
+ return x;
+}
+
+int test3(int x)
+{
+ if (x & 2)
+ x ^= 2;
+ return x;
+}
+
+int test4(int x)
+{
+ if (!(x & 2))
+ x ^= 2;
+ return x;
+}
+
+int test5(int x)
+{
+ if (x & 2)
+ x &= ~2;
+ return x;
+}
+
+int test6(int x)
+{
+ if (!(x & 2))
+ x &= ~2;
+ return x;
+}
+
+int main()
+{
+ if (test1(0) != 0)
+ abort();
+ if (test1(2) != 2)
+ abort();
+ if (test1(5) != 5)
+ abort();
+ if (test1(7) != 7)
+ abort();
+
+ if (test2(0) != 2)
+ abort();
+ if (test2(2) != 2)
+ abort();
+ if (test2(5) != 7)
+ abort();
+ if (test2(7) != 7)
+ abort();
+
+ if (test3(0) != 0)
+ abort();
+ if (test3(2) != 0)
+ abort();
+ if (test3(5) != 5)
+ abort();
+ if (test3(7) != 5)
+ abort();
+
+ if (test4(0) != 2)
+ abort();
+ if (test4(2) != 2)
+ abort();
+ if (test4(5) != 7)
+ abort();
+ if (test4(7) != 7)
+ abort();
+
+ if (test5(0) != 0)
+ abort();
+ if (test5(2) != 0)
+ abort();
+ if (test5(5) != 5)
+ abort();
+ if (test5(7) != 5)
+ abort();
+
+ if (test6(0) != 0)
+ abort();
+ if (test6(2) != 2)
+ abort();
+ if (test6(5) != 5)
+ abort();
+ if (test6(7) != 7)
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-align-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-align-2.c
new file mode 100644
index 000000000..5cdaff958
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-align-2.c
@@ -0,0 +1,67 @@
+/* { dg-do run { target *-*-solaris2.* } } */
+/* { dg-options "-std=gnu99" } */
+
+void abort (void);
+
+#pragma align 1(x1)
+#pragma align 2(x2)
+#pragma align 4(x4)
+#pragma align 8(x8,y8,z8)
+#pragma align 16(x16)
+#pragma align 32(x32)
+#pragma align 64(x64)
+#pragma align 128(x128)
+
+#define MACRO 128
+#define MACRO2(A) A
+
+#pragma align MACRO(y128)
+#pragma align MACRO2(MACRO) (z128)
+
+#pragma align 8(not_defined)
+
+#pragma align 9(odd_align) /* { dg-warning "invalid alignment" } */
+#pragma align 256(high_align) /* { dg-warning "invalid alignment" } */
+#pragma align -1(neg_align) /* { dg-warning "malformed" } */
+#pragma align bad_align /* { dg-warning "malformed" } */
+#pragma align 1(bad_align /* { dg-warning "malformed" } */
+
+int x, x1, x2, x4, x8, y8, z8, x16, x32, x64, x128, y128, z128;
+
+#pragma align 16(x) /* { dg-warning "must appear before" } */
+
+int
+main ()
+{
+ if (__alignof__ (x4) < 4)
+ abort ();
+
+ if (__alignof__ (x8) < 8)
+ abort ();
+
+ if (__alignof__ (y8) < 8)
+ abort ();
+
+ if (__alignof__ (z8) < 8)
+ abort ();
+
+ if (__alignof__ (x16) < 16)
+ abort ();
+
+ if (__alignof__ (x32) < 32)
+ abort ();
+
+ if (__alignof__ (x64) < 64)
+ abort ();
+
+ if (__alignof__ (x128) < 128)
+ abort ();
+
+ if (__alignof__ (y128) < 128)
+ abort ();
+
+ if (__alignof__ (z128) < 128)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-align.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-align.c
new file mode 100644
index 000000000..4c0138b5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-align.c
@@ -0,0 +1,47 @@
+/* Prove that pragma alignment handling works somewhat. */
+
+/* { dg-do run { target { ! default_packed } } } */
+
+extern void abort (void);
+
+struct {
+ char one;
+ long two;
+} defaultalign;
+
+#if defined(__LP64__)
+#pragma pack(8)
+#else
+#pragma pack(4)
+#endif
+struct {
+ char one;
+ long two;
+} sixteen;
+
+#pragma pack(1)
+struct {
+ char one;
+ long two;
+} two;
+
+#pragma pack(2)
+struct {
+ char one;
+ long two;
+} three;
+
+#pragma pack()
+struct {
+ char one;
+ long two;
+} resetalign;
+
+main()
+{
+ if(sizeof(sixteen) < sizeof(defaultalign)) abort();
+ if(sizeof(two) >= sizeof(defaultalign)) abort();
+ if(sizeof(three) <= sizeof(two)) abort();
+ if(sizeof(resetalign) != sizeof(defaultalign)) abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-darwin-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-darwin-2.c
new file mode 100644
index 000000000..4bbecef01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-darwin-2.c
@@ -0,0 +1,24 @@
+/* Darwin (Mac OS X) pragma exercises. */
+
+/* { dg-do compile { target *-*-darwin* } } */
+
+/* The mark pragma is valid at any point in the program. Fortunately
+ the compiler only needs to ignore it. It's also followed only
+ by pp-tokens, not necessarily real C tokens. */
+
+void foo(void)
+{
+ if (1) {
+ ;
+ }
+ else if (1) {
+ ;
+ }
+#pragma mark "last case" "hi"
+ else if (1) {
+ ;
+ }
+}
+
+#pragma mark 802.11x 1_2_3
+#pragma mark •••• marker ••••
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-darwin.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-darwin.c
new file mode 100644
index 000000000..f64095b0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-darwin.c
@@ -0,0 +1,70 @@
+/* Darwin (Mac OS X) pragma exercises. */
+
+/* { dg-do run { target *-*-darwin* } } */
+/* { dg-options "-O -Wunused" } */
+
+/* The mark pragma is to help decorate IDEs. */
+
+extern void abort(void);
+
+#pragma mark hey hey ho
+
+/* The options pragma used to do a lot, now it's only for emulating
+ m68k alignment rules in structs. */
+
+#pragma options 23 /* { dg-warning "malformed '#pragma options'" } */
+#pragma options align /* { dg-warning "malformed '#pragma options'" } */
+#pragma options align natural /* { dg-warning "malformed '#pragma options'" } */
+#pragma options align=45 /* { dg-warning "malformed '#pragma options'" } */
+#pragma options align=foo /* { dg-warning "malformed '#pragma options align" } */
+
+#ifndef __LP64__
+#pragma options align=mac68k
+struct s1 { short f1; int f2; };
+#endif
+#pragma options align=power
+struct s2 { short f1; int f2; };
+#ifndef __LP64__
+#pragma options align=mac68k
+struct s3 { short f1; int f2; };
+#endif
+#pragma options align=reset
+struct s4 { short f1; int f2; };
+
+#pragma options align=natural foo /* { dg-warning "junk at end of '#pragma options'" } */
+/* { dg-warning "malformed '#pragma options align={mac68k|power|reset}', ignoring" "ignoring" { target *-*-* } 34 } */
+
+/* Segment pragmas don't do anything anymore. */
+
+#pragma segment foo
+
+int
+main ()
+{
+ int x, z; /* { dg-warning "unused variable 'z'" } */
+ #pragma unused (x, y)
+
+#ifndef __LP64__
+ if (sizeof (struct s1) != 6)
+ abort ();
+#endif
+ if (sizeof (struct s2) != 8)
+ abort ();
+#ifndef __LP64__
+ if (sizeof (struct s3) != 6)
+ abort ();
+#endif
+ if (sizeof (struct s4) != 8)
+ abort ();
+ return 0;
+}
+
+void
+unused_err_test ()
+{
+ int a, b;
+ /* Trying to match on '(' or ')' gives regexp headaches, use . instead. */
+#pragma unused /* { dg-warning "missing '.' after '#pragma unused" } */
+#pragma unused (a /* { dg-warning "missing '.' after '#pragma unused" } */
+#pragma unused (b) foo /* { dg-warning "junk at end of '#pragma unused'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-diag-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-diag-1.c
new file mode 100644
index 000000000..b6d294d9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-diag-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+
+main()
+{
+ int a;
+ int b;
+ int c;
+ int d;
+
+#pragma GCC diagnostic error "-Wuninitialized"
+ foo(a); /* { dg-error "uninitialized" } */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuninitialized"
+ foo(b);
+#pragma GCC diagnostic pop
+ foo(c); /* { dg-error "uninitialized" } */
+#pragma GCC diagnostic pop
+ foo(d); /* { dg-warning "uninitialized" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-diag-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-diag-2.c
new file mode 100644
index 000000000..588d61895
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-diag-2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -pedantic -Wno-long-long" } */
+/* { dg-message "warnings being treated as errors" "" { target *-*-* } 0 } */
+
+int i = 0LL;
+
+#pragma GCC diagnostic error "-Wlong-long"
+
+int j = 1LL; /* { dg-error "long long" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-init-fini-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-init-fini-2.c
new file mode 100644
index 000000000..91bc622a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-init-fini-2.c
@@ -0,0 +1,15 @@
+/* Tests for #pragma init and #pragma fini. */
+
+/* { dg-do link { target *-*-solaris2.* } } */
+/* { dg-options "-fpic" } */
+
+#include <stdio.h>
+
+#pragma fini (f)
+
+void f() {
+ fprintf (stderr, "f\n");
+}
+
+int main () {
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-init-fini.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-init-fini.c
new file mode 100644
index 000000000..4013b8dd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-init-fini.c
@@ -0,0 +1,50 @@
+/* Tests for #pragma init and #pragma fini. */
+
+/* { dg-do run { target *-*-solaris2.* } } */
+
+extern void abort ();
+
+#pragma init /* { dg-warning "malformed" } */
+#pragma init () /* { dg-warning "malformed" } */
+#pragma init init_func /* { dg-warning "malformed" } */
+
+#pragma fini /* { dg-warning "malformed" } */
+#pragma fini () /* { dg-warning "malformed" } */
+#pragma fini fini_func /* { dg-warning "malformed" } */
+
+#pragma init (init_func, init_static_func)
+
+int glob_1, glob_2;
+
+void init_func (void)
+{
+ glob_1 = 1;
+}
+
+static void init_static_func (void)
+{
+ glob_2 = 2;
+}
+
+#pragma fini (fini_func, fini_static_func)
+
+void fini_func (void)
+{
+
+}
+
+static void fini_static_func (void)
+{
+
+}
+
+int main()
+{
+ if (glob_1 != 1)
+ abort ();
+
+ if (glob_2 != 2)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-message.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-message.c
new file mode 100644
index 000000000..0f9c6bf44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-message.c
@@ -0,0 +1,53 @@
+/* Test that #pragma message "..." writes compiler messages. */
+
+#pragma message /* { dg-warning "expected a string" } */
+#pragma message 0 /* { dg-warning "expected a string" } */
+#pragma message id /* { dg-warning "expected a string" } */
+#pragma message ( /* { dg-warning "expected a string" } */
+#pragma message (0 /* { dg-warning "expected a string" } */
+#pragma message (id /* { dg-warning "expected a string" } */
+#pragma message () /* { dg-warning "expected a string" } */
+#pragma message (0) /* { dg-warning "expected a string" } */
+#pragma message (id) /* { dg-warning "expected a string" } */
+
+/* gcc prefixes '#pragma message ...' output with filename and line number,
+ then 'note: #pragma message: ', allowing dg-message to check output.
+ If unexpected pragma messages are printed (anything not caught by a
+ matching dg-message), dejagnu will report these as excess errors. */
+
+#pragma message "
+/* { dg-error "missing terminating" "" { target *-*-* } 18 } */
+/* { dg-warning "expected a string" "" { target *-*-* } 18 } */
+#pragma message "Bad 1
+/* { dg-error "missing terminating" "" { target *-*-* } 21 } */
+/* { dg-warning "expected a string" "" { target *-*-* } 21 } */
+#pragma message ("Bad 2
+/* { dg-error "missing terminating" "" { target *-*-* } 24 } */
+/* { dg-warning "expected a string" "" { target *-*-* } 24 } */
+#pragma message ("Bad 3"
+/* { dg-warning "malformed '#pragma message" "" { target *-*-* } 27 } */
+
+#pragma message "" junk
+/* { dg-warning "junk at end of '#pragma message'" "" { target *-*-* } 30 } */
+
+#pragma message ("") junk
+/* { dg-warning "junk at end of '#pragma message'" "" { target *-*-* } 33 } */
+
+#pragma message "" /* No output expected for empty messages. */
+#pragma message ("")
+
+#pragma message "Okay 1" /* { dg-message "Okay 1" } */
+#pragma message ("Okay 2") /* { dg-message "Okay 2" } */
+#define THREE "3"
+#pragma message ("Okay " THREE) /* { dg-message "Okay 3" } */
+
+/* Create a TODO() that prints a message on compilation. */
+#define DO_PRAGMA(x) _Pragma (#x)
+#define TODO(x) DO_PRAGMA(message ("TODO - " #x))
+TODO(Okay 4) /* { dg-message "TODO - Okay 4" } */
+
+#if 0
+#pragma message ("Not printed")
+#endif
+
+int unused; /* Silence `ISO C forbids an empty translation unit' warning. */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-ms_struct.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-ms_struct.c
new file mode 100644
index 000000000..cc7161014
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-ms_struct.c
@@ -0,0 +1,21 @@
+/* Darwin pragma for __attribute__ ((ms_struct)). */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-Wall" } */
+
+#pragma ms_struct on
+
+#pragma ms_struct off
+
+#pragma ms_struct reset
+
+#pragma ms_struct /* { dg-warning "malformed" } */
+
+#pragma ms_struct on top of spaghetti /* { dg-warning "junk" } */
+
+struct foo
+{
+ int a;
+ int b;
+ char c;
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-2.c
new file mode 100644
index 000000000..f44f8dbba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-2.c
@@ -0,0 +1,48 @@
+/* On Solaris, #pragma pack should accept macro expansion. */
+
+/* { dg-do run { target *-*-solaris2.* } } */
+
+extern void abort (void);
+
+struct {
+ char one;
+ long two;
+} defaultalign;
+
+#define ALIGNHIGH 16
+
+#pragma pack(ALIGNHIGH)
+struct {
+ char one;
+ long two;
+} sixteen;
+
+#define ALIGN1(X) 1
+#pragma pack(ALIGN1(4))
+struct {
+ char one;
+ long two;
+} two;
+
+#define ALIGN2(X) X
+#pragma pack(ALIGN2(2))
+struct {
+ char one;
+ long two;
+} three;
+
+#define EMPTY
+#pragma pack(EMPTY)
+struct {
+ char one;
+ long two;
+} resetalign;
+
+main()
+{
+ if(sizeof(sixteen) < sizeof(defaultalign)) abort();
+ if(sizeof(two) >= sizeof(defaultalign)) abort();
+ if(sizeof(three) <= sizeof(two)) abort();
+ if(sizeof(resetalign) != sizeof(defaultalign)) abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-3.c
new file mode 100644
index 000000000..d38431491
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-3.c
@@ -0,0 +1,28 @@
+/* PR c++/25294 */
+/* { dg-options "-std=gnu99" } */
+/* Epiphany makes struct S 8-byte aligned. */
+/* { dg-do run { target { ! epiphany-*-* } } } */
+
+extern void abort (void);
+
+struct S
+{
+ char a[3];
+#pragma pack(1) /* A block comment
+ that ends on the next line. */
+ struct T
+ {
+ char b;
+ int c;
+ } d;
+#pragma pack /*/ */ () // C++ comment
+ int e;
+} s;
+
+int
+main ()
+{
+ if (sizeof (int) == 4 && sizeof (s) != 12)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-4.c
new file mode 100644
index 000000000..c2ea59e9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-4.c
@@ -0,0 +1,7 @@
+/* PR c/28286 */
+/* { dg-do compile } */
+
+
+#pragma pack(0.5) /* { dg-warning "invalid constant" } */
+#pragma pack(push,0.5) /* { dg-warning "invalid constant" } */
+#pragma pack(push,x,0.5) /* { dg-warning "invalid constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-5.c
new file mode 100644
index 000000000..897686f77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-pack-5.c
@@ -0,0 +1,10 @@
+/* Check that pragma pack overrides STRUCTURE_SIZE_BOUNDARY. */
+/* { dg-do compile } */
+
+#pragma pack(1)
+struct S
+{
+ char a;
+};
+
+int test[sizeof(struct S) == 1 ? 1: -1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-push_macro-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-push_macro-1.c
new file mode 100644
index 000000000..ac5d059b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-push_macro-1.c
@@ -0,0 +1,26 @@
+/* Prove that HANDLE_PRAGMA_PUSH_POP_MACRO handling works somewhat. */
+
+/* { dg-do link { target *-*-mingw* } } */
+
+#define TEXT1 "ABC"
+#define TEXT2 "DEF"
+
+int main()
+{
+ if (__builtin_strcmp (TEXT1 TEXT2, "ABCDEF") != 0)
+ link_error ();
+
+#pragma push_macro("TEXT1")
+#undef TEXT1
+#define TEXT1 "XYZ"
+
+ if (__builtin_strcmp (TEXT1 TEXT2, "XYZDEF") != 0)
+ link_error ();
+
+#pragma pop_macro("TEXT1")
+
+ if (__builtin_strcmp (TEXT1 TEXT2, "ABCDEF") != 0)
+ link_error ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-1.c
new file mode 100644
index 000000000..78312e570
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-1.c
@@ -0,0 +1,10 @@
+/* { dg-final { scan-assembler "bar" } } */
+/* { dg-final { scan-assembler-not "foo" } } */
+
+#ifndef __PRAGMA_REDEFINE_EXTNAME
+#error
+#endif
+
+#pragma redefine_extname foo bar
+extern int foo(void);
+int (*p)(void) = foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-2.c
new file mode 100644
index 000000000..ee7140133
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-2.c
@@ -0,0 +1,7 @@
+
+#pragma redefine_extname /* { dg-warning "malformed" } */
+#pragma redefine_extname foo /* { dg-warning "malformed" } */
+#pragma redefine_extname foo 1 /* { dg-warning "malformed" } */
+#pragma redefine_extname foo bar 2 /* { dg-warning "junk" } */
+
+int bar; /* silence `ISO C forbids an empty translation unit' warning */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-3.c
new file mode 100644
index 000000000..3885fe8f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-3.c
@@ -0,0 +1,17 @@
+
+#pragma redefine_extname f1 f
+#pragma redefine_extname g1 g
+
+void f() {
+ extern int f1();
+ f1();
+}
+
+void g() {
+ g1();
+}
+
+int main () {
+ f();
+ g();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-4.c
new file mode 100644
index 000000000..627e0b6e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pragma-re-4.c
@@ -0,0 +1,17 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc. */
+/* Contributed by Carlos O'Donell on 2006-01-27 */
+
+/* Origin: Carlos O'Donell <carlos@codesourcery.com> */
+/* { dg-final { scan-assembler "_foo" } } */
+/* { dg-final { scan-assembler-not "_foo64" } } */
+
+#define foo _foo
+#define foo64 _foo64
+extern int foo(void);
+extern int foo64(void);
+#pragma redefine_extname foo64 foo
+int
+bar()
+{
+ return (foo64());
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/precedence-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/precedence-1.c
new file mode 100644
index 000000000..f3f1e3527
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/precedence-1.c
@@ -0,0 +1,153 @@
+/* Test precedence and associativity in expressions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s { int *a; } *p, q, *r[2], *g();
+int *i[2];
+int j[2];
+_Complex double c[2];
+
+void
+f (void)
+{
+#define ASSERT(expr) do { char x[(expr) ? 1 : -1]; } while (0)
+ /* Postfix and unary operators and casts. */
+ *p++;
+ *p--;
+ *p->a;
+ *q.a;
+ *r[1];
+ (*g()).a;
+ ++i[0];
+ --i[0];
+ +j[0];
+ -j[0];
+ ~j[0];
+ !j[0];
+ __real__ c[1];
+ __imag__ c[1];
+ ASSERT ((sizeof p++) == (sizeof p));
+ ASSERT ((sizeof (int) + 1) == ((sizeof (int)) + 1));
+ ASSERT ((__alignof p++) == (__alignof p));
+ ASSERT ((__alignof (int) + 1) == ((__alignof (int)) + 1));
+ ASSERT ((sizeof __extension__ 1 + 1) == ((sizeof 1) + 1));
+ /* Binary operators. */
+ ASSERT (((_Bool) 1 * 2) == 2);
+ ASSERT (((_Bool) 8 / 4) == 0);
+ ASSERT (((_Bool) 8 % 4) == 1);
+#define ASSERT_BIN(C1, O1, C2, O2, C3, V1, V2, V3) \
+ do { \
+ ASSERT ((C1 O1 C2 O2 C3) == V1); \
+ ASSERT (((C1 O1 C2) O2 C3) == V2); \
+ ASSERT ((C1 O1 (C2 O2 C3)) == V3); \
+ } while (0);
+ ASSERT_BIN (1, *, 2, *, 3, 6, 6, 6);
+ ASSERT_BIN (2, *, 2, /, 3, 1, 1, 0);
+ ASSERT_BIN (2, *, 2, %, 3, 1, 1, 4);
+ ASSERT_BIN (2, /, 2, *, 3, 3, 3, 0);
+ ASSERT_BIN (2, /, 2, /, 2, 0, 0, 2);
+ ASSERT_BIN (2, /, 4, %, 3, 0, 0, 2);
+ ASSERT_BIN (2, %, 2, *, 3, 0, 0, 2);
+ ASSERT_BIN (2, %, 9, /, 3, 0, 0, 2);
+ ASSERT_BIN (2, %, 4, %, 3, 2, 2, 0);
+ ASSERT_BIN (2, *, 3, +, 4, 10, 10, 14);
+ ASSERT_BIN (2, *, 3, -, 4, 2, 2, -2);
+ ASSERT_BIN (2, /, 3, +, 4, 4, 4, 0);
+ ASSERT_BIN (2, /, 3, -, 4, -4, -4, -2);
+ ASSERT_BIN (2, %, 3, +, 4, 6, 6, 2);
+ ASSERT_BIN (2, %, 3, -, 4, -2, -2, 0);
+ ASSERT_BIN (2, +, 3, *, 4, 14, 20, 14);
+ ASSERT_BIN (2, +, 3, /, 4, 2, 1, 2);
+ ASSERT_BIN (2, +, 3, %, 4, 5, 1, 5);
+ ASSERT_BIN (2, -, 3, *, 4, -10, -4, -10);
+ ASSERT_BIN (2, -, 3, /, 4, 2, 0, 2);
+ ASSERT_BIN (2, -, 4, %, 4, 2, -2, 2);
+ ASSERT_BIN (2, +, 3, +, 4, 9, 9, 9);
+ ASSERT_BIN (2, +, 3, -, 4, 1, 1, 1);
+ ASSERT_BIN (2, -, 3, +, 4, 3, 3, -5);
+ ASSERT_BIN (2, -, 3, -, 4, -5, -5, 3);
+ ASSERT_BIN (3, +, 2, <<, 4, 80, 80, 35);
+ ASSERT_BIN (3, +, 2, >>, 4, 0, 0, 3);
+ ASSERT_BIN (3, -, 2, <<, 4, 16, 16, -29);
+ ASSERT_BIN (3, -, 2, >>, 4, 0, 0, 3);
+ ASSERT_BIN (2, <<, 4, +, 3, 256, 35, 256);
+ ASSERT_BIN (2, <<, 4, -, 3, 4, 29, 4);
+ ASSERT_BIN (2, >>, 4, +, 3, 0, 3, 0);
+ ASSERT_BIN (2, >>, 4, -, 3, 1, -3, 1);
+ ASSERT_BIN (4L, <<, 2L, <<, 3L, 128L, 128L, 262144L);
+ ASSERT_BIN (4L, <<, 2L, >>, 3L, 2L, 2L, 4L);
+ ASSERT_BIN (4L, >>, 2L, <<, 3L, 8L, 8L, 0L);
+ ASSERT_BIN (4L, >>, 2L, >>, 3L, 0L, 0L, 4L);
+ ASSERT_BIN (2, <<, 5, <, 4, 0, 0, 2);
+ ASSERT_BIN (2, <<, 5, >, 4, 1, 1, 4);
+ ASSERT_BIN (2, <<, 5, <=, 4, 0, 0, 2);
+ ASSERT_BIN (2, <<, 5, >=, 4, 1, 1, 4);
+ ASSERT_BIN (2, >>, 5, <, 4, 1, 1, 2);
+ ASSERT_BIN (2, >>, 5, >, 4, 0, 0, 1);
+ ASSERT_BIN (2, >>, 5, <=, 4, 1, 1, 2);
+ ASSERT_BIN (2, >>, 5, >=, 4, 0, 0, 1);
+ ASSERT_BIN (4, <, 3, <<, 2, 1, 0, 1);
+ ASSERT_BIN (4, <, 20, >>, 2, 1, 0, 1);
+ ASSERT_BIN (4, >, 3, <<, 2, 0, 4, 0);
+ ASSERT_BIN (4, >, 3, >>, 2, 1, 0, 1);
+ ASSERT_BIN (4, <=, 3, <<, 2, 1, 0, 1);
+ ASSERT_BIN (4, <=, 20, >>, 2, 1, 0, 1);
+ ASSERT_BIN (4, >=, 3, <<, 2, 0, 4, 0);
+ ASSERT_BIN (4, >=, 3, >>, 2, 1, 0, 1);
+ ASSERT_BIN (1, <, 2, <, 3, 1, 1, 0);
+ ASSERT_BIN (1, <, 2, >, 0, 1, 1, 0);
+ ASSERT_BIN (1, <, 2, <=, 3, 1, 1, 0);
+ ASSERT_BIN (0, <, 4, >=, 3, 0, 0, 1);
+ ASSERT_BIN (1, >, 2, <, 3, 1, 1, 0);
+ ASSERT_BIN (1, >, 2, >, 3, 0, 0, 1);
+ ASSERT_BIN (1, >, 2, <=, 3, 1, 1, 0);
+ ASSERT_BIN (1, >, 2, >=, 3, 0, 0, 1);
+ ASSERT_BIN (3, <=, 2, <, 3, 1, 1, 0);
+ ASSERT_BIN (2, <=, 3, >, 0, 1, 1, 0);
+ ASSERT_BIN (2, <=, 3, <=, 4, 1, 1, 0);
+ ASSERT_BIN (2, <=, 3, >=, 1, 1, 1, 0);
+ ASSERT_BIN (0, >=, 2, <, 3, 1, 1, 0);
+ ASSERT_BIN (1, >=, 2, >, 3, 0, 0, 1);
+ ASSERT_BIN (0, >=, 2, <=, 3, 1, 1, 0);
+ ASSERT_BIN (1, >=, 2, >=, 3, 0, 0, 1);
+ ASSERT_BIN (-1, <, 2, ==, 3, 0, 0, 1);
+ ASSERT_BIN (1, <, 2, !=, 3, 1, 1, 0);
+ ASSERT_BIN (1, >, 2, ==, 3, 0, 0, 1);
+ ASSERT_BIN (1, >, 2, !=, 3, 1, 1, 0);
+ ASSERT_BIN (0, <=, 2, ==, 3, 0, 0, 1);
+ ASSERT_BIN (2, <=, 2, !=, 3, 1, 1, 0);
+ ASSERT_BIN (1, >=, 2, ==, 3, 0, 0, 1);
+ ASSERT_BIN (0, >=, 2, !=, 3, 1, 1, 0);
+ ASSERT_BIN (1, ==, 3, <, 2, 0, 1, 0);
+ ASSERT_BIN (1, ==, 3, >, 2, 1, 0, 1);
+ ASSERT_BIN (1, ==, 3, <=, 2, 0, 1, 0);
+ ASSERT_BIN (1, ==, 3, >=, 2, 1, 0, 1);
+ ASSERT_BIN (1, !=, 2, <, 3, 0, 1, 0);
+ ASSERT_BIN (1, !=, 2, >, 3, 1, 0, 1);
+ ASSERT_BIN (1, !=, 2, <=, 3, 0, 1, 0);
+ ASSERT_BIN (1, !=, 2, >=, 3, 1, 0, 1);
+ ASSERT_BIN (1, ==, 2, ==, 0, 1, 1, 0);
+ ASSERT_BIN (1, ==, 2, !=, 0, 0, 0, 1);
+ ASSERT_BIN (1, !=, 2, ==, 3, 0, 0, 1);
+ ASSERT_BIN (1, !=, 2, !=, 3, 1, 1, 0);
+ ASSERT_BIN (0, ==, 2, &, 1, 0, 0, 1);
+ ASSERT_BIN (0, !=, 2, &, 1, 1, 1, 0);
+ ASSERT_BIN (1, &, 2, ==, 0, 0, 1, 0);
+ ASSERT_BIN (1, &, 2, !=, 0, 1, 0, 1);
+ ASSERT_BIN (1, &, 2, ^, 3, 3, 3, 1);
+ ASSERT_BIN (3, ^, 2, &, 1, 3, 1, 3);
+ ASSERT_BIN (3, ^, 2, |, 1, 1, 1, 0);
+ ASSERT_BIN (3, |, 2, ^, 1, 3, 2, 3);
+ ASSERT_BIN (2, |, 0, &&, 2, 1, 1, 2);
+ ASSERT_BIN (2, &&, 0, |, 2, 1, 2, 1);
+ ASSERT_BIN (0, &&, 0, ||, 1, 1, 1, 0);
+ ASSERT_BIN (1, ||, 0, &&, 0, 1, 0, 1);
+ /* Conditional expressions. */
+ ASSERT ((1 || 2 ? 3 : 4) == 3);
+ ASSERT ((1 || (2 ? 3 : 4)) == 1);
+ /* Assignment expressions. */
+ p = p = p;
+ /* Expressions. */
+ p, p = p;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/predict-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/predict-1.c
new file mode 100644
index 000000000..5c9a5a930
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/predict-1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+
+extern int global;
+
+int bar(int);
+
+void foo (int bound)
+{
+ int i, ret = 0;
+ for (i = 0; i < bound; i++)
+ {
+ if (i > bound)
+ global += bar (i);
+ if (i >= bound + 2)
+ global += bar (i);
+ if (i > bound - 2)
+ global += bar (i);
+ if (i + 2 > bound)
+ global += bar (i);
+ if (i == 10)
+ global += bar (i);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 5 "profile_estimate"} } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/predict-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/predict-2.c
new file mode 100644
index 000000000..55ca1d0bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/predict-2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+
+extern int global;
+
+int bar(int);
+
+void foo (int base, int bound)
+{
+ int i, ret = 0;
+ for (i = base; i < bound; i++)
+ {
+ if (i > bound * bound)
+ global += bar (i);
+ if (i > bound + 10)
+ global += bar (i);
+ if (i <= bound + 10)
+ global += bar (i);
+ if (i > base + 10)
+ global += bar (i);
+ if (i < base - 10)
+ global += bar (i);
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "loop iv compare heuristics" "profile_estimate"} } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/predict-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/predict-3.c
new file mode 100644
index 000000000..8881bde30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/predict-3.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+
+extern int global;
+
+int bar(int);
+
+void foo (int bound)
+{
+ int i, ret = 0;
+ for (i = 0; i <= bound; i++)
+ {
+ if (i < bound - 2)
+ global += bar (i);
+ if (i <= bound)
+ global += bar (i);
+ if (i + 1 < bound)
+ global += bar (i);
+ if (i != bound)
+ global += bar (i);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/predict-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/predict-4.c
new file mode 100644
index 000000000..17a50b9ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/predict-4.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+
+extern int global;
+
+int bar(int);
+
+void foo (int bound)
+{
+ int i, ret = 0;
+ for (i = 0; i < 10; i++)
+ {
+ if (i < 5)
+ global += bar (i);
+ }
+}
+
+/* { dg-final { scan-tree-dump "loop iv compare heuristics: 50.0%" "profile_estimate"} } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/predict-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/predict-5.c
new file mode 100644
index 000000000..f2fe339b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/predict-5.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+
+extern int global;
+
+int bar (int);
+
+void foo (int base, int bound)
+{
+ int i, ret = 0;
+ for (i = base; i <= bound; i++)
+ {
+ if (i > base)
+ global += bar (i);
+ if (i > base + 1)
+ global += bar (i);
+ if (i >= base + 3)
+ global += bar (i);
+ if (i - 2 >= base)
+ global += bar (i);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/predict-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/predict-6.c
new file mode 100644
index 000000000..bf769fd2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/predict-6.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+
+extern int global;
+
+int bar (int);
+
+void foo (int base, int bound)
+{
+ int i, ret = 0;
+ for (i = base; i <= bound; i++)
+ {
+ if (i < base)
+ global += bar (i);
+ if (i < base + 1)
+ global += bar (i);
+ if (i <= base + 3)
+ global += bar (i);
+ if (i - 1 < base)
+ global += bar (i);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 4 "profile_estimate"} } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/predict-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/predict-7.c
new file mode 100644
index 000000000..2c1c36f78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/predict-7.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+
+extern int global;
+
+int bar (int);
+
+void foo (int base)
+{
+ int i;
+ while (global < 10)
+ for (i = base; i < 10; i++)
+ bar (i);
+}
+
+/* { dg-final { scan-tree-dump-times "loop branch heuristics" 0 "profile_estimate"} } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/prefetch-loop-arrays-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/prefetch-loop-arrays-1.c
new file mode 100644
index 000000000..024cc1af5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/prefetch-loop-arrays-1.c
@@ -0,0 +1,36 @@
+/* PR tree-optimization/28887 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=i686 -msse -w" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+struct re_pattern_buffer
+{
+ size_t re_nsub;
+};
+
+typedef enum
+{
+ start_memory,
+} re_opcode_t;
+
+typedef union
+{
+ struct
+ {
+ unsigned matched_something:1;
+ } bits;
+} byte_register_info_type;
+
+void byte_re_match_2_internal (struct re_pattern_buffer *bufp)
+{
+ int mcnt;
+ size_t num_regs = bufp->re_nsub + 1;
+ byte_register_info_type *reg_info;
+ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
+ {
+ ((reg_info[mcnt]).bits.matched_something) = 0;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-1.c
new file mode 100644
index 000000000..6cf5391bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O -fprofile-generate=. -fdump-ipa-cgraph" } */
+/* { dg-final { scan-ipa-dump " ./profile-dir-1.gcda" "cgraph" } } */
+
+int
+main(void)
+{
+ return 0;
+}
+
+/* { dg-final { cleanup-ipa-dump "cgraph" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-2.c
new file mode 100644
index 000000000..0d8624e18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O -fprofile-generate -fdump-ipa-cgraph" } */
+/* { dg-final { scan-ipa-dump "/profile-dir-2.gcda" "cgraph" } } */
+
+int
+main(void)
+{
+ return 0;
+}
+
+/* { dg-final { cleanup-ipa-dump "cgraph" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-3.c
new file mode 100644
index 000000000..dac0e4a6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/profile-dir-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O -fprofile-generate -fprofile-dir=. -fdump-ipa-cgraph" } */
+/* { dg-final { scan-ipa-dump " ./profile-dir-3.gcda" "cgraph" } } */
+
+int
+main(void)
+{
+ return 0;
+}
+
+/* { dg-final { cleanup-ipa-dump "cgraph" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-1.c
new file mode 100644
index 000000000..ed49df921
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-1.c
@@ -0,0 +1,38 @@
+/* Bug 16325. */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-O -fprofile-generate" } */
+
+extern void abort (void);
+
+int *p1;
+int *p2;
+int *p3;
+
+int ga = 100;
+
+int
+sub (int i, int j)
+{
+ int k;
+ int l;
+ int m;
+ int n;
+ p1 = &k;
+ p2 = &l;
+ p3 = &m;
+ k = 20;
+ l = 30;
+ m = 40;
+ n = i / j;
+ return n + ga;
+}
+
+int
+main(void)
+{
+ if (sub (99, 33) != 103)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-coverage-files } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-2.c
new file mode 100644
index 000000000..eaea065f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-2.c
@@ -0,0 +1,35 @@
+/* PR middle-end/23199 */
+/* Testcase by Ralf Menzel <menzel@ls6.cs.uni-dortmund.de> */
+
+/* { dg-do compile } */
+/* { dg-options "-O -fprofile-generate" } */
+
+union rtunion_def
+{
+ struct rtx_def *rt_rtx;
+};
+
+typedef union rtunion_def rtunion;
+
+struct rtx_def
+{
+ unsigned int in_struct : 1;
+ union u {
+ rtunion fld[1];
+ } u;
+};
+
+typedef struct rtx_def *rtx;
+
+static void
+check_annul_list_true_false (int annul_true_p, rtx delay_list)
+{
+ rtx temp;
+ while (1)
+ {
+ temp = delay_list;
+ rtx trial = (((temp)->u.fld[0]).rt_rtx);
+ if ((annul_true_p && (((trial))->in_struct)))
+ return;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-3.c
new file mode 100644
index 000000000..212ddee33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/profile-generate-3.c
@@ -0,0 +1,10 @@
+/* { dg-do link } */
+/* { dg-require-profiling "-fprofile-generate" } */
+/* { dg-options "-fprofile-generate=." } */
+
+int
+main ()
+{
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/proto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/proto-1.c
new file mode 100644
index 000000000..62d0209b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/proto-1.c
@@ -0,0 +1,5 @@
+/* PR c/28502 */
+/* { dg-do compile } */
+
+void foo() {} /* { dg-message "note: previous" } */
+void foo(void[]); /* { dg-error "array of voids" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-1.c
new file mode 100644
index 000000000..8b600c3fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-1.c
@@ -0,0 +1,15 @@
+/* Ensure we get clean warning results when using the pthread
+ * initialization macros.
+ *
+ * Origin: Kaveh Ghazi (ghazi@caip.rutgers.edu) 9/27/2006.
+ */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread_h } */
+/* { dg-options "-Wextra -Wall" } */
+/* The RTP definition of PTHREAD_MUTEX_INITIALIZER is missing an
+ * initializer for mutexAttr.mutexAttrType. */
+/* { dg-xfail-if "missing initializer" { vxworks_rtp } } */
+
+#include "pthread-init-common.h"
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-2.c
new file mode 100644
index 000000000..8ec0515ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-2.c
@@ -0,0 +1,14 @@
+/* Various Solaris versions have been known to have problems with the
+ * pthread initialization macros when __STDC__ is defined.
+ *
+ * Origin: Kaveh Ghazi (ghazi@caip.rutgers.edu) 9/27/2006.
+ */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread_h } */
+/* { dg-options "-Wextra -Wall -ansi" } */
+/* { dg-options "-Wextra -Wall -ansi -D_POSIX_C_SOURCE=199506L" { target { *-*-hpux* } } } */
+/* { dg-options "-Wextra -Wall -ansi -D_XOPEN_SOURCE=500" { target { powerpc-ibm-aix* } } } */
+
+#include "pthread-init-common.h"
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-common.h b/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-common.h
new file mode 100644
index 000000000..723d997c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pthread-init-common.h
@@ -0,0 +1,39 @@
+/*
+ * Common code for the pthread-init-*.c tests.
+ *
+ * Origin: Kaveh Ghazi (ghazi@caip.rutgers.edu) 9/27/2006.
+ */
+
+#define _GNU_SOURCE
+
+#include <pthread.h>
+#define UNUSED __attribute__ ((__unused__))
+
+void foo(void)
+{
+#ifdef PTHREAD_MUTEX_INITIALIZER
+ pthread_mutex_t pmutex UNUSED = PTHREAD_MUTEX_INITIALIZER;
+#endif
+#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+ pthread_mutex_t pmutex_rc UNUSED = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+#endif
+#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+ pthread_mutex_t pmutex_ec UNUSED = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+#endif
+#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+ pthread_mutex_t pmutex_ad UNUSED = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
+#endif
+#ifdef PTHREAD_COND_INITIALIZER
+ pthread_cond_t pcond UNUSED = PTHREAD_COND_INITIALIZER;
+#endif
+#ifdef PTHREAD_RWLOCK_INITIALIZER
+ pthread_rwlock_t prwlock UNUSED = PTHREAD_RWLOCK_INITIALIZER;
+#endif
+#ifdef PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+ pthread_rwlock_t prwlock_nrc UNUSED
+ = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP;
+#endif
+#ifdef PTHREAD_ONCE_INIT
+ pthread_once_t ponce UNUSED = PTHREAD_ONCE_INIT;
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-1.c
new file mode 100644
index 000000000..3f09646c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-1.c
@@ -0,0 +1,47 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-O0 -gdwarf-2 -dA -fno-eliminate-unused-debug-types" } */
+/* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */
+/* { dg-final { scan-assembler "__debug_pubtypes" } } */
+/* { dg-final { scan-assembler "long+\[ \t\]+0x\[0-9a-f]+\[ \t\]+\[#;]+\[ \t\]+Pub Info Length" } } */
+/* { dg-final { scan-assembler "used_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+/* { dg-final { scan-assembler "unused_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+struct used_struct
+{
+ int key;
+ char *name;
+};
+
+struct unused_struct
+{
+ int key1;
+ int f2;
+ double f3;
+ char *f4;
+ struct unused_struct *next;
+};
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ struct used_struct *my_list;
+
+ my_list = (struct used_struct *) malloc (10 * sizeof (struct used_struct));
+
+ for (i = 0; i < 10; i++)
+ {
+ my_list[i].key = i;
+ my_list[i].name = (char *) malloc (11);
+ sprintf (my_list[i].name, "Alice_%d", i);
+ }
+
+ for (i = 0; i < 10; i++)
+ fprintf (stdout, "Key: %d, Name: %s\n", my_list[i].key, my_list[i].name);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-2.c
new file mode 100644
index 000000000..b4ba8712c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-2.c
@@ -0,0 +1,46 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+/* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */
+/* { dg-final { scan-assembler "__debug_pubtypes" } } */
+/* { dg-final { scan-assembler "long+\[ \t\]+0x13b+\[ \t\]+\[#;]+\[ \t\]+Pub Info Length" } } */
+/* { dg-final { scan-assembler "used_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+/* { dg-final { scan-assembler-not "unused_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+struct used_struct
+{
+ int key;
+ char *name;
+};
+
+struct unused_struct
+{
+ int key1;
+ int f2;
+ double f3;
+ char *f4;
+ struct unused_struct *next;
+};
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ struct used_struct *my_list;
+
+ my_list = (struct used_struct *) malloc (10 * sizeof (struct used_struct));
+
+ for (i = 0; i < 10; i++)
+ {
+ my_list[i].key = i;
+ my_list[i].name = (char *) malloc (11);
+ sprintf (my_list[i].name, "Alice_%d", i);
+ }
+
+ for (i = 0; i < 10; i++)
+ fprintf (stdout, "Key: %d, Name: %s\n", my_list[i].key, my_list[i].name);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-3.c
new file mode 100644
index 000000000..f4b0468ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-3.c
@@ -0,0 +1,83 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+/* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */
+/* { dg-final { scan-assembler "__debug_pubtypes" } } */
+/* { dg-final { scan-assembler "long+\[ \t\]+0x13b+\[ \t\]+\[#;]+\[ \t\]+Pub Info Length" } } */
+/* { dg-final { scan-assembler "used_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+/* { dg-final { scan-assembler-not "unused_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+/* { dg-final { scan-assembler-not "\"list_name_type\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+struct used_struct
+{
+ int key;
+ char *name;
+};
+
+struct unused_struct
+{
+ int key1;
+ int f2;
+ double f3;
+ char *f4;
+ struct unused_struct *next;
+};
+
+void
+foo (struct used_struct *list)
+{
+ enum list_name_type {
+ boy_name,
+ girl_name,
+ unknown
+ };
+
+ int b_count = 0;
+ int g_count = 0;
+ int i;
+ enum list_name_type *enum_list;
+
+ enum_list = (enum list_name_type *) malloc (10 * sizeof (enum list_name_type));
+
+ for (i = 0; i < 10; i++)
+ {
+ if (strncmp (list[i].name, "Alice", 5) == 0)
+ {
+ enum_list[i] = girl_name;
+ g_count++;
+ }
+ else if (strncmp (list[i].name, "David", 5) == 0)
+ {
+ enum_list[i] = boy_name;
+ b_count++;
+ }
+ else
+ enum_list[i] = unknown;
+ }
+
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ struct used_struct *my_list;
+
+ my_list = (struct used_struct *) malloc (10 * sizeof (struct used_struct));
+
+ for (i = 0; i < 10; i++)
+ {
+ my_list[i].key = i;
+ my_list[i].name = (char *) malloc (11);
+ sprintf (my_list[i].name, "Alice_%d", i);
+ }
+
+ foo (my_list);
+
+ for (i = 0; i < 10; i++)
+ fprintf (stdout, "Key: %d, Name: %s\n", my_list[i].key, my_list[i].name);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-4.c
new file mode 100644
index 000000000..76d7c4a98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pubtypes-4.c
@@ -0,0 +1,96 @@
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-O0 -gdwarf-2 -dA" } */
+/* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */
+/* { dg-final { scan-assembler "__debug_pubtypes" } } */
+/* { dg-final { scan-assembler "long+\[ \t\]+0x172+\[ \t\]+\[#;]+\[ \t\]+Pub Info Length" } } */
+/* { dg-final { scan-assembler "used_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+/* { dg-final { scan-assembler-not "unused_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+/* { dg-final { scan-assembler "\"list_name_type\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+/* { dg-final { scan-assembler "\"enum_list_array\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+/* { dg-final { scan-assembler "\"field_union\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+struct used_struct
+{
+ int key;
+ char *name;
+ union field_union
+ {
+ char u_c;
+ int u_i;
+ long u_l;
+ double u_d;
+ } u;
+};
+
+struct unused_struct
+{
+ int key1;
+ int f2;
+ double f3;
+ char *f4;
+ struct unused_struct *next;
+};
+
+enum list_name_type {
+ boy_name,
+ girl_name,
+ unknown
+};
+
+
+typedef enum list_name_type *enum_list_array;
+
+enum_list_array enum_list;
+
+void
+foo (struct used_struct *list)
+{
+ int b_count = 0;
+ int g_count = 0;
+ int i;
+
+ enum_list = (enum_list_array) malloc (10 * sizeof (enum list_name_type));
+
+ for (i = 0; i < 10; i++)
+ {
+ if (strncmp (list[i].name, "Alice", 5) == 0)
+ {
+ enum_list[i] = girl_name;
+ g_count++;
+ }
+ else if (strncmp (list[i].name, "David", 5) == 0)
+ {
+ enum_list[i] = boy_name;
+ b_count++;
+ }
+ else
+ enum_list[i] = unknown;
+ }
+
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ struct used_struct *my_list;
+
+ my_list = (struct used_struct *) malloc (10 * sizeof (struct used_struct));
+
+ for (i = 0; i < 10; i++)
+ {
+ my_list[i].key = i;
+ my_list[i].name = (char *) malloc (11);
+ sprintf (my_list[i].name, "Alice_%d", i);
+ }
+
+ foo (my_list);
+
+ for (i = 0; i < 10; i++)
+ fprintf (stdout, "Key: %d, Name: %s\n", my_list[i].key, my_list[i].name);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pure-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pure-1.c
new file mode 100644
index 000000000..f365c8dae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pure-1.c
@@ -0,0 +1,16 @@
+/* Regression test for PR middle-end/23584 */
+/* Verify that dereferencing a volatile element in a struct causes
+ the function not be pure. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-ipa-pure-const" } */
+
+struct test_a { volatile int a; };
+
+int func_a(struct test_a *a)
+{
+ return a->a;
+}
+
+/* { dg-final { scan-ipa-dump-not "found to be pure: func_a" "pure-const" } } */
+/* { dg-final { cleanup-ipa-dump "pure-const" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pure-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/pure-2.c
new file mode 100644
index 000000000..8c2ba56cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/pure-2.c
@@ -0,0 +1,57 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wsuggest-attribute=pure" } */
+
+extern int extern_const(int a) __attribute__ ((pure));
+extern int v;
+
+/* Trivial. */
+int
+foo1(int a) /* { dg-bogus "normally" "detect pure candidate" } */
+{ /* { dg-warning "pure" "detect pure candidate" { target *-*-* } "9" } */
+ return v;
+}
+
+/* Loops known to be normally and extern const calls should be safe. */
+int __attribute__ ((noinline))
+foo2(int n) /* { dg-bogus "normally" "detect pure candidate" } */
+{ /* { dg-warning "pure" "detect pure candidate" { target *-*-* } "16" } */
+ int ret = 0;
+ int i;
+ for (i=0; i<n; i++)
+ ret+=extern_const (i);
+ return ret;
+}
+
+/* No warning here; we can work it by ourselves. */
+static int __attribute__ ((noinline))
+foo2b(int n)
+{
+ int ret = 0;
+ int i;
+ for (i=0; i<n; i++)
+ ret+=extern_const (i);
+ return ret;
+}
+
+/* Unbounded loops are not safe. */
+static int __attribute__ ((noinline))
+foo3(unsigned int n) /* { dg-warning "pure\[^\n\]* normally" "detect pure candidate" } */
+{
+ int ret = 0;
+ unsigned int i;
+ for (i=0; extern_const (i+n); n++)
+ ret+=extern_const (i);
+ return ret;
+}
+
+int
+foo4(int n) /* { dg-warning "pure\[^\n\]* normally" "detect pure candidate" } */
+{
+ return foo3(n) + foo2b(n);
+}
+
+int
+foo5(int n) /* { dg-bogus "normally" "detect pure candidate" } */
+{ /* { dg-warning "pure" "detect pure candidate" { target *-*-* } "54" } */
+ return foo2(n);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/qual-component-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/qual-component-1.c
new file mode 100644
index 000000000..dedc63f39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/qual-component-1.c
@@ -0,0 +1,232 @@
+/* Test qualification of components of qualified structures or unions:
+ should have qualifiers from both the component and the structure or
+ union. Bug 27697 from Frank Victor Fischer. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s {
+ int a;
+ int b[1];
+ int c[2][3];
+ const int d;
+ const int e[1];
+ const int f[2][3];
+};
+
+union u {
+ int a;
+ int b[1];
+ int c[2][3];
+ const int d;
+ const int e[1];
+ const int f[2][3];
+};
+
+struct cs {
+ const struct s x;
+};
+
+struct s v1;
+union u *v2;
+const struct s *v3;
+const union u v4;
+struct cs v5;
+
+void
+f (void)
+{
+ v1.a = 0;
+ v1.b[0] = 0;
+ *v1.b = 0;
+ v1.c[0][0] = 0;
+ *v1.c[0] = 0;
+ **v1.c = 0;
+ v1.d = 0; /* { dg-error "assignment of read-only" } */
+ v1.e[0] = 0; /* { dg-error "assignment of read-only" } */
+ *v1.e = 0; /* { dg-error "assignment of read-only" } */
+ v1.f[0][0] = 0; /* { dg-error "assignment of read-only" } */
+ *v1.f[0] = 0; /* { dg-error "assignment of read-only" } */
+ **v1.f = 0; /* { dg-error "assignment of read-only" } */
+
+ v2->a = 0;
+ v2->b[0] = 0;
+ *v2->b = 0;
+ v2->c[0][0] = 0;
+ *v2->c[0] = 0;
+ **v2->c = 0;
+ v2->d = 0; /* { dg-error "assignment of read-only" } */
+ v2->e[0] = 0; /* { dg-error "assignment of read-only" } */
+ *v2->e = 0; /* { dg-error "assignment of read-only" } */
+ v2->f[0][0] = 0; /* { dg-error "assignment of read-only" } */
+ *v2->f[0] = 0; /* { dg-error "assignment of read-only" } */
+ **v2->f = 0; /* { dg-error "assignment of read-only" } */
+
+ v3->a = 0; /* { dg-error "assignment of member" } */
+ v3->b[0] = 0; /* { dg-error "assignment of read-only" } */
+ *v3->b = 0; /* { dg-error "assignment of read-only" } */
+ v3->c[0][0] = 0; /* { dg-error "assignment of read-only" } */
+ *v3->c[0] = 0; /* { dg-error "assignment of read-only" } */
+ **v3->c = 0; /* { dg-error "assignment of read-only" } */
+ v3->d = 0; /* { dg-error "assignment of member" } */
+ v3->e[0] = 0; /* { dg-error "assignment of read-only" } */
+ *v3->e = 0; /* { dg-error "assignment of read-only" } */
+ v3->f[0][0] = 0; /* { dg-error "assignment of read-only" } */
+ *v3->f[0] = 0; /* { dg-error "assignment of read-only" } */
+ **v3->f = 0; /* { dg-error "assignment of read-only" } */
+
+ v4.a = 0; /* { dg-error "assignment of member" } */
+ v4.b[0] = 0; /* { dg-error "assignment of read-only" } */
+ *v4.b = 0; /* { dg-error "assignment of read-only" } */
+ v4.c[0][0] = 0; /* { dg-error "assignment of read-only" } */
+ *v4.c[0] = 0; /* { dg-error "assignment of read-only" } */
+ **v4.c = 0; /* { dg-error "assignment of read-only" } */
+ v4.d = 0; /* { dg-error "assignment of member" } */
+ v4.e[0] = 0; /* { dg-error "assignment of read-only" } */
+ *v4.e = 0; /* { dg-error "assignment of read-only" } */
+ v4.f[0][0] = 0; /* { dg-error "assignment of read-only" } */
+ *v4.f[0] = 0; /* { dg-error "assignment of read-only" } */
+ **v4.f = 0; /* { dg-error "assignment of read-only" } */
+
+ v5.x.a = 0; /* { dg-error "assignment of member" } */
+ v5.x.b[0] = 0; /* { dg-error "assignment of read-only" } */
+ *v5.x.b = 0; /* { dg-error "assignment of read-only" } */
+ v5.x.c[0][0] = 0; /* { dg-error "assignment of read-only" } */
+ *v5.x.c[0] = 0; /* { dg-error "assignment of read-only" } */
+ **v5.x.c = 0; /* { dg-error "assignment of read-only" } */
+ v5.x.d = 0; /* { dg-error "assignment of member" } */
+ v5.x.e[0] = 0; /* { dg-error "assignment of read-only" } */
+ *v5.x.e = 0; /* { dg-error "assignment of read-only" } */
+ v5.x.f[0][0] = 0; /* { dg-error "assignment of read-only" } */
+ *v5.x.f[0] = 0; /* { dg-error "assignment of read-only" } */
+ **v5.x.f = 0; /* { dg-error "assignment of read-only" } */
+}
+
+void
+g (void)
+{
+ {
+ int *a = &v1.a;
+ int (*b)[1] = &v1.b;
+ int (*c)[2][3] = &v1.c;
+ int (*cc)[3] = v1.c;
+ const int (*ff)[3] = v1.c; /* { dg-warning "initialization from incompatible pointer type" } */
+ a = &v1.a;
+ b = &v1.b;
+ c = &v1.c;
+ cc = v1.c;
+ ff = v1.c; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+ {
+ const int *d = &v1.d;
+ const int (*e)[1] = &v1.e;
+ const int (*f)[2][3] = &v1.f;
+ const int (*ff)[3] = v1.f;
+ int (*cc)[3] = v1.f; /* { dg-warning "initialization from incompatible pointer type" } */
+ d = &v1.d;
+ e = &v1.e;
+ f = &v1.f;
+ ff = v1.f;
+ cc = v1.f; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+
+ {
+ int *a = &v2->a;
+ int (*b)[1] = &v2->b;
+ int (*c)[2][3] = &v2->c;
+ int (*cc)[3] = v2->c;
+ const int (*ff)[3] = v2->c; /* { dg-warning "initialization from incompatible pointer type" } */
+ a = &v2->a;
+ b = &v2->b;
+ c = &v2->c;
+ cc = v2->c;
+ ff = v2->c; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+ {
+ const int *d = &v2->d;
+ const int (*e)[1] = &v2->e;
+ const int (*f)[2][3] = &v2->f;
+ const int (*ff)[3] = v2->f;
+ int (*cc)[3] = v2->f; /* { dg-warning "initialization from incompatible pointer type" } */
+ d = &v2->d;
+ e = &v2->e;
+ f = &v2->f;
+ ff = v2->f;
+ cc = v2->f; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+
+ {
+ const int *d = &v3->a;
+ const int (*e)[1] = &v3->b;
+ const int (*f)[2][3] = &v3->c;
+ const int (*ff)[3] = v3->c;
+ int (*cc)[3] = v3->c; /* { dg-warning "initialization from incompatible pointer type" } */
+ d = &v3->a;
+ e = &v3->b;
+ f = &v3->c;
+ ff = v3->c;
+ cc = v3->c; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+ {
+ const int *d = &v3->d;
+ const int (*e)[1] = &v3->e;
+ const int (*f)[2][3] = &v3->f;
+ const int (*ff)[3] = v3->f;
+ int (*cc)[3] = v3->f; /* { dg-warning "initialization from incompatible pointer type" } */
+ d = &v3->d;
+ e = &v3->e;
+ f = &v3->f;
+ ff = v3->f;
+ cc = v3->f; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+
+ {
+ const int *d = &v4.a;
+ const int (*e)[1] = &v4.b;
+ const int (*f)[2][3] = &v4.c;
+ const int (*ff)[3] = v4.c;
+ int (*cc)[3] = v4.c; /* { dg-warning "initialization from incompatible pointer type" } */
+ d = &v4.a;
+ e = &v4.b;
+ f = &v4.c;
+ ff = v4.c;
+ cc = v4.c; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+ {
+ const int *d = &v4.d;
+ const int (*e)[1] = &v4.e;
+ const int (*f)[2][3] = &v4.f;
+ const int (*ff)[3] = v4.f;
+ int (*cc)[3] = v4.f; /* { dg-warning "initialization from incompatible pointer type" } */
+ d = &v4.d;
+ e = &v4.e;
+ f = &v4.f;
+ ff = v4.f;
+ cc = v4.f; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+
+ {
+ const int *d = &v5.x.a;
+ const int (*e)[1] = &v5.x.b;
+ const int (*f)[2][3] = &v5.x.c;
+ const int (*ff)[3] = v5.x.c;
+ int (*cc)[3] = v5.x.c; /* { dg-warning "initialization from incompatible pointer type" } */
+ d = &v5.x.a;
+ e = &v5.x.b;
+ f = &v5.x.c;
+ ff = v5.x.c;
+ cc = v5.x.c; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+ {
+ const int *d = &v5.x.d;
+ const int (*e)[1] = &v5.x.e;
+ const int (*f)[2][3] = &v5.x.f;
+ const int (*ff)[3] = v5.x.f;
+ int (*cc)[3] = v5.x.f; /* { dg-warning "initialization from incompatible pointer type" } */
+ d = &v5.x.d;
+ e = &v5.x.e;
+ f = &v5.x.f;
+ ff = v5.x.f;
+ cc = v5.x.f; /* { dg-warning "assignment from incompatible pointer type" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-1.c
new file mode 100644
index 000000000..8151995d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-1.c
@@ -0,0 +1,22 @@
+/* Test for warnings for qualified function return types. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -Wreturn-type -Wignored-qualifiers" } */
+
+/* Qualifying a function return type makes no sense. */
+
+const int int_fn (void); /* { dg-warning "qualifiers" "int decl" } */
+const int (*int_ptr) (void); /* { dg-warning "qualifiers" "int ptr" } */
+const int int_fn2 (void) { return 0; } /* { dg-warning "qualifiers" "int defn" } */
+
+const void void_fn (void); /* { dg-warning "qualifiers" "void decl" } */
+const void (*void_ptr) (void); /* { dg-warning "qualifiers" "void ptr" } */
+const void void_fn2 (void) { } /* { dg-warning "qualified" "void defn" } */
+
+volatile void vvoid_fn (void); /* { dg-warning "qualifiers" "void decl" } */
+volatile void (*vvoid_ptr) (void); /* { dg-warning "qualifiers" "void ptr" } */
+volatile void vvoid_fn2 (void) { } /* { dg-warning "qualified" "void defn" } */
+
+int *restrict ip_fn (void); /* { dg-warning "qualifiers" "restrict decl" } */
+int *restrict (*ip_ptr) (void); /* { dg-warning "qualifiers" "restrict ptr" } */
+int *restrict ip_fn2 (void) { return (int *)0; }; /* { dg-warning "qualifiers" "restrict defn" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-2.c
new file mode 100644
index 000000000..22a1946b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-2.c
@@ -0,0 +1,13 @@
+/* Test for warnings for qualified function return types. -pedantic test. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+/* Qualifying a function return type makes no sense. */
+
+/* The first two of these shouldn't warn (with just -pedantic) as long
+ as the function is not defined. */
+
+volatile void vvoid_fn (void);
+volatile void (*vvoid_ptr) (void);
+volatile void vvoid_fn2 (void) { } /* { dg-warning "qualified" "volatile defn" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-3.c
new file mode 100644
index 000000000..e65f86d54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-3.c
@@ -0,0 +1,16 @@
+/* Test for warnings for qualified function return types. Bug 15052
+ from Olatunji Ruwase (tjruwase at stanfordalumni.org): qualifiers
+ should not be lost when merging declarations. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int foo (); /* { dg-message "note: previous declaration" "different qualifiers" } */
+const int foo () { return 0; } /* { dg-error "conflicting types" "different qualifiers" } */
+
+void bar (void);
+volatile void bar () { } /* { dg-warning "qualified|volatile" "different qualifiers" } */
+
+volatile void baz (void);
+void baz () { } /* { dg-warning "not compatible" "different qualifiers" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-4.c
new file mode 100644
index 000000000..9b61cfebf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/qual-return-4.c
@@ -0,0 +1,10 @@
+/* Test for warnings for qualified function return types. -pedantic
+ test. Only the definition gets a warning for qualified void return
+ types, not other such types within the definition. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+volatile void (*y)(int);
+
+volatile void (*vvf(int x))(int) { return y; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/range-test-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/range-test-1.c
new file mode 100644
index 000000000..93a90ac71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/range-test-1.c
@@ -0,0 +1,168 @@
+/* Test fold-const.c (fold_range_test) optimizations. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+
+#if (INT_MAX == 2147483647) && (INT_MIN == -2147483648) \
+ && (SCHAR_MIN == -128) && (SCHAR_MAX == 127) \
+ && (UCHAR_MIN == 0) && (UCHAR_MAX == 255)
+
+#ifndef T
+
+enum integers
+{
+ int_smallest = INT_MIN,
+ int_2ndsmallest = INT_MIN + 1,
+ int_3rdsmallest = INT_MIN + 2,
+ int_minus2 = -2,
+ int_minus1 = -1,
+ int_zero = 0,
+ int_one = 1,
+ int_two = 2,
+ int_3rdlargest = INT_MAX - 2,
+ int_2ndlargest = INT_MAX - 1,
+ int_largest = INT_MAX
+};
+
+int var;
+void
+check (void)
+{
+ ++var;
+}
+
+#define T(IDX, TYPE, TEST, YESARR, NOARR) \
+void __attribute__((noinline)) \
+test##IDX (TYPE x) \
+{ \
+ if (TEST) \
+ check (); \
+}
+#include "range-test-1.c"
+#undef T
+
+int
+main (void)
+{
+ int i, fails = 0;
+
+#define C ,
+#define T(IDX, TYPE, TEST, YESARR, NOARR) \
+ { \
+ static TYPE yesarr##IDX [] = YESARR; \
+ static TYPE noarr##IDX [] = NOARR; \
+ for (i = 0; i < (int) (sizeof (yesarr##IDX) / sizeof (TYPE)); ++i) \
+ { \
+ var = 0; \
+ test##IDX (yesarr##IDX [i]); \
+ if (var != 1) \
+ printf ("test" #IDX " failed for yesarr [%u]\n", i), ++fails; \
+ } \
+ var = 0; \
+ for (i = 0; i < (int) (sizeof (noarr##IDX) / sizeof (TYPE)); ++i) \
+ { \
+ test##IDX (noarr##IDX [i]); \
+ if (var != 0) \
+ printf ("test" #IDX " failed for noarr [%u]\n", i), ++fails; \
+ } \
+ }
+#include "range-test-1.c"
+#undef T
+
+ if (fails)
+ abort ();
+
+ exit (0);
+}
+
+#else
+
+/* Use `C' instead of `,' below to separate array entries. */
+
+/* These ought to be all optimized into single comparison. */
+T(1, unsigned int, x == 0 || x == 1,
+ { 0 C 1 }, { -1U C 2 C 12 C 35 C 0x7fffffff C 0x80000000 })
+T(2, unsigned int, x == 0 || x == -1U || x == -2U,
+ { 0 C -1U C -2U }, { -3U C -6U C 1 C 2 C 12 C 35 C 0x7fffffff C 0x80000000 })
+T(3, unsigned int, x == 0 || x == 1 || x == 2,
+ { 0 C 1 C 2 }, { -3U C -6U C -1U C -2U C 12 C 35 C 0x7fffffff C 0x80000000 })
+T(4, unsigned int, x == 3 || x == 4 || x == 5 || x == 6,
+ { 3 C 4 C 5 C 6 }, { -3U C 0 C 1 C 2 C 7 C 8 C 12 C 0x7fffffff C 0x80000000 })
+T(5, unsigned int, x == -3U || x == -4U || x == -5U || x == -6U,
+ { -3U C -4U C -5U C -6U }, { -7U C -8U C -2U C -1U C 1 C 2 C 0x7fffffff C 0x80000000 })
+T(6, unsigned int, x == -3U || x == -4U || x == -5U,
+ { -3U C -4U C -5U }, { -6U C -7U C -8U C -2U C -1U C 1 C 2 C 0x7fffffff C 0x80000000 })
+T(7, char *, x == (char *) -3UL || x == (char *) -4UL || x == (char *) -5UL,
+ { (char *) -3UL C (char *) -4UL C (char *) -5UL },
+ { (char *) -6UL C (char *) -20UL C (char *) -2UL C (char *) -1UL C (char *) 0
+ C (char *) 1UL C (char *) 35UL C (char *) 0x7fffffffUL C (char *) 0x80000000UL })
+T(8, unsigned long, x == -2UL || x == -1UL || x == 0,
+ { 0 C -1UL C -2UL }, { -3UL C -6UL C 1 C 2 C 12 C 35 C 0x7fffffff C 0x80000000 })
+T(9, unsigned long, x >= -4UL || x <= 8,
+ { -4UL C -3UL C -2UL C -1UL C 0 C 1 C 2 C 3 C 4 C 5 C 6 C 7 C 8 },
+ { -7UL C -5UL C 9 C 10 C 61 C 127 C 0x7fffffff C 0x80000000 })
+T(10, signed char, x == 0 || x == -1 || x == -2 || x == -3,
+ { 0 C -1 C -2 C -3 }, { -4 C -5 C 1 C 2 C 3 C 35 C -24 })
+T(11, int, x == 0 || x == 1,
+ { 0 C 1 }, { -1 C 2 C 12 C 35 C INT_MAX C INT_MIN })
+T(12, int, x == 0 || x == -1 || x == -2,
+ { 0 C -1 C -2 }, { -3 C -6 C 1 C 2 C 12 C 35 C INT_MAX C INT_MIN })
+T(13, int, x == 0 || x == 1 || x == 2,
+ { 0 C 1 C 2 }, { -3 C -6 C -1 C -2 C 12 C 35 C INT_MAX C INT_MIN })
+T(14, int, x == 3 || x == 4 || x == 5 || x == 6,
+ { 3 C 4 C 5 C 6 }, { -3 C 0 C 1 C 2 C 7 C 8 C 12 C INT_MAX C INT_MIN })
+T(15, int, x == -3 || x == -4 || x == -5 || x == -6,
+ { -3 C -4 C -5 C -6 }, { -7 C -8 C -2 C -1 C 1 C 2 C INT_MAX C INT_MIN })
+T(16, int, x == -3 || x == -4 || x == -5,
+ { -3 C -4 C -5 }, { -6 C -7 C -8 C -2 C -1 C 1 C 2 C INT_MAX C INT_MIN })
+T(17, unsigned int, (x >= -8U && x <= -3U) || x == -2U || x == -1U || x == 0 || x == 1 || x == 2,
+ { -8U C -7U C -6U C -5U C -4U C -3U C -2U C -1U C 0 C 1 C 2 },
+ { -9U C -10U C 3 C 4 C 12 C -54U C INT_MAX C INT_MIN })
+T(18, int, (x >= -8 && x <= -3) || x == -2 || x == -1 || x == 0 || x == 1 || x == 2,
+ { -8 C -7 C -6 C -5 C -4 C -3 C -2 C -1 C 0 C 1 C 2 },
+ { -9 C -10 C 3 C 4 C 12 C -54 C INT_MAX C INT_MIN })
+T(19, unsigned long, (x >= 0 && x <= 16) || (x >= 18 && x <= -1UL),
+ { -3UL C -6UL C -1UL C 0 C 1 C 2 C 12 C 15 C 16 C 18 C 19 C 35 C 0x7fffffff
+ C 0x80000000 }, { 17 })
+T(20, char *, x == (char *) -1UL || x == 0,
+ { (char *) -1UL C 0 }, { (char *) -6UL C (char *) -20UL C (char *) -2UL
+ C (char *) 1UL C (char *) 35UL C (char *) 0x7fffffffUL C (char *) 0x80000000UL })
+T(21, enum integers, x == int_zero || x == int_one,
+ { int_zero C int_one }, { int_minus1 C int_two C 12 C 35 C int_largest C int_smallest })
+T(22, int, x == INT_MIN || x == INT_MAX,
+ { INT_MIN C INT_MAX },
+ { -1 C 0 C 1 C INT_MAX - 1 C INT_MAX - 2 C INT_MIN + 1 C INT_MIN + 2 })
+T(23, int, x == INT_MIN + 1 || x == INT_MIN + 2 || x == INT_MIN || x == INT_MAX,
+ { INT_MIN + 1 C INT_MIN + 2 C INT_MIN C INT_MAX },
+ { -1 C 0 C 1 C INT_MAX - 1 C INT_MAX - 2 C INT_MIN + 3 C INT_MIN + 4 })
+T(24, signed char, x == SCHAR_MIN || x == SCHAR_MAX,
+ { SCHAR_MIN C SCHAR_MAX },
+ { -1 C 0 C 1 C SCHAR_MAX - 1 C SCHAR_MAX - 2 C SCHAR_MIN + 1 C SCHAR_MIN + 2 })
+T(25, enum integers, x == int_smallest || x == int_largest,
+ { int_smallest C int_largest }, { int_minus1 C int_zero C int_one
+ C int_2ndsmallest C int_2ndlargest C int_3rdsmallest C int_3rdlargest })
+
+/* This should be optimized into unconditional jump. */
+T(o1, unsigned long, (x >= 0 && x <= 16) || (x >= 17 && x <= -1UL),
+ { -3UL C -6UL C -1UL C 0 C 1 C 2 C 12 C 15 C 16 C 17 C 18 C 19 C 35 C 0x7fffffff
+ C 0x80000000 }, { })
+T(o2, unsigned long, (x >= 0 && x <= -3UL) || (x == -2UL || x == -1UL),
+ { -3UL C -6UL C -1UL C 0 C 1 C 2 C 12 C 15 C 16 C 17 C 18 C 19 C 35 C 0x7fffffff
+ C 0x80000000 }, { })
+
+/* This should be eventually optimized into a single comparison. */
+T(td1, unsigned char, x == 0 || x == 4 || x == 1 || x == 5 || x == 2 || x == 6 || x == 3,
+ { 0 C 1 C 2 C 3 C 4 C 5 C 6 }, { 7 C 8 C 127 C 128 C 254 C 255 })
+
+#endif
+
+#else
+int
+main (void)
+{
+ return 0;
+}
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/readonly-loc.c b/gcc-4.9/gcc/testsuite/gcc.dg/readonly-loc.c
new file mode 100644
index 000000000..c5d1c97d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/readonly-loc.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+int func()
+{
+ const int *arr;
+ const int arr2[5];
+ arr[0] = 1; /* { dg-error "assignment of read-only location" "*(arr)" } */
+ arr[1] = 1; /* { dg-error "assignment of read-only location" "*(arr + 4u)" } */
+ arr2[0] = 1; /* { dg-error "assignment of read-only location" "arr2\[0\]" } */
+ arr2[1] = 1; /* { dg-error "assignment of read-only location" "arr2\[1\]" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/real-const-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/real-const-1.c
new file mode 100644
index 000000000..4c7058d17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/real-const-1.c
@@ -0,0 +1,5 @@
+/* PR middle-end/21781. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+int foo(void) { if (.0e200000000 == 0 ) return 1; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-1.c
new file mode 100644
index 000000000..e04ec801d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-1.c
@@ -0,0 +1,102 @@
+/* Test for various situations where a new declaration of an
+ identifier conflicts with an earlier declaration which isn't in the
+ same scope. These are all undefined behavior per C89 sections
+ 6.1.2.2p7, 6.1.2.6p2, and 6.3.2.2p2/footnote 38 (C99 6.2.2p7 and
+ 6.2.7p2 - implicit declarations are invalid in C99). */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -pedantic -Wall -Wno-unused" } */
+
+/* Extern at function scope, clashing with extern at file scope */
+
+extern int foo1; /* { dg-message "note: previous" } */
+extern int bar1(int); /* { dg-message "note: previous" } */
+
+void test1(void)
+{
+ extern double foo1; /* { dg-error "conflict" } */
+ extern double bar1(double); /* { dg-error "conflict" } */
+}
+
+/* Extern at file scope, clashing with extern at function scope */
+
+void test2(void)
+{
+ extern double foo2; /* { dg-message "note: previous" } */
+ extern double bar2(double); /* { dg-message "note: previous" } */
+}
+
+extern int foo2; /* { dg-error "conflict" } */
+extern int bar2(int); /* { dg-error "conflict" } */
+
+/* Extern at function scope, clashing with extern at earlier function
+ scope. Also, don't be fooled by a typedef at file scope. */
+
+typedef float baz3; /* { dg-bogus } */
+
+void prime3(void)
+{
+ extern int foo3; /* { dg-message "note: previous" } */
+ extern int bar3(int); /* { dg-message "note: previous" } */
+ extern int baz3; /* { dg-message "note: previous" } */
+}
+
+void test3(void)
+{
+ extern double foo3; /* { dg-error "conflict" } */
+ extern double bar3(double); /* { dg-error "conflict" } */
+ extern double baz3; /* { dg-error "conflict" } */
+}
+
+/* Extern at function scope, clashing with previous implicit decl. */
+
+void prime4(void)
+{
+ bar4(); /* { dg-warning "implicit declaration of function" "implicit" } */
+}
+
+void test4(void)
+{
+ extern double bar4(double); /* { dg-error "conflict" } */
+/* { dg-message "note: previous implicit declaration" "previous" { target *-*-* } 55 } */
+}
+
+/* Implicit decl, clashing with extern at previous function scope. */
+
+void prime5(void)
+{
+ extern double bar5(double); /* { dg-message "note: previous declaration" "previous 1" } */
+} /* { dg-message "note: previous implicit declaration" "previous 2" { target *-*-* } 68 } */
+
+void test5(void)
+{
+ bar5(1); /* { dg-warning "implicit declaration of function" } */
+} /* { dg-error "incompatible implicit declaration" "" { target *-*-* } 73 } */
+
+/* Extern then static, both at file scope. */
+
+extern int test6(int); /* { dg-message "note: previous" "" } */
+static int test6(int x) /* { dg-error "follows non-static" } */
+{ return x; }
+
+
+/* Extern then static, extern at previous function scope. */
+
+void prime7(void)
+{
+ extern int test7(int); /* { dg-message "note: previous" "" } */
+}
+
+static int test7(int x) /* { dg-error "follows non-static" } */
+{ return x; }
+
+/* Implicit decl then static. */
+
+void prime8(void)
+{
+ test8(); /* { dg-message "note: previous" "" } */
+ /* { dg-warning "implicit" "implicit" { target *-*-* } 97 } */
+}
+
+static int test8(int x) /* { dg-error "follows non-static" } */
+{ return x; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-10.c
new file mode 100644
index 000000000..525961e7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-10.c
@@ -0,0 +1,34 @@
+/* Test for multiple declarations and composite types. Check we don't
+ ICE with nested initializers. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+static int w[];
+void
+f (void)
+{
+ extern int w[] = { 1, 2 }; /* { dg-error "has both" } */
+}
+
+int x[]; /* { dg-warning "array 'x' assumed to have one element" } */
+void
+g (void)
+{
+ extern int x[] = { 3, 4, 5 }; /* { dg-error "has both" } */
+}
+
+static int y[];
+void
+h (void)
+{
+ extern int y[] = { 6 }; /* { dg-error "has both" } */
+}
+
+int z[]; /* { dg-warning "array 'z' assumed to have one element" } */
+void
+i (void)
+{
+ extern int z[] = { 7 }; /* { dg-error "has both" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-11.c
new file mode 100644
index 000000000..5540e4050
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-11.c
@@ -0,0 +1,9 @@
+/* Some incompatible external linkage declarations were not diagnosed.
+ Bug 21342. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int f(int (*)[]);
+void g() { int f(int (*)[2]); } /* { dg-message "note: previous declaration of 'f' was here" } */
+int f(int (*)[3]); /* { dg-error "conflicting types for 'f'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-12.c
new file mode 100644
index 000000000..711b8a3fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-12.c
@@ -0,0 +1,9 @@
+/* Some incompatible external linkage declarations were not diagnosed.
+ Bug 21342. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern int a[];
+void f(void) { extern int a[]; extern int a[10]; } /* { dg-message "note: previous declaration of 'a' was here" } */
+extern int a[5]; /* { dg-error "conflicting types for 'a'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-13.c
new file mode 100644
index 000000000..3f05d0fb1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-13.c
@@ -0,0 +1,9 @@
+/* Some incompatible external linkage declarations were not diagnosed.
+ Bug 21342. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+extern int a[];
+void f(void) { extern int a[10]; } /* { dg-message "note: previous declaration of 'a' was here" } */
+extern int a[5]; /* { dg-error "conflicting types for 'a'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-14.c
new file mode 100644
index 000000000..b27c02441
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-14.c
@@ -0,0 +1,22 @@
+/* Some incompatible external linkage declarations were not diagnosed.
+ Bug 21342. Test type in inner scope is correct. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int IA[];
+typedef int IA5[5];
+typedef IA *IAP;
+typedef IA5 *IA5P;
+extern IAP a[];
+void
+f (void)
+{
+ {
+ extern IA5P a[];
+ sizeof (*a[0]);
+ }
+ extern IAP a[];
+ extern IAP a[5];
+ sizeof (*a[0]); /* { dg-error "invalid application of 'sizeof' to incomplete type 'IA'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-15.c
new file mode 100644
index 000000000..d2f48bd79
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-15.c
@@ -0,0 +1,14 @@
+/* Test for ICE with redeclaration in inner scope which is accepted
+ despite incompatible type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f (void)
+{
+ g(); /* { dg-message "note: previous implicit declaration of 'g' was here" } */
+ {
+ void g(); /* { dg-warning "conflicting types for 'g'" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-16.c
new file mode 100644
index 000000000..560b373fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-16.c
@@ -0,0 +1,18 @@
+/* PR 21502 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int IA[];
+typedef int IA5[5];
+typedef int IA10[10];
+typedef IA *IAP;
+typedef IA5 *IA5P;
+typedef IA10 *IA10P;
+extern IAP a[];
+void
+f (void)
+{
+ extern IA5P a[];
+}
+IAP a[] = { 0 }; /* { dg-message "note: previous definition" } */
+extern IA10P a[]; /* { dg-error "conflicting types" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-17.c
new file mode 100644
index 000000000..686ebc589
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-17.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+void (*fp)(const int i);
+void (*fp)(int i);
+
+void foo()
+{
+ (*fp)(0);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-2.c
new file mode 100644
index 000000000..fa0d5e447
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-2.c
@@ -0,0 +1,68 @@
+/* Test for multiple declarations of an identifier at same block
+ scope: only valid case is all extern. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+fa0 (void)
+{
+ int a0; /* { dg-message "note: previous declaration" } */
+ int a0; /* { dg-error "redeclaration" } */
+}
+
+void
+fa1 (void)
+{
+ int a1; /* { dg-message "note: previous declaration" } */
+ static int a1; /* { dg-error "redeclaration" } */
+}
+
+void
+fa2 (void)
+{
+ int a2; /* { dg-message "note: previous declaration" } */
+ extern int a2; /* { dg-error "follows declaration with no linkage" } */
+}
+
+void
+fa3 (void)
+{
+ static int a3; /* { dg-message "note: previous declaration" } */
+ int a3; /* { dg-error "redeclaration" } */
+}
+
+void
+fa4 (void)
+{
+ static int a4; /* { dg-message "note: previous declaration" } */
+ static int a4; /* { dg-error "redeclaration" } */
+}
+
+void
+fa5 (void)
+{
+ static int a5; /* { dg-message "note: previous declaration" } */
+ extern int a5; /* { dg-error "follows declaration with no linkage" } */
+}
+
+void
+fa6 (void)
+{
+ extern int a6; /* { dg-message "note: previous declaration" } */
+ int a6; /* { dg-error "follows extern declaration" } */
+}
+
+void
+fa7 (void)
+{
+ extern int a7; /* { dg-message "note: previous declaration" } */
+ static int a7; /* { dg-error "follows extern declaration" } */
+}
+
+void
+fa8 (void)
+{
+ extern int a8;
+ extern int a8;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-3.c
new file mode 100644
index 000000000..3181712f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-3.c
@@ -0,0 +1,1180 @@
+/* Test for multiple declarations and composite types. Includes bug
+ 13801. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+typedef int IA[];
+typedef int A10[10];
+
+/* Test all combinations of: a variable declared at file scope (no
+ type specifiers, or extern, or static), or just inside a function
+ (with extern), redeclared in an inner scope (with extern), and
+ redeclared in an inner scope when the previous declaration is
+ hidden (with extern, and not if the original declaration was
+ static). Test three times: incomplete variable types; pointers to
+ incomplete types; functions returning such pointers. */
+
+IA a0;
+void
+f0 (void)
+{
+ sizeof(a0); /* { dg-error "incomplete" } */
+ {
+ extern IA a0;
+ sizeof(a0); /* { dg-error "incomplete" } */
+ {
+ int a0;
+ {
+ extern IA a0;
+ sizeof(a0); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(a0); /* { dg-error "incomplete" } */
+ }
+ sizeof(a0); /* { dg-error "incomplete" } */
+}
+extern A10 a0;
+
+IA a1;
+void
+f1 (void)
+{
+ sizeof(a1); /* { dg-error "incomplete" } */
+ {
+ extern IA a1;
+ sizeof(a1); /* { dg-error "incomplete" } */
+ {
+ int a1;
+ {
+ extern A10 a1;
+ sizeof(a1);
+ }
+ }
+ sizeof(a1); /* { dg-error "incomplete" } */
+ }
+ sizeof(a1); /* { dg-error "incomplete" } */
+}
+extern A10 a1;
+
+IA a2;
+void
+f2 (void)
+{
+ sizeof(a2); /* { dg-error "incomplete" } */
+ {
+ extern A10 a2;
+ sizeof(a2);
+ {
+ int a2;
+ {
+ extern IA a2;
+ sizeof(a2); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(a2);
+ }
+ sizeof(a2); /* { dg-error "incomplete" } */
+}
+extern A10 a2;
+
+IA a3;
+void
+f3 (void)
+{
+ sizeof(a3); /* { dg-error "incomplete" } */
+ {
+ extern A10 a3;
+ sizeof(a3);
+ {
+ int a3;
+ {
+ extern A10 a3;
+ sizeof(a3);
+ }
+ }
+ sizeof(a3);
+ }
+ sizeof(a3); /* { dg-error "incomplete" } */
+}
+extern A10 a3;
+
+A10 a4;
+void
+f4 (void)
+{
+ sizeof(a4);
+ {
+ extern IA a4;
+ sizeof(a4);
+ {
+ int a4;
+ {
+ extern IA a4;
+ sizeof(a4); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(a4);
+ }
+ sizeof(a4);
+}
+extern A10 a4;
+
+A10 a5;
+void
+f5 (void)
+{
+ sizeof(a5);
+ {
+ extern IA a5;
+ sizeof(a5);
+ {
+ int a5;
+ {
+ extern A10 a5;
+ sizeof(a5);
+ }
+ }
+ sizeof(a5);
+ }
+ sizeof(a5);
+}
+extern A10 a5;
+
+A10 a6;
+void
+f6 (void)
+{
+ sizeof(a6);
+ {
+ extern A10 a6;
+ sizeof(a6);
+ {
+ int a6;
+ {
+ extern IA a6;
+ sizeof(a6); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(a6);
+ }
+ sizeof(a6);
+}
+extern A10 a6;
+
+A10 a7;
+void
+f7 (void)
+{
+ sizeof(a7);
+ {
+ extern A10 a7;
+ sizeof(a7);
+ {
+ int a7;
+ {
+ extern A10 a7;
+ sizeof(a7);
+ }
+ }
+ sizeof(a7);
+ }
+ sizeof(a7);
+}
+extern A10 a7;
+
+extern IA a8;
+void
+f8 (void)
+{
+ sizeof(a8); /* { dg-error "incomplete" } */
+ {
+ extern IA a8;
+ sizeof(a8); /* { dg-error "incomplete" } */
+ {
+ int a8;
+ {
+ extern IA a8;
+ sizeof(a8); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(a8); /* { dg-error "incomplete" } */
+ }
+ sizeof(a8); /* { dg-error "incomplete" } */
+}
+extern A10 a8;
+
+extern IA a9;
+void
+f9 (void)
+{
+ sizeof(a9); /* { dg-error "incomplete" } */
+ {
+ extern IA a9;
+ sizeof(a9); /* { dg-error "incomplete" } */
+ {
+ int a9;
+ {
+ extern A10 a9;
+ sizeof(a9);
+ }
+ }
+ sizeof(a9); /* { dg-error "incomplete" } */
+ }
+ sizeof(a9); /* { dg-error "incomplete" } */
+}
+extern A10 a9;
+
+extern IA a10;
+void
+f10 (void)
+{
+ sizeof(a10); /* { dg-error "incomplete" } */
+ {
+ extern A10 a10;
+ sizeof(a10);
+ {
+ int a10;
+ {
+ extern IA a10;
+ sizeof(a10); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(a10);
+ }
+ sizeof(a10); /* { dg-error "incomplete" } */
+}
+extern A10 a10;
+
+extern IA a11;
+void
+f11 (void)
+{
+ sizeof(a11); /* { dg-error "incomplete" } */
+ {
+ extern A10 a11;
+ sizeof(a11);
+ {
+ int a11;
+ {
+ extern A10 a11;
+ sizeof(a11);
+ }
+ }
+ sizeof(a11);
+ }
+ sizeof(a11); /* { dg-error "incomplete" } */
+}
+extern A10 a11;
+
+extern A10 a12;
+void
+f12 (void)
+{
+ sizeof(a12);
+ {
+ extern IA a12;
+ sizeof(a12);
+ {
+ int a12;
+ {
+ extern IA a12;
+ sizeof(a12); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(a12);
+ }
+ sizeof(a12);
+}
+extern A10 a12;
+
+extern A10 a13;
+void
+f13 (void)
+{
+ sizeof(a13);
+ {
+ extern IA a13;
+ sizeof(a13);
+ {
+ int a13;
+ {
+ extern A10 a13;
+ sizeof(a13);
+ }
+ }
+ sizeof(a13);
+ }
+ sizeof(a13);
+}
+extern A10 a13;
+
+extern A10 a14;
+void
+f14 (void)
+{
+ sizeof(a14);
+ {
+ extern A10 a14;
+ sizeof(a14);
+ {
+ int a14;
+ {
+ extern IA a14;
+ sizeof(a14); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(a14);
+ }
+ sizeof(a14);
+}
+extern A10 a14;
+
+extern A10 a15;
+void
+f15 (void)
+{
+ sizeof(a15);
+ {
+ extern A10 a15;
+ sizeof(a15);
+ {
+ int a15;
+ {
+ extern A10 a15;
+ sizeof(a15);
+ }
+ }
+ sizeof(a15);
+ }
+ sizeof(a15);
+}
+extern A10 a15;
+
+static IA a16;
+void
+f16 (void)
+{
+ sizeof(a16); /* { dg-error "incomplete" } */
+ {
+ extern IA a16;
+ sizeof(a16); /* { dg-error "incomplete" } */
+ }
+ sizeof(a16); /* { dg-error "incomplete" } */
+}
+extern A10 a16;
+
+static IA a17;
+void
+f17 (void)
+{
+ sizeof(a17); /* { dg-error "incomplete" } */
+ {
+ extern A10 a17;
+ sizeof(a17);
+ }
+ sizeof(a17); /* { dg-error "incomplete" } */
+}
+extern A10 a17;
+
+static A10 a18;
+void
+f18 (void)
+{
+ sizeof(a18);
+ {
+ extern IA a18;
+ sizeof(a18);
+ }
+ sizeof(a18);
+}
+extern A10 a18;
+
+static A10 a19;
+void
+f19 (void)
+{
+ sizeof(a19);
+ {
+ extern A10 a19;
+ sizeof(a19);
+ }
+ sizeof(a19);
+}
+extern A10 a19;
+
+IA *b0;
+void
+g0 (void)
+{
+ sizeof(*b0); /* { dg-error "incomplete" } */
+ {
+ extern IA *b0;
+ sizeof(*b0); /* { dg-error "incomplete" } */
+ {
+ int b0;
+ {
+ extern IA *b0;
+ sizeof(*b0); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*b0); /* { dg-error "incomplete" } */
+ }
+ sizeof(*b0); /* { dg-error "incomplete" } */
+}
+extern A10 *b0;
+
+IA *b1;
+void
+g1 (void)
+{
+ sizeof(*b1); /* { dg-error "incomplete" } */
+ {
+ extern IA *b1;
+ sizeof(*b1); /* { dg-error "incomplete" } */
+ {
+ int b1;
+ {
+ extern A10 *b1;
+ sizeof(*b1);
+ }
+ }
+ sizeof(*b1); /* { dg-error "incomplete" } */
+ }
+ sizeof(*b1); /* { dg-error "incomplete" } */
+}
+extern A10 *b1;
+
+IA *b2;
+void
+g2 (void)
+{
+ sizeof(*b2); /* { dg-error "incomplete" } */
+ {
+ extern A10 *b2;
+ sizeof(*b2);
+ {
+ int b2;
+ {
+ extern IA *b2;
+ sizeof(*b2); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*b2);
+ }
+ sizeof(*b2); /* { dg-error "incomplete" } */
+}
+extern A10 *b2;
+
+IA *b3;
+void
+g3 (void)
+{
+ sizeof(*b3); /* { dg-error "incomplete" } */
+ {
+ extern A10 *b3;
+ sizeof(*b3);
+ {
+ int b3;
+ {
+ extern A10 *b3;
+ sizeof(*b3);
+ }
+ }
+ sizeof(*b3);
+ }
+ sizeof(*b3); /* { dg-error "incomplete" } */
+}
+extern A10 *b3;
+
+A10 *b4;
+void
+g4 (void)
+{
+ sizeof(*b4);
+ {
+ extern IA *b4;
+ sizeof(*b4);
+ {
+ int b4;
+ {
+ extern IA *b4;
+ sizeof(*b4); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*b4);
+ }
+ sizeof(*b4);
+}
+extern A10 *b4;
+
+A10 *b5;
+void
+g5 (void)
+{
+ sizeof(*b5);
+ {
+ extern IA *b5;
+ sizeof(*b5);
+ {
+ int b5;
+ {
+ extern A10 *b5;
+ sizeof(*b5);
+ }
+ }
+ sizeof(*b5);
+ }
+ sizeof(*b5);
+}
+extern A10 *b5;
+
+A10 *b6;
+void
+g6 (void)
+{
+ sizeof(*b6);
+ {
+ extern A10 *b6;
+ sizeof(*b6);
+ {
+ int b6;
+ {
+ extern IA *b6;
+ sizeof(*b6); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*b6);
+ }
+ sizeof(*b6);
+}
+extern A10 *b6;
+
+A10 *b7;
+void
+g7 (void)
+{
+ sizeof(*b7);
+ {
+ extern A10 *b7;
+ sizeof(*b7);
+ {
+ int b7;
+ {
+ extern A10 *b7;
+ sizeof(*b7);
+ }
+ }
+ sizeof(*b7);
+ }
+ sizeof(*b7);
+}
+extern A10 *b7;
+
+extern IA *b8;
+void
+g8 (void)
+{
+ sizeof(*b8); /* { dg-error "incomplete" } */
+ {
+ extern IA *b8;
+ sizeof(*b8); /* { dg-error "incomplete" } */
+ {
+ int b8;
+ {
+ extern IA *b8;
+ sizeof(*b8); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*b8); /* { dg-error "incomplete" } */
+ }
+ sizeof(*b8); /* { dg-error "incomplete" } */
+}
+extern A10 *b8;
+
+extern IA *b9;
+void
+g9 (void)
+{
+ sizeof(*b9); /* { dg-error "incomplete" } */
+ {
+ extern IA *b9;
+ sizeof(*b9); /* { dg-error "incomplete" } */
+ {
+ int b9;
+ {
+ extern A10 *b9;
+ sizeof(*b9);
+ }
+ }
+ sizeof(*b9); /* { dg-error "incomplete" } */
+ }
+ sizeof(*b9); /* { dg-error "incomplete" } */
+}
+extern A10 *b9;
+
+extern IA *b10;
+void
+g10 (void)
+{
+ sizeof(*b10); /* { dg-error "incomplete" } */
+ {
+ extern A10 *b10;
+ sizeof(*b10);
+ {
+ int b10;
+ {
+ extern IA *b10;
+ sizeof(*b10); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*b10);
+ }
+ sizeof(*b10); /* { dg-error "incomplete" } */
+}
+extern A10 *b10;
+
+extern IA *b11;
+void
+g11 (void)
+{
+ sizeof(*b11); /* { dg-error "incomplete" } */
+ {
+ extern A10 *b11;
+ sizeof(*b11);
+ {
+ int b11;
+ {
+ extern A10 *b11;
+ sizeof(*b11);
+ }
+ }
+ sizeof(*b11);
+ }
+ sizeof(*b11); /* { dg-error "incomplete" } */
+}
+extern A10 *b11;
+
+extern A10 *b12;
+void
+g12 (void)
+{
+ sizeof(*b12);
+ {
+ extern IA *b12;
+ sizeof(*b12);
+ {
+ int b12;
+ {
+ extern IA *b12;
+ sizeof(*b12); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*b12);
+ }
+ sizeof(*b12);
+}
+extern A10 *b12;
+
+extern A10 *b13;
+void
+g13 (void)
+{
+ sizeof(*b13);
+ {
+ extern IA *b13;
+ sizeof(*b13);
+ {
+ int b13;
+ {
+ extern A10 *b13;
+ sizeof(*b13);
+ }
+ }
+ sizeof(*b13);
+ }
+ sizeof(*b13);
+}
+extern A10 *b13;
+
+extern A10 *b14;
+void
+g14 (void)
+{
+ sizeof(*b14);
+ {
+ extern A10 *b14;
+ sizeof(*b14);
+ {
+ int b14;
+ {
+ extern IA *b14;
+ sizeof(*b14); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*b14);
+ }
+ sizeof(*b14);
+}
+extern A10 *b14;
+
+extern A10 *b15;
+void
+g15 (void)
+{
+ sizeof(*b15);
+ {
+ extern A10 *b15;
+ sizeof(*b15);
+ {
+ int b15;
+ {
+ extern A10 *b15;
+ sizeof(*b15);
+ }
+ }
+ sizeof(*b15);
+ }
+ sizeof(*b15);
+}
+extern A10 *b15;
+
+static IA *b16;
+void
+g16 (void)
+{
+ sizeof(*b16); /* { dg-error "incomplete" } */
+ {
+ extern IA *b16;
+ sizeof(*b16); /* { dg-error "incomplete" } */
+ }
+ sizeof(*b16); /* { dg-error "incomplete" } */
+}
+extern A10 *b16;
+
+static IA *b17;
+void
+g17 (void)
+{
+ sizeof(*b17); /* { dg-error "incomplete" } */
+ {
+ extern A10 *b17;
+ sizeof(*b17);
+ }
+ sizeof(*b17); /* { dg-error "incomplete" } */
+}
+extern A10 *b17;
+
+static A10 *b18;
+void
+g18 (void)
+{
+ sizeof(*b18);
+ {
+ extern IA *b18;
+ sizeof(*b18);
+ }
+ sizeof(*b18);
+}
+extern A10 *b18;
+
+static A10 *b19;
+void
+g19 (void)
+{
+ sizeof(*b19);
+ {
+ extern A10 *b19;
+ sizeof(*b19);
+ }
+ sizeof(*b19);
+}
+extern A10 *b19;
+
+IA *c0 (void);
+void
+h0 (void)
+{
+ sizeof(*c0()); /* { dg-error "incomplete" } */
+ {
+ extern IA *c0 (void);
+ sizeof(*c0()); /* { dg-error "incomplete" } */
+ {
+ int c0;
+ {
+ extern IA *c0 (void);
+ sizeof(*c0()); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*c0()); /* { dg-error "incomplete" } */
+ }
+ sizeof(*c0()); /* { dg-error "incomplete" } */
+}
+A10 *c0 (void) { return 0; }
+
+IA *c1 (void);
+void
+h1 (void)
+{
+ sizeof(*c1()); /* { dg-error "incomplete" } */
+ {
+ extern IA *c1 (void);
+ sizeof(*c1()); /* { dg-error "incomplete" } */
+ {
+ int c1;
+ {
+ extern A10 *c1 (void);
+ sizeof(*c1());
+ }
+ }
+ sizeof(*c1()); /* { dg-error "incomplete" } */
+ }
+ sizeof(*c1()); /* { dg-error "incomplete" } */
+}
+A10 *c1 (void) { return 0; }
+
+IA *c2 (void);
+void
+h2 (void)
+{
+ sizeof(*c2()); /* { dg-error "incomplete" } */
+ {
+ extern A10 *c2 (void);
+ sizeof(*c2());
+ {
+ int c2;
+ {
+ extern IA *c2 (void);
+ sizeof(*c2()); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*c2());
+ }
+ sizeof(*c2()); /* { dg-error "incomplete" } */
+}
+A10 *c2 (void) { return 0; }
+
+IA *c3 (void);
+void
+h3 (void)
+{
+ sizeof(*c3()); /* { dg-error "incomplete" } */
+ {
+ extern A10 *c3 (void);
+ sizeof(*c3());
+ {
+ int c3;
+ {
+ extern A10 *c3 (void);
+ sizeof(*c3());
+ }
+ }
+ sizeof(*c3());
+ }
+ sizeof(*c3()); /* { dg-error "incomplete" } */
+}
+A10 *c3 (void) { return 0; }
+
+A10 *c4 (void);
+void
+h4 (void)
+{
+ sizeof(*c4());
+ {
+ extern IA *c4 (void);
+ sizeof(*c4());
+ {
+ int c4;
+ {
+ extern IA *c4 (void);
+ sizeof(*c4()); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*c4());
+ }
+ sizeof(*c4());
+}
+A10 *c4 (void) { return 0; }
+
+A10 *c5 (void);
+void
+h5 (void)
+{
+ sizeof(*c5());
+ {
+ extern IA *c5 (void);
+ sizeof(*c5());
+ {
+ int c5;
+ {
+ extern A10 *c5 (void);
+ sizeof(*c5());
+ }
+ }
+ sizeof(*c5());
+ }
+ sizeof(*c5());
+}
+A10 *c5 (void) { return 0; }
+
+A10 *c6 (void);
+void
+h6 (void)
+{
+ sizeof(*c6());
+ {
+ extern A10 *c6 (void);
+ sizeof(*c6());
+ {
+ int c6;
+ {
+ extern IA *c6 (void);
+ sizeof(*c6()); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*c6());
+ }
+ sizeof(*c6());
+}
+A10 *c6 (void) { return 0; }
+
+A10 *c7 (void);
+void
+h7 (void)
+{
+ sizeof(*c7());
+ {
+ extern A10 *c7 (void);
+ sizeof(*c7());
+ {
+ int c7;
+ {
+ extern A10 *c7 (void);
+ sizeof(*c7());
+ }
+ }
+ sizeof(*c7());
+ }
+ sizeof(*c7());
+}
+A10 *c7 (void) { return 0; }
+
+extern IA *c8 (void);
+void
+h8 (void)
+{
+ sizeof(*c8()); /* { dg-error "incomplete" } */
+ {
+ extern IA *c8 (void);
+ sizeof(*c8()); /* { dg-error "incomplete" } */
+ {
+ int c8;
+ {
+ extern IA *c8 (void);
+ sizeof(*c8()); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*c8()); /* { dg-error "incomplete" } */
+ }
+ sizeof(*c8()); /* { dg-error "incomplete" } */
+}
+extern A10 *c8 (void) { return 0; }
+
+extern IA *c9 (void);
+void
+h9 (void)
+{
+ sizeof(*c9()); /* { dg-error "incomplete" } */
+ {
+ extern IA *c9 (void);
+ sizeof(*c9()); /* { dg-error "incomplete" } */
+ {
+ int c9;
+ {
+ extern A10 *c9 (void);
+ sizeof(*c9());
+ }
+ }
+ sizeof(*c9()); /* { dg-error "incomplete" } */
+ }
+ sizeof(*c9()); /* { dg-error "incomplete" } */
+}
+extern A10 *c9 (void) { return 0; }
+
+extern IA *c10 (void);
+void
+h10 (void)
+{
+ sizeof(*c10()); /* { dg-error "incomplete" } */
+ {
+ extern A10 *c10 (void);
+ sizeof(*c10());
+ {
+ int c10;
+ {
+ extern IA *c10 (void);
+ sizeof(*c10()); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*c10());
+ }
+ sizeof(*c10()); /* { dg-error "incomplete" } */
+}
+extern A10 *c10 (void) { return 0; }
+
+extern IA *c11 (void);
+void
+h11 (void)
+{
+ sizeof(*c11()); /* { dg-error "incomplete" } */
+ {
+ extern A10 *c11 (void);
+ sizeof(*c11());
+ {
+ int c11;
+ {
+ extern A10 *c11 (void);
+ sizeof(*c11());
+ }
+ }
+ sizeof(*c11());
+ }
+ sizeof(*c11()); /* { dg-error "incomplete" } */
+}
+extern A10 *c11 (void) { return 0; }
+
+extern A10 *c12 (void);
+void
+h12 (void)
+{
+ sizeof(*c12());
+ {
+ extern IA *c12 (void);
+ sizeof(*c12());
+ {
+ int c12;
+ {
+ extern IA *c12 (void);
+ sizeof(*c12()); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*c12());
+ }
+ sizeof(*c12());
+}
+extern A10 *c12 (void) { return 0; }
+
+extern A10 *c13 (void);
+void
+h13 (void)
+{
+ sizeof(*c13());
+ {
+ extern IA *c13 (void);
+ sizeof(*c13());
+ {
+ int c13;
+ {
+ extern A10 *c13 (void);
+ sizeof(*c13());
+ }
+ }
+ sizeof(*c13());
+ }
+ sizeof(*c13());
+}
+extern A10 *c13 (void) { return 0; }
+
+extern A10 *c14 (void);
+void
+h14 (void)
+{
+ sizeof(*c14());
+ {
+ extern A10 *c14 (void);
+ sizeof(*c14());
+ {
+ int c14;
+ {
+ extern IA *c14 (void);
+ sizeof(*c14()); /* { dg-error "incomplete" } */
+ }
+ }
+ sizeof(*c14());
+ }
+ sizeof(*c14());
+}
+extern A10 *c14 (void) { return 0; }
+
+extern A10 *c15 (void);
+void
+h15 (void)
+{
+ sizeof(*c15());
+ {
+ extern A10 *c15 (void);
+ sizeof(*c15());
+ {
+ int c15;
+ {
+ extern A10 *c15 (void);
+ sizeof(*c15());
+ }
+ }
+ sizeof(*c15());
+ }
+ sizeof(*c15());
+}
+extern A10 *c15 (void) { return 0; }
+
+static IA *c16 (void);
+void
+h16 (void)
+{
+ sizeof(*c16()); /* { dg-error "incomplete" } */
+ {
+ extern IA *c16 (void);
+ sizeof(*c16()); /* { dg-error "incomplete" } */
+ }
+ sizeof(*c16()); /* { dg-error "incomplete" } */
+}
+static A10 *c16 (void) { return 0; }
+
+static IA *c17 (void);
+void
+h17 (void)
+{
+ sizeof(*c17()); /* { dg-error "incomplete" } */
+ {
+ extern A10 *c17 (void);
+ sizeof(*c17());
+ }
+ sizeof(*c17()); /* { dg-error "incomplete" } */
+}
+static A10 *c17 (void) { return 0; }
+
+static A10 *c18 (void);
+void
+h18 (void)
+{
+ sizeof(*c18());
+ {
+ extern IA *c18 (void);
+ sizeof(*c18());
+ }
+ sizeof(*c18());
+}
+static A10 *c18 (void) { return 0; }
+
+static A10 *c19 (void);
+void
+h19 (void)
+{
+ sizeof(*c19());
+ {
+ extern A10 *c19 (void);
+ sizeof(*c19());
+ }
+ sizeof(*c19());
+}
+static A10 *c19 (void) { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-4.c
new file mode 100644
index 000000000..80f678ec2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-4.c
@@ -0,0 +1,28 @@
+/* Test for multiple declarations and composite types, with built-in
+ functions. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -Wformat -g" } */
+
+void
+f (void)
+{
+ int printf;
+ int strcmp;
+ {
+ int printf (const char *, ...);
+ int strcmp ();
+ /* Should get format warnings even though the built-in declaration
+ isn't "visible". */
+ printf ("%s", 1); /* { dg-warning "format" } */
+ /* The type of strcmp here should have no prototype. */
+ if (0)
+ strcmp (1);
+ /* Likewise, implicitly declared memcmp. */
+ if (0)
+ memcmp (1);
+ }
+}
+
+/* Should still diagnose incompatible prototype for strcmp. */
+int strcmp (void); /* { dg-error "conflict" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-5.c
new file mode 100644
index 000000000..15b1f8c8e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-5.c
@@ -0,0 +1,19 @@
+/* Test for multiple declarations and composite types. Diagnosis of
+ incompatible implicit declaration. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=c89" } */
+
+void
+f (void)
+{
+ long z(); /* { dg-message "note: previous implicit declaration" } */
+}
+
+void
+g (void)
+{
+ z(); /* { dg-error "incompatible" } */
+ labs(1); /* { dg-warning "incompatible" } */
+ printf("x"); /* { dg-warning "incompatible" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-6.c
new file mode 100644
index 000000000..164ec974d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-6.c
@@ -0,0 +1,24 @@
+/* Test for multiple declarations and composite types. As in bug
+ 13801. Illustrates how bug causes correct code to be wrongly
+ diagnosed. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef int IA[];
+typedef int A5[5];
+typedef int A10[10];
+
+A10 array10;
+
+A5 *ap;
+void
+f (void)
+{
+ int ap;
+ {
+ extern IA *ap;
+ /* This assignment is valid. */
+ ap = &array10;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-7.c
new file mode 100644
index 000000000..6168562ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-7.c
@@ -0,0 +1,23 @@
+/* Test for multiple declarations and composite types. Diagnosis of
+ completion incompatible with implicit initializer. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+int x[];
+
+void
+f (void)
+{
+ extern int x[2]; /* { dg-error "completed incompatibly" } */
+}
+
+/* The following is OK. */
+
+int y[];
+void
+g (void)
+{
+ extern int y[1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-8.c
new file mode 100644
index 000000000..9145b9fdd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-8.c
@@ -0,0 +1,23 @@
+/* Test for multiple declarations and composite types. Diagnosis of
+ completion incompatible with implicit initializer. */
+
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+static int x[];
+
+void
+f (void)
+{
+ extern int x[2]; /* { dg-error "completed incompatibly" } */
+}
+
+/* The following is OK. */
+
+static int y[];
+void
+g (void)
+{
+ extern int y[1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/redecl-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-9.c
new file mode 100644
index 000000000..6fe25800e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/redecl-9.c
@@ -0,0 +1,30 @@
+/* Test for multiple declarations and composite types, as in bug
+ 13801. Test types saved from outer scopes are up to date. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int x[];
+
+void
+f (void)
+{
+ extern int x[];
+}
+
+int x[10];
+
+void
+g (void)
+{
+ int x;
+ {
+ extern int x[10];
+ }
+}
+
+void
+h (void)
+{
+ sizeof (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/reg-vol-struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/reg-vol-struct-1.c
new file mode 100644
index 000000000..b885f9179
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/reg-vol-struct-1.c
@@ -0,0 +1,18 @@
+/* Test cases of structures with volatile fields declared register:
+ should be allowed unless register name given but explicitly taking
+ the address forbidden. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+
+/* { dg-do compile } */
+
+struct S { volatile int field; };
+
+void
+f (void)
+{
+ register struct S a;
+ register struct S b[2];
+ register struct S c __asm__("nosuchreg"); /* { dg-error "object with volatile field" "explicit reg name" } */
+ &a; /* { dg-error "address of register" "explicit address" } */
+ b; /* { dg-error "address of register" "implicit address" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/register-var-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/register-var-1.c
new file mode 100644
index 000000000..e36f49974
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/register-var-1.c
@@ -0,0 +1,14 @@
+/* PR/18160 */
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+
+/* This should yield an error even without -pedantic. */
+/* { dg-options "-ansi" } */
+
+void g(int *);
+
+void f(void)
+{
+ register int x __asm ("eax");
+ g(&x); /* { dg-error "address of register variable" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/register-var-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/register-var-2.c
new file mode 100644
index 000000000..01816d5f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/register-var-2.c
@@ -0,0 +1,14 @@
+/* PR/18160 */
+
+/* { dg-do compile } */
+
+/* This should yield an error even without -pedantic. */
+/* { dg-options "-ansi" } */
+
+void g(int *);
+
+void f(void)
+{
+ register int x;
+ g(&x); /* { dg-error "address of register variable" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/register-var-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/register-var-3.c
new file mode 100644
index 000000000..dc659f57f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/register-var-3.c
@@ -0,0 +1,9 @@
+/* { dg-options "" } */
+/* { dg-do compile } */
+register int r0; /* { dg-error "register name not specified" } */
+register int bp; /* { dg-error "register name not specified" } */
+register int sp; /* { dg-error "register name not specified" } */
+register int r30; /* { dg-error "register name not specified" } */
+register int toc; /* { dg-error "register name not specified" } */
+register int d0; /* { dg-error "register name not specified" } */
+register int a0; /* { dg-error "register name not specified" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/return-type-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/return-type-1.c
new file mode 100644
index 000000000..2507cafa5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/return-type-1.c
@@ -0,0 +1,9 @@
+/* Missing warning for falling off the end of a non-void function.
+ egcs-1.1.2 passes, egcs-ss-19990428 fails.
+ http://gcc.gnu.org/ml/gcc-bugs/1999-03n/msg00221.html */
+/* { dg-do compile } */
+/* { dg-options "-O -Wreturn-type" } */
+int
+foo(void)
+{
+} /* { dg-warning "control reaches end of non-void function" "warning for falling off end of non-void function" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/return-type-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/return-type-2.c
new file mode 100644
index 000000000..183c6a88d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/return-type-2.c
@@ -0,0 +1,47 @@
+/* Bogus warnings claiming we fall off the end of a non-void function.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/27/2000. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wreturn-type" } */
+
+extern void abort (void) __attribute__ ((__noreturn__));
+
+int
+foo1 (int i)
+{
+ if (i)
+ return i;
+
+ abort ();
+} /* { dg-bogus "control reaches end of non-void function" "warning for falling off end of non-void function" } */
+
+__inline__ int
+foo2 (int i)
+{
+ if (i)
+ return i;
+
+ abort ();
+} /* { dg-bogus "control reaches end of non-void function" "warning for falling off end of non-void function" } */
+
+static int
+foo3 (int i)
+{
+ if (i)
+ return i;
+
+ abort ();
+} /* { dg-bogus "control reaches end of non-void function" "warning for falling off end of non-void function" } */
+
+static __inline__ int
+foo4 (int i)
+{
+ if (i)
+ return i;
+
+ abort ();
+} /* { dg-bogus "control reaches end of non-void function" "warning for falling off end of non-void function" } */
+
+int bar (int i)
+{
+ return foo1 (i) + foo2 (i) + foo3 (i) + foo4 (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/return-type-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/return-type-3.c
new file mode 100644
index 000000000..e06ba7c02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/return-type-3.c
@@ -0,0 +1,14 @@
+/* PR optimization/7189
+ This was a missing warning caused by a cfg cleanup after sibling
+ call optimization. The return clobber insn was cleaned up and
+ the warning was never issued. */
+/* { dg-do compile } */
+/* { dg-options "-O -foptimize-sibling-calls -Wreturn-type" } */
+
+extern void foo(void);
+
+int
+bar (void)
+{
+ foo();
+} /* { dg-warning "control reaches end of non-void function" "warning for falling off end of non-void function" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/section1.c b/gcc-4.9/gcc/testsuite/gcc.dg/section1.c
new file mode 100644
index 000000000..e907f193b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/section1.c
@@ -0,0 +1,5 @@
+/* PR optimization/6871 */
+/* Constant variables belong in .rodata, not .bss. */
+/* { dg-final { scan-assembler-not "\.bss" } } */
+
+const int i = 0;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-1.c
new file mode 100644
index 000000000..2e22b662a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-1.c
@@ -0,0 +1,109 @@
+/* Test for sequence point warnings. */
+/* Origin: Michael Meeks in
+ <URL:http://gcc.gnu.org/ml/gcc-patches/1998-06/msg00316.html>,
+ adapted to a testcase by Joseph Myers <jsm28@cam.ac.uk>. */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+struct s
+{
+ int a;
+};
+
+extern int fn (int);
+extern int fnb (int, int);
+extern int fnc (int *);
+extern int sprintf (char *, const char *, ...);
+
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+void
+foo (int a, int b, int n, int p, int *ptr, struct s *sptr,
+ int *ap, int *bp, int **cp, char *ans, int (*fnp[8])(int))
+{
+ int len;
+
+ a = a++; /* { dg-warning "undefined" "sequence point warning" } */
+ a = --a; /* { dg-warning "undefined" "sequence point warning" } */
+ a = ++a + b; /* { dg-warning "undefined" "sequence point warning" } */
+ a = a-- + b; /* { dg-warning "undefined" "sequence point warning" } */
+ ap[n] = bp[n++]; /* { dg-warning "undefined" "sequence point warning" } */
+ ap[--n] = bp[n]; /* { dg-warning "undefined" "sequence point warning" } */
+ ap[++n] = bp[--n]; /* { dg-warning "undefined" "sequence point warning" } */
+ cp[n][n] = cp[n][n]++; /* { dg-warning "undefined" "sequence point warning" } */
+ cp[n][p] = cp[n][n++]; /* { dg-warning "undefined" "sequence point warning" } */
+ *ptr++ = (uintptr_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */
+ sptr->a = sptr->a++; /* { dg-warning "undefined" "sequence point warning" } */
+ sptr->a = (uintptr_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */
+ *ptr++ = fn (*ptr); /* { dg-warning "undefined" "sequence point warning" } */
+ a = b = a++; /* { dg-warning "undefined" "sequence point warning" } */
+ b = a = --b; /* { dg-warning "undefined" "sequence point warning" } */
+ a = 1 + (a = 1); /* { dg-warning "undefined" "sequence point warning" } */
+ a = (a = b); /* { dg-warning "undefined" "sequence point warning" } */
+ a = (a = b) + 1; /* { dg-warning "undefined" "sequence point warning" } */
+ a = (bp[a++] = b) + 1; /* { dg-warning "undefined" "sequence point warning" } */
+ a = b++ * b++; /* { dg-warning "undefined" "sequence point warning" } */
+ a = fnb (b++, b++); /* { dg-warning "undefined" "sequence point warning" } */
+ a = (*fnp[b++]) (b++); /* { dg-warning "undefined" "sequence point warning" } */
+ a = (*fnp[b]) (b++); /* { dg-warning "undefined" "sequence point warning" } */
+ a = (*fnp[b++]) (b); /* { dg-warning "undefined" "sequence point warning" } */
+ *ap = fnc (ap++); /* { dg-warning "undefined" "sequence point warning" } */
+ (a += b) + (a += n); /* { dg-warning "undefined" "sequence point warning" } */
+ a = (b, b++) + (b++, b); /* { dg-warning "undefined" "sequence point warning" } */
+ ap[a++] += a; /* { dg-warning "undefined" "sequence point warning" } */
+ ap[a+=1] += a; /* { dg-warning "undefined" "sequence point warning" } */
+ ap[a++] += a++; /* { dg-warning "undefined" "sequence point warning" } */
+ ap[a+=1] += a++; /* { dg-warning "undefined" "sequence point warning" } */
+ a = a++, b = a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = a, a = a++; /* { dg-warning "undefined" "sequence point warning" } */
+ a = (b++ ? n : a) + b; /* { dg-warning "undefined" "sequence point warning" } */
+ b ? a = a++ : a; /* { dg-warning "undefined" "sequence point warning" } */
+ b && (a = a++); /* { dg-warning "undefined" "sequence point warning" } */
+ (a = a++) && b; /* { dg-warning "undefined" "sequence point warning" } */
+ b, (a = a++); /* { dg-warning "undefined" "sequence point warning" } */
+ (a = a++), b; /* { dg-warning "undefined" "sequence point warning" } */
+ a ^= b ^= a ^= b; /* { dg-warning "undefined" "sequence point warning" } */
+
+ a = a; /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = ! (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = - (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = (double) (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ len = sprintf (ans, "%d", len++); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = fn (a++); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ b++, (b + b); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ (a = b++), (a = b++); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = (b++, b++); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = b++ && b++; /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = b++ || b++; /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = (b++ ? b++ : a); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ a = (b++ ? a : b++); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ ap[a++] += bp[b]; /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ ap[a += 1] += 1; /* { dg-bogus "undefined" "bogus sequence point warning" } */
+ *ptr < 128 ? *ptr++ : *(ptr += 2); /* { dg-bogus "undefined" "bogus sequence point warning" } */
+
+ /* The following will be represented internally with a tree consisting of
+ many duplicated SAVE_EXPRs. This caused the previous version of the
+ sequence point warning code to fail by running out of virtual memory. */
+ a = ((b & 1 ? 21 : 0)
+ | (b & 2 ? 22 : 0)
+ | (b & 3 ? 23 : 0)
+ | (b & 4 ? 24 : 0)
+ | (b & 5 ? 25 : 0)
+ | (b & 6 ? 26 : 0)
+ | (b & 7 ? 27 : 0)
+ | (b & 8 ? 28 : 0)
+ | (b & 9 ? 29 : 0)
+ | (b & 10 ? 30 : 0)
+ | (b & 11 ? 31 : 0)
+ | (b & 12 ? 32 : 0)
+ | (b & 13 ? 1 : 0)
+ | (b & 14 ? 2 : 0)
+ | (b & 15 ? 3 : 0)
+ | (b & 16 ? 4 : 0)
+ | (b & 17 ? 5 : 0)
+ | (b & 18 ? 6 : 0)
+ | (b & 19 ? 7 : 0)
+ | (b & 20 ? 8 : 0)
+ | (b & 21 ? 9 : 0));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-2.c
new file mode 100644
index 000000000..9a4b618ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-2.c
@@ -0,0 +1,46 @@
+/* More sequence point warning tests */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+struct s { struct s *nxt; int v; } q;
+
+int x[10];
+
+int foo(int *p)
+{
+ int i = 0;
+
+ /* Test general-lvalue sequence point warnings */
+ (*p) = (*p)++; /* { dg-warning "undefined" "sequence point warning" } */
+ p[3] = p[3]++; /* { dg-warning "undefined" "sequence point warning" } */
+ p[i] = p[i]++; /* { dg-warning "undefined" "sequence point warning" } */
+ x[3] = x[3]++; /* { dg-warning "undefined" "sequence point warning" } */
+ q.nxt->nxt->v = q.nxt->nxt->v++; /* { dg-warning "undefined" "sequence point warning" } */
+
+ /* test expressions that appear elsewhere in the C grammar */
+
+ { int a = i-i++; (void)a;} /* { dg-warning "undefined" "sequence point warning" } */
+
+ if ((i-i++) != 0) /* { dg-warning "undefined" "sequence point warning" } */
+ return i-i++; /* { dg-warning "undefined" "sequence point warning" } */
+
+ for (i-i++;;) /* { dg-warning "undefined" "sequence point warning" } */
+ ;
+
+ for (; (i-i++) != 0; ) /* { dg-warning "undefined" "sequence point warning" } */
+ ;
+
+ for (;;i-i++) /* { dg-warning "undefined" "sequence point warning" } */
+ ;
+
+ while ((i-i++) != 0) /* { dg-warning "undefined" "sequence point warning" } */
+ ;
+
+ do {} while ((i-i++) != 0); /* { dg-warning "undefined" "sequence point warning" } */
+
+ switch (i-i++) { /* { dg-warning "undefined" "sequence point warning" } */
+ case 0: return 1;
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-3.c
new file mode 100644
index 000000000..58971ca18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-3.c
@@ -0,0 +1,15 @@
+/* More sequence point warning tests */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+void bar(int i, int j)
+{
+ return;
+}
+
+void foo (int i)
+{
+ int a = i-i++; (void)a; /* { dg-warning "undefined" "sequence point warning" } */
+
+ bar (i--, i++); /* { dg-warning "undefined" "sequence point warning" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-pr17880.c b/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-pr17880.c
new file mode 100644
index 000000000..df706e577
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sequence-pt-pr17880.c
@@ -0,0 +1,54 @@
+/* PR 17880 */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+int
+foo (int x)
+{
+ unsigned int a;
+ int b;
+
+ b = (a += 5) > a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = (a += 5) + a == 10; /* { dg-warning "undefined" "sequence point warning" } */
+ b = (a -= 5) > a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = (a -= 5) + a == 10; /* { dg-warning "undefined" "sequence point warning" } */
+ b = a-- > a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = a-- + a == 10; /* { dg-warning "undefined" "sequence point warning" } */
+ b = ++a > a; /* { dg-warning "undefined" "sequence point warning" } */
+ b = ++a + a == 10; /* { dg-warning "undefined" "sequence point warning" } */
+
+ if ((a += 5) > a) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if ((a += 5) + a == 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if ((a -= 5) > a) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if ((a -= 5) + a == 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if (a-- > a) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if (a-- + a == 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if (++a > a) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ if (++a + a == 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
+ do {} while ((a += 5) > a); /* { dg-warning "undefined" "sequence point warning" } */
+ while ((a += 5) > a); /* { dg-warning "undefined" "sequence point warning" } */
+ for ((a += 5) > a;;); /* { dg-warning "undefined" "sequence point warning" } */
+ for (b = (a += 5) > a;;); /* { dg-warning "undefined" "sequence point warning" } */
+ for (; (a += 5) > a;); /* { dg-warning "undefined" "sequence point warning" } */
+ for (;; b = (a += 5) > a); /* { dg-warning "undefined" "sequence point warning" } */
+ for (;; a++ + a++); /* { dg-warning "undefined" "sequence point warning" } */
+ if (a) a++ - a--; /* { dg-warning "undefined" "sequence point warning" } */
+ ((a +=5) > a) ? a : b; /* { dg-warning "undefined" "sequence point warning" } */
+ return (a++ - a--); /* { dg-warning "undefined" "sequence point warning" } */
+}
+
+void bar (int i)
+{
+ int a = i++ - i++; /* { dg-warning "undefined" "sequence point warning" } */
+}
+
+void baz (int i)
+{
+ switch (i++ + i++) /* { dg-warning "undefined" "sequence point warning" } */
+ {
+ case 1:
+ i++ - i++; /* { dg-warning "undefined" "sequence point warning" } */
+ case 2:
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-1.c
new file mode 100644
index 000000000..b5c84fc87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-1.c
@@ -0,0 +1,36 @@
+/* Test for bogus "variable `x' may be clobbered by longjmp" warnings.
+ Inspired by cse.c:simplify_relational_operation. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -Wclobbered -Wextra -Wall" } */
+
+#include <setjmp.h>
+
+extern void set_float_handler (jmp_buf *);
+
+#define EQ 0x01
+#define LT 0x02
+#define GT 0x04
+
+int
+compare_float (double a, double b) /* { dg-bogus "clobbered" "spurious clobbered warning" } */
+{
+ jmp_buf handler;
+ int result;
+
+ a += 1.0;
+
+ if (setjmp (handler))
+ {
+ set_float_handler (0);
+ return 0;
+ }
+
+ set_float_handler (&handler);
+ if (a == b) result = EQ;
+ else if (a > b) result = LT;
+ else if (a < b) result = GT;
+ else result = 0;
+ set_float_handler (0);
+ return result;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-2.c
new file mode 100644
index 000000000..bd35a2567
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-2.c
@@ -0,0 +1,48 @@
+/* PR middle-end/17813 */
+/* Origin: Tom Hughes <tom@compton.nu> */
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
+/* { dg-options "-O -fomit-frame-pointer" } */
+/* { dg-options "-O -fomit-frame-pointer -march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#include <setjmp.h>
+#include <signal.h>
+#include <stdlib.h>
+
+static jmp_buf segv_jmpbuf;
+
+static void segv_handler(int seg)
+{
+ __builtin_longjmp(segv_jmpbuf, 1);
+}
+
+static int is_addressable(void *p, size_t size)
+{
+ volatile char * volatile cp = (volatile char *)p;
+ volatile int ret;
+ struct sigaction sa, origsa;
+ sigset_t mask;
+
+ sa.sa_handler = segv_handler;
+ sa.sa_flags = 0;
+ sigfillset(&sa.sa_mask);
+ sigaction(SIGSEGV, &sa, &origsa);
+ sigprocmask(SIG_SETMASK, NULL, &mask);
+
+ if (__builtin_setjmp(segv_jmpbuf) == 0) {
+ while(size--)
+ *cp++;
+ ret = 1;
+ } else
+ ret = 0;
+
+ sigaction(SIGSEGV, &origsa, NULL);
+ sigprocmask(SIG_SETMASK, &mask, NULL);
+
+ return ret;
+}
+
+int main(int argc, char **argv)
+{
+ is_addressable(0x0, 1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-3.c
new file mode 100644
index 000000000..306861d25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-3.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+
+#include <setjmp.h>
+
+extern void abort (void);
+
+jmp_buf buf;
+
+void raise0(void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int execute(int cmd)
+{
+ int last = 0;
+
+ if (__builtin_setjmp (buf) == 0)
+ while (1)
+ {
+ last = 1;
+ raise0 ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-4.c
new file mode 100644
index 000000000..53bf0e872
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-4.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+
+#include <setjmp.h>
+
+extern void abort (void);
+
+jmp_buf buf;
+
+void raise0(void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int execute(int cmd)
+{
+ int last = 0;
+
+ __builtin_setjmp (buf);
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise0 ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-5.c
new file mode 100644
index 000000000..c6e5f9317
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/setjmp-5.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+#include <setjmp.h>
+
+void bar (int);
+
+jmp_buf buf;
+int v;
+
+void
+foo (void)
+{
+ int i;
+ bar (0);
+ bar (1);
+ i = 5;
+ int j = setjmp (buf);
+ if (j == 0)
+ bar (2);
+ v = i; /* { dg-bogus "may be used uninitialized in this function" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/short-compare-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/short-compare-1.c
new file mode 100644
index 000000000..b5e01c1c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/short-compare-1.c
@@ -0,0 +1,20 @@
+/* PR rtl-optimization/19296 */
+/* Origin: Falk Hueffner <falk@debian.org> */
+
+/* { dg-do run } */
+/* { dg-options "-O" } */
+/* { dg-options "-O -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern void abort(void);
+
+void f(unsigned short ad)
+{
+ if (ad >= 0x4000 && ad < 0xc000)
+ abort();
+}
+
+int main(void)
+{
+ f(0xff00);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/short-compare-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/short-compare-2.c
new file mode 100644
index 000000000..bf4e6b4ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/short-compare-2.c
@@ -0,0 +1,21 @@
+/* PR rtl-optimization/19296 */
+/* Origin: Falk Hueffner <falk@debian.org> */
+/* Testcase by Andrew Pinski <pinskia@gcc.gnu.org> */
+
+/* { dg-do run } */
+/* { dg-options "-O" } */
+/* { dg-options "-O -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern void abort();
+
+void f(unsigned short ad)
+{
+ if ((short) (ad - 0x4000) >= 0)
+ abort();
+}
+
+int main(void)
+{
+ f(0xc000);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c b/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c
new file mode 100644
index 000000000..fbe6f4fd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+int *p;
+
+void
+test (int a)
+{
+ if (a > 0)
+ p = __builtin_alloca (4);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-pretend.c b/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-pretend.c
new file mode 100644
index 000000000..6e20ca12e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-pretend.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#define DEBUG_BUFFER_SIZE 80
+int unifi_debug = 5;
+
+void
+unifi_trace (void* ospriv, int level, const char *fmt, ...)
+{
+ static char s[DEBUG_BUFFER_SIZE];
+ va_list args;
+ unsigned int len;
+
+ if (!ospriv)
+ return;
+
+ if (unifi_debug >= level)
+ {
+ va_start (args, fmt);
+ len = vsnprintf (&(s)[0], (DEBUG_BUFFER_SIZE), fmt, args);
+ va_end (args);
+
+ if (len >= DEBUG_BUFFER_SIZE)
+ {
+ (s)[DEBUG_BUFFER_SIZE - 2] = '\n';
+ (s)[DEBUG_BUFFER_SIZE - 1] = 0;
+ }
+
+ printf ("%s", s);
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-sibcall.c b/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-sibcall.c
new file mode 100644
index 000000000..193bec2ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/shrink-wrap-sibcall.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+unsigned char a, b, d, f, g;
+
+int test (void);
+
+int
+baz (int c)
+{
+ if (c == 0) return test ();
+ if (b & 1)
+ {
+ g = 0;
+ int e = (a & 0x0f) - (g & 0x0f);
+
+ if (!a) b |= 0x80;
+ a = e + test ();
+ f = g/5 + a*3879 + b *2985;
+ }
+ else
+ {
+ f = g + a*39879 + b *25;
+ }
+ return test ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-1.c
new file mode 100644
index 000000000..e8a95513d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-1.c
@@ -0,0 +1,49 @@
+/* Simple check that sibling calls are performed from a
+ void non-leaf-function taking one int argument calling itself.
+
+ Copyright (C) 2002 Free Software Foundation Inc.
+ Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -foptimize-sibling-calls" } */
+
+/* The option -foptimize-sibling-calls is the default, but serves as
+ marker. Self-recursion tail calls are optimized for all targets,
+ regardless of presence of sibcall patterns. */
+
+extern void abort (void);
+extern void exit (int);
+
+extern void recurser_void (int);
+extern void track (int);
+
+int main ()
+{
+ recurser_void (0);
+ exit (0);
+}
+
+void
+recurser_void (int n)
+{
+ if (n == 0 || n == 7)
+ track (n);
+
+ if (n == 10)
+ return;
+
+ recurser_void (n + 1);
+}
+
+void *trackpoint;
+
+void __attribute__ ((noinline))
+track (int n)
+{
+ char stackpos[1];
+
+ if (n == 0)
+ trackpoint = stackpos;
+ else if (n != 7 || trackpoint != stackpos)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-2.c
new file mode 100644
index 000000000..a626273e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-2.c
@@ -0,0 +1,50 @@
+/* Simple check that sibling calls are performed from a
+ void non-leaf-function taking no arguments calling itself.
+
+ Copyright (C) 2002 Free Software Foundation Inc.
+ Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -foptimize-sibling-calls" } */
+
+/* The option -foptimize-sibling-calls is the default, but serves as
+ marker. Self-recursion tail calls are optimized for all targets,
+ regardless of presence of sibcall patterns. */
+
+extern void abort (void);
+extern void exit (int);
+
+extern void recurser_void (void);
+extern void track (void);
+
+int n = 0;
+int main ()
+{
+ recurser_void ();
+ exit (0);
+}
+
+void
+recurser_void (void)
+{
+ if (n == 0 || n == 7)
+ track ();
+
+ if (n == 10)
+ return;
+ n++;
+ recurser_void ();
+}
+
+void *trackpoint;
+
+void __attribute__ ((noinline))
+track ()
+{
+ char stackpos[1];
+
+ if (n == 0)
+ trackpoint = stackpos;
+ else if (n != 7 || trackpoint != stackpos)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-3.c
new file mode 100644
index 000000000..e02a410e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-3.c
@@ -0,0 +1,78 @@
+/* Simple check that sibling calls are performed from a
+ void non-leaf-function taking one int argument calling a function which
+ is about the same as itself.
+
+ Copyright (C) 2002 Free Software Foundation Inc.
+ Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
+
+/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
+/* -mlongcall disables sibcall patterns. */
+/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
+/* { dg-options "-O2 -foptimize-sibling-calls" } */
+
+/* The option -foptimize-sibling-calls is the default, but serves as
+ marker. This test is xfailed on targets without sibcall patterns
+ (except targets where the test does not work due to the return address
+ not saved on the regular stack). */
+
+extern void abort (void);
+extern void exit (int);
+
+/* Sibcalls are not supported in MIPS16 mode, which has direct calls but
+ not direct jumps. */
+#ifdef __mips
+#define ATTR __attribute__((nomips16))
+#else
+#define ATTR
+#endif
+
+static ATTR void recurser_void1 (int);
+static ATTR void recurser_void2 (int);
+extern void track (int);
+
+int main ()
+{
+ recurser_void1 (0);
+ exit (0);
+}
+
+/* The functions should get the same stack-frame, and best way to make it
+ reasonably sure is to make them have the same contents (regarding the
+ n tests). */
+
+static void __attribute__((noinline)) ATTR
+recurser_void1 (int n)
+{
+ if (n == 0 || n == 7 || n == 8)
+ track (n);
+
+ if (n == 10)
+ return;
+
+ recurser_void2 (n + 1);
+}
+
+static void __attribute__((noinline)) ATTR
+recurser_void2 (int n)
+{
+ if (n == 0 || n == 7 || n == 8)
+ track (n);
+
+ if (n == 10)
+ return;
+
+ recurser_void1 (n + 1);
+}
+
+void *trackpoint;
+
+void __attribute__ ((noinline))
+track (int n)
+{
+ char stackpos[1];
+
+ if (n == 0)
+ trackpoint = stackpos;
+ else if ((n != 7 && n != 8) || trackpoint != stackpos)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-4.c
new file mode 100644
index 000000000..a66ed0798
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-4.c
@@ -0,0 +1,79 @@
+/* Simple check that sibling calls are performed from a
+ void non-leaf-function taking no arguments calling a function which
+ is about the same as itself.
+
+ Copyright (C) 2002 Free Software Foundation Inc.
+ Contributed by Hans-Peter Nilsson <hp@bitrange.com> */
+
+/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */
+/* -mlongcall disables sibcall patterns. */
+/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
+/* { dg-options "-O2 -foptimize-sibling-calls" } */
+
+/* The option -foptimize-sibling-calls is the default, but serves as
+ marker. This test is xfailed on targets without sibcall patterns
+ (except targets where the test does not work due to the return address
+ not saved on the regular stack). */
+
+extern void abort (void);
+extern void exit (int);
+
+/* Sibcalls are not supported in MIPS16 mode, which has direct calls but
+ not direct jumps. */
+#ifdef __mips
+#define ATTR __attribute__((nomips16))
+#else
+#define ATTR
+#endif
+
+static ATTR void recurser_void1 (void);
+static ATTR void recurser_void2 (void);
+extern void track (void);
+
+int n = 0;
+int main ()
+{
+ recurser_void1 ();
+ exit (0);
+}
+
+/* The functions should get the same stack-frame, and best way to make it
+ reasonably sure is to make them have the same contents (regarding the
+ n tests). */
+
+static void __attribute__((noinline)) ATTR
+recurser_void1 (void)
+{
+ if (n == 0 || n == 7 || n == 8)
+ track ();
+
+ if (n == 10)
+ return;
+ n++;
+ recurser_void2 ();
+}
+
+static void __attribute__((noinline)) ATTR
+recurser_void2 (void)
+{
+ if (n == 0 || n == 7 || n == 8)
+ track ();
+
+ if (n == 10)
+ return;
+ n++;
+ recurser_void1 ();
+}
+
+void *trackpoint;
+
+void __attribute__ ((noinline))
+track ()
+{
+ char stackpos[1];
+
+ if (n == 0)
+ trackpoint = stackpos;
+ else if ((n != 7 && n != 8) || trackpoint != stackpos)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-6.c
new file mode 100644
index 000000000..744bf4698
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-6.c
@@ -0,0 +1,46 @@
+/* A simple check to see whether indirect calls are
+ being sibcall optimized on targets that do support
+ this notion, i.e. have the according call patterns
+ in place.
+
+ Copyright (C) 2002 Free Software Foundation Inc.
+ Contributed by Andreas Bauer <baueran@in.tum.de> */
+
+/* { dg-do run { target epiphany-*-* i?86-*-* x86_64-*-* s390*-*-* } } */
+/* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! nonpic } } } { "*" } { "" } } */
+/* { dg-options "-O2 -foptimize-sibling-calls -fno-ipa-cp" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int foo (int);
+int bar (int);
+
+int (*ptr) (int);
+int *f_addr;
+
+int
+main ()
+{
+ ptr = bar;
+ foo (7);
+ exit (0);
+}
+
+int __attribute__ ((noinline))
+bar (b)
+ int b;
+{
+ if (f_addr == (int*) __builtin_return_address (0))
+ return b;
+ else
+ abort ();
+}
+
+int __attribute__ ((noinline))
+foo (f)
+ int f;
+{
+ f_addr = (int*) __builtin_return_address (0);
+ return (*ptr)(f);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-7.c
new file mode 100644
index 000000000..6d59ca339
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-7.c
@@ -0,0 +1,46 @@
+/* Simple check that tail recursive call optimization is also
+ controlled by -foptimize-sibling-calls.
+
+ Copyright (C) 2006 Free Software Foundation Inc.
+ Original test by Hans-Peter Nilsson <hp@bitrange.com> */
+
+/* On IA64 the call frame is allocated on the register stack, not the
+ normal stack. */
+
+/* { dg-do run { target { ! "ia64-*-*" } } } */
+/* { dg-options "-O2 -fno-optimize-sibling-calls" } */
+
+
+extern void abort (void);
+
+extern void recurser_void (int);
+extern void track (int);
+
+int main (void)
+{
+ recurser_void (0);
+ return 0;
+}
+
+void recurser_void (int n)
+{
+ if (n == 0 || n == 7)
+ track (n);
+
+ if (n == 10)
+ return;
+
+ recurser_void (n + 1);
+}
+
+void *trackpoint;
+
+void track (int n)
+{
+ char stackpos[1];
+
+ if (n == 0)
+ trackpoint = stackpos;
+ else if (n != 7 || trackpoint == stackpos)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-8.c
new file mode 100644
index 000000000..767040fd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sibcall-8.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -foptimize-sibling-calls" } */
+
+typedef struct {
+ int data[4];
+} arr16_t;
+
+int result = 0;
+
+void func2(int i, int j, arr16_t arr)
+{
+ result = (arr.data[0] != 1
+ || arr.data[1] != 2
+ || arr.data[2] != 3
+ || arr.data[3] != 4);
+}
+
+void func1(int i, int j, int k, arr16_t a)
+{
+ func2(i, j, a);
+}
+
+int main(int argc, const char *argv[])
+{
+ arr16_t arr = {{1, 2, 3, 4}};
+
+ func1(0, 0, 0, arr);
+ return result;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simd-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/simd-1.c
new file mode 100644
index 000000000..e00e1dd69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simd-1.c
@@ -0,0 +1,62 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Origin: Aldy Hernandez <aldyh@redhat.com>. */
+/* Purpose: Program to test generic SIMD support. */
+
+typedef int __attribute__((vector_size (16))) v4si;
+typedef short __attribute__((vector_size (16))) v8hi;
+typedef int __attribute__((vector_size (8))) v2si;
+typedef unsigned int __attribute__((vector_size (16))) uv4si;
+
+v4si a, b;
+v2si c, d;
+v8hi e;
+uv4si f;
+
+long long foo;
+int foo1;
+short foo2 __attribute__((vector_size (8)));
+
+void
+hanneke ()
+{
+ /* Assignment. */
+ a = b;
+
+ /* Assignment of different types. */
+ b = c; /* { dg-error "incompatible types when assigning" } */
+ d = a; /* { dg-error "incompatible types when assigning" } */
+
+ /* Casting between SIMDs of the same size. */
+ e = (typeof (e)) a;
+
+ /* Different signed SIMD assignment. */
+ f = a; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
+ /* { dg-error "incompatible types when assigning" "" { target *-*-* } 35 } */
+
+ /* Casted different signed SIMD assignment. */
+ f = (uv4si) a;
+
+ /* Assignment between scalar and SIMD of different size. */
+ foo = a; /* { dg-error "incompatible types when assigning" } */
+
+ /* Casted assignment between scalar and SIMD of same size. */
+ foo = (typeof (foo)) foo2;
+
+ /* Casted assignment between scalar and SIMD of different size. */
+ foo1 = (typeof (foo1)) foo2; /* { dg-error "can't convert between vector values of different size" } */
+
+ /* Operators on compatible SIMD types. */
+ a += b + b;
+ a -= b;
+ a *= b;
+ a /= b;
+ a = -b;
+
+ /* Operators on incompatible SIMD types. */
+ a = b + c; /* { dg-error "invalid operands to binary +" } */
+ a = b - c; /* { dg-error "invalid operands to binary -" } */
+ a = b * c; /* { dg-error "invalid operands to binary *" } */
+ a = b / c; /* { dg-error "invalid operands to binary /" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simd-1b.c b/gcc-4.9/gcc/testsuite/gcc.dg/simd-1b.c
new file mode 100644
index 000000000..44c39c2ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simd-1b.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Origin: Aldy Hernandez <aldyh@redhat.com>. */
+/* Purpose: Program to test generic SIMD support. */
+
+typedef int __attribute__((vector_size (16))) v4si;
+typedef int __attribute__((vector_size (8))) v2si;
+
+v4si a, b;
+v2si c, d;
+
+void
+hanneke ()
+{
+ /* Operators on compatible SIMD types. */
+ a %= b;
+ c &= d;
+ a |= b;
+ c ^= d;
+ a >>= b;
+ c <<= d;
+ a = +b;
+ c = ~d;
+
+ /* Operators on incompatible SIMD types. */
+ a = b % c; /* { dg-error "invalid operands to binary" } */
+ a = b % c; /* { dg-error "invalid operands to binary" } */
+ d = c & b; /* { dg-error "invalid operands to binary" } */
+ a = b | c; /* { dg-error "invalid operands to binary" } */
+ d = c ^ b; /* { dg-error "invalid operands to binary" } */
+ a = b >> c; /* { dg-error "invalid operands to binary" } */
+ a = b >> c; /* { dg-error "invalid operands to binary" } */
+ d = c << b; /* { dg-error "invalid operands to binary" } */
+ d = c << b; /* { dg-error "invalid operands to binary" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simd-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/simd-2.c
new file mode 100644
index 000000000..13e1caba6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simd-2.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Origin: Aldy Hernandez <aldyh@redhat.com>. */
+/* Purpose: Program to test generic SIMD support. */
+
+typedef float __attribute__((vector_size(8))) v2sf;
+typedef float __attribute__((vector_size(16))) v4sf;
+typedef double __attribute__((vector_size(16))) v2df;
+
+v4sf a, b;
+v2sf c, d;
+v2df e;
+
+double foo;
+float foo1;
+v2sf foo2;
+
+void
+hanneke ()
+{
+ /* Assignment. */
+ a = b;
+
+ /* Assignment of different types. */
+ b = c; /* { dg-error "incompatible types when assigning" } */
+ d = a; /* { dg-error "incompatible types when assigning" } */
+
+ /* Casting between SIMDs of the same size. */
+ e = (typeof (e)) a;
+
+ /* Assignment between scalar and SIMD of different size. */
+ foo = a; /* { dg-error "incompatible types when assigning" } */
+
+ /* Casted assignment between scalar and SIMD of same size. */
+ foo = (typeof (foo)) foo2; /* { dg-error "aggregate value used where a float was expected" } */
+
+ /* Casted assignment between scalar and SIMD of different size. */
+ foo1 = (typeof (foo1)) foo2; /* { dg-error "aggregate value used where a float was expected" } */
+
+ /* Operators on compatible SIMD types. */
+ a += b + b;
+ a -= b;
+ a *= b;
+ a /= b;
+ a = +b;
+ c = -d;
+
+ /* Operators on incompatible SIMD types. */
+ a = b + c; /* { dg-error "invalid operands to binary" } */
+ a = b - c; /* { dg-error "invalid operands to binary" } */
+ a = b * c; /* { dg-error "invalid operands to binary" } */
+ a = b / c; /* { dg-error "invalid operands to binary" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simd-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/simd-3.c
new file mode 100644
index 000000000..790b1e51e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simd-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-maltivec" { target { powerpc*-*-* && powerpc_altivec_ok } } } */
+
+__attribute__ ((vector_size (2))) signed char v1, v2, v3;
+void
+one (void)
+{
+ v1 = v2 + v3;
+}
+
+__attribute__ ((vector_size (8))) signed char v4, v5, v6;
+void
+two (void)
+{
+ v4 = v5 + v6;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simd-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/simd-4.c
new file mode 100644
index 000000000..f7b28d452
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simd-4.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+typedef int myint;
+
+float __attribute__((vector_size(16))) b;
+int __attribute__((vector_size(16))) d;
+myint __attribute__((vector_size(16))) d2;
+unsigned int __attribute__((vector_size(16))) e;
+
+void foo()
+{
+ b + d; /* { dg-error "invalid operands to binary" } */
+ d += e;
+ d2 += d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simd-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/simd-5.c
new file mode 100644
index 000000000..cb0ecf898
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simd-5.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu89" } */
+
+/* Ensure that we don't need a typedef to initialize a vector type. */
+#define vector __attribute__ ((vector_size (8)))
+vector char x = (vector char) {1,2,3,4,5,6,7,8}; /* { dg-bogus "initializer" } */
+vector char y = (vector short) {1,2,3,4}; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
+ /* { dg-error "incompatible types when initializing" "" { target *-*-* } 7 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simd-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/simd-6.c
new file mode 100644
index 000000000..969697994
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simd-6.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99" } */
+
+/* Ensure that we don't need a typedef to initialize a vector type. */
+#define vector __attribute__ ((vector_size (8)))
+vector char x = (vector char) {1,2,3,4,5,6,7,8}; /* { dg-bogus "initializer" } */
+vector char y = (vector short) {1,2,3,4}; /* { dg-message "note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
+ /* { dg-error "incompatible types when initializing" "" { target *-*-* } 7 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/README b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/README
new file mode 100644
index 000000000..5588e04d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/README
@@ -0,0 +1,118 @@
+OVERVIEW
+--------
+
+This is a harness to test the atomicity of certain operations, and to
+make sure the compiler does not introduce data races in a
+multi-threaded environment.
+
+The basic premise is that we set up testcases such that the thing we
+want test, say an atomic instruction which stores a double word is in
+a function of its own. We then run this testcase within GDB,
+controlled by a gdb script (simulate-thread.gdb). The gdb script will
+break on the function to be tested, and then single step through every
+machine instruction in the function. We set this up so GDB can make a
+couple of inferior function calls before and after each of these
+single step instructions for a couple of purposes:
+
+ 1. One of the calls simulates another thread running in the
+ process which changes or access memory.
+
+ 2. The other calls are used to verify that we always get the
+ expected behavior.
+
+For example, in the case of an atomic store, anyone looking at the
+memory associated with an atomic variable should never see any in
+between states. If you have an atomic long long int, and it starts
+with the value 0, and you write the value MAX_LONG_LONG, any other
+thread looking at that variable should never see anything other than 0
+or MAX_LONG_LONG. If you implement the atomic write as a sequence of
+2 stores, it is possible for another thread to read the location after
+the first store, but before the second one is complete. That thread
+would then see an in-between state (one word would still be 0).
+
+We simulate this in the testcase by having GDB step through the
+program, instruction by instruction, and after each step, making an
+inferior function call which looks at the value of the atomic variable
+and verifies that it sees either 0 or MAX_LONG_LONG. If it sees any
+other value, it fails the testcase.
+
+This way, we are *sure* there is no in between state because we
+effectively acted like an OS and switched to another thread after
+every single instruction of the routine is executed and looked at the
+results each time.
+
+We use the same idea to test for data races to see if an illegal load
+has been hoisted, or that two parallel bitfield writes don't overlap
+in a data race.
+
+Below is a skeleton of how a test should look like. For more details,
+look at the tests themselves.
+
+ANATOMY OF A TEST
+-----------------
+
+/* { dg-do link } */
+/* { dg-options "-some-flags" } */
+/* { dg-final { simulate-thread } } */
+
+/* NOTE: Any failure must be indicated by displaying "FAIL:". */
+
+#include "simulate-thread.h"
+
+/* Called before each instruction, simulating another thread executing. */
+void simulate_thread_other_threads()
+{
+}
+
+/* Called after each instruction. Returns 1 if any inconsistency is
+ found, 0 otherwise. */
+int simulate_thread_step_verify()
+{
+ if (some_problem)
+ {
+ printf("FAIL: reason\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* Called at the end of the program (simulate_thread_fini == 1). Verifies
+ the state of the program and returns 1 if any inconsistency is
+ found, 0 otherwise. */
+int simulate_thread_final_verify()
+{
+ if (some_problem)
+ {
+ printf("FAIL: reason\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* The gdb script will break on simulate_thread_main(), so make sure
+ GCC does not inline it, thus making the break point fail. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ /* Do stuff. */
+}
+
+int main()
+{
+
+ /* Perform any setup code that will run outside of the testing
+ harness. Put code here that you do NOT want to be interrupted on
+ an instruction basis. E.g., setup code, and system library
+ calls. */
+
+ /* Do un-instrumented stuff. */
+ /* ... */
+
+ /* Start the instrumented show. */
+ simulate_thread_main();
+
+ /* Must be called at the end of the test. */
+ simulate_thread_done();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c
new file mode 100644
index 000000000..d03e83181
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int.c
@@ -0,0 +1,116 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+
+/* Testing load for atomicity is a little trickier.
+
+ Set up the atomic value so that it changes value after every instruction
+ is executed.
+
+ Simply alternating between 2 values wouldn't be sufficient since a load of
+ one part, followed by the load of the second part 2 instructions later would
+ appear to be valid.
+
+ set up a table of 16 values which change a bit in every byte of the value
+ each time, this will give us a 16 instruction cycle before repetition
+ kicks in, which should be sufficient to detect any issues. Just to be sure,
+ we also change the table cycle size during execution.
+
+ The end result is that all loads should always get one of the values from
+ the table. Any other pattern means the load failed. */
+
+unsigned int ret;
+unsigned int value = 0;
+unsigned int result = 0;
+unsigned int table[16] = {
+0x00000000,
+0x11111111,
+0x22222222,
+0x33333333,
+0x44444444,
+0x55555555,
+0x66666666,
+0x77777777,
+0x88888888,
+0x99999999,
+0xAAAAAAAA,
+0xBBBBBBBB,
+0xCCCCCCCC,
+0xDDDDDDDD,
+0xEEEEEEEE,
+0xFFFFFFFF
+};
+
+int table_cycle_size = 16;
+
+/* Return 0 if 'result' is a valid value to have loaded. */
+int verify_result ()
+{
+ int x;
+ int found = 0;
+
+ /* Check entire table for valid values. */
+ for (x = 0; x < 16 ; x++)
+ if (result == table[x])
+ {
+ found = 1;
+ break;
+ }
+
+ if (!found)
+ printf("FAIL: Invalid result returned from fetch\n");
+
+ return !found;
+}
+
+/* Iterate VALUE through the different valid values. */
+void simulate_thread_other_threads ()
+{
+ static int current = 0;
+
+ if (++current >= table_cycle_size)
+ current = 0;
+ value = table[current];
+}
+
+int simulate_thread_step_verify ()
+{
+ return verify_result ();
+}
+
+int simulate_thread_final_verify ()
+{
+ return verify_result ();
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int x;
+
+ /* Execute loads with value changing at various cyclic values. */
+ for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
+ {
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ /* In order to verify the returned value (which is not atomic), it needs
+ to be atomically stored into another variable and check that. */
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute the fetch/store a couple of times just to ensure the cycles
+ have a chance to be interesting. */
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+ }
+}
+
+main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c
new file mode 100644
index 000000000..651e76a95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-int128.c
@@ -0,0 +1,133 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_int_128_runtime } */
+/* { dg-options "-mcx16" { target { x86_64-*-* i?86-*-* } } } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+
+/* Testing load for atomicity is a little trickier.
+
+ Set up the atomic value so that it changes value after every instruction
+ is executed.
+
+ Simply alternating between 2 values wouldn't be sufficient since a load of
+ one part, followed by the load of the second part 2 instructions later would
+ appear to be valid.
+
+ set up a table of 16 values which change a bit in every byte of the value
+ each time, this will give us a 16 instruction cycle before repetition
+ kicks in, which should be sufficient to detect any issues. Just to be sure,
+ we also change the table cycle size during execution.
+
+ The end result is that all loads should always get one of the values from
+ the table. Any other pattern means the load failed. */
+
+__int128_t ret;
+__int128_t value = 0;
+__int128_t result = 0;
+__int128_t table[16] = {
+0x0000000000000000,
+0x1111111111111111,
+0x2222222222222222,
+0x3333333333333333,
+0x4444444444444444,
+0x5555555555555555,
+0x6666666666666666,
+0x7777777777777777,
+0x8888888888888888,
+0x9999999999999999,
+0xAAAAAAAAAAAAAAAA,
+0xBBBBBBBBBBBBBBBB,
+0xCCCCCCCCCCCCCCCC,
+0xDDDDDDDDDDDDDDDD,
+0xEEEEEEEEEEEEEEEE,
+0xFFFFFFFFFFFFFFFF
+};
+
+int table_cycle_size = 16;
+
+/* Since we don't have 128 bit constants, we have to properly pad the table. */
+void fill_table()
+{
+ int x;
+ for (x = 0; x < 16; x++)
+ {
+ ret = table[x];
+ ret = (ret << 64) | ret;
+ table[x] = ret;
+ }
+}
+
+/* Return 0 if 'result' is a valid value to have loaded. */
+int verify_result ()
+{
+ int x;
+ int found = 0;
+
+ /* Check entire table for valid values. */
+ for (x = 0; x < 16; x++)
+ if (result == table[x])
+ {
+ found = 1;
+ break;
+ }
+
+ if (!found)
+ printf("FAIL: Invalid result returned from fetch\n");
+
+ return !found;
+}
+
+/* Iterate VALUE through the different valid values. */
+void simulate_thread_other_threads ()
+{
+ static int current = 0;
+
+ if (++current >= table_cycle_size)
+ current = 0;
+ value = table[current];
+}
+
+int simulate_thread_step_verify ()
+{
+ return verify_result ();
+}
+
+int simulate_thread_final_verify ()
+{
+ return verify_result ();
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int x;
+
+ /* Execute loads with value changing at various cyclic values. */
+ for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
+ {
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ /* In order to verify the returned value (which is not atomic), it needs
+ to be atomically stored into another variable and check that. */
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute the fetch/store a couple of times just to ensure the cycles
+ have a chance to be interesting. */
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+ }
+}
+
+main()
+{
+ fill_table ();
+
+ /* Make sure value starts with an atomic value from the table. */
+ __atomic_store_n (&value, table[0], __ATOMIC_SEQ_CST);
+
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-longlong.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-longlong.c
new file mode 100644
index 000000000..91f9a0627
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-longlong.c
@@ -0,0 +1,118 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+
+/* Testing load for atomicity is a little trickier.
+
+ Set up the atomic value so that it changes value after every instruction
+ is executed.
+
+ Simply alternating between 2 values wouldn't be sufficient since a load of
+ one part, followed by the load of the second part 2 instructions later would
+ appear to be valid.
+
+ set up a table of 16 values which change a bit in every byte of the value
+ each time, this will give us a 16 instruction cycle before repetition
+ kicks in, which should be sufficient to detect any issues. Just to be sure,
+ we also change the table cycle size during execution.
+
+ The end result is that all loads should always get one of the values from
+ the table. Any other pattern means the load failed. */
+
+unsigned long long ret;
+unsigned long long value = 0;
+unsigned long long result = 0;
+unsigned long long table[16] = {
+0x0000000000000000,
+0x1111111111111111,
+0x2222222222222222,
+0x3333333333333333,
+0x4444444444444444,
+0x5555555555555555,
+0x6666666666666666,
+0x7777777777777777,
+0x8888888888888888,
+0x9999999999999999,
+0xAAAAAAAAAAAAAAAA,
+0xBBBBBBBBBBBBBBBB,
+0xCCCCCCCCCCCCCCCC,
+0xDDDDDDDDDDDDDDDD,
+0xEEEEEEEEEEEEEEEE,
+0xFFFFFFFFFFFFFFFF
+};
+
+int table_cycle_size = 16;
+
+/* Return 0 if 'result' is a valid value to have loaded. */
+int verify_result ()
+{
+ int x;
+ int found = 0;
+
+ /* Check entire table for valid values. */
+ for (x = 0; x < 16 ; x++)
+ if (result == table[x])
+ {
+ found = 1;
+ break;
+ }
+
+ if (!found)
+ printf("FAIL: Invalid result returned from fetch\n");
+
+ return !found;
+}
+
+/* Iterate VALUE through the different valid values. */
+void simulate_thread_other_threads ()
+{
+ static int current = 0;
+
+ if (++current >= table_cycle_size)
+ current = 0;
+ value = table[current];
+}
+
+int simulate_thread_step_verify ()
+{
+ return verify_result ();
+}
+
+int simulate_thread_final_verify ()
+{
+ return verify_result ();
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int x;
+
+ /* Execute loads with value changing at various cyclic values. */
+ for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
+ {
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ /* In order to verify the returned value (which is not atomic), it needs
+ to be atomically stored into another variable and check that. */
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute the fetch/store a couple of times just to ensure the cycles
+ have a chance to be interesting. */
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+ }
+}
+
+main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-short.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-short.c
new file mode 100644
index 000000000..e7b54c46b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-load-short.c
@@ -0,0 +1,116 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+
+/* Testing load for atomicity is a little trickier.
+
+ Set up the atomic value so that it changes value after every instruction
+ is executed.
+
+ Simply alternating between 2 values wouldn't be sufficient since a load of
+ one part, followed by the load of the second part 2 instructions later would
+ appear to be valid.
+
+ set up a table of 16 values which change a bit in every byte of the value
+ each time, this will give us a 16 instruction cycle before repetition
+ kicks in, which should be sufficient to detect any issues. Just to be sure,
+ we also change the table cycle size during execution.
+
+ The end result is that all loads should always get one of the values from
+ the table. Any other pattern means the load failed. */
+
+unsigned short ret;
+unsigned short value = 0;
+unsigned short result = 0;
+unsigned short table[16] = {
+0x0000,
+0x1111,
+0x2222,
+0x3333,
+0x4444,
+0x5555,
+0x6666,
+0x7777,
+0x8888,
+0x9999,
+0xAAAA,
+0xBBBB,
+0xCCCC,
+0xDDDD,
+0xEEEE,
+0xFFFF
+};
+
+int table_cycle_size = 16;
+
+/* Return 0 if 'result' is a valid value to have loaded. */
+int verify_result ()
+{
+ int x;
+ int found = 0;
+
+ /* Check entire table for valid values. */
+ for (x = 0; x < 16 ; x++)
+ if (result == table[x])
+ {
+ found = 1;
+ break;
+ }
+
+ if (!found)
+ printf("FAIL: Invalid result returned from fetch\n");
+
+ return !found;
+}
+
+/* Iterate VALUE through the different valid values. */
+void simulate_thread_other_threads ()
+{
+ static int current = 0;
+
+ if (++current >= table_cycle_size)
+ current = 0;
+ value = table[current];
+}
+
+int simulate_thread_step_verify ()
+{
+ return verify_result ();
+}
+
+int simulate_thread_final_verify ()
+{
+ return verify_result ();
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int x;
+
+ /* Execute loads with value changing at various cyclic values. */
+ for (table_cycle_size = 16; table_cycle_size > 4 ; table_cycle_size--)
+ {
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ /* In order to verify the returned value (which is not atomic), it needs
+ to be atomically stored into another variable and check that. */
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+
+ /* Execute the fetch/store a couple of times just to ensure the cycles
+ have a chance to be interesting. */
+ ret = __atomic_load_n (&value, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&result, ret, __ATOMIC_SEQ_CST);
+ }
+}
+
+main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int.c
new file mode 100644
index 000000000..990310c0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int.c
@@ -0,0 +1,118 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_int_long } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* Test all the __sync routines for proper atomicity on 4 byte values. */
+
+unsigned int zero = 0;
+unsigned int max = ~0;
+
+unsigned int changing_value = 0;
+unsigned int value = 0;
+unsigned int ret;
+
+void test_abort()
+{
+ static int reported = 0;
+ if (!reported)
+ {
+ printf ("FAIL: improper execution of __sync builtin.\n");
+ reported = 1;
+ }
+}
+
+void simulate_thread_other_threads ()
+{
+}
+
+int simulate_thread_step_verify ()
+{
+ if (value != zero && value != max)
+ {
+ printf ("FAIL: invalid intermediate result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (value != 0)
+ {
+ printf ("FAIL: invalid final result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* All values written to 'value' alternate between 'zero' and
+ 'max'. Any other value detected by simulate_thread_step_verify()
+ between instructions would indicate that the value was only
+ partially written, and would thus fail this atomicity test.
+
+ This function tests each different __atomic routine once, with
+ the exception of the load instruction which requires special
+ testing. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+
+ ret = __atomic_exchange_n (&value, max, __ATOMIC_SEQ_CST);
+ if (ret != zero || value != max)
+ test_abort();
+
+ __atomic_store_n (&value, zero, __ATOMIC_SEQ_CST);
+ if (value != zero)
+ test_abort();
+
+ ret = __atomic_fetch_add (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_sub (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_or (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_and (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_xor (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_add_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_sub_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+
+ ret = __atomic_or_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_and_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_xor_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+}
+
+main ()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c
new file mode 100644
index 000000000..6aaaa88ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-int128.c
@@ -0,0 +1,116 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_int_128_runtime } */
+/* { dg-options "-mcx16" { target { x86_64-*-* i?86-*-* } } } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* Test all the __sync routines for proper atomicity on 16 byte values. */
+
+__int128_t zero = 0;
+__int128_t max = ~0;
+__int128_t changing_value = 0;
+__int128_t value = 0;
+__int128_t ret;
+
+void test_abort()
+{
+ static int reported = 0;
+ if (!reported)
+ {
+ printf ("FAIL: improper execution of __sync builtin.\n");
+ reported = 1;
+ }
+}
+
+void simulate_thread_other_threads ()
+{
+}
+
+int simulate_thread_step_verify ()
+{
+ if (value != zero && value != max)
+ {
+ printf ("FAIL: invalid intermediate result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (value != 0)
+ {
+ printf ("FAIL: invalid final result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* All values written to 'value' alternate between 'zero' and 'max'. Any other
+ value detected by simulate_thread_step_verify() between instructions would indicate
+ that the value was only partially written, and would thus fail this
+ atomicity test.
+
+ This function tests each different __atomic routine once, with the
+ exception of the load instruction which requires special testing. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+
+ ret = __atomic_exchange_n (&value, max, __ATOMIC_SEQ_CST);
+ if (ret != zero || value != max)
+ test_abort();
+
+ __atomic_store_n (&value, zero, __ATOMIC_SEQ_CST);
+ if (value != zero)
+ test_abort();
+
+ ret = __atomic_fetch_add (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_sub (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_or (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_and (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_xor (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_add_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_sub_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+
+ ret = __atomic_or_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_and_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_xor_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+}
+
+int main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-longlong.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-longlong.c
new file mode 100644
index 000000000..087c4660c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-longlong.c
@@ -0,0 +1,118 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_long_long_runtime } */
+/* { dg-options "" } */
+/* { dg-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* Test all the __sync routines for proper atomicity on 8 byte values. */
+
+unsigned long long zero = 0;
+unsigned long long max = ~0;
+
+unsigned long long changing_value = 0;
+unsigned long long value = 0;
+unsigned long long ret;
+
+void test_abort()
+{
+ static int reported = 0;
+ if (!reported)
+ {
+ printf ("FAIL: improper execution of __sync builtin.\n");
+ reported = 1;
+ }
+}
+
+void simulate_thread_other_threads ()
+{
+}
+
+int simulate_thread_step_verify ()
+{
+ if (value != zero && value != max)
+ {
+ printf ("FAIL: invalid intermediate result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (value != 0)
+ {
+ printf ("FAIL: invalid final result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* All values written to 'value' alternate between 'zero' and 'max'. Any other
+ value detected by simulate_thread_step_verify() between instructions would indicate
+ that the value was only partially written, and would thus fail this
+ atomicity test.
+
+ This function tests each different __atomic routine once, with the
+ exception of the load instruction which requires special testing. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ ret = __atomic_exchange_n (&value, max, __ATOMIC_SEQ_CST);
+ if (ret != zero || value != max)
+ test_abort();
+
+ __atomic_store_n (&value, zero, __ATOMIC_SEQ_CST);
+ if (value != zero)
+ test_abort();
+
+ ret = __atomic_fetch_add (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_sub (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_or (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_and (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_xor (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_add_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_sub_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+
+ ret = __atomic_or_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_and_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_xor_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+}
+
+int main ()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-short.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-short.c
new file mode 100644
index 000000000..d823e02fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/atomic-other-short.c
@@ -0,0 +1,117 @@
+/* { dg-do link } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-final { simulate-thread } } */
+
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* Test all the __sync routines for proper atomicity on 2 byte values. */
+
+unsigned short zero = 0;
+unsigned short max = ~0;
+
+unsigned short changing_value = 0;
+unsigned short value = 0;
+unsigned short ret;
+
+void test_abort()
+{
+ static int reported = 0;
+ if (!reported)
+ {
+ printf ("FAIL: improper execution of __sync builtin.\n");
+ reported = 1;
+ }
+}
+
+void simulate_thread_other_threads ()
+{
+}
+
+int simulate_thread_step_verify ()
+{
+ if (value != zero && value != max)
+ {
+ printf ("FAIL: invalid intermediate result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (value != 0)
+ {
+ printf ("FAIL: invalid final result for value.\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* All values written to 'value' alternate between 'zero' and
+ 'max'. Any other value detected by simulate_thread_step_verify()
+ between instructions would indicate that the value was only
+ partially written, and would thus fail this atomicity test.
+
+ This function tests each different __atomic routine once, with
+ the exception of the load instruction which requires special
+ testing. */
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ ret = __atomic_exchange_n (&value, max, __ATOMIC_SEQ_CST);
+ if (ret != zero || value != max)
+ test_abort();
+
+ __atomic_store_n (&value, zero, __ATOMIC_SEQ_CST);
+ if (value != zero)
+ test_abort();
+
+ ret = __atomic_fetch_add (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_sub (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_or (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != zero)
+ test_abort ();
+
+ ret = __atomic_fetch_and (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_fetch_xor (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != max)
+ test_abort ();
+
+ ret = __atomic_add_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_sub_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+
+ ret = __atomic_or_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_and_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != max || ret != max)
+ test_abort ();
+
+ ret = __atomic_xor_fetch (&value, max, __ATOMIC_SEQ_CST);
+ if (value != zero || ret != zero)
+ test_abort ();
+}
+
+int main ()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp
new file mode 100644
index 000000000..a4c2302d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.exp
@@ -0,0 +1,41 @@
+# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Your run of the mill dg test, but verify that we have a working GDB first.
+
+load_lib gcc-dg.exp
+load_lib gcc-simulate-thread.exp
+load_lib torture-options.exp
+
+if { [istarget "powerpc-ibm-aix*"] } {
+ set torture_execute_xfail "powerpc-ibm-aix*"
+ return
+}
+
+dg-init
+torture-init
+set-torture-options [list \
+ { -O0 -g } \
+ { -O2 -g } \
+ { -O3 -g } ]
+
+if [gdb-exists] {
+ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] ""
+ gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/simulate-thread/*.c]] ""
+}
+
+torture-finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb
new file mode 100644
index 000000000..93f60c345
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.gdb
@@ -0,0 +1,17 @@
+set height 0
+break simulate_thread_main
+# disp/i $pc
+run
+
+set $ret = 0
+while (simulate_thread_fini != 1) && (! $ret)
+ set $ret |= simulate_thread_wrapper_other_threads()
+ stepi
+ set $ret |= simulate_thread_step_verify()
+end
+
+if (! $ret)
+ set $ret |= simulate_thread_wrapper_final_verify()
+end
+continue
+quit $ret
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h
new file mode 100644
index 000000000..22c05084e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h
@@ -0,0 +1,131 @@
+int simulate_thread_fini = 0;
+
+void __attribute__((noinline))
+simulate_thread_done ()
+{
+ simulate_thread_fini = 1;
+}
+
+/* A hostile thread is one which changes a memory location so quickly
+ that another thread may never see the same value again. This is
+ simulated when simulate_thread_other_thread() is defined to modify
+ a memory location every cycle.
+
+ A process implementing a dependency on this value can run into
+ difficulties with such a hostile thread. For instance,
+ implementing an add with a compare_and_swap loop goes something
+ like:
+
+ expected = *mem;
+ loop:
+ new = expected += value;
+ if (!succeed (expected = compare_and_swap (mem, expected, new)))
+ goto loop;
+
+ If the content of 'mem' are changed every cycle by
+ simulate_thread_other_thread () this will become an infinite loop
+ since the value *mem will never be 'expected' by the time the
+ compare_and_swap is executed.
+
+ HOSTILE_THREAD_THRESHOLD defines the number of intructions which a
+ program will execute before triggering the hostile thread
+ pause. The pause will last for HOSTILE_THREAD_PAUSE instructions,
+ and then the counter will reset and begin again. During the pause
+ period, simulate_thread_other_thread will not be called.
+
+ This provides a chance for forward progress to be made and the
+ infinite loop to be avoided.
+
+ If the testcase defines HOSTILE_PAUSE_ERROR, then it will be
+ considered a RUNTIME FAILURE if the hostile pause is triggered.
+ This will allow to test for guaranteed forward progress routines.
+
+ If the default values for HOSTILE_THREAD_THRESHOLD or
+ HOSTILE_THREAD_PAUSE are insufficient, then the testcase may
+ override these by defining the values before including this file.
+
+ Most testcase are intended to run for very short periods of time,
+ so these defaults are considered to be high enough to not trigger
+ on a typical case, but not drag the test time out too much if a
+ hostile condition is interferring. */
+
+
+/* Define the threshold instruction count to start pausing the hostile
+ thread. To avoid huge potential log files when things are not going well,
+ set this number very low. If a test specifically requires that the forward
+ progress guarantee is made, this number should be raised by the testcase. */
+#if !defined (HOSTILE_THREAD_THRESHOLD)
+#define HOSTILE_THREAD_THRESHOLD 50
+#endif
+
+/* Define the length of pause in cycles for the hostile thread to pause to
+ allow forward progress to be made. If this number is too low, a
+ compare_and_swap loop may not have time to finish, especially on a
+ 128 bit operation. */
+#if !defined (HOSTILE_THREAD_PAUSE)
+#define HOSTILE_THREAD_PAUSE 20
+#endif
+
+/* Define the number of instructions which are allowed to be executed before
+ the testcase is deemed to fail. This is primarily to avoid huge log files
+ when a testcase goes into an infinte loop. */
+#if !defined (INSN_COUNT_THRESHOLD)
+#define INSN_COUNT_THRESHOLD 10000
+#endif
+
+void simulate_thread_other_threads (void);
+int simulate_thread_final_verify (void);
+
+static int simulate_thread_hostile_pause = 0;
+
+/* This function wraps simulate_thread_other_threads an monitors for
+ an infinite loop. If the threshold value HOSTILE_THREAD_THRESHOLD
+ is reached, the other_thread process is paused for
+ HOSTILE_THREAD_PAUSE cycles before resuming, and the counters start
+ again. */
+int
+simulate_thread_wrapper_other_threads()
+{
+ static int insn_count = 0;
+ static int hostile_count = 0;
+ static int hostile_pause = 0;
+
+ if (++insn_count >= INSN_COUNT_THRESHOLD)
+ {
+ printf ("FAIL: Testcase exceeded maximum instruction count threshold\n");
+ return 1;
+ }
+
+ if (++hostile_count >= HOSTILE_THREAD_THRESHOLD)
+ {
+ if (!simulate_thread_hostile_pause)
+ simulate_thread_hostile_pause = 1;
+
+ /* Count cycles before calling the hostile thread again. */
+ if (hostile_pause++ < HOSTILE_THREAD_PAUSE)
+ return 0;
+
+ /* Reset the pause counter, as well as the thread counter. */
+ hostile_pause = 0;
+ hostile_count = 0;
+ }
+ simulate_thread_other_threads ();
+ return 0;
+}
+
+
+/* If the test case defines HOSTILE_PAUSE_ERROR, then the test case
+ will fail execution if it had a hostile pause. */
+int
+simulate_thread_wrapper_final_verify ()
+{
+ int ret = simulate_thread_final_verify ();
+#if defined (HOSTILE_PAUSE_ERROR)
+ if (simulate_thread_hostile_pause)
+ {
+ printf ("FAIL: Forward progress made only by pausing hostile thread\n");
+ ret = ret | 1; /* 0 indicates proper comnpletion. */
+ }
+#endif
+ return ret;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-2.c
new file mode 100644
index 000000000..d4d28f5ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-2.c
@@ -0,0 +1,74 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-store-data-races=0 -O2" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "simulate-thread.h"
+
+/* Test that speculative stores do not happen for --param
+ allow-store-data-races=0. */
+
+int count, insns;
+
+struct obj {
+ int data;
+ struct obj *next;
+} *q;
+
+void simulate_thread_other_threads ()
+{
+ ++insns;
+ ++count;
+}
+
+int simulate_thread_step_verify ()
+{
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ /* If count != insns, someone must have cached `count' and stored a
+ racy value into it. */
+ if (count != insns)
+ {
+ printf("FAIL: count was incorrectly cached\n");
+ return 1;
+ }
+ return 0;
+}
+
+/* Test that `count' is not written to unless p->data > 0. */
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ struct obj *p;
+ for (p = q; p; p = p->next)
+ if (p->data > 0)
+ count++;
+}
+
+struct obj *
+insert(struct obj *head, int data)
+{
+ struct obj *t = (struct obj *) malloc (sizeof (struct obj));
+ t->next = head;
+ t->data = data;
+ return t;
+}
+
+int main()
+{
+ q = insert (0, 0);
+ q = insert (q, 0);
+ q = insert (q, 0);
+ q = insert (q, 0);
+ q = insert (q, 0);
+
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-3.c
new file mode 100644
index 000000000..203c02604
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-3.c
@@ -0,0 +1,71 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-store-data-races=0 -O2" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "simulate-thread.h"
+
+/* Test distilled from PR52558. */
+
+int g_1 = 1;
+int g_2 = 0, insns = 0;
+int f;
+
+/* Test that g_2 is not written to unless !g_1. */
+
+__attribute__((noinline))
+int funky()
+{
+ int l;
+ for (l = 0; l != 4; l++)
+ {
+ if (g_1)
+ {
+ /* g_1 is globally true so we should always execute here,
+ thus never writing to g_2 under any circumstance in this
+ code path. */
+ return l;
+ }
+ for (g_2 = 0; g_2 >= 26; ++g_2)
+ ;
+ }
+ return 999;
+}
+
+int simulate_thread_final_verify ()
+{
+ /* If g_2 != insns, someone must have cached `g_2' and stored a
+ racy value into it. */
+ if (g_2 != insns)
+ {
+ printf("FAIL: g_2 was incorrectly cached\n");
+ return 1;
+ }
+ return 0;
+}
+
+void simulate_thread_other_threads ()
+{
+ ++insns;
+ ++g_2;
+}
+
+int simulate_thread_step_verify ()
+{
+ return 0;
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ f = funky();
+}
+
+int main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-4.c
new file mode 100644
index 000000000..59f81b756
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store-4.c
@@ -0,0 +1,54 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "simulate-thread.h"
+
+/* PR 54139 */
+/* Test that speculative stores do not happen for --param
+ allow-store-data-races=0. */
+
+int g_13=1, insns=1;
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ int l_245;
+
+ /* Since g_13 is unilaterally set positive above, there should be
+ no store to g_13 below. */
+ for (l_245 = 0; l_245 <= 1; l_245 += 1)
+ for (; g_13 <= 0; g_13 = 1)
+ ;
+}
+
+int main()
+{
+ simulate_thread_main ();
+ simulate_thread_done ();
+ return 0;
+}
+
+void simulate_thread_other_threads ()
+{
+ ++g_13;
+ ++insns;
+}
+
+int simulate_thread_step_verify ()
+{
+ return 0;
+}
+
+int simulate_thread_final_verify ()
+{
+ if (g_13 != insns)
+ {
+ printf("FAIL: g_13 was incorrectly cached\n");
+ return 1;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c
new file mode 100644
index 000000000..ff9d71e08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/speculative-store.c
@@ -0,0 +1,58 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* This file tests that speculative store movement out of a loop doesn't
+ happen. This is disallowed when --param allow-store-data-races is 0. */
+
+int global = 100;
+
+/* Other thread makes sure global is 100 before the next instruction is
+ * exceuted. */
+void simulate_thread_other_threads()
+{
+ global = 100;
+}
+
+int simulate_thread_step_verify()
+{
+ if (global != 100)
+ {
+ printf("FAIL: global variable was assigned to. \n");
+ return 1;
+ }
+ return 0;
+}
+
+int simulate_thread_final_verify()
+{
+ return 0;
+}
+
+/* The variable global should never be assigned if func(0) is called.
+ This tests store movement out of loop thats never executed. */
+void test (int y)
+{
+ int x;
+ for (x=0; x< y; x++)
+ {
+ global = y; /* This should never speculatively execute. */
+ }
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ test(0);
+ simulate_thread_done();
+}
+
+__attribute__((noinline))
+int main()
+{
+ simulate_thread_main();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c
new file mode 100644
index 000000000..fdcd7f46a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/strict-align-global.c
@@ -0,0 +1,52 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-packed-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* This test verifies writes to globals do not write to adjacent
+ globals. This mostly happens on strict-align targets that are not
+ byte addressable (old Alphas, etc). */
+
+char a = 0;
+char b = 77;
+
+void simulate_thread_other_threads()
+{
+}
+
+int simulate_thread_step_verify()
+{
+ if (b != 77)
+ {
+ printf("FAIL: Unexpected value. <b> is %d, should be 77\n", b);
+ return 1;
+ }
+ return 0;
+}
+
+/* Verify that every variable has the correct value. */
+int simulate_thread_final_verify()
+{
+ int ret = simulate_thread_step_verify ();
+ if (a != 66)
+ {
+ printf("FAIL: Unexpected value. <a> is %d, should be 66\n", a);
+ return 1;
+ }
+ return ret;
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ a = 66;
+}
+
+int main ()
+{
+ simulate_thread_main();
+ simulate_thread_done();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/subfields.c b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/subfields.c
new file mode 100644
index 000000000..2d931176e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/simulate-thread/subfields.c
@@ -0,0 +1,93 @@
+/* { dg-do link } */
+/* { dg-options "--param allow-packed-store-data-races=0" } */
+/* { dg-final { simulate-thread } } */
+
+#include <stdio.h>
+#include "simulate-thread.h"
+
+/* This test verifies that data races aren't introduced by structure subfield
+ stores. */
+
+struct test_struct {
+ char a;
+ char b;
+ char c;
+ char d;
+} var = {0,0,0,0};
+
+
+/* This routine sets field a to 'x'. If executed properly, it will
+ not affect any of the other fields in the structure. An improper
+ implementation may load an entire word, change the 8 bits for field
+ 'a' and write the entire word back out. */
+__attribute__((noinline))
+void set_a(char x)
+{
+ var.a = x;
+}
+
+static int global = 0;
+
+/* The other thread increments the value of each of the other fields
+ in the structure every cycle. If the store to the 'a' field does
+ an incorrect full or partial word load, mask and store, it will
+ write back an incorrect value to one or more of the other
+ fields. */
+void simulate_thread_other_threads()
+{
+ global++;
+ var.b = global;
+ var.c = global;
+ var.d = global;
+}
+
+
+/* Make sure that none of the other fields have been changed. */
+int simulate_thread_step_verify()
+{
+ int ret = 0;
+ if (var.b != global)
+ {
+ printf("FAIL: Unexpected value. var.b is %d, should be %d\n",
+ var.b, global);
+ ret = 1;
+ }
+ if (var.c != global)
+ {
+ printf("FAIL: Unexpected value. var.c is %d, should be %d\n",
+ var.c, global);
+ ret = 1;
+ }
+ if (var.d != global)
+ {
+ printf("FAIL: Unexpected value. var.d is %d, should be %d\n",
+ var.d, global);
+ ret = 1;
+ }
+ return ret;
+}
+
+/* Verify that every variable has the correct value. */
+int simulate_thread_final_verify()
+{
+ int ret = simulate_thread_step_verify();
+ if (var.a != 1)
+ {
+ printf("FAIL: Unexpected value. var.a is %d, should be %d\n", var.a, 1);
+ ret = 1;
+ }
+ return ret;
+}
+
+__attribute__((noinline))
+void simulate_thread_main()
+{
+ set_a(1);
+}
+
+int main ()
+{
+ simulate_thread_main();
+ simulate_thread_done();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/single-precision-constant.c b/gcc-4.9/gcc/testsuite/gcc.dg/single-precision-constant.c
new file mode 100644
index 000000000..ffd893d93
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/single-precision-constant.c
@@ -0,0 +1,26 @@
+/* Test that double precision constants are correctly handled
+ when code is compiled with -fsingle-precision-constant */
+/* Origin: Carlos O'Donell <carlos@codesourcery.com> */
+
+/* { dg-do run } */
+/* { dg-options "-fsingle-precision-constant" } */
+/* { dg-add-options c99_runtime } */
+
+#include <math.h>
+#include <float.h>
+
+#include "builtins-config.h"
+
+int main (void)
+{
+ int result = 0;
+ double local_DBL_MAX = DBL_MAX;
+ double local_DBL_MIN = DBL_MIN;
+#ifdef HAVE_C99_RUNTIME
+ if (isinf (local_DBL_MAX))
+ result |= 1;
+#endif
+ if (local_DBL_MIN <= 0.0)
+ result |= 1;
+ return result;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sizeof-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/sizeof-1.c
new file mode 100644
index 000000000..9541a4c27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sizeof-1.c
@@ -0,0 +1,4 @@
+/* PR c/27718 */
+/* { dg-do compile } */
+
+int i = sizeof(struct A[]); /* { dg-error "incomplete" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sizeof-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/sizeof-2.c
new file mode 100644
index 000000000..018ed740a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sizeof-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+
+void foo()
+{
+ sizeof(,); /* { dg-error "expected expression before" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/slp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/slp-1.c
new file mode 100644
index 000000000..bb352020f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/slp-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model" } */
+
+struct R {
+ double d1;
+ double d2;
+};
+
+struct R foo (struct R arg)
+{
+ struct R ret;
+ ret.d1 = arg.d2 * (0.0 - arg.d1);
+ ret.d2 = ret.d1;
+ return ret;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/smod-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/smod-1.c
new file mode 100644
index 000000000..9a847a1d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/smod-1.c
@@ -0,0 +1,25 @@
+/* PR middle-end/18045 */
+/* Contributed by Eric Botcazou <ebotcazou@libertysurf.fr> */
+
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+/* { dg-options "-std=c99 -mtune=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#include <limits.h>
+
+extern void abort(void);
+
+long long smod16(long long x)
+{
+ return x % 16;
+}
+
+int main(void)
+{
+#if LLONG_MAX > 2147483647L
+ if (smod16 (0xFFFFFFFF) != 0xF)
+ abort ();
+#endif
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-1.c
new file mode 100644
index 000000000..26e502e2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-1.c
@@ -0,0 +1,45 @@
+/* The same test as loop-3c.c. It failed on ia64
+ due to not handling of subreg in the lhs that is fixed. */
+/* { dg-do run } */
+/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
+
+
+#include <limits.h>
+extern void abort (void);
+
+void * a[255];
+
+__attribute__ ((noinline))
+void
+f (m)
+{
+ int i;
+ int sh = 0x100;
+ i = m;
+ do
+ {
+ a[sh >>= 1] = ((unsigned)i << 3) + (char*)a;
+ i += 4;
+ }
+ while (i < INT_MAX/2 + 1 + 4 * 4);
+}
+
+int
+main ()
+{
+ a[0x10] = 0;
+ a[0x08] = 0;
+ f (INT_MAX/2 + INT_MAX/4 + 2);
+ if (a[0x10] || a[0x08])
+ abort ();
+ a[0x10] = 0;
+ a[0x08] = 0;
+ f (INT_MAX/2 + 1);
+ if (! a[0x10] || a[0x08])
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* spu-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-10.c
new file mode 100644
index 000000000..c1de07f16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-10.c
@@ -0,0 +1,119 @@
+ /* { dg-do run } */
+ /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
+
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+extern void free (void *);
+extern void abort (void);
+
+struct regstat_n_sets_and_refs_t
+{
+ int sets;
+ int refs;
+};
+
+struct regstat_n_sets_and_refs_t *regstat_n_sets_and_refs;
+
+struct df_reg_info
+{
+ unsigned int n_refs;
+};
+
+struct df_d
+{
+ struct df_reg_info **def_regs;
+ struct df_reg_info **use_regs;
+};
+struct df_d *df;
+
+static inline int
+REG_N_SETS (int regno)
+{
+ return regstat_n_sets_and_refs[regno].sets;
+}
+
+__attribute__ ((noinline))
+ int max_reg_num (void)
+{
+ return 100;
+}
+
+__attribute__ ((noinline))
+ void regstat_init_n_sets_and_refs (void)
+{
+ unsigned int i;
+ unsigned int max_regno = max_reg_num ();
+
+ for (i = 0; i < max_regno; i++)
+ {
+ (regstat_n_sets_and_refs[i].sets = (df->def_regs[(i)]->n_refs));
+ (regstat_n_sets_and_refs[i].refs =
+ (df->use_regs[(i)]->n_refs) + REG_N_SETS (i));
+ }
+}
+
+int a_sets[100] =
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
+};
+
+int a_refs[100] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38,
+ 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76,
+ 78, 80, 82,
+ 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116,
+ 118, 120,
+ 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150,
+ 152, 154, 156,
+ 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186,
+ 188, 190, 192,
+ 194, 196, 198
+};
+
+int
+main ()
+{
+ struct df_reg_info *b[100], *c[100];
+ struct df_d df1;
+ size_t s = sizeof (struct df_reg_info);
+ struct regstat_n_sets_and_refs_t a[100];
+
+ df = &df1;
+ regstat_n_sets_and_refs = a;
+ int i;
+
+ for (i = 0; i < 100; i++)
+ {
+ b[i] = (struct df_reg_info *) malloc (s);
+ b[i]->n_refs = i;
+ c[i] = (struct df_reg_info *) malloc (s);
+ c[i]->n_refs = i;
+ }
+
+ df1.def_regs = b;
+ df1.use_regs = c;
+ regstat_init_n_sets_and_refs ();
+
+ for (i = 0; i < 100; i++)
+ if ((a[i].sets != a_sets[i]) || (a[i].refs != a_refs[i]))
+ abort ();
+
+ for (i = 0; i < 100; i++)
+ {
+ free (b[i]);
+ free (c[i]);
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target powerpc*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-11.c
new file mode 100644
index 000000000..613459863
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-11.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
+
+extern void abort (void);
+
+float out[4][4] = { 6, 6, 7, 5, 6, 7, 5, 5, 6, 4, 4, 4, 6, 2, 3, 4 };
+
+void
+invert (void)
+{
+ int i, j, k = 0, swap;
+ float tmp[4][4] = { 5, 6, 7, 5, 6, 7, 5, 5, 4, 4, 4, 4, 3, 2, 3, 4 };
+
+ for (i = 0; i < 4; i++)
+ {
+ for (j = i + 1; j < 4; j++)
+ if (tmp[j][i] > tmp[i][i])
+ swap = j;
+
+ if (swap != i)
+ tmp[i][k] = tmp[swap][k];
+ }
+
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 4; j++)
+ if (tmp[i][j] != out[i][j])
+ abort ();
+}
+
+int
+main ()
+{
+ invert ();
+ return 0;
+}
+
+/* { dg-final { cleanup-rtl-dump "sms" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-2.c
new file mode 100644
index 000000000..897e5d4b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-2.c
@@ -0,0 +1,36 @@
+/* The same test as 921011-1.c. It can fails on gcc 4.1 due to a dfs
+ traversal of the loops after versioning. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms" } */
+
+int th, h, em, nlwm, nlwS, nlw, sy;
+void
+fun (nb)
+ int nb;
+{
+
+ while (nb--)
+ while (h--)
+ {
+ nlw = nlwm;
+ while (nlw)
+ {
+ if (nlwS == 1)
+ {
+ }
+ else
+ if (nlwS == 1)
+ {
+ }
+ nlwS--; nlw--;
+ }
+ if (em)
+ nlwS--;
+ if (++sy == th)
+ sy = 0;
+ }
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS loop many exits" 1 "sms" { target spu-*-* powerpc*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-3.c
new file mode 100644
index 000000000..d1d3b508f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-3.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fmodulo-sched -funroll-loops -fdump-rtl-sms --param sms-min-sc=1 -fmodulo-sched-allow-regmoves" } */
+
+extern void abort (void);
+
+int X[1000]={0};
+int Y[1000]={0};
+
+extern void abort (void);
+
+__attribute__ ((noinline))
+int
+foo (int len, long a)
+{
+ int i;
+ long res = a;
+
+ len = 1000;
+ for (i = 0; i < len; i++)
+ res += X[i]* Y[i];
+
+ if (res != 601)
+ abort ();
+
+}
+
+int
+main ()
+{
+ X[0] = Y[1] = 2;
+ Y[0] = X[1] = 21;
+ X[2] = Y[3] = 3;
+ Y[2] = X[3] = 31;
+ X[4] = Y[5] = 4;
+ Y[4] = X[5] = 41;
+
+ foo (6, 3);
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* powerpc*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-4.c
new file mode 100644
index 000000000..98132e0d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-4.c
@@ -0,0 +1,40 @@
+/* Inspired from bitmap_or_and function in sbitmap.c. */
+/* { dg-do run } */
+/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" } */
+/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms --param sms-min-sc=1" { target powerpc*-*-* } } */
+
+extern void abort (void);
+
+int a[5] = { 0, 1, 0, 0, 0 };
+int b[5] = { 0, 1, 0, 1, 0 };
+int c[5] = { 0, 0, 1, 1, 0 };
+int dst[5] = { 0, 0, 0, 0, 0 };
+
+__attribute__ ((noinline))
+void
+foo (int size, int *ap, int *bp, int *cp, int *dstp)
+{
+ unsigned int i, n = size;
+ int changed = 0;
+
+ for (i = 0; i < n; i++)
+ {
+ const int tmp = *ap++ | (*bp++ & *cp++);
+ changed |= *dstp ^ tmp;
+ *dstp++ = tmp;
+ }
+
+ if (changed == 0)
+ abort ();
+}
+
+int
+main ()
+{
+ foo (5, a, b, c, dst);
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* powerpc*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-5.c
new file mode 100644
index 000000000..7bc4c33a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-5.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -funroll-loops -fdump-rtl-sms --param sms-min-sc=1" } */
+/* This is the same test as loop-2e.c test. It is related to a fix in
+ the generation of the prolog and epilog. */
+
+extern void abort (void);
+
+__attribute__ ((noinline))
+void f (int *p, int **q)
+{
+ int i;
+ for (i = 0; i < 40; i++)
+ {
+ *q++ = &p[i];
+ }
+}
+
+int main ()
+{
+ void *p;
+ int *q[40];
+ __SIZE_TYPE__ start;
+
+ /* Find the signed middle of the address space. */
+ if (sizeof(start) == sizeof(int))
+ start = (__SIZE_TYPE__) __INT_MAX__;
+ else if (sizeof(start) == sizeof(long))
+ start = (__SIZE_TYPE__) __LONG_MAX__;
+ else if (sizeof(start) == sizeof(long long))
+ start = (__SIZE_TYPE__) __LONG_LONG_MAX__;
+ else
+ return 0;
+
+ /* Arbitrarily align the pointer. */
+ start &= -32;
+
+ /* Pretend that's good enough to start address arithmetic. */
+ p = (void *)start;
+
+ /* Verify that GIV replacement computes the correct results. */
+ q[39] = 0;
+ f (p, q);
+ if (q[39] != (int *)p + 39)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* } } } */
+
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-6.c
new file mode 100644
index 000000000..87d1a959a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-6.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-require-effective-target size32plus } */
+/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms --param sms-min-sc=1" } */
+/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms --param sms-min-sc=1 -fmodulo-sched-allow-regmoves" { target powerpc*-*-* } } */
+
+extern void abort (void);
+
+__attribute__ ((noinline))
+void foo (int * __restrict__ a, int * __restrict__ b, int * __restrict__ c)
+{
+ int i;
+ for(i = 0; i < 100; i+=4)
+ {
+ a[i] = b[i] * c[i];
+ a[i+1] = b[i+1] * c[i+1];
+ a[i+2] = b[i+2] * c[i+2];
+ a[i+3] = b[i+3] * c[i+3];
+ }
+}
+
+int a[100], b[100], c[100];
+
+int main()
+{
+ int i;
+ int res;
+
+ for(i = 0; i < 100; i++)
+ {
+ b[i] = c[i] = i;
+ }
+ foo(a, b, c);
+
+ res = 0;
+ for(i = 0; i < 100; i++)
+ {
+ res += a[i];
+ }
+ if(res != 328350)
+ abort();
+
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* } } } */
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 3 "sms" { target powerpc*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-7.c
new file mode 100644
index 000000000..f96530a26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-7.c
@@ -0,0 +1,49 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fmodulo-sched -fstrict-aliasing -fdump-rtl-sms -fmodulo-sched-allow-regmoves --param sms-min-sc=1" } */
+
+extern void abort (void);
+
+__attribute__ ((noinline))
+void foo (int * __restrict__ a, int * __restrict__ b, short * c)
+{
+ int i;
+ for(i = 0; i < 100; i+=4)
+ {
+ a[i] = b[i] * c[i];
+ a[i+1] = b[i+1] * c[i+1];
+ a[i+2] = b[i+2] * c[i+2];
+ a[i+3] = b[i+3] * c[i+3];
+ }
+}
+
+int a[100], b[100];
+short c[100];
+
+int main()
+{
+#if (__SIZEOF_INT__ <= 2)
+ int i;
+ long res;
+#else
+ int i, res;
+#endif
+ for(i = 0; i < 100; i++)
+ {
+ b[i] = c[i] = i;
+ }
+ foo(a, b, c);
+
+ res = 0;
+ for(i = 0; i < 100; i++)
+ {
+ res += a[i];
+ }
+ if(res != 328350)
+ abort();
+
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" { target spu-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-8.c
new file mode 100644
index 000000000..1cb6280aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-8.c
@@ -0,0 +1,42 @@
+/* This test is a reduced test case for a bug that caused
+ bootstrapping with -fmodulo-sched. Related to a broken anti-dep
+ that was not fixed by reg-moves. */
+
+ /* { dg-do run } */
+ /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms --param sms-min-sc=1" } */
+ /* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves -fdump-rtl-sms" { target powerpc*-*-* } } */
+
+extern void abort (void);
+
+__attribute__ ((noinline))
+unsigned long long
+foo (long long ixi, unsigned ctr)
+{
+ unsigned long long irslt = 1;
+ long long ix = ixi;
+
+ for (; ctr; ctr--)
+ {
+ irslt *= ix;
+ ix *= ix;
+ }
+
+ if (irslt != 14348907)
+ abort ();
+ return irslt;
+}
+
+
+int
+main ()
+{
+ unsigned long long res;
+
+ res = foo (3, 4);
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 0 "sms" { target powerpc*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sms-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/sms-9.c
new file mode 100644
index 000000000..c8dc28104
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sms-9.c
@@ -0,0 +1,60 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fmodulo-sched -fmodulo-sched-allow-regmoves" } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+
+struct df_ref_info
+{
+ unsigned int *begin;
+ unsigned int *count;
+};
+
+extern void *memset (void *s, int c, __SIZE_TYPE__ n);
+
+
+__attribute__ ((noinline))
+int
+df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
+ int num, unsigned int start)
+{
+ unsigned int m = num;
+ unsigned int offset = 77;
+ unsigned int r;
+
+ for (r = start; r < m; r++)
+ {
+ ref_info->begin[r] = offset;
+ offset += ref_info->count[r];
+ ref_info->count[r] = 0;
+ }
+
+ return offset;
+}
+
+int
+main ()
+{
+ struct df_ref_info temp;
+ int num = 100;
+ unsigned int start = 5;
+ int i, offset;
+
+ temp.begin = malloc (100 * sizeof (unsigned int));
+ temp.count = malloc (100 * sizeof (unsigned int));
+
+ memset (temp.begin, 0, sizeof (unsigned int) * num);
+ memset (temp.count, 0, sizeof (unsigned int) * num);
+
+ for (i = 0; i < num; i++)
+ temp.count[i] = i + 1;
+
+ offset = df_reorganize_refs_by_reg_by_insn (&temp, num, start);
+
+ if (offset != 5112)
+ abort ();
+
+ free (temp.begin);
+ free (temp.count);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/spec-options.c b/gcc-4.9/gcc/testsuite/gcc.dg/spec-options.c
new file mode 100644
index 000000000..1f9d8c1fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/spec-options.c
@@ -0,0 +1,17 @@
+/* Check that -mfoo is accepted if defined in a user spec
+ and that it is not passed on the command line. */
+/* Must be processed in EXTRA_SPECS to run. */
+/* { dg-do run { target sh*-*-* } } */
+/* { dg-do compile } */
+/* { dg-options "-B${srcdir}/gcc.dg --specs=foo.specs -tfoo" } */
+
+extern void abort(void);
+
+int main(void)
+{
+#ifdef FOO
+ return 0;
+#else
+ abort();
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/20000419-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/20000419-2.c
new file mode 100644
index 000000000..4a228eb1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/20000419-2.c
@@ -0,0 +1,18 @@
+/* A static function with a global alias should not get 'defined but
+ not used' warnings. Exposed by Linux kernel. */
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-Wall" } */
+
+extern void do_something (void);
+extern void do_something_else (void);
+
+static int
+init_foobar(void) /* { dg-bogus "defined but not used" "not used warning" } */
+{
+ do_something();
+ do_something_else();
+ return 0;
+}
+
+int init_module(void) __attribute__((alias("init_foobar")));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/alias-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/alias-1.c
new file mode 100644
index 000000000..6798c5be4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/alias-1.c
@@ -0,0 +1,18 @@
+/* { dg-do link } */
+/* { dg-require-alias "" } */
+
+#include <stdlib.h>
+
+extern int foo(void) __attribute__((alias("bar")));
+
+int bar(void) {
+ return 1;
+}
+
+int main(void) {
+
+ if (foo())
+ exit(0);
+ else
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/alias-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/alias-2.c
new file mode 100644
index 000000000..4cc8ce150
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/alias-2.c
@@ -0,0 +1,19 @@
+/* PR 3997 */
+/* { dg-do run } */
+/* { dg-require-alias "" } */
+
+extern void abort (void);
+extern void exit (int);
+
+void foo(void)
+{
+ exit(0);
+}
+
+static void bar(void) __attribute__((alias("foo")));
+
+int main()
+{
+ bar();
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/gcsec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/gcsec-1.c
new file mode 100644
index 000000000..ef1434fbe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/gcsec-1.c
@@ -0,0 +1,29 @@
+/* AIX gld supports garbage collection. But AIX gcc does not support
+ -ffunction-sections or -fdata-sections. */
+/* { dg-do run { xfail rs6000-*-aix* powerpc*-*-aix* } } */
+/* { dg-require-gc-sections "" } */
+
+/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections" } */
+/* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" { target static } } */
+
+#include <stdlib.h>
+
+static int unusedint=5;
+
+static int usedint=1;
+
+int unused(void) {
+ return 1;
+}
+
+int foo(void) {
+ return usedint;
+}
+
+int main(void) {
+
+ if (foo())
+ exit(0);
+ else
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/mips-abi.exp b/gcc-4.9/gcc/testsuite/gcc.dg/special/mips-abi.exp
new file mode 100644
index 000000000..0eba278c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/mips-abi.exp
@@ -0,0 +1,104 @@
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This test checks whether MIPS ELF configurations pass the right
+# ABI flags to the assembler. An ABI flag should always be passed
+# unless MEABI is selected.
+
+load_lib gcc-dg.exp
+
+# Only run this test on MIPS ELF targets
+if {![istarget mips*-*-*] || [gcc_target_object_format] != "elf"} {
+ return
+}
+
+# A list of all assembler ABI flags.
+set asm_abi_flags {-mabi=32 -mabi=n32 -mabi=64 -mabi=o64 -mabi=eabi}
+
+# Try to assemble mips-abi.s (an empty file), passing -v in order to
+# get the assembler command line. Check whether an appropriate ABI
+# flag is passed.
+#
+# NAME is a name for the pass/fail line.
+# ABIS is a list of acceptable assembler ABI flags, or "" if no
+# ABI flag is expected.
+# FLAGS is a list of options for gcc.
+proc check_mips_abi {name abis flags} {
+ global srcdir subdir
+
+ lappend flags "-v"
+ set lines [gcc_target_compile "$srcdir/$subdir/mips-abi.s" \
+ "mips-abi.o" object \
+ [list "additional_flags=$flags"]]
+ set good 0
+ set bad 0
+ foreach line [split $lines "\n"] {
+ # Find the assembler command line.
+ if {[string first "$srcdir/$subdir/mips-abi.s" $line] >= 0} {
+ foreach arg [split $line " "] {
+ # Count the number of matching and non-matching
+ # ABI options.
+ if {[lsearch -exact $abis $arg] >= 0} {
+ incr good
+ } elseif {[string match "-mabi=*" $arg]} {
+ incr bad
+ }
+ }
+ }
+ }
+ if {$good == ($abis != "") && $bad == 0} {
+ pass "mips-abi $name"
+ } else {
+ fail "mips-abi $name"
+ }
+}
+
+# Collect the default target flags.
+set default_flags ""
+set target [target_info name]
+if {[info exists CFLAGS_FOR_TARGET]} {
+ append default_flags " $CFLAGS_FOR_TARGET"
+}
+if {[board_info $target exists cflags]} {
+ append default_flags " [board_info $target cflags]"
+}
+if {[board_info $target exists multilib_flags]} {
+ append default_flags " [board_info $target multilib_flags]"
+}
+
+# See whether the default command line specifies an ABI.
+set default_abi ""
+foreach flag $default_flags {
+ if {[string match "-mabi=*" $flag]} {
+ set default_abi $flag
+ }
+}
+
+# If the command line does specify an ABI, just check for the
+# appropriate assembler flag.
+if {$default_abi != ""} {
+ check_mips_abi "command line" $default_abi ""
+} else {
+ # An ABI should be passed to the assembler by default.
+ # It doesn't seem worthwhile to duplicate the
+ # configuration to ABI logic here, so just accept any ABI.
+ check_mips_abi "default" $asm_abi_flags ""
+
+ # See whether passing a -mabi flag does the right thing.
+ foreach abi $asm_abi_flags {
+ check_mips_abi $abi $abi $abi
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/mips-abi.s b/gcc-4.9/gcc/testsuite/gcc.dg/special/mips-abi.s
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/mips-abi.s
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/special.exp b/gcc-4.9/gcc/testsuite/gcc.dg/special/special.exp
new file mode 100644
index 000000000..637f2a407
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/special.exp
@@ -0,0 +1,32 @@
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# jlarmour@redhat.com
+
+# This file was written by Jonathan Larmour (jlarmour@redhat.com).
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*\[1-9\].c]] \
+ "" ""
+dg-finish
+
+### EOF special.exp
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-1.c
new file mode 100644
index 000000000..175fb9c2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run { xfail { hppa*-*-hpux* && { ! lp64 } } } } */
+/* { dg-require-weak "" } */
+/* { dg-additional-sources weak-1a.c } */
+/* See PR target/23387 for hppa xfail details. */
+
+#include <stdlib.h>
+
+int foo(void) __attribute__((weak));
+
+int foo(void) {
+ return 0;
+}
+
+int main(void) {
+
+ if (foo())
+ exit(0);
+ else
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-1a.c
new file mode 100644
index 000000000..2a7dbba3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-1a.c
@@ -0,0 +1,3 @@
+int foo(void) {
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2.c
new file mode 100644
index 000000000..b93a8ef9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-require-weak "" } */
+/* { dg-additional-sources "weak-2a.c weak-2b.c" } */
+
+#include <stdlib.h>
+
+extern int foo(void);
+
+int main(void) {
+
+ if (foo())
+ exit(0);
+ else
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2a.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2a.c
new file mode 100644
index 000000000..52d3e08a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2a.c
@@ -0,0 +1,5 @@
+int foo(void) __attribute__((weak));
+
+int foo(void) {
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2b.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2b.c
new file mode 100644
index 000000000..2a7dbba3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/weak-2b.c
@@ -0,0 +1,3 @@
+int foo(void) {
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-1.c
new file mode 100644
index 000000000..9d97b8e12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-1.c
@@ -0,0 +1,19 @@
+/* { dg-do link } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+
+#include <stdlib.h>
+
+extern int foo(void) __attribute__((weak, alias("bar")));
+
+int bar(void) {
+ return 1;
+}
+
+int main(void) {
+
+ if (foo())
+ exit(0);
+ else
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2.c
new file mode 100644
index 000000000..c36024632
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+/* { dg-additional-sources "wkali-2a.c wkali-2b.c" } */
+
+#include <stdlib.h>
+
+extern int foo(void);
+
+int main(void) {
+
+ if (foo())
+ exit(0);
+ else
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2a.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2a.c
new file mode 100644
index 000000000..79dde1455
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2a.c
@@ -0,0 +1,7 @@
+/* { dg-do run } */
+
+extern int foo(void) __attribute__((weak, alias("bar_a")));
+
+int bar_a(void) {
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2b.c b/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2b.c
new file mode 100644
index 000000000..84f389e84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/special/wkali-2b.c
@@ -0,0 +1,7 @@
+/* { dg-do run } */
+
+extern int foo(void) __attribute__((alias("bar_b")));
+
+int bar_b(void) {
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/spill-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/spill-1.c
new file mode 100644
index 000000000..b85942e87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/spill-1.c
@@ -0,0 +1,15 @@
+/* This caused an ICE during register spilling when targeting thumb.
+ There are 8 registers available for arithmetic operations (r0-r7)
+ r7 is the frame pointer, and r0-r3 are used to pass arguments.
+ Combine was extending the lives of the arguments (in r0-r3) up until the
+ call to z. This leaves only 3 regs free which isn't enough to preform the
+ doubleword addition. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-omit-frame-pointer" } */
+void z(int);
+int foo(int a, int b, int c, int d, long long *q)
+{
+ *q=*q+1;
+ z (a+b+c+d);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/split-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/split-1.c
new file mode 100644
index 000000000..91fcb4aa5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/split-1.c
@@ -0,0 +1,49 @@
+/* This test needs to use setrlimit to set the stack size, so it can
+ only run on Unix. */
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-darwin* } } */
+/* { dg-require-effective-target split_stack } */
+/* { dg-options "-fsplit-stack" } */
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+
+/* Use a noinline function to ensure that the buffer is not removed
+ from the stack. */
+static void use_buffer (char *buf) __attribute__ ((noinline));
+static void
+use_buffer (char *buf)
+{
+ buf[0] = '\0';
+}
+
+/* Each recursive call uses 10,000 bytes. We call it 1000 times,
+ using a total of 10,000,000 bytes. If -fsplit-stack is not
+ working, that will overflow our stack limit. */
+
+static void
+down (int i)
+{
+ char buf[10000];
+
+ if (i > 0)
+ {
+ use_buffer (buf);
+ down (i - 1);
+ }
+}
+
+int
+main (void)
+{
+ struct rlimit r;
+
+ /* We set a stack limit because we are usually invoked via make, and
+ make sets the stack limit to be as large as possible. */
+ r.rlim_cur = 8192 * 1024;
+ r.rlim_max = 8192 * 1024;
+ if (setrlimit (RLIMIT_STACK, &r) != 0)
+ abort ();
+ down (1000);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/split-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/split-2.c
new file mode 100644
index 000000000..208169aa0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/split-2.c
@@ -0,0 +1,55 @@
+/* { dg-do run } */
+/* { dg-require-effective-target split_stack } */
+/* { dg-require-effective-target pthread_h } */
+/* { dg-options "-pthread -fsplit-stack" } */
+
+#include <stdlib.h>
+#include <pthread.h>
+
+/* Use a noinline function to ensure that the buffer is not removed
+ from the stack. */
+static void use_buffer (char *buf) __attribute__ ((noinline));
+static void
+use_buffer (char *buf)
+{
+ buf[0] = '\0';
+}
+
+/* Each recursive call uses 10,000 bytes. We call it 1000 times,
+ using a total of 10,000,000 bytes. If -fsplit-stack is not
+ working, that will overflow our stack limit. */
+
+static void
+down (int i)
+{
+ char buf[10000];
+
+ if (i > 0)
+ {
+ use_buffer (buf);
+ down (i - 1);
+ }
+}
+
+static void *
+thread_routine (void *arg __attribute__ ((unused)))
+{
+ down (1000);
+ return NULL;
+}
+
+int
+main (void)
+{
+ int i;
+ pthread_t tid;
+ void *dummy;
+
+ i = pthread_create (&tid, NULL, thread_routine, NULL);
+ if (i != 0)
+ abort ();
+ i = pthread_join (tid, &dummy);
+ if (i != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/split-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/split-3.c
new file mode 100644
index 000000000..64bbb8c0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/split-3.c
@@ -0,0 +1,64 @@
+/* This test needs to use setrlimit to set the stack size, so it can
+ only run on Unix. */
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-darwin* } } */
+/* { dg-require-effective-target split_stack } */
+/* { dg-options "-fsplit-stack" } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+
+/* Use a noinline function to ensure that the buffer is not removed
+ from the stack. */
+static void use_buffer (char *buf) __attribute__ ((noinline));
+static void
+use_buffer (char *buf)
+{
+ buf[0] = '\0';
+}
+
+/* Each recursive call uses 10,000 bytes. We call it 1000 times,
+ using a total of 10,000,000 bytes. If -fsplit-stack is not
+ working, that will overflow our stack limit. */
+
+static void
+down (int i, ...)
+{
+ char buf[10000];
+ va_list ap;
+
+ va_start (ap, i);
+ if (va_arg (ap, int) != 1
+ || va_arg (ap, int) != 2
+ || va_arg (ap, int) != 3
+ || va_arg (ap, int) != 4
+ || va_arg (ap, int) != 5
+ || va_arg (ap, int) != 6
+ || va_arg (ap, int) != 7
+ || va_arg (ap, int) != 8
+ || va_arg (ap, int) != 9
+ || va_arg (ap, int) != 10)
+ abort ();
+
+ if (i > 0)
+ {
+ use_buffer (buf);
+ down (i - 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ }
+}
+
+int
+main (void)
+{
+ struct rlimit r;
+
+ /* We set a stack limit because we are usually invoked via make, and
+ make sets the stack limit to be as large as possible. */
+ r.rlim_cur = 8192 * 1024;
+ r.rlim_max = 8192 * 1024;
+ if (setrlimit (RLIMIT_STACK, &r) != 0)
+ abort ();
+ down (1000, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/split-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/split-4.c
new file mode 100644
index 000000000..b89164e34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/split-4.c
@@ -0,0 +1,68 @@
+/* This test needs to use setrlimit to set the stack size, so it can
+ only run on Unix. */
+/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-darwin* } } */
+/* { dg-require-effective-target split_stack } */
+/* { dg-options "-fsplit-stack" } */
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+
+/* Use a noinline function to ensure that the buffer is not removed
+ from the stack. */
+static void use_buffer (char *buf, size_t) __attribute__ ((noinline));
+static void
+use_buffer (char *buf, size_t c)
+{
+ size_t i;
+
+ for (i = 0; i < c; ++i)
+ buf[i] = (char) i;
+}
+
+/* Each recursive call uses 10 * i bytes. We call it 1000 times,
+ using a total of 5,000,000 bytes. If -fsplit-stack is not working,
+ that will overflow our stack limit. */
+
+static void
+down1 (int i)
+{
+ char buf[10 * i];
+
+ if (i > 0)
+ {
+ use_buffer (buf, 10 * i);
+ down1 (i - 1);
+ }
+}
+
+/* Same thing, using alloca. */
+
+static void
+down2 (int i)
+{
+ char *buf = alloca (10 * i);
+
+ if (i > 0)
+ {
+ use_buffer (buf, 10 * i);
+ down2 (i - 1);
+ }
+}
+
+int
+main (void)
+{
+ struct rlimit r;
+
+ /* We set a stack limit because we are usually invoked via make, and
+ make sets the stack limit to be as large as possible. */
+ r.rlim_cur = 8192 * 1024;
+ r.rlim_max = 8192 * 1024;
+ if (setrlimit (RLIMIT_STACK, &r) != 0)
+ abort ();
+ down1 (1000);
+ down2 (1000);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/split-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/split-5.c
new file mode 100644
index 000000000..601640f22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/split-5.c
@@ -0,0 +1,171 @@
+/* { dg-do run } */
+/* { dg-require-effective-target split_stack } */
+/* { dg-require-effective-target pthread_h } */
+/* { dg-require-effective-target ucontext_h } */
+/* { dg-options "-pthread -fsplit-stack" } */
+
+#include <stdlib.h>
+#include <pthread.h>
+#include <ucontext.h>
+
+extern void __splitstack_getcontext (void *context[10]);
+
+extern void __splitstack_setcontext (void *context[10]);
+
+extern void *__splitstack_makecontext (size_t, void *context[10], size_t *);
+
+extern void __splitstack_block_signals (int *, int *);
+
+extern void __splitstack_block_signals_context (void *context[10], int *,
+ int *);
+
+extern void *__splitstack_find (void *, void *, size_t *, void **, void **,
+ void **);
+
+extern void *__splitstack_find_context (void *context[10], size_t *, void **,
+ void **, void **);
+
+static ucontext_t c1;
+static void *s1[10];
+
+static ucontext_t c2;
+static void *s2[10];
+
+static void swap (ucontext_t *, void *fs[10], ucontext_t *, void *ts[10])
+ __attribute__ ((no_split_stack));
+
+static void
+swap (ucontext_t *fu, void *fs[10], ucontext_t *tu, void *ts[10])
+{
+ __splitstack_getcontext (fs);
+ __splitstack_setcontext (ts);
+ swapcontext (fu, tu);
+ __splitstack_setcontext (fs);
+}
+
+/* Use a noinline function to ensure that the buffer is not removed
+ from the stack. */
+static void use_buffer (char *buf) __attribute__ ((noinline));
+static void
+use_buffer (char *buf)
+{
+ buf[0] = '\0';
+}
+
+static void
+down (int i, const char *msg, ucontext_t *me, void *mes[10],
+ ucontext_t *other, void *others[10])
+{
+ char buf[10000];
+
+ if (i > 0)
+ {
+ use_buffer (buf);
+ swap (me, mes, other, others);
+ down (i - 1, msg, me, mes, other, others);
+ }
+ else
+ {
+ int c = 0;
+ void *stack;
+ size_t stack_size;
+ void *next_segment = NULL;
+ void *next_sp = NULL;
+ void *initial_sp = NULL;
+
+ stack = __splitstack_find_context (mes, &stack_size, &next_segment,
+ &next_sp, &initial_sp);
+ if (stack != NULL)
+ {
+ ++c;
+ while (__splitstack_find (next_segment, next_sp, &stack_size,
+ &next_segment, &next_sp, &initial_sp)
+ != NULL)
+ ++c;
+ }
+ }
+}
+
+static void
+go1 (void)
+{
+ down (1000, "go1", &c1, s1, &c2, s2);
+ pthread_exit (NULL);
+}
+
+static void
+go2 (void)
+{
+ down (1000, "go2", &c2, s2, &c1, s1);
+ pthread_exit (NULL);
+}
+
+struct thread_context
+{
+ ucontext_t *u;
+ void **s;
+};
+
+static void *start_thread (void *) __attribute__ ((no_split_stack));
+
+static void *
+start_thread (void *context)
+{
+ struct thread_context *tc = (struct thread_context *) context;
+ int block;
+
+ block = 0;
+ __splitstack_block_signals (&block, NULL);
+ __splitstack_setcontext (tc->s);
+ setcontext (tc->u);
+ abort ();
+}
+
+int
+main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)))
+{
+ pthread_t tid;
+ int err;
+ size_t size;
+ struct thread_context tc;
+ int block;
+
+ if (getcontext (&c1) < 0)
+ abort ();
+
+ c2 = c1;
+
+ c1.uc_stack.ss_sp = __splitstack_makecontext (8192, &s1[0], &size);
+ if (c1.uc_stack.ss_sp == NULL)
+ abort ();
+ c1.uc_stack.ss_flags = 0;
+ c1.uc_stack.ss_size = size;
+ c1.uc_link = NULL;
+ block = 0;
+ __splitstack_block_signals_context (&s1[0], &block, NULL);
+ makecontext (&c1, go1, 0);
+
+ c2.uc_stack.ss_sp = __splitstack_makecontext (8192, &s2[0], &size);
+ if (c2.uc_stack.ss_sp == NULL)
+ abort ();
+ c2.uc_stack.ss_flags = 0;
+ c2.uc_stack.ss_size = size;
+ c2.uc_link = NULL;
+ __splitstack_block_signals_context (&s2[0], &block, NULL);
+ makecontext (&c2, go2, 0);
+
+ block = 0;
+ __splitstack_block_signals (&block, NULL);
+
+ tc.u = &c1;
+ tc.s = &s1[0];
+ err = pthread_create (&tid, NULL, start_thread, &tc);
+ if (err != 0)
+ abort ();
+
+ err = pthread_join (tid, NULL);
+ if (err != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/split-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/split-6.c
new file mode 100644
index 000000000..b32cf8de2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/split-6.c
@@ -0,0 +1,53 @@
+/* { dg-do run } */
+/* { dg-require-effective-target split_stack } */
+/* { dg-options "-fsplit-stack" } */
+
+/* This test is like split-3.c, but tests with a smaller stack frame,
+ since that uses a different prologue. */
+
+#include <stdarg.h>
+#include <stdlib.h>
+
+/* Use a noinline function to ensure that the buffer is not removed
+ from the stack. */
+static void use_buffer (char *buf) __attribute__ ((noinline));
+static void
+use_buffer (char *buf)
+{
+ buf[0] = '\0';
+}
+
+/* When using gold, the call to abort will force a stack split. */
+
+static void
+down (int i, ...)
+{
+ char buf[1];
+ va_list ap;
+
+ va_start (ap, i);
+ if (va_arg (ap, int) != 1
+ || va_arg (ap, int) != 2
+ || va_arg (ap, int) != 3
+ || va_arg (ap, int) != 4
+ || va_arg (ap, int) != 5
+ || va_arg (ap, int) != 6
+ || va_arg (ap, int) != 7
+ || va_arg (ap, int) != 8
+ || va_arg (ap, int) != 9
+ || va_arg (ap, int) != 10)
+ abort ();
+
+ if (i > 0)
+ {
+ use_buffer (buf);
+ down (i - 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ }
+}
+
+int
+main (void)
+{
+ down (1000, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ssp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ssp-1.c
new file mode 100644
index 000000000..5467f4dc3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ssp-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run { target native } } */
+/* { dg-options "-fstack-protector" } */
+/* { dg-require-effective-target fstack_protector } */
+
+#include <stdlib.h>
+
+void
+__stack_chk_fail (void)
+{
+ exit (0); /* pass */
+}
+
+int main ()
+{
+ int i;
+ char foo[255];
+
+ // smash stack
+ for (i = 0; i <= 400; i++)
+ foo[i] = 42;
+
+ return 1; /* fail */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ssp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ssp-2.c
new file mode 100644
index 000000000..9a7ac3206
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ssp-2.c
@@ -0,0 +1,29 @@
+/* { dg-do run { target native } } */
+/* { dg-options "-fstack-protector" } */
+/* { dg-options "-fstack-protector -Wl,-multiply_defined,suppress" { target *-*-darwin* } } */
+/* { dg-require-effective-target fstack_protector } */
+
+#include <stdlib.h>
+
+void
+__stack_chk_fail (void)
+{
+ exit (0); /* pass */
+}
+
+void
+overflow()
+{
+ int i = 0;
+ char foo[30];
+
+ /* Overflow buffer. */
+ for (i = 0; i < 50; i++)
+ foo[i] = 42;
+}
+
+int main (void)
+{
+ overflow ();
+ return 1; /* fail */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stack-layout-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/stack-layout-1.c
new file mode 100644
index 000000000..389a4eb05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stack-layout-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fdump-rtl-expand" } */
+union U {
+ int a;
+ float b;
+};
+struct A {
+ union U u1;
+ char a[100];
+};
+void bar (struct A *);
+void foo ()
+ {
+ {
+ struct A a;
+ bar (&a);
+ }
+ {
+ struct A a;
+ bar (&a);
+ }
+ }
+
+/* { dg-final { scan-rtl-dump-times "Partition" 1 "expand" } } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stack-layout-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/stack-layout-2.c
new file mode 100644
index 000000000..9ed545d72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stack-layout-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-expand" } */
+void bar( char *);
+int foo()
+{
+ int i=0;
+ {
+ char a[8000];
+ bar(a);
+ i += a[0];
+ }
+ {
+ char a[8192];
+ char b[32];
+ bar(a);
+ i += a[0];
+ bar(b);
+ i += a[0];
+ }
+ return i;
+}
+/* { dg-final { scan-rtl-dump "size 8192" "expand" } } */
+/* { dg-final { scan-rtl-dump "size 32" "expand" } } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-1.c
new file mode 100644
index 000000000..05e3df7be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -0,0 +1,96 @@
+/* { dg-do compile } */
+/* { dg-options "-fstack-usage" } */
+
+/* This is aimed at testing basic support for -fstack-usage in the back-ends.
+ See the SPARC back-end for example (grep flag_stack_usage_info in sparc.c).
+ Once it is implemented, adjust SIZE below so that the stack usage for the
+ function FOO is reported as 256 or 264 in the stack usage (.su) file.
+ Then check that this is the actual stack usage in the assembly file. */
+
+#if defined(__aarch64__)
+# define SIZE 256 /* No frame pointer for leaf functions (default) */
+#elif defined(__arc__)
+# define SIZE (256-4)
+#elif defined(__i386__)
+# define SIZE 248
+#elif defined(__x86_64__)
+# ifndef _WIN64
+# define SIZE 356
+# else
+# define SIZE (256 - 24)
+# endif
+#elif defined (__sparc__)
+# if defined (__arch64__)
+# define SIZE 76
+# else
+# define SIZE 160
+# endif
+#elif defined(__hppa__)
+# define SIZE 192
+#elif defined (__alpha__)
+# define SIZE 240
+#elif defined (__ia64__)
+# define SIZE 272
+#elif defined(__mips__)
+# if defined (__mips_abicalls) \
+ || (defined _MIPS_SIM && (_MIPS_SIM ==_ABIN32 || _MIPS_SIM==_ABI64))
+# define SIZE 240
+# else
+# define SIZE 248
+# endif
+#elif defined (__nds32__)
+# define SIZE 248 /* 256 - 8 bytes, only $fp and padding bytes are saved in
+ the register save area under O0 optimization level. */
+#elif defined (__powerpc64__) || defined (__ppc64__) || defined (__POWERPC64__) \
+ || defined (__PPC64__)
+# if _CALL_ELF == 2
+# define SIZE 208
+# else
+# define SIZE 180
+# endif
+#elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
+ || defined (__POWERPC__) || defined (PPC) || defined (_IBMR2)
+# if defined (__ALTIVEC__)
+# if defined (__APPLE__)
+# define SIZE 204
+# else
+# define SIZE 220
+# endif
+# elif defined (_AIX)
+# define SIZE 208
+# else
+# define SIZE 240
+# endif
+#elif defined (__AVR__)
+# define SIZE 254
+#elif defined (__s390x__)
+# define SIZE 96 /* 256 - 160 bytes for register save area */
+#elif defined (__s390__)
+# define SIZE 160 /* 256 - 96 bytes for register save area */
+#elif defined (__SPU__)
+# define SIZE 224
+#elif defined (__epiphany__)
+# define SIZE (256 - __EPIPHANY_STACK_OFFSET__)
+#elif defined (__RL78__)
+# define SIZE 254
+#elif defined (__sh__)
+# define SIZE 252
+#elif defined (__frv__)
+# define SIZE 248
+#elif defined (xstormy16)
+# define SIZE 254
+#elif defined (__nios2__)
+# define SIZE 252
+#else
+# define SIZE 256
+#endif
+
+int foo (void)
+{
+ char arr[SIZE];
+ arr[0] = 1;
+ return 0;
+}
+
+/* { dg-final { scan-stack-usage "foo\t\(256|264\)\tstatic" } } */
+/* { dg-final { cleanup-stack-usage } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c
new file mode 100644
index 000000000..d3c17a84d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stack-usage-2.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-Wstack-usage=512" } */
+
+int foo1 (void)
+{
+ char arr[16];
+ arr[0] = 1;
+ return 0;
+} /* { dg-bogus "stack usage" } */
+
+int foo2 (void)
+{
+ char arr[1024];
+ arr[0] = 1;
+ return 0;
+} /* { dg-warning "stack usage is \[0-9\]* bytes" } */
+
+int foo3 (void)
+{
+ char arr[1024] __attribute__((aligned (512)));
+ arr[0] = 1;
+ /* Force dynamic realignment of argument pointer. */
+ __builtin_apply ((void (*)()) foo2, 0, 0);
+ return 0;
+
+} /* { dg-warning "stack usage might be \[0-9\]* bytes" } */
+
+int foo4 (int n)
+{
+ char arr[n];
+ arr[0] = 1;
+ return 0;
+} /* { dg-warning "stack usage might be unbounded" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-1.c
new file mode 100644
index 000000000..fdd62528d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-1.c
@@ -0,0 +1,11 @@
+/* Test diagnostic for GNU extension: statement expressions. Test
+ with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+int
+f (void)
+{
+ return ({ 1; });
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-2.c
new file mode 100644
index 000000000..524e8ac87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-2.c
@@ -0,0 +1,11 @@
+/* Test diagnostic for GNU extension: statement expressions. Test
+ with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+int
+f (void)
+{
+ return ({ 1; }); /* { dg-warning "ISO C forbids braced-groups within expressions" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-3.c
new file mode 100644
index 000000000..6ef7e069e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-3.c
@@ -0,0 +1,11 @@
+/* Test diagnostic for GNU extension: statement expressions. Test
+ with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -pedantic-errors" } */
+
+int
+f (void)
+{
+ return ({ 1; }); /* { dg-error "ISO C forbids braced-groups within expressions" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-4.c
new file mode 100644
index 000000000..d6d01633d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-4.c
@@ -0,0 +1,22 @@
+
+/* { dg-options "-O2 -std=gnu99" } */
+/* Internal compiler error in iterative_hash_expr */
+
+struct tree_string
+{
+ char str[1];
+};
+
+union tree_node
+{
+ struct tree_string string;
+};
+
+char *Foo (union tree_node * num_string)
+{
+ char *str = ((union {const char * _q; char * _nq;})
+ ((const char *)(({ __typeof (num_string) const __t
+ = num_string; __t; })
+ ->string.str)))._nq;
+ return str;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-1.c
new file mode 100644
index 000000000..a9dd46623
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-1.c
@@ -0,0 +1,407 @@
+/* Test for labels in statement expressions: bugs 772 and 17913.
+ goto statements must not jump into statement expressions.
+
+ This tests all combinations of label and goto locations in a given
+ function. Each combination is tested twice, once with just that
+ label and goto and once with many others in order to exercise the
+ different code paths involved with excess labels. */
+
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f0 (void) { goto a; a:({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa0 (void) { p0A:goto p0A; goto a; a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f1 (void) { goto a; ({ a:({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa1 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f2 (void) { goto a; ({ ({a:0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa2 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f3 (void) { goto a; ({ ({0;}); a:({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa3 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f4 (void) { goto a; ({ ({0;}); ({a:0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa4 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f5 (void) { goto a; ({ ({0;}); ({0;}); a:0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa5 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f6 (void) { goto a; ({ ({0;}); ({0;}); 0;}); a:({ ({0;}); ({0;}); 0;}); 0; }
+void fa6 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f7 (void) { goto a; ({ ({0;}); ({0;}); 0;}); ({ a:({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa7 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f8 (void) { goto a; ({ ({0;}); ({0;}); 0;}); ({ ({a:0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa8 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f9 (void) { goto a; ({ ({0;}); ({0;}); 0;}); ({ ({0;}); a:({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa9 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f10 (void) { goto a; ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa10 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f11 (void) { goto a; ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); a:0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa11 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f12 (void) { goto a; ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); a:0; }
+void fa12 (void) { p0A:goto p0A; goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f13 (void) { a: goto a; ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa13 (void) { a: goto a; P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f14 (void) { a:({ goto a; ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa14 (void) { a:({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f15 (void) { ({ goto a; a:({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa15 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f16 (void) { ({ goto a; ({a:0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa16 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f17 (void) { ({ goto a; ({0;}); a:({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa17 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f18 (void) { ({ goto a; ({0;}); ({a:0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa18 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f19 (void) { ({ goto a; ({0;}); ({0;}); a:0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa19 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f20 (void) { ({ goto a; ({0;}); ({0;}); 0;}); a:({ ({0;}); ({0;}); 0;}); 0; }
+void fa20 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f21 (void) { ({ goto a; ({0;}); ({0;}); 0;}); ({ a:({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa21 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f22 (void) { ({ goto a; ({0;}); ({0;}); 0;}); ({ ({a:0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa22 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f23 (void) { ({ goto a; ({0;}); ({0;}); 0;}); ({ ({0;}); a:({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa23 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f24 (void) { ({ goto a; ({0;}); ({0;}); 0;}); ({ ({0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa24 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f25 (void) { ({ goto a; ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); a:0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa25 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f26 (void) { ({ goto a; ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); a:0; }
+void fa26 (void) { P0A:goto P0A;({ p01A:goto p01A; goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f27 (void) { ({ a: goto a; ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa27 (void) { P0A:goto P0A;({ a: goto a; P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f28 (void) { a:({ ({ goto a; 0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa28 (void) { a:({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f29 (void) { ({ a:({ goto a; 0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa29 (void) { P0A:goto P0A;({ a:({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f30 (void) { ({ ({ goto a; a:0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa30 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f31 (void) { ({ ({ goto a; 0;}); a:({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa31 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f32 (void) { ({ ({ goto a; 0;}); ({a:0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa32 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f33 (void) { ({ ({ goto a; 0;}); ({0;}); a:0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa33 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f34 (void) { ({ ({ goto a; 0;}); ({0;}); 0;}); a:({ ({0;}); ({0;}); 0;}); 0; }
+void fa34 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f35 (void) { ({ ({ goto a; 0;}); ({0;}); 0;}); ({ a:({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa35 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f36 (void) { ({ ({ goto a; 0;}); ({0;}); 0;}); ({ ({a:0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa36 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f37 (void) { ({ ({ goto a; 0;}); ({0;}); 0;}); ({ ({0;}); a:({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa37 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f38 (void) { ({ ({ goto a; 0;}); ({0;}); 0;}); ({ ({0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa38 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f39 (void) { ({ ({ goto a; 0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); a:0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa39 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f40 (void) { ({ ({ goto a; 0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); a:0; }
+void fa40 (void) { P0A:goto P0A;({ P01A:goto P01A;({p012A:goto p012A; goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f41 (void) { ({ ({a: goto a; 0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa41 (void) { P0A:goto P0A;({ P01A:goto P01A;({a: goto a; P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f42 (void) { a:({ ({0;}); goto a; ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa42 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f43 (void) { ({ a:({0;}); goto a; ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa43 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f44 (void) { ({ ({a:0;}); goto a; ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa44 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f45 (void) { ({ ({0;}); goto a; a:({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa45 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f46 (void) { ({ ({0;}); goto a; ({a:0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa46 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f47 (void) { ({ ({0;}); goto a; ({0;}); a:0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa47 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f48 (void) { ({ ({0;}); goto a; ({0;}); 0;}); a:({ ({0;}); ({0;}); 0;}); 0; }
+void fa48 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f49 (void) { ({ ({0;}); goto a; ({0;}); 0;}); ({ a:({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa49 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f50 (void) { ({ ({0;}); goto a; ({0;}); 0;}); ({ ({a:0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa50 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f51 (void) { ({ ({0;}); goto a; ({0;}); 0;}); ({ ({0;}); a:({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa51 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f52 (void) { ({ ({0;}); goto a; ({0;}); 0;}); ({ ({0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa52 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f53 (void) { ({ ({0;}); goto a; ({0;}); 0;}); ({ ({0;}); ({0;}); a:0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa53 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f54 (void) { ({ ({0;}); goto a; ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); a:0; }
+void fa54 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); p01B:goto p01B; goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f55 (void) { ({ ({0;}); a: goto a; ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa55 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a: goto a; P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f56 (void) { a:({ ({0;}); ({ goto a; 0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa56 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f57 (void) { ({ a:({0;}); ({ goto a; 0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa57 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f58 (void) { ({ ({a:0;}); ({ goto a; 0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa58 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f59 (void) { ({ ({0;}); a:({ goto a; 0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa59 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f60 (void) { ({ ({0;}); ({ goto a; a:0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa60 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f61 (void) { ({ ({0;}); ({ goto a; 0;}); a:0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa61 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f62 (void) { ({ ({0;}); ({ goto a; 0;}); 0;}); a:({ ({0;}); ({0;}); 0;}); 0; }
+void fa62 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f63 (void) { ({ ({0;}); ({ goto a; 0;}); 0;}); ({ a:({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa63 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f64 (void) { ({ ({0;}); ({ goto a; 0;}); 0;}); ({ ({a:0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa64 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f65 (void) { ({ ({0;}); ({ goto a; 0;}); 0;}); ({ ({0;}); a:({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa65 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f66 (void) { ({ ({0;}); ({ goto a; 0;}); 0;}); ({ ({0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa66 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f67 (void) { ({ ({0;}); ({ goto a; 0;}); 0;}); ({ ({0;}); ({0;}); a:0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa67 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f68 (void) { ({ ({0;}); ({ goto a; 0;}); 0;}); ({ ({0;}); ({0;}); 0;}); a:0; }
+void fa68 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({p013A:goto p013A; goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f69 (void) { ({ ({0;}); ({a: goto a; 0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa69 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a: goto a; P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f70 (void) { a:({ ({0;}); ({0;}); goto a; 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa70 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f71 (void) { ({ a:({0;}); ({0;}); goto a; 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa71 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f72 (void) { ({ ({a:0;}); ({0;}); goto a; 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa72 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f73 (void) { ({ ({0;}); a:({0;}); goto a; 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa73 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f74 (void) { ({ ({0;}); ({a:0;}); goto a; 0;}); ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa74 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f75 (void) { ({ ({0;}); ({0;}); goto a; a:0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa75 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f76 (void) { ({ ({0;}); ({0;}); goto a; 0;}); a:({ ({0;}); ({0;}); 0;}); 0; }
+void fa76 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f77 (void) { ({ ({0;}); ({0;}); goto a; 0;}); ({ a:({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa77 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f78 (void) { ({ ({0;}); ({0;}); goto a; 0;}); ({ ({a:0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa78 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f79 (void) { ({ ({0;}); ({0;}); goto a; 0;}); ({ ({0;}); a:({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa79 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f80 (void) { ({ ({0;}); ({0;}); goto a; 0;}); ({ ({0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa80 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f81 (void) { ({ ({0;}); ({0;}); goto a; 0;}); ({ ({0;}); ({0;}); a:0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa81 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f82 (void) { ({ ({0;}); ({0;}); goto a; 0;}); ({ ({0;}); ({0;}); 0;}); a:0; }
+void fa82 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); p01C:goto p01C; goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f83 (void) { ({ ({0;}); ({0;}); a: goto a; 0;}); ({ ({0;}); ({0;}); 0;}); 0; }
+void fa83 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a: goto a; P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f84 (void) { a:({ ({0;}); ({0;}); 0;}); goto a; ({ ({0;}); ({0;}); 0;}); 0; }
+void fa84 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f85 (void) { ({ a:({0;}); ({0;}); 0;}); goto a; ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa85 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f86 (void) { ({ ({a:0;}); ({0;}); 0;}); goto a; ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa86 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f87 (void) { ({ ({0;}); a:({0;}); 0;}); goto a; ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa87 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f88 (void) { ({ ({0;}); ({a:0;}); 0;}); goto a; ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa88 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f89 (void) { ({ ({0;}); ({0;}); a:0;}); goto a; ({ ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa89 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f90 (void) { ({ ({0;}); ({0;}); 0;}); goto a; a:({ ({0;}); ({0;}); 0;}); 0; }
+void fa90 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f91 (void) { ({ ({0;}); ({0;}); 0;}); goto a; ({ a:({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa91 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f92 (void) { ({ ({0;}); ({0;}); 0;}); goto a; ({ ({a:0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa92 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f93 (void) { ({ ({0;}); ({0;}); 0;}); goto a; ({ ({0;}); a:({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa93 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f94 (void) { ({ ({0;}); ({0;}); 0;}); goto a; ({ ({0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa94 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f95 (void) { ({ ({0;}); ({0;}); 0;}); goto a; ({ ({0;}); ({0;}); a:0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa95 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f96 (void) { ({ ({0;}); ({0;}); 0;}); goto a; ({ ({0;}); ({0;}); 0;}); a:0; }
+void fa96 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); p0B:goto p0B; goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f97 (void) { ({ ({0;}); ({0;}); 0;}); a: goto a; ({ ({0;}); ({0;}); 0;}); 0; }
+void fa97 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a: goto a; P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f98 (void) { a:({ ({0;}); ({0;}); 0;}); ({ goto a; ({0;}); ({0;}); 0;}); 0; }
+void fa98 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f99 (void) { ({ a:({0;}); ({0;}); 0;}); ({ goto a; ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa99 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f100 (void) { ({ ({a:0;}); ({0;}); 0;}); ({ goto a; ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa100 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f101 (void) { ({ ({0;}); a:({0;}); 0;}); ({ goto a; ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa101 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f102 (void) { ({ ({0;}); ({a:0;}); 0;}); ({ goto a; ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa102 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f103 (void) { ({ ({0;}); ({0;}); a:0;}); ({ goto a; ({0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa103 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f104 (void) { ({ ({0;}); ({0;}); 0;}); a:({ goto a; ({0;}); ({0;}); 0;}); 0; }
+void fa104 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f105 (void) { ({ ({0;}); ({0;}); 0;}); ({ goto a; a:({0;}); ({0;}); 0;}); 0; }
+void fa105 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f106 (void) { ({ ({0;}); ({0;}); 0;}); ({ goto a; ({a:0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa106 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f107 (void) { ({ ({0;}); ({0;}); 0;}); ({ goto a; ({0;}); a:({0;}); 0;}); 0; }
+void fa107 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f108 (void) { ({ ({0;}); ({0;}); 0;}); ({ goto a; ({0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa108 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f109 (void) { ({ ({0;}); ({0;}); 0;}); ({ goto a; ({0;}); ({0;}); a:0;}); 0; }
+void fa109 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f110 (void) { ({ ({0;}); ({0;}); 0;}); ({ goto a; ({0;}); ({0;}); 0;}); a:0; }
+void fa110 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ p02A:goto p02A; goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f111 (void) { ({ ({0;}); ({0;}); 0;}); ({ a: goto a; ({0;}); ({0;}); 0;}); 0; }
+void fa111 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a: goto a; P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f112 (void) { a:({ ({0;}); ({0;}); 0;}); ({ ({ goto a; 0;}); ({0;}); 0;}); 0; }
+void fa112 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f113 (void) { ({ a:({0;}); ({0;}); 0;}); ({ ({ goto a; 0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa113 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f114 (void) { ({ ({a:0;}); ({0;}); 0;}); ({ ({ goto a; 0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa114 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f115 (void) { ({ ({0;}); a:({0;}); 0;}); ({ ({ goto a; 0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa115 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f116 (void) { ({ ({0;}); ({a:0;}); 0;}); ({ ({ goto a; 0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa116 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f117 (void) { ({ ({0;}); ({0;}); a:0;}); ({ ({ goto a; 0;}); ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa117 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f118 (void) { ({ ({0;}); ({0;}); 0;}); a:({ ({ goto a; 0;}); ({0;}); 0;}); 0; }
+void fa118 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f119 (void) { ({ ({0;}); ({0;}); 0;}); ({ a:({ goto a; 0;}); ({0;}); 0;}); 0; }
+void fa119 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f120 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({ goto a; a:0;}); ({0;}); 0;}); 0; }
+void fa120 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f121 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({ goto a; 0;}); a:({0;}); 0;}); 0; }
+void fa121 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f122 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({ goto a; 0;}); ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa122 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f123 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({ goto a; 0;}); ({0;}); a:0;}); 0; }
+void fa123 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f124 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({ goto a; 0;}); ({0;}); 0;}); a:0; }
+void fa124 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({p024A:goto p024A; goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f125 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({a: goto a; 0;}); ({0;}); 0;}); 0; }
+void fa125 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a: goto a; P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f126 (void) { a:({ ({0;}); ({0;}); 0;}); ({ ({0;}); goto a; ({0;}); 0;}); 0; }
+void fa126 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f127 (void) { ({ a:({0;}); ({0;}); 0;}); ({ ({0;}); goto a; ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa127 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f128 (void) { ({ ({a:0;}); ({0;}); 0;}); ({ ({0;}); goto a; ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa128 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f129 (void) { ({ ({0;}); a:({0;}); 0;}); ({ ({0;}); goto a; ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa129 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f130 (void) { ({ ({0;}); ({a:0;}); 0;}); ({ ({0;}); goto a; ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa130 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f131 (void) { ({ ({0;}); ({0;}); a:0;}); ({ ({0;}); goto a; ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa131 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f132 (void) { ({ ({0;}); ({0;}); 0;}); a:({ ({0;}); goto a; ({0;}); 0;}); 0; }
+void fa132 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f133 (void) { ({ ({0;}); ({0;}); 0;}); ({ a:({0;}); goto a; ({0;}); 0;}); 0; }
+void fa133 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f134 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({a:0;}); goto a; ({0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa134 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f135 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); goto a; a:({0;}); 0;}); 0; }
+void fa135 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f136 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); goto a; ({a:0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa136 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f137 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); goto a; ({0;}); a:0;}); 0; }
+void fa137 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f138 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); goto a; ({0;}); 0;}); a:0; }
+void fa138 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); p02B:goto p02B; goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f139 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); a: goto a; ({0;}); 0;}); 0; }
+void fa139 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a: goto a; P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f140 (void) { a:({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({ goto a; 0;}); 0;}); 0; }
+void fa140 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f141 (void) { ({ a:({0;}); ({0;}); 0;}); ({ ({0;}); ({ goto a; 0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa141 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f142 (void) { ({ ({a:0;}); ({0;}); 0;}); ({ ({0;}); ({ goto a; 0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa142 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f143 (void) { ({ ({0;}); a:({0;}); 0;}); ({ ({0;}); ({ goto a; 0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa143 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f144 (void) { ({ ({0;}); ({a:0;}); 0;}); ({ ({0;}); ({ goto a; 0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa144 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f145 (void) { ({ ({0;}); ({0;}); a:0;}); ({ ({0;}); ({ goto a; 0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa145 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f146 (void) { ({ ({0;}); ({0;}); 0;}); a:({ ({0;}); ({ goto a; 0;}); 0;}); 0; }
+void fa146 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f147 (void) { ({ ({0;}); ({0;}); 0;}); ({ a:({0;}); ({ goto a; 0;}); 0;}); 0; }
+void fa147 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f148 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({a:0;}); ({ goto a; 0;}); 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa148 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f149 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); a:({ goto a; 0;}); 0;}); 0; }
+void fa149 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f150 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({ goto a; a:0;}); 0;}); 0; }
+void fa150 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f151 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({ goto a; 0;}); a:0;}); 0; }
+void fa151 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f152 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({ goto a; 0;}); 0;}); a:0; }
+void fa152 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({p025A:goto p025A; goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f153 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({a: goto a; 0;}); 0;}); 0; }
+void fa153 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a: goto a; P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f154 (void) { a:({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); goto a; 0;}); 0; }
+void fa154 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f155 (void) { ({ a:({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); goto a; 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa155 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f156 (void) { ({ ({a:0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); goto a; 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa156 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f157 (void) { ({ ({0;}); a:({0;}); 0;}); ({ ({0;}); ({0;}); goto a; 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa157 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f158 (void) { ({ ({0;}); ({a:0;}); 0;}); ({ ({0;}); ({0;}); goto a; 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa158 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f159 (void) { ({ ({0;}); ({0;}); a:0;}); ({ ({0;}); ({0;}); goto a; 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa159 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f160 (void) { ({ ({0;}); ({0;}); 0;}); a:({ ({0;}); ({0;}); goto a; 0;}); 0; }
+void fa160 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f161 (void) { ({ ({0;}); ({0;}); 0;}); ({ a:({0;}); ({0;}); goto a; 0;}); 0; }
+void fa161 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f162 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({a:0;}); ({0;}); goto a; 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa162 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f163 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); a:({0;}); goto a; 0;}); 0; }
+void fa163 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f164 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({a:0;}); goto a; 0;}); 0; } /* { dg-error "jump into statement expression" } */
+void fa164 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f165 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); goto a; a:0;}); 0; }
+void fa165 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; a:0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f166 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); goto a; 0;}); a:0; }
+void fa166 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); p02C:goto p02C; goto a; P02C:goto P02C;0;}); a:0;P0D:goto P0D; }
+void f167 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); a: goto a; 0;}); 0; }
+void fa167 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a: goto a; P02C:goto P02C;0;}); P0C:goto P0C;0;P0D:goto P0D; }
+void f168 (void) { a:({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); goto a; 0; }
+void fa168 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; }
+void f169 (void) { ({ a:({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa169 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f170 (void) { ({ ({a:0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa170 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f171 (void) { ({ ({0;}); a:({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa171 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f172 (void) { ({ ({0;}); ({a:0;}); 0;}); ({ ({0;}); ({0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa172 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f173 (void) { ({ ({0;}); ({0;}); a:0;}); ({ ({0;}); ({0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa173 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f174 (void) { ({ ({0;}); ({0;}); 0;}); a:({ ({0;}); ({0;}); 0;}); goto a; 0; }
+void fa174 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; }
+void f175 (void) { ({ ({0;}); ({0;}); 0;}); ({ a:({0;}); ({0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa175 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f176 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({a:0;}); ({0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa176 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f177 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); a:({0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa177 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f178 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({a:0;}); 0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa178 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f179 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); a:0;}); goto a; 0; } /* { dg-error "jump into statement expression" } */
+void fa179 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); p0C:goto p0C; goto a; P0C:goto P0C;0;P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f180 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); goto a; a:0; }
+void fa180 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); p0C:goto p0C; goto a; a:0;P0D:goto P0D; }
+void f181 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); a: goto a; 0; }
+void fa181 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a: goto a; P0C:goto P0C;0;P0D:goto P0D; }
+void f182 (void) { a:({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; goto a; }
+void fa182 (void) { a:({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; }
+void f183 (void) { ({ a:({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa183 (void) { P0A:goto P0A;({ a:({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f184 (void) { ({ ({a:0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa184 (void) { P0A:goto P0A;({ P01A:goto P01A;({a:0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f185 (void) { ({ ({0;}); a:({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa185 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); a:({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f186 (void) { ({ ({0;}); ({a:0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa186 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({a:0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f187 (void) { ({ ({0;}); ({0;}); a:0;}); ({ ({0;}); ({0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa187 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); a:0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f188 (void) { ({ ({0;}); ({0;}); 0;}); a:({ ({0;}); ({0;}); 0;}); 0; goto a; }
+void fa188 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); a:({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; }
+void f189 (void) { ({ ({0;}); ({0;}); 0;}); ({ a:({0;}); ({0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa189 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ a:({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f190 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({a:0;}); ({0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa190 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({a:0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f191 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); a:({0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa191 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); a:({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f192 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({a:0;}); 0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa192 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({a:0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f193 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); a:0;}); 0; goto a; } /* { dg-error "jump into statement expression" } */
+void fa193 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); a:0;}); P0C:goto P0C;0;p0D:goto p0D; goto a; P0D:goto P0D; } /* { dg-error "jump into statement expression" } */
+void f194 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); a:0; goto a; }
+void fa194 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); a:0;p0D:goto p0D; goto a; P0D:goto P0D; }
+void f195 (void) { ({ ({0;}); ({0;}); 0;}); ({ ({0;}); ({0;}); 0;}); 0;a: goto a; }
+void fa195 (void) { P0A:goto P0A;({ P01A:goto P01A;({P012A:goto P012A;0;}); P01B:goto P01B;({P013A:goto P013A;0;}); P01C:goto P01C;0;}); P0B:goto P0B;({ P02A:goto P02A;({P024A:goto P024A;0;}); P02B:goto P02B;({P025A:goto P025A;0;}); P02C:goto P02C;0;}); P0C:goto P0C;0;a: goto a; P0D:goto P0D; }
+
+/* Match extra informative notes. */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-2.c
new file mode 100644
index 000000000..be7aa5210
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-2.c
@@ -0,0 +1,27 @@
+/* Test for labels in statement expressions: bugs 772 and 17913.
+ switch statements must not jump into statement expressions. */
+
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f (int a)
+{
+ switch (a) /* { dg-message "here" } */
+ {
+ case 0:
+ case 1:
+ ({
+ case 2: /* { dg-error "switch jumps into statement expression" } */
+ default: /* { dg-error "switch jumps into statement expression" } */
+ switch (a)
+ {
+ case 3:
+ default:
+ ;
+ }
+ 0;
+ });
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-3.c
new file mode 100644
index 000000000..0a6722283
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/stmt-expr-label-3.c
@@ -0,0 +1,11 @@
+/* Test for labels in statement expressions: bugs 772 and 17913.
+ Test the particular case of bug 17913. */
+
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void f(void) { 1 ? 1 : ({ a : 1; 1; }); goto a; } /* { dg-error "jump into statement expression" } */
+
+/* Match extra informative notes. */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "note: expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-1.c
new file mode 100644
index 000000000..f37dbd54f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of no-strict-overflow-1.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return i - 5 < 10;
+}
+
+/* { dg-final { scan-tree-dump-not "-\[ \]*5" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-2.c
new file mode 100644
index 000000000..fd2dc6920
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of no-strict-overflow-2.c. */
+
+/* We can only simplify the division when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return (i * 100) / 10;
+}
+
+/* { dg-final { scan-tree-dump-not "100" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-3.c
new file mode 100644
index 000000000..bdde003a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of no-strict-overflow-3.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i, int j)
+{
+ return i + 100 < j + 1000;
+}
+
+/* { dg-final { scan-tree-dump-not "1000" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-4.c
new file mode 100644
index 000000000..ad2d635e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of no-strict-overflow-4.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (int i)
+{
+ return i + 1 > i;
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-5.c
new file mode 100644
index 000000000..816bfe440
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-5.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */
+
+/* We can only unroll when using strict overflow semantics. */
+
+int foo (int i)
+{
+ int index;
+ int r=0;
+
+ for (index = i; index <= i+4; index+=2)
+ r++;
+
+ return r;
+}
+
+/* { dg-final { scan-tree-dump "return 3" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-6.c
new file mode 100644
index 000000000..d8251f4cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strict-overflow-6.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2 -fdump-tree-optimized" } */
+
+/* Source: Ian Lance Taylor. Dual of no-strict-overflow-7.c. */
+
+/* We can only simplify the conditional when using strict overflow
+ semantics. */
+
+int
+foo (char* p)
+{
+ return p + 1000 < p;
+}
+
+/* { dg-final { scan-tree-dump-not "\[+\]\[ \]*1000" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/string-opt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/string-opt-1.c
new file mode 100644
index 000000000..bc0f30098
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/string-opt-1.c
@@ -0,0 +1,11 @@
+/* Ensure mempcpy is not "optimized" into memcpy followed by addition. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void *
+fn (char *x, char *y, int z)
+{
+ return __builtin_mempcpy (x, y, z);
+}
+
+/* { dg-final { scan-assembler-not "memcpy" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-1.c
new file mode 100644
index 000000000..5ed5be1f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-1.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+foo (char *p, char *r)
+{
+ char *q = malloc (strlen (p) + strlen (r) + 64);
+ if (q == NULL) return NULL;
+ /* This strcpy can be optimized into memcpy, using the remembered
+ strlen (p). */
+ strcpy (q, p);
+ /* These two strcat can be optimized into memcpy. The first one
+ could be even optimized into a *ptr = '/'; store as the '\0'
+ is immediately overwritten. */
+ strcat (q, "/");
+ strcat (q, "abcde");
+ /* This can also be optimized into memcpy. */
+ strcat (q, r);
+ return q;
+}
+
+int
+main ()
+{
+ char *volatile p = "string1";
+ char *volatile r = "string2";
+ char *q = foo (p, r);
+ if (q != NULL)
+ {
+ if (strcmp (q, "string1/abcdestring2"))
+ abort ();
+ free (q);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-10.c
new file mode 100644
index 000000000..b04449635
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-10.c
@@ -0,0 +1,83 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) size_t
+fn1 (char *p)
+{
+ char *q;
+ /* This can be optimized into memcpy and the size can be decreased to one,
+ as it is immediately overwritten. */
+ strcpy (p, "z");
+ q = strchr (p, '\0');
+ *q = 32;
+ /* This strlen can't be optimized away, string length is unknown here. */
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) void
+fn2 (char *p, const char *z, size_t *lp)
+{
+ char *q, *r;
+ char buf[64];
+ size_t l[10];
+ /* The first strlen stays, all the strcpy calls can be optimized
+ into memcpy and all other strlen calls and all strchr calls
+ optimized away. */
+ l[0] = strlen (z);
+ strcpy (buf, z);
+ strcpy (p, "abcde");
+ q = strchr (p, '\0');
+ strcpy (q, "efghi");
+ r = strchr (q, '\0');
+ strcpy (r, "jkl");
+ l[1] = strlen (p);
+ l[2] = strlen (q);
+ l[3] = strlen (r);
+ strcpy (r, buf);
+ l[4] = strlen (p);
+ l[5] = strlen (q);
+ l[6] = strlen (r);
+ strcpy (r, "mnopqr");
+ l[7] = strlen (p);
+ l[8] = strlen (q);
+ l[9] = strlen (r);
+ memcpy (lp, l, sizeof l);
+}
+
+int
+main ()
+{
+ char buf[64];
+ size_t l[10];
+ const char *volatile z = "ABCDEFG";
+ memset (buf, '\0', sizeof buf);
+ if (fn1 (buf) != 2 || buf[0] != 'z' || buf[1] != 32 || buf[2] != '\0')
+ abort ();
+ fn2 (buf, z, l);
+ if (memcmp (buf, "abcdeefghimnopqr", 17) != 0)
+ abort ();
+ if (l[0] != 7)
+ abort ();
+ if (l[1] != 13 || l[2] != 8 || l[3] != 3)
+ abort ();
+ if (l[4] != 17 || l[5] != 12 || l[6] != 7)
+ abort ();
+ if (l[7] != 16 || l[8] != 11 || l[9] != 6)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* avr has BIGGEST_ALIGNMENT 8, allowing fold_builtin_memory_op
+ to expand the memcpy call at the end of fn2. */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 8 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 7 "strlen" { target { avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "\\*q_\[0-9\]* = 32;" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(\[^\n\r\]*, 1\\)" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-11.c
new file mode 100644
index 000000000..0fb327ced
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-11.c
@@ -0,0 +1,76 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) void
+fn1 (char *p, const char *z, size_t *lp)
+{
+ char *q, *r, *s;
+ char buf[64];
+ size_t l[11];
+ /* The first strlen stays, all the strcpy calls can be optimized
+ into memcpy and most other strlen calls and all strchr calls
+ optimized away. l[6] = strlen (r); and l[9] = strlen (r); need
+ to stay, because we need to invalidate the knowledge about
+ r strlen after strcpy (q, "jklmnopqrst"). */
+ l[0] = strlen (z);
+ strcpy (buf, z);
+ strcpy (p, "abcde");
+ q = strchr (p, '\0');
+ strcpy (q, "efghi");
+ r = strchr (q, '\0');
+ strcpy (r, buf);
+ l[1] = strlen (p);
+ l[2] = strlen (q);
+ l[3] = strlen (r);
+ strcpy (q, "jklmnopqrst");
+ l[4] = strlen (p);
+ l[5] = strlen (q);
+ l[6] = strlen (r);
+ s = strchr (q, '\0');
+ strcpy (s, buf);
+ l[7] = strlen (p);
+ l[8] = strlen (q);
+ l[9] = strlen (r);
+ l[10] = strlen (s);
+ memcpy (lp, l, sizeof l);
+}
+
+int
+main ()
+{
+ char buf[64];
+ size_t l[11];
+ const char *volatile z = "ABCDEFG";
+ memset (buf, '\0', sizeof buf);
+ fn1 (buf, z, l);
+ if (memcmp (buf, "abcdejklmnopqrstABCDEFG", 24) != 0)
+ abort ();
+ if (l[0] != 7)
+ abort ();
+ if (l[1] != 17 || l[2] != 12 || l[3] != 7)
+ abort ();
+ if (l[4] != 16 || l[5] != 11 || l[6] != 6)
+ abort ();
+ if (l[7] != 23 || l[8] != 18 || l[9] != 13 || l[10] != 7)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */
+/* avr has BIGGEST_ALIGNMENT 8, allowing fold_builtin_memory_op
+ to expand the memcpy call at the end of fn1. */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 7 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 6 "strlen" { target { avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* Where the memcpy is expanded, the assignemts to elements of l are
+ propagated. */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.0. = " 1 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.6. = " 1 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.9. = " 1 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;" 3 "strlen" { target { avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-12.c
new file mode 100644
index 000000000..1005fc670
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-12.c
@@ -0,0 +1,90 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (char *p, size_t *l)
+{
+ char *q = strcat (p, "abcde");
+ *l = strlen (p);
+ return q;
+}
+
+__attribute__((noinline, noclone)) char *
+fn2 (char *p, const char *q, size_t *l1, size_t *l2)
+{
+ size_t l = strlen (q);
+ char *r = strcat (p, q);
+ *l1 = l;
+ *l2 = strlen (p);
+ return r;
+}
+
+__attribute__((noinline, noclone)) char *
+fn3 (char *p, const char *q, size_t *l)
+{
+ char *r = strcpy (p, q);
+ *l = strlen (p);
+ return r;
+}
+
+__attribute__((noinline, noclone)) char *
+fn4 (char *p, const char *q, size_t *l)
+{
+ char *r = strcat (p, q);
+ *l = strlen (p);
+ return r;
+}
+
+__attribute__((noinline, noclone)) char *
+fn5 (char *p, const char *q, size_t *l1, size_t *l2, size_t *l3)
+{
+ size_t l = strlen (q);
+ size_t ll = strlen (p);
+ char *r = strcat (p, q);
+ *l1 = l;
+ *l2 = strlen (p);
+ *l3 = ll;
+ return r;
+}
+
+__attribute__((noinline, noclone)) char *
+fn6 (char *p, const char *q, size_t *l1, size_t *l2)
+{
+ size_t l = strlen (p);
+ char *r = strcat (p, q);
+ *l1 = strlen (p);
+ *l2 = l;
+ return r;
+}
+
+int
+main ()
+{
+ char buf[64];
+ const char *volatile q = "fgh";
+ size_t l, l1, l2, l3;
+ memset (buf, '\0', sizeof buf);
+ memset (buf, 'a', 3);
+ if (fn1 (buf, &l) != buf || l != 8 || memcmp (buf, "aaaabcde", 9) != 0)
+ abort ();
+ if (fn2 (buf, q, &l1, &l2) != buf || l1 != 3 || l2 != 11
+ || memcmp (buf, "aaaabcdefgh", 12) != 0)
+ abort ();
+ if (fn3 (buf, q, &l) != buf || l != 3
+ || memcmp (buf, "fgh\0bcdefgh", 12) != 0)
+ abort ();
+ if (fn4 (buf, q, &l) != buf || l != 6
+ || memcmp (buf, "fghfgh\0efgh", 12) != 0)
+ abort ();
+ l1 = 0;
+ l2 = 0;
+ if (fn5 (buf, q, &l1, &l2, &l3) != buf || l1 != 3 || l2 != 9 || l3 != 6
+ || memcmp (buf, "fghfghfgh\0h", 12) != 0)
+ abort ();
+ if (fn6 (buf, q, &l1, &l2) != buf || l1 != 12 || l2 != 9
+ || memcmp (buf, "fghfghfghfgh", 13) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-12g.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-12g.c
new file mode 100644
index 000000000..f1dec1f9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-12g.c
@@ -0,0 +1,6 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2" } */
+
+#define USE_GNU
+#include "strlenopt-12.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-13.c
new file mode 100644
index 000000000..f9ab56111
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-13.c
@@ -0,0 +1,74 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) void
+fn1 (char *p, const char *y, const char *z, size_t *lp)
+{
+ char *q, *r, *s;
+ char buf1[64], buf2[64];
+ size_t l[8];
+ /* These two strlen calls stay, all strcpy calls are optimized into
+ memcpy, all strchr calls optimized away, and most other strlen
+ calls too. */
+ l[0] = strlen (y);
+ l[1] = strlen (z);
+ strcpy (buf1, y);
+ strcpy (buf2, z);
+ strcpy (p, "abcde");
+ q = strchr (p, '\0');
+ strcpy (q, "efghi");
+ r = strchr (q, '\0');
+ strcpy (r, buf1);
+ l[2] = strlen (p);
+ l[3] = strlen (q);
+ l[4] = strlen (r);
+ strcpy (r, buf2);
+ /* Except for these two calls, strlen (r) before and after the above
+ is non-constant, so adding l[4] - l[1] to all previous strlens
+ might make the expressions already too complex. */
+ l[5] = strlen (p);
+ l[6] = strlen (q);
+ /* This one is of course optimized, it is l[1]. */
+ l[7] = strlen (r);
+ memcpy (lp, l, sizeof l);
+}
+
+int
+main ()
+{
+ char buf[64];
+ size_t l[8];
+ const char *volatile y = "ABCDEFG";
+ const char *volatile z = "HIJK";
+ memset (buf, '\0', sizeof buf);
+ fn1 (buf, y, z, l);
+ if (memcmp (buf, "abcdeefghiHIJK", 15) != 0)
+ abort ();
+ if (l[0] != 7 || l[1] != 4)
+ abort ();
+ if (l[2] != 17 || l[3] != 12 || l[4] != 7)
+ abort ();
+ if (l[5] != 14 || l[6] != 9 || l[7] != 4)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
+/* avr has BIGGEST_ALIGNMENT 8, allowing fold_builtin_memory_op
+ to expand the memcpy call at the end of fn1. */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 7 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 6 "strlen" { target { avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* Where the memcpy is expanded, the assignemts to elements of l are
+ propagated. */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.0. = " 1 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.1. = " 1 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.5. = " 1 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;\[\n\r\]* l.6. = " 1 "strlen" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times " _\[0-9\]* = strlen \\(\[^\n\r\]*;" 4 "strlen" { target { avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-14g.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-14g.c
new file mode 100644
index 000000000..86c57f195
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-14g.c
@@ -0,0 +1,115 @@
+/* This test needs runtime that provides stpcpy and mempcpy functions. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (char *p, size_t *l1, size_t *l2)
+{
+ char *a = mempcpy (p, "abcde", 6);
+ /* This strlen needs to stay. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into 5. */
+ size_t lp = strlen (p);
+ *l1 = la;
+ *l2 = lp;
+ return a;
+}
+
+__attribute__((noinline, noclone)) char *
+fn2 (char *p, const char *q, size_t *l1, size_t *l2, size_t *l3)
+{
+ /* This strlen needs to stay. */
+ size_t lq = strlen (q);
+ char *a = mempcpy (p, q, lq + 1);
+ /* This strlen needs to stay. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into lq. */
+ size_t lp = strlen (p);
+ *l1 = lq;
+ *l2 = la;
+ *l3 = lp;
+ return a;
+}
+
+__attribute__((noinline, noclone)) char *
+fn3 (char *p, size_t *l1, size_t *l2)
+{
+ char *a = stpcpy (p, "abcde");
+ /* This strlen can be optimized into 0. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into 5. */
+ size_t lp = strlen (p);
+ *l1 = la;
+ *l2 = lp;
+ return a;
+}
+
+__attribute__((noinline, noclone)) char *
+fn4 (char *p, const char *q, size_t *l1, size_t *l2, size_t *l3)
+{
+ /* This strlen needs to stay. */
+ size_t lq = strlen (q);
+ char *a = stpcpy (p, q);
+ /* This strlen can be optimized into 0. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into lq. */
+ size_t lp = strlen (p);
+ *l1 = lq;
+ *l2 = la;
+ *l3 = lp;
+ return a;
+}
+
+__attribute__((noinline, noclone)) char *
+fn5 (char *p, const char *q, size_t *l1, size_t *l2)
+{
+ char *a = stpcpy (p, q);
+ /* This strlen can be optimized into 0. */
+ size_t la = strlen (a);
+ /* This strlen can be optimized into a - p. */
+ size_t lp = strlen (p);
+ *l1 = la;
+ *l2 = lp;
+ return a;
+}
+
+int
+main ()
+{
+ char buf[64];
+ const char *volatile q = "ABCDEFGH";
+ size_t l1, l2, l3;
+ memset (buf, '\0', sizeof buf);
+ memset (buf + 6, 'z', 7);
+ if (fn1 (buf, &l1, &l2) != buf + 6 || l1 != 7 || l2 != 5
+ || memcmp (buf, "abcde\0zzzzzzz", 14) != 0)
+ abort ();
+ if (fn2 (buf, q, &l1, &l2, &l3) != buf + 9 || l1 != 8 || l2 != 4 || l3 != 8
+ || memcmp (buf, "ABCDEFGH\0zzzz", 14) != 0)
+ abort ();
+ if (fn3 (buf, &l1, &l2) != buf + 5 || l1 != 0 || l2 != 5
+ || memcmp (buf, "abcde\0GH\0zzzz", 14) != 0)
+ abort ();
+ l3 = 0;
+ memset (buf, 'n', 9);
+ if (fn4 (buf, q, &l1, &l2, &l3) != buf + 8 || l1 != 8 || l2 != 0 || l3 != 8
+ || memcmp (buf, "ABCDEFGH\0zzzz", 14) != 0)
+ abort ();
+ memset (buf, 'm', 9);
+ if (fn5 (buf, q, &l1, &l2) != buf + 8 || l1 != 0 || l2 != 8
+ || memcmp (buf, "ABCDEFGH\0zzzz", 14) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "mempcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 2 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-14gf.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-14gf.c
new file mode 100644
index 000000000..8b78538d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-14gf.c
@@ -0,0 +1,24 @@
+/* This test needs runtime that provides stpcpy, mempcpy and __*_chk
+ functions. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define FORTIFY_SOURCE 2
+#include "strlenopt-14g.c"
+
+/* Compared to strlenopt-14gf.c, strcpy_chk with string literal as
+ second argument isn't being optimized by builtins.c into
+ memcpy. */
+/* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__mempcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "mempcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 2 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-15.c
new file mode 100644
index 000000000..495166ddb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-15.c
@@ -0,0 +1,60 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) size_t
+fn1 (char *p, size_t l)
+{
+ memcpy (p, "abcdef", l);
+ /* This strlen can't be optimized, as l is unknown. */
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn2 (char *p, const char *q, size_t *lp)
+{
+ size_t l = strlen (q), l2;
+ memcpy (p, q, 7);
+ /* This strlen can't be optimized, as l might be bigger than 7. */
+ l2 = strlen (p);
+ *lp = l;
+ return l2;
+}
+
+__attribute__((noinline, noclone)) char *
+fn3 (char *p)
+{
+ *p = 0;
+ return p + 1;
+}
+
+int
+main ()
+{
+ char buf[64];
+ const char *volatile q = "ABCDEFGH";
+ const char *volatile q2 = "IJ\0KLMNOPQRS";
+ size_t l;
+ memset (buf, '\0', sizeof buf);
+ memset (buf + 2, 'a', 7);
+ if (fn1 (buf, 3) != 9 || memcmp (buf, "abcaaaaaa", 10) != 0)
+ abort ();
+ if (fn1 (buf, 7) != 6 || memcmp (buf, "abcdef\0aa", 10) != 0)
+ abort ();
+ if (fn2 (buf, q, &l) != 9 || l != 8 || memcmp (buf, "ABCDEFGaa", 10) != 0)
+ abort ();
+ if (fn2 (buf, q2, &l) != 2 || l != 2 || memcmp (buf, "IJ\0KLMNaa", 10) != 0)
+ abort ();
+ if (fn3 (buf) != buf + 1 || memcmp (buf, "\0J\0KLMNaa", 10) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-16g.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-16g.c
new file mode 100644
index 000000000..0e74ad7f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-16g.c
@@ -0,0 +1,34 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (char *p, const char *q)
+{
+ /* This strcpy can be optimized into stpcpy. */
+ strcpy (p, q);
+ /* And this strchr into the return value from it. */
+ return strchr (p, '\0');
+}
+
+int
+main ()
+{
+ char buf[64];
+ const char *volatile q = "ABCDEFGH";
+ if (fn1 (buf, q) != buf + 8 || memcmp (buf, "ABCDEFGH", 9) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "mempcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-17g.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-17g.c
new file mode 100644
index 000000000..f06435f6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-17g.c
@@ -0,0 +1,57 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) int
+foo (const char *p)
+{
+ static int c;
+ const char *q[] = { "123498765abcde", "123498765..", "129abcde", "129abcde" };
+ if (strcmp (p, q[c]) != 0)
+ abort ();
+ return c++;
+}
+
+__attribute__((noinline, noclone)) void
+bar (const char *p, const char *q)
+{
+ size_t l;
+ /* This strlen stays. */
+ char *a = __builtin_alloca (strlen (p) + 50);
+ /* strcpy can be optimized into memcpy. */
+ strcpy (a, p);
+ /* strcat into stpcpy. */
+ strcat (a, q);
+ /* This strlen can be optimized away. */
+ l = strlen (a);
+ /* This becomes memcpy. */
+ strcat (a, "abcde");
+ if (!foo (a))
+ /* And this one too. */
+ strcpy (a + l, "..");
+ foo (a);
+}
+
+int
+main ()
+{
+ const char *volatile s1 = "1234";
+ const char *volatile s2 = "98765";
+ const char *volatile s3 = "12";
+ const char *volatile s4 = "9";
+ bar (s1, s2);
+ bar (s3, s4);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "mempcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-18g.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-18g.c
new file mode 100644
index 000000000..21b6c47c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-18g.c
@@ -0,0 +1,82 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (int x, int y, int z)
+{
+ static char buf[40];
+ const char *p;
+ switch (x)
+ {
+ case 0:
+ p = "abcd";
+ break;
+ case 1:
+ p = "efgh";
+ break;
+ case 2:
+ p = "ijkl";
+ break;
+ default:
+ p = "mnopq";
+ break;
+ }
+ if (y)
+ {
+ strcpy (buf, p);
+ if (z)
+ strcat (buf, "ABCDEFG");
+ else
+ strcat (buf, "HIJKLMN");
+ }
+ else
+ {
+ strcpy (buf, p + 1);
+ if (z)
+ strcat (buf, "OPQ");
+ else
+ strcat (buf, "RST");
+ }
+ return buf;
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 5; i++)
+ {
+ const char *p = "abcdefghijklmnopq" + (i < 3 ? i : 3) * 4;
+ const char *q;
+ int j = i >= 3;
+ fn1 (i ? 0 : 1, 1, 1);
+ q = fn1 (i, 0, 0);
+ if (memcmp (q, p + 1, 3 + j) != 0 || memcmp (q + 3 + j, "RST", 4) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 0, 1);
+ q = fn1 (i, 1, 0);
+ if (memcmp (q, p, 4 + j) != 0 || memcmp (q + 4 + j, "HIJKLMN", 8) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 1, 0);
+ q = fn1 (i, 0, 1);
+ if (memcmp (q, p + 1, 3 + j) != 0 || memcmp (q + 3 + j, "OPQ", 4) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 0, 0);
+ q = fn1 (i, 1, 1);
+ if (memcmp (q, p, 4 + j) != 0 || memcmp (q + 4 + j, "ABCDEFG", 8) != 0)
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 2 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-19.c
new file mode 100644
index 000000000..042fd77b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-19.c
@@ -0,0 +1,81 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (int x, int y, int z)
+{
+ static char buf[40];
+ const char *p;
+ switch (x)
+ {
+ case 0:
+ p = "abcd";
+ /* Prevent cswitch optimization. */
+ asm volatile ("" : : : "memory");
+ break;
+ case 1:
+ p = "efgh";
+ break;
+ case 2:
+ p = "ijkl";
+ break;
+ default:
+ p = "mnop";
+ break;
+ }
+ if (y)
+ {
+ strcpy (buf, p);
+ if (z)
+ strcat (buf, "ABCDEFG");
+ else
+ strcat (buf, "HIJKLMN");
+ }
+ else
+ {
+ strcpy (buf, p + 1);
+ if (z)
+ strcat (buf, "OPQ");
+ else
+ strcat (buf, "RST");
+ }
+ return buf;
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 5; i++)
+ {
+ const char *p = "abcdefghijklmnop" + (i < 3 ? i : 3) * 4;
+ const char *q;
+ fn1 (i ? 0 : 1, 1, 1);
+ q = fn1 (i, 0, 0);
+ if (memcmp (q, p + 1, 3) != 0 || memcmp (q + 3, "RST", 4) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 0, 1);
+ q = fn1 (i, 1, 0);
+ if (memcmp (q, p, 4) != 0 || memcmp (q + 4, "HIJKLMN", 8) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 1, 0);
+ q = fn1 (i, 0, 1);
+ if (memcmp (q, p + 1, 3) != 0 || memcmp (q + 3, "OPQ", 4) != 0)
+ abort ();
+ fn1 (i ? 0 : 1, 0, 0);
+ q = fn1 (i, 1, 1);
+ if (memcmp (q, p, 4) != 0 || memcmp (q + 4, "ABCDEFG", 8) != 0)
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 6 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-1f.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-1f.c
new file mode 100644
index 000000000..50c5f9130
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-1f.c
@@ -0,0 +1,18 @@
+/* This test needs runtime that provides __*_chk functions. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define FORTIFY_SOURCE 2
+#include "strlenopt-1.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-2.c
new file mode 100644
index 000000000..5e6557b56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-2.c
@@ -0,0 +1,49 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+foo (char *p, char *r)
+{
+ char buf[26];
+ if (strlen (p) + strlen (r) + 9 > 26)
+ return NULL;
+ /* This strcpy can be optimized into memcpy, using the remembered
+ strlen (p). */
+ strcpy (buf, p);
+ /* These two strcat can be optimized into memcpy. The first one
+ could be even optimized into a *ptr = '/'; store as the '\0'
+ is immediately overwritten. */
+ strcat (buf, "/");
+ strcat (buf, "abcde");
+ /* This strcpy can be optimized into memcpy, using the remembered
+ strlen (r). */
+ strcat (buf, r);
+ /* And this can be optimized into memcpy too. */
+ strcat (buf, "fg");
+ return strdup (buf);
+}
+
+int
+main ()
+{
+ char *volatile p = "string1";
+ char *volatile r = "string2";
+ char *q = foo (p, r);
+ if (q != NULL)
+ {
+ if (strcmp (q, "string1/abcdestring2fg"))
+ abort ();
+ free (q);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 5 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-20.c
new file mode 100644
index 000000000..6fe99a422
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-20.c
@@ -0,0 +1,95 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) const char *
+fn1 (int x, int y)
+{
+ const char *p;
+ switch (x)
+ {
+ case 0:
+ p = "abcd";
+ /* Prevent cswitch optimization. */
+ asm volatile ("" : : : "memory");
+ break;
+ case 1:
+ p = "efgh";
+ break;
+ case 2:
+ p = "ijkl";
+ break;
+ default:
+ p = "mnop";
+ break;
+ }
+ if (y)
+ /* strchr should be optimized into p + 4 here. */
+ return strchr (p, '\0');
+ else
+ /* and strlen into 3. */
+ return p + strlen (p + 1);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn2 (char *p, char *q)
+{
+ size_t l;
+ /* Both strcpy calls can be optimized into memcpy, strlen needs to stay. */
+ strcpy (p, "abc");
+ p[3] = 'd';
+ l = strlen (p);
+ strcpy (q, p);
+ return l;
+}
+
+__attribute__((noinline, noclone)) char *
+fn3 (char *p)
+{
+ char *c;
+ /* The strcpy call can be optimized into memcpy, strchr needs to stay,
+ strcat is optimized into memcpy. */
+ strcpy (p, "abc");
+ p[3] = 'd';
+ c = strchr (p, '\0');
+ strcat (p, "efgh");
+ return c;
+}
+
+int
+main ()
+{
+ int i;
+ char buf[64], buf2[64];
+ for (i = 0; i < 5; i++)
+ {
+ const char *p = "abcdefghijklmnop" + (i < 3 ? i : 3) * 4;
+ const char *q;
+ q = fn1 (i, 1);
+ if (memcmp (q - 4, p, 4) != 0 || q[0] != '\0')
+ abort ();
+ q = fn1 (i, 0);
+ if (memcmp (q - 3, p, 4) != 0 || q[1] != '\0')
+ abort ();
+ }
+ memset (buf, '\0', sizeof buf);
+ memset (buf + 4, 'z', 2);
+ if (fn2 (buf, buf2) != 6
+ || memcmp (buf, "abcdzz", 7) != 0
+ || memcmp (buf2, "abcdzz", 7) != 0)
+ abort ();
+ memset (buf, '\0', sizeof buf);
+ memset (buf + 4, 'z', 2);
+ if (fn3 (buf) != buf + 6 || memcmp (buf, "abcdzzefgh", 11) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-21.c
new file mode 100644
index 000000000..1f27c3340
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-21.c
@@ -0,0 +1,66 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+struct S { char *p; size_t l; };
+
+__attribute__((noinline, noclone)) struct S
+foo (char *x, int n)
+{
+ int i;
+ char a[64];
+ char *p = strchr (x, '\0');
+ struct S s;
+ /* strcpy here is optimized into memcpy, length computed as p - x + 1. */
+ strcpy (a, x);
+ /* strcat here is optimized into memcpy. */
+ strcat (p, "abcd");
+ for (i = 0; i < n; i++)
+ if ((i % 123) == 53)
+ /* strcat here is optimized into strlen and memcpy. */
+ strcat (a, "efg");
+ s.p = strdup (a);
+ /* The strlen should be optimized here into 4. */
+ s.l = strlen (p);
+ return s;
+}
+
+int
+main ()
+{
+ char buf[32];
+ struct S s;
+ buf[0] = 'z';
+ buf[1] = '\0';
+ s = foo (buf, 0);
+ if (s.l != 4 || memcmp (buf, "zabcd", 6) != 0)
+ abort ();
+ if (s.p == NULL)
+ return 0;
+ if (memcmp (s.p, "z", 2) != 0)
+ abort ();
+ s = foo (buf, 60);
+ if (s.l != 4 || memcmp (buf, "zabcdabcd", 10) != 0)
+ abort ();
+ if (s.p == NULL)
+ return 0;
+ if (memcmp (s.p, "zabcdefg", 9) != 0)
+ abort ();
+ s = foo (buf, 240);
+ if (s.l != 4 || memcmp (buf, "zabcdabcdabcd", 14) != 0)
+ abort ();
+ if (s.p == NULL)
+ return 0;
+ if (memcmp (s.p, "zabcdabcdefgefg", 16) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-22.c
new file mode 100644
index 000000000..d6fd4dfbd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-22.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) size_t
+bar (char *p, char *q)
+{
+ size_t l1, l2, l3;
+ char *r = strchr (p, '\0');
+ strcpy (r, "abcde");
+ char *s = strchr (r, '\0');
+ strcpy (s, q);
+ l1 = strlen (p);
+ l2 = strlen (r);
+ l3 = strlen (s);
+ return l1 + l2 + l3;
+}
+
+int
+main ()
+{
+ char buf[16] = "01234";
+
+ if (bar (buf, "56789") != 30)
+ abort ();
+
+ if (memcmp (buf, "01234abcde56789", 16) != 0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } *
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-22g.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-22g.c
new file mode 100644
index 000000000..4cd6a5f1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-22g.c
@@ -0,0 +1,14 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt-22.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-23.c
new file mode 100644
index 000000000..75dab2ae0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-23.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/57230 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include "strlenopt.h"
+
+int
+main ()
+{
+ char p[] = "hello world";
+ p[0] = (char) (strlen (p) - 1);
+ if (strlen (p) != 11)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-24.c
new file mode 100644
index 000000000..962e04fde
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-24.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/57230 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+int
+main ()
+{
+ char p[] = "hello world";
+ if (strlen (p) != 11)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } *
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-25.c
new file mode 100644
index 000000000..486215654
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-25.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+int
+main ()
+{
+ char p[] = "foobar";
+ int len, len2;
+ len = strlen (p);
+ p[0] = 'O';
+ len2 = strlen (p);
+ return len - len2;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-26.c
new file mode 100644
index 000000000..089355e49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-26.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) size_t
+fn1 (char *p, const char *r)
+{
+ size_t len1 = strlen (r);
+ char *q = strchr (p, '\0');
+ *q = '\0';
+ return len1 - strlen (r); // This strlen should be optimized into len1.
+}
+
+int
+main (void)
+{
+ char p[] = "foobar";
+ const char *volatile q = "xyzzy";
+ fn1 (p, q);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-2f.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-2f.c
new file mode 100644
index 000000000..ba4797d51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-2f.c
@@ -0,0 +1,18 @@
+/* This test needs runtime that provides __*_chk functions. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define FORTIFY_SOURCE 2
+#include "strlenopt-2.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 5 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-3.c
new file mode 100644
index 000000000..1bab8f37e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-3.c
@@ -0,0 +1,66 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen -fdump-tree-optimized" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) size_t
+fn1 (char *p, char *q)
+{
+ size_t s = strlen (q);
+ strcpy (p, q);
+ return s - strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn2 (char *p, char *q)
+{
+ size_t s = strlen (q);
+ memcpy (p, q, s + 1);
+ return s - strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn3 (char *p)
+{
+ memcpy (p, "abcd", 5);
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn4 (char *p)
+{
+ memcpy (p, "efg\0hij", 6);
+ return strlen (p);
+}
+
+int
+main ()
+{
+ char buf[64];
+ char *volatile p = buf;
+ char *volatile q = "ABCDEF";
+ buf[7] = 'G';
+ if (fn1 (p, q) != 0 || memcmp (buf, "ABCDEF\0G", 8))
+ abort ();
+ q = "HIJ";
+ if (fn2 (p + 1, q) != 0 || memcmp (buf, "AHIJ\0F\0G", 8))
+ abort ();
+ buf[6] = 'K';
+ if (fn3 (p + 1) != 4 || memcmp (buf, "Aabcd\0KG", 8))
+ abort ();
+ if (fn4 (p) != 3 || memcmp (buf, "efg\0hiKG", 8))
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
+/* { dg-final { scan-tree-dump-times "return 0" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 4" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 3" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4.c
new file mode 100644
index 000000000..beea49592
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4.c
@@ -0,0 +1,75 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+/* If stpcpy can't be used, this is optimized into
+ strcpy (p, q); strcat (p, r); memcpy (p + strlen (p), "abcd", 5);
+ If stpcpy can be used (see strlenopt-4g.c test),
+ this is optimized into
+ memcpy (stpcpy (stpcpy (p, q), r), "abcd", 5); */
+__attribute__((noinline, noclone)) void
+foo (char *p, const char *q, const char *r)
+{
+ strcpy (p, q);
+ strcat (p, r);
+ strcat (p, "abcd");
+}
+
+/* If stpcpy can't be used, this is optimized into
+ memcpy (p, "abcd", 4); strcpy (p + 4, q); strcat (p, r);
+ If stpcpy can be used, this is optimized into
+ memcpy (p, "abcd", 4); strcpy (stpcpy (p + 4, q), r); */
+__attribute__((noinline, noclone)) void
+bar (char *p, const char *q, const char *r)
+{
+ strcpy (p, "abcd");
+ strcat (p, q);
+ strcat (p, r);
+}
+
+/* If stpcpy can't be used, this is optimized into
+ strcat (p, q); memcpy (t1 = p + strlen (p), "abcd", 4);
+ strcpy (t1 + 4, r); memcpy (p + strlen (p), "efgh", 5);
+ If stpcpy can be used, this is optimized into
+ t1 = stpcpy (p + strlen (p), q); memcpy (t1, "abcd", 4);
+ memcpy (stpcpy (t1 + 4, r), "efgh", 5); */
+__attribute__((noinline, noclone)) void
+baz (char *p, const char *q, const char *r)
+{
+ strcat (p, q);
+ strcat (p, "abcd");
+ strcat (p, r);
+ strcat (p, "efgh");
+}
+
+char buf[64];
+
+int
+main ()
+{
+ char *volatile p = buf;
+ const char *volatile q = "ij";
+ const char *volatile r = "klmno";
+ foo (p, q, r);
+ if (memcmp (buf, "ijklmnoabcd\0\0\0\0\0\0\0\0", 20) != 0)
+ abort ();
+ memset (buf, '\0', sizeof buf);
+ bar (p, q, r);
+ if (memcmp (buf, "abcdijklmno\0\0\0\0\0\0\0\0", 20) != 0)
+ abort ();
+ memset (buf, 'v', 3);
+ memset (buf + 3, '\0', -3 + sizeof buf);
+ baz (p, q, r);
+ if (memcmp (buf, "vvvijabcdklmnoefgh\0", 20) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4g.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4g.c
new file mode 100644
index 000000000..c9a5f00ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4g.c
@@ -0,0 +1,14 @@
+/* This test needs runtime that provides stpcpy function. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#include "strlenopt-4.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 5 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4gf.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4gf.c
new file mode 100644
index 000000000..e1762366e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-4gf.c
@@ -0,0 +1,19 @@
+/* This test needs runtime that provides stpcpy and __*_chk functions. */
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#define USE_GNU
+#define FORTIFY_SOURCE 2
+#include "strlenopt-4.c"
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__memcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__strcat_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "__stpcpy_chk \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 5 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-5.c
new file mode 100644
index 000000000..131494ac8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-5.c
@@ -0,0 +1,57 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+foo (char *p, const char *q)
+{
+ char *e = strchr (p, '\0');
+ strcat (p, q);
+ return e;
+}
+
+__attribute__((noinline, noclone)) char *
+bar (char *p)
+{
+ memcpy (p, "abcd", 5);
+ return strchr (p, '\0');
+}
+
+__attribute__((noinline, noclone)) void
+baz (char *p)
+{
+ char *e = strchr (p, '\0');
+ strcat (e, "abcd");
+}
+
+char buf[64];
+
+int
+main ()
+{
+ char *volatile p = buf;
+ const char *volatile q = "ij";
+ memset (buf, 'v', 3);
+ if (foo (p, q) != buf + 3
+ || memcmp (buf, "vvvij\0\0\0\0", 10) != 0)
+ abort ();
+ memset (buf, '\0', sizeof buf);
+ if (bar (p) != buf + 4
+ || memcmp (buf, "abcd\0\0\0\0\0", 10) != 0)
+ abort ();
+ memset (buf, 'v', 2);
+ memset (buf + 2, '\0', -2 + sizeof buf);
+ baz (p);
+ if (memcmp (buf, "vvabcd\0\0\0", 10) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-6.c
new file mode 100644
index 000000000..d9b718758
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-6.c
@@ -0,0 +1,86 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+foo (char *x)
+{
+#ifdef PR50262_FIXED
+ /* Once PTA is fixed, we'll need just one strlen here,
+ without the memcpy. */
+ char *p = x;
+ char *q = malloc (strlen (p) + 64);
+#else
+ /* This is here just because PTA can't figure that
+ *q = '\0' store below can't change p's length.
+ In this case we have one strlen and one memcpy here. */
+ char b[64];
+ char *q = malloc (strlen (x) + 64);
+ char *p = strcpy (b, x);
+#endif
+ char *r;
+ if (q == NULL) return NULL;
+ /* This store can be optimized away once strcat is
+ replaced with memcpy. */
+ *q = '\0';
+ /* These two strcat calls can be optimized into memcpy calls. */
+ strcat (q, p);
+ strcat (q, "/");
+ /* The strchr can be optimized away, as we know the current
+ string length as well as end pointer. */
+ r = strchr (q, '\0');
+ /* This store can go, as it is overwriting '\0' with the same
+ character. */
+ *r = '\0';
+ /* And this strcat can be again optimized into memcpy call. */
+ strcat (q, "abcde");
+ return q;
+}
+
+__attribute__((noinline, noclone)) char *
+bar (char *p)
+{
+ char buf[26];
+ char *r;
+ if (strlen (p) + 9 > 26)
+ return NULL;
+ *buf = '\0';
+ strcat (buf, p);
+ strcat (buf, "/");
+ r = strchr (buf, '\0');
+ *r = '\0';
+ strcat (buf, "abcde");
+ return strdup (buf);
+}
+
+int
+main ()
+{
+ char *volatile p = "string1";
+ char *volatile r = "string2";
+ char *q = foo (p);
+ if (q != NULL)
+ {
+ if (strcmp (q, "string1/abcde"))
+ abort ();
+ memset (q, '\0', 14);
+ free (q);
+ }
+ q = bar (p);
+ if (q != NULL)
+ {
+ if (strcmp (q, "string1/abcde"))
+ abort ();
+ free (q);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 7 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-7.c
new file mode 100644
index 000000000..6fd940d74
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-7.c
@@ -0,0 +1,53 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen -fdump-tree-optimized" } */
+
+#include "strlenopt.h"
+
+char buf[64];
+
+__attribute__((noinline, noclone)) size_t
+foo (void)
+{
+ char *p = memcpy (buf, "abcdefgh", 9);
+ /* This store can be optimized away as... */
+ *p = '\0';
+ /* ... the following strcat can be optimized into memcpy,
+ which overwrites that '\0'. */
+ strcat (p, "ijk");
+ /* This should be optimized into return 3. */
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+bar (char *p)
+{
+ char *r = strchr (p, '\0');
+ /* This store shouldn't be optimized away, because we
+ want to crash if p is e.g. a string literal. */
+ *r = '\0';
+ /* This strlen can be optimized into 0. */
+ return strlen (r);
+}
+
+int
+main ()
+{
+ char *volatile p = buf;
+ if (foo () != 3 || memcmp (buf, "ijk\0efgh\0", 10) != 0)
+ abort ();
+ if (bar (p) != 0 || memcmp (buf, "ijk\0efgh\0", 10) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 2 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "\\*r_\[0-9\]* = 0;" 1 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
+/* { dg-final { scan-tree-dump-times "return 3;" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return 0;" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-8.c
new file mode 100644
index 000000000..3aaf660a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-8.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen" } */
+
+#include "strlenopt.h"
+
+/* Yes, there are people who write code like this. */
+
+__attribute__((noinline, noclone)) char *
+foo (int r)
+{
+ char buf[10] = "";
+ strcat (buf, r ? "r" : "w");
+ strcat (buf, "b");
+ return strdup (buf);
+}
+
+__attribute__((noinline, noclone)) char *
+bar (int r)
+{
+ char buf[10] = {};
+ strcat (buf, r ? "r" : "w");
+ strcat (buf, "b");
+ return strdup (buf);
+}
+
+int
+main ()
+{
+ char *q = foo (1);
+ if (q != NULL)
+ {
+ if (strcmp (q, "rb"))
+ abort ();
+ free (q);
+ }
+ q = bar (0);
+ if (q != NULL)
+ {
+ if (strcmp (q, "wb"))
+ abort ();
+ free (q);
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-9.c
new file mode 100644
index 000000000..6590d708e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt-9.c
@@ -0,0 +1,109 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-strlen -fdump-tree-optimized" } */
+
+#include "strlenopt.h"
+
+__attribute__((noinline, noclone)) char *
+fn1 (int r)
+{
+ char *p = r ? "a" : "bc";
+ /* String length for p varies, therefore strchr below isn't
+ optimized away. */
+ return strchr (p, '\0');
+}
+
+__attribute__((noinline, noclone)) size_t
+fn2 (int r)
+{
+ char *p, q[10];
+ strcpy (q, "abc");
+ p = r ? "a" : q;
+ /* String length for p varies, therefore strlen below isn't
+ optimized away. */
+ return strlen (p);
+}
+
+__attribute__((noinline, noclone)) size_t
+fn3 (char *p, int n)
+{
+ int i;
+ p = strchr (p, '\0');
+ /* strcat here can be optimized into memcpy. */
+ strcat (p, "abcd");
+ for (i = 0; i < n; i++)
+ if ((i % 123) == 53)
+ /* strcat here is optimized into strlen and memcpy. */
+ strcat (p, "efg");
+ /* The strlen here can't be optimized away, as in the loop string
+ length of p might change. */
+ return strlen (p);
+}
+
+char buf[64];
+
+__attribute__((noinline, noclone)) size_t
+fn4 (char *x, int n)
+{
+ int i;
+ size_t l;
+ char a[64];
+ char *p = strchr (x, '\0');
+ /* strcpy here is optimized into memcpy, length computed as p - x + 1. */
+ strcpy (a, x);
+ /* strcat here is optimized into memcpy. */
+ strcat (p, "abcd");
+ for (i = 0; i < n; i++)
+ if ((i % 123) == 53)
+ /* strcat here is optimized into strlen and memcpy. */
+ strcat (a, "efg");
+ /* The strlen should be optimized here into 4. */
+ l = strlen (p);
+ /* This stays strcpy. */
+ strcpy (buf, a);
+ return l;
+}
+
+int
+main ()
+{
+ volatile int l = 1;
+ char b[64];
+
+ if (memcmp (fn1 (l) - 1, "a", 2) != 0)
+ abort ();
+ if (memcmp (fn1 (!l) - 2, "bc", 3) != 0)
+ abort ();
+ if (fn2 (l) != 1 || fn2 (!l) != 3)
+ abort ();
+ memset (b, '\0', sizeof b);
+ memset (b, 'a', 3);
+ if (fn3 (b, 10) != 4 || memcmp (b, "aaaabcd", 8) != 0)
+ abort ();
+ if (fn3 (b, 128) != 7 || memcmp (b, "aaaabcdabcdefg", 15) != 0)
+ abort ();
+ if (fn3 (b, 256) != 10 || memcmp (b, "aaaabcdabcdefgabcdefgefg", 25) != 0)
+ abort ();
+ if (fn4 (b, 10) != 4
+ || memcmp (b, "aaaabcdabcdefgabcdefgefgabcd", 29) != 0
+ || memcmp (buf, "aaaabcdabcdefgabcdefgefg", 25) != 0)
+ abort ();
+ if (fn4 (b, 128) != 4
+ || memcmp (b, "aaaabcdabcdefgabcdefgefgabcdabcd", 33) != 0
+ || memcmp (buf, "aaaabcdabcdefgabcdefgefgabcdefg", 32) != 0)
+ abort ();
+ if (fn4 (b, 256) != 4
+ || memcmp (b, "aaaabcdabcdefgabcdefgefgabcdabcdabcd", 37) != 0
+ || memcmp (buf, "aaaabcdabcdefgabcdefgefgabcdabcdefgefg", 39) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "strlen \\(" 4 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "memcpy \\(" 6 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "strchr \\(" 3 "strlen" } } */
+/* { dg-final { scan-tree-dump-times "stpcpy \\(" 0 "strlen" } } */
+/* { dg-final { cleanup-tree-dump "strlen" } } */
+/* { dg-final { scan-tree-dump-times "return 4;" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt.h b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt.h
new file mode 100644
index 000000000..ef47e5ac9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strlenopt.h
@@ -0,0 +1,59 @@
+/* This is a replacement of needed parts from stdlib.h and string.h
+ for -foptimize-strlen testing, to ensure we are testing the builtins
+ rather than whatever the OS has in its headers. */
+
+#define NULL ((void *) 0)
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+void *malloc (size_t);
+void free (void *);
+char *strdup (const char *);
+size_t strlen (const char *);
+void *memcpy (void *__restrict, const void *__restrict, size_t);
+char *strcpy (char *__restrict, const char *__restrict);
+char *strcat (char *__restrict, const char *__restrict);
+char *strchr (const char *, int);
+void *memset (void *, int, size_t);
+int memcmp (const void *, const void *, size_t);
+int strcmp (const char *, const char *);
+#ifdef USE_GNU
+void *mempcpy (void *__restrict, const void *__restrict, size_t);
+char *stpcpy (char *__restrict, const char *__restrict);
+#endif
+
+#if defined(FORTIFY_SOURCE) && FORTIFY_SOURCE > 0 && __OPTIMIZE__
+# define bos(ptr) __builtin_object_size (ptr, FORTIFY_SOURCE > 0)
+# define bos0(ptr) __builtin_object_size (ptr, 0)
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
+memcpy (void *__restrict dest, const void *__restrict src, size_t len)
+{
+ return __builtin___memcpy_chk (dest, src, len, bos0 (dest));
+}
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) char *
+strcpy (char *__restrict dest, const char *__restrict src)
+{
+ return __builtin___strcpy_chk (dest, src, bos (dest));
+}
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) char *
+strcat (char *__restrict dest, const char *__restrict src)
+{
+ return __builtin___strcat_chk (dest, src, bos (dest));
+}
+
+# ifdef USE_GNU
+extern inline __attribute__((gnu_inline, always_inline, artificial)) void *
+mempcpy (void *__restrict dest, const void *__restrict src, size_t len)
+{
+ return __builtin___mempcpy_chk (dest, src, len, bos0 (dest));
+}
+
+extern inline __attribute__((gnu_inline, always_inline, artificial)) char *
+stpcpy (char *__restrict dest, const char *__restrict src)
+{
+ return __builtin___stpcpy_chk (dest, src, bos (dest));
+}
+# endif
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/strncpy-fix-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/strncpy-fix-1.c
new file mode 100644
index 000000000..b8bc916e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/strncpy-fix-1.c
@@ -0,0 +1,11 @@
+/* Test that use of strncpy does not result in a "value computed is
+ not used" warning. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+#include <string.h>
+void
+f (char *s)
+{
+ strncpy (s, "::", 2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-alias-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-alias-1.c
new file mode 100644
index 000000000..6cfadcf2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-alias-1.c
@@ -0,0 +1,22 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+struct S {
+ int a[3];
+ int x;
+};
+
+extern void link_error(void);
+static int i;
+
+int main()
+{
+ struct S s;
+
+ s.x = 0;
+ s.a[i] = 1;
+ if (s.x != 0)
+ link_error ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-by-value-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-by-value-1.c
new file mode 100644
index 000000000..addf253d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-by-value-1.c
@@ -0,0 +1,83 @@
+/* Test structure passing by value. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#define T(N) \
+struct S##N { unsigned char i[N]; }; \
+struct S##N g1s##N, g2s##N, g3s##N; \
+ \
+void \
+init##N (struct S##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ p->i[j] = i + j; \
+} \
+ \
+void \
+check##N (struct S##N *p, int i) \
+{ \
+ int j; \
+ for (j = 0; j < N; j++) \
+ if (p->i[j] != i + j) abort (); \
+} \
+ \
+void \
+test##N (struct S##N s1, struct S##N s2, \
+ struct S##N s3) \
+{ \
+ check##N (&s1, 64); \
+ check##N (&s2, 128); \
+ check##N (&s3, 192); \
+} \
+ \
+void \
+test2_##N (struct S##N s1, struct S##N s2) \
+{ \
+ test##N (s1, g2s##N, s2); \
+} \
+ \
+void \
+testit##N (void) \
+{ \
+ init##N (&g1s##N, 64); \
+ check##N (&g1s##N, 64); \
+ init##N (&g2s##N, 128); \
+ check##N (&g2s##N, 128); \
+ init##N (&g3s##N, 192); \
+ check##N (&g3s##N, 192); \
+ test##N (g1s##N, g2s##N, g3s##N); \
+ test2_##N (g1s##N, g3s##N); \
+}
+
+extern void abort (void);
+extern void exit (int);
+
+T(0) T(1) T(2) T(3) T(4) T(5) T(6) T(7)
+T(8) T(9) T(10) T(11) T(12) T(13) T(14) T(15)
+T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23)
+T(24) T(25) T(26) T(27) T(28) T(29) T(30) T(31)
+T(32) T(33) T(34) T(35) T(36) T(37) T(38) T(39)
+T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47)
+T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55)
+T(56) T(57) T(58) T(59) T(60) T(61) T(62) T(63)
+
+#undef T
+
+int
+main ()
+{
+#define T(N) testit##N ();
+
+T(0) T(1) T(2) T(3) T(4) T(5) T(6) T(7)
+T(8) T(9) T(10) T(11) T(12) T(13) T(14) T(15)
+T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23)
+T(24) T(25) T(26) T(27) T(28) T(29) T(30) T(31)
+T(32) T(33) T(34) T(35) T(36) T(37) T(38) T(39)
+T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47)
+T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55)
+T(56) T(57) T(58) T(59) T(60) T(61) T(62) T(63)
+
+#undef T
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-by-value-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-by-value-2.c
new file mode 100644
index 000000000..8d5d0bb01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-by-value-2.c
@@ -0,0 +1,15 @@
+/* This testcase caused a sanity check to abort on SPARC64
+ because of a discrepancy between two functions involved
+ in the calculation of structure layout. */
+
+/* { dg-do compile } */
+
+struct S { float f1; int i1; int i2; float f2; };
+
+extern void foo(struct S);
+
+void bar(void)
+{
+ struct S s;
+ foo(s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-1.c
new file mode 100644
index 000000000..779746567
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-1.c
@@ -0,0 +1,10 @@
+/* Test diagnostics for empty structures and unions. Test with no
+ special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s0 {};
+union u0 {};
+struct s1 { int : 1; };
+union u1 { int : 1; };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-2.c
new file mode 100644
index 000000000..1f06a1b17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-2.c
@@ -0,0 +1,10 @@
+/* Test diagnostics for empty structures and unions. Test with
+ -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+struct s0 {}; /* { dg-warning "struct has no members" } */
+union u0 {}; /* { dg-warning "union has no members" } */
+struct s1 { int : 1; }; /* { dg-warning "struct has no named members" } */
+union u1 { int : 1; }; /* { dg-warning "union has no named members" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-3.c
new file mode 100644
index 000000000..6e5baa9cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-empty-3.c
@@ -0,0 +1,10 @@
+/* Test diagnostics for empty structures and unions. Test with
+ -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+struct s0 {}; /* { dg-error "struct has no members" } */
+union u0 {}; /* { dg-error "union has no members" } */
+struct s1 { int : 1; }; /* { dg-error "struct has no named members" } */
+union u1 { int : 1; }; /* { dg-error "union has no named members" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-in-proto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-in-proto-1.c
new file mode 100644
index 000000000..162ba914a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-in-proto-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+int foo(struct S { int i; } s) {
+ return sizeof(struct S); /* { dg-bogus "incomplete type" "S visible here" } */
+}
+int bar(void) {
+ return sizeof(struct S); /* { dg-error "incomplete type" "not here" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-incompl-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-incompl-1.c
new file mode 100644
index 000000000..c32b2d538
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-incompl-1.c
@@ -0,0 +1,7 @@
+/* PR c/26818 */
+/* { dg-do compile } */
+
+struct __attribute__ ((packed)) A
+{
+ struct B b; /* { dg-error "incomplete" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-parse-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-parse-1.c
new file mode 100644
index 000000000..9ceac8afa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-parse-1.c
@@ -0,0 +1,11 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc. */
+/* Contributed by Carlos O'Donell on 2006-03-31 */
+
+/* This code caused the C frontend to loop
+ forever exhausting all system memory, or ICE */
+/* Origin: Carlos O'Donell <carlos@codesourcery.com> */
+
+/* { dg-options "-std=c99" } */
+struct s { int a; int b; struct t c; }; /* { dg-error "field 'c' has incomplete type" } */
+struct s d = { .b = 0 };
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-parse-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-parse-2.c
new file mode 100644
index 000000000..6d01f3e88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-parse-2.c
@@ -0,0 +1,13 @@
+/* PR c/35437 */
+/* { dg-do compile } */
+
+struct A
+{
+ int i;
+ struct A a; /* { dg-error "has incomplete type" } */
+};
+
+void foo()
+{
+ struct A b = { 0 };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-1.c
new file mode 100644
index 000000000..23c9e9813
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-1.c
@@ -0,0 +1,47 @@
+/* { dg-do run { target hppa*-*-* } } */
+/* { dg-options { -O2 } { target hppa*-*-* } } */
+extern void abort (void);
+extern void exit (int);
+typedef struct {
+ int x;
+ int y;
+} point_t;
+
+int main(int argc, char *argv[]);
+int printPoints(point_t a, point_t b);
+point_t toPoint(int x1, int y1);
+
+int
+main(int argc, char *argv[])
+{
+
+ if (printPoints(toPoint(0, 0), toPoint(1000, 1000)) != 1)
+ abort();
+ else
+ exit(0);
+
+ return 0;
+}
+
+int
+printPoints(point_t a, point_t b)
+{
+ if (a.x != 0
+ || a.y != 0
+ || b.x != 1000
+ || b.y != 1000)
+ return 0;
+ else
+ return 1;
+}
+
+point_t
+toPoint(int x1, int y1)
+{
+ point_t p;
+
+ p.x = x1;
+ p.y = y1;
+
+ return p;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-2.c
new file mode 100644
index 000000000..0d9b86f6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-2.c
@@ -0,0 +1,15 @@
+/* Simplified by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+ from bug report by Helmut Jarausch <jarausch@igpm.rwth-aachen.de>
+
+ Copyright (C) 1999 Free Software Foundation */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -w" } */
+
+struct {
+ unsigned i[4];
+} foo() {}
+
+void bar() {
+ foo();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-3.c
new file mode 100644
index 000000000..36cc87e7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-3.c
@@ -0,0 +1,112 @@
+/* PR middle-end/31309 */
+/* Origin: Peeter Joot <peeterj@ca.ibm.com> */
+
+/* { dg-do run { target *-*-linux* *-*-gnu* } } */
+
+#include <sys/mman.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+
+#if defined(STACK_SIZE) && (STACK_SIZE < 128*1024)
+ #define CHUNK_SIZE 4096
+#else
+ #define CHUNK_SIZE 16384
+#endif
+
+unsigned long ossAlignX(unsigned long i, unsigned long X)
+{
+ return ((i + (X - 1)) & ~(unsigned long) (X - 1));
+}
+
+struct STRUCT_6_BYTES
+{
+ unsigned char slot[sizeof(unsigned short)];
+ unsigned char page[sizeof(unsigned int)];
+};
+
+struct SQLU_DICT_INFO_0
+{
+ void *pBlah;
+ char bSomeFlag1;
+ char bSomeFlag2;
+ struct STRUCT_6_BYTES dRID;
+};
+
+struct SQLU_DATAPART_0
+{
+ struct SQLU_DICT_INFO_0 *pDictRidderInfo;
+};
+
+struct XXX
+{
+ struct SQLU_DATAPART_0 *m_pDatapart;
+};
+
+struct STRUCT_6_BYTES INIT_6_BYTES_ZERO()
+{
+ struct STRUCT_6_BYTES ridOut = {{0,0}, {0,0,0,0}};
+ return ridOut;
+}
+
+void Initialize(struct XXX *this, int iIndex)
+{
+ struct SQLU_DICT_INFO_0 *pDictRidderInfo
+ = this->m_pDatapart[iIndex].pDictRidderInfo;
+ pDictRidderInfo->bSomeFlag1 = 0;
+ pDictRidderInfo->bSomeFlag2 = 0;
+ pDictRidderInfo->dRID = INIT_6_BYTES_ZERO();
+}
+
+int main(void)
+{
+ int rc;
+
+ struct stuff
+ {
+ char c0[CHUNK_SIZE-sizeof(struct XXX)];
+ struct XXX o;
+ char c1[CHUNK_SIZE*2-sizeof(struct SQLU_DATAPART_0)];
+ struct SQLU_DATAPART_0 dp;
+ char c2[CHUNK_SIZE*2-sizeof(struct SQLU_DICT_INFO_0)];
+ struct SQLU_DICT_INFO_0 di;
+ char c3[CHUNK_SIZE];
+ };
+
+ char buf[sizeof(struct stuff)+CHUNK_SIZE];
+ struct stuff *u
+ = (struct stuff *)ossAlignX((unsigned long)&buf[0], CHUNK_SIZE);
+
+ /* This test assumes system memory page
+ size of CHUNK_SIZE bytes or less. */
+ if (sysconf(_SC_PAGESIZE) > CHUNK_SIZE)
+ return 0;
+
+ memset(u, 1, sizeof(struct stuff));
+ u->c1[0] = '\xAA';
+ u->c2[0] = '\xBB';
+ u->c3[0] = '\xCC';
+
+ rc = mprotect(u->c1, CHUNK_SIZE, PROT_NONE);
+ if (rc == -1)
+ printf("mprotect:c1: %d: %d(%s)\n", rc, errno, strerror(errno));
+
+ rc = mprotect(u->c2, CHUNK_SIZE, PROT_NONE);
+ if (rc == -1)
+ printf("mprotect:c2: %d: %d(%s)\n", rc, errno, strerror(errno));
+
+ rc = mprotect(u->c3, CHUNK_SIZE, PROT_NONE);
+ if (rc == -1)
+ printf("mprotect:c3: %d: %d(%s)\n", rc, errno, strerror(errno));
+
+ u->o.m_pDatapart = &u->dp;
+ u->dp.pDictRidderInfo = &u->di;
+ Initialize(&u->o, 0);
+
+ mprotect(u->c1, CHUNK_SIZE, PROT_READ|PROT_WRITE);
+ mprotect(u->c2, CHUNK_SIZE, PROT_READ|PROT_WRITE);
+ mprotect(u->c3, CHUNK_SIZE, PROT_READ|PROT_WRITE);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-libc.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-libc.c
new file mode 100644
index 000000000..723e1cd02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-ret-libc.c
@@ -0,0 +1,16 @@
+/* Test evolved from source from Simona Perri <perri@mat.unical.it>
+ and Gerald Pfeifer<pfeifer@dbai.tuwien.ac.at>.
+
+ Copyright (C) 2003 Free Software Foundation */
+
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+int main ()
+{
+ div_t d = div (20, 5);
+ if ((d.quot != 4) || (d.rem))
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-1.c
new file mode 100644
index 000000000..8ac90eaee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-1.c
@@ -0,0 +1,19 @@
+/* Test diagnostics for missing and extra semicolons in structures.
+ Test with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s0 { ; };
+struct s1 {
+ int a;
+ ;
+ int b;
+};
+struct s2 {
+ ;
+ int c
+}; /* { dg-warning "no semicolon at end of struct or union" } */
+struct s3 {
+ int d
+}; /* { dg-warning "no semicolon at end of struct or union" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-2.c
new file mode 100644
index 000000000..3708e534f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-2.c
@@ -0,0 +1,20 @@
+/* Test diagnostics for missing and extra semicolons in structures.
+ Test with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+struct s0 { ; }; /* { dg-warning "extra semicolon in struct or union specified" } */
+/* { dg-warning "struct has no members" "empty" { target *-*-* } 7 } */
+struct s1 {
+ int a;
+ ; /* { dg-warning "extra semicolon in struct or union specified" } */
+ int b;
+};
+struct s2 {
+ ; /* { dg-warning "extra semicolon in struct or union specified" } */
+ int c
+}; /* { dg-warning "no semicolon at end of struct or union" } */
+struct s3 {
+ int d
+}; /* { dg-warning "no semicolon at end of struct or union" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-3.c
new file mode 100644
index 000000000..da0f237a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-3.c
@@ -0,0 +1,20 @@
+/* Test diagnostics for missing and extra semicolons in structures.
+ Test with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+struct s0 { ; }; /* { dg-error "extra semicolon in struct or union specified" } */
+/* { dg-error "struct has no members" "empty" { target *-*-* } 7 } */
+struct s1 {
+ int a;
+ ; /* { dg-error "extra semicolon in struct or union specified" } */
+ int b;
+};
+struct s2 {
+ ; /* { dg-error "extra semicolon in struct or union specified" } */
+ int c
+}; /* { dg-error "no semicolon at end of struct or union" } */
+struct s3 {
+ int d
+}; /* { dg-error "no semicolon at end of struct or union" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-4.c
new file mode 100644
index 000000000..6f4dc7c0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/struct-semi-4.c
@@ -0,0 +1,7 @@
+/* Test for missing semicolons in structures: anonymous structures and
+ similar cases. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct s { struct { int a; } }; /* { dg-warning "no semicolon" } */
+int *f (struct s *p) { return &p->a; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/superblock.c b/gcc-4.9/gcc/testsuite/gcc.dg/superblock.c
new file mode 100644
index 000000000..272d161f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/superblock.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-asynchronous-unwind-tables -fsched2-use-superblocks -fdump-rtl-sched2 -fdump-rtl-bbro" } */
+/* { dg-require-effective-target scheduling } */
+
+typedef int aligned __attribute__ ((aligned (64)));
+extern void abort (void);
+
+int bar (void *p);
+
+void
+foo (void)
+{
+ char *p = __builtin_alloca (13);
+ aligned i;
+
+ if (bar (p) || bar (&i))
+ abort ();
+}
+
+/* { dg-final { scan-rtl-dump-times "0 uses" 0 "bbro"} } */
+/* { dg-final { scan-rtl-dump-times "ADVANCING TO" 2 "sched2"} } */
+/* { dg-final { cleanup-rtl-dump "bbro" } } */
+/* { dg-final { cleanup-rtl-dump "sched2" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-1.c
new file mode 100644
index 000000000..1879790dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-fpic -O2" } */
+
+void f (char *s)
+{
+ for (;;)
+ {
+ int t = 6;
+ switch (t)
+ {
+ case 2:
+ *s = '2';
+ case 6: case 4: case 3: case 1:
+ break;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-2.c
new file mode 100644
index 000000000..cedb69f7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-2.c
@@ -0,0 +1,10 @@
+/* PR c/9262 */
+/* Originator: Rasmus Hahn <rassahah@neofonie.de> */
+/* { dg-do compile } */
+
+int foo(int i)
+{
+ switch (i)
+ case 3:
+ return 1,
+} /* { dg-error "parse error|syntax error|expected" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-3.c
new file mode 100644
index 000000000..593c42d8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-3.c
@@ -0,0 +1,12 @@
+/* PR c/9262 */
+/* Originator: Rasmus Hahn <rassahah@neofonie.de> */
+/* { dg-do compile } */
+
+int foo(int i)
+{
+ switch (i)
+ case 3:
+ return 1;
+ case 4: /* { dg-error "not within a switch statement" } */
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-4.c
new file mode 100644
index 000000000..f2d85300d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-4.c
@@ -0,0 +1,24 @@
+/* PR middle-end/17657 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern signed char foo(int);
+
+void bar (void)
+{
+ signed char tmp = foo (0);
+ int t1 = tmp;
+ switch (t1)
+ {
+ case 1: foo (1); break;
+ case 2: foo (2); break;
+ case 3: foo (3); break;
+ case 4: foo (4); break;
+ case 5: foo (5); break;
+ case 6: foo (6); break;
+ case 7: foo (7); break;
+ case 255: foo (8); break;
+ default: break;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-5.c
new file mode 100644
index 000000000..5a5849069
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-5.c
@@ -0,0 +1,75 @@
+/* Test diagnostics for switch statements and labels therein. Test
+ with no special options. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+f (int a, double d, void *p)
+{
+ switch (d) /* { dg-error "switch quantity not an integer" } */
+ {
+ }
+ switch (p) /* { dg-error "switch quantity not an integer" } */
+ {
+ }
+ switch (a)
+ {
+ case (void *)0: ; /* { dg-error "pointers are not permitted as case values" } */
+ }
+ switch (a)
+ {
+ case (double)0: ; /* { dg-error "case label does not reduce to an integer constant" } */
+ }
+ switch (a)
+ {
+ case (char)0: ;
+ }
+ switch (a)
+ {
+ case 0 ... 0: ;
+ }
+ switch (a)
+ {
+ case 0 ... -1: ; /* { dg-warning "empty range specified" } */
+ }
+ switch (a)
+ {
+ case 0 ... -2: ; /* { dg-warning "empty range specified" } */
+ }
+ switch (a)
+ {
+ case 0:
+ default: /* { dg-error "this is the first default label" } */
+ case 1:
+ default: ; /* { dg-error "multiple default labels in one switch" } */
+ }
+ switch (a)
+ {
+ case 0: /* { dg-error "previously used here" } */
+ case 1:
+ case 0: ; /* { dg-error "duplicate case value" } */
+ }
+ case 1: ; /* { dg-error "case label not within a switch statement" } */
+ default: ; /* { dg-error "'default' label not within a switch statement" } */
+ break; /* { dg-error "break statement not within loop or switch" } */
+ continue; /* { dg-error "continue statement not within a loop" } */
+ switch (a)
+ {
+ case a: ; /* { dg-error "case label does not reduce to an integer constant" } */
+ }
+ switch (a)
+ {
+ case 0: /* { dg-error "this is the first entry overlapping that value" } */
+ case -1 ... 1: /* { dg-error "duplicate \\(or overlapping\\) case value" } */
+ case 2 ... 3: /* { dg-error "previously used here" } */
+ case 2: /* { dg-error "duplicate case value" } */
+ case 4 ... 7: /* { dg-error "this is the first entry overlapping that value" } */
+ case 6 ... 9: ; /* { dg-error "duplicate \\(or overlapping\\) case value" } */
+ }
+ switch (a)
+ {
+ case 0:
+ continue; /* { dg-error "continue statement not within a loop" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-6.c
new file mode 100644
index 000000000..25d1d96b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-6.c
@@ -0,0 +1,14 @@
+/* Test diagnostics for switch statements and labels therein. Test
+ for case ranges with -pedantic. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+void
+f (int a)
+{
+ switch (a)
+ {
+ case 0 ... 0: ; /* { dg-warning "range expressions in switch statements are non-standard" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c
new file mode 100644
index 000000000..29cb82569
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-7.c
@@ -0,0 +1,14 @@
+/* Test diagnostics for switch statements and labels therein. Test
+ for case ranges with -pedantic-errors. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors" } */
+
+void
+f (int a)
+{
+ switch (a)
+ {
+ case 0 ... 0: ; /* { dg-error "range expressions in switch statements are non-standard" } */
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-8.c
new file mode 100644
index 000000000..fcb3f602e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-8.c
@@ -0,0 +1,10 @@
+/* PR middle-end/18493 */
+/* { dg-do link } */
+
+int main() {
+goto bug;
+switch(0) {
+bug: return 0;
+}
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-9.c
new file mode 100644
index 000000000..2ae89d095
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-9.c
@@ -0,0 +1,25 @@
+/* PR middle-end/18859 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void foo(int a)
+{
+ switch (a)
+ {
+ case 0 ... -1: /* { dg-warning "empty range" } */
+ a = a+2;
+ break;
+
+ case 1 ... 2:
+ a = 0;
+ break;
+
+ case 3 ... 4:
+ a = 1;
+ break;
+
+ case 5 ... 6:
+ a = 0;
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-A.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-A.c
new file mode 100644
index 000000000..3bc04c017
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-A.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void foo()
+{
+ switch (,) { } /* { dg-error "expected expression before" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-1.c
new file mode 100644
index 000000000..04ca4e367
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-1.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort (void);
+extern void exit (int);
+
+/* Check that out-of-bounds case warnings work in the case that the
+ testing expression is promoted. */
+int
+foo1 (unsigned char i)
+{
+ switch (i)
+ {
+ case -1: /* { dg-warning "case label value is less than minimum value for type" } */
+ return 1;
+ case 256: /* { dg-warning "case label value exceeds maximum value for type" } */
+ return 2;
+ default:
+ return 3;
+ }
+}
+
+/* Like above, but for case ranges that need to be satured. */
+int
+foo2 (unsigned char i)
+{
+ switch (i)
+ {
+ case -1 ... 1: /* { dg-warning "lower value in case label range less than minimum value for type" } */
+ return 1;
+ case 254 ... 256: /* { dg-warning "upper value in case label range exceeds maximum value for type" } */
+ return 2;
+ default:
+ return 3;
+ }
+}
+
+int
+main (void)
+{
+ if (foo1 (10) != 3)
+ abort ();
+ if (foo2 (10) != 3)
+ abort ();
+ exit (0);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-2.c
new file mode 100644
index 000000000..7778b66e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-2.c
@@ -0,0 +1,26 @@
+/* This should not warn about the case label being out of range. */
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+foo (unsigned int i)
+{
+ switch (i)
+ {
+ case 123456123456ULL: /* { dg-warning "large integer implicitly truncated to unsigned type" } */
+ return 0;
+ default:
+ return 3;
+ }
+}
+
+int
+main (void)
+{
+ if (foo (10) != 3)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-3.c
new file mode 100644
index 000000000..e13b4f58a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/switch-warn-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-Wswitch-enum" } */
+
+enum a { a0, a1, a2, a3 };
+
+int error(enum a aa)
+{
+ switch ( aa )
+ {
+ case a0 ... a3:
+ return 1;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sync-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/sync-1.c
new file mode 100644
index 000000000..f8cabe47a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sync-1.c
@@ -0,0 +1,40 @@
+/* Validate that the __sync builtins are overloaded properly. */
+/* { dg-do compile } */
+/* { dg-options "-Werror" } */
+
+#define TEST1(TYPE, BUILTIN) \
+void t_##TYPE##BUILTIN(TYPE *p) \
+{ \
+ __typeof(BUILTIN(p, 1)) *pp; \
+ pp = p; \
+}
+
+#define TEST2(BUILTIN) \
+ TEST1(int, BUILTIN) \
+ TEST1(long, BUILTIN)
+
+TEST2(__sync_fetch_and_add)
+TEST2(__sync_fetch_and_sub)
+TEST2(__sync_fetch_and_or)
+TEST2(__sync_fetch_and_and)
+TEST2(__sync_fetch_and_xor)
+TEST2(__sync_fetch_and_nand)
+
+TEST2(__sync_add_and_fetch)
+TEST2(__sync_sub_and_fetch)
+TEST2(__sync_or_and_fetch)
+TEST2(__sync_and_and_fetch)
+TEST2(__sync_xor_and_fetch)
+TEST2(__sync_nand_and_fetch)
+
+TEST2(__sync_lock_test_and_set)
+
+#define TEST3(TYPE) \
+void t_##TYPE##__sync_val_compare_and_swap(TYPE *p) \
+{ \
+ __typeof(__sync_val_compare_and_swap(p, 1, 2)) *pp; \
+ pp = p; \
+}
+
+TEST3(int)
+TEST3(long)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sync-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/sync-2.c
new file mode 100644
index 000000000..78aa8cb20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sync-2.c
@@ -0,0 +1,105 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-options "-ansi" } */
+/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
+
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "fetch_and_nand" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "nand_and_fetch" { target *-*-* } 0 } */
+
+/* Test functionality of the intrinsics for 'short' and 'char'. */
+
+extern void abort (void);
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+
+static char AI[18];
+static char init_qi[18] = { 3,5,7,9,0,0,0 ,0 ,-1,0,0,-1,0,0 ,-1,0,0,-1 };
+static char test_qi[18] = { 3,5,7,9,1,4,22,-12,7 ,8,9,~7,1,-12,7 ,8,9,~7 };
+
+static void
+do_qi (void)
+{
+ if (__sync_fetch_and_add(AI+4, 1) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AI+5, 4) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AI+6, 22) != 0)
+ abort ();
+ if (__sync_fetch_and_sub(AI+7, 12) != 0)
+ abort ();
+ if (__sync_fetch_and_and(AI+8, 7) != (char)-1)
+ abort ();
+ if (__sync_fetch_and_or(AI+9, 8) != 0)
+ abort ();
+ if (__sync_fetch_and_xor(AI+10, 9) != 0)
+ abort ();
+ if (__sync_fetch_and_nand(AI+11, 7) != (char)-1)
+ abort ();
+
+ if (__sync_add_and_fetch(AI+12, 1) != 1)
+ abort ();
+ if (__sync_sub_and_fetch(AI+13, 12) != (char)-12)
+ abort ();
+ if (__sync_and_and_fetch(AI+14, 7) != 7)
+ abort ();
+ if (__sync_or_and_fetch(AI+15, 8) != 8)
+ abort ();
+ if (__sync_xor_and_fetch(AI+16, 9) != 9)
+ abort ();
+ if (__sync_nand_and_fetch(AI+17, 7) != (char)~7)
+ abort ();
+}
+
+static short AL[18];
+static short init_hi[18] = { 3,5,7,9,0,0,0 ,0 ,-1,0,0,-1,0,0 ,-1,0,0,-1 };
+static short test_hi[18] = { 3,5,7,9,1,4,22,-12,7 ,8,9,~7,1,-12,7 ,8,9,~7 };
+
+static void
+do_hi (void)
+{
+ if (__sync_fetch_and_add(AL+4, 1) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AL+5, 4) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AL+6, 22) != 0)
+ abort ();
+ if (__sync_fetch_and_sub(AL+7, 12) != 0)
+ abort ();
+ if (__sync_fetch_and_and(AL+8, 7) != -1)
+ abort ();
+ if (__sync_fetch_and_or(AL+9, 8) != 0)
+ abort ();
+ if (__sync_fetch_and_xor(AL+10, 9) != 0)
+ abort ();
+ if (__sync_fetch_and_nand(AL+11, 7) != -1)
+ abort ();
+
+ if (__sync_add_and_fetch(AL+12, 1) != 1)
+ abort ();
+ if (__sync_sub_and_fetch(AL+13, 12) != -12)
+ abort ();
+ if (__sync_and_and_fetch(AL+14, 7) != 7)
+ abort ();
+ if (__sync_or_and_fetch(AL+15, 8) != 8)
+ abort ();
+ if (__sync_xor_and_fetch(AL+16, 9) != 9)
+ abort ();
+ if (__sync_nand_and_fetch(AL+17, 7) != ~7)
+ abort ();
+}
+
+int main()
+{
+ memcpy(AI, init_qi, sizeof(init_qi));
+ memcpy(AL, init_hi, sizeof(init_hi));
+
+ do_qi ();
+ do_hi ();
+
+ if (memcmp (AI, test_qi, sizeof(test_qi)))
+ abort ();
+ if (memcmp (AL, test_hi, sizeof(test_hi)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/sync-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/sync-3.c
new file mode 100644
index 000000000..255faaabc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/sync-3.c
@@ -0,0 +1,102 @@
+/* { dg-do run } */
+/* { dg-require-effective-target sync_char_short } */
+/* { dg-options "-ansi" } */
+/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
+
+/* Test functionality of the intrinsics for 'short' and 'char'. */
+
+extern void abort (void);
+extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+
+static char AI[18] __attribute__((__aligned__ (4)));
+static char init_qi[18] = { 3,5,7,9,0,0,0 ,0 ,-1,0,0,-1,0,0 ,-1,0,0,-1 };
+static char test_qi[18] = { 3,5,7,9,1,4,22,-12,7 ,8,9,~7,1,-12,7 ,8,9,~7 };
+
+static void
+do_qi (void)
+{
+ if (__sync_fetch_and_add(AI+4, 1) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AI+5, 4) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AI+6, 22) != 0)
+ abort ();
+ if (__sync_fetch_and_sub(AI+7, 12) != 0)
+ abort ();
+ if (__sync_fetch_and_and(AI+8, 7) != (char)-1)
+ abort ();
+ if (__sync_fetch_and_or(AI+9, 8) != 0)
+ abort ();
+ if (__sync_fetch_and_xor(AI+10, 9) != 0)
+ abort ();
+ if (__sync_fetch_and_nand(AI+11, 7) != (char)-1) /* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" } */
+ abort ();
+
+ if (__sync_add_and_fetch(AI+12, 1) != 1)
+ abort ();
+ if (__sync_sub_and_fetch(AI+13, 12) != (char)-12)
+ abort ();
+ if (__sync_and_and_fetch(AI+14, 7) != 7)
+ abort ();
+ if (__sync_or_and_fetch(AI+15, 8) != 8)
+ abort ();
+ if (__sync_xor_and_fetch(AI+16, 9) != 9)
+ abort ();
+ if (__sync_nand_and_fetch(AI+17, 7) != (char)~7) /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" } */
+ abort ();
+}
+
+static short AL[18];
+static short init_hi[18] = { 3,5,7,9,0,0,0 ,0 ,-1,0,0,-1,0,0 ,-1,0,0,-1 };
+static short test_hi[18] = { 3,5,7,9,1,4,22,-12,7 ,8,9,~7,1,-12,7 ,8,9,~7 };
+
+static void
+do_hi (void)
+{
+ if (__sync_fetch_and_add(AL+4, 1) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AL+5, 4) != 0)
+ abort ();
+ if (__sync_fetch_and_add(AL+6, 22) != 0)
+ abort ();
+ if (__sync_fetch_and_sub(AL+7, 12) != 0)
+ abort ();
+ if (__sync_fetch_and_and(AL+8, 7) != -1)
+ abort ();
+ if (__sync_fetch_and_or(AL+9, 8) != 0)
+ abort ();
+ if (__sync_fetch_and_xor(AL+10, 9) != 0)
+ abort ();
+ if (__sync_fetch_and_nand(AL+11, 7) != -1)
+ abort ();
+
+ if (__sync_add_and_fetch(AL+12, 1) != 1)
+ abort ();
+ if (__sync_sub_and_fetch(AL+13, 12) != -12)
+ abort ();
+ if (__sync_and_and_fetch(AL+14, 7) != 7)
+ abort ();
+ if (__sync_or_and_fetch(AL+15, 8) != 8)
+ abort ();
+ if (__sync_xor_and_fetch(AL+16, 9) != 9)
+ abort ();
+ if (__sync_nand_and_fetch(AL+17, 7) != ~7)
+ abort ();
+}
+
+int main()
+{
+ memcpy(AI, init_qi, sizeof(init_qi));
+ memcpy(AL, init_hi, sizeof(init_hi));
+
+ do_qi ();
+ do_hi ();
+
+ if (memcmp (AI, test_qi, sizeof(test_qi)))
+ abort ();
+ if (memcmp (AL, test_hi, sizeof(test_hi)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/system-binary-constants-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/system-binary-constants-1.c
new file mode 100644
index 000000000..921ee2086
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/system-binary-constants-1.c
@@ -0,0 +1,18 @@
+/*
+ Origin: Dodji Seketeli <dodji@redhat.com>
+ { dg-options "-std=iso9899:1999 -pedantic" }
+ { dg-do compile }
+ */
+
+#include "system-binary-constants-1.h"
+
+int
+foo (void)
+{
+#if BINARY_INT_CONSTANT_IN_SYSTEM_HEADER /* A binary constant defined
+ in system header. No
+ warning. */
+ return 23;
+#endif
+ return 0b1101; /* { dg-warning "binary constants are a GCC extension" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/system-binary-constants-1.h b/gcc-4.9/gcc/testsuite/gcc.dg/system-binary-constants-1.h
new file mode 100644
index 000000000..85f291742
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/system-binary-constants-1.h
@@ -0,0 +1,3 @@
+#pragma GCC system_header
+
+#define BINARY_INT_CONSTANT_IN_SYSTEM_HEADER 0b1101
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tail-merge-store.c b/gcc-4.9/gcc/testsuite/gcc.dg/tail-merge-store.c
new file mode 100644
index 000000000..1aefbdc14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tail-merge-store.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */
+
+int z;
+int x;
+
+void
+f (int c, int d)
+{
+ if (c)
+ z = 5;
+ else
+ {
+ if (d)
+ x = 4;
+ z = 5;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "duplicate of" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times "z = 5" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tg-tests.h b/gcc-4.9/gcc/testsuite/gcc.dg/tg-tests.h
new file mode 100644
index 000000000..ce9cfb866
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tg-tests.h
@@ -0,0 +1,148 @@
+/* Test various type-generic builtins by calling "main_tests()". */
+
+#define FP_NAN 1
+#define FP_INFINITE 2
+#define FP_NORMAL 3
+#define FP_SUBNORMAL 4
+#define FP_ZERO 5
+#define fpclassify(X) __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, (X))
+
+void __attribute__ ((__noinline__))
+foo_1 (float f, double d, long double ld,
+ int res_unord, int res_isnan, int res_isinf,
+ int res_isinf_sign, int res_isfin, int res_isnorm,
+ int classification)
+{
+ if (__builtin_isunordered (f, 0) != res_unord)
+ __builtin_abort ();
+ if (__builtin_isunordered (0, f) != res_unord)
+ __builtin_abort ();
+ if (__builtin_isunordered (d, 0) != res_unord)
+ __builtin_abort ();
+ if (__builtin_isunordered (0, d) != res_unord)
+ __builtin_abort ();
+ if (__builtin_isunordered (ld, 0) != res_unord)
+ __builtin_abort ();
+ if (__builtin_isunordered (0, ld) != res_unord)
+ __builtin_abort ();
+
+ if (__builtin_isnan (f) != res_isnan)
+ __builtin_abort ();
+ if (__builtin_isnan (d) != res_isnan)
+ __builtin_abort ();
+ if (__builtin_isnan (ld) != res_isnan)
+ __builtin_abort ();
+ if (__builtin_isnanf (f) != res_isnan)
+ __builtin_abort ();
+ if (__builtin_isnanl (ld) != res_isnan)
+ __builtin_abort ();
+
+ if (__builtin_isinf (f) != res_isinf)
+ __builtin_abort ();
+ if (__builtin_isinf (d) != res_isinf)
+ __builtin_abort ();
+ if (__builtin_isinf (ld) != res_isinf)
+ __builtin_abort ();
+ if (__builtin_isinff (f) != res_isinf)
+ __builtin_abort ();
+ if (__builtin_isinfl (ld) != res_isinf)
+ __builtin_abort ();
+
+ if (__builtin_isinf_sign (f) != res_isinf_sign)
+ __builtin_abort ();
+ if (__builtin_isinf_sign (d) != res_isinf_sign)
+ __builtin_abort ();
+ if (__builtin_isinf_sign (ld) != res_isinf_sign)
+ __builtin_abort ();
+
+ if (__builtin_isnormal (f) != res_isnorm)
+ __builtin_abort ();
+ if (__builtin_isnormal (d) != res_isnorm)
+ __builtin_abort ();
+ if (__builtin_isnormal (ld) != res_isnorm)
+ __builtin_abort ();
+
+ if (__builtin_isfinite (f) != res_isfin)
+ __builtin_abort ();
+ if (__builtin_isfinite (d) != res_isfin)
+ __builtin_abort ();
+ if (__builtin_isfinite (ld) != res_isfin)
+ __builtin_abort ();
+
+ if (__builtin_finitef (f) != res_isfin)
+ __builtin_abort ();
+ if (__builtin_finite (f) != res_isfin)
+ __builtin_abort ();
+ if (__builtin_finite (d) != res_isfin)
+ __builtin_abort ();
+ if (__builtin_finitel (d) != res_isfin)
+ __builtin_abort ();
+ if (__builtin_finitel (ld) != res_isfin)
+ __builtin_abort ();
+
+ /* Subnormals can abruptly underflow to zero in unsafe math
+ mode, so bypass testing these numbers if necessary. */
+#ifdef UNSAFE
+ if (classification != FP_SUBNORMAL)
+#endif
+ {
+ if (fpclassify(f) != classification)
+ __builtin_abort ();
+ if (fpclassify(d) != classification)
+ __builtin_abort ();
+ if (fpclassify(ld) != classification)
+ __builtin_abort ();
+ }
+}
+
+void __attribute__ ((__noinline__))
+foo (float f, double d, long double ld,
+ int res_unord, int res_isnan, int res_isinf,
+ int res_isfin, int res_isnorm, int classification)
+{
+ foo_1 (f, d, ld, res_unord, res_isnan, res_isinf, res_isinf, res_isfin, res_isnorm, classification);
+ /* Try all the values negated as well. */
+ foo_1 (-f, -d, -ld, res_unord, res_isnan, res_isinf, -res_isinf, res_isfin, res_isnorm, classification);
+}
+
+int __attribute__ ((__noinline__))
+main_tests (void)
+{
+ volatile float f;
+ volatile double d;
+ volatile long double ld;
+
+ /* Test NaN. */
+ f = __builtin_nanf(""); d = __builtin_nan(""); ld = __builtin_nanl("");
+ foo(f, d, ld, /*unord=*/ 1, /*isnan=*/ 1, /*isinf=*/ 0, /*isfin=*/ 0, /*isnorm=*/ 0, FP_NAN);
+
+ /* Test infinity. */
+ f = __builtin_inff(); d = __builtin_inf(); ld = __builtin_infl();
+ foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INFINITE);
+
+ /* Test zero. */
+ f = 0; d = 0; ld = 0;
+ foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 0, /*isfin=*/ 1, /*isnorm=*/ 0, FP_ZERO);
+
+ /* Test one. */
+ f = 1; d = 1; ld = 1;
+ foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 0, /*isfin=*/ 1, /*isnorm=*/ 1, FP_NORMAL);
+
+ /* Test minimum values. */
+ f = __FLT_MIN__; d = __DBL_MIN__; ld = __LDBL_MIN__;
+ foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 0, /*isfin=*/ 1, /*isnorm=*/ 1, FP_NORMAL);
+
+ /* Test subnormal values. */
+ f = __FLT_MIN__/2; d = __DBL_MIN__/2; ld = __LDBL_MIN__/2;
+ foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 0, /*isfin=*/ 1, /*isnorm=*/ 0, FP_SUBNORMAL);
+
+ /* Test maximum values. */
+ f = __FLT_MAX__; d = __DBL_MAX__; ld = __LDBL_MAX__;
+ foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 0, /*isfin=*/ 1, /*isnorm=*/ 1, FP_NORMAL);
+
+ /* Test overflow values. */
+ f = __FLT_MAX__*2; d = __DBL_MAX__*2; ld = __LDBL_MAX__*2;
+ foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INFINITE);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/titype-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/titype-1.c
new file mode 100644
index 000000000..ef860b90a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/titype-1.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+
+/* Not all platforms support TImode integers. */
+#if (defined(__LP64__) && !defined(__hppa__)) || defined(_WIN64) || defined(__SPU__)
+typedef int TItype __attribute__ ((mode (TI)));
+#else
+typedef long TItype;
+#endif
+
+#include <stdarg.h>
+
+extern void abort(void);
+
+
+void foo(int i, ...)
+{
+ TItype q;
+ va_list va;
+
+ va_start(va, i);
+ q = va_arg(va, TItype);
+ va_end(va);
+
+ if (q != 5)
+ abort();
+}
+
+int main(void)
+{
+ TItype q = 5;
+
+ foo(1, q);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/alias-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/alias-1.c
new file mode 100644
index 000000000..722ad2154
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/alias-1.c
@@ -0,0 +1,24 @@
+/* { dg-do link } */
+/* { dg-require-alias "" } */
+/* { dg-require-visibility "" } */
+/* { dg-require-effective-target tls_runtime } */
+/* Test that encode_section_info handles the change from externally
+ defined to locally defined (via hidden). Extracted from glibc. */
+
+struct __res_state {
+ char x[123];
+};
+
+extern __thread struct __res_state bar
+ __attribute__ ((tls_model ("initial-exec")));
+
+int main()
+{
+ bar.x[0] = 0;
+ return 0;
+}
+
+__thread struct __res_state foo;
+extern __thread struct __res_state bar
+ __attribute__ ((alias ("foo")))
+ __attribute__ ((visibility ("hidden")));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/alpha-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/alpha-1.c
new file mode 100644
index 000000000..1f0d6eda1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/alpha-1.c
@@ -0,0 +1,10 @@
+/* Make sure that we honor initial-exec. */
+/* { dg-do compile { target alpha*-*-* } } */
+/* { dg-options "" } */
+/* { dg-require-effective-target tls_native } */
+
+static __thread int xyzzy __attribute__ ((tls_model ("initial-exec")));
+int foo(void) { return xyzzy; }
+
+/* { dg-final { scan-assembler "gottprel" } } */
+/* { dg-final { scan-assembler-not "tprel(lo|hi|16)" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/asm-1.c
new file mode 100644
index 000000000..b77e550d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/asm-1.c
@@ -0,0 +1,8 @@
+/* { dg-options "-Werror" } */
+/* { dg-require-effective-target tls } */
+__thread int i;
+
+int foo ()
+{
+ asm volatile ("" :: "m" (&i)); /* { dg-error "directly addressable" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/debug-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/debug-1.c
new file mode 100644
index 000000000..67d7be69c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/debug-1.c
@@ -0,0 +1,5 @@
+/* { dg-do assemble } */
+/* { dg-options "-g" } */
+/* { dg-require-effective-target tls } */
+
+__thread int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-1.c
new file mode 100644
index 000000000..56b570c94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-1.c
@@ -0,0 +1,12 @@
+/* Valid __thread specifiers. */
+/* { dg-require-effective-target tls } */
+
+__thread int g1;
+extern __thread int g2;
+static __thread int g3;
+
+void foo()
+{
+ extern __thread int l1;
+ static __thread int l2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-2.c
new file mode 100644
index 000000000..854824385
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-2.c
@@ -0,0 +1,22 @@
+/* Invalid __thread specifiers. */
+/* { dg-require-effective-target tls } */
+
+__thread extern int g1; /* { dg-error "'__thread' before 'extern'" } */
+__thread static int g2; /* { dg-error "'__thread' before 'static'" } */
+__thread __thread int g3; /* { dg-error "duplicate" } */
+typedef __thread int g4; /* { dg-error "'__thread' used with 'typedef'" } */
+
+void foo()
+{
+ __thread int l1; /* { dg-error "implicitly auto and declared '__thread'" } */
+ auto __thread int l2; /* { dg-error "'__thread' used with 'auto'" } */
+ __thread extern int l3; /* { dg-error "'__thread' before 'extern'" } */
+ register __thread int l4; /* { dg-error "'__thread' used with 'register'" } */
+}
+
+__thread void f1 (); /* { dg-error "invalid storage class for function" } */
+extern __thread void f2 (); /* { dg-error "invalid storage class for function" } */
+static __thread void f3 (); /* { dg-error "invalid storage class for function" } */
+__thread void f4 () { } /* { dg-error "function definition declared '__thread'" } */
+
+void bar(__thread int p1); /* { dg-error "storage class specified for parameter" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-3.c
new file mode 100644
index 000000000..1a7994c69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-3.c
@@ -0,0 +1,11 @@
+/* Report invalid extern and __thread combinations. */
+/* { dg-require-effective-target tls } */
+
+extern int j; /* { dg-message "note: previous declaration" } */
+__thread int j; /* { dg-error "follows non-thread-local" } */
+
+extern __thread int i; /* { dg-message "note: previous declaration" } */
+int i; /* { dg-error "follows thread-local" } */
+
+extern __thread int k; /* This is fine. */
+__thread int k;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-4.c
new file mode 100644
index 000000000..fed2f3acc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-4.c
@@ -0,0 +1,11 @@
+/* Invalid __thread specifiers. As diag-4.c but some cases in
+ different orders. */
+/* { dg-require-effective-target tls } */
+
+__thread typedef int g4; /* { dg-error "'__thread' used with 'typedef'" } */
+
+void foo()
+{
+ __thread auto int l2; /* { dg-error "'__thread' used with 'auto'" } */
+ __thread register int l4; /* { dg-error "'__thread' used with 'register'" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-5.c
new file mode 100644
index 000000000..ac78cb295
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-5.c
@@ -0,0 +1,4 @@
+/* __thread specifiers on empty declarations. */
+/* { dg-require-effective-target tls } */
+
+__thread struct foo; /* { dg-warning "useless '__thread' in empty declaration" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-6.c
new file mode 100644
index 000000000..71b0b9524
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/diag-6.c
@@ -0,0 +1,8 @@
+/* Invalid tls_model attributes. PR 35435. */
+/* { dg-require-effective-target tls } */
+
+int v __attribute__((tls_model("initial-exec"))); /* { dg-warning "attribute ignored" } */
+typedef int X __attribute__((tls_model("initial-exec"))); /* { dg-warning "attribute ignored" } */
+void f(int x __attribute__((tls_model("initial-exec")))); /* { dg-warning "attribute ignored" } */
+__thread int a __attribute__((tls_model(1))); /* { dg-error "tls_model argument not a string" } */
+__thread int b __attribute__((tls_model("unknown"))); /* { dg-error "tls_model argument must be one of" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/emutls-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/emutls-1.c
new file mode 100644
index 000000000..3b3577c89
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/emutls-1.c
@@ -0,0 +1,22 @@
+/* { dg-do run { target *-wrs-vxworks } } */
+/* { dg-require-effective-target tls } */
+/* { dg-add-options tls } */
+
+/* vxworks' TLS model requires no extra padding on the tls proxy
+ objects. */
+
+__thread int i;
+__thread int j;
+
+extern int __tls__i;
+extern int __tls__j;
+
+int main ()
+{
+ int delta = ((char *)&__tls__j - (char *)&__tls__i);
+
+ if (delta < 0)
+ delta = -delta;
+
+ return delta != 12;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/emutls-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/emutls-2.c
new file mode 100644
index 000000000..1e26d5fe1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/emutls-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+/* { dg-options "-O2" } */
+
+/* With emulated TLS, the constructor generated during IPA
+ was not properly lowered to SSA form. */
+
+__thread int i __attribute__((common));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/init-1.c
new file mode 100644
index 000000000..fa4208dce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/init-1.c
@@ -0,0 +1,5 @@
+/* Invalid initializations. */
+/* { dg-require-effective-target tls } */
+
+extern __thread int i;
+int *p = &i; /* { dg-error "initializer element is not constant" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/nonpic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/nonpic-1.c
new file mode 100644
index 000000000..9c592a985
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/nonpic-1.c
@@ -0,0 +1,72 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftls-model=initial-exec" } */
+/* { dg-require-effective-target tls } */
+
+extern __thread long e1;
+extern __thread int e2;
+static __thread long s1;
+static __thread int s2;
+
+long *ae1 (void)
+{
+ return &e1;
+}
+
+int *ae2 (void)
+{
+ return &e2;
+}
+
+long *as1 (void)
+{
+ return &s1;
+}
+
+int *as2 (void)
+{
+ return &s2;
+}
+
+long ge1 (void)
+{
+ return e1;
+}
+
+int ge2 (void)
+{
+ return e2;
+}
+
+long gs1 (void)
+{
+ return s1;
+}
+
+int gs2 (void)
+{
+ return s2;
+}
+
+long ge3 (void)
+{
+ return e1 + e2;
+}
+
+long gs3 (void)
+{
+ return s1 + s2;
+}
+
+long ge4 (void)
+{
+ if (0)
+ return e1;
+ return e2;
+}
+
+long gs4 (void)
+{
+ if (0)
+ return s1;
+ return s2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-1.c
new file mode 100644
index 000000000..658fc67c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-1.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-options "-O2 -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target fpic } */
+
+extern __thread int thr;
+
+static int x;
+
+static void
+bar (void)
+{
+ x = 1;
+}
+
+static void
+#ifdef __i386__
+__attribute__ ((regparm (3)))
+#endif
+foo (const char *x, void *y, int *z)
+{
+ bar ();
+}
+
+void
+test (const char *x, void *y)
+{
+ foo (x, y, &thr);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-10.c
new file mode 100644
index 000000000..15dc68610
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-10.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O3 -fpic" } */
+/* { dg-require-effective-target tls } */
+
+/* The web pass was creating unrecognisable pic_load_dot_plus_four insns
+ on ARM. */
+
+__thread int a_thread_local;
+void *
+spin (int n)
+{
+ int i;
+ for (i = 0; i <= n; i++)
+ {
+ a_thread_local += i;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-11.c
new file mode 100644
index 000000000..edfe16b7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-11.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern void *memset (void *, int, size_t);
+
+struct A
+{
+ char pad[48];
+ int i;
+ int pad2;
+ int j;
+};
+__thread struct A a;
+
+int *
+__attribute__((noinline))
+foo (void)
+{
+ return &a.i;
+}
+
+int
+main (void)
+{
+ int *p = foo ();
+ memset (&a, 0, sizeof (a));
+ a.i = 6;
+ a.j = 8;
+ if (p[0] != 6 || p[1] != 0 || p[2] != 8)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-12.c
new file mode 100644
index 000000000..7b9e498a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-12.c
@@ -0,0 +1,51 @@
+/* PR target/29198 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fpic" } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+/* { dg-require-effective-target fpic } */
+
+extern void abort (void);
+
+int f2 (int, int, int, int);
+struct s { char b[4]; };
+__thread struct s thra[2];
+
+void
+__attribute__((noinline))
+f1 (int a1, int a2)
+{
+ int i, j;
+ for (i = 0; i < 4; i++)
+ {
+ int tot = 0;
+ for (j = 0; j < 4; j++)
+ tot += f2 (a1, a2, i, j);
+ *(&thra[0].b[0] + i) = tot;
+ }
+}
+
+int
+__attribute__((noinline))
+f2 (int a, int b, int c, int d)
+{
+ return a + b + c + d;
+}
+
+int
+main (void)
+{
+ f1 (0, 0);
+ if (thra[0].b[0] != 6
+ || thra[0].b[1] != 10
+ || thra[0].b[2] != 14
+ || thra[0].b[3] != 18)
+ abort ();
+ f1 (2, 3);
+ if (thra[0].b[0] != 26
+ || thra[0].b[1] != 30
+ || thra[0].b[2] != 34
+ || thra[0].b[3] != 38)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-13.c
new file mode 100644
index 000000000..8eea76b68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-13.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+__thread struct
+{
+ int a;
+ char b[32];
+} thr;
+
+int
+main ()
+{
+ __builtin_strcpy (thr.b, "abcd");
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-14.c
new file mode 100644
index 000000000..5abeacea7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-14.c
@@ -0,0 +1,28 @@
+/* This testcase generated invalid assembly on ARM Thumb-2. Two
+ PIC additions of pc were combined, but the deleted label was still
+ used. */
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+struct __res_state
+{
+ int options;
+};
+extern __thread struct __res_state *__resp
+ __attribute__ ((tls_model ("initial-exec")));
+
+void foo (void);
+
+int main(void)
+{
+ int count, total = 0;
+
+ for (count = 0; count < 10; count++)
+ {
+ if (((*__resp).options & 0x00000001) == 0)
+ foo ();
+ (*__resp).options &= ~((0x00000002 | 0x00000200 | 0x00000080));
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-15.c
new file mode 100644
index 000000000..a6cc7214a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-15.c
@@ -0,0 +1,24 @@
+/* PR target/42564 */
+/* This used to ICE on the SPARC because of an unrecognized TLS pattern. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -fPIC" } */
+/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target fpic } */
+
+extern void *memset(void *s, int c, __SIZE_TYPE__ n);
+
+struct S1 { int i; };
+
+struct S2
+{
+ int ver;
+ struct S1 s;
+};
+
+static __thread struct S2 m;
+
+void init(void)
+{
+ memset(&m.s, 0, sizeof(m.s));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-2.c
new file mode 100644
index 000000000..868b97c5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-2.c
@@ -0,0 +1,55 @@
+/* This testcase generated invalid assembly on IA-32,
+ since %gs:0 memory load was not exposed to the compiler
+ as memory load and mem to mem moves are not possible
+ on IA-32. */
+/* { dg-do link } */
+/* { dg-options "-O2 -ftls-model=initial-exec" } */
+/* { dg-options "-O2 -ftls-model=initial-exec -march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_runtime } */
+
+__thread int thr;
+
+struct A
+{
+ unsigned int a, b, c, d, e;
+};
+
+int bar (int x, unsigned long y, void *z)
+{
+ return 0;
+}
+
+int
+foo (int x, int y, const struct A *z)
+{
+ struct A b;
+ int d;
+
+ b = *z;
+ d = bar (x, y, &b);
+ if (d == 0 && y == 0x5402)
+ {
+ int e = thr;
+ d = bar (x, 0x5401, &b);
+ if (d)
+ {
+ thr = e;
+ d = 0;
+ }
+ else if ((z->c & 0600) != (b.c & 0600)
+ || ((z->c & 060) && ((z->c & 060) != (b.c & 060))))
+ {
+ thr = 22;
+ d = -1;
+ }
+ }
+
+ return d;
+}
+
+int main (void)
+{
+ foo (1, 2, 0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-3.c
new file mode 100644
index 000000000..0f1bbfcd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpic" } */
+/* { dg-options "-O2 -fpic -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target fpic } */
+
+extern __thread int i, j, k;
+extern void bar(int *, int *, int *);
+void foo(void)
+{
+ bar(&i, &j, &k);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-4.c
new file mode 100644
index 000000000..3d7953b47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-4.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls_native } */
+
+struct A
+{
+ int a1;
+ int a2;
+};
+
+extern __thread const unsigned char *tcc1, **tcc2;
+
+extern inline const unsigned char ** __attribute__ ((const))
+foo (void)
+{
+ const unsigned char **a = &tcc1;
+ if (*a == 0)
+ *a = *tcc2 + 128;
+ return a;
+}
+
+extern inline int
+bar (const struct A *x)
+{
+ int a;
+
+ if (x->a2 & 8)
+ return 0;
+ a = x->a1;
+ return a > 0 && ((*foo ())[a] & 64);
+}
+
+int
+baz (const struct A *x, char *y)
+{
+ const struct A *a;
+
+ for (a = x; !!a->a1; a++)
+ if (! (x->a2 & 8))
+ if (bar (a))
+ {
+ *y++ = a->a1;
+ if (x->a1)
+ *y++ = ':';
+ *y = '\0';
+ }
+ return 0;
+}
+
+/* Verify tcc1 and tcc2 variables show up only in the TLS access sequences. */
+/* { dg-final { scan-assembler "tcc1@" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler "tcc2@" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler-not "tcc1\[^@\]" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler-not "tcc2\[^@\]" { target i?86-*-* x86_64-*-* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-5.c
new file mode 100644
index 000000000..0ae9f075d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-5.c
@@ -0,0 +1,110 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+/* Sched1 moved {load_tp} pattern between strlen call and the copy
+ of the hard return value to its pseudo. This resulted in a
+ reload abort, since the hard register was not spillable. */
+
+extern __thread int __libc_errno __attribute__ ((tls_model ("initial-exec")));
+
+struct stat64
+ {
+ long dummy[4];
+ };
+typedef __SIZE_TYPE__ size_t;
+typedef unsigned long long uint64_t;
+typedef int __mode_t;
+
+extern size_t strlen (__const char *__s) __attribute__ ((__pure__));
+extern int strcmp (__const char *__s1, __const char *__s2)
+ __attribute__ ((__pure__));
+
+extern int __open64 (__const char *__file, int __oflag, ...);
+extern int __open (__const char *__file, int __oflag, ...);
+extern int __mkdir (__const char *__path, __mode_t __mode);
+extern int __lxstat64 (int __ver, __const char *__filename,
+ struct stat64 *__stat_buf) ;
+
+static const char letters[] =
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+int
+__gen_tempname (char *tmpl, int kind)
+{
+ int len;
+ char *XXXXXX;
+ static uint64_t value;
+ uint64_t random_time_bits;
+ unsigned long count;
+ int fd = -1;
+ int save_errno = __libc_errno;
+ struct stat64 st;
+ unsigned long attempts_min = 62L * 62L * 62L;
+ unsigned long attempts = attempts_min < 238328 ? 238328 : attempts_min;
+
+ len = strlen (tmpl);
+ if (len < 6 || strcmp(&tmpl[len - 6], "XXXXXX"))
+ {
+ (__libc_errno = (22));
+ return -1;
+ }
+
+ XXXXXX = &tmpl[len - 6];
+
+ for (count = 0; count < attempts; value += 7777, ++count)
+ {
+ uint64_t v = value;
+
+ XXXXXX[0] = letters[v % 62];
+ v /= 62;
+ XXXXXX[1] = letters[v % 62];
+ v /= 62;
+ XXXXXX[2] = letters[v % 62];
+ v /= 62;
+ XXXXXX[3] = letters[v % 62];
+ v /= 62;
+ XXXXXX[4] = letters[v % 62];
+ v /= 62;
+ XXXXXX[5] = letters[v % 62];
+
+ switch (kind)
+ {
+ case 0:
+ fd = __open (tmpl, 02 | 01000 | 04000, 0400 | 0200);
+ break;
+
+ case 1:
+ fd = __open64 (tmpl, 02 | 01000 | 04000, 0400 | 0200);
+ break;
+
+ case 2:
+ fd = __mkdir (tmpl, 0400 | 0200 | 0100);
+ break;
+
+ case 3:
+ if (__lxstat64 (2, tmpl, &st) < 0)
+ {
+ if (__libc_errno == 2)
+ {
+ (__libc_errno = (save_errno));
+ return 0;
+ }
+ else
+
+ return -1;
+ }
+ continue;
+ }
+
+ if (fd >= 0)
+ {
+ (__libc_errno = (save_errno));
+ return fd;
+ }
+ else if (__libc_errno != 17)
+ return -1;
+ }
+
+ (__libc_errno = (17));
+ return -1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-6.c
new file mode 100644
index 000000000..8a01c019c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-6.c
@@ -0,0 +1,71 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct A
+{
+ char a;
+ int b;
+ long long c;
+};
+extern __thread struct A a1, a2, a3, a4;
+extern struct A *f1a (void);
+extern struct A *f2a (void);
+extern struct A *f3a (void);
+extern struct A *f4a (void);
+extern struct A *f5a (void);
+extern struct A *f6a (void);
+extern struct A *f7a (void);
+extern struct A *f8a (void);
+extern struct A *f9a (void);
+extern struct A *f10a (void);
+extern int f1b (void);
+extern int f2b (void);
+extern int f3b (void);
+extern int f4b (void);
+extern int f5b (void);
+extern int f6b (void);
+extern int f7b (void);
+extern int f8b (void);
+extern int f9b (void);
+extern int f10b (void);
+extern void check1 (void);
+extern void check2 (void);
+__thread int dummy = 12;
+__thread struct A local = { 1, 2, 3 };
+
+int
+main (void)
+{
+ struct A *p;
+
+ if (local.a != 1 || local.b != 2 || local.c != 3)
+ abort ();
+ if (a1.a != 4 || a1.b != 5 || a1.c != 6)
+ abort ();
+ if (a2.a != 22 || a2.b != 23 || a2.c != 24)
+ abort ();
+ if (a3.a != 10 || a3.b != 11 || a3.c != 12)
+ abort ();
+ if (a4.a != 25 || a4.b != 26 || a4.c != 27)
+ abort ();
+ check1 ();
+ check2 ();
+ if (f1a () != &a1 || f2a () != &a2 || f3a () != &a3 || f4a () != &a4)
+ abort ();
+ p = f5a (); if (p->a != 16 || p->b != 16 + 1 || p->c != 16 + 2)
+ abort ();
+ p = f6a (); if (p->a != 19 || p->b != 19 + 1 || p->c != 19 + 2)
+ abort ();
+ if (f7a () != &a2 || f8a () != &a4)
+ abort ();
+ p = f9a (); if (p->a != 28 || p->b != 28 + 1 || p->c != 28 + 2)
+ abort ();
+ p = f10a (); if (p->a != 31 || p->b != 31 + 1 || p->c != 31 + 2)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-7.c
new file mode 100644
index 000000000..44b900f54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-7.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target fpic } */
+
+static __thread void *baz [4] __attribute__((tls_model ("initial-exec")));
+void foo (void)
+{
+ void **u = (void **) baz;
+
+ u[0] = 0;
+ u[1] = 0;
+}
+
+/* { dg-final { scan-assembler-not "\[48\]\\+baz" { target i?86-*-* x86_64-*-* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-8.c
new file mode 100644
index 000000000..a73311153
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-8.c
@@ -0,0 +1,14 @@
+/* PR 18910 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+static __thread void *foo [2];
+void
+test1 (void)
+{
+ unsigned int s;
+
+ for (s = 0; s < 2; ++s)
+ foo [s] = &foo[s];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-9.c
new file mode 100644
index 000000000..49aa9085f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/opt-9.c
@@ -0,0 +1,9 @@
+/* PR 21412 */
+/* { dg-do compile */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
+
+struct S { int x[10]; };
+extern __thread struct S s;
+int *foo() { return &s.x[2]; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pic-1.c
new file mode 100644
index 000000000..9108b58aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pic-1.c
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fpic -ftls-model=global-dynamic" } */
+/* { dg-require-effective-target tls } */
+
+extern __thread long e1;
+extern __thread int e2;
+static __thread long s1;
+static __thread int s2;
+
+long *ae1 (void)
+{
+ return &e1;
+}
+
+int *ae2 (void)
+{
+ return &e2;
+}
+
+long *as1 (void)
+{
+ return &s1;
+}
+
+int *as2 (void)
+{
+ return &s2;
+}
+
+long ge1 (void)
+{
+ return e1;
+}
+
+int ge2 (void)
+{
+ return e2;
+}
+
+long gs1 (void)
+{
+ return s1;
+}
+
+int gs2 (void)
+{
+ return s2;
+}
+
+long ge3 (void)
+{
+ return e1 + e2;
+}
+
+long gs3 (void)
+{
+ return s1 + s2;
+}
+
+long ge4 (void)
+{
+ if (0)
+ return e1;
+ return e2;
+}
+
+long gs4 (void)
+{
+ if (0)
+ return s1;
+ return s2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pie-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pie-1.c
new file mode 100644
index 000000000..07eb5f1ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pie-1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-fpie" } */
+/* { dg-require-effective-target tls } */
+
+__thread int a; int b; int main() { return a = b; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr24428-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr24428-2.c
new file mode 100644
index 000000000..b147f60d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr24428-2.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+__thread double thrtest[81];
+int main ()
+{
+ double *p, *e;
+ e = &thrtest[81];
+ for (p = &thrtest[0]; p < e; ++p)
+ *p = 1.0;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr24428.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr24428.c
new file mode 100644
index 000000000..643969877
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr24428.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+__thread double thrtest[81];
+int main ()
+{
+ int i;
+ for (i = 0; i < 81; i++)
+ thrtest[i] = 1.0;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr42894.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr42894.c
new file mode 100644
index 000000000..2875b494c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr42894.c
@@ -0,0 +1,11 @@
+/* PR target/42894 */
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+extern __thread int t;
+
+void
+foo (int a)
+{
+ t = a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr45870.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr45870.c
new file mode 100644
index 000000000..8a5d3c74a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr45870.c
@@ -0,0 +1,21 @@
+/* PR target/45870 */
+/* { dg-do compile } */
+/* { dg-options "-g -O" } */
+/* { dg-require-effective-target tls } */
+
+__thread int v[30];
+int bar (void);
+
+int
+foo (int x, int y, int z)
+{
+ int a, b = z, c;
+ while (b > 0)
+ {
+ c = (bar () % 3);
+ a = v[x];
+ if (x < y)
+ for (;;);
+ b += a;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-1.c
new file mode 100644
index 000000000..ef8c5394a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
+
+extern __thread int h_errno;
+int *
+__h_errno_location (void)
+{
+ return &h_errno;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-2.c
new file mode 100644
index 000000000..d11239548
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
+
+extern __thread int *__libc_resp;
+int
+__res_init(void) {
+ return *__libc_resp;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-3.c
new file mode 100644
index 000000000..ba2003c7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
+
+struct initial_sp
+{
+ void *sp;
+ long len;
+};
+__thread
+struct initial_sp __morestack_initial_sp;
+void bar (void *);
+void
+foo ()
+{
+ bar (&__morestack_initial_sp.len);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-4.c
new file mode 100644
index 000000000..980d7e985
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-4.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+/* { dg-require-effective-target tls } */
+
+struct gomp_team_state
+{
+ struct gomp_team_state *prev_ts;
+ unsigned team_id;
+ unsigned level;
+};
+struct gomp_thread
+{
+ void *data;
+ struct gomp_team_state ts;
+};
+extern __thread struct gomp_thread gomp_tls_data;
+int
+foo (int level)
+{
+ struct gomp_team_state *ts = &gomp_tls_data.ts;
+ if (level < 0 || level > ts->level)
+ return -1;
+ return ts->team_id;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-5.c
new file mode 100644
index 000000000..ca3410df7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr47715-5.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+extern __thread int __libc_errno __attribute__ ((tls_model ("initial-exec")));
+;
+int *
+__errno_location (void)
+{
+ return &__libc_errno;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr58595.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr58595.c
new file mode 100644
index 000000000..e7827d79d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/pr58595.c
@@ -0,0 +1,29 @@
+/* PR target/58595 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-additional-options "-fpic" { target fpic } } */
+/* { dg-add-options tls } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-require-effective-target sync_int_long } */
+
+struct S { unsigned long a, b; };
+__thread struct S s;
+void bar (unsigned long *);
+
+__attribute__((noinline)) void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 10; i++)
+ __sync_fetch_and_add (&s.b, 1L);
+}
+
+int
+main ()
+{
+ s.b = 12;
+ foo ();
+ if (s.b != 22)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/section-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/section-1.c
new file mode 100644
index 000000000..1ca2ffb90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/section-1.c
@@ -0,0 +1,12 @@
+/* Verify that we get errors for trying to put TLS data in
+ sections which can't work. */
+/* { dg-require-effective-target tls_native } */
+
+#define A(X) __attribute__((section(X)))
+
+__thread int i A("foo"); /* Ok */
+
+__thread int j A(".data"); /* { dg-error "causes a section type conflict" "conflict with .data section" { xfail *-*-* } } */
+
+int k A("bar");
+__thread int l A("bar"); /* { dg-error "causes a section type conflict" "conflict with user-defined section" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/section-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/section-2.c
new file mode 100644
index 000000000..8f11def96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/section-2.c
@@ -0,0 +1,8 @@
+/* Verify that we get errors for trying to put TLS data in
+ sections which can't work. */
+/* { dg-require-effective-target tls } */
+/* { dg-do compile { target *-*-vxworks } } */
+
+#define A(X) __attribute__((section(X)))
+
+__thread int i A("foo"); /* { dg-error "cannot be overridden" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/struct-1.c
new file mode 100644
index 000000000..fbe3e3c10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/struct-1.c
@@ -0,0 +1,34 @@
+/* This testcase ICEd on IA-32 because the backend was inconsistent whether
+ to allow addends for @dtpoff relocs or not. */
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-O2 -fpic" } */
+/* { dg-require-effective-target tls } */
+
+struct S {
+ int s0, s1, s2, s3;
+};
+static __thread struct S x;
+extern void abort (void);
+extern void exit (int);
+
+void
+foo (struct S *s)
+{
+ s->s2 = 231;
+}
+
+void
+bar (void)
+{
+ if (x.s0 == 231 || x.s2 != 231)
+ abort ();
+}
+
+int
+main ()
+{
+ foo (&x);
+ bar ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-cse-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-cse-1.c
new file mode 100644
index 000000000..8e64424b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-cse-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+/* Using -mshort-calls avoids loading the function addresses in
+ registers and thus getting the counts wrong. */
+/* { dg-additional-options "-mshort-calls" { target epiphany-*-* } } */
+/* { dg-require-effective-target tls_emulated } */
+
+/* Test that we only get one call to emutls_get_address when CSE is
+ active. Note that the var _must_ be initialized for the scan asm
+ to work, since otherwise there will be an initializer which will,
+ correctly, call emutls_get_address. */
+int foo (int b, int c, int d)
+{
+ static __thread int a=1;
+ a += b;
+ a -= c;
+ a += d;
+ return a;
+}
+
+/* { dg-final { scan-assembler-not "emutls_get_address.*emutls_get_address.*" { target { ! { "*-wrs-vxworks" "*-*-darwin8" "hppa*-*-hpux*" "spu-*-*" "i?86-*-mingw*" "x86_64-*-mingw*" } } } } } */
+/* { dg-final { scan-assembler-not "call\tL___emutls_get_address.stub.*call\tL___emutls_get_address.stub.*" { target "*-*-darwin8" } } } */
+/* { dg-final { scan-assembler-not "(b,l|bl) __emutls_get_address.*(b,l|bl) __emutls_get_address.*" { target "hppa*-*-hpux*" } } } */
+/* { dg-final { scan-assembler-not "(brsl|brasl)\t__emutls_get_address.*(brsl|brasl)\t__emutls_get_address.*" { target spu-*-* } } } */
+/* { dg-final { scan-assembler-not "tls_lookup.*tls_lookup.*" { target *-wrs-vxworks } } } */
+/* { dg-final { scan-assembler-not "call\t___emutls_get_address.*call\t___emutls_get_address" { target "i?86-*-mingw*" } } } */
+/* { dg-final { scan-assembler-not "call\t__emutls_get_address.*call\t__emutls_get_address" { target "x86_64-*-mingw*" } } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-init-1.c
new file mode 100644
index 000000000..eb2f84695
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-init-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+
+static __thread int fstat ;
+static __thread int fstat = 1 ;
+static __thread int fstat ;
+static __thread int fstat = 2; /* { dg-error "redefinition of 'fstat'" } */
+ /* { dg-message "note: previous definition of 'fstat' was here" "" { target *-*-* } 5 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-init-2.c
new file mode 100644
index 000000000..22c96ea9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/thr-init-2.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+extern void abort() ;
+
+static __thread int fstat ;
+static __thread int fstat = 1;
+
+int test_code(int b)
+{
+ fstat += b ;
+ return fstat;
+}
+
+int main (int ac, char *av[])
+{
+ int a = test_code(1);
+
+ if ((a != 2) || (fstat != 2))
+ abort () ;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/tls.exp b/gcc-4.9/gcc/testsuite/gcc.dg/tls/tls.exp
new file mode 100644
index 000000000..1ccdbab9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/tls.exp
@@ -0,0 +1,36 @@
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tls/trivial.c b/gcc-4.9/gcc/testsuite/gcc.dg/tls/trivial.c
new file mode 100644
index 000000000..96b8e49a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tls/trivial.c
@@ -0,0 +1,3 @@
+/* { dg-require-effective-target tls } */
+
+__thread int i;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20091013.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20091013.c
new file mode 100644
index 000000000..d9b3b0ed3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20091013.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O2" } */
+
+extern long ringo(long int);
+int g,i;
+
+f()
+{
+ __transaction_relaxed {
+ for (i=0; i < 10; ++i)
+ ringo(g);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20091221.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20091221.c
new file mode 100644
index 000000000..1d75d153a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20091221.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmedge" } */
+
+int i;
+extern void virgin () __attribute__((transaction_pure));
+
+foo()
+{
+ __transaction_atomic {
+ virgin(i);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "readOnly" 1 "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmedge" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100125.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100125.c
new file mode 100644
index 000000000..3f1dd10fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100125.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
+
+/* Test that the call to george() doesn't end up inside the transaction. */
+
+int trxn;
+
+void set_remove(int * val)
+{
+ __transaction_atomic {
+ trxn = 5;
+ }
+ george();
+}
+
+/* { dg-final { scan-tree-dump-times "getTMCloneOrIrrevocable" 0 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100519.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100519.c
new file mode 100644
index 000000000..009b7901a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100519.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+typedef struct coordinate {
+ double x;
+} coordinate_t;
+
+coordinate_t elementPtrC[3];
+
+__attribute__((transaction_safe))
+void TMelement_alloc (coordinate_t* coordinates, int numCoordinate)
+{
+ int i;
+ for (i = 0; i < numCoordinate; i++) {
+ elementPtrC[i] = coordinates[i];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100524-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100524-2.c
new file mode 100644
index 000000000..a3578cb27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100524-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O0" } */
+
+typedef struct {
+ int value[5];
+} type_t;
+
+__attribute__((transaction_safe))
+type_t func_move ();
+
+__attribute__((transaction_safe))
+type_t func_push (int type)
+{
+ type_t trace;
+
+ if (type == 9)
+ trace = func_move();
+
+ return trace;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100603.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100603.c
new file mode 100644
index 000000000..306106339
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100603.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-optimized" } */
+
+int jj;
+
+__attribute__((transaction_safe))
+static void poof ()
+{
+ if (jj)
+ return;
+ poof();
+}
+
+__attribute__((transaction_safe))
+void TMlist_free ()
+{
+ poof();
+}
+
+/* { dg-final { scan-tree-dump-times "Function poof ._ZGTt4poof" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100609.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100609.c
new file mode 100644
index 000000000..760f81ec6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100609.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+extern void funcNoReturn() __attribute__ ((__noreturn__));
+
+int later;
+
+void MyFunc()
+{
+ __transaction_relaxed {
+ funcNoReturn();
+ later=8;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100610.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100610.c
new file mode 100644
index 000000000..0985b9ebc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100610.c
@@ -0,0 +1,90 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O3" } */
+
+/* The function calculateCircumCircle() should get inlined into the TM
+ clone for TMelement_alloc(), so we don't need to generate a TM
+ clone for calculateCircumCircle(). We also don't need to put its
+ entry into the clone table since it's static. */
+
+/* { dg-final { scan-assembler-not "ZGTt21calculateCircumCircle" } } */
+
+extern double sqrt(double) __attribute__((transaction_pure));
+extern void *xmalloc(int) __attribute__((transaction_safe));
+
+typedef struct coordinate {
+ double x;
+ double y;
+} coordinate_t;
+typedef struct element {
+ coordinate_t coordinates[3];
+ long numCoordinate;
+ coordinate_t circumCenter;
+ double circumRadius;
+} element_t;
+
+__attribute__((transaction_safe))
+double
+coordinate_distance (coordinate_t* coordinatePtr, coordinate_t* aPtr)
+{
+ return sqrt( coordinatePtr->x );
+}
+
+__attribute__((transaction_safe))
+static void
+calculateCircumCircle (element_t* elementPtr)
+{
+ long numCoordinate = elementPtr->numCoordinate;
+ coordinate_t* coordinates = elementPtr->coordinates;
+ coordinate_t* circumCenterPtr = &elementPtr->circumCenter;
+ ((void) (0));
+ if (numCoordinate == 2) {
+ circumCenterPtr->x = (coordinates[0].x + coordinates[1].x) / 2.0;
+ circumCenterPtr->y = (coordinates[0].y + coordinates[1].y) / 2.0;
+ }
+ else {
+ double ax = coordinates[0].x;
+ double ay = coordinates[0].y;
+ double bx = coordinates[1].x;
+ double by = coordinates[1].y;
+ double cx = coordinates[2].x;
+ double cy = coordinates[2].y;
+ double bxDelta = bx - ax;
+ double byDelta = by - ay;
+ double cxDelta = cx - ax;
+ double cyDelta = cy - ay;
+ double bDistance2 = (bxDelta * bxDelta) + (byDelta * byDelta);
+ double cDistance2 = (cxDelta * cxDelta) + (cyDelta * cyDelta);
+ double xNumerator = (byDelta * cDistance2) - (cyDelta * bDistance2);
+ double yNumerator = (bxDelta * cDistance2) - (cxDelta * bDistance2);
+ double denominator = 2 * ((bxDelta * cyDelta) - (cxDelta * byDelta));
+ double rx = ax - (xNumerator / denominator);
+ double ry = ay + (yNumerator / denominator);
+ circumCenterPtr->x = rx;
+ circumCenterPtr->y = ry;
+ }
+ elementPtr->circumRadius = coordinate_distance(circumCenterPtr,
+ &coordinates[0]);
+}
+
+element_t*
+element_alloc (coordinate_t* coordinates, long numCoordinate)
+{
+ element_t* elementPtr;
+ elementPtr = (element_t*)xmalloc(sizeof(element_t));
+ if (elementPtr) {
+ calculateCircumCircle(elementPtr);
+ }
+ return elementPtr;
+}
+
+__attribute__((transaction_safe))
+element_t*
+TMelement_alloc (coordinate_t* coordinates, long numCoordinate)
+{
+ element_t* elementPtr;
+ elementPtr = (element_t*)xmalloc(sizeof(element_t));
+ if (elementPtr) {
+ calculateCircumCircle(elementPtr);
+ }
+ return elementPtr;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100615-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100615-2.c
new file mode 100644
index 000000000..4341e7d35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100615-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+__attribute__((transaction_safe))
+void Info_RemoveKey (char *s)
+{
+ char *o = 0;
+ while (1)
+ {
+ s++;
+ while (*s)
+ {
+ if (!*s)
+ return;
+ *o++ = *s++;
+ }
+ *o = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100615.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100615.c
new file mode 100644
index 000000000..26964d433
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20100615.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+/* Since the non TM version of new_node() gets optimized away, it
+ shouldn't appear in the clone table either. */
+/* { dg-final { scan-assembler-not "tm_clone_table" { target { ! *-*-darwin* } } } } */
+/* { dg-final { scan-assembler-not "__DATA,__tm_clone_table" { target *-*-darwin* } } } */
+
+#define NULL 0
+extern void *malloc (__SIZE_TYPE__);
+
+__attribute__((transaction_pure))
+void exit(int status);
+
+typedef struct node {
+} node_t;
+
+__attribute__((transaction_safe))
+static node_t *new_node(node_t *next)
+{
+ node_t *node;
+ node = (node_t *)malloc(sizeof(node_t));
+ if (node == NULL) {
+ exit(1);
+ }
+ return NULL;
+}
+
+static node_t *set_new()
+{
+ node_t *min, *max;
+ __transaction_atomic {
+ max = new_node(NULL);
+ min = new_node(max);
+ }
+ return min;
+}
+
+int main(int argc, char **argv)
+{
+ set_new();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/20110216.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20110216.c
new file mode 100644
index 000000000..22edae0fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/20110216.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+int george;
+
+__attribute__((transaction_callable))
+void q1()
+{
+ __transaction_atomic {
+ george=999;
+ }
+ q1();
+}
+
+/* { dg-final { scan-assembler-not "_ITM_getTMCloneOrIrrevocable" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/alias-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/alias-1.c
new file mode 100644
index 000000000..596851d59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/alias-1.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-ealias -O" } */
+
+typedef __UINTPTR_TYPE__ ptrcast;
+
+#if (__SIZEOF_POINTER__ == 4)
+#define TM_LOAD __builtin__ITM_RU4
+#define TM_STORE __builtin__ITM_WU4
+#elif (__SIZEOF_POINTER__ == 8)
+#define TM_LOAD __builtin__ITM_RU8
+#define TM_STORE __builtin__ITM_WU8
+#else
+#error Add target support here
+#endif
+
+struct mystruct_type {
+ ptrcast *ptr;
+} *mystruct;
+
+ptrcast *someptr, **pp;
+ptrcast ui;
+
+void f(void)
+{
+ __transaction_atomic {
+ ui = TM_LOAD (&mystruct);
+ mystruct = (struct mystruct_type *) ui;
+ ui = TM_LOAD (&someptr);
+ someptr = (ptrcast *) ui;
+ ui = (ptrcast) someptr;
+ pp = &mystruct->ptr;
+ TM_STORE (pp, ui);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "mystruct = \{ .*ESCAPED" 1 "ealias" } } */
+/* { dg-final { scan-tree-dump-times "someptr = .*same as mystruct" 1 "ealias" } } */
+/* { dg-final { scan-tree-dump-times "ui\..* = .*same as mystruct" 1 "ealias" } } */
+/* { dg-final { scan-tree-dump-times "pp\..* = .*same as mystruct" 1 "ealias" } } */
+/* { dg-final { cleanup-tree-dump "ealias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/alias-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/alias-2.c
new file mode 100644
index 000000000..630680355
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/alias-2.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-ealias -O" } */
+
+typedef __UINTPTR_TYPE__ ptrcast;
+
+#if (__SIZEOF_POINTER__ == 4)
+#define TM_LOAD __builtin__ITM_RU4
+#define TM_STORE __builtin__ITM_WU4
+#elif (__SIZEOF_POINTER__ == 8)
+#define TM_LOAD __builtin__ITM_RU8
+#define TM_STORE __builtin__ITM_WU8
+#else
+#error Add target support here
+#endif
+
+void candy ();
+
+struct mystruct_type {
+ ptrcast *ptr;
+} *mystruct, *mystruct2;
+
+ptrcast *someptr, **pp;
+ptrcast ui;
+
+void tootsie_roll () __attribute__((transaction_wrap (candy)));
+void tootsie_roll ()
+{
+ ui = TM_LOAD (&mystruct);
+ mystruct2 = (struct mystruct_type *) ui;
+
+ pp = &mystruct2->ptr;
+}
+
+void foo()
+{
+ candy();
+}
+
+/* { dg-final { scan-tree-dump-times "ui\..* = .*same as mystruct" 1 "ealias" } } */
+/* { dg-final { scan-tree-dump-times "mystruct.*ESCAPED" 1 "ealias" } } */
+/* { dg-final { scan-tree-dump-times "pp = .*same as mystruct" 1 "ealias" } } */
+/* { dg-final { cleanup-tree-dump "ealias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/asm-1.c
new file mode 100644
index 000000000..a3826e2a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/asm-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O1" } */
+
+static inline void asmfunc()
+{
+__asm__("");
+}
+
+__attribute__((transaction_callable))
+void push()
+{
+ asmfunc();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/clone-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/clone-1.c
new file mode 100644
index 000000000..4050adddc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/clone-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmmark" } */
+
+int foo;
+
+__attribute__((transaction_callable))
+void cloneme()
+{
+ foo = 666;
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_WU.*foo" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/data-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/data-1.c
new file mode 100644
index 000000000..16061476e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/data-1.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+/* Test read and write on all basic types. */
+
+static char gc;
+static signed char gsc;
+static unsigned char guc;
+
+static short gs;
+static unsigned short gus;
+
+static int gi;
+static unsigned int gui;
+
+static long gl;
+static unsigned long gul;
+
+static long long gll;
+static unsigned long long gull;
+
+static float gf;
+static double gd;
+static long double gld;
+
+void f(void)
+{
+ __transaction_atomic {
+ gc++;
+ gsc++;
+ guc++;
+
+ gs++;
+ gus++;
+
+ gi++;
+ gui++;
+
+ gl++;
+ gul++;
+
+ gll++;
+ gull++;
+
+ gf++;
+ gd++;
+ gld++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/data-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/data-2.c
new file mode 100644
index 000000000..3e2a604bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/data-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+/* Test read and write on all basic types. */
+
+struct S
+{
+ int x[10];
+};
+
+static struct S g;
+
+extern void fill (struct S *);
+
+void f(void)
+{
+ struct S l;
+ fill(&l);
+
+ __transaction_atomic {
+ g = l;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/debug-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/debug-1.c
new file mode 100644
index 000000000..01acfae4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/debug-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O0 -fdump-tree-tmmark-lineno" } */
+
+/* Test that instrumented statements have correct location info. */
+
+int a,b, c, z;
+
+testing(){
+ c=9;
+}
+
+main() {
+ b = 9898;
+ __transaction_relaxed {
+ z = c;
+ a = 888;
+ testing();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times ": 13:.*b = 9898" 1 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times ": 14:.*_ITM_beginTransaction" 1 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times ": 15:.*ITM_WU. \\(&z" 1 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times ": 16:.*ITM_WU. \\(&a" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/indirect-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/indirect-1.c
new file mode 100644
index 000000000..eade848bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/indirect-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+void foo(void (*fn)(void))
+{
+ __transaction_relaxed {
+ fn();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/indirect-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/indirect-2.c
new file mode 100644
index 000000000..dd7168f05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/indirect-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+void __attribute__((transaction_safe))
+foo(void);
+
+void __attribute__((transaction_safe))
+set_fn(void)
+{
+ void __attribute__((transaction_safe)) (*fn)(void);
+ fn = foo;
+ fn();
+}
+
+/* { dg-final { scan-assembler "_ITM_getTMCloneSafe" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/instrumented-mask.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/instrumented-mask.c
new file mode 100644
index 000000000..6cfd3e479
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/instrumented-mask.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmmark" } */
+
+/* If we're sure to go irrevocable, as in the case below, do not pass
+ PR_INSTRUMENTEDCODE to the run-time if there is nothing
+ instrumented within the transaction. */
+
+int
+main()
+{
+ __transaction_relaxed { __asm__(""); }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times " instrumentedCode" 0 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-1.c
new file mode 100644
index 000000000..ec1cdca70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmmark-asmname" } */
+
+void foo(void) __attribute__((transaction_safe));
+
+void bar(void)
+{
+ __transaction_atomic {
+ foo();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "_ZGTt3foo" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-2.c
new file mode 100644
index 000000000..e7a02cb19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmmark-asmname" } */
+
+void foo(void);
+
+void bar(void)
+{
+ __transaction_relaxed {
+ foo();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "_ZGTt3foo" 0 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-3.c
new file mode 100644
index 000000000..cb1b433bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/ipa-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+static int x;
+
+void __attribute__((transaction_callable))
+foo(void)
+{
+ x++;
+}
+
+/* { dg-final { scan-assembler "_ZGTt3foo" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-1.c
new file mode 100644
index 000000000..60f629133
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+int global;
+int george;
+
+extern crap() __attribute__((transaction_unsafe));
+
+foo()
+{
+ __transaction_relaxed {
+ global++;
+ crap();
+ george++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-2.c
new file mode 100644
index 000000000..17ac8a5f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmedge" } */
+
+/* Test that a direct call to __builtin__ITM_changeTransactionMode()
+ sets the irrevocable bit. */
+
+int global;
+int george;
+
+foo()
+{
+ __transaction_relaxed {
+ global++;
+ __builtin__ITM_changeTransactionMode (0);
+ george++;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "doesGoIrrevocable" 1 "tmedge" } } */
+/* { dg-final { scan-tree-dump-times "hasNoIrrevocable" 0 "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmedge" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-3.c
new file mode 100644
index 000000000..fdf3e52e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmmark" } */
+
+extern void bar(void) __attribute__((transaction_callable));
+
+foo()
+{
+ __transaction_relaxed {
+ bar();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "doesGoIrrevocable" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-4.c
new file mode 100644
index 000000000..72075df36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmmark" } */
+
+void orig(void);
+void xyz(void) __attribute__((transaction_wrap (orig)));
+
+
+foo()
+{
+ __transaction_relaxed {
+ orig();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "hasNoIrrevocable" 0 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-5.c
new file mode 100644
index 000000000..155879f1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-5.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-ipa-tmipa -O" } */
+
+int a;
+
+void foo(void) __attribute__((transaction_safe));
+void bar(void) __attribute__((transaction_safe));
+void danger(void) __attribute__((transaction_unsafe));
+
+void wildthing()
+{
+ /* All blocks should be propagated as irrevocable. */
+ __transaction_relaxed {
+ if (a)
+ foo();
+ else
+ bar();
+ danger();
+ }
+}
+
+/* { dg-final { scan-ipa-dump-times "GTMA_DOES_GO_IRREVOCABLE" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 3 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 4 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 5 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 6 goes irr" 1 "tmipa" } } */
+/* { dg-final { cleanup-ipa-dump "tmipa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-6.c
new file mode 100644
index 000000000..239913121
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-6.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-ipa-tmipa -O" } */
+
+int a, trxn, eee;
+
+void foo(void) __attribute__((transaction_safe));
+void bar(void) __attribute__((transaction_safe));
+void danger(void) __attribute__((transaction_unsafe));
+
+void wildthing()
+{
+ /* All blocks should be propagated as irrevocable. */
+ __transaction_relaxed {
+ if (eee) {
+ if (a)
+ foo();
+ else
+ bar();
+ danger();
+ } else {
+ danger();
+ }
+ }
+}
+
+/* { dg-final { scan-ipa-dump-times "GTMA_DOES_GO_IRREVOCABLE" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 3 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 4 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 5 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 6 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 7 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 8 goes irr" 1 "tmipa" } } */
+/* { dg-final { scan-ipa-dump-times "bb 9 goes irr" 1 "tmipa" } } */
+/* { dg-final { cleanup-ipa-dump "tmipa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-7.c
new file mode 100644
index 000000000..ea8a00f0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/irrevocable-7.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-ipa-tmipa" } */
+
+extern void bark(void);
+
+__attribute__((transaction_callable))
+int foo()
+{
+ bark();
+}
+
+/* { dg-final { scan-ipa-dump-times "changeTransactionMode \\(0\\)" 1 "tmipa" } } */
+/* { dg-final { cleanup-ipa-dump "tmipa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/lto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/lto-1.c
new file mode 100644
index 000000000..4c031780a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/lto-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-fgnu-tm -flto" } */
+
+__attribute__((transaction_safe))
+void foo()
+{
+}
+
+/* { dg-final { scan-assembler "ZGTt3foo" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-1.c
new file mode 100644
index 000000000..c5ac5ced5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmemopt" } */
+
+long g, xxx, yyy;
+extern george() __attribute__((transaction_safe));
+extern ringo(long int) __attribute__((transaction_safe));
+int i;
+
+f()
+{
+ __transaction_relaxed {
+ g = 666;
+ george();
+ if (i == 9)
+ goto bye;
+ xxx=8;
+ yyy=9;
+ for (i=0; i < 10; ++i)
+ ringo(g);
+ bye:
+ ringo(g);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "transforming: .*_ITM_RaWU\[248\] \\(&g\\);" 1 "tmmemopt" } } */
+/* { dg-final { scan-tree-dump-times "transforming: .*_ITM_WaRU4 \\(&i," 1 "tmmemopt" } } */
+/* { dg-final { scan-tree-dump-times "transforming: .*_ITM_RaWU4 \\(&i\\);" 1 "tmmemopt" } } */
+/* { dg-final { scan-tree-dump-times "transforming: .*_ITM_WaWU4 \\(&i," 1 "tmmemopt" } } */
+/* { dg-final { cleanup-tree-dump "tmmemopt" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-10.c
new file mode 100644
index 000000000..0978bce91
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-10.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
+
+extern int something(void) __attribute__((transaction_safe));
+extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
+
+int f()
+{
+ int *p;
+
+ p = malloc (sizeof (*p) * 100);
+
+ __transaction_atomic {
+ /* p[5] is thread private, but not transaction local since the
+ malloc is outside of the transaction. We can use the logging
+ functions for this. */
+ p[5] = 123;
+
+ if (something())
+ __transaction_cancel;
+ }
+ return p[5];
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_LU" 0 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times "int tm_save" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-11.c
new file mode 100644
index 000000000..36aa66412
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-11.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
+
+extern int something(void) __attribute__((transaction_safe));
+extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
+
+int f()
+{
+ int *p;
+
+ p = malloc (sizeof (*p) * 100);
+ foo(p[5]);
+
+ __transaction_atomic {
+ /* p[5] is thread private, however the SSA_NAME that holds the
+ address dominates the entire transaction (transaction
+ invariant) so we can use a save/restore pair. */
+ p[5] = 123;
+
+ if (something())
+ __transaction_cancel;
+ }
+ return p[5];
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_LU" 0 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
+/* { dg-final { scan-tree-dump-times "int tm_save" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-12.c
new file mode 100644
index 000000000..5520ecef2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-12.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
+
+extern int test(void) __attribute__((transaction_safe));
+extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
+
+struct large { int foo[500]; };
+
+int f()
+{
+ int *p1, *p2, *p3;
+
+ p1 = malloc (sizeof (*p1)*5000);
+ __transaction_atomic {
+ *p1 = 0;
+
+ p2 = malloc (sizeof (*p2)*6000);
+ *p2 = 1;
+
+ /* p3 = PHI (p1, p2) */
+ if (test())
+ p3 = p1;
+ else
+ p3 = p2;
+
+ /* Since both p1 and p2 are thread-private, we can inherit the
+ logging already done. No ITM_W* instrumentation necessary. */
+ *p3 = 555;
+ }
+ return p3[something()];
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-13.c
new file mode 100644
index 000000000..381e682bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-13.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
+
+struct large { int x[100]; };
+struct large large_global;
+extern struct large function (void) __attribute__((transaction_safe));
+
+void f()
+{
+ __transaction_atomic {
+ large_global = function();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "memmoveRtWt \\\(&large_global," 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-15.c
new file mode 100644
index 000000000..975c79433
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-15.c
@@ -0,0 +1,30 @@
+/* { dg-do compile { target { x86_64-*-linux* } } } */
+/* { dg-options "-fgnu-tm -O" } */
+
+/* Test the TM vector logging functions. */
+
+typedef int __attribute__((vector_size (16))) vectype;
+extern int something(void) __attribute__((transaction_safe));
+extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
+
+vectype vecky;
+
+vectype f()
+{
+ vectype *p;
+
+ p = malloc (sizeof (*p) * 100);
+
+ __transaction_atomic {
+ /* p[5] is thread private, but not transaction local since the
+ malloc is outside of the transaction. We can use the logging
+ functions for this. */
+ p[5] = vecky;
+
+ if (something())
+ __transaction_cancel;
+ }
+ return p[5];
+}
+
+/* { dg-final { scan-assembler "_ITM_LM128" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-16.c
new file mode 100644
index 000000000..c230240de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-16.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O3 -fdump-tree-tmmark" } */
+/* Like memopt-12.c but the phi is inside a look which causes
+ it to be converted into a COND_EXPR. */
+
+extern int test(void) __attribute__((transaction_safe));
+extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
+
+struct large { int foo[500]; };
+
+int f(int j)
+{
+ int *p1, *p2, *p3;
+
+ p1 = malloc (sizeof (*p1)*5000);
+ __transaction_atomic {
+ _Bool t;
+ int i = 1;
+ *p1 = 0;
+
+ p2 = malloc (sizeof (*p2)*6000);
+ *p2 = 1;
+ t = test();
+
+ for (i = 0;i < j;i++)
+ {
+
+ /* p3 = PHI (p1, p2) */
+ if (t)
+ p3 = p1;
+ else
+ p3 = p2;
+
+ /* Since both p1 and p2 are thread-private, we can inherit the
+ logging already done. No ITM_W* instrumentation necessary. */
+ *p3 = 555;
+ }
+ }
+ return p3[something()];
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-2.c
new file mode 100644
index 000000000..08aa9acdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmemopt" } */
+
+char c;
+
+void f(void)
+{
+ __transaction_atomic {
+ ++c;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "transforming.*RfWU1 \\(&c" 1 "tmmemopt" } } */
+/* { dg-final { scan-tree-dump-times "transforming.*WaWU1 \\(&c" 1 "tmmemopt" } } */
+/* { dg-final { cleanup-tree-dump "tmmemopt" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-3.c
new file mode 100644
index 000000000..1220ffc4a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-3.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
+
+struct large { int x[100]; };
+extern int test(void) __attribute__((transaction_safe));
+
+int f()
+{
+ int i = readint();
+ struct large lala = { 0 };
+ __transaction_atomic {
+ lala.x[i] = 666;
+ if (test())
+ __transaction_cancel;
+ }
+ return lala.x[0];
+}
+
+/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_4\\\]" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-4.c
new file mode 100644
index 000000000..58f8fd042
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-4.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmedge" } */
+
+/* Test thread-local memory optimizations: save/restore pairs. */
+
+struct large { int x[100]; };
+struct large bark();
+extern int test (void) __attribute__((transaction_safe));
+
+int f()
+{
+ int i = readint();
+ struct large lala = bark();
+ __transaction_atomic {
+ lala.x[55] = 666;
+ if (test())
+ __transaction_cancel;
+ }
+ return lala.x[i];
+}
+
+/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala.x\\\[55\\\]" 1 "tmedge" } } */
+/* { dg-final { scan-tree-dump-times "lala.x\\\[55\\\] = tm_save" 1 "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmedge" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-5.c
new file mode 100644
index 000000000..53f7f1208
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-5.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmedge --param tm-max-aggregate-size=1" } */
+
+/* Test thread-local memory optimizations: logging function. */
+
+struct large { int x[100]; };
+struct large bark();
+extern int test (void) __attribute__((transaction_safe));
+
+int f()
+{
+ int i = readint();
+ struct large lala = bark();
+ __transaction_atomic {
+ lala.x[55] = 666;
+ if (test())
+ __transaction_cancel;
+ }
+ return lala.x[i];
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_LU\[0-9\] \\\(&lala.x\\\[55\\\]" 1 "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmedge" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-6.c
new file mode 100644
index 000000000..810a5595d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmedge --param tm-max-aggregate-size=1" } */
+
+struct large { int x[100]; };
+struct large bark();
+extern int test (void) __attribute__((transaction_safe));
+struct large lacopy;
+
+int f()
+{
+ int i = readint();
+ struct large lala = bark();
+ __transaction_atomic {
+ lala.x[55] = 666;
+ lala = lacopy; /* Aggregate instrumentation. */
+ }
+ return lala.x[i];
+}
+
+/* { dg-final { scan-tree-dump-times "memmoveRtWt \\\(.*, &lacopy" 1 "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmedge" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-7.c
new file mode 100644
index 000000000..d3a478bde
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-7.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmedge --param tm-max-aggregate-size=999" } */
+
+/* Test save/restore pairs for aggregates. */
+
+struct large { int x[100]; };
+extern struct large foobie (void) __attribute__((transaction_safe));
+int asdf;
+
+int f()
+{
+ struct large lala;
+ struct large lacopy = foobie();
+ __transaction_atomic {
+ lala = lacopy;
+ }
+ return lala.x[asdf];
+}
+
+/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala" 1 "tmedge" } } */
+/* { dg-final { scan-tree-dump-times "lala = tm_save" 1 "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmedge" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-8.c
new file mode 100644
index 000000000..10320e789
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-8.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
+
+extern int something(void) __attribute__((transaction_safe));
+extern int escape(int *) __attribute__((transaction_safe));
+extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
+
+int f()
+{
+ int *p;
+
+ __transaction_atomic {
+ p = malloc (sizeof (*p) * 100);
+ escape (p);
+
+ /* This should be instrumented because P escapes. */
+ p[5] = 123;
+
+ if (something())
+ __transaction_cancel;
+ }
+ return p[5];
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_WU" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-9.c
new file mode 100644
index 000000000..0c34f20b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memopt-9.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
+
+extern int something(void) __attribute__((transaction_safe));
+extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
+
+struct large { int foo[500]; };
+
+int f()
+{
+ int *p;
+ struct large *lp;
+
+ __transaction_atomic {
+ p = malloc (sizeof (*p) * 100);
+ lp = malloc (sizeof (*lp) * 100);
+
+ /* No instrumentation necessary; P and LP are transaction local. */
+ p[5] = 123;
+ lp->foo[66] = 123;
+
+ if (something())
+ __transaction_cancel;
+ }
+ return p[5];
+}
+
+/* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memset-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memset-2.c
new file mode 100644
index 000000000..743ada137
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memset-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmlower" } */
+
+char array[4];
+
+void *memset(void *s, int c, __SIZE_TYPE__);
+
+int main()
+{
+ __transaction_atomic {
+ memset(array, 'b', sizeof(4));
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "GTMA_HAVE_STORE" 1 "tmlower" } } */
+/* { dg-final { cleanup-tree-dump "tmlower" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/memset.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memset.c
new file mode 100644
index 000000000..3b73ec6ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/memset.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+extern void *memset (void *, int, __SIZE_TYPE__);
+
+char array[4] = "aaaa";
+
+__attribute__((transaction_safe))
+void *my_memset()
+{
+ return memset(array,'b',4);
+}
+
+
+int main()
+{
+
+ __transaction_atomic {
+ my_memset();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-assembler "_ITM_memsetW" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/nested-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/nested-1.c
new file mode 100644
index 000000000..afadb83c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/nested-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+extern int foo(int) __attribute__((transaction_safe));
+void bar(void)
+{
+ __transaction_atomic {
+ if (foo(1))
+ __transaction_atomic {
+ if (foo(2))
+ __transaction_atomic {
+ if (foo(3))
+ __transaction_atomic {
+ if (foo(4))
+ foo(5);
+ else
+ __transaction_cancel;
+ }
+ else
+ __transaction_cancel;
+ }
+ else
+ __transaction_cancel;
+ }
+ else
+ __transaction_cancel;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/nested-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/nested-2.c
new file mode 100644
index 000000000..205ca8d7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/nested-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+void foobar(void)
+{
+ __transaction_atomic {
+ foobar();
+ }
+}
+
+void doit(void) __attribute__((transaction_safe));
+
+__attribute__((transaction_callable))
+void callable(void)
+{
+ __transaction_atomic {
+ doit();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/opt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/opt-1.c
new file mode 100644
index 000000000..87a8c72bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/opt-1.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+extern void usleep (int) __attribute__((transaction_pure));
+extern int rand(void) __attribute__((pure, transaction_pure));
+extern int printf (const char *, ...);
+extern void *malloc (__SIZE_TYPE__) __attribute__((malloc));
+extern void xyzzy (void * (*)(void *));
+
+typedef struct
+{
+ int id;
+} parm;
+
+int gvar;
+
+void *hello(void *arg)
+{
+ parm *p=(parm *)arg;
+ int tmp = p->id;
+ int tmp3;
+ printf ("Thread reads %d.\n", tmp);
+ __transaction_atomic
+ {
+ int tmp2 = gvar;
+ usleep ((int) (10.0*rand()/(10+1.0))/100);
+ gvar = tmp + tmp2;
+ tmp3 = gvar;
+ }
+ printf("tmp3 = %d\n", tmp3);
+ return 0;
+}
+
+int
+main()
+{
+ int i, n = rand();
+
+ for (i=0; i<n; i++)
+ xyzzy (hello);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/opt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/opt-2.c
new file mode 100644
index 000000000..d9e2b8a6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/opt-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O2" } */
+
+int foo(int *arr, int v)
+{
+ int r = 0;
+ int i;
+ __transaction_atomic {
+ for (i = 0; i < 10; ++i)
+ if (arr[i] < 27)
+ r += arr[i] += v;
+ }
+ return r;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr45985.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr45985.c
new file mode 100644
index 000000000..c81184067
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr45985.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+__attribute__((transaction_unsafe))
+void illegal();
+
+static int a = 0;
+void func()
+{
+ __transaction_relaxed {
+ if( a == 0)
+ illegal();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46567-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46567-2.c
new file mode 100644
index 000000000..bfe0078bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46567-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+int funky();
+int global;
+
+void SeqfileGetLine()
+{
+ funky();
+}
+
+__attribute__((transaction_callable)) void readLoop()
+{
+ SeqfileGetLine();
+ if (global)
+ funky();
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46567.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46567.c
new file mode 100644
index 000000000..bcc59adf5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46567.c
@@ -0,0 +1,18 @@
+__attribute__((transaction_callable))
+static void SeqfileGetLine ()
+{
+ SSIGetFilePosition ();
+}
+
+__attribute__((transaction_callable))
+static void readLoop (int addfirst)
+{
+ if (!addfirst)
+ {
+ if (!addfirst)
+ {
+ SSIGetFilePosition ();
+ }
+ SeqfileGetLine ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46654.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46654.c
new file mode 100644
index 000000000..bb63b6858
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr46654.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+extern void baz(int);
+
+int y;
+void foo(volatile int x)
+{
+ __transaction_atomic {
+ x = 5; /* { dg-error "invalid volatile use of 'x' inside transaction" } */
+ x += y;
+ y++;
+ }
+ baz(x);
+}
+
+
+volatile int i = 0;
+
+void george()
+{
+ __transaction_atomic {
+ if (i == 2) /* { dg-error "invalid volatile use of 'i' inside transaction" } */
+ i = 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47520.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47520.c
new file mode 100644
index 000000000..80b976bd4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47520.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+struct ReadSeqVars
+{
+ int format;
+ char *ss;
+};
+
+void rms_feof(struct ReadSeqVars *);
+
+__attribute__((transaction_callable)) int ReadSeq(struct ReadSeqVars *V)
+{
+ if (V->format > 1)
+ {
+ if ((V->format != 2) && (V->ss != (void*)0) )
+ {
+ V->format = 3;
+ }
+ }
+ else
+ {
+ int i = 0;
+ for (i = 0; i < 1; i++)
+ {
+ }
+ rms_feof(V);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47690.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47690.c
new file mode 100644
index 000000000..d18e2e11f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47690.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+int george;
+
+void q1()
+{
+ __transaction_atomic {
+ george=999;
+ }
+ q1();
+}
+
+/* { dg-final { scan-assembler-not "ZGTt2q1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47905.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47905.c
new file mode 100644
index 000000000..c4b254930
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr47905.c
@@ -0,0 +1,14 @@
+/* { dg-do compile }
+ { dg-options "-fgnu-tm" } */
+
+void funcA();
+void funcB();
+
+void *thread()
+{
+ __transaction_relaxed
+ {
+ funcA();
+ };
+ funcB();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr51472.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr51472.c
new file mode 100644
index 000000000..67f055735
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr51472.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O --param tm-max-aggregate-size=32" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
+
+typedef int __attribute__ ((vector_size (16))) vectype;
+vectype v;
+
+void
+foo (int c)
+{
+ vectype *p = __builtin_malloc (sizeof (vectype));
+ __transaction_atomic
+ {
+ *p = v;
+ if (c)
+ __transaction_cancel;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr51696.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr51696.c
new file mode 100644
index 000000000..02ee3f517
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr51696.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+struct list {
+ void (*compare)();
+} *listPtr;
+
+static void (*compare)();
+
+__attribute__((transaction_safe))
+static void func () {
+ listPtr->compare(); /* { dg-error "unsafe indirect function call" } */
+ compare(); /* { dg-error "unsafe function call" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52141.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52141.c
new file mode 100644
index 000000000..0dabf76ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52141.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O0 -w" } */
+
+__attribute__((always_inline))
+static void asmfunc(void)
+{
+ __asm__ (""); /* { dg-error "asm not allowed in .transaction_safe" } */
+}
+
+__attribute__((transaction_safe))
+static void f(void)
+{
+ asmfunc();
+}
+
+int main()
+{
+ __transaction_atomic {
+ f();
+ }
+ return 0;
+}
+
+/* { dg-message "inlined from \'f\'" "" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52142.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52142.c
new file mode 100644
index 000000000..21d4a0ca1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52142.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O1" } */
+static int global = 0;
+
+__attribute__((transaction_pure))
+static inline void purefunc()
+{
+ global++;
+}
+
+__attribute__((transaction_safe))
+void f();
+
+void push()
+{
+ __transaction_atomic {
+ f();
+ purefunc();
+ }
+}
+
+/* { dg-final { scan-assembler-not "_ITM_RfWU4" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52173-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52173-1.c
new file mode 100644
index 000000000..9ffa4d618
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52173-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O3" } */
+
+int vec[500];
+
+void func()
+{
+ __transaction_relaxed
+ {
+ vec[123] = 456;
+ }
+}
+
+main()
+{
+ int i;
+ for(i = 0; i < 10; ++i)
+ func();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52173-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52173-2.c
new file mode 100644
index 000000000..ca64893fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr52173-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O2" } */
+
+int a;
+
+int main()
+{
+ int i;
+ for (i = 0; i < 1; ++i)
+ __transaction_atomic { ++a; }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr53008.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr53008.c
new file mode 100644
index 000000000..1374d76fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr53008.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+void __attribute__((transaction_safe)) (*fn)(void);
+
+static void __attribute__((transaction_safe))
+foo(void)
+{
+}
+
+void set_fn(void)
+{
+ fn = foo;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr53850.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr53850.c
new file mode 100644
index 000000000..ca2c6043b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr53850.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O3" } */
+
+unsigned char pp[100];
+
+void
+foo (void)
+{
+ int i;
+ __transaction_atomic
+ {
+ for (i = 0; i < 100; ++i)
+ pp[i] = 0x33;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr55401.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr55401.c
new file mode 100644
index 000000000..1ac7d9757
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr55401.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O0 -fdump-tree-optimized" } */
+
+int george;
+int ringo;
+
+__attribute__((transaction_callable))
+void foo()
+{
+ ringo=666;
+ __transaction_atomic {
+ george=999;
+ }
+}
+
+/* There should only be 2 instrumented writes to GEORGE: one in FOO,
+ and one in the transactional clone to FOO. There should NOT be
+ more than one instrumented write to GEORGE in the clone of
+ FOO. */
+/* { dg-final { scan-tree-dump-times "ITM_WU\[0-9\] \\(&george," 2 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr56108.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr56108.c
new file mode 100644
index 000000000..81ff574cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pr56108.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O" } */
+
+int
+main()
+{
+ __transaction_relaxed { __asm__(""); }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-1.c
new file mode 100644
index 000000000..896902404
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmedge -fdump-tree-tmlower" } */
+
+int global;
+
+foo(int local)
+{
+ __transaction_atomic {
+ local++;
+ if (++global == 10)
+ __transaction_cancel;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times " instrumentedCode" 1 "tmedge" } } */
+/* { dg-final { scan-tree-dump-times "hasNoAbort" 0 "tmedge" } } */
+/* { dg-final { scan-tree-dump-times "GTMA_HAVE_ABORT" 1 "tmlower" } } */
+/* { dg-final { cleanup-tree-dump "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmlower" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-2.c
new file mode 100644
index 000000000..56a3ffa13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-ipa-tmipa" } */
+
+/* Test that irrevocability gets set for the obvious case. */
+
+int global;
+int george;
+
+extern crap() __attribute__((transaction_unsafe));
+
+foo(){
+ __transaction_relaxed {
+ global++;
+ crap();
+ george++;
+ }
+}
+
+/* { dg-final { scan-ipa-dump-times "GTMA_MAY_ENTER_IRREVOCABLE" 1 "tmipa" } } */
+/* { dg-final { cleanup-ipa-dump "tmipa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-3.c
new file mode 100644
index 000000000..48f2230cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-3.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-ipa-tmipa" } */
+
+/* Test that indirect calls set the irrevocable bit. */
+
+void (*indirect)(void);
+
+foo(){
+ __transaction_relaxed {
+ (*indirect)();
+ }
+}
+
+/* { dg-final { scan-ipa-dump-times "GTMA_MAY_ENTER_IRREVOCABLE" 1 "tmipa" } } */
+/* { dg-final { cleanup-ipa-dump "tmipa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-4.c
new file mode 100644
index 000000000..c34f5e619
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/props-4.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-tmedge -fdump-tree-tmmark" } */
+
+int a, b;
+
+void __attribute((transaction_may_cancel_outer,noinline)) cancel1()
+{
+ __transaction_cancel [[outer]];
+}
+
+void
+foo(void)
+{
+ __transaction_atomic [[outer]] {
+ a = 2;
+ __transaction_atomic {
+ b = 2;
+ cancel1();
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump-times " instrumentedCode" 1 "tmedge" } } */
+/* { dg-final { scan-tree-dump-times "hasNoAbort" 0 "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmedge" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/pub-safety-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pub-safety-1.c
new file mode 100644
index 000000000..660e9a627
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/pub-safety-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O1 -fdump-tree-lim1" } */
+
+/* Test that thread visible loads do not get hoisted out of loops if
+ the load would not have occurred on each path out of the loop. */
+
+int x[10] = {0,0,0,0,0,0,0,0,0,0};
+int DATA_DATA = 0;
+
+void reader()
+{
+ int i;
+ __transaction_atomic
+ {
+ for (i = 0; i < 10; i++)
+ if (x[i])
+ x[i] += DATA_DATA;
+ /* If we loaded DATA_DATA here, we could hoist it before the loop,
+ but since we don't... we can't. */
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Cannot hoist.*DATA_DATA because it is in a transaction" 1 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/reg-promotion.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/reg-promotion.c
new file mode 100644
index 000000000..e48bfb279
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/reg-promotion.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O2 -fdump-tree-lim1" } */
+
+/* Test that `count' is not written to unless p->data>0. */
+
+int count;
+
+struct obj {
+ int data;
+ struct obj *next;
+} *q;
+
+void func()
+{
+ struct obj *p;
+ __transaction_atomic {
+ for (p = q; p; p = p->next)
+ if (p->data > 0)
+ count++;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Cannot hoist conditional load of count because it is in a transaction" 1 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/tm.exp b/gcc-4.9/gcc/testsuite/gcc.dg/tm/tm.exp
new file mode 100644
index 000000000..ce1ec0c3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/tm.exp
@@ -0,0 +1,43 @@
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+if ![check_effective_target_fgnu_tm] {
+ return
+}
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Run the tests that are shared with C++ testing.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/tm/*c]] \
+ "" $DEFAULT_CFLAGS
+# Run the C-only tests.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/unsafe.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/unsafe.c
new file mode 100644
index 000000000..824368a1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/unsafe.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+__attribute__((transaction_callable))
+static int func ()
+{
+ return 12345;
+}
+
+int main()
+{
+ __transaction_atomic { return func(); } /* { dg-error "unsafe function call .func. " } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/unused.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/unused.c
new file mode 100644
index 000000000..7c8aa3e77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/unused.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -Wall" } */
+
+__attribute__((transaction_safe))
+static int unused_func () /* { dg-warning "defined but not used" } */
+{
+ return 12345;
+}
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler "_ZGTt11unused_func:" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/vector-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/vector-1.c
new file mode 100644
index 000000000..2dc43b0a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/vector-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -O3" } */
+
+/* On x86-64, the vectorizer creates V2DI uses which we must handle.
+ Similarly for other vector architectures. */
+
+void ** newElements;
+
+__attribute__((transaction_safe))
+long
+TMqueue_push (void** queuePtr)
+{
+ long src;
+ for (src = 1; src < 9; src++) {
+ newElements[src+1] = queuePtr[src];
+ }
+ return 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-2.c
new file mode 100644
index 000000000..29486335a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm" } */
+
+#define W(X) __attribute__((transaction_wrap(X)))
+void f1(void);
+void f2(int);
+int i3;
+int f7(void);
+
+void g1(void) W(f1);
+void g2(void) W(f2); /* { dg-error "is not compatible" } */
+void g3(void) W(i3); /* { dg-error "is not a function" } */
+void g4(void) W(f4); /* { dg-error "is not a function" } */
+void g5(void) W(1); /* { dg-error "not an identifier" } */
+void g6(void) W("f1"); /* { dg-error "not an identifier" } */
+void g7(void) W(f7); /* { dg-error "is not compatible" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-3.c
new file mode 100644
index 000000000..673247103
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-optimized" } */
+
+void free (void *);
+void wrapper (void *) __attribute__((transaction_wrap (free)));
+void *p;
+
+void foo()
+{
+ __transaction_relaxed { free (p); }
+}
+
+/* We still have one call to free()-- on the uninstrumented path
+ everything is as usual. */
+/* { dg-final { scan-tree-dump-times "free" 1 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-4.c
new file mode 100644
index 000000000..9a4ec061f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tm/wrap-4.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-optimized -O2" } */
+
+static void candy() { candycane(); }
+
+static void tootsie_roll () __attribute__((transaction_wrap (candy)));
+static void tootsie_roll () { bark(); }
+
+void foo()
+{
+ __transaction_relaxed { candy(); }
+}
+
+/* We still have one call to candy()-- on the uninstrumented path
+ everything is as usual. */
+/* { dg-final { scan-tree-dump-times "candy \\(\\);" 1 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/20080716-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20080716-1.c
new file mode 100644
index 000000000..91fcd2b00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20080716-1.c
@@ -0,0 +1,58 @@
+/* { dg-do run } */
+/* { dg-require-effective-target lp64 } */
+
+typedef unsigned long size_t;
+struct tree_base
+{
+ int code;
+};
+struct tree_decl_minimal
+{
+ struct tree_base base;
+ const char *name;
+};
+typedef union tree_node {
+ struct tree_base base;
+ struct tree_decl_minimal decl_minimal;
+} *tree;
+struct tree_overload
+{
+ struct tree_base common;
+ tree function;
+};
+typedef struct VEC_tree_base { unsigned num; unsigned alloc; tree vec[1]; } VEC_tree_base;
+typedef struct VEC_tree_gc { VEC_tree_base base; } VEC_tree_gc;
+static __inline__ unsigned VEC_tree_base_length (const VEC_tree_base *vec_)
+{ return vec_ ? vec_->num : 0; }
+static __inline__ int VEC_tree_base_iterate (const VEC_tree_base *vec_, unsigned ix_, tree *ptr)
+{
+ if (vec_ && ix_ < vec_->num) { *ptr = vec_->vec[ix_]; return 1; } else { *ptr = 0; return 0; }
+}
+extern void abort (void);
+void __attribute__((noinline)) foo (size_t x)
+{
+ if (x != 18446744073709551614UL)
+ abort ();
+}
+void
+resort_type_method_vec (VEC_tree_gc *method_vec)
+{
+ int len = (VEC_tree_base_length(((method_vec) ? &(method_vec)->base : 0)));
+ size_t slot;
+ tree fn;
+
+ for (slot = 2;
+ (VEC_tree_base_iterate(((method_vec) ? &(method_vec)->base : 0),slot,&(fn)));
+ ++slot)
+ if (!(((((((fn)->base.code) == 225) ? (((struct tree_overload*)(fn))->function) : (fn)))->decl_minimal.name)))
+ break;
+
+ if (len - slot > 1)
+ foo (len - slot);
+}
+
+int main ()
+{
+ resort_type_method_vec ((void *)0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/20090618-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20090618-1.c
new file mode 100644
index 000000000..8b601d62c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20090618-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
+
+extern void abort (void);
+
+struct X { int *p; int *q; };
+
+int foo(void)
+{
+ int i = 0, j = 1;
+ struct X x, y;
+ int **p;
+ y.p = &i;
+ x.q = &j;
+ p = __builtin_mempcpy (&x, &y, sizeof (int *));
+ return **p;
+}
+
+int main()
+{
+ if (foo() != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110713-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110713-1.c
new file mode 100644
index 000000000..aa446af59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110713-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+
+void *
+test (unsigned long long x, unsigned long long y)
+{
+ return (void *) (unsigned int) (x / y);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110718-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110718-1.c
new file mode 100644
index 000000000..ccabbd914
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110718-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct X {
+#if (__SIZEOF_LONG__ != __SIZEOF_INT__) && (__SIZEOF_LONG__ == 8)
+ unsigned long i : 33;
+#else
+ unsigned long i;
+#endif
+};
+unsigned long __attribute__((noinline))
+foo (struct X *p)
+{
+ return ~p->i;
+}
+int main()
+{
+ struct X x;
+ x.i = -1;
+ if (foo (&x) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110719-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110719-1.c
new file mode 100644
index 000000000..7797e08ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20110719-1.c
@@ -0,0 +1,10 @@
+extern void abort (void);
+int i;
+int main()
+{
+ int b = i != 0;
+ int c = ~b;
+ if (c != -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/20131115-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20131115-1.c
new file mode 100644
index 000000000..edb05f04c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20131115-1.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+
+struct S { int i; };
+__attribute__((const, noinline, noclone))
+struct S foo (int x)
+{
+ struct S s;
+ s.i = x;
+ return s;
+}
+
+int a[2048], b[2048], c[2048], d[2048];
+struct S e[2048];
+
+__attribute__((noinline, noclone)) void
+bar (void)
+{
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ e[i] = foo (i);
+ a[i+2] = a[i] + a[i+1];
+ b[10] = b[10] + i;
+ c[i] = c[2047 - i];
+ d[i] = d[i + 1];
+ }
+}
+
+int
+main ()
+{
+ int i;
+ bar ();
+ for (i = 0; i < 1024; i++)
+ if (e[i].i != i)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/20131122-0.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20131122-0.c
new file mode 100644
index 000000000..42d92faed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/20131122-0.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+extern void abort (void);
+
+void __attribute__ ((noinline))
+f (long *s, long *t, int len1, int len2)
+{
+ int i, j;
+
+ j = 2;
+ for (i = len1 - 1; i >= 0; i--)
+ {
+ s[j--] = (i < len2 ? t[i] : t[len2 - 1] < 0 ? -1 : 0);
+ if (j < 0)
+ break;
+ }
+}
+
+long s[3];
+long t[3];
+
+int
+main (void)
+{
+ t[0] = 1;
+ t[1] = 2;
+ t[2] = 3;
+ f (s, t, 3, 3);
+ if (memcmp (s, t, sizeof (s)) != 0)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c
new file mode 100644
index 000000000..8d01bc616
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/Wsizeof-pointer-memaccess1.c
@@ -0,0 +1,712 @@
+/* Test -Wsizeof-pointer-memaccess warnings. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+/* Test just twice, once with -O0 non-fortified, once with -O2 fortified. */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" "-O2" } } */
+/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *memset (void *, int, size_t);
+extern void *memcpy (void *__restrict, const void *__restrict, size_t);
+extern void *memmove (void *__restrict, const void *__restrict, size_t);
+extern int memcmp (const void *, const void *, size_t);
+extern char *strncpy (char *__restrict, const char *__restrict, size_t);
+extern char *strncat (char *__restrict, const char *__restrict, size_t);
+extern char *stpncpy (char *__restrict, const char *__restrict, size_t);
+extern char *strndup (const char *, size_t);
+extern int strncmp (const char *, const char *, size_t);
+extern int strncasecmp (const char *, const char *, size_t);
+
+#ifdef __OPTIMIZE__
+# define bos(ptr) __builtin_object_size (ptr, 1)
+# define bos0(ptr) __builtin_object_size (ptr, 0)
+
+__attribute__((__always_inline__, __gnu_inline__, __artificial__))
+extern inline void *
+memset (void *dest, int c, size_t len)
+{
+ return __builtin___memset_chk (dest, c, len, bos0 (dest));
+}
+
+__attribute__((__always_inline__, __gnu_inline__, __artificial__))
+extern inline void *
+memcpy (void *__restrict dest, const void *__restrict src, size_t len)
+{
+ return __builtin___memcpy_chk (dest, src, len, bos0 (dest));
+}
+
+__attribute__((__always_inline__, __gnu_inline__, __artificial__))
+extern inline void *
+memmove (void *dest, const void *src, size_t len)
+{
+ return __builtin___memmove_chk (dest, src, len, bos0 (dest));
+}
+
+__attribute__((__always_inline__, __gnu_inline__, __artificial__))
+extern inline char *
+strncpy (char *__restrict dest, const char *__restrict src, size_t len)
+{
+ return __builtin___strncpy_chk (dest, src, len, bos (dest));
+}
+
+__attribute__((__always_inline__, __gnu_inline__, __artificial__))
+extern inline char *
+strncat (char *dest, const char *src, size_t len)
+{
+ return __builtin___strncat_chk (dest, src, len, bos (dest));
+}
+
+__attribute__((__always_inline__, __gnu_inline__, __artificial__))
+extern inline char *
+stpncpy (char *__restrict dest, const char *__restrict src, size_t len)
+{
+ return __builtin___stpncpy_chk (dest, src, len, bos (dest));
+}
+#endif
+
+struct A { short a, b; int c, d; long e, f; };
+typedef struct A TA;
+typedef struct A *PA;
+typedef TA *PTA;
+struct B {};
+typedef struct B TB;
+typedef struct B *PB;
+typedef TB *PTB;
+typedef int X[3][3][3];
+
+int
+f1 (void *x, int z)
+{
+ struct A a, *pa1 = &a;
+ TA *pa2 = &a;
+ PA pa3 = &a;
+ PTA pa4 = &a;
+ memset (&a, 0, sizeof (&a)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memset (pa1, 0, sizeof (pa1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memset (pa2, 0, sizeof pa2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memset (pa3, 0, sizeof (pa3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memset (pa4, 0, sizeof pa4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memset (pa1, 0, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memset (pa2, 0, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memset (pa3, 0, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memset (pa4, 0, sizeof (__typeof (pa4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ memcpy (&a, x, sizeof (&a)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memcpy (pa1, x, sizeof (pa1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memcpy (pa2, x, sizeof pa2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memcpy (pa3, x, sizeof (pa3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memcpy (pa4, x, sizeof pa4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memcpy (pa1, x, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (pa2, x, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (pa3, x, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (pa4, x, sizeof (__typeof (pa4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ memcpy (x, &a, sizeof (&a)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ memcpy (x, pa1, sizeof (pa1)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memcpy (x, pa2, sizeof pa2); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memcpy (x, pa3, sizeof (pa3)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memcpy (x, pa4, sizeof pa4); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memcpy (x, pa1, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (x, pa2, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (x, pa3, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (x, pa4, sizeof (__typeof (pa4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+
+ memmove (&a, x, sizeof (&a)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memmove (pa1, x, sizeof (pa1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memmove (pa2, x, sizeof pa2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memmove (pa3, x, sizeof (pa3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memmove (pa4, x, sizeof pa4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memmove (pa1, x, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memmove (pa2, x, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memmove (pa3, x, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memmove (pa4, x, sizeof (__typeof (pa4)));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ memmove (x, &a, sizeof (&a)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ memmove (x, pa1, sizeof (pa1)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memmove (x, pa2, sizeof pa2); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memmove (x, pa3, sizeof (pa3)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memmove (x, pa4, sizeof pa4); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memmove (x, pa1, sizeof (struct A *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memmove (x, pa2, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memmove (x, pa3, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memmove (x, pa4, sizeof (__typeof (pa4)));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+
+ z += memcmp (&a, x, sizeof (&a)); /* { dg-warning "call is the same expression as the first source; did you mean to remove the addressof" } */
+ z += memcmp (pa1, x, sizeof (pa1)); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += memcmp (pa2, x, sizeof pa2); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += memcmp (pa3, x, sizeof (pa3)); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += memcmp (pa4, x, sizeof pa4); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += memcmp (pa1, x, sizeof (struct A *));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+ z += memcmp (pa2, x, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+ z += memcmp (pa3, x, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+
+ z += memcmp (x, &a, sizeof (&a)); /* { dg-warning "call is the same expression as the second source; did you mean to remove the addressof" } */
+ z += memcmp (x, pa1, sizeof (pa1)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += memcmp (x, pa2, sizeof pa2); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += memcmp (x, pa3, sizeof (pa3)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += memcmp (x, pa4, sizeof pa4); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += memcmp (x, pa1, sizeof (struct A *));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+ z += memcmp (x, pa2, sizeof (PTA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+ z += memcmp (x, pa3, sizeof (PA)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+
+ /* These are correct, no warning. */
+ memset (&a, 0, sizeof a);
+ memset (&a, 0, sizeof (a));
+ memset (&a, 0, sizeof (struct A));
+ memset (&a, 0, sizeof (const struct A));
+ memset (&a, 0, sizeof (volatile struct A));
+ memset (&a, 0, sizeof (volatile const struct A));
+ memset (&a, 0, sizeof (TA));
+ memset (&a, 0, sizeof (__typeof (*&a)));
+ memset (pa1, 0, sizeof (*pa1));
+ memset (pa2, 0, sizeof (*pa3));
+ memset (pa3, 0, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memset ((void *) &a, 0, sizeof (&a));
+ memset ((char *) &a, 0, sizeof (&a));
+ memset (&a, 0, sizeof (&a) + 0);
+ memset (&a, 0, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ memcpy (&a, x, sizeof a);
+ memcpy (&a, x, sizeof (a));
+ memcpy (&a, x, sizeof (struct A));
+ memcpy (&a, x, sizeof (const struct A));
+ memcpy (&a, x, sizeof (volatile struct A));
+ memcpy (&a, x, sizeof (volatile const struct A));
+ memcpy (&a, x, sizeof (TA));
+ memcpy (&a, x, sizeof (__typeof (*&a)));
+ memcpy (pa1, x, sizeof (*pa1));
+ memcpy (pa2, x, sizeof (*pa3));
+ memcpy (pa3, x, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memcpy ((void *) &a, x, sizeof (&a));
+ memcpy ((char *) &a, x, sizeof (&a));
+ memcpy (&a, x, sizeof (&a) + 0);
+ memcpy (&a, x, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ memcpy (x, &a, sizeof a);
+ memcpy (x, &a, sizeof (a));
+ memcpy (x, &a, sizeof (struct A));
+ memcpy (x, &a, sizeof (const struct A));
+ memcpy (x, &a, sizeof (volatile struct A));
+ memcpy (x, &a, sizeof (volatile const struct A));
+ memcpy (x, &a, sizeof (TA));
+ memcpy (x, &a, sizeof (__typeof (*&a)));
+ memcpy (x, pa1, sizeof (*pa1));
+ memcpy (x, pa2, sizeof (*pa3));
+ memcpy (x, pa3, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memcpy (x, (void *) &a, sizeof (&a));
+ memcpy (x, (char *) &a, sizeof (&a));
+ memcpy (x, &a, sizeof (&a) + 0);
+ memcpy (x, &a, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ memmove (&a, x, sizeof a);
+ memmove (&a, x, sizeof (a));
+ memmove (&a, x, sizeof (struct A));
+ memmove (&a, x, sizeof (const struct A));
+ memmove (&a, x, sizeof (volatile struct A));
+ memmove (&a, x, sizeof (volatile const struct A));
+ memmove (&a, x, sizeof (TA));
+ memmove (&a, x, sizeof (__typeof (*&a)));
+ memmove (pa1, x, sizeof (*pa1));
+ memmove (pa2, x, sizeof (*pa3));
+ memmove (pa3, x, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memmove ((void *) &a, x, sizeof (&a));
+ memmove ((char *) &a, x, sizeof (&a));
+ memmove (&a, x, sizeof (&a) + 0);
+ memmove (&a, x, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ memmove (x, &a, sizeof a);
+ memmove (x, &a, sizeof (a));
+ memmove (x, &a, sizeof (struct A));
+ memmove (x, &a, sizeof (const struct A));
+ memmove (x, &a, sizeof (volatile struct A));
+ memmove (x, &a, sizeof (volatile const struct A));
+ memmove (x, &a, sizeof (TA));
+ memmove (x, &a, sizeof (__typeof (*&a)));
+ memmove (x, pa1, sizeof (*pa1));
+ memmove (x, pa2, sizeof (*pa3));
+ memmove (x, pa3, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memmove (x, (void *) &a, sizeof (&a));
+ memmove (x, (char *) &a, sizeof (&a));
+ memmove (x, &a, sizeof (&a) + 0);
+ memmove (x, &a, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ z += memcmp (&a, x, sizeof a);
+ z += memcmp (&a, x, sizeof (a));
+ z += memcmp (&a, x, sizeof (struct A));
+ z += memcmp (&a, x, sizeof (const struct A));
+ z += memcmp (&a, x, sizeof (volatile struct A));
+ z += memcmp (&a, x, sizeof (volatile const struct A));
+ z += memcmp (&a, x, sizeof (TA));
+ z += memcmp (&a, x, sizeof (__typeof (*&a)));
+ z += memcmp (pa1, x, sizeof (*pa1));
+ z += memcmp (pa2, x, sizeof (*pa3));
+ z += memcmp (pa3, x, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += memcmp ((void *) &a, x, sizeof (&a));
+ z += memcmp ((char *) &a, x, sizeof (&a));
+ z += memcmp (&a, x, sizeof (&a) + 0);
+ z += memcmp (&a, x, 0 + sizeof (&a));
+
+ /* These are correct, no warning. */
+ z += memcmp (x, &a, sizeof a);
+ z += memcmp (x, &a, sizeof (a));
+ z += memcmp (x, &a, sizeof (struct A));
+ z += memcmp (x, &a, sizeof (const struct A));
+ z += memcmp (x, &a, sizeof (volatile struct A));
+ z += memcmp (x, &a, sizeof (volatile const struct A));
+ z += memcmp (x, &a, sizeof (TA));
+ z += memcmp (x, &a, sizeof (__typeof (*&a)));
+ z += memcmp (x, pa1, sizeof (*pa1));
+ z += memcmp (x, pa2, sizeof (*pa3));
+ z += memcmp (x, pa3, sizeof (__typeof (*pa3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += memcmp (x, (void *) &a, sizeof (&a));
+ z += memcmp (x, (char *) &a, sizeof (&a));
+ z += memcmp (x, &a, sizeof (&a) + 0);
+ z += memcmp (x, &a, 0 + sizeof (&a));
+
+ return z;
+}
+
+int
+f2 (void *x, int z)
+{
+ struct B b, *pb1 = &b;
+ TB *pb2 = &b;
+ PB pb3 = &b;
+ PTB pb4 = &b;
+ memset (&b, 0, sizeof (&b)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memset (pb1, 0, sizeof (pb1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memset (pb2, 0, sizeof pb2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memset (pb3, 0, sizeof (pb3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memset (pb4, 0, sizeof pb4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memset (pb1, 0, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memset (pb2, 0, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memset (pb3, 0, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memset (pb4, 0, sizeof (__typeof (pb4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ memcpy (&b, x, sizeof (&b)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memcpy (pb1, x, sizeof (pb1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memcpy (pb2, x, sizeof pb2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memcpy (pb3, x, sizeof (pb3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memcpy (pb4, x, sizeof pb4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memcpy (pb1, x, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (pb2, x, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (pb3, x, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (pb4, x, sizeof (__typeof (pb4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ memcpy (x, &b, sizeof (&b)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ memcpy (x, pb1, sizeof (pb1)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memcpy (x, pb2, sizeof pb2); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memcpy (x, pb3, sizeof (pb3)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memcpy (x, pb4, sizeof pb4); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memcpy (x, pb1, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (x, pb2, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (x, pb3, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memcpy (x, pb4, sizeof (__typeof (pb4))); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+
+ memmove (&b, x, sizeof (&b)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memmove (pb1, x, sizeof (pb1)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memmove (pb2, x, sizeof pb2); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memmove (pb3, x, sizeof (pb3)); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memmove (pb4, x, sizeof pb4); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+ memmove (pb1, x, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memmove (pb2, x, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memmove (pb3, x, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+ memmove (pb4, x, sizeof (__typeof (pb4)));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the destination; expected \[^\n\r\]* or an explicit length" } */
+
+ memmove (x, &b, sizeof (&b)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ memmove (x, pb1, sizeof (pb1)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memmove (x, pb2, sizeof pb2); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memmove (x, pb3, sizeof (pb3)); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memmove (x, pb4, sizeof pb4); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+ memmove (x, pb1, sizeof (struct B *)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memmove (x, pb2, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memmove (x, pb3, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+ memmove (x, pb4, sizeof (__typeof (pb4)));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the source; expected \[^\n\r\]* or an explicit length" } */
+
+ z += memcmp (&b, x, sizeof (&b)); /* { dg-warning "call is the same expression as the first source; did you mean to remove the addressof" } */
+ z += memcmp (pb1, x, sizeof (pb1)); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += memcmp (pb2, x, sizeof pb2); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += memcmp (pb3, x, sizeof (pb3)); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += memcmp (pb4, x, sizeof pb4); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+ z += memcmp (pb1, x, sizeof (struct B *));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+ z += memcmp (pb2, x, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+ z += memcmp (pb3, x, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the first source; expected \[^\n\r\]* or an explicit length" } */
+
+ z += memcmp (x, &b, sizeof (&b)); /* { dg-warning "call is the same expression as the second source; did you mean to remove the addressof" } */
+ z += memcmp (x, pb1, sizeof (pb1)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += memcmp (x, pb2, sizeof pb2); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += memcmp (x, pb3, sizeof (pb3)); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += memcmp (x, pb4, sizeof pb4); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+ z += memcmp (x, pb1, sizeof (struct B *));/* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+ z += memcmp (x, pb2, sizeof (PTB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+ z += memcmp (x, pb3, sizeof (PB)); /* { dg-warning "call is the same pointer type \[^\n\r\]* as the second source; expected \[^\n\r\]* or an explicit length" } */
+
+ /* These are correct, no warning. */
+ memset (&b, 0, sizeof b);
+ memset (&b, 0, sizeof (b));
+ memset (&b, 0, sizeof (struct B));
+ memset (&b, 0, sizeof (const struct B));
+ memset (&b, 0, sizeof (volatile struct B));
+ memset (&b, 0, sizeof (volatile const struct B));
+ memset (&b, 0, sizeof (TB));
+ memset (&b, 0, sizeof (__typeof (*&b)));
+ memset (pb1, 0, sizeof (*pb1));
+ memset (pb2, 0, sizeof (*pb3));
+ memset (pb3, 0, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memset ((void *) &b, 0, sizeof (&b));
+ memset ((char *) &b, 0, sizeof (&b));
+ memset (&b, 0, sizeof (&b) + 0);
+ memset (&b, 0, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ memcpy (&b, x, sizeof b);
+ memcpy (&b, x, sizeof (b));
+ memcpy (&b, x, sizeof (struct B));
+ memcpy (&b, x, sizeof (const struct B));
+ memcpy (&b, x, sizeof (volatile struct B));
+ memcpy (&b, x, sizeof (volatile const struct B));
+ memcpy (&b, x, sizeof (TB));
+ memcpy (&b, x, sizeof (__typeof (*&b)));
+ memcpy (pb1, x, sizeof (*pb1));
+ memcpy (pb2, x, sizeof (*pb3));
+ memcpy (pb3, x, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memcpy ((void *) &b, x, sizeof (&b));
+ memcpy ((char *) &b, x, sizeof (&b));
+ memcpy (&b, x, sizeof (&b) + 0);
+ memcpy (&b, x, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ memcpy (x, &b, sizeof b);
+ memcpy (x, &b, sizeof (b));
+ memcpy (x, &b, sizeof (struct B));
+ memcpy (x, &b, sizeof (const struct B));
+ memcpy (x, &b, sizeof (volatile struct B));
+ memcpy (x, &b, sizeof (volatile const struct B));
+ memcpy (x, &b, sizeof (TB));
+ memcpy (x, &b, sizeof (__typeof (*&b)));
+ memcpy (x, pb1, sizeof (*pb1));
+ memcpy (x, pb2, sizeof (*pb3));
+ memcpy (x, pb3, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memcpy (x, (void *) &b, sizeof (&b));
+ memcpy (x, (char *) &b, sizeof (&b));
+ memcpy (x, &b, sizeof (&b) + 0);
+ memcpy (x, &b, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ memmove (&b, x, sizeof b);
+ memmove (&b, x, sizeof (b));
+ memmove (&b, x, sizeof (struct B));
+ memmove (&b, x, sizeof (const struct B));
+ memmove (&b, x, sizeof (volatile struct B));
+ memmove (&b, x, sizeof (volatile const struct B));
+ memmove (&b, x, sizeof (TB));
+ memmove (&b, x, sizeof (__typeof (*&b)));
+ memmove (pb1, x, sizeof (*pb1));
+ memmove (pb2, x, sizeof (*pb3));
+ memmove (pb3, x, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memmove ((void *) &b, x, sizeof (&b));
+ memmove ((char *) &b, x, sizeof (&b));
+ memmove (&b, x, sizeof (&b) + 0);
+ memmove (&b, x, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ memmove (x, &b, sizeof b);
+ memmove (x, &b, sizeof (b));
+ memmove (x, &b, sizeof (struct B));
+ memmove (x, &b, sizeof (const struct B));
+ memmove (x, &b, sizeof (volatile struct B));
+ memmove (x, &b, sizeof (volatile const struct B));
+ memmove (x, &b, sizeof (TB));
+ memmove (x, &b, sizeof (__typeof (*&b)));
+ memmove (x, pb1, sizeof (*pb1));
+ memmove (x, pb2, sizeof (*pb3));
+ memmove (x, pb3, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ memmove (x, (void *) &b, sizeof (&b));
+ memmove (x, (char *) &b, sizeof (&b));
+ memmove (x, &b, sizeof (&b) + 0);
+ memmove (x, &b, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ z += memcmp (&b, x, sizeof b);
+ z += memcmp (&b, x, sizeof (b));
+ z += memcmp (&b, x, sizeof (struct B));
+ z += memcmp (&b, x, sizeof (const struct B));
+ z += memcmp (&b, x, sizeof (volatile struct B));
+ z += memcmp (&b, x, sizeof (volatile const struct B));
+ z += memcmp (&b, x, sizeof (TB));
+ z += memcmp (&b, x, sizeof (__typeof (*&b)));
+ z += memcmp (pb1, x, sizeof (*pb1));
+ z += memcmp (pb2, x, sizeof (*pb3));
+ z += memcmp (pb3, x, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += memcmp ((void *) &b, x, sizeof (&b));
+ z += memcmp ((char *) &b, x, sizeof (&b));
+ z += memcmp (&b, x, sizeof (&b) + 0);
+ z += memcmp (&b, x, 0 + sizeof (&b));
+
+ /* These are correct, no warning. */
+ z += memcmp (x, &b, sizeof b);
+ z += memcmp (x, &b, sizeof (b));
+ z += memcmp (x, &b, sizeof (struct B));
+ z += memcmp (x, &b, sizeof (const struct B));
+ z += memcmp (x, &b, sizeof (volatile struct B));
+ z += memcmp (x, &b, sizeof (volatile const struct B));
+ z += memcmp (x, &b, sizeof (TB));
+ z += memcmp (x, &b, sizeof (__typeof (*&b)));
+ z += memcmp (x, pb1, sizeof (*pb1));
+ z += memcmp (x, pb2, sizeof (*pb3));
+ z += memcmp (x, pb3, sizeof (__typeof (*pb3)));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += memcmp (x, (void *) &b, sizeof (&b));
+ z += memcmp (x, (char *) &b, sizeof (&b));
+ z += memcmp (x, &b, sizeof (&b) + 0);
+ z += memcmp (x, &b, 0 + sizeof (&b));
+
+ return z;
+}
+
+int
+f3 (void *x, char *y, int z, X w)
+{
+ unsigned char *y1 = (unsigned char *) __builtin_alloca (z + 16);
+ char buf1[7];
+ signed char buf2[z + 32];
+ long buf3[17];
+ int *buf4[9];
+ signed char *y2 = buf2;
+ char c;
+ char *y3;
+ memset (y, 0, sizeof (y)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memset (y1, 0, sizeof (y1)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memset (y2, 0, sizeof (y2)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memset (&c, 0, sizeof (&c)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memset (w, 0, sizeof w); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+
+ memcpy (y, x, sizeof (y)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memcpy (y1, x, sizeof (y1)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memcpy (y2, x, sizeof (y2)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memcpy (&c, x, sizeof (&c)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memcpy (w, x, sizeof w); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+
+ memcpy (x, y, sizeof (y)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ memcpy (x, y1, sizeof (y1)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ memcpy (x, y2, sizeof (y2)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ memcpy (x, &c, sizeof (&c)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ memcpy (x, w, sizeof w); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+
+ memmove (y, x, sizeof (y)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memmove (y1, x, sizeof (y1)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memmove (y2, x, sizeof (y2)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ memmove (&c, x, sizeof (&c)); /* { dg-warning "call is the same expression as the destination; did you mean to remove the addressof" } */
+ memmove (w, x, sizeof w); /* { dg-warning "call is the same expression as the destination; did you mean to dereference it" } */
+
+ memmove (x, y, sizeof (y)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ memmove (x, y1, sizeof (y1)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ memmove (x, y2, sizeof (y2)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ memmove (x, &c, sizeof (&c)); /* { dg-warning "call is the same expression as the source; did you mean to remove the addressof" } */
+ memmove (x, w, sizeof w); /* { dg-warning "call is the same expression as the source; did you mean to dereference it" } */
+
+ z += memcmp (y, x, sizeof (y)); /* { dg-warning "call is the same expression as the first source; did you mean to provide an explicit length" } */
+ z += memcmp (y1, x, sizeof (y1)); /* { dg-warning "call is the same expression as the first source; did you mean to provide an explicit length" } */
+ z += memcmp (y2, x, sizeof (y2)); /* { dg-warning "call is the same expression as the first source; did you mean to provide an explicit length" } */
+ z += memcmp (&c, x, sizeof (&c)); /* { dg-warning "call is the same expression as the first source; did you mean to remove the addressof" } */
+ z += memcmp (w, x, sizeof w); /* { dg-warning "call is the same expression as the first source; did you mean to dereference it" } */
+
+ z += memcmp (x, y, sizeof (y)); /* { dg-warning "call is the same expression as the second source; did you mean to provide an explicit length" } */
+ z += memcmp (x, y1, sizeof (y1)); /* { dg-warning "call is the same expression as the second source; did you mean to provide an explicit length" } */
+ z += memcmp (x, y2, sizeof (y2)); /* { dg-warning "call is the same expression as the second source; did you mean to provide an explicit length" } */
+ z += memcmp (x, &c, sizeof (&c)); /* { dg-warning "call is the same expression as the second source; did you mean to remove the addressof" } */
+ z += memcmp (x, w, sizeof w); /* { dg-warning "call is the same expression as the second source; did you mean to dereference it" } */
+
+ /* These are correct, no warning. */
+ memset (y, 0, sizeof (*y));
+ memset (y1, 0, sizeof (*y2));
+ memset (buf1, 0, sizeof buf1);
+ memset (buf3, 0, sizeof (buf3));
+ memset (&buf3[0], 0, sizeof (buf3));
+ memset (&buf4[0], 0, sizeof (buf4));
+ memset (w, 0, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ memset ((void *) y, 0, sizeof (y));
+ memset ((char *) y1, 0, sizeof (y2));
+ memset (y, 0, sizeof (y) + 0);
+ memset (y1, 0, 0 + sizeof (y2));
+ memset ((void *) &c, 0, sizeof (&c));
+ memset ((signed char *) &c, 0, sizeof (&c));
+ memset (&c, 0, sizeof (&c) + 0);
+ memset (&c, 0, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ memcpy (y, x, sizeof (*y));
+ memcpy (y1, x, sizeof (*y2));
+ memcpy (buf1, x, sizeof buf1);
+ memcpy (buf3, x, sizeof (buf3));
+ memcpy (&buf3[0], x, sizeof (buf3));
+ memcpy (&buf4[0], x, sizeof (buf4));
+ memcpy (&y3, y, sizeof (y3));
+ memcpy ((char *) &y3, y, sizeof (y3));
+ memcpy (w, x, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ memcpy ((void *) y, x, sizeof (y));
+ memcpy ((char *) y1, x, sizeof (y2));
+ memcpy (y, x, sizeof (y) + 0);
+ memcpy (y1, x, 0 + sizeof (y2));
+ memcpy ((void *) &c, x, sizeof (&c));
+ memcpy ((signed char *) &c, x, sizeof (&c));
+ memcpy (&c, x, sizeof (&c) + 0);
+ memcpy (&c, x, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ memcpy (x, y, sizeof (*y));
+ memcpy (x, y1, sizeof (*y2));
+ memcpy (x, buf1, sizeof buf1);
+ memcpy (x, buf3, sizeof (buf3));
+ memcpy (x, &buf3[0], sizeof (buf3));
+ memcpy (x, &buf4[0], sizeof (buf4));
+ memcpy (y, &y3, sizeof (y3));
+ memcpy (y, (char *) &y3, sizeof (y3));
+ memcpy (x, w, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ memcpy (x, (void *) y, sizeof (y));
+ memcpy (x, (char *) y1, sizeof (y2));
+ memcpy (x, y, sizeof (y) + 0);
+ memcpy (x, y1, 0 + sizeof (y2));
+ memcpy (x, (void *) &c, sizeof (&c));
+ memcpy (x, (signed char *) &c, sizeof (&c));
+ memcpy (x, &c, sizeof (&c) + 0);
+ memcpy (x, &c, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ memmove (y, x, sizeof (*y));
+ memmove (y1, x, sizeof (*y2));
+ memmove (buf1, x, sizeof buf1);
+ memmove (buf3, x, sizeof (buf3));
+ memmove (&buf3[0], x, sizeof (buf3));
+ memmove (&buf4[0], x, sizeof (buf4));
+ memmove (&y3, y, sizeof (y3));
+ memmove ((char *) &y3, y, sizeof (y3));
+ memmove (w, x, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ memmove ((void *) y, x, sizeof (y));
+ memmove ((char *) y1, x, sizeof (y2));
+ memmove (y, x, sizeof (y) + 0);
+ memmove (y1, x, 0 + sizeof (y2));
+ memmove ((void *) &c, x, sizeof (&c));
+ memmove ((signed char *) &c, x, sizeof (&c));
+ memmove (&c, x, sizeof (&c) + 0);
+ memmove (&c, x, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ memmove (x, y, sizeof (*y));
+ memmove (x, y1, sizeof (*y2));
+ memmove (x, buf1, sizeof buf1);
+ memmove (x, buf3, sizeof (buf3));
+ memmove (x, &buf3[0], sizeof (buf3));
+ memmove (x, &buf4[0], sizeof (buf4));
+ memmove (y, &y3, sizeof (y3));
+ memmove (y, (char *) &y3, sizeof (y3));
+ memmove (x, w, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ memmove (x, (void *) y, sizeof (y));
+ memmove (x, (char *) y1, sizeof (y2));
+ memmove (x, y, sizeof (y) + 0);
+ memmove (x, y1, 0 + sizeof (y2));
+ memmove (x, (void *) &c, sizeof (&c));
+ memmove (x, (signed char *) &c, sizeof (&c));
+ memmove (x, &c, sizeof (&c) + 0);
+ memmove (x, &c, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ z += memcmp (y, x, sizeof (*y));
+ z += memcmp (y1, x, sizeof (*y2));
+ z += memcmp (buf1, x, sizeof buf1);
+ z += memcmp (buf3, x, sizeof (buf3));
+ z += memcmp (&buf3[0], x, sizeof (buf3));
+ z += memcmp (&buf4[0], x, sizeof (buf4));
+ z += memcmp (&y3, y, sizeof (y3));
+ z += memcmp ((char *) &y3, y, sizeof (y3));
+ z += memcmp (w, x, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += memcmp ((void *) y, x, sizeof (y));
+ z += memcmp ((char *) y1, x, sizeof (y2));
+ z += memcmp (y, x, sizeof (y) + 0);
+ z += memcmp (y1, x, 0 + sizeof (y2));
+ z += memcmp ((void *) &c, x, sizeof (&c));
+ z += memcmp ((signed char *) &c, x, sizeof (&c));
+ z += memcmp (&c, x, sizeof (&c) + 0);
+ z += memcmp (&c, x, 0 + sizeof (&c));
+
+ /* These are correct, no warning. */
+ z += memcmp (x, y, sizeof (*y));
+ z += memcmp (x, y1, sizeof (*y2));
+ z += memcmp (x, buf1, sizeof buf1);
+ z += memcmp (x, buf3, sizeof (buf3));
+ z += memcmp (x, &buf3[0], sizeof (buf3));
+ z += memcmp (x, &buf4[0], sizeof (buf4));
+ z += memcmp (y, &y3, sizeof (y3));
+ z += memcmp (y, (char *) &y3, sizeof (y3));
+ z += memcmp (x, w, sizeof (X));
+ /* These are probably broken, but obfuscated, no warning. */
+ z += memcmp (x, (void *) y, sizeof (y));
+ z += memcmp (x, (char *) y1, sizeof (y2));
+ z += memcmp (x, y, sizeof (y) + 0);
+ z += memcmp (x, y1, 0 + sizeof (y2));
+ z += memcmp (x, (void *) &c, sizeof (&c));
+ z += memcmp (x, (signed char *) &c, sizeof (&c));
+ z += memcmp (x, &c, sizeof (&c) + 0);
+ z += memcmp (x, &c, 0 + sizeof (&c));
+
+ return z;
+}
+
+int
+f4 (char *x, char **y, int z, char w[64])
+{
+ const char *s1 = "foobarbaz";
+ const char *s2 = "abcde12345678";
+ strncpy (x, s1, sizeof (s1)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ strncat (x, s2, sizeof (s2)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ stpncpy (x, s1, sizeof (s1)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ y[0] = strndup (s1, sizeof (s1)); /* { dg-warning "call is the same expression as the source; did you mean to provide an explicit length" } */
+ z += strncmp (s1, s2, sizeof (s1)); /* { dg-warning "call is the same expression as the first source; did you mean to provide an explicit length" } */
+ z += strncmp (s1, s2, sizeof (s2)); /* { dg-warning "call is the same expression as the second source; did you mean to provide an explicit length" } */
+ z += strncasecmp (s1, s2, sizeof (s1)); /* { dg-warning "call is the same expression as the first source; did you mean to provide an explicit length" } */
+ z += strncasecmp (s1, s2, sizeof (s2)); /* { dg-warning "call is the same expression as the second source; did you mean to provide an explicit length" } */
+
+ strncpy (w, s1, sizeof (w)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ strncat (w, s2, sizeof (w)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+ stpncpy (w, s1, sizeof (w)); /* { dg-warning "call is the same expression as the destination; did you mean to provide an explicit length" } */
+
+ /* These are correct, no warning. */
+ const char s3[] = "foobarbaz";
+ const char s4[] = "abcde12345678";
+ strncpy (x, s3, sizeof (s3));
+ strncat (x, s4, sizeof (s4));
+ stpncpy (x, s3, sizeof (s3));
+ y[1] = strndup (s3, sizeof (s3));
+ z += strncmp (s3, s4, sizeof (s3));
+ z += strncmp (s3, s4, sizeof (s4));
+ z += strncasecmp (s3, s4, sizeof (s3));
+ z += strncasecmp (s3, s4, sizeof (s4));
+
+ return z;
+}
+
+/* { dg-prune-output "\[\n\r\]*will always overflow\[\n\r\]*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/alias-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/alias-1.c
new file mode 100644
index 000000000..92b880990
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/alias-1.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "-fschedule-insns" } */
+/* { dg-require-effective-target scheduling } */
+
+extern void abort (void) __attribute__((noreturn));
+
+struct B { int a; int b;};
+struct wrapper {
+union setconflict
+{
+ struct S { char one1; struct B b1; } s;
+ struct T { struct B b2; char two2; } t;
+} a;
+};
+
+int
+main ()
+{
+ int sum = 0;
+ int i;
+ struct wrapper w;
+ struct B *p;
+
+ p = &w.a.s.b1;
+ asm ("": "=r" (p):"0" (p));
+ p->a = 0;
+ asm ("": "=r" (p):"0" (p));
+ sum += p->a;
+
+ p = &w.a.t.b2;
+ asm ("": "=r" (p):"0" (p));
+ p->b = 1;
+ asm ("": "=r" (p):"0" (p));
+ sum += p->b;
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-compile-assign.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-compile-assign.c
new file mode 100644
index 000000000..d6143d278
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-compile-assign.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target arm*-*-* } } */
+/* { dg-options "-mfp16-format=ieee" } */
+
+/* Test basic assignments and conversions for __fp16. */
+
+__fp16 h0 = -1.0;
+__fp16 h1 = 0.0;
+__fp16 h2 = 1234.0;
+__fp16 h3 = 42.0;
+float f1 = 2.0;
+float f2 = -999.9;
+
+void f (__fp16 *p)
+{
+ __fp16 t;
+
+ h0 = 1.0;
+ h1 = h2;
+ h2 = f1;
+ f2 = h2;
+
+ t = *p;
+ *p = h3;
+ h3 = t;
+}
+
+/* Make sure we are not falling through to undefined libcalls. */
+/* { dg-final { scan-assembler-not "__truncsfhf" } } */
+/* { dg-final { scan-assembler-not "__extendhfsf" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-compile-convert.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-compile-convert.c
new file mode 100644
index 000000000..04341959f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-compile-convert.c
@@ -0,0 +1,41 @@
+/* { dg-do compile { target arm*-*-* } } */
+/* { dg-options "-mfp16-format=ieee" } */
+
+/* Test basic assignments and conversions for __fp16. */
+
+__fp16 h1 = 0.0;
+__fp16 h2 = 1234.0;
+char c1 = 1;
+char c2 = 2;
+short s1 = 10;
+short s2 = 20;
+int i1 = -100;
+int i2 = -200;
+long long l1 = 1000.0;
+long long l2 = 2000.0;
+double d1 = -10000.0;
+double d2 = -20000.0;
+
+void f (void)
+{
+ c1 = h1;
+ h2 = c2;
+
+ h1 = s1;
+ s2 = h2;
+
+ i1 = h1;
+ h2 = i2;
+
+ h1 = l1;
+ l2 = h2;
+
+ d1 = h1;
+ h2 = d2;
+}
+
+/* Make sure we are not falling through to undefined libcalls. */
+/* { dg-final { scan-assembler-not "__float.ihf" } } */
+/* { dg-final { scan-assembler-not "__fixhf.i" } } */
+/* { dg-final { scan-assembler-not "__trunc.fhf" } } */
+/* { dg-final { scan-assembler-not "__extendhf.f" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-alt.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-alt.c
new file mode 100644
index 000000000..bcd7aeff1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-alt.c
@@ -0,0 +1,17 @@
+/* Test floating-point conversions. Standard types and __fp16. */
+/* { dg-do run { target arm*-*-* } } */
+/* { dg-options "-mfp16-format=alternative" } */
+
+#include "fp-int-convert.h"
+#define FP16_MANT_DIG 11
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, float, FP16_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, float, FP16_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, float, FP16_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, float, FP16_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, float, FP16_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-ieee.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-ieee.c
new file mode 100644
index 000000000..1314d4b0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-int-convert-ieee.c
@@ -0,0 +1,17 @@
+/* Test floating-point conversions. Standard types and __fp16. */
+/* { dg-do run { target arm*-*-* } } */
+/* { dg-options "-mfp16-format=ieee" } */
+
+#include "fp-int-convert.h"
+#define FP16_MANT_DIG 11
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, float, FP16_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, float, FP16_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, float, FP16_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, float, FP16_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, float, FP16_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-1.c
new file mode 100644
index 000000000..0c601e68c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-1.c
@@ -0,0 +1,5 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+/* { dg-do run { target arm*-*-* } } */
+/* { dg-options "-mfp16-format=ieee" } */
+
+#include "arm-fp16-ops.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-2.c
new file mode 100644
index 000000000..244e31082
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-2.c
@@ -0,0 +1,5 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+/* { dg-do run { target arm*-*-* } } */
+/* { dg-options "-mfp16-format=ieee -ffast-math" } */
+
+#include "arm-fp16-ops.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c
new file mode 100644
index 000000000..8f9ab64bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-3.c
@@ -0,0 +1,5 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+/* { dg-do run { target arm*-*-* } } */
+/* { dg-options "-mfp16-format=alternative" } */
+
+#include "arm-fp16-ops.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c
new file mode 100644
index 000000000..4877f392c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-4.c
@@ -0,0 +1,5 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+/* { dg-do run { target arm*-*-* } } */
+/* { dg-options "-mfp16-format=alternative -ffast-math" } */
+
+#include "arm-fp16-ops.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c
new file mode 100644
index 000000000..92bc8a9c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-5.c
@@ -0,0 +1,15 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+/* { dg-do compile { target arm*-*-* } } */
+/* { dg-require-effective-target arm_fp16_ok } */
+/* { dg-options "-mfp16-format=ieee" } */
+/* { dg-add-options arm_fp16 } */
+
+#include "arm-fp16-ops.h"
+
+/* We've specified options for hardware float, including fp16 support, so
+ we should not see any calls to libfuncs here. */
+/* { dg-final { scan-assembler-not "\tbl\t__.*hf2" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__.*hf3" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c
new file mode 100644
index 000000000..ae40b1e86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-6.c
@@ -0,0 +1,15 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+/* { dg-do compile { target arm*-*-* } } */
+/* { dg-require-effective-target arm_fp16_ok } */
+/* { dg-options "-mfp16-format=ieee -ffast-math" } */
+/* { dg-add-options arm_fp16 } */
+
+#include "arm-fp16-ops.h"
+
+/* We've specified options for hardware float, including fp16 support, so
+ we should not see any calls to libfuncs here. */
+/* { dg-final { scan-assembler-not "\tbl\t__.*hf2" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__.*hf3" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__gnu_h2f_ieee" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__gnu_f2h_ieee" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-7.c
new file mode 100644
index 000000000..ed8089bd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-7.c
@@ -0,0 +1,13 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+/* { dg-do compile { target arm*-*-* } } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-mfp16-format=ieee" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm-fp16-ops.h"
+
+/* We've specified options for hardware float, so we should not see any
+ calls to libfuncs here except for those to the conversion functions. */
+/* { dg-final { scan-assembler-not "\tbl\t__.*hf2" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__.*hf3" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-8.c
new file mode 100644
index 000000000..b138ca187
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops-8.c
@@ -0,0 +1,13 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+/* { dg-do compile { target arm*-*-* } } */
+/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-options "-mfp16-format=ieee -ffast-math" } */
+/* { dg-add-options arm_neon } */
+
+#include "arm-fp16-ops.h"
+
+/* We've specified options for hardware float, so we should not see any
+ calls to libfuncs here except for those to the conversion functions. */
+/* { dg-final { scan-assembler-not "\tbl\t__.*hf2" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__.*hf3" } } */
+/* { dg-final { scan-assembler-not "\tbl\t__gnu_h\[a-z\]*_ieee" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops.h b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops.h
new file mode 100644
index 000000000..320494ee7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/arm-fp16-ops.h
@@ -0,0 +1,135 @@
+/* Test various operators on __fp16 and mixed __fp16/float operands. */
+
+#include <assert.h>
+
+#define CHECK(e,r) assert ((e) == r)
+#define CHECK2(e,r) (assert ((e) == r), temp = (e), assert (temp == r))
+#define TEST(e) assert (e)
+#define TESTNOT(e) assert (!(e))
+
+volatile __fp16 h0 = 0.0;
+volatile __fp16 h1 = 1.0;
+volatile __fp16 h42 = 42.0;
+volatile __fp16 hm2 = -2.0;
+volatile __fp16 temp;
+
+volatile float f0 = 0.0;
+volatile float f1 = 1.0;
+volatile float f42 = 42.0;
+volatile float fm2 = -2.0;
+
+int main (void)
+{
+ TEST (h1);
+ TESTNOT (h0);
+ TEST (!h0);
+ TESTNOT (!h1);
+
+ CHECK2 (-h1, -1.0);
+ CHECK2 (+h1, 1.0);
+
+ CHECK (h1++, 1.0);
+ CHECK (h1, 2.0);
+ CHECK (++h1, 3.0);
+ CHECK (h1, 3.0);
+
+ CHECK (--h1, 2.0);
+ CHECK (h1, 2.0);
+ CHECK (h1--, 2.0);
+ CHECK (h1, 1.0);
+
+ CHECK2 (h42 * hm2, -84.0);
+ CHECK2 (h42 * (__fp16) -2.0, -84.0);
+ CHECK2 (h42 * fm2, -84.0);
+ CHECK2 (f42 * hm2, -84.0);
+
+ CHECK2 (h42 / hm2, -21.0);
+ CHECK2 (h42 / (__fp16) -2.0, -21.0);
+ CHECK2 (h42 / fm2, -21.0);
+ CHECK2 (f42 / hm2, -21.0);
+
+ CHECK2 (hm2 + h42, 40.0);
+ CHECK2 ((__fp16)-2.0 + h42, 40.0);
+ CHECK2 (hm2 + f42, 40.0);
+ CHECK2 (fm2 + h42, 40.0);
+
+ CHECK2 (hm2 - h42, -44.0);
+ CHECK2 ((__fp16)-2.0 - h42, -44.0);
+ CHECK2 (hm2 - f42, -44.0);
+ CHECK2 (fm2 - h42, -44.0);
+
+ TEST (hm2 < h42);
+ TEST (hm2 < (__fp16)42.0);
+ TEST (hm2 < f42);
+ TEST (fm2 < h42);
+
+ TEST (h42 > hm2);
+ TEST ((__fp16)42.0 > hm2);
+ TEST (h42 > fm2);
+ TEST (f42 > hm2);
+
+ TEST (hm2 <= h42);
+ TEST (hm2 <= (__fp16)42.0);
+ TEST (hm2 <= f42);
+ TEST (fm2 <= h42);
+
+ TEST (h42 >= hm2);
+ TEST (h42 >= (__fp16)-2.0);
+ TEST (h42 >= fm2);
+ TEST (f42 >= hm2);
+
+ TESTNOT (h1 == hm2);
+ TEST (h1 == h1);
+ TEST (h1 == (__fp16)1.0);
+ TEST (h1 == f1);
+ TEST (f1 == h1);
+
+ TEST (h1 != hm2);
+ TESTNOT (h1 != h1);
+ TESTNOT (h1 != (__fp16)1.0);
+ TESTNOT (h1 != f1);
+ TESTNOT (f1 != h1);
+
+ CHECK2 ((h1 ? hm2 : h42), -2.0);
+ CHECK2 ((h0 ? hm2 : h42), 42.0);
+
+ CHECK (h0 = h42, 42.0);
+ CHECK (h0, 42.0);
+ CHECK (h0 = (__fp16)-2.0, -2.0);
+ CHECK (h0, -2.0);
+ CHECK (h0 = f0, 0.0);
+ CHECK (h0, 0.0);
+
+ CHECK (h0 += h1, 1.0);
+ CHECK (h0, 1.0);
+ CHECK (h0 += (__fp16)1.0, 2.0);
+ CHECK (h0, 2.0);
+ CHECK (h0 += fm2, 0.0);
+ CHECK (h0, 0.0);
+
+ CHECK (h0 -= h1, -1.0);
+ CHECK (h0, -1.0);
+ CHECK (h0 -= (__fp16)1.0, -2.0);
+ CHECK (h0, -2.0);
+ CHECK (h0 -= fm2, 0.0);
+ CHECK (h0, 0.0);
+
+ h0 = hm2;
+ CHECK (h0 *= hm2, 4.0);
+ CHECK (h0, 4.0);
+ CHECK (h0 *= (__fp16)-2.0, -8.0);
+ CHECK (h0, -8.0);
+ CHECK (h0 *= fm2, 16.0);
+ CHECK (h0, 16.0);
+
+ CHECK (h0 /= hm2, -8.0);
+ CHECK (h0, -8.0);
+ CHECK (h0 /= (__fp16)-2.0, 4.0);
+ CHECK (h0, 4.0);
+ CHECK (h0 /= fm2, -2.0);
+ CHECK (h0, -2.0);
+
+ CHECK ((h0, h1), 1.0);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/asm-subreg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/asm-subreg-1.c
new file mode 100644
index 000000000..d3a14b24c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/asm-subreg-1.c
@@ -0,0 +1,15 @@
+/* PR middle-end/20491 */
+
+/* { dg-do compile } */
+/* { dg-skip-if "" { hppa*64*-*-* || sparc-*-vxworks* } "*" "" } */
+
+/* Combine used to introduce invalid subregs for the asm input, and
+ we'd crash later on, when removing all subregs. */
+
+volatile unsigned short _const_32 [4] = {1,2,3,4};
+void
+evas_common_convert_yuv_420p_601_rgba()
+{
+ __asm__ __volatile__ ("" : : "X" (*_const_32));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/badshift.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/badshift.c
new file mode 100644
index 000000000..39d123b13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/badshift.c
@@ -0,0 +1,29 @@
+/* PR rtl-optimization/20532 */
+
+/* { dg-do run } */
+/* { dg-options "" } */
+/* { dg-options "-march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+/* We used to optimize the DImode shift-by-32 to zero because in combine
+ we turned:
+
+ (v << 31) + (v << 31)
+
+ into:
+
+ (v * (((HOST_WIDE_INT)1 << 31) + ((HOST_WIDE_INT)1 << 31)))
+
+ With a 32-bit HOST_WIDE_INT, the coefficient overflowed to zero. */
+
+unsigned long long int badshift(unsigned long long int v)
+{
+ return v << 31 << 1;
+}
+
+extern void abort ();
+
+int main() {
+ if (badshift (1) == 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c
new file mode 100644
index 000000000..c138b9234
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c
@@ -0,0 +1,438 @@
+/* Copyright (C) 2003, 2005 Free Software Foundation.
+
+ Verify that the `const' function attribute is applied to various
+ builtins and that these functions are optimized away by the
+ compiler under the appropriate circumstances.
+
+ Written by Kaveh Ghazi, 2003-08-04. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+/* These are helper macros to test combinations of functions. We test
+ foo() != foo() with the same arguments, and expect the compiler to
+ optimize away these tests of const functions. */
+
+/* Just test the __builtin_ functions. */
+#define BUILTIN_TEST1(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+void test_builtin_##FN(TYPE x) \
+{ if (__builtin_##FN(x) != __builtin_##FN(x)) link_failure_builtin_##FN(); }
+
+/* Just test the __builtin_ functions. */
+#define BUILTIN_TEST2(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+void test_builtin_##FN(TYPE x, TYPE y) \
+{ if (__builtin_##FN(x,y) != __builtin_##FN(x,y)) link_failure_builtin_##FN(); }
+
+/* Also test the regular (non-__builtin_) function. */
+#define TEST1(FN, TYPE, RTYPE) \
+BUILTIN_TEST1(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern RTYPE FN(TYPE); \
+void test_##FN(TYPE x) { if (FN(x) != FN(x)) link_failure_##FN(); }
+
+/* Test the __builtin_ functions taking void arguments (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST0(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(void) \
+{ if (__builtin_##FN() != __builtin_##FN()) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(void) \
+{ if (__builtin_##FN##f() != __builtin_##FN##f()) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(void) \
+{ if (__builtin_##FN##l() != __builtin_##FN##l()) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one FP argument (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST1(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d) \
+{ if (__builtin_##FN(d) != __builtin_##FN(d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f) \
+{ if (__builtin_##FN##f(f) != __builtin_##FN##f(f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld) \
+{ if (__builtin_##FN##l(ld) != __builtin_##FN##l(ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one argument of supplied type
+ (with the "f" and "l" variants). */
+#define BUILTIN_FPTEST1ARG(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(TYPE x) \
+{ if (__builtin_##FN(x) != __builtin_##FN(x)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(TYPE x) \
+{ if (__builtin_##FN##f(x) != __builtin_##FN##f(x)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(TYPE x) \
+{ if (__builtin_##FN##l(x) != __builtin_##FN##l(x)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two FP arguments (with the "f"
+ and "l" variants). */
+#define BUILTIN_FPTEST2(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d1, double d2) \
+{ if (__builtin_##FN(d1,d2) != __builtin_##FN(d1,d2)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f1, float f2) \
+{ if (__builtin_##FN##f(f1,f2) != __builtin_##FN##f(f1,f2)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld1, long double ld2) \
+{ if (__builtin_##FN##l(ld1,ld2) != __builtin_##FN##l(ld1,ld2)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two arguments, the first one
+ is of a supplied type and the second one one is of FP type (with
+ the "f" and "l" variants). */
+#define BUILTIN_FPTEST2ARG1(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(TYPE x, double d) \
+{ if (__builtin_##FN(x,d) != __builtin_##FN(x,d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(TYPE x, float f) \
+{ if (__builtin_##FN##f(x,f) != __builtin_##FN##f(x,f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(TYPE x, long double ld) \
+{ if (__builtin_##FN##l(x,ld) != __builtin_##FN##l(x,ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two arguments, the first one
+ is of FP type and the second one one is of a supplied type (with
+ the "f" and "l" variants). */
+#define BUILTIN_FPTEST2ARG2(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d, TYPE x) \
+{ if (__builtin_##FN(d,x) != __builtin_##FN(d,x)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f, TYPE x) \
+{ if (__builtin_##FN##f(f,x) != __builtin_##FN##f(f,x)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld, TYPE x) \
+{ if (__builtin_##FN##l(ld,x) != __builtin_##FN##l(ld,x)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking three FP arguments (with the
+ "f" and "l" variants). */
+#define BUILTIN_FPTEST3(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(double d1, double d2, double d3) \
+{ if (__builtin_##FN(d1,d2,d3) != __builtin_##FN(d1,d2,d3)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(float f1, float f2, float f3) \
+{ if (__builtin_##FN##f(f1,f2,f3) != __builtin_##FN##f(f1,f2,f3)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(long double ld1, long double ld2, long double ld3) \
+{ if (__builtin_##FN##l(ld1,ld2,ld3) != __builtin_##FN##l(ld1,ld2,ld3)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking one complex argument (with the
+ "f" and "l" variants). */
+#define BUILTIN_CPTEST1(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(_Complex double d) \
+{ if (__builtin_##FN(d) != __builtin_##FN(d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(_Complex float f) \
+{ if (__builtin_##FN##f(f) != __builtin_##FN##f(f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(_Complex long double ld) \
+{ if (__builtin_##FN##l(ld) != __builtin_##FN##l(ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two complex arguments (with
+ the "f" and "l" variants). */
+#define BUILTIN_CPTEST2(FN) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(_Complex double d1, _Complex double d2) \
+{ if (__builtin_##FN(d1,d2) != __builtin_##FN(d1,d2)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(_Complex float f1, _Complex float f2) \
+{ if (__builtin_##FN##f(f1,f2) != __builtin_##FN##f(f1,f2)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(_Complex long double ld1, _Complex long double ld2) \
+{ if (__builtin_##FN##l(ld1,ld2) != __builtin_##FN##l(ld1,ld2)) link_failure_builtin_##FN##l(); }
+
+/* These macros additionally test the non-__builtin_ functions. */
+
+/* Test the functions taking one FP argument (with the "f" and "l"
+ variants) and returning that type. */
+#define FPTEST1(FN) \
+BUILTIN_FPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(double); \
+extern float FN##f(float); \
+extern long double FN##l(long double); \
+void test_##FN(double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking one FP argument (with the "f" and "l"
+ variants) and returning TYPE. */
+#define FPTEST1T(FN, TYPE) \
+BUILTIN_FPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern TYPE FN(double); \
+extern TYPE FN##f(float); \
+extern TYPE FN##l(long double); \
+void test_##FN(double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two FP arguments (with the "f" and "l"
+ variants). */
+#define FPTEST2(FN) \
+BUILTIN_FPTEST2(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(double, double); \
+extern float FN##f(float, float); \
+extern long double FN##l(long double, long double); \
+void test_##FN(double d1, double d2) \
+{ if (FN(d1,d2) != FN(d1,d2)) link_failure_##FN(); } \
+void test_##FN##f(float f1, float f2) \
+{ if (FN##f(f1,f2) != FN##f(f1,f2)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld1, long double ld2) \
+{ if (FN##l(ld1,ld2) != FN##l(ld1,ld2)) link_failure_##FN##l(); }
+
+/* Test the functions taking two arguments, the first one is of a
+ supplied type and the second one one is of FP type (with the "f"
+ and "l" variants). */
+#define FPTEST2ARG1(FN, TYPE) \
+BUILTIN_FPTEST2ARG1(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(TYPE, double); \
+extern float FN##f(TYPE, float); \
+extern long double FN##l(TYPE, long double); \
+void test_##FN(TYPE x, double d) \
+{ if (FN(x,d) != FN(x,d)) link_failure_##FN(); } \
+void test_##FN##f(TYPE x, float f) \
+{ if (FN##f(x,f) != FN##f(x,f)) link_failure_##FN##f(); } \
+void test_##FN##l(TYPE x, long double ld) \
+{ if (FN##l(x,ld) != FN##l(x,ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two arguments, the first one is of FP
+ type and the second one one is of a supplied type (with the "f" and
+ "l" variants). */
+#define FPTEST2ARG2(FN, TYPE) \
+BUILTIN_FPTEST2ARG2(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(double, TYPE); \
+extern float FN##f(float, TYPE); \
+extern long double FN##l(long double, TYPE); \
+void test_##FN(double d, TYPE x) \
+{ if (FN(d,x) != FN(d,x)) link_failure_##FN(); } \
+void test_##FN##f(float f, TYPE x) \
+{ if (FN##f(f,x) != FN##f(f,x)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld, TYPE x) \
+{ if (FN##l(ld,x) != FN##l(ld,x)) link_failure_##FN##l(); }
+
+/* Test the functions taking three FP arguments (with the "f" and "l"
+ variants). */
+#define FPTEST3(FN) \
+BUILTIN_FPTEST3(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(double, double, double); \
+extern float FN##f(float, float, float); \
+extern long double FN##l(long double, long double, long double); \
+void test_##FN(double d1, double d2, double d3) \
+{ if (FN(d1,d2,d3) != FN(d1,d2,d3)) link_failure_##FN(); } \
+void test_##FN##f(float f1, float f2, float f3) \
+{ if (FN##f(f1,f2,f3) != FN##f(f1,f2,f3)) link_failure_##FN##f(); } \
+void test_##FN##l(long double ld1, long double ld2, long double ld3) \
+{ if (FN##l(ld1,ld2,ld3) != FN##l(ld1,ld2,ld3)) link_failure_##FN##l(); }
+
+/* Test the functions taking one complex argument (with the "f" and
+ "l" variants) and returning that type. */
+#define CPTEST1(FN) \
+BUILTIN_CPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern _Complex double FN(_Complex double); \
+extern _Complex float FN##f(_Complex float); \
+extern _Complex long double FN##l(_Complex long double); \
+void test_##FN(_Complex double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking one complex argument (with the "f" and
+ "l" variants) and returning the real type. */
+#define CPTEST1R(FN) \
+BUILTIN_CPTEST1(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern double FN(_Complex double); \
+extern float FN##f(_Complex float); \
+extern long double FN##l(_Complex long double); \
+void test_##FN(_Complex double d) \
+{ if (FN(d) != FN(d)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f) \
+{ if (FN##f(f) != FN##f(f)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld) \
+{ if (FN##l(ld) != FN##l(ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two complex arguments (with the "f" and
+ "l" variants). */
+#define CPTEST2(FN) \
+BUILTIN_CPTEST2(FN) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+extern _Complex double FN(_Complex double, _Complex double); \
+extern _Complex float FN##f(_Complex float, _Complex float); \
+extern _Complex long double FN##l(_Complex long double, _Complex long double); \
+void test_##FN(_Complex double d1, _Complex double d2) \
+{ if (FN(d1,d2) != FN(d1,d2)) link_failure_##FN(); } \
+void test_##FN##f(_Complex float f1, _Complex float f2) \
+{ if (FN##f(f1,f2) != FN##f(f1,f2)) link_failure_##FN##f(); } \
+void test_##FN##l(_Complex long double ld1, _Complex long double ld2) \
+{ if (FN##l(ld1,ld2) != FN##l(ld1,ld2)) link_failure_##FN##l(); }
+
+
+/* Test the math builtins. */
+FPTEST1 (acos)
+FPTEST1 (acosh)
+FPTEST1 (asin)
+FPTEST1 (asinh)
+FPTEST1 (atan)
+FPTEST2 (atan2)
+FPTEST1 (atanh)
+FPTEST1 (cbrt)
+FPTEST1 (ceil)
+FPTEST2 (copysign)
+FPTEST1 (cos)
+FPTEST1 (cosh)
+FPTEST2 (drem)
+FPTEST1 (erf)
+FPTEST1 (erfc)
+FPTEST1 (exp)
+FPTEST1 (exp10)
+FPTEST1 (exp2)
+FPTEST1 (expm1)
+FPTEST1 (fabs)
+FPTEST2 (fdim)
+FPTEST1 (floor)
+FPTEST3 (fma)
+FPTEST2 (fmax)
+FPTEST2 (fmin)
+FPTEST2 (fmod)
+BUILTIN_FPTEST0 (huge_val)
+FPTEST2 (hypot)
+FPTEST1T (ilogb, int)
+BUILTIN_FPTEST0 (inf) /* { dg-warning "does not support infinity" "INF unsupported" { target vax-*-* pdp11-*-* spu-*-* } } */
+FPTEST1 (j0)
+FPTEST1 (j1)
+FPTEST2ARG1 (jn, int)
+FPTEST2ARG2 (ldexp, int)
+BUILTIN_FPTEST1 (llceil)
+BUILTIN_FPTEST1 (llfloor)
+FPTEST1T (llrint, long long)
+FPTEST1T (llround, long long)
+FPTEST1 (log)
+FPTEST1 (log10)
+FPTEST1 (log1p)
+FPTEST1 (log2)
+FPTEST1 (logb)
+BUILTIN_FPTEST1 (lceil)
+BUILTIN_FPTEST1 (lfloor)
+FPTEST1T (lrint, long)
+FPTEST1T (lround, long)
+BUILTIN_FPTEST1ARG (nan, char *)
+BUILTIN_FPTEST1ARG (nans, char *)
+FPTEST1 (nearbyint)
+FPTEST2 (nextafter)
+FPTEST2ARG2 (nexttoward, long double)
+FPTEST2 (pow)
+FPTEST1 (pow10)
+FPTEST2 (remainder)
+FPTEST1 (rint)
+FPTEST1 (round)
+FPTEST2 (scalb)
+FPTEST2ARG2 (scalbn, int)
+FPTEST2ARG2 (scalbln, long int)
+FPTEST1 (significand)
+FPTEST1 (sin)
+FPTEST1 (sinh)
+FPTEST1 (sqrt)
+FPTEST1 (tan)
+FPTEST1 (tanh)
+FPTEST1 (tgamma)
+FPTEST1 (trunc)
+FPTEST1 (y0)
+FPTEST1 (y1)
+FPTEST2ARG1 (yn, int)
+
+/* Test the complex math builtins. */
+/*CPTEST1 (cabs) See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00040.html */
+CPTEST1 (cacos)
+CPTEST1 (cacosh)
+CPTEST1R (carg)
+CPTEST1 (casin)
+CPTEST1 (casinh)
+CPTEST1 (catan)
+CPTEST1 (catanh)
+CPTEST1 (ccos)
+CPTEST1 (ccosh)
+CPTEST1 (cexp)
+CPTEST1R (cimag)
+CPTEST1 (clog)
+CPTEST1 (conj)
+CPTEST2 (cpow)
+CPTEST1 (cproj)
+CPTEST1R (creal)
+CPTEST1 (csin)
+CPTEST1 (csinh)
+CPTEST1 (csqrt)
+CPTEST1 (ctan)
+CPTEST1 (ctanh)
+
+typedef __INTMAX_TYPE__ intmax_t;
+
+/* Various other const builtins. */
+TEST1 (abs, int, int)
+BUILTIN_TEST1 (clz, int)
+BUILTIN_TEST1 (clzl, long)
+BUILTIN_TEST1 (clzll, long long)
+BUILTIN_TEST1 (ctz, int)
+BUILTIN_TEST1 (ctzl, long)
+BUILTIN_TEST1 (ctzll, long long)
+BUILTIN_TEST1 (clrsb, int)
+BUILTIN_TEST1 (clrsbl, long)
+BUILTIN_TEST1 (clrsbll, long long)
+TEST1 (ffs, int, int)
+TEST1 (ffsl, long, int)
+TEST1 (ffsll, long long, int)
+TEST1 (imaxabs, intmax_t, intmax_t)
+TEST1 (labs, long, long)
+TEST1 (llabs, long long, long long)
+BUILTIN_TEST1 (parity, int)
+BUILTIN_TEST1 (parityl, long)
+BUILTIN_TEST1 (parityll, long long)
+BUILTIN_TEST1 (popcount, int)
+BUILTIN_TEST1 (popcountl, long)
+BUILTIN_TEST1 (popcountll, long long)
+
+int main(void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-complex-1.c
new file mode 100644
index 000000000..0d26c9cc7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-complex-1.c
@@ -0,0 +1,124 @@
+/* Test __builtin_complex semantics. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+/* { dg-add-options ieee } */
+
+extern void exit (int);
+extern void abort (void);
+
+#define COMPARE_BODY(A, B, TYPE, COPYSIGN) \
+ do { \
+ TYPE s1 = COPYSIGN ((TYPE) 1.0, A); \
+ TYPE s2 = COPYSIGN ((TYPE) 1.0, B); \
+ if (s1 != s2) \
+ abort (); \
+ if ((__builtin_isnan (A) != 0) != (__builtin_isnan (B) != 0)) \
+ abort (); \
+ if ((A != B) != (__builtin_isnan (A) != 0)) \
+ abort (); \
+ } while (0)
+
+#ifndef __SPU__
+void
+comparef (float a, float b)
+{
+ COMPARE_BODY (a, b, float, __builtin_copysignf);
+}
+#endif
+
+void
+compare (double a, double b)
+{
+ COMPARE_BODY (a, b, double, __builtin_copysign);
+}
+
+void
+comparel (long double a, long double b)
+{
+ COMPARE_BODY (a, b, long double, __builtin_copysignl);
+}
+
+#ifndef __SPU__
+void
+comparecf (_Complex float a, float r, float i)
+{
+ comparef (__real__ a, r);
+ comparef (__imag__ a, i);
+}
+#endif
+
+void
+comparec (_Complex double a, double r, double i)
+{
+ compare (__real__ a, r);
+ compare (__imag__ a, i);
+}
+
+void
+comparecl (_Complex long double a, long double r, long double i)
+{
+ comparel (__real__ a, r);
+ comparel (__imag__ a, i);
+}
+
+#define VERIFY(A, B, TYPE, COMPARE) \
+ do { \
+ TYPE a = A; \
+ TYPE b = B; \
+ _Complex TYPE cr = __builtin_complex (a, b); \
+ static _Complex TYPE cs = __builtin_complex (A, B); \
+ COMPARE (cr, A, B); \
+ COMPARE (cs, A, B); \
+ } while (0)
+
+#define ALL_CHECKS(PZ, NZ, NAN, INF, TYPE, COMPARE) \
+ do { \
+ VERIFY (PZ, PZ, TYPE, COMPARE); \
+ VERIFY (PZ, NZ, TYPE, COMPARE); \
+ VERIFY (PZ, NAN, TYPE, COMPARE); \
+ VERIFY (PZ, INF, TYPE, COMPARE); \
+ VERIFY (NZ, PZ, TYPE, COMPARE); \
+ VERIFY (NZ, NZ, TYPE, COMPARE); \
+ VERIFY (NZ, NAN, TYPE, COMPARE); \
+ VERIFY (NZ, INF, TYPE, COMPARE); \
+ VERIFY (NAN, PZ, TYPE, COMPARE); \
+ VERIFY (NAN, NZ, TYPE, COMPARE); \
+ VERIFY (NAN, NAN, TYPE, COMPARE); \
+ VERIFY (NAN, INF, TYPE, COMPARE); \
+ VERIFY (INF, PZ, TYPE, COMPARE); \
+ VERIFY (INF, NZ, TYPE, COMPARE); \
+ VERIFY (INF, NAN, TYPE, COMPARE); \
+ VERIFY (INF, INF, TYPE, COMPARE); \
+ } while (0)
+
+void
+check_float (void)
+{
+#ifndef __SPU__
+ ALL_CHECKS (0.0f, -0.0f, __builtin_nanf(""), __builtin_inff(),
+ float, comparecf);
+#endif
+}
+
+void
+check_double (void)
+{
+ ALL_CHECKS (0.0, -0.0, __builtin_nan(""), __builtin_inf(),
+ double, comparec);
+}
+
+void
+check_long_double (void)
+{
+ ALL_CHECKS (0.0l, -0.0l, __builtin_nanl(""), __builtin_infl(),
+ long double, comparecl);
+}
+
+int
+main (void)
+{
+ check_float ();
+ check_double ();
+ check_long_double ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c
new file mode 100644
index 000000000..f13d29e67
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-1.c
@@ -0,0 +1,149 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in math function conversion to smaller FP types
+ is correctly performed by the compiler.
+
+ Written by Kaveh Ghazi, 2004-03-17. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-add-options c99_runtime } */
+
+#include "../builtins-config.h"
+
+/* This check is necessary when converting to a C99 function. */
+#ifdef HAVE_C99_RUNTIME
+#define C99CODE(CODE) (CODE)
+#define MAYBEC99(CODE, C99) (CODE)
+#else
+#define C99CODE(CODE) 0
+#define MAYBEC99(CODE, C99) (!(C99) && (CODE))
+#endif
+
+void test(double d1, float f1, long double ld1)
+{
+ /* Test converting math builtins to narrower FP types based on a
+ narrowing cast on the outside of the call. MATHFN is the
+ function to test, and C99 is 0/1 depending on whether the
+ `double' version of MATHFN is a C99 function. The optimization
+ is only performed if the replacement function is actually
+ narrower in width, so check that first. */
+#define OUTER_CAST1(MATHFN, C99) \
+ extern void link_failure_outer_##MATHFN##l_##MATHFN##_1(void); \
+ extern void link_failure_outer_##MATHFN##l_##MATHFN##_2(void); \
+ extern void link_failure_outer_##MATHFN##l_##MATHFN##f_1(void); \
+ extern void link_failure_outer_##MATHFN##l_##MATHFN##f_2(void); \
+ extern void link_failure_outer_##MATHFN##_##MATHFN##f_1(void); \
+ extern void link_failure_outer_##MATHFN##_##MATHFN##f_2(void); \
+ if (sizeof (long double) > sizeof (double) \
+ && MAYBEC99 ((double) __builtin_##MATHFN##l((double)ld1) != __builtin_##MATHFN(ld1), C99)) \
+ link_failure_outer_##MATHFN##l_##MATHFN##_1(); \
+ if (sizeof (long double) > sizeof (double) \
+ && MAYBEC99 ((double) __builtin_##MATHFN##l(d1) != __builtin_##MATHFN(d1), C99)) \
+ link_failure_outer_##MATHFN##l_##MATHFN##_1(); \
+ if (sizeof (long double) > sizeof (double) \
+ && MAYBEC99 ((double) __builtin_##MATHFN##l(f1) != __builtin_##MATHFN(f1), C99)) \
+ link_failure_outer_##MATHFN##l_##MATHFN##_2(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN##l((float) ld1) != __builtin_##MATHFN##f(ld1))) \
+ link_failure_outer_##MATHFN##l_##MATHFN##f_1(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN##l((float) d1) != __builtin_##MATHFN##f(d1))) \
+ link_failure_outer_##MATHFN##l_##MATHFN##f_1(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN##l(f1) != __builtin_##MATHFN##f(f1))) \
+ link_failure_outer_##MATHFN##l_##MATHFN##f_2(); \
+ if (sizeof (double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN((float) ld1) != __builtin_##MATHFN##f(ld1))) \
+ link_failure_outer_##MATHFN##_##MATHFN##f_1(); \
+ if (sizeof (double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN((float) d1) != __builtin_##MATHFN##f(d1))) \
+ link_failure_outer_##MATHFN##_##MATHFN##f_1(); \
+ if (sizeof (double) > sizeof (float) \
+ && C99CODE ((float) __builtin_##MATHFN(f1) != __builtin_##MATHFN##f(f1))) \
+ link_failure_outer_##MATHFN##_##MATHFN##f_2()
+
+ /* Test converting math builtins to narrower FP types based on if
+ the argument is a narrower type (perhaps implicitly) cast to a
+ wider one. */
+#define INNER_CAST1(MATHFN, C99) \
+ extern void link_failure_inner_##MATHFN##l_##MATHFN(void); \
+ extern void link_failure_inner_##MATHFN##l_##MATHFN##f(void); \
+ extern void link_failure_inner_##MATHFN##_##MATHFN##f(void); \
+ if (sizeof (long double) > sizeof (double) \
+ && MAYBEC99 (__builtin_##MATHFN##l(d1) != (long double) __builtin_##MATHFN(d1), C99)) \
+ link_failure_inner_##MATHFN##l_##MATHFN(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE (__builtin_##MATHFN##l(f1) != (long double) __builtin_##MATHFN##f(f1))) \
+ link_failure_inner_##MATHFN##l_##MATHFN##f(); \
+ if (sizeof (long double) > sizeof (float) \
+ && C99CODE (__builtin_##MATHFN##l((double)f1) != (long double) __builtin_##MATHFN##f(f1))) \
+ link_failure_inner_##MATHFN##l_##MATHFN##f(); \
+ if (sizeof (double) > sizeof (float) \
+ && C99CODE (__builtin_##MATHFN(f1) != (double) __builtin_##MATHFN##f(f1))) \
+ link_failure_inner_##MATHFN##_##MATHFN##f()
+
+
+#ifdef __OPTIMIZE__
+ OUTER_CAST1 (acos, /*C99=*/ 0);
+ OUTER_CAST1 (acosh, /*C99=*/ 1);
+ OUTER_CAST1 (asin, /*C99=*/ 1);
+ OUTER_CAST1 (asinh, /*C99=*/ 1);
+ OUTER_CAST1 (atan, /*C99=*/ 0);
+ OUTER_CAST1 (atanh, /*C99=*/ 1);
+ OUTER_CAST1 (cbrt, /*C99=*/ 1);
+ OUTER_CAST1 (cos, /*C99=*/ 0);
+ OUTER_CAST1 (cosh, /*C99=*/ 0);
+ OUTER_CAST1 (erf, /*C99=*/ 1);
+ OUTER_CAST1 (erfc, /*C99=*/ 1);
+ OUTER_CAST1 (exp, /*C99=*/ 0);
+ OUTER_CAST1 (exp2, /*C99=*/ 1);
+ OUTER_CAST1 (expm1, /*C99=*/ 1);
+ OUTER_CAST1 (fabs, /*C99=*/ 0);
+ OUTER_CAST1 (log, /*C99=*/ 0);
+ OUTER_CAST1 (log10, /*C99=*/ 0);
+ OUTER_CAST1 (log1p, /*C99=*/ 1);
+ OUTER_CAST1 (log2, /*C99=*/ 1);
+ OUTER_CAST1 (logb, /*C99=*/ 1);
+ OUTER_CAST1 (sin, /*C99=*/ 0);
+ OUTER_CAST1 (sinh, /*C99=*/ 0);
+ OUTER_CAST1 (sqrt, /*C99=*/ 0);
+ OUTER_CAST1 (tan, /*C99=*/ 0);
+ OUTER_CAST1 (tanh, /*C99=*/ 0);
+ OUTER_CAST1 (tgamma, /*C99=*/ 1);
+
+ INNER_CAST1 (ceil, /*C99=*/ 0);
+ OUTER_CAST1 (ceil, /*C99=*/ 0);
+ INNER_CAST1 (floor, /*C99=*/ 0);
+ OUTER_CAST1 (floor, /*C99=*/ 0);
+ INNER_CAST1 (lceil, /*C99=*/ 1);
+ OUTER_CAST1 (lceil, /*C99=*/ 1);
+ INNER_CAST1 (lfloor, /*C99=*/ 1);
+ OUTER_CAST1 (lfloor, /*C99=*/ 1);
+ INNER_CAST1 (lrint, /*C99=*/ 1);
+ OUTER_CAST1 (lrint, /*C99=*/ 1);
+ INNER_CAST1 (lround, /*C99=*/ 1);
+ OUTER_CAST1 (lround, /*C99=*/ 1);
+ INNER_CAST1 (llceil, /*C99=*/ 1);
+ OUTER_CAST1 (llceil, /*C99=*/ 1);
+ INNER_CAST1 (llfloor, /*C99=*/ 1);
+ OUTER_CAST1 (llfloor, /*C99=*/ 1);
+ INNER_CAST1 (llrint, /*C99=*/ 1);
+ OUTER_CAST1 (llrint, /*C99=*/ 1);
+ INNER_CAST1 (llround, /*C99=*/ 1);
+ OUTER_CAST1 (llround, /*C99=*/ 1);
+ INNER_CAST1 (nearbyint, /*C99=*/ 1);
+ OUTER_CAST1 (nearbyint, /*C99=*/ 1);
+ INNER_CAST1 (rint, /*C99=*/ 1);
+ OUTER_CAST1 (rint, /*C99=*/ 1);
+ INNER_CAST1 (round, /*C99=*/ 1);
+ OUTER_CAST1 (round, /*C99=*/ 1);
+ INNER_CAST1 (trunc, /*C99=*/ 1);
+ OUTER_CAST1 (trunc, /*C99=*/ 1);
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c
new file mode 100644
index 000000000..167ecddcb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-2.c
@@ -0,0 +1,78 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in math function conversion into integer rounding
+ functions is correctly performed by the compiler.
+
+ Written by Kaveh ghazi, 2004-04-26. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-add-options c99_runtime } */
+
+#include "../builtins-config.h"
+
+/* Macro to do all FP type combinations. The second half tests
+ narrowing the FP type. */
+#define TEST_FP2FIXED(FN1, FN2) \
+ extern void link_error_##FN1##_##FN2(void); \
+ extern void link_error_##FN1##f_##FN2##f(void); \
+ extern void link_error_##FN1##l_##FN2##l(void); \
+ extern void link_error_##FN1##_l##FN2(void); \
+ extern void link_error_##FN1##f_l##FN2##f(void); \
+ extern void link_error_##FN1##l_l##FN2##l(void); \
+ if ((long)__builtin_##FN1(d) != __builtin_##FN2(d)) \
+ link_error_##FN1##_##FN2(); \
+ if ((long)__builtin_##FN1##f(f) != __builtin_##FN2##f(f)) \
+ link_error_##FN1##f_##FN2##f(); \
+ if ((long)__builtin_##FN1##l(ld) != __builtin_##FN2##l(ld)) \
+ link_error_##FN1##l_##FN2##l(); \
+ if ((long long)__builtin_##FN1(d) != __builtin_l##FN2(d)) \
+ link_error_##FN1##_l##FN2(); \
+ if ((long long)__builtin_##FN1##f(f) != __builtin_l##FN2##f(f)) \
+ link_error_##FN1##f_l##FN2##f(); \
+ if ((long long)__builtin_##FN1##l(ld) != __builtin_l##FN2##l(ld)) \
+ link_error_##FN1##l_l##FN2##l(); \
+ extern void link_error_##FN1##_##FN2##f(void); \
+ extern void link_error_##FN1##l_##FN2(void); \
+ extern void link_error_##FN1##l_##FN2##f(void); \
+ extern void link_error_##FN1##_l##FN2##f(void); \
+ extern void link_error_##FN1##l_l##FN2(void); \
+ extern void link_error_##FN1##l_l##FN2##f(void); \
+ if (sizeof(double) > sizeof(float) \
+ && (long)__builtin_##FN1(f) != __builtin_##FN2##f(f)) \
+ link_error_##FN1##_##FN2##f(); \
+ if (sizeof(long double) > sizeof(double) \
+ && (long)__builtin_##FN1##l(d) != __builtin_##FN2(d)) \
+ link_error_##FN1##l_##FN2(); \
+ if (sizeof(long double) > sizeof(float) \
+ && (long)__builtin_##FN1##l(f) != __builtin_##FN2##f(f)) \
+ link_error_##FN1##l_##FN2##f(); \
+ if (sizeof(double) > sizeof(float) \
+ && (long long)__builtin_##FN1(f) != __builtin_l##FN2##f(f)) \
+ link_error_##FN1##_l##FN2##f(); \
+ if (sizeof(long double) > sizeof(double) \
+ && (long long)__builtin_##FN1##l(d) != __builtin_l##FN2(d)) \
+ link_error_##FN1##l_l##FN2(); \
+ if (sizeof(long double) > sizeof(float) \
+ && (long long)__builtin_##FN1##l(f) != __builtin_l##FN2##f(f)) \
+ link_error_##FN1##l_l##FN2##f()
+
+void __attribute__ ((__noinline__)) foo (double d, float f, long double ld)
+{
+#ifdef __OPTIMIZE__
+# ifdef HAVE_C99_RUNTIME
+ /* The resulting transformation functions are all C99. */
+ TEST_FP2FIXED (ceil, lceil);
+ TEST_FP2FIXED (floor, lfloor);
+ TEST_FP2FIXED (round, lround);
+ TEST_FP2FIXED (nearbyint, lrint);
+ TEST_FP2FIXED (rint, lrint);
+# endif
+#endif
+}
+
+int main()
+{
+ foo (1.0, 2.0, 3.0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c
new file mode 100644
index 000000000..2034b4190
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-3.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that builtin math functions (with fixed point return types)
+ are converted to smaller FP types correctly by the compiler.
+
+ Written by Kaveh Ghazi, 2004-05-01. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-add-options c99_runtime } */
+
+#include "../builtins-config.h"
+
+#define PROTOTYPE1_RET(FN, RET) \
+ extern RET FN(double); \
+ extern RET FN##f(float); \
+ extern RET FN##l(long double);
+
+/* Test converting math builtins to narrower FP types based on if the
+ argument is a narrower type (perhaps implicitly) cast to a wider
+ one. */
+#define INNER_CAST1(MATHFN, RET) \
+ PROTOTYPE1_RET (MATHFN, RET); \
+ extern void link_failure_inner_##MATHFN##l_##MATHFN(void); \
+ extern void link_failure_inner_##MATHFN##l_##MATHFN##f(void); \
+ extern void link_failure_inner_##MATHFN##_##MATHFN##f(void); \
+ if (sizeof (long double) > sizeof (double) \
+ && MATHFN##l(d1) != MATHFN(d1)) \
+ link_failure_inner_##MATHFN##l_##MATHFN(); \
+ if (sizeof (long double) > sizeof (float) \
+ && MATHFN##l(f1) != MATHFN##f(f1)) \
+ link_failure_inner_##MATHFN##l_##MATHFN##f(); \
+ if (sizeof (long double) > sizeof (float) \
+ && MATHFN##l((double)f1) != MATHFN##f(f1)) \
+ link_failure_inner_##MATHFN##l_##MATHFN##f(); \
+ if (sizeof (double) > sizeof (float) \
+ && MATHFN(f1) != MATHFN##f(f1)) \
+ link_failure_inner_##MATHFN##_##MATHFN##f()
+
+void __attribute__ ((__noinline__)) test (double d1, float f1)
+{
+#ifdef __OPTIMIZE__
+#ifdef HAVE_C99_RUNTIME
+ /* We're converting to implicitly generated C99 functions. */
+ INNER_CAST1 (__builtin_lceil, long);
+ INNER_CAST1 (__builtin_llceil, long long);
+ INNER_CAST1 (__builtin_lfloor, long);
+ INNER_CAST1 (__builtin_llfloor, long long);
+ INNER_CAST1 (lround, long);
+ INNER_CAST1 (llround, long long);
+ INNER_CAST1 (lrint, long);
+ INNER_CAST1 (llrint, long long);
+#endif /* HAVE_C99_RUNTIME */
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ test (1, 2);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-4.c
new file mode 100644
index 000000000..3dc47ad1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-convert-4.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Verify that nearbyint isn't transformed into e.g. rint or lrint
+ when -ftrapping-math is set.
+
+ Written by Kaveh ghazi, 2007-03-04. */
+
+/* { dg-do compile } */
+/* { dg-options "-ftrapping-math -fdump-tree-original" } */
+/* { dg-add-options c99_runtime } */
+
+#include "../builtins-config.h"
+
+extern void bar (long);
+
+#define TESTIT(FUNC) do { \
+ bar (__builtin_##FUNC(d)); \
+ bar (__builtin_##FUNC##f(f)); \
+ bar (__builtin_##FUNC##l(ld)); \
+} while (0)
+
+void __attribute__ ((__noinline__)) foo (double d, float f, long double ld)
+{
+ TESTIT(nearbyint);
+}
+
+int main()
+{
+ foo (1.0, 2.0, 3.0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "nearbyint " 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "nearbyintf" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "nearbyintl" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c
new file mode 100644
index 000000000..53ae6046a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-cproj-1.c
@@ -0,0 +1,247 @@
+/* Copyright (C) 2010 Free Software Foundation.
+
+ Verify that folding of built-in cproj is correctly performed by the
+ compiler.
+
+ Origin: Kaveh R. Ghazi, April 9, 2010. */
+
+/* { dg-do link } */
+/* { dg-add-options ieee } */
+
+/* All references to link_error should go away at compile-time. The
+ argument is the __LINE__ number. It appears in the tree dump file
+ and aids in debugging should any of the tests fail. */
+extern void link_error(int);
+
+#define CPROJ(X) __builtin_cproj(X)
+#define CPROJF(X) __builtin_cprojf(X)
+#define CPROJL(X) __builtin_cprojl(X)
+#ifndef __SPU__
+#define INF __builtin_inff()
+#else
+#define INF __builtin_inf()
+#endif
+#define I 1i
+#define CPSGN(X,Y) __builtin_copysignf((X),(Y))
+#define CIMAG(X) __builtin_cimagf(X)
+#define CREAL(X) __builtin_crealf(X)
+
+/* Check that the signs of the real and/or imaginary parts of two
+ complex numbers match. */
+#define CKSGN(X,Y) (CKSGN_R(X,Y) || CKSGN_I(X,Y))
+#define CKSGN_R(X,Y) (CPSGN(1,CREAL(X)) != CPSGN(1,CREAL(Y)))
+#define CKSGN_I(X,Y) (CPSGN(1,CIMAG(X)) != CPSGN(1,CIMAG(Y)))
+
+/* Test that (cproj(X) == ZERO+Inf) and that the signs of the
+ imaginary parts match. ZERO is +/- 0i. */
+#ifndef __SPU__
+#define TEST_CST_INF(X,ZERO) do { \
+ if (CPROJF(X) != ZERO+INF || CKSGN_I(CPROJF(X),ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJ(X) != ZERO+INF || CKSGN_I(CPROJ(X),ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJL(X) != ZERO+INF || CKSGN_I(CPROJL(X),ZERO+INF)) \
+ link_error(__LINE__); \
+} while (0)
+#else
+#define TEST_CST_INF(X,ZERO) do { \
+ if (CPROJ(X) != ZERO+INF || CKSGN_I(CPROJ(X),ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJL(X) != ZERO+INF || CKSGN_I(CPROJL(X),ZERO+INF)) \
+ link_error(__LINE__); \
+} while (0)
+#endif
+
+/* Test that (cproj(X) == X) for all finite (X). */
+#define TEST_CST(X) do { \
+ if (CPROJF(X) != (X) || CKSGN(CPROJF(X),(X))) \
+ link_error(__LINE__); \
+} while (0)
+
+/* Test that cproj(X + I*INF) -> (ZERO + INF), where ZERO is +-0i.
+ NEG is either blank or a minus sign when ZERO is negative. */
+#ifndef __SPU__
+#define TEST_IMAG_INF(NEG,ZERO) do { \
+ if (CPROJF(f+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJF(f+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJ(d+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJ(d+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJL(ld+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJL(ld+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+} while (0)
+#else
+#define TEST_IMAG_INF(NEG,ZERO) do { \
+ if (CPROJ(d+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJ(d+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJL(ld+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJL(ld+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+} while (0)
+#endif
+
+/* Like TEST_IMAG_INF, but check that side effects are honored. */
+#ifndef __SPU__
+#define TEST_IMAG_INF_SIDE_EFFECT(NEG,ZERO) do { \
+ int side = 4; \
+ if (CPROJF(++side+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJF(++side+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJ(++side+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJ(++side+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJL(++side+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJL(++side+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+ if (side != 10) \
+ link_error(__LINE__); \
+} while (0)
+#else
+#define TEST_IMAG_INF_SIDE_EFFECT(NEG,ZERO) do { \
+ int side = 4; \
+ if (CPROJ(++side+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJ(++side+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+ if (CPROJL(++side+I*NEG INF) != ZERO+INF \
+ || CKSGN_I (CPROJL(++side+I*NEG INF), ZERO+INF)) \
+ link_error(__LINE__); \
+ if (side != 8) \
+ link_error(__LINE__); \
+} while (0)
+#endif
+
+/* Test that cproj(INF, POSITIVE) -> INF+0i. NEG is either blank or a
+ minus sign to test negative INF. */
+#ifndef __SPU__
+#define TEST_REAL_INF(NEG) do { \
+ __real cf = NEG INF; \
+ __imag cf = (x ? 4 : 5); \
+ if (CPROJF(cf) != INF \
+ || CKSGN_I (CPROJF(cf), INF)) \
+ link_error(__LINE__); \
+ __real cd = NEG INF; \
+ __imag cd = (x ? 4 : 5); \
+ if (CPROJ(cd) != INF \
+ || CKSGN_I (CPROJ(cd), INF)) \
+ link_error(__LINE__); \
+ __real cld = NEG INF; \
+ __imag cld = (x ? 4 : 5); \
+ if (CPROJL(cld) != INF \
+ || CKSGN_I (CPROJL(cld), INF)) \
+ link_error(__LINE__); \
+} while (0)
+#else
+#define TEST_REAL_INF(NEG) do { \
+ __real cd = NEG INF; \
+ __imag cd = (x ? 4 : 5); \
+ if (CPROJ(cd) != INF \
+ || CKSGN_I (CPROJ(cd), INF)) \
+ link_error(__LINE__); \
+ __real cld = NEG INF; \
+ __imag cld = (x ? 4 : 5); \
+ if (CPROJL(cld) != INF \
+ || CKSGN_I (CPROJL(cld), INF)) \
+ link_error(__LINE__); \
+} while (0)
+#endif
+
+/* Like TEST_REAL_INF, but check that side effects are honored. */
+#ifndef __SPU__
+#define TEST_REAL_INF_SIDE_EFFECT(NEG) do { \
+ int side = -9; \
+ __real cf = NEG INF; \
+ __imag cf = (x ? 4 : 5); \
+ if (CPROJF((++side,cf)) != INF \
+ || CKSGN_I (CPROJF((++side,cf)), INF)) \
+ link_error(__LINE__); \
+ __real cd = NEG INF; \
+ __imag cd = (x ? 4 : 5); \
+ if (CPROJ((++side,cd)) != INF \
+ || CKSGN_I (CPROJ((++side,cd)), INF)) \
+ link_error(__LINE__); \
+ __real cld = NEG INF; \
+ __imag cld = (x ? 4 : 5); \
+ if (CPROJL((++side,cld)) != INF \
+ || CKSGN_I (CPROJL((++side,cld)), INF)) \
+ link_error(__LINE__); \
+ if (side != -3) \
+ link_error(__LINE__); \
+} while (0)
+#else
+#define TEST_REAL_INF_SIDE_EFFECT(NEG) do { \
+ int side = -9; \
+ __real cd = NEG INF; \
+ __imag cd = (x ? 4 : 5); \
+ if (CPROJ((++side,cd)) != INF \
+ || CKSGN_I (CPROJ((++side,cd)), INF)) \
+ link_error(__LINE__); \
+ __real cld = NEG INF; \
+ __imag cld = (x ? 4 : 5); \
+ if (CPROJL((++side,cld)) != INF \
+ || CKSGN_I (CPROJL((++side,cld)), INF)) \
+ link_error(__LINE__); \
+ if (side != -5) \
+ link_error(__LINE__); \
+} while (0)
+#endif
+
+void foo (_Complex long double cld, _Complex double cd, _Complex float cf,
+ long double ld, double d, float f, int x)
+{
+ TEST_CST_INF (INF+0I, 0);
+ TEST_CST_INF (INF-0I, -0.FI);
+ TEST_CST_INF (INF+4I, 0);
+ TEST_CST_INF (INF-4I, -0.FI);
+ TEST_CST_INF (-INF+0I, 0);
+ TEST_CST_INF (-INF-0I, -0.FI);
+ TEST_CST_INF (-INF+4I, 0);
+ TEST_CST_INF (-INF-4I, -0.FI);
+
+ TEST_CST_INF (0+I*INF, 0);
+ TEST_CST_INF (0-I*INF, -0.FI);
+ TEST_CST_INF (23+I*INF, 0);
+ TEST_CST_INF (23-I*INF, -0.FI);
+ TEST_CST_INF (-0.F+I*INF, 0);
+ TEST_CST_INF (-0.F-I*INF, -0.FI);
+ TEST_CST_INF (-23+I*INF, 0);
+ TEST_CST_INF (-23-I*INF, -0.FI);
+
+ TEST_CST_INF (INF+I*INF, 0);
+ TEST_CST_INF (INF-I*INF, -0.FI);
+ TEST_CST_INF (-INF+I*INF, 0);
+ TEST_CST_INF (-INF-I*INF, -0.FI);
+
+ TEST_CST (0);
+ TEST_CST (-0.F);
+ TEST_CST (0-0.FI);
+ TEST_CST (-0.F-0.FI);
+
+ TEST_CST (22+3I);
+ TEST_CST (22-3I);
+ TEST_CST (-22+3I);
+ TEST_CST (-22-3I);
+
+ TEST_IMAG_INF (,0.FI);
+ TEST_IMAG_INF (-,-0.FI);
+
+#ifdef __OPTIMIZE__
+ TEST_REAL_INF( );
+ TEST_REAL_INF(-);
+
+ TEST_IMAG_INF_SIDE_EFFECT (,0.FI);
+ TEST_IMAG_INF_SIDE_EFFECT (-,-0.FI);
+
+ TEST_REAL_INF_SIDE_EFFECT( );
+ TEST_REAL_INF_SIDE_EFFECT(-);
+#endif
+
+ return;
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-cproj-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-cproj-2.c
new file mode 100644
index 000000000..39331651f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-cproj-2.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 2010 Free Software Foundation.
+
+ Verify that folding of built-in cproj is correctly performed by the
+ compiler. With -ffinite-math-only all cproj calls should be
+ eliminated regardless of what the argument is, or what is known
+ about it.
+
+ Origin: Kaveh R. Ghazi, April 9, 2010. */
+
+/* { dg-do link } */
+/* { dg-options "-ffinite-math-only" } */
+
+/* All references to link_error should go away at compile-time. The
+ argument is the __LINE__ number. It appears in the tree dump file
+ and aids in debugging should any of the tests fail. */
+extern void link_error(int);
+
+#define CPROJ(X) __builtin_cproj(X)
+#define CPROJF(X) __builtin_cprojf(X)
+#define CPROJL(X) __builtin_cprojl(X)
+
+/* Test that the supplied expressions eliminte the cproj call. */
+#define TEST_EXPRS(LD_EXPR, D_EXPR, F_EXPR) do { \
+ if (CPROJF(F_EXPR) != (F_EXPR)) \
+ link_error (__LINE__); \
+ if (CPROJ(D_EXPR) != (D_EXPR)) \
+ link_error (__LINE__); \
+ if (CPROJL(LD_EXPR) != (LD_EXPR)) \
+ link_error (__LINE__); \
+} while (0)
+
+void foo (_Complex long double cld, _Complex double cd, _Complex float cf)
+{
+#ifdef __OPTIMIZE__
+ TEST_EXPRS (cld, cd, cf);
+ TEST_EXPRS (cld*2, cd*2, cf*2);
+ TEST_EXPRS (cld*cld, cd*cd, cf*cf);
+#endif
+
+ return;
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ctype-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ctype-1.c
new file mode 100644
index 000000000..ad6fc1c60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ctype-1.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in ctype function attributes are correctly set by
+ the compiler.
+
+ Written by Kaveh Ghazi, 2004-03-23. */
+
+/* { dg-do link } */
+
+
+void test(int i)
+{
+ /* All of these ctype functions should be const/pure and thus
+ eliminated. */
+#define TEST_CTYPE(FN) \
+ extern int FN(int); \
+ extern void link_failure_##FN(void); \
+ if (FN(i) != FN(i)) \
+ link_failure_##FN()
+
+#ifdef __OPTIMIZE__
+ TEST_CTYPE(isalnum);
+ TEST_CTYPE(isalpha);
+ TEST_CTYPE(isascii);
+ TEST_CTYPE(isblank);
+ TEST_CTYPE(iscntrl);
+ TEST_CTYPE(isdigit);
+ TEST_CTYPE(isgraph);
+ TEST_CTYPE(islower);
+ TEST_CTYPE(isprint);
+ TEST_CTYPE(ispunct);
+ TEST_CTYPE(isspace);
+ TEST_CTYPE(isupper);
+ TEST_CTYPE(isxdigit);
+ TEST_CTYPE(toascii);
+ TEST_CTYPE(tolower);
+ TEST_CTYPE(toupper);
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ctype-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ctype-2.c
new file mode 100644
index 000000000..7046aad65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ctype-2.c
@@ -0,0 +1,107 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in ctype transformations are done correctly by
+ the compiler.
+
+ Written by Kaveh Ghazi, 2004-04-05. */
+
+/* { dg-do link } */
+
+extern void link_failure_var(void);
+
+void test(int i)
+{
+ /* All of these ctype calls should compile-time evaluate to true. */
+#define TEST_CTYPE_CST_TRUE(FN, VALUE) \
+ extern void link_failure_##FN##_cst_true(void); \
+ extern int FN(int); \
+ if (! FN(VALUE)) \
+ link_failure_##FN##_cst_true()
+
+ /* All of these ctype calls should compile-time evaluate to false. */
+#define TEST_CTYPE_CST_FALSE(FN, VALUE) \
+ extern void link_failure_##FN##_cst_false(void); \
+ extern int FN(int); \
+ if (FN(VALUE)) \
+ link_failure_##FN##_cst_false()
+
+ /* All of these ctype calls should compile-time evaluate to true. */
+#define TEST_TOCTYPE_CST_TRUE(FN, VALUE) \
+ extern void link_failure_##FN##_cst_true(void); \
+ extern int FN(int); \
+ if (FN(VALUE) != (VALUE)) \
+ link_failure_##FN##_cst_true()
+
+ /* All of these ctype calls should compile-time evaluate to false. */
+#define TEST_TOCTYPE_CST_FALSE(FN, VALUE) \
+ extern void link_failure_##FN##_cst_false(void); \
+ extern int FN(int); \
+ if (FN(VALUE) == (VALUE)) \
+ link_failure_##FN##_cst_false()
+
+#ifdef __OPTIMIZE__
+ TEST_CTYPE_CST_TRUE (isascii, 0);
+ TEST_CTYPE_CST_TRUE (isascii, 1);
+ TEST_CTYPE_CST_TRUE (isascii, 126);
+ TEST_CTYPE_CST_TRUE (isascii, 127);
+
+ TEST_CTYPE_CST_FALSE (isascii, -1);
+ TEST_CTYPE_CST_FALSE (isascii, 128);
+ TEST_CTYPE_CST_FALSE (isascii, 129);
+ TEST_CTYPE_CST_FALSE (isascii, 255);
+ TEST_CTYPE_CST_FALSE (isascii, 256);
+ TEST_CTYPE_CST_FALSE (isascii, 257);
+ TEST_CTYPE_CST_FALSE (isascii, 10000);
+ TEST_CTYPE_CST_FALSE (isascii, __INT_MAX__);
+
+ /* This ctype call should transform into another expression. */
+ if (isascii(i) != ((i & ~0x7f) == 0))
+ link_failure_var();
+
+ TEST_TOCTYPE_CST_TRUE (toascii, 0);
+ TEST_TOCTYPE_CST_TRUE (toascii, 1);
+ TEST_TOCTYPE_CST_TRUE (toascii, 126);
+ TEST_TOCTYPE_CST_TRUE (toascii, 127);
+
+ TEST_TOCTYPE_CST_FALSE (toascii, -1);
+ TEST_TOCTYPE_CST_FALSE (toascii, 128);
+ TEST_TOCTYPE_CST_FALSE (toascii, 129);
+ TEST_TOCTYPE_CST_FALSE (toascii, 255);
+ TEST_TOCTYPE_CST_FALSE (toascii, 256);
+ TEST_TOCTYPE_CST_FALSE (toascii, 10000);
+ TEST_TOCTYPE_CST_FALSE (toascii, __INT_MAX__);
+
+ /* This ctype call should transform into another expression. */
+ if (toascii(i) != (i & 0x7f))
+ link_failure_var();
+
+ TEST_CTYPE_CST_TRUE (isdigit, '0');
+ TEST_CTYPE_CST_TRUE (isdigit, '1');
+ TEST_CTYPE_CST_TRUE (isdigit, '2');
+ TEST_CTYPE_CST_TRUE (isdigit, '3');
+ TEST_CTYPE_CST_TRUE (isdigit, '4');
+ TEST_CTYPE_CST_TRUE (isdigit, '5');
+ TEST_CTYPE_CST_TRUE (isdigit, '6');
+ TEST_CTYPE_CST_TRUE (isdigit, '7');
+ TEST_CTYPE_CST_TRUE (isdigit, '8');
+ TEST_CTYPE_CST_TRUE (isdigit, '9');
+
+ TEST_CTYPE_CST_FALSE (isdigit, '0'-1);
+ TEST_CTYPE_CST_FALSE (isdigit, '9'+1);
+ TEST_CTYPE_CST_FALSE (isdigit, -1);
+ TEST_CTYPE_CST_FALSE (isdigit, 0);
+ TEST_CTYPE_CST_FALSE (isdigit, 255);
+ TEST_CTYPE_CST_FALSE (isdigit, 256);
+ TEST_CTYPE_CST_FALSE (isdigit, 10000);
+ TEST_CTYPE_CST_FALSE (isdigit, __INT_MAX__);
+
+ /* This ctype call should transform into another expression. */
+ if (isdigit(i) != ((unsigned)i - '0' <= 9))
+ link_failure_var();
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-explog-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-explog-1.c
new file mode 100644
index 000000000..545f9239c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-explog-1.c
@@ -0,0 +1,232 @@
+/* Copyright (C) 2003, 2004 Free Software Foundation.
+
+ Verify that built-in math function constant folding of log & exp is
+ correctly performed by the compiler.
+
+ Written by Kaveh Ghazi, 2003-09-05. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-skip-if "PR44214" { *-*-* } { "-O0" } { "" } } */
+
+/* Define "e" with as many bits as found in builtins.c:dconste. */
+#define M_E 2.7182818284590452353602874713526624977572470936999595749669676277241
+#define M_EF 2.7182818284590452353602874713526624977572470936999595749669676277241F
+#define M_EL 2.7182818284590452353602874713526624977572470936999595749669676277241L
+/* Precision for comparison tests. */
+#define PREC (sizeof (float) < sizeof (double) ? 0.0000001 : PRECF)
+#define PRECF 0.0001F
+#define PRECL (sizeof (float) < sizeof (long double) \
+ ? 0.0000000000001L : PRECF)
+#define PROTOTYPE(FN) extern double FN(double); extern float FN##f(float); \
+ extern long double FN##l(long double);
+#define PROTOTYPE2(FN) extern double FN(double, double); \
+ extern float FN##f(float, float); \
+ extern long double FN##l(long double, long double);
+
+PROTOTYPE(exp)
+PROTOTYPE(exp2)
+PROTOTYPE(exp10)
+PROTOTYPE(log)
+PROTOTYPE(log2)
+PROTOTYPE(log10)
+PROTOTYPE(pow10)
+PROTOTYPE(sqrt)
+PROTOTYPE(cbrt)
+PROTOTYPE2(pow)
+
+void test(double d1, double d2, float f1, float f2,
+ long double ld1, long double ld2)
+{
+ /* Test logN(1) -> 0. */
+#define LOG_1(LOG) \
+ extern void link_failure_##LOG##_1(void); \
+ if (LOG(1.0) != 0.0 || LOG##f(1.0F) != 0.0F || LOG##l(1.0L) != 0.0L) \
+ link_failure_##LOG##_1()
+
+ LOG_1(log);
+ LOG_1(log2);
+ LOG_1(log10);
+
+ /* Test logN(N) -> 1. */
+#define LOG_N(LOG, BASE) \
+ extern void link_failure_##LOG##_N(void); \
+ if (LOG(BASE) != 1.0 || LOG##f(BASE##F) != 1.0F || LOG##l(BASE##L) != 1.0L) \
+ link_failure_##LOG##_N()
+
+ LOG_N(log2, 2.0);
+ LOG_N(log10, 10.0);
+
+ /* Test logN(expN(x)) -> x. */
+#define LOGEXP_SAME(LOG, EXP) \
+ extern void link_failure_##LOG##_##EXP##_same(void); \
+ if (LOG(EXP(d1)) != d1 || LOG##f(EXP##f(f1)) != f1 \
+ || LOG##l(EXP##l(ld1)) != ld1) link_failure_##LOG##_##EXP##_same()
+
+ LOGEXP_SAME(log,exp);
+ LOGEXP_SAME(log2,exp2);
+ LOGEXP_SAME(log10,exp10);
+ LOGEXP_SAME(log10,pow10);
+
+ /* Test logN(expM(x)) -> x*logN(M). */
+#define LOGEXP(LOG, EXP, BASE) \
+ extern void link_failure_##LOG##_##EXP(void); \
+ if (LOG(EXP(d1)) != d1*LOG(BASE) || LOG##f(EXP##f(f1)) != f1*LOG##f(BASE##F) \
+ || LOG##l(EXP##l(ld1)) != ld1*LOG##l(BASE##L)) link_failure_##LOG##_##EXP()
+
+ LOGEXP(log,exp2,2.0);
+ LOGEXP(log,exp10,10.0);
+ LOGEXP(log,pow10,10.0);
+ LOGEXP(log2,exp,M_E);
+ LOGEXP(log2,exp2,2.0);
+ LOGEXP(log2,exp10,10.0);
+ LOGEXP(log2,pow10,10.0);
+ LOGEXP(log10,exp,M_E);
+ LOGEXP(log10,exp2,2.0);
+ LOGEXP(log10,exp10,10.0);
+ LOGEXP(log10,pow10,10.0);
+
+ /* Test logN(sqrt(x)) -> 0.5*logN(x). */
+#define LOG_SQRT(LOG) \
+ extern void link_failure_##LOG##_sqrt(void); \
+ if (LOG(sqrt(d1)) != 0.5*LOG(d1) || LOG##f(sqrtf(f1)) != 0.5F*LOG##f(f1) \
+ || LOG##l(sqrtl(ld1)) != 0.5L*LOG##l(ld1)) link_failure_##LOG##_sqrt()
+
+ LOG_SQRT(log);
+ LOG_SQRT(log2);
+ LOG_SQRT(log10);
+
+ /* Test sqrt(expN(x)) -> expN(x*0.5). */
+#define SQRT_EXP(EXP) \
+ extern void link_failure_sqrt_##EXP(void); \
+ if (sqrt(EXP(d1)) != EXP(d1*0.5) || sqrtf(EXP##f(f1)) != EXP##f(f1*0.5F) \
+ || sqrtl(EXP##l(ld1)) != EXP##l(ld1*0.5L)) link_failure_sqrt_##EXP()
+
+ SQRT_EXP(exp);
+ SQRT_EXP(exp2);
+ SQRT_EXP(exp10);
+ SQRT_EXP(pow10);
+
+ /* Test logN(cbrt(x)) -> (1/3)*logN(x). */
+#define LOG_CBRT(LOG) \
+ extern void link_failure_##LOG##_cbrt(void); \
+ if (LOG(cbrt(d1)) != (1.0/3)*LOG(d1) \
+ || LOG##f(cbrtf(f1)) != (1.0F/3)*LOG##f(f1) \
+ || LOG##l(cbrtl(ld1)) != (1.0L/3)*LOG##l(ld1)) link_failure_##LOG##_cbrt()
+
+ LOG_CBRT(log);
+ LOG_CBRT(log2);
+ LOG_CBRT(log10);
+
+ /* Test cbrt(expN(x)) -> expN(x/3). */
+#define CBRT_EXP(EXP) \
+ extern void link_failure_cbrt_##EXP(void); \
+ if (cbrt(EXP(d1)) != EXP(d1/3.0) || cbrtf(EXP##f(f1)) != EXP##f(f1/3.0F) \
+ || cbrtl(EXP##l(ld1)) != EXP##l(ld1/3.0L)) link_failure_cbrt_##EXP()
+
+ CBRT_EXP(exp);
+ CBRT_EXP(exp2);
+ CBRT_EXP(exp10);
+ CBRT_EXP(pow10);
+
+ /* Test logN(pow(x,y)) -> y*logN(x). */
+#define LOG_POW(LOG, POW) \
+ extern void link_failure_##LOG##_##POW(void); \
+ if (LOG(POW(d1,d2)) != d2*LOG(d1) || LOG##f(POW##f(f1,f2)) != f2*LOG##f(f1) \
+ || LOG##l(POW##l(ld1,ld2)) != ld2*LOG##l(ld1)) link_failure_##LOG##_##POW()
+
+ LOG_POW(log,pow);
+ LOG_POW(log2,pow);
+ LOG_POW(log10,pow);
+
+ /* Test pow(expN(x),y)) -> expN(x*y). */
+#define POW_EXP(POW, EXP) \
+ extern void link_failure_##POW##_##EXP(void); \
+ if (POW(EXP(d1),d2) != EXP(d1*d2) || POW##f(EXP##f(f1),f2) != EXP##f(f1*f2) \
+ || POW##l(EXP##l(ld1),ld2) != EXP##l(ld1*ld2)) link_failure_##POW##_##EXP()
+
+ POW_EXP(pow, exp);
+ POW_EXP(pow, exp2);
+ POW_EXP(pow, exp10);
+ POW_EXP(pow, pow10);
+
+ /* Test expN(0) -> 1. */
+#define EXP_0(EXP) \
+ extern void link_failure_##EXP##_0(void); \
+ if (EXP(0.0) != 1.0 || EXP##f(0.0F) != 1.0F || EXP##l(0.0L) != 1.0L) \
+ link_failure_##EXP##_0()
+
+ EXP_0(exp);
+ EXP_0(exp2);
+ EXP_0(exp10);
+ EXP_0(pow10);
+
+ /* Test expN(1) -> N. */
+#define EXP_N(EXP, BASE) \
+ extern void link_failure_##EXP##_N(void); \
+ if (EXP(1.0) != BASE || EXP##f(1.0F) != BASE##F || EXP##l(1.0L) != BASE##L) \
+ link_failure_##EXP##_N()
+
+ EXP_N(exp, M_E);
+ EXP_N(exp2, 2.0);
+ EXP_N(exp10, 10.0);
+ EXP_N(pow10, 10.0);
+
+ /* Test expN(integer) -> N*N*N*... */
+#define EXP_INT(EXP, BASE) \
+ extern void link_failure_##EXP##_INT(void); \
+ if (EXP(5.0) < (BASE)*(BASE)*(BASE)*(BASE)*(BASE) - PREC \
+ || EXP(5.0) > (BASE)*(BASE)*(BASE)*(BASE)*(BASE) + PREC \
+ || EXP##f(5.0F) < (BASE##F)*(BASE##F)*(BASE##F)*(BASE##F)*(BASE##F) -PRECF \
+ || EXP##f(5.0F) > (BASE##F)*(BASE##F)*(BASE##F)*(BASE##F)*(BASE##F) +PRECF \
+ || EXP##l(5.0L) < (BASE##L)*(BASE##L)*(BASE##L)*(BASE##L)*(BASE##L) -PRECL \
+ || EXP##l(5.0L) > (BASE##L)*(BASE##L)*(BASE##L)*(BASE##L)*(BASE##L) +PRECL) \
+ link_failure_##EXP##_INT()
+
+ EXP_INT(exp, M_E);
+ EXP_INT(exp2, 2.0);
+ EXP_INT(exp10, 10.0);
+ EXP_INT(pow10, 10.0);
+
+ /* Test expN(logN(x)) -> x. */
+#define EXPLOG_SAME(EXP, LOG) \
+ extern void link_failure_##EXP##_##LOG##_same(void); \
+ if (EXP(LOG(d1)) != d1 || EXP##f(LOG##f(f1)) != f1 \
+ || EXP##l(LOG##l(ld1)) != ld1) link_failure_##EXP##_##LOG##_same()
+
+ EXPLOG_SAME(exp, log);
+ EXPLOG_SAME(exp2, log2);
+ EXPLOG_SAME(exp10, log10);
+ EXPLOG_SAME(pow10, log10);
+
+ /* Test expN(x)*expN(y)) -> expN(x+y). */
+#define EXPXEXP(EXP) \
+ extern void link_failure_##EXP##X##EXP(void); \
+ if (EXP(d1)*EXP(d2) != EXP(d1+d2) || EXP##f(f1)*EXP##f(f2) != EXP##f(f1+f2) \
+ || EXP##l(ld1)*EXP##l(ld2) != EXP##l(ld1+ld2)) link_failure_##EXP##X##EXP()
+
+ EXPXEXP(exp);
+ EXPXEXP(exp2);
+ EXPXEXP(exp10);
+ EXPXEXP(pow10);
+
+ /* Test x/expN(y) -> x*expN(-y). */
+ /* Test expN(x)/expN(y) -> expN(x-y). */
+#define DIVEXP(EXP) \
+ extern void link_failure_div1_##EXP(void); \
+ if (d1/EXP(d2) != d1*EXP(-d2) || f1/EXP##f(f2) != f1*EXP##f(-f2) \
+ || ld1/EXP##l(ld2) != ld1*EXP##l(-ld2)) link_failure_div1_##EXP(); \
+ extern void link_failure_div2_##EXP(void); \
+ if (EXP(d1)/EXP(d2) != EXP(d1-d2) || EXP##f(f1)/EXP##f(f2) != EXP##f(f1-f2) \
+ || EXP##l(ld1)/EXP##l(ld2) != EXP##l(ld1-ld2)) link_failure_div2_##EXP()
+
+ DIVEXP(exp);
+ DIVEXP(exp2);
+ DIVEXP(exp10);
+ DIVEXP(pow10);
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-frexp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-frexp-1.c
new file mode 100644
index 000000000..a66ce51fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-frexp-1.c
@@ -0,0 +1,137 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Verify that built-in folding of frexp is correctly performed by the
+ compiler.
+
+ Origin: Kaveh R. Ghazi, February 21, 2007. */
+
+/* { dg-do link } */
+/* { dg-options "-fno-finite-math-only" { target sh*-*-* } } */
+/* In order to fold algebraic exprs below, targets with "composite"
+ floating point formats need -funsafe-math-optimizations. */
+/* { dg-options "-funsafe-math-optimizations" { target powerpc*-*-* } } */
+
+extern void link_error(int);
+
+/* Return TRUE if the sign of X != sign of Y. This is important when
+ comparing signed zeros. */
+#define CKSGN_F(X,Y) \
+ (__builtin_copysignf(1.0F,(X)) != __builtin_copysignf(1.0F,(Y)))
+#define CKSGN(X,Y) \
+ (__builtin_copysign(1.0,(X)) != __builtin_copysign(1.0,(Y)))
+#define CKSGN_L(X,Y) \
+ (__builtin_copysignl(1.0L,(X)) != __builtin_copysignl(1.0L,(Y)))
+
+/* We can only check the exponent when optimizing since we rely on
+ other optimizations to propagate the value. TRUE means an error
+ occurred. */
+#ifdef __OPTIMIZE__
+#define CKEXP(X,Y) X != Y
+#else
+#define CKEXP(X,Y) 0
+#endif
+
+/* Test that frexp(ARG,&i) == RES && i == EXP. Check the sign in
+ case we get -0.0. */
+#define TESTIT_FREXP(ARG,RES,EXP) do { \
+ int i = 12345; \
+ if (__builtin_frexpf(ARG##f,&i) != RES##f \
+ || CKEXP(i,EXP) \
+ || CKSGN_F(__builtin_frexpf(ARG##f,&i),RES##f)) \
+ link_error(__LINE__); \
+ i = 12345; \
+ if (__builtin_frexp(ARG,&i) != RES \
+ || CKEXP(i,EXP) \
+ || CKSGN(__builtin_frexp(ARG,&i),RES)) \
+ link_error(__LINE__); \
+ i = 12345; \
+ if (__builtin_frexpl(ARG##l,&i) != RES##l \
+ || CKEXP(i,EXP) \
+ || CKSGN_L(__builtin_frexpl(ARG##l,&i),RES##l)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNCRES(frexp(NEG FUNCARG(ARGARG),&i)) is false. Check
+ the sign as well. Ensure side-effects are evaluated in i. */
+#ifndef __SPU__
+#define TESTIT_FREXP2(NEG,FUNCARG,ARGARG,FUNCRES) do { \
+ int i=5; \
+ if (!__builtin_##FUNCRES##f(__builtin_frexpf(NEG __builtin_##FUNCARG##f(ARGARG),&i)) \
+ || CKSGN_F(__builtin_frexpf(NEG __builtin_##FUNCARG##f(ARGARG),(i++,&i)), NEG __builtin_##FUNCARG##f(ARGARG)) \
+ || CKEXP(i,6)) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES(__builtin_frexp(NEG __builtin_##FUNCARG(ARGARG),&i)) \
+ || CKSGN(__builtin_frexp(NEG __builtin_##FUNCARG(ARGARG),(i++,&i)), NEG __builtin_##FUNCARG(ARGARG)) \
+ || CKEXP(i,7)) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES##l(__builtin_frexpl(NEG __builtin_##FUNCARG##l(ARGARG),&i)) \
+ || CKSGN_L(__builtin_frexpl(NEG __builtin_##FUNCARG##l(ARGARG),(i++,&i)), NEG __builtin_##FUNCARG##l(ARGARG)) \
+ || CKEXP(i,8)) \
+ link_error(__LINE__); \
+ } while (0)
+#else
+#define TESTIT_FREXP2(NEG,FUNCARG,ARGARG,FUNCRES) do { \
+ int i=6; \
+ /* SPU single-precision floating point format does not support Inf or Nan. */ \
+ if (!__builtin_##FUNCRES(__builtin_frexp(NEG __builtin_##FUNCARG(ARGARG),&i)) \
+ || CKSGN(__builtin_frexp(NEG __builtin_##FUNCARG(ARGARG),(i++,&i)), NEG __builtin_##FUNCARG(ARGARG)) \
+ || CKEXP(i,7)) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES##l(__builtin_frexpl(NEG __builtin_##FUNCARG##l(ARGARG),&i)) \
+ || CKSGN_L(__builtin_frexpl(NEG __builtin_##FUNCARG##l(ARGARG),(i++,&i)), NEG __builtin_##FUNCARG##l(ARGARG)) \
+ || CKEXP(i,8)) \
+ link_error(__LINE__); \
+ } while (0)
+#endif
+
+void __attribute__ ((__noinline__))
+foo(void)
+{
+ /* Test that frexp(ARG1,&i) -> ARG2 && i == ARG3. */
+ TESTIT_FREXP (-0x1p40, -0.5, 41);
+ TESTIT_FREXP (-0x1p30, -0.5, 31);
+ TESTIT_FREXP (-0x1p20, -0.5, 21);
+ TESTIT_FREXP (-0x1p10, -0.5, 11);
+ TESTIT_FREXP (-0x1p5, -0.5, 6);
+ TESTIT_FREXP (-100/3.0, -100/192.0, 6);
+ TESTIT_FREXP (-1.5, -0.75, 1);
+ TESTIT_FREXP (-1.0, -0.5, 1);
+ TESTIT_FREXP (-1/3.0, -2/3.0, -1);
+ TESTIT_FREXP (-1/9.0, -8/9.0, -3);
+ TESTIT_FREXP (-0x1p-5, -0.5, -4);
+ TESTIT_FREXP (-0x1p-10, -0.5, -9);
+ TESTIT_FREXP (-0x1p-20, -0.5, -19);
+ TESTIT_FREXP (-0x1p-30, -0.5, -29);
+ TESTIT_FREXP (-0x1p-40, -0.5, -39);
+ TESTIT_FREXP (-0.0, -0.0, 0);
+ TESTIT_FREXP (0.0, 0.0, 0);
+ TESTIT_FREXP (0x1p-40, 0.5, -39);
+ TESTIT_FREXP (0x1p-30, 0.5, -29);
+ TESTIT_FREXP (0x1p-20, 0.5, -19);
+ TESTIT_FREXP (0x1p-10, 0.5, -9);
+ TESTIT_FREXP (0x1p-5, 0.5, -4);
+ TESTIT_FREXP (1/9.0, 8/9.0, -3);
+ TESTIT_FREXP (1/3.0, 2/3.0, -1);
+ TESTIT_FREXP (1.0, 0.5, 1);
+ TESTIT_FREXP (1.5, 0.75, 1);
+ TESTIT_FREXP (100/3.0, 100/192.0, 6);
+ TESTIT_FREXP (0x1p5, 0.5, 6);
+ TESTIT_FREXP (0x1p10, 0.5, 11);
+ TESTIT_FREXP (0x1p20, 0.5, 21);
+ TESTIT_FREXP (0x1p30, 0.5, 31);
+ TESTIT_FREXP (0x1p40, 0.5, 41);
+
+ /* Test for frexp(+-Inf,&i) -> +-Inf and frexp(+-NaN,&i) -> +-NaN.
+ Exponent is left unspecified, but we test for side-effects. */
+ TESTIT_FREXP2 ( ,inf, , isinf);
+ TESTIT_FREXP2 (- ,inf, , isinf);
+ TESTIT_FREXP2 ( ,nan, "", isnan);
+ TESTIT_FREXP2 (- ,nan, "", isnan);
+}
+
+int main()
+{
+ foo ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-integral-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-integral-1.c
new file mode 100644
index 000000000..522646dd5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-integral-1.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that integral FP expressions are optimized.
+
+ Written by Kaveh Ghazi, 2004-03-16. */
+
+/* { dg-do link } */
+/* We need -ffinite-math-only so that we can fold "foo != foo", where
+ foo is a floating point expression. We need -fno-math-errno so
+ that various math functions are marked const/pure and can be
+ folded. */
+/* { dg-options "-ffinite-math-only -fno-math-errno" } */
+
+extern int link_failure (int);
+
+/* Test that the various FP truncation builtins detect integral
+ arguments. */
+#define CHECK_FN(MATHFN) \
+ if (__builtin_##MATHFN(i1) != i1) link_failure (__LINE__); \
+ if (__builtin_##MATHFN##f(i1) != i1) link_failure (__LINE__); \
+ if (__builtin_##MATHFN##l(i1) != i1) link_failure (__LINE__);
+
+#define CHECK_FN_RET(MATHFN, RET) \
+ if (__builtin_##MATHFN(i1) != (RET)(double)i1) link_failure (__LINE__); \
+ if (__builtin_##MATHFN##f(i1) != (RET)(float)i1) link_failure (__LINE__); \
+ if (__builtin_##MATHFN##l(i1) != (RET)(long double)i1) link_failure (__LINE__);
+
+ /* Check that various other integral expressions are detected. */
+#define CHECK_EXPR(EXPR,NAME) \
+ if (__builtin_ceill(EXPR) != (EXPR)) link_failure (__LINE__); \
+ if (__builtin_lroundl(EXPR) != (long)(long double)(EXPR)) link_failure (__LINE__);
+
+void __attribute__ ((__noinline__)) test (int i1, int i2)
+{
+ CHECK_FN(ceil);
+ CHECK_FN(floor);
+ CHECK_FN(nearbyint);
+ CHECK_FN(rint);
+ CHECK_FN(round);
+ CHECK_FN(trunc);
+ CHECK_FN_RET(lround, long);
+ CHECK_FN_RET(llround, long long);
+ CHECK_FN_RET(lrint, long);
+ CHECK_FN_RET(llrint, long long);
+ CHECK_FN_RET(lceil, long);
+ CHECK_FN_RET(llceil, long long);
+ CHECK_FN_RET(lfloor, long);
+ CHECK_FN_RET(llfloor, long long);
+
+ CHECK_EXPR (5.0, REAL_CST);
+ CHECK_EXPR (5.0F, REAL_CSTf);
+ CHECK_EXPR (5.0L, REAL_CSTl);
+ CHECK_EXPR ((double)i1, FLOAT_EXPR);
+ CHECK_EXPR ((float)i1, FLOAT_EXPRf);
+ CHECK_EXPR ((long double)i1, FLOAT_EXPRl);
+ CHECK_EXPR (__builtin_fabs(i1), ABS_EXPR);
+ CHECK_EXPR (__builtin_fabsf(i1), ABS_EXPRf);
+ CHECK_EXPR (__builtin_fabsl(i1), ABS_EXPRl);
+ CHECK_EXPR (((void)i1,(double)i2), COMPOUND_EXPR);
+ CHECK_EXPR ((double)i1+i2, PLUS_EXPR);
+ CHECK_EXPR ((double)i1-i2, MINUS_EXPR);
+ CHECK_EXPR ((double)i1*i2, MULT_EXPR);
+}
+
+int main (void)
+{
+ test (1, 2);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-isinf_sign-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-isinf_sign-1.c
new file mode 100644
index 000000000..6dc2326ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-isinf_sign-1.c
@@ -0,0 +1,56 @@
+/* Copyright (C) 2008 Free Software Foundation.
+
+ Verify that __builtin_isinf_sign folds correctly.
+
+ Origin: Kaveh R. Ghazi, May 17, 2008. */
+
+/* { dg-do link } */
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(int);
+
+void __attribute__ ((__noinline__))
+foo (float f, double d, long double ld)
+{
+ /* Test the generic expansion of isinf_sign. */
+
+ if (__builtin_isinf_sign(f)
+ != (__builtin_isinf(f) ? (__builtin_signbitf(f) ? -1 : 1) : 0))
+ link_error (__LINE__);
+ if (__builtin_isinf_sign(d)
+ != (__builtin_isinf(d) ? (__builtin_signbit(d) ? -1 : 1) : 0))
+ link_error (__LINE__);
+ if (__builtin_isinf_sign(ld)
+ != (__builtin_isinf(ld) ? (__builtin_signbitl(ld) ? -1 : 1) : 0))
+ link_error (__LINE__);
+
+ /* In boolean contexts, GCC will fold the inner conditional
+ expression to 1. So isinf_sign folds to plain isinf. */
+
+ if ((_Bool)__builtin_isinf_sign(f) != (__builtin_isinf(f) != 0))
+ link_error (__LINE__);
+ if ((_Bool)__builtin_isinf_sign(d) != (__builtin_isinf(d) != 0))
+ link_error (__LINE__);
+ if ((_Bool)__builtin_isinf_sign(ld) != (__builtin_isinf(ld) != 0))
+ link_error (__LINE__);
+
+ if ((__builtin_isinf_sign(f) != 0) != (__builtin_isinf(f) != 0))
+ link_error (__LINE__);
+ if ((__builtin_isinf_sign(d) != 0) != (__builtin_isinf(d) != 0))
+ link_error (__LINE__);
+ if ((__builtin_isinf_sign(ld) != 0) != (__builtin_isinf(ld) != 0))
+ link_error (__LINE__);
+
+ if ((__builtin_isinf_sign(f) ? 5 : 6) != (__builtin_isinf(f) ? 5 : 6))
+ link_error (__LINE__);
+ if ((__builtin_isinf_sign(d) ? 5 : 6) != (__builtin_isinf(d) ? 5 : 6))
+ link_error (__LINE__);
+ if ((__builtin_isinf_sign(ld) ? 5 : 6) != (__builtin_isinf(ld) ? 5 : 6))
+ link_error (__LINE__);
+}
+
+int main (void)
+{
+ foo (1, 2, 3);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ldexp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ldexp-1.c
new file mode 100644
index 000000000..94560a8ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-ldexp-1.c
@@ -0,0 +1,216 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Verify that built-in folding of ldexp et al. is correctly performed
+ by the compiler.
+
+ Origin: Kaveh R. Ghazi, February 17, 2007. */
+
+/* { dg-do link } */
+/* { dg-options "-fno-finite-math-only" { target sh*-*-* } } */
+
+extern void link_error(int);
+
+/* Return TRUE if the sign of X != sign of Y. This is important when
+ comparing signed zeros. */
+#define CKSGN_F(X,Y) \
+ (__builtin_copysignf(1.0F,(X)) != __builtin_copysignf(1.0F,(Y)))
+#define CKSGN(X,Y) \
+ (__builtin_copysign(1.0,(X)) != __builtin_copysign(1.0,(Y)))
+#define CKSGN_L(X,Y) \
+ (__builtin_copysignl(1.0L,(X)) != __builtin_copysignl(1.0L,(Y)))
+
+/* Test that FUNC(ARG1,ARG2) == RES. Check the sign for -0.0. */
+#define TESTIT(FUNC,ARG1,ARG2,RES) do { \
+ if (__builtin_##FUNC##f(ARG1##f,ARG2) != RES##f \
+ || CKSGN_F(__builtin_##FUNC##f(ARG1##f,ARG2),RES##f)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG1,ARG2) != RES \
+ || CKSGN(__builtin_##FUNC(ARG1,ARG2),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG1##l,ARG2) != RES##l \
+ || CKSGN_L(__builtin_##FUNC##l(ARG1##l,ARG2),RES##l)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that (long)FUNC(ARG1,ARG2) == (long)RES. The cast is
+ necessary when RES is not a constant. */
+#define TESTIT2(FUNC,ARG1,ARG2,RES) do { \
+ if ((long)__builtin_##FUNC##f(ARG1##f,ARG2) != (long)RES##f) \
+ link_error(__LINE__); \
+ if ((long)__builtin_##FUNC(ARG1,ARG2) != (long)RES) \
+ link_error(__LINE__); \
+ if ((long)__builtin_##FUNC##l(ARG1##l,ARG2) != (long)RES##l) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNCRES(FUNC(NEG FUNCARG(ARGARG),ARG2)) is false. Check
+ the sign as well. */
+#ifndef __SPU__
+#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,ARG2,FUNCRES) do { \
+ if (!__builtin_##FUNCRES##f(__builtin_##FUNC##f(NEG __builtin_##FUNCARG##f(ARGARG),ARG2)) \
+ || CKSGN_F(__builtin_##FUNC##f(NEG __builtin_##FUNCARG##f(ARGARG),ARG2), NEG __builtin_##FUNCARG##f(ARGARG))) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG),ARG2)) \
+ || CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG),ARG2), NEG __builtin_##FUNCARG(ARGARG))) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES##l(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG),ARG2)) \
+ || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG),ARG2), NEG __builtin_##FUNCARG##l(ARGARG))) \
+ link_error(__LINE__); \
+ } while (0)
+#else
+#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,ARG2,FUNCRES) do { \
+ /* SPU single-precision floating point format does not support Inf or Nan. */ \
+ if (!__builtin_##FUNCRES(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG),ARG2)) \
+ || CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG),ARG2), NEG __builtin_##FUNCARG(ARGARG))) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES##l(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG),ARG2)) \
+ || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG),ARG2), NEG __builtin_##FUNCARG##l(ARGARG))) \
+ link_error(__LINE__); \
+ } while (0)
+#endif
+
+/* Using foo==MIN/MAX float values, test that FUNC(foo,EXP) == foo*exp2(EXP),
+ and also that FUNC(foo,-EXP) == foo*exp2(-EXP). */
+#define TESTIT4(FUNC,EXP) do { \
+ if (__builtin_##FUNC##f(__FLT_MIN__,EXP) != __FLT_MIN__*__builtin_exp2f(EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##f(-__FLT_MIN__,EXP) != -__FLT_MIN__*__builtin_exp2f(EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(__DBL_MIN__,EXP) != __DBL_MIN__*__builtin_exp2(EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(-__DBL_MIN__,EXP) != -__DBL_MIN__*__builtin_exp2(EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(__LDBL_MIN__,EXP) != __LDBL_MIN__*__builtin_exp2l(EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(-__LDBL_MIN__,EXP) != -__LDBL_MIN__*__builtin_exp2l(EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##f(__FLT_MAX__,-EXP) != __FLT_MAX__*__builtin_exp2f(-EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##f(-__FLT_MAX__,-EXP) != -__FLT_MAX__*__builtin_exp2f(-EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(__DBL_MAX__,-EXP) != __DBL_MAX__*__builtin_exp2(-EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(-__DBL_MAX__,-EXP) != -__DBL_MAX__*__builtin_exp2(-EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(__LDBL_MAX__,-EXP) != __LDBL_MAX__*__builtin_exp2l(-EXP)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(-__LDBL_MAX__,-EXP) != -__LDBL_MAX__*__builtin_exp2l(-EXP)) \
+ link_error(__LINE__); \
+ } while (0)
+
+void __attribute__ ((__noinline__))
+foo(float xf, double x, long double xl, int i, long l)
+{
+ /* f(0.0, i) -> 0.0 and f(-0.0, i) -> -0.0. */
+ TESTIT (ldexp, 0.0, i, 0.0);
+ TESTIT (ldexp, -0.0, i, -0.0);
+ TESTIT (scalbn, 0.0, i, 0.0);
+ TESTIT (scalbn, -0.0, i, -0.0);
+ TESTIT (scalbln, 0.0, l, 0.0);
+ TESTIT (scalbln, -0.0, l, -0.0);
+
+ /* f(x,0) -> x. */
+ TESTIT2 (ldexp, x, 0, x);
+ TESTIT2 (scalbn, x, 0, x);
+ TESTIT2 (scalbln, x, 0, x);
+
+ /* f(Inf,i) -> Inf and f(NaN,i) -> NaN. */
+ TESTIT3 (ldexp, , inf, , i, isinf);
+ TESTIT3 (ldexp, -, inf, , i, isinf);
+ TESTIT3 (ldexp, , nan, "", i, isnan);
+ TESTIT3 (ldexp, -, nan, "", i, isnan);
+
+ TESTIT3 (scalbn, , inf, , i, isinf);
+ TESTIT3 (scalbn, -, inf, , i, isinf);
+ TESTIT3 (scalbn, , nan, "", i, isnan);
+ TESTIT3 (scalbn, -, nan, "", i, isnan);
+
+ TESTIT3 (scalbln, , inf, , i, isinf);
+ TESTIT3 (scalbln, -, inf, , i, isinf);
+ TESTIT3 (scalbln, , nan, "", i, isnan);
+ TESTIT3 (scalbln, -, nan, "", i, isnan);
+
+ /* Evaluate when both arguments are constant. */
+ TESTIT (ldexp, 5.0, 3, 40.0);
+ TESTIT (ldexp, -5.0, 3, -40.0);
+ TESTIT (ldexp, 5.0, -3, 0.625);
+ TESTIT (ldexp, -5.0, -3, -0.625);
+
+ TESTIT (ldexp, 1000.0, 5, 32000.0);
+ TESTIT (ldexp, -1000.0, 5, -32000.0);
+ TESTIT (ldexp, 1000.0, -5, 31.25);
+ TESTIT (ldexp, -1000.0, -5, -31.25);
+
+ /* f(x,N) -> x*exp2(N), using MIN/MAX constants for x and constant N. */
+ TESTIT4 (ldexp, 1);
+ TESTIT4 (ldexp, 2);
+ TESTIT4 (ldexp, 3);
+ TESTIT4 (ldexp, 5);
+ TESTIT4 (ldexp, 9);
+ TESTIT4 (ldexp, 10);
+ TESTIT4 (ldexp, 12);
+ TESTIT4 (ldexp, 18);
+ TESTIT4 (ldexp, 25);
+ TESTIT4 (ldexp, 50);
+ TESTIT4 (ldexp, 75);
+ TESTIT4 (ldexp, 100);
+ TESTIT4 (ldexp, 123);
+
+ /* These are folded when float radix is two. */
+#if __FLT_RADIX__ == 2
+ TESTIT (scalbn, 5.0, 3, 40.0);
+ TESTIT (scalbn, -5.0, 3, -40.0);
+ TESTIT (scalbn, 5.0, -3, 0.625);
+ TESTIT (scalbn, -5.0, -3, -0.625);
+
+ TESTIT (scalbn, 1000.0, 5, 32000.0);
+ TESTIT (scalbn, -1000.0, 5, -32000.0);
+ TESTIT (scalbn, 1000.0, -5, 31.25);
+ TESTIT (scalbn, -1000.0, -5, -31.25);
+
+ TESTIT4 (scalbn, 1);
+ TESTIT4 (scalbn, 2);
+ TESTIT4 (scalbn, 3);
+ TESTIT4 (scalbn, 5);
+ TESTIT4 (scalbn, 9);
+ TESTIT4 (scalbn, 10);
+ TESTIT4 (scalbn, 12);
+ TESTIT4 (scalbn, 18);
+ TESTIT4 (scalbn, 25);
+ TESTIT4 (scalbn, 50);
+ TESTIT4 (scalbn, 75);
+ TESTIT4 (scalbn, 100);
+ TESTIT4 (scalbn, 123);
+
+ TESTIT (scalbln, 5.0, 3, 40.0);
+ TESTIT (scalbln, -5.0, 3, -40.0);
+ TESTIT (scalbln, 5.0, -3, 0.625);
+ TESTIT (scalbln, -5.0, -3, -0.625);
+
+ TESTIT (scalbln, 1000.0, 5, 32000.0);
+ TESTIT (scalbln, -1000.0, 5, -32000.0);
+ TESTIT (scalbln, 1000.0, -5, 31.25);
+ TESTIT (scalbln, -1000.0, -5, -31.25);
+
+ TESTIT4 (scalbln, 1);
+ TESTIT4 (scalbln, 2);
+ TESTIT4 (scalbln, 3);
+ TESTIT4 (scalbln, 5);
+ TESTIT4 (scalbln, 9);
+ TESTIT4 (scalbln, 10);
+ TESTIT4 (scalbln, 12);
+ TESTIT4 (scalbln, 18);
+ TESTIT4 (scalbln, 25);
+ TESTIT4 (scalbln, 50);
+ TESTIT4 (scalbln, 75);
+ TESTIT4 (scalbln, 100);
+ TESTIT4 (scalbln, 123);
+#endif
+}
+
+int main()
+{
+ foo (0, 0, 0, 0, 0);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-logb-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-logb-1.c
new file mode 100644
index 000000000..d759d1c6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-logb-1.c
@@ -0,0 +1,192 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Verify that built-in folding of logb, ilogb and significand is
+ correctly performed by the compiler.
+
+ Origin: Kaveh R. Ghazi, February 22, 2007. */
+
+/* { dg-do link } */
+/* { dg-options "-fno-finite-math-only" { target sh*-*-* } } */
+/* In order to fold algebraic exprs below, targets with "composite"
+ floating point formats need -funsafe-math-optimizations. */
+/* { dg-options "-funsafe-math-optimizations" { target powerpc*-*-* } } */
+
+extern void link_error(int);
+
+/* Return TRUE if the sign of X != sign of Y. This is important when
+ comparing signed zeros. */
+#define CKSGN_F(X,Y) \
+ (__builtin_copysignf(1.0F,(X)) != __builtin_copysignf(1.0F,(Y)))
+#define CKSGN(X,Y) \
+ (__builtin_copysign(1.0,(X)) != __builtin_copysign(1.0,(Y)))
+#define CKSGN_L(X,Y) \
+ (__builtin_copysignl(1.0L,(X)) != __builtin_copysignl(1.0L,(Y)))
+
+/* Test that FUNC(ARG) == RES. Check the sign in case we get -0.0. */
+#define TESTIT(FUNC,ARG,RES) do { \
+ if (__builtin_##FUNC##f(ARG##f) != RES##f \
+ || CKSGN_F(__builtin_##FUNC##f(ARG##f),RES##f)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG) != RES \
+ || CKSGN(__builtin_##FUNC(ARG),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG##l) != RES##l \
+ || CKSGN_L(__builtin_##FUNC##l(ARG##l),RES##l)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(ARG) == RES. RES is an int so it can't be -0.0. */
+#define TESTIT2(FUNC,ARG,RES) do { \
+ if (__builtin_##FUNC##f(ARG##f) != RES) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG) != RES) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG##l) != RES) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test if FUNCRES(FUNC(NEG FUNCARG(ARGARG))) is false. Check the
+ sign as well. */
+#ifndef __SPU__
+#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,FUNCRES,NEG2) do { \
+ if (!__builtin_##FUNCRES##f(__builtin_##FUNC(NEG __builtin_##FUNCARG##f(ARGARG))) \
+ || CKSGN_F(__builtin_##FUNC##f(NEG __builtin_##FUNCARG##f(ARGARG)), NEG2 __builtin_##FUNCARG##f(ARGARG))) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG))) \
+ || CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG)), NEG2 __builtin_##FUNCARG(ARGARG))) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES##l(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG))) \
+ || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG)), NEG2 __builtin_##FUNCARG##l(ARGARG))) \
+ link_error(__LINE__); \
+ } while (0)
+#else
+#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,FUNCRES,NEG2) do { \
+ /* SPU single-precision floating point format does not support Inf or Nan. */ \
+ if (!__builtin_##FUNCRES(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG))) \
+ || CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG)), NEG2 __builtin_##FUNCARG(ARGARG))) \
+ link_error(__LINE__); \
+ if (!__builtin_##FUNCRES##l(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG))) \
+ || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG)), NEG2 __builtin_##FUNCARG##l(ARGARG))) \
+ link_error(__LINE__); \
+ } while (0)
+#endif
+
+void __attribute__ ((__noinline__))
+foo(void)
+{
+ /* If radix == 2, test that logb(ARG2) -> ARG3. */
+#if __FLT_RADIX__ == 2
+ TESTIT (logb, -0x1p40, 40.0);
+ TESTIT (logb, -0x1p30, 30.0);
+ TESTIT (logb, -0x1p20, 20.0);
+ TESTIT (logb, -0x1p10, 10.0);
+ TESTIT (logb, -0x1p5, 5.0);
+ TESTIT (logb, -100/3.0, 5.0);
+ TESTIT (logb, -2.0, 1.0);
+ TESTIT (logb, -1.5, 0.0);
+ TESTIT (logb, -1.0, 0.0);
+ TESTIT (logb, -1/3.0, -2.0);
+ TESTIT (logb, -1/9.0, -4.0);
+ TESTIT (logb, -0x1p-5, -5.0);
+ TESTIT (logb, -0x1p-10, -10.0);
+ TESTIT (logb, -0x1p-20, -20.0);
+ TESTIT (logb, -0x1p-30, -30.0);
+ TESTIT (logb, -0x1p-40, -40.0);
+
+ TESTIT (logb, 0x1p-40, -40.0);
+ TESTIT (logb, 0x1p-30, -30.0);
+ TESTIT (logb, 0x1p-20, -20.0);
+ TESTIT (logb, 0x1p-10, -10.0);
+ TESTIT (logb, 0x1p-5, -5.0);
+ TESTIT (logb, 1/9.0, -4.0);
+ TESTIT (logb, 1/3.0, -2.0);
+ TESTIT (logb, 1.0, 0.0);
+ TESTIT (logb, 1.5, 0.0);
+ TESTIT (logb, 2.0, 1.0);
+ TESTIT (logb, 100/3.0, 5.0);
+ TESTIT (logb, 0x1p5, 5.0);
+ TESTIT (logb, 0x1p10, 10.0);
+ TESTIT (logb, 0x1p20, 20.0);
+ TESTIT (logb, 0x1p30, 30.0);
+ TESTIT (logb, 0x1p40, 40.0);
+#endif
+
+ /* If radix == 2, test that ilogb(ARG2) -> ARG3. */
+#if __FLT_RADIX__ == 2
+ TESTIT2 (ilogb, -0x1p40, 40);
+ TESTIT2 (ilogb, -0x1p30, 30);
+ TESTIT2 (ilogb, -0x1p20, 20);
+ TESTIT2 (ilogb, -0x1p10, 10);
+ TESTIT2 (ilogb, -0x1p5, 5);
+ TESTIT2 (ilogb, -100/3.0, 5);
+ TESTIT2 (ilogb, -2.0, 1);
+ TESTIT2 (ilogb, -1.5, 0);
+ TESTIT2 (ilogb, -1.0, 0);
+ TESTIT2 (ilogb, -1/3.0, -2);
+ TESTIT2 (ilogb, -1/9.0, -4);
+ TESTIT2 (ilogb, -0x1p-5, -5);
+ TESTIT2 (ilogb, -0x1p-10, -10);
+ TESTIT2 (ilogb, -0x1p-20, -20);
+ TESTIT2 (ilogb, -0x1p-30, -30);
+ TESTIT2 (ilogb, -0x1p-40, -40);
+
+ TESTIT2 (ilogb, 0x1p-40, -40);
+ TESTIT2 (ilogb, 0x1p-30, -30);
+ TESTIT2 (ilogb, 0x1p-20, -20);
+ TESTIT2 (ilogb, 0x1p-10, -10);
+ TESTIT2 (ilogb, 0x1p-5, -5);
+ TESTIT2 (ilogb, 1/9.0, -4);
+ TESTIT2 (ilogb, 1/3.0, -2);
+ TESTIT2 (ilogb, 1.0, 0);
+ TESTIT2 (ilogb, 1.5, 0);
+ TESTIT2 (ilogb, 2.0, 1);
+ TESTIT2 (ilogb, 100/3.0, 5);
+ TESTIT2 (ilogb, 0x1p5, 5);
+ TESTIT2 (ilogb, 0x1p10, 10);
+ TESTIT2 (ilogb, 0x1p20, 20);
+ TESTIT2 (ilogb, 0x1p30, 30);
+ TESTIT2 (ilogb, 0x1p40, 40);
+#endif
+
+ /* If radix == 2, test that significand(ARG2) -> ARG3. Zero always
+ folds regardless of the radix. */
+ TESTIT (significand, -0.0, -0.0);
+ TESTIT (significand, 0.0, 0.0);
+
+#if __FLT_RADIX__ == 2
+ TESTIT (significand, -0x1p5, -1.0);
+ TESTIT (significand, -100/3.0, -100/96.0);
+ TESTIT (significand, -1.5, -1.5);
+ TESTIT (significand, -1.0, -1.0);
+ TESTIT (significand, -1/3.0, -4/3.0);
+ TESTIT (significand, -1/9.0, -16/9.0);
+ TESTIT (significand, -0x1p-5, -1.0);
+
+ TESTIT (significand, 0x1p-5, 1.0);
+ TESTIT (significand, 1/9.0, 16/9.0);
+ TESTIT (significand, 1/3.0, 4/3.0);
+ TESTIT (significand, 1.0, 1.0);
+ TESTIT (significand, 1.5, 1.5);
+ TESTIT (significand, 100/3.0, 100/96.0);
+ TESTIT (significand, 0x1p5, 1.0);
+#endif
+
+ /* Test for f(+-Inf) -> +-Inf and f(+-NaN) -> +-NaN, regardless of
+ the radix. */
+ TESTIT3 (logb, ,inf, , isinf, );
+ TESTIT3 (logb, - ,inf, , isinf, );
+ TESTIT3 (logb, ,nan, "", isnan, );
+ TESTIT3 (logb, - ,nan, "", isnan, -);
+
+ TESTIT3 (significand, ,inf, , isinf, );
+ TESTIT3 (significand, - ,inf, , isinf, -);
+ TESTIT3 (significand, ,nan, "", isnan, );
+ TESTIT3 (significand, - ,nan, "", isnan, -);
+}
+
+int main()
+{
+ foo ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-1.c
new file mode 100644
index 000000000..d052f5347
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-1.c
@@ -0,0 +1,186 @@
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation.
+
+ Verify that built-in math function constant folding of constant
+ arguments is correctly performed by the compiler.
+
+ Written by Roger Sayle, 16th August 2002. */
+
+/* { dg-do link } */
+
+extern double atan (double);
+extern float atanf (float);
+extern long double atanl (long double);
+extern double cbrt (double);
+extern float cbrtf (float);
+extern long double cbrtl (long double);
+extern double cos (double);
+extern float cosf (float);
+extern long double cosl (long double);
+extern double exp (double);
+extern float expf (float);
+extern long double expl (long double);
+extern double log (double);
+extern float logf (float);
+extern long double logl (long double);
+extern double pow (double, double);
+extern float powf (float, float);
+extern long double powl (long double, long double);
+extern double sin (double);
+extern float sinf (float);
+extern long double sinl (long double);
+extern double sqrt (double);
+extern float sqrtf (float);
+extern long double sqrtl (long double);
+extern double tan (double);
+extern float tanf (float);
+extern long double tanl (long double);
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(void);
+
+void test (float f, double d, long double ld)
+{
+ if (sqrt (0.0) != 0.0)
+ link_error ();
+
+ if (sqrt (1.0) != 1.0)
+ link_error ();
+
+ if (cbrt (0.0) != 0.0)
+ link_error ();
+
+ if (cbrt (1.0) != 1.0)
+ link_error ();
+
+ if (cbrt (-1.0) != -1.0)
+ link_error ();
+
+ if (exp (0.0) != 1.0)
+ link_error ();
+
+ if (exp (1.0) <= 2.71 || exp (1.0) >= 2.72)
+ link_error ();
+
+ if (log (1.0) != 0.0)
+ link_error ();
+
+ if (sin (0.0) != 0.0)
+ link_error ();
+
+ if (cos (0.0) != 1.0)
+ link_error ();
+
+ if (tan (0.0) != 0.0)
+ link_error ();
+
+ if (atan (0.0) != 0.0)
+ link_error ();
+
+ if (4.0*atan (1.0) <= 3.14 || 4.0*atan (1.0) >= 3.15)
+ link_error ();
+
+ if (pow (d, 0.0) != 1.0)
+ link_error ();
+
+ if (pow (1.0, d) != 1.0)
+ link_error ();
+
+
+ if (sqrtf (0.0F) != 0.0F)
+ link_error ();
+
+ if (sqrtf (1.0F) != 1.0F)
+ link_error ();
+
+ if (cbrtf (0.0F) != 0.0F)
+ link_error ();
+
+ if (cbrtf (1.0F) != 1.0F)
+ link_error ();
+
+ if (cbrtf (-1.0F) != -1.0F)
+ link_error ();
+
+ if (expf (0.0F) != 1.0F)
+ link_error ();
+
+ if (expf (1.0F) <= 2.71F || expf (1.0F) >= 2.72F)
+ link_error ();
+
+ if (logf (1.0F) != 0.0F)
+ link_error ();
+
+ if (sinf (0.0F) != 0.0F)
+ link_error ();
+
+ if (cosf (0.0F) != 1.0F)
+ link_error ();
+
+ if (tanf (0.0F) != 0.0F)
+ link_error ();
+
+ if (atanf (0.0F) != 0.0F)
+ link_error ();
+
+ if (4.0F*atanf (1.0F) <= 3.14F || 4.0F*atanf (1.0F) >= 3.15F)
+ link_error ();
+
+ if (powf (f, 0.0F) != 1.0F)
+ link_error ();
+
+ if (powf (1.0F, f) != 1.0F)
+ link_error ();
+
+
+ if (sqrtl (0.0L) != 0.0L)
+ link_error ();
+
+ if (sqrtl (1.0L) != 1.0L)
+ link_error ();
+
+ if (cbrtl (0.0L) != 0.0L)
+ link_error ();
+
+ if (cbrtl (1.0L) != 1.0L)
+ link_error ();
+
+ if (cbrtl (-1.0L) != -1.0L)
+ link_error ();
+
+ if (expl (0.0L) != 1.0L)
+ link_error ();
+
+ if (expl (1.0L) <= 2.71L || expl (1.0L) >= 2.72L)
+ link_error ();
+
+ if (logl (1.0L) != 0.0L)
+ link_error ();
+
+ if (sinl (0.0L) != 0.0L)
+ link_error ();
+
+ if (cosl (0.0L) != 1.0L)
+ link_error ();
+
+ if (tanl (0.0L) != 0.0L)
+ link_error ();
+
+ if (atanl (0.0) != 0.0L)
+ link_error ();
+
+ if (4.0L*atanl (1.0L) <= 3.14L || 4.0L*atanl (1.0L) >= 3.15L)
+ link_error ();
+
+ if (powl (ld, 0.0L) != 1.0L)
+ link_error ();
+
+ if (powl (1.0L, ld) != 1.0L)
+ link_error ();
+}
+
+int main()
+{
+ test (3.0, 3.0F, 3.0L);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-2.c
new file mode 100644
index 000000000..7e2ff1383
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-2.c
@@ -0,0 +1,385 @@
+/* Copyright (C) 2006, 2007 Free Software Foundation.
+
+ Test things that should block GCC from optimizing compile-time
+ constants passed to a builtin transcendental function.
+
+ Origin: Kaveh R. Ghazi, October 22, 2006. */
+
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+extern void foof (float);
+extern void foo (double);
+extern void fool (long double);
+
+#define TESTIT(FUNC, ARG) do { \
+ foof (__builtin_##FUNC##f (ARG##F)); \
+ foo (__builtin_##FUNC (ARG)); \
+ fool (__builtin_##FUNC##l (ARG##L)); \
+} while (0)
+
+#define TESTIT2(FUNC, ARG1, ARG2) do { \
+ foof (__builtin_##FUNC##f (ARG1##F, ARG2##F)); \
+ foo (__builtin_##FUNC (ARG1, ARG2)); \
+ fool (__builtin_##FUNC##l (ARG1##L, ARG2##L)); \
+} while (0)
+
+#define TESTIT2_I1(FUNC, ARG1, ARG2) do { \
+ foof (__builtin_##FUNC##f (ARG1, ARG2##F)); \
+ foo (__builtin_##FUNC (ARG1, ARG2)); \
+ fool (__builtin_##FUNC##l (ARG1, ARG2##L)); \
+} while (0)
+
+#define TESTIT2_I2ALL(FUNC, ARGF, MAXF, ARGD, MAXD, ARGLD, MAXLD) do { \
+ foof (__builtin_##FUNC##f (ARGF, MAXF)); \
+ foo (__builtin_##FUNC (ARGD, MAXD)); \
+ fool (__builtin_##FUNC##l (ARGLD, MAXLD)); \
+} while (0)
+
+#define TESTIT2_I2(FUNC, ARG1, ARG2) do { \
+ foof (__builtin_##FUNC##f (ARG1##F, ARG2)); \
+ foo (__builtin_##FUNC (ARG1, ARG2)); \
+ fool (__builtin_##FUNC##l (ARG1##L, ARG2)); \
+} while (0)
+
+#define TESTIT_REMQUO(ARG1, ARG2) do { \
+ int quo; \
+ foof (__builtin_remquof (ARG1##F, ARG2##F, &quo)); \
+ foo (__builtin_remquo (ARG1, ARG2, &quo)); \
+ fool (__builtin_remquol (ARG1##L, ARG2##L, &quo)); \
+} while (0)
+
+#define TESTIT_REENT(FUNC,ARG1) do { \
+ int sg; \
+ foof (__builtin_##FUNC##f_r (ARG1##F, &sg)); \
+ foo (__builtin_##FUNC##_r (ARG1, &sg)); \
+ fool (__builtin_##FUNC##l_r (ARG1##L, &sg)); \
+} while (0)
+
+void bar()
+{
+ /* An argument of NaN is not evaluated at compile-time. */
+#ifndef __SPU__
+ foof (__builtin_exp2f (__builtin_nanf("")));
+#endif
+ foo (__builtin_exp2 (__builtin_nan("")));
+ fool (__builtin_exp2l (__builtin_nanl("")));
+
+ /* An argument of Inf/-Inf is not evaluated at compile-time. */
+#ifndef __SPU__
+ foof (__builtin_exp2f (__builtin_inff()));
+#endif
+ foo (__builtin_exp2 (__builtin_inf()));
+ fool (__builtin_exp2l (__builtin_infl()));
+#ifndef __SPU__
+ foof (__builtin_exp2f (-__builtin_inff()));
+#endif
+ foo (__builtin_exp2 (-__builtin_inf()));
+ fool (__builtin_exp2l (-__builtin_infl()));
+
+ /* Result overflows MPFR, which in version 2.2.x has 30 exponent bits. */
+ TESTIT (exp2, 0x1p50);
+ /* Result underflows MPFR, which in version 2.2.x has 30 exponent bits. */
+ TESTIT (exp2, -0x1p50);
+
+ /* Result overflows GCC's REAL_VALUE_TYPE, which has 26 exponent bits. */
+ TESTIT (exp2, 0x1p28);
+ /* Result underflows GCC's REAL_VALUE_TYPE, which has 26 exponent bits. */
+ TESTIT (exp2, -0x1p28);
+
+ /* Result overflows (even an extended) C double's mode. */
+ TESTIT (exp2, 0x1p24);
+ /* Result underflows (even an extended) C double's mode. */
+ TESTIT (exp2, -0x1p24);
+
+ /* Ensure that normal arguments/results are folded. */
+ TESTIT (exp2, 1.5);
+ TESTIT (exp2, -1.5);
+
+ /* The asin arg must be [-1 ... 1] inclusive. */
+ TESTIT (asin, -1.5);
+ TESTIT (asin, 1.5);
+
+ /* The acos arg must be [-1 ... 1] inclusive. */
+ TESTIT (acos, -1.5);
+ TESTIT (acos, 1.5);
+
+ /* The acosh arg must be [1 ... Inf] inclusive. */
+ TESTIT (acosh, 0.5);
+
+ /* The atanh arg must be [-1 ... 1] EXclusive. */
+ TESTIT (atanh, -1.0);
+ TESTIT (atanh, 1.0);
+
+ /* The log* arg must be [0 ... Inf] EXclusive. */
+ TESTIT (log, -1.0);
+ TESTIT (log, 0.0);
+ TESTIT (log, -0.0);
+
+ TESTIT (log2, -1.0);
+ TESTIT (log2, 0.0);
+ TESTIT (log2, -0.0);
+
+ TESTIT (log10, -1.0);
+ TESTIT (log10, 0.0);
+ TESTIT (log10, -0.0);
+
+ /* The log1p arg must be [-1 ... Inf] EXclusive. */
+ TESTIT (log1p, -2.0);
+ TESTIT (log1p, -1.0);
+
+ /* The tgamma arg errors with zero or negative integers. */
+ TESTIT (tgamma, 0.0);
+ TESTIT (tgamma, -0.0);
+ TESTIT (tgamma, -1.0);
+ TESTIT (tgamma, -2.0);
+ TESTIT (tgamma, -3.0);
+
+ /* An argument of NaN is not evaluated at compile-time. */
+#ifndef __SPU__
+ foof (__builtin_powf (__builtin_nanf(""), 2.5F));
+#endif
+ foo (__builtin_pow (__builtin_nan(""), 2.5));
+ fool (__builtin_powl (__builtin_nanl(""), 2.5L));
+#ifndef __SPU__
+ foof (__builtin_powf (2.5F, __builtin_nanf("")));
+#endif
+ foo (__builtin_pow (2.5, __builtin_nan("")));
+ fool (__builtin_powl (2.5L, __builtin_nanl("")));
+
+ /* An argument of Inf/-Inf is not evaluated at compile-time. */
+#ifndef __SPU__
+ foof (__builtin_powf (__builtin_inff(), 2.5F));
+#endif
+ foo (__builtin_pow (__builtin_inf(), 2.5));
+ fool (__builtin_powl (__builtin_infl(), 2.5L));
+#ifndef __SPU__
+ foof (__builtin_powf (-__builtin_inff(), 2.5F));
+#endif
+ foo (__builtin_pow (-__builtin_inf(), 2.5));
+ fool (__builtin_powl (-__builtin_infl(), 2.5L));
+#ifndef __SPU__
+ foof (__builtin_powf (2.5F, __builtin_inff()));
+#endif
+ foo (__builtin_pow (2.5, __builtin_inf()));
+ fool (__builtin_powl (2.5L, __builtin_infl()));
+#ifndef __SPU__
+ foof (__builtin_powf (2.5F, -__builtin_inff()));
+#endif
+ foo (__builtin_pow (2.5, -__builtin_inf()));
+ fool (__builtin_powl (2.5L, -__builtin_infl()));
+
+ /* Check for Inv/NaN return values. */
+ TESTIT2 (pow, -0.0, -4.5); /* Returns Inf */
+ TESTIT2 (pow, 0.0, -4.5); /* Returns Inf */
+ TESTIT2 (pow, -3.0, -4.5); /* Returns NaN */
+
+ /* Check for overflow/underflow. */
+ foof (__builtin_powf (__FLT_MAX__, 3.5F));
+ foo (__builtin_pow (__DBL_MAX__, 3.5));
+ fool (__builtin_powl (__LDBL_MAX__, 3.5L));
+ TESTIT2 (pow, 2.0, 0x1p50);
+ foof (__builtin_powf (__FLT_MAX__, -3.5F));
+ foo (__builtin_pow (__DBL_MAX__, -3.5));
+ fool (__builtin_powl (__LDBL_MAX__, -3.5L));
+ TESTIT2 (pow, 2.0, -0x1p50);
+
+ /* The sqrt arg must be [0 ... Inf] inclusive. */
+ TESTIT (sqrt, -0.5);
+ TESTIT (sqrt, -0.0);
+ TESTIT (sqrt, 0.0);
+
+ /* Check for overflow/underflow. */
+
+ /* These adjustments are too big. */
+#define FLT_EXP_ADJ (2*(__FLT_MAX_EXP__-__FLT_MIN_EXP__)+1)
+#define DBL_EXP_ADJ (2*(__DBL_MAX_EXP__-__DBL_MIN_EXP__)+1)
+#define LDBL_EXP_ADJ (2*(__LDBL_MAX_EXP__-__LDBL_MIN_EXP__)+1)
+
+ TESTIT2_I2 (ldexp, 1.0, __INT_MAX__);
+ TESTIT2_I2 (ldexp, 1.0, -__INT_MAX__-1);
+ TESTIT2_I2 (ldexp, -1.0, __INT_MAX__);
+ TESTIT2_I2 (ldexp, -1.0, -__INT_MAX__-1);
+ TESTIT2_I2ALL (ldexp, __FLT_MIN__, FLT_EXP_ADJ, __DBL_MIN__,
+ DBL_EXP_ADJ, __LDBL_MIN__, LDBL_EXP_ADJ);
+ TESTIT2_I2ALL (ldexp, __FLT_MAX__, -FLT_EXP_ADJ, __DBL_MAX__,
+ -DBL_EXP_ADJ, __LDBL_MAX__, -LDBL_EXP_ADJ);
+ TESTIT2_I2ALL (ldexp, __FLT_MIN__, __FLT_MIN_EXP__, __DBL_MIN__,
+ __DBL_MIN_EXP__, __LDBL_MIN__, __LDBL_MIN_EXP__);
+ TESTIT2_I2ALL (ldexp, __FLT_MAX__, __FLT_MAX_EXP__, __DBL_MAX__,
+ __DBL_MAX_EXP__, __LDBL_MAX__, __LDBL_MAX_EXP__);
+
+ TESTIT2_I2 (scalbn, 1.0, __INT_MAX__);
+ TESTIT2_I2 (scalbn, 1.0, -__INT_MAX__-1);
+ TESTIT2_I2 (scalbn, -1.0, __INT_MAX__);
+ TESTIT2_I2 (scalbn, -1.0, -__INT_MAX__-1);
+ TESTIT2_I2ALL (scalbn, __FLT_MIN__, FLT_EXP_ADJ, __DBL_MIN__,
+ DBL_EXP_ADJ, __LDBL_MIN__, LDBL_EXP_ADJ);
+ TESTIT2_I2ALL (scalbn, __FLT_MAX__, -FLT_EXP_ADJ, __DBL_MAX__,
+ -DBL_EXP_ADJ, __LDBL_MAX__, -LDBL_EXP_ADJ);
+ TESTIT2_I2ALL (scalbn, __FLT_MIN__, __FLT_MIN_EXP__, __DBL_MIN__,
+ __DBL_MIN_EXP__, __LDBL_MIN__, __LDBL_MIN_EXP__);
+ TESTIT2_I2ALL (scalbn, __FLT_MAX__, __FLT_MAX_EXP__, __DBL_MAX__,
+ __DBL_MAX_EXP__, __LDBL_MAX__, __LDBL_MAX_EXP__);
+
+ TESTIT2_I2 (scalbln, 1.0, __LONG_MAX__);
+ TESTIT2_I2 (scalbln, 1.0, -__LONG_MAX__-1);
+ TESTIT2_I2 (scalbln, -1.0, __LONG_MAX__);
+ TESTIT2_I2 (scalbln, -1.0, -__LONG_MAX__-1);
+ TESTIT2_I2ALL (scalbln, __FLT_MIN__, FLT_EXP_ADJ, __DBL_MIN__,
+ DBL_EXP_ADJ, __LDBL_MIN__, LDBL_EXP_ADJ);
+ TESTIT2_I2ALL (scalbln, __FLT_MAX__, -FLT_EXP_ADJ, __DBL_MAX__,
+ -DBL_EXP_ADJ, __LDBL_MAX__, -LDBL_EXP_ADJ);
+ TESTIT2_I2ALL (scalbln, __FLT_MIN__, __FLT_MIN_EXP__, __DBL_MIN__,
+ __DBL_MIN_EXP__, __LDBL_MIN__, __LDBL_MIN_EXP__);
+ TESTIT2_I2ALL (scalbln, __FLT_MAX__, __FLT_MAX_EXP__, __DBL_MAX__,
+ __DBL_MAX_EXP__, __LDBL_MAX__, __LDBL_MAX_EXP__);
+
+ TESTIT (logb, 0.0);
+ TESTIT (logb, -0.0);
+
+ TESTIT (ilogb, 0.0);
+ TESTIT (ilogb, -0.0);
+
+#ifndef __SPU__
+ foof (__builtin_ilogbf (__builtin_inff()));
+#endif
+ foo (__builtin_ilogb (__builtin_inf()));
+ fool (__builtin_ilogbl (__builtin_infl()));
+#ifndef __SPU__
+ foof (__builtin_ilogbf (-__builtin_inff()));
+#endif
+ foo (__builtin_ilogb (-__builtin_inf()));
+ fool (__builtin_ilogbl (-__builtin_infl()));
+
+#ifndef __SPU__
+ foof (__builtin_ilogbf (__builtin_nanf("")));
+#endif
+ foo (__builtin_ilogb (__builtin_nan("")));
+ fool (__builtin_ilogbl (__builtin_nanl("")));
+#ifndef __SPU__
+ foof (__builtin_ilogbf (-__builtin_nanf("")));
+#endif
+ foo (__builtin_ilogb (-__builtin_nan("")));
+ fool (__builtin_ilogbl (-__builtin_nanl("")));
+
+ /* The y* arg must be [0 ... Inf] EXclusive. */
+ TESTIT (y0, -1.0);
+ TESTIT (y0, 0.0);
+ TESTIT (y0, -0.0);
+
+ TESTIT (y1, -1.0);
+ TESTIT (y1, 0.0);
+ TESTIT (y1, -0.0);
+
+ TESTIT2_I1 (yn, 2, -1.0);
+ TESTIT2_I1 (yn, 2, 0.0);
+ TESTIT2_I1 (yn, 2, -0.0);
+
+ TESTIT2_I1 (yn, -3, -1.0);
+ TESTIT2_I1 (yn, -3, 0.0);
+ TESTIT2_I1 (yn, -3, -0.0);
+
+ /* The second argument of remquo/remainder/drem must not be 0. */
+ TESTIT_REMQUO (1.0, 0.0);
+ TESTIT_REMQUO (1.0, -0.0);
+ TESTIT2 (remainder, 1.0, 0.0);
+ TESTIT2 (remainder, 1.0, -0.0);
+ TESTIT2 (drem, 1.0, 0.0);
+ TESTIT2 (drem, 1.0, -0.0);
+
+ /* The argument to lgamma* cannot be zero or a negative integer. */
+ TESTIT_REENT (lgamma, -4.0); /* lgamma_r */
+ TESTIT_REENT (lgamma, -3.0); /* lgamma_r */
+ TESTIT_REENT (lgamma, -2.0); /* lgamma_r */
+ TESTIT_REENT (lgamma, -1.0); /* lgamma_r */
+ TESTIT_REENT (lgamma, -0.0); /* lgamma_r */
+ TESTIT_REENT (lgamma, 0.0); /* lgamma_r */
+
+ TESTIT_REENT (gamma, -4.0); /* gamma_r */
+ TESTIT_REENT (gamma, -3.0); /* gamma_r */
+ TESTIT_REENT (gamma, -2.0); /* gamma_r */
+ TESTIT_REENT (gamma, -1.0); /* gamma_r */
+ TESTIT_REENT (gamma, -0.0); /* gamma_r */
+ TESTIT_REENT (gamma, 0.0); /* gamma_r */
+}
+
+/* { dg-final { scan-tree-dump-times "exp2 " 9 "original" } } */
+/* { dg-final { scan-tree-dump-times "exp2f" 9 "original" { target { ! { spu*-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "exp2f" 6 "original" { target { spu*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "exp2l" 9 "original" } } */
+/* { dg-final { scan-tree-dump-times "asin " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "asinf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "asinl" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "acos " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "acosf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "acosl" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "acosh " 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "acoshf" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "acoshl" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "atanh " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "atanhf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "atanhl" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "log " 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "logf" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "logl" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "log2 " 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "log2f" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "log2l" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "log10 " 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "log10f" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "log10l" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "log1p " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "log1pf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "log1pl" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "tgamma " 5 "original" } } */
+/* { dg-final { scan-tree-dump-times "tgammaf" 5 "original" } } */
+/* { dg-final { scan-tree-dump-times "tgammal" 5 "original" } } */
+/* { dg-final { scan-tree-dump-times "pow " 13 "original" } } */
+/* { dg-final { scan-tree-dump-times "powf" 13 "original" { target { ! { spu*-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "powf" 7 "original" { target { spu*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "powl" 13 "original" } } */
+/* { dg-final { scan-tree-dump-times "sqrt " 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "sqrtf" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "sqrtl" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "ldexp " 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "ldexpf" 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "ldexpl" 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "scalbn " 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "scalbnf" 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "scalbnl" 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "scalbln " 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "scalblnf" 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "scalblnl" 8 "original" } } */
+/* { dg-final { scan-tree-dump-times "_logb " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "_logbf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "_logbl" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "ilogb " 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "ilogbf" 6 "original" { target { ! { spu*-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "ilogbf" 2 "original" { target { spu*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "ilogbl" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "y0 " 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y0f" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y0l" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y1 " 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y1f" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "y1l" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "yn " 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "ynf" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "ynl" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "remquo " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remquof" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remquol" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remainder " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remainderf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "remainderl" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "drem " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "dremf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "dreml" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "lgamma_r " 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "lgammaf_r" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "lgammal_r" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "_gamma_r " 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "_gammaf_r" 6 "original" } } */
+/* { dg-final { scan-tree-dump-times "_gammal_r" 6 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-3.c
new file mode 100644
index 000000000..896edccaa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-3.c
@@ -0,0 +1,374 @@
+/* Copyright (C) 2006 Free Software Foundation.
+
+ Verify that built-in math function constant folding of constant
+ arguments is correctly performed by the compiler.
+
+ Origin: Kaveh R. Ghazi, October 23, 2006. */
+
+/* { dg-do link } */
+
+/* Define "e" with as many bits as found in builtins.c:dconste. */
+#define M_E 2.7182818284590452353602874713526624977572470936999595749669676277241
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(int);
+
+/* Return TRUE if the sign of X != sign of Y. This is important when
+ comparing signed zeros. */
+#define CKSGN_F(X,Y) \
+ (__builtin_copysignf(1.0F,(X)) != __builtin_copysignf(1.0F,(Y)))
+#define CKSGN(X,Y) \
+ (__builtin_copysign(1.0,(X)) != __builtin_copysign(1.0,(Y)))
+#define CKSGN_L(X,Y) \
+ (__builtin_copysignl(1.0L,(X)) != __builtin_copysignl(1.0L,(Y)))
+
+/* Test that FUNC(ARG) == (RES). */
+#define TESTIT(FUNC,ARG,RES) do { \
+ if (__builtin_##FUNC##f(ARG##F) != RES##F \
+ || CKSGN_F(__builtin_##FUNC##f(ARG##F),RES##F)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG) != RES \
+ || CKSGN(__builtin_##FUNC(ARG),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG##L) != RES##L \
+ || CKSGN_L(__builtin_##FUNC##l(ARG##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Range test, check that (LOW) < FUNC(ARG) < (HI). */
+#define TESTIT_R(FUNC,ARG,LOW,HI) do { \
+ if (__builtin_##FUNC##f(ARG) <= (LOW) || __builtin_##FUNC##f(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG) <= (LOW) || __builtin_##FUNC(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG) <= (LOW) || __builtin_##FUNC##l(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(ARG1, ARG2) == (RES). */
+#define TESTIT2(FUNC,ARG1,ARG2,RES) do { \
+ if (__builtin_##FUNC##f(ARG1##F, ARG2##F) != RES##F \
+ || CKSGN_F(__builtin_##FUNC##f(ARG1##F,ARG2##F),RES##F)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG1, ARG2) != RES \
+ || CKSGN(__builtin_##FUNC(ARG1,ARG2),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG1##L, ARG2##L) != RES##L \
+ || CKSGN_L(__builtin_##FUNC##l(ARG1##L,ARG2##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Range test, check that (LOW) < FUNC(ARG1,ARG2) < (HI). */
+#define TESTIT2_R(FUNC,ARG1,ARG2,LOW,HI) do { \
+ if (__builtin_##FUNC##f(ARG1, ARG2) <= (LOW) \
+ || __builtin_##FUNC##f(ARG1, ARG2) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG1, ARG2) <= (LOW) \
+ || __builtin_##FUNC(ARG1, ARG2) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG1, ARG2) <= (LOW) \
+ || __builtin_##FUNC##l(ARG1, ARG2) >= (HI)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(ARG1, ARG2, ARG3) == (RES). */
+#define TESTIT3(FUNC,ARG1,ARG2,ARG3,RES) do { \
+ if (__builtin_##FUNC##f(ARG1##F, ARG2##F, ARG3##F) != RES##F \
+ || CKSGN_F(__builtin_##FUNC##f(ARG1##F,ARG2##F,ARG3##F),RES##F)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG1, ARG2, ARG3) != RES \
+ || CKSGN(__builtin_##FUNC(ARG1,ARG2,ARG3),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG1##L, ARG2##L, ARG3##L) != RES##L \
+ || CKSGN_L(__builtin_##FUNC##l(ARG1##L,ARG2##L,ARG3##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that for FUNC(ARG, &ARG_S, &ARG_C);
+ assert (ARG_S == RES_S && ARG_C == RES_C);. */
+#define TESTIT_2P(FUNC,ARG,ARG_S,ARG_C,RES_S,RES_C) do { \
+ __builtin_##FUNC##f(ARG##F, &ARG_S##f, &ARG_C##f); \
+ if (ARG_S##f != (RES_S##F) || ARG_C##f != (RES_C##F)) \
+ link_error(__LINE__); \
+ __builtin_##FUNC(ARG, &ARG_S, &ARG_C); \
+ if (ARG_S != (RES_S) || ARG_C != (RES_C)) \
+ link_error(__LINE__); \
+ __builtin_##FUNC##l(ARG##L, &ARG_S##l, &ARG_C##l); \
+ if (ARG_S##l != (RES_S##L) || ARG_C##l != (RES_C##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that for FUNC(ARG, &ARG_S, &ARG_C);
+ assert (LOW_S < ARG_S < HI_S && LOW_C < ARG_C < HI_C);. */
+#define TESTIT_2P_R(FUNC,ARG,ARG_S,ARG_C,LOW_S,HI_S,LOW_C,HI_C) do { \
+ __builtin_##FUNC##f(ARG##F, &ARG_S##f, &ARG_C##f); \
+ if (ARG_S##f <= (LOW_S##F) || ARG_S##f >= (HI_S##F) \
+ || ARG_C##f <= (LOW_C##F) || ARG_C##f >= (HI_C##F)) \
+ link_error(__LINE__); \
+ __builtin_##FUNC(ARG, &ARG_S, &ARG_C); \
+ if (ARG_S <= (LOW_S) || ARG_S >= (HI_S) \
+ || ARG_C <= (LOW_C) || ARG_C >= (HI_C)) \
+ link_error(__LINE__); \
+ __builtin_##FUNC##l(ARG##L, &ARG_S##l, &ARG_C##l); \
+ if (ARG_S##l <= (LOW_S##L) || ARG_S##l >= (HI_S##L) \
+ || ARG_C##l <= (LOW_C##L) || ARG_C##l >= (HI_C##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+int main (void)
+{
+#ifdef __OPTIMIZE__
+ float sf, cf, oneF = 1.0F;
+ double s, c, one = 1.0;
+ long double sl, cl, oneL = 1.0L;
+#endif
+
+ TESTIT_R (asin, -1.0, -3.15/2.0, -3.14/2.0); /* asin(-1) == -pi/2 */
+ TESTIT (asin, 0.0, 0.0); /* asin(0) == 0 */
+ TESTIT (asin, -0.0, -0.0); /* asin(-0) == -0 */
+ TESTIT_R (asin, 1.0, 3.14/2.0, 3.15/2.0); /* asin(1) == pi/2 */
+
+ TESTIT_R (acos, -1.0, 3.14, 3.15); /* acos(-1) == pi */
+ TESTIT_R (acos, 0.0, 3.14/2.0, 3.15/2.0); /* acos(0) == pi/2 */
+ TESTIT_R (acos, -0.0, 3.14/2.0, 3.15/2.0); /* acos(-0) == pi/2 */
+ TESTIT (acos, 1.0, 0.0); /* acos(1) == 0 */
+
+ TESTIT_R (atan, -1.0, -3.15/4.0, -3.14/4.0); /* atan(-1) == -pi/4 */
+ TESTIT (atan, 0.0, 0.0); /* atan(0) == 0 */
+ TESTIT (atan, -0.0, -0.0); /* atan(-0) == -0 */
+ TESTIT_R (atan, 1.0, 3.14/4.0, 3.15/4.0); /* atan(1) == pi/4 */
+
+ TESTIT_R (asinh, -1.0, -0.89, -0.88); /* asinh(-1) == -0.881... */
+ TESTIT (asinh, 0.0, 0.0); /* asinh(0) == 0 */
+ TESTIT (asinh, -0.0, -0.0); /* asinh(-0) == -0 */
+ TESTIT_R (asinh, 1.0, 0.88, 0.89); /* asinh(1) == 0.881... */
+
+ TESTIT (acosh, 1.0, 0.0); /* acosh(1) == 0. */
+ TESTIT_R (acosh, 2.0, 1.31, 1.32); /* acosh(2) == 1.316... */
+
+ TESTIT_R (atanh, -0.5, -0.55, -0.54); /* atanh(-0.5) == -0.549... */
+ TESTIT (atanh, 0.0, 0.0); /* atanh(0) == 0 */
+ TESTIT (atanh, -0.0, -0.0); /* atanh(-0) == -0 */
+ TESTIT_R (atanh, 0.5, 0.54, 0.55); /* atanh(0.5) == 0.549... */
+
+ TESTIT_R (sin, -1.0, -0.85, -0.84); /* sin(-1) == -0.841... */
+ TESTIT (sin, 0.0, 0.0); /* sin(0) == 0 */
+ TESTIT (sin, -0.0, -0.0); /* sin(-0) == -0 */
+ TESTIT_R (sin, 1.0, 0.84, 0.85); /* sin(1) == 0.841... */
+
+ TESTIT_R (cos, -1.0, 0.54, 0.55); /* cos(-1) == 0.5403... */
+ TESTIT (cos, 0.0, 1.0); /* cos(0) == 1 */
+ TESTIT (cos, -0.0, 1.0); /* cos(-0) == 1 */
+ TESTIT_R (cos, 1.0, 0.54, 0.55); /* cos(1) == 0.5403... */
+
+ TESTIT_R (tan, -1.0, -1.56, 1.55); /* tan(-1) == -1.557... */
+ TESTIT (tan, 0.0, 0.0); /* tan(0) == 0 */
+ TESTIT (tan, -0.0, -0.0); /* tan(-0) == -0 */
+ TESTIT_R (tan, 1.0, 1.55, 1.56); /* tan(1) == 1.557... */
+
+#ifdef __OPTIMIZE__
+ /* These tests rely on propagating the variables s, c and one, which
+ happens only when optimization is turned on. */
+ TESTIT_2P_R (sincos, -1.0, s, c, -0.85, -0.84, 0.54, 0.55); /* (s==-0.841..., c==0.5403...) */
+ TESTIT_2P (sincos, 0.0, s, c, 0.0, 1.0); /* (s==0, c==1) */
+ TESTIT_2P (sincos, -0.0, s, c, -0.0, 1.0); /* (s==-0, c==1) */
+ TESTIT_2P_R (sincos, 1.0, s, c, 0.84, 0.85, 0.54, 0.55); /* (s==0.841..., c==0.5403...) */
+ TESTIT_2P_R (sincos, one, s, c, 0.84, 0.85, 0.54, 0.55); /* (s==0.841..., c==0.5403...) */
+ TESTIT_2P_R (sincos, -one, s, c, -0.85, -0.84, 0.54, 0.55); /* (s==-0.841..., c==0.5403...) */
+#endif
+
+ TESTIT_R (sinh, -1.0, -1.18, -1.17); /* sinh(-1) == -1.175... */
+ TESTIT (sinh, 0.0, 0.0); /* sinh(0) == 0 */
+ TESTIT (sinh, -0.0, -0.0); /* sinh(-0) == -0 */
+ TESTIT_R (sinh, 1.0, 1.17, 1.18); /* sinh(1) == 1.175... */
+
+ TESTIT_R (cosh, -1.0, 1.54, 1.55); /* cosh(-1) == 1.543... */
+ TESTIT (cosh, 0.0, 1.0); /* cosh(0) == 1 */
+ TESTIT (cosh, -0.0, 1.0); /* cosh(-0) == 1 */
+ TESTIT_R (cosh, 1.0, 1.54, 1.55); /* cosh(1) == 1.543... */
+
+ TESTIT_R (tanh, -1.0, -0.77, -0.76); /* tanh(-1) == -0.761... */
+ TESTIT (tanh, -0.0, -0.0); /* tanh(-0) == -0 */
+ TESTIT (tanh, 0.0, 0.0); /* tanh(0) == 0 */
+ TESTIT_R (tanh, 1.0, 0.76, 0.77); /* tanh(1) == 0.761... */
+
+ TESTIT_R (exp, -1.0, 0.36, 0.37); /* exp(-1) == 1/e */
+ TESTIT (exp, -0.0, 1.0); /* exp(-0) == 1 */
+ TESTIT (exp, 0.0, 1.0); /* exp(0) == 1 */
+ TESTIT_R (exp, 1.0, 2.71, 2.72); /* exp(1) == e */
+
+ TESTIT (exp2, -1.0, 0.5); /* exp2(-1) == 1/2 */
+ TESTIT (exp2, -0.0, 1.0); /* exp2(-0) == 1 */
+ TESTIT (exp2, 0.0, 1.0); /* exp2(0) == 1 */
+ TESTIT (exp2, 1.0, 2.0); /* exp2(1) == 2 */
+
+ TESTIT (exp10, -1.0, 0.1); /* exp10(-1) == 1/10 */
+ TESTIT (exp10, -0.0, 1.0); /* exp10(-0) == 1 */
+ TESTIT (exp10, 0.0, 1.0); /* exp10(0) == 1 */
+ TESTIT (exp10, 1.0, 10.0); /* exp10(1) == 10 */
+
+ TESTIT (pow10, -1.0, 0.1); /* pow10(-1) == 1/10 */
+ TESTIT (pow10, -0.0, 1.0); /* pow10(-0) == 1 */
+ TESTIT (pow10, 0.0, 1.0); /* pow10(0) == 1 */
+ TESTIT (pow10, 1.0, 10.0); /* pow10(1) == 10 */
+
+ TESTIT_R (expm1, -1.0, -0.64, -0.63); /* expm1(-1) == 1/e - 1 */
+ TESTIT (expm1, -0.0, -0.0); /* expm1(-0) == 0 */
+ TESTIT (expm1, 0.0, 0.0); /* expm1(0) == 0 */
+ TESTIT_R (expm1, 1.0, 1.71, 1.72); /* expm1(1) == e - 1 */
+
+ TESTIT (log, 1.0, 0.0); /* log(1) == 0 */
+ TESTIT_R (log, M_E, 0.99, 1.01); /* log(e) == 1.000... */
+ TESTIT_R (log, M_E*M_E, 1.99, 2.01); /* log(e*e) == 2.000... */
+
+ TESTIT (log2, 1.0, 0.0); /* log2(1) == 0 */
+ TESTIT (log2, 2.0, 1.0); /* log2(2) == 1 */
+ TESTIT (log2, 4.0, 2.0); /* log2(4) == 2 */
+
+ TESTIT (log10, 1.0, 0.0); /* log10(1) == 0 */
+ TESTIT (log10, 10.0, 1.0); /* log10(10) == 1 */
+ TESTIT (log10, 100.0, 2.0); /* log10(100) == 2 */
+
+ TESTIT (log1p, 0.0, 0.0); /* log1p(0) == 0 */
+ TESTIT (log1p, -0.0, -0.0); /* log1p(-0) == -0 */
+ TESTIT_R (log1p, M_E-1, 0.99, 1.01); /* log1p(e-1) == 1.000... */
+ TESTIT_R (log1p, M_E*M_E-1, 1.99, 2.01); /* log1p(e*e-1) == 2.000... */
+
+ TESTIT (cbrt, -0.0, -0.0); /* cbrt(-0) == -0 */
+ TESTIT (cbrt, 0.0, 0.0); /* cbrt(0) == 0 */
+ TESTIT (cbrt, 1.0, 1.0); /* cbrt(1) == 1 */
+ TESTIT (cbrt, -1.0, -1.0); /* cbrt(-1) == -1 */
+ TESTIT (cbrt, 8.0, 2.0); /* cbrt(8) == 2 */
+ TESTIT (cbrt, -8.0, -2.0); /* cbrt(-8) == -2 */
+
+ TESTIT (erf, -0.0, -0.0); /* erf(-0) == -0 */
+ TESTIT (erf, 0.0, 0.0); /* erf(0) == 0 */
+ TESTIT_R (erf, 1.0, 0.84, 0.85); /* erf(1) == 0.842... */
+ TESTIT_R (erf, -1.0, -0.85, -0.84); /* erf(-1) == -0.842... */
+
+ TESTIT (erfc, -0.0, 1.0); /* erfc(-0) == 1 */
+ TESTIT (erfc, 0.0, 1.0); /* erfc(0) == 1 */
+ TESTIT_R (erfc, 1.0, 0.15, 0.16); /* erfc(1) == 0.157... */
+ TESTIT_R (erfc, -1.0, 1.84, 1.85); /* erfc(-1) == 1.842... */
+
+ TESTIT_R (tgamma, -4.5, -0.061, -0.060); /* tgamma(-4.5) == -0.06001... */
+ TESTIT_R (tgamma, -3.5, 0.27, 0.28); /* tgamma(-3.5) == 0.27008... */
+ TESTIT_R (tgamma, -2.5, -0.95, -0.94); /* tgamma(-2.5) == -0.945... */
+ TESTIT_R (tgamma, -1.5, 2.36, 2.37); /* tgamma(-1.5) == 2.363... */
+ TESTIT_R (tgamma, -0.5, -3.55, -3.54); /* tgamma(-0.5) == -3.544... */
+ TESTIT_R (tgamma, 0.5, 1.77, 1.78); /* tgamma(0.5) == 1.772... */
+ TESTIT (tgamma, 1.0, 1.0); /* tgamma(1) == 1 */
+ TESTIT_R (tgamma, 1.5, 0.88, 0.89); /* tgamma(1.5) == 0.886... */
+ TESTIT (tgamma, 2.0, 1.0); /* tgamma(2) == 1 */
+ TESTIT_R (tgamma, 2.5, 1.32, 1.33); /* tgamma(2.5) == 1.329... */
+ TESTIT (tgamma, 3.0, 2.0); /* tgamma(3) == 2 */
+ TESTIT_R (tgamma, 3.5, 3.32, 3.33); /* tgamma(3.5) == 3.323... */
+ TESTIT (tgamma, 4.0, 6.0); /* tgamma(4) == 6 */
+ TESTIT_R (tgamma, 4.5, 11.63, 11.64); /* tgamma(4.5) == 11.631... */
+
+ TESTIT2 (pow, 3.0, 4.0, 81.0); /* pow(3,4) == 81 */
+ TESTIT2 (pow, -3.0, 5.0, -243.0); /* pow(-3,5) == -243 */
+ TESTIT2 (pow, 16.0, 0.25, 2.0); /* pow(16,1/4) == 2 */
+ TESTIT2 (pow, 4.0, -2.0, 0.0625); /* pow(4,-2) == 1/16 */
+ TESTIT2 (pow, -2.0, -3.0, -0.125); /* pow(-2,-3) == -1/8 */
+ TESTIT2_R (pow, -1.5, -3.0, -0.297, -0.296); /* pow(-1.5,-3) == -1/3.375 */
+
+ TESTIT2 (hypot, 0.0, 0.0, 0.0); /* hypot(0,0) == 0 */
+ TESTIT2 (hypot, -0.0, 0.0, 0.0); /* hypot(-0,0) == 0 */
+ TESTIT2 (hypot, 0.0, -0.0, 0.0); /* hypot(0,-0) == 0 */
+ TESTIT2 (hypot, -0.0, -0.0, 0.0); /* hypot(-0,-0) == 0 */
+ TESTIT2 (hypot, 3.0, 4.0, 5.0); /* hypot(3,4) == 5 */
+ TESTIT2 (hypot, -3.0, 4.0, 5.0); /* hypot(-3,4) == 5 */
+ TESTIT2 (hypot, 3.0, -4.0, 5.0); /* hypot(3,-4) == 5 */
+ TESTIT2 (hypot, -3.0, -4.0, 5.0); /* hypot(-3,-4) == 5 */
+ TESTIT2_R (hypot, 4.0, 5.0, 6.40, 6.41); /* hypot(4,5) == 6.403... */
+
+ TESTIT2 (atan2, 0.0, 0.0, 0.0); /* atan2(0,0) == 0 */
+ TESTIT2 (atan2, -0.0, 0.0, -0.0); /* atan2(-0,0) == -0 */
+ TESTIT2_R (atan2, 0.0, -0.0, 3.14, 3.15); /* atan2(0,-0) == pi */
+ TESTIT2_R (atan2, -0.0, -0.0, -3.15, -3.14); /* atan2(-0,-0) == -pi */
+ TESTIT2_R (atan2, 0.0, -1.0, 3.14, 3.15); /* atan2(0,-1) == pi */
+ TESTIT2_R (atan2, -0.0, -1.0, -3.15, -3.14); /* atan2(-0,-1) == -pi */
+ TESTIT2 (atan2, 0.0, 1.0, 0.0); /* atan2(0,1) == 0 */
+ TESTIT2 (atan2, -0.0, 1.0, -0.0); /* atan2(-0,1) == -0 */
+ TESTIT2_R (atan2, -1.0, 0.0, -1.58, -1.57); /* atan2(-1,0) == -pi/2 */
+ TESTIT2_R (atan2, 1.0, 0.0, 1.57, 1.58); /* atan2(1,0) == pi/2 */
+
+ TESTIT2 (fdim, 0.0, 0.0, 0.0); /* fdim(0,0) == 0 */
+ TESTIT2 (fdim, -0.0, 0.0, 0.0); /* fdim(-0,0) == 0 */
+ TESTIT2 (fdim, 0.0, -0.0, 0.0); /* fdim(0,-0) == 0 */
+ TESTIT2 (fdim, -0.0, -0.0, 0.0); /* fdim(-0,-0) == 0 */
+ TESTIT2 (fdim, 5.0, 5.0, 0.0); /* fdim(5,5) == 0 */
+ TESTIT2 (fdim, 5.0, 6.0, 0.0); /* fdim(5,6) == 0 */
+ TESTIT2 (fdim, 6.0, 5.0, 1.0); /* fdim(6,5) == 1 */
+ TESTIT2 (fdim, -5.0, -6.0, 1.0); /* fdim(-5,-6) == 1 */
+ TESTIT2 (fdim, -6.0, -5.0, 0.0); /* fdim(-6,-5) == 0 */
+
+ TESTIT2 (fmin, 5.0, 6.0, 5.0); /* fmin(5,6) == 5 */
+ TESTIT2 (fmin, 6.0, 5.0, 5.0); /* fmin(6,5) == 5 */
+ TESTIT2 (fmin, -5.0, -6.0, -6.0); /* fmin(-5,-6) == -6 */
+ TESTIT2 (fmin, -6.0, -5.0, -6.0); /* fmin(-6,-5) == -6 */
+ TESTIT2 (fmin, -0.0, 0.0, -0.0); /* fmin(-0,0) == -0 */
+ TESTIT2 (fmin, 0.0, -0.0, -0.0); /* fmin(-0,0) == -0 */
+
+ TESTIT2 (fmax, 5.0, 6.0, 6.0); /* fmax(5,6) == 6 */
+ TESTIT2 (fmax, 6.0, 5.0, 6.0); /* fmax(6,5) == 6 */
+ TESTIT2 (fmax, -5.0, -6.0, -5.0); /* fmax(-5,-6) == -5 */
+ TESTIT2 (fmax, -6.0, -5.0, -5.0); /* fmax(-6,-5) == -5 */
+ TESTIT2 (fmax, -0.0, 0.0, 0.0); /* fmax(-0,0) == 0 */
+ TESTIT2 (fmax, 0.0, -0.0, 0.0); /* fmax(-0,0) == 0 */
+
+ TESTIT3 (fma, 2.0, 3.0, 4.0, 10.0); /* fma(2,3,4) == 10 */
+ TESTIT3 (fma, 2.0, -3.0, 4.0, -2.0); /* fma(2,-3,4) == -2 */
+ TESTIT3 (fma, 2.0, 3.0, -4.0, 2.0); /* fma(2,3,-4) == 2 */
+ TESTIT3 (fma, 2.0, -3.0, -4.0, -10.0); /* fma(2,-3,-4) == -10 */
+ TESTIT3 (fma, -2.0, -3.0, -4.0, 2.0); /* fma(-2,-3,-4) == 2 */
+ TESTIT3 (fma, 6.0, -0.0, 0.0, 0.0); /* fma(6,-0,0) == 0 */
+ TESTIT3 (fma, -0.0, 6.0, 0.0, 0.0); /* fma(-0,6,0) == 0 */
+ TESTIT3 (fma, 6.0, -0.0, -0.0, -0.0); /* fma(6,-0,-0) == -0 */
+ TESTIT3 (fma, -0.0, 6.0, -0.0, -0.0); /* fma(-0,6,-0) == -0 */
+ TESTIT3 (fma, 0.0, 0.0, 0.0, 0.0); /* fma(0,0,0) == 0 */
+ TESTIT3 (fma, -0.0, 0.0, 0.0, 0.0); /* fma(-0,0,0) == 0 */
+ TESTIT3 (fma, 0.0, -0.0, 0.0, 0.0); /* fma(0,-0,0) == 0 */
+ TESTIT3 (fma, -0.0, -0.0, 0.0, 0.0); /* fma(-0,-0,0) == 0 */
+ TESTIT3 (fma, 0.0, 0.0, -0.0, 0.0); /* fma(0,0,-0) == 0 */
+ TESTIT3 (fma, -0.0, 0.0, -0.0, -0.0); /* fma(-0,0,-0) == -0 */
+ TESTIT3 (fma, 0.0, -0.0, -0.0, -0.0); /* fma(0,-0,-0) == -0 */
+ TESTIT3 (fma, -0.0, -0.0, -0.0, 0.0); /* fma(-0,-0,-0) == 0 */
+
+ if (__builtin_fmaf(__FLT_MAX__, 2.0F, -__FLT_MAX__) != __FLT_MAX__)
+ link_error (__LINE__);
+ if (__builtin_fmaf(2.0F,__FLT_MAX__, -__FLT_MAX__) != __FLT_MAX__)
+ link_error (__LINE__);
+ if (__builtin_fmaf(__FLT_MIN__, 0.5F, __FLT_MIN__) != __FLT_MIN__*1.5F)
+ link_error (__LINE__);
+ if (__builtin_fmaf(0.5F,__FLT_MIN__, __FLT_MIN__) != __FLT_MIN__*1.5F)
+ link_error (__LINE__);
+
+ if (__builtin_fma(__DBL_MAX__, 2.0, -__DBL_MAX__) != __DBL_MAX__)
+ link_error (__LINE__);
+ if (__builtin_fma(2.0,__DBL_MAX__, -__DBL_MAX__) != __DBL_MAX__)
+ link_error (__LINE__);
+ if (__builtin_fma(__DBL_MIN__, 0.5, __DBL_MIN__) != __DBL_MIN__*1.5)
+ link_error (__LINE__);
+ if (__builtin_fma(0.5,__DBL_MIN__, __DBL_MIN__) != __DBL_MIN__*1.5)
+ link_error (__LINE__);
+
+ if (__builtin_fmal(__LDBL_MAX__, 2.0L, -__LDBL_MAX__) != __LDBL_MAX__)
+ link_error (__LINE__);
+ if (__builtin_fmal(2.0L,__LDBL_MAX__, -__LDBL_MAX__) != __LDBL_MAX__)
+ link_error (__LINE__);
+ if (__builtin_fmal(__LDBL_MIN__, 0.5L, __LDBL_MIN__) != __LDBL_MIN__*1.5L)
+ link_error (__LINE__);
+ if (__builtin_fmal(0.5L,__LDBL_MIN__, __LDBL_MIN__) != __LDBL_MIN__*1.5L)
+ link_error (__LINE__);
+
+ TESTIT (sqrt, -0.0, -0.0); /* sqrt(-0) == -0 */
+ TESTIT (sqrt, 0.0, 0.0); /* sqrt(0) == 0 */
+ TESTIT (sqrt, 1.0, 1.0); /* sqrt(1) == 1 */
+ TESTIT (sqrt, 4.0, 2.0); /* sqrt(4) == 2 */
+ TESTIT_R (sqrt, 1.5, 1.22, 1.23); /* sqrt(1.5) == 1.224... */
+ TESTIT_R (sqrt, 2.0, 1.41, 1.42); /* sqrt(2) == 1.414... */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-4.c
new file mode 100644
index 000000000..d47e13933
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-4.c
@@ -0,0 +1,311 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Verify that built-in math function constant folding of constant
+ arguments is correctly performed by the compiler. This testcase is
+ for functionality that was available as of mpfr-2.3.0.
+
+ Origin: Kaveh R. Ghazi, April 23, 2007. */
+
+/* { dg-do link } */
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(int);
+
+/* Return TRUE if the sign of X != sign of Y. This is important when
+ comparing signed zeros. */
+#define CKSGN_F(X,Y) \
+ (__builtin_copysignf(1.0F,(X)) != __builtin_copysignf(1.0F,(Y)))
+#define CKSGN(X,Y) \
+ (__builtin_copysign(1.0,(X)) != __builtin_copysign(1.0,(Y)))
+#define CKSGN_L(X,Y) \
+ (__builtin_copysignl(1.0L,(X)) != __builtin_copysignl(1.0L,(Y)))
+
+/* Test that FUNC(ARG) == (RES). */
+#define TESTIT(FUNC,ARG,RES) do { \
+ if (__builtin_##FUNC##f(ARG##F) != RES##F \
+ || CKSGN_F(__builtin_##FUNC##f(ARG##F),RES##F)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG) != RES \
+ || CKSGN(__builtin_##FUNC(ARG),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG##L) != RES##L \
+ || CKSGN_L(__builtin_##FUNC##l(ARG##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Range test, check that (LOW) < FUNC(ARG) < (HI). */
+#define TESTIT_R(FUNC,ARG,LOW,HI) do { \
+ if (__builtin_##FUNC##f(ARG) <= (LOW) || __builtin_##FUNC##f(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG) <= (LOW) || __builtin_##FUNC(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG) <= (LOW) || __builtin_##FUNC##l(ARG) >= (HI)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(ARG1, ARG2) == (RES). */
+#define TESTIT2(FUNC,ARG1,ARG2,RES) do { \
+ if (__builtin_##FUNC##f(ARG1, ARG2##F) != RES##F \
+ || CKSGN_F(__builtin_##FUNC##f(ARG1,ARG2##F),RES##F)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG1, ARG2) != RES \
+ || CKSGN(__builtin_##FUNC(ARG1,ARG2),RES)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG1, ARG2##L) != RES##L \
+ || CKSGN_L(__builtin_##FUNC##l(ARG1,ARG2##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Range test, check that (LOW) < FUNC(ARG1,ARG2) < (HI). */
+#define TESTIT2_R(FUNC,ARG1,ARG2,LOW,HI) do { \
+ if (__builtin_##FUNC##f(ARG1, ARG2##F) <= (LOW) \
+ || __builtin_##FUNC##f(ARG1, ARG2##F) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(ARG1, ARG2) <= (LOW) \
+ || __builtin_##FUNC(ARG1, ARG2) >= (HI)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(ARG1, ARG2##L) <= (LOW) \
+ || __builtin_##FUNC##l(ARG1, ARG2##L) >= (HI)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that remquo(ARG0, ARG1, &ARG_Q) == RES and ARG_Q == RES_Q.
+ Also test remainder/drem (ARG0,ARG1) == RES. */
+#define TESTIT2_REMQUO(ARG0,ARG1,ARG_Q,RES,RES_Q) do { \
+ ARG_Q = 12345; \
+ if (__builtin_remquof(ARG0##F, ARG1##F, &ARG_Q) != RES##F \
+ || CKSGN_F(__builtin_remquof(ARG0##F, ARG1##F, &ARG_Q),RES##F) \
+ || ARG_Q != RES_Q \
+ || __builtin_remainderf(ARG0##F, ARG1##F) != RES##F \
+ || CKSGN_F(__builtin_remainderf(ARG0##F, ARG1##F),RES##F) \
+ || __builtin_dremf(ARG0##F, ARG1##F) != RES##F \
+ || CKSGN_F(__builtin_dremf(ARG0##F, ARG1##F),RES##F)) \
+ link_error(__LINE__); \
+ ARG_Q = 12345; \
+ if (__builtin_remquo(ARG0, ARG1, &ARG_Q) != RES \
+ || CKSGN(__builtin_remquo(ARG0, ARG1, &ARG_Q),RES) \
+ || ARG_Q != RES_Q \
+ || __builtin_remainder(ARG0, ARG1) != RES \
+ || CKSGN(__builtin_remainder(ARG0, ARG1),RES) \
+ || __builtin_drem(ARG0, ARG1) != RES \
+ || CKSGN(__builtin_drem(ARG0, ARG1),RES)) \
+ link_error(__LINE__); \
+ ARG_Q = 12345; \
+ if (__builtin_remquol(ARG0##L, ARG1##L, &ARG_Q) != RES##L \
+ || CKSGN_L(__builtin_remquol(ARG0##L, ARG1##L, &ARG_Q),RES##L) \
+ || ARG_Q != RES_Q \
+ || __builtin_remainderl(ARG0##L, ARG1##L) != RES##L \
+ || CKSGN_L(__builtin_remainderl(ARG0##L, ARG1##L),RES##L) \
+ || __builtin_dreml(ARG0##L, ARG1##L) != RES##L \
+ || CKSGN_L(__builtin_dreml(ARG0##L, ARG1##L),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(ARG,&SG) == (RES) && SG == RES_SG. */
+#define TESTIT_LGAMMA_REENT(FUNC,ARG,RES,RES_SG) do { \
+ int sg; \
+ sg = 123; \
+ if (__builtin_##FUNC##f_r(ARG##F,&sg) != RES##F \
+ || sg != RES_SG \
+ || CKSGN_F(__builtin_##FUNC##f_r(ARG##F,&sg),RES##F)) \
+ link_error(__LINE__); \
+ sg = 123; \
+ if (__builtin_##FUNC##_r(ARG,&sg) != RES \
+ || sg != RES_SG \
+ || CKSGN(__builtin_##FUNC##_r(ARG,&sg),RES)) \
+ link_error(__LINE__); \
+ sg = 123; \
+ if (__builtin_##FUNC##l_r(ARG##L,&sg) != RES##L \
+ || sg != RES_SG \
+ || CKSGN_L(__builtin_##FUNC##l_r(ARG##L,&sg),RES##L)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Range test, check that (LOW) < FUNC(ARG,&SG) < (HI), and also test
+ that SG == RES_SG. */
+#define TESTIT_LGAMMA_REENT_R(FUNC,ARG,LOW,HI,RES_SG) do { \
+ int sg; \
+ sg = 123; \
+ if (__builtin_##FUNC##f_r(ARG,&sg) <= (LOW) || __builtin_##FUNC##f_r(ARG,&sg) >= (HI) \
+ || sg != RES_SG) \
+ link_error(__LINE__); \
+ sg = 123; \
+ if (__builtin_##FUNC##_r(ARG,&sg) <= (LOW) || __builtin_##FUNC##_r(ARG,&sg) >= (HI) \
+ || sg != RES_SG) \
+ link_error(__LINE__); \
+ sg = 123; \
+ if (__builtin_##FUNC##l_r(ARG,&sg) <= (LOW) || __builtin_##FUNC##l_r(ARG,&sg) >= (HI) \
+ || sg != RES_SG) \
+ link_error(__LINE__); \
+ } while (0)
+
+int main (void)
+{
+#ifdef __OPTIMIZE__
+ int q;
+#endif
+
+ TESTIT (j0, 0.0, 1.0); /* j0(0) == 1 */
+ TESTIT (j0, -0.0, 1.0); /* j0(-0) == 1 */
+ TESTIT_R (j0, 1.0, 0.765, 0.766); /* j0(1) == 0.7651... */
+ TESTIT_R (j0, -1.0, 0.765, 0.766); /* j0(-1) == 0.7651... */
+
+ TESTIT (j1, 0.0, 0.0); /* j1(0) == 0 */
+ TESTIT (j1, -0.0, -0.0); /* j1(-0) == -0 */
+ TESTIT_R (j1, 1.0, 0.44, 0.45); /* j1(1) == 0.440... */
+ TESTIT_R (j1, -1.0, -0.45, -0.44); /* j1(-1) == -0.440... */
+
+ TESTIT2 (jn, 5, 0.0, 0.0); /* jn(5,0) == 0 */
+ TESTIT2 (jn, 5, -0.0, -0.0); /* jn(5,-0) == -0 */
+ TESTIT2 (jn, 6, 0.0, 0.0); /* jn(6,0) == 0 */
+ TESTIT2 (jn, 6, -0.0, 0.0); /* jn(6,-0) == 0 */
+
+ TESTIT2 (jn, -5, 0.0, -0.0); /* jn(-5,0) == -0 */
+ TESTIT2 (jn, -5, -0.0, 0.0); /* jn(-5,-0) == 0 */
+ TESTIT2 (jn, -6, 0.0, 0.0); /* jn(-6,0) == 0 */
+ TESTIT2 (jn, -6, -0.0, 0.0); /* jn(-6,-0) == 0 */
+
+ TESTIT2_R (jn, 2, 1.0, 0.11, 0.12); /* jn(2,1) == 0.114... */
+ TESTIT2_R (jn, 2, -1.0, 0.11, 0.12); /* jn(2,-1) == 0.114... */
+ TESTIT2_R (jn, 3, 5.0, 0.36, 0.37); /* jn(3,5) == 0.364... */
+ TESTIT2_R (jn, 3, -5.0, -0.37, -0.36); /* jn(3,-5) == -0.364... */
+
+ TESTIT2_R (jn, -2, 1.0, 0.11, 0.12); /* jn(-2,1) == 0.114... */
+ TESTIT2_R (jn, -2, -1.0, 0.11, 0.12); /* jn(-2,-1) == 0.114... */
+ TESTIT2_R (jn, -3, 5.0, -0.37, -0.36); /* jn(-3,5) == -0.364... */
+ TESTIT2_R (jn, -3, -5.0, 0.36, 0.37); /* jn(-3,-5) == 0.364... */
+
+ TESTIT2_R (jn, 4, 3.5, 0.20, 0.21); /* jn(4,3.5) == 0.204... */
+ TESTIT2_R (jn, 4, -3.5, 0.20, 0.21); /* jn(4,-3.5) == 0.204... */
+ TESTIT2_R (jn, 5, 4.6, 0.20, 0.21); /* jn(5,4.6) == 0.207... */
+ TESTIT2_R (jn, 5, -4.6, -0.21, -0.20); /* jn(5,-4.6) == -0.207... */
+
+ TESTIT2_R (jn, -4, 3.5, 0.20, 0.21); /* jn(-4,3.5) == 0.204... */
+ TESTIT2_R (jn, -4, -3.5, 0.20, 0.21); /* jn(-4,-3.5) == 0.204... */
+ TESTIT2_R (jn, -5, 4.6, -0.21, -0.20); /* jn(-5,4.6) == -0.207... */
+ TESTIT2_R (jn, -5, -4.6, 0.20, 0.21); /* jn(-5,-4.6) == 0.207... */
+
+ TESTIT_R (y0, 5.0, -0.31, -0.30); /* y0(5) == -0.308... */
+ TESTIT_R (y0, 0.1, -1.54, -1.53); /* y0(0.1) == -1.534... */
+
+ TESTIT_R (y1, 5.0, 0.14, 0.15); /* y1(5) == 0.147... */
+ TESTIT_R (y1, 0.1, -6.46, -6.45); /* y1(0.1) == -6.458... */
+
+ TESTIT2_R (yn, -1, 3.0, -0.33, -0.32); /* yn(-1,3) == -0.324... */
+ TESTIT2_R (yn, -1, 0.25, 2.70, 2.71); /* yn(-1,0.25) == 2.704... */
+
+ TESTIT2_R (yn, 2, 4.0, 0.21, 0.22); /* yn(2,4) == 0.215... */
+ TESTIT2_R (yn, 2, 0.9, -1.95, -1.94); /* yn(2,0.9) == -1.945... */
+ TESTIT2_R (yn, -2, 4.0, 0.21, 0.22); /* yn(-2,4) == 0.215... */
+ TESTIT2_R (yn, -2, 0.9, -1.95, -1.94); /* yn(-2,0.9) == -1.945... */
+
+ TESTIT2_R (yn, 3, 6.0, 0.32, 0.33); /* yn(3,6) == 0.328... */
+ TESTIT2_R (yn, 3, 0.89, -8.03, -8.02); /* yn(3,0.89) == -8.020... */
+ TESTIT2_R (yn, -3, 8.0, -0.03, -0.02); /* yn(-3,8) == -0.026... */
+ TESTIT2_R (yn, -3, 0.99, 5.98, 5.99); /* yn(-3,0.99) == 5.982... */
+
+#ifdef __OPTIMIZE__
+ /* These tests rely on propagating the variable q, which happens
+ only when optimization is turned on. This macro also tests
+ remainder/drem. */
+ TESTIT2_REMQUO (0.0, 1.0, q, 0.0, 0); /* remquo(0,1,&q)==0, q==0 */
+ TESTIT2_REMQUO (1.0, 1.0, q, 0.0, 1); /* remquo(1,1,&q)==0, q==1 */
+ TESTIT2_REMQUO (2.0, 1.0, q, 0.0, 2); /* remquo(2,1,&q)==0, q==2 */
+ TESTIT2_REMQUO (-0.0, 1.0, q, -0.0, 0); /* remquo(-0,1,&q)==-0, q==0 */
+ TESTIT2_REMQUO (-1.0, 1.0, q, -0.0, -1); /* remquo(-1,1,&q)==-0, q==-1 */
+ TESTIT2_REMQUO (-2.0, 1.0, q, -0.0, -2); /* remquo(-2,1,&q)==-0, q==-2 */
+
+ TESTIT2_REMQUO (0.0, -1.0, q, 0.0, 0); /* remquo(0,-1,&q)==0, q==0 */
+ TESTIT2_REMQUO (1.0, -1.0, q, 0.0, -1); /* remquo(1,-1,&q)==0, q==-1 */
+ TESTIT2_REMQUO (2.0, -1.0, q, 0.0, -2); /* remquo(2,-1,&q)==0, q==-2 */
+ TESTIT2_REMQUO (-0.0, -1.0, q, -0.0, 0); /* remquo(-0,-1,&q)==-0, q==0 */
+ TESTIT2_REMQUO (-1.0, -1.0, q, -0.0, 1); /* remquo(-1,-1,&q)==-0, q==1 */
+ TESTIT2_REMQUO (-2.0, -1.0, q, -0.0, 2); /* remquo(-2,-1,&q)==-0, q==2 */
+
+ TESTIT2_REMQUO (1.0, 2.0, q, 1.0, 0); /* remquo(1,2,&q)==1, q==0 */
+ TESTIT2_REMQUO (3.0, 2.0, q, -1.0, 2); /* remquo(3,2,&q)==-1, q==2 */
+ TESTIT2_REMQUO (5.0, 2.0, q, 1.0, 2); /* remquo(5,2,&q)==1, q==2 */
+ TESTIT2_REMQUO (-1.0, 2.0, q, -1.0, 0); /* remquo(-1,2,&q)==-1, q==0 */
+ TESTIT2_REMQUO (-3.0, 2.0, q, 1.0, -2); /* remquo(-3,2,&q)==1, q==-2 */
+ TESTIT2_REMQUO (-5.0, 2.0, q, -1.0, -2); /* remquo(-5,2,&q)==-1, q==-2 */
+
+ TESTIT2_REMQUO (1.0, -2.0, q, 1.0, 0); /* remquo(1,-2,&q)==1, q==0 */
+ TESTIT2_REMQUO (3.0, -2.0, q, -1.0, -2); /* remquo(3,-2,&q)==-1, q==-2 */
+ TESTIT2_REMQUO (5.0, -2.0, q, 1.0, -2); /* remquo(5,-2,&q)==1, q==-2 */
+ TESTIT2_REMQUO (-1.0, -2.0, q, -1.0, 0); /* remquo(-1,-2,&q)==-1, q==0 */
+ TESTIT2_REMQUO (-3.0, -2.0, q, 1.0, 2); /* remquo(-3,-2,&q)==1, q==2 */
+ TESTIT2_REMQUO (-5.0, -2.0, q, -1.0, 2); /* remquo(-5,-2,&q)==-1, q==2 */
+
+ /* Test that the maximum possible value can be generated into the
+ int quotient, and check for wrap around (modulo) when that value
+ is exceeded. We can only check for this when the mantissa has
+ enough bits to hold an INT_MAX value with complete precision. */
+
+#define MAXIT(FUNC,X,R) do { \
+ q = 12345; \
+ if (__builtin_##FUNC((X), 1, &q) != 0 || q != (R)) \
+ link_error (__LINE__); \
+} while (0)
+
+ if (sizeof(int)*__CHAR_BIT__ <= __FLT_MANT_DIG__)
+ {
+ MAXIT(remquof, __INT_MAX__-1.0F, __INT_MAX__-1);
+ MAXIT(remquof, __INT_MAX__+0.0F, __INT_MAX__);
+ MAXIT(remquof, __INT_MAX__+1.0F, 0);
+ MAXIT(remquof, __INT_MAX__+2.0F, 1);
+
+ MAXIT(remquof, -(__INT_MAX__-1.0F), -(__INT_MAX__-1));
+ MAXIT(remquof, -(__INT_MAX__+0.0F), -__INT_MAX__);
+ MAXIT(remquof, -(__INT_MAX__+1.0F), 0);
+ MAXIT(remquof, -(__INT_MAX__+2.0F), -1);
+ }
+
+ if (sizeof(int)*__CHAR_BIT__ <= __DBL_MANT_DIG__)
+ {
+ MAXIT(remquo, __INT_MAX__-1.0, __INT_MAX__-1);
+ MAXIT(remquo, __INT_MAX__+0.0, __INT_MAX__);
+ MAXIT(remquo, __INT_MAX__+1.0, 0);
+ MAXIT(remquo, __INT_MAX__+2.0, 1);
+
+ MAXIT(remquo, -(__INT_MAX__-1.0), -(__INT_MAX__-1));
+ MAXIT(remquo, -(__INT_MAX__+0.0), -__INT_MAX__);
+ MAXIT(remquo, -(__INT_MAX__+1.0), 0);
+ MAXIT(remquo, -(__INT_MAX__+2.0), -1);
+ }
+
+ if (sizeof(int)*__CHAR_BIT__ <= __LDBL_MANT_DIG__)
+ {
+ MAXIT(remquo, __INT_MAX__-1.0L, __INT_MAX__-1);
+ MAXIT(remquo, __INT_MAX__+0.0L, __INT_MAX__);
+ MAXIT(remquo, __INT_MAX__+1.0L, 0);
+ MAXIT(remquo, __INT_MAX__+2.0L, 1);
+
+ MAXIT(remquol, -(__INT_MAX__-1.0L), -(__INT_MAX__-1));
+ MAXIT(remquol, -(__INT_MAX__+0.0L), -__INT_MAX__);
+ MAXIT(remquol, -(__INT_MAX__+1.0L), 0);
+ MAXIT(remquol, -(__INT_MAX__+2.0L), -1);
+ }
+
+ /* These tests rely on propagating the variable sg which contains
+ signgam. This happens only when optimization is turned on. */
+ TESTIT_LGAMMA_REENT_R (lgamma, -2.5, -0.06, -0.05, -1); /* lgamma_r(-2.5) == -0.056... */
+ TESTIT_LGAMMA_REENT_R (lgamma, -1.5, 0.86, 0.87, 1); /* lgamma_r(-1.5) == 0.860... */
+ TESTIT_LGAMMA_REENT_R (lgamma, -0.5, 1.26, 1.27, -1); /* lgamma_r(-0.5) == 1.265... */
+ TESTIT_LGAMMA_REENT_R (lgamma, 0.5, 0.57, 0.58, 1); /* lgamma_r(0.5) == 0.572... */
+ TESTIT_LGAMMA_REENT (lgamma, 1.0, 0.0, 1); /* lgamma_r(1) == 0 */
+ TESTIT_LGAMMA_REENT_R (lgamma, 1.5, -0.13, -0.12, 1); /* lgamma_r(1.5) == -0.120... */
+ TESTIT_LGAMMA_REENT (lgamma, 2.0, 0.0, 1); /* lgamma_r(2) == 0 */
+ TESTIT_LGAMMA_REENT_R (lgamma, 2.5, 0.28, 0.29, 1); /* lgamma_r(2.5) == 0.284... */
+
+ TESTIT_LGAMMA_REENT_R (gamma, -2.5, -0.06, -0.05, -1); /* gamma_r(-2.5) == -0.056... */
+ TESTIT_LGAMMA_REENT_R (gamma, -1.5, 0.86, 0.87, 1); /* gamma_r(-1.5) == 0.860... */
+ TESTIT_LGAMMA_REENT_R (gamma, -0.5, 1.26, 1.27, -1); /* gamma_r(-0.5) == 1.265... */
+ TESTIT_LGAMMA_REENT_R (gamma, 0.5, 0.57, 0.58, 1); /* gamma_r(0.5) == 0.572... */
+ TESTIT_LGAMMA_REENT (gamma, 1.0, 0.0, 1); /* gamma_r(1) == 0 */
+ TESTIT_LGAMMA_REENT_R (gamma, 1.5, -0.13, -0.12, 1); /* gamma_r(1.5) == -0.120... */
+ TESTIT_LGAMMA_REENT (gamma, 2.0, 0.0, 1); /* gamma_r(2) == 0 */
+ TESTIT_LGAMMA_REENT_R (gamma, 2.5, 0.28, 0.29, 1); /* gamma_r(2.5) == 0.284... */
+#endif
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-5.c
new file mode 100644
index 000000000..259164107
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-5.c
@@ -0,0 +1,123 @@
+/* Copyright (C) 2009 Free Software Foundation.
+
+ Test things that should block GCC from optimizing compile-time
+ constants passed to a builtin complex transcendental functions.
+
+ Origin: Kaveh R. Ghazi, January 28, 2009. */
+
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+extern void foof (_Complex float);
+extern void foo (_Complex double);
+extern void fool (_Complex long double);
+
+#define TESTIT(FUNC, ARG) do { \
+ foof (__builtin_##FUNC##f (ARG##F)); \
+ foo (__builtin_##FUNC (ARG)); \
+ fool (__builtin_##FUNC##l (ARG##L)); \
+} while (0)
+
+#define TESTIT2(FUNC, ARG0, ARG1) do { \
+ foof (__builtin_##FUNC##f (ARG0##F, ARG1##F)); \
+ foo (__builtin_##FUNC (ARG0, ARG1)); \
+ fool (__builtin_##FUNC##l (ARG0##L, ARG1##L)); \
+} while (0)
+
+void bar()
+{
+ /* An argument of NaN is not evaluated at compile-time. */
+#ifndef __SPU__
+ foof (__builtin_csqrtf (__builtin_nanf("")));
+#endif
+ foo (__builtin_csqrt (__builtin_nan("")));
+ fool (__builtin_csqrtl (__builtin_nanl("")));
+
+ /* An argument of Inf/-Inf is not evaluated at compile-time. */
+#ifndef __SPU__
+ foof (__builtin_csqrtf (__builtin_inff()));
+#endif
+ foo (__builtin_csqrt (__builtin_inf()));
+ fool (__builtin_csqrtl (__builtin_infl()));
+#ifndef __SPU__
+ foof (__builtin_csqrtf (-__builtin_inff()));
+#endif
+ foo (__builtin_csqrt (-__builtin_inf()));
+ fool (__builtin_csqrtl (-__builtin_infl()));
+
+ /* Check for overflow/underflow. */
+ TESTIT (cexp, 1e20);
+ TESTIT (cexp, -1e20);
+
+ /* An argument of NaN is not evaluated at compile-time. */
+#ifndef __SPU__
+ foof (__builtin_cpowf (__builtin_nanf(""), 2.5F));
+#endif
+ foo (__builtin_cpow (__builtin_nan(""), 2.5));
+ fool (__builtin_cpowl (__builtin_nanl(""), 2.5L));
+#ifndef __SPU__
+ foof (__builtin_cpowf (2.5F, __builtin_nanf("")));
+#endif
+ foo (__builtin_cpow (2.5, __builtin_nan("")));
+ fool (__builtin_cpowl (2.5L, __builtin_nanl("")));
+
+ /* An argument of Inf/-Inf is not evaluated at compile-time. */
+#ifndef __SPU__
+ foof (__builtin_cpowf (__builtin_inff(), 2.5F));
+#endif
+ foo (__builtin_cpow (__builtin_inf(), 2.5));
+ fool (__builtin_cpowl (__builtin_infl(), 2.5L));
+#ifndef __SPU__
+ foof (__builtin_cpowf (-__builtin_inff(), 2.5F));
+#endif
+ foo (__builtin_cpow (-__builtin_inf(), 2.5));
+ fool (__builtin_cpowl (-__builtin_infl(), 2.5L));
+#ifndef __SPU__
+ foof (__builtin_cpowf (2.5F, __builtin_inff()));
+#endif
+ foo (__builtin_cpow (2.5, __builtin_inf()));
+ fool (__builtin_cpowl (2.5L, __builtin_infl()));
+#ifndef __SPU__
+ foof (__builtin_cpowf (2.5F, -__builtin_inff()));
+#endif
+ foo (__builtin_cpow (2.5, -__builtin_inf()));
+ fool (__builtin_cpowl (2.5L, -__builtin_infl()));
+
+ /* Check for Inv/NaN return values. */
+ TESTIT2 (cpow, -0.0, -4.5); /* Returns Inf */
+ TESTIT2 (cpow, 0.0, -4.5); /* Returns Inf */
+
+ /* Check for overflow/underflow. */
+ foof (__builtin_cpowf (__FLT_MAX__, 3.5F));
+ foof (__builtin_cpowf (__FLT_MAX__ * 1.FI, 3.5F));
+ foo (__builtin_cpow (__DBL_MAX__, 3.5));
+ foo (__builtin_cpow (__DBL_MAX__ * 1.I, 3.5));
+ fool (__builtin_cpowl (__LDBL_MAX__, 3.5L));
+ fool (__builtin_cpowl (__LDBL_MAX__ * 1.LI, 3.5L));
+ TESTIT2 (cpow, 2.0, 0x1p50);
+ TESTIT2 (cpow, 2.0, 0x1p28);
+ TESTIT2 (cpow, 2.0, 0x1p24);
+ foof (__builtin_cpowf (__FLT_MAX__, -3.5F));
+ foof (__builtin_cpowf (__FLT_MAX__ * 1.FI, -3.5F));
+ foo (__builtin_cpow (__DBL_MAX__, -3.5));
+ foo (__builtin_cpow (__DBL_MAX__ * 1.I, -3.5));
+ fool (__builtin_cpowl (__LDBL_MAX__, -3.5L));
+ fool (__builtin_cpowl (__LDBL_MAX__ * 1.LI, -3.5L));
+ TESTIT2 (cpow, 2.0, -0x1p50);
+ TESTIT2 (cpow, 2.0, -0x1p28);
+ TESTIT2 (cpow, 2.0, -0x1p24);
+
+}
+
+/* { dg-final { scan-tree-dump-times "csqrtf" 3 "original" { target { ! { spu*-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "csqrtf" 0 "original" { target { spu*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "csqrt " 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "csqrtl" 3 "original" } } */
+/* { dg-final { scan-tree-dump-times "cexpf" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "cexp " 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "cexpl" 2 "original" } } */
+/* { dg-final { scan-tree-dump-times "cpowf" 18 "original" { target { ! { spu*-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "cpowf" 12 "original" { target { spu*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "cpow " 18 "original" } } */
+/* { dg-final { scan-tree-dump-times "cpowl" 18 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-6.c
new file mode 100644
index 000000000..462c7d3ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-6.c
@@ -0,0 +1,302 @@
+/* Copyright (C) 2009 Free Software Foundation.
+
+ Verify that folding of built-in complex math functions with
+ constant arguments is correctly performed by the compiler.
+
+ Origin: Kaveh R. Ghazi, January 28, 2009. */
+
+/* { dg-do link } */
+
+/* All references to link_error should go away at compile-time. The
+ first number is the line number and the second is the value number
+ among several tests. These appear in the tree dump file and aid in
+ debugging. */
+extern void link_error(int, int);
+
+#define CONJ(X) __builtin_conjf(X)
+
+/* Return TRUE if the signs of floating point values X and Y are not
+ equal. This is important when comparing signed zeros. */
+#define CKSGN_F(X,Y) \
+ (__builtin_copysignf(1,(X)) != __builtin_copysignf(1,(Y)))
+#define CKSGN(X,Y) \
+ (__builtin_copysign(1,(X)) != __builtin_copysign(1,(Y)))
+#define CKSGN_L(X,Y) \
+ (__builtin_copysignl(1,(X)) != __builtin_copysignl(1,(Y)))
+
+/* Return TRUE if signs of the real parts, and the signs of the
+ imaginary parts, of X and Y are not equal. */
+#define COMPLEX_CKSGN_F(X,Y) \
+ (CKSGN_F(__real__ (X), __real__ (Y)) || CKSGN_F (__imag__ (X), __imag__ (Y)))
+#define COMPLEX_CKSGN(X,Y) \
+ (CKSGN(__real__ (X), __real__ (Y)) || CKSGN (__imag__ (X), __imag__ (Y)))
+#define COMPLEX_CKSGN_L(X,Y) \
+ (CKSGN_L(__real__ (X), __real__ (Y)) || CKSGN_L (__imag__ (X), __imag__ (Y)))
+
+/* For complex numbers, test that FUNC(ARG) == (RES). */
+#define TESTIT_COMPLEX(VAL_NUM, FUNC, ARG, RES) do { \
+ if (__builtin_##FUNC##f(ARG) != (RES) \
+ || COMPLEX_CKSGN_F(__builtin_##FUNC##f(ARG), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ if (__builtin_##FUNC(ARG) != (RES) \
+ || COMPLEX_CKSGN(__builtin_##FUNC(ARG), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ if (__builtin_##FUNC##l(ARG) != (RES) \
+ || COMPLEX_CKSGN_L(__builtin_##FUNC##l(ARG), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ } while (0)
+
+/* For complex numbers, call the TESTIT_COMPLEX macro for all
+ combinations of neg and conj. */
+#define TESTIT_COMPLEX_ALLNEG(FUNC, ARG, RES1, RES2, RES3, RES4) do { \
+ TESTIT_COMPLEX(1, FUNC, (_Complex float)(ARG), RES1); \
+ TESTIT_COMPLEX(2, FUNC, -CONJ(ARG), RES2); \
+ TESTIT_COMPLEX(3, FUNC, CONJ(ARG), RES3); \
+ TESTIT_COMPLEX(4, FUNC, -(_Complex float)(ARG), RES4); \
+} while (0)
+
+/* For complex numbers, call the TESTIT_COMPLEX_R macro for all
+ combinations of neg and conj. */
+#define TESTIT_COMPLEX_R_ALLNEG(FUNC, ARG, RES1, RES2, RES3, RES4) do { \
+ TESTIT_COMPLEX_R(1, FUNC, (_Complex float)(ARG), RES1); \
+ TESTIT_COMPLEX_R(2, FUNC, -CONJ(ARG), RES2); \
+ TESTIT_COMPLEX_R(3, FUNC, CONJ(ARG), RES3); \
+ TESTIT_COMPLEX_R(4, FUNC, -(_Complex float)(ARG), RES4); \
+} while (0)
+
+/* For complex numbers, test that FUNC(ARG0, ARG1) == (RES). */
+#define TESTIT_COMPLEX2(VAL_NUM, FUNC, ARG0, ARG1, RES) do { \
+ if (__builtin_##FUNC##f(ARG0, ARG1) != (RES) \
+ || COMPLEX_CKSGN_F(__builtin_##FUNC##f(ARG0, ARG1), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ if (__builtin_##FUNC(ARG0, ARG1) != (RES) \
+ || COMPLEX_CKSGN(__builtin_##FUNC(ARG0, ARG1), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ if (__builtin_##FUNC##l(ARG0, ARG1) != (RES) \
+ || COMPLEX_CKSGN_L(__builtin_##FUNC##l(ARG0, ARG1), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ } while (0)
+
+/* For complex numbers, call the TESTIT_COMPLEX2 macro for all
+ combinations of neg and conj. */
+#define TESTIT_COMPLEX2_ALLNEG(FUNC, ARG0, ARG1, RES1, RES2, RES3, RES4, RES5,\
+ RES6, RES7, RES8, RES9, RES10, RES11, RES12, RES13, RES14, RES15, RES16) do{ \
+ TESTIT_COMPLEX2(1, FUNC, (_Complex float)(ARG0),(_Complex float)(ARG1), RES1);\
+ TESTIT_COMPLEX2(2, FUNC, (_Complex float)(ARG0),CONJ(ARG1), RES2); \
+ TESTIT_COMPLEX2(3, FUNC, (_Complex float)(ARG0),-(_Complex float)(ARG1), RES3); \
+ TESTIT_COMPLEX2(4, FUNC, (_Complex float)(ARG0),-CONJ(ARG1), RES4); \
+ TESTIT_COMPLEX2(5, FUNC, -(_Complex float)(ARG0),(_Complex float)(ARG1), RES5); \
+ TESTIT_COMPLEX2(6, FUNC, -(_Complex float)(ARG0),CONJ(ARG1), RES6); \
+ TESTIT_COMPLEX2(7, FUNC, -(_Complex float)(ARG0),-(_Complex float)(ARG1), RES7); \
+ TESTIT_COMPLEX2(8, FUNC, -(_Complex float)(ARG0),-CONJ(ARG1), RES8); \
+ TESTIT_COMPLEX2(9, FUNC, CONJ(ARG0),(_Complex float)(ARG1), RES9); \
+ TESTIT_COMPLEX2(10, FUNC, CONJ(ARG0),CONJ(ARG1), RES10); \
+ TESTIT_COMPLEX2(11, FUNC, CONJ(ARG0),-(_Complex float)(ARG1), RES11); \
+ TESTIT_COMPLEX2(12, FUNC, CONJ(ARG0),-CONJ(ARG1), RES12); \
+ TESTIT_COMPLEX2(13, FUNC, -CONJ(ARG0),(_Complex float)(ARG1), RES13); \
+ TESTIT_COMPLEX2(14, FUNC, -CONJ(ARG0),CONJ(ARG1), RES14); \
+ TESTIT_COMPLEX2(15, FUNC, -CONJ(ARG0),-(_Complex float)(ARG1), RES15); \
+ TESTIT_COMPLEX2(16, FUNC, -CONJ(ARG0),-CONJ(ARG1), RES16); \
+} while (0)
+
+/* Return TRUE if X differs from EXPECTED by more than 1%. If
+ EXPECTED is zero, then any difference may return TRUE. We don't
+ worry about signed zeros. */
+#define DIFF1PCT_F(X,EXPECTED) \
+ (__builtin_fabsf((X)-(EXPECTED)) * 100 > __builtin_fabsf(EXPECTED))
+#define DIFF1PCT(X,EXPECTED) \
+ (__builtin_fabs((X)-(EXPECTED)) * 100 > __builtin_fabs(EXPECTED))
+#define DIFF1PCT_L(X,EXPECTED) \
+ (__builtin_fabsl((X)-(EXPECTED)) * 100 > __builtin_fabsl(EXPECTED))
+
+/* Return TRUE if complex value X differs from EXPECTED by more than
+ 1% in either the real or imaginary parts. */
+#define COMPLEX_DIFF1PCT_F(X,EXPECTED) \
+ (DIFF1PCT_F(__real__ (X), __real__ (EXPECTED)) \
+ || DIFF1PCT_F(__imag__ (X), __imag__ (EXPECTED)))
+#define COMPLEX_DIFF1PCT(X,EXPECTED) \
+ (DIFF1PCT(__real__ (X), __real__ (EXPECTED)) \
+ || DIFF1PCT(__imag__ (X), __imag__ (EXPECTED)))
+#define COMPLEX_DIFF1PCT_L(X,EXPECTED) \
+ (DIFF1PCT_L(__real__ (X), __real__ (EXPECTED)) \
+ || DIFF1PCT_L(__imag__ (X), __imag__ (EXPECTED)))
+
+/* Range test, for complex numbers check that FUNC(ARG) is within 1%
+ of RES. This is NOT a test for accuracy to the last-bit, we're
+ merely checking that we get relatively sane results. I.e. the GCC
+ builtin is hooked up to the correct MPC function call. We first
+ check the magnitude and then the sign. */
+#define TESTIT_COMPLEX_R(VAL_NUM, FUNC, ARG, RES) do { \
+ if (COMPLEX_DIFF1PCT_F (__builtin_##FUNC##f(ARG), (RES)) \
+ || COMPLEX_CKSGN_F(__builtin_##FUNC##f(ARG), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ if (COMPLEX_DIFF1PCT (__builtin_##FUNC(ARG), (RES)) \
+ || COMPLEX_CKSGN(__builtin_##FUNC(ARG), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ if (COMPLEX_DIFF1PCT (__builtin_##FUNC(ARG), (RES)) \
+ || COMPLEX_CKSGN(__builtin_##FUNC(ARG), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ } while (0)
+
+/* Range test, for complex numbers check that FUNC(ARG0, ARG1) is
+ within 1% of RES. This is NOT a test for accuracy to the last-bit,
+ we're merely checking that we get relatively sane results.
+ I.e. the GCC builtin is hooked up to the correct MPC function call.
+ We first check the magnitude and then the sign. */
+#define TESTIT_COMPLEX_R2(VAL_NUM, FUNC, ARG0, ARG1, RES) do { \
+ if (COMPLEX_DIFF1PCT_F (__builtin_##FUNC##f(ARG0, ARG1), (RES)) \
+ || COMPLEX_CKSGN_F (__builtin_##FUNC##f(ARG0, ARG1), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ if (COMPLEX_DIFF1PCT (__builtin_##FUNC(ARG0, ARG1), (RES)) \
+ || COMPLEX_CKSGN (__builtin_##FUNC(ARG0, ARG1), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ if (COMPLEX_DIFF1PCT_L (__builtin_##FUNC##l(ARG0, ARG1), (RES)) \
+ || COMPLEX_CKSGN_L (__builtin_##FUNC##l(ARG0, ARG1), (RES))) \
+ link_error(__LINE__, VAL_NUM); \
+ } while (0)
+
+/* For complex numbers, call the TESTIT_COMPLEX_R2 macro for all
+ combinations of neg and conj. */
+#define TESTIT_COMPLEX_R2_ALLNEG(FUNC, ARG0, ARG1, RES1, RES2, RES3, RES4, RES5,\
+ RES6, RES7, RES8, RES9, RES10, RES11, RES12, RES13, RES14, RES15, RES16) do{ \
+ TESTIT_COMPLEX_R2(1, FUNC, (_Complex float)(ARG0),(_Complex float)(ARG1), RES1);\
+ TESTIT_COMPLEX_R2(2, FUNC, (_Complex float)(ARG0),CONJ(ARG1), RES2); \
+ TESTIT_COMPLEX_R2(3, FUNC, (_Complex float)(ARG0),-(_Complex float)(ARG1), RES3); \
+ TESTIT_COMPLEX_R2(4, FUNC, (_Complex float)(ARG0),-CONJ(ARG1), RES4); \
+ TESTIT_COMPLEX_R2(5, FUNC, -(_Complex float)(ARG0),(_Complex float)(ARG1), RES5); \
+ TESTIT_COMPLEX_R2(6, FUNC, -(_Complex float)(ARG0),CONJ(ARG1), RES6); \
+ TESTIT_COMPLEX_R2(7, FUNC, -(_Complex float)(ARG0),-(_Complex float)(ARG1), RES7); \
+ TESTIT_COMPLEX_R2(8, FUNC, -(_Complex float)(ARG0),-CONJ(ARG1), RES8); \
+ TESTIT_COMPLEX_R2(9, FUNC, CONJ(ARG0),(_Complex float)(ARG1), RES9); \
+ TESTIT_COMPLEX_R2(10, FUNC, CONJ(ARG0),CONJ(ARG1), RES10); \
+ TESTIT_COMPLEX_R2(11, FUNC, CONJ(ARG0),-(_Complex float)(ARG1), RES11); \
+ TESTIT_COMPLEX_R2(12, FUNC, CONJ(ARG0),-CONJ(ARG1), RES12); \
+ TESTIT_COMPLEX_R2(13, FUNC, -CONJ(ARG0),(_Complex float)(ARG1), RES13); \
+ TESTIT_COMPLEX_R2(14, FUNC, -CONJ(ARG0),CONJ(ARG1), RES14); \
+ TESTIT_COMPLEX_R2(15, FUNC, -CONJ(ARG0),-(_Complex float)(ARG1), RES15); \
+ TESTIT_COMPLEX_R2(16, FUNC, -CONJ(ARG0),-CONJ(ARG1), RES16); \
+} while (0)
+
+int main (void)
+{
+ TESTIT_COMPLEX (1, cacos, 1, CONJ(0));
+ TESTIT_COMPLEX_R (1, cacos, -1, CONJ(3.141593F));
+ TESTIT_COMPLEX (1, cacos, CONJ(1), 0);
+ TESTIT_COMPLEX_R (1, cacos, CONJ(-1), 3.141593F);
+ TESTIT_COMPLEX_R_ALLNEG (cacos, 3.45678F + 2.34567FI,
+ 0.60971F - 2.11780FI, 2.531875F - 2.117800FI,
+ 0.60971F + 2.11780FI, 2.531875F + 2.117800FI);
+
+ TESTIT_COMPLEX_ALLNEG (casin, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (casin, 3.45678F + 2.34567FI,
+ 0.96107F + 2.11780FI, -0.96107F + 2.11780FI,
+ 0.96107F - 2.11780FI, -0.96107F - 2.11780FI);
+
+ TESTIT_COMPLEX_ALLNEG (catan, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (catan, 3.45678F + 2.34567FI,
+ 1.37188F + 0.12997FI, -1.37188F + 0.12997FI,
+ 1.37188F - 0.12997FI, -1.37188F - 0.12997FI);
+
+ TESTIT_COMPLEX (1, cacosh, 1, 0);
+ TESTIT_COMPLEX_R (1, cacosh, -1, 3.141593FI);
+ TESTIT_COMPLEX (1, cacosh, CONJ(1), CONJ(0));
+ TESTIT_COMPLEX_R (1, cacosh, CONJ(-1), CONJ(3.141593FI));
+ TESTIT_COMPLEX_R_ALLNEG (cacosh, 3.45678F + 2.34567FI,
+ 2.11780F + 0.60971FI, 2.11780F + 2.531875FI,
+ 2.11780F - 0.60971FI, 2.11780F - 2.531875FI);
+
+ TESTIT_COMPLEX_ALLNEG (casinh, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (casinh, 3.45678F + 2.34567FI,
+ 2.12836F + 0.58310FI, -2.12836F + 0.58310FI,
+ 2.12836F - 0.58310FI, -2.12836F - 0.58310FI);
+
+ TESTIT_COMPLEX_ALLNEG (catanh, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (catanh, 3.45678F + 2.34567FI,
+ 0.19693F + 1.43190FI, -0.19693F + 1.43190FI,
+ 0.19693F - 1.43190FI, -0.19693F - 1.43190FI);
+
+ TESTIT_COMPLEX_ALLNEG (csin, 0,
+ 0, -0.F, CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (csin, 3.45678F + 2.34567FI,
+ -1.633059F - 4.917448FI, 1.633059F - 4.917448FI,
+ -1.633059F + 4.917448FI, 1.633059F + 4.917448FI);
+
+ TESTIT_COMPLEX_ALLNEG (ccos, 0,
+ CONJ(1), 1, 1, CONJ(1));
+ TESTIT_COMPLEX_R_ALLNEG (ccos, 3.45678F + 2.34567FI,
+ -5.008512F + 1.603367FI, -5.008512F - 1.603367FI,
+ -5.008512F - 1.603367FI, -5.008512F + 1.603367FI);
+
+ TESTIT_COMPLEX_ALLNEG (ctan, 0,
+ 0, -0.F, CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (ctan, 3.45678F + 2.34567FI,
+ 0.010657F + 0.985230FI, -0.010657F + 0.985230FI,
+ 0.010657F - 0.985230FI, -0.010657F - 0.985230FI);
+
+ TESTIT_COMPLEX_ALLNEG (csinh, 0,
+ 0, -0.F, CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (csinh, 3.45678F + 2.34567FI,
+ -11.083178F + 11.341487FI, 11.083178F +11.341487FI,
+ -11.083178F - 11.341487FI, 11.083178F -11.341487FI);
+
+ TESTIT_COMPLEX_ALLNEG (ccosh, 0,
+ 1, CONJ(1), CONJ(1), 1);
+ TESTIT_COMPLEX_R_ALLNEG (ccosh, 3.45678F + 2.34567FI,
+ -11.105238F + 11.318958FI,-11.105238F -11.318958FI,
+ -11.105238F - 11.318958FI,-11.105238F +11.318958FI);
+
+ TESTIT_COMPLEX_ALLNEG (ctanh, 0,
+ 0, -0.F, CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (ctanh, 3.45678F + 2.34567FI,
+ 1.000040F - 0.001988FI, -1.000040F - 0.001988FI,
+ 1.000040F + 0.001988FI, -1.000040F + 0.001988FI);
+
+ TESTIT_COMPLEX (1, clog, 1, 0);
+ TESTIT_COMPLEX_R (1, clog, -1, 3.141593FI);
+ TESTIT_COMPLEX (1, clog, CONJ(1), CONJ(0));
+ TESTIT_COMPLEX_R (1, clog, CONJ(-1), CONJ(3.141593FI));
+ TESTIT_COMPLEX_R_ALLNEG (clog, 3.45678F + 2.34567FI,
+ 1.429713F + 0.596199FI, 1.429713F + 2.545394FI,
+ 1.429713F - 0.596199FI, 1.429713F - 2.545394FI);
+
+ TESTIT_COMPLEX_ALLNEG (csqrt, 0,
+ 0, 0, CONJ(0), CONJ(0));
+ TESTIT_COMPLEX_R_ALLNEG (csqrt, 3.45678F + 2.34567FI,
+ 1.953750F + 0.600299FI, 0.600299F + 1.953750FI,
+ 1.953750F - 0.600299FI, 0.600299F - 1.953750FI);
+
+ TESTIT_COMPLEX2_ALLNEG (cpow, 1, 0,
+ 1, 1, CONJ(1), CONJ(1), CONJ(1), CONJ(1), 1, 1,
+ CONJ(1), CONJ(1), 1, 1, 1, 1, CONJ(1), CONJ(1));
+ TESTIT_COMPLEX2_ALLNEG (cpow, 1.FI, 0,
+ 1, 1, CONJ(1), CONJ(1), CONJ(1), CONJ(1), 1, 1,
+ CONJ(1), CONJ(1), 1, 1, 1, 1, CONJ(1), CONJ(1));
+ TESTIT_COMPLEX_R2_ALLNEG (cpow, 2, 3,
+ 8, 8, CONJ(1/8.F), CONJ(1/8.F), CONJ(-8), CONJ(-8), -1/8.F, -1/8.F,
+ CONJ(8), CONJ(8), 1/8.F, 1/8.F, -8, -8, CONJ(-1/8.F), CONJ(-1/8.F));
+ TESTIT_COMPLEX_R2_ALLNEG (cpow, 3, 4,
+ 81, 81, CONJ(1/81.F), CONJ(1/81.F), CONJ(81), CONJ(81), 1/81.F, 1/81.F,
+ CONJ(81), CONJ(81), 1/81.F, 1/81.F, 81, 81, CONJ(1/81.F), CONJ(1/81.F));
+ TESTIT_COMPLEX_R2_ALLNEG (cpow, 3, 5,
+ 243, 243, CONJ(1/243.F), CONJ(1/243.F), CONJ(-243), CONJ(-243), -1/243.F, -1/243.F,
+ CONJ(243), CONJ(243), 1/243.F, 1/243.F, -243, -243, CONJ(-1/243.F), CONJ(-1/243.F));
+ TESTIT_COMPLEX_R2_ALLNEG (cpow, 4, 2,
+ 16, 16, CONJ(1/16.F), CONJ(1/16.F), CONJ(16), CONJ(16), 1/16.F, 1/16.F,
+ CONJ(16), CONJ(16), 1/16.F, 1/16.F, 16, 16, CONJ(1/16.F), CONJ(1/16.F));
+ TESTIT_COMPLEX_R2_ALLNEG (cpow, 1.5, 3,
+ 3.375F, 3.375F, CONJ(1/3.375F), CONJ(1/3.375F), CONJ(-3.375F), CONJ(-3.375F), -1/3.375F, -1/3.375F,
+ CONJ(3.375F), CONJ(3.375F), 1/3.375F, 1/3.375F, -3.375F, -3.375F, CONJ(-1/3.375F), CONJ(-1/3.375F));
+
+ TESTIT_COMPLEX2 (1, cpow, 16, 0.25F, 2);
+
+ TESTIT_COMPLEX_R2 (1, cpow, 3.45678F + 2.34567FI, 1.23456 + 4.56789FI, 0.212485F + 0.319304FI);
+ TESTIT_COMPLEX_R2 (1, cpow, 3.45678F - 2.34567FI, 1.23456 + 4.56789FI, 78.576402F + -41.756208FI);
+ TESTIT_COMPLEX_R2 (1, cpow, -1.23456F + 2.34567FI, 2.34567 - 1.23456FI, -110.629847F + -57.021655FI);
+ TESTIT_COMPLEX_R2 (1, cpow, -1.23456F - 2.34567FI, 2.34567 - 1.23456FI, 0.752336F + 0.199095FI);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-7.c
new file mode 100644
index 000000000..064e28641
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-7.c
@@ -0,0 +1,102 @@
+/* Copyright (C) 2009 Free Software Foundation.
+
+ Verify that folding of complex mul and div work correctly.
+
+ Origin: Kaveh R. Ghazi, August 13, 2009. */
+
+/* { dg-do run } */
+/* C6X fails due to -freciprocal-math default. */
+/* { dg-skip-if "" { tic6x-*-* } "*" "" } */
+/* { dg-add-options ieee } */
+/* { dg-require-effective-target large_double } */
+
+extern void link_error(int);
+
+/* Evaluate this expression at compile-time. */
+#define COMPILETIME_TESTIT(TYPE,X,OP,Y,RES) do { \
+ if ((_Complex TYPE)(X) OP (_Complex TYPE)(Y) != (_Complex TYPE)(RES)) \
+ link_error(__LINE__); \
+} while (0)
+
+/* Use this error function for cases which only evaluate at
+ compile-time when optimizing. */
+#ifdef __OPTIMIZE__
+# define ERROR_FUNC(X) link_error(X)
+#else
+# define ERROR_FUNC(X) __builtin_abort()
+#endif
+
+/* Evaluate this expression at compile-time using static initializers. */
+#define STATICINIT_TESTIT(TYPE,X,OP,Y,RES) do { \
+ static const _Complex TYPE foo = (_Complex TYPE)(X) OP (_Complex TYPE)(Y); \
+ if (foo != (_Complex TYPE)(RES)) \
+ ERROR_FUNC (__LINE__); \
+} while (0)
+
+/* Evaluate this expression at runtime. */
+#define RUNTIME_TESTIT(TYPE,X,OP,Y,RES) do { \
+ volatile _Complex TYPE foo; \
+ foo = (_Complex TYPE)(X); \
+ foo OP##= (_Complex TYPE)(Y); \
+ if (foo != (_Complex TYPE)(RES)) \
+ __builtin_abort(); \
+} while (0)
+
+/* Evaluate this expression at compile-time and runtime. */
+#define TESTIT(TYPE,X,OP,Y,RES) do { \
+ STATICINIT_TESTIT(TYPE,X,OP,Y,RES); \
+ COMPILETIME_TESTIT(TYPE,X,OP,Y,RES); \
+ RUNTIME_TESTIT(TYPE,X,OP,Y,RES); \
+} while (0)
+
+/* Either the real or imaginary parts should be infinity. */
+#define TEST_ONE_PART_INF(VAL) do { \
+ static const _Complex double foo = (VAL); \
+ if (! __builtin_isinf(__real foo) && ! __builtin_isinf(__imag foo)) \
+ ERROR_FUNC (__LINE__); \
+ if (! __builtin_isinf(__real (VAL)) && ! __builtin_isinf(__imag (VAL))) \
+ __builtin_abort(); \
+} while (0)
+
+int main()
+{
+ /* Test some regular finite values. */
+ TESTIT (double, 3.+4.i, *, 2, 6+8i);
+ TESTIT (double, 3.+4.i, /, 2, 1.5+2i);
+ TESTIT (int, 3+4i, *, 2, 6+8i);
+ TESTIT (int, 3+4i, /, 2, 1+2i);
+
+ TESTIT (double, 3.+4.i, *, 2+5i, -14+23i);
+ TESTIT (double, 3.+4.i, /, 5i, .8-.6i);
+ TESTIT (int, 3+4i, *, 2+5i, -14+23i);
+ TESTIT (int, 30+40i, /, 5i, 8-6i);
+ TESTIT (int, 14+6i, /, 7+3i, 2);
+ TESTIT (int, 8+24i, /, 4+12i, 2);
+
+ /* Test that we don't overflow. */
+ TESTIT (double,
+ (__DBL_MAX__ * 0.5 + __DBL_MAX__ * 0.5i),
+ /,
+ (__DBL_MAX__ * 0.25 + __DBL_MAX__ * 0.25i),
+ 2);
+
+ /* Test for accuracy. */
+ COMPILETIME_TESTIT (double,
+ (1 + __DBL_EPSILON__ + 1i),
+ *,
+ (1 - __DBL_EPSILON__ + 1i),
+ -4.93038065763132378382330353301741393545754021943139377981e-32+2i);
+
+ /* This becomes (NaN + iInf). */
+#define VAL1 ((_Complex double)__builtin_inf() * 1i)
+
+ /* Test some C99 Annex G special cases. */
+ TEST_ONE_PART_INF ((VAL1) * (VAL1));
+ TEST_ONE_PART_INF ((_Complex double)1 / (_Complex double)0);
+ TEST_ONE_PART_INF ((VAL1) / (_Complex double)1);
+
+ RUNTIME_TESTIT (double, 1, /, VAL1, 0);
+ STATICINIT_TESTIT (double, 1, /, VAL1, 0);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-8.c
new file mode 100644
index 000000000..1a1a843e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-math-8.c
@@ -0,0 +1,34 @@
+/* { dg-do link } */
+
+extern void link_error (void);
+
+int main()
+{
+ if (!__builtin_constant_p(1.0))
+ link_error ();
+ if (!__builtin_constant_p(__builtin_fma (1.0, 1.0, 1.0)))
+ link_error ();
+
+ if (__builtin_constant_p(__builtin_fmaf (__FLT_MAX__, __FLT_MAX__, 0.0F)))
+ link_error ();
+ if (__builtin_constant_p(__builtin_fmaf (__FLT_MAX__, 1.0F, __FLT_MAX__)))
+ link_error ();
+ if (__builtin_constant_p(__builtin_fmaf (__FLT_MIN__, __FLT_MIN__, 0.0F)))
+ link_error ();
+
+ if (__builtin_constant_p(__builtin_fma (__DBL_MAX__, __DBL_MAX__, 0.0)))
+ link_error ();
+ if (__builtin_constant_p(__builtin_fma (__DBL_MAX__, 1.0, __DBL_MAX__)))
+ link_error ();
+ if (__builtin_constant_p(__builtin_fma (__DBL_MIN__, __DBL_MIN__, 0.0)))
+ link_error ();
+
+ if (__builtin_constant_p(__builtin_fmal (__LDBL_MAX__, __LDBL_MAX__, 0.0L)))
+ link_error ();
+ if (__builtin_constant_p(__builtin_fmal (__LDBL_MAX__, 1.0L, __LDBL_MAX__)))
+ link_error ();
+ if (__builtin_constant_p(__builtin_fmal (__LDBL_MIN__, __LDBL_MIN__, 0.0L)))
+ link_error ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-minmax-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-minmax-1.c
new file mode 100644
index 000000000..13831ad3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-minmax-1.c
@@ -0,0 +1,128 @@
+/* Copyright (C) 2006 Free Software Foundation.
+
+ Verify that built-in math function folding of fmin/fmax is
+ correctly performed by the compiler.
+
+ Origin: Kaveh R. Ghazi, November 13, 2006. */
+
+/* { dg-do link } */
+/* { dg-options "-fno-math-errno" } */
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(int);
+
+#define DECLARE(FUNC) \
+ extern float FUNC##f (float); \
+ extern double FUNC (double); \
+ extern long double FUNC##l (long double)
+#define DECLARE2(FUNC) \
+ extern float FUNC##f (float, float); \
+ extern double FUNC (double, double); \
+ extern long double FUNC##l (long double, long double)
+
+DECLARE2(fmin);
+DECLARE2(fmax);
+DECLARE(fabs);
+extern int pure(int) __attribute__ ((__pure__));
+
+/* Test that FUNC(x,x) == x. We cast to (long) so "!=" folds. */
+#define TEST_EQ(FUNC) do { \
+ if ((long)FUNC##f(xf,xf) != (long)xf) \
+ link_error(__LINE__); \
+ if ((long)FUNC(x,x) != (long)x) \
+ link_error(__LINE__); \
+ if ((long)FUNC##l(xl,xl) != (long)xl) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(purefn,purefn) == purefn. We cast to (long) so "!=" folds. */
+#define TEST_EQ_PURE(FUNC) do { \
+ if ((long)FUNC##f(pure(i),pure(i)) != (long)FUNC##f(pure(i),pure(i))) \
+ link_error(__LINE__); \
+ if ((long)FUNC(pure(i),pure(i)) != (long)FUNC(pure(i),pure(i))) \
+ link_error(__LINE__); \
+ if ((long)FUNC##l(pure(i),pure(i)) != (long)FUNC##l(pure(i),pure(i))) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FIXFUNC(FUNC(int1,int2)) == (TYPE)FUNC(int1,int2),
+ i.e. FIXFUNC should be folded away and replaced with a cast. */
+#define TEST_FIXFUNC(FUNC,FIXFUNC,TYPE) do { \
+ if (FIXFUNC##f(FUNC##f(i,j)) != (TYPE)FUNC##f(i,j)) \
+ link_error(__LINE__); \
+ if (FIXFUNC(FUNC(i,j)) != (TYPE)FUNC(i,j)) \
+ link_error(__LINE__); \
+ if (FIXFUNC##l(FUNC##l(i,j)) != (TYPE)FUNC##l(i,j)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(int1,int2) has an integer return type. */
+#define TEST_INT(FUNC) do { \
+ TEST_FIXFUNC(FUNC,__builtin_lround,long); \
+ TEST_FIXFUNC(FUNC,__builtin_llround,long long); \
+ TEST_FIXFUNC(FUNC,__builtin_lrint,long); \
+ TEST_FIXFUNC(FUNC,__builtin_llrint,long long); \
+ TEST_FIXFUNC(FUNC,__builtin_lceil,long); \
+ TEST_FIXFUNC(FUNC,__builtin_llceil,long long); \
+ TEST_FIXFUNC(FUNC,__builtin_lfloor,long); \
+ TEST_FIXFUNC(FUNC,__builtin_llfloor,long long); \
+ } while (0)
+
+/* Test that (long)fabs(FUNC(fabs(x),fabs(y))) ==
+ (long)FUNC(fabs(x),fabs(y)). We cast to (long) so "!=" folds. */
+#define TEST_NONNEG(FUNC) do { \
+ if ((long)fabsf(FUNC##f(fabsf(xf),fabsf(yf))) != (long)FUNC##f(fabsf(xf),fabsf(yf))) \
+ link_error(__LINE__); \
+ if ((long)fabs(FUNC(fabs(x),fabs(y))) != (long)FUNC(fabs(x),fabs(y))) \
+ link_error(__LINE__); \
+ if ((long)fabsl(FUNC##l(fabsl(xl),fabsl(yl))) != (long)FUNC##l(fabsl(xl),fabsl(yl))) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(NaN,x) == x. We cast to (long) so "!=" folds. Set
+ parameter SIGNAL to `s' for testing signaling NaN. */
+#define TEST_NAN(FUNC,SIGNAL) do { \
+ if ((long)FUNC##f(__builtin_nan##SIGNAL##f(""),xf) != (long)xf) \
+ link_error(__LINE__); \
+ if ((long)FUNC##f(xf,__builtin_nan##SIGNAL##f("")) != (long)xf) \
+ link_error(__LINE__); \
+ if ((long)FUNC(__builtin_nan##SIGNAL(""),x) != (long)x) \
+ link_error(__LINE__); \
+ if ((long)FUNC(x,__builtin_nan##SIGNAL("")) != (long)x) \
+ link_error(__LINE__); \
+ if ((long)FUNC##l(__builtin_nan##SIGNAL##l(""),xl) != (long)xl) \
+ link_error(__LINE__); \
+ if ((long)FUNC##l(xl,__builtin_nan##SIGNAL##l("")) != (long)xl) \
+ link_error(__LINE__); \
+ } while (0)
+
+void __attribute__ ((__noinline__))
+ foo (float xf, double x, long double xl,
+ float yf, double y, long double yl,
+ int i, int j)
+{
+ TEST_EQ(fmin);
+ TEST_EQ(fmax);
+
+#ifdef __OPTIMIZE__
+ TEST_EQ_PURE(fmin);
+ TEST_EQ_PURE(fmax);
+#endif
+
+ TEST_INT(fmin);
+ TEST_INT(fmax);
+
+ TEST_NONNEG(fmin);
+ TEST_NONNEG(fmax);
+
+ TEST_NAN(fmin,);
+ TEST_NAN(fmax,);
+ TEST_NAN(fmin,s);
+ TEST_NAN(fmax,s);
+}
+
+int main()
+{
+ foo (1,1,1,1,1,1,1,1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-modf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-modf-1.c
new file mode 100644
index 000000000..05e16ac2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-modf-1.c
@@ -0,0 +1,195 @@
+/* Copyright (C) 2007 Free Software Foundation.
+
+ Verify that built-in folding of modf is correctly performed by the
+ compiler.
+
+ Origin: Kaveh R. Ghazi, February 23, 2007. */
+
+/* { dg-do link } */
+/* { dg-options "-fno-finite-math-only" { target sh*-*-* } } */
+/* { dg-options "-funsafe-math-optimizations -fsigned-zeros -fno-associative-math" { target powerpc-*-darwin* powerpc*-*-linux* } } */
+
+extern void link_error(int);
+
+/* Return TRUE if the sign of X != sign of Y. This is important when
+ comparing signed zeros. */
+#define CKSGN_F(X,Y) \
+ (__builtin_copysignf(1.0F,(X)) != __builtin_copysignf(1.0F,(Y)))
+#define CKSGN(X,Y) \
+ (__builtin_copysign(1.0,(X)) != __builtin_copysign(1.0,(Y)))
+#define CKSGN_L(X,Y) \
+ (__builtin_copysignl(1.0L,(X)) != __builtin_copysignl(1.0L,(Y)))
+
+/* We use these macros if we can only check these when optimizing. In
+ some cases we rely on other optimizations to propagate the value
+ and fold away certain constructs. Likewise for the sign testing.
+ TRUE means an error occurred. */
+#ifdef __OPTIMIZE__
+#define CKRES(X) (X)
+#define CKIPTR(X,Y) X != Y
+#define CKSGN_IPTR_F(X,Y) CKSGN_F(X,Y)
+#define CKSGN_IPTR(X,Y) CKSGN(X,Y)
+#define CKSGN_IPTR_L(X,Y) CKSGN_L(X,Y)
+#else
+#define CKRES(X) 0
+#define CKIPTR(X,Y) 0
+#define CKSGN_IPTR_F(X,Y) 0
+#define CKSGN_IPTR(X,Y) 0
+#define CKSGN_IPTR_L(X,Y) 0
+#endif
+
+/* Test that modf(ARG1,&iptr) == FRACRES && iptr == INTRES. Check the
+ sign in case we get -0.0. */
+#define TESTIT_MODF(ARG,INTRES,FRACRES) do { \
+ float iptrf = 0.5; double iptr = 0.5; long double iptrl = 0.5; \
+ if (__builtin_modff(ARG##f,&iptrf) != FRACRES##f \
+ || CKIPTR(iptrf,INTRES##f) \
+ || CKSGN_F(__builtin_modff(ARG##f,&iptrf),FRACRES##f) \
+ || CKSGN_IPTR_F(iptrf,INTRES##f)) \
+ link_error(__LINE__); \
+ if (__builtin_modf(ARG,&iptr) != FRACRES \
+ || CKIPTR(iptr,INTRES) \
+ || CKSGN(__builtin_modf(ARG,&iptr),FRACRES) \
+ || CKSGN_IPTR(iptr,INTRES)) \
+ link_error(__LINE__); \
+ if (__builtin_modfl(ARG##l,&iptrl) != FRACRES##l \
+ || CKIPTR(iptrl,INTRES##l) \
+ || CKSGN_L(__builtin_modfl(ARG##l,&iptrl),FRACRES##l) \
+ || CKSGN_IPTR_L(iptrl,INTRES##l)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that modf(NEG FUNCARG(ARGARG, &iptr)) == FRACRES &&
+ FUNCRES(iptr) is true. Check the sign of both as well. This is
+ for checking an argument of Inf. */
+#ifndef __SPU__
+#define TESTIT_MODF2(NEG,FUNCARG,ARGARG,FUNCRES,FRACRES) do { \
+ float iptrf = 0.5; double iptr = 0.5; long double iptrl = 0.5; \
+ if (__builtin_modff(NEG __builtin_##FUNCARG##f(ARGARG),&iptrf) != FRACRES##f \
+ || CKSGN_F(__builtin_modff(NEG __builtin_##FUNCARG##f(ARGARG),&iptrf), FRACRES##f) \
+ || CKIPTR(!__builtin_##FUNCRES##f(iptrf),0) \
+ || CKSGN_IPTR_F(iptrf,FRACRES##f)) \
+ link_error(__LINE__); \
+ if (__builtin_modf(NEG __builtin_##FUNCARG(ARGARG),&iptr) != FRACRES \
+ || CKSGN(__builtin_modf(NEG __builtin_##FUNCARG(ARGARG),&iptr), FRACRES) \
+ || CKIPTR(!__builtin_##FUNCRES(iptr),0) \
+ || CKSGN_IPTR(iptr,FRACRES)) \
+ link_error(__LINE__); \
+ if (__builtin_modfl(NEG __builtin_##FUNCARG##l(ARGARG),&iptrl) != FRACRES##l \
+ || CKSGN_L(__builtin_modfl(NEG __builtin_##FUNCARG##l(ARGARG),&iptrl), FRACRES##l) \
+ || CKIPTR(!__builtin_##FUNCRES##l(iptrl),0) \
+ || CKSGN_IPTR_L(iptrl,FRACRES##l)) \
+ link_error(__LINE__); \
+ } while (0)
+#else
+#define TESTIT_MODF2(NEG,FUNCARG,ARGARG,FUNCRES,FRACRES) do { \
+ /* SPU single-precision floating point format does not support Inf or Nan. */ \
+ double iptr = 0.5; long double iptrl = 0.5; \
+ if (__builtin_modf(NEG __builtin_##FUNCARG(ARGARG),&iptr) != FRACRES \
+ || CKSGN(__builtin_modf(NEG __builtin_##FUNCARG(ARGARG),&iptr), FRACRES) \
+ || CKIPTR(!__builtin_##FUNCRES(iptr),0) \
+ || CKSGN_IPTR(iptr,FRACRES)) \
+ link_error(__LINE__); \
+ if (__builtin_modfl(NEG __builtin_##FUNCARG##l(ARGARG),&iptrl) != FRACRES##l \
+ || CKSGN_L(__builtin_modfl(NEG __builtin_##FUNCARG##l(ARGARG),&iptrl), FRACRES##l) \
+ || CKIPTR(!__builtin_##FUNCRES##l(iptrl),0) \
+ || CKSGN_IPTR_L(iptrl,FRACRES##l)) \
+ link_error(__LINE__); \
+ } while (0)
+#endif
+
+/* Test that FUNCRES(modf(NEG FUNCARG(ARGARG, &iptr))) is true &&
+ FUNCRES(iptr) is true. Check the sign of both as well. This is
+ for checking an argument of NaN. */
+#ifndef __SPU__
+#define TESTIT_MODF3(NEG,FUNCARG,ARGARG,FUNCRES) do { \
+ float iptrf = 0.5; double iptr = 0.5; long double iptrl = 0.5; \
+ if (CKRES(!__builtin_##FUNCRES##f(__builtin_modff(NEG __builtin_##FUNCARG##f(ARGARG),&iptrf))) \
+ || CKSGN_F(__builtin_modff(NEG __builtin_##FUNCARG##f(ARGARG),&iptrf), NEG 1) \
+ || CKIPTR(!__builtin_##FUNCRES##f(iptrf),0) \
+ || CKSGN_IPTR_F(iptrf,NEG 1)) \
+ link_error(__LINE__); \
+ if (CKRES(!__builtin_##FUNCRES(__builtin_modf(NEG __builtin_##FUNCARG(ARGARG),&iptr))) \
+ || CKSGN(__builtin_modf(NEG __builtin_##FUNCARG(ARGARG),&iptr), NEG 1) \
+ || CKIPTR(!__builtin_##FUNCRES(iptr),0) \
+ || CKSGN_IPTR(iptr,NEG 1)) \
+ link_error(__LINE__); \
+ if (CKRES(!__builtin_##FUNCRES##l(__builtin_modfl(NEG __builtin_##FUNCARG##l(ARGARG),&iptrl))) \
+ || CKSGN_L(__builtin_modfl(NEG __builtin_##FUNCARG##l(ARGARG),&iptrl), NEG 1) \
+ || CKIPTR(!__builtin_##FUNCRES##l(iptrl),0) \
+ || CKSGN_IPTR_L(iptrl,NEG 1)) \
+ link_error(__LINE__); \
+ } while (0)
+#else
+#define TESTIT_MODF3(NEG,FUNCARG,ARGARG,FUNCRES) do { \
+ /* SPU single-precision floating point format does not support Inf or Nan. */ \
+ double iptr = 0.5; long double iptrl = 0.5; \
+ if (CKRES(!__builtin_##FUNCRES(__builtin_modf(NEG __builtin_##FUNCARG(ARGARG),&iptr))) \
+ || CKSGN(__builtin_modf(NEG __builtin_##FUNCARG(ARGARG),&iptr), NEG 1) \
+ || CKIPTR(!__builtin_##FUNCRES(iptr),0) \
+ || CKSGN_IPTR(iptr,NEG 1)) \
+ link_error(__LINE__); \
+ if (CKRES(!__builtin_##FUNCRES##l(__builtin_modfl(NEG __builtin_##FUNCARG##l(ARGARG),&iptrl))) \
+ || CKSGN_L(__builtin_modfl(NEG __builtin_##FUNCARG##l(ARGARG),&iptrl), NEG 1) \
+ || CKIPTR(!__builtin_##FUNCRES##l(iptrl),0) \
+ || CKSGN_IPTR_L(iptrl,NEG 1)) \
+ link_error(__LINE__); \
+ } while (0)
+#endif
+
+void __attribute__ ((__noinline__))
+foo(void)
+{
+ /* Test that modf(ARG1,&iptr) -> ARG3 && iptr == ARG2. */
+ TESTIT_MODF (0x1p10F+0.5, 0x1p10, 0.5);
+ TESTIT_MODF (0x1p10F+0x1p-10, 0x1p10, 0x1p-10);
+ TESTIT_MODF (12345678L/17.0, 726216.0, -726216L+12345678L/17.0);
+ TESTIT_MODF (555.555, 555.0, -555+555.555);
+ TESTIT_MODF (5000/11.0, 454.0, -454+5000/11.0);
+ TESTIT_MODF (1000/7.0, 142.0, -142+1000/7.0);
+ TESTIT_MODF (123/7.0, 17.0, -17+123/7.0);
+ TESTIT_MODF (117/7.0, 16.0, -16+117/7.0);
+ TESTIT_MODF (5.5, 5.0, 0.5);
+ TESTIT_MODF (1.5, 1.0, 0.5);
+ TESTIT_MODF (4/3.0, 1.0, -1+4/3.0);
+ TESTIT_MODF (1.0, 1.0, 0.0);
+ TESTIT_MODF (0.5, 0.0, 0.5);
+ TESTIT_MODF (4/9.0, 0.0, 4/9.0);
+ TESTIT_MODF (1/3.0, 0.0, 1/3.0);
+ TESTIT_MODF (1/9.0, 0.0, 1/9.0);
+ TESTIT_MODF (0.0, 0.0, 0.0);
+
+ TESTIT_MODF (-0.0, -0.0, -0.0);
+ TESTIT_MODF (-1/9.0, -0.0, -1/9.0);
+ TESTIT_MODF (-1/3.0, -0.0, -1/3.0);
+ TESTIT_MODF (-4/9.0, -0.0, -4/9.0);
+ TESTIT_MODF (-0.5, -0.0, -0.5);
+ TESTIT_MODF (-1.0, -1.0, -0.0);
+ TESTIT_MODF (-4/3.0, -1.0, 1-4/3.0);
+ TESTIT_MODF (-1.5, -1.0, -0.5);
+ TESTIT_MODF (-5.5, -5.0, -0.5);
+ TESTIT_MODF (-117/7.0, -16.0, 16-117/7.0);
+ TESTIT_MODF (-123/7.0, -17.0, 17-123/7.0);
+ TESTIT_MODF (-1000/7.0, -142.0, 142-1000/7.0);
+ TESTIT_MODF (-5000/11.0, -454.0, 454-5000/11.0);
+ TESTIT_MODF (-555.555, -555.0, 555-555.555);
+ TESTIT_MODF (-12345678L/17.0, -726216.0, 726216L-12345678L/17.0);
+ TESTIT_MODF (-0x1p10F-0x1p-10, -0x1p10, -0x1p-10);
+ TESTIT_MODF (-0x1p10F-0.5, -0x1p10, -0.5);
+
+
+ /* Test for modf(+-Inf,&i) -> (i=+-0.0, +-Inf). */
+ TESTIT_MODF2 ( ,inf, , isinf, 0.0);
+ TESTIT_MODF2 (- ,inf, , isinf, -0.0);
+
+ /* Test for and modf(+-NaN,&i) -> (i=+-NaN, +-NaN). */
+ TESTIT_MODF3 ( ,nan, "", isnan);
+ TESTIT_MODF3 (- ,nan, "", isnan);
+}
+
+int main()
+{
+ foo();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-nonneg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-nonneg-1.c
new file mode 100644
index 000000000..8a3286a59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-nonneg-1.c
@@ -0,0 +1,180 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that GCC can determine which built-in functions produce a
+ nonnegative result.
+
+ Written by Kaveh Ghazi, 2004-03-10. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+#define PROTOTYPE_RTYPE(FN,RTYPE) extern RTYPE FN(double); \
+ extern RTYPE FN##f(float); \
+ extern RTYPE FN##l(long double);
+#define PROTOTYPE(FN) extern double FN(double); extern float FN##f(float); \
+ extern long double FN##l(long double);
+#define PROTOTYPE2(FN) extern double FN(double, double); \
+ extern float FN##f(float, float); \
+ extern long double FN##l(long double, long double);
+#define CPROTOTYPE1(FN) extern double FN(_Complex double); \
+ extern float FN##f(_Complex float); \
+ extern long double FN##l(_Complex long double);
+#define CPROTOTYPE1(FN) extern double FN(_Complex double); \
+ extern float FN##f(_Complex float); \
+ extern long double FN##l(_Complex long double);
+#define IPROTOTYPE(FN) extern int FN(int); extern int FN##l(long); \
+ extern int FN##ll(long long);
+#define PROTOTYPE2TYPE2(FN,A2TYPE) extern double FN(double, A2TYPE); \
+ extern float FN##f(float, A2TYPE); \
+ extern long double FN##l(long double, A2TYPE);
+#define PROTOTYPE2_A2FPTR(FN) extern double FN(double, double *); \
+ extern float FN##f(float, float *); \
+ extern long double FN##l(long double, long double *);
+
+extern int signbit (double);
+extern int signbitf (float);
+extern int signbitl (long double);
+
+void test(double d1, double d2, float f1, float f2,
+ long double ld1, long double ld2)
+{
+ /* These are always nonnegative. */
+
+#define TEST1(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE(FN) \
+ if (signbit(FN(d1)) || signbitf(FN##f(f1)) || signbitl(FN##l(ld1))) \
+ link_failure_##FN()
+
+#define TEST2(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(d1,d2)) || signbitf(FN##f(f1,f2)) || signbitl(FN##l(ld1,ld2))) \
+ link_failure_##FN()
+
+#define CTEST1(FN) \
+ extern void link_failure_##FN (void); CPROTOTYPE1(FN) \
+ if (signbit(FN(d1)) || signbitf(FN##f(f1)) || signbitl(FN##l(ld1))) \
+ link_failure_##FN()
+
+#define ITEST1(FN) \
+ extern void link_failure_##FN (void); IPROTOTYPE(FN) \
+ if (signbit(FN(d1)) || signbitf(FN##l(f1)) || signbitl(FN##ll(ld1))) \
+ link_failure_##FN()
+
+ TEST1 (acos);
+ TEST1 (acosh);
+ CTEST1 (cabs);
+ TEST1 (cosh);
+ TEST1 (erfc);
+ TEST1 (exp);
+ TEST1 (exp10);
+ TEST1 (exp2);
+ TEST1 (fabs);
+ TEST2 (fdim);
+ TEST2 (hypot);
+ TEST1 (pow10);
+ TEST1 (sqrt);
+ ITEST1 (ffs);
+ ITEST1 (__builtin_parity);
+ ITEST1 (__builtin_popcount);
+
+ /* These are nonnegative if the first argument is. */
+#define ARG1TEST1(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE(FN) \
+ if (signbit(FN(fabs(d1))) || signbitf(FN##f(fabsf(f1))) \
+ || signbitl(FN##l(fabsl(ld1)))) \
+ link_failure_##FN()
+
+ /* Same, but allow specifying the return type. */
+#define ARG1TEST1_RTYPE(FN,RTYPE) \
+ extern void link_failure_##FN (void); PROTOTYPE_RTYPE(FN,RTYPE) \
+ if (signbit(FN(fabs(d1))) || signbitf(FN##f(fabsf(f1))) \
+ || signbitl(FN##l(fabsl(ld1)))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first argument is. */
+#define ARG1TEST2(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(fabs(d1),d2)) || signbitf(FN##f(fabsf(f1),f2)) \
+ || signbitl(FN##l(fabsl(ld1),ld2))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the second argument is. */
+#define ARG2TEST2(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(d1,fabs(d2))) || signbitf(FN##f(f1,fabsf(f2))) \
+ || signbitl(FN##l(ld1,fabsl(ld2)))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first OR second argument is. */
+#define ARG2TESTor(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(fabs(d1),d2)) || signbitf(FN##f(fabsf(f1),f2)) \
+ || signbitl(FN##l(fabsl(ld1),ld2)) || signbit(FN(d1,fabs(d2))) \
+ || signbitf(FN##f(f1,fabsf(f2))) || signbitl(FN##l(ld1,fabsl(ld2)))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first AND second argument is. */
+#define ARG2TESTand(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2(FN) \
+ if (signbit(FN(fabs(d1),fabs(d2))) || signbitf(FN##f(fabsf(f1),fabsf(f2))) \
+ || signbitl(FN##l(fabsl(ld1),fabsl(ld2)))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first argument is, 2nd arg is an int. */
+#define ARG1TEST2_A2INT(FN, INTTYPE) \
+ extern void link_failure_##FN (void); PROTOTYPE2TYPE2(FN, INTTYPE) \
+ if (signbit(FN(fabs(d1),d2)) || signbitf(FN##f(fabsf(f1),f2)) \
+ || signbitl(FN##l(fabsl(ld1),ld2))) \
+ link_failure_##FN()
+
+ /* These are nonnegative if the first argument is, specify 2nd arg. */
+#define ARG2TEST1_A2FPTR(FN) \
+ extern void link_failure_##FN (void); PROTOTYPE2_A2FPTR(FN) \
+ if (signbit(FN(fabs(d1),&d2)) || signbitf(FN##f(fabsf(f1),&f2)) \
+ || signbitl(FN##l(fabsl(ld1),&ld2))) \
+ link_failure_##FN()
+
+ ARG1TEST1 (asinh);
+ ARG1TEST1 (atan);
+ ARG1TEST1 (atanh);
+ ARG1TEST1 (cbrt);
+ ARG1TEST1 (ceil);
+ ARG1TEST1 (erf);
+ ARG1TEST1 (expm1);
+ ARG1TEST1 (floor);
+ ARG1TEST2 (fmod);
+ ARG1TEST2_A2INT (ldexp, int);
+ ARG1TEST1_RTYPE (__builtin_llceil, long long);
+ ARG1TEST1_RTYPE (__builtin_llfloor, long long);
+ ARG1TEST1_RTYPE (llrint, long long);
+ ARG1TEST1_RTYPE (llround, long long);
+ ARG1TEST1_RTYPE (__builtin_lceil, long);
+ ARG1TEST1_RTYPE (__builtin_lfloor, long);
+ ARG1TEST1_RTYPE (lrint, long);
+ ARG1TEST1_RTYPE (lround, long);
+ /* The modf* functions aren't ever "const" or "pure" even with
+ -ffast-math so they won't be eliminated and yield a link failure. */
+ /* ARG2TEST1_A2FPTR (modf);*/
+ ARG1TEST1 (nearbyint);
+ ARG1TEST2 (pow);
+ ARG1TEST1 (rint);
+ ARG1TEST1 (round);
+ ARG1TEST2 (scalb);
+ ARG1TEST2_A2INT (scalbln, long);
+ ARG1TEST2_A2INT (scalbn, int);
+ ARG1TEST1_RTYPE (signbit, int);
+ ARG1TEST1 (significand);
+ ARG1TEST1 (sinh);
+ ARG1TEST1 (tanh);
+ ARG1TEST1 (trunc);
+
+ ARG2TESTor (fmax);
+ ARG2TESTand (fmin);
+ ARG2TEST2 (copysign);
+
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-noret-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-noret-1.c
new file mode 100644
index 000000000..d3e97701f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-noret-1.c
@@ -0,0 +1,79 @@
+/* Test for builtin noreturn attributes. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-options "-multiply_defined suppress" { target powerpc-*-darwin* } } */
+/* { dg-do link } */
+/* { dg-require-weak "" } */
+
+extern void abort (void);
+extern void exit (int);
+extern void _exit (int);
+extern void _Exit (int);
+
+extern void tabort (void);
+extern void texit (void);
+extern void t_exit (void);
+extern void t_Exit (void);
+
+extern void link_failure (void);
+
+/* Some libcs have _exit and/or _Exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _exit
+#pragma weak _Exit
+
+int
+main (void)
+{
+ volatile int i = 0;
+ if (i)
+ tabort ();
+ if (i)
+ texit ();
+ if (i)
+ t_exit ();
+ if (i)
+ t_Exit ();
+ exit (0);
+}
+
+void
+tabort (void)
+{
+ abort ();
+ link_failure ();
+}
+
+void
+texit (void)
+{
+ exit (1);
+ link_failure ();
+}
+
+void
+t_exit (void)
+{
+ _exit (1);
+ link_failure ();
+}
+
+/* Some non-Unix libcs might not have _exit. */
+void
+_exit (int i)
+{
+ abort ();
+}
+
+void
+t_Exit (void)
+{
+ _Exit (1);
+ link_failure ();
+}
+
+/* Some libcs might not have _Exit. */
+void
+_Exit (int i)
+{
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-noret-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-noret-2.c
new file mode 100644
index 000000000..1103e3d81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-noret-2.c
@@ -0,0 +1,89 @@
+/* Test for builtin noreturn attributes when the visible declarations
+ are function-local. Modified from builtin-noret-1.c by Zack Weinberg
+ <zack@codesourcery.com>. */
+/* { dg-options "-multiply_defined suppress" { target powerpc-*-darwin* } } */
+/* { dg-do link } */
+/* { dg-require-weak "" } */
+
+extern void tabort (void);
+extern void texit (void);
+extern void t_exit (void);
+extern void t_Exit (void);
+
+extern void link_failure (void);
+
+int
+main (void)
+{
+ volatile int i = 0;
+ extern void exit (int);
+ if (i)
+ tabort ();
+ if (i)
+ texit ();
+ if (i)
+ t_exit ();
+ if (i)
+ t_Exit ();
+ exit (0);
+}
+
+void
+tabort (void)
+{
+ extern void abort (void);
+ abort ();
+ link_failure ();
+}
+
+void
+texit (void)
+{
+ extern void exit (int);
+ exit (1);
+ link_failure ();
+}
+
+void
+t_exit (void)
+{
+ extern void _exit (int);
+ /* Some non-Unix libcs have _exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _exit
+ _exit (1);
+ link_failure ();
+}
+
+/* Some non-Unix libcs might not have _exit. */
+/* Some non-Unix libcs have _exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _exit
+void
+_exit (int i)
+{
+ extern void abort (void);
+ abort ();
+}
+
+void
+t_Exit (void)
+{
+ extern void _Exit (int);
+ /* Some libcs have _Exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _Exit
+ _Exit (1);
+ link_failure ();
+}
+
+/* Some libcs might not have _Exit. */
+/* Some libcs have _Exit, and won't allow it to be re-defined,
+ so make it weak. */
+#pragma weak _Exit
+void
+_Exit (int i)
+{
+ extern void abort (void);
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-pow-mpfr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-pow-mpfr-1.c
new file mode 100644
index 000000000..6206b9ee3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-pow-mpfr-1.c
@@ -0,0 +1,19 @@
+/* Version 2.2.0 of MPFR had bugs in pow underflow/overflow. This
+ test checks to see if that buggy version was installed. The
+ problem is NOT fixed with the version 2.2.0 "cumulative patch".
+ However it is fixed in version 2.2.1 and presumably later MPFR
+ versions.
+
+ Origin: Kaveh R. Ghazi 12/17/2006. */
+
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+extern double testit()
+{
+ /* This underflows and therefore gcc should not fold it. */
+ return __builtin_pow (0.11, 1.0e38);
+}
+
+/* { dg-final { scan-tree-dump "pow" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-power-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-power-1.c
new file mode 100644
index 000000000..9e7c25adb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-power-1.c
@@ -0,0 +1,114 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Verify that built-in folding of various math "power" functions is
+ correctly performed by the compiler.
+
+ Written by Kaveh Ghazi, 2004-03-11. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+/* { dg-add-options c99_runtime } */
+/* { dg-skip-if "PR44214" { *-*-* } { "-O0" } { "" } } */
+
+#include "../builtins-config.h"
+
+#ifdef HAVE_C99_RUNTIME
+#define C99CODE(CODE) CODE
+#else
+#define C99CODE(CODE) 0
+#endif
+
+#define PROTOTYPE(FN) extern double FN(double); extern float FN##f(float); \
+ extern long double FN##l(long double);
+#define PROTOTYPE2(FN) extern double FN(double, double); \
+ extern float FN##f(float, float); \
+ extern long double FN##l(long double, long double);
+
+PROTOTYPE(fabs)
+PROTOTYPE(sqrt)
+PROTOTYPE(cbrt)
+PROTOTYPE2(pow)
+
+void test(double d1, double d2, double d3,
+ float f1, float f2, float f3,
+ long double ld1, long double ld2, long double ld3)
+{
+ /* Test N1root(N2root(x)) -> pow(x,1/(N1*N2)). */
+ /* E.g. sqrt(cbrt(x)) -> pow(x,1/6). */
+ /* The `ABS' argument is `fabs' when the transformation only works
+ for nonnegative arguments. Otherwise it's blank. */
+#define ROOT_ROOT(FN1,N1,FN2,N2,ABS) \
+ extern void link_failure_##FN1##_##FN2(void); \
+ if (FN1(FN2(ABS(d1))) != pow(ABS(d1),1.0/(N1*N2)) \
+ || C99CODE (FN1##f(FN2##f(ABS(f1))) != powf(ABS(f1),1.0F/(N1*N2))) \
+ || C99CODE (FN1##l(FN2##l(ABS(ld1))) != powl(ABS(ld1),1.0L/(N1*N2)))) \
+ link_failure_##FN1##_##FN2()
+
+ ROOT_ROOT(sqrt,2,sqrt,2,);
+ ROOT_ROOT(sqrt,2,cbrt,3,);
+ ROOT_ROOT(cbrt,3,sqrt,2,);
+ ROOT_ROOT(cbrt,3,cbrt,3,fabs);
+
+ /* Test pow(Nroot(x),y) -> pow(x,y/N). */
+ /* The `ABS' argument is `fabs' when the transformation only works
+ for nonnegative arguments. Otherwise it's blank. */
+#define POW_ROOT(FN,N,ABS) \
+ extern void link_failure_pow_##FN(void); \
+ if (pow(FN(ABS(d1)), d2) != pow(ABS(d1),d2/N) \
+ || powf(FN##f(ABS(f1)),f2) != powf(ABS(f1),f2/N) \
+ || powl(FN##l(ABS(ld1)),ld2) != powl(ABS(ld1),ld2/N)) \
+ link_failure_pow_##FN()
+
+ POW_ROOT(sqrt,2,);
+ POW_ROOT(cbrt,3,fabs);
+
+ /* Test Nroot(pow(x,y)) -> pow(x,y/N). */
+ /* The `ABS' argument is `fabs' when the transformation only works
+ for nonnegative arguments. Otherwise it's blank. */
+#define ROOT_POW(FN,N,ABS) \
+ extern void link_failure_##FN##_pow(void); \
+ if (FN(pow(ABS(d1), d2)) != pow(ABS(d1),d2/N) \
+ || FN##f(powf(ABS(f1),f2)) != powf(ABS(f1),f2/N) \
+ || FN##l(powl(ABS(ld1),ld2)) != powl(ABS(ld1),ld2/N)) \
+ link_failure_##FN##_pow()
+
+ ROOT_POW(sqrt,2,fabs);
+ ROOT_POW(cbrt,3,fabs);
+
+ /* Test pow(pow(x,y),z) -> pow(x,y*z). */
+#define POW_POW \
+ extern void link_failure_pow_pow(void); \
+ if (pow(pow(fabs(d1), d2), d3) != pow(fabs(d1),d2*d3) \
+ || powf(powf(fabs(f1),f2),f3) != powf(fabs(f1),f2*f3) \
+ || powl(powl(fabs(ld1),ld2),ld3) != powl(fabs(ld1),ld2*ld3)) \
+ link_failure_pow_pow()
+
+ POW_POW;
+
+ /* Test Nroot(x)*Nroot(y) -> Nroot(x*y). */
+#define ROOT_X_ROOT(FN) \
+ extern void link_failure_root_x_root(void); \
+ if (FN(d1)*FN(d2) != FN(d1*d2) \
+ || FN##f(f1)*FN##f(f2) != FN##f(f1*f2) \
+ || FN##l(ld1)*FN##l(ld2) != FN##l(ld1*ld2)) \
+ link_failure_root_x_root()
+
+ ROOT_X_ROOT(sqrt);
+ ROOT_X_ROOT(cbrt);
+
+ /* Test pow(x,y)*pow(x,z) -> pow(x,y+z). */
+#define POW_X_POW \
+ extern void link_failure_pow_x_pow(void); \
+ if (pow(d1,d2)*pow(d1,d3) != pow(d1,d2+d3) \
+ || powf(f1,f2)*powf(f1,f3) != powf(f1,f2+f3) \
+ || powl(ld1,ld2)*powl(ld1,ld3) != powl(ld1,ld2+ld3)) \
+ link_failure_pow_x_pow()
+
+ POW_X_POW;
+
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-rounding-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-rounding-1.c
new file mode 100644
index 000000000..816cffc04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-rounding-1.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 2004 Free Software Foundation.
+
+ Check that constant folding of the rounding math functions doesn't
+ break anything and produces the expected results.
+
+ Written by Kaveh Ghazi, 2004-04-29. */
+
+/* { dg-do link } */
+
+extern int link_error (int);
+
+#define TEST(FN, VALUE, RESULT) \
+ if (__builtin_##FN (VALUE) != RESULT) link_error (__LINE__); \
+ if (__builtin_##FN##f (VALUE) != RESULT) link_error (__LINE__); \
+ if (__builtin_##FN##l (VALUE) != RESULT) link_error (__LINE__); \
+
+int
+main (void)
+{
+ TEST(trunc, 0, 0);
+ TEST(floor, 0, 0);
+ TEST(ceil, 0, 0);
+ TEST(round, 0, 0);
+ TEST(lround, 0, 0);
+ TEST(llround, 0, 0);
+ TEST(lfloor, 0, 0);
+ TEST(llfloor, 0, 0);
+ TEST(lceil, 0, 0);
+ TEST(llceil, 0, 0);
+
+ TEST(trunc, 6, 6);
+ TEST(floor, 6, 6);
+ TEST(ceil, 6, 6);
+ TEST(round, 6, 6);
+ TEST(lround, 6, 6);
+ TEST(llround, 6, 6);
+ TEST(lfloor, 6, 6);
+ TEST(llfloor, 6, 6);
+ TEST(lceil, 6, 6);
+ TEST(llceil, 6, 6);
+
+ TEST(trunc, -8, -8);
+ TEST(floor, -8, -8);
+ TEST(ceil, -8, -8);
+ TEST(round, -8, -8);
+ TEST(lround, -8, -8);
+ TEST(llround, -8, -8);
+ TEST(lfloor, -8, -8);
+ TEST(llfloor, -8, -8);
+ TEST(lceil, -8, -8);
+ TEST(llceil, -8, -8);
+
+ TEST(trunc, 3.2, 3);
+ TEST(floor, 3.2, 3);
+ TEST(ceil, 3.2, 4);
+ TEST(round, 3.2, 3);
+ TEST(lround, 3.2, 3);
+ TEST(llround, 3.2, 3);
+ TEST(lfloor, 3.2, 3);
+ TEST(llfloor, 3.2, 3);
+ TEST(lceil, 3.2, 4);
+ TEST(llceil, 3.2, 4);
+
+ TEST(trunc, -2.8, -2);
+ TEST(floor, -2.8, -3);
+ TEST(ceil, -2.8, -2);
+ TEST(round, -2.8, -3);
+ TEST(lround, -2.8, -3);
+ TEST(llround, -2.8, -3);
+ TEST(lfloor, -2.8, -3);
+ TEST(llfloor, -2.8, -3);
+ TEST(lceil, -2.8, -2);
+ TEST(llceil, -2.8, -2);
+
+ TEST(trunc, 0.01, 0);
+ TEST(floor, 0.01, 0);
+ TEST(ceil, 0.01, 1);
+ TEST(round, 0.01, 0);
+ TEST(lround, 0.01, 0);
+ TEST(llround, 0.01, 0);
+ TEST(lfloor, 0.01, 0);
+ TEST(llfloor, 0.01, 0);
+ TEST(lceil, 0.01, 1);
+ TEST(llceil, 0.01, 1);
+
+ TEST(trunc, -0.7, 0);
+ TEST(floor, -0.7, -1);
+ TEST(ceil, -0.7, 0);
+ TEST(round, -0.7, -1);
+ TEST(lround, -0.7, -1);
+ TEST(llround, -0.7, -1);
+ TEST(lfloor, -0.7, -1);
+ TEST(llfloor, -0.7, -1);
+ TEST(lceil, -0.7, 0);
+ TEST(llceil, -0.7, 0);
+
+ TEST(trunc, 2.5, 2);
+ TEST(floor, 2.5, 2);
+ TEST(ceil, 2.5, 3);
+ TEST(round, 2.5, 3);
+ TEST(lround, 2.5, 3);
+ TEST(llround, 2.5, 3);
+ TEST(lfloor, 2.5, 2);
+ TEST(llfloor, 2.5, 2);
+ TEST(lceil, 2.5, 3);
+ TEST(llceil, 2.5, 3);
+
+ TEST(trunc, -1.5, -1);
+ TEST(floor, -1.5, -2);
+ TEST(ceil, -1.5, -1);
+ TEST(round, -1.5, -2);
+ TEST(lround, -1.5, -2);
+ TEST(llround, -1.5, -2);
+ TEST(lfloor, -1.5, -2);
+ TEST(llfloor, -1.5, -2);
+ TEST(lceil, -1.5, -1);
+ TEST(llceil, -1.5, -1);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-self.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-self.c
new file mode 100644
index 000000000..6d1719f75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-self.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* Check that we can use this idiom to define out-of-line copies of built-in
+ functions. This is used by libgcc/sync.c, for example. */
+void __sync_synchronize (void)
+{
+ __sync_synchronize ();
+}
+/* { dg-final { scan-assembler "__sync_synchronize" } } */
+/* { dg-final { scan-assembler "\t(lock|mfence)" } } */
+/* { dg-final { scan-assembler-not "\tcall" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-sin-mpfr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-sin-mpfr-1.c
new file mode 100644
index 000000000..359728708
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-sin-mpfr-1.c
@@ -0,0 +1,29 @@
+/* Version 2.2.0 of MPFR had bugs in sin rounding. This test checks
+ to see if that buggy version was installed. The problem is fixed
+ in version 2.2.1 and presumably later MPFR versions.
+
+ Origin: Kaveh R. Ghazi 10/23/2006. */
+
+/* { dg-do link } */
+
+extern void link_error (int, double, double);
+
+#define TESTIT(ARG,RES) do { \
+ if (sizeof (double) == 8 && __builtin_sin(ARG) != RES) \
+ link_error(__LINE__, __builtin_sin(ARG), RES); \
+ } while (0);
+
+int main()
+{
+ TESTIT (-0x1.c0016155c4da3p-1, -0x1.88fc58bcf030dp-1);
+
+ TESTIT (0x1.30654d85c2756p-2, 0x1.2beeb9de27a79p-2);
+
+ TESTIT (0x1.fe68ccaa8e201p+2, 0x1.fc3f0c54e97a7p-1);
+
+ /* This case should always pass. */
+ TESTIT (0.0, 0.0);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-symmetric-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-symmetric-1.c
new file mode 100644
index 000000000..4834d8e2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-symmetric-1.c
@@ -0,0 +1,111 @@
+/* Copyright (C) 2006 Free Software Foundation.
+
+ Verify that built-in math function folding of symmetric even and
+ odd functions is correctly performed by the compiler.
+
+ Origin: Kaveh R. Ghazi, November 09, 2006. */
+
+/* { dg-do link } */
+/* { dg-options "-ffast-math" } */
+
+/* All references to link_error should go away at compile-time. */
+extern void link_error(int);
+
+/* Test that FUNC(-ARG) == FUNC(ARG). */
+#define TESTIT_EVEN(FUNC) do { \
+ if (__builtin_##FUNC##f(-xf) != __builtin_##FUNC##f(xf)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(-x) != __builtin_##FUNC(x)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(-xl) != __builtin_##FUNC##l(xl)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(-ARG) == FUNC(ARG), where ARG has a complex type. */
+#define TESTIT_EVEN_C(FUNC) do { \
+ if (__builtin_##FUNC##f(-cxf) != __builtin_##FUNC##f(cxf)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC(-cx) != __builtin_##FUNC(cx)) \
+ link_error(__LINE__); \
+ if (__builtin_##FUNC##l(-cxl) != __builtin_##FUNC##l(cxl)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that FUNC(-VAR) == FUNC(VAR), where VAR has an int type. */
+#define TESTIT_EVEN_I(FUNC,VAR) do { \
+ if (__builtin_##FUNC(-VAR) != __builtin_##FUNC(VAR)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that -FUNC(ARG) == FUNC(-ARG). */
+#define TESTIT_ODD(FUNC) do { \
+ if (-__builtin_##FUNC##f(-xf) != __builtin_##FUNC##f(xf)) \
+ link_error(__LINE__); \
+ if (-__builtin_##FUNC(-x) != __builtin_##FUNC(x)) \
+ link_error(__LINE__); \
+ if (-__builtin_##FUNC##l(-xl) != __builtin_##FUNC##l(xl)) \
+ link_error(__LINE__); \
+ } while (0)
+
+/* Test that -FUNC(ARG) == FUNC(-ARG), where ARG has a complex type. */
+#define TESTIT_ODD_C(FUNC) do { \
+ if (-__builtin_##FUNC##f(-cxf) != __builtin_##FUNC##f(cxf)) \
+ link_error(__LINE__); \
+ if (-__builtin_##FUNC(-cx) != __builtin_##FUNC(cx)) \
+ link_error(__LINE__); \
+ if (-__builtin_##FUNC##l(-cxl) != __builtin_##FUNC##l(cxl)) \
+ link_error(__LINE__); \
+ } while (0)
+
+void foo (float xf, double x, long double xl,
+ __complex__ float cxf, __complex__ double cx, __complex__ long double cxl,
+ int i, long l, long long ll, __INTMAX_TYPE__ im)
+{
+ TESTIT_EVEN(cos);
+ TESTIT_EVEN(cosh);
+ TESTIT_EVEN(fabs);
+
+ TESTIT_EVEN_C(ccos);
+ TESTIT_EVEN_C(ccosh);
+ TESTIT_EVEN_C(cabs);
+
+ TESTIT_EVEN_I(abs, i);
+ TESTIT_EVEN_I(imaxabs, im);
+ TESTIT_EVEN_I(labs, l);
+ TESTIT_EVEN_I(llabs, ll);
+
+ TESTIT_ODD(asin);
+ TESTIT_ODD(asinh);
+ TESTIT_ODD(atan);
+ TESTIT_ODD(atanh);
+ TESTIT_ODD(cbrt);
+ TESTIT_ODD(erf);
+ TESTIT_ODD(llrint);
+ TESTIT_ODD(llround);
+ TESTIT_ODD(lrint);
+ TESTIT_ODD(lround);
+ TESTIT_ODD(nearbyint);
+ TESTIT_ODD(rint);
+ TESTIT_ODD(round);
+ TESTIT_ODD(sin);
+ TESTIT_ODD(sinh);
+ TESTIT_ODD(tan);
+ TESTIT_ODD(tanh);
+ TESTIT_ODD(trunc);
+
+ TESTIT_ODD_C(casin);
+ TESTIT_ODD_C(casinh);
+ TESTIT_ODD_C(catan);
+ TESTIT_ODD_C(catanh);
+ TESTIT_ODD_C(cproj);
+ TESTIT_ODD_C(csin);
+ TESTIT_ODD_C(csinh);
+ TESTIT_ODD_C(ctan);
+ TESTIT_ODD_C(ctanh);
+}
+
+int main()
+{
+ foo (1,1,1,1,1,1,1,1,1,1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-wctype-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-wctype-1.c
new file mode 100644
index 000000000..5b4371e14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtin-wctype-1.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2004, 2005 Free Software Foundation.
+
+ Verify that built-in wctype function attributes are correctly set
+ by the compiler.
+
+ Written by Kaveh Ghazi, 2004-03-25. */
+
+/* { dg-do link } */
+
+/* Use the target type definitions if we can. */
+#ifndef __WINT_TYPE__
+#define __WINT_TYPE__ int
+#endif
+
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ int
+#endif
+
+void test(int i)
+{
+ /* All of these ctype functions should be const/pure and thus
+ eliminated. */
+#define TEST_IS_WCTYPE(FN) \
+ extern int FN(__WINT_TYPE__); \
+ extern void link_failure_##FN(void); \
+ if (FN(i) != FN(i)) \
+ link_failure_##FN()
+
+#define TEST_TO_WCTYPE(FN) \
+ extern __WINT_TYPE__ FN(__WINT_TYPE__); \
+ extern void link_failure_##FN(void); \
+ if (FN(i) != FN(i)) \
+ link_failure_##FN()
+
+
+#ifdef __OPTIMIZE__
+ TEST_IS_WCTYPE(iswalnum);
+ TEST_IS_WCTYPE(iswalpha);
+ TEST_IS_WCTYPE(iswblank);
+ TEST_IS_WCTYPE(iswcntrl);
+ TEST_IS_WCTYPE(iswdigit);
+ TEST_IS_WCTYPE(iswgraph);
+ TEST_IS_WCTYPE(iswlower);
+ TEST_IS_WCTYPE(iswprint);
+ TEST_IS_WCTYPE(iswpunct);
+ TEST_IS_WCTYPE(iswspace);
+ TEST_IS_WCTYPE(iswupper);
+ TEST_IS_WCTYPE(iswxdigit);
+ TEST_TO_WCTYPE(towlower);
+ TEST_TO_WCTYPE(towupper);
+#endif /* __OPTIMIZE__ */
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtins-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtins-1.c
new file mode 100644
index 000000000..c0e8210a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/builtins-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-rtl-expand-all" */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
+int isdigit(int c)
+{
+ return c >= 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/c99-contract-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/c99-contract-1.c
new file mode 100644
index 000000000..602308308
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/c99-contract-1.c
@@ -0,0 +1,21 @@
+/* Test floating-point contraction occurs only within source language
+ expressions. */
+/* { dg-do run } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+extern void abort (void);
+extern void exit (int);
+
+volatile float a = 1 + 0x1p-23f, b = 1 - 0x1p-23f, c = -1;
+
+int
+main (void)
+{
+ float av = a, bv = b, cv = c;
+ float p = av * bv;
+ float r = p + cv;
+ if (r == 0)
+ exit (0);
+ else
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/calleesave-sse.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/calleesave-sse.c
new file mode 100644
index 000000000..292791c72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/calleesave-sse.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-options "-fno-omit-frame-pointer" } */
+
+#define alloca __builtin_alloca
+extern void abort (void);
+
+__attribute__ ((noinline)) static double
+bar (double a, double b, double c, double d, char *h)
+{
+ *h = 0;
+ return a * b + b + c;
+}
+
+__attribute__ ((noinline)) static int
+boo (double a, double b, double c, double d)
+{
+ return c * b + a + b;
+}
+
+__attribute__ ((noinline)) static double
+foo (double a, double b, double c, double d)
+{
+ int aa = boo (b, c, d, a);
+ return bar (a, b, c, d, (char *) alloca (aa))
+ + bar (d, c, b, a, (char *) alloca (aa));
+}
+
+int main ()
+{
+ double a = 2.0, b = 3.0, c = 4.0, d = 5.0;
+ double r1, r2;
+ int aa;
+
+ aa = boo (b, c, d, a);
+ r1 = bar (a, b, c, d, (char *) alloca (aa))
+ + bar (d, c, b, a, (char *) alloca (aa));
+ r2 = foo (a, b, c, d);
+
+ if (r1 != r2)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c
new file mode 100644
index 000000000..5ebde5ed5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile { target cris-*-* crisv32-*-* } } */
+/* { dg-skip-if "" { cris*-*-* } { "-march*" } { "" } } */
+/* { dg-options "-O2 -march=v10" } */
+/* { dg-final { scan-assembler "in-asm: .mof" } } */
+/* { dg-final { scan-assembler "out-asm: .mof" } } */
+/* { dg-final { scan-assembler "in2-asm: .mof" } } */
+/* { dg-final { scan-assembler "out2-asm: .mof" } } */
+
+unsigned int
+in (unsigned int i)
+{
+ register int i0 asm ("mof") = i;
+ asm ("in-asm: %0" : : "x" (i0));
+}
+
+unsigned int
+out (void)
+{
+ register int o asm ("mof");
+ asm ("out-asm: %0" : "=x" (o));
+ return o;
+}
+
+unsigned int
+in2 (unsigned int i)
+{
+ asm ("in2-asm: %0" : : "h" (i));
+}
+
+unsigned int
+out2 (void)
+{
+ unsigned int o;
+ asm ("out2-asm: %0" : "=h" (o));
+ return o;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/cris-volatile-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/cris-volatile-1.c
new file mode 100644
index 000000000..6b19852c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/cris-volatile-1.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 2003 Free Software Foundation.
+ Check that size-optimizations for move insns (specifically peephole
+ optimizations) aren't applied to volatile objects in the CRIS port.
+ Origin: Hans-Peter Nilsson. */
+/* { dg-do compile { target cris-*-* crisv32-*-* } } */
+/* { dg-final { scan-assembler-not {movu\...\[} } } */
+/* { dg-final { scan-assembler-not {move\.[^d].\[} } } */
+/* { dg-final { scan-assembler-not {and\.[^d].\[} } } */
+/* { dg-final { scan-assembler-not {or\.[^d].\[} } } */
+
+static const unsigned long c = 0x0000FF00;
+unsigned long
+a1 (void)
+{
+ unsigned long m;
+ m = *(volatile unsigned long*) 0xb00000c8;
+ m &= c;
+ return m;
+}
+extern volatile unsigned long xx;
+unsigned long
+a2 (void)
+{
+ unsigned long m;
+ m = xx;
+ m &= c;
+ return m;
+}
+extern volatile unsigned long yy[];
+unsigned long
+a3 (void)
+{
+ unsigned long m;
+ m = yy[3];
+ m &= 0xfe00;
+ return m;
+}
+unsigned long
+ac1 (void)
+{
+ unsigned long m;
+ m = *(volatile unsigned long*) 0xb00000c8;
+ m &= 0xfe00;
+ return m;
+}
+extern volatile unsigned long xx;
+unsigned long
+ac2 (void)
+{
+ unsigned long m;
+ m = xx;
+ m &= 0xfe00;
+ return m;
+}
+extern volatile unsigned long yy[];
+unsigned long
+ac3 (void)
+{
+ unsigned long m;
+ m = yy[3];
+ m &= 0xfe00;
+ return m;
+}
+extern volatile unsigned long yy[];
+unsigned long
+oc3 (void)
+{
+ unsigned long m;
+ m = yy[3];
+ m |= ~0xf;
+ return m;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/darwin-cfstring-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/darwin-cfstring-3.c
new file mode 100644
index 000000000..2d755ec8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/darwin-cfstring-3.c
@@ -0,0 +1,30 @@
+/* Test whether the __builtin__CFStringMakeConstantString
+ "function" generates compile-time objects with the correct layout. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-mconstant-cfstrings" } */
+
+typedef const struct __CFString *CFStringRef;
+
+#ifdef __CONSTANT_CFSTRINGS__
+#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString (STR))
+#else
+#error __CONSTANT_CFSTRINGS__ not defined
+#endif
+
+extern int cond;
+extern const char *func(void);
+
+CFStringRef s0 = CFSTR("Hello" "there");
+
+void foo(void) {
+ const CFStringRef s1 = CFSTR("Str1");
+
+ s0 = s1;
+}
+
+/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+4\n" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+10\n" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".quad\t___CFConstantStringClassReference\n\t.long\t1992\n\t.space 4\n\t.quad\t.*\n\t.quad\t4\n" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".quad\t___CFConstantStringClassReference\n\t.long\t1992\n\t.space 4\n\t.quad\t.*\n\t.quad\t10\n" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/dg-torture.exp b/gcc-4.9/gcc/testsuite/gcc.dg/torture/dg-torture.exp
new file mode 100644
index 000000000..cb91c791e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/dg-torture.exp
@@ -0,0 +1,7 @@
+# This harness is for tests that should be run at all optimisation levels.
+
+load_lib gcc-dg.exp
+
+dg-init
+gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c $srcdir/c-c++-common/torture/*.c]] ""
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
new file mode 100644
index 000000000..9d37ba25b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-cmp-invalid.c
@@ -0,0 +1,19 @@
+/* Test for "invalid" exceptions from __float128 comparisons. */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-require-effective-target fenv_exceptions } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ volatile __float128 a = __builtin_nan (""), b = 0;
+ volatile int r = a < b;
+ if (!fetestexcept (FE_INVALID))
+ abort ();
+ if (r)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-div-underflow.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-div-underflow.c
new file mode 100644
index 000000000..f721e562b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-div-underflow.c
@@ -0,0 +1,19 @@
+/* Test for spurious underflow from __float128 division. */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-require-effective-target fenv_exceptions } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ volatile __float128 a = 0x0.fffp-16382q, b = 0x0.fffp0q, c;
+ c = a / b;
+ if (fetestexcept (FE_UNDERFLOW | FE_INEXACT))
+ abort ();
+ if (c != 0x1p-16382q)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-extend-nan.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-extend-nan.c
new file mode 100644
index 000000000..60f9bbe94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-extend-nan.c
@@ -0,0 +1,23 @@
+/* Test extensions to __float128 quiet signaling NaNs. */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "-fsignaling-nans" } */
+/* { dg-require-effective-target fenv_exceptions } */
+
+#include <fenv.h>
+#include <float.h>
+#include <stdlib.h>
+
+volatile long double a = __builtin_nansl ("");
+
+int
+main (void)
+{
+#if LDBL_MANT_DIG < 113
+ volatile __float128 r = a;
+ feclearexcept (FE_INVALID);
+ r += 1;
+ if (fetestexcept (FE_INVALID))
+ abort ();
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c
new file mode 100644
index 000000000..e3ebfffc9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-mul-underflow.c
@@ -0,0 +1,21 @@
+/* Test __float128 multiplication uses after-rounding tininess
+ detection. */
+
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-require-effective-target fenv_exceptions } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ volatile __float128 a = 0x1.fffffffffffffffp-16382q, b = 0x1.0000000000000008p-1q, c;
+ c = a * b;
+ if (fetestexcept (FE_UNDERFLOW))
+ abort ();
+ if (c != 0x1p-16382q)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-truncdf-underflow.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-truncdf-underflow.c
new file mode 100644
index 000000000..83b05387e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-truncdf-underflow.c
@@ -0,0 +1,27 @@
+/* Test truncation from __float128 to double uses after-rounding
+ tininess detection. */
+
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-require-effective-target fenv_exceptions } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ volatile __float128 a = 0x0.fffffffffffffffp-1022q, b = 0x0.fffffffffffff8p-1022q;
+ volatile double r;
+ r = (double) a;
+ if (fetestexcept (FE_UNDERFLOW))
+ abort ();
+ if (r != 0x1p-1022)
+ abort ();
+ r = (double) b;
+ if (!fetestexcept (FE_UNDERFLOW))
+ abort ();
+ if (r != 0x1p-1022)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-truncsf-underflow.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-truncsf-underflow.c
new file mode 100644
index 000000000..3f1a71366
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/float128-truncsf-underflow.c
@@ -0,0 +1,27 @@
+/* Test truncation from __float128 to float uses after-rounding
+ tininess detection. */
+
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-require-effective-target fenv_exceptions } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ volatile __float128 a = 0x0.ffffffffffp-126q, b = 0x0.ffffffp-126q;
+ volatile float r;
+ r = (float) a;
+ if (fetestexcept (FE_UNDERFLOW))
+ abort ();
+ if (r != 0x1p-126f)
+ abort ();
+ r = (float) b;
+ if (!fetestexcept (FE_UNDERFLOW))
+ abort ();
+ if (r != 0x1p-126f)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-compare.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-compare.c
new file mode 100644
index 000000000..0d51dfd24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-compare.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* Check that find_scan_insn properly handles swapped FP comparisons. */
+static double x;
+static int exit_code;
+
+void __attribute__ ((noinline))
+check_int (int a, int b)
+{
+ exit_code += (a != b);
+}
+
+int
+main (void)
+{
+ x = 0.0;
+ asm ("" : "+m" (x));
+ check_int (__builtin_isgreater (x, 1.0), 0);
+ check_int (__builtin_isgreaterequal (x, 1.0), 0);
+ check_int (__builtin_isless (x, 1.0), 1);
+ check_int (__builtin_islessequal (x, 1.0), 1);
+ check_int (__builtin_islessgreater (x, 1.0), 1);
+ return exit_code;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-2.c
new file mode 100644
index 000000000..4c00e8fa7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-2.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int128 } */
+
+extern void abort (void);
+
+float __attribute__((noinline))
+f (__uint128_t x)
+{
+ return x + 1;
+}
+
+int
+main (void)
+{
+ if (f (0xffffffffu) == 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c
new file mode 100644
index 000000000..39ec3cde1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-double.c
@@ -0,0 +1,18 @@
+/* Test floating-point conversions. Standard types and double. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include <float.h>
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, double, DBL_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, double, DBL_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, double, DBL_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, double, DBL_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, double, DBL_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
new file mode 100644
index 000000000..7fca1df7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c
@@ -0,0 +1,18 @@
+/* Test floating-point conversions. Standard types and float. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include <float.h>
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, float, FLT_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, float, FLT_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, float, FLT_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, float, FLT_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, float, FLT_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-2.c
new file mode 100644
index 000000000..9990e190c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-2.c
@@ -0,0 +1,21 @@
+/* Test floating-point conversions. __float128 type with TImode: bug
+ 53317. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ volatile unsigned long long a = 0x1000000000000ULL;
+ volatile unsigned long long b = 0xffffffffffffffffULL;
+ unsigned __int128 c = (((unsigned __int128) a) << 64) | b;
+ __float128 d = c;
+ if (d != 0x1.000000000000ffffffffffffffffp112q)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c
new file mode 100644
index 000000000..944494d9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c
@@ -0,0 +1,23 @@
+/* Test for correct rounding of conversions from __int128 to
+ __float128. */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-frounding-math" } */
+
+#include <fenv.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ volatile unsigned long long h = -1ULL;
+ volatile unsigned __int128 u128 = (((unsigned __int128) h) << 64) | h;
+ volatile __int128 s128 = u128 >> 1;
+ fesetround (FE_TOWARDZERO);
+ __float128 ru = u128, rs = s128;
+ if (ru != 0x1.ffffffffffffffffffffffffffffp127q)
+ abort ();
+ if (rs != 0x1.ffffffffffffffffffffffffffffp126q)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
new file mode 100644
index 000000000..8318f8ad8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode.c
@@ -0,0 +1,15 @@
+/* Test floating-point conversions. __float128 type with TImode. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT128_MANT_DIG 113
+
+int
+main (void)
+{
+ TEST_I_F(TItype, UTItype, __float128, FLOAT128_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
new file mode 100644
index 000000000..bc5e5adeb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128.c
@@ -0,0 +1,19 @@
+/* Test floating-point conversions. __float128 type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT128_MANT_DIG 113
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, __float128, FLOAT128_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, __float128, FLOAT128_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, __float128, FLOAT128_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, __float128, FLOAT128_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, __float128, FLOAT128_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c
new file mode 100644
index 000000000..7600994b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80-timode.c
@@ -0,0 +1,16 @@
+/* Test floating-point conversions. __float80 type with TImode. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+/* { dg-options "-mmmx" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT80_MANT_DIG 64
+
+int
+main (void)
+{
+ TEST_I_F(TItype, UTItype, __float80, FLOAT80_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c
new file mode 100644
index 000000000..3e25f904d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-float80.c
@@ -0,0 +1,19 @@
+/* Test floating-point conversions. __float80 type. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run { target i?86-*-* x86_64-*-* ia64-*-* } } */
+/* { dg-options "" } */
+
+#include "fp-int-convert.h"
+
+#define FLOAT80_MANT_DIG 64
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, __float80, FLOAT80_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, __float80, FLOAT80_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, __float80, FLOAT80_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, __float80, FLOAT80_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, __float80, FLOAT80_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c
new file mode 100644
index 000000000..bb189a34c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-long-double.c
@@ -0,0 +1,18 @@
+/* Test floating-point conversions. Standard types and long double. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include <float.h>
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+ TEST_I_F(signed char, unsigned char, long double, LDBL_MANT_DIG);
+ TEST_I_F(signed short, unsigned short, long double, LDBL_MANT_DIG);
+ TEST_I_F(signed int, unsigned int, long double, LDBL_MANT_DIG);
+ TEST_I_F(signed long, unsigned long, long double, LDBL_MANT_DIG);
+ TEST_I_F(signed long long, unsigned long long, long double, LDBL_MANT_DIG);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
new file mode 100644
index 000000000..3a60d01ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c
@@ -0,0 +1,21 @@
+/* Test floating-point conversions. TImode types. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "" } */
+
+#include <float.h>
+#include "fp-int-convert.h"
+
+int
+main (void)
+{
+ TEST_I_F(TItype, UTItype, float, FLT_MANT_DIG);
+ TEST_I_F(TItype, UTItype, double, DBL_MANT_DIG);
+ /* Disable the long double tests when using IBM Extended Doubles.
+ They have variable precision, but constants calculated by gcc's
+ real.c assume fixed precision. */
+#if DBL_MANT_DIG != LDBL_MANT_DIG && LDBL_MANT_DIG != 106
+ TEST_I_F(TItype, UTItype, long double, LDBL_MANT_DIG);
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert.h b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert.h
new file mode 100644
index 000000000..8ac9c3de1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/fp-int-convert.h
@@ -0,0 +1,89 @@
+/* Test floating-point conversions. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+
+#include <limits.h>
+extern void abort (void);
+extern void exit (int);
+
+/* Not all platforms support TImode integers; logic as in
+ gcc.dg/titype-1.c. */
+#if (defined(__LP64__) && !defined(__hppa__)) || defined(_WIN64) || defined(__SPU__)
+typedef int TItype __attribute__ ((mode (TI)));
+typedef unsigned int UTItype __attribute__ ((mode (TI)));
+#else
+typedef long TItype;
+typedef unsigned long UTItype;
+#endif
+
+/* TEST_I_F(I, U, F, P) tests conversions between the pair of signed
+ and unsigned integer types I and U and the floating-point type F,
+ where P is the binary precision of the floating point type. We
+ test conversions of the values 0, 1, 0x7...f, 0x8...0, 0xf...f. We
+ also test conversions of values half way between two
+ representable values (rounding both ways), just above half way, and
+ just below half way. */
+#define TEST_I_F(I, U, F, P) \
+do { \
+ TEST_I_F_VAL (I, F, (I)0, 1); \
+ TEST_I_F_VAL (I, F, (I)1, 1); \
+ TEST_I_F_VAL (I, F, (I)(((U)~(U)0) >> 1), P_OK1 (P, I)); \
+ TEST_I_F_VAL (I, F, (I)(U)~(((U)~(U)0) >> 1), 1); \
+ TEST_I_F_VAL (I, F, (I)(U)~(U)0, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL0S (P, I), P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL0S (P, I) + 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL0S (P, I) - 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL1S (P, I), P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL1S (P, I) + 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, HVAL1S (P, I) - 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL0S (P, I), P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL0S (P, I) + 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL0S (P, I) - 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL1S (P, I), P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL1S (P, I) + 1, P_OK (P, I)); \
+ TEST_I_F_VAL (I, F, -HVAL1S (P, I) - 1, P_OK (P, I)); \
+ TEST_I_F_VAL (U, F, (U)0, 1); \
+ TEST_I_F_VAL (U, F, (U)1, 1); \
+ TEST_I_F_VAL (U, F, (U)(((U)~(U)0) >> 1), P_OK1 (P, U)); \
+ TEST_I_F_VAL (U, F, (U)~(((U)~(U)0) >> 1), 1); \
+ TEST_I_F_VAL (U, F, (U)~(U)0, P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL0U (P, U), P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL0U (P, U) + 1, P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL0U (P, U) - 1, P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL1U (P, U), P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL1U (P, U) + 1, P_OK (P, U)); \
+ TEST_I_F_VAL (U, F, HVAL1U (P, U) - 1, P_OK (P, U)); \
+} while (0)
+
+#define P_OK(P, T) ((P) >= sizeof(T) * CHAR_BIT)
+#define P_OK1(P, T) ((P) >= sizeof(T) * CHAR_BIT - 1)
+#define HVAL0U(P, U) (U)(P_OK (P, U) \
+ ? (U)1 \
+ : (((U)1 << (sizeof(U) * CHAR_BIT - 1)) \
+ + ((U)1 << (sizeof(U) * CHAR_BIT - 1 - P))))
+#define HVAL1U(P, U) (U)(P_OK (P, U) \
+ ? (U)1 \
+ : (((U)1 << (sizeof(U) * CHAR_BIT - 1)) \
+ + ((U)3 << (sizeof(U) * CHAR_BIT - 1 - P))))
+#define HVAL0S(P, S) (S)(P_OK1 (P, S) \
+ ? (S)1 \
+ : (((S)1 << (sizeof(S) * CHAR_BIT - 2)) \
+ + ((S)1 << (sizeof(S) * CHAR_BIT - 2 - P))))
+#define HVAL1S(P, S) (S)(P_OK1 (P, S) \
+ ? (S)1 \
+ : (((S)1 << (sizeof(S) * CHAR_BIT - 2)) \
+ + ((S)3 << (sizeof(S) * CHAR_BIT - 2 - P))))
+
+#define TEST_I_F_VAL(IT, FT, VAL, PREC_OK) \
+do { \
+ static volatile IT ivin, ivout; \
+ static volatile FT fv1, fv2; \
+ ivin = (VAL); \
+ fv1 = (VAL); \
+ fv2 = ivin; \
+ ivout = fv2; \
+ if (ivin != (VAL) \
+ || ((PREC_OK) && ivout != ivin) \
+ || ((PREC_OK) && ivout != (VAL)) \
+ || fv1 != (VAL) || fv2 != (VAL) || fv1 != fv2) \
+ abort (); \
+} while (0)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/inline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/inline-1.c
new file mode 100644
index 000000000..c7144ca68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/inline-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "--param ggc-min-heapsize=0 --param ggc-min-expand=0" } */
+/* This used to ICE because we forgot to update the statement after folding
+ and the eh info. */
+/* PR tree-opt/30385 */
+
+static inline void g(int t)
+{
+ int a;
+ while (a < f())
+ ;
+}
+void h(int t)
+{
+ g(t);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/inline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/inline-2.c
new file mode 100644
index 000000000..0d341bfad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/inline-2.c
@@ -0,0 +1,35 @@
+/* { dg-do link } */
+
+extern inline void foo2 (void) __attribute__((always_inline,gnu_inline));
+extern inline void foo1 (void) __attribute__((always_inline,gnu_inline));
+void bar1 (void);
+void bar2 (void);
+
+extern inline void __attribute__((always_inline,gnu_inline))
+foo2 (void)
+{
+ bar2 ();
+}
+
+void
+bar1 (void)
+{
+ foo2 ();
+}
+
+void
+bar2 (void)
+{
+ foo1 ();
+}
+
+extern inline void __attribute__((always_inline,gnu_inline))
+foo1 (void)
+{
+ bar1 ();
+}
+
+int main()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
new file mode 100644
index 000000000..aae987de3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
@@ -0,0 +1,46 @@
+/* { dg-do compile { target { nonpic } } } */
+/* { dg-options "-fipa-pta -fdump-ipa-pta" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+struct X { char x; char y; };
+
+char *q;
+
+static void __attribute__((noinline))
+bar (char *p)
+{
+ q = p;
+}
+
+void test1 (char a1, char b, char c, char d, char e, char f, char g, char h)
+{
+ char *p = &a1;
+ p++;
+ bar (p);
+}
+
+void test2 (struct X a2, char b, char c, char d, char e, char f, char g, char h)
+{
+ char *p = &a2.x;
+ p++;
+ bar (p);
+}
+
+void test3 (struct X a3, char b, char c, char d, char e, char f, char g, char h)
+{
+ char *p = &a3.y;
+ bar (p);
+}
+
+void test4 (int a4, char b, char c, char d, char e, char f, char g, char h)
+{
+ char *p = (char *)&a4;
+ p++;
+ p++;
+ p++;
+ p++;
+ bar (p);
+}
+
+/* { dg-final { scan-ipa-dump "bar.arg0 = { test4.arg0 test3.arg0 test2.arg0 test1.arg0 }" "pta" } } */
+/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c
new file mode 100644
index 000000000..768c99e82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/ipa-pta-2.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-fipa-pta" } */
+
+int **x;
+
+static int __attribute__((noinline,noclone))
+foo (int **p)
+{
+ int a = 1;
+ **p = 0;
+ *x = &a;
+ return **p;
+}
+
+extern void abort (void);
+int main()
+{
+ int b;
+ int *p = &b;
+ x = &p;
+ if (foo (&p) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/ldist-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/ldist-1.c
new file mode 100644
index 000000000..b6a0f28ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/ldist-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-loop-distribute-patterns" } */
+
+void foo (volatile int *p, int n)
+{
+ int i;
+ for (i = 0; i < n; ++i)
+ p[i] = 0;
+}
+
+/* { dg-final { scan-assembler-not "memset" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-1.c
new file mode 100644
index 000000000..1b88599bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-1.c
@@ -0,0 +1,90 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The whole matrix VEL is flattened (3 dimensions). */
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k, id;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+ mem_init ();
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][j][k]);
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < ARCHnodes; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-2.c
new file mode 100644
index 000000000..5013671af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-2.c
@@ -0,0 +1,113 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The last dimension of VEL escapes because of
+ the assignment : vel[1][1] =...
+ Only the two external dimensions are flattened. */
+
+
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][j][k]);
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ for (j = 0; j < 3; j++)
+ printf ("%x\n",vel[i][j]);
+ /*if (i!=1 || j!=1)*/
+ /*if (i==1 && j==1)
+ continue;
+ else
+ free (vel[i][j]);*/
+
+ for (i = 0; i < ARCHnodes; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ printf ("%x %d %d\n",vel[i][j], ARCHnodes1, sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ printf ("%x\n",vel[i][j]);
+ }
+ }
+
+ printf ("again:\n\n");
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ printf ("%x\n",vel[i][j]);
+ /*for (k = 0; k < ARCHnodes1; k++)
+ {
+ vel[i][j][k] = d;
+ d++;
+ }*/
+ }
+ }
+ /*vel[1][1] = vel[0][1];*/
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-3.c
new file mode 100644
index 000000000..c646899a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-3.c
@@ -0,0 +1,97 @@
+/* { dg-do compile } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+void just_a_call (int *);
+
+/* The last dimension of VEL escapes because it was sent
+ as argumet to just_a_call(). (external function)
+ Only the two external dimensions are flattened.
+ Run with -c. */
+
+
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][j][k]);
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < ARCHnodes; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+ just_a_call (vel[1][1]);
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-4.c
new file mode 100644
index 000000000..586443ce2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-4.c
@@ -0,0 +1,95 @@
+/* { dg-do compile } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+void just_a_call (int ****);
+
+/* Address of VEL is taken.
+ It is not flattened. */
+
+
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][j][k]);
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < ARCHnodes; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+ just_a_call (&vel);
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-5.c
new file mode 100644
index 000000000..9b17567f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-5.c
@@ -0,0 +1,96 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The two inner dimesions of matrix escape because of the
+ assignment vel[1]= ...
+ VEL is not Flattened. */
+
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][j][k]);
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < ARCHnodes-1; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < ARCHnodes-1; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+ vel[1] = vel[0];
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-6.c
new file mode 100644
index 000000000..cad63ddab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/matrix-6.c
@@ -0,0 +1,97 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The last dimension of VEL escapes because of
+ the assignment : *vel[1] =...
+ Only the two external dimensions are flattened. */
+
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][j][k]);
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ for (j = 0; j < 3; j++)
+ if (!(i == 1 && j == 0))
+ free (vel[i][j]);
+
+ for (i = 0; i < ARCHnodes; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+ *vel[1] = &d;
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/memcpy-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/memcpy-1.c
new file mode 100644
index 000000000..290c78923
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/memcpy-1.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-additional-options "-mtune=pentiumpro" { target ia32 } } */
+/* { dg-additional-options "-minline-all-stringops" { target { i?86-*-* x86_64-*-* } } } */
+
+static void __attribute__((noinline, noclone))
+my_memcpy (char *dest, const char *src, int n)
+{
+ __builtin_memcpy (dest, src, n);
+}
+
+int
+main (void)
+{
+ char a1[4], a2[4];
+ __builtin_memset (a1, 'a', 4);
+ __builtin_memset (a2, 'b', 4);
+ my_memcpy (a2, a1, 4);
+ if (a2[0] != 'a')
+ __builtin_abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-clobber-at.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-clobber-at.c
new file mode 100644
index 000000000..7f936984a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-clobber-at.c
@@ -0,0 +1,4 @@
+/* "$1" used to be mapped to the internal frame pointer. */
+/* { dg-do compile { target mips*-*-* } } */
+/* { dg-options "" } */
+int foo () { asm volatile ("#" ::: "$1"); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-div-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-div-1.c
new file mode 100644
index 000000000..6345000fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-div-1.c
@@ -0,0 +1,9 @@
+/* Check that hard-float MIPS code doesn't use library calls for 1.0/x. */
+/* { dg-options "-fno-delayed-branch" } */
+/* { dg-do compile { target mips*-*-* } } */
+
+float f1 (float x) { return 1.0f / x; }
+double f2 (double x) { return 1.0 / x; }
+
+/* { dg-final { scan-assembler-not {lwc1.*__divsf3} } } */
+/* { dg-final { scan-assembler-not {ldc1.*__divdf3} } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-hilo-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-hilo-2.c
new file mode 100644
index 000000000..dbe949307
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-hilo-2.c
@@ -0,0 +1,27 @@
+/* Due to a reload inheritance bug, the asm statement in f() would be passed
+ the low part of u.ll on little-endian 32-bit targets. */
+/* { dg-do run { target mips*-*-* } } */
+
+extern void abort (void);
+extern void exit (int);
+
+unsigned int g;
+
+unsigned __attribute__ ((nomips16)) long long f (unsigned int x)
+{
+ union { unsigned long long ll; unsigned int parts[2]; } u;
+
+ u.ll = ((unsigned long long) x * x);
+ asm ("mflo\t%0" : "=r" (g) : "l" (u.parts[1]));
+ return u.ll;
+}
+
+int __attribute__ ((nomips16)) main ()
+{
+ union { unsigned long long ll; unsigned int parts[2]; } u;
+
+ u.ll = f (0x12345678);
+ if (g != u.parts[1])
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-sdata-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-sdata-1.c
new file mode 100644
index 000000000..8ffd4d848
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/mips-sdata-1.c
@@ -0,0 +1,10 @@
+/* Check that sdata-accesses are applied regardless of size or ABI. */
+/* { dg-options -mexplicit-relocs } */
+/* { dg-do compile { target mips*-*-elf* } } */
+
+struct s { int x[4]; };
+struct s my_struct __attribute__((__section__(".sdata")));
+
+int f() { return my_struct.x[0]; }
+
+/* { dg-final { scan-assembler {gp_?rel\(my_struct} } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/nested-fn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/nested-fn-1.c
new file mode 100644
index 000000000..99e852344
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/nested-fn-1.c
@@ -0,0 +1,74 @@
+/* PR middle-end/15345, c/16450 */
+/* Test whether unused nested functions aren't emitted into the assembly. */
+/* { dg-do compile } */
+/* { dg-options "-g0" } */
+/* { dg-require-effective-target trampolines } */
+
+int
+fn1 (int x)
+{
+ int i = x;
+ inline __attribute__((always_inline)) int
+ should_not_appear1 (void)
+ {
+ return i;
+ }
+ return should_not_appear1 ();
+}
+
+int
+fn2 (int x)
+{
+ int i = x;
+ inline __attribute__((always_inline)) int
+ should_not_appear2 (void)
+ {
+ return i;
+ }
+ return x;
+}
+
+extern void check (void *p);
+
+int
+fn3 (int x)
+{
+ int i = x;
+ inline int
+ should_appear1 (void)
+ {
+ char *p = __builtin_alloca (i);
+ check (p);
+ return i;
+ }
+ return should_appear1 ();
+}
+
+int
+fn4 (int x)
+{
+ int i = x;
+ inline int
+ should_not_appear3 (void)
+ {
+ char *p = __builtin_alloca (i);
+ check (p);
+ return i;
+ }
+ return 0 ? should_not_appear3 () : 1;
+}
+
+int
+fn5 (int x)
+{
+ int i = x;
+ inline int
+ should_appear2 (void)
+ {
+ return i;
+ }
+ check (should_appear2);
+ return i;
+}
+
+/* { dg-final { scan-assembler-not "should_not_appear" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr16104-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr16104-1.c
new file mode 100644
index 000000000..ad5eda65f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr16104-1.c
@@ -0,0 +1,79 @@
+/* PR rtl-optimization/16104 */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+extern void abort (void);
+
+typedef int V2SI __attribute__ ((vector_size (8)));
+typedef unsigned int V2USI __attribute__ ((vector_size (8)));
+typedef short V2HI __attribute__ ((vector_size (4)));
+typedef unsigned int V2UHI __attribute__ ((vector_size (4)));
+
+int
+test1 (void)
+{
+ return (long long) (V2SI) 0LL;
+}
+
+int
+test2 (V2SI x)
+{
+ return (long long) x;
+}
+
+V2SI
+test3 (void)
+{
+ return (V2SI) (long long) (int) (V2HI) 0;
+}
+
+V2SI
+test4 (V2HI x)
+{
+ return (V2SI) (long long) (int) x;
+}
+
+V2SI
+test5 (V2USI x)
+{
+ return (V2SI) x;
+}
+
+void
+__attribute__ ((noinline))
+do_test (void)
+{
+ if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8)
+ return;
+
+ if (test1 () != 0)
+ abort ();
+
+ V2SI x = { 2, 2 };
+ if (test2 (x) != 2)
+ abort ();
+
+ union { V2SI x; int y[2]; V2USI z; long long l; } u;
+ u.x = test3 ();
+ if (u.y[0] != 0 || u.y[1] != 0)
+ abort ();
+
+ V2HI y = { 4, 4 };
+ union { V2SI x; long long y; } v;
+ v.x = test4 (y);
+ if (v.y != 0x40004)
+ abort ();
+
+ V2USI z = { 6, 6 };
+ u.x = test5 (z);
+ if (u.y[0] != 6 || u.y[1] != 6)
+ abort ();
+}
+
+int
+main (void)
+{
+ do_test ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr17526.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr17526.c
new file mode 100644
index 000000000..58b479143
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr17526.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-fno-pcc-struct-return" { target i?86-*-* } } */
+
+void abort(void);
+
+typedef struct { int i; } A;
+
+A __attribute__((noinline))
+foo(void)
+{
+ A a = { -1 };
+ return a;
+}
+
+void __attribute__((noinline))
+bar(A *p)
+{
+ *p = foo();
+}
+
+int main(void)
+{
+ A a;
+ bar(&a);
+ if (a.i != -1) abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr17933-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr17933-1.c
new file mode 100644
index 000000000..02c597b0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr17933-1.c
@@ -0,0 +1,14 @@
+/* PR rtl-optimization/17933.
+ Test-case from the ObjC test-suite, execute/class_self-2.m,
+ translated to C from and reduced by Andrew Pinski. */
+
+struct d
+{ int a; };
+void abort(void);
+typedef struct d (*f) (int i);
+f ff(void);
+void test1()
+{
+ f t = ff();
+ t(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr18582-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr18582-1.c
new file mode 100644
index 000000000..619593905
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr18582-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse3" } */
+typedef char v16qi __attribute__((vector_size (16)));
+typedef float v4sf __attribute__((vector_size (16)));
+typedef double v2df __attribute__((vector_size (16)));
+
+extern char ca[];
+extern float fa[];
+extern double da[];
+
+extern v16qi cva[];
+extern v4sf fva[];
+extern v2df dva[];
+
+void
+foo (void)
+{
+ cva[0] = __builtin_ia32_loaddqu (ca);
+ cva[0] = __builtin_ia32_lddqu (ca);
+
+ fva[0] = __builtin_ia32_loadups (fa);
+
+ dva[0] = __builtin_ia32_loadupd (da);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr19462-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr19462-1.c
new file mode 100644
index 000000000..8e140356f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr19462-1.c
@@ -0,0 +1,56 @@
+/* { dg-do compile } */
+/* PR rtl-optimization/19462
+ Delayed branch bug: return insns generated in presence of
+ current_function_epilogue_delay_list. See also PR target/7042. */
+
+/* The test is from newlib/libc/string/wcscspn.c, which has the following
+ copyright and licensing notice, which by inclusion this file supposedly
+ complies with:
+
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE. */
+
+
+unsigned long
+wcscspn(const long *s, const long *set)
+{
+ const long *p;
+ const long *q;
+
+ p = s;
+ while (*p)
+ {
+ q = set;
+ while (*q)
+ {
+ if (*p == *q)
+ goto done;
+ q++;
+ }
+ p++;
+ }
+
+done:
+ return (p - s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr19683-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr19683-1.c
new file mode 100644
index 000000000..05bf17418
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr19683-1.c
@@ -0,0 +1,42 @@
+/* From PR rtl-optimization/19683. On little-endian MIPS targets,
+ reload would incorrectly inherit the high part of the multiplication
+ result. */
+/* { dg-do run { target mips*-*-* } } */
+
+extern void abort (void);
+extern void exit (int);
+
+#define REPEAT10(X, Y) \
+ X(Y##0); X(Y##1); X(Y##2); X(Y##3); X(Y##4); \
+ X(Y##5); X(Y##6); X(Y##7); X(Y##8); X(Y##9)
+
+#define REPEAT30(X) REPEAT10 (X, 0); REPEAT10 (X, 1); REPEAT10 (X, 2)
+#define IN(X) unsigned int x##X = ptr[0]
+#define OUT(X) ptr[0] = x##X
+
+union u { unsigned long long ll; unsigned int i[2]; };
+
+unsigned int __attribute__ ((nomips16))
+foo (volatile unsigned int *ptr)
+{
+ union u u;
+ int result;
+
+ u.ll = (unsigned long long) ptr[0] * ptr[0];
+ REPEAT30 (IN);
+ REPEAT30 (OUT);
+ asm ("#" : "=l" (result) : "l" (u.i[1]));
+ return result;
+}
+
+int __attribute__ ((nomips16))
+main (void)
+{
+ unsigned int array[] = { 1000 * 1000 * 1000 };
+ union u u;
+
+ u.ll = (unsigned long long) array[0] * array[0];
+ if (foo (array) != u.i[1])
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr20314-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr20314-1.c
new file mode 100644
index 000000000..8a69c2dca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr20314-1.c
@@ -0,0 +1,56 @@
+/* PR inline-asm/20314 */
+/* { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-* ia64-*-* } } */
+
+int
+f1 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "+r,r" (x), "=r,r" (y)
+ : "%r,r" (x), "m,r" (8), "r,r" (2));
+ return x;
+}
+
+int
+f2 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "=r,r" (x), "=r,r" (y)
+ : "%0,0" (x), "m,r" (8), "r,r" (2));
+ return x;
+}
+
+int
+f3 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "+r,r" (x), "=r,r" (y)
+ : "%m,r" (8), "r,r" (2));
+ return x;
+}
+
+int
+f4 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "+r" (x), "=r" (y)
+ : "r" (x), "r" (8), "r" (2));
+ return x;
+}
+
+int
+f5 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "=r" (x), "=r" (y)
+ : "0" (x), "r" (8), "r" (2));
+ return x;
+}
+
+int
+f6 (void)
+{
+ int x = 4, y;
+ __asm__ volatile ("" : "+r" (x), "=r" (y)
+ : "r" (8), "r" (2));
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr20314-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr20314-2.c
new file mode 100644
index 000000000..aac02ddfa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr20314-2.c
@@ -0,0 +1,47 @@
+/* PR inline-asm/20314 */
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } */
+/* { dg-do compile { target ia64-*-* powerpc*-*-* } } */
+
+int a, b, c, d, e, f, g, h, i, j, k, l;
+
+void
+f1 (void)
+{
+ __asm__ volatile (""
+ : [a] "+r" (a), [b] "+r" (b), [c] "+r" (c), [d] "+r" (d),
+ [e] "+r" (e), [f] "+r" (f), [g] "+r" (g), [h] "+r" (h),
+ [i] "+r" (i), [j] "+r" (j), [k] "+r" (k), [l] "+r" (l));
+}
+
+void
+f2 (void)
+{
+ __asm__ volatile (""
+ : [a] "+r,m" (a), [b] "+r,m" (b), [c] "+r,m" (c), [d] "+r,m" (d),
+ [e] "+r,m" (e), [f] "+r,m" (f), [g] "+r,m" (g), [h] "+r,m" (h),
+ [i] "+r,m" (i), [j] "+r,m" (j), [k] "+r,m" (k), [l] "+r,m" (l));
+}
+
+void
+f3 (void)
+{
+ __asm__ volatile (""
+ : [a] "=r" (a), [b] "=r" (b), [c] "=r" (c), [d] "=r" (d),
+ [e] "=r" (e), [f] "=r" (f), [g] "=r" (g), [h] "=r" (h),
+ [i] "=r" (i), [j] "=r" (j), [k] "=r" (k), [l] "=r" (l)
+ : "[a]" (a), "[b]" (b), "[c]" (c), "[d]" (d),
+ "[e]" (e), "[f]" (f), "[g]" (g), "[h]" (h),
+ "[i]" (i), "[j]" (j), "[k]" (k), "[l]" (l));
+}
+
+void
+f4 (void)
+{
+ __asm__ volatile (""
+ : [a] "=r,m" (a), [b] "=r,m" (b), [c] "=r,m" (c), [d] "=r,m" (d),
+ [e] "=r,m" (e), [f] "=r,m" (f), [g] "=r,m" (g), [h] "=r,m" (h),
+ [i] "=r,m" (i), [j] "=r,m" (j), [k] "=r,m" (k), [l] "=r,m" (l)
+ : "[a],m" (a), "[b],m" (b), "[c],m" (c), "[d],m" (d),
+ "[e],m" (e), "[f],m" (f), "[g],m" (g), "[h],m" (h),
+ "[i],m" (i), "[j],m" (j), "[k],m" (k), "[l],m" (l));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr21817-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr21817-1.c
new file mode 100644
index 000000000..d90d3239c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr21817-1.c
@@ -0,0 +1,16 @@
+/* hppa*-*-hpux* needs -fno-common so that value can be given a 16
+ byte alignment. */
+
+/* { dg-do compile } */
+/* { dg-options "-fno-common" { target { hppa*-*-hpux* } } } */
+
+typedef float v4sf __attribute__((vector_size(16)));
+v4sf value;
+void foo(void)
+{
+ unsigned int band;
+ for(band=0; band < 2; band++)
+ {
+ value += (v4sf){1e9f,1e9f,1e9f,1e9f};
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr23424-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr23424-1.c
new file mode 100644
index 000000000..91950d77a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr23424-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+extern char *x;
+extern void foo (void);
+void f (char *s, char *se, char *mp, char *y)
+{
+ while (s != se)
+ {
+ char *p;
+ foo ();
+ p = s + *mp;
+ *y++ = *p;
+ s = p;
+ }
+
+ x = s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr23821.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr23821.c
new file mode 100644
index 000000000..04847d65a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr23821.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+/* At -O1 DOM threads a jump in a non-optimal way which leads to
+ the bogus propagation. */
+/* { dg-skip-if "" { *-*-* } { "-O1" } { "" } } */
+/* { dg-options "-fdump-tree-ivcanon-details" } */
+
+int a[199];
+
+extern void abort (void);
+
+int
+main ()
+{
+ int i, x;
+ for (i = 0; i < 199; i++)
+ {
+ x = a[i];
+ if (x != i)
+ abort ();
+ }
+ return 0;
+}
+
+/* Verify that we do not propagate the equivalence x == i into the
+ induction variable increment. */
+
+/* { dg-final { scan-tree-dump "Added canonical iv" "ivcanon" } } */
+/* { dg-final { cleanup-tree-dump "ivcanon" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24257.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24257.c
new file mode 100644
index 000000000..d685df63d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24257.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-fgcse -fgcse-sm" } */
+
+typedef struct A {
+ int buf, left;
+} A;
+
+static void flush(A *s, int n)
+{
+ s->buf <<= n;
+
+ while (s->left < 32) {
+ s->buf <<= 8;
+ s->left += 8;
+ }
+
+ s->buf=0;
+}
+
+void oof(A *s, int n)
+{
+ s->buf = n;
+ s->left = n;
+
+ flush(s, n);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-1.c
new file mode 100644
index 000000000..331c55ec3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+typedef long
+(*bla)(int *node);
+
+static long F2(void *tree, long blk, bla after_node_func)
+{
+ long call_result = 0;
+ int *node;
+
+
+ if (call_result = after_node_func(node))
+ goto error_free_node;
+
+ T(node);
+ return 0;
+
+error_free_node:
+ T(node);
+error:
+ return call_result;
+}
+
+long F1(void *tree)
+{
+ return F2(tree, F3(tree), (void *)0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-2.c
new file mode 100644
index 000000000..e48d3b31c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-2.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+
+typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
+typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
+typedef u_int32_t db_pgno_t;
+typedef struct __db DB;
+typedef struct __db_env DB_ENV;
+typedef struct __db_mpoolfile DB_MPOOLFILE;
+typedef struct __dbc DBC;
+struct __db {
+ DB_MPOOLFILE *mpf;
+ db_pgno_t meta_pgno;
+ struct __cq_aq {
+ } s_links;
+};
+struct __db_env {
+ struct {
+ } xa_txn;
+ u_int32_t flags;
+};
+typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
+typedef struct __dbpginfo {
+ u_int8_t type;
+} PAGE;
+int __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
+ DB *mdbp, *sdbp;
+{
+ DB_ENV *dbenv;
+ DBC *dbc, *ndbc;
+ PAGE *p, *r;
+ int modify, ret, t_ret;
+ if ((ret = __db_cursor(mdbp, txn, &dbc,
+ (((dbenv)->flags & (0x0000002))
+ && modify) ? 35 : 0)) != 0)
+ goto err;
+ switch (action) {
+ case MU_REMOVE:
+ if ((ret = __memp_fget(mdbp->mpf, &sdbp->meta_pgno, 0, &p)) != 0)
+ goto err;
+ if ((((PAGE *)p)->type) == 9) {
+ if ((ret = __db_free(dbc, r)) != 0) { }
+ }
+ if ((ret = __db_free(dbc, p)) != 0) {
+ p = ((void *)0);
+ goto err;
+ }
+ p = ((void *)0);
+ }
+ err:
+ if (ndbc != ((void *)0) && (t_ret = __db_c_close(ndbc)) != 0 && ret == 0)
+ ret = t_ret;
+ return (ret);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-3.c
new file mode 100644
index 000000000..778068268
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+long fff(int*);
+
+long F2(int *node)
+{
+ long call_result = 0;
+
+ if (call_result = fff(node))
+ goto error_free_node;
+
+ T(node);
+ return 0;
+
+error_free_node:
+ T(node);
+ return call_result;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-4.c
new file mode 100644
index 000000000..a66801661
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24626-4.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-fmodulo-sched" } */
+
+int foo(short* vec1, short* vec2, short* vec3,int len )
+{
+ int temp,i;
+ for (i=0; i<len; i++) {
+ temp = vec1[i] * 2;
+ temp += vec2[i] * 3 ;
+ vec3[i] = temp;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24750-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24750-1.c
new file mode 100644
index 000000000..58b1ea2ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24750-1.c
@@ -0,0 +1,73 @@
+extern void free (void *);
+extern int unknown;
+extern int n0;
+extern short *s0;
+extern int n1;
+extern short *s1;
+extern short *s2;
+extern int *n2;
+extern int *n3;
+extern int n4;
+extern short *n5;
+extern int *n6;
+extern int n7;
+extern char *unc;
+
+void
+f (short *sp)
+{
+ int j = 0;
+ int i = 0;
+ int n8 = 0;
+ int n9 = 0;
+ short *s3 = sp;
+ short s4 = (short) unknown;
+ short s5 = (short) unknown;
+ char *c0 = unc;
+ int n10 = 0;
+ int n11 = 0;
+ int u0 = unknown;
+ int k = 0;
+
+ for (n8 = 1; n8 <= n7; n8++)
+ {
+ for (i = 1; i <= n0; i++)
+ c0[i] = 0;
+ for (i = 1; i <= u0; i++) { }
+ for (i = sp[0]; i != -32767; i = sp[i])
+ if (s4 == u0)
+ for (j = 1; j <= u0; j++)
+ if (!c0[s3[j]])
+ break;
+ }
+ for (n9 = 1; n9 <= n0; n9++) s1[unknown + n9] = n9;
+ for (i = 1; i <= n1; i++)
+ for (j = 1; j <= s4; j++)
+ s3[j] = s1[s3[j]];
+ for (n8 = 1; n8 <= n7; n8++)
+ for (i = 1; i <= s5; i++)
+ s3[i] = s1[s3[i]];
+ for (n9 = 1; n9 <= n0; n9++) sp[s1[n9]] = unknown;
+ for (n10 = 2; n10 < n4; n10++) { }
+ for (k = 1; k <= unknown; k++)
+ {
+ s4 = s0[n5[u0]];
+ for (i = 1; i <= s4; i++) { }
+ for (j = 1; j <= s4; j++)
+ if (n2[1] != 0)
+ if (i == unknown)
+ unknown = n3[unknown];
+ n6[u0] = n10;
+ }
+ for (k = n7; k >= n11; k--)
+ if (n2[k] == -32767)
+ break;
+ free (c0);
+
+ for (i = 1; i <= n7; i++)
+ {
+ for (j = 1; j <= s4; j++) { }
+ for (n8 = s2[unknown]; n8 != -32767; n8 = s2[n8]) { }
+ for (j = 1; j <= s5; j++) { }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24912-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24912-1.c
new file mode 100644
index 000000000..947175f9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr24912-1.c
@@ -0,0 +1,10 @@
+void foo(void);
+void
+bar (unsigned char *p)
+{
+ int j;
+ j = *(p) ;
+ j += ((signed char) (*p) ) << 8;
+ if (j)
+ foo();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25183.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25183.c
new file mode 100644
index 000000000..0157b806c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25183.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+enum err {
+ err_IO = 0x8a450000, /* { dg-warning "int" } */
+ err_NM,
+ err_EOF,
+ err_SE,
+ err_PT
+};
+static enum err E_;
+int error()
+{
+ switch (E_) {
+ case err_IO : break;
+ case err_NM : break;
+ case err_EOF : break;
+ case err_SE : break;
+ case err_PT : break;
+ default : return 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25481.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25481.c
new file mode 100644
index 000000000..3072e5ecb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25481.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+struct s {
+ int *blah;
+};
+
+static struct s array[] = {
+ { 0 }
+};
+
+void
+foo (struct s *p)
+{
+ unsigned int n = 1;
+ struct s *q = &array[n];
+ while (p < q)
+ p++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25654.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25654.c
new file mode 100644
index 000000000..03761e93c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25654.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+union setconflict
+{
+ short a[20];
+ int b[10];
+};
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ union setconflict a;
+ short *c;
+ c = a.a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ union setconflict a;
+ int *c;
+ c = a.b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25706-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25706-1.c
new file mode 100644
index 000000000..49bb32722
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25706-1.c
@@ -0,0 +1,35 @@
+/* { dg-do assemble } */
+/* Invalid assembly generated due to port bug. */
+struct tcp_opt {
+ unsigned int window_clamp;
+ unsigned int rcv_ssthresh;
+ unsigned short advmss;
+};
+extern int sysctl_tcp_app_win;
+void tcp_init_buffer_space(struct tcp_opt *tp, int maxwin)
+{
+ if (tp->window_clamp >= maxwin)
+ if (sysctl_tcp_app_win && maxwin>4*tp->advmss)
+ tp->window_clamp
+ = ({
+ int _x = maxwin;
+ typeof(4*tp->advmss) _y = (4*tp->advmss);
+ _x > _y ? _x : _y;
+ });
+
+ if (sysctl_tcp_app_win
+ && tp->window_clamp > 2*tp->advmss
+ && tp->window_clamp + tp->advmss > maxwin)
+ tp->window_clamp
+ = ({
+ unsigned short _x = maxwin;
+ unsigned short _y = (maxwin-tp->advmss);
+ _x > _y ? _x : _y;
+ });
+ tp->rcv_ssthresh
+ = ({
+ unsigned int _x = (tp->rcv_ssthresh);
+ unsigned int _y = (tp->window_clamp);
+ _x < _y ? _x : _y;
+ });
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25718-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25718-1.c
new file mode 100644
index 000000000..8333a33a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25718-1.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* PR 25718: invalid constant operand to the "bound" insn; error at
+ assembly time. We'll make sure the code is correct to: run a few
+ example values. */
+
+extern void exit (int);
+extern void abort (void);
+unsigned __attribute__ ((__noinline__)) foo(unsigned a)
+{
+ unsigned l;
+ l = (a >= (~0u - 512) ? (~0u - 512) : a);
+ return l;
+}
+
+int
+main (void)
+{
+ if (foo ((unsigned) -512) != (unsigned) -513
+ || foo ((unsigned) -514) != (unsigned) -514
+ || foo ((unsigned) -513) != (unsigned) -513
+ || foo ((unsigned) -1) != (unsigned) -513
+ || foo (513) != 513
+ || foo (0) != 0)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25947-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25947-1.c
new file mode 100644
index 000000000..8af6f8d46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr25947-1.c
@@ -0,0 +1,22 @@
+/* PR target/25947: define_split in cris.md caused unrecognized insn. */
+/* { dg-options "-fpic" { target fpic } } */
+/* { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "-O0" } { "" } } */
+
+extern char *rl_line_buffer;
+extern int rl_point;
+extern int rl_end;
+static const char *vi_motion = " hl^$0ftFT;,%wbeWBE|";
+void
+rl_vi_complete (int ignore, int key)
+{
+ if ((rl_point < rl_end)
+ &&
+ (!(((rl_line_buffer[rl_point]) == ' ')
+ || ((rl_line_buffer[rl_point]) == '\t'))))
+ {
+ if (!
+ (((rl_line_buffer[rl_point + 1]) == ' ')
+ || ((rl_line_buffer[rl_point + 1]) == '\t')))
+ rl_vi_end_word (1, 'E');
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26222.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26222.c
new file mode 100644
index 000000000..b580db673
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26222.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-pre -fno-tree-loop-im" } */
+
+void putShort (int, int);
+
+int t2;
+void f(int t1)
+{
+ int clutOffset = 52 + 256 * 3 * 2;
+ int x, y, z;
+ for (x = 0; x < 16; x++)
+ for (y = 0; y < 16; y++)
+ for (z = 0; z < 16; z++)
+ {
+ int offset = clutOffset + z * 6 + y * 16 * 6 + x * 16 * 16 * 6;
+ double xf = ((double) x) / ((double) 16 - 1.0);
+ double tt = xf;
+ putShort(offset, tt);
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26258.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26258.c
new file mode 100644
index 000000000..e9acd55cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26258.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+typedef struct Foo { int a; int b; } Foo;
+
+Foo foo(Foo first, Foo last, _Bool ret_first)
+{
+ Foo t;
+ Foo *t1 = (ret_first ? &first : &last);
+ first.a = 2;
+ last.b = 3;
+ t.a = t1->a;
+ t.b = t1->b;
+ t.a += first.a;
+ t.b += last.b;
+ return t;
+}
+
+int main()
+{
+ Foo first = (Foo){1, 2};
+ Foo last = (Foo){3, 4};
+ Foo ret = foo(first, last, 0);
+ if (ret.b != 6)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26515.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26515.c
new file mode 100644
index 000000000..a051e2e53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26515.c
@@ -0,0 +1,27 @@
+/* { dg-options "-march=v10" { target cris*-*-* } } */
+struct i
+{
+ long long i_size;
+ struct a *i_mapping;
+};
+struct p
+{
+ struct a *mapping;
+ long index;
+};
+extern void b (struct p*, unsigned);
+extern void u (struct p*);
+void
+block_page_mkwrite (struct i *i, struct p *p)
+{
+ unsigned end = 0;
+ long long size = 0;
+ size = i->i_size;
+ if ((p->mapping != i->i_mapping))
+ goto out_unlock;
+ if (((p->index + 1) << 13) > size)
+ end = size & ~(~(((1UL) << 13) - 1));
+ b (p, end);
+out_unlock:
+ u (p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26565.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26565.c
new file mode 100644
index 000000000..d45272df3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26565.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* m32c is already packed. */
+/* { dg-skip-if "" { "m32c-*-*" } { "*" } { "" } } */
+
+void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n);
+
+struct timeval {
+ long tv_sec;
+};
+
+struct outdata {
+ long align;
+ char seq;
+ struct timeval tv __attribute__((packed)); /* { dg-warning "attribute ignored" "" { target default_packed } } */
+};
+
+void send_probe(struct outdata *outdata, struct timeval *tp) __attribute__((noinline));
+void send_probe(struct outdata *outdata, struct timeval *tp)
+{
+ memcpy(&outdata->tv, tp, sizeof outdata->tv);
+}
+
+struct timeval t;
+struct outdata outdata;
+
+int main()
+{
+ send_probe(&outdata, &t);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26587.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26587.c
new file mode 100644
index 000000000..ad5d60f3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26587.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort(void);
+typedef unsigned int BF_word;
+typedef BF_word BF_key[16 + 2];
+static struct {
+ BF_key P;
+} BF_current;
+int main(void)
+{
+ BF_word L;
+ BF_word tmp4, *ptr;
+ BF_word i;
+ for (i = 0; i < 16 + 2; i++)
+ BF_current.P[i] = i * 0x98765432;
+ L = 0;
+ ptr = BF_current.P;
+ do {
+ ptr += 2;
+ L ^= BF_current.P[0];
+ tmp4 = L >> 24;
+ L = tmp4 ^ BF_current.P[16 + 1];
+ *(ptr - 2) = L;
+ } while (ptr < &BF_current.P[16 + 2]);
+ if (L != 0x1fdb9752)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26630.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26630.c
new file mode 100644
index 000000000..96bab36a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26630.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort(void);
+int main()
+{
+ int a1 = 40000;
+ int c1 = ( ((int)(short)(a1-10000)) + 10000)*2;
+ if (c1 != 80000)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26672.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26672.c
new file mode 100644
index 000000000..b13b5dcae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26672.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+int printf(const char *format, ...);
+extern const char help_string[];
+void app_opts(void) {
+ printf("%s", help_string);
+}
+const char help_string[] = "foo\n";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26763-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26763-1.c
new file mode 100644
index 000000000..37054e7a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26763-1.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int try (int *a)
+{
+ return a + -1 > a;
+}
+
+int main(void)
+{
+ int bla[100];
+
+ if (try (bla + 50))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26763-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26763-2.c
new file mode 100644
index 000000000..d8155fb08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26763-2.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int try (char *a, int d)
+{
+ return a + d > a;
+}
+
+int main(void)
+{
+ char bla[100];
+
+ if (try (bla + 50, -1))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26869.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26869.c
new file mode 100644
index 000000000..6743319d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26869.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+_Complex float f (_Complex float b, _Complex float c)
+{
+ _Complex float a = 1.0 + 0.0i;
+ return a / c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26898-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26898-1.c
new file mode 100644
index 000000000..619412929
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26898-1.c
@@ -0,0 +1,15 @@
+/* { dg-do link } */
+/* { dg-options "-fstrict-overflow" } */
+
+#include <limits.h>
+
+extern void link_error(void);
+int main()
+{
+ int i0, i1;
+ if (!(i0 + 1 < i1 + 1 == i0 < i1))
+ link_error ();
+ if (!(i0 + INT_MIN < i1 - INT_MAX == i0 < i1 - -1))
+ link_error ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26898-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26898-2.c
new file mode 100644
index 000000000..508fde4ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26898-2.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+
+#include <limits.h>
+
+int a = 0, b = INT_MAX - 1;
+extern void abort(void);
+int main()
+{
+ if (a - 1 > b + 1)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26998.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26998.c
new file mode 100644
index 000000000..d50c34473
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr26998.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+int decCompareOp (int result)
+{
+ if (result != (int)0x80000000)
+ {
+ result = -result;
+ return (result > 0);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27116-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27116-2.c
new file mode 100644
index 000000000..9c748b245
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27116-2.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int main (void)
+{
+ volatile long int n;
+ n = -2;
+
+ if ((-2147483647L - 1L) / (-n) != -1073741824L)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27116.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27116.c
new file mode 100644
index 000000000..70eeb1a86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27116.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+
+extern void abort(void);
+
+int f(int a, int b)
+{
+ return (-1 - a) / (-b);
+}
+
+int main()
+{
+ if (f(__INT_MAX__, 2) != __INT_MAX__/2 + 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27136.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27136.c
new file mode 100644
index 000000000..32b7bf123
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27136.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math" } */
+
+void foo()
+{
+ double x;
+
+ for (x = 2; x < 10; x *= x)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27184.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27184.c
new file mode 100644
index 000000000..cfb6ed2a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27184.c
@@ -0,0 +1,22 @@
+/* Copyright 2006 Free Software Foundation */
+
+/* Make sure a and a1 alias each other.
+ Incomplete array types used to not be unified, which broke aliasing. */
+
+/* { dg-do run } */
+
+typedef long atype[];
+typedef long atype1[];
+int NumSift (atype *a, atype1 *a1)
+{
+ (*a)[0] = 0;
+ (*a1)[0] = 1;
+ return (*a)[0];
+}
+int main(void)
+{
+ long a[2];
+ if (!NumSift(&a, &a))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27302-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27302-2.c
new file mode 100644
index 000000000..5c201b3d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27302-2.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-fstrict-overflow" } */
+
+extern void link_error (void);
+
+void test0 (int a, int b)
+{
+ if ((a < b) != (b > a))
+ link_error ();
+
+ if ((a - 1 < b) != (a <= b))
+ link_error ();
+ if ((a - 2 < b) != (a - 1 <= b))
+ link_error ();
+ if ((a + -1 < b) != (a <= b))
+ link_error ();
+ if ((a + -2 < b) != (a + -1 <= b))
+ link_error ();
+
+ if ((a + 1 > b) != (a >= b))
+ link_error ();
+ if ((a + 2 > b) != (a + 1 >= b))
+ link_error ();
+ if ((a - -1 > b) != (a >= b))
+ link_error ();
+ if ((a - -2 > b) != (a - -1 >= b))
+ link_error ();
+
+ if ((a + 1 <= b) != (a < b))
+ link_error ();
+ if ((a + 2 <= b) != (a + 1 < b))
+ link_error ();
+ if ((a - -1 <= b) != (a < b))
+ link_error ();
+ if ((a - -2 <= b) != (a - -1 < b))
+ link_error ();
+
+ if ((a - 1 >= b) != (a > b))
+ link_error ();
+ if ((a - 2 >= b) != (a - 1 > b))
+ link_error ();
+ if ((a + -1 >= b) != (a > b))
+ link_error ();
+ if ((a + -2 >= b) != (a + -1 > b))
+ link_error ();
+}
+
+int main()
+{
+ test0 (1, 2);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27302.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27302.c
new file mode 100644
index 000000000..0e41fc385
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27302.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+
+extern void link_error (void);
+
+void test0 (int a, int b)
+{
+ if ((a < b) != (b > a))
+ link_error ();
+}
+
+int main()
+{
+ test0 (1, 2);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27409.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27409.c
new file mode 100644
index 000000000..430e6c8cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27409.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+typedef struct {
+ struct { } z;
+} thang_t;
+
+struct {
+ short e;
+ thang_t f;
+ int g;
+} my_struct;
+
+void function(int blaz)
+{
+ thang_t *fp = &my_struct.f;
+ foo(fp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27603.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27603.c
new file mode 100644
index 000000000..8cb0235ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27603.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+
+void exit (int);
+void abort (void);
+int a;
+int main()
+{
+ int j;
+ for (j = 0; j < 6; j++)
+ {
+ if ((unsigned)j - 3 <= 1)
+ exit (0);
+ a = 1000 * (6 - j);
+ }
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27743.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27743.c
new file mode 100644
index 000000000..47d70457c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27743.c
@@ -0,0 +1,16 @@
+/* { dg-do run { target { stdint_types } } } */
+
+#include <stdint.h>
+extern void abort(void);
+
+int32_t bar (int32_t a)
+{
+ return ((uint32_t) ((a) >> 2)) >> 15;
+}
+
+int main()
+{
+ if (bar (0xffff3000) != 0x1ffff)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27773.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27773.c
new file mode 100644
index 000000000..e30e540ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr27773.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+_Complex float f(_Complex float a, float b)
+{
+ return a - a*b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28045.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28045.c
new file mode 100644
index 000000000..f2d16646c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28045.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+extern void abort(void);
+struct a
+{
+ unsigned int bits : 1;
+ signed long val : ((sizeof(long) * 8) - 1);
+};
+int Fnegate (struct a b)
+{
+ if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))
+ && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))) - 1))
+ return 0 ;
+ abort ();
+}
+int main ()
+{
+ struct a b = {1, 1};
+ Fnegate (b);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28230.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28230.c
new file mode 100644
index 000000000..5ecc0c716
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28230.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-fwrapv" } */
+
+void foo( unsigned long long bb, unsigned short tn, unsigned e, unsigned* w );
+void foo( unsigned long long bb, unsigned short tn, unsigned e, unsigned* w )
+{
+ unsigned n = tn + bb;
+ do {
+ e = (e > n) ? e : *w;
+ n -= (e > n) ? n : e;
+ if (*w)
+ *w = 0;
+ } while ( n );
+}
+int main()
+{
+ unsigned w = 0;
+ foo( 0, 0, 0, &w );
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28268.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28268.c
new file mode 100644
index 000000000..f143c0804
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28268.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+
+int __attribute__((vector_size(8))) a;
+
+void foo()
+{
+ a += a*a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28814.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28814.c
new file mode 100644
index 000000000..cc3c9f6ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28814.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { ilp32 || lp64 } } } */
+
+struct w49
+{
+ union
+ {
+ }
+ value;
+};
+f9887 (struct w49 a23040)
+{
+ unsigned long r9887;
+ if (((struct structure_type24753 *) (r9887 - 1)) == ((void *) 0))
+ {
+ backtrace ("stalin.sc", 7222, 248274);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28900.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28900.c
new file mode 100644
index 000000000..75555f46e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr28900.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-vectorize" } */
+
+int synths_ ( float * rc)
+{
+ float r1, r2;
+ int i;
+ for (i = 0; i < 128; ++i)
+ {
+ r2 = rc[i];
+ r1 = ((r2) <= (.99f) ? (r2) : (.99f));
+ rc[i] = ((r1) >= (-.99f) ? (r1) : (-.99f));
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29119.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29119.c
new file mode 100644
index 000000000..63e5d8693
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29119.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+void ldt_add_entry(void)
+{
+ __asm__ ("" :: "m"(({unsigned __v; __v;})));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29446.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29446.c
new file mode 100644
index 000000000..5571c71e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29446.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+
+void f(_Bool D917, int j0, int ubound1, int ubound5)
+{
+ int i, j = j0;
+ int (*abc)[3];
+ i = 1;
+ while (1)
+ {
+ if (j <= 3)
+ while (1)
+ {
+ if (i != j)
+ {
+ if (ubound1 <= 0)
+ return;
+ (*abc)[1] = 0;
+ }
+ else
+ {
+ if (j > ubound1)
+ return;
+ if (ubound5 <= 0)
+ return;
+ }
+ j = j + 1;
+ if (D917)
+ break;
+ }
+ i = i + 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29584.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29584.c
new file mode 100644
index 000000000..4cb51d275
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr29584.c
@@ -0,0 +1,28 @@
+/* PR middle-end/29584 */
+/* { dg-do compile { target { ilp32 || lp64 } } } */
+
+extern void *foo1 (void);
+extern void foo2 (void);
+extern void foo3 (void *, void *);
+extern int foo4 (void);
+
+void
+bar (void)
+{
+ int i;
+ void *s;
+ for (i = 1; i < 4; i++)
+ {
+ if (foo4 ())
+ foo2 ();
+ switch (0x8000000UL + i * 0x400)
+ {
+ case 0x80000000UL ... 0x80000000UL + 0x3a000000UL - 1:
+ s = 0;
+ break;
+ default:
+ s = foo1 ();
+ }
+ foo3 ((void *) (0x8000000UL + i * 0x400), s);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30313.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30313.c
new file mode 100644
index 000000000..aefeb7866
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30313.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+static inline void bar(){}
+
+struct S
+{
+#if __INT_MAX__ == 32767
+ signed int i: 16;
+#elif __INT_MAX__ == 2147483647
+ signed int i: 32;
+#elif __INT_MAX__ == 9223372036854775807
+ signed int i: 64;
+#else
+#error Please add support for your target here
+#endif
+};
+
+int main()
+{
+ struct S x = {32};
+ sizeof(x.i+0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c
new file mode 100644
index 000000000..64ee7e44e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+#include <limits.h>
+extern void abort (void);
+
+int f(int a, int b)
+{
+ if (a > INT_MAX - 15) return 0;
+ if (b > INT_MAX - 15) return 0;
+
+ int c = (a - 20) + (b - 20);
+ return c > INT_MAX - 15;
+}
+
+int main()
+{
+ if (f (INT_MAX - 15, 41) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-2.c
new file mode 100644
index 000000000..d8b678d53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-2.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+#include <limits.h>
+extern void abort (void);
+
+int f(unsigned int a, unsigned int b)
+{
+ if (a > INT_MAX - 15) return 0;
+ if (b > INT_MAX - 15) return 0;
+
+ int c = (a - 20) + (b - 20);
+ return c > INT_MAX - 15;
+}
+
+int main()
+{
+ if (f (INT_MAX - 15, 41) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-3.c
new file mode 100644
index 000000000..ae96ba39f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30364-3.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-fwrapv" } */
+
+#include <limits.h>
+extern void abort (void);
+
+int f(int a, int b)
+{
+ if (a > INT_MAX - 15) return 0;
+ if (b > INT_MAX - 15) return 0;
+
+ int c = (a - 20) + (b - 20);
+ return c > INT_MAX - 15;
+}
+
+int main()
+{
+ if (f (INT_MAX - 15, 41) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30375.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30375.c
new file mode 100644
index 000000000..435c38f13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30375.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+typedef struct _s {
+ int a;
+ int b;
+ int c;
+ int d;
+} s;
+
+extern void abort(void);
+
+void __attribute__((noinline)) g(s *p)
+{
+ if (p->d != 0)
+ abort ();
+}
+
+char *c = (void*)0;
+void __attribute__((noinline)) f(void) { if (c) *c = 1; }
+
+void test_signed_msg_encoding(void)
+{
+ s signInfo = { sizeof(signInfo), 0 };
+
+ signInfo.b = 1;
+ signInfo.c = 0;
+ g(&signInfo);
+ signInfo.d = 1;
+ f();
+}
+
+int main()
+{
+ test_signed_msg_encoding ();
+ test_signed_msg_encoding ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30665-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30665-1.c
new file mode 100644
index 000000000..4650408d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30665-1.c
@@ -0,0 +1,24 @@
+/* PR target/30665: bug in cris.md peephole2 condition.
+ Testcase for trunk. */
+/* { dg-do run } */
+
+extern void abort (void);
+extern void exit (int);
+
+int __attribute__ ((__noinline__)) f (unsigned *p, int *x)
+{
+ int y = *p++ & 0xfff;
+ *x++ = y;
+ *x = *p;
+ return y;
+}
+
+int main (void)
+{
+ unsigned u[2] = { 0x3aad, 0x5ad1 };
+ int x[2] = {17689, 23456};
+
+ if (f (u, x) != 0xaad || x[0] != 0xaad || x[1] != 0x5ad1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30665-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30665-2.c
new file mode 100644
index 000000000..a2cbf024c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr30665-2.c
@@ -0,0 +1,57 @@
+/* PR target/30665: bug in cris.md peephole2 condition.
+ Original reduced testcase (fails on 3.2.1 derivate, not on trunk). */
+/* { dg-do run } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct t
+{
+ unsigned int a : 12;
+ unsigned int b : 12;
+ unsigned int dummy1 : 8;
+};
+
+struct area
+{
+ int xa;
+ int xb;
+};
+
+struct c
+{
+ struct area ii;
+};
+
+static struct c c;
+
+void __attribute__ ((__noinline__)) g(int a)
+{
+ if (a != 79)
+ abort ();
+}
+
+void __attribute__ ((__noinline__)) h(struct t tt)
+{
+ if (tt.a != 20 || tt.b != 79)
+ abort ();
+}
+
+void __attribute__ ((__noinline__)) s(void);
+
+int main(int argc, char **argv)
+{
+ c.ii.xa = 20;
+ c.ii.xb = 79;
+
+ s();
+
+ exit (0);
+}
+
+void __attribute__ ((__noinline__)) s(void)
+{
+ struct t ii_x = { .a = c.ii.xa, .b = c.ii.xb };
+ g(c.ii.xb);
+ h(ii_x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr31115.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr31115.c
new file mode 100644
index 000000000..1395a34b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr31115.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+extern void exit(int);
+extern void abort();
+void foo (int e1)
+{
+ if (e1 < 0)
+ {
+ e1 = -e1;
+ if (e1 >>= 4)
+ {
+ if (e1 >= 1 << 5)
+ exit(0);
+ }
+ }
+}
+
+int main()
+{
+ foo(-(1<<9));
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr31254.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr31254.c
new file mode 100644
index 000000000..cec301273
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr31254.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+struct timespec
+{
+ long tv_sec;
+ long tv_nsec;
+};
+struct inode
+{
+ struct timespec i_atime;
+ struct timespec i_mtime;
+};
+struct afs_vnode
+{
+ struct inode vfs_inode;
+};
+static inline
+ struct inode *AFS_VNODE_TO_I (struct afs_vnode *vnode)
+{
+ return &vnode->vfs_inode;
+};
+afs_inode_map_status (struct afs_vnode *vnode)
+{
+ struct inode *inode = AFS_VNODE_TO_I (vnode);
+ inode->i_atime = inode->i_mtime;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr32897.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr32897.c
new file mode 100644
index 000000000..3dc43ece0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr32897.c
@@ -0,0 +1,27 @@
+/* { dg-options "-G0" { target mips*-*-* } } */
+
+volatile int g[32];
+long long gll;
+double gd;
+
+#define MULTI(X) \
+ X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), X(10), \
+ X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19), X(20), \
+ X(21), X(22), X(23), X(24), X(25), X(26), X(27), X(28), X(29), X(30)
+
+#define DECLARE(INDEX) x##INDEX
+#define COPY_IN(INDEX) x##INDEX = g[INDEX]
+#define COPY_OUT(INDEX) g[INDEX] = x##INDEX
+
+void
+test (int n)
+{
+ union { long long l; double d; } u = { 0x12345678 };
+ gll = u.l;
+ int MULTI (DECLARE);
+ MULTI (COPY_IN);
+ MULTI (COPY_OUT);
+ MULTI (COPY_OUT);
+ MULTI (COPY_OUT);
+ gd = u.d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33560.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33560.c
new file mode 100644
index 000000000..7eea1e3f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33560.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+struct T
+{
+ int a, b;
+} t;
+
+__attribute__((noinline)) struct T *f (struct T *p)
+{
+ struct T *q = __builtin_malloc (sizeof (struct T));
+ *q = *p;
+ return q;
+}
+
+int main (void)
+{
+ struct T *p;
+
+ t.a = 1;
+ t.b = 2;
+ p = f (&t);
+ t.a = 3;
+
+ if (p->a != 1)
+ __builtin_abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33563.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33563.c
new file mode 100644
index 000000000..33e78521c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33563.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+
+struct T
+{
+ int a, b;
+} t, q;
+
+int main (void)
+{
+ struct T *p;
+
+ t.a = 1;
+ t.b = 2;
+ q = t;
+ t.a = 3;
+
+ if (q.a != 1)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33655.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33655.c
new file mode 100644
index 000000000..2f9da65ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33655.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+typedef struct {
+ unsigned long attr;
+ int chars[2];
+} cchar_t;
+typedef struct _win_st {
+ cchar_t _bkgrnd;
+} WINDOW;
+void render_char(WINDOW *win, cchar_t ch)
+{
+ if ((ch).chars[0] == L' '
+ && (ch).chars[1] == L'\0')
+ win->_bkgrnd = ch;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33848.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33848.c
new file mode 100644
index 000000000..c3b85e9e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33848.c
@@ -0,0 +1,43 @@
+/* &&foo should be hoisted, but on most targets, excess register pressure
+ forces it to be rematerialized before "data != &&foo". On targets that
+ have a "branch if registers are equal" instruction, this leads to the
+ branch having two LABEL_REFs: one for the branch target and one for
+ &&foo. When reloading &&foo into a register, reload would wrongly
+ say that &&foo was the target of the branch, and the real target would
+ then be removed as dead. */
+/* { dg-do link } */
+#define NVARS 30
+#define MULTI(X) \
+ X( 0), X( 1), X( 2), X( 3), X( 4), X( 5), X( 6), X( 7), X( 8), X( 9), \
+ X(10), X(11), X(12), X(13), X(14), X(15), X(16), X(17), X(18), X(19), \
+ X(20), X(21), X(22), X(23), X(24), X(25), X(26), X(27), X(28), X(29)
+
+#define DECLARE(INDEX) i##INDEX = gv[INDEX]
+#define COPY(INDEX) gv[INDEX] = i##INDEX
+
+volatile int gv[NVARS];
+void *volatile data;
+
+int
+main (void)
+{
+ __label__ foo;
+
+ if (gv[0] == 1)
+ goto foo;
+ data = &&foo;
+ do
+ {
+ int MULTI (DECLARE);
+ MULTI (COPY);
+ MULTI (COPY);
+ MULTI (COPY);
+ if (data != &&foo)
+ gv[0] = 1;
+ else
+ gv[1] = 2;
+ }
+ while (gv[0] > 0);
+ foo:
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33870.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33870.c
new file mode 100644
index 000000000..9c0e30d94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr33870.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+struct X {
+ int i;
+ int a[4];
+} m;
+
+int a[4];
+
+int __attribute__((noinline)) foo(int b)
+{
+ int (*p)[4] = b ? &a : &m.a;
+ a[3] = 0;
+ (*p)[3] = 1;
+ return (*p)[3] + (*p)[2] + (*p)[1] + a[0] + a[3];
+}
+
+extern void abort (void);
+
+int main()
+{
+ int i;
+ for (i = 0; i < 4; ++i)
+ a[i] = 0;
+ if (foo(1) != 2)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr34174-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr34174-1.c
new file mode 100644
index 000000000..0f1ed067f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr34174-1.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* Based on PR target/27386 testcase by Joerg Wunsch. */
+
+extern void abort (void);
+extern void exit (int);
+
+#if __INT_MAX__ >= 9223372036854775807LL
+typedef unsigned int uint64_t;
+#elif __LONG_MAX__ >= 9223372036854775807LL
+typedef unsigned long int uint64_t;
+#elif __LONG_LONG_MAX__ >= 9223372036854775807LL
+typedef unsigned long long int uint64_t;
+#else
+int
+main (void)
+{
+ exit (0);
+}
+#endif
+
+uint64_t a, b, c;
+
+int
+foo (uint64_t x, uint64_t y, uint64_t z, int i)
+{
+ a = x;
+ b = y;
+ c = z;
+ return 2 * i;
+}
+
+int
+main (void)
+{
+ if (foo (1234512345123ull, 3456734567345ull, 7897897897897ull, 42) != 84)
+ abort ();
+ if (a != 1234512345123ull)
+ abort ();
+ if (b != 3456734567345ull)
+ abort ();
+ if (c != 7897897897897ull)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr34330.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr34330.c
new file mode 100644
index 000000000..0ed2f9fb3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr34330.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-ftree-parallelize-loops=4 -ftree-vectorize" } */
+
+struct T
+{
+ int t;
+ struct { short s1, s2, s3, s4; } *s;
+};
+
+void
+foo (int *a, int *b, int *c, int *d, struct T *e)
+{
+ int i;
+ for (i = 0; i < e->t; i++)
+ {
+ e->s[i].s1 = a[i];
+ e->s[i].s2 = b[i];
+ e->s[i].s3 = c[i];
+ e->s[i].s4 = d[i];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35227.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35227.c
new file mode 100644
index 000000000..d951d250f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35227.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+mandel(double _Complex C)
+{
+ int py;
+ C = (__extension__ 1.0iF) * (double)py;
+ return cabs(C); /* { dg-warning "incompatible" } */
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35400.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35400.c
new file mode 100644
index 000000000..285dc72e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35400.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-Wtype-limits" } */
+
+struct A
+{
+ struct A *p;
+};
+
+int foo(const struct A *q)
+{
+ return q->p == q;
+}
+
+void bar(int);
+
+void baz()
+{
+ struct A a;
+
+ while (foo(&a))
+ bar(foo(&a));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35634.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35634.c
new file mode 100644
index 000000000..73f860f2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35634.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+void abort (void);
+void exit (int);
+
+void foo (int i)
+{
+ static int n;
+ if (i < -128 || i > 127)
+ abort ();
+ if (++n > 1000)
+ exit (0);
+}
+
+int main ()
+{
+ signed char c;
+ for (c = 0; ; c++) foo (c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-1.c
new file mode 100644
index 000000000..b3fd554da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-1.c
@@ -0,0 +1,9 @@
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define TYPE __m128
+
+#include "pr35771.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-2.c
new file mode 100644
index 000000000..a033caefd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-2.c
@@ -0,0 +1,9 @@
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define TYPE __m128d
+
+#include "pr35771.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-3.c
new file mode 100644
index 000000000..fcbe86cb1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771-3.c
@@ -0,0 +1,9 @@
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
+
+#define TYPE __m128i
+
+#include "pr35771.h"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771.h b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771.h
new file mode 100644
index 000000000..7b921c41b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35771.h
@@ -0,0 +1,30 @@
+typedef TYPE __attribute__((aligned(1))) unaligned;
+
+extern void abort (void);
+
+
+TYPE __attribute__((noinline))
+foo (TYPE a1, TYPE a2, TYPE a3, TYPE a4,
+ TYPE a5, TYPE a6, TYPE a7, TYPE a8,
+ int b1, int b2, int b3, int b4, int b5, int b6, int b7, unaligned y)
+{
+ return y;
+}
+
+void
+do_test (void)
+{
+ unaligned x;
+ TYPE y = { 0 };
+ x = y;
+ y = foo (y, y, y, y, y, y, y, y, 1, 2, 3, 4, 5, 6, -1, x);
+ if (__builtin_memcmp (&y, &x, sizeof (y)) != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ do_test ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35833.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35833.c
new file mode 100644
index 000000000..2e740f29f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35833.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "-ftree-vrp" } */
+
+struct S {struct S *field;};
+struct S True, False, Z;
+static inline int f(void) {return 1;}
+static inline int g(struct S **obj) {
+ return f() && *obj == &Z;
+}
+struct S **h(struct S **x) {
+ if (x)
+ return g(x) ? &True.field : &False.field;
+ else
+ return &True.field;
+}
+extern void abort (void);
+int main()
+{
+ if (h(&False.field) != &False.field)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35842.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35842.c
new file mode 100644
index 000000000..05b26d84c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr35842.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { *-*-mingw* } } } */
+extern __attribute__((dllimport)) const int SSL_ImplementedCiphers[];
+extern void SSL_GetCipherSuiteInfo(int cipherSuite);
+void nsCipherInfo(int SSL_NumImplementedCiphers)
+{
+ int i;
+ for (i = 0; i < SSL_NumImplementedCiphers; ++i)
+ {
+ const int i_id = SSL_ImplementedCiphers[i];
+ SSL_GetCipherSuiteInfo(i_id);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36066.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36066.c
new file mode 100644
index 000000000..0e1d1ce30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36066.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-funsafe-loop-optimizations -ftree-vrp" } */
+
+typedef int FLAC__int32;
+typedef int FLAC__bool;
+typedef struct { } FLAC__Subframe;
+typedef enum { FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0, FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1, FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2, FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 } FLAC__ChannelAssignment;
+typedef struct {
+ struct FLAC__StreamEncoderProtected *protected_;
+ struct FLAC__StreamEncoderPrivate *private_;
+} FLAC__StreamEncoder;
+typedef struct FLAC__StreamEncoderProtected {
+ FLAC__bool loose_mid_side_stereo;
+ unsigned channels;
+ unsigned blocksize;
+} FLAC__StreamEncoderProtected;
+typedef struct FLAC__StreamEncoderPrivate {
+ FLAC__int32 *integer_signal[(8u)];
+ FLAC__Subframe subframe_workspace_mid_side[2][2];
+ unsigned best_subframe_mid_side[2];
+ unsigned loose_mid_side_stereo_frame_count;
+} FLAC__StreamEncoderPrivate;
+static void get_wasted_bits_(FLAC__int32 signal[], unsigned samples)
+{
+ unsigned i;
+ FLAC__int32 x = 0;
+ for(i = 0; i < samples && !(x&1); i++)
+ x |= signal[i];
+}
+FLAC__Subframe * process_subframes_(FLAC__StreamEncoder *encoder, unsigned *bits)
+{
+ unsigned channel;
+ FLAC__Subframe *left_subframe = 0;
+ FLAC__ChannelAssignment channel_assignment;
+ for(channel = 0; channel < encoder->protected_->channels; channel++)
+ get_wasted_bits_(encoder->private_->integer_signal[channel], encoder->protected_->blocksize);
+ if(encoder->protected_->loose_mid_side_stereo && encoder->private_->loose_mid_side_stereo_frame_count > 0)
+ channel_assignment = FLAC__CHANNEL_ASSIGNMENT_MID_SIDE;
+ else {
+ FLAC__ChannelAssignment ca = (FLAC__ChannelAssignment)1;
+ unsigned min_bits = bits[0];
+ for(channel_assignment = (FLAC__ChannelAssignment)0; (int)ca <= 3; ca = (FLAC__ChannelAssignment)((int)ca + 1))
+ if(bits[ca] < min_bits)
+ channel_assignment = ca;
+ }
+ switch(channel_assignment) {
+ case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT:
+ case FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE:
+ case FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE:
+ case FLAC__CHANNEL_ASSIGNMENT_MID_SIDE:
+ left_subframe = &encoder->private_->subframe_workspace_mid_side[0][encoder->private_->best_subframe_mid_side[0]];
+ }
+ return left_subframe;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36227.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36227.c
new file mode 100644
index 000000000..462b2c4f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36227.c
@@ -0,0 +1,17 @@
+/* { dg-do run { target { stdint_types } } } */
+
+#include <stdint.h>
+extern void abort (void);
+int main()
+{
+ int i = 1;
+ int *p = &i;
+ uintptr_t iptr;
+
+ iptr = (uintptr_t)p - (uintptr_t)&iptr;
+ p = (int *)((uintptr_t)&iptr + iptr);
+ if (*p != 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36244.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36244.c
new file mode 100644
index 000000000..b1b14be18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36244.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O3 -ftree-parallelize-loops=4" } */
+
+struct p7prior_s {
+ int mnum; /* number of mat emission Dirichlet mixtures */
+ float mq[200]; /* probabilities of mnum components */
+ float m[200][20]; /* match emission terms per mix component */
+};
+
+struct p7prior_s *default_amino_prior(void);
+struct p7prior_s *P7AllocPrior(void);
+
+struct p7prior_s *
+default_amino_prior(void)
+{
+ struct p7prior_s *pri;
+ int x, q;
+
+ static float defmq[5] = {
+ 0.178091, 0.056591, 0.0960191, 0.0781233, 0.0834977 };
+ static float defm[5][6] = {
+ { 0.270671, 0.039848, 0.017576, 0.016415, 0.014268, 0.216147 },
+ { 0.021465, 0.010300, 0.011741, 0.010883, 0.385651, 0.029156 },
+ { 0.561459, 0.045448, 0.438366, 0.764167, 0.087364, 0.583402 },
+ { 0.070143, 0.011140, 0.019479, 0.094657, 0.013162, 0.073732 },
+ { 0.041103, 0.014794, 0.005610, 0.010216, 0.153602, 0.012049 }
+ };
+
+ pri = P7AllocPrior();
+ pri->mnum = 5;
+ for (q = 0; q < pri->mnum; q++)
+ {
+ pri->mq[q] = defmq[q];
+ for (x = 0; x < 6; x++)
+ pri->m[q][x] = defm[q][x];
+ }
+ return pri;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-1.c
new file mode 100644
index 000000000..9cd02c57a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-1.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-sra" } */
+
+extern void abort (void);
+struct Bar {
+ struct Foo {
+ int *p;
+ } x;
+ int *q;
+};
+struct Foo __attribute__((noinline))
+bar(int *p)
+{
+ struct Foo f;
+ f.p = p;
+ return f;
+}
+void __attribute__((noinline))
+foo(struct Foo f)
+{
+ *f.p = 0;
+}
+int main()
+{
+ int a, b;
+ a = 0;
+ b = 1;
+ struct Bar f;
+ f.x = bar (&b);
+ f.q = &a;
+ foo(f.x);
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-10.c
new file mode 100644
index 000000000..ed7017728
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-10.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__)
+typedef unsigned long long uintptr_t;
+#elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__)
+typedef unsigned long uintptr_t;
+#elif (__SIZEOF_INT__ == __SIZEOF_POINTER__)
+typedef unsigned int uintptr_t;
+#else
+#error Add target support here
+#endif
+
+void __attribute__((noinline))
+foo(uintptr_t l)
+{
+ int *p = (int *)l;
+ *p = 1;
+}
+
+extern void abort (void);
+int main()
+{
+ int b = 0;
+ uintptr_t l = (uintptr_t)&b;
+ foo(l);
+ if (b != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-2.c
new file mode 100644
index 000000000..2653182a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-2.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-sra" } */
+
+extern void abort (void);
+struct Foo {
+ int *p;
+};
+struct Bar {
+ struct Foo *x;
+ int *q;
+};
+struct Foo __attribute__((noinline))
+bar(int *p)
+{
+ struct Foo f;
+ f.p = p;
+ return f;
+}
+void __attribute__((noinline))
+foo(struct Foo f)
+{
+ *f.p = 0;
+}
+int main()
+{
+ int a, b;
+ a = 0;
+ b = 1;
+ struct Bar f;
+ struct Foo g = bar (&b);
+ f.x = &g;
+ f.q = &a;
+ foo(*f.x);
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-3.c
new file mode 100644
index 000000000..d5ad93e1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-3.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct Foo {
+ int *p;
+};
+struct Bar {
+ struct Foo *x;
+ int *q;
+};
+struct Foo __attribute__((noinline))
+bar(int *p)
+{
+ struct Foo f;
+ f.p = p;
+ return f;
+}
+void __attribute__((noinline))
+foo(struct Foo f)
+{
+ *f.p = 0;
+}
+int main()
+{
+ int a, b;
+ a = 0;
+ b = 1;
+ struct Bar f;
+ struct Foo g = bar (&b);
+ f.x = &g;
+ f.q = &a;
+ foo(*f.x);
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-4.c
new file mode 100644
index 000000000..5f3b83349
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-4.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct Foo {
+ int *p;
+ int *q;
+};
+struct Foo __attribute__((noinline))
+bar(int *p)
+{
+ struct Foo f;
+ f.p = p;
+ return f;
+}
+void __attribute__((noinline))
+foo(struct Foo f)
+{
+ *f.p = 0;
+}
+int main()
+{
+ int a, b;
+ a = 0;
+ b = 1;
+ struct Foo f;
+ f = bar (&b);
+ f.q = &a;
+ foo(f);
+ if (b != 0)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-5.c
new file mode 100644
index 000000000..0061ef418
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-5.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-sra" } */
+
+extern void abort (void);
+struct Foo {
+ int *p;
+ int *q;
+};
+struct Foo __attribute__((noinline))
+bar(int *p)
+{
+ struct Foo f;
+ f.p = p;
+ return f;
+}
+void __attribute__((noinline))
+foo(struct Foo f)
+{
+ *f.p = 0;
+}
+int main()
+{
+ int a, b;
+ a = 0;
+ b = 1;
+ struct Foo f;
+ f = bar (&b);
+ f.q = &a;
+ foo(f);
+ if (b != 0)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-6.c
new file mode 100644
index 000000000..c55e3ff3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-6.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-sra" } */
+
+extern void abort (void);
+struct Foo {
+ int *p;
+} x;
+struct Foo __attribute__((noinline))
+bar(int *p)
+{
+ struct Foo f;
+ f.p = p;
+ return f;
+}
+void __attribute__((noinline))
+foo()
+{
+ *x.p = 0;
+}
+int main()
+{
+ int b;
+ b = 1;
+ struct Foo g = bar (&b);
+ x = g;
+ foo();
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-7.c
new file mode 100644
index 000000000..103694e15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-7.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct Foo {
+ int *p;
+} x;
+struct Foo __attribute__((noinline))
+bar(int *p)
+{
+ struct Foo f;
+ f.p = p;
+ return f;
+}
+void __attribute__((noinline))
+foo()
+{
+ *x.p = 0;
+}
+int main()
+{
+ int b;
+ b = 1;
+ struct Foo g = bar (&b);
+ x = g;
+ foo();
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-8.c
new file mode 100644
index 000000000..9f77ea137
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-8.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-sra" } */
+
+extern void abort (void);
+struct Foo {
+ int *p;
+} x;
+void __attribute__((noinline))
+foo()
+{
+ *x.p = 0;
+}
+int main()
+{
+ int b;
+ struct Foo g;
+ b = 1;
+ g.p = &b;
+ x = g;
+ foo();
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-9.c
new file mode 100644
index 000000000..5588eadae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36373-9.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct Foo {
+ int *p;
+} x;
+void __attribute__((noinline))
+foo()
+{
+ *x.p = 0;
+}
+int main()
+{
+ int b;
+ struct Foo g;
+ b = 1;
+ g.p = &b;
+ x = g;
+ foo();
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36400.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36400.c
new file mode 100644
index 000000000..1dedc0aa1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36400.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-ffat-lto-objects" } */
+
+struct barstruct { char const* some_string; };
+
+void changethepointer(struct barstruct***);
+
+void baz()
+{
+ struct barstruct bar1;
+ struct barstruct* barptr = &bar1;
+ struct barstruct** barptr2 = &barptr;
+ changethepointer(&barptr2);
+ barptr->some_string = "Everything OK";
+}
+
+/* { dg-final { scan-assembler "Everything OK" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36891.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36891.c
new file mode 100644
index 000000000..ab58e43b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36891.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math" } */
+/* { dg-options "-ffast-math -msse" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target sse { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-ffast-math -mabi=altivec" { target { { powerpc*-*-linux* } && ia32 } } } */
+
+#define __vector __attribute__((vector_size(16) ))
+__vector float f(void);
+void g(__vector float);
+void RRB( __vector float vdist, __vector float vx)
+{
+ int detail;
+ for(detail = 0; detail < 5;++detail)
+ {
+ __vector float frand = f();
+ __vector float pullperc = frand/ vdist;
+ __vector float pullx = vx * pullperc;
+ g(pullx);
+ }
+}
+
+/* Ignore a warning that is irrelevant to the purpose of this test. */
+/* { dg-prune-output ".*GCC vector returned by reference.*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36978.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36978.c
new file mode 100644
index 000000000..cd1af4ebc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr36978.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-funswitch-loops" } */
+
+unsigned short status;
+void foo (const _Bool flag)
+{
+ if (status == 2 || status == 7)
+ {
+ while (status != 2 && (status != 7 || !flag))
+ {
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37731-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37731-1.c
new file mode 100644
index 000000000..5c156b1f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37731-1.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+extern void abort ();
+
+unsigned long long xh = 1;
+
+int
+main ()
+{
+ unsigned long long yh = 0xffffffffull;
+ unsigned long long z = xh * yh;
+
+ if (z != yh)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37731-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37731-2.c
new file mode 100644
index 000000000..a7f8f1e02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37731-2.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+extern void abort ();
+
+long long xh = 1;
+
+int
+main ()
+{
+ long long yh = 0xffffffffll;
+ long long z = xh * yh;
+
+ if (z != yh)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37868.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37868.c
new file mode 100644
index 000000000..5204c5a59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37868.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "-fno-strict-aliasing" } */
+/* { dg-skip-if "unaligned access" { arc*-*-* epiphany-*-* nds32*-*-* sparc*-*-* sh*-*-* tic6x-*-* } "*" "" } */
+
+extern void abort (void);
+#if (__SIZEOF_INT__ <= 2)
+struct X {
+ unsigned char pad : 4;
+ unsigned int a : 16;
+ unsigned int b : 8;
+ unsigned int c : 6;
+} __attribute__((packed));
+#else
+struct X {
+ unsigned char pad : 4;
+ unsigned int a : 32;
+ unsigned int b : 24;
+ unsigned int c : 6;
+} __attribute__((packed));
+
+#endif
+
+
+int main (void)
+{
+ struct X x;
+ unsigned int bad_bits;
+
+ x.pad = -1;
+ x.a = -1;
+ x.b = -1;
+ x.c = -1;
+
+ bad_bits = ((unsigned int)-1) ^ *(1+(unsigned int *) &x);
+ if (bad_bits != 0)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37969.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37969.c
new file mode 100644
index 000000000..cbb6f0598
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr37969.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-funswitch-loops" } */
+
+void foo(double);
+void CreateDefaultTexture(double mnMinimum, double mnMaximum,
+ unsigned short nCreateWhat)
+{
+ double d = 0.0;
+ for(;;)
+ {
+ if(nCreateWhat & (0x0001)
+ && mnMinimum != 0.0)
+ d = mnMinimum;
+ if(nCreateWhat & (0x0002)
+ && mnMaximum != 0.0)
+ d = mnMaximum;
+ foo(d);
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38271.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38271.c
new file mode 100644
index 000000000..2c64a9b34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38271.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+struct xxx {
+ short a;
+ short b;
+ void *c;
+};
+
+void bar(struct xxx);
+
+void foo(struct xxx *p, int i)
+{
+ struct xxx s0 = *p;
+ struct xxx s = s0;
+ if (s.a) i++;
+ bar(s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c
new file mode 100644
index 000000000..3f93445cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+extern void abort ();
+extern int printf (char *__format, ...);
+
+struct vpiBinaryConst {
+ int signed_flag :1;
+ int sized_flag :1;
+};
+
+int binary_get(int code, struct vpiBinaryConst *rfp)
+{
+ switch (code) {
+ case 1:
+ return rfp->signed_flag ? 1 : 0;
+ default:
+ printf("error: %d not supported\n", code);
+ return code;
+ }
+}
+
+int main(void)
+{
+ struct vpiBinaryConst x={1,0};
+ int y=binary_get(1, &x);
+ if (y!=1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38774.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38774.c
new file mode 100644
index 000000000..b62619416
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38774.c
@@ -0,0 +1,16 @@
+/* PR rtl-optimization/38774 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-options "-march=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern int bar (void);
+volatile int g;
+
+int
+foo (void)
+{
+ int a = 1 >= bar ();
+ if ((1 > 9223372036854775807LL - a && 1 - a ? : 1 + a) & 1)
+ return g;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38948.c
new file mode 100644
index 000000000..98ed493cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38948.c
@@ -0,0 +1,101 @@
+/* { dg-options "-fno-tree-sra" } */
+/* { dg-options "-fno-tree-sra -march=v32" { target cris-*-* } } */
+typedef unsigned char byte;
+typedef unsigned int uint;
+typedef int bool;
+typedef struct gs_const_string_s
+{
+ const byte *data;
+}
+gs_const_string;
+struct gs_matrix_s
+{
+ float xx, xy, yx, yy, tx, ty;
+};
+typedef struct gs_matrix_s gs_matrix;
+typedef long fixed;
+typedef struct gs_fixed_point_s
+{
+ fixed x, y;
+}
+gs_fixed_point;
+typedef struct gs_matrix_fixed_s
+{
+ int x;
+}
+gs_matrix_fixed;
+static int
+append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath)
+{
+ int numContours =
+ (int) (((((uint) ((glyph)[0]) << 8) + (glyph)[1]) ^ 0x8000) - 0x8000);
+ const byte *pends = glyph + 10;
+ int code = 0;
+ {
+ uint i = 0;
+ uint np = 0;
+ gs_fixed_point pt = {0};
+ uint reps = 0;
+ for (i = 0, np = 0; i < numContours; ++i)
+ {
+ bool move = ((bool) 1);
+ uint last_point =
+ (((uint) ((pends + i * 2)[0]) << 8) + (pends + i * 2)[1]);
+ int off_curve = 0;
+ gs_fixed_point cpoints[3];
+ for (; np <= last_point; --reps, ++np)
+ {
+ if (move)
+ {
+ cpoints[0] = pt;
+ move = ((bool) 0);
+ }
+ else
+ {
+ switch (off_curve++)
+ {
+ default:
+ cpoints[2].x = ((cpoints[1].x + pt.x) / 2);
+ cpoints[2].y = ((cpoints[1].y + pt.y) / 2);
+ code =
+ gx_path_add_curve_notes (ppath,
+ ((cpoints[0].x +
+ 2 * cpoints[1].x) / 3),
+ ((cpoints[0].y +
+ 2 * cpoints[1].y) / 3),
+ ((2 * cpoints[1].x +
+ cpoints[2].x) / 3),
+ ((2 * cpoints[1].y +
+ cpoints[2].y) / 3),
+ cpoints[2].x, cpoints[2].y,
+ 0);
+ cpoints[0] = cpoints[2];
+ case 0:
+ cpoints[1] = pt;
+ }
+ }
+ }
+ }
+ }
+}
+int
+append_outline (uint glyph_index, const gs_matrix_fixed *pmat, void *ppath)
+{
+ gs_const_string glyph_string = {0};
+ int numContours = 0;
+ numContours =
+ (int) (((((uint) ((glyph_string.data)[0]) << 8) +
+ (glyph_string.data)[1]) ^ 0x8000) - 0x8000);
+ if (numContours >= 0)
+ return append_simple (glyph_string.data, pmat, ppath);
+ {
+ uint flags = 0;
+ do
+ {
+ gs_matrix_fixed mat = {0};
+ gs_matrix scale_mat = {0};
+ gs_matrix_multiply (&scale_mat, (const gs_matrix *) &mat, (gs_matrix *) & mat);
+ }
+ while (flags & 32);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074-2.c
new file mode 100644
index 000000000..d18930a4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074-2.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+#include <stdint.h>
+
+int i;
+uintptr_t __attribute__((noinline,const)) bar(int ***p) { return (uintptr_t)p; }
+void __attribute__((noinline))
+foo(void)
+{
+ int *y;
+ int **a = &y, **x;
+ int ***p;
+ uintptr_t b;
+ b = bar(&a);
+ p = (int ***)b;
+ x = *p;
+ *x = &i; /* *ANYTHING = &i has to make sure that y points to i. */
+ *y = 0;
+}
+extern void abort (void);
+int main()
+{
+ i = 1;
+ foo ();
+ if (i != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "y.._. = { i }" "alias" } } */
+/* { dg-final { scan-tree-dump "y.._., points-to vars: { D..... }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074-3.c
new file mode 100644
index 000000000..7c7604826
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074-3.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-require-effective-target stdint_types } */
+
+#include <stdint.h>
+
+uintptr_t __attribute__((noinline,const)) bar(int ***p) { return (uintptr_t)p; }
+extern void abort (void);
+int main()
+{
+ int i, j;
+ int *y = &j;
+ int **a = &y, **x;
+ int ***p;
+ uintptr_t b;
+ b = bar(&a);
+ p = (int ***)b;
+ x = *p;
+ *x = &i;
+ i = 1;
+ *y = 0;
+ if (i != 0)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074.c
new file mode 100644
index 000000000..5d46f3120
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39074.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+typedef __INTPTR_TYPE__ intptr_t;
+
+int i;
+void __attribute__((noinline))
+foo(long b, intptr_t q)
+{
+ int *y;
+ int **a = &y, **x;
+ int ***p;
+ if (b)
+ p = (int ***)q;
+ else
+ p = &a;
+ x = *p;
+ *x = &i; /* *ANYTHING = &i has to make sure that y points to i. */
+ *y = 0;
+}
+extern void abort (void);
+int main()
+{
+ i = 1;
+ foo (0, 0);
+ if (i != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "y.._. = { i }" "alias" } } */
+/* { dg-final { scan-tree-dump "y.._., points-to vars: { D..... }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39132.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39132.c
new file mode 100644
index 000000000..f6e2907e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39132.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-ftree-loop-distribution" } */
+
+extern void abort(void);
+
+struct epic_private
+{
+ unsigned int *rx_ring;
+ unsigned int rx_skbuff[5];
+};
+
+int
+main (void)
+{
+ struct epic_private ep;
+ unsigned int rx_ring[5];
+ int i;
+
+ ep.rx_skbuff[0] = 5;
+
+ ep.rx_ring = rx_ring;
+
+ for (i = 0; i < 5; i++)
+ {
+ ep.rx_ring[i] = i;
+ ep.rx_skbuff[i] = 0;
+ }
+
+ if (ep.rx_skbuff[0] != 0)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39204.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39204.c
new file mode 100644
index 000000000..1389a52ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39204.c
@@ -0,0 +1,131 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+__extension__ typedef __u_quad_t __dev_t;
+__extension__ typedef unsigned int __uid_t;
+__extension__ typedef unsigned int __gid_t;
+__extension__ typedef unsigned long int __ino_t;
+__extension__ typedef __u_quad_t __ino64_t;
+__extension__ typedef unsigned int __mode_t;
+__extension__ typedef unsigned int __nlink_t;
+__extension__ typedef long int __off_t;
+__extension__ typedef __quad_t __off64_t;
+__extension__ typedef int __pid_t;
+__extension__ typedef struct {
+ int __val[2];
+} __fsid_t;
+__extension__ typedef long int __clock_t;
+__extension__ typedef unsigned int __id_t;
+typedef struct _IO_FILE FILE;
+typedef struct _IO_FILE __FILE;
+typedef struct {
+ int __count;
+ union {
+ unsigned int __wch;
+ char __wchb[4];
+ }
+ __value;
+} __mbstate_t;
+typedef struct {
+ __off_t __pos;
+ __mbstate_t __state;
+} _G_fpos_t;
+typedef struct {
+ __off64_t __pos;
+ __mbstate_t __state;
+} _G_fpos64_t;
+typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
+typedef struct _IO_FILE _IO_FILE;
+extern struct _IO_FILE_plus _IO_2_1_stderr_;
+extern int fputs (__const char *__restrict __s, FILE * __restrict __stream);
+extern char *strstr (__const char *__haystack, __const char *__needle)
+ __attribute__ ((__nonnull__ (1, 2)));
+ extern char *rindex (__const char *__s, int __c) __attribute__ ((__nonnull__ (1)));
+extern size_t strlen (__const char *__s) __attribute__ ((__nothrow__))
+ __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+ char *mystrlwr (char *string);
+ char *m_replace_filename (const char *path, const char *filename);
+ typedef struct LINE {
+ char *text;
+ struct LINE *next;
+ int flags;
+ } LINE;
+typedef struct TOC {
+ char *text;
+ char *alt;
+ struct TOC *next;
+ int root;
+ int texinfoable;
+ int htmlable;
+ int otherfile;
+} TOC;
+static int _empty_count;
+extern char *_word_substitution[256];
+static void _output_sorted_nested_toc (TOC ** list, unsigned int num_items);
+static char *_do_text_substitution (char *input);
+static int _toc_scmp (const void *e1, const void *e2)
+{
+ TOC *t1 = *((TOC **) e1);
+ TOC *t2 = *((TOC **) e2);
+ return mystricmp (t1->text, t2->text);
+}
+static void _output_buffered_text (void) { if (_empty_count) ; }
+void _post_process_filename (char *filename)
+{
+ int code_scanning = 0;
+ char *new_filename, *p;
+ char *line;
+ FILE *f1 = 0, *f2 = 0;
+ if (!new_filename || strlen (new_filename) < 2)
+ new_filename[strlen (filename) - 1] = 'x';
+ if (!f1 || !f2)
+ while ((line = m_fgets (f1)))
+ {
+ line = _do_text_substitution (line);
+ fputs (line, f2);
+ }
+ if (remove (filename))
+ cancel:
+ if (f1)
+ if (f2)
+ if (new_filename)
+ ;
+}
+static void _close_html_file (FILE * file)
+{
+ int f;
+ for (f = 0; _word_substitution[f]; f++)
+ ;
+}
+static __attribute__((always_inline))
+char * _do_text_substitution (char *input)
+{
+ int start, end, middle, f;
+ char *temp, *found, *reader;
+ for (f = 0; _word_substitution[f]; f++)
+ {
+ reader = input;
+ while ((found = strstr (reader, _word_substitution[f])))
+ {
+ start = found - input;
+ input = temp;
+ reader = temp + start + middle;
+ }
+ }
+ return input;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39241.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39241.c
new file mode 100644
index 000000000..860a04d73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39241.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+static inline int
+foo (float f)
+{
+ return *((int *) &f) - 1;
+}
+
+float
+bar (float x, float y, float *z)
+{
+ float c = y < 0.002f ? 0.002f : y;
+ float d = x < c ? c : x;
+ return z[foo (c)] + z[foo (d * 255.0f)];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39678.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39678.c
new file mode 100644
index 000000000..5411fbbc1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39678.c
@@ -0,0 +1,27 @@
+/* PR target/39678 */
+/* { dg-do run } */
+/* { dg-options "-Wno-psabi" } */
+
+struct X {
+ signed char c;
+ __complex__ float val;
+};
+
+struct X __attribute__((noinline))
+foo (float *p)
+{
+ struct X x;
+ x.c = -3;
+ __real x.val = p[0];
+ __imag x.val = p[1];
+ return x;
+}
+extern void abort (void);
+float a[2] = { 3., -2. };
+int main()
+{
+ struct X x = foo(a);
+ if (x.c != -3 || __real x.val != a[0] || __imag x.val != a[1])
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39829.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39829.c
new file mode 100644
index 000000000..da15a56e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39829.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+void foo (void * DAG_temp117584)
+{
+ char uA;
+ void* pA;
+ void* pB;
+ void* pC;
+ do {
+ int DAG_temp117585;
+ int DAG_temp117586;
+ void ** __indir_union1 = (void**)DAG_temp117584;
+ DAG_temp117585 = (long)*__indir_union1;
+ DAG_temp117586 = DAG_temp117585;
+ if ( DAG_temp117586 != (int)268435456 )
+ pA = (void*)&uA;
+ pB = (void*)&pA;
+ pC = pB;
+ union __block_indir0_u { struct { long val; } __indir_struct; }
+ * __indir_union = (union __block_indir0_u*)pC;
+ f(__indir_union->__indir_struct.val);
+
+ DAG_temp117584 += 64;
+ } while (1);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39855.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39855.c
new file mode 100644
index 000000000..6d75c38a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39855.c
@@ -0,0 +1,24 @@
+/* PR c/39855 */
+/* { dg-do run { target { int32plus } } } */
+
+extern void abort (void);
+
+int i, j, k;
+
+int
+foo (void)
+{
+ return ++i;
+}
+
+int
+main ()
+{
+ if (__CHAR_BIT__ != 8 || sizeof (int) != 4)
+ return 0;
+ j = foo () << 30 << 2;
+ k = (unsigned) foo () >> 16 >> 16;
+ if (i != 2 || j != 0 || k != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39903-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39903-1.c
new file mode 100644
index 000000000..1a67dd795
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39903-1.c
@@ -0,0 +1,24 @@
+/* PR target/39903 */
+/* { dg-do run } */
+/* { dg-options "-Wno-psabi" } */
+
+struct X {
+ double d;
+ double b[];
+};
+
+struct X __attribute__((noinline))
+foo (double d)
+{
+ struct X x;
+ x.d = d;
+ return x;
+}
+extern void abort (void);
+int main()
+{
+ struct X x = foo(3.0);
+ if (x.d != 3.0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39903-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39903-2.c
new file mode 100644
index 000000000..0cd74029b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr39903-2.c
@@ -0,0 +1,24 @@
+/* PR target/39903 */
+/* { dg-do run } */
+/* { dg-options "-Wno-psabi" } */
+
+struct X {
+ float d;
+ float b[];
+};
+
+struct X __attribute__((noinline))
+foo (float d)
+{
+ struct X x;
+ x.d = d;
+ return x;
+}
+extern void abort (void);
+int main()
+{
+ struct X x = foo(3.0);
+ if (x.d != 3.0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40328.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40328.c
new file mode 100644
index 000000000..e378e63c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40328.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-sra" } */
+
+_Complex float foo(void)
+{
+ _Complex float a[64] = {};
+ _Complex float x;
+ x = a[1];
+ return x;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-1.c
new file mode 100644
index 000000000..cb2510e88
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse4" } */
+#include <nmmintrin.h>
+__m128i load (char *);
+char *
+foo (char *p1, char *p2,
+ int bmsk, __m128i mask1, __m128i mask2)
+{
+ int len = 0;
+ __m128i frag1, frag2;
+ int cmp_s;
+ if( !p2[0]) return p1;
+ if( !p1[0] ) return NULL;
+ frag2 = load (p2);
+ frag1 = load (p1);
+ frag2 = _mm_blendv_epi8(frag2, mask2, mask1);
+ frag1 = _mm_blendv_epi8(frag1, mask2, mask1);
+ cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c);
+ if( cmp_s )
+ __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) );
+ return p1 + len;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-2.c
new file mode 100644
index 000000000..b0414bbea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse4" } */
+#include <nmmintrin.h>
+__m128i load (char *);
+char *
+foo (const unsigned char *s1, const unsigned char *s2,
+ int bmsk, __m128i frag2)
+{
+ int len = 0;
+ char *p1 = (char *) s1;
+ char *p2 = (char *) s2;
+ __m128i frag1, fruc, mask;
+ int cmp_c, cmp_s;
+ if( !p2[0]) return (char *) s1;
+ if( !p1[0] ) return NULL;
+ if( p2[1]) frag2 = load (p2);
+ frag1 = load (p1);
+ fruc = _mm_loadu_si128 ((__m128i *) s1);
+ mask = _mm_cmpistrm(fruc, frag2, 0x44);
+ frag2 = _mm_blendv_epi8(frag2, mask, mask);
+ frag1 = _mm_blendv_epi8(frag1, mask, mask);
+ cmp_c = _mm_cmpistrc(frag2, frag1, 0x0c);
+ cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c);
+ if( cmp_s & cmp_c )
+ __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) );
+ return p2 + len;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-3.c
new file mode 100644
index 000000000..5c4c361de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-3.c
@@ -0,0 +1,22 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse4" } */
+#include <nmmintrin.h>
+__m128i load (char *);
+char *
+foo (char *p1, char *p2,
+ int bmsk, __m128i mask1, __m128i mask2)
+{
+ int len = 0;
+ __m128i frag1, frag2;
+ int cmp_s;
+ if( !p2[0]) return p1;
+ if( !p1[0] ) return NULL;
+ frag2 = load (p2);
+ frag1 = load (p1);
+ frag2 = _mm_blendv_epi8(frag2, mask2, mask1);
+ frag1 = _mm_blendv_epi8(frag1, mask1, mask2);
+ cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c);
+ if( cmp_s )
+ __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) );
+ return p1 + len;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-4.c
new file mode 100644
index 000000000..f9d0e5095
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr40470-4.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse4" } */
+#include <nmmintrin.h>
+__m128i load (char *);
+char *
+foo (const unsigned char *s1, const unsigned char *s2,
+ int bmsk, __m128i frag2)
+{
+ int len = 0;
+ char *p1 = (char *) s1;
+ char *p2 = (char *) s2;
+ __m128i frag1, fruc1, fruc2, mask1, mask2;
+ int cmp_c, cmp_s;
+ if( !p2[0]) return (char *) s1;
+ if( !p1[0] ) return NULL;
+ if( p2[1]) frag2 = load (p2);
+ frag1 = load (p1);
+ fruc1 = _mm_loadu_si128 ((__m128i *) s1);
+ fruc2 = _mm_loadu_si128 ((__m128i *) s2);
+ mask1 = _mm_cmpistrm(fruc1, frag2, 0x44);
+ mask2 = _mm_cmpistrm(fruc2, frag1, 0x14);
+ frag2 = _mm_blendv_epi8(frag2, mask1, mask2);
+ frag1 = _mm_blendv_epi8(frag1, mask2, mask1);
+ cmp_c = _mm_cmpistrc(frag2, frag1, 0x0c);
+ cmp_s = _mm_cmpistrs(frag2, frag1, 0x0c);
+ if( cmp_s & cmp_c )
+ __asm("bsfl %[bmsk], %[len]" : [len] "=r" (len) : [bmsk] "r" (bmsk) );
+ return p2 + len;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41094.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41094.c
new file mode 100644
index 000000000..2a4e9616c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41094.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-ffast-math" } */
+
+#include <math.h>
+
+extern void abort (void);
+
+double foo(void)
+{
+ double x = -4.0;
+ return pow (x * x, 0.25);
+}
+
+int main()
+{
+ if (foo() != 2.0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41261.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41261.c
new file mode 100644
index 000000000..8e601555c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41261.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-fprofile-arcs" } */
+
+extern void relocate_kernel();
+void machine_kexec(void *control_page)
+{
+ __builtin_memcpy(control_page, relocate_kernel, 2048);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41555.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41555.c
new file mode 100644
index 000000000..c201fda0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41555.c
@@ -0,0 +1,119 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+#include <stdint.h>
+#include <limits.h>
+
+extern void abort (void);
+
+static uint64_t safe_div_func_uint64_t_u_u (uint64_t _ui1, uint64_t _ui2)
+{
+ if (_ui2==0) return _ui1;
+ return _ui1 / _ui2;
+}
+
+static int64_t safe_div_func_int64_t_s_s (int64_t _si1, int64_t _si2)
+{
+ if (_si2==0 || (_si1==INT64_MIN && _si2==-1)) return _si1;
+ return _si1 / _si2;
+}
+
+#define safe_add_macro_int8_t_s_s(si1,si2) \
+ ((((((int8_t)(si1))>((int8_t)0)) && (((int8_t)(si2))>((int8_t)0)) && (((int8_t)(si1)) > ((INT8_MAX)-((int8_t)(si2))))) \
+ || ((((int8_t)(si1))<((int8_t)0)) && (((int8_t)(si2))<((int8_t)0)) && (((int8_t)(si1)) < ((INT8_MIN)-((int8_t)(si2)))))) \
+ ? ((int8_t)(si1)) \
+ : (((int8_t)(si1)) + ((int8_t)(si2))) \
+ )
+
+static int8_t
+safe_add_func_int8_t_s_s(int8_t _si1, int8_t _si2)
+{
+ return safe_add_macro_int8_t_s_s(_si1,_si2);
+}
+
+#define safe_rshift_macro_uint64_t_u_s(left,right) \
+ (((((int)(right)) < ((uint64_t)0)) \
+ || (((int)(right)) >= sizeof(uint64_t)*CHAR_BIT)) \
+ ? ((uint64_t)(left)) \
+ : (((uint64_t)(left)) >> ((int)(right))))
+
+static uint64_t
+safe_rshift_func_uint64_t_u_s(uint64_t _left, int _right)
+{
+ return safe_rshift_macro_uint64_t_u_s(_left,_right);
+}
+
+#define safe_mul_macro_int32_t_s_s(si1,si2) \
+ ((((((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) && (((int32_t)(si1)) > ((INT32_MAX) / ((int32_t)(si2))))) || \
+ ((((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MIN) / ((int32_t)(si1))))) || \
+ ((((int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) && (((int32_t)(si1)) < ((INT32_MIN) / ((int32_t)(si2))))) || \
+ ((((int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) && (((int32_t)(si1)) != ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MAX) / ((int32_t)(si1)))))) \
+ ? ((int32_t)(si1)) \
+ : ((int32_t)(si1)) * ((int32_t)(si2)))
+
+static int32_t
+safe_mul_func_int32_t_s_s (int32_t _si1, int32_t _si2)
+{
+ return safe_mul_macro_int32_t_s_s(_si1,_si2);
+}
+
+static int8_t g_39;
+static volatile uint8_t g_46;
+static uint8_t g_47;
+static uint8_t *g_62;
+static uint8_t g_79;
+static int8_t g_101 = -1L;
+static uint8_t *g_114;
+static uint8_t *g_126;
+static uint8_t g_133;
+
+static uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38);
+static uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38)
+{
+ if (g_62 != 0)
+ abort ();
+ for (g_39 = 1; g_39 < 0; g_39 = 1)
+ {
+ }
+ return 1;
+}
+
+static int32_t func_19 (int32_t p_20);
+static int32_t func_19 (int32_t p_20)
+{
+ if (1 !=
+ safe_div_func_uint64_t_u_u ((safe_div_func_int64_t_s_s (p_20, 1)),
+ g_101))
+ {
+ func_35 (0, 1 <= (safe_add_func_int8_t_s_s (g_47, g_46)) > p_20 < 1, 1);
+ g_133 = 1;
+ if (g_114 != 0)
+ abort ();
+ if (g_126 != 0)
+ abort ();
+ }
+ return 1;
+}
+
+static uint8_t func_2 (int32_t p_6);
+static uint8_t func_2 (int32_t p_6)
+{
+ for (1; p_6 > 1; 1)
+ return 0;
+ func_19 (g_79);
+ if (safe_mul_func_int32_t_s_s
+ ((0, 1 < (safe_rshift_func_uint64_t_u_s (1 ^ p_6, 1))),
+ (func_35 (&p_6, 1, 1) < 1)))
+ {
+ }
+ return 1;
+}
+
+int main (void)
+{
+ func_2 (1);
+ if (g_133 != 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41993.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41993.c
new file mode 100644
index 000000000..890e36561
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr41993.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx -mvzeroupper" { target { i?86-*-* x86_64-*-* } } } */
+
+short retframe_short (void *rframe)
+{
+ __builtin_return (rframe);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42363.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42363.c
new file mode 100644
index 000000000..9c9da1373
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42363.c
@@ -0,0 +1,84 @@
+/* PR middle-end/pr42363, extended from the test for PR middle-end/37913. */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+void foo (void) __attribute__ ((noreturn));
+
+static int __attribute__ ((noreturn))
+bar (void)
+{
+ foo ();
+}
+
+int
+baz (void)
+{
+ int i = bar ();
+ return i + 1;
+}
+
+int fooz (void) __attribute__ ((noreturn));
+
+static int __attribute__ ((noreturn))
+bart (void)
+{
+ return fooz (); /* { dg-warning "noreturn" } */
+}
+
+int bazr (void)
+{
+ int i = bart ();
+ return i + 1;
+}
+
+static inline int
+bard (void)
+{
+ return fooz ();
+}
+
+int bizr (void)
+{
+ int i, j;
+
+ i = j = bard ();
+
+ return i + 1;
+}
+
+/* This might be regarded as pure and folded, rather than inlined.
+ It's pure evil. */
+static int __attribute__ ((pure, const, noreturn))
+barf (void)
+{
+} /* { dg-warning "does return" } */
+
+static int __attribute__ ((pure, const))
+bark (void)
+{
+ barf ();
+}
+
+int buzr (void)
+{
+ int i, j;
+
+ i = j = bark () + bark ();
+
+ return i + 1;
+}
+
+int buzt (void)
+{
+ int i, j;
+
+ i = j = barf () + barf ();
+
+ return i + 1;
+}
+
+void bust (void)
+{
+ while (barf ())
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42667.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42667.c
new file mode 100644
index 000000000..eac80014b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42667.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+extern int strlen(const char *);
+void WriteTextDots(int len);
+
+void OnDisplay(char * string)
+{
+ if (!string)
+ string = "(none)";
+ WriteTextDots(strlen(string));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42878-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42878-1.c
new file mode 100644
index 000000000..8c21f0f60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42878-1.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug" } */
+
+struct S {
+ int i;
+};
+
+extern struct S *e1(void);
+extern int e2(int i);
+
+static inline void f1()
+{
+ int i;
+ struct S *s;
+ for (i = 0; i < 10; i++)
+ s = e1();
+ e2(s->i);
+}
+
+static inline void f2(int i)
+{
+ int j = j;
+ j = e2(i);
+}
+
+void foo(int i)
+{
+ f1();
+ f2(i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42878-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42878-2.c
new file mode 100644
index 000000000..67e413a2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42878-2.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug" } */
+
+extern void error(void) __attribute__((noreturn));
+
+struct S {
+ struct S *s;
+};
+
+static inline unsigned char f2()
+{
+ error();
+}
+
+static inline void f1()
+{
+ int builtin_optab;
+ if (!f2() && builtin_optab)
+ error();
+}
+
+extern void f4(struct S *s);
+
+static inline void f3(struct S *s)
+{
+ f4(s->s->s);
+}
+
+void expand_builtin(struct S *s, int cond)
+{
+ if (cond)
+ f1();
+ f3(s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42898-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42898-2.c
new file mode 100644
index 000000000..ee2de9675
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42898-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+struct hardware {
+ int parm1:8;
+ int :4;
+ int parm2:4;
+ int parm3:15;
+ int parm4:1;
+};
+
+const struct hardware h = {
+ .parm1=42,
+ .parm2=13,
+ .parm3=11850,
+ .parm4=1,
+};
+
+void f1(volatile struct hardware *ptr)
+{
+ *ptr = h;
+}
+
+/* { dg-final { scan-tree-dump-times "\\*ptr" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42898.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42898.c
new file mode 100644
index 000000000..d87c45dfb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42898.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+struct hardware {
+ int parm1:8;
+ int :4;
+ int parm2:4;
+ int parm3:15;
+ int parm4:1;
+};
+
+void f1(volatile struct hardware *ptr)
+{
+ *ptr=(struct hardware) {
+ .parm1=42,
+ .parm2=13,
+ .parm3=11850,
+ .parm4=1,
+ };
+}
+
+/* { dg-final { scan-tree-dump-times "\\*ptr" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42952.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42952.c
new file mode 100644
index 000000000..db8782af3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr42952.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-ccp -fno-tree-fre" } */
+
+extern void abort (void);
+
+static int g[1];
+
+static int * const p = &g[0];
+static int * const q = &g[0];
+
+int main(void)
+{
+ g[0] = 1;
+ *p = 0;
+ *p = *q;
+ if (g[0] != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43000.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43000.c
new file mode 100644
index 000000000..c11233750
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43000.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-fwrapv" } */
+
+int __attribute__((noinline))
+foo (long i, long j)
+{
+ if (i >= 1)
+ if (j > -(long)(((unsigned long)(long)-1)>>1))
+ {
+ long x;
+ j--;
+ x = i + j;
+ if (x >= 0)
+ return 1;
+ }
+ return 0;
+}
+extern void abort (void);
+int main()
+{
+ if (foo (1, 1) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43002.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43002.c
new file mode 100644
index 000000000..f28a9102b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43002.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall -fwrapv" } */
+
+long A[4], B[100];
+
+void foo(void)
+{
+ int i, j, k = 3;
+ while (A[k] && k > 0) k--; /* k = {0, 1, 2, 3} */
+ for (i = 3 - k; i >= 0; i--) /* i = {0..3-k} */
+ for (j = 0; j <= k; j++) { /* line 8; j = {0..k} */
+ B[i + j] = 0; /* line 9; i + j = {0..3-k+k} = {0..3} */
+ for (j = 0; j <= k; j++); /* only one iteration is done, with j == 0 */
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43017.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43017.c
new file mode 100644
index 000000000..257945290
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43017.c
@@ -0,0 +1,99 @@
+/* { dg-do run } */
+/* { dg-options "-fwrapv" } */
+
+signed char foo(unsigned char c2)
+{
+ signed char c2_22;
+
+ if (c2 <= 63 || c2 == 127)
+ goto bb43;
+ else
+ goto bb20;
+
+bb20:
+ if (c2 > 252)
+ goto bb43;
+ else
+ goto bb21;
+
+bb21:
+ /*...*/;
+
+bb24:
+ c2_22 = (signed char)c2;
+ if (c2_22 >= 0)
+ goto bb25;
+ else
+ goto bb26;
+
+bb25:
+ c2 = (unsigned char)(c2_22 - 64);
+ goto bb27;
+
+bb26:
+ c2 = (unsigned char)(c2_22 - 65);
+
+bb27:
+ if (c2 <= 93)
+ goto bb28;
+ else
+ goto bb29;
+
+bb28:
+ c2 = c2 + 33;
+ goto bb30;
+
+bb29:
+ c2 = (unsigned char)((signed char)c2 - 61);
+
+bb30:
+ return c2;
+
+bb43:
+ return -1;
+}
+extern void abort (void);
+int main()
+{
+ signed char res[256] = {
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 84, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, -1,
+ 96, 97, 98, 99, 100, 101, 102, 103,
+ 104, 105, 106, 107, 108, 109, 110, 111,
+ 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, 79, 80, 81,
+ 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105,
+ 106, 107, 108, 109, 110, 111, 112, 113,
+ 114, 115, 116, 117, 118, 119, 120, 121,
+ 122, 123, 124, 125, 126, -1, -1, -1
+ };
+ unsigned int c;
+ for (c = 0; c <= 255; ++c)
+ {
+ if (foo (c) != res[c])
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43165.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43165.c
new file mode 100644
index 000000000..991c3d118
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43165.c
@@ -0,0 +1,18 @@
+/* PR debug/43165 */
+/* { dg-options "-g" } */
+/* { dg-require-effective-target int32plus } */
+
+struct __attribute__((packed)) S
+{
+ unsigned char a;
+ unsigned short b;
+ unsigned short c;
+ unsigned d : 24;
+};
+
+void
+foo (struct S p)
+{
+ for (; p.c; p.c++)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43360.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43360.c
new file mode 100644
index 000000000..9ed9872db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43360.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+int l_5_5_2 = 4;
+int g_3[1][1];
+
+void func_1 (void)
+{
+ for (g_3[0][0] = 1; g_3[0][0] < 8; g_3[0][0] += 7) {
+ int *l_6 = &g_3[0][0];
+ *l_6 = l_5_5_2;
+ }
+}
+
+int main (void)
+{
+ func_1 ();
+ if (g_3[0][0] != 11)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43560.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43560.c
new file mode 100644
index 000000000..44abb80b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43560.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-require-weak "" } */
+
+int g_6[1][2] = {{1,1}};
+int g_34 = 0;
+int *const g_82 = &g_6[0][1];
+int *g_85[2][1] __attribute__((weak));
+
+void __attribute__((noinline))
+func_4 (int x)
+{
+ int i;
+ for (i = 0; i <= x; i++) {
+ if (g_6[0][1]) {
+ *g_82 = 1;
+ } else {
+ int **l_109 = &g_85[1][0];
+ if (&g_82 != l_109) {
+ } else {
+ *l_109 = &g_6[0][1];
+ }
+ *g_82 = 1;
+ }
+ }
+}
+
+int main (void)
+{
+ g_85[0][0] = &g_34;
+ g_85[1][0] = &g_34;
+ func_4(1);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43781.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43781.c
new file mode 100644
index 000000000..37fe5a367
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43781.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+
+typedef int int32_t;
+typedef unsigned char uint8_t;
+
+struct S0
+{
+ uint8_t f3;
+};
+
+struct S2
+{
+ uint8_t f5;
+};
+
+struct S0 g_22 = {
+ 0
+};
+
+int32_t g_91;
+const struct S2 *g_314;
+const struct S2 **g_313 = &g_314;
+struct S2 g_320[2] = {
+ 0
+};
+
+void
+int32func (uint64p_34)
+{
+ for (g_22.f3 = 0; g_22.f3 <= 0; g_22.f3)
+ {
+ lbl_491:{
+ if (1)
+ {
+ int32_t *l_453[2][7][7][1][1];
+ int i, j, k, l, m;
+ for (m; m; m++)
+ l_453[i][j][k][l][m];
+ }
+ *g_313 = 0;
+ if (g_91)
+ goto lbl_491;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879-3.c
new file mode 100644
index 000000000..5ee80d518
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879-3.c
@@ -0,0 +1,41 @@
+/* { dg-do run } */
+/* { dg-options "-fipa-pta" } */
+
+typedef unsigned long ulong;
+
+int __attribute__((noinline, noclone))
+f4 (int a, int b, int c, int d, int e)
+{
+ return a + b + c + d + e;
+}
+
+void __attribute__((noinline, noclone))
+f3 (int *p)
+{
+ *p = f4(1, 2, 3, 4, 5);
+}
+
+void __attribute__((noinline, noclone))
+f2 ()
+{
+ int unused;
+ f3 (&unused);
+}
+
+void __attribute__((noinline, noclone))
+f1 (ulong e, ulong f)
+{
+ if (e > 5 || f > 5) __builtin_abort();
+ f2 ();
+}
+
+
+int main()
+{
+ ulong e, f;
+ for (e = 5; e > 0; e--)
+ for (f = 5; f > 0; f--)
+ f1(e, f);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879_1.c
new file mode 100644
index 000000000..151a184cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879_1.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-fipa-pta" } */
+/* { dg-additional-sources "pr43879_2.c" } */
+
+void bar(int c)
+{
+ static int x = 1;
+ if (c != x) __builtin_abort();
+ x--;
+}
+
+void baz(int *i)
+{
+ (*i)--;
+}
+
+struct TBL {
+ int (*p)(int *i);
+};
+extern struct TBL tbl;
+
+int main()
+{
+ int c = 1;
+ return tbl.p(&c);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879_2.c
new file mode 100644
index 000000000..8155653a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr43879_2.c
@@ -0,0 +1,17 @@
+struct TBL {
+ int (*p)(int *i);
+};
+
+extern void bar(int i);
+extern void baz(int *i);
+
+static int foo(int *i)
+{
+ bar(*i);
+ baz(i);
+ bar(*i);
+ return *i;
+}
+
+struct TBL tbl = { foo };
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44050.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44050.c
new file mode 100644
index 000000000..931eff6ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44050.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-pta" } */
+
+static void __attribute__((noinline))
+foo (int *i, int n)
+{
+ *i = n;
+}
+
+int
+main (void)
+{
+ int i = 0;
+ foo (&i, 1);
+
+ if (i != 1)
+ __builtin_abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44695.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44695.c
new file mode 100644
index 000000000..85bb4c7b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44695.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8_t;
+
+static uint8_t
+safe_div_func_uint8_t_u_u (uint8_t ui1, uint8_t ui2)
+{
+ return ui2 ? ui2 : (ui1 / ui2);
+}
+
+int
+int81 (int x)
+{
+ return safe_div_func_uint8_t_u_u (1, 8 & x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44806.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44806.c
new file mode 100644
index 000000000..8b67b10f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44806.c
@@ -0,0 +1,91 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+#include <stdint.h>
+
+extern void abort (void);
+
+#define N_DEV_BITS_4 5
+#define N_INO_BITS_4 (32 - N_DEV_BITS_4 - 2 - 1)
+
+#define N_DEV_BITS_8 8
+#define N_INO_BITS_8 (64 - N_DEV_BITS_8 - 2 - 1)
+
+struct dev_ino_4
+{
+ uint32_t mode:2;
+ uint32_t short_ino:N_INO_BITS_4;
+ uint32_t mapped_dev:N_DEV_BITS_4;
+ uint32_t always_set:1;
+};
+
+struct dev_ino_8
+{
+ uint32_t mode:2;
+ uint64_t short_ino:N_INO_BITS_8;
+ uint32_t mapped_dev:N_DEV_BITS_8;
+ uint32_t always_set:1;
+};
+
+struct dev_ino_full
+{
+ uint32_t mode:2;
+ uint32_t dev;
+ uint32_t ino;
+};
+
+enum di_mode
+{
+ DI_MODE_4 = 1,
+ DI_MODE_8 = 2,
+ DI_MODE_FULL = 3
+};
+
+struct di_ent
+{
+ union
+ {
+ struct dev_ino_4 di4;
+ struct dev_ino_8 di8;
+ struct dev_ino_full full;
+ uint32_t u32;
+ uint64_t u64;
+ void *ptr;
+ } u;
+};
+
+static struct di_ent
+decode_ptr (struct di_ent const *v)
+{
+ struct di_ent di;
+ di.u.ptr = (void *) v;
+ return di;
+}
+
+static int
+di_ent_equal (void const *x, void const *y)
+{
+ struct di_ent a = decode_ptr (x);
+ struct di_ent b = decode_ptr (y);
+ if (a.u.di4.mode != b.u.di4.mode)
+ return 0;
+
+ if (a.u.di4.mode == DI_MODE_4)
+ return (a.u.di4.short_ino == b.u.di4.short_ino
+ && a.u.di4.mapped_dev == b.u.di4.mapped_dev);
+
+ if (a.u.di8.mode == DI_MODE_8)
+ return (a.u.di8.short_ino == b.u.di8.short_ino
+ && a.u.di8.mapped_dev == b.u.di8.mapped_dev);
+
+ return (a.u.full.ino == b.u.full.ino
+ && a.u.full.dev == b.u.full.dev);
+}
+
+int
+main ()
+{
+ if (di_ent_equal ((void *) 0x80143c4d, (void *) 0x80173851) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44807.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44807.c
new file mode 100644
index 000000000..aa24a4c32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44807.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+
+struct jobstats
+{
+ int j_jobslots;
+};
+struct jobstats js;
+int *jobs;
+
+typedef int sh_job_map_func_t (int *, int, int, int);
+
+static void
+map_over_jobs (sh_job_map_func_t func)
+{
+ int i;
+ int set, oset;
+ if (js.j_jobslots)
+ return;
+ sigemptyset (&set);
+ sigaddset (set, 17);
+ sigemptyset (&oset);
+ sigprocmask (0, set, oset);
+ for (i = 0; js.j_jobslots; i++)
+ if (jobs[i])
+ func (jobs, 0, 0, 0);
+ sigprocmask (oset, ((void *) 0));
+}
+
+int
+print_job (int *job, int format, int state, int job_index)
+{
+ map_over_jobs (print_job);
+}
+
+void
+list_running_jobs (void)
+{
+ map_over_jobs (print_job);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44913.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44913.c
new file mode 100644
index 000000000..eef61fbfb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44913.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+void __attribute__((noinline,noclone))
+foo (int *a, int n)
+{
+ int *lasta = a + n;
+ for (; a != lasta; a++)
+ {
+ *a *= 2;
+ a[1] = a[-1] + a[-2];
+ }
+}
+extern void abort (void);
+int main()
+{
+ int a[16] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
+ int r[16] = { 1, 2, 6, 6, 16, 24, 44, 80, 136, 248, 432, 768, 1360, 2400, 4256, 3760 };
+ unsigned i;
+ foo (&a[2], 13);
+ for (i = 0; i < 8; ++i)
+ if (a[i] != r[i])
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44977.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44977.c
new file mode 100644
index 000000000..66fd7d1bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr44977.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+static unsigned short
+foo (unsigned short ui1, unsigned short ui2)
+{
+ return ui1 - ui2;
+}
+
+static unsigned short
+bar (unsigned ui1, unsigned short ui2)
+{
+ return ui1 + ui2;
+}
+
+struct S1
+{
+ const short f3;
+};
+int g_31;
+short g_67;
+struct S1 g_68[2][5][9][1][1] = {
+};
+
+int func_90 (int);
+
+int int329 (int * const *const int32p_81, short ** p_82)
+{
+ short l_169[8];
+ for (g_31 = 0; g_31 <= 0; g_31 = foo (g_31, 1))
+ {
+ short l_85;
+lbl_89:g_67 ^= l_85;
+ for (l_85 = 0; l_85 >= 0; l_85 = bar)
+ if (g_31)
+ goto lbl_89;
+ func_90 (1), g_68[0][2][2][0][0].f3, 0;
+ }
+ return l_169[6];
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45017.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45017.c
new file mode 100644
index 000000000..f2e02bcea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45017.c
@@ -0,0 +1,24 @@
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+
+int tester(char *bytes)
+{
+ union {
+ struct {
+ unsigned int r1:4;
+ unsigned int r2:4;
+ } fmt;
+ char value[1];
+ } ovl;
+
+ ovl.value[0] = bytes[0];
+ return ovl.fmt.r1;
+}
+extern void abort (void);
+int main()
+{
+ char buff = 0x2f;
+ if (tester(&buff) != 0x0f)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45623.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45623.c
new file mode 100644
index 000000000..693a8c4c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45623.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+#include <stdint.h>
+
+extern void abort (void);
+
+char *s1 = "foo";
+char *s2 = "bar";
+
+char **ss1 = &s1;
+
+typedef union jsval_layout
+{
+ uint64_t asBits;
+ char **ptr;
+} jsval_layout;
+
+int main()
+{
+ jsval_layout l, m;
+ l.ptr = ss1;
+ m.asBits = l.asBits;
+ char ** data = m.ptr;
+ *data = s2;
+ if (s1 != s2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45636.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45636.c
new file mode 100644
index 000000000..0566de86e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45636.c
@@ -0,0 +1,77 @@
+/* { dg-do run } */
+/* { dg-require-effective-target mempcpy } */
+/* PR fortran/45636 */
+
+typedef __SIZE_TYPE__ size_t;
+void *memcpy (void *__restrict__, const void *__restrict__, size_t);
+void *mempcpy (void *__restrict__, const void *__restrict__, size_t);
+void *memset (void *, int, size_t);
+int memcmp (const void *, const void *, size_t);
+extern void abort (void);
+
+struct A { int i; char c[32]; } a[2];
+
+__attribute__((noinline, noclone)) int
+f1 (char *p, int q, int z)
+{
+ memcpy (p, "abcd", 4);
+ if (q)
+ z = z + 123;
+ else
+ z *= 114;
+ memset (p + 4, ' ', 2);
+ return z;
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ char *p = mempcpy (&a[0].c[13], "123456", 4);
+ memset (p, '7', 3);
+}
+
+__attribute__((noinline, noclone)) void
+f3 (struct A *p)
+{
+ p++;
+ char *q = &p->c[10];
+ memcpy (q + 4, "__1234567" + 2, 7);
+ memset (&p->c[21], '9', 3);
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ memcpy (&a[0].c[10], "0123456789", 10);
+ memset (&a[0].c[13], ' ', 3);
+}
+
+__attribute__((noinline, noclone)) void
+check (const char *p, const char *str, size_t size)
+{
+ const char *q;
+ for (q = (const char *) &a; q < p; q++)
+ if (*q)
+ abort ();
+ if (memcmp (p, str, size) != 0)
+ abort ();
+ for (q = p + size; q < (const char *) (&a[0] + 2); q++)
+ if (*q)
+ abort ();
+ memset (&a, '\0', sizeof a);
+}
+
+int
+main (void)
+{
+ if (f1 (&a[0].c[7], 1, 2) != 125)
+ abort ();
+ check (&a[0].c[7], "abcd ", 6);
+ f2 ();
+ check (&a[0].c[13], "1234777", 7);
+ f3 (&a[0]);
+ check (&a[1].c[14], "1234567999", 10);
+ f4 ();
+ check (&a[0].c[10], "012 6789", 10);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45678-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45678-1.c
new file mode 100644
index 000000000..9abc7fd75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45678-1.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-fno-common" { target { { hppa*-*-hpux* } && { ! lp64 } } } } */
+
+typedef float V __attribute__ ((vector_size (16)));
+V g;
+float d[4] = { 4, 3, 2, 1 };
+
+int
+main ()
+{
+ V e;
+ __builtin_memcpy (&e, &d, sizeof (d));
+ V f = { 5, 15, 25, 35 };
+ e = e * f;
+ g = e;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45678-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45678-2.c
new file mode 100644
index 000000000..037fc2a52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45678-2.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-fno-common" { target { { hppa*-*-hpux* } && { ! lp64 } } } } */
+
+typedef float V __attribute__ ((vector_size (16)));
+V g;
+
+int
+main ()
+{
+ float d[4] = { 4, 3, 2, 1 };
+ V e;
+ __builtin_memcpy (&e, &d, sizeof (d));
+ V f = { 5, 15, 25, 35 };
+ e = e * f;
+ g = e;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45704.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45704.c
new file mode 100644
index 000000000..51456cec4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45704.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+struct st {
+ int ptr;
+};
+
+int foo(struct st *st)
+{
+ int v = *(volatile int *)&st->ptr;
+ return v & 0xff;
+}
+
+/* { dg-final { scan-tree-dump-times "={v}" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45720.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45720.c
new file mode 100644
index 000000000..9de8d1117
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45720.c
@@ -0,0 +1,50 @@
+/* { dg-do run } */
+/* { dg-options "-ftree-vectorize" } */
+
+float val[256];
+float x;
+void __attribute__((noinline,noclone))
+foo(int len, int beg)
+{
+ int i;
+ for (i = len - 1; i >= beg; --i)
+ x += val[i] * 2;
+}
+void __attribute__((noinline,noclone))
+bar(void)
+{
+ int i;
+ for (i = 255; i >= 0; --i)
+ x += val[i] * 2;
+ for (i = 254; i >= 0; --i)
+ x += val[i] * 2;
+ for (i = 253; i >= 0; --i)
+ x += val[i] * 2;
+ for (i = 252; i >= 0; --i)
+ x += val[i] * 2;
+}
+float y[256];
+void __attribute__((noinline,noclone))
+foobar(void)
+{
+ int i;
+ for (i = 0; i < 252; ++i)
+ {
+ float l = 0;
+ l += val[255 - i] * 2;
+ l += val[254 - i] * 2;
+ l += val[253 - i] * 2;
+ l += val[252 - i] * 2;
+ y[i] = l;
+ }
+}
+int main()
+{
+ foo(256-1, 0);
+ foo(256-2, 0);
+ foo(256-3, 0);
+ foo(256-4, 0);
+ bar();
+ foobar();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45732.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45732.c
new file mode 100644
index 000000000..04ceaa279
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45732.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+typedef char chars[5];
+const chars bad_chars[] = { "" };
+
+int foo ()
+{
+ const chars *c = bad_chars;
+ return c[0][0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45764.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45764.c
new file mode 100644
index 000000000..ac8c075db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45764.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-skip-if "Too much RAM needed" { "avr-*-*" } { "*" } { "" } } */
+
+int result[64][16];
+
+int main()
+{
+ double dbuf[1000] = {0.0};
+ int ibuf[900];
+ int i, j;
+
+ double d1 = 0.0;
+ double d2 = 0.0;
+ for (i = 0; i < 900; ++i) {
+ ibuf[i] = (int)(d2 - d1);
+ d1 += dbuf[i];
+ d2 += dbuf[i + 64];
+ }
+
+ for (i = 0; i < 64; ++i) {
+ for (j = 0; j < 8; ++j) {
+ result[i][ j] = ibuf[64 - i + 64 * j];
+ result[i][15 - j] = ibuf[ i + 64 * j];
+ }
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45830.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45830.c
new file mode 100644
index 000000000..fe6294bb7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45830.c
@@ -0,0 +1,99 @@
+/* PR tree-optimization/45830 */
+/* { dg-do run } */
+/* { dg-additional-options "-fno-tree-switch-conversion" { target avr-*-* } } */
+
+extern void abort (void);
+
+long long va, vb, vc, vd, ve;
+
+__attribute__((noinline)) int
+foo (int x)
+{
+ long long a, b, c, d, e;
+ switch (x)
+ {
+ case 0:
+ case 3:
+ case 1:
+ case 2:
+ case 4:
+ a = 1;
+ b = 129;
+ c = -12;
+ d = -4;
+ e = 128;
+ break;
+ case 23:
+ case 26:
+ case 19:
+ case 65:
+ case 5:
+ a = 2;
+ b = 138;
+ c = 115;
+ d = 128;
+ e = -16;
+ break;
+ case 21:
+ case 20:
+ case 22:
+ case 38:
+ case 27:
+ case 66:
+ case 45:
+ case 47:
+ a = 3;
+ b = 6;
+ c = 127;
+ d = 25;
+ e = 257;
+ break;
+ default:
+ a = 0;
+ b = 18;
+ c = 0;
+ d = 64;
+ e = 32768L;
+ break;
+ }
+ va = a;
+ vb = b;
+ vc = c;
+ vd = d;
+ ve = e;
+}
+
+int
+bar (int x)
+{
+ if (x < 0)
+ return 3;
+ if (x < 5)
+ return 0;
+ if (x == 5 || x == 19 || x == 23 | x == 26 || x == 65)
+ return 1;
+ if ((x >= 20 && x <= 22) || x == 27 || x == 38
+ || x == 45 || x == 47 || x == 66)
+ return 2;
+ return 3;
+}
+
+long long expected[] =
+{ 1, 129, -12, -4, 128, 2, 138, 115, 128, -16,
+ 3, 6, 127, 25, 257, 0, 18, 0, 64, 32768L };
+
+int
+main (void)
+{
+ int i, v;
+ for (i = -4; i < 70; i++)
+ {
+ foo (i);
+ v = bar (i);
+ if (va != expected[5 * v] || vb != expected[5 * v + 1]
+ || vc != expected[5 * v + 2] || vd != expected[5 * v + 3]
+ || ve != expected[5 * v + 4])
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45860.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45860.c
new file mode 100644
index 000000000..4a48bc559
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45860.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+void
+foo (char *str, int i)
+{
+ static const char text[] = "";
+ str[i] = 0;
+ if (i & 1)
+ __builtin_strcpy (str + i, text);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45865.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45865.c
new file mode 100644
index 000000000..f2e31dbab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45865.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+
+typedef struct rtx_def *rtx;
+enum machine_mode {
+ VOIDmode,
+ CCFPmode,
+ CCFPUmode,
+ MAX_MACHINE_MODE
+};
+enum mode_class {
+ MODE_CC,
+ MODE_FLOAT,
+ MODE_COMPLEX_FLOAT,
+ MODE_VECTOR_FLOAT
+};
+extern const enum mode_class mode_class[(int) MAX_MACHINE_MODE];
+enum rtx_code {
+ UNKNOWN,
+ GEU,
+ ORDERED,
+ CONST_INT
+};
+struct rtx_def {
+ unsigned int code: 16;
+ unsigned int mode : 8;
+};
+extern enum rtx_code reverse_condition (enum rtx_code);
+enum rtx_code
+reversed_comparison_code_parts (enum rtx_code code, rtx insn, rtx arg0,
+ rtx arg1)
+{
+ enum machine_mode mode;
+ mode = (enum machine_mode) (arg0)->mode;
+ if (mode == VOIDmode)
+ mode = (enum machine_mode) (arg1)->mode;
+ if ((mode_class[(int) (mode)]) == MODE_CC)
+ return (mode != CCFPmode && mode != CCFPUmode
+ ? reverse_condition (code)
+ : reverse_condition_maybe_unordered (code));
+ switch (code)
+ {
+ case GEU:
+ return reverse_condition (code);
+ case ORDERED:
+ return UNKNOWN;
+ }
+ if (((enum rtx_code) (arg0)->code) == CONST_INT
+ || (((enum machine_mode) (arg0)->mode) != VOIDmode
+ && ! ((mode_class[(int) (mode)]) == MODE_FLOAT
+ || (mode_class[(int) (mode)]) == MODE_COMPLEX_FLOAT
+ || (mode_class[(int) (mode)]) == MODE_VECTOR_FLOAT)))
+ return reverse_condition (code);
+ return UNKNOWN;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45869.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45869.c
new file mode 100644
index 000000000..e01977bf9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45869.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+char *
+foo (unsigned int count, void **list)
+{
+ char *minaddr = (char *) list[0];
+ unsigned int i; /* NOTE: change of type to "int" eliminates the ICE */
+ for (i = 1; i < count; i++)
+ {
+ char *addr = (char *) list[i];
+ if (addr < minaddr)
+ minaddr = addr;
+ }
+ return minaddr;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967-2.c
new file mode 100644
index 000000000..6959fd5e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967-2.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+extern void abort (void);
+int b;
+void
+foo (void *p_, int *q)
+{
+ int *p;
+ int i;
+ for (i = 0; i < sizeof(int *); ++i)
+ ((char *)&p)[i] = ((char *)p_)[i];
+ if (b)
+ p = q;
+ *p = 1;
+}
+int main()
+{
+ int i = 0, j;
+ int *p = &i;
+ foo (&p, &j);
+ if (i != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967-3.c
new file mode 100644
index 000000000..1a23a773b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967-3.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+
+extern void abort (void);
+void
+foo (void *p_)
+{
+ int *p;
+ int i;
+ for (i = 0; i < sizeof(int *); ++i)
+ ((char *)&p)[i] = ((char *)p_)[i];
+ *p = 1;
+}
+int main()
+{
+ int i = 0;
+ int *p = &i;
+ foo (&p);
+ if (i != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c
new file mode 100644
index 000000000..0a5b206e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45967.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+
+extern void abort (void);
+void __attribute__((noinline,noclone))
+foo (void *p_)
+{
+ int *p;
+ int i;
+ for (i = 0; i < sizeof(int *); ++i)
+ ((char *)&p)[i] = ((char *)p_)[i];
+ *p = 1;
+}
+int main()
+{
+ int i = 0;
+ int *p = &i;
+ foo (&p);
+ if (i != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45982.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45982.c
new file mode 100644
index 000000000..4aea6a8d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr45982.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+#include <stdint.h>
+
+extern void abort (void);
+
+uintptr_t __attribute__((pure,noinline,noclone))
+foo (int *a)
+{
+ return (uintptr_t) a;
+}
+
+void __attribute__((noinline,noclone))
+bar (uintptr_t a)
+{
+ int *p = (int *)a;
+ *p = 1;
+}
+
+int main()
+{
+ int t = 0;
+ bar (foo (&t));
+ if (t != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46068.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46068.c
new file mode 100644
index 000000000..120119ce8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46068.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+void
+foo ()
+{
+ asm goto (""::::l1);
+ __builtin_unreachable ();
+l1:;
+}
+
+void
+bar ()
+{
+ foo ();
+ foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46172.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46172.c
new file mode 100644
index 000000000..c8d1b4759
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46172.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-dce -ftree-vectorize" } */
+
+extern short X[];
+
+int foo (int len)
+{
+ int i;
+ int s = 0;
+ for (i = 0; i < len; i++)
+ s += X[i] * X[i];
+ return s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46183.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46183.c
new file mode 100644
index 000000000..9582c34e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46183.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-dse" } */
+
+void bar(void);
+
+void foo (int i, ...)
+{
+ __builtin_va_list ap;
+ __builtin_va_start (ap, i);
+ __builtin_va_arg (ap, int);
+ while (i) i++;
+ __builtin_va_arg (ap, int);
+ while (i) i++;
+ __builtin_va_arg (ap, int);
+ while (i) i++;
+ __builtin_va_arg (ap, int);
+ if (i)
+ bar ();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46216.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46216.c
new file mode 100644
index 000000000..b257dbf2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46216.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+typedef int Embryo_Cell;
+int
+embryo_program_run(Embryo_Cell *cip)
+{
+ unsigned char op;
+ Embryo_Cell offs;
+ static const void *switchtable[256] = {
+ &&SWITCHTABLE_EMBRYO_OP_NONE, &&SWITCHTABLE_EMBRYO_OP_LOAD_PRI
+ };
+ for (;;)
+ {
+ op = *cip++;
+ while (1) {
+ goto *switchtable[op];
+SWITCHTABLE_EMBRYO_OP_LOAD_PRI:
+ offs = *(Embryo_Cell *)cip++;
+SWITCHTABLE_EMBRYO_OP_NONE:
+ break;
+ };
+ }
+ return offs;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46398.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46398.c
new file mode 100644
index 000000000..9110bbbbe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46398.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+int __attribute__((noinline))
+test (int token)
+{
+ int done = 0;
+ int virtual_p = 0;
+ while (!done)
+ {
+ if (token == 42)
+ virtual_p = 1;
+ else
+ done = 1;
+ }
+ return virtual_p;
+}
+extern void abort (void);
+int
+main()
+{
+ if (test (0) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46723.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46723.c
new file mode 100644
index 000000000..40c6e8cd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr46723.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+short *m;
+void test()
+{
+ short x = 128;
+ unsigned int i;
+ for (i = 0; i < 128; ++i, x = (unsigned short)x + 1)
+ m[i] = x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47228.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47228.c
new file mode 100644
index 000000000..4ee7cab4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47228.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+struct S4
+{
+ unsigned f0:24;
+} __attribute__((__packed__));
+
+struct S4 g_10 = {
+ 6210831
+};
+
+struct S4 func_2 (int x)
+{
+ struct S4 l_8[2] = {
+ {0}, {0}
+ };
+ g_10 = l_8[1];
+ for (; x<2; x++) {
+ struct S4 tmp = {
+ 11936567
+ };
+ l_8[x] = tmp;
+ }
+ return g_10;
+}
+
+int main (void)
+{
+ func_2 (0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47278-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47278-1.c
new file mode 100644
index 000000000..f97906c61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47278-1.c
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-visibility "" } */
+/* { dg-additional-sources "pr47278-2.c" } */
+
+int foo (void) { return 1; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47278-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47278-2.c
new file mode 100644
index 000000000..0c700d196
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47278-2.c
@@ -0,0 +1,15 @@
+/* { dg-require-visibility "" } */
+
+extern void abort (void);
+
+int __attribute__((weak,visibility("hidden"))) foo (void)
+{
+ return 0;
+}
+
+int main()
+{
+ if (foo() != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47281.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47281.c
new file mode 100644
index 000000000..517e8548e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47281.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+struct T;
+typedef void F(void);
+
+F* aux(void (*x)())
+{
+ return x;
+}
+
+void make_mess (int);
+
+F*
+get_funloc (void (*x)(int), F* (*y)())
+{
+ return y(x);
+}
+
+F*
+foo ()
+{
+ return get_funloc (make_mess, aux);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47364-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47364-1.c
new file mode 100644
index 000000000..3ac699974
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47364-1.c
@@ -0,0 +1,8 @@
+/* { dg-do run } */
+
+char one[50] = "ijk";
+int
+main (void)
+{
+ return __builtin_strlen (one) != 3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47365.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47365.c
new file mode 100644
index 000000000..e3bc55011
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47365.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+
+struct A
+{
+ int i;
+};
+
+struct B
+{
+ struct A a[2];
+};
+
+int i = 1;
+struct B b = { 0, 3 };
+
+static void
+test ()
+{
+ if (b.a[0].i != i)
+ {
+ int t = b.a[0].i;
+ b.a[0] = b.a[1];
+ b.a[1].i = t;
+ }
+
+ if (b.a[1].i == i)
+ __builtin_abort ();
+
+ if (b.a[0].i == 0)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ test ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47370.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47370.c
new file mode 100644
index 000000000..ff71f0964
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47370.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+struct S { int s; };
+
+void
+foo (void)
+{
+ for (;;)
+ ;
+}
+
+struct S
+bar (void)
+{
+ struct S s = { 99 };
+ return s;
+}
+
+void
+baz (int i)
+{
+ struct S s[1];
+ s[0] = bar ();
+ bar ();
+ foo ();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47383.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47383.c
new file mode 100644
index 000000000..ae8d67051
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47383.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+
+static int heap[2*(256 +1+29)+1];
+static int heap_len;
+static int heap_max;
+void
+__attribute__ ((noinline))
+foo (int elems)
+{
+ int n, m;
+ int max_code = -1;
+ int node = elems;
+ heap_len = 0, heap_max = (2*(256 +1+29)+1);
+ for (n = 0; n < elems; n++)
+ heap[++heap_len] = max_code = n;
+ do {
+ n = heap[1];
+ heap[1] = heap[heap_len--];
+ m = heap[1];
+ heap[--heap_max] = n;
+ heap[--heap_max] = m;
+ } while (heap_len >= 2);
+}
+
+int
+main ()
+{
+ foo (286);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47411.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47411.c
new file mode 100644
index 000000000..d3c10d331
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47411.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+
+typedef long unsigned int size_t;
+
+static __inline void *
+__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
+{
+ return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
+}
+
+extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+
+struct htab { void ** entries; };
+
+typedef struct htab *htab_t;
+
+extern void ** htab_find_slot (htab_t, const void *);
+
+enum mode_class { MODE_RANDOM, MODE_CC, MODE_INT, MAX_MODE_CLASS };
+
+struct mode_data
+{
+ struct mode_data *next;
+ enum mode_class cl;
+};
+
+static const struct mode_data blank_mode = { 0, MAX_MODE_CLASS };
+
+static htab_t modes_by_name;
+
+struct mode_data *
+new_mode (void)
+{
+ struct mode_data *m
+ = ((struct mode_data *) xmalloc (sizeof (struct mode_data)));
+
+ ((__builtin_object_size (m, 0) != (size_t) -1) ? __builtin___memcpy_chk (m, &blank_mode, sizeof (struct mode_data), __builtin_object_size (m, 0)) : __inline_memcpy_chk (m, &blank_mode, sizeof (struct mode_data)));
+
+ *htab_find_slot (modes_by_name, m) = m;
+
+ return m;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47426-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47426-1.c
new file mode 100644
index 000000000..47dcff913
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47426-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-fipa-pta" } */
+/* { dg-additional-sources "pr47426-2.c" } */
+
+void bar (int *i);
+
+static void
+foo (int *i)
+{
+ if (*i)
+ bar (i);
+ if (*i)
+ __builtin_abort();
+}
+
+typedef void tfoo (int *);
+
+tfoo *
+getfoo (void)
+{
+ return &foo;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47426-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47426-2.c
new file mode 100644
index 000000000..a22e902bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47426-2.c
@@ -0,0 +1,19 @@
+typedef void tfoo (int *);
+tfoo *getfoo (void);
+
+void
+bar (int *i)
+{
+ (*i)--;
+}
+
+int
+main ()
+{
+ int i = 1;
+ getfoo ()(&i);
+ if (i)
+ __builtin_abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47473.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47473.c
new file mode 100644
index 000000000..92f2b872e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47473.c
@@ -0,0 +1,14 @@
+/* PR c/47473 */
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+int
+main (void)
+{
+ long double _Complex w = 0.2L - 0.3iL;
+ w = w * (0.3L - (0.0F + 1.0iF) * 0.9L);
+ if (__builtin_fabsl (__real__ w + 0.21L) > 0.001L
+ || __builtin_fabsl (__imag__ w + 0.27L) > 0.001L)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47621.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47621.c
new file mode 100644
index 000000000..882e67f08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47621.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int
+main (void)
+{
+ int data = 1;
+ struct ptr { int val; } *ptr = (struct ptr *) &data;
+ ptr->val = 0;
+ if (data != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47677.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47677.c
new file mode 100644
index 000000000..bd9077863
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47677.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+
+struct S { int s; int u; };
+extern int bar (void);
+extern struct S *baz (void);
+
+void
+foo (int x, struct S *y, char z, int *v, struct S *s)
+{
+ int c, d;
+ if (x & 2)
+ d = 1;
+ else
+ {
+ d = (x & 1) ? 11 : 0;
+ while ((c = (s->s != (s->u & 1) ? s->s : bar ())) != '\0');
+ c = (s->s != '\\' && (s->u & 4) ? s->s : bar ());
+ if (c == '<')
+ goto lab;
+ }
+ while ((c = ((s->u & 1) ? s->s : bar ())) != 0
+ && ((d != 11 && d != 17) || (v[c] & 1) == 0))
+ {
+ lab:;
+ switch (d)
+ {
+ case 14:
+ if (c == '}')
+ y = baz ();
+ d = y->s = z == '<' ? 17 : 11;
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47725.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47725.c
new file mode 100644
index 000000000..03d5d36c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47725.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+struct _Unwind_Context
+{
+ void *reg[17];
+ void *ra;
+};
+extern void bar (struct _Unwind_Context *);
+void
+__frame_state_for (void *pc_target)
+{
+ struct _Unwind_Context context;
+ __builtin_memset (&context, 0, sizeof (struct _Unwind_Context));
+ context.ra = pc_target;
+ bar (&context);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47743.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47743.c
new file mode 100644
index 000000000..1930e94d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47743.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+int
+foo (void *x, int y)
+{
+ long long a = 1, *b;
+ double *c;
+ if (y)
+ {
+ b = (long long *) x;
+ while (b)
+ a *= *b++;
+ }
+ else
+ {
+ c = (double *) x;
+ while (c)
+ a *= *c++;
+ }
+ return a;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-1.c
new file mode 100644
index 000000000..0f7efa9f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fpic" { target fpic } } */
+
+typedef int int32_t;
+static const int init_jk[] = {2,3,4,6};
+ int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, const int32_t *ipio2)
+{
+ int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
+ double z,fw,f[20],fq[20],q[20];
+ jk = init_jk[prec];
+ jp = jk;
+ jx = nx-1;
+ for (i=0;i<=jk;i++) {
+ for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+ }
+ for(i=0,j=jz,z=q[jz];j>0;i++,j--) {
+ z = q[j-1]+fw;
+ }
+ n = (int32_t) z;
+ return n&7;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-2.c
new file mode 100644
index 000000000..82f6151cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-2.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-std=gnu99" } */
+
+typedef long unsigned int size_t;
+typedef long int ssize_t;
+typedef ssize_t index_type;
+typedef __int128_t GFC_INTEGER_16;
+typedef struct descriptor_dimension
+{
+ index_type _stride;
+ index_type _lbound;
+ index_type _ubound;
+}
+descriptor_dimension;
+typedef struct { GFC_INTEGER_16 *data; size_t offset; index_type dtype; descriptor_dimension dim[7];} gfc_array_i16;
+void
+matmul_i16 (gfc_array_i16 * const restrict retarray,
+ gfc_array_i16 * const restrict a,
+ GFC_INTEGER_16 bbase_yn)
+{
+ GFC_INTEGER_16 * restrict dest;
+ index_type rxstride, rystride;
+ index_type x, y, n, count, xcount;
+ GFC_INTEGER_16 * restrict dest_y;
+ GFC_INTEGER_16 s;
+ const GFC_INTEGER_16 * restrict abase_n;
+ rxstride = ((retarray)->dim[0]._stride);
+ rystride = ((retarray)->dim[1]._stride);
+ xcount = ((a)->dim[0]._ubound + 1 - (a)->dim[0]._lbound);
+ dest = retarray->data;
+ dest_y = &dest[y*rystride];
+ for (x = 0; x < xcount; x++)
+ dest_y[x] += abase_n[x] * bbase_yn;
+ for (x = 0; x < xcount; x++)
+ {
+ for (n = 0; n < count; n++)
+ dest_y[x*rxstride] = (GFC_INTEGER_16) 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-3.c
new file mode 100644
index 000000000..5a5dd33e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47744-3.c
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+
+typedef union rtunion_def {
+ struct rtx_def *rtx;
+} rtunion;
+typedef struct rtx_def {
+ unsigned short code;
+ rtunion fld[1];
+} *rtx;
+extern rtx recog_operand[];
+extern rtx *recog_operand_loc[];
+extern int reload_n_operands;
+extern void find_dummy_reload (int, int);
+extern int asm_noperands (rtx);
+extern int n_occurrences (char **);
+char operands_match[10][10];
+void find_reloads (rtx insn, int n_alternatives, int commutative)
+{
+ register int i, j;
+ int noperands;
+ char *constraints[10];
+ int address_reloaded[10];
+ int this_alternative[10];
+ char this_alternative_win[10];
+ int this_alternative_matches[10];
+ int this_alternative_number;
+ rtx body = ((insn)->fld[3].rtx);
+ int operand_mode[10];
+ if (body->code == 1)
+ {
+ reload_n_operands = noperands = asm_noperands (body);
+ n_alternatives = n_occurrences (constraints);
+ }
+ for (this_alternative_number = 0;
+ this_alternative_number < n_alternatives;
+ this_alternative_number++)
+ for (i = 0;
+ i < noperands;
+ i++)
+ {
+ register char *p = constraints[i];
+ register int win = 0;
+ int badop = 1;
+ int c;
+ register rtx operand = recog_operand[i];
+ int force_reload = 0;
+ this_alternative_win[i] = 0;
+ this_alternative[i] = 1;
+ while (*p && (c = *p++) != ',')
+ switch (c)
+ {
+ case '4':
+ c -= '0';
+ this_alternative_matches[i] = c;
+ if ((c != commutative
+ || i != commutative + 1)
+ && operands_match[c][i])
+ win = this_alternative_win[c];
+ else
+ find_dummy_reload (operand_mode[i], this_alternative[c]);
+ if (! win || force_reload)
+ for (j = 0; j < i; j++)
+ if (this_alternative_matches[j]
+ == this_alternative_matches[i])
+ badop = 1;
+ break;
+ case '<':
+ if (operand->code == 2
+ && ! address_reloaded[i]
+ && operand->fld[0].rtx->code == 3)
+ win = 1;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47890.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47890.c
new file mode 100644
index 000000000..83cb5e6d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47890.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void f(char *s)
+{
+ signed short i;
+
+ for (i = 0; i < 19; i = i + 1)
+ s[i] = i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47917.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47917.c
new file mode 100644
index 000000000..f89d44987
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47917.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+/* { dg-options "-std=c99 -D_XOPEN_SOURCE=500" { target *-*-solaris2.9 } } */
+/* { dg-options "-std=gnu99" { target *-*-hpux* } } */
+/* { dg-additional-options "-D__USE_MINGW_ANSI_STDIO=1" { target *-*-mingw* } } */
+/* { dg-xfail-run-if "no C99 snprintf function" { *-*-hpux10* } } */
+/* { dg-xfail-run-if "non-conforming C99 snprintf" { *-*-hpux11.[012]* } } */
+
+/* PR middle-end/47917 */
+
+#include <stdio.h>
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+extern void abort (void);
+
+char buf1[6], buf2[6], buf3[4], buf4[4];
+int i;
+
+int
+foo (void)
+{
+ int ret = snprintf (buf1, sizeof buf1, "abcde");
+ ret += snprintf (buf2, sizeof buf2, "abcdef") * 16;
+ ret += snprintf (buf3, sizeof buf3, "%s", i++ < 6 ? "abc" : "def") * 256;
+ ret += snprintf (buf4, sizeof buf4, "%s", i++ > 10 ? "abcde" : "defgh") * 4096;
+ return ret;
+}
+
+int
+main (void)
+{
+ if (foo () != 5 + 6 * 16 + 3 * 256 + 5 * 4096)
+ abort ();
+ if (memcmp (buf1, "abcde", 6) != 0
+ || memcmp (buf2, "abcde", 6) != 0
+ || memcmp (buf3, "abc", 4) != 0
+ || memcmp (buf4, "def", 4) != 0
+ || i != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47958-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47958-1.c
new file mode 100644
index 000000000..9fdf142fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47958-1.c
@@ -0,0 +1,13 @@
+/* { dg-do assemble } */
+
+void (*foo[6][6]) (int);
+void bar (hdR)
+ int hdR;
+{ }
+void xxx ()
+{
+ unsigned int i, j;
+ for (i = 0; i < 6; ++i)
+ for (j = 0; j < 6; ++j)
+ foo [i][j] = bar;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47968.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47968.c
new file mode 100644
index 000000000..4f33cf1f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47968.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-w -Wno-psabi" } */
+
+typedef __attribute__ ((vector_size (16))) float float4;
+typedef __attribute__ ((vector_size (16))) double double2;
+
+float foo (double2 d2)
+{
+ float4 f4 = (float4) d2;
+ return *(float *) &f4;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47975.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47975.c
new file mode 100644
index 000000000..e2a72af49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr47975.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-common" { target { hppa*-*-hpux* } } } */
+
+int __attribute__ ((vector_size (32))) x;
+
+void
+foo (void)
+{
+ x <<= x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48044.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48044.c
new file mode 100644
index 000000000..d20a634a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48044.c
@@ -0,0 +1,11 @@
+/* PR middle-end/48044 */
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+
+#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x) #x
+
+int a __asm__ (ASMNAME ("b")) = 0;
+extern int c __asm__ (ASMNAME ("a")) __attribute__ ((alias ("b")));
+extern int d __attribute__ ((weak, alias ("a")));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48063.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48063.c
new file mode 100644
index 000000000..d861bf04c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48063.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/48063 */
+/* { dg-do compile } */
+/* { dg-options "-fno-early-inlining" } */
+
+extern void abort (void);
+static void bar ();
+
+void
+foo ()
+{
+ bar (1);
+}
+
+static void
+bar (double i)
+{
+ if (i)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48098.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48098.c
new file mode 100644
index 000000000..cd7293937
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48098.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+void
+foo (int n)
+{
+ static char *__restrict *p;
+ int i;
+ p = __builtin_malloc (n);
+ for (i = 0; i < n; i++)
+ p[i] = 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-1.c
new file mode 100644
index 000000000..a0c73bf59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-1.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-fno-toplevel-reorder" } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort (void);
+
+struct S
+{
+ signed a : 26;
+ signed b : 16;
+ signed c : 10;
+ volatile signed d : 14;
+};
+
+static struct S e = { 0, 0, 0, 1 };
+static int f = 1;
+
+void __attribute__((noinline))
+foo (void)
+{
+ e.d = 0;
+ f = 2;
+}
+
+int
+main ()
+{
+ if (e.a || e.b || e.c || e.d != 1 || f != 1)
+ abort ();
+ foo ();
+ if (e.a || e.b || e.c || e.d || f != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-2.c
new file mode 100644
index 000000000..485d8d4b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-2.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+static volatile struct S0 {
+ short f3[9];
+ unsigned f8 : 15;
+} s = {1};
+static unsigned short sh = 0x1234;
+
+struct S0 a, b;
+int vi = 0;
+
+void func_4()
+{
+ s.f8 |= 1;
+ sh = 15;
+ if (vi) a = b;
+}
+
+int main()
+{
+ func_4();
+ if (sh != 15)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-3.c
new file mode 100644
index 000000000..386d88bd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-3.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct S1
+{
+ int f0;
+ int:1;
+ int f3;
+ int:1;
+ int:0;
+ int f6:1;
+};
+int g_13 = 1;
+volatile struct S1 g_118 = {
+ 1
+};
+
+void __attribute__((noinline))
+func_46 ()
+{
+ for (g_13 = 0; g_13 >= 0; g_13 -= 1)
+ g_118.f6 = 0;
+}
+
+int
+main ()
+{
+ func_46 ();
+ if (g_13 != -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-4.c
new file mode 100644
index 000000000..fe9f97efc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48124-4.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort (void);
+struct S1 {
+ unsigned f0, f1;
+ unsigned short f2, f3;
+ unsigned f4 : 16;
+ unsigned f5, f6;
+ volatile unsigned f7 : 28;
+};
+static struct S1 g_76;
+static struct S1 g_245 = {0,0,0,0,0,0,0,1};
+static signed char g_323 = 0x80;
+static void func_1(void)
+{
+ g_245.f7 &= 1;
+ for (g_323 = 0; g_323 <= -1; g_323 -= 2) {
+ g_76 = g_76;
+ g_76.f4 ^= 11;
+ }
+}
+int main()
+{
+ func_1();
+ if (g_323 != 0 || g_245.f7 != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48146.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48146.c
new file mode 100644
index 000000000..c04903528
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48146.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+static unsigned char
+safe_sub_func_int_s_s (int si1, unsigned char si2)
+{
+ return si1 ^ si2 & -si2 ^ si2 ? : si1 - si2;
+}
+
+int g_2[10] = {
+ 0x90AC204EL
+};
+
+volatile unsigned char g_39;
+
+unsigned char
+func_67 (unsigned short p_68)
+{
+ unsigned char l_92;
+ unsigned char l_74;
+ int *l = &g_2[6];
+lbl_90:*l ^= 1;
+ if (p_68)
+ goto lbl_93;
+ for (l_74 = 0;; l_74 = safe_sub_func_int_s_s (l_74, 1))
+ {
+ if (l_74)
+ goto lbl_90;
+lbl_93:l_92 ^= 0 != &g_39;
+ if (0)
+ {
+ }
+ else
+ *l = 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48343.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48343.c
new file mode 100644
index 000000000..e56b3a3da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48343.c
@@ -0,0 +1,19 @@
+/* PR debug/48343 */
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug" } */
+
+void foo (unsigned char *, unsigned char *);
+
+void
+test (unsigned int x, int y)
+{
+ unsigned int i, j = 0, k;
+ unsigned char s[256], t[64];
+ foo (s, t);
+ t[0] = y;
+ for (i = 0; i < 256; i++)
+ {
+ j = (j + s[i] + t[i % x]) & 0xff;
+ k = i; i = j; j = k;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48493.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48493.c
new file mode 100644
index 000000000..ddb61f2e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48493.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+typedef long long T __attribute__((may_alias, aligned (1)));
+
+struct S
+{
+ _Complex float d __attribute__((aligned (8)));
+};
+
+void bar (struct S);
+
+void
+f1 (T x)
+{
+ struct S s;
+ *(T *) ((char *) &s.d + 1) = x;
+ bar (s);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48542.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48542.c
new file mode 100644
index 000000000..e3e49489f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48542.c
@@ -0,0 +1,57 @@
+/* { dg-do run } */
+/* The return-address was clobbered. */
+#include <stdlib.h>
+#include <setjmp.h>
+
+jmp_buf env;
+extern void sub(void);
+extern void sub3(void);
+int called;
+__attribute__ ((__noinline__))
+int sjtest()
+{
+ int i;
+ if (setjmp(env))
+ return 99;
+
+ for (i = 0; i < 10; i++)
+ sub();
+
+ longjmp(env, 1);
+}
+
+__attribute__ ((__noinline__))
+void sub(void)
+{
+ called++;
+}
+
+int called3;
+__attribute__ ((__noinline__))
+int sjtest3()
+{
+ int i;
+ if (setjmp(env))
+ return 42;
+
+ for (i = 0; i < 10; i++)
+ sub3();
+ return 0;
+}
+
+__attribute__ ((__noinline__))
+void sub3(void)
+{
+ called3++;
+ if (called3 == 10)
+ longjmp (env, 1);
+}
+
+int main(void)
+{
+ if (sjtest() != 99 || called != 10)
+ abort();
+ if (sjtest3() != 42 || called3 != 10)
+ abort();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48694-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48694-1.c
new file mode 100644
index 000000000..810366bc8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48694-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+extern volatile int g_89[5][9];
+extern int g, *gp;
+void func_64()
+{
+ int i;
+ for (i = 0; i < 1; )
+ {
+ for (g = 0; g < 1; )
+ return;
+ gp = (int *)&g_89[g][0];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48694-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48694-2.c
new file mode 100644
index 000000000..4791ac3f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48694-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+extern volatile int g_4[1][4];
+extern int g_7;
+void modify(int *);
+void func_2()
+{
+ int l_46 = 4;
+ if (g_7)
+ modify(&l_46);
+ else
+ {
+ int i;
+ for (i = 0; i != 5; i += 1)
+ {
+ volatile int *vp = &g_4[0][l_46];
+ *vp = 0;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48702.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48702.c
new file mode 100644
index 000000000..1ec371da8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48702.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+#define LEN 4
+
+static inline void unpack(int array[LEN])
+{
+ int ii, val;
+ val = 1;
+ for (ii = 0; ii < LEN; ii++) {
+ array[ii] = val % 2;
+ val = val / 2;
+ }
+}
+
+static inline int pack(int array[LEN])
+{
+ int ans, ii;
+ ans = 0;
+ for (ii = LEN-1; ii >= 0; ii--) {
+ ans = 2 * ans + array[ii];
+ }
+ return ans;
+}
+
+int __attribute__((noinline))
+foo()
+{
+ int temp, ans;
+ int array[LEN];
+ unpack(array);
+ temp = array[0];
+ array[0] = array[2];
+ array[2] = temp;
+ ans = pack(array);
+ return ans;
+}
+
+int main(void)
+{
+ int val;
+ val = foo();
+ if (val != 4)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48731.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48731.c
new file mode 100644
index 000000000..74b77f67c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48731.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+#include <stdarg.h>
+
+int blah(int a, ...)
+{
+ va_list va;
+ va_start(va,a);
+ if (a == 0)
+ return -1;
+ else
+ {
+ int i;
+ for (i = 0; i < a; i++)
+ va_arg(va,int);
+ return va_arg(va,int);
+ }
+}
+
+__attribute((flatten))
+int blah2(int b, int c)
+{
+ return blah(2, b, c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48822.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48822.c
new file mode 100644
index 000000000..b619f369b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48822.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+void foo (int *, int *);
+int bar ()
+{
+ int a = 0;
+ int b = 0;
+ if (b != 0)
+ {
+ int ax = a;
+ int bx = b;
+ while (bx != 0)
+ {
+ int tem = ax % bx;
+ ax = bx;
+ bx = tem;
+ }
+ }
+ foo (&a, &b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48953.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48953.c
new file mode 100644
index 000000000..41a3d7b80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr48953.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-dce" } */
+
+static inline int foo (int n, int k)
+{
+ struct S
+ {
+ int i[n];
+ int value;
+ } s[2];
+ return s[k].value = 0;
+}
+
+int main ()
+{
+ return foo (2, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49030.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49030.c
new file mode 100644
index 000000000..edd0c3629
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49030.c
@@ -0,0 +1,21 @@
+/* { dg-require-effective-target int32plus } */
+
+void
+sample_move_d32u24_sS (char *dst, float *src, unsigned long nsamples,
+ unsigned long dst_skip)
+{
+ long long y;
+ while (nsamples--)
+ {
+ y = (long long) (*src * 8388608.0f) << 8;
+ if (y > 2147483647) {
+ *(int *) dst = 2147483647;
+ } else if (y < -2147483647 - 1) {
+ *(int *) dst = -2147483647 - 1;
+ } else {
+ *(int *) dst = (int) y;
+ }
+ dst += dst_skip;
+ src++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49079.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49079.c
new file mode 100644
index 000000000..1b53d3c31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49079.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct Ustr
+{
+ unsigned char data[1];
+};
+
+static unsigned int
+ustr_xi__embed_val_get(const unsigned char *data)
+{
+ return (unsigned int)data[0];
+}
+
+int __attribute__((noinline)) zero(void) { return 0; }
+
+static unsigned int
+ustr_len(const struct Ustr *s1)
+{
+ return ustr_xi__embed_val_get(s1->data + 1 + zero());
+}
+
+int
+main()
+{
+ if (ustr_len (((struct Ustr *) "\x01" "\x0002" "s2")) != 2)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49169.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49169.c
new file mode 100644
index 000000000..c7800bb75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49169.c
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { arm*-*-* || mips*-*-* } } } */
+
+#include <stdlib.h>
+#include <stdint.h>
+
+int
+main (void)
+{
+ void *p = main;
+ if ((intptr_t) p & 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "abort" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49217.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49217.c
new file mode 100644
index 000000000..e8a89de8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49217.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-fno-early-inlining" } */
+
+extern void abort (void);
+int i;
+static void foo(void);
+void __attribute__((noinline))
+bar (void)
+{
+ if (!i)
+ foo ();
+}
+static void
+foo(void)
+{
+ i = 1;
+ bar ();
+}
+int main()
+{
+ i = 0;
+ bar();
+ if (i != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c
new file mode 100644
index 000000000..55761fd61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-aggressive-loop-optimizations" } */
+
+int a, b;
+struct S { unsigned int s, t, u; } c, d = { 0, 1, 0 };
+
+void
+test (unsigned char z)
+{
+ char e[] = {0, 0, 0, 0, 1};
+ for (c.s = 1; c.s; c.s++)
+ {
+ b = e[c.s];
+ if (a)
+ break;
+ b = z >= c.u;
+ if (d.t)
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49603.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49603.c
new file mode 100644
index 000000000..90f51e505
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49603.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+struct gl_visual {
+ float AlphaScale;
+};
+struct gl_context {
+ struct gl_visual *Visual;
+};
+void quickdraw_rgb( struct gl_context * ctx,
+ int width, int height)
+{
+ int i, j;
+ unsigned char alpha[1600];
+ for (j=0; j<width; j++)
+ alpha[j] = (int) ctx->Visual->AlphaScale;
+ for (i=0; i<height; i++)
+ foo( alpha);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49651.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49651.c
new file mode 100644
index 000000000..c58fe943c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49651.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct X {
+ int *p;
+ int *q;
+};
+
+void __attribute__((noinline, noclone))
+foo (struct X x) { *x.q = 0; }
+
+volatile int what;
+struct X y;
+
+int main()
+{
+ int i, j;
+ struct X x, *p;
+ x.p = &i;
+ x.q = &j;
+ if (what)
+ p = &y;
+ else
+ p = &x;
+ j = 1;
+ foo (*p);
+ if (j != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49958.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49958.c
new file mode 100644
index 000000000..de689bcde
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49958.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "-fstrict-overflow" } */
+
+extern void abort (void);
+int foo (int i, int j, int o, int m) { return i*o + 1 + j*m > 1; }
+int main()
+{
+ if (foo (- __INT_MAX__ - 1, -1, 1, 1))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49997.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49997.c
new file mode 100644
index 000000000..4ccc60473
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49997.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-finline-functions -fnon-call-exceptions" } */
+
+extern int g_78, g_223;
+static int MOD(int si1, int si2) {
+ return (!si2 || (!si1 && si2)) ? si1 : (si1 % 3);
+}
+void func_65(int p_66) {
+ g_78 = MOD(p_66, 3);
+}
+void func_54(int si1) {
+ func_65(0);
+ func_65(1);
+ func_65(2);
+ while (g_223) {
+ MOD(si1, 3);
+ func_65(3);
+ func_65(4);
+ func_65(5);
+ func_65(6);
+ func_65(7);
+ func_65(8);
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-1.c
new file mode 100644
index 000000000..8201ebfdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+
+/* Make sure data-dependence analysis does not compute a bogus
+ distance vector for the different sized accesses. */
+
+extern int memcmp(const void *, const void *, __SIZE_TYPE__);
+extern void abort (void);
+short a[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+short b[32] = { 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, };
+int main()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ int i;
+ if (sizeof (short) == 2)
+ {
+ for (i = 0; i < 32; ++i)
+ (*((unsigned short(*)[32])&a[0]))[i] = (*((char(*)[32])&a[0]))[i+8];
+ if (memcmp (&a, &b, sizeof (a)) != 0)
+ abort ();
+ }
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-2.c
new file mode 100644
index 000000000..f9728a766
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-2.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+
+/* Make sure data-dependence analysis does not compute a bogus
+ distance vector for the different sized accesses. */
+
+extern int memcmp(const void *, const void *, __SIZE_TYPE__);
+extern void abort (void);
+short a[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+short b[32] = { 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, };
+int main()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ int i;
+ if (sizeof (short) == 2)
+ {
+ for (i = 0; i < 32; ++i)
+ {
+ a[i] = (*((char(*)[32])&a[0]))[i+8];
+ }
+ if (memcmp (&a, &b, sizeof (a)) != 0)
+ abort ();
+ }
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-3.c
new file mode 100644
index 000000000..b774ea3f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-3.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-fpredictive-commoning" } */
+
+extern void abort (void);
+int a[6] = { 0, 0, 0, 0, 7, 0 };
+static int *p = &a[4];
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 4; ++i)
+ {
+ a[i + 1] = a[i + 2] > i;
+ *p &= ~1;
+ }
+ if (a[4] != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-4.c
new file mode 100644
index 000000000..1571d72f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-4.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+
+/* Verify we do not get a bogus access function with 0B vs. 1B which
+ disambiguates both accesses and leads to vectorization. */
+
+extern int memcmp(const void *, const void *, __SIZE_TYPE__);
+extern void abort (void);
+short a[33] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+short b[33] = { 0, };
+int main()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ int i;
+ if (sizeof (short) == 2)
+ {
+ for (i = 0; i < 64; ++i)
+ {
+ (*((char(*)[])&a[1]))[i] = (*((char(*)[])&a[0]))[i+1];
+ }
+ if (memcmp (&a, &b, sizeof (a)) != 0)
+ abort ();
+ }
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-5.c
new file mode 100644
index 000000000..13ed73fe4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50067-5.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+/* Verify we do not get a bogus access function pairs with
+ exchanged dimensions, 0, {1, +, 1}_1 vs. {2B, +, 1}_1, 0 which
+ disambiguates both accesses and leads to vectorization. */
+
+extern int memcmp(const void *, const void *, __SIZE_TYPE__);
+extern void abort (void);
+short a[33] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
+short b[33] = { 0, };
+char * volatile ap_ = (char *)&a[0];
+int main()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ int i;
+ char *ap = ap_;
+ if (sizeof (short) == 2)
+ {
+ for (i = 0; i < 64; ++i)
+ {
+ (*((char(*)[])&ap[i+2]))[0] = (*((char(*)[])&ap[0]))[i+1];
+ }
+ if (memcmp (&a, &b, sizeof (a)) != 0)
+ abort ();
+ }
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50092.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50092.c
new file mode 100644
index 000000000..c8a929b2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50092.c
@@ -0,0 +1,15 @@
+/* PR target/50092 */
+/* { dg-do compile { target lp64 } } */
+
+volatile int v;
+
+void bar (long double);
+void baz (_Complex long double *);
+
+void
+foo (void)
+{
+ _Complex long double w[100000000];
+ bar ((long double) v / 2147483648.0);
+ baz (w);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50222.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50222.c
new file mode 100644
index 000000000..f534d8960
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50222.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-funswitch-loops -ftree-loop-distribution" } */
+
+typedef struct AVProgram {
+ void *priv_data;
+ unsigned int nb_streams;
+} AVFormatContext;
+typedef struct {
+ unsigned short flags;
+ unsigned char stream_id;
+} FrameCode;
+typedef struct {
+ FrameCode frame_code[256];
+} NUTContext;
+void build_frame_code(AVFormatContext *s, int stream_id,
+ int is_audio, int pred_count)
+{
+ NUTContext *nut = s->priv_data;
+ int keyframe_0_esc = s->nb_streams > 2;
+ int start2 = 1 + 253*stream_id / s->nb_streams;
+ int key_frame;
+ for(key_frame=0; key_frame<2; key_frame++)
+ {
+ FrameCode *ft;
+ if (is_audio && keyframe_0_esc && key_frame==0)
+ continue;
+ ft= &nut->frame_code[start2];
+ ft->flags|= 3;
+ ft->stream_id= stream_id;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50287.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50287.c
new file mode 100644
index 000000000..1f61293a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50287.c
@@ -0,0 +1,109 @@
+/* { dg-do compile } */
+
+struct PMC {
+ unsigned flags;
+};
+
+struct PVC {
+ unsigned flags, other_stuff;
+};
+
+
+typedef struct Pcc_cell
+{
+ struct PMC *p;
+ long bla;
+ long type;
+} Pcc_cell;
+
+int gi;
+int cond;
+
+struct PVC g_pvc;
+
+extern void abort ();
+extern void never_ever(int interp, struct PMC *pmc)
+ __attribute__((noinline,noclone));
+
+void never_ever (int interp, struct PMC *pmc)
+{
+ abort ();
+}
+
+static void mark_cell(int * interp, Pcc_cell *c, struct PVC pvc)
+ __attribute__((__nonnull__(1)));
+
+static void
+mark_cell(int * interp, Pcc_cell *c, struct PVC pvc)
+{
+ if (!cond)
+ return;
+
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<8)))
+ never_ever(gi + 1, c->p);
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<7)))
+ never_ever(gi + 2, c->p);
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<6)))
+ never_ever(gi + 3, c->p);
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<5)))
+ never_ever(gi + 4, c->p);
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<4)))
+ never_ever(gi + 5, c->p);
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<3)))
+ never_ever(gi + 6, c->p);
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<2)))
+ never_ever(gi + 7, c->p);
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<1)))
+ never_ever(gi + 8, c->p);
+ if (c && c->type == 4 && c->p
+ && !(c->p->flags & (1<<9)))
+ never_ever(gi + 9, c->p);
+}
+
+static void
+foo(int * interp, Pcc_cell *c)
+{
+ mark_cell(interp, c, g_pvc);
+}
+
+static struct Pcc_cell *
+__attribute__((noinline,noclone))
+getnull(void)
+{
+ return (struct Pcc_cell *) 0;
+}
+
+
+int main()
+{
+ int i;
+
+ cond = 1;
+ for (i = 0; i < 100; i++)
+ foo (&gi, getnull ());
+ return 0;
+}
+
+
+void
+bar_1 (int * interp, Pcc_cell *c)
+{
+ c->bla += 1;
+ mark_cell(interp, c, g_pvc);
+}
+
+void
+bar_2 (int * interp, Pcc_cell *c, struct PVC pvc)
+{
+ c->bla += 2;
+ mark_cell(interp, c, pvc);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50333.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50333.c
new file mode 100644
index 000000000..47577dccc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50333.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+static inline void
+unext(unsigned int *_ui, unsigned _len, unsigned int _ui0)
+{
+ unsigned j = 1;
+ while (++j<_len)
+ ;
+ _ui[j-1]=_ui0;
+}
+unsigned int
+ncwrs_urow(unsigned _n, unsigned _k, unsigned int *_u)
+{
+ unsigned k;
+ for(k=2; k<_n; k++)
+ unext(_u+1,_k+1,1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50363.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50363.c
new file mode 100644
index 000000000..eb350198a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50363.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-ch -fno-tree-fre" } */
+
+void
+foo (int *__restrict__ * r, int n)
+{
+ int *p;
+ for (p = *r; p < *r + n; p++)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50389.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50389.c
new file mode 100644
index 000000000..6d8b095b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50389.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-freorder-blocks -ftracer" } */
+
+extern int data[];
+extern int i;
+
+void
+foo (void)
+{
+ char buf[8];
+ __builtin___memcpy_chk (buf, data, i ? 8 : 4,
+ __builtin_object_size (buf, 0));
+ __builtin___memcpy_chk (buf, data, i ? 8 : 4,
+ __builtin_object_size (buf, 0));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50396.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50396.c
new file mode 100644
index 000000000..aa17ebdaa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50396.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-add-options ieee } */
+
+extern void abort (void);
+typedef float vf128 __attribute__((vector_size(16)));
+typedef float vf64 __attribute__((vector_size(8)));
+int main()
+{
+#if !__FINITE_MATH_ONLY__
+#if __FLT_HAS_QUIET_NAN__
+ vf128 v = (vf128){ 0.f, 0.f, 0.f, 0.f };
+ vf64 u = (vf64){ 0.f, 0.f };
+ v = v / (vf128){ 0.f, 0.f, 0.f, 0.f };
+ if (v[0] == v[0])
+ abort ();
+ u = u / (vf64){ 0.f, 0.f };
+ if (u[0] == u[0])
+ abort ();
+#endif
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50444.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50444.c
new file mode 100644
index 000000000..35a614163
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50444.c
@@ -0,0 +1,76 @@
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+typedef long long __m128i __attribute__ ((__vector_size__ (16),
+__may_alias__));
+typedef int __v4si __attribute__ ((__vector_size__ (16)));
+typedef long long __v2di __attribute__ ((__vector_size__ (16)));
+typedef unsigned int uint32_t;
+
+typedef struct {
+ uint32_t v[4];
+} a4x32;
+
+a4x32* incr(a4x32* x)
+{
+ x->v[0] += 1;
+ return x;
+}
+
+typedef struct {
+ __m128i m;
+} a1xm128i;
+
+static inline a1xm128i ssefunc( a1xm128i in, a1xm128i k)
+{
+ a1xm128i ret;
+ ret.m = (__m128i)__builtin_ia32_pxor128 ((__v2di)in.m, (__v2di)k.m);
+ return ret;
+}
+
+static a4x32 caster( a4x32 c4x32, a1xm128i k)
+{
+ a1xm128i c1x128;
+ if( sizeof(c4x32) != sizeof(c1x128) ) __builtin_abort();
+ __builtin_memcpy(&c1x128, &c4x32, sizeof(c1x128));
+ c1x128 = ssefunc(c1x128, k);
+ __builtin_memcpy(&c4x32, &c1x128, sizeof(c4x32));
+ return c4x32;
+}
+
+typedef struct {
+ a1xm128i key;
+ a4x32 c;
+ __SIZE_TYPE__ elem;
+ a4x32 v;
+} Engine;
+
+void ctor(Engine *e)
+{
+ e->elem = 0;
+ e->key.m = (__m128i)(__v4si){ 0, 0, 0, 0 };
+ e->c.v[0] = 0;
+ e->c.v[1] = 0;
+ e->c.v[2] = 0;
+ e->c.v[3] = 0;
+}
+
+uint32_t method( Engine *e)
+{
+ if( e->elem == 0 )
+ {
+ e->v = caster(*incr(&e->c), e->key);
+ e->elem = 4;
+ }
+ return e->v.v[--e->elem];
+}
+
+int main()
+{
+ Engine e4; ctor(&e4);
+ Engine e5; ctor(&e5);
+ if(method(&e4)!=method(&e5))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50472.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50472.c
new file mode 100644
index 000000000..3b432eae3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50472.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+static const unsigned int foo = 1;
+unsigned int test( void )
+{
+ const volatile unsigned int *bar = &foo;
+ return ( *bar );
+}
+
+/* { dg-final { scan-tree-dump-not "return 1" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50723.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50723.c
new file mode 100644
index 000000000..24e490fc6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50723.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+typedef short unsigned int wchar_t;
+typedef unsigned int size_t;
+int* _errno(void);
+int WideCharToMultiByte (wchar_t *);
+int __attribute__ ((__nonnull__ (1)))
+__wcrtomb_cp (char *dst, wchar_t wc, const unsigned int cp,
+ const unsigned int mb_max)
+{
+ if (cp == 0) {
+ if (wc > 255)
+ (*_errno()) = 42;
+ return 1;
+ }
+ else
+ return WideCharToMultiByte (&wc);
+}
+void wcsrtombs (char *dst, const wchar_t *pwc, unsigned int cp,
+ unsigned int mb_max)
+{
+ if ((__wcrtomb_cp (dst, *pwc, cp, mb_max)) <= 0)
+ return;
+ if ((__wcrtomb_cp (dst, *pwc, cp, mb_max)) <= 0)
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c
new file mode 100644
index 000000000..a1daa7b85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50729.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort (void);
+unsigned short __attribute__((noinline))
+foo (int i)
+{
+ if (i >= 0
+ && i <= 0x400000)
+ return (unsigned short)(signed char)i;
+ return i;
+}
+int main()
+{
+ int i;
+ for (i = 0; i < 0xffff; ++i)
+ if (foo(i) != (unsigned short)(signed char) i)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50767.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50767.c
new file mode 100644
index 000000000..96ab72ebd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50767.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-copy-prop -fno-tree-dominator-opts" } */
+
+struct S
+{
+ struct S *s;
+};
+
+static struct S *ss;
+struct S *s;
+
+void bar(void);
+
+void foo(void)
+{
+ for (;;)
+ {
+ s->s = ss;
+ bar ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50768.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50768.c
new file mode 100644
index 000000000..351b2f966
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50768.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-ftracer" } */
+
+char data[8];
+int l1;
+
+void
+test1 (void)
+{
+ char buf[8];
+ __builtin___mempcpy_chk (buf, data, l1 ? sizeof (buf) : 4,
+ __builtin_object_size (buf, 0));
+ if (__builtin___memmove_chk
+ (buf, data, l1 ? sizeof (buf) : 4,
+ __builtin_object_size (buf, 0)) != buf)
+ __builtin_abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50823.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50823.c
new file mode 100644
index 000000000..9ac691172
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50823.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-finline-functions" } */
+
+int k1, k2, k3, k4, k5, k6, k7, k8;
+
+void set_first_insn (int);
+void set_last_insn (void);
+
+static int make_insn_raw (void)
+{
+ set_first_insn (0);
+ set_last_insn ();
+ return k1;
+}
+
+static void add_insn_after (void)
+{
+ if (k2)
+ k3 = k4;
+
+ if (k5)
+ k6 = k7;
+}
+
+void emit_pattern_after_noloc (int (make_raw) (void))
+{
+ if (k8)
+ {
+ make_raw ();
+ add_insn_after ();
+ }
+}
+
+void emit_insn_after_noloc (void)
+{
+ emit_pattern_after_noloc (make_insn_raw);
+}
+
+void emit_debug_insn_before_setloc (int k9)
+{
+ if (k9)
+ make_insn_raw ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50838.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50838.c
new file mode 100644
index 000000000..a3911c975
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50838.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+typedef void * gcv_object_t;
+typedef gcv_object_t object;
+typedef const void * Pseudofun;
+extern struct pseudocode_tab_ {
+ Pseudofun pseudo_eql;
+ Pseudofun pseudo_iconv_wcslen;
+ Pseudofun pseudo_iconv_wcstombs;
+ Pseudofun pseudo_iconv_range;
+}
+pseudocode_tab;
+extern struct symbol_tab_ {
+ object pointer[1024];
+} pseudofun_tab;
+int
+init_memory (void)
+{
+ object* ptr2 = &pseudofun_tab.pointer[0];
+ const Pseudofun* ptr1 = (const Pseudofun*)&pseudocode_tab;
+ unsigned int count = (sizeof(pseudocode_tab)/sizeof(Pseudofun));
+ while (count--)
+ {
+ *ptr2++ = (gcv_object_t)(((unsigned char *)((*ptr1))));
+ ptr1++;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50890.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50890.c
new file mode 100644
index 000000000..17240d4fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50890.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+static float make_insn_raw (void)
+{
+ return 0;
+}
+
+static int emit_pattern_after_noloc (int (make_raw) ())
+{
+ return make_raw ();
+}
+
+void emit_insn_after_noloc (void)
+{
+ emit_pattern_after_noloc ((void *) make_insn_raw);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50902.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50902.c
new file mode 100644
index 000000000..5b7275b83
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr50902.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+_Bool data[128];
+void foo (_Bool *init)
+{
+ int i;
+ for (i = 0; i < 128; i++)
+ data[i] = *init;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51042.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51042.c
new file mode 100644
index 000000000..05961c4ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51042.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+int a, b;
+
+void
+foo (int x)
+{
+ int e[2];
+ int d;
+ while (x)
+ {
+ for (d = 0; d <= 1; d = 1)
+ if (e[a])
+ break;
+ for (b = 0; b <= 0; b = 1)
+ {
+ e[a] = a;
+ if (a)
+ break;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51070-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51070-2.c
new file mode 100644
index 000000000..f21eb3acb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51070-2.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-inline" } */
+
+int
+func_4 (int si1, int si2)
+{
+ return si1;
+}
+
+int
+func_14 (int left, int right)
+{
+ return 1;
+}
+
+int
+func_37 (int left, int right)
+{
+ return left;
+}
+
+int g_92[1024];
+int g_95[1024];
+int g_224;
+int g_352[1024];
+int
+func_9 ()
+{
+ for (; g_224; g_224 += 1)
+ {
+ g_95[0] = func_4 (func_37 (g_92[g_224], 0), 0);
+ g_92[g_224] = 0, g_352[g_224] = func_14 (0, 0);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51070.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51070.c
new file mode 100644
index 000000000..cc06a90c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51070.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+
+int
+func_4 (int si1, int si2)
+{
+ return si1;
+}
+
+int
+func_14 (int left, int right)
+{
+ return 1;
+}
+
+int
+func_37 (int left, int right)
+{
+ return left;
+}
+
+int g_92[1024];
+int g_95[1024];
+int g_224;
+int g_352[1024];
+int
+func_9 ()
+{
+ for (; g_224; g_224 += 1)
+ {
+ g_95[0] = func_4 (func_37 (g_92[g_224], 0), 0);
+ g_92[g_224] = 0, g_352[g_224] = func_14 (0, 0);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51071-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51071-2.c
new file mode 100644
index 000000000..b67879c44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51071-2.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-delete-null-pointer-checks" } */
+
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
+
+extern struct module __this_module;
+static inline void
+trace_module_get (struct module *mod, uintptr_t ip) { }
+struct module;
+static inline __attribute__((no_instrument_function))
+int try_module_get(struct module *module)
+{
+ int ret = 1;
+ if (module)
+ {
+ if (module_is_live(module))
+ {
+ __label__ __here;
+ asm("");
+ __here:
+ trace_module_get(module, (uintptr_t)&&__here);
+ }
+ else
+ ret = 0;
+ }
+ return ret;
+}
+struct net_device;
+struct net_device_ops {
+ int (*ndo_open)(struct net_device *dev);
+};
+int t3e3_open(struct net_device *dev)
+{
+ int ret = hdlc_open(dev);
+ if (ret)
+ return ret;
+ try_module_get((&__this_module));
+ return 0;
+}
+const struct net_device_ops t3e3_ops = { .ndo_open = t3e3_open };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51071.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51071.c
new file mode 100644
index 000000000..99af9587d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51071.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+
+void foo (void);
+void bar (void *);
+extern int t;
+
+static void kmalloc_large (int size, int flags)
+{
+ (void) size;
+ (void) flags;
+ foo ();
+ bar (({__here:&&__here;}));
+}
+
+static void kmalloc (int size, int flags)
+{
+ if (size)
+ {
+ if ((unsigned long) size > 0x1000)
+ kmalloc_large (size, flags);
+
+ if (flags)
+ bar (({__here:&&__here;}));
+ }
+}
+
+void compress_file_range (int i, int j, int k)
+{
+ int nr_pages = ({j < k;});
+
+ if (i || t)
+ kmalloc (0x1000UL * nr_pages, 0x40UL);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51106-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51106-1.c
new file mode 100644
index 000000000..10b3b682b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51106-1.c
@@ -0,0 +1,14 @@
+/* PR target/51106 */
+/* { dg-do "compile" } */
+/* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */
+
+int
+foo (int x)
+{
+ asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */
+ return 1;
+lab:
+ return 0;
+}
+
+/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51106-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51106-2.c
new file mode 100644
index 000000000..bab0987ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51106-2.c
@@ -0,0 +1,15 @@
+/* PR target/51106 */
+/* { dg-do "compile" } */
+/* { dg-skip-if "RTL error" { "*-*-*" } { "-fno-fat-lto-objects" } { "" } } */
+/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int
+bar (int x)
+{
+ asm goto ("" : : "i" (x) : : lab); /* { dg-error "impossible constraint" } */
+ __builtin_unreachable ();
+lab:
+ return 0;
+}
+
+/* { dg-warning "probably doesn.t match constraints" "" { target *-*-* } 9 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51238.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51238.c
new file mode 100644
index 000000000..4d5da5d18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51238.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-loop-distribution" } */
+
+extern int ia[];
+extern int ib[];
+int i;
+
+void
+foo (int l)
+{
+ while (l--)
+ {
+ i = ia[l];
+ ia[l] = ib[l] = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51244-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51244-21.c
new file mode 100644
index 000000000..fbb02db28
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51244-21.c
@@ -0,0 +1,75 @@
+/* { dg-do run } */
+#include <assert.h>
+
+static inline int
+blk_oversized_queue (int* q)
+{
+ if (q[2])
+ return q[1] != 0;
+ return q[0] == 0;
+}
+
+int __attribute__ ((noinline))
+get_request (int* q, int rw)
+{
+ if (blk_oversized_queue (q))
+ {
+ if ((rw == 1) || (rw == 0))
+ return -33;
+
+ return 0;
+ }
+
+ return -100;
+}
+
+int main (void)
+{
+ int x[3];
+ int r;
+
+ x[0] = 0; x[1] = 1; x[2] = 1;
+ r = get_request (x, 0);
+ assert (r == -33);
+
+ r = get_request (x, 1);
+ assert (r == -33);
+
+ r = get_request (x, 2);
+ assert (r == 0);
+
+
+ x[0] = 0; x[1] = 0; x[2] = 1;
+ r = get_request (x, 0);
+ assert (r == -100);
+
+ r = get_request (x, 1);
+ assert (r == -100);
+
+ r = get_request (x, 2);
+ assert (r == -100);
+
+
+ x[0] = 0; x[1] = 0; x[2] = 0;
+ r = get_request (x, 0);
+ assert (r == -33);
+
+ r = get_request (x, 1);
+ assert (r == -33);
+
+ r = get_request (x, 2);
+ assert (r == 0);
+
+
+ x[0] = 0; x[1] = 0; x[2] = 0;
+ r = get_request (x, 0);
+ assert (r == -33);
+
+ r = get_request (x, 1);
+ assert (r == -33);
+
+ r = get_request (x, 2);
+ assert (r == 0);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51245.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51245.c
new file mode 100644
index 000000000..e5e2ded13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51245.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+struct S { int s; } a, *b, **c;
+int d;
+
+struct S
+foo (void)
+{
+ struct S s = { 0 }, *e = &a;
+ if (d)
+ **c = *b;
+ while (1)
+ {
+ *b = s;
+ *e = *b;
+ if (a.s)
+ break;
+ }
+ return **c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c
new file mode 100644
index 000000000..db5f3e0ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51528.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-options "-fno-early-inlining" } */
+
+extern void abort (void);
+
+union U
+{
+ int i;
+ _Bool b;
+};
+
+_Bool gb;
+
+void __attribute__ ((noinline))
+use_bool (union U u)
+{
+ gb = u.b;
+}
+
+union U
+bar (void)
+{
+ union U u;
+ u.i = 0xFFFE;
+ return u;
+}
+
+union U __attribute__ ((noinline))
+foo (void)
+{
+ union U u,v;
+
+ u.b = 1;
+ use_bool (u);
+ u = bar ();
+
+ return u;
+}
+
+int main (int argc, char **argv)
+{
+ union U u = foo ();
+ if (u.i != 0xFFFE)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51692.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51692.c
new file mode 100644
index 000000000..34a81c29d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51692.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+int
+main ()
+{
+ volatile double d = 0.0;
+ double *p = __builtin_calloc (1, sizeof (double));
+ d += 1.0;
+ *p += 2.0;
+ __builtin_free (p);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51760.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51760.c
new file mode 100644
index 000000000..ebff2c930
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51760.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+extern inline __attribute__ ((always_inline)) void *
+memmove (void *dest, const void *src, __SIZE_TYPE__ len)
+{
+ return __builtin___memmove_chk (dest, src, len,
+ __builtin_object_size (dest, 0));
+}
+
+void
+foo (void)
+{
+ char a[64], *b;
+ for (;;)
+ {
+ memmove (a, b, 0);
+ b = a;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51801.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51801.c
new file mode 100644
index 000000000..c36cee306
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51801.c
@@ -0,0 +1,62 @@
+/* { dg-do compile } */
+
+typedef struct { char Vshow; } TScreen;
+typedef struct _Misc { char Tshow; } Misc;
+typedef struct _XtermWidgetRec { TScreen screen; Misc misc; } XtermWidgetRec, *XtermWidget;
+extern XtermWidget term;
+
+void
+handle_tekshow (void *gw, int allowswitch)
+{
+ XtermWidget xw = term;
+ if (!((xw)->misc.Tshow))
+ set_tek_visibility (1);
+}
+
+void
+do_tekonoff (void *gw, void *closure, void *data)
+{
+ handle_tekshow (gw, 0);
+}
+
+void
+do_vtonoff (void *gw, void *closure, void *data)
+{
+}
+
+void
+handle_toggle (void (*proc) (void *gw, void *closure, void *data),
+ int var, char **params, unsigned int nparams, void *w,
+ void *closure, void *data)
+{
+ XtermWidget xw = term;
+ int dir = -2;
+ switch (nparams)
+ {
+ case 0:
+ dir = -1;
+ }
+ switch (dir)
+ {
+ case 1:
+ (*proc) (w, closure, data);
+ Bell (xw, 2, 0);
+ }
+}
+
+void
+HandleVisibility (void *w, char **params, unsigned int *param_count)
+{
+ XtermWidget xw = term;
+ if (*param_count == 2)
+ switch (params[0][0])
+ {
+ case 'v':
+ handle_toggle (do_vtonoff, (int) ((int) (&(xw)->screen)->Vshow),
+ params + 1, (*param_count) - 1, w, (void *) 0,
+ (void *) 0);
+ handle_toggle (do_tekonoff, (int) ((int) ((xw)->misc.Tshow)),
+ params + 1, (*param_count) - 1, w, (void *) 0,
+ (void *) 0);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51949.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51949.c
new file mode 100644
index 000000000..e23bd7b4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr51949.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+typedef long unsigned int size_t;
+extern __attribute__ ((malloc)) void *mem_alloc(size_t);
+void *mem_alloc(size_t amount)
+{
+ void *q = __builtin_malloc (amount);
+ if (!q) {
+ __builtin_printf("malloc");
+ __builtin_exit(255);
+ }
+}
+void mem_realloc()
+{
+ mem_alloc(1);
+}
+void put_env_var()
+{
+ mem_alloc(1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52028.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52028.c
new file mode 100644
index 000000000..764377c3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52028.c
@@ -0,0 +1,83 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-ftree-loop-distribution" } */
+
+#define CAST_LONG unsigned int
+typedef struct cast_key_st
+{
+ CAST_LONG data[32];
+} CAST_KEY;
+#define CAST_exp(l,A,a,n) \
+ A[n/4]=l; \
+ a[n+3]=(l )&0xff; \
+ a[n+2]=(l>> 8)&0xff; \
+ a[n+1]=(l>>16)&0xff; \
+ a[n+0]=(l>>24)&0xff;
+
+CAST_LONG CAST_S_table[1024];
+
+#define S4 (CAST_S_table + 000)
+#define S5 (CAST_S_table + 256)
+#define S6 (CAST_S_table + 512)
+#define S7 (CAST_S_table + 768)
+
+void
+CAST_set_key (CAST_KEY * key)
+{
+ CAST_LONG x[16];
+ CAST_LONG z[16];
+ CAST_LONG k[32];
+ CAST_LONG X[4] = {0,0,0,0}, Z[4];
+ CAST_LONG l, *K = k;
+ int i;
+ for (i = 0; i < 16; i++)
+ x[i] = 0;
+ for (;;)
+ {
+ l = X[0] ^ S4[x[13]] ^ S5[x[15]] ^ S6[x[12]] ^ S7[x[14]] ^ S6[x[8]];
+ CAST_exp (l, Z, z, 0);
+ CAST_exp (l, Z, z, 4);
+ CAST_exp (l, Z, z, 8);
+ CAST_exp (l, Z, z, 12);
+ K[0] = S4[z[8]] ^ S5[z[9]] ^ S6[z[7]] ^ S7[z[6]] ^ S4[z[2]];
+ K[1] = S4[z[10]] ^ S5[z[11]] ^ S6[z[5]] ^ S7[z[4]] ^ S5[z[6]];
+ K[2] = S4[z[12]] ^ S5[z[13]] ^ S6[z[3]] ^ S7[z[2]] ^ S6[z[9]];
+ K[3] = S4[z[14]] ^ S5[z[15]] ^ S6[z[1]] ^ S7[z[0]] ^ S7[z[12]];
+ K[4] = S4[x[3]] ^ S5[x[2]] ^ S6[x[12]] ^ S7[x[13]] ^ S4[x[8]];
+ K[5] = S4[x[1]] ^ S5[x[0]] ^ S6[x[14]] ^ S7[x[15]] ^ S5[x[13]];
+ K[6] = S4[x[7]] ^ S5[x[6]] ^ S6[x[8]] ^ S7[x[9]] ^ S6[x[3]];
+ K[7] = S4[x[5]] ^ S5[x[4]] ^ S6[x[10]] ^ S7[x[11]] ^ S7[x[7]];
+ K[8] = S4[z[3]] ^ S5[z[2]] ^ S6[z[12]] ^ S7[z[13]] ^ S4[z[9]];
+ K[9] = S4[z[1]] ^ S5[z[0]] ^ S6[z[14]] ^ S7[z[15]] ^ S5[z[12]];
+ K[10] = S4[z[7]] ^ S5[z[6]] ^ S6[z[8]] ^ S7[z[9]] ^ S6[z[2]];
+ K[11] = S4[z[5]] ^ S5[z[4]] ^ S6[z[10]] ^ S7[z[11]] ^ S7[z[6]];
+ l = Z[2] ^ S4[z[5]] ^ S5[z[7]] ^ S6[z[4]] ^ S7[z[6]] ^ S6[z[0]];
+ CAST_exp (l, X, x, 0);
+ K[12] = S4[x[8]] ^ S5[x[9]] ^ S6[x[7]] ^ S7[x[6]] ^ S4[x[3]];
+ K[13] = S4[x[10]] ^ S5[x[11]] ^ S6[x[5]] ^ S7[x[4]] ^ S5[x[7]];
+ K[14] = S4[x[12]] ^ S5[x[13]] ^ S6[x[3]] ^ S7[x[2]] ^ S6[x[8]];
+ K[15] = S4[x[14]] ^ S5[x[15]] ^ S6[x[1]] ^ S7[x[0]] ^ S7[x[13]];
+ if (K != k)
+ break;
+ K += 16;
+ }
+ for (i = 0; i < 16; i++)
+ {
+ key->data[i * 2] = k[i];
+ key->data[i * 2 + 1] = ((k[i + 16]) + 16) & 0x1f;
+ }
+}
+
+int
+main ()
+{
+ CAST_KEY ref = { {0x0069B3F8, 0x00000013, 0x000AEFF8, 0x00000013, 0x004AD0E0, 0x0000001B, 0x00818F18, 0x00000018, 0x008FF000, 0x0000001B, 0x002D1C00, 0x0000001B, 0x00EA2800, 0x00000010, 0x00C73400, 0x00000010, 0x004BF8E0, 0x0000001B, 0x00B3D718, 0x00000018, 0x00B0EBF8, 0x00000013, 0x003247F8, 0x00000013, 0x00C5BA20, 0x00000010, 0x002D1C00, 0x00000010, 0x0060822B, 0x00000008, 0x0096236B, 0x0000001B} };
+ CAST_KEY key;
+ unsigned i;
+ for (i = 1; i < 1024; i++)
+ CAST_S_table[i] = (CAST_S_table[i-1] * 7 + 3) & 0xFFFFFF;
+ CAST_set_key (&key);
+ if (__builtin_memcmp(&ref, &key, sizeof(ref)))
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52060.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52060.c
new file mode 100644
index 000000000..44207a503
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52060.c
@@ -0,0 +1,57 @@
+/* PR rtl-optimization/52060 */
+/* { dg-do run { target int32plus } } */
+
+extern void abort (void);
+union U { float f; unsigned int i; };
+
+static inline __attribute__((always_inline)) unsigned int
+foo (float x)
+{
+ union U u;
+ unsigned int a, b, c;
+ int d;
+ int e;
+ u.f = x;
+ d = ((unsigned) u.i >> 23) & 0xFF;
+ c = d < 126 ? 0 : ~0;
+ e = 127 + 30 - d;
+ a = (u.i << 8) | 0x80000000U;
+ b = a & ((1 << e) - 1);
+ a = a >> e;
+ c &= (b | (a & 2)) ? ~0 : ~1;
+ a = ((a + 1U) >> 1) & c;
+ return a;
+}
+
+__attribute__((noinline)) unsigned int
+bar (float x)
+{
+ unsigned int a, b, c;
+ static const unsigned int d[128] =
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7
+ };
+ a = foo (1048575.0f * x);
+ c = d[a >> 13];
+ b = (c << 13) | ((a >> (7 - c)) & 0x1fff);
+ return b;
+}
+
+int
+main ()
+{
+ union U u;
+ u.f = 1048575.0f;
+ if (sizeof (u.i) == sizeof (u.f)
+ && u.i == 0x497ffff0U
+ && bar (1.0f) != 65535)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52170.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52170.c
new file mode 100644
index 000000000..3d0a03889
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52170.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8_t ;
+typedef unsigned long uint32_t;
+void f0a(uint32_t * result, uint32_t * arg1)
+{
+ int idx;
+ for (idx=0;idx<96;idx += 1)
+ {
+ uint8_t temp_5;
+ uint8_t temp_6;
+
+ temp_5 = ~(*arg1);
+ temp_6 = (*arg1) + 1 - temp_5;
+ result[idx] = temp_6;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52244.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52244.c
new file mode 100644
index 000000000..2a29e3cf4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52244.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+typedef union u_r
+{
+ _Bool b;
+ unsigned char c;
+} u_t;
+
+u_t
+bar (void)
+{
+ u_t u;
+ u.c = 0x12;
+ return u;
+}
+
+u_t __attribute__ ((noinline))
+foo (void)
+{
+ u_t u;
+
+ u.b = 1;
+ u = bar ();
+
+ return u;
+}
+
+int main (int argc, char **argv)
+{
+ u_t u = foo ();
+ if (u.c != 0x12)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52298.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52298.c
new file mode 100644
index 000000000..f0799c1a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52298.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+int a, b, c, h;
+
+int i[5][5];
+
+void
+fn1 ()
+{
+ int l = 0;
+
+ for (a = 0; a <= 3; a++)
+ for (b = 1; b >= 0; b -= 1)
+ l |= i[0][b];
+ c = l;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52402.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52402.c
new file mode 100644
index 000000000..ba7c5ae24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52402.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-options "-w -Wno-psabi" } */
+/* { dg-require-effective-target int32plus } */
+
+typedef int v4si __attribute__((vector_size(16)));
+struct T { v4si i[2]; int j; } __attribute__((packed));
+
+static v4si __attribute__((noinline))
+foo (struct T t)
+{
+ return t.i[0];
+}
+
+static struct T *__attribute__((noinline))
+init ()
+{
+ char *p = __builtin_malloc (sizeof (struct T) + 1);
+ p++;
+ __builtin_memset (p, 1, sizeof (struct T));
+ return (struct T *)p;
+}
+
+int main()
+{
+ struct T *p;
+ p = init ();
+ if (foo (*p)[0] != 0x01010101)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52406.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52406.c
new file mode 100644
index 000000000..5579d0943
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52406.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+extern void abort (void);
+struct { int f1; } a[2];
+
+int *b, *const k = &a[1].f1;
+static int **c = &b;
+
+int e, f, d;
+
+int
+main ()
+{
+ int **l = &b;
+ *l = k;
+ for (; d <= 0; d++)
+ {
+ int *j = &e;
+ **c = 1;
+ *l = k;
+ *k ^= 0;
+ f = **l;
+ *j = f;
+ }
+ if (e != 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52407.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52407.c
new file mode 100644
index 000000000..917e9db3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52407.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+
+extern void abort (void);
+
+typedef long long T;
+typedef T vl_t __attribute__((vector_size(2 * sizeof (T))));
+
+vl_t ul[4], vl[4] = { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
+
+static void
+mul_vl_l(vl_t *u, vl_t *v, T x, int m)
+{
+ vl_t w;
+ T *p = (T *)&w;
+ p[0] = p[1] = x;
+ while (m--)
+ *u++ = *v++ * w;
+}
+
+int
+main(int argc, char *argv[])
+{
+ int i;
+ T *pl;
+
+ pl = (T *) &ul;
+ mul_vl_l(ul, vl, 2, 4);
+ for (i = 0; i < 8; i++)
+ if (pl[i] != 2 * (i + 1))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52419.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52419.c
new file mode 100644
index 000000000..d24225a3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52419.c
@@ -0,0 +1,32 @@
+/* PR middle-end/52419 */
+/* { dg-do run } */
+
+extern void abort (void);
+
+typedef long long V
+ __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
+
+typedef struct S { V b; } P __attribute__((aligned (1)));
+
+struct __attribute__((packed)) T { char c; P s; };
+
+__attribute__((noinline, noclone)) void
+foo (P *p)
+{
+ p->b[1] = 5;
+}
+
+int
+main ()
+{
+ V a = { 3, 4 };
+ struct T t;
+
+ t.s.b = a;
+ foo (&t.s);
+
+ if (t.s.b[0] != 3 || t.s.b[1] != 5)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52429.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52429.c
new file mode 100644
index 000000000..e2aeaa971
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52429.c
@@ -0,0 +1,24 @@
+/* PR tree-optimization/52429 */
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-g -ftree-parallelize-loops=4" } */
+
+double d[65536], e[65536];
+
+void
+foo (void)
+{
+ int i;
+ double f, g;
+ for (i = 0; i < 65536; i++)
+ {
+ f = e[i];
+ goto lab1;
+ lab2:
+ d[i] = f * g;
+ continue;
+ lab1:
+ g = d[i];
+ goto lab2;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52493.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52493.c
new file mode 100644
index 000000000..b04ac5c17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52493.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+
+struct Time {
+ long int sec;
+ long usec;
+};
+struct Flow {
+ unsigned short iif;
+ struct Time mtime;
+};
+struct NetFlow {
+ unsigned MaxFlows;
+ unsigned HeaderFields;
+ unsigned short *HeaderFormat;
+};
+static struct NetFlow *netflow;
+static struct Time start_time;
+static unsigned char emit_packet[1500];
+inline long int cmpmtime(struct Time *t1, struct Time *t2)
+{
+ return (t1->sec - t2->sec) * 1000 + (t1->usec - t2->usec) / 1000;
+}
+static void fill(int fields, unsigned short *format,
+ struct Flow *flow, void *p)
+{
+ int i;
+ for (i = 0; i < fields; i++)
+ if (format[i] == 21)
+ {
+ unsigned int __v;
+ __v = cmpmtime(&flow->mtime, &start_time);
+ *((unsigned int *) p) = __v;
+ }
+}
+void emit_thread()
+{
+ fill(netflow->HeaderFields, netflow->HeaderFormat, 0, &emit_packet);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52530.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52530.c
new file mode 100644
index 000000000..f7cdf1a63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52530.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+#if __SIZEOF_INT__ > 2
+struct foo
+{
+ int *f;
+ int i;
+};
+
+int baz;
+#else
+struct foo
+{
+ long *f;
+ long i;
+};
+
+long baz;
+#endif
+
+void __attribute__ ((noinline))
+bar (struct foo x)
+{
+ *(x.f) = x.i;
+}
+
+int
+main ()
+{
+ struct foo x = { &baz, 0xdeadbeef };
+
+ bar (x);
+
+ if (baz != 0xdeadbeef)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52693.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52693.c
new file mode 100644
index 000000000..93e0680ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52693.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+struct pair
+{
+ int x;
+ int y;
+};
+
+struct array
+{
+ struct pair elems[ 2 ];
+ unsigned index;
+};
+
+extern void abort ();
+
+void __attribute__ ((noinline,noclone))
+test_results (int x1, int y1, int x2, int y2)
+{
+ if (x1 != x2 || y1 != y2)
+ abort ();
+}
+
+int
+main (void)
+{
+ struct array arr = {{{1,2}, {3,4}}, 1};
+ struct pair last = arr.elems[arr.index];
+
+ test_results ( last.x, last.y, arr.elems[1].x, arr.elems[1].y);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52720.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52720.c
new file mode 100644
index 000000000..528aa161b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52720.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-march=k8-sse3" { target x86_64-*-* } } */
+
+struct alu_bank_swizzle {
+ int hw_gpr[3][4];
+ int hw_cfile_addr[4];
+};
+static void init_bank_swizzle(struct alu_bank_swizzle *bs)
+{
+ int i, cycle, component;
+ for (cycle = 0; cycle < 3; cycle++)
+ for (component = 0; component < 4; component++)
+ bs->hw_gpr[cycle][component] = -1;
+ for (i = 0; i < 4; i++)
+ bs->hw_cfile_addr[i] = -1;
+}
+int check_and_set_bank_swizzle(int max_slots, int *slots)
+{
+ struct alu_bank_swizzle bs;
+ int i;
+ for (i = 0; i < max_slots; i++)
+ {
+ init_bank_swizzle(&bs);
+ if (slots[i])
+ check_vector(&bs);
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52756.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52756.c
new file mode 100644
index 000000000..175b414e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52756.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void Env_FetchObj0AttrOffset (unsigned int NumFields, int *Status)
+{
+ int Found = 0;
+ if (NumFields)
+ while ((*Status == 0) && NumFields-- > 0 && Found == 0)
+ Found = 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52881.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52881.c
new file mode 100644
index 000000000..c101c8033
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52881.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+
+int a, b, c, d, e, f, h, i, j, k, l, m, n, o;
+static int g;
+int
+fn1 () {
+ for (;; ++f)
+ if (e)
+ break;
+ return 0;
+}
+unsigned char fn2 ();
+void
+fn3 () {
+lbl_220:
+ if (j) {
+lbl_221:
+ l = (g || b) <= fn1 ();
+ for (;;) {
+ g = 0;
+ fn2 ();
+ if (k)
+ goto lbl_220;
+ break;
+ }
+ if (l)
+ goto lbl_221;
+ }
+}
+unsigned char
+fn2 () {
+ o = d ? 0 : c;
+ h = m | a % o != n;
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52912.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52912.c
new file mode 100644
index 000000000..3ae57588f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52912.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+int a, b, c;
+static int
+fn1 (p1)
+{
+lbl_549:
+ if (p1)
+ goto lbl_549;
+ return 0;
+}
+
+void
+fn2 ()
+{
+ b = (c && a) > fn1 (c) >= c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52913.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52913.c
new file mode 100644
index 000000000..ad99884bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52913.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+int a, b, c, d, e;
+void
+fn1 ()
+{
+lbl_101:
+ e = 0;
+lbl_274:
+ for (c = 0; c < 1; c = a)
+ if (d)
+ if (b)
+ goto lbl_101;
+ else
+ break;
+ d = 1;
+ goto lbl_274;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52943.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52943.c
new file mode 100644
index 000000000..da35c9d18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52943.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+extern void abort (void);
+int a[] = { 0, 0, 0, 6 };
+
+int b;
+int
+main ()
+{
+ for (;;)
+ {
+ b = 3;
+ for (; b; b -= 1)
+ a[b] = a[3] > 1;
+ break;
+ }
+ if (a[1] != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52969.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52969.c
new file mode 100644
index 000000000..05331d93f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52969.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-loop-if-convert-stores" } */
+
+int a, b;
+float xsum[100];
+void foo (float *cluster)
+{
+ int j;
+ for (; a ; ++j) {
+ xsum[j] = cluster[j];
+ if (xsum[j] > 0)
+ xsum[j] = 0;
+ }
+ if (xsum[0])
+ b = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52996.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52996.c
new file mode 100644
index 000000000..200bc36b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr52996.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-funswitch-loops" } */
+
+int a, b, c, d, e, f;
+void
+fn1 ()
+{
+ int g, h;
+lbl_173:
+ if (a)
+ c++;
+lbl_158:
+ e = 0;
+ h = 0;
+ for (; h > -8; h--)
+ {
+ g = 0;
+ for (; g <= 0; g += 1)
+ {
+ d = 1;
+ for (; d >= 0; d -= 1)
+ a = 1;
+ if (b)
+ break;
+ if (f)
+ return;
+ if (h)
+ goto lbl_158;
+ }
+ }
+ goto lbl_173;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53070.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53070.c
new file mode 100644
index 000000000..534ac3414
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53070.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math -ftree-loop-if-convert -fno-tree-loop-im" } */
+int
+foo (int c)
+{
+ int t = 0, i = 0;
+ for (; i < 100; i++)
+ t += c ? c : 1;
+ return t;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53120.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53120.c
new file mode 100644
index 000000000..8a70290e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53120.c
@@ -0,0 +1,110 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-sra" } */
+typedef struct {
+ unsigned int en : 1;
+ unsigned int bit_order : 1;
+ unsigned int scl_io : 1;
+ unsigned int scl_inv : 1;
+ unsigned int sda0_io : 1;
+ unsigned int sda0_idle : 1;
+ unsigned int sda1_io : 1;
+ unsigned int sda1_idle : 1;
+ unsigned int sda2_io : 1;
+ unsigned int sda2_idle : 1;
+ unsigned int sda3_io : 1;
+ unsigned int sda3_idle : 1;
+ unsigned int sda_sel : 2;
+ unsigned int sen_idle : 1;
+ unsigned int sen_inv : 1;
+ unsigned int sen_sel : 2;
+ unsigned int dummy1 : 14;
+} reg_gio_rw_i2c1_cfg;
+
+typedef struct {
+ unsigned int data0 : 8;
+ unsigned int data1 : 8;
+ unsigned int data2 : 8;
+ unsigned int data3 : 8;
+} reg_gio_rw_i2c1_data;
+
+typedef struct {
+ unsigned int trf_bits : 6;
+ unsigned int switch_dir : 6;
+ unsigned int extra_start : 3;
+ unsigned int early_end : 1;
+ unsigned int start_stop : 1;
+ unsigned int ack_dir0 : 1;
+ unsigned int ack_dir1 : 1;
+ unsigned int ack_dir2 : 1;
+ unsigned int ack_dir3 : 1;
+ unsigned int ack_dir4 : 1;
+ unsigned int ack_dir5 : 1;
+ unsigned int ack_bit : 1;
+ unsigned int start_bit : 1;
+ unsigned int freq : 2;
+ unsigned int dummy1 : 5;
+} reg_gio_rw_i2c1_ctrl;
+
+extern reg_gio_rw_i2c1_cfg reg_gio;
+extern reg_gio_rw_i2c1_data reg_data;
+extern int reg_start;
+extern reg_gio_rw_i2c1_ctrl reg_ctrl;
+
+extern void foobar(void);
+extern void foo(int);
+extern void frob(unsigned int);
+extern void bar(int);
+extern void baz(void);
+
+unsigned int f(int *devspec, unsigned int addr)
+{
+ reg_gio_rw_i2c1_ctrl ctrl = {0};
+ reg_gio_rw_i2c1_data data = {0};
+
+ foobar();
+
+ static int first = 1;
+
+ if (first) {
+ reg_gio_rw_i2c1_cfg cfg = {0};
+ first = 0;
+
+ foo(1);
+ cfg.sda0_idle = 1;
+ cfg.sda0_io = 0;
+ cfg.scl_inv = 0;
+ cfg.scl_io = 0;
+ cfg.bit_order = 1;
+ cfg.sda_sel = 0;
+ cfg.sen_sel = 0;
+ cfg.en = 1;
+ reg_gio = cfg;
+ }
+
+ ctrl.freq = 1;
+ ctrl.start_bit = 0;
+ ctrl.ack_bit = 1;
+ ctrl.ack_dir0 = 0;
+ ctrl.ack_dir1 = 0;
+ ctrl.ack_dir2 = 0;
+ ctrl.ack_dir3 = 1;
+ ctrl.ack_dir4 = 0;
+ ctrl.ack_dir5 = 0;
+ ctrl.start_stop = 1;
+ ctrl.early_end = 0;
+ ctrl.extra_start = 2;
+ ctrl.switch_dir = 8*3;
+ ctrl.trf_bits = 8*4;
+ reg_ctrl = ctrl;
+ frob(0xac);
+ data.data0 = devspec[1] & 192;
+ data.data1 = addr;
+ data.data2 = devspec[1] | 0x01;
+ reg_data = data;
+ reg_start = 1;
+ bar(100);
+ data = reg_data;
+ baz();
+
+ return data.data3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53144.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53144.c
new file mode 100644
index 000000000..ad94812ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53144.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+typedef unsigned char __attribute__((vector_size(4))) uvec;
+
+int main (int argc, char *argv[]) {
+ int i;
+ int x = 0;
+ uvec uc0 = (uvec) {argc, 1, 2, 10};
+ unsigned char uc1[4] = {0, 3, 2, 200};
+ signed char ucg[4] = {1, 0, 0, 0 };
+ signed char ucl[4] = {0, 1, 0, 1 };
+
+#define uc0_ ((unsigned char *)&uc0)
+
+ for (i = 0; i < 4; i ++) {
+ x |= ucg[i] != (uc0_[i] > uc1[i]);
+ x |= ucl[i] != (uc0_[i] < uc1[i]);
+ }
+ return x;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53168.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53168.c
new file mode 100644
index 000000000..0b9a8dce6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53168.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+
+int a, b, c;
+unsigned *d;
+int e[1];
+void fn1 ();
+int fn2 ();
+int
+fn3 ()
+{
+ int *f = &a;
+ if (fn2 ())
+ {
+ for (; c; c++)
+ {
+ e[a] && (b = 0);
+ fn1 ();
+ if (e[a])
+ return 0;
+ }
+ for (; c <= 0; c++)
+ for (;;)
+ ;
+ }
+ else
+ e[0] = 0 != (d = f);
+ return *d;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53272-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53272-1.c
new file mode 100644
index 000000000..a8fc91cb5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53272-1.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-additional-sources "pr53272-2.c" } */
+struct rtc_class_ops {
+ int (*f)(void *, unsigned int enabled);
+};
+
+struct rtc_device
+{
+ void *owner;
+ const struct rtc_class_ops *ops;
+ int ops_lock;
+};
+
+__attribute__ ((__noinline__, __noclone__))
+extern int foo(void *);
+__attribute__ ((__noinline__, __noclone__))
+extern void foobar(void *);
+
+__attribute__ ((__noinline__, __noclone__))
+int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
+{
+ int err;
+ asm volatile ("");
+
+ err = foo(&rtc->ops_lock);
+
+ if (err)
+ return err;
+
+ if (!rtc->ops)
+ err = -19;
+ else if (!rtc->ops->f)
+ err = -22;
+ else
+ err = rtc->ops->f(rtc->owner, enabled);
+
+ foobar(&rtc->ops_lock);
+ return err;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53272-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53272-2.c
new file mode 100644
index 000000000..f5065a785
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53272-2.c
@@ -0,0 +1,39 @@
+__attribute__ ((__noinline__, __noclone__))
+int foo(void *x)
+{
+ asm ("");
+ return *(int *) x != 42;
+}
+
+__attribute__ ((__noinline__, __noclone__))
+void foobar(void *x)
+{
+ asm ("");
+ if (foo(x))
+ __builtin_abort();
+}
+
+struct rtc_class_ops {
+ int (*f)(void *, unsigned int enabled);
+};
+
+struct rtc_device
+{
+ void *owner;
+ struct rtc_class_ops *ops;
+ int ops_lock;
+};
+
+extern __attribute__ ((__noinline__, __noclone__))
+int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int);
+
+int main(void)
+{
+ struct rtc_class_ops ops = {(void *) 0};
+ struct rtc_device dev1 = {0, &ops, 42};
+
+ if (rtc_update_irq_enable (&dev1, 1) != -22)
+ __builtin_abort ();
+
+ __builtin_exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53366-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53366-1.c
new file mode 100644
index 000000000..d70eae821
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53366-1.c
@@ -0,0 +1,71 @@
+/* PR tree-optimization/53366 */
+/* { dg-do run { target { size32plus } } } */
+/* { dg-require-effective-target size32plus } */
+
+extern void abort (void);
+
+struct S { double v[3]; };
+struct T { struct S r, i; };
+struct U { struct T j[5]; };
+
+void
+foo (struct U *__restrict p1, struct U *__restrict p2,
+ struct S l1, struct S l2, struct S l3, struct S l4,
+ const double _Complex * __restrict x, int y, int z)
+{
+ int i, j;
+ while (y < z - 2)
+ {
+ for (j = 0; j < 5; ++j)
+ {
+ double a = __real__ x[5 * y + j];
+ double b = __imag__ x[5 * y + j];
+ double c = __real__ x[5 * (y + 2) + j];
+ double d = __imag__ x[5 * (y + 2) + j];
+ double e = __real__ x[5 * (y + 1) + j];
+ double f = __imag__ x[5 * (y + 1) + j];
+ double g = __real__ x[5 * (y + 3) + j];
+ double h = __imag__ x[5 * (y + 3) + j];
+ for (i = 0; i < 3; ++i)
+ {
+ p1->j[j].r.v[i] += l2.v[i] * a;
+ p1->j[j].r.v[i] += l4.v[i] * c;
+ p1->j[j].i.v[i] += l2.v[i] * b;
+ p1->j[j].i.v[i] += l4.v[i] * d;
+ p2->j[j].r.v[i] += l3.v[i] * e;
+ p2->j[j].r.v[i] += l1.v[i] * g;
+ p2->j[j].i.v[i] += l3.v[i] * f;
+ p2->j[j].i.v[i] += l1.v[i] * h;
+ }
+ }
+ y += 4;
+ }
+}
+
+_Complex double x[5005];
+struct U p1, p2;
+
+int
+main ()
+{
+ int i, j;
+ struct S l1, l2, l3, l4;
+ for (i = 0; i < 5005; ++i)
+ x[i] = i + 1.0iF * (2 * i);
+ for (i = 0; i < 3; ++i)
+ {
+ l1.v[i] = 1;
+ l2.v[i] = 2;
+ l3.v[i] = 3;
+ l4.v[i] = 4;
+ }
+ foo (&p1, &p2, l1, l2, l3, l4, x, 5, 1000);
+ for (j = 0; j < 5; ++j)
+ for (i = 0; i < 3; ++i)
+ if (p1.j[j].r.v[i] != 3752430 + j * 1494.0
+ || p1.j[j].i.v[i] != p1.j[j].r.v[i] * 2
+ || p2.j[j].r.v[i] != 2502450 + j * 996.0
+ || p2.j[j].i.v[i] != p2.j[j].r.v[i] * 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53366-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53366-2.c
new file mode 100644
index 000000000..6be6a5610
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53366-2.c
@@ -0,0 +1,43 @@
+/* PR tree-optimization/53366 */
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct T { float r[3], i[3]; };
+struct U { struct T j[2]; };
+
+void __attribute__ ((noinline))
+foo (struct U *__restrict y, const float _Complex *__restrict x)
+{
+ int i, j;
+ for (j = 0; j < 2; ++j)
+ {
+ float a = __real__ x[j];
+ float b = __imag__ x[j];
+ float c = __real__ x[j + 2];
+ float d = __imag__ x[j + 2];
+ for (i = 0; i < 3; ++i)
+ {
+ y->j[j].r[i] = y->j[j].r[i] + a + c;
+ y->j[j].i[i] = y->j[j].i[i] + b + d;
+ }
+ }
+}
+
+_Complex float x[4];
+struct U y;
+
+int
+main ()
+{
+ int i, j;
+ for (i = 0; i < 4; ++i)
+ x[i] = i + 1.0iF * (2 * i);
+ foo (&y, x);
+ for (j = 0; j < 2; ++j)
+ for (i = 0; i < 3; ++i)
+ if (y.j[j].r[i] != __real__ (x[j] + x[j + 2])
+ || y.j[j].i[i] != __imag__ (x[j] + x[j + 2]))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53390.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53390.c
new file mode 100644
index 000000000..72a25c52e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53390.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+extern unsigned short var1;
+extern int var2;
+
+extern struct {
+ int f1;
+ unsigned short *f2;
+} *my_table;
+
+void foo(void)
+{
+ unsigned short *local_vec
+ = __builtin_malloc(var1 * var2 * sizeof(unsigned short));
+ unsigned short i;
+
+ my_table[0].f2 = __builtin_malloc(var1 * sizeof(unsigned short));
+
+ for (i = 0; i < var1; ++i)
+ my_table[0].f2[i] = local_vec[i * var2];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53408.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53408.c
new file mode 100644
index 000000000..25c6dc7f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53408.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+int a, b, c, d, e;
+void
+fn1 ()
+{
+ int f, g;
+ char h = 0;
+ b = 0;
+ for (; b < 32; b++)
+ {
+ g = h > e ? h : h << 1;
+ f = g && a ? 0 : 1;
+ h = 1;
+ for (; h > 0; h = h + 1)
+ c = 0 < h | f;
+ }
+ if (h)
+ d = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53501.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53501.c
new file mode 100644
index 000000000..36e3ae61e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53501.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int e[100], n, here;
+
+void __attribute__((noinline))
+foo(void)
+{
+ int i, k = 0;
+ for (i = 0; i < n; ++i) { e[k] = 10; ++k; e[k] = 10; ++k; }
+ for (i = 0; i < k; ++i) here = 1;
+ if (here != 1)
+ abort ();
+}
+
+int main(void)
+{
+ n = 10;
+ foo();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53516.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53516.c
new file mode 100644
index 000000000..7f8094d19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53516.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-ftree-vectorize -ftree-loop-distribute-patterns" } */
+
+extern void abort (void);
+
+struct Foo
+{
+ char a : 1;
+ char b : 7;
+};
+
+struct Foo x[256];
+int y[256];
+
+void __attribute__((noinline,noclone)) bar (int n)
+{
+ int i;
+ for (i = 0; i < n; ++i)
+ {
+ x[i].a = 0;
+ y[i] = 3;
+ }
+}
+
+int main()
+{
+ x[5].b = 7;
+ bar (256);
+ if (x[5].b != 7)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53589.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53589.c
new file mode 100644
index 000000000..5ab78907f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53589.c
@@ -0,0 +1,15 @@
+/* PR rtl-optimization/53589 */
+/* { dg-do compile } */
+
+extern void foo (void) __attribute__ ((__noreturn__));
+
+void
+bar (int x)
+{
+ if (x < 0)
+ foo ();
+ if (x == 0)
+ return;
+ __asm goto ("# %l[lab]" : : : : lab);
+lab:;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-1.c
new file mode 100644
index 000000000..3392ddecb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-1.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+union u
+{
+ int i;
+ _Bool b;
+};
+
+void f(union u * vp, union u v)
+{
+ *vp = v;
+}
+
+int main()
+{
+ union u v;
+ union u v1;
+ union u v2;
+
+ v.i = 10;
+ f(&v1, v);
+
+ v.b = 0;
+ f(&v2, v);
+ if (v2.b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-2.c
new file mode 100644
index 000000000..9589a9e20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-2.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+union u
+{
+ int i;
+ short f;
+} v;
+
+short foo (short *f)
+{
+ *f = 1;
+ v.i = 0;
+ v.f = 0;
+ return *f;
+}
+
+int main()
+{
+ if (foo (&v.f) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-3.c
new file mode 100644
index 000000000..96af5db10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53663-3.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+union u
+{
+ int i;
+ float f;
+} v;
+
+float foo (float *f)
+{
+ *f = 1;
+ v.i = 0;
+ v.f = 0.;
+ return *f;
+}
+
+int main()
+{
+ if (foo (&v.f) != 0.)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53695.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53695.c
new file mode 100644
index 000000000..eba0843c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53695.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-ftracer" } */
+
+void
+foo (const void **p)
+{
+ void *labs[] = { &&l1, &&l2, &&l3 };
+l1:
+ goto *p++;
+l2:
+ goto *p;
+l3:
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53703.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53703.c
new file mode 100644
index 000000000..c9e10abf5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53703.c
@@ -0,0 +1,149 @@
+/* Reduced test case from PR53703. Used to ICE. */
+
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+typedef long unsigned int size_t;
+typedef unsigned short int sa_family_t;
+struct sockaddr {};
+typedef unsigned char __u8;
+typedef unsigned short __u16;
+typedef unsigned int __u32;
+struct nlmsghdr {
+ __u32 nlmsg_len;
+ __u16 nlmsg_type;
+};
+struct ifaddrmsg {
+ __u8 ifa_family;
+};
+enum {
+ IFA_ADDRESS,
+ IFA_LOCAL,
+};
+enum {
+ RTM_NEWLINK = 16,
+ RTM_NEWADDR = 20,
+};
+struct rtattr {
+ unsigned short rta_len;
+ unsigned short rta_type;
+};
+struct ifaddrs {
+ struct ifaddrs *ifa_next;
+ unsigned short ifa_flags;
+};
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+struct nlmsg_list {
+ struct nlmsg_list *nlm_next;
+ int size;
+};
+struct rtmaddr_ifamap {
+ void *address;
+ void *local;
+ int address_len;
+ int local_len;
+};
+int usagi_getifaddrs (struct ifaddrs **ifap)
+{
+ struct nlmsg_list *nlmsg_list, *nlmsg_end, *nlm;
+ size_t dlen, xlen, nlen;
+ int build;
+ for (build = 0; build <= 1; build++)
+ {
+ struct ifaddrs *ifl = ((void *)0), *ifa = ((void *)0);
+ struct nlmsghdr *nlh, *nlh0;
+ uint16_t *ifflist = ((void *)0);
+ struct rtmaddr_ifamap ifamap;
+ for (nlm = nlmsg_list; nlm; nlm = nlm->nlm_next)
+ {
+ int nlmlen = nlm->size;
+ for (nlh = nlh0;
+ ((nlmlen) >= (int)sizeof(struct nlmsghdr)
+ && (nlh)->nlmsg_len >= sizeof(struct nlmsghdr)
+ && (nlh)->nlmsg_len <= (nlmlen));
+ nlh = ((nlmlen) -= ( (((nlh)->nlmsg_len)+4U -1) & ~(4U -1) ),
+ (struct nlmsghdr*)(((char*)(nlh))
+ + ( (((nlh)->nlmsg_len)+4U -1)
+ & ~(4U -1) ))))
+ {
+ struct ifinfomsg *ifim = ((void *)0);
+ struct ifaddrmsg *ifam = ((void *)0);
+ struct rtattr *rta;
+ sa_family_t nlm_family = 0;
+ uint32_t nlm_scope = 0, nlm_index = 0;
+ memset (&ifamap, 0, sizeof (ifamap));
+ switch (nlh->nlmsg_type)
+ {
+ case RTM_NEWLINK:
+ ifim = (struct ifinfomsg *)
+ ((void*)(((char*)nlh)
+ + ((0)+( ((((int)
+ ( ((sizeof(struct nlmsghdr))+4U -1)
+ & ~(4U -1) )))+4U -1)
+ & ~(4U -1) ))));
+ case RTM_NEWADDR:
+ ifam = (struct ifaddrmsg *)
+ ((void*)(((char*)nlh)
+ + ((0)+( ((((int)
+ ( ((sizeof(struct nlmsghdr))+4U -1)
+ & ~(4U -1) )))+4U -1)
+ & ~(4U -1) ))));
+ nlm_family = ifam->ifa_family;
+ if (build)
+ ifa->ifa_flags = ifflist[nlm_index];
+ break;
+ default:
+ continue;
+ }
+ if (!build)
+ {
+ void *rtadata = ((void*)(((char*)(rta))
+ + (( ((sizeof(struct rtattr))+4 -1)
+ & ~(4 -1) ) + (0))));
+ size_t rtapayload = ((int)((rta)->rta_len)
+ - (( ((sizeof(struct rtattr))+4 -1)
+ & ~(4 -1) ) + (0)));
+ switch (nlh->nlmsg_type)
+ {
+ case RTM_NEWLINK:
+ break;
+ case RTM_NEWADDR:
+ if (nlm_family == 17)
+ break;
+ switch (rta->rta_type)
+ {
+ case IFA_ADDRESS:
+ ifamap.address = rtadata;
+ ifamap.address_len = rtapayload;
+ case IFA_LOCAL:
+ ifamap.local = rtadata;
+ }
+ }
+ }
+ if (nlh->nlmsg_type == RTM_NEWADDR && nlm_family != 17)
+ {
+ if (!ifamap.local)
+ {
+ ifamap.local = ifamap.address;
+ ifamap.local_len = ifamap.address_len;
+ }
+ if (!ifamap.address)
+ {
+ ifamap.address = ifamap.local;
+ }
+ if (ifamap.address_len != ifamap.local_len
+ || (ifamap.address != ((void *)0)
+ && memcmp (ifamap.address, ifamap.local,
+ ifamap.address_len)))
+ {
+ if (!build)
+ dlen += (((ifa_sa_len (nlm_family,
+ ifamap.address_len))+4U -1)
+ & ~(4U -1) );
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53790.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53790.c
new file mode 100644
index 000000000..0abd3dd83
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53790.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+typedef struct s {
+ int value;
+} s_t;
+
+static inline int
+read(s_t const *var)
+{
+ return var->value;
+}
+
+int main()
+{
+ extern union u extern_var;
+ return read((s_t *)&extern_var);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53908.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53908.c
new file mode 100644
index 000000000..e96b63522
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53908.c
@@ -0,0 +1,288 @@
+/* { dg-do run } */
+/* SEGV at comment below. */
+typedef unsigned int size_t;
+typedef enum har {
+ he_fatal = (-199),
+ he_not_initialized,
+ he_bad_input,
+ he_memory_too_small,
+ he_bad_action,
+ he_duplicate,
+ he_bad_nonce,
+ he_stale_nonce,
+ he_bad_credentials,
+ he_bad_user,
+ he_no_such_user,
+ he_bad_passwd,
+ he_unknown_auth_scheme,
+ he_not_found,
+ he_failed_digest_file_check,
+ he_failed_digest_file_save,
+ he_process_not_privileged,
+ he_other,
+ he_end_of_range,
+ ha_no_error = 0,
+ ha_no_value = 1
+} har;
+typedef enum realm_type
+{
+ axis_realm = 0,
+ ws_realm
+} realm_type;
+
+__attribute__((__noclone__, __noinline__))
+har has_www_auth(char *, size_t, realm_type, har);
+
+__attribute__((__noclone__, __noinline__))
+har has_auth_user(const char *, const char *, realm_type, char *, size_t);
+
+__attribute__((__noclone__, __noinline__))
+char *ha_get_string_value(void);
+
+typedef struct
+{
+ unsigned int track_id;
+ char* user;
+ char* realm;
+ char* authent;
+ int internal_realm;
+} request;
+enum user_response {
+ file_not_found_user_response = -3,
+ access_denied_user_response = -2,
+ no_user_response = -1,
+ ok_user_response = 0
+};
+struct realm_group {
+ char *name;
+ int id;
+ struct realm_group *next;
+};
+struct realm {
+ char *name;
+ char *space;
+ struct realm_group *groups;
+ struct realm *next;
+};
+struct user_info {
+ char *name;
+ int no_groups;
+ int groups[128];
+ struct user_info *next;
+};
+static struct user_info *find_user(const char *user_name);
+static int is_member_of_groups(const struct user_info *user_item,
+ const struct realm_group *groups);
+int authent_author(request *req);
+struct realm *realms = ((void *)0);
+struct user_info *users = ((void *)0);
+static struct user_info*
+find_user(const char *user_name)
+{
+ struct user_info *user_item;
+ user_item = users;
+ while (user_item != ((void *)0)) {
+ /* SEGV due to NULL access here on user_name. See also comment below. */
+ if ((__builtin_strcmp(user_item->name, user_name) == 0))
+ break;
+ user_item = user_item->next;
+ }
+ return user_item;
+}
+static int
+is_member_of_groups(const struct user_info *user_item,
+ const struct realm_group *groups)
+{
+ const struct realm_group *group_item;
+ int i;
+ group_item = groups;
+ while (group_item != ((void *)0)) {
+ for (i = 0; i < user_item->no_groups; i++)
+ if (user_item->groups[i] == group_item->id)
+ return 0;
+ group_item = group_item->next;
+ }
+ return -1;
+}
+char *foo (void) __attribute__((__noclone__, __noinline__));
+char* g_strdup (const char *str) __attribute__((__malloc__, __noclone__, __noinline__));
+int g_strcmp0 (const char *str1, const char *str2);
+static int
+is_basic(char **user)
+{
+ char *passwd_ptr;
+ char *authent = foo();
+ passwd_ptr = __builtin_strchr(authent, ':');
+ if (passwd_ptr != ((void *)0)) {
+ *user = g_strdup(authent);
+ return 0;
+ }
+ return -1;
+}
+static int
+is_digest(char **user)
+{
+ int ret_val = -1;
+ char *authent;
+ authent = ha_get_string_value();
+ if (authent) {
+ *user = g_strdup(authent);
+ ret_val = 0;
+ }
+ return ret_val;
+}
+__attribute__((__noclone__, __noinline__))
+void g_free (void * mem);
+static enum user_response
+get_user_info_from_header(const realm_type type,
+ char **user_name,
+ struct user_info **user_item)
+{
+ int ret_val = no_user_response;
+ if ((type == ws_realm)) {
+ if (is_basic(user_name) == 0)
+ ret_val = access_denied_user_response;
+ if (is_digest(user_name) == 0)
+ ret_val = ok_user_response;
+ } else {
+ if (is_basic(user_name) < 0 &&
+ /* Load of *user_name here, but not after the is_digest call. */
+ is_digest(user_name) < 0)
+ ;
+ else if ((*user_item = find_user(*user_name)) != ((void *)0))
+ ret_val = ok_user_response;
+ else
+ ret_val = access_denied_user_response;
+ if (ret_val != ok_user_response)
+ g_free(*user_name);
+ }
+ return ret_val;
+}
+static enum user_response
+authenticate_user(request *req,
+ char **user_name,
+ struct user_info **user_item)
+{
+ char *authent = ((void *)0);
+ har resp = ha_no_value;
+ enum user_response user_resp;
+ int ret_val = no_user_response;
+ if (req->authent && __builtin_strlen(req->authent)) {
+ authent = req->authent;
+ user_resp = get_user_info_from_header(req->internal_realm,
+ user_name,
+ user_item);
+ if (user_resp == ok_user_response) {
+ resp = has_auth_user(authent, 0, req->internal_realm, "", 1);
+ if (resp == ha_no_error)
+ ret_val = ok_user_response;
+ else if (resp != he_stale_nonce)
+ ret_val = access_denied_user_response;
+ } else if (user_resp == access_denied_user_response)
+ ret_val = access_denied_user_response;
+ }
+ if (resp != he_memory_too_small && resp != ha_no_error)
+ resp = has_www_auth("", 1, req->internal_realm, resp);
+ return ret_val;
+}
+
+int __attribute__ ((__noinline__, __noclone__))
+authent_author(request *req)
+{
+ struct realm *realm;
+ char *user_name = ((void *)0);
+ struct user_info *user_item = ((void *)0);
+ int res = 0;
+ asm ("");
+ realm = realms;
+ if (__builtin_strcmp("Wsd", realm->name) == 0) {
+ req->internal_realm = ws_realm;
+ is_digest(&user_name);
+ }
+ if (authenticate_user(req, &user_name, &user_item) < 0) {
+ if (user_name != ((void *)0))
+ req->user = user_name;
+ res = -2;
+ goto authent_author_return;
+ }
+ if (is_member_of_groups(user_item, realm->groups) < 0)
+ res = -1;
+authent_author_return:
+ return res;
+}
+
+int good0, good1, good2;
+
+__attribute__ ((__noinline__, __noclone__))
+char *foo(void)
+{
+ asm ("");
+ good0++;
+ return "";
+}
+
+__attribute__ ((__noinline__, __noclone__))
+char *ha_get_string_value(void)
+{
+ asm ("");
+ good1++;
+ return "f";
+}
+
+__attribute__ ((__noinline__, __noclone__))
+har has_auth_user(const char *a, const char *b, realm_type c, char *d, size_t e)
+{
+ asm ("");
+ if (*a != 'z' || a[1] != 0 || b != 0 || c != axis_realm || *d != 0
+ || e != 1)
+ __builtin_abort ();
+ return ha_no_error;
+}
+
+__attribute__ ((__noinline__, __noclone__))
+har has_www_auth(char *a, size_t b, realm_type c, har d)
+{
+ (void)(*a+b+c+d);
+ asm ("");
+ __builtin_abort ();
+}
+
+
+char *strdupped_user = "me";
+__attribute__((__malloc__, __noclone__, __noinline__))
+char* g_strdup (const char *str)
+{
+ asm ("");
+ if (*str != 'f')
+ __builtin_abort ();
+ good2++;
+ return strdupped_user;
+}
+
+__attribute__((__noclone__, __noinline__))
+void g_free (void * mem)
+{
+ (void)mem;
+ asm ("");
+ __builtin_abort ();
+}
+
+struct user_info me = { .name = "me", .no_groups = 1, .groups = {42}, .next = 0};
+struct user_info you = { .name = "you", .next = &me};
+struct realm_group xgroups = { .name = "*", .id = 42, .next = 0};
+
+int main(void)
+{
+ char *orig_user = "?";
+ struct realm r = { .name = "x", .space = "space?", .groups = &xgroups, .next = 0};
+ request req = { .user = orig_user, .realm = "!", .authent = "z",
+ .internal_realm = axis_realm};
+ realms = &r;
+ users = &you;
+ if (authent_author (&req) != 0 || good0 != 1 || good1 != 1 || good2 != 1
+ || req.user != orig_user
+ || req.internal_realm != axis_realm)
+ __builtin_abort ();
+ __builtin_exit (0);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53922.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53922.c
new file mode 100644
index 000000000..d385587e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr53922.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-require-weak "" } */
+/* { dg-skip-if "No undefined" { *-*-mingw* } { "*" } { "" } } */
+/* { dg-skip-if "No undefined weak" { *-*-aix* } { "*" } { "" } } */
+/* { dg-skip-if "No undefined weak" { hppa*-*-hpux* && { ! lp64 } } { "*" } { "" } } */
+/* { dg-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */
+
+int x(int a)
+{
+ return a;
+}
+int y(int a) __attribute__ ((weak));
+int g = 0;
+int main()
+{
+ int (*scan_func)(int);
+ if (g)
+ scan_func = x;
+ else
+ scan_func = y;
+
+ if (scan_func)
+ g = scan_func(10);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54027.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54027.c
new file mode 100644
index 000000000..b5568f437
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54027.c
@@ -0,0 +1,9 @@
+/* { dg-do run } */
+
+int main (void)
+{
+ int x = 1;
+ while (x)
+ x <<= 1;
+ return x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54098.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54098.c
new file mode 100644
index 000000000..74398b689
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54098.c
@@ -0,0 +1,72 @@
+/* { dg-do compile } */
+
+extern int printf(const char *, ...);
+struct list_head {
+ struct list_head *next, *prev;
+};
+struct resource {
+ unsigned long long start;
+ unsigned long long end;
+ unsigned long flags;
+ struct resource *parent, *sibling, *child;
+};
+struct pci_dev {
+ struct list_head bus_list;
+ struct resource resource[12];
+};
+struct pci_bus {
+ struct list_head devices;
+ unsigned char secondary;
+ unsigned char subordinate;
+};
+struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n);
+static struct resource *find_free_bus_resource(struct pci_bus *bus, unsigned long type) {
+ int i;
+ struct resource *r;
+ unsigned long type_mask = 0x00000100 | 0x00000200 | 0x00002000;
+ for (i = 0; (r = pci_bus_resource_n(bus, i)) || i < 4; i++) {
+ if (r && (r->flags & type_mask) == type && !r->parent) return r;
+ }
+ return ((void *)0);
+}
+static unsigned long long calculate_memsize(unsigned long long size, unsigned long long min_size, unsigned long long size1, unsigned long long old_size, unsigned long long align) {
+ if (old_size == 1 ) old_size = 0;
+ if (size < old_size) size = old_size;
+ return size;
+}
+void pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long type, unsigned long long min_size, unsigned long long add_size, void *realloc_head) {
+ struct pci_dev *dev;
+ unsigned long long min_align, align, size, size0, size1;
+ int order;
+ struct resource *b_res = find_free_bus_resource(bus, type);
+ unsigned long long children_add_size = 0;
+ if (!b_res) return;
+ for (dev = ({
+ const typeof( ((typeof(*dev) *)0)->bus_list ) *__mptr = ((&bus->devices)->next);
+ (typeof(*dev) *)( (char *)__mptr - __builtin_offsetof(typeof(*dev),bus_list) );
+ }
+ );
+ &dev->bus_list != (&bus->devices);
+ dev = ({
+ const typeof( ((typeof(*dev) *)0)->bus_list ) *__mptr = (dev->bus_list.next);
+ (typeof(*dev) *)( (char *)__mptr - __builtin_offsetof(typeof(*dev),bus_list) );
+ }
+ )) {
+ int i;
+ for (i = 0; i < 12; i++) {
+ struct resource *r = &dev->resource[i];
+ unsigned long long r_size;
+ if (r->parent || (r->flags & mask) != type) continue;
+ r_size = r->end - r->start + 1;
+ if (order > 11) {
+ printf("%d: %pR %#llx\n", i, r, (unsigned long long) align);
+ }
+ size += r_size;
+ }
+ }
+ if (children_add_size > add_size) add_size = children_add_size;
+ size1 = (!realloc_head || (realloc_head && !add_size)) ? size0 : calculate_memsize(size, min_size+add_size, 0, b_res->end - b_res->start + 1, min_align);
+ if (!size0 && !size1) {
+ printf("%pR %02x-%02x\n", b_res, bus->secondary, bus->subordinate);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54109.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54109.c
new file mode 100644
index 000000000..d4d05263d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54109.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+typedef struct
+{
+ unsigned long bits[4];
+} nodemask_t;
+
+struct cpuset
+{
+ long flags;
+ nodemask_t mems_allowed;
+ struct cpuset *parent;
+} b;
+
+void func1(unsigned long *p1, int p2)
+{
+ p1[p2 - 1] = 0;
+}
+
+void func2(nodemask_t *p1, int p2)
+{
+ func1(p1->bits, p2);
+}
+
+void func3(void)
+{
+ /* This accesses b.flags. */
+ func2(&b.mems_allowed, 0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54127.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54127.c
new file mode 100644
index 000000000..4f64998af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54127.c
@@ -0,0 +1,16 @@
+/* PR rtl-optimization/54127 */
+/* { dg-do compile } */
+
+extern void foo (void) __attribute__ ((__noreturn__));
+
+void
+bar (int x)
+{
+ if (x < 0)
+ foo ();
+ if (x == 0)
+ return;
+ __asm goto ("# %l[lab] %l[lab2]" : : : : lab, lab2);
+lab:;
+lab2:;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54132.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54132.c
new file mode 100644
index 000000000..97bc01caf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54132.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+
+extern void abort (void);
+void foo(char *p, int n)
+{
+ int i;
+ for (i = 1; i < n; i++)
+ p[i] = p[i - 1];
+}
+int main()
+{
+ char a[1024];
+ a[0] = 1;
+ foo (a, 1024);
+ if (a[1023] != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54261-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54261-1.c
new file mode 100644
index 000000000..571727b0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54261-1.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-additional-options "-DSYNC_FALLBACK" { target { ! cas_int } } } */
+
+#ifdef SYNC_FALLBACK
+/* The SYNC_FALLBACK code is just so we don't have to restrict this test
+ to any subset of targets. For targets with no atomics support at
+ all, the cas_int effective-target is false and the fallback provides
+ a PASS. Where the bug trigs (at the time this test-case was added),
+ cas_int is also false but the fallback isn't used. */
+__attribute__((__noinline__, __noclone__))
+int
+# if __INT_MAX__ == 0x7fff
+ __sync_fetch_and_add_2
+# else
+ __sync_fetch_and_add_4
+# endif
+ (int *at, int val)
+{
+ int tmp = *at;
+ asm ("");
+ *at = tmp + val;
+ return tmp;
+}
+#endif
+
+__attribute__((__noinline__, __noclone__))
+void g (int *at, int val)
+{
+ asm ("");
+ __sync_fetch_and_add (at, val);
+}
+
+int main(void)
+{
+ int x = 41;
+ int a = 1;
+ g (&x, a);
+
+ if (x != 42)
+ __builtin_abort ();
+ __builtin_exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54327.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54327.c
new file mode 100644
index 000000000..fe7499aab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54327.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+#include <string.h>
+#include <stdlib.h>
+void treathead ()
+{
+ char *a = ';' == '\0' ? : 0;
+ if (*a == '=')
+ {
+ while (*a == (*a == 0) || *a == '\'')
+ a++;
+ if (strlen (a) < 2)
+ abort ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54409.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54409.c
new file mode 100644
index 000000000..c7595474f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54409.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+
+int b;
+
+struct S
+{
+ char *p;
+ struct {
+ } s;
+ int a;
+};
+
+static _Bool
+fn2 (int *p1)
+{
+ if (b)
+ {
+ struct S *c = (struct S *) &p1;
+ return c->a;
+ }
+}
+
+_Bool
+fn3 (struct S *p1)
+{
+ if (fn2 ((int *) &p1->s))
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54436.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54436.c
new file mode 100644
index 000000000..4bce32409
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54436.c
@@ -0,0 +1,38 @@
+/* PR target/54436 */
+/* { dg-do assemble } */
+
+#if __SIZEOF_SHORT__ == 2 && __SIZEOF_LONG_LONG__ == 8
+static inline unsigned short
+baz (unsigned short *x)
+{
+ union U { unsigned short a; unsigned char b[2]; } u = { *x };
+ u.b[0] = ((u.b[0] * 0x0802ULL & 0x22110ULL)
+ | (u.b[0] * 0x8020ULL & 0x88440ULL)) * 0x10101ULL >> 16;
+ u.b[1] = ((u.b[1] * 0x0802ULL & 0x22110ULL)
+ | (u.b[1] * 0x8020ULL & 0x88440ULL)) * 0x10101ULL >> 16;
+ unsigned char t = u.b[0];
+ u.b[0] = u.b[1];
+ u.b[1] = t;
+ return u.a;
+}
+
+static inline unsigned long long
+bar (unsigned long long *x)
+{
+ union U { unsigned long long a; unsigned short b[4]; } u = { *x };
+ u.b[0] = baz (&u.b[0]);
+ return u.a;
+}
+
+void
+foo (void)
+{
+ unsigned long long l = -1ULL;
+ __asm volatile ("" : : "r" (bar (&l)));
+}
+#else
+void
+foo (void)
+{
+}
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54458.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54458.c
new file mode 100644
index 000000000..3d2e12fc2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54458.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+unsigned int a, b, c;
+
+void
+foo (unsigned int x)
+{
+ do
+ {
+ if (a == 0 ? 1 : 1 % a)
+ for (; b; b--)
+ lab:;
+ else
+ while (x)
+ ;
+ if (c)
+ goto lab;
+ }
+ while (1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54520.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54520.c
new file mode 100644
index 000000000..5884b2f35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54520.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+char *a;
+void
+fn1 ()
+{
+ char *p = a;
+ while (p && *p != '\0')
+ {
+ while (*p == '\t')
+ *p++ = '\0';
+ if (*p != '\0')
+ p = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54824.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54824.c
new file mode 100644
index 000000000..82b822b09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54824.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+void __attribute__((noreturn)) bar(void)
+{
+}
+
+void foo(int i, char *p, char *q)
+{
+ while (*p++) {
+ if (i)
+ p++;
+ if (!*q++)
+ bar();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54877.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54877.c
new file mode 100644
index 000000000..cee406e50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54877.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/54877 */
+/* { dg-do run } */
+/* { dg-options "-ffast-math" } */
+
+extern void abort (void);
+
+int
+foo (void)
+{
+ double d;
+ int i;
+ for (i = 0, d = 0; i < 64; i++)
+ d--;
+ return (int) d;
+}
+
+int
+main ()
+{
+ if (foo () != -64)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54894.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54894.c
new file mode 100644
index 000000000..f243ec788
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54894.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target size32plus } */
+
+typedef unsigned long long uint64_t;
+
+#define n 4096
+double A[n][n] __attribute__((aligned(16)));
+double B[n][n] __attribute__((aligned(16)));
+double C[n][n] __attribute__((aligned(16)));
+
+#define tilesize 128
+
+typedef double adouble __attribute__((__aligned__(16)));
+
+void foo ()
+{
+ int ih, jh, kh, il, kl, jl;
+ for (ih = 0; ih < n; ih += tilesize)
+ for (jh = 0; jh < n; jh += tilesize)
+ for (kh = 0; kh < n; kh += tilesize)
+ for (il = 0; il < tilesize; ++il)
+ {
+ adouble *Ap = (adouble *)&A[ih+il][kh];
+ for (kl = 0; kl < tilesize; ++kl)
+ for (jl = 0; jl < tilesize; ++jl)
+ C[ih+il][jh+jl] += Ap[kl] * B[kh+kl][jh+jl];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54920.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54920.c
new file mode 100644
index 000000000..6b99e9ed2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr54920.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-common" { target { hppa*-*-hpux* } } } */
+
+typedef short __v8hi __attribute__ ((__vector_size__ (16)));
+typedef long long __m128i __attribute__ ((__vector_size__ (16)));
+int a;
+__m128i b;
+
+void
+fn1 ()
+{
+ while (1)
+ b = (__m128i) (__v8hi) { a, 0, 0, 0, 0, 0 };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55011.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55011.c
new file mode 100644
index 000000000..67b2613f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55011.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+char a;
+
+void f(void)
+{
+ char b = 2;
+
+ for(;;)
+ {
+ unsigned short s = 1, *p = &s, *i;
+
+ for(*i = 0; *i < 4; ++*i)
+ if(a | (*p /= (b += !!a)) <= 63739)
+ return;
+
+ if(!s)
+ a = 0;
+
+ for(;;);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55018.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55018.c
new file mode 100644
index 000000000..d459b1ba6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55018.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/55018 */
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+void
+foo (int x)
+{
+ unsigned int a = 0;
+ int b = 3;
+ if (x)
+ b = 0;
+lab:
+ if (x)
+ goto lab;
+ a++;
+ if (b != 2)
+ __builtin_printf ("%u", a);
+ goto lab;
+}
+
+/* { dg-final { scan-tree-dump "printf" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55107.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55107.c
new file mode 100644
index 000000000..2402716be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55107.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+
+typedef unsigned short uint16_t;
+
+uint16_t a, b;
+
+uint16_t f(void)
+{
+ int c, **p;
+ short d = 2, e = 4;
+
+ for (;; b++)
+ {
+ int *j, k = 0;
+
+ for (; *j; j++)
+ {
+ for(; c; c++)
+ for(; k < 1; k++)
+ {
+ short *f = &d;
+
+ if(b)
+ return *f;
+ }
+ }
+
+ if(!c)
+ d *= e;
+
+ ((a = d) ? b = 0 : (**p ? : 1) != (d != 1 ? : (a = 0))) != (k ? a : 0)
+ < (a *= c = k) && (**p = 0);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55111.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55111.c
new file mode 100644
index 000000000..f5b0692c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55111.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+int a, b, c;
+long d;
+unsigned long *e;
+
+int f(void)
+{
+ for(;; a++)
+ {
+ if(c)
+ {
+ for(b = d = 0; b < 1; b++)
+ e = &d;
+
+ --*e;
+
+ if(d > 0)
+ a = 0;
+
+ return d;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55124.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55124.c
new file mode 100644
index 000000000..a8eec984b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55124.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+int a, b;
+long c;
+
+void f2(void)
+{
+ unsigned long k = 1;
+
+ foo(b ? k = 0 : 0);
+
+ b = ((c = b) ? (k ? : (c = 0)) : a) * c;
+}
+
+void f1(void)
+{
+ f2();
+
+ a = b | c;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55238.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55238.c
new file mode 100644
index 000000000..0ace05809
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55238.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+
+typedef void * gzFile;
+typedef struct
+{
+ int mode;
+ int direct;
+ int seek;
+ int err;
+ char *msg;
+}
+gz_state;
+
+void gz_error (gz_state *state, int err, char *msg);
+
+static void
+gz_reset (gz_state *state)
+{
+ if (state->mode == 7247)
+ {
+ state->direct = 1;
+ }
+ state->seek = 0;
+ gz_error (state, 0, 0);
+}
+
+int
+gzbuffer (void *file, int size)
+{
+ gz_state *state;
+ gz_reset (state);
+}
+
+void gz_error (gz_state *state, int err, char *msg)
+{
+ if (state->msg != 0)
+ {
+ if (state->err != -4)
+ foo (state->msg);
+ }
+ if (msg == 0)
+ return;
+ bar (state->msg, msg);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55253.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55253.c
new file mode 100644
index 000000000..9f6491d4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55253.c
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+
+struct
+{
+ int mallocFailed;
+}
+*a;
+
+struct StrAccum
+{
+ int useMalloc;
+}
+b, c;
+
+static void
+fn1 (struct StrAccum *p1, int p2)
+{
+ if (p2 == 0)
+ return;
+ if (p1->useMalloc)
+ a->mallocFailed = 0;
+}
+
+void
+fn2 (struct StrAccum *p1)
+{
+ fn1 (p1, 1);
+}
+
+void
+fn3 (struct StrAccum *p1)
+{
+ fn1 (p1, 1);
+}
+
+void
+fn4 ()
+{
+ c.useMalloc = 1;
+ fn1 (&c, 0);
+}
+
+int
+main ()
+{
+ fn3 (&b);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55270.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55270.c
new file mode 100644
index 000000000..0b7f906d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55270.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+unsigned a, b, c;
+
+void f(void)
+{
+ for(; a; a++)
+ {
+ long *p1 = (long *)&b;
+
+ if(*p1)
+ return;
+
+ if(b && (*p1 = b) || c && ++*p1)
+ {
+ unsigned *p2 = &b;
+
+ for(*p2 = 0; *p2 < 1;)
+ for(; b; b++);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55305.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55305.c
new file mode 100644
index 000000000..fb6144715
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55305.c
@@ -0,0 +1,151 @@
+/* { dg-do run } */
+
+extern void exit (int) __attribute__ ((noreturn));
+extern void abort (void) __attribute__ ((noreturn));
+
+struct t
+{
+ char dummy;
+};
+
+struct m
+{
+ const struct t *t;
+ void (*m)(void);
+};
+
+struct s
+{
+ const struct m *m;
+ void *o;
+};
+
+struct e
+{
+ const struct t *t;
+ void *o;
+};
+
+struct ret
+{
+ struct s s;
+ _Bool b;
+};
+
+const struct t t1 = { 1 };
+const struct t t2 = { 2 };
+const struct t t3 = { 3 };
+const struct t t4 = { 4 };
+const struct t t5 = { 5 };
+
+void
+pass (void)
+{
+ exit (0);
+}
+
+void
+fail (void)
+{
+ abort ();
+}
+
+const struct m m1 = { &t4, fail };
+const struct m m2 = { &t5, pass };
+
+static struct e f2 (struct s s2, void *p);
+static struct e f3 (struct s, void *) __attribute__ ((noinline));
+static void f4 (struct s, void *) __attribute__ ((noinline));
+
+struct ret c (struct s, const struct t *) __attribute__ ((noinline));
+
+struct ret
+c (struct s s1, const struct t *t)
+{
+ struct ret r;
+
+ if (s1.m->t == t)
+ {
+ r.s.m = &m2;
+ r.s.o = s1.o;
+ r.b = 1;
+ }
+ else
+ {
+ r.s.m = 0;
+ r.s.o = 0;
+ r.b = 0;
+ }
+ return r;
+}
+
+void *m (void) __attribute__ ((noinline));
+
+void *
+m (void)
+{
+ return 0;
+}
+
+struct e
+f1 (struct s s1, void *p)
+{
+ struct ret r;
+ void *a;
+ struct s a2;
+
+ r = c (s1, &t5);
+ if (r.b)
+ return f2 (r.s, p);
+ a = m ();
+ a2.m = &m1;
+ a2.o = a;
+ return f2 (a2, p);
+}
+
+static struct e
+f2 (struct s s2, void *p)
+{
+ struct e e1;
+
+ e1 = f3 (s2, p);
+ if (e1.t == &t2 && e1.o == 0)
+ {
+ e1.t = 0;
+ e1.o = 0;
+ }
+ return e1;
+}
+
+static struct e
+f3 (struct s s1, void *p)
+{
+ struct e r;
+
+ f4 (s1, p);
+ r.t = &t3;
+ r.o = 0;
+ return r;
+}
+
+struct s g1;
+void *g2;
+
+static void
+f4 (struct s s1, void *p)
+{
+ g1 = s1;
+ g2 = p;
+ s1.m->m ();
+}
+
+int
+main ()
+{
+ struct s s1;
+
+ s1.m = &m2;
+ s1.o = 0;
+ f1 (s1, 0);
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55481.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55481.c
new file mode 100644
index 000000000..26ba9ff7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55481.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+
+int main()
+{
+ signed char result = 0;
+ int n;
+ for (n = 0; n < 13; ++n)
+ {
+ int tem = result;
+ tem = tem + 31;
+ result = tem;
+ }
+ if (result != -109)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55555.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55555.c
new file mode 100644
index 000000000..9e4226659
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55555.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+
+double s[4] = { 1.0, 2.0, 3.0, 4.0 }, pol_x[2] = { 5.0, 6.0 };
+
+__attribute__((noinline)) int
+foo (void)
+{
+ double coef_x[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ int lxp = 0;
+ if (lxp <= 1)
+ do
+ {
+ double t = pol_x[lxp];
+ long S;
+ long l = lxp * 4L - 1;
+ for (S = 1; S <= 4; S++)
+ coef_x[S + l] = coef_x[S + l] + s[S - 1] * t;
+ }
+ while (lxp++ != 1);
+ asm volatile ("" : : "r" (coef_x) : "memory");
+ for (lxp = 0; lxp < 8; lxp++)
+ if (coef_x[lxp] != ((lxp & 3) + 1) * (5.0 + (lxp >= 4)))
+ __builtin_abort ();
+ return 1;
+}
+
+int
+main ()
+{
+ asm volatile ("" : : : "memory");
+ if (!foo ())
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55633.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55633.c
new file mode 100644
index 000000000..5d30d61a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55633.c
@@ -0,0 +1,39 @@
+/* PR fortran/55633 */
+/* { dg-do run { target int128 } } */
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) void
+bar (__int128_t *x)
+{
+ int c = sizeof (__int128_t) * __CHAR_BIT__;
+ if (c > 127)
+ c = 127;
+ if (*x != c)
+ abort ();
+}
+
+__attribute__((noinline)) void
+foo (void)
+{
+ __int128_t m, ma;
+ ma = 0;
+ m = 0;
+ m = ~m;
+ do
+ {
+ if (m == 0 || ma > 126)
+ break;
+ ma = ma + 1;
+ m = ((__uint128_t) m) >> 1;
+ }
+ while (1);
+ bar (&ma);
+}
+
+int
+main ()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55684.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55684.c
new file mode 100644
index 000000000..7002a3737
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55684.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+
+typedef struct _IO_FILE FILE;
+unsigned long int strtoul(const char *, char **, int);
+char *fgets(char *, int, FILE *);
+struct ihexrec {
+ unsigned char reclen;
+ unsigned char data[256];
+};
+static void srec_readrec(struct ihexrec * srec, char * rec)
+{
+ int i, j;
+ char buf[8];
+ int offset = 0, len;
+ char * e;
+ for (i=0; j<srec->reclen; j++)
+ {
+ if (offset+2 > len)
+ return;
+ for (i=0; i<2; i++)
+ buf[i] = rec[offset++];
+ srec->data[j] = strtoul(buf, &e, 16);
+ }
+ for (i=0; i<2; i++)
+ buf[i] = rec[offset++];
+}
+void srec2b(FILE *inf)
+{
+ char buffer[256];
+ struct ihexrec srec;
+ while (fgets(buffer,256,inf)!=(void *)0)
+ srec_readrec(&srec, buffer);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55687.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55687.c
new file mode 100644
index 000000000..1eab1a4f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55687.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+typedef struct _IO_FILE FILE;
+typedef short gshort;
+typedef struct _GString GString;
+
+extern char *fgets(char *, int, FILE *);
+
+void verbose_text_loop (void *data)
+{
+ FILE *dev_vcs;
+ char buf[81];
+ GString *buf_str;
+ gshort i, j;
+ while (1)
+ {
+ for (i = 1; i <= 7; i++)
+ {
+ while (fgets (buf, 81, dev_vcs))
+ {
+ for (j = 0; j < __builtin_strlen (buf); j++)
+ if (buf[j] != ' ')
+ break;
+ for (; j < __builtin_strlen (buf); j++)
+ g_string_append_c_inline (buf_str, buf[j]);
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55755.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55755.c
new file mode 100644
index 000000000..3c8bb6ba4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55755.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+struct S4
+{
+ unsigned f0:24;
+} __attribute__((__packed__));
+
+struct S4 g_10 = {
+ 6210831
+};
+
+struct S5
+{
+ int i;
+ struct S4 l_8[2];
+} __attribute__((__packed__));
+
+int a, b;
+
+struct S4 func_2 (int x)
+{
+ struct S5 l = {
+ 0,
+ {{0}, {0}}
+ };
+ l.i = a;
+ g_10 = l.l_8[1];
+ for (; x<2; x++) {
+ struct S4 tmp = {
+ 11936567
+ };
+ l.l_8[x] = tmp;
+ }
+ b = l.i;
+ return g_10;
+}
+
+int main (void)
+{
+ func_2 (0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55862.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55862.c
new file mode 100644
index 000000000..eb8dceb9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55862.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+
+int g, a, *b;
+
+void f(void)
+{
+ int *p;
+
+ if(g)
+ {
+ int **k = &p;
+
+ for(; g; p++)
+ for(a = 0; a < 1; a++)
+ {
+ int *c = p;
+label2:
+ if(a < 1)
+ *c = 0;
+ }
+
+ goto label1;
+
+ while(g++)
+ for(*b = 0; *b; b++)
+ label1:
+ ;
+ }
+
+ goto label2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55882.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55882.c
new file mode 100644
index 000000000..fd2276e7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55882.c
@@ -0,0 +1,94 @@
+/* { dg-do run } */
+
+typedef enum
+{
+ PVT_A = 0,
+ PVT_B = 1,
+ PVT_CONFIG = 2,
+ PVT_RESERVED3 = 3,
+} T_CR_SELECT;
+
+typedef enum
+{
+ STD_ULOGIC_0 = 0,
+ STD_ULOGIC_1 = 1,
+} STD_ULOGIC;
+
+typedef struct
+{
+ unsigned char rtp : 3;
+ unsigned char rtn : 3;
+} C;
+
+typedef struct
+{
+ unsigned char nd;
+ unsigned char pd;
+ unsigned char rtn;
+ unsigned char rtp;
+} A;
+
+typedef struct
+{
+ unsigned short reserved : 14;
+ unsigned char Z_rx_enable : 2;
+ A pvt;
+} B;
+
+typedef struct
+{
+ B cr_dsclk_q3;
+ B cr_data_q3;
+ B cr_addr_q3;
+ B cr_cmd_q3;
+ B cr_pres_q3;
+ C cr_vref_q3[6];
+ unsigned char pres_disable;
+ unsigned char pres_drive_high;
+ unsigned char c_enab_120;
+ STD_ULOGIC clk_tximp;
+ STD_ULOGIC dqs_tximp;
+ STD_ULOGIC cmd_tximp;
+ STD_ULOGIC data_tximp;
+ STD_ULOGIC dqs_rxterm;
+ STD_ULOGIC data_rxterm;
+ T_CR_SELECT cr_clk_sel;
+ unsigned char cr_clk : 5;
+ T_CR_SELECT cr_dsclk_odd_sel;
+ unsigned char cr_dsclk_odd : 5;
+ T_CR_SELECT cr_dsclk_even_sel;
+ unsigned char cr_dsclk_even : 5;
+ T_CR_SELECT cr_data_sel;
+ unsigned char cr_data : 5;
+ T_CR_SELECT cr_vref_sel;
+ unsigned char cr_vref : 5;
+ T_CR_SELECT cr_others_sel;
+ unsigned char cr_others : 5;
+} CONFIG;
+
+typedef struct
+{
+ unsigned char enable_monitor;
+ unsigned short step_out_pointer : 12;
+ unsigned short hold_out_pointer : 12;
+ unsigned short enable_wr_dqs : 12;
+ unsigned short use_alt_rd_dqs : 12;
+ CONFIG io_buf;
+} mystruct;
+
+unsigned short __attribute__((noinline,noclone))
+testfunction(unsigned i)
+{
+ mystruct dmfe[8];
+ dmfe[0].use_alt_rd_dqs = 1;
+ dmfe[i].use_alt_rd_dqs = 0;
+ return dmfe[0].use_alt_rd_dqs;
+}
+
+extern void abort (void);
+int main ()
+{
+ if (testfunction(0) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55888.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55888.c
new file mode 100644
index 000000000..e75adcd2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55888.c
@@ -0,0 +1,116 @@
+/* { dg-do compile } */
+
+typedef unsigned _GCC_ATTR_ALIGN_u32t;
+typedef _GCC_ATTR_ALIGN_u32t _Uint32t __attribute__ ((__aligned__ (4)));
+typedef unsigned int _GCC_ATTR_ALIGN_u8t __attribute__ ((__mode__ (__QI__)));
+typedef _GCC_ATTR_ALIGN_u8t _Uint8t __attribute__ ((__aligned__ (1)));
+typedef unsigned _Sizet;
+typedef _Sizet size_t;
+typedef _Uint8t uint8_t;
+typedef _Uint32t uint32_t;
+typedef enum
+{
+ PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_LABEL_REPEATED
+}
+ProtobufCLabel;
+typedef enum
+{
+ PROTOBUF_C_TYPE_INT32, PROTOBUF_C_TYPE_SINT32, PROTOBUF_C_TYPE_SFIXED32,
+ PROTOBUF_C_TYPE_INT64, PROTOBUF_C_TYPE_SINT64, PROTOBUF_C_TYPE_SFIXED64,
+ PROTOBUF_C_TYPE_UINT32, PROTOBUF_C_TYPE_FIXED32, PROTOBUF_C_TYPE_UINT64,
+ PROTOBUF_C_TYPE_FIXED64, PROTOBUF_C_TYPE_FLOAT, PROTOBUF_C_TYPE_DOUBLE,
+ PROTOBUF_C_TYPE_BOOL, PROTOBUF_C_TYPE_ENUM, PROTOBUF_C_TYPE_STRING,
+ PROTOBUF_C_TYPE_BYTES, PROTOBUF_C_TYPE_MESSAGE,
+}
+ProtobufCType;
+typedef struct _ProtobufCBinaryData ProtobufCBinaryData;
+struct _ProtobufCBinaryData
+{
+ size_t len;
+};
+typedef struct _ProtobufCMessageDescriptor ProtobufCMessageDescriptor;
+typedef struct _ProtobufCFieldDescriptor ProtobufCFieldDescriptor;
+typedef struct _ProtobufCMessage ProtobufCMessage;
+struct _ProtobufCFieldDescriptor
+{
+ uint32_t id;
+ ProtobufCLabel label;
+ ProtobufCType type;
+ unsigned offset;
+};
+struct _ProtobufCMessageDescriptor
+{
+ unsigned n_fields;
+ const ProtobufCFieldDescriptor *fields;
+};
+struct _ProtobufCMessage
+{
+ const ProtobufCMessageDescriptor *descriptor;
+};
+typedef enum
+{
+ PROTOBUF_C_WIRE_TYPE_VARINT, PROTOBUF_C_WIRE_TYPE_64BIT,
+ PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED, PROTOBUF_C_WIRE_TYPE_START_GROUP,
+ PROTOBUF_C_WIRE_TYPE_END_GROUP, PROTOBUF_C_WIRE_TYPE_32BIT
+}
+ProtobufCWireType;
+static inline size_t
+uint32_pack (uint32_t value, uint8_t * out)
+{
+ unsigned rv = 0;
+ if (value >= 0x80)
+ {
+ if (value >= 0x80)
+ {
+ value >>= 7;
+ }
+ }
+ out[rv++] = value;
+}
+
+static inline size_t
+binary_data_pack (const ProtobufCBinaryData * bd, uint8_t * out)
+{
+ size_t len = bd->len;
+ size_t rv = uint32_pack (len, out);
+ return rv + len;
+}
+
+static size_t
+required_field_pack (const ProtobufCFieldDescriptor * field,
+ const void *member, uint8_t * out)
+{
+ size_t rv = tag_pack (field->id, out);
+ switch (field->type)
+ {
+ case PROTOBUF_C_TYPE_BYTES:
+ {
+ const ProtobufCBinaryData *bd =
+ ((const ProtobufCBinaryData *) member);
+ out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED;
+ return rv + binary_data_pack (bd, out + rv);
+ }
+ case PROTOBUF_C_TYPE_MESSAGE:
+ {
+ out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED;
+ return rv +
+ prefixed_message_pack (*(ProtobufCMessage * const *) member,
+ out + rv);
+ }
+ }
+}
+
+size_t
+protobuf_c_message_pack (const ProtobufCMessage * message, uint8_t * out)
+{
+ unsigned i;
+ size_t rv = 0;
+ for (i = 0; i < message->descriptor->n_fields; i++)
+ {
+ const ProtobufCFieldDescriptor *field = message->descriptor->fields + i;
+ const void *member = ((const char *) message) + field->offset;
+ if (field->label == PROTOBUF_C_LABEL_REQUIRED)
+ rv += required_field_pack (field, member, out + rv);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-1.c
new file mode 100644
index 000000000..9fd558ea0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+extern void *memmove(void *, void *, __SIZE_TYPE__);
+typedef int (*_TEST_fun_) ();
+static _TEST_fun_ i = (_TEST_fun_) memmove;
+main() { i(); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-2.c
new file mode 100644
index 000000000..a753e573d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-2.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+
+extern void *memcpy();
+main() { memcpy(); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-3.c
new file mode 100644
index 000000000..c7f77be68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55890-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void *memmove ();
+
+void *
+bar ()
+{
+ return memmove ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55964-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55964-2.c
new file mode 100644
index 000000000..a3bd09d5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55964-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-loop-distribution -funswitch-loops" } */
+
+struct test_struct {
+ int a, b[10], c[10], d[10];
+};
+
+extern struct test_struct* new_struct;
+
+void testfunc(struct test_struct* old_struct)
+{
+ int i;
+ for (i = 0; i < 10; ++i)
+ {
+ new_struct->b[i] = old_struct ? old_struct->b[i] : -1;
+ new_struct->c[i] = old_struct ? old_struct->c[i] : 0;
+ new_struct->d[i] = old_struct ? old_struct->d[i] : 0;
+ }
+ if (old_struct)
+ old_struct->a++;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55964.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55964.c
new file mode 100644
index 000000000..361151ccf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr55964.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-loop-distribution -funswitch-loops -w" } */
+
+int a, b;
+
+void f(void)
+{
+lbl1:
+ for(b = 0; b < 1; b++)
+ {
+ int u = 1;
+
+ if((b %= 0) * (b ? 0 : a) - 1 && (u /= 0))
+ {
+ int *q = &u, **k = q;
+ goto lbl1;
+lbl2:
+lbl3:
+ a = **k;
+ goto lbl2;
+ }
+ }
+ goto lbl3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56034.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56034.c
new file mode 100644
index 000000000..f2b5d3784
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56034.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-loop-distribution" } */
+
+int a, b, *p;
+
+void f(void)
+{
+ int *q;
+
+ while(b++)
+ {
+ int i;
+ p = &i;
+ a = *q;
+ }
+
+ if(a)
+ for(;; b++);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56150.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56150.c
new file mode 100644
index 000000000..6de1115a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56150.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+struct {
+ int f4;
+} g1;
+
+long g2;
+
+volatile long g3;
+
+void func_1 ()
+{
+ if (g2)
+ g1 = g1;
+ else
+ g3;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56157.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56157.c
new file mode 100644
index 000000000..796e3235c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56157.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-ftree-vectorize" } */
+
+struct Pixel {
+ unsigned short r;
+ unsigned short g;
+ unsigned short b;
+ unsigned short a;
+};
+
+void fn(unsigned char * __restrict dst, const unsigned char * __restrict src)
+{
+ unsigned x;
+ for(x = 0; x < 1024; x += 1)
+ {
+ struct Pixel pixel;
+ pixel.r = (unsigned short)(((unsigned)src[0]) * 0xffff / 0xff);
+ pixel.g = (unsigned short)(((unsigned)src[1]) * 0xffff / 0xff);
+ pixel.b = (unsigned short)(((unsigned)src[2]) * 0xffff / 0xff);
+ pixel.a = (unsigned short)(((unsigned)src[3]) * 0xffff / 0xff);
+ __builtin_memcpy(dst, &pixel, sizeof pixel);
+ src += 4;
+ dst += 8;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56181.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56181.c
new file mode 100644
index 000000000..c382b29c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56181.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-ftracer" } */
+
+int a, b;
+
+void f(void)
+{
+ if(a++)
+ {
+ for(a = 0; a < 1;)
+ {
+ for(b = 0; b < 1; b++)
+ {
+ while(a++ < 0);
+lbl:
+ ;
+ }
+
+ if(a)
+ goto lbl;
+ }
+
+ goto lbl;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56195.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56195.c
new file mode 100644
index 000000000..d1949fd0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56195.c
@@ -0,0 +1,31 @@
+/* PR rtl-optimization/56195 */
+/* { dg-do assemble } */
+
+int i, a, t, b, c, d, e, f, j, *h;
+
+void
+fn (void)
+{
+ if (b)
+ {
+ int *p, *q;
+ char g;
+
+ if (f++)
+ for (;; e++);
+ lbl:
+ for (b = 0; b < 2; b++)
+ t /= d + 1 ? : i || a < c < (d = f) ? : 1 | (j = 2);
+
+ *p = g >= *q ^ c != a ^ *p;
+
+ if (!e)
+ {
+ q = p;
+ goto lbl;
+ }
+ }
+
+ if (h++)
+ goto lbl;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56264.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56264.c
new file mode 100644
index 000000000..ca5eb47ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56264.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-funswitch-loops" } */
+
+int a, b, c;
+
+void f(void)
+{
+ if(b)
+ {
+ for(a = 0; a < 1; a++)
+ lbl:
+ c = c && b ? : 0;
+
+ c = 0;
+ goto lbl;
+ }
+
+ if(a)
+ goto lbl;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56321.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56321.c
new file mode 100644
index 000000000..a8c463465
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56321.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math" } */
+
+void foo(int n, int nreps, float tdgefa, float tdgesl)
+{
+ float kflops,ops;
+ ops=((2.0*n*n*n)/3.0+2.0*n*n);
+ kflops=2.*nreps*ops/(1000.*(tdgefa+tdgesl));
+
+ __builtin_printf ("%f\n", kflops);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56349.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56349.c
new file mode 100644
index 000000000..dc9ed082b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56349.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+
+int a, b;
+short c;
+
+void f(void)
+{
+ int a = 0;
+ int *k = 0;
+
+ for(; a < 2; a++);
+
+ if(!!(b |= a < 3) - 1)
+ {
+ if(0)
+ for (;; a++)
+ {
+ for (; c; *k = 0);
+lbl1:
+ ;
+ }
+
+ for(; *k; k++)
+ {
+ c = b ? : a;
+
+ if (c)
+ lbl2:
+ b = 0;
+ }
+ goto lbl1;
+ }
+
+ for(;; b++)
+ {
+ if(b)
+ goto lbl2;
+
+ k = &b;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56366.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56366.c
new file mode 100644
index 000000000..15a430048
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56366.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+int a, *c, d;
+unsigned short b;
+short e;
+
+void f(void)
+{
+ for(;; d++)
+ {
+ for(a = -9; a < 63; a++)
+ for(d = 0; d < 9; d++)
+ b -= --e;
+
+ a = b & *c;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56384.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56384.c
new file mode 100644
index 000000000..ef3cf0536
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56384.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+int a, c;
+
+void f(void)
+{
+ unsigned char b;
+
+ if(a)
+ {
+ for(; b < 1; b++);
+lbl1:
+ c = (b |= 0) ^ (b || a);
+ }
+
+ if((a = b))
+ {
+ b = c;
+ goto lbl1;
+ }
+
+ b = 5;
+ goto lbl1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56407.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56407.c
new file mode 100644
index 000000000..f26fd23f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56407.c
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+
+extern void abort(void);
+extern int rand(void);
+
+static void copy(int *r,int *a,int na)
+{
+ int i;
+ for( i = 0 ; i < na ; i++ )
+ r[i] = a[i];
+}
+
+static void foo(int *a,int na)
+{
+ int i;
+ for( i = 0 ; i < na ; i++ )
+ a[i] = rand();
+}
+
+static int cmp(int *a,int *b,int n)
+{
+ int i;
+ for( i = 0 ; i < n ; i++ )
+ if ( a[i] != b[i] )
+ return -1;
+ return 0;
+}
+
+void __attribute__((noinline,noclone))
+test(int sz,int comm)
+{
+ int j,n;
+ int v[64],w[64];
+ for( j = 1 ; j <= sz ; j++ )
+ {
+ n = (2 * j - 1) * (2 * j - 1);
+ foo(w,n);
+ copy(v,w,n);
+ if ( comm )
+ if ( cmp(v,w,n) ) abort ();
+ }
+}
+
+int main()
+{
+ test(2,1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56420.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56420.c
new file mode 100644
index 000000000..6fa1a803d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56420.c
@@ -0,0 +1,37 @@
+/* PR middle-end/56420 */
+/* { dg-do run { target int128 } } */
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) __uint128_t
+foo (__uint128_t x)
+{
+ return x * (((__uint128_t) -1) << 63);
+}
+
+__attribute__((noinline, noclone)) __uint128_t
+bar (__uint128_t x)
+{
+ return x * (((__uint128_t) 1) << 63);
+}
+
+__attribute__((noinline, noclone)) __uint128_t
+baz (__uint128_t x)
+{
+ return x * -(((__uint128_t) 1) << 62);
+}
+
+int
+main ()
+{
+ if (foo (1) != (((__uint128_t) -1) << 63)
+ || foo (8) != (((__uint128_t) -1) << 66))
+ abort ();
+ if (bar (1) != (((__uint128_t) 1) << 63)
+ || bar (8) != (((__uint128_t) 1) << 66))
+ abort ();
+ if (baz (1) != -(((__uint128_t) 1) << 62)
+ || baz (8) != ((-(((__uint128_t) 1) << 62)) << 3))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56443.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56443.c
new file mode 100644
index 000000000..ed60e05af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56443.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/56443 */
+/* { dg-do run } */
+/* { dg-options "-ftree-vectorize" } */
+
+extern void abort (void);
+typedef int myint __attribute__ ((__aligned__ (16)));
+
+int a1[1024] __attribute__ ((__aligned__ (16)));
+int a2[1024] __attribute__ ((__aligned__ (16)));
+
+__attribute__((noinline, noclone)) void
+test (int n, myint * __restrict__ p1, myint * __restrict__ p2)
+{
+ while (n--)
+ *p1++ = *p2++ + 1;
+}
+
+int
+main ()
+{
+ int n;
+ for (n = 0; n < 1024; n++)
+ a2[n] = n;
+ test (1024, a1, a2);
+ for (n = 0; n < 1024; n++)
+ if (a1[n] != a2[n] + 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56478.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56478.c
new file mode 100644
index 000000000..506204e8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56478.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/56478 */
+/* { dg-do compile } */
+
+int a;
+
+void
+foo ()
+{
+ int b;
+ for (b = 0;; b++)
+ a = 0 < -__LONG_LONG_MAX__ - 1 - b ? : 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56488.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56488.c
new file mode 100644
index 000000000..94add8d9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56488.c
@@ -0,0 +1,32 @@
+/* { dg-do run { target { size32plus } } } */
+/* { dg-require-effective-target int32plus } */
+
+int a, c, d = 1;
+struct S { int s; } b, f;
+short e;
+
+static void
+foo (int x)
+{
+ int g[] = { };
+ for (e = 0; e != 1; e = e + 5)
+ {
+ int *h[1] = { &g[0] };
+ if (!x)
+ return;
+ f = b;
+ }
+}
+
+int
+main ()
+{
+ int i, j;
+ for (i = 0; i < 6; i++)
+ for (j = 8; j; j--)
+ a = 0;
+ foo (d);
+ while (c)
+ ;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56501.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56501.c
new file mode 100644
index 000000000..d6fc29d7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56501.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+int a;
+void try_help () __attribute__ ((__noreturn__));
+void try_help ()
+{
+}
+
+int main ()
+{
+ switch (a)
+ {
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ break;
+ default:
+ try_help ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56661.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56661.c
new file mode 100644
index 000000000..6fdaedb31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56661.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+
+__attribute__((noinline, noclone)) void
+bar (int *b)
+{
+ b[0] = b[1] = b[2] = 1;
+}
+
+__attribute__((noinline, noclone)) int
+baz (int x)
+{
+ if (x != 1)
+ __builtin_abort ();
+}
+
+void
+foo (int x)
+{
+ if (x == 0)
+ {
+ int *b = __builtin_malloc (3 * sizeof (int));
+ while (b[0])
+ ;
+ }
+ else if (x == 1)
+ {
+ int i, j;
+ int *b = __builtin_malloc (3 * sizeof (int));
+ for (i = 0; i < 2; i++)
+ {
+ bar (b);
+ for (j = 0; j < 3; ++j)
+ baz (b[j]);
+ baz (b[0]);
+ }
+ }
+}
+
+int
+main ()
+{
+ int x = 1;
+ asm volatile ("" : "+r" (x));
+ foo (x);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56689.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56689.c
new file mode 100644
index 000000000..719f528c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56689.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+
+extern int baz ();
+extern void bar (void);
+extern void noret (void) __attribute__ ((__noreturn__));
+
+void
+fix_register (const char *name, int fixed, int call_used, int nregs)
+{
+ int i;
+ int reg;
+
+ if ((reg = baz ()) >= 0)
+ {
+ for (i = reg; i < nregs; i++)
+ {
+ if ((i == 15 || i == 11) && (fixed == 0 || call_used == 0))
+ {
+ switch (fixed)
+ {
+ case 0:
+ switch (call_used)
+ {
+ case 1:
+ bar ();
+ break;
+ default:
+ (noret ());
+ }
+ case 1:
+ switch (call_used)
+ {
+ case 1:
+ break;
+ case 0:
+ default:
+ (noret ());
+ }
+ break;
+ default:
+ (noret ());
+ }
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56756.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56756.c
new file mode 100644
index 000000000..470014d26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56756.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+
+int a, *b;
+
+void f(void)
+{
+ if(a)
+ {
+ int k;
+
+ for(a = 0; a < 1; a++)
+ {
+ int **q;
+ f();
+
+ for(; **q; ++**q)
+ lbl:
+ if(a)
+ {
+ a = 0;
+ goto lbl;
+ }
+
+ b = &k;
+ }
+ }
+ goto lbl;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56778.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56778.c
new file mode 100644
index 000000000..48068774a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56778.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-march=core-avx2" { target x86_64-*-* } } */
+
+typedef struct {
+ float a,b,c;
+} S;
+
+S * arr[100];
+
+void bar (float *in[], int n)
+{
+ int i;
+ for (i=0; i<n; i++)
+ (*in)[i] = -arr[i]->b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57026.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57026.c
new file mode 100644
index 000000000..e37895486
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57026.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+typedef struct __jmp_buf_tag { char buf[1024]; } jmp_buf[1];
+extern int setjmp (jmp_buf);
+extern int bar (unsigned int *);
+extern jmp_buf *baz (void);
+struct C { int c1; unsigned int c2, c3, c4; };
+
+void
+foo (struct C *x, const int *y, unsigned int *z, unsigned int e, unsigned int g)
+{
+ unsigned int d = 0;
+ unsigned long f;
+ setjmp (*baz ());
+ f = d;
+ if ((x->c1 || x->c2) && g && (!e || d >= 8))
+ d = 16;
+ else
+ d = 8;
+ if ((!x->c3 && !x->c4 || *y == 0) && !e && bar (z))
+ *z = f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57036-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57036-1.c
new file mode 100644
index 000000000..5aa63bd75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57036-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+extern void g (void);
+extern __inline __attribute__ ((__always_inline__,__leaf__))
+f ()
+{
+ g ();
+}
+struct __jmp_buf_tag *b;
+int jpgDecode_convert (unsigned i)
+{
+ if (i != 0)
+ f ();
+ read_buf_open ();
+ return _setjmp (b);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57036-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57036-2.c
new file mode 100644
index 000000000..25de5cd15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57036-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+int j_;
+int jpgDecode_convert (unsigned i)
+{
+ __label__ label;
+ int j;
+
+ inline void __attribute__((always_inline,leaf)) f(void)
+ {
+ g();
+ }
+
+ void __attribute__((noinline)) read_buf_open (void)
+ {
+ goto label;
+ }
+
+ if (i != 0)
+ f ();
+ j = j_;
+ read_buf_open ();
+label:
+ return j;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57075.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57075.c
new file mode 100644
index 000000000..dee74a844
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57075.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+extern int baz (void) __attribute__ ((returns_twice));
+int __attribute__ ((__leaf__))
+foo (void)
+{
+ return __builtin_printf ("$");
+}
+
+void
+bar ()
+{
+ foo ();
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57081.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57081.c
new file mode 100644
index 000000000..0fcbaaa62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57081.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+int a;
+
+void f(void)
+{
+ int b;
+
+ if(0)
+ lbl:
+ goto lbl;
+
+ if(b)
+ {
+ int p = 0;
+ goto lbl;
+ }
+
+ a = 0;
+ while(b++);
+ goto lbl;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57083.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57083.c
new file mode 100644
index 000000000..070a53d21
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57083.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/57083 */
+/* { dg-do run { target int32plus } } */
+
+extern void abort (void);
+short x = 1;
+int y = 0;
+
+int
+main ()
+{
+ unsigned t = (0x7fff8001U - x) << (y == 0);
+ if (t != 0xffff0000U)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57122.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57122.c
new file mode 100644
index 000000000..f1b99c862
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57122.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+unsigned a;
+int b, c;
+
+void f(void)
+{
+ if(a)
+ {
+ for(a = 0; a < 2; a++)
+ a /= 7;
+
+ for(;; a++)
+ {
+ if(a)
+ lbl1:
+ b++;
+
+ if(c)
+ goto lbl1;
+lbl2:
+ ;
+ }
+ }
+
+ goto lbl2;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-1.c
new file mode 100644
index 000000000..e5ad54499
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+struct __jmp_buf_tag {};
+typedef struct __jmp_buf_tag jmp_buf[1];
+extern int _setjmp (struct __jmp_buf_tag __env[1]);
+
+jmp_buf g_return_jmp_buf;
+
+void SetNaClSwitchExpectations (void)
+{
+}
+void TestSyscall(void)
+{
+ SetNaClSwitchExpectations();
+ _setjmp (g_return_jmp_buf);
+}
+
+/* { dg-final { scan-tree-dump-not "builtin_unreachable" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-2.c
new file mode 100644
index 000000000..521d126e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+
+struct __jmp_buf_tag {};
+typedef struct __jmp_buf_tag jmp_buf[1];
+extern int _setjmp (struct __jmp_buf_tag __env[1]);
+
+jmp_buf g_return_jmp_buf;
+
+void SetNaClSwitchExpectations (void)
+{
+ __builtin_longjmp (g_return_jmp_buf, 1);
+}
+void TestSyscall(void)
+{
+ SetNaClSwitchExpectations();
+ _setjmp (g_return_jmp_buf);
+}
+
+/* { dg-final { scan-tree-dump "setjmp" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-3.c
new file mode 100644
index 000000000..c64e5adb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57147-3.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+typedef char * ptr_t;
+struct __jmp_buf_tag {
+};
+typedef struct __jmp_buf_tag sigjmp_buf[1];
+sigjmp_buf GC_jmp_buf;
+void GC_fault_handler(int sig)
+{
+}
+void GC_setup_temporary_fault_handler() {
+ GC_set_and_save_fault_handler(GC_fault_handler);
+}
+ptr_t GC_find_limit(ptr_t p)
+{
+ GC_setup_temporary_fault_handler();
+ if (__sigsetjmp (GC_jmp_buf, 1) == 0)
+ for (;;)
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57214.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57214.c
new file mode 100644
index 000000000..d51067d95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57214.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+extern int baz (void);
+extern int foo (void) __attribute__ ((returns_twice));
+
+void
+bar (_Bool b)
+{
+ int buf[1];
+ while (1)
+ {
+ _Bool x = 1;
+ if (b)
+ baz ();
+ b = 1;
+ baz ();
+ x = 0;
+ int i;
+ while (buf[i] && i)
+ i++;
+ foo ();
+ if (!x)
+ b = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57251.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57251.c
new file mode 100644
index 000000000..2fe268c36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57251.c
@@ -0,0 +1,12 @@
+/* PR middle-end/57251 */
+/* { dg-do compile } */
+/* { dg-options "-ftracer" } */
+
+short a, b;
+int
+f (void)
+{
+ long long i = 2;
+ a ? f () ? : 0 : b--;
+ b &= i *= a |= 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57303.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57303.c
new file mode 100644
index 000000000..1ddb5a8aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57303.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+void abort (void);
+
+struct S0
+{
+ int f0;
+};
+struct S1
+{
+ struct S0 f0;
+};
+
+struct S1 x = { {0} };
+struct S1 y = { {1} };
+
+static void
+foo (struct S0 p)
+{
+ struct S0 *l = &y.f0;
+ *l = x.f0;
+ if (p.f0)
+ *l = *l;
+}
+
+int
+main ()
+{
+ foo(y.f0);
+ if (y.f0.f0 != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57330.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57330.c
new file mode 100644
index 000000000..3e6cbcbd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57330.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+void foo (int a)
+{}
+
+void *a;
+void bar ()
+{
+ void **( *b ) ( ) = (void**(*)()) foo;
+ a = b (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57341.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57341.c
new file mode 100644
index 000000000..3f5cc8dd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57341.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-additional-options "-msse" { target sse2_runtime } } */
+
+int a, d;
+int *b = &a, **c;
+int
+main ()
+{
+ int e;
+ {
+ int f[4];
+ for (d = 0; d < 4; d++)
+ f[d] = 1;
+ e = f[1];
+ }
+ int *g[28] = { };
+ *b = e;
+ c = &g[0];
+ if (a != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57343.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57343.c
new file mode 100644
index 000000000..b05bad5cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57343.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+int c = 0;
+
+int
+main ()
+{
+ int i, f = 1;
+ for (i = 0; i < 5; i++)
+ {
+ --c;
+ unsigned char h = c * 100;
+ if (h == 0)
+ {
+ f = 0;
+ break;
+ }
+ }
+ if (f != 1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57381.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57381.c
new file mode 100644
index 000000000..ff6550a6d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57381.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+struct S0 { int f0, f1, f2; };
+
+struct S1 {
+ int f0;
+ volatile struct S0 f2;
+};
+
+static struct S1 s = {0x47BED265,{0x06D4EB3E,5,0U}};
+
+int foo(struct S0 p)
+{
+ for (s.f2.f2 = 0; (s.f2.f2 <= 12); s.f2.f2++)
+ {
+ volatile int *l_61[5][2][2] = {{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,(void*)0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{&s.f2.f0,&s.f2.f0}},{{&s.f2.f0,&s.f2.f0},{(void*)0,&s.f2.f0}}};
+
+ volatile int **l_68 = &l_61[0][0][1];
+ volatile int *l_76 = &s.f2.f0;
+ (*l_68) = l_61[0][0][0];
+ if ((*l_76 = (p.f2 % 5))) ;
+ }
+ return p.f0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-1.c
new file mode 100644
index 000000000..e62d44df4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-1.c
@@ -0,0 +1,15 @@
+/* PR middle-end/57393 */
+/* { dg-do compile } */
+/* { dg-additional-options "-g -ffast-math" } */
+
+extern void bar (double);
+
+struct S { int n; };
+
+void
+foo (struct S s, double a, int i, int j, int k)
+{
+ struct S t;
+ bar (s.n * a * i * j);
+ t.n = s.n * a * i * k;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-2.c
new file mode 100644
index 000000000..b9b12ffa5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-2.c
@@ -0,0 +1,16 @@
+/* PR middle-end/57393 */
+/* { dg-do compile } */
+
+char a;
+
+foo (int **p)
+{
+ int b;
+ for (;;)
+ {
+ int c[1] = { 0 };
+ unsigned *d = &c[0];
+ for (b = 7; b; b--)
+ **p &= --*d >= a;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-3.c
new file mode 100644
index 000000000..34cece06c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57393-3.c
@@ -0,0 +1,20 @@
+/* PR middle-end/57393 */
+/* { dg-do compile } */
+
+int a, b, c;
+void foo (void);
+
+int
+bar (void)
+{
+ for (;;)
+ {
+ foo ();
+ int d = a = 0;
+ for (; a < 7; ++a)
+ {
+ d--;
+ b &= c <= d;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57417.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57417.c
new file mode 100644
index 000000000..6eac6f932
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57417.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+int a, b;
+volatile int *c;
+
+void foo ()
+{
+ volatile int d[1];
+ b = 0;
+ for (;; a--)
+ c = &d[b];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-1.c
new file mode 100644
index 000000000..8ca85cafe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-1.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+union setconflict
+{
+ int a[20];
+ long b[10];
+};
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ union setconflict a;
+ int *c;
+ c = a.a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ union setconflict a;
+ long *c;
+ c = a.b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-2.c
new file mode 100644
index 000000000..ccb546e0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-2.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ int a[20];
+ int *c;
+ c = a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ long b[10];
+ long *c;
+ c = b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-3.c
new file mode 100644
index 000000000..8e0c7fe2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57425-3.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+int
+main ()
+{
+ int sum = 0;
+ {
+ long a[20];
+ long *c;
+ c = a;
+ asm ("": "=r" (c):"0" (c));
+ *c = 0;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+ {
+ long long b[10];
+ long long *c;
+ c = b;
+ asm ("": "=r" (c):"0" (c));
+ *c = 1;
+ asm ("": "=r" (c):"0" (c));
+ sum += *c;
+ }
+
+ if (sum != 1)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57478.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57478.c
new file mode 100644
index 000000000..e81348dfd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57478.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+typedef struct Node Node;
+
+struct Node
+{
+ Node *Pred, *Suc;
+ Node *SubBestPred;
+ Node *SubBestSuc;
+};
+
+void
+foo (Node *N)
+{
+ do
+ {
+ N->SubBestPred = N->Pred;
+ N->SubBestSuc = N->Suc;
+ }
+ while (N = N->Suc);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57488.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57488.c
new file mode 100644
index 000000000..7eda36476
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57488.c
@@ -0,0 +1,58 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int i, j, *pj = &j, **ppj = &pj;
+int x, *px = &x;
+
+short s, *ps = &s, k;
+
+unsigned short u, *pu = &u, **ppu = &pu;
+
+char c, *pc = &c;
+
+unsigned char v = 48;
+
+static int
+bar (int p)
+{
+ p = k;
+ *px = **ppu = i;
+ *ppj = &p;
+ if (**ppj)
+ *pj = p;
+ return p;
+}
+
+void __attribute__((noinline))
+foo ()
+{
+ for (; i <= 3; i++)
+ for (; j; j--);
+
+ u ^= bar (*pj);
+
+ for (k = 1; k >= 0; k--)
+ {
+ int l;
+ bar (0);
+ for (l = 1; l < 5; l++)
+ {
+ int m;
+ for (m = 6; m; m--)
+ {
+ v--;
+ *ps = *pc;
+ }
+ }
+ }
+}
+
+int
+main ()
+{
+ foo ();
+ if (v != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57517.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57517.c
new file mode 100644
index 000000000..2422d8ee6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57517.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+int x[1024], y[1024], z[1024], w[1024];
+void foo (void)
+{
+ int i;
+ for (i = 1; i < 1024; ++i)
+ {
+ int a = x[i];
+ int b = y[i];
+ int c = x[i-1];
+ int d = y[i-1];
+ if (w[i])
+ z[i] = (a + b) + (c + d);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57521.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57521.c
new file mode 100644
index 000000000..e7832cb00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57521.c
@@ -0,0 +1,51 @@
+/* { dg-do run } */
+/* { dg-options "-ftree-loop-if-convert" } */
+
+void abort (void);
+
+int a, b, c, d, o = 1, p;
+short e;
+
+int
+fn1 (int * p1)
+{
+ int f, g, h, j = 0, k = 0, l = 0;
+ unsigned int i;
+ int *m[1] = { &l };
+ for (; b >= 0; b--)
+ {
+ if (*p1)
+ if (j >= 0)
+ {
+ int n = 1;
+ e = 1;
+ h = a ? a : 1 % n;
+ g = h > 0 ? 0 : h + 1;
+ k = c + g;
+ }
+ else
+ continue;
+ else
+ {
+
+ f = d > 0 ? 0 : d + 1;
+ i = f;
+ j = 1 + i;
+ }
+ l++;
+ }
+ return k;
+}
+
+int
+main ()
+{
+ for (;; p++)
+ {
+ fn1 (&o);
+ break;
+ }
+ if (e != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57569.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57569.c
new file mode 100644
index 000000000..f036d559d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57569.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+extern void abort (void) __attribute__((noreturn));
+
+struct S { int f0; } a;
+
+int b, e, *d = &b, f;
+
+void
+fn1 ()
+{
+ int **g[9][6];
+ int ***h = &g[6][3];
+ for (; e < 9; e++) {
+ f = 0;
+ for (; f < 6; f++)
+ g[e][f] = &d;
+ }
+ ***h = 0;
+}
+
+void
+fn2 ()
+{
+ fn1 ();
+ struct S c[4][10] = {};
+ a = c[3][9];
+}
+
+int
+main ()
+{
+ fn2 ();
+ if (a.f0 != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57584.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57584.c
new file mode 100644
index 000000000..0e5a29492
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57584.c
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+typedef int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned long int uintptr_t;
+typedef uint8_t scm_t_uint8;
+typedef int32_t scm_t_int32;
+typedef uintptr_t scm_t_uintptr;
+typedef scm_t_uintptr scm_t_bits;
+typedef struct scm_unused_struct {
+} *SCM;
+enum scm_tc8_tags {
+ scm_tc8_flag = 4 + 0x00, scm_tc8_char = 4 + 0x08, scm_tc8_unused_0 = 4 + 0x10, scm_tc8_unused_1 = 4 + 0x18 };
+struct __jmp_buf_tag {
+};
+typedef struct __jmp_buf_tag jmp_buf[1];
+typedef struct scm_t_cell {
+} scm_t_cell;
+struct scm_prompt_registers {
+ jmp_buf regs;
+};
+enum {
+ SCM_VM_APPLY_HOOK, SCM_VM_PUSH_CONTINUATION_HOOK, SCM_VM_POP_CONTINUATION_HOOK, SCM_VM_NEXT_HOOK, SCM_VM_ABORT_CONTINUATION_HOOK, SCM_VM_RESTORE_CONTINUATION_HOOK, SCM_VM_NUM_HOOKS, };
+typedef SCM (*scm_t_vm_engine) (SCM vm, SCM program, SCM *argv, int nargs);
+struct scm_vm {
+ scm_t_uint8 *ip;
+ SCM *sp;
+ SCM *fp;
+ int engine;
+ int trace_level;
+};
+static SCM vm_regular_engine (SCM vm, SCM program, SCM *argv, int nargs) {
+}
+static SCM vm_debug_engine (SCM vm, SCM program, SCM *argv, int nargs) {
+ register scm_t_uint8 *ip ;
+ register SCM *sp ;
+ register SCM *fp ;
+ struct scm_vm *vp = ((struct scm_vm *) ((((scm_t_bits) (0? (*(SCM*)0=((((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((vm))))): (((vm)))))))) [((1))]))): (((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((vm))))): (((vm)))))))) [((1))]))))));
+ static const void **jump_table_pointer = ((void *)0);
+ const void **jump_table;
+ if (__builtin_expect ((!jump_table_pointer), 0)) {
+ jump_table_pointer[0] = &&l_nop;
+ }
+l_nop:
+ {
+ SCM *old_sp;
+ scm_t_int32 n;
+ old_sp = sp;
+ sp = (fp - 1) + n;
+ if (old_sp < sp) {
+ while (old_sp < sp) *++old_sp = ((SCM) ((((((9)) << 8) + scm_tc8_flag))));
+ }
+ {
+ { if (__builtin_expect ((vp->trace_level > 0), 0)) { { vp->ip = ip; vp->sp = sp; vp->fp = fp; }; vm_dispatch_hook (vm, SCM_VM_NEXT_HOOK); } };
+ };
+ }
+ {
+ SCM k, prompt;
+ if ((_setjmp (((struct scm_prompt_registers*)((((scm_t_bits) (0? (*(SCM*)0=((((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((prompt))))): (((prompt)))))))) [((2))]))): (((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((prompt))))): (((prompt)))))))) [((2))]))))))->regs))) {
+ { ip = vp->ip; sp = vp->sp; fp = vp->fp; };
+ { { if (__builtin_expect ((vp->trace_level > 0), 0)) { { vp->ip = ip; vp->sp = sp; vp->fp = fp; }; vm_dispatch_hook (vm, SCM_VM_NEXT_HOOK); } }; ; goto *jump_table[(*ip++) & ((1<<8)-1)]; };
+ }
+
+ if (__builtin_expect ((vp->trace_level > 0), 0)) { { vp->ip = ip; vp->sp = sp; vp->fp = fp; }; vm_dispatch_hook (vm, SCM_VM_NEXT_HOOK); } ;
+
+ }
+}
+static const scm_t_vm_engine vm_engines[] = {
+ vm_regular_engine, vm_debug_engine };
+SCM scm_c_vm_run (SCM vm, SCM program, SCM *argv, int nargs) {
+ struct scm_vm *vp = ((struct scm_vm *) ((((scm_t_bits) (0? (*(SCM*)0=((((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((vm))))): (((vm)))))))) [((1))]))): (((SCM *)((scm_t_cell *) (((scm_t_bits) (0? (*(SCM*)0=((((vm))))): (((vm)))))))) [((1))]))))));
+ return vm_engines[vp->engine](vm, program, argv, nargs);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57656.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57656.c
new file mode 100644
index 000000000..4f3645e46
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57656.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-fstrict-overflow" } */
+
+int main (void)
+{
+ int a = -1;
+ int b = __INT_MAX__;
+ int c = 2;
+ int t = 1 - ((a - b) / c); // t = 1 - ( __INT_MIN__ / 2 )
+ if (t != (1 - (-1 - __INT_MAX__) / 2))
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57685.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57685.c
new file mode 100644
index 000000000..75973f2a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57685.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+unsigned f(void)
+{
+ unsigned a;
+ int b, c, d, e;
+
+ for(c = 27; c < 40; c++)
+ b |= d |= b;
+
+ if(b)
+ a = e;
+
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-1.c
new file mode 100644
index 000000000..dc0fcdc3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-1.c
@@ -0,0 +1,49 @@
+/* PR middle-end/57748 */
+/* { dg-do run } */
+/* ICE in expand_assignment:
+ misalignp == true, !MEM_P (to_rtx), offset != 0,
+ => gcc_assert (TREE_CODE (offset) == INTEGER_CST) */
+
+#include <stdlib.h>
+
+extern void abort (void);
+
+typedef long long V
+ __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
+
+typedef struct S { V a; V b[0]; } P __attribute__((aligned (1)));
+
+struct __attribute__((packed)) T { char c; P s; };
+
+void __attribute__((noinline, noclone))
+check (struct T *t)
+{
+ if (t->s.b[0][0] != 3 || t->s.b[0][1] != 4)
+ abort ();
+}
+
+int __attribute__((noinline, noclone))
+get_i (void)
+{
+ return 0;
+}
+
+void __attribute__((noinline, noclone))
+foo (P *p)
+{
+ V a = { 3, 4 };
+ int i = get_i ();
+ p->b[i] = a;
+}
+
+int
+main ()
+{
+ struct T *t = (struct T *) calloc (128, 1);
+
+ foo (&t->s);
+ check (t);
+
+ free (t);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-2.c
new file mode 100644
index 000000000..4e3b4b884
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-2.c
@@ -0,0 +1,43 @@
+/* PR middle-end/57748 */
+/* { dg-do run } */
+/* wrong code in expand_assignment:
+ misalignp == true, !MEM_P (to_rtx),
+ offset == 0, bitpos >= GET_MODE_PRECISION,
+ => result = NULL. */
+
+#include <stdlib.h>
+
+extern void abort (void);
+
+typedef long long V
+ __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
+
+typedef struct S { V a; V b[0]; } P __attribute__((aligned (1)));
+
+struct __attribute__((packed)) T { char c; P s; };
+
+void __attribute__((noinline, noclone))
+check (struct T *t)
+{
+ if (t->s.b[0][0] != 3 || t->s.b[0][1] != 4)
+ abort ();
+}
+
+void __attribute__((noinline, noclone))
+foo (P *p)
+{
+ V a = { 3, 4 };
+ p->b[0] = a;
+}
+
+int
+main ()
+{
+ struct T *t = (struct T *) calloc (128, 1);
+
+ foo (&t->s);
+ check (t);
+
+ free (t);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-3.c
new file mode 100644
index 000000000..5ddb6099c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-3.c
@@ -0,0 +1,40 @@
+/* PR middle-end/57748 */
+/* { dg-do run } */
+/* wrong code in expand_expr_real_1. */
+
+#include <stdlib.h>
+
+extern void abort (void);
+
+typedef long long V
+ __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
+
+typedef struct S { V a; V b[0]; } P __attribute__((aligned (1)));
+
+struct __attribute__((packed)) T { char c; P s; };
+
+void __attribute__((noinline, noclone))
+check (P *p)
+{
+ if (p->b[0][0] != 3 || p->b[0][1] != 4)
+ abort ();
+}
+
+void __attribute__((noinline, noclone))
+foo (struct T *t)
+{
+ V a = { 3, 4 };
+ t->s.b[0] = a;
+}
+
+int
+main ()
+{
+ struct T *t = (struct T *) calloc (128, 1);
+
+ foo (t);
+ check (&t->s);
+
+ free (t);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-4.c
new file mode 100644
index 000000000..455cb3d32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57748-4.c
@@ -0,0 +1,40 @@
+/* PR middle-end/57748 */
+/* { dg-do run } */
+/* wrong code in expand_expr_real_1. */
+
+#include <stdlib.h>
+
+extern void abort (void);
+
+typedef long long V
+ __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
+
+typedef struct S { V b[1]; } P __attribute__((aligned (1)));
+
+struct __attribute__((packed)) T { char c; P s; };
+
+void __attribute__((noinline, noclone))
+check (P *p)
+{
+ if (p->b[1][0] != 3 || p->b[1][1] != 4)
+ abort ();
+}
+
+void __attribute__((noinline, noclone))
+foo (struct T *t)
+{
+ V a = { 3, 4 };
+ t->s.b[1] = a;
+}
+
+int
+main ()
+{
+ struct T *t = (struct T *) calloc (128, 1);
+
+ foo (t);
+ check (&t->s);
+
+ free (t);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57993-2.cpp b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57993-2.cpp
new file mode 100644
index 000000000..d8fd371b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57993-2.cpp
@@ -0,0 +1,213 @@
+/* This ICEd due to an incomplete fix for PR57993. */
+/* { dg-compile } */
+
+extern "C"
+{
+ extern double sqrt (double __x) throw ();
+ typedef long unsigned int size_t;
+ typedef struct
+ {
+ }
+ __mbstate_t;
+ void *pov_malloc (size_t size, const char *file, int line, const char *msg);
+ typedef struct Object_Struct OBJECT;
+ typedef struct Ray_Struct RAY;
+ typedef struct istack_struct ISTACK;
+ typedef struct istk_entry INTERSECTION;
+ typedef double UV_VECT[2];
+ typedef double VECTOR[3];
+ typedef struct Transform_Struct TRANSFORM;
+ typedef struct Method_Struct METHODS;
+ typedef int (*ALL_INTERSECTIONS_METHOD) (OBJECT *, RAY *, ISTACK *);
+ typedef int (*INSIDE_METHOD) (VECTOR, OBJECT *);
+ typedef void (*NORMAL_METHOD) (VECTOR, OBJECT *, INTERSECTION *);
+ typedef void (*UVCOORD_METHOD) (UV_VECT, OBJECT *, INTERSECTION *);
+ typedef void *(*COPY_METHOD) (OBJECT *);
+ typedef void (*TRANSLATE_METHOD) (OBJECT *, VECTOR, TRANSFORM *);
+ typedef void (*ROTATE_METHOD) (OBJECT *, VECTOR, TRANSFORM *);
+ typedef void (*SCALE_METHOD) (OBJECT *, VECTOR, TRANSFORM *);
+ typedef void (*TRANSFORM_METHOD) (OBJECT *, TRANSFORM *);
+ typedef void (*INVERT_METHOD) (OBJECT *);
+ typedef void (*DESTROY_METHOD) (OBJECT *);
+ struct Method_Struct
+ {
+ ALL_INTERSECTIONS_METHOD All_Intersections_Method;
+ INSIDE_METHOD Inside_Method;
+ NORMAL_METHOD Normal_Method;
+ UVCOORD_METHOD UVCoord_Method;
+ COPY_METHOD Copy_Method;
+ TRANSLATE_METHOD Translate_Method;
+ ROTATE_METHOD Rotate_Method;
+ SCALE_METHOD Scale_Method;
+ TRANSFORM_METHOD Transform_Method;
+ INVERT_METHOD Invert_Method;
+ DESTROY_METHOD Destroy_Method;
+ };
+ typedef struct Bicubic_Patch_Struct BICUBIC_PATCH;
+ typedef struct Bezier_Node_Struct BEZIER_NODE;
+ struct Bezier_Node_Struct
+ {
+ int Node_Type;
+ int Count;
+ };
+ struct Bicubic_Patch_Struct
+ {
+ METHODS *Methods;
+ int Patch_Type, U_Steps, V_Steps;
+ VECTOR Control_Points[4][4];
+ BEZIER_NODE *Node_Tree;
+ };
+ typedef enum
+ {
+ CSV, SYS, PPM, TARGA, PNG, NONE
+ }
+ SHELLDATA;
+ typedef enum STATS
+ {
+ Number_Of_Pixels =
+ 0, Number_Of_Pixels_Supersampled, Number_Of_Samples, Number_Of_Rays,
+ Calls_To_DNoise, Calls_To_Noise, ADC_Saves, Istack_overflows,
+ Ray_RBezier_Tests, Ray_RBezier_Tests_Succeeded, Ray_Bicubic_Tests,
+ Ray_Bicubic_Tests_Succeeded, Ray_Blob_Tests, Ray_Blob_Tests_Succeeded,
+ Blob_Element_Tests, Blob_Element_Tests_Succeeded, Blob_Bound_Tests,
+ Blob_Bound_Tests_Succeeded, Ray_Box_Tests, Ray_Box_Tests_Succeeded,
+ Ray_Cone_Tests, Ray_Cone_Tests_Succeeded, Ray_CSG_Intersection_Tests,
+ Ray_CSG_Intersection_Tests_Succeeded, Ray_CSG_Merge_Tests,
+ Ray_CSG_Merge_Tests_Succeeded, Ray_CSG_Union_Tests,
+ Ray_CSG_Union_Tests_Succeeded, Ray_Disc_Tests, Ray_Disc_Tests_Succeeded,
+ Ray_Fractal_Tests, Ray_Fractal_Tests_Succeeded, Ray_HField_Tests,
+ Ray_HField_Tests_Succeeded, Ray_HField_Box_Tests,
+ Ray_HField_Box_Tests_Succeeded, Ray_HField_Triangle_Tests,
+ Ray_HField_Triangle_Tests_Succeeded, Ray_HField_Block_Tests,
+ Ray_HField_Block_Tests_Succeeded, Ray_HField_Cell_Tests,
+ Ray_HField_Cell_Tests_Succeeded, Ray_IsoSurface_Tests,
+ Ray_IsoSurface_Tests_Succeeded, Ray_IsoSurface_Bound_Tests,
+ Ray_IsoSurface_Bound_Tests_Succeeded, Ray_IsoSurface_Cache,
+ Ray_IsoSurface_Cache_Succeeded, Ray_Lathe_Tests,
+ Ray_Lathe_Tests_Succeeded, Lathe_Bound_Tests,
+ Lathe_Bound_Tests_Succeeded, Ray_Mesh_Tests, Ray_Mesh_Tests_Succeeded,
+ Ray_Plane_Tests, Ray_Plane_Tests_Succeeded, Ray_Polygon_Tests,
+ Ray_Polygon_Tests_Succeeded, Ray_Prism_Tests, Ray_Prism_Tests_Succeeded,
+ Prism_Bound_Tests, Prism_Bound_Tests_Succeeded, Ray_Parametric_Tests,
+ Ray_Parametric_Tests_Succeeded, Ray_Par_Bound_Tests,
+ Ray_Par_Bound_Tests_Succeeded, Ray_Quadric_Tests,
+ Ray_Quadric_Tests_Succeeded, Ray_Poly_Tests, Ray_Poly_Tests_Succeeded,
+ Ray_Sphere_Tests, Ray_Sphere_Tests_Succeeded, Ray_Sphere_Sweep_Tests,
+ Ray_Sphere_Sweep_Tests_Succeeded, Ray_Superellipsoid_Tests,
+ Ray_Superellipsoid_Tests_Succeeded, Ray_Sor_Tests,
+ Ray_Sor_Tests_Succeeded, Sor_Bound_Tests, Sor_Bound_Tests_Succeeded,
+ Ray_Torus_Tests, Ray_Torus_Tests_Succeeded, Torus_Bound_Tests,
+ Torus_Bound_Tests_Succeeded, Ray_Triangle_Tests,
+ Ray_Triangle_Tests_Succeeded, Ray_TTF_Tests, Ray_TTF_Tests_Succeeded,
+ Bounding_Region_Tests, Bounding_Region_Tests_Succeeded,
+ Clipping_Region_Tests, Clipping_Region_Tests_Succeeded,
+ Ray_IsoSurface_Find_Root, Ray_Function_VM_Calls,
+ Ray_Function_VM_Instruction_Est, VBuffer_Tests, VBuffer_Tests_Succeeded,
+ LBuffer_Tests, LBuffer_Tests_Succeeded, Media_Samples, Media_Intervals,
+ Reflected_Rays_Traced, Refracted_Rays_Traced, Transmitted_Rays_Traced,
+ Internal_Reflected_Rays_Traced, Shadow_Cache_Hits,
+ Shadow_Rays_Succeeded, Shadow_Ray_Tests, nChecked, nEnqueued,
+ totalQueues, totalQueueResets, totalQueueResizes, Polynomials_Tested,
+ Roots_Eliminated, MemStat_Smallest_Alloc, MemStat_Largest_Alloc,
+ MemStat_Largest_Mem_Usage, Number_Of_Photons_Shot,
+ Number_Of_Photons_Stored, Number_Of_Global_Photons_Stored,
+ Number_Of_Media_Photons_Stored, Priority_Queue_Add,
+ Priority_Queue_Remove, Gather_Performed_Count, Gather_Expanded_Count,
+ MaxStat
+ }
+ Stats;
+ static int All_Bicubic_Patch_Intersections (OBJECT * Object, RAY * Ray,
+ ISTACK * Depth_Stack);
+ static int Inside_Bicubic_Patch (VECTOR IPoint, OBJECT * Object);
+ static void Bicubic_Patch_Normal (VECTOR Result, OBJECT * Object,
+ INTERSECTION * Inter);
+ static void Bicubic_Patch_UVCoord (UV_VECT Result, OBJECT * Object,
+ INTERSECTION * Inter);
+ static BICUBIC_PATCH *Copy_Bicubic_Patch (OBJECT * Object);
+ static void Translate_Bicubic_Patch (OBJECT * Object, VECTOR Vector,
+ TRANSFORM * Trans);
+ static void Rotate_Bicubic_Patch (OBJECT * Object, VECTOR Vector,
+ TRANSFORM * Trans);
+ static void Scale_Bicubic_Patch (OBJECT * Object, VECTOR Vector,
+ TRANSFORM * Trans);
+ static void Transform_Bicubic_Patch (OBJECT * Object, TRANSFORM * Trans);
+ static void Invert_Bicubic_Patch (OBJECT * Object);
+ static void Destroy_Bicubic_Patch (OBJECT * Object);
+ static METHODS Bicubic_Patch_Methods = {
+ All_Bicubic_Patch_Intersections, Inside_Bicubic_Patch,
+ Bicubic_Patch_Normal, Bicubic_Patch_UVCoord,
+ (COPY_METHOD) Copy_Bicubic_Patch, Translate_Bicubic_Patch,
+ Rotate_Bicubic_Patch, Scale_Bicubic_Patch, Transform_Bicubic_Patch,
+ Invert_Bicubic_Patch, Destroy_Bicubic_Patch
+ };
+ static void bezier_value (VECTOR (*Control_Points)[4][4], double u0,
+ double v0, VECTOR P, VECTOR N)
+ {
+ int i, j;
+ double c, t, ut, vt;
+ double u[4], uu[4], v[4], vv[4];
+ double du[4], duu[4], dv[4], dvv[4];
+ for (i = 1; i < 4; i++)
+ {
+ vv[i] = vv[i - 1] * (1.0 - v0);
+ dvv[i] = -i * vv[i - 1];
+ }
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ t = c * ut * (dv[j] * vv[3 - j] + v[j] * dvv[3 - j]);
+ }
+ t = 1.0 / sqrt (t);
+ }
+ }
+ static int intersect_subpatch (BICUBIC_PATCH * Shape, RAY * ray,
+ VECTOR V1[3], double uu[3], double vv[3],
+ double *Depth, VECTOR P, VECTOR N, double *u,
+ double *v)
+ {
+ VECTOR Q, T1;
+ VECTOR B[3], IB[3], NN[3];
+ bezier_value ((VECTOR (*)[4][4]) & Shape->Control_Points, uu[1], vv[1],
+ T1, NN[1]);
+ }
+ static int bezier_tree_walker (RAY * Ray, BICUBIC_PATCH * Shape,
+ BEZIER_NODE * Node, ISTACK * Depth_Stack)
+ {
+ int i, cnt = 0;
+ double Depth, u, v;
+ double uu[3], vv[3];
+ VECTOR N, P;
+ VECTOR V1[3];
+ if (Node->Node_Type == 0)
+ {
+ for (i = 0; i < Node->Count; i++)
+ {
+ }
+ if (intersect_subpatch (Shape, Ray, V1, uu, vv, &Depth, P, N, &u, &v))
+ {
+ }
+ }
+ }
+ static int All_Bicubic_Patch_Intersections (OBJECT * Object, RAY * Ray,
+ ISTACK * Depth_Stack)
+ {
+ int Found, cnt = 0;
+ switch (((BICUBIC_PATCH *) Object)->Patch_Type)
+ {
+ case 1:
+ cnt =
+ bezier_tree_walker (Ray, (BICUBIC_PATCH *) Object,
+ ((BICUBIC_PATCH *) Object)->Node_Tree,
+ Depth_Stack);
+ }
+ }
+ BICUBIC_PATCH *Create_Bicubic_Patch ()
+ {
+ BICUBIC_PATCH *New;
+ New =
+ (BICUBIC_PATCH *) pov_malloc ((sizeof (BICUBIC_PATCH)), "bezier.cpp",
+ 2079, ("bicubic patch"));
+ New->Methods = &Bicubic_Patch_Methods;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57993.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57993.c
new file mode 100644
index 000000000..e73b73f4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57993.c
@@ -0,0 +1,30 @@
+/* This ICEd prior to fixing PR57993. */
+/* { dg-do compile } */
+
+int a, b, c, d;
+char e;
+unsigned g;
+
+void f(void)
+{
+ int h;
+
+ for(; d; d++)
+ if(d)
+lbl:
+ g + a || (d = 0);
+
+ b && (a = e);
+
+ for(h = 0; h < 1; ++h)
+ {
+ h = c ? : (d = 0);
+ g = a = (e | 0);
+ }
+
+ if(a)
+ goto lbl;
+
+ a = e = 0;
+ goto lbl;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58018.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58018.c
new file mode 100644
index 000000000..52c8e83fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58018.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/58018 */
+/* { dg-do compile } */
+
+int a, b, c, d, e;
+
+void
+bar (int p)
+{
+ int f = b;
+ e &= p <= (f ^= 0);
+}
+
+void
+foo ()
+{
+ for (; d; d++)
+ {
+ bar (a && c);
+ bar (0);
+ bar (1);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58041.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58041.c
new file mode 100644
index 000000000..169a71ae7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58041.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+typedef long long V
+ __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
+
+struct s
+{
+ char u;
+ V v[2];
+} __attribute__((packed,aligned(1)));
+
+__attribute__((noinline, noclone))
+long long foo(struct s *x, int y, V *z)
+{
+ V a = x->v[y];
+ x->v[y] = *z;
+ return a[1];
+}
+
+struct s a = {0,{{0,0},{0,0}}};
+int main()
+{
+ V v1 = {0,1};
+ V v2 = {0,2};
+
+ if (foo(&a,0,&v1) != 0)
+ __builtin_abort();
+ if (foo(&a,0,&v2) != 1)
+ __builtin_abort();
+ if (foo(&a,1,&v1) != 0)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58079.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58079.c
new file mode 100644
index 000000000..99a30181f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58079.c
@@ -0,0 +1,107 @@
+/* { dg-options "-mlong-calls" { target mips*-*-* } } */
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int __kernel_size_t;
+typedef __kernel_size_t size_t;
+struct list_head {
+ struct list_head *next;
+};
+
+struct dmx_ts_feed {
+ int is_filtering;
+};
+struct dmx_section_feed {
+ u16 secbufp;
+ u16 seclen;
+ u16 tsfeedp;
+};
+
+typedef int (*dmx_ts_cb) (
+ const u8 * buffer1,
+ size_t buffer1_length,
+ const u8 * buffer2,
+ size_t buffer2_length
+);
+
+struct dvb_demux_feed {
+ union {
+ struct dmx_ts_feed ts;
+ struct dmx_section_feed sec;
+ } feed;
+ union {
+ dmx_ts_cb ts;
+ } cb;
+ int type;
+ u16 pid;
+ int ts_type;
+ struct list_head list_head;
+};
+
+struct dvb_demux {
+ int (*stop_feed)(struct dvb_demux_feed *feed);
+ struct list_head feed_list;
+};
+
+
+static
+inline
+__attribute__((always_inline))
+u8
+payload(const u8 *tsp)
+{
+ if (tsp[3] & 0x20) {
+ return 184 - 1 - tsp[4];
+ }
+ return 184;
+}
+
+static
+inline
+__attribute__((always_inline))
+int
+dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed, const u8 *buf)
+{
+ int count = payload(buf);
+ int p;
+ if (count == 0)
+ return -1;
+ return feed->cb.ts(&buf[p], count, ((void *)0), 0);
+}
+
+static
+inline
+__attribute__((always_inline))
+void
+dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, const u8 *buf)
+{
+ switch (feed->type) {
+ case 0:
+ if (feed->ts_type & 1) {
+ dvb_dmx_swfilter_payload(feed, buf);
+ }
+ if (dvb_dmx_swfilter_section_packet(feed, buf) < 0)
+ feed->feed.sec.seclen = feed->feed.sec.secbufp = 0;
+ }
+}
+
+static
+void
+dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
+{
+ struct dvb_demux_feed *feed;
+ int dvr_done = 0;
+
+ for (feed = ({ const typeof( ((typeof(*feed) *)0)->list_head ) *__mptr = ((&demux->feed_list)->next); (typeof(*feed) *)( (char *)__mptr - __builtin_offsetof(typeof(*feed),list_head) );}); __builtin_prefetch(feed->list_head.next), &feed->list_head != (&demux->feed_list); feed = ({ const typeof( ((typeof(*feed) *)0)->list_head ) *__mptr = (feed->list_head.next); (typeof(*feed) *)( (char *)__mptr - __builtin_offsetof(typeof(*feed),list_head) );})) {
+ if (((((feed)->type == 0) && ((feed)->feed.ts.is_filtering) && (((feed)->ts_type & (1 | 8)) == 1))) && (dvr_done++))
+ dvb_dmx_swfilter_packet_type(feed, buf);
+ else if (feed->pid == 0x2000)
+ feed->cb.ts(buf, 188, ((void *)0), 0);
+ }
+}
+void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, size_t count)
+{
+ while (count--) {
+ dvb_dmx_swfilter_packet(demux, buf);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58131.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58131.c
new file mode 100644
index 000000000..3f68d4c52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58131.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/58131 */
+/* { dg-do compile } */
+
+short a;
+int b, c, d[1][4][2];
+
+void
+foo (void)
+{
+ int *e;
+ for (b = 1; ; b--)
+ {
+ if (*e)
+ break;
+ for (c = 2; c >= 0; c--)
+ {
+ *e |= d[0][3][b] != a;
+ int *f = &d[0][3][b];
+ *f = 0;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-1.c
new file mode 100644
index 000000000..855515edb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-1.c
@@ -0,0 +1,51 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fstrict-overflow" } */
+
+extern void abort (void);
+
+int a, b, c, d, e, f, g, h = 1, i;
+
+int foo (int p)
+{
+ return p < 0 && a < - __INT_MAX__ - 1 - p ? 0 : 1;
+}
+
+int *bar ()
+{
+ int j;
+ i = h ? 0 : 1 % h;
+ for (j = 0; j < 1; j++)
+ for (d = 0; d; d++)
+ for (e = 1; e;)
+ return 0;
+ return 0;
+}
+
+int baz ()
+{
+ for (; b >= 0; b--)
+ for (c = 1; c >= 0; c--)
+ {
+ int *k = &c;
+ for (;;)
+ {
+ for (f = 0; f < 1; f++)
+ {
+ g = foo (*k);
+ bar ();
+ }
+ if (*k)
+ break;
+ return 0;
+ }
+ }
+ return 0;
+}
+
+int main ()
+{
+ baz ();
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-2.c
new file mode 100644
index 000000000..dd0dae1ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-2.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fstrict-overflow" } */
+
+int a, b, d, e, f, *g, h, i;
+volatile int c;
+
+char foo (unsigned char p)
+{
+ return p + 1;
+}
+
+int bar ()
+{
+ for (h = 0; h < 3; h = foo (h))
+ {
+ c;
+ for (f = 0; f < 1; f++)
+ {
+ i = a && 0 < -__INT_MAX__ - h ? 0 : 1;
+ if (e)
+ for (; d;)
+ b = 0;
+ else
+ g = 0;
+ }
+ }
+ return 0;
+}
+
+int main ()
+{
+ bar ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-3.c
new file mode 100644
index 000000000..23ae9cd39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58143-3.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fstrict-overflow" } */
+
+int a, b, c, d, e;
+
+int
+main ()
+{
+ for (b = 4; b > -30; b--)
+ for (; c;)
+ for (;;)
+ {
+ e = a > __INT_MAX__ - b;
+ if (d)
+ break;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58223.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58223.c
new file mode 100644
index 000000000..978084ad0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58223.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+
+extern void abort (void);
+int a[2], b;
+
+int main ()
+{
+ for (b = 0; b < 2; b++)
+ {
+ a[0] = 1;
+ a[b] = 0;
+ }
+ if (a[0] != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58228.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58228.c
new file mode 100644
index 000000000..d12303a00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58228.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+
+extern void abort (void);
+int a[8][8] = {{1}};
+int b, c, d, e;
+
+int main ()
+{
+ for (c = 0; c < 8; c++)
+ for (b = 0; b < 2; b++)
+ a[b + 4][c] = a[c][0];
+ if (a[4][4] != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58246.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58246.c
new file mode 100644
index 000000000..5417abf91
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58246.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int a, b;
+
+int main ()
+{
+ int t[2] = {1,1};
+
+ for (a = 0; a < 2; a++)
+ {
+ b ^= t[a];
+ t[a] = t[1] = 0;
+ }
+
+ if (b != 1)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58326-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58326-1.c
new file mode 100644
index 000000000..3b46eed9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58326-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+int a, *d;
+long b;
+short c;
+
+void foo ()
+{
+ int e;
+lbl:
+ for (c = 0; c < 2; c++)
+ {
+ if (1 >> b)
+ break;
+ e = *d;
+ for (; a; a++)
+ {
+ *d = e;
+ if (b)
+ goto lbl;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58326-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58326-2.c
new file mode 100644
index 000000000..ddddbbe57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58326-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+int a, b, c, d;
+
+void foo ()
+{
+ int e;
+
+lbl:
+ for (c = 0; c < 2; c++)
+ {
+ e = d;
+ for (; a; a++)
+ {
+ d = e;
+ if (b)
+ goto lbl;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58417.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58417.c
new file mode 100644
index 000000000..5cb0ddb02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58417.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+
+long long arr[6] = {0, 1, 2, 3, 4, 5};
+extern void abort (void);
+void __attribute__((noinline,noclone))
+foo (long long sum)
+{
+ asm ("");
+}
+int main()
+{
+ int i, n = 5;
+ long long sum = 0, prevsum = 0;
+
+ for(i = 1; i <= n; i++)
+ {
+ foo (sum);
+ sum = (i - 1) * arr[i] - prevsum;
+ prevsum += arr[i];
+ }
+
+ if (sum != 10)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58539.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58539.c
new file mode 100644
index 000000000..a016150f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58539.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+int a, b;
+
+extern void baz (int);
+
+int foo (int p)
+{
+ return p ? p : 1;
+}
+
+void bar ()
+{
+ int *c = &a, *d = &a;
+ for (b = 0; b < 12; b++)
+ *d |= 1;
+ foo (*c);
+ baz (*c && 1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58553.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58553.c
new file mode 100644
index 000000000..542bf3f10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58553.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+#define MAX_LENGTH 96
+#define SEQUENCE_LENGTH 31
+
+static struct {
+ char buf[MAX_LENGTH + 1];
+} u1, u2;
+
+extern void abort (void);
+
+int main ()
+{
+ int i;
+ char c;
+
+ for (i = 0, c = 'A'; i < MAX_LENGTH; i++, c++)
+ {
+ u1.buf[i] = 'a';
+ if (c >= 'A' + SEQUENCE_LENGTH)
+ c = 'A';
+ u2.buf[i] = c;
+ }
+ if (u1.buf[MAX_LENGTH] != '\0')
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58554.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58554.c
new file mode 100644
index 000000000..269171ae9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58554.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+extern void abort (void);
+void __attribute__((noinline,noclone))
+clear_board(unsigned char *board, int board_size)
+{
+ int k;
+ for (k = 0; k < 421; k++)
+ if (k < board_size )
+ board[k] = 3;
+}
+int main()
+{
+ unsigned char board[421];
+ board[420] = 1;
+ clear_board (board, 420);
+ if (board[420] != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58626.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58626.c
new file mode 100644
index 000000000..1416384b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58626.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int a[8][6] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
+int b;
+
+int main(void)
+{
+ for (b = 0; b <= 1; b++) {
+ a[1][3] = 0;
+ int c;
+ for (c = 0; c <= 1; c++) {
+ a[c + 1][b] = a[c + 2][b];
+ }
+ }
+ if (a[1][1] != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58670.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58670.c
new file mode 100644
index 000000000..ba9fce71f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58670.c
@@ -0,0 +1,47 @@
+/* PR middle-end/58670 */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+
+#if defined (__i386__) || defined (__x86_64__)
+#define ASM_STR "btsl $1, %0; jc %l[lab]"
+#endif
+
+__attribute__((noinline, noclone)) int
+foo (int a, int b)
+{
+ if (a)
+ return -3;
+#ifdef ASM_STR
+ asm volatile goto (ASM_STR : : "m" (b) : "memory" : lab);
+ return 0;
+lab:
+#endif
+ return 0;
+}
+
+int
+bar (int a, int b)
+{
+ if (a)
+ return -3;
+#ifdef ASM_STR
+ asm volatile goto (ASM_STR : : "m" (b) : "memory" : lab);
+ return 0;
+lab:
+#endif
+ return 0;
+}
+
+int
+main ()
+{
+ if (foo (1, 0) != -3
+ || foo (0, 3) != 0
+ || foo (1, 0) != -3
+ || foo (0, 0) != 0
+ || bar (1, 0) != -3
+ || bar (0, 3) != 0
+ || bar (1, 0) != -3
+ || bar (0, 0) != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58779.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58779.c
new file mode 100644
index 000000000..b0c0c8695
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58779.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+
+int a, c;
+
+int main ()
+{
+ int e = -1;
+ short d = (c <= 0) ^ e;
+ if ((unsigned int) a - (a || d) <= (unsigned int) a)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58830.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58830.c
new file mode 100644
index 000000000..8081f8b2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58830.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-additional-options "-ftree-pre -ftree-partial-pre" } */
+
+extern void abort (void);
+
+int b, c, d, f, g, h, i, j[6], *l = &b, *m, n, *o, r;
+char k;
+
+static int
+foo ()
+{
+ char *p = &k;
+
+ for (; d; d++)
+ if (i)
+ h = 0;
+ else
+ h = c || (r = 0);
+
+ for (f = 0; f < 2; f++)
+ {
+ unsigned int q;
+ *l = 0;
+ if (n)
+ *m = g;
+ if (g)
+ o = 0;
+ for (q = -8; q >= 5; q++)
+ (*p)--;
+ }
+
+ return 0;
+}
+
+int
+main ()
+{
+ foo ();
+ if (j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[j[0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ^ (k & 15)] != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58921.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58921.c
new file mode 100644
index 000000000..7d7c98514
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58921.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+int a[7];
+int b;
+
+void
+fn1 ()
+{
+ for (; b; b++)
+ a[b] = ((a[b] <= 0) == (a[0] != 0));
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58941.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58941.c
new file mode 100644
index 000000000..c0eea0731
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58941.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+typedef struct {
+ int msgLength;
+ unsigned char data[1000];
+} SMsg;
+
+typedef struct {
+ int dummy;
+ int d[0];
+} SData;
+
+int condition = 3;
+
+int main()
+{
+ SMsg msg;
+ SData *pData = (SData*)(msg.data);
+ unsigned int i = 0;
+ for (i = 0; i < 1; i++)
+ {
+ pData->d[i] = 0;
+ if(condition & 1)
+ pData->d[i] |= 0x55;
+ if(condition & 2)
+ pData->d[i] |= 0xaa;
+ }
+ if (pData->d[0] != 0xff)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58955-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58955-1.c
new file mode 100644
index 000000000..a79f42f0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58955-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int a, b, c, d[4] = { 0, 0, 0, 1 };
+
+int
+main ()
+{
+ for (; a < 4; a++)
+ {
+ int e = d[a];
+ for (c = 1; c < 1; c++);
+ b = e;
+ d[a] = 0;
+ }
+ if (b != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58955-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58955-2.c
new file mode 100644
index 000000000..a43860e9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58955-2.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int a, b[10];
+
+int
+main ()
+{
+ for (; a < 2; a++)
+ {
+ b[a] = 1;
+ b[a + 1] = 0;
+ }
+ if (b[1] != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58956.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58956.c
new file mode 100644
index 000000000..7576ba7fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr58956.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct S
+{
+ int f0;
+} a = {1}, b, g, *c = &b, **f = &c;
+
+int *d, **e = &d, h;
+
+struct S
+foo ()
+{
+ *e = &h;
+ if (!d)
+ __builtin_unreachable ();
+ *f = &g;
+ return a;
+}
+
+int
+main ()
+{
+ struct S *i = c;
+ *i = foo ();
+ if (b.f0 != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59006.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59006.c
new file mode 100644
index 000000000..34de83dac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59006.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+int a[8], b;
+void fn1(void)
+{
+ int c;
+ for (; b; b++)
+ {
+ int d = a[b];
+ c = a[0] ? d : 0;
+ a[b] = c;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59038.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59038.c
new file mode 100644
index 000000000..1694eca43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59038.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+unsigned char first_ones_8bit[256];
+unsigned char connected_passed[256];
+
+int
+main ()
+{
+ int i, j;
+ for (i=0;i<256;i++){
+ connected_passed[i]=0;
+ first_ones_8bit[i]=0;
+ for (j=7;j>0;j--){
+ if ((i & (3<<(7-j))) == (3<<(7-j))){
+ connected_passed[i]=j;
+ break;
+ }
+ }
+ }
+ if (connected_passed[3] != 7)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59047.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59047.c
new file mode 100644
index 000000000..fcedfcba8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59047.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct
+{
+ int f0;
+ int f1:1;
+ int f2:2;
+} a = {0, 0, 1};
+
+int b, c, *d, e, f;
+
+int
+fn1 ()
+{
+ for (; b < 1; ++b)
+ {
+ for (e = 0; e < 1; e = 1)
+ {
+ int **g = &d;
+ *g = &c;
+ }
+ *d = 0;
+ f = a.f1;
+ if (f)
+ return 0;
+ }
+ return 0;
+}
+
+int
+main ()
+{
+ fn1 ();
+ if (b != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59058.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59058.c
new file mode 100644
index 000000000..b3a5a3960
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59058.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+short b = 0;
+
+int
+main ()
+{
+ int c = 0;
+l1:
+ b++;
+ c |= b;
+ if (b)
+ goto l1;
+ if (c != -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59139.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59139.c
new file mode 100644
index 000000000..4ec9177ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59139.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+int a, b, c, d, e;
+int fn1(p1, p2) { return p2 == 0 ? p1 : 1 % p2; }
+
+void fn2()
+{
+ c = 0;
+ for (;; c = (unsigned short)c)
+ {
+ b = 2;
+ for (; b; b = a)
+ {
+ e = fn1(2, c && 1);
+ d = c == 0 ? e : c;
+ if (d)
+ return;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59164.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59164.c
new file mode 100644
index 000000000..1ec69610c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59164.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+int a, d, e;
+long b[10];
+int c[10][8];
+
+int fn1(p1)
+{
+ return 1 >> p1;
+}
+
+void fn2(void)
+{
+ int f;
+ for (a=1; a <= 4; a++)
+ {
+ f = fn1(0 < c[a][0]);
+ if (f || d)
+ e = b[a] = 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59166.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59166.c
new file mode 100644
index 000000000..d29ec33e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59166.c
@@ -0,0 +1,37 @@
+/* PR rtl-optimization/59166 */
+/* { dg-additional-options "-fcompare-debug" } */
+
+int a, b, c, f, g;
+
+void
+foo ()
+{
+ for (; b; b++)
+ for (; f; f = g)
+ for (; a;)
+ ;
+}
+
+static int
+bar (int p)
+{
+ short d;
+ if (c)
+ {
+ for (; f; f = g);
+ foo ();
+ d = p;
+ char e = d;
+ if (p)
+ return 1;
+ }
+ return p;
+}
+
+int
+main ()
+{
+ bar (0);
+ bar (g);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59216.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59216.c
new file mode 100644
index 000000000..0de51bac9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59216.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+
+#include <limits.h>
+
+extern void abort (void);
+extern void exit (int);
+
+long long __attribute__((noinline)) f(int a)
+{
+ return -(long long) a;
+}
+
+int
+main()
+{
+ if (f(0) != 0)
+ abort ();
+
+ if (f(1) != -(long long)1)
+ abort ();
+
+ if (f(-1) != -(long long)-1)
+ abort ();
+
+ if (f(INT_MIN) != -(long long)INT_MIN)
+ abort ();
+
+ if (f(INT_MAX) != -(long long)INT_MAX)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59245.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59245.c
new file mode 100644
index 000000000..e5b9a0fb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59245.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+
+int a, b, c, e, g;
+char d[5], f;
+
+int
+fn1 ()
+{
+ if (b)
+ {
+ g = 0;
+ return 0;
+ }
+ for (f = 0; f != 1; f--)
+ ;
+ return 0;
+}
+
+void
+fn2 ()
+{
+ d[4] = -1;
+ for (a = 4; a; a--)
+ {
+ fn1 ();
+ e = c < -2147483647 - 1 - d[a] ? c : 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59288.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59288.c
new file mode 100644
index 000000000..8331e7328
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59288.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void
+baz (int *d)
+{
+ long int i, j, k;
+ for (i = 0, j = 0, k = 0; i < 512; i = (int) i + 1, j = (int) j + 1, k = (int) k + 3)
+ d[i] = j ^ (i * 3) ^ (2 * k + 2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59330.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59330.c
new file mode 100644
index 000000000..74b832ea3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59330.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+void free(void *ptr)
+{
+}
+
+void *foo(void)
+{
+ return 0;
+}
+
+int main(void)
+{
+ void *p = foo();
+ free(p);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59338.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59338.c
new file mode 100644
index 000000000..481c84d4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59338.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+typedef enum
+{
+ XYZZY,
+} enumType;
+
+typedef struct
+{
+ unsigned char More : 1;
+} tResp;
+
+typedef struct
+{
+ enumType QueryType;
+ union
+ {
+ tResp l[0];
+ } u;
+} tQResp;
+
+void test(void)
+{
+ tQResp *qResp = (0);
+ if (qResp->u.l[0].More == 0)
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-1.c
new file mode 100644
index 000000000..6230ae9ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-additional-options "-ftree-slp-vectorize" } */
+
+extern void abort (void);
+
+static struct X { void *a; void *b; } a, b;
+
+void __attribute__((noinline))
+foo (void)
+{
+ void *tem = a.b;
+ a.b = (void *)0;
+ b.b = tem;
+ b.a = a.a;
+}
+
+int main()
+{
+ a.b = &a;
+ foo ();
+ if (b.b != &a)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-2.c
new file mode 100644
index 000000000..d791b987e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-2.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-additional-options "-ftree-slp-vectorize" } */
+
+extern void abort (void);
+
+static struct X { void *a; void *b; } a, b;
+static struct X *p;
+
+void __attribute__((noinline))
+foo (void)
+{
+ void *tem = a.b;
+ p->b = (void *)0;
+ b.b = tem;
+ b.a = a.a;
+}
+
+int main()
+{
+ p = &a;
+ a.b = &a;
+ foo ();
+ if (b.b != &a)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c
new file mode 100644
index 000000000..ab0014d8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59374-3.c
@@ -0,0 +1,21 @@
+extern void abort (void);
+
+static struct X { void *a; void *b; } a, b;
+
+void __attribute__((noinline)) foo (void)
+{
+ void *tem = a.b;
+ a.b = (void *)0;
+ b.b = tem;
+ b.a = a.a;
+ a.a = tem;
+}
+
+int main()
+{
+ a.b = &a;
+ foo ();
+ if (b.b != &a)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59651.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59651.c
new file mode 100644
index 000000000..7139ba9bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59651.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/59561 */
+/* { dg-do run } */
+
+extern void abort (void);
+int a[] = { 0, 0, 0, 0, 0, 0, 0, 6 };
+
+int b;
+int
+main ()
+{
+ for (;;)
+ {
+ for (b = 7; b; --b)
+ a[b] = a[7] > 1;
+ break;
+ }
+ if (a[1] != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59715.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59715.c
new file mode 100644
index 000000000..19c09de55
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59715.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int a = 2, b;
+
+int
+main ()
+{
+ int c;
+ if (!b)
+ {
+ b = a;
+ c = a == 0 ? 1 : 1 % a;
+ if (c)
+ b = 0;
+ }
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59891.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59891.c
new file mode 100644
index 000000000..1562acccf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59891.c
@@ -0,0 +1,9 @@
+/* PR c/59891 */
+
+unsigned int a;
+
+int
+main ()
+{
+ return (0 ? a : 0) ? : 0 % 0; /* { dg-warning "division by zero" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59903.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59903.c
new file mode 100644
index 000000000..01772df61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59903.c
@@ -0,0 +1,56 @@
+/* { dg-do compile } */
+
+int a, b, c, d, e, f, g, h, i[3], l, m, n, o, p, q, r;
+
+struct S0
+{
+ int f0;
+ int f1;
+ int f2;
+ int f3;
+} j;
+
+static int
+fn1 (int p1)
+{
+ return p1 || ((p1 > 0) > (e << 1));
+}
+
+static struct S0
+fn2 (struct S0 p1)
+{
+ char s;
+ struct S0 t = {0,0,0,0};
+ int u = 2;
+ for (;;)
+ {
+ if (i[0])
+ break;
+ for (m = 0; m < 4; m++)
+ for (p1.f0 = 0; p1.f0 < 3; p1.f0++)
+ {
+ j = t;
+ t.f3 = i[p1.f0];
+ o = b || 1 >> b ? 0 : a < 0;
+ q = 1 % d;
+ if ((g < fn1 ((1 ^ (q & 1)) | n)) ^ u)
+ j.f3 |= p % 2;
+ s = j.f3 > 0 ? j.f3 : j.f3 << 1;
+ r = l = s && p1.f1 * c;
+ h = p1.f1;
+ }
+ }
+ return p1;
+}
+
+int
+main ()
+{
+ for (;f;)
+ {
+ struct S0 v = {0,0,0,0};
+ fn2 (v);
+ j.f3 = 0;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59990.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59990.c
new file mode 100644
index 000000000..e54f9b7ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59990.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+unsigned char value[4] = { 66, 9, 160, 255 };
+
+int main (void)
+{
+ volatile float f;
+ unsigned char a[4];
+
+ __builtin_memcpy ((void *)&f, value, 4);
+ __builtin_memcpy (a, (void *)&f, 4);
+ if (a[2] != 160)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59993.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59993.c
new file mode 100644
index 000000000..be55a10b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr59993.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+#include <setjmp.h>
+
+extern int optind;
+jmp_buf jump_buf;
+int
+main (int argc, char **argv)
+{
+ foo (jump_buf, setjmp(jump_buf));
+ argv += optind;
+ bar(argv[1]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60092.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60092.c
new file mode 100644
index 000000000..a85720c60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60092.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-require-weak "" } */
+/* { dg-skip-if "No undefined weak" { hppa*-*-hpux* && { ! lp64 } } { "*" } { "" } } */
+/* { dg-xfail-run-if "posix_memalign modifies first arg on error" { *-*-solaris2.11* } { "-O0" } } */
+
+typedef __SIZE_TYPE__ size_t;
+extern int posix_memalign(void **memptr, size_t alignment, size_t size) __attribute__((weak));
+extern void abort(void);
+int
+main (void)
+{
+ void *p;
+ int ret;
+
+ if (!posix_memalign)
+ return 0;
+
+ p = (void *)&ret;
+ ret = posix_memalign (&p, sizeof (void *), -1);
+ if (p != (void *)&ret)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60115.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60115.c
new file mode 100644
index 000000000..cf7f45dfb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60115.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+
+int a, b[2];
+
+int
+main ()
+{
+lbl:
+ for (; a; a--)
+ if (b[10000])
+ goto lbl;
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60183.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60183.c
new file mode 100644
index 000000000..3f676637b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60183.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-require-effective-target size32plus } */
+
+/* Large so an out-of-bound read will crash. */
+unsigned char c[0x30001] = { 1 };
+int j = 2;
+
+static void
+foo (unsigned long *x, unsigned char *y)
+{
+ int i;
+ unsigned long w = x[0];
+ for (i = 0; i < j; i++)
+ {
+ w += *y;
+ y += 0x10000;
+ w += *y;
+ y += 0x10000;
+ }
+ x[1] = w;
+}
+
+__attribute__ ((noinline, noclone)) void
+bar (unsigned long *x)
+{
+ foo (x, c);
+}
+
+int
+main ()
+{
+ unsigned long a[2] = { 0, -1UL };
+ asm volatile (""::"r" (c):"memory");
+ c[0] = 0;
+ bar (a);
+ if (a[1] != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr8081.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr8081.c
new file mode 100644
index 000000000..008ec5a14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr8081.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+
+extern void abort (void);
+int
+main (int argc, char **argv)
+{
+ int size = 10;
+ typedef struct
+ {
+ char val[size];
+ }
+ block;
+ block a, b;
+ block __attribute__((noinline))
+ retframe_block ()
+ {
+ return *(block *) &b;
+ }
+ b.val[0] = 1;
+ b.val[9] = 2;
+ a=retframe_block ();
+ if (a.val[0] != 1
+ || a.val[9] != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
new file mode 100644
index 000000000..5ca71c2a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-callused-1.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+volatile int i;
+int ** __attribute__((noinline,pure)) foo(int **p) { i; return p; }
+int bar(void)
+{
+ int i = 0, j = 1;
+ int *p, **q;
+ p = &i;
+ q = foo(&p);
+ *q = &j;
+ return *p;
+}
+extern void abort (void);
+int main()
+{
+ if (bar() != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "p.._. = { i j }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-escape-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-escape-1.c
new file mode 100644
index 000000000..d3cb25437
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-escape-1.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+int *p;
+void __attribute__((noinline,noclone))
+bar (void)
+{
+ *p = 1;
+}
+int __attribute__((noinline,noclone))
+foo (__INTPTR_TYPE__ addr)
+{
+ int i;
+ /* q points to ANYTHING */
+ int **q = (int **)addr;
+ /* this store needs to cause i to escape */
+ *q = &i;
+ i = 0;
+ /* and thus be clobbered by this function call */
+ bar ();
+ return i;
+}
+extern void abort (void);
+int
+main()
+{
+ if (foo ((__INTPTR_TYPE__)&p) != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "ESCAPED = {\[^\n\}\]* i \[^\n\}\]*}" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c
new file mode 100644
index 000000000..ab5634da9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+struct Foo {
+ int *p;
+};
+
+void __attribute__((noinline))
+foo (void *p)
+{
+ struct Foo *f = (struct Foo *)p - 1;
+ *f->p = 0;
+}
+
+int bar (void)
+{
+ struct Foo f;
+ int i = 1;
+ f.p = &i;
+ foo (&f + 1);
+ return i;
+}
+extern void abort (void);
+int main()
+{
+ if (bar () != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "ESCAPED = {\[^\n\}\]* i f \[^\n\}\]*}" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c
new file mode 100644
index 000000000..1158775ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-2.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+struct Foo {
+ int **p;
+ int **q;
+};
+
+int __attribute__((noinline))
+bar (void)
+{
+ struct Foo f;
+ int j, i = 1;
+ char *p;
+ int *x = &i;
+ int *y = &j;
+ f.p = &y;
+ f.q = &x;
+ p = (char *)&f;
+ for (j = 0; j < sizeof (int *); ++j)
+ p++;
+ return ***(int ***)p;
+}
+extern void abort (void);
+int main()
+{
+ if (bar () != 1)
+ abort ();
+ return 0;
+}
+
+/* In theory = { i } is the correct solution. But it's not easy to scan
+ for that reliably, so just use what we create now. */
+/* { dg-final { scan-tree-dump "= { i j }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c
new file mode 100644
index 000000000..938fb296b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+extern void abort (void);
+struct X {
+ int *p;
+ int *q;
+ int *r;
+};
+int __attribute__((noinline))
+foo(int i, int j, int k, int off)
+{
+ struct X x;
+ int **p, *q;
+ x.p = &i;
+ x.q = &j;
+ x.r = &k;
+ p = &x.q;
+ p += off;
+ /* *p points to { i, j, k } */
+ q = *p;
+ return *q;
+}
+int main()
+{
+ if (foo(1, 2, 3, -1) != 1)
+ abort ();
+ if (foo(1, 2, 3, 0) != 2)
+ abort ();
+ if (foo(1, 2, 3, 1) != 3)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "q_. = { i j k }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c
new file mode 100644
index 000000000..4846dd698
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-ealias -Wno-attributes" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
+
+struct X
+{
+ long l1;
+ struct Y
+ {
+ long l2;
+ int *p;
+ } y;
+};
+int i;
+static int __attribute__((always_inline))
+foo (struct X *x)
+{
+ struct Y y = x->y;
+ /* In the inlined instance the dereferenced pointer needs to point to i. */
+ *y.p = 0;
+ i = 1;
+ return *y.p;
+}
+extern void abort (void);
+int main()
+{
+ struct X x;
+ x.y.p = &i;
+ if (foo(&x) != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "y.* = { i }" "ealias" } } */
+/* { dg-final { scan-tree-dump "y.*, points-to vars: { D..... }" "ealias" } } */
+/* { dg-final { cleanup-tree-dump "ealias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/reassoc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/reassoc-1.c
new file mode 100644
index 000000000..f0c9014cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/reassoc-1.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+
+int x;
+
+int __attribute__((noinline))
+foo(int a, int b, int w)
+{
+ int tmp1 = a * w;
+ int tmp2 = b * w;
+ x = tmp1;
+ return tmp1 + tmp2;
+}
+
+extern void abort (void);
+
+int main()
+{
+ if (foo(1, 2, 3) != 9)
+ abort ();
+ if (x != 3)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-1.c
new file mode 100644
index 000000000..e7af4f538
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-1.c
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+
+extern void abort (void);
+void __attribute__((noinline,noclone))
+foo (int ** __restrict__ p, int ** __restrict__ q)
+{
+ **p = **q;
+}
+int main()
+{
+ int x = 0, y = 1, *i = &x, *j = &y;
+ foo (&i, &j);
+ if (x != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-2.c
new file mode 100644
index 000000000..ec51ade61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-2.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+static inline void
+foo (int * p)
+{
+ int * __restrict pr = p;
+ *pr = 1;
+}
+
+int __attribute__((noinline,noclone))
+bar (int *q)
+{
+ int * __restrict qr = q;
+ *qr = 0;
+ foo (qr);
+ return *qr;
+}
+
+int main()
+{
+ int i;
+ if (bar (&i) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c
new file mode 100644
index 000000000..d815b8076
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-3.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+static inline void
+foo (int * __restrict pr)
+{
+ *pr = 1;
+}
+
+int __attribute__((noinline,noclone))
+bar (int *q)
+{
+ int * __restrict qr = q;
+ *qr = 0;
+ foo (qr);
+ return *qr;
+}
+
+int main()
+{
+ int i;
+ if (bar (&i) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-4.c
new file mode 100644
index 000000000..52994d48b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-4.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+static inline void
+foo (int * p)
+{
+ int * __restrict pr = p;
+ *pr = 1;
+}
+
+int __attribute__((noinline,noclone))
+bar (int * __restrict qr)
+{
+ *qr = 0;
+ foo (qr);
+ return *qr;
+}
+
+int main()
+{
+ int i;
+ if (bar (&i) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-5.c
new file mode 100644
index 000000000..233a9075f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/restrict-5.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+static inline void
+foo (int * __restrict pr)
+{
+ *pr = 1;
+}
+
+int __attribute__((noinline,noclone))
+bar (int * __restrict qr)
+{
+ *qr = 0;
+ foo (qr);
+ return *qr;
+}
+
+int main()
+{
+ int i;
+ if (bar (&i) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c
new file mode 100644
index 000000000..a90b1c62d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/ssa-pta-fn-1.c
@@ -0,0 +1,62 @@
+/* { dg-do run } */
+/* { dg-options "-fdump-tree-alias" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */
+
+extern void abort (void);
+int *glob;
+int dummy;
+
+int * __attribute__((noinline,const))
+foo_const(int *p) { return p; }
+
+int * __attribute__((noinline,pure))
+foo_pure(int *p) { return p + dummy; }
+
+int * __attribute__((noinline))
+foo_normal(int *p) { glob = p; return p; }
+
+void test_const(void)
+{
+ int i;
+ int *p = &i;
+ int *q_const = foo_const(p);
+ *p = 1;
+ *q_const = 2;
+ if (*p != 2)
+ abort ();
+}
+
+void test(void)
+{
+ int i;
+ int *p = &i;
+ int *q_normal = foo_normal(p);
+ *p = 1;
+ *q_normal = 2;
+ if (*p != 2)
+ abort ();
+}
+
+void test_pure(void)
+{
+ int i;
+ int *p = &i;
+ int *q_pure = foo_pure(p);
+ *p = 1;
+ *q_pure = 2;
+ if (*p != 2)
+ abort ();
+}
+
+int main()
+{
+ test_const();
+ test();
+ test_pure();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "q_const_. = { NONLOCAL i }" "alias" } } */
+/* { dg-final { scan-tree-dump "q_pure_. = { ESCAPED NONLOCAL i }" "alias" } } */
+/* { dg-final { scan-tree-dump "q_normal_. = { ESCAPED NONLOCAL }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c
new file mode 100644
index 000000000..e226e7f03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+foo (int size)
+{
+ char *p = __builtin_alloca (size + 1);
+ aligned i;
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main()
+{
+ foo (5);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
new file mode 100644
index 000000000..2ef17629d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-2.c
@@ -0,0 +1,49 @@
+/* PR middle-end/37009 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-additional-options "-mmmx -msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+#include <emmintrin.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 16
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+__attribute__ ((noinline))
+foo (__m128 x, __m128 y ,__m128 z , int size)
+{
+ char *p = __builtin_alloca (size + 1);
+ aligned i;
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main (void)
+{
+ __m128 x = { 1.0 };
+ foo (x, x, x, 5);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
new file mode 100644
index 000000000..c3dd12479
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-3.c
@@ -0,0 +1,49 @@
+/* PR middle-end/37009 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-additional-options "-mmmx -msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+#include <emmintrin.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 16
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+__attribute__ ((noinline))
+foo (__m128 x, __m128 y ,__m128 z ,__m128 a, int size)
+{
+ char *p = __builtin_alloca (size + 1);
+ aligned i;
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main (void)
+{
+ __m128 x = { 1.0 };
+ foo (x, x, x, x, 5);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c
new file mode 100644
index 000000000..bc16f5789
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-4.c
@@ -0,0 +1,41 @@
+/* PR middle-end/37009 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
+
+#include "check.h"
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+__attribute__ ((noinline))
+foo (double x, double y ,double z ,double a, int size)
+{
+ char *p = __builtin_alloca (size + 1);
+ double i;
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ check (&i, __alignof__(i));
+}
+
+int
+main (void)
+{
+ double x = 1.0 ;
+
+ foo (x, x, x, x, 5);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c
new file mode 100644
index 000000000..4c6506d1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-5.c
@@ -0,0 +1,32 @@
+/* PR middle-end/45234 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
+
+#include "check.h"
+
+void
+__attribute__ ((noinline))
+bar (__float128 f)
+{
+ check (&f, __alignof__(f));
+}
+
+int
+main (void)
+{
+ char *p = __builtin_alloca (6);
+
+ bar (0);
+
+ __builtin_strncpy (p, "good", 5);
+ if (__builtin_strncmp (p, "good", 5) != 0)
+ {
+#ifdef DEBUG
+ p[5] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-6.c
new file mode 100644
index 000000000..301fff7a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/alloca-6.c
@@ -0,0 +1,34 @@
+/* PR middle-end/45234 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-additional-options "-mincoming-stack-boundary=2 -mpreferred-stack-boundary=2" } */
+
+#include "check.h"
+
+void
+__attribute__ ((noinline))
+bar (__float128 f)
+{
+ check (&f, __alignof__(f));
+}
+
+volatile int z = 6;
+
+int
+main (void)
+{
+ char *p = __builtin_alloca (z);
+
+ bar (0);
+
+ __builtin_strncpy (p, "good", 5);
+ if (__builtin_strncmp (p, "good", 5) != 0)
+ {
+#ifdef DEBUG
+ p[z - 1] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-1.c
new file mode 100644
index 000000000..38b384e7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-1.c
@@ -0,0 +1,9 @@
+/* PR 11184 */
+/* Origin: Dara Hazeghi <dhazeghi@yahoo.com> */
+
+void *
+objc_msg_sendv (char * arg_frame, void (*foo)())
+{
+ return __builtin_apply ( foo, arg_frame, 4);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
new file mode 100644
index 000000000..8eba13aed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
@@ -0,0 +1,48 @@
+/* PR target/12503 */
+/* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */
+
+/* Verify that __builtin_apply behaves correctly on targets
+ with pre-pushed arguments (e.g. SPARC). */
+
+/* { dg-do run } */
+
+/* arm_hf_eabi: Variadic funcs use Base AAPCS. Normal funcs use VFP variant.
+ avr: Variadic funcs don't pass arguments in registers, while normal funcs
+ do. */
+/* { dg-skip-if "Variadic funcs use different argument passing from normal funcs" { arm_hf_eabi || { avr-*-* } } "*" "" } */
+/* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { nds32*-*-* } "*" "" } */
+
+
+#define INTEGER_ARG 5
+
+#if defined(__ARM_PCS) || defined(__epiphany__)
+/* For Base AAPCS, NAME is passed in r0. D is passed in r2 and r3.
+ E, F and G are passed on stack. So the size of the stack argument
+ data is 20. */
+#define STACK_ARGUMENTS_SIZE 20
+#elif defined __aarch64__ || defined __arc__ || defined __MMIX__
+/* No parameters on stack for bar. */
+#define STACK_ARGUMENTS_SIZE 0
+#else
+#define STACK_ARGUMENTS_SIZE 64
+#endif
+
+extern void abort(void);
+
+void foo(char *name, double d, double e, double f, int g)
+{
+ if (g != INTEGER_ARG)
+ abort();
+}
+
+void bar(char *name, ...)
+{
+ __builtin_apply(foo, __builtin_apply_args(), STACK_ARGUMENTS_SIZE);
+}
+
+int main(void)
+{
+ bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-3.c
new file mode 100644
index 000000000..1335d0902
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-3.c
@@ -0,0 +1,31 @@
+/* PR middle-end/12210 */
+/* Origin: Ossadchy Yury A. <waspcoder@mail.ru> */
+
+/* This used to fail on i686 because the argument was not copied
+ to the right location by __builtin_apply after the direct call. */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+void foo(int arg)
+{
+ if (arg != INTEGER_ARG)
+ abort();
+}
+
+void bar(int arg)
+{
+ foo(arg);
+ __builtin_apply(foo, __builtin_apply_args(), 16);
+}
+
+int main(void)
+{
+ bar(INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c
new file mode 100644
index 000000000..28dc6106d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/20076 */
+/* { dg-do run } */
+
+extern void abort (void);
+
+double
+foo (int arg)
+{
+ if (arg != 116)
+ abort();
+ return arg + 1;
+}
+
+inline double
+bar (int arg)
+{
+ foo (arg);
+ __builtin_return (__builtin_apply ((void (*) ()) foo,
+ __builtin_apply_args (), 16));
+}
+
+int
+main (int argc, char **argv)
+{
+ if (bar (116) != 117.0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c
new file mode 100644
index 000000000..75c9acdf7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c
@@ -0,0 +1,34 @@
+/* PR middle-end/11151 */
+/* Originator: Andrew Church <gcczilla@achurch.org> */
+/* { dg-do run } */
+
+/* This used to fail on SPARC because the (undefined) return
+ value of 'bar' was overwriting that of 'foo'. */
+
+extern void abort(void);
+
+int foo(int n)
+{
+ return n+1;
+}
+
+int bar(int n)
+{
+ __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(), 64));
+}
+
+char *g;
+
+int main(void)
+{
+ /* Allocate 64 bytes on the stack to make sure that __builtin_apply
+ can read at least 64 bytes above the return address. */
+ char dummy[64];
+
+ g = dummy;
+
+ if (bar(1) != 2)
+ abort();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/check.h b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/check.h
new file mode 100644
index 000000000..af1988512
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/check.h
@@ -0,0 +1,36 @@
+#include <stddef.h>
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" void abort (void);
+#else
+extern void abort (void);
+#endif
+
+int
+check_int (int *i, int align)
+{
+ *i = 20;
+ if ((((ptrdiff_t) i) & (align - 1)) != 0)
+ {
+#ifdef DEBUG
+ printf ("\nUnalign address (%d): %p!\n", align, i);
+#endif
+ abort ();
+ }
+ return *i;
+}
+
+void
+check (void *p, int align)
+{
+ if ((((ptrdiff_t) p) & (align - 1)) != 0)
+ {
+#ifdef DEBUG
+ printf ("\nUnalign address (%d): %p!\n", align, p);
+#endif
+ abort ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c
new file mode 100644
index 000000000..7558f01e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c
@@ -0,0 +1,41 @@
+/* { dg-do run } */
+
+#ifdef STACK_SIZE
+#define DEPTH ((STACK_SIZE) / 512 + 1)
+#else
+#define DEPTH 1000
+#endif
+
+extern void abort (void);
+extern void exit (int);
+
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+int
+x(a)
+{
+ __label__ xlab;
+ void y(a)
+ {
+ void *x = &&llab;
+ if (a==-1)
+ goto *x;
+ if (a==0)
+ goto xlab;
+ llab:
+ y (a-1);
+ }
+ y (a);
+ xlab:;
+ return a;
+}
+#endif
+
+int
+main ()
+{
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+ if (x (DEPTH) != DEPTH)
+ abort ();
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/fastcall-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/fastcall-1.c
new file mode 100644
index 000000000..24dab4d13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/fastcall-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+__attribute__ ((fastcall))
+void
+foo (int j, int k, int m, int n, int o)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (i != 20 || j != 1 || k != 2 || m != 3 || n != 4 || o != 5)
+ abort ();
+}
+
+int
+main()
+{
+ foo (1, 2, 3, 4, 5);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c
new file mode 100644
index 000000000..332103a76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+foo (void)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c
new file mode 100644
index 000000000..38127fd50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+static void
+inline __attribute__((always_inline))
+foo (void)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c
new file mode 100644
index 000000000..85a2ee3f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+static void
+inline __attribute__((always_inline))
+foo (int size)
+{
+ char *p = __builtin_alloca (size + 1);
+ aligned i;
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main()
+{
+ foo (5);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c
new file mode 100644
index 000000000..8402f95f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+foo (void)
+{
+ aligned j;
+
+ void bar ()
+ {
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+
+ j = -20;
+ }
+ bar ();
+
+ if (j != -20)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c
new file mode 100644
index 000000000..dabc310d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+foo (void)
+{
+ aligned j;
+
+ __attribute__ ((__noinline__))
+ void bar ()
+ {
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+
+ j = -20;
+ }
+ bar ();
+
+ if (j != -20)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c
new file mode 100644
index 000000000..d35c9a7ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c
@@ -0,0 +1,63 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+copy (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+foo (int size)
+{
+ aligned j;
+
+ __attribute__ ((__noinline__))
+ void bar (int size)
+ {
+ char *p = __builtin_alloca (size + 1);
+ aligned i;
+
+ copy (p, size);
+ if (strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+
+ j = -20;
+ }
+ bar (size);
+
+ if (j != -20)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+}
+
+int
+main()
+{
+ foo (5);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c
new file mode 100644
index 000000000..05cb83301
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int n;
+
+void
+g (void)
+{
+ __label__ lab;
+ void h (void)
+ {
+ aligned t;
+ if (check_int (&t, __alignof__(t)) != t)
+ abort ();
+ if (n+t == 0) goto lab;
+ }
+ h();
+lab:
+ return;
+}
+
+int main()
+{
+ g();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c
new file mode 100644
index 000000000..95eba0482
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+
+extern void abort (void);
+extern void exit (int);
+
+#ifndef NO_TRAMPOLINES
+static void recursive (int n, void (*proc) (void))
+{
+ __label__ l1;
+
+ void do_goto (void)
+ {
+ goto l1;
+ }
+
+ if (n == 3)
+ recursive (n - 1, do_goto);
+ else if (n > 0)
+ recursive (n - 1, proc);
+ else
+ (*proc) ();
+ return;
+
+l1:
+ if (n == 3)
+ exit (0);
+ else
+ abort ();
+}
+
+int main ()
+{
+ recursive (10, abort);
+ abort ();
+}
+#else
+int main () { return 0; }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c
new file mode 100644
index 000000000..d853825fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+#ifndef NO_TRAMPOLINES
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+
+int main ()
+{
+ __label__ nonlocal;
+ int compare (const void *a, const void *b)
+ {
+ goto nonlocal;
+ }
+
+ char array[3];
+ qsort (array, 3, 1, compare);
+ abort ();
+
+ nonlocal:
+ exit (0);
+}
+
+#else
+int main() { return 0; }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-1.c
new file mode 100644
index 000000000..263d4486c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-1.c
@@ -0,0 +1,55 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int global;
+
+static void foo(void) __attribute__((noinline));
+
+static void foo(void)
+{
+ global = 1;
+}
+
+static void bar(void)
+{
+ foo ();
+}
+
+int execute(int cmd)
+{
+ __label__ start;
+
+ void raise(void)
+ {
+ goto start;
+ }
+
+ int last = -1;
+
+ bar ();
+
+ last = 0;
+
+start:
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-2.c
new file mode 100644
index 000000000..5a64d5419
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-2.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int global;
+
+static void foo(void) __attribute__((noinline));
+
+static void foo(void)
+{
+ global = 1;
+}
+
+static void bar(void)
+{
+ foo ();
+ global = 0;
+}
+
+int execute(int cmd)
+{
+ __label__ start;
+
+ void raise(void)
+ {
+ goto start;
+ }
+
+ int last = -1;
+
+ bar ();
+
+ last = 0;
+
+start:
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c
new file mode 100644
index 000000000..3afc8cc6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+
+#ifndef NO_TRAMPOLINES
+extern void abort (void);
+
+int x(int a, int b)
+{
+ __label__ xlab;
+
+ void y(int b)
+ {
+ switch (b)
+ {
+ case 1: goto xlab;
+ case 2: goto xlab;
+ }
+ }
+
+ a = a + 2;
+ y (b);
+
+ xlab:
+ return a;
+}
+
+int main ()
+{
+ int i, j;
+
+ for (j = 1; j <= 2; ++j)
+ for (i = 1; i <= 2; ++i)
+ {
+ int a = x (j, i);
+ if (a != 2 + j)
+ abort ();
+ }
+
+ return 0;
+}
+#else
+int main() { return 0; }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c
new file mode 100644
index 000000000..3673f1ac3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+
+extern void abort (void);
+extern void exit (int);
+
+#ifdef STACK_SIZE
+#define DEPTH ((STACK_SIZE) / 512 + 1)
+#else
+#define DEPTH 1000
+#endif
+
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+int
+
+x(a)
+{
+ __label__ xlab;
+ void y(a)
+ {
+ if (a==0)
+ goto xlab;
+ y (a-1);
+ }
+ y (a);
+ xlab:;
+ return a;
+}
+#endif
+
+int
+main ()
+{
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+ if (x (DEPTH) != DEPTH)
+ abort ();
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c
new file mode 100644
index 000000000..d198c9a97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+
+extern void exit (int);
+#if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+extern void abort (void);
+int s(i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;}
+int x(){return s(0)==1&&s(1)==0&&s(2)==1;}
+int main(){if(x()!=1)abort();exit(0);}
+#else
+int main(){ exit (0); }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c
new file mode 100644
index 000000000..b917e824b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+void
+f ()
+{
+ unsigned long tmp[4] __attribute__((aligned(64)));
+ check (&tmp, 64);
+}
+
+int
+main()
+{
+ f();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c
new file mode 100644
index 000000000..9a039eb2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+typedef __SIZE_TYPE__ size_t;
+#define ALIGNMENT 256
+int main(void)
+{
+ int a[ALIGNMENT/sizeof(int)] __attribute__((aligned(ALIGNMENT)));
+ check (&a, ALIGNMENT);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c
new file mode 100644
index 000000000..1c1ddd1dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+typedef __SIZE_TYPE__ size_t;
+#define ALIGNMENT 256
+int main(void)
+{
+ int a[ALIGNMENT/sizeof(int)] __attribute__((aligned(ALIGNMENT)));
+ check (&a, ALIGNMENT);
+ int b[ALIGNMENT/sizeof(int)] __attribute__((aligned(ALIGNMENT)));
+ check (&b, ALIGNMENT);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
new file mode 100644
index 000000000..c23faf411
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/push-1.c
@@ -0,0 +1,51 @@
+/* PR middle-end/37010 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-additional-options "-mmmx -msse2 -mpreferred-stack-boundary=2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+#include <emmintrin.h>
+
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef int aligned __attribute__((aligned(16)));
+
+extern void abort (void);
+
+__m128 r;
+
+int
+__attribute__ ((noinline))
+check_int (int *i, int align)
+{
+ *i = 20;
+ if ((((ptrdiff_t) i) & (align - 1)) != 0)
+ {
+ abort ();
+ }
+ return *i;
+}
+
+void
+__attribute__ ((noinline))
+foo (__m128 x, __m128 y ,__m128 z ,__m128 a, int size)
+{
+ aligned i;
+
+ if (size != 5 || check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ r = a;
+}
+
+int
+main (void)
+{
+ __m128 x = { 1.0 };
+
+ foo (x, x, x, x, 5);
+
+ if (__builtin_memcmp (&r, &x, sizeof (r)))
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/regparm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/regparm-1.c
new file mode 100644
index 000000000..b9acacf9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/regparm-1.c
@@ -0,0 +1,60 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int test_nested (int i)
+{
+ aligned y;
+
+ int __attribute__ ((__noinline__, __regparm__(2))) foo (int j, int k, int l)
+ {
+ aligned x;
+
+ if (check_int (&x, __alignof__(x)) != x)
+ abort ();
+
+ if (x != 20)
+ abort ();
+
+ return i + j + k + l;
+ }
+
+ if (check_int (&y, __alignof__(y)) != y)
+ abort ();
+
+ if (y != 20)
+ abort ();
+
+ return foo(i, i+1, i+2) * i;
+}
+
+int __attribute__ ((__noinline__, __regparm__(3), __force_align_arg_pointer__))
+test_realigned (int j, int k, int l)
+{
+ aligned y;
+
+ if (check_int (&y, __alignof__(y)) != y)
+ abort ();
+
+ if (y != 20)
+ abort ();
+
+ return j + k + l;
+}
+
+int main ()
+{
+ if (test_nested(10) != 430)
+ abort ();
+
+ if (test_realigned(10, 11, 12) != 33)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c
new file mode 100644
index 000000000..b218a14ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+extern void abort();
+typedef struct my_struct
+{
+ char str[31];
+} stype ;
+
+stype g_s;
+
+stype __attribute__((noinline))
+foo (char arg1, char arg2, char arg3)
+{
+ stype __attribute__((aligned(ALIGNMENT))) s;
+ s.str[0] = arg1;
+ s.str[1] = arg2;
+ s.str[30] = arg3;
+ check(&s, ALIGNMENT);
+ return s;
+}
+
+int main()
+{
+ g_s = foo(1,2,3);
+
+ if (g_s.str[0] != 1 || g_s.str[1] != 2 || g_s.str[30] !=3)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-1.c
new file mode 100644
index 000000000..6ab67e395
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-1.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+
+extern int strcmp(const char *, const char *);
+extern char *strcpy(char *, const char *);
+extern void abort(void);
+extern void exit(int);
+
+void *buf[20];
+
+void __attribute__((noinline))
+sub2 (void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int
+main ()
+{
+ char *p = 0;
+
+ p = (char *) __builtin_alloca (20);
+
+ strcpy (p, "test");
+
+ if (__builtin_setjmp (buf))
+ {
+ if (strcmp (p, "test") != 0)
+ abort ();
+
+ exit (0);
+ }
+
+ {
+ int *q = (int *) __builtin_alloca (p[2] * sizeof (int));
+ int i;
+
+ for (i = 0; i < p[2]; i++)
+ q[i] = 0;
+
+ while (1)
+ sub2 ();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c
new file mode 100644
index 000000000..2fd3be8fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c
@@ -0,0 +1,46 @@
+/* { dg-do run { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } */
+
+#include <setjmp.h>
+#include <signal.h>
+
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+static jmp_buf segv_jmpbuf;
+
+static void segv_handler(int seg)
+{
+ __builtin_longjmp(segv_jmpbuf, 1);
+}
+
+static int is_addressable(void *p, size_t size)
+{
+ volatile char * volatile cp = (volatile char *)p;
+ volatile int ret;
+ struct sigaction sa, origsa;
+ sigset_t mask;
+
+ sa.sa_handler = segv_handler;
+ sa.sa_flags = 0;
+ sigfillset(&sa.sa_mask);
+ sigaction(SIGSEGV, &sa, &origsa);
+ sigprocmask(SIG_SETMASK, NULL, &mask);
+
+ if (__builtin_setjmp(segv_jmpbuf) == 0) {
+ while(size--)
+ *cp++;
+ ret = 1;
+ } else
+ ret = 0;
+
+ sigaction(SIGSEGV, &origsa, NULL);
+ sigprocmask(SIG_SETMASK, &mask, NULL);
+
+ return ret;
+}
+
+int main(int argc, char **argv)
+{
+ is_addressable(0x0, 1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-3.c
new file mode 100644
index 000000000..fee0d281f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-3.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+#include <setjmp.h>
+
+extern void abort (void);
+
+jmp_buf buf;
+
+void raise0(void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int execute(int cmd)
+{
+ int last = 0;
+
+ if (__builtin_setjmp (buf) == 0)
+ while (1)
+ {
+ last = 1;
+ raise0 ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-4.c
new file mode 100644
index 000000000..d1671223a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-4.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+
+#include <setjmp.h>
+
+extern void abort (void);
+
+jmp_buf buf;
+
+void raise0(void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int execute(int cmd)
+{
+ int last = 0;
+
+ __builtin_setjmp (buf);
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise0 ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/sibcall-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/sibcall-1.c
new file mode 100644
index 000000000..8c174758f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/sibcall-1.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+
+extern int ok (int);
+extern void exit ();
+static int gen_x86_64_shrd (int);
+static int
+gen_x86_64_shrd(int a __attribute__ ((__unused__)))
+{
+ return 0;
+}
+
+extern int gen_x86_shrd_1 (int);
+extern void ix86_split_ashr (int);
+
+void
+ix86_split_ashr (int mode)
+{
+ (mode != 0
+ ? ok
+ : gen_x86_64_shrd) (0);
+}
+
+volatile int one = 1;
+int
+main (void)
+{
+ ix86_split_ashr (one);
+ return 1;
+}
+
+int
+ok (int i)
+{
+ exit (i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp
new file mode 100644
index 000000000..8ef84fe35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp
@@ -0,0 +1,69 @@
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# This harness is for tests that should be run at all optimisation levels.
+
+load_lib gcc-dg.exp
+load_lib torture-options.exp
+
+global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
+
+dg-init
+torture-init
+
+# default_flags are replaced by a dg-options test directive, or appended
+# to by using dg-additional-options. Use default_flags for options that
+# are used in all of the torture sets to limit the amount of noise in
+# test summaries.
+set default_flags ""
+
+# torture_flags are combined with other torture options and do not
+# affect options specified within a test.
+set torture_flags ""
+
+set stackalign_options [list]
+if { [check_effective_target_automatic_stack_alignment] } then {
+ append default_flags " -mstackrealign"
+ append default_flags " -mpreferred-stack-boundary=5"
+}
+if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then {
+ append default_flags " -mno-mmx"
+}
+lappend stackalign_options [join $torture_flags]
+
+if { [check_effective_target_fpic] } then {
+ set pic_torture_flags $torture_flags
+ append pic_torture_flags " -fpic"
+ lappend stackalign_options [join $pic_torture_flags]
+}
+
+if { [check_effective_target_automatic_stack_alignment] } then {
+ append torture_flags " -mforce-drap"
+ lappend stackalign_options [join $torture_flags]
+ if { [check_effective_target_fpic] } then {
+ set pic_torture_flags $torture_flags
+ append pic_torture_flags " -fpic"
+ lappend stackalign_options [join $pic_torture_flags]
+ }
+}
+
+# Combine stackalign options with the usual torture optimization flags.
+set-torture-options [concat $DG_TORTURE_OPTIONS $LTO_TORTURE_OPTIONS] $stackalign_options
+
+gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "$default_flags"
+
+torture-finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c
new file mode 100644
index 000000000..860213298
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+void
+foo (void)
+{
+ struct i
+ {
+ aligned i;
+ } i;
+
+ if (check_int (&i.i, __alignof__(i.i)) != i.i)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/thiscall-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/thiscall-1.c
new file mode 100644
index 000000000..27b71b60c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/thiscall-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+__attribute__ ((thiscall))
+void
+foo (int j, int k, int m, int n, int o)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (i != 20 || j != 1 || k != 2 || m != 3 || n != 4 || o != 5)
+ abort ();
+}
+
+int
+main()
+{
+ foo (1, 2, 3, 4, 5);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c
new file mode 100644
index 000000000..5b36f2cd4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c
@@ -0,0 +1,60 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include <stdarg.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+foo (const char *fmt, ...)
+{
+ va_list arg;
+ char *p;
+ aligned i;
+ int size;
+ double x;
+
+ va_start (arg, fmt);
+ size = va_arg (arg, int);
+ if (size != 5)
+ abort ();
+ p = __builtin_alloca (size + 1);
+
+ x = va_arg (arg, double);
+ if (x != 5.0)
+ abort ();
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+ va_end (arg);
+}
+
+int
+main()
+{
+ foo ("foo", 5, 5.0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c
new file mode 100644
index 000000000..6740e994e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c
@@ -0,0 +1,66 @@
+/* { dg-do run } */
+/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
+
+#include <stdarg.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+test (va_list arg)
+{
+ char *p;
+ aligned i;
+ int size;
+ double x;
+
+ size = va_arg (arg, int);
+ if (size != 5)
+ abort ();
+
+ p = __builtin_alloca (size + 1);
+
+ x = va_arg (arg, double);
+ if (x != 5.0)
+ abort ();
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+void
+foo (const char *fmt, ...)
+{
+ va_list arg;
+ va_start (arg, fmt);
+ test (arg);
+ va_end (arg);
+}
+int
+main()
+{
+ foo ("foo", 5, 5.0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
new file mode 100644
index 000000000..baf398c12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c
@@ -0,0 +1,78 @@
+/* PR middle-end/37009 */
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-additional-options "-mmmx -msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+#include <stdarg.h>
+#include <emmintrin.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 16
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+__m128 a = { 1.0 };
+
+void
+test (va_list arg)
+{
+ char *p;
+ aligned i;
+ int size;
+ double x;
+ __m128 e;
+
+ size = va_arg (arg, int);
+ if (size != 5)
+ abort ();
+
+ p = __builtin_alloca (size + 1);
+
+ x = va_arg (arg, double);
+ if (x != 5.0)
+ abort ();
+
+ bar (p, size);
+ if (__builtin_strncmp (p, "good", size) != 0)
+ {
+#ifdef DEBUG
+ p[size] = '\0';
+ printf ("Failed: %s != good\n", p);
+#endif
+ abort ();
+ }
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ e = va_arg (arg, __m128);
+ if (__builtin_memcmp (&e, &a, sizeof (e)))
+ abort ();
+}
+
+void
+foo (const char *fmt, ...)
+{
+ va_list arg;
+ va_start (arg, fmt);
+ test (arg);
+ va_end (arg);
+}
+
+int
+main (void)
+{
+ __m128 x = { 1.0 };
+
+ foo ("foo", 5, 5.0, x);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-gd.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-gd.c
new file mode 100644
index 000000000..6335e73c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-gd.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+extern void abort (void);
+
+__thread int tls_gd __attribute__((tls_model("global-dynamic"))) = 0;
+
+int get_gd (void)
+{
+ return tls_gd;
+}
+
+int *get_gdp (void)
+{
+ return &tls_gd;
+}
+
+int main (void)
+{
+ int val;
+
+ val = get_gd ();
+ if (val != 0)
+ abort ();
+
+ val = *get_gdp ();
+ if (val != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-ie.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-ie.c
new file mode 100644
index 000000000..ec07a4447
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-ie.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+extern void abort (void);
+
+__thread int tls_ie __attribute__((tls_model("initial-exec"))) = 4;
+
+int get_ie (void)
+{
+ return tls_ie;
+}
+
+int *get_iep (void)
+{
+ return &tls_ie;
+}
+
+int main (void)
+{
+ int val;
+
+ val = get_ie ();
+ if (val != 4)
+ abort ();
+
+ val = *get_iep ();
+ if (val != 4)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-ld.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-ld.c
new file mode 100644
index 000000000..cabfaf794
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-ld.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+extern void abort (void);
+
+__thread int tls_ld __attribute__((tls_model("local-dynamic"))) = 1;
+__thread int tls_ld2 __attribute__((tls_model("local-dynamic"))) = 2;
+
+int get_ld (void)
+{
+ return tls_ld + tls_ld2;
+}
+
+int *get_ldp (void)
+{
+ return &tls_ld;
+}
+
+int main (void)
+{
+ int val;
+
+ val = get_ld ();
+ if (val != 1 + 2)
+ abort ();
+
+ val = *get_ldp ();
+ if (val != 1)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-le.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-le.c
new file mode 100644
index 000000000..0c340f30e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/run-le.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+extern void abort (void);
+
+__thread int tls_le __attribute__((tls_model("local-exec"))) = 3;
+
+int get_le (void)
+{
+ return tls_le;
+}
+
+int *get_lep (void)
+{
+ return &tls_le;
+}
+
+int main (void)
+{
+ int val;
+
+ val = get_le ();
+ if (val != 3)
+ abort ();
+
+ val = *get_lep ();
+ if (val != 3)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/thr-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/thr-init-1.c
new file mode 100644
index 000000000..ff3338ffb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/thr-init-1.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+extern int printf (char *,...);
+extern void abort() ;
+
+int test_code(int b)
+{
+static __thread int fstat = 1;
+ fstat += b ;
+ return fstat;
+}
+
+int main (int ac, char *av[])
+{
+ int a = test_code(1);
+
+ if ( a != 2 )
+ {
+ printf ("a=%d\n", a) ;
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/thr-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/thr-init-2.c
new file mode 100644
index 000000000..44156232c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/thr-init-2.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+extern int printf (char *,...);
+extern void abort() ;
+
+static __thread int fstat ;
+static __thread int fstat = 1;
+static __thread int fstat ;
+
+int test_code(int b)
+{
+ fstat += b ;
+ return fstat;
+}
+
+int main (int ac, char *av[])
+{
+ int a = test_code(1);
+
+ if ( a != 2 || fstat != 2 )
+ {
+ printf ("a=%d fstat=%d\n", a, fstat) ;
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls-reload-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls-reload-1.c
new file mode 100644
index 000000000..bd9a0b891
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls-reload-1.c
@@ -0,0 +1,49 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls_runtime } */
+/* { dg-add-options tls } */
+
+#define ARRAY(X) X##_array
+#define DECLARE(X) \
+ __thread int X; \
+ __thread int ARRAY(X)[4]; \
+ int *volatile *__attribute__((noinline)) \
+ check##X (int *volatile *y) \
+ { \
+ if (!y || *y++ != &X || *y++ != &ARRAY(X)[3]) \
+ return 0; \
+ return y; \
+ }
+#define COPY(X) *y++ = &X; *y++ = &ARRAY(X)[3];
+#define CHECK(X) y = check##X (y);
+#define A(M, X) M(X##0) M(X##1) M(X##2) M(X##3) M(X##4) M(X##5) M(X##6) M(X##7)
+#define B(M, X) A(M, X##0) A(M, X##1) A(M, X##2)
+#define C(M, X) B(M, X) B(M, X) B(M, X)
+
+#define NM 2
+#define NA (NM * 8)
+#define NB (NA * 3)
+#define NC (NB * 3)
+
+extern void abort (void);
+
+B(DECLARE, tls)
+
+void __attribute__ ((noinline))
+setup (int *volatile *y)
+{
+ C(COPY, tls)
+}
+
+int
+main (void)
+{
+ int *volatile array[NC];
+ int *volatile *y = array;
+ int i;
+
+ setup (array);
+ C(CHECK, tls);
+ if (!y)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls-test.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls-test.c
new file mode 100644
index 000000000..8a23e77c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls-test.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-pthread" } */
+
+#include <pthread.h>
+extern int printf (char *,...);
+__thread int a = 5;
+int *volatile a_in_other_thread = (int *) 12345;
+
+static void *
+thread_func (void *arg)
+{
+ a_in_other_thread = &a;
+ a+=5;
+ *((int *) arg) = a;
+ return (void *)0;
+}
+
+int
+main ()
+{
+ pthread_t thread;
+ void *thread_retval;
+ int *volatile a_in_main_thread;
+ int *volatile again ;
+ int thr_a;
+
+ a_in_main_thread = &a;
+
+ if (pthread_create (&thread, (pthread_attr_t *)0, thread_func, &thr_a))
+ return 0;
+
+ if (pthread_join (thread, &thread_retval))
+ return 0;
+
+ again = &a;
+ if (again != a_in_main_thread)
+ {
+ printf ("FAIL: main thread addy changed from 0x%0x to 0x%0x\n",
+ a_in_other_thread, again);
+ return 1;
+ }
+
+ if (a != 5 || thr_a != 10 || (a_in_other_thread == a_in_main_thread))
+ {
+ printf ("FAIL: a= %d, thr_a = %d Addr = 0x%0x\n",
+ a, thr_a, a_in_other_thread);
+ return 1;
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls.exp b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls.exp
new file mode 100644
index 000000000..e8404232b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tls/tls.exp
@@ -0,0 +1,57 @@
+# Copyright (C) 2010-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib torture-options.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
+set TLS_TORTURE_OPTIONS $DG_TORTURE_OPTIONS
+if { [check_effective_target_fpic] } then {
+ foreach pic {fpic fPIC} {
+ foreach option $DG_TORTURE_OPTIONS {
+ lappend TLS_TORTURE_OPTIONS "$option -$pic"
+ }
+ }
+}
+if { [check_effective_target_pie] } then {
+ foreach pie {fpie fPIE} {
+ foreach option $DG_TORTURE_OPTIONS {
+ lappend TLS_TORTURE_OPTIONS "$option -pie -$pie"
+ }
+ }
+}
+
+# Initialize `dg'.
+dg-init
+torture-init
+set-torture-options $TLS_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
+
+# Main loop.
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ $DEFAULT_CFLAGS
+
+# All done.
+torture-finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-1.c
new file mode 100644
index 000000000..188f3b51b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-1.c
@@ -0,0 +1,97 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The whole matrix VEL is flattened (3 dimensions).
+ All dimensions are transposed : dim 0 -> dim 2
+ dim 1 -> dim 0
+ dim 2 -> dim 1
+*/
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ for (k = 0; k < 2; k++)
+ {
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[k][i][j]);
+ }
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < ARCHnodes; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-2.c
new file mode 100644
index 000000000..bff6a3aba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-2.c
@@ -0,0 +1,94 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The whole matrix VEL is flattened (3 dimensions).
+ No transposing is necessary. */
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (j = 0; j < 2; j++)
+ {
+ for (i = 0; i < 4; i++)
+ {
+ for (k = 0; k < 2; k++)
+ {
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[k][k][k]);
+ }
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < ARCHnodes; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-3.c
new file mode 100644
index 000000000..da7e88701
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-3.c
@@ -0,0 +1,101 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+/* The inner most dimension escapes.
+ The two external dimensions are flattened
+ after being transposed. */
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (j = 0; j < 4; j++)
+ {
+ for (i = 0; i < 3; i++)
+ {
+ for (k = 0; k < 2; k++)
+ {
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[k][i][j]);
+ }
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ vel[0][0]=vel[1][1];
+
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 3; j++)
+ if (i==1 && j==1)
+ continue;
+ else
+ free (vel[i][j]);
+
+ for (i = 0; i < 2; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ signed int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ printf ("acc to dim2 ");
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+ printf ("\n");
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-4.c
new file mode 100644
index 000000000..5a96a5163
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-4.c
@@ -0,0 +1,100 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The whole matrix VEL is flattened (3 dimensions).
+ The two inner dimensions are transposed.
+ dim 1 -> dim 2
+ dim 2 -> dim 1
+*/
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (j = 0; j < 4; j++)
+ {
+ for (i = 0; i < 2; i++)
+ {
+ for (k = 0; k < 3; k++)
+ {
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][k][j]);
+ }
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < 2; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ signed int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ printf ("acc to dim2 ");
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+ printf ("\n");
+
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-5.c
new file mode 100644
index 000000000..049d7b03e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-5.c
@@ -0,0 +1,96 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The whole matrix VEL is flattened (3 dimensions).
+ The dimensions are NOT transposed. */
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (j = 0; j < 3; j++)
+ {
+ for (i = 0; i < 2; i++)
+ {
+ for (k = 0; k < 4; k++)
+ {
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][j][k]);
+ }
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < 2; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ signed int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ printf ("acc to dim2 ");
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+ printf ("\n");
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-6.c
new file mode 100644
index 000000000..9b3329b53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/transpose-6.c
@@ -0,0 +1,96 @@
+/* { dg-do run } */
+/* { dg-options "-fwhole-program" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+void mem_init (void);
+int ARCHnodes, ARCHnodes1;
+int ***vel;
+
+/* The whole matrix VEL is flattened (3 dimensions).
+ The dimensions are NOT transposed. */
+/*--------------------------------------------------------------------------*/
+
+int
+main (int argc, char **argv)
+{
+ int i, j, k;
+
+ ARCHnodes = 2;
+ ARCHnodes1 = 4;
+
+/* Dynamic memory allocations and initializations */
+
+ mem_init ();
+
+ for (j = 0; j < 3; j++)
+ {
+ for (i = 0; i < 2; i++)
+ {
+ for (k = 0; k < 3; k++)
+ {
+ printf ("[%d][%d][%d]=%d ", i, j, k, vel[i][k][k]);
+ }
+ printf ("\n");
+ }
+ printf ("\n");
+ }
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 3; j++)
+ free (vel[i][j]);
+
+ for (i = 0; i < 2; i++)
+ free (vel[i]);
+
+ free (vel);
+ return 0;
+}
+
+/*--------------------------------------------------------------------------*/
+/* Dynamic memory allocations and initializations */
+
+void
+mem_init (void)
+{
+
+ signed int i, j, k,d;
+
+ d = 0;
+ vel = (int ***) malloc (ARCHnodes * sizeof (int **));
+
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ vel[i] = (int **) malloc (3 * sizeof (int *));
+ if (vel[i] == (int **) NULL)
+ {
+ fprintf (stderr, "malloc failed for vel[%d]\n", i);
+ fflush (stderr);
+ exit (0);
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ vel[i][j] = (int *) malloc (ARCHnodes1 * sizeof (int));
+ }
+ }
+ for (i = 0; i < ARCHnodes; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < ARCHnodes1; k++)
+ {
+ printf ("acc to dim2 ");
+ vel[i][j][k] = d;
+ d++;
+ }
+ }
+ }
+ printf ("\n");
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/tree-loop-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tree-loop-1.c
new file mode 100644
index 000000000..1d3869178
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/tree-loop-1.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/20640 */
+
+/* After unrolling the loop, we'd turn some conditional branches into
+ unconditional ones, but branch redirection would fail to compute
+ the PHI args for the PHI nodes in the replacement edge
+ destination, so they'd remain NULL causing crashes later on. */
+
+/* { dg-do compile } */
+
+static int a = 0;
+extern int foo (void);
+extern int *bar (void) __attribute__ ((__const__));
+
+void
+test (int x)
+{
+ int b = 10;
+ while (foo () == -1 && *bar () == 4 && b > 0)
+ --b;
+ a = x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/type-generic-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/type-generic-1.c
new file mode 100644
index 000000000..f6949cff1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/type-generic-1.c
@@ -0,0 +1,14 @@
+/* Do the type-generic tests. Unlike pr28796-2.c, we test these
+ without any fast-math flags. */
+
+/* { dg-do run } */
+/* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */
+/* { dg-options "-DUNSAFE" { target tic6x*-*-* } } */
+/* { dg-add-options ieee } */
+
+#include "../tg-tests.h"
+
+int main(void)
+{
+ return main_tests ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/va-arg-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/va-arg-25.c
new file mode 100644
index 000000000..64aaffac8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/va-arg-25.c
@@ -0,0 +1,44 @@
+/* Varargs and vectors! */
+
+/* { dg-do run } */
+/* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-mabi=altivec -maltivec" { target { powerpc-*-* powerpc64-*-* } } } */
+/* { dg-require-effective-target vmx_hw { target { powerpc-*-* powerpc64-*-* } } } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <limits.h>
+
+#define vector __attribute__((vector_size(16)))
+
+const vector unsigned int v1 = {10,11,12,13};
+const vector unsigned int v2 = {20,21,22,23};
+
+void foo(int a, ...)
+{
+ va_list args;
+ vector unsigned int v;
+
+ va_start (args, a);
+ v = va_arg (args, vector unsigned int);
+ if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
+ abort ();
+ a = va_arg (args, int);
+ if (a != 2)
+ abort ();
+ v = va_arg (args, vector unsigned int);
+ if (memcmp (&v, &v2, sizeof (v)) != 0)
+ abort ();
+ va_end (args);
+}
+
+int main(void)
+{
+#if INT_MAX == 2147483647
+ foo (1, (vector unsigned int){10,11,12,13}, 2,
+ (vector unsigned int){20,21,22,23});
+#endif
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vec-cvt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vec-cvt-1.c
new file mode 100644
index 000000000..78a900956
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vec-cvt-1.c
@@ -0,0 +1,213 @@
+/* { dg-do run } */
+/* This test is too big for small targets. */
+/* { dg-require-effective-target size32plus } */
+
+#include <stdlib.h>
+
+#define N 1024
+signed char sc[N];
+short ss[N];
+int si[N];
+long long sl[N];
+unsigned char uc[N];
+unsigned short us[N];
+unsigned int ui[N];
+unsigned long long ul[N];
+float f[N];
+double d[N];
+
+#define FN1(from, to) \
+__attribute__((noinline, noclone)) void \
+from##2##to (void) \
+{ \
+ int i; \
+ for (i = 0; i < N; i++) \
+ to[i] = from[i]; \
+}
+#define FN(intt, fltt) FN1 (intt, fltt) FN1 (fltt, intt)
+
+FN (sc, f)
+FN (ss, f)
+FN (si, f)
+FN (sl, f)
+FN (uc, f)
+FN (us, f)
+FN (ui, f)
+FN (ul, f)
+FN (sc, d)
+FN (ss, d)
+FN (si, d)
+FN (sl, d)
+FN (uc, d)
+FN (us, d)
+FN (ui, d)
+FN (ul, d)
+
+#define FLTTEST(min, max, intt) \
+__attribute__((noinline, noclone)) void \
+flttointtest##intt (void) \
+{ \
+ int i; \
+ volatile float fltmin, fltmax, vf, vf2; \
+ volatile double dblmin, dblmax, vd, vd2; \
+ if (min == 0) \
+ fltmin = 0.0f; \
+ else \
+ { \
+ vf2 = fltmin = min - 1.0f; \
+ for (vf = 1.0f; (fltmin = vf2 + vf) == vf2; vf = vf * 2.0f) \
+ ; \
+ } \
+ vf2 = fltmax = max + 1.0f; \
+ for (vf = 1.0f; (fltmax = vf2 - vf) == vf2; vf = vf * 2.0f) \
+ ; \
+ if (min == 0) \
+ dblmin = 0.0; \
+ else \
+ { \
+ vd2 = dblmin = min - 1.0; \
+ for (vd = 1.0; (dblmin = vd2 + vd) == vd2; vd = vd * 2.0) \
+ ; \
+ } \
+ vd2 = dblmax = max + 1.0; \
+ for (vd = 1.0; (dblmax = vd2 - vd) == vd2; vd = vd * 2.0) \
+ ; \
+ for (i = 0; i < N; i++) \
+ { \
+ asm (""); \
+ if (i == 0) \
+ f[i] = fltmin; \
+ else if (i < N / 4) \
+ f[i] = fltmin + i + 0.25f; \
+ else if (i < 3 * N / 4) \
+ f[i] = (fltmax + fltmin) / 2.0 - N * 8 + 16.0f * i; \
+ else \
+ f[i] = fltmax - N + 1 + i; \
+ if (f[i] < fltmin) f[i] = fltmin; \
+ if (f[i] > fltmax) f[i] = fltmax; \
+ if (i == 0) \
+ d[i] = dblmin; \
+ else if (i < N / 4) \
+ d[i] = dblmin + i + 0.25f; \
+ else if (i < 3 * N / 4) \
+ d[i] = (dblmax + dblmin) / 2.0 - N * 8 + 16.0f * i; \
+ else \
+ d[i] = dblmax - N + 1 + i; \
+ if (d[i] < dblmin) d[i] = dblmin; \
+ if (d[i] > dblmax) d[i] = dblmax; \
+ } \
+ f2##intt (); \
+ for (i = 0; i < N; i++) \
+ if (intt[i] != (__typeof (intt[0])) f[i]) \
+ abort (); \
+ d2##intt (); \
+ for (i = 0; i < N; i++) \
+ if (intt[i] != (__typeof (intt[0])) d[i]) \
+ abort (); \
+ for (i = 0; i < N; i++) \
+ { \
+ unsigned long long r = rand (); \
+ r = (r << 21) ^ (unsigned) rand (); \
+ r = (r << 21) ^ (unsigned) rand (); \
+ asm (""); \
+ f[i] = (r >> 59) / 32.0f + (__typeof (intt[0])) r; \
+ if (f[i] < fltmin) f[i] = fltmin; \
+ if (f[i] > fltmax) f[i] = fltmax; \
+ d[i] = (r >> 59) / 32.0 + (__typeof (intt[0])) r; \
+ if (d[i] < dblmin) f[i] = dblmin; \
+ if (d[i] > dblmax) f[i] = dblmax; \
+ } \
+ f2##intt (); \
+ for (i = 0; i < N; i++) \
+ if (intt[i] != (__typeof (intt[0])) f[i]) \
+ abort (); \
+ d2##intt (); \
+ for (i = 0; i < N; i++) \
+ if (intt[i] != (__typeof (intt[0])) d[i]) \
+ abort (); \
+} \
+ \
+__attribute__((noinline, noclone)) void \
+inttoflttest##intt (void) \
+{ \
+ int i; \
+ volatile float vf; \
+ volatile double vd; \
+ for (i = 0; i < N; i++) \
+ { \
+ asm (""); \
+ if (i < N / 4) \
+ intt[i] = min + i; \
+ else if (i < 3 * N / 4) \
+ intt[i] = (max + min) / 2 - N * 8 + 16 * i; \
+ else \
+ intt[i] = max - N + 1 + i; \
+ } \
+ intt##2f (); \
+ for (i = 0; i < N; i++) \
+ { \
+ vf = intt[i]; \
+ if (f[i] != vf) \
+ abort (); \
+ } \
+ intt##2d (); \
+ for (i = 0; i < N; i++) \
+ { \
+ vd = intt[i]; \
+ if (d[i] != vd) \
+ abort (); \
+ } \
+ for (i = 0; i < N; i++) \
+ { \
+ unsigned long long r = rand (); \
+ r = (r << 21) ^ (unsigned) rand (); \
+ r = (r << 21) ^ (unsigned) rand (); \
+ asm (""); \
+ intt[i] = r; \
+ } \
+ intt##2f (); \
+ for (i = 0; i < N; i++) \
+ { \
+ vf = intt[i]; \
+ if (f[i] != vf) \
+ abort (); \
+ } \
+ intt##2d (); \
+ for (i = 0; i < N; i++) \
+ { \
+ vd = intt[i]; \
+ if (d[i] != vd) \
+ abort (); \
+ } \
+}
+
+FLTTEST (- __SCHAR_MAX__ - 1, __SCHAR_MAX__, sc)
+FLTTEST (- __SHRT_MAX__ - 1, __SHRT_MAX__, ss)
+FLTTEST (- __INT_MAX__ - 1, __INT_MAX__, si)
+FLTTEST (- __LONG_LONG_MAX__ - 1LL, __LONG_LONG_MAX__, sl)
+FLTTEST (0, 2U * __SCHAR_MAX__ + 1, uc)
+FLTTEST (0, 2U * __SHRT_MAX__ + 1, us)
+FLTTEST (0, 2U * __INT_MAX__ + 1, ui)
+FLTTEST (0, 2ULL * __LONG_LONG_MAX__ + 1, ul)
+
+int
+main ()
+{
+ flttointtestsc ();
+ flttointtestss ();
+ flttointtestsi ();
+ flttointtestsl ();
+ flttointtestuc ();
+ flttointtestus ();
+ flttointtestui ();
+ flttointtestul ();
+ inttoflttestsc ();
+ inttoflttestss ();
+ inttoflttestsi ();
+ inttoflttestsl ();
+ inttoflttestuc ();
+ inttoflttestus ();
+ inttoflttestui ();
+ inttoflttestul ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-1.c
new file mode 100644
index 000000000..205fee6d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-1.c
@@ -0,0 +1,42 @@
+/* Check that vector extraction works correctly. */
+
+/* { dg-do run } */
+/* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-mabi=altivec" { target { powerpc-*-* powerpc64-*-* } } } */
+/* { dg-require-effective-target vmx_hw { target { powerpc-*-* powerpc64--*-* } } } */
+
+#define vector __attribute__((vector_size(16) ))
+
+int f0(vector int t)
+{
+ return ((int*)&t)[0];
+}
+int f1(vector int t)
+{
+ return ((int*)&t)[1];
+}
+int f2(vector int t)
+{
+ return ((int*)&t)[2];
+}
+int f3(vector int t)
+{
+ return ((int*)&t)[3];
+}
+int main(void)
+{
+ vector int a = {0, 1, 2, 3};
+ /* Make sure that we have the correct size for the vectors. */
+ if (sizeof(int) != 4)
+ __builtin_exit (0);
+ if (f0(a) != 0)
+ __builtin_abort ();
+ if (f1(a) != 1)
+ __builtin_abort ();
+ if (f2(a) != 2)
+ __builtin_abort ();
+ if (f3(a) != 3)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-2.c
new file mode 100644
index 000000000..6cc56cfae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-2.c
@@ -0,0 +1,52 @@
+/* Check that vector insertion works correctly. */
+
+/* { dg-do run } */
+/* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-mabi=altivec" { target { powerpc-*-* powerpc64-*-* } } } */
+/* { dg-require-effective-target vmx_hw { target { powerpc-*-* powerpc64--*-* } } } */
+
+#define vector __attribute__((vector_size(16) ))
+
+vector int f0(vector int t, int a)
+{
+ ((int*)&t)[0] = a;
+ return t;
+}
+vector int f1(vector int t, int a)
+{
+ ((int*)&t)[1] = a;
+ return t;
+}
+vector int f2(vector int t, int a)
+{
+ ((int*)&t)[2] = a;
+ return t;
+}
+vector int f3(vector int t, int a)
+{
+ ((int*)&t)[3] = a;
+ return t;
+}
+int main(void)
+{
+ vector int a = {0, 0, 0, 0};
+ vector int b = {1, 0, 0, 0};
+ vector int c = {0, 1, 0, 0};
+ vector int d = {0, 0, 1, 0};
+ vector int e = {0, 0, 0, 1};
+ vector int a0;
+ a0 = f0(a, 1);
+ if (memcmp (&a0, &b, sizeof(a0)))
+ __builtin_abort ();
+ a0 = f1(a, 1);
+ if (memcmp (&a0, &c, sizeof(a0)))
+ __builtin_abort ();
+ a0 = f2(a, 1);
+ if (memcmp (&a0, &d, sizeof(a0)))
+ __builtin_abort ();
+ a0 = f3(a, 1);
+ if (memcmp (&a0, &e, sizeof(a0)))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shift2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shift2.c
new file mode 100644
index 000000000..0e8a0eb24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shift2.c
@@ -0,0 +1,61 @@
+/* { dg-do run } */
+
+#define vector(elcount, type) \
+__attribute__((vector_size((elcount)*sizeof(type)))) type
+
+#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
+#define schar signed char
+#define uchar unsigned char
+
+#define ch14 1,2,3,4
+#define ch1 1,1,1,1
+#define chm1 -1,-1,-1,-1
+
+int main (int argc, char *argv[]) {
+ vector(16, uchar) vuchar = { ch14, ch14, ch14, ch14};
+ vector(16, schar) vchar0 = { ch1, ch1, ch1, ch1};
+ vector(16, schar) vchar1 = { chm1, chm1, chm1, chm1};
+
+ vector(16, schar) i1, i2, i3;
+ vector(16, uchar) u1, u2, u3;
+
+ i1 = vchar1<< vchar0;
+
+ if (vidx(schar, i1, 0) != ((schar)-1 << (schar)1))
+ __builtin_abort ();
+ if (vidx(schar, i1, 1) != ((schar)-1 << (schar)1))
+ __builtin_abort ();
+ if (vidx(schar, i1, 2) != ((schar)-1 << (schar)1))
+ __builtin_abort ();
+ if (vidx(schar, i1, 3) != ((schar)-1 << (schar)1))
+ __builtin_abort ();
+ u1 = vuchar << vchar0;
+
+ if (vidx(uchar, u1, 0) != ((uchar)1 << (schar)1))
+ __builtin_abort ();
+ if (vidx(uchar, u1, 1) != ((uchar)2 << (schar)1))
+ __builtin_abort ();
+ if (vidx(uchar, u1, 2) != ((uchar)3 << (schar)1))
+ __builtin_abort ();
+ if (vidx(uchar, u1, 3) != ((uchar)4 << (schar)1))
+ __builtin_abort ();
+
+
+ i2 = vchar1 >> vuchar;
+
+ if (vidx(schar, i2, 0) != ((schar)-1 >> (uchar)1))
+ __builtin_abort ();
+ if (vidx(schar, i2, 1) != ((schar)-1 >> (uchar)2))
+ __builtin_abort ();
+ if (vidx(schar, i2, 2) != ((schar)-1 >> (uchar)3))
+ __builtin_abort ();
+ if (vidx(schar, i2, 3) != ((schar)-1 >> (uchar)4))
+ __builtin_abort ();
+
+ vchar1 >>= vuchar;
+ vuchar <<= vchar0;
+ vuchar <<= vchar1;
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shuffle1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shuffle1.c
new file mode 100644
index 000000000..14e435b8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shuffle1.c
@@ -0,0 +1,21 @@
+/* PR54219 */
+/* { dg-do run } */
+
+extern void abort (void);
+
+typedef int v2si __attribute__((vector_size(2*sizeof(int))));
+
+void f(v2si *x)
+{
+ /* This requires canonicalization of the mask to { 1, 0 }. */
+ *x = __builtin_shuffle(*x, *x, (v2si) { 5, 0 });
+}
+
+int main()
+{
+ v2si y = { 1, 2 };
+ f(&y);
+ if (y[0] != 2 || y[1] != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-16.inc b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-16.inc
new file mode 100644
index 000000000..f04b8dded
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-16.inc
@@ -0,0 +1,139 @@
+#define N 16
+#define TESTS \
+T (0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) \
+T (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) \
+T (2, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7) \
+T (3, 0, 18, 7, 16, 23, 5, 4, 22, 1, 6, 21, 20, 19, 3, 17, 2) \
+T (4, 0, 1, 2, 3, 4, 5, 6, 7, 7, 1, 2, 0, 4, 5, 6, 3) \
+T (5, 0, 19, 16, 3, 2, 17, 18, 1, 24, 8, 11, 10, 27, 26, 25, 9) \
+T (6, 4, 23, 20, 7, 6, 21, 22, 5, 28, 12, 15, 14, 31, 30, 29, 13) \
+T (7, 7, 1, 2, 0, 4, 5, 6, 3, 7, 1, 2, 0, 4, 5, 6, 3) \
+T (8, 7, 3, 0, 5, 4, 1, 6, 2, 31, 27, 24, 29, 28, 25, 30, 26) \
+T (9, 7, 1, 2, 0, 4, 5, 6, 3, 15, 9, 14, 10, 8, 12, 13, 11) \
+T (10, 15, 0, 3, 12, 14, 2, 1, 13, 4, 11, 9, 6, 5, 10, 7, 8) \
+T (11, 15, 9, 14, 10, 8, 12, 13, 11, 7, 1, 2, 0, 4, 5, 6, 3) \
+T (12, 2, 5, 24, 23, 17, 22, 20, 21, 12, 14, 13, 8, 6, 20, 10, 18) \
+T (13, 23, 11, 15, 9, 0, 14, 8, 12, 10, 13, 19, 11, 2, 26, 24, 30) \
+T (14, 25, 5, 17, 1, 9, 15, 21, 7, 28, 2, 18, 13, 30, 14, 10, 4) \
+T (15, 1, 30, 27, 31, 9, 18, 25, 12, 7, 4, 2, 16, 25, 20, 10, 3) \
+T (16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30) \
+T (17, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31) \
+T (18, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3) \
+T (19, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) \
+T (20, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23) \
+T (21, 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31) \
+T (22, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0) \
+T (23, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 15)
+#define EXPTESTS \
+T (116, 28, 13, 27, 11, 21, 1, 5, 22, 29, 14, 15, 6, 3, 10, 16, 30) \
+T (117, 22, 26, 1, 13, 29, 3, 18, 18, 11, 21, 12, 28, 19, 5, 7, 4) \
+T (118, 1, 28, 26, 11, 4, 27, 30, 12, 10, 19, 6, 7, 13, 31, 0, 24) \
+T (119, 7, 30, 17, 27, 0, 10, 13, 21, 3, 29, 24, 21, 12, 6, 15, 18) \
+T (120, 28, 13, 26, 24, 21, 16, 29, 9, 10, 2, 27, 19, 20, 17, 18, 14) \
+T (121, 22, 21, 1, 8, 14, 15, 0, 28, 25, 30, 10, 17, 19, 27, 26, 13) \
+T (122, 28, 13, 27, 2, 21, 29, 22, 4, 8, 0, 18, 1, 31, 7, 19, 14) \
+T (123, 15, 0, 9, 2, 31, 3, 17, 24, 1, 8, 26, 20, 30, 11, 22, 5) \
+T (124, 28, 14, 5, 7, 9, 10, 21, 31, 2, 11, 22, 27, 7, 27, 30, 2) \
+T (125, 17, 13, 1, 7, 20, 22, 8, 15, 4, 25, 10, 28, 23, 24, 9, 21) \
+T (126, 17, 5, 3, 4, 0, 7, 19, 13, 29, 25, 26, 1, 15, 8, 2, 7) \
+T (127, 16, 6, 3, 22, 31, 15, 13, 21, 14, 20, 29, 17, 18, 2, 23, 25) \
+T (128, 18, 22, 21, 28, 10, 13, 6, 17, 29, 20, 7, 16, 2, 9, 1, 11) \
+T (129, 30, 11, 11, 22, 21, 10, 3, 18, 15, 26, 20, 16, 17, 13, 29, 7) \
+T (130, 5, 9, 21, 16, 29, 11, 4, 2, 17, 28, 3, 19, 9, 10, 13, 20) \
+T (131, 13, 3, 19, 25, 1, 28, 31, 30, 10, 12, 21, 26, 27, 14, 5, 17) \
+T (132, 8, 28, 26, 31, 5, 14, 4, 13, 6, 15, 3, 17, 6, 20, 27, 29) \
+T (133, 7, 26, 8, 17, 31, 11, 25, 16, 19, 4, 0, 27, 7, 20, 19, 13) \
+T (134, 14, 23, 19, 4, 9, 11, 16, 6, 7, 3, 27, 20, 24, 18, 26, 31) \
+T (135, 7, 25, 14, 2, 16, 5, 29, 3, 4, 24, 21, 9, 20, 19, 27, 1) \
+T (136, 5, 14, 29, 12, 3, 3, 1, 4, 8, 7, 9, 13, 10, 4, 12, 23) \
+T (137, 2, 6, 21, 28, 5, 23, 16, 24, 22, 18, 30, 12, 31, 16, 4, 1) \
+T (138, 4, 31, 11, 26, 16, 23, 5, 12, 15, 14, 19, 3, 18, 21, 27, 6) \
+T (139, 29, 14, 19, 18, 23, 27, 16, 7, 8, 26, 0, 12, 15, 17, 9, 1) \
+T (140, 18, 27, 20, 31, 8, 10, 9, 17, 13, 19, 12, 15, 28, 3, 25, 5) \
+T (141, 28, 13, 23, 20, 10, 5, 22, 17, 27, 0, 21, 27, 11, 25, 24, 30) \
+T (142, 24, 17, 31, 22, 9, 15, 28, 6, 12, 23, 30, 1, 21, 5, 27, 29) \
+T (143, 12, 19, 16, 0, 8, 15, 13, 22, 17, 4, 31, 20, 2, 9, 21, 30) \
+T (144, 5, 13, 26, 12, 27, 0, 17, 1, 25, 8, 10, 25, 18, 11, 29, 4) \
+T (145, 6, 18, 13, 29, 14, 31, 16, 10, 2, 12, 20, 25, 23, 28, 24, 10) \
+T (146, 17, 0, 21, 0, 12, 13, 16, 5, 19, 29, 30, 27, 4, 9, 1, 20) \
+T (147, 14, 26, 28, 17, 31, 10, 6, 3, 29, 22, 18, 1, 6, 5, 30, 8) \
+T (148, 10, 17, 12, 18, 26, 16, 5, 24, 2, 7, 20, 15, 30, 2, 29, 25) \
+T (149, 30, 27, 15, 23, 8, 12, 29, 2, 4, 9, 25, 13, 21, 7, 16, 20) \
+T (150, 7, 13, 4, 22, 24, 0, 31, 28, 18, 5, 2, 16, 17, 1, 1, 6) \
+T (151, 24, 27, 17, 25, 27, 6, 14, 30, 21, 19, 23, 29, 12, 19, 15, 9) \
+T (152, 1, 16, 24, 19, 29, 27, 17, 9, 8, 23, 22, 12, 11, 2, 26, 25) \
+T (153, 2, 25, 22, 8, 11, 16, 20, 26, 29, 15, 6, 15, 30, 10, 21, 24) \
+T (154, 19, 20, 23, 11, 20, 1, 18, 29, 21, 24, 6, 8, 19, 2, 4, 9) \
+T (155, 30, 12, 29, 21, 7, 8, 31, 15, 3, 1, 10, 4, 2, 9, 19, 2) \
+T (156, 14, 27, 5, 23, 15, 22, 4, 26, 30, 19, 29, 18, 16, 24, 21, 7) \
+T (157, 14, 15, 26, 17, 30, 16, 6, 0, 10, 8, 2, 23, 20, 13, 3, 27) \
+T (158, 2, 14, 13, 22, 24, 26, 17, 16, 4, 27, 7, 31, 9, 1, 28, 3) \
+T (159, 13, 15, 19, 12, 31, 23, 16, 8, 0, 2, 17, 27, 30, 14, 18, 1) \
+T (160, 3, 9, 30, 28, 31, 24, 5, 1, 23, 0, 13, 24, 20, 18, 3, 26) \
+T (161, 6, 10, 28, 8, 15, 14, 17, 26, 9, 0, 11, 2, 16, 2, 27, 24) \
+T (162, 20, 29, 7, 11, 5, 21, 0, 8, 12, 28, 13, 4, 26, 10, 28, 23) \
+T (163, 31, 25, 24, 10, 18, 3, 5, 12, 18, 2, 17, 22, 30, 16, 8, 6) \
+T (164, 0, 5, 22, 3, 21, 28, 31, 20, 12, 14, 18, 4, 13, 2, 0, 29) \
+T (165, 26, 18, 25, 20, 2, 0, 10, 30, 27, 11, 9, 3, 31, 4, 29, 21) \
+T (166, 15, 21, 3, 9, 22, 6, 29, 13, 24, 30, 31, 5, 26, 17, 0, 12) \
+T (167, 3, 28, 19, 27, 26, 14, 5, 10, 16, 24, 12, 30, 23, 13, 18, 26) \
+T (168, 0, 13, 10, 16, 23, 17, 8, 24, 20, 25, 21, 3, 12, 22, 6, 1) \
+T (169, 11, 18, 7, 26, 23, 6, 24, 21, 29, 18, 7, 19, 12, 31, 15, 28) \
+T (170, 14, 5, 21, 6, 9, 11, 12, 4, 0, 8, 30, 10, 24, 19, 18, 3) \
+T (171, 6, 3, 5, 13, 10, 2, 24, 31, 23, 2, 29, 4, 22, 7, 19, 20) \
+T (172, 12, 26, 13, 18, 19, 9, 1, 27, 14, 7, 20, 31, 11, 8, 30, 4) \
+T (173, 1, 23, 10, 31, 12, 26, 6, 13, 7, 30, 18, 4, 0, 27, 21, 19) \
+T (174, 20, 15, 13, 22, 10, 14, 5, 3, 31, 8, 0, 11, 4, 9, 1, 0) \
+T (175, 12, 29, 23, 28, 8, 20, 19, 7, 20, 24, 6, 26, 11, 17, 2, 5) \
+T (176, 19, 0, 31, 26, 30, 16, 17, 14, 5, 7, 3, 27, 1, 22, 29, 9) \
+T (177, 17, 15, 4, 1, 7, 13, 23, 28, 2, 8, 26, 12, 21, 24, 3, 19) \
+T (178, 17, 23, 21, 2, 12, 27, 8, 15, 6, 25, 7, 28, 4, 26, 1, 23) \
+T (179, 17, 25, 19, 4, 7, 20, 13, 30, 18, 3, 25, 21, 24, 26, 16, 31) \
+T (180, 7, 20, 18, 9, 3, 16, 12, 22, 0, 30, 10, 25, 17, 29, 19, 5) \
+T (181, 4, 17, 23, 1, 16, 22, 12, 31, 25, 9, 8, 21, 26, 15, 29, 29) \
+T (182, 31, 25, 14, 17, 8, 24, 4, 29, 27, 0, 20, 5, 13, 12, 5, 30) \
+T (183, 29, 26, 3, 22, 24, 30, 0, 15, 19, 7, 18, 6, 25, 14, 3, 3) \
+T (184, 23, 22, 7, 18, 10, 30, 29, 6, 16, 13, 11, 28, 5, 26, 4, 24) \
+T (185, 27, 15, 8, 29, 21, 23, 12, 11, 26, 22, 21, 6, 10, 23, 20, 27) \
+T (186, 19, 23, 20, 7, 8, 14, 6, 17, 20, 1, 5, 12, 25, 18, 10, 29) \
+T (187, 12, 14, 2, 5, 31, 21, 30, 18, 2, 6, 17, 22, 22, 28, 0, 18) \
+T (188, 10, 8, 13, 29, 20, 18, 8, 5, 4, 3, 26, 19, 24, 29, 6, 30) \
+T (189, 23, 19, 8, 2, 21, 18, 26, 1, 27, 12, 10, 4, 3, 20, 10, 17) \
+T (190, 31, 30, 21, 8, 15, 9, 3, 22, 7, 17, 25, 5, 13, 6, 1, 11) \
+T (191, 0, 5, 26, 6, 18, 1, 9, 31, 11, 3, 10, 23, 30, 27, 17, 14) \
+T (192, 19, 7, 29, 27, 8, 17, 22, 20, 10, 22, 2, 11, 9, 14, 31, 23) \
+T (193, 3, 23, 10, 18, 14, 9, 4, 24, 8, 30, 9, 13, 16, 17, 4, 22) \
+T (194, 13, 22, 8, 3, 9, 24, 9, 7, 15, 17, 26, 19, 11, 5, 18, 24) \
+T (195, 1, 18, 17, 13, 14, 0, 6, 15, 31, 22, 9, 2, 23, 19, 20, 3) \
+T (196, 9, 8, 17, 4, 28, 20, 6, 1, 11, 12, 23, 0, 15, 27, 31, 18) \
+T (197, 11, 2, 16, 1, 29, 21, 14, 9, 23, 30, 22, 8, 27, 9, 18, 10) \
+T (198, 10, 6, 26, 22, 13, 28, 18, 31, 4, 17, 27, 5, 7, 25, 20, 21) \
+T (199, 9, 8, 0, 0, 10, 7, 4, 24, 16, 3, 20, 1, 31, 11, 17, 26) \
+T (200, 19, 24, 31, 25, 7, 4, 14, 4, 9, 21, 29, 30, 10, 16, 6, 13) \
+T (201, 27, 4, 25, 12, 11, 3, 29, 1, 16, 6, 12, 5, 26, 25, 10, 15) \
+T (202, 11, 28, 9, 3, 20, 30, 18, 6, 13, 12, 25, 24, 5, 26, 0, 31) \
+T (203, 7, 23, 14, 16, 1, 31, 3, 0, 18, 6, 4, 10, 11, 15, 13, 29) \
+T (204, 28, 15, 6, 4, 21, 18, 22, 29, 13, 3, 18, 27, 21, 7, 31, 26) \
+T (205, 2, 13, 7, 22, 21, 9, 24, 15, 6, 20, 14, 29, 16, 27, 31, 0) \
+T (206, 23, 3, 13, 0, 18, 19, 10, 29, 16, 22, 21, 30, 17, 5, 6, 31) \
+T (207, 0, 3, 6, 29, 7, 10, 20, 17, 5, 8, 27, 18, 12, 4, 30, 28) \
+T (208, 5, 31, 20, 6, 14, 11, 28, 19, 7, 25, 27, 26, 10, 8, 22, 4) \
+T (209, 26, 22, 12, 9, 25, 0, 21, 14, 4, 7, 17, 30, 29, 24, 13, 31) \
+T (210, 15, 1, 6, 10, 26, 12, 8, 25, 3, 31, 23, 5, 30, 2, 0, 27) \
+T (211, 2, 11, 1, 27, 4, 17, 28, 22, 5, 28, 16, 20, 6, 3, 0, 15) \
+T (212, 25, 2, 6, 18, 16, 12, 4, 27, 1, 29, 7, 3, 21, 20, 17, 19) \
+T (213, 16, 0, 19, 21, 29, 23, 18, 31, 24, 12, 4, 20, 2, 8, 27, 30) \
+T (214, 20, 28, 9, 28, 22, 13, 2, 0, 8, 26, 10, 23, 24, 12, 31, 11) \
+T (215, 27, 22, 12, 15, 10, 20, 4, 25, 29, 9, 17, 3, 28, 21, 31, 23) \
+T (216, 16, 29, 20, 19, 16, 6, 18, 28, 3, 15, 29, 30, 1, 22, 10, 0) \
+T (217, 24, 14, 27, 3, 16, 30, 6, 0, 13, 12, 19, 7, 11, 20, 5, 26) \
+T (218, 19, 30, 26, 17, 13, 5, 10, 15, 16, 28, 24, 20, 0, 25, 9, 14) \
+T (219, 11, 0, 29, 5, 16, 30, 22, 19, 25, 4, 17, 7, 18, 2, 14, 13) \
+T (220, 27, 9, 16, 10, 19, 23, 12, 21, 3, 30, 18, 4, 15, 6, 29, 13) \
+T (221, 26, 12, 25, 22, 11, 18, 1, 7, 0, 19, 29, 31, 8, 4, 9, 15) \
+T (222, 18, 23, 31, 7, 26, 5, 15, 11, 25, 4, 22, 21, 14, 10, 20, 8) \
+T (223, 2, 18, 4, 24, 6, 20, 9, 25, 16, 3, 5, 22, 10, 7, 23, 30) \
+T (224, 4, 13, 6, 8, 22, 2, 12, 24, 31, 29, 20, 23, 0, 10, 1, 3) \
+T (225, 26, 3, 30, 18, 4, 19, 22, 31, 28, 24, 15, 14, 1, 23, 27, 7) \
+T (226, 18, 6, 23, 16, 25, 26, 17, 5, 28, 10, 30, 24, 12, 14, 15, 20) \
+T (227, 5, 19, 23, 22, 1, 7, 26, 12, 30, 17, 0, 0, 10, 6, 18, 4)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-2.inc b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-2.inc
new file mode 100644
index 000000000..70b2e5c13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-2.inc
@@ -0,0 +1,19 @@
+#define N 2
+#define TESTS \
+T (0, 0, 0) \
+T (1, 0, 1) \
+T (2, 0, 2) \
+T (3, 0, 3) \
+T (4, 1, 0) \
+T (5, 1, 1) \
+T (6, 1, 2) \
+T (7, 1, 3) \
+T (8, 2, 0) \
+T (9, 2, 1) \
+T (10, 2, 2) \
+T (11, 2, 3) \
+T (12, 3, 0) \
+T (13, 3, 1) \
+T (14, 3, 2) \
+T (15, 3, 3)
+#define EXPTESTS
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-32.inc b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-32.inc
new file mode 100644
index 000000000..c7fced062
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-32.inc
@@ -0,0 +1,139 @@
+#define N 32
+#define TESTS \
+T (0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31) \
+T (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) \
+T (2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) \
+T (3, 26, 60, 14, 40, 44, 51, 12, 45, 9, 37, 4, 47, 35, 63, 54, 30, 28, 10, 48, 32, 5, 59, 7, 52, 11, 6, 62, 49, 25, 25, 20, 55) \
+T (4, 32, 16, 54, 20, 62, 60, 56, 9, 38, 26, 42, 12, 17, 51, 4, 58, 59, 25, 50, 27, 41, 37, 8, 30, 18, 24, 40, 36, 25, 7, 37, 63) \
+T (5, 0, 4, 60, 9, 23, 19, 45, 6, 5, 12, 38, 60, 34, 36, 26, 11, 47, 52, 63, 39, 7, 56, 17, 54, 53, 39, 18, 2, 37, 55, 22, 21) \
+T (6, 2, 44, 46, 13, 40, 38, 52, 10, 50, 55, 11, 15, 9, 0, 12, 42, 45, 19, 11, 34, 26, 24, 62, 25, 5, 17, 1, 47, 21, 7, 60, 41) \
+T (7, 50, 13, 37, 62, 9, 49, 14, 53, 15, 42, 36, 1, 33, 27, 63, 41, 57, 12, 7, 2, 44, 48, 16, 39, 25, 31, 20, 10, 3, 60, 43, 21) \
+T (8, 1, 37, 22, 61, 5, 14, 46, 47, 6, 35, 10, 48, 30, 26, 33, 13, 18, 18, 11, 21, 44, 29, 60, 45, 19, 37, 7, 43, 36, 1, 28, 59) \
+T (9, 30, 44, 42, 51, 6, 7, 38, 13, 43, 31, 58, 0, 56, 17, 27, 32, 10, 53, 3, 29, 21, 12, 15, 50, 28, 24, 16, 61, 9, 34, 59, 19) \
+T (10, 20, 49, 50, 14, 54, 53, 33, 40, 46, 15, 0, 28, 25, 30, 10, 17, 51, 59, 26, 13, 45, 27, 2, 61, 4, 36, 8, 0, 18, 33, 22, 63) \
+T (11, 13, 40, 7, 33, 51, 21, 59, 46, 47, 32, 9, 34, 63, 35, 41, 17, 24, 1, 8, 26, 52, 62, 11, 22, 37, 28, 5, 39, 10, 53, 60, 2) \
+T (12, 39, 43, 54, 27, 53, 39, 27, 30, 2, 17, 13, 33, 7, 52, 40, 15, 36, 57, 10, 28, 22, 23, 25, 24, 41, 47, 8, 20, 5, 3, 4, 0) \
+T (13, 7, 51, 13, 61, 25, 4, 19, 58, 35, 33, 29, 15, 40, 2, 39, 16, 38, 3, 54, 63, 15, 6, 48, 21, 14, 52, 17, 50, 34, 55, 57, 50) \
+T (14, 22, 53, 28, 42, 45, 38, 49, 13, 54, 61, 21, 52, 7, 16, 34, 9, 1, 43, 62, 43, 35, 50, 47, 58, 20, 3, 30, 15, 37, 53, 43, 36) \
+T (15, 2, 43, 49, 34, 28, 35, 29, 36, 51, 9, 17, 48, 10, 37, 45, 21, 52, 19, 25, 33, 60, 31, 30, 42, 12, 26, 27, 46, 5, 40, 14, 36) \
+T (16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62) \
+T (17, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63) \
+T (18, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3) \
+T (19, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) \
+T (20, 0, 32, 1, 33, 2, 34, 3, 35, 4, 36, 5, 37, 6, 38, 7, 39, 8, 40, 9, 41, 10, 42, 11, 43, 12, 44, 13, 45, 14, 46, 15, 47) \
+T (21, 16, 48, 17, 49, 18, 50, 19, 51, 20, 52, 21, 53, 22, 54, 23, 55, 24, 56, 25, 57, 26, 58, 27, 59, 28, 60, 29, 61, 30, 62, 31, 63) \
+T (22, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0) \
+T (23, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 31)
+#define EXPTESTS \
+T (116, 13, 38, 47, 3, 17, 8, 38, 20, 59, 61, 39, 26, 7, 49, 63, 43, 57, 16, 40, 19, 4, 32, 27, 7, 52, 19, 46, 55, 36, 41, 48, 6) \
+T (117, 39, 35, 59, 20, 56, 18, 58, 63, 57, 14, 2, 16, 5, 61, 35, 4, 53, 9, 52, 51, 27, 33, 61, 12, 3, 35, 36, 40, 37, 7, 45, 42) \
+T (118, 4, 5, 8, 14, 35, 12, 55, 34, 6, 53, 60, 5, 48, 56, 22, 18, 62, 44, 38, 31, 28, 16, 33, 36, 43, 26, 16, 23, 37, 47, 51, 3) \
+T (119, 26, 50, 53, 27, 6, 29, 14, 19, 23, 48, 39, 8, 58, 0, 12, 15, 17, 41, 33, 18, 52, 31, 10, 9, 49, 13, 51, 45, 47, 60, 35, 57) \
+T (120, 37, 60, 13, 55, 52, 42, 5, 22, 17, 59, 0, 21, 59, 11, 25, 56, 62, 56, 31, 54, 9, 47, 28, 6, 44, 33, 61, 12, 19, 16, 8, 40) \
+T (121, 47, 45, 44, 40, 22, 17, 4, 31, 8, 52, 34, 32, 41, 21, 62, 37, 5, 13, 58, 27, 0, 17, 33, 57, 42, 57, 18, 43, 61, 36, 38, 14) \
+T (122, 31, 16, 42, 6, 34, 2, 12, 20, 57, 29, 23, 60, 24, 10, 17, 0, 21, 32, 45, 5, 19, 30, 59, 4, 9, 1, 46, 14, 26, 63, 3, 22) \
+T (123, 46, 61, 50, 1, 38, 37, 62, 40, 10, 49, 44, 26, 16, 24, 5, 2, 39, 20, 15, 30, 34, 29, 57, 27, 47, 55, 8, 44, 36, 4, 9, 25) \
+T (124, 45, 53, 7, 48, 23, 21, 20, 7, 13, 4, 22, 24, 39, 0, 63, 60, 18, 37, 34, 36, 54, 49, 1, 1, 38, 27, 17, 57, 27, 14, 59, 62) \
+T (125, 30, 57, 46, 21, 51, 23, 25, 62, 29, 12, 51, 15, 41, 33, 16, 56, 19, 61, 27, 49, 41, 40, 55, 54, 44, 43, 2, 26, 34, 22, 11, 20) \
+T (126, 26, 29, 15, 57, 6, 15, 30, 10, 53, 24, 19, 52, 23, 43, 20, 1, 18, 29, 56, 51, 38, 8, 51, 2, 4, 41, 62, 12, 7, 63, 3, 33) \
+T (127, 42, 10, 36, 2, 41, 34, 19, 2, 46, 27, 5, 55, 15, 22, 36, 26, 30, 58, 51, 61, 18, 48, 24, 21, 56, 7, 14, 47, 17, 6, 0, 8) \
+T (128, 34, 23, 16, 20, 15, 13, 3, 30, 59, 46, 54, 24, 26, 45, 17, 48, 4, 27, 7, 31, 2, 41, 1, 28, 51, 12, 63, 8, 32, 19, 18, 33) \
+T (129, 3, 41, 62, 28, 30, 63, 24, 5, 33, 60, 55, 32, 37, 45, 56, 52, 50, 35, 26, 38, 10, 40, 15, 14, 17, 58, 46, 41, 11, 34, 48, 2) \
+T (130, 59, 60, 24, 20, 61, 39, 43, 37, 53, 32, 8, 44, 28, 13, 36, 58, 0, 42, 60, 55, 31, 57, 56, 10, 18, 3, 5, 12, 18, 34, 49, 54) \
+T (131, 3, 62, 16, 40, 38, 32, 5, 54, 53, 28, 63, 20, 12, 14, 50, 4, 13, 34, 32, 29, 26, 18, 25, 52, 2, 42, 30, 59, 43, 41, 27, 10) \
+T (132, 35, 31, 57, 52, 4, 0, 61, 21, 15, 3, 9, 54, 38, 13, 24, 30, 37, 58, 41, 6, 49, 32, 12, 28, 19, 59, 14, 42, 16, 48, 56, 23) \
+T (133, 62, 12, 13, 50, 26, 32, 45, 10, 48, 55, 49, 8, 24, 42, 52, 57, 53, 3, 54, 38, 33, 43, 7, 26, 23, 6, 21, 61, 18, 7, 51, 44) \
+T (134, 31, 15, 38, 39, 60, 14, 5, 21, 53, 6, 9, 43, 12, 36, 32, 40, 30, 10, 56, 51, 50, 35, 38, 3, 37, 13, 2, 24, 63, 34, 55, 34) \
+T (135, 29, 36, 22, 7, 63, 23, 19, 20, 12, 58, 13, 50, 41, 1, 59, 33, 46, 39, 52, 11, 8, 51, 62, 42, 31, 10, 58, 38, 45, 4, 32, 53) \
+T (136, 19, 20, 47, 13, 22, 10, 14, 37, 35, 31, 8, 15, 32, 54, 43, 40, 4, 9, 1, 32, 12, 29, 23, 60, 52, 51, 39, 52, 56, 6, 26, 11) \
+T (137, 39, 11, 49, 34, 37, 51, 32, 63, 26, 62, 16, 49, 14, 5, 7, 3, 59, 33, 54, 58, 61, 9, 47, 36, 13, 23, 28, 2, 40, 4, 44, 1) \
+T (138, 53, 24, 33, 35, 19, 49, 55, 34, 44, 27, 40, 47, 38, 17, 25, 39, 60, 4, 26, 15, 7, 36, 55, 51, 39, 20, 45, 62, 57, 50, 57, 21) \
+T (139, 24, 58, 16, 63, 7, 20, 18, 9, 35, 48, 12, 54, 0, 62, 41, 42, 25, 50, 17, 61, 51, 37, 4, 55, 33, 22, 12, 40, 53, 26, 47, 29) \
+T (140, 55, 53, 40, 61, 63, 57, 46, 17, 8, 56, 4, 29, 27, 32, 24, 52, 5, 13, 12, 5, 44, 30, 26, 3, 22, 0, 47, 19, 39, 50, 38, 15) \
+T (141, 15, 46, 3, 18, 3, 55, 22, 39, 10, 62, 61, 38, 48, 16, 6, 45, 11, 60, 5, 26, 4, 50, 24, 59, 47, 8, 29, 53, 12, 21, 43, 58) \
+T (142, 22, 8, 21, 6, 55, 10, 55, 20, 59, 19, 55, 23, 52, 39, 46, 49, 20, 1, 40, 5, 12, 14, 57, 50, 29, 2, 37, 31, 62, 18, 34, 54) \
+T (143, 54, 28, 50, 0, 62, 18, 10, 8, 13, 29, 52, 8, 5, 36, 35, 4, 58, 19, 56, 29, 38, 30, 55, 51, 40, 34, 53, 26, 33, 59, 12, 27) \
+T (144, 42, 4, 35, 20, 52, 3, 10, 21, 17, 63, 62, 40, 15, 41, 54, 39, 8, 57, 5, 45, 37, 38, 1, 43, 32, 58, 6, 50, 33, 3, 55, 9) \
+T (145, 27, 62, 49, 14, 19, 39, 61, 40, 22, 20, 10, 22, 34, 43, 9, 46, 31, 42, 54, 23, 35, 50, 4, 3, 41, 24, 8, 30, 9, 45, 48, 17) \
+T (146, 4, 40, 22, 45, 8, 35, 9, 24, 9, 41, 7, 47, 49, 58, 51, 43, 54, 37, 18, 39, 56, 1, 46, 0, 33, 38, 15, 13, 17, 31, 54, 2) \
+T (147, 55, 19, 20, 3, 41, 8, 49, 36, 28, 38, 1, 11, 44, 55, 32, 15, 59, 0, 63, 50, 2, 16, 61, 21, 14, 23, 30, 22, 33, 46, 48, 62) \
+T (148, 30, 40, 59, 11, 9, 8, 50, 42, 10, 6, 58, 22, 45, 60, 63, 4, 49, 31, 5, 7, 25, 18, 52, 13, 53, 0, 0, 39, 24, 48, 3, 20) \
+T (149, 41, 1, 63, 11, 49, 24, 26, 51, 31, 57, 7, 36, 46, 4, 53, 19, 29, 21, 30, 14, 10, 48, 38, 13, 59, 25, 44, 43, 35, 61, 33, 16) \
+T (150, 38, 44, 5, 26, 25, 42, 16, 15, 43, 28, 41, 3, 52, 62, 50, 11, 6, 35, 13, 12, 57, 24, 32, 31, 39, 55, 46, 33, 0, 18, 4, 47) \
+T (151, 45, 29, 60, 15, 6, 36, 53, 18, 54, 47, 61, 13, 3, 50, 21, 27, 28, 21, 7, 63, 26, 34, 9, 24, 52, 46, 38, 56, 48, 59, 31, 2) \
+T (152, 32, 23, 3, 13, 35, 55, 18, 19, 42, 29, 48, 54, 53, 30, 17, 62, 37, 38, 31, 32, 6, 61, 7, 10, 52, 8, 27, 12, 59, 50, 36, 28) \
+T (153, 37, 63, 52, 6, 46, 43, 28, 51, 7, 25, 59, 26, 42, 40, 22, 5, 4, 58, 54, 44, 41, 32, 53, 14, 39, 17, 30, 61, 24, 45, 31, 47) \
+T (154, 33, 38, 42, 58, 12, 10, 8, 25, 3, 63, 55, 37, 31, 30, 2, 0, 59, 34, 43, 11, 36, 27, 49, 28, 22, 60, 48, 20, 1, 6, 35, 47) \
+T (155, 57, 2, 6, 50, 16, 12, 36, 59, 1, 61, 39, 35, 21, 20, 17, 51, 48, 32, 19, 53, 29, 23, 18, 31, 24, 4, 52, 8, 27, 62, 60, 9) \
+T (156, 60, 54, 13, 2, 32, 8, 58, 42, 23, 24, 12, 63, 43, 59, 22, 44, 15, 20, 4, 57, 61, 27, 47, 9, 49, 35, 28, 21, 48, 52, 19, 48) \
+T (157, 61, 38, 50, 28, 35, 15, 29, 51, 30, 20, 1, 54, 10, 0, 24, 46, 59, 3, 16, 32, 45, 12, 7, 11, 48, 37, 26, 19, 62, 49, 13, 5) \
+T (158, 10, 15, 16, 60, 24, 52, 19, 0, 25, 41, 46, 11, 29, 5, 62, 22, 43, 36, 17, 7, 18, 34, 49, 45, 59, 9, 42, 51, 55, 44, 21, 3) \
+T (159, 30, 18, 51, 36, 21, 15, 6, 61, 13, 58, 44, 25, 57, 22, 11, 54, 33, 39, 43, 0, 26, 19, 29, 63, 8, 4, 41, 23, 31, 58, 5, 47) \
+T (160, 43, 57, 36, 22, 21, 46, 53, 50, 63, 10, 20, 52, 8, 34, 18, 4, 56, 38, 41, 48, 35, 5, 39, 23, 54, 30, 4, 13, 40, 45, 2, 12) \
+T (161, 24, 31, 61, 52, 55, 36, 32, 10, 33, 3, 58, 35, 62, 50, 51, 54, 63, 30, 28, 4, 26, 47, 14, 56, 23, 59, 39, 38, 16, 25, 17, 37) \
+T (162, 60, 17, 42, 30, 56, 12, 14, 47, 6, 20, 5, 19, 55, 54, 33, 39, 58, 30, 22, 32, 0, 7, 18, 4, 63, 48, 36, 10, 3, 21, 28, 35) \
+T (163, 11, 12, 21, 42, 0, 50, 48, 35, 20, 48, 38, 46, 52, 36, 43, 31, 28, 52, 48, 27, 1, 13, 60, 58, 39, 16, 32, 37, 57, 53, 24, 41) \
+T (164, 10, 17, 45, 30, 36, 24, 55, 59, 5, 50, 15, 56, 13, 38, 25, 29, 53, 20, 6, 1, 26, 51, 36, 32, 23, 35, 62, 3, 34, 10, 12, 52) \
+T (165, 15, 0, 34, 40, 12, 13, 28, 39, 39, 20, 48, 14, 22, 27, 51, 34, 11, 18, 16, 38, 62, 58, 6, 41, 44, 42, 36, 7, 33, 37, 37, 5) \
+T (166, 35, 44, 35, 56, 39, 57, 11, 35, 1, 0, 61, 31, 52, 32, 33, 24, 37, 49, 18, 29, 24, 12, 5, 43, 55, 25, 60, 40, 4, 30, 38, 3) \
+T (167, 25, 2, 53, 19, 62, 59, 49, 43, 15, 12, 15, 28, 22, 35, 40, 31, 47, 11, 16, 10, 41, 5, 7, 23, 48, 24, 60, 52, 30, 50, 55, 7) \
+T (168, 49, 27, 41, 40, 42, 20, 39, 50, 17, 58, 9, 54, 2, 38, 48, 16, 62, 43, 18, 59, 22, 63, 29, 61, 60, 6, 33, 24, 14, 57, 4, 28) \
+T (169, 13, 41, 9, 55, 51, 0, 46, 18, 42, 53, 37, 5, 7, 39, 15, 36, 30, 50, 11, 20, 52, 47, 1, 44, 63, 43, 6, 60, 2, 34, 31, 54) \
+T (170, 49, 35, 62, 17, 55, 14, 30, 11, 8, 29, 2, 54, 31, 44, 36, 46, 37, 21, 15, 28, 27, 23, 57, 53, 51, 37, 34, 19, 47, 16, 43, 59) \
+T (171, 50, 37, 40, 26, 46, 58, 54, 59, 17, 30, 23, 11, 43, 61, 31, 8, 60, 34, 25, 63, 4, 41, 39, 48, 51, 13, 49, 22, 52, 57, 29, 13) \
+T (172, 42, 47, 27, 36, 47, 41, 45, 24, 8, 20, 35, 22, 38, 50, 57, 52, 28, 46, 53, 54, 37, 2, 48, 33, 32, 5, 60, 17, 19, 34, 55, 43) \
+T (173, 19, 12, 42, 37, 36, 13, 0, 1, 62, 53, 54, 50, 44, 0, 24, 59, 2, 6, 10, 29, 3, 63, 34, 28, 13, 61, 46, 33, 7, 26, 27, 5) \
+T (174, 32, 5, 30, 54, 15, 26, 25, 28, 1, 51, 11, 39, 2, 30, 27, 13, 43, 6, 7, 25, 31, 8, 3, 16, 41, 29, 26, 5, 19, 58, 42, 59) \
+T (175, 48, 5, 7, 28, 40, 56, 49, 42, 47, 61, 24, 13, 44, 18, 38, 53, 30, 10, 21, 6, 29, 2, 33, 22, 14, 59, 42, 21, 45, 31, 27, 54) \
+T (176, 56, 39, 62, 32, 46, 48, 36, 27, 3, 53, 22, 42, 31, 9, 40, 0, 19, 58, 16, 26, 1, 10, 16, 21, 63, 54, 23, 2, 15, 6, 7, 47) \
+T (177, 31, 18, 57, 52, 5, 32, 56, 7, 11, 6, 9, 20, 30, 56, 46, 23, 42, 38, 3, 34, 19, 45, 21, 55, 0, 8, 53, 24, 29, 60, 25, 49) \
+T (178, 32, 2, 48, 34, 7, 57, 1, 58, 39, 16, 53, 33, 31, 12, 21, 6, 4, 62, 50, 46, 61, 23, 5, 40, 44, 9, 28, 11, 11, 37, 25, 13) \
+T (179, 47, 40, 12, 47, 26, 3, 33, 30, 46, 61, 33, 10, 19, 1, 20, 5, 37, 9, 28, 27, 25, 63, 15, 23, 43, 54, 11, 30, 6, 24, 57, 18) \
+T (180, 16, 27, 2, 62, 63, 52, 26, 21, 37, 18, 41, 45, 15, 9, 51, 46, 28, 38, 60, 30, 35, 20, 7, 52, 53, 24, 42, 56, 33, 22, 48, 31) \
+T (181, 0, 40, 54, 27, 2, 3, 21, 10, 32, 31, 55, 31, 34, 53, 36, 22, 59, 41, 1, 20, 13, 42, 46, 17, 52, 49, 28, 41, 37, 40, 4, 43) \
+T (182, 35, 7, 38, 12, 27, 41, 8, 17, 1, 23, 46, 3, 28, 24, 61, 60, 21, 19, 48, 33, 26, 29, 45, 51, 48, 56, 34, 22, 10, 62, 25, 39) \
+T (183, 61, 14, 56, 62, 44, 59, 54, 26, 61, 27, 52, 24, 3, 33, 12, 16, 48, 47, 28, 9, 21, 38, 23, 0, 55, 5, 22, 39, 9, 35, 59, 63) \
+T (184, 41, 27, 35, 53, 49, 26, 12, 14, 3, 39, 19, 2, 16, 46, 47, 52, 24, 59, 6, 51, 52, 34, 4, 50, 32, 13, 63, 20, 45, 10, 28, 40) \
+T (185, 14, 7, 4, 53, 23, 11, 9, 41, 26, 20, 46, 51, 3, 8, 18, 56, 31, 48, 38, 15, 12, 46, 42, 59, 40, 57, 16, 2, 21, 33, 37, 11) \
+T (186, 46, 10, 6, 33, 7, 2, 37, 4, 11, 32, 59, 60, 2, 4, 12, 47, 26, 39, 27, 52, 5, 58, 30, 24, 36, 55, 63, 28, 62, 25, 43, 25) \
+T (187, 6, 60, 15, 13, 18, 56, 39, 43, 61, 20, 63, 26, 37, 53, 23, 33, 44, 10, 14, 58, 35, 2, 17, 37, 41, 12, 1, 22, 10, 16, 5, 55) \
+T (188, 31, 62, 49, 57, 22, 42, 61, 6, 34, 35, 3, 13, 16, 56, 2, 28, 38, 49, 22, 49, 0, 29, 17, 57, 59, 27, 5, 22, 26, 24, 40, 30) \
+T (189, 3, 24, 42, 30, 19, 13, 9, 57, 6, 46, 36, 52, 16, 55, 60, 4, 2, 50, 32, 33, 58, 15, 22, 33, 21, 39, 20, 37, 27, 0, 1, 53) \
+T (190, 19, 62, 32, 12, 18, 61, 31, 60, 14, 6, 15, 17, 22, 39, 30, 56, 49, 48, 16, 63, 42, 43, 1, 11, 20, 59, 27, 25, 63, 29, 37, 2) \
+T (191, 0, 15, 16, 7, 56, 54, 8, 63, 39, 18, 32, 46, 12, 35, 17, 38, 41, 34, 36, 40, 51, 21, 61, 26, 43, 57, 53, 4, 45, 6, 57, 2) \
+T (192, 52, 12, 62, 8, 60, 56, 29, 5, 6, 7, 9, 21, 44, 47, 48, 53, 58, 54, 45, 40, 15, 17, 1, 28, 4, 55, 22, 57, 32, 19, 33, 10) \
+T (193, 14, 48, 58, 51, 60, 30, 42, 4, 3, 17, 44, 36, 34, 9, 8, 16, 46, 43, 32, 24, 47, 21, 2, 49, 59, 55, 10, 62, 11, 25, 29, 57) \
+T (194, 35, 0, 38, 57, 14, 16, 12, 7, 10, 40, 20, 44, 42, 40, 22, 47, 31, 5, 54, 8, 13, 26, 62, 28, 32, 37, 48, 34, 41, 39, 60, 4) \
+T (195, 30, 15, 1, 38, 55, 58, 7, 14, 13, 12, 11, 35, 17, 22, 39, 32, 50, 13, 5, 62, 51, 63, 46, 10, 8, 61, 9, 49, 59, 4, 0, 34) \
+T (196, 37, 31, 6, 15, 23, 0, 30, 35, 4, 54, 56, 63, 3, 20, 44, 27, 43, 25, 4, 41, 5, 1, 38, 51, 59, 26, 42, 48, 58, 50, 5, 2) \
+T (197, 3, 21, 28, 5, 22, 62, 16, 17, 56, 45, 46, 33, 41, 24, 25, 31, 10, 54, 19, 14, 0, 59, 42, 34, 12, 23, 53, 35, 55, 30, 18, 8) \
+T (198, 3, 56, 16, 31, 45, 6, 37, 26, 34, 41, 36, 52, 21, 48, 13, 27, 22, 51, 62, 60, 59, 0, 25, 62, 44, 9, 23, 42, 11, 33, 39, 57) \
+T (199, 59, 20, 31, 41, 24, 27, 26, 54, 7, 42, 30, 5, 25, 37, 53, 11, 21, 42, 39, 3, 2, 28, 47, 59, 32, 10, 57, 61, 52, 22, 19, 15) \
+T (200, 3, 57, 34, 47, 8, 31, 63, 39, 34, 19, 52, 42, 51, 28, 50, 44, 59, 27, 21, 24, 30, 61, 28, 20, 56, 20, 37, 32, 12, 22, 14, 4) \
+T (201, 1, 61, 23, 43, 21, 38, 13, 42, 45, 40, 24, 16, 59, 4, 46, 11, 43, 10, 30, 55, 20, 5, 49, 62, 22, 31, 54, 21, 53, 36, 17, 8) \
+T (202, 49, 56, 60, 30, 24, 23, 40, 15, 32, 61, 37, 13, 56, 5, 57, 0, 28, 39, 27, 59, 60, 42, 3, 6, 51, 36, 8, 53, 34, 22, 35, 10) \
+T (203, 27, 13, 16, 12, 30, 31, 15, 47, 23, 22, 37, 29, 40, 55, 6, 44, 11, 4, 49, 9, 50, 1, 25, 38, 59, 61, 2, 18, 28, 8, 17, 57) \
+T (204, 5, 62, 5, 37, 27, 2, 31, 25, 9, 40, 58, 34, 60, 17, 14, 0, 8, 47, 44, 43, 21, 54, 15, 20, 57, 35, 30, 61, 36, 7, 16, 32) \
+T (205, 55, 22, 9, 29, 54, 52, 0, 13, 39, 36, 63, 12, 43, 56, 58, 0, 10, 18, 48, 1, 20, 60, 4, 62, 2, 51, 41, 61, 1, 26, 24, 21) \
+T (206, 29, 14, 52, 20, 49, 59, 31, 55, 61, 15, 20, 11, 1, 16, 39, 43, 53, 13, 35, 7, 38, 28, 41, 10, 63, 56, 2, 23, 0, 57, 30, 26) \
+T (207, 31, 45, 56, 4, 19, 1, 32, 44, 20, 50, 8, 39, 58, 33, 59, 29, 62, 3, 55, 11, 28, 6, 32, 29, 43, 41, 7, 5, 18, 15, 21, 14) \
+T (208, 29, 1, 31, 17, 10, 58, 27, 5, 63, 27, 23, 49, 60, 4, 33, 3, 9, 51, 28, 37, 35, 61, 42, 19, 18, 39, 34, 15, 21, 14, 7, 36) \
+T (209, 47, 2, 8, 51, 56, 61, 12, 0, 37, 49, 24, 29, 44, 60, 30, 63, 33, 55, 5, 4, 27, 45, 50, 13, 59, 14, 39, 46, 40, 28, 19, 11) \
+T (210, 50, 2, 52, 36, 3, 59, 4, 24, 20, 41, 8, 49, 48, 5, 28, 37, 22, 18, 26, 16, 61, 38, 43, 33, 30, 16, 6, 42, 55, 54, 14, 32) \
+T (211, 56, 57, 33, 0, 47, 43, 50, 22, 15, 53, 1, 17, 60, 20, 63, 2, 27, 18, 51, 45, 23, 7, 31, 47, 4, 38, 34, 35, 49, 10, 9, 32) \
+T (212, 42, 54, 63, 4, 20, 3, 48, 34, 28, 10, 6, 60, 33, 29, 37, 14, 35, 13, 11, 57, 43, 44, 24, 39, 7, 56, 37, 22, 41, 31, 49, 32) \
+T (213, 40, 25, 61, 33, 60, 4, 1, 28, 29, 63, 47, 56, 9, 6, 22, 39, 7, 16, 38, 55, 18, 10, 34, 3, 24, 59, 9, 51, 44, 35, 14, 47) \
+T (214, 14, 11, 0, 4, 25, 6, 13, 60, 2, 26, 11, 27, 31, 30, 41, 58, 48, 24, 35, 44, 32, 49, 17, 8, 3, 1, 54, 16, 61, 15, 10, 18) \
+T (215, 7, 30, 38, 10, 26, 20, 54, 1, 28, 41, 0, 0, 5, 32, 56, 61, 48, 42, 14, 4, 34, 55, 39, 53, 46, 13, 62, 31, 53, 37, 24, 11) \
+T (216, 43, 36, 2, 21, 0, 28, 16, 53, 23, 7, 47, 30, 37, 28, 6, 35, 40, 60, 50, 32, 60, 9, 32, 46, 55, 49, 29, 13, 22, 14, 8, 62) \
+T (217, 15, 53, 9, 63, 0, 6, 29, 26, 35, 55, 38, 23, 50, 45, 2, 25, 16, 7, 53, 48, 47, 4, 18, 34, 28, 22, 43, 8, 60, 61, 21, 1) \
+T (218, 60, 32, 56, 46, 28, 61, 35, 57, 2, 11, 44, 34, 13, 23, 39, 50, 18, 5, 1, 40, 59, 3, 51, 49, 43, 14, 12, 27, 43, 31, 1, 25) \
+T (219, 4, 10, 19, 21, 46, 37, 30, 61, 45, 45, 40, 59, 39, 18, 42, 50, 2, 3, 23, 15, 32, 26, 52, 31, 35, 38, 48, 53, 20, 6, 12, 57) \
+T (220, 37, 43, 11, 32, 25, 41, 42, 54, 19, 27, 46, 12, 35, 16, 58, 48, 38, 21, 52, 56, 13, 22, 24, 1, 30, 24, 51, 50, 59, 20, 15, 31) \
+T (221, 31, 52, 23, 52, 42, 57, 3, 59, 56, 34, 35, 50, 25, 2, 45, 8, 11, 16, 62, 21, 25, 0, 15, 28, 18, 7, 24, 33, 1, 4, 20, 48) \
+T (222, 2, 37, 10, 34, 16, 28, 56, 57, 42, 11, 0, 27, 60, 25, 23, 61, 44, 36, 55, 53, 62, 41, 13, 27, 24, 20, 14, 39, 19, 8, 50, 56) \
+T (223, 47, 23, 30, 12, 48, 20, 63, 38, 60, 46, 43, 54, 1, 53, 6, 62, 2, 0, 37, 55, 39, 33, 19, 28, 26, 5, 41, 35, 44, 31, 9, 33) \
+T (224, 8, 3, 25, 48, 57, 1, 24, 23, 32, 22, 12, 10, 5, 43, 46, 39, 56, 19, 33, 27, 0, 56, 13, 2, 38, 51, 60, 35, 15, 59, 23, 28) \
+T (225, 15, 40, 34, 53, 58, 22, 7, 47, 54, 5, 33, 13, 60, 17, 52, 45, 24, 20, 36, 16, 61, 21, 46, 56, 23, 2, 42, 63, 43, 59, 57, 9) \
+T (226, 43, 21, 31, 3, 24, 2, 53, 41, 25, 12, 47, 19, 48, 28, 36, 45, 29, 23, 9, 50, 63, 20, 1, 61, 7, 6, 37, 26, 10, 55, 60, 58) \
+T (227, 59, 13, 48, 58, 52, 5, 16, 39, 7, 36, 37, 41, 47, 26, 40, 42, 25, 54, 6, 51, 63, 27, 12, 56, 28, 19, 49, 62, 38, 44, 61, 9)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-4.inc b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-4.inc
new file mode 100644
index 000000000..c50fa8e9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-4.inc
@@ -0,0 +1,139 @@
+#define N 4
+#define TESTS \
+T (0, 0, 1, 2, 3) \
+T (1, 0, 0, 0, 0) \
+T (2, 6, 3, 1, 5) \
+T (3, 1, 3, 5, 0) \
+T (4, 6, 3, 5, 4) \
+T (5, 6, 4, 1, 0) \
+T (6, 6, 1, 4, 2) \
+T (7, 3, 7, 4, 4) \
+T (8, 3, 2, 4, 4) \
+T (9, 3, 2, 6, 1) \
+T (10, 5, 4, 5, 6) \
+T (11, 1, 4, 0, 7) \
+T (12, 1, 5, 7, 2) \
+T (13, 2, 3, 0, 4) \
+T (14, 7, 6, 4, 2) \
+T (15, 6, 1, 3, 4) \
+T (16, 0, 2, 4, 6) \
+T (17, 1, 3, 5, 7) \
+T (18, 3, 3, 3, 3) \
+T (19, 3, 2, 1, 0) \
+T (20, 0, 4, 1, 5) \
+T (21, 2, 6, 3, 7) \
+T (22, 1, 2, 3, 0) \
+T (23, 2, 1, 0, 3)
+#define EXPTESTS \
+T (116, 1, 2, 4, 3) \
+T (117, 7, 3, 3, 0) \
+T (118, 5, 3, 2, 7) \
+T (119, 0, 3, 5, 6) \
+T (120, 0, 0, 1, 5) \
+T (121, 4, 6, 2, 1) \
+T (122, 2, 5, 6, 3) \
+T (123, 4, 6, 3, 2) \
+T (124, 4, 7, 5, 6) \
+T (125, 0, 4, 2, 4) \
+T (126, 2, 4, 6, 0) \
+T (127, 4, 3, 5, 1) \
+T (128, 5, 4, 7, 3) \
+T (129, 7, 5, 6, 4) \
+T (130, 2, 0, 5, 3) \
+T (131, 7, 4, 3, 0) \
+T (132, 6, 1, 3, 1) \
+T (133, 3, 4, 1, 7) \
+T (134, 0, 0, 6, 4) \
+T (135, 6, 4, 0, 1) \
+T (136, 6, 0, 2, 4) \
+T (137, 1, 3, 4, 2) \
+T (138, 3, 1, 2, 4) \
+T (139, 3, 1, 5, 0) \
+T (140, 1, 6, 0, 2) \
+T (141, 0, 2, 6, 4) \
+T (142, 1, 7, 5, 2) \
+T (143, 7, 0, 4, 1) \
+T (144, 7, 3, 5, 6) \
+T (145, 0, 7, 5, 4) \
+T (146, 6, 4, 2, 3) \
+T (147, 1, 5, 7, 6) \
+T (148, 5, 7, 4, 7) \
+T (149, 5, 2, 2, 0) \
+T (150, 7, 1, 6, 4) \
+T (151, 5, 2, 4, 6) \
+T (152, 5, 0, 4, 6) \
+T (153, 4, 2, 7, 3) \
+T (154, 7, 1, 0, 6) \
+T (155, 0, 4, 2, 5) \
+T (156, 3, 4, 3, 2) \
+T (157, 2, 0, 6, 1) \
+T (158, 5, 1, 7, 4) \
+T (159, 2, 1, 5, 6) \
+T (160, 1, 6, 5, 7) \
+T (161, 2, 4, 1, 6) \
+T (162, 3, 7, 1, 6) \
+T (163, 2, 1, 4, 7) \
+T (164, 4, 2, 1, 0) \
+T (165, 0, 7, 1, 3) \
+T (166, 7, 4, 2, 3) \
+T (167, 4, 5, 3, 5) \
+T (168, 1, 5, 6, 7) \
+T (169, 6, 3, 2, 0) \
+T (170, 6, 2, 1, 5) \
+T (171, 5, 6, 1, 3) \
+T (172, 2, 2, 3, 1) \
+T (173, 5, 4, 3, 5) \
+T (174, 7, 3, 4, 1) \
+T (175, 4, 2, 3, 6) \
+T (176, 7, 6, 5, 3) \
+T (177, 7, 2, 0, 6) \
+T (178, 1, 3, 0, 2) \
+T (179, 5, 3, 0, 5) \
+T (180, 4, 6, 7, 2) \
+T (181, 4, 5, 2, 0) \
+T (182, 5, 0, 1, 2) \
+T (183, 2, 3, 4, 1) \
+T (184, 2, 6, 5, 1) \
+T (185, 0, 6, 7, 4) \
+T (186, 4, 1, 6, 2) \
+T (187, 1, 3, 2, 3) \
+T (188, 2, 5, 4, 3) \
+T (189, 2, 5, 6, 4) \
+T (190, 4, 0, 5, 0) \
+T (191, 2, 1, 6, 0) \
+T (192, 7, 5, 0, 1) \
+T (193, 3, 5, 6, 7) \
+T (194, 0, 1, 2, 7) \
+T (195, 3, 1, 0, 2) \
+T (196, 2, 4, 6, 3) \
+T (197, 6, 0, 5, 4) \
+T (198, 6, 5, 7, 1) \
+T (199, 2, 5, 4, 6) \
+T (200, 7, 2, 3, 6) \
+T (201, 3, 5, 7, 3) \
+T (202, 1, 7, 4, 6) \
+T (203, 4, 0, 7, 1) \
+T (204, 7, 1, 0, 4) \
+T (205, 5, 1, 3, 4) \
+T (206, 0, 7, 3, 5) \
+T (207, 3, 2, 1, 5) \
+T (208, 7, 5, 0, 2) \
+T (209, 7, 0, 6, 3) \
+T (210, 6, 6, 7, 7) \
+T (211, 5, 6, 0, 4) \
+T (212, 5, 1, 2, 2) \
+T (213, 7, 1, 2, 6) \
+T (214, 5, 4, 2, 6) \
+T (215, 1, 5, 6, 4) \
+T (216, 7, 0, 2, 1) \
+T (217, 1, 5, 3, 6) \
+T (218, 3, 3, 6, 5) \
+T (219, 2, 3, 5, 7) \
+T (220, 2, 4, 3, 0) \
+T (221, 1, 5, 6, 3) \
+T (222, 7, 5, 1, 5) \
+T (223, 0, 5, 3, 4) \
+T (224, 2, 3, 1, 4) \
+T (225, 2, 3, 5, 1) \
+T (226, 4, 3, 1, 0) \
+T (227, 2, 3, 5, 5)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-8.inc b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-8.inc
new file mode 100644
index 000000000..a39d71da6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-8.inc
@@ -0,0 +1,139 @@
+#define N 8
+#define TESTS \
+T (0, 0, 1, 2, 3, 4, 5, 6, 7) \
+T (1, 0, 0, 0, 0, 0, 0, 0, 0) \
+T (2, 0, 1, 2, 3, 0, 1, 2, 3) \
+T (3, 0, 10, 3, 8, 1, 11, 10, 2) \
+T (4, 0, 1, 2, 3, 3, 0, 2, 1) \
+T (5, 12, 5, 14, 9, 8, 15, 1, 7) \
+T (6, 9, 10, 11, 8, 4, 15, 14, 12) \
+T (7, 4, 10, 14, 9, 11, 1, 12, 11) \
+T (8, 15, 3, 3, 8, 5, 11, 2, 10) \
+T (9, 13, 11, 10, 15, 8, 5, 14, 8) \
+T (10, 9, 13, 12, 14, 10, 1, 5, 14) \
+T (11, 5, 11, 12, 6, 3, 2, 4, 15) \
+T (12, 5, 13, 14, 8, 4, 10, 4, 12) \
+T (13, 14, 8, 12, 3, 13, 9, 5, 4) \
+T (14, 15, 3, 13, 6, 14, 12, 10, 0) \
+T (15, 0, 5, 11, 7, 4, 6, 14, 1) \
+T (16, 0, 2, 4, 6, 8, 10, 12, 14) \
+T (17, 1, 3, 5, 7, 9, 11, 13, 15) \
+T (18, 3, 3, 3, 3, 3, 3, 3, 3) \
+T (19, 7, 6, 5, 4, 3, 2, 1, 0) \
+T (20, 0, 8, 1, 9, 2, 10, 3, 11) \
+T (21, 4, 12, 5, 13, 6, 14, 7, 15) \
+T (22, 1, 2, 3, 4, 5, 6, 7, 0) \
+T (23, 6, 5, 4, 3, 2, 1, 0, 7)
+#define EXPTESTS \
+T (116, 9, 3, 9, 4, 7, 0, 0, 6) \
+T (117, 4, 14, 12, 8, 9, 6, 0, 10) \
+T (118, 10, 12, 1, 3, 4, 11, 9, 2) \
+T (119, 4, 11, 9, 5, 8, 14, 0, 2) \
+T (120, 0, 10, 8, 6, 4, 9, 7, 5) \
+T (121, 10, 15, 0, 4, 12, 9, 7, 3) \
+T (122, 13, 6, 0, 7, 5, 12, 12, 2) \
+T (123, 4, 10, 11, 15, 12, 7, 3, 8) \
+T (124, 1, 13, 15, 9, 6, 5, 7, 4) \
+T (125, 7, 13, 2, 5, 2, 8, 1, 6) \
+T (126, 4, 5, 2, 12, 14, 13, 8, 6) \
+T (127, 4, 10, 2, 7, 11, 15, 9, 0) \
+T (128, 14, 8, 12, 10, 13, 3, 11, 2) \
+T (129, 10, 8, 14, 9, 5, 1, 15, 7) \
+T (130, 12, 2, 9, 13, 5, 14, 1, 15) \
+T (131, 10, 4, 1, 14, 11, 15, 9, 2) \
+T (132, 9, 12, 7, 4, 2, 1, 0, 9) \
+T (133, 11, 15, 4, 10, 3, 12, 13, 5) \
+T (134, 1, 5, 6, 13, 14, 15, 3, 10) \
+T (135, 0, 14, 6, 10, 1, 13, 3, 2) \
+T (136, 2, 11, 1, 5, 12, 13, 3, 5) \
+T (137, 7, 11, 4, 1, 12, 10, 14, 10) \
+T (138, 3, 6, 7, 13, 11, 15, 10, 0) \
+T (139, 10, 8, 7, 14, 1, 11, 0, 13) \
+T (140, 5, 3, 13, 11, 8, 5, 12, 6) \
+T (141, 15, 2, 12, 13, 10, 8, 5, 0) \
+T (142, 13, 9, 10, 2, 11, 3, 4, 1) \
+T (143, 2, 14, 6, 5, 1, 8, 15, 0) \
+T (144, 12, 9, 14, 10, 1, 3, 11, 13) \
+T (145, 12, 13, 11, 2, 5, 6, 4, 8) \
+T (146, 5, 0, 2, 1, 6, 8, 15, 13) \
+T (147, 8, 7, 1, 3, 5, 11, 14, 15) \
+T (148, 0, 9, 2, 15, 3, 1, 8, 10) \
+T (149, 4, 14, 11, 6, 8, 5, 12, 7) \
+T (150, 5, 9, 10, 12, 14, 15, 2, 7) \
+T (151, 11, 6, 5, 7, 11, 14, 2, 1) \
+T (152, 13, 1, 7, 4, 6, 8, 15, 9) \
+T (153, 10, 12, 9, 1, 6, 7, 8, 15) \
+T (154, 8, 4, 5, 1, 3, 0, 7, 13) \
+T (155, 13, 9, 3, 4, 10, 1, 15, 7) \
+T (156, 13, 8, 2, 7, 0, 6, 3, 6) \
+T (157, 15, 15, 13, 6, 0, 5, 14, 4) \
+T (158, 13, 1, 2, 2, 7, 9, 2, 6) \
+T (159, 5, 12, 10, 13, 6, 1, 4, 7) \
+T (160, 0, 2, 9, 1, 5, 11, 14, 11) \
+T (161, 14, 6, 5, 10, 3, 2, 15, 4) \
+T (162, 3, 10, 0, 1, 13, 14, 11, 15) \
+T (163, 13, 7, 5, 9, 5, 0, 11, 4) \
+T (164, 2, 11, 1, 12, 3, 13, 4, 9) \
+T (165, 1, 0, 10, 11, 5, 13, 4, 3) \
+T (166, 3, 9, 1, 12, 15, 14, 10, 5) \
+T (167, 3, 10, 11, 14, 5, 1, 8, 12) \
+T (168, 10, 15, 5, 14, 4, 13, 6, 3) \
+T (169, 1, 8, 6, 4, 11, 13, 7, 10) \
+T (170, 8, 7, 1, 15, 11, 9, 0, 3) \
+T (171, 4, 0, 11, 7, 1, 15, 3, 13) \
+T (172, 14, 7, 3, 4, 9, 11, 0, 6) \
+T (173, 7, 3, 11, 4, 8, 2, 10, 15) \
+T (174, 7, 9, 14, 2, 0, 5, 13, 3) \
+T (175, 4, 8, 5, 9, 3, 11, 1, 14) \
+T (176, 13, 12, 3, 3, 1, 4, 8, 5) \
+T (177, 7, 12, 9, 13, 10, 4, 5, 8) \
+T (178, 14, 3, 12, 7, 2, 6, 5, 5) \
+T (179, 7, 0, 8, 6, 2, 14, 12, 15) \
+T (180, 2, 12, 0, 4, 1, 15, 11, 10) \
+T (181, 0, 7, 5, 12, 15, 10, 14, 3) \
+T (182, 3, 10, 2, 5, 11, 6, 13, 14) \
+T (183, 3, 2, 7, 11, 0, 13, 8, 10) \
+T (184, 0, 12, 15, 1, 9, 2, 11, 4) \
+T (185, 11, 15, 8, 10, 9, 1, 13, 3) \
+T (186, 12, 13, 15, 12, 3, 9, 5, 7) \
+T (187, 4, 10, 5, 6, 1, 11, 0, 11) \
+T (188, 11, 6, 7, 9, 0, 8, 14, 8) \
+T (189, 1, 15, 6, 9, 12, 6, 7, 14) \
+T (190, 1, 5, 6, 11, 12, 13, 3, 0) \
+T (191, 0, 8, 15, 13, 12, 6, 1, 4) \
+T (192, 12, 15, 8, 4, 2, 0, 9, 5) \
+T (193, 14, 5, 13, 10, 12, 11, 0, 1) \
+T (194, 12, 1, 9, 8, 10, 9, 0, 2) \
+T (195, 11, 0, 13, 4, 6, 2, 14, 15) \
+T (196, 0, 10, 6, 2, 12, 4, 9, 13) \
+T (197, 7, 12, 8, 10, 1, 0, 5, 0) \
+T (198, 12, 13, 0, 5, 3, 14, 11, 4) \
+T (199, 9, 1, 4, 14, 10, 12, 15, 6) \
+T (200, 3, 12, 13, 6, 14, 2, 1, 6) \
+T (201, 5, 14, 8, 10, 1, 12, 2, 0) \
+T (202, 5, 8, 2, 7, 4, 15, 14, 2) \
+T (203, 14, 13, 10, 9, 11, 15, 7, 8) \
+T (204, 12, 13, 14, 2, 4, 9, 5, 7) \
+T (205, 0, 7, 5, 4, 7, 13, 6, 8) \
+T (206, 7, 0, 15, 6, 12, 2, 5, 4) \
+T (207, 8, 6, 0, 1, 1, 11, 1, 9) \
+T (208, 11, 6, 14, 9, 5, 3, 7, 13) \
+T (209, 12, 3, 15, 9, 1, 0, 8, 13) \
+T (210, 11, 1, 9, 8, 7, 6, 12, 2) \
+T (211, 10, 9, 2, 6, 8, 11, 0, 4) \
+T (212, 10, 13, 15, 9, 6, 15, 14, 10) \
+T (213, 9, 5, 8, 3, 4, 7, 11, 4) \
+T (214, 1, 2, 13, 5, 8, 4, 3, 6) \
+T (215, 8, 3, 2, 4, 9, 14, 12, 13) \
+T (216, 5, 7, 8, 15, 3, 1, 10, 4) \
+T (217, 2, 9, 3, 2, 14, 11, 5, 7) \
+T (218, 15, 6, 4, 10, 14, 3, 13, 2) \
+T (219, 0, 8, 14, 5, 15, 7, 10, 1) \
+T (220, 14, 0, 6, 10, 8, 2, 7, 4) \
+T (221, 15, 13, 3, 14, 11, 2, 14, 6) \
+T (222, 8, 2, 10, 13, 1, 0, 4, 11) \
+T (223, 7, 15, 2, 9, 1, 12, 11, 3) \
+T (224, 13, 15, 3, 12, 15, 7, 0, 8) \
+T (225, 0, 2, 1, 11, 14, 3, 9, 14) \
+T (226, 12, 14, 3, 15, 8, 5, 1, 7) \
+T (227, 0, 5, 13, 8, 4, 2, 1, 3)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-main.inc b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-main.inc
new file mode 100644
index 000000000..52b75ee73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-main.inc
@@ -0,0 +1,55 @@
+/* Driver fragment for __builtin_shuffle of any vector shape. */
+
+extern void abort (void);
+
+#ifndef UNSUPPORTED
+V a, b, c, d;
+
+#define T(num, msk...) \
+__attribute__((noinline, noclone)) void \
+test_##num (void) \
+{ \
+ VI mask = { msk }; \
+ int i; \
+ c = __builtin_shuffle (a, mask); \
+ d = __builtin_shuffle (a, b, mask); \
+ __asm ("" : : "r" (&c), "r" (&d) : "memory"); \
+ for (i = 0; i < N; ++i) \
+ if (c[i] != a[mask[i] & (N - 1)]) \
+ abort (); \
+ else if ((mask[i] & N)) \
+ { \
+ if (d[i] != b[mask[i] & (N - 1)]) \
+ abort (); \
+ } \
+ else if (d[i] != a[mask[i] & (N - 1)]) \
+ abort (); \
+}
+TESTS
+#ifdef EXPENSIVE
+EXPTESTS
+#endif
+#endif
+
+int
+main ()
+{
+#ifndef UNSUPPORTED
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ a[i] = i + 2;
+ b[i] = N + i + 2;
+ }
+
+#undef T
+#define T(num, msk...) \
+ test_##num ();
+ TESTS
+#ifdef EXPENSIVE
+ EXPTESTS
+#endif
+#endif
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v16hi.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v16hi.c
new file mode 100644
index 000000000..9ff3ebbfa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v16hi.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+typedef unsigned short V __attribute__((vector_size(32)));
+typedef V VI;
+
+#include "vshuf-16.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v16qi.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v16qi.c
new file mode 100644
index 000000000..062324d7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v16qi.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+typedef unsigned char V __attribute__((vector_size(16)));
+typedef V VI;
+
+#include "vshuf-16.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2df.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2df.c
new file mode 100644
index 000000000..8e33d1d04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2df.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_DOUBLE__ == 8 && __SIZEOF_LONG_LONG__ == 8
+typedef double V __attribute__((vector_size(16)));
+typedef unsigned long long VI __attribute__((vector_size(16)));
+#else
+#define UNSUPPORTED
+#endif
+
+#include "vshuf-2.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2di.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2di.c
new file mode 100644
index 000000000..d498c28f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2di.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_LONG_LONG__ == 8
+typedef unsigned long long V __attribute__((vector_size(16)));
+typedef V VI;
+#else
+#define UNSUPPORTED
+#endif
+
+#include "vshuf-2.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2sf.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2sf.c
new file mode 100644
index 000000000..22bcaa98d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2sf.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_FLOAT__ == 4
+typedef float V __attribute__((vector_size(8)));
+# if __SIZEOF_INT__ == 4
+typedef unsigned int VI __attribute__((vector_size(8)));
+# elif __SIZEOF_LONG__ == 4
+typedef unsigned long VI __attribute__((vector_size(8)));
+# else
+# define UNSUPPORTED
+# endif
+#else
+# define UNSUPPORTED
+#endif
+
+#include "vshuf-2.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2si.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2si.c
new file mode 100644
index 000000000..2138c6ca6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v2si.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_INT__ == 4
+typedef unsigned int V __attribute__((vector_size(8)));
+typedef V VI;
+#elif __SIZEOF_LONG__ == 4
+typedef unsigned long V __attribute__((vector_size(8)));
+typedef V VI;
+#else
+#define UNSUPPORTED
+#endif
+
+#include "vshuf-2.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v32qi.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v32qi.c
new file mode 100644
index 000000000..017900687
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v32qi.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+typedef unsigned char V __attribute__((vector_size(32)));
+typedef V VI;
+
+#include "vshuf-32.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4df.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4df.c
new file mode 100644
index 000000000..c11d6396d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4df.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_DOUBLE__ == 8 && __SIZEOF_LONG_LONG__ == 8
+typedef double V __attribute__((vector_size(32)));
+typedef unsigned long long VI __attribute__((vector_size(32)));
+#else
+#define UNSUPPORTED
+#endif
+
+#include "vshuf-4.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4di.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4di.c
new file mode 100644
index 000000000..494cb7826
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4di.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_LONG_LONG__ == 8
+typedef unsigned long long V __attribute__((vector_size(32)));
+typedef V VI;
+#else
+#define UNSUPPORTED
+#endif
+
+#include "vshuf-4.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4hi.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4hi.c
new file mode 100644
index 000000000..cfd56a613
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4hi.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+typedef unsigned short V __attribute__((vector_size(8)));
+typedef V VI;
+
+#include "vshuf-4.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4sf.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4sf.c
new file mode 100644
index 000000000..4db59f9da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4sf.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_FLOAT__ == 4
+typedef float V __attribute__((vector_size(16)));
+# if __SIZEOF_INT__ == 4
+typedef unsigned int VI __attribute__((vector_size(16)));
+# elif __SIZEOF_LONG__ == 4
+typedef unsigned long VI __attribute__((vector_size(16)));
+# else
+# define UNSUPPORTED
+# endif
+#else
+# define UNSUPPORTED
+#endif
+
+#include "vshuf-4.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4si.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4si.c
new file mode 100644
index 000000000..3ae86acd3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v4si.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_INT__ == 4
+typedef unsigned int V __attribute__((vector_size(16)));
+typedef V VI;
+#elif __SIZEOF_LONG__ == 4
+typedef unsigned long V __attribute__((vector_size(16)));
+typedef V VI;
+#else
+# define UNSUPPORTED
+#endif
+
+#include "vshuf-4.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8hi.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8hi.c
new file mode 100644
index 000000000..f4639880f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8hi.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+typedef unsigned short V __attribute__((vector_size(16)));
+typedef V VI;
+
+#include "vshuf-8.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8qi.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8qi.c
new file mode 100644
index 000000000..4bc96bedc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8qi.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+typedef unsigned char V __attribute__((vector_size(8)));
+typedef V VI;
+
+#include "vshuf-8.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8sf.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8sf.c
new file mode 100644
index 000000000..d11aa0c95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8sf.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_FLOAT__ == 4
+typedef float V __attribute__((vector_size(32)));
+# if __SIZEOF_INT__ == 4
+typedef unsigned int VI __attribute__((vector_size(32)));
+# elif __SIZEOF_LONG__ == 4
+typedef unsigned long VI __attribute__((vector_size(32)));
+# else
+# define UNSUPPORTED
+# endif
+#else
+# define UNSUPPORTED
+#endif
+
+#include "vshuf-8.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8si.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8si.c
new file mode 100644
index 000000000..64d97164d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/vshuf-v8si.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-DEXPENSIVE" { target run_expensive_tests } } */
+/* { dg-options "-fno-common" { target hppa*-*-hpux* } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O2" } } */
+/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */
+
+#if __SIZEOF_INT__ == 4
+typedef unsigned int V __attribute__((vector_size(32)));
+typedef V VI;
+#elif __SIZEOF_LONG__ == 4
+typedef unsigned long V __attribute__((vector_size(32)));
+typedef V VI;
+#else
+# define UNSUPPORTED
+#endif
+
+#include "vshuf-8.inc"
+#include "vshuf-main.inc"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/trampoline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/trampoline-1.c
new file mode 100644
index 000000000..37a582c57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/trampoline-1.c
@@ -0,0 +1,57 @@
+/* PR target/12865 */
+/* Origin: Waldek Hebisch <hebisch@math.uni.wroc.pl> */
+
+/* { dg-do run } */
+/* { dg-require-effective-target trampolines } */
+/* { dg-options "-O2" } */
+
+#ifndef NO_TRAMPOLINES
+
+/* This used to fail on various versions of Solaris 2 because the
+ trampoline couldn't be made executable. */
+
+extern void abort(void);
+extern double fabs(double);
+
+void foo (void)
+{
+ const int correct[1100] = {1, 0, -2, 0, 1, 0, 1, -1, -10, -30, -67};
+ int i;
+
+ double x1 (void) {return 1; }
+ double x2 (void) {return -1;}
+ double x3 (void) {return -1;}
+ double x4 (void) {return 1; }
+ double x5 (void) {return 0; }
+
+ typedef double pfun(void);
+
+ double a (int k, pfun x1, pfun x2, pfun x3, pfun x4, pfun x5)
+ {
+ double b (void)
+ {
+ k = k - 1;
+ return a (k, b, x1, x2, x3, x4 );
+ }
+
+ if (k <= 0)
+ return x4 () + x5 ();
+ else
+ return b ();
+ }
+
+ for (i=0; i<=10; i++)
+ {
+ if (fabs(a( i, x1, x2, x3, x4, x5 ) - correct [i]) > 0.1)
+ abort();
+ }
+}
+#endif
+
+int main (void)
+{
+#ifndef NO_TRAMPOLINES
+ foo ();
+#endif
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-1.c
new file mode 100644
index 000000000..3f0c260c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-1.c
@@ -0,0 +1,85 @@
+/* PR c/20043 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+extern void f0 (int *);
+extern void f0 (int *__restrict);
+
+extern void f1 (int *__restrict);
+extern void f1 (int *);
+
+typedef union { int *i; long *l; } U2
+ __attribute__((transparent_union));
+extern void f2 (U2);
+extern void f2 (int *);
+
+typedef union { int *__restrict i; long *__restrict l; } U3
+ __attribute__((transparent_union));
+extern void f3 (U3);
+extern void f3 (int *__restrict);
+
+extern void f4 (U3);
+extern void f4 (int *);
+
+extern void f5 (U2);
+extern void f5 (int *__restrict);
+
+typedef union { long *l; int *i; } U6
+ __attribute__((transparent_union));
+extern void f6 (U6);
+extern void f6 (int *);
+
+typedef union { long *__restrict l; int *__restrict i; } U7
+ __attribute__((transparent_union));
+extern void f7 (U7);
+extern void f7 (int *__restrict);
+
+extern void f8 (U7);
+extern void f8 (int *);
+
+extern void f9 (U6);
+extern void f9 (int *__restrict);
+
+extern void f10 (U2);
+extern void f11 (U3);
+extern void f12 (U6);
+extern void f13 (U7);
+
+int i;
+long l;
+
+int
+main (void)
+{
+ f0 (&i);
+ f0 (&l); /* { dg-warning "passing argument 1 of 'f0' from incompatible pointer type" } */
+ f1 (&i);
+ f1 (&l); /* { dg-warning "passing argument 1 of 'f1' from incompatible pointer type" } */
+ f2 (&i);
+ f2 (&l); /* { dg-warning "passing argument 1 of 'f2' from incompatible pointer type" } */
+ f3 (&i);
+ f3 (&l); /* { dg-warning "passing argument 1 of 'f3' from incompatible pointer type" } */
+ f4 (&i);
+ f4 (&l); /* { dg-warning "passing argument 1 of 'f4' from incompatible pointer type" } */
+ f5 (&i);
+ f5 (&l); /* { dg-warning "passing argument 1 of 'f5' from incompatible pointer type" } */
+ f6 (&i);
+ f6 (&l); /* { dg-warning "passing argument 1 of 'f6' from incompatible pointer type" } */
+ f7 (&i);
+ f7 (&l); /* { dg-warning "passing argument 1 of 'f7' from incompatible pointer type" } */
+ f8 (&i);
+ f8 (&l); /* { dg-warning "passing argument 1 of 'f8' from incompatible pointer type" } */
+ f9 (&i);
+ f9 (&l); /* { dg-warning "passing argument 1 of 'f9' from incompatible pointer type" } */
+ f10 (&i);
+ f10 (&l);
+ f11 (&i);
+ f11 (&l);
+ f12 (&i);
+ f12 (&l);
+ f13 (&i);
+ f13 (&l);
+ return 0;
+}
+
+/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c
new file mode 100644
index 000000000..adc207617
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-2.c
@@ -0,0 +1,18 @@
+/* PR c/20043 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+typedef union { int *i; long *l; } U
+ __attribute__((transparent_union));
+
+extern void f0 (U); /* { dg-message "note: previous declaration" } */
+extern void f0 (void *); /* { dg-error "conflicting types" } */
+
+extern void f1 (U); /* { dg-message "note: previous declaration" } */
+extern void f1 (unsigned long); /* { dg-error "conflicting types" } */
+
+extern void f2 (void *); /* { dg-message "note: previous declaration" } */
+extern void f2 (U); /* { dg-error "conflicting types" } */
+
+extern void f3 (unsigned long); /* { dg-message "note: previous declaration" } */
+extern void f3 (U); /* { dg-error "conflicting types" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-3.c
new file mode 100644
index 000000000..3e4cd77fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-3.c
@@ -0,0 +1,22 @@
+/* Test for ICEs on invalid transparent unions (empty or no named
+ members). Bug 21213. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+enum e { A };
+
+union __attribute__((__transparent_union__)) ue1 { enum e; }; /* { dg-warning "declaration does not declare anything" "not anything" } */
+/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 9 } */
+union ue2 { enum e; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "not anything" } */
+/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 11 } */
+
+union __attribute__((__transparent_union__)) ui1 { int; }; /* { dg-warning "declaration does not declare anything" "not anything" } */
+/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 14 } */
+union ui2 { int; } __attribute__((__transparent_union__)); /* { dg-warning "declaration does not declare anything" "no anything" } */
+/* { dg-warning "union cannot be made transparent" "cannot" { target *-*-* } 16 } */
+
+union __attribute__((__transparent_union__)) u1 { };
+/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 19 } */
+union u2 { } __attribute__((__transparent_union__));
+/* { dg-warning "union cannot be made transparent" "" { target *-*-* } 21 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-4.c
new file mode 100644
index 000000000..f661cf2cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-4.c
@@ -0,0 +1,9 @@
+/* Test for ICE on transparent union with function pointer and
+ -pedantic. Bug 22240. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+
+typedef union { union w *u; int *i; } H __attribute__ ((transparent_union));
+void (*h) (H);
+void g (int *s) { h (s); } /* { dg-warning "ISO C prohibits argument conversion to union type" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-5.c
new file mode 100644
index 000000000..47e245e24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/transparent-union-5.c
@@ -0,0 +1,37 @@
+/* PR 24255 */
+/* { dg-do run } */
+/* { dg-options "-O" } */
+
+extern void abort (void);
+
+union wait { int w_status; };
+
+typedef union
+{
+ union wait *uptr;
+ int *iptr;
+} WAIT_STATUS __attribute__ ((__transparent_union__));
+
+int status;
+union wait wstatus;
+
+void __attribute__((noinline))
+test1 (WAIT_STATUS s)
+{
+ if (s.iptr != &status)
+ abort ();
+}
+
+void __attribute__((noinline))
+test2 (WAIT_STATUS s)
+{
+ if (s.uptr != &wstatus)
+ abort ();
+}
+
+int main()
+{
+ test1 (&status);
+ test2 (&wstatus);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c
new file mode 100644
index 000000000..cbd1c7c80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/20041218-1.c
@@ -0,0 +1,119 @@
+/* PR rtl-optimization/16968 */
+/* Testcase by Jakub Jelinek <jakub@redhat.com> */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+
+struct T
+{
+ unsigned int b, c, *d;
+ unsigned char e;
+};
+struct S
+{
+ unsigned int a;
+ struct T f;
+};
+struct U
+{
+ struct S g, h;
+};
+struct V
+{
+ unsigned int i;
+ struct U j;
+};
+
+extern void exit (int);
+extern void abort (void);
+
+void *
+dummy1 (void *x)
+{
+ return "";
+}
+
+void *
+dummy2 (void *x, void *y)
+{
+ exit (0);
+}
+
+struct V *
+baz (unsigned int x)
+{
+ static struct V v;
+ __builtin_memset (&v, 0x55, sizeof (v));
+ return &v;
+}
+
+int
+check (void *x, struct S *y)
+{
+ if (y->a || y->f.b || y->f.c || y->f.d || y->f.e)
+ abort ();
+ return 1;
+}
+
+static struct V *
+bar (unsigned int x, void *y)
+{
+ const struct T t = { 0, 0, (void *) 0, 0 };
+ struct V *u;
+ void *v;
+ v = dummy1 (y);
+ if (!v)
+ return (void *) 0;
+
+ u = baz (sizeof (struct V));
+ u->i = x;
+ u->j.g.a = 0;
+ u->j.g.f = t;
+ u->j.h.a = 0;
+ u->j.h.f = t;
+
+ if (!check (v, &u->j.g) || !check (v, &u->j.h))
+ return (void *) 0;
+ return u;
+}
+
+int
+foo (unsigned int *x, unsigned int y, void **z)
+{
+ void *v;
+ unsigned int i, j;
+
+ *z = v = (void *) 0;
+
+ for (i = 0; i < y; i++)
+ {
+ struct V *c;
+
+ j = *x;
+
+ switch (j)
+ {
+ case 1:
+ c = bar (j, x);
+ break;
+ default:
+ c = 0;
+ break;
+ }
+ if (c)
+ v = dummy2 (v, c);
+ else
+ return 1;
+ }
+
+ *z = v;
+ return 0;
+}
+
+int
+main (void)
+{
+ unsigned int one = 1;
+ void *p;
+ foo (&one, 1, &p);
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c
new file mode 100644
index 000000000..f850c9bfd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/bb-reorg.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+
+#include <string.h>
+
+#define SIZE 1000
+int t0 = 0;
+const char *t2[SIZE];
+char buf[SIZE];
+
+void
+foo (void)
+{
+ char *s = buf;
+ t0 = 1;
+
+ for (;;)
+ {
+ if (*s == '\0')
+ break;
+ else
+ {
+ t2[t0] = s;
+ t0++;
+ }
+ *s++ = '\0';
+ }
+ t2[t0] = NULL;
+}
+
+
+int
+main ()
+{
+ strcpy (buf, "hello");
+ foo ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c
new file mode 100644
index 000000000..a03aad7f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c
@@ -0,0 +1,38 @@
+/* Test case to check if function foo gets split and the cold function
+ gets a label. */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps" } */
+
+#define SIZE 10000
+
+const char *sarr[SIZE];
+const char *buf_hot;
+const char *buf_cold;
+
+__attribute__((noinline))
+void
+foo (int path)
+{
+ int i;
+ if (path)
+ {
+ for (i = 0; i < SIZE; i++)
+ sarr[i] = buf_hot;
+ }
+ else
+ {
+ for (i = 0; i < SIZE; i++)
+ sarr[i] = buf_cold;
+ }
+}
+
+int
+main (int argc, char *argv[])
+{
+ buf_hot = "hello";
+ buf_cold = "world";
+ foo (argc);
+ return 0;
+}
+
+/* { dg-final-use { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
new file mode 100644
index 000000000..bbfe1f472
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
@@ -0,0 +1,166 @@
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+#include <stdlib.h>
+
+#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647
+typedef unsigned int uint32;
+typedef signed int sint32;
+
+typedef uint32 reg_t;
+
+typedef unsigned long int host_addr_t;
+typedef uint32 target_addr_t;
+typedef sint32 target_saddr_t;
+
+typedef union
+{
+ struct
+ {
+ unsigned int offset:18;
+ unsigned int ignore:4;
+ unsigned int s1:8;
+ int :2;
+ signed int simm:14;
+ unsigned int s3:8;
+ unsigned int s2:8;
+ int pad2:2;
+ } f1;
+ long long ll;
+ double d;
+} insn_t;
+
+typedef struct
+{
+ target_addr_t vaddr_tag;
+ unsigned long int rigged_paddr;
+} tlb_entry_t;
+
+typedef struct
+{
+ insn_t *pc;
+ reg_t registers[256];
+ insn_t *program;
+ tlb_entry_t tlb_tab[0x100];
+} environment_t;
+
+enum operations
+{
+ LOAD32_RR,
+ METAOP_DONE
+};
+
+host_addr_t
+f ()
+{
+ abort ();
+}
+
+reg_t
+simulator_kernel (int what, environment_t *env)
+{
+ register insn_t *pc = env->pc;
+ register reg_t *regs = env->registers;
+ register insn_t insn;
+ register int s1;
+ register reg_t r2;
+ register void *base_addr = &&sim_base_addr;
+ register tlb_entry_t *tlb = env->tlb_tab;
+
+ if (what != 0)
+ {
+ int i;
+ static void *op_map[] =
+ {
+ &&L_LOAD32_RR,
+ &&L_METAOP_DONE,
+ };
+ insn_t *program = env->program;
+ for (i = 0; i < what; i++)
+ program[i].f1.offset = op_map[program[i].f1.offset] - base_addr;
+ }
+
+ sim_base_addr:;
+
+ insn = *pc++;
+ r2 = (*(reg_t *) (((char *) regs) + (insn.f1.s2 << 2)));
+ s1 = (insn.f1.s1 << 2);
+ goto *(base_addr + insn.f1.offset);
+
+ L_LOAD32_RR:
+ {
+ target_addr_t vaddr_page = r2 / 4096;
+ unsigned int x = vaddr_page % 0x100;
+ insn = *pc++;
+
+ for (;;)
+ {
+ target_addr_t tag = tlb[x].vaddr_tag;
+ host_addr_t rigged_paddr = tlb[x].rigged_paddr;
+
+ if (tag == vaddr_page)
+ {
+ *(reg_t *) (((char *) regs) + s1) = *(uint32 *) (rigged_paddr + r2);
+ r2 = *(reg_t *) (((char *) regs) + (insn.f1.s2 << 2));
+ s1 = insn.f1.s1 << 2;
+ goto *(base_addr + insn.f1.offset);
+ }
+
+ if (((target_saddr_t) tag < 0))
+ {
+ *(reg_t *) (((char *) regs) + s1) = *(uint32 *) f ();
+ r2 = *(reg_t *) (((char *) regs) + (insn.f1.s2 << 2));
+ s1 = insn.f1.s1 << 2;
+ goto *(base_addr + insn.f1.offset);
+ }
+
+ x = (x - 1) % 0x100;
+ }
+
+ L_METAOP_DONE:
+ return (*(reg_t *) (((char *) regs) + s1));
+ }
+}
+
+insn_t program[2 + 1];
+
+void *malloc ();
+
+int
+main ()
+{
+ environment_t env;
+ insn_t insn;
+ int i, res;
+ host_addr_t a_page = (host_addr_t) malloc (2 * 4096);
+ target_addr_t a_vaddr = 0x123450;
+ target_addr_t vaddr_page = a_vaddr / 4096;
+ a_page = (a_page + 4096 - 1) & -4096;
+
+ env.tlb_tab[((vaddr_page) % 0x100)].vaddr_tag = vaddr_page;
+ env.tlb_tab[((vaddr_page) % 0x100)].rigged_paddr = a_page - vaddr_page * 4096;
+ insn.f1.offset = LOAD32_RR;
+ env.registers[0] = 0;
+ env.registers[2] = a_vaddr;
+ *(sint32 *) (a_page + a_vaddr % 4096) = 88;
+ insn.f1.s1 = 0;
+ insn.f1.s2 = 2;
+
+ for (i = 0; i < 2; i++)
+ program[i] = insn;
+
+ insn.f1.offset = METAOP_DONE;
+ insn.f1.s1 = 0;
+ program[2] = insn;
+
+ env.pc = program;
+ env.program = program;
+
+ res = simulator_kernel (2 + 1, &env);
+
+ if (res != 88)
+ abort ();
+ exit (0);
+}
+#else
+main(){ exit (0); }
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c
new file mode 100644
index 000000000..67a76c9f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c
@@ -0,0 +1,21 @@
+/* { dg-require-effective-target lto } */
+/* { dg-additional-sources "crossmodule-indircall-1a.c" } */
+/* { dg-options "-O3 -flto -DDOJOB=1" } */
+
+int a;
+extern void (*p[2])(int n);
+void abort (void);
+main()
+{ int i;
+
+ /* This call shall be converted. */
+ for (i = 0;i<1000;i++)
+ p[0](1);
+ /* This call shall not be converted. */
+ for (i = 0;i<1000;i++)
+ p[i%2](2);
+ if (a != 1000)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1a.c
new file mode 100644
index 000000000..a94195cd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1a.c
@@ -0,0 +1,40 @@
+/* It seems there is no way to avoid the other source of mulitple
+ source testcase from being compiled independently. Just avoid
+ error. */
+#ifdef DOJOB
+extern int a;
+void abort (void);
+
+#ifdef _PROFILE_USE
+__attribute__ ((externally_visible))
+int constval=1,constval2=2;
+#else
+__attribute__ ((externally_visible))
+int constval=3,constval2=2;
+#endif
+
+
+void
+add(int i)
+{
+ /* Verify that inlining happens for first case. */
+ if (i==constval && !__builtin_constant_p (i))
+ abort ();
+ /* Second case has no dominating target; it should not inline. */
+ if (i==constval2 && __builtin_constant_p (i))
+ abort ();
+ a += i;
+}
+void
+sub(int i)
+{
+ a -= i;
+}
+__attribute__ ((externally_visible))
+void (*p[2])(int)={add, sub};
+#else
+main()
+{
+ return 0;
+}
+#endif
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1.c
new file mode 100644
index 000000000..e9f3a418d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1.c
@@ -0,0 +1,19 @@
+/* { dg-options "-O2 -fdump-ipa-profile" } */
+/* { dg-additional-sources "ic-misattribution-1a.c" } */
+
+extern void other_caller (void);
+
+void
+callee (void)
+{
+ return;
+}
+
+void
+caller(void (*func) (void))
+{
+ func ();
+}
+
+/* { dg-final-use { scan-ipa-dump "hist->count 1 hist->all 1" "profile" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c
new file mode 100644
index 000000000..fa9d6e705
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c
@@ -0,0 +1,22 @@
+/* { dg-options "-DEMPTY" } */
+/* This file is only needed in combination with ic-misattribution-1.c
+ but there's no easy way to make this file ignored. */
+extern void callee (void);
+extern void caller (void (*func) (void));
+
+typedef void (*func_t) (void);
+func_t func;
+
+int
+main ()
+{
+#ifdef EMPTY
+#else
+ func = callee;
+ caller (callee);
+ func ();
+#endif
+ return 0;
+}
+
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c
new file mode 100644
index 000000000..df7481f4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c
@@ -0,0 +1,43 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
+
+static int a1 (void)
+{
+ return 10;
+}
+
+static int a2 (void)
+{
+ return 0;
+}
+
+typedef int (*tp) (void);
+
+static tp aa [] = {a2, a1, a1, a1, a1};
+
+void setp (int (**pp) (void), int i)
+{
+ if (!i)
+ *pp = aa [i];
+ else
+ *pp = aa [(i & 2) + 1];
+}
+
+int
+main (void)
+{
+ int (*p) (void);
+ int i;
+
+ for (i = 0; i < 10; i ++)
+ {
+ setp (&p, i);
+ p ();
+ }
+
+ return 0;
+}
+
+/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* a1 transformation on insn" "profile"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c
new file mode 100644
index 000000000..e44887b52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c
@@ -0,0 +1,42 @@
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int a;
+int b[100];
+void abort (void);
+
+inline void
+cold_function ()
+{
+ int i;
+ for (i = 0; i < 99; i++)
+ if (b[i] / (b[i+1] + 1))
+ abort ();
+}
+
+inline void
+hot_function ()
+{
+ int i;
+ for (i = 0; i < 99; i++)
+ if (b[i] / (b[i+1] + 1))
+ abort ();
+}
+
+main ()
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ {
+ if (a)
+ cold_function ();
+ else
+ hot_function ();
+ }
+ return 0;
+}
+
+/* cold function should be inlined, while hot function should not.
+ Look for "cold_function () [tail call];" call statement not for the
+ declaration or other appearances of the string in dump. */
+/* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
+/* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/peel-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/peel-1.c
new file mode 100644
index 000000000..65f0c562c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/peel-1.c
@@ -0,0 +1,25 @@
+/* { dg-options "-O3 -fdump-rtl-loop2_unroll -fno-unroll-loops -fpeel-loops" } */
+void abort();
+
+int a[1000];
+int
+__attribute__ ((noinline))
+t()
+{
+ int i;
+ for (i=0;i<1000;i++)
+ if (!a[i])
+ return 1;
+ abort ();
+}
+main()
+{
+ int i;
+ for (i=0;i<1000;i++)
+ t();
+ return 0;
+}
+/* { dg-final-use { scan-rtl-dump "Considering simply peeling loop" "loop2_unroll" } } */
+/* In fact one peeling is enough; we however mispredict number of iterations of the loop
+ at least until loop_ch is schedule ahead of profiling pass. */
+/* { dg-final-use { cleanup-rtl-dump "loop2_unroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr34999.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr34999.c
new file mode 100644
index 000000000..4ec42790e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr34999.c
@@ -0,0 +1,45 @@
+/* Same test as built-in-setjmp.c. Includes the case where
+ the source block of a crossing fallthru edge ends with a call. */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+
+extern int strcmp(const char *, const char *);
+extern char *strcpy(char *, const char *);
+extern void abort(void);
+extern void exit(int);
+
+void *buf[20];
+
+void __attribute__((noinline))
+sub2 (void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int
+main ()
+{
+ char *p = (char *) __builtin_alloca (20);
+
+ strcpy (p, "test");
+
+ if (__builtin_setjmp (buf))
+ {
+ if (strcmp (p, "test") != 0)
+ abort ();
+
+ exit (0);
+ }
+
+ {
+ int *q = (int *) __builtin_alloca (p[2] * sizeof (int));
+ int i;
+
+ for (i = 0; i < p[2]; i++)
+ q[i] = 0;
+
+ while (1)
+ sub2 ();
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr44777.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr44777.c
new file mode 100644
index 000000000..1c4da7f5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr44777.c
@@ -0,0 +1,43 @@
+/* PR middle-end/44777 */
+/* { dg-options "-O0" } */
+/* A variant of gcc.c-torture/execute/comp-goto-2.c. */
+
+extern void abort (void);
+extern void exit (int);
+
+#ifdef STACK_SIZE
+#define DEPTH ((STACK_SIZE) / 512 + 1)
+#else
+#define DEPTH 1000
+#endif
+
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+int
+x (int a)
+{
+ __label__ xlab;
+ void y (int a)
+ {
+ void *x = &&llab;
+ if (a==-1)
+ goto *x;
+ if (a==0)
+ goto xlab;
+ llab:
+ y (a-1);
+ }
+ y (a);
+ xlab:;
+ return a;
+}
+#endif
+
+int
+main ()
+{
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+ if (x (DEPTH) != DEPTH)
+ abort ();
+#endif
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr45354.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr45354.c
new file mode 100644
index 000000000..849e786bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr45354.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling" { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+
+extern void abort (void);
+
+int ifelse_val2;
+
+int __attribute__((noinline))
+test_ifelse2 (int i)
+{
+ int result = 0;
+ if (!i) /* count(6) */
+ result = 1; /* count(1) */
+ if (i == 1) /* count(6) */
+ result = 1024;
+ if (i == 2) /* count(6) */
+ result = 2; /* count(3) */
+ if (i == 3) /* count(6) */
+ return 8; /* count(2) */
+ if (i == 4) /* count(4) */
+ return 2048;
+ return result; /* count(4) */
+}
+
+void __attribute__((noinline))
+call_ifelse ()
+{
+ ifelse_val2 += test_ifelse2 (0);
+ ifelse_val2 += test_ifelse2 (2);
+ ifelse_val2 += test_ifelse2 (2);
+ ifelse_val2 += test_ifelse2 (2);
+ ifelse_val2 += test_ifelse2 (3);
+ ifelse_val2 += test_ifelse2 (3);
+}
+
+int
+main()
+{
+ call_ifelse ();
+ if (ifelse_val2 != 23)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr47187.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr47187.c
new file mode 100644
index 000000000..467ce252b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr47187.c
@@ -0,0 +1,23 @@
+/* PR bootstrap/47187 */
+/* { dg-options "-O2" } */
+
+char buf[64];
+char buf2[64];
+
+void *
+foo (char *p, long size)
+{
+ return __builtin_memcpy (buf, p, size);
+}
+
+int
+main (void)
+{
+ long i;
+ for (i = 0; i < 65536; i++)
+ if (foo ("abcdefghijkl", 12) != buf)
+ __builtin_abort ();
+ if (foo (buf2, 64) != buf)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr49299-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr49299-1.c
new file mode 100644
index 000000000..dd45bafc7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr49299-1.c
@@ -0,0 +1,34 @@
+/* { dg-options "-O2" } */
+
+__attribute__((noreturn)) void (*fn) (void);
+
+volatile int v;
+
+__attribute__((noreturn)) void
+fn0 (void)
+{
+ __builtin_exit (0);
+}
+
+__attribute__((noreturn)) void
+fn1 (void)
+{
+ __builtin_exit (1);
+}
+
+__attribute__((noinline, noclone)) void
+setfn (__attribute__((noreturn)) void (*x) (void))
+{
+ fn = x;
+}
+
+int
+main ()
+{
+ int i;
+ if (v < 1)
+ setfn (fn0);
+ else
+ setfn (fn1);
+ fn ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr49299-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr49299-2.c
new file mode 100644
index 000000000..220c8c8ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr49299-2.c
@@ -0,0 +1,34 @@
+/* { dg-options "-O2" } */
+
+void (*fn) (void);
+
+volatile int v;
+
+__attribute__((noreturn)) void
+fn0 (void)
+{
+ __builtin_exit (0);
+}
+
+void
+fn1 (void)
+{
+}
+
+__attribute__((noinline, noclone)) void
+setfn (void (*x) (void))
+{
+ fn = x;
+}
+
+int
+main ()
+{
+ int i;
+ if (v < 1)
+ setfn (fn0);
+ else
+ setfn (fn1);
+ fn ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr50907.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr50907.c
new file mode 100644
index 000000000..b850513a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr50907.c
@@ -0,0 +1,5 @@
+/* PR middle-end/50907 */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling -fpic" { target { { powerpc*-*-* ia64-*-* x86_64-*-* } && fpic } } } */
+
+#include "pr45354.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr52027.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr52027.c
new file mode 100644
index 000000000..c46a14b2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr52027.c
@@ -0,0 +1,19 @@
+/* PR debug/52027 */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition -fno-reorder-functions" } */
+
+void
+foo (int len)
+{
+ char array[1000];
+ __builtin_memset (array, 0, len);
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 1000; i++)
+ foo (8);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr52150.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr52150.c
new file mode 100644
index 000000000..accdb4a4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr52150.c
@@ -0,0 +1,16 @@
+/* PR gcov-profile/52150 */
+/* { dg-options "-O0" } */
+
+void foo () __asm__ ("bar");
+
+void
+foo ()
+{
+}
+
+int
+main ()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr59003.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr59003.c
new file mode 100644
index 000000000..1c7d5e07f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/pr59003.c
@@ -0,0 +1,30 @@
+/* PR target/59003 */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=amdfam10" { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fno-common" { target hppa*-*-hpux* } } */
+
+__attribute__((noinline, noclone)) void *
+foo (void *p, unsigned int q)
+{
+ return __builtin_memset (p, 0, q * 4UL);
+}
+
+char buf[128] __attribute__((aligned (32)));
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 100000; i++)
+ foo (buf + 4, 1 + (i & 1));
+ for (i = 0; i < 128; i++)
+ {
+ buf[i] = 'X';
+ asm volatile ("" : : : "memory");
+ }
+ foo (buf + 32, 7);
+ for (i = 0; i < 128; i++)
+ if (buf[i] != ((i < 32 || i >= 32 + 28) ? 'X' : 0))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c
new file mode 100644
index 000000000..316cfc757
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c
@@ -0,0 +1,25 @@
+/* { dg-options "-O2 -w" } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef _PROFILE_USE
+int foo(int x) {
+ return 3 * x;
+}
+#else
+int foo(int x) {
+ return 3 * x;
+}
+#endif
+
+int x = 1000;
+
+int main(int argc, char *argv[]) {
+ int i;
+ int sum = 0;
+ for (i = 0; i < x; i++)
+ sum += i;
+ printf("%d\n", sum);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c
new file mode 100644
index 000000000..f73061387
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c
@@ -0,0 +1,22 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
+int a[1000];
+int b[1000];
+int size=1;
+int max=10000;
+main()
+{
+ int i;
+ for (i=0;i<max; i++)
+ {
+ __builtin_memcpy (a, b, size * sizeof (a[0]));
+ asm("");
+ }
+ return 0;
+}
+/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "profile"} } */
+/* Really this ought to simplify into assignment, but we are not there yet. */
+/* a[0] = b[0] is what we fold the resulting memcpy into. */
+/* { dg-final-use { scan-tree-dump " = MEM.*&b" "optimized"} } */
+/* { dg-final-use { scan-tree-dump "MEM.*&a\\\] = " "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c
new file mode 100644
index 000000000..f70fafba3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c
@@ -0,0 +1,24 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
+int a[1000];
+int b[1000];
+int size=1;
+int max=10000;
+#ifdef __mips
+/* We allow short memcpy()s for MIPS16. */
+int __attribute__((nomips16))
+#endif
+main()
+{
+ int i;
+ for (i=0;i<max; i++)
+ {
+ __builtin_memset (a, 10, size * sizeof (a[0]));
+ asm("");
+ }
+ return 0;
+}
+/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "profile"} } */
+/* The versioned memset of size 4 should be optimized to an assignment. */
+/* { dg-final-use { scan-tree-dump "a\\\[0\\\] = 168430090" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/switch-case-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/switch-case-1.c
new file mode 100644
index 000000000..50ee9e44f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/switch-case-1.c
@@ -0,0 +1,40 @@
+/* { dg-options "-O2 -fdump-rtl-expand-all" } */
+int g;
+
+__attribute__((noinline)) void foo (int n)
+{
+ switch (n)
+ {
+ case 1:
+ g++; break;
+ case 2:
+ g += 2; break;
+ case 3:
+ g += 1; break;
+ case 4:
+ g += 3; break;
+ case 5:
+ g += 4; break;
+ case 6:
+ g += 5; break;
+ case 7:
+ g += 6; break;
+ case 8:
+ g += 7; break;
+ case 9:
+ g += 8; break;
+ default:
+ g += 8; break;
+ }
+}
+
+int main ()
+{
+ int i;
+ for (i = 0; i < 10000; i++)
+ foo ((i * i) % 5);
+ return 0;
+}
+/* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 4000" 2 "expand"} } */
+/* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 2000" 1 "expand"} } */
+/* { dg-final-use { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c
new file mode 100644
index 000000000..07d4363d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/switch-case-2.c
@@ -0,0 +1,40 @@
+/* { dg-options "-O2 -fdump-rtl-expand-all" } */
+int g;
+
+__attribute__((noinline)) void foo (int n)
+{
+ switch (n)
+ {
+ case 99:
+ g += 2; break;
+ case 1:
+ g++; break;
+ case 100:
+ g += 1; break;
+ case 4:
+ g += 3; break;
+ case 5:
+ g += 4; break;
+ case 6:
+ g += 5; break;
+ case 7:
+ g += 6; break;
+ case 8:
+ g += 7; break;
+ case 9:
+ g += 8; break;
+ default:
+ g += 8; break;
+ }
+}
+
+int main ()
+{
+ int i;
+ for (i = 0; i < 10000; i++)
+ foo ((i * i) % 5);
+ return 0;
+}
+/* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 4000" 2 "expand"} } */
+/* { dg-final-use { scan-rtl-dump-times ";; basic block\[^\\n\]*count 2000" 1 "expand"} } */
+/* { dg-final-use { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/time-profiler-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/time-profiler-1.c
new file mode 100644
index 000000000..c61b534a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/time-profiler-1.c
@@ -0,0 +1,22 @@
+/* { dg-options "-O2 -fdump-ipa-profile" } */
+
+__attribute__ ((noinline))
+int foo()
+{
+ return 0;
+}
+
+__attribute__ ((noinline))
+int bar()
+{
+ return 1;
+}
+
+int main ()
+{
+ return foo ();
+}
+/* { dg-final-use { scan-ipa-dump-times "Read tp_first_run: 0" 1 "profile"} } */
+/* { dg-final-use { scan-ipa-dump-times "Read tp_first_run: 1" 1 "profile"} } */
+/* { dg-final-use { scan-ipa-dump-times "Read tp_first_run: 2" 1 "profile"} } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/time-profiler-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/time-profiler-2.c
new file mode 100644
index 000000000..041134197
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/time-profiler-2.c
@@ -0,0 +1,50 @@
+/* { dg-options "-O2 -fdump-ipa-profile" } */
+
+#include <unistd.h>
+
+__attribute__ ((noinline))
+int foo()
+{
+ return 1;
+}
+
+__attribute__ ((noinline))
+int bar()
+{
+ return 1;
+}
+
+__attribute__ ((noinline))
+int baz()
+{
+ return 1;
+}
+
+__attribute__ ((noinline))
+int baz1()
+{
+ return 1;
+}
+
+int main ()
+{
+ int f = fork();
+ int r = 0;
+
+ foo ();
+
+ if (f < 0)
+ return 1; /* Fork failed. */
+
+ if(f == 0) /* Child process. */
+ r = bar() - foo();
+ else /* Parent process. */
+ r = foo() - foo();
+
+ return r;
+}
+/* { dg-final-use { scan-ipa-dump-times "Read tp_first_run: 0" 2 "profile"} } */
+/* { dg-final-use { scan-ipa-dump-times "Read tp_first_run: 1" 1 "profile"} } */
+/* { dg-final-use { scan-ipa-dump-times "Read tp_first_run: 2" 1 "profile"} } */
+/* { dg-final-use { scan-ipa-dump-times "Read tp_first_run: 3" 1 "profile"} } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c
new file mode 100644
index 000000000..385a1a5c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/tracer-1.c
@@ -0,0 +1,18 @@
+/* { dg-options "-O2 -ftracer -fdump-tree-tracer" } */
+volatile int a, b, c;
+int main ()
+{
+ int i;
+ for (i = 0; i < 1000; i++)
+ {
+ if (i % 17)
+ a++;
+ else
+ b++;
+ c++;
+ }
+ return 0;
+}
+/* Superblock formation should produce two copies of the increment of c */
+/* { dg-final-generate { scan-tree-dump-times "c =" 2 "tracer" } } */
+/* { dg-final-use { cleanup-tree-dump "tracer" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp
new file mode 100644
index 000000000..454dfaeed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp
@@ -0,0 +1,56 @@
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Test the functionality of programs compiled with profile-directed block
+# ordering using -fprofile-generate followed by -fprofile-use.
+
+load_lib target-supports.exp
+
+# Some targets don't support tree profiling.
+if { ![check_profiling_available "-fprofile-generate"] } {
+ return
+}
+
+# The procedures in profopt.exp need these parameters.
+set tool gcc
+set prof_ext "gcda"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load support procs.
+load_lib profopt.exp
+
+# Save and override the default list defined in profopt.exp.
+set treeprof_save_profopt_options $PROFOPT_OPTIONS
+set PROFOPT_OPTIONS [list {}]
+
+# These are globals used by profopt-execute. The first is options
+# needed to generate profile data, the second is options to use the
+# profile data.
+set profile_option "-fprofile-generate -D_PROFILE_GENERATE"
+set feedback_option "-fprofile-use -D_PROFILE_USE"
+
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+ profopt-execute $src
+}
+
+set PROFOPT_OPTIONS $treeprof_save_profopt_options
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c
new file mode 100644
index 000000000..0663b1286
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c
@@ -0,0 +1,23 @@
+/* { dg-options "-O3 -fdump-rtl-loop2_unroll -funroll-loops -fno-peel-loops" } */
+void abort ();
+
+int a[1000];
+int
+__attribute__ ((noinline))
+t()
+{
+ int i;
+ for (i=0;i<1000;i++)
+ if (!a[i])
+ return 1;
+ abort ();
+}
+main()
+{
+ int i;
+ for (i=0;i<1000;i++)
+ t();
+ return 0;
+}
+/* { dg-final-use { scan-rtl-dump "Considering unrolling loop with constant number of iterations" "loop2_unroll" } } */
+/* { dg-final-use { cleanup-rtl-dump "loop2_unroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c
new file mode 100644
index 000000000..d559b9245
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c
@@ -0,0 +1,21 @@
+
+/* { dg-options "-O2 -fdump-tree-optimized-blocks" } */
+int a[8];
+__attribute__ ((noinline))
+int t()
+{
+ int i;
+ for (i = 0; i < 3; i++)
+ if (a[i])
+ break;
+ return i;
+}
+main ()
+{
+ int i;
+ for (i = 0; i < 1000; i++)
+ t ();
+ return 0;
+}
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c
new file mode 100644
index 000000000..5297098fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-loopch.c
@@ -0,0 +1,22 @@
+/* { dg-options "-O2 -fdump-ipa-profile-blocks-details -fdump-tree-optimized-blocks-details" } */
+int max = 33333;
+int a[8];
+int
+main ()
+{
+ int i;
+ for (i = 0; i < max; i++)
+ {
+ a[i % 8]++;
+ }
+ return 0;
+}
+/* Loop header copying will peel away the initial conditional, so the loop body
+ is once reached directly from entry point of function, rest via loopback
+ edge. */
+/* { dg-final-use { scan-ipa-dump "loop depth 1, count 33334" "profile"} } */
+/* { dg-final-use { scan-tree-dump "loop depth 1, count 33332" "optimized"} } */
+/* { dg-final-use { scan-tree-dump-times "Removing basic block \[^\r\n\]*\[\\r\\n\]+\[^\r\n\]*\[\\r\\n\]+Invalid sum of\[^\r\n\]*\[\\r\\n\]+Invalid sum of" 1 "optimized"} } */
+/* { dg-final-use { scan-tree-dump-times "Invalid sum of" 2 "optimized"} } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c
new file mode 100644
index 000000000..285491445
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O2 -fdump-tree-tailc -fdump-tree-optimized" } */
+__attribute__ ((noinline))
+int factorial(int x)
+{
+ if (x == 1)
+ return 1;
+ else
+ return x*factorial(--x);
+}
+int gbl;
+int
+main()
+{
+ gbl = factorial(100);
+ return 0;
+}
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "tailc"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "tailc" } } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c
new file mode 100644
index 000000000..8d17dbfef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/va-arg-pack-1.c
@@ -0,0 +1,145 @@
+/* __builtin_va_arg_pack () builtin tests. */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+int v1 = 8;
+long int v2 = 3;
+void *v3 = (void *) &v2;
+struct A { char c[16]; } v4 = { "foo" };
+long double v5 = 40;
+char seen[20];
+int cnt;
+
+__attribute__ ((noinline)) int
+foo1 (int x, int y, ...)
+{
+ int i;
+ long int l;
+ void *v;
+ struct A a;
+ long double ld;
+ va_list ap;
+
+ va_start (ap, y);
+ if (x < 0 || x >= 20 || seen[x])
+ abort ();
+ seen[x] = ++cnt;
+ if (y != 6)
+ abort ();
+ i = va_arg (ap, int);
+ if (i != 5)
+ abort ();
+ switch (x)
+ {
+ case 0:
+ i = va_arg (ap, int);
+ if (i != 9 || v1 != 9)
+ abort ();
+ a = va_arg (ap, struct A);
+ if (__builtin_memcmp (a.c, v4.c, sizeof (a.c)) != 0)
+ abort ();
+ v = (void *) va_arg (ap, struct A *);
+ if (v != (void *) &v4)
+ abort ();
+ l = va_arg (ap, long int);
+ if (l != 3 || v2 != 4)
+ abort ();
+ break;
+ case 1:
+ ld = va_arg (ap, long double);
+ if (ld != 41 || v5 != ld)
+ abort ();
+ i = va_arg (ap, int);
+ if (i != 8)
+ abort ();
+ v = va_arg (ap, void *);
+ if (v != &v2)
+ abort ();
+ break;
+ case 2:
+ break;
+ default:
+ abort ();
+ }
+ va_end (ap);
+ return x;
+}
+
+__attribute__ ((noinline)) int
+foo2 (int x, int y, ...)
+{
+ long long int ll;
+ void *v;
+ struct A a, b;
+ long double ld;
+ va_list ap;
+
+ va_start (ap, y);
+ if (x < 0 || x >= 20 || seen[x])
+ abort ();
+ seen[x] = ++cnt | 64;
+ if (y != 10)
+ abort ();
+ switch (x)
+ {
+ case 11:
+ break;
+ case 12:
+ ld = va_arg (ap, long double);
+ if (ld != 41 || v5 != 40)
+ abort ();
+ a = va_arg (ap, struct A);
+ if (__builtin_memcmp (a.c, v4.c, sizeof (a.c)) != 0)
+ abort ();
+ b = va_arg (ap, struct A);
+ if (__builtin_memcmp (b.c, v4.c, sizeof (b.c)) != 0)
+ abort ();
+ v = va_arg (ap, void *);
+ if (v != &v2)
+ abort ();
+ ll = va_arg (ap, long long int);
+ if (ll != 16LL)
+ abort ();
+ break;
+ case 2:
+ break;
+ default:
+ abort ();
+ }
+ va_end (ap);
+ return x + 8;
+}
+
+__attribute__ ((noinline)) int
+foo3 (void)
+{
+ return 6;
+}
+
+extern inline __attribute__ ((always_inline, gnu_inline)) int
+bar (int x, ...)
+{
+ if (x < 10)
+ return foo1 (x, foo3 (), 5, __builtin_va_arg_pack ());
+ return foo2 (x, foo3 () + 4, __builtin_va_arg_pack ());
+}
+
+int
+main (void)
+{
+ if (bar (0, ++v1, v4, &v4, v2++) != 0)
+ abort ();
+ if (bar (1, ++v5, 8, v3) != 1)
+ abort ();
+ if (bar (2) != 2)
+ abort ();
+ if (bar (v1 + 2) != 19)
+ abort ();
+ if (bar (v1 + 3, v5--, v4, v4, v3, 16LL) != 20)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c
new file mode 100644
index 000000000..d6f603e8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c
@@ -0,0 +1,22 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
+int a[1000];
+int b = 256;
+int c = 257;
+main ()
+{
+ int i;
+ int n;
+ for (i = 0; i < 1000; i++)
+ {
+ if (i % 17)
+ n = c;
+ else n = b;
+ a[i] /= n;
+ }
+ return 0;
+}
+/* { dg-final-use { scan-ipa-dump "Div.mod by constant n_\[0-9\]*=257 transformation on insn" "profile"} } */
+/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* != 257\\)" "optimized"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c
new file mode 100644
index 000000000..16839612d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
+unsigned int a[1000];
+unsigned int b = 256;
+unsigned int c = 1024;
+unsigned int d = 17;
+main ()
+{
+ int i;
+ unsigned int n;
+ for (i = 0; i < 1000; i++)
+ {
+ a[i]=100*i;
+ }
+ for (i = 0; i < 1000; i++)
+ {
+ if (i % 2)
+ n = b;
+ else if (i % 3)
+ n = c;
+ else
+ n = d;
+ a[i] %= n;
+ }
+ return 0;
+}
+/* { dg-final-use { scan-ipa-dump "Mod power of 2 transformation on insn" "profile" } } */
+/* This is part of code checking that n is power of 2, so we are sure that the transformation
+ didn't get optimized out. */
+/* { dg-final-use { scan-tree-dump "n_\[0-9\]* \\+ (4294967295|0x0*ffffffff)" "optimized"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c
new file mode 100644
index 000000000..d7b3914a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
+unsigned int a[1000];
+unsigned int b = 257;
+unsigned int c = 1023;
+unsigned int d = 19;
+main ()
+{
+ int i;
+ unsigned int n;
+ for (i = 0; i < 1000; i++)
+ {
+ a[i]=18;
+ }
+ for (i = 0; i < 1000; i++)
+ {
+ if (i % 2)
+ n = b;
+ else if (i % 3)
+ n = c;
+ else
+ n = d;
+ a[i] %= n;
+ }
+ return 0;
+}
+/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */
+/* This is part of code checking that n is greater than the divisor so we are sure that it
+ didn't get optimized out. */
+/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c
new file mode 100644
index 000000000..239bf595d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
+unsigned int a[1000];
+unsigned int b = 999;
+unsigned int c = 1002;
+unsigned int d = 1003;
+main ()
+{
+ int i;
+ unsigned int n;
+ for (i = 0; i < 1000; i++)
+ {
+ a[i]=1000+i;
+ }
+ for (i = 0; i < 1000; i++)
+ {
+ if (i % 2)
+ n = b;
+ else if (i % 3)
+ n = c;
+ else
+ n = d;
+ a[i] %= n;
+ }
+ return 0;
+}
+/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */
+/* This is part of code checking that n is greater than the divisor so we are sure that it
+ didn't get optimized out. */
+/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c
new file mode 100644
index 000000000..1a804a767
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */
+int a[1000];
+int b=997;
+main()
+{
+ int i;
+ for (i = 0; i < 1000; i++)
+ if (a[i])
+ a[i]/=b;
+ else
+ a[i]/=b;
+ return 0;
+}
+/* { dg-final-use { scan-ipa-dump "Div.mod by constant b.*=997 transformation on insn" "profile" } } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-6.c
new file mode 100644
index 000000000..c439fcffe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-6.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+char a[1000];
+char b[1000];
+int size=1000;
+__attribute__ ((noinline))
+t(int size)
+{
+ __builtin_memcpy(a,b,size);
+}
+int
+main()
+{
+ int i;
+ for (i=0; i < size; i++)
+ t(i);
+ return 0;
+}
+/* { dg-final-use { scan-tree-dump "Average value sum:499500" "optimized"} } */
+/* { dg-final-use { scan-tree-dump "IOR value" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c
new file mode 100644
index 000000000..6c64d0795
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c
@@ -0,0 +1,26 @@
+/* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+
+extern void bzero (void *, __SIZE_TYPE__);
+
+int foo(int len)
+{
+ char array[1000];
+ bzero(array, len);
+ return 0;
+}
+
+int main() {
+ int i;
+ for (i = 0; i < 1000; i++)
+ {
+ if (i > 990)
+ foo(16);
+ else
+ foo(8);
+ }
+ return 0;
+}
+
+/* { dg-final-use { scan-ipa-dump "Single value 8 stringop transformation on bzero" "profile" } } */
+/* { dg-final-use { cleanup-ipa-dump "profile" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/wcoverage-mismatch.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/wcoverage-mismatch.c
new file mode 100644
index 000000000..e4231057f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/wcoverage-mismatch.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O2 -Wno-coverage-mismatch" } */
+
+int __attribute__((noinline)) bar (void)
+{
+}
+
+int foo (int i)
+{
+#ifdef _PROFILE_USE
+ if (i)
+ bar ();
+#endif
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ foo (argc);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c
new file mode 100644
index 000000000..3d4ba4f91
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+
+typedef struct rs6000_stack {
+ int first_gp_reg_save;
+} rs6000_stack_t;
+extern char regs_ever_live[113];
+extern rs6000_stack_t *rs6000_stack_info (void);
+void
+rs6000_emit_prologue (int i, rs6000_stack_t *info)
+{
+ if (regs_ever_live[info->first_gp_reg_save + i] || i+info->first_gp_reg_save)
+ gen_rtx_REG (info->first_gp_reg_save + i);
+}
+
+/* There should be precisely one load of first_gp_reg_save. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "first_gp_reg_save" 1 "dom2"} } */
+
+/* There should be precisely one addition. If there is more than one, then
+ the dominator optimizations failed, most likely due to not handling
+ commutative operands correctly. */
+/* { dg-final { scan-tree-dump-times "\\+" 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c
new file mode 100644
index 000000000..fac91be70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern int square (int) __attribute__ ((__const__));
+shit(int a)
+{
+ return square (a) + square (a);
+
+}
+
+/* There should be precisely one call to square. If there is more than one,
+ then the dominator optimizations failed to remove the redundant call. */
+/* { dg-final { scan-tree-dump-times "square" 1 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c
new file mode 100644
index 000000000..fa5992372
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+extern int blah[];
+
+foo(int index)
+{
+ if (blah [(unsigned int)index] != 0)
+ abort ();
+ if (blah [(unsigned int)index] != 0)
+ abort ();
+}
+
+/* There should be precisely one load of blah. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "blah" 1 "dom2"} } */
+
+/* There should be exactly one IF conditional. */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
new file mode 100644
index 000000000..4a64b90db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+union tree_node;
+typedef union tree_node *tree;
+extern const char tree_code_type[];
+
+union tree_node
+{
+ int code;
+ long pointer_alias_set;
+};
+
+long
+get_alias_set (t)
+ tree t;
+{
+ if (tree_code_type[t->code])
+ abort ();
+ if (t->pointer_alias_set)
+ {
+ tree __t = t;
+ if (tree_code_type[__t->code])
+ abort ();
+ }
+}
+
+/* There should be precisely one load of {t,__t}->code. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "->code" 1 "dom2"} } */
+
+/* There should be precisely one load of tree_code_type. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "tree_code_type" 1 "dom2"} } */
+
+/* There should be one IF conditional. If 'tree_code_type[t->code]' is
+ zero, then the third if() conditional is unnecessary. That should cause
+ the call to abort() to be removed, which in turn causes the whole second
+ if() to disappear. */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
new file mode 100644
index 000000000..b3be8a939
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+extern void abort (void);
+struct rtx_def;
+typedef struct rtx_def *rtx;
+enum rtx_code
+{
+ CALL_INSN,
+ EXPR_LIST,
+ NOTE,
+ LAST = 256
+};
+
+struct rtx_def
+{
+
+ enum rtx_code code:16;
+};
+
+int
+nonlocal_mentioned_p (x)
+ rtx x;
+{
+ if (x->code == CALL_INSN)
+ {
+ rtx const _rtx = ((x));
+ if (_rtx->code != CALL_INSN
+ && _rtx->code != NOTE
+ && _rtx->code != EXPR_LIST)
+ abort ();
+ }
+
+ blah (&x);
+}
+
+/* There should be no casts to a short unsigned int since the entire
+ set of conditionals should optimize away. */
+/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom2"} } */
+
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-1.c
new file mode 100644
index 000000000..686ca76a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+static int copying_arguments;
+
+int
+foo ()
+{
+ unsigned int regno;
+ if (regno < 53 && copying_arguments)
+ if (regno >= 53)
+ return 1;
+}
+
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
new file mode 100644
index 000000000..f99598d73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cddce2" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+union tree_node;
+typedef union tree_node *tree;
+typedef struct mem_attrs
+{
+ int foo;
+
+} mem_attrs;
+union rtunion_def
+{
+ mem_attrs *rtmem;
+};
+typedef union rtunion_def rtunion;
+struct rtx_def
+{
+ rtunion fld[1];
+};
+struct tree_decl
+{
+ rtx rtl;
+};
+union tree_node
+{
+ struct tree_decl decl;
+};
+void *
+get_alias_set (t)
+ tree t;
+{
+ long set;
+ if (t->decl.rtl)
+ return (t->decl.rtl->fld[1].rtmem
+ ? 0
+ : (((t->decl.rtl ? t->decl.rtl: (make_decl_rtl (t, 0), t->decl.rtl)))->fld[1]).rtmem);
+ return (void*)-1;
+}
+
+/* There should be precisely one load of ->decl.rtl. If there is
+ more than, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce2"} } */
+
+/* There should be no loads of .rtmem since the complex return statement
+ is just "return 0". */
+/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce2"} } */
+
+/* There should be one IF statement (the complex return statement should
+ collapse down to a simple return 0 without any conditionals). */
+/* { dg-final { scan-tree-dump-times "if " 1 "cddce2"} } */
+
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
new file mode 100644
index 000000000..4f9847852
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+union tree_node;
+typedef union tree_node *tree;
+enum tree_code
+{
+ TREE_VEC = 20,
+};
+struct tree_common
+{
+ int code;
+};
+struct tree_type
+{
+ tree binfo;
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_type type;
+};
+void
+record_component_aliases (type)
+ tree type;
+{
+ const tree __z = type->type.binfo;
+ if (type->type.binfo->common.code != TREE_VEC)
+ abort ();
+
+ if (__z->common.code != TREE_VEC)
+ abort ();
+}
+
+/* There should be precisely one load of type.binfo. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom2"} } */
+
+/* There should be precisely one load of common.code. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "common\\.code" 1 "dom2"} } */
+
+/* There should be one IF conditional. */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
new file mode 100644
index 000000000..c344d48e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+union tree_node;
+typedef union tree_node *tree;
+struct tree_vec
+{
+ int length;
+ tree a[1];
+};
+struct tree_type
+{
+ tree binfo;
+};
+union tree_node
+{
+ struct tree_type type;
+ struct tree_vec vec;
+};
+void
+record_component_aliases (type)
+ tree type;
+{
+ if (type->type.binfo->vec.length)
+ abort ();
+ for (; ((
+ {
+ const tree __z = type->type.binfo;
+ if (type->type.binfo->vec.length)
+ abort ();
+ type->type.binfo->vec.a[4];}
+ )->vec.length);)
+ {
+ if (4 >= type->type.binfo->vec.length)
+ abort ();
+ blah ();
+ }
+}
+
+/* The call to blah should have been eliminated. If the call is not
+ eliminated, then dominator optimizations failed and it'll be
+ impossible to delete other unnecessary code. */
+/* { dg-final { scan-tree-dump-not "blah \\(\\)" "dom2" } } */
+
+/* There should be two IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */
+
+/* There should be a single load of type.binfo. */
+/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom2"} } */
+
+/* There should be two loads of vec.length. */
+/* { dg-final { scan-tree-dump-times "vec.length" 2 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
new file mode 100644
index 000000000..1855580d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+union tree_node;
+typedef union tree_node *tree;
+struct tree_vec
+{
+ int length;
+ tree a[1];
+};
+struct tree_type
+{
+ tree binfo;
+};
+union tree_node
+{
+ struct tree_type type;
+ struct tree_vec vec;
+};
+
+void
+record_component_aliases (type)
+ tree type;
+{
+ int i;
+ if (4 >= type->type.binfo->vec.length)
+ abort ();
+ for (; i < ((
+ {
+ const tree __t = type->type.binfo;
+ if (4 >= __t->vec.length)
+ abort (); type->type.binfo->vec.a[4];}
+ )->vec.length);)
+ {
+ if (4 >= type->type.binfo->vec.length)
+ abort ();
+ blah ();
+ }
+}
+
+/* The call to blah can not be eliminated. */
+/* { dg-final { scan-tree-dump-times "blah \\(\\)" 1 "dom2" } } */
+
+/* There should be four IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 4 "dom2"} } */
+
+/* There should be two loads of type.binfo. */
+/* { dg-final { scan-tree-dump-times "type\\.binfo" 2 "dom2"} } */
+
+/* There should be four loads of vec.length. */
+/* { dg-final { scan-tree-dump-times "vec.length" 4 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
new file mode 100644
index 000000000..44dd25355
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
@@ -0,0 +1,69 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
+
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+struct rtvec_def;
+typedef struct rtvec_def *rtvec;
+union tree_node;
+typedef union tree_node *tree;
+typedef struct mem_attrs
+{
+ long alias;
+}
+mem_attrs;
+union rtunion_def
+{
+ mem_attrs *rtmem;
+};
+typedef union rtunion_def rtunion;
+struct rtx_def
+{
+ int code;
+ rtunion fld[1];
+};
+struct tree_decl
+{
+ rtx rtl;
+};
+union tree_node
+{
+ struct tree_decl decl;
+};
+long
+get_alias_set (t,z)
+ tree t;
+ rtx z;
+{
+ if (t->decl.rtl && (((t->decl.rtl ? z
+ : (make_decl_rtl (t, 0), t->decl.rtl)))->code))
+ return (((((t->decl.rtl ? z : (make_decl_rtl (t, 0), t->decl.rtl)))->
+ fld[1]).rtmem) == 0 ? 0 : (((((
+ {
+ t;}
+ )->decl.
+ rtl ? z : (make_decl_rtl (t, 0),
+ t->decl.rtl)))->
+ fld[1]).rtmem)->alias);
+}
+
+/* The calls to make_decl_rtl should be eliminated
+/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom2" } } */
+
+/* There should be three IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */
+
+/* There should be one loads of decl.rtl. */
+/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom2"} } */
+
+/* There should be one load of code. */
+/* { dg-final { scan-tree-dump-times "code" 1 "dom2"} } */
+
+/* There should be one load of rtmem. */
+/* { dg-final { scan-tree-dump-times "rtmem" 1 "dom2"} } */
+
+/* There should be one load of alias. */
+/* { dg-final { scan-tree-dump-times "->alias" 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
new file mode 100644
index 000000000..ec04e1754
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+struct rtvec_def;
+typedef struct rtvec_def *rtvec;
+union tree_node;
+typedef union tree_node *tree;
+typedef struct mem_attrs
+{
+ long alias;
+}
+mem_attrs;
+union rtunion_def
+{
+ mem_attrs *rtmem;
+};
+typedef union rtunion_def rtunion;
+struct rtx_def
+{
+ int code;
+ rtunion fld[1];
+};
+struct tree_decl
+{
+ rtx rtl;
+};
+union tree_node
+{
+ struct tree_decl decl;
+};
+long
+get_alias_set (t)
+ tree t;
+{
+ if (t->decl.rtl != (void *) 0)
+ return (((t->decl.rtl->fld[1]).rtmem) ==
+ 0 ? 0
+ : ((((t->decl.
+ rtl ? 0 : (make_decl_rtl (t, ((void *) 0)),
+ t->decl.rtl)))->fld[1]).rtmem)->alias);
+}
+
+/* The calls to make_decl_rtl should be eliminated. */
+/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom2" } } */
+
+/* There should be two IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */
+
+/* There should be one load of decl.rtl. */
+/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom2"} } */
+
+/* There should be two loads of rtmem. */
+/* { dg-final { scan-tree-dump-times "rtmem" 2 "dom2"} } */
+
+/* There should be one load of alias. */
+/* { dg-final { scan-tree-dump-times "->alias" 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
new file mode 100644
index 000000000..0225d58a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+enum rtx_code
+{
+ REG,
+ LAST_AND_UNUSED_RTX_CODE = 256
+};
+typedef union rtunion_def rtunion;
+struct rtx_def
+{
+ enum rtx_code code:16;
+ unsigned frame_related:1;
+};
+
+static rtx
+find_base_value (src)
+ rtx src;
+{
+ rtx temp;
+ rtx src_0, src_2;
+ rtx src_1, src_3;
+
+ if ((src_0->code == REG) && (({src_2;})->frame_related))
+ return find_base_value (src_0);
+ if ((src_1->code == REG) && (({ src_3;})->frame_related))
+ return find_base_value (src_1);
+ if (src_0->code == REG)
+ find_base_value (src_0);
+ if (src_1->code == REG)
+ find_base_value (src_1);
+}
+
+rtx
+find_base_value_wrapper (src)
+ rtx src;
+{
+ return find_base_value (src);
+}
+
+/* There should be no casts to short unsigned int. */
+/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
new file mode 100644
index 000000000..cac648687
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+
+union tree_node;
+typedef union tree_node *tree;
+extern const char tree_code_type[];
+struct tree_common
+{
+ int code;
+ tree type;
+};
+struct tree_exp
+{
+ tree operands[1];
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_exp exp;
+};
+long
+get_alias_set (t)
+ tree t;
+{
+ if (tree_code_type[t->common.code] != 't' && t->common.type == 0)
+ return 0;
+ if (tree_code_type[t->common.code] != 't')
+ {
+ while (t->exp.operands[0])
+ t = t->exp.operands[0];
+ }
+}
+
+/* There should be exactly three IF conditionals if we thread jumps
+ properly. */
+/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
new file mode 100644
index 000000000..93a7979c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-expand-details" } */
+
+
+union tree_node;
+typedef union tree_node *tree;
+
+enum tree_code
+{
+ ARRAY_TYPE,
+ LAST_AND_UNUSED_TREE_CODE
+};
+
+struct tree_common
+{
+ enum tree_code code:8;
+};
+
+
+
+
+
+union tree_node
+{
+ struct tree_common common;
+};
+
+
+
+
+int
+objects_must_conflict_p (t1, t2)
+ tree t1, t2;
+{
+
+ if ((t1->common.code == ARRAY_TYPE) != (t2
+ && t2->common.code == ARRAY_TYPE))
+ return 11;
+
+
+ return foo (t2 ? get_alias_set (t2) : 0);
+}
+
+/* There should be one assignment of variables to the value zero. There
+ used to be two assignments, but improvements in threading allowed the
+ second to be propagated into all its uses and eliminated. */
+/* { dg-final { scan-rtl-dump-times "PART.. = 0" 1 "expand"} } */
+
+/* { dg-final { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c
new file mode 100644
index 000000000..59b48397c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+union tree_node;
+typedef union tree_node *tree;
+
+
+enum tree_code
+{
+ SET_TYPE,
+ RECORD_TYPE,
+ LAST_AND_UNUSED_TREE_CODE
+};
+extern const char tree_code_type[];
+
+struct tree_common
+{
+
+ enum tree_code code:8;
+};
+
+
+
+
+
+union tree_node
+{
+ struct tree_common common;
+};
+
+readonly_fields_p (type)
+ tree type;
+{
+
+ if (type->common.code != RECORD_TYPE)
+ return;
+
+ if (tree_code_type[type->common.code] != 't')
+ abort ();
+
+ return;
+}
+
+/* A good optimizer would realize that the cast to (unsigned int) is
+ useless as the earlier cast of the same value of (unsigned char) will
+ always produce the same result. */
+/* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 0 "dom2"} } */
+
+/* There should be one load of ->common.code. We currently fail this
+ because we load from ->common.code using different types. */
+/* { dg-final { scan-tree-dump-times "common\.code" 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c
new file mode 100644
index 000000000..bb474ff4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
+
+extern void exit (int);
+extern void *ggc_alloc (__SIZE_TYPE__);
+typedef struct dw_attr_struct *dw_attr_ref;
+typedef struct dw_attr_struct
+{
+ int dw_attr;
+}
+dw_attr_node;
+void
+foo (int attr_kind, unsigned long offset)
+{
+ dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ attr->dw_attr = attr_kind;
+ if (attr != 0)
+ exit (0);
+}
+
+/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "if " "dom2" { target { keeps_null_pointer_checks } } } } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c
new file mode 100644
index 000000000..1768d4523
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
+
+extern void exit (int);
+extern void *ggc_alloc (__SIZE_TYPE__);
+typedef struct dw_attr_struct *dw_attr_ref;
+typedef struct dw_attr_struct
+{
+ int dw_attr;
+}
+dw_attr_node;
+void
+foo (int attr_kind, unsigned long offset)
+{
+ dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ attr->dw_attr = attr_kind;
+ if (attr != ((void *)0))
+ exit (0);
+}
+
+/* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "if " "dom2" { target { keeps_null_pointer_checks } } } } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c
new file mode 100644
index 000000000..f90acd078
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c
@@ -0,0 +1,67 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+struct rtvec_def;
+typedef struct rtvec_def *rtvec;
+union tree_node;
+typedef union tree_node *tree;
+struct rtx_def
+{
+ int code;
+ int mode;
+ unsigned int in_struct:1;
+};
+struct tree_common
+{
+ int code;
+};
+struct tree_decl
+{
+ rtx rtl;
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_decl decl;
+};
+rtx
+store_expr (exp, target, want_value)
+ tree exp;
+ rtx target;
+ int want_value;
+{
+ if (exp->common.code == 42)
+ abort ();
+ else if (queued_subexp_p (target))
+ {
+ blah (target->mode);
+ if (target->code)
+ abort ();
+ }
+ else
+ {
+ if (target->code && (__extension__({target;})->in_struct));
+ }
+
+ if ((target != (exp->decl.rtl
+ ? (exp->decl.rtl
+ ? exp->decl.rtl
+ : (make_decl_rtl (exp, 0), exp->decl.rtl))
+ : 0))
+ && expr_size (exp))
+ ;
+}
+
+/* All paths to the test "target != 0" occurring in the final IF statement
+ dereference target. Thus target can not have the value zero at that
+ point and the test should have been eliminated. */
+/* ??? The dominator walker (A) doesn't merge this data at joins and
+ (B) only looks at immediate dominators, and only queued_subexp_p
+ immediately dominates the comparison in question. We need something
+ stronger. */
+/* { dg-final { scan-tree-dump-times "target.*!= 0" 0 "dom2" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c
new file mode 100644
index 000000000..8300320c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dce1" } */
+
+void
+bar (int i, int partial, int args_addr)
+{
+ int offset = 0;
+ if (args_addr == 0)
+ offset = 0;
+ if (i >= offset)
+ foo ();
+}
+
+/* There should be only one IF conditional since the first does nothing
+ useful. */
+/* { dg-final { scan-tree-dump-times "if " 1 "dce1"} } */
+/* { dg-final { cleanup-tree-dump "dce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c
new file mode 100644
index 000000000..84344e36c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+
+
+
+union rtunion_def
+{
+ int rtint;
+};
+typedef union rtunion_def rtunion;
+
+
+
+struct rtx_def
+{
+ rtunion fld[1];
+
+};
+
+static int *uid_cuid;
+static int max_uid_cuid;
+
+rtx
+bar (rtx r)
+{
+ rtx place = r;
+
+ if (place->fld[0].rtint <= max_uid_cuid
+ && (place->fld[0].rtint > max_uid_cuid ? insn_cuid (place) :
+ uid_cuid[place->fld[0].rtint]))
+ return r;
+
+ return 0;
+}
+
+/* There should be two IF conditionals. One tests <= max_uid_cuid, the
+ other tets the value in uid_cuid. If either is false the jumps
+ are threaded to the return 0. Which in turn means the path
+ which combines the result of those two tests into a new test
+ must always be true and it is optimized appropriately. */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
new file mode 100644
index 000000000..fe5e859ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+
+extern const unsigned char mode_size[];
+unsigned int
+subreg_highpart_offset (outermode, innermode)
+ int outermode, innermode;
+{
+ unsigned int offset = 0;
+ int difference = (mode_size[innermode] - mode_size[outermode]);
+ if (difference > 0)
+ {
+ offset += difference % (0 ? 8 : 4);
+ offset += difference / 4 * 4;
+ }
+ return offset;
+}
+
+/* There should be one mask with the value 3. */
+/* { dg-final { scan-tree-dump-times " \& 3" 1 "vrp1"} } */
+
+/* There should be one right shift by 2 places. */
+/* { dg-final { scan-tree-dump-times " >> 2" 1 "vrp1"} } */
+
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
new file mode 100644
index 000000000..0711053bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+struct rtx_def;
+typedef struct rtx_def *rtx;
+struct rtx_def
+{
+ int code;
+};
+foo (reg)
+ rtx reg;
+{
+ reg->code = 42;
+ if (reg->code != 42)
+ abort ();
+}
+
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c
new file mode 100644
index 000000000..a12d71840
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vrp -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+oof ()
+{
+ int live_head;
+ int * live = &live_head;
+
+ if (live)
+ bitmap_clear (live);
+}
+
+foo(int n)
+{
+ int *space = (int *)__builtin_alloca (n);
+
+ if (space == 0)
+ abort ();
+ else
+ bar (space);
+}
+
+
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
new file mode 100644
index 000000000..9a3c23163
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+typedef unsigned int cppchar_t;
+cppchar_t
+cpp_parse_escape (pstr, limit, wide)
+ const unsigned char **pstr;
+ const unsigned char *limit;
+ int wide;
+{
+ cppchar_t i = 0;
+ int overflow = 0;
+ cppchar_t mask = ~0;
+
+ while (*pstr < limit)
+ {
+ overflow |= i ^ (i << 4 >> 4);
+ i = oof ();
+ }
+ if (overflow | (i != (i & mask)))
+ foo();
+}
+
+/* There should be precisely three IF statements. If there is
+ more than two, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c
new file mode 100644
index 000000000..424b5583b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+struct rtx_def;
+typedef struct rtx_def *rtx;
+
+
+struct rtx_def
+{
+
+ int code;
+ unsigned int unchanging:1;
+
+};
+static rtx current_sym_addr;
+
+int
+foo ()
+{
+ if (current_sym_addr->code == 42
+ && (({
+ rtx _rtx = current_sym_addr;
+ if (((_rtx)->code) != 42)
+ abort ();
+ _rtx;}
+ )->unchanging))
+ return 0;
+}
+
+/* There should be precisely one load of ->code. If there is
+ more than, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "->code" 1 "dom2"} } */
+
+/* There should be two IF statements. One for 'current_sym_addr->code == 42'.
+ The other one for '(EXPR)->unchanging'. */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
new file mode 100644
index 000000000..8a6506b3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+
+void
+foo (distance, i, j)
+ int distance[13][13];
+ int i, j;
+{
+ if (distance[i][j] < 0)
+ distance[i][0] = ((distance[i][j]) < 0 ? -(distance[i][j]) : (distance[i][j]));
+}
+
+void
+foo2 (distance, i, j)
+ int distance[13][13];
+ int i, j;
+{
+ if (distance[i][j] <= 0)
+ distance[i][0] = ((distance[i][j]) < 0 ? -(distance[i][j]) : (distance[i][j]));
+}
+
+void
+foo3 (distance, i, j)
+ int distance[13][13];
+ int i, j;
+{
+ if (distance[i][j] > 0)
+ distance[i][0] = ((distance[i][j]) < 0 ? -(distance[i][j]) : (distance[i][j]));
+}
+
+void
+foo4 (distance, i, j)
+ double distance[13][13];
+ int i, j;
+{
+ if (distance[i][j] >= 0)
+ distance[i][0] = ((distance[i][j]) < 0 ? -(distance[i][j]) : (distance[i][j]));
+}
+
+/* There should be no ABS_EXPR. */
+/* { dg-final { scan-tree-dump-times "ABS_EXPR " 0 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
new file mode 100644
index 000000000..f9f5fb798
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void abort (void);
+
+union tree_node;
+typedef union tree_node *tree;
+struct tree_common
+{
+ int code;
+};
+struct tree_list
+{
+ tree purpose;
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_list list;
+};
+void
+simplify_condition (cond_p)
+ tree *cond_p;
+{
+ tree decl;
+ tree cond = *cond_p;
+ if (cond->common.code != 42)
+ abort ();
+ decl = cond->list.purpose;
+ if (cond->common.code != 42)
+ abort ();
+ c_simplify_stmt (&decl);
+}
+
+/* There should be exactly one IF conditional. */
+/* { dg-final { scan-tree-dump-times "if " 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c
new file mode 100644
index 000000000..77fd3e59a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+struct die_struct;
+typedef struct die_struct *dw_die_ref;
+typedef struct dw_loc_list_struct *dw_loc_list_ref;
+enum dw_val_class
+{
+ dw_val_class_loc_list,
+};
+typedef struct dw_val_struct
+{
+ enum dw_val_class val_class;
+ union dw_val_struct_union
+ {
+ dw_loc_list_ref val_loc_list;
+ }
+ v;
+}
+dw_val_node;
+typedef struct dw_attr_struct *dw_attr_ref;
+typedef struct dw_attr_struct
+{
+ dw_val_node dw_attr_val;
+}
+dw_attr_node;
+
+extern __inline__ enum dw_val_class
+AT_class (a)
+ dw_attr_ref a;
+{
+ return a->dw_attr_val.val_class;
+}
+
+extern __inline__ dw_loc_list_ref
+AT_loc_list (a)
+ dw_attr_ref a;
+{
+ if (AT_class (a) == dw_val_class_loc_list)
+ return a->dw_attr_val.v.val_loc_list;
+}
+
+void
+output_location_lists (die)
+ dw_die_ref die;
+{
+ dw_die_ref c;
+ dw_attr_ref d_attr;
+ if (AT_class (d_attr) == dw_val_class_loc_list)
+ output_loc_list (AT_loc_list (d_attr));
+}
+
+/* There should be exactly one IF conditional, in output_location_lists. */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c
new file mode 100644
index 000000000..4f0b7cbaf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+static void
+bar ()
+{
+ const char *label2 = (*"*.L_sfnames_b" == '*') + "*.L_sfnames_b";
+ oof (label2);
+}
+
+void
+ooof ()
+{
+ if (""[0] == 0)
+ foo();
+}
+
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c
new file mode 100644
index 000000000..27e2c7105
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-cddce2" } */
+
+extern void abort (void);
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+enum rtx_code
+{
+ UNKNOWN,
+ CODE_LABEL,
+ NOTE,
+ LAST_AND_UNUSED_RTX_CODE = 256
+};
+typedef union rtunion_def rtunion;
+struct rtx_def
+{
+ enum rtx_code code:16;
+};
+void
+delete_dead_jumptables ()
+{
+ rtx insn, next;
+ if (insn->code == CODE_LABEL)
+ {
+ rtx const _rtx = insn;
+ if (_rtx->code != CODE_LABEL && _rtx->code != NOTE)
+ abort ();
+ }
+ ;
+}
+
+/* There should be no loads of ->code. If any exist, then we failed to
+ optimize away all the IF statements and the statements feeding
+ their conditions. */
+/* { dg-final { scan-tree-dump-times "->code" 0 "cddce2"} } */
+
+/* There should be no IF statements. */
+/* { dg-final { scan-tree-dump-times "if " 0 "cddce2"} } */
+
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c
new file mode 100644
index 000000000..aad53c339
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+com(int *blah)
+{
+ int z = *blah;
+ if (z == 256)
+ {
+ oof (z);
+ abort ();
+ }
+ return *blah;
+}
+
+/* There should be precisely one load of blah. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "\\*blah" 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c
new file mode 100644
index 000000000..7f60b2783
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+void
+foo (int value)
+{
+ switch (value)
+ {
+ case 42:
+ if (value != 42)
+ abort ();
+ case 50:
+ blah ();
+ }
+}
+
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c
new file mode 100644
index 000000000..2746415e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+void
+foo (int value)
+{
+ switch (value)
+ {
+ case 40:
+ case 42:
+ if (value != 42)
+ abort ();
+ case 50:
+ blah ();
+ }
+}
+
+/* There should be one IF conditional. */
+/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */
+
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
new file mode 100644
index 000000000..2c2142cbc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
+
+extern void abort (void);
+union tree_node;
+typedef union tree_node *tree;
+extern const char tree_code_type[];
+struct tree_common
+{
+ int code;
+};
+struct tree_decl
+{
+ long pointer_alias_set;
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_decl decl;
+};
+long
+blah (decl, set)
+ tree decl;
+ long set;
+{
+ decl->decl.pointer_alias_set = set;
+ if (tree_code_type[decl->common.code] != 'd')
+ abort ();
+ record_alias_subset (decl->decl.pointer_alias_set);
+ if (set != -1)
+ set = 0;
+ return set;
+}
+
+/* There should be precisely one reference to pointer_alias_set. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
+
+/* The assignment set = -1 in the ELSE clause of the last IF
+ statement should be removed by the final cleanup phase. */
+/* { dg-final { scan-tree-dump-times "set = -1" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
new file mode 100644
index 000000000..41aa1482d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
+
+extern void abort (void);
+union tree_node;
+typedef union tree_node *tree;
+extern const char tree_code_type[];
+struct tree_common
+{
+ int code;
+};
+struct tree_decl
+{
+ long pointer_alias_set;
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_decl decl;
+};
+long
+blah (decl, set)
+ tree decl;
+ long set;
+{
+ decl->decl.pointer_alias_set = oof();
+ if (tree_code_type[decl->common.code] != 'd')
+ abort ();
+ record_alias_subset (decl->decl.pointer_alias_set);
+ if (set != -1)
+ set = 0;
+ return set;
+}
+
+/* There should be precisely one reference to pointer_alias_set. If there is
+ more than one, then the dominator optimizations failed. */
+/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
+
+/* The assignment set = -1 in the ELSE clause of the last IF
+ statement should be removed by the final cleanup phase. */
+/* { dg-final { scan-tree-dump-times "set = -1" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
new file mode 100644
index 000000000..170526547
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+union tree_node;
+typedef union tree_node *tree;
+enum tree_code
+{
+ LAST_AND_UNUSED_TREE_CODE
+};
+extern const char tree_code_type[];
+struct tree_common
+{
+ enum tree_code code:8;
+};
+struct tree_type
+{
+ double alias_set;
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_type type;
+};
+long
+foo (t, set)
+ tree t;
+ double set;
+{
+ if (tree_code_type[t->common.code] != 't')
+ abort ();
+
+ t->type.alias_set = set;
+
+ if (t->common.code == 42)
+ return 1;
+ else
+ return 0;
+}
+/* There should be precisely one load of common.code. If there is
+ more than one, then the dominator optimizations failed. */
+/* ??? Will fail until we properly distinguish member stores. At
+ present the write to type.alias_set kills the previous load. */
+/* { dg-final { scan-tree-dump-times "common.code" 1 "dom2" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c
new file mode 100644
index 000000000..711bab251
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+struct rtx_def;
+typedef struct rtx_def *rtx;
+struct rtvec_def;
+typedef struct rtvec_def *rtvec;
+union tree_node;
+typedef union tree_node *tree;
+struct tree_common
+{
+ int code;
+};
+union tree_node
+{
+ struct tree_common common;
+};
+extern tree current_function_decl;
+struct cgraph_rtl_info
+{
+ _Bool pure_function;
+};
+struct cgraph_rtl_info *cgraph_rtl_info (tree);
+void
+mark_constant_function (void)
+{
+ rtx insn;
+ int nonlocal_memory_referenced;
+
+ if (current_function_decl->common.code != 42)
+ abort ();
+
+ cgraph_rtl_info (current_function_decl)->pure_function = 1;
+}
+
+/* current_function_decl should be loaded once into a temporary
+ and the temporary used as the argument to cgraph_rtl_info.
+ This if we find current_function_decl used as an argument, then
+ we have failed. */
+/* { dg-final { scan-tree-dump-times "\\(current_function_decl\\)" 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030820-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030820-1.c
new file mode 100644
index 000000000..4b659ca34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030820-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* A test for unreachable blocks removal -- bind_expr whose entry is
+ unreachable, but it contains reachable statements. */
+
+void foo(void)
+{
+ if (1)
+ {
+ goto bla;
+ }
+ else
+ {
+xxx:
+ {
+bla:
+ bar ();
+ return;
+ }
+ goto xxx;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030820-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030820-2.c
new file mode 100644
index 000000000..9ca9fbb59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030820-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* A test for variables getting out of their scope in copy propagation. */
+
+void foo(void)
+{
+ int k;
+
+ goto forward;
+back:
+ bla (k);
+ return;
+
+forward:
+ {
+ int i = bar ();
+
+ k = i;
+
+ goto back;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030821-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030821-1.c
new file mode 100644
index 000000000..5de503ed6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030821-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom1 -fdump-tree-optimized" } */
+
+void foo(int k)
+{
+ int i = 1;
+ void *label;
+
+ label = k ? &&x : &&y;
+
+ if (k == 1)
+ goto *label;
+
+ i = 0;
+ goto z;
+z:
+x:
+ if (i)
+ dont_remove ();
+y: ;
+}
+
+/* { dg-final { scan-tree-dump-times "dont_remove \\(\\)" 1 "optimized"} } */
+
+/* We should have folded away the goto &x */
+/* { dg-final { scan-tree-dump-times "goto &x" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c
new file mode 100644
index 000000000..e5988bd79
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+struct A
+{
+ int a,b;
+};
+
+int foo (int x, int y)
+{
+ int i, j;
+ struct A a,b;
+
+ a.a = x;
+ b.b = y;
+ j = a.a;
+ i = b.b;
+ return i + j;
+}
+
+/* The addition should be optimized into 'y+x'. */
+/* { dg-final { scan-tree-dump-times "\[xy\]_..D. \\+ \[xy]_..D." 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c
new file mode 100644
index 000000000..1234aeb34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+struct A
+{
+ int a,b;
+};
+
+int foo (int x, int y)
+{
+ int i, j;
+ struct A a;
+
+ a.a = x;
+ a.b = y;
+ j = a.a;
+ i = a.b;
+ return i + j;
+}
+
+/* This function should be optimized into 'return y+x'. */
+/* { dg-final { scan-tree-dump-times "\[xy\]_..D. \\+ \[xy]_..D." 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030825-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030825-1.c
new file mode 100644
index 000000000..de34acaec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030825-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+void bla(void);
+
+void
+foo(int c, int d)
+{
+ goto skip;
+
+ebef:
+ goto xxx;
+
+skip:
+
+ if (c)
+ {
+xxx:;
+ if (!c)
+ bla ();
+ }
+
+ if (d)
+ goto ebef;
+}
+
+/* Bla should not be optimized away. */
+/* { dg-final { scan-tree-dump-times "bla" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030907-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030907-1.c
new file mode 100644
index 000000000..a36472d39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030907-1.c
@@ -0,0 +1,30 @@
+/* PR optimization/12198
+
+ This was a miscompilation of a switch expressions because
+ the "Case Ranges" extension wasn't handled in tree-cfg.c. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int main()
+{
+ int i;
+ i = 2;
+ switch (i)
+ {
+ case 1 ... 5:
+ goto L1;
+ default:
+ abort ();
+ goto L1;
+ }
+ L1:
+ exit(0);
+}
+
+/* The abort() call clearly is unreachable. */
+/* { dg-final { scan-tree-dump-times "abort" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030907-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030907-2.c
new file mode 100644
index 000000000..47d60946e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030907-2.c
@@ -0,0 +1,30 @@
+/* PR optimization/12109
+
+ This would ICE in tree-ssa-dce.c:process_worklist() when
+ the function was expecting an SSA_NAME but found a VAR_DECL. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-dce" } */
+
+void *do_it(void * dest, const void * src);
+double *create_float(void);
+
+void parse_rvalue(void **DataPtr)
+{
+ double local = 0.0;
+ int terms = 1;
+
+ *DataPtr = create_float();
+
+ switch (terms)
+ {
+ case 1:
+ *((double *)*DataPtr) = local;
+ break;
+
+ case 2:
+ do_it(*DataPtr, &local);
+ break;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c
new file mode 100644
index 000000000..eb1f5ec7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+
+extern int board[];
+
+void
+findbestextension (int blah, int blah2)
+{
+ int defval;
+ defval = def_val (board[blah2]);
+ if (blah)
+ defval = 0;
+ foo (defval);
+}
+
+/* The argument to "foo" should be a variable, not a constant. */
+/* { dg-final { scan-tree-dump-times "foo .defval" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-2.c
new file mode 100644
index 000000000..2c08050c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-2.c
@@ -0,0 +1,40 @@
+/* This test was causing an ICE in DCE because we were allowing void *
+ pointers to have a memory tag, which we were copying when doing copy
+ propagation. Since void * can never be de-referenced, its memory tag
+ was never renamed. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-dominator-opts" } */
+
+typedef __SIZE_TYPE__ size_t;
+typedef union tree_node *tree;
+struct operands_d
+{
+ tree *def_op;
+};
+
+void
+gt_ggc_mx_operands_d (void *x_p)
+{
+ struct operands_d *const x = (struct operands_d *) x_p;
+ if ((*x).def_op != ((void *) 0))
+ {
+ size_t i0;
+ do
+ {
+ const void *const a__ = ((*x).def_op);
+ if (a__ != ((void *) 0) && a__ != (void *) 1)
+ ggc_set_mark (a__);
+ }
+ while (0);
+ for (i0 = 0; i0 < (size_t) (1); i0++)
+ {
+ do
+ {
+ if ((void *) (*x).def_op[i0] != ((void *) 0))
+ gt_ggc_mx_lang_tree_node ((*x).def_op[i0]);
+ }
+ while (0);
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c
new file mode 100644
index 000000000..e74bd08da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+extern int printf (const char *, ...);
+
+main ()
+{
+ int variable = 0;
+ int p = 1;
+ while (1)
+ {
+ if (p)
+ break;
+ variable = variable + 1;
+ if (variable == 10)
+ break;
+ }
+ printf("%d\n", variable);
+}
+
+
+/* The argument to "printf" should be a constant, not a variable. */
+/* { dg-final { scan-tree-dump-times "printf.*, 0" 1 "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
new file mode 100644
index 000000000..719ea65f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
@@ -0,0 +1,15 @@
+/* The compiler was failing to adjust pointer dereferences into array
+ references after propagating &equot[0] into p. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-dominator-opts" } */
+
+static unsigned short equot[(6 +3)];
+int
+foo (num)
+ unsigned short num[];
+{
+ unsigned short *p = &equot[0];
+ *p++ = num[0];
+ *p++ = num[1];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030920-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030920-1.c
new file mode 100644
index 000000000..e27764aec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030920-1.c
@@ -0,0 +1,112 @@
+/* Jump threading was creating FALLTHRU edges out of blocks ending in
+ GOTO_EXPR. */
+
+extern int frame_pointer_needed;
+
+struct value_data_entry
+{
+ unsigned int mode;
+ unsigned int oldest_regno;
+ unsigned int next_regno;
+};
+
+struct value_data
+{
+ struct value_data_entry e[53];
+ unsigned int max_value_regs;
+};
+
+struct rtx_def
+{
+ unsigned int code: 16;
+ unsigned int mode : 8;
+ unsigned int jump : 1;
+ unsigned int call : 1;
+ unsigned int unchanging : 1;
+ unsigned int volatil : 1;
+ unsigned int in_struct : 1;
+ unsigned int used : 1;
+ unsigned integrated : 1;
+ unsigned frame_related : 1;
+ int fld[1];
+};
+
+typedef struct rtx_def *rtx;
+
+enum machine_mode { VOIDmode, BImode, QImode, HImode, SImode, DImode,
+ TImode, OImode, PQImode, PHImode, PSImode, PDImode, QFmode, HFmode,
+ TQFmode, SFmode, DFmode, XFmode, TFmode, QCmode, HCmode, SCmode,
+ DCmode, XCmode, TCmode, CQImode, CHImode, CSImode, CDImode, CTImode,
+ COImode, V1DImode, V2QImode, V2HImode, V2SImode, V2DImode, V4QImode,
+ V4HImode, V4SImode, V4DImode, V8QImode, V8HImode, V8SImode, V8DImode,
+ V16QImode, V2HFmode, V2SFmode, V2DFmode, V4HFmode, V4SFmode, V4DFmode,
+ V8HFmode, V8SFmode, V8DFmode, V16SFmode, BLKmode, CCmode, CCGCmode,
+ CCGOCmode, CCNOmode, CCZmode, CCFPmode, CCFPUmode, MAX_MACHINE_MODE };
+
+enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC,
+ MODE_COMPLEX_INT, MODE_COMPLEX_FLOAT,
+ MODE_VECTOR_INT, MODE_VECTOR_FLOAT,
+ MAX_MODE_CLASS};
+
+extern const unsigned char mode_size[(int) MAX_MACHINE_MODE];
+extern const enum mode_class mode_class[(int) MAX_MACHINE_MODE];
+
+extern int target_flags;
+
+static void
+copy_value (rtx dest, rtx src, struct value_data *vd)
+{
+ unsigned int dr = (((dest)->fld[0]));
+ unsigned int sr = (((src)->fld[0]));
+ unsigned int dn, sn;
+ unsigned int i;
+
+
+
+ if (sr == dr)
+ return;
+
+
+
+ if (dr == 7)
+ return;
+
+
+ if (frame_pointer_needed && dr == 6)
+ return;
+
+
+ dn = (((dr) >= 8 && (dr) <= (8 + 7)) || (((dr) >= (20 + 1) && (dr) <= ((20 + 1) + 7)) || ((dr) >= (((((((20 + 1) + 7) + 1) + 7) + 1) + 7) + 1) && (dr) <= ((((((((20 + 1) + 7) + 1) + 7) + 1) + 7) + 1) + 7))) || ((dr) >= (((20 + 1) + 7) + 1) && (dr) <= ((((20 + 1) + 7) + 1) + 7)) ? (((mode_class[(int) (((enum machine_mode) (dest)->mode))]) == MODE_COMPLEX_INT || (mode_class[(int) (((enum machine_mode) (dest)->mode))]) == MODE_COMPLEX_FLOAT) ? 2 : 1) : ((((enum machine_mode) (dest)->mode)) == TFmode ? ((target_flags & 0x00100000) ? 2 : 3) : (((enum machine_mode) (dest)->mode)) == TCmode ? ((target_flags & 0x00100000) ? 4 : 6) : (((mode_size[(int) (((enum machine_mode) (dest)->mode))]) + ((target_flags & 0x00100000) ? 8 : 4) - 1) / ((target_flags & 0x00100000) ? 8 : 4))));
+ sn = (((sr) >= 8 && (sr) <= (8 + 7)) || (((sr) >= (20 + 1) && (sr) <= ((20 + 1) + 7)) || ((sr) >= (((((((20 + 1) + 7) + 1) + 7) + 1) + 7) + 1) && (sr) <= ((((((((20 + 1) + 7) + 1) + 7) + 1) + 7) + 1) + 7))) || ((sr) >= (((20 + 1) + 7) + 1) && (sr) <= ((((20 + 1) + 7) + 1) + 7)) ? (((mode_class[(int) (((enum machine_mode) (dest)->mode))]) == MODE_COMPLEX_INT || (mode_class[(int) (((enum machine_mode) (dest)->mode))]) == MODE_COMPLEX_FLOAT) ? 2 : 1) : ((((enum machine_mode) (dest)->mode)) == TFmode ? ((target_flags & 0x00100000) ? 2 : 3) : (((enum machine_mode) (dest)->mode)) == TCmode ? ((target_flags & 0x00100000) ? 4 : 6) : (((mode_size[(int) (((enum machine_mode) (dest)->mode))]) + ((target_flags & 0x00100000) ? 8 : 4) - 1) / ((target_flags & 0x00100000) ? 8 : 4))));
+ if ((dr > sr && dr < sr + sn)
+ || (sr > dr && sr < dr + dn))
+ return;
+
+
+
+
+ if (vd->e[sr].mode == VOIDmode)
+ set_value_regno (sr, vd->e[dr].mode, vd);
+ else if (sn < (unsigned int) (((sr) >= 8 && (sr) <= (8 + 7)) || (((sr) >= (20 + 1) && (sr) <= ((20 + 1) + 7)) || ((sr) >= (((((((20 + 1) + 7) + 1) + 7) + 1) + 7) + 1) && (sr) <= ((((((((20 + 1) + 7) + 1) + 7) + 1) + 7) + 1) + 7))) || ((sr) >= (((20 + 1) + 7) + 1) && (sr) <= ((((20 + 1) + 7) + 1) + 7)) ? (((mode_class[(int) (vd->e[sr].mode)]) == MODE_COMPLEX_INT || (mode_class[(int) (vd->e[sr].mode)]) == MODE_COMPLEX_FLOAT) ? 2 : 1) : ((vd->e[sr].mode) == TFmode ? ((target_flags & 0x00100000) ? 2 : 3) : (vd->e[sr].mode) == TCmode ? ((target_flags & 0x00100000) ? 4 : 6) : (((mode_size[(int) (vd->e[sr].mode)]) + ((target_flags & 0x00100000) ? 8 : 4) - 1) / ((target_flags & 0x00100000) ? 8 : 4))))
+ && ((mode_size[(int) (vd->e[sr].mode)]) > ((target_flags & 0x00100000) ? 8 : 4)
+ ? 0 : 0))
+ return;
+
+
+
+
+ else if (sn > (unsigned int) (((sr) >= 8 && (sr) <= (8 + 7)) || (((sr) >= (20 + 1) && (sr) <= ((20 + 1) + 7)) || ((sr) >= (((((((20 + 1) + 7) + 1) + 7) + 1) + 7) + 1) && (sr) <= ((((((((20 + 1) + 7) + 1) + 7) + 1) + 7) + 1) + 7))) || ((sr) >= (((20 + 1) + 7) + 1) && (sr) <= ((((20 + 1) + 7) + 1) + 7)) ? (((mode_class[(int) (vd->e[sr].mode)]) == MODE_COMPLEX_INT || (mode_class[(int) (vd->e[sr].mode)]) == MODE_COMPLEX_FLOAT) ? 2 : 1) : ((vd->e[sr].mode) == TFmode ? ((target_flags & 0x00100000) ? 2 : 3) : (vd->e[sr].mode) == TCmode ? ((target_flags & 0x00100000) ? 4 : 6) : (((mode_size[(int) (vd->e[sr].mode)]) + ((target_flags & 0x00100000) ? 8 : 4) - 1) / ((target_flags & 0x00100000) ? 8 : 4)))))
+ return;
+
+
+
+ vd->e[dr].oldest_regno = vd->e[sr].oldest_regno;
+
+ for (i = sr; vd->e[i].next_regno != (~(unsigned int) 0); i = vd->e[i].next_regno)
+ continue;
+ vd->e[i].next_regno = dr;
+
+
+ validate_value_data (vd);
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c
new file mode 100644
index 000000000..96db1bd1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+
+extern void abort (void);
+
+union tree_node;
+typedef union tree_node *tree;
+enum tree_code
+{
+ BIND_EXPR,
+};
+struct tree_common
+{
+ enum tree_code code:8;
+};
+union tree_node
+{
+ struct tree_common common;
+};
+tree
+voidify_wrapper_expr (tree wrapper)
+{
+ switch (wrapper->common.code)
+ {
+ case BIND_EXPR:
+ if (wrapper->common.code != BIND_EXPR)
+ abort ();
+ }
+}
+
+
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030922-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030922-2.c
new file mode 100644
index 000000000..9a787bd21
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20030922-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom1" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+struct rtx_def
+{
+ int bb;
+};
+int *block_to_bb;
+int target_bb;
+
+int
+rgn_rank (rtx insn1, rtx insn2)
+{
+ if (block_to_bb[insn1->bb] != block_to_bb[insn2->bb])
+ if (block_to_bb[insn2->bb] == target_bb
+ && block_to_bb[insn1->bb] != target_bb)
+ return 1;
+}
+
+/* There should be two IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 2 "dom1" } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c
new file mode 100644
index 000000000..3cc2ae946
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c
@@ -0,0 +1,18 @@
+/* With tree-ssa, gcc.dg/20000724-1.c failed because we missed
+ a VOP of x in the asm statement. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-alias-vops" } */
+
+struct s { int a; };
+
+int
+main(void)
+{
+ struct s x = { 0 };
+ asm volatile ("" : : "r" (&x) : "memory");
+ return 0;
+}
+
+/* The VDEF comes from the initial assignment, the asm, and the clobber. */
+/* { dg-final { scan-tree-dump-times "DEF" 3 "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031021-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031021-1.c
new file mode 100644
index 000000000..7c34ff449
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031021-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+struct A
+{
+ int i : 8;
+};
+
+signed char c1, c2;
+struct A a;
+
+int main()
+{
+ a.i = c1;
+ c2 = a.i;
+ return a.i;
+}
+
+/* We should only store to a.i, not load from it. */
+/* { dg-final { scan-tree-dump-not "= a.i" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031022-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031022-1.c
new file mode 100644
index 000000000..27de6e90e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031022-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom1" } */
+
+typedef struct edge_def
+{
+ int z;
+} *edge;
+typedef struct basic_block_def
+{
+ edge pred;
+} *basic_block;
+extern struct basic_block_def entry_exit_blocks[2];
+void
+blah (int arf)
+{
+ edge e;
+ e = (&entry_exit_blocks[1])->pred;
+ for ( ; ;)
+ if (arf)
+ break;
+ commit_edge_insertions ();
+ e = (&entry_exit_blocks[1])->pred;
+ foo (e);
+}
+
+/* There should be one load from entry_exit_blocks[1].pred. */
+/* { dg-final { scan-tree-dump-times "entry_exit_blocks.1..pred" 1 "dom1"} } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031031-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031031-1.c
new file mode 100644
index 000000000..baca2a00a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031031-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* This program requires the SSA renamer to be run after the second DOM
+ pass. Test provided by Falk Hueffner as Bugzilla #12825. */
+
+struct floppy_raw_cmd {
+ int flags, track;
+} *raw_cmd, default_raw_cmd;
+
+void
+setup_format_params (void)
+{
+ raw_cmd = &default_raw_cmd;
+ raw_cmd->track = 0;
+ raw_cmd->flags = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-1.c
new file mode 100644
index 000000000..fea5aaf08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+/* Check for dead stores to an array. */
+
+void foo (int testarray[])
+{
+ testarray[0] = 0;
+ testarray[0]++;
+ if (testarray[0] != 1)
+ link_error ();
+}
+
+/* There should be only one reference to "testarray" and one in the function header. */
+/* { dg-final { scan-tree-dump-times "testarray" 2 "optimized" } } */
+
+/* There should be no link_error calls. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-2.c
new file mode 100644
index 000000000..73dd4ff2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+/* Check for dead stores to a struct. */
+
+struct s
+{
+ char d;
+ int a, b;
+ double m;
+};
+
+void foo (struct s* teststruct)
+{
+ teststruct->a = 0;
+ teststruct->a++;
+ if (teststruct->a != 1)
+ link_error ();
+}
+
+/* There should be only one reference to "teststruct" and one in the function header. */
+/* { dg-final { scan-tree-dump-times "teststruct" 2 "optimized" } } */
+
+/* There should be no link_error calls. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-3.c
new file mode 100644
index 000000000..2508a2c2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-3.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+/* Check for cprop on array elements. */
+
+void foo (int testarray[])
+{
+ testarray[0] = 0;
+ testarray[1] = 1;
+ testarray[0]++;
+ testarray[1]++;
+ if (testarray[0] != 1)
+ link_error ();
+ if (testarray[1] != 2)
+ link_error ();
+}
+
+/* There should be no link_error calls. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-4.c
new file mode 100644
index 000000000..d72788691
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-4.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+/* Check for cprop on fields of the same struct. */
+
+struct s
+{
+ char d;
+ int a, b;
+ double m;
+};
+
+
+void foo (struct s* r)
+{
+ r->a = 0;
+ r->b = 1;
+ r->a++;
+ r->b++;
+ if (r->a != 1)
+ link_error ();
+ if (r->b != 2)
+ link_error ();
+}
+
+/* There should be no link_error calls. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-5.c
new file mode 100644
index 000000000..b066ab6ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-5.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+/* Check for cprop on different fields of same type structs. */
+
+struct s
+{
+ char d;
+ int a, b;
+ double m;
+};
+
+void foo2 (struct s* r, struct s* p)
+{
+ r->a = 0;
+ p->b = 1;
+ r->a++;
+ p->b++;
+ if (r->a != 1)
+ link_error ();
+ if (p->b != 2)
+ link_error ();
+}
+
+/* There should be no link_error calls. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-6.c
new file mode 100644
index 000000000..51fcd9788
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031106-6.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-sra -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+/* Check for copyprop on structs. */
+
+struct s
+{
+ char d;
+ int a, b;
+ double m;
+};
+
+struct s foo (struct s r)
+{
+ struct s temp_struct1;
+ struct s temp_struct2;
+ struct s temp_struct3;
+ temp_struct1 = r;
+ temp_struct2 = temp_struct1;
+ temp_struct3 = temp_struct2;
+ return temp_struct3;
+}
+
+/* There should be no references to any of "temp_struct*"
+ temporaries. */
+/* { dg-final { scan-tree-dump-times "temp_struct" 0 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031113-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031113-1.c
new file mode 100644
index 000000000..865915f4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031113-1.c
@@ -0,0 +1,32 @@
+/* PR optimization/12640
+
+ We used to get into an infinite loop while trying to
+ figure out `strlen (resultString)'. This showed up as
+ a stack overflow while compiling tk. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+extern __SIZE_TYPE__ strlen (const char *);
+
+int i;
+
+static void
+SendEventProc (char *resultString)
+{
+ char *p;
+
+ resultString = "";
+ while (*p == '-')
+ {
+ if (p[2] == ' ')
+ {
+ resultString = p + 3;
+ }
+ }
+ for (;;)
+ {
+ i = strlen (resultString) + 1;
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031216-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031216-1.c
new file mode 100644
index 000000000..0e97833fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20031216-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+void
+foo (int b)
+{
+ int a;
+ a = b + 2;
+ a--;
+ a--;
+ if (a != b)
+ link_error ();
+}
+
+/* The comparison should be eliminated, there should be no reference
+ to link_error. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040121-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040121-1.c
new file mode 100644
index 000000000..6225bcdc8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040121-1.c
@@ -0,0 +1,28 @@
+
+
+/* Test that (p!=0) + (q!=0) is computed as int,
+ not boolean */
+/* { dg-options "-O3" } */
+/* { dg-do run } */
+extern void abort (void);
+char *foo(char *p, char *q) {
+ int x = (p !=0) + (q != 0);
+ if (x==2) return "a"; else return 0;
+}
+extern char *bar(char*, char*) __attribute__((noinline));
+char *bar(char *first, char *last)
+{
+ int y;
+ if (!first) return last;
+ if (!last) return first;
+ if (*first == 'a')
+ return foo(first, last);
+ return 0;
+}
+main() {
+ char *p = "a", *q = "b";
+ if (p)
+ if (bar(p,q))
+ return 0;
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
new file mode 100644
index 000000000..8518dfb1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+/*
+ test that a condition is propagated inside an if
+*/
+
+void test5 (int x)
+{
+ extern int foo (int);
+ if (x == 0)
+ foo (x);
+ else if (x == 0 )
+ link_error ();
+}
+
+void test55 (int x, int y)
+{
+ int u;
+ if (x == 5 && y)
+ {
+ u = x + 22;
+ if (u != 27)
+ link_error ();
+ }
+}
+
+/* There should be not link_error calls, if there is any the
+ optimization has failed */
+/* ??? Ug. This one may or may not fail based on how fold decides
+ that the && should be emitted (based on BRANCH_COST). Fix this
+ by teaching dom to look through && and register all components
+ as true. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* sparc*-*-* spu-*-* x86_64-*-*" } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040209-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040209-1.c
new file mode 100644
index 000000000..087715322
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040209-1.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+typedef union tree_node *tree;
+
+struct tree_common
+{
+ tree chain;
+};
+
+struct tree_decl
+{
+ struct tree_common common;
+ tree name;
+};
+
+
+union tree_node
+{
+ struct tree_common common;
+ struct tree_decl decl;
+};
+
+int pedantic;
+
+void
+finish_struct (tree t, tree fieldlist, tree attributes)
+{
+ union tree_node * x;
+
+ if (pedantic)
+ {
+ x = fieldlist;
+ if (x->decl.name == 0)
+ {
+ while (x)
+ x = x->common.chain;
+ foo (fieldlist);
+ }
+ }
+
+ x = fieldlist;
+ if (x)
+ {
+ do
+ {
+ x = x->common.chain;
+ } while (x != 0);
+ }
+
+ bar1 (&fieldlist);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040210-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040210-1.c
new file mode 100644
index 000000000..990cb8075
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040210-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+
+
+void abort(void);
+void exit(int);
+
+int x, y;
+
+static void __attribute__ ((noinline))
+init_xy(void)
+{
+ x = 3;
+ y = 2;
+}
+
+void
+test4(void)
+{
+ init_xy();
+ if ((x < y ? x++ : y++) != 2)
+ abort ();
+}
+
+int
+main(){
+ test4 ();
+ exit (0);
+}
+
+/* Should have no more than two ifs left after straightening. */
+/* { dg-final { scan-tree-dump-times "if " 2 "phiopt1"} } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c
new file mode 100644
index 000000000..34a592679
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cddce2" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+extern const char rtx_class[];
+union rtunion_def
+{
+ rtx rtx;
+};
+typedef union rtunion_def rtunion;
+struct rtx_def
+{
+ int code;
+ rtunion fld[1];
+};
+static int
+can_move_up (rtx insn, int n_insns)
+{
+ while (n_insns > 0)
+ {
+ insn = (((insn)->fld[1]).rtx);
+ if (((rtx_class[(int) (((insn)->code))]) == 'i'))
+ n_insns--;
+ }
+ return n_insns <= 0;
+}
+int
+com (rtx insn, int blah)
+{
+ if (!can_move_up (insn, blah))
+ foo ();
+}
+
+/* Cddce cannot remove possibly infinite loops and there is no way how to
+ determine whether the loop in can_move_up ends. */
+/* { dg-final { scan-tree-dump "if " "cddce2"} } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040216-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040216-1.c
new file mode 100644
index 000000000..c770340a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040216-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dse1-details" } */
+
+foo(int *z, int *y, int xx)
+{
+ *z = 1;
+ if (xx)
+ xx = 20;
+ else
+ xx = 30;
+ *z = 2;
+ *z = 3;
+ return xx;
+}
+
+/* We should convert two COND_EXPRs into straightline code. */
+/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1"} } */
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040302-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040302-1.c
new file mode 100644
index 000000000..8b80128cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040302-1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+/* Test for .GLOBAL_VAR not being renamed into SSA after alias analysis.
+ provided by Dale Johannesen in PR 14266. */
+
+void foo() { bar (); }
+main () { foo (); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c
new file mode 100644
index 000000000..8e9f61da6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cddce2 -fdump-tree-forwprop1-details" } */
+
+int abarney[2];
+int afred[1];
+
+void foo(int edx, int eax)
+{
+ if (eax == 100)
+ {
+ if (edx == 1)
+ {
+ abarney[0] = 5;
+ abarney[1] = 6;
+ }
+ }
+ if (eax == 100)
+ {
+ if (-- edx == 0)
+ afred[0] = 2;
+ }
+}
+
+
+/* Verify that we did a forward propagation. */
+/* { dg-final { scan-tree-dump-times "Replaced" 1 "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+
+/* After cddce we should have two IF statements remaining as the other
+ two tests can be threaded. */
+/* { dg-final { scan-tree-dump-times "if " 2 "cddce2"} } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040313-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040313-1.c
new file mode 100644
index 000000000..0ad144c03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040313-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+/* Test provided by Volker Reichelt in PR 14553. The redundant PHI
+ node elimination pass was not using the right API functions to
+ propagate pointers, which resulted in dereferenced pointers that
+ did not have memory tags associated with them. */
+
+void foo(int* p)
+{
+ int i;
+ for (i=1; i>0; --i, ++p)
+ *p=0;
+}
+
+void bar(int* p) { foo(p); }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040319-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040319-1.c
new file mode 100644
index 000000000..d6e544971
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040319-1.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+/* Test derived from PR 14643. When a function has no addressable
+ variables but 2 or more pointers have conflicting memory tags, they
+ were not being processed by the type based alias analyzer,
+ resulting in optimizations removing a non-redundant load. */
+
+extern void abort (void);
+
+struct bar { int count; int *arr;};
+
+void foo (struct bar *b)
+{
+ b->count = 0;
+ *(b->arr) = 2;
+ if (b->count == 0) /* b->count can't be assumed to be 0 here. */
+ abort ();
+}
+
+main ()
+{
+ struct bar x;
+ x.arr = &x.count;
+ foo (&x);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040324-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040324-1.c
new file mode 100644
index 000000000..be718aba6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040324-1.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+/* Ensure that BIT_FIELD_REFs gets the appropriate VUSE.
+ Contributed by Paolo Bonzini <bonzini@gnu.org>.
+
+ This testcase actually never triggered in the CVS repo, but it did
+ in my local tree and it seems worth testing. In this test, the if's
+ are folded to BIT_FIELD_REFs but the VUSEs were erroneously left out.
+ Therefore, DOM did not see that i was modified between the two ifs
+ and optimized away the second if. */
+
+extern void abort (void);
+extern void exit (int);
+
+struct x
+{
+ unsigned b:1;
+ unsigned c:1;
+};
+
+struct x i = { 1, 1 };
+
+int
+main ()
+{
+ i.b = 1;
+ if (i.b == 1 && i.c == 0)
+ exit (0);
+ i.c = 0;
+ if (i.b == 1 && i.c == 0)
+ exit (0);
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040326-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040326-1.c
new file mode 100644
index 000000000..4be6049e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040326-1.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O2 -fno-inline-functions" } */
+/* { dg-do run } */
+/* When there are no call-clobbered variables, we should still create
+ a .GLOBAL_VAR to model the side effects of functions. Without it,
+ we were moving the call to Faref() inside the second call to
+ Faset(). */
+extern void abort (void);
+extern void exit (int);
+
+main ()
+{
+ int table, c, elt;
+ int tem = Faref (table, elt);
+ Faset (table, elt, c);
+ Faset (table, c, tem);/* tem cannot be replaced with Faref (table, elt) */
+ exit (0);
+}
+
+int j = 0;
+
+int __attribute__ ((noinline)) Faref (table, elt)
+{
+ j = 1;
+ return 0;
+}
+
+int __attribute__ ((noinline)) Faset (table, elt, c)
+{
+ if (j != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040326-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040326-2.c
new file mode 100644
index 000000000..b1bed75da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040326-2.c
@@ -0,0 +1,64 @@
+/* { dg-options "-O2 -fno-inline-functions" } */
+/* { dg-do run } */
+
+/* Gimplification problem exposed by zsh. All the side-effects in
+ function arguments and in the called expression should happen
+ before the actual function call. */
+extern void abort (void);
+int A;
+
+typedef void (*fnptr) (void);
+fnptr *F;
+
+void
+foo (int x)
+{
+ if (A == x)
+ abort ();
+}
+
+void
+bar (int x, int y)
+{
+ if (x == 5 || y != 3)
+ abort ();
+}
+
+void
+boz (void)
+{
+ abort ();
+}
+
+void
+baz (void)
+{
+ if (*F != boz)
+ abort ();
+}
+
+fnptr B[2] = { baz, boz };
+
+main ()
+{
+ int b, c;
+
+ /* The gimplifier was emitting A++ after the call to foo. */
+ A = 5;
+ foo (A++);
+
+ /* The increment to 'b' and 'c' must happen before the call. However,
+ the first argument to bar() must be the original value of 'b', while
+ the second argument must be the new value of 'c'. */
+ b = 4;
+ c = 2;
+ bar (b++, ++c);
+
+ /* This call via function pointer *F should go to baz, but F should
+ be incremented before the actual call (i.e., right before the
+ call F should be pointing to boz). */
+ F = &B[0];
+ (*F++) ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040408-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040408-1.c
new file mode 100644
index 000000000..6578be543
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040408-1.c
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* Make sure that when a variable with an NMT is marked for renaming
+ that the NMT's aliases are also marked for renaming. */
+
+static int eiisnan (short unsigned int *x)
+{
+ int i;
+
+ if( x[i] != 0 )
+ return(1);
+}
+
+static int eiisinf (unsigned short *x)
+{
+ if (eiisnan (x))
+ return (0);
+
+ if ((x[1] & 0x7fff) == 0x7fff)
+ return (1);
+}
+
+static void toe64(short unsigned int *a, short unsigned int *b)
+{
+ register unsigned short *p, *q;
+ unsigned short i;
+
+ q = b + 4;
+
+ if (eiisinf (a));
+
+ for( i=0; i<4; i++ )
+ *q-- = *p++;
+}
+
+static int asctoeg(short unsigned int *y, int oprec)
+{
+ unsigned short yy[13];
+ char *s;
+
+ while( *s == ' ' )
+ ++s;
+
+ toe64( yy, y );
+}
+
+long double _strtold (char *s, char **se)
+{
+ long double x;
+ asctoeg( (unsigned short *)&x, 64 );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040430-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040430-1.c
new file mode 100644
index 000000000..4bc1f85ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040430-1.c
@@ -0,0 +1,26 @@
+/* PR middle-end/14470. Similar to
+ gcc.c-torture/execute/20040313-1.c, but with a compile time test to
+ make sure the second if() is removed. */
+/* Update: We now remove both ifs. Whee. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+
+extern void abort(void);
+
+int main()
+{
+ int t[1025] = { 1024 }, d;
+
+ d = 0;
+ d = t[d]++;
+ if (t[0] != 1025)
+ abort();
+ if (d != 1024)
+ abort();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040513-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040513-1.c
new file mode 100644
index 000000000..bc65b979d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040513-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1" } */
+void bar (void);
+
+void
+foo (unsigned int a)
+{
+ if ((a >> 5) & 1)
+ bar ();
+}
+
+
+
+/* There should be no casts to a _Bool since we can use the temporary
+ holding (a>>5)&1 directly. */
+/* { dg-final { scan-tree-dump-times "\\(_Bool\\)" 0 "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040513-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040513-2.c
new file mode 100644
index 000000000..a3edf9b80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040513-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom2" } */
+int link_error(void);
+int s(void);
+
+int t(int i)
+{
+ _Bool g = i == 4;
+ int h = g;
+ _Bool j = h;
+ int k = j;
+ _Bool l = k == 0;
+ _Bool o = !l;
+ int m = o;
+
+ if (m)
+ if (i != 4)
+ return link_error();
+ return 0;
+}
+
+/* There should be no link_error calls, if there is any, the
+ optimization has failed */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c
new file mode 100644
index 000000000..4c2835075
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+
+int t( int i)
+{
+ int j;
+ if(i ==0)
+ {
+ j = 1;
+ goto end;
+ }
+ j = 0;
+end:
+ return j;
+}
+
+/* Should have no ifs left after straightening. */
+/* { dg-final { scan-tree-dump-times "if " 0 "phiopt1"} } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
new file mode 100644
index 000000000..d518cacd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-phiopt1" } */
+int
+foo2 (distance, i, j)
+ int distance;
+ int i, j;
+{
+ int t = distance;
+ if (t <= 0)
+ t = ((t) >= 0 ? (t) : -(t));
+ return t;
+}
+
+/* There should be one ABS_EXPR and no conditionals. */
+/* { dg-final { scan-tree-dump-times "ABS_EXPR " 1 "phiopt1"} } */
+/* { dg-final { scan-tree-dump-times "if " 0 "phiopt1"} } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c
new file mode 100644
index 000000000..99b27ce02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-alias-vops" } */
+extern void abort (void);
+int a;
+
+extern void __attribute__ ((malloc)) *foo ();
+
+void bar (void)
+{
+ a = 1;
+ foo ();
+ if (a)
+ abort ();
+}
+
+/* We used to treat malloc functions like pure and const functions, but
+ malloc functions may clobber global memory. Only the function result
+ does not alias any other pointer.
+ Hence, we must have a VDEF for a before and after the call to foo(). */
+/* { dg-final { scan-tree-dump-times "VDEF" 2 "alias"} } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040518-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040518-1.c
new file mode 100644
index 000000000..315a5ebf8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040518-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+int f(int a, int b)
+{
+ int c = b;
+ if (a != b)
+ c = a;
+ return c;
+}
+
+/* Should have no ifs left after straightening. */
+/* { dg-final { scan-tree-dump-times "if " 0 "phiopt1"} } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040518-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040518-2.c
new file mode 100644
index 000000000..62f66232d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040518-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+
+int t( int i)
+{
+ int j;
+ if(i>=0)
+ j = i;
+ else
+ j = -i;
+ return j;
+}
+
+/* We should convert one COND_EXPRs into straightline code with ABS. */
+/* { dg-final { scan-tree-dump-times "straightline" 1 "phiopt1"} } */
+/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "phiopt1"} } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040615-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040615-1.c
new file mode 100644
index 000000000..5bb7a4d7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040615-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom1" } */
+
+void bar1 (void);
+void bar2 (void);
+
+void
+foo (unsigned int a, unsigned int b)
+{
+ if (a >= b)
+ bar1 ();
+ else if (b <= a)
+ bar2 ();
+}
+
+/* { dg-final { scan-tree-dump-times "bar2" 0 "dom1" } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040624-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040624-1.c
new file mode 100644
index 000000000..eb8e21095
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040624-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dom1" } */
+
+void bar1 (void);
+void bar2 (void);
+
+void
+foo (unsigned int a, unsigned int b)
+{
+ if (a >= b)
+ bar1 ();
+ else if (a <= b)
+ bar2 ();
+}
+
+/* The second conditional is redundant since we know it must be
+ true (to reach the second condition we know a < b via the first
+ conditional. */
+
+/* { dg-final { scan-tree-dump-times "if " 1 "dom1" } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c
new file mode 100644
index 000000000..ad96198a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
+
+float foo(float x)
+{
+ x += 1;
+ x -= 1;
+ return x;
+}
+
+/* We should *not* fold the arithmetic. */
+/* { dg-final { scan-tree-dump-times "0\\.0" 0 "dom2"} } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040713-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040713-1.c
new file mode 100644
index 000000000..78919d040
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040713-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+/* Extracted from PR 16443. Contributed by Volker Reichelt.
+ Scanning of __asm__ operands wasn't considering call-clobbered
+ variables discovered before the aliasing pass. This was causing a
+ crash in verify_ssa() because 'p' was not being given an SSA_NAME. */
+
+void foo(char *p)
+{
+ __asm__ ("" ::: "memory");
+}
+
+void bar()
+{
+ static char *p;
+ foo(p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c
new file mode 100644
index 000000000..1a6e36df8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c
@@ -0,0 +1,29 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+/* Test to check whether global variables are being
+ constant propagated. */
+
+extern void link_error (void);
+
+int G;
+
+void
+foo (int i)
+{
+ if (i > 0)
+ G = 3;
+ else
+ G = 3;
+
+ if (G != 3)
+ link_error ();
+}
+
+int
+main ()
+{
+ foo (0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c
new file mode 100644
index 000000000..ef94096fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dce2" } */
+
+foo ()
+{
+ volatile int *p;
+ volatile int x;
+
+ p = &x;
+ *p = 3;
+ return *p + 1;
+}
+
+/* The assignment to 'p' is dead and should be removed. But the
+ compiler was mistakenly thinking that the statement had volatile
+ operands. But 'p' itself is not volatile and taking the address of
+ a volatile does not constitute a volatile operand. */
+/* { dg-final { scan-tree-dump-times "&x" 0 "dce2"} } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c
new file mode 100644
index 000000000..f17e98aed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c
@@ -0,0 +1,22 @@
+/* Verify that points-to information is handled properly for PTR + OFFSET
+ pointer arithmetics. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-alias-vops" } */
+
+char buf[4], *q;
+int foo (int i)
+{
+ char c, *p;
+ q = &c;
+ p = buf;
+ if (i)
+ p = p + 3;
+ else
+ p = p + 2;
+ *p = 6;
+ c = 8;
+ return *p;
+}
+
+/* { dg-final { scan-tree-dump-not "VUSE <c" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041002-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041002-1.c
new file mode 100644
index 000000000..9a07877fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041002-1.c
@@ -0,0 +1,24 @@
+/* PR tree-optimization/16632
+ fold() failed to see the following "if" statements never trigger. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ssa" } */
+
+int
+foo (int i)
+{
+ if ((i | 3) == 1)
+ return 1;
+ return 0;
+}
+
+int
+bar (int i)
+{
+ if ((i & 4) == 2)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "if" 0 "ssa" } } */
+/* { dg-final { cleanup-tree-dump "ssa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c
new file mode 100644
index 000000000..ca24427b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+struct A {
+ int x;
+ int y;
+};
+
+baz (struct A *a)
+{
+ a->x = 3;
+ a->y = 2;
+}
+
+foo (int i)
+{
+ struct A a;
+
+ /* Make sure we can't scalarize 'a'. */
+ baz (&a);
+
+ if (i > 10)
+ a.x = i;
+ else
+ a.x = i;
+
+ /* Copy propagation should prove that this predicate is always false. */
+ if (a.x != i)
+ link_error ();
+
+ return a.x;
+}
+
+main ()
+{
+ foo (30);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c
new file mode 100644
index 000000000..5e6828b6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fstrict-aliasing -fdump-tree-fre1" } */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+struct edge_def
+{
+ struct basic_block_def *dest;
+ int flags;
+};
+typedef struct edge_def *edge;
+struct basic_block_def
+{
+ int flags;
+};
+typedef struct basic_block_def *basic_block;
+extern int n_basic_blocks;
+extern edge frob ();
+basic_block *
+find_unreachable_blocks (void)
+{
+ basic_block *tos, *worklist;
+ tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
+ edge e = frob();
+ if (!(e->dest->flags & 4))
+ {
+ e->dest->flags |= 4;
+ *tos++ = e->dest;
+ }
+ return worklist;
+}
+
+/* If the aliasing code does its job properly, then we should be
+ able to determine that modifying e->dest->flags does not
+ modify e or e->dest if we can assert strict-aliasing rules.
+ The net result is that we only need one load of e->dest. */
+/* { dg-final { scan-tree-dump-times "->dest" 1 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050128-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050128-1.c
new file mode 100644
index 000000000..7197ec8b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050128-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+int
+foo (int align)
+{
+ int off = 0 % align;
+ return off ? align - off : 0;
+}
+
+/* We should have optimized away the mod operator before we gimpleized
+ the code. */
+/* { dg-final { scan-tree-dump-times "%" 0 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050215-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050215-1.c
new file mode 100644
index 000000000..b9bb3a749
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050215-1.c
@@ -0,0 +1,14 @@
+/* PR middle-end/19857 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int i;
+int foo (void)
+{
+ return i & ~(unsigned int) 3;
+}
+
+/* Make sure the optimizers don't introduce overflow where one
+ did not exist in the original. */
+/* { dg-final { scan-tree-dump-times "-0+4" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c
new file mode 100644
index 000000000..108297336
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-lim1-details" } */
+
+float a[100];
+
+int foo(void);
+float sinf (float);
+
+void xxx (void)
+{
+ int i, k = foo ();
+
+ for (i = 0; i < 100; i++)
+ a[k] += sinf (i);
+}
+
+/* Store motion may be applied to the assignment to a[k], since sinf
+ cannot read nor write the memory. */
+
+/* { dg-final { scan-tree-dump-times "Moving statement" 1 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050412-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050412-1.c
new file mode 100644
index 000000000..9c172d769
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050412-1.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/14627 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+
+int b;
+void foo (int a) {
+ if (a)
+ a = 3;
+ b = a;
+}
+
+/* Make sure we do not have an assignment a = 0 in the resulting
+ optimized dump. */
+/* { dg-final { scan-tree-dump-times "a.* = 0;" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050719-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050719-1.c
new file mode 100644
index 000000000..8dc4c7e5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20050719-1.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void) __attribute__ ((__nothrow__)) __attribute__
+((__noreturn__));
+extern void exit (int __status) __attribute__ ((__nothrow__))
+__attribute__ ((__noreturn__));
+
+struct bootLoader {
+ int x;
+};
+
+void
+zap(struct bootLoader *bootLoader)
+{
+ /* The expression on the RHS of the assignment is *not* a
+ dereference of pointer 'bootLoader'. It is merely used as an
+ offset calculation. VRP was erroneously removing the if()
+ because it thought that 'bootLoader' was always dereferenced. */
+ int *boot = &bootLoader->x;
+
+ if (bootLoader)
+ {
+ useboot (boot);
+ }
+}
+
+int
+useboot (void *boot)
+{
+ abort ();
+}
+
+main()
+{
+ zap (0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20070302-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20070302-1.c
new file mode 100644
index 000000000..4b148f23d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20070302-1.c
@@ -0,0 +1,45 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+struct A
+{
+ int x;
+ float y;
+};
+
+volatile float X, Y;
+
+int __attribute__ ((__noinline__))
+baz (struct A *z, struct A *y)
+{
+ z->x = (int) X;
+ z->y = Y;
+ y->x = (int) X;
+ y->y = Y;
+}
+
+
+struct A B;
+
+float foo (int i)
+{
+ struct A *p, x, y, z;
+
+ p = (i > 10) ? &x : &z;
+ x.y = 3.0;
+ p->x += baz (&z, &y);
+ X = z.y;
+ Y = p->y;
+
+ /* This predicate should always evaluate to false. The call to
+ baz() is not a clobbering site for x.y. The operand scanner was
+ considering it a clobbering site for x.y because x.y is in the
+ alias set of a call-clobbered memory tag. */
+ if (x.y != 3.0)
+ link_error ();
+}
+
+main(int argc, char **argv)
+{
+ foo (argc);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20070815.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20070815.c
new file mode 100644
index 000000000..fa0e69f7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20070815.c
@@ -0,0 +1,60 @@
+/* { dg-do compile } */
+/* { dg-options "-O -w" } */
+
+/* This code snippet from glibc 2.3.5 was causing an ICE during
+ optimization because we were failing to update the SSA form for
+ stale name tags. These are tags that are associated with SSA pointers
+ that have been removed from the IL. This was causing the SSA
+ verifier to fail before we had a chance to run the cleanup pass that
+ finally removes all the remaining PHI nodes for the stale name tag. */
+struct _IO_wide_data
+{
+};
+struct _IO_FILE {
+};
+typedef struct _IO_FILE _IO_FILE;
+struct _IO_jump_t
+{
+};
+struct _IO_FILE_plus
+{
+ _IO_FILE file;
+};
+extern const struct _IO_jump_t _IO_file_jumps_maybe_mmap ;
+extern const struct _IO_jump_t _IO_wfile_jumps;
+extern const struct _IO_jump_t _IO_wfile_jumps_maybe_mmap ;
+
+_IO_new_fdopen (fd, mode)
+ const char *mode;
+{
+ int read_write;
+ int posix_mode = 0;
+ struct locked_FILE
+ {
+ struct _IO_FILE_plus fp;
+ struct _IO_wide_data wd;
+ } *new_f;
+ int fd_flags;
+ int use_mmap = 0;
+ {
+ }
+ {
+ switch (*++mode)
+ {
+ case '\0':
+ use_mmap = 1;
+ }
+ }
+ if (((fd_flags & 0003) == 00 && !(read_write & 8))
+ || ((fd_flags & 0003) == 01 && !(read_write & 4)))
+ {
+ }
+ if ((posix_mode & 02000) && !(fd_flags & 02000))
+ return ((void *)0);
+ _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd,
+ (use_mmap && (read_write & 8))
+ ? &_IO_wfile_jumps_maybe_mmap :
+ &_IO_wfile_jumps);
+ (use_mmap && (read_write & 8)) ? &_IO_file_jumps_maybe_mmap :
+ _IO_file_init (&new_f->fp);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20080530.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20080530.c
new file mode 100644
index 000000000..bf222fee1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20080530.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-einline" } */
+
+void bar (char *);
+int i;
+
+static void
+foo (void)
+{
+ char *p = __builtin_alloca (i);
+ bar (p);
+}
+
+int
+baz (void)
+{
+ foo (); /* foo() should not be inlined here because it calls alloca */
+ return 6;
+}
+
+/* { dg-final { scan-tree-dump-times "Inlining foo into baz" 0 "einline"} } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-10.c
new file mode 100644
index 000000000..03956100a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-10.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct {
+ int i;
+ int x[2];
+ int j;
+} a;
+
+int foo(int i)
+{
+ a.i = 1;
+ a.j = 2;
+ a.x[i] = 0;
+ return a.i + a.j;
+}
+
+/* { dg-final { scan-tree-dump "return 3;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-11.c
new file mode 100644
index 000000000..1f8a12d85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-11.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct param { int *a; };
+void foo(struct param *p);
+int bar(void)
+{
+ int a[32];
+ struct param p;
+ a[0] = 1;
+ a[1] = 1;
+ p.a = &a[0];
+ foo(&p);
+ return a[0] + *p.a;
+}
+
+/* We need to have both: a load from "a[0]" and a load from "*p.a",
+ the latter is an ssa temporary. */
+/* { dg-final { scan-tree-dump "= a.0.;" "optimized" } } */
+/* { dg-final { scan-tree-dump "= \\*\[^\r\n\]*_.;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-12.c
new file mode 100644
index 000000000..b1fb7997f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-12.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-alias-vops" } */
+
+struct {
+ int i;
+ int x[128];
+ int j;
+} a;
+
+int foo(int i)
+{
+ a.x[i] = 0;
+ return a.x[i];
+}
+
+/* { dg-final { scan-tree-dump "VDEF" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-13.c
new file mode 100644
index 000000000..ae7cc8214
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-13.c
@@ -0,0 +1,33 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+
+struct a
+{
+ char a1;
+};
+
+int *aa;
+
+void g(int *a)
+{
+ aa = a;
+ *a = 2;
+}
+
+int t(int i, struct a *b)
+{
+ g(&i);
+ b->a1 = 1;
+ i = 2;
+ if (b->a1 != 1)
+ link_failure ();
+}
+int main(void)
+{
+ struct a b;
+ t(1, &b);
+ return 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-14.c
new file mode 100644
index 000000000..a1216b7d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-14.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+struct s
+{
+ long long a:12;
+ long long b:12;
+ long long c:40;
+};
+
+struct s s, *p = &s;
+
+int
+main ()
+{
+ p->a = 1;
+ s.a = 0;
+ s.b = 0;
+ return p->a + s.b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-16.c
new file mode 100644
index 000000000..c71486c26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-16.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+struct X {
+ int a;
+ struct Y {
+ int b[4];
+ } b;
+ struct Y c;
+} m;
+
+struct X n;
+
+foo (int i)
+{
+ struct Y *p = (i > 10) ? &m.b : &n.c;
+ p->b[2] = 10;
+ m.b.b[3] = 6;
+ n.c.b[2] = 3;
+ return p->b[2] + n.c.b[2] + m.b.b[3];
+}
+
+main()
+{
+ if (foo (3) != 12)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-17.c
new file mode 100644
index 000000000..48e72ffee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-17.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-early-inlining -fdump-tree-ccp2" } */
+
+int *p;
+int inline bar(void) { return 0; }
+int foo(int x)
+{
+ int i;
+ int *q;
+ if (bar())
+ q = &i;
+ else
+ q = p;
+ return *q + *p;
+}
+
+/* { dg-final { scan-tree-dump-not "NOTE: no flow-sensitive alias info for" "ccp2" } } */
+/* { dg-final { cleanup-tree-dump "ccp2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-18.c
new file mode 100644
index 000000000..69c2e23c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-18.c
@@ -0,0 +1,90 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-details -fdump-tree-optimized" } */
+
+struct A {
+ int i;
+ int j;
+ float x;
+};
+struct B {
+ struct A a;
+ int k;
+};
+
+int g;
+
+int test0 (struct A *p, struct A *q)
+{
+ p->i = 0;
+ q->j = -1;
+ return p->i;
+}
+
+int test1 (struct A *p, struct B *q)
+{
+ p->i = 1;
+ q->k = -1;
+ return p->i;
+}
+
+int test2 (struct A *p, struct B *q)
+{
+ p->i = 2;
+ q->a.i = -1;
+ return p->i;
+}
+
+int test3 (struct A *p, struct B *q)
+{
+ p->i = 3;
+ q->a.j = -1;
+ return p->i;
+}
+
+int test4 (struct A *p)
+{
+ g = 4;
+ p->i = -1;
+ return g;
+}
+
+int test5 (struct A *p)
+{
+ p->i = 5;
+ g = -1;
+ return p->i;
+}
+
+int test6 (struct A *p, int *q)
+{
+ p->i = 6;
+ *q = -1;
+ return p->i;
+}
+
+int test7 (struct A *p, int *q)
+{
+ p->j = 7;
+ *q = -1;
+ return p->j;
+}
+
+int test8 (struct A *p, int *q)
+{
+ *q = 8;
+ p->x = -1;
+ return *q;
+}
+
+/* { dg-final { scan-tree-dump "with 0" "fre1" } } */
+/* { dg-final { scan-tree-dump "with 1" "fre1" } } */
+/* { dg-final { scan-tree-dump "with 3" "fre1" } } */
+/* { dg-final { scan-tree-dump "with 4" "fre1" } } */
+/* { dg-final { scan-tree-dump "with 5" "fre1" } } */
+/* { dg-final { scan-tree-dump "with 8" "fre1" } } */
+/* { dg-final { scan-tree-dump-not "return 2;" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "return 6;" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "return 7;" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "return -1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c
new file mode 100644
index 000000000..ce36d2c22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-alias" } */
+
+const static int a;
+
+int __attribute__((noinline))
+foo(int i)
+{
+ const int *q;
+ int b;
+ if (i)
+ q = &a;
+ else
+ q = &b;
+ b = 1;
+ /* We should not prune a from the points-to set of q. */
+ return *q;
+}
+
+extern void abort (void);
+int main()
+{
+ if (foo(1) != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "q_. = { a b }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c
new file mode 100644
index 000000000..ecd0fdc9f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c
@@ -0,0 +1,28 @@
+/* { dg-do compile { target { nonpic } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+static int a;
+int f;
+void bar (void) __attribute__((noinline));
+void bar (void)
+{
+ f = 9;
+}
+
+void link_error ();
+
+int foo()
+{
+ int b, c;
+ a = 5;
+ b = a;
+ bar ();
+ b = b + a;
+ if (b != 10)
+ link_error ();
+ return b;
+}
+
+/* We should have removed the link_error on the tree level as GCC can tell that
+ a is not touched by the calling bar at all. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-20.c
new file mode 100644
index 000000000..7991c52fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-20.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-aliasing -fdump-tree-optimized" } */
+
+struct S { float f; int i; };
+struct R { int x; int i; };
+
+/* Strict-aliasing rules say that int and float do not alias. */
+int bar(struct S *s, int *i)
+{
+ *i = 0;
+ s->f = 1.0;
+ return *i;
+}
+
+/* Strict-aliasing rules say that S and R do not alias. */
+int foo(struct S *s, struct R *r)
+{
+ r->i = 0;
+ s->i = 1;
+ return r->i;
+}
+
+/* { dg-final { scan-tree-dump-times "return 0;" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-21.c
new file mode 100644
index 000000000..417558812
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-21.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+
+int f(int *r)
+{
+ r[0] = 0;
+ r[1] = 1;
+ return r[0];
+}
+
+
+/* { dg-final { scan-tree-dump-times "return 0;" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-22.c
new file mode 100644
index 000000000..8c808fe43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-22.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+
+int f(int *r)
+{
+ r[1] = 0;
+ r[2] = 1;
+ return r[1];
+}
+
+
+/* { dg-final { scan-tree-dump-times "return 0;" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-23.c
new file mode 100644
index 000000000..9d0dd3206
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-23.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+typedef struct A { int i; double d; } A;
+
+void f1 (const char *c)
+{
+ A *s = (A*) __builtin_malloc (sizeof (A));
+ double *p = &s->d;
+ s->i = 42;
+ __builtin_memcpy (p, c, sizeof (double));
+ int j = s->i;
+ if (j != 42) __builtin_abort();
+}
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-24.c
new file mode 100644
index 000000000..0edd51f85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-24.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void f (const char *c, int *i)
+{
+ *i = 42;
+ __builtin_memcpy (i + 1, c, sizeof (int));
+ if (*i != 42) __builtin_abort();
+}
+
+extern void keepit ();
+void g (const char *c, int *i)
+{
+ *i = 33;
+ __builtin_memcpy (i - 1, c, 3 * sizeof (int));
+ if (*i != 33) keepit();
+}
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
+/* { dg-final { scan-tree-dump "keepit" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-25.c
new file mode 100644
index 000000000..f5705d03c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-25.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+void f (long *p) {
+ *p = 42;
+ p[4] = 42;
+ __builtin_free (p);
+}
+
+/* { dg-final { scan-tree-dump-not "= 42" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-26.c
new file mode 100644
index 000000000..a1eb8f7d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-26.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void f (const char *c, int *i)
+{
+ *i = 42;
+ __builtin_memcpy (i - 1, c, sizeof (int));
+ if (*i != 42) __builtin_abort();
+}
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-27.c
new file mode 100644
index 000000000..91c737eae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-27.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+void f (long *p) {
+ *p = 42;
+ p[4] = 42;
+ __builtin_memset (p, 0, 100);
+}
+
+/* { dg-final { scan-tree-dump-not "= 42" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-28.c
new file mode 100644
index 000000000..8413230ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-28.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+extern void abort (void);
+extern void *malloc(__SIZE_TYPE__);
+
+int * __attribute__((noinline,noclone))
+foo (int *p)
+{
+ int *q = (int *) malloc (sizeof (int));
+ *p = 1;
+ *q = 2;
+ if (*p != 1)
+ __link_error ();
+ *p = 3;
+ return q;
+}
+
+int main()
+{
+ int i;
+ int *p = foo (&i);
+ if (i != 3 || *p != 2)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-29.c
new file mode 100644
index 000000000..4d57ca8f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-29.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+union X {
+ int i;
+ void *p;
+};
+void bar (int);
+
+int * __attribute__((noinline,noclone))
+baz (int *p) { return p; }
+
+void foo (union X *x)
+{
+ struct Y { int i; } ystruct = {};
+ ystruct.i = * baz (&ystruct.i);
+ bar (x->i);
+}
+
+/* DSE and then DCE should be able to remove all uses of ystruct.
+ Formerly the union access for the parameter to bar let 'anything'
+ escape which made the call to bar possibly use ystruct and thus
+ prevent the store to ystruct.i from being eliminated. The call to
+ baz makes sure that ystruct has its address taken. */
+
+/* { dg-final { scan-tree-dump-not "ystruct" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-3.c
new file mode 100644
index 000000000..3d8587da8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-3.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct {
+ int i;
+ int j;
+ int x[2];
+} a;
+
+int foo(void)
+{
+ a.i = 1;
+ a.j = 0;
+ a.x[0] = 0;
+ return a.i + a.j;
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-30.c
new file mode 100644
index 000000000..addf12840
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-30.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre-details" } */
+
+extern int posix_memalign(void **memptr,
+ __SIZE_TYPE__ alignment, __SIZE_TYPE__ size);
+
+int foo (float *p)
+{
+ int res = *p;
+ int *q;
+ void *tem;
+ if (posix_memalign (&tem, 128, 128 * sizeof (int)) != 0)
+ return 0;
+ q = (int *)tem;
+ *q = 1;
+ return res + *p;
+}
+
+/* We should be able to CSE the load from *p in the return stmt. */
+
+/* { dg-final { scan-tree-dump "Replaced \\\*p" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-31.c
new file mode 100644
index 000000000..622df80a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-31.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra -fdump-tree-cddce1" } */
+
+extern int posix_memalign(void **memptr,
+ __SIZE_TYPE__ alignment, __SIZE_TYPE__ size);
+
+int foo (float *p)
+{
+ int res = *p;
+ struct { void *q1; void *q2; } q;
+ if (posix_memalign (&q.q1, 128, 128 * sizeof (int)) != 0)
+ return 0;
+ if (posix_memalign (&q.q2, 128, 128 * sizeof (int)) != 0)
+ return 0;
+ *((int *)q.q1) = 1;
+ *((int *)q.q2) = 2;
+ return res + *p + *((int *)q.q1) + *((int *)q.q2);
+}
+
+/* There should be only one load from *p left. All stores and all
+ other loads should be removed. */
+
+/* { dg-final { scan-tree-dump-times "\\\*\[^ \]" 1 "cddce1" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-4.c
new file mode 100644
index 000000000..e0394327d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-4.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct {
+ int i;
+ struct {
+ int x[2];
+ } b;
+} a;
+
+int foo(void)
+{
+ a.i = 1;
+ a.b.x[0] = 0;
+ a.b.x[1] = 1;
+ return a.i + a.b.x[0];
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-5.c
new file mode 100644
index 000000000..f1faae52c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-5.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct {
+ int i;
+ struct {
+ struct {
+ int i;
+ } x[2];
+ } b;
+} a;
+
+int foo(void)
+{
+ a.i = 1;
+ a.b.x[0].i = 0;
+ a.b.x[1].i = 1;
+ return a.i + a.b.x[0].i;
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-6.c
new file mode 100644
index 000000000..9a41920e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct param { int *a; };
+void foo(struct param *p);
+int bar(void)
+{
+ int a[2];
+ struct param p;
+ a[0] = 1;
+ a[1] = 1;
+ p.a = &a[0];
+ foo(&p);
+ return a[0] + *p.a;
+}
+
+/* We need to have both: a load from "a[0]" and a load from "*p.a",
+ the latter is an ssa temporary. */
+/* { dg-final { scan-tree-dump "= a.0.;" "optimized" } } */
+/* { dg-final { scan-tree-dump "= \\*\[^\r\n\]*_.;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-7.c
new file mode 100644
index 000000000..7ef604be2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-7.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort(void);
+int main()
+{
+ int a[2];
+ int *p = a;
+ int i;
+ a[0] = 1;
+ a[1] = 2;
+ for (i=0; i<2; ++i)
+ if (p[i] != i+1)
+ abort();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-8.c
new file mode 100644
index 000000000..7c825f965
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-8.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort(void);
+int main()
+{
+ int a[2];
+ int i = 1;
+ a[0] = 1;
+ a[1] = 2;
+ if (*(a + i) != 2)
+ abort();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-9.c
new file mode 100644
index 000000000..0a20e0543
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias-9.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort(void);
+int main()
+{
+ int a[32];
+ int i = 1;
+ a[0] = 1;
+ a[1] = 2;
+ if (*(a + i) != 2)
+ abort();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c
new file mode 100644
index 000000000..64fef2787
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/alias_bug.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */
+
+typedef unsigned u32;
+typedef unsigned short u16;
+typedef unsigned char u8;
+struct biosregs {
+ union {
+ struct {
+ u32 edi;
+ u32 esi;
+ u32 ebp;
+ u32 _esp;
+ u32 ebx;
+ u32 edx;
+ u32 ecx;
+ u32 eax;
+ u32 _fsgs;
+ u32 _dses;
+ u32 eflags;
+ };
+ struct {
+ u16 di, hdi;
+ u16 si, hsi;
+ u16 bp, hbp;
+ u16 _sp, _hsp;
+ u16 bx, hbx;
+ u16 dx, hdx;
+ u16 cx, hcx;
+ u16 ax, hax;
+ u16 gs, fs;
+ u16 es, ds;
+ u16 flags, hflags;
+ };
+ struct {
+ u8 dil, dih, edi2, edi3;
+ u8 sil, sih, esi2, esi3;
+ u8 bpl, bph, ebp2, ebp3;
+ u8 _spl, _sph, _esp2, _esp3;
+ u8 bl, bh, ebx2, ebx3;
+ u8 dl, dh, edx2, edx3;
+ u8 cl, ch, ecx2, ecx3;
+ u8 al, ah, eax2, eax3;
+ };
+ };
+};
+void initregs(struct biosregs *regs);
+void intcall(u8 int_no, const struct biosregs *ireg, struct biosregs *oreg);
+static u32 *const gp = (u32*) 0x32;
+void keyboard_set_repeat(void)
+{
+ struct biosregs ireg;
+ *gp = 10;
+ initregs(&ireg);
+ ireg.ax = 0x0305;
+ intcall(0x16, &ireg, ((void *)0));
+}
+
+/* { dg-final { scan-tree-dump-times "ireg.*ax" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-1.c
new file mode 100644
index 000000000..1a5385740
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-1.c
@@ -0,0 +1,65 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+unsigned int test1(unsigned int a)
+{
+ return (a & 1) | 1;
+}
+
+int test2(int b)
+{
+ return (b & 1) | 1;
+}
+
+unsigned int test3(unsigned int c)
+{
+ return (c | 1) & 1;
+}
+
+int test4(int d)
+{
+ return (d | 1) & 1;
+}
+
+unsigned int test5(unsigned int e)
+{
+ return (e | 4) & 6;
+}
+
+int test6(int f)
+{
+ return (f | 4) & 6;
+}
+
+unsigned int test7(unsigned int g)
+{
+ return (g & -2) | 1;
+}
+
+int test8(int h)
+{
+ return (h & -2) | 1;
+}
+
+unsigned int test9(unsigned int i)
+{
+ return (i & 3) | 1;
+}
+
+int test10(int j)
+{
+ return (j & 3) | 1;
+}
+
+/* { dg-final { scan-tree-dump-times "a \& 1 \\| 1" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "b \& 1 \\| 1" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(c \\| 1\\) \& 1" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "\\(d \\| 1\\) \& 1" 0 "original" } } */
+/* { dg-final { scan-tree-dump-times "e \& 2 \\| 4" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "f \& 2 \\| 4" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "g \\| 1" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "h \\| 1" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "i \& 2 \\| 1" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "j \& 2 \\| 1" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-2.c
new file mode 100644
index 000000000..cdc00b7a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-2.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+int test1(int a, int b)
+{
+ return (a & b) | b;
+}
+
+int test2(int c, int d)
+{
+ return (c & d) | c;
+}
+
+int test3(int e, int f)
+{
+ return e | (e & f);
+}
+
+int test4(int g, int h)
+{
+ return g | (h & g);
+}
+
+int test5(int i, int j)
+{
+ return (i | j) & j;
+}
+
+int test6(int k, int l)
+{
+ return (k | l) & k;
+}
+
+int test7(int m, int n)
+{
+ return m & (m | n);
+}
+
+int test8(int o, int p)
+{
+ return o & (p | o);
+}
+
+/* { dg-final { scan-tree-dump-times "return b;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return c;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return e;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return g;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return j;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return k;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return m;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return o;" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-3.c
new file mode 100644
index 000000000..a1401c079
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-3.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int f(int y, int x)
+{
+ return x & ((~x) | y);
+}
+int f1(int y, int x)
+{
+ return x & (y | (~x));
+}
+int f2(int y, int x)
+{
+ return ((~x) | y) & x;
+}
+int f3(int y, int x)
+{
+ return (y | (~x)) & x;
+}
+
+
+/* { dg-final { scan-tree-dump-times "~x" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_..D. \& y_..D." 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-4.c
new file mode 100644
index 000000000..1dbdca7df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-4.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int f(int y, int x)
+{
+ return x | ((~x) & y);
+}
+int f1(int y, int x)
+{
+ return x | (y & (~x));
+}
+int f2(int y, int x)
+{
+ return ((~x) & y) | x;
+}
+int f3(int y, int x)
+{
+ return (y & (~x)) | x;
+}
+
+
+/* { dg-final { scan-tree-dump-times "~x" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_..D. \\\| y_..D." 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-5.c
new file mode 100644
index 000000000..15097272a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/andor-5.c
@@ -0,0 +1,50 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int f(int y, int x)
+{
+ int a = x | y;
+ return a & x;
+}
+int f1(int y, int x)
+{
+ int a = y | x;
+ return a & x;
+}
+int f2(int y, int x)
+{
+ int a = x | y;
+ return x & a;
+}
+int f3(int y, int x)
+{
+ int a = x | y;
+ return x & a;
+}
+int f4(int y, int x)
+{
+ int a = x & y;
+ return a | x;
+}
+int f5(int y, int x)
+{
+ int a = y & x;
+ return a | x;
+}
+int f6(int y, int x)
+{
+ int a = x & y;
+ return x | a;
+}
+int f7(int y, int x)
+{
+ int a = x & y;
+ return x | a;
+}
+/* These all should be optimized to just return x; */
+
+
+/* { dg-final { scan-tree-dump-times "\\\|" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\&" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "return x_..D.;" 8 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-1.c
new file mode 100644
index 000000000..fe2757013
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-1.c
@@ -0,0 +1,17 @@
+/* Make sure that gcc understands that an in/out operand is a use as well
+ as a def. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized-nouid" } */
+
+void f()
+{
+ int i = 42;
+ int j = 63;
+
+ asm ("": "=m"(i), "+r"(j) : "m"(i));
+}
+
+/* { dg-final { scan-tree-dump-times "42" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "63" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-2.c
new file mode 100644
index 000000000..96d8ba624
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#ifdef __hppa__
+#define REGISTER "1"
+#else
+#ifdef __moxie__
+#define REGISTER "2"
+#else
+#define REGISTER "0"
+#endif
+#endif
+
+void baz(void)
+{
+ register int xyzzy asm(REGISTER) = 1;
+ asm volatile ("" : : "r"(xyzzy));
+}
+
+/* { dg-final { scan-tree-dump-times "asm\[^\\r\\n\]*xyzzy" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c
new file mode 100644
index 000000000..29b27f4ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asm-3.c
@@ -0,0 +1,36 @@
+/* PR 17739 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#ifdef __hppa__
+#define REGISTER "1"
+#else
+#ifdef __moxie__
+#define REGISTER "8"
+#else
+#define REGISTER "0"
+#endif
+#endif
+
+static inline int source(void)
+{
+ register int hardreg __asm__(REGISTER);
+ asm("" : "=r"(hardreg));
+ return hardreg;
+}
+
+void test(void)
+{
+ int t = source();
+ foo(t);
+ bar(t);
+}
+
+/* Hardreg should appear exactly 3 times -- declaration, asm stmt,
+ and copy out. */
+/* { dg-final { scan-tree-dump-times "hardreg" 3 "optimized" } } */
+
+/* In particular, hardreg should *not* appear in the call to bar. */
+/* { dg-final { scan-tree-dump-times "bar \[(\]\[^\n\r\]*_.\[)\]" 1 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asmgoto-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asmgoto-1.c
new file mode 100644
index 000000000..9dd549906
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/asmgoto-1.c
@@ -0,0 +1,95 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -w -fdump-tree-optimized" } */
+
+extern void XYZZY (void);
+typedef unsigned long __kernel_size_t;
+typedef __kernel_size_t size_t;
+typedef unsigned gfp_t;
+struct per_cpu_pageset { } __attribute__ ((__aligned__ ((1 << (6)))));
+struct zone { struct per_cpu_pageset *pageset[64]; }
+zone_flags_t; typedef struct pglist_data { struct zone node_zones[4]; } pg_data_t;
+extern struct pglist_data *first_online_pgdat (void);
+extern struct zone *next_zone (struct zone *zone);
+extern volatile int per_cpu__x86_cpu_to_node_map[];
+struct kmem_cache { int size; };
+extern struct kmem_cache kmalloc_caches[(12 + 2)];
+struct tracepoint { void **funcs; } __attribute__ ((aligned (32)));
+extern struct tracepoint __tracepoint_kmalloc_node;
+void *__kmalloc_node (size_t size, gfp_t flags, int node);
+
+static inline int
+cpu_to_node (int cpu)
+{
+ return per_cpu__x86_cpu_to_node_map[cpu];
+}
+
+static inline void
+trace_kmalloc_node (unsigned long call_site, const void *ptr,
+ size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags,
+ int node)
+{
+ asm goto ("" : : : : trace_label);
+ if (0)
+ {
+ void **it_func;
+ trace_label:
+ asm ("" : "=r"(it_func) : "0"(&__tracepoint_kmalloc_node.funcs));
+ }
+};
+
+static inline __attribute__ ((always_inline)) int
+kmalloc_index (size_t size)
+{
+ if (size <= 64)
+ return 6;
+ return -1;
+}
+
+static inline __attribute__ ((always_inline)) struct kmem_cache *
+kmalloc_slab (size_t size)
+{
+ int index = kmalloc_index (size);
+ if (index == 0)
+ return ((void *) 0);
+ return &kmalloc_caches[index];
+}
+
+static inline __attribute__ ((always_inline)) void *
+kmalloc_node (size_t size, gfp_t flags, int node)
+{
+ void *ret;
+ if (__builtin_constant_p (size) && size <= (2 * ((1UL) << 12))
+ && !(flags & ((gfp_t) 0x01u)))
+ {
+ struct kmem_cache *s = kmalloc_slab (size);
+ if (!s)
+ return ((void *) 16);
+ trace_kmalloc_node (({ __here:(unsigned long) &&__here;}),
+ ret, size, s->size, flags, node);
+ }
+ return __kmalloc_node (size, flags, node);
+}
+
+int
+process_zones (int cpu)
+{
+ struct zone *zone, *dzone;
+ int node = cpu_to_node (cpu);
+ for (zone = (first_online_pgdat ())->node_zones;
+ zone; zone = next_zone (zone))
+ {
+ ((zone)->pageset[(cpu)]) =
+ kmalloc_node (sizeof (struct per_cpu_pageset),
+ (((gfp_t) 0x10u) | ((gfp_t) 0x40u) | ((gfp_t) 0x80u)),
+ node);
+ if (!((zone)->pageset[(cpu)]))
+ goto bad;
+ }
+ return 0;
+bad:
+ XYZZY ();
+ return -12;
+}
+
+/* { dg-final { scan-tree-dump-times "XYZZY" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-1.c
new file mode 100644
index 000000000..f95f03ff4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+volatile int count;
+void bar(int);
+void foo()
+{
+ bar(count++);
+}
+
+/* { dg-final { scan-tree-dump-times "count =" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-2.c
new file mode 100644
index 000000000..47c38225b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+volatile int count;
+int arr[4];
+void foo()
+{
+ arr[count++] = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "count =" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-3.c
new file mode 100644
index 000000000..e5426d781
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/assign-3.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+extern void abort (void);
+struct S { int i; };
+struct S arr[32];
+volatile int count = 0;
+
+struct S __attribute__((noinline))
+incr ()
+{
+ ++count;
+}
+
+int main()
+{
+ arr[count++] = incr ();
+ if (count != 2)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times " = count;" 3 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-alias-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-alias-2.c
new file mode 100644
index 000000000..89477d92f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-alias-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+static int a=4;
+static int b __attribute__ ((alias("a")));
+main()
+{
+ return b+a;
+}
+/* { dg-final { scan-tree-dump "return 8" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c
new file mode 100644
index 000000000..fe4084d21
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+void abort (void);
+__attribute__ ((weak))
+int test()
+{
+ return 0;
+}
+static int test2() __attribute__ ((alias("test")));
+static int test1() __attribute__ ((weakref)) __attribute__ ((alias("test2")));
+static int test4() __attribute__ ((weakref)) __attribute__ ((alias("test")));
+main()
+{
+ test();
+ test2();
+ test3();
+ test4();
+}
+
+/* calls to test1 and test2 can be inlined and optmized away. Calls
+ to test and test4 are overwritable. */
+
+/* { dg-final { scan-tree-dump-times " test " 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " test4 " 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-not " test1 " "optimized" } } */
+/* { dg-final { scan-tree-dump-not " test2 " "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
new file mode 100644
index 000000000..d0225ec16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/attr-hotcold-2.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-profile_estimate-blocks-details" } */
+
+void g(void);
+void h(void);
+void f(int x, int y)
+{
+ if (x) goto A;
+ if (y) goto B;
+ return;
+
+ A: __attribute__((cold))
+ g();
+ return;
+
+ B: __attribute__((hot))
+ h();
+ return;
+}
+
+/* { dg-final { scan-ipa-dump-times "block 4, loop depth 0, count 0, freq 1\[^0-9\]" 1 "profile_estimate" } } */
+
+/* Note: we're attempting to match some number > 6000, i.e. > 60%.
+ The exact number ought to be tweekable without having to juggle
+ the testcase around too much. */
+/* { dg-final { scan-ipa-dump-times "block 5, loop depth 0, count 0, freq \[6-9\]\[0-9\]\[0-9\]\[0-9\]" 1 "profile_estimate" } } */
+
+/* { dg-final { cleanup-ipa-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c
new file mode 100644
index 000000000..1de04bc84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (_Bool x)
+{
+ return (x ^ 1);
+}
+
+/* { dg-final { scan-tree-dump-times "~x" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c
new file mode 100644
index 000000000..d6e121ae0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ if (x != 0)
+ return 1;
+ return 0;
+}
+
+/* There should be no != 0 which is produced by the front-end as
+ bool_var != 0 is the same as bool_var. */
+/* { dg-final { scan-tree-dump-times "!= 0" 0 "optimized"} } */
+
+/* There should be no adde for powerpc. Check if we actually optimized
+ away the comparison. */
+/* { dg-final { scan-assembler-times "adde" 0 { target powerpc*-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c
new file mode 100644
index 000000000..58d064539
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ return (x != 1);
+}
+
+/* There should be no != 1 which is produced by the front-end as
+ bool_var != 1 is the same as !bool_var. */
+/* { dg-final { scan-tree-dump-times "!= 1" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "~x" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c
new file mode 100644
index 000000000..ee266c79c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ return (x == 0);
+}
+
+/* There should be no == 0 which is produced by the front-end as
+ bool_var == 0 is the same as !bool_var. */
+/* { dg-final { scan-tree-dump-times "== 0" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "~x" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c
new file mode 100644
index 000000000..0f88b0965
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ int y;
+ if (x)
+ y = 1;
+ else
+ y = 0;
+ return y;
+}
+
+/* There should be no != 0 which is produced by the front-end as
+ bool_var != 0 is the same as bool_var. */
+/* { dg-final { scan-tree-dump-times "!= 0" 0 "optimized"} } */
+
+/* There should be no adde for powerpc. Check if we actually optimized
+ away the comparison. */
+/* { dg-final { scan-assembler-times "adde" 0 { target powerpc*-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-3.c
new file mode 100644
index 000000000..8fa2a57c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ int y;
+ if (!x)
+ y = 0;
+ else
+ y = 1;
+ return y;
+}
+
+/* There should be no == 0. Though PHI-OPT or invert_truth does not
+ fold its tree forwprop is able to clean up the mess. */
+/* { dg-final { scan-tree-dump-times "== 0" 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-4.c
new file mode 100644
index 000000000..b06182e2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ return (x != 0);
+}
+
+/* There should be no != 0 which is produced by the front-end as
+ bool_var != 0 is the same as bool_var. */
+/* { dg-final { scan-tree-dump-times "!= 0" 0 "optimized"} } */
+
+/* There should be no adde for powerpc. Check if we actually optimized
+ away the comparison. */
+/* { dg-final { scan-assembler-times "adde" 0 { target powerpc*-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-5.c
new file mode 100644
index 000000000..e33ce9c73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-5.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ if (x == 1)
+ return 1;
+ return 0;
+}
+
+/* There should be no == 1 which is produced by the front-end as
+ bool_var == 1 is the same as bool_var. */
+/* { dg-final { scan-tree-dump-times "== 1" 0 "optimized"} } */
+
+/* There should be no adde for powerpc. Check if we actually optimized
+ away the comparison. */
+/* { dg-final { scan-assembler-times "adde" 0 { target powerpc*-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-6.c
new file mode 100644
index 000000000..cc77591c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-6.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ int y;
+ if (x)
+ y = 1;
+ else
+ y = 0;
+ return y;
+}
+
+/* There should be no == 1 which is produced by the front-end as
+ bool_var == 1 is the same as bool_var. */
+/* { dg-final { scan-tree-dump-times "== 1" 0 "optimized"} } */
+
+/* There should be no adde for powerpc. Check if we actually optimized
+ away the comparison. */
+/* { dg-final { scan-assembler-times "adde" 0 { target powerpc*-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c
new file mode 100644
index 000000000..b79871064
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-7.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ int y;
+ if (x != 1)
+ y = 0;
+ else
+ y = 1;
+ return y;
+}
+
+/* There should be no != 1. Fold changes x != 1 to ! x. */
+/* { dg-final { scan-tree-dump-times "!= 1" 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-8.c
new file mode 100644
index 000000000..527525270
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-8.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(_Bool x)
+{
+ return (x == 1);
+}
+
+/* There should be no == 1 which is produced by the front-end as
+ bool_var == 1 is the same as bool_var. */
+/* { dg-final { scan-tree-dump-times "== 1" 0 "optimized"} } */
+
+/* There should be no adde for powerpc. Check if we actually optimized
+ away the comparison. */
+/* { dg-final { scan-assembler-times "adde" 0 { target powerpc*-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-9.c
new file mode 100644
index 000000000..2660b2580
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/bool-9.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+_Bool f1(_Bool x)
+{
+ return !!x;
+}
+
+/* There should be no != 0 which is produced by the front-end as
+ bool_var != 0 is the same as bool_var. */
+/* { dg-final { scan-tree-dump-times "!= 0" 0 "optimized"} } */
+
+/* There should be no subfe for powerpc. Check if we actually optimized
+ away the comparison. */
+/* { dg-final { scan-assembler-times "subfe" 0 { target powerpc*-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-1.c
new file mode 100644
index 000000000..4c3888fd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+f (int i, float j, int i2, float j2)
+{
+ if (__builtin_expect ((i * i2) > 0 && (j * j2), 0))
+ g ();
+}
+
+/* { dg-final { scan-tree-dump-times {builtin_expect[^\n]*, 0\);\n[^\n]*if} 2 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-2.c
new file mode 100644
index 000000000..d8f344f78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+f (int i, float j, int i2, float j2)
+{
+ if (__builtin_expect ((i * i2) > 0 || (j * j2), 0))
+ ;
+ else
+ g ();
+}
+
+/* { dg-final { scan-tree-dump-times {builtin_expect[^\n]*, 0\);\n[^\n]*if} 2 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-3.c
new file mode 100644
index 000000000..b9e6cfb8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+f (int i, float j, int i2, float j2)
+{
+ if (__builtin_expect ((i * i2) > 0 && (j * j2), 0))
+ a ();
+ else
+ b ();
+}
+
+/* { dg-final { scan-tree-dump-times {builtin_expect[^\n]*, 0\);\n[^\n]*if} 2 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-4.c
new file mode 100644
index 000000000..2d2b20668
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-4.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+f (int i, float j, int i2, float j2)
+{
+ if (__builtin_expect ((i * i2) > 0 || (j * j2), 0))
+ a ();
+ else
+ b ();
+}
+
+/* { dg-final { scan-tree-dump-times {builtin_expect[^\n]*, 0\);\n[^\n]*if} 2 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-5.c
new file mode 100644
index 000000000..d0b251db1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-5.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop" } */
+
+f (int i, float j, int i2, float j2)
+{
+ if (__builtin_expect ((i * i2) > 0 && __builtin_expect ((j * j2) != 0, 1), 0))
+ a ();
+ else
+ b ();
+}
+
+/* { dg-final { scan-tree-dump-times { if } 2 "forwprop1"} } */
+/* { dg-final { scan-tree-dump {builtin_expect[^\n]*, 0\);\n[^\n]*if} "forwprop1"} } */
+/* { dg-final { scan-tree-dump {builtin_expect[^\n]*, 1\);\n[^\n]*if} "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop?" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-1.c
new file mode 100644
index 000000000..b69cb9055
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-1.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+typedef struct { int i; } FILE;
+FILE *fp;
+extern int fprintf (FILE *, const char *, ...);
+volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9;
+
+void test (void)
+{
+ vi0 = 0;
+ fprintf (fp, "hello");
+ vi1 = 0;
+ fprintf (fp, "hello\n");
+ vi2 = 0;
+ fprintf (fp, "a");
+ vi3 = 0;
+ fprintf (fp, "");
+ vi4 = 0;
+ fprintf (fp, "%s", "hello");
+ vi5 = 0;
+ fprintf (fp, "%s", "hello\n");
+ vi6 = 0;
+ fprintf (fp, "%s", "a");
+ vi7 = 0;
+ fprintf (fp, "%c", 'x');
+ vi8 = 0;
+ fprintf (fp, "%d%d", vi0, vi1);
+ vi9 = 0;
+}
+
+/* { dg-final { scan-tree-dump "vi0.*fwrite.*\"hello\".*1, 5, fp.*vi1" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi1.*fwrite.*\"hello\\\\n\".*1, 6, fp.*vi2" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi2.*fputc.*fp.*vi3" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi4.*fwrite.*\"hello\".*1, 5, fp.*vi5" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi5.*fwrite.*\"hello\\\\n\".*1, 6, fp.*vi6" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi6.*fputc.*fp.*vi7" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi7.*fputc.*fp.*vi8" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi8.*fprintf.*fp.*\"%d%d\".*vi9" "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-chk-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-chk-1.c
new file mode 100644
index 000000000..201186bc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-chk-1.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+typedef struct { int i; } FILE;
+FILE *fp;
+extern int __fprintf_chk (FILE *, int, const char *, ...);
+volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9;
+
+void test (void)
+{
+ vi0 = 0;
+ __fprintf_chk (fp, 1, "hello");
+ vi1 = 0;
+ __fprintf_chk (fp, 1, "hello\n");
+ vi2 = 0;
+ __fprintf_chk (fp, 1, "a");
+ vi3 = 0;
+ __fprintf_chk (fp, 1, "");
+ vi4 = 0;
+ __fprintf_chk (fp, 1, "%s", "hello");
+ vi5 = 0;
+ __fprintf_chk (fp, 1, "%s", "hello\n");
+ vi6 = 0;
+ __fprintf_chk (fp, 1, "%s", "a");
+ vi7 = 0;
+ __fprintf_chk (fp, 1, "%c", 'x');
+ vi8 = 0;
+ __fprintf_chk (fp, 1, "%d%d", vi0, vi1);
+ vi9 = 0;
+}
+
+/* { dg-final { scan-tree-dump "vi0.*fwrite.*\"hello\".*1, 5, fp.*vi1" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi1.*fwrite.*\"hello\\\\n\".*1, 6, fp.*vi2" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi2.*fputc.*fp.*vi3" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi4.*fwrite.*\"hello\".*1, 5, fp.*vi5" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi5.*fwrite.*\"hello\\\\n\".*1, 6, fp.*vi6" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi6.*fputc.*fp.*vi7" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi7.*fputc.*fp.*vi8" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi8.*__fprintf_chk.*fp.*1.*\"%d%d\".*vi9" "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-free.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-free.c
new file mode 100644
index 000000000..67dd07140
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-free.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void bar (void *);
+void foo(unsigned n)
+{
+ void *p = __builtin_malloc (n);
+ if (p)
+ {
+ bar (p);
+ __builtin_free (p);
+ p = 0;
+ }
+ __builtin_free (p);
+}
+
+/* We should remove the redundant call to free. */
+
+/* { dg-final { scan-tree-dump-times "free" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-1.c
new file mode 100644
index 000000000..f6bde472d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-1.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+extern int printf (const char *, ...);
+volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9, via;
+
+void test (void)
+{
+ vi0 = 0;
+ printf ("hello");
+ vi1 = 0;
+ printf ("hello\n");
+ vi2 = 0;
+ printf ("a");
+ vi3 = 0;
+ printf ("");
+ vi4 = 0;
+ printf ("%s", "hello");
+ vi5 = 0;
+ printf ("%s", "hello\n");
+ vi6 = 0;
+ printf ("%s", "a");
+ vi7 = 0;
+ printf ("%s", "");
+ vi8 = 0;
+ printf ("%c", 'x');
+ vi9 = 0;
+ printf ("%s\n", "hello\n");
+ via = 0;
+}
+
+/* { dg-final { scan-tree-dump "vi0.*printf.*\"hello\".*vi1" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi1.*puts.*\"hello\".*vi2" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi2.*putchar.*vi3" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi4.*printf.*\"hello\".*vi5" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi5.*puts.*\"hello\".*vi6" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi6.*putchar.*vi7" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi7 ={v} 0\[^\(\)\]*vi8 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi8.*putchar.*vi9" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi9.*puts.*\"hello\\\\n\".*via" "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-chk-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-chk-1.c
new file mode 100644
index 000000000..c7e931366
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-chk-1.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+extern int __printf_chk (int, const char *, ...);
+volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9, via;
+
+void test (void)
+{
+ vi0 = 0;
+ __printf_chk (1, "hello");
+ vi1 = 0;
+ __printf_chk (1, "hello\n");
+ vi2 = 0;
+ __printf_chk (1, "a");
+ vi3 = 0;
+ __printf_chk (1, "");
+ vi4 = 0;
+ __printf_chk (1, "%s", "hello");
+ vi5 = 0;
+ __printf_chk (1, "%s", "hello\n");
+ vi6 = 0;
+ __printf_chk (1, "%s", "a");
+ vi7 = 0;
+ __printf_chk (1, "%s", "");
+ vi8 = 0;
+ __printf_chk (1, "%c", 'x');
+ vi9 = 0;
+ __printf_chk (1, "%s\n", "hello\n");
+ via = 0;
+}
+
+/* { dg-final { scan-tree-dump "vi0.*__printf_chk.*1.*\"hello\".*vi1" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi1.*puts.*\"hello\".*vi2" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi2.*putchar.*vi3" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi4.*__printf_chk.*1.*\"hello\".*vi5" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi5.*puts.*\"hello\".*vi6" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi6.*putchar.*vi7" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi7 ={v} 0\[^\(\)\]*vi8 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi8.*putchar.*vi9" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi9.*puts.*\"hello\\\\n\".*via" "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-1.c
new file mode 100644
index 000000000..60cbe4fc7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-1.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+#include <stdarg.h>
+
+typedef struct { int i; } FILE;
+FILE *fp;
+extern int vfprintf (FILE *, const char *, va_list);
+volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9, via;
+
+void
+test (va_list ap1, va_list ap2, va_list ap3, va_list ap4, va_list ap5,
+ va_list ap6, va_list ap7)
+{
+ vi0 = 0;
+ vfprintf (fp, "hello", ap1);
+ vi1 = 0;
+ vfprintf (fp, "hello\n", ap2);
+ vi2 = 0;
+ vfprintf (fp, "a", ap3);
+ vi3 = 0;
+ vfprintf (fp, "", ap4);
+ vi4 = 0;
+ vfprintf (fp, "%s", ap5);
+ vi5 = 0;
+ vfprintf (fp, "%c", ap6);
+ vi6 = 0;
+ vfprintf (fp, "%s\n", ap7);
+ vi7 = 0;
+}
+
+/* { dg-final { scan-tree-dump "vi0.*fwrite.*\"hello\".*1, 5, fp.*vi1" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi1.*fwrite.*\"hello\\\\n\".*1, 6, fp.*vi2" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi2.*fputc.*fp.*vi3" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi4.*vfprintf.*\"%s\".*vi5" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi5.*vfprintf.*\"%c\".*vi6" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi6.*vfprintf.*\"%s\\\\n\".*vi7" "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-chk-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-chk-1.c
new file mode 100644
index 000000000..ead09ceda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-chk-1.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+#include <stdarg.h>
+
+typedef struct { int i; } FILE;
+FILE *fp;
+extern int __vfprintf_chk (FILE *, int, const char *, va_list);
+volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9, via;
+
+void
+test (va_list ap1, va_list ap2, va_list ap3, va_list ap4, va_list ap5,
+ va_list ap6, va_list ap7)
+{
+ vi0 = 0;
+ __vfprintf_chk (fp, 1, "hello", ap1);
+ vi1 = 0;
+ __vfprintf_chk (fp, 1, "hello\n", ap2);
+ vi2 = 0;
+ __vfprintf_chk (fp, 1, "a", ap3);
+ vi3 = 0;
+ __vfprintf_chk (fp, 1, "", ap4);
+ vi4 = 0;
+ __vfprintf_chk (fp, 1, "%s", ap5);
+ vi5 = 0;
+ __vfprintf_chk (fp, 1, "%c", ap6);
+ vi6 = 0;
+ __vfprintf_chk (fp, 1, "%s\n", ap7);
+ vi7 = 0;
+}
+
+/* { dg-final { scan-tree-dump "vi0.*fwrite.*\"hello\".*1, 5, fp.*vi1" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi1.*fwrite.*\"hello\\\\n\".*1, 6, fp.*vi2" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi2.*fputc.*fp.*vi3" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi4.*__vfprintf_chk.*fp.*1.*\"%s\".*vi5" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi5.*__vfprintf_chk.*fp.*1.*\"%c\".*vi6" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi6.*__vfprintf_chk.*fp.*1.*\"%s\\\\n\".*vi7" "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-1.c
new file mode 100644
index 000000000..f87186dd8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-1.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+#include <stdarg.h>
+
+extern int vprintf (const char *, va_list);
+volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9, via;
+
+void
+test (va_list ap1, va_list ap2, va_list ap3, va_list ap4, va_list ap5,
+ va_list ap6, va_list ap7)
+{
+ vi0 = 0;
+ vprintf ("hello", ap1);
+ vi1 = 0;
+ vprintf ("hello\n", ap2);
+ vi2 = 0;
+ vprintf ("a", ap3);
+ vi3 = 0;
+ vprintf ("", ap4);
+ vi4 = 0;
+ vprintf ("%s", ap5);
+ vi5 = 0;
+ vprintf ("%c", ap6);
+ vi6 = 0;
+ vprintf ("%s\n", ap7);
+ vi7 = 0;
+}
+
+/* { dg-final { scan-tree-dump "vi0.*vprintf.*\"hello\".*vi1" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi1.*puts.*\"hello\".*vi2" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi2.*putchar.*vi3" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi4.*vprintf.*\"%s\".*vi5" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi5.*vprintf.*\"%c\".*vi6" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi6.*vprintf.*\"%s\\\\n\".*vi7" "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-chk-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-chk-1.c
new file mode 100644
index 000000000..3ffb51b8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-chk-1.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fab1" } */
+
+#include <stdarg.h>
+
+extern int __vprintf_chk (int, const char *, va_list);
+volatile int vi0, vi1, vi2, vi3, vi4, vi5, vi6, vi7, vi8, vi9, via;
+
+void
+test (va_list ap1, va_list ap2, va_list ap3, va_list ap4, va_list ap5,
+ va_list ap6, va_list ap7)
+{
+ vi0 = 0;
+ __vprintf_chk (1, "hello", ap1);
+ vi1 = 0;
+ __vprintf_chk (1, "hello\n", ap2);
+ vi2 = 0;
+ __vprintf_chk (1, "a", ap3);
+ vi3 = 0;
+ __vprintf_chk (1, "", ap4);
+ vi4 = 0;
+ __vprintf_chk (1, "%s", ap5);
+ vi5 = 0;
+ __vprintf_chk (1, "%c", ap6);
+ vi6 = 0;
+ __vprintf_chk (1, "%s\n", ap7);
+ vi7 = 0;
+}
+
+/* { dg-final { scan-tree-dump "vi0.*__vprintf_chk.*1.*\"hello\".*vi1" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi1.*puts.*\"hello\".*vi2" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi2.*putchar.*vi3" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi3 ={v} 0\[^\(\)\]*vi4 ={v} 0" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi4.*__vprintf_chk.*1.*\"%s\".*vi5" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi5.*__vprintf_chk.*1.*\"%c\".*vi6" "fab1"} } */
+/* { dg-final { scan-tree-dump "vi6.*__vprintf_chk.*1.*\"%s\\\\n\".*vi7" "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c
new file mode 100644
index 000000000..e86a6484e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dce1" } */
+void
+cleanup (int a, int b)
+{
+ if (a)
+ if (b)
+ a = 1;
+ else
+ b = 1;
+ else if (a)
+ a = 1;
+ else
+ b = 1;
+ return;
+}
+/* Dce should get rid of the initializers and cfgcleanup should elliminate ifs */
+/* { dg-final { scan-tree-dump-times "if " 0 "dce1"} } */
+/* { dg-final { cleanup-tree-dump "dce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/coalesce-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/coalesce-1.c
new file mode 100644
index 000000000..5cae9ae2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/coalesce-1.c
@@ -0,0 +1,195 @@
+/* { dg-do compile } */
+
+/* { dg-options "-O2 -fdump-rtl-expand-details" } */
+
+typedef long unsigned int size_t;
+union tree_node;
+typedef union tree_node *tree;
+union gimple_statement_d;
+typedef union gimple_statement_d *gimple;
+typedef const union tree_node *const_tree;
+typedef const union gimple_statement_d *const_gimple;
+struct gimple_seq_d;
+typedef struct gimple_seq_d *gimple_seq;
+struct edge_def;
+typedef struct edge_def *edge;
+struct basic_block_def;
+typedef struct basic_block_def *basic_block;
+typedef const struct basic_block_def *const_basic_block;
+struct tree_exp
+{
+ tree operands[1];
+};
+typedef struct ssa_use_operand_d
+{
+ tree *use;
+} ssa_use_operand_t;
+struct phi_arg_d
+{
+ struct ssa_use_operand_d imm_use;
+};
+union tree_node
+{
+ struct tree_exp exp;
+};
+struct function
+{
+};
+extern struct function *cfun;
+struct edge_def
+{
+ unsigned int dest_idx;
+};
+static __inline__ void
+VEC_edge_must_be_pointer_type (void)
+{
+ (void) ((edge) 1 == (void *) 1);
+} typedef struct VEC_edge_base
+
+{
+ unsigned num;
+ unsigned alloc;
+ edge vec[1];
+} VEC_edge_base;
+typedef struct VEC_edge_none
+{
+ VEC_edge_base base;
+} VEC_edge_none;
+
+static __inline__ edge
+VEC_edge_base_index (const VEC_edge_base * vec_, unsigned ix_,
+ const char *file_, unsigned line_, const char *function_)
+{
+ return vec_->vec[ix_];
+}
+
+typedef struct VEC_edge_gc
+{
+ VEC_edge_base base;
+} VEC_edge_gc;
+struct basic_block_def
+{
+ VEC_edge_gc *succs;
+};
+static __inline__ edge
+single_succ_edge (const_basic_block bb)
+{
+ return (VEC_edge_base_index
+ ((((bb)->succs) ? &((bb)->succs)->base : 0), (0),
+ "/home/gcc/virgin-gcc/gcc/basic-block.h", 563, __FUNCTION__));
+}
+
+edge find_edge (basic_block, basic_block);
+typedef tree *def_operand_p;
+typedef ssa_use_operand_t *use_operand_p;
+struct gimple_seq_node_d;
+typedef struct gimple_seq_node_d *gimple_seq_node;
+struct gimple_seq_node_d
+{
+ gimple stmt;
+};
+typedef struct
+{
+ gimple_seq_node ptr;
+ gimple_seq seq;
+ basic_block bb;
+} gimple_stmt_iterator;
+struct gimple_statement_phi
+{
+ struct phi_arg_d args[1];
+};
+union gimple_statement_d
+{
+ struct gimple_statement_phi gimple_phi;
+};
+extern size_t const gimple_ops_offset_[];
+static __inline__ tree *
+gimple_ops (gimple gs)
+{
+ size_t off;
+ off = gimple_ops_offset_[gimple_statement_structure (gs)];
+ return (tree *) ((char *) gs + off);
+}
+
+static __inline__ tree
+gimple_op (const_gimple gs, unsigned i)
+{
+ return gimple_ops ((((union
+ {
+ const union gimple_statement_d * _q;
+ union gimple_statement_d * _nq;}) (((gs))))._nq))[i];
+}
+
+static __inline__ struct phi_arg_d *
+gimple_phi_arg (gimple gs, unsigned index)
+{
+ return &(gs->gimple_phi.args[index]);
+}
+
+static __inline__ tree
+gimple_switch_label (const_gimple gs, unsigned index)
+{
+ return gimple_op (gs, index + 1);
+}
+
+gimple_stmt_iterator gsi_start_phis (basic_block);
+extern basic_block label_to_block_fn (struct function *, tree);
+
+static __inline__ tree
+get_use_from_ptr (use_operand_p use)
+{
+ return *(use->use);
+}
+
+static __inline__ use_operand_p
+gimple_phi_arg_imm_use_ptr (gimple gs, int i)
+{
+ return &gimple_phi_arg (gs, i)->imm_use;
+}
+
+struct switch_conv_info
+{
+ basic_block final_bb;
+ basic_block switch_bb;
+ const char *reason;
+ tree *default_values;
+};
+static struct switch_conv_info info;
+
+static void
+gather_default_values (tree default_case)
+{
+ gimple_stmt_iterator gsi;
+ basic_block bb =
+ (label_to_block_fn ((cfun + 0), default_case->exp.operands[2]));
+ edge e;
+ int i = 0;
+ if (bb == info.final_bb)
+ e = find_edge (info.switch_bb, bb);
+ else
+ e = single_succ_edge (bb);
+ for (gsi = gsi_start_phis (info.final_bb);
+ gsi_gsi_start_phis (info.final_bb); gsi_next (&gsi))
+ {
+ gimple phi = gsi.ptr->stmt;
+ tree val = get_use_from_ptr (gimple_phi_arg_imm_use_ptr
+ ((((phi))), (((e)->dest_idx))));
+ info.default_values[i++] = val;
+ }
+}
+
+unsigned char
+process_switch (gimple swtch)
+{
+ unsigned int i, branch_num = gimple_switch_num_labels (swtch);
+ tree index_type;
+ info.reason = "switch has no labels\n";
+ gather_default_values (gimple_switch_label (swtch, 0));
+}
+
+/* Verify that out-of-ssa coalescing did its job by verifying there are not
+ any partition copies inserted. */
+
+/* { dg-final { scan-rtl-dump-not "partition copy" "expand"} } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/coalesce-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/coalesce-2.c
new file mode 100644
index 000000000..56c5ccccc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/coalesce-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-expand-details" } */
+
+float total = 0.2;
+void foo(int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ total += i;
+}
+
+/* Verify that out-of-ssa coalescing did its job by verifying there are not
+ any partition copies inserted. */
+
+/* { dg-final { scan-rtl-dump-not "partition copy" "expand"} } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/col-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/col-1.c
new file mode 100644
index 000000000..5838134ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/col-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple-details-lineno" } */
+
+void foo (int, int);
+
+int
+m(int x)
+{
+ int c, a;
+ a = (c = 5) + 16 + x * 2 ;
+ foo (c, a);
+}
+
+/* { dg-final { scan-tree-dump-times "10:9.*c = 5" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "10:14.*c . 16" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "10:4.*a =" 1 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-1.c
new file mode 100644
index 000000000..7c76467f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-1.c
@@ -0,0 +1,13 @@
+/* Verify that we don't libcall for complex * real. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -O -fdump-tree-optimized" } */
+
+typedef _Complex float C;
+
+C foo(C x, float y)
+{
+ return x * y;
+}
+
+/* { dg-final { scan-tree-dump-times "__mul" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-2.c
new file mode 100644
index 000000000..d2d42b93d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-2.c
@@ -0,0 +1,13 @@
+/* Verify that we don't libcall for complex / real. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -O -fdump-tree-optimized" } */
+
+typedef _Complex float C;
+
+C foo(C x, float y)
+{
+ return x / y;
+}
+
+/* { dg-final { scan-tree-dump-times "__div" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-3.c
new file mode 100644
index 000000000..5f4b110c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-3.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+typedef _Complex float COMPLEX_FLOAT;
+float real_part(COMPLEX_FLOAT a)
+{
+ return *(float*)(&a);
+}
+
+float real_part_2(COMPLEX_FLOAT a)
+{
+ return ((float*)(&a))[0];
+}
+
+
+float imag_part(COMPLEX_FLOAT a)
+{
+ return ((float*)(&a))[1];
+}
+
+/* Test that the above gets optimized to REALPART_EXPR and IMAGPART_EXPR
+ respectively. */
+
+/* { dg-final { scan-tree-dump-times "REALPART_EXPR" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "IMAGPART_EXPR" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c
new file mode 100644
index 000000000..fa2ad5816
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int g(_Complex int*);
+int f(void)
+{
+ _Complex int t = 0;
+ int i, j;
+ __real__ t += 2;
+ __imag__ t += 2;
+ return g(&t);
+}
+
+/* { dg-final { scan-tree-dump-times "__complex__" 0 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-5.c
new file mode 100644
index 000000000..dec394a5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-5.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-dce -fdump-tree-optimized" } */
+_Complex int t = 0;
+int f(void)
+{
+ t = 0;
+ __real__ t = 2;
+ __imag__ t = 2;
+}
+
+/* { dg-final { scan-tree-dump-times "__complex__" 0 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c
new file mode 100644
index 000000000..01d1fd119
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+float
+quantum_real(float _Complex a)
+{
+ float *p = (float *) &a;
+ return p[0];
+}
+float
+quantum_imag(float _Complex a)
+{
+ float *p = (float *) &a;
+ return p[1];
+}
+float
+quantum_foo(float _Complex a)
+{
+ float *p = (float *) &a;
+ return p[2];
+}
+
+/* { dg-final { scan-tree-dump-times "REALPART_EXPR" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "IMAGPART_EXPR" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c
new file mode 100644
index 000000000..474633eab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ch-details" } */
+
+extern int foo (int);
+
+void bla (void)
+{
+ int i, n = foo (0);
+
+ for (i = 0; i < n; i++)
+ foo (i);
+}
+
+/* There should be a header duplicated. */
+/* { dg-final { scan-tree-dump-times "Duplicating header" 1 "ch"} } */
+/* { dg-final { cleanup-tree-dump "ch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cswtch-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cswtch-2.c
new file mode 100644
index 000000000..ec1d28fe3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cswtch-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-switchconv" } */
+
+typedef enum { a = 5, b = 6, c = 7, d = 8, e = 9 } X;
+
+int h1 (X x)
+{
+ switch (x) {
+ case a:
+ case b:
+ case c:
+ case d:
+ case e:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "CSWTCH" 0 "switchconv" } } */
+/* { dg-final { cleanup-tree-dump "switchconv" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cswtch.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cswtch.c
new file mode 100644
index 000000000..06710f217
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cswtch.c
@@ -0,0 +1,81 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-switchconv" } */
+/* { dg-do run } */
+
+extern void abort (void);
+
+static int X, Y;
+
+int check(int param)
+{
+ int a = 0;
+ int b = 1;
+
+ switch (param)
+ {
+ case -2:
+ a = 0;
+ b = -1;
+ break;
+ case 1:
+ case 2:
+ a = 8;
+ b = 6;
+ break;
+ case 3:
+ a = 9;
+ b = 5;
+ break;
+ case 6:
+ a = 10;
+ b = 4;
+ break;
+ default:
+ a = 16;
+ b = 1;
+ }
+
+ X = a;
+ Y = b;
+ return 0;
+}
+
+void assertions(int a, int b)
+{
+ if (X != a || Y != b)
+ abort();
+
+ return;
+}
+
+int main ()
+{
+ check (-10);
+ assertions (16, 1);
+
+ check (-2);
+ assertions (0, -1);
+
+ check(1);
+ assertions (8, 6);
+
+ check(2);
+ assertions (8, 6);
+
+ check(3);
+ assertions (9, 5);
+
+ check(5);
+ assertions (16, 1);
+
+ check(6);
+ assertions (10, 4);
+
+ check(12);
+ assertions (16, 1);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Switch converted" "switchconv" } } */
+/* { dg-final { cleanup-tree-dump "switchconv" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-1.c
new file mode 100644
index 000000000..0bea9a9f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-cunrolli-details" } */
+int a[2];
+test(int c)
+{
+ int i;
+ for (i=0;i<c;i++)
+ a[i]=5;
+}
+/* Array bounds says the loop will not roll much. */
+/* { dg-final { scan-tree-dump "loop with 3 iterations completely unrolled" "cunrolli"} } */
+/* { dg-final { scan-tree-dump "Last iteration exit edge was proved true." "cunrolli"} } */
+/* { dg-final { cleanup-tree-dump "cunrolli" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-10.c
new file mode 100644
index 000000000..f2cd904ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-10.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Warray-bounds -fdump-tree-cunroll-details" } */
+int a[3];
+int b[4];
+int
+foo (int n)
+{
+ int i;
+ for (i=0;i<n;i++)
+ if (b[i]==2)
+ a[i]++;
+}
+/* { dg-final { scan-tree-dump-times "Forced statement unreachable" 2 "cunroll" } } */
+/* { dg-final { cleanup-tree-dump "cunroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-2.c
new file mode 100644
index 000000000..e16d0086f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-cunroll-details" } */
+int a[2];
+test(int c)
+{
+ int i;
+ for (i=0;i<c;i++)
+ {
+ a[i]=5;
+ if (test2())
+ return;
+ }
+}
+/* We are not able to get rid of the final conditional because the loop has two exits. */
+/* { dg-final { scan-tree-dump "loop with 2 iterations completely unrolled" "cunroll"} } */
+/* { dg-final { cleanup-tree-dump "cunroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-3.c
new file mode 100644
index 000000000..dd6ce5067
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-3.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cunrolli-details" } */
+int a[1];
+test(int c)
+{
+ int i;
+ for (i=0;i<c;i++)
+ {
+ a[i]=5;
+ }
+}
+/* If we start duplicating headers prior curoll, this loop will have 0 iterations. */
+
+/* { dg-final { scan-tree-dump "loop with 2 iterations completely unrolled" "cunrolli"} } */
+/* { dg-final { cleanup-tree-dump "cunrolli" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c
new file mode 100644
index 000000000..86e12bbb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-4.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-ivcanon-details" } */
+int a[1];
+test(int c)
+{
+ int i=0,j;
+ for (i=0;i<c;i++)
+ {
+ for (j=0;j<c;j++)
+ {
+ a[i]=5;
+ test2();
+ }
+ }
+}
+
+/* We should do this as part of cunrolli, but our cost model do not take into account early exit
+ from the last iteration. */
+/* { dg-final { scan-tree-dump "loop turned into non-loop; it never loops." "ivcanon"} } */
+/* { dg-final { scan-tree-dump "Last iteration exit edge was proved true." "ivcanon"} } */
+/* { dg-final { cleanup-tree-dump "ivcanon" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-5.c
new file mode 100644
index 000000000..1e9b8bfba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-5.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-cunroll-details" } */
+int *a;
+test(int c)
+{
+ int i;
+ for (i=0;i<6;i++)
+ a[i]=5;
+}
+/* Basic testcase for complette unrolling. */
+/* { dg-final { scan-tree-dump "loop with 6 iterations completely unrolled" "cunroll"} } */
+/* { dg-final { scan-tree-dump "Exit condition of peeled iterations was eliminated." "cunroll"} } */
+/* { dg-final { scan-tree-dump "Last iteration exit edge was proved true." "cunroll"} } */
+/* { dg-final { cleanup-tree-dump "cunroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c
new file mode 100644
index 000000000..f3b59f9fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cunrolli-details" } */
+void abort (void);
+int a[10];
+int b[11];
+t (int n)
+{
+ int i;
+ int sum = 0;
+ for (i = 0; i < n; i++)
+ {
+ if (i > 1000)
+ abort ();
+ if (q ())
+ sum += a[i];
+ else
+ sum += b[i];
+ }
+ return sum;
+}
+/* { dg-final { scan-tree-dump-times "Removed pointless exit:" 1 "cunrolli" } } */
+/* { dg-final { cleanup-tree-dump "cunrolli" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/dce-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/dce-1.c
new file mode 100644
index 000000000..12612e546
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/dce-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cddce1" } */
+int foo (int b, int j)
+{
+ if (b)
+ {
+ int i;
+ for (i = 0; i<1000; ++i)
+ ;
+ j = 0;
+ }
+ return j;
+}
+/* Check that empty loop is eliminated in this case. We should no longer have
+ the exit condition after the loop. */
+/* { dg-final { scan-tree-dump-not "999" "cddce1"} } */
+/* { dg-final { scan-tree-dump-not "1000" "cddce1"} } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-1.c
new file mode 100644
index 000000000..66bc3745b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fstrict-overflow -fdump-tree-optimized" } */
+
+int f(int a)
+{
+ return (-a)/10;
+}
+
+
+/* { dg-final { scan-tree-dump-times "-a" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "a_..D. / -10" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-2.c
new file mode 100644
index 000000000..6cd86b21f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fstrict-overflow -fdump-tree-optimized" } */
+
+int f(int a)
+{
+ return 10/-a;
+}
+
+
+/* { dg-final { scan-tree-dump-times "10 / -a" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "-10 / a" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-3.c
new file mode 100644
index 000000000..12fa09b95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fstrict-overflow -fdump-tree-optimized" } */
+
+int f(int a)
+{
+ return -(a/10);
+}
+
+/* { dg-final { scan-tree-dump-times "a_\[0-9()D\]* / 10" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "a_..D. / -10" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-4.c
new file mode 100644
index 000000000..734acad69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/divide-4.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fstrict-overflow -fdump-tree-optimized" } */
+
+int f(int a)
+{
+ return -(-a/10);
+}
+
+/* { dg-final { scan-tree-dump-times "-a" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "a_..D. / 10" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/dump-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/dump-1.c
new file mode 100644
index 000000000..e55084899
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/dump-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-profile_estimate-details" } */
+
+int f(void)
+{
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-1.c
new file mode 100644
index 000000000..2eb41e5b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-1.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options -O2 } */
+
+/* Basic tests for flatten attribute, check we end up
+ with only the flattened function bodies. */
+
+static int foobar(int i);
+static int bar(int i);
+
+int __attribute__((flatten)) leaf0a(int i)
+{
+ return bar(i);
+}
+int __attribute__((flatten)) leaf0b(int i)
+{
+ return foobar(i);
+}
+int __attribute__((flatten)) leaf1(int i)
+{
+ return bar(foobar(i));
+}
+int __attribute__((flatten)) leaf2(int i)
+{
+ int j;
+ j = foobar(i);
+ return bar(j);
+}
+
+static int foobar(int i)
+{
+ return i-1;
+}
+static int bar(int i)
+{
+ return i + foobar(i);
+}
+
+
+static int gloobar(int i)
+{
+ return i*5+1;
+}
+static int floobar(int i)
+{
+ return gloobar(i);
+}
+int __attribute__((flatten)) leaf3(int i)
+{
+ int j;
+ j = floobar(i);
+ j += floobar(i);
+ return j;
+}
+
+/* { dg-final { scan-assembler-not "bar\[: \t\n\]" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c
new file mode 100644
index 000000000..ffed23cf4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c
@@ -0,0 +1,85 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-early-inlining" } */
+
+extern void do_something_usefull();
+/* Check that we finish compiling even if instructed to
+ flatten a cyclic callgraph. Verify we correctly
+ flatten with another function marked flatten in the
+ callgraph.
+
+ Main inline is cureful about indirect calls giving
+ precedence to breaking cycle at indirect call sites.
+ Early inliner can't do similar analysis, so we need
+ to disable it if we want cycles to be broken consistently. */
+
+void __attribute__((flatten)) direct(void)
+{
+ direct();
+}
+
+
+void __attribute__((flatten)) indirect(void);
+static void indirect1(void)
+{
+ indirect();
+}
+void __attribute__((flatten)) indirect(void)
+{
+ indirect1();
+}
+
+
+void __attribute__((flatten)) doubleindirect(void);
+static void doubleindirect2(void)
+{
+ doubleindirect();
+ do_something_usefull ();
+}
+static void doubleindirect1(void)
+{
+ doubleindirect2();
+}
+void __attribute__((flatten)) doubleindirect(void)
+{
+ doubleindirect1();
+}
+
+
+static void subcycle1(void);
+static void subcycle2(void)
+{
+ subcycle1();
+ do_something_usefull ();
+}
+static void subcycle1(void)
+{
+ subcycle2();
+}
+void __attribute__((flatten)) subcycle(void)
+{
+ subcycle1();
+}
+
+
+static void doublesubcycle1(void);
+static void doublesubcycle2(void);
+static void doublesubcycle3(void)
+{
+ doublesubcycle1();
+ do_something_usefull ();
+}
+static void doublesubcycle2(void)
+{
+ doublesubcycle3();
+}
+static void doublesubcycle1(void)
+{
+ doublesubcycle2();
+}
+void __attribute__((flatten)) doublesubcycle(void)
+{
+ doublesubcycle1();
+}
+
+/* { dg-final { scan-assembler "cycle\[123\]\[: \t\n\]" } } */
+/* { dg-final { scan-assembler-not "indirect\[12\]\[: \t\n\]" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-3.c
new file mode 100644
index 000000000..a1edb910e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/flatten-3.c
@@ -0,0 +1,79 @@
+/* { dg-do compile } */
+/* { dg-options -O2 } */
+
+extern void do_something_usefull();
+/* Check that we finish compiling even if instructed to
+ flatten a cyclic callgraph. Verify we correctly
+ flatten with another function marked flatten in the
+ callgraph. */
+
+void __attribute__((flatten)) direct(void)
+{
+ direct();
+}
+
+
+void __attribute__((flatten)) indirect(void);
+static void indirect1(void)
+{
+ indirect();
+}
+void __attribute__((flatten)) indirect(void)
+{
+ indirect1();
+}
+
+
+void __attribute__((flatten)) doubleindirect(void);
+static void doubleindirect2(void)
+{
+ doubleindirect();
+ do_something_usefull ();
+}
+static void doubleindirect1(void)
+{
+ doubleindirect2();
+}
+void __attribute__((flatten)) doubleindirect(void)
+{
+ doubleindirect1();
+}
+
+
+static void subcycle1(void);
+static void subcycle2(void)
+{
+ subcycle1();
+ do_something_usefull ();
+}
+static void subcycle1(void)
+{
+ subcycle2();
+}
+void __attribute__((flatten)) subcycle(void)
+{
+ subcycle1();
+}
+
+
+static void doublesubcycle1(void);
+static void doublesubcycle2(void);
+static void doublesubcycle3(void)
+{
+ doublesubcycle1();
+ do_something_usefull ();
+}
+static void doublesubcycle2(void)
+{
+ doublesubcycle3();
+}
+static void doublesubcycle1(void)
+{
+ doublesubcycle2();
+}
+void __attribute__((flatten)) doublesubcycle(void)
+{
+ doublesubcycle1();
+}
+
+/* { dg-final { scan-assembler "cycle\[123\]\[: \t\n\]" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c
new file mode 100644
index 000000000..0c81d92bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fnsplit" } */
+#include <stdio.h>
+int a[1000];
+
+void
+t(int a)
+{
+ if (a)
+ printf ("I Am Completely Operational,"),
+ printf ("And All My Circuits Are Functioning Perfectly\n");
+}
+int
+main(void)
+{
+ int i;
+ for (i = 0; i < 1000; i++)
+ t(a[i]);
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "Splitting function at:" 1 "fnsplit"} } */
+
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c
new file mode 100644
index 000000000..d74022e4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-original" } */
+#include <stddef.h>
+
+char *a;
+int foo(char *b)
+{
+ return a+5+(ptrdiff_t)b == (ptrdiff_t)b+a;
+}
+
+/* Folding should have determined that the two addresses were
+ not identical and thus collapsed the function into a trivial
+ "return 0". */
+/* { dg-final { scan-tree-dump-times "return 0" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c
new file mode 100644
index 000000000..9444f0be2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+typedef __INTPTR_TYPE__ ssize_t;
+ssize_t foo (ssize_t x)
+{
+ return (ssize_t)(char *)x;
+}
+
+char *bar (char *x)
+{
+ return (char *)(ssize_t)x;
+}
+
+/* { dg-final { scan-tree-dump-times "return x;" 2 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-1.c
new file mode 100644
index 000000000..10414a2a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+void bar (unsigned int);
+
+void
+foo (void)
+{
+ char buf[1] = { 3 };
+ const char *p = buf;
+ const char **q = &p;
+ unsigned int ch;
+ switch (**q)
+ {
+ case 1: ch = 5; break;
+ case 2: ch = 4; break;
+ case 3: ch = 3; break;
+ case 4: ch = 2; break;
+ case 5: ch = 1; break;
+ default: ch = 0; break;
+ }
+ bar (ch);
+}
+/* The switch should be switch converted and later constant propagated. */
+/* { dg-final { scan-tree-dump-not "CSWTCH" "optimized"} } */
+/* { dg-final { scan-tree-dump-not "switch" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
new file mode 100644
index 000000000..0eff197bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ch" } */
+typedef union tree_node *tree;
+enum tree_code
+{
+ OFFSET_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, POINTER_TYPE, FIXED_POINT_TYPE,
+};
+struct tree_base
+{
+ unsigned public_flag:1;
+};
+struct tree_decl_with_vis
+{
+ unsigned comdat_flag:1;
+};
+union tree_node
+{
+ struct tree_base base;
+ struct tree_decl_with_vis decl_with_vis;
+};
+enum tree_index
+{
+ TI_LONG_DOUBLE_PTR_TYPE, TI_INTEGER_PTR_TYPE, TI_VOID_TYPE, TI_PTR_TYPE,
+ TI_VA_LIST_FPR_COUNTER_FIELD, TI_BOOLEAN_TYPE, TI_FILEPTR_TYPE,
+ TI_CURRENT_TARGET_PRAGMA, TI_CURRENT_OPTIMIZE_PRAGMA, TI_MAX
+};
+extern tree global_trees[TI_MAX];
+emit_support_tinfos (void)
+{
+ static tree *const fundamentals[] = {
+ &global_trees[TI_VOID_TYPE], &global_trees[TI_BOOLEAN_TYPE],
+ };
+ int ix;
+ for (ix = 0; fundamentals[ix]; ix++)
+ {
+ {
+ tree tinfo;
+ {
+ ((void) (!(((tinfo)->base.public_flag) && !(__extension__ (
+ {
+ __typeof
+ (tinfo)
+ __t
+ =
+ (tinfo);
+ __t;}
+ )->decl_with_vis.
+ comdat_flag)) ?
+ fancy_abort ("../../gcc/cp/rtti.c", 1529,
+ __FUNCTION__), 0 : 0));
+ }
+ }
+ }
+}
+/* We should copy loop header to fundamentals[0] and then fold it way into
+ known value. */
+/* { dg-final { scan-tree-dump-not "fundamentals.0" "ch"} } */
+/* { dg-final { cleanup-tree-dump "ch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
new file mode 100644
index 000000000..9f1088687
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
@@ -0,0 +1,76 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fno-short-enums" } */
+typedef const union tree_node *const_tree;
+typedef struct
+{
+}
+double_int;
+double_int double_int_zext (double_int, unsigned);
+enum tree_code
+{ ERROR_MARK, IDENTIFIER_NODE, TREE_LIST, BLOCK, ENUMERAL_TYPE, BOOLEAN_TYPE,
+ INTEGER_TYPE, ARRAY_TYPE, INTEGER_CST, VAR_DECL, PARM_DECL, RESULT_DECL,
+ };
+enum tree_code_class
+{ tcc_exceptional, tcc_constant, tcc_type, tcc_declaration, tcc_reference, };
+struct tree_base
+{
+ __extension__ enum tree_code code:16;
+ unsigned unsigned_flag:1;
+};
+struct tree_type
+{
+ unsigned int precision:10;
+ union tree_type_symtab
+ {
+ } symtab;
+};
+union tree_node
+{
+ struct tree_base base;
+ struct tree_type type;
+};
+const enum tree_code_class tree_code_type[] =
+{ tcc_exceptional, 1, 0, 0, 0, 0, 2, };
+
+int_fits_type_p (const_tree c, const_tree type)
+{
+ double_int dc, dd;
+ {
+ if (((enum tree_code) (type)->base.code) == INTEGER_TYPE && ((
+ {
+ __typeof
+ (type) __t
+ = (type);
+ if
+ (tree_code_type
+ [(int)
+ (((enum
+ tree_code)
+ (__t)->
+ base.
+ code))]
+ !=
+ (tcc_type))
+ tree_class_check_failed
+ (__t,
+ __FUNCTION__);
+ __t;})->
+ base.
+ unsigned_flag))
+ dd = double_int_zext (dd, ((
+ {
+ __typeof (type) __t = (type);
+ if (tree_code_type
+ [(int)
+ (((enum tree_code) (__t)->base.
+ code))] !=
+ (tcc_type))
+ tree_class_check_failed (__t,
+ __FUNCTION__);
+ __t;}
+ )->type.precision));
+}
+}
+/* The switch should be switch converted and later constant propagated. */
+/* { dg-final { scan-tree-dump-not "tree_code_type" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-4.c
new file mode 100644
index 000000000..b416d371e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-4.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp2" } */
+
+struct a {int a,b;};
+const static struct a a;
+static int b[10];
+int c;
+test()
+{
+ return a.a+b[c];
+}
+/* { dg-final { scan-tree-dump "return 0;" "ccp2" } } */
+/* { dg-final { cleanup-tree-dump "ccp2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-5.c
new file mode 100644
index 000000000..1dad931ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-5.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+
+static const char a[5]="t";
+static const int b[5]={1,2};
+static const struct a {int a : 6; int b : 6;} c = {5,9};
+test()
+{
+ return a[2]+b[1]+b[3]+c.b;
+}
+/* { dg-final { scan-tree-dump "return 11;" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-6.c
new file mode 100644
index 000000000..0c08f8f25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldconst-6.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+typedef long vec __attribute__ ((vector_size (2 * sizeof(long))));
+
+void f (vec *r)
+{
+ vec a = { -2, 666 };
+ vec b = { 3, 2 };
+ *r = a < b;
+}
+
+/* { dg-final { scan-tree-dump-not "666" "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
new file mode 100644
index 000000000..e738a44ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-gimple" } */
+
+void
+arf ()
+{
+ if (""[0] == 0)
+ blah ();
+}
+/* { dg-final { scan-tree-dump-times "= 0;" 1 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
new file mode 100644
index 000000000..955e76791
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop1" } */
+
+/* We may not optimize this to b->t[i] = 1. */
+
+struct a
+{
+ int t[10];
+};
+
+void f(struct a * b, __SIZE_TYPE__ i)
+{
+ int *c = b->t;
+ c[i] = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\[\[^\n\r\]*\\\] = 1;" 0 "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c
new file mode 100644
index 000000000..5ca8060c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+int b;
+unsigned a;
+
+static inline int *g(void)
+{
+ a = 1;
+ return (int*)&a;
+}
+void test2(void)
+{
+ b = *g();
+}
+
+/* The indirect load should be replaced by a load from a and a
+ conversion to int. FRE should then be able to replace
+ the rhs of the store to b by 1. */
+
+/* { dg-final { scan-tree-dump "Replaced\[^\\n\]*with 1" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-11.c
new file mode 100644
index 000000000..08d0864af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-11.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+int f(int *p, int n)
+{
+ int (*a)[n] = (int (*)[n])p;
+ int *q = &(*a)[0];
+ return q[1];
+}
+
+int g(int *p, int n)
+{
+ int (*a)[n] = (int (*)[n])p;
+ int *q = &(*a)[2];
+ return q[-1];
+}
+
+/* { dg-final { scan-tree-dump-times "= MEM\\\[\\\(int \\\*\\\)\[ap\]_.. \\\+ 4B\\\];" 2 "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-12.c
new file mode 100644
index 000000000..1c5ea02ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-12.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+struct X { int a[256]; };
+
+int foo(struct X *p, __SIZE_TYPE__ i)
+{
+ int *q = &p->a[0];
+ int *q2 = (int *)((void *)q + i*4 + 32);
+ return *q2;
+}
+
+int bar(struct X *p, int i)
+{
+ return *((int *)p + i + 8);
+}
+
+/* We should have propagated the base array address through the
+ address arithmetic into the memory access as an array access. */
+
+/* { dg-final { scan-tree-dump-times "->a\\\[D\\\." 2 "forwprop1" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-13.c
new file mode 100644
index 000000000..aab4ff6fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-13.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+struct B {
+ unsigned bit0 : 1;
+ unsigned bit1 : 1;
+};
+
+void
+foo (struct B *b)
+{
+ b->bit0 = b->bit0 | b->bit1;
+}
+
+/* { dg-final { scan-tree-dump-not "\\\(unsigned" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-14.c
new file mode 100644
index 000000000..7432e0d54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-14.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+unsigned int
+foo (unsigned int eax)
+{
+ eax |= 4;
+ eax &= 247;
+ eax |= 16;
+ eax &= 223;
+ eax |= 64;
+ eax &= 127;
+ return eax;
+}
+
+/* { dg-final { scan-tree-dump-times " & " 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\\| " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-15.c
new file mode 100644
index 000000000..b7a3a31f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-15.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop1" } */
+
+_Bool
+foo (_Bool a, _Bool b, _Bool c)
+{
+ _Bool r1 = a == 0 & b != 0;
+ _Bool r2 = b != 0 & c == 0;
+ return (r1 == 0 & r2 == 0);
+}
+
+/* { dg-final { scan-tree-dump-times " == " 0 "forwprop1" } } */
+/* { dg-final { scan-tree-dump-times " != " 0 "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-16.c
new file mode 100644
index 000000000..b47edea0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-16.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+int foo (double xx, double xy)
+{
+ int p = xx < xy;
+ int np = !p;
+ if (np)
+ return 5;
+ return 2;
+}
+
+/* { dg-final { scan-tree-dump "if \\\(x" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-17.c
new file mode 100644
index 000000000..a85d0eb9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-17.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int foo (int xx, int xy)
+{
+ xx &=1;
+ xy &=1;
+ return xx ^ xy;
+}
+
+/* { dg-final { scan-tree-dump-times " & 1" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-18.c
new file mode 100644
index 000000000..2c4d120e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-18.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+signed char f1(signed char n)
+{
+ return (long double)n;
+}
+unsigned long long f2(signed char n)
+{
+ return (long double)n;
+}
+
+unsigned long long g1(unsigned long long n)
+{
+ return (float)n;
+}
+signed char g2(unsigned long long n)
+{
+ return (float)n;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\(float\\\)" 2 "forwprop1" } } */
+/* { dg-final { scan-tree-dump-not "\\\(long double\\\)" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-19.c
new file mode 100644
index 000000000..f309e3c7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-19.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+typedef int vec __attribute__((vector_size (4 * sizeof (int))));
+void f (vec *x1, vec *x2)
+{
+ vec m = { 1, 2, 3, 0 };
+ vec n = { 3, 0, 1, 2 };
+ vec y = __builtin_shuffle (*x1, *x2, n);
+ vec z = __builtin_shuffle (y, m);
+ *x1 = z;
+}
+
+/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
new file mode 100644
index 000000000..bcdd78d10
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop1" } */
+
+/* We may not optimize this to b->t[i] = 1. */
+
+struct a
+{
+ char t[10];
+};
+
+struct a *b;
+
+void f(__SIZE_TYPE__ i)
+{
+ char *c = b->t;
+ c[i] = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\[\[^\n\r\]*\\\] = 1;" 0 "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop?" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-20.c
new file mode 100644
index 000000000..b1daa9133
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-20.c
@@ -0,0 +1,70 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target double64 } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+#include <stdint.h>
+
+/* All of these optimizations happen for unsupported vector modes as a
+ consequence of the lowering pass. We need to test with a vector mode
+ that is supported by default on at least some architectures, or make
+ the test target specific so we can pass a flag like -mavx. */
+
+typedef double vecf __attribute__ ((vector_size (2 * sizeof (double))));
+typedef int64_t veci __attribute__ ((vector_size (2 * sizeof (int64_t))));
+
+void f (double d, vecf* r)
+{
+ vecf x = { -d, 5 };
+ vecf y = { 1, 4 };
+ veci m = { 2, 0 };
+ *r = __builtin_shuffle (x, y, m); // { 1, -d }
+}
+
+void g (float d, vecf* r)
+{
+ vecf x = { d, 5 };
+ vecf y = { 1, 4 };
+ veci m = { 2, 1 };
+ *r = __builtin_shuffle (x, y, m); // { 1, 5 }
+}
+
+void h (double d, vecf* r)
+{
+ vecf x = { d + 1, 5 };
+ vecf y = { 1 , 4 };
+ veci m = { 2 , 0 };
+ *r = __builtin_shuffle (y, x, m); // { d + 1, 1 }
+}
+
+void i (float d, vecf* r)
+{
+ vecf x = { d, 5 };
+ veci m = { 1, 0 };
+ *r = __builtin_shuffle (x, m); // { 5, d }
+}
+
+void j (vecf* r)
+{
+ vecf y = { 1, 2 };
+ veci m = { 0, 0 };
+ *r = __builtin_shuffle (y, m); // { 1, 1 }
+}
+
+void k (vecf* r)
+{
+ vecf x = { 3, 4 };
+ vecf y = { 1, 2 };
+ veci m = { 3, 0 };
+ *r = __builtin_shuffle (x, y, m); // { 2, 3 }
+}
+
+void l (double d, vecf* r)
+{
+ vecf x = { -d, 5 };
+ vecf y = { d, 4 };
+ veci m = { 2, 0 };
+ *r = __builtin_shuffle (x, y, m); // { d, -d }
+}
+
+/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-21.c
new file mode 100644
index 000000000..d92b9b33a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-21.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-copyprop1" } */
+typedef int v4si __attribute__ ((vector_size (4 * sizeof(int))));
+
+int
+test (v4si *x, v4si *y)
+{
+ v4si m = { 2, 3, 6, 5 };
+ v4si z = __builtin_shuffle (*x, *y, m);
+ return z[2];
+}
+
+/* Optimization in forwprop1, cleanup in copyprop1. */
+
+/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "copyprop1" } } */
+/* { dg-final { cleanup-tree-dump "copyprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-23.c
new file mode 100644
index 000000000..520499336
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-23.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+typedef long vec __attribute__ ((vector_size (2 * sizeof (long))));
+
+long f (long d, long e)
+{
+ vec x = { d, e };
+ vec m = { 1, 0 };
+ return __builtin_shuffle (x, m) [1];
+}
+
+
+/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-24.c
new file mode 100644
index 000000000..74207cf1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-24.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-cddce1" } */
+
+void bar (void);
+unsigned short
+foo (unsigned char x, unsigned short y)
+{
+ unsigned char t = (unsigned char)((x & 1) ^ ((unsigned char)y & 1));
+ if (t == 1)
+ bar ();
+ return y;
+}
+
+/* We should have combined this to require only one bitwise and
+ as in (x ^ (char) y) & 1. */
+
+/* { dg-final { scan-tree-dump-times " & " 1 "cddce1" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-25.c
new file mode 100644
index 000000000..cf0c50427
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-25.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+typedef const struct rtx_def *const_rtx;
+enum machine_mode
+{
+ MAX_MACHINE_MODE,
+ NUM_MACHINE_MODES = MAX_MACHINE_MODE
+};
+extern const char *const mode_name[NUM_MACHINE_MODES];
+enum mode_class
+{ MODE_RANDOM, MODE_CC, MODE_INT, MODE_PARTIAL_INT, MODE_FRACT, MODE_UFRACT,
+ MODE_ACCUM, MODE_UACCUM, MODE_FLOAT, MODE_DECIMAL_FLOAT, MODE_COMPLEX_INT,
+ MODE_COMPLEX_FLOAT, MODE_VECTOR_INT, MODE_VECTOR_FRACT,
+ MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM,
+ MODE_VECTOR_FLOAT, MAX_MODE_CLASS };
+extern const unsigned char mode_class[NUM_MACHINE_MODES];
+extern const unsigned short mode_precision[NUM_MACHINE_MODES];
+struct rtx_def
+{
+ __extension__ enum machine_mode mode:8;
+};
+void
+convert_move (rtx to, rtx from, int unsignedp)
+{
+ enum machine_mode to_mode = ((enum machine_mode) (to)->mode);
+ enum machine_mode from_mode = ((enum machine_mode) (from)->mode);
+ ((void)
+ (!((mode_precision[from_mode] != mode_precision[to_mode])
+ || ((((enum mode_class) mode_class[from_mode]) == MODE_DECIMAL_FLOAT) !=
+ (((enum mode_class) mode_class[to_mode]) ==
+ MODE_DECIMAL_FLOAT))) ?
+ fancy_abort ("/home/gcc/virgin-gcc/gcc/expr.c", 380, __FUNCTION__),
+ 0 : 0));
+}
+
+/* { dg-final { scan-tree-dump "Replaced.*!=.*with.*!=.* " "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-26.c
new file mode 100644
index 000000000..108b1bcaa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-26.c
@@ -0,0 +1,64 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop1 -fno-short-enums" } */
+
+union tree_node;
+typedef union tree_node *tree;
+enum tree_code
+{
+ MAX_TREE_CODES
+};
+extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
+struct tree_base
+{
+ __extension__ enum tree_code code:16;
+ unsigned public_flag:1;
+};
+enum tree_node_structure_enum
+{
+ TS_DECL_WITH_VIS,
+};
+struct tree_decl_with_vis
+{
+ unsigned comdat_flag:1;
+};
+union tree_node
+{
+ struct tree_base base;
+ struct tree_decl_with_vis decl_with_vis;
+};
+struct varpool_node
+{
+ tree decl;
+ struct varpool_node *next_needed, *prev_needed;
+ unsigned externally_visible:1;
+};
+extern struct varpool_node *varpool_nodes_queue;
+struct pointer_set_t;
+struct pointer_set_t *pointer_set_create (void);
+__inline__ static unsigned char
+varpool_externally_visible_p (struct varpool_node *vnode,
+ unsigned char aliased)
+{
+ struct varpool_node *alias;
+ if (!(( { __typeof (vnode->decl) const __t = (vnode->decl); __t;})->decl_with_vis.comdat_flag)
+ && !((vnode->decl)->base.public_flag))
+ return 0;
+ if (aliased)
+ return 1;
+ return 0;
+}
+
+unsigned int
+function_and_variable_visibility (unsigned char whole_program)
+{
+ struct cgraph_node *node;
+ struct varpool_node *vnode;
+ struct pointer_set_t *aliased_vnodes = pointer_set_create ();
+ for (vnode = varpool_nodes_queue; vnode; vnode = vnode->next_needed)
+ if (varpool_externally_visible_p
+ (vnode, pointer_set_contains (aliased_vnodes, vnode)))
+ vnode->externally_visible = 1;
+}
+
+/* { dg-final { scan-tree-dump-not "& 255" "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-27.c
new file mode 100644
index 000000000..9e1b0763b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-27.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+typedef int V __attribute__((vector_size(2*sizeof(int))));
+typedef __complex__ int C;
+
+void f (V *v1, V *v2){
+ V w1 = *v1;
+ V x1 = ~w1;
+ *v1 = x1 + 1;
+ V w2 = *v2;
+ V x2 = ~w2;
+ *v2 = x2 + w2;
+}
+
+void g (V *v1, V *v2){
+ V c1 = { 5, -10 };
+ V c2 = { 32, 13 };
+ *v1 = (*v1|c1)&c2;
+ *v2 = (*v2^c1)^c2;
+}
+
+void h (C *v1, C *v2){
+ C w = *v2;
+ C x = *v1 - w;
+ *v1 = x + w;
+}
+
+void i (V *v1, V *v2){
+ V c1 = { 5, -10 };
+ V c2 = { 32, 13 };
+ *v1 = (*v1-c1)+c2;
+ *v2 = (c1-*v2)+c2;
+}
+
+/* { dg-final { scan-tree-dump-not "\\\+" "forwprop1"} } */
+/* { dg-final { scan-tree-dump "{ 0, 4 }" "forwprop1"} } */
+/* { dg-final { scan-tree-dump "{ 37, -5 }" "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c
new file mode 100644
index 000000000..3fa9d5879
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c
@@ -0,0 +1,80 @@
+/* Setting LOGICAL_OP_NON_SHORT_CIRCUIT to 0 leads to two conditional jumps
+ when evaluating an && condition. VRP is not able to optimize this. */
+/* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* } } } } } */
+/* { dg-options "-O2 -fdump-tree-forwprop1" } */
+
+extern char *frob (void);
+extern _Bool testit (void);
+
+test (int code)
+{
+ char *temp = frob ();
+ int rotate = (code == 22);
+ if (temp == 0 && !rotate)
+ oof ();
+}
+
+test_2 (int code)
+{
+ char *temp = frob ();
+ int rotate = (code == 22);
+ if (!rotate && temp == 0)
+ oof ();
+}
+
+
+test_3 (int code)
+{
+ char *temp = frob ();
+ int rotate = (code == 22);
+ if (!rotate || temp == 0)
+ oof ();
+}
+
+
+test_4 (int code)
+{
+ char *temp = frob ();
+ int rotate = (code == 22);
+ if (temp == 0 || !rotate)
+ oof ();
+}
+
+
+test_5 (int code)
+{
+ _Bool temp = testit ();
+ _Bool rotate = (code == 22);
+ if (temp == 0 && !rotate)
+ oof ();
+}
+
+test_6 (int code)
+{
+ _Bool temp = testit ();
+ _Bool rotate = (code == 22);
+ if (!rotate && temp == 0)
+ oof ();
+}
+
+
+test_7 (int code)
+{
+ _Bool temp = testit ();
+ _Bool rotate = (code == 22);
+ if (!rotate || temp == 0)
+ oof ();
+}
+
+
+test_8 (int code)
+{
+ _Bool temp = testit ();
+ _Bool rotate = (code == 22);
+ if (temp == 0 || !rotate)
+ oof ();
+}
+
+/* { dg-final { scan-tree-dump-times "Replaced" 8 "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-3.c
new file mode 100644
index 000000000..dbb6e420e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop1" } */
+
+struct bar {
+ int a[2];
+};
+
+int foo(struct bar *x)
+{
+ int *p = &x->a[0];
+ int *q = &x->a[1];
+ if (p < q)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Replaced .p_. < q_.. with .1." "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-4.c
new file mode 100644
index 000000000..7eabd1a7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-4.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+/* We should be able to fold the comparison at least with the
+ first forwprop pass, if not a ccp pass before. */
+
+extern void link_error (void);
+void foo()
+{
+ int i;
+ char *p = (char *)&i;
+ long *q = (long *)p;
+ if (q == 0)
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c
new file mode 100644
index 000000000..033c60dae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized -w" } */
+/* { dg-options "-O1 -fdump-tree-optimized -w -msse" { target { i?86-*-* x86_64-*-* } } } */
+
+#define vector __attribute__((vector_size(16) ))
+struct VecClass
+{
+ vector float v;
+};
+
+vector float foo( vector float v )
+{
+ vector float x = v;
+ x = x + x;
+ struct VecClass disappear = *(struct VecClass*)&x;
+ return disappear.v;
+}
+
+/* { dg-final { scan-tree-dump-times "disappear" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
new file mode 100644
index 000000000..4106b3316
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop1 -W -Wall" } */
+#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__)
+typedef int intflt;
+#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__)
+typedef long intflt;
+#else
+#error Add target support here for type that will union float size
+#endif
+
+intflt b;
+void f(void)
+{
+ float a;
+ a = 1;
+ b = *(intflt*)&a; /* { dg-warning "aliasing" } */
+}
+
+/* We should be able to convert the cast to a VCE in forwprop1,
+ even if there is an aliasing violation.
+ ??? While this would be useful and nice to our users in this
+ particular situation before doing this transformation we have to
+ assure that a is killed by a dominating store via type float for
+ it to be valid. Then we might as well handle the situation by
+ value-numbering, removing the load altogether.
+ ??? We now do this after CPP re-writes a into SSA form. */
+/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 1 "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c
new file mode 100644
index 000000000..0d2bac521
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1 -W -Wall" } */
+
+int i;
+int foo(void)
+{
+ volatile int *p = (volatile int *)&i;
+ return *p + *p;
+}
+
+/* We should not convert the cast to a VCE in forwprop1 as we have a
+ volatile reference. */
+
+/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 0 "forwprop1"} } */
+/* { dg-final { scan-tree-dump-times "={v}" 2 "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c
new file mode 100644
index 000000000..1c780c834
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1 -W -Wall" } */
+
+
+struct X { int a[5]; };
+int foo(struct X *q)
+{
+ int (*pointer)[5] = &q->a;
+ return (*pointer)[0];
+}
+
+
+/* We should have propragated &q->a into (*pointer). */
+/* { dg-final { scan-tree-dump "q_.\\\(D\\\)\\\]\\\[0\\\];" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c
new file mode 100644
index 000000000..d02a62d3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-fre1 -W -Wall -fno-early-inlining" } */
+
+int b;
+unsigned a;
+static inline int *g(void)
+{
+ a = 1;
+ return (int*)&a;
+}
+void f(void)
+{
+ b = *g();
+}
+
+/* We should have converted the assignments to two = 1. FRE does this. */
+
+/* { dg-final { scan-tree-dump-times " = 1" 2 "optimized"} } */
+/* { dg-final { scan-tree-dump-not " = a;" "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c
new file mode 100644
index 000000000..c6c142b4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c
@@ -0,0 +1,37 @@
+/* { dg-options "-O2 -fdump-tree-fre1 -w" } */
+/* { dg-options "-O2 -fdump-tree-fre1 -w -msse" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-do compile } */
+#define vector __attribute__((vector_size(sizeof(int)*4) ))
+struct s { vector int i; };
+vector float f(struct s *sv)
+{
+ sv->i = (vector int){1, 2, 3, 4};
+ return (vector float)sv->i;
+}
+
+
+vector float f1(struct s *sv, vector int a)
+{
+ sv->i = a;
+ return (vector float)sv->i;
+}
+
+struct s1 { int i; };
+
+void g(struct s1 *, float);
+void a1 (struct s1 sv)
+{
+ sv.i = 1;
+ g(&sv, *(float*)&sv.i);
+}
+
+
+void a2 (struct s1 sv, int i)
+{
+ sv.i = i;
+ g(&sv, *(float*)&sv.i);
+}
+
+/* { dg-final { scan-tree-dump-times "sv_\[0-9\]\\\(D\\\)->i" 2 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "sv.i" 2 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
new file mode 100644
index 000000000..e5019c012
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
@@ -0,0 +1,34 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fwrapv -fdump-tree-vect-details -fvect-cost-model=dynamic" } */
+/* { dg-options "-O2 -ftree-vectorize -fwrapv -fdump-tree-vect-details -fvect-cost-model=dynamic -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 16
+
+char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+int main ()
+{
+ int i;
+ char ia[N];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] + ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i] + ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
new file mode 100644
index 000000000..8344fdf59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c
@@ -0,0 +1,42 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic" } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 16
+
+#if __INT_MAX__ == 32767
+typedef char half_word;
+#elif __LONG_MAX__ == 2147483647
+typedef short half_word;
+#else
+typedef int half_word;
+#endif
+
+half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+int main ()
+{
+ int i;
+ half_word ia[N];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] & ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != (ib[i] & ic[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c
new file mode 100644
index 000000000..50dea9cb3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c
@@ -0,0 +1,34 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 16
+
+int main ()
+{
+ int i;
+ char ia[N];
+ char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+ /* Not vectorizable, multiplication */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] * ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != (char) (ib[i] * ic[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c
new file mode 100644
index 000000000..f3ada9944
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c
@@ -0,0 +1,42 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 16
+
+/* One x86_64 mingw a long remains 4 bytes sized, but machine word
+ is 8 bytes. */
+#if LONG_MAX == 2147483647 && !defined (_WIN64)
+typedef short half_word;
+#else
+typedef int half_word;
+#endif
+
+int main ()
+{
+ int i;
+ half_word ia[N];
+ half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+ /* Not worthwhile, only 2 parts per int */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] + ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i] + ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c
new file mode 100644
index 000000000..0888ecf59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c
@@ -0,0 +1,41 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic" } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 16
+
+#if __INT_MAX__ == 32767
+typedef char half_word;
+#elif __LONG_MAX__ == 2147483647
+typedef short half_word;
+#else
+typedef int half_word;
+#endif
+
+half_word cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+int main ()
+{
+ half_word ca[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
new file mode 100644
index 000000000..85bbc0b76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c
@@ -0,0 +1,59 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic" } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 128
+
+#if __LONG_MAX__ == 2147483647
+typedef short half_word;
+#else
+typedef int half_word;
+#endif
+
+int main_1 (int n, int *p)
+{
+ int i;
+ half_word ib[N];
+ half_word ia[N];
+ int k;
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = n;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != n)
+ abort ();
+ }
+
+ k = *p;
+ for (i = 0; i < N; i++)
+ {
+ ib[i] = k;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ib[i] != k)
+ abort ();
+ }
+
+ return 0;
+}
+
+static volatile int n = 1;
+
+int main (void)
+{
+ return main_1 (n + 2, (int *) &n);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c
new file mode 100644
index 000000000..dadeb073d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c
@@ -0,0 +1,35 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic" } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 128
+
+/* unaligned store. */
+
+int main ()
+{
+ int i;
+ char ia[N+1];
+
+ for (i = 1; i <= N; i++)
+ {
+ ia[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c
new file mode 100644
index 000000000..f314b28d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c
@@ -0,0 +1,43 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic" } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fvect-cost-model=dynamic -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 128
+#define OFF 3
+
+/* unaligned store. */
+
+int main_1 (int off)
+{
+ int i;
+ char ia[N+OFF];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i+off] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i+off] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+static volatile int off = 1;
+
+int main (void)
+{
+ return main_1 (off);
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c
new file mode 100644
index 000000000..1b7101125
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c
@@ -0,0 +1,34 @@
+/* { dg-do run { target vect_cmdline_needed } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fno-vect-cost-model" } */
+/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+
+#include <stdlib.h>
+
+#define N 16
+
+int main ()
+{
+ struct {
+ char ca[N];
+ } s;
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-33.c
new file mode 100644
index 000000000..8cd12da3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-33.c
@@ -0,0 +1,14 @@
+/* Compiler generates 64-bit stores of zero for this on some targets.
+ Check there is no problem for such case. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+void
+foo (float *dest, int xcount, int ycount)
+{
+ int x, y;
+
+ for (y = 0; y < ycount; y++)
+ for (x = 0; x < xcount; x++)
+ dest[x + y] = (float) 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c
new file mode 100644
index 000000000..e7b13b540
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize -fdump-tree-ifcvt-stats" { target *-*-* } } */
+
+#include <stdarg.h>
+
+#define N 16
+#define MAX 42
+
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+
+extern void abort(void);
+
+int main1 ()
+{
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ {
+ j = A[i];
+ A[i] = ( j >= MAX ? MAX : 0);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (A[i] > MAX)
+ abort ();
+ }
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "ifcvt" } } */
+/* { dg-final { cleanup-tree-dump "ifcvt" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c
new file mode 100644
index 000000000..f37a4d336
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize -fdump-tree-ifcvt-stats" { target *-*-* } } */
+
+void foo(const int * __restrict__ zr_in,
+ const int * __restrict__ zi_in,
+ const int * __restrict__ zk_in,
+ int * __restrict__ zr_out,
+ int * __restrict__ zi_out,
+ int * __restrict__ zk_out,
+ int cr, int ci)
+{
+ unsigned int pi;
+ int tmp_r, tmp_i, tmp_k;
+#if __SIZEOF_INT__ >= 4
+ for (pi = 0; pi < (512)*(512); pi++) {
+#else
+ for (pi = 0; pi < (32)*(32); pi++) {
+#endif
+ int zr = zr_in[pi];
+ int zi = zi_in[pi];
+ int zk = zk_in[pi];
+
+ if (zr*zr + zi*zi >= 4) {
+ tmp_r = zr;
+ tmp_i = zi;
+ tmp_k = zk;
+ } else {
+ tmp_r = (zr*zr - zi*zi + cr);
+ tmp_i = (2 * zr * zi + ci);
+ tmp_k = zk + 1;
+ }
+ zr_out[pi] = tmp_r;
+ zi_out[pi] = tmp_i;
+ zk_out[pi] = tmp_k;
+ }
+}
+
+
+/* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "ifcvt" } } */
+/* { dg-final { cleanup-tree-dump "ifcvt" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-3.c
new file mode 100644
index 000000000..e853ec4df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-3.c
@@ -0,0 +1,12 @@
+/* PR 20994 */
+/* { dg-do compile } */
+int foo(double* p, double* q)
+{
+ int i=0;
+
+ for (; q!=p; ++q)
+ if (*q)
+ ++i;
+
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-4.c
new file mode 100644
index 000000000..beb1a0e60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-4.c
@@ -0,0 +1,53 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize -fdump-tree-ifcvt-stats" { target *-*-* } } */
+
+struct ht
+{
+ void * (*alloc_subobject) (int);
+};
+typedef struct cpp_reader cpp_reader;
+typedef struct cpp_token cpp_token;
+typedef struct cpp_macro cpp_macro;
+enum cpp_ttype
+{
+ CPP_PASTE,
+};
+struct cpp_token {
+ __extension__ enum cpp_ttype type : 8;
+} cpp_comment_table;
+struct cpp_macro {
+ union cpp_macro_u
+ {
+ cpp_token * tokens;
+ } exp;
+ unsigned int count;
+};
+struct cpp_reader
+{
+ struct ht *hash_table;
+};
+create_iso_definition (cpp_reader *pfile, cpp_macro *macro)
+{
+ unsigned int num_extra_tokens = 0;
+ {
+ cpp_token *tokns =
+ (cpp_token *) pfile->hash_table->alloc_subobject (sizeof (cpp_token)
+ * macro->count);
+ {
+ cpp_token *normal_dest = tokns;
+ cpp_token *extra_dest = tokns + macro->count - num_extra_tokens;
+ unsigned int i;
+ for (i = 0; i < macro->count; i++)
+ {
+ if (macro->exp.tokens[i].type == CPP_PASTE)
+ *extra_dest++ = macro->exp.tokens[i];
+ else
+ *normal_dest++ = macro->exp.tokens[i];
+ }
+ }
+ }
+}
+
+/* This cannot be if-converted because the stores are to aggregate types. */
+/* { dg-final { scan-tree-dump-times "Applying if-conversion" 0 "ifcvt" } } */
+/* { dg-final { cleanup-tree-dump "ifcvt" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c
new file mode 100644
index 000000000..a9cc8168e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-5.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize -fdump-tree-ifcvt-stats" { target *-*-* } } */
+
+void
+dct_unquantize_h263_inter_c (short *block, int n, int qscale, int nCoeffs)
+{
+ int i, level, qmul, qadd;
+
+ qadd = (qscale - 1) | 1;
+ qmul = qscale << 1;
+
+ for (i = 0; i <= nCoeffs; i++)
+ {
+ level = block[i];
+ if (level < 0)
+ level = level * qmul - qadd;
+ else
+ level = level * qmul + qadd;
+ block[i] = level;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "ifcvt" } } */
+/* { dg-final { cleanup-tree-dump "ifcvt" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-6.c
new file mode 100644
index 000000000..a9c5db387
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-6.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize" { target *-*-* } } */
+
+static int x;
+foo (int n, int *A)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ if (A[i])
+ x = 2;
+ if (A[i + 1])
+ x = 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-7.c
new file mode 100644
index 000000000..4d26dc765
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-7.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize" { target *-*-* } } */
+
+typedef struct eqn_d
+{
+ int *coef;
+} *eqn;
+typedef struct omega_pb_d
+{
+ eqn subs;
+} *omega_pb;
+
+omega_pb omega_solve_problem (omega_pb);
+
+omega_pb
+omega_solve_geq (omega_pb pb, int n)
+{
+ int i, e;
+ int j = 0;
+
+ for (e = n - 1; e >= 0; e--)
+ if (pb->subs[e].coef[i] != pb->subs[e].coef[j])
+ {
+ pb->subs[e].coef[i] = j;
+ pb->subs[e].coef[j] = i;
+ }
+
+ return omega_solve_problem (pb);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr44710.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr44710.c
new file mode 100644
index 000000000..d4a1be8f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr44710.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O2 -ftree-vectorize" { target *-*-* } } */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define N 64
+float arr[N];
+
+__attribute__ ((noinline))
+int foo (unsigned int n, float *min)
+{
+ unsigned int pos = 1;
+ unsigned int i;
+ float limit = N+N;
+
+ for (i = 0; i < N; i++)
+ if (arr[i] < limit)
+ {
+ pos = i + 1;
+ limit = arr[i];
+ }
+
+ *min = limit;
+ return pos;
+}
+
+int main (void)
+{
+ int i, pos;
+ float min;
+
+ for (i = 0; i < N; i++)
+ arr[i] = (float)(i);
+
+ arr[2] = -5.8;
+
+ pos = foo (N, &min);
+ if (pos != 3 || min != arr[2])
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr47271.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr47271.c
new file mode 100644
index 000000000..bf3607946
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr47271.c
@@ -0,0 +1,49 @@
+/* { dg-options "-O3" } */
+/* { dg-do run } */
+
+extern void abort (void);
+
+void func (void)
+{
+ int i;
+ int nops;
+ char *codestr =
+ "|\000\000Ee\000\000Z\001\000d\000\000Z\002\000d\025\000Z\003\000"
+ "\t\t\t\t\t\t\t\t\t\t\t\td\026\000Z\004\000d\005\000\204\000\000Z"
+ "\005\000e\006\000e\a\000j\005\000e\b\000d\006\000\204\002\000\203"
+ "\001\000Z\t\000d\a\000\204\000\000Z\n\000d\b\000\204\000\000Z\v\000d"
+ "\t\000\204\000\000Z\f\000d\n\000\204\000\000Z\r\000e\016\000e\017\000d"
+ "\v\000\203\001\000d\f\000d\r\000\203\001\001Z\020\000e\016\000e\017"
+ "\000d\016\000\203\001\000d\f\000d\017\000\203\001\001Z\021\000e\016"
+ "\000e\017\000d\020\000\203\001\000d\f\000d\021\000\203\001\001Z\022"
+ "\000e\016\000e\017\000d\022\000\203\001\000d\f\000d\023\000\203\001"
+ "\001Z\023\000d\024\000S";
+ int codelen = 209;
+ int addrmap[500];
+
+ for (i=0, nops=0 ; i<codelen ; i += ((codestr[i] >= 90) ? 3 : 1))
+ {
+ addrmap[i] = i - nops;
+ if (codestr[i] == 9)
+ nops++;
+ }
+
+ if (addrmap[0] != 0
+ || addrmap[3] != 3
+ || addrmap[4] != 4
+ || addrmap[7] != 7
+ || addrmap[10] != 10
+ || addrmap[13] != 13
+ || addrmap[16] != 16
+ || addrmap[19] != 19
+ || addrmap[22] != 22
+ || addrmap[23] != 22
+ || addrmap[24] != 22)
+ abort ();
+}
+
+int main ()
+{
+ func ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c
new file mode 100644
index 000000000..030181404
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+
+typedef struct {
+ double min;
+ double max;
+} interval;
+inline interval add(interval x, interval y) __attribute__((always_inline));
+inline interval add(interval x, interval y)
+{
+ interval r;
+ r.min = x.min + y.min;
+ r.max = x.max + y.max;
+ return r;
+}
+interval foo (interval a, interval b, interval c)
+{
+ return add (a, add (b, c));
+}
+
+
+/* { dg-final { scan-tree-dump-times "\\(struct interval\\)" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-10.c
new file mode 100644
index 000000000..1d7aeef2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-10.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-optimized -fno-partial-inlining" } */
+void do_something1(void);
+void do_something2(void);
+void do_something3(void);
+void do_something4(void);
+void do_something5(void);
+void do_something_big(int);
+
+int do_something (int size)
+{
+ if (__builtin_constant_p (size))
+ switch (size)
+ {
+ case 1:do_something1 (); break;
+ case 2:do_something2 (); break;
+ case 5:do_something1 (); do_something1 ();
+ case 3:do_something3 (); break;
+ case 4:do_something4 (); break;
+ }
+ else
+ do_something_big (size);
+}
+extern int n;
+main()
+{
+ do_something (2);
+ do_something (3);
+ do_something (5);
+ do_something (70);
+}
+/* All calls should be inlined, except for do_something (5). */
+/* { dg-final { scan-tree-dump-not "do_something1" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "do_something2" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "do_something3" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "do_something \\(5\\)" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-not "do_something \\(70\\)" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c
new file mode 100644
index 000000000..7d45ec135
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-11.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-O2 -fdump-tree-einline" } */
+int w;
+int bar (void) __attribute__ ((weak));
+int bar (){
+ w++;
+}
+void foo()
+{
+ bar();
+}
+/* { dg-final { scan-tree-dump-times "function body can be overwritten at link time" 1 "einline" } } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c
new file mode 100644
index 000000000..72b61c369
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-2.c
@@ -0,0 +1,17 @@
+/* { dg-do link } */
+/* { dg-options "-O" } */
+
+/* When optimized we expect the call to foo () in bar to be inlined
+ and the call to link_error optimized away. */
+
+extern void link_error (void);
+inline int __attribute__((always_inline)) foo(void) { return 0; }
+
+int main()
+{
+ int (*fn)(void) = foo;
+ if (fn())
+ link_error ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
new file mode 100644
index 000000000..35c3ebbda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-einline --param max-early-inliner-iterations=2" } */
+/* { dg-add-options bind_pic_locally } */
+
+extern void inlined ();
+void inline_me_too (void);
+void inline_through_me (void (*ptr)(void));
+void
+inline_me (void)
+{
+ inlined();
+}
+
+void main(void)
+{
+ inline_through_me (inline_me);
+ inline_through_me (inline_me_too);
+}
+void
+inline_through_me (void (*ptr)(void))
+{
+ ptr();
+}
+
+void
+inline_me_too (void)
+{
+ inlined();
+}
+/* { dg-final { scan-tree-dump-times "Inlining inline_me " 1 "einline"} } */
+/* { dg-final { scan-tree-dump-times "Inlining inline_me_too " 1 "einline"} } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c
new file mode 100644
index 000000000..1e700ef02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-4.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-einline" } */
+/* { dg-add-options bind_pic_locally } */
+
+extern int rand(void);
+
+int get_data_for (int id)
+{
+ return rand();
+}
+
+int my_id;
+
+int main()
+{
+ int res = get_data_for (my_id);
+ switch (res)
+ {
+ case 0:
+ return 666;
+ default:
+ return -1;
+ }
+}
+
+/* { dg-final { scan-tree-dump "Inlining get_data_for into main" "einline" } } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-5.c
new file mode 100644
index 000000000..1a6faf4c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-5.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-optimized" } */
+struct a {int a,b,c,d,e,f;};
+
+do_inc (struct a *a)
+{
+ a->a=a->b;
+ a->b=a->c;
+ a->c=a->d;
+ a->e=a->f;
+}
+
+test(struct a *a)
+{
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+}
+/* { dg-final { scan-tree-dump-times "do_inc" 12 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-6.c
new file mode 100644
index 000000000..ae6c41f5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-6.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-optimized" } */
+struct a {int a,b,c,d,e,f,g,h,i,j;};
+
+do_inc (struct a *a)
+{
+ a->a=1;
+ a->b=2;
+ a->c=3;
+ a->e=4;
+ a->f=5;
+ a->g=5;
+ a->h=5;
+ a->i=5;
+ a->j=5;
+}
+
+test(struct a *a)
+{
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+ do_inc (a);
+ do_something (a);
+}
+/* { dg-final { scan-tree-dump-times "do_inc" 12 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-7.c
new file mode 100644
index 000000000..16c3c86bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-7.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-einline" } */
+
+void foo0();
+inline void bar0() { foo0(); }
+void foobar() { bar0(); bar0(); bar0(); }
+
+/* { dg-final { scan-tree-dump "Iterations: 1" "einline" } } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c
new file mode 100644
index 000000000..3215473ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O -finline-small-functions --param early-inlining-insns=0 -fdump-tree-einline" } */
+
+int foo0();
+void bar0() { foo0(); }
+void foobar0() { bar0(); }
+
+void foo1();
+void bar1() { foo1(); }
+void foobar1() { bar1(); }
+
+#if 0
+int foo2();
+int bar2() { return foo2(); }
+/* The size estimate fails to see that inlining the call statement in bar2
+ will make its lhs dead. */
+void foobar2() { bar2(); }
+#endif
+
+int foo3();
+int bar3() { return foo3(); }
+int foobar3() { return bar3(); }
+
+int bar4() { return 0; }
+void foobar4() { bar4(); }
+
+int bar5() { return 0; }
+int foobar5() { return bar5(); }
+
+/* { dg-final { scan-tree-dump-times "Inlining" 5 "einline" } } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-9.c
new file mode 100644
index 000000000..678dd852d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline-9.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-optimized -fno-partial-inlining" } */
+
+/* When optimizing for size, t should be inlined when it expands to one call only. */
+extern int q(int);
+int t(int a)
+{
+ if (a > 12)
+ {
+ q(a+5);
+ q(a+5);
+ }
+ else
+ q(a+10);
+}
+
+main()
+{
+ t(5);
+ t(20);
+}
+/* { dg-final { scan-tree-dump-times "q \\(15\\)" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "t \\(20\\)" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-1.c
new file mode 100644
index 000000000..0c84ed3fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-alias-vops" } */
+/* Test to make sure that inline-asm causes a VDEF and that we call test_function twice. */
+
+char test_function(void ) __attribute__((__pure__));
+char f(char *a)
+{
+ char b = test_function();
+ asm("":"=m"(*a):"r"(b));
+ b = test_function();
+ return b;
+}
+
+/* test_function should be called twice as the inline-asm changes memory. */
+/* { dg-final { scan-tree-dump-times "test_function" 2 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+/* There should a VDEF for the inline-asm. */
+/* { dg-final { scan-tree-dump-times "VDEF" 1 "alias"} } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c
new file mode 100644
index 000000000..6b347c41e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-alias-vops" } */
+/* Test to make sure that inline-asm causes a VDEF. */
+
+
+void link_error();
+void f(char *a)
+{
+ int *a1 = (int *)a;
+ if (*a == 0)
+ asm("":"=m"(*a1));
+ if (*a == 0)
+ link_error ();
+}
+
+/* There should a VDEF for the inline-asm and one for the link_error. */
+/* { dg-final { scan-tree-dump-times "VDEF" 2 "alias"} } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c
new file mode 100644
index 000000000..b102a7a52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/integer-addr.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fno-strict-aliasing" } */
+/* Test with fixed address */
+static int *foo = (int *) (unsigned long) 0x7800000;
+
+int func(void) __attribute__ ((noinline));
+
+extern int bar(void);
+
+int func(void)
+{
+ if (*foo) {
+ return 1;
+ }
+ return 0;
+
+}
+
+int foobar(void)
+{
+
+ if (func()) {
+ *foo = 1;
+ }
+ return func();
+}
+
+/* { dg-final { scan-tree-dump-times "= func" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
new file mode 100644
index 000000000..ec628b777
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
+/* { dg-add-options bind_pic_locally } */
+
+int
+very_long_function(int a)
+{
+ if (a > 0)
+ return 2 * a + very_long_function (a)/4;
+ else
+ return 2 * -a + very_long_function (a)/4;
+}
+
+blah ()
+{
+ very_long_function (1);
+}
+/* One appearance for dump, one self recursive call and one call from main. */
+/* { dg-final { scan-tree-dump-times "very_long_function.constprop \\(\\)" 3 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-reference-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-reference-1.c
new file mode 100644
index 000000000..c15a8b609
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-reference-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static int conststaticvariable;
+
+int f(void)
+{
+ return conststaticvariable;
+}
+
+/* There should be no reference to conststaticvariable as we should have
+ inlined the 0 as IPA reference should have marked the variable as a const
+ as it is not set in the IR. */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-1.c
new file mode 100644
index 000000000..a31e8ea7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-fnsplit" } */
+int test2(a)
+{
+ if (a<100)
+ return 1;
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ do_something_big ();
+ return 0;
+}
+
+test()
+{
+ test2(10);
+ test2(20);
+}
+/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-2.c
new file mode 100644
index 000000000..bbde73d6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-2.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-fnsplit" } */
+int b;
+int c;
+int d;
+split_me(int a)
+{
+ int t = 0;
+ if (d>4)
+ return;
+ do
+ {
+ long_function (t);
+ long_function (t);
+ long_function (t);
+ long_function (t);
+ long_function (t);
+ long_function (t);
+ make_me_irregular:
+ long_function (t);
+ long_function (t);
+ long_function (t);
+ long_function (t);
+ long_function (t);
+ t=b;
+ }
+ while (t);
+ if (c)
+ goto make_me_irregular;
+}
+
+main()
+{
+ split_me (1);
+ split_me (2);
+ split_me (3);
+ split_me (4);
+ split_me (5);
+}
+/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-3.c
new file mode 100644
index 000000000..05a37f810
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-3.c
@@ -0,0 +1,21 @@
+int baz (void);
+static int
+foo (int x)
+{
+ if (__builtin_expect (x <= 0, 0))
+ {
+ __builtin_printf ("foo\n");
+ __builtin_printf ("foo\n");
+ __builtin_printf ("foo\n");
+ __builtin_abort ();
+ }
+ return 6;
+}
+
+int a,b,c;
+
+int
+bar (int x)
+{
+ return foo (a) + foo (b) + foo (c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-4.c
new file mode 100644
index 000000000..9d5864bad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-4.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-fnsplit" } */
+int make_me_big (void);
+void abort (void);
+
+int
+split_me (int a)
+{
+ if (__builtin_expect(a<10, 1))
+ {
+ abort ();
+ }
+ else
+ {
+ make_me_big ();
+ make_me_big ();
+ make_me_big ();
+ make_me_big ();
+ return a+1;
+ }
+}
+
+int
+test(void)
+{
+ return split_me (0)+split_me(1)+split_me(2);
+}
+/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
new file mode 100644
index 000000000..8fc1244e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
@@ -0,0 +1,37 @@
+/* { dg-do compile { target nonpic } } */
+/* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized --param=builtin-expect-probability=100" } */
+
+struct a {int a,b;};
+struct a make_me_big (int a);
+struct a split_me (int a)
+{
+ struct a retval;
+ if (__builtin_expect (a!=0,1))
+ {
+ retval.a = 0;
+ retval.b = 0;
+ return retval;
+ }
+ else
+ {
+ struct a retval = make_me_big (a);
+ retval = make_me_big (a);
+ retval = make_me_big (a);
+ retval = make_me_big (a);
+ retval = make_me_big (a);
+ retval = make_me_big (a);
+ return retval;
+ }
+}
+int val;
+test()
+{
+ split_me (val);
+ split_me (val);
+ split_me (val);
+ split_me (val);
+}
+/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
+/* { dg-final { scan-tree-dump "part" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c
new file mode 100644
index 000000000..fcdf79d70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c
@@ -0,0 +1,10 @@
+/* PR tree-optimization/52019 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-tree-sra -fdump-tree-fnsplit -fdump-tree-optimized --param=builtin-expect-probability=100" } */
+
+#include "ipa-split-5.c"
+
+/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
+/* { dg-final { scan-tree-dump "part" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c
new file mode 100644
index 000000000..f1f3101d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c
@@ -0,0 +1,60 @@
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-isolate-paths" } */
+
+
+struct demangle_component
+{
+
+ int type;
+ int zzz;
+
+};
+
+
+struct d_info
+{
+ struct demangle_component *comps;
+ int next_comp;
+ int num_comps;
+};
+
+
+static struct demangle_component *
+d_make_empty (struct d_info *di)
+{
+ struct demangle_component *p;
+
+ if (di->next_comp >= di->num_comps)
+ return ((void *)0);
+ p = &di->comps[di->next_comp];
+ return p;
+}
+
+
+
+struct demangle_component *
+d_type (struct d_info *di)
+{
+ struct demangle_component *ret;
+ ret = d_make_empty (di);
+ ret->type = 42;
+ ret->zzz = -1;
+ return ret;
+}
+
+/* We're testing three aspects of isolation here. First that isolation
+ occurs, second that if we have two null dereferences in a block that
+ that we delete everything from the first dereferece to the end of the
+ block, regardless of which comes first in the immediate use iterator
+ and finally that we set the RHS of the store to zero. */
+/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */
+/* { dg-final { scan-tree-dump-times "->type = 42" 1 "isolate-paths"} } */
+/* { dg-final { scan-tree-dump-times "->type ={v} 0" 1 "isolate-paths"} } */
+/* { dg-final { scan-tree-dump-times "->zzz" 1 "isolate-paths"} } */
+/* { dg-final { cleanup-tree-dump "isolate-paths" } } */
+
+
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-2.c
new file mode 100644
index 000000000..bfcaa2b01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-2.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fisolate-erroneous-paths-attribute -fdump-tree-isolate-paths -fdump-tree-phicprop1" } */
+
+
+int z;
+int y;
+
+int * foo(int a) __attribute__((returns_nonnull));
+int * bar(void) __attribute__((returns_nonnull));
+
+int *
+foo(int a)
+
+{
+ switch (a)
+ {
+ case 0:
+ return &z;
+ default:
+ return (int *)0;
+ }
+}
+
+
+int *
+bar (void)
+{
+ return 0;
+}
+
+/* We testing that the path isolation code can take advantage of the
+ returns non-null attribute to isolate a path where NULL flows into
+ a return statement. We test this twice, once where the NULL flows
+ from a PHI, the second with an explicit return 0 in the IL.
+
+ We also verify that after isolation phi-cprop simplifies the
+ return statement so that it returns &z directly.
+/* { dg-final { scan-tree-dump-times "__builtin_trap" 2 "isolate-paths"} } */
+/* { dg-final { scan-tree-dump-times "return &z;" 1 "phicprop1"} } */
+/* { dg-final { cleanup-tree-dump "isolate-paths" } } */
+/* { dg-final { cleanup-tree-dump "phicprop1" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c
new file mode 100644
index 000000000..7dddd8062
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c
@@ -0,0 +1,65 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-isolate-paths" } */
+
+
+typedef long unsigned int size_t;
+extern void *memset (void *__s, int __c, size_t __n)
+ __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
+struct rtx_def;
+typedef struct rtx_def *rtx;
+typedef struct VEC_rtx_base
+
+{
+ unsigned num;
+ unsigned alloc;
+ rtx vec[1];
+} VEC_rtx_base;
+static __inline__ rtx *
+VEC_rtx_base_address (VEC_rtx_base * vec_)
+{
+ return vec_ ? vec_->vec : 0;
+}
+typedef struct VEC_rtx_gc
+{
+ VEC_rtx_base base;
+} VEC_rtx_gc;
+
+static __inline__ void
+VEC_rtx_gc_safe_grow (VEC_rtx_gc ** vec_, int size_, const char *file_,
+ unsigned line_, const char *function_)
+{
+ ((*vec_) ? &(*vec_)->base : 0)->num = size_;
+}
+
+static __inline__ void
+VEC_rtx_gc_safe_grow_cleared (VEC_rtx_gc ** vec_, int size_,
+ const char *file_, unsigned line_,
+ const char *function_, int oldsize)
+{
+ VEC_rtx_gc_safe_grow (vec_, size_, file_, line_, function_);
+ memset (&(VEC_rtx_base_address ((*vec_) ? &(*vec_)->base : 0))[oldsize], 0,
+ sizeof (rtx) * (size_ - oldsize));
+}
+
+static VEC_rtx_gc *reg_base_value;
+void
+init_alias_analysis (void)
+{
+ unsigned int maxreg = max_reg_num ();
+ (VEC_rtx_gc_safe_grow_cleared
+ (&(reg_base_value), maxreg, "../../../gcc-4.6.0/gcc/alias.c", 2755,
+ __FUNCTION__, arf ()));
+}
+
+
+
+/* This is an example of how a NULL pointer dereference can show up
+ without a PHI. Note VEC_rtx_gcc_safe_grow. If an earlier pass
+ (such as VRP) isolates the NULL path for some reason or another
+ we end up with an explicit NULL dereference in the IL. Yes, it
+ started with a PHI, but by the time the path isolation code runs
+ its explicit in the IL. */
+/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */
+/* { dg-final { cleanup-tree-dump "isolate-paths" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-4.c
new file mode 100644
index 000000000..c9c074df6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-4.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fisolate-erroneous-paths-attribute -fdump-tree-isolate-paths -fdump-tree-phicprop1" } */
+
+
+extern void foo(void *) __attribute__ ((__nonnull__ (1)));
+
+int z;
+
+void
+com (int a)
+{
+ foo (a == 42 ? &z : (void *) 0);
+}
+
+void
+bar (void)
+{
+ foo ((void *)0);
+}
+
+/* We testing that the path isolation code can take advantage of the
+ returns non-null attribute to isolate a path where NULL flows into
+ a return statement.
+
+ We also verify that after isolation phi-cprop simplifies the
+ return statement so that it returns &z directly.
+/* { dg-final { scan-tree-dump-times "__builtin_trap" 2 "isolate-paths"} } */
+/* { dg-final { scan-tree-dump-times "foo .&z.;" 1 "phicprop1"} } */
+/* { dg-final { cleanup-tree-dump "isolate-paths" } } */
+/* { dg-final { cleanup-tree-dump "phicprop1" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c
new file mode 100644
index 000000000..4d01d5c63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-isolate-paths -fdump-tree-optimized" } */
+
+struct demangle_component
+{
+
+ int type;
+ int zzz;
+
+};
+
+struct d_info
+{
+ struct demangle_component *comps;
+ int next_comp;
+ int num_comps;
+};
+
+static struct demangle_component *
+d_make_empty (struct d_info *di)
+{
+ struct demangle_component *p;
+
+ if (di->next_comp >= di->num_comps)
+ return ((void *)0);
+ p = &di->comps[di->next_comp];
+ return p;
+}
+
+struct demangle_component *
+d_type (struct d_info *di)
+{
+ struct demangle_component *ret;
+ ret = d_make_empty (di);
+ foo (ret->type);
+ bar (ret->zzz);
+ return ret;
+}
+
+/* We're testing two aspects of isolation here. First that isolation
+ occurs, second that if we have two null dereferences in a block that
+ that we delete everything from the first dereferece to the end of the
+ block, regardless of which comes first in the immediate use iterator.
+
+ We leave the 0->type in the IL, so expect to see ->type twice. */
+/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */
+/* { dg-final { scan-tree-dump-times "->type" 2 "isolate-paths"} } */
+/* { dg-final { scan-tree-dump-times "->type" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "\\.type" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "->zzz" 1 "isolate-paths"} } */
+/* { dg-final { cleanup-tree-dump "isolate-paths" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c
new file mode 100644
index 000000000..74b73da68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts" } */
+#define TYPE char*
+
+/* Testing that only one induction variable is selected after IVOPT on
+ the given target instead of 3. */
+void foo (int i_width, TYPE dst, TYPE src1, TYPE src2)
+{
+ int x;
+ for( x = 0; x < i_width; x++ )
+ {
+ dst[x] = ( src1[x] + src2[x] + 1 ) >> 1;
+ }
+}
+
+
+/* { dg-final { scan-tree-dump-times "ivtmp.\[0-9_\]* = PHI <" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c
new file mode 100644
index 000000000..f27b90072
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts" } */
+
+#define TYPE char*
+
+/* Testing on the given target, only one iv candidate instead of 3. */
+void foo (int i_width, TYPE dst, TYPE src1, TYPE src2)
+{
+ int x;
+ for( x = 0; x < i_width; x++ )
+ {
+ *dst++ = ( *src1++ + *src2++ + 1 ) >> 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "ivtmp.\[0-9_\]* = PHI <" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_3.c
new file mode 100644
index 000000000..b548e8f0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_3.c
@@ -0,0 +1,20 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts" } */
+
+#define TYPE char*
+
+/* Make sure only 1 iv candidate is selected after IVOPT. */
+void foo (int i_width, char* dst, char* src1, char* src2)
+{
+ int x;
+ for( x = 0; x < i_width; x++ )
+ {
+ *((TYPE)dst) = ( *((TYPE)src1) + *((TYPE)src2) + 1 ) >> 1;
+ dst+=sizeof(TYPE);
+ src1+=sizeof(TYPE);
+ src2+=sizeof(TYPE);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "ivtmp.\[0-9_\]* = PHI <" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c
new file mode 100644
index 000000000..330b3bf53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c
@@ -0,0 +1,19 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts" } */
+
+#ifndef TYPE
+#define TYPE char*
+#endif
+
+/* Make sure only 1 iv candidate is selected. */
+void foo (int i_width, TYPE dst, TYPE src1, TYPE src2)
+{
+ TYPE dstn= dst + i_width;
+ for( ; dst < dstn; )
+ {
+ *dst++ = ( *src1++ + *src2++ + 1 ) >> 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "ivtmp.\[0-9_\]* = PHI <" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_1.c
new file mode 100644
index 000000000..076f5118e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */
+
+#ifndef TYPE
+#define TYPE char*
+#endif
+
+int a[400];
+
+/* Testing inferred loop iteration from array -- exit test can be replaced. */
+void foo (int i_width, TYPE dst, TYPE src1, TYPE src2)
+{
+ TYPE dstn= dst + i_width;
+ TYPE dst0 = dst;
+ unsigned long long i = 0;
+ for( ; dst <= dstn; )
+ {
+ dst0[i] = ( src1[i] + src2[i] + 1 +a[i]) >> 1;
+ dst++;
+ i += 16;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Replacing" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_2.c
new file mode 100644
index 000000000..c0f6398d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_infer_2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */
+
+#ifndef TYPE
+#define TYPE char*
+#endif
+
+extern char a[];
+
+/* Can not infer loop iteration from array -- exit test can not be
+ replaced by the array address. */
+void foo (unsigned int i_width, TYPE dst)
+{
+ unsigned long long i = 0;
+ unsigned long long j = 0;
+ for ( ; j < i_width; )
+ {
+ *dst = a[i];
+ dst++;
+ i += 2;
+ j += 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "\[^:\]*if \\(.*j_\[0-9\]+.*\\)" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_1.c
new file mode 100644
index 000000000..4e19dfd01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */
+
+/* The test 'if (p2 > p_limit2)' can be replaced, so iv p2 can be
+ * eliminated. */
+long foo(long* p, long* p2, int N1, int N2)
+{
+ int i = 0;
+ long* p_limit = p + N1;
+ long* p_limit2 = p2 + N2;
+ long s = 0;
+ while (p <= p_limit)
+ {
+ p++;
+ p2++;
+ if (p2 > p_limit2)
+ break;
+ s += (*p);
+ }
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times "Replacing" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_2.c
new file mode 100644
index 000000000..5e38df67b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */
+
+/* Exit tests 'i < N1' and 'p2 > p_limit2' can be replaced, so
+ * two ivs i and p2 can be eliminate. */
+long foo(long* p, long* p2, int N1, int N2)
+{
+ int i = 0;
+ long* p_limit2 = p2 + N2;
+ long s = 0;
+ while (i < N1)
+ {
+ p++;
+ p2++;
+ i++;
+ if (p2 > p_limit2)
+ break;
+ s += (*p);
+ }
+
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times "Replacing" 2 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_3.c
new file mode 100644
index 000000000..25ae845f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_3.c
@@ -0,0 +1,22 @@
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */
+
+/* iv p2 can be eliminated. */
+long foo(long* p, long* p2, int N1, int N2)
+{
+ unsigned long i = 0;
+ long* p_limit2 = p2 + N2;
+ long s = 0;
+ while (i < N1)
+ {
+ p2++;
+ i++;
+ if (p2 > p_limit2)
+ break;
+ s += p[i];
+ }
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times "Replacing exit test: if \\(.*p2.*\\)" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c
new file mode 100644
index 000000000..d2aa78d61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c
@@ -0,0 +1,25 @@
+
+/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */
+
+/* iv i's step 16 so its period is smaller than the max iterations
+ * i.e. replacing if (p2 > p_limit2) with testing of i may result in
+ * overflow. */
+long foo(long* p, long* p2, int N1, int N2)
+{
+ unsigned long i = 0;
+ long* p_limit2 = p2 + N2;
+ long s = 0;
+ while (i < N1)
+ {
+ p2++;
+ i += 16;
+ if (p2 > p_limit2)
+ break;
+ s += p[i];
+ }
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times "Replacing" 0 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-1.c
new file mode 100644
index 000000000..44f1b628f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+/* Not all platforms support TImode integers. */
+#if (defined(__LP64__) && !defined(__hppa__)) || defined(__SPU__)
+typedef int TItype __attribute__ ((mode (TI)));
+#else
+typedef long TItype;
+#endif
+
+TItype last_data_offset ;
+int store;
+char *data;
+
+f ()
+{
+
+ TItype data_offset = last_data_offset;
+ char *p;
+
+ for (p = data; *p; p++)
+ {
+ data_offset++;
+ g (data_offset);
+ store = data_offset + 1;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-2.c
new file mode 100644
index 000000000..369f082e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ivopts-details" } */
+
+long last_data_offset;
+int store;
+char *data;
+
+f ()
+{
+
+ long data_offset = last_data_offset;
+ char *p;
+
+ for (p = data; *p; p++)
+ {
+ data_offset++;
+ g (data_offset);
+ store = data_offset + 1;
+ }
+}
+
+/* We should only have two IVs. */
+/* { dg-final { scan-tree-dump-not "\\n candidates \\d+, \\d+,\[^\\n\]*\\n\[^\\n\]*\\nFinal cost" "ivopts" } } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-3.c
new file mode 100644
index 000000000..202ad1f4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ivopts-details" } */
+
+void main (void)
+{
+ int i;
+ for (i = 0; i < 10; i++)
+ f2 ();
+}
+
+/* { dg-final { scan-tree-dump-times "!= 0" 5 "ivopts" } } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c
new file mode 100644
index 000000000..908015239
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+void foo(int *p, long i, int j)
+{
+ do {
+ p[i]++;
+ } while (i += j);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c
new file mode 100644
index 000000000..5188fed2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ivopts" } */
+/* { dg-require-effective-target stdint_types } */
+
+#include "stdint.h"
+
+void
+f1 (char *p, uintptr_t i, uintptr_t n)
+{
+ p += i;
+ do
+ {
+ *p = '\0';
+ p += 1;
+ i++;
+ }
+ while (i < n);
+}
+
+/* { dg-final { scan-tree-dump-times "PHI" 1 "ivopts" } } */
+/* { dg-final { scan-tree-dump-times "PHI <p_" 1 "ivopts"} } */
+/* { dg-final { scan-tree-dump-times "p_\[0-9\]* <" 1 "ivopts" } } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-1.c
new file mode 100644
index 000000000..43c104665
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-1.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+void foo (int * __restrict__ ia,
+ int * __restrict__ ib,
+ int * __restrict__ oxa,
+ int * __restrict__ oxb,
+ int * __restrict__ oya,
+ int * __restrict__ oyb)
+{
+ int i;
+ long int mya[52];
+ long int myb[52];
+
+ for (i=0; i < 52; i++)
+ {
+ mya[i] = ia[i] * oxa[i] + ib[i] * oxb[i];
+ myb[i] = -ia[i] * oxb[i] + ib[i] * oxa[i];
+ oya[i] = mya[i] >> 10;
+ oyb[i] = myb[i] >> 10;
+ }
+
+ /* This loop was distributed, but it is not anymore due to the cost
+ model changes: the result of a distribution would look like this:
+
+ | for (i=0; i < 52; i++)
+ | oya[i] = ia[i] * oxa[i] + ib[i] * oxb[i] >> 10;
+ |
+ | for (i=0; i < 52; i++)
+ | oyb[i] = -ia[i] * oxb[i] + ib[i] * oxa[i] >> 10;
+
+ and in this the array IA is read in both tasks. For maximizing
+ the cache reuse, ldist does not distributes this loop anymore.
+ */
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-10.c
new file mode 100644
index 000000000..0790c18a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-10.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int loop1 (int k)
+{
+ unsigned int i;
+ int a[1000], b[1000], c[1000];
+
+ for (i = 1; i < 1000; i ++)
+ {
+ a[i] = c[i]; /* S1 */
+ b[i] = a[i-1]+1; /* S2 */
+ }
+ /* Dependences:
+ S1->S2 (flow, level 1)
+
+ One partition as A is used in both S1 and S2.
+ */
+
+ return a[1000-2] + b[1000-1] + c[1000-2];
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-11.c
new file mode 100644
index 000000000..902c25b15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-11.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-all" } */
+
+void foo (int * __restrict__ ia,
+ int * __restrict__ ib,
+ int * __restrict__ oxa,
+ int * __restrict__ oxb,
+ int * __restrict__ oya,
+ int * __restrict__ oyb)
+{
+ int i;
+ long int mya[52];
+ long int myb[52];
+
+ for (i=0; i < 52; i++)
+ {
+ mya[i] = ia[i] * oxa[i] + ib[i] * oxb[i];
+ myb[i] = -ia[i] * oxb[i] + ib[i] * oxa[i];
+ oya[i] = 0;
+ oyb[i] = myb[i] >> 10;
+ }
+
+ /* This loop should be distributed, and the result should look like
+ this:
+ | memset (oya, 0, 208);
+ | for (i=0; i < 52; i++)
+ | oyb[i] = -ia[i] * oxb[i] + ib[i] * oxa[i] >> 10;
+ */
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 1 loops and 1 library calls" 1 "ldist" } } */
+/* { dg-final { scan-tree-dump-times "generated memset zero" 1 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-12.c
new file mode 100644
index 000000000..1e555fe26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-12.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int foo (int * __restrict__ ia,
+ int * __restrict__ ib,
+ int * __restrict__ oxa,
+ int * __restrict__ oxb)
+{
+ int i;
+ int oya[52], oyb[52];
+
+ for (i=0; i < 52; i++)
+ {
+ oya[i] = (ia[i] * oxa[i]) >> 10;
+ oyb[i] = (ib[i] * oxb[i]) >> 10;
+ }
+
+ return oya[22] + oyb[21];
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 1 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-13.c
new file mode 100644
index 000000000..984156954
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-13.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-details" } */
+
+float * __restrict__ x;
+float * __restrict__ y;
+
+float foo (int n)
+{
+ int i;
+ float tmp = 0.0;
+ for (i = 0; i < n; ++i)
+ {
+ x[i] = 0.0;
+ tmp += y[i];
+ }
+ return tmp;
+}
+
+/* We should apply loop distribution. */
+
+/* { dg-final { scan-tree-dump "Loop 1 distributed: split to 2 loops" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c
new file mode 100644
index 000000000..700599f1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-14.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -ftree-loop-distribution -fdump-tree-ldist-details" } */
+
+struct desc {
+ int i;
+ void * __restrict__ data;
+ int j;
+} a, b;
+
+float foo (int n)
+{
+ int i;
+ float * __restrict__ x, * __restrict__ y, tmp = 0.0;
+ x = (float * __restrict__)a.data;
+ y = (float * __restrict__)b.data;
+ for (i = 0; i < n; ++i)
+ {
+ x[i] = 0.0;
+ tmp += y[i];
+ }
+ return tmp;
+}
+
+/* We should apply loop distribution. */
+
+/* { dg-final { scan-tree-dump "Loop 1 distributed: split to 2 loops" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-15.c
new file mode 100644
index 000000000..7ce3b956b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-15.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-ldist-details" } */
+
+int x[1000];
+
+void foo (int n)
+{
+ int i;
+
+ for (i = 0; i < n; ++i)
+ {
+ x[2*i] = 0;
+ x[2*i + 1] = 1;
+ }
+}
+
+/* We should not apply loop distribution as it is not beneficial from
+ a data locality point of view. Also it is not possible to generate
+ a memset (0) as the write has a stride of 2. */
+
+/* { dg-final { scan-tree-dump-not "distributed: split to" "ldist" } } */
+/* { dg-final { scan-tree-dump-not "__builtin_memset" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-16.c
new file mode 100644
index 000000000..53a9fa4f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-16.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-ldist-details" } */
+
+int x[1000];
+
+void foo (int n)
+{
+ int i;
+
+ for (i = 0; i < n; ++i)
+ {
+ x[i] = 0;
+ x[2*i + 1] = 1;
+ }
+}
+
+/* We should not apply loop distribution and not generate a memset (0). */
+
+/* { dg-final { scan-tree-dump "Loop 1 is the same" "ldist" } } */
+/* { dg-final { scan-tree-dump-times "generated memset zero" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c
new file mode 100644
index 000000000..bbf54db2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-17.c
@@ -0,0 +1,50 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details -fdisable-tree-cunroll -fdisable-tree-cunrolli" } */
+
+typedef int mad_fixed_t;
+struct mad_pcm
+{
+ unsigned int samplerate;
+ unsigned short channels;
+ unsigned short length;
+ mad_fixed_t samples[2][1152];
+};
+struct mad_synth
+{
+ mad_fixed_t filter[2][2][2][16][8];
+ unsigned int phase;
+ struct mad_pcm pcm;
+};
+void mad_synth_mute (struct mad_synth *synth);
+void
+mad_synth_mute (struct mad_synth *synth)
+{
+ unsigned int ch;
+ unsigned int s;
+ unsigned int v;
+
+ ch = 0U;
+ while (ch < 2U)
+ {
+ s = 0U;
+ while (s < 16U)
+ {
+ v = 0U;
+ while (v < 8U)
+ {
+ synth->filter[ch][1][1][s][v] = 0;
+ synth->filter[ch][1][0][s][v] = 0;
+ synth->filter[ch][0][1][s][v] = 0;
+ synth->filter[ch][0][0][s][v] = 0;
+ v++;
+ }
+ s++;
+ }
+ ch++;
+ }
+ return;
+}
+
+/* { dg-final { scan-tree-dump "distributed: split to 0 loops and 4 library calls" "ldist" } } */
+/* { dg-final { scan-tree-dump-times "generated memset zero" 4 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c
new file mode 100644
index 000000000..893ab8b70
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-18.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
+
+void foo (int *p, int n)
+{
+ int i;
+ for (i = 0; i < n; ++i)
+ p[i] = 0;
+}
+
+/* { dg-final { scan-tree-dump "generated memset zero" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c
new file mode 100644
index 000000000..8ea9ceaef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-19.c
@@ -0,0 +1,71 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-ldist-details" } */
+
+struct Foo
+{
+ char a;
+};
+
+struct Foo x[256];
+
+static void __attribute__((noinline,noclone))
+foo()
+{
+ int i;
+ for (i = 0; i < 256; ++i)
+ x[i] = (struct Foo){};
+}
+
+static void __attribute__((noinline,noclone))
+bar()
+{
+ int i;
+ for (i = 0; i < 256; ++i)
+ x[i].a = 1;
+}
+
+static void __attribute__((noinline,noclone))
+foobar(unsigned char c)
+{
+ int i;
+ for (i = 0; i < 256; ++i)
+ x[i].a = c;
+}
+
+static void __attribute__((noinline,noclone))
+foobar2(char c)
+{
+ int i;
+ for (i = 0; i < 256; ++i)
+ x[i].a = c;
+}
+
+struct Baz
+{
+ short a;
+};
+
+struct Baz y[256];
+
+static void __attribute__((noinline,noclone))
+baz()
+{
+ int i;
+ for (i = 0; i < 256; ++i)
+ y[i].a = -1;
+}
+
+int main()
+{
+ volatile int x;
+ foo();
+ bar();
+ foobar(x);
+ foobar2(x);
+ baz();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "generated memset zero" 1 "ldist" } } */
+/* { dg-final { scan-tree-dump-times "generated memset" 5 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-1a.c
new file mode 100644
index 000000000..623aacfdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-1a.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int foo (int * __restrict__ ia,
+ int * __restrict__ ib,
+ int * __restrict__ oxa,
+ int * __restrict__ oxb)
+{
+ int i;
+ int oya[52], oyb[52];
+
+ for (i=0; i < 52; i++)
+ {
+ oya[i] = (ia[i] * oxa[i] + ib[i] * oxb[i]) >> 10;
+ oyb[i] = (-ia[i] * oxb[i] + ib[i] * oxa[i]) >> 10;
+ }
+
+ return oya[22] + oyb[21];
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-2.c
new file mode 100644
index 000000000..de98ccc4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-2.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+void foo (int * __restrict__ a,
+ int * __restrict__ b,
+ int * __restrict__ c)
+{
+ int i;
+
+ for (i=1; i < 10; i++)
+ {
+ a[i] += c[i];
+ b[i] = a[i - 1] + 1;
+ }
+
+ /* This loop is not distributed because the cost of spliting it:
+
+ | for (i=1; i < N; i++)
+ | a[i] += c[i];
+ |
+ | for (i=1; i < N; i++)
+ | b[i] = a[i - 1] + 1;
+
+ is higher due to data in array A that is written and then read in
+ another task. The cost model should forbid the transformation in
+ this case.
+ */
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-20.c
new file mode 100644
index 000000000..95ae2c04c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-20.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
+
+void foo(char *);
+void my_memcpy (void *q, unsigned int n)
+{
+ unsigned i;
+ char p[1024];
+ for (i = 0; i < n; ++i)
+ ((char *)p)[i] = ((char *)q)[i];
+ foo(p);
+}
+
+struct S { int i; int j; };
+
+void my_memcpy2 (void *q, unsigned int n)
+{
+ unsigned i;
+ char p[1024];
+ for (i = 0; i < n; ++i)
+ ((struct S *)p)[i] = ((struct S *)q)[i];
+ foo(p);
+}
+
+char p[1024];
+void my_memmove (unsigned int n)
+{
+ unsigned i;
+ for (i = 0; i < n; ++i)
+ p[i] = p[i+1];
+ foo(p);
+}
+
+
+/* { dg-final { scan-tree-dump-times "generated memcpy" 2 "ldist" } } */
+/* { dg-final { scan-tree-dump-times "generated memmove" 1 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-21.c
new file mode 100644
index 000000000..5401dcf04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-21.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-ldist-details" } */
+
+void bar(char *p, int n)
+{
+ int i;
+ for (i = 1; i < n; i++)
+ p[i-1] = p[i];
+}
+
+/* { dg-final { scan-tree-dump "generated memmove" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-22.c
new file mode 100644
index 000000000..afc792f65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-22.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fdump-tree-ldist-details" } */
+
+extern void abort (void);
+
+int a[1024], b[1024];
+
+void __attribute__((noinline,noclone))
+foo (void)
+{
+ int i;
+ for (i = 0; i < 1024; ++i)
+ {
+ a[i] = 0;
+ if (i > 100)
+ b[i] = i;
+ }
+}
+
+int main()
+{
+ b[100] = 1;
+ foo ();
+ if (b[100] != 1 || b[101] != 101)
+ abort ();
+ if (a[0] != 0 || a[101] != 0)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "generated memset zero" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-23.c
new file mode 100644
index 000000000..0e7609bdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-23.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fdump-tree-ldist-details" } */
+
+extern void abort (void);
+
+int a[128], b[128], c[128], d[128];
+
+void __attribute__((noinline,noclone))
+foo (void)
+{
+ int i;
+ for (i = 0; i < 128; ++i)
+ {
+ a[i] = a[i] + 1;
+ b[i] = d[i];
+ c[i] = a[i] / d[i];
+ }
+}
+int main()
+{
+ int i;
+ for (i = 0; i < 128; ++i)
+ a[i] = i;
+ for (i = 0; i < 128; ++i)
+ d[i] = 1;
+ foo ();
+ if (c[0] != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "split to 1 loops and 1 library call" "ldist" } } */
+/* { dg-final { scan-tree-dump "generated memcpy" "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-3.c
new file mode 100644
index 000000000..40adfe1a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-3.c
@@ -0,0 +1,34 @@
+/* { dg-do compile { target int32plus } } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int loop1 (int k)
+{
+ unsigned int i;
+ int a[10000], b[10000], c[10000], d[10000];
+
+ a[0] = k; a[3] = k*2;
+ c[1] = k+1;
+ for (i = 2; i < (10000-1); i ++)
+ {
+ a[i] = k * i; /* S1 */
+ b[i] = a[i-2] + k; /* S2 */
+ c[i] = b[i] + a[i+1]; /* S3 */
+ d[i] = c[i-1] + k + i; /* S4 */
+ }
+ /*
+ Dependences:
+ S1 -> S2 (flow, level 1)
+ S1 -> S3 (anti, level 1)
+ S2 -> S3 (flow, level 0)
+ S3 -> S4 (flow, level 1)
+
+ There are three partitions: {S1, S3}, {S2} and {S4}.
+
+ The cost model should fuse together all the partitions, as they
+ are reusing the same data, ending on a single partition.
+ */
+ return a[10000-2] + b[10000-1] + c[10000-2] + d[10000-2];
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 3 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-4.c
new file mode 100644
index 000000000..80626bdac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-4.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int loop1 (int k)
+{
+ unsigned int i;
+ unsigned int j;
+ int a[100], b[100][100];
+
+ a[0] = k;
+ for (i = 1; i < 100; i ++)
+ {
+ for (j = 1; j < 100; j++)
+ {
+ a[j] = k * i;
+ b[i][j] = a[j-1] + k;
+ }
+ }
+
+ return b[100-1][1];
+}
+
+/* The current cost model fuses the two partitions because they have
+ similar memory accesses. */
+/* { dg-final { scan-tree-dump "similar memory accesses" "ldist" } } */
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-5.c
new file mode 100644
index 000000000..9a03dc171
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-5.c
@@ -0,0 +1,33 @@
+/* { dg-do compile { target int32plus } } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int loop1 (int k)
+{
+ unsigned int i;
+ unsigned int j;
+ int a[100][100], b[100][100], c[100][100], d[100][100];
+
+ a[0][0] = k;
+ for (i = 1; i < 100; i ++)
+ for (j = 1; j < (100-1); j++)
+ {
+ a[i][j] = k * i; /* S1 */
+ b[i][j] = a[i][j-1] + k; /* S2 */
+ c[i][j] = b[i][j] + a[i][j+1]; /* S3 */
+ d[i][j] = c[i][j] + k + i; /* S4 */
+ }
+ /* Dependences:
+ S1->S2 (flow, level 2)
+ S1->S3 (anti, level 2)
+ S2->S3 (flow, level 0)
+ S3->S4 (flow, level 0)
+ */
+
+ return a[100-1][100-1] + b[100-1][100-1] + c[100-1][100-1] + d[100-1][100-1];
+}
+
+/* FIXME: This is XFAILed because of a data dependence analysis
+ problem: the dependence test fails with a "don't know" relation. */
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 1 "ldist" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-6.c
new file mode 100644
index 000000000..7a38c8683
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-6.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int loop1 (int k)
+{
+ unsigned int i;
+ int a[1000], b[1000], c[1000], d[1000];
+
+ for (i = 2; i < (1000-1); i ++) {
+ a[i] = k * i; /* S1 */
+ b[i] = a[i-2] + k; /* S2 */
+ c[i] = b[i-1] + a[i+1]; /* S3 */
+ d[i] = c[i-1] + k + i; /* S4 */
+ }
+ /* Dependences:
+ S1->S2 (flow, level 1)
+ S2->S3 (flow, level 1)
+ S3->S1 (anti, level 1)
+ S3->S4 (flow, level 1)
+
+ There are two partitions: {S1, S2, S3} and {S4}.
+
+ {S1, S2, S3} have to be in the same partition because:
+ - S1 (i) has to be executed before S2 (i+2), as S1 produces a[i] that is then consumed 2 iterations later by S2.
+ - S2 (i) has to be executed before S3 (i+1), as S2 produces b[i] that is then consumed one iteration later by S3,
+ - S3 (i) has to be executed before S1 (i+1), as a[i+1] has to execute before the update to a[i],
+
+ {S4} is the consumer partition: it consumes the values from array "c" produced in S3.
+
+ The cost model should fuse all the tasks together as the cost of
+ fetching data from caches is too high.
+ */
+
+ return a[1000-2] + b[1000-1] + c[1000-2] + d[1000-2];
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-7.c
new file mode 100644
index 000000000..124fcdedd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-7.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int loop1 (int k)
+{
+ unsigned int i, z;
+ int a[1000], b[1000], c[1000], d[1000];
+
+ for (i = 2; i < (1000-1); i ++) {
+ z = a[i+1]; /* S1 */
+ a[i] = k * i; /* S2 */
+ b[i] = a[i-2] + k; /* S3 */
+ c[i] = b[i-1] + z; /* S4 */
+ d[i] = c[i-1] + b[i+1] + k + i; /* S5 */
+ }
+ /* Dependences:
+ S1->S2 (anti, level 1)
+ S1->S4 (flow, level 1, scalar)
+ S2->S3 (flow, level 1)
+ S3->S4 (flow, level 1)
+ S4->S5 (flow, level 1)
+ S5->S3 (anti, level 1)
+
+ There is a single partition: {S1, S2, S3, S4, S5}, because of the
+ scalar dependence z between the two partitions {S1, S2} and {S3, S4, S5}.
+ */
+
+ return a[1000-2] + b[1000-1] + c[1000-2] + d[1000-2];
+}
+
+/* { dg-final { scan-tree-dump-times "distributed" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-8.c
new file mode 100644
index 000000000..4a8e06600
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-8.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int loop1 (int k)
+{
+ unsigned int i;
+ int a[1000], b[1000], c[1000], d[1000];
+
+ for (i = 2; i < (1000-1); i ++)
+ {
+ a[i] = k * i; /* S1 */
+ b[i] = a[i+1] + k; /* S2 */
+ c[i] = a[i-1] + b[i-1] + d[i-1]; /* S3 */
+ d[i] = a[i-1] + b[i+1] + k + i; /* S4 */
+ }
+ /* Dependences:
+ S1->S2 (anti, level 1)
+ S1->S3 (flow, level 1)
+ S1->S4 (flow, level 1)
+ S2->S3 (flow, level 1)
+ S2->S4 (anti, level 1)
+ S4->S3 (flow, level 1)
+
+ Two partitions: {S1, S2, S4} produce information that is consumed in {S3}.
+
+ So that means that the current cost model will also fuse these
+ two partitions into a single one for avoiding cache misses.
+ */
+
+ return a[1000-2] + b[1000-1] + c[1000-2] + d[1000-2];
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-9.c
new file mode 100644
index 000000000..ee8d023de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-9.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+int loop1 (int k)
+{
+ unsigned int i;
+ int a[1000], b[1000];
+
+ for (i = 1; i < (1000-1); i ++) {
+ a[i] = a[i+1] + a[i-1]; /* S1 */
+ b[i] = a[i-1] + k; /* S2 */
+ }
+ /*
+ Dependences:
+ S1->S2 (flow, level 1)
+ S1->S1 (anti, level 1)
+ S1->S1 (flow, level 1)
+
+ One partition, because of the cost of cache misses.
+ */
+
+ return a[1000-2] + b[1000-1];
+}
+
+/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948-2.c
new file mode 100644
index 000000000..aecb49f1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fno-tree-scev-cprop" } */
+
+extern void bar(int);
+
+void
+foo (int i, int n)
+{
+ int a[30];
+ int b[30];
+ for (; i < n; i++)
+ a[i] = b[i] = 0;
+
+ while (1)
+ if (b[0])
+ bar (a[i - 1]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c
new file mode 100644
index 000000000..f25a91064
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
+
+extern void bar(int);
+
+void
+foo (int i, int n)
+{
+ int a[30];
+ int b[30];
+ for (; i < n; i++)
+ a[i] = b[i] = 0;
+
+ while (1)
+ if (b[0])
+ bar (a[i - 1]);
+}
+
+/* We should apply loop distribution and generate 2 memset (0). */
+
+/* { dg-final { scan-tree-dump "distributed: split to 0 loops and 2 library calls" "ldist" } } */
+/* { dg-final { scan-tree-dump-times "generated memset zero" 2 "ldist" } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/leaf.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/leaf.c
new file mode 100644
index 000000000..936523a93
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/leaf.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+static int local_static;
+void __attribute__ ((leaf)) leaf_call (void);
+
+int
+clobber_it (void)
+{
+ return local_static++;
+}
+int
+test (void)
+{
+ local_static = 9;
+ leaf_call ();
+ return local_static;
+}
+/* { dg-final { scan-tree-dump-times "return 9" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c
new file mode 100644
index 000000000..ce78f02c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int foo(int *a, int argc)
+{
+ int c;
+ int d, e;
+
+ /* Should be able to eliminate the second load of *a along the main path. */
+ d = *a;
+ if (argc)
+ {
+ a = &c;
+ }
+ e = *a;
+ return d + e;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c
new file mode 100644
index 000000000..4147a702a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre10.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+struct tree_common
+{
+ int code;
+};
+union tree_node
+{
+ struct tree_common common;
+};
+typedef union tree_node *tree;
+
+extern tree test (tree, int, int);
+extern tree foo (void);
+extern void abort (void) __attribute__ ((__noreturn__));
+
+/* Redundant loads of expr->common.code */
+tree
+test (tree expr, int t, int D17630)
+{
+ int __i;
+
+L0:
+ if (expr->common.code != 142) goto L23; else goto L2;
+
+L2:
+ __i = 0;
+ goto L10;
+
+L10:
+ __i = __i + 1;
+ if (D17630 != __i) goto L8; else goto L19;
+
+L8:
+ if (t) goto L15; else goto L10;
+
+L15:
+ expr = foo ();
+ if (expr->common.code != 142) goto L23; else goto L0;
+
+L19:
+ abort ();
+
+L23:
+ return expr;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre11.c
new file mode 100644
index 000000000..eb6089c4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre11.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats -fno-tree-cselim" } */
+int *t;
+int g(int);
+int f(int tt)
+{
+ int *t1 = t;
+ if (*t1)
+ *t1 = 2;
+ return g(*t1);
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre12.c
new file mode 100644
index 000000000..94a3d00bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre12.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+type *t;
+int g(int);
+int f(int tt)
+{
+ type *t1 = t;
+ if ((*t1)[0])
+ (*t1)[0] = 2;
+ return g((*t1)[0]);
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre13.c
new file mode 100644
index 000000000..420ad7162
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre13.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int t[2];
+int g(int);
+int f(int tt)
+{
+ if (t[0])
+ t[0] = 2;
+ return g(t[0]);
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre14.c
new file mode 100644
index 000000000..11bfd0060
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre14.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int foo(type *a, int argc)
+{
+ type c = {0, 1};
+ int d, e;
+
+ /* Should be able to eliminate the second load of *a along the main path. */
+ d = (*a)[0];
+ if (argc)
+ {
+ a = &c;
+ }
+ e = (*a)[0];
+ return d + e;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre15.c
new file mode 100644
index 000000000..b04c7621b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre15.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int foo(type *a, int argc, int t)
+{
+ type c = {0, 1};
+ int d, e;
+
+ /* Should be able to eliminate the second load of *a along the main path. */
+ d = (*a)[t];
+ if (argc)
+ {
+ a = &c;
+ }
+ e = (*a)[t];
+ return d + e;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre16.c
new file mode 100644
index 000000000..193ae52d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre16.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int foo(type *a, int argc)
+{
+ int d, e;
+
+ /* Should be able to eliminate the second load of *a along the main path. */
+ d = (*a)[0];
+ if (argc)
+ a++;
+ e = (*a)[0];
+ return d + e;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre17.c
new file mode 100644
index 000000000..ec0f6ec2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre17.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int foo(type *a, int argc)
+{
+ int d, e;
+
+ /* Should be able to eliminate the second load of *a along the main path. */
+ d = (*a)[argc];
+ if (argc)
+ a++;
+ e = (*a)[argc];
+ return d + e;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre18.c
new file mode 100644
index 000000000..21a1d0670
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre18.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int main(type *a, int argc)
+{
+ int d, e;
+
+ /* Should be able to eliminate the second load of *a along the main path. */
+ d = (*a)[argc];
+ if (argc)
+ argc++;
+ e = (*a)[argc];
+ return d + e;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre19.c
new file mode 100644
index 000000000..0ad8988f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre19.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int foo(type *a, int argc)
+{
+ int d, e;
+
+ /* Should be able to eliminate the second load of *a along the main path. */
+ d = (*a)[argc];
+ if (!d)
+ argc++;
+ e = (*a)[argc];
+ return e;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre2.c
new file mode 100644
index 000000000..8d6557a9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int main(int *a, int argc)
+{
+ int b;
+ int i;
+ int d, e;
+
+ /* Should be able to hoist this out of the loop. */
+ for (i = 0; i < argc; i++)
+ {
+ e = *a;
+ }
+ return d + e;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre20.c
new file mode 100644
index 000000000..92a235325
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre20.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int foo(type *a, int argc)
+{
+ int d, e;
+
+ /* Should be able to eliminate the second load of *a along the main path. */
+ d = (*a)[argc];
+ if (!d)
+ a++;
+ e = (*a)[argc];
+ return e;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre21.c
new file mode 100644
index 000000000..77caef6de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre21.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int main(type *a, int argc)
+{
+ int b;
+ int i;
+ int d, e;
+
+ /* Should be able to hoist this out of the loop. */
+ for (i = 0; i < argc; i++)
+ {
+ e = (*a)[0];
+ }
+ return d + e;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre22.c
new file mode 100644
index 000000000..3c03c9b12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre22.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef int type[2];
+int main(type *a, int argc)
+{
+ int b;
+ int i;
+ int d, e;
+
+ /* Should be able to hoist this out of the loop. */
+ for (i = 0; i < argc; i++)
+ {
+ e = (*a)[argc];
+ }
+ return d + e;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c
new file mode 100644
index 000000000..2273accba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre23.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+struct {
+ int a;
+ int large[100];
+} x;
+
+int foo(int argc)
+{
+ int b;
+ int c;
+ int i;
+ int d, e;
+
+ for (i = 0; i < argc; i++)
+ {
+ e = x.a;
+ x.a = 9;
+ }
+ return d + e;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c
new file mode 100644
index 000000000..31fcc9f8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre24.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+int a;
+
+int foo(int argc)
+{
+ int b;
+ int c;
+ int i;
+ int d, e;
+
+ for (i = 0; i < argc; i++)
+ {
+ e = a;
+ a = 9;
+ }
+ return d + e;
+}
+
+/* We will move the load of a out of the loop. */
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c
new file mode 100644
index 000000000..aaf09313e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre25.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+struct X { int i; };
+int foo(struct X *a, int argc)
+{
+ int b;
+ int c;
+ int i;
+ int d, e;
+
+ for (i = 0; i < argc; i++)
+ {
+ e = a->i;
+ a->i = 9;
+ }
+ return d + e;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c
new file mode 100644
index 000000000..4bda8f644
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre3.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int foo(int **a,int argc)
+{
+ int b;
+ int d, e;
+
+ if (argc)
+ {
+ d = *(*a);
+ }
+ else
+ {
+
+ }
+ /* Should be able to eliminate one of the *(*a)'s along the if path
+ by pushing it into the else path. We will also eliminate
+ one of the *a's. */
+ e = *(*a);
+ return d + e;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c
new file mode 100644
index 000000000..1e2660317
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre4.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int main(int *a, int argc)
+{
+ int b;
+ int c;
+ int i;
+ int d, e;
+
+ for (i = 0; i < argc; i++)
+ {
+ e = *a;
+ *a = 9;
+ }
+ return d + e;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre5.c
new file mode 100644
index 000000000..475050a6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre5.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int p;
+int r;
+
+__attribute__ ((noinline))
+static int a(void)
+{
+ return p;
+}
+int foo(int argc)
+{
+ int q;
+ q = a();
+
+ /* We should be able to move the call to a into the if path.
+ in a perfect world, we'd actually decide that it can't touch
+ r, and not recompute it at all!. */
+ if (argc)
+ r = 9;
+ return q + a();
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
new file mode 100644
index 000000000..bcd72c5ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
@@ -0,0 +1,80 @@
+/* { dg-do compile { target nonpic } } */
+/* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1" } */
+#include <stddef.h>
+
+union tree_node;
+typedef union tree_node *tree;
+
+struct tree_common
+{
+ tree chain;
+};
+
+struct tree_list
+{
+ struct tree_common common;
+ tree value;
+};
+
+union tree_node
+
+{
+ struct tree_common common;
+ struct tree_list list;
+};
+
+extern void abort (void) __attribute__((noreturn));
+
+void __attribute__((noinline))
+foo (void)
+{
+ abort ();
+}
+
+/* There are some reloaded loads of *cell, and cell->common.chain on various
+ branches. */
+void __attribute__((noinline))
+remove_useless_vars (tree *unexpanded_var_list, int dump_file)
+{
+ tree var, *cell;
+ int c = 0;
+ for (cell = unexpanded_var_list; *cell; )
+ {
+ var = (*cell)->list.value;
+ if (var)
+ {
+ if (dump_file)
+ foo ();
+
+ *cell = ((*cell)->common.chain);
+ continue;
+ }
+
+ cell = &((*cell)->common.chain);
+ }
+}
+extern void *malloc (__SIZE_TYPE__) __attribute__ ((malloc));
+
+int
+main (void)
+{
+ int i;
+ tree unexpanded_var_list, last = (tree) 0;
+
+ for (i = 0; i < 2; i++)
+ {
+ unexpanded_var_list = malloc (sizeof (struct tree_list));
+ unexpanded_var_list->list.value = (tree) (ptrdiff_t) (i & 1);
+ unexpanded_var_list->common.chain = last;
+ last = unexpanded_var_list;
+ }
+
+ remove_useless_vars (&unexpanded_var_list, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "= unexpanded_var_list;" "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { scan-tree-dump-times "Insertions: 2" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
new file mode 100644
index 000000000..6f68f3ae2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+/* We can't eliminate the *p load here in any sane way, as eshup8 may
+ change it. */
+void
+enormlz (x)
+ unsigned short x[];
+{
+ register unsigned short *p;
+ p = &x[2];
+ while ((*p & 0xff00) == 0)
+ {
+ eshup8 (x);
+ }
+}
+/* { dg-final { scan-tree-dump-not "Eliminated:" "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c
new file mode 100644
index 000000000..056c3fd63
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c
@@ -0,0 +1,97 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+typedef union tree_node *tree;
+struct tree_common
+{
+ tree chain;
+}
+VEC_constructor_elt_base;
+struct tree_ssa_name
+{
+ tree var;
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_ssa_name ssa_name;
+};
+struct edge_def
+{
+ struct basic_block_def *dest;
+};
+typedef struct edge_def *edge;
+typedef struct VEC_edge_base
+{
+}
+VEC_edge_base;
+__attribute__ ((noinline)) static edge
+VEC_edge_base_index (const VEC_edge_base * vec_, unsigned ix_)
+{
+}
+typedef struct VEC_edge_gc
+{
+ VEC_edge_base base;
+}
+VEC_edge_gc;
+struct basic_block_def
+{
+ VEC_edge_gc *succs;
+};
+typedef struct basic_block_def *basic_block;
+typedef struct
+{
+ unsigned index;
+ VEC_edge_gc **container;
+}
+edge_iterator;
+__inline__ VEC_edge_gc *
+ei_container (edge_iterator i)
+{
+ return *i.container;
+}
+__inline__ edge_iterator
+ei_start_1 (VEC_edge_gc ** ev)
+{
+ edge_iterator i;
+ i.container = ev;
+ return i;
+}
+__attribute__ ((noinline)) static ei_next (edge_iterator * i)
+{
+}
+static __inline__ edge
+ei_edge (edge_iterator i)
+{
+ return (edge) (VEC_edge_base_index ((((ei_container (i))) ? &((ei_container (i)))->base : 0), (i.index)));
+}
+static __inline__ unsigned char
+ei_cond (edge_iterator ei, edge * p)
+{
+ *p = ei_edge (ei);
+}
+typedef tree *def_operand_p;
+extern tree *get_phi_result_ptr (tree);
+static __inline__ tree
+get_def_from_ptr (def_operand_p def)
+{
+}
+__attribute__ ((noinline)) static tree
+phi_nodes (basic_block bb)
+{
+}
+
+/* We can eliminate a load of the SRA'd variable edge_iterator.container */
+rewrite_add_phi_arguments (basic_block bb)
+{
+ edge e;
+ edge_iterator ei;
+ for ((ei) = ei_start_1 (&((bb->succs))); ei_cond ((ei), &(e));
+ ei_next (&(ei)))
+ {
+ tree phi;
+ for (phi = phi_nodes (e->dest); phi; phi = (((phi))->common.chain))
+ get_reaching_def ((get_def_from_ptr (get_phi_result_ptr (phi)))->ssa_name.var);
+ }
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
new file mode 100644
index 000000000..afb7ca4b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-local-pure-const1" } */
+/* { dg-add-options bind_pic_locally } */
+
+t(int a, int b, int c)
+{
+ int *p;
+ if (a)
+ p = &a;
+ else
+ p = &c;
+ return *p;
+}
+/* { dg-final { scan-tree-dump-times "local memory is OK" 1 "local-pure-const1"} } */
+/* { dg-final { scan-tree-dump-times "found to be const" 1 "local-pure-const1"} } */
+/* { dg-final { cleanup-tree-dump "local-pure-const1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
new file mode 100644
index 000000000..dd52c50fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
@@ -0,0 +1,59 @@
+/* { dg-do compile } */
+/* -mlongcall will cause us to place &foo in the CTR register. */
+/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
+/* { dg-options "-O1 -ftree-loop-ivcanon -funroll-loops -fdump-tree-ivcanon-details -fdump-tree-cunroll-details -fdump-tree-optimized" } */
+/* { dg-options "-O1 -ftree-loop-ivcanon -funroll-loops -fdump-tree-ivcanon-details -fdump-tree-cunroll-details -fdump-tree-optimized -mshort-calls" {target epiphany-*-*} } */
+
+
+/* On 31-bit S/390 the function address will be stored (once) in the literal pool,
+ so scan-assembler-times "foo" will return 1 even if the loop is fully unrolled.
+ -msmall-exec avoids this by enabling a call instruction with immediate operand. */
+/* { dg-options "-O1 -ftree-loop-ivcanon -funroll-loops -fdump-tree-ivcanon-details -fdump-tree-cunroll-details -fdump-tree-optimized -msmall-exec" { target s390-*-* } } */
+
+/* On Darwin, we call extern functions via a stub in PIC mode which is default and
+ the stub is named after the function. To avoid this we use -static to go out
+ of PIC mode. */
+/* { dg-options "-O1 -ftree-loop-ivcanon -funroll-loops -fdump-tree-ivcanon-details -fdump-tree-cunroll-details -fdump-tree-optimized -static" { target *-*-darwin* } } */
+
+/* On MIPS, disable generating hints (R_MIPS_JALR) for PIC calls. In addition
+ to the load from the GOT this also contains the name of the function so for
+ each call the function name would appear twice. */
+/* { dg-options "-O1 -ftree-loop-ivcanon -funroll-loops -fdump-tree-ivcanon-details -fdump-tree-cunroll-details -fdump-tree-optimized -mno-relax-pic-calls" { target mips*-*-* } } */
+__attribute__ ((pure))
+int foo (int x);
+int xxx(void)
+{
+ int x = 45;
+ int sum;
+
+ while (x >>= 1)
+ sum += foo (x) * 2;
+ return sum;
+}
+
+/* We should be able to find out that the loop iterates four times and unroll it completely. */
+
+/* { dg-final { scan-tree-dump-times "Added canonical iv to loop 1, 4 iterations" 1 "ivcanon"} } */
+/* { dg-final { cleanup-tree-dump "ivcanon" } } */
+/* { dg-final { scan-tree-dump-times "loop with 5 iterations completely unrolled" 1 "cunroll"} } */
+/* { dg-final { cleanup-tree-dump "cunroll" } } */
+/* { dg-final { scan-tree-dump-times "foo" 5 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+/* Because hppa, ia64 and Windows targets include an external declaration
+ for foo as well as the calls we need to look for something more specific
+ than just foo in order to count only the calls and not the declaration. */
+/* The SH targets always use separate instructions to load the address
+ and to do the actual call - bsr is only generated by link time
+ relaxation. */
+/* CRIS keeps the address in a register. */
+/* m68k sometimes puts the address in a register, depending on CPU and PIC. */
+
+/* { dg-final { scan-assembler-times "foo" 5 { xfail hppa*-*-* ia64*-*-* sh*-*-* cris-*-* crisv32-*-* fido-*-* m68k-*-* i?86-*-mingw* i?86-*-cygwin* x86_64-*-mingw* } } } */
+/* { dg-final { scan-assembler-times "foo,%r" 5 { target hppa*-*-* } } } */
+/* { dg-final { scan-assembler-times "= foo" 5 { target ia64*-*-* } } } */
+/* { dg-final { scan-assembler-times "call\[ \t\]*_foo" 5 { target i?86-*-mingw* i?86-*-cygwin* } } } */
+/* { dg-final { scan-assembler-times "call\[ \t\]*foo" 5 { target x86_64-*-mingw* } } } */
+/* { dg-final { scan-assembler-times "jsr|bsrf|blink\ttr?,r18" 5 { target sh*-*-* } } } */
+/* { dg-final { scan-assembler-times "Jsr \\\$r" 5 { target cris-*-* } } } */
+/* { dg-final { scan-assembler-times "\[jb\]sr" 5 { target fido-*-* m68k-*-* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-10.c
new file mode 100644
index 000000000..c8d118e37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-10.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
+
+int bar (void);
+
+void foo (void)
+{
+ unsigned i, j, n;
+
+ for (i = 0; i < 100000; i++)
+ ;
+
+ n = bar ();
+ for (i = 0; i < n; i++)
+ ;
+
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j++)
+ ;
+
+ /* These should not be removed. */
+ for (i = 0; i < 10000; i++)
+ bar ();
+
+ for (i = 0; i != n; i += 2)
+ ;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "bar " 2 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-11.c
new file mode 100644
index 000000000..d6c656f31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-11.c
@@ -0,0 +1,28 @@
+/* A test for final value replacement and higher-order ivs,
+ see PR 22442. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+void bar (unsigned);
+
+void foo (void)
+{
+ unsigned i, a;
+
+ for (i = 0; i < 5; i++)
+ a = i * i;
+
+ bar (a);
+}
+
+/* Final value of a gets replaced. */
+
+/* { dg-final { scan-tree-dump-times "\\(16\\)" 1 "optimized" } } */
+
+/* And the empty loop is removed. */
+
+/* { dg-final { scan-tree-dump-times "if " 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-14.c
new file mode 100644
index 000000000..987c7dea8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-14.c
@@ -0,0 +1,19 @@
+/* A test for final value replacement. */
+
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int foo(void);
+
+int bla(void)
+{
+ int i, j = foo ();
+
+ for (i = 0; i < 100; i++, j++)
+ foo ();
+
+ /* Should be replaced with return j0 + 100; */
+ return j;
+}
+
+/* { dg-final { scan-tree-dump-times "\\+ 100" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c
new file mode 100644
index 000000000..aa0747b6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-15.c
@@ -0,0 +1,27 @@
+/* A test for # of iterations analysis (signed counter cannot wrap) and final
+ value replacement. */
+
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int foo(void);
+
+int bla(void)
+{
+ int i, n = foo (), j;
+
+ j = 0;
+ /* The loop should be removed completely. */
+ for (i = 1; i <= n; i++)
+ j += n;
+
+ /* Should be replaced with return n * n; */
+ return j;
+}
+
+/* Since the loop is removed, there should be no addition. */
+/* { dg-final { scan-tree-dump-times "\\+" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "n_. \\* n_." 1 "optimized" } } */
+
+/* The if from the loop header copying remains in the code. */
+/* { dg-final { scan-tree-dump-times "if " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c
new file mode 100644
index 000000000..50fa33330
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c
@@ -0,0 +1,24 @@
+/* A test for # of iterations estimation. We know that the loop is executed
+ at most 100 times, thus the (32-bit) induction variables do not overflow,
+ and we may use 64-bit variable to represent them. */
+
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-do compile { target x86_64-*-* } } */
+
+unsigned a[100];
+
+void foo(unsigned n)
+{
+ unsigned i;
+
+ for (i = 0; i < n; i++)
+ a[i] = 4 * i;
+}
+
+/* Check that the memory reference was replaced with MEM, and that there is no
+ multiplication. */
+
+/* { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c
new file mode 100644
index 000000000..0e856d8d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-sccp-details" } */
+
+/* To determine the number of iterations in this loop we need to fold
+ p_4 + 4B > p_4 + 8B to false. This transformation has caused
+ troubles in the past due to overflow issues. */
+
+int foo (int *p)
+{
+ int i = 0, *x;
+
+ for (x = p; x < p + 2; x++)
+ i++;
+
+ return i;
+}
+
+/* { dg-final { scan-tree-dump "# of iterations 1, bounded by 1" "sccp" } } */
+/* { dg-final { cleanup-tree-dump "sccp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-18.c
new file mode 100644
index 000000000..ca75db941
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-18.c
@@ -0,0 +1,24 @@
+/* A test for # of iterations estimation. We know that I does not overflow,
+ thus we can perform strength reduction (even though the 32-bit variable
+ i is first extended to 64-bit type). */
+
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-do compile { target x86_64-*-* } } */
+
+unsigned bar(void);
+
+void foo(unsigned *p, unsigned n)
+{
+ unsigned i;
+
+ for (i = 0; i < n; i++)
+ p[i] = bar ();
+}
+
+/* Check that the memory reference was replaced with MEM, and that there is no
+ multiplication. */
+
+/* { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c
new file mode 100644
index 000000000..74b60a054
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c
@@ -0,0 +1,28 @@
+/* This tests strength reduction and choice of induction variables. The targets
+ for this testcase are quite limited, as with different set of available
+ addressing modes, the results may be quite different.
+
+ The testcase comes from PR 29256 (and originally, the stream benchmark). */
+
+/* { dg-do compile { target { i?86-*-* || { x86_64-*-* || powerpc_hard_double } } } } */
+/* { dg-require-effective-target nonpic } */
+/* { dg-options "-O3 -fno-tree-loop-distribute-patterns -fno-prefetch-loop-arrays -fdump-tree-optimized -fno-common" } */
+
+# define N 2000000
+double a[N],c[N];
+void tuned_STREAM_Copy()
+{
+ int j;
+ for (j=0; j<N; j++)
+ c[j] = a[j];
+}
+
+/* Check that the memory references are based on &a and &c, with appropriate
+ offsets. Ideally, we would want each of them to appear once in the output.
+ However, due to a bug in jump threading, we end up peeling one iteration from
+ the loop, which creates an additional occurrence. */
+
+/* { dg-final { scan-tree-dump-times "MEM.(base: &|symbol: )a," 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "MEM.(base: &|symbol: )c," 2 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-2.c
new file mode 100644
index 000000000..f43a6d8eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-2.c
@@ -0,0 +1,44 @@
+/* A test for strength reduction and induction variable elimination. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+/* { dg-require-effective-target size32plus } */
+
+/* Size of this structure should be sufficiently weird so that no memory
+ addressing mode applies. */
+
+struct bla
+{
+ char x[187];
+ int y;
+ char z[253];
+} arr_base[100];
+
+void xxx(void)
+{
+ int iter;
+
+ for (iter = 0; iter < 100; iter++)
+ arr_base[iter].y = 17 * iter;
+}
+
+/* Access to arr_base[iter].y should be strength reduced, i.e., there should
+ be no multiplication. */
+
+/* { dg-final { scan-tree-dump-times " \\* \[^\\n\\r\]*=" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[base" 1 "optimized" } } */
+
+/* 17 * iter should be strength reduced. */
+
+/* { dg-final { scan-tree-dump-times " \\* 17" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\+ 17" 1 "optimized" } } */
+
+/* The induction variable comparison with 99 should be eliminated
+ and replaced by comparison of one of the newly created ivs. */
+
+/* { dg-final { scan-tree-dump-times "iter" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= 99" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "< 100" 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-20.c
new file mode 100644
index 000000000..24524a02b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-20.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/29516 */
+
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O -ftree-vrp -fPIC -fdump-tree-ivopts" } */
+
+typedef struct gfc_se { int pre; } gfc_se;
+typedef struct gfc_ss_info { int dim[7]; } gfc_ss_info;
+int gfc_rank_cst[7 + 1];
+gfc_conv_array_transpose (gfc_se * se) {
+ int dest, src, dest_index, src_index;
+ gfc_ss_info *dest_info;
+ int n;
+ for (n = 0; n < 2; n++) {
+ dest_info->dim[n] = n;
+ src_index = gfc_rank_cst[1 - n];
+ a (se->pre, b (dest, dest_index), c (src, src_index));
+ }
+}
+
+/* Ivopts should not produce multiplication by a pointer constant. */
+
+/* { dg-final { scan-tree-dump-times "\\* \[0-9\]*B;" 0 "ivopts" } } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-21.c
new file mode 100644
index 000000000..f53407d9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-21.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/30322 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern void op( int, int);
+void foo(int f0, int f1, int e0, int e1)
+{
+ int i0, i1;
+
+ for (i1 = f1; i1 <= e1; ++i1)
+ for (i0 = f0; i0 <= e0; ++i0)
+ op(i0, i1);
+}
+
+/* { dg-final { scan-tree-dump-times "~" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-22.c
new file mode 100644
index 000000000..fa7da712b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-22.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int a[100];
+
+void test (int n)
+{
+ int i;
+
+ for (i = 0; i < n; i += 3)
+ a[i] = i;
+}
+
+/* We used to replace the exit test "i < n" by "i != ((n-1)/3) * 3 + 1". Although
+ correct, this transformation is obviously harmful. */
+
+/* { dg-final { scan-tree-dump-times "/" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-23.c
new file mode 100644
index 000000000..5bdc35fbd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-23.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-loops -fdump-tree-cunroll-details" } */
+
+__attribute__ ((pure))
+int bla(int);
+
+int foo(void)
+{
+ int i;
+ int sum;
+
+ /* This loop used to appear to be too large for unrolling. */
+ for (i = 0; i < 4; i++)
+ {
+ sum += bla (i);
+ sum += bla (2*i);
+ sum += bla (3*i);
+ sum += bla (4*i);
+ sum += bla (5*i);
+ sum += bla (6*i);
+ sum += bla (7*i);
+ sum += bla (8*i);
+ }
+ return sum;
+}
+
+/* { dg-final { scan-tree-dump-times "loop with 4 iterations completely unrolled" 1 "cunroll" } } */
+
+/* { dg-final { cleanup-tree-dump "cunroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-24.c
new file mode 100644
index 000000000..5632b0679
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-24.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstrict-overflow -fdump-tree-optimized" } */
+
+void foo(int a, int b)
+{ for(;a!=b;a+=4); }
+
+void foo2(int a, int b)
+{ for(;a<b;a+=4); }
+
+void foo3(int*a, int* b)
+{ for(;a<b;a++); }
+
+void foo4(int*a, int*b)
+{ for(;a!=b;a++); }
+
+/* { dg-final { scan-tree-dump-not "if" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-25.c
new file mode 100644
index 000000000..c2fb74e58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-25.c
@@ -0,0 +1,129 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-profile_estimate" } */
+
+int foo(void);
+void bla(void);
+void bar(void);
+
+void test1 (void)
+{
+ unsigned i;
+
+ /* Only one loop should be found here. */
+ i = 0;
+ while (1)
+ {
+ i++;
+ if (i == 100)
+ break;
+
+ if (foo ())
+ bla ();
+ else
+ bar ();
+ }
+}
+
+void test2 (void)
+{
+ unsigned i, j;
+
+ /* Two loops should be found, in this case. */
+ i = j = 0;
+ while (1)
+ {
+ j++;
+ foo ();
+ if (j < 100)
+ continue;
+
+ i++;
+ j = 0;
+ if (i == 100)
+ break;
+ }
+}
+
+void test3 (void)
+{
+ unsigned i, j, k;
+
+ /* Three loops. */
+ i = j = k = 0;
+ while (1)
+ {
+ j++;
+ foo ();
+ if (j < 100)
+ continue;
+
+ j = 0;
+ k++;
+ if (k < 100)
+ continue;
+
+ k = 0;
+ i++;
+ if (i == 100)
+ break;
+ }
+}
+
+void test4 (void)
+{
+ unsigned i, j, k;
+
+ /* Two loops with a nested subloop. */
+ i = j = 0;
+ while (1)
+ {
+ j++;
+ foo ();
+ for (k = 0; k < 100; k++)
+ foo ();
+
+ if (j < 100)
+ continue;
+
+ i++;
+ j = 0;
+ if (i == 100)
+ break;
+ }
+}
+
+
+void test5 (void)
+{
+ unsigned i, j;
+
+ /* Both subloop and non-subloop back edges. */
+ i = j = 0;
+ while (1)
+ {
+ j++;
+ foo ();
+ if (j < 100)
+ continue;
+ j = 0;
+
+ i++;
+ if (i == 100)
+ break;
+
+ if (foo ())
+ bla ();
+ else
+ bar ();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Disambiguating loop" 5 "profile_estimate" } } */
+/* For the following xfail marks, see PR35629. */
+/* { dg-final { scan-tree-dump-times "Found latch edge" 5 "profile_estimate" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Merged latch edges" 2 "profile_estimate" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "4 loops found" 2 "profile_estimate" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "3 loops found" 2 "profile_estimate" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "2 loops found" 1 "profile_estimate" { xfail *-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-26.c
new file mode 100644
index 000000000..f8bc8e010
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-26.c
@@ -0,0 +1,29 @@
+/* PR 30730, PR 26900, number of iterations analysis should be able to
+ determine number of iterations of the following loops unconditionally. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstrict-overflow -fdump-tree-optimized-blocks" } */
+
+unsigned foo(unsigned int n)
+{
+ unsigned x = 0;;
+
+ while (n > 10)
+ {
+ n -= 2;
+ x++;
+ }
+
+ return x;
+}
+
+int foo0(int i0, int i1)
+{
+ int i, j = 0;
+ for (i=i0; i<=i1+1; ++i)
+ ++j;
+ return j;
+}
+
+/* { dg-final { scan-tree-dump-times "if" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-28.c
new file mode 100644
index 000000000..479355eb6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-28.c
@@ -0,0 +1,23 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -fdump-tree-optimized -fdump-tree-aprefetch --param max-unrolled-insns=1000" } */
+
+char x[100000];
+
+void foo(int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ x[i] = (char) i;
+}
+
+/* There should be 64 MEMs in the unrolled loop and one more in the copy of the loop
+ for the rest of the iterations. */
+
+/* { dg-final { scan-tree-dump-times "MEM" 65 "optimized" } } */
+
+/* There should be no i_a = i_b assignments. */
+/* { dg-final { scan-tree-dump-times "i_.*= i_\[0-9\]*;" 0 "aprefetch" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-29.c
new file mode 100644
index 000000000..c900dbf9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-29.c
@@ -0,0 +1,21 @@
+/* PR 31885 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct s {
+ int *blah;
+};
+
+static struct s array[] = { { 0 } };
+
+void
+foo (struct s *p)
+{
+ struct s *q = &array[1];
+ while (p < q)
+ p++;
+}
+
+/* { dg-final { scan-tree-dump-not "if" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c
new file mode 100644
index 000000000..9868c078d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-3.c
@@ -0,0 +1,30 @@
+/* A test for strength reduction and induction variable elimination.
+ Target is restricted to x86 type architectures, so that we may
+ assume something about memory addressing modes. */
+
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && nonpic } } } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int arr_base[100];
+
+int foo(int);
+
+void xxx(void)
+{
+ long iter;
+
+ for (iter = 0; iter < 100; iter++)
+ arr_base[iter] = foo (iter);
+}
+
+/* Access to arr_base[iter].y should not be strength reduced, since
+ we have a memory mode including multiplication by 4. */
+
+/* { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "step:" 1 "optimized" } } */
+
+/* And original induction variable should be preserved. */
+
+/* { dg-final { scan-tree-dump-times "int iter" 1 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-30.c
new file mode 100644
index 000000000..14d58e598
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-30.c
@@ -0,0 +1,14 @@
+/* PR 25371 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+void
+slow_close(int n)
+{
+ int i;
+ double *mm;
+ for (i=0;i<2*n;i++)
+ for (i=0;i<2*n;i++)
+ *(mm+i*2*n+i) = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-31.c
new file mode 100644
index 000000000..fa18f5e04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-31.c
@@ -0,0 +1,21 @@
+/* PR 32283 */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+short a[(2048)];
+short foo (int len, int v)
+{
+ int i;
+ for (i = 0; i < len; i++) {
+ a[i] = v;
+ }
+ return a[0];
+}
+
+/* When we do not have addressing mode including multiplication,
+ the memory access should be strength-reduced. */
+/* { dg-final { scan-tree-dump-times " \\+ 2;" 1 "optimized" { target arm*-*-* } } } */
+/* { dg-final { scan-tree-dump-times " \\+ 2;" 1 "optimized" { target { ia64-*-* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump-times " \\+ 2;" 2 "optimized" { target { ia64-*-* && lp64 } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-32.c
new file mode 100644
index 000000000..f0c8d3057
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-32.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim1-details" } */
+
+int x;
+int a[100];
+
+struct a
+{
+ int X;
+ int Y;
+};
+
+void bla(void);
+
+void test1(void)
+{
+ unsigned i;
+
+ /* We should perform store motion here. */
+ for (x = 0; x < 100; x++)
+ a[x] = x;
+}
+
+void test2(void)
+{
+ unsigned i;
+
+ /* But not here. */
+ for (x = 0; x < 100; x++)
+ bla ();
+}
+
+void test3(struct a *A)
+{
+ unsigned i;
+
+ /* But we should here (using base + offset analysis). */
+ for (i = 0; i < 100; i++)
+ {
+ A[5].X += i;
+ A[5].Y += i;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 3 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-33.c
new file mode 100644
index 000000000..bf16b1398
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-33.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim1-details" } */
+
+int x;
+int a[100];
+
+struct a
+{
+ int X;
+ int Y;
+};
+
+struct a arr[100];
+
+void test4(unsigned b)
+{
+ unsigned i;
+
+ /* And here. */
+ for (i = 0; i < 100; i++)
+ {
+ arr[b+8].X += i;
+ arr[b+9].X += i;
+ }
+}
+
+void test5(struct a *A, unsigned b)
+{
+ unsigned i;
+
+ /* And here as well. */
+ for (i = 0; i < 100; i++)
+ {
+ A[b].X += i;
+ A[b+1].Y += i;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 4 "lim1" { xfail { lp64 || llp64 } } } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-34.c
new file mode 100644
index 000000000..125a2202d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-34.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim1-details" } */
+
+int r[6];
+
+void f (int n)
+{
+ while (-- n)
+ {
+ r [0] += r [5];
+ r [1] += r [0];
+ r [2] += r [1];
+ r [3] += r [2];
+ r [4] += r [3];
+ r [5] += r [4];
+ }
+}
+
+
+/* { dg-final { scan-tree-dump-times "Executing store motion of r" 6 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
new file mode 100644
index 000000000..2d2db701a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-35.c
@@ -0,0 +1,72 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim1-details" } */
+
+int x;
+int a[100];
+
+struct a
+{
+ int X;
+ int Y;
+};
+
+/* Word size is long long for 64-bit mingw target. */
+#ifdef _WIN64
+#define LONG long long
+#else
+#define LONG long
+#endif
+
+struct a arr[100];
+
+void test1(int b)
+{
+ unsigned i;
+
+ /* And here. */
+ for (i = 0; i < 100; i++)
+ {
+ arr[b+8].X += i;
+ arr[b+9].X += i;
+ }
+}
+
+void test2(struct a *A, int b)
+{
+ unsigned i;
+
+ /* And here as well. */
+ for (i = 0; i < 100; i++)
+ {
+ A[b].X += i;
+ A[b+1].Y += i;
+ }
+}
+
+void test3(unsigned LONG b)
+{
+ unsigned i;
+
+ /* And here. */
+ for (i = 0; i < 100; i++)
+ {
+ arr[b+8].X += i;
+ arr[b+9].X += i;
+ }
+}
+
+void test4(struct a *A, unsigned LONG b)
+{
+ unsigned i;
+
+ /* And here as well. */
+ for (i = 0; i < 100; i++)
+ {
+ A[b].X += i;
+ A[b+1].Y += i;
+ }
+}
+/* long index not hoisted for avr target PR 36561 */
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 8 "lim1" { xfail { "avr-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "Executing store motion of" 6 "lim1" { target { "avr-*-*" } } } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-36.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-36.c
new file mode 100644
index 000000000..9e9173765
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-36.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dce2" } */
+
+struct X { float array[2]; };
+
+struct X a,b;
+
+float foobar () {
+ float s = 0;
+ unsigned int d;
+ struct X c;
+ for (d=0; d<2; ++d)
+ c.array[d] = a.array[d] * b.array[d];
+ for (d=0; d<2; ++d)
+ s+=c.array[d];
+ return s;
+}
+
+/* The temporary structure should have been promoted to registers
+ by FRE after the loops have been unrolled by the early unrolling pass. */
+/* { dg-final { scan-tree-dump-not "c\.array" "dce2" } } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-37.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-37.c
new file mode 100644
index 000000000..46b26bb87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-37.c
@@ -0,0 +1,27 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+static const int my_array [3] = { 4, 5, 6 };
+
+void f0 (void)
+{
+ int j, sum = 0;
+ for (j = 0; j < 3; j ++)
+ sum += my_array [j];
+ if (15 != sum)
+ link_error ();
+}
+
+int f1 (int a [])
+{
+ int j, sum = 0;
+ for (j = 0; j < 3; j ++)
+ sum += a [j] + my_array [j];
+ return sum;
+}
+
+int main() { }
+
+/* { dg-final { scan-tree-dump-not "my_array" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-38.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-38.c
new file mode 100644
index 000000000..714696e87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-38.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cunrolli-details" } */
+int a[10];
+int b[11];
+t(int n)
+{
+ int i;
+ int sum = 0;
+ for (i=0;i<n;i++)
+ if (q())
+ sum+=a[i];
+ else
+ sum+=b[i];
+ return sum;
+}
+/* { dg-final { scan-tree-dump "Loop 1 iterates at most 11 times" "cunrolli" } } */
+/* { dg-final { cleanup-tree-dump "cunrolli" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c
new file mode 100644
index 000000000..1f6bba42f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sccp-details" } */
+
+int
+foo (unsigned int n)
+{
+ int i, r = 1;
+ if (n > 0)
+ {
+ asm ("");
+ if (n < 10)
+ {
+ asm ("");
+ do
+ {
+ --n;
+ r *= 2;
+ }
+ while (n > 0);
+ }
+ }
+ return r + n;
+}
+
+/* { dg-final { scan-tree-dump "# of iterations \[^\n\r]*, bounded by 8" "sccp" } } */
+/* { dg-final { cleanup-tree-dump "sccp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-4.c
new file mode 100644
index 000000000..4313fca50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-4.c
@@ -0,0 +1,46 @@
+/* A test for strength reduction and induction variable elimination. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+/* { dg-require-effective-target size32plus } */
+
+/* Size of this structure should be sufficiently weird so that no memory
+ addressing mode applies. */
+
+struct bla
+{
+ char x[187];
+ int y;
+ char z[253];
+} arr_base[100];
+
+int foo(void);
+
+void xxx(void)
+{
+ int iter;
+
+ for (iter = 0; iter < 100; iter++)
+ arr_base[iter].y = foo ();
+}
+
+/* Access to arr_base[iter].y should be strength reduced. Depending on
+ whether we have an addressing mode of type [base + offset], one of the
+ following forms might get chosen:
+
+ -- induction variable with base &arr_base[0].y, the memory access of
+ form *iv = ...
+ -- induction variable with base 0, the memory access of form
+ *(iv + &arr_base[0].y) = ...
+
+ In any case, we should not have any multiplication. */
+
+/* { dg-final { scan-tree-dump-times " \\* \[^\\n\\r\]*=" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " MEM" 1 "optimized" } } */
+
+/* And the original induction variable should be eliminated. */
+
+/* { dg-final { scan-tree-dump-times "iter" 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c
new file mode 100644
index 000000000..e9ff9fcfe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c
@@ -0,0 +1,30 @@
+/* A test for induction variable merging. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+void foo(long);
+
+void xxx(void)
+{
+ long iter, jter;
+
+ for (iter = 0, jter = 2; iter < 100; iter++, jter++)
+ {
+ foo (iter);
+ foo (jter);
+ }
+}
+
+/* Only iter variable should remain. */
+
+/* { dg-final { scan-tree-dump-times "int jiter" 0 "optimized" } } */
+
+/* And jter shouldn't be an induction variable anymore (no PHI node). */
+/* { dg-final { scan-tree-dump-times "jter_\[0-9\]* = PHI" 0 "optimized" } } */
+
+/* And the use of jter should be replaced by iter + 2 */
+
+/* { dg-final { scan-tree-dump-times " \\+ 2" 1 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-6.c
new file mode 100644
index 000000000..992f671e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-6.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -funswitch-loops -fdump-tree-unswitch-details -fdump-tree-optimized" } */
+
+int ch;
+int a[100];
+
+void xxx(void)
+{
+ int i;
+
+ for (i = 0; i < 100; i++)
+ {
+ if (ch)
+ a[i] = ch;
+ else
+ a[i] = i;
+ }
+}
+
+/* Loop should be unswitched. */
+
+/* { dg-final { scan-tree-dump-times "Unswitching loop" 1 "unswitch" } } */
+/* { dg-final { cleanup-tree-dump "unswitch" } } */
+
+/* In effect there should be exactly three conditional jumps in the final program. */
+
+/* { dg-final { scan-tree-dump-times "else" 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-7.c
new file mode 100644
index 000000000..38e19e6aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-7.c
@@ -0,0 +1,35 @@
+/* PR tree-optimization/19828 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-lim1-details" } */
+
+int cst_fun1 (int) __attribute__((__const__));
+int cst_fun2 (int) __attribute__((__const__));
+int pure_fun1 (int) __attribute__((__pure__));
+int pure_fun2 (int) __attribute__((__pure__));
+int foo (void);
+
+int xxx (void)
+{
+ int i, k = foo (), x = 0;
+
+ for (i = 0; i < 100; i++)
+ {
+ x += cst_fun1 (k);
+ x += pure_fun1 (k);
+
+ if (k)
+ {
+ x += cst_fun2 (k);
+ x += pure_fun2 (k);
+ }
+ }
+
+ return x;
+}
+
+/* Calls to cst_fun1 and pure_fun1 may be moved out of the loop.
+ Calls to cst_fun2 and pure_fun2 should not be, since calling
+ with k = 0 may be invalid. */
+
+/* { dg-final { scan-tree-dump-times "Moving statement" 2 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-8.c
new file mode 100644
index 000000000..de439c719
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-8.c
@@ -0,0 +1,25 @@
+/* A test for strength reduction of ivs with nonconstant step. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int bar (void);
+
+int a[100];
+
+void xxx (void)
+{
+ int iter, step = bar ();
+
+ for (iter = 0; iter < 10; iter++)
+ a[iter * step] = bar ();
+}
+
+/* The array access should be strength reduced. But to determine the value of
+ the step, we need to calculate step * sizeof (int), thus we need to be
+ a bit careful about which multiplications we disallow. */
+
+/* { dg-final { scan-tree-dump-times "step \\* \[^0-9\]" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\[^0-9\] \\* step" 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-9.c
new file mode 100644
index 000000000..c4b47c054
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-9.c
@@ -0,0 +1,24 @@
+/* Without TARGET_MEM_REFs, dom creates code like
+
+ i1 = 4 * i;
+ *(p + i1) = i;
+ *(p + i1 + 4) = i
+
+ causing us to have unnecessary multiplication by 4 in the
+ result. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+void foo (int *p)
+{
+ int i;
+
+ for (i = 0; i < 100; i++)
+ {
+ p[i] = i;
+ p[i + 1] = i;
+ }
+}
+
+/* { dg-final { scan-assembler-times "lea\\t" 0 { target i?86-*-* x86_64-*-* } } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/negate.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/negate.c
new file mode 100644
index 000000000..12e2cdf71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/negate.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+int f (int a, int b)
+{
+ int x = -a;
+ int y = b - x;
+ return y;
+}
+
+/* We tested for reassociation to -(a + b) on the following which
+ isn't a transform that makes things cheaper. With reassoc
+ no longer applying to types with undefined overflow we lost
+ this transform.
+
+int g (int a, int b)
+{
+ int x = -a;
+ int y = x - b;
+ return y;
+}
+
+*/
+
+/* There should be an addition now. */
+/* { dg-final { scan-tree-dump-times "\\+" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-1.c
new file mode 100644
index 000000000..b29516936
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(int a, int b, int c)
+{
+ if (c == 0) goto temp;
+ if (a == 0)
+ return 0;
+temp:
+ if (a == b)
+ return a;
+ return a;
+}
+
+/* There should be no ifs as the PHI arguments, we did not
+ optimize this before because PHI-OPT did not look at
+ PHIs which have more than two arguments. */
+/* { dg-final { scan-tree-dump-times "if" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c
new file mode 100644
index 000000000..62d007d45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-10.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int nem1_phi (unsigned long a) { return a ? -1 : 0; }
+int eqm1_phi (unsigned long a) { return a ? 0 : -1; }
+
+int spaceship1 (long a) { return a > 0 ? 1 : a < 0 ? -1 : 0; }
+int spaceship2 (long a) { return a > 0 ? 1 : a == 0 ? 0 : -1; }
+
+/* { dg-final { scan-tree-dump-times " = -\[^\r\n\]*_.;" 4 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c
new file mode 100644
index 000000000..7c83007e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(int a, int b, int c)
+{
+ if (a == 0 && b > c)
+ return 0;
+ return a;
+}
+
+int g(int a, int b, int c)
+{
+ if (a == 42 && b > c)
+ return 42;
+ return a;
+}
+
+int h(int a, int b, int c, int d)
+{
+ if (a == d && b > c)
+ return d;
+ return a;
+}
+/* { dg-final { scan-tree-dump-times "if" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-2.c
new file mode 100644
index 000000000..3d34ef3f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+/* { dg-additional-options "-mbranch-cost=1" { target { i?86-*-* x86_64-*-* mips*-*-* s390*-*-* avr*-*-* } } } */
+
+_Bool f1(_Bool a, _Bool b)
+{
+ if (a)
+ {
+ if (b)
+ return 1;
+ else
+ return 0;
+ }
+ return 0;
+}
+
+
+/* There should be only one if, the outer one; the inner one
+ should have been changed to straight line code with the
+ value of b (except that we don't fold ! (b != 0) into b
+ which can be fixed in a different patch).
+ Test this only when known to be !LOGICAL_OP_NON_SHORT_CIRCUIT,
+ otherwise ifcombine may convert this into return a & b;. */
+/* { dg-final { scan-tree-dump-times "if" 1 "optimized" { target { i?86-*-* x86_64-*-* mips*-*-* s390*-*-* avr*-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-3.c
new file mode 100644
index 000000000..54970ad80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(int a, int b)
+{
+ if (a == 0)
+ return 0;
+ if (a != b)
+ return a;
+ return a;
+}
+
+/* There should be no ifs as the PHI arguments, we did not
+ optimize this before because PHI-OPT did not look at
+ PHIs which have more than two arguments. */
+/* { dg-final { scan-tree-dump-times "if" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c
new file mode 100644
index 000000000..efd9228b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+_Bool t();
+_Bool t1();
+
+_Bool f1()
+{
+ return t() && t1();
+}
+
+/* There should be only one if, the outer one; the inner one
+ should have been changed to straight line code with the
+ value of b (except that we don't fold ! (b != 0) into b
+ which means that we miss a sib calling opportunity). */
+/* { dg-final { scan-tree-dump-times "if " 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c
new file mode 100644
index 000000000..7a930dd45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c
@@ -0,0 +1,59 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ffinite-math-only -fdump-tree-phiopt1" } */
+
+float repl1 (float varx)
+{
+ if (varx < 0.0)
+ return 0.0;
+ else if (varx > 1.0)
+ return 1.0;
+ else
+ return varx;
+}
+
+/* Should be turned to
+
+ varx_4 = MIN_EXPR <1.0e+0, varx_2>;
+ varx_5 = MAX_EXPR <varx_4, 0.0>; */
+
+/* { dg-final { scan-tree-dump "varx.*MIN_EXPR.*1\\.0" "phiopt1"} } */
+/* { dg-final { scan-tree-dump "varx.*MAX_EXPR.*0\\.0" "phiopt1"} } */
+
+float repl2 (float vary)
+{
+ if (vary > 1.0)
+ return 1.0;
+ else if (vary < 0.0)
+ return 0.0;
+ else
+ return vary;
+}
+
+/* Should be turned to
+
+ vary_4 = MAX_EXPR <0.0, vary_2>;
+ vary_5 = MIN_EXPR <vary_4, 1.0e+0>; */
+
+/* { dg-final { scan-tree-dump "vary.*MAX_EXPR.*0\\.0" "phiopt1"} } */
+/* { dg-final { scan-tree-dump "vary.*MIN_EXPR.*1\\.0" "phiopt1"} } */
+
+float repl3 (float varz, float vara, float varb)
+{
+ if (varz > vara)
+ return vara;
+ else if (varz < varb)
+ return varb;
+ else
+ return varz;
+}
+
+/* Should be turned to
+
+ if (varz_2 > vara_3) goto <L4>; else goto <L1>;
+
+<L1>:;
+ vara_6 = MAX_EXPR <varb_5, varz_2>; */
+
+/* { dg-final { scan-tree-dump "if .*varz" "phiopt1"} } */
+/* { dg-final { scan-tree-dump "vara.*MAX_EXPR" "phiopt1"} } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-6.c
new file mode 100644
index 000000000..6ec7b7224
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-6.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-phiopt1" } */
+
+struct C { int i; };
+int *g(struct C *p)
+{
+ if (p)
+ return &p->i;
+ return (int *)0;
+}
+
+/* { dg-final { scan-tree-dump-not "if" "phiopt1" } } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c
new file mode 100644
index 000000000..bd897554e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int g(int,int);
+int f(int t, int c)
+{
+ int d = 0;
+ int e = 0;
+ if (t)
+ {
+ d = t;
+ if (c) e = 1;
+ }
+ else d = 0, e = 0;
+ return g(d,e);
+}
+
+/* There should be one ifs as one of them should be changed into
+ a conditional and the other should be there still. */
+/* { dg-final { scan-tree-dump-times "if" 1 "optimized" } }*/
+/* { dg-final { scan-tree-dump-times "\[^\r\n\]*_. = c_\[0-9\]*.D. != 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c
new file mode 100644
index 000000000..775926da9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized -fdump-tree-phiopt1" } */
+
+int g(int,int);
+int f(int t, int c)
+{
+ int d = 0;
+ int e = 0;
+ if (t)
+ {
+ d = 1;
+ e = t;
+ }
+ else d = 0, e = 0;
+ return g(e,d);
+}
+
+/* This testcase should be reduced to e = t; d = t != 0; in phiopt1
+ but currently is not as PHI-OPT does not reduce the t PHI as we have
+ two phis. Note this is fixed with
+ http://gcc.gnu.org/ml/gcc-patches/2012-01/msg01195.html . */
+/* { dg-final { scan-tree-dump-not "if" "phiopt1" } } */
+/* { dg-final { scan-tree-dump "g .t_\[0-9\]*.D.," "optimized" } } */
+/* { dg-final { scan-tree-dump-not "PHI" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c
new file mode 100644
index 000000000..a224788f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int g(int,int);
+int h(int);
+int f(int t, int c)
+{
+ int d = 0;
+ int e = 0;
+ if (t)
+ {
+ d = h(c);
+ e = t;
+ }
+ else d = 0, e = 0;
+ return g(e,d);
+}
+
+/* The value e should have been replaced with t and there should be only one PHI. */
+/* { dg-final { scan-tree-dump "g .t_\[0-9\]*.D.," "optimized" } } */
+/* { dg-final { scan-tree-dump-times "PHI" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr13146.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr13146.c
new file mode 100644
index 000000000..b55645767
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr13146.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-aliasing -fdump-tree-optimized" } */
+
+struct A
+{
+ int i;
+};
+struct B
+{
+ struct A a;
+ int j;
+};
+
+int foo (struct A *p, struct B *q)
+{
+ p->i = 0;
+ q->j = 1;
+ return p->i;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14341.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14341.c
new file mode 100644
index 000000000..0287a25cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14341.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-require-effective-target int32plus } */
+
+void fn_call (int);
+int h(int, int);
+void t()
+{
+ int i;
+ int x;
+ for( i = 0; i < 100000000; i++ ){
+ fn_call (i < 100000000);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "fn_call \\(1\\)" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-1.c
new file mode 100644
index 000000000..b69bb70d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -fdump-tree-gimple" } */
+int g(int x)
+{
+ return (x - 10) < 0;
+}
+/* There should be only x <= 9 and no x - 10. */
+/* { dg-final { scan-tree-dump-times "<= 9" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "\\+ -10" 0 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-2.c
new file mode 100644
index 000000000..925442bb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple -fwrapv" } */
+int g(int x)
+{
+ return (x - 10) < 0;
+}
+/* There should be no x >= 9 and one x - 10. */
+/* { dg-final { scan-tree-dump-times "<= 9" 0 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "\\+ -10" 1 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-3.c
new file mode 100644
index 000000000..bf63d3afc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-3.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -fdump-tree-gimple" } */
+int g(int x)
+{
+ return (x + 10) < 0;
+}
+/* There should be only x < -10 and no x + 10. */
+/* { dg-final { scan-tree-dump-times "< -10" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "\\+ 10" 0 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-4.c
new file mode 100644
index 000000000..90a49bbdd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14490-4.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple -fwrapv" } */
+int g(int x)
+{
+ return (x + 10) < 0;
+}
+/* There should be no x < -10 and one x + 10. */
+/* { dg-final { scan-tree-dump-times "< -10" 0 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "\\+ 10" 1 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14814.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14814.c
new file mode 100644
index 000000000..20608156f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14814.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-sra -fdump-tree-forwprop2" } */
+
+struct YY {
+ double e[3]; };
+
+static inline double *y(struct YY* this_1) { return &this_1->e[1]; }
+
+struct XX {
+ struct YY v;
+ };
+
+static inline struct YY direction (const struct XX* this_1) { return this_1->v;}
+
+int foo(const struct XX* r) {
+ struct YY t = direction(r);
+ if (*y(&t) < 0.000001) return 0;
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-times "= &" 0 "forwprop2" } } */
+/* { dg-final { cleanup-tree-dump "forwprop2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14841.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14841.c
new file mode 100644
index 000000000..cc6e0158b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr14841.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/14841
+ Make sure that we can fold a possible nested reference into a
+ constant aggregate. */
+
+/* { dg-do link } */
+/* { dg-options "-O" } */
+
+struct car {
+ int speed;
+ int tire_pressure[4];
+};
+
+static const struct car cars[] = {
+ { 75, { 10, 20, 30, 40 } },
+ { 35, { 12, 34, 56, 78 } },
+ { 40, { 19, 28, 37, 46 } }
+};
+
+extern void link_error (void);
+
+void
+foo (void)
+{
+ if (cars[1].tire_pressure[2] != 56)
+ link_error ();
+}
+
+int main () { return 0; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15349.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15349.c
new file mode 100644
index 000000000..26c193842
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15349.c
@@ -0,0 +1,26 @@
+/* PR 15349. Merge two PHI nodes. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-mergephi2" } */
+
+int
+foo (int a, int b)
+{
+ int t;
+
+ if (b)
+ {
+ if (a)
+ t = 3;
+ else
+ t = 5;
+
+ a = 0;
+ }
+ else
+ t = 7;
+
+ return t;
+}
+
+/* { dg-final { scan-tree-dump-times "PHI" 1 "mergephi2"} } */
+/* { dg-final { cleanup-tree-dump "mergephi2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-1.c
new file mode 100644
index 000000000..68f14adad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-1.c
@@ -0,0 +1,25 @@
+/* { dg-do link } */
+
+void link_error ();
+
+int main ()
+{
+ struct { int b[2]; } x;
+ int b[2];
+ if (&b[1] != &b[1])
+ link_error ();
+ if (&b[0] != b)
+ link_error ();
+ if (b == &b[2])
+ link_error ();
+ if (b != b)
+ link_error ();
+ if (&x.b[1] == &x.b[0])
+ link_error ();
+ if (x.b != &x.b[0])
+ link_error ();
+ if (&x.b[1] == x.b)
+ link_error ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-2.c
new file mode 100644
index 000000000..df68bfeba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-2.c
@@ -0,0 +1,13 @@
+/* { dg-do link } */
+/* { dg-options "" } */
+
+void link_error ();
+struct a {};
+int main ()
+{
+ struct a b[2];
+ if (&b[0] != &b[1])
+ link_error ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-3.c
new file mode 100644
index 000000000..2fd03e2e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int f(int i, unsigned j)
+{
+ int b[2];
+ if (&b[i] == &b[j])
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "i == j" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-4.c
new file mode 100644
index 000000000..82be2e33a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-4.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int f(int i, int j)
+{
+ int b[2][2];
+ if (&b[1][i] == &b[0][j])
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "i == j" 0 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-5.c
new file mode 100644
index 000000000..06ce523a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr15791-5.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int foo(int i, int j)
+{
+ char g[16];
+ if (&g[i] == &g[j])
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "i == j" 1 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr16721.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr16721.c
new file mode 100644
index 000000000..eec753405
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr16721.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-optimized" } */
+
+struct data {
+ volatile unsigned long *addr;
+} *p;
+
+int test()
+{
+ *p->addr;
+ return 0;
+}
+
+/* The load from p->addr should not disappear. */
+/* { dg-final { scan-tree-dump-times "\->addr" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c
new file mode 100644
index 000000000..853fe70c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+struct A { int i; };
+int
+foo(struct A *locp, int str)
+{
+ int T355, *T356;
+ T356 = &locp->i;
+ *T356 = str;
+ return locp->i;
+}
+
+/* We should have propagated &locp->i into its dereference. */
+
+/* { dg-final { scan-tree-dump "locp_\[^\\n\]* =" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17141-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17141-2.c
new file mode 100644
index 000000000..37782cafe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17141-2.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+
+
+void abort (void);
+struct a
+{
+ int i;
+} *a;
+int f(void)
+{
+ int *ii = &a->i;
+ void *l;
+ a->i = 1;
+ if (*ii)
+ l = &&l1;
+ else
+ l = &&l2;
+ goto *l;
+l1:
+ return 0;
+l2:
+ abort ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "&" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "abort" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17598.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17598.c
new file mode 100644
index 000000000..ac912a2b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr17598.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+struct f
+{
+ int i;
+ int j;
+};
+
+struct g
+{
+ int i;
+ struct f j;
+ struct f *k;
+};
+
+int foo(struct f *x, struct f *y)
+{
+ return &x->j == &y->j; /* x == y */
+}
+
+struct f y;
+int bar(struct f *x)
+{
+ return &x->j == &y.j; /* x == &y */
+}
+
+struct g yy;
+int foobar(struct g *x)
+{
+ return &x->j.i == &yy.j.i; /* x == &yy */
+}
+int foobar2(struct g *x)
+{
+ return &x->k->i == &yy.k->i; /* x->k == yy.k */
+}
+
+/* { dg-final { scan-tree-dump-times "x == y" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "x == &y" 2 "gimple" } } */
+/* { dg-final { scan-tree-dump "x->k" "gimple" } } */
+/* { dg-final { scan-tree-dump "yy.k" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c
new file mode 100644
index 000000000..8bae0145d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized-blocks-details" } */
+
+void foo (void)
+{
+void *p;
+p = &&L0;
+goto *p;
+L0:
+return;
+}
+
+/* The goto &L0 should have been optimized away during CFG
+ cleanups. */
+/* { dg-final { scan-tree-dump-not "goto &L0" "optimized" } } */
+
+/* There should not be any abnormal edges as DOM removed the
+ computed goto. */
+
+/* { dg-final { scan-tree-dump-not "ABNORMAL" "optimized" } } */
+
+/* And verify that we have fixed the fallthru flag as well.
+ After DOM we will have two fallthru edges (e->0, 0->1),
+ but in the dump files we mention the 2->3 two times. So
+ scan for 3 instances of "FALLTHRU". */
+
+/* { dg-final { scan-tree-dump-times "FALLTHRU" 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c
new file mode 100644
index 000000000..9d04ded45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized-blocks" } */
+
+int c, d;
+
+int
+bar (int a)
+{
+ void *p;
+ int b;
+
+ if (a!=0)
+ {
+ b = 3;
+ p = &&L0;
+ }
+ else
+ {
+ b = 5;
+ p = &&L1;
+ }
+
+ goto *p;
+
+ L0:
+ c = b;
+ return 1;
+
+ L1:
+ d = b;
+ return 0;
+}
+
+/* The both paths to the block containing the goto *p should
+ have been threaded, thus eliminating the need for the goto *p. */
+
+/* { dg-final { scan-tree-dump-times "goto p" 0 "optimized" } } */
+
+/* There should not be any abnormal edges as DOM removed the
+ computed goto. */
+
+/* { dg-final { scan-tree-dump-times "ab" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c
new file mode 100644
index 000000000..783d598a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18134.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int foo (int a)
+{
+void *p;
+if (a!=0)
+ p = &&L0;
+else
+ p = &&L1;
+goto *p;
+L0:
+return 1;
+L1:
+return 0;
+}
+
+/* Everything should have been cleaned up leaving a simple
+ return statement. */
+/* { dg-final { scan-tree-dump-times "= a_..D. != 0" 1 "optimized" } } */
+
+/* There should not be any abnormal edges as DOM removed the
+ computed gotos. */
+
+/* { dg-final { scan-tree-dump-times "ab" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-1.c
new file mode 100644
index 000000000..48c904d0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+double baz (double x, double y)
+{
+ return x * x * x * x * y * y * y * y;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-10.c
new file mode 100644
index 000000000..4a6120abd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-10.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+double baz (double x, double y, double z)
+{
+ return (__builtin_pow (x, 4.0) * __builtin_pow (y, 2.0)
+ * __builtin_pow (z, 4.0));
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-2.c
new file mode 100644
index 000000000..d8b7fca00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-2.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+double baz (double x, double y)
+{
+ return x * y * y * x * y * x * x * y;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-3.c
new file mode 100644
index 000000000..26c1893ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-3.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+double baz (double x, double y, double z)
+{
+ return x * x * y * y * y * z * z * z * z;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-4.c
new file mode 100644
index 000000000..55c2d43b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-4.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+double baz (double x, double y, double z, double u)
+{
+ return x * x * y * y * y * z * z * z * z * u;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 6 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-5.c
new file mode 100644
index 000000000..ea60f8eca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-5.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+double baz (double x, double y, double z, double u)
+{
+ return x * x * x * y * y * y * z * z * z * z * u * u * u * u;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 6 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-6.c
new file mode 100644
index 000000000..5044020cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-6.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+double baz (double x, double y)
+{
+ return __builtin_pow (x, 3.0) * __builtin_pow (y, 4.0);
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 4 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-7.c
new file mode 100644
index 000000000..d4c524158
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-7.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+float baz (float x, float y)
+{
+ return x * x * x * x * y * y * y * y;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-8.c
new file mode 100644
index 000000000..5335fa229
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-8.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+long double baz (long double x, long double y)
+{
+ return x * x * x * x * y * y * y * y;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-9.c
new file mode 100644
index 000000000..08d5798e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18589-9.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -fdump-tree-optimized" } */
+
+double baz (double x, double y, double z)
+{
+ return (__builtin_pow (x, 3.0) * __builtin_pow (y, 2.0)
+ * __builtin_pow (z, 5.0));
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 6 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c
new file mode 100644
index 000000000..3707efe36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr18908.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1" } */
+
+_Bool f3(_Bool *p) { *p ^= 1; }
+
+/* We should be able to canonicalize the above to use bitwise not. */
+/* { dg-final { scan-tree-dump "~\[^\n\r\]*_.;" "forwprop1" } } */
+/* { dg-final { scan-tree-dump-not "\\\^ 1" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19055-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19055-2.c
new file mode 100644
index 000000000..739d69c0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19055-2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+int f1(int a,int b,int c,int d)
+{
+ return ((a&d)|(b&c)) ^ (b&c);
+}
+
+int f2(int a,int b,int c,int d)
+{
+ return (b&c) ^ ((a&d)|(b&c));
+}
+
+int f3(int a,int b,int c,int d)
+{
+ return ((b&c)|(a&d)) ^ (b&c);
+}
+
+int f4(int a,int b,int c,int d)
+{
+ return (b&c) ^ ((b&c)|(a&d));
+}
+
+/* There should be no ^, 4 ~ and 12 &. */
+/* { dg-final { scan-tree-dump-times "\\^" 0 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "~" 4 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "&" 12 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19055.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19055.c
new file mode 100644
index 000000000..055a96c1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19055.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+int f1(int a,int b)
+{
+ return (a|b) ^ b;
+}
+int f2(int a,int b)
+{
+ return (b|a) ^ b;
+}
+int f3(int a,int b)
+{
+ return b^(a|b);
+}
+int f4(int a,int b)
+{
+ return b^(b|a);
+}
+/* There should be no ^, 4 ~ and 4 &. */
+/* { dg-final { scan-tree-dump-times "\\^" 0 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "~" 4 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "&" 4 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c
new file mode 100644
index 000000000..906132c69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wunsafe-loop-optimizations" } */
+extern void g(void);
+
+void
+f (unsigned n)
+{
+ unsigned k;
+ for(k = 0;k <= n;k++) /* { dg-warning "cannot optimize.*infinite loops" } */
+ g();
+
+ for(k = 0;k <= n;k += 4) /* { dg-warning "cannot optimize.*overflow" } */
+ g();
+
+ /* We used to get warning for this loop. However, since then # of iterations
+ analysis improved, and we can now prove that this loop does not verflow.
+ This is because the only case when it would overflow is if n = ~0 (since
+ ~0 is divisible by 5), and this cannot be the case, since when we got
+ here, the previous loop exited, thus there exists k > n. */
+ for(k = 5;k <= n;k += 5)
+ g();
+
+ /* So we need the following loop, instead. */
+ for(k = 4;k <= n;k += 5) /* { dg-warning "cannot optimize.*overflow" } */
+ g();
+
+ for(k = 15;k >= n;k--) /* { dg-warning "cannot optimize.*infinite" } */
+ g();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19210-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19210-2.c
new file mode 100644
index 000000000..9116e97ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19210-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funsafe-loop-optimizations -Wunsafe-loop-optimizations" } */
+extern void g(void);
+
+void
+f (unsigned n)
+{
+ unsigned k;
+ for(k = 0;k <= n;k++) /* { dg-warning "assuming.*not infinite" } */
+ g();
+
+ for(k = 5;k <= n;k += 4) /* { dg-warning "assuming.*not overflow" } */
+ g();
+
+ /* We used to get warning for this loop. However, since then # of iterations
+ analysis improved, and we can now prove that this loop does not verflow.
+ This is because the only case when it would overflow is if n = ~0 (since
+ ~0 is divisible by 5), and this cannot be the case, since when we got
+ here, the previous loop exited, thus there exists k > n. */
+ for(k = 5;k <= n;k += 5)
+ g();
+
+ for(k = 4;k <= n;k += 5) /* { dg-warning "assuming.*not overflow" } */
+ g();
+
+ for(k = 15;k >= n;k--) /* { dg-warning "assuming.*not infinite" } */
+ g();
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19431.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19431.c
new file mode 100644
index 000000000..08972063e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19431.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+/* We want this optimized as
+<bb 2>:
+ if (k != 0) goto <L2>; else goto <L3>;
+
+<L3>:;
+ i1 = j1;
+
+<L2>:;
+ return i1;
+
+ This requires that i1 and j1 are changed into registers after they
+ no longer have their address taken. */
+
+int f(int k, int i1, int j1)
+{
+ int *f1;
+ if(k)
+ f1 = &i1;
+ else
+ f1 = &j1;
+ return *f1;
+}
+
+/* { dg-final { scan-tree-dump "\[^\r\n\]*_. = PHI <i1_\[^,\]*, j1_\[^>\]*>" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19590.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19590.c
new file mode 100644
index 000000000..1be1119da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19590.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ivopts" } */
+
+void vnum_test8(int *data)
+{
+ int i;
+ int stop = data[3];
+ int m = data[4];
+ int n = m;
+ for (i=1; i<stop; i++) {
+ int k = data[2];
+ data[k] = 2;
+ data[0] = m - n;
+ k = data[1];
+ m = m + k;
+ n = n + k;
+ }
+}
+
+/* Using the SCEV analysis, this loop should be transformed to:
+
+ | void vnum_result8(int *data)
+ |{
+ | int i;
+ | int stop = data[3];
+ | for (i=1; i<stop; i++) {
+ | int k = data[2];
+ | data[k] = 2;
+ | data[0] = 0;
+ | }
+ |}
+
+*/
+
+/* { dg-final { scan-tree-dump-times "= 0;" 1 "ivopts"} } */
+/* { dg-final { scan-tree-dump-times "= 2;" 1 "ivopts"} } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19633.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19633.c
new file mode 100644
index 000000000..01c7eec31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19633.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-ssa-vops" } */
+struct S
+{
+ int w, x, y, z;
+};
+struct T
+{
+ int r;
+ struct S s;
+};
+void bar (struct S, int);
+void
+foo (int a, struct T b)
+{
+ struct S x;
+ struct S *c = &x;
+ if (a)
+ c = &b.s;
+ bar (*c, a);
+}
+
+/* Make sure that .GLOBAL_VAR is not created when there are no
+ clobbering calls. */
+/* { dg-final { scan-tree-dump-times "GLOBAL_VAR" 0 "ssa"} } */
+/* { dg-final { cleanup-tree-dump "ssa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-1.c
new file mode 100644
index 000000000..1c8f97227
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-1.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+void test1(void)
+{
+ int *p = __builtin_malloc (sizeof (int) * 4);
+ int *q = p;
+ *q++ = 4;
+ *q++ = 4;
+ __builtin_free (p);
+}
+
+void test3(int b)
+{
+ int *p = __builtin_malloc (sizeof (int) * 4);
+ if (b)
+ __builtin_free (p);
+ *p = 5;
+}
+
+void test4(int b)
+{
+ int *p = __builtin_malloc (sizeof (int) * 4);
+ if (b)
+ __builtin_free (p);
+ *p = 5;
+ __builtin_free (p);
+}
+
+/* { dg-final { scan-tree-dump-times "free" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "malloc" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-2.c
new file mode 100644
index 000000000..bc7c4cc31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+void test1(void)
+{
+ int *p = __builtin_malloc (sizeof (int) * 4);
+ *p++ = 4;
+ __builtin_free (p);
+}
+
+/* Undefined. We can't do anything here. */
+
+/* { dg-final { scan-tree-dump-times "free" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "malloc" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-3.c
new file mode 100644
index 000000000..02b55726a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr19831-3.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void test2(void)
+{
+ int *p = __builtin_malloc (sizeof (int) * 4);
+ if (p == (void *)0)
+ __builtin_abort ();
+ __builtin_free (p);
+}
+
+void test5(int b)
+{
+ int *p = __builtin_malloc (sizeof (int) * 4);
+ if (p)
+ __builtin_free (p);
+}
+
+void test6(void)
+{
+ int *p = __builtin_malloc (sizeof (int) * 4);
+ if (p == (void *)0)
+ __builtin_abort ();
+ if (p)
+ __builtin_free (p);
+}
+
+/* We should be able to remove all malloc/free pairs with CDDCE.
+ Assume p was non-NULL for test2.
+ For test5, it doesn't matter if p is NULL or non-NULL. */
+
+/* { dg-final { scan-tree-dump-times "free" 0 "optimized" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "malloc" 0 "optimized" { xfail *-*-* } } } */
+
+/* But make sure we don't partially optimize for now. */
+
+/* { dg-final { scan-tree-dump-times "free" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "malloc" 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c
new file mode 100644
index 000000000..016ad004e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/20139
+ This testcase is derived from gcc.dg/20020720-1.c. Here we check
+ that the optimization happens at tree level. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern double fabs (double);
+extern void link_error (void);
+
+void
+foo (double x)
+{
+ double p, q;
+
+ p = fabs (x);
+ q = 0.0;
+ if (p < q)
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20318.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20318.c
new file mode 100644
index 000000000..1b302aede
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20318.c
@@ -0,0 +1,19 @@
+/* { dg-do compile { target { ! keeps_null_pointer_checks } } } */
+/* { dg-options "-O2 -fdump-tree-original -fdump-tree-vrp1" } */
+
+extern int* f(int) __attribute__((returns_nonnull));
+extern void eliminate ();
+void g () {
+ if (f (2) == 0)
+ eliminate ();
+}
+void h () {
+ int *p = f (2);
+ if (p == 0)
+ eliminate ();
+}
+
+/* { dg-final { scan-tree-dump-times "== 0" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate\[^\\n\]*to 0" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20470.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20470.c
new file mode 100644
index 000000000..b0d7492de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20470.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+/* PR tree-optimization/20470:
+ Missing fold to abs(x) when x == MINUS_EXPR. */
+#define abs(x) ((x) >= 0 ? (x) : -(x))
+
+int i,j,k;
+void f1()
+{
+ i = abs(j-k);
+}
+
+/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20490.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20490.c
new file mode 100644
index 000000000..8edc35e8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20490.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-pre" } */
+static int a;
+static int b;
+
+typedef int gint;
+
+int blah ()
+{
+ gint x = a;
+ gint y = b;
+
+ x *= (x < 0) ? -1 : 0;
+ y *= (y < 0) ? -1 : 0;
+
+ return (y * x);
+
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20657.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20657.c
new file mode 100644
index 000000000..1c3dbf9fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20657.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/20657
+ VRP did not pick up a conditional equivalence from the first "if"
+ statement, which was needed to eliminate the second "if" statement. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp1-details" } */
+
+int
+foo (int a)
+{
+ if (a == 0)
+ if (a == 0)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c
new file mode 100644
index 000000000..3ddf48e6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
+
+typedef struct {
+ int code;
+} *rtx;
+
+static inline void *zero ()
+{
+ return 0;
+}
+static inline int three ()
+{
+ return 3;
+}
+
+int
+can_combine_p (rtx insn, rtx elt)
+{
+ rtx set;
+
+ set = zero ();
+ if (insn->code == three ())
+ set = insn;
+ else
+ {
+ set = elt;
+ if (set == zero ())
+ return 0;
+ }
+
+ if (set == zero ())
+ return 1;
+
+ return 0;
+}
+
+/* Target with fno-delete-null-pointer-checks should not fold checks */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c
new file mode 100644
index 000000000..ce62fa3f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20702.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/20702
+ VRP did not insert ASSERT_EXPRs into dominator dominator children
+ of a basic block ending with COND_EXPR unless the children are also
+ immediate successors of the basic block. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp1-details" } */
+
+extern void bar (int);
+
+int
+foo (int *p, int b)
+{
+ int a;
+
+ if (b)
+ bar (123);
+ else
+ bar (321);
+
+ a = *p;
+ if (p == 0)
+ return 0;
+
+ return a;
+}
+
+/* Target with fno-delete-null-pointer-checks should not fold checks */
+/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20739.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20739.c
new file mode 100644
index 000000000..c1e7b58e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20739.c
@@ -0,0 +1,24 @@
+/* PR middle-end/20739 */
+
+/* dg-do compile */
+/* dg-options "-O" */
+
+/* We used to fail to compile this because gimplification dropped the
+ conversion that added the const qualifier to the sub-expression
+ involving baz, and then immediately noticed and reported its
+ absence. */
+
+typedef struct
+{
+ char chars[5];
+}
+baz_t;
+
+extern baz_t * baz;
+
+extern void foo (baz_t);
+int
+bar (const baz_t * ls)
+{
+ foo (ls == 0 ? *(&baz[0]) : *ls);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20742.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20742.c
new file mode 100644
index 000000000..21d6eb63c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20742.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define TEN(x) x x x x x x x x x x
+#define THOUSAND(x) TEN (TEN (TEN (x)))
+
+int
+foo (int x, int y)
+{
+ register int a = y + 57;
+ register int b = y + 31;
+
+ while (x-- > 0)
+ {
+ THOUSAND (a += b; b -= a;)
+ }
+ return a + b;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c
new file mode 100644
index 000000000..fb5461a26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c
@@ -0,0 +1,34 @@
+/* PR tree-optimization/20913
+ COPY-PROP did not fold COND_EXPR, blocking some copy propagation
+ opportunities. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -fno-tree-dominator-opts" } */
+
+int
+foo (int a, int b, int c, int d)
+{
+ int x, y;
+
+ b = a;
+ if (a == b)
+ x = c;
+ else
+ {
+ link_error ();
+ x = d;
+ }
+
+ if (x == c)
+ return a;
+ else
+ {
+ link_error ();
+ return b;
+ }
+}
+
+main()
+{
+ foo (1, 2, 3, 4);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20933.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20933.c
new file mode 100644
index 000000000..d32d6003e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20933.c
@@ -0,0 +1,70 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern __SIZE_TYPE__ strlen (__const char *__s)
+ __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
+extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
+extern int access (__const char *__name, int __type) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
+extern void * xmalloc (__SIZE_TYPE__) __attribute__ ((__malloc__));
+
+static __inline__ const char *
+try (const char *dir, const char *base)
+{
+ if (base != 0)
+ return base;
+ if (dir != 0
+ && access (dir, 4 | 2 | 1) == 0)
+ return dir;
+ return 0;
+}
+
+static const char tmp[] = { '/', 't', 'm', 'p', 0 };
+static const char usrtmp[] =
+{ '/', 'u', 's', 'r', '/', 't', 'm', 'p', 0 };
+static const char vartmp[] =
+{ '/', 'v', 'a', 'r', '/', 't', 'm', 'p', 0 };
+
+static char *memoized_tmpdir;
+char *
+choose_tmpdir (void)
+{
+ const char *base = 0;
+ char *tmpdir;
+ unsigned int len;
+
+ if (memoized_tmpdir)
+ return memoized_tmpdir;
+
+ base = try (getenv ("TMPDIR"), base);
+ base = try (getenv ("TMP"), base);
+ base = try (getenv ("TEMP"), base);
+
+
+ base = try ("/tmp", base);
+
+
+
+ base = try (vartmp, base);
+ base = try (usrtmp, base);
+ base = try (tmp, base);
+
+
+ if (base == 0)
+ base = ".";
+
+
+
+ len = strlen (base);
+ tmpdir = xmalloc (len + 2);
+ strcpy (tmpdir, base);
+ /* Alias analysis was associating read-only memory tags to pointers
+ that are not read-only. We would then not issue any V_MAY_DEF in
+ this store. */
+ tmpdir[len] = '/';
+ tmpdir[len+1] = '\0';
+
+ memoized_tmpdir = tmpdir;
+ return tmpdir;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c
new file mode 100644
index 000000000..888d609ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/21001
+ VRP did not insert ASSERT_EXPRs when the variable tested in a
+ COND_EXPR is a single-use variable. By propagating the definition
+ of the single-use variable into the COND_EXPR, we can get useful
+ range information out of the conditional. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp1-details" } */
+
+int
+foo (int a)
+{
+ int b = a != 0;
+ if (b)
+ if (a != 0)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21029.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21029.c
new file mode 100644
index 000000000..de2595aee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21029.c
@@ -0,0 +1,118 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fwrapv" } */
+
+/* PR tree-optimization/21029
+
+ f() used to get optimized to an infinite loop by tree-vrp, because
+ j is assumed to be non-negative. Even though the conversion from
+ unsigned to signed has unspecified results if the expression value
+ is not representable in the signed type, the compiler itself (e.g.,
+ the Ada front end) depends on wrap-around behavior. */
+
+unsigned int f(void) {
+ unsigned char i = 123;
+ signed char j;
+
+ do
+ if ((j = (signed char) i) < 0)
+ break;
+ else
+ i++;
+ while (1);
+
+ return i;
+}
+
+/* Now let's torture it a bit further. Narrowing conversions need
+ similar treatment. */
+
+unsigned int f1 (void) {
+ unsigned short i = 123;
+ signed char j;
+
+ do
+ if ((j = (signed char) i) < 0)
+ break;
+ else
+ i++;
+ while (1);
+
+ return i;
+}
+
+/* And so do widening conversions. */
+
+unsigned int f2 (void) {
+ unsigned char i = 123;
+ signed short j;
+
+ do
+ if ((j = (signed short) (signed char) i) < 0)
+ break;
+ else
+ i++;
+ while (1);
+
+ return i;
+}
+
+/* Check same-sign truncations with an increment that turns into
+ decrements. */
+
+unsigned int f3 (void) {
+ signed short i = 5;
+ signed char j;
+
+ do
+ if ((j = (signed char) i) < 0)
+ break;
+ else
+ i += 255;
+ while (1);
+
+ return i;
+}
+
+/* Check that the truncation above doesn't confuse the result of the
+ test after a widening conversion. */
+
+unsigned int f4 (void) {
+ signed short i = -123;
+ signed int j;
+
+ do
+ if ((j = (signed int) (signed char) i) > 0)
+ break;
+ else
+ i += 255;
+ while (1);
+
+ return i;
+}
+
+/* Even if we omit the widening truncation, the narrowing truncation
+ is implementation-defined. */
+
+unsigned int f5 (void) {
+ signed long i = -123;
+ signed char j;
+
+ do
+ if ((j = (signed char) i) > 0)
+ break;
+ else
+ i += 255;
+ while (1);
+
+ return i;
+}
+
+int main (void) {
+ f ();
+ f1 ();
+ f2 ();
+ f3 ();
+ f4 ();
+ f5 ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21031.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21031.c
new file mode 100644
index 000000000..df200d564
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21031.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/21031
+
+ Make sure that a != 0 is propagated into the "if" statement. */
+
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1-details" } */
+
+int
+foo (int a)
+{
+ int b = a != 0;
+ unsigned char c = b;
+ if (c)
+ return 1;
+ else
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Replaced" 2 "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c
new file mode 100644
index 000000000..f924d26cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21086.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fdump-tree-dce1" } */
+
+int
+foo (int *p)
+{
+ int a = *p;
+ int b = p != 0;
+
+ *p = b;
+
+ if (b)
+ return a;
+ else
+ return 0;
+}
+
+/* Target with fno-delete-null-pointer-checks should not fold checks */
+/* { dg-final { scan-tree-dump "Folding predicate " "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate " 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-not "b_. =" "dce1" { target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump "b_. =" "dce1" { target { avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "dce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21090.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21090.c
new file mode 100644
index 000000000..40d960d49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21090.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int g, h;
+
+int
+foo (int a)
+{
+ int *p;
+
+ if (a)
+ p = &g;
+ else
+ p = &h;
+
+ if (p != 0)
+ return 1;
+ else
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21171.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21171.c
new file mode 100644
index 000000000..9f7278378
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21171.c
@@ -0,0 +1,29 @@
+/* PR 21171. Ivopts should not rewrite references to volatile memory. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+typedef unsigned int u_int32_t;
+typedef unsigned char u_int8_t;
+
+#define AIC_VECTORS 32
+
+typedef volatile struct AT91RM9200_regs {
+ u_int32_t SVR[AIC_VECTORS];
+} AT91RM9200_regs_t;
+
+#define CPUReg ((AT91RM9200_regs_t*)0xFFF00000)
+
+extern const u_int32_t __IntTable[AIC_VECTORS];
+
+int main()
+{
+ int c;
+
+ for (c = 0; c < AIC_VECTORS; c++)
+ CPUReg->SVR[c] = __IntTable[c];
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "SVR" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c
new file mode 100644
index 000000000..567e6366a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/21294
+ VRP did not notice that an address of the form &p->i is nonnull
+ when p is known to be nonnull. In this testcase, noticing that
+ allows us to eliminate the second "if" statement. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp1-details" } */
+
+struct f {
+ int i;
+};
+
+int
+foo (struct f *p)
+{
+ if (p != 0)
+ if (&p->i != 0)
+ return 123;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21332.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21332.c
new file mode 100644
index 000000000..8dd75ccc5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21332.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+// this testcase fails also on amd64:
+
+extern void abort (void);
+
+int f ()
+{
+ return -1;
+}
+
+int main ()
+{
+ int b, c, i;
+
+ b = 0;
+ c = f ();
+ if (c <= 0)
+ {
+ c = -c;
+ for (i = 0; i < c; i++)
+ b = 1;
+ if (!b)
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c
new file mode 100644
index 000000000..4a2c82143
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom2-details" } */
+
+struct tree_common
+{
+ int code;
+};
+union tree_node
+{
+ struct tree_common common;
+};
+typedef union tree_node *tree;
+
+extern tree test (tree, int, int);
+extern tree foo (void);
+extern void abort (void) __attribute__ ((__noreturn__));
+
+tree
+test (tree expr, int t, int D17630)
+{
+ int __i;
+
+L0:
+ if (expr->common.code != 142) goto L23; else goto L2;
+
+L2:
+ __i = 0;
+ goto L10;
+
+L10:
+ __i = __i + 1;
+ if (D17630 != __i) goto L8; else goto L19;
+
+L8:
+ if (t) goto L15; else goto L10;
+
+L15:
+ expr = foo ();
+ if (expr->common.code != 142) goto L23; else goto L0;
+
+L19:
+ abort ();
+
+L23:
+ return expr;
+}
+
+
+/* We should thread the backedge to the top of the loop; ie we only
+ execute the if (expr->common.code != 142) test once per loop
+ iteration. */
+/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "dom2" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21458.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21458.c
new file mode 100644
index 000000000..01777f6e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21458.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void g (void);
+extern void bar (int);
+
+int
+foo (int a)
+{
+ int i;
+
+ for (i = 1; i < 100; i++)
+ {
+ if (i)
+ g ();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c
new file mode 100644
index 000000000..3f63cdd8e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21463.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-phiprop-details" } */
+
+struct f
+{
+ int i;
+};
+
+int g(int i, int c, struct f *ff, int g)
+{
+ int *t;
+ if (c)
+ t = &i;
+ else
+ t = &ff->i;
+ return *t;
+}
+
+/* { dg-final { scan-tree-dump-times "Inserting PHI for result of load" 1 "phiprop" } } */
+/* { dg-final { cleanup-tree-dump "phiprop" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21559.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21559.c
new file mode 100644
index 000000000..6378d1aa7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21559.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+static int blocksize = 4096;
+
+int bar (int);
+
+void foo (void)
+{
+ int toread;
+ int bytes;
+ static char eof_reached = 0;
+
+ toread = blocksize;
+ bytes = 1;
+
+ while (toread != 0)
+ {
+ bytes = bar (toread);
+ if (bytes <= 0)
+ {
+ if (bytes < 0)
+ continue;
+ break;
+ }
+ toread -= bytes;
+ }
+
+ if (bytes == 0)
+ eof_reached = 1;
+}
+
+
+/* First, we should simplify the bits < 0 test within the loop. */
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
+
+/* Second, we should thread the edge out of the loop via the break
+ statement. We also realize that the final bytes == 0 test is useless,
+ and thread over it. We also know that toread != 0 is useless when
+ entering while loop and thread over it. */
+/* { dg-final { scan-tree-dump-times "Threaded jump" 3 "vrp1" } } */
+
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21563.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21563.c
new file mode 100644
index 000000000..8e6c57850
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21563.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/21563
+ Make sure VRP folds the second "if" statement. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp1-details" } */
+
+int
+foo (int a)
+{
+ if (a > 1)
+ if (a == 0)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c
new file mode 100644
index 000000000..dcfa13151
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21574.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+int
+foo (int *p)
+{
+ *p = 0;
+ return *p;
+}
+
+/* The store to *p should be propagated to the load statement. */
+/* { dg-final { scan-tree-dump "Replaced \\\*p_.\\\(D\\\) with 0" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21582.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21582.c
new file mode 100644
index 000000000..0f5dc9ec1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21582.c
@@ -0,0 +1,28 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+static inline void do_thing(char *s, int *p, char *q)
+{
+ /* This should be folded away. */
+ if (s == 0 || q == 0)
+ link_error ();
+
+ /* This should not be folded as 'p' is not marked nonnull. */
+ if (p)
+ *p = 3;
+}
+
+void __attribute__((nonnull (1, 3))) do_other_thing(char *s, int *p, char *q)
+{
+ do_thing(s, p, q);
+}
+
+int i;
+
+main()
+{
+ do_other_thing ("xxx", &i, "yyy");
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*" 0 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c
new file mode 100644
index 000000000..c1a48c04b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/21658
+ CCP did not propagate an ADDR_EXPR far enough, preventing the "if"
+ statement below from being folded. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-ccp1-details" } */
+
+void link_error (void);
+
+void
+f (void)
+{
+ int a[10];
+ int *p = &a[5];
+ int *q = p - 1;
+ if (q != &a[4])
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-times "Folded into: if " 1 "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
new file mode 100644
index 000000000..c95714ab9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int test(int v)
+{
+ int x = 0;
+ int u;
+ for (u=0;u<2;u++)
+ {
+ if (u>v)
+ {
+ if (u%2==1)
+ x++;
+ }
+ }
+ return x;
+}
+
+/* This should be unrolled and optimized into conditional set of return value "v < 0". */
+
+/* { dg-final { scan-tree-dump-not "if \\(" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21959.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21959.c
new file mode 100644
index 000000000..decbcaf3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21959.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+unsigned char c[0xFF];
+void f(void)
+{
+ unsigned char i;
+ c[128] = 128;
+ i = 0;
+ while (1)
+ {
+ /* This predicate should not be folded out. */
+ if (((signed char) i) < 0) break;
+ c[i] = ' ';
+ i++;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate " 0 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21985.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21985.c
new file mode 100644
index 000000000..19ad0f113
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr21985.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+struct
+{
+ struct
+ {
+ int a;
+ int b;
+ } a[100];
+} a;
+
+typedef __SIZE_TYPE__ size_t;
+void foo(size_t);
+size_t *bar (void);
+
+int
+main (void)
+{
+ size_t *b = bar ();
+
+ /* This should be folded. */
+ foo (&a.a[50].a - &a.a[33].b);
+ foo ((size_t) &a.a[50].b - (size_t) &a);
+
+ /* And this should not. */
+ foo ((size_t) &b - (size_t) b);
+ return 0;
+}
+
+/* Two of the calls to foo should be folded to just foo(constant). */
+
+/* { dg-final { scan-tree-dump-times "foo \\(\[0-9\]*\\)" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22018.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22018.c
new file mode 100644
index 000000000..d4d332c2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22018.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options -O2 } */
+
+void abort (void);
+void g(int);
+void f(int l)
+{
+ unsigned i;
+ for (i = 0; i < l; i++)
+ {
+ int y = i;
+ /* VRP was wrongfully computing z's range to be [0, 0] instead
+ of [-INF, 0]. */
+ int z = y*-32;
+ g(z);
+ }
+}
+
+void g(int i)
+{
+ static int x = 0;
+ if (i == 0)
+ x ++;
+ if (x > 1)
+ abort ();
+}
+
+int main(void)
+{
+ f(3);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22026.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22026.c
new file mode 100644
index 000000000..7e6914d9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22026.c
@@ -0,0 +1,49 @@
+/* PR tree-optimization/22026
+ VRP used think that ~[0,0] + ~[0,0] = ~[0,0], which is wrong. The
+ same applies to subtraction and unsigned multiplication. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int
+plus (int x, int y)
+{
+ if (x != 0)
+ if (y != 0)
+ {
+ int z = x + y;
+ if (z != 0)
+ return 1;
+ }
+ return 0;
+}
+
+int
+minus (int x, int y)
+{
+ if (x != 0)
+ if (y != 0)
+ {
+ int z = x - y;
+ if (z != 0)
+ return 1;
+ }
+ return 0;
+}
+
+int
+mult (unsigned x, unsigned y)
+{
+ if (x != 0)
+ if (y != 0)
+ {
+ unsigned z = x * y;
+ if (z != 0)
+ return 1;
+ }
+ return 0;
+}
+
+/* None of the predicates can be folded in these functions. */
+/* { dg-final { scan-tree-dump-times "Folding predicate" 0 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c
new file mode 100644
index 000000000..73bda118f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22051-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+
+void *arf ();
+int
+foo()
+{
+ void *p = arf ();
+
+ if ((void (*)(void))p != 0)
+ return 1;
+ else
+ return 2;
+}
+
+/* The cast to a function pointer type must remain after all optimizations
+ are complete so that function pointer canonicalization works on those
+ targets which require it. */
+/* { dg-final { scan-tree-dump-times "= \\(void \\(\\*<.*>\\) \\(void\\)\\) p_" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22051-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22051-2.c
new file mode 100644
index 000000000..bcbbb73c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22051-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -w" } */
+
+
+
+
+void *arf ();
+int
+foo()
+{
+ void (*q)(void);
+ int r = q;
+
+ if (r != 0)
+ return 1;
+ else
+ return 2;
+}
+
+/* The cast to an int type must remain after all optimizations are complete
+ so that we do not try to canonicalize a function pointer for the
+ comparison when no such canonicalization is wanted. */
+/* { dg-final { scan-tree-dump-times "r_. = \\(int\\) q" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22117.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22117.c
new file mode 100644
index 000000000..d265d5e2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22117.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/22117
+ VRP used think that &p[q] is nonzero even though p and q are both
+ known to be zero after entering the first two "if" statements. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+void
+foo (int *p, int q)
+{
+ if (p == 0)
+ {
+ if (q == 0)
+ {
+ int *r = &p[q];
+ if (r != 0)
+ link_error ();
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate r_.* != 0B to 0" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22171.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22171.c
new file mode 100644
index 000000000..6a26c56d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22171.c
@@ -0,0 +1,28 @@
+/* { dg-options "-O2" } */
+
+static unsigned int old_serial_port_irq[10];
+
+static struct uart_8250_port {
+ volatile unsigned int slock;
+ unsigned int irq;
+} serial8250_ports[10];
+
+static __inline__ __attribute__((always_inline)) int irq_canonicalize(int irq)
+{
+ return ((irq == 2) ? 9 : irq);
+}
+
+void serial8250_isa_init_ports(void)
+{
+ struct uart_8250_port *up;
+ int i;
+
+ for (i = 0, up = serial8250_ports; i < 10; i++, up++)
+ up->irq = irq_canonicalize(old_serial_port_irq[i]);
+}
+
+int main(void)
+{
+ serial8250_isa_init_ports();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22230.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22230.c
new file mode 100644
index 000000000..4d6534909
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22230.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -ftree-vrp" } */
+
+/* PR tree-optimization/22230
+
+ The meet of the ranges in "i*i" was not computed correctly, leading
+ gcc to believe that a was equal to 0 after the loop. */
+
+extern void abort (void) __attribute__((noreturn));
+
+int main (void)
+{
+ long a, i;
+
+ for (i = 0; i < 5; i++)
+ a = i * i;
+ if (a != 16)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22236.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22236.c
new file mode 100644
index 000000000..1986c2f0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22236.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -fno-tree-vrp -fwrapv" } */
+
+/* PR tree-optimization/22236
+
+ Avoid conversion of (signed char) {(uchar)1, +, (uchar)1}_x when
+ it is not possible to prove that the scev does not wrap.
+
+ In this PR, a sequence 1, 2, ..., 255 has to be converted to
+ signed char, but this would wrap: 1, 2, ..., 127, -128, ... The
+ result should not be a linear scev {(schar)1, +, (schar)1}_x.
+ The conversion should be kept: (schar) {(uchar)1, +, (uchar)1}_x.
+ */
+
+void abort(void);
+
+static inline void
+foo (signed char a)
+{
+ int b = a - 0x7F;
+ if (b > 1)
+ abort();
+}
+
+int main()
+{
+ unsigned char b;
+ for(b = 0; b < 0xFF; b++)
+ foo (b);
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22321.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22321.c
new file mode 100644
index 000000000..64a94ab2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22321.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-vrp -fno-tree-copy-prop -fno-tree-ccp -fdump-tree-optimized" } */
+
+
+volatile int x;
+
+int main ()
+{
+ volatile int *vip;
+ vip = &x;
+ volatile int *cvip;
+ cvip = vip;
+
+ if (vip != cvip) return -1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22591.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22591.c
new file mode 100644
index 000000000..f1f5ec849
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr22591.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort ();
+
+typedef struct _Node
+{
+ struct _Node *next, *prev;
+} Node;
+
+void __attribute__ ((noinline)) append (Node * q, Node * p)
+{
+ p->next = q;
+ p->prev = q;
+ q->next = p;
+ q->prev = p;
+}
+
+inline void
+swap (Node ** a, Node ** b)
+{
+ Node *tmp = *a;
+ *a = *b;
+ *b = tmp;
+}
+
+/* Miscompilation seems to happen here. If one removes the if condition
+ (which should be true) the program works fine. */
+void
+ListSwap (Node * x, Node * y)
+{
+ Node *tmp;
+ if (x->next)
+ {
+ swap (&x->next, &y->next);
+ swap (&x->prev, &y->prev);
+ x->next->prev = x->prev->next = x;
+ y->next->prev = y->prev->next = y;
+ }
+}
+
+int
+main ()
+{
+ Node A, A1, B, B1;
+
+ append (&A, &A1);
+ append (&B, &B1);
+
+ ListSwap (&A, &B);
+
+ if (&A != A.next->prev)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23048.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23048.c
new file mode 100644
index 000000000..7dc67ea29
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23048.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize" } */
+
+void f(unsigned char *mem)
+{
+ int i;
+
+ for(i=0;i<4;i++) {
+ while(mem[i]==0) ;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23086.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23086.c
new file mode 100644
index 000000000..206b92de1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23086.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+extern void link_error (void);
+extern void abort (void);
+
+int *t;
+int __attribute__((noinline)) g(int *a)
+{
+ t = a;
+ *a = 2;
+}
+
+void __attribute__((noinline)) f(int *a)
+{
+ int b;
+ b = 1;
+ g(&b);
+ b = 2;
+ *a = 1;
+ if (b != 2)
+ link_error();
+}
+
+int main(void)
+{
+ int t;
+ f(&t);
+ if (t != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23109.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23109.c
new file mode 100644
index 000000000..73fd84d92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23109.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funsafe-math-optimizations -ftrapping-math -fdump-tree-recip -fdump-tree-lim1" } */
+/* { dg-warning "-fassociative-math disabled" "" { target *-*-* } 1 } */
+
+double F[2] = { 0., 0. }, e = 0.;
+
+int main()
+{
+ int i;
+ double E, W, P, d;
+
+ /* make sure the program crashes on FP exception */
+ unsigned short int Mask;
+
+ W = 1.;
+ d = 2.*e;
+ E = 1. - d;
+
+ for( i=0; i < 2; i++ )
+ if( d > 0.01 )
+ {
+ P = ( W < E ) ? (W - E)/d : (E - W)/d;
+ F[i] += P;
+ }
+
+ return 0;
+}
+
+/* LIM only performs the transformation in the no-trapping-math case. In
+ the future we will do it for trapping-math as well in recip, check that
+ this is not wrongly optimized. */
+/* { dg-final { scan-tree-dump-not "reciptmp" "lim1" } } */
+/* { dg-final { scan-tree-dump-not "reciptmp" "recip" } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23115.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23115.c
new file mode 100644
index 000000000..61408e47a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23115.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+extern void abort (void);
+
+#define MIN2(a,b) (((a)<(b)) ? (a) : (b))
+#define MAX2(a,b) (((a)>(b)) ? (a) : (b))
+
+double p[2] = { 4., 5. };
+
+int main()
+{
+ long j;
+ double R, n, x;
+#if __SIZEOF_DOUBLE__ >= 8
+ n = 1.e300;
+ x = -1.e300;
+#else
+ n = 1.e30;
+ x = -1.e30;
+#endif
+ for( j=0; j < 2; j++ )
+ {
+ x = MAX2(x,p[j]);
+ n = MIN2(n,p[j]);
+ }
+ R = x-n;
+
+ if( R < 0.1 )
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23192.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23192.c
new file mode 100644
index 000000000..2a606a5c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23192.c
@@ -0,0 +1,23 @@
+/* { dg-options "-O2" } */
+/* { dg-do run } */
+
+struct S { int i; } s;
+
+void f (struct S *q)
+{
+ int a, *p;
+ p = &a;
+ if (q)
+ p = &q->i;
+ *p = 1;
+}
+
+void abort (void);
+
+int main (void)
+{
+ f (&s);
+ if (s.i != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c
new file mode 100644
index 000000000..3a3869815
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c
@@ -0,0 +1,58 @@
+/* The problem in this PR was mostly finding a suitable place to insert
+ the reciprocals of the function arguments. This test case tries to
+ test three possible ways of how this may go wrong. */
+/* { dg-options "-O2 -ffast-math" } */
+/* { dg-do compile } */
+
+/* The original test case. */
+double
+f1 (double a, double b, double c)
+{
+ double y0;
+ double y1;
+
+ if (a == 0.0)
+ {
+ y0 = -c / b;
+ return y0;
+ }
+ y0 = c / b;
+ y1 = a / b;
+ return y0 * y1;
+}
+
+/* Labels may end up in the middle of a block. Also bad. */
+double
+f2 (double a, double b, double c)
+{
+ double y0;
+ double y1;
+
+a_label:
+another_label:
+ if (a == 0.0)
+ {
+ y0 = -c / b;
+ return y0;
+ }
+ y0 = c / b;
+ y1 = a / b;
+ return y0 * y1;
+}
+
+/* Uses must still be dominated by their defs. */
+double
+f3 (double a, double b, double c)
+{
+ double y0;
+ double y1;
+
+ y0 = -c / b;
+ if (a == 0.0)
+ {
+ return y0;
+ }
+ y0 = c / b;
+ y1 = a / b;
+ return y0 * y1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c
new file mode 100644
index 000000000..ed890fa55
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int f1(int a)
+{
+ return a*6-a;
+}
+
+int f2(int a)
+{
+ return a*4+a;
+}
+
+int f3(int a)
+{
+ return 2*a + 3*a;
+}
+
+int f4(int a, int b)
+{
+ return 2*a + 6*b;
+}
+
+int f5(int a, int b)
+{
+ return 2*a - 6*b;
+}
+
+int f6(int a, int b)
+{
+ return 6*a - 2*b;
+}
+
+/* { dg-final { scan-tree-dump-times "a_..D. \\\* 5" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\\* 2" 3 "optimized" } } */
+/* { dg-final { scan-tree-dump-not "\\\* 6" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23386.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23386.c
new file mode 100644
index 000000000..d322f995b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23386.c
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int f[100];
+int g[100];
+unsigned char
+f1 (int a, int b)
+{
+ __SIZE_TYPE__ ix;
+ if (a)
+ return 1;
+ for (ix = 4; ix--;)
+ if (f[ix] != g[ix])
+ return 0;
+ return 1;
+}
+
+int main(void)
+{
+ if (!f1 (0, 2))
+ __builtin_abort();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23391.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23391.c
new file mode 100644
index 000000000..a5effbb15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23391.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo (int N)
+{
+ int C;
+ double R;
+
+ R = 0.0;
+ do
+ {
+ R += 0.001;
+ C = (int) (R * N);
+ if (-R * N <= R * N)
+ {
+ C++;
+ }
+ }
+ while (C < 0);
+
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23401.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23401.c
new file mode 100644
index 000000000..1d30ac751
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23401.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+struct f
+{
+ struct {
+ int i;
+ } ff[10];
+};
+
+struct f g;
+int ffff(int i)
+{
+ int t1 = 0;
+ int i1 = g.ff[t1].i;
+ int i2 = g.ff[i].i;
+ return i1 + i2;
+}
+
+/* We should not use extra temporaries apart from for i1 + i2. */
+
+/* { dg-final { scan-tree-dump-times "int" 5 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "int D\\\." 1 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23433.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23433.c
new file mode 100644
index 000000000..464d4b542
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23433.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+double transport_sumexp(int numexp)
+{
+ int k,j;
+ double xk1 = 1.0;
+ for(k=1; k<=numexp;k++)
+ for(j=1;j<=3;j++)
+ xk1 += 1.0;
+ return xk1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23434.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23434.c
new file mode 100644
index 000000000..a21b95566
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23434.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+cblas_csyr2k (int N, void *A, int lda, float *B, int ldb, float *C, int k)
+{
+ int i, j;
+ for (;; k ++)
+ {
+ for (i = 0; i < N; i ++)
+ {
+ float t = ((float * ) A) [i];
+ for (j = i; j < N; j ++)
+ {
+ C [i + j] = B [ldb] * ((float *) A) [k];
+ C [lda] = 0 ;
+ }
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
new file mode 100644
index 000000000..6522f99f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23455.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+#ifdef _WIN64
+#define LONG long long
+#else
+#define LONG long
+#endif
+
+unsigned LONG outcnt;
+extern void flush_outbuf(void);
+
+void
+bi_windup(unsigned int *outbuf, unsigned int bi_buf)
+{
+ unsigned LONG t1 = outcnt;
+ outbuf[t1] = bi_buf;
+
+ unsigned LONG t2 = outcnt;
+ if (t2 == 16384)
+ flush_outbuf();
+
+ unsigned LONG t3 = outcnt;
+ outbuf[t3] = bi_buf;
+}
+/* We should eliminate one load of outcnt, which will in turn let us eliminate
+ one multiply of outcnt which will in turn let us eliminate
+ one add involving outcnt and outbuf. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" {target { ! avr-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "pre" {target { avr-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23546.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23546.c
new file mode 100644
index 000000000..06324dfcb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23546.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+typedef int m64 __attribute__ ((__vector_size__ (8)));
+
+void mmxCombineMaskU (m64 * mask, int width)
+{
+ while (--width >= 0)
+ *mask++ = (m64) 0LL;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23744.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23744.c
new file mode 100644
index 000000000..538139676
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23744.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-vrp1" } */
+
+int g (int i, int j)
+{
+ int t = 0;
+ int i1;
+
+ if (i == j)
+ t = 3;
+ for (i1 = 0; i1 < 10000; i1++) h();
+ if (t != 5)
+ return 0;
+ else
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23777.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23777.c
new file mode 100644
index 000000000..c2ad9b707
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23777.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern void f(char *const *);
+void g (char **o)
+{
+ static const char *const multilib_exclusions_raw[] = { 0 };
+ const char *const *q = multilib_exclusions_raw;
+
+ f (o);
+ while (*q++)
+ f (o);
+}
+
+/* The last DCE pass is able to remove the load from
+ multilib_exclusions_raw. */
+
+/* { dg-final { scan-tree-dump-not "multilib_exclusions_raw" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-1.c
new file mode 100644
index 000000000..08916e4e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-1.c
@@ -0,0 +1,32 @@
+/* PR middle-end/23848 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void bar1 (char *, int);
+void foo1 (int size)
+{
+ char temp[size];
+ temp[size-1] = '\0';
+ bar1 (temp, size);
+}
+
+void bar2 (char *, char *, char *, char *, int);
+void foo2 (int size)
+{
+ char temp[size];
+ temp[size-1] = '\0';
+ {
+ char temp2[size];
+ {
+ char temp3[size];
+ {
+ char temp4[size];
+ bar2 (temp, temp2, temp3, temp4, size);
+ }
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "__builtin_stack_save" "optimized"} } */
+/* { dg-final { scan-tree-dump-not "__builtin_stack_restore" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-2.c
new file mode 100644
index 000000000..c9691469d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-2.c
@@ -0,0 +1,25 @@
+/* PR middle-end/23848 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void bar (char *, char *, char *, char *, int);
+void foo (int size)
+{
+ char temp[size];
+ temp[size-1] = '\0';
+ {
+ char temp2[size];
+ {
+ char temp3[size];
+ {
+ char temp4[size];
+ bar (temp, temp2, temp3, temp4, size);
+ }
+ }
+ bar (temp, temp2, (char *) 0, (char *) 0, size);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "__builtin_stack_save" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "__builtin_stack_restore" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-3.c
new file mode 100644
index 000000000..d2555049b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-3.c
@@ -0,0 +1,28 @@
+/* PR middle-end/23848 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void bar (int, char *, char *, char *, char *, int);
+void foo (int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ {
+ char temp[size];
+ temp[size-1] = '\0';
+ {
+ char temp2[size];
+ {
+ char temp3[size];
+ {
+ char temp4[size];
+ bar (i, temp, temp2, temp3, temp4, size);
+ }
+ }
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "__builtin_stack_save" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "__builtin_stack_restore" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-4.c
new file mode 100644
index 000000000..66b21b81e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr23848-4.c
@@ -0,0 +1,25 @@
+/* PR middle-end/23848 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void bar (char *, char *, char *, char *, int);
+void foo (int size)
+{
+ char temp[size];
+ temp[size-1] = '\0';
+ {
+ char temp2[size];
+ {
+ char temp3[size];
+ {
+ char temp4[size];
+ bar (temp, temp2, temp3, temp4, size);
+ }
+ }
+ __asm __volatile ("" : : "r" (&temp[0]), "r" (&temp2[0]) : "memory");
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "__builtin_stack_save" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "__builtin_stack_restore" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24117.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24117.c
new file mode 100644
index 000000000..ffa5dd04c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24117.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+typedef struct {
+ int x;
+ int z;
+} Foo_t;
+
+char *xm;
+void bar(void);
+
+void foo(void)
+{
+ Foo_t x;
+ x.x = 1;
+ x.z = 2;
+ xm = (char *)&x;
+ bar();
+ /* We can't propagate x.z past bar, so this link_error should still be there. */
+ if (x.z != 2)
+ link_error ();
+}
+/* { dg-final { scan-tree-dump-times "link_error" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24287.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24287.c
new file mode 100644
index 000000000..c264fbcb2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24287.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int g1(int);
+int h(int *a, int *b)__attribute__((pure));
+void link_error();
+
+/* The calls to link_error should be eliminated, since nothing escapes to
+ non-pure functions. */
+int g(void)
+{
+ int t = 0, t1 = 2;
+ /* ??? That's not true. The pointers escape to the integer return
+ value which we do not track in PTA. */
+ int t2 = h(&t, &t1);
+ if (t != 0)
+ link_error ();
+ if (t1 != 2)
+ link_error ();
+ /* ??? And it would finally escape here even if we did. */
+ g1(t2);
+ if (t != 0)
+ link_error ();
+ if (t1 != 2)
+ link_error ();
+ return t2 == 2;
+}
+/* We are allowed to optimize the first two link_error calls. */
+/* { dg-final { scan-tree-dump-times "link_error" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24627.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24627.c
new file mode 100644
index 000000000..c065eef84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24627.c
@@ -0,0 +1,67 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+/* { dg-require-effective-target int32plus } */
+
+extern void abort (void);
+typedef unsigned int u_int32;
+
+typedef struct {
+ union {u_int32 Xl_ui;} Ul_i;
+ union {u_int32 Xl_uf;} Ul_f;
+} l_fp;
+
+void
+dolfptoa (short ndec)
+{
+ l_fp work, ftmp;
+
+ work.Ul_i.Xl_ui = 0;
+ work.Ul_f.Xl_uf = 0x535f3d8;
+
+ while (ndec > 0)
+ {
+ u_int32 lo_tmp;
+ u_int32 hi_tmp;
+
+ ndec--;
+ work.Ul_i.Xl_ui = 0;
+ work.Ul_i.Xl_ui <<= 1;
+ if ((work.Ul_f.Xl_uf) & 0x80000000)
+ (work.Ul_i.Xl_ui) |= 0x1;
+ (work.Ul_f.Xl_uf) <<= 1;
+
+ ftmp = work;
+ (work.Ul_i.Xl_ui) <<= 1;
+ if ((work.Ul_f.Xl_uf) & 0x80000000)
+ (work.Ul_i.Xl_ui) |= 0x1;
+ (work.Ul_f.Xl_uf) <<= 1;
+
+ (work.Ul_i.Xl_ui) <<= 1;
+ if ((work.Ul_f.Xl_uf) & 0x80000000)
+ (work.Ul_i.Xl_ui) |= 0x1;
+ (work.Ul_f.Xl_uf) <<= 1;
+
+ lo_tmp = ((work.Ul_f.Xl_uf) & 0xffff) + ((ftmp.Ul_f.Xl_uf) & 0xffff);
+ hi_tmp = (((work.Ul_f.Xl_uf) >> 16) & 0xffff)
+ + (((ftmp.Ul_f.Xl_uf) >> 16) & 0xffff);
+
+ if (lo_tmp & 0x10000)
+ hi_tmp++;
+
+ (work.Ul_f.Xl_uf) = ((hi_tmp & 0xffff) << 16) | (lo_tmp & 0xffff);
+ (work.Ul_i.Xl_ui) += (ftmp.Ul_i.Xl_ui);
+
+ if (hi_tmp & 0x10000)
+ (work.Ul_i.Xl_ui)++;
+
+
+ if (!(work.Ul_i.Xl_ui < 10))
+ abort ();
+ }
+}
+
+int main()
+{
+ dolfptoa(6);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24670.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24670.c
new file mode 100644
index 000000000..a5ff800d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24670.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+__inline__ void
+shift128Right (int count, long long int *z1Ptr)
+{
+ long long int z1;
+ if (count == 0);
+ else if (count < 64);
+ else
+ z1 = (count < 64) ? count : 0;
+ *z1Ptr = z1;
+}
+
+float128_rem ()
+{
+ signed int expDiff;
+ long long int aSig1;
+ long long int sigMean1;
+ if (-64 < expDiff)
+ shift128Right (-expDiff, &aSig1);
+ add128 (&sigMean1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24689.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24689.c
new file mode 100644
index 000000000..4fe74b658
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24689.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+extern void bar (unsigned int);
+
+int
+foo (void)
+{
+ char buf[1] = { 3 };
+ const char *p = buf;
+ const char **q = &p;
+ unsigned int ch;
+ switch (**q)
+ {
+ case 1: ch = 5; break;
+ default: ch = 0; break;
+ }
+
+ bar (ch);
+ return ch;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr2480.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr2480.c
new file mode 100644
index 000000000..d7f7af4d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr2480.c
@@ -0,0 +1,53 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+/* We have enough cascading at -O2 to cover the missed control-dependence
+ in SCCVN (which considers the link_error calls to clobber the structs). */
+
+struct example
+{
+ char a;
+ int b;
+ char c;
+} *ex1;
+
+extern void link_error(void);
+
+void
+bar (void)
+{
+ ex1->a = 1;
+ ex1->b = 2;
+ ex1->c = 3;
+
+ if (ex1->a != 1)
+ link_error ();
+ if (ex1->b != 2)
+ link_error ();
+ if (ex1->c != 3)
+ link_error ();
+
+}
+
+void
+foo (struct example *ex2)
+{
+ ex2->a = 1;
+ ex2->b = 2;
+ ex2->c = 3;
+
+ if (ex2->a != 1)
+ link_error ();
+ if (ex2->b != 2)
+ link_error ();
+ if (ex2->c != 3)
+ link_error ();
+
+}
+
+int main (void)
+{
+ bar ();
+ foo (ex1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
new file mode 100644
index 000000000..736dafdec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef struct
+{
+ int tag, y;
+} Object;
+
+void Err_Handler () __attribute__ ((__noreturn__));
+
+int
+P_Error (int argc, Object * argv)
+{
+ if (((argv[1]).tag >> 1) != 11)
+ Wrong_Type (argv[1], 11);
+ Err_Handler (argv[0], argv[1], argc - 2, argv + 2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24990-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24990-1.c
new file mode 100644
index 000000000..a518df025
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr24990-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+int f(int x)
+{
+ return ((~x) != 0);
+}
+int f1(int x)
+{
+ return ((~x) == 0);
+}
+
+/* There should be no != 0 which is produced by the front-end as
+ ~x != 0 is the same as x != -1 (or ~0). Likewise for ==. */
+/* { dg-final { scan-tree-dump-times "!= 0" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "!= -1" 1 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "== 0" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "== -1" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25382.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25382.c
new file mode 100644
index 000000000..daff68ee9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25382.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/25382
+ VRP used to ignore BIT_AND_EXPRs for the purpose of distilling ranges.
+ Check that VRP now gets ranges from BIT_AND_EXPRs. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-vrp1" } */
+
+int
+foo (int a)
+{
+ int b = a & 0xff;
+ if (b > 300)
+ return 2;
+ else
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate b_.* > 300 to 0" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25485.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25485.c
new file mode 100644
index 000000000..93f583cc3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25485.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/25485
+ VRP did not fold TRUTH_AND_EXPR. Make sure it does now. */
+
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int
+foo (int a, int b)
+{
+ if (a > 50)
+ return 19;
+ if (a > 63 && b < 50)
+ return 17;
+ return 31;
+}
+
+/* { dg-final { scan-tree-dump-times "if" 1 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25501.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25501.c
new file mode 100644
index 000000000..1fb2c7eba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25501.c
@@ -0,0 +1,36 @@
+/* PR tree-optimization/25501
+ The PHI merge pass used to try to merge PHI nodes that cannot
+ actually merged, causing a segfault later. Make sure that does not
+ happen any more. */
+
+/* { dg-options "-O1 -fdump-tree-mergephi1" } */
+
+int
+foo (int a)
+{
+ int b;
+ int c;
+ int d;
+
+ if (a == 2)
+ b = 3;
+ else
+ b = 5;
+
+ c = 7;
+
+ d = 11;
+
+ for (;;)
+ {
+ if (d == 5)
+ break;
+
+ d = b;
+ }
+
+ return 13;
+}
+
+/* { dg-final { scan-tree-dump-times "Removing basic block" 0 "mergephi1"} } */
+/* { dg-final { cleanup-tree-dump "mergephi1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25734.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25734.c
new file mode 100644
index 000000000..a71c7f01a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr25734.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+struct list_head {
+ struct list_head *next;
+};
+static inline __attribute__((always_inline)) void list_del_init(struct
+list_head *entry)
+{
+ __list_del(entry->next);
+ (entry)->next = (entry);
+};
+struct dentry {
+ void *d_fsdata;
+};
+struct sysfs_dirent {
+ struct list_head s_sibling;
+ struct list_head s_children;
+};
+const char *sysfs_get_name(struct sysfs_dirent *);
+void sysfs_hash_and_remove(struct dentry * dir, const char * name)
+{
+ struct sysfs_dirent * sd;
+ struct sysfs_dirent * parent_sd = dir->d_fsdata;
+ for (sd = (struct sysfs_dirent *)((&parent_sd->s_children)->next);
+ &sd->s_sibling != (&parent_sd->s_children);
+ sd = (struct sysfs_dirent *)sd->s_sibling.next) {
+ if (!__builtin_strcmp(sysfs_get_name(sd), name))
+ {
+ list_del_init(&sd->s_sibling);
+ break;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26180.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26180.c
new file mode 100644
index 000000000..13c302dea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26180.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target int32plus } */
+
+void abort(void);
+int bar(int x, int y)
+{
+ int x1, y1;
+ int x2, y2;
+ unsigned int x3, y3, w;
+ int z = 1;
+
+ x1 = (x < (1 << 30));
+ y1 = (y < (1 << 30));
+ if (x1)
+ if (y1) {
+ x2 = ((x > 0)? (x): -(x));
+ y2 = ((y > 0)? (y): -(y));
+
+ x3 = x2;
+ y3 = y2;
+ w = x3 * y3;
+
+ if (w >= (1 << 30)) {
+ z = 1;
+ } else {
+ z = -1;
+ }
+ }
+
+ return z;
+}
+
+
+int main()
+{
+ int x, y, z;
+ x = 536870912; /* 2^29 */
+ y = 2;
+ z = bar(x, y);
+ if (z != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c
new file mode 100644
index 000000000..70f123158
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+typedef struct {
+ int i;
+ int j;
+ int k;
+} Foo;
+
+void bar(Foo*);
+int foo(void)
+{
+ Foo a;
+ a.i = 1;
+ bar(&a);
+ return a.i;
+}
+
+/* Verify the call clobbers all of a. */
+
+/* { dg-final { scan-tree-dump-not "return 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26899.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26899.c
new file mode 100644
index 000000000..2e9941060
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr26899.c
@@ -0,0 +1,10 @@
+/* { dg-options "-fstrict-overflow -fdump-tree-gimple" } */
+
+int foo (int i, int j)
+{
+ return (i < j + 1) || (j > i - 1);
+}
+
+/* { dg-final { scan-tree-dump "j >= i" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27236.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27236.c
new file mode 100644
index 000000000..389b65206
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27236.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static inline int inline_read(volatile int *mem)
+{
+ return *mem;
+}
+__attribute__ ((noinline))
+int foo_read(volatile int *mem)
+{
+ return inline_read(mem);
+}
+unsigned int foo(volatile int *mem)
+{
+ foo_read(mem);
+ return foo_read(mem);
+}
+
+/* { dg-final { scan-tree-dump-times "foo_read" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27498.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27498.c
new file mode 100644
index 000000000..75d3d4bac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27498.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+void zconfdump(void)
+{
+ char *p, *p2;
+ for (p2 = p; p2; )
+ {
+ char __a0, __a1, __a2;
+ __a0 = ((__const char *) ("\"\\"))[0];
+ if (__a0)
+ return;
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "goto" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27781.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27781.c
new file mode 100644
index 000000000..233c93dac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27781.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-weak-override "" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void __attribute__((weak)) func(void)
+{
+ /* no code */
+}
+
+int main()
+{
+ func();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "func \\(\\);" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27799.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27799.c
new file mode 100644
index 000000000..de09a40e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27799.c
@@ -0,0 +1,26 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+struct X { double m; int x; };
+struct Y { int y; short d; };
+struct YY { int y; short d; char c; };
+
+extern void link_error (void);
+
+int foo(struct X *x, struct Y *y)
+{
+ x->x = 0;
+ y->y = 1;
+ if (x->x != 0)
+ link_error ();
+}
+
+int foo_no(struct X *x, struct YY *y)
+{
+ x->x = 0;
+ y->y = 1;
+ if (x->x != 0)
+ link_error ();
+}
+
+int main() {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27810.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27810.c
new file mode 100644
index 000000000..c7da3bd5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr27810.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+int bar (int);
+
+int qqq (int a)
+{
+ int result;
+ result = bar (a);
+ return result;
+}
+
+/* We should not use an extra temporary for the result of the
+ function call. */
+
+/* { dg-final { scan-tree-dump-times "int" 3 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "int D\\\." 1 "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr28410.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr28410.c
new file mode 100644
index 000000000..adc49b15c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr28410.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort(void);
+struct Bar { int p; };
+struct Foo { struct Bar *p; };
+struct Bar p0 = { 0 };
+struct Bar p1 = { 1 };
+void bar(struct Foo *f)
+{
+ f->p = &p0;
+}
+int foo(struct Foo *f)
+{
+ f->p->p = 1;
+ bar(f);
+ return f->p->p;
+}
+int main()
+{
+ struct Foo f;
+ f.p = &p1;
+ if (foo(&f) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr30375.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr30375.c
new file mode 100644
index 000000000..50b3bfd56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr30375.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse" } */
+
+typedef struct _s {
+ int a;
+ int b;
+ int c;
+ int d;
+} s;
+
+extern void g(s*);
+extern void f(void);
+
+void test_signed_msg_encoding(void)
+{
+ s signInfo = { sizeof(signInfo), 0 };
+
+ signInfo.b = 1;
+ signInfo.c = 0;
+ g(&signInfo);
+ signInfo.d = 0;
+ f();
+}
+
+/* { dg-final { scan-tree-dump-times "signInfo = {}" 1 "dse1" } } */
+/* { dg-final { cleanup-tree-dump "dse*" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c
new file mode 100644
index 000000000..ee45e5b4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr30978.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int foo(int a)
+{
+ unsigned int b = a > 0;
+ char c = b;
+ _Bool d = c == 0;
+ int e = !d;
+ return e;
+}
+
+/* { dg-final { scan-tree-dump-times " = " 2 "optimized" } } */
+/* One comparison and one extension to int. */
+/* { dg-final { scan-tree-dump " = a_..D. > 0;" "optimized" } } */
+/* { dg-final { scan-tree-dump "e_. = \\\(int\\\)" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c
new file mode 100644
index 000000000..54f677ba8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31261.c
@@ -0,0 +1,41 @@
+/* PR tree-optimization/31261 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-original" } */
+
+unsigned int
+f1 (unsigned int a)
+{
+ return (8 - (a & 7)) & 7;
+}
+
+long int
+f2 (long int b)
+{
+ return (16 + (b & 7)) & 15;
+}
+
+char
+f3 (char c)
+{
+ return -(c & 63) & 31;
+}
+
+int
+f4 (int d)
+{
+ return (12 - (d & 15)) & 7;
+}
+
+int
+f5 (int e)
+{
+ return (12 - (e & 7)) & 15;
+}
+
+/* { dg-final { scan-tree-dump-times "return -a \& 7;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return b \& 7;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return \\(char\\) -\\(unsigned char\\) c \& 31;" 1 "original" } } */
+/* { dg-final { scan-tree-dump-times "return \\(int\\) \\(12 - \\(unsigned int\\) d\\) \& 7;" 1 "original" { target { ! int16 } } } } */
+/* { dg-final { scan-tree-dump-times "return \\(int\\) \\(12 - \\(unsigned short\\) d\\) \& 7;" 1 "original" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "return 12 - \\(e \& 7\\) \& 15;" 1 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31521.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31521.c
new file mode 100644
index 000000000..4f54cc077
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31521.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+void fail(void) __attribute__((noreturn));
+int bar(int);
+
+int foo(int x) {
+ int i;
+ int s = 0;
+
+ if (x <= 0) fail();
+ for (i = 0; i < x; ++i) {
+ /* This division by 4 should be replaced with >> 2. */
+ s += bar(i/4);
+ }
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times " = i_.* >> 2" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c
new file mode 100644
index 000000000..a18f9d041
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr31966.c
@@ -0,0 +1,50 @@
+/* Contributed by Jack Lloyd <lloyd@randombit.net> */
+
+/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-O2 -ftree-vectorize -march=nocona" { target { i?86-*-* x86_64-*-* } } } */
+
+typedef unsigned long long word;
+
+const unsigned int MP_WORD_BITS = 64;
+const word MP_WORD_MASK = ~((word)0);
+const word MP_WORD_TOP_BIT = (word)1 << (8*sizeof(word) - 1);
+
+extern void abort (void);
+
+word do_div(word n1, word n0, word d)
+{
+ word high = n1 % d, quotient = 0;
+ unsigned int j;
+
+ for(j = 0; j != MP_WORD_BITS; ++j)
+ {
+ word high_top_bit = (high & MP_WORD_TOP_BIT);
+
+ high <<= 1;
+ high |= (n0 >> (MP_WORD_BITS-1-j)) & 1;
+ quotient <<= 1;
+
+ if(high_top_bit || high >= d)
+ {
+ high -= d;
+ quotient |= 1;
+ }
+ }
+
+ return quotient;
+}
+
+int main()
+{
+ word result;
+
+ result = do_div(0x0000000000200000ll,
+ 0x0000000000000000ll,
+ 0x86E53497CE000000ll);
+
+
+ if (result != 0x3CBA83)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c
new file mode 100644
index 000000000..58a62662b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32044.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int foo (int n)
+{
+ while (n >= 45)
+ n -= 45;
+
+ return n;
+}
+
+int bar (int n)
+{
+ while (n >= 64)
+ n -= 64;
+
+ return n;
+}
+
+int bla (int n)
+{
+ int i = 0;
+
+ while (n >= 45)
+ {
+ i++;
+ n -= 45;
+ }
+
+ return i;
+}
+
+int baz (int n)
+{
+ int i = 0;
+
+ while (n >= 64)
+ {
+ i++;
+ n -= 64;
+ }
+
+ return i;
+}
+
+/* The loops computing division/modulo by 64 should be eliminated */
+/* { dg-final { scan-tree-dump-times "if" 6 "optimized" } } */
+
+/* There should be no division/modulo in the final dump (division and modulo
+ by 64 are done using bit operations). */
+/* { dg-final { scan-tree-dump-times "/" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "%" 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32367.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32367.c
new file mode 100644
index 000000000..1b153b65e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32367.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int BinomialCoefficientsInited = 0;
+int BinomialCoefficients[17 * 35];
+double Evaluate_TPat (void)
+{
+ unsigned short n, k;
+ if (BinomialCoefficientsInited == 0)
+ {
+ int *ptr = BinomialCoefficients;
+ for (n = 1; n <= 33; ++n)
+ {
+ for (k = 1; k < n; ++k)
+ ++ptr;
+ *ptr = 1;
+ }
+ }
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32461-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32461-1.c
new file mode 100644
index 000000000..6e069886d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32461-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+typedef struct
+{
+ unsigned exp[256];
+}
+expbap_t;
+
+void
+a52_bit_allocate (expbap_t * expbap)
+{
+ int i;
+ unsigned *exp = expbap->exp;
+ char *bap;
+
+ while (i < 3 || exp[i] > exp[i - 1]);
+
+ do {
+ if (exp[i + 1] == exp[i])
+ bap[i] = 0;
+ i++;
+ } while (i < 20);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32461-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32461-2.c
new file mode 100644
index 000000000..81ee6ae95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32461-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+typedef struct
+{
+ unsigned char exp[256];
+}
+expbap_t;
+
+void
+a52_bit_allocate (expbap_t * expbap)
+{
+ int i;
+ unsigned char *exp = expbap->exp;
+ int lowcomp;
+
+ do
+ {
+ if (exp[i + 1] == exp[i] - 2)
+ lowcomp = 384;
+ else if (lowcomp && (exp[i + 1] > exp[i]))
+ lowcomp -= 64;
+ i++;
+ }
+ while ((i < 3) || ((i < 7) && (exp[i] > exp[i - 1])));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32540-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32540-1.c
new file mode 100644
index 000000000..f5a444806
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32540-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-pre" } */
+
+int f(void);
+void acceptloop_th(int *t) {
+ int options = 0;
+ if (f()) options |= 0x1 << 1;
+ if (f()) options |= 0x1 << 2;
+ if (f()) options |= 0x1 << 3;
+ if (f()) options |= 0x1 << 4;
+ if (f()) options |= 0x1 << 5;
+ if (f()) options |= 0x1 << 6;
+ if (f()) options |= 0x1 << 7;
+ if (f()) options |= 0x1 << 8;
+ if (f()) options |= 0x1 << 9;
+ if (f()) options |= 0x1 << 10;
+ if (f()) options |= 0x1 << 11;
+ if (f()) options |= 0x1 << 12;
+ if (f()) options |= 0x1 << 13;
+ if (f()) options |= 0x1 << 14;
+ if (f()) options |= 0x1 << 15;
+#if(__SIZEOF_INT__ >= 4)
+ if (f()) options |= 0x1 << 16;
+ if (f()) options |= 0x1 << 17;
+ if (f()) options |= 0x1 << 18;
+ if (f()) options |= 0x1 << 19;
+ if (f()) options |= 0x1 << 20;
+ if (f()) options |= 0x1 << 21;
+ if (f()) options |= 0x1 << 22;
+ if (f()) options |= 0x1 << 23;
+ if (f()) options |= 0x1 << 24;
+ if (f()) options |= 0x1 << 25;
+ if (f()) options |= 0x1 << 26;
+#endif
+ if (f()) *t = options;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32540-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32540-2.c
new file mode 100644
index 000000000..f7fa38de1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32540-2.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-pre" } */
+
+int f(void);
+void acceptloop_th(int *t, int options) {
+ if (f()) options |= 0x1 << 0;
+ if (f()) options |= 0x1 << 1;
+ if (f()) options |= 0x1 << 2;
+ if (f()) options |= 0x1 << 3;
+ if (f()) options |= 0x1 << 4;
+ if (f()) options |= 0x1 << 5;
+ if (f()) options |= 0x1 << 6;
+ if (f()) options |= 0x1 << 7;
+ if (f()) options |= 0x1 << 8;
+ if (f()) options |= 0x1 << 9;
+ if (f()) options |= 0x1 << 10;
+ if (f()) options |= 0x1 << 11;
+ if (f()) options |= 0x1 << 12;
+ if (f()) options |= 0x1 << 13;
+ if (f()) options |= 0x1 << 14;
+ if (f()) options |= 0x1 << 15;
+#if(__SIZEOF_INT__ >= 4)
+ if (f()) options |= 0x1 << 16;
+ if (f()) options |= 0x1 << 17;
+ if (f()) options |= 0x1 << 18;
+ if (f()) options |= 0x1 << 19;
+ if (f()) options |= 0x1 << 20;
+ if (f()) options |= 0x1 << 21;
+ if (f()) options |= 0x1 << 22;
+ if (f()) options |= 0x1 << 23;
+ if (f()) options |= 0x1 << 24;
+ if (f()) options |= 0x1 << 25;
+ if (f()) options |= 0x1 << 26;
+#endif
+ if (f()) *t = options;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32681.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32681.c
new file mode 100644
index 000000000..235234244
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32681.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ffast-math -ftree-vectorize" } */
+/* { dg-options "-O3 -ffast-math -ftree-vectorize -march=nocona" { target { i?86-*-* x86_64-*-* } } } */
+
+int aa_renderpalette (int p)
+{
+ int y = 42;
+ int i;
+
+ for (i = 0; i < 256; i++)
+ {
+ if (y > 255)
+ y = 255;
+ if (y < 0)
+ y = 0;
+
+ if (p)
+ y = (y < p ? 0 : (y > p) * 255 / (255 - 2 * p));
+ }
+ return y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32821.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32821.c
new file mode 100644
index 000000000..219573940
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32821.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-ifcvt-details" } */
+
+void
+main1 (int *arr, int n, int a, int b)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ int m = arr[i];
+ arr[i] = (m < a ? m - a : b);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "ifcvt" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32901.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32901.c
new file mode 100644
index 000000000..c0ba060e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32901.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-gimple" } */
+
+struct foo {
+ unsigned a1: 1;
+ unsigned a2: 3;
+ unsigned : 4;
+};
+
+extern struct foo thefoo, theotherfoo;
+
+void setup_foo(void)
+{
+ const struct foo init = {
+ .a1 = 1,
+ .a2 = 5,
+ };
+ volatile const struct foo volinit = {
+ .a1 = 0,
+ .a2 = 6
+ };
+ thefoo = init;
+ theotherfoo = volinit;
+}
+
+/* { dg-final { scan-tree-dump-times "thefoo.* = {}" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "thefoo.* = 1" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "thefoo.* = 5" 1 "gimple"} } */
+/* { dg-final { scan-tree-dump-times "theotherfoo = volinit" 1 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32964.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32964.c
new file mode 100644
index 000000000..18e73f939
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr32964.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+union A
+{
+ float a;
+};
+
+float t(float a)
+{
+ union A a1, a2, a3;
+ int i;
+
+ a1.a = a;
+ for(i = 0; i<100; i++)
+ {
+ a2 = a1;
+ a2.a += a;
+ a1 = a2;
+ }
+ a3 = a1;
+ return a3.a;
+}
+
+/* { dg-final { scan-tree-dump-times "union" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33172.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33172.c
new file mode 100644
index 000000000..17a40d4a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33172.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct abc {
+ void (*abc_call)(void);
+};
+
+/*
+ * Use only any one of the three definitions below at a time:
+ *
+ * 1. nothing optimized away. Good.
+ * 2. call_func() _not_ optimized away, but struct xyz is. gcc disappoints.
+ * 3. both call_func() and struct xyz optimized away. Nice.
+ */
+
+/* 1 */
+/*extern int do_register(struct abc *xyz);*/
+
+/* 2 */
+static inline int do_register(struct abc *xyz)
+{
+ return 0;
+}
+
+/* 3 */
+/*#define do_register(xyz) do { (void)(xyz); } while (0)*/
+
+static void call_func(void)
+{
+}
+
+static struct abc xyz = {
+ .abc_call = call_func,
+};
+
+void func(void)
+{
+ do_register(&xyz);
+}
+
+/* { dg-final { scan-tree-dump-not "call_func" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33723.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33723.c
new file mode 100644
index 000000000..32a3aad9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33723.c
@@ -0,0 +1,72 @@
+/* PR tree-optimization/33723 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+typedef union
+{
+ struct
+ {
+ int f1, f2, f3, f4, f5, f6, f7, f8;
+ long int f9, f10;
+ int f11;
+ } f;
+ char s[4];
+ long int a;
+} T;
+
+void
+foo1 (void)
+{
+ T t;
+ t = (T) { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
+ test (&t);
+}
+
+void
+bar1 (void)
+{
+ T t = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
+ test (&t);
+}
+
+void
+baz1 (void)
+{
+ T t;
+ t = (const T) { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };
+ test (&t);
+}
+
+void
+foo2 (void)
+{
+ T t;
+ t = (T) { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } };
+ test (&t);
+}
+
+void
+bar2 (void)
+{
+ T t = { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } };
+ test (&t);
+}
+
+void
+baz2 (void)
+{
+ T t;
+ t = (const T) { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } };
+ test (&t);
+}
+
+void
+baz3 (void)
+{
+ T t;
+ t = (const T) (T) { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } };
+ test (&t);
+}
+
+/* { dg-final { scan-tree-dump-not "t = D" "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33920.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33920.c
new file mode 100644
index 000000000..e6a9e7118
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33920.c
@@ -0,0 +1,52 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+typedef __PTRDIFF_TYPE__ intptr_t;
+typedef union lispunion *object;
+struct character
+{
+ long e;
+};
+extern struct symbol Cnil_body;
+extern struct symbol Ct_body;
+struct vector
+{
+ object *v_self;
+};
+union lispunion
+{
+ struct vector v;
+};
+void init_code ()
+{
+ object V659;
+ object _x, _y;
+ object V643;
+ intptr_t V648;
+ unsigned char V653;
+ object V651;
+ object V654;
+ object V658;
+
+T1240:
+if (V648 >= (intptr_t)V651)
+ goto T1243;
+ V653 = ((char *) V654->v.v_self)[V648];
+ V659 = (object) V654 + V653;
+T1261:
+ V658 =
+ (object)
+ V659 ? (object) & Ct_body : (object) & Cnil_body;
+ if (V658 == (object) & Cnil_body)
+ goto T1249;
+ goto T1224;
+T1249:
+ V648 = (intptr_t) V648 + 1;
+ goto T1240;
+T1243:
+ V643 = (object) & Cnil_body;
+T1224:
+ _y = V643;
+ number_plus (_x, _y);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33922.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33922.c
new file mode 100644
index 000000000..7429eb161
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr33922.c
@@ -0,0 +1,79 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-pre" } */
+
+typedef enum
+{
+ ST_TiemanStyle,
+}
+BrailleDisplay;
+static int pendingCommand;
+static int currentModifiers;
+typedef struct
+{
+ int (*updateKeys) (BrailleDisplay * brl, int *keyPressed);
+}
+ProtocolOperations;
+static const ProtocolOperations *protocol;
+brl_readCommand (BrailleDisplay * brl)
+{
+ unsigned long int keys;
+ int command;
+ int keyPressed;
+ unsigned char routingKeys[200];
+ int routingKeyCount;
+ signed char rightVerticalSensor;
+ if (pendingCommand != (-1))
+ {
+ return command;
+ }
+ if (!protocol->updateKeys (brl, &keyPressed))
+ {
+ if (rightVerticalSensor >= 0)
+ keys |= 1;
+ if ((routingKeyCount == 0) && keys)
+ {
+ if (currentModifiers)
+ {
+ doChord:switch (keys);
+ }
+ else
+ {
+ doCharacter:
+ command = 0X2200;
+ if (keys & 0X01UL)
+ command |= 0001;
+ if (keys & 0X02UL)
+ command |= 0002;
+ if (keys & 0X04UL)
+ command |= 0004;
+ if (keys & 0X08UL)
+ command |= 0010;
+ if (keys & 0X10UL)
+ command |= 0020;
+ if (keys & 0X20UL)
+ command |= 0040;
+ if (currentModifiers & (0X0010 | 0X0200))
+ command |= 0100;
+ if (currentModifiers & 0X0040)
+ command |= 0200;
+ if (currentModifiers & 0X0100)
+ command |= 0X020000;
+ if (currentModifiers & 0X0400)
+ command |= 0X080000;
+ if (currentModifiers & 0X0800)
+ command |= 0X040000;
+ }
+ unsigned char key1 = routingKeys[0];
+ if (key1 == 0)
+ {
+ }
+ if (key1 == 1)
+ if (keys)
+ {
+ currentModifiers |= 0X0010;
+ goto doCharacter;
+ }
+ }
+ }
+ return command;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34146-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34146-2.c
new file mode 100644
index 000000000..31007b07f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34146-2.c
@@ -0,0 +1,53 @@
+/* PR c/34146 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+struct A
+{
+ int f1, f2, f3;
+};
+
+struct B
+{
+ struct A g1, g2;
+};
+
+struct C
+{
+ struct B h1, h2;
+};
+
+typedef union
+{
+ struct C c;
+ char s[4];
+ long int a;
+} T;
+
+void
+foo (void)
+{
+ T t = (T) { { { { 0, 0, 0 }, { 0, 0, 0 } }, { { 0, 0, 0 }, { 0, 0, 0 } } } };
+ test (&t);
+}
+
+void
+bar (void)
+{
+ T t = (T) { { { { 0, 0, 0 }, (struct A) { 0, 0, 0 } },
+ (struct B) { (struct A) { 0, 0, 0 }, { 0, 0, 0 } } } };
+ test (&t);
+}
+
+void
+baz (void)
+{
+ T t = (T) { { { { 0, 0, 0 }, (struct A) { 1, 1, 1 } },
+ (struct B) { (struct A) { 0, 0, 0 }, { 1, 1, 1 } } } };
+ test (&t);
+}
+
+/* { dg-final { scan-tree-dump-not "t = D" "gimple"} } */
+/* { dg-final { scan-tree-dump-not "t\.c\.h\[12\] = D" "gimple"} } */
+/* { dg-final { scan-tree-dump-not "\.g\[12\] = D" "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34146.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34146.c
new file mode 100644
index 000000000..99fdeb5ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34146.c
@@ -0,0 +1,53 @@
+/* PR c/34146 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+struct A
+{
+ int f1, f2, f3;
+};
+
+struct B
+{
+ struct A g1, g2;
+};
+
+struct C
+{
+ struct B h1, h2;
+};
+
+typedef union
+{
+ struct C c;
+ char s[4];
+ long int a;
+} T;
+
+void
+foo (void)
+{
+ T t = { { { { 0, 0, 0 }, { 0, 0, 0 } }, { { 0, 0, 0 }, { 0, 0, 0 } } } };
+ test (&t);
+}
+
+void
+bar (void)
+{
+ T t = { { { { 0, 0, 0 }, (struct A) { 0, 0, 0 } },
+ (struct B) { (struct A) { 0, 0, 0 }, { 0, 0, 0 } } } };
+ test (&t);
+}
+
+void
+baz (void)
+{
+ T t = { { { { 0, 0, 0 }, (struct A) { 1, 1, 1 } },
+ (struct B) { (struct A) { 0, 0, 0 }, { 1, 1, 1 } } } };
+ test (&t);
+}
+
+/* { dg-final { scan-tree-dump-not "t = D" "gimple"} } */
+/* { dg-final { scan-tree-dump-not "t\.c\.h\[12\] = D" "gimple"} } */
+/* { dg-final { scan-tree-dump-not "\.g\[12\] = D" "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34244.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34244.c
new file mode 100644
index 000000000..262c92f1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34244.c
@@ -0,0 +1,65 @@
+/* PR tree-optimization/34244 */
+/* { dg-do run } */
+/* { dg-options "-O2 " } */
+
+int __attribute__((noinline)) GetParent(void)
+{
+ static int count = 0;
+ count++;
+ switch (count)
+ {
+ case 1:
+ case 3:
+ case 4:
+ return 1;
+ default:
+ return 0;
+ }
+}
+int __attribute__((noinline)) FindCommonAncestor(int aNode1, int aNode2)
+{
+ if (aNode1 && aNode2) {
+ int offset = 0;
+ int anc1 = aNode1;
+ for (;;) {
+ ++offset;
+ int parent = GetParent();
+ if (!parent)
+ break;
+ anc1 = parent;
+ }
+ int anc2 = aNode2;
+ for (;;) {
+ --offset;
+ int parent = GetParent();
+ if (!parent)
+ break;
+ anc2 = parent;
+ }
+ if (anc1 == anc2) {
+ anc1 = aNode1;
+ anc2 = aNode2;
+ while (offset > 0) {
+ anc1 = GetParent();
+ --offset;
+ }
+ while (offset < 0) {
+ anc2 = GetParent();
+ ++offset;
+ }
+ while (anc1 != anc2) {
+ anc1 = GetParent();
+ anc2 = GetParent();
+ }
+ return anc1;
+ }
+ }
+ return 0;
+}
+extern void abort (void);
+int main()
+{
+ if (FindCommonAncestor (1, 1) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34635-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34635-1.c
new file mode 100644
index 000000000..5afc6db27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34635-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void foo(int x[])
+{
+ int i, j;
+
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ {
+ x[i] = x[i+j];
+ x[i] = x[i+j];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34635.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34635.c
new file mode 100644
index 000000000..5b4253cc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr34635.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+void foo(int x[])
+{
+ int i, j;
+
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < 2; j++)
+ {
+ x[i] = x[i*j];
+ x[i] = x[i*j];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr35286.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr35286.c
new file mode 100644
index 000000000..8601cabec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr35286.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int g2;
+struct A {
+ int a; int b;
+}g1;
+int foo(int a, int b)
+{
+ if (a > 0)
+ {
+ g1.a = a+ b;
+ }
+ else
+ g1.a = b;
+
+ g2 = a+b;
+
+ return g1.a;
+}
+/* We will eliminate the g1.a from the return statement as fully redundant,
+ and remove one calculation of a + b. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr35287.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr35287.c
new file mode 100644
index 000000000..1e9766280
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr35287.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int *gp;
+int foo(int p)
+{
+ int t = 0;
+ if (p)
+ t = *gp + 1;
+
+ return (*gp + t);
+}
+
+/* We will eliminate one load of gp and one indirect load of *gp. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36181.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36181.c
new file mode 100644
index 000000000..7294c07b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36181.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O3 -ftree-parallelize-loops=2" } */
+
+int foo ()
+{
+ int i, sum = 0, data[1024];
+
+ for(i = 0; i<1024; i++)
+ sum += data[i];
+
+ return sum;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36326.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36326.c
new file mode 100644
index 000000000..0611f7d84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36326.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+union X { int i; double x; };
+
+int foo (union X *p)
+{
+ union X x = *p;
+ return x.x;
+}
+
+/* { dg-final { scan-tree-dump-not "x.0" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36881.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36881.c
new file mode 100644
index 000000000..96922e3a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36881.c
@@ -0,0 +1,26 @@
+/* PR tree-optimization/36881 */
+/* { dg-do compile { target fpic } } */
+/* { dg-options "-O2 -fpic -fdump-tree-switchconv-all" } */
+
+const char *foo (int i)
+{
+ const char *p;
+ switch (i)
+ {
+ case 0:
+ case 6: p = ""; break;
+ case 1:
+ case 7: p = "abc"; break;
+ case 2:
+ case 8: p = "def"; break;
+ case 9: p = "ghi"; break;
+ case 5: p = "jkl"; break;
+ case 3: p = "mno"; break;
+ default: p = "prq"; break;
+ }
+ return p;
+}
+
+/* { dg-final { scan-assembler-not "CSWTCH" } } */
+/* { dg-final { scan-tree-dump "need runtime relocations" "switchconv" } } */
+/* { dg-final { cleanup-tree-dump "switchconv" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36908.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36908.c
new file mode 100644
index 000000000..8fa2ed2ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr36908.c
@@ -0,0 +1,65 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+#define NULL ((void *)0)
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+extern void *foo(size_t nelem, size_t elsize);
+extern void bar (char*, ...);
+
+typedef struct alt_state *alt_state_t;
+typedef struct state *state_t;
+
+struct alt_state
+{
+ alt_state_t next_alt_state;
+};
+
+static alt_state_t first_free_alt_state = NULL;
+
+static void
+free_alt_state (alt_state_t alt_state)
+{
+ if (alt_state == NULL)
+ return;
+ alt_state->next_alt_state = first_free_alt_state;
+ first_free_alt_state = alt_state;
+}
+
+/* The function frees list started with node ALT_STATE_LIST. */
+static void
+free_alt_states (alt_state_t alt_states_list)
+{
+ alt_state_t curr_alt_state;
+ alt_state_t next_alt_state;
+
+ for (curr_alt_state = alt_states_list;
+ curr_alt_state != NULL;
+ curr_alt_state = next_alt_state)
+ {
+ next_alt_state = curr_alt_state->next_alt_state;
+ free_alt_state (curr_alt_state);
+ }
+}
+
+int
+main (void)
+{
+ int i;
+ alt_state_t state, act_state;
+
+ act_state = state = foo (1, sizeof (struct alt_state));
+ for (i = 0; i < 2; i ++)
+ {
+ act_state->next_alt_state = foo (1, sizeof (struct alt_state));
+ act_state = act_state->next_alt_state;
+ }
+
+ free_alt_states (state);
+
+ for (act_state = first_free_alt_state;
+ act_state != NULL;
+ act_state = act_state->next_alt_state)
+ bar ("going from %p to %p\n", act_state, act_state->next_alt_state);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr37508.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr37508.c
new file mode 100644
index 000000000..aea35cc04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr37508.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+struct foo1 {
+ int i:1;
+};
+struct foo2 {
+ unsigned i:1;
+};
+
+int test1 (struct foo1 *x)
+{
+ if (x->i == 0)
+ return 1;
+ else if (x->i == -1)
+ return 1;
+ return 0;
+}
+
+int test2 (struct foo2 *x)
+{
+ if (x->i == 0)
+ return 1;
+ else if (x->i == -1)
+ return 1;
+ return 0;
+}
+
+int test3 (struct foo1 *x)
+{
+ if (x->i == 0)
+ return 1;
+ else if (x->i == 1) /* This test is already folded to false by fold. */
+ return 1;
+ return 0;
+}
+
+int test4 (struct foo2 *x)
+{
+ if (x->i == 0)
+ return 1;
+ else if (x->i == 1)
+ return 1;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding" 3 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38250.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38250.c
new file mode 100644
index 000000000..fac6cd3b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38250.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+typedef struct {
+ long dat[2];
+} gsl_complex_long_double;
+typedef struct {
+ size_t size;
+ size_t stride;
+ long *data;
+} gsl_vector_complex_long_double;
+
+void gsl_vector_complex_long_double_set_zero (gsl_vector_complex_long_double * v)
+{
+ long * const data = v->data;
+ const size_t n = v->size;
+ const size_t stride = v->stride;
+ const gsl_complex_long_double zero = { { 0,0} } ;
+ size_t i;
+ for (i = 0; i < n; i++)
+ *(gsl_complex_long_double *) (data + 2 * i * stride) = zero;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38385.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38385.c
new file mode 100644
index 000000000..a49c93e26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38385.c
@@ -0,0 +1,124 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+struct rtx_def
+{
+ int a;
+};
+
+typedef struct rtx_def *rtx;
+
+struct rd {
+ int alternative_enabled_p[100];
+ rtx operand[100];
+ int n_operands;
+};
+
+rtx this_insn;
+int n_reloads;
+int n_replacements;
+int n_earlyclobbers;
+int replace_reloads;
+int hard_regs_live_known;
+short* static_reload_reg_p;
+struct rd recog_data;
+
+int
+find_reloads (rtx insn, int replace, int ind_levels, int live_known,
+ short *reload_reg_p)
+{
+ int i, j;
+ int noperands = replace;
+
+ int no_input_reloads = 0;
+ int n_alternatives = replace;
+ char this_alternative_match_win[30];
+ char this_alternative_win[30];
+ char this_alternative_earlyclobber[30];
+ int this_alternative_matches[30];
+ int goal_alternative[30];
+ int this_alternative_number;
+
+ char goal_alternative_match_win[30];
+ char goal_alternative_win[30];
+ int best;
+
+ int operand_mode[30];
+ int retval = 0;
+
+ for (this_alternative_number = 0;
+ this_alternative_number < n_alternatives;
+ this_alternative_number++)
+ {
+
+ int losers = 0;
+ int bad = 0;
+
+ if (!recog_data.alternative_enabled_p[this_alternative_number])
+ {
+ int i;
+
+ for (i = 0; i < recog_data.n_operands; i++)
+ ;
+
+ continue;
+ }
+
+ for (i = 0; i < noperands; i++)
+ if (this_alternative_earlyclobber[i]
+ && (this_alternative_win[i] || this_alternative_match_win[i]))
+ {
+ if (j != noperands)
+ {
+ losers++;
+
+ for (j = 0; j < noperands; j++)
+ if (this_alternative_matches[j] == i
+ && this_alternative_match_win[j])
+ {
+ this_alternative_win[j] = 0;
+ this_alternative_match_win[j] = 0;
+ losers++;
+ }
+ }
+ }
+
+ if (losers == 0)
+ {
+ for (i = 0; i < noperands; i++)
+ {
+ goal_alternative_win[i] = 0;
+ goal_alternative_match_win[i] = 0;
+ }
+
+ goto finish;
+ }
+
+ if (! bad && best > losers)
+ {
+ for (i = 0; i < noperands; i++)
+ {
+ goal_alternative[i] = 0;
+ goal_alternative_win[i] = 0;
+ }
+ }
+ }
+
+
+ finish:
+
+ for (i = 0; i < noperands; i++)
+ if (! goal_alternative_win[i])
+ {
+ rtx op = recog_data.operand[i];
+ int mode = operand_mode[i];
+
+ if (((ix86_preferred_reload_class ((op), (goal_alternative[i])) == 2)
+ || no_input_reloads)
+ && mode != 0)
+ {}
+ }
+
+ return retval;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38533.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38533.c
new file mode 100644
index 000000000..a80a5a813
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38533.c
@@ -0,0 +1,30 @@
+/* PR middle-end/38533 */
+/* { dg-do compile } */
+/* { dg-options "-O2 --param tree-reassoc-width=1 -fdump-tree-reassoc1" } */
+
+#define A asm volatile ("" : "=r" (f) : "0" (0)); e |= f;
+#define B A A A A A A A A A A A
+#define C B B B B B B B B B B B
+
+int
+foo (void)
+{
+ int e = 0, f;
+ C C B B B B B A A A A A A
+ return e;
+}
+
+int
+main (void)
+{
+ if (foo ())
+ __builtin_abort ();
+ return 0;
+}
+
+/* Verify that reassoc hasn't increased register pressure too much
+ by moving all bitwise ors after the last __asm__. There should
+ be exactly 2 (first) __asm__ stmts with no intervening stmts,
+ all others should have some bitwise or in between. */
+/* { dg-final { scan-tree-dump-times "__asm__\[^;\n]*;\n *__asm__" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c
new file mode 100644
index 000000000..21b335130
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38699.c
@@ -0,0 +1,81 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-optimized" } */
+/*
+ * License: GPL
+ * Copyright: (c) 2007 by Till Harbaum <till@harbaum.org>
+ * Copyright: (c) 2008 Wolfgang Moser, http://d81.de
+ */
+
+/* #include <avr/wdt.h> */
+/* some declarations from the include above for ATMega8 */
+#define _SFR_IO8(io_addr) (*(volatile unsigned char *)((io_addr) + 0x20))
+#define TOV0 0
+#define TCNT0 _SFR_IO8(0x32)
+#define TIFR _SFR_IO8(0x38)
+#define DDRC _SFR_IO8(0x14)
+#define DDRD _SFR_IO8(0x11)
+#define PORTC _SFR_IO8(0x15)
+#define PORTD _SFR_IO8(0x12)
+
+
+static void delay_wait_us( unsigned char timeout ) {
+ __asm__ __volatile__ ("wdr");
+
+ TCNT0 = timeout;
+ TIFR |= (1 << (TOV0));
+
+ /* wait until counter overflows */
+ while(!(TIFR & (1 << (TOV0))));
+}
+
+/* The original testcase was multiplying by 1000. Gcc is now smart enough
+ to work out that actual parameter is 5000 that is not what testcase was
+ about. Obstructate the code somewhat then. */
+int a;
+static void delay_wait_us_ms( unsigned char timeout ) {
+ delay_wait_us( timeout * a );
+}
+
+
+void makeUseOfTimerWait( unsigned char val ) {
+ delay_wait_us( 10 );
+ DDRC |= 0x10;
+ delay_wait_us( 10 );
+ DDRD |= 0x20;
+
+ delay_wait_us( 20 );
+ PORTC &= ~0x10;
+ delay_wait_us( 10 );
+ PORTD &= ~0x20;
+
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+ delay_wait_us_ms( 5 );
+
+ PORTC |= val & 0x10;
+ delay_wait_us( 10 );
+ PORTD |= val & 0x20;
+
+ delay_wait_us( 10 );
+}
+/* We should not inline the delay loops. */
+/* { dg-final { scan-tree-dump "delay_wait_us" "optimized"} } */
+/* { dg-final { scan-tree-dump "delay_wait_us_ms" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38895.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38895.c
new file mode 100644
index 000000000..0a96e5334
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38895.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-aliasing -fdump-tree-optimized" } */
+
+struct A {
+ int i;
+ int j;
+};
+struct B {
+ struct A a1;
+ struct A a2;
+};
+struct C {
+ struct A a1;
+ struct B b;
+};
+int foo(struct C *c, struct B *b)
+{
+ c->a1.i = 1;
+ b->a1.i = 0;
+ return c->a1.i;
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38997.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38997.c
new file mode 100644
index 000000000..211203c9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr38997.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+int a[8][8];
+int b[8];
+
+void
+foo (int i)
+{
+ int j;
+ for (j = 0; j < 8; j++)
+ {
+ a[i][j] = 0;
+ b[j] = j;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr39007.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr39007.c
new file mode 100644
index 000000000..94b24436d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr39007.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+void
+foo (int *__restrict__ p, int *__restrict__ q, int count)
+{
+ int i;
+ for (i = 0; i < count; i++)
+ {
+ *p++ = 0;
+ *q++ = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr40087.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr40087.c
new file mode 100644
index 000000000..98d243784
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr40087.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -Wno-attributes" } */
+
+extern void abort (void);
+
+static void __attribute__((always_inline))
+reverse(int *first, int *last)
+{
+ if (first == last--)
+ return;
+ while (first != last)
+ {
+ int t = *first;
+ *first = *last;
+ *last = t;
+ if (++first == last--)
+ break;
+ }
+}
+
+int main()
+{
+ int seq[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
+
+ reverse(seq, seq + 8);
+ if (seq[3] != 5 || seq[4] != 4)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c
new file mode 100644
index 000000000..cee2c0822
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr41469-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fexceptions -fdump-tree-optimized" } */
+
+void af (void *a);
+
+void
+bf (void)
+{
+ int i = 1;
+ char v[i];
+ af (v);
+}
+
+/* { dg-final { scan-tree-dump-not "__builtin_stack_save" "optimized"} } */
+/* { dg-final { scan-tree-dump-not "__builtin_stack_restore" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
new file mode 100644
index 000000000..e66ee8464
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+
+extern void abort (void);
+
+unsigned int a;
+int b, c;
+
+void
+foo (void)
+{
+ b = 0;
+ do {
+ for (a = -13; a == 0; a = (unsigned short)a)
+ c = 1;
+ b++;
+ } while (b == 0);
+}
+
+int
+main ()
+{
+ foo ();
+ if (a != -13)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42327.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42327.c
new file mode 100644
index 000000000..c0d3811b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42327.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fcheck-data-deps" } */
+
+void foo(char *str)
+{
+ while (*str != 0) *str++ = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
new file mode 100644
index 000000000..a970c855b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+struct _fat_ptr
+{
+ unsigned char *curr;
+ unsigned char *base;
+ unsigned char *last_plus_one;
+};
+int Cyc_string_ungetc (int ignore, struct _fat_ptr *sptr);
+int
+Cyc_string_ungetc (int ignore, struct _fat_ptr *sptr)
+{
+ struct _fat_ptr *_T0;
+ struct _fat_ptr *_T1;
+ struct _fat_ptr _T2;
+ int _T3;
+ struct _fat_ptr _ans;
+ int _change;
+
+ {
+ _T0 = sptr;
+ _T1 = sptr;
+ _T2 = *sptr;
+ _T3 = -1;
+ _ans = _T2;
+ _change = -1;
+ _ans.curr += 4294967295U;
+ *sptr = _ans;
+ return (0);
+ }
+}
+
+/* The local aggregates . */
+/* Whether the structs are totally scalarized or not depends on the
+ MOVE_RATIO macro definition in the back end. The scalarization will
+ not take place when using small values for MOVE_RATIO. */
+/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { ! "arm*-*-* avr-*-* nds32*-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { ! "arm*-*-* avr-*-* nds32*-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42640.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42640.c
new file mode 100644
index 000000000..70807c091
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42640.c
@@ -0,0 +1,58 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-loop-distribution" } */
+
+/* Checks if loop distribution works correctly if the subscript used
+ is assigned to a loop invariant value. */
+
+extern void abort (void);
+struct S { int a; int b; int c; };
+
+int get_rr_node_index (int i)
+{
+ return i;
+}
+
+struct S nodes[8];
+struct S *rr_node = nodes;
+volatile int io_rat = 2;
+void
+doit (int i, int j)
+{
+ int s_node, p_node, inode, ipad, iloop;
+
+ for (ipad = 0; ipad < io_rat; ipad++)
+ {
+ p_node = get_rr_node_index (ipad+2);
+ inode = get_rr_node_index (ipad);
+
+ for (iloop = 1; iloop <= 2; iloop++)
+ {
+ rr_node[inode].a = i;
+ rr_node[inode].b = j;
+ rr_node[inode].c = ipad;
+ inode = p_node;
+ }
+ }
+}
+
+int
+main ()
+{
+ int i;
+
+ doit (1, 2);
+
+ if (rr_node[0].a != rr_node[1].a
+ || rr_node[2].a != rr_node[3].a
+ || rr_node[1].a != 1
+ || rr_node[0].b != rr_node[1].b
+ || rr_node[2].b != rr_node[3].b
+ || rr_node[1].b != 2
+ || rr_node[0].c != 0
+ || rr_node[1].c != 1
+ || rr_node[2].c != 0
+ || rr_node[3].c != 1)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42893.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42893.c
new file mode 100644
index 000000000..b3fbd7654
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr42893.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+struct frame_info;
+void tui_registers_changed_hook (void);
+extern struct frame_info *deprecated_selected_frame;
+int tui_refreshing_registers = 0;
+void
+tui_registers_changed_hook (void)
+{
+ struct frame_info *fi;
+ fi = deprecated_selected_frame;
+ if (fi)
+
+ {
+ if (tui_refreshing_registers == 0)
+
+ {
+ tui_refreshing_registers = 1;
+ tui_refreshing_registers = 0;
+ }
+ }
+ return;
+}
+
+/* No references to tui_refreshing_registers should remain. */
+/* { dg-final { scan-tree-dump-not "tui_refreshing_registers" "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr43491.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr43491.c
new file mode 100644
index 000000000..44dc5f2d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr43491.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+#define REGISTER register
+
+#if defined __arm__
+# define REG1 asm("r4")
+#elif defined __i386__
+# define REG1 asm("ebx")
+#elif defined __mips__
+# define REG1 asm("s0")
+#elif defined __x86_64__
+# define REG1 asm("rbp")
+#else
+# undef REGISTER
+# define REGISTER
+# define REG1
+#endif
+
+REGISTER long data_0 REG1;
+long data_3;
+
+long foo(long data, long v)
+{
+ long i;
+ long t, u;
+
+ if (data)
+ i = data_0 + data_3;
+ else {
+ v = 2;
+ i = 5;
+ }
+ t = data_0 + data_3;
+ u = i;
+ return v * t * u;
+}
+/* We should not eliminate global register variable when it is the RHS of
+ a single assignment. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre" { target { arm*-*-* i?86-*-* mips*-*-* x86_64-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "pre" { target { ! { arm*-*-* i?86-*-* mips*-*-* x86_64-*-* } } } } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44133.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44133.c
new file mode 100644
index 000000000..d3d0fe3a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44133.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+struct S { int i, j; };
+
+int foo (int l)
+{
+ struct S s;
+ s.j = l - 22;
+ return s.i + s.j; /* { dg-warning ".s\.i. is used uninitialized" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44258.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44258.c
new file mode 100644
index 000000000..6dc233b32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44258.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-esra-details" } */
+
+struct blah
+{
+ char a[4];
+};
+
+struct str
+{
+ struct blah b1;
+ char x;
+};
+
+struct val
+{
+ char y;
+ struct blah b2;
+};
+
+union U
+{
+ struct str str;
+ struct val val;
+};
+
+
+extern struct blah e_b1, e_b2;
+extern union U *e_u;
+
+int foo (int b)
+{
+ union U u;
+
+ u.str.b1 = e_b1;
+ u.val.b2 = e_b2;
+ u.str.b1.a[3] = 0;
+
+ *e_u = u;
+}
+
+/* Epiphany has struct alignment/padding that avoids the overlap of
+ str.b1 and val.b2. */
+/* { dg-final { scan-tree-dump-times "Created a replacement" 0 "esra" { target { ! "epiphany-*-*" } } } } */
+/* { dg-final { cleanup-tree-dump "esra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c
new file mode 100644
index 000000000..1ea04ce3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O3 -ftree-vectorize" { target *-*-* } } */
+
+extern const int quant_coef8[6][8][8];
+extern const int dequant_coef8[6][8][8];
+int LevelScale8x8Luma_Intra[6][8][8];
+int LevelScale8x8Luma_Inter[6][8][8];
+int InvLevelScale8x8Luma_Intra[6][8][8];
+int InvLevelScale8x8Luma_Inter[6][8][8];
+short UseDefaultScalingMatrix8x8Flag[2];
+void CalculateQuant8Param()
+{
+ int i, j, k, temp;
+ int present[2];
+ for(k=0; j<8; j++)
+ for(i=0; i<8; i++)
+ {
+ temp = (i<<3)+j;
+ if((!present[0]) || UseDefaultScalingMatrix8x8Flag[0])
+ {
+ LevelScale8x8Luma_Intra[k][j][i] = (quant_coef8[k][j][i]<<4);
+ InvLevelScale8x8Luma_Intra[k][j][i] = dequant_coef8[k][j][i];
+ }
+ if((!present[1]) || UseDefaultScalingMatrix8x8Flag[1])
+ {
+ LevelScale8x8Luma_Inter[k][j][i] = (quant_coef8[k][j][i]<<4);
+ InvLevelScale8x8Luma_Inter[k][j][i] = dequant_coef8[k][j][i];
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44423.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44423.c
new file mode 100644
index 000000000..6232d6496
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44423.c
@@ -0,0 +1,47 @@
+/* { dg-do compile { target x86_64-*-* } } */
+/* { dg-options "-O2 -fdump-tree-esra-details" } */
+
+#include "xmmintrin.h"
+
+typedef __m128 v4sf; // vector of 4 floats (SSE1)
+
+#define ARRSZ 1024
+
+typedef union {
+ float f[4];
+ v4sf v;
+} V4SF;
+
+struct COLOUR {
+ float r,g,b;
+};
+
+void func (float *pre1, float pre2, struct COLOUR *a, V4SF *lpic)
+ {
+ V4SF va;
+ int y;
+ va.f[0]=a->r;va.f[1]=a->g;va.f[2]=a->b;va.f[3]=0.f;
+ for (y=0; y<20; ++y)
+ {
+ float att = pre1[y]*pre2;
+ v4sf tmpatt=_mm_load1_ps(&att);
+ tmpatt=_mm_mul_ps(tmpatt,va.v);
+ lpic[y].v=_mm_add_ps(tmpatt,lpic[y].v);
+ }
+ }
+
+int main()
+ {
+ V4SF lpic[ARRSZ];
+ float pre1[ARRSZ];
+ int i;
+ struct COLOUR col={0.,2.,4.};
+ for (i=0; i<20; ++i)
+ pre1[i]=0.4;
+ for (i=0;i<10000000;++i)
+ func(&pre1[0],0.3,&col,&lpic[0]);
+ return 0;
+ }
+
+/* { dg-final { scan-tree-dump-times "Created a replacement" 0 "esra"} } */
+/* { dg-final { cleanup-tree-dump "esra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44483.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44483.c
new file mode 100644
index 000000000..cdae91a90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr44483.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-c -O3" { target *-*-* } } */
+
+int ffesum (void) {
+ int ch[4], ii, jj, kk;
+ char asc[32];
+
+ for (ii = 0; ii < 4; ii++)
+ {
+ for (jj = 0; jj < 4; jj++)
+ ch[jj] = ii;
+ for (kk = 0; kk < 13; kk++)
+ for (jj = 0; jj < 4; jj += 2)
+ if ((unsigned char) ch[jj] || (unsigned char) ch[jj + 1])
+ ch[jj]++;
+ for (jj = 0; jj < 4; jj++)
+ asc[4 * jj + ii] = ch[jj];
+ }
+ return asc[0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45085.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45085.c
new file mode 100644
index 000000000..d95ac8620
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45085.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+struct S { char *s1; long s2; };
+struct T { int t1; long t2; long t3; };
+extern int fn2 (void);
+extern int fn3 (struct T);
+extern struct T fn4 ();
+extern int fn5 (char **, long *, int);
+extern void fn6 (void);
+extern void fn7 (void *);
+struct S *fn10 ();
+static int p;
+static void *q;
+extern struct T r;
+
+static struct T
+fn8 (struct T x, int y)
+{
+ struct S *u = fn10 ();
+ int v = fn5 (&u->s1, &u->s2, 0);
+ while (1)
+ {
+ if (p)
+fn6 ();
+ if (fn3 (x))
+return fn4 ();
+ if (y & 1)
+return r;
+ v = fn5 (&u->s1, &u->s2, 1);
+ }
+}
+
+struct T
+fn9 (struct T x, int y)
+{
+ struct T t = fn8 (x, y);
+ if (fn2 ())
+ fn7 (q);
+ return t;
+}
+
+void *
+fn1 (void)
+{
+ return fn9;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45122.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45122.c
new file mode 100644
index 000000000..e979b766f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45122.c
@@ -0,0 +1,50 @@
+/* PR tree-optimization/27285 */
+/* PR tree-optimization/45122 */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -funsafe-loop-optimizations" } */
+
+extern void abort (void);
+
+struct S { unsigned char a, b, c, d[16]; };
+
+void __attribute__ ((noinline))
+foo (struct S *x, struct S *y)
+{
+ int a, b;
+ unsigned char c, *d, *e;
+
+ b = x->b;
+ d = x->d;
+ e = y->d;
+ a = 0;
+ while (b)
+ {
+ if (b >= 8)
+ {
+ c = 0xff;
+ b -= 8;
+ }
+ else
+ {
+ c = 0xff << (8 - b);
+ b = 0;
+ }
+
+ e[a] = d[a] & c;
+ a++;
+ }
+}
+
+int
+main (void)
+{
+ struct S x = { 0, 25, 0, { 0xaa, 0xbb, 0xcc, 0xdd }};
+ struct S y = { 0, 0, 0, { 0 }};
+
+ foo (&x, &y);
+ if (x.d[0] != y.d[0] || x.d[1] != y.d[1]
+ || x.d[2] != y.d[2] || (x.d[3] & 0x80) != y.d[3])
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c
new file mode 100644
index 000000000..af23fb597
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-require-effective-target int32plus } */
+
+void baz (unsigned);
+
+extern unsigned buf[];
+
+struct A
+{
+ unsigned a1:10;
+ unsigned a2:3;
+ unsigned:19;
+};
+
+union TMP
+{
+ struct A a;
+ unsigned int b;
+};
+
+static unsigned
+foo (struct A *p)
+{
+ union TMP t;
+ struct A x;
+
+ x = *p;
+ t.a = x;
+ return t.b;
+}
+
+void
+bar (unsigned orig, unsigned *new)
+{
+ struct A a;
+ union TMP s;
+
+ s.b = orig;
+ a = s.a;
+ if (a.a1)
+ baz (a.a2);
+ *new = foo (&a);
+}
+
+/* { dg-final { scan-tree-dump-not "unnamed-unsigned:19" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45427.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45427.c
new file mode 100644
index 000000000..0952b5a04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45427.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cunrolli-details" } */
+
+extern void abort (void);
+int __attribute__((noinline,noclone))
+foo (char *p)
+{
+ int h = 0;
+ do
+ {
+ if (*p == '\0')
+ break;
+ ++h;
+ if (p == 0)
+ abort ();
+ ++p;
+ }
+ while (1);
+ return h;
+}
+int main()
+{
+ if (foo("a") != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "bounded by 0" 0 "cunrolli"} } */
+/* { dg-final { cleanup-tree-dump "cunrolli" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45685.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45685.c
new file mode 100644
index 000000000..06289430f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr45685.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-phiopt1-details" } */
+
+typedef unsigned long int uint64_t;
+typedef long int int64_t;
+int summation_helper_1(int64_t* products, uint64_t count)
+{
+ int s = 0;
+ uint64_t i;
+ for(i=0; i<count; i++)
+ {
+ int64_t val = (products[i]>0) ? 1 : -1;
+ products[i] *= val;
+ if(products[i] != i)
+ val = -val;
+ products[i] = val;
+ s += val;
+ }
+ return s;
+}
+
+
+int summation_helper_2(int64_t* products, uint64_t count)
+{
+ int s = 0;
+ uint64_t i;
+ for(i=0; i<count; i++)
+ {
+ int val = (products[i]>0) ? 1 : -1;
+ products[i] *= val;
+ if(products[i] != i)
+ val = -val;
+ products[i] = val;
+ s += val;
+ }
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times "converted to straightline code" 2 "phiopt1" } } */
+/* { dg-final { cleanup-tree-dump "phiopt1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c
new file mode 100644
index 000000000..a2777a604
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c
@@ -0,0 +1,27 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+typedef unsigned char(*Calculable)(void);
+
+static unsigned char one() { return 1; }
+static unsigned char two() { return 2; }
+
+static int
+print(Calculable calculate)
+{
+ return calculate() + calculate() + 1;
+}
+
+int
+main()
+{
+ /* Make sure we perform indirect inlining of one and two and optimize
+ the result to a constant. */
+ if (print(one) != 3)
+ link_error ();
+ if (print(two) != 5)
+ link_error ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr47286.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr47286.c
new file mode 100644
index 000000000..b03c59b83
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr47286.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct thread_info { int preempt_count; };
+static inline struct thread_info *current_thread_info(void)
+{
+ register struct thread_info *sp asm("esp");
+ return sp;
+}
+void testcase(void)
+{
+ current_thread_info()->preempt_count += 1;
+}
+
+/* We have to make sure that alias analysis treats sp as pointing
+ to globals and thus the store not optimized away. */
+
+/* { dg-final { scan-tree-dump "->preempt_count =" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr47392.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr47392.c
new file mode 100644
index 000000000..20161363f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr47392.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+struct A
+{
+ int i;
+};
+
+struct B
+{
+ struct A a[2];
+};
+
+int i = 1;
+struct B b = { 0, 3 };
+
+void
+test ()
+{
+ if (b.a[0].i != i)
+ {
+ int t = b.a[0].i;
+ b.a[0] = b.a[1];
+ b.a[1].i = t;
+ }
+
+ if (b.a[1].i == i)
+ __builtin_abort ();
+
+ if (b.a[0].i == 0)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ test ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49039.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49039.c
new file mode 100644
index 000000000..3500dbf2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49039.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/49039 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void bar (void);
+
+void
+foo (unsigned int x, unsigned int y)
+{
+ unsigned int minv, maxv;
+ if (x >= 3 && x <= 6)
+ return;
+ if (y >= 5 && y <= 8)
+ return;
+ minv = x < y ? x : y;
+ maxv = x > y ? x : y;
+ if (minv == 5)
+ bar ();
+ if (minv == 6)
+ bar ();
+ if (maxv == 5)
+ bar ();
+ if (maxv == 6)
+ bar ();
+}
+
+/* { dg-final { scan-tree-dump "Folding predicate minv_\[0-9\]* == 5 to 0" "vrp1" } } */
+/* { dg-final { scan-tree-dump "Folding predicate minv_\[0-9\]* == 6 to 0" "vrp1" } } */
+/* { dg-final { scan-tree-dump "Folding predicate maxv_\[0-9\]* == 5 to 0" "vrp1" } } */
+/* { dg-final { scan-tree-dump "Folding predicate maxv_\[0-9\]* == 6 to 0" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49094.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49094.c
new file mode 100644
index 000000000..5e565f786
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49094.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+
+struct in_addr {
+ unsigned int s_addr;
+};
+
+struct ip {
+ unsigned char ip_p;
+ unsigned short ip_sum;
+ struct in_addr ip_src,ip_dst;
+} __attribute__ ((aligned(1), packed));
+
+struct ip ip_fw_fwd_addr;
+
+int test_alignment( char *m )
+{
+ struct ip *ip = (struct ip *) m;
+ struct in_addr pkt_dst;
+ pkt_dst = ip->ip_dst ;
+ if( pkt_dst.s_addr == 0 )
+ return 1;
+ else
+ return 0;
+}
+
+int __attribute__ ((noinline, noclone))
+intermediary (char *p)
+{
+ return test_alignment (p);
+}
+
+int
+main (int argc, char *argv[])
+{
+ ip_fw_fwd_addr.ip_dst.s_addr = 1;
+ return intermediary ((void *) &ip_fw_fwd_addr);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49642-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49642-1.c
new file mode 100644
index 000000000..65a0b128a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49642-1.c
@@ -0,0 +1,49 @@
+/* Verify that ipa-split is disabled following __builtin_constant_p. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+typedef unsigned int u32;
+typedef unsigned long long u64;
+
+static inline __attribute__((always_inline)) __attribute__((const))
+int __ilog2_u32(u32 n)
+{
+ int bit;
+ asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n));
+ return 31 - bit;
+}
+
+
+static inline __attribute__((always_inline)) __attribute__((const))
+int __ilog2_u64(u64 n)
+{
+ int bit;
+ asm ("cntlzd %0,%1" : "=r" (bit) : "r" (n));
+ return 63 - bit;
+}
+
+
+
+static u64 ehca_map_vaddr(void *caddr);
+
+struct ehca_shca {
+ u32 hca_cap_mr_pgsize;
+};
+
+static u64 ehca_get_max_hwpage_size(struct ehca_shca *shca)
+{
+ return 1UL << ( __builtin_constant_p(shca->hca_cap_mr_pgsize) ? ( (shca->hca_cap_mr_pgsize) < 1 ? ____ilog2_NaN() : (shca->hca_cap_mr_pgsize) & (1ULL << 63) ? 63 : (shca->hca_cap_mr_pgsize) & (1ULL << 62) ? 62 : (shca->hca_cap_mr_pgsize) & (1ULL << 61) ? 61 : (shca->hca_cap_mr_pgsize) & (1ULL << 60) ? 60 : (shca->hca_cap_mr_pgsize) & (1ULL << 59) ? 59 : (shca->hca_cap_mr_pgsize) & (1ULL << 58) ? 58 : (shca->hca_cap_mr_pgsize) & (1ULL << 57) ? 57 : (shca->hca_cap_mr_pgsize) & (1ULL << 56) ? 56 : (shca->hca_cap_mr_pgsize) & (1ULL << 55) ? 55 : (shca->hca_cap_mr_pgsize) & (1ULL << 54) ? 54 : (shca->hca_cap_mr_pgsize) & (1ULL << 53) ? 53 : (shca->hca_cap_mr_pgsize) & (1ULL << 52) ? 52 : (shca->hca_cap_mr_pgsize) & (1ULL << 51) ? 51 : (shca->hca_cap_mr_pgsize) & (1ULL << 50) ? 50 : (shca->hca_cap_mr_pgsize) & (1ULL << 49) ? 49 : (shca->hca_cap_mr_pgsize) & (1ULL << 48) ? 48 : (shca->hca_cap_mr_pgsize) & (1ULL << 47) ? 47 : (shca->hca_cap_mr_pgsize) & (1ULL << 46) ? 46 : (shca->hca_cap_mr_pgsize) & (1ULL << 45) ? 45 : (shca->hca_cap_mr_pgsize) & (1ULL << 44) ? 44 : (shca->hca_cap_mr_pgsize) & (1ULL << 43) ? 43 : (shca->hca_cap_mr_pgsize) & (1ULL << 42) ? 42 : (shca->hca_cap_mr_pgsize) & (1ULL << 41) ? 41 : (shca->hca_cap_mr_pgsize) & (1ULL << 40) ? 40 : (shca->hca_cap_mr_pgsize) & (1ULL << 39) ? 39 : (shca->hca_cap_mr_pgsize) & (1ULL << 38) ? 38 : (shca->hca_cap_mr_pgsize) & (1ULL << 37) ? 37 : (shca->hca_cap_mr_pgsize) & (1ULL << 36) ? 36 : (shca->hca_cap_mr_pgsize) & (1ULL << 35) ? 35 : (shca->hca_cap_mr_pgsize) & (1ULL << 34) ? 34 : (shca->hca_cap_mr_pgsize) & (1ULL << 33) ? 33 : (shca->hca_cap_mr_pgsize) & (1ULL << 32) ? 32 : (shca->hca_cap_mr_pgsize) & (1ULL << 31) ? 31 : (shca->hca_cap_mr_pgsize) & (1ULL << 30) ? 30 : (shca->hca_cap_mr_pgsize) & (1ULL << 29) ? 29 : (shca->hca_cap_mr_pgsize) & (1ULL << 28) ? 28 : (shca->hca_cap_mr_pgsize) & (1ULL << 27) ? 27 : (shca->hca_cap_mr_pgsize) & (1ULL << 26) ? 26 : (shca->hca_cap_mr_pgsize) & (1ULL << 25) ? 25 : (shca->hca_cap_mr_pgsize) & (1ULL << 24) ? 24 : (shca->hca_cap_mr_pgsize) & (1ULL << 23) ? 23 : (shca->hca_cap_mr_pgsize) & (1ULL << 22) ? 22 : (shca->hca_cap_mr_pgsize) & (1ULL << 21) ? 21 : (shca->hca_cap_mr_pgsize) & (1ULL << 20) ? 20 : (shca->hca_cap_mr_pgsize) & (1ULL << 19) ? 19 : (shca->hca_cap_mr_pgsize) & (1ULL << 18) ? 18 : (shca->hca_cap_mr_pgsize) & (1ULL << 17) ? 17 : (shca->hca_cap_mr_pgsize) & (1ULL << 16) ? 16 : (shca->hca_cap_mr_pgsize) & (1ULL << 15) ? 15 : (shca->hca_cap_mr_pgsize) & (1ULL << 14) ? 14 : (shca->hca_cap_mr_pgsize) & (1ULL << 13) ? 13 : (shca->hca_cap_mr_pgsize) & (1ULL << 12) ? 12 : (shca->hca_cap_mr_pgsize) & (1ULL << 11) ? 11 : (shca->hca_cap_mr_pgsize) & (1ULL << 10) ? 10 : (shca->hca_cap_mr_pgsize) & (1ULL << 9) ? 9 : (shca->hca_cap_mr_pgsize) & (1ULL << 8) ? 8 : (shca->hca_cap_mr_pgsize) & (1ULL << 7) ? 7 : (shca->hca_cap_mr_pgsize) & (1ULL << 6) ? 6 : (shca->hca_cap_mr_pgsize) & (1ULL << 5) ? 5 : (shca->hca_cap_mr_pgsize) & (1ULL << 4) ? 4 : (shca->hca_cap_mr_pgsize) & (1ULL << 3) ? 3 : (shca->hca_cap_mr_pgsize) & (1ULL << 2) ? 2 : (shca->hca_cap_mr_pgsize) & (1ULL << 1) ? 1 : (shca->hca_cap_mr_pgsize) & (1ULL << 0) ? 0 : ____ilog2_NaN() ) : (sizeof(shca->hca_cap_mr_pgsize) <= 4) ? __ilog2_u32(shca->hca_cap_mr_pgsize) : __ilog2_u64(shca->hca_cap_mr_pgsize) );
+}
+
+int x(struct ehca_shca *shca) {
+ return ehca_get_max_hwpage_size(shca);
+}
+
+int y(struct ehca_shca *shca)
+{
+ return ehca_get_max_hwpage_size(shca);
+}
+
+/* { dg-final { scan-tree-dump-times "____ilog2_NaN" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49642-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49642-2.c
new file mode 100644
index 000000000..c96a87a40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49642-2.c
@@ -0,0 +1,51 @@
+/* Verify that ipa-split is disabled following __builtin_constant_p.
+ Same as pr49642-1.c, but we turn off FRE which currently masks
+ the problem. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fno-tree-fre" } */
+
+typedef unsigned int u32;
+typedef unsigned long long u64;
+
+static inline __attribute__((always_inline)) __attribute__((const))
+int __ilog2_u32(u32 n)
+{
+ int bit;
+ asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n));
+ return 31 - bit;
+}
+
+
+static inline __attribute__((always_inline)) __attribute__((const))
+int __ilog2_u64(u64 n)
+{
+ int bit;
+ asm ("cntlzd %0,%1" : "=r" (bit) : "r" (n));
+ return 63 - bit;
+}
+
+
+
+static u64 ehca_map_vaddr(void *caddr);
+
+struct ehca_shca {
+ u32 hca_cap_mr_pgsize;
+};
+
+static u64 ehca_get_max_hwpage_size(struct ehca_shca *shca)
+{
+ return 1UL << ( __builtin_constant_p(shca->hca_cap_mr_pgsize) ? ( (shca->hca_cap_mr_pgsize) < 1 ? ____ilog2_NaN() : (shca->hca_cap_mr_pgsize) & (1ULL << 63) ? 63 : (shca->hca_cap_mr_pgsize) & (1ULL << 62) ? 62 : (shca->hca_cap_mr_pgsize) & (1ULL << 61) ? 61 : (shca->hca_cap_mr_pgsize) & (1ULL << 60) ? 60 : (shca->hca_cap_mr_pgsize) & (1ULL << 59) ? 59 : (shca->hca_cap_mr_pgsize) & (1ULL << 58) ? 58 : (shca->hca_cap_mr_pgsize) & (1ULL << 57) ? 57 : (shca->hca_cap_mr_pgsize) & (1ULL << 56) ? 56 : (shca->hca_cap_mr_pgsize) & (1ULL << 55) ? 55 : (shca->hca_cap_mr_pgsize) & (1ULL << 54) ? 54 : (shca->hca_cap_mr_pgsize) & (1ULL << 53) ? 53 : (shca->hca_cap_mr_pgsize) & (1ULL << 52) ? 52 : (shca->hca_cap_mr_pgsize) & (1ULL << 51) ? 51 : (shca->hca_cap_mr_pgsize) & (1ULL << 50) ? 50 : (shca->hca_cap_mr_pgsize) & (1ULL << 49) ? 49 : (shca->hca_cap_mr_pgsize) & (1ULL << 48) ? 48 : (shca->hca_cap_mr_pgsize) & (1ULL << 47) ? 47 : (shca->hca_cap_mr_pgsize) & (1ULL << 46) ? 46 : (shca->hca_cap_mr_pgsize) & (1ULL << 45) ? 45 : (shca->hca_cap_mr_pgsize) & (1ULL << 44) ? 44 : (shca->hca_cap_mr_pgsize) & (1ULL << 43) ? 43 : (shca->hca_cap_mr_pgsize) & (1ULL << 42) ? 42 : (shca->hca_cap_mr_pgsize) & (1ULL << 41) ? 41 : (shca->hca_cap_mr_pgsize) & (1ULL << 40) ? 40 : (shca->hca_cap_mr_pgsize) & (1ULL << 39) ? 39 : (shca->hca_cap_mr_pgsize) & (1ULL << 38) ? 38 : (shca->hca_cap_mr_pgsize) & (1ULL << 37) ? 37 : (shca->hca_cap_mr_pgsize) & (1ULL << 36) ? 36 : (shca->hca_cap_mr_pgsize) & (1ULL << 35) ? 35 : (shca->hca_cap_mr_pgsize) & (1ULL << 34) ? 34 : (shca->hca_cap_mr_pgsize) & (1ULL << 33) ? 33 : (shca->hca_cap_mr_pgsize) & (1ULL << 32) ? 32 : (shca->hca_cap_mr_pgsize) & (1ULL << 31) ? 31 : (shca->hca_cap_mr_pgsize) & (1ULL << 30) ? 30 : (shca->hca_cap_mr_pgsize) & (1ULL << 29) ? 29 : (shca->hca_cap_mr_pgsize) & (1ULL << 28) ? 28 : (shca->hca_cap_mr_pgsize) & (1ULL << 27) ? 27 : (shca->hca_cap_mr_pgsize) & (1ULL << 26) ? 26 : (shca->hca_cap_mr_pgsize) & (1ULL << 25) ? 25 : (shca->hca_cap_mr_pgsize) & (1ULL << 24) ? 24 : (shca->hca_cap_mr_pgsize) & (1ULL << 23) ? 23 : (shca->hca_cap_mr_pgsize) & (1ULL << 22) ? 22 : (shca->hca_cap_mr_pgsize) & (1ULL << 21) ? 21 : (shca->hca_cap_mr_pgsize) & (1ULL << 20) ? 20 : (shca->hca_cap_mr_pgsize) & (1ULL << 19) ? 19 : (shca->hca_cap_mr_pgsize) & (1ULL << 18) ? 18 : (shca->hca_cap_mr_pgsize) & (1ULL << 17) ? 17 : (shca->hca_cap_mr_pgsize) & (1ULL << 16) ? 16 : (shca->hca_cap_mr_pgsize) & (1ULL << 15) ? 15 : (shca->hca_cap_mr_pgsize) & (1ULL << 14) ? 14 : (shca->hca_cap_mr_pgsize) & (1ULL << 13) ? 13 : (shca->hca_cap_mr_pgsize) & (1ULL << 12) ? 12 : (shca->hca_cap_mr_pgsize) & (1ULL << 11) ? 11 : (shca->hca_cap_mr_pgsize) & (1ULL << 10) ? 10 : (shca->hca_cap_mr_pgsize) & (1ULL << 9) ? 9 : (shca->hca_cap_mr_pgsize) & (1ULL << 8) ? 8 : (shca->hca_cap_mr_pgsize) & (1ULL << 7) ? 7 : (shca->hca_cap_mr_pgsize) & (1ULL << 6) ? 6 : (shca->hca_cap_mr_pgsize) & (1ULL << 5) ? 5 : (shca->hca_cap_mr_pgsize) & (1ULL << 4) ? 4 : (shca->hca_cap_mr_pgsize) & (1ULL << 3) ? 3 : (shca->hca_cap_mr_pgsize) & (1ULL << 2) ? 2 : (shca->hca_cap_mr_pgsize) & (1ULL << 1) ? 1 : (shca->hca_cap_mr_pgsize) & (1ULL << 0) ? 0 : ____ilog2_NaN() ) : (sizeof(shca->hca_cap_mr_pgsize) <= 4) ? __ilog2_u32(shca->hca_cap_mr_pgsize) : __ilog2_u64(shca->hca_cap_mr_pgsize) );
+}
+
+int x(struct ehca_shca *shca) {
+ return ehca_get_max_hwpage_size(shca);
+}
+
+int y(struct ehca_shca *shca)
+{
+ return ehca_get_max_hwpage_size(shca);
+}
+
+/* { dg-final { scan-tree-dump-times "____ilog2_NaN" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c
new file mode 100644
index 000000000..acc9980db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49671-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+volatile int t;
+static inline int cvmx_atomic_get32(volatile int *ptr)
+{
+ return *ptr;
+}
+void f(void)
+{
+ while (!cvmx_atomic_get32(&t))
+ ;
+}
+
+/* { dg-final { scan-tree-dump "\{v\}" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c
new file mode 100644
index 000000000..ba5a9d99c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49671-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int t;
+static inline int cvmx_atomic_get32(int *ptr)
+{
+ return *(volatile int*)ptr;
+}
+void f(void)
+{
+ while (!cvmx_atomic_get32(&t))
+ ;
+}
+
+/* { dg-final { scan-tree-dump "\{v\}" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49923.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49923.c
new file mode 100644
index 000000000..83113f815
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr49923.c
@@ -0,0 +1,55 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+#define PACKED __attribute__(( packed ))
+
+struct PACKED aostk_point_u8 {
+ unsigned char x;
+ unsigned char y;
+};
+
+struct PACKED aostk_size_u8 {
+ unsigned char width;
+ unsigned char height;
+};
+
+struct PACKED aostk_glyph {
+ unsigned short i;
+ struct aostk_size_u8 size;
+ char top;
+ struct aostk_point_u8 advance;
+ unsigned char pitch;
+ unsigned char* data;
+ char left;
+};
+
+
+struct PACKED aostk_font {
+ unsigned short numglyphs;
+ unsigned char height;
+ struct aostk_glyph* glyphs;
+};
+
+struct aostk_font glob_font;
+
+static struct aostk_glyph* aostk_get_glyph(struct aostk_font* f, unsigned int c) {
+ return f->glyphs;
+}
+
+int aostk_font_strwidth(struct aostk_font* font, const char* str) {
+ struct aostk_glyph* g = aostk_get_glyph(font, 0);
+ return (g != 0);
+}
+
+struct aostk_font*
+__attribute__ ((noinline, noclone))
+get_some_font (void)
+{
+ return &glob_font;
+}
+
+int main (int argc, char *argv[])
+{
+ return (int) aostk_font_strwidth (get_some_font (), "sth");
+
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c
new file mode 100644
index 000000000..2c4ec4723
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+typedef __complex__ double Value;
+
+union U
+{
+ Value v;
+ char c[sizeof(Value)];
+};
+
+struct S
+{
+ union U u;
+ int i,j;
+};
+
+Value gv;
+int gi, gj;
+
+Value foo (void)
+{
+ struct S s,t;
+
+ t.i = gi;
+ t.j = gj;
+ t.u.v = gv;
+ t.u.c[0] = 0;
+
+ s = t;
+ __imag__ s.u.v += s.i;
+
+ return s.u.v;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr52631.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr52631.c
new file mode 100644
index 000000000..21b2f3fed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr52631.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-details" } */
+
+unsigned f(unsigned a)
+{
+#if __SIZEOF_INT__ == 2
+ unsigned b = a >> 15;
+#else
+ unsigned b = a >> 31;
+#endif
+ return b&1;
+}
+
+/* We want to verify that we replace the b & 1 with b. */
+/* { dg-final { scan-tree-dump-times "Replaced b_\[0-9\]+ & 1 with b_\[0-9\]+ in" 1 "fre1"} } */
+
+/* { dg-final { cleanup-tree-dump "fre1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c
new file mode 100644
index 000000000..c8a1591b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54211.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+int a, b;
+unsigned char e;
+void fn1 ()
+{
+ unsigned char *c=0;
+ for (;; a++)
+ {
+ unsigned char d = *(c + b);
+ for (; &e<&d; c++)
+ goto Found_Top;
+ }
+Found_Top:
+ if (0)
+ goto Empty_Bitmap;
+ for (;; a++)
+ {
+ unsigned char *e = c + b;
+ for (; c < e; c++)
+ goto Found_Bottom;
+ c -= b;
+ }
+Found_Bottom:
+Empty_Bitmap:
+ ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54245.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54245.c
new file mode 100644
index 000000000..daca0423a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54245.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-slsr-details" } */
+
+#include <stdio.h>
+
+#define W1 22725
+#define W2 21407
+#define W3 19266
+#define W6 8867
+
+void idct_row(short *row, int *dst)
+{
+ int a0, a1, b0, b1;
+
+ a0 = W1 * row[0];
+ a1 = a0;
+
+ a0 += W2 * row[2];
+ a1 += W6 * row[2];
+
+ b0 = W1 * row[1];
+ b1 = W3 * row[1];
+
+ dst[0] = a0 + b0;
+ dst[1] = a0 - b0;
+ dst[2] = a1 + b1;
+ dst[3] = a1 - b1;
+}
+
+static short block[8] = { 1, 2, 3, 4 };
+
+int main(void)
+{
+ int out[4];
+ int i;
+
+ idct_row(block, out);
+
+ for (i = 0; i < 4; i++)
+ printf("%d\n", out[i]);
+
+ return !(out[2] == 87858 && out[3] == 10794);
+}
+
+/* For now, disable inserting an initializer when the multiplication will
+ take place in a smaller type than originally. This test may be deleted
+ in future when this case is handled more precisely. */
+/* { dg-final { scan-tree-dump-times "Inserting initializer" 0 "slsr" { target { ! int16 } } } } */
+/* { dg-final { cleanup-tree-dump "slsr" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54915.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54915.c
new file mode 100644
index 000000000..1e11df198
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr54915.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef double v2df __attribute__ ((__vector_size__ (16)));
+typedef double v4df __attribute__ ((__vector_size__ (32)));
+
+void f (v2df *ret, v4df* xp)
+{
+ v4df x = *xp;
+ v2df xx = { x[2], x[3] };
+ *ret = xx;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr55008.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr55008.c
new file mode 100644
index 000000000..32af32a80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr55008.c
@@ -0,0 +1,17 @@
+/* This used to fail to compile; see PR55008. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -w" } */
+
+typedef unsigned long long T;
+
+void f(void)
+{
+ int a, *p;
+
+ T b = 6309343725;
+
+ if(*p ? (b = 1) : 0)
+ if(b - (a = b /= 0) ? : (a + b))
+ while(1);
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr55579.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr55579.c
new file mode 100644
index 000000000..16807cf66
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr55579.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fdump-tree-esra -fvar-tracking-assignments" } */
+
+struct S { int a; char b; char c; short d; };
+
+int
+foo (int x)
+{
+ struct S s = { x + 1, x + 2, x + 3, x + 4 };
+ char *p = &s.c;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump "Created a debug-only replacement for s" "esra" } } */
+/* { dg-final { cleanup-tree-dump "esra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr57361.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr57361.c
new file mode 100644
index 000000000..bc265db6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr57361.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dse1-details" } */
+
+struct A { int x; double y; };
+void f (struct A *a) {
+ *a = *a;
+}
+
+/* { dg-final { scan-tree-dump "Deleted dead store" "dse1"} } */
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr57385.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr57385.c
new file mode 100644
index 000000000..a1f001db3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr57385.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+/* { dg-require-effective-target int32plus } */
+
+int c;
+
+void foo(int f)
+{
+ int wbi=-100000000;
+ c = (f ? "012346000000000000":"01345:000000006008")[wbi];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr58480.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr58480.c
new file mode 100644
index 000000000..a42edf973
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr58480.c
@@ -0,0 +1,19 @@
+/* { dg-do compile { target { ! keeps_null_pointer_checks } } } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void eliminate (void);
+extern void* f1 (void *a, void *b) __attribute__((nonnull));
+extern void* f2 (void *a, void *b) __attribute__((nonnull(2)));
+void g1 (void*p, void*q){
+ f1 (q, p);
+ if (p == 0)
+ eliminate ();
+}
+void g2 (void*p, void*q){
+ f2 (q, p);
+ if (p == 0)
+ eliminate ();
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate\[^\\n\]*to 0" 2 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr58958.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr58958.c
new file mode 100644
index 000000000..faf377fb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr58958.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+double a[10];
+int f(int n){
+ a[3]=9;
+ __builtin_memset(&a[n],3,sizeof(double));
+ return a[3]==9;
+}
+
+/* { dg-final { scan-tree-dump " == 9" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c
new file mode 100644
index 000000000..bc9d73049
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -fdump-tree-vrp1-details" } */
+
+typedef unsigned short u16;
+typedef unsigned char u8;
+typedef unsigned int u32;
+#define NNN 10
+
+u32 f[NNN], t[NNN];
+
+static u16
+Calc_crc8 (u8 data, u16 crc)
+{
+ u8 i=0,x16=0,carry=0;
+ for (i = 0; i < 8; i++)
+ {
+ x16 = (u8)((data & 1) ^ ((u8)crc & 1));
+ data >>= 1;
+
+ if (x16 == 1)
+ {
+ crc ^= 0x4002;
+ carry = 1;
+ }
+ else
+ carry = 0;
+ crc >>= 1;
+ if (carry)
+ crc |= 0x8000;
+ else
+ crc &= 0x7fff;
+ }
+ return crc;
+}
+
+int
+main (int argc, char argv[])
+{
+ int i, j; u16 crc;
+ for (j = 0; j < 10000000; j++)
+ {
+ for (i = 0; i < NNN; i++)
+ {
+ f[i] = random(i);
+ t[i] = random(NNN - i - 1);
+ }
+ for (i=0; i<NNN; i++)
+ {
+ crc=Calc_crc8(f[i],(u16)argc);
+ crc=Calc_crc8(t[i],crc);
+ }
+ }
+ return crc;
+}
+
+/* { dg-final { scan-tree-dump "Cancelling" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c
new file mode 100644
index 000000000..f1e52e5d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
+
+void abort (void);
+
+unsigned fib[1000];
+
+__attribute__ ((noinline))
+void count_fib(void)
+{
+ int i;
+
+ fib[0] = 0;
+ fib[1] = 1;
+ for (i = 2; i < 1000; i++)
+ fib[i] = (fib[i-1] + fib[i - 2]) & 0xffff;
+}
+
+unsigned avg[1000];
+
+__attribute__ ((noinline))
+void count_averages(int n)
+{
+ int i;
+
+ for (i = 1; i < n; i++)
+ avg[i] = (((unsigned long) fib[i - 1] + fib[i] + fib[i + 1]) / 3) & 0xffff;
+}
+
+int main(void)
+{
+ count_fib ();
+ count_averages (999);
+
+ if (fib[19] != 4181 || avg[19] != 4510)
+ abort ();
+
+ if (fib[999] != 162 || avg[998] != 21953)
+ abort ();
+
+ return 0;
+}
+
+/* Verify that both loops were transformed and unrolled. */
+/* { dg-final { scan-tree-dump-times "Unrolling 2 times." 2 "pcom"} } */
+
+/* Also check that we undid the transformation previously made by PRE. */
+/* { dg-final { scan-tree-dump-times "looparound ref" 1 "pcom"} } */
+
+/* { dg-final { cleanup-tree-dump "pcom" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c
new file mode 100644
index 000000000..27e53ee65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-2.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
+
+void abort (void);
+
+long int fib[1000];
+
+__attribute__ ((noinline))
+void count_fib(void)
+{
+ int i;
+
+ fib[0] = 0;
+ fib[1] = 1;
+ for (i = 2; i < 1000; i++)
+ fib[i] = (fib[i-1] + fib[i - 2]) & 0xffff;
+}
+
+int avg[1000];
+
+__attribute__ ((noinline))
+void count_averages(void)
+{
+ int i;
+
+ for (i = 1; i < 999; i++)
+ avg[i] = ((fib[i - 1] + fib[i] + fib[i + 1]) / 3) & 0xffff;
+}
+
+int main(void)
+{
+ count_fib ();
+ count_averages ();
+
+ if (fib[19] != 4181 || avg[19] != 4510)
+ abort ();
+
+ if (fib[999] != 162 || avg[998] != 21953)
+ abort ();
+
+ return 0;
+}
+
+/* Verify that both loops were transformed and unrolled. */
+/* { dg-final { scan-tree-dump-times "Unrolling 2 times." 2 "pcom"} } */
+/* { dg-final { cleanup-tree-dump "pcom" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c
new file mode 100644
index 000000000..5dfe38424
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
+
+int a[1000], b[1000];
+
+void test(void)
+{
+ int i;
+
+ for (i = 1; i < 999; i++)
+ b[i] = (a[i + 1] + a[i] + a[i - 1]) / 3;
+}
+
+/* Verify that we used 3 temporary variables for the loop. */
+/* { dg-final { scan-tree-dump-times "Unrolling 3 times." 1 "pcom"} } */
+/* { dg-final { cleanup-tree-dump "pcom" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c
new file mode 100644
index 000000000..c29a46ac2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
+
+/* Test for predictive commoning of expressions, without reassociation. */
+
+void abort (void);
+
+int a[1000], b[1000], c[1000];
+
+int main(void)
+{
+ int i;
+
+ for (i = 0; i < 1000; i++)
+ a[i] = b[i] = i;
+
+ for (i = 1; i < 998; i++)
+ c[i] = a[i + 2] * b[i + 1] - b[i - 1] * a[i];
+
+ for (i = 1; i < 998; i++)
+ if (c[i] != 4 * i + 2)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Combination" 1 "pcom"} } */
+/* { dg-final { scan-tree-dump-times "Unrolling 3 times." 1 "pcom"} } */
+/* { dg-final { cleanup-tree-dump "pcom" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c
new file mode 100644
index 000000000..29444abe5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */
+
+/* Test for predictive commoning of expressions, with reassociation. */
+
+void abort (void);
+
+unsigned a[1000], b[1000], c[1000], d[1000];
+
+int main(void)
+{
+ unsigned i;
+
+ for (i = 0; i < 1000; i++)
+ a[i] = b[i] = d[i] = i;
+
+ for (i = 1; i < 998; i++)
+ c[i] = d[i + 1] * a[i + 2] * b[i + 1] - b[i - 1] * a[i] * d[i - 1];
+
+ for (i = 1; i < 998; i++)
+ if (c[i] != (i+1)*(i+2)*(i+1) - (i - 1) * i * (i - 1))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Combination" 2 "pcom"} } */
+/* { dg-final { scan-tree-dump-times "Unrolling 3 times." 1 "pcom"} } */
+/* { dg-final { cleanup-tree-dump "pcom" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-6.c
new file mode 100644
index 000000000..96d9bf93e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-6.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+
+int a, c, e[5][2];
+unsigned int d;
+
+int
+main ()
+{
+ for (d = 0; d < 2; d++)
+ if (a ? 0 : e[c + 3][d] & e[c + 4][d])
+ break;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-7.c
new file mode 100644
index 000000000..e7ae87ccc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-7.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fdump-tree-pcom-details" } */
+
+int b, f, d[5][2];
+unsigned int c;
+
+int
+main ()
+{
+ for (c = 0; c < 2; c++)
+ if (d[b + 3][c] & d[b + 4][c])
+ if (f)
+ break;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Executing predictive commoning" "pcom" } } */
+/* { dg-final { cleanup-tree-dump "pcom" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c
new file mode 100644
index 000000000..dc19150ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-3.c
@@ -0,0 +1,22 @@
+/* Prefetching used to prefer nonsensical unroll factor of 5 in this testcase. */
+
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse -fdump-tree-aprefetch-details" } */
+
+#define N 1000000
+
+double a[N];
+
+double test(void)
+{
+ unsigned i;
+ double sum = 0;
+
+ for (i = 0; i < N; i += 2)
+ sum += (a[i] * a[i+1]);
+
+ return sum;
+}
+
+/* { dg-final { scan-tree-dump-times "unroll factor 4" 1 "aprefetch" } } */
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-4.c
new file mode 100644
index 000000000..11fd41f0b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-4.c
@@ -0,0 +1,17 @@
+/* The loop rolls too little, hence the prefetching would not be useful. */
+
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -fdump-tree-optimized" } */
+
+int xxx[20];
+
+void foo (int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ xxx[i] = i;
+}
+
+/* { dg-final { scan-tree-dump-times "prefetch" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-5.c
new file mode 100644
index 000000000..1ccf50693
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-5.c
@@ -0,0 +1,59 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-O2 --param min-insn-to-prefetch-ratio=5 -fprefetch-loop-arrays -march=athlon -fdump-tree-aprefetch-details" } */
+
+/* These are common idioms for writing variable-length arrays at the end
+ of structures. We should not deduce anything about the number of iterations
+ of the loops from them. */
+
+struct tail0
+{
+ int xxx;
+ int yyy[0];
+};
+
+int loop0 (int n, struct tail0 *x)
+{
+ int i, s = 0;
+
+ for (i = 0; i < n; i++)
+ s += x->yyy[i];
+
+ return s;
+}
+
+struct tail1
+{
+ int xxx;
+ int yyy[1];
+};
+int loop1 (int n, struct tail1 *x)
+{
+ int i, s = 0;
+
+ for (i = 0; i < n; i++)
+ s += x->yyy[i];
+
+ return s;
+}
+
+/* It is unlikely that this should be a tail array. We may deduce that most
+ likely, the loop iterates about 5 times, and the array is not worth prefetching. */
+
+struct tail5
+{
+ int xxx;
+ int yyy[5];
+};
+int loop5 (int n, struct tail5 *x)
+{
+ int i, s = 0;
+
+ for (i = 0; i < n; i++)
+ s += x->yyy[i];
+
+ return s;
+}
+
+/* { dg-final { scan-tree-dump-times "Issued prefetch" 2 "aprefetch" } } */
+/* { dg-final { scan-tree-dump-times "Not prefetching" 1 "aprefetch" } } */
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c
new file mode 100644
index 000000000..176830580
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-6.c
@@ -0,0 +1,54 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 --param min-insn-to-prefetch-ratio=6 -fdump-tree-aprefetch-details" } */
+
+#define N 1000
+#define K 900
+
+double a[N][N];
+
+double test(void)
+{
+ unsigned i, j;
+ double sum = 0;
+
+ /* Here, we should use non-temporal prefetch instruction. */
+ for (i = 0; i < K; i++)
+ for (j = 0; j < K; j++)
+ sum += a[i][j];
+
+ /* Here, we should not use non-temporal prefetch instruction, since the
+ value of a[i+10][j] is reused in L2 cache. */
+ for (i = 0; i < K; i++)
+ for (j = 0; j < K; j++)
+ sum += a[i][j] * a[i + 10][j];
+
+ /* Here, we should use non-temporal prefetch instruction, since the
+ value of a[i+100][j] is too far to be reused in L2 cache. */
+ for (i = 0; i < K; i++)
+ for (j = 0; j < K; j++)
+ sum += a[i][j] * a[i + 100][j];
+
+ /* Here, temporal prefetches should be used, since the volume of the
+ memory accesses is smaller than L2 cache. */
+ for (i = 0; i < 100; i++)
+ for (j = 0; j < 100; j++)
+ sum += a[i][j] * a[i + 100][j];
+
+ /* Temporal prefetches should be used here (even though the accesses to
+ a[j][i] are independent, the same cache line is almost always hit
+ every N iterations). */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum += a[j][i];
+
+ return sum;
+}
+
+/* { dg-final { scan-tree-dump-times "Issued prefetch" 5 "aprefetch" } } */
+/* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 3 "aprefetch" } } */
+
+/* { dg-final { scan-assembler-times "prefetcht" 5 } } */
+/* { dg-final { scan-assembler-times "prefetchnta" 3 } } */
+
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c
new file mode 100644
index 000000000..5c469ba00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c
@@ -0,0 +1,48 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
+
+#define K 1000000
+int a[K];
+
+void test(int *p)
+{
+ unsigned i;
+
+ /* Nontemporal store should not be used here (only write and read temporal
+ prefetches). */
+ for (i = 0; i < K - 10000; i++)
+ a[i + 10000] = a[i];
+
+ /* Nontemporal store should not be used here (only write and read nontemporal
+ prefetches). */
+ for (i = 0; i < K - 100000; i++)
+ a[i + 100000] = a[i];
+
+ /* Nontemporal store should be used neither for a nor for p, as we do not know
+ whether they alias or not. */
+ for (i = 0; i < K; i++)
+ {
+ a[i] = 0;
+ *p++ = 1;
+ }
+
+ /* Nontemporal store should not be used for a, as we do not know whether its
+ value will be reused or not. */
+ for (i = 0; i < 1000; i++)
+ a[i] = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Issued prefetch" 5 "aprefetch" } } */
+/* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 2 "aprefetch" } } */
+/* { dg-final { scan-tree-dump-times "a nontemporal store" 0 "aprefetch" } } */
+
+/* { dg-final { scan-tree-dump-times "builtin_prefetch" 7 "optimized" } } */
+
+/* { dg-final { scan-assembler-times "prefetchw" 5 } } */
+/* { dg-final { scan-assembler-times "prefetcht" 1 } } */
+/* { dg-final { scan-assembler-times "prefetchnta" 1 } } */
+
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c
new file mode 100644
index 000000000..705d35fe2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
+
+#define K 1000000
+int a[K];
+
+void test()
+{
+ unsigned i;
+
+ /* Nontemporal store should be used for a. */
+ for (i = 0; i < K; i++)
+ a[i] = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "a nontemporal store" 1 "aprefetch" } } */
+
+/* { dg-final { scan-tree-dump "=\\{nt\\}" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 1 "optimized" } } */
+
+/* { dg-final { scan-assembler "movnti" } } */
+/* { dg-final { scan-assembler-times "mfence" 1 } } */
+
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c
new file mode 100644
index 000000000..f78bea3a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c
@@ -0,0 +1,31 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
+
+#define K 1000000
+int a[K], b[K];
+
+void test()
+{
+ unsigned i;
+
+ /* Nontemporal store should be used for a, nontemporal prefetch for b. */
+ for (i = 0; i < K; i++)
+ a[i] = b[i];
+
+}
+
+/* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 1 "aprefetch" } } */
+/* { dg-final { scan-tree-dump-times "a nontemporal store" 1 "aprefetch" } } */
+
+/* { dg-final { scan-tree-dump-times "builtin_prefetch" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump "=\\{nt\\}" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 1 "optimized" } } */
+
+/* { dg-final { scan-assembler-times "prefetchnta" 1 } } */
+/* { dg-final { scan-assembler "movnti" } } */
+/* { dg-final { scan-assembler-times "mfence" 1 } } */
+
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c
new file mode 100644
index 000000000..9c8ec3034
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 --param max-fields-for-field-sensitive=2 -fdump-tree-alias" } */
+
+struct Foo {
+ int *p, *q;
+};
+
+int *foo (int ***x) __attribute__((pure));
+
+int bar (int b)
+{
+ int i;
+ struct Foo f;
+ int *p, **q;
+ p = &i;
+ f.p = &i;
+ f.q = f.p;
+ if (b)
+ q = &f.p;
+ else
+ q = &f.q;
+ return *foo (&q);
+}
+
+/* { dg-final { scan-tree-dump "CALLUSED = { ESCAPED NONLOCAL f.* i q }" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c
new file mode 100644
index 000000000..dcfae5dd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-O -fdump-tree-alias-details" } */
+
+int *i;
+void __attribute__((noinline))
+foo (void)
+{
+ *i = 1;
+}
+int __attribute__((noinline))
+bar(int local_p)
+{
+ int x = 0;
+ int *j;
+ int **p;
+ if (local_p)
+ p = &j;
+ else
+ p = &i;
+ *p = &x; /* This makes x escape. */
+ foo ();
+ return x;
+}
+extern void abort (void);
+int main()
+{
+ int k = 2;
+ i = &k;
+ if (bar (1) != 0 || k != 1)
+ abort ();
+ if (bar (0) != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "ESCAPED = { NULL ESCAPED NONLOCAL x }" "alias" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "ESCAPED = { ESCAPED NONLOCAL x }" "alias" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c
new file mode 100644
index 000000000..e6139591e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "-O -fdump-tree-alias-details" } */
+
+int *i;
+void __attribute__((noinline))
+foo (void)
+{
+ *i = 1;
+}
+int __attribute__((noinline))
+bar(int local_p, int **q)
+{
+ int x = 0;
+ int *j;
+ int **p;
+ if (local_p)
+ p = &j;
+ else
+ p = q;
+ *p = &x; /* This makes x escape. */
+ foo ();
+ return x;
+}
+extern void abort (void);
+int main()
+{
+ int k = 2;
+ int **q = &i;
+ i = &k;
+ if (bar (1, q) != 0 || k != 1)
+ abort ();
+ if (bar (0, q) != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "ESCAPED = { NULL ESCAPED NONLOCAL x }" "alias" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "ESCAPED = { ESCAPED NONLOCAL x }" "alias" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c
new file mode 100644
index 000000000..870dcf6b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-options "-O -fdump-tree-alias-details" } */
+
+int *i;
+void __attribute__((noinline))
+foo (void)
+{
+ *i = 1;
+}
+int **__attribute__((noinline,const))
+foobar (void)
+{
+ return &i;
+}
+int __attribute__((noinline))
+bar(int local_p)
+{
+ int x = 0;
+ int *j;
+ int **p;
+ if (local_p)
+ p = &j;
+ else
+ p = foobar();
+ *p = &x; /* This makes x escape. */
+ foo ();
+ return x;
+}
+extern void abort (void);
+int main()
+{
+ int k = 2;
+ i = &k;
+ if (bar (1) != 0 || k != 1)
+ abort ();
+ if (bar (0) != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "ESCAPED = { NULL ESCAPED NONLOCAL x }" "alias" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump "ESCAPED = { ESCAPED NONLOCAL x }" "alias" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c
new file mode 100644
index 000000000..022783df1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-fp.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-alias" } */
+extern double cos (double);
+extern double sin (double);
+double f(double a)
+{
+ double b;
+ double c,d;
+ double (*fp) (double);
+ if (a < 2.0)
+ {
+ fp = sin;
+ c = fp (a);
+ }
+ else
+ {
+ c = 1.0;
+ fp = cos;
+ }
+ d = fp (a);
+ return d + c;
+}
+/* The points-to set of the final function pointer should be "sin cos" */
+
+/* { dg-final { scan-tree-dump-times "{ sin cos }" 1 "alias"} } */
+/* { dg-final { cleanup-tree-dump "alias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c
new file mode 100644
index 000000000..d4121122b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */
+
+extern void abort (void);
+struct X {
+ int *p;
+ int *q;
+ int *r;
+};
+int __attribute__((noinline))
+foo(int i, int j, int k, int off)
+{
+ struct X x;
+ int **p, *q;
+ x.p = &i;
+ x.q = &j;
+ x.r = &k;
+ p = &x.q;
+ p += 1;
+ /* *p points to { k } */
+ q = *p;
+ return *q;
+}
+
+/* { dg-final { scan-tree-dump "q_. = { k }" "ealias" } } */
+/* { dg-final { cleanup-tree-dump "ealias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c
new file mode 100644
index 000000000..430f216da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */
+
+extern void abort (void);
+struct X {
+ int *p;
+ int *q;
+ int *r;
+};
+int __attribute__((noinline))
+foo(int i, int j, int k, int off)
+{
+ struct X x;
+ int **p, *q;
+ x.p = &i;
+ x.q = &j;
+ x.r = &k;
+ p = &x.q;
+ p -= 1;
+ /* *p points to { i } */
+ q = *p;
+ return *q;
+}
+
+/* { dg-final { scan-tree-dump "q_. = { i }" "ealias" } } */
+/* { dg-final { cleanup-tree-dump "ealias" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-1.c
new file mode 100644
index 000000000..43ccd8eaa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int a, b, c, d;
+extern int printf (const char *, ...);
+int main(void)
+{
+ int e;
+ int f;
+ /* We should be able to transform these into the same expression, and only have two additions. */
+ e = a + b;
+ e = e + c;
+ f = c + a;
+ f = f + b;
+ printf ("%d %d\n", e, f);
+}
+
+/* We cannot reassociate these expressions because of undefined signed
+ integer overflow. Instead the value-numberer has to be extended
+ to canonicalize these expressions. */
+
+/* { dg-final { scan-tree-dump-times "b.._. \\\+ a.._." 1 "optimized" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times " \\\+ " 2 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-10.c
new file mode 100644
index 000000000..cdc277431
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-10.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int main(int a, int b, int c, int d)
+{
+ /* Should become just a & b & c & d */
+ int e = (a & b) & (c & d);
+ int f = (c & a) & (b & d);
+ return e & f;
+}
+/* { dg-final { scan-tree-dump-times "\\\& " 3 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-11.c
new file mode 100644
index 000000000..f48f04e99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-11.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+int main(int a, int b, int c, int d)
+{
+ /* All the xor's cancel each other out, leaving 0 */
+ int e = (a ^ b) ^ (c ^ d);
+ int f = (c ^ a) ^ (b ^ d);
+ return e ^ f;
+}
+/* { dg-final { scan-tree-dump-times "= 0" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-12.c
new file mode 100644
index 000000000..65e2931ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-12.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1-details" } */
+int f(int a, int b)
+{
+ /* MAX_EXPR <a, a> should cause it to be equivalent to a. */
+ int c = a>=b?a:b;
+ int d = c>=a?c:a;
+ return d;
+}
+/* { dg-final { scan-tree-dump-times "Equivalence:" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-13.c
new file mode 100644
index 000000000..f05401cba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-13.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -fdump-tree-reassoc1 -fdump-tree-optimized" } */
+
+double foo(double a)
+{
+ double tmp = 5.0;
+ double tmp2 = a + tmp;
+ tmp2 = tmp2 - a;
+ return a + tmp2 - 5.0;
+}
+
+/* { dg-final { scan-tree-dump-not "\\\+ 0.0" "reassoc1" } } */
+/* { dg-final { scan-tree-dump "return a_..D.;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-14.c
new file mode 100644
index 000000000..5b57160bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-14.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+unsigned int test1 (unsigned int x, unsigned int y, unsigned int z,
+ unsigned int weight)
+{
+ unsigned int tmp1 = x * weight;
+ unsigned int tmp2 = y * weight;
+ unsigned int tmp3 = (x - y) * weight;
+ return tmp1 + (tmp2 + tmp3);
+}
+
+unsigned int test2 (unsigned int x, unsigned int y, unsigned int z,
+ unsigned int weight)
+{
+ unsigned int tmp1 = x * weight;
+ unsigned int tmp2 = y * weight * weight;
+ unsigned int tmp3 = z * weight * weight * weight;
+ return tmp1 + tmp2 + tmp3;
+}
+
+/* There should be one multiplication left in test1 and three in test2. */
+
+/* { dg-final { scan-tree-dump-times "\\\*" 4 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-15.c
new file mode 100644
index 000000000..df6fd5213
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-15.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+unsigned int test3 (unsigned int x, unsigned int y, unsigned int z,
+ unsigned int weight,
+ unsigned int w1, unsigned int w2, unsigned int w3)
+{
+ unsigned int wtmp1 = w1 * weight;
+ unsigned int wtmp2 = w2 * weight;
+ unsigned int wtmp3 = w3 * weight;
+ unsigned int tmp1 = x * wtmp1;
+ unsigned int tmp2 = y * wtmp2;
+ unsigned int tmp3 = z * wtmp3;
+ return tmp1 + tmp2 + tmp3;
+}
+
+/* The multiplication with weight should be un-distributed.
+ ??? This pattern is not recognized currently. */
+
+/* { dg-final { scan-tree-dump-times "\\\*" 4 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-16.c
new file mode 100644
index 000000000..4dd54a8cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-16.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -fdump-tree-reassoc1" } */
+
+double test1 (double x, double y, double z, double weight)
+{
+ double tmp1 = x / weight;
+ double tmp2 = y / weight;
+ double tmp3 = -x / weight;
+ return tmp1 + tmp2 + tmp3;
+}
+
+/* The division should be un-distributed and all references to x should
+ be gone. */
+
+/* { dg-final { scan-tree-dump-times "/" 1 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-17.c
new file mode 100644
index 000000000..255c786d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-17.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math -fdump-tree-reassoc1" } */
+
+double test2 (double x, double y, double ddj, int b)
+{
+ double tmp1, tmp2, sum;
+ sum = 0.0;
+ if (b)
+ sum = 1.0;
+ tmp1 = sum/ddj;
+ tmp2 = x/ddj;
+ return tmp1 + y + tmp2;
+}
+
+/* { dg-final { scan-tree-dump-times "/" 1 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-18.c
new file mode 100644
index 000000000..ab7fe295a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-18.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-reassoc1" } */
+
+unsigned int
+ETree_nFactorEntriesInFront (unsigned int b, unsigned int m)
+{
+ unsigned int nent = b*b + 2*b*m;
+ return nent;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\*" 2 "reassoc1" } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c
new file mode 100644
index 000000000..bbaf69b40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-optimized" } */
+
+/* Slightly changed testcase from PR middle-end/40815. */
+void bar(char*, char*, int);
+void foo(char* left, char* rite, int element)
+{
+ while (left <= rite)
+ {
+ /* This should expand into
+ _7 = (sizetype) element_6(D);
+ _8 = -_7;
+ rite_9 = rite_1 + _8; */
+ rite -= element;
+ bar(left, rite, element);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "= \\\(sizetype\\\) element" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= -" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\\+ " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-2.c
new file mode 100644
index 000000000..c5787ab5a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int f (int a0,int a1,int a2,int a3,int a4)
+{
+int b0, b1, b2, b3, b4,e;
+ /* this can be optimized to four additions... */
+ b4 = a4 + a3 + a2 + a1 + a0;
+ b3 = a3 + a2 + a1 + a0;
+ b2 = a2 + a1 + a0;
+ b1 = a1 + a0;
+ /* This is actually 0 */
+ e = b4 - b3 + b2 - b1 - a4 - a2;
+ return e;
+}
+
+/* We can't reassociate the expressions due to undefined signed overflow. */
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c
new file mode 100644
index 000000000..1cfb98093
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-20.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+unsigned int a, b, c, d;
+extern int printf (const char *, ...);
+int main(void)
+{
+ unsigned int e;
+ unsigned int f;
+ /* We should be able to transform these into the same expression, and only have two additions. */
+ e = a + b;
+ e = e + c;
+ f = c + a;
+ f = f + b;
+ printf ("%d %d\n", e, f);
+}
+
+/* { dg-final { scan-tree-dump-times "b.._. \\\+ a.._." 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\\+ " 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-21.c
new file mode 100644
index 000000000..e02de1b47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-21.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+unsigned int f (unsigned int a0, unsigned int a1, unsigned int a2,
+ unsigned int a3, unsigned int a4)
+{
+ unsigned int b0, b1, b2, b3, b4, e;
+ /* this can be optimized to four additions... */
+ b4 = a4 + a3 + a2 + a1 + a0;
+ b3 = a3 + a2 + a1 + a0;
+ b2 = a2 + a1 + a0;
+ b1 = a1 + a0;
+ /* This is actually 0 */
+ e = b4 - b3 + b2 - b1 - a4 - a2;
+ return e;
+}
+
+/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-22.c
new file mode 100644
index 000000000..7eb97f456
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-22.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+unsigned int foo(unsigned int a, unsigned int b, unsigned int c, unsigned int d)
+{
+ /* Should be transformed into a + c + 8 */
+ unsigned int e = a + 3;
+ unsigned int f = c + 5;
+ unsigned int g = e + f;
+ return g;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\+ 8" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c
new file mode 100644
index 000000000..65aee7237
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+unsigned int
+foo(unsigned int a, unsigned int b, unsigned int c, unsigned int d,
+ unsigned int e, unsigned int f, unsigned int g, unsigned int h)
+{
+ /* Should be transformed into e = 20 */
+ unsigned int i = (a + 9) + (c + 8);
+ unsigned int j = (-c + 1) + (-a + 2);
+
+ e = i + j;
+ return e;
+}
+
+/* { dg-final { scan-tree-dump-times "= 20" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c
new file mode 100644
index 000000000..c871628ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 --param tree-reassoc-width=2 -fdump-tree-reassoc1" } */
+
+unsigned int
+foo (void)
+{
+ unsigned int a = 0;
+ unsigned int b;
+
+ asm volatile ("" : "=r" (b) : "0" (0));
+ a += b;
+ asm volatile ("" : "=r" (b) : "0" (0));
+ a += b;
+ asm volatile ("" : "=r" (b) : "0" (0));
+ a += b;
+ asm volatile ("" : "=r" (b) : "0" (0));
+ a += b;
+
+ return a;
+}
+
+/* Verify there are two pairs of __asm__ statements with no
+ intervening stmts. */
+/* { dg-final { scan-tree-dump-times "__asm__\[^;\n]*;\n *__asm__" 2 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c
new file mode 100644
index 000000000..4ff66ef8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 --param tree-reassoc-width=3 -fdump-tree-reassoc1-details" } */
+
+unsigned int
+foo (int a, int b, int c, int d)
+{
+ unsigned int s = 0;
+
+ s += a;
+ s += b;
+ s += c;
+ s += d;
+
+ return s;
+}
+
+/* Verify reassociation width was chosen to be 2. */
+/* { dg-final { scan-tree-dump-times "Width = 2" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-26.c
new file mode 100644
index 000000000..ae4bdaa9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-26.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/56559 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double a, b, c, d, e;
+
+void
+foo ()
+{
+ a = e * e;
+ b = d * e + c * e * a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-27.c
new file mode 100644
index 000000000..f406beb2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-27.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -frounding-math -fdump-tree-optimized" } */
+
+double baz (double foo, double bar)
+{
+ return foo * foo * foo * foo * bar * bar * bar * bar;
+}
+
+/* We should re-associate this as (foo * bar)**3. */
+/* { dg-final { scan-tree-dump-times " \\\* " 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c
new file mode 100644
index 000000000..2e9998601
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-28.c
@@ -0,0 +1,32 @@
+/* { dg-do run} */
+/* { dg-options "-O2" } */
+
+#define LENGTH 4
+void abort (void);
+unsigned
+__attribute__ ((noinline)) foo (unsigned char *buf, int n)
+{
+ unsigned sum = 0, i = 0;
+ do {
+ sum +=(buf)[n-1];
+ /* Split the BB to test statements are correctly moved to
+ satisfy dependences. */
+ if (n > LENGTH)
+ i++;
+ sum += buf[n-2];
+ sum += buf[n-3];
+ sum += buf[n-4];
+ n = n-4;
+ } while (n > 0);
+
+ return sum + i;
+}
+
+unsigned char a[] = {1, 1, 1, 1};
+
+int main() {
+ int sum = foo (a, LENGTH);
+ if (sum != 4)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-29.c
new file mode 100644
index 000000000..ac01d75b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-29.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/57322 */
+/* { dg-do compile } */
+/* { dg-options "-w -O1" } */
+int a;
+
+void f (void)
+{
+ char b;
+
+ for (;; a++)
+ {
+ char *p = &b, *q;
+ *q = b < 0 & !!*p;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c
new file mode 100644
index 000000000..178e6a448
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-3.c
@@ -0,0 +1,7 @@
+/* { dg-options "" } */
+int main(int a, int b, int c, int d)
+{
+ int e = (a & ~b) & (~c & d);
+ int f = (~c & a) & (b & ~d);
+ return (e & f);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-30.c
new file mode 100644
index 000000000..662898483
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-30.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/57442 */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+short a;
+unsigned b;
+long c;
+int d;
+
+void f(void)
+{
+ b = a ? : (a = b) - c + (d - (b + b));
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-31.c
new file mode 100644
index 000000000..1c1527f13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-31.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/58011 */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+int a, b;
+
+void f(unsigned p)
+{
+ unsigned *pp = &p;
+
+ if(!a)
+ p = 0;
+
+ for(b = 0; b < 1; b++)
+ if(3 * p + 5 * *pp)
+ a = 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c
new file mode 100644
index 000000000..08530bd7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c
@@ -0,0 +1,29 @@
+/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-*"} } } */
+
+/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+
+int test (int a, int b, int c)
+{
+ if ( a == 10 || a == 12 || a == 26)
+ return b;
+ else
+ return c;
+}
+
+int main ()
+{
+ if (test (10, 20, 30) != 20)
+ __builtin_abort ();
+ if (test (12, 20, 30) != 20)
+ __builtin_abort ();
+ if (test (26, 20, 30) != 20)
+ __builtin_abort ();
+ if (test (30, 20, 30) != 30)
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests .* 26" 1 "reassoc1"} }*/
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c
new file mode 100644
index 000000000..da96d0df4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c
@@ -0,0 +1,27 @@
+/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-*"} } } */
+
+/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int test (int a, int b, int c)
+{
+ if (a == 43 || a == 75 || a == 44 || a == 78
+ || a == 77 || a == 46 || a == 76 || a == 45)
+ return b;
+ else
+ return c;
+}
+
+int
+main ()
+{
+ volatile int n43, n47, n75, n79;
+ n43 = 43; n47 = n43 + 4; n75 = 75; n79 = n75 + 4;
+ int i;
+ for (i = -10; i <= 100; i++)
+ if (test (i, 2, 3) != 3 - ((i >= n43 && i < n47) || (i >= n75 && i < n79)))
+ __builtin_abort ();
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "Optimizing range tests" 3 "reassoc1"} }*/
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c
new file mode 100644
index 000000000..dbb1a6c30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c
@@ -0,0 +1,24 @@
+/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-*"} } } */
+
+/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int test (int a, int b, int c)
+{
+ if (a == 10 || a == 12)
+ return b;
+ else
+ return c;
+}
+int main ()
+{
+ if (test (10, 20, 30) != 20)
+ __builtin_abort ();
+ if (test (12, 20, 30) != 20)
+ __builtin_abort ();
+ if (test (26, 20, 30) != 30)
+ __builtin_abort ();
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c
new file mode 100644
index 000000000..05830c831
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c
@@ -0,0 +1,26 @@
+/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-*"} } } */
+
+/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int test (unsigned int a, int b, int c)
+{
+ if ((a - 43) <= 3 || (a - 75) <= 3)
+ return b;
+ else
+ return c;
+}
+int
+main ()
+{
+ volatile int n43, n47, n75, n79;
+ n43 = 43; n47 = n43 + 4; n75 = 75; n79 = n75 + 4;
+ int i;
+ for (i = -10; i <= 100; i++)
+ if (test (i, 2, 3) != 3 - ((i >= n43 && i < n47) || (i >= n75 && i < n79)))
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c
new file mode 100644
index 000000000..91c95b583
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c
@@ -0,0 +1,25 @@
+/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-*"} } } */
+
+/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int test (int a, int b, int c)
+{
+ if (a != 10 && a != 12)
+ return b;
+ else
+ return c;
+}
+int main ()
+{
+ if (test (10, 20, 30) != 30)
+ __builtin_abort ();
+ if (test (12, 20, 30) != 30)
+ __builtin_abort ();
+ if (test (26, 20, 30) != 20)
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1"} }*/
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-4.c
new file mode 100644
index 000000000..8f9de464e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-4.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -ffast-math" } */
+float a, b, c, d;
+extern int printf (const char *, ...);
+int main(void)
+{
+ float e;
+ float f;
+ /* We should not be able to transform these into the same expression, and only have two additions. */
+ e = a + b;
+ e = e + c;
+ f = c + a;
+ f = f + b;
+ printf ("%f %f\n", e, f);
+}
+
+/* { dg-final { scan-tree-dump-times "\\\+" 2 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-5.c
new file mode 100644
index 000000000..8d168f90f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-5.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+extern int printf (const char *, ...);
+int main(int argc, int b)
+{
+ /* We should be able to get rid of the a - i. */
+ int i;
+ for (i = 0; i < 50; i++)
+ {
+ int a = b + i;
+ int c = a - i;
+ int d = argc + b;
+ printf ("%d %d\n", c,d);
+ }
+}
+/* { dg-final { scan-tree-dump-times "a - i" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-6.c
new file mode 100644
index 000000000..480f7c016
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-6.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+int main(int a, int b, int c, int d)
+{
+ /* Should be transformed into a + c + 8 */
+ int e = a + 3;
+ int f = c + 5;
+ int g = e + f;
+ return g;
+}
+
+/* We cannot re-associate the additions due to undefined signed overflow. */
+
+/* { dg-final { scan-tree-dump-times "\\\+ 8" 1 "reassoc1" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-7.c
new file mode 100644
index 000000000..ee9b80fd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-7.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+unsigned int
+foo(unsigned int a, unsigned int b, unsigned int c, unsigned int d,
+ unsigned int e, unsigned int f, unsigned int g, unsigned int h)
+{
+ /* Should be transformed into a + c + d + e + g + 15 */
+ unsigned int i = (a + 9) + (c + d);
+ unsigned int j = (e + 4) + (2 + g);
+ e = i + j;
+ return e;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\+ 15" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-8.c
new file mode 100644
index 000000000..b2ca4ae03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-8.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+int main(int a, int b, int c, int d, int e, int f, int g, int h)
+{
+ /* e & ~e -> 0 */
+ int i = (a & 9) & (c & d);
+ int j = (~e & d) & (~c & e);
+ e = i & j;
+ return e;
+}
+/* { dg-final { scan-tree-dump-times "= 0" 1 "reassoc1"} } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-9.c
new file mode 100644
index 000000000..d09303ccf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-9.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-reassoc1" } */
+
+int main(int a, int b, int c, int d, int e, int f, int g, int h)
+{
+ /* Should be transformed into e = 20 */
+ int i = (a + 9) + (c + 8);
+ int j = (-c + 1) + (-a + 2);
+
+ e = i + j;
+ return e;
+}
+
+/* We can always re-associate to a final constant but the current
+ implementation does not allow easy roll-back without IL changes. */
+
+/* { dg-final { scan-tree-dump-times "= 20" 1 "reassoc1" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "reassoc1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-1.c
new file mode 100644
index 000000000..36f2c23de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -funsafe-math-optimizations -fdump-tree-recip" } */
+
+float e(float *x, float *y, float *z)
+{
+ float m = __builtin_sqrt (*x * *x + *y * *y + *z * *z);
+ *x /= m;
+ *y /= m;
+ *z /= m;
+}
+
+/* Look for only one division. */
+/* { dg-final { scan-tree-dump-times "= .* /" 1 "recip" } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c
new file mode 100644
index 000000000..be754145e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -funsafe-math-optimizations -fdump-tree-recip" } */
+
+float u, v, w, x, y, z;
+
+void e(float a, float b, float c, float d, float e, float f)
+{
+ if (a < b)
+ {
+ a = a + b;
+ c = c + d;
+ }
+
+ /* The PHI nodes for these divisions should be combined. */
+ d = d / a;
+ e = e / a;
+ f = f / a;
+
+ a = a / c;
+ b = b / c;
+
+ /* This should not be left as a multiplication. */
+ c = 1 / c;
+
+ u = a;
+ v = b;
+ w = c;
+ x = d;
+ y = e;
+ z = f;
+}
+
+/* { dg-final { scan-tree-dump-times " / " 2 "recip" } } */
+/* { dg-final { scan-tree-dump-times " \\* " 5 "recip" } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c
new file mode 100644
index 000000000..04b40f32a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-trapping-math -funsafe-math-optimizations -fdump-tree-recip" } */
+
+double F[2] = { 0.0, 0.0 }, e;
+
+/* In this case the optimization is interesting. */
+float h ()
+{
+ int i;
+ double E, W, P, d;
+
+ W = 1.1;
+ d = 2.*e;
+ E = 1. - d;
+
+ for( i=0; i < 2; i++ )
+ if( d > 0.01 )
+ {
+ P = ( W < E ) ? (W - E)/d : (E - W)/d;
+ F[i] += P;
+ }
+
+ F[0] += E / d;
+}
+
+/* { dg-final { scan-tree-dump-times " / " 1 "recip" } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-4.c
new file mode 100644
index 000000000..20d7681d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-4.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-trapping-math -funsafe-math-optimizations -fdump-tree-recip" } */
+
+/* based on the test case in pr23109 */
+
+double F[2] = { 0., 0. }, e = 0.;
+
+/* Nope, we cannot prove the optimization is worthwhile in this case. */
+void f ()
+{
+ int i;
+ double E, W, P, d;
+
+ W = 1.;
+ d = 2.*e;
+ E = 1. - d;
+
+ if( d > 0.01 )
+ {
+ P = ( W < E ) ? (W - E)/d : (E - W)/d;
+ F[i] += P;
+ }
+}
+
+/* We also cannot prove the optimization is worthwhile in this case. */
+float g ()
+{
+ int i;
+ double E, W, P, d;
+
+ W = 1.;
+ d = 2.*e;
+ E = 1. - d;
+
+ if( d > 0.01 )
+ {
+ P = ( W < E ) ? (W - E)/d : (E - W)/d;
+ F[i] += P;
+ }
+
+ return 1.0 / d;
+}
+
+/* { dg-final { scan-tree-dump-not "reciptmp" "recip" } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-5.c
new file mode 100644
index 000000000..aafa98f16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-5.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O1 -funsafe-math-optimizations -ftrapping-math -fdump-tree-recip -fdump-tree-optimized" } */
+/* { dg-do compile } */
+/* { dg-warning "-fassociative-math disabled" "" { target *-*-* } 1 } */
+
+/* Test the reciprocal optimizations together with trapping math. */
+
+extern int f2();
+
+double f1(double y, double z, double w, double j, double k)
+{
+ double b, c, d, e, f, g;
+
+ if (f2 ())
+ /* inserts one division here */
+ b = 1 / y, c = z / y, d = j / y;
+ else
+ /* one division here */
+ b = 3 / y, c = w / y, d = k / y;
+
+ /* and one here, that should be removed afterwards but is not right now */
+ e = b / y;
+ f = c / y;
+ g = d / y;
+
+ return e + f + g;
+}
+
+/* { dg-final { scan-tree-dump-times " / " 3 "recip" } } */
+/* { dg-final { scan-tree-dump-times " / " 2 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c
new file mode 100644
index 000000000..b3334fb86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c
@@ -0,0 +1,30 @@
+/* { dg-options "-O1 -funsafe-math-optimizations -fno-trapping-math -fdump-tree-recip" } */
+/* { dg-do compile } */
+
+/* Test inserting in a block that does not contain a division. */
+
+extern int f2();
+
+double m, n, o;
+
+void f1(double y, double z, double w)
+{
+ double b, c, d, e, f;
+
+ if (g ())
+ b = 1 / y, c = z / y;
+ else
+ b = 3 / y, c = w / y;
+
+ d = b / y;
+ e = c / y;
+ f = 1 / y;
+
+ m = d;
+ n = e;
+ o = f;
+}
+
+/* { dg-final { scan-tree-dump-times " / " 1 "recip" } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c
new file mode 100644
index 000000000..98bbdca6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c
@@ -0,0 +1,31 @@
+/* { dg-options "-O1 -funsafe-math-optimizations -fno-trapping-math -fdump-tree-recip" } */
+/* { dg-do compile } */
+
+/* Test inserting in a block that does not contain a division. */
+
+extern double h();
+
+double m, n, o;
+
+void f(int x, double z, double w)
+{
+ double b, c, d, e, f;
+ double y = h ();
+
+ if (x)
+ b = 1 / y, c = z / y;
+ else
+ b = 3 / y, c = w / y;
+
+ d = b / y;
+ e = c / y;
+ f = 1 / y;
+
+ m = d;
+ n = e;
+ o = f;
+}
+
+/* { dg-final { scan-tree-dump-times " / " 1 "recip" } } */
+/* { dg-final { cleanup-tree-dump "recip" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-3.c
new file mode 100644
index 000000000..95cc1a2e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-strict-aliasing -fdump-tree-lim1-details" } */
+
+void f(int * __restrict__ r,
+ int a[__restrict__ 16][16],
+ int b[__restrict__ 16][16],
+ int i, int j)
+{
+ int x;
+ *r = 0;
+ for (x = 1; x < 16; ++x)
+ *r = *r + a[i][x] * b[x][j];
+}
+
+/* We should apply store motion to the store to *r. */
+
+/* { dg-final { scan-tree-dump "Executing store motion of \\\*r" "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
new file mode 100644
index 000000000..7bcdcdd05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int *x, int y)
+{
+ int *__restrict p1 = x;
+ int *__restrict p2 = x + 32;
+ p1[y] = 1;
+ p2[4] = 2;
+ return p1[y];
+}
+
+int
+bar (int *x, int y)
+{
+ int *__restrict p1 = x;
+ int *p3 = x + 32;
+ int *__restrict p2 = p3;
+ p1[y] = 1;
+ p2[4] = 2;
+ return p1[y];
+}
+
+/* { dg-final { scan-tree-dump-times "return 1;" 2 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sccp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sccp-1.c
new file mode 100644
index 000000000..633a37a35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sccp-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int main(int argc, char* argv[])
+{
+ int i, a = 0;
+ for (i=0; i < 10; i++)
+ a += i + 0xff00ff;
+ return a;
+}
+
+/* There should be no loop left. */
+
+/* { dg-final { scan-tree-dump-times "goto" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-1.c
new file mode 100644
index 000000000..b959fa17b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-1.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/19899 */
+/* Decrementing a floating-point variable in a loop caused an ICE. */
+
+/* { dg-do run } */
+/* { dg-options "-O -ftree-vectorize" } */
+
+extern void abort (void);
+
+int main()
+{
+ float i=1;
+
+ while (i>=0)
+ --i;
+
+ if (i != -1)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-2.c
new file mode 100644
index 000000000..0cac99475
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-2.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/19899 */
+/* Decrementing a floating-point variable in a loop caused an ICE. */
+
+/* { dg-do run } */
+/* { dg-options "-O -ftree-vectorize" } */
+
+extern void abort (void);
+
+int main()
+{
+ double a = 20;
+ int i;
+
+ for (i = 0; i < 10; ++i)
+ a -= 2;
+
+ if (a)
+ abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c
new file mode 100644
index 000000000..5cac1cefb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int *a_p;
+int a[1000];
+
+f(int k)
+{
+ int i;
+
+ for (i=k; i<1000; i+=k) {
+ a_p = &a[i];
+ *a_p = 100;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "&a" 1 "optimized" { xfail { lp64 || llp64 } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c
new file mode 100644
index 000000000..5f15d622d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+typedef struct {
+ int x;
+ int y;
+} S;
+
+int *a_p;
+S a[1000];
+
+f(int k)
+{
+ int i;
+
+ for (i=k; i<1000; i+=k) {
+ a_p = &a[i].y;
+ *a_p = 100;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "&a" 1 "optimized" { xfail { lp64 || llp64 } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c
new file mode 100644
index 000000000..b9de36a47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int *a_p;
+int a[1000];
+
+f(int k)
+{
+ long long i;
+
+ for (i=k; i<1000; i+=k) {
+ a_p = &a[i];
+ *a_p = 100;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "&a" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-6.c
new file mode 100644
index 000000000..3b02374a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-6.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int main()
+{
+ int i;
+ signed char result = 0;
+ for (i = 0; i != 8000; ++i)
+ {
+ int tem = result;
+ tem = tem + 2;
+ result = tem;
+ }
+ if (__builtin_abs ((int)(signed char)((unsigned char ) result + 128)) != 0)
+ __builtin_abort ();
+ return 0;
+}
+
+/* SCEV constant propagation should be able to compute the overall effect
+ of the loop. */
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-7.c
new file mode 100644
index 000000000..d6ceb2082
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-7.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sccp-scev" } */
+
+struct struct_t
+{
+ int* data;
+};
+
+void foo (struct struct_t* sp, int start, int end)
+{
+ int i;
+
+ for (i = 1000; i+start > end; i--)
+ sp->data[i+start] = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Simplify PEELED_CHREC into POLYNOMIAL_CHREC" 1 "sccp" } } */
+/* { dg-final { cleanup-tree-dump "sccp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c
new file mode 100644
index 000000000..ff645fac2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/scev-cast.c
@@ -0,0 +1,28 @@
+/* A test for various conversions of chrecs. */
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void blas (signed char xxx);
+void blau (unsigned char xxx);
+
+void tst(void)
+{
+ unsigned i;
+
+ for (i = 0; i < 129; i++) /* This truncation to char has to be preserved. */
+ blas ((signed char) i);
+ for (i = 0; i < 128; i++) /* This one is not necessary, VRP eliminates it. */
+ blas ((signed char) i);
+ for (i = 0; i < 127; i++) /* This one is not necessary, IVOPTS eliminates it. */
+ blas ((signed char) i);
+ for (i = 0; i < 256; i++) /* This one is not necessary, VRP eliminates it. */
+ blau ((unsigned char) i);
+ for (i = 0; i < 257; i++) /* This one is necessary. */
+ blau ((unsigned char) i);
+}
+
+/* { dg-final { scan-tree-dump-times "& 255" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= \\(signed char\\)" 1 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-1.c
new file mode 100644
index 000000000..e8c0ff021
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+extern void foo (int);
+
+void
+f (int *p, unsigned int n)
+{
+ foo (*(p + n * 4));
+ foo (*(p + 32 + n * 4));
+ if (n > 3)
+ foo (*(p + 16 + n * 4));
+ else
+ foo (*(p + 48 + n * 4));
+}
+
+/* { dg-final { scan-tree-dump-times "\\+ 128|\\, 128>" 1 "optimized" { target { int32plus } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 64|\\, 64>" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 32|\\, 32>" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 192|\\, 192>" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 96|\\, 96>" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-10.c
new file mode 100644
index 000000000..f131dae3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-10.c
@@ -0,0 +1,23 @@
+/* Verify straight-line strength reduction for simple integer addition
+ with stride reversed on 1st and 3rd instances. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = 2 * s;
+ x1 = a1 + c;
+ a2 = 4 * s;
+ x2 = c + a2;
+ a3 = 6 * s;
+ x3 = a3 + c;
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-11.c
new file mode 100644
index 000000000..6f77d5185
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-11.c
@@ -0,0 +1,24 @@
+/* Verify straight-line strength reduction for simple integer addition
+ with casts thrown in. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+long
+f (int s, long c)
+{
+ int a1, a2, a3;
+ long x1, x2, x3, x;
+
+ a1 = 2 * s;
+ x1 = c + a1;
+ a2 = 4 * s;
+ x2 = c + a2;
+ a3 = 6 * s;
+ x3 = c + a3;
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-12.c
new file mode 100644
index 000000000..558b3594e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-12.c
@@ -0,0 +1,30 @@
+/* Verify that no straight-line strength reduction occurs across sibling
+ blocks. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ if (c > 0)
+ {
+ a1 = 2 * s;
+ x1 = c + a1;
+ }
+ else
+ {
+ a1 = 4 * s;
+ x1 = c + a1;
+ }
+
+ a2 = 6 * s;
+ x2 = c + a2;
+ x = x1 + x2;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 3 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-13.c
new file mode 100644
index 000000000..5cdfb9d37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-13.c
@@ -0,0 +1,25 @@
+/* x2 and x3 will be strength-reduced based on the same statement
+ but with different variables as the stride. Note that they will
+ be strength-reduced by introducing an initializer 4*s which is
+ cheaper than 5*s; similar for 4*c and 5*c. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c)
+{
+ int a2, a3, x1, x2, x3, x;
+
+ x1 = c + s;
+ a2 = 5 * s;
+ x2 = c + a2;
+ a3 = 5 * c;
+ x3 = s + a3;
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* 4" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 5" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-14.c
new file mode 100644
index 000000000..194134549
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-14.c
@@ -0,0 +1,32 @@
+/* Straight-line strength reduction control flow variation. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int c, int s)
+{
+ int a1, a2, x, x1, x2, x3, x4;
+
+ a1 = 2 * s;
+
+ if (n > 64)
+ {
+ x1 = c + a1;
+ a2 = 4 * s;
+ x2 = c + a2;
+ x = x1 + x2;
+ }
+ else
+ {
+ x3 = c + a1;
+ a2 = 4 * s;
+ x4 = c + a2;
+ x = x4 / x3;
+ }
+
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-15.c
new file mode 100644
index 000000000..98d2df870
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-15.c
@@ -0,0 +1,27 @@
+/* Straight-line strength reduction control flow variation. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int c, int s)
+{
+ int a, x1, x2, x3;
+
+ x1 = x2 = x3 = c;
+
+ if (n > 64)
+ {
+ a = 2 * s;
+ x1 = c + a;
+ a = 4 * s;
+ x2 = c + a;
+ a = 6 * s;
+ x3 = c + a;
+ }
+
+ return x1 + x2 + x3;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-16.c
new file mode 100644
index 000000000..5fe0175cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-16.c
@@ -0,0 +1,28 @@
+/* Straight-line strength reduction control flow variation. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int c, int s)
+{
+ int a2, a3, a4, x1, x2, x3, x4;
+
+ x1 = c + s;
+ a2 = 3 * s;
+ x2 = c + a2;
+ x3 = x4 = c;
+
+ if (n > 64)
+ {
+ a3 = 5 * s;
+ x3 = c + a3;
+ a4 = 7 * s;
+ x4 = c + a4;
+ }
+
+ return x1 + x2 + x3 + x4;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-17.c
new file mode 100644
index 000000000..3da203c20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-17.c
@@ -0,0 +1,31 @@
+/* Straight-line strength reduction control flow variation with incr = 1. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int c, int s)
+{
+ int a2, a3, a4, x1, x2, x3, x4;
+
+ x1 = c + s;
+ x2 = x3 = x4 = c;
+
+ if (n > 64)
+ {
+ a2 = 2 * s;
+ x2 = c + a2;
+ a3 = 3 * s;
+ x3 = c + a3;
+ }
+ else
+ {
+ a4 = 2 * s;
+ x4 = c + a4;
+ }
+
+ return x1 + x2 + x3 + x4;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-18.c
new file mode 100644
index 000000000..b8d368ea4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-18.c
@@ -0,0 +1,32 @@
+/* Straight-line strength reduction control flow variation with incr = -1. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int c, int s)
+{
+ int a1, a2, a3, a4, x1, x2, x3, x4;
+
+ a1 = 4 * s;
+ x1 = c + a1;
+ x2 = x3 = x4 = c;
+
+ if (n > 64)
+ {
+ a2 = 3 * s;
+ x2 = c + a2;
+ a3 = 2 * s;
+ x3 = c + a3;
+ }
+ else
+ {
+ a4 = 3 * s;
+ x4 = c + a4;
+ }
+
+ return x1 + x2 + x3 + x4;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-19.c
new file mode 100644
index 000000000..c92730f40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-19.c
@@ -0,0 +1,22 @@
+/* Verify straight-line strength reduction for multiply candidates
+ with stride in RHS1 position. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int c, int s)
+{
+ int x1, x2, y1, y2;
+
+ y1 = c + 2;
+ x1 = s * y1;
+ y2 = y1 + 2;
+ x2 = s * y2;
+ return x1 + x2;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* y" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-2.c
new file mode 100644
index 000000000..56697ff7f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+extern void foo (int);
+
+void
+f (int *p, int n)
+{
+ foo (*(p + n++ * 4));
+ foo (*(p + 32 + n++ * 4));
+ foo (*(p + 16 + n * 4));
+}
+
+/* { dg-final { scan-tree-dump-times "\\+ 144|\\, 144>" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 72|\\, 72>" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 96|\\, 96>" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 48|\\, 48>" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-20.c
new file mode 100644
index 000000000..cf3e1b3a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-20.c
@@ -0,0 +1,21 @@
+/* Verify straight-line strength reduction for multiply candidates
+ with stride in inconsistent positions. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int c, int s)
+{
+ int x1, x2, y1, y2;
+
+ y1 = c + 2;
+ x1 = y1 * s;
+ y2 = y1 + 2;
+ x2 = s * y2;
+ return x1 + x2;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* s" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-21.c
new file mode 100644
index 000000000..c32afb2aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-21.c
@@ -0,0 +1,32 @@
+/* Verify straight-line strength reduction for multiply candidates
+ with variable stride and control flow. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int x, int stride)
+{
+ int a, x1, x2, x3;
+
+ a = x * stride;
+
+ if (n > 64)
+ {
+ x1 = x + 3;
+ a += x1 * stride;
+ x2 = x1 + 3;
+ a += x2 * stride;
+ }
+ else
+ {
+ x3 = x + 3;
+ a += x3 * stride;
+ }
+
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* stride" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 3" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-22.c
new file mode 100644
index 000000000..6e56d9bb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-22.c
@@ -0,0 +1,29 @@
+/* Verify straight-line strength reduction for multiply candidates
+ with variable stride and control flow. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int x, int stride)
+{
+ int a, x1, x2, x3;
+
+ a = x * stride;
+
+ if (n > 64)
+ {
+ x1 = x + 3;
+ a += x1 * stride;
+ x2 = x1 + 3;
+ a += x2 * stride;
+ x3 = x2 + 3;
+ a += x3 * stride;
+ }
+
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* stride" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 3" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-23.c
new file mode 100644
index 000000000..88bd087de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-23.c
@@ -0,0 +1,29 @@
+/* Verify straight-line strength reduction for multiply candidates
+ with variable stride and control flow. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int x, int stride)
+{
+ int a, x1, x2, x3;
+
+ a = x * stride;
+ x1 = x + 3;
+ a += x1 * stride;
+
+ if (n > 64)
+ {
+ x2 = x1 + 3;
+ a += x2 * stride;
+ x3 = x2 + 3;
+ a += x3 * stride;
+ }
+
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* stride" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 3" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-24.c
new file mode 100644
index 000000000..04e093be5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-24.c
@@ -0,0 +1,31 @@
+/* Verify straight-line strength reduction for multiply candidates
+ with variable stride and control flow, increment = 1. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int x, int stride)
+{
+ int a, x1, x2, x3;
+
+ a = x * stride;
+
+ if (n > 64)
+ {
+ x1 = x + 1;
+ a += x1 * stride;
+ x2 = x1 + 1;
+ a += x2 * stride;
+ }
+ else
+ {
+ x3 = x + 1;
+ a += x3 * stride;
+ }
+
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-25.c
new file mode 100644
index 000000000..9e16e0476
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-25.c
@@ -0,0 +1,31 @@
+/* Verify straight-line strength reduction for multiply candidates
+ with variable stride and control flow, increment = -1. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int x, int stride)
+{
+ int a, x1, x2, x3;
+
+ a = x * stride;
+
+ if (n > 64)
+ {
+ x1 = x - 1;
+ a += x1 * stride;
+ x2 = x1 - 1;
+ a += x2 * stride;
+ }
+ else
+ {
+ x3 = x - 1;
+ a += x3 * stride;
+ }
+
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-26.c
new file mode 100644
index 000000000..c333e00bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-26.c
@@ -0,0 +1,32 @@
+/* Verify straight-line strength reduction for multiply candidates
+ with variable stride and control flow, increment = -3. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int n, int x, int stride)
+{
+ int a, x1, x2, x3;
+
+ a = x * stride;
+
+ if (n > 64)
+ {
+ x1 = x - 3;
+ a += x1 * stride;
+ x2 = x1 - 3;
+ a += x2 * stride;
+ }
+ else
+ {
+ x3 = x - 3;
+ a += x3 * stride;
+ }
+
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* stride" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 3" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-27.c
new file mode 100644
index 000000000..c6642627d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-27.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
+
+struct x
+{
+ int a[16];
+ int b[16];
+ int c[16];
+};
+
+extern void foo (int, int, int);
+
+void
+f (struct x *p, unsigned int n)
+{
+ foo (p->a[n], p->c[n], p->b[n]);
+}
+
+/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom2" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+;" 1 "dom2" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 3 "dom2" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-28.c
new file mode 100644
index 000000000..c4dbf54db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-28.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
+
+struct x
+{
+ int a[16];
+ int b[16];
+ int c[16];
+};
+
+extern void foo (int, int, int);
+
+void
+f (struct x *p, unsigned int n)
+{
+ foo (p->a[n], p->c[n], p->b[n]);
+ if (n > 12)
+ foo (p->a[n], p->c[n], p->b[n]);
+ else if (n > 3)
+ foo (p->b[n], p->a[n], p->c[n]);
+}
+
+/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom2" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+" 1 "dom2" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom2" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-29.c
new file mode 100644
index 000000000..c8e7a5e13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-29.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom2" } */
+
+struct x
+{
+ int a[16];
+ int b[16];
+ int c[16];
+};
+
+extern void foo (int, int, int);
+
+void
+f (struct x *p, unsigned int n)
+{
+ foo (p->a[n], p->c[n], p->b[n]);
+ if (n > 3)
+ {
+ foo (p->a[n], p->c[n], p->b[n]);
+ if (n > 12)
+ foo (p->b[n], p->a[n], p->c[n]);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "\\* 4;" 1 "dom2" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\* 2;" 1 "dom2" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "p_\\d\+\\(D\\) \\+ \[^\r\n\]*_\\d\+" 1 "dom2" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\(struct x \\*\\)\[^\r\n\]*_\\d\+" 9 "dom2" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-3.c
new file mode 100644
index 000000000..89d1d2e73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-3.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+foo (int a[], int b[], int i)
+{
+ a[i] = b[i] + 2;
+ i++;
+ a[i] = b[i] + 2;
+ i++;
+ a[i] = b[i] + 2;
+ i++;
+ a[i] = b[i] + 2;
+ i++;
+ return i;
+}
+
+/* { dg-final { scan-tree-dump-times "\\* 4" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { scan-tree-dump-times "\\* 2" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 2|\\, 2>" 5 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 4|\\, 4>" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 8|\\, 8>" 1 "optimized" { target { int32plus } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 6|\\, 6>" 1 "optimized" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump-times "\\+ 12|\\, 12>" 1 "optimized" { target { int32 } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c
new file mode 100644
index 000000000..5fea3d3db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c
@@ -0,0 +1,24 @@
+/* Verify straight-line strength reduction fails for simple integer addition
+ with casts thrown in when -fwrapv is used. */
+
+/* { dg-do compile { target { long_neq_int } } } */
+/* { dg-options "-O3 -fdump-tree-dom2 -fwrapv" } */
+
+long
+f (int s, long c)
+{
+ int a1, a2, a3;
+ long x1, x2, x3, x;
+
+ a1 = 2 * s;
+ x1 = c + a1;
+ a2 = 4 * s;
+ x2 = c + a2;
+ a3 = 6 * s;
+ x3 = c + a3;
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 3 "dom2" } } */
+/* { dg-final { cleanup-tree-dump "dom2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-31.c
new file mode 100644
index 000000000..edf31294a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-31.c
@@ -0,0 +1,27 @@
+/* Verify straight-line strength reduction for add candidates in
+ which the stride is unknown and increments appear that differ
+ only in sign. Verify the increments are shared. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c)
+{
+ int a1, a2, a3, a4, x1, x2, x3, x4, x;
+
+ a1 = 2 * s;
+ x1 = c + a1;
+ a2 = 4 * s; /* incr = +2 */
+ x2 = c + a2;
+ a3 = 7 * s;
+ x3 = c + a3;
+ a4 = 5 * s; /* incr = -2 */
+ x4 = c + a4;
+ x = x1 + x2 + x3 + x4;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* -2" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c
new file mode 100644
index 000000000..73e679743
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c
@@ -0,0 +1,32 @@
+/* Verify straight-line strength reduction for a candidate with a basis
+ hidden by a phi dependence and having an unknown stride. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c, int i)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = i * s;
+ x1 = c + a1;
+
+ i = i + 2;
+ a2 = i * s;
+ x2 = c + a2;
+
+ if (x2 > 6)
+ i = i + 2;
+
+ i = i + 2;
+ a3 = i * s;
+ x3 = c + a3;
+
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* s" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c
new file mode 100644
index 000000000..5cd427657
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c
@@ -0,0 +1,31 @@
+/* Verify straight-line strength reduction for a candidate with a basis
+ hidden by a phi dependence and having a known stride. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int c, int i)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = i * 16;
+ x1 = c + a1;
+
+ i = i + 2;
+ a2 = i * 16;
+ x2 = c + a2;
+
+ if (x2 > 6)
+ i = i + 2;
+
+ i = i + 2;
+ a3 = i * 16;
+ x3 = c + a3;
+
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c
new file mode 100644
index 000000000..3593f869b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c
@@ -0,0 +1,43 @@
+/* Verify straight-line strength reduction for a candidate with a basis
+ hidden by two phi dependences, and having a known stride. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+extern void
+g (void);
+
+int
+f (int c, int i)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = i * 16;
+ x1 = c + a1;
+
+ i = i + 2;
+ a2 = i * 16;
+ x2 = c + a2;
+
+ if (x2 > 6)
+ {
+ if (c < 200)
+ i = i + 2;
+ else
+ i = i + 4;
+ g ();
+ }
+ else
+ i = i + 6;
+
+ i = i + 2;
+ a3 = i * 16;
+ x3 = c + a3;
+
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "PHI" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c
new file mode 100644
index 000000000..3f4d13617
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c
@@ -0,0 +1,28 @@
+/* Verify straight-line strength reduction for a candidate with a basis
+ hidden by a phi dependences, having a known stride, and where the
+ phi has an argument which is a parameter. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int c, int i)
+{
+ int a1, a3, x1, x3, x;
+
+ a1 = i * 16;
+ x1 = c + a1;
+
+ if (x1 > 6)
+ i = i + 2;
+
+ i = i + 2;
+ a3 = i * 16;
+ x3 = c + a3;
+
+ x = x1 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c
new file mode 100644
index 000000000..8cb09e0cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c
@@ -0,0 +1,29 @@
+/* Verify straight-line strength reduction for a candidate with a basis
+ hidden by a phi dependences, having an unknown stride, and where the
+ phi has an argument which is a parameter. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c, int i)
+{
+ int a1, a3, x1, x3, x;
+
+ a1 = i * s;
+ x1 = c + a1;
+
+ if (x1 > 6)
+ i = i + 2;
+
+ i = i + 2;
+ a3 = i * s;
+ x3 = c + a3;
+
+ x = x1 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* s" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c
new file mode 100644
index 000000000..fb13b20e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c
@@ -0,0 +1,33 @@
+/* Verify straight-line strength reduction for a candidate with a basis
+ hidden by a phi dependence and having an unknown stride. Variation
+ using negative increments. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c, int i)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = i * s;
+ x1 = c + a1;
+
+ i = i - 2;
+ a2 = i * s;
+ x2 = c + a2;
+
+ if (x2 > 6)
+ i = i - 2;
+
+ i = i - 2;
+ a3 = i * s;
+ x3 = c + a3;
+
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* s" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c
new file mode 100644
index 000000000..1a0ab79bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c
@@ -0,0 +1,32 @@
+/* Verify straight-line strength reduction for a candidate with a basis
+ hidden by a phi dependence and having a known stride. Variation using
+ negative increments. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int c, int i)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = i * 16;
+ x1 = c + a1;
+
+ i = i - 2;
+ a2 = i * 16;
+ x2 = c + a2;
+
+ if (x2 > 6)
+ i = i - 2;
+
+ i = i - 2;
+ a3 = i * 16;
+ x3 = c + a3;
+
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-39.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-39.c
new file mode 100644
index 000000000..c1462195c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-39.c
@@ -0,0 +1,26 @@
+/* Verify straight-line strength reduction for back-tracing
+ CAND_ADD for T2 in:
+
+ *PBASE: T1
+ *POFFSET: MULT_EXPR (T2, C3)
+ *PINDEX: C1 + (C2 * C3) + C4 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-slsr-details" } */
+
+typedef int arr_2[50][50];
+
+void foo (arr_2 a2, int v1)
+{
+ int i, j;
+
+ i = v1 + 5;
+ j = i;
+ a2 [i] [j++] = i;
+ a2 [i] [j++] = i;
+ a2 [i] [i-1] += 1;
+ return;
+}
+
+/* { dg-final { scan-tree-dump-times "Replacing reference: " 4 "slsr" } } */
+/* { dg-final { cleanup-tree-dump "slsr" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-4.c
new file mode 100644
index 000000000..413a1cc27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-4.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-slsr -fdump-tree-optimized" } */
+
+void foo (int);
+
+int
+f (int i)
+{
+ int x, y;
+
+ x = i * 4;
+ y = x * 10;
+ foo (y);
+
+ i = i + 5;
+ x = i * 4;
+ y = x * 10;
+ foo (y);
+
+ i = i - 4;
+ x = i * 4;
+ y = x * 10;
+ foo (y);
+}
+
+/* { dg-final { scan-tree-dump-times "\\* 4" 1 "slsr" } } */
+/* { dg-final { scan-tree-dump-times "\\* 10" 1 "slsr" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 20;" 1 "slsr" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 200" 1 "slsr" } } */
+/* { dg-final { scan-tree-dump-times "\\- 16;" 1 "slsr" } } */
+/* { dg-final { scan-tree-dump-times "\\- 160" 1 "slsr" } } */
+/* { dg-final { scan-tree-dump-times "\\* 4" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\* 10" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 200" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\\+ 40" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "slsr" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-40.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-40.c
new file mode 100644
index 000000000..72726a3aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-40.c
@@ -0,0 +1,27 @@
+/* Verify straight-line strength reduction for array
+ subscripting.
+
+ elems[n-1] is reduced to elems + n * 4 + 0xffffffff * 4, only when
+ pointers are of the same size as that of int (assuming 4 bytes). */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+struct data
+{
+ unsigned long elms[1];
+} gData;
+
+void __attribute__((noinline))
+foo (struct data *dst, unsigned int n)
+{
+ dst->elms[n - 1] &= 1;
+}
+
+int
+main ()
+{
+ foo (&gData, 1);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-41.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-41.c
new file mode 100644
index 000000000..2c9d90880
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-41.c
@@ -0,0 +1,24 @@
+/* Verify straight-line strength reduction in using
+ alternative base expr to record and look for the
+ potential candidate. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-slsr-details" } */
+
+typedef int arr_2[50][50];
+
+void foo (arr_2 a2, int v1)
+{
+ int i, j;
+
+ i = v1 + 5;
+ j = i;
+ a2 [i-10] [j] = 2;
+ a2 [i] [j++] = i;
+ a2 [i+20] [j++] = i;
+ a2 [i-3] [i-1] += 1;
+ return;
+}
+
+/* { dg-final { scan-tree-dump-times "Replacing reference: " 5 "slsr" } } */
+/* { dg-final { cleanup-tree-dump "slsr" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-5.c
new file mode 100644
index 000000000..8612febc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-5.c
@@ -0,0 +1,22 @@
+/* Verify straight-line strength reduction for simple add candidates. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = 2 * s;
+ x1 = c + a1;
+ a2 = 4 * s;
+ x2 = c + a2;
+ a3 = 6 * s;
+ x3 = c + a3;
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-6.c
new file mode 100644
index 000000000..56b167731
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-6.c
@@ -0,0 +1,25 @@
+/* Verify straight-line strength reduction for simple add candidates,
+ pointer version. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+void
+f (int s, char *c, char *x1, char *x2, char *x3)
+{
+ int a1, a2, a3;
+
+ a1 = 2 * s;
+ x1 = c + a1;
+ *x1 = 1;
+ a2 = 4 * s;
+ x2 = c + a2;
+ *x2 = 2;
+ a3 = 6 * s;
+ x3 = c + a3;
+ *x3 = 3;
+}
+
+/* There will be four ' * ' instances for the parms, one in the code. */
+/* { dg-final { scan-tree-dump-times " \\* " 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-7.c
new file mode 100644
index 000000000..ace755f07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-7.c
@@ -0,0 +1,22 @@
+/* Verify straight-line strength reduction for simple integer subtraction. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = 2 * s;
+ x1 = c - a1;
+ a2 = 4 * s;
+ x2 = c - a2;
+ a3 = 6 * s;
+ x3 = c - a3;
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-8.c
new file mode 100644
index 000000000..e78e9c004
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-8.c
@@ -0,0 +1,24 @@
+/* Verify straight-line strength reduction for simple pointer subtraction. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int*
+f (int s, int *c)
+{
+ int a1, a2, a3, *x1, *x2, *x3;
+
+ a1 = 2 * s;
+ x1 = c - a1;
+ a2 = 4 * s;
+ x2 = c - a2;
+ a3 = 6 * s;
+ x3 = c - a3;
+ return x1 ? x2 : x3;
+}
+
+/* There are 4 ' * ' instances in the decls (since "int * iftmp.0;" is
+ added), 1 parm, 2 in the code. The second one in the code can be
+ a widening mult. */
+/* { dg-final { scan-tree-dump-times " w?\\* " 7 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-9.c
new file mode 100644
index 000000000..3a388731e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/slsr-9.c
@@ -0,0 +1,23 @@
+/* Verify straight-line strength reduction for simple integer addition
+ with stride reversed. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+int
+f (int s, int c)
+{
+ int a1, a2, a3, x1, x2, x3, x;
+
+ a1 = 2 * s;
+ x1 = a1 + c;
+ a2 = 4 * s;
+ x2 = a2 + c;
+ a3 = 6 * s;
+ x3 = a3 + c;
+ x = x1 + x2 + x3;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-1.c
new file mode 100644
index 000000000..e5af24751
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-1.c
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+/* Tests for SRA. */
+
+typedef struct teststruct
+{
+ double d;
+ char f1;
+} teststruct;
+
+void
+copystruct1 (teststruct param)
+{
+ teststruct local;
+ param.f1 = 0;
+ local = param;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+void
+copystruct11 (teststruct *param)
+{
+ teststruct local;
+ param->f1 = 0;
+ local = *param;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+void
+copystruct111 (teststruct param)
+{
+ teststruct *local = &param;
+ param.f1 = 0;
+ if (local->f1 != 0)
+ link_error ();
+}
+
+teststruct globf;
+void
+copystruct1111 (void)
+{
+ teststruct local;
+ globf.f1 = 0;
+ local = globf;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+void
+copystruct11111 (void)
+{
+ teststruct *local = &globf;
+ globf.f1 = 0;
+ if (local->f1 != 0)
+ link_error ();
+}
+
+void
+copystruct111111 (teststruct param)
+{
+ static teststruct local;
+ param.f1 = 0;
+ local = param;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+/* There should be no referenc to link_error. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-10.c
new file mode 100644
index 000000000..49bfa31fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-10.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+struct S
+{
+ int a[1];
+ int z[256];
+};
+
+void foo (struct S *s, int i)
+{
+ struct S disappear;
+
+ disappear.a[i] = 12;
+ *s = disappear;
+}
+
+/* { dg-final { scan-tree-dump-times "disappear" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-11.c
new file mode 100644
index 000000000..c8a90eac5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-11.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-esra-details" } */
+
+struct S
+{
+ int i;
+ int j;
+ char c[32]; /* this disables total scalarization */
+};
+
+extern struct S bar(void);
+
+int foo1 (int b)
+{
+ struct S s1;
+
+ s1 = bar ();
+ return s1.i;
+}
+
+extern struct S *g;
+
+int foo2 (void)
+{
+ struct S s2;
+
+ s2 = *g;
+ return s2.i;
+}
+
+/* { dg-final { scan-tree-dump-times "Created a replacement for s1" 0 "esra"} } */
+/* { dg-final { scan-tree-dump-times "Created a replacement for s2" 1 "esra"} } */
+/* { dg-final { cleanup-tree-dump "esra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-12.c
new file mode 100644
index 000000000..59e5e6af6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-12.c
@@ -0,0 +1,25 @@
+/* Verify that SRA total scalarization will not be confused by padding. */
+/* Test skipped for targets with small (often default) MOVE_RATIO. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-release_ssa" } */
+
+struct S
+{
+ int i;
+ unsigned short f1;
+ char f2;
+ unsigned short f3, f4;
+};
+
+
+int foo (struct S *p)
+{
+ struct S l;
+
+ l = *p;
+ l.i++;
+ *p = l;
+}
+
+/* { dg-final { scan-tree-dump-times "l;" 0 "release_ssa" { target { ! "avr*-*-* nds32*-*-*" } } } } */
+/* { dg-final { cleanup-tree-dump "release_ssa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c
new file mode 100644
index 000000000..d4aa47a05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c
@@ -0,0 +1,114 @@
+/* Test that SRA replacement can deal with assignments that have
+ sub-replacements on one side and a single scalar replacement on another. */
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+struct A
+{
+ int i1, i2;
+};
+
+struct B
+{
+ long long int l;
+};
+
+union U
+{
+ struct A a;
+ struct B b;
+};
+
+int b, gi;
+long gl;
+union U gu1, gu2;
+
+int __attribute__ ((noinline, noclone))
+foo (void)
+{
+ union U x, y;
+ int r;
+
+ y = gu1;
+ if (b)
+ y.b.l = gl;
+
+ x = y;
+
+ if (!b)
+ r = x.a.i1;
+ else
+ r = 0;
+
+ gu2 = x;
+ return r;
+}
+
+long long int __attribute__ ((noinline, noclone))
+bar (void)
+{
+ union U x, y;
+ int r;
+
+ y = gu1;
+ if (b)
+ y.a.i1 = gi;
+
+ x = y;
+
+ if (!b)
+ r = x.b.l;
+ else
+ r = 0;
+
+ gu2 = x;
+ return r;
+}
+
+
+int
+main (void)
+{
+ int r;
+ long long int s;
+
+ b = 0;
+ gu1.a.i1 = 123;
+ gu1.a.i2 = 234;
+ r = foo ();
+ if (r != 123)
+ __builtin_abort ();
+ if (gu2.a.i1 != 123)
+ __builtin_abort ();
+ if (gu2.a.i2 != 234)
+ __builtin_abort ();
+
+ b = 1;
+ gl = 10000001;
+ gu1.b.l = 10000000;
+ r = foo ();
+ if (r != 0)
+ __builtin_abort ();
+ if (gu2.b.l != 10000001)
+ __builtin_abort ();
+
+ b = 0;
+ gu1.b.l = 20000000;
+ s = bar ();
+ if (s != (int)20000000)
+ __builtin_abort ();
+ if (gu2.b.l != 20000000)
+ __builtin_abort ();
+
+ b = 1;
+ gi = 456;
+ gu1.a.i1 = 123;
+ gu1.a.i2 = 234;
+ s = bar ();
+ if (s != 0)
+ __builtin_abort ();
+ if (gu2.a.i1 != 456)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-2.c
new file mode 100644
index 000000000..5682b8afb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fno-tree-fre -fdump-tree-optimized" } */
+
+/* Test for SRA. */
+
+typedef struct teststruct
+{
+ double d;
+ char f1;
+} teststruct;
+
+
+void
+copystruct11 (teststruct *param)
+{
+ static teststruct local;
+ param->f1 = 0;
+ local = *param;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+
+/* There should be no reference to link_error. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-3.c
new file mode 100644
index 000000000..d89081523
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-3.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+/* Test for SRA. */
+
+typedef struct teststruct
+{
+ double d;
+ char f1;
+} teststruct;
+
+teststruct *globf1;
+
+extern void link_error (void);
+
+void
+copystruct1 (void)
+{
+ teststruct local;
+ globf1->f1 = 0;
+ local = *globf1;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+/* There should be no reference to link_error. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-4.c
new file mode 100644
index 000000000..e6ca7561f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-4.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized -w" } */
+/* { dg-options "-O1 -fdump-tree-optimized -w -msse" { target { i?86-*-* x86_64-*-* } } } */
+/* Check that SRA replaces structures containing vectors. */
+
+#define vector __attribute__((vector_size(16)))
+
+struct vt
+{
+ vector int t;
+};
+
+
+vector int f(vector int t1, vector int t2)
+{
+ struct vt st1, st2, st3;
+ st1.t = t1;
+ st2 = st1;
+ st2.t += t2;
+ st3 = st2;
+ return st3.t;
+}
+
+/* { dg-final { scan-tree-dump-times "st" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-5.c
new file mode 100644
index 000000000..869d2f55f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-5.c
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+/* Tests for SRA of unions. */
+
+
+typedef union testunion
+{
+ double d;
+ char f1;
+} testunion;
+
+void
+copyunion1 (testunion param)
+{
+ testunion local;
+ param.f1 = 0;
+ local = param;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+void
+copyunion11 (testunion *param)
+{
+ testunion local;
+ param->f1 = 0;
+ local = *param;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+void
+copyunion111 (testunion param)
+{
+ testunion *local = &param;
+ param.f1 = 0;
+ if (local->f1 != 0)
+ link_error ();
+}
+
+testunion globuf;
+void
+copyunion1111 (void)
+{
+ testunion local;
+ globuf.f1 = 0;
+ local = globuf;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+void
+copyunion11111 (void)
+{
+ testunion *local = &globuf;
+ globuf.f1 = 0;
+ if (local->f1 != 0)
+ link_error ();
+}
+
+void
+copyunion111111 (testunion param)
+{
+ static testunion local;
+ param.f1 = 0;
+ local = param;
+ if (local.f1 != 0)
+ link_error ();
+}
+
+/* There should be no reference to link_error. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-6.c
new file mode 100644
index 000000000..e59b536c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-6.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-esra-details" } */
+
+typedef struct teststruct
+{
+ double d;
+ int i1;
+ char c1;
+ float z;
+ char c2;
+ int i2;
+} teststruct;
+
+
+void cow (int i)
+{
+ teststruct a, b, c, d;
+
+ a.d = 3.2;
+ a.i1 = i;
+
+ b = a;
+ c = b;
+ d = c;
+
+ if (d.i1 != i)
+ link_error ();
+}
+
+
+/* Suaccesses of b and c should have been created. */
+/* { dg-final { scan-tree-dump "expr = b.d" "esra"} } */
+/* { dg-final { scan-tree-dump "expr = b.i1" "esra"} } */
+/* { dg-final { scan-tree-dump "expr = c.d" "esra"} } */
+/* { dg-final { scan-tree-dump "expr = c.i1" "esra"} } */
+/* { dg-final { cleanup-tree-dump "esra" } } */
+
+/* There should be no reference to link_error. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-7.c
new file mode 100644
index 000000000..325a329f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-7.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+typedef struct { char f[4]; } __attribute__((aligned (4))) s;
+
+void a(s *s1, s *s2)
+{
+ *s1 = *s2;
+}
+
+/* Struct copies should not be split into members. */
+/* { dg-final { scan-tree-dump "\\\*s1_.\\\(D\\\) = \\\*s2" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-8.c
new file mode 100644
index 000000000..d43bbe0d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-8.c
@@ -0,0 +1,35 @@
+/* A testcase for PR 40744. We do not want to create replacements for object
+ that are dead or have only a single use, whenever it can be avoided
+ simply. */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-esra-details" } */
+
+struct X { int i; int j; };
+
+void foo(void)
+{
+ struct X x;
+ x.i = 1;
+ x.j = 2;
+}
+
+
+int bar(struct X x)
+{
+ return x.i;
+}
+
+
+extern void do_something (struct X);
+
+void bar2(int i, int j)
+{
+ struct X x;
+
+ x.i = i;
+ x.j = j;
+ do_something (x);
+}
+
+/* { dg-final { scan-tree-dump-times "Created a replacement" 0 "esra"} } */
+/* { dg-final { cleanup-tree-dump "esra" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-9.c
new file mode 100644
index 000000000..54f42179e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/sra-9.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+struct S
+{
+ int a, b, c;
+ int z[20];
+};
+
+int foo (int d)
+{
+ struct S s;
+
+ s.a = d;
+ return s.a + s.b;
+}
+
+/* There should be no reference to s.b. */
+/* { dg-final { scan-tree-dump-times "= s\.b" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c
new file mode 100644
index 000000000..82f37abc8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c
@@ -0,0 +1,75 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+extern void link_error (void);
+
+/* check folding */
+
+void test1 (void)
+{
+ unsigned int l = 3 * 4 - 5 / 2;
+ if (l != 10)
+ link_error ();
+}
+
+void test11 (void)
+{
+ unsigned int l = (((((((3 / 2 + 2) * 4) & 7) ^ 3) % 8) << 2) + 1) >> 2;
+ if (l != 7)
+ link_error ();
+}
+
+/* cprop in a basic block */
+void test111 (void)
+{
+ unsigned int l0 = 3 / 2 + 2;
+ unsigned int l1 = l0 * 4;
+ unsigned int l2 = 7;
+ unsigned int l3 = l1 & l2;
+ unsigned int l4 = 3;
+ unsigned int l5 = l3 ^ l4;
+ unsigned int l6 = 8;
+ unsigned int l7 = l5 % l6;
+ unsigned int l8 = 2;
+ unsigned int l9 = l7 << l8;
+ unsigned int l10 = l9 + 1;
+ unsigned int l11 = l10 >> 2;
+ if (l11 != 7)
+ link_error ();
+}
+
+
+/* cprop after an if statement */
+void test1111 (int p)
+{
+ int l = 53;
+ if (p)
+ {
+ if ((67 + l - 25) != 95)
+ link_error ();
+ }
+ else
+ {
+ if ((93 - l + 25) != 65)
+ link_error ();
+ }
+}
+
+/* cprop after a loop */
+void test11111 (int p, int q, int r)
+{
+ int l = 53;
+ while (p < r)
+ {
+ if ((67 + l - 25) != 95)
+ link_error ();
+ p -= q;
+ }
+}
+
+
+
+/* There should be not link_error calls, if there is any the
+ optimization has failed */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-10.c
new file mode 100644
index 000000000..9eecf94e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-10.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-fab1" } */
+
+/* Check that we fold strlen of equally long strings, and that we do not
+ fail to terminate when there is a nontrivial cycle in the corresponding
+ ssa graph. */
+
+extern __SIZE_TYPE__ strlen (const char *);
+
+void foo(int i)
+{
+ char *s = "abcde";
+
+ if (i)
+ {
+ s = "defgh";
+ goto middle;
+ }
+
+start:
+
+ bla ();
+
+middle:
+
+ if (bla ())
+ goto start;
+
+ bar (strlen (s));
+}
+
+/* There should be no calls to strlen. */
+/* { dg-final { scan-tree-dump-times "strlen" 0 "fab1"} } */
+/* { dg-final { cleanup-tree-dump "fab1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-11.c
new file mode 100644
index 000000000..4eaad28b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-11.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+/* Test for CPROP across a DAG. */
+
+int test111 (int param)
+{
+ int a, b, c;
+ if (param) {
+ a = 3;
+ b = 2;
+ }
+ else {
+ a = 2;
+ b = 3;
+ }
+ c = a + b;
+ if (c != 5)
+ return 2;
+ return 0;
+}
+
+int test1111 (int param)
+{
+ _Bool a, b, c;
+ if (param) {
+ a = 1;
+ b = 0;
+ }
+ else {
+ a = 0;
+ b = 1;
+ }
+ c = a && b;
+ if (c)
+ return 2;
+ return 0;
+}
+
+/* All ifs should be eliminated. */
+/* { dg-final { scan-tree-dump-times "if " 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-12.c
new file mode 100644
index 000000000..8ee9eb8d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-12.c
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+struct A
+{
+ int a;
+ int b;
+};
+
+struct A a;
+const int B = 42;
+
+void foo (int i)
+{
+ if (i > 10)
+ a.a = 42;
+ else
+ {
+ a.b = 21;
+ a.a = a.b + 21;
+ }
+
+ /* This should be folded to 'if (0)' as a.a and B are both 42. */
+ if (a.a != B)
+ link_error ();
+}
+
+main ()
+{
+ foo (3);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-13.c
new file mode 100644
index 000000000..d35adee51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-13.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static const char f[3] = "?";
+
+int foo()
+{
+ int i = 0;
+ return f[i] != '?';
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c
new file mode 100644
index 000000000..3be025f07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/29738. We used not to realize that "i" can never
+ become nonzero. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int i;
+
+void foo (void);
+void bar (void)
+{
+ int j;
+ i = 0;
+ for (j = 0; j < 10000; j++)
+ if (i)
+ foo ();
+}
+
+/* Everything except for the "i = 0" assignment should get removed. */
+/* { dg-final { scan-tree-dump-times "if" 0 "optimized" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-15.c
new file mode 100644
index 000000000..aaf57126a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-15.c
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+/* Check that the initial values are honored when necessary. */
+
+void link_error (void);
+
+/* The call to link_error cannot be eliminated in this case. */
+
+void test1 (int param1, int param2, int x)
+{
+ if (param1)
+ x = 3;
+
+ if (param2)
+ if (x != 3)
+ link_error ();
+}
+
+/* The call to link_error cannot be eliminated in this case. */
+
+int global;
+void test2 (int param1, int param2)
+{
+ if (param1)
+ global = 3;
+
+ if (param2)
+ if (global != 3)
+ link_error ();
+}
+
+/* In this case, we can eliminate the call, as unless "local" is set
+ to 3, its value is undefined. */
+
+void test3 (int param1, int param2)
+{
+ int local;
+
+ if (param1)
+ local = 3;
+
+ if (param2)
+ if (local != 3)
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-times "link_error" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-16.c
new file mode 100644
index 000000000..33f9744d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-16.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+static const int x;
+
+int test1 (void)
+{
+ char *p = "hello";
+ int i = x;
+ i = i + 5;
+ return p[i];
+}
+
+int test2 (void)
+{
+ int i = x;
+ i = i + 5;
+ return "hello"[i];
+}
+
+/* { dg-final { scan-tree-dump-times "return 0;" 2 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c
new file mode 100644
index 000000000..338d8a862
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+int foo(void)
+{
+ int i = 0;
+ char *p = (char *)&i;
+ return *(int *)p;
+}
+
+struct Foo {
+ int i;
+} f;
+
+int bar(void)
+{
+ char *p = (char *)&f;
+ return ((struct Foo *)p)->i;
+}
+
+extern const struct Foo g;
+
+int foobar(void)
+{
+ struct Foo *p = (struct Foo *)&g;
+ return ((const struct Foo *)p)->i;
+}
+
+/* { dg-final { scan-tree-dump "= i_.;" "ccp1" } } */
+/* { dg-final { scan-tree-dump "= f.i;" "ccp1" } } */
+/* { dg-final { scan-tree-dump "= g.i;" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-18.c
new file mode 100644
index 000000000..cbe12598b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-18.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+/* Check that we constant propagate &&c into the goto and remove
+ the unreachable BBs. */
+
+void a(int*); void b(int*); void c(int*); void d(int*);
+void func2(int* val)
+{
+ const void *const labels[] = { &&a, &&b, &&c, &&d };
+ goto *labels[2];
+ a: a(val);
+ b: b(val);
+ c: c(val);
+ d: d(val);
+}
+
+/* { dg-final { scan-tree-dump-not "a \\\(" "ccp1" } } */
+/* { dg-final { scan-tree-dump-not "b \\\(" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c
new file mode 100644
index 000000000..c67373f01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+struct f { int i; };
+int g()
+{
+ struct f a, *a1;
+ int *i;
+ a.i = 1;
+ a1 = &a;
+ i = &a1->i;
+ return *i; /* This should be turned into a.i */
+}
+
+/* { dg-final { scan-tree-dump "= MEM\\\[\\\(int \\\*\\\)&a\\\];" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c
new file mode 100644
index 000000000..19975a392
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c
@@ -0,0 +1,172 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+
+/* check that cprop for variables of different types still works even
+ if function calls or assignments to different types of data are
+ interposed. */
+
+int test7 (int *intarr)
+{
+ extern int foo7 (int);
+ int u = 7, v1;
+ foo7 (u);
+ v1 = u;
+ if (v1 != 7)
+ link_error ();
+ return v1;
+}
+
+int test77 (int *arr)
+{
+ int u = 7, v1;
+ arr[0] = 4;
+ v1 = u;
+ if (v1 != 7)
+ link_error ();
+ return v1 + arr[0];
+}
+
+int test777 (void)
+{
+ extern int foo(int *);
+ int u = 7, v1;
+ static int sarr[10];
+ sarr[0] = 4;
+ v1 = u;
+ if (v1 != 7)
+ link_error ();
+ foo (sarr);
+ return v1 + sarr[0];
+}
+
+int garr[10];
+int test7777 (void)
+{
+ int u = 7, v1;
+ garr[0] = 4;
+ v1 = u;
+ if (v1 != 7)
+ link_error ();
+ return v1 + garr[0];
+}
+
+int test88 (int *arr)
+{
+ static int l;
+ int v1;
+ l = 8;
+ arr[0] = 4;
+ v1 = l;
+ if (v1 != 8)
+ link_error ();
+ l = foo88 (l);
+ return v1 + arr[0];
+}
+
+int test888 (void)
+{
+ static int l;
+ extern int foo(int *);
+ int v1;
+ static int sarr[10];
+ l = 8;
+ sarr[0] = 4;
+ v1 = l;
+ if (v1 != 8)
+ link_error ();
+ foo (sarr);
+ l = foo88(l);
+ return v1 + sarr[0];
+}
+
+int test8888 (void)
+{
+ static int l;
+ int v1;
+ l = 8;
+ garr[0] = 4;
+ v1 = l;
+ if (v1 != 8)
+ link_error ();
+ return v1 + garr[0];
+}
+
+
+
+/* global var */
+int g9;
+int garr9[10];
+int test9 (int *intarr)
+{
+ extern int foo9 (int) __attribute__ ((const));
+ int h, v;
+ g9 = 9;
+ h = foo9 (g9);
+ v = g9;
+ if (v != 9)
+ link_error ();
+ return g9;
+}
+
+int test99 (int *intarr)
+{
+ extern int foo9 (int) __attribute__ ((pure));
+ int h, v;
+ g9 = 9;
+ h = foo9 (g9);
+ v = g9;
+ if (v != 9)
+ link_error ();
+ return g9;
+}
+
+extern int foo99 (int);
+
+int test999 (int *arr)
+{
+ static int l;
+ int v1;
+ g9 = 9;
+ l = 4;
+ v1 = g9;
+ if (v1 != 9)
+ link_error ();
+ l = foo99 (l);
+ return v1 + l;
+}
+
+
+int test9999 (void)
+{
+ int v1;
+ static int sarr[10];
+ g9 = 9;
+ sarr[0] = 4;
+ v1 = g9;
+ if (v1 != 9)
+ link_error ();
+ foo (sarr);
+ g9 = foo99 (g9);
+ return v1 + sarr[0];
+}
+
+
+int test99999 (void)
+{
+ int v1;
+ g9 = 9;
+ garr9[0] = 4;
+ v1 = g9;
+ if (v1 != 9)
+ link_error ();
+ return v1 + garr9[0];
+}
+
+
+/* There should be not link_error calls, if there is any the
+ optimization has failed */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c
new file mode 100644
index 000000000..63febd0e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-20.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+/* Make sure CCP propagates through indirect calls. */
+
+int foo (void)
+{
+ int i = -5;
+ int (*fn)(int) = __builtin_abs;
+ int j = fn(i);
+ return j + 5;
+}
+
+/* { dg-final { scan-tree-dump "return 10;" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c
new file mode 100644
index 000000000..3f4adf434
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-21.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+struct A {
+ struct B {
+ int i;
+ } b;
+} a;
+
+int foo (void)
+{
+ struct B *p = &a.b;
+ struct A *q = (struct A *) p;
+ return q->b.i;
+}
+
+int bar (void)
+{
+ struct A *p = &a;
+ struct B *q = (struct B *) p;
+ return q->i;
+}
+
+/* The first access is through struct A, so a.b.i is fine,
+ the second access needs to preserve the original access type struct B. */
+
+/* { dg-final { scan-tree-dump-times "a.b.i" 1 "ccp1" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\\(struct B \\\*\\\)&a\\\].i" 1 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-22.c
new file mode 100644
index 000000000..01d11ecac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-22.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+/* Make sure we propagate through builtins. */
+
+int foo (unsigned b)
+{
+ unsigned t = -1;
+ int x = b <= t;
+ long l = __builtin_expect (x, 0);
+ return l;
+}
+
+/* { dg-final { scan-tree-dump "return 1;" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c
new file mode 100644
index 000000000..8b95b0c34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-23.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+/* Make sure we propagate through POINTER_PLUS_EXPRs. */
+
+struct A {
+ int i[2];
+} a;
+
+int foo (void)
+{
+ struct A *p = &a;
+ int *q = (int *)p;
+ int *x = q + 1;
+ return *x;
+}
+
+/* { dg-final { scan-tree-dump "MEM\\\[\\\(int \\\*\\\)&a \\\+ 2B\\\]" "ccp1" { target { int16 } } } } */
+/* { dg-final { scan-tree-dump "MEM\\\[\\\(int \\\*\\\)&a \\\+ 4B\\\]" "ccp1" { target { int32 } } } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-24.c
new file mode 100644
index 000000000..84f69e9d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-24.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+static const int x;
+int foo()
+{
+ const int *p = &x;
+ int y = *p;
+ return y + 1;
+}
+
+static const int x2[3] = { 1, 0, 2 };
+int bar()
+{
+ int i = 1;
+ const int *p = &x2[i];
+ int y = *p;
+ return y + 1;
+}
+
+/* { dg-final { scan-tree-dump-times "return 1;" 2 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-27.c
new file mode 100644
index 000000000..c27963454
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-27.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp1" } */
+
+#include <string.h>
+
+char c[10];
+
+void
+f1 ()
+{
+ const char *p = "123456";
+ memcpy (c, p, 6);
+}
+
+void
+f2 ()
+{
+ const char *p = "12345678";
+ p += 2;
+ memcpy (c, p, 6);
+}
+
+/* { dg-final { scan-tree-dump-times "memcpy\[^\n\]*123456" 2 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-28.c
new file mode 100644
index 000000000..f5dbe70b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-28.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+extern void abort (void);
+
+static int g[1];
+
+static int * const p = &g[0];
+static int * const q = &g[0];
+
+int main(void)
+{
+ g[0] = 1;
+ *p = 0;
+ *p = *q;
+ if (g[0] != 0)
+ abort ();
+ return 0;
+}
+
+/* We should have replaced all loads from p and q with the constant
+ initial value. */
+
+/* { dg-final { scan-tree-dump-times "= p;" 0 "ccp1" } } */
+/* { dg-final { scan-tree-dump-times "= q;" 0 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-29.c
new file mode 100644
index 000000000..44d2945a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-29.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp2" } */
+
+static double num;
+int foo (void)
+{
+ return *(unsigned *)&num;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "ccp2" } } */
+/* { dg-final { cleanup-tree-dump "ccp2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c
new file mode 100644
index 000000000..86a706b80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c
@@ -0,0 +1,137 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp2" } */
+
+extern void link_error (void);
+
+/* Some addresses clearly cannot be equal, check that some address
+ expressions can be evaluated as constants.
+ Most of the tests are folding tests, but at least some require
+ points-to analysis, so we scan the first CCP dump after PTA. */
+
+char g1, g2;
+void test6 (char p1, char p2)
+{
+ char l1 = 1, l2 = 2;
+ static char s1 = 5, s2 = 7;
+ if (&l1 == &l2)
+ link_error ();
+
+ if (&p1 == &p2)
+ link_error ();
+
+ if (&s1 == &s2)
+ link_error ();
+
+ if (&g1 == &g2)
+ link_error ();
+
+ if (&p1 == &l1)
+ link_error ();
+
+ if (&p1 == &s1)
+ link_error ();
+
+ if (&p1 == &l2)
+ link_error ();
+
+ if (&p1 == &g1)
+ link_error ();
+
+ if (&l1 == &g1)
+ link_error ();
+
+ if (&s1 == &g1)
+ link_error ();
+}
+
+extern void *alloc (int) __attribute__ ((malloc));
+char gca1[128];
+char* __restrict__ rgc1;
+char* test66 (char * __restrict__ rp1, char * __restrict__ rp2, char *p1)
+{
+ char * __restrict__ rl1 = p1;
+ char * l1 = (char*) alloc (20);
+
+ if (l1 == rgc1)
+ link_error ();
+
+ if (l1 == rp1)
+ link_error ();
+
+ if (l1 == rl1)
+ link_error ();
+
+ if (l1 == gca1)
+ link_error ();
+
+ if (rl1 == rgc1)
+ link_error ();
+
+ if (rl1 == rp1)
+ link_error ();
+
+ if (rl1 == gca1)
+ link_error ();
+
+ if (rp1 == rp2)
+ link_error ();
+
+ if (rp1 == rgc1)
+ link_error ();
+
+ if (rp1 == gca1)
+ link_error ();
+
+ if (gca1 == rgc1)
+ link_error ();
+
+}
+
+int gci1[128];
+int* __restrict__ rgi1;
+int* test666 (int * __restrict__ rp1, int * __restrict__ rp2, int *p1)
+{
+ int * __restrict__ rl1 = p1;
+ int * l1 = (int*) alloc (20);
+
+ if (l1 == rgi1)
+ link_error ();
+
+ if (l1 == rp1)
+ link_error ();
+
+ if (l1 == rl1)
+ link_error ();
+
+ if (l1 == gci1)
+ link_error ();
+
+ if (rl1 == rgi1)
+ link_error ();
+
+ if (rl1 == rp1)
+ link_error ();
+
+ if (rl1 == gci1)
+ link_error ();
+
+ if (rp1 == rp2)
+ link_error ();
+
+ if (rp1 == rgi1)
+ link_error ();
+
+ if (rp1 == gci1)
+ link_error ();
+
+ if (gci1 == rgi1)
+ link_error ();
+}
+
+
+/* There should be not link_error calls, if there is any the
+ optimization has failed */
+/* ??? While we indeed don't handle some of these, a couple of the
+ restrict tests are incorrect. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "ccp2" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "ccp2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-30.c
new file mode 100644
index 000000000..47675ed5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-30.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+int
+foo (int a)
+{
+ int b = a & 0xff;
+ if (b > 300)
+ return 2;
+ else
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate b_.* > 300 to 0" 1 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-31.c
new file mode 100644
index 000000000..c155e921c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-31.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+int g (int i, int j)
+{
+ int t = 0;
+ int i1;
+
+ if (i == j)
+ t = 3;
+ for (i1 = 0; i1 < 10000; i1++) h();
+ if (t != 5)
+ return 0;
+ else
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-32.c
new file mode 100644
index 000000000..7487d07d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-32.c
@@ -0,0 +1,58 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+
+extern void link_error (void);
+unsigned int __attribute__((noinline,noclone))
+test0 (unsigned int a)
+{
+ a = a & 1;
+ a = a << 1 | a >> (sizeof (unsigned int) * 8 - 1);
+ if (a & 1)
+ {
+ a = a | 4;
+ link_error ();
+ }
+ if (a & 4)
+ link_error ();
+ return a;
+}
+int __attribute__((noinline,noclone))
+test1 (int a)
+{
+ a |= 1;
+ a = a << (sizeof (int) * 8 - 1);
+ if (a >= 0)
+ link_error ();
+ a = a * 4;
+ if (a & ~3)
+ link_error ();
+ if (a == -1)
+ link_error ();
+ return a;
+}
+int __attribute__((noinline,noclone))
+test2 (int a)
+{
+ a = a | 0xff;
+ a = a + 1;
+ if (a & 0xff)
+ link_error ();
+ a = -a;
+ if (a & 0xff)
+ link_error ();
+ a = a - 1;
+ if ((a & 0xff) != 0xff)
+ link_error ();
+ return a;
+}
+extern void abort (void);
+int main()
+{
+ if (test0 (1) != 2)
+ abort ();
+ if (test1 (0) != 0)
+ abort ();
+ if (test2 (-1) != -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-33.c
new file mode 100644
index 000000000..753676994
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-33.c
@@ -0,0 +1,17 @@
+/* { dg-do link } */
+/* { dg-options "-O" } */
+
+extern void link_error ();
+int a[256];
+void foo(int n)
+{
+ int *p;
+ for (p = a; n != 0; --n, ++p)
+ ;
+ if ((__SIZE_TYPE__)p & (__alignof__ (int) - 1))
+ link_error ();
+}
+int main()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c
new file mode 100644
index 000000000..b34974130
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+
+/* tests to check if cprop works when using non-return functions */
+
+extern int not_returning (int) __attribute__ ((noreturn));
+
+int b;
+int test7 (int a)
+{
+ b = 7;
+ if (a)
+ {
+ not_returning (a);
+ }
+ if (b != 7)
+ link_error ();
+ return b;
+}
+
+
+/* There should be not link_error calls, if there is any the
+ optimization has failed */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c
new file mode 100644
index 000000000..af23f8beb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+
+/* Check that cprop works for assignments to array elements and structs. */
+
+struct foo {
+ int a;
+};
+
+extern void link_error (void);
+
+void
+test9 (struct foo f)
+{
+ f.a = 0;
+ if (f.a != 0)
+ link_error ();
+}
+
+void
+test99 (struct foo *f)
+{
+ f->a = 0;
+ if (f->a != 0)
+ link_error ();
+}
+
+void
+test999 (int *arr)
+{
+ *arr = 0;
+ if (*arr != 0)
+ link_error ();
+}
+
+void
+test9999 (int *arr)
+{
+ arr[13] = 0;
+ if (arr[13] != 0)
+ link_error ();
+}
+
+void
+test99999 (int *arr, int j)
+{
+ arr[j] = 0;
+ if (arr[j] != 0)
+ link_error ();
+}
+
+/* There should be no link_error calls, if there is any, the
+ optimization has failed */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-1.c
new file mode 100644
index 000000000..41ad6ce6e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-copyprop-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-optimized" } */
+
+typedef struct { int i; int j; } A;
+int foo(A *a, int i)
+{
+ a->i = i;
+ return a->i;
+}
+
+/* { dg-final { scan-tree-dump "return i" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c
new file mode 100644
index 000000000..12d982629
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-dce2" } */
+
+int t() __attribute__ ((const));
+q()
+{
+ int i = t();
+ if (!i)
+ i = t();
+}
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "dce2"} } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c
new file mode 100644
index 000000000..5e5302486
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dce2" } */
+
+/* We should notice constantness of this function. */
+static int __attribute__((noinline)) t(int a)
+{
+ return a+1;
+}
+void q(void)
+{
+ int i = t(1);
+ if (!i)
+ i = t(1);
+}
+/* There should be no IF conditionals. */
+/* { dg-final { scan-tree-dump-times "if " 0 "dce2"} } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c
new file mode 100644
index 000000000..72020aac7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cddce1" } */
+
+int main(void)
+{
+ unsigned i, j;
+
+ for (i = 1, j = 0; i != 0; i+=2)
+ {
+ j += 500;
+ if (j % 7)
+ {
+ j++;
+ }
+ else
+ {
+ j--;
+ }
+ }
+
+ return 0;
+}
+
+/* We now can prove the infiniteness of the loop during CCP and fail
+ to eliminate the code inside the infinite loop because we start
+ by marking the j % 7 condition as useful. See PR45178. */
+
+/* We should eliminate the inner condition, but the loop must be preserved
+ as it is infinite. Therefore there should be just one phi node (for i): */
+/* { dg-final { scan-tree-dump-times "PHI " 1 "cddce1" { xfail *-*-* } } } */
+
+/* And one if (for the exit condition of the loop): */
+/* { dg-final { scan-tree-dump-times "if " 1 "cddce1" } } */
+
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-4.c
new file mode 100644
index 000000000..261880cc2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-4.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-fre -fdump-tree-cddce1" } */
+
+int foo(int b)
+{
+ int a[128];
+ a[b] = 1;
+ if (b)
+ {
+ b = 2;
+ a[2] = 0;
+ }
+ a[2] = 3;
+ return a[2] + b;
+}
+
+/* Verify DCE removes all accesses to a but the last store and the
+ read from a[2]. */
+/* { dg-final { scan-tree-dump-times "a\\\[\[^\n\]\\\]" 2 "cddce1" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-5.c
new file mode 100644
index 000000000..11c9e666b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-5.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-cddce1" } */
+
+struct X { int i; };
+struct X foo(int b)
+{
+ struct X x;
+ if (b)
+ x.i = 0;
+ x.i = 1;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-times "x.i =" 1 "cddce1" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-6.c
new file mode 100644
index 000000000..30a06a102
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-6.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-cddce1" } */
+
+struct object { int field; };
+void o(struct object *);
+int globl;
+void t(int x)
+{
+ struct object a, b;
+ struct object *p;
+ o(&a);
+ if (x)
+ p = &a;
+ else
+ p = &b;
+ p->field = 1;
+ globl = 0;
+ return;
+}
+
+/* The global store should not prevent deleting the store to p->field. */
+
+/* { dg-final { scan-tree-dump-not "p_.->field" "cddce1" } } */
+/* { dg-final { cleanup-tree-dump "cddce1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-7.c
new file mode 100644
index 000000000..792dfb028
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-7.c
@@ -0,0 +1,33 @@
+/* { dg-do link } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+extern void link_error (void);
+void foo(int n)
+{
+ int * f = (int*) __builtin_malloc (n * sizeof (int));
+ int * ff = (int*) __builtin_malloc (n * sizeof (int));
+ int i;
+
+ for (i = 0; i < n; ++i)
+ {
+ f[i] = 1;
+ ff[i] = 2;
+ if (f[i] != 1)
+ link_error ();
+ if (ff[i] != 2)
+ link_error ();
+ }
+
+ __builtin_free (f);
+ __builtin_free (ff);
+}
+int main()
+{
+ return 0;
+}
+
+/* We should have removed the calls to link_error () and all stores
+ to the allocated memory. */
+
+/* { dg-final { scan-tree-dump-times "\\\*D" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-8.c
new file mode 100644
index 000000000..689eb99c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-8.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int main()
+{
+ int *p = __builtin_malloc (4);
+ *p = 4;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "malloc" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-ccp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-ccp-1.c
new file mode 100644
index 000000000..b2bcd06be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-ccp-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int t(int a) __attribute__ ((const));
+void abort (void);
+int
+ccp(int b)
+{
+ int a=1;
+ a++;
+ a++;
+ a++;
+ if (b)
+ abort();
+ return a;
+}
+/* We should propagate constant 4 into return. */
+/* { dg-final { scan-tree-dump-times "return 4" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c
new file mode 100644
index 000000000..70a905819
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-details" } */
+int t(int a) __attribute__ ((const));
+void q (void);
+void
+threading(int a,int b)
+{
+ if (t(a))
+ {
+ if (t(a))
+ q();
+ }
+}
+/* We should thread the jump twice and eliminate it. */
+/* { dg-final { scan-tree-dump-times "Replaced.* t " 1 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-dse-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-dse-1.c
new file mode 100644
index 000000000..504e4bc03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-dse-1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int x;
+void
+foo (void)
+{
+ if (x == 0)
+ x = 0;
+}
+void
+bar (int i)
+{
+ if (x == i)
+ x = i;
+}
+
+/* { dg-final { scan-tree-dump-not "x =" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c
new file mode 100644
index 000000000..7671e93ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-vrp -fdump-tree-dom1-details" } */
+void t(void);
+void q(void);
+void q1(void);
+void
+threading(int a,int b)
+{
+ if (a>b)
+ t();
+ else
+ q();
+ if (a<=b)
+ q1();
+}
+/* We should thread the jump twice and elliminate it. */
+/* { dg-final { scan-tree-dump-times "Threaded" 2 "dom1"} } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c
new file mode 100644
index 000000000..6aaea8ecb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c
@@ -0,0 +1,119 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-stats -fdump-tree-dom1-stats" } */
+
+void foo();
+void bla();
+void bar();
+
+/* In the following two cases, we should be able to thread edge through
+ the loop header. */
+
+void thread_entry_through_header (void)
+{
+ int i;
+
+ for (i = 0; i < 170; i++)
+ bla ();
+}
+
+void thread_latch_through_header (void)
+{
+ int i = 0;
+ int first = 1;
+
+ do
+ {
+ if (first)
+ foo ();
+
+ first = 0;
+ bla ();
+ } while (i++ < 100);
+}
+
+/* This is a TODO -- it is correct to thread both entry and latch edge through
+ the header, but we do not handle this case yet. */
+
+void dont_thread_1 (void)
+{
+ int i = 0;
+ int first = 1;
+
+ do
+ {
+ if (first)
+ foo ();
+ else
+ bar ();
+
+ first = 0;
+ bla ();
+ } while (i++ < 100);
+}
+
+/* Avoid threading in the following two cases, to prevent creating subloops. */
+
+void dont_thread_2 (int first)
+{
+ int i = 0;
+
+ do
+ {
+ if (first)
+ foo ();
+ else
+ bar ();
+
+ first = 0;
+ bla ();
+ } while (i++ < 100);
+}
+
+void dont_thread_3 (int nfirst)
+{
+ int i = 0;
+ int first = 0;
+
+ do
+ {
+ if (first)
+ foo ();
+ else
+ bar ();
+
+ first = nfirst;
+ bla ();
+ } while (i++ < 100);
+}
+
+/* Avoid threading in this case, in order to avoid creating loop with
+ multiple entries. */
+
+void dont_thread_4 (int a, int nfirst)
+{
+ int i = 0;
+ int first;
+
+ if (a)
+ first = 0;
+ else
+ first = 1;
+
+ do
+ {
+ if (first)
+ foo ();
+ else
+ bar ();
+
+ first = nfirst;
+ bla ();
+ } while (i++ < 100);
+}
+
+/* { dg-final { scan-tree-dump-times "Jumps threaded: 1" 1 "vrp1"} } */
+/* { dg-final { scan-tree-dump-times "Jumps threaded: 2" 0 "vrp1"} } */
+/* { dg-final { scan-tree-dump-times "Jumps threaded: 1" 0 "dom1"} } */
+/* { dg-final { scan-tree-dump-times "Jumps threaded: 2" 1 "dom1"} } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c
new file mode 100644
index 000000000..1e46634c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-4.c
@@ -0,0 +1,81 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom1-details" } */
+/* { dg-additional-options "-mbranch-cost=2" { target s390*-*-* } } */
+struct bitmap_head_def;
+typedef struct bitmap_head_def *bitmap;
+typedef const struct bitmap_head_def *const_bitmap;
+typedef unsigned long BITMAP_WORD;
+typedef struct bitmap_element_def
+{
+ struct bitmap_element_def *next;
+ unsigned int indx;
+} bitmap_element;
+
+
+
+
+
+
+
+
+
+unsigned char
+bitmap_ior_and_compl (bitmap dst, const_bitmap a, const_bitmap b,
+ const_bitmap kill)
+{
+ unsigned char changed = 0;
+
+ bitmap_element *dst_elt;
+ const bitmap_element *a_elt, *b_elt, *kill_elt, *dst_prev;
+
+ while (a_elt || b_elt)
+ {
+ unsigned char new_element = 0;
+
+ if (b_elt)
+ while (kill_elt && kill_elt->indx < b_elt->indx)
+ kill_elt = kill_elt->next;
+
+ if (b_elt && kill_elt && kill_elt->indx == b_elt->indx
+ && (!a_elt || a_elt->indx >= b_elt->indx))
+ {
+ bitmap_element tmp_elt;
+ unsigned ix;
+
+ BITMAP_WORD ior = 0;
+
+ changed = bitmap_elt_ior (dst, dst_elt, dst_prev,
+ a_elt, &tmp_elt, changed);
+
+ }
+
+ }
+
+
+ return changed;
+}
+/* The block starting the second conditional has 3 incoming edges,
+ we should thread all three, but due to a bug in the threading
+ code we missed the edge when the first conditional is false
+ (b_elt is zero, which means the second conditional is always
+ zero. */
+/* { dg-final { scan-tree-dump-times "Threaded" 3 "dom1" { target { ! logical_op_short_circuit } } } } */
+/* On targets that define LOGICAL_OP_NON_SHORT_CIRCUIT to 0, we split both
+ "a_elt || b_elt" and "b_elt && kill_elt" into two conditions each,
+ rather than using "(var1 != 0) op (var2 != 0)". Also, as on other targets,
+ we duplicate the header of the inner "while" loop. There are then
+ 4 threading opportunities:
+
+ 1x "!a_elt && b_elt" in the outer "while" loop
+ -> the start of the inner "while" loop,
+ skipping the known-true "b_elt" in the first condition.
+ 1x "!b_elt" in the first condition
+ -> the outer "while" loop's continuation point,
+ skipping the known-false "b_elt" in the second condition.
+ 2x "kill_elt->indx >= b_elt->indx" in the first "while" loop
+ -> "kill_elt->indx == b_elt->indx" in the second condition,
+ skipping the known-true "b_elt && kill_elt" in the second
+ condition. */
+/* { dg-final { scan-tree-dump-times "Threaded" 4 "dom1" { target logical_op_short_circuit } } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-1.c
new file mode 100644
index 000000000..d0263e3a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-1.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse1" } */
+
+int
+foo (int a, int b, int c)
+{
+ int *p;
+ if (c)
+ p = &a;
+ else
+ p = &b;
+
+ *p = 3;
+ *p = 4;
+ return *p;
+}
+
+
+/* We should eliminate both assignments to *p. */
+/* { dg-final { scan-tree-dump-times " = 3" 0 "dse1"} } */
+/* { dg-final { scan-tree-dump-times " = 4" 0 "dse1"} } */
+
+/* The return *p should be turned into return 4. */
+/* { dg-final { scan-tree-dump-times " return 4" 1 "dse1"} } */
+
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-10.c
new file mode 100644
index 000000000..c2e27c82d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-10.c
@@ -0,0 +1,1523 @@
+/* { dg-do compile } */
+/* { dg-options "-O -w -fdump-tree-dse1-vops" } */
+
+__extension__ typedef __SIZE_TYPE__ size_t;
+typedef struct _IO_FILE FILE;
+typedef struct
+{
+} __mbstate_t;
+typedef struct
+{
+} _G_fpos_t;
+typedef struct
+{
+};
+typedef int (*__gconv_trans_fct) (struct __gconv_step *,
+ size_t *);
+typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
+ size_t *);
+struct __gconv_trans_data
+{
+};
+struct __gconv_step_data
+{
+};
+typedef struct __gconv_info
+{
+} *__gconv_t;
+typedef union
+{
+ struct
+ {
+ } __combined;
+} _G_iconv_t;
+typedef __builtin_va_list __gnuc_va_list;
+enum __codecvt_result
+{
+ __codecvt_noconv
+};
+struct _IO_FILE {
+};
+vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
+{
+}
+putchar (int __c)
+{
+}
+fputc_unlocked (int __c, FILE *__stream)
+{
+}
+putc_unlocked (int __c, FILE *__stream)
+{
+}
+__attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream)
+{
+}
+extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
+ __gnuc_va_list __ap);
+gets (char *__str)
+{
+}
+extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
+ FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
+fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
+{
+}
+typedef void *LPVOID;
+typedef int BOOL, *PBOOL, *LPBOOL;
+typedef unsigned char BYTE, *PBYTE, *LPBYTE;
+typedef unsigned short WORD, *PWORD, *LPWORD;
+typedef unsigned int DWORD, *PDWORD, *LPDWORD;
+typedef struct _GUID
+{
+} GUID;
+enum
+{
+ _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
+};
+extern char *__strtok_r (char *__restrict __s,
+ __const char *__restrict __delim,
+ char **__restrict __save_ptr)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
+__strcspn_c3 (__const char *__s, int __reject1, int __reject2,
+ int __reject3)
+{
+}
+extern __inline size_t __strspn_c3 (__const char *__s, int __accept1,
+ int __accept2, int __accept3);
+extern __inline size_t
+__strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
+{
+}
+extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1,
+ int __accept2);
+extern __inline char *
+__strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
+{
+}
+extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1,
+ int __accept3)
+{
+}
+__strtok_r_1c (char *__s, char __sep, char **__nextp)
+{
+ {
+ {
+ }
+ }
+}
+__strsep_1c (char **__s, char __reject)
+{
+}
+__strsep_2c (char **__s, char __reject1, char __reject2)
+{
+ {
+ {
+ }
+ }
+}
+extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2,
+ char __reject3);
+extern __inline char *
+__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
+{
+ {
+ {
+ {
+ }
+ }
+ }
+}
+__attribute__ ((__nothrow__)) __memcpy_ichk (void *__restrict __dest, __const void *__restrict __src, size_t __len)
+{
+}
+__attribute__ ((__nothrow__)) __memmove_ichk (void *__dest, __const void *__src, size_t __len)
+{
+}
+__attribute__ ((__nothrow__)) __strncpy_ichk (char *__restrict __dest, __const char *__restrict __src, size_t __len)
+{
+}
+__attribute__ ((__nothrow__)) stpncpy (char *__dest, __const char *__src, size_t __n)
+{
+ if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1
+ && (!__builtin_constant_p (__n) || __n <= __builtin_object_size (__dest, 2 > 1)))
+ return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1));
+}
+__attribute__ ((__nothrow__)) __strncat_ichk (char *__restrict __dest, __const char *__restrict __src, size_t __len)
+{
+}
+typedef void *PVOID;
+typedef char CHAR, *PCHAR;
+typedef int LONG, *PLONG;
+typedef unsigned short WCHAR, *PWCHAR;
+typedef CHAR *PSTR, *LPSTR, *NPSTR;
+typedef const CHAR *PCSTR, *LPCSTR;
+typedef WCHAR *PWSTR, *LPWSTR, *NWPSTR;
+typedef LONG HRESULT;
+typedef struct _MEMORY_BASIC_INFORMATION
+{
+} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
+typedef enum _HEAP_INFORMATION_CLASS {
+ HeapCompatibilityInformation,
+} HEAP_INFORMATION_CLASS;
+typedef struct _FLOATING_SAVE_AREA
+{
+} CONTEXT86;
+typedef struct _LDT_ENTRY {
+ union {
+ struct {
+ } Bits;
+ } HighWord;
+} LDT_ENTRY, *PLDT_ENTRY;
+typedef struct _EXCEPTION_RECORD
+{
+} EXCEPTION_RECORD, *PEXCEPTION_RECORD;
+typedef struct _EXCEPTION_POINTERS
+{
+} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
+typedef struct _NT_TIB
+{
+ union {
+ } ;
+} NT_TIB, *PNT_TIB;
+extern inline struct _TEB * __attribute__((__stdcall__)) NtCurrentTeb(void)
+{
+} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
+typedef struct _IMAGE_SYMBOL {
+ union {
+ struct {
+ } FcnAry;
+ } Section;
+} IMAGE_AUX_SYMBOL;
+typedef struct _IMAGE_EXPORT_DIRECTORY {
+ union {
+ } u1;
+} IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF;
+typedef struct _IMAGE_BASE_RELOCATION
+{
+} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
+typedef struct _IMAGE_RELOCATION
+{
+ union {
+ } ;
+} IMAGE_RELOCATION, *PIMAGE_RELOCATION;
+typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
+{
+} IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
+typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
+ union {
+ struct {
+ } ;
+ struct {
+ } ;
+ } ;
+} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
+typedef enum ReplacesCorHdrNumericDefines
+{
+ MAX_PACKAGE_NAME = 1024,
+} ReplacesCorHdrNumericDefines;
+typedef struct IMAGE_COR20_HEADER
+{
+} MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
+typedef PVOID PSECURITY_DESCRIPTOR;
+typedef enum _TOKEN_INFORMATION_CLASS {
+ TokenUser = 1,
+} TOKEN_INFORMATION_CLASS;
+typedef struct _GENERIC_MAPPING {
+} ACL, *PACL;
+typedef struct _ACL_SIZE_INFORMATION
+{
+} ACL_SIZE_INFORMATION, *PACL_SIZE_INFORMATION;
+typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
+typedef struct {
+} SID_AND_ATTRIBUTES;
+typedef enum {
+ WinBuiltinTerminalServerLicenseServersSid = 60
+} WELL_KNOWN_SID_TYPE;
+typedef struct _TOKEN_USER {
+} TOKEN_GROUPS, *PTOKEN_GROUPS;
+typedef union _LARGE_INTEGER {
+ struct {
+ };
+} LARGE_INTEGER, *PLARGE_INTEGER;
+typedef union _ULARGE_INTEGER {
+ struct {
+ };
+} LUID, *PLUID;
+typedef struct _LUID_AND_ATTRIBUTES {
+} LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES;
+typedef enum tagTOKEN_TYPE {
+ TokenPrimary = 1,
+} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL;
+typedef struct _SECURITY_QUALITY_OF_SERVICE {
+} QUOTA_LIMITS_EX, *PQUOTA_LIMITS_EX;
+typedef enum _LATENCY_TIME {
+ VerifyProcessorPowerPolicyDc,
+} POWER_INFORMATION_LEVEL;
+typedef struct _ADMINISTRATOR_POWER_POLICY {
+} RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
+typedef struct _RTL_CRITICAL_SECTION {
+} RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
+typedef struct _IO_COUNTERS {
+} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
+typedef struct {
+} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
+typedef struct {
+} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
+typedef struct {
+} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
+typedef struct tagSIZE
+{
+} POINT, *PPOINT, *LPPOINT;
+typedef struct _POINTL
+{
+} FILETIME, *PFILETIME, *LPFILETIME;
+typedef struct tagRECT
+{
+ } ldiv_t;
+extern double strtod (__const char *__restrict __nptr,
+ char **__restrict __endptr)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern long int strtol (__const char *__restrict __nptr,
+ char **__restrict __endptr, int __base)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern long int __strtol_internal (__const char *__restrict __nptr,
+ int __base, int __group)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
+ int __base, int __group)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
+extern __inline double
+__attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr)
+{
+}
+extern __inline long int
+__attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base)
+{
+}
+__attribute__ ((__nothrow__)) strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base)
+{
+}
+__attribute__ ((__nothrow__)) atoi (__const char *__nptr)
+{
+}
+typedef int int32_t __attribute__ ((__mode__ (__SI__)));
+typedef struct
+ {
+ };
+extern int random_r (struct random_data *__restrict __buf,
+ int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
+struct drand48_data
+ {
+ };
+extern int drand48_r (struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
+extern int mrand48_r (struct drand48_data *__restrict __buffer,
+ long int *__restrict __result)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
+extern int jrand48_r (unsigned short int __xsubi[3],
+ long int *__restrict __result)
+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
+extern int seed48_r (unsigned short int __seed16v[3],
+ struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
+extern char *qfcvt (long double __value, int __ndigit,
+ size_t __resolvedlen) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
+__attribute__ ((__nothrow__)) realpath (__const char *__restrict __name, char *__restrict __resolved)
+{
+}
+__attribute__ ((__nothrow__)) ptsname_r (int __fd, char *__buf, size_t __buflen)
+{
+}
+typedef struct _EXCEPTION_DEBUG_INFO {
+} EXCEPTION_DEBUG_INFO;
+typedef struct _CREATE_THREAD_DEBUG_INFO {
+} CREATE_THREAD_DEBUG_INFO;
+typedef struct _CREATE_PROCESS_DEBUG_INFO {
+} CREATE_PROCESS_DEBUG_INFO;
+typedef struct _EXIT_THREAD_DEBUG_INFO {
+} LOAD_DLL_DEBUG_INFO;
+typedef struct _UNLOAD_DLL_DEBUG_INFO {
+} RIP_INFO;
+typedef struct _DEBUG_EVENT {
+ union {
+ } u;
+} DEBUG_EVENT, *LPDEBUG_EVENT;
+typedef struct _OFSTRUCT
+{
+} WIN32_FIND_DATAA, *PWIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
+typedef struct _WIN32_FIND_DATAW
+{
+} WIN32_FIND_DATAW, *PWIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;
+typedef enum _FINDEX_SEARCH_OPS
+{
+ FindExSearchNameMatch,
+} FINDEX_SEARCH_OPS;
+typedef struct _PROCESS_HEAP_ENTRY
+{
+ union {
+ struct {
+ } Block;
+ struct {
+ } Region;
+ } ;
+} PROCESS_HEAP_ENTRY, *PPROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY;
+typedef struct tagMEMORYSTATUS
+{
+} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
+typedef struct _SYSTEMTIME{
+ WORD wYear;
+} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
+typedef struct _OVERLAPPED {
+ union {
+ struct {
+ } ;
+ } ;
+} PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
+typedef struct _TIME_ZONE_INFORMATION{
+} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
+typedef struct _BY_HANDLE_FILE_INFORMATION
+{
+} ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, *PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
+typedef struct tagACTCTX_SECTION_KEYED_DATA {
+} COMMTIMEOUTS,*LPCOMMTIMEOUTS;
+typedef enum _COMPUTER_NAME_FORMAT
+{
+ ComputerNameNetBIOS,
+} COMPUTER_NAME_FORMAT;
+typedef struct tagHW_PROFILE_INFOA {
+} HW_PROFILE_INFOA, *LPHW_PROFILE_INFOA;
+typedef struct tagHW_PROFILE_INFOW {
+} HW_PROFILE_INFOW, *LPHW_PROFILE_INFOW;
+BOOL __attribute__((__stdcall__)) SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,
+ SECURITY_DESCRIPTOR_CONTROL);
+typedef struct tagSYSLEVEL
+{
+} SYSLEVEL;
+static inline PVOID __attribute__((__stdcall__)) InterlockedCompareExchangePointer( PVOID volatile *dest, PVOID xchg, PVOID compare )
+{
+}
+static inline PVOID __attribute__((__stdcall__)) InterlockedExchangePointer( PVOID volatile *dest, PVOID val )
+{
+}
+typedef unsigned long HCRYPTPROV;
+typedef unsigned long HCRYPTKEY;
+typedef void *HCERTSTOREPROV;
+typedef struct _PROV_ENUMALGS {
+} PROV_ENUMALGS;
+typedef struct _HMAC_INFO {
+} HMAC_INFO, *PHMAC_INFO;
+typedef struct _CRYPTOAPI_BLOB {
+ DWORD cbData;
+ BYTE* pbData;
+} CRYPT_INTEGER_BLOB, *PCRYPT_INTEGER_BLOB,
+ CRYPT_OBJID_BLOB, *PCRYPT_OBJID_BLOB,
+ CERT_NAME_BLOB, *PCERT_NAME_BLOB,
+ CERT_RDN_VALUE_BLOB, *PCERT_RDN_VALUE_BLOB,
+ CRYPT_DER_BLOB, *PCRYPT_DER_BLOB,
+ CRYPT_ATTR_BLOB, *PCRYPT_ATTR_BLOB;
+typedef struct _CRYPTPROTECT_PROMPTSTRUCT{
+} CRYPTPROTECT_PROMPTSTRUCT, *PCRYPTPROTECT_PROMPTSTRUCT;
+typedef struct _CRYPT_ALGORITHM_IDENTIFIER {
+ LPSTR pszObjId;
+ CRYPT_OBJID_BLOB Parameters;
+} CRYPT_ALGORITHM_IDENTIFIER, *PCRYPT_ALGORITHM_IDENTIFIER;
+typedef struct _CRYPT_ATTRIBUTE_TYPE_VALUE {
+} CRYPT_ATTRIBUTE_TYPE_VALUE, *PCRYPT_ATTRIBUTE_TYPE_VALUE;
+typedef struct _PUBLICKEYSTRUC {
+} BLOBHEADER, PUBLICKEYSTRUC;
+typedef struct _RSAPUBKEY {
+ DWORD magic;
+ DWORD pubexp;
+} RSAPUBKEY;
+typedef struct _CRYPT_BIT_BLOB {
+ DWORD cbData;
+ BYTE *pbData;
+ DWORD cUnusedBits;
+} CRYPT_BIT_BLOB, *PCRYPT_BIT_BLOB;
+typedef struct _CRYPT_KEY_PROV_PARAM {
+} CRYPT_KEY_PROV_PARAM, *PCRYPT_KEY_PROV_PARAM;
+typedef struct _CRYPT_KEY_PROV_INFO {
+ CRYPT_ALGORITHM_IDENTIFIER Algorithm;
+ CRYPT_BIT_BLOB PublicKey;
+} CERT_PUBLIC_KEY_INFO, *PCERT_PUBLIC_KEY_INFO;
+typedef struct _CERT_EXTENSION {
+ LPSTR pszObjId;
+ CRYPT_OBJID_BLOB Value;
+} CERT_EXTENSION, *PCERT_EXTENSION;
+typedef struct _CERT_EXTENSIONS {
+ DWORD cExtension;
+ PCERT_EXTENSION rgExtension;
+} CERT_EXTENSIONS, *PCERT_EXTENSIONS;
+typedef struct _CERT_INFO {
+ CRYPT_INTEGER_BLOB SerialNumber;
+ CERT_NAME_BLOB Subject;
+ CERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
+} CERT_INFO, *PCERT_INFO;
+typedef struct _CERT_RDN_ATTR {
+ LPSTR pszObjId;
+ CERT_RDN_VALUE_BLOB Value;
+} CERT_RDN_ATTR, *PCERT_RDN_ATTR;
+typedef struct _CERT_RDN {
+} CERT_RDN, *PCERT_RDN;
+typedef struct _CERT_NAME_INFO {
+ DWORD cRDN;
+} CERT_NAME_INFO, *PCERT_NAME_INFO;
+typedef struct _CERT_NAME_VALUE {
+ DWORD dwValueType;
+ CERT_RDN_VALUE_BLOB Value;
+} CERT_NAME_VALUE, *PCERT_NAME_VALUE;
+typedef struct _CERT_ENCRYPTED_PRIVATE_KEY_INFO {
+ CERT_NAME_BLOB CertIssuer;
+} CERT_AUTHORITY_KEY_ID_INFO, *PCERT_AUTHORITY_KEY_ID_INFO;
+typedef struct _CERT_PRIVATE_KEY_VALIDITY {
+} CERT_OTHER_NAME, *PCERT_OTHER_NAME;
+typedef struct _CERT_ALT_NAME_ENTRY {
+ DWORD dwAltNameChoice;
+ union {
+ LPWSTR pwszURL;
+ } ;
+} CERT_ALT_NAME_ENTRY, *PCERT_ALT_NAME_ENTRY;
+typedef struct _CERT_ALT_NAME_INFO {
+ DWORD cAltEntry;
+ PCERT_ALT_NAME_ENTRY rgAltEntry;
+} CERT_ALT_NAME_INFO, *PCERT_ALT_NAME_INFO;
+typedef struct _CERT_BASIC_CONSTRAINTS_INFO {
+ CERT_NAME_BLOB *rgSubtreesConstraint;
+} CERT_BASIC_CONSTRAINTS_INFO, *PCERT_BASIC_CONSTRAINTS_INFO;
+typedef struct _CERT_BASIC_CONSTRAINTS2_INFO {
+} CERT_BASIC_CONSTRAINTS2_INFO, *PCERT_BASIC_CONSTRAINTS2_INFO;
+typedef struct _CERT_POLICY_QUALIFIER_INFO {
+} CERT_POLICY_QUALIFIER_INFO, *PCERT_POLICY_QUALIFIER_INFO;
+typedef struct _CERT_POLICY_QUALIFIER_NOTICE_REFERENCE {
+} CERT_POLICY_QUALIFIER_NOTICE_REFERENCE,
+ *PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE;
+typedef struct _CERT_POLICY_QUALIFIER_USER_NOTICE {
+ DWORD cValue;
+ PCRYPT_DER_BLOB rgValue;
+} CRYPT_SEQUENCE_OF_ANY, *PCRYPT_SEQUENCE_OF_ANY;
+typedef struct _CERT_AUTHORITY_KEY_ID2_INFO {
+ PCERT_INFO pCertInfo;
+} CERT_CONTEXT, *PCERT_CONTEXT;
+typedef const CERT_CONTEXT *PCCERT_CONTEXT;
+typedef struct _CRL_ENTRY {
+} CRL_ENTRY, *PCRL_ENTRY;
+typedef struct _CRL_INFO {
+ DWORD cCRLEntry;
+ DWORD cExtension;
+} CRL_INFO, *PCRL_INFO;
+typedef struct _CRL_DIST_POINT_NAME {
+ DWORD dwDistPointNameChoice;
+ union {
+ } ;
+} CRL_DIST_POINT_NAME, *PCRL_DIST_POINT_NAME;
+typedef struct _CRL_DIST_POINT {
+ CRL_DIST_POINT_NAME DistPointName;
+ CRYPT_BIT_BLOB ReasonFlags;
+ CERT_ALT_NAME_INFO CRLIssuer;
+} CRL_DIST_POINT, *PCRL_DIST_POINT;
+typedef struct _CRL_DIST_POINTS_INFO {
+ DWORD cDistPoint;
+ PCRL_DIST_POINT rgDistPoint;
+} CRL_DIST_POINTS_INFO, *PCRL_DIST_POINTS_INFO;
+typedef struct _CRL_ISSUING_DIST_POINT {
+ BOOL fOnlyContainsUserCerts;
+} CRL_ISSUING_DIST_POINT, *PCRL_ISSUING_DIST_POINT;
+typedef struct _CERT_GENERAL_SUBTREE {
+} CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE;
+typedef struct _CRYPT_ATTRIBUTES {
+} CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES;
+typedef struct _CERT_REQUEST_INFO {
+ DWORD dwVersion;
+ CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm;
+ CRYPT_BIT_BLOB Signature;
+} CERT_SIGNED_CONTENT_INFO, *PCERT_SIGNED_CONTENT_INFO;
+typedef struct _CRL_CONTEXT {
+} CRL_CONTEXT, *PCRL_CONTEXT;
+typedef struct _VTableProvStruc {
+} CTL_CONTEXT, *PCTL_CONTEXT;
+typedef struct _CRYPT_TIME_STAMP_REQUEST_INFO {
+} CERT_REVOCATION_STATUS, *PCERT_REVOCATION_STATUS;
+typedef struct _CERT_TRUST_STATUS {
+} CERT_SYSTEM_STORE_RELOCATE_PARA, *PCERT_SYSTEM_STORE_RELOCATE_PARA;
+typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)(
+ void *pvArg);
+typedef struct _CRYPT_ENCODE_PARA {
+} CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO;
+typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)(
+ DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara);
+typedef struct _CERT_STORE_PROV_FIND_INFO {
+} CERT_STORE_PROV_FIND_INFO, *PCERT_STORE_PROV_FIND_INFO;
+typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_STORE_PROV_FIND_CERT)(HCERTSTOREPROV hStoreProv,
+ DWORD dwFlags, void **ppvStoreProvFindInfo, PCCERT_CONTEXT *ppProvCertContext);
+typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_STORE_PROV_FREE_FIND_CERT)(
+ DWORD dwFlags, void *pvData, DWORD *pcbData);
+typedef BOOL (__attribute__((__stdcall__)) *PFN_CERT_STORE_PROV_GET_CTL_PROPERTY)(
+ DWORD dwFlags, void *pvData);
+typedef struct _CERT_CREATE_CONTEXT_PARA {
+} CRYPT_OID_FUNC_ENTRY, *PCRYPT_OID_FUNC_ENTRY;
+typedef BOOL (__attribute__((__stdcall__)) *PFN_CRYPT_ENUM_OID_FUNC)(DWORD dwEncodingType,
+ const DWORD rgcbValueData[], void *pvArg);
+typedef struct _CRYPT_OID_INFO {
+ union {
+ } ;
+} CRYPT_OID_INFO, *PCRYPT_OID_INFO;
+typedef const CRYPT_OID_INFO CCRYPT_OID_INFO, *PCCRYPT_OID_INFO;
+typedef BOOL (__attribute__((__stdcall__)) *PFN_CRYPT_ENUM_OID_INFO)(PCCRYPT_OID_INFO pInfo,
+ void *pvArg);
+typedef struct _CRYPT_SIGN_MESSAGE_PARA {
+} CRYPT_HASH_MESSAGE_PARA, *PCRYPT_HASH_MESSAGE_PARA;
+typedef struct _CRYPT_KEY_SIGN_MESSAGE_PARA {
+} CRYPT_URL_INFO, *PCRYPT_URL_INFO;
+typedef void (__attribute__((__stdcall__)) *PFN_CRYPT_ASYNC_PARAM_FREE_FUNC)(LPSTR pszParamOid,
+ LPVOID pvParam);
+typedef struct _CRYPT_CREDENTIALS {
+} CRYPT_CREDENTIALS, *PCRYPT_CREDENTIALS;
+typedef struct _CRYPT_PASSWORD_CREDENTIALSA {
+} CRYPT_PASSWORD_CREDENTIALSW, *PCRYPT_PASSWORD_CREDENTIALSW;
+typedef struct _CRYPT_RETRIEVE_AUX_INFO {
+} CRYPT_RETRIEVE_AUX_INFO, *PCRYPT_RETRIEVE_AUX_INFO;
+typedef struct _CERT_CHAIN_ENGINE_CONFIG
+{
+} CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG;
+BOOL __attribute__((__stdcall__)) CryptExportPublicKeyInfoEx(HCRYPTPROV hCryptProv, DWORD dwKeySpec,
+ DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, DWORD dwFlags,
+ void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo);
+BOOL __attribute__((__stdcall__)) CryptImportPublicKeyInfo(HCRYPTPROV hCryptProv,
+ PCRYPT_RETRIEVE_AUX_INFO pAuxInfo);
+struct encodedInt
+{
+ int val;
+ const BYTE *encoded;
+};
+static const struct encodedInt ints[] = {
+};
+struct encodedBigInt
+{
+ const BYTE *val;
+ const BYTE *encoded;
+};
+static const struct encodedBigInt bigInts[] = {
+};
+static const struct encodedBigInt bigUInts[] = {
+};
+static void test_encodeInt(DWORD dwEncoding)
+{
+ DWORD bufSize = 0;
+ int i;
+ BOOL ret;
+ CRYPT_INTEGER_BLOB blob;
+ BYTE *buf = ((void *)0);
+ ret = CryptEncodeObjectEx(0, ((LPCSTR)27), &ints[0].val, 0, ((void *)0), ((void *)0),
+ "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
+ {
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)27), &ints[i].val,
+ 0x08000, ((void *)0), &buf, &bufSize);
+ {
+ (winetest_set_location("encode.c", 119), 0) ? 0 : winetest_ok(buf[0] == 2, "Got unexpected type %d for integer (expected 2)\n",
+ buf[1], ints[i].encoded[1]);
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)28), &blob,
+ 0, ((void *)0), ((void *)0), &bufSize);
+ {
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)38), &blob,
+ 0x08000, ((void *)0), &buf, &bufSize);
+ {
+ (winetest_set_location("encode.c", 187), 0) ? 0 : winetest_ok(buf[1] == bigUInts[i].encoded[1], "Got length %d, expected %d\n",
+ buf[1], bigUInts[i].encoded[1]);
+ (winetest_set_location("encode.c", 189), 0) ? 0 : winetest_ok(!memcmp(buf + 1, bigUInts[i].encoded + 1,
+ bigUInts[i].encoded[1] + 1),
+ "Encoded value didn't match expected\n");
+ }
+ }
+}
+static void test_decodeInt(DWORD dwEncoding)
+{
+ static const BYTE longForm[] = { 2, 0x81, 0x01, 0x01 };
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ int i;
+ BOOL ret;
+ ret = CryptDecodeObjectEx(3, ((LPCSTR)27), (BYTE *)&ints[0].encoded,
+ ints[0].encoded[1] + 2, 0, ((void *)0), ((void *)0), &bufSize);
+ (winetest_set_location("encode.c", 225), 0) ? 0 : winetest_ok(!ret && GetLastError() == ((HRESULT)0x80093104L),
+ "Expected CRYPT_E_ASN1_BADTAG, got %d\n", GetLastError());
+ {
+ {
+ (winetest_set_location("encode.c", 249), 0) ? 0 : winetest_ok(!memcmp(buf, &ints[i].val, bufSize), "Expected %d, got %d\n",
+ ints[i].val, *(int *)buf);
+ }
+ }
+ {
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)28),
+ &bufSize);
+ {
+ CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)buf;
+ (winetest_set_location("encode.c", 296), 0) ? 0 : winetest_ok(blob->cbData == strlen((const char*)bigUInts[i].val),
+ "Unexpected value\n");
+ }
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)28), longForm,
+ sizeof(longForm), 0x08000, ((void *)0), (BYTE *)&buf, &bufSize);
+ {
+ }
+}
+static const struct encodedInt enums[] = {
+};
+static const LPCSTR enumeratedTypes[] = { ((LPCSTR)29),
+ "2.5.29.21" };
+static void test_encodeEnumerated(DWORD dwEncoding)
+{
+ DWORD i, j;
+ {
+ {
+ BOOL ret;
+ DWORD bufSize = 0;
+ ret = CryptEncodeObjectEx(dwEncoding, enumeratedTypes[i],
+ &bufSize);
+ {
+ }
+ }
+ }
+}
+static void test_decodeEnumerated(DWORD dwEncoding)
+{
+ DWORD i, j;
+ {
+ {
+ BOOL ret;
+ DWORD bufSize = sizeof(int);
+ int val;
+ ret = CryptDecodeObjectEx(dwEncoding, enumeratedTypes[i],
+ (BYTE *)&val, &bufSize);
+ (winetest_set_location("encode.c", 403), 0) ? 0 : winetest_ok(val == enums[j].val, "Unexpected value %d, expected %d\n",
+ val, enums[j].val);
+ }
+ }
+}
+struct encodedFiletime
+{
+ SYSTEMTIME sysTime;
+ const BYTE *encodedTime;
+};
+static void testTimeEncoding(DWORD dwEncoding, LPCSTR structType,
+ const struct encodedFiletime *time)
+{
+}
+static void testTimeDecoding(DWORD dwEncoding, LPCSTR structType,
+ const struct encodedFiletime *time)
+{
+ BOOL ret;
+ if (structType == ((LPCSTR)30) ||
+ (time->sysTime.wYear >= 1950 && time->sysTime.wYear <= 2050))
+ {
+ }
+ (winetest_set_location("encode.c", 476), 0) ? 0 : winetest_ok(!ret && GetLastError() == ((HRESULT)0x8009310BL),
+ "Expected CRYPT_E_ASN1_BADTAG, got 0x%08x\n", GetLastError());
+}
+static const BYTE bin22[] = {
+ 0x18,0x0f,'2','1','4','5','0','6','0','6','1','6','1','0','0','0','Z'};
+static const struct encodedFiletime times[] = {
+};
+static void test_encodeFiletime(DWORD dwEncoding)
+{
+ {
+ }
+}
+static const BYTE bin23[] = {
+ 0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','.','0','0','0','Z'};
+static const BYTE bin24[] = {
+ 0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','.','9','9','9','Z'};
+static const BYTE bin26[] = {
+ 0x17,0x0b,'4','5','0','6','0','6','1','6','1','0','Z'};
+static const BYTE bin33[] = {
+ 0x17,0x0f,'4','5','0','6','0','6','1','6','1','0','-','0','1','0','0'};
+static const BYTE bin35[] = {
+ 0x17,0x08, '4','5','0','6','0','6','1','6'};
+static const BYTE bin38[] = {
+ 0x18,0x08, '2','1','4','5','0','6','0','6'};
+static void test_decodeFiletime(DWORD dwEncoding)
+{
+ static const struct encodedFiletime otherTimes[] = {
+ };
+ static const unsigned char *bogusTimes[] = {
+ };
+ {
+ }
+}
+static const char commonName[] = "Juan Lang";
+static const char surName[] = "Lang";
+static const BYTE emptySequence[] = { 0x30, 0 };
+static const BYTE emptyRDNs[] = { 0x30, 0x02, 0x31, 0 };
+static const BYTE twoRDNs[] = {
+ 0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0};
+static const BYTE encodedTwoRDNs[] = {
+};
+static const BYTE us[] = { 0x55, 0x53 };
+static const BYTE minnesota[] = { 0x4d, 0x69, 0x6e, 0x6e, 0x65, 0x73, 0x6f,
+ 0x6f, 0x6c, 0x69, 0x73 };
+static const BYTE codeweavers[] = { 0x43, 0x6f, 0x64, 0x65, 0x57, 0x65, 0x61,
+ 0x76, 0x65, 0x72, 0x73 };
+static const BYTE wine[] = { 0x57, 0x69, 0x6e, 0x65, 0x20, 0x44, 0x65, 0x76,
+ 0x65, 0x6c, 0x6f, 0x70, 0x6d, 0x65, 0x6e, 0x74 };
+static const BYTE aric[] = { 0x61, 0x72, 0x69, 0x63, 0x40, 0x63, 0x6f, 0x64,
+ 0x65, 0x77, 0x65, 0x61, 0x76, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x6f, 0x6d };
+static CHAR oid_us[] = "2.5.4.6",
+ oid_aric[] = "1.2.840.113549.1.9.1";
+static CERT_RDN_ATTR rdnAttrs[] = { { oid_us, 4, { sizeof(us), (LPBYTE)us } },
+ { oid_aric, 7, { sizeof(aric), (LPBYTE)aric } } };
+static const BYTE encodedRDNAttrs[] = {
+};
+static void test_encodeName(DWORD dwEncoding)
+{
+ CERT_NAME_INFO info;
+ static CHAR oid_common_name[] = "2.5.4.3",
+ oid_sur_name[] = "2.5.4.4";
+ BOOL ret;
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)7), ((void *)0),
+ "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
+ {
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)7), &info,
+ "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
+ {
+ }
+ {
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)7), &info,
+ "Expected E_INVALIDARG, got %08x\n", GetLastError());
+ {
+ }
+}
+static WCHAR commonNameW[] = { 'J','u','a','n',' ','L','a','n','g',0 };
+static const BYTE twoRDNsNoNull[] = {
+ 0x20,0x4c,0x61,0x6e,0x67 };
+static const BYTE anyType[] = {
+ 0x61,0x4c,0x67,0x6e };
+static void test_encodeUnicodeName(DWORD dwEncoding)
+{
+ BOOL ret;
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)20), ((void *)0),
+ "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
+ {
+ }
+}
+static void compareNameValues(const CERT_NAME_VALUE *expected,
+ const CERT_NAME_VALUE *got)
+{
+ (winetest_set_location("encode.c", 913), 0) ? 0 : winetest_ok(got->dwValueType == expected->dwValueType,
+ expected->dwValueType, got->Value.cbData, expected->Value.cbData);
+ (winetest_set_location("encode.c", 920), 0) ? 0 : winetest_ok(!memcmp(got->Value.pbData, expected->Value.pbData,
+ (((got->Value.cbData) < (expected->Value.cbData)) ? (got->Value.cbData) : (expected->Value.cbData))),
+ "String type %d: unexpected value\n", expected->dwValueType);
+}
+static void compareRDNAttrs(const CERT_RDN_ATTR *expected,
+ const CERT_RDN_ATTR *got)
+{
+ {
+ {
+ (winetest_set_location("encode.c", 934), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (got->pszObjId) && __builtin_constant_p (expected->pszObjId) && (__s1_len = strlen (got->pszObjId), __s2_len = strlen (expected->pszObjId), (!((size_t)(const void *)((got->pszObjId) + 1) - (size_t)(const void *)(got->pszObjId) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((expected->pszObjId) + 1) - (size_t)(const void *)(expected->pszObjId) == 1) || __s2_len >= 4)) ? __builtin_strcmp (got->pszObjId, expected->pszObjId) : (__builtin_constant_p (got->pszObjId) && ((size_t)(const void *)((got->pszObjId) + 1) - (size_t)(const void *)(got->pszObjId) == 1) && (__s1_len = strlen (got->pszObjId), __s1_len < 4) ? (__builtin_constant_p (expected->pszObjId) && ((size_t)(const void *)((expected->pszObjId) + 1) - (size_t)(const void *)(expected->pszObjId) == 1) ? __builtin_strcmp (got->pszObjId, expected->pszObjId) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (expected->pszObjId); register int __result = (((__const unsigned char *) (__const char *) (got->pszObjId))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (got->pszObjId))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (got->pszObjId))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (got->pszObjId))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (expected->pszObjId) && ((size_t)(const void *)((expected->pszObjId) + 1) - (size_t)(const void *)(expected->pszObjId) == 1) && (__s2_len = strlen (expected->pszObjId), __s2_len < 4) ? (__builtin_constant_p (got->pszObjId) && ((size_t)(const void *)((got->pszObjId) + 1) - (size_t)(const void *)(got->pszObjId) == 1) ? __builtin_strcmp (got->pszObjId, expected->pszObjId) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (got->pszObjId); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (expected->pszObjId))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (expected->pszObjId))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (expected->pszObjId))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (expected->pszObjId))[3]); } } __result; }))) : __builtin_strcmp (got->pszObjId, expected->pszObjId)))); }),
+ expected->pszObjId);
+ }
+ }
+}
+static void compareRDNs(const CERT_RDN *expected, const CERT_RDN *got)
+{
+ {
+ }
+}
+static void compareNames(const CERT_NAME_INFO *expected,
+ const CERT_NAME_INFO *got)
+{
+ (winetest_set_location("encode.c", 959), 0) ? 0 : winetest_ok(got->cRDN == expected->cRDN, "Expected %d RDNs, got %d\n",
+ expected->cRDN, got->cRDN);
+ {
+ }
+}
+static void test_decodeName(DWORD dwEncoding)
+{
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ BOOL ret;
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)7), emptySequence,
+ (BYTE *)&buf, &bufSize);
+ {
+ static CHAR oid_sur_name[] = "2.5.4.4",
+ oid_common_name[] = "2.5.4.3";
+ CERT_RDN_ATTR attrs[] = {
+ { oid_sur_name, 4, { sizeof(surName),
+ (BYTE *)commonName } },
+ };
+ }
+ {
+ }
+}
+static void test_decodeUnicodeName(DWORD dwEncoding)
+{
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ BOOL ret;
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)20), emptySequence,
+ (BYTE *)&buf, &bufSize);
+ {
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)20), emptyRDNs,
+ (BYTE *)&buf, &bufSize);
+ {
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)20), twoRDNsNoNull,
+ (BYTE *)&buf, &bufSize);
+ {
+ static CHAR oid_sur_name[] = "2.5.4.4",
+ oid_common_name[] = "2.5.4.3";
+ CERT_RDN_ATTR attrs[] = {
+ { oid_sur_name, 4,
+ { lstrlenW(commonNameW) * sizeof(WCHAR), (BYTE *)commonNameW } },
+ };
+ }
+}
+struct EncodedNameValue
+{
+ CERT_NAME_VALUE value;
+};
+static const char bogusPrintable[] = "~";
+static const BYTE bin42[] = { 0x16,0x02,0x80,0x00 };
+static const BYTE bin43[] = { 0x13,0x02,0x7e,0x00 };
+static BYTE octetCommonNameValue[] = {
+ 0x12,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00 };
+static BYTE printableCommonNameValue[] = {
+ 0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00 };
+static BYTE t61CommonNameValue[] = {
+ 0x14,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00 };
+static BYTE graphicCommonNameValue[] = {
+ 0x61,0x00,0x6e,0x00,0x67,0x00,0x00 };
+static BYTE utf8CommonNameValue[] = {
+ 0x0c,0x0a,0x4a,0x75,0x61,0x6e,0x20,0x4c,0x61,0x6e,0x67,0x00 };
+static struct EncodedNameValue nameValues[] = {
+ { { 5, { sizeof(commonName), (BYTE *)commonName } },
+ sizeof(bin42) },
+ { { 4, { sizeof(bogusPrintable),
+ (BYTE *)bogusPrintable } }, bin43, sizeof(bin43) },
+};
+static void test_encodeNameValue(DWORD dwEncoding)
+{
+ DWORD size = 0, i;
+ BOOL ret;
+ CERT_NAME_VALUE value = { 0, { 0, ((void *)0) } };
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)6), &value,
+ "Expected CRYPT_E_ASN1_CHOICE, got %08x\n", GetLastError());
+ {
+ (winetest_set_location("encode.c", 1209), 0) ? 0 : winetest_ok(size == sizeof(printableCommonNameValue), "Unexpected size %d\n",
+ "Unexpected encoding\n");
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)6),
+ nameValues[i].value.dwValueType, GetLastError());
+ {
+ }
+ }
+}
+static void test_decodeNameValue(DWORD dwEncoding)
+{
+ int i;
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ BOOL ret;
+ {
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)6),
+ (BYTE *)&buf, &bufSize);
+ {
+ compareNameValues(&nameValues[i].value,
+ (const CERT_NAME_VALUE *)buf);
+ }
+ }
+}
+static const BYTE emptyURL[] = { 0x30, 0x02, 0x86, 0x00 };
+static const WCHAR url[] = { 'h','t','t','p',':','/','/','w','i','n','e',
+ 0x6f, 0x72, 0x67 };
+static const BYTE encodedIPAddr[] = { 0x30, 0x06, 0x87, 0x04, 0x7f, 0x00, 0x00,
+ 0x01 };
+static void test_encodeAltName(DWORD dwEncoding)
+{
+ CERT_ALT_NAME_INFO info = { 0 };
+ BYTE *buf = ((void *)0);
+ DWORD size = 0;
+ BOOL ret;
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)12), &info,
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ }
+ {
+ }
+}
+static void test_decodeAltName(DWORD dwEncoding)
+{
+ BOOL ret;
+ DWORD bufSize = 0;
+ CERT_ALT_NAME_INFO *info;
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)12),
+ &bufSize);
+ {
+ (winetest_set_location("encode.c", 1392), 0) ? 0 : winetest_ok(info->cAltEntry == 0, "Expected 0 entries, got %d\n",
+ info->cAltEntry);
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)12), emptyURL,
+ &bufSize);
+ {
+ }
+}
+struct encodedBits
+{
+ const BYTE *encoded;
+ DWORD cbDecoded;
+};
+static const struct encodedBits bits[] = {
+};
+static void test_encodeBits(DWORD dwEncoding)
+{
+ DWORD i;
+ {
+ DWORD bufSize = 0;
+ {
+ (winetest_set_location("encode.c", 1802), 0) ? 0 : winetest_ok(bufSize == bits[i].encoded[1] + 2,
+ bits[i].encoded[1] + 2);
+ }
+ }
+}
+static void test_decodeBits(DWORD dwEncoding)
+{
+ DWORD i;
+ {
+ {
+ CRYPT_BIT_BLOB *blob;
+ (winetest_set_location("encode.c", 1835), 0) ? 0 : winetest_ok(blob->cbData == bits[i].cbDecoded,
+ "Unexpected value\n");
+ }
+ }
+ {
+ }
+}
+struct Constraints2
+{
+ CERT_BASIC_CONSTRAINTS2_INFO info;
+};
+static const struct Constraints2 constraints2[] = {
+};
+static const BYTE encodedDomainName[] = { 0x30, 0x2b, 0x31, 0x29, 0x30, 0x11,
+ 0x16, 0x06, 0x77, 0x69, 0x6e, 0x65, 0x68, 0x71 };
+static void test_encodeBasicConstraints(DWORD dwEncoding)
+{
+ CERT_NAME_BLOB nameBlob = { sizeof(encodedDomainName),
+ (LPBYTE)encodedDomainName };
+ {
+ {
+ }
+ }
+ {
+ }
+}
+static const unsigned char encodedCommonName[] = {
+ 0x30,0x15,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,'J','u','a','n',' ','L','a','n','g',0};
+static void test_decodeBasicConstraints(DWORD dwEncoding)
+{
+ static const BYTE inverted[] = { 0x30, 0x06, 0x02, 0x01, 0x01, 0x01, 0x01,
+ 0xff };
+ DWORD i;
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ {
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)15),
+ 0x08000, ((void *)0), (BYTE *)&buf, &bufSize);
+ {
+ CERT_BASIC_CONSTRAINTS2_INFO *info =
+ (winetest_set_location("encode.c", 1984), 0) ? 0 : winetest_ok(!memcmp(info, &constraints2[i].info, sizeof(*info)),
+ "Unexpected value for item %d\n", i);
+ }
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)15),
+ (BYTE *)&buf, &bufSize);
+ {
+ CERT_BASIC_CONSTRAINTS_INFO *info = (CERT_BASIC_CONSTRAINTS_INFO *)buf;
+ {
+ (winetest_set_location("encode.c", 2043), 0) ? 0 : winetest_ok(info->rgSubtreesConstraint[0].cbData ==
+ info->rgSubtreesConstraint[0].cbData);
+ (winetest_set_location("encode.c", 2046), 0) ? 0 : winetest_ok(!memcmp(info->rgSubtreesConstraint[0].pbData, encodedDomainName,
+ sizeof(encodedDomainName)), "Unexpected value\n");
+ }
+ }
+}
+static const BYTE modulus1[] = { 0,0,0,1,1,1,1,1 };
+struct EncodedRSAPubKey
+{
+ const BYTE *modulus;
+ size_t decodedModulusLen;
+};
+struct EncodedRSAPubKey rsaPubKeys[] = {
+};
+static void test_encodeRsaPublicKey(DWORD dwEncoding)
+{
+ BYTE toEncode[sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + sizeof(modulus1)];
+ RSAPUBKEY *rsaPubKey = (RSAPUBKEY *)(toEncode + sizeof(BLOBHEADER));
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0, i;
+ ret = CryptDecodeObjectEx(dwEncoding, "1.2.840.113549.1.1.1",
+ "Expected ERROR_FILE_NOT_FOUND, got %08x\n", GetLastError());
+ {
+ {
+ (winetest_set_location("encode.c", 2210), 0) ? 0 : winetest_ok(bufSize >= sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) +
+ "Wrong size %d\n", bufSize);
+ (winetest_set_location("encode.c", 2223), 0) ? 0 : winetest_ok(rsaPubKey->magic == 0x31415352,
+ rsaPubKey->pubexp);
+ (winetest_set_location("encode.c", 2229), 0) ? 0 : winetest_ok(!memcmp(buf + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY),
+ rsaPubKeys[i].modulus, rsaPubKeys[i].decodedModulusLen),
+ "Unexpected modulus\n");
+ }
+ }
+}
+static const BYTE intSequence[] = { 0x30, 0x1b, 0x02, 0x01, 0x01, 0x02, 0x01,
+ 0x02, 0xff, 0x7f, 0x02, 0x04, 0xba, 0xdd, 0xf0, 0x0d };
+static const BYTE mixedSequence[] = { 0x30, 0x27, 0x17, 0x0d, 0x30, 0x35, 0x30,
+ 0xff, 0x7f, 0x02, 0x04, 0xba, 0xdd, 0xf0, 0x0d };
+static void test_encodeSequenceOfAny(DWORD dwEncoding)
+{
+ BYTE *buf = ((void *)0);
+ {
+ }
+ {
+ (winetest_set_location("encode.c", 2284), 0) ? 0 : winetest_ok(!memcmp(buf, mixedSequence, mixedSequence[1] + 2),
+ "Unexpected value\n");
+ }
+}
+static void test_decodeSequenceOfAny(DWORD dwEncoding)
+{
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ {
+ {
+ }
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)34), mixedSequence,
+ &bufSize);
+ {
+ CRYPT_SEQUENCE_OF_ANY *seq = (CRYPT_SEQUENCE_OF_ANY *)buf;
+ (winetest_set_location("encode.c", 2324), 0) ? 0 : winetest_ok(seq->cValue == sizeof(ints) / sizeof(ints[0]),
+ seq->rgValue[0].cbData);
+ (winetest_set_location("encode.c", 2330), 0) ? 0 : winetest_ok(!memcmp(seq->rgValue[0].pbData, times[0].encodedTime,
+ times[0].encodedTime[1] + 2), "Unexpected value\n");
+ }
+}
+struct encodedExtensions
+{
+ CERT_EXTENSIONS exts;
+};
+static BYTE noncrit_ext_data[] = { 0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
+static CHAR oid_basic_constraints2[] = "2.5.29.19";
+static CERT_EXTENSION nonCriticalExt =
+ { oid_basic_constraints2, 0, { 8, noncrit_ext_data } };
+static const struct encodedExtensions exts[] = {
+};
+static void test_encodeExtensions(DWORD dwEncoding)
+{
+ DWORD i;
+ {
+ {
+ }
+ }
+ {
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)5),
+ ((void *)0), (BYTE *)&buf, &bufSize);
+ {
+ CERT_EXTENSIONS *ext = (CERT_EXTENSIONS *)buf;
+ DWORD j;
+ (winetest_set_location("encode.c", 2405), 0) ? 0 : winetest_ok(ext->cExtension == exts[i].exts.cExtension,
+ ext->cExtension);
+ {
+ (winetest_set_location("encode.c", 2410), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (ext->rgExtension[j].pszObjId) && __builtin_constant_p (exts[i].exts.rgExtension[j].pszObjId) && (__s1_len = strlen (ext->rgExtension[j].pszObjId), __s2_len = strlen (exts[i].exts.rgExtension[j].pszObjId), (!((size_t)(const void *)((ext->rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(ext->rgExtension[j].pszObjId) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((exts[i].exts.rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(exts[i].exts.rgExtension[j].pszObjId) == 1) || __s2_len >= 4)) ? __builtin_strcmp (ext->rgExtension[j].pszObjId, exts[i].exts.rgExtension[j].pszObjId) : (__builtin_constant_p (ext->rgExtension[j].pszObjId) && ((size_t)(const void *)((ext->rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(ext->rgExtension[j].pszObjId) == 1) && (__s1_len = strlen (ext->rgExtension[j].pszObjId), __s1_len < 4) ? (__builtin_constant_p (exts[i].exts.rgExtension[j].pszObjId) && ((size_t)(const void *)((exts[i].exts.rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(exts[i].exts.rgExtension[j].pszObjId) == 1) ? __builtin_strcmp (ext->rgExtension[j].pszObjId, exts[i].exts.rgExtension[j].pszObjId) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId); register int __result = (((__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (exts[i].exts.rgExtension[j].pszObjId) && ((size_t)(const void *)((exts[i].exts.rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(exts[i].exts.rgExtension[j].pszObjId) == 1) && (__s2_len = strlen (exts[i].exts.rgExtension[j].pszObjId), __s2_len < 4) ? (__builtin_constant_p (ext->rgExtension[j].pszObjId) && ((size_t)(const void *)((ext->rgExtension[j].pszObjId) + 1) - (size_t)(const void *)(ext->rgExtension[j].pszObjId) == 1) ? __builtin_strcmp (ext->rgExtension[j].pszObjId, exts[i].exts.rgExtension[j].pszObjId) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (ext->rgExtension[j].pszObjId); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (exts[i].exts.rgExtension[j].pszObjId))[3]); } } __result; }))) : __builtin_strcmp (ext->rgExtension[j].pszObjId, exts[i].exts.rgExtension[j].pszObjId)))); }),
+ ext->rgExtension[j].pszObjId);
+ (winetest_set_location("encode.c", 2415), 0) ? 0 : winetest_ok(!memcmp(ext->rgExtension[j].Value.pbData,
+ exts[i].exts.rgExtension[j].Value.cbData),
+ "Unexpected value\n");
+ }
+ }
+ }
+}
+struct encodedPublicKey
+{
+ const BYTE *encoded;
+ const BYTE *encodedNoNull;
+};
+static const BYTE aKey[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd,
+ 0xe, 0xf };
+static const BYTE params[] = { 0x02, 0x01, 0x01 };
+static const unsigned char bin66[] = {
+ 0x30,0x0f,0x30,0x0a,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x05,0x00,0x03,0x01,0x00};
+static const unsigned char bin67[] = {
+ 0x30,0x0d,0x30,0x08,0x06,0x06,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x03,0x01,0x00};
+static const unsigned char bin69[] = {
+ 0x0f};
+static unsigned char bin72[] = { 0x05,0x00};
+static CHAR oid_bogus[] = "1.2.3",
+ oid_rsa[] = "1.2.840.113549";
+static const struct encodedPublicKey pubKeys[] = {
+ { { { oid_rsa, { 0, ((void *)0) } }, { 0, ((void *)0), 0} },
+ { { oid_rsa, { 2, bin72 } }, { sizeof(aKey), (BYTE *)aKey, 0} } },
+ { { { oid_rsa, { sizeof(params), (BYTE *)params } }, { sizeof(aKey),
+ (BYTE *)aKey, 0 } } },
+};
+static void test_encodePublicKeyInfo(DWORD dwEncoding)
+{
+ DWORD i;
+ {
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)8),
+ &bufSize);
+ {
+ (winetest_set_location("encode.c", 2505), 0) ? 0 : winetest_ok(bufSize == pubKeys[i].encoded[1] + 2 ||
+ pubKeys[i].encodedNoNull[1] + 2, bufSize);
+ (winetest_set_location("encode.c", 2510), 0) ? 0 : winetest_ok(!memcmp(buf, pubKeys[i].encoded, pubKeys[i].encoded[1] + 2),
+ "Unexpected value\n");
+ (winetest_set_location("encode.c", 2513), 0) ? 0 : winetest_ok(!memcmp(buf, pubKeys[i].encodedNoNull,
+ pubKeys[i].encodedNoNull[1] + 2), "Unexpected value\n");
+ }
+ }
+}
+static void comparePublicKeyInfo(const CERT_PUBLIC_KEY_INFO *expected,
+ const CERT_PUBLIC_KEY_INFO *got)
+{
+ (winetest_set_location("encode.c", 2523), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (expected->Algorithm.pszObjId) && __builtin_constant_p (got->Algorithm.pszObjId) && (__s1_len = strlen (expected->Algorithm.pszObjId), __s2_len = strlen (got->Algorithm.pszObjId), (!((size_t)(const void *)((expected->Algorithm.pszObjId) + 1) - (size_t)(const void *)(expected->Algorithm.pszObjId) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((got->Algorithm.pszObjId) + 1) - (size_t)(const void *)(got->Algorithm.pszObjId) == 1) || __s2_len >= 4)) ? __builtin_strcmp (expected->Algorithm.pszObjId, got->Algorithm.pszObjId) : (__builtin_constant_p (expected->Algorithm.pszObjId) && ((size_t)(const void *)((expected->Algorithm.pszObjId) + 1) - (size_t)(const void *)(expected->Algorithm.pszObjId) == 1) && (__s1_len = strlen (expected->Algorithm.pszObjId), __s1_len < 4) ? (__builtin_constant_p (got->Algorithm.pszObjId) && ((size_t)(const void *)((got->Algorithm.pszObjId) + 1) - (size_t)(const void *)(got->Algorithm.pszObjId) == 1) ? __builtin_strcmp (expected->Algorithm.pszObjId, got->Algorithm.pszObjId) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (got->Algorithm.pszObjId); register int __result = (((__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (got->Algorithm.pszObjId) && ((size_t)(const void *)((got->Algorithm.pszObjId) + 1) - (size_t)(const void *)(got->Algorithm.pszObjId) == 1) && (__s2_len = strlen (got->Algorithm.pszObjId), __s2_len < 4) ? (__builtin_constant_p (expected->Algorithm.pszObjId) && ((size_t)(const void *)((expected->Algorithm.pszObjId) + 1) - (size_t)(const void *)(expected->Algorithm.pszObjId) == 1) ? __builtin_strcmp (expected->Algorithm.pszObjId, got->Algorithm.pszObjId) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (expected->Algorithm.pszObjId); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (got->Algorithm.pszObjId))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (got->Algorithm.pszObjId))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (got->Algorithm.pszObjId))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (got->Algorithm.pszObjId))[3]); } } __result; }))) : __builtin_strcmp (expected->Algorithm.pszObjId, got->Algorithm.pszObjId)))); }),
+ expected->PublicKey.cbData, got->PublicKey.cbData);
+ (winetest_set_location("encode.c", 2538), 0) ? 0 : winetest_ok(!memcmp(expected->PublicKey.pbData, got->PublicKey.pbData,
+ got->PublicKey.cbData), "Unexpected public key value\n");
+}
+static void test_decodePublicKeyInfo(DWORD dwEncoding)
+{
+ static const BYTE bogusPubKeyInfo[] = { 0x30, 0x22, 0x30, 0x0d, 0x06, 0x06,
+ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f };
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ {
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)8),
+ 0x08000, ((void *)0), (BYTE *)&buf, &bufSize);
+ {
+ }
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)8),
+ "Expected CRYPT_E_ASN1_CORRUPT, got %08x\n", GetLastError());
+}
+static const BYTE v1Cert[] = { 0x30, 0x33, 0x02, 0x00, 0x30, 0x02, 0x06, 0x00,
+ 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 };
+static const BYTE v2Cert[] = { 0x30, 0x38, 0xa0, 0x03, 0x02, 0x01, 0x01, 0x02,
+ 0x30, 0x5a, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 };
+static const BYTE v3Cert[] = { 0x30, 0x38, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02,
+ 0x30, 0x5a, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00 };
+static const BYTE v1CertWithConstraints[] = { 0x30, 0x4b, 0x02, 0x00, 0x30,
+ 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 };
+static const BYTE v1CertWithSerial[] = { 0x30, 0x4c, 0x02, 0x01, 0x01, 0x30,
+ 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 };
+static const BYTE bigCert[] = { 0x30, 0x7a, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06,
+ 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 };
+static void test_encodeCertToBeSigned(DWORD dwEncoding)
+{
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD size = 0;
+ CERT_INFO info = { 0 };
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)2), ((void *)0),
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ }
+ {
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)2), &info,
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ }
+ {
+ }
+}
+static void test_decodeCertToBeSigned(DWORD dwEncoding)
+{
+ static const BYTE *corruptCerts[] = { v1Cert, v2Cert, v3Cert,
+ v1CertWithConstraints, v1CertWithSerial };
+ BOOL ret;
+ (winetest_set_location("encode.c", 2727), 0) ? 0 : winetest_ok(!ret && GetLastError() == ((HRESULT)0x80093102L),
+ "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
+ {
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)2),
+ "Expected CRYPT_E_ASN1_CORRUPT, got %08x\n", GetLastError());
+ }
+ {
+ }
+}
+static const BYTE hash[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd,
+ 0xe, 0xf };
+static const BYTE signedBigCert[] = {
+ 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 };
+static void test_encodeCert(DWORD dwEncoding)
+{
+ CERT_SIGNED_CONTENT_INFO info = { { sizeof(bigCert), (BYTE *)bigCert },
+ { ((void *)0), { 0, ((void *)0) } }, { sizeof(hash), (BYTE *)hash, 0 } };
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD bufSize = 0;
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)1), &info,
+ 0x08000, ((void *)0), (BYTE *)&buf, &bufSize);
+ {
+ }
+}
+static void test_decodeCert(DWORD dwEncoding)
+{
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD size = 0;
+ {
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)2), signedBigCert,
+ sizeof(signedBigCert), 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ CERT_INFO *info = (CERT_INFO *)buf;
+ (winetest_set_location("encode.c", 2843), 0) ? 0 : winetest_ok(info->SerialNumber.cbData == 1,
+ *info->SerialNumber.pbData);
+ (winetest_set_location("encode.c", 2852), 0) ? 0 : winetest_ok(info->Subject.cbData == sizeof(encodedCommonName),
+ "Wrong size %d\n", info->Subject.cbData);
+ (winetest_set_location("encode.c", 2854), 0) ? 0 : winetest_ok(!memcmp(info->Subject.pbData, encodedCommonName,
+ info->Subject.cbData), "Unexpected subject\n");
+ }
+}
+static const BYTE distPointWithUrl[] = { 0x30, 0x19, 0x30, 0x17, 0xa0, 0x15,
+ 0x6e, 0x65, 0x68, 0x71, 0x2e, 0x6f, 0x72, 0x67 };
+static const BYTE distPointWithIssuer[] = { 0x30, 0x17, 0x30, 0x15, 0xa2, 0x13,
+ 0x2e, 0x6f, 0x72, 0x67 };
+static const BYTE crlReason = 1 |
+ 3;
+static void test_encodeCRLDistPoints(DWORD dwEncoding)
+{
+ CRL_DIST_POINTS_INFO xxxinfo = { 0 };
+ CRL_DIST_POINT point = { { 0 } };
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD size = 0;
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)35), &xxxinfo,
+ "Expected E_INVALIDARG, got %08x\n", GetLastError());
+ xxxinfo.cDistPoint = 1;
+ xxxinfo.rgDistPoint = &point;
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)35), &xxxinfo,
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ point.ReasonFlags.cbData = sizeof(crlReason);
+ {
+ }
+}
+static void test_decodeCRLDistPoints(DWORD dwEncoding)
+{
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD size = 0;
+ PCERT_ALT_NAME_ENTRY entry;
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)35),
+ (BYTE *)&buf, &size);
+ {
+ (winetest_set_location("encode.c", 3065), 0) ? 0 : winetest_ok(entry->dwAltNameChoice == 7,
+ "Expected CERT_ALT_NAME_URL, got %d\n", entry->dwAltNameChoice);
+ }
+}
+static const BYTE urlIDP[] = { 0x30,0x17,0xa0,0x15,0xa0,0x13,0x86,0x11,0x68,
+ 0x67 };
+static void test_encodeCRLIssuingDistPoint(DWORD dwEncoding)
+{
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD size = 0;
+ CRL_ISSUING_DIST_POINT point = { { 0 } };
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)54), ((void *)0),
+ "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError());
+ {
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)54), &point,
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ }
+ {
+ }
+}
+static void compareAltNameEntry(const CERT_ALT_NAME_ENTRY *expected,
+ const CERT_ALT_NAME_ENTRY *got)
+{
+ (winetest_set_location("encode.c", 3149), 0) ? 0 : winetest_ok(expected->dwAltNameChoice == got->dwAltNameChoice,
+ got->dwAltNameChoice);
+ {
+ {
+ (winetest_set_location("encode.c", 3161), 0) ? 0 : winetest_ok((!(*expected).pwszURL && !(*got).pwszURL) ||
+ !lstrcmpW((*expected).pwszURL, (*got).pwszURL), "Unexpected name\n");
+ }
+ }
+}
+static void compareAltNameInfo(const CERT_ALT_NAME_INFO *expected,
+ const CERT_ALT_NAME_INFO *got)
+{
+}
+static const BYTE v1CRL[] = { 0x30, 0x15, 0x30, 0x02, 0x06, 0x00, 0x18, 0x0f,
+ 0x30, 0x5a };
+static const BYTE v2CRL[] = { 0x30, 0x18, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06,
+ 0x30, 0x30, 0x30, 0x30, 0x5a };
+static const BYTE v1CRLWithIssuer[] = { 0x30, 0x2c, 0x30, 0x02, 0x06, 0x00,
+ 0x5a };
+static const BYTE v1CRLWithIssuerAndEmptyEntry[] = { 0x30, 0x43, 0x30, 0x02,
+ 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a };
+static const BYTE v1CRLWithIssuerAndEntry[] = { 0x30, 0x44, 0x30, 0x02, 0x06,
+ 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a };
+static const BYTE v1CRLWithEntryExt[] = { 0x30,0x5a,0x30,0x02,0x06,0x00,0x30,
+ 0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
+static const BYTE v1CRLWithExt[] = { 0x30,0x5c,0x30,0x02,0x06,0x00,0x30,0x15,
+ 0xff,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
+static const BYTE v2CRLWithExt[] = { 0x30,0x5c,0x02,0x01,0x01,0x30,0x02,0x06,
+ 0x13,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
+static const BYTE v2CRLWithIssuingDistPoint[] = { 0x30,0x5c,0x02,0x01,0x01,
+ 0x03,0x55,0x1d,0x13,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01 };
+static void test_encodeCRLToBeSigned(DWORD dwEncoding)
+{
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD size = 0;
+ CRL_INFO info = { 0 };
+ {
+ (winetest_set_location("encode.c", 3386), 0) ? 0 : winetest_ok(size == sizeof(v1CRLWithIssuerAndEntry),
+ "Wrong size %d\n", size);
+ }
+ {
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)3), &info,
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ }
+ {
+ }
+}
+static const BYTE verisignCRL[] = { 0x30, 0x82, 0x01, 0xb1, 0x30, 0x82, 0x01,
+0x61,0xc0,0x99,0x16,0x71,0x05,0xb6,0x25,0x14,0x64,0x4f,0x30 };
+static void test_decodeCRLToBeSigned(DWORD dwEncoding)
+{
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD size = 0, i;
+ {
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)3),
+ (BYTE *)&buf, &size);
+ {
+ CRL_INFO *info = (CRL_INFO *)buf;
+ (winetest_set_location("encode.c", 4016), 0) ? 0 : winetest_ok(info->cCRLEntry == 0, "Expected 0 CRL entries, got %d\n",
+ "Unexpected issuer\n");
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)3),
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ CRL_INFO *info = (CRL_INFO *)buf;
+ (winetest_set_location("encode.c", 4041), 0) ? 0 : winetest_ok(info->cCRLEntry == 1, "Expected 1 CRL entries, got %d\n",
+ "Unexpected issuer\n");
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)3),
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ CRL_INFO *info = (CRL_INFO *)buf;
+ (winetest_set_location("encode.c", 4085), 0) ? 0 : winetest_ok(info->cCRLEntry == 209, "Expected 209 CRL entries, got %d\n",
+ info->cExtension);
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)3),
+ ((void *)0), (BYTE *)&buf, &size);
+ {
+ }
+}
+static const BYTE authorityKeyIdWithIssuer[] = { 0x30,0x19,0xa1,0x17,0x30,0x15,
+ 0x20,0x4c,0x61,0x6e,0x67,0x00 };
+static const BYTE authorityKeyIdWithSerial[] = { 0x30,0x03,0x82,0x01,0x01 };
+static void test_encodeAuthorityKeyId(DWORD dwEncoding)
+{
+ CERT_AUTHORITY_KEY_ID_INFO info = { { 0 } };
+ BOOL ret;
+ BYTE *buf = ((void *)0);
+ DWORD size = 0;
+ {
+ }
+ {
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)9), &info,
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ }
+ ret = CryptEncodeObjectEx(dwEncoding, ((LPCSTR)9), &info,
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ (winetest_set_location("encode.c", 4284), 0) ? 0 : winetest_ok(size == sizeof(authorityKeyIdWithSerial), "Unexpected size %d\n",
+ size);
+ }
+}
+static void test_decodeAuthorityKeyId(DWORD dwEncoding)
+{
+ BOOL ret;
+ LPBYTE buf = ((void *)0);
+ DWORD size = 0;
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)9),
+ (BYTE *)&buf, &size);
+ {
+ }
+ ret = CryptDecodeObjectEx(dwEncoding, ((LPCSTR)9),
+ 0x08000, ((void *)0), (BYTE *)&buf, &size);
+ {
+ (winetest_set_location("encode.c", 4355), 0) ? 0 : winetest_ok(size >= sizeof(CERT_AUTHORITY_KEY_ID_INFO), "Unexpected size %d\n",
+ "Unexpected serial number\n");
+ }
+}
+static void testExportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO *pInfo)
+{
+ BOOL ret;
+ DWORD size = 0;
+ {
+ ret = CryptExportPublicKeyInfoEx(csp, 2, 0x00000001,
+ ((void *)0), 0, ((void *)0), ((void *)0), &size);
+ {
+ {
+ (winetest_set_location("encode.c", 4416), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ((*pInfo)->Algorithm.pszObjId) && __builtin_constant_p ("1.2.840.113549.1.1.1") && (__s1_len = strlen ((*pInfo)->Algorithm.pszObjId), __s2_len = strlen ("1.2.840.113549.1.1.1"), (!((size_t)(const void *)(((*pInfo)->Algorithm.pszObjId) + 1) - (size_t)(const void *)((*pInfo)->Algorithm.pszObjId) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) || __s2_len >= 4)) ? __builtin_strcmp ((*pInfo)->Algorithm.pszObjId, "1.2.840.113549.1.1.1") : (__builtin_constant_p ((*pInfo)->Algorithm.pszObjId) && ((size_t)(const void *)(((*pInfo)->Algorithm.pszObjId) + 1) - (size_t)(const void *)((*pInfo)->Algorithm.pszObjId) == 1) && (__s1_len = strlen ((*pInfo)->Algorithm.pszObjId), __s1_len < 4) ? (__builtin_constant_p ("1.2.840.113549.1.1.1") && ((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) ? __builtin_strcmp ((*pInfo)->Algorithm.pszObjId, "1.2.840.113549.1.1.1") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"); register int __result = (((__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("1.2.840.113549.1.1.1") && ((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) && (__s2_len = strlen ("1.2.840.113549.1.1.1"), __s2_len < 4) ? (__builtin_constant_p ((*pInfo)->Algorithm.pszObjId) && ((size_t)(const void *)(((*pInfo)->Algorithm.pszObjId) + 1) - (size_t)(const void *)((*pInfo)->Algorithm.pszObjId) == 1) ? __builtin_strcmp ((*pInfo)->Algorithm.pszObjId, "1.2.840.113549.1.1.1") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ((*pInfo)->Algorithm.pszObjId); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[3]); } } __result; }))) : __builtin_strcmp ((*pInfo)->Algorithm.pszObjId, "1.2.840.113549.1.1.1")))); }),
+ (*pInfo)->Algorithm.pszObjId);
+ }
+ }
+ }
+}
+static const BYTE expiredCert[] = { 0x30, 0x82, 0x01, 0x33, 0x30, 0x81, 0xe2,
+ 0x49, 0xe5, 0xf9, 0x65, 0xf3 };
+static void testImportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO info)
+{
+ BOOL ret;
+ HCRYPTKEY key;
+ PCCERT_CONTEXT context;
+ (winetest_set_location("encode.c", 4464), 0) ? 0 : winetest_ok(!ret && GetLastError() == 2,
+ GetLastError());
+ {
+ (winetest_set_location("encode.c", 4485), 0) ? 0 : winetest_ok(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ("1.2.840.113549.1.1.1") && __builtin_constant_p (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) && (__s1_len = strlen ("1.2.840.113549.1.1.1"), __s2_len = strlen (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId), (!((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) || __s1_len >= 4) && (!((size_t)(const void *)((context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) + 1) - (size_t)(const void *)(context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("1.2.840.113549.1.1.1", context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) : (__builtin_constant_p ("1.2.840.113549.1.1.1") && ((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) && (__s1_len = strlen ("1.2.840.113549.1.1.1"), __s1_len < 4) ? (__builtin_constant_p (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) && ((size_t)(const void *)((context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) + 1) - (size_t)(const void *)(context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) == 1) ? __builtin_strcmp ("1.2.840.113549.1.1.1", context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId); register int __result = (((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) && ((size_t)(const void *)((context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) + 1) - (size_t)(const void *)(context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) == 1) && (__s2_len = strlen (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId), __s2_len < 4) ? (__builtin_constant_p ("1.2.840.113549.1.1.1") && ((size_t)(const void *)(("1.2.840.113549.1.1.1") + 1) - (size_t)(const void *)("1.2.840.113549.1.1.1") == 1) ? __builtin_strcmp ("1.2.840.113549.1.1.1", context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ("1.2.840.113549.1.1.1"); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId))[3]); } } __result; }))) : __builtin_strcmp ("1.2.840.113549.1.1.1", context->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId)))); }),
+ &context->pCertInfo->SubjectPublicKeyInfo, 0, 0, ((void *)0), &key);
+ }
+}
+static const char cspName[] = "WineCryptTemp";
+static void testPortPublicKeyInfo(void)
+{
+ HCRYPTPROV csp;
+ BOOL ret;
+ CryptAcquireContextA(&csp, cspName, "Microsoft Base Cryptographic Provider v1.0", 1,
+ 0x00000008);
+ ret = CryptAcquireContextA(&csp, cspName, "Microsoft Base Cryptographic Provider v1.0", 1,
+ 0x00000010);
+}
+void func_encode(void)
+{
+ test_encodeCRLDistPoints(0x00000001);
+}
+
+/* { dg-final { scan-tree-dump-times " xxxinfo = {}" 1 "dse1"} } */
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c
new file mode 100644
index 000000000..6e13e1875
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-11.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dse1-details" } */
+
+extern void abort(void);
+void foo(int *p)
+{
+ while (1)
+ {
+ *p = 1;
+ *p = 0;
+ }
+}
+void bar(int *p)
+{
+ *p = 1;
+ *p = 0;
+ abort ();
+}
+
+/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-12.c
new file mode 100644
index 000000000..dd8f69c8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-12.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dse1" } */
+
+void foo (int *p, int b)
+{
+ if (b)
+ *p = 1;
+ *p = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "\\\*p" 1 "dse1" } } */
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-13.c
new file mode 100644
index 000000000..92e0f2b53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-13.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dse1-details" } */
+
+struct A { char c[4]; } a, b;
+
+void
+f1 (void)
+{
+ __builtin_memcpy (&a.c[0], "a", 1);
+ a = b;
+}
+
+void
+f2 (void)
+{
+ __builtin_memcpy (&a.c[0], "a", 1);
+ __builtin_memcpy (&a.c[0], "cdef", 4);
+}
+
+/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-14.c
new file mode 100644
index 000000000..1c74596ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-14.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-dse1-details" } */
+
+struct A { char c[4]; } a, b;
+
+void
+f1 (void)
+{
+ a.c[2] = '\0';
+ __builtin_memset (&a.c[1], 1, 2);
+}
+
+void
+f2 (void)
+{
+ __builtin_memcpy (&a.c[0], "a", 1);
+ __builtin_memcpy (&a, &b, 3);
+}
+
+/* { dg-final { scan-tree-dump-times "Deleted dead store" 2 "dse1" } } */
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-2.c
new file mode 100644
index 000000000..104ef26df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse1" } */
+
+int a, b, c;
+int
+foo ()
+{
+ int *p;
+ if (c)
+ p = &a;
+ else
+ p = &b;
+
+ *p = 3;
+ *p = 4;
+ return *p;
+}
+
+
+/* We should eliminate the first assignment to *p, but not the second. */
+/* { dg-final { scan-tree-dump-times " = 3" 0 "dse1"} } */
+/* { dg-final { scan-tree-dump-times " = 4" 1 "dse1"} } */
+
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-3.c
new file mode 100644
index 000000000..4292f2384
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse1" } */
+
+char Bool_Glob;
+void f(void)
+{
+ Bool_Glob = 0;
+ Bool_Glob = 1;
+}
+
+/* We should eliminate the first assignment to *p, but not the second. */
+/* { dg-final { scan-tree-dump-times "Bool_Glob = 0" 0 "dse1"} } */
+/* { dg-final { scan-tree-dump-times "Bool_Glob = 1" 1 "dse1"} } */
+
+/* { dg-final { cleanup-tree-dump "dse1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-4.c
new file mode 100644
index 000000000..39fc85e69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-4.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse1" } */
+
+foo( int *a)
+{
+ *a = 5;
+ *a = 3;
+}
+
+
+
+
+/* We should eliminate the first assignment to *p, but not the second. */
+/* { dg-final { scan-tree-dump-times "= 5" 0 "dse1"} } */
+/* { dg-final { scan-tree-dump-times "= 3" 1 "dse1"} } */
+
+/* { dg-final { cleanup-tree-dump "dse1" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-5.c
new file mode 100644
index 000000000..76e2004b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-5.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int x;
+
+int
+f1 (int i, int j, int k)
+{
+ int *p = k ? &i : &j;
+ i = 3;
+ *p = 5;
+ x = j;
+}
+
+/* The assignment "i = 3" is partially dead. Our DSE pass doesn't handle
+ detection of partially dead assignments.
+
+ There's two outputs which would indicate that the optimization was
+ performed.
+
+ If we used block copying to detect and eliminate the partially dead
+ store, then we should see an assignment "i = 5" somewhere in the
+ dump file.
+
+ Another approach would be to redirect the path from the true arm
+ of the first conditional so that it reaches the statement *p = 5
+ rather than i = 3. */
+
+/* { dg-final { scan-tree-dump-times "i = 5" 1 "optimized" { xfail *-*-* }} } */
+/* { dg-final { scan-tree-dump-times "<L.*>:;\[\n\t \]*\\*p = 5" 1 "optimized" { xfail *-*-*}} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-6.c
new file mode 100644
index 000000000..3d020067c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-6.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse1" } */
+
+int foo11 (int c)
+{
+ static int local1, local2;
+ local1 = 0;
+ local2 += c;
+ local1 = 2;
+ local2++;
+ return local1 + local2;
+}
+
+/* There should only be one assignment to local1 and local2. */
+/* { dg-final { scan-tree-dump-times "local1 = " 1 "dse1"} } */
+/* { dg-final { scan-tree-dump-times "local2 = " 1 "dse1"} } */
+
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-7.c
new file mode 100644
index 000000000..77e4a6246
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-7.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse1" } */
+
+int glob1, glob2;
+
+int foo1 (void)
+{
+ glob1 = 0;
+ glob2 = 1;
+ glob1 = 2;
+ glob2 = 3;
+ return glob1 + glob2;
+}
+
+
+
+/* There should only be one assignment to glob1 and glob2, the final
+ return statement should just return a constant. */
+/* { dg-final { scan-tree-dump-times "glob1 = " 1 "dse1"} } */
+/* { dg-final { scan-tree-dump-times "glob2 = " 1 "dse1"} } */
+/* { dg-final { scan-tree-dump-times "return 5" 1 "dse1"} } */
+
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-8.c
new file mode 100644
index 000000000..de1d5bb62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-8.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dce -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dominator-opts" } */
+
+/* This caused the compiler to enter an infinite loop if copies are not
+ fully propagated. The options are to disable copy propagation and
+ thus expose the bug. */
+
+int foo (void);
+
+struct A {
+ struct B {
+ struct B *n;
+ } *p;
+};
+
+static inline void baz (struct A *a)
+{
+ a->p = a->p->n;
+}
+
+void bar (struct A a)
+{
+ while (foo ())
+ baz (&a);
+ while (foo ());
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-9.c
new file mode 100644
index 000000000..4cb67f0ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-9.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dse1-vops" } */
+
+struct { int a, b; } soup1, soup2;
+foo ()
+{
+ soup1 = soup2;
+ soup1.a = 66;
+ soup1.b = 77;
+}
+
+/* We should eliminate the first assignment. */
+/* { dg-final { scan-tree-dump-times "VDEF" 2 "dse1" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "dse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c
new file mode 100644
index 000000000..058d33737
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+/* From PR27090. */
+
+int f(int *a)
+{
+ int t = *a;
+ unsigned *b = (unsigned *)a;
+ int *c = (int*)b;
+ return *c + t;
+}
+
+/* { dg-final { scan-tree-dump "Replaced \\\*\[ac\]_\[^\n\].*with t_" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c
new file mode 100644
index 000000000..34217a029
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-10.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+union loc { unsigned reg; signed offset; };
+void __frame_state_for (volatile char *state_in, int x)
+{
+ /* We should move all the loads out of this loop. Right now, we only
+ move one. It takes two insertions because we insert a cast. */
+ union loc fs;
+ int reg;
+ for (;;) {
+ switch (x) {
+ case 0:
+ *state_in = fs.reg;
+ case 1:
+ *state_in = fs.offset;
+ }
+ }
+}
+
+/* This is a weird testcase. It should need PPRE to hoist the loop
+ invariants and the volatileness of state_in prevents DSE of the
+ first store. Thus, this is XFAILed. */
+
+/* { dg-final { scan-tree-dump "Insertions: 2" "pre" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-11.c
new file mode 100644
index 000000000..7bef07caf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-11.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+struct
+{
+ int x;
+ int y;
+} S[100];
+
+int z[100];
+
+int
+foo (int y)
+{
+ int x;
+
+ S[5].x = 4;
+ S[5].y = 0;
+
+ x = S[5].x;
+
+ return (x);
+}
+
+/* { dg-final { scan-tree-dump "Replaced S\\\[5\\\].x with 4" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-12.c
new file mode 100644
index 000000000..7bef07caf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-12.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+struct
+{
+ int x;
+ int y;
+} S[100];
+
+int z[100];
+
+int
+foo (int y)
+{
+ int x;
+
+ S[5].x = 4;
+ S[5].y = 0;
+
+ x = S[5].x;
+
+ return (x);
+}
+
+/* { dg-final { scan-tree-dump "Replaced S\\\[5\\\].x with 4" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
new file mode 100644
index 000000000..cfb72b8bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-aliasing -fno-tree-sra -fdump-tree-fre1-details" } */
+
+/* Should be optimized, propagating &a into (*p)[i]. */
+
+/* For this testcase we need TBAA to work. */
+
+struct Foo
+{
+ void *data;
+ int size;
+};
+void foo(double (*q)[4], struct Foo *tmp1)
+{
+ double a[4];
+ int i;
+ tmp1->data = &a;
+ tmp1->size = 4;
+ for (i=0; i<4; ++i)
+ {
+ double (*p)[4] = tmp1->data;
+ (*p)[i] = (*q)[i];
+ }
+}
+
+/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data with &a" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
new file mode 100644
index 000000000..2b677d5b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */
+
+/* Should be optimized, propagating &a into (*p)[i]. */
+
+struct Foo
+{
+ void *data;
+ double size;
+};
+void bar(double *);
+void foo(double (*q)[4])
+{
+ struct Foo tmp1;
+ double a[4];
+ int i;
+ tmp1.data = &a;
+ tmp1.size = 4;
+ for (i=0; i<4; ++i)
+ {
+ double (*p)[4] = tmp1.data;
+ (*p)[i] = (*q)[i];
+ /* We want a PHI for the VOP for accessing tmp1.data, so place
+ this store to tmp1 here. */
+ tmp1.size -= 1.0;
+ }
+ bar(a);
+}
+
+/* { dg-final { scan-tree-dump "Replaced tmp1.data with &a" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-15.c
new file mode 100644
index 000000000..f24d0f6ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-15.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */
+
+/* Should be optimized, propagating &a into (*p)[i]. */
+
+struct Foo
+{
+ void *data;
+ double size;
+};
+void bar(double *);
+void foo(double (*q)[4])
+{
+ struct Foo tmp1;
+ double a[4];
+ int i;
+ tmp1.data = &a;
+ for (i=0; i<4; ++i)
+ {
+ double (*p)[4] = tmp1.data;
+ (*p)[i] = (*q)[i];
+ /* We want a PHI for the VOP for accessing tmp1.data, so place
+ this store to tmp1 here. */
+ tmp1.size -= 1.0;
+ }
+ bar(a);
+}
+
+/* { dg-final { scan-tree-dump "Replaced" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c
new file mode 100644
index 000000000..fa5f3719a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1" } */
+
+/* FRE should be able to combine i and j and perform simplification
+ on the condition. */
+
+extern void link_error (void);
+int i;
+int foo(int b, int c)
+{
+ i = b + 1;
+ int j = i - 1;
+ if (b != j)
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c
new file mode 100644
index 000000000..01f57ed7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details -fno-tree-sra" } */
+
+struct Bar {
+ int dom;
+};
+struct Foo {
+ struct Bar doms[3];
+};
+
+int foo(int i, int j, int k)
+{
+ struct Foo f;
+
+ f.doms[0].dom = i;
+ f.doms[1].dom = j;
+ f.doms[2].dom = k;
+ return f.doms[0LL].dom;
+}
+
+/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-18.c
new file mode 100644
index 000000000..986fe0781
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-18.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1" } */
+
+struct a
+{
+ union
+ {
+ int a;
+ int b;
+ };
+ union
+ {
+ int c;
+ int d;
+ };
+};
+
+int f(struct a *c)
+{
+ int d = c->a;
+ c->c = 1;
+ return c->a + d;
+}
+
+/* We should have CSEd the load from c->a. */
+
+/* { dg-final { scan-tree-dump-times "c_.*\\\.a" 1 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-19.c
new file mode 100644
index 000000000..c121832de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-19.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1" } */
+
+struct a
+{
+ union
+ {
+ int a;
+ int b;
+ };
+ union
+ {
+ int c;
+ int d;
+ };
+ int e;
+};
+
+int f(struct a *c)
+{
+ int d;
+ c->e = 2;
+ d = c->a;
+ c->c = 1;
+ return c->a + d;
+}
+
+/* We should have CSEd the load from c->a. */
+
+/* { dg-final { scan-tree-dump-times "c_.*\\\.a" 1 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-2.c
new file mode 100644
index 000000000..f85c06139
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-forwprop -fdump-tree-fre1-details" } */
+
+/* From PR14287. */
+
+short g, h;
+
+void
+foo (long a)
+{
+ short b = a & 3;
+ long c = b;
+ g = c;
+ h = c;
+}
+
+/* { dg-final { scan-tree-dump "Replaced \\\(short int\\\) c_.*with b_" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-20.c
new file mode 100644
index 000000000..f73ad36c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-20.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int i, j;
+int foo(int b)
+{
+ j = 0;
+ if (b)
+ goto L2;
+L1:
+ i = i + 1;
+L2:
+ i = i + 1;
+ if (i == 1)
+ goto L1;
+ return j;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c
new file mode 100644
index 000000000..219c0a926
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-21.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1" } */
+
+struct f {
+ float a;
+ float b;
+ float c;
+ float d;
+};
+
+struct f a;
+
+void h(float, float, float, float);
+
+void g(void)
+{
+ float a1 = a.a, b = a.b, c = a.c, d = a.d;
+ a.a = a1;
+ a.b = b;
+ a.c = c;
+ a.d = d;
+ h(a1, b, c, d);
+}
+
+/* { dg-final { scan-tree-dump-not "a\\\.? = " "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-22.c
new file mode 100644
index 000000000..3504d1041
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-22.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1" } */
+
+int i;
+int foo (void)
+{
+ int j;
+ i = j;
+ return i;
+}
+
+/* We should eliminate the redundant load of i. */
+
+/* { dg-final { scan-tree-dump-not "= i;" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-23.c
new file mode 100644
index 000000000..f21360824
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-23.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1" } */
+
+int f(int t, int a, int b)
+{
+ int c, d;
+ if (t)
+ {
+ c = a;
+ d = a;
+ }
+ else
+ {
+ c = b;
+ d = b;
+ }
+ return c+d;
+}
+
+/* { dg-final { scan-tree-dump-times "PHI" 1 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c
new file mode 100644
index 000000000..c68321879
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-24.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1" } */
+
+int foo(void)
+{
+ int a[16] = {};
+ return a[3];
+}
+
+int bar(void)
+{
+ int a[16];
+ __builtin_memset (a, 0, sizeof(a));
+ return a[3];
+}
+
+struct X { int i; };
+int baz(void)
+{
+ struct X a,b;
+ a.i = 0;
+ b = a;
+ return b.i;
+}
+
+int bazzoo (void)
+{
+ struct X b, a = {};
+ b = a;
+ return b.i;
+}
+
+/* { dg-final { scan-tree-dump-times "= 0;" 5 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-25.c
new file mode 100644
index 000000000..e7723f9bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-25.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1" } */
+
+struct X { int i; int j; };
+void bar (struct X *);
+int foo (struct X *p)
+{
+ struct X x;
+ p->i = 1;
+ x = *p;
+ x.j = 2;
+ return p->i - x.i;
+}
+
+/* We should optimize this to return 0. */
+
+/* { dg-final { scan-tree-dump "= 0;" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c
new file mode 100644
index 000000000..81d9ea0fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-26.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */
+
+union U {
+ float f;
+ int i;
+};
+
+int foo (union U *p)
+{
+ union U u;
+ p->f = 0.0;
+ u = *p;
+ return u.i;
+}
+
+/* avr has 16 bit int and 32 bit float */
+/* { dg-final { scan-tree-dump "Replaced u.i with 0 in" "fre1" {xfail avr-*-* } } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-27.c
new file mode 100644
index 000000000..ba0710171
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-27.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+int *q;
+void __attribute__((noinline))
+bar (void)
+{
+ *q = 1;
+}
+int foo(int which_p)
+{
+ int x = 0;
+ int *i,*j;
+ int **p;
+ if (which_p)
+ p = &i;
+ else
+ p = &j;
+ *p = &x;
+ bar ();
+ return x;
+}
+
+/* { dg-final { scan-tree-dump "Replaced x with 0" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c
new file mode 100644
index 000000000..6813b4323
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-3.c
@@ -0,0 +1,22 @@
+/* This test requires:
+
+ TRULY_NOOP_TRUNCATION (sizeof (int) * CHAR_BIT,
+ sizeof (long long) * CHAR_BIT)
+
+ When the condition is true, we distribute "(int) (a + b)" as
+ "(int) a + (int) b", otherwise we keep the original. */
+/* { dg-do compile { target { { ! mips64 } && { ! spu-*-* } } } } */
+/* { dg-options "-O -fno-tree-forwprop -fwrapv -fdump-tree-fre1-details" } */
+
+/* From PR14844. */
+
+int
+foo (int a, int b)
+{
+ long long aa = a;
+ long long bb = b;
+ return aa + bb;
+}
+
+/* { dg-final { scan-tree-dump "Replaced \\\(int\\\) aa_.*with a_" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-30.c
new file mode 100644
index 000000000..bfbef804d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-30.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffinite-math-only -fdump-tree-optimized" } */
+
+float foo(float x, float y, float z)
+{
+ float a = __builtin_fmaf (x, y, z);
+ float b = __builtin_fmaf (x, y, z);
+ return a - b;
+}
+
+/* { dg-final { scan-tree-dump "return 0" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-31.c
new file mode 100644
index 000000000..bddf78ef2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-31.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
+
+typedef double d128 __attribute__((vector_size(16)));
+typedef float f128 __attribute__((vector_size(16)));
+typedef short s128 __attribute__((vector_size(16)));
+typedef char c256 __attribute__((vector_size(32)));
+
+d128 d;
+f128 f;
+s128 s;
+c256 c;
+
+void test1 (double x)
+{
+ d = (d128){x + x, x + x};
+ d = (d128){x + x, x + x};
+}
+
+void test2 (float x)
+{
+ f = (f128){x + x, x + x, x + x, x + x};
+ f = (f128){x + x, x + x, x + x, x + x};
+}
+
+void test3 (short x)
+{
+ s = (s128){x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x};
+ s = (s128){x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x};
+}
+
+void test4 (unsigned char x)
+{
+ c = (c256){x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x,
+ x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x,
+ x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x,
+ x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x};
+ c = (c256){x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x,
+ x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x,
+ x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x,
+ x + x, x + x, x + x, x + x, x + x, x + x, x + x, x + x};
+}
+
+/* { dg-final { scan-tree-dump-times "Replaced \{" 4 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Deleted redundant store" 4 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-32.c
new file mode 100644
index 000000000..537fd5a6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-32.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+_Complex float
+foo (_Complex float x)
+{
+ float r = __real x;
+ float i = __imag x;
+ _Complex float z;
+ __real z = r;
+ __imag z = i;
+ return z;
+}
+
+_Complex float
+bar (_Complex float x)
+{
+ float r = __real x;
+ float i = __imag x;
+ _Complex float z = x;
+ __real z = r;
+ __imag z = i;
+ return z;
+}
+
+/* We should CSE all the way to replace the final assignment to z with x. */
+/* { dg-final { scan-tree-dump-times "with x_1\\\(D\\\) in z" 3 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-33.c
new file mode 100644
index 000000000..ead6a183d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-33.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
+
+#define vector __attribute__((vector_size(16) ))
+
+struct {
+ float i;
+ vector float global_res;
+} s;
+float x;
+int main(int argc)
+{
+ vector float res;
+ res = (vector float){1.0f,2.0f,3.0f,5.0f};
+ s.global_res = res;
+ x = *((float*)&s.global_res + 1);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Replaced BIT_FIELD_REF.*with 2" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-34.c
new file mode 100644
index 000000000..f3cefa583
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-34.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
+
+#define vector __attribute__((vector_size(16) ))
+
+struct {
+ float i;
+ vector float global_res;
+} s;
+float foo(float f)
+{
+ vector float res = (vector float){0.0f,f,0.0f,1.0f};
+ s.global_res = res;
+ return *((float*)&s.global_res + 1);
+}
+
+/* { dg-final { scan-tree-dump "Replaced BIT_FIELD_REF.*with f" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-35.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-35.c
new file mode 100644
index 000000000..dfbd7c1bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-35.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+struct s { _Complex float i; };
+void g(struct s *);
+
+float a1 (float dd)
+{
+ struct s sv;
+ sv.i = dd;
+ float d = __real__ sv.i;
+ g(&sv);
+ return d;
+}
+
+/* { dg-final { scan-tree-dump "Replaced REALPART_EXPR.*with dd" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-36.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-36.c
new file mode 100644
index 000000000..a8a2dbaad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-36.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+extern int opening;
+extern int middle_game;
+int s;
+extern int d[1];
+void PreEvaluate(int wtm)
+{
+ int i, j;
+ if (opening) {
+ d[0]=1;
+ }
+ else if (middle_game) {
+ d[0]=-1;
+ }
+ if (4 != opening) {
+ return;
+ }
+ s = 1;
+}
+
+/* We should be able to CSE the second load of opening. */
+
+/* { dg-final { scan-tree-dump "Replaced opening" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-37.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-37.c
new file mode 100644
index 000000000..bd4c5ef8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-37.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1" } */
+
+int a[256];
+int *b, *c;
+void foo (int i, int j)
+{
+ b = &a[i+j];
+ c = &a[i+j];
+}
+
+/* We should remove the redundant address computation. */
+
+/* { dg-final { scan-tree-dump-times " = &a" 1 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-38.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-38.c
new file mode 100644
index 000000000..2b342db52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-38.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1" } */
+
+struct S { int i; int j; };
+
+struct U
+{
+ struct S a[10];
+} u;
+
+int foo (int n, int i, int j)
+{
+ u.a[n].i = i;
+ u.a[n].j = j;
+ return u.a[n].i;
+}
+
+/* We should remove the redundant load. */
+
+/* { dg-final { scan-tree-dump-not "= u.a\\\[n_2\\(D\\)\\\].i" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c
new file mode 100644
index 000000000..96738305b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-4.c
@@ -0,0 +1,15 @@
+/* If the target returns false for TARGET_PROMOTE_PROTOTYPES, then there
+ will be no casts for FRE to eliminate and the test will fail. */
+/* { dg-do compile { target i?86-*-* x86_64-*-* hppa*-*-* mips*-*-* m68k*-*-* } } */
+/* { dg-options "-O -fno-tree-forwprop -fdump-tree-fre1-details" } */
+
+/* From PR21608. */
+
+static inline char wrap(char f) { return f; }
+char bar(char f)
+{
+ return wrap(f);
+}
+
+/* { dg-final { scan-tree-dump "Replaced \\\(char\\\) .*with " "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c
new file mode 100644
index 000000000..e6010ca03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-5.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-forwprop -fdump-tree-fre1-details" } */
+
+/* From PR19792. */
+
+int
+bar (unsigned int t)
+{
+ int a = t;
+ return a == t;
+}
+
+/* { dg-final { scan-tree-dump "Replaced \\\(unsigned int\\\) a_.*with t_" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c
new file mode 100644
index 000000000..18a9d9b89
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-6.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+ int i; int foo(void) { i = 2; int j = i * 2; int k = i + 2; return j == k; }
+/* { dg-final { scan-tree-dump-times "Replaced " 6 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c
new file mode 100644
index 000000000..a758efe5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details -fdump-tree-optimized" } */
+#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__)
+typedef int intflt;
+#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__)
+typedef long intflt;
+#else
+#error Add target support here for type that will union float size
+#endif
+
+struct X {
+ int i;
+ union {
+ intflt j;
+ intflt k;
+ float f;
+ } u;
+};
+
+intflt foo(intflt j)
+{
+ struct X a;
+
+ a.u.j = j;
+ a.u.f = a.u.f;
+ a.u.f = a.u.f;
+ a.u.j = a.u.j;
+ a.u.f = a.u.f;
+ return a.u.k;
+}
+
+/* { dg-final { scan-tree-dump-times "Inserted pretmp" 1 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Replaced a.u.f with pretmp" 3 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Replaced a.u.k with j" 1 "fre1" } } */
+/* { dg-final { scan-tree-dump "= VIEW_CONVERT_EXPR<float>\\\(j_" "fre1" } } */
+/* { dg-final { scan-tree-dump "return j" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c
new file mode 100644
index 000000000..d6ab2ef24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-details" } */
+#if (__SIZEOF_INT__ == __SIZEOF_FLOAT__)
+typedef int intflt;
+#elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__)
+typedef long intflt;
+#else
+#error Add target support here for type that will union float size
+#endif
+union U {
+ intflt i;
+ float f;
+};
+intflt foo(int i, int b)
+{
+ union U u;
+ if (b)
+ {
+ i = i << 2;
+ u.i = i;
+ return u.f;
+ }
+ else
+ {
+ i = i << 2;
+ u.i = i;
+ return u.f;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Replaced u.f with pretmp" 2 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Inserted pretmp" 2 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c
new file mode 100644
index 000000000..d3986f5ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-sra -fdump-tree-fre1-stats" } */
+
+union loc {
+ unsigned reg;
+ signed offset;
+};
+void __frame_state_for2 (volatile char *state_in)
+{
+ union loc fs;
+ {
+ *state_in = fs.reg;
+ *state_in = fs.offset;
+ }
+}
+void __frame_state_for1 (volatile char *state_in)
+{
+ union loc fs;
+ for (;;)
+ {
+ *state_in = fs.offset;
+ *state_in = fs.reg;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 2 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Insertions: 1" 2 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-1.c
new file mode 100644
index 000000000..20854813d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+/* Testcase for PR31657. */
+
+int foo (int x, int a, int b)
+{
+ int c = 1 << a;
+ if (x & c)
+ if (x & (1 << b))
+ /* returning 1 causes phiopt to trigger in */
+ return 2;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "\\|" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-10.c
new file mode 100644
index 000000000..c2b1c19d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-10.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+/* Testcase for PR31657. */
+
+int f(int x, int a, int b)
+{
+ int t = 0;
+ int c = 1 << a;
+ if (!(x & 1))
+ t = 0;
+ else
+ if (x & (1 << 2))
+ t = 3;
+ else
+ t = 0;
+ return t;
+}
+/* { dg-final { scan-tree-dump "& 5" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-11.c
new file mode 100644
index 000000000..d024df85a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-11.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+/* Testcase for PR31657. */
+int g(void);
+int f(int x, int a, int b)
+{
+ int t = 0;
+ int c = 1 << a;
+ if (!(x & 1))
+ t = 0;
+ else
+ if (x & (1 << 2))
+ t = g();
+ else
+ t = 0;
+ return t;
+}
+
+/* { dg-final { scan-tree-dump "& 5" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-12.c
new file mode 100644
index 000000000..5893ba7be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-12.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-vrp -fdump-tree-optimized" } */
+
+/* Testcase for PR31657. */
+
+int f(int x, int a, int b)
+{
+ int t = 0;
+ int c = 1 << a;
+ if (!(x & 1))
+ t = 0;
+ else
+ if (x & (1 << 2))
+ t = 3;
+ else
+ t = 0;
+ return t;
+}
+/* { dg-final { scan-tree-dump "& 5" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-13.c
new file mode 100644
index 000000000..19f892eaa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-13.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+/* { dg-additional-options "-mbranch-cost=2" { target { i?86-*-* x86_64-*-* mips*-*-* s390*-*-* avr*-*-* } } } */
+
+_Bool f1(_Bool a, _Bool b)
+{
+ if (a)
+ {
+ if (b)
+ return 1;
+ else
+ return 0;
+ }
+ return 0;
+}
+
+
+/* For LOGICAL_OP_NON_SHORT_CIRCUIT, this should be optimized
+ into return a & b;, with no ifs. */
+/* { dg-final { scan-tree-dump-not "if" "optimized" { target { i?86-*-* x86_64-*-* mips*-*-* s390*-*-* avr*-*-* } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c
new file mode 100644
index 000000000..dab30addd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+/* Testcase for PR31657. */
+
+int foo (int x, int a, int b)
+{
+ /* if ((x & a) || (x & b)) */
+ if (x & a)
+ goto doit;
+ if (x & b)
+ goto doit;
+
+ /* else */
+ return 0;
+
+ /* then - returing 1 causes phiopt to trigger */
+doit:
+ return 2;
+}
+
+/* { dg-final { scan-tree-dump "\\|" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-3.c
new file mode 100644
index 000000000..79fec8ba9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-3.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+/* Testcase extracted from PR15353. */
+
+int foo (int x, int a)
+{
+ /* if ((x > a) || (x == a)) */
+ if (x > a)
+ goto doit;
+ if (x == a)
+ goto doit;
+
+ /* else */
+ return 0;
+
+ /* then - returing 1 causes phiopt to trigger */
+doit:
+ return 2;
+}
+
+/* { dg-final { scan-tree-dump ">=" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-4.c
new file mode 100644
index 000000000..da477867e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-4.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+/* Testcase extracted from PR15353. */
+
+extern void bar(void);
+
+void foo (int x, int a)
+{
+ /* if ((x < a) || (x != a)) return; else bar (); */
+ if (x < a)
+ return;
+ if (x != a)
+ return;
+
+ /* else */
+ bar ();
+}
+
+/* { dg-final { scan-tree-dump "!=" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-5.c
new file mode 100644
index 000000000..88bd81e25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-5.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+/* Testcase from PR15353. */
+
+int g(void);
+int h(void);
+int f(int *i, int *j)
+{
+ while (1)
+ {
+ if (*i > *j || *i == *j)
+ break;
+ return g();
+ }
+ return h();
+}
+
+/* { dg-final { scan-tree-dump ">=" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c
new file mode 100644
index 000000000..90abc8deb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ifcombine" } */
+
+void bar (void);
+
+void
+foo1 (unsigned int a)
+{
+ if (a & 1)
+ goto heaven;
+ if (a & 4)
+ goto heaven;
+ return;
+
+ heaven:
+ bar ();
+}
+
+void
+foo2 (unsigned int a)
+{
+ if (a & 1)
+ if (a & 4)
+ goto heaven;
+ return;
+
+ heaven:
+ bar ();
+}
+
+
+/* The special treatment of a & 1 != 0 in fold caused the pattern not
+ to be recognized due to extra conversions inserted. */
+
+/* { dg-final { scan-tree-dump "optimizing bits or bits test" "ifcombine" } } */
+/* { dg-final { scan-tree-dump "optimizing double bit test" "ifcombine" } } */
+/* { dg-final { cleanup-tree-dump "ifcombine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-7.c
new file mode 100644
index 000000000..617cb585a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-7.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ifcombine" } */
+
+int test1 (int i, int j)
+{
+ if (i >= j)
+ if (i != j)
+ return 0;
+ return -1;
+}
+
+/* The above should be optimized to a i > j test by ifcombine. */
+
+/* { dg-final { scan-tree-dump " > " "ifcombine" } } */
+/* { dg-final { cleanup-tree-dump "ifcombine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-8.c
new file mode 100644
index 000000000..a6c4282ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-8.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-trapping-math -fdump-tree-ifcombine" } */
+
+double test1 (double i, double j)
+{
+ if (i >= j)
+ if (i <= j)
+ goto plif;
+ else
+ goto plouf;
+ else
+ goto plif;
+
+plif:
+ return 0;
+plouf:
+ return -1;
+}
+
+/* The above should be optimized to a i > j test by ifcombine.
+ The transformation would also be legal with -ftrapping-math.
+ Instead we get u<=, which is acceptable with -fno-trapping-math. */
+
+/* { dg-final { scan-tree-dump " u<= " "ifcombine" } } */
+/* { dg-final { cleanup-tree-dump "ifcombine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-9.c
new file mode 100644
index 000000000..cb5750227
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-9.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-trapping-math -fdump-tree-ifcombine" } */
+
+void f ();
+enum Sign { NEG=-1, ZERO, POS };
+
+static inline enum Sign sign (double x)
+{
+ if (x > 0) return POS;
+ if (x < 0) return NEG;
+ return ZERO;
+}
+void g (double x)
+{
+ if (sign (x) == NEG) f();
+}
+
+/* The above should be optimized to x < 0 by ifcombine.
+ The transformation would also be legal with -ftrapping-math. */
+
+/* { dg-final { scan-tree-dump "optimizing.* < " "ifcombine" } } */
+/* { dg-final { cleanup-tree-dump "ifcombine" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-1.c
new file mode 100644
index 000000000..89959d84e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
+
+/* { dg-options "-O2 -g -fdump-tree-optimized" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int t (int a, int b)
+{
+ if (a > 0)
+ if (b > 0)
+ return 0;
+ return 1;
+}
+/* { dg-final { scan-tree-dump "\&" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-2.c
new file mode 100644
index 000000000..c6ae111dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
+
+/* { dg-options "-O2 -g -fdump-tree-optimized" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int t (int a, int b)
+{
+ if (a > 0)
+ goto L1;
+ if (b > 0)
+ goto L1;
+ return 0;
+L1:
+ return 1;
+}
+/* { dg-final { scan-tree-dump "\|" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-3.c
new file mode 100644
index 000000000..4b2605e2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-3.c
@@ -0,0 +1,20 @@
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
+
+/* { dg-options "-O2 -g -fdump-tree-optimized" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int t (int a, int b)
+{
+ if (a > 0)
+ goto L1;
+ else
+ goto L2;
+L1:
+ if (b > 0)
+ goto L2;
+ return 5;
+L2:
+ return 6;
+}
+/* { dg-final { scan-tree-dump "\|" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-4.c
new file mode 100644
index 000000000..e38b707c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-4.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
+
+/* { dg-options "-O2 -g -fdump-tree-optimized" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int t (int a, int b)
+{
+ if (a > 0)
+ goto L1;
+ if (b > 0)
+ goto L2;
+L1:
+ return 0;
+L2:
+ return 1;
+}
+/* { dg-final { scan-tree-dump "\&" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-5.c
new file mode 100644
index 000000000..7f80d38f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-5.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
+
+/* { dg-options "-O2 -g -fdump-tree-optimized" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int t (int a, int b, int c)
+{
+ if (a > 0 && b > 0 && c > 0)
+ return 0;
+ return 1;
+}
+/* { dg-final { scan-tree-dump-times "\&" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-6.c
new file mode 100644
index 000000000..15017e8f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-6.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } } || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-* } } } } } */
+
+/* { dg-options "-O2 -g -fdump-tree-optimized" } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */
+
+int t (int a, int b, int c)
+{
+ if (a > 0 || b > 0 || c > 0)
+ return 0;
+ return 1;
+}
+/* { dg-final { scan-tree-dump-times "\\|" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-1.c
new file mode 100644
index 000000000..3952a9a38
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-1.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-lim1" } */
+
+/* This is a variant that does cause fold to place a cast to
+ int before testing bit 1. */
+
+void
+quantum_toffoli (int control1, int control2, int target,
+ unsigned long *state, int size)
+{
+ int i;
+
+ for(i=0; i<size; i++)
+ {
+ if (state[i] & ((unsigned long) 1 << control1))
+ if (state[i] & ((unsigned long) 1 << control2))
+ state[i] ^= ((unsigned long) 1 << target);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "1 <<" 3 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-10.c
new file mode 100644
index 000000000..bc149265d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-10.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim1-details" } */
+
+int *l, *r;
+int test_func(void)
+{
+ int i;
+ int direction;
+ static int pos;
+
+ pos = 0;
+ direction = 1;
+
+ for ( i = 0; i <= 400; i++ )
+ {
+ if ( direction == 0 )
+ pos = l[pos];
+ else
+ pos = r[pos];
+
+ if ( pos == -1 )
+ {
+ pos = 0;
+ direction = !direction;
+ }
+ }
+ return i;
+}
+
+/* { dg-final { scan-tree-dump "Executing store motion of pos" "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-11.c
new file mode 100644
index 000000000..ea91a6123
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-11.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fprofile-arcs -fdump-tree-lim1-details" } */
+
+struct thread_param
+{
+ long* buf;
+ long iterations;
+ long accesses;
+} param;
+
+void access_buf(struct thread_param* p)
+{
+ long i,j;
+ long iterations = p->iterations;
+ long accesses = p->accesses;
+ for (i=0; i<iterations; i++)
+ {
+ long* pbuf = p->buf;
+ for (j=0; j<accesses; j++)
+ pbuf[j] += 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Executing store motion of __gcov0.access_buf\\\[\[01\]\\\] from loop 1" 2 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-2.c
new file mode 100644
index 000000000..2106b6232
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-lim1" } */
+
+/* This is a variant that doesn't cause fold to place a cast to
+ int before testing bit 1. */
+
+void
+quantum_toffoli(int control1, int control2, int target, int *state,
+int size)
+{
+ int i;
+
+ for(i=0; i<size; i++)
+ {
+ if (state[i] & ( 1 << control1))
+ if (state[i] & ( 1 << control2))
+ state[i] ^= ( 1 << target);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "1 <<" 3 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c
new file mode 100644
index 000000000..a81857c0c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-lim1-details" } */
+
+struct { int x; int y; } global;
+void foo(int n)
+{
+ int i;
+ for ( i=0; i<n; i++)
+ global.y += global.x*global.x;
+}
+
+/* { dg-final { scan-tree-dump "Executing store motion of global.y" "lim1" } } */
+/* { dg-final { scan-tree-dump "Moving statement.*global.x.*out of loop 1" "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-5.c
new file mode 100644
index 000000000..4a428515d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-5.c
@@ -0,0 +1,29 @@
+/* { dg-do link } */
+/* { dg-options "-O" } */
+
+/* We should apply store motion here. */
+
+struct BUF1
+{
+ int b1;
+ int b12;
+};
+
+void link_error();
+
+int foo(struct BUF1 * p)
+{
+ int i = 0;
+#if(__SIZEOF_INT__ >= 4)
+ for (i = 0; i < 1024*1024; i++)
+#else
+ for (i = 0; i < 128*128; i++)
+#endif
+ p->b1 = 1;
+
+ if (p->b1 != 1)
+ link_error ();
+ return 0;
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-6.c
new file mode 100644
index 000000000..100a23027
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-6.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim1-details" } */
+
+double a[16][64], y[64], x[16];
+void foo(void)
+{
+ int i, j;
+ for (j = 0; j < 64; ++j)
+ for (i = 0; i < 16; ++i)
+ y[j] = y[j] + a[i][j] * x[i];
+}
+
+/* { dg-final { scan-tree-dump "Executing store motion of y" "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-7.c
new file mode 100644
index 000000000..f8e15f344
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-7.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-lim1-details" } */
+
+extern const int srcshift;
+
+void foo (int *srcdata, int *dstdata)
+{
+ int i;
+
+ for (i = 0; i < 256; i++)
+ dstdata[i] = srcdata[i] << srcshift;
+}
+
+/* { dg-final { scan-tree-dump "Moving statement" "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-9.c
new file mode 100644
index 000000000..c5a67653b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-9.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-lim1-details" } */
+
+void bar (int);
+void foo (int n, int m)
+{
+ unsigned i;
+ for (i = 0; i < n; ++i)
+ {
+ int x;
+ if (m < 0)
+ x = 1+n;
+ else
+ x = m-n;
+ bar (x);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Moving PHI node" 1 "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-1.c
new file mode 100644
index 000000000..3bc0f5e3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+extern int printf (const char *, ...);
+int foo(int argc, char **argv)
+{
+ int a;
+ int b;
+ int c;
+ b = argc + 1;
+ c = argc + 2;
+ a = b + c;
+ if (argc > 2)
+ {
+ c = argc + 3;
+ }
+ printf ("%d, %d\n", a, b + c);
+}
+/* We should eliminate one evaluation of b + c along the main path,
+ causing one reload. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c
new file mode 100644
index 000000000..8cb1bebde
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats -fno-finite-math-only" { target sh*-*-* } } */
+double cos (double);
+void link_error();
+void f(double a)
+{
+ double b = cos (a);
+ double c = cos (a);
+ if (b != c)
+ link_error();
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-11.c
new file mode 100644
index 000000000..26c47b183
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-11.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+double cos (double);
+double f(double a)
+{
+ double b;
+ double c,d;
+ if (a < 2.0)
+ {
+ c = cos (a);
+ }
+ else
+ {
+ c = 1.0;
+ }
+ d = cos (a);
+ return d + c;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-12.c
new file mode 100644
index 000000000..fd80e3d8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-12.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+double cos (double) __attribute__ ((const));
+double sin (double) __attribute__ ((const));
+double f(double a)
+{
+ double b;
+ double c,d;
+ double (*fp) (double) __attribute__ ((const));
+ /* Fully redundant call, but we need a phi node to merge the results. */
+ if (a < 2.0)
+ {
+ fp = sin;
+ c = fp (a);
+ }
+ else
+ {
+ c = 1.0;
+ fp = cos;
+ c = fp (a);
+ }
+ d = fp (a);
+ return d + c;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-13.c
new file mode 100644
index 000000000..dfce46b99
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-13.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+double cos (double) __attribute__ ((const));
+double sin (double) __attribute__ ((const));
+double f(double a)
+{
+ double b;
+ double c,d;
+ double (*fp) (double) __attribute__ ((const));
+ /* Partially redundant call */
+ if (a < 2.0)
+ {
+ fp = sin;
+ c = fp (a);
+ }
+ else
+ {
+ c = 1.0;
+ fp = cos;
+ }
+ d = fp (a);
+ return d + c;
+}
+
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-14.c
new file mode 100644
index 000000000..2371cfa1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-14.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+extern __SIZE_TYPE__ strlen (const char *) __attribute__ ((__pure__));
+
+void
+foo (const char *str)
+{
+ __SIZE_TYPE__ a = strlen (str);
+ __SIZE_TYPE__ b = strlen (str);
+ if (a != b)
+ link_error ();
+}
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c
new file mode 100644
index 000000000..ed3b2f784
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-15.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-expand-details" } */
+
+/* Verify we PRE the strlen call, as strlen("") folds to zero. */
+
+extern __SIZE_TYPE__ strlen (const char *);
+
+__SIZE_TYPE__ mystrlen (const char *s)
+{
+ if (!s)
+ s = "";
+ return strlen(s);
+}
+
+/* { dg-final { scan-rtl-dump "PART.. = 0" "expand" } } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c
new file mode 100644
index 000000000..b087dc1b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-16.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats -std=c99" } */
+int foo(int k, int *x)
+{
+ int j=0;
+ int res = 0;
+ /* We should pull res = *x all the way out of the do-while */
+ do {
+ for (int n=0;n<3;++n);
+ res = *x;
+ } while (++j<k);
+ return res;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c
new file mode 100644
index 000000000..d4274dbe0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-17.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+typedef union {
+ int i;
+ float f;
+} U;
+
+int foo(U *u, int b, int i)
+{
+ u->i = 0;
+ if (b)
+ u->i = i;
+ return u->i;
+}
+
+/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c
new file mode 100644
index 000000000..5e92934f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-18.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-details" } */
+
+struct Bar { int a; int b; };
+struct Foo { int x; struct Bar y; };
+
+int __attribute__((const)) foo (struct Bar);
+
+int bar (int b)
+{
+ struct Foo f;
+ int c;
+ while (b--)
+ {
+ c = foo(f.y);
+ }
+ return c;
+}
+
+/* { dg-final { scan-tree-dump "Replaced foo \\(f.y\\)" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c
new file mode 100644
index 000000000..0fd0dc542
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+struct Loc {
+ int x[3];
+};
+
+void bar (struct Loc *);
+
+int foo (int i, int j, int k, int b)
+{
+ struct Loc IND;
+ int res;
+
+ if (b)
+ {
+ IND.x[0] = i;
+ IND.x[1] = j;
+ IND.x[2] = k-1;
+ }
+ else
+ {
+ IND.x[0] = i;
+ IND.x[1] = j;
+ IND.x[2] = k;
+ }
+
+ /* This should be optimized to i + j + {k, k + 1}. */
+ res = IND.x[0] + IND.x[1] + IND.x[2];
+
+ /* This is just to prevent SRA. */
+ bar (&IND);
+
+ return res;
+}
+
+/* All three loads should be eliminated. */
+/* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c
new file mode 100644
index 000000000..311f12781
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int motion_test1(int data, int data_0, int data_3, int v)
+{
+ int i;
+ int t, u;
+
+ if (data)
+ i = data_0 + data_3;
+ else {
+ v = 2;
+ i = 5;
+ }
+ t = data_0 + data_3;
+ u = i;
+ return v * t * u;
+}
+/* We should eliminate one computation of data_0 + data_3 along the
+ main path. We cannot re-associate v * t * u due to undefined
+ signed overflow so we do not eliminate one computation of v * i along
+ the main path. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c
new file mode 100644
index 000000000..6361b679c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+double pcheck;
+
+void foo(int n, int m, int b)
+{
+ int i, j;
+
+ goto bb18;
+
+start:
+ i = 1;
+ do {
+ j = 1;
+ do {
+ double x = pcheck;
+ x = x + 1;
+ pcheck = x;
+ j = j + 1;
+ } while (j != m);
+ i = i + 1;
+ } while (i != n);
+
+bb18:
+ pcheck = 0.0;
+ goto start;
+}
+
+/* We should have inserted two PHI nodes and the one in the i-loop
+ should have 0.0 in the argument coming from the bb18 block. */
+
+/* { dg-final { scan-tree-dump "New PHIs: 2" "pre" } } */
+/* { dg-final { scan-tree-dump "PHI <.*0\\\.0" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c
new file mode 100644
index 000000000..40bb421f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+long
+NumSift (long *array, unsigned long k)
+{
+ if (array[k] < array[k + 1L])
+ ++k;
+ return array[k];
+}
+
+/* There should be only two loads left. */
+
+/* { dg-final { scan-tree-dump-times "= \\\*\[^\n;\]*;" 2 "pre" { xfail { ! size32plus } } } } */ /* xfail: PR tree-optimization/58169 */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-22.c
new file mode 100644
index 000000000..3a1697e6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-22.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+int foo (int i, int b)
+{
+ int j = 1;
+ if (b)
+ j = i;
+ return j - i;
+}
+
+/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
new file mode 100644
index 000000000..6aeb06af9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+struct { int x; int y; } global;
+void foo(int n)
+{
+ int i;
+ for ( i=0; i<n; i++)
+ global.y += global.x*global.x;
+}
+
+/* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
new file mode 100644
index 000000000..f91f4af74
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+void foo(int *p, double *x, int n)
+{
+ int i;
+ for (i = 0; i < n; ++i)
+ *(x + *p * i) = 0.0;
+}
+
+/* We should remove the unnecessary insertion of a phi-node and
+ _not_ end up using the phi result for replacement *p. */
+
+/* { dg-final { scan-tree-dump-not "= prephitmp" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-25.c
new file mode 100644
index 000000000..32b068275
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-25.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+struct X { int i; };
+
+int foo (int x)
+{
+ struct X a;
+ struct X b;
+ struct X *p;
+ a.i = 1;
+ b.i = 2;
+ if (x)
+ p = &a;
+ else
+ p = &b;
+ return p->i;
+}
+
+/* We should eliminate the load from p for a PHI node with values 1 and 2. */
+
+/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
new file mode 100644
index 000000000..7342c3361
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-fre1-details" } */
+
+typedef union
+{
+ int* data;
+} SA;
+
+typedef struct
+{
+ int reserved;
+ char* array;
+}SB;
+
+typedef struct
+{
+ int status;
+}SC;
+
+void foo(SA* pResult, SB* method, SC* self)
+{
+ if (method->array[0] == 'L' && !self->status && pResult->data != 0)
+ pResult->data = pResult->data;
+}
+
+/* { dg-final { scan-tree-dump "Deleted redundant store" "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-27.c
new file mode 100644
index 000000000..4149bbef6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-27.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+int foo (int i, int j, int b)
+{
+ int res = 0;
+ if (b)
+ res = i/j;
+ /* We should insert the possibly trapping i/j. */
+ res += i/j;
+ return res;
+}
+
+extern void bar (void);
+int foo2 (int i, int j, int b)
+{
+ int res = 0;
+ if (b)
+ res = i/j;
+ /* And here, the possibly not returning call in the same basic-block
+ comes after the trapping i/j. */
+ res += i/j;
+ bar ();
+ return res;
+}
+
+/* { dg-final { scan-tree-dump-times "# prephitmp" 2 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c
new file mode 100644
index 000000000..55887a694
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-28.c
@@ -0,0 +1,21 @@
+/* PR37997 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-details" } */
+
+int foo (int i, int b, int result)
+{
+ int mask;
+ if (b)
+ mask = -2;
+ else
+ mask = 0;
+ result = i + 1;
+ result = result & mask;
+ return result;
+}
+
+/* We should insert i + 1 into the if (b) path as well as the simplified
+ i + 1 & -2 expression. And do replacement with two PHI temps. */
+
+/* { dg-final { scan-tree-dump-times "with prephitmp" 2 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-29.c
new file mode 100644
index 000000000..f2d2c4107
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-29.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-details" } */
+
+int flag, hoist, y, z;
+
+void
+foo (void)
+{
+ if (flag)
+ y = hoist + 4;
+ else
+ flag = 888;
+ z = hoist + 4;
+ bark ();
+}
+
+/* We should see the partial redundancy of hoist + 4, not being confused
+ about bark () possibly clobbering hoist. */
+
+/* { dg-final { scan-tree-dump "Replaced hoist" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c
new file mode 100644
index 000000000..3925f7529
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+unsigned foo1 (unsigned a, unsigned b)
+{
+ unsigned i, j, k;
+ for (i = 0; i != a; i++)
+ {
+ j += 4*b;
+ k += 4*a;
+ }
+ return j + k;
+}
+/* We should eliminate both 4*b and 4*a from the main body of the loop */
+/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-30.c
new file mode 100644
index 000000000..91e0e8936
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-30.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32 } */
+/* { dg-options "-O2 -fdump-tree-pre-details" } */
+
+int f;
+int g;
+unsigned int
+foo (int b, int x)
+{
+ if (b)
+ x = *(int *)&f;
+ g = x;
+ return *(unsigned int*)&f;
+}
+float
+bar (int b, int x)
+{
+ if (b)
+ x = *(int *)&f;
+ g = x;
+ return *(float *)&f;
+}
+
+/* We should see the partial redundant loads of f even though they
+ are using different types (of the same size). */
+
+/* { dg-final { scan-tree-dump-times "Replaced MEM" 2 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-31.c
new file mode 100644
index 000000000..2094de4ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-31.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+typedef struct {
+ unsigned int key;
+} S;
+typedef struct s1 {
+ unsigned int key;
+ unsigned int bits;
+ struct s1 *left, *right;
+}S1;
+extern S a[1024];
+static inline int bar( S* p, S1* n )
+{
+ S1 *curr;
+ S1 *next;
+
+ if ( n->left == n )
+ return (int)(p->key == n->key);
+
+ curr = n;
+ next = n->left;
+
+ while (curr->bits > next->bits ) {
+ curr = next;
+ if (p->key & (1 << curr->bits))
+ next = curr->right;
+ else
+ next = curr->left;
+ }
+
+ return (int)(p->key == next->key);
+
+}
+
+int foo (S1 *root, int N)
+{
+ volatile int r;
+ int i,j;
+ for (i=0; i<N; i++)
+ for (j=0;j<1024; j++)
+ r = bar(&a[j], root);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "key" 4 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-4.c
new file mode 100644
index 000000000..274737ac4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-4.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int foo(void)
+{
+ int x, c, y;
+ x = 3;
+ if (c)
+ x = 2;
+ y = x + 1;
+ return y;
+}
+/* We should eliminate the x+1 computation from this routine, replacing
+ it with a phi of 3, 4 */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-5.c
new file mode 100644
index 000000000..d0e985f81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-5.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int
+foo (int i)
+{
+ int a, b;
+ if (i)
+ a = 3, b = 2;
+ else
+ a = 2, b = 3;
+ return a + b;
+}
+/* We should detect that a+b is the same along both edges, and replace it with
+ 5 */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { scan-tree-dump-times "Insertions" 0 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-6.c
new file mode 100644
index 000000000..2811f4379
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-6.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+int foo(int x)
+{
+ int c, y;
+ if (c)
+ x = 2;
+ y = x + 1;
+ return y;
+}
+/* We should eliminate one evaluation of x + 1 along the x = 2 path,
+ causing one elimination. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c
new file mode 100644
index 000000000..bc7ca4e68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */
+int
+foo (int *array)
+{
+ if (array[1] != 0)
+ return array[1];
+ return 0;
+}
+/* We should eliminate one load. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c
new file mode 100644
index 000000000..f08ef7fde
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */
+struct s {
+ int *n;
+};
+
+int
+foo (__SIZE_TYPE__ i, struct s *array)
+{
+ int *p = array[i].n;
+ if (p)
+ {
+ int *q = array[i].n;
+ if (p != q)
+ return 1;
+ }
+ return 0;
+}
+/* We should eliminate two address calculations, and one load. */
+/* We used to eliminate a cast but that was before POINTER_PLUS_EXPR
+ was added. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c
new file mode 100644
index 000000000..4f88624ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre1-stats" } */
+int
+foo (unsigned long a)
+{
+ int b = __builtin_clzl (a);
+ int c = __builtin_clzl (a);
+ if (b == c)
+ return 1;
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "return 0;" 0 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-1.c
new file mode 100644
index 000000000..0cb027222
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-stats" } */
+
+void vnum_test8(int *data)
+{
+ int i;
+ int stop = data[3];
+ int m = data[4];
+ int n = m;
+ for (i=0; i<stop; i++) {
+ int k = data[2];
+ data[k] = 2;
+ data[0] = m - n;
+ k = data[1];
+ m = m + k;
+ n = n + k;
+ }
+}
+/* We should eliminate m - n, and set n = n + k into n = m. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 3" 1 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-2.c
new file mode 100644
index 000000000..b4c3c14a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-stats" } */
+
+int vnum_test8(int *data)
+{
+ int i;
+ int stop = data[3];
+ int m = data[4];
+ int n = m;
+ int p;
+ for (i=0; i<stop; i++) {
+ int k = data[2];
+ data[k] = 2;
+ data[0] = m - n;
+ k = data[1];
+ m = m + k;
+ n = n + k;
+ p = data[0];
+ }
+ return p;
+}
+/* We should eliminate m - n, and set n = n + k into n = m, and
+ set p to 0 */
+/* { dg-final { scan-tree-dump-times "Eliminated: 4" 1 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-3.c
new file mode 100644
index 000000000..fb266bb54
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-3.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-stats" } */
+int main(int argc, char **argv)
+{
+ int *p;
+ int result;
+ *p = 2;
+ if (argc)
+ *p = 2;
+ result = *p;
+ return result;
+}
+/* We should eliminate result = *p by saying it has the value 2. */
+/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c
new file mode 100644
index 000000000..7f0a93297
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sccvn-4.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-stats" } */
+
+int vnum_test8(int *data)
+{
+ int i;
+ int stop = data[3];
+ int m = data[4];
+ int n = m;
+ int p = 0;
+
+ for (i=0; i<stop; i++) {
+ int k = data[2];
+ data[5] = 0;
+ if (i < 30)
+ data[5] = m - n;
+ p = data[5];
+ k = data[1];
+ m = m + k;
+ n = n + k;
+ }
+ return p;
+}
+/* We should eliminate m - n, n + k, set data[5] = 0, eliminate the
+ address arithmetic for data[5], and set p = 0.
+/* { dg-final { scan-tree-dump-times "Eliminated: 5" 1 "fre1"} } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-1.c
new file mode 100644
index 000000000..c3326d27e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sink-stats" } */
+int
+foo (int a, int b, int c)
+{
+ int x = a * b;
+ return c ? x : a;
+}
+/* We should sink the x = a * b calculation into the branch that returns x. */
+/* { dg-final { scan-tree-dump-times "Sunk statements: 1" 1 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-2.c
new file mode 100644
index 000000000..1d54d019e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sink-stats" } */
+int
+bar (int a, int b, int c)
+{
+ int y = a * b;
+ if (c)
+ y = 12;
+ return y;
+}
+/* We should sink the x = a * b calculation into the else branch */
+/* { dg-final { scan-tree-dump-times "Sunk statements: 1" 1 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-3.c
new file mode 100644
index 000000000..fceb509e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sink-stats" } */
+extern void foo(int a);
+int
+main (int argc)
+{
+ int a;
+ a = argc + 1;
+ if (argc + 3)
+ {
+ foo (a);
+ }
+}
+/* We should sink the a = argc + 1 calculation into the if branch */
+/* { dg-final { scan-tree-dump-times "Sunk statements: 1" 1 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-4.c
new file mode 100644
index 000000000..6e1cc50dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-4.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-sink-stats" } */
+extern int foo (int *, int *);
+extern int foo2 (int);
+int
+main (int argc)
+{
+ int a, b, c;
+ b = argc + 1;
+ c = argc + 2;
+ a = b + c;
+ if (argc)
+ {
+ foo (&b, &c);
+ a = b + c;
+ }
+ foo2 (a);
+}
+/* We should sink the first a = b + c calculation into the else branch */
+/* { dg-final { scan-tree-dump-times "Sunk statements: 1" 1 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-5.c
new file mode 100644
index 000000000..f51d485d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-5.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-sink-stats" } */
+
+typedef short int16_t;
+typedef unsigned char uint8_t;
+
+void foo(int16_t runs[], uint8_t alpha[], int x, int count)
+{
+ int16_t* next_runs = runs + x;
+ uint8_t* next_alpha = alpha + x;
+
+ while (x > 0)
+ {
+ int n = runs[0];
+
+ if (x < n)
+ {
+ alpha[x] = alpha[0];
+ runs[0] = (int16_t)(x);
+ runs[x] = (int16_t)(n - x);
+ break;
+ }
+ runs += n;
+ alpha += n;
+ x -= n;
+ }
+
+ runs = next_runs;
+ alpha = next_alpha;
+ x = count;
+
+ for (;;)
+ {
+ int n = runs[0];
+
+ if (x < n)
+ {
+ alpha[x] = alpha[0];
+ break;
+ }
+ x -= n;
+ runs += n;
+ }
+}
+
+/* We should not sink the next_runs = runs + x calculation after the loop. */
+/* { dg-final { scan-tree-dump-times "Sunk statements:" 0 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-6.c
new file mode 100644
index 000000000..70e48121e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-6.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-sink" } */
+
+int foo(int *a, int r)
+{
+ int ret = 0;
+ *a = 1;
+ if (r == 3)
+ *a = 5;
+ else
+ ret = r + 20;
+ return ret;
+}
+
+/* *a = 1 should be sunk to the else block. */
+
+/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-7.c
new file mode 100644
index 000000000..ffee03368
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-7.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-sink" } */
+
+int foo(int *a, int r, short *b)
+{
+ int ret = 0;
+ *a = 1;
+ if (r == 3)
+ *a = 5;
+ else
+ ret = r + 20;
+ *b = 9;
+ return ret;
+}
+
+/* *a = 1 should be sunk to the else block. */
+
+/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-8.c
new file mode 100644
index 000000000..4a575a7a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-8.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-sink" } */
+
+int foo(int *a, int r, short *b)
+{
+ int ret = 0;
+ *a = 1;
+ switch (r)
+ {
+ case 3:
+ *a = 5;
+ break;
+ case 4:
+ case 5:
+ *a = 9;
+ ret = r + 25;
+ break;
+ default:
+ ret = r + 20;
+ }
+ *b = 9;
+ return ret;
+}
+
+/* *a = 1 should be sunk into the default case. */
+
+/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-9.c
new file mode 100644
index 000000000..1a6e2b8d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-9.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-sink" } */
+
+int foo(int *a, int r, int *b)
+{
+ int ret = 0;
+ *a = 1;
+ if (r == 3)
+ {
+ *a = 5;
+ *b = 3;
+ }
+ return ret;
+}
+
+/* *a = 1 should be sunk to the else block. */
+
+/* { dg-final { scan-tree-dump-times "Sinking" 1 "sink" } } */
+/* { dg-final { cleanup-tree-dump "sink" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-1.c
new file mode 100644
index 000000000..aaa3d13ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+static const int conststaticvariable;
+
+int f(void)
+{
+ return conststaticvariable;
+}
+
+/* There should be no reference to conststaticvariable as we should have
+ inlined the 0. */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-2.c
new file mode 100644
index 000000000..29a2dd5cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-2.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+const int conststaticvariable;
+
+int f(void)
+{
+ return conststaticvariable;
+}
+
+/* There should be a reference to conststaticvariable since it may
+ may be overriden at link time. */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized" { xfail { *-*-mingw* *-*-cygwin* } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
new file mode 100644
index 000000000..e187735a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* Skipped on MIPS GNU/Linux target because __PIC__ can be
+ defined for executables as well as shared libraries. */
+/* { dg-skip-if "" { *-*-darwin* hppa*64*-*-* mips*-*-linux* *-*-mingw* } { "*" } { "" } } */
+/* { dg-options "-O2 -fno-common -fdump-tree-optimized" } */
+
+const int conststaticvariable;
+
+int f(void)
+{
+ return conststaticvariable;
+}
+
+/* There should be no reference for nonpic targets to
+ conststaticvariable as we should have inlined the 0. */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 0 "optimized" { target nonpic } } } */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized" { target { ! nonpic } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-4.c
new file mode 100644
index 000000000..c7a0fbd17
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-skip-if "" { *-*-darwin* *-*-mingw* } { "*" } { "" } } */
+/* { dg-options "-O2 -fno-common -fpic -fdump-tree-optimized" } */
+
+const int conststaticvariable;
+
+int f(void)
+{
+ return conststaticvariable;
+}
+
+/* There should be a reference to conststaticvariable since it may
+ may be overriden at run time. */
+/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-vrp-thread-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-vrp-thread-1.c
new file mode 100644
index 000000000..476ee5e94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-vrp-thread-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+
+struct basic_block_def;
+typedef struct basic_block_def *basic_block;
+enum gimple_code
+{
+ LAST_AND_UNUSED_GIMPLE_CODE
+};
+struct omp_region
+{
+ struct omp_region *outer;
+ basic_block cont;
+};
+void
+build_omp_regions_1 (basic_block bb, struct omp_region *parent,
+ unsigned char single_tree, enum gimple_code code)
+{
+ if (code == 25)
+ parent = parent->outer;
+ else if (code == 42)
+ parent->cont = bb;
+ if (single_tree && !parent)
+ return;
+ oof ();
+}
+
+/* ARM Cortex-M defined LOGICAL_OP_NON_SHORT_CIRCUIT to false,
+ so skip below test. */
+/* { dg-final { scan-tree-dump-times "Threaded" 1 "vrp1" { target { ! arm_cortex_m } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-1.c
new file mode 100644
index 000000000..3cba2928f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-stdarg" } */
+
+#include <stdarg.h>
+
+/* This can be handled on all arches. If there is no va_start, registers don't need
+ to be saved. */
+void
+f1 (int i, ...)
+{
+}
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" } } */
+/* { dg-final { cleanup-tree-dump "stdarg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-2.c
new file mode 100644
index 000000000..fe39da352
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-2.c
@@ -0,0 +1,298 @@
+/* First dg-final line after each function is for architectures that use
+ a struct {...} va_list[1] with separate GPR and FPR counters in the
+ structure. Second dg-final line is for architectures that use void *
+ or char * va_list. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-stdarg" } */
+
+#include <stdarg.h>
+
+extern void foo (int, va_list);
+extern void bar (int);
+long x;
+double d;
+va_list gap;
+va_list *pap;
+
+void
+f1 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f2 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ bar (d);
+ x = va_arg (ap, long);
+ bar (x);
+ va_end (ap);
+}
+/* Assume the counters can be number of registers or bytes on 32-bit
+ architecture or bytes on 64-bit architecture. */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save 8 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save 1 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f3 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ d = va_arg (ap, double);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && { powerpc_fprs && ilp32 } } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 0 GPR units and 1 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 8 GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[1-9\]\[0-9\]* GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[1-9\]\[0-9\]* GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[1-9\]\[0-9\]* GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f4 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ x = va_arg (ap, double);
+ foo (i, ap);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f5 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ va_copy (gap, ap);
+ bar (i);
+ va_end (ap);
+ va_end (gap);
+}
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f6 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ bar (d);
+ va_arg (ap, long);
+ va_arg (ap, long);
+ x = va_arg (ap, long);
+ bar (x);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save 24 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save 3 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f7 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ pap = &ap;
+ bar (6);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f8 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ pap = &ap;
+ bar (d);
+ x = va_arg (ap, long);
+ bar (x);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f9 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ __asm __volatile ("" : "=r" (pap) : "0" (&ap));
+ bar (6);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f10 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ __asm __volatile ("" : "=r" (pap) : "0" (&ap));
+ bar (d);
+ x = va_arg (ap, long);
+ bar (x);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f11 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ bar (d);
+ x = va_arg (ap, long);
+ x += va_arg (ap, long);
+ x += va_arg (ap, long);
+ bar (x);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save 24 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save 3 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f12 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ bar (d);
+ va_arg (ap, double);
+ va_arg (ap, double);
+ x = va_arg (ap, double);
+ bar (x);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && { powerpc_fprs && ilp32 } } } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save 24 GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save 0 GPR units and 3 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f13 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ bar (d);
+ x = va_arg (ap, double);
+ x += va_arg (ap, double);
+ x += va_arg (ap, double);
+ bar (x);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && { powerpc_fprs && ilp32 } } } } } */
+/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save 24 GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save 0 GPR units and 3 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f14 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ bar (d);
+ x = va_arg (ap, double);
+ x += va_arg (ap, long);
+ x += va_arg (ap, double);
+ bar (x);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[148\] GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[148\] GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && { powerpc_fprs && ilp32 } } } } } */
+/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save 24 GPR units and 3" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save 1 GPR units and 2 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+inline void __attribute__((always_inline))
+f15_1 (va_list ap)
+{
+ x = va_arg (ap, double);
+ x += va_arg (ap, long);
+ x += va_arg (ap, double);
+}
+
+void
+f15 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ f15_1 (ap);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f15: va_list escapes 0, needs to save \[148\] GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f15: va_list escapes 0, needs to save \[148\] GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && { powerpc_fprs && ilp32 } } } } } */
+/* { dg-final { scan-tree-dump "f15: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f15: va_list escapes 0, needs to save 1 GPR units and 2 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump-not "f15: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump-not "f15: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump-not "f15: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+/* { dg-final { cleanup-tree-dump "stdarg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-3.c
new file mode 100644
index 000000000..d9c55a87e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-3.c
@@ -0,0 +1,193 @@
+/* First dg-final line after each function is for architectures that use
+ a struct {...} va_list[1] with separate GPR and FPR counters in the
+ structure. Second dg-final line is for architectures that use void *
+ or char * va_list. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-stdarg" } */
+
+#include <stdarg.h>
+
+extern void foo (int, va_list);
+extern void bar (int);
+long x;
+va_list gap;
+
+/* If va_list is not local variable, it escapes the function. */
+void
+f1 (int i, ...)
+{
+ va_start (gap, i);
+ x = va_arg (gap, long);
+ va_end (gap);
+}
+/* { dg-final { scan-tree-dump "f1: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f2 (int i, ...)
+{
+ va_start (gap, i);
+ bar (i);
+ va_end (gap);
+}
+/* { dg-final { scan-tree-dump "f2: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+/* tree-stdarg.c only handles va_list variables, not arrays of them or
+ va_list fields embedded in structures. */
+void
+f3 (int i, ...)
+{
+ va_list aps[10];
+ va_start (aps[4], i);
+ x = va_arg (aps[4], long);
+ va_end (aps[4]);
+}
+/* { dg-final { scan-tree-dump "f3: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f4 (int i, ...)
+{
+ va_list aps[10];
+ va_start (aps[4], i);
+ bar (i);
+ va_end (aps[4]);
+}
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f5 (int i, ...)
+{
+ va_list aps[10];
+ va_start (aps[4], i);
+ foo (i, aps[4]);
+ va_end (aps[4]);
+}
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+struct A { int i; va_list g; va_list h[2]; };
+
+void
+f6 (int i, ...)
+{
+ struct A a;
+ va_start (a.g, i);
+ x = va_arg (a.g, long);
+ va_end (a.g);
+}
+/* { dg-final { scan-tree-dump "f6: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f7 (int i, ...)
+{
+ struct A a;
+ va_start (a.g, i);
+ bar (i);
+ va_end (a.g);
+}
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f8 (int i, ...)
+{
+ struct A a;
+ va_start (a.g, i);
+ foo (i, a.g);
+ va_end (a.g);
+}
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f10 (int i, ...)
+{
+ struct A a;
+ va_start (a.h[1], i);
+ x = va_arg (a.h[1], long);
+ va_end (a.h[1]);
+}
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f11 (int i, ...)
+{
+ struct A a;
+ va_start (a.h[1], i);
+ bar (i);
+ va_end (a.h[1]);
+}
+/* { dg-final { scan-tree-dump "f11: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f11: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f12 (int i, ...)
+{
+ struct A a;
+ va_start (a.h[1], i);
+ foo (i, a.h[1]);
+ va_end (a.h[1]);
+}
+/* { dg-final { scan-tree-dump "f12: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f12: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+/* { dg-final { cleanup-tree-dump "stdarg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-4.c
new file mode 100644
index 000000000..5e22b1d9e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-4.c
@@ -0,0 +1,94 @@
+/* First dg-final line after each function is for architectures that use
+ a struct {...} va_list[1] with separate GPR and FPR counters in the
+ structure. Second dg-final line is for architectures that use void *
+ or char * va_list. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-stdarg" } */
+
+#include <stdarg.h>
+
+extern void foo (int, va_list);
+extern void bar (int);
+long x;
+double d;
+
+/* Here va_arg can be executed more than once for one va_start. All GPR
+ registers needs to be saved. */
+void
+f1 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ while (i-- > 0)
+ x = va_arg (ap, long);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save all GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { x32 || { ! { ia32 || llp64 } } } } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save all GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save all GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save all GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes \[01\], needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes \[01\], needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes \[01\], needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f2 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ while (i-- > 0)
+ d = va_arg (ap, double);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save 0 GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { x32 || { ! { ia32 || llp64 } } } } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save 0 GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && { powerpc_fprs && ilp32 } } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save all GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save 0 GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes \[01\], needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes \[01\], needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes \[01\], needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+/* Here va_arg can be executed at most as many times as va_start.
+ Only one GPR needs to be saved. */
+void
+f3 (int i, ...)
+{
+ va_list ap;
+ int j = i;
+ while (j-- > 0)
+ {
+ va_start (ap, i);
+ x = va_arg (ap, long);
+ va_end (ap);
+ bar (x);
+ }
+}
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[148\] GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[148\] GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 8 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 1 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+
+void
+f4 (int i, ...)
+{
+ va_list ap;
+ int j = i;
+ while (j-- > 0)
+ {
+ va_start (ap, i);
+ d = va_arg (ap, double);
+ va_end (ap);
+ bar (d + 2.5);
+ }
+}
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && { powerpc_fprs && ilp32 } } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save 8 GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save 0 GPR units and 1 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+/* { dg-final { cleanup-tree-dump "stdarg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-5.c
new file mode 100644
index 000000000..82352f7c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-5.c
@@ -0,0 +1,119 @@
+/* This test has architecture specific function passing details. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-stdarg" } */
+
+#include <stdarg.h>
+
+extern void foo (int, va_list);
+extern void bar (int);
+struct S1 { int i; double d; int j; double e; } s1;
+struct S2 { double d; long i; } s2;
+int y;
+_Complex int ci;
+_Complex double cd;
+
+/* Here va_arg can be executed more than once for one va_start. */
+void
+f1 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ while (i-- > 0)
+ s1 = va_arg (ap, struct S1);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save all GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save all GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+
+void
+f2 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ while (i-- > 0)
+ s2 = va_arg (ap, struct S2);
+ va_end (ap);
+}
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save all GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save all GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+
+/* Here va_arg can be executed at most as many times as va_start. */
+void
+f3 (int i, ...)
+{
+ va_list ap;
+ int j = i;
+ while (j-- > 0)
+ {
+ va_start (ap, i);
+ s1 = va_arg (ap, struct S1);
+ va_end (ap);
+ bar (s1.i);
+ }
+}
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 32 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 1 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+
+void
+f4 (int i, ...)
+{
+ va_list ap;
+ int j = i;
+ while (j-- > 0)
+ {
+ va_start (ap, i);
+ s2 = va_arg (ap, struct S2);
+ y = va_arg (ap, int);
+ va_end (ap);
+ bar (s2.i);
+ }
+}
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save 16 GPR units and 16 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save 24 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f4: va_list escapes 0, needs to save 2 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+
+void
+f5 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ ci = va_arg (ap, _Complex int);
+ ci += va_arg (ap, _Complex int);
+ va_end (ap);
+ bar (__real__ ci + __imag__ ci);
+}
+/* { dg-final { scan-tree-dump "f5: va_list escapes 0, needs to save 16 GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 0, needs to save 32 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f5: va_list escapes 0, needs to save (4|2) GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+
+void
+f6 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ ci = va_arg (ap, _Complex int);
+ cd = va_arg (ap, _Complex double);
+ va_end (ap);
+ bar (__real__ ci + __imag__ cd);
+}
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save 8 GPR units and 32 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save 32 GPR units and 3" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|2) GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+
+void
+f7 (int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ cd = va_arg (ap, _Complex double);
+ cd += va_arg (ap, _Complex double);
+ va_end (ap);
+ bar (__real__ cd + __imag__ cd);
+}
+/* { dg-final { scan-tree-dump "f7: va_list escapes 0, needs to save 0 GPR units and 64 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 || llp64 } } } } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 0, needs to save 32 GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "f7: va_list escapes 0, needs to save 2 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { cleanup-tree-dump "stdarg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-6.c
new file mode 100644
index 000000000..70cde1b80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/stdarg-6.c
@@ -0,0 +1,36 @@
+/* PR tree-optimization/56205 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-stdarg" } */
+
+#include <stdarg.h>
+
+int a, b;
+char c[128];
+
+static inline void
+foo (int x, char const *y, va_list z)
+{
+ __builtin_printf ("%s %d %s", x ? "" : "foo", ++a, (y && *y) ? "bar" : "");
+ if (y && *y)
+ __builtin_vprintf (y, z);
+}
+
+void
+bar (int x, char const *y, ...)
+{
+ va_list z;
+ va_start (z, y);
+ if (!x && *c == '\0')
+ ++b;
+ foo (x, y, z);
+ va_end (z);
+}
+
+/* { dg-final { scan-tree-dump "bar: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && { ! { ia32 } } } } } } */
+/* { dg-final { scan-tree-dump "bar: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-tree-dump "bar: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "bar: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
+/* { dg-final { scan-tree-dump "bar: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */
+/* { dg-final { scan-tree-dump "bar: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
+/* { dg-final { scan-tree-dump "bar: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
+/* { dg-final { cleanup-tree-dump "stdarg" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/strlen-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/strlen-1.c
new file mode 100644
index 000000000..f6ff3e157
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/strlen-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+extern const unsigned long base;
+static inline void wreg(unsigned char val, unsigned long addr) __attribute__((always_inline));
+static inline void wreg(unsigned char val, unsigned long addr)
+{
+ *((volatile unsigned char *) (__SIZE_TYPE__) (base + addr)) = val;
+}
+void wreg_twice(void)
+{
+ wreg(0, 42);
+ wreg(0, 42);
+}
+
+/* We should not remove the second null character store to (base+42) address. */
+/* { dg-final { scan-tree-dump-times " ={v} 0;" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
new file mode 100644
index 000000000..495b7ba11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1-details" } */
+
+struct S { float f; };
+int __attribute__((noinline))
+foo (float *r, struct S *p)
+{
+ int *q = (int *)&p->f;
+ int i = *q;
+ *r = 0.0;
+ return i + *q;
+}
+
+/* { dg-final { scan-tree-dump "Replaced\[^\n\]*with i_." "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
new file mode 100644
index 000000000..c348bdfe2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1" } */
+
+struct S { unsigned f; };
+
+int
+foo ( struct S *p)
+{
+ int *q = (int *)&p->f;
+ int i = *q;
+ return i + p->f;
+}
+
+
+/* There should only be one load of p->f because fwprop can change
+ *(int *)&p->f into just (int)p->f. */
+/* { dg-final { scan-tree-dump-times "= \[^\n\]*p_.\\\(D\\\)" 1 "fre1" } } */
+/* { dg-final { cleanup-tree-dump "fre1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-1.c
new file mode 100644
index 000000000..e5fe291d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim1-details" } */
+int x; int y;
+struct { int x; int y; } global;
+int foo() {
+ int i;
+ for ( i=0; i<10; i++)
+ y += x*x;
+ for ( i=0; i<10; i++)
+ global.y += global.x*global.x;
+}
+
+/* { dg-final { scan-tree-dump-times "Executing store motion of global.y" 1 "lim1" } } */
+/* XXX: We should also check for the load motion of global.x, but there is no easy way to do this. */
+/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-2.c
new file mode 100644
index 000000000..b4d28257e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-2.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized -fno-tree-sra" } */
+
+/* Even without SRA being enabled, we should be able to eliminate every structure store and load here. */
+extern void foo (const int);
+int main(void)
+{
+ struct a
+ {
+ int e;
+ int f;
+ int g;
+ } a;
+ struct a b;
+ int x, c;
+ a.e = 50;
+ a.f = 9;
+ a.g = a.e * a.f;
+ foo (a.f);
+ foo (a.g);
+ x = a.f;
+ c = a.e;
+ foo (x);
+ foo (c);
+ a.e = 5;
+ a.f = 40;
+ a.g = 90;
+ foo (a.e);
+ foo (a.f);
+ foo (a.g);
+ c = a.f;
+ foo (c);
+ b.e = 9;
+ a.e = b.e + 1 * c;
+ a.f = 30;
+ foo (a.e);
+ foo (a.f);
+ x = a.e * a.f;
+ foo (x);
+
+}
+/* { dg-final { scan-tree-dump-times "a.e" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "a.f" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "a.g" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "b.e" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c
new file mode 100644
index 000000000..a7fcb5bf8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct foo
+{
+ int a;
+ int b;
+} temp;
+/* We should be able to optimize this to return 11. */
+int main(void)
+{
+ temp.a = 5;
+ temp.b = 6;
+ return temp.a + temp.b;
+}
+/* { dg-final { scan-tree-dump-times "return 11" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c
new file mode 100644
index 000000000..422ee2d7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+extern void *alloca (__SIZE_TYPE__);
+int q(int a);
+int *v;
+int
+t(int a)
+{
+ int r,r1;
+ if (a)
+ r1=r = q(a-1);
+ else
+ return 0;
+ /* Dead alloca should not disturb us. */
+ if (r!=r1)
+ v=alloca(r);
+ return r;
+}
+/* { dg-final { scan-tree-dump-times "Found tail call" 1 "tailc"} } */
+/* { dg-final { cleanup-tree-dump "tailc" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c
new file mode 100644
index 000000000..bd9a85354
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+/* Test provided by Richard Earnshaw in PR 14312. */
+
+void bar (int i);
+void baz (int *);
+
+void
+foo (int *x)
+{
+ if (*x < 0)
+ {
+ baz (x);
+ return;
+ }
+ bar (*x);
+}
+
+/* The test has no local call-clobbered variables. Only the memory
+ tag for 'x' is call-clobbered. And since tags are not real
+ variables, they ought to be ignored. There should be two tail
+ calls here. */
+/* { dg-final { scan-tree-dump-times "Found tail call" 2 "tailc"} } */
+/* { dg-final { cleanup-tree-dump "tailc" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-3.c
new file mode 100644
index 000000000..4055bc3f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-3.c
@@ -0,0 +1,28 @@
+/* The return argument needs a type conversion which on some targets
+ (e.g. s390) needs additional code. So it is invalid to do tail
+ call optimization here. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+long long __attribute__((noinline))
+foo ()
+{
+ return 3;
+}
+
+int __attribute__((noinline))
+boo ()
+{
+ return foo ();
+}
+
+int
+main ()
+{
+ if (boo () != 3)
+ abort ();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c
new file mode 100644
index 000000000..e7983da31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+/* PR tree-opt/37024 */
+
+double doubleValue();
+
+long
+longValue ()
+{
+ return (long) doubleValue ();
+}
+
+/* We should not tail call doubleValue in longValue as the mode changes. */
+/* { dg-final { scan-tree-dump-times "Found tail call" 0 "tailc"} } */
+/* { dg-final { cleanup-tree-dump "tailc" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-5.c
new file mode 100644
index 000000000..7aa433ecf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-5.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc" } */
+
+void
+set_integer (void *dest, int value, int length)
+{
+ int tmp = value;
+ __builtin_memcpy (dest, (void *) &tmp, length);
+}
+
+/* { dg-final { scan-tree-dump-not "tail call" "tailc" } } */
+/* { dg-final { cleanup-tree-dump "tailc" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-6.c
new file mode 100644
index 000000000..4997f9b83
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailcall-6.c
@@ -0,0 +1,33 @@
+/* PR tree-optimization/43904. */
+/* { dg-do run } */
+/* { dg-options "-O1 -foptimize-sibling-calls" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort(void);
+
+void *memcpy(void *dest, const void *src, size_t n);
+
+void
+buggy_init(void *ptr, size_t size)
+{
+ const char *str = "Hello world!";
+ memcpy(ptr, &str, size);
+}
+
+void
+expose_bug(void *ptr, size_t size)
+{
+ const char *str;
+ memcpy(&str, ptr, size);
+ if (*str != 'H')
+ abort ();
+}
+
+int
+main()
+{
+ const char *ptr;
+ buggy_init(&ptr, sizeof(ptr));
+ expose_bug(&ptr, sizeof(ptr));
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-1.c
new file mode 100644
index 000000000..c725d7949
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -foptimize-sibling-calls -fdump-tree-tailr1-details" } */
+int
+t(int a)
+{
+ if (a)
+ return t(a-1);
+ else
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-2.c
new file mode 100644
index 000000000..ae2989d76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -foptimize-sibling-calls -fdump-tree-tailr1-details" } */
+int
+t(char *a)
+{
+ static char p[100];
+ if (a)
+ return t(p);
+ else
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c
new file mode 100644
index 000000000..6ab2cd188
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -foptimize-sibling-calls -fdump-tree-tailr1-details" } */
+int
+t(int a)
+{
+ int r;
+ if (a)
+ r = t(a-1);
+ else
+ return 0;
+ if (r)
+ r=r;
+ return r;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-4.c
new file mode 100644
index 000000000..a17573cf2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-4.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -foptimize-sibling-calls -fdump-tree-tailr1-details" } */
+int
+t(int a)
+{
+ int r;
+ if (a&1)
+ r = t(a-1);
+ else if (a)
+ r = t(a-2);
+ else
+ return 0;
+ if (r)
+ r=r;
+ return r;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 2 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-5.c
new file mode 100644
index 000000000..53a2cdb15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-5.c
@@ -0,0 +1,77 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -foptimize-sibling-calls -fdump-tree-optimized" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int sum (int n)
+{
+ if (n == 0)
+ return 0;
+
+ return n + sum (n - 1);
+}
+
+int fac (int n)
+{
+ if (n == 0)
+ return 1;
+
+ return n * fac (n - 1);
+}
+
+int sq_sum (int n)
+{
+ if (n == 0)
+ return 0;
+
+ return n * n + sq_sum (n - 1);
+}
+
+int pow2m1 (int n)
+{
+ if (n == 0)
+ return 0;
+
+ return 2 * pow2m1 (n - 1) + 1;
+}
+
+int fib (int n)
+{
+ if (n <= 1)
+ return 1;
+
+ return fib (n - 2) + fib (n - 1);
+}
+
+int main(void)
+{
+ if (sum (5) != 15)
+ abort ();
+
+ if (fac (5) != 120)
+ abort ();
+
+ if (sq_sum (5) != 55)
+ abort ();
+
+ if (pow2m1 (5) != 31)
+ abort ();
+
+ if (fib (5) != 8)
+ abort ();
+
+ exit (0);
+}
+
+/* There is one call of sum in main and then 2 instances of the word in
+ ;; Function sum (sum) and one in the function header. */
+/* { dg-final { scan-tree-dump-times "\\msum\\M" 4 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "\\mfac\\M" 4 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "\\msq_sum\\M" 4 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "\\mpow2m1\\M" 4 "optimized"} } */
+
+/* There is one recursive call to fib. */
+/* { dg-final { scan-tree-dump-times "\\mfib\\M" 5 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-6.c
new file mode 100644
index 000000000..e994cc424
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-6.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -foptimize-sibling-calls -fdump-tree-tailr1-details" } */
+int
+foo (int a)
+{
+ if (a)
+ return a * (2 * (foo (a - 1))) + a + 1;
+ else
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-7.c
new file mode 100644
index 000000000..875a6aa78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-7.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -foptimize-sibling-calls -fdump-tree-optimized" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int foo (int n)
+{
+ return n == 0 ? 1 : n * (n - foo (n - 1));
+}
+
+int bar (int n)
+{
+ return n == 0 ? 1 : n * (- bar (n - 1));
+}
+
+int baz (int n, int m)
+{
+ return n == 0 ? 100 : (baz (n - 1, m) - m);
+}
+
+int main (void)
+{
+ if (foo (6) != 726)
+ abort ();
+
+ if (bar (7) != -5040)
+ abort ();
+
+ if (baz (10, 5) != 50)
+ abort ();
+
+ exit (0);
+}
+
+/* { dg-final { scan-tree-dump-times "\\mfoo\\M" 4 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "\\mbar\\M" 4 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "\\mbaz\\M" 4 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tree-ssa.exp b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tree-ssa.exp
new file mode 100644
index 000000000..1dd660715
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/tree-ssa.exp
@@ -0,0 +1,36 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/unreachable.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/unreachable.c
new file mode 100644
index 000000000..c4caeaf6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/unreachable.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-optimized" } */
+static void bad_boy()
+{
+}
+int
+main()
+{
+ void *t=(void *)bad_boy;
+ if (!t)
+ return 1;
+ return 0;
+}
+/* { dg-final { scan-tree-dump-not "bad_boy" "optimized" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c
new file mode 100644
index 000000000..12c2b91ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/upcast-1.c
@@ -0,0 +1,12 @@
+/* { do-go compile } */
+/* { dg-options "-fdump-tree-gimple" } */
+
+typedef struct { int i; } Foo;
+Foo foo;
+Foo *bar(void)
+{
+ return (Foo *)&foo.i;
+}
+
+/* { dg-final { scan-tree-dump "&foo;" "gimple" } } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-cunroll.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-cunroll.c
new file mode 100644
index 000000000..dafd44bb9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-cunroll.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+int a[8];
+int t()
+{
+ int i;
+ for (i = 0; i < 3; i++)
+ if (a[i])
+ break;
+ return i;
+}
+/* { dg-final { scan-tree-dump-times "Invalid sum" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c
new file mode 100644
index 000000000..58b26e615
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+typedef struct { unsigned short a; } A;
+
+extern void abort (void);
+extern void exit (int);
+
+void foo (unsigned int x)
+{
+ if (x != 0x800 && x != 0x810)
+ abort ();
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ for (i = 0; i < 2; ++i)
+ foo (((A) { ((!(i >> 4) ? 8 : 64 + (i >> 4)) << 8) + (i << 4) } ).a);
+ exit (0);
+}
+/* { dg-final { scan-tree-dump-times "Invalid sum" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-unroll-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-unroll-1.c
new file mode 100644
index 000000000..a93310249
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-unroll-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-O1 -fprefetch-loop-arrays -march=athlon -fdump-tree-aprefetch-blocks" } */
+
+int a[10000];
+
+int foo(unsigned n)
+{
+ unsigned i, s = 0;
+
+ for (i = 0; i < n; i++)
+ s += a[i];
+
+ return s;
+}
+
+/* We used to make the probability that the body of the loop (unrolled
+ to enable prefetching) is entered 0, which is not correct. */
+
+/* { dg-final { scan-tree-dump-not "Invalid sum" "aprefetch"} } */
+/* { dg-final { scan-tree-dump-not "SUCC: 7 .100.0%" "aprefetch"} } */
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-unswitch-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-unswitch-1.c
new file mode 100644
index 000000000..499b78b01
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/update-unswitch-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -funswitch-loops -fdump-tree-unswitch-blocks" } */
+
+int bla(int p)
+{
+ unsigned i, s = 1;
+
+ for (i = 4; i < 100; i++)
+ {
+ if (p)
+ s += i/2;
+ else
+ s *= i/2;
+ }
+
+ return s;
+}
+
+/* We used to make the probability that the first of the loops created
+ by unswitching is entered 100%, which is not correct. */
+
+/* { dg-final { scan-tree-dump-not "Invalid sum" "unswitch"} } */
+/* { dg-final { scan-tree-dump-not "SUCC: 3 .100.0%" "unswitch"} } */
+/* { dg-final { cleanup-tree-dump "unswitch" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
new file mode 100644
index 000000000..68eab7004
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-gimple" } */
+
+void
+foo (void)
+{
+ int i, a;
+ for (i = 0; i < 10; i++)
+ { a = i; }
+}
+
+/* There should be three gotos in the dump. If one was removed
+ in the loop exit condition, it would be re-introduced during
+ GIMPLE lowering, at the cost of an extra statement, label,
+ and basic block. */
+/* { dg-final { scan-tree-dump-times "goto" 3 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-1.c
new file mode 100644
index 000000000..6fe0e872b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-w -O1 -fdump-tree-gimple" } */
+/* { dg-options "-w -O1 -fdump-tree-gimple -msse" { target { i?86-*-* x86_64-*-* } } } */
+
+
+/* We should be able to produce a BIT_FIELD_REF for each of these vector access. */
+#define vector __attribute__((vector_size(16)))
+float f0(vector float t)
+{
+ return ((float*)&t)[0];
+}
+
+float f1(vector float t)
+{
+ return ((float*)&t)[1];
+}
+
+float f2(vector float t)
+{
+ return ((float*)&t)[2];
+}
+
+float f3(vector float t)
+{
+ return ((float*)&t)[3];
+}
+
+
+/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 4 "gimple"} } */
+
+/* { dg-final { cleanup-tree-dump "gimple" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-2.c
new file mode 100644
index 000000000..2d214df40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-w -O1 -fdump-tree-optimized" } */
+/* { dg-options "-w -O1 -fdump-tree-optimized -msse" { target { i?86-*-* x86_64-*-* } } } */
+
+#define vector __attribute__(( vector_size(16) ))
+
+float f(vector float a, int b, vector float c)
+{
+ vector float dd = c*a;
+ a = (vector float){0,0,0,0};
+ c = (vector float){0,0,0,0};
+ {
+ float d = ((float*)&a)[0];
+ float d1 = ((float*)&c)[0];
+ return d*d1;
+ }
+}
+
+/* We should be able to optimize this to just "return 0.0;" */
+/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "optimized"} } */
+/* { dg-final { scan-tree-dump-times "return 0.0" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-3.c
new file mode 100644
index 000000000..f5e337fb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-3.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-w -O1 -fdump-tree-optimized" } */
+
+#define vector __attribute((vector_size(16) ))
+vector float a;
+
+float f(float b)
+{
+ vector float c = {0, 0, 0, 0};
+ vector float d = {0, 0, 0, 0};
+ d += c;
+ return ((float*)&c)[2];
+}
+
+/* We should be able to optimize this to just "return 0.0;" */
+/* { dg-final { scan-tree-dump-times "BIT_FIELD_REF" 0 "optimized"} } */
+/* { dg-final { scan-tree-dump-times "0\\\.0" 1 "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c
new file mode 100644
index 000000000..018b8cbe3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vector-4.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-w -O1 -fdump-tree-gimple" } */
+
+typedef int SItype __attribute__ ((mode (SI)));
+typedef SItype v4si __attribute__ ((vector_size (16)));
+
+v4si vs (v4si a, v4si b)
+{
+ return __builtin_shuffle (a, b, (v4si) {0, 4, 1, 5});
+}
+
+/* The compound literal should be placed directly in the vec_perm. */
+/* Test is xfailed on 32-bit hppa*-*-* because target-callee-copies. */
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR <a, b, { 0, 4, 1, 5 }>;" 1 "gimple" { xfail { hppa*-*-* && { ! lp64 } } } } } */
+
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp.h b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp.h
new file mode 100644
index 000000000..079013a81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp.h
@@ -0,0 +1,27 @@
+extern void link_error(void);
+
+#define RANGE(name, min, max) \
+ if (name < min || name > max) \
+ return;
+#define ANTI_RANGE(name, min, max) \
+ if (name >= min && name <= max) \
+ return;
+#define MERGE(cond, name1, name2) \
+ if (cond) \
+ name1 = name2;
+#define CHECK_RANGE(expr, min, max) \
+ do { \
+ __typeof__ (expr) v = (expr); \
+ if (v < min) link_error(); \
+ if (v > max) link_error(); \
+ if (v < min || v > max) link_error (); \
+ } while (0)
+#define CHECK_ANTI_RANGE(expr, min, max) \
+ do { \
+ __typeof__ (expr) v = (expr); \
+ if (v >= min) \
+ if (v <= max) \
+ link_error(); \
+ if (v >= min && v <= max) \
+ link_error(); \
+ } while (0)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp01.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp01.c
new file mode 100644
index 000000000..3f8e82061
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp01.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+foo (int *p, int i)
+{
+ int x;
+
+ if (i > 10)
+ {
+ if (p)
+ {
+ x = *p;
+ p = 0;
+ }
+ }
+ else
+ p = 0;
+
+ /* This should be folded to if (1), but only if we insert an
+ assertion on the ELSE edge from the inner 'if (p)'. */
+ if (p == 0)
+ return x + 1;
+
+ return i;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp02.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp02.c
new file mode 100644
index 000000000..56fca9711
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp02.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+struct A
+{
+ int a;
+ int b;
+};
+
+foo (struct A *p, struct A *q)
+{
+ int x = p->a;
+ if (p == q)
+ return q->a;
+
+ /* We should fold this to 'if (1)' but the assertion for 'p == q'
+ was overwriting the assertion 'p != 0' from the first dereference
+ of 'p'. */
+ if (p)
+ return x + p->b;
+}
+/* Target with fno-delete-null-pointer-checks should not fold check */
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp03.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp03.c
new file mode 100644
index 000000000..9b7c08256
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp03.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+struct A
+{
+ int a;
+ int b;
+};
+
+foo (struct A *p, struct A *q)
+{
+ int *r = 0;
+
+ if (p)
+ {
+ if (p == q)
+ {
+ /* This should be folded to 'if (1)' because q is [p, p]
+ and p is ~[0, 0]. */
+ if (q)
+ r = &q->a;
+
+ /* This should be folded to 'if (1)' because q should be
+ ~[0, 0] and thus &q->a should be ~[0, 0]. */
+ if (r)
+ return 5;
+ }
+ }
+
+ return q->a;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate q_.*to 1" 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate r_.*to 1" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp04.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp04.c
new file mode 100644
index 000000000..bf5d683cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp04.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+foo (int a, int b)
+{
+ if (a == b)
+ /* This should be folded to if (1) */
+ if (a == b)
+ return a + b;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate a_.*to 1" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp05.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp05.c
new file mode 100644
index 000000000..7b8b61b44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp05.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
+
+
+inline int ten()
+{
+ return 10;
+}
+inline int zero()
+{
+ return 0;
+}
+
+foo (int k, int j)
+{
+ if (k >= ten())
+ {
+ if (j > k)
+ {
+ /* We should fold this to if (1). */
+ if (j > zero())
+ return j;
+ }
+ }
+
+ return j+1;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate j_.*to 1" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp06.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp06.c
new file mode 100644
index 000000000..cb6df0dca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp06.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+foo (int i, int j, int a)
+{
+ if (i >= 10)
+ if (i <= 30)
+ if (i == j)
+ {
+ a--;
+
+ /* This should fold to 'if (0)'. */
+ if (i < 0)
+ i = baz ();
+
+ /* This should fold to 'if (1)'. */
+ if (j > 0)
+ a--;
+
+ /* This should fold to 'if (0)'. */
+ if (i != j)
+ return 0;
+ }
+
+ return i + a + j;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate i_\[0-9\]+.*0 to 0" 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate j_\[0-9\]+.*0 to 1" 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate i_\[0-9]+.*j_\[0-9\]+.* to 0" 1 "vrp1" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp07.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp07.c
new file mode 100644
index 000000000..6584919b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp07.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+foo (int i, int *p)
+{
+ int j;
+
+ if (i > 10)
+ {
+ if (p)
+ {
+ j = *p;
+ /* This should be folded to if (1) because of the parent 'if
+ (p)'. But the dereference of p above does not need an
+ assertion. */
+ if (p)
+ return j + 1;
+ }
+ }
+ else
+ {
+ j = *p - 3;
+ /* This should be folded to if (0), because p has just been
+ dereferenced. But we were not inserting enough ASSERT_EXPRs
+ to figure it out. */
+ if (!p)
+ return j - 4;
+ }
+
+ return i;
+}
+/* Target with fno-delete-null-pointer-checks should not fold checks */
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+
+/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 1 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp08.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp08.c
new file mode 100644
index 000000000..193199fbf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp08.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-fre -fdump-tree-vrp1-details" } */
+
+/* Compile with -fno-tree-fre -O2 to prevent CSEing *p. */
+foo (int a, int *p)
+{
+ int x = *p + 2;
+ int y = *p - 1;
+ int z = *p + 9;
+
+ /* This should be folded to if (1), but only one ASSERT_EXPR should
+ be inserted. */
+ if (p)
+ a = x + y + z;
+ else
+ a = x - y;
+
+ return a;
+}
+/* Target with fno-delete-null-pointer-checks should not fold checks */
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "PREDICATE: p_.* ne_expr 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp09.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp09.c
new file mode 100644
index 000000000..9ff0f14f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp09.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+foo (int *p)
+{
+ int x = baz ();
+
+ if (p == 0)
+ goto L78;
+ else
+ {
+ x = *p;
+ /* This should be folded to if (1). */
+ if (p)
+ x = x + 1;
+L78:
+ /* This should not be folded to if (1). */
+ if (p)
+ {
+ x = baz (*p);
+ /* This should be folded to if (1). */
+ if (p)
+ return x + 3;
+ }
+
+ return x - 3;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate p_.. != 0B to 1" 2 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp10.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp10.c
new file mode 100644
index 000000000..5a7458459
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp10.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+foo (int k, int j)
+{
+ if (k >= 10)
+ {
+ if (j > k)
+ {
+ /* We should fold this to if (0). */
+ if (j < 10)
+ abort ();
+ }
+ }
+
+ return j;
+}
+
+main()
+{
+ foo (10, 3);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp11.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp11.c
new file mode 100644
index 000000000..591507c22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp11.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
+
+inline int
+bounce (int arg)
+{
+ return arg;
+}
+
+foo (int k, int j, int z)
+{
+ if (k > z)
+ {
+ if (j > k)
+ {
+ /* We should fold this to if (1). */
+ if (j > bounce (z))
+ return j;
+ }
+ }
+
+ return j+1;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp12.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp12.c
new file mode 100644
index 000000000..1714a561c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp12.c
@@ -0,0 +1,23 @@
+/* { dg-do link } */
+/* { dg-options -O2 } */
+
+foo (int i)
+{
+ int x;
+
+ x = i;
+ if (i < -10)
+ {
+ x = __builtin_abs (i);
+ /* VRP was incorrectly folding this to if (1). */
+ if (x < 0)
+ link_error ();
+ }
+
+ return x;
+}
+
+main()
+{
+ foo (-30);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp13.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp13.c
new file mode 100644
index 000000000..4b3afdbc8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp13.c
@@ -0,0 +1,258 @@
+/* { dg-do run } */
+/* { dg-options -O2 } */
+
+extern void abort (void);
+
+foo_div (int i, int j)
+{
+ int k;
+
+ /* [-INF, -1] / [1, +INF] should not give [-1, -1]. */
+ if (i <= -1)
+ if (j >= 1)
+ {
+ k = i / j;
+ if (k == -1)
+ abort ();
+
+ return k;
+ }
+
+ /* [-20, -10] / [2, 10] should give [-10, -1]. */
+ if (i >= -20)
+ if (i <= -10)
+ if (j >= 2)
+ if (j <= 10)
+ {
+ k = i / j;
+ if (k < -10)
+ link_error ();
+ if (k > -1)
+ link_error ();
+
+ return k;
+ }
+
+ /* [-20, -10] / [-10, -2] should give [1, 10]. */
+ if (i >= -20)
+ if (i <= -10)
+ if (j >= -10)
+ if (j <= -2)
+ {
+ k = i / j;
+ if (k < 1)
+ link_error ();
+ if (k > 10)
+ link_error ();
+
+ return k;
+ }
+
+ /* [-20, 10] / [2, 10] should give [-10, 5]. */
+ if (i >= -20)
+ if (i <= 10)
+ if (j >= 2)
+ if (j <= 10)
+ {
+ k = i / j;
+ if (k < -10)
+ link_error ();
+ if (k > 5)
+ link_error ();
+
+ return k;
+ }
+
+ /* [-20, 10] / [-10, -2] should give [-5, 10]. */
+ if (i >= -20)
+ if (i <= 10)
+ if (j >= -10)
+ if (j <= -2)
+ {
+ k = i / j;
+ if (k < -5)
+ link_error ();
+ if (k > 10)
+ link_error ();
+
+ return k;
+ }
+
+ /* [10, 20] / [2, 10] should give [1, 10]. */
+ if (i >= 10)
+ if (i <= 20)
+ if (j >= 2)
+ if (j <= 10)
+ {
+ k = i / j;
+ if (k < 1)
+ link_error ();
+ if (k > 10)
+ link_error ();
+
+ return k;
+ }
+
+ /* [10, 20] / [-10, -2] should give [-10, -1]. */
+ if (i >= 10)
+ if (i <= 20)
+ if (j >= -10)
+ if (j <= -2)
+ {
+ k = i / j;
+ if (k > -1)
+ link_error ();
+ if (k < -10)
+ link_error ();
+
+ return k;
+ }
+
+ abort ();
+}
+
+
+foo_mult (int i, int j)
+{
+ int k;
+
+ /* [-20, -10] * [2, 10] should give [-200, -20]. */
+ if (i >= -20)
+ if (i <= -10)
+ if (j >= 2)
+ if (j <= 10)
+ {
+ k = i * j;
+ if (k < -200)
+ link_error ();
+ if (k > -20)
+ link_error ();
+
+ return k;
+ }
+
+ /* [-20, -10] * [-10, -2] should give [20, 200]. */
+ if (i >= -20)
+ if (i <= -10)
+ if (j >= -10)
+ if (j <= -2)
+ {
+ k = i * j;
+ if (k < 20)
+ link_error ();
+ if (k > 200)
+ link_error ();
+
+ return k;
+ }
+
+ /* [-20, 10] * [2, 10] should give [-200, 100]. */
+ if (i >= -20)
+ if (i <= 10)
+ if (j >= 2)
+ if (j <= 10)
+ {
+ k = i * j;
+ if (k < -200)
+ link_error ();
+ if (k > 100)
+ link_error ();
+
+ return k;
+ }
+
+ /* [-20, 10] * [-10, -2] should give [-100, 200]. */
+ if (i >= -20)
+ if (i <= 10)
+ if (j >= -10)
+ if (j <= -2)
+ {
+ k = i * j;
+ if (k < -100)
+ link_error ();
+ if (k > 200)
+ link_error ();
+
+ return k;
+ }
+
+ /* [10, 20] * [2, 10] should give [20, 200]. */
+ if (i >= 10)
+ if (i <= 20)
+ if (j >= 2)
+ if (j <= 10)
+ {
+ k = i * j;
+ if (k < 20)
+ link_error ();
+ if (k > 200)
+ link_error ();
+
+ return k;
+ }
+
+ /* [10, 20] * [-10, -2] should give [-200, -20]. */
+ if (i >= 10)
+ if (i <= 20)
+ if (j >= -10)
+ if (j <= -2)
+ {
+ k = i * j;
+ if (k < -200)
+ link_error ();
+ if (k > -20)
+ link_error ();
+
+ return k;
+ }
+
+ abort ();
+}
+
+
+main()
+{
+ if (foo_div (-10, 5) != -2)
+ abort ();
+
+ if (foo_div (-16, 4) != -4)
+ abort ();
+
+ if (foo_div (-15, -5) != 3)
+ abort ();
+
+ if (foo_div (8, 2) != 4)
+ abort ();
+
+ if (foo_div (10, -2) != -5)
+ abort ();
+
+ if (foo_div (20, 5) != 4)
+ abort ();
+
+ if (foo_div (15, -3) != -5)
+ abort ();
+
+ if (foo_mult (-10, 5) != -50)
+ abort ();
+
+ if (foo_mult (-16, 4) != -64)
+ abort ();
+
+ if (foo_mult (-15, -5) != 75)
+ abort ();
+
+ if (foo_mult (8, 2) != 16)
+ abort ();
+
+ if (foo_mult (10, -2) != -20)
+ abort ();
+
+ if (foo_mult (20, 5) != 100)
+ abort ();
+
+ if (foo_mult (15, -3) != -45)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp14.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp14.c
new file mode 100644
index 000000000..a65d8a16d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp14.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target int32plus } */
+
+struct tree_decl
+{
+ union tree_decl_u1 {
+ int f;
+ long i;
+ struct tree_decl_u1_a {
+ unsigned int align : 24;
+ unsigned int off_align : 8;
+ } a;
+ } u1;
+};
+
+extern void abort (void);
+
+unsigned int
+assemble_variable (struct tree_decl decl)
+{
+ unsigned int align;
+
+ align = decl.u1.a.align;
+
+ if (align > (1 << ((8 * 4) < 64 ? (8 * 4) - 2 : 62)))
+ align = (1 << ((8 * 4) < 64 ? (8 * 4) - 2 : 62));
+
+ /* VRP should not be propagating 0 to the RHS of this assignment.
+ But it was erroneously applying a cast operation between types of
+ different precision. align is an unsigned int with range [0,
+ 0x4000000] but the .align field holds only 24 bits. So the cast
+ was returning a [0, 0] range. */
+ decl.u1.a.align = align;
+
+ return decl.u1.a.align;
+}
+
+main ()
+{
+ struct tree_decl decl;
+ decl.u1.a.align = 13;
+ unsigned int x = assemble_variable (decl);
+ if (x == 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp15.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp15.c
new file mode 100644
index 000000000..7e7226487
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp15.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+
+extern void abort (void) __attribute__ ((__noreturn__));
+union tree_node;
+typedef union tree_node *tree;
+enum tree_code
+{
+ ERROR_MARK,
+ COND_EXPR = 42,
+};
+extern const unsigned char tree_code_length[];
+struct tree_common
+{
+ enum tree_code code:8;
+};
+union tree_node
+{
+ struct tree_common common;
+};
+void
+blah (tree t)
+{
+ if (t->common.code != COND_EXPR)
+ abort ();
+ if (1 >= tree_code_length[t->common.code])
+ abort ();
+
+}
+
+/* { dg-final { scan-tree-dump-times "tree_code_length.42." 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp16.c
new file mode 100644
index 000000000..166529ab9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp16.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+
+extern void abort (void) __attribute__ ((__noreturn__));
+struct rtx_def;
+typedef struct rtx_def *rtx;
+struct rtx_def
+{
+ int code;
+};
+int
+nonlocal_mentioned_p (rtx x)
+{
+ if (x->code == 6 || x->code == 7)
+ if (x->code == 7)
+ if (x->code != 7)
+ abort ();
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate .*to 0" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp17.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp17.c
new file mode 100644
index 000000000..c04b9ba78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp17.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void abort (void) __attribute__ ((__noreturn__));
+union tree_node;
+typedef union tree_node *tree;
+extern const unsigned char tree_code_length[];
+struct tree_common
+{
+ int code;
+};
+struct tree_exp
+{
+ tree operands[1];
+};
+union tree_node
+{
+ struct tree_common common;
+ struct tree_exp exp;
+};
+int
+gimplify_for_stmt (tree stmt)
+{
+ if (2 >= tree_code_length[stmt->common.code])
+ abort ();
+ if (3 >= tree_code_length[stmt->common.code])
+ abort ();
+}
+
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp18.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp18.c
new file mode 100644
index 000000000..a3cc536ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp18.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+static int blocksize = 4096;
+
+int bar (int);
+
+void foo (void)
+{
+ int toread;
+ int bytes;
+ static char eof_reached = 0;
+
+ toread = blocksize;
+ bytes = 1;
+
+ while (toread != 0)
+ {
+ bytes = bar (toread);
+ if (bytes <= 0)
+ {
+ if (bytes < 0)
+ continue;
+ break;
+ }
+ toread -= bytes;
+ }
+
+ if (bytes == 0)
+ eof_reached = 1;
+}
+
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp19.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp19.c
new file mode 100644
index 000000000..e4c884a85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp19.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-fwrapv -O1 -ftree-vrp -fdump-tree-vrp1" } */
+
+#include <limits.h>
+extern void abort ();
+extern void exit (int);
+
+int f (int a) {
+ if (a != INT_MIN) {
+ a = a > 0 ? a : -a;
+ if (a < 0)
+ return 1;
+ }
+ return 0;
+}
+
+int g (int b) {
+ if (b != INT_MIN) {
+ b = b > 0 ? b : -b;
+ if (b >= 0)
+ return 0;
+ }
+ return 1;
+}
+/* { dg-final { scan-tree-dump "Folding predicate a_. < 0 to 0" "vrp1" } } */
+/* { dg-final { scan-tree-dump "Folding predicate b_. >= 0 to 1" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp20.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp20.c
new file mode 100644
index 000000000..14da7df48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp20.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-fwrapv -O1 -ftree-vrp -fdump-tree-vrp1" } */
+
+extern void abort ();
+extern void exit (int);
+
+int f (int a) {
+ if (a != 0) {
+ a = a > 0 ? a : -a;
+ if (a == 0)
+ return 1;
+ return 0;
+ }
+ return 0;
+}
+
+int g (int b) {
+ if (b != 0) {
+ b = b > 0 ? b : -b;
+ if (b != 0)
+ return 0;
+ }
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump "Folding predicate a_. == 0 to 0" "vrp1" } } */
+/* { dg-final { scan-tree-dump "Folding predicate b_. != 0 to 1" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp21.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp21.c
new file mode 100644
index 000000000..9a4e4e783
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp21.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vrp -fdump-tree-vrp1" } */
+/* { dg-require-effective-target int32plus } */
+
+extern void link_error ();
+
+void test01(unsigned int a, unsigned int b)
+{
+ unsigned int x = 0x80000000;
+ if (a < x)
+ if (b < x)
+ if (a > 5)
+ if (a + b == 0U)
+ link_error ();
+}
+
+void test02(unsigned int a, unsigned int b)
+{
+ unsigned int x = 0x80000000;
+ if (a > x)
+ if (b < x)
+ if (a - b == 1U)
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-times "link_error" 0 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp22.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp22.c
new file mode 100644
index 000000000..cbd4dc529
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp22.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vrp -fdump-tree-vrp1" } */
+/* { dg-require-effective-target int32plus } */
+
+extern void link_error ();
+
+void test02(unsigned int a, unsigned int b)
+{
+ unsigned int x = 0x80000000;
+ if (a > x)
+ if (b < x)
+ if (a == b)
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-times "link_error" 0 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp23.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp23.c
new file mode 100644
index 000000000..77899a65f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp23.c
@@ -0,0 +1,45 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+blah (int code1, int code2)
+{
+ int i;
+ int n_sets;
+
+ n_sets = (int) (code1 == 32);
+ if (code2 == 64) goto L2; else goto L3;
+
+L2:
+ aa ();
+
+L3:
+ if (n_sets > 1) goto L4; else goto L10;
+
+L4:
+ aos ();
+ i = 0;
+ goto L24;
+
+L10:
+ if (n_sets > 0) goto L25; else goto L8;
+
+L25:
+ i = 0;
+
+L24:
+ aob ();
+ i = i + 1;
+ if (i < n_sets) goto L24; else goto L8;
+
+L8:
+ return;
+}
+
+
+
+/* The n_sets > 0 test can be simplified into n_sets == 1 since the
+ only way to reach the test is when n_sets <= 1, and the only value
+ which satisfies both conditions is n_sets == 1. */
+/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp24.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp24.c
new file mode 100644
index 000000000..85e5b62d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp24.c
@@ -0,0 +1,91 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+union rtunion_def
+{
+ rtx rt_rtx;
+};
+typedef union rtunion_def rtunion;
+struct rtx_def
+{
+ int code;
+ union u
+ {
+ rtunion fld[1];
+ } u;
+};
+
+sss (rtx insn, int code1, int code2, int code3)
+{
+ _Bool D1562;
+ struct rtx_def * body;
+ int i;
+ int n_sets;
+ int D1544;
+
+ body = insn->u.fld[5].rt_rtx;
+ D1544 = body->code;
+ n_sets = 1;
+ if (D1544 == 55) goto L7; else goto L1;
+
+L1:
+ n_sets = 0;
+ if (code3 == 99) goto L2; else goto L11;
+
+L2:
+ D1562 = code1 == 10;
+ n_sets = (int) D1562;
+ if (n_sets > 0) goto L7; else goto L11;
+
+L37:
+ if (code2 == 42) goto L8; else goto L9;
+
+L8:
+ arf ();
+
+L9:
+ i = i + 1;
+ if (i < n_sets) goto L37; else goto L32;
+
+L32:
+
+L11:
+ if (n_sets > 1) goto L12; else goto L15;
+
+L12:
+ nit ();
+
+L14:
+ i = 0;
+ goto L38;
+
+L15:
+ if (n_sets > 0) goto L14; else goto L16;
+
+L38:
+ frob ();
+ i = i + 1;
+ if (n_sets > i) goto L38; else goto L16;
+
+L16:
+ return;
+
+L7:
+ i = 0;
+ goto L37;
+
+}
+
+/* The first n_sets > 0 test can be simplfiied into n_sets == 1 since
+ n_sets can only have the values [0, 1] as it's the result of a
+ boolean operation.
+
+ The second n_sets > 0 test can also be simplified into n_sets == 1
+ as the only way to reach the tests is when n_sets <= 1 and the only
+ value which satisfies both conditions is n_sets == 1. */
+/* { dg-final { scan-tree-dump-times "Simplified relational" 2 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp25.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp25.c
new file mode 100644
index 000000000..fa8bbfd4c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp25.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+extern void abort ();
+int tree_code_length[100];
+
+blah (int code1)
+{
+ unsigned char D18670;
+
+ if (code1 != 53) goto L0; else goto L1;
+
+L0:
+ abort ();
+
+L1:
+ D18670 = tree_code_length[53];
+ if (D18670 <= 1) goto L2; else goto L3;
+
+L2:
+ abort ();
+
+L3:
+ if (D18670 == 2) goto L4; else goto L5;
+
+L4:
+ abort ();
+
+L5:
+ arf ();
+ if (code1 != 53) goto L6; else goto L7;
+
+L6:
+ abort ();
+
+L7:
+ if (D18670 <= 2) goto L8; else goto L9;
+
+L8:
+ abort ();
+
+L9:
+ return;
+
+}
+
+/* The second test of (code1 != 53) and the test (D18670 <= 2) are
+ both totally subsumed by earlier tests and thus should be folded
+ away using VRP. */
+/* { dg-final { scan-tree-dump-times "Folding predicate" 2 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp26.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp26.c
new file mode 100644
index 000000000..621541630
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp26.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int
+foo(int a)
+{
+ int z = a | 1;
+ return z != 0;
+}
+
+/* VRP should optimize this to a trivial "return 1". */
+/* { dg-final { scan-tree-dump-times "return 1" 1 "vrp1" } } * /
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp27.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp27.c
new file mode 100644
index 000000000..09b96f919
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp27.c
@@ -0,0 +1,33 @@
+/* PR middle-end/26361. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+void abort(void);
+
+__attribute__((noinline))
+void gen_rtx_CONST_INT(long long x) {
+ if (-x > 10)
+ abort();
+}
+__attribute__((noinline))
+int alpha_expand_prologue(long frame_size)
+{
+ unsigned long long a;
+ int probed;
+ if (frame_size <= 1) return;
+ unsigned long long b = -2;
+ a = -2;
+ do {
+ int a1 = a;
+ probed = -a1;
+ gen_rtx_CONST_INT (a1);
+ a -= 2;
+ a1 = -a;
+ probed = a1;
+ } while (probed < frame_size);
+}
+
+int main(void) {
+ alpha_expand_prologue(10);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp28.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp28.c
new file mode 100644
index 000000000..6b2a1fd6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp28.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int f(_Bool a)
+{
+ int t = a;
+ if (t != 2)
+ return 0;
+ return 1;
+}
+
+int f1(unsigned char a)
+{
+ int t = a;
+ if (t != 256)
+ return 0;
+ return 1;
+}
+
+int f3 (unsigned char c)
+{
+ int i = c;
+ if (i < 0 || i > 255)
+ return -1;
+ else
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "if " 0 "vrp1" } } * /
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp29.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp29.c
new file mode 100644
index 000000000..0a370f7d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp29.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+#include <limits.h>
+
+extern void abort(void);
+
+void decCompareOp (int result)
+{
+ if (result != (int) (INT_MAX + 1U))
+ {
+ result = -result;
+ if (result != (int) (INT_MAX + 2U))
+ abort ();
+ }
+}
+
+int main()
+{
+ decCompareOp (INT_MAX);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp30.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp30.c
new file mode 100644
index 000000000..245dcfb74
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp30.c
@@ -0,0 +1,30 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern int link_error (int);
+
+int tst2 (int x, int y)
+{
+ /* VRP should be able to extract range information for
+ x and y out of this TRUTH_AND_EXPR. */
+ if ((x > 5555) && (y < 6666))
+ {
+ if (x > 5555)
+ if (y < 6666)
+ return 1111;
+ else
+ return link_error (2222);
+ else
+ if (y < 6666)
+ return link_error (3333);
+ else
+ return link_error (4444);
+ }
+ else
+ return 0;
+}
+
+int main()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp31.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp31.c
new file mode 100644
index 000000000..5b4aa5db9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp31.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int f(int i)
+{
+ int t = i == 1;
+ int g = t == 2;
+ int h = g == 3;
+ return h;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp32.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp32.c
new file mode 100644
index 000000000..a42b3ca27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp32.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int f(int i)
+{
+ _Bool t = !i;
+ int g = !t && i;
+ int h = g == 3;
+ return h;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp33.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp33.c
new file mode 100644
index 000000000..13f60a6e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp33.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+/* This is from PR14052. */
+
+int f2(int x) { return x == 1 || x == 3 || x == 1; }
+
+/* { dg-final { scan-tree-dump "Folding predicate.*== 1 to 0" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp34.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp34.c
new file mode 100644
index 000000000..fd92eca65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp34.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+void bar (void);
+
+void
+foo (int a)
+{
+ switch (a)
+ {
+ case 4:
+ if (a >= 3)
+ if (a <= 5)
+ bar ();
+ }
+}
+
+/* { dg-final { scan-tree-dump "Folding predicate a_. > 2 to 1" "vrp1" } } */
+/* { dg-final { scan-tree-dump "Folding predicate a_. <= 5 to 1" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp35.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp35.c
new file mode 100644
index 000000000..6402f4d22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp35.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int test1(int i, int k)
+{
+ if (i > 0 && i <= 5 && k >= 10 && k < 42)
+ {
+ int j = i + 1 + k;
+ return j == 10;
+ }
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-not "j_.* == 10" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp36.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp36.c
new file mode 100644
index 000000000..de300d727
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp36.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int foo(int i)
+{
+ if (i < 0 || i >= 5)
+ return i == 1;
+ return 1;
+}
+
+/* { dg-final { scan-tree-dump-not "i_.* == 1" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp37.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp37.c
new file mode 100644
index 000000000..fba35a48b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp37.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+unsigned char x;
+int foo(void)
+{
+ unsigned long long i = x;
+ i = i + 0x80000000;
+ if (i > 0xffffffff)
+ return x;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp38.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp38.c
new file mode 100644
index 000000000..b740c6024
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp38.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int __attribute__((noinline))
+foo(char c)
+{
+ unsigned short a = (unsigned short)c;
+ if (a >= -32000 && a <= 32000)
+ return c == 0;
+ return -1;
+}
+
+extern void abort (void);
+
+int main()
+{
+ if (foo(1) == 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp39.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp39.c
new file mode 100644
index 000000000..69329affb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp39.c
@@ -0,0 +1,18 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+void test1(int i)
+{
+ if (i >= -5 && i <= 8)
+ {
+ unsigned int j = i;
+ if (j == -6)
+ link_error ();
+ if (j == 9)
+ link_error ();
+ }
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp40.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp40.c
new file mode 100644
index 000000000..23f080acf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp40.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int f(int a) {
+ switch (a & 1) {
+ case 0:
+ case 1: return 3;
+ case 2: return 5;
+ case 3: return 7;
+ case 4: return 11;
+ case 5: return 13;
+ case 6: return 17;
+ case 7: return 19;
+ }
+}
+
+/* { dg-final { scan-tree-dump "return 3;" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp41.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp41.c
new file mode 100644
index 000000000..d573fbb0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp41.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+void bar0 (void);
+void bar1 (void);
+void bar2 (void);
+void bar3 (void);
+
+void
+foo (int a)
+{
+ if (a < 100)
+ return;
+ if (200 < a)
+ return;
+
+ switch (a)
+ {
+ case 99: bar0 (); return;
+ case 100: bar1 (); return;
+ case 101: bar2 (); return;
+ case 102: bar3 (); return;
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "case 99:" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp42.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp42.c
new file mode 100644
index 000000000..79eb22cb1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp42.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+int foo(int val)
+{
+ int tmp;
+ if ((val > 5) && (val < 8))
+ {
+ switch (val)
+ {
+ case 6:
+ tmp = 1;
+ break;
+ case 7:
+ tmp = 2;
+ break;
+ }
+ return tmp; /* { dg-bogus "used uninitialized" } */
+ }
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp43.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp43.c
new file mode 100644
index 000000000..f475354dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp43.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+int __attribute__((noinline))
+foo(int i)
+{
+ if (i != 0)
+ {
+ char c = (char)i;
+ return c != 0;
+ }
+ return 0;
+}
+
+extern void abort (void);
+
+int main()
+{
+ if (foo(0xff00))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp44.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp44.c
new file mode 100644
index 000000000..a2df852c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp44.c
@@ -0,0 +1,30 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+void test1(int i)
+{
+ if (i >= -5 && i <= 8)
+ {
+ unsigned int j = i + 1;
+ if (j == -5)
+ link_error ();
+ if (j == 10)
+ link_error ();
+ }
+}
+
+void test2(unsigned int i)
+{
+ if (i >= -5 || i <= 8)
+ {
+ int j = i;
+ if (j == -6)
+ link_error ();
+ if (j == 9)
+ link_error ();
+ }
+}
+
+int main() { return 0; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp45.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp45.c
new file mode 100644
index 000000000..7916d2da8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp45.c
@@ -0,0 +1,19 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+void foo (int i)
+{
+ if (i > -128 && i < 127)
+ {
+ unsigned char k = i;
+ if (k == 0x80)
+ link_error ();
+ if (k == 0x7f)
+ link_error ();
+ }
+}
+
+int main() { return 0; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp46.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp46.c
new file mode 100644
index 000000000..a67e839de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp46.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+void
+func_18 ( int t )
+{
+ unsigned l_889;
+ int l_895 = 1;
+ for (0; 1; ++l_889)
+ {
+ int t1 = 0;
+ if (func_81 (1))
+ {
+ int rhs = l_895;
+ if (rhs == 0)
+ rhs = 1;
+ if (1 & (t % rhs))
+ t1 = 1;
+ }
+ func_98 (t1);
+ l_895 = 0;
+ }
+}
+
+/* There should be a single if left. */
+
+/* { dg-final { scan-tree-dump-times "if" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c
new file mode 100644
index 000000000..9fdba58d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c
@@ -0,0 +1,49 @@
+/* Setting LOGICAL_OP_NON_SHORT_CIRCUIT to 0 inhibits the setcc
+ optimizations that expose the VRP opportunity. */
+/* Skip on S/390. Lower values in BRANCH_COST lead to two conditional
+ jumps when evaluating an && condition. VRP is not able to optimize
+ this. */
+/* { dg-do compile { target { ! { logical_op_short_circuit || { s390*-*-* mn10300-*-* hppa*-*-* } } } } } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fdump-tree-dom1 -fdump-tree-vrp2" } */
+/* { dg-additional-options "-march=i586" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+int h(int x, int y)
+{
+ if ((x >= 0 && x <= 1) && (y >= 0 && y <= 1))
+ return x && y;
+ else
+ return -1;
+}
+
+int g(int x, int y)
+{
+ if ((x >= 0 && x <= 1) && (y >= 0 && y <= 1))
+ return x || y;
+ else
+ return -1;
+}
+
+int f(int x)
+{
+ if (x != 0 && x != 1)
+ return -2;
+
+ else
+ return !x;
+}
+
+/* Test that x and y are never compared to 0 -- they're always known to be
+ 0 or 1. */
+/* { dg-final { scan-tree-dump-times "\[xy\]\[^ \]* !=" 0 "vrp1" } } */
+
+/* These two are fully simplified by VRP1. */
+/* { dg-final { scan-tree-dump-times "x\[^ \]* \[|\] y" 1 "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "x\[^ \]* \\^ 1" 1 "vrp1" } } */
+
+/* VRP2 gets rid of the remaining & 1 operations, x and y are always
+ either 0 or 1. */
+/* { dg-final { scan-tree-dump-times " & 1;" 0 "vrp2" } } */
+
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
+/* { dg-final { cleanup-tree-dump "vrp2" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c
new file mode 100644
index 000000000..a42346599
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp48.c
@@ -0,0 +1,23 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_failure (void);
+
+static int __attribute__ ((noinline)) foo (int x)
+{
+ if (x >= 1)
+ if (x <= 10)
+ {
+ if (x < 1 || x > 10)
+ link_failure ();
+ x = x + 1;
+ }
+ return x;
+}
+
+int main (void)
+{
+ int i = foo (0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp49.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp49.c
new file mode 100644
index 000000000..664ad93ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp49.c
@@ -0,0 +1,28 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void) __attribute__((noreturn));
+int n;
+float *x;
+int main()
+{
+ if (n > 0)
+ {
+ int i = 0;
+ do
+ {
+ long long index;
+ i = i + 1;
+ index = i;
+ if (index <= 0)
+ link_error ();
+ x[index] = 0;
+ i = i + 1;
+ index = i;
+ if (index <= 0)
+ link_error ();
+ x[index] = 0;
+ }
+ while (i < n);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp50.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp50.c
new file mode 100644
index 000000000..a5b3ee28f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp50.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int
+foo (unsigned int i, unsigned int j)
+{
+ i &= 15;
+ j &= 15;
+ i += 1024;
+ j += 2048;
+ i &= j;
+ return i < 16;
+}
+
+int
+bar (int i)
+{
+ int c = 2;
+ c &= i > 6;
+ return c == 0;
+}
+
+int baz (int x, int y)
+{
+ x &= 15;
+ y &= 15;
+ x += 4;
+ y += 16;
+ x &= y;
+ return x < 20;
+}
+
+/* { dg-final { scan-tree-dump-times "return 1;" 3 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp51.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp51.c
new file mode 100644
index 000000000..94b29766a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp51.c
@@ -0,0 +1,59 @@
+/* PR tree-optimization/28632 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vrp -fno-tree-ccp" } */
+/* { dg-require-effective-target int32plus } */
+
+void
+v4 (unsigned a, unsigned b)
+{
+ if (a < 0x1000) return;
+ if (a > 0x1000) return;
+ if (b < 0x0110) return;
+ /* constant true. */
+ if (!__builtin_constant_p ((a|b) >= 0x01000))
+ __asm__("vrp.bug.always.true");
+ /* VRP must not think that this is constant. */
+ if (__builtin_constant_p ((a|b) >= 0x10000))
+ __asm__("vrp.bug.not.always.true");
+}
+
+void
+u4 (unsigned n)
+{
+ if (n > 0x10111) return;
+ if (n < 0x10101) return;
+ /* always true. */
+ if (!__builtin_constant_p (n & 0x00100))
+ __asm__("vrp.bug.always.true");
+ /* VRP must not think that this is constant true. */
+ if (__builtin_constant_p (n & 0x00001))
+ __asm__("vrp.bug.not.always.true");
+ /* Out of range, always evaluates to constant false. */
+ if (!__builtin_constant_p (n & 0x01000))
+ __asm__("vrp.bug.always.false");
+}
+
+void
+u5 (unsigned n)
+{
+ struct s {unsigned exp:8;} x;
+ x.exp = n;
+ if (__builtin_constant_p(((n + 1) & 255) > 1))
+ __asm__("vrp.bug.not.always.true");
+}
+
+void
+v5 (int a, int b)
+{
+ if (a < 0x1000) return;
+ if (a > 0x1000) return;
+ if (b < 0x0110) return;
+ /* constant true. */
+ if (!__builtin_constant_p ((a|b) >= 0x01000))
+ __asm__("vrp.bug.always.true");
+ /* VRP must not think that this is always true. */
+ if (__builtin_constant_p ((a|b) >= 0x10000))
+ __asm__("vrp.bug.not.always.true");
+}
+
+/* { dg-final { scan-assembler-not "vrp\\\.bug\\\." } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp52.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp52.c
new file mode 100644
index 000000000..52ceea6be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp52.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-tree-ccp" } */
+
+int
+foo (unsigned int i, unsigned int j)
+{
+ i &= 15;
+ j &= 15;
+ i += 1024;
+ j += 2048;
+ i |= j;
+ return i >= 1024 + 2048;
+}
+
+/* { dg-final { scan-tree-dump-times "return 1;" 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp53.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp53.c
new file mode 100644
index 000000000..4bcd299ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp53.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-tree-ccp" } */
+
+int
+f1 (int x)
+{
+ x &= 0xff;
+ x += 0x400;
+ x &= 0x7ff;
+ return x;
+}
+
+int
+f2 (int x)
+{
+ x &= 0xff;
+ x += 0x5400;
+ x |= 0x4400;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-not "\& (2047|0x7ff)" "vrp1" } } */
+/* { dg-final { scan-tree-dump-not "\\| (17408|0x4400)" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp54.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp54.c
new file mode 100644
index 000000000..6e8da7758
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp54.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void link_error (void);
+void foo (void)
+{
+ int j = 256;
+ do
+ {
+ if (j < 0 || j > 256)
+ link_error ();
+ j--;
+ }
+ while (j >= 0);
+ if (j != -1)
+ link_error ();
+}
+extern void link_error (void);
+void bar (void)
+{
+ int j = 0;
+ do
+ {
+ if (j < 0 || j > 256)
+ link_error ();
+ j++;
+ }
+ while (j <= 256);
+ if (j != 257)
+ link_error ();
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp55.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp55.c
new file mode 100644
index 000000000..7a3e726b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp55.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-blocks-vops-details" } */
+
+fu (char *p, int x)
+{
+ if (x)
+ *p = 69;
+ if (p)
+ arf ();
+}
+
+/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
+/* { dg-final { scan-tree-dump-times "Threaded jump" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp56.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp56.c
new file mode 100644
index 000000000..912d28e0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp56.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+typedef struct basic_block_def *basic_block;
+struct basic_block_def;
+struct edge_def;
+typedef struct edge_def *edge;
+typedef struct VEC_edge_base
+{
+ unsigned num;
+} VEC_edge_base;
+typedef struct VEC_edge_none
+{
+ VEC_edge_base base;
+} VEC_edge_none;
+static __inline__ unsigned
+VEC_edge_base_length (VEC_edge_base * vec_)
+{
+ return vec_ ? vec_->num : 0;
+}
+
+typedef struct VEC_edge_gc
+{
+ VEC_edge_base base;
+} VEC_edge_gc;
+struct basic_block_def
+{
+ VEC_edge_gc *succs;
+};
+
+unsigned char
+cleanup_empty_eh (basic_block bb)
+{
+ edge e_out;
+ switch (VEC_edge_base_length (&bb->succs->base))
+ {
+ case 1:
+ foo ();
+ }
+}
+/* { dg-final { scan-tree-dump-times "Threaded" 1 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c
new file mode 100644
index 000000000..cac37835d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp57.c
@@ -0,0 +1,17 @@
+/* PR40052 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vrp -fno-tree-ccp -fdump-tree-optimized" } */
+
+int foo(_Bool b)
+{
+ return b | 1;
+}
+
+int bar(_Bool b)
+{
+ return b & -2;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */
+/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp58.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp58.c
new file mode 100644
index 000000000..aa10af249
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp58.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+long long
+foo (long long a, signed char b, signed char c)
+{
+ int bc = b * c;
+ return a + (short)bc;
+}
+
+/* { dg-final { scan-tree-dump "Folded into" "vrp1" { target int32plus } } } */
+/* { dg-final { scan-tree-dump "Folding statement: _\[0-9\]\* = \\(long long int\\) bc_\[0-9\]\*;" "vrp1" { target int16 } } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c
new file mode 100644
index 000000000..963282a2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-vrp1" } */
+
+int f(int x)
+{
+ if (x >= 0 && x <= 3)
+ {
+ x = x ^ 3;
+ x = x & 3;
+ }
+ return x;
+}
+
+int g(int x)
+{
+ if (x >= 0 && x <= 3)
+ {
+ x = x ^ 2;
+ x = x & 3;
+ }
+ return x;
+}
+
+int h(int x)
+{
+ if (x >= 0 && x <= 3)
+ {
+ x = x ^ 1;
+ x = x & 3;
+ }
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-not " & 3;" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp60.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp60.c
new file mode 100644
index 000000000..059d76473
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp60.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-ccp -fno-tree-dominator-opts -fdump-tree-vrp1" } */
+
+int foo (int x, int b)
+{
+ int cst;
+ if (b)
+ cst = -__INT_MAX__ - 1;
+ else
+ cst = -__INT_MAX__;
+ x = x | cst;
+ if (x >= 0)
+ return 12345;
+ return x;
+}
+
+int bar (int x, int b)
+{
+ int cst;
+ if (b)
+ cst = __INT_MAX__;
+ else
+ cst = __INT_MAX__ - 1;
+ x = x & cst;
+ if (x < 0)
+ return 12345;
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-not "12345" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp61.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp61.c
new file mode 100644
index 000000000..33eb44bb1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp61.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1-nouid" } */
+
+int f (int x, int y)
+{
+ if (x > -1024 && x < 0 && y > -1024 && y < 0)
+ {
+ x = x ^ y;
+ if (x < 0 || x > 1023)
+ return 1234;
+ }
+ return x;
+}
+
+/* { dg-final { scan-tree-dump-not "1234" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp62.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp62.c
new file mode 100644
index 000000000..139195b1e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp62.c
@@ -0,0 +1,110 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-ccp -fno-tree-dominator-opts" } */
+
+/* Tests generated via */
+
+#if 0
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+ int amin, amax, bmin, bmax, a, b;
+ int testno = 0;
+ int min = atoi (argv[1]);
+ int max = atoi (argv[2]);
+ char op = argv[3][0];
+ printf ("/* Testing range [%d, %d] with operator %c. */\n", min, max, op);
+ printf ("extern void abort (void);\n");
+ for (amin = min; amin <= max; ++amin)
+ for (amax = amin; amax <= max; ++amax)
+ for (bmin = min; bmin <= max; ++bmin)
+ for (bmax = bmin; bmax <= max; ++bmax)
+ {
+ ++testno;
+ printf ("int test%d (int a, int b)\n"
+ "{\n"
+ " if (a >= %d && a <= %d && b >= %d && b <= %d)\n"
+ " {\n"
+ " int x = a %c b;\n"
+ " if (0\n", testno, amin, amax, bmin, bmax, op);
+ for (a = amin; a <= amax; ++a)
+ for (b = bmin; b <= bmax; ++b)
+ printf ("|| x == (%d %c %d)\n", a, op, b);
+ printf (" ) return 0;\n"
+ " abort ();\n"
+ " }\n"
+ " return 0;\n"
+ "}\n");
+ }
+ printf ("int main()\n"
+ "{\n"
+ " int a, b;\n"
+ " for (a = %d; a <= %d; ++a)\n"
+ " for (b = %d; b <= %d; ++b)\n"
+ " {\n", min, max, min, max);
+ for (; testno > 0; --testno)
+ printf (" test%d (a, b);\n", testno);
+ printf (" }\n"
+ " return 0;\n"
+ "}\n");
+ return 0;
+}
+#endif
+
+extern void abort (void);
+
+int test381 (int a, int b)
+{
+ if (a >= -3 && a <= -1 && b >= -2 && b <= 3)
+ {
+ int x = a | b;
+ if (x == (-3 | -2)
+ || x == (-3 | -1)
+ || x == (-3 | 0)
+ || x == (-3 | 1)
+ || x == (-3 | 2)
+ || x == (-3 | 3)
+ || x == (-2 | -2)
+ || x == (-2 | -1)
+ || x == (-2 | 0)
+ || x == (-2 | 1)
+ || x == (-2 | 2)
+ || x == (-2 | 3)
+ || x == (-1 | -2)
+ || x == (-1 | -1)
+ || x == (-1 | 0)
+ || x == (-1 | 1)
+ || x == (-1 | 2)
+ || x == (-1 | 3))
+ return 0;
+ abort ();
+ }
+ return 0;
+}
+
+int test900 (int a, int b)
+{
+ if (a >= -1 && a <= 2 && b >= 3 && b <= 3)
+ {
+ int x = a & b;
+ if (x == (-1 & 3)
+ || x == (0 & 3)
+ || x == (1 & 3)
+ || x == (2 & 3))
+ return 0;
+ abort ();
+ }
+ return 0;
+}
+
+int main()
+{
+ int a, b;
+ for (a = -4; a < 4; ++a)
+ for (b = -4; b < 4; ++b)
+ {
+ test381 (a, b);
+ test900 (a, b);
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp63.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp63.c
new file mode 100644
index 000000000..9116847de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp63.c
@@ -0,0 +1,345 @@
+/* PR tree-optimization/51721 */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
+
+void
+f1 (unsigned int s)
+{
+ if (s >> 1 == 0)
+ {
+ if (s == 2 || s == -1U)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 1)
+ link_error ();
+ }
+}
+
+void
+f2 (unsigned int s)
+{
+ if (s >> 4 != 3)
+ {
+ if (s == 48 || s == 57 || s == 63)
+ link_error ();
+ }
+ else
+ {
+ if (s == 47 || s == 64 || s == 0 || s == -1U)
+ link_error ();
+ }
+}
+
+void
+f3 (int s)
+{
+ if (s >> 3 == -2)
+ {
+ if (s == -17 || s == -8 || s == 0
+ || s == -__INT_MAX__ - 1 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == -16 || s == -12 || s == -9)
+ link_error ();
+ }
+}
+
+void
+f4 (unsigned int s)
+{
+ if (s >> 2 < 4)
+ {
+ if (s == 16 || s == 20 || s == -1U)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 2 || s == 14 || s == 15)
+ link_error ();
+ }
+}
+
+void
+f5 (unsigned int s)
+{
+ if (s >> 3 <= 7)
+ {
+ if (s == 64 || s == 68 || s == -1U)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 1 || s == 62 || s == 63)
+ link_error ();
+ }
+}
+
+void
+f6 (unsigned int s)
+{
+ if (s >> 1 > 2)
+ {
+ if (s == 0 || s == 3 || s == 5)
+ link_error ();
+ }
+ else
+ {
+ if (s == 6 || s == 8 || s == -1U)
+ link_error ();
+ }
+}
+
+void
+f7 (unsigned int s)
+{
+ if (s >> 5 >= 7)
+ {
+ if (s == 0 || s == 2 || s == 221 || s == 223)
+ link_error ();
+ }
+ else
+ {
+ if (s == 224 || s == 256 || s == 258 || s == -1U)
+ link_error ();
+ }
+}
+
+void
+f8 (int s)
+{
+ if (s >> 2 < -3)
+ {
+ if (s == -12 || s == -10 || s == 0 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == -13 || s == -16 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+}
+
+void
+f9 (int s)
+{
+ if (s >> 3 <= -2)
+ {
+ if (s == -8 || s == -6 || s == 0 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == -9 || s == -11 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+}
+
+void
+f10 (int s)
+{
+ if (s >> 1 > -4)
+ {
+ if (s == -7 || s == -9 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s == -6 || s == -4 || s == 0 || s == __INT_MAX__)
+ link_error ();
+ }
+}
+
+void
+f11 (int s)
+{
+ if (s >> 3 >= -6)
+ {
+ if (s == -49 || s == -51 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s == -48 || s == -46 || s == 0 || s == __INT_MAX__)
+ link_error ();
+ }
+}
+
+void
+f12 (int s)
+{
+ if (s >> 2 < 4)
+ {
+ if (s == 16 || s == 20 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 2 || s == 14 || s == 15
+ || s == -2 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+}
+
+void
+f13 (int s)
+{
+ if (s >> 3 <= 7)
+ {
+ if (s == 64 || s == 68 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 1 || s == 62 || s == 63
+ || s == -2 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+}
+
+void
+f14 (int s)
+{
+ if (s >> 1 > 2)
+ {
+ if (s == 0 || s == 3 || s == 5
+ || s == -2 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s == 6 || s == 8 || s == __INT_MAX__)
+ link_error ();
+ }
+}
+
+void
+f15 (int s)
+{
+ if (s >> 5 >= 7)
+ {
+ if (s == 0 || s == 2 || s == 221 || s == 223
+ || s == -2 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s == 224 || s == 256 || s == 258 || s == __INT_MAX__)
+ link_error ();
+ }
+}
+
+unsigned int
+f16 (unsigned int s)
+{
+ unsigned int t = s >> BITSM1;
+ if (t != 0)
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
+ link_error ();
+ }
+ return t;
+}
+
+int
+f17 (int s)
+{
+ int t = s >> BITSM1;
+ if (t == 0)
+ {
+ if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ return t;
+}
+
+unsigned int
+f18 (unsigned int s)
+{
+ unsigned int t = s >> BITSM1;
+ if (t >= 1)
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
+ link_error ();
+ }
+ return t;
+}
+
+int
+f19 (int s)
+{
+ int t = s >> BITSM1;
+ if (t >= 0)
+ {
+ if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ return t;
+}
+
+unsigned int
+f20 (unsigned int s)
+{
+ unsigned int t = s >> BITSM1;
+ if (t < 1)
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ return t;
+}
+
+int
+f21 (int s)
+{
+ int t = s >> BITSM1;
+ if (t < 0)
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ return t;
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp64.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp64.c
new file mode 100644
index 000000000..2ab328f1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp64.c
@@ -0,0 +1,152 @@
+/* PR tree-optimization/51721 */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
+
+void
+f1 (unsigned int s)
+{
+ if (s >> BITSM1 != 0)
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
+ link_error ();
+ }
+}
+
+void
+f2 (int s)
+{
+ if (s >> BITSM1 == 0)
+ {
+ if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+}
+
+void
+f3 (unsigned int s)
+{
+ if ((s & (1U << BITSM1)) != 0)
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
+ link_error ();
+ }
+}
+
+void
+f4 (int s)
+{
+ if ((s & (1U << BITSM1)) == 0)
+ {
+ if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+}
+
+void
+f5 (unsigned int s)
+{
+ if ((int) s < 0)
+ {
+ if (s == 0 || s == 5 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
+ link_error ();
+ }
+}
+
+void
+f6 (unsigned int s)
+{
+ if ((int) s < 4)
+ {
+ if (s == 4 || s == 6 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U
+ || s == 3 || s == 0)
+ link_error ();
+ }
+}
+
+void
+f7 (unsigned int s)
+{
+ if ((int) s <= -7)
+ {
+ if (s == -6U || s == -1U || s == 0 || s == 4 || s == 6 || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -9U
+ || s == -7U)
+ link_error ();
+ }
+}
+
+void
+f8 (unsigned int s)
+{
+ if ((int) s >= 4)
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U
+ || s == 3 || s == 0)
+ link_error ();
+ }
+ else
+ {
+ if (s == 4 || s == 6 || s == __INT_MAX__)
+ link_error ();
+ }
+}
+
+void
+f9 (unsigned int s)
+{
+ if ((int) s > -7)
+ {
+ if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -9U
+ || s == -7U)
+ link_error ();
+ }
+ else
+ {
+ if (s == -6U || s == -1U || s == 0 || s == 4 || s == 6 || s == __INT_MAX__)
+ link_error ();
+ }
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp65.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp65.c
new file mode 100644
index 000000000..d1090685d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp65.c
@@ -0,0 +1,376 @@
+/* PR tree-optimization/52267 */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
+#define BITSH ((sizeof (int) - sizeof (short)) * __CHAR_BIT__)
+
+void
+f1 (unsigned int s)
+{
+ if ((s & (7U << (BITSM1 - 2))) != 0)
+ {
+ if (s <= (1U << (BITSM1 - 2)) - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s >= (1U << (BITSM1 - 2)))
+ link_error ();
+ }
+}
+
+void
+f2 (int s)
+{
+ if ((s & (7U << (BITSM1 - 2))) == 0)
+ {
+ if (s >= (1 << (BITSM1 - 2)) || s < 0)
+ link_error ();
+ }
+ else
+ {
+ if (s >= 0 && s <= (1 << (BITSM1 - 2)) - 1)
+ link_error ();
+ }
+}
+
+void
+f3 (unsigned int s)
+{
+ if ((s & 0x3cc0) == 0)
+ {
+ if (s >= -15552U)
+ link_error ();
+ }
+ else
+ {
+ if (s <= 0x3f)
+ link_error ();
+ }
+}
+
+void
+f4 (int s)
+{
+ if ((s & 0x3cc0) == 0)
+ {
+ if (s >= -15552 && s < 0)
+ link_error ();
+ }
+ else
+ {
+ if (/* s <= 0x3fU */ s == 0 || s == 0x20 || s == 0x3f)
+ link_error ();
+ }
+}
+
+void
+f5 (int s)
+{
+ if ((s & 0x3cc0U) == 0)
+ {
+ if (s >= -15552 && s < 0)
+ link_error ();
+ }
+ else
+ {
+ if (/* s <= 0x3fU */ s == 0 || s == 0x20 || s == 0x3f)
+ link_error ();
+ }
+}
+
+void
+f6 (unsigned int s)
+{
+ if ((s & 0x3cc0) == 0x3cc0)
+ {
+ if (s <= 0x3cbf)
+ link_error ();
+ }
+ else
+ {
+ if (s >= -64U)
+ link_error ();
+ }
+}
+
+void
+f7 (int s)
+{
+ if ((s & 0x3cc0) == 0x3cc0)
+ {
+ if (s >= 0 && s <= 0x3cbf)
+ link_error ();
+ }
+ else
+ {
+ if (s >= -64 && s < 0)
+ link_error ();
+ }
+}
+
+void
+f8 (int s)
+{
+ if ((s & 0x3cc0U) == 0x3cc0)
+ {
+ if (s >= 0 && s <= 0x3cbf)
+ link_error ();
+ }
+ else
+ {
+ if (s >= -64 && s < 0)
+ link_error ();
+ }
+}
+
+void
+f9 (unsigned int s)
+{
+ if ((s & 0x3cc0) >= 0x1cc0)
+ {
+ if (s <= 0x1cbf)
+ link_error ();
+ }
+ else
+ {
+ if (s >= -8256U)
+ link_error ();
+ }
+}
+
+void
+f10 (unsigned int s)
+{
+ if ((s & 0x3cc0) > 0x1cc0)
+ {
+ if (s <= 0x1fff)
+ link_error ();
+ }
+ else
+ {
+ if (s >= -8192U)
+ link_error ();
+ }
+}
+
+void
+f11 (int s)
+{
+ if ((s & 0x3cc0) >= 0x1cc0)
+ {
+ if (s >= 0 && s <= 0x1cbf)
+ link_error ();
+ }
+ else
+ {
+ if (s >= -8256 && s < 0)
+ link_error ();
+ }
+}
+
+void
+f12 (int s)
+{
+ if ((s & 0x3cc0) > 0x1cc0)
+ {
+ if (s >= 0 && s <= 0x1fff)
+ link_error ();
+ }
+ else
+ {
+ if (s >= -8192 && s < 0)
+ link_error ();
+ }
+}
+
+void
+f13 (unsigned int s)
+{
+ if ((s & (0xe071U << BITSH)) > (0xb030U << BITSH))
+ {
+ if (s <= ((0xc000U << BITSH) - 1))
+ link_error ();
+ }
+ else
+ {
+ if (s >= (0xc000U << BITSH))
+ link_error ();
+ }
+}
+
+void
+f14 (unsigned int s)
+{
+ if ((s & (0xe071U << BITSH)) > (0xa030U << BITSH))
+ {
+ if (s <= ((0xa031U << BITSH) - 1))
+ link_error ();
+ }
+ else
+ {
+ if (s >= (0xbfbfU << BITSH))
+ link_error ();
+ }
+}
+
+void
+f15 (int s)
+{
+ if ((s & ((-0x1f8f) << BITSH)) > ((-0x4fd0) << BITSH))
+ {
+ if (s <= ((-0x4000 << BITSH) - 1))
+ link_error ();
+ }
+ else
+ {
+ if (s > ((-0x4000 << BITSH) - 1))
+ link_error ();
+ }
+}
+
+void
+f16 (int s)
+{
+ if ((s & ((-0x1f8f) << BITSH)) >= ((-0x4fd0) << BITSH))
+ {
+ if (s <= ((-0x4000 << BITSH) - 1))
+ link_error ();
+ }
+ else
+ {
+ if (s > ((-0x4000 << BITSH) - 1))
+ link_error ();
+ }
+}
+
+void
+f17 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != -__INT_MAX__ - 1)
+ {
+ if (s == -__INT_MAX__ - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s >= (-0x4000 << BITSH) - 1)
+ link_error ();
+ }
+}
+
+void
+f18 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != ((-0x4000 << BITSH) | 1))
+ {
+ if (s == -1)
+ link_error ();
+ }
+ else
+ {
+ if (s < ((-0x4000 << BITSH) | 1) || s >= 0)
+ link_error ();
+ }
+}
+
+void
+f19 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != ((0x4000 << BITSH) | 1))
+ {
+ if (s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s <= (0x4000 << BITSH))
+ link_error ();
+ }
+}
+
+void
+f20 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != -__INT_MAX__ - 1)
+ {
+ if (s < (-0x7000 << BITSH))
+ link_error ();
+ }
+ else
+ {
+ if (s >= (-0x7000 << BITSH))
+ link_error ();
+ }
+}
+
+void
+f21 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != (-0x1000 << BITSH))
+ {
+ if (s >= (-0x1000 << BITSH) && s < 0)
+ link_error ();
+ }
+ else
+ {
+ if (s < (-0x1000 << BITSH) || s >= 0)
+ link_error ();
+ }
+}
+
+void
+f22 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != (0x7000 << BITSH))
+ {
+ if (s >= (0x7000 << BITSH))
+ link_error ();
+ }
+ else
+ {
+ if (s < (0x7000 << BITSH))
+ link_error ();
+ }
+}
+
+void
+f23 (unsigned int s)
+{
+ if ((s & (0xf000U << BITSH)) != (0x7000 << BITSH))
+ {
+ if (/* s >= (0x7000 << BITSH) && s < (0x8000U << BITSH) */
+ s == (0x7000 << BITSH) || s == __INT_MAX__)
+ link_error ();
+ }
+ else
+ {
+ if (s < (0x7000 << BITSH) || s >= (0x8000U << BITSH))
+ link_error ();
+ }
+}
+
+void
+f24 (unsigned int s)
+{
+ if ((s & (0xf000U << BITSH)) != (0x8000U << BITSH))
+ {
+ if (/* s >= (0x8000U << BITSH) && s < (0x9000U << BITSH) */
+ s == (0x8000U << BITSH) || s == (0x9000U << BITSH) - 1)
+ link_error ();
+ }
+ else
+ {
+ if (s >= (0x9000U << BITSH) || s < (0x8000U << BITSH))
+ link_error ();
+ }
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp66-int16-sw.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp66-int16-sw.c
new file mode 100644
index 000000000..b194d2370
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp66-int16-sw.c
@@ -0,0 +1,914 @@
+/* PR tree-optimization/52267 */
+/* { dg-do run { target { int16 } } } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
+#define BITSH ((sizeof (int) - sizeof (short)) * __CHAR_BIT__)
+
+void
+f1 (unsigned int s)
+{
+ if ((s & (7U << (BITSM1 - 2))) != 0)
+ {
+ if (s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
+ || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == -1U || s == -15U
+ || s == 0x3cbf || s == 0x3cc0
+ || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == 1U + __INT_MAX__ || s == -32U
+ || s == (3 << (BITSM1 - 2)) + 2 || s == -5U || s == -63U
+ || s == -64U || s == -65U || s == 6U + __INT_MAX__ || s == -8189U
+ || s == -8191U || s == -8192U || s == -8193U || s == -8250U
+ || s == -8255U || s == -8256U || s == -8257U || s == __INT_MAX__
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3f || s == 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
+ return;
+ }
+ abort ();
+}
+
+void
+f2 (int s)
+{
+ if ((s & (7U << (BITSM1 - 2))) == 0)
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3f || s == 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
+ return;
+ }
+ else
+ {
+ if (s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == -1 || s == -15 || s == -15550
+ || s == 0x3cbf || s == 0x3cc0
+ || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == -__INT_MAX__ - 1 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
+ || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f3 (unsigned int s)
+{
+ if ((s & 0x3cc0) == 0)
+ {
+ if (s == 0 || s == 0x20 || s == 0x3f
+ || s == (0xc000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == 1
+ || s == 1U + __INT_MAX__ || s == 2 || s == 24
+ || s == 5 || s == 6U + __INT_MAX__
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ else
+ {
+ if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == (0xbfbfU << BITSH) || s == (0xf000U << BITSH)
+ || s == (0x9000U << BITSH)
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (3 << (BITSM1 - 2)) + 2
+ || s == 0x3cbf || s == 0x3cc0 || s == (0xc000U << BITSH) - 1
+ || s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
+ || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == -32U || s == -5U
+ || s == -63U || s == -64U || s == -65U || s == -8189U || s == -8191U
+ || s == -8192U || s == -8193U || s == -8250U || s == -8255U
+ || s == -8256U || s == -8257U || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f4 (int s)
+{
+ if ((s & 0x3cc0) == 0)
+ {
+ if (s == 0 || s == 0x20 || s == 0x3f
+ || s == (-0x4000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == 5 || s == -__INT_MAX__ + 4
+ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == (-0x4041 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH)
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (3 << (BITSM1 - 2)) + 2
+ || s == 0x3cbf || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15 || s == -15550
+ || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f5 (int s)
+{
+ if ((s & 0x3cc0U) == 0)
+ {
+ if (s == 0 || s == 0x20 || s == 0x3f
+ || s == (-0x4000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == 5 || s == -__INT_MAX__ + 4
+ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == (-0x4041 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH)
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (3 << (BITSM1 - 2)) + 2
+ || s == 0x3cbf || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15 || s == -15550
+ || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f6 (unsigned int s)
+{
+ if ((s & 0x3cc0) == 0x3cc0)
+ {
+ if (s == 0x3cc0 || s == (0xc000U << BITSH) - 1
+ || s == -1U || s == -15U
+ || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32U || s == -5U || s == -63U || s == -64U
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1
+ || s == (0x7000 << BITSH) - 1
+ || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (0xbfbfU << BITSH)
+ || s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
+ || s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
+ || s == -15550U || s == -15552U || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65U
+ || s == 6U + __INT_MAX__ || s == -8189U || s == -8191U
+ || s == -8192U || s == -8193U || s == -8250U || s == -8255U
+ || s == -8256U || s == -8257U || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f7 (int s)
+{
+ if ((s & 0x3cc0) == 0x3cc0)
+ {
+ if (s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == -1 || s == -15
+ || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32 || s == -5 || s == -63 || s == -64 || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1
+ || s == (0x7000 << BITSH) - 1
+ || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == -__INT_MAX__ - 1 || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65
+ || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f8 (int s)
+{
+ if ((s & 0x3cc0U) == 0x3cc0)
+ {
+ if (s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == -1 || s == -15
+ || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32 || s == -5 || s == -63 || s == -64 || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1
+ || s == (0x7000 << BITSH) - 1
+ || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == -__INT_MAX__ - 1 || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65
+ || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f9 (unsigned int s)
+{
+ if ((s & 0x3cc0) >= 0x1cc0)
+ {
+ if (s == 0x1cc0 || s == 0x1fff || s == 0x2000 || s == 0x3cbf
+ || s == 0x3cc0 || s == (0xc000U << BITSH) - 1
+ || s == (0xf000U << BITSH) - 1
+ || s == (0xbfbfU << BITSH) || s == (0xf000U << BITSH)
+ || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (3 << (BITSM1 - 2)) + 2
+ || s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
+ || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
+ || s == -8189U || s == -8191U || s == -8192U || s == -8193U
+ || s == -8250U || s == -8255U || s == -8256U || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x20 || s == 0x3f
+ || s == (0x9000U << BITSH) - 1 || s == (0xc000U << BITSH)
+ || s == (0x9000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == 1 || s == -15550U
+ || s == -15552U
+ || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == 5
+ || s == 6U + __INT_MAX__ || s == -8257U || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f10 (unsigned int s)
+{
+ if ((s & 0x3cc0) > 0x1cc0)
+ {
+ if (s == 0x2000 || s == 0x3cbf || s == 0x3cc0
+ || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0xbfbfU << BITSH) || s == (0xa031U << BITSH) - 1
+ || s == (0xf000U << BITSH)
+ || s == -1U || s == -15U || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == -32U || s == (3 << (BITSM1 - 2)) + 2 || s == -5U
+ || s == -63U || s == -64U || s == -65U || s == -8189U || s == -8191U
+ || s == -8192U || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x20
+ || s == 0x3f || s == (0x9000U << BITSH) - 1
+ || s == (0xc000U << BITSH) || s == (0x9000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == 1 || s == -15550U
+ || s == -15552U || s == (1 << (BITSM1 - 2)) - 1
+ || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == 5
+ || s == 6U + __INT_MAX__ || s == -8193U || s == -8250U
+ || s == -8255U || s == -8256U || s == -8257U
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f11 (int s)
+{
+ if ((s & 0x3cc0) >= 0x1cc0)
+ {
+ if (s == 0x1cc0 || s == 0x1fff || s == 0x2000 || s == 0x3cbf
+ || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == (-0x1000 << BITSH) - 1
+ || s == (-0x4041 << BITSH)
+ || s == (-0x1000 << BITSH)
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (3 << (BITSM1 - 2)) + 2
+ || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15
+ || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32 || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x20 || s == 0x3f
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x4000 << BITSH)
+ || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -15550
+ || s == -15552
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == 5 || s == -__INT_MAX__ + 4
+ || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f12 (int s)
+{
+ if ((s & 0x3cc0) > 0x1cc0)
+ {
+ if (s == 0x2000 || s == 0x3cbf || s == 0x3cc0
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH)
+ || s == (-0x1000 << BITSH)
+ || s == -1 || s == -15 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (3 << (BITSM1 - 2)) + 2
+ || s == -32 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x20
+ || s == 0x3f || s == (-0x7000 << BITSH) - 1
+ || s == (-0x4000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -15550
+ || s == -15552 || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == 5 || s == -__INT_MAX__ + 4
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f13 (unsigned int s)
+{
+ if ((s & (0xe071U << BITSH)) > (0xb030U << BITSH))
+ {
+ if (s == (0xf000U << BITSH) - 1 || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0xc000U << BITSH) + 1
+ || s == -1U || s == -15U || s == -15550U || s == -15552U
+ || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
+ || s == -8189U || s == -8191U || s == -8192U || s == -8193U
+ || s == -8250U || s == -8255U || s == -8256U || s == -8257U)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (0xc000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1 || s == (0xbfbfU << BITSH)
+ || s == (0x9000U << BITSH) || s == 1 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
+ || s == 6U + __INT_MAX__ || s == __INT_MAX__
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f14 (unsigned int s)
+{
+ if ((s & (0xe071U << BITSH)) > (0xa030U << BITSH))
+ {
+ if (s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0xc000U << BITSH) + 1
+ || s == -1U || s == -15U || s == -15550U || s == -15552U
+ || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
+ || s == -8189U || s == -8191U || s == -8192U || s == -8193U
+ || s == -8250U || s == -8255U || s == -8256U || s == -8257U)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
+ || s == (0x9000U << BITSH) || s == 1 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
+ || s == 6U + __INT_MAX__ || s == __INT_MAX__
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f15 (int s)
+{
+ if ((s & ((-0x1f8f) << BITSH)) > ((-0x4fd0) << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -1 || s == -15 || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
+ || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == -8257
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x7000 << BITSH) || s == -__INT_MAX__ - 1
+ || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f16 (int s)
+{
+ if ((s & ((-0x1f8f) << BITSH)) >= ((-0x4fd0) << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -1 || s == -15 || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
+ || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == -8257
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x7000 << BITSH) || s == -__INT_MAX__ - 1
+ || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f17 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != -__INT_MAX__ - 1)
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == -32
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
+ || s == -8191 || s == -8192 || s == -8193 || s == -8250
+ || s == -8255 || s == -8256 || s == -8257 || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (-0x5fcf << BITSH) - 1 || s == (-0x7000 << BITSH)
+ || s == -__INT_MAX__ - 1 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f18 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != ((-0x4000 << BITSH) | 1))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == 1 || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -64
+ || s == -__INT_MAX__ + 4 || s == -8192 || s == -8250 || s == -8256
+ || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH) + 1
+ || s == -1 || s == -15 || s == -5 || s == -63 || s == -65
+ || s == -8189 || s == -8191 || s == -8193 || s == -8255
+ || s == -8257)
+ return;
+ }
+ abort ();
+}
+
+void
+f19 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != ((0x4000 << BITSH) | 1))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
+ || s == -8191 || s == -8192 || s == -8193 || s == -8250
+ || s == -8255 || s == -8256 || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == (0x7000 << BITSH) - 1 || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f20 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != -__INT_MAX__ - 1)
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -1 || s == -15 || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
+ || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == -8257
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (-0x7000 << BITSH) - 1 || s == -__INT_MAX__ - 1
+ || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f21 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != (-0x1000 << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == -8257
+ || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == (-0x1000 << BITSH) || s == -1 || s == -15
+ || s == -32 || s == -5 || s == -63 || s == -64
+ || s == -65)
+ return;
+ }
+ abort ();
+}
+
+void
+f22 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != (0x7000 << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
+ || s == -8191 || s == -8192 || s == -8193 || s == -8250
+ || s == -8255 || s == -8256 || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == (0x7000 << BITSH) || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f23 (unsigned int s)
+{
+ if ((s & (0xf000U << BITSH)) != (0x7000 << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
+ || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == 1 || s == -1U || s == -15U
+ || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 1U + __INT_MAX__ || s == 2 || s == 24 || s == -32U
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5U || s == -63U
+ || s == -64U || s == -65U || s == 6U + __INT_MAX__ || s == -8189U
+ || s == -8191U || s == -8192U || s == -8193U || s == -8250U
+ || s == -8255U || s == -8256U || s == -8257U
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ else
+ {
+ if (s == (0x7000 << BITSH) || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f24 (unsigned int s)
+{
+ if ((s & (0xf000U << BITSH)) != (0x8000U << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1 || s == (0xbfbfU << BITSH)
+ || s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
+ || s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
+ || s == -1U || s == -15U || s == -15550U || s == -15552U
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 2 || s == 24 || s == -32U || s == (3 << (BITSM1 - 2)) + 2
+ || s == 5 || s == -5U || s == -63U || s == -64U || s == -65U
+ || s == -8189U || s == -8191U || s == -8192U || s == -8193U
+ || s == -8250U || s == -8255U || s == -8256U || s == -8257U
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (0x9000U << BITSH) - 1 || s == 1U + __INT_MAX__
+ || s == 6U + __INT_MAX__ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+/* Make this easier to run on microcontroller architectures by using a switch
+ statements instead of arrays.
+ We still don't want the compiler to constant-propagate the array contents,
+ so use an asm in each accessor function with to hide what's going on. */
+
+int
+svals (int i)
+{
+ asm ("" : "=g" (i) : "0" (i));
+ switch (i)
+ {
+ case 0: return 0;
+ case 1: return 0x1cbf;
+ case 2: return 0x1cc0;
+ case 3: return 0x1fff;
+ case 4: return 0x2000;
+ case 5: return 0x20;
+ case 6: return 0x3cbf;
+ case 7: return 0x3cc0;
+ case 8: return 0x3f;
+ case 9: return (-0x4000 << BITSH) - 1;
+ case 10: return (-0x1000 << BITSH) - 1;
+ case 11: return (-0x7000 << BITSH) - 1;
+ case 12: return (-0x5fcf << BITSH) - 1;
+ case 13: return (-0x4041 << BITSH);
+ case 14: return (-0x4000 << BITSH);
+ case 15: return (-0x1000 << BITSH);
+ case 16: return (-0x7000 << BITSH);
+ case 17: return (-0x4000 << BITSH) + 1;
+ case 18: return 1;
+ case 19: return -1;
+ case 20: return -15;
+ case 21: return -15550;
+ case 22: return -15552;
+ case 23: return (0x7000 << BITSH) - 1;
+ case 24: return (0x7000 << BITSH);
+ case 25: return (1 << (BITSM1 - 2));
+ case 26: return (1 << (BITSM1 - 2)) - 1;
+ case 27: return -__INT_MAX__ - 1;
+ case 28: return 2;
+ case 29: return 24;
+ case 30: return -32;
+ case 31: return (3 << (BITSM1 - 2)) + 2;
+ case 32: return 5;
+ case 33: return -5;
+ case 34: return -63;
+ case 35: return -64;
+ case 36: return -65;
+ case 37: return -__INT_MAX__ + 4;
+ case 38: return -8189;
+ case 39: return -8191;
+ case 40: return -8192;
+ case 41: return -8193;
+ case 42: return -8250;
+ case 43: return -8255;
+ case 44: return -8256;
+ case 45: return -8257;
+ case 46: return __INT_MAX__;
+ case 47: return -__INT_MAX__ + 7;
+#define SVAL_NUM 48
+ default: abort ();
+ }
+};
+
+unsigned int
+uvals (int i)
+{
+ asm ("" : "=g" (i) : "0" (i));
+ switch (i)
+ {
+ case 0: return 0;
+ case 1: return 0x1cbf;
+ case 2: return 0x1cc0;
+ case 3: return 0x1fff;
+ case 4: return 0x2000;
+ case 5: return 0x20;
+ case 6: return 0x3cbf;
+ case 7: return 0x3cc0;
+ case 8: return 0x3f;
+ case 9: return (0xc000U << BITSH) - 1;
+ case 10: return (0xf000U << BITSH) - 1;
+ case 11: return (0x9000U << BITSH) - 1;
+ case 12: return (0xa031U << BITSH) - 1;
+ case 13: return (0xbfbfU << BITSH);
+ case 14: return (0xc000U << BITSH);
+ case 15: return (0xf000U << BITSH);
+ case 16: return (0x9000U << BITSH);
+ case 17: return (0xc000U << BITSH) + 1;
+ case 18: return 1;
+ case 19: return -1U;
+ case 20: return -15U;
+ case 21: return -15550U;
+ case 22: return -15552U;
+ case 23: return (0x7000 << BITSH) - 1;
+ case 24: return (0x7000 << BITSH);
+ case 25: return (1 << (BITSM1 - 2));
+ case 26: return (1 << (BITSM1 - 2)) - 1;
+ case 27: return 1U + __INT_MAX__;
+ case 28: return 2;
+ case 29: return 24;
+ case 30: return -32U;
+ case 31: return (3 << (BITSM1 - 2)) + 2;
+ case 32: return 5;
+ case 33: return -5U;
+ case 34: return -63U;
+ case 35: return -64U;
+ case 36: return -65U;
+ case 37: return 6U + __INT_MAX__;
+ case 38: return -8189U;
+ case 39: return -8191U;
+ case 40: return -8192U;
+ case 41: return -8193U;
+ case 42: return -8250U;
+ case 43: return -8255U;
+ case 44: return -8256U;
+ case 45: return -8257U;
+ case 46: return __INT_MAX__;
+ case 47: return __INT_MAX__ + 9U;
+#define UVAL_NUM 48
+ default: abort ();
+ }
+};
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < SVAL_NUM; i++)
+ {
+ f2 (svals (i));
+ f4 (svals (i));
+ f5 (svals (i));
+ f7 (svals (i));
+ f8 (svals (i));
+ f11 (svals (i));
+ f12 (svals (i));
+ f15 (svals (i));
+ f16 (svals (i));
+ f17 (svals (i));
+ f18 (svals (i));
+ f19 (svals (i));
+ f20 (svals (i));
+ f21 (svals (i));
+ f22 (svals (i));
+ }
+ for (i = 0; i < UVAL_NUM; i++)
+ {
+ f1 (uvals (i));
+ f3 (uvals (i));
+ f6 (uvals (i));
+ f9 (uvals (i));
+ f10 (uvals (i));
+ f13 (uvals (i));
+ f14 (uvals (i));
+ f23 (uvals (i));
+ f24 (uvals (i));
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp66.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp66.c
new file mode 100644
index 000000000..6a6ab3463
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp66.c
@@ -0,0 +1,861 @@
+/* PR tree-optimization/52267 */
+/* { dg-do run { target { ! int16 } } } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
+#define BITSH ((sizeof (int) - sizeof (short)) * __CHAR_BIT__)
+
+void
+f1 (unsigned int s)
+{
+ if ((s & (7U << (BITSM1 - 2))) != 0)
+ {
+ if (s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
+ || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == -1U || s == -15U
+ || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == 1U + __INT_MAX__ || s == -32U
+ || s == (3 << (BITSM1 - 2)) + 2 || s == -5U || s == -63U
+ || s == -64U || s == -65U || s == 6U + __INT_MAX__ || s == -8189U
+ || s == -8191U || s == -8192U || s == -8193U || s == -8250U
+ || s == -8255U || s == -8256U || s == -8257U || s == __INT_MAX__
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f || s == 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
+ return;
+ }
+ abort ();
+}
+
+void
+f2 (int s)
+{
+ if ((s & (7U << (BITSM1 - 2))) == 0)
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f || s == 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
+ return;
+ }
+ else
+ {
+ if (s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == -1 || s == -15 || s == -15550
+ || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == -__INT_MAX__ - 1 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
+ || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f3 (unsigned int s)
+{
+ if ((s & 0x3cc0) == 0)
+ {
+ if (s == 0 || s == 0x20 || s == 0x3f || s == (0xbfbfU << BITSH)
+ || s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
+ || s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == 1U + __INT_MAX__ || s == 2 || s == 24
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == 6U + __INT_MAX__
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ else
+ {
+ if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x3cbf || s == 0x3cc0 || s == (0xc000U << BITSH) - 1
+ || s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
+ || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == -32U || s == -5U
+ || s == -63U || s == -64U || s == -65U || s == -8189U || s == -8191U
+ || s == -8192U || s == -8193U || s == -8250U || s == -8255U
+ || s == -8256U || s == -8257U || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f4 (int s)
+{
+ if ((s & 0x3cc0) == 0)
+ {
+ if (s == 0 || s == 0x20 || s == 0x3f || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
+ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x3cbf || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15 || s == -15550
+ || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f5 (int s)
+{
+ if ((s & 0x3cc0U) == 0)
+ {
+ if (s == 0 || s == 0x20 || s == 0x3f || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
+ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x3cbf || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15 || s == -15550
+ || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f6 (unsigned int s)
+{
+ if ((s & 0x3cc0) == 0x3cc0)
+ {
+ if (s == 0x3cc0 || s == (0xc000U << BITSH) - 1
+ || s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
+ || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32U || s == -5U || s == -63U || s == -64U
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (0xbfbfU << BITSH)
+ || s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
+ || s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
+ || s == -15550U || s == -15552U || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65U
+ || s == 6U + __INT_MAX__ || s == -8189U || s == -8191U
+ || s == -8192U || s == -8193U || s == -8250U || s == -8255U
+ || s == -8256U || s == -8257U || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f7 (int s)
+{
+ if ((s & 0x3cc0) == 0x3cc0)
+ {
+ if (s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15
+ || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32 || s == -5 || s == -63 || s == -64 || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == -__INT_MAX__ - 1 || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65
+ || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f8 (int s)
+{
+ if ((s & 0x3cc0U) == 0x3cc0)
+ {
+ if (s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15
+ || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32 || s == -5 || s == -63 || s == -64 || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == -__INT_MAX__ - 1 || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65
+ || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f9 (unsigned int s)
+{
+ if ((s & 0x3cc0) >= 0x1cc0)
+ {
+ if (s == 0x1cc0 || s == 0x1fff || s == 0x2000 || s == 0x3cbf
+ || s == 0x3cc0 || s == (0xc000U << BITSH) - 1
+ || s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
+ || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
+ || s == -8189U || s == -8191U || s == -8192U || s == -8193U
+ || s == -8250U || s == -8255U || s == -8256U || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x20 || s == 0x3f
+ || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == 1 || s == -15550U
+ || s == -15552U || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
+ || s == 6U + __INT_MAX__ || s == -8257U || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f10 (unsigned int s)
+{
+ if ((s & 0x3cc0) > 0x1cc0)
+ {
+ if (s == 0x2000 || s == 0x3cbf || s == 0x3cc0
+ || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
+ || s == -1U || s == -15U || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == -32U || s == -5U
+ || s == -63U || s == -64U || s == -65U || s == -8189U || s == -8191U
+ || s == -8192U || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x20
+ || s == 0x3f || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == 1 || s == -15550U
+ || s == -15552U || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
+ || s == 6U + __INT_MAX__ || s == -8193U || s == -8250U
+ || s == -8255U || s == -8256U || s == -8257U
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f11 (int s)
+{
+ if ((s & 0x3cc0) >= 0x1cc0)
+ {
+ if (s == 0x1cc0 || s == 0x1fff || s == 0x2000 || s == 0x3cbf
+ || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15
+ || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
+ || s == -32 || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x20 || s == 0x3f
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -15550
+ || s == -15552 || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
+ || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f12 (int s)
+{
+ if ((s & 0x3cc0) > 0x1cc0)
+ {
+ if (s == 0x2000 || s == 0x3cbf || s == 0x3cc0
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == -1 || s == -15 || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x20
+ || s == 0x3f || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -15550
+ || s == -15552 || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
+ || s == -8193 || s == -8250 || s == -8255 || s == -8256
+ || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f13 (unsigned int s)
+{
+ if ((s & (0xe071U << BITSH)) > (0xb030U << BITSH))
+ {
+ if (s == (0xf000U << BITSH) - 1 || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0xc000U << BITSH) + 1
+ || s == -1U || s == -15U || s == -15550U || s == -15552U
+ || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
+ || s == -8189U || s == -8191U || s == -8192U || s == -8193U
+ || s == -8250U || s == -8255U || s == -8256U || s == -8257U)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (0xc000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1 || s == (0xbfbfU << BITSH)
+ || s == (0x9000U << BITSH) || s == 1 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
+ || s == 6U + __INT_MAX__ || s == __INT_MAX__
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f14 (unsigned int s)
+{
+ if ((s & (0xe071U << BITSH)) > (0xa030U << BITSH))
+ {
+ if (s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0xc000U << BITSH) + 1
+ || s == -1U || s == -15U || s == -15550U || s == -15552U
+ || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
+ || s == -8189U || s == -8191U || s == -8192U || s == -8193U
+ || s == -8250U || s == -8255U || s == -8256U || s == -8257U)
+ return;
+ }
+ else
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
+ || s == (0x9000U << BITSH) || s == 1 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 1U + __INT_MAX__ || s == 2
+ || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
+ || s == 6U + __INT_MAX__ || s == __INT_MAX__
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+void
+f15 (int s)
+{
+ if ((s & ((-0x1f8f) << BITSH)) > ((-0x4fd0) << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -1 || s == -15 || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
+ || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == -8257
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x7000 << BITSH) || s == -__INT_MAX__ - 1
+ || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f16 (int s)
+{
+ if ((s & ((-0x1f8f) << BITSH)) >= ((-0x4fd0) << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -1 || s == -15 || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
+ || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == -8257
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x7000 << BITSH) || s == -__INT_MAX__ - 1
+ || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f17 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != -__INT_MAX__ - 1)
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
+ || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == -32
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
+ || s == -8191 || s == -8192 || s == -8193 || s == -8250
+ || s == -8255 || s == -8256 || s == -8257 || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (-0x4041 << BITSH) || s == (-0x7000 << BITSH)
+ || s == -__INT_MAX__ - 1 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f18 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != ((-0x4000 << BITSH) | 1))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == 1 || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -64
+ || s == -__INT_MAX__ + 4 || s == -8192 || s == -8250 || s == -8256
+ || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH) + 1
+ || s == -1 || s == -15 || s == -5 || s == -63 || s == -65
+ || s == -8189 || s == -8191 || s == -8193 || s == -8255
+ || s == -8257)
+ return;
+ }
+ abort ();
+}
+
+void
+f19 (int s)
+{
+ if ((s & ((-0x4000 << BITSH) | 1)) != ((0x4000 << BITSH) | 1))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
+ || s == -8191 || s == -8192 || s == -8193 || s == -8250
+ || s == -8255 || s == -8256 || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == (0x7000 << BITSH) - 1 || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f20 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != -__INT_MAX__ - 1)
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
+ || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == -1 || s == -15 || s == -15550 || s == -15552
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
+ || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
+ || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == -8257
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (-0x7000 << BITSH) - 1 || s == -__INT_MAX__ - 1
+ || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ abort ();
+}
+
+void
+f21 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != (-0x1000 << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
+ || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == (-0x1000 << BITSH) || s == -1 || s == -15 || s == -15550
+ || s == -15552 || s == -32 || s == -5 || s == -63 || s == -64
+ || s == -65 || s == -8189 || s == -8191 || s == -8192 || s == -8193
+ || s == -8250 || s == -8255 || s == -8256 || s == -8257)
+ return;
+ }
+ abort ();
+}
+
+void
+f22 (int s)
+{
+ if ((s & (-0x1000 << BITSH)) != (0x7000 << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
+ || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
+ || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
+ || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
+ || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
+ || s == -15550 || s == -15552 || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
+ || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
+ || s == -8191 || s == -8192 || s == -8193 || s == -8250
+ || s == -8255 || s == -8256 || s == -8257 || s == -__INT_MAX__ + 7)
+ return;
+ }
+ else
+ {
+ if (s == (0x7000 << BITSH) || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f23 (unsigned int s)
+{
+ if ((s & (0xf000U << BITSH)) != (0x7000 << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
+ || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
+ || s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
+ || s == (0xc000U << BITSH) + 1 || s == 1 || s == -1U || s == -15U
+ || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 1U + __INT_MAX__ || s == 2 || s == 24 || s == -32U
+ || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5U || s == -63U
+ || s == -64U || s == -65U || s == 6U + __INT_MAX__ || s == -8189U
+ || s == -8191U || s == -8192U || s == -8193U || s == -8250U
+ || s == -8255U || s == -8256U || s == -8257U
+ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ else
+ {
+ if (s == (0x7000 << BITSH) || s == __INT_MAX__)
+ return;
+ }
+ abort ();
+}
+
+void
+f24 (unsigned int s)
+{
+ if ((s & (0xf000U << BITSH)) != (0x8000U << BITSH))
+ {
+ if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
+ || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
+ || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
+ || s == (0xa031U << BITSH) - 1 || s == (0xbfbfU << BITSH)
+ || s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
+ || s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
+ || s == -1U || s == -15U || s == -15550U || s == -15552U
+ || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
+ || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
+ || s == 2 || s == 24 || s == -32U || s == (3 << (BITSM1 - 2)) + 2
+ || s == 5 || s == -5U || s == -63U || s == -64U || s == -65U
+ || s == -8189U || s == -8191U || s == -8192U || s == -8193U
+ || s == -8250U || s == -8255U || s == -8256U || s == -8257U
+ || s == __INT_MAX__)
+ return;
+ }
+ else
+ {
+ if (s == (0x9000U << BITSH) - 1 || s == 1U + __INT_MAX__
+ || s == 6U + __INT_MAX__ || s == __INT_MAX__ + 9U)
+ return;
+ }
+ abort ();
+}
+
+int svals[] = {
+ 0,
+ 0x1cbf,
+ 0x1cc0,
+ 0x1fff,
+ 0x2000,
+ 0x20,
+ 0x3cbf,
+ 0x3cc0,
+ 0x3f,
+ (-0x4000 << BITSH) - 1,
+ (-0x1000 << BITSH) - 1,
+ (-0x7000 << BITSH) - 1,
+ (-0x5fcf << BITSH) - 1,
+ (-0x4041 << BITSH),
+ (-0x4000 << BITSH),
+ (-0x1000 << BITSH),
+ (-0x7000 << BITSH),
+ (-0x4000 << BITSH) + 1,
+ 1,
+ -1,
+ -15,
+ -15550,
+ -15552,
+ (0x7000 << BITSH) - 1,
+ (0x7000 << BITSH),
+ (1 << (BITSM1 - 2)),
+ (1 << (BITSM1 - 2)) - 1,
+ -__INT_MAX__ - 1,
+ 2,
+ 24,
+ -32,
+ (3 << (BITSM1 - 2)) + 2,
+ 5,
+ -5,
+ -63,
+ -64,
+ -65,
+ -__INT_MAX__ + 4,
+ -8189,
+ -8191,
+ -8192,
+ -8193,
+ -8250,
+ -8255,
+ -8256,
+ -8257,
+ __INT_MAX__,
+ -__INT_MAX__ + 7,
+};
+
+unsigned int uvals[] = {
+ 0,
+ 0x1cbf,
+ 0x1cc0,
+ 0x1fff,
+ 0x2000,
+ 0x20,
+ 0x3cbf,
+ 0x3cc0,
+ 0x3f,
+ (0xc000U << BITSH) - 1,
+ (0xf000U << BITSH) - 1,
+ (0x9000U << BITSH) - 1,
+ (0xa031U << BITSH) - 1,
+ (0xbfbfU << BITSH),
+ (0xc000U << BITSH),
+ (0xf000U << BITSH),
+ (0x9000U << BITSH),
+ (0xc000U << BITSH) + 1,
+ 1,
+ -1U,
+ -15U,
+ -15550U,
+ -15552U,
+ (0x7000 << BITSH) - 1,
+ (0x7000 << BITSH),
+ (1 << (BITSM1 - 2)),
+ (1 << (BITSM1 - 2)) - 1,
+ 1U + __INT_MAX__,
+ 2,
+ 24,
+ -32U,
+ (3 << (BITSM1 - 2)) + 2,
+ 5,
+ -5U,
+ -63U,
+ -64U,
+ -65U,
+ 6U + __INT_MAX__,
+ -8189U,
+ -8191U,
+ -8192U,
+ -8193U,
+ -8250U,
+ -8255U,
+ -8256U,
+ -8257U,
+ __INT_MAX__,
+ __INT_MAX__ + 9U,
+};
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < sizeof (svals) / sizeof (svals[0]); i++)
+ {
+ f2 (svals[i]);
+ f4 (svals[i]);
+ f5 (svals[i]);
+ f7 (svals[i]);
+ f8 (svals[i]);
+ f11 (svals[i]);
+ f12 (svals[i]);
+ f15 (svals[i]);
+ f16 (svals[i]);
+ f17 (svals[i]);
+ f18 (svals[i]);
+ f19 (svals[i]);
+ f20 (svals[i]);
+ f21 (svals[i]);
+ f22 (svals[i]);
+ }
+ for (i = 0; i < sizeof (uvals) / sizeof (uvals[0]); i++)
+ {
+ f1 (uvals[i]);
+ f3 (uvals[i]);
+ f6 (uvals[i]);
+ f9 (uvals[i]);
+ f10 (uvals[i]);
+ f13 (uvals[i]);
+ f14 (uvals[i]);
+ f23 (uvals[i]);
+ f24 (uvals[i]);
+ }
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c
new file mode 100644
index 000000000..f02d83780
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+unsigned foo (unsigned i)
+{
+ if (i == 2)
+ {
+ i = i << 2;
+ if (i != 8)
+ link_error ();
+ }
+ return i;
+}
+unsigned bar (unsigned i)
+{
+ if (i == 1 << (sizeof (unsigned) * 8 - 1))
+ {
+ i = i << 1;
+ if (i != 0)
+ link_error ();
+ }
+ return i;
+}
+unsigned baz (unsigned i)
+{
+ i = i & 15;
+ if (i == 0)
+ return 0;
+ i = 1000 - i;
+ i >>= 1;
+ i <<= 1;
+ if (i == 0)
+ link_error ();
+ return i;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate" 3 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp68.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp68.c
new file mode 100644
index 000000000..4f977f401
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp68.c
@@ -0,0 +1,18 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+#include "vrp.h"
+
+void test1 (int i, int j, int b)
+{
+ RANGE(i, 2, 6);
+ ANTI_RANGE(j, 1, 7);
+ MERGE(b, i, j);
+ CHECK_ANTI_RANGE(i, 1, 1);
+}
+int main() { }
+
+/* VRP will arbitrarily choose ~[1, 1] when merging [2, 6] with ~[1, 7]. */
+
+/* { dg-final { scan-tree-dump-times "link_error" 0 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp69.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp69.c
new file mode 100644
index 000000000..d7540c9e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp69.c
@@ -0,0 +1,38 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+#include "vrp.h"
+
+void test1(int i, int j)
+{
+ RANGE(i, 1, 5);
+ RANGE(j, 7, 10);
+ CHECK_RANGE(i + j, 8, 15);
+}
+
+#define UINT_MAX 2*(unsigned)__INT_MAX__ + 1
+void test2(unsigned int i)
+{
+ RANGE(i, UINT_MAX - 0x4, UINT_MAX - 0x1);
+ CHECK_ANTI_RANGE(i + 0x2, 0x1, UINT_MAX - 0x3);
+}
+void test3(unsigned int i)
+{
+ RANGE(i, UINT_MAX - 0x4, UINT_MAX - 0x1);
+ CHECK_RANGE(i + 0x5, 0x0, 0x3);
+}
+void test4(unsigned int i)
+{
+ RANGE(i, 2, 4);
+ CHECK_ANTI_RANGE(i - 4, 1, UINT_MAX - 2);
+}
+void test5(unsigned int i)
+{
+ RANGE(i, 2, 4);
+ CHECK_RANGE(i - 8, UINT_MAX - 5, UINT_MAX - 3);
+}
+
+int main() {}
+
+/* { dg-final { scan-tree-dump-times "link_error" 0 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp70.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp70.c
new file mode 100644
index 000000000..e9a7563dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp70.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void link_error (void);
+
+void
+foo (unsigned int s)
+{
+ if (s + 0x70000000 < 0xf0000000U)
+ {
+ if (s >= 0x80000000U && s < 0x90000000U)
+ link_error ();
+ }
+}
+
+void
+bar (unsigned int s)
+{
+ if (s + 0x70000000 >= 0xf0000000U)
+ {
+ if (s < 0x80000000U || s >= 0x90000000U)
+ link_error ();
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp71.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp71.c
new file mode 100644
index 000000000..2d1a24029
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp71.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int foo(int *p)
+{
+ int x = -10;
+ if (p[0]) x++;
+ if (p[1]) x++;
+ if (p[2]) x++;
+ if (p[3]) x++;
+ x <<= 2;
+ return (x > 0);
+}
+
+int bar(char c)
+{
+ int i = c << 1;
+ return i > 1000;
+}
+
+/* { dg-final { scan-tree-dump-times "return 0;" 2 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp72.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp72.c
new file mode 100644
index 000000000..0b12aad0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp72.c
@@ -0,0 +1,31 @@
+/* { dg-options "-O2" } */
+
+typedef __INTPTR_TYPE__ intptr_t;
+typedef unsigned long long uint64_t;
+
+static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val)
+{
+ *(volatile uint64_t *)(intptr_t)addr = val;
+};
+static inline uint64_t cvmx_read64_uint64(uint64_t addr)
+{
+ return *(volatile uint64_t *)(intptr_t)addr;
+};
+
+static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val)
+{
+ cvmx_write64_uint64 (csr_addr, val);
+ if ((csr_addr >> 40) != 0x800118)
+ linker_error ();
+}
+
+int uart;
+
+int
+main ()
+{
+ cvmx_write_csr (((((uint64_t) 2LL) << 62)
+ | (0x0001180000000808ull+((uart&0xff)*1024))),
+ 0xfff);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp73.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp73.c
new file mode 100644
index 000000000..ea557fd9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp73.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O2" } */
+
+__extension__ typedef __INTPTR_TYPE__ intptr_t;
+
+typedef unsigned long long uint64_t;
+
+static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val)
+{
+ *(volatile uint64_t *)(intptr_t)addr = val;
+};
+static inline uint64_t cvmx_read64_uint64(uint64_t addr)
+{
+ return *(volatile uint64_t *)(intptr_t)addr;
+};
+
+static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val)
+{
+ cvmx_write64_uint64 (csr_addr, val);
+ if ((csr_addr >> 40) == 0x800118)
+ linker_error ();
+}
+
+int dest_core, src_core;
+
+int
+main ()
+{
+ cvmx_write_csr ((((((uint64_t)2LL) << 62)
+ | ((0x0001070000000600ull+((dest_core&0xff)*8))))),
+ 1ull << src_core);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp74.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp74.c
new file mode 100644
index 000000000..b15186fea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp74.c
@@ -0,0 +1,23 @@
+/* { dg-options "-O2" } */
+
+void abort (void);
+void exit (int);
+
+__attribute__ ((noinline)) void
+f (unsigned long long i)
+{
+ if (i <= 0x1000000000000000ull)
+ {
+ unsigned long long j = i | 0x1000000000000000ull;
+ if (j == 0x1100000000000000ull)
+ exit (0);
+ }
+}
+
+int
+main ()
+{
+ f (0x0100000000000000ull);
+ abort ();
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp75.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp75.c
new file mode 100644
index 000000000..42b338707
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp75.c
@@ -0,0 +1,32 @@
+/* { dg-options "-O2" } */
+
+__extension__ typedef __INTPTR_TYPE__ intptr_t;
+typedef unsigned long long uint64_t;
+
+static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val)
+{
+ *(volatile uint64_t *)(intptr_t)addr = val;
+};
+static inline uint64_t cvmx_read64_uint64(uint64_t addr)
+{
+ return *(volatile uint64_t *)(intptr_t)addr;
+};
+static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val)
+{
+ cvmx_write64_uint64 (csr_addr, val);
+ if ((csr_addr >> 40) != 0x800118)
+ linker_error ();
+}
+
+int interface;
+int idx;
+
+int
+main ()
+{
+ cvmx_write_csr((((((uint64_t) 2LL) << 62)
+ | ((0x0001180008000208ull
+ + (((idx)&3)*2048)
+ + (((interface)&1)*0x8000000ull))))), 1);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp76.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp76.c
new file mode 100644
index 000000000..c8b8595c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp76.c
@@ -0,0 +1,35 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fno-tree-switch-conversion" } */
+
+/* Based on f3 from vrp63.c, but with switch instead of if-chain. This test
+ tests the propagation of an anti-range in a switch statement. */
+
+extern void link_error (void);
+
+void
+f3 (int s)
+{
+ if (s >> 3 == -2)
+ /* s in range [ -16, -9]. */
+ ;
+ else
+ {
+ /* s in range ~[-16, -9], so none of the case labels can be taken. */
+ switch (s)
+ {
+ case -16:
+ case -12:
+ case -9:
+ link_error ();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp77.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp77.c
new file mode 100644
index 000000000..c0a8a8653
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp77.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#ifdef __SIZEOF_INT128__
+#define T __int128
+#else
+#define T long long
+#endif
+
+extern void impossible (void);
+
+void f(T x)
+{
+ unsigned T y;
+ unsigned T z;
+ if (x < -7)
+ return;
+ if (x > 2)
+ return;
+ y = x;
+ z = y * y;
+ if (z == 666)
+ impossible ();
+}
+
+void g(unsigned T x)
+{
+ unsigned T y;
+ unsigned T z;
+ unsigned T m = -1;
+ m = m / 2;
+ if (x < m-2)
+ return;
+ if (x > m-1)
+ return;
+ y = x;
+ z = y * y;
+ /* The product (ignoring it is a square) has only 3 possible values:
+ 4, 9 and 2^127+6. At least one of the values 7, 666 and -666 is
+ known to be impossible. 7 is the most logical in the current
+ implementation. */
+ if (z == 7)
+ impossible ();
+}
+
+/* { dg-final { scan-tree-dump-not "impossible" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp78.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp78.c
new file mode 100644
index 000000000..e08d1ffdf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp78.c
@@ -0,0 +1,34 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+/* Based on f3 from vrp63.c, but with switch instead of if-chain. */
+
+extern void link_error (void);
+
+void
+f3 (int s)
+{
+ if (s >> 3 == -2)
+ /* s in range [ -16, -9]. */
+ ;
+ else
+ {
+ /* s in range ~[-16, -9], so none of the case labels can be taken. */
+ switch (s)
+ {
+ case -16:
+ case -12:
+ case -9:
+ link_error ();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp79.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp79.c
new file mode 100644
index 000000000..88c1bd858
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp79.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#ifdef __SIZEOF_INT128__
+typedef unsigned __int128 NT;
+#else
+typedef unsigned long long NT;
+#endif
+
+extern void do_not_go_away ();
+
+void f (NT x, NT y)
+{
+ NT n = 1;
+ n <<= (__CHAR_BIT__ * sizeof (NT) - 1);
+ if (x > n) return;
+ if (y > n) return;
+ NT z = x + y;
+ if (z == 42) do_not_go_away ();
+}
+
+/* { dg-final { scan-tree-dump "do_not_go_away" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp80.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp80.c
new file mode 100644
index 000000000..2d0004010
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp80.c
@@ -0,0 +1,33 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fno-tree-switch-conversion" } */
+
+extern void link_error (void);
+
+/* Test <<. */
+
+void
+f3 (int s, int b)
+{
+ if (s >> 3 == -2)
+ /* s in range [-16, -9]. */
+ {
+ s += 17;
+ /* s in range [1, 8]. */
+ b = (b & 1) + 1;
+ /* b in range [1, 2]. */
+ b = b << s;
+ /* b in range [bmin << smin, bmax << smax],
+ == [1 << 1, 2 << 8]
+ == [2, 512]. */
+ if (b == 1 || b == 513)
+ link_error ();
+ }
+}
+
+int
+main ()
+{
+ return 0;
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp81.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp81.c
new file mode 100644
index 000000000..bb38f27c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp81.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-switch-conversion -fdump-tree-vrp1" } */
+
+extern void vrp_keep (void);
+
+/* Test <<. */
+
+void
+f3 (int s, int b)
+{
+ if (s >> 3 == -2)
+ /* s in range [-16, -9]. */
+ {
+ s += 17;
+ /* s in range [1, 8]. */
+ b = (b & 1) + 1;
+ /* b in range [1, 2]. */
+ b = b << s;
+ /* b in range [bmin << smin, bmax << smax],
+ == [1 << 1, 2 << 8]
+ == [2, 512]. */
+ if (b == 2)
+ vrp_keep ();
+ if (b == 512)
+ vrp_keep ();
+ }
+}
+
+int
+main ()
+{
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vrp_keep \\(" 2 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp82.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp82.c
new file mode 100644
index 000000000..8f9b2ff05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp82.c
@@ -0,0 +1,57 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+extern void link_error (void);
+
+void
+f2 (int c, int b)
+{
+ int s = 0;
+ if (c == 0)
+ s += 1;
+ else if (c < 1)
+ s -= 1;
+ /* s in [-1, 1]. */
+ b = (b & 1) + 1;
+ /* b in range [1, 2]. */
+ b = s << b;
+ /* b in range [-4, 4]. */
+ if (b == -5 || b == 5)
+ link_error ();
+}
+
+void
+f3 (int s, int b)
+{
+ if (s >> 3 == -2)
+ {
+ /* s in range [-16, -9]. */
+ b = (b & 1) + 1;
+ /* b in range [1, 2]. */
+ b = s << b;
+ /* b in range [bmin << smax, bmax << smin],
+ == [-16 << 2, -9 << 1]
+ == [-64, -18]. */
+ if (b == -65 || b == -17)
+ link_error ();
+ }
+}
+
+void
+f4 (unsigned int s, unsigned int b)
+{
+ s |= ~0xffU;
+ /* s in [0xffffff00, 0xffffffff]. */
+ b = (b & 1) + 1;
+ /* b in [1, 2]. */
+ b = s << b;
+ /* s in [0xfffffc00, 0xfffffffe]. */
+ if (b == ~0x3ffU - 1 || b == ~0x1U + 1)
+ link_error ();
+}
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp83.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp83.c
new file mode 100644
index 000000000..6237adfe9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp83.c
@@ -0,0 +1,60 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void vrp_keep (void);
+
+void
+f2 (int c, int b)
+{
+ int s = 0;
+ if (c == 0)
+ s += 1;
+ else if (c < 1)
+ s -= 1;
+ /* s in [-1, 1]. */
+ b = (b & 1) + 1;
+ /* b in range [1, 2]. */
+ b = s << b;
+ /* b in range [-4, 4]. */
+ if (b == -4)
+ vrp_keep ();
+ if (b == 4)
+ vrp_keep ();
+}
+
+void
+f3 (int s, int b)
+{
+ if (s >> 3 == -2)
+ {
+ /* s in range [-16, -9]. */
+ b = (b & 1) + 1;
+ /* b in range [1, 2]. */
+ b = s << b;
+ /* b in range [bmin << smax, bmax << smin],
+ == [-16 << 2, -9 << 1]
+ == [-64, -18]. */
+ if (b == -64)
+ vrp_keep ();
+ if (b == -18)
+ vrp_keep ();
+ }
+}
+
+void
+f4 (unsigned int s, unsigned int b)
+{
+ s |= ~(0xffU);
+ /* s in [0xffffff00, 0xffffffff]. */
+ b = (b & 1) + 1;
+ /* b in [1, 2]. */
+ b = s << b;
+ /* s in [0xfffffc00, 0xfffffffe]. */
+ if (b == ~0x3ffU)
+ vrp_keep ();
+ if (b == ~0x1U)
+ vrp_keep ();
+}
+
+/* { dg-final { scan-tree-dump-times "vrp_keep \\(" 6 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp84.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp84.c
new file mode 100644
index 000000000..8f8dc0d2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp84.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void vrp_keep (void);
+
+void
+f2 (int s, int b)
+{
+ if (s > 1)
+ s = 1;
+ /* s in [minint, 1]. */
+ b = (b & 1) + 1;
+ /* b in range [1, 2]. */
+ b = s << b;
+ /* b in range [minint+4, maxint-3]. */
+ if (b == -2)
+ vrp_keep ();
+}
+
+/* { dg-final { scan-tree-dump-times "vrp_keep \\(" 1 "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp85.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp85.c
new file mode 100644
index 000000000..ad2b38d02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp85.c
@@ -0,0 +1,40 @@
+/* PR tree-optimization/54810 */
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+extern void link_error (void);
+
+#define T(n, ntype, wtype) \
+void \
+f##n (wtype s) \
+{ \
+ if ((ntype) s == 0) \
+ return; \
+ if (s == 0) \
+ link_error (); \
+}
+
+T(1, unsigned char, unsigned char)
+T(2, unsigned char, unsigned short)
+T(3, unsigned char, unsigned int)
+T(4, unsigned char, unsigned long int)
+T(5, unsigned char, unsigned long long int)
+T(6, unsigned short int, unsigned short int)
+T(7, unsigned short int, unsigned int)
+T(8, unsigned short int, unsigned long int)
+T(9, unsigned short int, unsigned long long int)
+T(10, unsigned int, unsigned int)
+T(11, unsigned int, unsigned long int)
+T(12, unsigned int, unsigned long long int)
+T(13, unsigned long int, unsigned long int)
+T(14, unsigned long int, unsigned long long int)
+T(15, unsigned long long int, unsigned long long int)
+
+int
+main ()
+{
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "link_error" "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp86.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp86.c
new file mode 100644
index 000000000..ee7ed5f08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp86.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/54471 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+#ifdef __SIZEOF_INT128__
+#define T __int128
+#else
+#define T long long
+#endif
+
+void fn1call (void);
+void fn2call (void);
+
+void
+foo (unsigned T x)
+{
+ if (x > (unsigned T) -3)
+ return;
+ unsigned T y = 2 * x;
+ if (y == 42)
+ fn1call ();
+ else
+ fn2call ();
+}
+
+/* { dg-final { scan-tree-dump "fn1call" "vrp1"} } */
+/* { dg-final { scan-tree-dump "fn2call" "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp87.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp87.c
new file mode 100644
index 000000000..ab399b50e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp87.c
@@ -0,0 +1,84 @@
+/* Setting LOGICAL_OP_NON_SHORT_CIRCUIT to 0 leads to two conditional jumps
+ when evaluating an && condition. VRP is not able to optimize this. */
+/* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* } } } } } */
+
+/* { dg-options "-O2 -fdump-tree-vrp2-details -fdump-tree-cddce2-details" } */
+
+struct bitmap_head_def;
+typedef struct bitmap_head_def *bitmap;
+typedef const struct bitmap_head_def *const_bitmap;
+
+
+typedef unsigned long BITMAP_WORD;
+typedef struct bitmap_element_def
+{
+ struct bitmap_element_def *next;
+ unsigned int indx;
+ BITMAP_WORD bits[((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u))];
+} bitmap_element;
+
+
+
+
+
+
+typedef struct bitmap_head_def
+{
+ bitmap_element *first;
+
+} bitmap_head;
+
+
+
+static __inline__ unsigned char
+bitmap_elt_ior (bitmap dst, bitmap_element * dst_elt,
+ bitmap_element * dst_prev, const bitmap_element * a_elt,
+ const bitmap_element * b_elt, unsigned char changed)
+{
+
+ if (a_elt)
+ {
+
+ if (!changed && dst_elt)
+ {
+ changed = 1;
+ }
+ }
+ else
+ {
+ changed = 1;
+ }
+ return changed;
+}
+
+unsigned char
+bitmap_ior_into (bitmap a, const_bitmap b)
+{
+ bitmap_element *a_elt = a->first;
+ const bitmap_element *b_elt = b->first;
+ bitmap_element *a_prev = ((void *) 0);
+ unsigned char changed = 0;
+
+ while (b_elt)
+ {
+
+ if (!a_elt || a_elt->indx == b_elt->indx)
+ changed = bitmap_elt_ior (a, a_elt, a_prev, a_elt, b_elt, changed);
+ else if (a_elt->indx > b_elt->indx)
+ changed = 1;
+ b_elt = b_elt->next;
+
+
+ }
+
+ return changed;
+}
+
+/* Verify that VRP simplified an "if" statement. */
+/* { dg-final { scan-tree-dump "Folded into: if.*" "vrp2"} } */
+/* Verify that DCE after VRP2 eliminates a dead conversion
+ to a (Bool). */
+/* { dg-final { scan-tree-dump "Deleting.*_Bool.*;" "cddce2"} } */
+/* { dg-final { cleanup-tree-dump "vrp2" } } */
+/* { dg-final { cleanup-tree-dump "cddce2" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp88.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp88.c
new file mode 100644
index 000000000..e43bdffbb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp88.c
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+
+/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
+
+
+typedef const struct bitmap_head_def *const_bitmap;
+typedef unsigned long BITMAP_WORD;
+typedef struct bitmap_element_def {
+ struct bitmap_element_def *next;
+ BITMAP_WORD bits[((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u))];
+} bitmap_element;
+typedef struct bitmap_head_def {
+ bitmap_element *first;
+} bitmap_head;
+unsigned char
+bitmap_single_bit_set_p (const_bitmap a)
+{
+ unsigned long count = 0;
+ const bitmap_element *elt;
+ unsigned ix;
+ if ((!(a)->first))
+ return 0;
+ elt = a->first;
+ if (elt->next != ((void *)0))
+ return 0;
+ for (ix = 0; ix != ((128 + (8 * 8 * 1u) - 1) / (8 * 8 * 1u)); ix++)
+ {
+ count += __builtin_popcountl (elt->bits[ix]);
+ if (count > 1)
+ return 0;
+ }
+ return count == 1;
+}
+
+/* Verify that VRP simplified an "if" statement. */
+/* { dg-final { scan-tree-dump "Folded into: if.*" "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp89.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp89.c
new file mode 100644
index 000000000..3e1d96e42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp89.c
@@ -0,0 +1,57 @@
+/* PR target/29776 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-final { scan-tree-dump-not "link_error" "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
+#define A(fn, arg, min, max) \
+ if (__builtin_##fn (arg) < min || __builtin_##fn (arg) > max) \
+ link_error ();
+#define B(fn, min, max) \
+ A (fn, a, min, max) A (fn##l, b, min, max) A (fn##ll, c, min, max)
+#define C(fn, min, sub) \
+ A (fn, a, min, ((int) sizeof (a) * __CHAR_BIT__ - sub)) \
+ A (fn##l, b, min, ((int) sizeof (b) * __CHAR_BIT__ - sub)) \
+ A (fn##ll, c, min, ((int) sizeof (c) * __CHAR_BIT__ - sub))
+#define D(fn, sub1, sub2) \
+ A (fn, a, ((int) sizeof (a) * __CHAR_BIT__ - sub1), \
+ ((int) sizeof (a) * __CHAR_BIT__ - sub2)) \
+ A (fn##l, b, ((int) sizeof (b) * __CHAR_BIT__ - sub1), \
+ ((int) sizeof (b) * __CHAR_BIT__ - sub2)) \
+ A (fn##ll, c, ((int) sizeof (c) * __CHAR_BIT__ - sub1), \
+ ((int) sizeof (c) * __CHAR_BIT__ - sub2))
+
+extern void link_error (void);
+
+unsigned int d;
+unsigned long e;
+unsigned long long f;
+
+void
+foo (unsigned int a, unsigned long b, unsigned long long c)
+{
+ B (parity, 0, 1)
+ C (ffs, 0, 0)
+ C (popcount, 0, 0)
+ C (clz, 0, 0)
+ C (ctz, -1, 0)
+ a &= 63;
+ b &= 63;
+ c &= 63;
+ B (ffs, 0, 6)
+ B (popcount, 0, 6)
+ a += 3; b += 3; c += 3;
+ B (ffs, 1, 7)
+ B (popcount, 1, 7)
+ a = 32U + (d & 1023U);
+ b = 32UL + (e & 1023UL);
+ c = 32ULL + (f & 1023ULL);
+ D (clz, 11, 6)
+ B (ctz, 0, 10)
+}
+
+void
+bar (int a, long b, long long c)
+{
+ C (clrsb, 0, 1)
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp90.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp90.c
new file mode 100644
index 000000000..836c335b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp90.c
@@ -0,0 +1,36 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-final { scan-tree-dump-not "link_error" "vrp1"} } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
+
+extern void link_error (void);
+
+__attribute__((noinline, noclone)) int
+foo (unsigned int n, int r)
+{
+ int i;
+ if (n > 0)
+ {
+ asm ("");
+ if (n < 10)
+ {
+ asm ("");
+ do
+ {
+ --n;
+ r *= 2;
+ if (n >= 9)
+ link_error ();
+ }
+ while (n > 0);
+ }
+ }
+ return r + n;
+}
+
+int
+main ()
+{
+ foo (7, 2);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-1.c
new file mode 100644
index 000000000..9d0af1f23
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-1.c
@@ -0,0 +1,23 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fwhole-program" } */
+int b[100];
+void abort (void);
+
+void
+large_function ()
+{
+ int i;
+ for (i = 0; i < 99; i++)
+ if (b[i] / (b[i+1] + 1))
+ abort ();
+}
+
+main ()
+{
+ large_function ();
+}
+
+/* Function should be inlined as called once. */
+/* { dg-final { scan-tree-dump-not "large_function" "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-2.c
new file mode 100644
index 000000000..bbdd0dd48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/wholeprogram-2.c
@@ -0,0 +1,8 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fwhole-program" } */
+__attribute__ ((externally_visible))
+void
+externally_visible_function ()
+{
+}
+/* { dg-final { scan-tree-dump "externally_visible_function" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/trunc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/trunc-1.c
new file mode 100644
index 000000000..a78cceb59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/trunc-1.c
@@ -0,0 +1,15 @@
+/* Origin: PR c/675 from aj@suse.de. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+#include <stddef.h>
+
+int
+main (void)
+{
+ size_t len;
+
+ len = ~(sizeof (size_t) - 1); /* { dg-bogus "truncated" "bogus truncation warning" } */
+
+ return len - len;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tsan/tsan.exp b/gcc-4.9/gcc/testsuite/gcc.dg/tsan/tsan.exp
new file mode 100644
index 000000000..f080195b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tsan/tsan.exp
@@ -0,0 +1,47 @@
+# Copyright (C) 2013-2014 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib tsan-dg.exp
+load_lib torture-options.exp
+
+if ![check_effective_target_fthread_sanitizer] {
+ return
+}
+
+# Initialize `dg'.
+dg-init
+torture-init
+set-torture-options [list \
+ { -O0 } \
+ { -O2 } ]
+
+if [tsan_init] {
+
+# Main loop.
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common/tsan/*.c]] ""
+
+}
+
+# All done.
+tsan_finish
+torture-finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-1.c
new file mode 100644
index 000000000..f6160aad1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+typedef int x, y;
+x y z; /* { dg-error "" "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-10.c
new file mode 100644
index 000000000..6c2b79bd5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-10.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+typedef enum a { XYZ } a; /* { dg-message "previous declaration" } */
+enum a a; /* { dg-error "redeclared" } */
+struct b { enum a a : 8; };
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-2.c
new file mode 100644
index 000000000..30fcabc11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-2.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+typedef int x, y;
+x struct f z; /* { dg-error "two or more " "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-3.c
new file mode 100644
index 000000000..233f9da5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-3.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+struct f {
+}
+int z(); /* { dg-error "expected ';', identifier or " "" { target *-*-* } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-4.c
new file mode 100644
index 000000000..1ec734f12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-4.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+int f()
+{
+ struct f {
+ }
+ int z; /* { dg-error "expected ';', identifier or " "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-5.c
new file mode 100644
index 000000000..a12738807
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-5.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+struct f {}
+struct g {} /* { dg-error "expected ';', identifier or " "" } */
+int f(); /* { dg-error "expected ';', identifier or " "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-6.c
new file mode 100644
index 000000000..1c5554916
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-6.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+struct s {
+ struct f {} /* dg-warning "does not declare anything" "" } */
+ struct g {} x; /* { dg-error "expected ';', identifier or " "" } */
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-7.c
new file mode 100644
index 000000000..981c69b56
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-7.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+struct s {
+ struct f {}
+ enum a { X } /* { dg-error "expected ';', identifier or " "" } */
+ struct g {} /* { dg-error "expected identifier " "" } */
+}; /* { dg-warning "no semicolon" "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-8.c
new file mode 100644
index 000000000..0103b221b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-8.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+enum x { XYZ }
+struct g { enum x a; }; /* { dg-error "expected ';', identifier or " "" } */
+
+int f(struct g *x)
+{
+ return x->a == XYZ; /* { dg-bogus " has no member " "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/two-types-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-9.c
new file mode 100644
index 000000000..c6da94992
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/two-types-9.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+struct f {}
+static int a, b; /* { dg-error "expected ';', identifier or " "" } */
+
+int f()
+{
+ return a - b; /* { dg-bogus "invalid operands " "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/typedef-init.c b/gcc-4.9/gcc/testsuite/gcc.dg/typedef-init.c
new file mode 100644
index 000000000..52928da9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/typedef-init.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+/* This code used to be a legitimate, if dubious, extension. However,
+ it's been broken since GCC 3.0 (caused ICE) and we have now removed
+ the extension. See PR c/7353. */
+
+/* Case A: just the bare name = initializer. */
+
+typedef A = 0; /* { dg-error "initialized" "A" } */
+A a; /* { dg-bogus "" "A error cascade" } */
+
+/* Case B: with a type also. */
+
+typedef int B = 0; /* { dg-error "initialized" "B" } */
+B b; /* { dg-bogus "" "B error cascade" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/typedef-redecl.c b/gcc-4.9/gcc/testsuite/gcc.dg/typedef-redecl.c
new file mode 100644
index 000000000..8ac5282fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/typedef-redecl.c
@@ -0,0 +1,6 @@
+/* Redeclaration of typedef (invalid but accepted in system headers)
+ causes ICE; PR 13656. Test case by Richard Sandiford <rsandifo@redhat.com>,
+ reduced from glibc. */
+
+#include "typedef-redecl.h"
+x a;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/typedef-redecl.h b/gcc-4.9/gcc/testsuite/gcc.dg/typedef-redecl.h
new file mode 100644
index 000000000..9fa7da05d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/typedef-redecl.h
@@ -0,0 +1,7 @@
+/* Redeclaration of typedef (invalid but accepted in system headers)
+ causes ICE; PR 13656. Test case by Richard Sandiford <rsandifo@redhat.com>,
+ reduced from glibc. */
+
+#pragma GCC system_header
+typedef int x;
+typedef int x;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/typename-vla-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/typename-vla-1.c
new file mode 100644
index 000000000..161651312
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/typename-vla-1.c
@@ -0,0 +1,17 @@
+/* PR c/21536 */
+/* { dg-do run } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ int a = 1;
+ if (sizeof (*(++a, (char (*)[a])0)) != 2)
+ abort ();
+ exit (0);
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/typeof-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/typeof-1.c
new file mode 100644
index 000000000..233b39425
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/typeof-1.c
@@ -0,0 +1,27 @@
+/* Test typeof with __asm redirection. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern int foo1;
+extern int foo1 __asm ("bar1");
+int foo1 = 1;
+
+extern int foo2 (int);
+extern int foo2 (int) __asm ("bar2");
+int foo2 (int x)
+{
+ return x;
+}
+
+extern int foo3;
+extern __typeof (foo3) foo3 __asm ("bar3");
+int foo3 = 1;
+
+extern int foo4 (int);
+extern __typeof (foo4) foo4 __asm ("bar4");
+int foo4 (int x)
+{
+ return x;
+}
+
+// { dg-final { scan-assembler-not "foo" } }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/typespec-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/typespec-1.c
new file mode 100644
index 000000000..65736546b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/typespec-1.c
@@ -0,0 +1,937 @@
+/* Test for valid and invalid combinations of type specifiers.
+ This test covers combinations of the reserved word type specifiers
+ other than _Complex and _Imaginary, and a typedef name as the first
+ specifier only. Within those constraints, there are no GCC extensions
+ and what is accepted should be exactly what C99 permits. All
+ sequences are tested which do not have a shorter invalid initial
+ subsequence. Within the given constraints, there are no valid sequences
+ with an invalid initial subsequence.
+
+ In particular, the example of PR c/4319 should be rejected unconditionally,
+ not requiring -pedantic. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+typedef char type;
+void *x0;
+char *x1;
+short *x2;
+int *x3;
+long *x4;
+float *x5;
+double *x6;
+signed *x7;
+unsigned *x8;
+_Bool *x9;
+type *x10;
+void void *x11; /* { dg-error "" "void void" } */
+void char *x12; /* { dg-error "" "void char" } */
+void short *x13; /* { dg-error "" "void short" } */
+void int *x14; /* { dg-error "" "void int" } */
+void long *x15; /* { dg-error "" "void long" } */
+void float *x16; /* { dg-error "" "void float" } */
+void double *x17; /* { dg-error "" "void double" } */
+void signed *x18; /* { dg-error "" "void signed" } */
+void unsigned *x19; /* { dg-error "" "void unsigned" } */
+void _Bool *x20; /* { dg-error "" "void _Bool" } */
+char void *x21; /* { dg-error "" "char void" } */
+char char *x22; /* { dg-error "" "char char" } */
+char short *x23; /* { dg-error "" "char short" } */
+char int *x24; /* { dg-error "" "char int" } */
+char long *x25; /* { dg-error "" "char long" } */
+char float *x26; /* { dg-error "" "char float" } */
+char double *x27; /* { dg-error "" "char double" } */
+char signed *x28;
+char unsigned *x29;
+char _Bool *x30; /* { dg-error "" "char _Bool" } */
+short void *x31; /* { dg-error "" "short void" } */
+short char *x32; /* { dg-error "" "short char" } */
+short short *x33; /* { dg-error "" "short short" } */
+short int *x34;
+short long *x35; /* { dg-error "" "short long" } */
+short float *x36; /* { dg-error "" "short float" } */
+short double *x37; /* { dg-error "" "short double" } */
+short signed *x38;
+short unsigned *x39;
+short _Bool *x40; /* { dg-error "" "short _Bool" } */
+int void *x41; /* { dg-error "" "int void" } */
+int char *x42; /* { dg-error "" "int char" } */
+int short *x43;
+int int *x44; /* { dg-error "" "int int" } */
+int long *x45;
+int float *x46; /* { dg-error "" "int float" } */
+int double *x47; /* { dg-error "" "int double" } */
+int signed *x48;
+int unsigned *x49;
+int _Bool *x50; /* { dg-error "" "int _Bool" } */
+long void *x51; /* { dg-error "" "long void" } */
+long char *x52; /* { dg-error "" "long char" } */
+long short *x53; /* { dg-error "" "long short" } */
+long int *x54;
+long long *x55;
+long float *x56; /* { dg-error "" "long float" } */
+long double *x57;
+long signed *x58;
+long unsigned *x59;
+long _Bool *x60; /* { dg-error "" "long _Bool" } */
+float void *x61; /* { dg-error "" "float void" } */
+float char *x62; /* { dg-error "" "float char" } */
+float short *x63; /* { dg-error "" "float short" } */
+float int *x64; /* { dg-error "" "float int" } */
+float long *x65; /* { dg-error "" "float long" } */
+float float *x66; /* { dg-error "" "float float" } */
+float double *x67; /* { dg-error "" "float double" } */
+float signed *x68; /* { dg-error "" "float signed" } */
+float unsigned *x69; /* { dg-error "" "float unsigned" } */
+float _Bool *x70; /* { dg-error "" "float _Bool" } */
+double void *x71; /* { dg-error "" "double void" } */
+double char *x72; /* { dg-error "" "double char" } */
+double short *x73; /* { dg-error "" "double short" } */
+double int *x74; /* { dg-error "" "double int" } */
+double long *x75;
+double float *x76; /* { dg-error "" "double float" } */
+double double *x77; /* { dg-error "" "double double" } */
+double signed *x78; /* { dg-error "" "double signed" } */
+double unsigned *x79; /* { dg-error "" "double unsigned" } */
+double _Bool *x80; /* { dg-error "" "double _Bool" } */
+signed void *x81; /* { dg-error "" "signed void" } */
+signed char *x82;
+signed short *x83;
+signed int *x84;
+signed long *x85;
+signed float *x86; /* { dg-error "" "signed float" } */
+signed double *x87; /* { dg-error "" "signed double" } */
+signed signed *x88; /* { dg-error "" "signed signed" } */
+signed unsigned *x89; /* { dg-error "" "signed unsigned" } */
+signed _Bool *x90; /* { dg-error "" "signed _Bool" } */
+unsigned void *x91; /* { dg-error "" "unsigned void" } */
+unsigned char *x92;
+unsigned short *x93;
+unsigned int *x94;
+unsigned long *x95;
+unsigned float *x96; /* { dg-error "" "unsigned float" } */
+unsigned double *x97; /* { dg-error "" "unsigned double" } */
+unsigned signed *x98; /* { dg-error "" "unsigned signed" } */
+unsigned unsigned *x99; /* { dg-error "" "unsigned unsigned" } */
+unsigned _Bool *x100; /* { dg-error "" "unsigned _Bool" } */
+_Bool void *x101; /* { dg-error "" "_Bool void" } */
+_Bool char *x102; /* { dg-error "" "_Bool char" } */
+_Bool short *x103; /* { dg-error "" "_Bool short" } */
+_Bool int *x104; /* { dg-error "" "_Bool int" } */
+_Bool long *x105; /* { dg-error "" "_Bool long" } */
+_Bool float *x106; /* { dg-error "" "_Bool float" } */
+_Bool double *x107; /* { dg-error "" "_Bool double" } */
+_Bool signed *x108; /* { dg-error "" "_Bool signed" } */
+_Bool unsigned *x109; /* { dg-error "" "_Bool unsigned" } */
+_Bool _Bool *x110; /* { dg-error "" "_Bool _Bool" } */
+type void *x111; /* { dg-error "" "type void" } */
+type char *x112; /* { dg-error "" "type char" } */
+type short *x113; /* { dg-error "" "type short" } */
+type int *x114; /* { dg-error "" "type int" } */
+type long *x115; /* { dg-error "" "type long" } */
+type float *x116; /* { dg-error "" "type float" } */
+type double *x117; /* { dg-error "" "type double" } */
+type signed *x118; /* { dg-error "" "type signed" } */
+type unsigned *x119; /* { dg-error "" "type unsigned" } */
+type _Bool *x120; /* { dg-error "" "type _Bool" } */
+char signed void *x121; /* { dg-error "" "char signed void" } */
+char signed char *x122; /* { dg-error "" "char signed char" } */
+char signed short *x123; /* { dg-error "" "char signed short" } */
+char signed int *x124; /* { dg-error "" "char signed int" } */
+char signed long *x125; /* { dg-error "" "char signed long" } */
+char signed float *x126; /* { dg-error "" "char signed float" } */
+char signed double *x127; /* { dg-error "" "char signed double" } */
+char signed signed *x128; /* { dg-error "" "char signed signed" } */
+char signed unsigned *x129; /* { dg-error "" "char signed unsigned" } */
+char signed _Bool *x130; /* { dg-error "" "char signed _Bool" } */
+char unsigned void *x131; /* { dg-error "" "char unsigned void" } */
+char unsigned char *x132; /* { dg-error "" "char unsigned char" } */
+char unsigned short *x133; /* { dg-error "" "char unsigned short" } */
+char unsigned int *x134; /* { dg-error "" "char unsigned int" } */
+char unsigned long *x135; /* { dg-error "" "char unsigned long" } */
+char unsigned float *x136; /* { dg-error "" "char unsigned float" } */
+char unsigned double *x137; /* { dg-error "" "char unsigned double" } */
+char unsigned signed *x138; /* { dg-error "" "char unsigned signed" } */
+char unsigned unsigned *x139; /* { dg-error "" "char unsigned unsigned" } */
+char unsigned _Bool *x140; /* { dg-error "" "char unsigned _Bool" } */
+short int void *x141; /* { dg-error "" "short int void" } */
+short int char *x142; /* { dg-error "" "short int char" } */
+short int short *x143; /* { dg-error "" "short int short" } */
+short int int *x144; /* { dg-error "" "short int int" } */
+short int long *x145; /* { dg-error "" "short int long" } */
+short int float *x146; /* { dg-error "" "short int float" } */
+short int double *x147; /* { dg-error "" "short int double" } */
+short int signed *x148;
+short int unsigned *x149;
+short int _Bool *x150; /* { dg-error "" "short int _Bool" } */
+short signed void *x151; /* { dg-error "" "short signed void" } */
+short signed char *x152; /* { dg-error "" "short signed char" } */
+short signed short *x153; /* { dg-error "" "short signed short" } */
+short signed int *x154;
+short signed long *x155; /* { dg-error "" "short signed long" } */
+short signed float *x156; /* { dg-error "" "short signed float" } */
+short signed double *x157; /* { dg-error "" "short signed double" } */
+short signed signed *x158; /* { dg-error "" "short signed signed" } */
+short signed unsigned *x159; /* { dg-error "" "short signed unsigned" } */
+short signed _Bool *x160; /* { dg-error "" "short signed _Bool" } */
+short unsigned void *x161; /* { dg-error "" "short unsigned void" } */
+short unsigned char *x162; /* { dg-error "" "short unsigned char" } */
+short unsigned short *x163; /* { dg-error "" "short unsigned short" } */
+short unsigned int *x164;
+short unsigned long *x165; /* { dg-error "" "short unsigned long" } */
+short unsigned float *x166; /* { dg-error "" "short unsigned float" } */
+short unsigned double *x167; /* { dg-error "" "short unsigned double" } */
+short unsigned signed *x168; /* { dg-error "" "short unsigned signed" } */
+short unsigned unsigned *x169; /* { dg-error "" "short unsigned unsigned" } */
+short unsigned _Bool *x170; /* { dg-error "" "short unsigned _Bool" } */
+int short void *x171; /* { dg-error "" "int short void" } */
+int short char *x172; /* { dg-error "" "int short char" } */
+int short short *x173; /* { dg-error "" "int short short" } */
+int short int *x174; /* { dg-error "" "int short int" } */
+int short long *x175; /* { dg-error "" "int short long" } */
+int short float *x176; /* { dg-error "" "int short float" } */
+int short double *x177; /* { dg-error "" "int short double" } */
+int short signed *x178;
+int short unsigned *x179;
+int short _Bool *x180; /* { dg-error "" "int short _Bool" } */
+int long void *x181; /* { dg-error "" "int long void" } */
+int long char *x182; /* { dg-error "" "int long char" } */
+int long short *x183; /* { dg-error "" "int long short" } */
+int long int *x184; /* { dg-error "" "int long int" } */
+int long long *x185;
+int long float *x186; /* { dg-error "" "int long float" } */
+int long double *x187; /* { dg-error "" "int long double" } */
+int long signed *x188;
+int long unsigned *x189;
+int long _Bool *x190; /* { dg-error "" "int long _Bool" } */
+int signed void *x191; /* { dg-error "" "int signed void" } */
+int signed char *x192; /* { dg-error "" "int signed char" } */
+int signed short *x193;
+int signed int *x194; /* { dg-error "" "int signed int" } */
+int signed long *x195;
+int signed float *x196; /* { dg-error "" "int signed float" } */
+int signed double *x197; /* { dg-error "" "int signed double" } */
+int signed signed *x198; /* { dg-error "" "int signed signed" } */
+int signed unsigned *x199; /* { dg-error "" "int signed unsigned" } */
+int signed _Bool *x200; /* { dg-error "" "int signed _Bool" } */
+int unsigned void *x201; /* { dg-error "" "int unsigned void" } */
+int unsigned char *x202; /* { dg-error "" "int unsigned char" } */
+int unsigned short *x203;
+int unsigned int *x204; /* { dg-error "" "int unsigned int" } */
+int unsigned long *x205;
+int unsigned float *x206; /* { dg-error "" "int unsigned float" } */
+int unsigned double *x207; /* { dg-error "" "int unsigned double" } */
+int unsigned signed *x208; /* { dg-error "" "int unsigned signed" } */
+int unsigned unsigned *x209; /* { dg-error "" "int unsigned unsigned" } */
+int unsigned _Bool *x210; /* { dg-error "" "int unsigned _Bool" } */
+long int void *x211; /* { dg-error "" "long int void" } */
+long int char *x212; /* { dg-error "" "long int char" } */
+long int short *x213; /* { dg-error "" "long int short" } */
+long int int *x214; /* { dg-error "" "long int int" } */
+long int long *x215;
+long int float *x216; /* { dg-error "" "long int float" } */
+long int double *x217; /* { dg-error "" "long int double" } */
+long int signed *x218;
+long int unsigned *x219;
+long int _Bool *x220; /* { dg-error "" "long int _Bool" } */
+long long void *x221; /* { dg-error "" "long long void" } */
+long long char *x222; /* { dg-error "" "long long char" } */
+long long short *x223; /* { dg-error "" "long long short" } */
+long long int *x224;
+long long long *x225; /* { dg-error "" "long long long" } */
+long long float *x226; /* { dg-error "" "long long float" } */
+long long double *x227; /* { dg-error "" "long long double" } */
+long long signed *x228;
+long long unsigned *x229;
+long long _Bool *x230; /* { dg-error "" "long long _Bool" } */
+long double void *x231; /* { dg-error "" "long double void" } */
+long double char *x232; /* { dg-error "" "long double char" } */
+long double short *x233; /* { dg-error "" "long double short" } */
+long double int *x234; /* { dg-error "" "long double int" } */
+long double long *x235; /* { dg-error "" "long double long" } */
+long double float *x236; /* { dg-error "" "long double float" } */
+long double double *x237; /* { dg-error "" "long double double" } */
+long double signed *x238; /* { dg-error "" "long double signed" } */
+long double unsigned *x239; /* { dg-error "" "long double unsigned" } */
+long double _Bool *x240; /* { dg-error "" "long double _Bool" } */
+long signed void *x241; /* { dg-error "" "long signed void" } */
+long signed char *x242; /* { dg-error "" "long signed char" } */
+long signed short *x243; /* { dg-error "" "long signed short" } */
+long signed int *x244;
+long signed long *x245;
+long signed float *x246; /* { dg-error "" "long signed float" } */
+long signed double *x247; /* { dg-error "" "long signed double" } */
+long signed signed *x248; /* { dg-error "" "long signed signed" } */
+long signed unsigned *x249; /* { dg-error "" "long signed unsigned" } */
+long signed _Bool *x250; /* { dg-error "" "long signed _Bool" } */
+long unsigned void *x251; /* { dg-error "" "long unsigned void" } */
+long unsigned char *x252; /* { dg-error "" "long unsigned char" } */
+long unsigned short *x253; /* { dg-error "" "long unsigned short" } */
+long unsigned int *x254;
+long unsigned long *x255;
+long unsigned float *x256; /* { dg-error "" "long unsigned float" } */
+long unsigned double *x257; /* { dg-error "" "long unsigned double" } */
+long unsigned signed *x258; /* { dg-error "" "long unsigned signed" } */
+long unsigned unsigned *x259; /* { dg-error "" "long unsigned unsigned" } */
+long unsigned _Bool *x260; /* { dg-error "" "long unsigned _Bool" } */
+double long void *x261; /* { dg-error "" "double long void" } */
+double long char *x262; /* { dg-error "" "double long char" } */
+double long short *x263; /* { dg-error "" "double long short" } */
+double long int *x264; /* { dg-error "" "double long int" } */
+double long long *x265; /* { dg-error "" "double long long" } */
+double long float *x266; /* { dg-error "" "double long float" } */
+double long double *x267; /* { dg-error "" "double long double" } */
+double long signed *x268; /* { dg-error "" "double long signed" } */
+double long unsigned *x269; /* { dg-error "" "double long unsigned" } */
+double long _Bool *x270; /* { dg-error "" "double long _Bool" } */
+signed char void *x271; /* { dg-error "" "signed char void" } */
+signed char char *x272; /* { dg-error "" "signed char char" } */
+signed char short *x273; /* { dg-error "" "signed char short" } */
+signed char int *x274; /* { dg-error "" "signed char int" } */
+signed char long *x275; /* { dg-error "" "signed char long" } */
+signed char float *x276; /* { dg-error "" "signed char float" } */
+signed char double *x277; /* { dg-error "" "signed char double" } */
+signed char signed *x278; /* { dg-error "" "signed char signed" } */
+signed char unsigned *x279; /* { dg-error "" "signed char unsigned" } */
+signed char _Bool *x280; /* { dg-error "" "signed char _Bool" } */
+signed short void *x281; /* { dg-error "" "signed short void" } */
+signed short char *x282; /* { dg-error "" "signed short char" } */
+signed short short *x283; /* { dg-error "" "signed short short" } */
+signed short int *x284;
+signed short long *x285; /* { dg-error "" "signed short long" } */
+signed short float *x286; /* { dg-error "" "signed short float" } */
+signed short double *x287; /* { dg-error "" "signed short double" } */
+signed short signed *x288; /* { dg-error "" "signed short signed" } */
+signed short unsigned *x289; /* { dg-error "" "signed short unsigned" } */
+signed short _Bool *x290; /* { dg-error "" "signed short _Bool" } */
+signed int void *x291; /* { dg-error "" "signed int void" } */
+signed int char *x292; /* { dg-error "" "signed int char" } */
+signed int short *x293;
+signed int int *x294; /* { dg-error "" "signed int int" } */
+signed int long *x295;
+signed int float *x296; /* { dg-error "" "signed int float" } */
+signed int double *x297; /* { dg-error "" "signed int double" } */
+signed int signed *x298; /* { dg-error "" "signed int signed" } */
+signed int unsigned *x299; /* { dg-error "" "signed int unsigned" } */
+signed int _Bool *x300; /* { dg-error "" "signed int _Bool" } */
+signed long void *x301; /* { dg-error "" "signed long void" } */
+signed long char *x302; /* { dg-error "" "signed long char" } */
+signed long short *x303; /* { dg-error "" "signed long short" } */
+signed long int *x304;
+signed long long *x305;
+signed long float *x306; /* { dg-error "" "signed long float" } */
+signed long double *x307; /* { dg-error "" "signed long double" } */
+signed long signed *x308; /* { dg-error "" "signed long signed" } */
+signed long unsigned *x309; /* { dg-error "" "signed long unsigned" } */
+signed long _Bool *x310; /* { dg-error "" "signed long _Bool" } */
+unsigned char void *x311; /* { dg-error "" "unsigned char void" } */
+unsigned char char *x312; /* { dg-error "" "unsigned char char" } */
+unsigned char short *x313; /* { dg-error "" "unsigned char short" } */
+unsigned char int *x314; /* { dg-error "" "unsigned char int" } */
+unsigned char long *x315; /* { dg-error "" "unsigned char long" } */
+unsigned char float *x316; /* { dg-error "" "unsigned char float" } */
+unsigned char double *x317; /* { dg-error "" "unsigned char double" } */
+unsigned char signed *x318; /* { dg-error "" "unsigned char signed" } */
+unsigned char unsigned *x319; /* { dg-error "" "unsigned char unsigned" } */
+unsigned char _Bool *x320; /* { dg-error "" "unsigned char _Bool" } */
+unsigned short void *x321; /* { dg-error "" "unsigned short void" } */
+unsigned short char *x322; /* { dg-error "" "unsigned short char" } */
+unsigned short short *x323; /* { dg-error "" "unsigned short short" } */
+unsigned short int *x324;
+unsigned short long *x325; /* { dg-error "" "unsigned short long" } */
+unsigned short float *x326; /* { dg-error "" "unsigned short float" } */
+unsigned short double *x327; /* { dg-error "" "unsigned short double" } */
+unsigned short signed *x328; /* { dg-error "" "unsigned short signed" } */
+unsigned short unsigned *x329; /* { dg-error "" "unsigned short unsigned" } */
+unsigned short _Bool *x330; /* { dg-error "" "unsigned short _Bool" } */
+unsigned int void *x331; /* { dg-error "" "unsigned int void" } */
+unsigned int char *x332; /* { dg-error "" "unsigned int char" } */
+unsigned int short *x333;
+unsigned int int *x334; /* { dg-error "" "unsigned int int" } */
+unsigned int long *x335;
+unsigned int float *x336; /* { dg-error "" "unsigned int float" } */
+unsigned int double *x337; /* { dg-error "" "unsigned int double" } */
+unsigned int signed *x338; /* { dg-error "" "unsigned int signed" } */
+unsigned int unsigned *x339; /* { dg-error "" "unsigned int unsigned" } */
+unsigned int _Bool *x340; /* { dg-error "" "unsigned int _Bool" } */
+unsigned long void *x341; /* { dg-error "" "unsigned long void" } */
+unsigned long char *x342; /* { dg-error "" "unsigned long char" } */
+unsigned long short *x343; /* { dg-error "" "unsigned long short" } */
+unsigned long int *x344;
+unsigned long long *x345;
+unsigned long float *x346; /* { dg-error "" "unsigned long float" } */
+unsigned long double *x347; /* { dg-error "" "unsigned long double" } */
+unsigned long signed *x348; /* { dg-error "" "unsigned long signed" } */
+unsigned long unsigned *x349; /* { dg-error "" "unsigned long unsigned" } */
+unsigned long _Bool *x350; /* { dg-error "" "unsigned long _Bool" } */
+short int signed void *x351; /* { dg-error "" "short int signed void" } */
+short int signed char *x352; /* { dg-error "" "short int signed char" } */
+short int signed short *x353; /* { dg-error "" "short int signed short" } */
+short int signed int *x354; /* { dg-error "" "short int signed int" } */
+short int signed long *x355; /* { dg-error "" "short int signed long" } */
+short int signed float *x356; /* { dg-error "" "short int signed float" } */
+short int signed double *x357; /* { dg-error "" "short int signed double" } */
+short int signed signed *x358; /* { dg-error "" "short int signed signed" } */
+short int signed unsigned *x359; /* { dg-error "" "short int signed unsigned" } */
+short int signed _Bool *x360; /* { dg-error "" "short int signed _Bool" } */
+short int unsigned void *x361; /* { dg-error "" "short int unsigned void" } */
+short int unsigned char *x362; /* { dg-error "" "short int unsigned char" } */
+short int unsigned short *x363; /* { dg-error "" "short int unsigned short" } */
+short int unsigned int *x364; /* { dg-error "" "short int unsigned int" } */
+short int unsigned long *x365; /* { dg-error "" "short int unsigned long" } */
+short int unsigned float *x366; /* { dg-error "" "short int unsigned float" } */
+short int unsigned double *x367; /* { dg-error "" "short int unsigned double" } */
+short int unsigned signed *x368; /* { dg-error "" "short int unsigned signed" } */
+short int unsigned unsigned *x369; /* { dg-error "" "short int unsigned unsigned" } */
+short int unsigned _Bool *x370; /* { dg-error "" "short int unsigned _Bool" } */
+short signed int void *x371; /* { dg-error "" "short signed int void" } */
+short signed int char *x372; /* { dg-error "" "short signed int char" } */
+short signed int short *x373; /* { dg-error "" "short signed int short" } */
+short signed int int *x374; /* { dg-error "" "short signed int int" } */
+short signed int long *x375; /* { dg-error "" "short signed int long" } */
+short signed int float *x376; /* { dg-error "" "short signed int float" } */
+short signed int double *x377; /* { dg-error "" "short signed int double" } */
+short signed int signed *x378; /* { dg-error "" "short signed int signed" } */
+short signed int unsigned *x379; /* { dg-error "" "short signed int unsigned" } */
+short signed int _Bool *x380; /* { dg-error "" "short signed int _Bool" } */
+short unsigned int void *x381; /* { dg-error "" "short unsigned int void" } */
+short unsigned int char *x382; /* { dg-error "" "short unsigned int char" } */
+short unsigned int short *x383; /* { dg-error "" "short unsigned int short" } */
+short unsigned int int *x384; /* { dg-error "" "short unsigned int int" } */
+short unsigned int long *x385; /* { dg-error "" "short unsigned int long" } */
+short unsigned int float *x386; /* { dg-error "" "short unsigned int float" } */
+short unsigned int double *x387; /* { dg-error "" "short unsigned int double" } */
+short unsigned int signed *x388; /* { dg-error "" "short unsigned int signed" } */
+short unsigned int unsigned *x389; /* { dg-error "" "short unsigned int unsigned" } */
+short unsigned int _Bool *x390; /* { dg-error "" "short unsigned int _Bool" } */
+int short signed void *x391; /* { dg-error "" "int short signed void" } */
+int short signed char *x392; /* { dg-error "" "int short signed char" } */
+int short signed short *x393; /* { dg-error "" "int short signed short" } */
+int short signed int *x394; /* { dg-error "" "int short signed int" } */
+int short signed long *x395; /* { dg-error "" "int short signed long" } */
+int short signed float *x396; /* { dg-error "" "int short signed float" } */
+int short signed double *x397; /* { dg-error "" "int short signed double" } */
+int short signed signed *x398; /* { dg-error "" "int short signed signed" } */
+int short signed unsigned *x399; /* { dg-error "" "int short signed unsigned" } */
+int short signed _Bool *x400; /* { dg-error "" "int short signed _Bool" } */
+int short unsigned void *x401; /* { dg-error "" "int short unsigned void" } */
+int short unsigned char *x402; /* { dg-error "" "int short unsigned char" } */
+int short unsigned short *x403; /* { dg-error "" "int short unsigned short" } */
+int short unsigned int *x404; /* { dg-error "" "int short unsigned int" } */
+int short unsigned long *x405; /* { dg-error "" "int short unsigned long" } */
+int short unsigned float *x406; /* { dg-error "" "int short unsigned float" } */
+int short unsigned double *x407; /* { dg-error "" "int short unsigned double" } */
+int short unsigned signed *x408; /* { dg-error "" "int short unsigned signed" } */
+int short unsigned unsigned *x409; /* { dg-error "" "int short unsigned unsigned" } */
+int short unsigned _Bool *x410; /* { dg-error "" "int short unsigned _Bool" } */
+int long long void *x411; /* { dg-error "" "int long long void" } */
+int long long char *x412; /* { dg-error "" "int long long char" } */
+int long long short *x413; /* { dg-error "" "int long long short" } */
+int long long int *x414; /* { dg-error "" "int long long int" } */
+int long long long *x415; /* { dg-error "" "int long long long" } */
+int long long float *x416; /* { dg-error "" "int long long float" } */
+int long long double *x417; /* { dg-error "" "int long long double" } */
+int long long signed *x418;
+int long long unsigned *x419;
+int long long _Bool *x420; /* { dg-error "" "int long long _Bool" } */
+int long signed void *x421; /* { dg-error "" "int long signed void" } */
+int long signed char *x422; /* { dg-error "" "int long signed char" } */
+int long signed short *x423; /* { dg-error "" "int long signed short" } */
+int long signed int *x424; /* { dg-error "" "int long signed int" } */
+int long signed long *x425;
+int long signed float *x426; /* { dg-error "" "int long signed float" } */
+int long signed double *x427; /* { dg-error "" "int long signed double" } */
+int long signed signed *x428; /* { dg-error "" "int long signed signed" } */
+int long signed unsigned *x429; /* { dg-error "" "int long signed unsigned" } */
+int long signed _Bool *x430; /* { dg-error "" "int long signed _Bool" } */
+int long unsigned void *x431; /* { dg-error "" "int long unsigned void" } */
+int long unsigned char *x432; /* { dg-error "" "int long unsigned char" } */
+int long unsigned short *x433; /* { dg-error "" "int long unsigned short" } */
+int long unsigned int *x434; /* { dg-error "" "int long unsigned int" } */
+int long unsigned long *x435;
+int long unsigned float *x436; /* { dg-error "" "int long unsigned float" } */
+int long unsigned double *x437; /* { dg-error "" "int long unsigned double" } */
+int long unsigned signed *x438; /* { dg-error "" "int long unsigned signed" } */
+int long unsigned unsigned *x439; /* { dg-error "" "int long unsigned unsigned" } */
+int long unsigned _Bool *x440; /* { dg-error "" "int long unsigned _Bool" } */
+int signed short void *x441; /* { dg-error "" "int signed short void" } */
+int signed short char *x442; /* { dg-error "" "int signed short char" } */
+int signed short short *x443; /* { dg-error "" "int signed short short" } */
+int signed short int *x444; /* { dg-error "" "int signed short int" } */
+int signed short long *x445; /* { dg-error "" "int signed short long" } */
+int signed short float *x446; /* { dg-error "" "int signed short float" } */
+int signed short double *x447; /* { dg-error "" "int signed short double" } */
+int signed short signed *x448; /* { dg-error "" "int signed short signed" } */
+int signed short unsigned *x449; /* { dg-error "" "int signed short unsigned" } */
+int signed short _Bool *x450; /* { dg-error "" "int signed short _Bool" } */
+int signed long void *x451; /* { dg-error "" "int signed long void" } */
+int signed long char *x452; /* { dg-error "" "int signed long char" } */
+int signed long short *x453; /* { dg-error "" "int signed long short" } */
+int signed long int *x454; /* { dg-error "" "int signed long int" } */
+int signed long long *x455;
+int signed long float *x456; /* { dg-error "" "int signed long float" } */
+int signed long double *x457; /* { dg-error "" "int signed long double" } */
+int signed long signed *x458; /* { dg-error "" "int signed long signed" } */
+int signed long unsigned *x459; /* { dg-error "" "int signed long unsigned" } */
+int signed long _Bool *x460; /* { dg-error "" "int signed long _Bool" } */
+int unsigned short void *x461; /* { dg-error "" "int unsigned short void" } */
+int unsigned short char *x462; /* { dg-error "" "int unsigned short char" } */
+int unsigned short short *x463; /* { dg-error "" "int unsigned short short" } */
+int unsigned short int *x464; /* { dg-error "" "int unsigned short int" } */
+int unsigned short long *x465; /* { dg-error "" "int unsigned short long" } */
+int unsigned short float *x466; /* { dg-error "" "int unsigned short float" } */
+int unsigned short double *x467; /* { dg-error "" "int unsigned short double" } */
+int unsigned short signed *x468; /* { dg-error "" "int unsigned short signed" } */
+int unsigned short unsigned *x469; /* { dg-error "" "int unsigned short unsigned" } */
+int unsigned short _Bool *x470; /* { dg-error "" "int unsigned short _Bool" } */
+int unsigned long void *x471; /* { dg-error "" "int unsigned long void" } */
+int unsigned long char *x472; /* { dg-error "" "int unsigned long char" } */
+int unsigned long short *x473; /* { dg-error "" "int unsigned long short" } */
+int unsigned long int *x474; /* { dg-error "" "int unsigned long int" } */
+int unsigned long long *x475;
+int unsigned long float *x476; /* { dg-error "" "int unsigned long float" } */
+int unsigned long double *x477; /* { dg-error "" "int unsigned long double" } */
+int unsigned long signed *x478; /* { dg-error "" "int unsigned long signed" } */
+int unsigned long unsigned *x479; /* { dg-error "" "int unsigned long unsigned" } */
+int unsigned long _Bool *x480; /* { dg-error "" "int unsigned long _Bool" } */
+long int long void *x481; /* { dg-error "" "long int long void" } */
+long int long char *x482; /* { dg-error "" "long int long char" } */
+long int long short *x483; /* { dg-error "" "long int long short" } */
+long int long int *x484; /* { dg-error "" "long int long int" } */
+long int long long *x485; /* { dg-error "" "long int long long" } */
+long int long float *x486; /* { dg-error "" "long int long float" } */
+long int long double *x487; /* { dg-error "" "long int long double" } */
+long int long signed *x488;
+long int long unsigned *x489;
+long int long _Bool *x490; /* { dg-error "" "long int long _Bool" } */
+long int signed void *x491; /* { dg-error "" "long int signed void" } */
+long int signed char *x492; /* { dg-error "" "long int signed char" } */
+long int signed short *x493; /* { dg-error "" "long int signed short" } */
+long int signed int *x494; /* { dg-error "" "long int signed int" } */
+long int signed long *x495;
+long int signed float *x496; /* { dg-error "" "long int signed float" } */
+long int signed double *x497; /* { dg-error "" "long int signed double" } */
+long int signed signed *x498; /* { dg-error "" "long int signed signed" } */
+long int signed unsigned *x499; /* { dg-error "" "long int signed unsigned" } */
+long int signed _Bool *x500; /* { dg-error "" "long int signed _Bool" } */
+long int unsigned void *x501; /* { dg-error "" "long int unsigned void" } */
+long int unsigned char *x502; /* { dg-error "" "long int unsigned char" } */
+long int unsigned short *x503; /* { dg-error "" "long int unsigned short" } */
+long int unsigned int *x504; /* { dg-error "" "long int unsigned int" } */
+long int unsigned long *x505;
+long int unsigned float *x506; /* { dg-error "" "long int unsigned float" } */
+long int unsigned double *x507; /* { dg-error "" "long int unsigned double" } */
+long int unsigned signed *x508; /* { dg-error "" "long int unsigned signed" } */
+long int unsigned unsigned *x509; /* { dg-error "" "long int unsigned unsigned" } */
+long int unsigned _Bool *x510; /* { dg-error "" "long int unsigned _Bool" } */
+long long int void *x511; /* { dg-error "" "long long int void" } */
+long long int char *x512; /* { dg-error "" "long long int char" } */
+long long int short *x513; /* { dg-error "" "long long int short" } */
+long long int int *x514; /* { dg-error "" "long long int int" } */
+long long int long *x515; /* { dg-error "" "long long int long" } */
+long long int float *x516; /* { dg-error "" "long long int float" } */
+long long int double *x517; /* { dg-error "" "long long int double" } */
+long long int signed *x518;
+long long int unsigned *x519;
+long long int _Bool *x520; /* { dg-error "" "long long int _Bool" } */
+long long signed void *x521; /* { dg-error "" "long long signed void" } */
+long long signed char *x522; /* { dg-error "" "long long signed char" } */
+long long signed short *x523; /* { dg-error "" "long long signed short" } */
+long long signed int *x524;
+long long signed long *x525; /* { dg-error "" "long long signed long" } */
+long long signed float *x526; /* { dg-error "" "long long signed float" } */
+long long signed double *x527; /* { dg-error "" "long long signed double" } */
+long long signed signed *x528; /* { dg-error "" "long long signed signed" } */
+long long signed unsigned *x529; /* { dg-error "" "long long signed unsigned" } */
+long long signed _Bool *x530; /* { dg-error "" "long long signed _Bool" } */
+long long unsigned void *x531; /* { dg-error "" "long long unsigned void" } */
+long long unsigned char *x532; /* { dg-error "" "long long unsigned char" } */
+long long unsigned short *x533; /* { dg-error "" "long long unsigned short" } */
+long long unsigned int *x534;
+long long unsigned long *x535; /* { dg-error "" "long long unsigned long" } */
+long long unsigned float *x536; /* { dg-error "" "long long unsigned float" } */
+long long unsigned double *x537; /* { dg-error "" "long long unsigned double" } */
+long long unsigned signed *x538; /* { dg-error "" "long long unsigned signed" } */
+long long unsigned unsigned *x539; /* { dg-error "" "long long unsigned unsigned" } */
+long long unsigned _Bool *x540; /* { dg-error "" "long long unsigned _Bool" } */
+long signed int void *x541; /* { dg-error "" "long signed int void" } */
+long signed int char *x542; /* { dg-error "" "long signed int char" } */
+long signed int short *x543; /* { dg-error "" "long signed int short" } */
+long signed int int *x544; /* { dg-error "" "long signed int int" } */
+long signed int long *x545;
+long signed int float *x546; /* { dg-error "" "long signed int float" } */
+long signed int double *x547; /* { dg-error "" "long signed int double" } */
+long signed int signed *x548; /* { dg-error "" "long signed int signed" } */
+long signed int unsigned *x549; /* { dg-error "" "long signed int unsigned" } */
+long signed int _Bool *x550; /* { dg-error "" "long signed int _Bool" } */
+long signed long void *x551; /* { dg-error "" "long signed long void" } */
+long signed long char *x552; /* { dg-error "" "long signed long char" } */
+long signed long short *x553; /* { dg-error "" "long signed long short" } */
+long signed long int *x554;
+long signed long long *x555; /* { dg-error "" "long signed long long" } */
+long signed long float *x556; /* { dg-error "" "long signed long float" } */
+long signed long double *x557; /* { dg-error "" "long signed long double" } */
+long signed long signed *x558; /* { dg-error "" "long signed long signed" } */
+long signed long unsigned *x559; /* { dg-error "" "long signed long unsigned" } */
+long signed long _Bool *x560; /* { dg-error "" "long signed long _Bool" } */
+long unsigned int void *x561; /* { dg-error "" "long unsigned int void" } */
+long unsigned int char *x562; /* { dg-error "" "long unsigned int char" } */
+long unsigned int short *x563; /* { dg-error "" "long unsigned int short" } */
+long unsigned int int *x564; /* { dg-error "" "long unsigned int int" } */
+long unsigned int long *x565;
+long unsigned int float *x566; /* { dg-error "" "long unsigned int float" } */
+long unsigned int double *x567; /* { dg-error "" "long unsigned int double" } */
+long unsigned int signed *x568; /* { dg-error "" "long unsigned int signed" } */
+long unsigned int unsigned *x569; /* { dg-error "" "long unsigned int unsigned" } */
+long unsigned int _Bool *x570; /* { dg-error "" "long unsigned int _Bool" } */
+long unsigned long void *x571; /* { dg-error "" "long unsigned long void" } */
+long unsigned long char *x572; /* { dg-error "" "long unsigned long char" } */
+long unsigned long short *x573; /* { dg-error "" "long unsigned long short" } */
+long unsigned long int *x574;
+long unsigned long long *x575; /* { dg-error "" "long unsigned long long" } */
+long unsigned long float *x576; /* { dg-error "" "long unsigned long float" } */
+long unsigned long double *x577; /* { dg-error "" "long unsigned long double" } */
+long unsigned long signed *x578; /* { dg-error "" "long unsigned long signed" } */
+long unsigned long unsigned *x579; /* { dg-error "" "long unsigned long unsigned" } */
+long unsigned long _Bool *x580; /* { dg-error "" "long unsigned long _Bool" } */
+signed short int void *x581; /* { dg-error "" "signed short int void" } */
+signed short int char *x582; /* { dg-error "" "signed short int char" } */
+signed short int short *x583; /* { dg-error "" "signed short int short" } */
+signed short int int *x584; /* { dg-error "" "signed short int int" } */
+signed short int long *x585; /* { dg-error "" "signed short int long" } */
+signed short int float *x586; /* { dg-error "" "signed short int float" } */
+signed short int double *x587; /* { dg-error "" "signed short int double" } */
+signed short int signed *x588; /* { dg-error "" "signed short int signed" } */
+signed short int unsigned *x589; /* { dg-error "" "signed short int unsigned" } */
+signed short int _Bool *x590; /* { dg-error "" "signed short int _Bool" } */
+signed int short void *x591; /* { dg-error "" "signed int short void" } */
+signed int short char *x592; /* { dg-error "" "signed int short char" } */
+signed int short short *x593; /* { dg-error "" "signed int short short" } */
+signed int short int *x594; /* { dg-error "" "signed int short int" } */
+signed int short long *x595; /* { dg-error "" "signed int short long" } */
+signed int short float *x596; /* { dg-error "" "signed int short float" } */
+signed int short double *x597; /* { dg-error "" "signed int short double" } */
+signed int short signed *x598; /* { dg-error "" "signed int short signed" } */
+signed int short unsigned *x599; /* { dg-error "" "signed int short unsigned" } */
+signed int short _Bool *x600; /* { dg-error "" "signed int short _Bool" } */
+signed int long void *x601; /* { dg-error "" "signed int long void" } */
+signed int long char *x602; /* { dg-error "" "signed int long char" } */
+signed int long short *x603; /* { dg-error "" "signed int long short" } */
+signed int long int *x604; /* { dg-error "" "signed int long int" } */
+signed int long long *x605;
+signed int long float *x606; /* { dg-error "" "signed int long float" } */
+signed int long double *x607; /* { dg-error "" "signed int long double" } */
+signed int long signed *x608; /* { dg-error "" "signed int long signed" } */
+signed int long unsigned *x609; /* { dg-error "" "signed int long unsigned" } */
+signed int long _Bool *x610; /* { dg-error "" "signed int long _Bool" } */
+signed long int void *x611; /* { dg-error "" "signed long int void" } */
+signed long int char *x612; /* { dg-error "" "signed long int char" } */
+signed long int short *x613; /* { dg-error "" "signed long int short" } */
+signed long int int *x614; /* { dg-error "" "signed long int int" } */
+signed long int long *x615;
+signed long int float *x616; /* { dg-error "" "signed long int float" } */
+signed long int double *x617; /* { dg-error "" "signed long int double" } */
+signed long int signed *x618; /* { dg-error "" "signed long int signed" } */
+signed long int unsigned *x619; /* { dg-error "" "signed long int unsigned" } */
+signed long int _Bool *x620; /* { dg-error "" "signed long int _Bool" } */
+signed long long void *x621; /* { dg-error "" "signed long long void" } */
+signed long long char *x622; /* { dg-error "" "signed long long char" } */
+signed long long short *x623; /* { dg-error "" "signed long long short" } */
+signed long long int *x624;
+signed long long long *x625; /* { dg-error "" "signed long long long" } */
+signed long long float *x626; /* { dg-error "" "signed long long float" } */
+signed long long double *x627; /* { dg-error "" "signed long long double" } */
+signed long long signed *x628; /* { dg-error "" "signed long long signed" } */
+signed long long unsigned *x629; /* { dg-error "" "signed long long unsigned" } */
+signed long long _Bool *x630; /* { dg-error "" "signed long long _Bool" } */
+unsigned short int void *x631; /* { dg-error "" "unsigned short int void" } */
+unsigned short int char *x632; /* { dg-error "" "unsigned short int char" } */
+unsigned short int short *x633; /* { dg-error "" "unsigned short int short" } */
+unsigned short int int *x634; /* { dg-error "" "unsigned short int int" } */
+unsigned short int long *x635; /* { dg-error "" "unsigned short int long" } */
+unsigned short int float *x636; /* { dg-error "" "unsigned short int float" } */
+unsigned short int double *x637; /* { dg-error "" "unsigned short int double" } */
+unsigned short int signed *x638; /* { dg-error "" "unsigned short int signed" } */
+unsigned short int unsigned *x639; /* { dg-error "" "unsigned short int unsigned" } */
+unsigned short int _Bool *x640; /* { dg-error "" "unsigned short int _Bool" } */
+unsigned int short void *x641; /* { dg-error "" "unsigned int short void" } */
+unsigned int short char *x642; /* { dg-error "" "unsigned int short char" } */
+unsigned int short short *x643; /* { dg-error "" "unsigned int short short" } */
+unsigned int short int *x644; /* { dg-error "" "unsigned int short int" } */
+unsigned int short long *x645; /* { dg-error "" "unsigned int short long" } */
+unsigned int short float *x646; /* { dg-error "" "unsigned int short float" } */
+unsigned int short double *x647; /* { dg-error "" "unsigned int short double" } */
+unsigned int short signed *x648; /* { dg-error "" "unsigned int short signed" } */
+unsigned int short unsigned *x649; /* { dg-error "" "unsigned int short unsigned" } */
+unsigned int short _Bool *x650; /* { dg-error "" "unsigned int short _Bool" } */
+unsigned int long void *x651; /* { dg-error "" "unsigned int long void" } */
+unsigned int long char *x652; /* { dg-error "" "unsigned int long char" } */
+unsigned int long short *x653; /* { dg-error "" "unsigned int long short" } */
+unsigned int long int *x654; /* { dg-error "" "unsigned int long int" } */
+unsigned int long long *x655;
+unsigned int long float *x656; /* { dg-error "" "unsigned int long float" } */
+unsigned int long double *x657; /* { dg-error "" "unsigned int long double" } */
+unsigned int long signed *x658; /* { dg-error "" "unsigned int long signed" } */
+unsigned int long unsigned *x659; /* { dg-error "" "unsigned int long unsigned" } */
+unsigned int long _Bool *x660; /* { dg-error "" "unsigned int long _Bool" } */
+unsigned long int void *x661; /* { dg-error "" "unsigned long int void" } */
+unsigned long int char *x662; /* { dg-error "" "unsigned long int char" } */
+unsigned long int short *x663; /* { dg-error "" "unsigned long int short" } */
+unsigned long int int *x664; /* { dg-error "" "unsigned long int int" } */
+unsigned long int long *x665;
+unsigned long int float *x666; /* { dg-error "" "unsigned long int float" } */
+unsigned long int double *x667; /* { dg-error "" "unsigned long int double" } */
+unsigned long int signed *x668; /* { dg-error "" "unsigned long int signed" } */
+unsigned long int unsigned *x669; /* { dg-error "" "unsigned long int unsigned" } */
+unsigned long int _Bool *x670; /* { dg-error "" "unsigned long int _Bool" } */
+unsigned long long void *x671; /* { dg-error "" "unsigned long long void" } */
+unsigned long long char *x672; /* { dg-error "" "unsigned long long char" } */
+unsigned long long short *x673; /* { dg-error "" "unsigned long long short" } */
+unsigned long long int *x674;
+unsigned long long long *x675; /* { dg-error "" "unsigned long long long" } */
+unsigned long long float *x676; /* { dg-error "" "unsigned long long float" } */
+unsigned long long double *x677; /* { dg-error "" "unsigned long long double" } */
+unsigned long long signed *x678; /* { dg-error "" "unsigned long long signed" } */
+unsigned long long unsigned *x679; /* { dg-error "" "unsigned long long unsigned" } */
+unsigned long long _Bool *x680; /* { dg-error "" "unsigned long long _Bool" } */
+int long long signed void *x681; /* { dg-error "" "int long long signed void" } */
+int long long signed char *x682; /* { dg-error "" "int long long signed char" } */
+int long long signed short *x683; /* { dg-error "" "int long long signed short" } */
+int long long signed int *x684; /* { dg-error "" "int long long signed int" } */
+int long long signed long *x685; /* { dg-error "" "int long long signed long" } */
+int long long signed float *x686; /* { dg-error "" "int long long signed float" } */
+int long long signed double *x687; /* { dg-error "" "int long long signed double" } */
+int long long signed signed *x688; /* { dg-error "" "int long long signed signed" } */
+int long long signed unsigned *x689; /* { dg-error "" "int long long signed unsigned" } */
+int long long signed _Bool *x690; /* { dg-error "" "int long long signed _Bool" } */
+int long long unsigned void *x691; /* { dg-error "" "int long long unsigned void" } */
+int long long unsigned char *x692; /* { dg-error "" "int long long unsigned char" } */
+int long long unsigned short *x693; /* { dg-error "" "int long long unsigned short" } */
+int long long unsigned int *x694; /* { dg-error "" "int long long unsigned int" } */
+int long long unsigned long *x695; /* { dg-error "" "int long long unsigned long" } */
+int long long unsigned float *x696; /* { dg-error "" "int long long unsigned float" } */
+int long long unsigned double *x697; /* { dg-error "" "int long long unsigned double" } */
+int long long unsigned signed *x698; /* { dg-error "" "int long long unsigned signed" } */
+int long long unsigned unsigned *x699; /* { dg-error "" "int long long unsigned unsigned" } */
+int long long unsigned _Bool *x700; /* { dg-error "" "int long long unsigned _Bool" } */
+int long signed long void *x701; /* { dg-error "" "int long signed long void" } */
+int long signed long char *x702; /* { dg-error "" "int long signed long char" } */
+int long signed long short *x703; /* { dg-error "" "int long signed long short" } */
+int long signed long int *x704; /* { dg-error "" "int long signed long int" } */
+int long signed long long *x705; /* { dg-error "" "int long signed long long" } */
+int long signed long float *x706; /* { dg-error "" "int long signed long float" } */
+int long signed long double *x707; /* { dg-error "" "int long signed long double" } */
+int long signed long signed *x708; /* { dg-error "" "int long signed long signed" } */
+int long signed long unsigned *x709; /* { dg-error "" "int long signed long unsigned" } */
+int long signed long _Bool *x710; /* { dg-error "" "int long signed long _Bool" } */
+int long unsigned long void *x711; /* { dg-error "" "int long unsigned long void" } */
+int long unsigned long char *x712; /* { dg-error "" "int long unsigned long char" } */
+int long unsigned long short *x713; /* { dg-error "" "int long unsigned long short" } */
+int long unsigned long int *x714; /* { dg-error "" "int long unsigned long int" } */
+int long unsigned long long *x715; /* { dg-error "" "int long unsigned long long" } */
+int long unsigned long float *x716; /* { dg-error "" "int long unsigned long float" } */
+int long unsigned long double *x717; /* { dg-error "" "int long unsigned long double" } */
+int long unsigned long signed *x718; /* { dg-error "" "int long unsigned long signed" } */
+int long unsigned long unsigned *x719; /* { dg-error "" "int long unsigned long unsigned" } */
+int long unsigned long _Bool *x720; /* { dg-error "" "int long unsigned long _Bool" } */
+int signed long long void *x721; /* { dg-error "" "int signed long long void" } */
+int signed long long char *x722; /* { dg-error "" "int signed long long char" } */
+int signed long long short *x723; /* { dg-error "" "int signed long long short" } */
+int signed long long int *x724; /* { dg-error "" "int signed long long int" } */
+int signed long long long *x725; /* { dg-error "" "int signed long long long" } */
+int signed long long float *x726; /* { dg-error "" "int signed long long float" } */
+int signed long long double *x727; /* { dg-error "" "int signed long long double" } */
+int signed long long signed *x728; /* { dg-error "" "int signed long long signed" } */
+int signed long long unsigned *x729; /* { dg-error "" "int signed long long unsigned" } */
+int signed long long _Bool *x730; /* { dg-error "" "int signed long long _Bool" } */
+int unsigned long long void *x731; /* { dg-error "" "int unsigned long long void" } */
+int unsigned long long char *x732; /* { dg-error "" "int unsigned long long char" } */
+int unsigned long long short *x733; /* { dg-error "" "int unsigned long long short" } */
+int unsigned long long int *x734; /* { dg-error "" "int unsigned long long int" } */
+int unsigned long long long *x735; /* { dg-error "" "int unsigned long long long" } */
+int unsigned long long float *x736; /* { dg-error "" "int unsigned long long float" } */
+int unsigned long long double *x737; /* { dg-error "" "int unsigned long long double" } */
+int unsigned long long signed *x738; /* { dg-error "" "int unsigned long long signed" } */
+int unsigned long long unsigned *x739; /* { dg-error "" "int unsigned long long unsigned" } */
+int unsigned long long _Bool *x740; /* { dg-error "" "int unsigned long long _Bool" } */
+long int long signed void *x741; /* { dg-error "" "long int long signed void" } */
+long int long signed char *x742; /* { dg-error "" "long int long signed char" } */
+long int long signed short *x743; /* { dg-error "" "long int long signed short" } */
+long int long signed int *x744; /* { dg-error "" "long int long signed int" } */
+long int long signed long *x745; /* { dg-error "" "long int long signed long" } */
+long int long signed float *x746; /* { dg-error "" "long int long signed float" } */
+long int long signed double *x747; /* { dg-error "" "long int long signed double" } */
+long int long signed signed *x748; /* { dg-error "" "long int long signed signed" } */
+long int long signed unsigned *x749; /* { dg-error "" "long int long signed unsigned" } */
+long int long signed _Bool *x750; /* { dg-error "" "long int long signed _Bool" } */
+long int long unsigned void *x751; /* { dg-error "" "long int long unsigned void" } */
+long int long unsigned char *x752; /* { dg-error "" "long int long unsigned char" } */
+long int long unsigned short *x753; /* { dg-error "" "long int long unsigned short" } */
+long int long unsigned int *x754; /* { dg-error "" "long int long unsigned int" } */
+long int long unsigned long *x755; /* { dg-error "" "long int long unsigned long" } */
+long int long unsigned float *x756; /* { dg-error "" "long int long unsigned float" } */
+long int long unsigned double *x757; /* { dg-error "" "long int long unsigned double" } */
+long int long unsigned signed *x758; /* { dg-error "" "long int long unsigned signed" } */
+long int long unsigned unsigned *x759; /* { dg-error "" "long int long unsigned unsigned" } */
+long int long unsigned _Bool *x760; /* { dg-error "" "long int long unsigned _Bool" } */
+long int signed long void *x761; /* { dg-error "" "long int signed long void" } */
+long int signed long char *x762; /* { dg-error "" "long int signed long char" } */
+long int signed long short *x763; /* { dg-error "" "long int signed long short" } */
+long int signed long int *x764; /* { dg-error "" "long int signed long int" } */
+long int signed long long *x765; /* { dg-error "" "long int signed long long" } */
+long int signed long float *x766; /* { dg-error "" "long int signed long float" } */
+long int signed long double *x767; /* { dg-error "" "long int signed long double" } */
+long int signed long signed *x768; /* { dg-error "" "long int signed long signed" } */
+long int signed long unsigned *x769; /* { dg-error "" "long int signed long unsigned" } */
+long int signed long _Bool *x770; /* { dg-error "" "long int signed long _Bool" } */
+long int unsigned long void *x771; /* { dg-error "" "long int unsigned long void" } */
+long int unsigned long char *x772; /* { dg-error "" "long int unsigned long char" } */
+long int unsigned long short *x773; /* { dg-error "" "long int unsigned long short" } */
+long int unsigned long int *x774; /* { dg-error "" "long int unsigned long int" } */
+long int unsigned long long *x775; /* { dg-error "" "long int unsigned long long" } */
+long int unsigned long float *x776; /* { dg-error "" "long int unsigned long float" } */
+long int unsigned long double *x777; /* { dg-error "" "long int unsigned long double" } */
+long int unsigned long signed *x778; /* { dg-error "" "long int unsigned long signed" } */
+long int unsigned long unsigned *x779; /* { dg-error "" "long int unsigned long unsigned" } */
+long int unsigned long _Bool *x780; /* { dg-error "" "long int unsigned long _Bool" } */
+long long int signed void *x781; /* { dg-error "" "long long int signed void" } */
+long long int signed char *x782; /* { dg-error "" "long long int signed char" } */
+long long int signed short *x783; /* { dg-error "" "long long int signed short" } */
+long long int signed int *x784; /* { dg-error "" "long long int signed int" } */
+long long int signed long *x785; /* { dg-error "" "long long int signed long" } */
+long long int signed float *x786; /* { dg-error "" "long long int signed float" } */
+long long int signed double *x787; /* { dg-error "" "long long int signed double" } */
+long long int signed signed *x788; /* { dg-error "" "long long int signed signed" } */
+long long int signed unsigned *x789; /* { dg-error "" "long long int signed unsigned" } */
+long long int signed _Bool *x790; /* { dg-error "" "long long int signed _Bool" } */
+long long int unsigned void *x791; /* { dg-error "" "long long int unsigned void" } */
+long long int unsigned char *x792; /* { dg-error "" "long long int unsigned char" } */
+long long int unsigned short *x793; /* { dg-error "" "long long int unsigned short" } */
+long long int unsigned int *x794; /* { dg-error "" "long long int unsigned int" } */
+long long int unsigned long *x795; /* { dg-error "" "long long int unsigned long" } */
+long long int unsigned float *x796; /* { dg-error "" "long long int unsigned float" } */
+long long int unsigned double *x797; /* { dg-error "" "long long int unsigned double" } */
+long long int unsigned signed *x798; /* { dg-error "" "long long int unsigned signed" } */
+long long int unsigned unsigned *x799; /* { dg-error "" "long long int unsigned unsigned" } */
+long long int unsigned _Bool *x800; /* { dg-error "" "long long int unsigned _Bool" } */
+long long signed int void *x801; /* { dg-error "" "long long signed int void" } */
+long long signed int char *x802; /* { dg-error "" "long long signed int char" } */
+long long signed int short *x803; /* { dg-error "" "long long signed int short" } */
+long long signed int int *x804; /* { dg-error "" "long long signed int int" } */
+long long signed int long *x805; /* { dg-error "" "long long signed int long" } */
+long long signed int float *x806; /* { dg-error "" "long long signed int float" } */
+long long signed int double *x807; /* { dg-error "" "long long signed int double" } */
+long long signed int signed *x808; /* { dg-error "" "long long signed int signed" } */
+long long signed int unsigned *x809; /* { dg-error "" "long long signed int unsigned" } */
+long long signed int _Bool *x810; /* { dg-error "" "long long signed int _Bool" } */
+long long unsigned int void *x811; /* { dg-error "" "long long unsigned int void" } */
+long long unsigned int char *x812; /* { dg-error "" "long long unsigned int char" } */
+long long unsigned int short *x813; /* { dg-error "" "long long unsigned int short" } */
+long long unsigned int int *x814; /* { dg-error "" "long long unsigned int int" } */
+long long unsigned int long *x815; /* { dg-error "" "long long unsigned int long" } */
+long long unsigned int float *x816; /* { dg-error "" "long long unsigned int float" } */
+long long unsigned int double *x817; /* { dg-error "" "long long unsigned int double" } */
+long long unsigned int signed *x818; /* { dg-error "" "long long unsigned int signed" } */
+long long unsigned int unsigned *x819; /* { dg-error "" "long long unsigned int unsigned" } */
+long long unsigned int _Bool *x820; /* { dg-error "" "long long unsigned int _Bool" } */
+long signed int long void *x821; /* { dg-error "" "long signed int long void" } */
+long signed int long char *x822; /* { dg-error "" "long signed int long char" } */
+long signed int long short *x823; /* { dg-error "" "long signed int long short" } */
+long signed int long int *x824; /* { dg-error "" "long signed int long int" } */
+long signed int long long *x825; /* { dg-error "" "long signed int long long" } */
+long signed int long float *x826; /* { dg-error "" "long signed int long float" } */
+long signed int long double *x827; /* { dg-error "" "long signed int long double" } */
+long signed int long signed *x828; /* { dg-error "" "long signed int long signed" } */
+long signed int long unsigned *x829; /* { dg-error "" "long signed int long unsigned" } */
+long signed int long _Bool *x830; /* { dg-error "" "long signed int long _Bool" } */
+long signed long int void *x831; /* { dg-error "" "long signed long int void" } */
+long signed long int char *x832; /* { dg-error "" "long signed long int char" } */
+long signed long int short *x833; /* { dg-error "" "long signed long int short" } */
+long signed long int int *x834; /* { dg-error "" "long signed long int int" } */
+long signed long int long *x835; /* { dg-error "" "long signed long int long" } */
+long signed long int float *x836; /* { dg-error "" "long signed long int float" } */
+long signed long int double *x837; /* { dg-error "" "long signed long int double" } */
+long signed long int signed *x838; /* { dg-error "" "long signed long int signed" } */
+long signed long int unsigned *x839; /* { dg-error "" "long signed long int unsigned" } */
+long signed long int _Bool *x840; /* { dg-error "" "long signed long int _Bool" } */
+long unsigned int long void *x841; /* { dg-error "" "long unsigned int long void" } */
+long unsigned int long char *x842; /* { dg-error "" "long unsigned int long char" } */
+long unsigned int long short *x843; /* { dg-error "" "long unsigned int long short" } */
+long unsigned int long int *x844; /* { dg-error "" "long unsigned int long int" } */
+long unsigned int long long *x845; /* { dg-error "" "long unsigned int long long" } */
+long unsigned int long float *x846; /* { dg-error "" "long unsigned int long float" } */
+long unsigned int long double *x847; /* { dg-error "" "long unsigned int long double" } */
+long unsigned int long signed *x848; /* { dg-error "" "long unsigned int long signed" } */
+long unsigned int long unsigned *x849; /* { dg-error "" "long unsigned int long unsigned" } */
+long unsigned int long _Bool *x850; /* { dg-error "" "long unsigned int long _Bool" } */
+long unsigned long int void *x851; /* { dg-error "" "long unsigned long int void" } */
+long unsigned long int char *x852; /* { dg-error "" "long unsigned long int char" } */
+long unsigned long int short *x853; /* { dg-error "" "long unsigned long int short" } */
+long unsigned long int int *x854; /* { dg-error "" "long unsigned long int int" } */
+long unsigned long int long *x855; /* { dg-error "" "long unsigned long int long" } */
+long unsigned long int float *x856; /* { dg-error "" "long unsigned long int float" } */
+long unsigned long int double *x857; /* { dg-error "" "long unsigned long int double" } */
+long unsigned long int signed *x858; /* { dg-error "" "long unsigned long int signed" } */
+long unsigned long int unsigned *x859; /* { dg-error "" "long unsigned long int unsigned" } */
+long unsigned long int _Bool *x860; /* { dg-error "" "long unsigned long int _Bool" } */
+signed int long long void *x861; /* { dg-error "" "signed int long long void" } */
+signed int long long char *x862; /* { dg-error "" "signed int long long char" } */
+signed int long long short *x863; /* { dg-error "" "signed int long long short" } */
+signed int long long int *x864; /* { dg-error "" "signed int long long int" } */
+signed int long long long *x865; /* { dg-error "" "signed int long long long" } */
+signed int long long float *x866; /* { dg-error "" "signed int long long float" } */
+signed int long long double *x867; /* { dg-error "" "signed int long long double" } */
+signed int long long signed *x868; /* { dg-error "" "signed int long long signed" } */
+signed int long long unsigned *x869; /* { dg-error "" "signed int long long unsigned" } */
+signed int long long _Bool *x870; /* { dg-error "" "signed int long long _Bool" } */
+signed long int long void *x871; /* { dg-error "" "signed long int long void" } */
+signed long int long char *x872; /* { dg-error "" "signed long int long char" } */
+signed long int long short *x873; /* { dg-error "" "signed long int long short" } */
+signed long int long int *x874; /* { dg-error "" "signed long int long int" } */
+signed long int long long *x875; /* { dg-error "" "signed long int long long" } */
+signed long int long float *x876; /* { dg-error "" "signed long int long float" } */
+signed long int long double *x877; /* { dg-error "" "signed long int long double" } */
+signed long int long signed *x878; /* { dg-error "" "signed long int long signed" } */
+signed long int long unsigned *x879; /* { dg-error "" "signed long int long unsigned" } */
+signed long int long _Bool *x880; /* { dg-error "" "signed long int long _Bool" } */
+signed long long int void *x881; /* { dg-error "" "signed long long int void" } */
+signed long long int char *x882; /* { dg-error "" "signed long long int char" } */
+signed long long int short *x883; /* { dg-error "" "signed long long int short" } */
+signed long long int int *x884; /* { dg-error "" "signed long long int int" } */
+signed long long int long *x885; /* { dg-error "" "signed long long int long" } */
+signed long long int float *x886; /* { dg-error "" "signed long long int float" } */
+signed long long int double *x887; /* { dg-error "" "signed long long int double" } */
+signed long long int signed *x888; /* { dg-error "" "signed long long int signed" } */
+signed long long int unsigned *x889; /* { dg-error "" "signed long long int unsigned" } */
+signed long long int _Bool *x890; /* { dg-error "" "signed long long int _Bool" } */
+unsigned int long long void *x891; /* { dg-error "" "unsigned int long long void" } */
+unsigned int long long char *x892; /* { dg-error "" "unsigned int long long char" } */
+unsigned int long long short *x893; /* { dg-error "" "unsigned int long long short" } */
+unsigned int long long int *x894; /* { dg-error "" "unsigned int long long int" } */
+unsigned int long long long *x895; /* { dg-error "" "unsigned int long long long" } */
+unsigned int long long float *x896; /* { dg-error "" "unsigned int long long float" } */
+unsigned int long long double *x897; /* { dg-error "" "unsigned int long long double" } */
+unsigned int long long signed *x898; /* { dg-error "" "unsigned int long long signed" } */
+unsigned int long long unsigned *x899; /* { dg-error "" "unsigned int long long unsigned" } */
+unsigned int long long _Bool *x900; /* { dg-error "" "unsigned int long long _Bool" } */
+unsigned long int long void *x901; /* { dg-error "" "unsigned long int long void" } */
+unsigned long int long char *x902; /* { dg-error "" "unsigned long int long char" } */
+unsigned long int long short *x903; /* { dg-error "" "unsigned long int long short" } */
+unsigned long int long int *x904; /* { dg-error "" "unsigned long int long int" } */
+unsigned long int long long *x905; /* { dg-error "" "unsigned long int long long" } */
+unsigned long int long float *x906; /* { dg-error "" "unsigned long int long float" } */
+unsigned long int long double *x907; /* { dg-error "" "unsigned long int long double" } */
+unsigned long int long signed *x908; /* { dg-error "" "unsigned long int long signed" } */
+unsigned long int long unsigned *x909; /* { dg-error "" "unsigned long int long unsigned" } */
+unsigned long int long _Bool *x910; /* { dg-error "" "unsigned long int long _Bool" } */
+unsigned long long int void *x911; /* { dg-error "" "unsigned long long int void" } */
+unsigned long long int char *x912; /* { dg-error "" "unsigned long long int char" } */
+unsigned long long int short *x913; /* { dg-error "" "unsigned long long int short" } */
+unsigned long long int int *x914; /* { dg-error "" "unsigned long long int int" } */
+unsigned long long int long *x915; /* { dg-error "" "unsigned long long int long" } */
+unsigned long long int float *x916; /* { dg-error "" "unsigned long long int float" } */
+unsigned long long int double *x917; /* { dg-error "" "unsigned long long int double" } */
+unsigned long long int signed *x918; /* { dg-error "" "unsigned long long int signed" } */
+unsigned long long int unsigned *x919; /* { dg-error "" "unsigned long long int unsigned" } */
+unsigned long long int _Bool *x920; /* { dg-error "" "unsigned long long int _Bool" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c
new file mode 100644
index 000000000..61b901053
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c-shift-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile} */
+/* { dg-options "-fsanitize=shift -w" } */
+/* { dg-shouldfail "ubsan" } */
+
+int x;
+int
+main (void)
+{
+ /* None of the following should pass. */
+ int A[1 >> -1] = {}; /* { dg-error "variable-sized object may not be initialized" } */
+ int B[-1 >> -1] = {}; /* { dg-error "variable-sized object may not be initialized" } */
+ int D[1 << -1] = {}; /* { dg-error "variable-sized object may not be initialized" } */
+ int E[-1 << -1] = {}; /* { dg-error "variable-sized object may not be initialized" } */
+ int F[-1 >> 200] = {}; /* { dg-error "variable-sized object may not be initialized" } */
+ int G[1 << 200] = {}; /* { dg-error "variable-sized object may not be initialized" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c99-shift-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c99-shift-1.c
new file mode 100644
index 000000000..ff6776bf3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c99-shift-1.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-options "-fsanitize=shift -w -std=c99" } */
+
+int
+main (void)
+{
+ int a = -42;
+ a << 1;
+}
+/* { dg-output "left shift of negative value -42" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c99-shift-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c99-shift-2.c
new file mode 100644
index 000000000..c6662dc43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/c99-shift-2.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+/* { dg-options "-fsanitize=shift -w -std=c99" } */
+
+int
+main (void)
+{
+ int a = 1;
+ a <<= 31;
+}
+/* { dg-output "left shift of 1 by 31 places cannot be represented in type 'int'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/ubsan.exp b/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/ubsan.exp
new file mode 100644
index 000000000..962363b61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ubsan/ubsan.exp
@@ -0,0 +1,36 @@
+# Copyright (C) 2013-2014 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+load_lib ubsan-dg.exp
+
+# Initialize `dg'.
+dg-init
+if [ubsan_init] {
+
+# Main loop.
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common/ubsan/*.c]] ""
+
+}
+
+# All done.
+ubsan_finish
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-1.c
new file mode 100644
index 000000000..ed89cfdee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-1.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+void abort (void);
+
+int main (void)
+{
+ int \u00C0 = 1;
+ int \u00C1 = 2;
+ int \U000000C2 = 3;
+ int wh\u00ff = 4;
+ int a\u00c4b\u0441\U000003b4e = 5;
+
+ if (\u00C0 != 1)
+ abort ();
+ if (\u00c1 != 2)
+ abort ();
+ if (\u00C2 != 3)
+ abort ();
+ if (wh\u00ff != 4)
+ abort ();
+ if (a\u00c4b\u0441\U000003b4e != 5)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-10.c
new file mode 100644
index 000000000..83425d3cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-10.c
@@ -0,0 +1,10 @@
+/* Verify diagnostics for extended identifiers refer to UCNs (in the C
+ locale). Test #pragma pack diagnostics. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fextended-identifiers" } */
+/* { dg-require-ascii-locale "" } */
+/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+#pragma pack(push)
+#pragma pack(pop, \u00f3) /* { dg-warning "pop, \\\\U000000f3.*push, \\\\U000000f3" } */
+#pragma pack(\u00e7) /* { dg-warning "unknown action '\\\\U000000e7'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-11.c
new file mode 100644
index 000000000..6d40ef4d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-11.c
@@ -0,0 +1,7 @@
+/* { dg-do run } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
+/* { dg-skip-if "-fdata-sections not supported" { { hppa*-*-hpux* } && { ! lp64 } } { "*" } { "" } } */
+/* { dg-options "-std=c99 -fextended-identifiers -fdata-sections" } */
+
+#include "ucnid-3.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-12.c
new file mode 100644
index 000000000..dd5e6d5d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-12.c
@@ -0,0 +1,7 @@
+/* { dg-do run } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
+/* { dg-skip-if "-ffunction-sections not supported" { { hppa*-*-hpux* } && { ! lp64 } } { "*" } { "" } } */
+/* { dg-options "-std=c99 -fextended-identifiers -ffunction-sections" } */
+
+#include "ucnid-4.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-13.c
new file mode 100644
index 000000000..0b94247ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-13.c
@@ -0,0 +1,15 @@
+/* Verify diagnostics for extended identifiers refer to UCNs (in the C
+ locale). Miscellaneous diagnostics. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fextended-identifiers -Wpacked" } */
+/* { dg-require-ascii-locale "" } */
+/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int a __attribute__((\u00c0)); /* { dg-warning "'\\\\U000000c0' attribute directive ignored" } */
+
+extern void \u00c1 (void) __attribute__((deprecated));
+void g (void) { \u00c1 (); } /* { dg-warning "'\\\\U000000c1' is deprecated" } */
+
+struct \u00c2 { char c; } __attribute__((packed)); /* { dg-warning "'\\\\U000000c2'" } */
+
+void h (void) { asm ("%[\u00c3]" : : ); } /* { dg-error "undefined named operand '\\\\U000000c3'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-2.c
new file mode 100644
index 000000000..9cbc7504c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-2.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+void abort (void);
+
+static int \u00C0 = 1;
+static int \u00C1 = 2;
+static int \U000000C2 = 3;
+static int wh\u00ff = 4;
+static int a\u00c4b\u0441\U000003b4e = 5;
+
+int main (void)
+{
+
+ if (\u00C0 != 1)
+ abort ();
+ if (\u00c1 != 2)
+ abort ();
+ if (\u00C2 != 3)
+ abort ();
+ if (wh\u00ff != 4)
+ abort ();
+ if (a\u00c4b\u0441\U000003b4e != 5)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-3.c
new file mode 100644
index 000000000..5ea0d03bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-3.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+void abort (void);
+
+int \u00C0 = 1;
+int \u00C1 = 2;
+int \U000000C2 = 3;
+int wh\u00ff = 4;
+int a\u00c4b\u0441\U000003b4e = 5;
+
+int main (void)
+{
+
+ if (\u00C0 != 1)
+ abort ();
+ if (\u00c1 != 2)
+ abort ();
+ if (\u00C2 != 3)
+ abort ();
+ if (wh\u00ff != 4)
+ abort ();
+ if (a\u00c4b\u0441\U000003b4e != 5)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-4.c
new file mode 100644
index 000000000..a18e6e302
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-4.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+void abort (void);
+
+int \u00C0(void) { return 1; }
+int \u00C1(void) { return 2; }
+int \U000000C2(void) { return 3; }
+int wh\u00ff(void) { return 4; }
+int a\u00c4b\u0441\U000003b4e(void) { return 5; }
+
+int main (void)
+{
+
+ if (\u00C0() != 1)
+ abort ();
+ if (\u00c1() != 2)
+ abort ();
+ if (\u00C2() != 3)
+ abort ();
+ if (wh\u00ff() != 4)
+ abort ();
+ if (a\u00c4b\u0441\U000003b4e() != 5)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-5.c
new file mode 100644
index 000000000..c7ad8ffb3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-5.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-skip-if "No dollar in identfiers" { "avr-*-*" } { "*" } { "" } } */
+/* { dg-options "-std=c99 -fdollars-in-identifiers -fextended-identifiers" } */
+void abort (void);
+
+int a$b(void) { return 1; }
+
+int main (void)
+{
+
+ if (a\u0024b() != 1)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-6.c
new file mode 100644
index 000000000..5713a84f2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-6.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
+/* { dg-options "-std=c99 -fextended-identifiers -save-temps" } */
+void abort (void);
+
+int \u00C0(void) { return 1; }
+int \u00C1(void) { return 2; }
+int \U000000C2(void) { return 3; }
+int wh\u00ff(void) { return 4; }
+int a\u00c4b\u0441\U000003b4e(void) { return 5; }
+
+int main (void)
+{
+
+ if (\u00C0() != 1)
+ abort ();
+ if (\u00c1() != 2)
+ abort ();
+ if (\u00C2() != 3)
+ abort ();
+ if (wh\u00ff() != 4)
+ abort ();
+ if (a\u00c4b\u0441\U000003b4e() != 5)
+ abort ();
+
+ return 0;
+}
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-7.c
new file mode 100644
index 000000000..3f73e35d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-7.c
@@ -0,0 +1,9 @@
+/* Verify diagnostics for extended identifiers refer to UCNs (in the C
+ locale). */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fextended-identifiers" } */
+/* { dg-require-ascii-locale "" } */
+/* { dg-skip-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */
+
+void *p = &\u00e9; /* { dg-error "'\\\\U000000e9' undeclared" } */
+void *q = &\u1e00; /* { dg-error "'\\\\U00001e00' undeclared" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-8.c
new file mode 100644
index 000000000..df1f35053
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-8.c
@@ -0,0 +1,16 @@
+/* Verify diagnostics for extended identifiers refer to UCNs (in the C
+ locale). Further tests of C front-end diagnostics. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fextended-identifiers -Wvla" } */
+/* { dg-require-ascii-locale "" } */
+/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int a __attribute__((__mode__(\u00e9))); /* { dg-error "unknown machine mode '\\\\U000000e9'" } */
+struct s1 { int \u00e9 : 0; }; /* { dg-error "zero width for bit-field '\\\\U000000e9'" } */
+
+void f (int b) { int \u00e9[b]; } /* { dg-warning "variable length array '\\\\U000000e9'" } */
+
+void g (static int \u00e9); /* { dg-error "storage class specified for parameter '\\\\U000000e9'" } */
+
+struct s2 { int \u00e1; } \u00e9 = { { 0 } }; /* { dg-warning "braces around scalar initializer" } */
+/* { dg-warning "near initialization for '\\\\U000000e9\\.\\\\U000000e1'" "UCN diag" { target *-*-* } 15 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-9.c
new file mode 100644
index 000000000..a6f91184a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/ucnid-9.c
@@ -0,0 +1,25 @@
+/* Test __func__ with extended identifiers and character set
+ conversions. */
+/* { dg-do run } */
+/* { dg-xfail-if "" { "powerpc-ibm-aix*" } { "*" } { "" } } */
+/* { dg-skip-if "" { ! ucn } { "*" } { "" } } */
+/* { dg-options "-std=c99 -fextended-identifiers -fexec-charset=ISO-8859-1" } */
+/* { dg-require-iconv "ISO-8859-1" } */
+
+extern int strcmp (const char *, const char *);
+extern void abort (void);
+extern void exit (int);
+
+void
+\u00e9 (void)
+{
+ if (strcmp (__func__, "\u00e9") != 0)
+ abort ();
+}
+
+int
+main (void)
+{
+ \u00e9 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unaligned-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/unaligned-1.c
new file mode 100644
index 000000000..5df1b37e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unaligned-1.c
@@ -0,0 +1,49 @@
+/* PR middle-end/7847 */
+/* Originator: <jk@tools.de> */
+/* { dg-do run } */
+
+/* This used to fail on SPARC at runtime because of
+ an unaligned memory access. */
+
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+
+typedef struct {
+ uint32_t address;
+ uint16_t size;
+} __attribute__ ((packed)) sml_agl_data_t;
+
+typedef struct {
+ sml_agl_data_t data[9];
+} __attribute__ ((packed)) sml_agli_t;
+
+typedef struct {
+ sml_agli_t sml_agli;
+} __attribute__ ((packed)) dsi_t;
+
+typedef struct {
+ int a;
+ dsi_t dsi_pack;
+} dvd_priv_t;
+
+int dvd_read_sector(dvd_priv_t *d, unsigned char* data)
+{
+ int i, skip=0;
+
+ for (i=0; i < 9; i++)
+ if ((skip=d->dsi_pack.sml_agli.data[i].address) != 0)
+ break;
+
+ return skip;
+}
+
+int main(void)
+{
+ static dvd_priv_t dvd_priv;
+ dvd_read_sector(&dvd_priv, 0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-1-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-1-O0.c
new file mode 100644
index 000000000..4fe5d6b11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-1-O0.c
@@ -0,0 +1,30 @@
+/* Spurious uninitialized variable warnings, case 1.
+ Taken from cppfiles.c (merge_include_chains) */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+struct list
+{
+ struct list *next;
+ int id;
+};
+
+extern void free (void *);
+
+void remove_dupes (struct list *el)
+{
+ struct list *p, *q, *r; /* { dg-bogus "r" "uninitialized variable warning" } */
+
+ for (p = el; p; p = p->next)
+ {
+ for (q = el; q != p; q = q->next)
+ if (q->id == p->id)
+ {
+ r->next = p->next;
+ free (p);
+ p = r;
+ break;
+ }
+ r = p;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-1.c
new file mode 100644
index 000000000..060ec250b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-1.c
@@ -0,0 +1,30 @@
+/* Spurious uninitialized variable warnings, case 1.
+ Taken from cppfiles.c (merge_include_chains) */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+struct list
+{
+ struct list *next;
+ int id;
+};
+
+extern void free (void *);
+
+void remove_dupes (struct list *el)
+{
+ struct list *p, *q, *r; /* { dg-bogus "r" "uninitialized variable warning" } */
+
+ for (p = el; p; p = p->next)
+ {
+ for (q = el; q != p; q = q->next)
+ if (q->id == p->id)
+ {
+ r->next = p->next;
+ free (p);
+ p = r;
+ break;
+ }
+ r = p;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-10-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-10-O0.c
new file mode 100644
index 000000000..f761ac91c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-10-O0.c
@@ -0,0 +1,109 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+/* On Alpha EV4, dead code elimination and cfg simplification conspired
+ to leave the register containing 'C' marked live, though all references
+ to the variable had been removed. */
+
+struct operand_data
+{
+ struct operand_data *next;
+ int index;
+ const char *predicate;
+ const char *constraint;
+ int mode;
+ unsigned char n_alternatives;
+ char address_p;
+ char strict_low;
+ char eliminable;
+ char seen;
+};
+
+struct data
+{
+ struct data *next;
+ const char *name;
+ const char *template;
+ int code_number;
+ int index_number;
+ int lineno;
+ int n_operands;
+ int n_dups;
+ int n_alternatives;
+ int operand_number;
+ int output_format;
+ struct operand_data operand[40];
+};
+
+extern void message_with_line (int, const char *, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int have_error;
+
+extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));
+
+void
+validate_insn_alternatives (d)
+ struct data *d;
+{
+ int n = 0, start;
+
+ for (start = 0; start < d->n_operands; start++)
+ if (d->operand[start].n_alternatives > 0)
+ {
+ int len, i;
+ const char *p;
+ char c; /* { dg-bogus "used uninitialized" "uninitialized variable warning" } */
+ int which_alternative = 0;
+ int alternative_count_unsure = 0;
+
+ for (p = d->operand[start].constraint; (c = *p); p += len)
+ {
+ len = 1;
+
+ if (len < 1 || (len > 1 && strchr (",#*+=&%!0123456789", c)))
+ {
+ message_with_line (d->lineno,
+ "invalid length %d for char '%c' in alternative %d of operand %d",
+ len, c, which_alternative, start);
+ len = 1;
+ have_error = 1;
+ }
+
+ if (c == ',')
+ {
+ which_alternative++;
+ continue;
+ }
+
+ for (i = 1; i < len; i++)
+ if (p[i] == '\0')
+ {
+ message_with_line (d->lineno,
+ "NUL in alternative %d of operand %d",
+ which_alternative, start);
+ alternative_count_unsure = 1;
+ break;
+ }
+ else if (strchr (",#*", p[i]))
+ {
+ message_with_line (d->lineno,
+ "'%c' in alternative %d of operand %d",
+ p[i], which_alternative, start);
+ alternative_count_unsure = 1;
+ }
+ }
+ if (alternative_count_unsure)
+ have_error = 1;
+ else if (n == 0)
+ n = d->operand[start].n_alternatives;
+ else if (n != d->operand[start].n_alternatives)
+ {
+ message_with_line (d->lineno,
+ "wrong number of alternatives in operand %d",
+ start);
+ have_error = 1;
+ }
+ }
+
+
+ d->n_alternatives = n;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-10.c
new file mode 100644
index 000000000..0d62020df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-10.c
@@ -0,0 +1,109 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+/* On Alpha EV4, dead code elimination and cfg simplification conspired
+ to leave the register containing 'C' marked live, though all references
+ to the variable had been removed. */
+
+struct operand_data
+{
+ struct operand_data *next;
+ int index;
+ const char *predicate;
+ const char *constraint;
+ int mode;
+ unsigned char n_alternatives;
+ char address_p;
+ char strict_low;
+ char eliminable;
+ char seen;
+};
+
+struct data
+{
+ struct data *next;
+ const char *name;
+ const char *template;
+ int code_number;
+ int index_number;
+ int lineno;
+ int n_operands;
+ int n_dups;
+ int n_alternatives;
+ int operand_number;
+ int output_format;
+ struct operand_data operand[40];
+};
+
+extern void message_with_line (int, const char *, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int have_error;
+
+extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));
+
+void
+validate_insn_alternatives (d)
+ struct data *d;
+{
+ int n = 0, start;
+
+ for (start = 0; start < d->n_operands; start++)
+ if (d->operand[start].n_alternatives > 0)
+ {
+ int len, i;
+ const char *p;
+ char c; /* { dg-bogus "used uninitialized" "uninitialized variable warning" } */
+ int which_alternative = 0;
+ int alternative_count_unsure = 0;
+
+ for (p = d->operand[start].constraint; (c = *p); p += len)
+ {
+ len = 1;
+
+ if (len < 1 || (len > 1 && strchr (",#*+=&%!0123456789", c)))
+ {
+ message_with_line (d->lineno,
+ "invalid length %d for char '%c' in alternative %d of operand %d",
+ len, c, which_alternative, start);
+ len = 1;
+ have_error = 1;
+ }
+
+ if (c == ',')
+ {
+ which_alternative++;
+ continue;
+ }
+
+ for (i = 1; i < len; i++)
+ if (p[i] == '\0')
+ {
+ message_with_line (d->lineno,
+ "NUL in alternative %d of operand %d",
+ which_alternative, start);
+ alternative_count_unsure = 1;
+ break;
+ }
+ else if (strchr (",#*", p[i]))
+ {
+ message_with_line (d->lineno,
+ "'%c' in alternative %d of operand %d",
+ p[i], which_alternative, start);
+ alternative_count_unsure = 1;
+ }
+ }
+ if (alternative_count_unsure)
+ have_error = 1;
+ else if (n == 0)
+ n = d->operand[start].n_alternatives;
+ else if (n != d->operand[start].n_alternatives)
+ {
+ message_with_line (d->lineno,
+ "wrong number of alternatives in operand %d",
+ start);
+ have_error = 1;
+ }
+ }
+
+
+ d->n_alternatives = n;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-11-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-11-O0.c
new file mode 100644
index 000000000..23af4f69a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-11-O0.c
@@ -0,0 +1,42 @@
+/* Positive test for uninitialized variables. */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+int sink;
+
+void f1(int parm) /* { dg-bogus "uninitialized" "parameter" } */
+{
+ sink = parm; /* { dg-bogus "uninitialized" "parameter" } */
+}
+
+void f2(void)
+{
+ int x;
+ sink = x; /* { dg-warning "is used" "unconditional" } */
+}
+
+void f3(int p)
+{
+ int x; /* { dg-warning "may be used" "conditional" { xfail *-*-* } } */
+ if (p)
+ x = p;
+ sink = x;
+}
+
+void f4(int p)
+{
+ int x; /* { dg-bogus "uninitialized" "easy if" } */
+ if (p)
+ x = 1;
+ else
+ x = 2;
+ sink = x;
+}
+
+void f5(void)
+{
+ int x, i; /* { dg-bogus "uninitialized" "easy loop" } */
+ for (i = 0; i < 10; ++i)
+ x = 1;
+ sink = x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-11.c
new file mode 100644
index 000000000..2730534e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-11.c
@@ -0,0 +1,42 @@
+/* Positive test for uninitialized variables. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+int sink;
+
+void f1(int parm) /* { dg-bogus "uninitialized" "parameter" } */
+{
+ sink = parm; /* { dg-bogus "uninitialized" "parameter" } */
+}
+
+void f2(void)
+{
+ int x;
+ sink = x; /* { dg-warning "is used" "unconditional" } */
+}
+
+void f3(int p)
+{
+ int x;
+ if (p)
+ x = p;
+ sink = x; /* { dg-warning "may be used" "conditional" } */
+}
+
+void f4(int p)
+{
+ int x; /* { dg-bogus "uninitialized" "easy if" } */
+ if (p)
+ x = 1;
+ else
+ x = 2;
+ sink = x;
+}
+
+void f5(void)
+{
+ int x, i; /* { dg-bogus "uninitialized" "easy loop" } */
+ for (i = 0; i < 10; ++i)
+ x = 1;
+ sink = x;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-12-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-12-O0.c
new file mode 100644
index 000000000..7c0664e4d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-12-O0.c
@@ -0,0 +1,12 @@
+/* PR 23497 */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+typedef _Complex float C;
+C foo()
+{
+ C f;
+ __real__ f = 0;
+ __imag__ f = 0;
+ return f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-12.c
new file mode 100644
index 000000000..7889e5370
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-12.c
@@ -0,0 +1,12 @@
+/* PR 23497 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+typedef _Complex float C;
+C foo()
+{
+ C f;
+ __real__ f = 0;
+ __imag__ f = 0;
+ return f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-13-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-13-O0.c
new file mode 100644
index 000000000..af80fa88c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-13-O0.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+typedef _Complex float C;
+C foo()
+{
+ C f;
+ __imag__ f = 0; /* { dg-warning "is used" "unconditional" { xfail *-*-* } } */
+ return f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-13.c
new file mode 100644
index 000000000..631e8de3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-13.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+typedef _Complex float C;
+C foo()
+{
+ C f;
+ __imag__ f = 0; /* { dg-warning "is used" "unconditional" } */
+ return f;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-14-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-14-O0.c
new file mode 100644
index 000000000..abde6ca86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-14-O0.c
@@ -0,0 +1,20 @@
+/* PR 24931 */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+struct p {
+ short x, y;
+};
+
+struct s {
+ int i;
+ struct p p;
+};
+
+struct s f()
+{
+ struct s s;
+ s.p = (struct p){};
+ s.i = (s.p.x || s.p.y);
+ return s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-14.c
new file mode 100644
index 000000000..41b4f622a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-14.c
@@ -0,0 +1,20 @@
+/* PR 24931 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+struct p {
+ short x, y;
+};
+
+struct s {
+ int i;
+ struct p p;
+};
+
+struct s f()
+{
+ struct s s;
+ s.p = (struct p){};
+ s.i = (s.p.x || s.p.y);
+ return s;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-15-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-15-O0.c
new file mode 100644
index 000000000..a3fd2b63b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-15-O0.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+/* XFAIL for now, the uninitialized pass runs before inlining only at -O0. */
+
+inline int __attribute__((always_inline))
+foo (int i)
+{
+ if (i) return 1; /* { dg-warning "is used uninitialized" {} { xfail *-*-* } } */
+ return 0;
+}
+
+void baz();
+
+void bar()
+{
+ int j; /* { dg-message "was declared here" {} { xfail *-*-* } } */
+ for (; foo(j); ++j)
+ baz();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-15.c
new file mode 100644
index 000000000..20bea95ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-15.c
@@ -0,0 +1,26 @@
+/* PR tree-optimization/17506
+ We issue an uninitialized variable warning at a wrong location at
+ line 11, which is very confusing. Make sure we print out a note to
+ make it less confusing. (xfailed alternative)
+ But it is of course ok if we warn in bar about uninitialized use
+ of j. (not xfailed alternative) */
+/* { dg-do compile } */
+/* { dg-options "-O1 -Wuninitialized" } */
+
+inline int
+foo (int i)
+{
+ if (i) /* { dg-warning "used uninitialized in this function" "" { xfail *-*-* } } */
+ return 1;
+ return 0;
+}
+
+void baz (void);
+
+void
+bar (void)
+{
+ int j; /* { dg-message "note: 'j' was declared here" "" { xfail *-*-* } } */
+ for (; foo (j); ++j) /* { dg-warning "'j' is used uninitialized" } */
+ baz ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-16.c
new file mode 100644
index 000000000..e039f7026
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-16.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+int foo, bar;
+
+static
+void decode_reloc(int reloc, int *is_alt)
+{
+ if (reloc >= 20)
+ *is_alt = 1;
+ else if (reloc >= 10)
+ *is_alt = 0;
+}
+
+void testfunc()
+{
+ int alt_reloc;
+
+ decode_reloc(foo, &alt_reloc);
+
+ if (alt_reloc) /* { dg-warning "may be used uninitialized" } */
+ bar = 42;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-2-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-2-O0.c
new file mode 100644
index 000000000..62a23fa6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-2-O0.c
@@ -0,0 +1,52 @@
+/* Spurious uninitialized variable warnings, case 2.
+ Taken from cpphash.c (macroexpand) */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+struct definition
+{
+ int nargs;
+ int rest_args;
+};
+
+struct cpp_reader;
+
+enum cpp_token
+{
+ CPP_EOF, CPP_POP, CPP_COMMA, CPP_RPAREN
+};
+
+extern enum cpp_token macarg (struct cpp_reader *, int);
+
+void
+macroexpand (struct cpp_reader *pfile, struct definition *defn)
+{
+ int nargs = defn->nargs;
+
+ if (nargs >= 0)
+ {
+ enum cpp_token token; /* { dg-bogus "token" "uninitialized variable warning" } */
+ int i, rest_args;
+ i = 0;
+ rest_args = 0;
+ do
+ {
+ if (rest_args)
+ continue;
+ if (i < nargs || (nargs == 0 && i == 0))
+ {
+ /* if we are working on last arg which absorbs rest of args... */
+ if (i == nargs - 1 && defn->rest_args)
+ rest_args = 1;
+ token = macarg (pfile, rest_args);
+ }
+ else
+ token = macarg (pfile, 0);
+ if (token == CPP_EOF || token == CPP_POP)
+ return;
+
+ i++;
+ }
+ while (token == CPP_COMMA);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-2.c
new file mode 100644
index 000000000..352bbac06
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-2.c
@@ -0,0 +1,52 @@
+/* Spurious uninitialized variable warnings, case 2.
+ Taken from cpphash.c (macroexpand) */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+struct definition
+{
+ int nargs;
+ int rest_args;
+};
+
+struct cpp_reader;
+
+enum cpp_token
+{
+ CPP_EOF, CPP_POP, CPP_COMMA, CPP_RPAREN
+};
+
+extern enum cpp_token macarg (struct cpp_reader *, int);
+
+void
+macroexpand (struct cpp_reader *pfile, struct definition *defn)
+{
+ int nargs = defn->nargs;
+
+ if (nargs >= 0)
+ {
+ enum cpp_token token; /* { dg-bogus "token" "uninitialized variable warning" } */
+ int i, rest_args;
+ i = 0;
+ rest_args = 0;
+ do
+ {
+ if (rest_args)
+ continue;
+ if (i < nargs || (nargs == 0 && i == 0))
+ {
+ /* if we are working on last arg which absorbs rest of args... */
+ if (i == nargs - 1 && defn->rest_args)
+ rest_args = 1;
+ token = macarg (pfile, rest_args);
+ }
+ else
+ token = macarg (pfile, 0);
+ if (token == CPP_EOF || token == CPP_POP)
+ return;
+
+ i++;
+ }
+ while (token == CPP_COMMA);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-3-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-3-O0.c
new file mode 100644
index 000000000..d3dcf14ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-3-O0.c
@@ -0,0 +1,33 @@
+/* Spurious uninit variable warnings, case 3.
+ Inspired by cppexp.c (parse_charconst) */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+extern void error (char *);
+
+int
+parse_charconst (const char *start, const char *end)
+{
+ int c; /* { dg-bogus "c" "uninitialized variable warning" } */
+ int nchars, retval;
+
+ nchars = 0;
+ retval = 0;
+ while (start < end)
+ {
+ c = *start++;
+ if (c == '\'')
+ break;
+ nchars++;
+ retval += c;
+ retval <<= 8;
+ }
+
+ if (nchars == 0)
+ return 0;
+
+ if (c != '\'')
+ error ("malformed character constant");
+
+ return retval;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-3.c
new file mode 100644
index 000000000..ac5bfec8e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-3.c
@@ -0,0 +1,33 @@
+/* Spurious uninit variable warnings, case 3.
+ Inspired by cppexp.c (parse_charconst) */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+extern void error (char *);
+
+int
+parse_charconst (const char *start, const char *end)
+{
+ int c; /* { dg-bogus "c" "uninitialized variable warning" } */
+ int nchars, retval;
+
+ nchars = 0;
+ retval = 0;
+ while (start < end)
+ {
+ c = *start++;
+ if (c == '\'')
+ break;
+ nchars++;
+ retval += c;
+ retval <<= 8;
+ }
+
+ if (nchars == 0)
+ return 0;
+
+ if (c != '\'')
+ error ("malformed character constant");
+
+ return retval;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-4-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-4-O0.c
new file mode 100644
index 000000000..0b9aeea7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-4-O0.c
@@ -0,0 +1,52 @@
+/* Spurious uninit variable warnings, case 4.
+ Simplified version of cppexp.c (cpp_parse_expr).
+
+ This one is really fragile, it gets it right if you take out case
+ 1, or if the structure is replaced by an int, or if the structure
+ has fewer members (!) */
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+extern void abort (void);
+
+struct operation {
+ short op;
+ char rprio;
+ char flags;
+ char unsignedp;
+ long value;
+};
+
+extern struct operation cpp_lex (void);
+
+void
+cpp_parse_expr (void)
+{
+ int rprio; /* { dg-bogus "rprio" "uninitialized variable warning PR19833" } */
+ struct operation op;
+
+ for (;;)
+ {
+ op = cpp_lex ();
+
+ switch (op.op)
+ {
+ case 0:
+ break;
+ case 1:
+ return;
+ case 2:
+ rprio = 1;
+ break;
+ default:
+ return;
+ }
+
+ if (op.op == 0)
+ return;
+
+ if (rprio != 1)
+ abort();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-4.c
new file mode 100644
index 000000000..d39ecac77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-4.c
@@ -0,0 +1,52 @@
+/* Spurious uninit variable warnings, case 4.
+ Simplified version of cppexp.c (cpp_parse_expr).
+
+ This one is really fragile, it gets it right if you take out case
+ 1, or if the structure is replaced by an int, or if the structure
+ has fewer members (!) */
+
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+extern void abort (void);
+
+struct operation {
+ short op;
+ char rprio;
+ char flags;
+ char unsignedp;
+ long value;
+};
+
+extern struct operation cpp_lex (void);
+
+void
+cpp_parse_expr (void)
+{
+ int rprio; /* { dg-bogus "rprio" "uninitialized variable warning PR19833" } */
+ struct operation op;
+
+ for (;;)
+ {
+ op = cpp_lex ();
+
+ switch (op.op)
+ {
+ case 0:
+ break;
+ case 1:
+ return;
+ case 2:
+ rprio = 1;
+ break;
+ default:
+ return;
+ }
+
+ if (op.op == 0)
+ return;
+
+ if (rprio != 1)
+ abort();
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-5-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-5-O0.c
new file mode 100644
index 000000000..d9784b3f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-5-O0.c
@@ -0,0 +1,39 @@
+/* Spurious uninitialized-variable warnings. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+extern void use(int);
+extern void foo(void);
+
+void
+func1(int cond)
+{
+ int x; /* { dg-bogus "x" "uninitialized variable warning" } */
+
+ if(cond)
+ x = 1;
+
+ foo();
+
+ if(cond)
+ use(x);
+}
+
+void
+func2 (int cond)
+{
+ int x; /* { dg-bogus "x" "uninitialized variable warning" } */
+ int flag = 0;
+
+ if(cond)
+ {
+ x = 1;
+ flag = 1;
+ }
+
+ foo();
+
+ if(flag)
+ use(x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-5.c
new file mode 100644
index 000000000..df2a27c44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-5.c
@@ -0,0 +1,39 @@
+/* Spurious uninitialized-variable warnings. */
+/* Disable jump threading, etc to test compiler analysis. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized -fno-tree-dce -fno-tree-vrp -fno-tree-dominator-opts" } */
+
+extern void use(int);
+extern void foo(void);
+
+void
+func1(int cond)
+{
+ int x; /* { dg-bogus "x" "uninitialized variable warning" } */
+
+ if(cond)
+ x = 1;
+
+ foo();
+
+ if(cond)
+ use(x);
+}
+
+void
+func2 (int cond)
+{
+ int x; /* { dg-bogus "x" "uninitialized variable warning" } */
+ int flag = 0;
+
+ if(cond)
+ {
+ x = 1;
+ flag = 1;
+ }
+
+ foo();
+
+ if(flag)
+ use(x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-6-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-6-O0.c
new file mode 100644
index 000000000..fe9815efb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-6-O0.c
@@ -0,0 +1,47 @@
+/* Spurious uninitialized variable warnings.
+ This one inspired by java/class.c:build_utf8_ref. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -ftrack-macro-expansion=2" } */
+
+#include <stddef.h>
+
+struct tree
+{
+ struct tree *car;
+ struct tree *cdr;
+ int type, data;
+};
+
+extern void *malloc(size_t);
+
+#define INTEGER_T 1
+#define PTR_T 2
+
+#define APPEND(TREE, LAST, TYPE, VALUE) \
+do { \
+ struct tree *tmp = malloc (sizeof (struct tree)); \
+ tmp->car = 0; tmp->cdr = 0; tmp->type = TYPE; \
+ tmp->data = VALUE; \
+ if (TREE->car) \
+ LAST->cdr = tmp; /* { dg-bogus "field" "uninitialized variable warning" { xfail *-*-* } } */ \
+ else \
+ TREE->car = tmp; \
+ LAST = tmp; \
+} while(0)
+
+struct tree *
+make_something(int a, int b, int c)
+{
+ struct tree *rv;
+ struct tree *field;
+
+ rv = malloc (sizeof (struct tree));
+ rv->car = 0;
+
+ APPEND(rv, field, INTEGER_T, a);
+ APPEND(rv, field, PTR_T, b);
+ APPEND(rv, field, INTEGER_T, c);
+
+ return rv;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-6.c
new file mode 100644
index 000000000..009e124fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-6.c
@@ -0,0 +1,47 @@
+/* Spurious uninitialized variable warnings.
+ This one inspired by java/class.c:build_utf8_ref. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+#include <stddef.h>
+
+struct tree
+{
+ struct tree *car;
+ struct tree *cdr;
+ int type, data;
+};
+
+extern void *malloc(size_t);
+
+#define INTEGER_T 1
+#define PTR_T 2
+
+#define APPEND(TREE, LAST, TYPE, VALUE) \
+do { \
+ struct tree *tmp = malloc (sizeof (struct tree)); \
+ tmp->car = 0; tmp->cdr = 0; tmp->type = TYPE; \
+ tmp->data = VALUE; \
+ if (TREE->car) \
+ LAST->cdr = tmp; \
+ else \
+ TREE->car = tmp; \
+ LAST = tmp; \
+} while(0)
+
+struct tree *
+make_something(int a, int b, int c)
+{
+ struct tree *rv;
+ struct tree *field;
+
+ rv = malloc (sizeof (struct tree));
+ rv->car = 0;
+
+ APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" } */
+ APPEND(rv, field, PTR_T, b);
+ APPEND(rv, field, INTEGER_T, c);
+
+ return rv;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-8-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-8-O0.c
new file mode 100644
index 000000000..b386896c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-8-O0.c
@@ -0,0 +1,32 @@
+/* Uninitialized variable warning tests...
+ Inspired by part of optabs.c:expand_binop.
+ May be the same as uninit-1.c. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+#include <limits.h>
+
+void
+add_bignums (int *out, int *x, int *y)
+{
+ int p, sum;
+ int carry; /* { dg-bogus "carry" "uninitialized variable warning" } */
+
+ p = 0;
+ for (; *x; x++, y++, out++, p++)
+ {
+ if (p)
+ sum = *x + *y + carry;
+ else
+ sum = *x + *y;
+
+ if (sum < 0)
+ {
+ carry = 1;
+ sum -= INT_MAX;
+ }
+ else
+ carry = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-8.c
new file mode 100644
index 000000000..98700f4aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-8.c
@@ -0,0 +1,32 @@
+/* Uninitialized variable warning tests...
+ Inspired by part of optabs.c:expand_binop.
+ May be the same as uninit-1.c. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+#include <limits.h>
+
+void
+add_bignums (int *out, int *x, int *y)
+{
+ int p, sum;
+ int carry; /* { dg-bogus "carry" "uninitialized variable warning" } */
+
+ p = 0;
+ for (; *x; x++, y++, out++, p++)
+ {
+ if (p)
+ sum = *x + *y + carry;
+ else
+ sum = *x + *y;
+
+ if (sum < 0)
+ {
+ carry = 1;
+ sum -= INT_MAX;
+ }
+ else
+ carry = 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-9-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-9-O0.c
new file mode 100644
index 000000000..493dd68d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-9-O0.c
@@ -0,0 +1,41 @@
+/* Spurious uninitialized variable warnings. Slight variant on the
+ documented case, inspired by reg-stack.c:record_asm_reg_life. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+struct foo
+{
+ int type;
+ struct foo *car;
+ struct foo *cdr;
+ char *data;
+ int data2;
+};
+
+extern void use(struct foo *);
+
+#define CLOBBER 6
+#define PARALLEL 3
+
+void
+func(struct foo *list, int count)
+{
+ int n_clobbers = 0;
+ int i;
+ struct foo **clob_list; /* { dg-bogus "clob_list" "uninitialized variable warning" } */
+
+ if(list[0].type == PARALLEL)
+ {
+ clob_list = __builtin_alloca(count * sizeof(struct foo *));
+
+ for(i = 1; i < count; i++)
+ {
+ if(list[i].type == CLOBBER)
+ clob_list[n_clobbers++] = &list[i];
+ }
+ }
+
+ for(i = 0; i < n_clobbers; i++)
+ use(clob_list[i]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-9.c
new file mode 100644
index 000000000..2a8ccb69f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-9.c
@@ -0,0 +1,41 @@
+/* Spurious uninitialized variable warnings. Slight variant on the
+ documented case, inspired by reg-stack.c:record_asm_reg_life. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+struct foo
+{
+ int type;
+ struct foo *car;
+ struct foo *cdr;
+ char *data;
+ int data2;
+};
+
+extern void use(struct foo *);
+
+#define CLOBBER 6
+#define PARALLEL 3
+
+void
+func(struct foo *list, int count)
+{
+ int n_clobbers = 0;
+ int i;
+ struct foo **clob_list; /* { dg-bogus "clob_list" "uninitialized variable warning" } */
+
+ if(list[0].type == PARALLEL)
+ {
+ clob_list = __builtin_alloca(count * sizeof(struct foo *));
+
+ for(i = 1; i < count; i++)
+ {
+ if(list[i].type == CLOBBER)
+ clob_list[n_clobbers++] = &list[i];
+ }
+ }
+
+ for(i = 0; i < n_clobbers; i++)
+ use(clob_list[i]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-A-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-A-O0.c
new file mode 100644
index 000000000..693769115
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-A-O0.c
@@ -0,0 +1,117 @@
+/* Inspired by part of java/parse.y.
+ May be a real bug in CSE. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+struct tree
+{
+ struct tree *car, *cdr, *wfl;
+ int code;
+ struct { unsigned int renp:1;
+ unsigned int rtnp:1;
+ unsigned int rpnp:1; } flags;
+};
+typedef struct tree *tree;
+#define NULL_TREE ((tree)0)
+
+/* Codes */
+enum
+{
+ CALL_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, CONVERT_EXPR,
+ ARRAY_REF, CONDITIONAL_EXPR, STRING_CST, EXPR_WITH_FILE_LOCATION
+};
+
+/* Flags */
+#define RESOLVE_EXPRESSION_NAME_P(t) ((t)->flags.renp)
+#define RESOLVE_TYPE_NAME_P(t) ((t)->flags.rtnp)
+#define RESOLVE_PACKAGE_NAME_P(t) ((t)->flags.rpnp)
+
+/* Macros */
+#define EXPR_WFL_QUALIFICATION(t) ((t)->wfl)
+#define QUAL_WFL(t) ((t)->wfl)
+#define EXPR_WFL_NODE(t) ((t)->wfl)
+#define TREE_CODE(t) ((t)->code)
+#define TREE_OPERAND(t,x) ((t)->car)
+#define CLASSTYPE_SUPER(t) ((t)->car)
+#define IDENTIFIER_LOCAL_VALUE(t) ((t)->car)
+#define TREE_CHAIN(t) ((t)->cdr)
+#define QUAL_RESOLUTION(t) ((t)->cdr)
+
+extern tree current_class, this_identifier_node;
+extern tree super_identifier_node, length_identifier_node;
+
+tree resolve_and_layout (tree, tree);
+tree lookup_field_wrapper (tree, tree);
+
+void
+qualify_ambiguous_name (id)
+ tree id;
+{
+ tree qual, qual_wfl, decl;
+ tree name; /* { dg-bogus "name" "uninitialized variable warning" } */
+ tree ptr_type; /* { dg-bogus "ptr_type" "uninitialized variable warning" } */
+ int again, new_array_found = 0;
+ int super_found = 0, this_found = 0;
+
+ qual = EXPR_WFL_QUALIFICATION (id);
+ do {
+ qual_wfl = QUAL_WFL (qual);
+ switch (TREE_CODE (qual_wfl))
+ {
+ case CALL_EXPR:
+ qual_wfl = TREE_OPERAND (qual_wfl, 0);
+ if (TREE_CODE (qual_wfl) != EXPR_WITH_FILE_LOCATION)
+ {
+ qual = EXPR_WFL_QUALIFICATION (qual_wfl);
+ qual_wfl = QUAL_WFL (qual);
+ }
+ break;
+ case NEW_ARRAY_EXPR:
+ qual = TREE_CHAIN (qual);
+ new_array_found = again = 1;
+ continue;
+ case NEW_CLASS_EXPR:
+ case CONVERT_EXPR:
+ qual_wfl = TREE_OPERAND (qual_wfl, 0);
+ break;
+ case ARRAY_REF:
+ while (TREE_CODE (qual_wfl) == ARRAY_REF)
+ qual_wfl = TREE_OPERAND (qual_wfl, 0);
+ break;
+ default:
+ break;
+ }
+
+ name = EXPR_WFL_NODE (qual_wfl);
+ ptr_type = current_class;
+ again = 0;
+
+ } while (again);
+
+ /* If you put straightforward uses of name and ptr_type here
+ instead of the if-else sequence below, the warnings go away.
+ Therefore I suspect a real bug. */
+
+ if (!this_found && !super_found && (decl = IDENTIFIER_LOCAL_VALUE (name)))
+ {
+ RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
+ QUAL_RESOLUTION (qual) = decl;
+ }
+ else if ((decl = lookup_field_wrapper (ptr_type, name))
+ || (new_array_found && name == length_identifier_node))
+ {
+ RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
+ QUAL_RESOLUTION (qual) = (new_array_found ? NULL_TREE : decl);
+ }
+ else if ((decl = resolve_and_layout (name, NULL_TREE)))
+ {
+ RESOLVE_TYPE_NAME_P (qual_wfl) = 1;
+ QUAL_RESOLUTION (qual) = decl;
+ }
+ else if (TREE_CODE (QUAL_WFL (qual)) == CALL_EXPR
+ || TREE_CODE (QUAL_WFL (qual)) == ARRAY_REF)
+ RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
+ else
+ RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-A.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-A.c
new file mode 100644
index 000000000..28f7fe9fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-A.c
@@ -0,0 +1,117 @@
+/* Inspired by part of java/parse.y.
+ May be a real bug in CSE. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+struct tree
+{
+ struct tree *car, *cdr, *wfl;
+ int code;
+ struct { unsigned int renp:1;
+ unsigned int rtnp:1;
+ unsigned int rpnp:1; } flags;
+};
+typedef struct tree *tree;
+#define NULL_TREE ((tree)0)
+
+/* Codes */
+enum
+{
+ CALL_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, CONVERT_EXPR,
+ ARRAY_REF, CONDITIONAL_EXPR, STRING_CST, EXPR_WITH_FILE_LOCATION
+};
+
+/* Flags */
+#define RESOLVE_EXPRESSION_NAME_P(t) ((t)->flags.renp)
+#define RESOLVE_TYPE_NAME_P(t) ((t)->flags.rtnp)
+#define RESOLVE_PACKAGE_NAME_P(t) ((t)->flags.rpnp)
+
+/* Macros */
+#define EXPR_WFL_QUALIFICATION(t) ((t)->wfl)
+#define QUAL_WFL(t) ((t)->wfl)
+#define EXPR_WFL_NODE(t) ((t)->wfl)
+#define TREE_CODE(t) ((t)->code)
+#define TREE_OPERAND(t,x) ((t)->car)
+#define CLASSTYPE_SUPER(t) ((t)->car)
+#define IDENTIFIER_LOCAL_VALUE(t) ((t)->car)
+#define TREE_CHAIN(t) ((t)->cdr)
+#define QUAL_RESOLUTION(t) ((t)->cdr)
+
+extern tree current_class, this_identifier_node;
+extern tree super_identifier_node, length_identifier_node;
+
+tree resolve_and_layout (tree, tree);
+tree lookup_field_wrapper (tree, tree);
+
+void
+qualify_ambiguous_name (id)
+ tree id;
+{
+ tree qual, qual_wfl, decl;
+ tree name; /* { dg-bogus "name" "uninitialized variable warning" } */
+ tree ptr_type; /* { dg-bogus "ptr_type" "uninitialized variable warning" } */
+ int again, new_array_found = 0;
+ int super_found = 0, this_found = 0;
+
+ qual = EXPR_WFL_QUALIFICATION (id);
+ do {
+ qual_wfl = QUAL_WFL (qual);
+ switch (TREE_CODE (qual_wfl))
+ {
+ case CALL_EXPR:
+ qual_wfl = TREE_OPERAND (qual_wfl, 0);
+ if (TREE_CODE (qual_wfl) != EXPR_WITH_FILE_LOCATION)
+ {
+ qual = EXPR_WFL_QUALIFICATION (qual_wfl);
+ qual_wfl = QUAL_WFL (qual);
+ }
+ break;
+ case NEW_ARRAY_EXPR:
+ qual = TREE_CHAIN (qual);
+ new_array_found = again = 1;
+ continue;
+ case NEW_CLASS_EXPR:
+ case CONVERT_EXPR:
+ qual_wfl = TREE_OPERAND (qual_wfl, 0);
+ break;
+ case ARRAY_REF:
+ while (TREE_CODE (qual_wfl) == ARRAY_REF)
+ qual_wfl = TREE_OPERAND (qual_wfl, 0);
+ break;
+ default:
+ break;
+ }
+
+ name = EXPR_WFL_NODE (qual_wfl);
+ ptr_type = current_class;
+ again = 0;
+
+ } while (again);
+
+ /* If you put straightforward uses of name and ptr_type here
+ instead of the if-else sequence below, the warnings go away.
+ Therefore I suspect a real bug. */
+
+ if (!this_found && !super_found && (decl = IDENTIFIER_LOCAL_VALUE (name)))
+ {
+ RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
+ QUAL_RESOLUTION (qual) = decl;
+ }
+ else if ((decl = lookup_field_wrapper (ptr_type, name))
+ || (new_array_found && name == length_identifier_node))
+ {
+ RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
+ QUAL_RESOLUTION (qual) = (new_array_found ? NULL_TREE : decl);
+ }
+ else if ((decl = resolve_and_layout (name, NULL_TREE)))
+ {
+ RESOLVE_TYPE_NAME_P (qual_wfl) = 1;
+ QUAL_RESOLUTION (qual) = decl;
+ }
+ else if (TREE_CODE (QUAL_WFL (qual)) == CALL_EXPR
+ || TREE_CODE (QUAL_WFL (qual)) == ARRAY_REF)
+ RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
+ else
+ RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-2.c
new file mode 100644
index 000000000..ee8a88581
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-2.c
@@ -0,0 +1,16 @@
+/* Origin: PR c/179 inverse of uninit-B-O0.c, we should not warn. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+extern void foo (int *);
+extern void bar (int);
+
+void
+baz (void)
+{
+ int i;
+ foo (&i); /* { dg-bogus "is used uninitialized" "uninit i warning" } */
+ if (i)
+ bar (i);
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-O0-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-O0-2.c
new file mode 100644
index 000000000..dfa3de97e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-O0-2.c
@@ -0,0 +1,16 @@
+/* Origin: PR c/179 inverse of uninit-B-O0.c, we should not warn. */
+/* { dg-do compile } */
+/* { dg-options "-O0 -Wuninitialized" } */
+extern void foo (int *);
+extern void bar (int);
+
+void
+baz (void)
+{
+ int i;
+ foo (&i); /* { dg-bogus "is used uninitialized" "uninit i warning" } */
+ if (i)
+ bar (i);
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-O0.c
new file mode 100644
index 000000000..e2883a38e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B-O0.c
@@ -0,0 +1,15 @@
+/* Origin: PR c/179 from Gray Watson <gray@256.com>, adapted as a testcase
+ by Joseph Myers <jsm28@cam.ac.uk>. */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+extern void foo (int *);
+extern void bar (int);
+
+void
+baz (void)
+{
+ int i;
+ if (i) /* { dg-warning "uninit" "uninit i warning" { xfail *-*-* } } */
+ bar (i);
+ foo (&i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B.c
new file mode 100644
index 000000000..adb1461d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-B.c
@@ -0,0 +1,15 @@
+/* Origin: PR c/179 from Gray Watson <gray@256.com>, adapted as a testcase
+ by Joseph Myers <jsm28@cam.ac.uk>. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+extern void foo (int *);
+extern void bar (int);
+
+void
+baz (void)
+{
+ int i;
+ if (i) /* { dg-warning "is used uninitialized" "uninit i warning" } */
+ bar (i);
+ foo (&i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-C-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-C-O0.c
new file mode 100644
index 000000000..02339d43d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-C-O0.c
@@ -0,0 +1,21 @@
+/* Spurious uninitialized variable warning, inspired by libgcc2.c. */
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+/* Not all platforms support TImode integers. */
+#if (defined(__LP64__) && !defined(__hppa__)) || defined(__SPU__)
+typedef int TItype __attribute__ ((mode (TI)));
+#else
+typedef long TItype;
+#endif
+
+
+TItype
+__subvdi3 (TItype a, TItype b)
+{
+ TItype w;
+
+ w = a - b;
+
+ return w;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-C.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-C.c
new file mode 100644
index 000000000..a22f0d78d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-C.c
@@ -0,0 +1,21 @@
+/* Spurious uninitialized variable warning, inspired by libgcc2.c. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+/* Not all platforms support TImode integers. */
+#if (defined(__LP64__) && !defined(__hppa__)) || defined(__SPU__)
+typedef int TItype __attribute__ ((mode (TI)));
+#else
+typedef long TItype;
+#endif
+
+
+TItype
+__subvdi3 (TItype a, TItype b)
+{
+ TItype w;
+
+ w = a - b;
+
+ return w;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-H-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-H-O0.c
new file mode 100644
index 000000000..97221462c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-H-O0.c
@@ -0,0 +1,33 @@
+/* PR 14204 */
+/* { dg-do compile } */
+/* { dg-options "-Wall -Werror" } */
+
+#if defined __alpha__
+# define ASM __asm__("$30")
+#elif defined __i386__
+# define ASM __asm__("esp")
+#elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) || defined (_POWER)
+# define ASM __asm__("r1")
+#elif defined __s390__
+# define ASM __asm__("r15")
+#elif defined __mips
+# define ASM __asm__("$sp")
+#elif defined __sparc__
+# define ASM __asm__("sp")
+#elif defined __ia64__
+# define ASM __asm__("r12")
+#elif defined __hppa__
+# define ASM __asm__("%r30")
+#elif defined __xtensa__
+# define ASM __asm__("sp")
+#else
+/* The register name should be target-dependent so for other targets,
+ we just silence the test. */
+# define ASM = 0
+#endif
+
+void *load_PCB (void)
+{
+ register void *sp ASM;
+ return sp; /* { dg-bogus "uninitialized" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-H.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-H.c
new file mode 100644
index 000000000..b93bf8daa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-H.c
@@ -0,0 +1,33 @@
+/* PR 14204 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wall -Werror" } */
+
+#if defined __alpha__
+# define ASM __asm__("$30")
+#elif defined __i386__
+# define ASM __asm__("esp")
+#elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) || defined (_POWER)
+# define ASM __asm__("r1")
+#elif defined __s390__
+# define ASM __asm__("r15")
+#elif defined __mips
+# define ASM __asm__("$sp")
+#elif defined __sparc__
+# define ASM __asm__("sp")
+#elif defined __ia64__
+# define ASM __asm__("r12")
+#elif defined __hppa__
+# define ASM __asm__("%r30")
+#elif defined __xtensa__
+# define ASM __asm__("sp")
+#else
+/* The register name should be target-dependent so for other targets,
+ we just silence the test. */
+# define ASM = 0
+#endif
+
+void *load_PCB (void)
+{
+ register void *sp ASM;
+ return sp; /* { dg-bogus "uninitialized" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-I-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-I-O0.c
new file mode 100644
index 000000000..655f54892
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-I-O0.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized" } */
+
+int sys_msgctl (void)
+{
+ struct { int mode; } setbuf; /* { dg-warning "'setbuf\.mode' is used" {} { xfail *-*-* } } */
+ return setbuf.mode;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-I.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-I.c
new file mode 100644
index 000000000..3f80d961c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-I.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+int sys_msgctl (void)
+{
+ struct { int mode; } setbuf;
+ return setbuf.mode; /* { dg-warning "'setbuf\.mode' is used" "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430-2.c
new file mode 100644
index 000000000..361a6a0bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+
+int *p, *q;
+
+int foo (int b)
+{
+ int i, j = 0;
+ int *x;
+ p = &i;
+ q = &j;
+ if (b)
+ x = p;
+ else
+ x = q;
+ return *x;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c
new file mode 100644
index 000000000..4ce258653
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -Wuninitialized" } */
+extern int bar (int);
+extern void baz (int *);
+
+int
+foo (int i)
+{
+ int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } 9 } */
+
+ if (bar (i)) {
+ baz (&j);
+ } else {
+ }
+
+ return j;
+}
+
+
+int foo2( void ) {
+ int rc; /* { dg-warning "'rc' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 21 } */
+ return rc;
+ *&rc = 0;
+}
+
+extern int printf(const char *, ...);
+void frob(int *pi);
+
+int main(void)
+{
+ int i;
+ printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 32 } */
+ frob(&i);
+
+ return 0;
+}
+
+void foo3(int*);
+void bar3(void) {
+ int x;
+ if(x) /* { dg-warning "'x' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 41 } */
+ foo3(&x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430.c
new file mode 100644
index 000000000..361293148
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr19430.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+extern int bar (int);
+extern void baz (int *);
+int
+foo (int i)
+{
+ int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } 8 } */
+
+ if (bar (i)) {
+ baz (&j);
+ } else {
+ }
+
+ return j;
+}
+
+
+
+int foo2( void ) {
+ int rc;
+ return rc; /* { dg-warning "'rc' is used uninitialized in this function" } */
+ *&rc = 0;
+}
+
+extern int printf(const char *, ...);
+void frob(int *pi);
+
+int main(void)
+{
+ int i;
+ printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" "" } */
+ frob(&i);
+
+ return 0;
+}
+
+void foo3(int*);
+void bar3(void) {
+ int x;
+ if(x) /* { dg-warning "'x' is used uninitialized in this function" "uninitialized" } */
+ foo3(&x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c
new file mode 100644
index 000000000..092d41164
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr20644-O0.c
@@ -0,0 +1,24 @@
+/* PR 20644 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -Wuninitialized" } */
+int foo ()
+{
+ int i = 0;
+ int j;
+
+ if (1 == i)
+ return j; /* { dg-bogus "uninitialized" "uninitialized" { xfail *-*-* } 10 } */
+
+ return 0;
+}
+
+int bar ()
+{
+ int i = 1;
+ int j;
+
+ if (1 == i)
+ return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 21 } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr20644.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr20644.c
new file mode 100644
index 000000000..e13910bec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr20644.c
@@ -0,0 +1,24 @@
+/* PR 20644 */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized" } */
+int foo ()
+{
+ int i = 0;
+ int j;
+
+ if (1 == i)
+ return j;
+
+ return 0;
+}
+
+int bar ()
+{
+ int i = 1;
+ int j;
+
+ if (1 == i)
+ return j; /* { dg-warning "uninitialized" "uninitialized" { target *-*-* } 18 } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr40943.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr40943.c
new file mode 100644
index 000000000..2b6e9131c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pr40943.c
@@ -0,0 +1,10 @@
+/* PR middle-end/40943 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+void
+foo (void)
+{
+ int *p;
+ *p = 3; /* { dg-warning "is used uninitialized" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_a.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_a.c
new file mode 100644
index 000000000..5edf21d30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_a.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar (void);
+void blah (int);
+
+int foo (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = 1;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ if (flag)
+ blah(v); /* { dg-bogus "uninitialized" "bogus uninitialized var warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_b.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_b.c
new file mode 100644
index 000000000..ac7697e3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_b.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar (void);
+void blah (int);
+
+int foo (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = 1;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ /* Wrong guard */
+ if (!flag)
+ blah(v); /* { dg-warning "uninitialized" "real uninitialized var warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_c.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_c.c
new file mode 100644
index 000000000..bf094d127
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-2_c.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2 -fno-tree-tail-merge" } */
+
+int g;
+void bar (void);
+void blah (int);
+
+int foo (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = 1;
+ }
+
+ if (m) g++;
+ else bar();
+
+ if (flag)
+ blah(v); /* { dg-bogus "uninitialized" "bogus uninitialized var warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = 1;
+ }
+
+ if (m) g++;
+ else bar();
+
+ if (flag)
+ blah(v); /* { dg-bogus "uninitialized" "bogus uninitialized var warning" } */
+ else
+ blah(v); /* { dg-warning "uninitialized" "real uninitialized var warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_a.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_a.c
new file mode 100644
index 000000000..0ef0650ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_a.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = 1;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ if (r > 0)
+ if (flag)
+ blah(v); /* {dg-bogus "uninitialized" "bogus warning" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_b.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_b.c
new file mode 100644
index 000000000..978210d50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_b.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = 1;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ if (r > 0)
+ goto use;
+ if (flag)
+ {
+use:
+ blah(v); /* { dg-warning "uninitialized" "real warning" } */
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_c.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_c.c
new file mode 100644
index 000000000..130979078
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_c.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = -1;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ if (r > 0)
+ if (flag < 0)
+ blah(v); /* {dg-bogus "uninitialized" "bogus warning" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_d.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_d.c
new file mode 100644
index 000000000..9f938763c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_d.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = -1;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ if (r > 0)
+ if (flag == -1)
+ blah(v); /* {dg-bogus "uninitialized" "bogus warning" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_e.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_e.c
new file mode 100644
index 000000000..66e2a3a93
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-3_e.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int m, int r)
+{
+ int flag = 0;
+ int v;
+
+ if (n)
+ {
+ v = r;
+ flag = -1;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ if (r > 0)
+ if (flag <= 0 )
+ blah(v); /* { dg-warning "uninitialized" "real warning" } */
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-4_a.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-4_a.c
new file mode 100644
index 000000000..7b2d291a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-4_a.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+int foo (int n, int m, int r, int t)
+{
+ int flag = 0;
+ int v;
+
+ if (t)
+ {
+ if (n)
+ {
+ v = r; /* init path 1 */
+ flag = 1;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ if (flag) /* properly guarded */
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+ }
+ else
+ {
+ v = r+1; /* init path 2 */
+ flag = 2;
+ }
+
+ if (m)
+ g++;
+ else
+ bar();
+
+ if (flag) /* properly guarded */
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-4_b.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-4_b.c
new file mode 100644
index 000000000..376639588
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-4_b.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+int foo (int n, int m, int r, int t)
+{
+ int flag = 0;
+ int v;
+
+ if (t)
+ {
+ if (n)
+ {
+ v = r; /* init path 1 */
+ flag = 1;
+ }
+
+ if (m) g++;
+ else bar();
+
+ if (flag) /* properly guarded */
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+ }
+ else
+ {
+ v = r+1; /* init path 2 */
+ flag = 2;
+ }
+
+ if (m) g++;
+ else bar();
+
+ if (g) /* guard can not be determined statically to be safe */
+ blah(v); /* { dg-warning "uninitialized" "real warning" } */
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-5_a.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-5_a.c
new file mode 100644
index 000000000..5ced8971c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-5_a.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -Wno-attributes -O2" } */
+
+int g;
+int bar();
+int blah(int);
+void t(int);
+
+static int
+__attribute__((always_inline))
+foo (int n, int* v, int r)
+{
+ int flag = 0;
+ if (r > n)
+ {
+ *v = bar();
+ flag = 1;
+ }
+
+ if (n > g)
+ g++;
+ else
+ bar();
+
+ return flag;
+}
+
+int a[100];
+int b[100];
+int blah(int n)
+{
+ int i;
+ for (i = 0 ; i < n; i++)
+ {
+ int v;
+ if (!foo (n, &v, b[i]))
+ return 0;
+ t (v); /* { dg-bogus "uninitialized" "bogus warning" } */
+ }
+ return 1;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-5_b.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-5_b.c
new file mode 100644
index 000000000..e8da25656
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-5_b.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -Wno-attributes -O2" } */
+
+int g;
+int bar();
+int blah(int);
+void t(int);
+
+static int
+__attribute__((always_inline))
+foo (int n, int* v, int r)
+{
+ int flag = 0;
+ if (r > n)
+ {
+ *v = bar();
+ flag = 1;
+ }
+
+ if (n > g)
+ g++;
+ else
+ bar();
+
+ return flag;
+}
+
+int a[100];
+int b[100];
+int blah(int n)
+{
+ int i;
+ for (i = 0 ; i < n; i++)
+ {
+ int v;
+ if (foo (n, &v, b[i]))
+ return 0;
+ t (v); /* { dg-warning "uninitialized" "real warning" } */
+ }
+ return 1;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_a.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_a.c
new file mode 100644
index 000000000..aa44f7616
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_a.c
@@ -0,0 +1,40 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n && l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n && l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n && l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if (n)
+ blah (v); /* { dg-warning "uninitialized" "warning" } */
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_b.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_b.c
new file mode 100644
index 000000000..dcc9a14a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_b.c
@@ -0,0 +1,46 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n)
+ if (l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n && l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if (l)
+ if (n)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n)
+ if (l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if (n || l)
+ blah (v); /* { dg-warning "uninitialized" "warning" } */
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_c.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_c.c
new file mode 100644
index 000000000..f60868dad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_c.c
@@ -0,0 +1,46 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n > 10)
+ if (l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( (n > 10) && l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if (l)
+ if (n > 12)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n > 10)
+ if (l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if (n > 8 )
+ if (l)
+ blah (v); /* { dg-warning "uninitialized" "warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_d.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_d.c
new file mode 100644
index 000000000..704c3e6e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_d.c
@@ -0,0 +1,24 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n && l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_e.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_e.c
new file mode 100644
index 000000000..21f429daf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-6_e.c
@@ -0,0 +1,43 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n > 10)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( (n > 10) && (l < 100))
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n > 100 )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n > 10)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n < 10)
+ blah (v); /* { dg-warning "uninitialized" "warning" } */
+
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_a.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_a.c
new file mode 100644
index 000000000..c2ba2a424
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_a.c
@@ -0,0 +1,54 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n || l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n && l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( l )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n || l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n && l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if (m || l)
+ blah (v); /* { dg-warning "uninitialized" "warning" } */
+
+ if ( l )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_b.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_b.c
new file mode 100644
index 000000000..338d18c95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_b.c
@@ -0,0 +1,23 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n > 10)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if (( n > 10) || (l != 100))
+ blah (v); /* { dg-warning "uninitialized" "warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_c.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_c.c
new file mode 100644
index 000000000..1bbe5014d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_c.c
@@ -0,0 +1,33 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if (n )
+ {
+ if (l)
+ g++;
+ else
+ goto l;
+ }
+ else
+ {
+l:
+ blah (v); /* { dg-warning "uninitialized" "warning" } */
+ }
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_d.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_d.c
new file mode 100644
index 000000000..06111731a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-7_d.c
@@ -0,0 +1,54 @@
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-Wuninitialized -O2 -mbranch-cost=0" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n || l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n && l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( l )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n || l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n && l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if (m || l)
+ blah (v); /* { dg-warning "uninitialized" "warning" } */
+
+ if ( l )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_a.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_a.c
new file mode 100644
index 000000000..1b7c47242
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_a.c
@@ -0,0 +1,45 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n || m || r || l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n || m || r || l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( l )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n || m || r )
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n || m || r || l)
+ blah(v); /* { dg-warning "uninitialized" "warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_b.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_b.c
new file mode 100644
index 000000000..c1cc1f0a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_b.c
@@ -0,0 +1,45 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -fno-tree-dominator-opts -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n < 10 || m > 100 || r < 20 || l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n < 10 || m > 100 || r < 20 )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n < 10 || m > 100 || r < 10 )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n < 10 || m > 100 || r < 20 || l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n < 10 || m > 100 || r < 20 )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n < 10 || m > 100 || r < 30 )
+ blah(v); /* { dg-warning "uninitialized" "warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_c.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_c.c
new file mode 100644
index 000000000..39d1bcd93
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_c.c
@@ -0,0 +1,39 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n < 10 && m > 100 && r < 20 )
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n <= 8 && m > 101 && r < 19 )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n < 10 && m > 100 && r < 20 )
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n <= 8 && m > 99 && r < 19 )
+ blah(v); /* { dg-warning "uninitialized" "warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_d.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_d.c
new file mode 100644
index 000000000..ccdea2967
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-8_d.c
@@ -0,0 +1,45 @@
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-Wuninitialized -O2 -mbranch-cost=0" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n || m || r || l)
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n || m || r || l)
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( n )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( l )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if (n || m || r )
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( n || m || r || l)
+ blah(v); /* { dg-warning "uninitialized" "warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-9_a.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-9_a.c
new file mode 100644
index 000000000..67fb8ab97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-9_a.c
@@ -0,0 +1,23 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if ( (n < 10) && (m == l) && (r < 20) )
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if ( (n <= 8) && (m == l) && (r < 19) )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-9_b.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-9_b.c
new file mode 100644
index 000000000..d9ae75e07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-pred-9_b.c
@@ -0,0 +1,44 @@
+
+/* { dg-do compile } */
+/* { dg-options "-Wuninitialized -O2" } */
+
+int g;
+void bar();
+void blah(int);
+
+int foo (int n, int l, int m, int r)
+{
+ int v;
+
+ if ( (n < 10) && (m != 100) && (r < 20) )
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if (l > 100)
+ if ( (n <= 9) && (m < 100) && (r < 19) )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ if ( (n <= 8) && (m < 99) && (r < 19) )
+ blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
+
+ return 0;
+}
+
+int foo_2 (int n, int l, int m, int r)
+{
+ int v;
+
+ if ( (n < 10) && (m != 100) && (r < 20) )
+ v = r;
+
+ if (m) g++;
+ else bar();
+
+ if (l > 100)
+ if ( (n <= 8) && (m < 101) && (r < 19) )
+ blah(v); /* { dg-warning "uninitialized" "real warning" } */
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-suppress.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-suppress.c
new file mode 100644
index 000000000..be3b4c1ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-suppress.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-ccp -fno-tree-vrp -O2 -Wuninitialized -Wno-maybe-uninitialized" } */
+void blah();
+int gflag;
+
+void foo()
+{
+ int v;
+ if (gflag)
+ v = 10;
+
+ blah(); /* *gflag may be killed, but compiler won't know */
+
+ if (gflag)
+ bar(v); /* { dg-bogus "uninitialized" "should be suppressed" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/uninit-suppress_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-suppress_2.c
new file mode 100644
index 000000000..e14973473
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/uninit-suppress_2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-ccp -fno-tree-vrp -O2 -Wuninitialized -Werror=uninitialized -Wno-error=maybe-uninitialized" } */
+void blah();
+int gflag;
+
+void foo()
+{
+ int v;
+ if (gflag)
+ v = 10;
+
+ blah(); /* *gflag may be killed, but compiler won't know */
+
+ if (gflag)
+ bar(v); /* { dg-warning "uninitialized" "should not be promoted to error" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-1.c
new file mode 100644
index 000000000..0dd2df9b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-1.c
@@ -0,0 +1,22 @@
+/* PR target/15783 */
+/* Origin: Paul Pluzhnikov <ppluzhnikov@charter.net> */
+
+/* This used to ICE on SPARC 64-bit because the back-end was
+ returning an invalid construct for the return value of fu2. */
+
+/* { dg-do compile } */
+
+union u2 {
+ struct
+ {
+ int u2s_a, u2s_b, u2s_c, u2s_d, u2s_e;
+ } u2_s;
+ double u2_d;
+} u2a;
+
+union u2 fu2();
+
+void unions()
+{
+ u2a = fu2();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-2.c
new file mode 100644
index 000000000..edc8a7abf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-2.c
@@ -0,0 +1,28 @@
+/* This used to segfault on SPARC 64-bit at runtime because
+ the stack pointer was clobbered by the function call. */
+
+/* { dg-do run } */
+
+#include <stdarg.h>
+
+union U
+{
+ long l1[2];
+};
+
+union U u;
+
+void foo (int z, ...)
+{
+ int i;
+ va_list ap;
+ va_start(ap,z);
+ i = va_arg(ap, int);
+ va_end(ap);
+}
+
+int main(void)
+{
+ foo (1, 1, 1, 1, 1, u);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-3.c
new file mode 100644
index 000000000..3e89b755a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-3.c
@@ -0,0 +1,10 @@
+/* PR target/27421 */
+/* { dg-do compile } */
+
+union A
+{
+ int i;
+ void x[1]; /* { dg-error "array of voids" } */
+};
+
+void foo(union A a) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-4.c
new file mode 100644
index 000000000..df9f36da0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-4.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-rtl-cse1" } */
+
+extern void abort(void);
+
+typedef unsigned int uint32;
+typedef unsigned long long uint64;
+
+typedef union {
+ uint32 i32;
+ uint64 i64;
+} u64;
+
+void foo(void)
+{
+ u64 data;
+ data.i64 = 1;
+ if (data.i32 != 1)
+ abort ();
+}
+
+/* { dg-final { scan-rtl-dump-not "abort" "cse1" { target i?86-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "cse1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-5.c
new file mode 100644
index 000000000..ea65f4b02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-5.c
@@ -0,0 +1,46 @@
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O -fgcse -fno-split-wide-types" } */
+
+extern void abort(void);
+
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long uint64_t;
+
+typedef struct
+{
+ uint16_t thread;
+ uint16_t phase;
+} s32;
+
+typedef union
+{
+ uint32_t i;
+ s32 s;
+} u32;
+
+typedef union
+{
+ uint64_t i;
+ u32 u;
+} u64;
+
+static __attribute__((noinline))
+void foo(int val)
+{
+ u64 data;
+ uint32_t thread;
+
+ data.u.i = 0x10000L;
+ thread = data.u.s.thread;
+ if (val)
+ abort ();
+ if (thread)
+ abort ();
+}
+
+int main(void)
+{
+ foo (0);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-1.c
new file mode 100644
index 000000000..1d7f4d549
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } */
+/* A combine of two extensions to C89 are used here.
+ First casts to unions is used.
+ Second subscripting non lvalue arrays, this is in C99. */
+
+union vx {short f[8]; int v;};
+int vec;
+
+void
+foo5 (int vec)
+{
+ ((union vx) vec).f[5] = 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-2.c
new file mode 100644
index 000000000..9aac5caa2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -pedantic-errors" } */
+/* PR 23155
+ We should get two error messages, one about union cast
+ and the other about array access for non lvalues. */
+
+
+union vx {short f[8]; int v;};
+int vec;
+
+void
+foo5 (int vec)
+{
+ ((union vx) vec).f[5] = 1; /* { dg-error "(forbids subscripting)|(forbids casts to union type)" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-3.c
new file mode 100644
index 000000000..5f9b9f868
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-3.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+/* PR 23155
+ We should get one error messag, one about union cast. */
+
+
+union vx {short f[8]; int v;};
+int vec;
+
+void
+foo5 (int vec)
+{
+ ((union vx) vec).f[5] = 1; /* { dg-error "forbids casts to union type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-4.c
new file mode 100644
index 000000000..a1c98ba14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/union-cast-4.c
@@ -0,0 +1,8 @@
+/* PR c/35748 */
+
+union U { void x[1]; }; /* { dg-error "array of voids" } */
+
+void foo()
+{
+ (union U)0; /* { dg-error "type not present" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unordered-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/unordered-1.c
new file mode 100644
index 000000000..1310532de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unordered-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+void bar (int);
+
+void foo (int i, float f)
+{
+ bar (__builtin_isgreater (i, i)); /* { dg-error "non-floating-point" } */
+ bar (__builtin_isgreater (f, i));
+ bar (__builtin_isgreater (i, f));
+ bar (__builtin_isgreater (f, 2));
+ bar (__builtin_isgreater (f, 2.0f));
+ bar (__builtin_isgreater (f, 2.0));
+ bar (__builtin_isgreater (2, f));
+ bar (__builtin_isgreater (2.0f, f));
+ bar (__builtin_isgreater (2.0, f));
+ bar (__builtin_isgreater (&f, i)); /* { dg-error "non-floating-point" } */
+ bar (__builtin_isgreater (f, &i)); /* { dg-error "non-floating-point" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unordered-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/unordered-2.c
new file mode 100644
index 000000000..0696d37cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unordered-2.c
@@ -0,0 +1,51 @@
+/* { dg-do link } */
+
+void link_error ();
+
+int main()
+{
+ if (__builtin_isgreater(1.0,2.0) != 0)
+ link_error ();
+ if (__builtin_isgreater(3.0,3.0) != 0)
+ link_error ();
+ if (__builtin_isgreater(5.0,4.0) == 0)
+ link_error ();
+
+ if (__builtin_isgreaterequal(1.0,2.0) != 0)
+ link_error ();
+ if (__builtin_isgreaterequal(3.0,3.0) == 0)
+ link_error ();
+ if (__builtin_isgreaterequal(5.0,4.0) == 0)
+ link_error ();
+
+ if (__builtin_isless(1.0,2.0) == 0)
+ link_error ();
+ if (__builtin_isless(3.0,3.0) != 0)
+ link_error ();
+ if (__builtin_isless(5.0,4.0) != 0)
+ link_error ();
+
+ if (__builtin_islessequal(1.0,2.0) == 0)
+ link_error ();
+ if (__builtin_islessequal(3.0,3.0) == 0)
+ link_error ();
+ if (__builtin_islessequal(5.0,4.0) != 0)
+ link_error ();
+
+ if (__builtin_islessgreater(1.0,2.0) == 0)
+ link_error ();
+ if (__builtin_islessgreater(3.0,3.0) != 0)
+ link_error ();
+ if (__builtin_islessgreater(5.0,4.0) == 0)
+ link_error ();
+
+ if (__builtin_isunordered(1.0,2.0) != 0)
+ link_error ();
+ if (__builtin_isunordered(3.0,3.0) != 0)
+ link_error ();
+ if (__builtin_isunordered(5.0,4.0) != 0)
+ link_error ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unordered-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/unordered-3.c
new file mode 100644
index 000000000..d08abd0ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unordered-3.c
@@ -0,0 +1,80 @@
+/* { dg-do link } */
+/* { dg-options "-fno-finite-math-only" } */
+
+void link_error ();
+
+void test1()
+{
+ if (__builtin_isgreater(1.0,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_isgreater(__builtin_nan(""),1.0) != 0)
+ link_error ();
+
+ if (__builtin_isgreaterequal(1.0,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_isgreaterequal(__builtin_nan(""),1.0) != 0)
+ link_error ();
+
+ if (__builtin_isless(1.0,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_isless(__builtin_nan(""),1.0) != 0)
+ link_error ();
+
+ if (__builtin_islessequal(1.0,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_islessequal(__builtin_nan(""),1.0) != 0)
+ link_error ();
+
+ if (__builtin_islessgreater(1.0,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_islessgreater(__builtin_nan(""),1.0) != 0)
+ link_error ();
+
+ if (__builtin_isunordered(1.0,__builtin_nan("")) == 0)
+ link_error ();
+ if (__builtin_isunordered(__builtin_nan(""),1.0) == 0)
+ link_error ();
+}
+
+
+void test2(double x)
+{
+ if (__builtin_isgreater(x,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_isgreater(__builtin_nan(""),x) != 0)
+ link_error ();
+
+ if (__builtin_isgreaterequal(x,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_isgreaterequal(__builtin_nan(""),x) != 0)
+ link_error ();
+
+ if (__builtin_isless(x,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_isless(__builtin_nan(""),x) != 0)
+ link_error ();
+
+ if (__builtin_islessequal(x,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_islessequal(__builtin_nan(""),x) != 0)
+ link_error ();
+
+ if (__builtin_islessgreater(x,__builtin_nan("")) != 0)
+ link_error ();
+ if (__builtin_islessgreater(__builtin_nan(""),x) != 0)
+ link_error ();
+
+ if (__builtin_isunordered(x,__builtin_nan("")) == 0)
+ link_error ();
+ if (__builtin_isunordered(__builtin_nan(""),x) == 0)
+ link_error ();
+}
+
+
+int main()
+{
+ test1 ();
+ test2 (1.0);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unroll-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/unroll-1.c
new file mode 100644
index 000000000..e70328918
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unroll-1.c
@@ -0,0 +1,27 @@
+/* PR optimization/8599 */
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops" } */
+/* { dg-options "-mtune=k6 -O2 -funroll-loops" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+
+extern void abort (void);
+
+int array[6] = { 1,2,3,4,5,6 };
+
+void foo()
+{
+ int i;
+
+ for (i = 0; i < 5; i++)
+ array[i] = 0;
+}
+
+int main()
+{
+ foo();
+ if (array[0] || array [1] || array[2] || array[3] || array[4])
+ abort ();
+ if (array[5] != 6)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unroll_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_1.c
new file mode 100644
index 000000000..b1d3e7c69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_1.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-loop2_unroll=stderr -fno-peel-loops -fno-tree-vrp -fdisable-tree-cunroll -fdisable-tree-cunrolli -fenable-rtl-loop2 -fenable-rtl-loop2_unroll" } */
+
+unsigned a[100], b[100];
+inline void bar()
+{
+ a[10] = b[10];
+}
+
+int foo(void)
+{
+ int i;
+ bar();
+ for (i = 0; i < 2; i++) /* { dg-message "note: loop turned into non-loop; it never loops" } */
+ {
+ a[i]= b[i] + 1;
+ }
+ return 1;
+}
+
+int foo2(void)
+{
+ int i;
+ for (i = 0; i < 2; i++) /* { dg-message "note: loop turned into non-loop; it never loops" } */
+ {
+ a[i]= b[i] + 1;
+ }
+ return 1;
+}
+/* { dg-prune-output ".*" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unroll_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_2.c
new file mode 100644
index 000000000..2322a4940
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_2.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-loop2_unroll -fno-peel-loops -fno-tree-vrp -fdisable-tree-cunroll=foo -fdisable-tree-cunrolli=foo -fenable-rtl-loop2_unroll" } */
+
+unsigned a[100], b[100];
+inline void bar()
+{
+ a[10] = b[10];
+}
+
+int foo(void)
+{
+ int i;
+ bar();
+ for (i = 0; i < 2; i++)
+ {
+ a[i]= b[i] + 1;
+ }
+ return 1;
+}
+
+int foo2(void)
+{
+ int i;
+ for (i = 0; i < 2; i++)
+ {
+ a[i]= b[i] + 1;
+ }
+ return 1;
+}
+
+/* { dg-final { scan-rtl-dump-times "loop turned into non-loop; it never loops" 1 "loop2_unroll" } } */
+/* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unroll_3.c b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_3.c
new file mode 100644
index 000000000..310bf064c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_3.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-loop2_unroll -fno-peel-loops -fno-tree-vrp -fdisable-tree-cunroll -fdisable-tree-cunrolli -fenable-rtl-loop2_unroll=foo" } */
+
+unsigned a[100], b[100];
+inline void bar()
+{
+ a[10] = b[10];
+}
+
+int foo(void)
+{
+ int i;
+ bar();
+ for (i = 0; i < 2; i++)
+ {
+ a[i]= b[i] + 1;
+ }
+ return 1;
+}
+
+int foo2(void)
+{
+ int i;
+ for (i = 0; i < 2; i++)
+ {
+ a[i]= b[i] + 1;
+ }
+ return 1;
+}
+
+/* { dg-final { scan-rtl-dump-times "loop turned into non-loop; it never loops" 1 "loop2_unroll" } } */
+/* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unroll_4.c b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_4.c
new file mode 100644
index 000000000..fbffbb0d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_4.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-rtl-loop2_unroll -fno-peel-loops -fno-tree-vrp -fdisable-tree-cunroll -fdisable-tree-cunrolli -fenable-rtl-loop2_unroll=foo2" } */
+
+unsigned a[100], b[100];
+inline void bar()
+{
+ a[10] = b[10];
+}
+
+int foo(void)
+{
+ int i;
+ bar();
+ for (i = 0; i < 2; i++)
+ {
+ a[i]= b[i] + 1;
+ }
+ return 1;
+}
+
+int foo2(void)
+{
+ int i;
+ for (i = 0; i < 2; i++)
+ {
+ a[i]= b[i] + 1;
+ }
+ return 1;
+}
+
+/* { dg-final { scan-rtl-dump-times "loop turned into non-loop; it never loops" 1 "loop2_unroll" } } */
+/* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unroll_5.c b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_5.c
new file mode 100644
index 000000000..edb9c26a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unroll_5.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-rtl-loop2_unroll -funroll-loops" } */
+/* { dg-require-effective-target int32plus } */
+
+void abort (void);
+int *a;
+/* Fails on MIPS16 because equality checks are implemented using XOR.
+ It's unlikely MIPS16 users would want unrolling anyway. */
+#ifdef __mips
+__attribute__((nomips16))
+#endif
+int t()
+{
+ int i;
+ for (i=0;i<1000000;i++)
+ if (a[i])
+ return 1;
+ return 0;
+}
+#ifdef __mips
+__attribute__((nomips16))
+#endif
+int t2()
+{
+ int i;
+ for (i=0;i<3000000;i++)
+ if (a[i])
+ abort ();
+ return 0;
+}
+/* { dg-final { scan-rtl-dump-times "upper bound: 999999" 1 "loop2_unroll" } } */
+/* { dg-final { scan-rtl-dump-not "realistic bound: 999999" "loop2_unroll" } } */
+/* { dg-final { scan-rtl-dump-times "upper bound: 2999999" 1 "loop2_unroll" } } */
+/* { dg-final { scan-rtl-dump-times "realistic bound: 2999999" 1 "loop2_unroll" } } */
+/* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unsigned-long-compare.c b/gcc-4.9/gcc/testsuite/gcc.dg/unsigned-long-compare.c
new file mode 100644
index 000000000..74e7638f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unsigned-long-compare.c
@@ -0,0 +1,24 @@
+/* Copyright (C) 2006 Free Software Foundation, Inc. */
+/* Contributed by Carlos O'Donell on 2006-01-30 */
+
+/* Test a division corner case where the expression simplifies
+ to a comparison, and the optab expansion is wrong. The optab
+ expansion emits a function whose return is unbiased and needs
+ adjustment. */
+/* Origin: Carlos O'Donell <carlos@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "" } */
+#include <stdlib.h>
+
+#define BIG_CONSTANT 0xFFFFFFFF80000000ULL
+
+int main (void)
+{
+ unsigned long long OneULL = 1ULL;
+ unsigned long long result;
+
+ result = OneULL / BIG_CONSTANT;
+ if (result)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-1.c
new file mode 100644
index 000000000..8db7c2ccf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-1.c
@@ -0,0 +1,11 @@
+/* Missing `unused parameter' warning.
+ egcs-1.1.2 fails, egcs-ss-19990418 passes.
+ http://gcc.gnu.org/ml/gcc-bugs/1998-09/msg00199.html */
+/* { dg-do compile } */
+/* { dg-options "-O -Wall -W" } */
+int
+f(c)
+ char c; /* { dg-warning "unused parameter" "unused parameter warning" } */
+{
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-2.c
new file mode 100644
index 000000000..454606ec9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-2.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2000 Free Software Foundation.
+
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -finline-functions -Wunused -Wreturn-type" } */
+
+static void
+foo ()
+{
+ skip_it: ; /* { dg-warning "defined but not used" "unused label warning" } */
+}
+
+void
+bar ()
+{
+ foo ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-3.c
new file mode 100644
index 000000000..120562448
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-3.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2000 Free Software Foundation. */
+/* Added extra line-breaks to check that diagnostics refer to correct token.
+ --Per Bothner. */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+typedef short unused_type __attribute__ ((unused));
+main ()
+{
+ short
+ x /* { dg-warning "unused variable" "unused variable warning" } */
+ ;
+ unused_type y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-4.c
new file mode 100644
index 000000000..99e845f45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-4.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Wunused -O3" } */
+
+static const int i = 0;
+static void f() { } /* { dg-warning "defined but not used" } */
+static inline void g() { }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-5.c
new file mode 100644
index 000000000..5ccc3f3be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-5.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+/* { dg-final { scan-assembler "string_to_look_for" } } */
+
+/* 'volatile' variables get output and don't produce a warning about being
+ unused. */
+static volatile char string[]
+ = "string_to_look_for"; /* { dg-bogus "not used" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-6-WallWextra.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-6-WallWextra.c
new file mode 100644
index 000000000..d2d80be06
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-6-WallWextra.c
@@ -0,0 +1,11 @@
+/* PR 28875 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wextra -Wall" } */
+static int t(int i) /* { dg-warning "unused parameter" "unused parameter warning" } */
+{
+ return 0;
+}
+int tt()
+{
+ return t(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-6-no.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-6-no.c
new file mode 100644
index 000000000..0923cfb81
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-6-no.c
@@ -0,0 +1,11 @@
+/* PR 28875 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wextra -Wno-unused-parameter -Wall" } */
+static int t(int i) /* { dg-bogus "unused parameter" "unused parameter warning" } */
+{
+ return 0;
+}
+int tt()
+{
+ return t(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-6.c
new file mode 100644
index 000000000..7651ecb28
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-6.c
@@ -0,0 +1,11 @@
+
+/* { dg-do compile } */
+/* { dg-options "-O3 -Wunused-parameter" } */
+static int t(int i) /* { dg-warning "unused parameter" "unused parameter warning" } */
+{
+ return 0;
+}
+int tt()
+{
+ return t(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-7.c
new file mode 100644
index 000000000..d2b9c3c1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-7.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+static int a = 10; /* { dg-warning "defined but not used" } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unwind-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/unwind-1.c
new file mode 100644
index 000000000..95bbb2daa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/unwind-1.c
@@ -0,0 +1,7 @@
+/* { dg-do assemble { target { ! { powerpc-ibm-aix* } } } } */
+/* { dg-options "-fleading-underscore -funwind-tables" } */
+
+void func(void) __asm("_func");
+void _func(int x) {}
+void func(void) {}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-array-short-wchar.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-array-short-wchar.c
new file mode 100644
index 000000000..ec478121a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-array-short-wchar.c
@@ -0,0 +1,42 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Expected errors for char16_t/char32_t string literals. */
+/* { dg-do compile } */
+/* { dg-require-effective-target wchar } */
+/* { dg-options "-std=gnu99 -fshort-wchar" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+const char s_0[] = "ab";
+const char s_1[] = u"ab"; /* { dg-error "from wide string" } */
+const char s_2[] = U"ab"; /* { dg-error "from wide string" } */
+const char s_3[] = L"ab"; /* { dg-error "from wide string" } */
+
+const char16_t s16_0[] = "ab"; /* { dg-error "from non-wide" } */
+const char16_t s16_1[] = u"ab";
+const char16_t s16_2[] = U"ab"; /* { dg-error "from incompatible" } */
+const char16_t s16_3[] = L"ab";
+
+const char16_t s16_4[0] = u"ab"; /* { dg-warning "chars is too long" } */
+const char16_t s16_5[1] = u"ab"; /* { dg-warning "chars is too long" } */
+const char16_t s16_6[2] = u"ab";
+const char16_t s16_7[3] = u"ab";
+const char16_t s16_8[4] = u"ab";
+
+const char32_t s32_0[] = "ab"; /* { dg-error "from non-wide" } */
+const char32_t s32_1[] = u"ab"; /* { dg-error "from incompatible" } */
+const char32_t s32_2[] = U"ab";
+const char32_t s32_3[] = L"ab"; /* { dg-error "from incompatible" } */
+
+const char32_t s32_4[0] = U"ab"; /* { dg-warning "chars is too long" } */
+const char32_t s32_5[1] = U"ab"; /* { dg-warning "chars is too long" } */
+const char32_t s32_6[2] = U"ab"; /* { dg-warning "chars is too long" "" { target "m32c-*-*" } } */
+const char32_t s32_7[3] = U"ab"; /* { dg-warning "chars is too long" "" { target "m32c-*-*" } } */
+const char32_t s32_8[4] = U"ab"; /* { dg-warning "chars is too long" "" { target "m32c-*-*" } } */
+
+const wchar_t sw_0[] = "ab"; /* { dg-error "from non-wide" } */
+const wchar_t sw_1[] = u"ab";
+const wchar_t sw_2[] = U"ab"; /* { dg-error "from incompatible" } */
+const wchar_t sw_3[] = L"ab";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-array.c
new file mode 100644
index 000000000..433ddcfaf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-array.c
@@ -0,0 +1,42 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Expected errors for char16_t/char32_t string literals. */
+/* { dg-do compile } */
+/* { dg-require-effective-target wchar } */
+/* { dg-options "-std=gnu99" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+const char s_0[] = "ab";
+const char s_1[] = u"ab"; /* { dg-error "from wide string" } */
+const char s_2[] = U"ab"; /* { dg-error "from wide string" } */
+const char s_3[] = L"ab"; /* { dg-error "from wide string" } */
+
+const char16_t s16_0[] = "ab"; /* { dg-error "from non-wide" } */
+const char16_t s16_1[] = u"ab";
+const char16_t s16_2[] = U"ab"; /* { dg-error "from incompatible" } */
+const char16_t s16_3[] = L"ab"; /* { dg-error "from incompatible" "" { target { ! wchar_t_char16_t_compatible } } } */
+
+const char16_t s16_4[0] = u"ab"; /* { dg-warning "chars is too long" } */
+const char16_t s16_5[1] = u"ab"; /* { dg-warning "chars is too long" } */
+const char16_t s16_6[2] = u"ab";
+const char16_t s16_7[3] = u"ab";
+const char16_t s16_8[4] = u"ab";
+
+const char32_t s32_0[] = "ab"; /* { dg-error "from non-wide" } */
+const char32_t s32_1[] = u"ab"; /* { dg-error "from incompatible" } */
+const char32_t s32_2[] = U"ab";
+const char32_t s32_3[] = L"ab"; /* { dg-error "from incompatible" "" { target { ! wchar_t_char32_t_compatible } } } */
+
+const char32_t s32_4[0] = U"ab"; /* { dg-warning "chars is too long" } */
+const char32_t s32_5[1] = U"ab"; /* { dg-warning "chars is too long" } */
+const char32_t s32_6[2] = U"ab"; /* { dg-warning "chars is too long" "" { target "m32c-*-*" } } */
+const char32_t s32_7[3] = U"ab"; /* { dg-warning "chars is too long" "" { target "m32c-*-*" } } */
+const char32_t s32_8[4] = U"ab"; /* { dg-warning "chars is too long" "" { target "m32c-*-*" } } */
+
+const wchar_t sw_0[] = "ab"; /* { dg-error "from non-wide" } */
+const wchar_t sw_1[] = u"ab"; /* { dg-error "from incompatible" "" { target { ! wchar_t_char16_t_compatible } } } */
+const wchar_t sw_2[] = U"ab"; /* { dg-error "from incompatible" "" { target { ! wchar_t_char32_t_compatible } } } */
+const wchar_t sw_3[] = L"ab";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-badconcat.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-badconcat.c
new file mode 100644
index 000000000..61ce495ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-badconcat.c
@@ -0,0 +1,22 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test unsupported concatenation of char16_t/char32_t* string literals. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void *s0 = u"a" "b";
+void *s1 = "a" u"b";
+void *s2 = u"a" U"b"; /* { dg-error "non-standard concatenation" } */
+void *s3 = U"a" u"b"; /* { dg-error "non-standard concatenation" } */
+void *s4 = u"a" L"b"; /* { dg-error "non-standard concatenation" } */
+void *s5 = L"a" u"b"; /* { dg-error "non-standard concatenation" } */
+void *s6 = u"a" u"b";
+void *s7 = U"a" "b";
+void *s8 = "a" U"b";
+void *s9 = U"a" L"b"; /* { dg-error "non-standard concatenation" } */
+void *sa = L"a" U"b"; /* { dg-error "non-standard concatenation" } */
+void *sb = U"a" U"b";
+void *sc = L"a" "b";
+void *sd = "a" L"b";
+void *se = L"a" L"b";
+
+int main () {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-badconcat2.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-badconcat2.c
new file mode 100644
index 000000000..ea71a7f68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-badconcat2.c
@@ -0,0 +1,15 @@
+/* Test unsupported concatenation of UTF-8 string literals. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void *s0 = u8"a" "b";
+void *s1 = "a" u8"b";
+void *s2 = u8"a" u8"b";
+void *s3 = u8"a" u"b"; /* { dg-error "non-standard concatenation" } */
+void *s4 = u"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+void *s5 = u8"a" U"b"; /* { dg-error "non-standard concatenation" } */
+void *s6 = U"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+void *s7 = u8"a" L"b"; /* { dg-error "non-standard concatenation" } */
+void *s8 = L"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+
+int main () {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-cvt.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-cvt.c
new file mode 100644
index 000000000..d6f18eead
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-cvt.c
@@ -0,0 +1,59 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test the char16_t and char32_t promotion rules. */
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+/* { dg-options "-std=gnu99 -Wall -Wconversion -Wsign-conversion" } */
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+extern void f_c (char);
+extern void fsc (signed char);
+extern void fuc (unsigned char);
+extern void f_s (short);
+extern void fss (signed short);
+extern void fus (unsigned short);
+extern void f_i (int);
+extern void fsi (signed int);
+extern void fui (unsigned int);
+extern void f_l (long);
+extern void fsl (signed long);
+extern void ful (unsigned long);
+extern void f_ll (long long);
+extern void fsll (signed long long);
+extern void full (unsigned long long);
+
+void m (char16_t c0, char32_t c1)
+{
+ f_c (c0); /* { dg-warning "alter its value" } */
+ fsc (c0); /* { dg-warning "alter its value" } */
+ fuc (c0); /* { dg-warning "alter its value" } */
+ f_s (c0); /* { dg-warning "change the sign" } */
+ fss (c0); /* { dg-warning "change the sign" } */
+ fus (c0);
+ f_i (c0);
+ fsi (c0);
+ fui (c0);
+ f_l (c0);
+ fsl (c0);
+ ful (c0);
+ f_ll (c0);
+ fsll (c0);
+ full (c0);
+
+ f_c (c1); /* { dg-warning "alter its value" } */
+ fsc (c1); /* { dg-warning "alter its value" } */
+ fuc (c1); /* { dg-warning "alter its value" } */
+ f_s (c1); /* { dg-warning "alter its value" } */
+ fss (c1); /* { dg-warning "alter its value" } */
+ fus (c1); /* { dg-warning "alter its value" } */
+ f_i (c1); /* { dg-warning "change the sign" "" { target { ! int16 } } } */
+ fsi (c1); /* { dg-warning "change the sign" "" { target { ! int16 } } } */
+ fui (c1);
+ f_l (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
+ fsl (c1); /* { dg-warning "change the sign" "" { target { llp64 || ilp32 } } } */
+ ful (c1);
+ f_ll (c1);
+ fsll (c1);
+ full (c1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-dflt.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-dflt.c
new file mode 100644
index 000000000..f672f0af5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-dflt.c
@@ -0,0 +1,25 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* If not gnu99, the u and U prefixes should be parsed as separate tokens. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const unsigned short c0 = u'a'; /* { dg-error "undeclared" "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 6 } */
+const unsigned long c1 = U'a'; /* { dg-error "undeclared" "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 8 } */
+
+#define u 1 +
+#define U 2 +
+
+const unsigned short c2 = u'a';
+const unsigned long c3 = U'a';
+
+#undef u
+#undef U
+#define u "a"
+#define U "b"
+
+const void *s0 = u"a";
+const void *s1 = U"a";
+
+int main () {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-dflt2.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-dflt2.c
new file mode 100644
index 000000000..022c081fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-dflt2.c
@@ -0,0 +1,12 @@
+/* If not gnu99, the u8 prefix should be parsed as separate tokens. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const void *s0 = u8"a"; /* { dg-error "undeclared" "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "expected" { target *-*-* } 5 } */
+
+#define u8 "a"
+
+const void *s1 = u8"a";
+
+int main () {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-inc-init.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-inc-init.c
new file mode 100644
index 000000000..531d21b26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-inc-init.c
@@ -0,0 +1,45 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test incremental initializers for char16_t/char32_t arrays. */
+/* { dg-do run { target int32plus } } */
+/* { dg-options "-std=gnu99" } */
+
+typedef __SIZE_TYPE__ size_t;
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+extern int memcmp (const void *, const void *, size_t);
+extern void abort (void);
+extern void exit (int);
+
+struct A {
+ char16_t S[6];
+ int M;
+} a[] = { { { u"foo" }, 1 }, [0].S[2] = u'x', [0].S[4] = u'y' };
+struct A b[] = { { { u"foo" }, 1 }, [0] = { .S[0] = u'b' } };
+struct A c[] = { { { u"foo" }, 1 }, [0].S = { u"a" }, [0].M = 2 };
+
+struct B {
+ char32_t S[6];
+ int M;
+} d[] = { { { U"foo" }, 1 }, [0].S[2] = U'x', [0].S[4] = U'y' };
+struct B e[] = { { { U"foo" }, 1 }, [0] = { .S[0] = U'b' } };
+struct B f[] = { { { U"foo" }, 1 }, [0].S = { U"a" }, [0].M = 2 };
+
+int main (void)
+{
+ if (memcmp (a[0].S, u"fox\0y", 6 * sizeof(char16_t)) || a[0].M != 1)
+ abort ();
+ if (memcmp (b[0].S, u"b\0\0\0\0", 6) || b[0].M)
+ abort ();
+ if (memcmp (c[0].S, u"a\0\0\0\0", 6) || c[0].M != 2)
+ abort ();
+
+ if (memcmp (d[0].S, U"fox\0y", 6 * sizeof(char32_t)) || d[0].M != 1)
+ abort ();
+ if (memcmp (e[0].S, U"b\0\0\0\0", 6) || e[0].M)
+ abort ();
+ if (memcmp (f[0].S, U"a\0\0\0\0", 6) || f[0].M != 2)
+ abort ();
+
+ exit(0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf-type.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf-type.c
new file mode 100644
index 000000000..1aa6020cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf-type.c
@@ -0,0 +1,18 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Ensure that __CHAR16_TYPE__ and __CHAR32_TYPE__ exist, and are of the
+ correct width. */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Werror" } */
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+extern void abort (void);
+
+int main ()
+{
+ if (sizeof (char16_t) != sizeof (u'a'))
+ abort();
+ if (sizeof (char32_t) != sizeof (U'a'))
+ abort();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf16-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf16-1.c
new file mode 100644
index 000000000..f2343d2a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf16-1.c
@@ -0,0 +1,67 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test the support for char16_t character constants. */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Werror" } */
+
+typedef __CHAR16_TYPE__ char16_t;
+
+extern void abort (void);
+
+char16_t c0 = u'a';
+char16_t c1 = u'\0';
+char16_t c2 = u'\u0024';
+char16_t c3 = u'\u2029';
+char16_t c4 = u'\u8010';
+
+char16_t c5 = 'a';
+char16_t c6 = U'a';
+char16_t c7 = U'\u2029';
+char16_t c8 = U'\u8010';
+char16_t c9 = L'a';
+char16_t ca = L'\u2029';
+char16_t cb = L'\u8010';
+
+#define A 0x0061
+#define D 0x0024
+#define X 0x2029
+#define Y 0x8010
+
+int main ()
+{
+ if (sizeof (u'a') != sizeof (char16_t))
+ abort ();
+ if (sizeof (u'\0') != sizeof (char16_t))
+ abort ();
+ if (sizeof (u'\u0024') != sizeof (char16_t))
+ abort ();
+ if (sizeof (u'\u2029') != sizeof (char16_t))
+ abort ();
+ if (sizeof (u'\u8010') != sizeof (char16_t))
+ abort ();
+
+ if (c0 != A)
+ abort ();
+ if (c1 != 0x0000)
+ abort ();
+ if (c2 != D)
+ abort ();
+ if (c3 != X)
+ abort ();
+ if (c4 != Y)
+ abort ();
+
+ if (c5 != A)
+ abort ();
+ if (c6 != A)
+ abort ();
+ if (c7 != X)
+ abort ();
+ if (c8 != Y)
+ abort ();
+ if (c9 != A)
+ abort ();
+ if (ca != X)
+ abort ();
+ if (cb != Y)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf16-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf16-2.c
new file mode 100644
index 000000000..7fc5ef1ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf16-2.c
@@ -0,0 +1,32 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test the support for char16_t* string literals. */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Werror" } */
+
+typedef __CHAR16_TYPE__ char16_t;
+
+extern void abort (void);
+
+char16_t *s0 = u"ab";
+char16_t *s1 = u"a\u0024";
+char16_t *s2 = u"a\u2029";
+char16_t *s3 = u"a\U00064321";
+
+#define A 0x0061
+#define B 0x0062
+#define D 0x0024
+#define X 0x2029
+#define Y1 0xD950
+#define Y2 0xDF21
+
+int main ()
+{
+ if (s0[0] != A || s0[1] != B || s0[2] != 0x0000)
+ abort ();
+ if (s1[0] != A || s1[1] != D || s0[2] != 0x0000)
+ abort ();
+ if (s2[0] != A || s2[1] != X || s0[2] != 0x0000)
+ abort ();
+ if (s3[0] != A || s3[1] != Y1 || s3[2] != Y2 || s3[3] != 0x0000)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf16-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf16-3.c
new file mode 100644
index 000000000..ed2eb408b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf16-3.c
@@ -0,0 +1,49 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test concatenation of char16_t* string literals. */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Werror" } */
+
+typedef __CHAR16_TYPE__ char16_t;
+
+extern void abort (void);
+
+char16_t *s0 = u"a" u"b";
+
+char16_t *s1 = u"a" "b";
+char16_t *s2 = "a" u"b";
+char16_t *s3 = u"a" "\u2029";
+char16_t *s4 = "\u2029" u"b";
+char16_t *s5 = u"a" "\U00064321";
+char16_t *s6 = "\U00064321" u"b";
+
+#define A 0x0061
+#define B 0x0062
+#define X 0x2029
+#define Y1 0xD950
+#define Y2 0xDF21
+
+int main ()
+{
+ if (sizeof ((u"a" u"b")[0]) != sizeof (char16_t))
+ abort ();
+ if (sizeof ((u"a" "b")[0]) != sizeof (char16_t))
+ abort ();
+ if (sizeof (( "a" u"b")[0]) != sizeof (char16_t))
+ abort ();
+
+ if (s0[0] != A || s0[1] != B || s0[2] != 0x0000)
+ abort ();
+
+ if (s1[0] != A || s1[1] != B || s1[2] != 0x0000)
+ abort ();
+ if (s2[0] != A || s2[1] != B || s2[2] != 0x0000)
+ abort ();
+ if (s3[0] != A || s3[1] != X || s3[2] != 0x0000)
+ abort ();
+ if (s4[0] != X || s4[1] != B || s4[2] != 0x0000)
+ abort ();
+ if (s5[0] != A || s5[1] != Y1 || s5[2] != Y2 || s5[3] != 0x0000)
+ abort ();
+ if (s6[0] != Y1 || s6[1] != Y2 || s6[2] != B || s6[3] != 0x0000)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf16-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf16-4.c
new file mode 100644
index 000000000..61cb10a1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf16-4.c
@@ -0,0 +1,21 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Expected errors for char16_t character constants. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+typedef __CHAR16_TYPE__ char16_t;
+
+char16_t c0 = u''; /* { dg-error "empty character" } */
+char16_t c1 = u'ab'; /* { dg-warning "constant too long" } */
+char16_t c2 = u'\U00064321'; /* { dg-warning "constant too long" } */
+
+char16_t c3 = 'a';
+char16_t c4 = U'a';
+char16_t c5 = U'\u2029';
+char16_t c6 = U'\U00064321'; /* { dg-warning "implicitly truncated" } */
+char16_t c7 = L'a';
+char16_t c8 = L'\u2029';
+char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" "" { target { 4byte_wchar_t } } 18 } */
+ /* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } 18 } */
+
+int main () {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf32-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf32-1.c
new file mode 100644
index 000000000..f9d24c4d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf32-1.c
@@ -0,0 +1,44 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test the support for char32_t character constants. */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Werror" } */
+
+typedef __CHAR32_TYPE__ char32_t;
+
+extern void abort (void);
+
+char32_t c0 = U'a';
+char32_t c1 = U'\0';
+char32_t c2 = U'\u0024';
+char32_t c3 = U'\u2029';
+char32_t c4 = U'\U00064321';
+
+#define A 0x00000061
+#define D 0x00000024
+#define X 0x00002029
+#define Y 0x00064321
+
+int main ()
+{
+ if (sizeof (U'a') != sizeof (char32_t))
+ abort ();
+ if (sizeof (U'\0') != sizeof (char32_t))
+ abort ();
+ if (sizeof (U'\u0024') != sizeof (char32_t))
+ abort ();
+ if (sizeof (U'\u2029') != sizeof (char32_t))
+ abort ();
+ if (sizeof (U'\U00064321') != sizeof (char32_t))
+ abort ();
+
+ if (c0 != A)
+ abort ();
+ if (c1 != 0x0000)
+ abort ();
+ if (c2 != D)
+ abort ();
+ if (c3 != X)
+ abort ();
+ if (c4 != Y)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf32-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf32-2.c
new file mode 100644
index 000000000..c0d23fb36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf32-2.c
@@ -0,0 +1,31 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test the support for char32_t* string constants. */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Werror" } */
+
+typedef __CHAR32_TYPE__ char32_t;
+
+extern void abort (void);
+
+char32_t *s0 = U"ab";
+char32_t *s1 = U"a\u0024";
+char32_t *s2 = U"a\u2029";
+char32_t *s3 = U"a\U00064321";
+
+#define A 0x00000061
+#define B 0x00000062
+#define D 0x00000024
+#define X 0x00002029
+#define Y 0x00064321
+
+int main ()
+{
+ if (s0[0] != A || s0[1] != B || s0[2] != 0x00000000)
+ abort ();
+ if (s1[0] != A || s1[1] != D || s0[2] != 0x00000000)
+ abort ();
+ if (s2[0] != A || s2[1] != X || s0[2] != 0x00000000)
+ abort ();
+ if (s3[0] != A || s3[1] != Y || s3[2] != 0x00000000)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf32-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf32-3.c
new file mode 100644
index 000000000..de7b2aa35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf32-3.c
@@ -0,0 +1,48 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Test concatenation of char32_t* string literals. */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99 -Wall -Werror" } */
+
+typedef __CHAR32_TYPE__ char32_t;
+
+extern void abort (void);
+
+char32_t *s0 = U"a" U"b";
+
+char32_t *s1 = U"a" "b";
+char32_t *s2 = "a" U"b";
+char32_t *s3 = U"a" "\u2029";
+char32_t *s4 = "\u2029" U"b";
+char32_t *s5 = U"a" "\U00064321";
+char32_t *s6 = "\U00064321" U"b";
+
+#define A 0x00000061
+#define B 0x00000062
+#define X 0x00002029
+#define Y 0x00064321
+
+int main ()
+{
+ if (sizeof ((U"a" U"b")[0]) != sizeof (char32_t))
+ abort ();
+ if (sizeof ((U"a" "b")[0]) != sizeof (char32_t))
+ abort ();
+ if (sizeof (( "a" U"b")[0]) != sizeof (char32_t))
+ abort ();
+
+ if (s0[0] != A || s0[1] != B || s0[2] != 0x00000000)
+ abort ();
+
+ if (s1[0] != A || s1[1] != B || s1[2] != 0x00000000)
+ abort ();
+ if (s2[0] != A || s2[1] != B || s2[2] != 0x00000000)
+ abort ();
+ if (s3[0] != A || s3[1] != X || s3[2] != 0x00000000)
+ abort ();
+ if (s4[0] != X || s4[1] != B || s4[2] != 0x00000000)
+ abort ();
+ if (s5[0] != A || s5[1] != Y || s5[2] != 0x00000000)
+ abort ();
+ if (s6[0] != Y || s6[1] != B || s6[2] != 0x00000000)
+ abort ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf32-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf32-4.c
new file mode 100644
index 000000000..aa7f66a36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf32-4.c
@@ -0,0 +1,20 @@
+/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
+/* Expected errors for char32_t character constants. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+typedef __CHAR32_TYPE__ char32_t;
+
+char32_t c0 = U''; /* { dg-error "empty character" } */
+char32_t c1 = U'ab'; /* { dg-warning "constant too long" } */
+char32_t c2 = U'\U00064321';
+
+char32_t c3 = 'a';
+char32_t c4 = u'a';
+char32_t c5 = u'\u2029';
+char32_t c6 = u'\U00064321'; /* { dg-warning "constant too long" } */
+char32_t c7 = L'a';
+char32_t c8 = L'\u2029';
+char32_t c9 = L'\U00064321'; /* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } } */
+
+int main () {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf8-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf8-1.c
new file mode 100644
index 000000000..e287e0656
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf8-1.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-require-iconv "ISO-8859-2" } */
+/* { dg-options "-std=gnu99 -fexec-charset=ISO-8859-2" } */
+
+const char *str1 = "h\u00e1\U0000010Dky ";
+const char *str2 = "\u010d\u00E1rky\n";
+const char *str3 = u8"h\u00e1\U0000010Dky ";
+const char *str4 = u8"\u010d\u00E1rky\n";
+const char *str5 = "h\u00e1\U0000010Dky " "\u010d\u00E1rky\n";
+const char *str6 = u8"h\u00e1\U0000010Dky " "\u010d\u00E1rky\n";
+const char *str7 = "h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n";
+#define u8
+const char *str8 = u8"h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n";
+
+const char latin2_1[] = "\x68\xe1\xe8\x6b\x79\x20";
+const char latin2_2[] = "\xe8\xe1\x72\x6b\x79\n";
+const char utf8_1[] = "\x68\xc3\xa1\xc4\x8d\x6b\x79\x20";
+const char utf8_2[] = "\xc4\x8d\xc3\xa1\x72\x6b\x79\n";
+
+int
+main (void)
+{
+ if (__builtin_strcmp (str1, latin2_1) != 0
+ || __builtin_strcmp (str2, latin2_2) != 0
+ || __builtin_strcmp (str3, utf8_1) != 0
+ || __builtin_strcmp (str4, utf8_2) != 0
+ || __builtin_strncmp (str5, latin2_1, sizeof (latin2_1) - 1) != 0
+ || __builtin_strcmp (str5 + sizeof (latin2_1) - 1, latin2_2) != 0
+ || __builtin_strncmp (str6, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str6 + sizeof (utf8_1) - 1, utf8_2) != 0
+ || __builtin_strncmp (str7, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str7 + sizeof (utf8_1) - 1, utf8_2) != 0
+ || __builtin_strncmp (str8, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str8 + sizeof (utf8_1) - 1, utf8_2) != 0)
+ __builtin_abort ();
+ if (sizeof ("a" u8"b"[0]) != 1
+ || sizeof (u8"a" "b"[0]) != 1
+ || sizeof (u8"a" u8"b"[0]) != 1
+ || sizeof ("a" "\u010d") != 3
+ || sizeof ("a" u8"\u010d") != 4
+ || sizeof (u8"a" "\u010d") != 4
+ || sizeof (u8"a" "\u010d") != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/utf8-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/utf8-2.c
new file mode 100644
index 000000000..f3b83fe33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/utf8-2.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target wchar } */
+/* { dg-options "-std=gnu99" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+const char s0[] = u8"ab";
+const char16_t s1[] = u8"ab"; /* { dg-error "from non-wide" } */
+const char32_t s2[] = u8"ab"; /* { dg-error "from non-wide" } */
+const wchar_t s3[] = u8"ab"; /* { dg-error "from non-wide" } */
+
+const char t0[0] = u8"ab"; /* { dg-warning "chars is too long" } */
+const char t1[1] = u8"ab"; /* { dg-warning "chars is too long" } */
+const char t2[2] = u8"ab";
+const char t3[3] = u8"ab";
+const char t4[4] = u8"ab";
+
+const char u0[0] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u1[1] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u2[2] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u3[3] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u4[4] = u8"\u2160.";
+const char u5[5] = u8"\u2160.";
+const char u6[6] = u8"\u2160.";
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-1.c
new file mode 100644
index 000000000..ecd0e4d84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+#include <stdarg.h>
+
+va_list v;
+volatile int i;
+
+void foo()
+{
+ i = va_arg(v, char); /* { dg-warning "is promoted to|so you should|abort" "char" } */
+ i = va_arg(v, short); /* { dg-warning "is promoted to|abort" "short" } */
+ i = va_arg(v, float); /* { dg-warning "is promoted to|abort" "float" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-2.c
new file mode 100644
index 000000000..e1c915ffc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-2.c
@@ -0,0 +1,12 @@
+/* <varargs.h> is not supported anymore, but we do install a stub
+ file which issues an #error telling the user to convert their code. */
+
+/* { dg-do compile } */
+
+#include <varargs.h> /* { dg-bogus "varargs.h" "missing file" } */
+
+/* { dg-message "file included from" "file included from" { target *-*-* } 0 } */
+/* { dg-error "no longer implements" "#error 1" { target *-*-* } 4 } */
+/* { dg-error "Revise your code" "#error 2" { target *-*-* } 5 } */
+
+int x; /* prevent empty-translation-unit warning */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-3.c
new file mode 100644
index 000000000..ef2344b4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* PR 14498. */
+#include <stdarg.h>
+extern void baz(char *);
+void bar (va_list *args)
+{
+ if (args)
+ {
+ char *s = va_arg(*args, char *);
+ baz(s);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-4.c
new file mode 100644
index 000000000..6d737c483
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-4.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+#include <stdarg.h>
+extern void baz(...); /* { dg-error "requires a named argument" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-5.c
new file mode 100644
index 000000000..a00616ee2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-5.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-fallow-parameterless-variadic-functions" } */
+#include <stdarg.h>
+extern void baz(...);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-1.c
new file mode 100644
index 000000000..09ae97917
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-1.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int bar (int, const char *, int, ...);
+int baz (int, const char *, long int);
+
+int
+f1 (int x, ...)
+{
+ return bar (5, "", 6, __builtin_va_arg_pack ()); /* { dg-error "invalid use of" } */
+}
+
+extern inline __attribute__((always_inline)) int
+f2 (int y, ...)
+{
+ return bar (y, "", __builtin_va_arg_pack ()); /* { dg-error "invalid use of" } */
+}
+
+extern inline __attribute__((always_inline)) int
+f3 (int y, ...)
+{
+ return bar (y, "", 5, __builtin_va_arg_pack ());
+}
+
+extern inline __attribute__((always_inline)) int
+f4 (int y, ...)
+{
+ return bar (y, "", 4, __builtin_va_arg_pack (), 6); /* { dg-error "invalid use of" } */
+}
+
+extern inline __attribute__((always_inline)) int
+f5 (int y, ...)
+{
+ return baz (y, "", __builtin_va_arg_pack ()); /* { dg-error "invalid use of" } */
+}
+
+extern inline __attribute__((always_inline)) int
+f6 (int y, ...)
+{
+ return __builtin_va_arg_pack (); /* { dg-error "invalid use of" } */
+}
+
+int
+test (void)
+{
+ int a = f2 (5, "a", 6);
+ a += f3 (6, "ab", 17LL);
+ a += f4 (7, 1, 2, 3);
+ a += f5 (8, 7L);
+ a += f6 (9);
+ return a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-2.c
new file mode 100644
index 000000000..417248a2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-2.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void noreturn (int status, ...);
+
+extern inline __attribute ((always_inline)) void
+error (int status, ...)
+{
+ if (__builtin_constant_p (status))
+ noreturn (status, __builtin_va_arg_pack ());
+}
+
+void
+f (void)
+{
+ error (1);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-len-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-len-1.c
new file mode 100644
index 000000000..409c34585
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-len-1.c
@@ -0,0 +1,122 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <stdarg.h>
+
+extern int error_open_missing_mode (void)
+ __attribute__((__error__ ("open with O_CREAT needs 3 arguments, only 2 were given")));
+extern int warn_open_too_many_arguments (void)
+ __attribute__((__warning__ ("open called with more than 3 arguments")));
+extern void abort (void);
+
+char expected_char;
+
+__attribute__((noinline)) int
+myopen2 (const char *path, int oflag)
+{
+ if (expected_char++ != path[0] || path[1] != '\0')
+ abort ();
+ switch (path[0])
+ {
+ case 'f':
+ if (oflag != 0x2)
+ abort ();
+ break;
+ case 'g':
+ if (oflag != 0x43)
+ abort ();
+ /* In real __open_2 this would terminate the program:
+ open with O_CREAT without third argument. */
+ return -6;
+ default:
+ abort ();
+ }
+ return 0;
+}
+
+__attribute__((noinline)) int
+myopenva (const char *path, int oflag, ...)
+{
+ int mode = 0;
+ va_list ap;
+ if ((oflag & 0x40) != 0)
+ {
+ va_start (ap, oflag);
+ mode = va_arg (ap, int);
+ va_end (ap);
+ }
+ if (expected_char++ != path[0] || path[1] != '\0')
+ abort ();
+ switch (path[0])
+ {
+ case 'a':
+ if (oflag != 0x43 || mode != 0644)
+ abort ();
+ break;
+ case 'b':
+ if (oflag != 0x3)
+ abort ();
+ break;
+ case 'c':
+ if (oflag != 0x2)
+ abort ();
+ break;
+ case 'd':
+ if (oflag != 0x43 || mode != 0600)
+ abort ();
+ break;
+ case 'e':
+ if (oflag != 0x3)
+ abort ();
+ break;
+ default:
+ abort ();
+ }
+ return 0;
+}
+
+extern inline __attribute__((always_inline, gnu_inline)) int
+myopen (const char *path, int oflag, ...)
+{
+ if (__builtin_va_arg_pack_len () > 1)
+ warn_open_too_many_arguments ();
+
+ if (__builtin_constant_p (oflag))
+ {
+ if ((oflag & 0x40) != 0 && __builtin_va_arg_pack_len () < 1)
+ {
+ error_open_missing_mode ();
+ return myopen2 (path, oflag);
+ }
+ return myopenva (path, oflag, __builtin_va_arg_pack ());
+ }
+
+ if (__builtin_va_arg_pack_len () < 1)
+ return myopen2 (path, oflag);
+
+ return myopenva (path, oflag, __builtin_va_arg_pack ());
+}
+
+volatile int l0;
+
+int
+main (void)
+{
+ expected_char = 'a';
+ if (myopen ("a", 0x43, 0644))
+ abort ();
+ if (myopen ("b", 0x3, 0755))
+ abort ();
+ if (myopen ("c", 0x2))
+ abort ();
+ if (myopen ("d", l0 + 0x43, 0600))
+ abort ();
+ if (myopen ("e", l0 + 0x3, 0700))
+ abort ();
+ if (myopen ("f", l0 + 0x2))
+ abort ();
+ /* Invalid use of myopen, but only detectable at runtime. */
+ if (myopen ("g", l0 + 0x43) != -6)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-len-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-len-2.c
new file mode 100644
index 000000000..c3fa856fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/va-arg-pack-len-2.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include <stdarg.h>
+
+extern int error_open_missing_mode (void)
+ __attribute__((__error__ ("open with O_CREAT needs 3 arguments, only 2 were given")));
+extern int warn_open_too_many_arguments (void)
+ __attribute__((__warning__ ("open called with more than 3 arguments")));
+
+extern int myopen2 (const char *path, int oflag);
+extern int myopenva (const char *path, int oflag, ...);
+
+extern inline __attribute__((always_inline, gnu_inline)) int
+myopen (const char *path, int oflag, ...)
+{
+ if (__builtin_va_arg_pack_len () > 1)
+ warn_open_too_many_arguments (); /* { dg-warning "called with more than 3" } */
+
+ if (__builtin_constant_p (oflag))
+ {
+ if ((oflag & 0x40) != 0 && __builtin_va_arg_pack_len () < 1)
+ {
+ error_open_missing_mode (); /* { dg-error "needs 3 arguments, only 2 were given" } */
+ return myopen2 (path, oflag);
+ }
+ return myopenva (path, oflag, __builtin_va_arg_pack ());
+ }
+
+ if (__builtin_va_arg_pack_len () < 1)
+ return myopen2 (path, oflag);
+
+ return myopenva (path, oflag, __builtin_va_arg_pack ());
+}
+
+int
+main (void)
+{
+ myopen ("h", 0x43);
+ myopen ("i", 0x43, 0644, 0655);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c b/gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c
new file mode 100644
index 000000000..a784ea1a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* We don't (and don't want to) perform this optimisation on soft-float
+ targets, where each addition is a library call. */
+/* { dg-require-effective-target hard_float } */
+/* { dg-options "-O2 -funroll-loops --fast-math -fvariable-expansion-in-unroller -fdump-rtl-loop2_unroll" } */
+
+extern void abort (void);
+
+float array[30] = { 1,2,3,4,5,6,7,8,9,10 };
+
+int foo (int n)
+{
+ unsigned i;
+ float accum = 1.0;
+
+ for (i = 0; i < n; i++)
+ accum += array[i];
+
+ return accum;
+}
+
+int main (void)
+{
+ return foo (10);
+}
+
+/* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" } } */
+/* { dg-final { cleanup-rtl-dump "loop*" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/var-expand2.c b/gcc-4.9/gcc/testsuite/gcc.dg/var-expand2.c
new file mode 100644
index 000000000..499de55cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/var-expand2.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller" } */
+
+extern void abort (void);
+
+float array[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+
+int
+foo (int n)
+{
+ unsigned i;
+ float accum = 0;
+
+ for (i = 0; i < n; i++)
+ accum += array[i];
+
+ if (accum != 55)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ return foo (10);
+}
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/var-expand3.c b/gcc-4.9/gcc/testsuite/gcc.dg/var-expand3.c
new file mode 100644
index 000000000..a9d0fe917
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/var-expand3.c
@@ -0,0 +1,58 @@
+/* { dg-do run { target { powerpc*-*-* && vmx_hw } } }} */
+/* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller -maltivec -fdump-rtl-loop2_unroll" } */
+
+#include "altivec.h"
+extern void abort (void);
+extern void exit (int);
+
+#define N 256
+
+float in1[N] __attribute__ ((__aligned__ (16))) = {0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57};
+float in2[N] __attribute__ ((__aligned__ (16))) = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
+
+float
+foo (int n)
+{
+ unsigned i;
+ vector float vp1, vp2, vp3, vaccum, vzero, vtmp;
+ float accum = 1.0;
+
+ vzero = (vector float){0, 0, 0, 0};
+
+ vaccum = vzero;
+
+ for (i = 0; i < n; i++)
+ {
+ vp1 = vec_ld (i * 16, in1);
+ vp2 = vec_ld (i * 16, in2);
+
+ vaccum = vec_madd (vp1, vp2, vaccum);
+
+ }
+ vtmp = vec_sld (vaccum, vaccum, 8);
+ vp1 = vec_add (vaccum, vtmp);
+ vtmp = vec_sld (vp1, vp1, 4);
+ vp2 = vec_add (vp1, vtmp);
+
+ vec_ste (vp2, 0, &accum);
+ if (accum != 1518)
+ return 0;
+
+ return accum;
+}
+
+int
+main (void)
+{
+ if (!foo (3))
+ abort ();
+
+ exit (0);
+}
+
+/* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" } } */
+/* { dg-final { cleanup-rtl-dump "loop*" } } */
+
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/varpool-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/varpool-1.c
new file mode 100644
index 000000000..48f1cd359
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/varpool-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "unnecesary_static_initialized_variable" } } */
+
+static int unnecesary_static_initialized_variable;
+static int *unnecesary_static_initialized_variable2 =
+ &unnecesary_static_initialized_variable;
+static inline
+simplify_after_inline (int param1, int *param2)
+{
+ if (unnecesary_static_initialized_variable != param1)
+ return unnecesary_static_initialized_variable;
+ if (unnecesary_static_initialized_variable2 != param2)
+ return unnecesary_static_initialized_variable;
+}
+
+main ()
+{
+ return simplify_after_inline (unnecesary_static_initialized_variable,
+ unnecesary_static_initialized_variable2) +
+ simplify_after_inline (unnecesary_static_initialized_variable,
+ unnecesary_static_initialized_variable2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O-pr46167.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O-pr46167.c
new file mode 100644
index 000000000..490ddd457
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O-pr46167.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+int foo (char c, int i)
+{
+ int s = 0;
+ while (i--)
+ s += c;
+ return s;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O1-pr33854.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O1-pr33854.c
new file mode 100644
index 000000000..4d4171fc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O1-pr33854.c
@@ -0,0 +1,22 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+/* { dg-do compile } */
+
+extern void *malloc (__SIZE_TYPE__ __size);
+typedef struct VMatrix_ VMatrix;
+struct VMatrix_
+{
+ int dim;
+ int t2;
+};
+void uniform_correlation_matrix (VMatrix * v)
+{
+ double *xbar = ((void *) 0);
+ int m = v->dim;
+ int i;
+ xbar = malloc (m * sizeof *xbar);
+ for (i = 0; i < m; i++)
+ xbar[i] /= m;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O1-pr41008.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O1-pr41008.c
new file mode 100644
index 000000000..bbdea127c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O1-pr41008.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+double heating[2][2];
+
+void foo (int, int);
+
+void map_do()
+{
+ int jsav, ksav, k, j;
+
+ for(k = 0; k < 2; k++)
+ for(j = 0; j < 2; j++)
+ if (heating[k][j] > 0.)
+ {
+ jsav = j;
+ ksav = k;
+ }
+
+ foo (jsav, ksav);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr36098.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr36098.c
new file mode 100644
index 000000000..b0b8e3c94
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr36098.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+typedef struct {
+ int iatom[3];
+ int blocknr;
+} t_sortblock;
+
+#define DIM 3
+
+void foo (int ncons, t_sortblock *sb, int *iatom)
+{
+ int i, m;
+
+ for(i=0; (i<ncons); i++,iatom+=3)
+ for(m=0; (m<DIM); m++)
+ iatom[m]=sb[i].iatom[m];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c
new file mode 100644
index 000000000..400ff2916
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 128
+
+int out[N*4], out2[N], in[N*4];
+
+void
+foo ()
+{
+ int i, a0, a1, a2, a3;
+
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*4];
+ a1 = in[i*4 + 1];
+ a2 = in[i*4 + 2];
+ a3 = in[i*4 + 3];
+
+ out[i*4] = a0;
+ out[i*4 + 1] = a1;
+ out[i*4 + 2] = a2;
+ out[i*4 + 3] = a3;
+
+ out2[i] = a0;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr41881.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr41881.c
new file mode 100644
index 000000000..7180b4c2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr41881.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+
+#define TYPE int
+
+TYPE fun1(TYPE *x, TYPE *y, unsigned int n)
+{
+ int i, j;
+ TYPE dot = 0;
+
+ for (i = 0; i < n; i++)
+ dot += *(x++) * *(y++);
+
+ return dot;
+}
+
+TYPE fun2(TYPE *x, TYPE *y, unsigned int n)
+{
+ int i, j;
+ TYPE dot = 0;
+
+ for (i = 0; i < n / 8; i++)
+ for (j = 0; j < 8; j++)
+ dot += *(x++) * *(y++);
+
+ return dot;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_int_mult && {! vect_no_align } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr45971.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr45971.c
new file mode 100644
index 000000000..1b7c65c80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr45971.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void
+foo (int *x, int *y)
+{
+ int i;
+ for (i = 0; i < 11; i++)
+ y[i] = (x[i] == 1) ? i + 1 : -(i + 1);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr46077.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr46077.c
new file mode 100644
index 000000000..6546f6e3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr46077.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void intf_pcmPlayEffect(int *src, int *dst, int size) {
+ int i;
+ for (i = 0; i < size; i++)
+ *dst++ = *src & 0x80 ? (*src++ & 0x7f) : -*src++;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr49087.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr49087.c
new file mode 100644
index 000000000..c897fbcd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-pr49087.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+
+static char func2() { }
+
+struct S0
+{
+ int t;
+};
+
+int g;
+
+struct S0 s0;
+
+int
+foo (int arg)
+{
+ int *ptr = &g;
+ int i, j;
+ for (i = 0; i < 10; i += 1)
+ {
+ for (j = 0; j < 1; j += 1)
+ {
+ int k;
+ if (arg)
+ {
+ int l;
+ for (k = 1; arg < 10; arg = func2 ())
+ {
+ return l;
+ }
+ }
+ *ptr = func2 () ^ s0.t;
+ }
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c
new file mode 100644
index 000000000..a35d90b3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-slp-reduc-10.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+#define TYPE int
+#define RESULT 755918
+
+__attribute__ ((noinline)) TYPE fun2 (TYPE *x, TYPE *y, unsigned int n)
+{
+ int i, j;
+ TYPE dot = 14;
+
+ for (i = 0; i < n / 2; i++)
+ for (j = 0; j < 2; j++)
+ dot += *(x++) * *(y++);
+
+ return dot;
+}
+
+int main (void)
+{
+ TYPE a[N], b[N], dot;
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i+8;
+ }
+
+ dot = fun2 (a, b, N);
+ if (dot != RESULT)
+ abort();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_int_mult && {! vect_no_align } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-vect-pr32243.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-vect-pr32243.c
new file mode 100644
index 000000000..0116c33fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-vect-pr32243.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+typedef struct __GLcontextRec GLcontext;
+
+struct gl_renderbuffer
+{
+ struct gl_renderbuffer *Wrapped;
+ void (*PutValues) (GLcontext * ctx, struct gl_renderbuffer * rb,
+ int count, const int x[], const int y[],
+ const void *values, const char *mask);
+};
+
+void
+put_mono_values_s8 (GLcontext * ctx, struct gl_renderbuffer *s8rb,
+ int count, const int x[], const int y[],
+ const void *value, const char *mask)
+{
+ struct gl_renderbuffer *dsrb = s8rb->Wrapped;
+ int temp[4096], i;
+ const char val = *((char *) value);
+ for (i = 0; i < count; i++)
+ if (!mask || mask[i])
+ temp[i] = (temp[i] & 0xffffff) | val;
+ dsrb->PutValues (ctx, dsrb, count, x, y, temp, mask);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c
new file mode 100644
index 000000000..5dd776c3e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c
@@ -0,0 +1,33 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define M 10
+#define N 3
+
+void __attribute__((noinline))
+foo (int n, int *ub, int *uc)
+{
+ int i, j, tmp1;
+
+ for (i = 0; i < n; i++)
+ {
+ tmp1 = 0;
+ for (j = 0; j < M; j++)
+ {
+ tmp1 += uc[i] * ((int)(j << N) / M);
+ }
+ ub[i] = tmp1;
+ }
+}
+
+int main()
+{
+ int uc[16], ub[16];
+ check_vect ();
+ foo (16, uc, ub);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/Os-vect-95.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/Os-vect-95.c
new file mode 100644
index 000000000..8f6e53a6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/Os-vect-95.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+void bar (float *pd, float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ if (pd[i] != 5.0)
+ abort ();
+ }
+
+ return;
+}
+
+
+int
+main1 (int n, float * __restrict__ pd, float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ pd[i] = 5.0;
+ }
+
+ bar (pd,pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float d[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (N,&d[1],a,b,c);
+ main1 (N-2,&d[1],a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-nest-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-nest-1.c
new file mode 100644
index 000000000..670e45491
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/aligned-section-anchors-nest-1.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target section_anchors } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+static int a[N][N];
+static int b[N][N];
+static int c[N][N];
+
+void clobber(int *);
+
+int *foo(void)
+{
+ int i;
+ int j;
+
+ clobber (&a[0][0]);
+ clobber (&b[0][0]);
+ clobber (&c[0][0]);
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ c[j][i] += a[j][i] + c[j][i];
+ }
+ }
+ return &c[0][0];
+}
+
+/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 3 "increase_alignment" } } */
+/* { dg-final { cleanup-ipa-dump "increase_alignment" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-1.c
new file mode 100644
index 000000000..1caa3cf5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-1.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned int out[N*8];
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 (int dummy)
+{
+ int i;
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[0];
+
+ for (i = 0; i < N; i++)
+ {
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ /* Avoid loop vectorization. */
+ if (dummy == 32)
+ abort ();
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8]
+ || out[i*8 + 1] != in[i*8 + 1]
+ || out[i*8 + 2] != in[i*8 + 2]
+ || out[i*8 + 3] != in[i*8 + 3]
+ || out[i*8 + 4] != in[i*8 + 4]
+ || out[i*8 + 5] != in[i*8 + 5]
+ || out[i*8 + 6] != in[i*8 + 6]
+ || out[i*8 + 7] != in[i*8 + 7])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (33);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-10.c
new file mode 100644
index 000000000..658bf03ca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-10.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[1];
+ unsigned int a0, a1, a2, a3;
+
+ /* Misaligned store. */
+ a0 = *pin++ + 23;
+ a1 = *pin++ + 142;
+ a2 = *pin++ + 2;
+ a3 = *pin++ + 31;
+
+ *pout++ = a0 * x;
+ *pout++ = a1 * y;
+ *pout++ = a2 * x;
+ *pout++ = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[1] != (in[0] + 23) * x
+ || out[2] != (in[1] + 142) * y
+ || out[3] != (in[2] + 2) * x
+ || out[4] != (in[3] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "unsupported alignment in basic block." 1 "slp" { xfail vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-11.c
new file mode 100644
index 000000000..3c350a7ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-11.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[0];
+ short a0, a1, a2, a3;
+
+ a0 = *pin++ + 23;
+ a1 = *pin++ + 142;
+ a2 = *pin++ + 2;
+ a3 = *pin++ + 31;
+
+ *pout++ = a0 * x;
+ *pout++ = a1 * y;
+ *pout++ = a2 * x;
+ *pout++ = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect64 } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-13.c
new file mode 100644
index 000000000..88838cea9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-13.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[2] + 2;
+ a3 = in[3] + 31;
+
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-14.c
new file mode 100644
index 000000000..d46deadd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-14.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ /* Not consecutive load with permutation - not supported. */
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[1] + 2;
+ a3 = in[3] + 31;
+
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[1] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 0 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-15.c
new file mode 100644
index 000000000..fd065e6ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-15.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ if (x > y)
+ x = x + y;
+ else
+ y = x;
+
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[2] + 2;
+ a3 = in[3] + 31;
+
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-16.c
new file mode 100644
index 000000000..0cbec65b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-16.c
@@ -0,0 +1,70 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned int out[N*8];
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int arr[N] = {0,1,2,3,4,5,6,7};
+
+__attribute__ ((noinline)) int
+main1 (int dummy)
+{
+ int i;
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[0];
+ unsigned int a = 0;
+
+ for (i = 0; i < N; i++)
+ {
+ *pout++ = *pin++ + a;
+ *pout++ = *pin++ + a;
+ *pout++ = *pin++ + a;
+ *pout++ = *pin++ + a;
+ *pout++ = *pin++ + a;
+ *pout++ = *pin++ + a;
+ *pout++ = *pin++ + a;
+ *pout++ = *pin++ + a;
+ if (arr[i] = i)
+ a = i;
+ else
+ a = 2;
+ }
+
+ a = 0;
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8] + a
+ || out[i*8 + 1] != in[i*8 + 1] + a
+ || out[i*8 + 2] != in[i*8 + 2] + a
+ || out[i*8 + 3] != in[i*8 + 3] + a
+ || out[i*8 + 4] != in[i*8 + 4] + a
+ || out[i*8 + 5] != in[i*8 + 5] + a
+ || out[i*8 + 6] != in[i*8 + 6] + a
+ || out[i*8 + 7] != in[i*8 + 7] + a)
+ abort ();
+
+ if (arr[i] = i)
+ a = i;
+ else
+ a = 2;
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (33);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-17.c
new file mode 100644
index 000000000..3f14ff487
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-17.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int b[N];
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ if (x > y)
+ x = x + y;
+ else
+ y = x;
+
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[2] + 2;
+ a3 = in[3] + 31;
+
+ b[0] = a0;
+ b[1] = a1;
+
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y
+ || b[0] != in[0] + 23
+ || b[1] != in[1] + 142)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-18.c
new file mode 100644
index 000000000..7d73dbd8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-18.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[2] + 2;
+ a3 = in[3] + 31;
+
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != a0 * x
+ || out[1] != a1 * y
+ || out[2] != a2 * x
+ || out[3] != a3 * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-19.c
new file mode 100644
index 000000000..576bbc169
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-19.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned short out[N];
+unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+int i;
+__attribute__ ((noinline)) int
+main1 ()
+{
+ unsigned short *pin = &in[0];
+ unsigned short *pout = &out[0];
+
+ /* A group of 9 shorts - unsupported for now. */
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+
+ if (i)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != in[0]
+ || out[1] != in[1]
+ || out[2] != in[2]
+ || out[3] != in[3]
+ || out[4] != in[4]
+ || out[5] != in[5]
+ || out[6] != in[6]
+ || out[7] != in[7]
+ || out[8] != in[8])
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-2.c
new file mode 100644
index 000000000..accc472f7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-2.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N*8];
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 (int dummy)
+{
+ int i;
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[0];
+
+ for (i = 0; i < N*2; i++)
+ {
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+
+ /* Avoid loop vectorization. */
+ if (dummy)
+ __asm__ volatile ("" : : : "memory");
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8]
+ || out[i*8 + 1] != in[i*8 + 1]
+ || out[i*8 + 2] != in[i*8 + 2]
+ || out[i*8 + 3] != in[i*8 + 3]
+ || out[i*8 + 4] != in[i*8 + 4]
+ || out[i*8 + 5] != in[i*8 + 5]
+ || out[i*8 + 6] != in[i*8 + 6]
+ || out[i*8 + 7] != in[i*8 + 7])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (33);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-20.c
new file mode 100644
index 000000000..a7978a70d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-20.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int b[N];
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ if (x > y)
+ x = x + y;
+ else
+ y = x;
+
+ /* Two SLP instances in the basic block. */
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[2] + 2;
+ a3 = in[3] + 31;
+
+ b[0] = -a0;
+ b[1] = -a1;
+ b[2] = -a2;
+ b[3] = -a3;
+
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y
+ || b[0] != -(in[0] + 23)
+ || b[1] != -(in[1] + 142)
+ || b[2] != -(in[2] + 2)
+ || b[3] != -(in[3] + 31))
+
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-21.c
new file mode 100644
index 000000000..8ad71454a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-21.c
@@ -0,0 +1,70 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int b[N];
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ /* Two SLP instances in one basic block. */
+ if (x > y)
+ x = x + y;
+ else
+ y = x;
+
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[2] + 2;
+ a3 = in[3] + 31;
+
+ b[0] = a0;
+ b[1] = a1;
+ b[2] = a2;
+ b[3] = a3;
+
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y
+ || b[0] != (in[0] + 23)
+ || b[1] != (in[1] + 142)
+ || b[2] != (in[2] + 2)
+ || b[3] != (in[3] + 31))
+
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "slp" { target { ! {vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-22.c
new file mode 100644
index 000000000..e425dc9ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-22.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int b[N];
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[2] + 2;
+ a3 = in[3] + 31;
+
+ if (x > y)
+ {
+ b[0] = a0;
+ b[1] = a1;
+ b[2] = a2;
+ b[3] = a3;
+ }
+ else
+ {
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+ }
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if ((x <= y
+ && (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y))
+ || (x > y
+ && (b[0] != (in[0] + 23)
+ || b[1] != (in[1] + 142)
+ || b[2] != (in[2] + 2)
+ || b[3] != (in[3] + 31))))
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target { ! {vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 2 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-23.c
new file mode 100644
index 000000000..35f5186fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-23.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+int a[N], b[N];
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ /* This statement is ignored in vectorization of this basic block. */
+ a[x] = b [y];
+
+ a0 = in[0] + 23;
+ a1 = in[1] + 142;
+ a2 = in[2] + 2;
+ a3 = in[3] + 31;
+
+ out[0] = a0 * x;
+ out[1] = a1 * y;
+ out[2] = a2 * x;
+ out[3] = a3 * y;
+
+ if (x)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-24.c
new file mode 100644
index 000000000..d0c1d69d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-24.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 3
+#define N 256
+
+short src[N], dst[N];
+
+void foo (short * __restrict__ dst, short * __restrict__ src, int h,
+ int stride, int dummy)
+{
+ int i;
+ h /= 8;
+ for (i = 0; i < h; i++)
+ {
+ dst[0] += A*src[0];
+ dst[1] += A*src[1];
+ dst[2] += A*src[2];
+ dst[3] += A*src[3];
+ dst[4] += A*src[4];
+ dst[5] += A*src[5];
+ dst[6] += A*src[6];
+ dst[7] += A*src[7];
+ dst += stride;
+ src += stride;
+ if (dummy == 32)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 0;
+ src[i] = i;
+ }
+
+ foo (dst, src, N, 8, 0);
+
+ for (i = 0; i < N; i++)
+ {
+ if (dst[i] != A * i)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-25.c
new file mode 100644
index 000000000..737b3b06c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-25.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 3
+#define B 4
+#define N 256
+
+short src[N], dst[N];
+
+void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy)
+{
+ int i;
+ h /= 16;
+ for (i = 0; i < h; i++)
+ {
+ dst[0] += A*src[0] + src[stride];
+ dst[1] += A*src[1] + src[1+stride];
+ dst[2] += A*src[2] + src[2+stride];
+ dst[3] += A*src[3] + src[3+stride];
+ dst[4] += A*src[4] + src[4+stride];
+ dst[5] += A*src[5] + src[5+stride];
+ dst[6] += A*src[6] + src[6+stride];
+ dst[7] += A*src[7] + src[7+stride];
+ dst += 8;
+ src += 8;
+ if (dummy == 32)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 0;
+ src[i] = i;
+ }
+
+ foo (dst, src, N, 8, 0);
+
+ for (i = 0; i < N/2; i++)
+ {
+ if (dst[i] != A * i + i + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-26.c
new file mode 100644
index 000000000..881f3204f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-26.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 3
+#define B 4
+#define N 256
+
+char src[N], dst[N];
+
+void foo (char * __restrict__ dst, char * __restrict__ src, int h,
+ int stride, int dummy)
+{
+ int i;
+ h /= 16;
+ for (i = 0; i < h; i++)
+ {
+ dst[0] += A*src[0] + src[stride];
+ dst[1] += A*src[1] + src[1+stride];
+ dst[2] += A*src[2] + src[2+stride];
+ dst[3] += A*src[3] + src[3+stride];
+ dst[4] += A*src[4] + src[4+stride];
+ dst[5] += A*src[5] + src[5+stride];
+ dst[6] += A*src[6] + src[6+stride];
+ dst[7] += A*src[7] + src[7+stride];
+ dst += 8;
+ src += 8;
+ if (dummy == 32)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 0;
+ src[i] = i/8;
+ }
+
+ foo (dst, src, N, 8, 0);
+
+ for (i = 0; i < N/2; i++)
+ {
+ if (dst[i] != A * src[i] + src[i+8])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect64 } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-27.c
new file mode 100644
index 000000000..7fcc1e610
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-27.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 3
+#define N 16
+
+short src[N], dst[N];
+
+void foo (int a)
+{
+ dst[0] += a*src[0];
+ dst[1] += a*src[1];
+ dst[2] += a*src[2];
+ dst[3] += a*src[3];
+ dst[4] += a*src[4];
+ dst[5] += a*src[5];
+ dst[6] += a*src[6];
+ dst[7] += a*src[7];
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 0;
+ src[i] = i;
+ }
+
+ foo (A);
+
+ for (i = 0; i < 8; i++)
+ {
+ if (dst[i] != A * i)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target { vect_int_mult && { vect_unpack && vect_pack_trunc } } } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-28.c
new file mode 100644
index 000000000..650c50eb9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-28.c
@@ -0,0 +1,71 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 300
+#define N 16
+
+char src[N];
+short dst[N];
+short src1[N], dst1[N];
+
+void foo (int a)
+{
+ dst[0] = (short) (a * (int) src[0]);
+ dst[1] = (short) (a * (int) src[1]);
+ dst[2] = (short) (a * (int) src[2]);
+ dst[3] = (short) (a * (int) src[3]);
+ dst[4] = (short) (a * (int) src[4]);
+ dst[5] = (short) (a * (int) src[5]);
+ dst[6] = (short) (a * (int) src[6]);
+ dst[7] = (short) (a * (int) src[7]);
+ dst[8] = (short) (a * (int) src[8]);
+ dst[9] = (short) (a * (int) src[9]);
+ dst[10] = (short) (a * (int) src[10]);
+ dst[11] = (short) (a * (int) src[11]);
+ dst[12] = (short) (a * (int) src[12]);
+ dst[13] = (short) (a * (int) src[13]);
+ dst[14] = (short) (a * (int) src[14]);
+ dst[15] = (short) (a * (int) src[15]);
+
+ dst1[0] += src1[0];
+ dst1[1] += src1[1];
+ dst1[2] += src1[2];
+ dst1[3] += src1[3];
+ dst1[4] += src1[4];
+ dst1[5] += src1[5];
+ dst1[6] += src1[6];
+ dst1[7] += src1[7];
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 2;
+ dst1[i] = 0;
+ src[i] = i;
+ src1[i] = i+2;
+ }
+
+ foo (A);
+
+ for (i = 0; i < N; i++)
+ {
+ if (dst[i] != A * i
+ || (i < N/2 && dst1[i] != i + 2))
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target { vect_int_mult && { vect_pack_trunc && vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-29.c
new file mode 100644
index 000000000..c5b31343a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-29.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define A 3
+#define B 4
+#define N 256
+
+short src[N], dst[N];
+
+void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy)
+{
+ int i;
+ h /= 16;
+ for (i = 0; i < h; i++)
+ {
+ dst[0] = A*src[0] + B*src[1];
+ dst[1] = A*src[1] + B*src[2];
+ dst[2] = A*src[2] + B*src[3];
+ dst[3] = A*src[3] + B*src[4];
+ dst[4] = A*src[4] + B*src[5];
+ dst[5] = A*src[5] + B*src[6];
+ dst[6] = A*src[6] + B*src[7];
+ dst[7] = A*src[7] + B*src[8];
+ dst += stride;
+ src += stride;
+ if (dummy == 32)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ dst[i] = 0;
+ src[i] = i;
+ }
+
+ foo (dst, src, N, 8, 0);
+
+ for (i = 0; i < N/2; i++)
+ {
+ if (dst[i] != A * src[i] + B * src[i+1])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target { vect_int_mult && vect_element_align } } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-3.c
new file mode 100644
index 000000000..093389faf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-3.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+int i;
+__attribute__ ((noinline)) int
+main1 ()
+{
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[0];
+
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+
+ if (i)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != in[0]
+ || out[1] != in[1]
+ || out[2] != in[2]
+ || out[3] != in[3])
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-30.c
new file mode 100644
index 000000000..86da55a47
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-30.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+int a[32];
+
+void __attribute__((noinline))
+test1(void)
+{
+ a[0] = 1;
+ a[1] = 1;
+ a[2] = 1;
+ a[3] = 1;
+ a[4] = 1;
+ a[5] = 1;
+ a[6] = 1;
+ a[7] = 1;
+ a[8] = 1;
+ a[9] = 1;
+ a[10] = 1;
+ a[11] = 1;
+ a[12] = 1;
+ a[13] = 1;
+ a[14] = 1;
+ a[15] = 1;
+ a[16] = 1;
+ a[17] = 1;
+ a[18] = 1;
+ a[19] = 1;
+ a[20] = 1;
+ a[21] = 1;
+ a[22] = 1;
+ a[23] = 1;
+ a[24] = 1;
+ a[25] = 1;
+ a[26] = 1;
+ a[27] = 1;
+ a[28] = 1;
+ a[29] = 1;
+ a[30] = 1;
+ a[31] = 1;
+ asm ("" : : : "memory");
+ a[21] = 0;
+}
+
+int main() { test1(); return a[21]; }
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-31.c
new file mode 100644
index 000000000..7ea341216
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-31.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+
+typedef double vec __attribute__ ((vector_size (2 * sizeof (double))));
+vec a;
+
+void f(){
+ a[0]=1+2*a[0]*a[0];
+ a[1]=1+2*a[1]*a[1];
+}
+
+/* { dg-final { scan-tree-dump "basic block vectorized" "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
new file mode 100644
index 000000000..6d69d15c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-32.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "-fvect-cost-model=dynamic" } */
+
+void bar (int *);
+int foo (int *p)
+{
+ int x[4];
+ int tem0, tem1, tem2, tem3;
+ tem0 = p[0] + 1;
+ x[0] = tem0;
+ tem1 = p[1] + 2;
+ x[1] = tem1;
+ tem2 = p[2] + 3;
+ x[2] = tem2;
+ tem3 = p[3] + 4;
+ x[3] = tem3;
+ bar (x);
+ return tem0 + tem1 + tem2 + tem3;
+}
+
+/* { dg-final { scan-tree-dump "vectorization is not profitable" "slp" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-4.c
new file mode 100644
index 000000000..2c4b62dc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-4.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned short out[N];
+unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+int i;
+__attribute__ ((noinline)) int
+main1 ()
+{
+ unsigned short *pin = &in[0];
+ unsigned short *pout = &out[0];
+
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+
+ if (i)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != in[0]
+ || out[1] != in[1])
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 0 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-5.c
new file mode 100644
index 000000000..ca093e795
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-5.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned short out[N];
+unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned short *pin = &in[0];
+ unsigned short *pout = &out[0];
+
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+
+ /* Check results. */
+ if (out[0] != in[0]
+ || out[1] != in[1]
+ || out[2] != in[2]
+ || out[3] != in[3]
+ || out[4] != in[4]
+ || out[5] != in[5]
+ || out[6] != in[6]
+ || out[7] != in[7])
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-6.c
new file mode 100644
index 000000000..c233a9d50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-6.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[0];
+ unsigned int a0, a1, a2, a3;
+
+ a0 = *pin++ + 23;
+ a1 = *pin++ + 142;
+ a2 = *pin++ + 2;
+ a3 = *pin++ + 31;
+
+ *pout++ = a0 * x;
+ *pout++ = a1 * y;
+ *pout++ = a2 * x;
+ *pout++ = a3 * y;
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-7.c
new file mode 100644
index 000000000..b7b90f0b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-7.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[0];
+ unsigned int a0, a1, a2, a3;
+
+ /* Non isomorphic. */
+ a0 = *pin++ + 23;
+ a1 = *pin++ + 142;
+ a2 = *pin++ + 2;
+ a3 = *pin++ * 31;
+
+ *pout++ = a0 * x;
+ *pout++ = a1 * y;
+ *pout++ = a2 * x;
+ *pout++ = a3 * y;
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] * 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 0 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8.c
new file mode 100644
index 000000000..303fe3e43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y, unsigned int *pin, unsigned int *pout)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ /* pin and pout may alias. But since all the loads are before the first
+ store the basic block is vectorizable. */
+ a0 = *pin++ + 23;
+ a1 = *pin++ + 142;
+ a2 = *pin++ + 2;
+ a3 = *pin++ + 31;
+
+ *pout++ = a0 * x;
+ *pout++ = a1 * y;
+ *pout++ = a2 * x;
+ *pout++ = a3 * y;
+
+ if (i)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3, &in[0], &out[0]);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_hw_misalign } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8a.c
new file mode 100644
index 000000000..55a6a81d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8a.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y, unsigned int *pin, unsigned int *pout)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+
+ /* pin and pout may alias, and loads and stores are mixed. The basic block
+ cannot be vectorized. */
+ a0 = *pin++ + 23;
+ *pout++ = a0 * x;
+ a1 = *pin++ + 142;
+ *pout++ = a1 * y;
+ a2 = *pin++ + 2;
+ *pout++ = a2 * x;
+ a3 = *pin++ + 31;
+ *pout++ = a3 * y;
+
+ if (i)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3, &in[0], &out[0]);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 0 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8b.c
new file mode 100644
index 000000000..8c5c5ab91
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-8b.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int a0, a1, a2, a3;
+ unsigned int *pin = &in[0];
+ unsigned int *pout = &out[0];
+
+ /* pin and pout are different, so despite the fact that loads and stores
+ are mixed the basic block is vectorizable. */
+ a0 = *pin++ + 23;
+ *pout++ = a0 * x;
+ a1 = *pin++ + 142;
+ *pout++ = a1 * y;
+ a2 = *pin++ + 2;
+ *pout++ = a2 * x;
+ a3 = *pin++ + 31;
+ *pout++ = a3 * y;
+
+ if (i)
+ __asm__ volatile ("" : : : "memory");
+
+ /* Check results. */
+ if (out[0] != (in[0] + 23) * x
+ || out[1] != (in[1] + 142) * y
+ || out[2] != (in[2] + 2) * x
+ || out[3] != (in[3] + 31) * y)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_hw_misalign } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-9.c
new file mode 100644
index 000000000..9f1a5877a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-9.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int *pin = &in[1];
+ unsigned int *pout = &out[0];
+ unsigned int a0, a1, a2, a3;
+
+ /* Misaligned load. */
+ a0 = *pin++ + 23;
+ a1 = *pin++ + 142;
+ a2 = *pin++ + 2;
+ a3 = *pin++ + 31;
+
+ *pout++ = a0 * x;
+ *pout++ = a1 * y;
+ *pout++ = a2 * x;
+ *pout++ = a3 * y;
+
+ /* Check results. */
+ if (out[0] != (in[1] + 23) * x
+ || out[1] != (in[2] + 142) * y
+ || out[2] != (in[3] + 2) * x
+ || out[3] != (in[4] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
new file mode 100644
index 000000000..86376b446
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__((noinline, noclone)) void
+foo (int *a, int stride)
+{
+ int i;
+
+ for (i = 0; i < N/stride; i++, a += stride)
+ {
+ a[0] = a[0] ? 1 : 5;
+ a[1] = a[1] ? 2 : 6;
+ a[2] = a[2] ? 3 : 7;
+ a[3] = a[3] ? 4 : 8;
+ }
+}
+
+
+int a[N];
+int main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ a[i] = i;
+
+ foo (a, 4);
+
+ for (i = 1; i < N; i++)
+ if (a[i] != i%4 + 1)
+ abort ();
+
+ if (a[0] != 5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_element_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-1.c
new file mode 100644
index 000000000..ff520c06f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-1.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned short X[N];
+unsigned short Y[N];
+unsigned int result[N];
+
+/* unsigned short->unsigned int widening-mult. */
+__attribute__ ((noinline, noclone)) void
+foo (void)
+{
+ result[0] = (unsigned int) (X[0] * Y[0]);
+ result[1] = (unsigned int) (X[1] * Y[1]);
+ result[2] = (unsigned int) (X[2] * Y[2]);
+ result[3] = (unsigned int) (X[3] * Y[3]);
+ result[4] = (unsigned int) (X[4] * Y[4]);
+ result[5] = (unsigned int) (X[5] * Y[5]);
+ result[6] = (unsigned int) (X[6] * Y[6]);
+ result[7] = (unsigned int) (X[7] * Y[7]);
+}
+
+int main (void)
+{
+ int i, tmp;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ X[i] = i;
+ Y[i] = 64-i;
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++)
+ {
+ __asm__ volatile ("");
+ tmp = X[i] * Y[i];
+ if (result[i] != tmp)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "slp" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 8 "slp" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { scan-tree-dump-times "pattern recognized" 8 "slp" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c
new file mode 100644
index 000000000..545c08d86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/bb-slp-pattern-2.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__((noinline, noclone)) void
+foo (short * __restrict__ a, int * __restrict__ b, int stride)
+{
+ int i;
+
+ for (i = 0; i < N/stride; i++, a += stride, b += stride)
+ {
+ a[0] = b[0] ? 1 : 7;
+ a[1] = b[1] ? 2 : 0;
+ a[2] = b[2] ? 3 : 0;
+ a[3] = b[3] ? 4 : 0;
+ a[4] = b[4] ? 5 : 0;
+ a[5] = b[5] ? 6 : 0;
+ a[6] = b[6] ? 7 : 0;
+ a[7] = b[7] ? 8 : 0;
+ }
+}
+
+short a[N];
+int b[N];
+int main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = -i;
+ }
+
+ foo (a, b, 8);
+
+ for (i = 1; i < N; i++)
+ if (a[i] != i%8 + 1)
+ abort ();
+
+ if (a[0] != 7)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target { vect_element_align && vect_pack_trunc } } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
new file mode 100644
index 000000000..d5c0a1a13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdlib.h>
+#include "../../tree-vect.h"
+
+__attribute__ ((noinline)) void
+interp_pitch(float *exc, float *interp, int pitch, int len)
+{
+ int i,k;
+ int maxj;
+
+ maxj=3;
+ for (i=0;i<len;i++)
+ {
+ float tmp = 0;
+ for (k=0;k<12;k++)
+ {
+ tmp += exc[i-pitch+k+maxj-6];
+ }
+ interp[i] = tmp;
+ }
+}
+
+int main()
+{
+ float *exc = calloc(136,sizeof(float));
+ float *interp = calloc(80,sizeof(float));
+ int pitch = -35;
+
+ check_vect ();
+
+ interp_pitch(exc, interp, pitch, 80);
+ free(exc);
+ free(interp);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
new file mode 100644
index 000000000..137267619
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
@@ -0,0 +1,91 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+struct s tmp = { 1 };
+
+int main1 ()
+{
+ int i;
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.b[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.b[i] != 5)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.c[i] = 6;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.c[i] != 6)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.d.k[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.d.k[i] != 7)
+ abort ();
+ }
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.e.k[i] = 8;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.e.k[i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
new file mode 100644
index 000000000..5676b2470
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+struct test {
+ char ca[N];
+};
+
+extern struct test s;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-68.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-68.c
new file mode 100644
index 000000000..b916cd91d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-68.c
@@ -0,0 +1,88 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 1. unaligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.a.n[1][2][i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 5)
+ abort ();
+ }
+
+ /* 2. aligned */
+ for (i = 3; i < N-1; i++)
+ {
+ tmp1.a.n[1][2][i] = 6;
+ }
+
+ /* check results: */
+ for (i = 3; i < N-1; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 6)
+ abort ();
+ }
+
+ /* 3. aligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.e.n[1][2][i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 7)
+ abort ();
+ }
+
+ /* 4. unaligned */
+ for (i = 3; i < N-3; i++)
+ {
+ tmp1.e.n[1][2][i] = 8;
+ }
+
+ /* check results: */
+ for (i = 3; i <N-3; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c
new file mode 100644
index 000000000..a7b86cebd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
+{
+ int i;
+ unsigned char udiff = 2;
+ unsigned char umax = x;
+ unsigned char umin = x;
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned char)(ub[i] - uc[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp
new file mode 100644
index 000000000..80c6d299c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/i386/i386-costmodel-vect.exp
@@ -0,0 +1,74 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Exit immediately if this isn't a x86 target.
+if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then {
+ return
+}
+
+# Set up flags used for tests that don't specify options.
+set DEFAULT_VECTCFLAGS ""
+
+# These flags are used for all targets.
+lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=dynamic"
+
+# If the target system supports vector instructions, the default action
+# for a test is 'run', otherwise it's 'compile'. Save current default.
+# Executing vector instructions on a system without hardware vector support
+# is also disabled by a call to check_vect, but disabling execution here is
+# more efficient.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+
+if { ![check_effective_target_sse2] } then {
+ return
+}
+lappend DEFAULT_VECTCFLAGS "-msse2"
+if [check_sse2_hw_available] {
+ set dg-do-what-default run
+} else {
+ set dg-do-what-default compile
+}
+
+# Initialize `dg'.
+dg-init
+
+lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-vect-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+#### Tests with special options
+global SAVED_DEFAULT_VECTCFLAGS
+set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
+
+# -ffast-math tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-ffast-math"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-fast-math-vect*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c
new file mode 100644
index 000000000..4e8d71b96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int *pin = &in[1];
+ unsigned int *pout = &out[0];
+ unsigned int a0, a1, a2, a3;
+
+ /* Misaligned load. */
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+ *pout++ = *pin++;
+
+ /* Check results. */
+ if (out[0] != in[1]
+ || out[1] != in[2]
+ || out[2] != in[3]
+ || out[3] != in[4])
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-fast-math-vect-pr29925.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-fast-math-vect-pr29925.c
new file mode 100644
index 000000000..00e631b13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-fast-math-vect-pr29925.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdlib.h>
+#include "../../tree-vect.h"
+
+__attribute__ ((noinline)) void
+interp_pitch(float *exc, float *interp, int pitch, int len)
+{
+ int i,k;
+ int maxj;
+
+ maxj=3;
+ for (i=0;i<len;i++)
+ {
+ float tmp = 0;
+ for (k=0;k<7;k++)
+ {
+ tmp += exc[i-pitch+k+maxj-6];
+ }
+ interp[i] = tmp;
+ }
+}
+
+int main()
+{
+ float *exc = calloc(126,sizeof(float));
+ float *interp = calloc(80,sizeof(float));
+ int pitch = -35;
+
+ check_vect ();
+
+ interp_pitch(exc, interp, pitch, 80);
+ free(exc);
+ free(interp);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c
new file mode 100644
index 000000000..76c7850fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c
@@ -0,0 +1,28 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-do compile } */
+
+#include <stdlib.h>
+#include "../../tree-vect.h"
+
+__attribute__ ((noinline)) void
+ggSpectrum_Set8(float * data, float d)
+{
+ int i;
+
+ for (i = 0; i < 8; i++)
+ data[i] = d;
+}
+
+__attribute__ ((noinline)) void
+ggSpectrum_Set20(float * data, float d)
+{
+ int i;
+
+ for (i = 0; i < 20; i++)
+ data[i] = d;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c
new file mode 100644
index 000000000..d9adf6f33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-12.c
@@ -0,0 +1,119 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ float out2[N*8], fa[N*4];
+ unsigned int ia[N], ib[N*2];
+
+ for (i = 0; i < N; i++)
+ {
+
+ a0 = in[i*8] + 5;
+ a1 = in[i*8 + 1] + 6;
+ a2 = in[i*8 + 2] + 7;
+ a3 = in[i*8 + 3] + 8;
+ a4 = in[i*8 + 4] + 9;
+ a5 = in[i*8 + 5] + 10;
+ a6 = in[i*8 + 6] + 11;
+ a7 = in[i*8 + 7] + 12;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+ b2 = a2 * 12;
+ b3 = a3 * 5;
+ b4 = a4 * 8;
+ b5 = a5 * 4;
+ b6 = a6 * 3;
+ b7 = a7 * 2;
+
+ out[i*8] = b0 - 2;
+ out[i*8 + 1] = b1 - 3;
+ out[i*8 + 2] = b2 - 2;
+ out[i*8 + 3] = b3 - 1;
+ out[i*8 + 4] = b4 - 8;
+ out[i*8 + 5] = b5 - 7;
+ out[i*8 + 6] = b6 - 3;
+ out[i*8 + 7] = b7 - 7;
+
+ ia[i] = b6;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (in[i*8] + 5) * 3 - 2
+ || out[i*8 + 1] != (in[i*8 + 1] + 6) * 2 - 3
+ || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
+ || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
+ || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
+ || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
+ || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
+ || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7
+ || ia[i] != (in[i*8 + 6] + 11) * 3)
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = (in[i*4] + 2) * 3;
+ out[i*4 + 1] = (in[i*4 + 1] + 2) * 7;
+ out[i*4 + 2] = (in[i*4 + 2] + 7) * 3;
+ out[i*4 + 3] = (in[i*4 + 3] + 7) * 7;
+
+ ib[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != (in[i*4] + 2) * 3
+ || out[i*4 + 1] != (in[i*4 + 1] + 2) * 7
+ || out[i*4 + 2] != (in[i*4 + 2] + 7) * 3
+ || out[i*4 + 3] != (in[i*4 + 3] + 7) * 7
+ || ib[i] != 7)
+ abort ();
+ }
+
+ for (i = 0; i < N*4; i++)
+ {
+ out2[i*2] = (float) (in[i*2] * 2 + 11) ;
+ out2[i*2 + 1] = (float) (in[i*2 + 1] * 3 + 7);
+
+ fa[i] = (float) in[i*2+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out2[i*2] != (float) (in[i*2] * 2 + 11)
+ || out2[i*2 + 1] != (float) (in[i*2 + 1] * 3 + 7)
+ || fa[i] != (float) in[i*2+1])
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target { vect_strided8 && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target { vect_strided8 && vect_int_mult } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c
new file mode 100644
index 000000000..9cae12fdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-33.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ short a; /* aligned */
+ char b[N-1]; /* unaligned (offset 2B) */
+};
+
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* unaligned */
+ for (i = 0; i < N/4; i++)
+ {
+ tmp.b[2*i] = 5;
+ tmp.b[2*i+1] = 15;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/4; i++)
+ {
+ if (tmp.b[2*i] != 5
+ || tmp.b[2*i+1] != 15)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c
new file mode 100644
index 000000000..f3d169b03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-34.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-skip-if "cost too high" { powerpc*le-*-* } { "*" } { "" } } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+struct mystr {
+ int f1;
+ int f2;
+};
+
+struct mystr af[16] = {
+ 10, 11, 12, 13, 14, 15, 16, 17,
+ 20, 21, 22, 23, 24, 25, 26, 27,
+ 30, 31, 32, 33, 34, 35, 36, 37,
+ 40, 41, 42, 43, 44, 45, 46, 47
+};
+
+struct mystr bf[16] = {
+ 12, 13, 14, 15, 16, 17, 18, 19,
+ 22, 23, 24, 25, 26, 27, 28, 29,
+ 32, 33, 34, 35, 36, 37, 38, 39,
+ 42, 43, 44, 45, 46, 47, 48, 49
+};
+
+struct mystr cf[16];
+
+int res1[16] = {
+ 22, 26, 30, 34, 42, 46, 50, 54,
+ 62, 66, 70, 74, 82, 86, 90, 94,
+};
+
+int res2[16] = {
+ 24, 28, 32, 36, 44, 48, 52, 56,
+ 64, 68, 72, 76, 84, 88, 92, 96,
+};
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+ int i;
+
+ for (i = 0; i < 16; i++)
+ {
+ cf[i].f1 = af[i].f1 + bf[i].f1;
+ cf[i].f2 = af[i].f2 + bf[i].f2;
+ }
+}
+
+
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+ foo ();
+
+ /* Check resiults. */
+ for (i = 0; i < 16; i++)
+ {
+ if (cf[i].f1 != res1[i])
+ abort ();
+ if (cf[i].f2 != res2[i])
+ abort ();
+
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c
new file mode 100644
index 000000000..272b3f0d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.b[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.b[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31b.c
new file mode 100644
index 000000000..b3224f943
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31b.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.c[i] = 6;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.c[i] != 6)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31c.c
new file mode 100644
index 000000000..9dcd09aba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31c.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.d.k[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.d.k[i] != 7)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c
new file mode 100644
index 000000000..11036b0bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+struct test {
+ char ca[N];
+};
+
+extern struct test s;
+
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ return main1 ();
+}
+
+/* Peeling to align the store is used. Overhead of peeling is too high. */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target vector_alignment_reachable } } } */
+
+/* Versioning to align the store is used. Overhead of versioning is not too high. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vector_alignment_reachable} } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68a.c
new file mode 100644
index 000000000..d0d40ac33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68a.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 1. unaligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.a.n[1][2][i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68b.c
new file mode 100644
index 000000000..4e52af8b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68b.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 2. aligned */
+ for (i = 3; i < N-1; i++)
+ {
+ tmp1.a.n[1][2][i] = 6;
+ }
+
+ /* check results: */
+ for (i = 3; i < N-1; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 6)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68c.c
new file mode 100644
index 000000000..58c5e9fdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-68c.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 3. aligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.e.n[1][2][i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 7)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c
new file mode 100644
index 000000000..d11a9a2d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+#define OFF 4
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+int main1 (int *pib)
+{
+ int i;
+ int ia[N+OFF];
+ int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+ for (i = OFF; i < N; i++)
+ {
+ ia[i] = pib[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (ia[i] != pib[i - OFF])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (&ib[OFF]);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c
new file mode 100644
index 000000000..d716b6139
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+#define OFF 4
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+int main1 (int *pib)
+{
+ int i;
+ int ia[N+OFF];
+ int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+ for (i = OFF; i < N; i++)
+ {
+ pib[i - OFF] = ic[i];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (pib[i - OFF] != ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (&ib[OFF]);
+ return 0;
+}
+
+/* Peeling to align the store is used. Overhead of peeling is too high. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target vector_alignment_reachable } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target { vector_alignment_reachable && {! vect_no_align} } } } } */
+
+/* Versioning to align the store is used. Overhead of versioning is not too high. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_no_align || {! vector_alignment_reachable} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c
new file mode 100644
index 000000000..1142e7a27
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+#define OFF 4
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+int main1 (int *pib)
+{
+ int i;
+ int ia[N+OFF];
+
+ for (i = OFF; i < N; i++)
+ {
+ ia[i] = ic[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (ia[i] != ic[i - OFF])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (&ib[OFF]);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c
new file mode 100644
index 000000000..efab0469b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-outer-fir.c
@@ -0,0 +1,71 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 40
+#define M 128
+float in[N+M];
+float coeff[M];
+float out[N];
+float fir_out[N];
+
+/* Vectorized. Fixed misaligment in the inner-loop. */
+__attribute__ ((noinline)) void foo (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ out[i] = 0;
+ }
+
+ for (k = 0; k < 4; k++) {
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = k; j < M; j+=4) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i] += diff;
+ }
+ }
+}
+
+/* Vectorized. Changing misalignment in the inner-loop. */
+__attribute__ ((noinline)) void fir (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j++) {
+ diff += in[j+i]*coeff[j];
+ }
+ fir_out[i] = diff;
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < M; i++)
+ coeff[i] = i;
+ for (i = 0; i < N+M; i++)
+ in[i] = i;
+
+ foo ();
+ fir ();
+
+ for (i = 0; i < N; i++) {
+ if (out[i] != fir_out[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-reduc-1char.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-reduc-1char.c
new file mode 100644
index 000000000..55334fdd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-reduc-1char.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
+{
+ int i;
+ unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ unsigned char udiff = 2;
+ unsigned char umax = x;
+ unsigned char umin = x;
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned char)(ub[i] - uc[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp
new file mode 100644
index 000000000..73e78d9e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/ppc/ppc-costmodel-vect.exp
@@ -0,0 +1,89 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Exit immediately if this isn't a powerpc target.
+if { ![istarget powerpc*-*-*] } then {
+ return
+}
+
+# Skip targets not supporting -maltivec.
+if ![is-effective-target powerpc_altivec_ok] {
+ return
+}
+
+# Set up flags used for tests that don't specify options.
+set DEFAULT_VECTCFLAGS ""
+
+# These flags are used for all targets.
+lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=dynamic" "-fno-common"
+
+# If the target system supports vector instructions, the default action
+# for a test is 'run', otherwise it's 'compile'. Save current default.
+# Executing vector instructions on a system without hardware vector support
+# is also disabled by a call to check_vect, but disabling execution here is
+# more efficient.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+
+lappend DEFAULT_VECTCFLAGS "-maltivec"
+if [check_vmx_hw_available] {
+ set dg-do-what-default run
+} else {
+ if [is-effective-target ilp32] {
+ # Specify a cpu that supports VMX for compile-only tests.
+ lappend DEFAULT_VECTCFLAGS "-mcpu=970"
+ }
+ set dg-do-what-default compile
+}
+
+# Initialize `dg'.
+dg-init
+
+set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS
+
+lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
+lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details"
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-pr*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-vect-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-slp-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-bb-slp*.\[cS\]]] \
+ "" $VECT_SLP_CFLAGS
+
+#### Tests with special options
+global SAVED_DEFAULT_VECTCFLAGS
+set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
+
+# -ffast-math tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-ffast-math"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-fast-math-vect*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-fast-math-vect-pr29925.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-fast-math-vect-pr29925.c
new file mode 100644
index 000000000..00e631b13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-fast-math-vect-pr29925.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdlib.h>
+#include "../../tree-vect.h"
+
+__attribute__ ((noinline)) void
+interp_pitch(float *exc, float *interp, int pitch, int len)
+{
+ int i,k;
+ int maxj;
+
+ maxj=3;
+ for (i=0;i<len;i++)
+ {
+ float tmp = 0;
+ for (k=0;k<7;k++)
+ {
+ tmp += exc[i-pitch+k+maxj-6];
+ }
+ interp[i] = tmp;
+ }
+}
+
+int main()
+{
+ float *exc = calloc(126,sizeof(float));
+ float *interp = calloc(80,sizeof(float));
+ int pitch = -35;
+
+ check_vect ();
+
+ interp_pitch(exc, interp, pitch, 80);
+ free(exc);
+ free(interp);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31a.c
new file mode 100644
index 000000000..272b3f0d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31a.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.b[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.b[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31b.c
new file mode 100644
index 000000000..b3224f943
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31b.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.c[i] = 6;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.c[i] != 6)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31c.c
new file mode 100644
index 000000000..9dcd09aba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31c.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.d.k[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.d.k[i] != 7)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31d.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31d.c
new file mode 100644
index 000000000..736804fd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-31d.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.e.k[i] = 8;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.e.k[i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c
new file mode 100644
index 000000000..11036b0bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+struct test {
+ char ca[N];
+};
+
+extern struct test s;
+
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ return main1 ();
+}
+
+/* Peeling to align the store is used. Overhead of peeling is too high. */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target vector_alignment_reachable } } } */
+
+/* Versioning to align the store is used. Overhead of versioning is not too high. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vector_alignment_reachable} } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68a.c
new file mode 100644
index 000000000..d0d40ac33
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68a.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 1. unaligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.a.n[1][2][i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68b.c
new file mode 100644
index 000000000..4e52af8b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68b.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 2. aligned */
+ for (i = 3; i < N-1; i++)
+ {
+ tmp1.a.n[1][2][i] = 6;
+ }
+
+ /* check results: */
+ for (i = 3; i < N-1; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 6)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68c.c
new file mode 100644
index 000000000..58c5e9fdb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68c.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 3. aligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.e.n[1][2][i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 7)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68d.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68d.c
new file mode 100644
index 000000000..9cec93633
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-68d.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 20
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 4. unaligned */
+ for (i = 3; i < N-3; i++)
+ {
+ tmp1.e.n[1][2][i] = 8;
+ }
+
+ /* check results: */
+ for (i = 3; i <N-3; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c
new file mode 100644
index 000000000..124493b03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+#define OFF 4
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+int main1 (int *pib)
+{
+ int i;
+ int ia[N+OFF];
+ int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+ for (i = OFF; i < N; i++)
+ {
+ ia[i] = pib[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (ia[i] != pib[i - OFF])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (&ib[OFF]);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c
new file mode 100644
index 000000000..4969a31e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76b.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+#define OFF 4
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 0, 1, 3, 5, 7, 11, 13, 17};
+int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 0, 1, 3, 5, 7, 11, 13, 17};
+
+int main1 (int *pib)
+{
+ int i;
+ int ia[N+OFF];
+
+ for (i = OFF; i < N; i++)
+ {
+ pib[i - OFF] = ic[i];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (pib[i - OFF] != ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (&ib[OFF]);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c
new file mode 100644
index 000000000..b42934c68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+#define OFF 4
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+int main1 (int *pib)
+{
+ int i;
+ int ia[N+OFF];
+
+ for (i = OFF; i < N; i++)
+ {
+ ia[i] = ic[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (ia[i] != ic[i - OFF])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (&ib[OFF]);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c
new file mode 100644
index 000000000..af694a36d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-iv-9.c
@@ -0,0 +1,38 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 26
+int a[N];
+
+__attribute__ ((noinline)) int main1 (int X)
+{
+ int s = X;
+ int i;
+
+ /* vectorization of reduction with induction. */
+ for (i = 0; i < N; i++)
+ s += (i + a[i]);
+
+ return s;
+}
+
+int main (void)
+{
+ int s, i;
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ a[i] = 2*i;
+
+ s = main1 (3);
+ if (s != 978)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vect_int_mult } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp
new file mode 100644
index 000000000..550ce84ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/spu/spu-costmodel-vect.exp
@@ -0,0 +1,69 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Exit immediately if this isn't a powerpc target.
+if { ![istarget spu*-*-*] } then {
+ return
+}
+
+
+# Set up flags used for tests that don't specify options.
+set DEFAULT_VECTCFLAGS ""
+
+# These flags are used for all targets.
+lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=dynamic"
+
+# If the target system supports vector instructions, the default action
+# for a test is 'run', otherwise it's 'compile'. Save current default.
+# Executing vector instructions on a system without hardware vector support
+# is also disabled by a call to check_vect, but disabling execution here is
+# more efficient.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+
+set dg-do-what-default run
+
+# Initialize `dg'.
+dg-init
+
+lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-pr*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-vect-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+#### Tests with special options
+global SAVED_DEFAULT_VECTCFLAGS
+set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
+
+# -ffast-math tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-ffast-math"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-fast-math-vect*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
new file mode 100644
index 000000000..d5c0a1a13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdlib.h>
+#include "../../tree-vect.h"
+
+__attribute__ ((noinline)) void
+interp_pitch(float *exc, float *interp, int pitch, int len)
+{
+ int i,k;
+ int maxj;
+
+ maxj=3;
+ for (i=0;i<len;i++)
+ {
+ float tmp = 0;
+ for (k=0;k<12;k++)
+ {
+ tmp += exc[i-pitch+k+maxj-6];
+ }
+ interp[i] = tmp;
+ }
+}
+
+int main()
+{
+ float *exc = calloc(136,sizeof(float));
+ float *interp = calloc(80,sizeof(float));
+ int pitch = -35;
+
+ check_vect ();
+
+ interp_pitch(exc, interp, pitch, 80);
+ free(exc);
+ free(interp);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
new file mode 100644
index 000000000..5d5d41587
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr30843.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_long } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+
+void dacP98FillRGBMap (unsigned char *pBuffer)
+{
+ unsigned long dw, dw1;
+ unsigned long *pdw = (unsigned long *)(pBuffer);
+
+ for( dw = 256, dw1 = 0; dw; dw--, dw1 += 0x01010101)
+ {
+ *pdw++ = dw1;
+ *pdw++ = dw1;
+ *pdw++ = dw1;
+ *pdw++ = dw1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target vect_interleave
+} } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
new file mode 100644
index 000000000..137267619
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
@@ -0,0 +1,91 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+struct s tmp = { 1 };
+
+int main1 ()
+{
+ int i;
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.b[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.b[i] != 5)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.c[i] = 6;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.c[i] != 6)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.d.k[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.d.k[i] != 7)
+ abort ();
+ }
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.e.k[i] = 8;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.e.k[i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
new file mode 100644
index 000000000..5676b2470
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+struct test {
+ char ca[N];
+};
+
+extern struct test s;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c
new file mode 100644
index 000000000..b916cd91d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-68.c
@@ -0,0 +1,88 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 1. unaligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.a.n[1][2][i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 5)
+ abort ();
+ }
+
+ /* 2. aligned */
+ for (i = 3; i < N-1; i++)
+ {
+ tmp1.a.n[1][2][i] = 6;
+ }
+
+ /* check results: */
+ for (i = 3; i < N-1; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 6)
+ abort ();
+ }
+
+ /* 3. aligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.e.n[1][2][i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 7)
+ abort ();
+ }
+
+ /* 4. unaligned */
+ for (i = 3; i < N-3; i++)
+ {
+ tmp1.e.n[1][2][i] = 8;
+ }
+
+ /* check results: */
+ for (i = 3; i <N-3; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c
new file mode 100644
index 000000000..a7b86cebd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "../../tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
+{
+ int i;
+ unsigned char udiff = 2;
+ unsigned char umax = x;
+ unsigned char umin = x;
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned char)(ub[i] - uc[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp
new file mode 100644
index 000000000..2c30019a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/x86_64-costmodel-vect.exp
@@ -0,0 +1,74 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Exit immediately if this isn't a x86 target.
+if { (![istarget x86_64-*-*] && ![istarget i?86-*-*])
+ || [is-effective-target ia32] } then {
+ return
+}
+
+# Set up flags used for tests that don't specify options.
+set DEFAULT_VECTCFLAGS ""
+
+# These flags are used for all targets.
+lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fvect-cost-model=dynamic"
+
+# If the target system supports vector instructions, the default action
+# for a test is 'run', otherwise it's 'compile'. Save current default.
+# Executing vector instructions on a system without hardware vector support
+# is also disabled by a call to check_vect, but disabling execution here is
+# more efficient.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+
+lappend DEFAULT_VECTCFLAGS "-msse2"
+if [check_sse2_hw_available] {
+ set dg-do-what-default run
+} else {
+ set dg-do-what-default compile
+}
+
+# Initialize `dg'.
+dg-init
+
+lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-pr*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-vect-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+#### Tests with special options
+global SAVED_DEFAULT_VECTCFLAGS
+set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
+
+# -ffast-math tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-ffast-math"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/costmodel-fast-math-vect*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/dump-tree-dceloop-pr26359.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/dump-tree-dceloop-pr26359.c
new file mode 100644
index 000000000..ae7aea25e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/dump-tree-dceloop-pr26359.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int a[256], b[256], c[256];
+
+foo () {
+ int i;
+
+ for (i=0; i<256; i++){
+ a[i] = b[i] + c[i];
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Deleting : vect_" 0 "dceloop3" } } */
+/* { dg-final { cleanup-tree-dump "dceloop\[1-3\]" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c
new file mode 100644
index 000000000..c138a78b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-1.c
@@ -0,0 +1,49 @@
+#include "tree-vect.h"
+
+extern float copysignf (float, float);
+extern float sqrtf (float);
+extern float fabsf (float);
+extern void abort (void);
+float a[64], b[64], c[64], d[64];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ a[0] = copysignf (b[0], c[0]) + 1.0f + sqrtf (d[0]);
+ a[1] = copysignf (b[1], c[1]) + 2.0f + sqrtf (d[1]);
+ a[2] = copysignf (b[2], c[2]) + 3.0f + sqrtf (d[2]);
+ a[3] = copysignf (b[3], c[3]) + 4.0f + sqrtf (d[3]);
+ a[4] = copysignf (b[4], c[4]) + 5.0f + sqrtf (d[4]);
+ a[5] = copysignf (b[5], c[5]) + 6.0f + sqrtf (d[5]);
+ a[6] = copysignf (b[6], c[6]) + 7.0f + sqrtf (d[6]);
+ a[7] = copysignf (b[7], c[7]) + 8.0f + sqrtf (d[7]);
+}
+
+__attribute__((noinline, noclone)) int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < 8; i++)
+ {
+ asm ("");
+ b[i] = (i & 1) ? -4 * i : 4 * i;
+ c[i] = (i & 2) ? -8 * i : 8 * i;
+ d[i] = i * i;
+ }
+ f1 ();
+ for (i = 0; i < 8; i++)
+ if (fabsf (((i & 2) ? -4 * i : 4 * i) + 1 + i + i - a[i]) >= 0.0001f)
+ abort ();
+ return 0;
+}
+
+int
+main ()
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target { vect_call_copysignf && vect_call_sqrtf } } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c
new file mode 100644
index 000000000..c126c1c00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-2.c
@@ -0,0 +1,67 @@
+/* { dg-require-effective-target vect_double } */
+
+#include "tree-vect.h"
+
+extern long int lrint (double);
+extern void abort (void);
+long int a[64];
+double b[64];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ a[0] = lrint (b[0]) + 1;
+ a[1] = lrint (b[1]) + 2;
+ a[2] = lrint (b[2]) + 3;
+ a[3] = lrint (b[3]) + 4;
+ a[4] = lrint (b[4]) + 5;
+ a[5] = lrint (b[5]) + 6;
+ a[6] = lrint (b[6]) + 7;
+ a[7] = lrint (b[7]) + 8;
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ a[0] = lrint (b[0]);
+ a[1] = lrint (b[1]);
+ a[2] = lrint (b[2]);
+ a[3] = lrint (b[3]);
+ a[4] = lrint (b[4]);
+ a[5] = lrint (b[5]);
+ a[6] = lrint (b[6]);
+ a[7] = lrint (b[7]);
+}
+
+__attribute__((noinline, noclone)) int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < 8; i++)
+ {
+ asm ("");
+ b[i] = ((i & 1) ? -4 * i : 4 * i) + 0.25;
+ }
+ f1 ();
+ for (i = 0; i < 8; i++)
+ if (a[i] != ((i & 1) ? -4 * i : 4 * i) + 1 + i)
+ abort ();
+ else
+ a[i] = 131.25;
+ f2 ();
+ for (i = 0; i < 8; i++)
+ if (a[i] != ((i & 1) ? -4 * i : 4 * i))
+ abort ();
+ return 0;
+}
+
+int
+main ()
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 2 "slp" { target vect_call_lrint } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-3.c
new file mode 100644
index 000000000..5878d418f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-3.c
@@ -0,0 +1,68 @@
+#include <stdlib.h>
+#include <math.h>
+
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+typedef struct {
+ int initialHeight, initialWidth;
+ int rotatedHeight, rotatedWidth;
+ int autoCropHeight, autoCropWidth;
+} ufraw_data;
+
+void __attribute__((noinline,noclone))
+ufraw_test(ufraw_data *uf)
+{
+ int iWidth = uf->initialWidth;
+ int iHeight = uf->initialHeight;
+ double aspectRatio = ((double)iWidth) / iHeight;
+ double midX = iWidth / 2.0 - 0.5;
+ double midY = iHeight / 2.0 - 0.5;
+ double maxX = 0, maxY = 0;
+ double minX = 999999, minY = 999999;
+ double lastX = 0, lastY = 0, area = 0;
+ double scale;
+ int i;
+ for (i = 0; i < iWidth + iHeight - 1; i++)
+ {
+ int x, y;
+ if (i < iWidth) { // Trace the left border of the image
+ x = i;
+ y = 0;
+ } else { // Trace the bottom border of the image
+ x = iWidth - 1;
+ y = i - iWidth + 1;
+ }
+ double srcX = x - midX;
+ double srcY = y - midY;
+ // A digital planimeter:
+ area += srcY * lastX - srcX * lastY;
+ lastX = srcX;
+ lastY = srcY;
+ maxX = MAX(maxX, fabs(srcX));
+ maxY = MAX(maxY, fabs(srcY));
+ if (fabs(srcX / srcY) > aspectRatio)
+ minX = MIN(minX, fabs(srcX));
+ else
+ minY = MIN(minY, fabs(srcY));
+ }
+ scale = sqrt((iWidth - 1) * (iHeight - 1) / area);
+ uf->rotatedWidth = MIN(ceil(2 * maxX + 1.0) * scale, 2 * iWidth);
+ uf->rotatedHeight = MIN(ceil(2 * maxY + 1.0) * scale, 2 * iHeight);
+ uf->autoCropWidth = MIN(floor(2 * minX) * scale, 2 * iWidth);
+ uf->autoCropHeight = MIN(floor(2 * minY) * scale, 2 * iHeight);
+ if (uf->autoCropWidth != 3)
+ abort ();
+}
+
+int main()
+{
+ ufraw_data uf_data;
+ ufraw_data *uf = &uf_data;
+ uf->initialWidth = 4;
+ uf->initialHeight = 5;
+ ufraw_test(uf);
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-ifcvt-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-ifcvt-1.c
new file mode 100644
index 000000000..ba22d8d78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-ifcvt-1.c
@@ -0,0 +1,18 @@
+/* PR 47892 */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_condition } */
+
+void
+bestseries9 (float * __restrict__ arr, int len)
+{
+ int i;
+ for (i = 0; i < len; ++i)
+ {
+ float or = arr[i];
+ arr[i] = (or > 0.0f) * (2 - or * or);
+ }
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
new file mode 100644
index 000000000..5b834568a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
+
+struct mem
+{
+ float avg;
+ int len;
+};
+
+float method2_int16 (struct mem *mem)
+{
+ int i;
+ float avg;
+
+ for (i = 0; i < 100; ++i)
+ avg += mem[i].avg * (float) mem[i].len;
+
+ return avg;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_extract_even_odd || vect_strided2 } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_extract_even_odd || vect_strided2 } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr43074.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr43074.c
new file mode 100644
index 000000000..80077ba7d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr43074.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+float
+pvslockprocess(float *fout, float *fin, int framesize)
+{
+ int i;
+ float mag=0.0f, diff;
+ for (i = 0; i < framesize; i += 2) {
+ mag += fin[i];
+ fout[i] = fin[i];
+ fout[i+1] = fin[i+1];
+ }
+ return mag;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr44152.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr44152.c
new file mode 100644
index 000000000..80ce3dc8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr44152.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+_Complex float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ { 10.0F + 20.0iF, 11.0F + 21.0iF, 12.0F + 22.0iF, 13.0F + 23.0iF,
+ 14.0F + 24.0iF, 15.0F + 25.0iF, 16.0F + 26.0iF, 17.0F + 27.0iF,
+ 18.0F + 28.0iF, 19.0F + 29.0iF, 20.0F + 30.0iF, 21.0F + 31.0iF,
+ 22.0F + 32.0iF, 23.0F + 33.0iF, 24.0F + 34.0iF, 25.0F + 35.0iF };
+
+_Complex float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+
+__attribute__ ((noinline)) _Complex float
+foo (int x)
+{
+ int i;
+ _Complex float *p = a + x;
+ _Complex float sum = 10.0F + 20.0iF;
+
+ for (i = 0; i < N; i++)
+ {
+ sum += *p;
+ p++;
+ }
+
+ c[0] = sum + 66.0F + 86.0iF;
+
+ return 0;
+}
+
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr55281.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr55281.c
new file mode 100644
index 000000000..4d75403e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-pr55281.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/55281 */
+/* { dg-do compile } */
+
+static inline float
+bar (float k, float j)
+{
+ float l = 0.0f;
+ if (k > j)
+ l = k;
+ float t = k / j;
+ float v = t * t;
+ if (k == 0)
+ v = 0.0f;
+ if (t > 0.4f)
+ v += 0.7;
+ if (l != 0)
+ v = 1.5 - v;
+ return v;
+}
+
+void
+foo (int *a, int b, float *d, float *e, int *f)
+{
+ int i, l;
+ for (l = 0; l != b; ++l)
+ for (i = 0; i != 8; ++i)
+ f[i] = e[i] + bar (a[i], d[i]);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c
new file mode 100644
index 000000000..4c2c5c510
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-slp-27.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+float x[2*256+1];
+
+void foo(void)
+{
+ int i;
+ for (i=0; i<256; ++i)
+ {
+ x[2*i] = x[2*i] * x[2*i];
+ x[2*i+1] = x[2*i+1] * x[2*i+1];
+ }
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c
new file mode 100644
index 000000000..241f9f5c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-slp-38.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+
+double self[1024];
+double a[1024][1024];
+double b[1024];
+
+void __attribute__((noinline,noclone))
+foo (void)
+{
+ int i, j;
+ for (i = 0; i < 1024; i+=6)
+ for (j = 0; j < 1024; j+=6)
+ {
+ self[i] = self[i] + a[i][j]*b[j];
+ self[i+1] = self[i+1] + a[i][j+1]*b[j+1];
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-call-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-call-1.c
new file mode 100644
index 000000000..db6df7e75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-call-1.c
@@ -0,0 +1,99 @@
+#include "tree-vect.h"
+
+extern float copysignf (float, float);
+extern float sqrtf (float);
+extern float fabsf (float);
+extern void abort (void);
+float a[64], b[64], c[64], d[64];
+
+__attribute__((noinline, noclone)) void
+f1 (int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ a[4 * i + 0] = copysignf (b[4 * i + 0], c[4 * i + 0]) + 1.0f + sqrtf (d[4 * i + 0]);
+ a[4 * i + 1] = copysignf (b[4 * i + 1], c[4 * i + 1]) + 2.0f + sqrtf (d[4 * i + 1]);
+ a[4 * i + 2] = copysignf (b[4 * i + 2], c[4 * i + 2]) + 3.0f + sqrtf (d[4 * i + 2]);
+ a[4 * i + 3] = copysignf (b[4 * i + 3], c[4 * i + 3]) + 4.0f + sqrtf (d[4 * i + 3]);
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (int n)
+{
+ int i;
+ for (i = 0; i < 2 * n; i++)
+ {
+ a[2 * i + 0] = copysignf (b[2 * i + 0], c[2 * i + 0]) + 1.0f + sqrtf (d[2 * i + 0]);
+ a[2 * i + 1] = copysignf (b[2 * i + 1], c[2 * i + 1]) + 2.0f + sqrtf (d[2 * i + 1]);
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < 64; i++)
+ a[i] = copysignf (b[i], c[i]) + 1.0f + sqrtf (d[i]);
+}
+
+__attribute__((noinline, noclone)) void
+f4 (int n)
+{
+ int i;
+ for (i = 0; i < 2 * n; i++)
+ {
+ a[3 * i + 0] = copysignf (b[3 * i + 0], c[3 * i + 0]) + 1.0f + sqrtf (d[3 * i + 0]);
+ a[3 * i + 1] = copysignf (b[3 * i + 1], c[3 * i + 1]) + 2.0f + sqrtf (d[3 * i + 1]);
+ a[3 * i + 2] = copysignf (b[3 * i + 2], c[3 * i + 2]) + 3.0f + sqrtf (d[3 * i + 2]);
+ }
+}
+
+__attribute__((noinline, noclone)) int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < 64; i++)
+ {
+ asm ("");
+ b[i] = (i & 1) ? -4 * i : 4 * i;
+ c[i] = (i & 2) ? -8 * i : 8 * i;
+ d[i] = i * i;
+ }
+ f1 (16);
+ for (i = 0; i < 64; i++)
+ if (fabsf (((i & 2) ? -4 * i : 4 * i) + 1 + (i & 3) + i - a[i]) >= 0.0001f)
+ abort ();
+ else
+ a[i] = 131.25;
+ f2 (16);
+ for (i = 0; i < 64; i++)
+ if (fabsf (((i & 2) ? -4 * i : 4 * i) + 1 + (i & 1) + i - a[i]) >= 0.0001f)
+ abort ();
+ else
+ a[i] = 131.25;
+ f3 ();
+ for (i = 0; i < 64; i++)
+ if (fabsf (((i & 2) ? -4 * i : 4 * i) + 1 + i - a[i]) >= 0.0001f)
+ abort ();
+ else
+ a[i] = 131.25;
+ f4 (10);
+ for (i = 0; i < 60; i++)
+ if (fabsf (((i & 2) ? -4 * i : 4 * i) + 1 + (i % 3) + i - a[i]) >= 0.0001f)
+ abort ();
+ return 0;
+}
+
+int
+main ()
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" { target { vect_call_copysignf && vect_call_sqrtf } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target { vect_call_copysignf && vect_call_sqrtf } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-call-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-call-2.c
new file mode 100644
index 000000000..ed7a9dcee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-call-2.c
@@ -0,0 +1,130 @@
+/* { dg-require-effective-target vect_double } */
+
+#include "tree-vect.h"
+
+extern long int lrint (double);
+extern void abort (void);
+long int a[64];
+double b[64];
+
+__attribute__((noinline, noclone)) void
+f1 (int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ a[4 * i + 0] = lrint (b[4 * i + 0]) + 1;
+ a[4 * i + 1] = lrint (b[4 * i + 1]) + 2;
+ a[4 * i + 2] = lrint (b[4 * i + 2]) + 3;
+ a[4 * i + 3] = lrint (b[4 * i + 3]) + 4;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (int n)
+{
+ int i;
+ for (i = 0; i < 2 * n; i++)
+ {
+ a[2 * i + 0] = lrint (b[2 * i + 0]) + 1;
+ a[2 * i + 1] = lrint (b[2 * i + 1]) + 2;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < 64; i++)
+ a[i] = lrint (b[i]) + 1;
+}
+
+__attribute__((noinline, noclone)) void
+f4 (int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ a[4 * i + 0] = lrint (b[4 * i + 0]);
+ a[4 * i + 1] = lrint (b[4 * i + 1]);
+ a[4 * i + 2] = lrint (b[4 * i + 2]);
+ a[4 * i + 3] = lrint (b[4 * i + 3]);
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f5 (int n)
+{
+ int i;
+ for (i = 0; i < 2 * n; i++)
+ {
+ a[2 * i + 0] = lrint (b[2 * i + 0]);
+ a[2 * i + 1] = lrint (b[2 * i + 1]);
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f6 (void)
+{
+ int i;
+ for (i = 0; i < 64; i++)
+ a[i] = lrint (b[i]);
+}
+
+__attribute__((noinline, noclone)) int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < 64; i++)
+ {
+ asm ("");
+ b[i] = ((i & 1) ? -4 * i : 4 * i) + 0.25;
+ }
+ f1 (16);
+ for (i = 0; i < 64; i++)
+ if (a[i] != ((i & 1) ? -4 * i : 4 * i) + 1 + (i & 3))
+ abort ();
+ else
+ a[i] = 131.25;
+ f2 (16);
+ for (i = 0; i < 64; i++)
+ if (a[i] != ((i & 1) ? -4 * i : 4 * i) + 1 + (i & 1))
+ abort ();
+ else
+ a[i] = 131.25;
+ f3 ();
+ for (i = 0; i < 64; i++)
+ if (a[i] != ((i & 1) ? -4 * i : 4 * i) + 1)
+ abort ();
+ else
+ a[i] = 131.25;
+ f4 (16);
+ for (i = 0; i < 64; i++)
+ if (a[i] != ((i & 1) ? -4 * i : 4 * i))
+ abort ();
+ else
+ a[i] = 131.25;
+ f5 (16);
+ for (i = 0; i < 64; i++)
+ if (a[i] != ((i & 1) ? -4 * i : 4 * i))
+ abort ();
+ else
+ a[i] = 131.25;
+ f6 ();
+ for (i = 0; i < 64; i++)
+ if (a[i] != ((i & 1) ? -4 * i : 4 * i))
+ abort ();
+ return 0;
+}
+
+int
+main ()
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 6 "vect" { target vect_call_lrint } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { target vect_call_lrint } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c
new file mode 100644
index 000000000..db55b3009
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-complex-3.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+_Complex float a[N] =
+ { 10.0F + 20.0iF, 11.0F + 21.0iF, 12.0F + 22.0iF, 13.0F + 23.0iF,
+ 14.0F + 24.0iF, 15.0F + 25.0iF, 16.0F + 26.0iF, 17.0F + 27.0iF,
+ 18.0F + 28.0iF, 19.0F + 29.0iF, 20.0F + 30.0iF, 21.0F + 31.0iF,
+ 22.0F + 32.0iF, 23.0F + 33.0iF, 24.0F + 34.0iF, 25.0F + 35.0iF };
+_Complex float b[N] =
+ { 30.0F + 40.0iF, 31.0F + 41.0iF, 32.0F + 42.0iF, 33.0F + 43.0iF,
+ 34.0F + 44.0iF, 35.0F + 45.0iF, 36.0F + 46.0iF, 37.0F + 47.0iF,
+ 38.0F + 48.0iF, 39.0F + 49.0iF, 40.0F + 50.0iF, 41.0F + 51.0iF,
+ 42.0F + 52.0iF, 43.0F + 53.0iF, 44.0F + 54.0iF, 45.0F + 55.0iF };
+
+_Complex float c[N];
+_Complex float res[N] =
+ { -500.0F + 1000.0iF, -520.0F + 1102.0iF,
+ -540.0F + 1208.0iF, -560.0F + 1318.0iF,
+ -580.0F + 1432.0iF, -600.0F + 1550.0iF,
+ -620.0F + 1672.0iF, -640.0F + 1798.0iF,
+ -660.0F + 1928.0iF, -680.0F + 2062.0iF,
+ -700.0F + 2200.0iF, -720.0F + 2342.0iF,
+ -740.0F + 2488.0iF, -760.0F + 2638.0iF,
+ -780.0F + 2792.0iF, -800.0F + 2950.0iF };
+
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ c[i] = a[i] * b[i];
+
+}
+
+int
+main (void)
+{
+ int i;
+ check_vect ();
+
+ foo ();
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (c[i] != res[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-outer-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-outer-7.c
new file mode 100644
index 000000000..4dafa3407
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-outer-7.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+float dvec[256];
+
+void test1 (float x)
+{
+ long i, j;
+ for (i = 0; i < 256; ++i)
+ for (j = 0; j < 131072; ++j)
+ dvec[i] *= x;
+}
+
+void test2 (float x)
+{
+ long i, j;
+ for (i = 0; i < 256; ++i)
+ for (j = 0; j < 131072; ++j)
+ dvec[i] *= 1.001f;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pow-1.c
new file mode 100644
index 000000000..4d000f192
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pow-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+float x[256];
+
+void foo(void)
+{
+ int i;
+ for (i=0; i<256; ++i)
+ x[i] = x[i] * x[i];
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pow-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pow-2.c
new file mode 100644
index 000000000..a9d927b3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pow-2.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+
+typedef double d_type;
+struct
+{
+ d_type x;
+ d_type y;
+} S[100];
+
+#define N 16
+d_type foo (d_type t);
+
+d_type
+main1 ()
+{
+ int i;
+ d_type t;
+
+ for (i = 0; i < N; i++)
+ {
+ t = (d_type) i / (d_type) 10;
+ S[5].x = t * t;
+ }
+ return S[5].x;
+}
+
+int
+main (void)
+{
+ d_type tmp = main1 ();
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pr25911.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pr25911.c
new file mode 100644
index 000000000..633382f5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pr25911.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+float bessel_Kn_scaled_small_x(int n)
+{
+ int k;
+ float k_term, sum1;
+ for(k=1; k<=n-1; k++)
+ {
+ k_term *= -1/(k * (n-k));
+ sum1 += k_term;
+ }
+ return sum1;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pr29925.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pr29925.c
new file mode 100644
index 000000000..be2f1a913
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-pr29925.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+__attribute__ ((noinline))
+void interp_pitch(float *exc, float *interp, int pitch, int len)
+{
+ int i,k;
+ int maxj;
+
+ maxj=3;
+ for (i=0;i<len;i++)
+ {
+ float tmp = 0;
+ for (k=0;k<7;k++)
+ {
+ tmp += exc[i-pitch+k+maxj-6];
+ }
+ interp[i] = tmp;
+ }
+}
+
+int main()
+{
+ float *exc = calloc(126,sizeof(float));
+ float *interp = calloc(80,sizeof(float));
+ int pitch = -35;
+
+ check_vect ();
+
+ interp_pitch(exc, interp, pitch, 80);
+ free(exc);
+ free(interp);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c
new file mode 100644
index 000000000..377d74b77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_float } */
+
+/* need -funsafe-math-optimizations to vectorize the summation.
+ also need -ffinite-math-only to create the min/max expr. */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+int main1 (float x, float max_result)
+{
+ int i;
+ float diff = 2;
+ float max = x;
+ float min = 10;
+
+ for (i = 0; i < N; i++) {
+ diff += (b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != 0)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100);
+ main1 (0, 15);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c
new file mode 100644
index 000000000..9f36db2e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_double } */
+
+/* need -funsafe-math-optimizations to vectorize the summation.
+ also need -ffinite-math-only to create the min/max expr. */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+double b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+double c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+int main1 (double x, double max_result)
+{
+ int i;
+ double diff = 2;
+ double max = x;
+ double min = 10;
+
+ for (i = 0; i < N; i++) {
+ diff += (b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != 0)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100);
+ main1 (0, 15);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-8.c
new file mode 100644
index 000000000..43a55f3a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-8.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+#include "tree-vect.h"
+
+extern float x[128] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+extern float y[128] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+extern float z[128] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+float f (unsigned n)
+{
+ float ret = 0.0;
+ unsigned i;
+ for (i = 0; i < n; i++)
+ {
+ float diff = x[i] - y[i];
+ ret -= diff * diff * z[i];
+ }
+ return ret;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-9.c
new file mode 100644
index 000000000..eb703f5af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-9.c
@@ -0,0 +1,30 @@
+/* { dg-require-effective-target vect_float } */
+
+#include "tree-vect.h"
+
+float x[1024];
+float
+test (void)
+{
+ int i;
+ float gosa = 0.0;
+ for (i = 0; i < 1024; ++i)
+ {
+ float tem = x[i];
+ gosa += tem * tem;
+ }
+ return gosa;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ if (test () != 0.0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/ggc-pr37574.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/ggc-pr37574.c
new file mode 100644
index 000000000..176aa7eaf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/ggc-pr37574.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+#include <stdarg.h>
+
+unsigned short in[40 +128];
+int main (void) {
+ int i = 0, j = 0;
+ unsigned int diff;
+ unsigned int s=0,sum=0;
+ for (i = 0; i < 40;i++)
+ {
+ diff = 0;
+ for (j = 0; j < 128;j+=8)
+ diff += in[j+i];
+ s += ((unsigned short)diff>>3);
+ }
+ if (s != sum)
+ return -1;
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c
new file mode 100644
index 000000000..38906a94a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/if-cvt-stores-vect-ifcvt-18.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 50
+
+typedef struct {
+ short a;
+ short b;
+} data;
+
+data in1[N], in2[N], out[N];
+short result[N*2] = {10,-7,11,-6,12,-5,13,-4,14,-3,15,-2,16,-1,17,0,18,1,19,2,20,3,21,4,22,5,23,6,24,7,25,8,26,9,27,10,28,11,29,12,30,13,31,14,32,15,33,16,34,17,35,18,36,19,37,20,38,21,39,22,40,23,41,24,42,25,43,26,44,27,45,28,46,29,47,30,48,31,49,32,50,33,51,34,52,35,53,36,54,37,55,38,56,39,57,40,58,41,59,42};
+short out1[N], out2[N];
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int i;
+ short c, d;
+
+ for (i = 0; i < N; i++)
+ {
+ c = in1[i].b;
+ d = in2[i].b;
+
+ if (c >= d)
+ {
+ out[i].b = in1[i].a;
+ out[i].a = d + 5;
+ }
+ else
+ {
+ out[i].b = d - 12;
+ out[i].a = in2[i].a + d;
+ }
+ }
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in1[i].a = i;
+ in1[i].b = i + 2;
+ in2[i].a = 5;
+ in2[i].b = i + 5;
+ __asm__ volatile ("");
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++)
+ {
+ if (out[i].a != result[2*i] || out[i].b != result[2*i+1])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || { ! vect_strided2 } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c
new file mode 100644
index 000000000..698370529
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c
@@ -0,0 +1,38 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 240
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ float diff;
+
+ diff = 0;
+ for (i = 0; i < N; i++) {
+ diff += (b[i] - c[i]);
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* Requires fast-math. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-fre-pre-pr50208.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-fre-pre-pr50208.c
new file mode 100644
index 000000000..26e2a6446
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-fre-pre-pr50208.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+char c;
+int a, b;
+
+void foo (int j)
+{
+ int i;
+ while (--j)
+ {
+ b = 3;
+ for (i = 0; i < 2; ++i)
+ a = b ^ c;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-math-errno-slp-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-math-errno-slp-32.c
new file mode 100644
index 000000000..c952e7f1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-math-errno-slp-32.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+
+double x[256];
+
+void foo(void)
+{
+ int i;
+ for (i=0; i<128; ++i)
+ {
+ x[2*i] = __builtin_pow (x[2*i], 0.5);
+ x[2*i+1] = __builtin_pow (x[2*i+1], 0.5);
+ }
+}
+
+/* { dg-final { scan-tree-dump "pattern recognized" "vect" { xfail spu*-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-math-errno-vect-pow-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-math-errno-vect-pow-1.c
new file mode 100644
index 000000000..03de93bf4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-math-errno-vect-pow-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+
+double x[256];
+
+void foo(void)
+{
+ int i;
+ for (i=0; i<256; ++i)
+ x[i] = __builtin_pow (x[i], 0.5);
+}
+
+/* { dg-final { scan-tree-dump "pattern recognized" "vect" { xfail spu*-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-1.c
new file mode 100644
index 000000000..9d8a403fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-1.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j,k=0;
+ int sum,x;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += (i + j);
+ i++;
+ }
+ a[k++] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j,k=0;
+ int sum;
+
+ check_vect ();
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++){
+ sum += (j + i);
+ i++;
+ }
+ if (a[k++] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-2.c
new file mode 100644
index 000000000..9a4fa3f25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-2.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+int a[200*N+N];
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ int sum,s=0;
+
+ for (i = 0; i < 200*N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += (i + j);
+ i++;
+ }
+ a[i] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j,k=0;
+ int sum,s=0;
+
+ check_vect ();
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<200*N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++){
+ sum += (j + i);
+ i++;
+ }
+ if (a[i] != sum)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-3.c
new file mode 100644
index 000000000..a4755e13a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-3.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j;
+ int sum,x;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += (i + j);
+ }
+ a[i] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++){
+ sum += (j + i);
+ }
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-4.c
new file mode 100644
index 000000000..afd2bc414
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-4.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j;
+ int sum,s=0;
+
+ for (i = 0; i < 200*N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += (i + j);
+ i++;
+ }
+ s += sum;
+ }
+ return s;
+}
+
+__attribute__ ((noinline))
+int bar (int i, int j)
+{
+return (i + j);
+}
+
+int main (void)
+{
+ int i,j,k=0;
+ int sum,s=0;
+ int res;
+
+ check_vect ();
+
+ res = foo ();
+
+ /* check results: */
+ for (i=0; i<200*N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++){
+ sum += bar (i, j);
+ i++;
+ }
+ s += sum;
+ }
+ if (res != s)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-5.c
new file mode 100644
index 000000000..0246a3cda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-outer-5.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j;
+ int sum,x;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ x = a[i];
+ for (j = 0; j < N; j++) {
+ sum += (x + j);
+ }
+ a[i] = sum + i + x;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+ int aa[N];
+
+ check_vect ();
+
+ for (i=0; i<N; i++){
+ a[i] = i;
+ aa[i] = i;
+ }
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += (j + aa[i]);
+ if (a[i] != sum + i + aa[i])
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-slp-reduc-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-slp-reduc-7.c
new file mode 100644
index 000000000..c268af7fb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-noreassoc-slp-reduc-7.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 121
+
+unsigned int ub[N] = {0,3,6,9,12,15,18,121,24,27,113,33,36,39,42,45};
+
+/* Vectorization of reduction using loop-aware SLP (with unrolling). */
+
+__attribute__ ((noinline))
+int main1 (int n)
+{
+ int i;
+ unsigned int max = 50;
+
+ for (i = 0; i < n; i++) {
+ max = max < ub[2*i] ? ub[2*i] : max;
+ max = max < ub[2*i + 1] ? ub[2*i + 1] : max;
+ }
+
+ /* Check results: */
+ if (max != MAX)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N/2);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-1.c
new file mode 100644
index 000000000..01fcbaa95
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+#define N 40
+signed short image[N][N];
+signed short block[N][N];
+
+/* memory references in the inner-loop */
+
+__attribute__ ((noinline)) unsigned int
+foo (){
+ int i,j;
+ unsigned int diff = 0;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ }
+ return diff;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10.c
new file mode 100644
index 000000000..e4d6f23f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+int b[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum,x,y;
+
+ for (i = 0; i < N/2; i++) {
+ sum = 0;
+ x = b[2*i];
+ y = b[2*i+1];
+ for (j = 0; j < n; j++) {
+ sum += j;
+ }
+ a[2*i] = sum + x;
+ a[2*i+1] = sum + y;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ b[i] = i;
+
+ foo (N-1);
+
+ /* check results: */
+ for (i=0; i<N/2; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N-1; j++)
+ sum += j;
+ if (a[2*i] != sum + b[2*i] || a[2*i+1] != sum + b[2*i+1])
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c
new file mode 100644
index 000000000..95906baed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10a.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+int b[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum,x,y;
+
+ if (n<=0)
+ return 0;
+
+ for (i = 0; i < N/2; i++) {
+ sum = 0;
+ x = b[2*i];
+ y = b[2*i+1];
+ j = 0;
+ do {
+ sum += j;
+ } while (++j < n);
+ a[2*i] = sum + x;
+ a[2*i+1] = sum + y;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ b[i] = i;
+
+ foo (N-1);
+
+ /* check results: */
+ for (i=0; i<N/2; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N-1; j++)
+ sum += j;
+ if (a[2*i] != sum + b[2*i] || a[2*i+1] != sum + b[2*i+1])
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c
new file mode 100644
index 000000000..544b89ae8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-10b.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+int b[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum,x,y;
+
+ if (n<=0)
+ return 0;
+
+ for (i = 0; i < N/2; i++) {
+ sum = 0;
+ x = b[2*i];
+ y = b[2*i+1];
+ for (j = 0; j < n; j++) {
+ sum += j;
+ }
+ a[2*i] = sum + x;
+ a[2*i+1] = sum + y;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ b[i] = i;
+
+ foo (N-1);
+
+ /* check results: */
+ for (i=0; i<N/2; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N-1; j++)
+ sum += j;
+ if (a[2*i] != sum + b[2*i] || a[2*i+1] != sum + b[2*i+1])
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-11.c
new file mode 100644
index 000000000..16b0cc0c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-11.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum;
+
+ for (i = 0; i < n; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[i] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-12.c
new file mode 100644
index 000000000..90ea32ddd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-12.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+int a[N];
+short b[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j;
+ int sum;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[i] = sum;
+ b[i] = (short)sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != sum || b[i] != (short)sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* Until we support multiple types in the inner loop */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-13.c
new file mode 100644
index 000000000..b70aabd84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-13.c
@@ -0,0 +1,67 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned short in[N];
+
+__attribute__ ((noinline)) unsigned int
+foo (short scale){
+ int i;
+ unsigned short j;
+ unsigned int sum = 0;
+ unsigned short sum_j;
+
+ for (i = 0; i < N; i++) {
+ sum_j = 0;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+ sum += ((unsigned int) in[i] * (unsigned int) sum_j) >> scale;
+ }
+ return sum;
+}
+
+__attribute__ ((noinline)) unsigned short
+bar (void)
+{
+ unsigned short j;
+ unsigned short sum_j;
+ sum_j = 0;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+ return sum_j;
+}
+
+int main (void)
+{
+ int i;
+ unsigned short j, sum_j;
+ unsigned int sum = 0;
+ unsigned int res;
+
+ check_vect ();
+
+ for (i=0; i<N; i++){
+ in[i] = i;
+ }
+
+ res = foo (2);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum_j = bar ();
+ sum += ((unsigned int) in[i] * (unsigned int) sum_j) >> 2;
+ }
+ if (res != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-14.c
new file mode 100644
index 000000000..d7614dc9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-14.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+__attribute__ ((noinline)) unsigned short
+foo (short scale){
+ int i;
+ unsigned short j;
+ unsigned short sum = 0;
+ unsigned short sum_j;
+
+ for (i = 0; i < N; i++) {
+ sum_j = 0;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+ sum += sum_j;
+ }
+ return sum;
+}
+
+__attribute__ ((noinline)) unsigned short
+bar (void)
+{
+ unsigned short j;
+ unsigned short sum_j;
+ sum_j = 0;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+ return sum_j;
+}
+
+int main (void)
+{
+ int i;
+ unsigned short j, sum_j;
+ unsigned short sum = 0;
+ unsigned short res;
+
+ check_vect ();
+
+ res = foo (2);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum_j = bar();
+ sum += sum_j;
+ }
+ if (res != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-15.c
new file mode 100644
index 000000000..b90167675
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-15.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int x){
+ int i,j;
+ int sum;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[i] = sum + i + x;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+ int aa[N];
+
+ check_vect ();
+
+ foo (3);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != sum + i + 3)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-16.c
new file mode 100644
index 000000000..ea58d395c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-16.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i;
+ unsigned short j;
+ int sum = 0;
+ unsigned short sum_j;
+
+ for (i = 0; i < N; i++) {
+ sum += i;
+
+ sum_j = 0;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+ a[i] = sum_j + 5;
+ }
+ return sum;
+}
+
+int main (void)
+{
+ int i;
+ unsigned short j, sum_j;
+ int sum = 0;
+ int res;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ res = foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum += i;
+
+ sum_j = 0;
+ for (j = 0; j < N; j++){
+ sum_j += j;
+ }
+ if (a[i] != sum_j + 5)
+ abort();
+ }
+ if (res != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { ! {vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-17.c
new file mode 100644
index 000000000..c11a1aa49
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-17.c
@@ -0,0 +1,68 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+int b[N];
+int c[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i;
+ unsigned short j;
+ int sum = 0;
+ unsigned short sum_j;
+
+ for (i = 0; i < N; i++) {
+ int diff = b[i] - c[i];
+
+ sum_j = 0;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+ a[i] = sum_j + 5;
+
+ sum += diff;
+ }
+ return sum;
+}
+
+int main (void)
+{
+ int i;
+ unsigned short j, sum_j;
+ int sum = 0;
+ int res;
+
+ check_vect ();
+
+ for (i=0; i<N; i++){
+ b[i] = i;
+ c[i] = 2*i;
+ }
+
+ res = foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum += (b[i] - c[i]);
+
+ sum_j = 0;
+ for (j = 0; j < N; j++){
+ sum_j += j;
+ }
+ if (a[i] != sum_j + 5)
+ abort();
+ }
+ if (res != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { ! {vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c
new file mode 100644
index 000000000..60cb00de4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-18.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j;
+ int sum;
+
+ for (i = 0; i < N/2; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[2*i] = sum;
+ a[2*i+1] = 2*sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N/2; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[2*i] != sum || a[2*i+1] != 2*sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target { vect_interleave || vect_strided2 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-19.c
new file mode 100644
index 000000000..58bcf0870
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-19.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned short a[N];
+unsigned int b[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ unsigned short i,j;
+ unsigned short sum;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[i] = sum;
+ b[i] = (unsigned int)sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ short sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != sum || b[i] != (unsigned int)sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { ! {vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-2.c
new file mode 100644
index 000000000..13b37883c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 40
+
+int
+foo (){
+ int i,j;
+ int diff = 0;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ diff += j;
+ }
+ }
+ return diff;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c
new file mode 100644
index 000000000..22b4aa96f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-20.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+int b[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j;
+ int sum,x,y;
+
+ for (i = 0; i < N/2; i++) {
+ sum = 0;
+ x = b[2*i];
+ y = b[2*i+1];
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[2*i] = sum + x;
+ a[2*i+1] = sum + y;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ b[i] = i;
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N/2; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[2*i] != sum + b[2*i] || a[2*i+1] != sum + b[2*i+1])
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-21.c
new file mode 100644
index 000000000..f955e4a12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-21.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i;
+ unsigned short j;
+ int sum = 0;
+ unsigned short sum_j;
+
+ for (i = 0; i < N; i++) {
+ sum += i;
+
+ sum_j = i;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+ a[i] = sum_j + 5;
+ }
+ return sum;
+}
+
+int main (void)
+{
+ int i;
+ unsigned short j, sum_j;
+ int sum = 0;
+ int res;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ res = foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum += i;
+
+ sum_j = i;
+ for (j = 0; j < N; j++){
+ sum_j += j;
+ }
+ if (a[i] != sum_j + 5)
+ abort();
+ }
+ if (res != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { ! { vect_pack_trunc } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-22.c
new file mode 100644
index 000000000..ac24b05d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-22.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum;
+
+ if (n<=0)
+ return 0;
+
+ /* inner-loop index j used after the inner-loop */
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < n; j+=2) {
+ sum += j;
+ }
+ a[i] = sum + j;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j+=2)
+ sum += j;
+ if (a[i] != sum + j)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-3.c
new file mode 100644
index 000000000..15afdfd5d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-3.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j;
+ int sum;
+
+ /* inner-loop step > 1 */
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j+=2) {
+ sum += j;
+ }
+ a[i] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j+=2)
+ sum += j;
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-4.c
new file mode 100644
index 000000000..5cf9ade11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-4.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+/* induction variable k advances through inner and outer loops. */
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j,k=0;
+ int sum;
+
+ if (n<=0)
+ return 0;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < n; j+=2) {
+ sum += k++;
+ }
+ a[i] = sum + j;
+ }
+}
+
+int main (void)
+{
+ int i,j,k=0;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j+=2)
+ sum += k++;
+ if (a[i] != sum + j)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-5.c
new file mode 100644
index 000000000..338e0283b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-5.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (){
+ int i,j;
+ int sum;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[i] += sum + i;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+ int aa[N];
+
+ check_vect ();
+
+ for (i=0; i<N; i++){
+ a[i] = i;
+ aa[i] = i;
+ }
+
+ foo ();
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != aa[i] + sum + i)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6-global.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6-global.c
new file mode 100644
index 000000000..9447524e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6-global.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int * __restrict__ b, int k){
+ int i,j;
+ int sum,x;
+
+ for (i = 0; i < N; i++) {
+ sum = b[i];
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[i] = sum;
+ }
+
+ return a[k];
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+ int b[N];
+ int a[N];
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ b[i] = i + 2;
+
+ for (i=0; i<N; i++)
+ a[i] = foo (b,i);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = b[i];
+ for (j = 0; j < N; j++){
+ sum += j;
+ }
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6.c
new file mode 100644
index 000000000..70cf520d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-6.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+__attribute__ ((noinline)) int
+foo (int * __restrict__ b, int k){
+ int i,j;
+ int sum,x;
+ int a[N];
+
+ for (i = 0; i < N; i++) {
+ sum = b[i];
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[i] = sum;
+ }
+
+ return a[k];
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+ int b[N];
+ int a[N];
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ b[i] = i + 2;
+
+ for (i=0; i<N; i++)
+ a[i] = foo (b,i);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = b[i];
+ for (j = 0; j < N; j++){
+ sum += j;
+ }
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { unaligned_stack || vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-7.c
new file mode 100644
index 000000000..9606d300c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-7.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned short in[N];
+unsigned short coef[N];
+unsigned short a[N];
+
+__attribute__ ((noinline)) unsigned int
+foo (short scale){
+ int i;
+ unsigned short j;
+ unsigned int sum = 0;
+ unsigned short sum_j;
+
+ for (i = 0; i < N; i++) {
+ sum_j = 0;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+ a[i] = sum_j;
+ sum += ((unsigned int) in[i] * (unsigned int) coef[i]) >> scale;
+ }
+ return sum;
+}
+
+unsigned short
+bar (void)
+{
+ unsigned short j;
+ unsigned short sum_j;
+
+ sum_j = 0;
+ for (j = 0; j < N; j++) {
+ sum_j += j;
+ }
+
+ return sum_j;
+}
+
+int main (void)
+{
+ int i;
+ unsigned short j, sum_j;
+ unsigned int sum = 0;
+ unsigned int res;
+
+ check_vect ();
+
+ for (i=0; i<N; i++){
+ in[i] = 2*i;
+ coef[i] = i;
+ }
+
+ res = foo (2);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ if (a[i] != bar ())
+ abort ();
+ sum += ((unsigned int) in[i] * (unsigned int) coef[i]) >> 2;
+ }
+ if (res != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-8.c
new file mode 100644
index 000000000..afa5b3d24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-8.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+
+__attribute__ ((noinline)) int
+foo (int *a){
+ int i,j;
+ int sum;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < N; j++) {
+ sum += j;
+ }
+ a[i] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+ int a[N];
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (a);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { ! { vect_element_align } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9.c
new file mode 100644
index 000000000..e0031274f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < n; j++) {
+ sum += j;
+ }
+ a[i] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9a.c
new file mode 100644
index 000000000..730600a7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9a.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum;
+
+ if (n<=0)
+ return 0;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ j = 0;
+ do {
+ sum += j;
+ }while (++j < n);
+ a[i] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9b.c
new file mode 100644
index 000000000..a8a52b963
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-outer-9b.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum;
+
+ if (n<=0)
+ return 0;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < n; j++) {
+ sum += j;
+ }
+ a[i] = sum;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ check_vect ();
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += j;
+ if (a[i] != sum)
+ abort();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-pr49199.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-pr49199.c
new file mode 100644
index 000000000..0f11142eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-pr49199.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int const_bar (void) __attribute__ ((__const__));
+int pure_bar (void) __attribute__ ((__pure__));
+
+int foo (void)
+{
+ int i = 0, x = 0;
+ for (; i < 100; i++)
+ {
+ x += const_bar ();
+ x += pure_bar ();
+ }
+ return x;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-slp-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-slp-30.c
new file mode 100644
index 000000000..547a49d58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-slp-30.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int
+main1 ()
+{
+ int i, j;
+ unsigned short out[N*8], a[N];
+
+ for (j = 0; j < N; j++)
+ {
+ for (i = 0; i < N; i++)
+ {
+ out[i*4] = 8;
+ out[i*4 + 1] = 18;
+ out[i*4 + 2] = 28;
+ out[i*4 + 3] = 38;
+ }
+ a[j] = 8;
+ }
+
+ /* check results: */
+ for (j = 0; j < N; j++)
+ {
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != 8
+ || out[i*4 + 1] != 18
+ || out[i*4 + 2] != 28
+ || out[i*4 + 3] != 38)
+ abort();
+ }
+
+ if (a[j] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-slp-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-slp-31.c
new file mode 100644
index 000000000..0a2149a45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-slp-31.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int
+main1 ()
+{
+ int i, j;
+ unsigned short out[N*8], a[N][N];
+
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ a[i][j] = 8;
+ }
+ out[i*4] = 8;
+ out[i*4 + 1] = 18;
+ out[i*4 + 2] = 28;
+ out[i*4 + 3] = 38;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (a[i][j] != 8)
+ abort ();
+ }
+ if (out[i*4] != 8
+ || out[i*4 + 1] != 18
+ || out[i*4 + 2] != 28
+ || out[i*4 + 3] != 38)
+ abort();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c
new file mode 100644
index 000000000..9793a129e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c
@@ -0,0 +1,34 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 26
+
+__attribute__ ((noinline)) int main1 (int X)
+{
+ int s = X;
+ int i;
+
+ /* vectorization of reduction with induction.
+ Need -fno-tree-scev-cprop or else the loop is eliminated. */
+ for (i = 0; i < N; i++)
+ s += i;
+
+ return s;
+}
+
+int main (void)
+{
+ int s;
+ check_vect ();
+
+ s = main1 (3);
+ if (s != 328)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c
new file mode 100644
index 000000000..adca5cba5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int arr1[N];
+ int k = 0;
+ int m = 3, i = 0;
+
+ /* Vectorization of induction that is used after the loop.
+ Currently vectorizable because scev_ccp disconnects the
+ use-after-the-loop from the iv def inside the loop. */
+
+ do {
+ k = k + 2;
+ arr1[i] = k;
+ m = m + k;
+ i++;
+ } while (i < N);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr1[i] != 2+2*i)
+ abort ();
+ }
+
+ return m + k;
+}
+
+int main (void)
+{
+ int res;
+
+ check_vect ();
+
+ res = main1 ();
+ if (res != 32 + 275)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c
new file mode 100644
index 000000000..9bf3b4b76
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 26
+
+__attribute__ ((noinline))
+unsigned int main1 ()
+{
+ unsigned short i;
+ unsigned int intsum = 0;
+
+ /* vectorization of reduction with induction, and widenning sum:
+ sum shorts into int.
+ Need -fno-tree-scev-cprop or else the loop is eliminated. */
+ for (i = 0; i < N; i++)
+ {
+ intsum += i;
+ }
+
+ return intsum;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
new file mode 100644
index 000000000..350c3f46b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
@@ -0,0 +1,92 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+struct s tmp;
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.b[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.b[i] != 5)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.c[i] = 6;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.c[i] != 6)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.d.k[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.d.k[i] != 7)
+ abort ();
+ }
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.e.k[i] = 8;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.e.k[i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-34.c
new file mode 100644
index 000000000..7600edf16
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-34.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct {
+ char ca[N];
+} s = {};
+char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-36.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-36.c
new file mode 100644
index 000000000..1384e8b7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-36.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+struct {
+ char ca[N];
+ char cb[N];
+} s;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.cb[i] = 3*i;
+ __asm__ volatile ("");
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = s.cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != s.cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
new file mode 100644
index 000000000..ab2f57677
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
@@ -0,0 +1,88 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ia[N][4][N+1];
+int ic[N][N][3][2*N+2];
+int id[N][N][N+4];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+
+ /* Multidimensional array. Not aligned: vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[i][1][j] = ib[i];
+ }
+ }
+
+ /* Multidimensional array. Aligned: vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ic[i][1][1][j] = ib[i];
+ }
+ }
+
+ /* Multidimensional array. Not aligned: vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ id[i][1][j+1] = ib[i];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[i][1][j] != ib[i])
+ abort();
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ic[i][1][1][j] != ib[i])
+ abort();
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (id[i][1][j+1] != ib[i])
+ abort();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-65.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-65.c
new file mode 100644
index 000000000..b1e74a9f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-65.c
@@ -0,0 +1,85 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define M 4
+
+int ib[M][M][N] = {{{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
+ {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
+ {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
+ {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}}};
+int ia[M][M][N];
+int ic[N];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+
+ /* Multidimensional array. Aligned. The "inner" dimensions
+ are invariant in the inner loop. Load and store. */
+ for (i = 0; i < M; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[i][1][j] = ib[2][i][j];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < M; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[i][1][j] != ib[2][i][j])
+ abort();
+ }
+ }
+
+ /* Multidimensional array. Aligned. The "inner" dimensions
+ are invariant in the inner loop. Load. */
+ for (i = 0; i < M; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ic[j] = ib[2][i][j];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < M; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ic[j] != ib[2][i][j])
+ abort();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
new file mode 100644
index 000000000..ffb455c05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
@@ -0,0 +1,84 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int ia[8][5][N+2];
+int ic[16][16][5][N+2];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+
+ /* Multidimensional array. Aligned. */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[2][6][j] = 5;
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[2][6][j] != 5)
+ abort();
+ }
+ }
+ /* Multidimensional array. Aligned. */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ ia[3][6][j+2] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 2; j < N+2; j++)
+ {
+ if (ia[3][6][j] != 5)
+ abort();
+ }
+ }
+
+ /* Multidimensional array. Not aligned. */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ic[2][1][6][j+1] = 5;
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ic[2][1][6][j+1] != 5)
+ abort();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { {! vect_aligned_arrays} && {vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {vect_aligned_arrays} && {! vect_sizes_32B_16B} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
new file mode 100644
index 000000000..7a7765110
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
@@ -0,0 +1,95 @@
+/* { dg-require-effective-target vect_int }
+ { dg-skip-if "AArch64 tiny code model does not support programs larger than 1MiB" {aarch64_tiny} {"*"} {""} }
+ */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+struct test1 tmp1;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i,j;
+
+ /* 1. unaligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.a.n[1][2][i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 5)
+ abort ();
+ }
+
+ /* 2. aligned */
+ for (i = 3; i < N-1; i++)
+ {
+ tmp1.a.n[1][2][i] = 6;
+ }
+
+ /* check results: */
+ for (i = 3; i < N-1; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 6)
+ abort ();
+ }
+
+ /* 3. aligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.e.n[1][2][i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 7)
+ abort ();
+ }
+
+ /* 4. unaligned */
+ for (i = 3; i < N-3; i++)
+ {
+ tmp1.e.n[1][2][i] = 8;
+ }
+
+ /* check results: */
+ for (i = 3; i <N-3; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 4 "vect" { target { {! vect_aligned_arrays} && {vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { {vect_aligned_arrays} && {! vect_sizes_32B_16B} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
new file mode 100644
index 000000000..890d39750
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
@@ -0,0 +1,120 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 24
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct s2{
+ int m;
+ int n[N-1][N-1][N-1];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+struct test2{
+ struct s2 a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s2 e; /* array e.n is aligned */
+};
+
+
+struct test1 tmp1[4];
+struct test2 tmp2[4];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i,j;
+
+ /* 1. unaligned (known misalignment) */
+ for (i = 0; i < N; i++)
+ {
+ tmp1[2].a.n[1][2][i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (tmp1[2].a.n[1][2][i] != 5)
+ abort ();
+ }
+
+ /* 2. aligned */
+ for (i = 3; i < N-1; i++)
+ {
+ tmp1[2].a.n[1][2][i] = 6;
+ }
+
+ /* check results: */
+ for (i = 3; i < N-1; i++)
+ {
+ if (tmp1[2].a.n[1][2][i] != 6)
+ abort ();
+ }
+
+ /* 3. aligned */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ tmp1[2].e.n[1][i][j] = 8;
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (tmp1[2].e.n[1][i][j] != 8)
+ abort ();
+ }
+ }
+
+ /* 4. unaligned (unknown misalignment) */
+ for (i = 0; i < N-4; i++)
+ {
+ for (j = 0; j < N-4; j++)
+ {
+ tmp2[2].e.n[1][i][j] = 8;
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N-4; i++)
+ {
+ for (j = 0; j < N-4; j++)
+ {
+ if (tmp2[2].e.n[1][i][j] != 8)
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { {! vector_alignment_reachable} || { vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-outer-4h.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-outer-4h.c
new file mode 100644
index 000000000..fc99122b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-outer-4h.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+
+#define N 40
+#define M 128
+unsigned short a[M][N];
+unsigned int out[N];
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline))
+void
+foo (){
+ int i,j;
+ unsigned int diff;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < M; j++) {
+ a[j][i] = 4;
+ }
+ out[i]=5;
+ }
+}
+
+int main (void)
+{
+ int i, j;
+ check_vect ();
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < M; j++) {
+ if (a[j][i] != 4)
+ abort ();
+ }
+ if (out[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-1.c
new file mode 100644
index 000000000..e9d957014
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-1.c
@@ -0,0 +1,12 @@
+/* Test for pr30485. */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_condition } */
+void
+foo (float a[32], float b[2][32])
+{
+ int i;
+ for (i = 0; i < 32; i++)
+ a[i] = (b[0][i] > b[1][i]) ? b[0][i] : b[1][i];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c
new file mode 100644
index 000000000..3971c920a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c
@@ -0,0 +1,39 @@
+/* Test for pr30485. */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ float a[N];
+
+ /* Condition in loop. */
+ /* This loop is vectorized on platforms that support vect_condition. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (b[i] > 0 ? b[i] : 0);
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != b[i])
+ abort ();
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c
new file mode 100644
index 000000000..673346a67
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ float a[N];
+
+ /* Condition in loop. */
+ /* This loop is vectorized on platforms that support vect_condition. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (b[i] > 0 ? b[i] : 0);
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != b[i])
+ abort ();
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target powerpc*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target i?86-*-* x86_64-*-* ia64-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c
new file mode 100644
index 000000000..a35b7ade8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c
@@ -0,0 +1,34 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] >= MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c
new file mode 100644
index 000000000..485e88cf3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c
@@ -0,0 +1,33 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] > MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c
new file mode 100644
index 000000000..58e6dc0a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c
@@ -0,0 +1,34 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] <= MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c
new file mode 100644
index 000000000..58e6dc0a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c
@@ -0,0 +1,34 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] <= MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c
new file mode 100644
index 000000000..a15a0b127
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c
@@ -0,0 +1,34 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+float B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] < MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c
new file mode 100644
index 000000000..d94aa3a64
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-dom-vect-bug.c
@@ -0,0 +1,30 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+long stack_vars_sorted[32];
+
+__attribute__ ((noinline)) int
+main1 (long n)
+{
+ long si;
+
+ for (si = 0; si < n; ++si)
+ stack_vars_sorted[si] = si;
+}
+
+int main ()
+{
+ long si;
+
+ check_vect ();
+ main1 (32);
+
+ for (si = 0; si < 32; ++si)
+ if (stack_vars_sorted[si] != si)
+ abort ();
+
+ return 0;
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-fre-pr50039.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-fre-pr50039.c
new file mode 100644
index 000000000..11c0c7004
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-fre-pr50039.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+extern unsigned char g_5;
+extern int g_31, g_76;
+int main(void) {
+ int i, j;
+ for (j=0; j < 2; ++j) {
+ g_31 = -3;
+ for (i=0; i < 2; ++i)
+ g_76 = (g_31 ? g_31+1 : 0) ^ g_5;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-pre-pr45241.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-pre-pr45241.c
new file mode 100644
index 000000000..289a930cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-pre-pr45241.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/45241 */
+/* { dg-do compile } */
+/* { dg-options "-ftree-vectorize" } */
+
+int
+foo (short x)
+{
+ short i, y;
+ int sum;
+
+ for (i = 0; i < x; i++)
+ y = x * i;
+
+ for (i = x; i > 0; i--)
+ sum += y;
+
+ return sum;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-pre-slp-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-pre-slp-29.c
new file mode 100644
index 000000000..e370ef307
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-pre-slp-29.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+int
+main1 (unsigned short *in)
+{
+ int i;
+ unsigned short out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*4] = in[i*4];
+ out[i*4 + 1] = in[i*4 + 1];
+ out[i*4 + 2] = in[i*4 + 2];
+ out[i*4 + 3] = in[i*4 + 3];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != in[i*4]
+ || out[i*4 + 1] != in[i*4 + 1]
+ || out[i*4 + 2] != in[i*4 + 2]
+ || out[i*4 + 3] != in[i*4 + 3])
+ abort ();
+ }
+
+ return 0;
+}
+
+int
+main2 (unsigned short * __restrict__ in, unsigned short * __restrict__ out)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*4] = in[i*4];
+ out[i*4 + 1] = in[i*4 + 1];
+ out[i*4 + 2] = in[i*4 + 2];
+ out[i*4 + 3] = in[i*4 + 3];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != in[i*4]
+ || out[i*4 + 1] != in[i*4 + 1]
+ || out[i*4 + 2] != in[i*4 + 2]
+ || out[i*4 + 3] != in[i*4 + 3])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ unsigned short out[N*8];
+
+ check_vect ();
+
+ main1 (&in2[5]);
+ main2 (&in2[3], &out[3]);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c
new file mode 100644
index 000000000..49274f88f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-reassoc-bb-slp-12.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int out[N];
+unsigned int in1[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+unsigned int in2[N] = {10,11,12,13,14,15,16,17,18,19,110,111,112,113,114,115};
+
+__attribute__ ((noinline)) int
+main1 (unsigned int x, unsigned int y)
+{
+ int i;
+ unsigned int *pin1 = &in1[0];
+ unsigned int *pin2 = &in2[0];
+ unsigned int *pout = &out[0];
+ unsigned int a0, a1, a2, a3;
+
+ a0 = *pin2++ - *pin1++ + 23;
+ a1 = *pin2++ - *pin1++ + 142;
+ a2 = *pin2++ - *pin1++ + 2;
+ a3 = *pin2++ - *pin1++ + 31;
+
+ *pout++ = a0 * x;
+ *pout++ = a1 * y;
+ *pout++ = a2 * x;
+ *pout++ = a3 * y;
+
+ /* Check results. */
+ if (out[0] != (in2[0] - in1[0] + 23) * x
+ || out[1] != (in2[1] - in1[1] + 142) * y
+ || out[2] != (in2[2] - in1[2] + 2) * x
+ || out[3] != (in2[3] - in1[3] + 31) * y)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (2, 3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-sra-bb-slp-pr50730.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-sra-bb-slp-pr50730.c
new file mode 100644
index 000000000..90dcd8443
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-tree-sra-bb-slp-pr50730.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+typedef __complex__ float Value;
+typedef struct {
+ Value a[16 / sizeof (Value)];
+} A;
+
+A sum(A a,A b)
+{
+ a.a[0]+=b.a[0];
+ a.a[1]+=b.a[1];
+ return a;
+}
+
+/* { dg-final { scan-tree-dump-times "not vectorized: more than one data ref in stmt" 0 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c
new file mode 100644
index 000000000..e475ffff6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+__attribute__ ((noinline))
+void with_restrict(int * __restrict p)
+{
+ int i;
+ int *q = p - 1;
+
+ for (i = 0; i < 1000; ++i) {
+ p[i] = q[i];
+ }
+}
+
+__attribute__ ((noinline))
+void without_restrict(int * p)
+{
+ int i;
+ int *q = p - 1;
+
+ for (i = 0; i < 1000; ++i) {
+ p[i] = q[i];
+ }
+}
+
+int main(void)
+{
+ int i;
+ int a[1002];
+ int b[1002];
+
+ check_vect ();
+
+ for (i = 0; i < 1002; ++i) {
+ a[i] = b[i] = i;
+ }
+
+ with_restrict(a + 1);
+ without_restrict(b + 1);
+
+ for (i = 0; i < 1002; ++i) {
+ if (a[i] != b[i])
+ abort();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c
new file mode 100644
index 000000000..6372aabd6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-101.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 9
+
+struct extraction
+{
+ int a[N];
+ int b[N];
+};
+
+static int a[N] = {1,2,3,4,5,6,7,8,9};
+static int b[N] = {2,3,4,5,6,7,8,9,0};
+
+__attribute__ ((noinline))
+int main1 (int x, int y) {
+ int i;
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ /* Not vectorizable: different unknown offset. */
+ for (i = 0; i < N; i++)
+ {
+ *((int *)p + x + i) = a[i];
+ *((int *)p + y + i) = b[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->a[i] != a[i] || p->b[i] != b[i])
+ abort();
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (0, N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c
new file mode 100644
index 000000000..2221049d7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 9
+
+struct extraction
+{
+ int a[N];
+ int b[N];
+};
+
+static int a[N] = {1,2,3,4,5,6,7,8,9};
+static int b[N] = {2,3,4,5,6,7,8,9,9};
+volatile int foo;
+
+__attribute__ ((noinline))
+int main1 (int x, int y) {
+ int i;
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ for (i = 0; i < N; i++)
+ {
+ p->a[i] = a[i];
+ if (foo == 135)
+ abort (); /* to avoid vectorization */
+ }
+
+ /* Not vectorizable: distance 1. */
+ for (i = 0; i < N - 1; i++)
+ {
+ *((int *)p + x + i + 1) = *((int *)p + x + i);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->a[i] != 1)
+ abort();
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ foo = 0;
+ return main1 (0, N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c
new file mode 100644
index 000000000..d7b68e53a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 9
+
+struct extraction
+{
+ int a[N];
+ int b[N];
+};
+
+static int a[N] = {1,2,3,4,5,6,7,8,9};
+static int b[N] = {2,3,4,5,6,7,8,9,9};
+volatile int foo;
+
+__attribute__ ((noinline))
+int main1 (int x, int y) {
+ int i;
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ for (i = 0; i < N; i++)
+ {
+ p->a[i] = a[i];
+ if (foo == 135)
+ abort (); /* to avoid vectorization */
+ }
+
+ /* Not vectorizable: distance 1. */
+ for (i = 0; i < N - 1; i++)
+ {
+ p->a[x + i + 1] = p->a[x + i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->a[i] != 1)
+ abort();
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ foo = 0;
+ return main1 (0, N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c
new file mode 100644
index 000000000..dff14ff5a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c
@@ -0,0 +1,63 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 (char *y)
+{
+ struct {
+ char *p;
+ char *q;
+ } s;
+ int i;
+
+ /* Not vectorized - can't antialias the pointer s.p from the array cb. */
+ s.p = y;
+ for (i = 0; i < N; i++)
+ {
+ s.p[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.p[i] != cb[i])
+ abort ();
+ }
+
+ /* Not vectorized - can't antialias the pointer s.p from the pointer s.q. */
+ s.q = cb;
+ for (i = 0; i < N; i++)
+ {
+ s.p[i] = s.q[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.p[i] != s.q[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (x);
+}
+
+/* Currently the loops fail to vectorize due to aliasing problems.
+ If/when the aliasing problems are resolved, unalignment may
+ prevent vectorization on some targets. */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "can't determine dependence" 4 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c
new file mode 100644
index 000000000..16a01d1a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-43.c
@@ -0,0 +1,94 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (float *pa, float *pb, float *pc)
+{
+ int i;
+ float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ for (i = 0; i < N; i++)
+ {
+ b[i] = pb[i];
+ c[i] = pc[i];
+ }
+
+ /* Vectorizable: pa may not alias pb and/or pc, even though their
+ addresses escape. &pa would need to escape to point to escaped memory. */
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = b[i] * c[i];
+ }
+
+ bar (pa,b,c);
+
+ return 0;
+}
+
+__attribute__ ((noinline)) int
+main2 (float *pa, float *pb, float *pc)
+{
+ int i;
+ float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ for (i = 0; i < N; i++)
+ {
+ b[i] = pb[i];
+ c[i] = pc[i];
+ }
+
+ /* Vectorizable: pb and pc addresses do not escape. */
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = b[i] * c[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (b[i] * c[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (a,b,c);
+ main2 (a,b,c);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-45.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-45.c
new file mode 100644
index 000000000..38328c1fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-45.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (const float *pa, const float *pb, const float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer accesses, with unknown alignment.
+ The loop bound is known and divisible by the vectorization factor.
+ Can't prove that the pointers don't alias.
+ vect-51.c is similar to this one with one difference:
+ the loop bound is unknown.
+ vect-44.c is similar to this one with one difference:
+ Aliasing is not a problem. */
+
+__attribute__ ((noinline)) int
+main1 (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N];
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (a,b,c);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-49.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-49.c
new file mode 100644
index 000000000..b883a94a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-49.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer read accesses, aligned pointer write access.
+ The loop bound is known and divisible by the vectorization factor.
+ Can't prove that the pointers don't alias.
+ vect-53.c is similar to this one with one difference:
+ the loop bound is unknown.
+ vect-48.c is similar to this one with one difference:
+ aliasing is not a problem. */
+
+__attribute__ ((noinline)) int
+main1 (float *pb, float *pc)
+{
+ float pa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float b[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
+ float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (b,c);
+ main1 (&b[1],c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-51.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-51.c
new file mode 100644
index 000000000..df463df6a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-51.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (const float *pa, const float *pb, const float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer accesses, with unknown alignment.
+ The loop bound is unknown.
+ Can't prove that the pointers don't alias.
+ vect-45.c is similar to this one with one difference:
+ the loop bound is known.
+ vect-50.c is similar to this one with one difference:
+ Aliasing is not a problem. */
+
+__attribute__ ((noinline)) int
+main1 (int n, float *pa, float *pb, float *pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N];
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (N,a,b,c);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-53.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-53.c
new file mode 100644
index 000000000..28deeaeac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-53.c
@@ -0,0 +1,63 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (const float *pa, const float *pb, const float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer read accesses, aligned pointer write access.
+ The loop bound is unknown.
+ Can't prove that the pointers don't alias.
+ vect-49.c is similar to this one with one difference:
+ the loop bound is known.
+ vect-52.c is similar to this one with one difference:
+ aliasing is not a problem. */
+
+__attribute__ ((noinline)) int
+main1 (int n, float *pb, float *pc)
+{
+ float pa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
+ float c[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
+
+ check_vect ();
+
+ main1 (N,&b[1],c);
+ main1 (N,&b[1],&c[1]);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c
new file mode 100644
index 000000000..63d332a39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-57.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <string.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (pa[i] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return;
+}
+
+__attribute__ ((noinline))
+void foo (float *pb, float *pc)
+{
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ memcpy (pb, b, sizeof (b));
+ memcpy (pc, c, sizeof (c));
+}
+
+/* Unaligned pointer read accesses with known alignment,
+ and an unaligned write access with unknown alignment.
+ The loop bound is known and divisible by the vectorization factor.
+ Can't prove that the pointers don't alias.
+ vect-61.c is similar to this one with one difference:
+ the loop bound is unknown.
+ vect-56.c is similar to this one with two differences:
+ aliasing is a problem, and the write access is aligned. */
+
+__attribute__ ((noinline)) int
+main1 (float *pa)
+{
+ int i;
+ float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float *pb = b;
+ float *pc = c;
+
+ foo (pb, pc);
+
+ for (i = 0; i < N/2; i++)
+ {
+ pa[i] = pb[i+1] * pc[i+1];
+ }
+
+ bar (pa, pb, pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ check_vect ();
+ main1 (a);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c
new file mode 100644
index 000000000..2df45fdfe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-61.c
@@ -0,0 +1,77 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <string.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (pa[i] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return;
+}
+
+__attribute__ ((noinline))
+void foo (float *pb, float *pc)
+{
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+ memcpy (pb, b, sizeof (b));
+ memcpy (pc, c, sizeof (c));
+}
+
+/* Unaligned pointer read accesses with known alignment,
+ and an unaligned write access with unknown alignment.
+ The loop bound is iunknown.
+ Can't prove that the pointers don't alias.
+ vect-57.c is similar to this one with one difference:
+ the loop bound is known.
+ vect-60.c is similar to this one with two differences:
+ aliasing is not a problem, and the write access is unaligned. */
+
+__attribute__ ((noinline)) int
+main1 (int n , float *pa)
+{
+ int i;
+ float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float *pb = b;
+ float *pc = c;
+
+ foo (pb, pc);
+
+ for (i = 0; i < n/2; i++)
+ {
+ pa[i] = pb[i+1] * pc[i+1];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ int n=N;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ check_vect ();
+ main1 (n,a);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c
new file mode 100644
index 000000000..1653f3d6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-79.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float fa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float fb[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
+float fc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5};
+
+/* Like vect-80.c but the pointers are not annotated as restricted,
+ and therefore can't be antialiased. */
+
+__attribute__ ((noinline)) int
+main1 (float *pa, float *pb, float *pc)
+{
+ int i;
+ float *q = pb + 4;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = q[i] * pc[i];
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != q[i] * pc[i])
+ abort();
+ }
+
+ return 0;
+}
+
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (fa, fb, fc);
+
+ return 0;
+}
+
+/* Currently the loops fail to vectorize due to aliasing problems.
+ If/when the aliasing problems are resolved, unalignment may
+ prevent vectorization on some targets. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
new file mode 100644
index 000000000..5679ff765
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 17
+
+int ia[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48};
+int res[N] = {12,24,36,48,60,72,84,96,108,120,132,144,156,168,180,192,48};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ /* Not vectorizable due to data dependence: dependence distance 1. */
+ for (i = 0; i < N - 1; i++)
+ {
+ ia[i+1] = ia[i] * 4;
+ }
+
+ /* check results: */
+ for (i = 0; i < N - 1; i++)
+ {
+ if (ia[i] != 0)
+ abort ();
+ }
+
+ /* Vectorizable. Dependence distance -1. */
+ for (i = 0; i < N - 1; i++)
+ {
+ ib[i] = ib[i+1] * 4;
+ }
+
+ /* check results: */
+ for (i = 0; i < N - 1; i++)
+ {
+ if (ib[i] != res[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "dependence distance negative" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c
new file mode 100644
index 000000000..f84528a50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-2.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 17
+
+int ia[N] = {48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3,0};
+int ib[N] = {48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3,0};
+int res[N] = {48,192,180,168,156,144,132,120,108,96,84,72,60,48,36,24,12};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ /* Not vectorizable due to data dependence: dependence distance 1. */
+ for (i = N - 2; i >= 0; i--)
+ {
+ ia[i] = ia[i+1] * 4;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != 0)
+ abort ();
+ }
+
+ /* Vectorizable. Dependence distance -1. */
+ for (i = N - 2; i >= 0; i--)
+ {
+ ib[i+1] = ib[i] * 4;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ib[i] != res[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "dependence distance negative" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-3.c
new file mode 100644
index 000000000..8f937a0f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-3.c
@@ -0,0 +1,187 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+int ia[N + 1];
+int ib[N + 1];
+
+/* Vectorizable. Dependence distance -1. */
+__attribute__((noinline)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ ia[i + 1] = 1;
+ ib[i] = ia[i];
+ }
+}
+
+/* Not vectorizable due to data dependence: dependence distance 1. */
+__attribute__((noinline)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = 1;
+ ib[i] = ia[i + 1];
+ }
+}
+
+/* Not vectorizable due to data dependence: dependence distance 1. */
+__attribute__((noinline)) void
+f3 (void)
+{
+ int i;
+ for (i = N - 1; i >= 0; i--)
+ {
+ ia[i + 1] = 1;
+ ib[i] = ia[i];
+ }
+}
+
+/* Vectorizable. Dependence distance -1. */
+__attribute__((noinline)) void
+f4 (void)
+{
+ int i;
+ for (i = N - 1; i >= 0; i--)
+ {
+ ia[i] = 1;
+ ib[i] = ia[i + 1];
+ }
+}
+
+/* Vectorizable. Dependence distance -1. */
+__attribute__((noinline)) void
+f5 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ ia[i + 1] = 1;
+ ia[i] = 2;
+ }
+}
+
+/* Not vectorizable due to data dependence: dependence distance 1. */
+__attribute__((noinline)) void
+f6 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = 1;
+ ia[i + 1] = 2;
+ }
+}
+
+/* Not vectorizable due to data dependence: dependence distance 1. */
+__attribute__((noinline)) void
+f7 (void)
+{
+ int i;
+ for (i = N - 1; i >= 0; i--)
+ {
+ ia[i + 1] = 1;
+ ia[i] = 2;
+ }
+}
+
+/* Vectorizable. Dependence distance -1. */
+__attribute__((noinline)) void
+f8 (void)
+{
+ int i;
+ for (i = N - 1; i >= 0; i--)
+ {
+ ia[i] = 1;
+ ia[i + 1] = 2;
+ }
+}
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i, j;
+
+ for (j = 0; j < 8; j++)
+ {
+ for (i = 0; i <= N; i++)
+ {
+ ia[i] = i + 3;
+ ib[i] = i + N + 3;
+ asm ("");
+ }
+
+ switch (j)
+ {
+ case 0: f1 (); break;
+ case 1: f2 (); break;
+ case 2: f3 (); break;
+ case 3: f4 (); break;
+ case 4: f5 (); break;
+ case 5: f6 (); break;
+ case 6: f7 (); break;
+ case 7: f8 (); break;
+ }
+
+ for (i = 0; i <= N; i++)
+ {
+ int ea = i + 3;
+ int eb = i + N + 3;
+ switch (j)
+ {
+ case 0:
+ if (i) ea = 1;
+ if (i == 0) eb = 3;
+ else if (i != N) eb = 1;
+ break;
+ case 1:
+ if (i != N) ea = 1;
+ if (i != N) eb = i + 4;
+ break;
+ case 2:
+ if (i) ea = 1;
+ if (i != N) eb = i + 3;
+ break;
+ case 3:
+ if (i != N) ea = 1;
+ if (i < N - 1) eb = 1;
+ else if (i == N - 1) eb = 67;
+ break;
+ case 4:
+ ea = 1 + (i != N);
+ break;
+ case 5:
+ ea = 2 - (i != N);
+ break;
+ case 6:
+ ea = 1 + (i == 0);
+ break;
+ case 7:
+ ea = 2 - (i == 0);
+ break;
+ }
+ if (ia[i] != ea || ib[i] != eb)
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+int main ()
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "dependence distance negative" 4 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-dv-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-dv-2.c
new file mode 100644
index 000000000..2b4482a3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/no-vfa-vect-dv-2.c
@@ -0,0 +1,79 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 64
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ int A[N];
+ int B[N];
+ int C[N];
+ int D[N];
+ int E[N] = {0,1,2,0};
+
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ A[i] = i;
+ B[i] = i;
+ C[i] = i;
+ D[i] = i;
+ }
+
+ /* Vectorizable */
+ for (i = 0; i < N-20; i++)
+ {
+ A[i] = A[i+20];
+ }
+
+ /* check results: */
+ for (i = 0; i < N-20; i++)
+ {
+ if (A[i] != D[i+20])
+ abort ();
+ }
+
+ /* Vectorizable */
+ for (i = 0; i < 16; i++)
+ {
+ B[i] = B[i] + 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ if (B[i] != C[i] + 5)
+ abort ();
+ }
+
+ /* Not vectorizable */
+ for (i = 0; i < 4; i++)
+ {
+ C[i+3] = C[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < 4; i++)
+ {
+ if (C[i] != E[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+
+/* The initialization induction loop (with aligned access) is also vectorized. */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 2 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/nodump-forwprop-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/nodump-forwprop-22.c
new file mode 100644
index 000000000..526e70b1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/nodump-forwprop-22.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_perm } */
+/* { dg-additional-options "-fdump-tree-copyprop1" } */
+
+typedef double vec __attribute__((vector_size (2 * sizeof (double))));
+void f (vec *px, vec *y, vec *z)
+{
+ vec x = *px;
+ vec t1 = { x[1], x[0] };
+ vec t2 = { x[0], x[1] };
+ *y = t1;
+ *z = t2;
+}
+
+/* Optimization in forwprop1, cleanup in copyprop1. */
+
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "copyprop1" } } */
+/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "copyprop1" } } */
+/* { dg-final { cleanup-tree-dump "copyprop1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/nodump-pr23073.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/nodump-pr23073.c
new file mode 100644
index 000000000..d13279919
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/nodump-pr23073.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+extern struct {
+ int o[2];
+ int p[2];
+} d;
+
+void C()
+{
+ int i;
+
+ for( i=0; i<2; ++i )
+ {
+ d.o[i] = 0;
+ d.p[i] = 0;
+ }
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr16105.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr16105.c
new file mode 100644
index 000000000..c59fe0573
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr16105.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+#define VECTOR_SIZE 512
+
+extern void check(const float * __restrict__ v);
+
+void square(const float * __restrict__ a,
+ float * __restrict__ out)
+{
+ unsigned int i;
+ for (i = 0; i < VECTOR_SIZE; i++) {
+ float ai = a[i];
+ float a2 = ai * ai;
+ out[i] = a2;
+ }
+ check(out);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18308.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18308.c
new file mode 100644
index 000000000..02aaed2f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18308.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -funroll-loops" } */
+void foo();
+
+void bar(int j)
+{
+ int i, k=0;
+ for (i = 0; i < 2; ++i)
+ if (j) k = 2;
+
+ if (k) foo();
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18400.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18400.c
new file mode 100644
index 000000000..50971046f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18400.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int b[N] = {0,3,6,9,12,15,18,21};
+int a[N];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = b[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != b[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18425.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18425.c
new file mode 100644
index 000000000..08f7b65cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18425.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* ??? Using "long" isn't quite right; we're testing vectors of pointers here.
+ But since no extant target supports sizeof(long) != sizeof(void*)... */
+/* { dg-require-effective-target vect_long } */
+
+char ** _M_allocate();
+void
+_M_fill_insert(unsigned int __n)
+{
+ char **__new_start = _M_allocate();
+ char *__tmp = 0;
+ for (; __n > 0; --__n, ++__new_start)
+ *__new_start = __tmp;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18536.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18536.c
new file mode 100644
index 000000000..6eac90ff1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr18536.c
@@ -0,0 +1,35 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline)) int main1 (short a, short *b)
+{
+ while (++a < 4) *b++ = 2;
+
+ return 0;
+}
+
+int main (void)
+{
+ int i = 0;
+ short x[N];
+
+ check_vect ();
+
+ main1 (0, x);
+
+ /* check results: */
+ while (++i < 4)
+ {
+ if (x[i-1] != 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr20122.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr20122.c
new file mode 100644
index 000000000..9d21fc600
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr20122.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+short Kernshort[24] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+static void VecBug(short Kernel[8][24]) __attribute__((noinline));
+static void VecBug2(short Kernel[8][24]) __attribute__((noinline));
+
+/* Kernel may alias Kernshort - a global array.
+ Use versioning for aliasing. */
+static void VecBug(short Kernel[8][24])
+{
+ int k,i;
+ for (k = 0; k<8; k++)
+ for (i = 0; i<24; i++)
+ Kernshort[i] = Kernel[k][i];
+}
+
+/* Vectorizable: Kernshort2 is local. */
+static void VecBug2(short Kernel[8][24])
+{
+ int k,i;
+ short Kernshort2[24] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ for (k = 0; k<8; k++)
+ for (i = 0; i<24; i++)
+ Kernshort2[i] = Kernel[k][i];
+
+ for (k = 0; k<8; k++)
+ for (i = 0; i<24; i++)
+ if (Kernshort2[i] != Kernel[k][i])
+ abort ();
+}
+
+int main (int argc, char **argv)
+{
+ check_vect ();
+
+ short Kernel[8][24] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ int k,i;
+
+ for (k = 0; k<8; k++)
+ for (i = 0; i<24; i++)
+ Kernel[k][i] = 0;
+
+ VecBug(Kernel);
+ VecBug2(Kernel);
+
+ return 0;
+}
+
+/* The loops in VecBug and VecBug2 require versioning for alignment.
+ The loop in main is aligned. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr21591.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr21591.c
new file mode 100644
index 000000000..425777738
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr21591.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+struct a
+{
+ int length;
+ int a1[256];
+};
+
+struct a *malloc1(__SIZE_TYPE__) __attribute__((malloc));
+void free(void*);
+
+struct a *p, *q, *r;
+
+void f(void)
+{
+ struct a *a = malloc1(sizeof(struct a));
+ struct a *b = malloc1(sizeof(struct a));
+ struct a *c = malloc1(sizeof(struct a));
+ int i;
+
+ for (i = 0; i < 256; i++)
+ {
+ b->a1[i] = i;
+ c->a1[i] = i;
+ }
+ for (i = 0; i < 256; i++)
+ {
+ a->a1[i] = b->a1[i] + c->a1[i];
+ }
+ p = a;
+ q = b;
+ r = c;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr21969.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr21969.c
new file mode 100644
index 000000000..388fc3129
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr21969.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+typedef float vsf __attribute__((vector_size(2048)));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr22480.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr22480.c
new file mode 100644
index 000000000..a7e238f22
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr22480.c
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_shift } */
+
+void
+test_1 (void)
+{
+ static unsigned int bm[16];
+ int j;
+ for (j = 0; j < 16; j++)
+ bm[j] <<= 8;
+}
+
+void
+test_2 (int a)
+{
+ static unsigned int bm[16];
+ int j;
+ for (j = 0; j < 16; j++)
+ bm[j] <<= a;
+}
+
+void
+test_3 (void)
+{
+ static unsigned bm[16];
+ int am[16];
+ int j;
+ for (j = 0; j < 16;j++)
+ bm[j] <<= am[j];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr22506.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr22506.c
new file mode 100644
index 000000000..a618e3291
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr22506.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+float x[3];
+
+void foo()
+{
+ int i;
+
+ for (i=0; i<3; ++i) x[i]=0;
+ for (i=0; i<2; ++i) ;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23816-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23816-1.c
new file mode 100644
index 000000000..9c76d2e9d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23816-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_condition } */
+
+void
+foo (float a[32], float b[2][32])
+{
+ int i;
+ for (i = 0; i < 32; i++)
+ a[i] = (b[0][i] > b[1][i]) ? b[0][i] : b[1][i];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23816-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23816-2.c
new file mode 100644
index 000000000..408eb4972
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23816-2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_condition } */
+
+void
+foo (double a[32], double b[2][32])
+{
+ int i;
+ for (i = 0; i < 32; i++)
+ a[i] = (b[0][i] > b[1][i]) ? b[0][i] : b[1][i];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23831.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23831.c
new file mode 100644
index 000000000..dfa21ce0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr23831.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void foo (void)
+{
+ static unsigned int bm[16];
+ int j;
+ for (j = 0; j < 16; j++)
+ bm[j] = bm[j] * 8;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24049.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24049.c
new file mode 100644
index 000000000..ee03fe3ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24049.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize --param ggc-min-heapsize=0 --param ggc-min-expand=0" } */
+
+int DES_CBCUpdate(unsigned char * output, int len)
+{
+ int work[2];
+ unsigned int i;
+ for(i = 0;i < len/8;i++)
+ unscrunch (&output[8*i], work);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24059.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24059.c
new file mode 100644
index 000000000..0849d15c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24059.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_condition } */
+
+struct pred_data
+{
+ unsigned char codes[((int) 100)];
+};
+
+void compute_predicate_codes (char *codes, struct pred_data *p)
+{
+ int i;
+ for (i = 0; i < ((int) 100); i++)
+ codes[i] = p->codes[i] ? 2 : 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24300.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24300.c
new file mode 100644
index 000000000..7a79e96c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr24300.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+
+static int *** foo (int);
+
+void
+bar ()
+{
+ int ***p = foo (2);
+}
+
+extern int *nd;
+extern int ***tc;
+extern int *ap;
+extern int *as;
+extern float ss;
+
+static int ***
+foo (int Fc)
+{
+ int i, j, s, p, n, t;
+
+ n = 0;
+ for (s = 0; s < 4; s++)
+ n += nd[s];
+
+ for (i = 0; i < n; i++)
+ {
+ p = ap[i];
+ s = as[i];
+ for (j = 0; j < Fc; j++)
+ tc[p][s][j] = i * ss + j;
+ }
+
+ return (tc);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25371.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25371.c
new file mode 100644
index 000000000..ad962f47c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25371.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+void slow_close(int n)
+{
+ int i;
+ double *mm;
+
+ for (i=0;i<2*n;i++)
+ for (i=0;i<2*n;i++)
+ *(mm+i*2*n+i) = 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25413.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25413.c
new file mode 100644
index 000000000..e48373268
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25413.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+struct
+{
+ char c;
+ double d[N];
+} a;
+
+__attribute__ ((noinline))
+int main1()
+{
+ int i;
+ for ( i=0; i<N; ++i )
+ a.d[i]=1;
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ check_vect ();
+
+ main1 ();
+ for (i=0; i<N; i++)
+ if (a.d[i] != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vector_alignment_reachable_for_64bit } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { {! vector_alignment_reachable_for_64bit} && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { {! vector_alignment_reachable_for_64bit} && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 1 "vect" { target { {! vector_alignment_reachable_for_64bit} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25413a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25413a.c
new file mode 100644
index 000000000..b9bef5f5b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr25413a.c
@@ -0,0 +1,129 @@
+/* { dg-require-effective-target vect_double } */
+
+#include "tree-vect.h"
+
+#define N 8
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void *malloc (size_t __size) __attribute__ ((__nothrow__,
+ __malloc__));
+
+typedef double num_t;
+static const num_t num__infty = ((num_t)1.0)/((num_t)0.0);
+
+struct oct_tt;
+typedef struct oct_tt oct_t;
+
+typedef unsigned int var_t;
+typedef enum {
+ OCT_EMPTY = 0,
+ OCT_NORMAL = 1,
+ OCT_CLOSED = 2
+} oct_state;
+
+struct oct_tt {
+ var_t n;
+
+ int ref;
+
+ oct_state state;
+ struct oct_tt* closed;
+
+ num_t* c;
+};
+
+void* octfapg_mm_malloc (size_t t);
+oct_t* octfapg_alloc (var_t n);
+oct_t* octfapg_full_copy (oct_t* m);
+
+struct mmalloc_tt;
+typedef struct mmalloc_tt mmalloc_t;
+
+struct mmalloc_tt
+{
+ int id;
+
+ int nb_alloc;
+ int nb_realloc;
+ int nb_free;
+
+ size_t rem;
+ size_t max;
+ size_t tot;
+
+};
+
+typedef struct
+{
+ size_t size;
+
+ mmalloc_t* mm;
+ int id;
+
+ double dummy;
+
+} mmheader_t;
+
+void*
+octfapg_mm_malloc (size_t t)
+{
+ char* m = (char*)malloc(t+sizeof(mmheader_t));
+ return m+sizeof(mmheader_t);
+}
+
+oct_t* octfapg_empty (var_t n);
+
+oct_t*
+octfapg_empty (const var_t n)
+{
+ oct_t* m;
+ /*octfapg_timing_enter("oct_empty",3);*/
+ m = ((oct_t*) octfapg_mm_malloc (sizeof(oct_t)));
+ m->n = n;
+ m->ref = 1;
+ m->state = OCT_EMPTY;
+ m->closed = (oct_t*)((void *)0);
+ m->c = (num_t*)((void *)0);
+ /*octfapg_timing_exit("oct_empty",3);*/
+ return m;
+}
+
+oct_t*
+octfapg_alloc (const var_t n)
+{
+ size_t nn = (2*(size_t)(n)*((size_t)(n)+1));
+ oct_t* m;
+ m = octfapg_empty(n);
+ m->c = ((num_t*) octfapg_mm_malloc (sizeof(num_t)*(nn)));
+ ;
+ m->state = OCT_NORMAL;
+ m->closed = (oct_t*)((void *)0);
+ return m;
+}
+
+oct_t*
+octfapg_universe (const var_t n)
+{
+ oct_t* m;
+ size_t i, nn = (2*(size_t)(n)*((size_t)(n)+1));
+ m = octfapg_alloc(n);
+ for (i=0;i<nn;i++) *(m->c+i) = num__infty;
+ for (i=0;i<2*n;i++) *(m->c+((size_t)(i)+(((size_t)(i)+1)*((size_t)(i)+1))/2)) = (num_t)(0);
+ m->state = OCT_CLOSED;
+ return m;
+}
+
+int main (void)
+{
+ int i;
+ check_vect ();
+
+ oct_t *p = octfapg_universe(10);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr27151.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr27151.c
new file mode 100644
index 000000000..81f89b1a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr27151.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+/* We were creating a float vector for the vis_type == 1
+ test, which we ICEd on. Now we simply punt here. */
+
+float vs_data[75];
+void vis_clear_data ()
+{
+ int vis_type, i;
+ for (i = 0; i < 75; i++)
+ {
+ vs_data[i] = (vis_type == 1);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr28952.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr28952.c
new file mode 100644
index 000000000..7305e607c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr28952.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+
+/* We were ICE because we wanted to check the type of the
+ elements of a conditional before we knew it was a conditional. */
+
+struct player_spaceship
+{
+ _Bool structure[32];
+};
+struct player
+{
+ struct player_spaceship spaceship;
+};
+struct packet_spaceship_info
+{
+ char structure[32 + 1];
+};
+send_spaceship_info (void)
+{
+ int j;
+ struct player *pplayer;
+ struct packet_spaceship_info info;
+ struct player_spaceship *ship = &pplayer->spaceship;
+ for (j = 0; j < 32; j++)
+ {
+ info.structure[j] = ship->structure[j] ? '1' : '0';
+ }
+ lsend_packet_spaceship_info (&info);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30771.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30771.c
new file mode 100644
index 000000000..e9f4bd2ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30771.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int a[128];
+
+int
+main()
+{
+ short i;
+
+ for (i=0; i<64; i++){
+ a[i] = (int)i;
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30784.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30784.c
new file mode 100644
index 000000000..3df9afe3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30784.c
@@ -0,0 +1,30 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+long stack_vars_sorted[32];
+
+int
+main1 (long n)
+{
+ long si;
+
+ for (si = 0; si < n; ++si)
+ stack_vars_sorted[si] = si;
+}
+
+int main ()
+{
+ long si;
+
+ check_vect ();
+ main1 (32);
+
+ for (si = 0; si < 32; ++si)
+ if (stack_vars_sorted[si] != si)
+ abort ();
+
+ return 0;
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30795.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30795.c
new file mode 100644
index 000000000..53dc9fa51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30795.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+char bigDone[260];
+int runningOrder[260];
+
+int
+main()
+{
+ int i;
+ for (i = 0; i <= 255; i++) {
+ bigDone [i] = ((char)0);
+ runningOrder[i] = i;
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30843.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30843.c
new file mode 100644
index 000000000..2e0855f6c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30843.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_long } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+void dacP98FillRGBMap (unsigned char *pBuffer)
+{
+ unsigned long dw, dw1;
+ unsigned long *pdw = (unsigned long *)(pBuffer);
+
+ for( dw = 256, dw1 = 0; dw; dw--, dw1 += 0x01010101)
+ {
+ *pdw++ = dw1;
+ *pdw++ = dw1;
+ *pdw++ = dw1;
+ *pdw++ = dw1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided4 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30858.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30858.c
new file mode 100644
index 000000000..0e7f7e10d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr30858.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int
+foo (int ko)
+{
+ int j,i;
+ for (j = 0; j < ko; j++)
+ i += (i > 10) ? -5 : 7;
+ return i;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump "Unknown def-use cycle pattern." "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31041.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31041.c
new file mode 100644
index 000000000..361b358b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31041.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+struct UNewTrie
+{
+ int index[(0x110000 >> 1)];
+};
+typedef struct UNewTrie UNewTrie;
+utrie_open_3_4 ()
+{
+ UNewTrie *trie;
+ int i, j;
+ {
+ i = 0;
+ do
+ {
+ trie->index[i++] = j;
+ j += 1;
+ }
+ while (i < 5);
+ }
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31343.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31343.c
new file mode 100644
index 000000000..856422221
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31343.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+
+#define N 16
+
+struct
+{
+ unsigned int x;
+ unsigned int y;
+} pS [100];
+
+void
+main1 ()
+{
+ int i, j;
+ unsigned int ub[N] =
+ { 1, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45 };
+ unsigned int uc[N] =
+ { 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ unsigned int udiffx, udiffy;
+
+ for (i = 0; i < N; i++)
+ {
+ pS[i].x = 0;
+ pS[i].y = 0;
+ for (j = 0; j < N; j++)
+ {
+ udiffx = (ub[j] - uc[j]);
+ udiffy = (ub[j] - uc[j]);
+ pS[i].x = udiffx;
+ pS[i].y = udiffy;
+ }
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31699.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31699.c
new file mode 100644
index 000000000..6015d5cd4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr31699.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+float x[256];
+
+__attribute__ ((noinline))
+double *foo(void)
+{
+ double *z = malloc (sizeof(double) * 256);
+
+ int i;
+ for (i=0; i<256; ++i)
+ z[i] = x[i] + 1.0f;
+
+ return z;
+}
+
+
+int main()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < 256; i++)
+ x[i] = (float) i;
+
+ foo();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { scan-tree-dump-times "vector alignment may not be reachable" 1 "vect" { target { ! vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32216.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32216.c
new file mode 100644
index 000000000..cf2744125
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32216.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_floatint_cvt } */
+
+unsigned int wlookup2[203];
+
+SetSoundVariables (int x)
+{
+ for (x = 1; x < 32; x++)
+ {
+ wlookup2[x] = (double) 16 / x;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32224.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32224.c
new file mode 100644
index 000000000..6f3a36b4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32224.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+typedef unsigned long int *mp_ptr;
+typedef const unsigned long int *mp_srcptr;
+gmpz_export (void *data)
+{
+ mp_srcptr zp;
+ int count, i;
+ mp_ptr __dst = ((mp_ptr) data);
+ mp_srcptr __src = (zp);
+
+ for (i = 0; i < count; i++)
+ {
+ __asm__ ("checkme": "=r" (*__dst):"0" (*(__src)));
+ __src++;
+ }
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32230.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32230.c
new file mode 100644
index 000000000..bdb290ab4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32230.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+typedef struct filter_buffer filter_buffer_t;
+struct filter_buffer
+{
+ char buf[1];
+};
+typedef struct sbuf_header sbuf_header_t;
+struct sbuf_header
+{
+ char buf[1];
+}
+const_f (filter_buffer_t *buf)
+{
+ float val;
+ int i;
+
+ for (i = 0; i < 10; i++)
+ ((float*) (&((sbuf_header_t *) (__PTRDIFF_TYPE__)((buf) == (filter_buffer_t *)&(buf)->buf[0]))->buf[0]))[i] = val;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32366.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32366.c
new file mode 100644
index 000000000..e83d579e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32366.c
@@ -0,0 +1,14 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+stream_test (void)
+{
+ static float input[20];
+ int k;
+ for (k = 0; k < 20; k++)
+ input[k] = k * 1.0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32421.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32421.c
new file mode 100644
index 000000000..68d51bd74
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32421.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+
+int f(int **__restrict a, int ** __restrict b)
+{
+ int i;
+ for(i= 0;i<32;i++)
+ a[i] = b[i] + 1;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32824.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32824.c
new file mode 100644
index 000000000..8f36d1db2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr32824.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int a[16*100];
+int e;
+void foo(void)
+{
+ int i;
+ for(i = 0;i<16*100;i++)
+ e += a[i];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33369.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33369.c
new file mode 100644
index 000000000..1aaf4e366
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33369.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+typedef struct tagPOINT
+{
+ int x;
+ int y;
+} POINT;
+
+void
+f (POINT * ptBuf)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ ptBuf[i].x = ((ptBuf[i].x) << 4);
+ ptBuf[i].y = ((ptBuf[i].y) << 4);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33373.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33373.c
new file mode 100644
index 000000000..b11cfb4eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33373.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+void DOSMEM_FillIsrTable(int*isr) {
+ int i;
+
+ for (i=0; i<256; i++)
+ isr[i]=(((short)((i*4) & 0xFFFF)) | (0xf000 & 0xFFFF) << 16);
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33373b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33373b.c
new file mode 100644
index 000000000..c294a385c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33373b.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+void f (unsigned int *d, unsigned int *s, int w)
+{
+ int i;
+ for (i = 0; i < w; ++i)
+ d [i] = s [i] * (unsigned short) (~d [i] >> 24);
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33597.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33597.c
new file mode 100644
index 000000000..7fdcde07f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33597.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+
+void
+rgb15to24_C (const uint8_t * src, uint8_t * dst, long src_size)
+{
+ const uint16_t *end;
+ const uint16_t *s = (uint16_t *)src;
+ uint8_t *d = (uint8_t *)dst;
+
+ end = s + src_size/2;
+ while (s < end)
+ {
+ uint16_t bgr = *s++;
+
+ *d++ = (bgr&0x1F)<<3;
+ *d++ = (bgr&0x3E0)>>2;
+ *d++ = (bgr&0x7C00)>>7;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33804.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33804.c
new file mode 100644
index 000000000..a4fb38683
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33804.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void f(unsigned char *s, unsigned char *d, int n) {
+ int i;
+ for (i = 0; i < n; i += 4) {
+ d[i + 0] += s[i + 0];
+ d[i + 1] += s[i + 1];
+ d[i + 2] += s[i + 2];
+ d[i + 3] += s[i + 3];
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33833.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33833.c
new file mode 100644
index 000000000..ebdfcb1f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33833.c
@@ -0,0 +1,35 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+/* { dg-do compile } */
+
+#define signed
+typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
+#undef signed
+
+struct list_head
+{
+ struct list_head *prev;
+};
+struct prio_array
+{
+ struct list_head queue[100];
+};
+struct rq
+{
+ struct prio_array *active, arrays[2];
+} per_cpu__runqueues;
+
+void sched_init (uintptr_t __ptr)
+{
+ int j, k;
+ struct prio_array *array;
+ struct rq *rq;
+ rq = (&(*( { (typeof (&per_cpu__runqueues)) (__ptr); } )));
+ for (j = 0; j < 2; j++)
+ {
+ array = rq->arrays + j;
+ for (k = 0; k < 100; k++)
+ (array->queue + k)->prev = array->queue;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33846.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33846.c
new file mode 100644
index 000000000..3f421c9b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33846.c
@@ -0,0 +1,24 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_shift } */
+
+int clamp_val (int i)
+{
+ return ~i >> 31;
+}
+
+typedef __PTRDIFF_TYPE__ intptr_t;
+
+void _mix_some_samples (intptr_t buf, int *mix_buffer, int mix_size)
+{
+ int i;
+ signed int *p = mix_buffer;
+ for (i = mix_size ; i > 0; i--)
+ {
+ *((short *) buf) = clamp_val ((*p) + 0x800000);
+ buf += 2;
+ p++;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33866.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33866.c
new file mode 100644
index 000000000..8adb2e7ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33866.c
@@ -0,0 +1,32 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_long } */
+
+typedef struct
+{
+ long *coords;
+}
+fill_iter_info;
+
+extern H5Diterate (fill_iter_info *);
+
+void test_select_fill_hyper_simple (long *offset)
+{
+ long start[2];
+ int num_points;
+ long points[16][2];
+ fill_iter_info iter_info;
+ int i, j;
+ iter_info.coords = (long *) points;
+ for (i = 0, num_points = 0; j < (int) start[1]; j++, num_points++)
+ {
+ points[num_points][0] = i + start[0];
+ points[num_points][1] = j + start[1];
+ }
+ H5Diterate (&iter_info);
+}
+
+/* Needs interleaving support. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33953.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33953.c
new file mode 100644
index 000000000..f501a452e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr33953.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+typedef unsigned int UINT32;
+
+void blockmove_NtoN_blend_noremap32 (const UINT32 *srcdata, int srcwidth,
+ int srcheight, int srcmodulo,
+ UINT32 *dstdata, int dstmodulo,
+ int srcshift)
+{
+ UINT32 *end;
+
+ while (srcheight)
+ {
+ while (dstdata <= end - 8)
+ {
+ dstdata[0] |= srcdata[0] << srcshift;
+ dstdata[1] |= srcdata[1] << srcshift;
+ dstdata[2] |= srcdata[2] << srcshift;
+ dstdata[3] |= srcdata[3] << srcshift;
+ dstdata[4] |= srcdata[4] << srcshift;
+ dstdata[5] |= srcdata[5] << srcshift;
+ dstdata[6] |= srcdata[6] << srcshift;
+ dstdata[7] |= srcdata[7] << srcshift;
+ dstdata += 8;
+ srcdata += 8;
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34005.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34005.c
new file mode 100644
index 000000000..86c38321b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34005.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/34005 */
+/* { dg-do compile } */
+
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+
+void XdmcpUnwrap (unsigned char *output, int k)
+{
+ int i;
+ unsigned char blocks[2][8];
+ k = (k == 0) ? 1 : 0;
+
+ for (i = 0; i < 8; i++)
+ output[i] = blocks[k][i];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34407.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34407.c
new file mode 100644
index 000000000..3da2ed7b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34407.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+extern int ReadBlobByte (void);
+
+void ReadRLEImage (unsigned char *p)
+{
+ unsigned char background_color[4] = { 0, 1, 2, 3 };
+ long j;
+
+ unsigned long number_planes = ReadBlobByte();
+
+ for (j = 0; j < (long) number_planes; j++)
+ *p++ = background_color[j];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34591.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34591.c
new file mode 100644
index 000000000..1f02544c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr34591.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+int av_resample(int filter_length, short *src, short *filter)
+{
+ int i;
+ int val=0;
+ for(i=0; i<filter_length; i++)
+ val += src[ i ] * filter[i];
+ return val;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36228.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36228.c
new file mode 100644
index 000000000..73933754c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36228.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-vect-details" } */
+
+#define COLS 8
+#define ROWS 8
+
+int
+t_run_test(void);
+
+int
+t_run_test()
+{
+ int k_1,i_1, j_1;
+ static signed char f_1[ROWS][COLS] ;
+ static long F_1[ROWS][COLS] ;
+ long cosMatrixA[ROWS][COLS] ;
+
+ for( k_1 = 0 ; k_1 < COLS ; k_1++ )
+ {
+ for( i_1 = 0 ; i_1 < ROWS ; i_1++ )
+ {
+ for( j_1 = 0 ; j_1 < COLS ; j_1++ )
+ F_1[i_1][j_1] += f_1[i_1][k_1] * cosMatrixA[k_1][j_1] ;
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "versioning for alias required" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36493.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36493.c
new file mode 100644
index 000000000..98517dfc5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36493.c
@@ -0,0 +1,25 @@
+/* { dg-require-effective-target vect_long } */
+
+#include "tree-vect.h"
+
+int
+main (void)
+{
+ int i;
+ long x[12] __attribute__((aligned(__BIGGEST_ALIGNMENT__)));
+
+ check_vect ();
+
+ x[0] = 1;
+ for (i = 0; i < 12; i++)
+ x[i] = i;
+
+ if (x[0] != 0)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36630.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36630.c
new file mode 100644
index 000000000..2253f7574
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr36630.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void
+foo (unsigned char *x, short y)
+{
+ short i;
+
+ i = 2;
+ while (i < y)
+ {
+ x[i - 1] = x[i];
+ i = i + 1;
+ }
+}
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37027.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37027.c
new file mode 100644
index 000000000..dcfed348d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37027.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+
+struct mystr
+{
+ int f1;
+ int f2;
+};
+
+struct mystr a[16];
+struct mystr b[16];
+int res1, res2;
+
+
+void
+foo (void)
+{
+ int i;
+ int sum1;
+ int sum2;
+
+ for (i = 0; i < 16; i++)
+ {
+ sum1 += a[i].f1 + b[i].f1;
+ sum2 += a[i].f2 + b[i].f2;
+ }
+
+ res1 = sum1;
+ res2 = sum2;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_add } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_add } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37385.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37385.c
new file mode 100644
index 000000000..8b1cf3ae1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37385.c
@@ -0,0 +1,20 @@
+/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+typedef int int_t;
+typedef void (*fun_t) (int);
+fun_t fun_tab[400] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+void foo (int_t a);
+
+void
+bar ()
+{
+ int i;
+
+ for (i = 0; i < 400; i++)
+ fun_tab[i] = foo;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37474.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37474.c
new file mode 100644
index 000000000..b6d01c269
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37474.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+
+#define M00 100
+#define M10 216
+#define M01 1322
+#define M11 13
+#define M02 74
+#define M12 191
+
+#define N 16
+
+void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
+{
+ unsigned int i, a, b, c, d, e, f;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+ d = *pInput++;
+ e = *pInput++;
+ f = *pInput++;
+
+ a = a + d;
+ b = b + e;
+ c = c + f;
+
+ *pOutput++ = M00 * a + M01 * b + M02 * c;
+ *pOutput++ = M10 * a + M11 * b + M12 * c;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37482.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37482.c
new file mode 100644
index 000000000..0b3bed33a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37482.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void SexiALI_Convert(void *vdest, void *vsrc, unsigned int frames)
+{
+ unsigned int x;
+ short *src = vsrc;
+ unsigned char *dest = vdest;
+ for(x=0;x<256;x++)
+ {
+ int tmp;
+ tmp = *src;
+ src++;
+ tmp += *src;
+ src++;
+ *dest++ = tmp;
+ *dest++ = tmp;
+ }
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37539.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37539.c
new file mode 100644
index 000000000..560c48463
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37539.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+__attribute__ ((noinline)) void
+ayuv2yuyv_ref (int *d, int *src, int n)
+{
+ char *dest = (char *)d;
+ int i;
+
+ for(i=0;i<n/2;i++){
+ dest[i*4 + 0] = (src[i*2 + 0])>>16;
+ dest[i*4 + 1] = (src[i*2 + 1])>>8;
+ dest[i*4 + 2] = (src[i*2 + 0])>>16;
+ dest[i*4 + 3] = (src[i*2 + 0])>>0;
+ }
+
+ /* Check results. */
+ for(i=0;i<n/2;i++){
+ if (dest[i*4 + 0] != (src[i*2 + 0])>>16
+ || dest[i*4 + 1] != (src[i*2 + 1])>>8
+ || dest[i*4 + 2] != (src[i*2 + 0])>>16
+ || dest[i*4 + 3] != (src[i*2 + 0])>>0)
+ abort();
+ }
+}
+
+int main ()
+{
+ int d[256], src[128], i;
+
+ check_vect ();
+
+ for (i = 0; i < 128; i++)
+ src[i] = i;
+
+ ayuv2yuyv_ref(d, src, 128);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_strided4 && vect_strided2 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37730.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37730.c
new file mode 100644
index 000000000..876f5499e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr37730.c
@@ -0,0 +1,16 @@
+/* PR middle-end/37730 */
+/* { dg-do compile } */
+
+void
+add_opush (void)
+{
+ unsigned char formats[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0xff };
+ void *dtds[sizeof (formats)];
+ unsigned int i;
+ unsigned char dtd = 0x08;
+ for (i = 0; i < sizeof (formats); i++)
+ dtds[i] = &dtd;
+ sdp_seq_alloc (dtds);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr38529.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr38529.c
new file mode 100644
index 000000000..496aa43f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr38529.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+float a[4];
+
+void foo()
+{
+ int i, j;
+
+ for (i = 0; i < 4; ++i)
+ for (j = 0; j < 17; ++j)
+ a[i] = 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr39529.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr39529.c
new file mode 100644
index 000000000..4853c1350
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr39529.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ char a[1024];
+ char *p = &a[0];
+ char *p2;
+
+ p2 = p + 1024;
+ do
+ {
+ p += 2;
+ *(p-2) = 1;
+ *(p-1) = 1;
+ } while (p < p2);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40074.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40074.c
new file mode 100644
index 000000000..6459f1b55
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40074.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+typedef struct {
+ int a;
+ int b;
+ int c;
+ int d;
+} s;
+
+
+s arr[N] = {{7,0,1,5}, {7,2,3,5}, {7,4,5,5}, {7,6,7,5}, {7,8,9,5}, {7,10,11,5}, {7,12,13,5}, {7,14,15,5}, {7,16,17,5}, {7,18,19,5}, {7,20,21,5}, {7,22,23,5}, {7,24,25,5}, {7,26,27,5}, {7,28,29,5}, {7,30,31,5}};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ s *p = arr, *q = arr + 1;
+ int res[N];
+ int i;
+
+ for (i = 0; i < N-1; i++)
+ {
+ res[i] = p->b + p->d + q->b;
+ p++;
+ q++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N-1; i++)
+ {
+ if (res[i] != arr[i].b + arr[i].d + arr[i+1].b)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40238.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40238.c
new file mode 100644
index 000000000..91cf09824
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40238.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+
+extern int xdo_rb_ctr_row( int *pos_code);
+
+int xgp_ahd_interpolate (int tile)
+{
+ int p[4];
+
+ switch (tile) {
+ default:
+ case 0:
+ case 1:
+ p[0] = 0; p[1] = 1; p[2] = 2; p[3] = 3;
+ break;
+ case 2:
+ case 3:
+ p[0] = 1; p[1] = 0; p[2] = 3; p[3] = 2;
+ break;
+ case 4:
+ case 5:
+ p[0] = 3; p[1] = 2; p[2] = 1; p[3] = 0;
+ break;
+ case 6:
+ case 7:
+ p[0] = 2; p[1] = 3; p[2] = 0; p[3] = 1;
+ break;
+ }
+
+ xdo_rb_ctr_row(p);
+ xdo_rb_ctr_row(p);
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40254.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40254.c
new file mode 100644
index 000000000..b890a4493
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40254.c
@@ -0,0 +1,39 @@
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+struct s
+{
+ int *x;
+ int x1;
+ int x2;
+ int x3;
+ int *y;
+};
+
+struct s arr[64] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo (int i, int *in_x, int *in_y)
+{
+ arr[i].x = in_x;
+ arr[i].y = in_y;
+}
+
+int
+main (void)
+{
+ int a, b;
+
+ check_vect ();
+
+ foo (5, &a, &b);
+
+ if (arr[5].x != &a || arr[5].y != &b)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40542.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40542.c
new file mode 100644
index 000000000..0a827724d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr40542.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+void
+volarr_cpy(char *d, volatile char *s)
+{
+ int i;
+
+ for (i = 0; i < 16; i++)
+ d[i] = s[i];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr41956.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr41956.c
new file mode 100644
index 000000000..455f50510
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr41956.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void K (int *gpwgts, int *badminpwgt, int *badmaxpwgt)
+{
+ int i;
+ for (i = 0; i < 10; i += 2) {
+ badminpwgt[i] = badminpwgt[i+1] = gpwgts[i]+gpwgts[i];
+ badmaxpwgt[i] = badmaxpwgt[i+1] = gpwgts[i]+gpwgts[i];
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42193.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42193.c
new file mode 100644
index 000000000..01609c982
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42193.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_long } */
+
+#include <stdarg.h>
+
+unsigned long in[6], out[6];
+
+void foo ()
+{
+ unsigned long a, b, c, d, e, f;
+
+ a = in[0];
+ b = in[1];
+ c = in[2];
+ d = in[3];
+ e = in[4];
+ f = in[5];
+
+ out[0] = 2 * a + 7 * b + 8 * c + 31 * d + 10 * e + 21 * f;
+ out[1] = 3 * a + 6 * b + 12 * c + 13 * d + 15 * e + 28 * f;
+ out[2] = 4 * a + 5 * b + 72 * c + 23 * d + 14 * e + 24 * f;
+ out[3] = 8 * a + 71 * b + 18 * c + 33 * d + 13 * e + 25 * f;
+ out[4] = 12 * a + 16 * b + 19 * c + 41 * d + 22 * e + 26 * f;
+ out[5] = 17 * a + 15 * b + 13 * c + 14 * d + 11 * e + 9 * f;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42395.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42395.c
new file mode 100644
index 000000000..7d0b8324f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42395.c
@@ -0,0 +1,10 @@
+/* PR debug/42395 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-vectorize -g" } */
+
+void foo(int j, int *A)
+{
+ int i;
+ for (i = 0; i < j; i ++) A[i] = i;
+ for (; i < 4096; i ++) A[i] = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42604.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42604.c
new file mode 100644
index 000000000..14f255a40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42604.c
@@ -0,0 +1,35 @@
+/* PR debug/42604 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-vectorize -g -ffast-math" } */
+
+unsigned *d;
+unsigned short e;
+int f;
+float h[3][4];
+
+void
+test (unsigned short *b)
+{
+ int a, c, i;
+ float g[3];
+ unsigned j[32] = { 10, 0x63707274 };
+ for (i = 0; i < (int) j[0]; i++)
+ {
+ j[i * 3 + 2] = d[0];
+ d[0] += (j[i * 3 + 3] + 3) & -4;
+ }
+ for (a = 0; a < e; a++)
+ {
+ g[0] = g[1] = g[2] = 0;
+ for (c = 0; c < f; c++)
+ {
+ g[0] += h[0][c] * b[c];
+ g[1] += h[1][c] * b[c];
+ }
+ for (c = 0; c < 3; c++)
+ b[c] = 0 > ((int) g[c] < 65535 ? ((int) g[c]) : 65535)
+ ? 0 : ((int) g[c]) < 65535 ? (int) g[c] : 65535;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42709.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42709.c
new file mode 100644
index 000000000..8ccbfa65e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr42709.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int *res[N];
+
+int
+main1 (int *a, int *b, int *c, int *d, int dummy)
+{
+ int i;
+
+ for (i = 0; i < N/2; i+=4)
+ {
+ res[i] = a + 16;
+ res[i+1] = b + 16;
+ res[i+2] = c + 16;
+ res[i+3] = d + 16;
+ if (dummy == 32)
+ abort ();
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43430-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43430-1.c
new file mode 100644
index 000000000..9eaa23cca
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43430-1.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+typedef int myint;
+myint data_ch1[N + 1] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
+myint data_ch2[N + 1] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
+#define SUM 480
+
+__attribute__ ((noinline)) int
+foo (myint * s1, myint * s2, int stride)
+{
+ int score = 0;
+ int x;
+ for (x = 0; x < N; x++)
+ score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
+ s1[x] + s2[x + stride] :
+ s2[x + stride]);
+
+ if (score != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo (data_ch1, data_ch2, 1);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43430-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43430-2.c
new file mode 100644
index 000000000..16f53dacc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43430-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+typedef unsigned char uint8_t;
+vsad16_c (void *c, uint8_t * s1, uint8_t * s2, int stride, int h)
+{
+ int score = 0;
+ int x, y;
+ for (x = 0; x < 16; x++)
+ score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
+ s1[x] + s2[x + stride] :
+ s2[x + stride]);
+ return score;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43432.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43432.c
new file mode 100644
index 000000000..5f3db7d82
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43432.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+
+void vector_fmul_reverse_c(float *dst, const float *src0, const float *src1,
+int len){
+ int i;
+ src1 += len-1;
+ for(i=0; i<len; i++)
+ dst[i] = src0[i] * src1[-i];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm && vect_hw_misalign } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43842.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43842.c
new file mode 100644
index 000000000..593404ffb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr43842.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+
+typedef char int8_t;
+typedef short int int16_t;
+typedef int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+
+static int16_t
+safe_rshift_func_int16_t_s_u (int16_t left, unsigned int right)
+{
+ return left || right >= 1 * 8 ? left : left >> right;
+}
+
+static int8_t
+safe_rshift_func_int8_t_s_u (int8_t left, unsigned int right)
+{
+ return left || right >= 1 * 8 ? left : left >> right;
+}
+
+
+static uint32_t
+safe_add_func_uint32_t_u_u (uint32_t ui1, uint16_t ui2)
+{
+ return ui1 + ui2;
+}
+
+int16_t g_4;
+int8_t g_4_8;
+uint32_t g_9[1];
+uint32_t g_9_8[2];
+int161 (void)
+{
+ int32_t l_2;
+
+ for (l_2 = -25; l_2; l_2 = safe_add_func_uint32_t_u_u (l_2, 1))
+ g_9[0] ^= safe_rshift_func_int16_t_s_u (g_4, 1);
+}
+
+int81 (void)
+{
+ int32_t l_2;
+
+ for (l_2 = -25; l_2; l_2 = safe_add_func_uint32_t_u_u (l_2, 1))
+ {
+ g_9[0] ^= safe_rshift_func_int8_t_s_u (g_4_8, 1);
+ g_9[1] ^= safe_rshift_func_int8_t_s_u (g_4_8, 1);
+ }
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr44507.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr44507.c
new file mode 100644
index 000000000..50c485399
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr44507.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+int seeIf256ByteArrayIsConstant(
+ unsigned char *pArray)
+{
+ int index;
+ unsigned int curVal, orVal, andVal;
+ int bytesAreEqual = 0;
+
+ if (pArray != 0)
+ {
+ for (index = 0, orVal = 0, andVal = 0xFFFFFFFF;
+ index < 64;
+ index += (int)sizeof(unsigned int))
+ {
+ curVal = *((unsigned int *)(&pArray[index]));
+ orVal = orVal | curVal;
+ andVal = andVal & curVal;
+ }
+
+ if (!((orVal == andVal)
+ && ((orVal >> 8) == (andVal & 0x00FFFFFF))))
+ abort ();
+ }
+
+ return 0;
+}
+
+
+int main(int argc, char** argv)
+{
+ unsigned char array1[64] = {
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ };
+
+ argv = argv;
+ argc = argc;
+
+ check_vect ();
+
+ return seeIf256ByteArrayIsConstant(&array1[0]);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45633.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45633.c
new file mode 100644
index 000000000..456d51f1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45633.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/45633 */
+/* { dg-do compile } */
+
+int s[32];
+unsigned char *t[32];
+
+void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 32; i++)
+ t[i] -= s[i];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45752.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45752.c
new file mode 100644
index 000000000..b4b3c1b7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45752.c
@@ -0,0 +1,108 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define M00 100
+#define M10 216
+#define M20 23
+#define M30 237
+#define M40 437
+
+#define M01 1322
+#define M11 13
+#define M21 27271
+#define M31 2280
+#define M41 284
+
+#define M02 74
+#define M12 191
+#define M22 500
+#define M32 111
+#define M42 1114
+
+#define M03 134
+#define M13 117
+#define M23 11
+#define M33 771
+#define M43 71
+
+#define M04 334
+#define M14 147
+#define M24 115
+#define M34 7716
+#define M44 16
+
+#define N 16
+
+void foo (unsigned int *__restrict__ pInput,
+ unsigned int *__restrict__ pOutput,
+ unsigned int *__restrict__ pInput2,
+ unsigned int *__restrict__ pOutput2)
+{
+ unsigned int i, a, b, c, d, e;
+
+ for (i = 0; i < N / 5; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+ d = *pInput++;
+ e = *pInput++;
+
+ *pOutput++ = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e;
+ *pOutput++ = M10 * a + M11 * b + M12 * c + M13 * d + M14 * e;
+ *pOutput++ = M20 * a + M21 * b + M22 * c + M23 * d + M24 * e;
+ *pOutput++ = M30 * a + M31 * b + M32 * c + M33 * d + M34 * e;
+ *pOutput++ = M40 * a + M41 * b + M42 * c + M43 * d + M44 * e;
+
+
+ a = *pInput2++;
+ b = *pInput2++;
+ c = *pInput2++;
+ d = *pInput2++;
+ e = *pInput2++;
+
+ *pOutput2++ = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e;
+ *pOutput2++ = M10 * a + M11 * b + M12 * c + M13 * d + M14 * e;
+ *pOutput2++ = M20 * a + M21 * b + M22 * c + M23 * d + M24 * e;
+ *pOutput2++ = M30 * a + M31 * b + M32 * c + M33 * d + M34 * e;
+ *pOutput2++ = M40 * a + M41 * b + M42 * c + M43 * d + M44 * e;
+
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ unsigned int input[N], output[N], i, input2[N], output2[N];
+ unsigned int check_results[N] = {3208, 1334, 28764, 35679, 2789, 13028,
+ 4754, 168364, 91254, 12399, 22848, 8174, 307964, 146829, 22009, 0};
+ unsigned int check_results2[N] = {7136, 2702, 84604, 57909, 6633, 16956,
+ 6122, 224204, 113484, 16243, 26776, 9542, 363804, 169059, 25853, 0};
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i%256;
+ input2[i] = i + 2;
+ output[i] = 0;
+ output2[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ foo (input, output, input2, output2);
+
+ for (i = 0; i < N; i++)
+ if (output[i] != check_results[i]
+ || output2[i] != check_results2[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump "permutation requires at least three vectors" "vect" { target vect_perm } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45847.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45847.c
new file mode 100644
index 000000000..f34caa1d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45847.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+
+long long foo (long long *__restrict a, int *__restrict b, int *__restrict c )
+{
+ int i;
+ long long sum=0;
+ for (i=0;i<256;i++)
+ sum += (long long)b[i] * c[i];
+
+ return sum;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45902.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45902.c
new file mode 100644
index 000000000..1690b3ab3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr45902.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include "tree-vect.h"
+
+#define N 128
+
+short res[N];
+short a[N];
+
+int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < N/4; i+=4)
+ {
+ res[i] = a[i] >> 8;
+ res[i+1] = a[i+1] >> 8;
+ res[i+2] = a[i+2] >> 8;
+ res[i+3] = a[i+3] >> 8;
+ }
+}
+
+int
+main ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ a[i] = i;
+
+ main1 ();
+
+ for (i = 0; i < N; i++)
+ if (res[i] != a[i] >> 8)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46009.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46009.c
new file mode 100644
index 000000000..a6a3217ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46009.c
@@ -0,0 +1,74 @@
+/* PR tree-optimization/46009 */
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+int a[1024] __attribute__((aligned));
+int b[1024] __attribute__((aligned));
+int c[1024] __attribute__((aligned));
+int d[1024] __attribute__((aligned));
+int e[1024] __attribute__((aligned));
+
+void __attribute__((noinline))
+foo (void)
+{
+ int i, g;
+ for (i = 0; i < 1024; i++)
+ {
+ g = a[i] + b[i] + c[i] * d[i];;
+ e[i] = g < 10 ? 1 : g;
+ }
+}
+
+void __attribute__((noinline))
+bar (void)
+{
+ int i, g;
+ for (i = 0; i < 1024; i++)
+ {
+ g = a[i] + b[i] + c[i] * d[i];;
+ if (g < 10)
+ e[i] = 1;
+ else
+ e[i] = g;
+ }
+}
+
+int
+main (void)
+{
+ int i;
+ check_vect ();
+ for (i = 0; i < 1024; i++)
+ {
+ asm volatile ("" : "+r" (i));
+ a[i] = i % 10;
+ b[i] = i % 10;
+ c[i] = 1;
+ d[i] = -1;
+ e[i] = -1;
+ }
+ foo ();
+ for (i = 0; i < 1024; i++)
+ {
+ int g;
+ asm volatile ("" : "+r" (i));
+ g = 2 * (i % 10) - 1;
+ if (e[i] != (g < 10 ? 1 : g))
+ abort ();
+ e[i] = -1;
+ }
+ bar ();
+ for (i = 0; i < 1024; i++)
+ {
+ int g;
+ asm volatile ("" : "+r" (i));
+ g = 2 * (i % 10) - 1;
+ if (e[i] != (g < 10 ? 1 : g))
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46049.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46049.c
new file mode 100644
index 000000000..90020681e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46049.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+typedef __INT16_TYPE__ int16_t;
+typedef __INT32_TYPE__ int32_t;
+
+static inline int32_t bar (int16_t x, int16_t y)
+{
+ return x * y;
+}
+
+void foo (int16_t i, int16_t *p, int16_t x)
+{
+ while (i--)
+ {
+ *p = bar (*p, x) >> 15;
+ p++;
+ *p = bar (*p, x) >> 15;
+ p++;
+ }
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46052.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46052.c
new file mode 100644
index 000000000..c32a93d07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46052.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+
+int i;
+int a[2];
+
+static inline char bar (void)
+{
+ return i ? i : 1;
+}
+
+void foo (int n)
+{
+ while (n--)
+ {
+ a[0] ^= bar ();
+ a[1] ^= bar ();
+ }
+}
+
+static inline char bar1 (void)
+{
+}
+
+void foo1 (int n)
+{
+ while (n--)
+ {
+ a[0] ^= bar1 ();
+ a[1] ^= bar1 ();
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46126.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46126.c
new file mode 100644
index 000000000..c46d7f40d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46126.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+__extension__ typedef __UINTPTR_TYPE__ uintptr_t;
+
+typedef struct TypHeader {
+ struct TypHeader * * ptr;
+ unsigned char type;
+ } * TypHandle;
+ extern TypHandle (* EvTab[81]) ( TypHandle hd );
+ TypHandle FunApplyRel ( TypHandle hdCall )
+ {
+ TypHandle hdApp;
+ TypHandle * ptApp;
+ long lp;
+ long lc;
+ hdApp = ((uintptr_t)(((TypHandle*)((hdCall)->ptr))[1])&1 ?
+(((TypHandle*)((hdCall)->ptr))[1]) : (*
+EvTab[(((uintptr_t)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 :
+((((TypHandle*)((hdCall)->ptr))[1])->type))])((((TypHandle*)((hdCall)->ptr))[1])));
+ ptApp = ((TypHandle*)((hdApp)->ptr));
+ ptApp[1] = ((TypHandle) (uintptr_t) (((long)(lp) << 2) + 1));
+ ptApp[2] = ((TypHandle) (uintptr_t) (((long)(lc) << 2) + 1));
+ }
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46663.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46663.c
new file mode 100644
index 000000000..42a1ffbbc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr46663.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -fdump-tree-vect-details -fexceptions" } */
+
+typedef __attribute__ ((const)) int (*bart) (void);
+
+int foo (bart bar, int m)
+{
+ int i, j = 0;
+ for (i = 0; i < m; i++)
+ j += bar();
+ return j;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr47001.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr47001.c
new file mode 100644
index 000000000..9c5d08dac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr47001.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#include <stdlib.h>
+
+#define N 128
+
+int a[N];
+
+int main1 (int res0, int res1)
+{
+ int i;
+ int sum0 = 0, sum1 = 0;
+
+ for (i = 0; i < N/2; i++) {
+ sum1 += a[2*i];
+ sum0 += a[2*i];
+ }
+
+ /* Check results: */
+ if (sum0 != res0
+ || sum1 != res1)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr47139.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr47139.c
new file mode 100644
index 000000000..9e9c751e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr47139.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+int d;
+
+void
+foo ()
+{
+ int a = 0;
+ unsigned char b;
+ for (b = 1; b; b++)
+ {
+ d = a;
+ a |= b;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48172.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48172.c
new file mode 100644
index 000000000..d6985bcc3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48172.c
@@ -0,0 +1,31 @@
+extern void *memset(void *s, int c, __SIZE_TYPE__ n);
+extern void abort (void);
+
+#define ASIZE 1028
+#define HALF (ASIZE/2)
+
+int main() {
+ unsigned int array[ASIZE];
+ int i;
+
+ memset(array, 0, sizeof(array));
+
+ /* initialize first half of the array */
+ for (i = 0; i < HALF; i++)
+ array[i] = i;
+
+ /* fill second half of array in by summing earlier elements of the array
+ gcc 4.5.1 and 4.5.2 incorrectly vectorize this loop! aray[1025] is left
+ at 0 for ASIZE=1028 */
+ for (i = 0; i < HALF-1; i++)
+ array[HALF+i] = array[2*i] + array[2*i + 1];
+
+ /* see if we have any failures */
+ for (i = 0; i < HALF - 1; i++)
+ if (array[HALF+i] != array[2*i] + array[2*i + 1])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48377.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48377.c
new file mode 100644
index 000000000..24846cd04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48377.c
@@ -0,0 +1,25 @@
+/* PR tree-optimization/48377 */
+/* { dg-require-effective-target non_strict_align } */
+
+typedef unsigned int U __attribute__((__aligned__ (1), __may_alias__));
+
+__attribute__((noinline, noclone)) unsigned int
+foo (const char *s, int len)
+{
+ const U *p = (const U *) s;
+ unsigned int f = len / sizeof (unsigned int), hash = len, i;
+
+ for (i = 0; i < f; ++i)
+ hash += *p++;
+ return hash;
+}
+
+char buf[64] __attribute__((aligned (32)));
+
+int
+main (void)
+{
+ return foo (buf + 1, 26) != 26;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48765.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48765.c
new file mode 100644
index 000000000..50839e389
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr48765.c
@@ -0,0 +1,83 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" } { "-mcpu=power6" } } */
+/* { dg-options "-O3 -mcpu=power6" } */
+
+enum reg_class
+{
+ NO_REGS, AP_REG, XRF_REGS, GENERAL_REGS, AGRF_REGS, XGRF_REGS, ALL_REGS,
+ LIM_REG_CLASSES
+};
+enum machine_mode
+{
+ VOIDmode, QImode, HImode, PSImode, SImode, PDImode, DImode, TImode, OImode,
+ QFmode, HFmode, TQFmode, SFmode, DFmode, XFmode, TFmode, SCmode, DCmode,
+ XCmode, TCmode, CQImode, CHImode, CSImode, CDImode, CTImode, COImode,
+ BLKmode, CCmode, CCEVENmode, MAX_MACHINE_MODE
+};
+typedef struct rtx_def
+{
+ int mode:8;
+}
+ *rtx;
+extern rtx *regno_reg_rtx;
+typedef unsigned int HARD_REG_ELT_TYPE;
+typedef HARD_REG_ELT_TYPE HARD_REG_SET[((64 + 32 - 1) / 32)];
+extern int reg_alloc_order[64];
+extern int max_regno;
+extern int *reg_n_calls_crossed;
+extern short *reg_renumber;
+static int *reg_where_dead;
+static int *reg_where_born;
+static int *reg_order;
+static char *regs_change_size;
+static HARD_REG_SET *after_insn_hard_regs;
+static int stupid_find_reg (int, enum reg_class, enum machine_mode, int, int,
+ int);
+void
+stupid_life_analysis (f, nregs, file)
+ rtx f;
+{
+ register int i;
+ for (i = (((64)) + 3) + 1; i < max_regno; i++)
+ {
+ register int r = reg_order[i];
+ if ((int) LIM_REG_CLASSES > 1)
+ reg_renumber[r] =
+ stupid_find_reg (reg_n_calls_crossed[r], reg_preferred_class (r),
+ ((regno_reg_rtx[r])->mode), reg_where_born[r],
+ reg_where_dead[r], regs_change_size[r]);
+ }
+}
+
+static int
+stupid_find_reg (call_preserved, class, mode, born_insn, dead_insn,
+ changes_size)
+ int call_preserved;
+ enum reg_class class;
+ enum machine_mode mode;
+{
+ register int i, ins;
+ HARD_REG_SET used, this_reg;
+ for (ins = born_insn; ins < dead_insn; ins++)
+ do
+ {
+ register HARD_REG_ELT_TYPE *scan_tp_ = (used), *scan_fp_ =
+ (after_insn_hard_regs[ins]);
+ for (i = 0; i < ((64 + 32 - 1) / 32); i++)
+ *scan_tp_++ |= *scan_fp_++;
+ }
+ while (0);
+ for (i = 0; i < 64; i++)
+ {
+ int regno = reg_alloc_order[i];
+ if (((used)[(regno) / ((unsigned) 32)] &
+ (((HARD_REG_ELT_TYPE) (1)) << ((regno) % ((unsigned) 32)))))
+ {
+ register int j;
+ if (j == regno)
+ return regno;
+ }
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49038.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49038.c
new file mode 100644
index 000000000..c760ef57b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49038.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target mmap } */
+
+#include <sys/mman.h>
+#include <stdio.h>
+
+#define COUNT 320
+#define MMAP_SIZE 0x10000
+#define ADDRESS 0x1122000000
+#define TYPE unsigned short
+
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
+void __attribute__((noinline))
+foo (TYPE *__restrict a, TYPE *__restrict b)
+{
+ int n;
+
+ for (n = 0; n < COUNT; n++)
+ a[n] = b[n * 2];
+}
+
+int
+main (void)
+{
+ void *x;
+ size_t b_offset;
+
+ x = mmap ((void *) ADDRESS, MMAP_SIZE, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (x == MAP_FAILED)
+ {
+ perror ("mmap");
+ return 1;
+ }
+
+ b_offset = MMAP_SIZE - (2 * COUNT - 1) * sizeof (TYPE);
+ foo ((unsigned short *) x,
+ (unsigned short *) ((char *) x + b_offset));
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49093.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49093.c
new file mode 100644
index 000000000..b8bded686
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49093.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize -fdump-tree-vect-details -fno-tree-fre" } */
+
+volatile unsigned char g_324[4] = {0, 1, 0, 1};
+void foo (int);
+int x, y;
+void func_81(void)
+{
+ int l_466, l_439[7] = {0}, g_97;
+lbl_473:
+ if (x) {
+ for (g_97 = 0; (g_97 < 4); ++g_97) {
+ if (y)
+ goto lbl_473;
+ g_324[g_97];
+ l_466 = l_439[g_97];
+ }
+ foo(l_466);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49318.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49318.c
new file mode 100644
index 000000000..d1c270d68
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49318.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+typedef enum { GL_FALSE } GLenum;
+typedef unsigned char GLboolean;
+typedef int GLint;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef double GLdouble;
+typedef struct gl_context GLcontext;
+struct gl_context {
+ GLfloat TextureMatrix[16];
+ GLenum Primitive;
+};
+void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ) {
+ GLuint i;
+ for (i=0; i<16; i++)
+ params[i] = (GLint) ctx->TextureMatrix[i];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49352.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49352.c
new file mode 100644
index 000000000..d8e0bae04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49352.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/49352 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -fcompare-debug" } */
+/* { dg-xfail-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+int
+foo (int *x, int *y, int n)
+{
+ int i, j;
+ int dot = 0;
+ for (i = 0; i < n; i++)
+ for (j = 0; j < 2; j++)
+ dot += *(x++) * *(y++);
+ return dot;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49478.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49478.c
new file mode 100644
index 000000000..064539923
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49478.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+
+#define N 64
+
+unsigned char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+unsigned int
+foo (int len) {
+ int i;
+ unsigned int result = 0;
+ unsigned short prod;
+
+ for (i=0; i<len; i++) {
+ prod = X[i] * 15;
+ result += prod;
+ }
+ return result;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49610.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49610.c
new file mode 100644
index 000000000..87ac5b503
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49610.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+extern int g_7;
+void func_13(int p_17) {
+ int i;
+ for (i=0; i < 16; i = (signed char)(i+1)) {
+ g_7 &= p_17;
+ g_7 &= (p_17 > 1);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49771.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49771.c
new file mode 100644
index 000000000..777f61536
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49771.c
@@ -0,0 +1,26 @@
+#include <stdlib.h>
+#include <stdarg.h>
+
+static int a[1000];
+
+int
+foo (void)
+{
+ int j;
+ int i;
+ for (i = 0; i < 1000; i++)
+ for (j = 0; j < 1000; j++)
+ a[j] = a[i] + 1;
+ return a[0];
+}
+
+int
+main (void)
+{
+ int res = foo ();
+ if (res != 1999)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49926.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49926.c
new file mode 100644
index 000000000..609681734
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr49926.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int a, b, c[10];
+
+void
+foo (unsigned int x, int y, int z, int *w)
+{
+ do
+ {
+ *w = z;
+ y = x;
+ if (y)
+ for (b = -4; b; b++)
+ {
+ z = y &= a &= 1;
+ y &= c[b + 4];
+ }
+ }
+ while (1);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50014.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50014.c
new file mode 100644
index 000000000..c04ffec21
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50014.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int f(unsigned char *s, int n)
+{
+ int sum = 0;
+ int i;
+
+ for (i = 0; i < n; i++)
+ sum += 256 * s[i];
+
+ return sum;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50451.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50451.c
new file mode 100644
index 000000000..0733ea2ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50451.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int
+foo (int integral, int decimal, int power_ten)
+{
+ while (power_ten > 0)
+ {
+ integral *= 10;
+ decimal *= 10;
+ power_ten--;
+ }
+
+ return integral+decimal;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50635.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50635.c
new file mode 100644
index 000000000..6a7ac52e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50635.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+typedef signed long int32_t;
+typedef char int8_t;
+
+void f0a(int32_t * result, int32_t * arg1, int8_t * arg2, int32_t temp_3)
+{
+ int idx;
+ for (idx=0;idx<10;idx += 1)
+ {
+ int32_t temp_4;
+ int32_t temp_12;
+
+ temp_4 = (-2 & arg2[idx]) + temp_3;
+ temp_12 = -2 * arg2[idx] + temp_4;
+ result[idx] = temp_12;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50727.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50727.c
new file mode 100644
index 000000000..896b614b9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr50727.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8_t;
+typedef unsigned long uint32_t;
+void
+f0a (uint32_t * __restrict__ result, uint32_t * arg2,
+ uint8_t * __restrict__ arg4)
+{
+ int idx;
+ for (idx = 0; idx < 429; idx += 1)
+ {
+ uint32_t temp_9;
+ uint32_t temp_11;
+ temp_9 = ((-19 | arg4[idx]) >> arg2[idx]);
+ temp_11 = (((-19 ^ arg4[idx]) & arg2[idx]) ^ temp_9);
+ result[idx] = temp_11;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51000.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51000.c
new file mode 100644
index 000000000..75af2d8a2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51000.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+_Bool a[2048];
+int b[2048];
+
+void
+foo ()
+{
+ int i;
+ for (i = 0; i < 2048; i += 4)
+ {
+ a[i] = b[i] <= 10;
+ a[i + 3] = b[i + 1] <= 10;
+ a[i + 2] = b[i + 2] <= 10;
+ a[i + 1] = b[i + 3] <= 10;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51015.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51015.c
new file mode 100644
index 000000000..bc29b0bf1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51015.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+typedef unsigned long long __u64;
+static __u64 ext2_max_sizes[16 - 10 + 1];
+
+void e2fsck_pass1()
+{
+ int i;
+ __u64 max_sizes;
+
+ for (i = 10; i <= 16; i++) {
+ max_sizes = 12 + (1ULL << ((i) - 2));
+ max_sizes = max_sizes + (1ULL << ((i) - 2)) * (1ULL << ((i) - 2));
+ max_sizes = max_sizes + (1ULL << ((i) - 2)) * (1ULL << ((i) - 2)) * (1ULL <<((i) - 2));
+ ext2_max_sizes[i - 10] = max_sizes;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51074.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51074.c
new file mode 100644
index 000000000..309139994
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51074.c
@@ -0,0 +1,24 @@
+/* PR tree-optimization/51074 */
+
+#include "tree-vect.h"
+
+struct S { int a, b; } s[8];
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ for (i = 0; i < 8; i++)
+ {
+ s[i].b = 0;
+ s[i].a = i;
+ }
+ asm volatile ("" : : : "memory");
+ for (i = 0; i < 8; i++)
+ if (s[i].b != 0 || s[i].a != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51301.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51301.c
new file mode 100644
index 000000000..c0000cad9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51301.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+typedef signed char int8_t;
+typedef signed long long int64_t;
+int64_t
+f0a (int8_t * __restrict__ arg1)
+{
+ int idx;
+ int64_t result = 0;
+ for (idx = 0; idx < 416; idx += 1)
+ result += arg1[idx] << (arg1[idx] == arg1[idx]);
+ return result;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-1.c
new file mode 100644
index 000000000..d8d61be90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-1.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/51581 */
+
+#include "tree-vect.h"
+
+#define main main1
+#include "../../gcc.c-torture/execute/pr51581-1.c"
+#undef main
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ asm ("");
+ return main1 ();
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-2.c
new file mode 100644
index 000000000..13b8ba92c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-2.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/51581 */
+
+#include "tree-vect.h"
+
+#define main main1
+#include "../../gcc.c-torture/execute/pr51581-2.c"
+#undef main
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ asm ("");
+ return main1 ();
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-3.c
new file mode 100644
index 000000000..a47813617
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-3.c
@@ -0,0 +1,118 @@
+/* PR tree-optimization/51581 */
+
+#include "tree-vect.h"
+
+int a[8], b[8];
+unsigned int c[8], d[8];
+
+void
+f1 (void)
+{
+ a[0] = b[0] / 8;
+ a[1] = b[1] / 8;
+ a[2] = b[2] / 8;
+ a[3] = b[3] / 8;
+ a[4] = b[4] / 8;
+ a[5] = b[5] / 8;
+ a[6] = b[6] / 8;
+ a[7] = b[7] / 8;
+}
+
+void
+f2 (void)
+{
+ c[0] = d[0] / 3;
+ c[1] = d[1] / 3;
+ c[2] = d[2] / 3;
+ c[3] = d[3] / 3;
+ c[4] = d[4] / 3;
+ c[5] = d[5] / 3;
+ c[6] = d[6] / 3;
+ c[7] = d[7] / 3;
+}
+
+void
+f3 (void)
+{
+ a[0] = b[0] / 8;
+ a[1] = b[1] / 4;
+ a[2] = b[2] / 8;
+ a[3] = b[3] / 4;
+ a[4] = b[4] / 8;
+ a[5] = b[5] / 4;
+ a[6] = b[6] / 8;
+ a[7] = b[7] / 4;
+}
+
+void
+f4 (void)
+{
+ c[0] = d[0] / 3;
+ c[1] = d[1] / 5;
+ c[2] = d[2] / 3;
+ c[3] = d[3] / 5;
+ c[4] = d[4] / 3;
+ c[5] = d[5] / 5;
+ c[6] = d[6] / 3;
+ c[7] = d[7] / 5;
+}
+
+void
+f5 (void)
+{
+ a[0] = b[0] / 14;
+ a[1] = b[1] / 15;
+ a[2] = b[2] / 14;
+ a[3] = b[3] / 15;
+ a[4] = b[4] / 14;
+ a[5] = b[5] / 15;
+ a[6] = b[6] / 14;
+ a[7] = b[7] / 15;
+}
+
+void
+f6 (void)
+{
+ c[0] = d[0] / 6;
+ c[1] = d[1] / 5;
+ c[2] = d[2] / 6;
+ c[3] = d[3] / 5;
+ c[4] = d[4] / 6;
+ c[5] = d[5] / 5;
+ c[6] = d[6] / 13;
+ c[7] = d[7] / 5;
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ asm ("");
+ for (i = 0; i < 8; i++)
+ {
+ asm ("");
+ b[i] = i - 4;
+ d[i] = i - 4;
+ }
+ f1 ();
+ f2 ();
+ for (i = 0; i < 8; i++)
+ if (a[i] != b[i] / 8 || c[i] != d[i] / 3)
+ abort ();
+ f3 ();
+ f4 ();
+ for (i = 0; i < 8; i+= 2)
+ if (a[i] != b[i] / 8 || a[i + 1] != b[i + 1] / 4
+ || c[i] != d[i] / 3 || c[i + 1] != d[i + 1] / 5)
+ abort ();
+ f5 ();
+ f6 ();
+ for (i = 0; i < 8; i+= 2)
+ if (a[i] != b[i] / 14 || a[i + 1] != b[i + 1] / 15
+ || c[i] != d[i] / (i == 6 ? 13 : 6) || c[i + 1] != d[i + 1] / 5)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-4.c
new file mode 100644
index 000000000..f48ec6b59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51581-4.c
@@ -0,0 +1,166 @@
+/* PR tree-optimization/51581 */
+
+#include "tree-vect.h"
+
+short int a[16], b[16];
+unsigned short int c[16], d[16];
+
+void
+f1 (void)
+{
+ a[0] = b[0] / 8;
+ a[1] = b[1] / 8;
+ a[2] = b[2] / 8;
+ a[3] = b[3] / 8;
+ a[4] = b[4] / 8;
+ a[5] = b[5] / 8;
+ a[6] = b[6] / 8;
+ a[7] = b[7] / 8;
+ a[8] = b[8] / 8;
+ a[9] = b[9] / 8;
+ a[10] = b[10] / 8;
+ a[11] = b[11] / 8;
+ a[12] = b[12] / 8;
+ a[13] = b[13] / 8;
+ a[14] = b[14] / 8;
+ a[15] = b[15] / 8;
+}
+
+void
+f2 (void)
+{
+ c[0] = d[0] / 3;
+ c[1] = d[1] / 3;
+ c[2] = d[2] / 3;
+ c[3] = d[3] / 3;
+ c[4] = d[4] / 3;
+ c[5] = d[5] / 3;
+ c[6] = d[6] / 3;
+ c[7] = d[7] / 3;
+ c[8] = d[8] / 3;
+ c[9] = d[9] / 3;
+ c[10] = d[10] / 3;
+ c[11] = d[11] / 3;
+ c[12] = d[12] / 3;
+ c[13] = d[13] / 3;
+ c[14] = d[14] / 3;
+ c[15] = d[15] / 3;
+}
+
+void
+f3 (void)
+{
+ a[0] = b[0] / 8;
+ a[1] = b[1] / 4;
+ a[2] = b[2] / 8;
+ a[3] = b[3] / 4;
+ a[4] = b[4] / 8;
+ a[5] = b[5] / 4;
+ a[6] = b[6] / 8;
+ a[7] = b[7] / 4;
+ a[8] = b[8] / 8;
+ a[9] = b[9] / 4;
+ a[10] = b[10] / 8;
+ a[11] = b[11] / 4;
+ a[12] = b[12] / 8;
+ a[13] = b[13] / 4;
+ a[14] = b[14] / 8;
+ a[15] = b[15] / 4;
+}
+
+void
+f4 (void)
+{
+ c[0] = d[0] / 3;
+ c[1] = d[1] / 5;
+ c[2] = d[2] / 3;
+ c[3] = d[3] / 5;
+ c[4] = d[4] / 3;
+ c[5] = d[5] / 5;
+ c[6] = d[6] / 3;
+ c[7] = d[7] / 5;
+ c[8] = d[8] / 3;
+ c[9] = d[9] / 5;
+ c[10] = d[10] / 3;
+ c[11] = d[11] / 5;
+ c[12] = d[12] / 3;
+ c[13] = d[13] / 5;
+ c[14] = d[14] / 3;
+ c[15] = d[15] / 5;
+}
+
+void
+f5 (void)
+{
+ a[0] = b[0] / 14;
+ a[1] = b[1] / 15;
+ a[2] = b[2] / 14;
+ a[3] = b[3] / 15;
+ a[4] = b[4] / 14;
+ a[5] = b[5] / 15;
+ a[6] = b[6] / 14;
+ a[7] = b[7] / 15;
+ a[8] = b[8] / 14;
+ a[9] = b[9] / 15;
+ a[10] = b[10] / 14;
+ a[11] = b[11] / 15;
+ a[12] = b[12] / 14;
+ a[13] = b[13] / 15;
+ a[14] = b[14] / 14;
+ a[15] = b[15] / 15;
+}
+
+void
+f6 (void)
+{
+ c[0] = d[0] / 6;
+ c[1] = d[1] / 5;
+ c[2] = d[2] / 6;
+ c[3] = d[3] / 5;
+ c[4] = d[4] / 6;
+ c[5] = d[5] / 5;
+ c[6] = d[6] / 13;
+ c[7] = d[7] / 5;
+ c[8] = d[8] / 6;
+ c[9] = d[9] / 5;
+ c[10] = d[10] / 6;
+ c[11] = d[11] / 5;
+ c[12] = d[12] / 6;
+ c[13] = d[13] / 5;
+ c[14] = d[14] / 13;
+ c[15] = d[15] / 5;
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ asm ("");
+ for (i = 0; i < 16; i++)
+ {
+ asm ("");
+ b[i] = i - 8;
+ d[i] = i - 8;
+ }
+ f1 ();
+ f2 ();
+ for (i = 0; i < 16; i++)
+ if (a[i] != b[i] / 8 || c[i] != d[i] / 3)
+ abort ();
+ f3 ();
+ f4 ();
+ for (i = 0; i < 16; i+= 2)
+ if (a[i] != b[i] / 8 || a[i + 1] != b[i + 1] / 4
+ || c[i] != d[i] / 3 || c[i + 1] != d[i + 1] / 5)
+ abort ();
+ f5 ();
+ f6 ();
+ for (i = 0; i < 16; i+= 2)
+ if (a[i] != b[i] / 14 || a[i + 1] != b[i + 1] / 15
+ || c[i] != d[i] / ((i & 7) == 6 ? 13 : 6) || c[i + 1] != d[i + 1] / 5)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51590.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51590.c
new file mode 100644
index 000000000..90075b6e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51590.c
@@ -0,0 +1,35 @@
+/* PR middle-end/51590 */
+/* { dg-do compile } */
+
+struct S { long a, b; };
+
+extern void baz (char *);
+
+static void
+bar (struct S *x)
+{
+ char c[8];
+ int i;
+
+ for (i = 0; i < 8; i++)
+ c[i] = x->a >> ((7 - i) * 8);
+
+ baz (c);
+}
+
+void
+foo (const char *x, struct S *y)
+{
+ struct S d = *y;
+ int i;
+
+ for (i = 0; *x; x++)
+ i++;
+
+ if (i != 1)
+ return;
+
+ bar (&d);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51799.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51799.c
new file mode 100644
index 000000000..7d95e363d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr51799.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned long uint32_t;
+void
+f0a (uint32_t * __restrict__ result, int8_t * __restrict__ arg1,
+ uint32_t * __restrict__ arg4, int8_t temp_6)
+{
+ int idx;
+ for (idx = 0; idx < 416; idx += 1)
+ {
+ result[idx] = (uint8_t)(((arg1[idx] << 7) + arg4[idx]) * temp_6);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52091.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52091.c
new file mode 100644
index 000000000..ff583b299
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52091.c
@@ -0,0 +1,31 @@
+/* { dg-require-effective-target vect_int } */
+
+/* PR tree-optimization/52091 */
+
+int b, c, d, f;
+unsigned h;
+extern void abort (void);
+
+int
+main ()
+{
+ d = -1;
+ h = 65;
+ asm volatile ("" : : : "memory");
+ for (f = 0; f < 4; f++)
+ {
+ h &= (unsigned short) d;
+ for (b = 0; b <= 1; b++)
+ {
+ c = 0;
+ d &= 1;
+ }
+ }
+ asm volatile ("" : : : "memory");
+ if (b != 2 || c != 0 || d != 1 || f != 4 || h != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52298.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52298.c
new file mode 100644
index 000000000..453d7c8aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52298.c
@@ -0,0 +1,30 @@
+/* { dg-options "-O1 -ftree-vectorize -fno-tree-pre -fno-tree-loop-im" } */
+
+extern void abort (void);
+int c[80];
+
+__attribute__((noinline)) int
+foo (void)
+{
+ int l = 0;
+ int a, b;
+
+ for (a = 3; a >= 0; a--)
+ for (b = 7; b >= 0; b--)
+ l |= c[a+60];
+ return l;
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 60; i++)
+ c[i] = 1;
+ for (; i < 64; i++)
+ c[i] = 1 << (i - 59);
+ if (foo () != 30)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52870.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52870.c
new file mode 100644
index 000000000..38518508b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr52870.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize" } */
+
+long
+test (int *x)
+{
+ unsigned long sx, xprec;
+
+ sx = *x >= 0 ? *x : -*x;
+
+ xprec = sx * 64;
+
+ if (sx < 16384)
+ foo (sx);
+
+ return xprec;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53185-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53185-2.c
new file mode 100644
index 000000000..2f9ea16ea
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53185-2.c
@@ -0,0 +1,27 @@
+void __attribute__((noinline,noclone))
+fn1 (int * __restrict f, int * __restrict d, unsigned short a, int c)
+{
+ unsigned short e;
+ for (e = 0; e < a; ++e)
+ f[e] = d[e * c];
+}
+
+extern void abort (void);
+
+int main ()
+{
+ int a[32], b[3 * 32];
+ int i, off;
+ for (i = 0; i < 3 * 32; ++i)
+ b[i] = i;
+ for (off = 0; off < 8; ++off)
+ {
+ fn1 (&a[off], &b[off], 32 - off, 3);
+ for (i = 0; i < 32 - off; ++i)
+ if (a[off+i] != b[off+i*3])
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53185.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53185.c
new file mode 100644
index 000000000..af1efba8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53185.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-vectorize" } */
+unsigned short a, e;
+int *b, *d;
+int c;
+extern int fn2();
+void fn1 () {
+ void *f;
+ for (;;) {
+ fn2 ();
+ b = f;
+ e = 0;
+ for (; e < a; ++e)
+ b[e] = d[e * c];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53773.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53773.c
new file mode 100644
index 000000000..1c9e468f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr53773.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-optimized" } */
+
+int
+foo (int integral, int decimal, int power_ten)
+{
+ while (power_ten > 0)
+ {
+ integral *= 10;
+ decimal *= 10;
+ power_ten--;
+ }
+
+ return integral+decimal;
+}
+
+/* { dg-final { scan-tree-dump-times "\\* 10" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr55857-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr55857-1.c
new file mode 100644
index 000000000..ad41d3043
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr55857-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+void
+foo (int *data, unsigned len, const int qlp_coeff[], int lp, int residual[])
+{
+ int i;
+ int sum;
+ for(i = 0; i < (int)len; i++)
+ {
+ sum = 0;
+ sum += qlp_coeff[1] * data[i-2];
+ sum += qlp_coeff[0] * data[i-1];
+ residual[i] = data[i] - (sum >> lp);
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr55857-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr55857-2.c
new file mode 100644
index 000000000..3bfff8247
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr55857-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+void foo (int *data, unsigned len, const int qlp_coeff[],
+ unsigned order, int lp, int residual[])
+{
+ int i;
+ int sum;
+ if(order == 2)
+ for(i = 0; i < (int)len; i++)
+ {
+ sum = 0;
+ sum += qlp_coeff[1] * data[i-2];
+ sum += qlp_coeff[0] * data[i-1];
+ residual[i] = data[i] - (sum >> lp);
+ }
+ else
+ for(i = 0; i < (int)len; i++)
+ residual[i] = data[i] - ((qlp_coeff[0] * data[i-1]) >> lp);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56695.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56695.c
new file mode 100644
index 000000000..8b997c299
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56695.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/56695 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+int a, b, i;
+
+void
+f (void)
+{
+ for (i = 0; i < 8; ++i)
+ a |= !(i |= b %= 1);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56787.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56787.c
new file mode 100644
index 000000000..77fe4d80a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56787.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+inline void
+bar (const float s[5], float z[3][5])
+{
+ float a = s[0], b = s[1], c = s[2], d = s[3], e = s[4];
+ float f = a;
+ float u = f * b, v = f * c, w = f * d;
+ float p = 0.4f * (e - 0.5f * (b * u + c * v + d * w));
+ z[0][3] = b * w;
+ z[1][3] = c * w;
+ z[2][3] = d * w + p;
+}
+
+void
+foo (unsigned long n, const float *__restrict u0,
+ const float *__restrict u1, const float *__restrict u2,
+ const float *__restrict u3, const float *__restrict u4,
+ const float *__restrict s0, const float *__restrict s1,
+ const float *__restrict s2, float *__restrict t3,
+ float *__restrict t4)
+{
+ unsigned long i;
+ for (i = 0; i < n; i++)
+ {
+ float u[5], f[3][5];
+ u[0] = u0[i]; u[1] = u1[i]; u[2] = u2[i]; u[3] = u3[i]; u[4] = u4[i];
+ bar (u, f);
+ t3[i] = s0[i] * f[0][3] + s1[i] * f[1][3] + s2[i] * f[2][3];
+ }
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56826.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56826.c
new file mode 100644
index 000000000..7a5c5ff40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56826.c
@@ -0,0 +1,41 @@
+extern void abort (void);
+
+typedef struct {
+ int a[3];
+ int num;
+} t1;
+t1 B[100];
+int A[300];
+
+void __attribute__((noinline,noclone))
+bar (int *A, t1 *B, int n)
+{
+ int i;
+ int *a = A;
+ for (i=0; i<n; i++, a+=3)
+ {
+ a[0] = B[i].a[0];
+ a[1] = B[i].a[1];
+ a[2] = B[i].a[2];
+ }
+}
+
+int main()
+{
+ int i;
+ for (i=0; i<100; i++)
+ {
+ B[i].num = i;
+ B[i].a[0] = i * 3;
+ B[i].a[1] = i * 3 + 1;
+ B[i].a[2] = i * 3 + 2;
+ __asm__ volatile ("");
+ }
+ bar (&A[0], &B[0], 100);
+ for (i=0; i<300; i++)
+ if (A[i] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56918.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56918.c
new file mode 100644
index 000000000..581faa0e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56918.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/56918 */
+/* { dg-additional-options "-O3" } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+double data[8];
+
+__attribute__((noinline, noclone)) void
+foo ()
+{
+ int i;
+ for (i = 0; i < 8; ++i)
+ data[i] = ((i + 2) % 3) + 1;
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ foo ();
+ if (data[0] != 3 || data[7] != 1)
+ abort ();
+ for (i = 1; i < 4; ++i)
+ if (data[i] != i || data[i + 3] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56920.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56920.c
new file mode 100644
index 000000000..c6c7cca0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56920.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/56920 */
+/* { dg-additional-options "-O3" } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+
+int
+main ()
+{
+ unsigned int a[15], i;
+ check_vect ();
+ for (i = 0; i < 15; ++i)
+ a[i] = (i * 2) % 15;
+ for (i = 0; i < 15; ++i)
+ if (a[i] != (i * 2) % 15)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56933.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56933.c
new file mode 100644
index 000000000..b5e56fbdd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr56933.c
@@ -0,0 +1,46 @@
+/* { dg-do run } */
+/* { dg-require-effective-target vect_double } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+void __attribute__((noinline,noclone))
+foo (double *b, double *d, double *f)
+{
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ d[2*i] = 2. * d[2*i];
+ d[2*i+1] = 4. * d[2*i+1];
+ b[i] = d[2*i] - 1.;
+ f[i] = d[2*i+1] + 2.;
+ }
+}
+int main()
+{
+ double b[1024], d[2*1024], f[1024];
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < 2*1024; i++)
+ d[i] = 1.;
+ foo (b, d, f);
+ for (i = 0; i < 1024; i+= 2)
+ {
+ if (d[2*i] != 2.)
+ abort ();
+ if (d[2*i+1] != 4.)
+ abort ();
+ }
+ for (i = 0; i < 1024; i++)
+ {
+ if (b[i] != 1.)
+ abort ();
+ if (f[i] != 6.)
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57705.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57705.c
new file mode 100644
index 000000000..ca8f69020
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57705.c
@@ -0,0 +1,67 @@
+/* { dg-do run } */
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+int a[1024];
+unsigned char b[1024];
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) void
+foo (int k, int m)
+{
+ int i, k2 = k;
+ for (i = 0; i < 1024; i++)
+ {
+ a[i] = k2;
+ k2 += m + 1;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+bar (int k, int m)
+{
+ int i, k2 = k;
+ for (i = 0; i < 1024; i++)
+ {
+ k2 += m + 1;
+ a[i] = k2;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+baz (int k, int m)
+{
+ int i, k2 = k;
+ for (i = 0; i < 1024; i++)
+ {
+ a[i] = k2;
+ b[i] = i;
+ k2 += m + 1;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ foo (5, 3);
+ for (i = 0; i < 1024; i++)
+ if (a[i] != 5 + 4 * i)
+ abort ();
+ bar (5, 3);
+ for (i = 0; i < 1024; i++)
+ if (a[i] != 9 + 4 * i)
+ abort ();
+ baz (5, 3);
+ for (i = 0; i < 1024; i++)
+ if (a[i] != 5 + 4 * i || b[i] != (unsigned char) i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loop" 3 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loop" 2 "vect" { target { ! vect_pack_trunc } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-1.c
new file mode 100644
index 000000000..780f870e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-1.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/57741 */
+/* { dg-do compile } */
+
+void
+foo (float *p, float *q, float x)
+{
+ int i;
+ float f = 1.0f, g = 2.0f;
+ for (i = 0; i < 1024; i++)
+ {
+ *p++ = f;
+ f += x;
+ }
+ for (i = 0; i < 1024; i++)
+ {
+ *q++ = g;
+ g += 0.5f;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-2.c
new file mode 100644
index 000000000..2b1151ef2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-2.c
@@ -0,0 +1,45 @@
+/* PR tree-optimization/57741 */
+/* { dg-do run } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-additional-options "-ffast-math" } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) void
+foo (float *p, float *q, float x)
+{
+ int i;
+ p = (float *) __builtin_assume_aligned (p, 32);
+ q = (float *) __builtin_assume_aligned (q, 32);
+ float f = 1.0f, g = 2.0f;
+ for (i = 0; i < 1024; i++)
+ {
+ *p++ = f;
+ f += x;
+ }
+ for (i = 0; i < 1024; i++)
+ {
+ *q++ = g;
+ g += 0.5f;
+ }
+}
+
+float p[1024] __attribute__((aligned (32))) = { 17.0f };
+float q[1024] __attribute__((aligned (32))) = { 17.0f };
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ foo (p, q, 1.5f);
+ for (i = 0; i < 1024; i++)
+ if (p[i] != 1.0f + i * 1.5f || q[i] != 2.0f + i * 0.5f)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loop" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-3.c
new file mode 100644
index 000000000..b0281765b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr57741-3.c
@@ -0,0 +1,44 @@
+/* PR tree-optimization/57741 */
+/* { dg-do run } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "-ffast-math" } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+
+float p[1024] __attribute__((aligned (32))) = { 17.0f };
+float q[1024] __attribute__((aligned (32))) = { 17.0f };
+char r[1024] __attribute__((aligned (32))) = { 1 };
+
+__attribute__((noinline, noclone)) void
+foo (float x)
+{
+ int i;
+ float f = 1.0f, g = 2.0f;
+ for (i = 0; i < 1024; i++)
+ {
+ p[i] = f;
+ f += x;
+ q[i] = g;
+ g += 0.5f;
+ r[i]++;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ r[0] = 0;
+ foo (1.5f);
+ for (i = 0; i < 1024; i++)
+ if (p[i] != 1.0f + i * 1.5f || q[i] != 2.0f + i * 0.5f || r[i] != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loop" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr58508.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr58508.c
new file mode 100644
index 000000000..80ba9cc1d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr58508.c
@@ -0,0 +1,71 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+
+/* The GCC vectorizer generates loop versioning for the following loop
+ since there may exist aliasing between A and B. The predicate checks
+ if A may alias with B across all iterations. Then for the loop in
+ the true body, we can assert that *B is a loop invariant so that
+ we can hoist the load of *B before the loop body. */
+
+void test1 (int* a, int* b)
+{
+ int i;
+ for (i = 0; i < 100000; ++i)
+ a[i] = *b + 1;
+}
+
+/* A test case with nested loops. The load of b[j+1] in the inner
+ loop should be hoisted. */
+
+void test2 (int* a, int* b)
+{
+ int i, j;
+ for (j = 0; j < 100000; ++j)
+ for (i = 0; i < 100000; ++i)
+ a[i] = b[j+1] + 1;
+}
+
+/* A test case with ifcvt transformation. */
+
+void test3 (int* a, int* b)
+{
+ int i, t;
+ for (i = 0; i < 10000; ++i)
+ {
+ if (*b > 0)
+ t = *b * 2;
+ else
+ t = *b / 2;
+ a[i] = t;
+ }
+}
+
+/* A test case in which the store in the loop can be moved outside
+ in the versioned loop with alias checks. Note this loop won't
+ be vectorized. */
+
+void test4 (int* a, int* b)
+{
+ int i;
+ for (i = 0; i < 100000; ++i)
+ *a += b[i];
+}
+
+/* A test case in which the load and store in the loop to b
+ can be moved outside in the versioned loop with alias checks.
+ Note this loop won't be vectorized. */
+
+void test5 (int* a, int* b)
+{
+ int i;
+ for (i = 0; i < 100000; ++i)
+ {
+ *b += a[i];
+ a[i] = *b;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "hoist" 8 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "hoist" 3 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59519-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59519-1.c
new file mode 100644
index 000000000..428d4ec32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59519-1.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/59519 */
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+int a, b, c, d;
+
+void
+foo (void)
+{
+ for (; d; d++)
+ for (b = 0; b < 14; b++)
+ {
+ c |= 1;
+ if (a)
+ break;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59519-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59519-2.c
new file mode 100644
index 000000000..2b109d255
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59519-2.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/59519 */
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+struct S { int f0; } d;
+int a[8] = { 0 }, b, c, e;
+
+void
+foo (void)
+{
+ for (; e < 1; e++)
+ for (b = 0; b < 7; b++)
+ {
+ c |= (a[b + 1] != 0);
+ if (d.f0)
+ break;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59591-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59591-1.c
new file mode 100644
index 000000000..b216deea9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59591-1.c
@@ -0,0 +1,55 @@
+/* PR tree-optimization/59591 */
+/* { dg-do run } */
+/* { dg-additional-options "-fopenmp-simd" } */
+
+#ifndef CHECK_H
+#include "tree-vect.h"
+#endif
+
+extern void abort (void);
+
+int p[256], q[256], r[256], t[256];
+
+__attribute__((noinline, noclone)) void
+foo (void)
+{
+ int i;
+ #pragma omp simd safelen(64)
+ for (i = 0; i < 256; i++)
+ if (r[i] > 32)
+ t[i] = p[q[i] * 3L + 2L];
+}
+
+__attribute__((noinline, noclone)) void
+bar (void)
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ {
+ r[i] = ((i >> 2) & (1 << (i & 3))) ? 32 + i : 32 - i;
+ q[i] = r[i] > 32 ? ((i * 7) % 84) : 99 + i;
+ p[i] = i * 11;
+ t[i] = i * 13;
+ }
+ foo ();
+ for (i = 0; i < 256; i++)
+ if ((i >> 2) & (1 << (i & 3)))
+ {
+ if (t[i] != (((i * 7) % 84) * 3 + 2) * 11)
+ abort ();
+ }
+ else if (t[i] != i * 13)
+ abort ();
+}
+
+#ifndef CHECK_H
+int
+main ()
+{
+ check_vect ();
+ bar ();
+ return 0;
+}
+#endif
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59591-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59591-2.c
new file mode 100644
index 000000000..429b187bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59591-2.c
@@ -0,0 +1,56 @@
+/* PR tree-optimization/59591 */
+/* { dg-do run } */
+/* { dg-additional-options "-fopenmp-simd" } */
+
+#ifndef CHECK_H
+#include "tree-vect.h"
+#endif
+
+extern void abort (void);
+
+long long int p[256], r[256], t[256];
+int q[256];
+
+__attribute__((noinline, noclone)) void
+foo (void)
+{
+ int i;
+ #pragma omp simd safelen(64)
+ for (i = 0; i < 256; i++)
+ if (r[i] > 32LL)
+ t[i] = p[q[i]];
+}
+
+__attribute__((noinline, noclone)) void
+bar (void)
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ {
+ r[i] = ((i >> 2) & (1 << (i & 3))) ? 32 + i : 32 - i;
+ q[i] = r[i] > 32 ? ((i * 7) % 256) : 258 + i;
+ p[i] = i * 11;
+ t[i] = i * 13;
+ }
+ foo ();
+ for (i = 0; i < 256; i++)
+ if ((i >> 2) & (1 << (i & 3)))
+ {
+ if (t[i] != ((i * 7) % 256) * 11)
+ abort ();
+ }
+ else if (t[i] != i * 13)
+ abort ();
+}
+
+#ifndef CHECK_H
+int
+main ()
+{
+ check_vect ();
+ bar ();
+ return 0;
+}
+#endif
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59594.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59594.c
new file mode 100644
index 000000000..6c0b5880e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59594.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/59594 */
+
+#include "tree-vect.h"
+
+#define N 1024
+int b[N + 1];
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ for (i = 0; i < N + 1; i++)
+ {
+ b[i] = i;
+ asm ("");
+ }
+ for (i = N; i >= 0; i--)
+ {
+ b[i + 1] = b[i];
+ b[i] = 1;
+ }
+ if (b[0] != 1)
+ __builtin_abort ();
+ for (i = 0; i < N; i++)
+ if (b[i + 1] != i)
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59651.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59651.c
new file mode 100644
index 000000000..4407785aa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59651.c
@@ -0,0 +1,4 @@
+/* PR tree-optimization/59561 */
+#include "../torture/pr59651.c"
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59984.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59984.c
new file mode 100644
index 000000000..1b9594295
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr59984.c
@@ -0,0 +1,65 @@
+/* PR c/59984 */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+
+#include "tree-vect.h"
+
+#define N 128
+
+int a[N];
+
+#pragma omp declare simd
+__attribute__((noinline)) void
+foo (int in, int *out1, int *out2)
+{
+ *out1 = in * in - 1;
+ *out2 = in * in + 1;
+}
+
+#pragma omp declare simd linear (out1, out2)
+__attribute__((noinline)) void
+bar (int in, int *out1, int *out2)
+{
+ *out1 = in * in - 1;
+ *out2 = in * in + 1;
+}
+
+__attribute__((noinline)) void
+test (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ a[i] = i;
+#pragma omp simd
+ for (i = 0; i < N; i++)
+ {
+ int v1, v2;
+ foo (a[i], &v1, &v2);
+ a[i] = v1 * v2;
+ }
+ for (i = 0; i < N; i++)
+ if (a[i] != i * i * i * i - 1)
+ __builtin_abort ();
+ for (i = 0; i < N; i++)
+ a[i] = i;
+#pragma omp simd
+ for (i = 0; i < N; i++)
+ {
+ int v1, v2;
+ bar (a[i], &v1, &v2);
+ a[i] = v1 * v2;
+ }
+ for (i = 0; i < N; i++)
+ if (a[i] != i * i * i * i - 1)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ check_vect ();
+ test ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60012.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60012.c
new file mode 100644
index 000000000..bd0f37c2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60012.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "--param vect-max-version-for-alias-checks=0" } */
+
+typedef struct
+{
+ short real;
+ short imag;
+} complex16_t;
+
+void
+libvector_AccSquareNorm_ref (unsigned int *acc,
+ const complex16_t *x, unsigned len)
+{
+ unsigned i;
+ for (i = 0; i < len; i++)
+ acc[i] += ((unsigned int)((int)x[i].real * x[i].real))
+ + ((unsigned int)((int)x[i].imag * x[i].imag));
+}
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_extract_even_odd } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60092-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60092-2.c
new file mode 100644
index 000000000..7d2eb6e80
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60092-2.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int *foo (int n)
+{
+ int *p;
+ int *q;
+ void *tem;
+ if (posix_memalign (&tem, 256, n * sizeof (int)) != 0)
+ return (void *)0;
+ p = (int *)tem;
+ if (posix_memalign (&tem, 256, n * sizeof (int)) != 0)
+ return (void *)0;
+ q = (int *)tem;
+ bar (q);
+ int i;
+ for (i = 0; i < n; ++i)
+ p[i] = q[i] + q[i];
+ return p;
+}
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump-not "Peeling for alignment will be applied" "vect" } } */
+/* { dg-final { scan-tree-dump-not "Vectorizing an unaligned access" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60276.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60276.c
new file mode 100644
index 000000000..d4ad21980
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60276.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+static void
+foo (int *out, const int *lp, unsigned samples)
+{
+ int x, target;
+ for (x = 0, target = 0; x < (int)samples; x += 2, target++)
+ {
+ out[x] = lp[target];
+ out[x - 1] = out[x - 2] + out[x];
+ }
+}
+
+static void
+foo_novec (int *out, const int *lp, unsigned samples)
+{
+ int x, target;
+ for (x = 0, target = 0; x < (int)samples; x += 2, target++)
+ {
+ out[x] = lp[target];
+ out[x - 1] = out[x - 2] + out[x];
+ __asm__ volatile ("" : : : "memory");
+ }
+}
+
+int main(void)
+{
+ const int lp[25] = {
+ 0, 2, 4, 6, 8,
+ 10, 12, 14, 16,
+ 18, 20, 22, 24,
+ 26, 28, 30, 32,
+ 34, 36, 38, 40,
+ 42, 44, 46, 48,
+ };
+ int out[49] = {0};
+ int out2[49] = {0};
+ int s;
+
+ foo (out + 2, lp + 1, 48);
+ foo_novec (out2 + 2, lp + 1, 48);
+
+ for (s = 0; s < 49; s++)
+ if (out[s] != out2[s])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60382.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60382.c
new file mode 100644
index 000000000..a28c6313c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60382.c
@@ -0,0 +1,32 @@
+#include "tree-vect.h"
+
+int a, b, c, e, f;
+
+void
+foo ()
+{
+ for (b = 0; b < 3; b++)
+ if (e)
+ {
+ for (c = 0; c < 4; c++)
+ {
+ if (b)
+ continue;
+ f = 1;
+ for (a = 0; a < 2; a++)
+ f |= 1;
+ }
+ for (;;)
+ ;
+ }
+}
+
+int
+main ()
+{
+ check_vect ();
+ foo ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60482.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60482.c
new file mode 100644
index 000000000..78821183c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60482.c
@@ -0,0 +1,20 @@
+/* PR middle-end/60482 */
+/* { dg-do compile } */
+/* { dg-additional-options "-Ofast" } */
+/* { dg-require-effective-target vect_int } */
+
+double
+foo (double *x, int n)
+{
+ double p = 0.0;
+ int i;
+ x = __builtin_assume_aligned (x, 128);
+ if (n % 128)
+ __builtin_unreachable ();
+ for (i = 0; i < n; i++)
+ p += x[i];
+ return p;
+}
+
+/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/section-anchors-pr27770.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/section-anchors-pr27770.c
new file mode 100644
index 000000000..7513d93a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/section-anchors-pr27770.c
@@ -0,0 +1,31 @@
+/* { dg-require-effective-target section_anchors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+short x;
+static short f[100] = {0};
+int
+bar (void)
+{
+ return f[0];
+}
+void
+foo (void)
+{
+ int i;
+ for (i = 0; i < 100; i++)
+ f[i]++;
+}
+int main (void)
+{
+ int i;
+ check_vect ();
+ foo ();
+ for (i = 0; i < 100; i++)
+ if (f[i]!=1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c
new file mode 100644
index 000000000..7b5ce7348
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c
@@ -0,0 +1,120 @@
+/* { dg-require-effective-target section_anchors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct s2{
+ int m;
+ int n[N-1][N-1][N-1];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+struct test2{
+ struct s2 a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s2 e; /* array e.n is aligned */
+};
+
+
+struct test1 tmp1[4];
+struct test2 tmp2[4];
+
+int main1 ()
+{
+ int i,j;
+
+ /* 1. unaligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1[2].a.n[1][2][i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (tmp1[2].a.n[1][2][i] != 5)
+ abort ();
+ }
+
+ /* 2. aligned */
+ for (i = 3; i < N-1; i++)
+ {
+ tmp1[2].a.n[1][2][i] = 6;
+ }
+
+ /* check results: */
+ for (i = 3; i < N-1; i++)
+ {
+ if (tmp1[2].a.n[1][2][i] != 6)
+ abort ();
+ }
+
+ /* 3. aligned */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ tmp1[2].e.n[1][i][j] = 8;
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (tmp1[2].e.n[1][i][j] != 8)
+ abort ();
+ }
+ }
+
+ /* 4. unaligned */
+ for (i = 0; i < N-4; i++)
+ {
+ for (j = 0; j < N-4; j++)
+ {
+ tmp2[2].e.n[1][i][j] = 8;
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N-4; i++)
+ {
+ for (j = 0; j < N-4; j++)
+ {
+ if (tmp2[2].e.n[1][i][j] != 8)
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_int } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* Alignment forced using versioning until the pass that increases alignment
+ is extended to handle structs. */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 4 "vect" { target {vect_int && vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target {vect_int && {! vector_alignment_reachable} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-1.c
new file mode 100644
index 000000000..6e95b6166
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-1.c
@@ -0,0 +1,123 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*4] = 8;
+ out[i*4 + 1] = 18;
+ out[i*4 + 2] = 28;
+ out[i*4 + 3] = 38;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != 8
+ || out[i*4 + 1] != 18
+ || out[i*4 + 2] != 28
+ || out[i*4 + 3] != 38)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = 8;
+ out[i*8 + 1] = 7;
+ out[i*8 + 2] = 81;
+ out[i*8 + 3] = 28;
+ out[i*8 + 4] = 18;
+ out[i*8 + 5] = 85;
+ out[i*8 + 6] = 5;
+ out[i*8 + 7] = 4;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != 8
+ || out[i*8 + 1] != 7
+ || out[i*8 + 2] != 81
+ || out[i*8 + 3] != 28
+ || out[i*8 + 4] != 18
+ || out[i*8 + 5] != 85
+ || out[i*8 + 6] != 5
+ || out[i*8 + 7] != 4)
+ abort ();
+ }
+
+ /* SLP with unrolling by 8. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*5] = 8;
+ out[i*5 + 1] = 7;
+ out[i*5 + 2] = 81;
+ out[i*5 + 3] = 28;
+ out[i*5 + 4] = 18;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*5] != 8
+ || out[i*5 + 1] != 7
+ || out[i*5 + 2] != 81
+ || out[i*5 + 3] != 28
+ || out[i*5 + 4] != 18)
+ abort ();
+ }
+
+ /* SLP with unrolling by 8. */
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*9] = 8;
+ out[i*9 + 1] = 7;
+ out[i*9 + 2] = 81;
+ out[i*9 + 3] = 28;
+ out[i*9 + 4] = 18;
+ out[i*9 + 5] = 85;
+ out[i*9 + 6] = 5;
+ out[i*9 + 7] = 4;
+ out[i*9 + 8] = 14;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*9] != 8
+ || out[i*9 + 1] != 7
+ || out[i*9 + 2] != 81
+ || out[i*9 + 3] != 28
+ || out[i*9 + 4] != 18
+ || out[i*9 + 5] != 85
+ || out[i*9 + 6] != 5
+ || out[i*9 + 7] != 4
+ || out[i*9 + 8] != 14)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-10.c
new file mode 100644
index 000000000..16a0c257d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-10.c
@@ -0,0 +1,113 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ float out2[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+
+ a0 = in[i*8] + 5;
+ a1 = in[i*8 + 1] + 6;
+ a2 = in[i*8 + 2] + 7;
+ a3 = in[i*8 + 3] + 8;
+ a4 = in[i*8 + 4] + 9;
+ a5 = in[i*8 + 5] + 10;
+ a6 = in[i*8 + 6] + 11;
+ a7 = in[i*8 + 7] + 12;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+ b2 = a2 * 12;
+ b3 = a3 * 5;
+ b4 = a4 * 8;
+ b5 = a5 * 4;
+ b6 = a6 * 3;
+ b7 = a7 * 2;
+
+ out[i*8] = b0 - 2;
+ out[i*8 + 1] = b1 - 3;
+ out[i*8 + 2] = b2 - 2;
+ out[i*8 + 3] = b3 - 1;
+ out[i*8 + 4] = b4 - 8;
+ out[i*8 + 5] = b5 - 7;
+ out[i*8 + 6] = b6 - 3;
+ out[i*8 + 7] = b7 - 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (in[i*8] + 5) * 3 - 2
+ || out[i*8 + 1] != (in[i*8 + 1] + 6) * 2 - 3
+ || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
+ || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
+ || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
+ || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
+ || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
+ || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7)
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = (in[i*4] + 2) * 3;
+ out[i*4 + 1] = (in[i*4 + 1] + 2) * 7;
+ out[i*4 + 2] = (in[i*4 + 2] + 7) * 3;
+ out[i*4 + 3] = (in[i*4 + 3] + 7) * 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != (in[i*4] + 2) * 3
+ || out[i*4 + 1] != (in[i*4 + 1] + 2) * 7
+ || out[i*4 + 2] != (in[i*4 + 2] + 7) * 3
+ || out[i*4 + 3] != (in[i*4 + 3] + 7) * 7)
+ abort ();
+ }
+
+ for (i = 0; i < N*4; i++)
+ {
+ out2[i*2] = (float) (in[i*2] * 2 + 5) ;
+ out2[i*2 + 1] = (float) (in[i*2 + 1] * 3 + 7);
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out2[i*2] != (float) (in[i*2] * 2 + 5)
+ || out2[i*2 + 1] != (float) (in[i*2 + 1] * 3 + 7))
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target {vect_uintfloat_cvt && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" {target {{! { vect_uintfloat_cvt}} && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target {{! { vect_uintfloat_cvt}} && { ! {vect_int_mult}}} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target {vect_uintfloat_cvt && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target {{! { vect_uintfloat_cvt}} && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target {{! { vect_uintfloat_cvt}} && { ! {vect_int_mult}}} } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11a.c
new file mode 100644
index 000000000..520bb74df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11a.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+ /* Different operations - not SLPable. */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*8] + 5;
+ a1 = in[i*8 + 1] * 6;
+ a2 = in[i*8 + 2] + 7;
+ a3 = in[i*8 + 3] + 8;
+ a4 = in[i*8 + 4] + 9;
+ a5 = in[i*8 + 5] + 10;
+ a6 = in[i*8 + 6] + 11;
+ a7 = in[i*8 + 7] + 12;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+ b2 = a2 * 12;
+ b3 = a3 * 5;
+ b4 = a4 * 8;
+ b5 = a5 * 4;
+ b6 = a6 * 3;
+ b7 = a7 * 2;
+
+ out[i*8] = b0 - 2;
+ out[i*8 + 1] = b1 - 3;
+ out[i*8 + 2] = b2 - 2;
+ out[i*8 + 3] = b3 - 1;
+ out[i*8 + 4] = b4 - 8;
+ out[i*8 + 5] = b5 - 7;
+ out[i*8 + 6] = b6 - 3;
+ out[i*8 + 7] = b7 - 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (in[i*8] + 5) * 3 - 2
+ || out[i*8 + 1] != (in[i*8 + 1] * 6) * 2 - 3
+ || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
+ || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
+ || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
+ || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
+ || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
+ || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11b.c
new file mode 100644
index 000000000..6942c578b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11b.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+ /* Requires permutation - not SLPable. */
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = (in[i*4] + 2) * 3;
+ out[i*4 + 1] = (in[i*4 + 2] + 2) * 7;
+ out[i*4 + 2] = (in[i*4 + 1] + 7) * 3;
+ out[i*4 + 3] = (in[i*4 + 3] + 3) * 4;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != (in[i*4] + 2) * 3
+ || out[i*4 + 1] != (in[i*4 + 2] + 2) * 7
+ || out[i*4 + 2] != (in[i*4 + 1] + 7) * 3
+ || out[i*4 + 3] != (in[i*4 + 3] + 3) * 4)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided4 && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided4 && vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11c.c
new file mode 100644
index 000000000..42b358aa6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-11c.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ float out[N*8];
+
+ /* Different operations - not SLPable. */
+ for (i = 0; i < N*4; i++)
+ {
+ out[i*2] = ((float) in[i*2] * 2 + 6) ;
+ out[i*2 + 1] = (float) (in[i*2 + 1] * 3 + 7);
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out[i*2] != ((float) in[i*2] * 2 + 6)
+ || out[i*2 + 1] != (float) (in[i*2 + 1] * 3 + 7))
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_uintfloat_cvt && vect_strided2 } && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { { vect_uintfloat_cvt && vect_strided2 } && vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12a.c
new file mode 100644
index 000000000..5c1c5a7a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12a.c
@@ -0,0 +1,80 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned int ia[N];
+
+ for (i = 0; i < N; i++)
+ {
+
+ a0 = in[i*8] + 5;
+ a1 = in[i*8 + 1] + 6;
+ a2 = in[i*8 + 2] + 7;
+ a3 = in[i*8 + 3] + 8;
+ a4 = in[i*8 + 4] + 9;
+ a5 = in[i*8 + 5] + 10;
+ a6 = in[i*8 + 6] + 11;
+ a7 = in[i*8 + 7] + 12;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+ b2 = a2 * 12;
+ b3 = a3 * 5;
+ b4 = a4 * 8;
+ b5 = a5 * 4;
+ b6 = a6 * 3;
+ b7 = a7 * 2;
+
+ out[i*8] = b0 - 2;
+ out[i*8 + 1] = b1 - 3;
+ out[i*8 + 2] = b2 - 2;
+ out[i*8 + 3] = b3 - 1;
+ out[i*8 + 4] = b4 - 8;
+ out[i*8 + 5] = b5 - 7;
+ out[i*8 + 6] = b6 - 3;
+ out[i*8 + 7] = b7 - 7;
+
+ ia[i] = b6;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (in[i*8] + 5) * 3 - 2
+ || out[i*8 + 1] != (in[i*8 + 1] + 6) * 2 - 3
+ || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
+ || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
+ || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
+ || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
+ || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
+ || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7
+ || ia[i] != (in[i*8 + 6] + 11) * 3)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_strided8 && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided8 && vect_int_mult } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12b.c
new file mode 100644
index 000000000..69e9f315f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12b.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_uintfloat_cvt } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+int
+main1 ()
+{
+ int i;
+ float out2[N*8], fa[N*4];
+
+ for (i = 0; i < N; i++)
+ {
+ out2[i*2] = (float) (in[i*2] * 2 + 11) ;
+ out2[i*2 + 1] = (float) (in[i*2 + 1] * 3 + 7);
+
+ fa[i] = (float) in[i*2+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out2[i*2] != (float) (in[i*2] * 2 + 11)
+ || out2[i*2 + 1] != (float) (in[i*2 + 1] * 3 + 7)
+ || fa[i] != (float) in[i*2+1])
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided2 && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_strided2 && vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_strided2 && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided2 && vect_int_mult } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12c.c
new file mode 100644
index 000000000..5152d2114
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-12c.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned int ia[N*2];
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = (in[i*4] + 2) * 3;
+ out[i*4 + 1] = (in[i*4 + 1] + 2) * 7;
+ out[i*4 + 2] = (in[i*4 + 2] + 7) * 3;
+ out[i*4 + 3] = (in[i*4 + 3] + 7) * 7;
+
+ ia[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != (in[i*4] + 2) * 3
+ || out[i*4 + 1] != (in[i*4 + 1] + 2) * 7
+ || out[i*4 + 2] != (in[i*4 + 2] + 7) * 3
+ || out[i*4 + 3] != (in[i*4 + 3] + 7) * 7
+ || ia[i] != 7)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_int_mult } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c
new file mode 100644
index 000000000..c40822b62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-13-big-array.c
@@ -0,0 +1,141 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+volatile int y = 0;
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+ unsigned short in[N*8];
+ unsigned int in2[N*8];
+ unsigned int out2[N*8];
+
+ for (i = 0; i < N*8; i++)
+ {
+ in[i] = in2[i] = i;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ /* Induction is not SLPable yet. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8] + i;
+ out[i*8 + 1] = in[i*8 + 1] + i;
+ out[i*8 + 2] = in[i*8 + 2] + i;
+ out[i*8 + 3] = in[i*8 + 3] + i;
+ out[i*8 + 4] = in[i*8 + 4] + i;
+ out[i*8 + 5] = in[i*8 + 5] + i;
+ out[i*8 + 6] = in[i*8 + 6] + i;
+ out[i*8 + 7] = in[i*8 + 7] + i;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8] + i
+ || out[i*8 + 1] != in[i*8 + 1] + i
+ || out[i*8 + 2] != in[i*8 + 2] + i
+ || out[i*8 + 3] != in[i*8 + 3] + i
+ || out[i*8 + 4] != in[i*8 + 4] + i
+ || out[i*8 + 5] != in[i*8 + 5] + i
+ || out[i*8 + 6] != in[i*8 + 6] + i
+ || out[i*8 + 7] != in[i*8 + 7] + i)
+ abort ();
+ }
+
+ /* Induction is not SLPable yet and strided group size must be a power of 2
+ to get vectorized. */
+ for (i = 0; i < N/2; i++)
+ {
+ out2[i*12] = in2[i*12] + i;
+ out2[i*12 + 1] = in2[i*12 + 1] + i;
+ out2[i*12 + 2] = in2[i*12 + 2] + i;
+ out2[i*12 + 3] = in2[i*12 + 3] + i;
+ out2[i*12 + 4] = in2[i*12 + 4] + i;
+ out2[i*12 + 5] = in2[i*12 + 5] + i;
+ out2[i*12 + 6] = in2[i*12 + 6] + i;
+ out2[i*12 + 7] = in2[i*12 + 7] + i;
+ out2[i*12 + 8] = in2[i*12 + 8] + i;
+ out2[i*12 + 9] = in2[i*12 + 9] + i;
+ out2[i*12 + 10] = in2[i*12 + 10] + i;
+ out2[i*12 + 11] = in2[i*12 + 11] + i;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out2[i*12] != in2[i*12] + i
+ || out2[i*12 + 1] != in2[i*12 + 1] + i
+ || out2[i*12 + 2] != in2[i*12 + 2] + i
+ || out2[i*12 + 3] != in2[i*12 + 3] + i
+ || out2[i*12 + 4] != in2[i*12 + 4] + i
+ || out2[i*12 + 5] != in2[i*12 + 5] + i
+ || out2[i*12 + 6] != in2[i*12 + 6] + i
+ || out2[i*12 + 7] != in2[i*12 + 7] + i
+ || out2[i*12 + 8] != in2[i*12 + 8] + i
+ || out2[i*12 + 9] != in2[i*12 + 9] + i
+ || out2[i*12 + 10] != in2[i*12 + 10] + i
+ || out2[i*12 + 11] != in2[i*12 + 11] + i)
+ abort ();
+ }
+
+ /* Not power of 2 but SLPable. */
+ for (i = 0; i < N/2; i++)
+ {
+ out2[i*12] = in2[i*12] + 1;
+ out2[i*12 + 1] = in2[i*12 + 1] + 2;
+ out2[i*12 + 2] = in2[i*12 + 2] + 3;
+ out2[i*12 + 3] = in2[i*12 + 3] + 4;
+ out2[i*12 + 4] = in2[i*12 + 4] + 5;
+ out2[i*12 + 5] = in2[i*12 + 5] + 6;
+ out2[i*12 + 6] = in2[i*12 + 6] + 7;
+ out2[i*12 + 7] = in2[i*12 + 7] + 8;
+ out2[i*12 + 8] = in2[i*12 + 8] + 9;
+ out2[i*12 + 9] = in2[i*12 + 9] + 10;
+ out2[i*12 + 10] = in2[i*12 + 10] + 11;
+ out2[i*12 + 11] = in2[i*12 + 11] + 12;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out2[i*12] != in2[i*12] + 1
+ || out2[i*12 + 1] != in2[i*12 + 1] + 2
+ || out2[i*12 + 2] != in2[i*12 + 2] + 3
+ || out2[i*12 + 3] != in2[i*12 + 3] + 4
+ || out2[i*12 + 4] != in2[i*12 + 4] + 5
+ || out2[i*12 + 5] != in2[i*12 + 5] + 6
+ || out2[i*12 + 6] != in2[i*12 + 6] + 7
+ || out2[i*12 + 7] != in2[i*12 + 7] + 8
+ || out2[i*12 + 8] != in2[i*12 + 8] + 9
+ || out2[i*12 + 9] != in2[i*12 + 9] + 10
+ || out2[i*12 + 10] != in2[i*12 + 10] + 11
+ || out2[i*12 + 11] != in2[i*12 + 11] + 12)
+ abort ();
+ }
+
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-13.c
new file mode 100644
index 000000000..655e6ade1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-13.c
@@ -0,0 +1,133 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+ unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned int in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned int out2[N*8];
+
+ /* Induction is not SLPable yet. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8] + i;
+ out[i*8 + 1] = in[i*8 + 1] + i;
+ out[i*8 + 2] = in[i*8 + 2] + i;
+ out[i*8 + 3] = in[i*8 + 3] + i;
+ out[i*8 + 4] = in[i*8 + 4] + i;
+ out[i*8 + 5] = in[i*8 + 5] + i;
+ out[i*8 + 6] = in[i*8 + 6] + i;
+ out[i*8 + 7] = in[i*8 + 7] + i;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8] + i
+ || out[i*8 + 1] != in[i*8 + 1] + i
+ || out[i*8 + 2] != in[i*8 + 2] + i
+ || out[i*8 + 3] != in[i*8 + 3] + i
+ || out[i*8 + 4] != in[i*8 + 4] + i
+ || out[i*8 + 5] != in[i*8 + 5] + i
+ || out[i*8 + 6] != in[i*8 + 6] + i
+ || out[i*8 + 7] != in[i*8 + 7] + i)
+ abort ();
+ }
+
+ /* Induction is not SLPable yet and strided group size must be a power of 2
+ to get vectorized. */
+ for (i = 0; i < N/2; i++)
+ {
+ out2[i*12] = in2[i*12] + i;
+ out2[i*12 + 1] = in2[i*12 + 1] + i;
+ out2[i*12 + 2] = in2[i*12 + 2] + i;
+ out2[i*12 + 3] = in2[i*12 + 3] + i;
+ out2[i*12 + 4] = in2[i*12 + 4] + i;
+ out2[i*12 + 5] = in2[i*12 + 5] + i;
+ out2[i*12 + 6] = in2[i*12 + 6] + i;
+ out2[i*12 + 7] = in2[i*12 + 7] + i;
+ out2[i*12 + 8] = in2[i*12 + 8] + i;
+ out2[i*12 + 9] = in2[i*12 + 9] + i;
+ out2[i*12 + 10] = in2[i*12 + 10] + i;
+ out2[i*12 + 11] = in2[i*12 + 11] + i;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out2[i*12] != in2[i*12] + i
+ || out2[i*12 + 1] != in2[i*12 + 1] + i
+ || out2[i*12 + 2] != in2[i*12 + 2] + i
+ || out2[i*12 + 3] != in2[i*12 + 3] + i
+ || out2[i*12 + 4] != in2[i*12 + 4] + i
+ || out2[i*12 + 5] != in2[i*12 + 5] + i
+ || out2[i*12 + 6] != in2[i*12 + 6] + i
+ || out2[i*12 + 7] != in2[i*12 + 7] + i
+ || out2[i*12 + 8] != in2[i*12 + 8] + i
+ || out2[i*12 + 9] != in2[i*12 + 9] + i
+ || out2[i*12 + 10] != in2[i*12 + 10] + i
+ || out2[i*12 + 11] != in2[i*12 + 11] + i)
+ abort ();
+ }
+
+ /* Not power of 2 but SLPable. */
+ for (i = 0; i < N/2; i++)
+ {
+ out2[i*12] = in2[i*12] + 1;
+ out2[i*12 + 1] = in2[i*12 + 1] + 2;
+ out2[i*12 + 2] = in2[i*12 + 2] + 3;
+ out2[i*12 + 3] = in2[i*12 + 3] + 4;
+ out2[i*12 + 4] = in2[i*12 + 4] + 5;
+ out2[i*12 + 5] = in2[i*12 + 5] + 6;
+ out2[i*12 + 6] = in2[i*12 + 6] + 7;
+ out2[i*12 + 7] = in2[i*12 + 7] + 8;
+ out2[i*12 + 8] = in2[i*12 + 8] + 9;
+ out2[i*12 + 9] = in2[i*12 + 9] + 10;
+ out2[i*12 + 10] = in2[i*12 + 10] + 11;
+ out2[i*12 + 11] = in2[i*12 + 11] + 12;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out2[i*12] != in2[i*12] + 1
+ || out2[i*12 + 1] != in2[i*12 + 1] + 2
+ || out2[i*12 + 2] != in2[i*12 + 2] + 3
+ || out2[i*12 + 3] != in2[i*12 + 3] + 4
+ || out2[i*12 + 4] != in2[i*12 + 4] + 5
+ || out2[i*12 + 5] != in2[i*12 + 5] + 6
+ || out2[i*12 + 6] != in2[i*12 + 6] + 7
+ || out2[i*12 + 7] != in2[i*12 + 7] + 8
+ || out2[i*12 + 8] != in2[i*12 + 8] + 9
+ || out2[i*12 + 9] != in2[i*12 + 9] + 10
+ || out2[i*12 + 10] != in2[i*12 + 10] + 11
+ || out2[i*12 + 11] != in2[i*12 + 11] + 12)
+ abort ();
+ }
+
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-14.c
new file mode 100644
index 000000000..9e0746b9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-14.c
@@ -0,0 +1,116 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+int
+main1 (int n)
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned short out2[N*16];
+
+ /* Multiple types are now SLPable. */
+ for (i = 0; i < n; i++)
+ {
+ a0 = in[i*8] + 5;
+ a1 = in[i*8 + 1] + 6;
+ a2 = in[i*8 + 2] + 7;
+ a3 = in[i*8 + 3] + 8;
+ a4 = in[i*8 + 4] + 9;
+ a5 = in[i*8 + 5] + 10;
+ a6 = in[i*8 + 6] + 11;
+ a7 = in[i*8 + 7] + 12;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+ b2 = a2 * 12;
+ b3 = a3 * 5;
+ b4 = a4 * 8;
+ b5 = a5 * 4;
+ b6 = a6 * 3;
+ b7 = a7 * 2;
+
+ out[i*8] = b0 - 2;
+ out[i*8 + 1] = b1 - 3;
+ out[i*8 + 2] = b2 - 2;
+ out[i*8 + 3] = b3 - 1;
+ out[i*8 + 4] = b4 - 8;
+ out[i*8 + 5] = b5 - 7;
+ out[i*8 + 6] = b6 - 3;
+ out[i*8 + 7] = b7 - 7;
+
+ out2[i*16] = in2[i*16] + 2;
+ out2[i*16 + 1] = in2[i*16 + 1] + 3;
+ out2[i*16 + 2] = in2[i*16 + 2] + 4;
+ out2[i*16 + 3] = in2[i*16 + 3] + 3;
+ out2[i*16 + 4] = in2[i*16 + 4] + 2;
+ out2[i*16 + 5] = in2[i*16 + 5] + 3;
+ out2[i*16 + 6] = in2[i*16 + 6] + 2;
+ out2[i*16 + 7] = in2[i*16 + 7] + 4;
+ out2[i*16 + 8] = in2[i*16 + 8] + 2;
+ out2[i*16 + 9] = in2[i*16 + 9] + 5;
+ out2[i*16 + 10] = in2[i*16 + 10] + 2;
+ out2[i*16 + 11] = in2[i*16 + 11] + 3;
+ out2[i*16 + 12] = in2[i*16 + 12] + 4;
+ out2[i*16 + 13] = in2[i*16 + 13] + 4;
+ out2[i*16 + 14] = in2[i*16 + 14] + 3;
+ out2[i*16 + 15] = in2[i*16 + 15] + 2;
+}
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (out[i*8] != (in[i*8] + 5) * 3 - 2
+ || out[i*8 + 1] != (in[i*8 + 1] + 6) * 2 - 3
+ || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
+ || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
+ || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
+ || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
+ || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
+ || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7)
+ abort ();
+
+ if (out2[i*16] != in2[i*16] + 2
+ || out2[i*16 + 1] != in2[i*16 + 1] + 3
+ || out2[i*16 + 2] != in2[i*16 + 2] + 4
+ || out2[i*16 + 3] != in2[i*16 + 3] + 3
+ || out2[i*16 + 4] != in2[i*16 + 4] + 2
+ || out2[i*16 + 5] != in2[i*16 + 5] + 3
+ || out2[i*16 + 6] != in2[i*16 + 6] + 2
+ || out2[i*16 + 7] != in2[i*16 + 7] + 4
+ || out2[i*16 + 8] != in2[i*16 + 8] + 2
+ || out2[i*16 + 9] != in2[i*16 + 9] + 5
+ || out2[i*16 + 10] != in2[i*16 + 10] + 2
+ || out2[i*16 + 11] != in2[i*16 + 11] + 3
+ || out2[i*16 + 12] != in2[i*16 + 12] + 4
+ || out2[i*16 + 13] != in2[i*16 + 13] + 4
+ || out2[i*16 + 14] != in2[i*16 + 14] + 3
+ || out2[i*16 + 15] != in2[i*16 + 15] + 2)
+ abort ();
+
+ }
+
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-15.c
new file mode 100644
index 000000000..898538a3d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-15.c
@@ -0,0 +1,118 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int out2[N*16];
+
+int
+main1 (int n)
+{
+ int i;
+ unsigned int a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+
+ for (i = 0; i < n; i++)
+ {
+ a0 = in[i*8] + 5;
+ a1 = in[i*8 + 1] + 6;
+ a2 = in[i*8 + 2] + 7;
+ a3 = in[i*8 + 3] + 8;
+ a4 = in[i*8 + 4] + 9;
+ a5 = in[i*8 + 5] + 10;
+ a6 = in[i*8 + 6] + 11;
+ a7 = in[i*8 + 7] + 12;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+ b2 = a2 * 12;
+ b3 = a3 * 5;
+ b4 = a4 * 8;
+ b5 = a5 * 4;
+ b6 = a6 * 3;
+ b7 = a7 * 2;
+
+ out[i*8] = b0 - 2;
+ out[i*8 + 1] = b1 - 3;
+ out[i*8 + 2] = b2 - 2;
+ out[i*8 + 3] = b3 - 1;
+ out[i*8 + 4] = b4 - 8;
+ out[i*8 + 5] = b5 - 7;
+ out[i*8 + 6] = b6 - 3;
+ out[i*8 + 7] = b7 - 7;
+
+ out2[i*16] = in2[i*16] * 2;
+ out2[i*16 + 1] = in2[i*16 + 1] * 3;
+ out2[i*16 + 2] = in2[i*16 + 2] * 4;
+ out2[i*16 + 3] = in2[i*16 + 3] * 3;
+ out2[i*16 + 4] = in2[i*16 + 4] * 2;
+ out2[i*16 + 5] = in2[i*16 + 5] * 3;
+ out2[i*16 + 6] = in2[i*16 + 6] * 2;
+ out2[i*16 + 7] = in2[i*16 + 7] * 4;
+ out2[i*16 + 8] = in2[i*16 + 8] * 2;
+ out2[i*16 + 9] = in2[i*16 + 9] * 5;
+ out2[i*16 + 10] = in2[i*16 + 10] * 2;
+ out2[i*16 + 11] = in2[i*16 + 11] * 3;
+ out2[i*16 + 12] = in2[i*16 + 12] * 4;
+ out2[i*16 + 13] = in2[i*16 + 13] * 4;
+ out2[i*16 + 14] = in2[i*16 + 14] * 3;
+ out2[i*16 + 15] = in2[i*16 + 15] * 2;
+}
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (out[i*8] != (in[i*8] + 5) * 3 - 2
+ || out[i*8 + 1] != (in[i*8 + 1] + 6) * 2 - 3
+ || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
+ || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
+ || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
+ || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
+ || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
+ || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7)
+ abort ();
+
+ if (out2[i*16] != in2[i*16] * 2
+ || out2[i*16 + 1] != in2[i*16 + 1] * 3
+ || out2[i*16 + 2] != in2[i*16 + 2] * 4
+ || out2[i*16 + 3] != in2[i*16 + 3] * 3
+ || out2[i*16 + 4] != in2[i*16 + 4] * 2
+ || out2[i*16 + 5] != in2[i*16 + 5] * 3
+ || out2[i*16 + 6] != in2[i*16 + 6] * 2
+ || out2[i*16 + 7] != in2[i*16 + 7] * 4
+ || out2[i*16 + 8] != in2[i*16 + 8] * 2
+ || out2[i*16 + 9] != in2[i*16 + 9] * 5
+ || out2[i*16 + 10] != in2[i*16 + 10] * 2
+ || out2[i*16 + 11] != in2[i*16 + 11] * 3
+ || out2[i*16 + 12] != in2[i*16 + 12] * 4
+ || out2[i*16 + 13] != in2[i*16 + 13] * 4
+ || out2[i*16 + 14] != in2[i*16 + 14] * 3
+ || out2[i*16 + 15] != in2[i*16 + 15] * 2)
+ abort ();
+
+ }
+
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { ! { vect_int_mult } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-16.c
new file mode 100644
index 000000000..e5469d46c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-16.c
@@ -0,0 +1,71 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int out[N*8];
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int out2[N*16];
+
+int
+main1 ()
+{
+ int i;
+ unsigned int a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+
+ /* SLP group of size that is not a multiple of vector size.
+ Unrolling by 2. */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*2] + 5;
+ a1 = in[i*2 + 1] + 6;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+
+ out[i*2] = b0 - 2;
+ out[i*2 + 1] = b1 - 3;
+
+ out2[i*6] = in2[i*6] * 2;
+ out2[i*6 + 1] = in2[i*6 + 1] * 3;
+ out2[i*6 + 2] = in2[i*6 + 2] * 4;
+ out2[i*6 + 3] = in2[i*6 + 3] * 2;
+ out2[i*6 + 4] = in2[i*6 + 4] * 4;
+ out2[i*6 + 5] = in2[i*6 + 5] * 3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*2] != (in[i*2] + 5) * 3 - 2
+ || out[i*2 + 1] != (in[i*2 + 1] + 6) * 2 - 3
+ || out2[i*6] != in2[i*6] * 2
+ || out2[i*6 + 1] != in2[i*6 + 1] * 3
+ || out2[i*6 + 2] != in2[i*6 + 2] * 4
+ || out2[i*6 + 3] != in2[i*6 + 3] * 2
+ || out2[i*6 + 4] != in2[i*6 + 4] * 4
+ || out2[i*6 + 5] != in2[i*6 + 5] * 3)
+ abort ();
+ }
+
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_int_mult } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-17.c
new file mode 100644
index 000000000..b76346add
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-17.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned short out[N*8];
+unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short out2[N*8];
+
+int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*2] = in[i*2] + 5;
+ out[i*2 + 1] = in[i*2 + 1] + 6;
+
+ out2[i*4] = in2[i*4] + 2;
+ out2[i*4 + 1] = in2[i*4 + 1] + 2;
+ out2[i*4 + 2] = in2[i*4 + 2] + 1;
+ out2[i*4 + 3] = in2[i*4 + 3] + 3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*2] != in[i*2] + 5
+ || out[i*2 + 1] != in[i*2 + 1] + 6
+ || out2[i*4] != in2[i*4] + 2
+ || out2[i*4 + 1] != in2[i*4 + 1] + 2
+ || out2[i*4 + 2] != in2[i*4 + 2] + 1
+ || out2[i*4 + 3] != in2[i*4 + 3] + 3)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-18.c
new file mode 100644
index 000000000..6cc6fbae3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-18.c
@@ -0,0 +1,97 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ float out2[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+
+ a0 = in[i*8] + 5;
+ a1 = in[i*8 + 1] + 6;
+ a2 = in[i*8 + 2] + 7;
+ a3 = in[i*8 + 3] + 8;
+ a4 = in[i*8 + 4] + 9;
+ a5 = in[i*8 + 5] + 10;
+ a6 = in[i*8 + 6] + 11;
+ a7 = in[i*8 + 7] + 12;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+ b2 = a2 * 12;
+ b3 = a3 * 5;
+ b4 = a4 * 8;
+ b5 = a5 * 4;
+ b6 = a6 * 3;
+ b7 = a7 * 2;
+
+ out[i*8] = b0 - 2;
+ out[i*8 + 1] = b1 - 3;
+ out[i*8 + 2] = b2 - 2;
+ out[i*8 + 3] = b3 - 1;
+ out[i*8 + 4] = b4 - 8;
+ out[i*8 + 5] = b5 - 7;
+ out[i*8 + 6] = b6 - 3;
+ out[i*8 + 7] = b7 - 7;
+
+
+ out2[i*8] = (float) b0;
+ out2[i*8 + 1] = (float) b1;
+ out2[i*8 + 2] = (float) b2;
+ out2[i*8 + 3] = (float) b3;
+ out2[i*8 + 4] = (float) b4;
+ out2[i*8 + 5] = (float) b5;
+ out2[i*8 + 6] = (float) b6;
+ out2[i*8 + 7] = (float) b7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (in[i*8] + 5) * 3 - 2
+ || out[i*8 + 1] != (in[i*8 + 1] + 6) * 2 - 3
+ || out[i*8 + 2] != (in[i*8 + 2] + 7) * 12 - 2
+ || out[i*8 + 3] != (in[i*8 + 3] + 8) * 5 - 1
+ || out[i*8 + 4] != (in[i*8 + 4] + 9) * 8 - 8
+ || out[i*8 + 5] != (in[i*8 + 5] + 10) * 4 - 7
+ || out[i*8 + 6] != (in[i*8 + 6] + 11) * 3 - 3
+ || out[i*8 + 7] != (in[i*8 + 7] + 12) * 2 - 7)
+ abort ();
+
+ if (out2[i*8] != (float) ((in[i*8] + 5) * 3)
+ || out2[i*8 + 1] != (float) ((in[i*8 + 1] + 6) * 2)
+ || out2[i*8 + 2] != (float) ((in[i*8 + 2] + 7) * 12)
+ || out2[i*8 + 3] != (float) ((in[i*8 + 3] + 8) * 5)
+ || out2[i*8 + 4] != (float) ((in[i*8 + 4] + 9) * 8)
+ || out2[i*8 + 5] != (float) ((in[i*8 + 5] + 10) * 4)
+ || out2[i*8 + 6] != (float) ((in[i*8 + 6] + 11) * 3)
+ || out2[i*8 + 7] != (float) ((in[i*8 + 7] + 12) * 2))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19a.c
new file mode 100644
index 000000000..02a4cd008
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19a.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int
+main1 ()
+{
+ unsigned int i;
+ unsigned int out[N*8];
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned int ia[N*2];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8];
+ out[i*8 + 1] = in[i*8 + 1];
+ out[i*8 + 2] = in[i*8 + 2];
+ out[i*8 + 3] = in[i*8 + 3];
+ out[i*8 + 4] = in[i*8 + 4];
+ out[i*8 + 5] = in[i*8 + 5];
+ out[i*8 + 6] = in[i*8 + 6];
+ out[i*8 + 7] = in[i*8 + 7];
+
+ ia[i] = in[i*8 + 2];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8]
+ || out[i*8 + 1] != in[i*8 + 1]
+ || out[i*8 + 2] != in[i*8 + 2]
+ || out[i*8 + 3] != in[i*8 + 3]
+ || out[i*8 + 4] != in[i*8 + 4]
+ || out[i*8 + 5] != in[i*8 + 5]
+ || out[i*8 + 6] != in[i*8 + 6]
+ || out[i*8 + 7] != in[i*8 + 7]
+ || ia[i] != in[i*8 + 2])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_strided8 } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_strided8} } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19b.c
new file mode 100644
index 000000000..1f29a0d2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19b.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int
+main1 ()
+{
+ unsigned int i;
+ unsigned int out[N*8];
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned int ia[N*2], a0, a1, a2, a3;
+
+ for (i = 0; i < N*2; i++)
+ {
+ a0 = in[i*4] + 1;
+ a1 = in[i*4 + 1] + 2;
+ a2 = in[i*4 + 2] + 3;
+ a3 = in[i*4 + 3] + 4;
+
+ out[i*4] = a0;
+ out[i*4 + 1] = a1;
+ out[i*4 + 2] = a2;
+ out[i*4 + 3] = a3;
+
+ ia[i] = a2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != in[i*4] + 1
+ || out[i*4 + 1] != in[i*4 + 1] + 2
+ || out[i*4 + 2] != in[i*4 + 2] + 3
+ || out[i*4 + 3] != in[i*4 + 3] + 4
+ || ia[i] != in[i*4 + 2] + 3)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! vect_strided4 } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! vect_strided4 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19c.c
new file mode 100644
index 000000000..f0df25f53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-19c.c
@@ -0,0 +1,95 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int
+main1 ()
+{
+ unsigned int i;
+ unsigned int out[N*8];
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned int ia[N*2], a0, a1, a2, a3;
+
+ /* The last stmt requires interleaving of not power of 2 size - not
+ vectorizable. */
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*12] = in[i*12];
+ out[i*12 + 1] = in[i*12 + 1];
+ out[i*12 + 2] = in[i*12 + 2];
+ out[i*12 + 3] = in[i*12 + 3];
+ out[i*12 + 4] = in[i*12 + 4];
+ out[i*12 + 5] = in[i*12 + 5];
+ out[i*12 + 6] = in[i*12 + 6];
+ out[i*12 + 7] = in[i*12 + 7];
+ out[i*12 + 8] = in[i*12 + 8];
+ out[i*12 + 9] = in[i*12 + 9];
+ out[i*12 + 10] = in[i*12 + 10];
+ out[i*12 + 11] = in[i*12 + 11];
+
+ ia[i] = in[i*12 + 7];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*12] != in[i*12]
+ || out[i*12 + 1] != in[i*12 + 1]
+ || out[i*12 + 2] != in[i*12 + 2]
+ || out[i*12 + 3] != in[i*12 + 3]
+ || out[i*12 + 4] != in[i*12 + 4]
+ || out[i*12 + 5] != in[i*12 + 5]
+ || out[i*12 + 6] != in[i*12 + 6]
+ || out[i*12 + 7] != in[i*12 + 7]
+ || out[i*12 + 8] != in[i*12 + 8]
+ || out[i*12 + 9] != in[i*12 + 9]
+ || out[i*12 + 10] != in[i*12 + 10]
+ || out[i*12 + 11] != in[i*12 + 11]
+ || ia[i] != in[i*12 + 7])
+ abort ();
+ }
+
+ /* Hybrid SLP with unrolling by 2. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*6] = in[i*6];
+ out[i*6 + 1] = in[i*6 + 1];
+ out[i*6 + 2] = in[i*6 + 2];
+ out[i*6 + 3] = in[i*6 + 3];
+ out[i*6 + 4] = in[i*6 + 4];
+ out[i*6 + 5] = in[i*6 + 5];
+
+ ia[i] = i;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*6] != in[i*6]
+ || out[i*6 + 1] != in[i*6 + 1]
+ || out[i*6 + 2] != in[i*6 + 2]
+ || out[i*6 + 3] != in[i*6 + 3]
+ || out[i*6 + 4] != in[i*6 + 4]
+ || out[i*6 + 5] != in[i*6 + 5]
+ || ia[i] != i)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-2.c
new file mode 100644
index 000000000..69e1ed5e0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-2.c
@@ -0,0 +1,145 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int
+main1 (unsigned short a0, unsigned short a1, unsigned short a2,
+ unsigned short a3, unsigned short a4, unsigned short a5,
+ unsigned short a6, unsigned short a7, unsigned short a8,
+ unsigned short a9, unsigned short a10, unsigned short a11,
+ unsigned short a12, unsigned short a13, unsigned short a14,
+ unsigned short a15)
+{
+ int i;
+ unsigned short out[N*16];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*4] = a8;
+ out[i*4 + 1] = a1;
+ out[i*4 + 2] = a2;
+ out[i*4 + 3] = a3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != a8
+ || out[i*4 + 1] != a1
+ || out[i*4 + 2] != a2
+ || out[i*4 + 3] != a3)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*16] = a8;
+ out[i*16 + 1] = a7;
+ out[i*16 + 2] = a1;
+ out[i*16 + 3] = a2;
+ out[i*16 + 4] = a8;
+ out[i*16 + 5] = a5;
+ out[i*16 + 6] = a5;
+ out[i*16 + 7] = a4;
+ out[i*16 + 8] = a12;
+ out[i*16 + 9] = a13;
+ out[i*16 + 10] = a14;
+ out[i*16 + 11] = a15;
+ out[i*16 + 12] = a6;
+ out[i*16 + 13] = a9;
+ out[i*16 + 14] = a0;
+ out[i*16 + 15] = a7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*16] != a8
+ || out[i*16 + 1] != a7
+ || out[i*16 + 2] != a1
+ || out[i*16 + 3] != a2
+ || out[i*16 + 4] != a8
+ || out[i*16 + 5] != a5
+ || out[i*16 + 6] != a5
+ || out[i*16 + 7] != a4
+ || out[i*16 + 8] != a12
+ || out[i*16 + 9] != a13
+ || out[i*16 + 10] != a14
+ || out[i*16 + 11] != a15
+ || out[i*16 + 12] != a6
+ || out[i*16 + 13] != a9
+ || out[i*16 + 14] != a0
+ || out[i*16 + 15] != a7)
+ abort ();
+ }
+
+ /* SLP with unrolling by 8. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*3] = a8;
+ out[i*3 + 1] = a1;
+ out[i*3 + 2] = a2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*3] != a8
+ || out[i*3 + 1] != a1
+ || out[i*3 + 2] != a2)
+ abort ();
+ }
+
+ /* SLP with unrolling by 8. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*11] = a8;
+ out[i*11 + 1] = a7;
+ out[i*11 + 2] = a1;
+ out[i*11 + 3] = a2;
+ out[i*11 + 4] = a8;
+ out[i*11 + 5] = a5;
+ out[i*11 + 6] = a5;
+ out[i*11 + 7] = a4;
+ out[i*11 + 8] = a12;
+ out[i*11 + 9] = a13;
+ out[i*11 + 10] = a14;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*11] != a8
+ || out[i*11 + 1] != a7
+ || out[i*11 + 2] != a1
+ || out[i*11 + 3] != a2
+ || out[i*11 + 4] != a8
+ || out[i*11 + 5] != a5
+ || out[i*11 + 6] != a5
+ || out[i*11 + 7] != a4
+ || out[i*11 + 8] != a12
+ || out[i*11 + 9] != a13
+ || out[i*11 + 10] != a14)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-20.c
new file mode 100644
index 000000000..5fd85743b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-20.c
@@ -0,0 +1,115 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int
+main1 (unsigned short a0, unsigned short a1, unsigned short a2,
+ unsigned short a3, unsigned short a4, unsigned short a5,
+ unsigned short a6, unsigned short a7, unsigned short a8)
+{
+ int i;
+ unsigned short out[N*8], out2[N*8], b0, b1, b2, b3, b4, b5, b6, b7, b8;
+
+ for (i = 0; i < N; i++)
+ {
+ b0 = a0 + 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 + 5;
+ b4 = a4 + 4;
+ b5 = a5 + 3;
+
+ out[i*4] = b0;
+ out[i*4 + 1] = b1;
+ out[i*4 + 2] = b2;
+ out[i*4 + 3] = b3;
+
+ out2[i*4] = b0;
+ out2[i*4 + 1] = b1;
+ out2[i*4 + 2] = b4;
+ out2[i*4 + 3] = b5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != b0
+ || out[i*4 + 1] != b1
+ || out[i*4 + 2] != b2
+ || out[i*4 + 3] != b3)
+ abort ();
+
+ if (out2[i*4] != b0
+ || out2[i*4 + 1] != b1
+ || out2[i*4 + 2] != b4
+ || out2[i*4 + 3] != b5)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ b0 = a0 + 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 + 5;
+ b4 = a4 + 4;
+ b5 = a5 + 3;
+ b6 = a6 + 2;
+ b7 = a7 + 1;
+ b8 = a8 + 9;
+
+ out[i*4] = b0;
+ out[i*4 + 1] = b1;
+ out[i*4 + 2] = b2;
+ out[i*4 + 3] = b3;
+
+ out2[i*8] = b0;
+ out2[i*8 + 1] = b1;
+ out2[i*8 + 2] = b4;
+ out2[i*8 + 3] = b5;
+ out2[i*8 + 4] = b6;
+ out2[i*8 + 5] = b2;
+ out2[i*8 + 6] = b7;
+ out2[i*8 + 7] = b8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != b0
+ || out[i*4 + 1] != b1
+ || out[i*4 + 2] != b2
+ || out[i*4 + 3] != b3)
+ abort ();
+
+ if (out2[i*8] != b0
+ || out2[i*8 + 1] != b1
+ || out2[i*8 + 2] != b4
+ || out2[i*8 + 3] != b5
+ || out2[i*8 + 4] != b6
+ || out2[i*8 + 5] != b2
+ || out2[i*8 + 6] != b7
+ || out2[i*8 + 7] != b8)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (8,7,6,5,4,3,2,1,0);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-21.c
new file mode 100644
index 000000000..39146b8fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-21.c
@@ -0,0 +1,207 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int
+main1 ()
+{
+ unsigned short i;
+ unsigned short out[N*8], out2[N*8], b0, b1, b2, b3, b4, a0, a1, a2, a3, b5;
+ unsigned short in[N*8];
+
+ for (i = 0; i < N*8; i++)
+ {
+ in[i] = i;
+ }
+
+ /* Different operations in both cases - vectorization with interleaving. */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*4];
+ a1 = in[i*4 + 1];
+ a2 = in[i*4 + 2];
+ a3 = in[i*4 + 3];
+
+ b0 = a0 * 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 * 5;
+
+ b4 = a2 + 4;
+ b5 = a3 + 3;
+
+ out[i*4] = b0;
+ out[i*4 + 1] = b1;
+ out[i*4 + 2] = b2;
+ out[i*4 + 3] = b3;
+
+ out2[i*4] = b0;
+ out2[i*4 + 1] = b1;
+ out2[i*4 + 2] = b4;
+ out2[i*4 + 3] = b5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*4];
+ a1 = in[i*4 + 1];
+ a2 = in[i*4 + 2];
+ a3 = in[i*4 + 3];
+
+ b0 = a0 * 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 * 5;
+
+ b4 = a2 + 4;
+ b5 = a3 + 3;
+
+ if (out[i*4] != b0
+ || out[i*4 + 1] != b1
+ || out[i*4 + 2] != b2
+ || out[i*4 + 3] != b3)
+ abort ();
+
+ if (out2[i*4] != b0
+ || out2[i*4 + 1] != b1
+ || out2[i*4 + 2] != b4
+ || out2[i*4 + 3] != b5)
+ abort ();
+ }
+
+ /* Different operations in the first case - vectorization with interleaving. */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*4];
+ a1 = in[i*4 + 1];
+ a2 = in[i*4 + 2];
+ a3 = in[i*4 + 3];
+
+ b0 = a0 + 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 * 5;
+
+ b4 = a2 + 4;
+ b5 = a3 + 3;
+
+ out[i*4] = b0;
+ out[i*4 + 1] = b1;
+ out[i*4 + 2] = b2;
+ out[i*4 + 3] = b3;
+
+ out2[i*4] = b0;
+ out2[i*4 + 1] = b1;
+ out2[i*4 + 2] = b4;
+ out2[i*4 + 3] = b5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*4];
+ a1 = in[i*4 + 1];
+ a2 = in[i*4 + 2];
+ a3 = in[i*4 + 3];
+
+ b0 = a0 + 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 * 5;
+
+ b4 = a2 + 4;
+ b5 = a3 + 3;
+
+ if (out[i*4] != b0
+ || out[i*4 + 1] != b1
+ || out[i*4 + 2] != b2
+ || out[i*4 + 3] != b3)
+ abort ();
+
+ if (out2[i*4] != b0
+ || out2[i*4 + 1] != b1
+ || out2[i*4 + 2] != b4
+ || out2[i*4 + 3] != b5)
+ abort ();
+ }
+
+
+ /* Different operations in the second case - vectorization with interleaving. */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*4];
+ a1 = in[i*4 + 1];
+ a2 = in[i*4 + 2];
+ a3 = in[i*4 + 3];
+
+ b0 = a0 + 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 + 5;
+
+ b4 = a2 * 4;
+ b5 = a3 + 3;
+
+ out[i*4] = b0;
+ out[i*4 + 1] = b1;
+ out[i*4 + 2] = b2;
+ out[i*4 + 3] = b3;
+
+ out2[i*4] = b0;
+ out2[i*4 + 1] = b1;
+ out2[i*4 + 2] = b4;
+ out2[i*4 + 3] = b5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*4];
+ a1 = in[i*4 + 1];
+ a2 = in[i*4 + 2];
+ a3 = in[i*4 + 3];
+
+ b0 = a0 + 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 + 5;
+
+ b4 = a2 * 4;
+ b5 = a3 + 3;
+
+ if (out[i*4] != b0
+ || out[i*4 + 1] != b1
+ || out[i*4 + 2] != b2
+ || out[i*4 + 3] != b3)
+ abort ();
+
+ if (out2[i*4] != b0
+ || out2[i*4 + 1] != b1
+ || out2[i*4 + 2] != b4
+ || out2[i*4 + 3] != b5)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target { vect_strided4 || vect_extract_even_odd } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided4 || vect_extract_even_odd } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_strided4 } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided4 } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-22.c
new file mode 100644
index 000000000..3f6692816
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-22.c
@@ -0,0 +1,134 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int
+main1 (unsigned short a0, unsigned short a1, unsigned short a2,
+ unsigned short a3, unsigned short a4, unsigned short a5,
+ unsigned short a6, unsigned short a7, unsigned short a8)
+{
+ int i;
+ unsigned short out[N*8], out2[N*8], out3[N*8], b0, b1, b2, b3, b4, b5, b6, b7, b8;
+
+ for (i = 0; i < N; i++)
+ {
+ b0 = a0 + 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 + 5;
+ b4 = a4 + 4;
+ b5 = a5 + 3;
+
+ out[i*4] = b0;
+ out[i*4 + 1] = b1;
+ out[i*4 + 2] = b2;
+ out[i*4 + 3] = b3;
+
+ out2[i*4] = b0;
+ out2[i*4 + 1] = b1;
+ out2[i*4 + 2] = b4;
+ out2[i*4 + 3] = b5;
+
+ out3[i*4] = b2;
+ out3[i*4 + 1] = b1;
+ out3[i*4 + 2] = b4;
+ out3[i*4 + 3] = b5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != b0
+ || out[i*4 + 1] != b1
+ || out[i*4 + 2] != b2
+ || out[i*4 + 3] != b3)
+ abort ();
+
+
+ if (out2[i*4] != b0
+ || out2[i*4 + 1] != b1
+ || out2[i*4 + 2] != b4
+ || out2[i*4 + 3] != b5)
+ abort ();
+
+ if (out3[i*4] != b2
+ || out3[i*4 + 1] != b1
+ || out3[i*4 + 2] != b4
+ || out3[i*4 + 3] != b5)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ b0 = a0 + 8;
+ b1 = a1 + 7;
+ b2 = a2 + 6;
+ b3 = a3 + 5;
+ b4 = a4 + 4;
+ b5 = a5 + 3;
+ b6 = a6 + 2;
+ b7 = a7 + 1;
+ b8 = a8 + 9;
+
+ out[i*4] = b0;
+ out[i*4 + 1] = b1;
+ out[i*4 + 2] = b2;
+ out[i*4 + 3] = b3;
+
+ out2[i*8] = b0;
+ out2[i*8 + 1] = b1;
+ out2[i*8 + 2] = b4;
+ out2[i*8 + 3] = b5;
+ out2[i*8 + 4] = b6;
+ out2[i*8 + 5] = b2;
+ out2[i*8 + 6] = b7;
+ out2[i*8 + 7] = b8;
+
+ out3[2*i + 1] = a0;
+ out3[2*i] = b8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != b0
+ || out[i*4 + 1] != b1
+ || out[i*4 + 2] != b2
+ || out[i*4 + 3] != b3)
+ abort ();
+
+ if (out2[i*8] != b0
+ || out2[i*8 + 1] != b1
+ || out2[i*8 + 2] != b4
+ || out2[i*8 + 3] != b5
+ || out2[i*8 + 4] != b6
+ || out2[i*8 + 5] != b2
+ || out2[i*8 + 6] != b7
+ || out2[i*8 + 7] != b8)
+ abort ();
+
+ if (out3[2*i] != b8
+ || out3[2*i+1] != a0)
+ abort();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (8,7,6,5,4,3,2,1,0);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 6 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-23.c
new file mode 100644
index 000000000..5a04c900e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-23.c
@@ -0,0 +1,113 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ int a;
+ int b;
+ int c;
+ int d;
+ int e;
+ int f;
+ int g;
+ int h;
+} s;
+
+int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->c + ptr->c;
+ res[i].a = ptr->a + ptr->a;
+ res[i].d = ptr->d + ptr->d;
+ res[i].b = ptr->b + ptr->b;
+ res[i].f = ptr->f + ptr->f;
+ res[i].e = ptr->e + ptr->e;
+ res[i].h = ptr->h + ptr->h;
+ res[i].g = ptr->g + ptr->g;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].c + arr[i].c
+ || res[i].a != arr[i].a + arr[i].a
+ || res[i].d != arr[i].d + arr[i].d
+ || res[i].b != arr[i].b + arr[i].b
+ || res[i].f != arr[i].f + arr[i].f
+ || res[i].e != arr[i].e + arr[i].e
+ || res[i].h != arr[i].h + arr[i].h
+ || res[i].g != arr[i].g + arr[i].g)
+ abort();
+ }
+
+ ptr = arr;
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->c + ptr->c;
+ res[i].a = ptr->a + ptr->a;
+ res[i].d = ptr->d + ptr->d;
+ res[i].b = ptr->b + ptr->b;
+ res[i].f = ptr->f + ptr->f;
+ res[i].e = ptr->e + ptr->e;
+ res[i].h = ptr->e + ptr->e;
+ res[i].g = ptr->g + ptr->g;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].c + arr[i].c
+ || res[i].a != arr[i].a + arr[i].a
+ || res[i].d != arr[i].d + arr[i].d
+ || res[i].b != arr[i].b + arr[i].b
+ || res[i].f != arr[i].f + arr[i].f
+ || res[i].e != arr[i].e + arr[i].e
+ || res[i].h != arr[i].e + arr[i].e
+ || res[i].g != arr[i].g + arr[i].g)
+ abort();
+ }
+
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ arr[i].f = i * 5;
+ arr[i].g = i - 3;
+ arr[i].h = 56;
+ if (arr[i].a == 178)
+ abort();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided8 && { ! { vect_no_align} } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided8 || vect_no_align } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-24-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-24-big-array.c
new file mode 100644
index 000000000..10b31aaac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-24-big-array.c
@@ -0,0 +1,99 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+} s;
+
+unsigned char ub[N*2];
+unsigned char uc[N];
+
+volatile int y = 0;
+unsigned char check_diff = 2;
+
+void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result, s *arr)
+{
+ int i;
+ unsigned char udiff = 2;
+ unsigned char umax = x;
+ unsigned char umin = x;
+ unsigned char ua1[N*2];
+ s *pIn = arr;
+ s out[N];
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned char) (ub[i] - uc[i]);
+
+ ua1[2*i+1] = ub[2*i+1];
+ ua1[2*i] = ub[2*i];
+
+ out[i].d = pIn->d - 1;
+ out[i].b = pIn->b - 4;
+ out[i].c = pIn->c - 8;
+ out[i].a = pIn->a - 3;
+
+ pIn++;
+ }
+
+ for (i = 0; i < N; i++) {
+ if (ua1[2*i] != ub[2*i]
+ || ua1[2*i+1] != ub[2*i+1]
+ || out[i].a != arr[i].a - 3
+ || out[i].b != arr[i].b - 4
+ || out[i].c != arr[i].c - 8
+ || out[i].d != arr[i].d - 1)
+ abort ();
+ }
+
+ /* check results: */
+ if (udiff != check_diff)
+ abort ();
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_diff = 2;
+ ub[0] = uc[0] = 1;
+ for (i = 1; i < N; i++) {
+ ub[i] = (i%5 == 0)?i*3:i;
+ uc[i] = i;
+ check_diff += (unsigned char) (ub[i] - uc[i]);
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+ for (; i < 2*N; i++) {
+ ub[i] = 0;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i + 9;
+ arr[i].b = i * 2 + 10;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+ check_vect ();
+
+ main1 (100, 100, 1, arr);
+ main1 (0, 15, 0, arr);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && ilp32 } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { vect_no_align && ilp32 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-24.c
new file mode 100644
index 000000000..eca66bfb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-24.c
@@ -0,0 +1,84 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+} s;
+
+unsigned char ub[N*2] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+volatile int y = 0;
+
+void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result, s *arr)
+{
+ int i;
+ unsigned char udiff = 2;
+ unsigned char umax = x;
+ unsigned char umin = x;
+ unsigned char ua1[N*2];
+ s *pIn = arr;
+ s out[N];
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned char)(ub[i] - uc[i]);
+
+ ua1[2*i+1] = ub[2*i+1];
+ ua1[2*i] = ub[2*i];
+
+ out[i].d = pIn->d - 1;
+ out[i].b = pIn->b - 4;
+ out[i].c = pIn->c - 8;
+ out[i].a = pIn->a - 3;
+
+ pIn++;
+ }
+
+ for (i = 0; i < N; i++) {
+ if (ua1[2*i] != ub[2*i]
+ || ua1[2*i+1] != ub[2*i+1]
+ || out[i].a != arr[i].a - 3
+ || out[i].b != arr[i].b - 4
+ || out[i].c != arr[i].c - 8
+ || out[i].d != arr[i].d - 1)
+ abort();
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i + 9;
+ arr[i].b = i * 2 + 10;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+ check_vect ();
+
+ main1 (100, 100, 1, arr);
+ main1 (0, 15, 0, arr);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && ilp32 } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { vect_no_align && ilp32 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-25.c
new file mode 100644
index 000000000..e5e5e3bdf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-25.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+/* Unaligned stores. */
+
+int ia[N+2];
+short sa[N+2];
+
+int main1 (int n)
+{
+ int i;
+
+ for (i = 1; i <= N/2; i++)
+ {
+ ia[2*i] = 25;
+ ia[2*i + 1] = 5;
+ }
+
+ /* check results: */
+ for (i = 1; i <= N/2; i++)
+ {
+ if (ia[2*i] != 25
+ || ia[2*i + 1] != 5)
+ abort ();
+ }
+
+ for (i = 1; i <= n/2; i++)
+ {
+ sa[2*i] = 25;
+ sa[2*i + 1] = 5;
+ }
+
+ /* check results: */
+ for (i = 1; i <= n/2; i++)
+ {
+ if (sa[2*i] != 25
+ || sa[2*i + 1] != 5)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+
+ check_vect ();
+
+ return main1 (N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || { ! vect_natural_alignment } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-26.c
new file mode 100644
index 000000000..09a1ecd9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-26.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned short out[N*8], a[N], b[N] = {3,0x8031,0x7fff,0x8032,0xffff,0,0x8030,0x8000};
+
+ /* Partial SLP is not supported. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*4] = in[i*4];
+ out[i*4 + 1] = in[i*4 + 1];
+ out[i*4 + 2] = in[i*4 + 2];
+ out[i*4 + 3] = in[i*4 + 3];
+
+ a[i] = b[i] / 0x8031;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*4] != in[i*4]
+ || out[i*4 + 1] != in[i*4 + 1]
+ || out[i*4 + 2] != in[i*4 + 2]
+ || out[i*4 + 3] != in[i*4 + 3]
+ || a[i] != b[i] / 0x8031)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-28.c
new file mode 100644
index 000000000..41c482709
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-28.c
@@ -0,0 +1,86 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+unsigned short in2[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+unsigned short in3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+unsigned short check[N] = {0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,35,36,37,38};
+unsigned short check3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,10,11,12,13,14,15,16,17};
+
+int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < N/4; i++)
+ {
+ in[i*4] = in[i*4] + 5;
+ in[i*4 + 1] = in[i*4 + 1] + 5;
+ in[i*4 + 2] = in[i*4 + 2] + 5;
+ in[i*4 + 3] = in[i*4 + 3] + 5;
+
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (in[i] != i+5)
+ abort ();
+ }
+
+ /* Not vectorizable because of data dependencies. */
+ for (i = 1; i < N/4; i++)
+ {
+ in2[i*4] = in2[(i-1)*4] + 5;
+ in2[i*4 + 1] = in2[(i-1)*4 + 1] + 5;
+ in2[i*4 + 2] = in2[(i-1)*4 + 2] + 5;
+ in2[i*4 + 3] = in2[(i-1)*4 + 3] + 5;
+
+ }
+
+ /* check results: */
+ for (i = 4; i < N; i++)
+ {
+ if (in2[i] != check[i])
+ abort ();
+ }
+
+ /* Not vectorizable because of data dependencies: distance 3 is greater than
+ the actual VF with SLP (2), but the analysis fail to detect that for now. */
+ for (i = 3; i < N/4; i++)
+ {
+ in3[i*4] = in3[(i-3)*4] + 5;
+ in3[i*4 + 1] = in3[(i-3)*4 + 1] + 5;
+ in3[i*4 + 2] = in3[(i-3)*4 + 2] + 5;
+ in3[i*4 + 3] = in3[(i-3)*4 + 3] + 5;
+
+ }
+
+ /* check results: */
+ for (i = 12; i < N; i++)
+ {
+ if (in3[i] != check3[i])
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-3-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-3-big-array.c
new file mode 100644
index 000000000..4f50f1f90
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-3-big-array.c
@@ -0,0 +1,155 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 96
+
+unsigned short in[N*8];
+volatile int y = 0;
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+
+ for (i = 0; i < N*8; i++)
+ {
+ in[i] = i&63;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8];
+ out[i*8 + 1] = in[i*8 + 1];
+ out[i*8 + 2] = in[i*8 + 2];
+ out[i*8 + 3] = in[i*8 + 3];
+ out[i*8 + 4] = in[i*8 + 4];
+ out[i*8 + 5] = in[i*8 + 5];
+ out[i*8 + 6] = in[i*8 + 6];
+ out[i*8 + 7] = in[i*8 + 7];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8]
+ || out[i*8 + 1] != in[i*8 + 1]
+ || out[i*8 + 2] != in[i*8 + 2]
+ || out[i*8 + 3] != in[i*8 + 3]
+ || out[i*8 + 4] != in[i*8 + 4]
+ || out[i*8 + 5] != in[i*8 + 5]
+ || out[i*8 + 6] != in[i*8 + 6]
+ || out[i*8 + 7] != in[i*8 + 7])
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = in[i*4];
+ out[i*4 + 1] = in[i*4 + 1];
+ out[i*4 + 2] = in[i*4 + 2];
+ out[i*4 + 3] = in[i*4 + 3];
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != in[i*4]
+ || out[i*4 + 1] != in[i*4 + 1]
+ || out[i*4 + 2] != in[i*4 + 2]
+ || out[i*4 + 3] != in[i*4 + 3])
+ abort ();
+ }
+
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*16] = in[i*16];
+ out[i*16 + 1] = in[i*16 + 1];
+ out[i*16 + 2] = in[i*16 + 2];
+ out[i*16 + 3] = in[i*16 + 3];
+ out[i*16 + 4] = in[i*16 + 4];
+ out[i*16 + 5] = in[i*16 + 5];
+ out[i*16 + 6] = in[i*16 + 6];
+ out[i*16 + 7] = in[i*16 + 7];
+ out[i*16 + 8] = in[i*16 + 8];
+ out[i*16 + 9] = in[i*16 + 9];
+ out[i*16 + 10] = in[i*16 + 10];
+ out[i*16 + 11] = in[i*16 + 11];
+ out[i*16 + 12] = in[i*16 + 12];
+ out[i*16 + 13] = in[i*16 + 13];
+ out[i*16 + 14] = in[i*16 + 14];
+ out[i*16 + 15] = in[i*16 + 15];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*16] != in[i*16]
+ || out[i*16 + 1] != in[i*16 + 1]
+ || out[i*16 + 2] != in[i*16 + 2]
+ || out[i*16 + 3] != in[i*16 + 3]
+ || out[i*16 + 4] != in[i*16 + 4]
+ || out[i*16 + 5] != in[i*16 + 5]
+ || out[i*16 + 6] != in[i*16 + 6]
+ || out[i*16 + 7] != in[i*16 + 7]
+ || out[i*16 + 8] != in[i*16 + 8]
+ || out[i*16 + 9] != in[i*16 + 9]
+ || out[i*16 + 10] != in[i*16 + 10]
+ || out[i*16 + 11] != in[i*16 + 11]
+ || out[i*16 + 12] != in[i*16 + 12]
+ || out[i*16 + 13] != in[i*16 + 13]
+ || out[i*16 + 14] != in[i*16 + 14]
+ || out[i*16 + 15] != in[i*16 + 15])
+ abort ();
+ }
+
+ /* SLP with unrolling by 8. */
+ for (i = 0; i < N/4; i++)
+ {
+ out[i*9] = in[i*9];
+ out[i*9 + 1] = in[i*9 + 1];
+ out[i*9 + 2] = in[i*9 + 2];
+ out[i*9 + 3] = in[i*9 + 3];
+ out[i*9 + 4] = in[i*9 + 4];
+ out[i*9 + 5] = in[i*9 + 5];
+ out[i*9 + 6] = in[i*9 + 6];
+ out[i*9 + 7] = in[i*9 + 7];
+ out[i*9 + 8] = in[i*9 + 8];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/4; i++)
+ {
+ if (out[i*9] != in[i*9]
+ || out[i*9 + 1] != in[i*9 + 1]
+ || out[i*9 + 2] != in[i*9 + 2]
+ || out[i*9 + 3] != in[i*9 + 3]
+ || out[i*9 + 4] != in[i*9 + 4]
+ || out[i*9 + 5] != in[i*9 + 5]
+ || out[i*9 + 6] != in[i*9 + 6]
+ || out[i*9 + 7] != in[i*9 + 7]
+ || out[i*9 + 8] != in[i*9 + 8])
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-3.c
new file mode 100644
index 000000000..7d9bd5637
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-3.c
@@ -0,0 +1,147 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 12
+
+unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8];
+ out[i*8 + 1] = in[i*8 + 1];
+ out[i*8 + 2] = in[i*8 + 2];
+ out[i*8 + 3] = in[i*8 + 3];
+ out[i*8 + 4] = in[i*8 + 4];
+ out[i*8 + 5] = in[i*8 + 5];
+ out[i*8 + 6] = in[i*8 + 6];
+ out[i*8 + 7] = in[i*8 + 7];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8]
+ || out[i*8 + 1] != in[i*8 + 1]
+ || out[i*8 + 2] != in[i*8 + 2]
+ || out[i*8 + 3] != in[i*8 + 3]
+ || out[i*8 + 4] != in[i*8 + 4]
+ || out[i*8 + 5] != in[i*8 + 5]
+ || out[i*8 + 6] != in[i*8 + 6]
+ || out[i*8 + 7] != in[i*8 + 7])
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = in[i*4];
+ out[i*4 + 1] = in[i*4 + 1];
+ out[i*4 + 2] = in[i*4 + 2];
+ out[i*4 + 3] = in[i*4 + 3];
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != in[i*4]
+ || out[i*4 + 1] != in[i*4 + 1]
+ || out[i*4 + 2] != in[i*4 + 2]
+ || out[i*4 + 3] != in[i*4 + 3])
+ abort ();
+ }
+
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*16] = in[i*16];
+ out[i*16 + 1] = in[i*16 + 1];
+ out[i*16 + 2] = in[i*16 + 2];
+ out[i*16 + 3] = in[i*16 + 3];
+ out[i*16 + 4] = in[i*16 + 4];
+ out[i*16 + 5] = in[i*16 + 5];
+ out[i*16 + 6] = in[i*16 + 6];
+ out[i*16 + 7] = in[i*16 + 7];
+ out[i*16 + 8] = in[i*16 + 8];
+ out[i*16 + 9] = in[i*16 + 9];
+ out[i*16 + 10] = in[i*16 + 10];
+ out[i*16 + 11] = in[i*16 + 11];
+ out[i*16 + 12] = in[i*16 + 12];
+ out[i*16 + 13] = in[i*16 + 13];
+ out[i*16 + 14] = in[i*16 + 14];
+ out[i*16 + 15] = in[i*16 + 15];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*16] != in[i*16]
+ || out[i*16 + 1] != in[i*16 + 1]
+ || out[i*16 + 2] != in[i*16 + 2]
+ || out[i*16 + 3] != in[i*16 + 3]
+ || out[i*16 + 4] != in[i*16 + 4]
+ || out[i*16 + 5] != in[i*16 + 5]
+ || out[i*16 + 6] != in[i*16 + 6]
+ || out[i*16 + 7] != in[i*16 + 7]
+ || out[i*16 + 8] != in[i*16 + 8]
+ || out[i*16 + 9] != in[i*16 + 9]
+ || out[i*16 + 10] != in[i*16 + 10]
+ || out[i*16 + 11] != in[i*16 + 11]
+ || out[i*16 + 12] != in[i*16 + 12]
+ || out[i*16 + 13] != in[i*16 + 13]
+ || out[i*16 + 14] != in[i*16 + 14]
+ || out[i*16 + 15] != in[i*16 + 15])
+ abort ();
+ }
+
+ /* SLP with unrolling by 8. */
+ for (i = 0; i < N/4; i++)
+ {
+ out[i*9] = in[i*9];
+ out[i*9 + 1] = in[i*9 + 1];
+ out[i*9 + 2] = in[i*9 + 2];
+ out[i*9 + 3] = in[i*9 + 3];
+ out[i*9 + 4] = in[i*9 + 4];
+ out[i*9 + 5] = in[i*9 + 5];
+ out[i*9 + 6] = in[i*9 + 6];
+ out[i*9 + 7] = in[i*9 + 7];
+ out[i*9 + 8] = in[i*9 + 8];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/4; i++)
+ {
+ if (out[i*9] != in[i*9]
+ || out[i*9 + 1] != in[i*9 + 1]
+ || out[i*9 + 2] != in[i*9 + 2]
+ || out[i*9 + 3] != in[i*9 + 3]
+ || out[i*9 + 4] != in[i*9 + 4]
+ || out[i*9 + 5] != in[i*9 + 5]
+ || out[i*9 + 6] != in[i*9 + 6]
+ || out[i*9 + 7] != in[i*9 + 7]
+ || out[i*9 + 8] != in[i*9 + 8])
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-33.c
new file mode 100644
index 000000000..4b67d894e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-33.c
@@ -0,0 +1,111 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7;
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ float out2[N*8];
+
+ /* SLP with unrolling by 4. */
+ for (i = 0; i < N; i++)
+ {
+ a0 = in[i*7] + 5;
+ a1 = in[i*7 + 1] + 6;
+ a2 = in[i*7 + 2] + 7;
+ a3 = in[i*7 + 3] + 8;
+ a4 = in[i*7 + 4] + 9;
+ a5 = in[i*7 + 5] + 10;
+ a6 = in[i*7 + 6] + 11;
+
+ b0 = a0 * 3;
+ b1 = a1 * 2;
+ b2 = a2 * 12;
+ b3 = a3 * 5;
+ b4 = a4 * 8;
+ b5 = a5 * 4;
+ b6 = a6 * 3;
+
+ out[i*7] = b0 - 2;
+ out[i*7 + 1] = b1 - 3;
+ out[i*7 + 2] = b2 - 2;
+ out[i*7 + 3] = b3 - 1;
+ out[i*7 + 4] = b4 - 8;
+ out[i*7 + 5] = b5 - 7;
+ out[i*7 + 6] = b6 - 3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*7] != (in[i*7] + 5) * 3 - 2
+ || out[i*7 + 1] != (in[i*7 + 1] + 6) * 2 - 3
+ || out[i*7 + 2] != (in[i*7 + 2] + 7) * 12 - 2
+ || out[i*7 + 3] != (in[i*7 + 3] + 8) * 5 - 1
+ || out[i*7 + 4] != (in[i*7 + 4] + 9) * 8 - 8
+ || out[i*7 + 5] != (in[i*7 + 5] + 10) * 4 - 7
+ || out[i*7 + 6] != (in[i*7 + 6] + 11) * 3 - 3)
+ abort ();
+ }
+
+ /* SLP with unrolling by 4. */
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*3] = (in[i*3] + 2) * 3;
+ out[i*3 + 1] = (in[i*3 + 1] + 2) * 7;
+ out[i*3 + 2] = (in[i*3 + 2] + 7) * 3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*3] != (in[i*3] + 2) * 3
+ || out[i*3 + 1] != (in[i*3 + 1] + 2) * 7
+ || out[i*3 + 2] != (in[i*3 + 2] + 7) * 3)
+ abort ();
+ }
+
+ /* SLP with unrolling by 4. */
+ for (i = 0; i < N*2; i++)
+ {
+ out2[i*3] = (float) (in[i*3] * 2 + 5) ;
+ out2[i*3 + 1] = (float) (in[i*3 + 1] * 3 + 7);
+ out2[i*3 + 2] = (float) (in[i*3 + 2] * 5 + 4);
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out2[i*3] != (float) (in[i*3] * 2 + 5)
+ || out2[i*3 + 1] != (float) (in[i*3 + 1] * 3 + 7)
+ || out2[i*3 + 2] != (float) (in[i*3 + 2] * 5 + 4))
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target {vect_uintfloat_cvt && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" {target {{! { vect_uintfloat_cvt}} && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target {{! { vect_uintfloat_cvt}} && {! {vect_int_mult}}} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target {vect_uintfloat_cvt && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target {{! { vect_uintfloat_cvt}} && vect_int_mult} } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target {{! { vect_uintfloat_cvt}} && {! {vect_int_mult}}} } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-34-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-34-big-array.c
new file mode 100644
index 000000000..53da79ee7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-34-big-array.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned short in[N*8];
+unsigned short in2[N*8];
+volatile int y = 0;
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+ unsigned short out2[N*8];
+
+ for (i = 0; i < N*8; i++)
+ {
+ in[i] = in2[i] = i;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ /* SLP with unrolling by 8. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*3] = in[i*3] + 5;
+ out[i*3 + 1] = in[i*3 + 1] + 6;
+ out[i*3 + 2] = in[i*3 + 2] + 16;
+
+ out2[i*5] = in2[i*5] + 2;
+ out2[i*5 + 1] = in2[i*5 + 1] + 2;
+ out2[i*5 + 2] = in2[i*5 + 2] + 1;
+ out2[i*5 + 3] = in2[i*5 + 3] + 3;
+ out2[i*5 + 4] = in2[i*5 + 4] + 13;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*3] != in[i*3] + 5
+ || out[i*3 + 1] != in[i*3 + 1] + 6
+ || out[i*3 + 2] != in[i*3 + 2] + 16
+ || out2[i*5] != in2[i*5] + 2
+ || out2[i*5 + 1] != in2[i*5 + 1] + 2
+ || out2[i*5 + 2] != in2[i*5 + 2] + 1
+ || out2[i*5 + 3] != in2[i*5 + 3] + 3
+ || out2[i*5 + 4] != in2[i*5 + 4] + 13)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-34.c
new file mode 100644
index 000000000..63dbab051
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-34.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+ unsigned short out2[N*8];
+
+ /* SLP with unrolling by 8. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*3] = in[i*3] + 5;
+ out[i*3 + 1] = in[i*3 + 1] + 6;
+ out[i*3 + 2] = in[i*3 + 2] + 16;
+
+ out2[i*5] = in2[i*5] + 2;
+ out2[i*5 + 1] = in2[i*5 + 1] + 2;
+ out2[i*5 + 2] = in2[i*5 + 2] + 1;
+ out2[i*5 + 3] = in2[i*5 + 3] + 3;
+ out2[i*5 + 4] = in2[i*5 + 4] + 13;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*3] != in[i*3] + 5
+ || out[i*3 + 1] != in[i*3 + 1] + 6
+ || out[i*3 + 2] != in[i*3 + 2] + 16
+ || out2[i*5] != in2[i*5] + 2
+ || out2[i*5 + 1] != in2[i*5 + 1] + 2
+ || out2[i*5 + 2] != in2[i*5 + 2] + 1
+ || out2[i*5 + 3] != in2[i*5 + 3] + 3
+ || out2[i*5 + 4] != in2[i*5 + 4] + 13)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-35.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-35.c
new file mode 100644
index 000000000..f75691431
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-35.c
@@ -0,0 +1,73 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ int a;
+ int b;
+ int c;
+ int d;
+ int e;
+} s;
+
+int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+
+ /* SLP with unrolling by 4. */
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->c + ptr->c;
+ res[i].a = ptr->a + ptr->a;
+ res[i].d = ptr->d + ptr->d;
+ res[i].b = ptr->b + ptr->b;
+ res[i].e = ptr->e + ptr->e;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].c + arr[i].c
+ || res[i].a != arr[i].a + arr[i].a
+ || res[i].d != arr[i].d + arr[i].d
+ || res[i].b != arr[i].b + arr[i].b
+ || res[i].e != arr[i].e + arr[i].e)
+ abort();
+ }
+
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ if (arr[i].a == 178)
+ abort();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-36.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-36.c
new file mode 100644
index 000000000..8480c4a05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-36.c
@@ -0,0 +1,76 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#define N 32
+
+/* All the loops are vectorizable on platforms with vector shift argument. */
+
+void
+test_1 (void)
+{
+ static unsigned int bm[N];
+ static unsigned int cm[N];
+ int j;
+
+ /* Vectorizable on platforms with scalar shift argument. */
+ for (j = 0; j < N/2; j++)
+ {
+ bm[2*j] <<= 8;
+ bm[2*j+1] <<= 8;
+ }
+
+ /* Not vectorizable on platforms with scalar shift argument. */
+ for (j = 0; j < N/2; j++)
+ {
+ cm[2*j] <<= 8;
+ cm[2*j+1] <<= 7;
+ }
+}
+
+void
+test_2 (int a, int b)
+{
+ static unsigned int bm[N];
+ static unsigned int cm[N];
+ int j;
+
+ /* Vectorizable on platforms with scalar shift argument. */
+ for (j = 0; j < N/2; j++)
+ {
+ bm[2*j] <<= a;
+ bm[2*j+1] <<= a;
+ }
+
+ /* Not vectorizable on platforms with scalar shift argument. */
+ for (j = 0; j < N/2; j++)
+ {
+ cm[2*j] <<= a;
+ cm[2*j+1] <<= b;
+ }
+}
+
+void
+test_3 (void)
+{
+ static unsigned int bm[N];
+ int am[N];
+ int j;
+
+ /* Not vectorizable on platforms with scalar shift argument. */
+ for (j = 0; j < N/2; j++)
+ {
+ bm[2*j] <<= am[j];
+ bm[2*j+1] <<= am[j];
+ }
+
+ /* Not vectorizable on platforms with scalar shift argument. */
+ for (j = 0; j < N/2; j++)
+ {
+ bm[2*j] <<= am[2*j];
+ bm[2*j+1] <<= am[2*j+1];
+ }
+
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-37.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-37.c
new file mode 100644
index 000000000..48642db96
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-37.c
@@ -0,0 +1,67 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ int a;
+ int b;
+ void *c;
+} s1;
+
+int
+foo1 (s1 *arr)
+{
+ int i;
+ s1 *ptr = arr;
+
+ /* Different constant types - not SLPable. The group size is not power of 2,
+ interleaving is not supported either. */
+ for (i = 0; i < N; i++)
+ {
+ ptr->a = 6;
+ ptr->b = 7;
+ ptr->c = NULL;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr[i].a != 6
+ || arr[i].b != 7
+ || arr[i].c != NULL)
+ abort();
+ }
+}
+
+int main (void)
+{
+ int i;
+ s1 arr1[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr1[i].a = i;
+ arr1[i].b = i * 2;
+ arr1[i].c = (void *)arr1;
+
+ if (arr1[i].a == 178)
+ abort();
+ }
+
+
+ foo1 (arr1);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-38.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-38.c
new file mode 100644
index 000000000..a387f5d0e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-38.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+typedef struct {
+ float l, h;
+} tFPinterval;
+
+tFPinterval X[1024];
+tFPinterval Y[1024];
+tFPinterval Z[1024];
+
+void Compute(void)
+{
+ int d;
+ for (d= 0; d < 1024; d++)
+ {
+ Y[d].l= X[d].l + X[d].h;
+ Y[d].h= Y[d].l;
+ Z[d].l= X[d].l;
+ Z[d].h= X[d].h;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target { vect_float && vect_perm } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-39.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-39.c
new file mode 100644
index 000000000..b3c278a5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-39.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+
+double x[1024], y[1024], z[1024];
+void foo (double w)
+{
+ int i;
+ for (i = 0; i < 1023; i+=2)
+ {
+ z[i] = x[i] + 1;
+ z[i+1] = x[i+1] + w;
+ }
+}
+void bar (double w)
+{
+ int i;
+ for (i = 0; i < 1023; i+=2)
+ {
+ z[i] = x[i] + w;
+ z[i+1] = x[i+1] + 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-4-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-4-big-array.c
new file mode 100644
index 000000000..55607dd2d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-4-big-array.c
@@ -0,0 +1,135 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+volatile int y = 0;
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+ unsigned short in[N*8];
+ unsigned int ia[N*2];
+
+ for (i = 0; i < N*8; i++)
+ {
+ in[i] = i;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8];
+ out[i*8 + 1] = in[i*8 + 1];
+ out[i*8 + 2] = in[i*8 + 2];
+ out[i*8 + 3] = in[i*8 + 3];
+ out[i*8 + 4] = in[i*8 + 4];
+ out[i*8 + 5] = in[i*8 + 5];
+ out[i*8 + 6] = in[i*8 + 6];
+ out[i*8 + 7] = in[i*8 + 7];
+
+ ia[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8]
+ || out[i*8 + 1] != in[i*8 + 1]
+ || out[i*8 + 2] != in[i*8 + 2]
+ || out[i*8 + 3] != in[i*8 + 3]
+ || out[i*8 + 4] != in[i*8 + 4]
+ || out[i*8 + 5] != in[i*8 + 5]
+ || out[i*8 + 6] != in[i*8 + 6]
+ || out[i*8 + 7] != in[i*8 + 7]
+ || ia[i] != 7)
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = in[i*4];
+ out[i*4 + 1] = in[i*4 + 1];
+ out[i*4 + 2] = in[i*4 + 2];
+ out[i*4 + 3] = in[i*4 + 3];
+
+ ia[i] = 12;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != in[i*4]
+ || out[i*4 + 1] != in[i*4 + 1]
+ || out[i*4 + 2] != in[i*4 + 2]
+ || out[i*4 + 3] != in[i*4 + 3]
+ || ia[i] != 12)
+ abort ();
+ }
+
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*16] = in[i*16];
+ out[i*16 + 1] = in[i*16 + 1];
+ out[i*16 + 2] = in[i*16 + 2];
+ out[i*16 + 3] = in[i*16 + 3];
+ out[i*16 + 4] = in[i*16 + 4];
+ out[i*16 + 5] = in[i*16 + 5];
+ out[i*16 + 6] = in[i*16 + 6];
+ out[i*16 + 7] = in[i*16 + 7];
+ out[i*16 + 8] = in[i*16 + 8];
+ out[i*16 + 9] = in[i*16 + 9];
+ out[i*16 + 10] = in[i*16 + 10];
+ out[i*16 + 11] = in[i*16 + 11];
+ out[i*16 + 12] = in[i*16 + 12];
+ out[i*16 + 13] = in[i*16 + 13];
+ out[i*16 + 14] = in[i*16 + 14];
+ out[i*16 + 15] = in[i*16 + 15];
+
+ ia[i] = 21;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*16] != in[i*16]
+ || out[i*16 + 1] != in[i*16 + 1]
+ || out[i*16 + 2] != in[i*16 + 2]
+ || out[i*16 + 3] != in[i*16 + 3]
+ || out[i*16 + 4] != in[i*16 + 4]
+ || out[i*16 + 5] != in[i*16 + 5]
+ || out[i*16 + 6] != in[i*16 + 6]
+ || out[i*16 + 7] != in[i*16 + 7]
+ || out[i*16 + 8] != in[i*16 + 8]
+ || out[i*16 + 9] != in[i*16 + 9]
+ || out[i*16 + 10] != in[i*16 + 10]
+ || out[i*16 + 11] != in[i*16 + 11]
+ || out[i*16 + 12] != in[i*16 + 12]
+ || out[i*16 + 13] != in[i*16 + 13]
+ || out[i*16 + 14] != in[i*16 + 14]
+ || out[i*16 + 15] != in[i*16 + 15]
+ || ia[i] != 21)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-4.c
new file mode 100644
index 000000000..50ad2bd53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-4.c
@@ -0,0 +1,127 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+ unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned int ia[N*2];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8];
+ out[i*8 + 1] = in[i*8 + 1];
+ out[i*8 + 2] = in[i*8 + 2];
+ out[i*8 + 3] = in[i*8 + 3];
+ out[i*8 + 4] = in[i*8 + 4];
+ out[i*8 + 5] = in[i*8 + 5];
+ out[i*8 + 6] = in[i*8 + 6];
+ out[i*8 + 7] = in[i*8 + 7];
+
+ ia[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8]
+ || out[i*8 + 1] != in[i*8 + 1]
+ || out[i*8 + 2] != in[i*8 + 2]
+ || out[i*8 + 3] != in[i*8 + 3]
+ || out[i*8 + 4] != in[i*8 + 4]
+ || out[i*8 + 5] != in[i*8 + 5]
+ || out[i*8 + 6] != in[i*8 + 6]
+ || out[i*8 + 7] != in[i*8 + 7]
+ || ia[i] != 7)
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = in[i*4];
+ out[i*4 + 1] = in[i*4 + 1];
+ out[i*4 + 2] = in[i*4 + 2];
+ out[i*4 + 3] = in[i*4 + 3];
+
+ ia[i] = 12;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != in[i*4]
+ || out[i*4 + 1] != in[i*4 + 1]
+ || out[i*4 + 2] != in[i*4 + 2]
+ || out[i*4 + 3] != in[i*4 + 3]
+ || ia[i] != 12)
+ abort ();
+ }
+
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*16] = in[i*16];
+ out[i*16 + 1] = in[i*16 + 1];
+ out[i*16 + 2] = in[i*16 + 2];
+ out[i*16 + 3] = in[i*16 + 3];
+ out[i*16 + 4] = in[i*16 + 4];
+ out[i*16 + 5] = in[i*16 + 5];
+ out[i*16 + 6] = in[i*16 + 6];
+ out[i*16 + 7] = in[i*16 + 7];
+ out[i*16 + 8] = in[i*16 + 8];
+ out[i*16 + 9] = in[i*16 + 9];
+ out[i*16 + 10] = in[i*16 + 10];
+ out[i*16 + 11] = in[i*16 + 11];
+ out[i*16 + 12] = in[i*16 + 12];
+ out[i*16 + 13] = in[i*16 + 13];
+ out[i*16 + 14] = in[i*16 + 14];
+ out[i*16 + 15] = in[i*16 + 15];
+
+ ia[i] = 21;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*16] != in[i*16]
+ || out[i*16 + 1] != in[i*16 + 1]
+ || out[i*16 + 2] != in[i*16 + 2]
+ || out[i*16 + 3] != in[i*16 + 3]
+ || out[i*16 + 4] != in[i*16 + 4]
+ || out[i*16 + 5] != in[i*16 + 5]
+ || out[i*16 + 6] != in[i*16 + 6]
+ || out[i*16 + 7] != in[i*16 + 7]
+ || out[i*16 + 8] != in[i*16 + 8]
+ || out[i*16 + 9] != in[i*16 + 9]
+ || out[i*16 + 10] != in[i*16 + 10]
+ || out[i*16 + 11] != in[i*16 + 11]
+ || out[i*16 + 12] != in[i*16 + 12]
+ || out[i*16 + 13] != in[i*16 + 13]
+ || out[i*16 + 14] != in[i*16 + 14]
+ || out[i*16 + 15] != in[i*16 + 15]
+ || ia[i] != 21)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-5.c
new file mode 100644
index 000000000..b99cadf13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-5.c
@@ -0,0 +1,126 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8];
+ unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+ unsigned short ia[N];
+ unsigned int ib[N*2];
+
+ /* Multiple types with SLP of the smaller type. */
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8];
+ out[i*8 + 1] = in[i*8 + 1];
+ out[i*8 + 2] = in[i*8 + 2];
+ out[i*8 + 3] = in[i*8 + 3];
+ out[i*8 + 4] = in[i*8 + 4];
+ out[i*8 + 5] = in[i*8 + 5];
+ out[i*8 + 6] = in[i*8 + 6];
+ out[i*8 + 7] = in[i*8 + 7];
+
+ ia[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8]
+ || out[i*8 + 1] != in[i*8 + 1]
+ || out[i*8 + 2] != in[i*8 + 2]
+ || out[i*8 + 3] != in[i*8 + 3]
+ || out[i*8 + 4] != in[i*8 + 4]
+ || out[i*8 + 5] != in[i*8 + 5]
+ || out[i*8 + 6] != in[i*8 + 6]
+ || out[i*8 + 7] != in[i*8 + 7]
+ || ia[i] != 7)
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = in[i*4];
+ out[i*4 + 1] = in[i*4 + 1];
+ out[i*4 + 2] = in[i*4 + 2];
+ out[i*4 + 3] = in[i*4 + 3];
+
+ ib[i] = 12;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != in[i*4]
+ || out[i*4 + 1] != in[i*4 + 1]
+ || out[i*4 + 2] != in[i*4 + 2]
+ || out[i*4 + 3] != in[i*4 + 3]
+ || ib[i] != 12)
+ abort ();
+ }
+
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*16] = in[i*16];
+ out[i*16 + 1] = in[i*16 + 1];
+ out[i*16 + 2] = in[i*16 + 2];
+ out[i*16 + 3] = in[i*16 + 3];
+ out[i*16 + 4] = in[i*16 + 4];
+ out[i*16 + 5] = in[i*16 + 5];
+ out[i*16 + 6] = in[i*16 + 6];
+ out[i*16 + 7] = in[i*16 + 7];
+ out[i*16 + 8] = in[i*16 + 8];
+ out[i*16 + 9] = in[i*16 + 9];
+ out[i*16 + 10] = in[i*16 + 10];
+ out[i*16 + 11] = in[i*16 + 11];
+ out[i*16 + 12] = in[i*16 + 12];
+ out[i*16 + 13] = in[i*16 + 13];
+ out[i*16 + 14] = in[i*16 + 14];
+ out[i*16 + 15] = in[i*16 + 15];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*16] != in[i*16]
+ || out[i*16 + 1] != in[i*16 + 1]
+ || out[i*16 + 2] != in[i*16 + 2]
+ || out[i*16 + 3] != in[i*16 + 3]
+ || out[i*16 + 4] != in[i*16 + 4]
+ || out[i*16 + 5] != in[i*16 + 5]
+ || out[i*16 + 6] != in[i*16 + 6]
+ || out[i*16 + 7] != in[i*16 + 7]
+ || out[i*16 + 8] != in[i*16 + 8]
+ || out[i*16 + 9] != in[i*16 + 9]
+ || out[i*16 + 10] != in[i*16 + 10]
+ || out[i*16 + 11] != in[i*16 + 11]
+ || out[i*16 + 12] != in[i*16 + 12]
+ || out[i*16 + 13] != in[i*16 + 13]
+ || out[i*16 + 14] != in[i*16 + 14]
+ || out[i*16 + 15] != in[i*16 + 15])
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-6.c
new file mode 100644
index 000000000..e8d007b02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-6.c
@@ -0,0 +1,122 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned int in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+int
+main1 ()
+{
+ int i;
+ unsigned short out[N*8];
+ unsigned int out2[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8] + 5;
+ out[i*8 + 1] = in[i*8 + 1] + 6;
+ out[i*8 + 2] = in[i*8 + 2] + 7;
+ out[i*8 + 3] = in[i*8 + 3] + 8;
+ out[i*8 + 4] = in[i*8 + 4] + 9;
+ out[i*8 + 5] = in[i*8 + 5] + 10;
+ out[i*8 + 6] = in[i*8 + 6] + 11;
+ out[i*8 + 7] = in[i*8 + 7] + 12;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8] + 5
+ || out[i*8 + 1] != in[i*8 + 1] + 6
+ || out[i*8 + 2] != in[i*8 + 2] + 7
+ || out[i*8 + 3] != in[i*8 + 3] + 8
+ || out[i*8 + 4] != in[i*8 + 4] + 9
+ || out[i*8 + 5] != in[i*8 + 5] + 10
+ || out[i*8 + 6] != in[i*8 + 6] + 11
+ || out[i*8 + 7] != in[i*8 + 7] + 12)
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = in[i*4] + 2;
+ out[i*4 + 1] = in[i*4 + 1] + 2;
+ out[i*4 + 2] = in[i*4 + 2] + 1;
+ out[i*4 + 3] = in[i*4 + 3] + 3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != in[i*4] + 2
+ || out[i*4 + 1] != in[i*4 + 1] + 2
+ || out[i*4 + 2] != in[i*4 + 2] + 1
+ || out[i*4 + 3] != in[i*4 + 3] + 3)
+ abort ();
+ }
+
+ for (i = 0; i < N/2; i++)
+ {
+ out2[i*16] = in2[i*16] * 2;
+ out2[i*16 + 1] = in2[i*16 + 1] * 3;
+ out2[i*16 + 2] = in2[i*16 + 2] * 4;
+ out2[i*16 + 3] = in2[i*16 + 3] * 3;
+ out2[i*16 + 4] = in2[i*16 + 4] * 2;
+ out2[i*16 + 5] = in2[i*16 + 5] * 3;
+ out2[i*16 + 6] = in2[i*16 + 6] * 2;
+ out2[i*16 + 7] = in2[i*16 + 7] * 4;
+ out2[i*16 + 8] = in2[i*16 + 8] * 2;
+ out2[i*16 + 9] = in2[i*16 + 9] * 5;
+ out2[i*16 + 10] = in2[i*16 + 10] * 2;
+ out2[i*16 + 11] = in2[i*16 + 11] * 3;
+ out2[i*16 + 12] = in2[i*16 + 12] * 4;
+ out2[i*16 + 13] = in2[i*16 + 13] * 4;
+ out2[i*16 + 14] = in2[i*16 + 14] * 3;
+ out2[i*16 + 15] = in2[i*16 + 15] * 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out2[i*16] != in2[i*16] * 2
+ || out2[i*16 + 1] != in2[i*16 + 1] * 3
+ || out2[i*16 + 2] != in2[i*16 + 2] * 4
+ || out2[i*16 + 3] != in2[i*16 + 3] * 3
+ || out2[i*16 + 4] != in2[i*16 + 4] * 2
+ || out2[i*16 + 5] != in2[i*16 + 5] * 3
+ || out2[i*16 + 6] != in2[i*16 + 6] * 2
+ || out2[i*16 + 7] != in2[i*16 + 7] * 4
+ || out2[i*16 + 8] != in2[i*16 + 8] * 2
+ || out2[i*16 + 9] != in2[i*16 + 9] * 5
+ || out2[i*16 + 10] != in2[i*16 + 10] * 2
+ || out2[i*16 + 11] != in2[i*16 + 11] * 3
+ || out2[i*16 + 12] != in2[i*16 + 12] * 4
+ || out2[i*16 + 13] != in2[i*16 + 13] * 4
+ || out2[i*16 + 14] != in2[i*16 + 14] * 3
+ || out2[i*16 + 15] != in2[i*16 + 15] * 2)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" {target vect_int_mult} } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" {target { ! { vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" {target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target { ! { vect_int_mult } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-7.c
new file mode 100644
index 000000000..9e7ce8c8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-7.c
@@ -0,0 +1,128 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int in[N*8] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned short in2[N*16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8], ia[N*2];
+ unsigned short sa[N], out2[N*16];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = in[i*8] + 5;
+ out[i*8 + 1] = in[i*8 + 1] + 6;
+ out[i*8 + 2] = in[i*8 + 2] + 7;
+ out[i*8 + 3] = in[i*8 + 3] + 8;
+ out[i*8 + 4] = in[i*8 + 4] + 9;
+ out[i*8 + 5] = in[i*8 + 5] + 10;
+ out[i*8 + 6] = in[i*8 + 6] + 11;
+ out[i*8 + 7] = in[i*8 + 7] + 12;
+
+ ia[i] = in[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != in[i*8] + 5
+ || out[i*8 + 1] != in[i*8 + 1] + 6
+ || out[i*8 + 2] != in[i*8 + 2] + 7
+ || out[i*8 + 3] != in[i*8 + 3] + 8
+ || out[i*8 + 4] != in[i*8 + 4] + 9
+ || out[i*8 + 5] != in[i*8 + 5] + 10
+ || out[i*8 + 6] != in[i*8 + 6] + 11
+ || out[i*8 + 7] != in[i*8 + 7] + 12
+ || ia[i] != in[i])
+ abort ();
+ }
+
+ for (i = 0; i < N*2; i++)
+ {
+ out[i*4] = in[i*4] + 1;
+ out[i*4 + 1] = in[i*4 + 1] + 2;
+ out[i*4 + 2] = in[i*4 + 2] + 3;
+ out[i*4 + 3] = in[i*4 + 3] + 4;
+
+ ia[i] = in[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N*2; i++)
+ {
+ if (out[i*4] != in[i*4] + 1
+ || out[i*4 + 1] != in[i*4 + 1] + 2
+ || out[i*4 + 2] != in[i*4 + 2] + 3
+ || out[i*4 + 3] != in[i*4 + 3] + 4
+ || ia[i] != in[i])
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ out2[i*16] = in2[i*16] * 2;
+ out2[i*16 + 1] = in2[i*16 + 1] * 3;
+ out2[i*16 + 2] = in2[i*16 + 2] * 4;
+ out2[i*16 + 3] = in2[i*16 + 3] * 3;
+ out2[i*16 + 4] = in2[i*16 + 4] * 2;
+ out2[i*16 + 5] = in2[i*16 + 5] * 3;
+ out2[i*16 + 6] = in2[i*16 + 6] * 2;
+ out2[i*16 + 7] = in2[i*16 + 7] * 4;
+ out2[i*16 + 8] = in2[i*16 + 8] * 2;
+ out2[i*16 + 9] = in2[i*16 + 9] * 5;
+ out2[i*16 + 10] = in2[i*16 + 10] * 2;
+ out2[i*16 + 11] = in2[i*16 + 11] * 3;
+ out2[i*16 + 12] = in2[i*16 + 12] * 4;
+ out2[i*16 + 13] = in2[i*16 + 13] * 4;
+ out2[i*16 + 14] = in2[i*16 + 14] * 3;
+ out2[i*16 + 15] = in2[i*16 + 15] * 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out2[i*16] != in2[i*16] * 2
+ || out2[i*16 + 1] != in2[i*16 + 1] * 3
+ || out2[i*16 + 2] != in2[i*16 + 2] * 4
+ || out2[i*16 + 3] != in2[i*16 + 3] * 3
+ || out2[i*16 + 4] != in2[i*16 + 4] * 2
+ || out2[i*16 + 5] != in2[i*16 + 5] * 3
+ || out2[i*16 + 6] != in2[i*16 + 6] * 2
+ || out2[i*16 + 7] != in2[i*16 + 7] * 4
+ || out2[i*16 + 8] != in2[i*16 + 8] * 2
+ || out2[i*16 + 9] != in2[i*16 + 9] * 5
+ || out2[i*16 + 10] != in2[i*16 + 10] * 2
+ || out2[i*16 + 11] != in2[i*16 + 11] * 3
+ || out2[i*16 + 12] != in2[i*16 + 12] * 4
+ || out2[i*16 + 13] != in2[i*16 + 13] * 4
+ || out2[i*16 + 14] != in2[i*16 + 14] * 3
+ || out2[i*16 + 15] != in2[i*16 + 15] * 2)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_short_mult } } }*/
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! { vect_short_mult } } } } }*/
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { target vect_short_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { ! { vect_short_mult } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-8.c
new file mode 100644
index 000000000..76db4e1c2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-8.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+int main1 ()
+{
+ int i;
+ float fa[N];
+
+ /* int -> float */
+ for (i = 0; i < N/4; i++)
+ {
+ fa[4*i] = (float) ib[4*i];
+ fa[4*i + 1] = (float) ib[4*i + 1];
+ fa[4*i + 2] = (float) ib[4*i + 2];
+ fa[4*i + 3] = (float) ib[4*i + 3];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/4; i++)
+ {
+ if (fa[4*i] != (float) ib[4*i]
+ || fa[4*i + 1] != (float) ib[4*i + 1]
+ || fa[4*i + 2] != (float) ib[4*i + 2]
+ || fa[4*i + 3] != (float) ib[4*i + 3])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-9.c
new file mode 100644
index 000000000..7e1ede4b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-9.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int result[N];
+
+/* short->int widening-mult */
+int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len/2; i++) {
+ result[2*i] = X[2*i] * Y[2*i];
+ result[2*i+1] = X[2*i+1] * Y[2*i+1];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } }*/
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-1.c
new file mode 100644
index 000000000..4b8e3d3b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-1.c
@@ -0,0 +1,126 @@
+/* { dg-require-effective-target vect_condition } */
+#include "tree-vect.h"
+
+#define N 32
+int a[N], b[N];
+int d[N], e[N];
+int k[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N/4; i++)
+ {
+ k[4*i] = a[4*i] < b[4*i] ? 17 : 0;
+ k[4*i+1] = a[4*i+1] < b[4*i+1] ? 17 : 0;
+ k[4*i+2] = a[4*i+2] < b[4*i+2] ? 17 : 0;
+ k[4*i+3] = a[4*i+3] < b[4*i+3] ? 17 : 0;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 0 : 24;
+ k[2*i+1] = a[2*i+1] < b[2*i+1] ? 7 : 4;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 51 : 12;
+ k[2*i+1] = a[2*i+1] > b[2*i+1] ? 51 : 12;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ int d0 = d[2*i], e0 = e[2*i];
+ int d1 = d[2*i+1], e1 = e[2*i+1];
+ k[2*i] = a[2*i] >= b[2*i] ? d0 : e0;
+ k[2*i+1] = a[2*i+1] >= b[2*i+1] ? d1 : e1;
+ }
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
+ case 1: a[i] = 0; b[i] = 0; break;
+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
+ case 3: a[i] = i; b[i] = i + 7; break;
+ case 4: a[i] = i; b[i] = i; break;
+ case 5: a[i] = i + 16; b[i] = i + 3; break;
+ case 6: a[i] = - i - 5; b[i] = - i; break;
+ case 7: a[i] = - i; b[i] = - i; break;
+ case 8: a[i] = - i; b[i] = - i - 7; break;
+ }
+ d[i] = i;
+ e[i] = 2 * i;
+ }
+ f1 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? 17 : 0))
+ abort ();
+
+ f2 ();
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0:
+ case 6:
+ if (k[i] != ((i/9 % 2) == 0 ? 0 : 7))
+ abort ();
+ break;
+ case 1:
+ case 5:
+ case 7:
+ if (k[i] != ((i/9 % 2) == 0 ? 4 : 24))
+ abort ();
+ break;
+ case 2:
+ case 4:
+ case 8:
+ if (k[i] != ((i/9 % 2) == 0 ? 24 : 4))
+ abort ();
+ break;
+ case 3:
+ if (k[i] != ((i/9 % 2) == 0 ? 7 : 0))
+ abort ();
+ break;
+ }
+ }
+
+ f3 ();
+
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? e[i] : d[i]))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c
new file mode 100644
index 000000000..8217b764a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c
@@ -0,0 +1,127 @@
+/* { dg-require-effective-target vect_cond_mixed } */
+#include "tree-vect.h"
+
+#define N 128
+int d[N], e[N], f[N];
+unsigned char k[N];
+float a[N], b[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N/4; i++)
+ {
+ k[4*i] = a[4*i] < b[4*i] ? 17 : 0;
+ k[4*i+1] = a[4*i+1] < b[4*i+1] ? 17 : 0;
+ k[4*i+2] = a[4*i+2] < b[4*i+2] ? 17 : 0;
+ k[4*i+3] = a[4*i+3] < b[4*i+3] ? 17 : 0;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 0 : 24;
+ k[2*i+1] = a[2*i+1] < b[2*i+1] ? 7 : 4;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 51 : 12;
+ k[2*i+1] = a[2*i+1] > b[2*i+1] ? 51 : 12;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ int d0 = d[2*i], e0 = e[2*i];
+ int d1 = d[2*i+1], e1 = e[2*i+1];
+ f[2*i] = a[2*i] >= b[2*i] ? d0 : e0;
+ f[2*i+1] = a[2*i+1] >= b[2*i+1] ? d1 : e1;
+ }
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
+ case 1: a[i] = 0; b[i] = 0; break;
+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
+ case 3: a[i] = i; b[i] = i + 7; break;
+ case 4: a[i] = i; b[i] = i; break;
+ case 5: a[i] = i + 16; b[i] = i + 3; break;
+ case 6: a[i] = - i - 5; b[i] = - i; break;
+ case 7: a[i] = - i; b[i] = - i; break;
+ case 8: a[i] = - i; b[i] = - i - 7; break;
+ }
+ d[i] = i;
+ e[i] = 2 * i;
+ }
+
+ f1 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? 17 : 0))
+ abort ();
+
+ f2 ();
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0:
+ case 6:
+ if (k[i] != ((i/9 % 2) == 0 ? 0 : 7))
+ abort ();
+ break;
+ case 1:
+ case 5:
+ case 7:
+ if (k[i] != ((i/9 % 2) == 0 ? 4 : 24))
+ abort ();
+ break;
+ case 2:
+ case 4:
+ case 8:
+ if (k[i] != ((i/9 % 2) == 0 ? 24 : 4))
+ abort ();
+ break;
+ case 3:
+ if (k[i] != ((i/9 % 2) == 0 ? 7 : 0))
+ abort ();
+ break;
+ }
+ }
+
+ f3 ();
+
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (f[i] != ((i % 3) == 0 ? e[i] : d[i]))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-2.c
new file mode 100644
index 000000000..c73933fce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-2.c
@@ -0,0 +1,127 @@
+/* { dg-require-effective-target vect_cond_mixed } */
+#include "tree-vect.h"
+
+#define N 32
+int d[N], e[N], f[N];
+unsigned char k[N];
+float a[N], b[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N/4; i++)
+ {
+ k[4*i] = a[4*i] < b[4*i] ? 17 : 0;
+ k[4*i+1] = a[4*i+1] < b[4*i+1] ? 17 : 0;
+ k[4*i+2] = a[4*i+2] < b[4*i+2] ? 17 : 0;
+ k[4*i+3] = a[4*i+3] < b[4*i+3] ? 17 : 0;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 0 : 24;
+ k[2*i+1] = a[2*i+1] < b[2*i+1] ? 7 : 4;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ k[2*i] = a[2*i] < b[2*i] ? 51 : 12;
+ k[2*i+1] = a[2*i+1] > b[2*i+1] ? 51 : 12;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N/2; ++i)
+ {
+ int d0 = d[2*i], e0 = e[2*i];
+ int d1 = d[2*i+1], e1 = e[2*i+1];
+ f[2*i] = a[2*i] >= b[2*i] ? d0 : e0;
+ f[2*i+1] = a[2*i+1] >= b[2*i+1] ? d1 : e1;
+ }
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
+ case 1: a[i] = 0; b[i] = 0; break;
+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
+ case 3: a[i] = i; b[i] = i + 7; break;
+ case 4: a[i] = i; b[i] = i; break;
+ case 5: a[i] = i + 16; b[i] = i + 3; break;
+ case 6: a[i] = - i - 5; b[i] = - i; break;
+ case 7: a[i] = - i; b[i] = - i; break;
+ case 8: a[i] = - i; b[i] = - i - 7; break;
+ }
+ d[i] = i;
+ e[i] = 2 * i;
+ }
+
+ f1 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? 17 : 0))
+ abort ();
+
+ f2 ();
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0:
+ case 6:
+ if (k[i] != ((i/9 % 2) == 0 ? 0 : 7))
+ abort ();
+ break;
+ case 1:
+ case 5:
+ case 7:
+ if (k[i] != ((i/9 % 2) == 0 ? 4 : 24))
+ abort ();
+ break;
+ case 2:
+ case 4:
+ case 8:
+ if (k[i] != ((i/9 % 2) == 0 ? 24 : 4))
+ abort ();
+ break;
+ case 3:
+ if (k[i] != ((i/9 % 2) == 0 ? 7 : 0))
+ abort ();
+ break;
+ }
+ }
+
+ f3 ();
+
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (f[i] != ((i % 3) == 0 ? e[i] : d[i]))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-3.c
new file mode 100644
index 000000000..4ee2dcec3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-3.c
@@ -0,0 +1,84 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include "tree-vect.h"
+
+#define N 128
+
+/* Comparison in int, then/else and result in unsigned char. */
+
+static inline unsigned char
+foo (int x, int y, int a, int b)
+{
+ if (x >= y)
+ return a;
+ else
+ return b;
+}
+
+__attribute__((noinline, noclone)) void
+bar (unsigned char * __restrict__ a, unsigned char * __restrict__ b,
+ unsigned char * __restrict__ c, unsigned char * __restrict__ d,
+ unsigned char * __restrict__ e, int w)
+{
+ int i;
+ for (i = 0; i < N/16; i++, a += 16, b += 16, c += 16, d += 16, e += 16)
+ {
+ e[0] = foo (c[0], d[0], a[0] * w, b[0] * w);
+ e[1] = foo (c[1], d[1], a[1] * w, b[1] * w);
+ e[2] = foo (c[2], d[2], a[2] * w, b[2] * w);
+ e[3] = foo (c[3], d[3], a[3] * w, b[3] * w);
+ e[4] = foo (c[4], d[4], a[4] * w, b[4] * w);
+ e[5] = foo (c[5], d[5], a[5] * w, b[5] * w);
+ e[6] = foo (c[6], d[6], a[6] * w, b[6] * w);
+ e[7] = foo (c[7], d[7], a[7] * w, b[7] * w);
+ e[8] = foo (c[8], d[8], a[8] * w, b[8] * w);
+ e[9] = foo (c[9], d[9], a[9] * w, b[9] * w);
+ e[10] = foo (c[10], d[10], a[10] * w, b[10] * w);
+ e[11] = foo (c[11], d[11], a[11] * w, b[11] * w);
+ e[12] = foo (c[12], d[12], a[12] * w, b[12] * w);
+ e[13] = foo (c[13], d[13], a[13] * w, b[13] * w);
+ e[14] = foo (c[14], d[14], a[14] * w, b[14] * w);
+ e[15] = foo (c[15], d[15], a[15] * w, b[15] * w);
+ }
+}
+
+
+unsigned char a[N], b[N], c[N], d[N], e[N];
+
+int main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = 5;
+ e[i] = 0;
+
+ switch (i % 9)
+ {
+ case 0: asm (""); c[i] = i; d[i] = i + 1; break;
+ case 1: c[i] = 0; d[i] = 0; break;
+ case 2: c[i] = i + 1; d[i] = i - 1; break;
+ case 3: c[i] = i; d[i] = i + 7; break;
+ case 4: c[i] = i; d[i] = i; break;
+ case 5: c[i] = i + 16; d[i] = i + 3; break;
+ case 6: c[i] = i - 5; d[i] = i; break;
+ case 7: c[i] = i; d[i] = i; break;
+ case 8: c[i] = i; d[i] = i - 7; break;
+ }
+ }
+
+ bar (a, b, c, d, e, 2);
+ for (i = 0; i < N; i++)
+ if (e[i] != ((i % 3) == 0 ? 10 : 2 * i))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-4.c
new file mode 100644
index 000000000..60a62384e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-cond-4.c
@@ -0,0 +1,86 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include "tree-vect.h"
+
+#define N 128
+
+/* Comparison in short, then/else and result in int. */
+static inline int
+foo (short x, short y, int a, int b)
+{
+ if (x >= y)
+ return a;
+ else
+ return b;
+}
+
+__attribute__((noinline, noclone)) void
+bar (short * __restrict__ a, short * __restrict__ b,
+ short * __restrict__ c, short * __restrict__ d,
+ int * __restrict__ e, int w)
+{
+ int i;
+ int stride = 16;
+
+ for (i = 0; i < N/stride; i++, a += stride, b += stride, c += stride,
+ d += stride, e += stride)
+ {
+ e[0] = foo (c[0], d[0], a[0], b[0]);
+ e[1] = foo (c[1], d[1], a[1], b[1]);
+ e[2] = foo (c[2], d[2], a[2], b[2]);
+ e[3] = foo (c[3], d[3], a[3], b[3]);
+ e[4] = foo (c[4], d[4], a[4], b[4]);
+ e[5] = foo (c[5], d[5], a[5], b[5]);
+ e[6] = foo (c[6], d[6], a[6], b[6]);
+ e[7] = foo (c[7], d[7], a[7], b[7]);
+ e[8] = foo (c[8], d[8], a[8], b[8]);
+ e[9] = foo (c[9], d[9], a[9], b[9]);
+ e[10] = foo (c[10], d[10], a[10], b[10]);
+ e[11] = foo (c[11], d[11], a[11], b[11]);
+ e[12] = foo (c[12], d[12], a[12], b[12]);
+ e[13] = foo (c[13], d[13], a[13], b[13]);
+ e[14] = foo (c[14], d[14], a[14], b[14]);
+ e[15] = foo (c[15], d[15], a[15], b[15]);
+ }
+}
+
+
+short a[N], b[N], c[N], d[N];
+int e[N];
+
+int main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = 5;
+ e[i] = 0;
+
+ switch (i % 9)
+ {
+ case 0: asm (""); c[i] = - i - 1; d[i] = i + 1; break;
+ case 1: c[i] = 0; d[i] = 0; break;
+ case 2: c[i] = i + 1; d[i] = - i - 1; break;
+ case 3: c[i] = i; d[i] = i + 7; break;
+ case 4: c[i] = i; d[i] = i; break;
+ case 5: c[i] = i + 16; d[i] = i + 3; break;
+ case 6: c[i] = - i - 5; d[i] = - i; break;
+ case 7: c[i] = - i; d[i] = - i; break;
+ case 8: c[i] = - i; d[i] = - i - 7; break;
+ }
+ }
+
+ bar (a, b, c, d, e, 2);
+ for (i = 0; i < N; i++)
+ if (e[i] != ((i % 3) == 0 ? 5 : i))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c
new file mode 100644
index 000000000..b52838197
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned short sout[N*8];
+ unsigned int iout[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ sout[i*4] = 8;
+ sout[i*4 + 1] = 18;
+ sout[i*4 + 2] = 28;
+ sout[i*4 + 3] = 38;
+
+ iout[i*4] = 8;
+ iout[i*4 + 1] = 18;
+ iout[i*4 + 2] = 28;
+ iout[i*4 + 3] = 38;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sout[i*4] != 8
+ || sout[i*4 + 1] != 18
+ || sout[i*4 + 2] != 28
+ || sout[i*4 + 3] != 38
+ || iout[i*4] != 8
+ || iout[i*4 + 1] != 18
+ || iout[i*4 + 2] != 28
+ || iout[i*4 + 3] != 38)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c
new file mode 100644
index 000000000..3dd6b84e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+struct s
+{
+ unsigned char a;
+ unsigned char b;
+};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ struct s out[N*4];
+
+ for (i = 0; i < N*4; i++)
+ {
+ out[i].a = (unsigned char) in[i*2] + 1;
+ out[i].b = (unsigned char) in[i*2 + 1] + 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out[i].a != (unsigned char) in[i*2] + 1
+ || out[i].b != (unsigned char) in[i*2 + 1] + 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c
new file mode 100644
index 000000000..b7a7a0be1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-11-big-array.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 144
+
+struct s
+{
+ int a;
+ int b;
+ int c;
+};
+
+char in[N*3];
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ struct s out[N];
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i&127;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ out[i].a = (int) in[i*3] + 1;
+ out[i].b = (int) in[i*3 + 1] + 2;
+ out[i].c = (int) in[i*3 + 2] + 3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i].a != (int) in[i*3] + 1
+ || out[i].b != (int) in[i*3 + 1] + 2
+ || out[i].c != (int) in[i*3 + 2] + 3)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c
new file mode 100644
index 000000000..602517bfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 18
+
+struct s
+{
+ int a;
+ int b;
+ int c;
+};
+
+char in[N*3] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ struct s out[N];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i].a = (int) in[i*3] + 1;
+ out[i].b = (int) in[i*3 + 1] + 2;
+ out[i].c = (int) in[i*3 + 2] + 3;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i].a != (int) in[i*3] + 1
+ || out[i].b != (int) in[i*3 + 1] + 2
+ || out[i].c != (int) in[i*3 + 2] + 3)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c
new file mode 100644
index 000000000..e9a2c6d4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c
@@ -0,0 +1,67 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned short sout[N*8];
+ unsigned int iout[N*8];
+ unsigned char cout[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ sout[i*4] = 8;
+ sout[i*4 + 1] = 18;
+ sout[i*4 + 2] = 28;
+ sout[i*4 + 3] = 38;
+
+ iout[i*4] = 8;
+ iout[i*4 + 1] = 18;
+ iout[i*4 + 2] = 28;
+ iout[i*4 + 3] = 38;
+
+ cout[i*4] = 1;
+ cout[i*4 + 1] = 2;
+ cout[i*4 + 2] = 3;
+ cout[i*4 + 3] = 4;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sout[i*4] != 8
+ || sout[i*4 + 1] != 18
+ || sout[i*4 + 2] != 28
+ || sout[i*4 + 3] != 38
+ || iout[i*4] != 8
+ || iout[i*4 + 1] != 18
+ || iout[i*4 + 2] != 28
+ || iout[i*4 + 3] != 38
+ || cout[i*4] != 1
+ || cout[i*4 + 1] != 2
+ || cout[i*4 + 2] != 3
+ || cout[i*4 + 3] != 4)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c
new file mode 100644
index 000000000..ab2ed69d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c
@@ -0,0 +1,82 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline)) int
+main1 (unsigned short a0, unsigned short a1, unsigned short a2,
+ unsigned short a3, unsigned short a4, unsigned short a5,
+ unsigned short a6, unsigned short a7, unsigned short a8,
+ unsigned short a9, unsigned short a10, unsigned short a11,
+ unsigned short a12, unsigned short a13, unsigned short a14,
+ unsigned short a15, unsigned char b0, unsigned char b1)
+{
+ int i;
+ unsigned short out[N*16];
+ unsigned char out2[N*16];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*16] = a8;
+ out[i*16 + 1] = a7;
+ out[i*16 + 2] = a1;
+ out[i*16 + 3] = a2;
+ out[i*16 + 4] = a8;
+ out[i*16 + 5] = a5;
+ out[i*16 + 6] = a5;
+ out[i*16 + 7] = a4;
+ out[i*16 + 8] = a12;
+ out[i*16 + 9] = a13;
+ out[i*16 + 10] = a14;
+ out[i*16 + 11] = a15;
+ out[i*16 + 12] = a6;
+ out[i*16 + 13] = a9;
+ out[i*16 + 14] = a0;
+ out[i*16 + 15] = a7;
+
+ out2[i*2] = b1;
+ out2[i*2+1] = b0;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*16] != a8
+ || out[i*16 + 1] != a7
+ || out[i*16 + 2] != a1
+ || out[i*16 + 3] != a2
+ || out[i*16 + 4] != a8
+ || out[i*16 + 5] != a5
+ || out[i*16 + 6] != a5
+ || out[i*16 + 7] != a4
+ || out[i*16 + 8] != a12
+ || out[i*16 + 9] != a13
+ || out[i*16 + 10] != a14
+ || out[i*16 + 11] != a15
+ || out[i*16 + 12] != a6
+ || out[i*16 + 13] != a9
+ || out[i*16 + 14] != a0
+ || out[i*16 + 15] != a7
+ || out2[i*2] != b1
+ || out2[i*2 + 1] != b0)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,20,21);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c
new file mode 100644
index 000000000..c5fd52ead
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c
@@ -0,0 +1,92 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned char in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned int out[N*8];
+ unsigned char out2[N*8];
+
+ for (i = 0; i < N/2; i++)
+ {
+ out[i*8] = in[i*8] + 5;
+ out[i*8 + 1] = in[i*8 + 1] + 6;
+ out[i*8 + 2] = in[i*8 + 2] + 7;
+ out[i*8 + 3] = in[i*8 + 3] + 8;
+ out[i*8 + 4] = in[i*8 + 4] + 9;
+ out[i*8 + 5] = in[i*8 + 5] + 10;
+ out[i*8 + 6] = in[i*8 + 6] + 11;
+ out[i*8 + 7] = in[i*8 + 7] + 12;
+
+ out2[i*16] = in2[i*16] + 2;
+ out2[i*16 + 1] = in2[i*16 + 1] + 3;
+ out2[i*16 + 2] = in2[i*16 + 2] + 4;
+ out2[i*16 + 3] = in2[i*16 + 3] + 3;
+ out2[i*16 + 4] = in2[i*16 + 4] + 2;
+ out2[i*16 + 5] = in2[i*16 + 5] + 3;
+ out2[i*16 + 6] = in2[i*16 + 6] + 2;
+ out2[i*16 + 7] = in2[i*16 + 7] + 4;
+ out2[i*16 + 8] = in2[i*16 + 8] + 2;
+ out2[i*16 + 9] = in2[i*16 + 9] + 5;
+ out2[i*16 + 10] = in2[i*16 + 10] + 2;
+ out2[i*16 + 11] = in2[i*16 + 11] + 3;
+ out2[i*16 + 12] = in2[i*16 + 12] + 4;
+ out2[i*16 + 13] = in2[i*16 + 13] + 4;
+ out2[i*16 + 14] = in2[i*16 + 14] + 3;
+ out2[i*16 + 15] = in2[i*16 + 15] + 2;
+
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (out[i*8] != in[i*8] + 5
+ || out[i*8 + 1] != in[i*8 + 1] + 6
+ || out[i*8 + 2] != in[i*8 + 2] + 7
+ || out[i*8 + 3] != in[i*8 + 3] + 8
+ || out[i*8 + 4] != in[i*8 + 4] + 9
+ || out[i*8 + 5] != in[i*8 + 5] + 10
+ || out[i*8 + 6] != in[i*8 + 6] + 11
+ || out[i*8 + 7] != in[i*8 + 7] + 12
+ || out2[i*16] != in2[i*16] + 2
+ || out2[i*16 + 1] != in2[i*16 + 1] + 3
+ || out2[i*16 + 2] != in2[i*16 + 2] + 4
+ || out2[i*16 + 3] != in2[i*16 + 3] + 3
+ || out2[i*16 + 4] != in2[i*16 + 4] + 2
+ || out2[i*16 + 5] != in2[i*16 + 5] + 3
+ || out2[i*16 + 6] != in2[i*16 + 6] + 2
+ || out2[i*16 + 7] != in2[i*16 + 7] + 4
+ || out2[i*16 + 8] != in2[i*16 + 8] + 2
+ || out2[i*16 + 9] != in2[i*16 + 9] + 5
+ || out2[i*16 + 10] != in2[i*16 + 10] + 2
+ || out2[i*16 + 11] != in2[i*16 + 11] + 3
+ || out2[i*16 + 12] != in2[i*16 + 12] + 4
+ || out2[i*16 + 13] != in2[i*16 + 13] + 4
+ || out2[i*16 + 14] != in2[i*16 + 14] + 3
+ || out2[i*16 + 15] != in2[i*16 + 15] + 2)
+
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail sparc*-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail sparc*-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c
new file mode 100644
index 000000000..a13f08d3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = (int) in[i*8] + 1;
+ out[i*8 + 1] = (int) in[i*8 + 1] + 2;
+ out[i*8 + 2] = (int) in[i*8 + 2] + 3;
+ out[i*8 + 3] = (int) in[i*8 + 3] + 4;
+ out[i*8 + 4] = (int) in[i*8 + 4] + 5;
+ out[i*8 + 5] = (int) in[i*8 + 5] + 6;
+ out[i*8 + 6] = (int) in[i*8 + 6] + 7;
+ out[i*8 + 7] = (int) in[i*8 + 7] + 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (int) in[i*8] + 1
+ || out[i*8 + 1] != (int) in[i*8 + 1] + 2
+ || out[i*8 + 2] != (int) in[i*8 + 2] + 3
+ || out[i*8 + 3] != (int) in[i*8 + 3] + 4
+ || out[i*8 + 4] != (int) in[i*8 + 4] + 5
+ || out[i*8 + 5] != (int) in[i*8 + 5] + 6
+ || out[i*8 + 6] != (int) in[i*8 + 6] + 7
+ || out[i*8 + 7] != (int) in[i*8 + 7] + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c
new file mode 100644
index 000000000..da4527646
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = (short) in[i*8] + 1;
+ out[i*8 + 1] = (short) in[i*8 + 1] + 2;
+ out[i*8 + 2] = (short) in[i*8 + 2] + 3;
+ out[i*8 + 3] = (short) in[i*8 + 3] + 4;
+ out[i*8 + 4] = (short) in[i*8 + 4] + 5;
+ out[i*8 + 5] = (short) in[i*8 + 5] + 6;
+ out[i*8 + 6] = (short) in[i*8 + 6] + 7;
+ out[i*8 + 7] = (short) in[i*8 + 7] + 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (short) in[i*8] + 1
+ || out[i*8 + 1] != (short) in[i*8 + 1] + 2
+ || out[i*8 + 2] != (short) in[i*8 + 2] + 3
+ || out[i*8 + 3] != (short) in[i*8 + 3] + 4
+ || out[i*8 + 4] != (short) in[i*8 + 4] + 5
+ || out[i*8 + 5] != (short) in[i*8 + 5] + 6
+ || out[i*8 + 6] != (short) in[i*8 + 6] + 7
+ || out[i*8 + 7] != (short) in[i*8 + 7] + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c
new file mode 100644
index 000000000..38f4f5d1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned char out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = (unsigned char) in[i*8] + 1;
+ out[i*8 + 1] = (unsigned char) in[i*8 + 1] + 2;
+ out[i*8 + 2] = (unsigned char) in[i*8 + 2] + 3;
+ out[i*8 + 3] = (unsigned char) in[i*8 + 3] + 4;
+ out[i*8 + 4] = (unsigned char) in[i*8 + 4] + 5;
+ out[i*8 + 5] = (unsigned char) in[i*8 + 5] + 6;
+ out[i*8 + 6] = (unsigned char) in[i*8 + 6] + 7;
+ out[i*8 + 7] = (unsigned char) in[i*8 + 7] + 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (unsigned char) in[i*8] + 1
+ || out[i*8 + 1] != (unsigned char) in[i*8 + 1] + 2
+ || out[i*8 + 2] != (unsigned char) in[i*8 + 2] + 3
+ || out[i*8 + 3] != (unsigned char) in[i*8 + 3] + 4
+ || out[i*8 + 4] != (unsigned char) in[i*8 + 4] + 5
+ || out[i*8 + 5] != (unsigned char) in[i*8 + 5] + 6
+ || out[i*8 + 6] != (unsigned char) in[i*8 + 6] + 7
+ || out[i*8 + 7] != (unsigned char) in[i*8 + 7] + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c
new file mode 100644
index 000000000..112db6b72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+char in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int out[N*8];
+
+ for (i = 0; i < N; i++)
+ {
+ out[i*8] = (int) in[i*8] + 1;
+ out[i*8 + 1] = (int) in[i*8 + 1] + 2;
+ out[i*8 + 2] = (int) in[i*8 + 2] + 3;
+ out[i*8 + 3] = (int) in[i*8 + 3] + 4;
+ out[i*8 + 4] = (int) in[i*8 + 4] + 5;
+ out[i*8 + 5] = (int) in[i*8 + 5] + 6;
+ out[i*8 + 6] = (int) in[i*8 + 6] + 7;
+ out[i*8 + 7] = (int) in[i*8 + 7] + 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (out[i*8] != (int) in[i*8] + 1
+ || out[i*8 + 1] != (int) in[i*8 + 1] + 2
+ || out[i*8 + 2] != (int) in[i*8 + 2] + 3
+ || out[i*8 + 3] != (int) in[i*8 + 3] + 4
+ || out[i*8 + 4] != (int) in[i*8 + 4] + 5
+ || out[i*8 + 5] != (int) in[i*8 + 5] + 6
+ || out[i*8 + 6] != (int) in[i*8 + 6] + 7
+ || out[i*8 + 7] != (int) in[i*8 + 7] + 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c
new file mode 100644
index 000000000..bd89c130d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+char in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int out[N*8];
+
+ for (i = 0; i < N*4; i++)
+ {
+ out[i*2] = (int) in[i*2] + 1;
+ out[i*2 + 1] = (int) in[i*2 + 1] + 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out[i*2] != (int) in[i*2] + 1
+ || out[i*2 + 1] != (int) in[i*2 + 1] + 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c
new file mode 100644
index 000000000..f0cf32933
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ unsigned char out[N*8];
+
+ for (i = 0; i < N*4; i++)
+ {
+ out[i*2] = (unsigned char) in[i*2] + 1;
+ out[i*2 + 1] = (unsigned char) in[i*2 + 1] + 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N*4; i++)
+ {
+ if (out[i*2] != (unsigned char) in[i*2] + 1
+ || out[i*2 + 1] != (unsigned char) in[i*2 + 1] + 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-1.c
new file mode 100644
index 000000000..756cf0b11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-1.c
@@ -0,0 +1,63 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define M00 100
+#define M10 216
+#define M20 23
+#define M01 1322
+#define M11 13
+#define M21 27271
+#define M02 74
+#define M12 191
+#define M22 500
+
+#define N 16
+
+void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
+{
+ unsigned int i, a, b, c;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+
+ *pOutput++ = M00 * a + M01 * b + M02 * c;
+ *pOutput++ = M10 * a + M11 * b + M12 * c;
+ *pOutput++ = M20 * a + M21 * b + M22 * c;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ unsigned int input[N], output[N], i;
+ unsigned int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0};
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i%256;
+ output[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ foo (input, output);
+
+ for (i = 0; i < N; i++)
+ {
+ if (output[i] != check_results[i])
+ abort ();
+ __asm__ volatile ("");
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-2.c
new file mode 100644
index 000000000..27156f482
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-2.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define M00 100
+#define M10 216
+#define M01 1322
+#define M11 13
+#define M02 74
+#define M12 191
+
+#define N 16
+
+void __attribute__((noinline))
+foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
+{
+ unsigned int i, a, b;
+
+ for (i = 0; i < N / 2; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+
+ *pOutput++ = M00 * a + M01 * b;
+ *pOutput++ = M10 * a + M11 * b;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ unsigned int input[N], output[N], i;
+ unsigned int check_results[N] = {1322, 13, 4166, 471, 7010, 929, 9854, 1387, 12698, 1845, 15542, 2303, 18386, 2761, 21230, 3219};
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i%256;
+ output[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ foo (input, output);
+
+ for (i = 0; i < N; i++)
+ {
+ if (output[i] != check_results[i])
+ abort ();
+ __asm__ volatile ("");
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-3.c
new file mode 100644
index 000000000..88c02fba6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-3.c
@@ -0,0 +1,73 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define M00 100
+#define M10 216
+#define M20 23
+#define M30 237
+#define M01 1322
+#define M11 13
+#define M21 27271
+#define M31 2280
+#define M02 74
+#define M12 191
+#define M22 500
+#define M32 111
+#define M03 134
+#define M13 117
+#define M23 11
+#define M33 771
+
+#define N 16
+
+void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
+{
+ unsigned int i, a, b, c, d;
+
+ for (i = 0; i < N / 4; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+ d = *pInput++;
+
+ *pOutput++ = M00 * a + M01 * b + M02 * c + M03 * d;
+ *pOutput++ = M10 * a + M11 * b + M12 * c + M13 * d;
+ *pOutput++ = M20 * a + M21 * b + M22 * c + M23 * d;
+ *pOutput++ = M30 * a + M31 * b + M32 * c + M33 * d;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ unsigned int input[N], output[N], i;
+ unsigned int check_results[N] = {1872, 746, 28304, 4815, 8392, 2894, 139524, 18411, 14912, 5042, 250744, 32007, 21432, 7190, 361964, 45603};
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i%256;
+ output[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ foo (input, output);
+
+ for (i = 0; i < N; i++)
+ {
+ if (output[i] != check_results[i])
+ abort ();
+ __asm__ volatile ("");
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-4.c
new file mode 100644
index 000000000..d0a069589
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-4.c
@@ -0,0 +1,87 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define M00 100
+#define M10 216
+#define M20 23
+#define M30 237
+#define M40 437
+
+#define M01 1322
+#define M11 13
+#define M21 27271
+#define M31 2280
+#define M41 284
+
+#define M02 74
+#define M12 191
+#define M22 500
+#define M32 111
+#define M42 1114
+
+#define M03 134
+#define M13 117
+#define M23 11
+#define M33 771
+#define M43 71
+
+#define M04 334
+#define M14 147
+#define M24 115
+#define M34 7716
+#define M44 16
+
+#define N 16
+
+void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
+{
+ unsigned int i, a, b, c, d, e;
+
+ for (i = 0; i < N / 5; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+ d = *pInput++;
+ e = *pInput++;
+
+ *pOutput++ = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e;
+ *pOutput++ = M10 * a + M11 * b + M12 * c + M13 * d + M14 * e;
+ *pOutput++ = M20 * a + M21 * b + M22 * c + M23 * d + M24 * e;
+ *pOutput++ = M30 * a + M31 * b + M32 * c + M33 * d + M34 * e;
+ *pOutput++ = M40 * a + M41 * b + M42 * c + M43 * d + M44 * e;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ unsigned int input[N], output[N], i;
+ unsigned int check_results[N] = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, 22848, 8174, 307964, 146829, 22009, 0};
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i%256;
+ if (input[i] > 200)
+ abort();
+ output[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ foo (input, output);
+
+ for (i = 0; i < N; i++)
+ if (output[i] != check_results[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump "permutation requires at least three vectors" "vect" { target vect_perm} } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-5.c
new file mode 100644
index 000000000..f8ee4c10e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-5.c
@@ -0,0 +1,79 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define M00 100
+#define M10 216
+#define M20 23
+#define M01 1322
+#define M11 13
+#define M21 27271
+#define M02 74
+#define M12 191
+#define M22 500
+
+#define K00 405
+#define K10 112
+#define K01 4322
+#define K11 135
+
+#define N 16
+
+void foo (int *__restrict__ pInput, int *__restrict__ pOutput,
+ int *__restrict__ pInput2, int *__restrict__ pOutput2)
+{
+ int i, a, b, c, d, e;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+
+ d = *pInput2++;
+ e = *pInput2++;
+
+ *pOutput++ = M00 * a + M01 * b + M02 * c;
+ *pOutput++ = M10 * a + M11 * b + M12 * c;
+ *pOutput++ = M20 * a + M21 * b + M22 * c;
+
+ *pOutput2++ = K00 * d + K01 * e;
+ *pOutput2++ = K10 * d + K11 * e;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ int input[N], output[N], i;
+ int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0};
+ int input2[N], output2[N];
+ int check_results2[N] = {4322, 135, 13776, 629, 23230, 1123, 32684, 1617, 42138, 2111, 0, 0, 0, 0, 0, 0};
+
+ check_vect ();
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i%256;
+ input2[i] = i%256;
+ output[i] = 0;
+ output2[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ foo (input, output, input2, output2);
+
+ for (i = 0; i < N; i++)
+ if (output[i] != check_results[i] || output2[i] != check_results2[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-6.c
new file mode 100644
index 000000000..a2843a04b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-6.c
@@ -0,0 +1,77 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define M00 100
+#define M10 216
+#define M20 23
+#define M01 1322
+#define M11 13
+#define M21 27271
+#define M02 74
+#define M12 191
+#define M22 500
+
+#define K00 405
+#define K10 112
+#define K01 4322
+#define K11 135
+
+#define N 16
+
+void foo (int *__restrict__ pInput, int *__restrict__ pOutput,
+ int *__restrict__ pInput2, int *__restrict__ pOutput2)
+{
+ int i, a, b, c, d, e;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+
+ d = *pInput2++;
+ e = *pInput2++;
+
+ *pOutput++ = M00 * a + M01 * b + M02 * c;
+ *pOutput++ = M10 * a + M11 * b + M12 * c;
+ *pOutput++ = M20 * a + M21 * b + M22 * c;
+
+ /* Regular SLP - no permutation required. */
+ *pOutput2++ = K00 * d;
+ *pOutput2++ = K10 * e;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ int input[N], output[N], i;
+ int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0};
+ int input2[N], output2[N];
+ int check_results2[N] = {0, 112, 810, 336, 1620, 560, 2430, 784, 3240, 1008, 0, 0, 0, 0, 0, 0};
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i%256;
+ input2[i] = i%256;
+ output[i] = 0;
+ output2[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ foo (input, output, input2, output2);
+
+ for (i = 0; i < N; i++)
+ if (output[i] != check_results[i] || output2[i] != check_results2[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-7.c
new file mode 100644
index 000000000..6291096f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-7.c
@@ -0,0 +1,77 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define M00 100
+#define M10 216
+#define M20 23
+#define M01 1322
+#define M11 13
+#define M21 27271
+#define M02 74
+#define M12 191
+#define M22 500
+
+#define K00 405
+#define K10 112
+#define K01 4322
+#define K11 135
+
+#define N 16
+
+/* SLP with load permutation and loop-based vectorization. */
+void foo (int *__restrict__ pInput, int *__restrict__ pOutput,
+ int *__restrict__ pInput2, int *__restrict__ pOutput2)
+{
+ int i, a, b, c, d;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+ d = *pInput2++;
+
+ *pOutput++ = M00 * a + M01 * b + M02 * c;
+ *pOutput++ = M10 * a + M11 * b + M12 * c;
+ *pOutput++ = M20 * a + M21 * b + M22 * c;
+
+ /* Loop-based vectorization. */
+ *pOutput2++ = K00 * d;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ int input[N], output[N], i;
+ int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0};
+ int input2[N], output2[N];
+ int check_results2[N] = {0, 405, 810, 1215, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i%256;
+ input2[i] = i%256;
+ output[i] = 0;
+ output2[i] = 0;
+ if (input[i] > 200)
+ abort ();
+ }
+
+ foo (input, output, input2, output2);
+
+ for (i = 0; i < N; i++)
+ if (output[i] != check_results[i] || output2[i] != check_results2[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
new file mode 100644
index 000000000..52a640c13
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-8.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 200
+
+void __attribute__((noinline))
+foo (unsigned char *__restrict__ pInput, unsigned char *__restrict__ pOutput)
+{
+ unsigned char i, a, b, c;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+
+ *pOutput++ = a + b + c + 3;
+ *pOutput++ = a + b + c + 12;
+ *pOutput++ = a + b + c + 1;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ unsigned char input[N], output[N], i;
+ unsigned char check_results[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i;
+ output[i] = 0;
+ __asm__ volatile ("");
+ }
+
+ for (i = 0; i < N / 3; i++)
+ {
+ check_results[3*i] = 9 * i + 6;
+ check_results[3*i+1] = 9 * i + 15;
+ check_results[3*i+2] = 9 * i + 4;
+ }
+
+ foo (input, output);
+
+ for (i = 0; i < N - (N % 3); i++)
+ if (output[i] != check_results[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_perm_byte && vect_char_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm_byte && {! vect_char_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm_byte } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
new file mode 100644
index 000000000..548430064
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 200
+
+void __attribute__((noinline))
+foo (unsigned short *__restrict__ pInput, unsigned short *__restrict__ pOutput)
+{
+ unsigned short i, a, b, c;
+
+ for (i = 0; i < N / 3; i++)
+ {
+ a = *pInput++;
+ b = *pInput++;
+ c = *pInput++;
+
+ *pOutput++ = a + b + c + 3;
+ *pOutput++ = a + b + c + 12;
+ *pOutput++ = a + b + c + 1;
+ }
+}
+
+int main (int argc, const char* argv[])
+{
+ unsigned short input[N], output[N], i;
+ unsigned short check_results[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ input[i] = i;
+ output[i] = 0;
+ if (input[i] > 256)
+ abort ();
+ }
+
+ for (i = 0; i < N / 3; i++)
+ {
+ check_results[3*i] = 9 * i + 6;
+ check_results[3*i+1] = 9 * i + 15;
+ check_results[3*i+2] = 9 * i + 4;
+ }
+
+ foo (input, output);
+
+ for (i = 0; i < N - (N % 3); i++)
+ if (output[i] != check_results[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
+/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-1.c
new file mode 100644
index 000000000..1667c5dc3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-1.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+/* Vectorization of reduction using loop-aware SLP. */
+
+__attribute__ ((noinline))
+int main1 (int n, int res0, int res1, int res2, int res3)
+{
+ int i;
+ unsigned int udiff0 = 5, udiff1 = 10, udiff2 = 20, udiff3 = 30;
+
+ for (i = 0; i < n; i++) {
+ udiff3 += (ub[4*i + 3] - uc[4*i + 3]);
+ udiff2 += (ub[4*i + 2] - uc[4*i + 2]);
+ udiff1 += (ub[4*i + 1] - uc[4*i + 1]);
+ udiff0 += (ub[4*i] - uc[4*i]);
+ }
+
+ /* Check results: */
+ if (udiff0 != res0
+ || udiff1 != res1
+ || udiff2 != res2
+ || udiff3 != res3)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N/4, 53, 66, 84, 102);
+ main1 (N/4 - 1, 29, 40, 56, 72);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_add } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_add } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-2.c
new file mode 100644
index 000000000..92d666987
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-2.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+/* Vectorization of reduction using loop-aware SLP (with unrolling). */
+
+__attribute__ ((noinline))
+int main1 (int n, int res0, int res1, int res2, int res3)
+{
+ int i;
+ unsigned int udiff0 = 5, udiff1 = 10;
+
+ for (i = 0; i < n; i++) {
+ udiff1 += (ub[2*i + 1] - uc[2*i + 1]);
+ udiff0 += (ub[2*i] - uc[2*i]);
+ }
+
+ /* Check results: */
+ if (udiff0 != res0
+ || udiff1 != res1)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N/2, 117, 138, 84, 102);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_add } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_add } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-3.c
new file mode 100644
index 000000000..93ca0ff2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-3.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT1 21834
+#define DOT2 21876
+
+unsigned short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* short->short->int dot product.
+ Not detected as a dot-product pattern.
+ Requires support for non-widneing multiplication and widening-summation.
+ Vectorized with loop-aware SLP. */
+__attribute__ ((noinline)) unsigned int
+foo1(int len, int *result1, int *result2)
+{
+ int i;
+ unsigned int res1 = 10, res2 = 20;
+ unsigned short prod;
+
+ for (i=0; i<len; i++) {
+ prod = X[2*i] * Y[2*i];
+ res1 += prod;
+ prod = X[2*i+1] * Y[2*i+1];
+ res2 += prod;
+ }
+
+ *result1 = res1;
+ *result2 = res2;
+
+ return 0;
+}
+
+int main (void)
+{
+ unsigned int dot1, dot2;
+ unsigned short i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ }
+
+ foo1 (N/2, &dot1, &dot2);
+
+ if (dot1 != DOT1 || dot2 != DOT2)
+ abort ();
+
+ return 0;
+}
+
+/* The initialization loop in main also gets vectorized. */
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_short_mult && { vect_widen_sum_hi_to_si && vect_unpack } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail { vect_widen_sum_hi_to_si_pattern || { ! vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-4.c
new file mode 100644
index 000000000..5df53f919
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-4.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+unsigned int uc[N];
+
+/* Vectorization of reduction using loop-aware SLP. */
+
+__attribute__ ((noinline))
+int main1 (int n, int res0, int res1, int res2, int res3, int res4, int res5, int res6, int res7)
+{
+ int i;
+ unsigned int max0 = 5, max1 = 10, max2 = 20, max3 = 30, max4 = 2, max5 = 13, max6 = 7, max7 = 313;
+
+ for (i = 0; i < n; i++) {
+ max2 = max2 < uc[8*i+2] ? uc[8*i+2] : max2;
+ max3 = max3 < uc[8*i+3] ? uc[8*i+3] : max3;
+ max1 = max1 < uc[8*i+1] ? uc[8*i+1] : max1;
+ max7 = max7 < uc[8*i+7] ? uc[8*i+7] : max7;
+ max6 = max6 < uc[8*i+6] ? uc[8*i+6] : max6;
+ max0 = max0 < uc[8*i] ? uc[8*i] : max0;
+ max4 = max4 < uc[8*i+4] ? uc[8*i+4] : max4;
+ max5 = max5 < uc[8*i+5] ? uc[8*i+5] : max5;
+ }
+
+ /* Check results: */
+ if (max0 != res0
+ || max1 != res1
+ || max2 != res2
+ || max3 != res3
+ || max4 != res4
+ || max5 != res5
+ || max6 != res6
+ || max7 != res7)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ uc[i] = i+3;
+ __asm__ volatile ("");
+ }
+
+ main1 (N/8, 123, 124, 125, 126, 127, 128, 129, 313);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-5.c
new file mode 100644
index 000000000..40958f131
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-5.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int c[N];
+
+/* Vectorization of reduction using loop-aware SLP. */
+
+__attribute__ ((noinline))
+int main1 (int n, int res0, int res1)
+{
+ int i;
+ int max0 = -100, max1 = -313;
+
+ for (i = 0; i < n; i++) {
+ max1 = max1 < c[2*i+1] ? c[2*i+1] : max1;
+ max0 = max0 < c[2*i] ? c[2*i] : max0;
+ }
+
+ /* Check results: */
+ if (max0 != res0
+ || max1 != res1)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ c[i] = (i+3) * -1;
+
+ c[0] = c[1] = -100;
+ main1 (N/2, -5, -6);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c
new file mode 100644
index 000000000..d43f329a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-reduc-6.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int a[N], b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* Vectorization of reduction. Loop-aware SLP is not possible, because of
+ different arrays. */
+
+__attribute__ ((noinline))
+int main1 (int n, int res0, int res1)
+{
+ int i;
+ int sum0 = 0, sum1 = 0;
+
+ for (i = 0; i < n; i++) {
+ sum1 += a[2*i];
+ sum0 += b[2*i];
+ }
+
+ /* Check results: */
+ if (sum0 != res0
+ || sum1 != res1)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ a[i] = b[i] = i;
+
+ main1 (N/2, 4032, 4032);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_int_add || { ! { vect_unpack || vect_strided2 } } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "different interleaving chains in one node" 1 "vect" { target { ! vect_no_int_add } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-half.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-half.c
new file mode 100644
index 000000000..e7a0f2a75
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-half.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+#include <stdlib.h>
+
+#define N 32
+#define COEF 32470
+#define COEF2 324700
+
+unsigned char in[N];
+int out[N];
+int out2[N];
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int i;
+
+ for (i = 0; i < N/2; i++)
+ {
+ out[2*i] = in[2*i] * COEF;
+ out2[2*i] = in[2*i] + COEF2;
+ out[2*i+1] = in[2*i+1] * COEF;
+ out2[2*i+1] = in[2*i+1] + COEF2;
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++)
+ if (out[i] != in[i] * COEF || out2[i] != in[i] + COEF2)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { scan-tree-dump-times "pattern recognized" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c
new file mode 100644
index 000000000..2eb73f380
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+
+int result[N];
+
+/* short->int widening-mult */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len/2; i++) {
+ result[2*i] = X[2*i] * Y[2*i];
+ result[2*i+1] = X[2*i+1] * Y[2*i+1];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c
new file mode 100644
index 000000000..fb3292ad4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+
+unsigned short result[N];
+
+/* char->short widening-mult */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len/2; i++) {
+ result[2*i] = X[2*i] * Y[2*i];
+ result[2*i+1] = X[2*i+1] * Y[2*i+1];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c
new file mode 100644
index 000000000..78ff73237
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-do compile } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+int main1 (int x, int max_result)
+{
+ int i;
+ int b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ int c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ int diff = 2;
+ int max = x;
+ int min = 10;
+
+ for (i = 0; i < N; i++) {
+ diff += (b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != 0)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100);
+ main1 (0, 15);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/tree-vect.h b/gcc-4.9/gcc/testsuite/gcc.dg/vect/tree-vect.h
new file mode 100644
index 000000000..ed59d7976
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/tree-vect.h
@@ -0,0 +1,71 @@
+/* Check if system supports SIMD */
+#include <signal.h>
+
+#if defined(__i386__) || defined(__x86_64__)
+# include "cpuid.h"
+#endif
+
+extern void abort (void);
+extern void exit (int);
+
+static void
+sig_ill_handler (int sig)
+{
+ exit(0);
+}
+
+static void __attribute__((noinline))
+check_vect (void)
+{
+ signal(SIGILL, sig_ill_handler);
+#if defined(__PAIRED__)
+ /* 750CL paired-single instruction, 'ps_mul %v0,%v0,%v0'. */
+ asm volatile (".long 0x10000032");
+#elif defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__) || defined(powerpc)
+ /* Altivec instruction, 'vor %v0,%v0,%v0'. */
+ asm volatile (".long 0x10000484");
+#elif defined(__i386__) || defined(__x86_64__)
+ {
+ int a, b, c, d, want_level, want_c, want_d;
+
+ /* Determine what instruction set we've been compiled for, and detect
+ that we're running with it. This allows us to at least do a compile
+ check for, e.g. SSE4.1 when the machine only supports SSE2. */
+# ifdef __XOP__
+ want_level = 0x80000001, want_c = bit_XOP, want_d = 0;
+# elif defined(__AVX__)
+ want_level = 1, want_c = bit_AVX, want_d = 0;
+# elif defined(__SSE4_1__)
+ want_level = 1, want_c = bit_SSE4_1, want_d = 0;
+# elif defined(__SSSE3__)
+ want_level = 1, want_c = bit_SSSE3, want_d = 0;
+# else
+ want_level = 1, want_c = 0, want_d = bit_SSE2;
+# if defined(__sun__) && defined(__svr4__)
+ /* Before Solaris 9 4/04, trying to execute an SSE2 instruction gives
+ SIGILL even if the CPU can handle them. */
+ asm volatile ("unpcklpd %xmm0,%xmm2");
+# endif
+# endif
+
+ if (!__get_cpuid (want_level, &a, &b, &c, &d)
+ || ((c & want_c) | (d & want_d)) == 0)
+ exit (0);
+ }
+#elif defined(__sparc__)
+ asm volatile (".word\t0x81b007c0");
+#elif defined(__arm__)
+ {
+ /* On some processors without NEON support, this instruction may
+ be a no-op, on others it may trap, so check that it executes
+ correctly. */
+ long long a = 0, b = 1;
+ asm ("vorr %P0, %P1, %P2"
+ : "=w" (a)
+ : "0" (a), "w" (b));
+ if (a != 1)
+ exit (0);
+ }
+#endif
+ signal (SIGILL, SIG_DFL);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c
new file mode 100644
index 000000000..b92a7fb7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/unswitch-loops-pr26969.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void
+ruby_re_compile_fastmap (char *fastmap, int options)
+{
+ int j;
+ for (j = 0; j < (1 << 8); j++)
+ {
+ if (j != '\n' || (options & 4))
+ fastmap[j] = 1;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt.c
new file mode 100644
index 000000000..86408160c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_int } */
+
+#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
+#define vector(elcount, type) \
+__attribute__((vector_size((elcount)*sizeof(type)))) type
+
+short k;
+
+int main (int argc, char *argv[]) {
+ k = argc;
+ vector(8, short) v0 = {argc,1,2,3,4,5,6,7};
+ vector(8, short) v2 = {k, k,k,k,k,k,k,k};
+ vector(8, short) r1;
+
+ r1 = v0 >> v2;
+
+ return vidx(short, r1, 0);
+}
+
+/* { dg-final { scan-tree-dump-times ">> k.\[0-9_\]*" 1 "veclower21" } } */
+/* { dg-final { cleanup-tree-dump "veclower21" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt1.c
new file mode 100644
index 000000000..33d3bbbe7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_int } */
+
+#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
+#define vector(elcount, type) \
+__attribute__((vector_size((elcount)*sizeof(type)))) type
+
+short k;
+
+int main (int argc, char *argv[]) {
+ vector(8, short) v0 = {argc,1,2,3,4,5,6,7};
+ vector(8, short) r1;
+
+ r1 = v0 >> (vector(8, short)){2,2,2,2,2,2,2,2};
+
+ return vidx(short, r1, 0);
+}
+
+/* { dg-final { scan-tree-dump-times ">> 2" 1 "veclower21" } } */
+/* { dg-final { cleanup-tree-dump "veclower21" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt2.c
new file mode 100644
index 000000000..397613feb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vec-scal-opt2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_int } */
+
+#define vidx(type, vec, idx) (*((type *) &(vec) + idx))
+#define vector(elcount, type) \
+__attribute__((vector_size((elcount)*sizeof(type)))) type
+
+int main (int argc, char *argv[]) {
+ vector(8, short) v0 = {argc,1,2,3,4,5,6,7};
+ vector(8, short) v1 = {2,2,2,2,2,2,2,2};
+ vector(8, short) r1;
+
+ r1 = v0 >> v1;
+
+ return vidx(short, r1, 0);
+}
+
+/* { dg-final { scan-tree-dump-times ">> 2" 1 "veclower21" } } */
+/* { dg-final { cleanup-tree-dump "veclower21" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-1-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-1-big-array.c
new file mode 100644
index 000000000..4c0f532b4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-1-big-array.c
@@ -0,0 +1,90 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+#define N 128
+
+void fbar (float *);
+void ibar (int *);
+void sbar (short *);
+
+/* multiple loops */
+
+foo (int n)
+{
+ float a[N+1];
+ float b[N];
+ float c[N];
+ float d[N];
+ int ia[N];
+ int ib[N];
+ int ic[N];
+ int i,j;
+ int diff = 0;
+ char cb[N];
+ char cc[N];
+ char image[N][N];
+ char block[N][N];
+
+ /* Vectorizable. */
+ diff = 0;
+ for (i = 0; i < N; i++) {
+ diff += (cb[i] - cc[i]);
+ }
+ ibar (&diff);
+
+
+ /* Vectorizable. */
+ diff = 0;
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ }
+ ibar (&diff);
+
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i];
+ }
+ fbar (a);
+
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i] + d[i];
+ }
+ fbar (a);
+
+
+ /* Strided access. Vectorizable on platforms that support load of strided
+ accesses (extract of even/odd vector elements). */
+ for (i = 0; i < N/2; i++){
+ a[i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+ d[i] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
+ }
+ fbar (a);
+
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i];
+ d[i] = b[i] + c[i];
+ ia[i] = ib[i] + ic[i];
+ }
+ ibar (ia);
+ fbar (a);
+ fbar (d);
+
+ /* Not vetorizable yet (too conservative dependence test). */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i];
+ a[i+1] = b[i] + c[i];
+ }
+ fbar (a);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 6 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 5 loops" 1 "vect" { xfail vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-1.c
new file mode 100644
index 000000000..04392ea78
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-1.c
@@ -0,0 +1,90 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+#define N 16
+
+void fbar (float *);
+void ibar (int *);
+void sbar (short *);
+
+/* multiple loops */
+
+foo (int n)
+{
+ float a[N+1];
+ float b[N];
+ float c[N];
+ float d[N];
+ int ia[N];
+ int ib[N];
+ int ic[N];
+ int i,j;
+ int diff = 0;
+ char cb[N];
+ char cc[N];
+ char image[N][N];
+ char block[N][N];
+
+ /* Vectorizable. */
+ diff = 0;
+ for (i = 0; i < N; i++) {
+ diff += (cb[i] - cc[i]);
+ }
+ ibar (&diff);
+
+
+ /* Vectorizable. */
+ diff = 0;
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ }
+ ibar (&diff);
+
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i];
+ }
+ fbar (a);
+
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i] + d[i];
+ }
+ fbar (a);
+
+
+ /* Strided access. Vectorizable on platforms that support load of strided
+ accesses (extract of even/odd vector elements). */
+ for (i = 0; i < N/2; i++){
+ a[i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+ d[i] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
+ }
+ fbar (a);
+
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i];
+ d[i] = b[i] + c[i];
+ ia[i] = ib[i] + ic[i];
+ }
+ ibar (ia);
+ fbar (a);
+ fbar (d);
+
+ /* Not vetorizable yet (too conservative dependence test). */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i];
+ a[i+1] = b[i] + c[i];
+ }
+ fbar (a);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 6 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 5 loops" 1 "vect" { xfail vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-10-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-10-big-array.c
new file mode 100644
index 000000000..ce6161977
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-10-big-array.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+#include <stdlib.h>
+
+#define N 128
+
+short a[N];
+short d[N];
+
+volatile int y = 0;
+
+int foo ()
+{
+ int i;
+ short b[N];
+ short c[N];
+ for (i = 0; i < N/2; i++)
+ {
+ b[i] = i*3;
+ c[i] = i;
+
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ /* Strided access pattern. */
+ for (i = 0; i < N/2; i++)
+ {
+ a[i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+ d[i] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_strided2 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-10.c
new file mode 100644
index 000000000..faa500d2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-10.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 16
+
+short a[N];
+short d[N];
+
+int foo ()
+{
+ int i;
+ short b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ short c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+ /* Strided access pattern. */
+ for (i = 0; i < N/2; i++)
+ {
+ a[i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+ d[i] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ! vect_strided2 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-100.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-100.c
new file mode 100644
index 000000000..9388084dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-100.c
@@ -0,0 +1,80 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 9
+
+struct extraction
+{
+ int a[N];
+ int b[N];
+};
+
+static int a[N] = {1,2,3,4,5,6,7,8,9};
+static int b[N] = {2,3,4,5,6,7,8,9,0};
+
+__attribute__ ((noinline))
+int main1 () {
+ int i;
+ struct extraction *p;
+
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ /* Vectorizable: alias analysis determines that p can't point to a and/or b. */
+ for (i = 0; i < N; i++)
+ {
+ p->a[i] = a[i];
+ p->b[i] = b[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->a[i] != a[i] || p->b[i] != b[i])
+ abort();
+ }
+
+ return 0;
+}
+
+__attribute__ ((noinline))
+int main2 () {
+ int i;
+ int c[N] = {1,2,3,4,5,6,7,8,9};
+ int d[N] = {2,3,4,5,6,7,8,9,0};
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ /* Vectorizable: c and d are local arrays. */
+ for (i = 0; i < N; i++)
+ {
+ p->a[i] = c[i];
+ p->b[i] = d[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->a[i] != c[i] || p->b[i] != d[i])
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+ main2 ();
+
+ return 0;
+}
+
+/* Requires versioning. */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-103.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-103.c
new file mode 100644
index 000000000..108f56d37
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-103.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 9
+
+struct extraction
+{
+ int a[N];
+ int b[N];
+};
+
+static int a[N] = {1,2,3,4,5,6,7,8,9};
+static int b[N] = {17,24,7,0,2,3,4,31,82};
+static int c[N] = {9,17,24,7,0,2,3,4,31};
+volatile int foo;
+
+__attribute__ ((noinline))
+int main1 (int x, int y) {
+ int i;
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ for (i = 0; i < N; i++)
+ {
+ p->a[i] = a[i];
+ p->b[i] = b[i];
+ if (foo == 135)
+ abort (); /* to avoid vectorization */
+ }
+
+ /* Vectorizable: distance > VF. */
+ for (i = 0; i < N; i++)
+ {
+ *((int *)p + x + i) = *((int *)p + x + i + 8);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->a[i] != c[i])
+ abort();
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ foo = 0;
+ return main1 (0, N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "dependence distance modulo vf == 0" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-104.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-104.c
new file mode 100644
index 000000000..107f5a770
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-104.c
@@ -0,0 +1,70 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 3
+
+struct extraction
+{
+ int a[N][N];
+ int b[N][N];
+};
+
+static int a[N][N] = {{1,2,3},{4,5,6},{7,8,9}};
+static int b[N][N] = {{17,24,7},{0,2,3},{4,31,82}};
+static int c[N][N] = {{1,2,3},{4,5,5},{5,5,5}};
+volatile int foo;
+
+__attribute__ ((noinline))
+int main1 (int x) {
+ int i,j;
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ p->a[i][j] = a[i][j];
+ p->b[i][j] = b[i][j];
+ if (foo == 135)
+ abort (); /* to avoid vectorization */
+ }
+ }
+
+ /* Not vectorizable: distance = 1. */
+ for (i = 1; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ *((int *)p + x + i + j + 1) = *((int *)p + x + i + j);
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (p->a[i][j] != c[i][j])
+ abort();
+ }
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ foo = 0;
+ return main1 (N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-105-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-105-big-array.c
new file mode 100644
index 000000000..f99a2afd7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-105-big-array.c
@@ -0,0 +1,106 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct extraction
+{
+ int a[N][N];
+ int b[N][N];
+};
+
+static int a[N][N];
+static int b[N][N];
+static int c[N][N];
+
+volatile int y;
+
+__attribute__ ((noinline))
+int main1 (int x) {
+ int i,j, off;
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ a[i][j] = (i*7 + j*17)%53;
+ b[i][j] = (i*11+ j*13)%41;
+ if (y)
+ abort (); /* to avoid vectorization. */
+ }
+ }
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ c[i][j] = a[i][j];
+ if (y)
+ abort (); /* to avoid vectorization. */
+ }
+ }
+ for (i = 1; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ off = x + i + j + N+1;
+ if (x + i + j > N*N-1)
+ break;
+ if (off > N*N-1)
+ *(&c[0][0]+x+i+j) = *(&b[0][0] + off - N*N);
+ else
+ *(&c[0][0]+x+i+j) = *(&a[0][0] + off);
+ if (y)
+ abort (); /* to avoid vectorization. */
+ }
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ p->a[i][j] = a[i][j];
+ p->b[i][j] = b[i][j];
+ /* Because Y is volatile, the compiler cannot move this check out
+ of the loop. */
+ if (y)
+ abort (); /* to avoid vectorization. */
+ }
+ }
+
+ /* Vectorizable: distance > number of iterations. */
+ for (i = 1; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ *((int *)p + x + i + j) = *((int *)p + x + i + j + N+1);
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (p->a[i][j] != c[i][j])
+ abort ();
+ }
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-105.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-105.c
new file mode 100644
index 000000000..bbf42af89
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-105.c
@@ -0,0 +1,72 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 4
+
+struct extraction
+{
+ int a[N][N];
+ int b[N][N];
+};
+
+static int a[N][N] = {{1,2,3,11},{4,5,6,12},{7,8,9,13},{34,45,67,83}};
+static int b[N][N] = {{17,28,15,23},{0,2,3,24},{4,31,82,25},{29,31,432,256}};
+static int c[N][N] = {{1,2,3,11},{4,9,13,34},{45,67,83,13},{34,45,67,83}};
+
+volatile int y;
+
+__attribute__ ((noinline))
+int main1 (int x) {
+ int i,j;
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ p->a[i][j] = a[i][j];
+ p->b[i][j] = b[i][j];
+ /* Because Y is volatile, the compiler cannot move this check out
+ of the loop. */
+ if (y)
+ abort (); /* to avoid vectorization */
+ }
+ }
+
+ /* Vectorizable: distance > number of iterations. */
+ for (i = 1; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ *((int *)p + x + i + j) = *((int *)p + x + i + j + 5);
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (p->a[i][j] != c[i][j])
+ abort();
+ }
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-106.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-106.c
new file mode 100644
index 000000000..d578d8143
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-106.c
@@ -0,0 +1,73 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 9
+
+static int a[N] = {1,2,3,4,5,6,7,8,9};
+static int b[N] = {2,3,4,5,6,7,8,9,0};
+
+__attribute__ ((noinline))
+int main1 () {
+ int i;
+ int *p, *q, *p1, *q1;
+ p = (unsigned int *) malloc (sizeof (unsigned int) * N);
+ q = (unsigned int *) malloc (sizeof (unsigned int) * N);
+
+ p1 = p; q1 = q;
+
+ /* Vectorizable, before pointer plus we would get a redundant cast
+ (caused by pointer arithmetics), alias analysis fails to distinguish
+ between the pointers. */
+ for (i = 0; i < N; i++)
+ {
+ *(q + i) = a[i];
+ *(p + i) = b[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (*q != a[i] || *p != b[i])
+ abort();
+ q++;
+ p++;
+ }
+
+ q = q1;
+ p = p1;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ *q = b[i];
+ *p = a[i];
+ q++;
+ p++;
+ }
+
+ q = q1;
+ p = p1;
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (*q != b[i] || *p != a[i])
+ abort();
+ q++;
+ p++;
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-107.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-107.c
new file mode 100644
index 000000000..0053b3321
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-107.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ float a[N];
+
+ /* Strided access. Vectorizable on platforms that support load of strided
+ accesses (extract of even/odd vector elements). */
+ for (i = 0; i < N/2; i++)
+ {
+ a[i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+ d[i] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
+ }
+
+ /* Check results. */
+ for (i = 0; i < N/2; i++)
+ {
+ if (a[i] != b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i]
+ || d[i] != b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i])
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-108.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-108.c
new file mode 100644
index 000000000..28e85b2e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-108.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ia[N];
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+
+ /* This loop is vectorized on platforms that support vect_int_mult. */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] * ic[i];
+ }
+
+ /* Check results. */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i] * ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-109.c
new file mode 100644
index 000000000..854c9707a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-109.c
@@ -0,0 +1,79 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+short sa[N];
+short sc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+short sb[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+int ia[N];
+int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline))
+int main1 (int n)
+{
+ int i;
+
+ /* Multiple types with different sizes, used in idependent
+ copmutations. Vectorizable. */
+ for (i = 0; i < n; i++)
+ {
+ sa[i+2] = sb[i] + sc[i];
+ ia[i+1] = ib[i] + ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (sa[i+2] != sb[i] + sc[i] || ia[i+1] != ib[i] + ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main2 (int n)
+{
+ int i;
+
+ /* Multiple types with different sizes, used in idependent
+ copmutations. Vectorizable. */
+ for (i = 0; i < n; i++)
+ {
+ ia[i+1] = ib[i] + ic[i];
+ sa[i] = sb[i] + sc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (sa[i] != sb[i] + sc[i] || ia[i+1] != ib[i] + ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N-2);
+ main2 (N-1);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-11.c
new file mode 100644
index 000000000..3df8f47b5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-11.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int ia[N];
+int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ /* Not vectorizable yet (integer mult). */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] * ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i] * ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-110.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-110.c
new file mode 100644
index 000000000..b62ad94fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-110.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+static __attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ float a[N];
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+ /* Too conservative dependence test. */
+ for (i = 0; i < N - 1; i++){
+ a[i] = b[i] + c[i];
+ a[i+1] = b[i] + c[i];
+ }
+
+ /* Check results. */
+ for (i = 0; i < N - 1; i++){
+ if (a[i] != b[i] + c[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-112-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-112-big-array.c
new file mode 100644
index 000000000..a1302c1e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-112-big-array.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+char cb[N];
+char cc[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ int diff = 0;
+ int check_diff = 0;
+ for (i = 0; i < N; i++) {
+ cb[i] = i + 2;
+ cc[i] = i + 1;
+ check_diff += (cb[i] - cc[i]);
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ /* Cross-iteration cycle. */
+ diff = 0;
+ for (i = 0; i < N; i++) {
+ diff += (cb[i] - cc[i]);
+ }
+
+ /* Check results. */
+ if (diff != check_diff)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-112.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-112.c
new file mode 100644
index 000000000..4d954d108
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-112.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+char cb[N] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
+char cc[N] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ int diff = 0;
+
+ /* Cross-iteration cycle. */
+ diff = 0;
+ for (i = 0; i < N; i++) {
+ diff += (cb[i] - cc[i]);
+ }
+
+ /* Check results. */
+ if (diff != 16)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-113.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-113.c
new file mode 100644
index 000000000..0d36c16c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-113.c
@@ -0,0 +1,36 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ float a[N];
+
+ /* Induction and type conversion. */
+ for ( i = 0; i < N; i++)
+ {
+ a[i] = i;
+ }
+
+ for ( i = 0; i < N; i++)
+ {
+ if (a[i] != i)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-114.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-114.c
new file mode 100644
index 000000000..3d43a7cd4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-114.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ float a[N];
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+ /* Reverse access and forward access. */
+ for (i = N; i > 0; i--)
+ {
+ a[N-i] = b[i-1];
+ }
+
+ /* Check results. */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != b[N-1-i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target { ! { vect_perm } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-115.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-115.c
new file mode 100644
index 000000000..ce6eaf454
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-115.c
@@ -0,0 +1,77 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct s{
+ int b[N];
+ int c[N];
+ int m;
+};
+
+struct t{
+ struct s strc_s;
+ int m;
+};
+
+struct test1{
+ struct t strc_t;
+ struct t *ptr_t;
+ int k;
+ int l;
+};
+
+int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ struct test1 tmp1;
+ struct t tmp2;
+
+ tmp1.ptr_t = &tmp2;
+
+ /* DR bases comparison: record and array. */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.strc_t.strc_s.b[i] = a[i];
+ }
+
+ /* Check results. */
+ for (i = 0; i < N; i++)
+ {
+ if (tmp1.strc_t.strc_s.b[i] != a[i])
+ abort();
+ }
+
+ /* DR bases comparison: record containing ptr and array. */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.ptr_t->strc_s.c[i] = a[i];
+ }
+
+ /* Check results. */
+ for (i = 0; i < N; i++)
+ {
+ if (tmp1.ptr_t->strc_s.c[i] != a[i])
+ abort();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-116.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-116.c
new file mode 100644
index 000000000..f59e8abf9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-116.c
@@ -0,0 +1,33 @@
+/* { dg-require-effective-target vect_int } */
+/* Assuming we can vectorize char multiplication, here's an execute test. */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+extern void abort (void);
+
+__attribute__ ((noinline))
+void foo()
+{
+ static unsigned char A[256], B[256], C[256];
+ int i;
+
+ for (i = 0; i < 256; ++i)
+ A[i] = B[i] = i;
+
+ for (i = 0; i < 256; ++i)
+ C[i] = A[i] * B[i];
+
+ for (i = 0; i < 256; ++i)
+ if (C[i] != (unsigned char)(i * i))
+ abort ();
+}
+
+int main()
+{
+ check_vect ();
+ foo();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-117.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-117.c
new file mode 100644
index 000000000..920e29314
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-117.c
@@ -0,0 +1,66 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 5
+
+static int a[N][N] = {{ 1, 2, 3, 4, 5},
+ { 6, 7, 8, 9,10},
+ {11,12,13,14,15},
+ {16,17,18,19,20},
+ {21,22,23,24,25}};
+
+static int c[N][N] = {{ 1, 2, 3, 4, 5},
+ { 7, 9,11, 13,15},
+ {18,21,24,27,30},
+ {34,38,42,46,50},
+ {55,60,65,70,75}};
+
+volatile int foo;
+
+__attribute__ ((noinline))
+int main1 (int A[N][N], int n)
+{
+
+ int i,j;
+
+ /* vectorizable */
+ for (i = 1; i < N; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ A[i][j] = A[i-1][j] + A[i][j];
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i,j;
+
+ check_vect ();
+
+ foo = 0;
+ main1 (a, N);
+
+ /* check results: */
+
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (a[i][j] != c[i][j])
+ abort();
+ }
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-118.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-118.c
new file mode 100644
index 000000000..bc08e9108
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-118.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+void f(short * __restrict__ a, short * __restrict__ b, short * __restrict__ x)
+{
+ int i;
+ for (i=0;i<1024;i++)
+ x[i] = a[i] + b[i];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-119.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-119.c
new file mode 100644
index 000000000..6a91029a5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-119.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define OUTER 32
+#define INNER 40
+
+static unsigned int
+bar (const unsigned int x[INNER][2], unsigned int sum)
+{
+ int i;
+
+ for (i = 0; i < INNER; i++)
+ sum += x[i][0] * x[i][0] + x[i][1] * x[i][1];
+ return sum;
+}
+
+unsigned int foo (const unsigned int x[OUTER][INNER][2])
+{
+ int i;
+ unsigned int sum;
+
+ sum = 0.0f;
+ for (i = 0; i < OUTER; i++)
+ sum = bar (x[i], sum);
+ return sum;
+}
+
+/* { dg-final { scan-tree-dump-times "Detected interleaving of size 2" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-11a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-11a.c
new file mode 100644
index 000000000..2da903b1b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-11a.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+extern void abort (void);
+
+unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
+ 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
+unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
+ 0x08000000,0x08000001,0xff0000ff,0xf0000001};
+unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001,
+ 0,0xf7ffffff,0x0200fe01,0xe0000001};
+unsigned int C[8];
+
+__attribute__ ((noinline))
+void u ()
+{
+ int i, j;
+
+ for (i=0; i<8; i++)
+ C[i] = A[i] * B[i];
+ for (i=0; i<8; i++)
+ if (C[i] != Answer[i])
+ abort ();
+}
+
+signed int D[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
+ 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
+signed int E[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
+ 0x08000000,0x08000001,0xff0000ff,0xf0000001};
+signed int Dnswer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001,
+ 0,0xf7ffffff,0x0200fe01, 0xe0000001};
+signed int F[8];
+
+__attribute__ ((noinline))
+void s()
+{
+ int i, j;
+
+ for (i=0; i<8; i++)
+ F[i] = D[i] * E[i];
+ for (i=0; i<8; i++)
+ if (F[i] != Dnswer[i])
+ abort ();
+}
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ u();
+ s();
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-12.c
new file mode 100644
index 000000000..80a08c802
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-12.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int ia[N];
+ int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ short sa[N];
+ short sc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+ /* Multiple types with different nunits in vector. */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] + ic[i];
+ sa[i] = sb[i] + sc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i] + ic[i] || sa[i] != sb[i] + sc[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-120.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-120.c
new file mode 100644
index 000000000..1b3c5d49c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-120.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_floatint_cvt } */
+
+static inline float
+i2f(int x)
+{
+ union { float f; int i; } tmp;
+ tmp.i=x;
+ return tmp.f;
+}
+static inline float
+vect_ldexpf(float x, int n)
+{
+ n = (n+0x7f)<<23;
+ return x * i2f(n);
+}
+
+float __attribute__ ((aligned(16))) a[1024];
+float __attribute__ ((aligned(16))) b[1024];
+float __attribute__ ((aligned(16))) c[1024];
+
+void
+tV()
+{
+ int i;
+ for (i=0; i!=1024; ++i)
+ {
+ float z = a[i];
+ int n = b[i];
+ c[i] = vect_ldexpf(z,n);
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-121.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-121.c
new file mode 100644
index 000000000..9071836c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-121.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+float *x;
+float parm;
+float
+test (int start, int end)
+{
+ int i;
+ for (i = start; i < end; ++i)
+ {
+ float tem = x[i];
+ x[i] = parm * tem;
+ }
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-122.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-122.c
new file mode 100644
index 000000000..4cbdd0f72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-122.c
@@ -0,0 +1,59 @@
+#include "tree-vect.h"
+
+#ifndef N
+#define N 64
+#endif
+
+char a[N];
+float b[N];
+long long l[N], m[N];
+
+__attribute__((noinline, noclone)) int
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ a[i] = i;
+}
+
+__attribute__((noinline, noclone)) int
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ b[i] = (double) i;
+}
+
+__attribute__((noinline, noclone)) int
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ l[i] = (long long) i * (i + 7);
+}
+
+__attribute__((noinline, noclone)) int
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ m[i] = (long long) i * 7;
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+ f1 ();
+ f2 ();
+ f3 ();
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (a[i] != i || b[i] != i || l[i] != i * (i + 7LL) || m[i] != i * 7LL)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-123.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-123.c
new file mode 100644
index 000000000..5a2f32509
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-123.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int x[4092];
+int y[1024];
+
+void foo (int s)
+{
+ int i, j;
+ for (i = 0, j = 0; j < 1023; i += s, j++)
+ y[j] += x[i];
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-124.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-124.c
new file mode 100644
index 000000000..f659b94ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-124.c
@@ -0,0 +1,30 @@
+#include "tree-vect.h"
+
+#ifndef N
+#define N 64
+#endif
+
+int a[N];
+
+__attribute__((noinline, noclone)) void
+foo (int x)
+{
+ int i;
+ for (i = 0; i < N; i++, x += 3)
+ a[i] = x;
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+ foo (6);
+ for (i = 0; i < N; i++)
+ if (a[i] != i * 3 + 6)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-13.c
new file mode 100644
index 000000000..ba8665bdc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-13.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int a[N];
+int results[N] = {0,1,2,3,0,0,0,0,0,0,0,0,12,13,14,15};
+int b[N] = {0,1,2,3,-4,-5,-6,-7,-8,-9,-10,-11,12,13,14,15};
+
+__attribute__ ((noinline))
+int main1()
+{
+ int i;
+
+ /* Max pattern. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (b[i] >= 0 ? b[i] : 0);
+ }
+
+ /* Check results */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != results[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-14.c
new file mode 100644
index 000000000..35e48cc36
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-14.c
@@ -0,0 +1,37 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int ia[N];
+
+ /* Induction. */
+ for ( i = 0; i < N; i++) {
+ ia[i] = i;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != i)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-15-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-15-big-array.c
new file mode 100644
index 000000000..912907d8c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-15-big-array.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int a[N];
+ int b[N];
+
+ for (i = 0; i <N; i++)
+ {
+ b[i] = i*3;
+ if (y)
+ abort ();
+ }
+
+ /* Not vectorizable yet (reverse access and forward access). */
+ for (i = N; i > 0; i--)
+ {
+ a[N-i] = b[i-1];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != b[N-1-i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm && vect_hw_misalign } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-15.c
new file mode 100644
index 000000000..ba7599162
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-15.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int a[N];
+ int b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+ /* Not vectorizable yet (reverse access and forward access). */
+ for (i = N; i > 0; i--)
+ {
+ a[N-i] = b[i-1];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != b[N-1-i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_perm && vect_hw_misalign } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-17.c
new file mode 100644
index 000000000..7c675fced
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-17.c
@@ -0,0 +1,129 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ int ic[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char ca[N];
+ char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char cc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] & ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != (ib[i] & ic[i]))
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i] & cc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ca[i] != (cb[i] & cc[i]))
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = sb[i] & sc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != (sb[i] & sc[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-18.c
new file mode 100644
index 000000000..8a2baab3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-18.c
@@ -0,0 +1,128 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+ int ic[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char ca[N];
+ char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char cc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = (ib[i] | ic[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != (ib[i] | ic[i]))
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = (cb[i] | cc[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != (cb[i] | cc[i]))
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = (sb[i] | sc[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != (sb[i] | sc[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-19.c
new file mode 100644
index 000000000..df2166a58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-19.c
@@ -0,0 +1,128 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+ int ic[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char ca[N];
+ char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char cc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] ^ ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != (ib[i] ^ ic[i]))
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i] ^ cc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ca[i] != (cb[i] ^ cc[i]))
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = sb[i] ^ sc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != (sb[i] ^ sc[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-2-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-2-big-array.c
new file mode 100644
index 000000000..255027004
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-2-big-array.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+char cb[N];
+char ca[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ cb[i] = i*3;
+ /* To avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-2.c
new file mode 100644
index 000000000..f01b7b46d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-2.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+char ca[N] = {};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-20.c
new file mode 100644
index 000000000..deed2da44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-20.c
@@ -0,0 +1,100 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ signed char ca[N];
+ signed char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ~ib[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != ~ib[i])
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = ~cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ca[i] != ~cb[i])
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = ~sb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != ~sb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_bitwise } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-21.c
new file mode 100644
index 000000000..28fc72ae7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-21.c
@@ -0,0 +1,129 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+ int ic[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char ca[N];
+ char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char cc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = !ib[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != !ib[i])
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = !cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ca[i] != !cb[i])
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = !sb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != !sb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target vect_condition } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-22.c
new file mode 100644
index 000000000..369fab112
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-22.c
@@ -0,0 +1,126 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ signed char ca[N];
+ signed char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ float fa[N];
+ float fb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = -ib[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != -ib[i])
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = -cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ca[i] != -cb[i])
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = -sb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != -sb[i])
+ abort ();
+ }
+
+ /* Check floats. */
+
+ for (i = 0; i < N; i++)
+ {
+ fa[i] = -fb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (fa[i] != -fb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-23.c
new file mode 100644
index 000000000..7991bb2d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-23.c
@@ -0,0 +1,128 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+ int ic[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char ca[N];
+ char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char cc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] && ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != ib[i] && ic[i])
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i] && cc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ca[i] != cb[i] && cc[i])
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = sb[i] && sc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != sb[i] && sc[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-24.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-24.c
new file mode 100644
index 000000000..c1ae6b702
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-24.c
@@ -0,0 +1,128 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ int ia[N];
+ int ib[N]=
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+ int ic[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char ca[N];
+ char cb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ char cc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sa[N];
+ short sb[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ short sc[N] =
+ {1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0,
+ 1,1,0,0,1,0,1,0};
+
+ /* Check ints. */
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = (ib[i] || ic[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ia[i] != (ib[i] || ic[i]))
+ abort ();
+ }
+
+ /* Check chars. */
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = (cb[i] || cc[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (ca[i] != (cb[i] || cc[i]))
+ abort ();
+ }
+
+ /* Check shorts. */
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = (sb[i] || sc[i]);
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (sa[i] != (sb[i] || sc[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-25.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-25.c
new file mode 100644
index 000000000..769df4f4f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-25.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline))
+int main1 (int n, int *p)
+{
+ int i;
+ int ib[N];
+ int ia[N];
+ int k;
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = n;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != n)
+ abort ();
+ }
+
+ k = *p;
+ for (i = 0; i < N; i++)
+ {
+ ib[i] = k;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ib[i] != k)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int m = 8;
+
+ check_vect ();
+
+ return main1 (m, &m);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-26.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-26.c
new file mode 100644
index 000000000..bec111b69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-26.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+/* unaligned store. */
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int ia[N+1];
+
+ for (i = 1; i <= N; i++)
+ {
+ ia[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-27.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-27.c
new file mode 100644
index 000000000..4a2da227e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-27.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+/* unaligned load. */
+
+int ia[N];
+int ib[N+1];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i=0; i <= N; i++)
+ {
+ ib[i] = i;
+ }
+
+ for (i = 1; i <= N; i++)
+ {
+ ia[i-1] = ib[i];
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i-1] != ib[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* The initialization induction loop (with aligned access) is also vectorized. */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-28.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-28.c
new file mode 100644
index 000000000..794a7c8f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-28.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+#define OFF 3
+
+/* unaligned store. */
+
+__attribute__ ((noinline))
+int main1 (int off)
+{
+ int i;
+ int ia[N+OFF];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i+off] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i+off] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (0); /* aligned */
+ main1 (OFF); /* unaligned */
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-29.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-29.c
new file mode 100644
index 000000000..0ad284880
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-29.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+#define OFF 3
+
+/* unaligned load. */
+
+int ia[N];
+int ib[N+OFF];
+
+__attribute__ ((noinline))
+int main1 (int off)
+{
+ int i;
+
+ for (i = 0; i < N+OFF; i++)
+ {
+ ib[i] = i;
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+off];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+off])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (0); /* aligned */
+ main1 (OFF); /* unaligned */
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the load.
+ (The store is aligned). */
+
+/* The initialization induction loop (with aligned access) is also vectorized. */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" {target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-3.c
new file mode 100644
index 000000000..d494deb85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-3.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 20
+
+float a[N];
+float e[N];
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ia[N];
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = b[i] + c[i] + d[i];
+ e[i] = b[i] + c[i] + d[i];
+ ia[i] = ib[i] + ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ float fres = b[i] + c[i] + d[i];
+ int ires = ib[i] + ic[i];
+ if (a[i] != fres || e[i] != fres || ia[i] != ires)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-30.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-30.c
new file mode 100644
index 000000000..408cbca4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-30.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+float a[N];
+float c[N];
+
+__attribute__ ((noinline))
+int main1 (int n)
+{
+ int i=0;
+
+ /* Vectorized: unknown loop bound. */
+ while (n--) {
+ a[i] = b[i];
+ i++;
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (a[i] != b[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+__attribute__ ((noinline))
+int main2 (unsigned int n)
+{
+ int i=0;
+ int nn = n;
+
+ /* Vectorized: unknown loop bound. */
+ while (n--) {
+ c[i] = b[i];
+ i++;
+ }
+
+ /* check results: */
+ for (i = 0; i < nn; i++)
+ {
+ if (c[i] != b[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N);
+ main2 (N);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-31-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-31-big-array.c
new file mode 100644
index 000000000..25d7fdf2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-31-big-array.c
@@ -0,0 +1,90 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.b[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.b[i] != 5)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.c[i] = 6;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.c[i] != 6)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.d.k[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.d.k[i] != 7)
+ abort ();
+ }
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.e.k[i] = 8;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.e.k[i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-31.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-31.c
new file mode 100644
index 000000000..8719fc9d2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-31.c
@@ -0,0 +1,90 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+struct t{
+ int k[N];
+ int l;
+};
+
+struct s{
+ char a; /* aligned */
+ char b[N-1]; /* unaligned (offset 1B) */
+ char c[N]; /* aligned (offset NB) */
+ struct t d; /* aligned (offset 2NB) */
+ struct t e; /* unaligned (offset 2N+4N+4 B) */
+};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ struct s tmp;
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.b[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.b[i] != 5)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.c[i] = 6;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.c[i] != 6)
+ abort ();
+ }
+
+ /* aligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.d.k[i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.d.k[i] != 7)
+ abort ();
+ }
+
+ /* unaligned */
+ for (i = 0; i < N/2; i++)
+ {
+ tmp.e.k[i] = 8;
+ }
+
+ /* check results: */
+ for (i = 0; i <N/2; i++)
+ {
+ if (tmp.e.k[i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-32-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-32-big-array.c
new file mode 100644
index 000000000..774a0b055
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-32-big-array.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ struct {
+ char ca[N];
+ } s;
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-32.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-32.c
new file mode 100644
index 000000000..c869f5ec9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-32.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ struct {
+ char ca[N];
+ } s;
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-33-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-33-big-array.c
new file mode 100644
index 000000000..2fc7106b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-33-big-array.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+struct test {
+ char ca[N];
+};
+
+extern struct test s;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target vector_alignment_reachable } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-33.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-33.c
new file mode 100644
index 000000000..43daaa807
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-33.c
@@ -0,0 +1,44 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+struct test {
+ char ca[N];
+};
+
+extern struct test s;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" { target vector_alignment_reachable } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-34-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-34-big-array.c
new file mode 100644
index 000000000..9041bd6e1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-34-big-array.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+struct {
+ char ca[N];
+} s;
+char cb[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ cb[i] = i*3;
+ /* To avoid vectorization. */
+ if (y)
+ abort ();
+ }
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-34.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-34.c
new file mode 100644
index 000000000..df18f774e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-34.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct {
+ char ca[N];
+} s;
+char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-35-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-35-big-array.c
new file mode 100644
index 000000000..73b18cf62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-35-big-array.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ union {
+ unsigned char a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ unsigned char b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ } s;
+ int i;
+
+ /* Initialization. */
+ for (i = 0; i < N; i++)
+ {
+ s.b[i] = i;
+ }
+
+ /* Dependence analysis fails cause s.a and s.b may overlap.
+ Use runtime aliasing test with versioning. */
+ for (i = 0; i < N; i++)
+ {
+ s.a[i] = s.b[i] + 1;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.a[i] != i + 1)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail { ia64-*-* sparc*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "can't determine dependence between" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-35.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-35.c
new file mode 100644
index 000000000..63fc8c819
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-35.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ union {
+ unsigned char a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ unsigned char b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ } s;
+ int i;
+
+ /* Initialization. */
+ for (i = 0; i < N; i++)
+ {
+ s.b[i] = i;
+ }
+
+ /* Dependence analysis fails cause s.a and s.b may overlap.
+ Use runtime aliasing test with versioning. */
+ for (i = 0; i < N; i++)
+ {
+ s.a[i] = s.b[i] + 1;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.a[i] != i + 1)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail { ia64-*-* sparc*-*-* } } } } */
+/* { dg-final { scan-tree-dump "can't determine dependence between" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-36-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-36-big-array.c
new file mode 100644
index 000000000..8f2514db2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-36-big-array.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ struct {
+ char ca[N];
+ char cb[N];
+ } s;
+
+
+ for (i = 0; i < N; i++)
+ {
+ s.cb[i] = 3*i;
+ __asm__ volatile ("");
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = s.cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != s.cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-36.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-36.c
new file mode 100644
index 000000000..20df3940a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-36.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ struct {
+ char ca[N];
+ char cb[N];
+ } s;
+
+
+ for (i = 0; i < N; i++)
+ {
+ s.cb[i] = 3*i;
+ __asm__ volatile ("");
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = s.cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != s.cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-38.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-38.c
new file mode 100644
index 000000000..8df8b5c9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-38.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+double cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+double ca[N];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-4.c
new file mode 100644
index 000000000..d86fea11e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-4.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 20
+
+float a[N];
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = b[i] * c[i];
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != b[i] * c[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-40.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-40.c
new file mode 100644
index 000000000..269b08955
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-40.c
@@ -0,0 +1,63 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Aligned pointer accesses.
+ The loop bound is known and divisible by the vectorization factor.
+ No aliasing problems.
+ vect-46.c is similar to this one with one difference:
+ the loop bound is unknown. */
+
+float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)))
+ = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)))
+ = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float *pa = a;
+ float *pb = b;
+ float *pc = c;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ main1 ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-42.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-42.c
new file mode 100644
index 000000000..31810817b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-42.c
@@ -0,0 +1,72 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned write access, aligned read accesses.
+ Since we are handling an unaligned store by peeling the loop,
+ the loads will become unaligned.
+ The loop bound is known and divisible by the vectorization factor.
+ No aliasing problems. */
+
+__attribute__ ((noinline)) int
+main1 (float * __restrict__ pa, float *pb, float *pc)
+{
+ float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ int i;
+
+ /* We also vectorize this loop. */
+ for (i = 0; i < N; i++)
+ {
+ b[i] = pb[i];
+ c[i] = pc[i];
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = b[i] * c[i];
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (a,b,c);
+ bar (a,b,c);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_element_align } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_element_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { { ! vector_alignment_reachable } || vect_element_align } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-44.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-44.c
new file mode 100644
index 000000000..ef1a4635b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-44.c
@@ -0,0 +1,72 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer accesses, with unknown alignment.
+ The loop bound is known and divisible by the vectorization factor.
+ No aliasing problems.
+ vect-50.c is similar to this one with one difference:
+ the loop bound is unknown.
+ vect-45.c is similar to this one with one difference:
+ can't prove that pointers don't alias. */
+
+__attribute__ ((noinline)) int
+main1 (float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69};
+ float c[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
+
+ check_vect ();
+
+ main1 (a,b,c);
+ main1 (&a[1],b,c);
+ main1 (a,&b[1],c);
+ main1 (&a[1],&b[1],&c[1]);
+
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the
+ all three accesses (peeling to align the store will not force the
+ two loads to be aligned). */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {{! vect_no_align} && {! vect_hw_misalign} } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-46.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-46.c
new file mode 100644
index 000000000..26e0e520b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-46.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort();
+ }
+
+ return;
+}
+
+/* Aligned pointer accesses.
+ The loop bound is unknown.
+ No aliasing problems.
+ vect-40.c is similar to this one with one difference:
+ the loop bound is known. */
+
+float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)))
+ = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)))
+ = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+__attribute__ ((noinline)) int
+main1 (int n)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float *pa = a;
+ float *pb = b;
+ float *pc = c;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ int n=N;
+ check_vect ();
+ main1 (n);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-48.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-48.c
new file mode 100644
index 000000000..d2eed3a6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-48.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+/* Unaligned pointer read accesses, aligned write access.
+ The loop bound is known and divisible by the vectorization factor.
+ No aliasing problems.
+ vect-56.c is similar to this one with one difference:
+ the alignment of the read accesses is known.
+ vect-52.c is similar to this one with one difference:
+ the loop bound is unknown.
+ vect-49.c is similar to this one with one difference:
+ aliasing is a problem. */
+
+__attribute__ ((noinline)) int
+main1 (float *pb, float *pc)
+{
+ float pa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float b[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
+ float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (b,c);
+ main1 (&b[1],c);
+
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the two loads.
+ (The store is aligned). */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-5.c
new file mode 100644
index 000000000..b5938ceae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-5.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float a[N];
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+
+ i = 0;
+ j = 0;
+ while (i < 5*N)
+ {
+ a[j] = c[j];
+ i += 5;
+ j++;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != c[i])
+ abort ();
+ }
+
+
+ for (i = N; i > 0; i--)
+ {
+ a[N-i] = d[N-i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != d[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-50.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-50.c
new file mode 100644
index 000000000..068c804a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-50.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return;
+}
+
+__attribute__ ((noinline)) int
+main1 (int n, float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ bar (pa,pb,pc);
+
+ return 0;
+}
+
+/* Unaligned pointer accesses, with unknown alignment.
+ The loop bound is unknown.
+ No aliasing problems.
+ vect-44.c is similar to this one with one difference:
+ the loop bound is known.
+ vect-51.c is similar to this one with one difference:
+ can't prove that pointers don't alias. */
+
+int main (void)
+{
+ int i;
+ float a[N];
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (N,a,b,c);
+ return 0;
+}
+
+/* For targets that don't support misaligned loads and don't support
+ misaligned stores we version for the all three accesses (peeling to
+ align the store will not force the two loads to be aligned). */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && { {! vect_no_align } && {! vect_hw_misalign } } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-52.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-52.c
new file mode 100644
index 000000000..69c097966
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-52.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+/* Unaligned pointer read accesses, aligned write access.
+ The loop bound is unknown.
+ No aliasing problems.
+ vect-60.c is similar to this one with one difference:
+ the alignment of the read accesses is known.
+ vect-48.c is similar to this one with one difference:
+ the loop bound is known.
+ vect-53.c is similar to this one with one difference:
+ aliasing is a problem. */
+
+__attribute__ ((noinline)) int
+main1 (int n, float *pb, float *pc)
+{
+ float pa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60};
+ float c[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
+
+ check_vect ();
+
+ main1 (N,&b[1],c);
+ main1 (N,&b[1],&c[1]);
+
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the two loads.
+ (The store is aligned). */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-54.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-54.c
new file mode 100644
index 000000000..d563cc34b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-54.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (pa[i+1] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer accesses, with a known alignment.
+ The loop bound is known and divisible by the vectorization factor.
+ No aliasing problems.
+ vect-58.c is similar to this one with one difference:
+ the loop bound is unknown. */
+
+float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float *pa = a;
+ float *pb = b;
+ float *pc = c;
+
+ for (i = 0; i < N/2; i++)
+ {
+ pa[i+1] = pb[i+1] * pc[i+1];
+ }
+
+ bar (a,b,c);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-56.c
new file mode 100644
index 000000000..5a8130b11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-56.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (pa[i] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer read accesses, aligned write access.
+ The loop bound is known and divisible by the vectorization factor.
+ No aliasing problems.
+ vect-48.c is similar to this one with one difference:
+ the alignment of the read accesses is unknown.
+ vect-60.c is similar to this one with one difference:
+ the loop bound is unknown.
+ vect-57.c is similar to this one with two differences:
+ aliasing is a problem, and the write access has unknown alignment. */
+
+float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float *pa = a;
+ float *pb = b;
+ float *pc = c;
+
+ for (i = 0; i < N/2; i++)
+ {
+ pa[i] = pb[i+1] * pc[i+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (pa[i] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-58.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-58.c
new file mode 100644
index 000000000..fa8c91b30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-58.c
@@ -0,0 +1,63 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (pa[i+1] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer accesses, with a known alignment.
+ The loop bound is unknown.
+ No aliasing problems.
+ vect-54.c is similar to this one with one difference:
+ the loop bound is known. */
+
+float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57}; float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+__attribute__ ((noinline)) int
+main1 (int n)
+{
+ int i;
+ float *pa = a;
+ float *pb = b;
+ float *pc = c;
+
+ for (i = 0; i < n/2; i++)
+ {
+ pa[i+1] = pb[i+1] * pc[i+1];
+ }
+
+ bar (a,b,c);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ int n=N;
+
+ check_vect ();
+ main1 (n);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-6-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-6-big-array.c
new file mode 100644
index 000000000..11b7fe2a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-6-big-array.c
@@ -0,0 +1,80 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+float results1[N];
+float results2[N];
+float a[N] = {0};
+float e[N] = {0};
+float b[N];
+float c[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i=0; i<N; i++)
+ {
+ b[i] = i*3;
+ c[i] = i;
+ results1[i] = 0;
+ results2[i] = 0;
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+ for (i=0; i<N/2; i++)
+ {
+ results1[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
+ results2[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ for (i = 0; i < N/2; i++)
+ {
+ a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
+ e[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
+ }
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ if (a[i] != results1[i] || e[i] != results2[i])
+ abort ();
+ }
+
+
+ for (i = 1; i <=N-4; i++)
+ {
+ a[i+3] = b[i-1];
+ }
+
+ /* check results: */
+ for (i = 1; i <=N-4; i++)
+ {
+ if (a[i+3] != b[i-1])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-6.c
new file mode 100644
index 000000000..76117146b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-6.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float results1[N] = {192.00,240.00,288.00,336.00,384.00,432.00,480.00,528.00,0.00};
+float results2[N] = {0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,54.00,120.00,198.00,288.00,390.00,504.00,630.00};
+float a[N] = {0};
+float e[N] = {0};
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N/2; i++)
+ {
+ a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
+ e[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
+ }
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ if (a[i] != results1[i] || e[i] != results2[i])
+ abort();
+ }
+
+
+ for (i = 1; i <=N-4; i++)
+ {
+ a[i+3] = b[i-1];
+ }
+
+ /* check results: */
+ for (i = 1; i <=N-4; i++)
+ {
+ if (a[i+3] != b[i-1])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-60.c
new file mode 100644
index 000000000..838a9bca4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-60.c
@@ -0,0 +1,76 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (pa[i] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return;
+}
+
+/* Unaligned pointer read accesses, aligned write access.
+ The loop bound is unknown
+ No aliasing problems.
+ vect-52.c is similar to this one with one difference:
+ the alignment of the read accesses is unknown.
+ vect-56.c is similar to this one with one difference:
+ the loop bound is known.
+ vect-61.c is similar to this one with two differences:
+ aliasing is not a problem, and the write access has unknown alignment. */
+
+float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+__attribute__ ((noinline)) int
+main1 (int n)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float *pa = a;
+ float *pb = b;
+ float *pc = c;
+
+ for (i = 0; i < n/2; i++)
+ {
+ pa[i] = pb[i+1] * pc[i+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (pa[i] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ int n=N;
+
+ check_vect ();
+ main1 (n);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail { vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vect_element_align } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-62.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-62.c
new file mode 100644
index 000000000..724b646fd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-62.c
@@ -0,0 +1,70 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+ int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ int ia[N][4][N+8];
+
+ /* Multidimensional array. Aligned. The "inner" dimensions
+ are invariant in the inner loop. Store. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[i][1][j+8] = ib[i];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[i][1][j+8] != ib[i])
+ abort();
+ }
+ }
+
+ /* Multidimensional array. Aligned. The "inner" dimensions
+ are invariant in the inner loop. Vectorizable, but the
+ vectorizer detects that everything is invariant and that
+ the loop is better left untouched. (it should be optimized away). */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[i][1][8] = ib[i];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[i][1][8] != ib[i])
+ abort();
+ }
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-63.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-63.c
new file mode 100644
index 000000000..70628da2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-63.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+ int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ int ia[N*2][4][N];
+
+ /* Multidimensional array. Aligned.
+ The first dimension depends on j: not vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[i + j][1][j] = ib[i];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[i + j][1][j] != ib[i])
+ abort();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-64.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-64.c
new file mode 100644
index 000000000..52131ea44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-64.c
@@ -0,0 +1,86 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+ int ia[N][4][N+1];
+ int ic[N][N][3][N+1];
+ int id[N][N][N+1];
+
+ /* Multidimensional array. Not aligned: vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[i][1][j] = ib[i];
+ }
+ }
+
+ /* Multidimensional array. Aligned: vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ic[i][1][1][j] = ib[i];
+ }
+ }
+
+ /* Multidimensional array. Not aligned: vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ id[i][1][j+1] = ib[i];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[i][1][j] != ib[i])
+ abort();
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ic[i][1][1][j] != ib[i])
+ abort();
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (id[i][1][j+1] != ib[i])
+ abort();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-65.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-65.c
new file mode 100644
index 000000000..ba3ab3a9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-65.c
@@ -0,0 +1,83 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define M 4
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+ int ib[M][M][N] = {{{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
+ {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
+ {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
+ {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}}};
+ int ia[M][M][N];
+ int ic[N];
+
+ /* Multidimensional array. Aligned. The "inner" dimensions
+ are invariant in the inner loop. Load and store. */
+ for (i = 0; i < M; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[i][1][j] = ib[2][i][j];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < M; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[i][1][j] != ib[2][i][j])
+ abort();
+ }
+ }
+
+ /* Multidimensional array. Aligned. The "inner" dimensions
+ are invariant in the inner loop. Load. */
+ for (i = 0; i < M; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ic[j] = ib[2][i][j];
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < M; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ic[j] != ib[2][i][j])
+ abort();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-66.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-66.c
new file mode 100644
index 000000000..e0b23cd65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-66.c
@@ -0,0 +1,96 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+void main1 ()
+{
+ int i, j;
+ int ia[8][5][N+2];
+
+ /* Multidimensional array. Aligned. */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[2][6][j] = 5;
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[2][6][j] != 5)
+ abort();
+ }
+ }
+}
+
+__attribute__ ((noinline))
+void main2 ()
+{
+ int i, j;
+ int ia[8][5][N+2];
+
+ /* Multidimensional array. Aligned. */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ ia[3][6][j+2] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 2; j < N+2; j++)
+ {
+ if (ia[3][6][j] != 5)
+ abort();
+ }
+ }
+}
+
+__attribute__ ((noinline))
+void main3 ()
+{
+ int i, j;
+ int ic[16][16][5][N+2];
+
+ /* Multidimensional array. Not aligned. */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ic[2][1][6][j+1] = 5;
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ic[2][1][6][j+1] != 5)
+ abort();
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+ main2 ();
+ main3 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-67.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-67.c
new file mode 100644
index 000000000..1ddab5c2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-67.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 (int a, int b)
+{
+ int i, j;
+ int ia[N][4][N+8];
+
+ /* Multidimensional array. Aligned. The "inner" dimensions
+ are invariant in the inner loop. Store.
+ Not vectorizable: unsupported operation. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ ia[i][1][j+8] = (a == b);
+ }
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ if (ia[i][1][j+8] != (a == b))
+ abort();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (2 ,7);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-68.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-68.c
new file mode 100644
index 000000000..c4f8857ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-68.c
@@ -0,0 +1,89 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+struct s{
+ int m;
+ int n[N][N][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e; /* array e.n is aligned */
+};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ /* 1. unaligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.a.n[1][2][i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 5)
+ abort ();
+ }
+
+ /* 2. aligned */
+ for (i = 3; i < N-1; i++)
+ {
+ tmp1.a.n[1][2][i] = 6;
+ }
+
+ /* check results: */
+ for (i = 3; i < N-1; i++)
+ {
+ if (tmp1.a.n[1][2][i] != 6)
+ abort ();
+ }
+
+ /* 3. aligned */
+ for (i = 0; i < N; i++)
+ {
+ tmp1.e.n[1][2][i] = 7;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 7)
+ abort ();
+ }
+
+ /* 4. unaligned */
+ for (i = 3; i < N-3; i++)
+ {
+ tmp1.e.n[1][2][i] = 8;
+ }
+
+ /* check results: */
+ for (i = 3; i <N-3; i++)
+ {
+ if (tmp1.e.n[1][2][i] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-7.c
new file mode 100644
index 000000000..7a6eb6180
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-7.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+short sa[N];
+short sb[N];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ sb[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sb[i] != 5)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = sb[i] + 100;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sa[i] != 105)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-70.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-70.c
new file mode 100644
index 000000000..24677c2f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-70.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 24
+
+struct s{
+ int m;
+ int n[N/6][N/6][N];
+};
+
+struct test1{
+ struct s a; /* array a.n is unaligned */
+ int b;
+ int c;
+ struct s e[N]; /* array e.n is aligned */
+};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i,j;
+ struct test1 tmp1;
+
+ for (i = 0; i < N; i++)
+ for (j = 3; j < N-3; j++)
+ {
+ tmp1.e[i].n[1][2][j] = 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ for (j = 3; j < N-3; j++)
+ {
+ if (tmp1.e[i].n[1][2][j] != 8)
+ abort ();
+ }
+
+ /* not consecutive */
+ for (i = 0; i < N; i++)
+ for (j = 3; j < N-3; j++)
+ {
+ tmp1.e[j].n[1][2][j] = 8;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ for (j = 3; j < N-3; j++)
+ {
+ if (tmp1.e[j].n[1][2][j] != 8)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {{! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-71.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-71.c
new file mode 100644
index 000000000..7416b4333
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-71.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+/* indirect access. */
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ unsigned ia[N];
+ unsigned ib[N+1] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2};
+
+ for (i = 2; i < N+1; i++)
+ {
+ ia[ib[i]] = 0;
+ }
+
+ /* check results: */
+ for (i = 2; i < N+1; i++)
+ {
+ if (ia[ib[i]] != 0)
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-72.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-72.c
new file mode 100644
index 000000000..67a197519
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-72.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+/* unaligned load. */
+
+char ia[N];
+char ib[N+1];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ for (i=0; i < N+1; i++)
+ {
+ ib[i] = i;
+ /* Avoid vectorization. */
+ if (i%3 == 0)
+ ib[i] = 5;
+ }
+
+ for (i = 1; i < N+1; i++)
+ {
+ ia[i-1] = ib[i];
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i-1] != ib[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-73-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-73-big-array.c
new file mode 100644
index 000000000..5f40055e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-73-big-array.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int ic[N*2];
+int ib[N];
+
+#define ia (ic+N)
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ {
+ ib[i] = i*3;
+ if (y)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-73.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-73.c
new file mode 100644
index 000000000..ee3c6e60e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-73.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int ic[N*2];
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+#define ia (ic+N)
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i])
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-74-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-74-big-array.c
new file mode 100644
index 000000000..5cd926fe0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-74-big-array.c
@@ -0,0 +1,68 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float b[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
+float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5};
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (float *__restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
+{
+ int i;
+ float *q = pb + 4;
+
+ for (i = 0; i < N; i++)
+ {
+ b[i] = i;
+ c[i] = 0.5 + i;
+ if (y)
+ abort ();
+ }
+ for (; i < N+4; i++)
+ {
+ b[i] = i;
+ if (y)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = q[i] * pc[i];
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != q[i] * pc[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (a, b, c);
+
+ return 0;
+}
+
+/* Xfail until handling restrict is refined. See pr29145. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* Uncomment when this testcase gets vectorized again:
+ dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } }
+ dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } }
+ dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } }
+*/
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-74.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-74.c
new file mode 100644
index 000000000..a680b9fb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-74.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float b[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
+float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5};
+
+__attribute__ ((noinline)) int
+main1 (float *__restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
+{
+ int i;
+ float *q = pb + 4;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = q[i] * pc[i];
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != q[i] * pc[i])
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (a, b, c);
+
+ return 0;
+}
+
+/* Xfail until handling restrict is refined. See pr29145 */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* Uncomment when this testcase gets vectorized again:
+ dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } }
+ dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } }
+ dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } }
+*/
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-75-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-75-big-array.c
new file mode 100644
index 000000000..1c70cc2c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-75-big-array.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 120
+#define OFF 8
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17};
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 (int *ib)
+{
+ int i;
+ int ia[N];
+
+ for (i = OFF; i < N+OFF; i++)
+ {
+ ib[i] = ib[i%OFF]*(i/OFF);
+ if (y)
+ abort ();
+ }
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+OFF];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+OFF])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (ib);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-75.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-75.c
new file mode 100644
index 000000000..092a3013e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-75.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+#define OFF 8
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+
+__attribute__ ((noinline))
+int main1 (int *ib)
+{
+ int i;
+ int ia[N];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+OFF];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+OFF])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (ib);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-76-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-76-big-array.c
new file mode 100644
index 000000000..915f10edb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-76-big-array.c
@@ -0,0 +1,83 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 124
+#define OFF 4
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17};
+int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17};
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 (int *pib)
+{
+ int i;
+ int ia[N+OFF];
+ for (i = OFF; i < N+OFF; i++)
+ {
+ ib[i] = ib[i%8]*(i/8);
+ ic[i] = ic[i%8]*(i/8);
+ if (y)
+ abort ();
+ }
+
+ for (i = OFF; i < N; i++)
+ {
+ ia[i] = pib[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (ia[i] != pib[i - OFF])
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = pib[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != pib[i - OFF])
+ abort ();
+ }
+
+ for (i = OFF; i < N; i++)
+ {
+ ia[i] = ic[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (ia[i] != ic[i - OFF])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (&ib[OFF]);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-76.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-76.c
new file mode 100644
index 000000000..d77130242
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-76.c
@@ -0,0 +1,74 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 24
+#define OFF 4
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
+
+__attribute__ ((noinline))
+int main1 (int *pib)
+{
+ int i;
+ int ia[N+OFF];
+
+ for (i = OFF; i < N; i++)
+ {
+ ia[i] = pib[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (ia[i] != pib[i - OFF])
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = pib[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != pib[i - OFF])
+ abort ();
+ }
+
+ for (i = OFF; i < N; i++)
+ {
+ ia[i] = ic[i - OFF];
+ }
+
+
+ /* check results: */
+ for (i = OFF; i < N; i++)
+ {
+ if (ia[i] != ic[i - OFF])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (&ib[OFF]);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c
new file mode 100644
index 000000000..4a05874b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77-alignchecks.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+#define OFF 8
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+
+__attribute__ ((noinline))
+int main1 (int *ib, int off)
+{
+ int i;
+ int ia[N];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+off];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+off])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (ib, 8);
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the load.
+ The store is aligned if alignment can be forced on the stack. Otherwise, we need to
+ peel the loop in order to align the store. For targets that can't align variables
+ using peeling (don't guarantee natural alignment) versioning the loop is required
+ both for the load and the store. */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && vect_no_align } || {unaligned_stack && { {! vector_alignment_reachable} && {! vect_no_align} } } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77-global.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77-global.c
new file mode 100644
index 000000000..ac29d7d3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77-global.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+#define OFF 8
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+int ia[N];
+
+__attribute__ ((noinline))
+int main1 (int *ib, int off)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+off];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+off])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (ib, 8);
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the load.
+ (The store is aligned). */
+/* Requires versioning for aliasing. */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77.c
new file mode 100644
index 000000000..07ee0fde1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-77.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+#define OFF 8
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+
+__attribute__ ((noinline))
+int main1 (int *ib, int off)
+{
+ int i;
+ int ia[N];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+off];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+off])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (ib, 8);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c
new file mode 100644
index 000000000..71c01ae1c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78-alignchecks.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+#define OFF 8
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+int off = 8;
+
+__attribute__ ((noinline))
+int main1 (int *ib)
+{
+ int i;
+ int ia[N];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+off];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+off])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (ib);
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the load.
+ The store is aligned if alignment can be forced on the stack. Otherwise, we need to
+ peel the loop in order to align the store. For targets that can't align variables
+ using peeling (don't guarantee natural alignment) versioning the loop is required
+ both for the load and the store. */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vect_no_align} && { unaligned_stack && vector_alignment_reachable } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { {! unaligned_stack} && vect_no_align } || {unaligned_stack && { {! vector_alignment_reachable} && {! vect_no_align} } } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 2 "vect" { target { { unaligned_stack && { vector_alignment_reachable && vect_no_align } } || {unaligned_stack && { {! vector_alignment_reachable} && vect_no_align } } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78-global.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78-global.c
new file mode 100644
index 000000000..ec6520fd8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78-global.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+#define OFF 8
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ia[N];
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+int off = 8;
+
+__attribute__ ((noinline))
+int main1 (int *ib)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+off];
+ }
+
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+off])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (ib);
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the load.
+ (The store is aligned). */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78.c
new file mode 100644
index 000000000..12ea12af9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-78.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+#define OFF 8
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34};
+int off = 8;
+
+__attribute__ ((noinline))
+int main1 (int *ib)
+{
+ int i;
+ int ia[N];
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i+off];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i+off])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (ib);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-8.c
new file mode 100644
index 000000000..62f819e04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-8.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+float a[N];
+
+__attribute__ ((noinline))
+int main1 (int n)
+{
+ int i;
+
+ /* Vectorized: unknown loop bound). */
+ for (i = 0; i < n; i++){
+ a[i] = b[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (a[i] != b[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-80-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-80-big-array.c
new file mode 100644
index 000000000..611d8260d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-80-big-array.c
@@ -0,0 +1,71 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+float fa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float fb[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float fc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc)
+{
+ int i;
+ float *q = pb + 4;
+ for (i = 0; i < N; i++)
+ {
+ fb[i] = i;
+ fc[i] = 0.5+i;
+ if (y)
+ abort ();
+ }
+ for (; i < N+4; i++)
+ {
+ fb[i] = i;
+ if (y)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = q[i] * pc[i];
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != q[i] * pc[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (fa, fb, fc);
+
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the
+ all three accesses (peeling to align the store will not force the
+ two loads to be aligned). */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* Uncomment when this testcase gets vectorized again:
+ dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } }
+ dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } }
+ dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } }
+*/
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-80.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-80.c
new file mode 100644
index 000000000..fc0ed1b39
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-80.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float fa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float fb[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
+float fc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5};
+
+/* Check handling of accesses for which the "initial condition" -
+ the expression that represents the first location accessed - is
+ more involved than just an ssa_name. */
+
+__attribute__ ((noinline)) int
+main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc)
+{
+ int i;
+ float *q = pb + 4;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = q[i] * pc[i];
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != q[i] * pc[i])
+ abort();
+ }
+
+ return 0;
+}
+
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (fa, fb, fc);
+
+ return 0;
+}
+
+/* For targets that don't support misaligned loads we version for the
+ all three accesses (peeling to align the store will not force the
+ two loads to be aligned). */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* Uncomment when this testcase gets vectorized again:
+ dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } }
+ dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } }
+ dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } }
+*/
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-82.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-82.c
new file mode 100644
index 000000000..7fbaa9216
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-82.c
@@ -0,0 +1,37 @@
+/* { dg-skip-if "powerpc and integer vectorization only" { ! { powerpc*-*-* && vect_int } } { "*" } { "" } } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ long long unsigned int ca[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = 0;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != 0)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-82_64.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-82_64.c
new file mode 100644
index 000000000..30d9c809f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-82_64.c
@@ -0,0 +1,40 @@
+/* { dg-do run { target { { powerpc*-*-* && lp64 } && powerpc_altivec_ok } } } */
+/* { dg-do compile { target { { powerpc*-*-* && ilp32 } && powerpc_altivec_ok } } } */
+/* { dg-options "-O2 -ftree-vectorize -mpowerpc64 -fdump-tree-vect-details -maltivec" } */
+/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ long long unsigned int ca[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = 0;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != 0)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-83.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-83.c
new file mode 100644
index 000000000..c031db9df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-83.c
@@ -0,0 +1,37 @@
+/* { dg-skip-if "powerpc and integer vectorization only" { ! { powerpc*-*-* && vect_int } } { "*" } { "" } } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ long long unsigned int ca[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-83_64.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-83_64.c
new file mode 100644
index 000000000..8cc4f22c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-83_64.c
@@ -0,0 +1,40 @@
+/* { dg-do run { target { { powerpc*-*-* && lp64 } && powerpc_altivec_ok } } } */
+/* { dg-do compile { target { { powerpc*-*-* && ilp32 } && powerpc_altivec_ok } } } */
+/* { dg-options "-O2 -ftree-vectorize -mpowerpc64 -fdump-tree-vect-details -maltivec" } */
+/* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ long long unsigned int ca[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = 2;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != 2)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-85-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-85-big-array.c
new file mode 100644
index 000000000..004114fbb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-85-big-array.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline))
+int main1 (int *a)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ k = i + N;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < N; j++)
+ if (a[j] != i + N - 1)
+ abort ();
+
+ for (j = 0; j < N; j++)
+ if (b[j] != j + N)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ check_vect ();
+
+ main1 (a);
+
+ return 0;
+}
+
+/* Fails for targets that don't vectorize PLUS (e.g alpha). */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-85.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-85.c
new file mode 100644
index 000000000..a5bf5db07
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-85.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 (int *a)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ {
+ k = i + N;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < N; j++)
+ if (a[j] != i + N - 1)
+ abort();
+
+ for (j = 0; j < N; j++)
+ if (b[j] != j + N)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ check_vect ();
+
+ main1 (a);
+
+ return 0;
+}
+
+/* Fails for targets that don't vectorize PLUS (e.g alpha). */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-86.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-86.c
new file mode 100644
index 000000000..334e54ee4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-86.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int a[N];
+
+__attribute__ ((noinline))
+int main1 (int n)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ k = i + n;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ abort();
+
+ for (i = 0; i < n; i++)
+ if (b[i] != i + n)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N);
+ main1 (0);
+ main1 (1);
+ main1 (2);
+ main1 (N-1);
+
+ return 0;
+}
+
+/* Fails for targets that don't vectorize PLUS (e.g alpha). */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-87.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-87.c
new file mode 100644
index 000000000..9912f19e7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-87.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 (int n, int *a)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ k = i + n;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ abort();
+
+ for (j = 0; j < n; j++)
+ if (b[j] != j + n)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ check_vect ();
+
+ main1 (N, a);
+ main1 (0, a);
+ main1 (1, a);
+ main1 (2, a);
+ main1 (N-1, a);
+
+ return 0;
+}
+
+/* Fails for targets that don't vectorize PLUS (e.g alpha). */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable} } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-88.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-88.c
new file mode 100644
index 000000000..593854652
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-88.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 (int n, int *a)
+{
+ int i, j, k;
+ int b[N];
+
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < n; j++)
+ {
+ k = i + n;
+ a[j] = k;
+ }
+ b[i] = k;
+ }
+
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ abort();
+
+ for (j = 0; j < n; j++)
+ if (b[j] != j + n)
+ abort();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ check_vect ();
+
+ main1 (N, a+1);
+ main1 (0, a+1);
+ main1 (1, a+1);
+ main1 (2, a+1);
+ main1 (N-1, a+1);
+
+ return 0;
+}
+
+/* Fails for targets that don't vectorize PLUS (e.g alpha). */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-89-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-89-big-array.c
new file mode 100644
index 000000000..89286635c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-89-big-array.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+struct tmp_struct
+{
+ int x;
+ int y[N];
+};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, *q;
+ struct tmp_struct tmp, *p;
+
+ p = &tmp;
+ q = p->y;
+
+ for (i = 0; i < N; i++)
+ {
+ *q++ = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->y[i] != 5)
+ {
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-89.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-89.c
new file mode 100644
index 000000000..131efeab5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-89.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct tmp_struct
+{
+ int x;
+ int y[N];
+};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, *q;
+ struct tmp_struct tmp, *p;
+
+ p = &tmp;
+ q = p->y;
+
+ for (i = 0; i < N; i++)
+ {
+ *q++ = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->y[i] != 5)
+ {
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-9.c
new file mode 100644
index 000000000..c11784a4b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-9.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ia[N];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ /* Requires type promotion (vector unpacking) support. */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = (int) sb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != (int) sb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-91.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-91.c
new file mode 100644
index 000000000..019cf353f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-91.c
@@ -0,0 +1,65 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+extern int a[N+20];
+
+/* The alignment of 'pa' is unknown.
+ Yet we do know that both the read access and write access have
+ the same alignment. Peeling to align one of the accesses will
+ align the other. */
+
+__attribute__ ((noinline)) int
+main1 (int * pa)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ pa[i] = pa[i] + 1;
+ }
+
+ return 0;
+}
+
+/* The alignment of 'a' is unknown.
+ Yet we do know that both the read access and write access have
+ the same alignment. Peeling to align one of the accesses will
+ align the other. */
+
+__attribute__ ((noinline)) int
+main2 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = a[i] + 1;
+ }
+
+ return 0;
+}
+
+__attribute__ ((noinline)) int
+main3 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = a[i+20];
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { xfail vect_no_int_add } } } */
+/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 3 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 2 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-92.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-92.c
new file mode 100644
index 000000000..3a64e251c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-92.c
@@ -0,0 +1,96 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+float pa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float pb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+float pc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+/* Check handling of unaligned accesses when the misalignment is
+ known at compile time and different accesses have the same
+ misalignment (e.g. peeling to align one access will align all
+ accesses with the same misalignment. Also, the number of
+ peeled iterations is known in this case, and the vectorizer
+ can use this information (generate prolog and epilog loops
+ with known number of iterations, and only if needed). */
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+
+ for (i = 0; i < 10; i++)
+ {
+ pa[i+1] = pb[i+1] * pc[i+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < 10; i++)
+ {
+ if (pa[i+1] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return 0;
+}
+
+__attribute__ ((noinline)) int
+main2 ()
+{
+ int i;
+
+ for (i = 0; i < 12; i++)
+ {
+ pa[i+1] = pb[i+1] * pc[i+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < 12; i++)
+ {
+ if (pa[i+1] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return 0;
+}
+
+__attribute__ ((noinline)) int
+main3 (int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i+1] = pb[i+1] * pc[i+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (pa[i+1] != (pb[i+1] * pc[i+1]))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ main1 ();
+ main2 ();
+ main3 (N-1);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-93.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-93.c
new file mode 100644
index 000000000..65403eb72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-93.c
@@ -0,0 +1,85 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 3001
+
+
+__attribute__ ((noinline))
+main1 (float *pa)
+{
+ int i;
+
+ for (i = 0; i < 3001; i++)
+ {
+ pa[i] = 2.0;
+ }
+
+ /* check results: */
+ for (i = 0; i < 3001; i++)
+ {
+ if (pa[i] != 2.0)
+ abort ();
+ }
+
+ for (i = 1; i <= 10; i++)
+ {
+ pa[i] = 3.0;
+ }
+
+ /* check results: */
+ for (i = 1; i <= 10; i++)
+ {
+ if (pa[i] != 3.0)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+ check_vect ();
+
+ /* from bzip2: */
+ for (i=0; i<N; i++) b[i] = i;
+ a[0] = 0;
+ for (i = 1; i <= 256; i++) a[i] = b[i-1];
+
+ /* check results: */
+ for (i = 1; i <= 256; i++)
+ {
+ if (a[i] != i-1)
+ abort ();
+ }
+ if (a[0] != 0)
+ abort ();
+
+ main1 (a);
+
+ return 0;
+}
+
+/* 2 loops vectorized in main1, 2 loops vectorized in main:
+ the first loop in main requires vectorization of conversions,
+ the second loop in main requires vectorization of misaligned load. */
+
+/* main && main1 together: */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */
+
+/* in main1: */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target !powerpc*-*-* !i?86-*-* !x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target vect_no_align } } } */
+
+/* in main: */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-95.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-95.c
new file mode 100644
index 000000000..c03d1965d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-95.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+__attribute__ ((noinline))
+void bar (float *pd, float *pa, float *pb, float *pc)
+{
+ int i;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pa[i] != (pb[i] * pc[i]))
+ abort ();
+ if (pd[i] != 5.0)
+ abort ();
+ }
+
+ return;
+}
+
+
+__attribute__ ((noinline)) int
+main1 (int n, float * __restrict__ pd, float * __restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ pa[i] = pb[i] * pc[i];
+ pd[i] = 5.0;
+ }
+
+ bar (pd,pa,pb,pc);
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float d[N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
+
+ check_vect ();
+
+ main1 (N,&d[1],a,b,c);
+ main1 (N-2,&d[1],a,b,c);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail {vect_element_align} } } } */
+
+/* For targets that support unaligned loads we version for the two unaligned
+ stores and generate misaligned accesses for the loads. For targets that
+ don't support unaligned loads we version for all four accesses. */
+
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_element_align} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-96.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-96.c
new file mode 100644
index 000000000..0060d4eb4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-96.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct tmp
+{
+ int x;
+ int ia[N];
+};
+
+__attribute__ ((noinline))
+int main1 (int off)
+{
+ struct tmp sb[N];
+ struct tmp *pp = &sb[off];
+ int i, ib[N];
+
+ for (i = 0; i < N; i++)
+ pp->ia[i] = ib[i];
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (pp->ia[i] != ib[i])
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (8);
+}
+
+/* The store is unaligned, the load is aligned. For targets that support unaligned
+ loads, peel to align the store and generate an unaligned access for the load.
+ For targets that don't support unaligned loads, version for the store. */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-97-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-97-big-array.c
new file mode 100644
index 000000000..87bacbf72
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-97-big-array.c
@@ -0,0 +1,73 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ struct {
+ char *p;
+ char *q;
+ } s;
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ cb[i] = i*3;
+ if (y)
+ abort ();
+ }
+
+ /* Check that datarefs analysis can determine that the access via pointer
+ s.p is based off array x, which enables us to antialias this access from
+ the access to array cb. */
+ s.p = x;
+ for (i = 0; i < N; i++)
+ {
+ s.p[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.p[i] != cb[i])
+ abort ();
+ }
+
+ /* Check that datarefs analysis can determine that the access via pointer
+ s.p is based off array x, and that the access via pointer s.q is based off
+ array cb, which enables us to antialias these two accesses. */
+ s.q = cb;
+ for (i = 0; i < N; i++)
+ {
+ s.p[i] = s.q[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.p[i] != s.q[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-97.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-97.c
new file mode 100644
index 000000000..6ea261490
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-97.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ struct {
+ char *p;
+ char *q;
+ } s;
+ int i;
+
+ /* Check that datarefs analysis can determine that the access via pointer
+ s.p is based off array x, which enables us to antialias this access from
+ the access to array cb. */
+ s.p = x;
+ for (i = 0; i < N; i++)
+ {
+ s.p[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.p[i] != cb[i])
+ abort ();
+ }
+
+ /* Check that datarefs analysis can determine that the access via pointer
+ s.p is based off array x, and that the access via pointer s.q is based off
+ array cb, which enables us to antialias these two accesses. */
+ s.q = cb;
+ for (i = 0; i < N; i++)
+ {
+ s.p[i] = s.q[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.p[i] != s.q[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-98-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-98-big-array.c
new file mode 100644
index 000000000..0528d43b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-98-big-array.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DOT16( a, b) ( a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + \
+ a[4]*b[4] + a[5]*b[5] + a[6]*b[6] + a[7]*b[7] + \
+ a[8]*b[8] + a[9]*b[9] + a[10]*b[10] + a[11]*b[11] + \
+ a[12]*b[12] + a[13]*b[13] + a[14]*b[14] + a[15]*b[15])
+
+volatile int y = 0;
+
+__attribute__ ((noinline))
+int main1 (int ia[][N])
+{
+ int i, j;
+ int ib[N] = {0,3,6,9};
+ int ic[N][N];
+
+ for (i = 0; i < N; i++)
+ {
+ ic[0][i] = DOT16 (ia[i], ib);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ic[0][i] != DOT16 (ia[i], ib))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int ia[N][N];
+ int i,j;
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ ia[i][j] = i + j + 1;
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ check_vect ();
+
+ return main1 (ia);
+}
+
+/* Needs interleaving support. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided4 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-98.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-98.c
new file mode 100644
index 000000000..01c915387
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-98.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 4
+#define DOT4( a, b ) ( a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3] )
+
+__attribute__ ((noinline))
+int main1 (int ia[][N])
+{
+ int i, j;
+ int ib[N] = {0,3,6,9};
+ int ic[N][N];
+
+ for (i = 0; i < N; i++)
+ {
+ ic[0][i] = DOT4 (ia[i], ib);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ic[0][i] != DOT4 (ia[i], ib))
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int ia[N][N] = {{1,2,3,4},{2,3,5,7},{2,4,6,8},{22,43,55,77}};
+
+ check_vect ();
+
+ return main1 (ia);
+}
+
+/* Needs interleaving support. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided4 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-99.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-99.c
new file mode 100644
index 000000000..d29023c73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-99.c
@@ -0,0 +1,33 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+int ca[100];
+
+__attribute__ ((noinline))
+void foo (int n)
+{
+ unsigned int i;
+
+ for (i = 0; i < n; i++)
+ ca[i] = 2;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo(100);
+
+ for (i = 0; i < 100; ++i) {
+ if (ca[i] != 2)
+ abort();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-alias-check.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-alias-check.c
new file mode 100644
index 000000000..7c8b7dd98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-alias-check.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "--param=vect-max-version-for-alias-checks=2" } */
+
+/* A test case showing four potential alias checks between a[i] and b[0], b[1],
+ b[i+1] and b[i+2]. With alias check merging enabled, those four checks
+ can be merged into two, and the loop will be vectorized with
+ vect-max-version-for-alias-checks=2. */
+
+void foo (int *a, int *b)
+{
+ int i;
+ for (i = 0; i < 1000; ++i)
+ a[i] = b[0] + b[1] + b[i+1] + b[i+2];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-1.c
new file mode 100644
index 000000000..099b7fea4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-1.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+/* Compile time known misalignment. Cannot use loop peeling to align
+ the store. */
+
+#define N 16
+
+struct foo {
+ char x;
+ int y[N];
+} __attribute__((packed));
+
+int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) int
+main1 (struct foo * __restrict__ p)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ p->y[i] = x[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->y[i] != x[i])
+ abort ();
+ }
+ return 0;
+}
+
+
+int main (void)
+{
+ int i;
+ struct foo *p = malloc (2*sizeof (struct foo));
+ check_vect ();
+
+ main1 (p);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { xfail vect_hw_misalign} } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-2.c
new file mode 100644
index 000000000..293d07b24
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-2.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+/* Compile time unknown misalignment. Cannot use loop peeling to align
+ the store. */
+
+#define N 17
+
+struct foo {
+ char x0;
+ int y[N][N];
+} __attribute__ ((packed));
+
+struct foo f2;
+int z[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+
+__attribute__ ((noinline))
+void fbar(struct foo *fp)
+{
+ int i,j;
+ for (i=0; i<N; i++)
+ for (j=0; j<N; j++)
+ f2.y[i][j] = z[i];
+
+ for (i=0; i<N; i++)
+ for (j=0; j<N; j++)
+ if (f2.y[i][j] != z[i])
+ abort ();
+}
+
+int main (void)
+{
+ struct foo *fp = (struct foo *) malloc (2*sizeof (struct foo));
+
+ check_vect ();
+
+ fbar(fp);
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { xfail vect_hw_misalign} } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-3.c
new file mode 100644
index 000000000..a8d3e485e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-align-3.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int a[2048];
+
+void
+f1 (int x, int y)
+{
+ int i;
+ x &= -256;
+ y &= -256;
+ for (i = x + 256; i < y; i++)
+ a[i]++;
+}
+
+void
+f2 (int x, int y)
+{
+ int i;
+ if (x & 31)
+ __builtin_unreachable ();
+ if (y & 31)
+ __builtin_unreachable ();
+ for (i = x + 256; i < x + y; i++)
+ a[i]++;
+}
+
+void
+f3 (int x, int y)
+{
+ int i;
+ if (x % 256)
+ __builtin_unreachable ();
+ if (y % 256)
+ __builtin_unreachable ();
+ for (i = x + 256; i < x + y; i++)
+ a[i]++;
+}
+
+void
+f4 (int x, int y)
+{
+ int i;
+ if ((x % 256) != 0)
+ __builtin_unreachable ();
+ if ((y % 256) != 0)
+ __builtin_unreachable ();
+ for (i = x + 256; i < x + y; i++)
+ a[i]++;
+}
+
+/* { dg-final { scan-tree-dump-not "vect_do_peeling_for_loop_bound" "vect" } } */
+/* { dg-final { scan-tree-dump-not "loop peeled for vectorization" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-all-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-all-big-array.c
new file mode 100644
index 000000000..16da0764e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-all-big-array.c
@@ -0,0 +1,255 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int iadd_results[N];
+float fadd_results[N];
+float fmul_results[N];
+float fresults1[N];
+float fresults2[N];
+
+/****************************************************/
+__attribute__ ((noinline))
+void icheck_results (int *a, int *results)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != results[i])
+ abort ();
+ }
+}
+
+__attribute__ ((noinline))
+void fcheck_results (float *a, float *results)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != results[i])
+ abort ();
+ }
+}
+
+__attribute__ ((noinline)) void
+fbar_mul (float *a)
+{
+ fcheck_results (a, fmul_results);
+}
+
+__attribute__ ((noinline)) void
+fbar_add (float *a)
+{
+ fcheck_results (a, fadd_results);
+}
+
+__attribute__ ((noinline)) void
+ibar_add (int *a)
+{
+ icheck_results (a, iadd_results);
+}
+
+__attribute__ ((noinline)) void
+fbar1 (float *a)
+{
+ fcheck_results (a, fresults1);
+}
+
+__attribute__ ((noinline)) void
+fbar2 (float *a)
+{
+ fcheck_results (a, fresults2);
+}
+
+float a[N];
+float e[N];
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ia[N];
+char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+char ca[N];
+short sa[N];
+
+volatile int y = 0;
+
+/* All of the loops below are currently vectorizable, except
+ initialization ones. */
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i,j;
+ /* Initialization. */
+ for (i = 0; i < N; i++)
+ {
+ b[i] = i*3;
+ c[i] = i;
+ d[i] = i*2;
+ ic[i] = i*3;
+ ib[i] = i*3;
+ cb[i] = i*3;
+ fadd_results[i] = b[i] + c[i] + d[i];
+ iadd_results[i] = ib[i] + ic[i];
+ fmul_results[i] = b[i] * c[i];
+ fresults1[i] = 0;
+ fresults2[i] = 0;
+ if (y)
+ abort ();
+ }
+
+ /* Test 1: copy chars. */
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i];
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != cb[i])
+ abort ();
+ }
+
+
+ /* Test 2: fp mult. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = b[i] * c[i];
+ }
+ fbar_mul (a);
+
+
+ /* Test 3: mixed types (int, fp), same nunits in vector. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = b[i] + c[i] + d[i];
+ e[i] = b[i] + c[i] + d[i];
+ ia[i] = ib[i] + ic[i];
+ }
+ ibar_add (ia);
+ fbar_add (a);
+ fbar_add (e);
+
+ /* Initialization. */
+ for (i = 0; i < N; i++)
+ {
+ fresults1[i] = a[i];
+ fresults2[i] = e[i];
+ if (y)
+ abort ();
+ }
+ for (i = 0; i < N/2; i++)
+ {
+ fresults1[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
+ fresults2[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
+ if (y)
+ abort ();
+ }
+ /* Test 4: access with offset. */
+ for (i = 0; i < N/2; i++)
+ {
+ a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
+ e[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
+ }
+ fbar1 (a);
+ fbar2 (e);
+
+
+ /* Test 5: access with offset. */
+ for (i = 1; i <=N-4; i++)
+ {
+ a[i+3] = b[i-1];
+ }
+ /* check results: */
+ for (i = 1; i <=N-4; i++)
+ {
+ if (a[i+3] != b[i-1])
+ abort ();
+ }
+
+
+ /* Test 6 - loop induction with stride != 1. */
+ i = 0;
+ j = 0;
+ while (i < 5*N)
+ {
+ a[j] = c[j];
+ i += 5;
+ j++;
+ }
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != c[i])
+ abort ();
+ }
+
+
+ /* Test 7 - reverse access. */
+ for (i = N; i > 0; i--)
+ {
+ a[N-i] = d[N-i];
+ }
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != d[i])
+ abort ();
+ }
+
+
+ /* Tests 8,9,10 - constants. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 5.0;
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 5.0)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = 5;
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sa[i] != 5)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] + 5;
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i] + 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 10 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-all.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-all.c
new file mode 100644
index 000000000..6756283b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-all.c
@@ -0,0 +1,221 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int iadd_results[N] = {0,6,12,18,24,30,36,42,48,54,60,66,72,78,84,90};
+float fadd_results[N] = {0.0,6.0,12.0,18.0,24.0,30.0,36.0,42.0,48.0,54.0,60.0,66.0,72.0,78.0,84.0,90.0};
+float fmul_results[N] = {0.0,3.0,12.0,27.0,48.0,75.0,108.0,147.0,192.0,243.0,300.0,363.0,432.0,507.0,588.0,675.0};
+float fresults1[N] = {192.00,240.00,288.00,336.00,384.00,432.00,480.00,528.00,48.00,54.00,60.00,66.00,72.00,78.00,84.00,90.00};
+float fresults2[N] = {0.00,6.00,12.00,18.00,24.00,30.00,36.00,42.00,0.00,54.00,120.00,198.00,288.00,390.00,504.00,630.00};
+
+/****************************************************/
+__attribute__ ((noinline))
+void icheck_results (int *a, int *results)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != results[i])
+ abort ();
+ }
+}
+
+__attribute__ ((noinline))
+void fcheck_results (float *a, float *results)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != results[i])
+ abort ();
+ }
+}
+
+__attribute__ ((noinline)) void
+fbar_mul (float *a)
+{
+ fcheck_results (a, fmul_results);
+}
+
+__attribute__ ((noinline)) void
+fbar_add (float *a)
+{
+ fcheck_results (a, fadd_results);
+}
+
+__attribute__ ((noinline)) void
+ibar_add (int *a)
+{
+ icheck_results (a, iadd_results);
+}
+
+__attribute__ ((noinline)) void
+fbar1 (float *a)
+{
+ fcheck_results (a, fresults1);
+}
+
+__attribute__ ((noinline)) void
+fbar2 (float *a)
+{
+ fcheck_results (a, fresults2);
+}
+
+float a[N];
+float e[N];
+float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int ia[N];
+char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+char ca[N];
+short sa[N];
+
+/* All of the loops below are currently vectorizable. */
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i,j;
+
+ /* Test 1: copy chars. */
+ for (i = 0; i < N; i++)
+ {
+ ca[i] = cb[i];
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ca[i] != cb[i])
+ abort ();
+ }
+
+
+ /* Test 2: fp mult. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = b[i] * c[i];
+ }
+ fbar_mul (a);
+
+
+ /* Test 3: mixed types (int, fp), same nunits in vector. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = b[i] + c[i] + d[i];
+ e[i] = b[i] + c[i] + d[i];
+ ia[i] = ib[i] + ic[i];
+ }
+ ibar_add (ia);
+ fbar_add (a);
+ fbar_add (e);
+
+
+ /* Test 4: access with offset. */
+ for (i = 0; i < N/2; i++)
+ {
+ a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
+ e[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
+ }
+ fbar1 (a);
+ fbar2 (e);
+
+
+ /* Test 5: access with offset */
+ for (i = 1; i <=N-4; i++)
+ {
+ a[i+3] = b[i-1];
+ }
+ /* check results: */
+ for (i = 1; i <=N-4; i++)
+ {
+ if (a[i+3] != b[i-1])
+ abort ();
+ }
+
+
+ /* Test 6 - loop induction with stride != 1. */
+ i = 0;
+ j = 0;
+ while (i < 5*N)
+ {
+ a[j] = c[j];
+ i += 5;
+ j++;
+ }
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != c[i])
+ abort ();
+ }
+
+
+ /* Test 7 - reverse access. */
+ for (i = N; i > 0; i--)
+ {
+ a[N-i] = d[N-i];
+ }
+ /* check results: */
+ for (i = 0; i <N; i++)
+ {
+ if (a[i] != d[i])
+ abort ();
+ }
+
+
+ /* Tests 8,9,10 - constants. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 5.0;
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != 5.0)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = 5;
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sa[i] != 5)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] + 5;
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i] + 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 10 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-bool-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-bool-1.c
new file mode 100644
index 000000000..fd12f5c77
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-bool-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+_Bool a[1024];
+_Bool b[1024];
+_Bool c[1024];
+void foo (void)
+{
+ unsigned i;
+ for (i = 0; i < 1024; ++i)
+ a[i] = b[i] | c[i];
+}
+
+/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-1.c
new file mode 100644
index 000000000..23f3651eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-1.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+_Complex float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ { 10.0F + 20.0iF, 11.0F + 21.0iF, 12.0F + 22.0iF, 13.0F + 23.0iF,
+ 14.0F + 24.0iF, 15.0F + 25.0iF, 16.0F + 26.0iF, 17.0F + 27.0iF,
+ 18.0F + 28.0iF, 19.0F + 29.0iF, 20.0F + 30.0iF, 21.0F + 31.0iF,
+ 22.0F + 32.0iF, 23.0F + 33.0iF, 24.0F + 34.0iF, 25.0F + 35.0iF };
+_Complex float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ { 30.0F + 40.0iF, 31.0F + 41.0iF, 32.0F + 42.0iF, 33.0F + 43.0iF,
+ 34.0F + 44.0iF, 35.0F + 45.0iF, 36.0F + 46.0iF, 37.0F + 47.0iF,
+ 38.0F + 48.0iF, 39.0F + 49.0iF, 40.0F + 50.0iF, 41.0F + 51.0iF,
+ 42.0F + 52.0iF, 43.0F + 53.0iF, 44.0F + 54.0iF, 45.0F + 55.0iF };
+
+_Complex float c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+_Complex float res[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ { 40.0F + 60.0iF, 42.0F + 62.0iF, 44.0F + 64.0iF, 46.0F + 66.0iF,
+ 48.0F + 68.0iF, 50.0F + 70.0iF, 52.0F + 72.0iF, 54.0F + 74.0iF,
+ 56.0F + 76.0iF, 58.0F + 78.0iF, 60.0F + 80.0iF, 62.0F + 82.0iF,
+ 64.0F + 84.0iF, 66.0F + 86.0iF, 68.0F + 88.0iF, 70.0F + 90.0iF };
+
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ c[i] = a[i] + b[i];
+
+}
+
+int
+main (void)
+{
+ int i;
+ check_vect ();
+
+ foo ();
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (c[i] != res[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-2.c
new file mode 100644
index 000000000..498e742a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-2.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+_Complex double a[N] =
+ { 10.0F + 20.0iF, 11.0F + 21.0iF, 12.0F + 22.0iF, 13.0F + 23.0iF,
+ 14.0F + 24.0iF, 15.0F + 25.0iF, 16.0F + 26.0iF, 17.0F + 27.0iF,
+ 18.0F + 28.0iF, 19.0F + 29.0iF, 20.0F + 30.0iF, 21.0F + 31.0iF,
+ 22.0F + 32.0iF, 23.0F + 33.0iF, 24.0F + 34.0iF, 25.0F + 35.0iF };
+_Complex double b[N] =
+ { 30.0F + 40.0iF, 31.0F + 41.0iF, 32.0F + 42.0iF, 33.0F + 43.0iF,
+ 34.0F + 44.0iF, 35.0F + 45.0iF, 36.0F + 46.0iF, 37.0F + 47.0iF,
+ 38.0F + 48.0iF, 39.0F + 49.0iF, 40.0F + 50.0iF, 41.0F + 51.0iF,
+ 42.0F + 52.0iF, 43.0F + 53.0iF, 44.0F + 54.0iF, 45.0F + 55.0iF };
+
+_Complex double c[N];
+_Complex double res[N] =
+ { 40.0F + 60.0iF, 42.0F + 62.0iF, 44.0F + 64.0iF, 46.0F + 66.0iF,
+ 48.0F + 68.0iF, 50.0F + 70.0iF, 52.0F + 72.0iF, 54.0F + 74.0iF,
+ 56.0F + 76.0iF, 58.0F + 78.0iF, 60.0F + 80.0iF, 62.0F + 82.0iF,
+ 64.0F + 84.0iF, 66.0F + 86.0iF, 68.0F + 88.0iF, 70.0F + 90.0iF };
+
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ c[i] = a[i] + b[i];
+
+}
+
+int
+main (void)
+{
+ int i;
+ check_vect ();
+
+ foo ();
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (c[i] != res[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-4.c
new file mode 100644
index 000000000..288ff07c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-4.c
@@ -0,0 +1,108 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct foostr {
+ _Complex short f1;
+ _Complex short f2;
+};
+
+struct foostr a[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {
+ 11 + 23i, 24 + 22i,
+ 11 + 26i, 24 + 35i,
+ 19 + 20i, 29 + 14i,
+ 23 + 31i, 26 + 30i,
+ 29 + 39i, 24 + 18i,
+ 20 + 32i, 16 + 23i,
+ 13 + 26i, 37 + 34i,
+ 12 + 23i, 26 + 14i,
+ 36 + 14i, 31 + 17i,
+ 35 + 17i, 17 + 36i,
+ 13 + 34i, 19 + 12i,
+ 27 + 34i, 36 + 19i,
+ 21 + 39i, 16 + 33i,
+ 28 + 18i, 39 + 26i,
+ 32 + 27i, 13 + 38i,
+ 35 + 36i, 34 + 28i,
+ };
+
+struct foostr b[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {
+ 37 + 12i, 23 + 15i,
+ 14 + 11i, 13 + 25i,
+ 35 + 29i, 22 + 34i,
+ 24 + 34i, 16 + 39i,
+ 34 + 32i, 26 + 21i,
+ 34 + 36i, 11 + 37i,
+ 25 + 21i, 10 + 39i,
+ 10 + 36i, 35 + 22i,
+ 39 + 29i, 23 + 21i,
+ 34 + 33i, 39 + 14i,
+ 16 + 31i, 32 + 33i,
+ 20 + 14i, 35 + 30i,
+ 26 + 24i, 36 + 37i,
+ 31 + 20i, 32 + 28i,
+ 25 + 27i, 15 + 30i,
+ 10 + 31i, 37 + 37i,
+ };
+struct foostr c[16] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+struct foostr res[N] =
+ {
+ 48 + 35i, 47 + 37i,
+ 25 + 37i, 37 + 60i,
+ 54 + 49i, 51 + 48i,
+ 47 + 65i, 42 + 69i,
+ 63 + 71i, 50 + 39i,
+ 54 + 68i, 27 + 60i,
+ 38 + 47i, 47 + 73i,
+ 22 + 59i, 61 + 36i,
+ 75 + 43i, 54 + 38i,
+ 69 + 50i, 56 + 50i,
+ 29 + 65i, 51 + 45i,
+ 47 + 48i, 71 + 49i,
+ 47 + 63i, 52 + 70i,
+ 59 + 38i, 71 + 54i,
+ 57 + 54i, 28 + 68i,
+ 45 + 67i, 71 + 65i,
+ };
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ c[i].f1 = a[i].f1 + b[i].f1;
+ c[i].f2 = a[i].f2 + b[i].f2;
+ }
+
+}
+
+int
+main (void)
+{
+ int i;
+ check_vect ();
+
+ foo ();
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (c[i].f1 != res[i].f1)
+ abort ();
+ if (c[i].f2 != res[i].f2)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-5.c
new file mode 100644
index 000000000..83d04cd04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-complex-5.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+struct foostr {
+ _Complex short f1;
+ _Complex short f2;
+};
+
+_Complex short a1[64] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+_Complex short a2[64] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+_Complex short b1[64] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+_Complex short b2[64] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+struct foostr c[64] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ c[i].f1 = a1[i] + b1[i];
+ c[i].f2 = a2[i] + b2[i];
+ }
+
+}
+
+int
+main (void)
+{
+ int i;
+ check_vect ();
+
+ foo ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-1.c
new file mode 100644
index 000000000..e42752f97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-1.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+#define M 32
+#define N 16
+
+int x_in[M];
+int x_out[M];
+int c[N] = {3,2,1,10,1,42,3,4,50,9,32,8,11,10,1,2};
+int a[N+1] = {0,16,32,48,64,128,256,512,0,16,32,48,64,128,256,512,1024};
+int check_result[M] = {1024,1024,1024,256,256,256,256,256,256,256,256,128,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48};
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int j, i, x;
+ int curr_a, next_a;
+
+ for (j = 0; j < M; j++)
+ {
+ x = x_in[j];
+ curr_a = a[0];
+
+ for (i = 0; i < N; i++)
+ {
+ next_a = a[i+1];
+ curr_a = x > c[i] ? curr_a : next_a;
+ }
+
+ x_out[j] = curr_a;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+
+ check_vect ();
+
+ for (j = 0; j < M; j++)
+ x_in[j] = j;
+
+ foo ();
+
+ for (j = 0; j < M; j++)
+ if (x_out[j] != check_result[j])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-10.c
new file mode 100644
index 000000000..687d42f05
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-10.c
@@ -0,0 +1,165 @@
+/* { dg-require-effective-target vect_cond_mixed } */
+
+#include "tree-vect.h"
+
+#define N 1024
+float a[N], b[N], c[N], d[N];
+_Bool k[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int x = a[i] < b[i];
+ int y = c[i] < d[i];
+ k[i] = x & y;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ k[i] = (a[i] < b[i]) & (c[i] < d[i]);
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int x = a[i] < b[i];
+ int y = c[i] < d[i];
+ k[i] = x | y;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ k[i] = (a[i] < b[i]) | (c[i] < d[i]);
+}
+
+__attribute__((noinline, noclone)) void
+f5 (_Bool *p)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int x = a[i] < b[i];
+ int y = c[i] < d[i];
+ p[i] = x & y;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f6 (_Bool *p)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ p[i] = (a[i] < b[i]) & (c[i] < d[i]);
+}
+
+__attribute__((noinline, noclone)) void
+f7 (_Bool *p)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int x = a[i] < b[i];
+ int y = c[i] < d[i];
+ p[i] = x | y;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f8 (_Bool *p)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ p[i] = (a[i] < b[i]) | (c[i] < d[i]);
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
+ case 1: a[i] = 0; b[i] = 0; break;
+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
+ case 3: a[i] = i; b[i] = i + 7; break;
+ case 4: a[i] = i; b[i] = i; break;
+ case 5: a[i] = i + 16; b[i] = i + 3; break;
+ case 6: a[i] = - i - 5; b[i] = - i; break;
+ case 7: a[i] = - i; b[i] = - i; break;
+ case 8: a[i] = - i; b[i] = - i - 7; break;
+ }
+ }
+ for (i = 0; i < N; i++)
+ {
+ switch ((i / 9) % 3)
+ {
+ case 0: c[i] = a[i / 9]; d[i] = b[i / 9]; break;
+ case 1: c[i] = a[i / 9 + 3]; d[i] = b[i / 9 + 3]; break;
+ case 2: c[i] = a[i / 9 + 6]; d[i] = b[i / 9 + 6]; break;
+ }
+ }
+ f1 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, 0, sizeof (k));
+ f2 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, 0, sizeof (k));
+ f3 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, 0, sizeof (k));
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, 0, sizeof (k));
+ f5 (k);
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, 0, sizeof (k));
+ f6 (k);
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, 0, sizeof (k));
+ f7 (k);
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, 0, sizeof (k));
+ f8 (k);
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, 0, sizeof (k));
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "note: vectorized 1 loops" 8 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-11.c
new file mode 100644
index 000000000..0301c8909
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-11.c
@@ -0,0 +1,116 @@
+#include "tree-vect.h"
+
+#define N 1024
+typedef int V __attribute__((vector_size (4)));
+unsigned int a[N * 2] __attribute__((aligned));
+unsigned int b[N * 2] __attribute__((aligned));
+V c[N];
+
+__attribute__((noinline, noclone)) unsigned int
+foo (unsigned int *a, unsigned int *b)
+{
+ int i;
+ unsigned int r = 0;
+ for (i = 0; i < N; i++)
+ {
+ unsigned int x = a[i], y = b[i];
+ if (x < 32)
+ {
+ x = x + 127;
+ y = y * 2;
+ }
+ else
+ {
+ x = x - 16;
+ y = y + 1;
+ }
+ a[i] = x;
+ b[i] = y;
+ r += x;
+ }
+ return r;
+}
+
+__attribute__((noinline, noclone)) unsigned int
+bar (unsigned int *a, unsigned int *b)
+{
+ int i;
+ unsigned int r = 0;
+ for (i = 0; i < N; i++)
+ {
+ unsigned int x = a[i], y = b[i];
+ if (x < 32)
+ {
+ x = x + 127;
+ y = y * 2;
+ }
+ else
+ {
+ x = x - 16;
+ y = y + 1;
+ }
+ a[i] = x;
+ b[i] = y;
+ c[i] = c[i] + 1;
+ r += x;
+ }
+ return r;
+}
+
+void
+baz (unsigned int *a, unsigned int *b,
+ unsigned int (*fn) (unsigned int *, unsigned int *))
+{
+ int i;
+ for (i = -64; i < 0; i++)
+ {
+ a[i] = 19;
+ b[i] = 17;
+ }
+ for (; i < N; i++)
+ {
+ a[i] = i - 512;
+ b[i] = i;
+ }
+ for (; i < N + 64; i++)
+ {
+ a[i] = 27;
+ b[i] = 19;
+ }
+ if (fn (a, b) != -512U - (N - 32) * 16U + 32 * 127U)
+ __builtin_abort ();
+ for (i = -64; i < 0; i++)
+ if (a[i] != 19 || b[i] != 17)
+ __builtin_abort ();
+ for (; i < N; i++)
+ if (a[i] != (i - 512U < 32U ? i - 512U + 127 : i - 512U - 16)
+ || b[i] != (i - 512U < 32U ? i * 2U : i + 1U))
+ __builtin_abort ();
+ for (; i < N + 64; i++)
+ if (a[i] != 27 || b[i] != 19)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ baz (a + 512, b + 512, foo);
+ baz (a + 512, b + 512, bar);
+ baz (a + 512 + 1, b + 512 + 1, foo);
+ baz (a + 512 + 1, b + 512 + 1, bar);
+ baz (a + 512 + 31, b + 512 + 31, foo);
+ baz (a + 512 + 31, b + 512 + 31, bar);
+ baz (a + 512 + 1, b + 512, foo);
+ baz (a + 512 + 1, b + 512, bar);
+ baz (a + 512 + 31, b + 512, foo);
+ baz (a + 512 + 31, b + 512, bar);
+ baz (a + 512, b + 512 + 1, foo);
+ baz (a + 512, b + 512 + 1, bar);
+ baz (a + 512, b + 512 + 31, foo);
+ baz (a + 512, b + 512 + 31, bar);
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-2.c
new file mode 100644
index 000000000..97d3241a9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-2.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int c[N] = {3,2,1,10,1,42,3,4,50,9,32,8,11,10,1,2};
+int a[N+1] = {0,16,32,48,64,128,256,512,0,16,32,48,64,128,256,512,1024};
+
+__attribute__ ((noinline)) void
+foo (int *x)
+{
+ int i;
+ int curr_a, flag, next_a;
+
+ curr_a = a[0];
+
+ for (i = 0; i < N; i++)
+ {
+ flag = *x > c[i];
+ next_a = a[i+1];
+ curr_a = flag ? curr_a : next_a;
+ }
+
+ *x = curr_a;
+}
+
+int main (void)
+{
+ int x = 7;
+
+ check_vect ();
+
+ foo (&x);
+
+ if (x != 256)
+ abort ();
+
+ return 0;
+}
+
+/* The order of computation should not be changed for cond_expr, therefore,
+ it cannot be vectorized in reduction. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-3.c
new file mode 100644
index 000000000..32ebf0fff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-3.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+#define M 32
+#define N 16
+
+int x_in[M];
+int x_out_a[M], x_out_b[M];
+int c[N] = {3,2,1,10,1,42,3,4,50,9,32,8,11,10,1,2};
+int a[N+1] = {0,16,32,48,64,128,256,512,0,16,32,48,64,128,256,512,1024};
+int b[N+1] = {17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+int check_result_a[M] = {1024,1024,1024,256,256,256,256,256,256,256,256,128,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48};
+int check_result_b[M] = {17,17,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int j, i, x;
+ int curr_a, flag, next_a, curr_b, next_b;
+
+ for (j = 0; j < M; j++)
+ {
+ x = x_in[j];
+ curr_a = a[0];
+ curr_b = b[0];
+
+ for (i = 0; i < N; i++)
+ {
+ flag = x > c[i];
+ next_a = a[i+1];
+ next_b = b[i+1];
+ curr_a = flag ? curr_a : next_a;
+ curr_b = flag ? next_b : curr_b;
+ }
+
+ x_out_a[j] = curr_a;
+ x_out_b[j] = curr_b;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+
+ check_vect ();
+
+ for (j = 0; j < M; j++)
+ x_in[j] = j;
+
+ foo ();
+
+ for (j = 0; j < M; j++)
+ if (x_out_a[j] != check_result_a[j]
+ || x_out_b[j] != check_result_b[j])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-4.c
new file mode 100644
index 000000000..3c37c6825
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-4.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+#define M 32
+#define N 16
+
+int x_in[M];
+int x_out_a[M], x_out_b[M];
+int c[N] = {3,2,1,10,1,42,3,4,50,9,32,8,11,10,1,2};
+int a[N+1] = {0,16,32,48,64,128,256,512,0,16,32,48,64,128,256,512,1024};
+int b[N+1] = {17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+int check_result_a[M] = {1024,1024,1024,256,256,256,256,256,256,256,256,128,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48};
+int check_result_b[M] = {17,17,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+
+__attribute__ ((noinline)) void
+foo (int z)
+{
+ int j, i, x;
+ int curr_a, curr_b;
+
+ for (j = 0; j < M; j++)
+ {
+ x = x_in[j];
+ curr_a = a[0];
+ curr_b = b[0];
+
+ for (i = 0; i < N; i++)
+ {
+ curr_a = x > c[i] ? curr_a : z;
+ curr_b = x > c[i] ? curr_b : 5;
+ }
+
+ x_out_a[j] = curr_a;
+ x_out_b[j] = curr_b;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+
+ check_vect ();
+
+ for (j = 0; j < M; j++)
+ x_in[j] = j;
+
+ foo (125);
+
+ for (j = 0; j < M; j++)
+ if (x_out_a[j] != 125
+ || x_out_b[j] != 5)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-5.c
new file mode 100644
index 000000000..e8adedbe4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-5.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 32
+
+int cond_array[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int a[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+int check_result[K] = {2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+
+__attribute__ ((noinline)) void
+foo (int c)
+{
+ int res, i, j, k, next;
+
+ for (k = 0; k < K; k++)
+ {
+ res = 0;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ {
+ next = a[i][j];
+ res = c > cond_array[i+k][j] ? next : res;
+ }
+
+ out[k] = res;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ cond_array[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ a[i][j] = i+2;
+ }
+
+ foo(5);
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
+
+/* Double reduction with cond_expr is not supported, since even though the order
+ of computation is the same, but vector results should be reduced to scalar
+ result, which can'be done for cond_expr. */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-6.c
new file mode 100644
index 000000000..944c9c272
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-6.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_condition } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 32
+
+int cond_array[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int a[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+
+__attribute__ ((noinline)) void
+foo (int c)
+{
+ int res, i, j, k, next;
+
+ for (k = 0; k < K; k++)
+ {
+ for (j = 0; j < K; j++)
+ {
+ res = 0;
+ for (i = 0; i < K; i++)
+ {
+ next = a[i][j];
+ res = c > cond_array[i+k][j] ? next : res;
+ }
+
+ out[j] = res;
+ }
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ cond_array[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ a[i][j] = i+2;
+ }
+
+ foo(125);
+
+ for (k = 0; k < K; k++)
+ if (out[k] != 33)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-7.c
new file mode 100644
index 000000000..227192cf2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-7.c
@@ -0,0 +1,68 @@
+#include "tree-vect.h"
+
+extern void abort (void);
+double ad[64], bd[64], cd[64], dd[64], ed[64];
+float af[64], bf[64], cf[64], df[64], ef[64];
+signed char ac[64], bc[64], cc[64], dc[64], ec[64];
+short as[64], bs[64], cs[64], ds[64], es[64];
+int ai[64], bi[64], ci[64], di[64], ei[64];
+long long all[64], bll[64], cll[64], dll[64], ell[64];
+unsigned char auc[64], buc[64], cuc[64], duc[64], euc[64];
+unsigned short aus[64], bus[64], cus[64], dus[64], eus[64];
+unsigned int au[64], bu[64], cu[64], du[64], eu[64];
+unsigned long long aull[64], bull[64], cull[64], dull[64], eull[64];
+
+#define F(var) \
+__attribute__((noinline, noclone)) void \
+f##var (void) \
+{ \
+ int i; \
+ for (i = 0; i < 64; i++) \
+ { \
+ __typeof (a##var[0]) d = d##var[i], e = e##var[i]; \
+ a##var[i] = b##var[i] > c##var[i] ? d : e; \
+ } \
+}
+
+#define TESTS \
+F (d) F (f) F (c) F (s) F (i) F (ll) F (uc) F (us) F (u) F (ull)
+
+TESTS
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+ for (i = 0; i < 64; i++)
+ {
+#undef F
+#define F(var) \
+ b##var[i] = i + 64; \
+ switch (i % 3) \
+ { \
+ case 0: c##var[i] = i + 64; break; \
+ case 1: c##var[i] = 127 - i; break; \
+ case 2: c##var[i] = i; break; \
+ } \
+ d##var[i] = i / 2; \
+ e##var[i] = i * 2;
+ TESTS
+ }
+#undef F
+#define F(var) f##var ();
+ TESTS
+ for (i = 0; i < 64; i++)
+ {
+ asm volatile ("" : : : "memory");
+#undef F
+#define F(var) \
+ if (a##var[i] != (b##var[i] > c##var[i] ? d##var[i] : e##var[i])) \
+ abort ();
+ TESTS
+ }
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-8.c
new file mode 100644
index 000000000..e5702c25a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-8.c
@@ -0,0 +1,122 @@
+/* { dg-require-effective-target vect_cond_mixed } */
+
+#include "tree-vect.h"
+
+#define N 1024
+float a[N], b[N], c[N];
+int d[N], e[N], f[N];
+unsigned char k[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ k[i] = a[i] < b[i] ? 17 : 0;
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ k[i] = a[i] < b[i] ? 0 : 24;
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ k[i] = a[i] < b[i] ? 51 : 12;
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int d2 = d[i], e2 = e[i];
+ f[i] = a[i] < b[i] ? d2 : e2;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f5 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ float a2 = a[i], b2 = b[i];
+ c[i] = d[i] < e[i] ? a2 : b2;
+ }
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
+ case 1: a[i] = 0; b[i] = 0; break;
+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
+ case 3: a[i] = i; b[i] = i + 7; break;
+ case 4: a[i] = i; b[i] = i; break;
+ case 5: a[i] = i + 16; b[i] = i + 3; break;
+ case 6: a[i] = - i - 5; b[i] = - i; break;
+ case 7: a[i] = - i; b[i] = - i; break;
+ case 8: a[i] = - i; b[i] = - i - 7; break;
+ }
+ d[i] = i;
+ e[i] = 2 * i;
+ }
+ f1 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? 17 : 0))
+ abort ();
+ f2 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? 0 : 24))
+ abort ();
+ f3 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 ? 51 : 12))
+ abort ();
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (f[i] != ((i % 3) == 0 ? d[i] : e[i]))
+ abort ();
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); d[i] = - i - 1; e[i] = i + 1; break;
+ case 1: d[i] = 0; e[i] = 0; break;
+ case 2: d[i] = i + 1; e[i] = - i - 1; break;
+ case 3: d[i] = i; e[i] = i + 7; break;
+ case 4: d[i] = i; e[i] = i; break;
+ case 5: d[i] = i + 16; e[i] = i + 3; break;
+ case 6: d[i] = - i - 5; e[i] = - i; break;
+ case 7: d[i] = - i; e[i] = - i; break;
+ case 8: d[i] = - i; e[i] = - i - 7; break;
+ }
+ a[i] = i;
+ b[i] = i / 2;
+ }
+ f5 ();
+ for (i = 0; i < N; i++)
+ if (c[i] != ((i % 3) == 0 ? a[i] : b[i]))
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "note: vectorized 1 loops" 5 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-9.c
new file mode 100644
index 000000000..cfa0363b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cond-9.c
@@ -0,0 +1,200 @@
+/* { dg-require-effective-target vect_cond_mixed } */
+
+#include "tree-vect.h"
+
+#define N 1024
+float a[N], b[N], c[N], d[N];
+int j[N];
+unsigned char k[N];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ unsigned int x = a[i] < b[i] ? -1 : 0;
+ unsigned int y = c[i] < d[i] ? -1 : 0;
+ j[i] = (x & y) >> 31;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int x = a[i] < b[i];
+ int y = c[i] < d[i];
+ j[i] = x & y;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ j[i] = (a[i] < b[i]) & (c[i] < d[i]);
+}
+
+__attribute__((noinline, noclone)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int x = a[i] < b[i];
+ int y = c[i] < d[i];
+ k[i] = x & y;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f5 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ k[i] = (a[i] < b[i]) & (c[i] < d[i]);
+}
+
+__attribute__((noinline, noclone)) void
+f6 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ unsigned int x = a[i] < b[i] ? -1 : 0;
+ unsigned int y = c[i] < d[i] ? -1 : 0;
+ j[i] = (x | y) >> 31;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f7 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int x = a[i] < b[i];
+ int y = c[i] < d[i];
+ j[i] = x | y;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f8 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ j[i] = (a[i] < b[i]) | (c[i] < d[i]);
+}
+
+__attribute__((noinline, noclone)) void
+f9 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ {
+ int x = a[i] < b[i];
+ int y = c[i] < d[i];
+ k[i] = x | y;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f10 (void)
+{
+ int i;
+ for (i = 0; i < N; ++i)
+ k[i] = (a[i] < b[i]) | (c[i] < d[i]);
+}
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ switch (i % 9)
+ {
+ case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break;
+ case 1: a[i] = 0; b[i] = 0; break;
+ case 2: a[i] = i + 1; b[i] = - i - 1; break;
+ case 3: a[i] = i; b[i] = i + 7; break;
+ case 4: a[i] = i; b[i] = i; break;
+ case 5: a[i] = i + 16; b[i] = i + 3; break;
+ case 6: a[i] = - i - 5; b[i] = - i; break;
+ case 7: a[i] = - i; b[i] = - i; break;
+ case 8: a[i] = - i; b[i] = - i - 7; break;
+ }
+ }
+ for (i = 0; i < N; i++)
+ {
+ switch ((i / 9) % 3)
+ {
+ case 0: c[i] = a[i / 9]; d[i] = b[i / 9]; break;
+ case 1: c[i] = a[i / 9 + 3]; d[i] = b[i / 9 + 3]; break;
+ case 2: c[i] = a[i / 9 + 6]; d[i] = b[i / 9 + 6]; break;
+ }
+ }
+ f1 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (j, -6, sizeof (j));
+ f2 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (j, -6, sizeof (j));
+ f3 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (j, -6, sizeof (j));
+ f4 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, -6, sizeof (k));
+ f5 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, -6, sizeof (k));
+ f6 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (j, -6, sizeof (j));
+ f7 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (j, -6, sizeof (j));
+ f8 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (j, -6, sizeof (j));
+ f9 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, -6, sizeof (k));
+ f10 ();
+ for (i = 0; i < N; i++)
+ if (k[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0))
+ abort ();
+ __builtin_memset (k, -6, sizeof (k));
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "note: vectorized 1 loops" 10 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c
new file mode 100644
index 000000000..3c21918ef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cselim-1.c
@@ -0,0 +1,86 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 50
+
+typedef struct {
+ short a;
+ short b;
+} data;
+
+data in1[N], in2[N], out[N];
+short result[N*2] = {7,-7,9,-6,11,-5,13,-4,15,-3,17,-2,19,-1,21,0,23,1,25,2,27,3,29,4,31,5,33,6,35,7,37,8,39,9,41,10,43,11,45,12,47,13,49,14,51,15,53,16,55,17,57,18,59,19,61,20,63,21,65,22,67,23,69,24,71,25,73,26,75,27,77,28,79,29,81,30,83,31,85,32,87,33,89,34,91,35,93,36,95,37,97,38,99,39,101,40,103,41,105,42};
+short out1[N], out2[N];
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int i;
+ short c, d;
+
+ /* Vectorizable with conditional store sinking. */
+ for (i = 0; i < N; i++)
+ {
+ c = in1[i].b;
+ d = in2[i].b;
+
+ if (c >= d)
+ {
+ out[i].b = c;
+ out[i].a = d + 5;
+ }
+ else
+ {
+ out[i].b = d - 12;
+ out[i].a = c + d;
+ }
+ }
+
+ /* Not vectorizable. */
+ for (i = 0; i < N; i++)
+ {
+ c = in1[i].b;
+ d = in2[i].b;
+
+ if (c >= d)
+ {
+ out1[i] = c;
+ }
+ else
+ {
+ out2[i] = c + d;
+ }
+ }
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in1[i].a = i;
+ in1[i].b = i + 2;
+ in2[i].a = 5;
+ in2[i].b = i + 5;
+ __asm__ volatile ("");
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++)
+ {
+ if (out[i].a != result[2*i] || out[i].b != result[2*i+1])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || { ! vect_strided2 } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cselim-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cselim-2.c
new file mode 100644
index 000000000..accfcf398
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-cselim-2.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 50
+
+int a[N], b[N], in1[N], in2[N];
+int result[2*N] = {5,-7,7,-6,9,-5,11,-4,13,-3,15,-2,17,-1,19,0,21,1,23,2,25,3,27,4,29,5,31,6,33,7,35,8,37,9,39,10,41,11,43,12,45,13,47,14,49,15,51,16,53,17,55,18,57,19,59,20,61,21,63,22,65,23,67,24,69,25,71,26,73,27,75,28,77,29,79,30,81,31,83,32,85,33,87,34,89,35,91,36,93,37,95,38,97,39,99,40,101,41,103,42};
+
+__attribute__ ((noinline)) void
+foo (int *pa, int *pb)
+{
+ int i;
+ int c, d;
+
+ /* Store sinking should not work here since the pointers may alias. */
+ for (i = 0; i < N; i++)
+ {
+ c = in1[i];
+ d = in2[i];
+
+ if (c >= d)
+ {
+ *pa = c;
+ *pb = d + 5;
+ }
+ else
+ {
+ *pb = d - 12;
+ *pa = c + d;
+ }
+
+ pa++;
+ pb++;
+ }
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in1[i] = i;
+ in2[i] = i + 5;
+ __asm__ volatile ("");
+ }
+
+ foo (a, b);
+
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != result[2*i] || b[i] != result[2*i+1])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c
new file mode 100644
index 000000000..a2d36d3b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-debug-pr41926.c
@@ -0,0 +1,21 @@
+/* PR debug/41926 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -ffast-math -funroll-loops -ftree-vectorize -msse2" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse2 { target { i?86-*-* x86_64-*-* } } } */
+
+void
+foo (double (*__restrict p)[4], double (*__restrict q)[4],
+ double *__restrict prim, double scale, double pp, double pq)
+{
+ int md, mc, mb, ma, p_index = 0;
+
+ for (md = 0; md < 1; md++)
+ for (mc = 0; mc < 1; mc++)
+ for (mb = 0; mb < 1; mb++)
+ for (ma = 0; ma < 4; ma++)
+ {
+ double tmp = scale * prim[p_index++];
+ p[md][ma] = p[md][ma] - tmp * pp;
+ q[mc][ma] = q[mc][ma] - tmp * pq;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-1.c
new file mode 100644
index 000000000..7dd6b494d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-1.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 32
+
+int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int coeff[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+int check_result[K] = {642816,660736,678656,696576,714496,732416,750336,768256,786176,804096,822016,839936,857856,875776,893696,911616,929536,947456,965376,983296,1001216,1019136,1037056,1054976,1072896,1090816,1108736,1126656,1144576,1162496,1180416,1198336};
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int sum = 0, i, j, k;
+
+ for (k = 0; k < K; k++)
+ {
+ sum = 0;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ sum += in[i+k][j] * coeff[i][j];
+
+ out[k] = sum;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ in[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ coeff[i][j] = i+2;
+ }
+
+ foo();
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-2.c
new file mode 100644
index 000000000..50d014174
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-2.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 32
+
+int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int coeff[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+int check_result[K] = {357184,339264,321344,303424,285504,267584,249664,231744,213824,195904,177984,160064,142144,124224,106304,88384,70464,52544,34624,16704,-1216,-19136,-37056,-54976,-72896,-90816,-108736,-126656,-144576,-162496,-180416,-198336};
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int res = 0, i, j, k;
+
+ for (k = 0; k < K; k++)
+ {
+ res = 1000000;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ res -= in[i+k][j] * coeff[i][j];
+
+ out[k] = res;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ in[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ coeff[i][j] = i+2;
+ }
+
+ foo();
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-3.c
new file mode 100644
index 000000000..f5376b8bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-3.c
@@ -0,0 +1,66 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 32
+
+int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int coeff[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out_max[K], out_min[K];
+int check_max[K] = {62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93};
+int check_min[K] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+
+__attribute__ ((noinline)) void
+foo (int x, int y)
+{
+ int max, min, i, j, k;
+
+ for (k = 0; k < K; k++)
+ {
+ max = x;
+ min = y;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ {
+ max = max < in[i+k][j] ? in[i+k][j] : max;
+ min = min > in[i+k][j] ? in[i+k][j] : min;
+ }
+ out_max[k] = max;
+ out_min[k] = min;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ in[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ coeff[i][j] = i+2;
+ }
+
+ foo(0, 0);
+
+ for (k = 0; k < K; k++)
+ if (out_max[k] != check_max[k] || out_min[k] != 0)
+ abort ();
+
+ foo(100, 45);
+
+ for (k = 0; k < K; k++)
+ if (out_min[k] != check_min[k] || out_max[k] != 100)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-4.c
new file mode 100644
index 000000000..7ab6b69ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-4.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 32
+
+int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int coeff[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+int check_result[K] = {652816,670736,688656,706576,724496,742416,760336,778256,796176,814096,832016,849936,867856,885776,903696,921616,939536,957456,975376,993296,1011216,1029136,1047056,1064976,1082896,1100816,1118736,1136656,1154576,1172496,1190416,1208336};
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int sum = 0, i, j, k;
+
+ for (k = 0; k < K; k++)
+ {
+ sum = 10000;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ sum += in[i+k][j] * coeff[i][j];
+
+ out[k] = sum;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ in[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ coeff[i][j] = i+2;
+ }
+
+ foo();
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-5.c
new file mode 100644
index 000000000..48457628f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-5.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 32
+
+signed short in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short coeff[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+int check_result[K] = {642816,660736,678656,696576,714496,732416,750336,768256,786176,804096,822016,839936,857856,875776,893696,911616,929536,947456,965376,983296,1001216,1019136,1037056,1054976,1072896,1090816,1108736,1126656,1144576,1162496,1180416,1198336};
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int sum = 0, i, j, k;
+
+ for (k = 0; k < K; k++)
+ {
+ sum = 0;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ sum += in[i+k][j] * coeff[i][j];
+
+ out[k] = sum;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ in[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ coeff[i][j] = i+2;
+ }
+
+ foo();
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
+
+/* Vectorization of loops with multiple types and double reduction is not
+ supported yet. */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-6-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-6-big-array.c
new file mode 100644
index 000000000..abf3f7db6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-6-big-array.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 16
+
+int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+int check_result[K];
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int sum;
+ int i, j, k;
+
+ for (k = 0; k < K; k++)
+ {
+ sum = 1;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ {
+ sum *= in[i+k][j];
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+ check_result[k] = sum;
+ }
+
+ for (k = 0; k < K; k++)
+ {
+ sum = 1;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ sum *= in[i+k][j];
+ out[k] = sum;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (i = 0; i < 2*K; i++)
+ for (j = 0; j < K; j++)
+ in[i][j] = (i+2)/3;
+
+ foo ();
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-6.c
new file mode 100644
index 000000000..6b14e3bf5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-6.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 4
+
+int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+int check_result[K] = {0,16,256,4096};
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int sum;
+ int i, j, k;
+
+ for (k = 0; k < K; k++)
+ {
+ sum = 1;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ sum *= in[i+k][j];
+ out[k] = sum;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (i = 0; i < 2*K; i++)
+ for (j = 0; j < K; j++)
+ in[i][j] = (i+2)/3;
+
+ foo();
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-7.c
new file mode 100644
index 000000000..34a6f600e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-double-reduc-7.c
@@ -0,0 +1,64 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define K 32
+
+int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int out[K];
+int check_result[K] = {63,63,191,191,127,127,191,191,127,127,191,191,127,127,191,191,127,127,191,191,127,127,191,191,127,127,191,191,127,127,191,191};
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int res_or, res_and, res_xor, i, j, k;
+
+ for (k = 0; k < K; k++)
+ {
+ res_or = 0;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ res_or = res_or | in[i+k][j];
+
+ res_and = 1;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ res_and = res_and & in[i+k][j];
+
+ res_xor = 0;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ res_xor = res_xor ^ in[i+k][j];
+
+ out[k] = res_or + res_and + res_xor;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ check_vect ();
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ in[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ out[i] = i+j;
+ }
+
+ foo();
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 3 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-dv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-dv-1.c
new file mode 100644
index 000000000..0da4cd978
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-dv-1.c
@@ -0,0 +1,22 @@
+/* Test compiler crash when dependence analyzer can not represent
+ dependence relation by distance vector. */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int x[199];
+
+void foo()
+
+{
+ int t,j;
+
+ for (j=99;j>0;j--)
+ x [j+j]=x[j];
+
+ for (j=198;j>=100;j--)
+ if(x[j])
+ {
+ x[j-63]=x[j-3]-x[j];
+ }
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
new file mode 100644
index 000000000..3035ee392
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
+double da[N];
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+
+ /* float -> double */
+ for (i = 0; i < N; i++)
+ {
+ da[i] = (double) fb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (da[i] != (double) fb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail spu*-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c
new file mode 100644
index 000000000..b7a9b47bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ double db[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
+ float fa[N];
+
+ /* double -> float */
+ for (i = 0; i < N; i++)
+ {
+ fa[i] = (float) db[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (fa[i] != (float) db[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail spu*-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c
new file mode 100644
index 000000000..e5b72f1ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
+int ia[N];
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+
+ /* float -> int */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = (int) fb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != (int) fb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_floatint_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
new file mode 100644
index 000000000..683b43c51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ double db[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5};
+ int ia[N];
+
+ /* double -> int */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = (int) db[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != (int) db[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_floatint_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-fold-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-fold-1.c
new file mode 100644
index 000000000..8aca1e420
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-fold-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ccp1" } */
+
+typedef unsigned char v4qi __attribute__ ((vector_size (4)));
+
+v4qi c;
+
+void foo()
+{
+ v4qi a = { 1, 2, 3, 4 };
+ v4qi b = { 5, 6, 7, 8 };
+ c = a + b;
+}
+
+/* { dg-final { scan-tree-dump-times "c =.* { 6, 8, 10, 12 }" 1 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c
new file mode 100644
index 000000000..8a4b24ed4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c
@@ -0,0 +1,12 @@
+/* PR 21272 */
+/* { dg-do compile } */
+double
+foo (int j, double *v, double x)
+{
+ int i;
+ for (i = 0; i < j; i++)
+ if (v[i] < x)
+ x = v[i];
+ return x;
+}
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c
new file mode 100644
index 000000000..8071c87d0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c
@@ -0,0 +1,34 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+float A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11};
+float B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42};
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] != MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c
new file mode 100644
index 000000000..a02c8984e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c
@@ -0,0 +1,34 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11};
+float B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] == MAX ? 0 : MAX);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c
new file mode 100644
index 000000000..e899f126d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c
@@ -0,0 +1,36 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] >= MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c
new file mode 100644
index 000000000..1d8e9f52b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c
@@ -0,0 +1,36 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] > MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c
new file mode 100644
index 000000000..1680cba8a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c
@@ -0,0 +1,36 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] <= MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c
new file mode 100644
index 000000000..5fc9674b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c
@@ -0,0 +1,36 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] < MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c
new file mode 100644
index 000000000..24e8c969e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c
@@ -0,0 +1,36 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+int A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11};
+int B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] != MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c
new file mode 100644
index 000000000..fa4cf3a58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c
@@ -0,0 +1,36 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11};
+int B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42};
+
+extern void abort(void);
+
+int main ()
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] == MAX ? 0 : MAX);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c
new file mode 100644
index 000000000..50eedb1d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
+inline void foo () __attribute__((always_inline));
+void foo ()
+{
+ int i, j;
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] >= MAX ? MAX : 0);
+}
+
+int main ()
+{
+
+ int i, j;
+ check_vect ();
+ foo ();
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c
new file mode 100644
index 000000000..90f33a508
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float fa[N];
+
+__attribute__ ((noinline)) int main1 ()
+{
+ int i;
+
+ /* int -> float */
+ for (i = 0; i < N; i++)
+ {
+ fa[i] = (float) ib[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (fa[i] != (float) ib[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c
new file mode 100644
index 000000000..87f200119
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int int_arr[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+float float_arr[N];
+char char_arr[N];
+
+__attribute__ ((noinline)) int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++){
+ float_arr[i] = (float) int_arr[i];
+ char_arr[i] = 0;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (float_arr[i] != (float) int_arr[i])
+ abort ();
+ if (char_arr[i] != 0)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
new file mode 100644
index 000000000..d5f25df71
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_double } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+double da[N];
+
+__attribute__ ((noinline)) int main1 ()
+{
+ int i;
+
+ /* int -> double */
+ for (i = 0; i < N; i++)
+ {
+ da[i] = (double) ib[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (da[i] != (double) ib[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c
new file mode 100644
index 000000000..af8344ba6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,-3,-6,-9,-12,-15,-18,-21,-24,-27,-30,-33,-36,-39,-42,-45};
+float fa[N];
+
+__attribute__ ((noinline)) int main1 ()
+{
+ int i;
+
+ /* short -> float */
+ for (i = 0; i < N; i++)
+ {
+ fa[i] = (float) sb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (fa[i] != (float) sb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c
new file mode 100644
index 000000000..51ea056fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned short usb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,65533,65530,65527,65524,65521,65518,65515,65512,65509,65506,65503,65500,65497,65494,65491};
+float fa[N];
+
+__attribute__ ((noinline)) int main1 ()
+{
+ int i;
+
+ /* unsigned short -> float */
+ for (i = 0; i < N; i++)
+ {
+ fa[i] = (float) usb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (fa[i] != (float) usb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-1.c
new file mode 100644
index 000000000..5d6ab5cd2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-1.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int result[N] = {8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38};
+
+__attribute__ ((noinline)) int main1 (int X)
+{
+ int arr[N];
+ int k = X;
+ int m, i=0;
+
+ /* vectorization of induction. */
+
+ do {
+ m = k + 5;
+ arr[i] = m;
+ k = k + 2;
+ i++;
+ } while (i < N);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr[i] != result[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (3);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-10.c
new file mode 100644
index 000000000..7ec487253
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-10.c
@@ -0,0 +1,36 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i,j;
+ int ia[N];
+
+ /* Induction. */
+ for (j=0,i=N; j<N,i>0; i--,j++) {
+ ia[j] = i;
+ }
+
+ /* check results: */
+ for (j=0,i=N; j<N,i>0; i--,j++) {
+ if (ia[j] != i)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-11.c
new file mode 100644
index 000000000..632b97c29
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-11.c
@@ -0,0 +1,32 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+int __attribute__((noinline,noclone))
+main1 (int len)
+{
+ int s = 0;
+ int i = len;
+
+ /* vectorization of induction with reduction. */
+ for ( ; i > 1; i -=2)
+ s += i;
+
+ return s;
+}
+
+int main (void)
+{
+ int s;
+ check_vect ();
+
+ s = main1 (26);
+ if (s != 182)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-2.c
new file mode 100644
index 000000000..df34a99c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-2.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline)) int main1 ()
+{
+ int arr1[N];
+ int k = 0;
+ int m = 3, i = 0;
+
+ /* Vectorization of induction that is used after the loop.
+ Currently vectorizable because scev_ccp disconnects the
+ use-after-the-loop from the iv def inside the loop. */
+
+ do {
+ k = k + 2;
+ arr1[i] = k;
+ m = m + k;
+ i++;
+ } while (i < N);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr1[i] != 2+2*i)
+ abort ();
+ }
+
+ return m + k;
+}
+
+int main (void)
+{
+ int res;
+
+ check_vect ();
+
+ res = main1 ();
+ if (res != 32 + 275)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-3.c
new file mode 100644
index 000000000..fac303a67
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-3.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline)) int main1 ()
+{
+ int arr1[N];
+ int arr2[N];
+ int k = 0;
+ int m = 3, i = 0;
+
+ /* vectorization of induction.
+ Peeling to align the store is also applied. */
+
+ do {
+ k = k + 2;
+ arr1[i] = k;
+ m = k + 3;
+ arr2[i] = m;
+ i++;
+ } while (i < N);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr1[i] != 2+2*i || arr2[i] != 5 + 2*i)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-4.c
new file mode 100644
index 000000000..fe29cff18
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-4.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline)) int main1 ()
+{
+ unsigned int arr1[N];
+ unsigned short arr2[N];
+ unsigned int k = 0;
+ unsigned short m = 3;
+ int i = 0;
+
+ /* Vectorization of induction with multiple data types. */
+
+ do {
+ k = k + 2;
+ arr1[i] = k;
+ m = k + 3;
+ arr2[i] = m;
+ i++;
+ } while (i < N);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr1[i] != 2+2*i || arr2[i] != 5 + 2*i)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-5.c
new file mode 100644
index 000000000..886109500
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-5.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline)) int main1 ()
+{
+ float arr[N];
+ float f = 1.0;
+ int i;
+
+ /* Vectorization of fp induction. */
+
+ for (i=0; i<N; i++)
+ {
+ arr[i] = f;
+ f += 2.0;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr[i] != 1.0 + 2.0*i)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail {! arm_neon_ok } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-6.c
new file mode 100644
index 000000000..96d3fbf52
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-6.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int_mult } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+__attribute__ ((noinline)) int main1 (int X)
+{
+ int arr1[N+1];
+ int arr2[N+1];
+ int k = X;
+ int m, i=0;
+
+ /* Vectorization of induction with non-constant initial condition X.
+ Also we have here two uses of the induction-variable k as defined
+ by the loop-header phi (as opposed to the other uses of k that are
+ defined in the loop), in which case we exercise the fact that we
+ reuse the same vector def-use-cycle for both uses.
+ Peeling to align the store is also applied. This peeling also aligns
+ the load (as they have the same misalignment). */
+
+ do {
+ arr2[i+1] = 2*k;
+ k = k + 2;
+ arr1[i+1] = k;
+ k = k + 4;
+ i++;
+ } while (i < N);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr1[i+1] != X+6*i+2
+ || arr2[i+1] != 2*(X+6*i))
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (3);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-7.c
new file mode 100644
index 000000000..0d96ac2d4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-7.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int result[N] = {8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38};
+
+__attribute__ ((noinline, noclone)) int main1 (int X)
+{
+ int arr[N];
+ int k = 3;
+ int m, i=0;
+
+ /* Vectorization of induction with non-constant step X. */
+
+ do {
+ m = k + 5;
+ arr[i] = m;
+ k = k + X;
+ i++;
+ } while (i < N);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (arr[i] != result[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (2);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8-big-array.c
new file mode 100644
index 000000000..677b7a353
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8-big-array.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline)) int main1 (short X)
+{
+ unsigned char a[N];
+ unsigned short b[N];
+ unsigned int c[N];
+ short myX = X;
+ int i;
+
+ /* vectorization of induction with type conversions. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (unsigned char)X;
+ b[i] = X;
+ c[i] = (unsigned int)X;
+ X++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != (unsigned char)myX || b[i] != myX || c[i] != (unsigned int)myX++)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (3);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_trunc && vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8.c
new file mode 100644
index 000000000..6544988b2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 26
+
+__attribute__ ((noinline)) int main1 (short X)
+{
+ unsigned char a[N];
+ unsigned short b[N];
+ unsigned int c[N];
+ short myX = X;
+ int i;
+
+ /* vectorization of induction with type conversions. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (unsigned char)X;
+ b[i] = X;
+ c[i] = (unsigned int)X;
+ X++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != (unsigned char)myX || b[i] != myX || c[i] != (unsigned int)myX++)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (3);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_trunc && vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8a-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8a-big-array.c
new file mode 100644
index 000000000..100c7513c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8a-big-array.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+__attribute__ ((noinline)) int main1 (short X)
+{
+ signed char a[N];
+ short b[N];
+ int c[N];
+ short myX = X;
+ int i;
+
+ /* vectorization of induction with type conversions. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (signed char)X;
+ b[i] = X;
+ c[i] = (int)X;
+ X++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != (signed char)myX || b[i] != myX || c[i] != (int)myX++)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (3);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_trunc && vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8a.c
new file mode 100644
index 000000000..dc742eb84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-8a.c
@@ -0,0 +1,43 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 26
+
+__attribute__ ((noinline)) int main1 (short X)
+{
+ signed char a[N];
+ short b[N];
+ int c[N];
+ short myX = X;
+ int i;
+
+ /* vectorization of induction with type conversions. */
+ for (i = 0; i < N; i++)
+ {
+ a[i] = (signed char)X;
+ b[i] = X;
+ c[i] = (int)X;
+ X++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (a[i] != (signed char)myX || b[i] != myX || c[i] != (int)myX++)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 (3);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_trunc && vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-9.c
new file mode 100644
index 000000000..28ce927bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-iv-9.c
@@ -0,0 +1,38 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 26
+int a[N];
+
+__attribute__ ((noinline)) int main1 (int X)
+{
+ int s = X;
+ int i;
+
+ /* vectorization of reduction with induction. */
+ for (i = 0; i < N; i++)
+ s += (i + a[i]);
+
+ return s;
+}
+
+int main (void)
+{
+ int s, i;
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ a[i] = 2*i;
+
+ s = main1 (3);
+ if (s != 978)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_int_mult } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vect_int_mult } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-1.c
new file mode 100644
index 000000000..7900e5929
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "-O3 -fopt-info-vec-optimized" } */
+
+/* PR other/33426 */
+/* Testing whether #pragma ivdep is working. */
+
+void foo(int n, int *a, int *b, int *c, int *d, int *e) {
+ int i, j;
+#pragma GCC ivdep
+ for (i = 0; i < n; ++i) {
+ a[i] = b[i] + c[i];
+ }
+}
+
+/* { dg-message "loop vectorized" "" { target *-*-* } 0 } */
+/* { dg-bogus " version\[^\n\r]* alias" "" { target *-*-* } 0 } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c
new file mode 100644
index 000000000..4e3dcbd32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-ivdep-2.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "-O3 -fopt-info-vec-optimized" } */
+
+/* PR other/33426 */
+/* Testing whether #pragma ivdep is working. */
+
+void foo(int n, int *a, int *b, int *c) {
+ int i;
+ i = 0;
+#pragma GCC ivdep
+ while(i < n)
+ {
+ a[i] = b[i] + c[i];
+ ++i;
+ }
+}
+
+void bar(int n, int *a, int *b, int *c) {
+ int i;
+ i = 0;
+#pragma GCC ivdep
+ do
+ {
+ a[i] = b[i] + c[i];
+ ++i;
+ }
+ while(i < n);
+}
+
+
+/* { dg-message "loop vectorized" "" { target *-*-* } 0 } */
+/* { dg-bogus " version\[^\n\r]* alias" "" { target *-*-* } 0 } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-mask-load-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-mask-load-1.c
new file mode 100644
index 000000000..2c30830be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-mask-load-1.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-additional-options "-Ofast -fno-common" } */
+/* { dg-additional-options "-Ofast -fno-common -mavx" { target avx_runtime } } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+__attribute__((noinline, noclone)) void
+foo (double *x, double *y)
+{
+ double *p = __builtin_assume_aligned (x, 16);
+ double *q = __builtin_assume_aligned (y, 16);
+ double z, h;
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ if (p[i] < 0.0)
+ z = q[i], h = q[i] * 7.0 + 3.0;
+ else
+ z = p[i] + 6.0, h = p[1024 + i];
+ p[i] = z + 2.0 * h;
+ }
+}
+
+double a[2048] __attribute__((aligned (16)));
+double b[1024] __attribute__((aligned (16)));
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ for (i = 0; i < 1024; i++)
+ {
+ a[i] = (i & 1) ? -i : 2 * i;
+ a[i + 1024] = i;
+ b[i] = 7 * i;
+ asm ("");
+ }
+ foo (a, b);
+ for (i = 0; i < 1024; i++)
+ if (a[i] != ((i & 1)
+ ? 7 * i + 2.0 * (7 * i * 7.0 + 3.0)
+ : 2 * i + 6.0 + 2.0 * i)
+ || b[i] != 7 * i
+ || a[i + 1024] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "note: vectorized 1 loops" 1 "vect" { target avx_runtime } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-mask-loadstore-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-mask-loadstore-1.c
new file mode 100644
index 000000000..ecc164fe1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-mask-loadstore-1.c
@@ -0,0 +1,50 @@
+/* { dg-do run } */
+/* { dg-additional-options "-Ofast -fno-common" } */
+/* { dg-additional-options "-Ofast -fno-common -mavx" { target avx_runtime } } */
+
+#include <stdlib.h>
+#include "tree-vect.h"
+
+__attribute__((noinline, noclone)) void
+foo (float *__restrict x, float *__restrict y, float *__restrict z)
+{
+ float *__restrict p = __builtin_assume_aligned (x, 32);
+ float *__restrict q = __builtin_assume_aligned (y, 32);
+ float *__restrict r = __builtin_assume_aligned (z, 32);
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ if (p[i] < 0.0f)
+ q[i] = p[i] + 2.0f;
+ else
+ p[i] = r[i] + 3.0f;
+ }
+}
+
+float a[1024] __attribute__((aligned (32)));
+float b[1024] __attribute__((aligned (32)));
+float c[1024] __attribute__((aligned (32)));
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ for (i = 0; i < 1024; i++)
+ {
+ a[i] = (i & 1) ? -i : i;
+ b[i] = 7 * i;
+ c[i] = a[i] - 3.0f;
+ asm ("");
+ }
+ foo (a, b, c);
+ for (i = 0; i < 1024; i++)
+ if (a[i] != ((i & 1) ? -i : i)
+ || b[i] != ((i & 1) ? a[i] + 2.0f : 7 * i)
+ || c[i] != a[i] - 3.0f)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "note: vectorized 1 loops" 1 "vect" { target avx_runtime } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
new file mode 100644
index 000000000..7ab21f1df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
@@ -0,0 +1,87 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+short sa[N];
+short sb[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+int ia[N];
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+/* Current peeling-for-alignment scheme will consider the 'sa[i+7]'
+ access for peeling, and therefore will examine the option of
+ using a peeling factor = V-7%V = 1,3 for V=8,4 respectively,
+ which will also align the access to 'ia[i+3]', and the loop could be
+ vectorized on all targets that support unaligned loads. */
+
+__attribute__ ((noinline)) int main1 (int n)
+{
+ int i;
+
+ /* Multiple types with different sizes, used in idependent
+ copmutations. Vectorizable. */
+ for (i = 0; i < n; i++)
+ {
+ sa[i+7] = sb[i];
+ ia[i+3] = ib[i+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (sa[i+7] != sb[i] || ia[i+3] != ib[i+1])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* Current peeling-for-alignment scheme will consider the 'ia[i+3]'
+ access for peeling, and therefore will examine the option of
+ using a peeling factor = (V-3)%V = 1 for V=2,4.
+ This will not align the access 'sa[i+3]' (for which we need to
+ peel 5 iterations). However, 'ia[i+3]' also gets aligned if we peel 5
+ iterations, so the loop is vectorizable on all targets that support
+ unaligned loads. */
+
+__attribute__ ((noinline)) int main2 (int n)
+{
+ int i;
+
+ /* Multiple types with different sizes, used in independent
+ copmutations. */
+ for (i = 0; i < n; i++)
+ {
+ ia[i+3] = ib[i];
+ sa[i+3] = sb[i+1];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (sa[i+3] != sb[i+1] || ia[i+3] != ib[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N-7);
+ main2 (N-3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {{ vect_no_align } || {vect_sizes_32B_16B }}} } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail {{ vect_no_align } || {vect_sizes_32B_16B }}} } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-10.c
new file mode 100644
index 000000000..60a4fc854
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-10.c
@@ -0,0 +1,68 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned short uY[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned int uresult[N];
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int result[N];
+
+/* Unsigned type promotion (hi->si) */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uX[i] = 5;
+ uresult[i] = (unsigned int)uY[i];
+ }
+}
+
+/* Signed type promotion (hi->si) */
+__attribute__ ((noinline)) int
+foo2(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uX[i] = 5;
+ result[i] = (int)Y[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = 16-i;
+ uX[i] = 16-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresult[i] != (unsigned short)uY[i])
+ abort ();
+ }
+
+ foo2 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != (short)Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-11.c
new file mode 100644
index 000000000..9cb8c1dfe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-11.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+short x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) int
+foo (int len, int *z) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ z[i] = x[i];
+ }
+}
+
+
+int main (void)
+{
+ short i;
+ int z[N+4];
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ x[i] = i;
+ }
+
+ foo (N,z+2);
+
+ for (i=0; i<N; i++) {
+ if (z[i+2] != x[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c
new file mode 100644
index 000000000..45b42cd26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-12.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) int
+foo (int len, int *z) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ z[i] = x[i];
+ }
+}
+
+
+int main (void)
+{
+ char i;
+ int z[N+4];
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ x[i] = i;
+ }
+
+ foo (N,z+2);
+
+ for (i=0; i<N; i++) {
+ if (z[i+2] != x[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* bleah */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target sparc*-*-* xfail ilp32 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { ! sparc*-*-* } && { ! vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-13.c
new file mode 100644
index 000000000..4200e62a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-13.c
@@ -0,0 +1,64 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned int uresult[N];
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int result[N];
+
+/* Unsigned type promotion (qi->si) */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uresult[i] = (unsigned int)uX[i];
+ }
+}
+
+/* Signed type promotion (qi->si) */
+__attribute__ ((noinline)) int
+foo2(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ result[i] = (int)X[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = 16-i;
+ uX[i] = 16-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresult[i] != (unsigned int)uX[i])
+ abort ();
+ }
+
+ foo2 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != (int)X[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-14.c
new file mode 100644
index 000000000..816f4e49c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-14.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned char uresultX[N];
+unsigned int uY[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned char uresultY[N];
+
+/* Unsigned type demotion (si->qi) */
+
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uresultX[i] = uX[i];
+ uresultY[i] = (unsigned char)uY[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ uX[i] = 16-i;
+ uY[i] = 16-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresultX[i] != uX[i])
+ abort ();
+ if (uresultY[i] != (unsigned char)uY[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-15.c
new file mode 100644
index 000000000..145bb5d7e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-15.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT1 43680
+#define DOT2 -20832
+
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned char CX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo1(int len) {
+ int i;
+ int result1 = 0;
+
+ for (i=0; i<len; i++) {
+ result1 += (X[i] * Y[i]);
+ CX[i] = 5;
+ }
+
+ if (result1 != DOT1)
+ abort ();
+}
+
+
+int main (void)
+{
+ int i, dot1, dot2;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ CX[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_sdot_hi || vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c
new file mode 100644
index 000000000..176333c2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_long_long } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+
+__attribute__ ((noinline)) int
+foo (int len, long long *z) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ z[i] = x[i];
+ }
+}
+
+
+int main (void)
+{
+ char i;
+ long long z[N+4];
+
+ check_vect ();
+
+ foo (N,z+2);
+
+ for (i=0; i<N; i++) {
+ if (z[i+2] != x[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_unpack } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c
new file mode 100644
index 000000000..b2f810582
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_long_long } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+unsigned char uresultX[N];
+unsigned long long uY[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+unsigned char uresultY[N];
+
+/* Unsigned type demotion (si->qi) */
+
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uresultX[i] = uX[i];
+ uresultY[i] = (unsigned char)uY[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresultX[i] != uX[i])
+ abort ();
+ if (uresultY[i] != (unsigned char)uY[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c
new file mode 100644
index 000000000..4ae47f2c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int ia[N];
+int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+short sa[N];
+short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+char ca[N];
+char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline)) int main1 ()
+{
+ int i;
+
+ /* Multiple types with different sizes, used in independent
+ cmputations. Vectorizable. All accesses aligned. */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i];
+ sa[i] = sb[i];
+ ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i]
+ || sa[i] != sb[i]
+ || ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
new file mode 100644
index 000000000..93796d0ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+int ib[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+short sb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 (int n, int * __restrict__ pib,
+ short * __restrict__ psb,
+ char * __restrict__ pcb)
+{
+ int i;
+ int ia[N];
+ short sa[N];
+ char ca[N];
+
+ /* Multiple types with different sizes, used in independent
+ computations. Vectorizable. The loads are misaligned. */
+ for (i = 0; i < n; i++)
+ {
+ ia[i] = pib[i];
+ sa[i] = psb[i];
+ ca[i] = pcb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (ia[i] != pib[i]
+ || sa[i] != psb[i]
+ || ca[i] != pcb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N, ib, sb, cb);
+ main1 (N-3, ib, sb, &cb[2]);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { vect_no_align } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
new file mode 100644
index 000000000..ed6ac6eda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
@@ -0,0 +1,100 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned short sa[N];
+unsigned short sc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+unsigned short sb[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
+ 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+unsigned int ia[N];
+unsigned int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+unsigned int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+/* Current peeling-for-alignment scheme will consider the 'sa[i+7]'
+ access for peeling, and therefore will examine the option of
+ using a peeling factor = VF-7%VF. This will result in a peeling factor 1,
+ which will also align the access to 'ia[i+3]', and the loop could be
+ vectorized on all targets that support unaligned loads.
+ Without cost model on targets that support misaligned stores, no peeling
+ will be applied since we want to keep the four loads aligned. */
+
+__attribute__ ((noinline))
+int main1 (int n)
+{
+ int i;
+
+ /* Multiple types with different sizes, used in independent
+ copmutations. Vectorizable. */
+ for (i = 0; i < n; i++)
+ {
+ sa[i+7] = sb[i] + sc[i];
+ ia[i+3] = ib[i] + ic[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (sa[i+7] != sb[i] + sc[i] || ia[i+3] != ib[i] + ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* Current peeling-for-alignment scheme will consider the 'ia[i+3]'
+ access for peeling, and therefore will examine the option of
+ using a peeling factor = VF-3%VF. This will result in a peeling factor
+ 1 if VF=4,2. This will not align the access to 'sa[i+3]', for which we
+ need to peel 5,1 iterations for VF=4,2 respectively, so the loop can not
+ be vectorized. However, 'ia[i+3]' also gets aligned if we peel 5
+ iterations, so the loop is vectorizable on all targets that support
+ unaligned loads.
+ Without cost model on targets that support misaligned stores, no peeling
+ will be applied since we want to keep the four loads aligned. */
+
+__attribute__ ((noinline))
+int main2 (int n)
+{
+ int i;
+
+ /* Multiple types with different sizes, used in independent
+ copmutations. Vectorizable. */
+ for (i = 0; i < n; i++)
+ {
+ ia[i+3] = ib[i] + ic[i];
+ sa[i+3] = sb[i] + sc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (sa[i+3] != sb[i] + sc[i] || ia[i+3] != ib[i] + ic[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N-7);
+ main2 (N-3);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { target { vect_element_align} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { xfail { vect_no_align || vect_element_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target { vect_element_align } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c
new file mode 100644
index 000000000..30ec68406
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned int ia[N];
+unsigned int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short sa[N];
+unsigned short sc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char ca[N];
+unsigned char cc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ /* Multiple types with different sizes, used in independent
+ computations. Vectorizable. All accesses aligned. */
+ for (i = 0; i < N; i++)
+ {
+ ia[i] = ib[i] + ic[i];
+ sa[i] = sb[i] + sc[i];
+ ca[i] = cb[i] + cc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (ia[i] != ib[i] + ic[i]
+ || sa[i] != sb[i] + sc[i]
+ || ca[i] != cb[i] + cc[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { sparc*-*-* && ilp32 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
new file mode 100644
index 000000000..7f7278506
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
@@ -0,0 +1,67 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-add-options double_vectors } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned int ic[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int ib[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short sc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short sb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char cc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
+ {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+
+__attribute__ ((noinline))
+int main1 (int n,
+ unsigned int * __restrict__ pic, unsigned int * __restrict__ pib,
+ unsigned short * __restrict__ psc, unsigned short * __restrict__ psb,
+ unsigned char * __restrict__ pcc, unsigned char * __restrict__ pcb)
+{
+ int i;
+ unsigned int ia[N];
+ unsigned short sa[N];
+ unsigned char ca[N];
+
+ /* Multiple types with different sizes, used in independent
+ computations. Vectorizable. The loads are misaligned. */
+ for (i = 0; i < n; i++)
+ {
+ ia[i] = pib[i] + pic[i];
+ sa[i] = psb[i] + psc[i];
+ ca[i] = pcb[i] + pcc[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (ia[i] != pib[i] + pic[i]
+ || sa[i] != psb[i] + psc[i]
+ || ca[i] != pcb[i] + pcc[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N, ic, ib, sc, sb, cc, cb);
+ main1 (N-3, ic, ib, &sc[1], sb, cc, &cb[2]);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { sparc*-*-* && ilp32 } }} } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail { vect_no_align } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-7.c
new file mode 100644
index 000000000..ae6ee1a06
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-7.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT1 43680
+#define DOT2 -20832
+
+signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned char CX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo1(int len) {
+ int i;
+ int result1 = 0;
+ short prod;
+
+ for (i=0; i<len; i++) {
+ result1 += (X[i] * Y[i]);
+ CX[i] = 5;
+ }
+
+ if (result1 != DOT1)
+ abort ();
+}
+
+
+int main (void)
+{
+ int i, dot1, dot2;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ CX[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_hi } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-8.c
new file mode 100644
index 000000000..699c87bd1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-8.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned char uresultX[N];
+unsigned int uY[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned short uresultY[N];
+
+/* Unsigned type demotion (si->hi) */
+
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uresultX[i] = uX[i];
+ uresultY[i] = (unsigned short)uY[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ uX[i] = 16-i;
+ uY[i] = 16-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresultX[i] != uX[i])
+ abort ();
+ if (uresultY[i] != (unsigned short)uY[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-9.c
new file mode 100644
index 000000000..9313f2a23
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-multitypes-9.c
@@ -0,0 +1,64 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char uX[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned short uresult[N];
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+short result[N];
+
+/* Unsigned type promotion (qi->hi) */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ uresult[i] = (unsigned short)uX[i];
+ }
+}
+
+/* Signed type promotion (qi->hi) */
+__attribute__ ((noinline)) int
+foo2(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ result[i] = (short)X[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = 16-i;
+ uX[i] = 16-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (uresult[i] != (unsigned short)uX[i])
+ abort ();
+ }
+
+ foo2 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != (short)X[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-neg-store-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-neg-store-1.c
new file mode 100644
index 000000000..178f0a1ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-neg-store-1.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdlib.h>
+
+__attribute__((noinline, noclone))
+void test1(short x[128])
+{
+ int i;
+ for (i=127; i>=0; i--) {
+ x[i] = 1234;
+ }
+}
+
+int main (void)
+{
+ short x[128 + 32];
+ int i;
+
+ for (i = 0; i < 16; i ++)
+ {
+ asm ("");
+ x[i] = x[i + 144] = 5678;
+ }
+
+ test1 (x + 16);
+
+ for (i = 0; i < 128; i++)
+ if (x[i + 16] != 1234)
+ abort ();
+
+ for (i = 0; i < 16; i++)
+ if (x[i] != 5678
+ || x[i + 144] != 5678)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-neg-store-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-neg-store-2.c
new file mode 100644
index 000000000..e97b9bf40
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-neg-store-2.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdlib.h>
+
+__attribute__((noinline, noclone))
+void test1(short x[128], short D)
+{
+ int i;
+ for (i=127; i>=0; i--) {
+ x[i] = D;
+ }
+}
+
+int main (void)
+{
+ short x[128 + 32];
+ int i;
+
+ for (i = 0; i < 16; i ++)
+ {
+ asm ("");
+ x[i] = x[i + 144] = 5678;
+ }
+
+ test1 (x + 16, 1234);
+
+ for (i = 0; i < 128; i++)
+ if (x[i + 16] != 1234)
+ abort ();
+
+ for (i = 0; i < 16; i++)
+ if (x[i] != 5678
+ || x[i + 144] != 5678)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-1.c
new file mode 100644
index 000000000..84883ca19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-1.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float in[N] = {232,132,32,432,532,321,327,323,321,324,322,329,432,832,932,232};
+float out[N];
+float check_res[N] = {112,-4,-120,264,348,121,111,91,73,60,42,33,120,504,588,-128};
+float a[2*N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int i, j;
+ float res;
+
+ for (i = 0; i < N; i++)
+ {
+ res = in[i];
+
+ for (j = 0; j < N; j++)
+ res = res - a[i+j];
+
+ out[i] = res;
+ }
+
+ for (i = 0; i < N; i++)
+ if (out[i] != check_res[i])
+ abort ();
+
+}
+
+int main ()
+{
+ check_vect ();
+
+ foo();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-2.c
new file mode 100644
index 000000000..22b1d98de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-2.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float out[N];
+float check_res[N] = {880,864,848,832,816,800,784,768,752,736,720,704,688,672,656,640};
+float a[2*N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int i, j;
+ float res;
+
+ for (i = 0; i < N; i++)
+ {
+ res = 1000;
+
+ for (j = 0; j < N; j++)
+ res = res - a[i+j];
+
+ out[i] = res;
+ }
+
+ for (i = 0; i < N; i++)
+ if (out[i] != check_res[i])
+ abort ();
+
+}
+
+int main ()
+{
+ check_vect ();
+
+ foo();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-3.c
new file mode 100644
index 000000000..0c8f91307
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nest-cycle-3.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 82
+
+float c[N][N], b[N][N], a[N];
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i, j;
+ float diff;
+
+ /* In inner loop vectorization -funsafe-math-optimizations is needed to
+ vectorize the summation. But in outer loop vectorization the order of
+ calculation doesn't change, therefore, there is no need in that flag. */
+ for (i = 0; i < N; i++)
+ {
+ diff = 2;
+ for (j = 0; j < N; j++)
+ diff += (b[j][i] - c[j][i]);
+
+ a[i] = diff;
+ }
+
+ /* Check results: */
+ for (i = 0; i < N; i++)
+ if (a[i] != DIFF)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int i, j;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ b[i][j] = i+j+5;
+ c[i][j] = i+j;
+ }
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nop-move.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nop-move.c
new file mode 100644
index 000000000..f8c980a3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-nop-move.c
@@ -0,0 +1,83 @@
+/* { dg-do run } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-additional-options "-fdump-rtl-combine-details" } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+
+#define NOINLINE __attribute__((noinline))
+
+typedef float float32x4_t __attribute__ ((__vector_size__ (16)));
+typedef float float32x2_t __attribute__ ((__vector_size__ (8)));
+
+NOINLINE float
+foo32x4_be (float32x4_t x)
+{
+ return x[3];
+}
+
+NOINLINE float
+foo32x4_le (float32x4_t x)
+{
+ return x[0];
+}
+
+NOINLINE float
+bar (float a)
+{
+ return a;
+}
+
+NOINLINE float
+foo32x2_be (float32x2_t x)
+{
+#ifdef __i386__
+ /* ix86 passes float32x2 vector arguments in mmx registers. We need to
+ emit emms to empty MMS state and reenable x87 stack before float value
+ can be loaded to and passed in x87 floating-point return register. */
+ __builtin_ia32_emms ();
+#endif
+ return bar (x[1]);
+}
+
+NOINLINE float
+foo32x2_le (float32x2_t x)
+{
+#ifdef __i386__
+ __builtin_ia32_emms ();
+#endif
+ return bar (x[0]);
+}
+
+NOINLINE int
+test (void)
+{
+ float32x4_t a = { 0.0f, 1.0f, 2.0f, 3.0f };
+ float32x2_t b = { 0.0f, 1.0f };
+
+ if (foo32x2_be (b) != 1.0f)
+ abort ();
+
+ if (foo32x2_le (b) != 0.0f)
+ abort ();
+
+ if (foo32x4_be (a) != 3.0f)
+ abort ();
+
+ if (foo32x4_le (a) != 0.0f)
+ abort ();
+
+ return 0;
+}
+
+int
+main ()
+{
+ check_vect ();
+ return test ();
+}
+
+/* { dg-final { scan-rtl-dump "deleting noop move" "combine" { target aarch64*-*-* } } } */
+/* { dg-final { cleanup-rtl-dump "combine" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1-big-array.c
new file mode 100644
index 000000000..3f23aeedf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1-big-array.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#define N 256
+signed short image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short block[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short out[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* Can't do outer-loop vectorization because of non-consecutive access. */
+
+void
+foo (){
+ int i,j;
+ int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j+=8) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1.c
new file mode 100644
index 000000000..623d146d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#define N 64
+signed short image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short block[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short out[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* Can't do outer-loop vectorization because of non-consecutive access. */
+
+void
+foo (){
+ int i,j;
+ int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j+=8) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1a-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1a-big-array.c
new file mode 100644
index 000000000..416cce187
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1a-big-array.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+#define N 256
+signed short image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short block[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* Can't do outer-loop vectorization because of non-consecutive access. */
+
+int
+foo (){
+ int i,j;
+ int diff = 0;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j+=8) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ }
+ return diff;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c
new file mode 100644
index 000000000..a8dce0512
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+#define N 64
+signed short image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short block[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* Can't do outer-loop vectorization because of non-consecutive access. */
+
+int
+foo (){
+ int i,j;
+ int diff = 0;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j+=8) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ }
+ return diff;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1b-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1b-big-array.c
new file mode 100644
index 000000000..7c03540ec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1b-big-array.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#define N 160
+signed short image[N][N];
+signed short block[N][N];
+signed short out[N];
+
+/* Outer-loop cannot get vectorized because of non-consecutive access. */
+
+void
+foo (){
+ int i,j;
+ int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j+=4) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1b.c
new file mode 100644
index 000000000..2c4a7392c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-1b.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#define N 40
+signed short image[N][N];
+signed short block[N][N];
+signed short out[N];
+
+/* Outer-loop cannot get vectorized because of non-consecutive access. */
+
+void
+foo (){
+ int i,j;
+ int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j+=4) {
+ diff += (image[i][j] - block[i][j]);
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2-big-array.c
new file mode 100644
index 000000000..ba3fa87b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2-big-array.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 160
+float image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float out[N];
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[j][i] = j+i;
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ if (image[j][i] != j+i)
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2.c
new file mode 100644
index 000000000..38701977b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float out[N];
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[j][i] = j+i;
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ if (image[j][i] != j+i)
+ abort ();
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2a-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2a-big-array.c
new file mode 100644
index 000000000..062e1fdd4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2a-big-array.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 160
+float image[N][N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j,k;
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[k][j][i] = j+i+k;
+ }
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j, k;
+
+ foo ();
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ if (image[k][j][i] != j+i+k)
+ abort ();
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2a.c
new file mode 100644
index 000000000..b8d0e51fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2a.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[N][N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j,k;
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[k][j][i] = j+i+k;
+ }
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j, k;
+
+ foo ();
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ if (image[k][j][i] != j+i+k)
+ abort ();
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2b.c
new file mode 100644
index 000000000..fccd13dcf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2b.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_float } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[2*N][N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j,k;
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[k+i][j][i] = j+i+k;
+ }
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j, k;
+
+ foo ();
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ if (image[k+i][j][i] != j+i+k)
+ abort ();
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2c-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2c-big-array.c
new file mode 100644
index 000000000..cdea72aab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2c-big-array.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 160
+float image[2*N][2*N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j,k;
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j+=2) {
+ image[k][j][i] = j+i+k;
+ }
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j, k;
+
+ foo ();
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j+=2) {
+ if (image[k][j][i] != j+i+k)
+ abort ();
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2c.c
new file mode 100644
index 000000000..0ca868637
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2c.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[2*N][2*N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j,k;
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j+=2) {
+ image[k][j][i] = j+i+k;
+ }
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j, k;
+
+ foo ();
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j+=2) {
+ if (image[k][j][i] != j+i+k)
+ abort ();
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2d.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2d.c
new file mode 100644
index 000000000..3e19d47b3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-2d.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_float } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[N][N][N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j,k;
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < i+1; j++) {
+ image[k][j][i] = j+i+k;
+ }
+ }
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j, k;
+
+ foo ();
+
+ for (k=0; k<N; k++) {
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < i+1; j++) {
+ if (image[k][j][i] != j+i+k)
+ abort ();
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3-big-array.c
new file mode 100644
index 000000000..83b6f994c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3-big-array.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_float } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 320
+float image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float out[N];
+
+/* Outer-loop vectoriation. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][i];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[i][j]=i+j;
+ }
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][i];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3.c
new file mode 100644
index 000000000..924700c58
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_float } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float out[N];
+
+/* Outer-loop vectoriation. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][i];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[i][j]=i+j;
+ }
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][i];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c
new file mode 100644
index 000000000..ecb2d9076
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3a-big-array.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_float } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 320
+float image[N][N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float out[N];
+
+/* Outer-loop vectorization with misaliged accesses in the inner-loop. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][i];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[i][j]=i+j;
+ }
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][i];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "step doesn't divide the vector-size" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3a.c
new file mode 100644
index 000000000..d0b4f8074
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3a.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_float } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[N][N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float out[N];
+
+/* Outer-loop vectorization with misaliged accesses in the inner-loop. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][i];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[i][j]=i+j;
+ }
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][i];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "step doesn't divide the vector-size" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3b.c
new file mode 100644
index 000000000..de16fa5cc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3b.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_float } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[N][N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float out[N];
+
+/* Outer-loop vectorization with non-consecutive access. Not vectorized yet. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N/2; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][2*i];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[i][j]=i+j;
+ }
+ }
+
+ foo ();
+
+ for (i = 0; i < N/2; i++) {
+ diff = 0;
+ for (j = 0; j < N; j++) {
+ diff += image[j][2*i];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 2 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "grouped access in outer loop" 4 "vect" { target vect_multiple_sizes } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3c.c
new file mode 100644
index 000000000..599137ba1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-3c.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_float } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+float image[N][N+1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float out[N];
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j+=4) {
+ diff += image[j][i];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ for (j = 0; j < N; j++) {
+ image[i][j]=i+j;
+ }
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < N; j+=4) {
+ diff += image[j][i];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4.c
new file mode 100644
index 000000000..8f53f2553
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+#define M 128
+float in[N+M];
+float coeff[M];
+float out[N];
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=4) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < M; i++)
+ coeff[i] = i;
+ for (i = 0; i < N+M; i++)
+ in[i] = i;
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=4) {
+ diff += in[j+i]*coeff[j];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4a-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4a-big-array.c
new file mode 100644
index 000000000..af9d2a88b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4a-big-array.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+#define N 512
+#define M 1024
+signed short in[N+M];
+signed short coeff[M];
+signed short out[N];
+
+/* Outer-loop vectorization. */
+
+void
+foo (){
+ int i,j;
+ int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target { vect_widen_mult_hi_to_si && vect_pack_trunc } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4a.c
new file mode 100644
index 000000000..d7bcc9a2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4a.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+#define N 40
+#define M 128
+signed short in[N+M];
+signed short coeff[M];
+signed short out[N];
+
+/* Outer-loop vectorization. */
+
+void
+foo (){
+ int i,j;
+ int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target { vect_widen_mult_hi_to_si && vect_pack_trunc } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4b-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4b-big-array.c
new file mode 100644
index 000000000..703ac9483
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4b-big-array.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+#define N 320
+#define M 1024
+signed short in[N+M];
+signed short coeff[M];
+int out[N];
+
+/* Outer-loop vectorization. */
+
+void
+foo (){
+ int i,j;
+ int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4b.c
new file mode 100644
index 000000000..407315a8d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4b.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+#define N 40
+#define M 128
+signed short in[N+M];
+signed short coeff[M];
+int out[N];
+
+/* Outer-loop vectorization. */
+
+void
+foo (){
+ int i,j;
+ int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4c-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4c-big-array.c
new file mode 100644
index 000000000..ded404987
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4c-big-array.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 320
+#define M 1024
+unsigned short in[N+M];
+unsigned short coeff[M];
+unsigned int out[N];
+
+/* Outer-loop vectorization. */
+
+void
+foo (){
+ int i,j;
+ unsigned short diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target { vect_short_mult && { ! vect_no_align } } } } } */
+/* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4c.c
new file mode 100644
index 000000000..cde59a135
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4c.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 40
+#define M 128
+unsigned short in[N+M];
+unsigned short coeff[M];
+unsigned int out[N];
+
+/* Outer-loop vectorization. */
+
+void
+foo (){
+ int i,j;
+ unsigned short diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target { vect_short_mult && { ! vect_no_align } } } } } */
+/* { dg-final { scan-tree-dump "zero step in outer loop." "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4d-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4d-big-array.c
new file mode 100644
index 000000000..0d85bed60
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4d-big-array.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 320
+#define M 1024
+float in[N+M];
+float out[N];
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=4) {
+ diff += in[j+i];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < N; i++)
+ in[i] = i;
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=4) {
+ diff += in[j+i];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4d.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4d.c
new file mode 100644
index 000000000..c344fb1d6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4d.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+#define M 128
+float in[N+M];
+float out[N];
+
+/* Outer-loop vectorization. */
+
+__attribute__ ((noinline)) void
+foo (){
+ int i,j;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=4) {
+ diff += in[j+i];
+ }
+ out[i]=diff;
+ }
+}
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < N; i++)
+ in[i] = i;
+
+ foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=4) {
+ diff += in[j+i];
+ }
+ if (out[i] != diff)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4e.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4e.c
new file mode 100644
index 000000000..243cc1af7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4e.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#define N 40
+#define M 128
+unsigned int in[N+M];
+unsigned short out[N];
+
+/* Outer-loop vectorization. */
+
+void
+foo (){
+ int i,j;
+ unsigned int diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ out[i]=(unsigned short)diff;
+ }
+
+ return;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4f.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4f.c
new file mode 100644
index 000000000..c6cc4a8d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4f.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 96
+#define M 128
+unsigned short in[N+M];
+unsigned int out[N];
+unsigned char arr[N];
+
+/* Outer-loop vectorization. */
+/* Not vectorized due to multiple-types in the inner-loop. */
+
+__attribute__ ((noinline)) unsigned int
+foo (){
+ int i,j;
+ unsigned int diff;
+ unsigned int s=0;
+
+ for (i = 0; i < N; i++) {
+ arr[i] = 3;
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s+=diff;
+ }
+ return s;
+}
+
+__attribute__ ((noinline)) unsigned int
+bar (int i, unsigned int diff, unsigned short *in)
+{
+ int j;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ return diff;
+}
+
+int main (void)
+{
+ int i, j;
+ unsigned int diff;
+ unsigned int s=0,sum=0;
+
+ check_vect ();
+
+ for (i = 0; i < N+M; i++) {
+ in[i] = i;
+ }
+
+ sum=foo ();
+
+ for (i = 0; i < N; i++) {
+ arr[i] = 3;
+ diff = 0;
+ diff = bar (i, diff, in);
+ s += diff;
+ }
+
+ if (s != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4g.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4g.c
new file mode 100644
index 000000000..c6cc4a8d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4g.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 96
+#define M 128
+unsigned short in[N+M];
+unsigned int out[N];
+unsigned char arr[N];
+
+/* Outer-loop vectorization. */
+/* Not vectorized due to multiple-types in the inner-loop. */
+
+__attribute__ ((noinline)) unsigned int
+foo (){
+ int i,j;
+ unsigned int diff;
+ unsigned int s=0;
+
+ for (i = 0; i < N; i++) {
+ arr[i] = 3;
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s+=diff;
+ }
+ return s;
+}
+
+__attribute__ ((noinline)) unsigned int
+bar (int i, unsigned int diff, unsigned short *in)
+{
+ int j;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ return diff;
+}
+
+int main (void)
+{
+ int i, j;
+ unsigned int diff;
+ unsigned int s=0,sum=0;
+
+ check_vect ();
+
+ for (i = 0; i < N+M; i++) {
+ in[i] = i;
+ }
+
+ sum=foo ();
+
+ for (i = 0; i < N; i++) {
+ arr[i] = 3;
+ diff = 0;
+ diff = bar (i, diff, in);
+ s += diff;
+ }
+
+ if (s != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4i.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4i.c
new file mode 100644
index 000000000..a244ac20a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4i.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 96
+#define M 128
+unsigned char in[N+M];
+unsigned short out[N];
+
+/* Outer-loop vectorization. */
+/* Multiple-types in the inner-loop. */
+
+__attribute__ ((noinline))
+unsigned short
+foo (){
+ int i,j;
+ unsigned short diff;
+ unsigned short s=0;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s+=diff;
+ }
+ return s;
+}
+
+int main (void)
+{
+ check_vect ();
+ int i;
+ unsigned short s;
+
+ for (i = 0; i < N+M; i++)
+ in[i] = (unsigned char)i;
+
+ s = foo ();
+
+ if (s != 34048)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4j.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4j.c
new file mode 100644
index 000000000..db8f61c5e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4j.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+#define N 96
+#define M 128
+unsigned char in[N+M];
+unsigned short out[N];
+
+/* Outer-loop vectorization. */
+
+void
+foo (){
+ int i,j;
+ unsigned short diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ out[i]=diff;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4k.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4k.c
new file mode 100644
index 000000000..c6cc4a8d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4k.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 96
+#define M 128
+unsigned short in[N+M];
+unsigned int out[N];
+unsigned char arr[N];
+
+/* Outer-loop vectorization. */
+/* Not vectorized due to multiple-types in the inner-loop. */
+
+__attribute__ ((noinline)) unsigned int
+foo (){
+ int i,j;
+ unsigned int diff;
+ unsigned int s=0;
+
+ for (i = 0; i < N; i++) {
+ arr[i] = 3;
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s+=diff;
+ }
+ return s;
+}
+
+__attribute__ ((noinline)) unsigned int
+bar (int i, unsigned int diff, unsigned short *in)
+{
+ int j;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ return diff;
+}
+
+int main (void)
+{
+ int i, j;
+ unsigned int diff;
+ unsigned int s=0,sum=0;
+
+ check_vect ();
+
+ for (i = 0; i < N+M; i++) {
+ in[i] = i;
+ }
+
+ sum=foo ();
+
+ for (i = 0; i < N; i++) {
+ arr[i] = 3;
+ diff = 0;
+ diff = bar (i, diff, in);
+ s += diff;
+ }
+
+ if (s != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4l.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4l.c
new file mode 100644
index 000000000..c6cc4a8d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4l.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 96
+#define M 128
+unsigned short in[N+M];
+unsigned int out[N];
+unsigned char arr[N];
+
+/* Outer-loop vectorization. */
+/* Not vectorized due to multiple-types in the inner-loop. */
+
+__attribute__ ((noinline)) unsigned int
+foo (){
+ int i,j;
+ unsigned int diff;
+ unsigned int s=0;
+
+ for (i = 0; i < N; i++) {
+ arr[i] = 3;
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s+=diff;
+ }
+ return s;
+}
+
+__attribute__ ((noinline)) unsigned int
+bar (int i, unsigned int diff, unsigned short *in)
+{
+ int j;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ return diff;
+}
+
+int main (void)
+{
+ int i, j;
+ unsigned int diff;
+ unsigned int s=0,sum=0;
+
+ check_vect ();
+
+ for (i = 0; i < N+M; i++) {
+ in[i] = i;
+ }
+
+ sum=foo ();
+
+ for (i = 0; i < N; i++) {
+ arr[i] = 3;
+ diff = 0;
+ diff = bar (i, diff, in);
+ s += diff;
+ }
+
+ if (s != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4m-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4m-big-array.c
new file mode 100644
index 000000000..9a1e02e03
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4m-big-array.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 320
+#define M 1024
+unsigned short in[N+M];
+unsigned int out[N];
+
+/* Outer-loop vectorization. */
+/* Not vectorized due to multiple-types in the inner-loop. */
+
+__attribute__ ((noinline)) unsigned int
+foo (){
+ int i,j;
+ unsigned int diff;
+ unsigned int s=0;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s+=((unsigned short)diff>>3);
+ }
+ return s;
+}
+
+int main (void)
+{
+ int i, j;
+ unsigned int diff;
+ unsigned int s=0,sum=0;
+
+ check_vect ();
+
+ for (i = 0; i < N+M; i++) {
+ in[i] = i;
+ }
+
+ sum=foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s += ((unsigned short)diff>>3);
+ }
+
+ if (s != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4m.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4m.c
new file mode 100644
index 000000000..6e032f13c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-4m.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+#define M 128
+unsigned short in[N+M];
+unsigned int out[N];
+
+/* Outer-loop vectorization. */
+/* Not vectorized due to multiple-types in the inner-loop. */
+
+__attribute__ ((noinline)) unsigned int
+foo (){
+ int i,j;
+ unsigned int diff;
+ unsigned int s=0;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s+=((unsigned short)diff>>3);
+ }
+ return s;
+}
+
+int main (void)
+{
+ int i, j;
+ unsigned int diff;
+ unsigned int s=0,sum=0;
+
+ check_vect ();
+
+ for (i = 0; i < N+M; i++) {
+ in[i] = i;
+ }
+
+ sum=foo ();
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j+=8) {
+ diff += in[j+i];
+ }
+ s += ((unsigned short)diff>>3);
+ }
+
+ if (s != sum)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-5.c
new file mode 100644
index 000000000..2d37d6d14
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-5.c
@@ -0,0 +1,82 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 64
+#define MAX 42
+
+extern void abort(void);
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ float A[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float B[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float C[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float D[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+ float E[4] = {0,480,960,1440};
+ float s;
+
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ {
+ A[i] = i;
+ B[i] = i;
+ C[i] = i;
+ D[i] = i;
+ }
+
+ /* Outer-loop 1: Vectorizable with respect to dependence distance. */
+ for (i = 0; i < N-20; i++)
+ {
+ s = 0;
+ for (j=0; j<N; j+=4)
+ s += C[j];
+ A[i] = A[i+20] + s;
+ }
+
+ /* check results: */
+ for (i = 0; i < N-20; i++)
+ {
+ s = 0;
+ for (j=0; j<N; j+=4)
+ s += C[j];
+ if (A[i] != D[i+20] + s)
+ abort ();
+ }
+
+ /* Outer-loop 2: Not vectorizable because of dependence distance. */
+ for (i = 0; i < 4; i++)
+ {
+ s = 0;
+ for (j=0; j<N; j+=4)
+ s += C[j];
+ B[i+1] = B[i] + s;
+ }
+
+ /* check results: */
+ for (i = 0; i < 4; i++)
+ {
+ if (B[i] != E[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main ()
+{
+ check_vect ();
+ return main1();
+}
+
+/* NOTE: We temporarily xfail the following check until versioning for
+ aliasing is fixed to avoid versioning when the dependence distance
+ is known. */
+/* { dg-final { scan-tree-dump-times "not vectorized: possible dependence between data-refs" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { scan-tree-dump "zero step in outer loop." "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-6.c
new file mode 100644
index 000000000..572f433cf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-6.c
@@ -0,0 +1,66 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include <signal.h>
+#include "tree-vect.h"
+
+#define N 64
+#define MAX 42
+
+float A[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float B[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float C[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+float D[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+extern void abort(void);
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ float s;
+
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ {
+ s = 0;
+ for (j = 0; j < N; j += 4)
+ s += C[j];
+ A[i] = s;
+ }
+
+ return 0;
+}
+
+int main ()
+{
+ int i,j;
+ float s;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ A[i] = i;
+ B[i] = i;
+ C[i] = i;
+ D[i] = i;
+ }
+
+ main1();
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ s = 0;
+ for (j = 0; j < N; j += 4)
+ s += C[j];
+ if (A[i] != s)
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-big-array.c
new file mode 100644
index 000000000..c69b7d749
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-big-array.c
@@ -0,0 +1,74 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 80
+#define M 256
+float in[N+M];
+float coeff[M];
+float out[N];
+float fir_out[N];
+
+/* Should be vectorized. Fixed misaligment in the inner-loop. */
+__attribute__ ((noinline))
+void foo (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ out[i] = 0;
+ }
+
+ for (k = 0; k < 4; k++) {
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = k; j < M; j+=4) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i] += diff;
+ }
+ }
+
+}
+
+/* Vectorized. Changing misalignment in the inner-loop. */
+__attribute__ ((noinline))
+void fir (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j++) {
+ diff += in[j+i]*coeff[j];
+ }
+ fir_out[i] = diff;
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < M; i++)
+ coeff[i] = i;
+ for (i = 0; i < N+M; i++)
+ in[i] = i;
+
+ foo ();
+ fir ();
+
+ for (i = 0; i < N; i++) {
+ if (out[i] != fir_out[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb-big-array.c
new file mode 100644
index 000000000..5ac62ac3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb-big-array.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 80
+#define M 128
+float in[N+M];
+float coeff[M];
+float out[N];
+float fir_out[N];
+
+/* Vectorized. Fixed misaligment in the inner-loop. */
+__attribute__ ((noinline))
+void foo (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ out[i] = 0;
+ }
+
+ for (k = 0; k < 4; k++) {
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ j = k;
+
+ do {
+ diff += in[j+i]*coeff[j];
+ j+=4;
+ } while (j < M);
+
+ out[i] += diff;
+ }
+ }
+
+}
+
+/* Vectorized. Changing misalignment in the inner-loop. */
+__attribute__ ((noinline))
+void fir (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j++) {
+ diff += in[j+i]*coeff[j];
+ }
+ fir_out[i] = diff;
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < M; i++)
+ coeff[i] = i;
+ for (i = 0; i < N+M; i++)
+ in[i] = i;
+
+ foo ();
+ fir ();
+
+ for (i = 0; i < N; i++) {
+ if (out[i] != fir_out[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb.c
new file mode 100644
index 000000000..3c1a362c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir-lb.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+#define M 64
+float in[N+M];
+float coeff[M];
+float out[N];
+float fir_out[N];
+
+/* Vectorized. Fixed misaligment in the inner-loop. */
+__attribute__ ((noinline))
+void foo (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ out[i] = 0;
+ }
+
+ for (k = 0; k < 4; k++) {
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ j = k;
+
+ do {
+ diff += in[j+i]*coeff[j];
+ j+=4;
+ } while (j < M);
+
+ out[i] += diff;
+ }
+ }
+
+}
+
+/* Vectorized. Changing misalignment in the inner-loop. */
+__attribute__ ((noinline))
+void fir (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j++) {
+ diff += in[j+i]*coeff[j];
+ }
+ fir_out[i] = diff;
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < M; i++)
+ coeff[i] = i;
+ for (i = 0; i < N+M; i++)
+ in[i] = i;
+
+ foo ();
+ fir ();
+
+ for (i = 0; i < N; i++) {
+ if (out[i] != fir_out[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir.c
new file mode 100644
index 000000000..af787b96a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-outer-fir.c
@@ -0,0 +1,74 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 40
+#define M 128
+float in[N+M];
+float coeff[M];
+float out[N];
+float fir_out[N];
+
+/* Should be vectorized. Fixed misaligment in the inner-loop. */
+__attribute__ ((noinline))
+void foo (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ out[i] = 0;
+ }
+
+ for (k = 0; k < 4; k++) {
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = k; j < M; j+=4) {
+ diff += in[j+i]*coeff[j];
+ }
+ out[i] += diff;
+ }
+ }
+
+}
+
+/* Vectorized. Changing misalignment in the inner-loop. */
+__attribute__ ((noinline))
+void fir (){
+ int i,j,k;
+ float diff;
+
+ for (i = 0; i < N; i++) {
+ diff = 0;
+ for (j = 0; j < M; j++) {
+ diff += in[j+i]*coeff[j];
+ }
+ fir_out[i] = diff;
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+ int i, j;
+ float diff;
+
+ for (i = 0; i < M; i++)
+ coeff[i] = i;
+ for (i = 0; i < N+M; i++)
+ in[i] = i;
+
+ foo ();
+ fir ();
+
+ for (i = 0; i < N; i++) {
+ if (out[i] != fir_out[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-1-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-1-big-array.c
new file mode 100644
index 000000000..5df349a15
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-1-big-array.c
@@ -0,0 +1,66 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 512
+
+/* Modified rgb to rgb conversion from FFmpeg. */
+__attribute__ ((noinline)) void
+foo (unsigned char *src, unsigned char *dst)
+{
+ unsigned char *s = src;
+ unsigned short *d = (unsigned short *)dst;
+ int i;
+
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ *d = ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5));
+ d++;
+ }
+
+ s = src;
+ d = (unsigned short *)dst;
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ if (*d != ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5)))
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N], out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { ! vect_widen_shift } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c
new file mode 100644
index 000000000..e358209ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c
@@ -0,0 +1,67 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+/* Modified rgb to rgb conversion from FFmpeg. */
+__attribute__ ((noinline)) void
+foo (unsigned char *src, unsigned char *dst)
+{
+ unsigned char *s = src;
+ unsigned short *d = (unsigned short *)dst;
+ int i;
+
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ *d = ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5));
+ d++;
+ }
+
+ s = src;
+ d = (unsigned short *)dst;
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ if (*d != ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5)))
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N], out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { { ! vect_sizes_32B_16B } && { ! vect_widen_shift } } } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 8 "vect" { target vect_sizes_32B_16B } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-2-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-2-big-array.c
new file mode 100644
index 000000000..bc738cef2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-2-big-array.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 512
+
+/* Modified rgb to rgb conversion from FFmpeg. */
+__attribute__ ((noinline)) void
+foo (unsigned char *src, unsigned char *dst)
+{
+ unsigned char *s = src;
+ int *d = (int *)dst;
+ int i;
+
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ *d = ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5));
+ d++;
+ }
+
+ s = src;
+ d = (int *)dst;
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ if (*d != ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5)))
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N], out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* Final value stays in int, so no over-widening is detected at the moment. */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c
new file mode 100644
index 000000000..fecc5ef30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-2.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+/* Modified rgb to rgb conversion from FFmpeg. */
+__attribute__ ((noinline)) void
+foo (unsigned char *src, unsigned char *dst)
+{
+ unsigned char *s = src;
+ int *d = (int *)dst;
+ int i;
+
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ *d = ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5));
+ d++;
+ }
+
+ s = src;
+ d = (int *)dst;
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ if (*d != ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5)))
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N], out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* Final value stays in int, so no over-widening is detected at the moment. */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-3-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-3-big-array.c
new file mode 100644
index 000000000..d828c833f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-3-big-array.c
@@ -0,0 +1,64 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+/* Modified rgb to rgb conversion from FFmpeg. */
+__attribute__ ((noinline)) void
+foo (unsigned char *src, unsigned char *dst)
+{
+ unsigned char *s = src;
+ unsigned short *d = (unsigned short *)dst;
+ int i;
+
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ *d = ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9));
+ d++;
+ }
+
+ s = src;
+ d = (unsigned short *)dst;
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ if (*d != ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9)))
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N], out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-3.c
new file mode 100644
index 000000000..c69465898
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-3.c
@@ -0,0 +1,64 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+/* Modified rgb to rgb conversion from FFmpeg. */
+__attribute__ ((noinline)) void
+foo (unsigned char *src, unsigned char *dst)
+{
+ unsigned char *s = src;
+ unsigned short *d = (unsigned short *)dst;
+ int i;
+
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ *d = ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9));
+ d++;
+ }
+
+ s = src;
+ d = (unsigned short *)dst;
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ if (*d != ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9)))
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N], out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "vect_recog_over_widening_pattern: detected" "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-4-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-4-big-array.c
new file mode 100644
index 000000000..900250f04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-4-big-array.c
@@ -0,0 +1,70 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 512
+
+/* Modified rgb to rgb conversion from FFmpeg. */
+__attribute__ ((noinline)) int
+foo (unsigned char *src, unsigned char *dst)
+{
+ unsigned char *s = src;
+ unsigned short *d = (unsigned short *)dst, res;
+ int i, result = 0;
+
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ res = ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5));
+ *d = res;
+ result += res;
+ d++;
+ }
+
+ s = src;
+ d = (unsigned short *)dst;
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ if (*d != ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5)))
+ abort ();
+ d++;
+ }
+
+ return result;
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N], out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { ! vect_widen_shift } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c
new file mode 100644
index 000000000..70f12fef7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c
@@ -0,0 +1,71 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+/* Modified rgb to rgb conversion from FFmpeg. */
+__attribute__ ((noinline)) int
+foo (unsigned char *src, unsigned char *dst)
+{
+ unsigned char *s = src;
+ unsigned short *d = (unsigned short *)dst, res;
+ int i, result = 0;
+
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ res = ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5));
+ *d = res;
+ result += res;
+ d++;
+ }
+
+ s = src;
+ d = (unsigned short *)dst;
+ for (i = 0; i < N/4; i++)
+ {
+ const int b = *s++;
+ const int g = *s++;
+ const int r = *s++;
+ const int a = *s++;
+ if (*d != ((b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8) | (a>>5)))
+ abort ();
+ d++;
+ }
+
+ return result;
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N], out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { { ! vect_sizes_32B_16B } && { ! vect_widen_shift } } } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 8 "vect" { target vect_sizes_32B_16B } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-1.c
new file mode 100644
index 000000000..b593411c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-1.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int ib[N+7];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int ia[N+1];
+
+ /* All the accesses are misaligned. With cost model disabled, we
+ count the number of aligned accesses for each peeling option, and
+ in this case we align the two loads if possible (i.e., if
+ misaligned stores are supported). */
+ for (i = 1; i <= N; i++)
+ {
+ ia[i] = ib[i+2] + ib[i+6];
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i] != ib[i+2] + ib[i+6])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i <= N+6; i++)
+ {
+ asm volatile ("" : "+r" (i));
+ ib[i] = i;
+ }
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { vect_element_align } && { vect_aligned_arrays } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-2.c
new file mode 100644
index 000000000..ea270436e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-2.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+/* unaligned store. */
+
+int ib[N+7];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+ int ia[N+1];
+
+ /* The store is aligned and the loads are misaligned with the same
+ misalignment. Cost model is disabled. If misaligned stores are supported,
+ we peel according to the loads to align them. */
+ for (i = 0; i <= N; i++)
+ {
+ ia[i] = ib[i+2] + ib[i+6];
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i] != ib[i+2] + ib[i+6])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i <= N+6; i++)
+ {
+ asm volatile ("" : "+r" (i));
+ ib[i] = i;
+ }
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { vect_element_align } && { vect_aligned_arrays } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { { vect_element_align } && { vect_aligned_arrays } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-3.c
new file mode 100644
index 000000000..5aab8053e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-3.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+#define RES 21640
+
+int ib[N+10];
+int ia[N+10];
+int ic[N+10];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i, suma = 0, sumb = 0, sumc = 0;
+
+ /* ib and ic have same misalignment, we peel to align them. */
+ for (i = 0; i <= N; i++)
+ {
+ suma += ia[i];
+ sumb += ib[i+5];
+ sumc += ic[i+1];
+ }
+
+ /* check results: */
+ if (suma + sumb + sumc != RES)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N+10; i++)
+ {
+ asm volatile ("" : "+r" (i));
+ ib[i] = i;
+ ic[i] = i+2;
+ ia[i] = i/2;
+ }
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { { vect_no_align } || {vect_sizes_32B_16B } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {vect_sizes_32B_16B } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-4.c
new file mode 100644
index 000000000..dffb858e2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-peel-4.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+int ib[N+7];
+int ia[N+1];
+
+__attribute__ ((noinline))
+int main1 ()
+{
+ int i;
+
+ /* Don't peel keeping one load and the store aligned. */
+ for (i = 0; i <= N; i++)
+ {
+ ia[i] = ib[i] + ib[i+5];
+ }
+
+ /* check results: */
+ for (i = 1; i <= N; i++)
+ {
+ if (ia[i] != ib[i] + ib[i+5])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i <= N+6; i++)
+ {
+ asm volatile ("" : "+r" (i));
+ ib[i] = i;
+ }
+
+ return main1 ();
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-pre-interact.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-pre-interact.c
new file mode 100644
index 000000000..096839f9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-pre-interact.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+/* This checks that PRE doesn't create situations that prevent vectorization.
+ I.e. PR39300, PR35229. */
+float res[1024], data[1025];
+
+void foo (void)
+{
+ int i;
+ for (i = 0; i < 1024; ++i)
+ res[i] = data[i] + data[i + 1];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-recip.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-recip.c
new file mode 100644
index 000000000..4f130b05c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-recip.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+
+void f(float *__restrict__ qa, float *__restrict__ qb,
+ float *__restrict__ qc, float *__restrict__ rtrms)
+{
+ int i;
+ static float qam[600];
+ static float qbm[600];
+ static float qcm[600];
+ for(i=0;i<600;i++)
+ {
+ float a = rtrms[i];
+ qam[i] = qa[i]/a;
+ qbm[i] = qb[i]/a;
+ qcm[i] = qc[i]/a;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c
new file mode 100644
index 000000000..dbb154d12
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+/* Test vectorization of reduction of unsigned-int. */
+
+__attribute__ ((noinline))
+void main1 (unsigned int x, unsigned int max_result, unsigned int min_result)
+{
+ int i;
+ unsigned int udiff = 2;
+ unsigned int umax = x;
+ unsigned int umin = x;
+
+ /* Summation. */
+ for (i = 0; i < N; i++) {
+ udiff += (ub[i] - uc[i]);
+ }
+
+ /* Maximum. */
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ /* Minimum. */
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail { vect_no_int_add || vect_no_int_max } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-10.c
new file mode 100644
index 000000000..ad2199956
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-10.c
@@ -0,0 +1,51 @@
+#include "tree-vect.h"
+
+extern void abort (void);
+double ad[1024];
+float af[1024];
+short as[1024];
+int ai[1024];
+long long all[1024];
+unsigned short aus[1024];
+unsigned int au[1024];
+unsigned long long aull[1024];
+
+#define F(var) \
+__attribute__((noinline, noclone)) __typeof (var[0]) \
+f##var (void) \
+{ \
+ int i; \
+ __typeof (var[0]) r = 0; \
+ for (i = 0; i < 1024; i++) \
+ r = r > var[i] ? r : var[i]; \
+ return r; \
+}
+
+#define TESTS \
+F (ad) F (af) F (as) F (ai) F (all) F (aus) F (au) F (aull)
+
+TESTS
+
+int
+main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < 1024; i++)
+ {
+#undef F
+#define F(var) var[i] = i;
+ TESTS
+ }
+ for (i = 1023; i < 32 * 1024; i += 1024 + 271)
+ {
+#undef F
+#define F(var) var[i & 1023] = i; if (f##var () != i) abort ();
+ TESTS
+ }
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1char-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1char-big-array.c
new file mode 100644
index 000000000..7462cb34c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1char-big-array.c
@@ -0,0 +1,71 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+
+unsigned char ub[N];
+unsigned char uc[N];
+unsigned char diff;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
+{
+ int i;
+ unsigned char udiff = 2;
+ unsigned char umax = x;
+ unsigned char umin = x;
+
+ diff = 2;
+ for (i = 0; i < N; i++) {
+ ub[i] = i;
+ uc[i] = i;
+ if (i%16 == 0)
+ {
+ ub[i] = i+2;
+ diff += 2;
+ }
+ if (uc[i] > max_result)
+ max_result = uc[i];
+ if (uc[i] < min_result)
+ min_result = uc[i];
+
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned char) (ub[i] - uc[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != diff)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c
new file mode 100644
index 000000000..5a1c03d11
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) void
+main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
+{
+ int i;
+ unsigned char udiff = 2;
+ unsigned char umax = x;
+ unsigned char umin = x;
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned char)(ub[i] - uc[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c
new file mode 100644
index 000000000..145722a19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline)) void
+main1 (unsigned short x, unsigned short max_result, unsigned short min_result)
+{
+ int i;
+ unsigned short udiff = 2;
+ unsigned short umax = x;
+ unsigned short umin = x;
+
+ for (i = 0; i < N; i++) {
+ udiff += (unsigned short)(ub[i] - uc[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ umax = umax < uc[i] ? uc[i] : umax;
+ }
+
+ for (i = 0; i < N; i++) {
+ umin = umin > uc[i] ? uc[i] : umin;
+ }
+
+ /* check results: */
+ if (udiff != DIFF)
+ abort ();
+ if (umax != max_result)
+ abort ();
+ if (umin != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c
new file mode 100644
index 000000000..912e69c93
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 240
+
+int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+/* Test vectorization of reduction of signed-int. */
+
+__attribute__ ((noinline))
+void main1 (int x, int max_result, int min_result)
+{
+ int i;
+ int diff = 0;
+ int max = x;
+ int min = x;
+
+ for (i = 0; i < N; i++) {
+ diff += (b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail { vect_no_int_add || vect_no_int_max } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2char-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2char-big-array.c
new file mode 100644
index 000000000..7004e9e4e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2char-big-array.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 256
+volatile int y = 0;
+
+__attribute__ ((noinline))
+void main1 (signed char x, signed char max_result, signed char min_result)
+{
+ int i;
+ signed char b[N];
+ signed char c[N];
+ signed char check_diff = 2;
+ signed char diff = 2;
+ signed char max = x;
+ signed char min = x;
+
+ check_diff = 2;
+ for (i = 0; i < N; i++) {
+ b[i] = i;
+ c[i] = i;
+ if (i%16 == 0)
+ {
+ c[i] = i + 1;
+ check_diff += 1;
+ }
+ if (c[i] > max_result)
+ max_result = c[i];
+ if (c[i] < min_result)
+ min_result = c[i];
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++) {
+ diff += (signed char) (c[i] - b[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != check_diff)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c
new file mode 100644
index 000000000..6d01f0317
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2char.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 121
+
+__attribute__ ((noinline))
+void main1 (signed char x, signed char max_result, signed char min_result)
+{
+ int i;
+ signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
+ signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ signed char diff = 2;
+ signed char max = x;
+ signed char min = x;
+
+ for (i = 0; i < N; i++) {
+ diff += (signed char)(b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c
new file mode 100644
index 000000000..7d19e7001
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-2short.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+__attribute__ ((noinline))
+void main1 (short x, short max_result, short min_result)
+{
+ int i;
+ short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ short diff = 2;
+ short max = x;
+ short min = x;
+
+ for (i = 0; i < N; i++) {
+ diff += (short)(b[i] - c[i]);
+ }
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c
new file mode 100644
index 000000000..3e6f17c48
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c
@@ -0,0 +1,42 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+/* Test vectorization of reduction of unsigned-int in the presence
+ of unknown-loop-bound. */
+
+__attribute__ ((noinline))
+int main1 (int n, int res)
+{
+ int i;
+ unsigned int udiff;
+
+ udiff = 0;
+ for (i = 0; i < n; i++) {
+ udiff += (ub[i] - uc[i]);
+ }
+
+ /* check results: */
+ if (udiff != res)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (N, 240);
+ main1 (N-1, 210);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_int_add } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c
new file mode 100644
index 000000000..3f8e2ec69
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+__attribute__ ((noinline))
+int main1 (float x, float max_result)
+{
+ int i;
+ float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ float diff = 2;
+ float max = x;
+ float min = 10;
+
+ for (i = 0; i < N; i++) {
+ diff += (b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != 0)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100 ,100);
+ main1 (0, 15);
+ return 0;
+}
+
+/* need -ffast-math to vectorizer these loops. */
+/* ARM NEON passes -ffast-math to these tests, so expect this to fail. */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail arm_neon_ok } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-7.c
new file mode 100644
index 000000000..a59a24ac7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-7.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define N 32
+
+extern void abort (void);
+typedef unsigned char T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum < lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum > lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+int main (void)
+{
+ static unsigned char const A[N] = {
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
+ };
+
+ static unsigned char const B[N] = {
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
+ };
+
+ static unsigned char const C[N] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ };
+
+ check_vect ();
+
+ testmin (A, 10, 1);
+ testmin (B, 0x7f, 0x70);
+ testmin (C, 0x7f, 0x09);
+
+ testmax (A, 0, 0x7f);
+ testmax (B, 0, 0x8f);
+ testmax (C, 0, 0xff);
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-8.c
new file mode 100644
index 000000000..fdfec0a8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-8.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define N 32
+
+extern void abort (void);
+typedef signed char T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum < lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum > lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+int main (void)
+{
+ static signed char const A[N] = {
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
+ };
+
+ static signed char const B[N] = {
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f
+ };
+
+ static signed char const C[N] = {
+ 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ };
+
+ check_vect ();
+
+ testmin (A, 0, 0);
+ testmin (B, 0, 0x80);
+ testmin (C, 0, 0x80);
+
+ testmax (A, 0, 0x7f);
+ testmax (B, 0, 0x7f);
+ testmax (C, 0, 0x77);
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-9.c
new file mode 100644
index 000000000..ecf3bf1ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-9.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define N 32
+
+extern void abort (void);
+typedef unsigned short T;
+
+__attribute__ ((noinline)) void
+testmax (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum < lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+testmin (const T *c, T init, T result)
+{
+ T lc[N], accum = init;
+ int i;
+
+ __builtin_memcpy (lc, c, sizeof(lc));
+
+ for (i = 0; i < N; i++) {
+ accum = accum > lc[i] ? lc[i] : accum;
+ }
+
+ if (accum != result)
+ abort ();
+}
+
+int main (void)
+{
+ static unsigned short const A[N] = {
+ 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
+ 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010,
+ 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+ 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff
+ };
+
+ static unsigned short const B[N] = {
+ 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+ 0x7ff8, 0x7ff9, 0x7ffa, 0x7ffb, 0x7ffc, 0x7ffd, 0x7ffe, 0x7fff,
+ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
+ 0x8008, 0x8009, 0x800a, 0x800b, 0x800c, 0x800d, 0x800e, 0x800f
+ };
+
+ static unsigned short const C[N] = {
+ 0xffff, 0xfffe, 0xfffd, 0xfffc, 0xfffb, 0xfffa, 0xfff9, 0xfff8,
+ 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 0x0010,
+ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007,
+ 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700,
+ };
+
+ check_vect ();
+
+ testmin (A, 10, 1);
+ testmin (B, 0x7fff, 0x7000);
+ testmin (C, 0x7fff, 0x0009);
+
+ testmax (A, 0, 0x7fff);
+ testmax (B, 0, 0x800f);
+ testmax (C, 0, 0xffff);
+
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c
new file mode 100644
index 000000000..c98634416
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16a.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+#define DOT 43680
+
+signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* short->int->int dot product.
+ Detected as a dot-product pattern.
+ Vectorized on targets that support dot-product for signed shorts. */
+
+__attribute__ ((noinline)) int
+foo (int len)
+{
+ int i;
+ int result = 0;
+
+ for (i = 0; i < len; i++)
+ {
+ result += (X[i] * Y[i]);
+ }
+ return result;
+}
+
+
+int
+main (void)
+{
+ int i;
+ int dot;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ X[i] = i;
+ Y[i] = N - i;
+ __asm__ volatile ("");
+ }
+
+ dot = foo (N);
+ if (dot != DOT)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_hi } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16b.c
new file mode 100644
index 000000000..1344ca955
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16b.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT 43680
+
+signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* short->short->int dot product. Should be vectorized on architectures
+ supporting vectorized multiplication of two short args with short result,
+ e.g "mulv4hi3" and widenning sum */
+__attribute__ ((noinline)) int
+foo (int len)
+{
+ int i;
+ int result = 0;
+ short prod;
+
+ for (i = 0; i < len; i++)
+ {
+ prod = X[i] * Y[i];
+ result += prod;
+ }
+ return result;
+}
+
+int
+main (void)
+{
+ int i, dot;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ X[i] = i;
+ Y[i] = 64 - i;
+ __asm__ volatile ("");
+ }
+
+ dot = foo (N);
+ if (dot != DOT)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_short_mult && { vect_widen_sum_hi_to_si || vect_unpack } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_short_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_hi_to_si } && { ! vect_unpack } } } } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c
new file mode 100644
index 000000000..8ba823b04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s16c.c
@@ -0,0 +1,73 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+#define DOT 43680
+
+signed short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed int Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* (short, int)->int->int dot product.
+ Not detected as a dot-product pattern. */
+
+__attribute__ ((noinline)) int
+foo (int len)
+{
+ int i;
+ int result = 0;
+
+ for (i = 0; i < len; i++)
+ {
+ result += (X[i] * Y[i]);
+ }
+ return result;
+}
+
+
+/* (int, short)->int->int dot product.
+ Not detected as a dot-product pattern. */
+
+__attribute__ ((noinline)) int
+bar (int len)
+{
+ int i;
+ int result = 0;
+
+ for (i = 0; i < len; i++)
+ {
+ result += (Y[i] * X[i]);
+ }
+ return result;
+}
+
+int
+main (void)
+{
+ int i;
+ int dot;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ X[i] = i;
+ Y[i] = N - i;
+ __asm__ volatile ("");
+ }
+
+ dot = foo (N);
+ if (dot != DOT)
+ abort ();
+
+ dot = bar (N);
+ if (dot != DOT)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c
new file mode 100644
index 000000000..96c2950c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8a.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT1 43680
+
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* char->short->int dot product.
+ The dot-product pattern should be detected.
+ Vectorizable on vect_sdot_qi targets (targets that support dot-product of
+ signed chars).
+
+ In the future could also be vectorized as widening-mult + widening-summation,
+ or with type-conversion support.
+ */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+ int result = 0;
+ short prod;
+
+ for (i=0; i<len; i++) {
+ prod = X[i] * Y[i];
+ result += prod;
+ }
+ return result;
+}
+
+int main (void)
+{
+ int i, dot1;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ dot1 = foo1 (N);
+ if (dot1 != DOT1)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_qi } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi && vect_widen_sum_hi_to_si } } } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c
new file mode 100644
index 000000000..2ecb225a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8b.c
@@ -0,0 +1,66 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT2 -21856
+
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* char->short->short dot product.
+ The dot-product pattern should be detected.
+ The reduction is currently not vectorized becaus of the signed->unsigned->signed
+ casts, since this patch:
+
+ 2005-12-26 Kazu Hirata <kazu@codesourcery.com>
+
+ PR tree-optimization/25125
+
+ When the dot-product is detected, the loop should be vectorized on vect_sdot_qi
+ targets (targets that support dot-product of signed char).
+ This test would currently fail to vectorize on targets that support
+ dot-product of chars into an int accumulator.
+ Alternatively, the loop could also be vectorized as widening-mult + summation,
+ or with type-conversion support.
+ */
+__attribute__ ((noinline)) short
+foo2(int len) {
+ int i;
+ short result = 0;
+
+ for (i=0; i<len; i++) {
+ result += (X[i] * Y[i]);
+ }
+ return result;
+}
+
+int main (void)
+{
+ int i;
+ short dot2;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ dot2 = foo2 (N);
+ if (dot2 != DOT2)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target { ! vect_multiple_sizes } } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_multiple_sizes } } } */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c
new file mode 100644
index 000000000..59b174e3f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-s8c.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT3 43680
+
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* char->int->int dot product.
+ Not detected as a dot-product pattern. */
+__attribute__ ((noinline)) int
+foo3(int len) {
+ int i;
+ int result = 0;
+
+ for (i=0; i<len; i++) {
+ result += (X[i] * Y[i]);
+ }
+ return result;
+}
+
+int main (void)
+{
+ int i, dot3;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ dot3 = foo3 (N);
+ if (dot3 != DOT3)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c
new file mode 100644
index 000000000..c09750d44
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16a.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT1 43680
+#define DOT2 43680
+
+unsigned short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* short->short->int dot product.
+ Not detected as a dot-product pattern.
+ Requires support for non-widneing multiplication and widening-summation. */
+__attribute__ ((noinline)) unsigned int
+foo1(int len) {
+ int i;
+ unsigned int result = 0;
+ unsigned short prod;
+
+ for (i=0; i<len; i++) {
+ prod = X[i] * Y[i];
+ result += prod;
+ }
+ return result;
+}
+
+int main (void)
+{
+ unsigned int dot1;
+ unsigned short i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ }
+
+ dot1 = foo1 (N);
+ if (dot1 != DOT1)
+ abort ();
+
+ return 0;
+}
+
+/* The initialization loop in main also gets vectorized. */
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { vect_short_mult && vect_widen_sum_hi_to_si } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16b.c
new file mode 100644
index 000000000..42b104fb8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u16b.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT2 43680
+
+unsigned short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+
+/* short->int->int dot product.
+ Currently not detected as a dot-product pattern: the multiplication
+ promotes the ushorts to int, and then the product is promoted to unsigned
+ int for the addition. Which results in an int->unsigned int cast, which
+ since no bits are modified in the cast should be trivially vectorizable. */
+__attribute__ ((noinline)) unsigned int
+foo2(int len) {
+ int i;
+ unsigned int result = 0;
+
+ for (i=0; i<len; i++) {
+ result += (X[i] * Y[i]);
+ }
+ return result;
+}
+
+
+int main (void)
+{
+ unsigned int dot2;
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ dot2 = foo2 (N);
+ if (dot2 != DOT2)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" { xfail *-*-* } } } */
+
+/* Once the dot-product pattern is detected, we expect
+ that loop to be vectorized on vect_udot_hi targets (targets that support
+ dot-product of unsigned shorts) and targets that support widening multiplication. */
+/* The induction loop in main is vectorized. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c
new file mode 100644
index 000000000..d856754c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8a.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT 43680
+
+unsigned char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+
+/* char->short->int dot product.
+ Detected as a dot-product pattern.
+ Should be vectorized on targets that support dot-product for unsigned chars
+ (vect_udot_qi),
+ and on targets that support widening-multiplication and widening-summation
+ (vect_widen_mult_qi && vec_widen_sum_qi_to_si).
+ Widening-multiplication can also be supported by type promotion and non-widening
+ multiplication (vect_unpack && vect_short_mult);
+ Widening summation can also be supported by type promotion and non-widening
+ summation (vect_unpack).
+ */
+__attribute__ ((noinline)) unsigned int
+foo (int len) {
+ int i;
+ unsigned int result = 0;
+ unsigned short prod;
+
+ for (i=0; i<len; i++) {
+ prod = X[i] * Y[i];
+ result += prod;
+ }
+ return result;
+}
+
+int main (void)
+{
+ unsigned int dot;
+ int i;
+
+ check_vect ();
+
+ dot = foo (N);
+ if (dot != DOT)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_udot_qi } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi && vect_widen_sum_qi_to_si } } } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c
new file mode 100644
index 000000000..01c82b52c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-dot-u8b.c
@@ -0,0 +1,55 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT 43680
+
+unsigned char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+unsigned char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+
+/* char->short->short dot product.
+ Detected as a dot-product pattern.
+ Should be vectorized on targets that support dot-product for unsigned chars,
+ but currently this test cannot be vectorized as a dot-product on targets
+ that support char->short->int dot-product.
+ Alternatively, this test can be vectorized using vect_widen_mult_qi (or
+ vect_unpack and non-widening multplication: vect_unpack && vect_short_mult).
+ */
+__attribute__ ((noinline)) unsigned short
+foo (int len) {
+ int i;
+ unsigned short result = 0;
+
+ for (i=0; i<len; i++) {
+ result += (unsigned short)(X[i] * Y[i]);
+ }
+ return result;
+}
+
+int main (void)
+{
+ unsigned short dot;
+ int i;
+
+ check_vect ();
+
+ dot = foo (N);
+ if (dot != DOT)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */
+
+/* When the vectorizer is enhanced to vectorize accumulation into short for
+ targets that support accumulation into int (powerpc, ia64) we'd have:
+dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_udot_qi || vect_widen_mult_qi_to_hi } }
+*/
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1a.c
new file mode 100644
index 000000000..2d5c5b9a8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1a.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+unsigned short udata_sh[N] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
+#define SUM 210
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ unsigned int intsum = 0;
+
+ /* widenning sum: sum shorts into int. */
+ for (i = 0; i < N; i++)
+ {
+ intsum += udata_sh[i];
+ }
+
+ /* check results: */
+ if (intsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_hi_to_si } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b-big-array.c
new file mode 100644
index 000000000..1967e3da6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b-big-array.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+unsigned char udata_ch[N];
+#define SUM N*(N-1)
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ unsigned int intsum = 0;
+
+ for (i = 0; i < N; i++)
+ {
+ udata_ch[i] = i*2;
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ /* widenning sum: sum chars into int. */
+ for (i = 0; i < N; i++)
+ {
+ intsum += udata_ch[i];
+ }
+
+ /* check results: */
+ if (intsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_sum_qi_to_si || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_qi_to_si } && { ! vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c
new file mode 100644
index 000000000..553ab6fcd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+unsigned char udata_ch[N] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
+#define SUM 210
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ unsigned int intsum = 0;
+
+ /* widenning sum: sum chars into int. */
+ for (i = 0; i < N; i++)
+ {
+ intsum += udata_ch[i];
+ }
+
+ /* check results: */
+ if (intsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump "vect_recog_widen_sum_pattern: detected" "vect"} } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_sum_qi_to_si || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_qi_to_si } && { ! vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c-big-array.c
new file mode 100644
index 000000000..5394adee0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c-big-array.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+unsigned char udata_ch[N];
+#define SUM N*(N-1)
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ unsigned short shortsum = 0;
+
+ for (i = 0; i < N; i++)
+ {
+ udata_ch[i] = i*2;
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ /* widenning sum: sum chars into short. */
+ for (i = 0; i < N; i++)
+ {
+ shortsum += udata_ch[i];
+ }
+
+ /* check results: */
+ if (shortsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_qi_to_hi } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_qi_to_hi } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c.c
new file mode 100644
index 000000000..2fc7f9a59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1c.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+unsigned char udata_ch[N] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
+#define SUM 210
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ unsigned short shortsum = 0;
+
+ /* widenning sum: sum chars into short. */
+ for (i = 0; i < N; i++)
+ {
+ shortsum += udata_ch[i];
+ }
+
+ /* check results: */
+ if (shortsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump "vect_recog_widen_sum_pattern: detected" "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_qi_to_hi } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_qi_to_hi } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2a.c
new file mode 100644
index 000000000..695738629
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2a.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+signed short data_sh[N] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
+#define SUM 210
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ signed int intsum = 0;
+
+ /* widenning sum: sum shorts into int. */
+ for (i = 0; i < N; i++)
+ {
+ intsum += data_sh[i];
+ }
+
+ /* check results: */
+ if (intsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_hi_to_si } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b-big-array.c
new file mode 100644
index 000000000..fa0100b9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b-big-array.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+signed char data_ch[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ signed int intsum = 0;
+ signed int check_intsum = 0;
+
+ for (i = 0; i < N; i++)
+ {
+ data_ch[i] = i*2;
+ check_intsum += data_ch[i];
+ /* Avoid vectorization. */
+ if (y)
+ abort ();
+ }
+
+ /* widenning sum: sum chars into int. */
+ for (i = 0; i < N; i++)
+ {
+ intsum += data_ch[i];
+ }
+
+ /* check results: */
+ if (intsum != check_intsum)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_sum_qi_to_si && vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_qi_to_si } && { ! vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c
new file mode 100644
index 000000000..6106ed8f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2b.c
@@ -0,0 +1,40 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+signed char data_ch[N] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
+#define SUM 210
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ signed int intsum = 0;
+
+ /* widenning sum: sum chars into int. */
+ for (i = 0; i < N; i++)
+ {
+ intsum += data_ch[i];
+ }
+
+ /* check results: */
+ if (intsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump "vect_recog_widen_sum_pattern: detected" "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_sum_qi_to_si && vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_qi_to_si } && { ! vect_unpack } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2c.c
new file mode 100644
index 000000000..36f51496f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-2c.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+signed char data_ch[N] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
+#define SUM 210
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ signed short shortsum = 0;
+
+ /* widenning sum: sum chars into short.
+ The widening-summation pattern is currently not detected because of this
+ patch:
+
+ 2005-12-26 Kazu Hirata <kazu@codesourcery.com>
+
+ PR tree-optimization/25125
+ */
+
+ for (i = 0; i < N; i++)
+ {
+ shortsum += data_ch[i];
+ }
+
+ /* check results: */
+ if (shortsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_qi_to_hi } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-3.c
new file mode 100644
index 000000000..39f3b6b3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-3.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_int_mult } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 10
+#define RES 1024
+
+/* A reduction pattern in which there is no data ref in
+ the loop and one operand is defined outside of the loop. */
+
+__attribute__ ((noinline)) int
+foo (int v)
+{
+ int i;
+ int result = 1;
+
+ ++v;
+ for (i = 0; i < N; i++)
+ result *= v;
+
+ return result;
+}
+
+int
+main (void)
+{
+ int res;
+
+ check_vect ();
+
+ res = foo (1);
+ if (res != RES)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-btrunc.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-btrunc.c
new file mode 100644
index 000000000..7432fe76f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-btrunc.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_call_btrunc } */
+
+#define N 32
+
+void
+foo (double *output, double *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_trunc (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_btrunc } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-btruncf.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-btruncf.c
new file mode 100644
index 000000000..0835e1b0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-btruncf.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_call_btruncf } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_truncf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_btruncf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-ceil.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-ceil.c
new file mode 100644
index 000000000..a430690f5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-ceil.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_call_ceil } */
+
+#define N 32
+
+void
+foo (double *output, double *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_ceil (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_ceil } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-ceilf.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-ceilf.c
new file mode 100644
index 000000000..4d00924d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-ceilf.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_call_ceilf } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_ceilf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_ceilf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-floor.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-floor.c
new file mode 100644
index 000000000..8f1c9ecc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-floor.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_call_floor } */
+
+#define N 32
+
+void
+foo (double *output, double *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_floor (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_floor } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-floorf.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-floorf.c
new file mode 100644
index 000000000..a68c2ec0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-floorf.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_call_floorf } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_floorf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_floorf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-lceil.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-lceil.c
new file mode 100644
index 000000000..b4ed236e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-lceil.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_call_lceil } */
+
+#define N 32
+
+void
+foo (long *output, double *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_lceil (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_lceil } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-lfloor.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-lfloor.c
new file mode 100644
index 000000000..5a3663183
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-lfloor.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_call_lfloor } */
+
+#define N 32
+
+void
+foo (long *output, double *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_lfloor (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_lfloor } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-nearbyint.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-nearbyint.c
new file mode 100644
index 000000000..572dbd3b6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-nearbyint.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_call_nearbyint } */
+
+#define N 32
+
+void
+foo (double *output, double *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_nearbyint (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_nearbyint } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-nearbyintf.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-nearbyintf.c
new file mode 100644
index 000000000..73ca7deb0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-nearbyintf.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_call_nearbyintf } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_nearbyintf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_nearbyintf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-round.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-round.c
new file mode 100644
index 000000000..c298bbbfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-round.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_call_round } */
+
+#define N 32
+
+void
+foo (double *output, double *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_round (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_round } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-roundf.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-roundf.c
new file mode 100644
index 000000000..362b9d655
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-rounding-roundf.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_call_roundf } */
+
+#define N 32
+
+void
+foo (float *output, float *input)
+{
+ int i = 0;
+ /* Vectorizable. */
+ for (i = 0; i < N; i++)
+ output[i] = __builtin_roundf (input[i]);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_call_roundf } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-sdivmod-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-sdivmod-1.c
new file mode 100644
index 000000000..c18204ea3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-sdivmod-1.c
@@ -0,0 +1,98 @@
+#include "tree-vect.h"
+
+extern void abort (void);
+int a[4096];
+
+__attribute__((noinline, noclone)) void
+f1 (int x)
+{
+ int i, j;
+ for (i = 1; i <= x; i++)
+ {
+ j = a[i] >> 8;
+ j = 1 + (j / 2);
+ a[i] = j << 8;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f2 (int x)
+{
+ int i, j;
+ for (i = 1; i <= x; i++)
+ {
+ j = a[i] >> 8;
+ j = 1 + (j / 16);
+ a[i] = j << 8;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f3 (int x)
+{
+ int i, j;
+ for (i = 1; i <= x; i++)
+ {
+ j = a[i] >> 8;
+ j = 1 + (j % 2);
+ a[i] = j << 8;
+ }
+}
+
+__attribute__((noinline, noclone)) void
+f4 (int x)
+{
+ int i, j;
+ for (i = 1; i <= x; i++)
+ {
+ j = a[i] >> 8;
+ j = 1 + (j % 16);
+ a[i] = j << 8;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ for (i = 0; i < 4096; i++)
+ {
+ asm ("");
+ a[i] = (i - 2048) << 8;
+ }
+ f1 (4095);
+ if (a[0] != (-2048 << 8))
+ abort ();
+ for (i = 1; i < 4096; i++)
+ if (a[i] != ((1 + ((i - 2048) / 2)) << 8))
+ abort ();
+ else
+ a[i] = (i - 2048) << 8;
+ f2 (4095);
+ if (a[0] != (-2048 << 8))
+ abort ();
+ for (i = 1; i < 4096; i++)
+ if (a[i] != ((1 + ((i - 2048) / 16)) << 8))
+ abort ();
+ else
+ a[i] = (i - 2048) << 8;
+ f3 (4095);
+ if (a[0] != (-2048 << 8))
+ abort ();
+ for (i = 1; i < 4096; i++)
+ if (a[i] != ((1 + ((i - 2048) % 2)) << 8))
+ abort ();
+ else
+ a[i] = (i - 2048) << 8;
+ f4 (4095);
+ if (a[0] != (-2048 << 8))
+ abort ();
+ for (i = 1; i < 4096; i++)
+ if (a[i] != ((1 + ((i - 2048) % 16)) << 8))
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" { target vect_condition } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
new file mode 100644
index 000000000..79699047e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
@@ -0,0 +1,32 @@
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 8
+
+unsigned int A[N] = { 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001,
+ 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001 };
+unsigned int B[N] = { 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000,
+ 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000 };
+
+int main ()
+{
+ int i;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ A[i] = A[i] >> 3;
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-2-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-2-big-array.c
new file mode 100644
index 000000000..0e1acfb7b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-2-big-array.c
@@ -0,0 +1,190 @@
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_int } */
+/* Check the standard integer types for left and right shifts to see if the
+ compiler replaced a scalar instruction with a vector instruction whether the
+ correct value is generated. */
+
+#ifdef TRACE
+#endif
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#ifndef ALIGN
+#define ALIGN __attribute__((__aligned__(__BIGGEST_ALIGNMENT__)))
+#endif
+
+#ifndef NOINLINE
+#define NOINLINE __attribute__((__noinline__))
+#endif
+
+#ifdef TRACE
+#define TRACE_FUNC(PREFIX, NAME) printf (#PREFIX #NAME "\n")
+#define TRACE_DONE() printf ("done!\n")
+#define TRACE_ABORT(I,E,G) \
+do { \
+ printf ("Element %d, expected 0x%lx, got 0x%lx\n", \
+ I, (long)(E), (long)(G)); \
+ abort (); \
+} while (0)
+
+#else
+#define TRACE_FUNC(PREFIX, A)
+#define TRACE_DONE()
+#define TRACE_ABORT(I,E,G) abort ()
+#endif
+
+#define NAME(A,B) A ## B
+
+#define VECT_TESTS(PREFIX, TYPE, N) \
+ /* Restrict the optimizer from optimizing the setup loops. */ \
+volatile TYPE NAME (PREFIX, zero) = 0; \
+ \
+TYPE NAME (PREFIX, a)[N] ALIGN; \
+TYPE NAME (PREFIX, b)[N] ALIGN; \
+TYPE NAME (PREFIX, c)[N] ALIGN; \
+TYPE NAME (PREFIX, d)[N] ALIGN; \
+ \
+static void NOINLINE \
+NAME (PREFIX, lshift_2) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, lshift_2); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << 2; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, lshift_var) (int shift) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, lshift_var); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << shift; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, lshift_vect) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, lshift_vect); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << NAME (PREFIX, c)[i]; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, rshift_2) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, rshift_2); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> 2; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, rshift_var) (int shift) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, rshift_var); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> shift; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, rshift_vect) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, rshift_vect); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> NAME (PREFIX, c)[i]; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, check) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, check); \
+ for (i = 0; i < N; i++) \
+ if (NAME (PREFIX, a)[i] != NAME (PREFIX, d)[i]) \
+ TRACE_ABORT (i, NAME (PREFIX, d)[i], NAME (PREFIX, a)[i]); \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, tests) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, tests); \
+ for (i = 0; i < N; i++) \
+ { \
+ NAME (PREFIX, b)[i] = (i + NAME (PREFIX, zero)); \
+ NAME (PREFIX, c)[i] = 2; \
+ NAME (PREFIX, d)[i] = (i + NAME (PREFIX, zero)) << 2; \
+ } \
+ \
+ NAME (PREFIX, lshift_2) (); \
+ NAME (PREFIX, check) (); \
+ \
+ NAME (PREFIX, lshift_var) (2); \
+ NAME (PREFIX, check) (); \
+ \
+ NAME (PREFIX, lshift_vect) (); \
+ NAME (PREFIX, check) (); \
+ \
+ for (i = 0; i < N; i++) \
+ { \
+ NAME (PREFIX, b)[i] = ((i + NAME (PREFIX, zero)) << 4) \
+ | (((TYPE)0x80) << ((sizeof (TYPE) * 8) - 8)); \
+ NAME (PREFIX, c)[i] = 2; \
+ NAME (PREFIX, d)[i] = (TYPE)((NAME (PREFIX, b)[i] \
+ + NAME (PREFIX, zero)) >> 2); \
+ } \
+ \
+ NAME (PREFIX, rshift_2) (); \
+ NAME (PREFIX, check) (); \
+ \
+ NAME (PREFIX, rshift_var) (2); \
+ NAME (PREFIX, check) (); \
+ \
+ NAME (PREFIX, rshift_vect) (); \
+ NAME (PREFIX, check) (); \
+}
+
+VECT_TESTS (uc_, unsigned char, 128)
+VECT_TESTS (us_, unsigned short, 256)
+VECT_TESTS (ui_, unsigned int, 256)
+VECT_TESTS (ul_, unsigned long, 256)
+
+VECT_TESTS (sc_, signed char, 128)
+VECT_TESTS (ss_, short, 256)
+VECT_TESTS (si_, int, 256)
+VECT_TESTS (sl_, long, 256)
+
+int main ()
+{
+ int i;
+
+ check_vect ();
+
+ uc_tests ();
+ us_tests ();
+ ui_tests ();
+ ul_tests ();
+
+ sc_tests ();
+ ss_tests ();
+ si_tests ();
+ sl_tests ();
+
+ TRACE_DONE ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-2.c
new file mode 100644
index 000000000..83211eba4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-2.c
@@ -0,0 +1,190 @@
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_int } */
+/* Check the standard integer types for left and right shifts to see if the
+ compiler replaced a scalar instruction with a vector instruction whether the
+ correct value is generated. */
+
+#ifdef TRACE
+#endif
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#ifndef ALIGN
+#define ALIGN __attribute__((__aligned__(__BIGGEST_ALIGNMENT__)))
+#endif
+
+#ifndef NOINLINE
+#define NOINLINE __attribute__((__noinline__))
+#endif
+
+#ifdef TRACE
+#define TRACE_FUNC(PREFIX, NAME) printf (#PREFIX #NAME "\n")
+#define TRACE_DONE() printf ("done!\n")
+#define TRACE_ABORT(I,E,G) \
+do { \
+ printf ("Element %d, expected 0x%lx, got 0x%lx\n", \
+ I, (long)(E), (long)(G)); \
+ abort (); \
+} while (0)
+
+#else
+#define TRACE_FUNC(PREFIX, A)
+#define TRACE_DONE()
+#define TRACE_ABORT(I,E,G) abort ()
+#endif
+
+#define NAME(A,B) A ## B
+
+#define VECT_TESTS(PREFIX, TYPE, N) \
+ /* Restrict the optimizer from optimizing the setup loops. */ \
+volatile TYPE NAME (PREFIX, zero) = 0; \
+ \
+TYPE NAME (PREFIX, a)[N] ALIGN; \
+TYPE NAME (PREFIX, b)[N] ALIGN; \
+TYPE NAME (PREFIX, c)[N] ALIGN; \
+TYPE NAME (PREFIX, d)[N] ALIGN; \
+ \
+static void NOINLINE \
+NAME (PREFIX, lshift_2) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, lshift_2); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << 2; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, lshift_var) (int shift) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, lshift_var); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << shift; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, lshift_vect) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, lshift_vect); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << NAME (PREFIX, c)[i]; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, rshift_2) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, rshift_2); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> 2; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, rshift_var) (int shift) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, rshift_var); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> shift; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, rshift_vect) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, rshift_vect); \
+ for (i = 0; i < N; i++) \
+ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> NAME (PREFIX, c)[i]; \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, check) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, check); \
+ for (i = 0; i < N; i++) \
+ if (NAME (PREFIX, a)[i] != NAME (PREFIX, d)[i]) \
+ TRACE_ABORT (i, NAME (PREFIX, d)[i], NAME (PREFIX, a)[i]); \
+} \
+ \
+static void NOINLINE \
+NAME (PREFIX, tests) (void) \
+{ \
+ int i; \
+ \
+ TRACE_FUNC (PREFIX, tests); \
+ for (i = 0; i < N; i++) \
+ { \
+ NAME (PREFIX, b)[i] = (i + NAME (PREFIX, zero)); \
+ NAME (PREFIX, c)[i] = 2; \
+ NAME (PREFIX, d)[i] = (i + NAME (PREFIX, zero)) << 2; \
+ } \
+ \
+ NAME (PREFIX, lshift_2) (); \
+ NAME (PREFIX, check) (); \
+ \
+ NAME (PREFIX, lshift_var) (2); \
+ NAME (PREFIX, check) (); \
+ \
+ NAME (PREFIX, lshift_vect) (); \
+ NAME (PREFIX, check) (); \
+ \
+ for (i = 0; i < N; i++) \
+ { \
+ NAME (PREFIX, b)[i] = ((i + NAME (PREFIX, zero)) << 4) \
+ | (((TYPE)0x80) << ((sizeof (TYPE) * 8) - 8)); \
+ NAME (PREFIX, c)[i] = 2; \
+ NAME (PREFIX, d)[i] = (TYPE)((NAME (PREFIX, b)[i] \
+ + NAME (PREFIX, zero)) >> 2); \
+ } \
+ \
+ NAME (PREFIX, rshift_2) (); \
+ NAME (PREFIX, check) (); \
+ \
+ NAME (PREFIX, rshift_var) (2); \
+ NAME (PREFIX, check) (); \
+ \
+ NAME (PREFIX, rshift_vect) (); \
+ NAME (PREFIX, check) (); \
+}
+
+VECT_TESTS(uc_, unsigned char, 16)
+VECT_TESTS(us_, unsigned short, 32)
+VECT_TESTS(ui_, unsigned int, 32)
+VECT_TESTS(ul_, unsigned long, 32)
+
+VECT_TESTS(sc_, signed char, 16)
+VECT_TESTS(ss_, short, 32)
+VECT_TESTS(si_, int, 32)
+VECT_TESTS(sl_, long, 32)
+
+int main ()
+{
+ int i;
+
+ check_vect ();
+
+ uc_tests ();
+ us_tests ();
+ ui_tests ();
+ ul_tests ();
+
+ sc_tests ();
+ ss_tests ();
+ si_tests ();
+ sl_tests ();
+
+ TRACE_DONE ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-3.c
new file mode 100644
index 000000000..78ed935ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-3.c
@@ -0,0 +1,37 @@
+/* { dg-require-effective-target vect_shift } */
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned short dst[N] __attribute__((aligned(N)));
+unsigned short src[N] __attribute__((aligned(N)));
+
+__attribute__ ((noinline))
+void array_shift(void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ dst[i] = src[i] >> 3;
+}
+
+int main()
+{
+ volatile int i;
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ src[i] = i << 3;
+
+ array_shift ();
+
+ for (i = 0; i < N; i++)
+ if (dst[i] != i)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-4.c
new file mode 100644
index 000000000..e705feadd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-shift-4.c
@@ -0,0 +1,37 @@
+/* { dg-require-effective-target vect_shift_char } */
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define N 32
+
+unsigned char dst[N] __attribute__((aligned(N)));
+unsigned char src[N] __attribute__((aligned(N)));
+
+__attribute__ ((noinline))
+void array_shift(void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ dst[i] = src[i] >> 3;
+}
+
+int main()
+{
+ volatile int i;
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ src[i] = i << 3;
+
+ array_shift ();
+
+ for (i = 0; i < N; i++)
+ if (dst[i] != i)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-1.c
new file mode 100644
index 000000000..9fdd05638
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-1.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int array[N];
+
+#pragma omp declare simd simdlen(4) notinbranch
+#pragma omp declare simd simdlen(4) notinbranch uniform(b) linear(c:3)
+#pragma omp declare simd simdlen(8) notinbranch
+#pragma omp declare simd simdlen(8) notinbranch uniform(b) linear(c:3)
+__attribute__((noinline)) int
+foo (int a, int b, int c)
+{
+ if (a < 30)
+ return 5;
+ return a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+bar ()
+{
+ int i;
+#pragma omp simd
+ for (i = 0; i < N; ++i)
+ array[i] = foo (i, 123, i * 3);
+}
+
+__attribute__((noinline, noclone)) void
+baz ()
+{
+ int i;
+#pragma omp simd
+ for (i = 0; i < N; ++i)
+ array[i] = foo (i, array[i], i * 3);
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ bar ();
+ for (i = 0; i < N; i++)
+ if (array[i] != (i < 30 ? 5 : i * 4 + 123))
+ abort ();
+ baz ();
+ for (i = 0; i < N; i++)
+ if (array[i] != (i < 30 ? 5 : i * 8 + 123))
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10.c
new file mode 100644
index 000000000..93cb9f993
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10.c
@@ -0,0 +1,85 @@
+/* { dg-do run } */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+/* { dg-additional-sources vect-simd-clone-10a.c } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int a[N], b[N];
+long int c[N];
+unsigned char d[N];
+
+#include "vect-simd-clone-10.h"
+
+__attribute__((noinline)) void
+fn1 (void)
+{
+ int i;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ a[i] = foo (c[i], a[i], b[i]) + 6;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ c[i] = bar (a[i], b[i], c[i]) * 2;
+}
+
+__attribute__((noinline)) void
+fn2 (void)
+{
+ int i;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ {
+ a[i] = foo (c[i], a[i], b[i]) + 6;
+ d[i]++;
+ }
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ {
+ c[i] = bar (a[i], b[i], c[i]) * 2;
+ d[i] /= 2;
+ }
+}
+
+__attribute__((noinline)) void
+fn3 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i * 2;
+ b[i] = 17 + (i % 37);
+ c[i] = (i & 63);
+ d[i] = 16 + i;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ fn3 ();
+ fn1 ();
+ for (i = 0; i < N; i++)
+ if (a[i] != i * 2 + 23 + (i % 37) + (i & 63)
+ || b[i] != 17 + (i % 37)
+ || c[i] != i * 4 + 80 + 4 * (i % 37) + 4 * (i & 63))
+ abort ();
+ fn3 ();
+ fn2 ();
+ for (i = 0; i < N; i++)
+ if (a[i] != i * 2 + 23 + (i % 37) + (i & 63)
+ || b[i] != 17 + (i % 37)
+ || c[i] != i * 4 + 80 + 4 * (i % 37) + 4 * (i & 63)
+ || d[i] != ((unsigned char) (17 + i)) / 2)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10.h b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10.h
new file mode 100644
index 000000000..ac3b81f86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10.h
@@ -0,0 +1,4 @@
+#pragma omp declare simd notinbranch
+extern int foo (long int a, int b, int c);
+#pragma omp declare simd notinbranch
+extern long int bar (int a, int b, long int c);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10a.c
new file mode 100644
index 000000000..c49473df1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-10a.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+#include "vect-simd-clone-10.h"
+
+#pragma omp declare simd notinbranch
+int
+foo (long int a, int b, int c)
+{
+ return a + b + c;
+}
+
+#pragma omp declare simd notinbranch
+long int
+bar (int a, int b, long int c)
+{
+ return a + b + c;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-11.c
new file mode 100644
index 000000000..a04530e25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-11.c
@@ -0,0 +1,67 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int a[N] __attribute__((aligned (32)));
+
+#pragma omp declare simd linear(a) linear(b:3) linear(c:6) notinbranch
+__attribute__((noinline)) int
+foo (int a, int b, int c)
+{
+ return a ^ (b * 512) ^ (c * 512 * 512);
+}
+
+__attribute__((noinline, noclone)) void
+bar (int *d)
+{
+ int i, j, k;
+ for (i = 0, j = 0, k = 0; i < N / 2; i++, j++, k += 3)
+ d[i] = foo (j, i * 3, 2 * k + 2);
+}
+
+#if 0
+__attribute__((noinline, noclone)) void
+baz (int *d)
+{
+ long int i, j, k;
+ for (i = 0, j = 0, k = 0; i < N / 2;
+ i = (int) i + 1, j = (int) j + 1, k = (int) k + 3)
+ d[i] = foo (j, i * 3, 2 * k + 2);
+}
+#endif
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ if (sizeof (int) * __CHAR_BIT__ < 32)
+ return 0;
+ bar (a + 7);
+ for (i = 0; i < N / 2; i++)
+ if (a[i + 7] != (i ^ (i * 3 * 512) ^ (((i * 6) + 2) * 512 * 512)))
+ abort ();
+ bar (a);
+ for (i = 0; i < N / 2; i++)
+ if (a[i] != (i ^ (i * 3 * 512) ^ (((i * 6) + 2) * 512 * 512)))
+ abort ();
+#if 0
+ baz (a + 7);
+ for (i = 0; i < N / 2; i++)
+ if (a[i + 7] != (i ^ (i * 3 * 512) ^ (((i * 6) + 2) * 512 * 512)))
+ abort ();
+ baz (a);
+ for (i = 0; i < N / 2; i++)
+ if (a[i] != (i ^ (i * 3 * 512) ^ (((i * 6) + 2) * 512 * 512)))
+ abort ();
+#endif
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12.c
new file mode 100644
index 000000000..0fd5890e9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12.c
@@ -0,0 +1,9 @@
+/* { dg-do run } */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+/* { dg-additional-sources vect-simd-clone-12a.c } */
+
+#include "vect-simd-clone-10.c"
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12a.c
new file mode 100644
index 000000000..c76508f9a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-12a.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+
+#include "vect-simd-clone-10.h"
+
+#pragma omp declare simd notinbranch
+__attribute__((noinline)) int
+foo (long int a, int b, int c)
+{
+ return a + b + c;
+}
+
+#pragma omp declare simd notinbranch
+__attribute__((noinline)) long int
+bar (int a, int b, long int c)
+{
+ return a + b + c;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-2.c
new file mode 100644
index 000000000..0eae49db9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-2.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int array[N] __attribute__((aligned (32)));
+
+#pragma omp declare simd simdlen(4) notinbranch aligned(a:16) uniform(a) linear(b)
+#pragma omp declare simd simdlen(4) notinbranch aligned(a:32) uniform(a) linear(b)
+#pragma omp declare simd simdlen(8) notinbranch aligned(a:16) uniform(a) linear(b)
+#pragma omp declare simd simdlen(8) notinbranch aligned(a:32) uniform(a) linear(b)
+__attribute__((noinline)) void
+foo (int *a, int b, int c)
+{
+ a[b] = c;
+}
+
+__attribute__((noinline, noclone)) void
+bar ()
+{
+ int i;
+#pragma omp simd
+ for (i = 0; i < N; ++i)
+ foo (array, i, i * array[i]);
+}
+
+__attribute__((noinline, noclone)) void
+baz ()
+{
+ int i;
+ for (i = 0; i < N; i++)
+ array[i] = 5 * (i & 7);
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ baz ();
+ bar ();
+ for (i = 0; i < N; i++)
+ if (array[i] != 5 * (i & 7) * i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-3.c
new file mode 100644
index 000000000..857c6f783
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-3.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int d[N], e[N];
+
+#pragma omp declare simd simdlen(4) notinbranch uniform(b) linear(c:3)
+__attribute__((noinline)) int
+foo (int a, int b, int c)
+{
+ if (a < 30)
+ return 5;
+ return a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+bar ()
+{
+ int i;
+#pragma omp simd
+ for (i = 0; i < N; ++i)
+ {
+ d[i] = foo (i, 123, i * 3);
+ e[i] = e[i] + i;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ bar ();
+ for (i = 0; i < N; i++)
+ if (d[i] != (i < 30 ? 5 : i * 4 + 123) || e[i] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-4.c
new file mode 100644
index 000000000..c64f1b0bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-4.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+float d[N];
+int e[N];
+unsigned short f[N];
+
+#pragma omp declare simd simdlen(8) notinbranch uniform(b)
+__attribute__((noinline)) float
+foo (float a, float b, float c)
+{
+ if (a < 30)
+ return 5.0f;
+ return a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+bar ()
+{
+ int i;
+#pragma omp simd
+ for (i = 0; i < N; ++i)
+ {
+ d[i] = foo (i, 123, i * 3);
+ e[i] = e[i] * 3;
+ f[i] = f[i] + 1;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ bar ();
+ for (i = 0; i < N; i++)
+ if (d[i] != (i < 30 ? 5.0f : i * 4 + 123.0f) || e[i] || f[i] != 1)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-5.c
new file mode 100644
index 000000000..1d2b067a7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-5.c
@@ -0,0 +1,44 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int d[N], e[N];
+
+#pragma omp declare simd simdlen(4) notinbranch uniform(b) linear(c:3)
+__attribute__((noinline)) long long int
+foo (int a, int b, int c)
+{
+ return a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+bar ()
+{
+ int i;
+#pragma omp simd
+ for (i = 0; i < N; ++i)
+ {
+ d[i] = foo (i, 123, i * 3);
+ e[i] = e[i] + i;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ bar ();
+ for (i = 0; i < N; i++)
+ if (d[i] != i * 4 + 123 || e[i] != i)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-6.c
new file mode 100644
index 000000000..26995da86
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-6.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int a[N];
+long long int b[N];
+short c[N];
+
+#pragma omp declare simd
+#pragma omp declare simd uniform(b) linear(c:3)
+__attribute__((noinline)) short
+foo (int a, long long int b, short c)
+{
+ return a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+bar (int x)
+{
+ int i;
+ if (x == 0)
+ {
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ c[i] = foo (a[i], b[i], c[i]);
+ }
+ else
+ {
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ c[i] = foo (a[i], x, i * 3);
+ }
+}
+
+__attribute__((noinline, noclone)) void
+baz (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 2 * i;
+ b[i] = -7 * i + 6;
+ c[i] = (i & 31) << 4;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ baz ();
+ bar (0);
+ for (i = 0; i < N; i++)
+ if (a[i] != 2 * i || b[i] != 6 - 7 * i
+ || c[i] != 6 - 5 * i + ((i & 31) << 4))
+ abort ();
+ else
+ a[i] = c[i];
+ bar (17);
+ for (i = 0; i < N; i++)
+ if (a[i] != 6 - 5 * i + ((i & 31) << 4)
+ || b[i] != 6 - 7 * i
+ || c[i] != 23 - 2 * i + ((i & 31) << 4))
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-7.c
new file mode 100644
index 000000000..2745c5e41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-7.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int a[N];
+long long int b[N];
+short c[N];
+
+#pragma omp declare simd
+#pragma omp declare simd uniform(b) linear(c:3)
+__attribute__((noinline)) short
+foo (int a, long long int b, int c)
+{
+ return a + b + c;
+}
+
+__attribute__((noinline, noclone)) void
+bar (int x)
+{
+ int i;
+ if (x == 0)
+ {
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ c[i] = foo (a[i], b[i], c[i]);
+ }
+ else
+ {
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ c[i] = foo (a[i], x, i * 3);
+ }
+}
+
+__attribute__((noinline, noclone)) void
+baz (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 2 * i;
+ b[i] = -7 * i + 6;
+ c[i] = (i & 31) << 4;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ baz ();
+ bar (0);
+ for (i = 0; i < N; i++)
+ if (a[i] != 2 * i || b[i] != 6 - 7 * i
+ || c[i] != 6 - 5 * i + ((i & 31) << 4))
+ abort ();
+ else
+ a[i] = c[i];
+ bar (17);
+ for (i = 0; i < N; i++)
+ if (a[i] != 6 - 5 * i + ((i & 31) << 4)
+ || b[i] != 6 - 7 * i
+ || c[i] != 23 - 2 * i + ((i & 31) << 4))
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-8.c
new file mode 100644
index 000000000..e0b09b645
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-8.c
@@ -0,0 +1,95 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int a[N], b[N];
+long int c[N];
+unsigned char d[N];
+
+#pragma omp declare simd simdlen(8) notinbranch
+__attribute__((noinline)) int
+foo (long int a, int b, int c)
+{
+ return a + b + c;
+}
+
+#pragma omp declare simd simdlen(8) notinbranch
+__attribute__((noinline)) long int
+bar (int a, int b, long int c)
+{
+ return a + b + c;
+}
+
+__attribute__((noinline)) void
+fn1 (void)
+{
+ int i;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ a[i] = foo (c[i], a[i], b[i]) + 6;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ c[i] = bar (a[i], b[i], c[i]) * 2;
+}
+
+__attribute__((noinline)) void
+fn2 (void)
+{
+ int i;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ {
+ a[i] = foo (c[i], a[i], b[i]) + 6;
+ d[i]++;
+ }
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ {
+ c[i] = bar (a[i], b[i], c[i]) * 2;
+ d[i] /= 2;
+ }
+}
+
+__attribute__((noinline)) void
+fn3 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i * 2;
+ b[i] = 17 + (i % 37);
+ c[i] = (i & 63);
+ d[i] = 16 + i;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ fn3 ();
+ fn1 ();
+ for (i = 0; i < N; i++)
+ if (a[i] != i * 2 + 23 + (i % 37) + (i & 63)
+ || b[i] != 17 + (i % 37)
+ || c[i] != i * 4 + 80 + 4 * (i % 37) + 4 * (i & 63))
+ abort ();
+ fn3 ();
+ fn2 ();
+ for (i = 0; i < N; i++)
+ if (a[i] != i * 2 + 23 + (i % 37) + (i & 63)
+ || b[i] != 17 + (i % 37)
+ || c[i] != i * 4 + 80 + 4 * (i % 37) + 4 * (i & 63)
+ || d[i] != ((unsigned char) (17 + i)) / 2)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-9.c
new file mode 100644
index 000000000..0c5ff4fa4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-simd-clone-9.c
@@ -0,0 +1,95 @@
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-mavx" { target avx_runtime } } */
+
+#include "tree-vect.h"
+
+#ifndef N
+#define N 1024
+#endif
+
+int a[N], b[N];
+long int c[N];
+unsigned char d[N];
+
+#pragma omp declare simd notinbranch
+__attribute__((noinline)) static int
+foo (long int a, int b, int c)
+{
+ return a + b + c;
+}
+
+#pragma omp declare simd notinbranch
+__attribute__((noinline)) static long int
+bar (int a, int b, long int c)
+{
+ return a + b + c;
+}
+
+__attribute__((noinline)) void
+fn1 (void)
+{
+ int i;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ a[i] = foo (c[i], a[i], b[i]) + 6;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ c[i] = bar (a[i], b[i], c[i]) * 2;
+}
+
+__attribute__((noinline)) void
+fn2 (void)
+{
+ int i;
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ {
+ a[i] = foo (c[i], a[i], b[i]) + 6;
+ d[i]++;
+ }
+ #pragma omp simd
+ for (i = 0; i < N; i++)
+ {
+ c[i] = bar (a[i], b[i], c[i]) * 2;
+ d[i] /= 2;
+ }
+}
+
+__attribute__((noinline)) void
+fn3 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i * 2;
+ b[i] = 17 + (i % 37);
+ c[i] = (i & 63);
+ d[i] = 16 + i;
+ }
+}
+
+int
+main ()
+{
+ int i;
+ check_vect ();
+ fn3 ();
+ fn1 ();
+ for (i = 0; i < N; i++)
+ if (a[i] != i * 2 + 23 + (i % 37) + (i & 63)
+ || b[i] != 17 + (i % 37)
+ || c[i] != i * 4 + 80 + 4 * (i % 37) + 4 * (i & 63))
+ abort ();
+ fn3 ();
+ fn2 ();
+ for (i = 0; i < N; i++)
+ if (a[i] != i * 2 + 23 + (i % 37) + (i & 63)
+ || b[i] != 17 + (i % 37)
+ || c[i] != i * 4 + 80 + 4 * (i % 37) + 4 * (i & 63)
+ || d[i] != ((unsigned char) (17 + i)) / 2)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c
new file mode 100644
index 000000000..8bc2c48db
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-mult.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+} s;
+
+typedef struct {
+ unsigned int a;
+ unsigned int b;
+} ii;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ s arr[N];
+ s *ptr = arr;
+ ii iarr[N];
+ ii *iptr = iarr;
+ s res[N];
+ ii ires[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ iarr[i].a = i;
+ iarr[i].b = i * 3;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ires[i].a = iptr->b - iptr->a;
+ ires[i].b = iptr->b + iptr->a;
+ res[i].b = ptr->b - ptr->a;
+ res[i].a = ptr->b + ptr->a;
+ iptr++;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].b != arr[i].b - arr[i].a
+ || ires[i].a != iarr[i].b - iarr[i].a
+ || res[i].a != arr[i].b + arr[i].a
+ || ires[i].b != iarr[i].b + iarr[i].a
+)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c
new file mode 100644
index 000000000..dca34ef1f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i2.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ s arr[N];
+ s *ptr = arr;
+ s res[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->b - ptr->a;
+ res[i].b = ptr->b + ptr->a;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].b - arr[i].a
+ || res[i].b != arr[i].a + arr[i].b)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c
new file mode 100644
index 000000000..68114a682
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-i4.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+ unsigned short c;
+ unsigned short d;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ s arr[N];
+ s *ptr = arr;
+ s res[N];
+ int i;
+ unsigned short x, y, z, w;
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ x = ptr->b - ptr->a;
+ y = ptr->d - ptr->c;
+ res[i].c = x + y;
+ z = ptr->a + ptr->c;
+ w = ptr->b + ptr->d;
+ res[i].a = z + w;
+ res[i].d = x + y;
+ res[i].b = x + y;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].a != arr[i].a + arr[i].c + arr[i].b + arr[i].d
+ || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].b != arr[i].b - arr[i].a + arr[i].d - arr[i].c)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c
new file mode 100644
index 000000000..0b2152249
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u16-mult.c
@@ -0,0 +1,69 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ s arr[N];
+ s *ptr = arr;
+ unsigned int iarr[N];
+ unsigned int *iptr = iarr;
+ s res[N];
+ unsigned int ires[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ iarr[i] = i * 3;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ires[i] = *iptr;
+ res[i].b = ptr->b - ptr->a;
+ res[i].a = ptr->b + ptr->a;
+ iptr++;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].b != arr[i].b - arr[i].a
+ || ires[i] != iarr[i]
+ || res[i].a != arr[i].b + arr[i].a)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c
new file mode 100644
index 000000000..4e742b201
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u32-mult.c
@@ -0,0 +1,66 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned int a;
+ unsigned int b;
+} ii;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ unsigned short arr[N];
+ unsigned short *ptr = arr;
+ ii iarr[N];
+ ii *iptr = iarr;
+ unsigned short res[N];
+ ii ires[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i] = i;
+ iarr[i].a = i;
+ iarr[i].b = i * 3;
+ __asm__ volatile ("");
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ ires[i].a = iptr->b - iptr->a;
+ ires[i].b = iptr->b + iptr->a;
+ res[i] = *ptr;
+ iptr++;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i] != arr[i]
+ || ires[i].a != iarr[i].b - iarr[i].a
+ || ires[i].b != iarr[i].b + iarr[i].a)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c
new file mode 100644
index 000000000..22030b06b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c
@@ -0,0 +1,76 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ s arr[N];
+ s *ptr = arr;
+ s res[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->a;
+ res[i].b = ptr->a;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].a
+ || res[i].b != arr[i].a)
+ abort ();
+ }
+
+ ptr = arr;
+ /* Not vectorizable: gap in store. */
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->b;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].b)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2-big-array.c
new file mode 100644
index 000000000..ca8bd1282
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2-big-array.c
@@ -0,0 +1,94 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ s arr[N];
+ s *ptr = arr;
+ s check_res[N];
+ s res[N];
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i + 5;
+ arr[i].f = i * 2 + 2;
+ arr[i].g = i - 3;
+ arr[i].h = 56;
+
+ check_res[i].c = arr[i].a;
+ check_res[i].a = arr[i].f + arr[i].a;
+ check_res[i].d = arr[i].f - arr[i].a;
+ check_res[i].b = arr[i].f;
+ check_res[i].f = arr[i].a;
+ check_res[i].e = arr[i].f - arr[i].a;
+ check_res[i].h = arr[i].f;
+ check_res[i].g = arr[i].f - arr[i].a;
+
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->a;
+ res[i].a = ptr->f + ptr->a;
+ res[i].d = ptr->f - ptr->a;
+ res[i].b = ptr->f;
+ res[i].f = ptr->a;
+ res[i].e = ptr->f - ptr->a;
+ res[i].h = ptr->f;
+ res[i].g = ptr->f - ptr->a;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != check_res[i].a
+ || res[i].b != check_res[i].b
+ || res[i].c != check_res[i].c
+ || res[i].d != check_res[i].d
+ || res[i].e != check_res[i].e
+ || res[i].f != check_res[i].f
+ || res[i].g != check_res[i].g
+ || res[i].h != check_res[i].h)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c
new file mode 100644
index 000000000..b1ce8052a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap2.c
@@ -0,0 +1,83 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ s arr[N];
+ s *ptr = arr;
+ s res[N];
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i + 5;
+ arr[i].f = i * 2 + 2;
+ arr[i].g = i - 3;
+ arr[i].h = 56;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->a;
+ res[i].a = ptr->f + ptr->a;
+ res[i].d = ptr->f - ptr->a;
+ res[i].b = ptr->f;
+ res[i].f = ptr->a;
+ res[i].e = ptr->f - ptr->a;
+ res[i].h = ptr->f;
+ res[i].g = ptr->f - ptr->a;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].a
+ || res[i].a != arr[i].f + arr[i].a
+ || res[i].d != arr[i].f - arr[i].a
+ || res[i].b != arr[i].f
+ || res[i].f != arr[i].a
+ || res[i].e != arr[i].f - arr[i].a
+ || res[i].h != arr[i].f
+ || res[i].g != arr[i].f - arr[i].a)
+ abort();
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7-big-array.c
new file mode 100644
index 000000000..188e28823
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7-big-array.c
@@ -0,0 +1,103 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ s arr[N];
+ s *ptr = arr;
+ s check_res[N];
+ s res[N];
+ unsigned char u, t, s, x, y, z, w;
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ arr[i].f = i * 5;
+ arr[i].g = i - 3;
+ arr[i].h = 67;
+
+ u = arr[i].b - arr[i].a;
+ t = arr[i].d - arr[i].c;
+ check_res[i].c = u + t;
+ x = arr[i].b + arr[i].d;
+ check_res[i].a = arr[i].a + x;
+ check_res[i].d = u + t;
+ s = arr[i].h - arr[i].a;
+ check_res[i].b = s + t;
+ check_res[i].f = arr[i].f + arr[i].h;
+ check_res[i].e = arr[i].b + arr[i].e;
+ check_res[i].h = arr[i].d;
+ check_res[i].g = u + t;
+
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ u = ptr->b - ptr->a;
+ t = ptr->d - ptr->c;
+ res[i].c = u + t;
+ x = ptr->b + ptr->d;
+ res[i].a = ptr->a + x;
+ res[i].d = u + t;
+ s = ptr->h - ptr->a;
+ res[i].b = s + t;
+ res[i].f = ptr->f + ptr->h;
+ res[i].e = ptr->b + ptr->e;
+ res[i].h = ptr->d;
+ res[i].g = u + t;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != check_res[i].a
+ || res[i].b != check_res[i].b
+ || res[i].c != check_res[i].c
+ || res[i].d != check_res[i].d
+ || res[i].e != check_res[i].e
+ || res[i].f != check_res[i].f
+ || res[i].g != check_res[i].g
+ || res[i].h != check_res[i].h)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c
new file mode 100644
index 000000000..87e6ce22e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i8-gap7.c
@@ -0,0 +1,88 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ int i;
+ s arr[N];
+ s *ptr = arr;
+ s res[N];
+ unsigned char u, t, s, x, y, z, w;
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ arr[i].f = i * 5;
+ arr[i].g = i - 3;
+ arr[i].h = 67;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ u = ptr->b - ptr->a;
+ t = ptr->d - ptr->c;
+ res[i].c = u + t;
+ x = ptr->b + ptr->d;
+ res[i].a = ptr->a + x;
+ res[i].d = u + t;
+ s = ptr->h - ptr->a;
+ res[i].b = s + t;
+ res[i].f = ptr->f + ptr->h;
+ res[i].e = ptr->b + ptr->e;
+ res[i].h = ptr->d;
+ res[i].g = u + t;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].a != arr[i].a + arr[i].b + arr[i].d
+ || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].b != arr[i].h - arr[i].a + arr[i].d - arr[i].c
+ || res[i].f != arr[i].f + arr[i].h
+ || res[i].e != arr[i].b + arr[i].e
+ || res[i].h != arr[i].d
+ || res[i].g != arr[i].b - arr[i].a + arr[i].d - arr[i].c)
+ abort();
+ }
+}
+
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-float.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-float.c
new file mode 100644
index 000000000..302be5f57
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-float.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_float } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+float b[N*2] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93};
+float c[N*2] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+ float a[N*2];
+
+ /* Strided access pattern. */
+ for (i = 0; i < N/2; i++)
+ {
+ a[i*2] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+ a[i*2+1] = b[2*i+8] * c[2*i+9] + b[2*i+9] * c[2*i+8];
+ }
+
+ /* Check results. */
+ for (i = 0; i < N/2; i++)
+ {
+ if (a[i*2] != b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i]
+ || a[i*2+1] != b[2*i+8] * c[2*i+9] + b[2*i+9] * c[2*i+8])
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* Needs interleaving support. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c
new file mode 100644
index 000000000..cc877293c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-mult-char-ls.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+} s;
+
+typedef struct {
+ unsigned int a;
+ unsigned int b;
+} ii;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr, ii *iarr)
+{
+ s *ptr = arr;
+ ii *iptr = iarr;
+ s res[N];
+ ii ires[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ires[i].a = iptr->b;
+ ires[i].b = iptr->a;
+ res[i].b = ptr->b - ptr->a;
+ res[i].a = ptr->b + ptr->a;
+ iptr++;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].b != arr[i].b - arr[i].a
+ || ires[i].a != iarr[i].b
+ || res[i].a != arr[i].b + arr[i].a
+ || ires[i].b != iarr[i].a
+)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+ ii iarr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ iarr[i].a = i;
+ iarr[i].b = i * 3;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr, iarr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c
new file mode 100644
index 000000000..3d2de09cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-mult.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+} s;
+
+typedef struct {
+ unsigned int a;
+ unsigned int b;
+} ii;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr, ii *iarr)
+{
+ s *ptr = arr;
+ ii *iptr = iarr;
+ s res[N];
+ ii ires[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ires[i].a = iptr->b - iptr->a;
+ ires[i].b = iptr->b + iptr->a;
+ res[i].b = ptr->b - ptr->a;
+ res[i].a = ptr->b + ptr->a;
+ iptr++;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].b != arr[i].b - arr[i].a
+ || ires[i].a != iarr[i].b - iarr[i].a
+ || res[i].a != arr[i].b + arr[i].a
+ || ires[i].b != iarr[i].b + iarr[i].a
+)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+ ii iarr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ iarr[i].a = i;
+ iarr[i].b = i * 3;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr, iarr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c
new file mode 100644
index 000000000..9768d7263
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-same-dr.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+} s;
+
+s buffer1[N], buffer2[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s * __restrict__ pIn, s* __restrict__ pOut)
+{
+ unsigned short i, x, y, d;
+ s *p, *q;
+
+ p = pIn;
+ q = pOut;
+
+ for (i = 0; i < N/2; i++)
+ {
+ x = pIn->a + 5;
+ y = pIn->a + 2;
+ pOut->a = x;
+ pOut->b = pIn->b;
+ pOut++;
+ pOut->a = y;
+ pOut->b = pIn->b;
+ pOut++;
+ pIn++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N/2; i++)
+ {
+ if (q->a != p->a + 5
+ || q->b != p->b)
+ abort ();
+ q++;
+ if (q->a != p->a + 2
+ || q->b != p->b)
+ abort ();
+ q++;
+ p++;
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ short i;
+
+ for (i = 0; i < N; i++)
+ {
+ buffer1[i].a = i;
+ buffer1[i].b = i + 8;
+ buffer2[i].a = i * 3;
+ buffer2[i].b = i * 2;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ check_vect ();
+
+ main1 (buffer1, buffer2);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c
new file mode 100644
index 000000000..26311a8bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-a-u8-i2.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+} s;
+
+__attribute__ ((noinline)) int
+main1 ()
+{
+ s arr[N];
+ s *ptr = arr;
+ s res[N];
+ int i;
+ unsigned char a[N], b[N];
+
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i * 2;
+ if (i%3 == 0)
+ a[i] = 10;
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = a[i] + 3;
+ res[i].b = a[i] + b[i];
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != a[i] + 3
+ || res[i].b != a[i] + b[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c
new file mode 100644
index 000000000..19af351e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-u16-i4.c
@@ -0,0 +1,72 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+ unsigned short c;
+ unsigned short d;
+} s;
+
+unsigned short a[N];
+unsigned short b[N];
+unsigned short c[N];
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+ unsigned short x, y, z, w;
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = a[i];
+ res[i].a = b[i];
+ res[i].d = c[i];
+ res[i].b = a[i] + b [i];
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != a[i]
+ || res[i].a != b[i]
+ || res[i].d != c[i]
+ || res[i].b != a[i] + b[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i * 2;
+ c[i] = 17;
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { { vect_interleave || vect_strided4 } && vect_pack_trunc } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { ! { vect_interleave || vect_strided4 } } && { vect_pack_trunc } } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c
new file mode 100644
index 000000000..3be94f10c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c
@@ -0,0 +1,45 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int a[N*2];
+int b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+int c[N] = {1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31};
+
+__attribute__ ((noinline)) int
+main1 (void)
+{
+ int i;
+
+ /* Strided access pattern. */
+ for (i = 0; i < N/2; i++)
+ {
+ a[i*2] = b[i] + c[i];
+ a[i*2+1] = b[i] * c[i];
+ }
+
+ /* Check results. */
+ for (i = 0; i < N/2; i++)
+ {
+ if (a[i*2] != b[i] + c[i]
+ || a[i*2+1] != b[i] * c[i])
+ abort();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+ return main1 ();
+}
+
+/* Needs interleaving support. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave || vect_strided2 } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail { vect_interleave || vect_strided2 } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c
new file mode 100644
index 000000000..57006846f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i2.c
@@ -0,0 +1,62 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ s *ptr = arr;
+ s res[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->b - ptr->a;
+ res[i].b = ptr->b + ptr->a;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].b - arr[i].a
+ || res[i].b != arr[i].a + arr[i].b)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c
new file mode 100644
index 000000000..e42314840
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i3.c
@@ -0,0 +1,112 @@
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+ unsigned short c;
+} s;
+
+#define A(I) (I)
+#define B(I) ((I) * 2)
+#define C(I) ((unsigned short) ~((I) ^ 0x18))
+
+void __attribute__ ((noinline))
+check1 (s *res)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ if (res[i].a != C (i)
+ || res[i].b != A (i)
+ || res[i].c != B (i))
+ abort ();
+}
+
+void __attribute__ ((noinline))
+check2 (unsigned short *res)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ if (res[i] != (unsigned short) (A (i) + B (i) + C (i)))
+ abort ();
+}
+
+void __attribute__ ((noinline))
+check3 (s *res)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ if (res[i].a != i
+ || res[i].b != i
+ || res[i].c != i)
+ abort ();
+}
+
+void __attribute__ ((noinline))
+check4 (unsigned short *res)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ if (res[i] != (unsigned short) (A (i) + B (i)))
+ abort ();
+}
+
+void __attribute__ ((noinline))
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res1[N];
+ unsigned short res2[N];
+
+ for (i = 0; i < N; i++)
+ {
+ res1[i].a = arr[i].c;
+ res1[i].b = arr[i].a;
+ res1[i].c = arr[i].b;
+ }
+ check1 (res1);
+
+ for (i = 0; i < N; i++)
+ res2[i] = arr[i].a + arr[i].b + arr[i].c;
+ check2 (res2);
+
+ for (i = 0; i < N; i++)
+ {
+ res1[i].a = i;
+ res1[i].b = i;
+ res1[i].c = i;
+ }
+ check3 (res1);
+
+ for (i = 0; i < N; i++)
+ res2[i] = arr[i].a + arr[i].b;
+ check4 (res2);
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = A (i);
+ arr[i].b = B (i);
+ arr[i].c = C (i);
+ }
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_strided3 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c
new file mode 100644
index 000000000..2e6fb02b8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u16-i4.c
@@ -0,0 +1,75 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned short a;
+ unsigned short b;
+ unsigned short c;
+ unsigned short d;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+ unsigned short x, y, z, w;
+
+ for (i = 0; i < N; i++)
+ {
+ x = ptr->b - ptr->a;
+ y = ptr->d - ptr->c;
+ res[i].c = x + y;
+ z = ptr->a + ptr->c;
+ w = ptr->b + ptr->d;
+ res[i].a = z + w;
+ res[i].d = x + y;
+ res[i].b = x + y;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].a != arr[i].a + arr[i].c + arr[i].b + arr[i].d
+ || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].b != arr[i].b - arr[i].a + arr[i].d - arr[i].c)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c
new file mode 100644
index 000000000..4c2048820
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i4.c
@@ -0,0 +1,70 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ int a;
+ int b;
+ int c;
+ int d;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->b - ptr->a + ptr->d - ptr->c;
+ res[i].a = ptr->a + ptr->c + ptr->b + ptr->d;
+ res[i].d = ptr->b - ptr->a + ptr->d - ptr->c;
+ res[i].b = ptr->b - ptr->a + ptr->d - ptr->c;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].a != arr[i].a + arr[i].c + arr[i].b + arr[i].d
+ || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].b != arr[i].b - arr[i].a + arr[i].d - arr[i].c)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided4 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c
new file mode 100644
index 000000000..4dbd8d9ab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-i8.c
@@ -0,0 +1,84 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ int a;
+ int b;
+ int c;
+ int d;
+ int e;
+ int f;
+ int g;
+ int h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->b - ptr->a + ptr->d - ptr->c;
+ res[i].a = ptr->a + ptr->g + ptr->b + ptr->d;
+ res[i].d = ptr->b - ptr->a + ptr->d - ptr->c;
+ res[i].b = ptr->h - ptr->a + ptr->d - ptr->c;
+ res[i].f = ptr->f + ptr->h;
+ res[i].e = ptr->b - ptr->e;
+ res[i].h = ptr->d - ptr->g;
+ res[i].g = ptr->b - ptr->a + ptr->d - ptr->c;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].a != arr[i].a + arr[i].g + arr[i].b + arr[i].d
+ || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].b != arr[i].h - arr[i].a + arr[i].d - arr[i].c
+ || res[i].f != arr[i].f + arr[i].h
+ || res[i].e != arr[i].b - arr[i].e
+ || res[i].h != arr[i].d - arr[i].g
+ || res[i].g != arr[i].b - arr[i].a + arr[i].d - arr[i].c)
+ abort();
+ }
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ arr[i].f = i * 5;
+ arr[i].g = i - 3;
+ arr[i].h = 56;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c
new file mode 100644
index 000000000..d825898a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u32-mult.c
@@ -0,0 +1,65 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned int a;
+ unsigned int b;
+} ii;
+
+__attribute__ ((noinline)) int
+main1 (unsigned short *arr, ii *iarr)
+{
+ unsigned short *ptr = arr;
+ ii *iptr = iarr;
+ unsigned short res[N];
+ ii ires[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ ires[i].a = iptr->b - iptr->a;
+ ires[i].b = iptr->b + iptr->a;
+ res[i] = *ptr;
+ iptr++;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i] != arr[i]
+ || ires[i].a != iarr[i].b - iarr[i].a
+ || ires[i].b != iarr[i].b + iarr[i].a)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ unsigned short arr[N];
+ ii iarr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i] = i;
+ iarr[i].a = i;
+ iarr[i].b = i * 3;
+ __asm__ volatile ("");
+ }
+ main1 (arr, iarr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c
new file mode 100644
index 000000000..b83d54e2e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c
@@ -0,0 +1,78 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ s *ptr = arr;
+ s res[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->b;
+ res[i].b = ptr->b;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].b
+ || res[i].b != arr[i].b)
+ abort ();
+ }
+
+ ptr = arr;
+ /* Not vectorizable: gap in store. */
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->b;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].b)
+ abort ();
+ }
+
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c
new file mode 100644
index 000000000..962ba51bd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2.c
@@ -0,0 +1,61 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ s *ptr = arr;
+ s res[N];
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->b - ptr->a;
+ res[i].b = ptr->b + ptr->a;
+ ptr++;
+ }
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].b - arr[i].a
+ || res[i].b != arr[i].a + arr[i].b)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2-big-array.c
new file mode 100644
index 000000000..473f56051
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2-big-array.c
@@ -0,0 +1,97 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+s check_res[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->b;
+ res[i].a = ptr->f + ptr->b;
+ res[i].d = ptr->f - ptr->b;
+ res[i].b = ptr->f;
+ res[i].f = ptr->b;
+ res[i].e = ptr->f - ptr->b;
+ res[i].h = ptr->f;
+ res[i].g = ptr->f - ptr->b;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != check_res[i].a
+ || res[i].b != check_res[i].b
+ || res[i].c != check_res[i].c
+ || res[i].d != check_res[i].d
+ || res[i].e != check_res[i].e
+ || res[i].f != check_res[i].f
+ || res[i].g != check_res[i].g
+ || res[i].h != check_res[i].h)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i + 5;
+ arr[i].f = i * 2 + 2;
+ arr[i].g = i - 3;
+ arr[i].h = 56;
+
+ check_res[i].c = arr[i].b;
+ check_res[i].a = arr[i].f + arr[i].b;
+ check_res[i].d = arr[i].f - arr[i].b;
+ check_res[i].b = arr[i].f;
+ check_res[i].f = arr[i].b;
+ check_res[i].e = arr[i].f - arr[i].b;
+ check_res[i].h = arr[i].f;
+ check_res[i].g = arr[i].f - arr[i].b;
+
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c
new file mode 100644
index 000000000..4037572d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap2.c
@@ -0,0 +1,85 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->b;
+ res[i].a = ptr->f + ptr->b;
+ res[i].d = ptr->f - ptr->b;
+ res[i].b = ptr->f;
+ res[i].f = ptr->b;
+ res[i].e = ptr->f - ptr->b;
+ res[i].h = ptr->f;
+ res[i].g = ptr->f - ptr->b;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b
+ || res[i].a != arr[i].f + arr[i].b
+ || res[i].d != arr[i].f - arr[i].b
+ || res[i].b != arr[i].f
+ || res[i].f != arr[i].b
+ || res[i].e != arr[i].f - arr[i].b
+ || res[i].h != arr[i].f
+ || res[i].g != arr[i].f - arr[i].b)
+ abort();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i + 5;
+ arr[i].f = i * 2 + 2;
+ arr[i].g = i - 3;
+ arr[i].h = 56;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c
new file mode 100644
index 000000000..da4b484b1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c
@@ -0,0 +1,118 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+s check_res[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+ unsigned char x;
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->b + ptr->c;
+ x = ptr->c + ptr->f;
+ res[i].a = x + ptr->b;
+ res[i].d = ptr->b + ptr->c;
+ res[i].b = ptr->c;
+ res[i].f = ptr->f + ptr->e;
+ res[i].e = ptr->b + ptr->e;
+ res[i].h = ptr->c;
+ res[i].g = ptr->b + ptr->c;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != check_res[i].a
+ || res[i].b != check_res[i].b
+ || res[i].c != check_res[i].c
+ || res[i].d != check_res[i].d
+ || res[i].e != check_res[i].e
+ || res[i].f != check_res[i].f
+ || res[i].g != check_res[i].g
+ || res[i].h != check_res[i].h)
+ abort ();
+ }
+
+ ptr = arr;
+ /* Not vectorizable: gap in store. */
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->b;
+ res[i].b = ptr->c;
+ ptr++;
+ }
+
+ /* Check results. */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].b
+ || res[i].b != arr[i].c)
+ abort ();
+ }
+
+}
+
+
+int main (void)
+{
+ int i;
+ s arr[N];
+ unsigned char x;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ arr[i].f = i * 5;
+ arr[i].g = i - 3;
+ arr[i].h = 56;
+
+ check_res[i].c = arr[i].b + arr[i].c;
+ x = arr[i].c + arr[i].f;
+ check_res[i].a = x + arr[i].b;
+ check_res[i].d = arr[i].b + arr[i].c;
+ check_res[i].b = arr[i].c;
+ check_res[i].f = arr[i].f + arr[i].e;
+ check_res[i].e = arr[i].b + arr[i].e;
+ check_res[i].h = arr[i].c;
+ check_res[i].g = arr[i].b + arr[i].c;
+
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c
new file mode 100644
index 000000000..07e1a803f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c
@@ -0,0 +1,118 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "tree-vect.h"
+
+#define N 160
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr, int n)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+ unsigned char x;
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = 0;
+ res[i].b = 0;
+ res[i].c = 0;
+ res[i].d = 0;
+ res[i].e = 0;
+ res[i].f = 0;
+ res[i].g = 0;
+ res[i].h = 0;
+ __asm__ volatile ("");
+ }
+
+ /* Check peeling for gaps for unknown loop bound. */
+ for (i = 0; i < n; i++)
+ {
+ res[i].c = ptr->b + ptr->c;
+ x = ptr->c + ptr->f;
+ res[i].a = x + ptr->b;
+ res[i].d = ptr->b + ptr->c;
+ res[i].b = ptr->c;
+ res[i].f = ptr->f + ptr->e;
+ res[i].e = ptr->b + ptr->e;
+ res[i].h = ptr->c;
+ res[i].g = ptr->b + ptr->c;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < n; i++)
+ {
+ if (res[i].c != arr[i].b + arr[i].c
+ || res[i].a != arr[i].c + arr[i].f + arr[i].b
+ || res[i].d != arr[i].b + arr[i].c
+ || res[i].b != arr[i].c
+ || res[i].f != arr[i].f + arr[i].e
+ || res[i].e != arr[i].b + arr[i].e
+ || res[i].h != arr[i].c
+ || res[i].g != arr[i].b + arr[i].c)
+ abort ();
+ }
+
+ /* Check also that we don't do more iterations than needed. */
+ for (i = n; i < N; i++)
+ {
+ if (res[i].c == arr[i].b + arr[i].c
+ || res[i].a == arr[i].c + arr[i].f + arr[i].b
+ || res[i].d == arr[i].b + arr[i].c
+ || res[i].b == arr[i].c
+ || res[i].f == arr[i].f + arr[i].e
+ || res[i].e == arr[i].b + arr[i].e
+ || res[i].h == arr[i].c
+ || res[i].g == arr[i].b + arr[i].c)
+ abort ();
+ }
+
+ return 0;
+}
+
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = 5;
+ arr[i].b = 6;
+ arr[i].c = 17;
+ arr[i].d = 3;
+ arr[i].e = 16;
+ arr[i].f = 16;
+ arr[i].g = 3;
+ arr[i].h = 56;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr, N-2);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c
new file mode 100644
index 000000000..007966704
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap4.c
@@ -0,0 +1,105 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+ unsigned char x;
+
+ for (i = 0; i < N; i++)
+ {
+ res[i].c = ptr->b + ptr->c;
+ x = ptr->c + ptr->f;
+ res[i].a = x + ptr->b;
+ res[i].d = ptr->b + ptr->c;
+ res[i].b = ptr->c;
+ res[i].f = ptr->f + ptr->e;
+ res[i].e = ptr->b + ptr->e;
+ res[i].h = ptr->c;
+ res[i].g = ptr->b + ptr->c;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b + arr[i].c
+ || res[i].a != arr[i].c + arr[i].f + arr[i].b
+ || res[i].d != arr[i].b + arr[i].c
+ || res[i].b != arr[i].c
+ || res[i].f != arr[i].f + arr[i].e
+ || res[i].e != arr[i].b + arr[i].e
+ || res[i].h != arr[i].c
+ || res[i].g != arr[i].b + arr[i].c)
+ abort ();
+ }
+
+ ptr = arr;
+ /* Not vectorizable: gap in store. */
+ for (i = 0; i < N; i++)
+ {
+ res[i].a = ptr->b;
+ res[i].b = ptr->c;
+ ptr++;
+ }
+
+ /* Check results. */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != arr[i].b
+ || res[i].b != arr[i].c)
+ abort ();
+ }
+
+}
+
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ arr[i].f = i * 5;
+ arr[i].g = i - 3;
+ arr[i].h = 56;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7-big-array.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7-big-array.c
new file mode 100644
index 000000000..9697aaa8b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7-big-array.c
@@ -0,0 +1,107 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+s check_res[N];
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+ unsigned char u, t, s, x, y, z, w;
+
+ for (i = 0; i < N; i++)
+ {
+ u = ptr->b - ptr->a;
+ t = ptr->d - ptr->c;
+ res[i].c = u + t;
+ x = ptr->b + ptr->d;
+ res[i].a = ptr->a + x;
+ res[i].d = u + t;
+ s = ptr->h - ptr->a;
+ res[i].b = s + t;
+ res[i].f = ptr->f + ptr->h;
+ res[i].e = ptr->b + ptr->e;
+ res[i].h = ptr->d;
+ res[i].g = u + t;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].a != check_res[i].a
+ || res[i].b != check_res[i].b
+ || res[i].c != check_res[i].c
+ || res[i].d != check_res[i].d
+ || res[i].e != check_res[i].e
+ || res[i].f != check_res[i].f
+ || res[i].g != check_res[i].g
+ || res[i].h != check_res[i].h)
+ abort ();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+ s arr[N];
+ unsigned char u, t, s, x, y, z, w;
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ arr[i].f = i * 5;
+ arr[i].g = i - 3;
+ arr[i].h = 67;
+
+ u = arr[i].b - arr[i].a;
+ t = arr[i].d - arr[i].c;
+ check_res[i].c = u + t;
+ x = arr[i].b + arr[i].d;
+ check_res[i].a = arr[i].a + x;
+ check_res[i].d = u + t;
+ s = arr[i].h - arr[i].a;
+ check_res[i].b = s + t;
+ check_res[i].f = arr[i].f + arr[i].h;
+ check_res[i].e = arr[i].b + arr[i].e;
+ check_res[i].h = arr[i].d;
+ check_res[i].g = u + t;
+
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c
new file mode 100644
index 000000000..854a4aaab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8-gap7.c
@@ -0,0 +1,90 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+ unsigned char u, t, s, x, y, z, w;
+
+ for (i = 0; i < N; i++)
+ {
+ u = ptr->b - ptr->a;
+ t = ptr->d - ptr->c;
+ res[i].c = u + t;
+ x = ptr->b + ptr->d;
+ res[i].a = ptr->a + x;
+ res[i].d = u + t;
+ s = ptr->h - ptr->a;
+ res[i].b = s + t;
+ res[i].f = ptr->f + ptr->h;
+ res[i].e = ptr->b + ptr->e;
+ res[i].h = ptr->d;
+ res[i].g = u + t;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].a != arr[i].a + arr[i].b + arr[i].d
+ || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].b != arr[i].h - arr[i].a + arr[i].d - arr[i].c
+ || res[i].f != arr[i].f + arr[i].h
+ || res[i].e != arr[i].b + arr[i].e
+ || res[i].h != arr[i].d
+ || res[i].g != arr[i].b - arr[i].a + arr[i].d - arr[i].c)
+ abort();
+ }
+}
+
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i * 3 + 5;
+ arr[i].f = i * 5;
+ arr[i].g = i - 3;
+ arr[i].h = 67;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c
new file mode 100644
index 000000000..37a095400
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i8.c
@@ -0,0 +1,92 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+typedef struct {
+ unsigned char a;
+ unsigned char b;
+ unsigned char c;
+ unsigned char d;
+ unsigned char e;
+ unsigned char f;
+ unsigned char g;
+ unsigned char h;
+} s;
+
+volatile int y = 0;
+
+__attribute__ ((noinline)) int
+main1 (s *arr)
+{
+ int i;
+ s *ptr = arr;
+ s res[N];
+ unsigned char u, t, s, x, y, z, w;
+
+ for (i = 0; i < N; i++)
+ {
+ u = ptr->b - ptr->a;
+ t = ptr->d - ptr->c;
+ res[i].c = u + t;
+ s = ptr->a + ptr->g;
+ x = ptr->b + ptr->d;
+ res[i].a = s + x;
+ res[i].d = u + t;
+ s = ptr->h - ptr->a;
+ x = ptr->d - ptr->c;
+ res[i].b = s + x;
+ res[i].f = ptr->f + ptr->h;
+ res[i].e = ptr->b + ptr->e;
+ res[i].h = ptr->d - ptr->g;
+ res[i].g = u + t;
+ ptr++;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].a != arr[i].a + arr[i].g + arr[i].b + arr[i].d
+ || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ || res[i].b != arr[i].h - arr[i].a + arr[i].d - arr[i].c
+ || res[i].f != arr[i].f + arr[i].h
+ || res[i].e != arr[i].b + arr[i].e
+ || res[i].h != arr[i].d - arr[i].g
+ || res[i].g != arr[i].b - arr[i].a + arr[i].d - arr[i].c
+ )
+ abort();
+ }
+}
+
+int main (void)
+{
+ int i;
+ s arr[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ arr[i].a = i;
+ arr[i].b = i * 2;
+ arr[i].c = 17;
+ arr[i].d = i+34;
+ arr[i].e = i;
+ arr[i].f = i + 5;
+ arr[i].g = i + 3;
+ arr[i].h = 67;
+ if (y) /* Avoid vectorization. */
+ abort ();
+ }
+
+ main1 (arr);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-01.c
new file mode 100644
index 000000000..4ae967a19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-01.c
@@ -0,0 +1,39 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int result[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
+int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
+int Y[N] = {};
+
+__attribute__ ((noinline)) void
+foo (int *in, int *out)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ out[i] = in[i] + 2;
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, Y);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (Y[i] != result[i])
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-02.c
new file mode 100644
index 000000000..13ab54a98
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-02.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int resultY[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
+int resultZ[N] = {13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28};
+int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
+int Y[N] = {};
+int Z[N] = {};
+
+__attribute__ ((noinline)) void
+foo (int *in, int *out1, int *out2)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ out1[i] = in[i] + 2;
+ out2[i] = in[i] + 3;
+ }
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, Y, Z);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (Y[i] != resultY[i])
+ abort ();
+
+ if (Z[i] != resultZ[i])
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c
new file mode 100644
index 000000000..2c06ce6b0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-03.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+struct S
+{
+ unsigned short a;
+ unsigned short b;
+};
+
+struct S result[N] = {20, 13, 22, 14, 24, 15, 26, 16, 28, 17, 30, 18,
+ 32, 19, 34, 20, 36, 21, 38, 22, 40, 23, 42, 24,
+ 44, 25, 46, 26, 48, 27, 50, 28};
+struct S X[N] = {10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16,
+ 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+ 23, 23, 24, 24, 25, 25};
+struct S Y[N] = {};
+
+__attribute__ ((noinline)) void
+foo (struct S * in, struct S * out)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ out[i].a = in[i].a * 2;
+ out[i].b = in[i].b + 3;
+ }
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, Y);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (Y[i].a != result[i].a)
+ abort ();
+
+ if (Y[i].b != result[i].b)
+ abort ();
+
+ }
+ return 0;
+}
+
+/* Needs interleaving support. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail vect_strided2 } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-04.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-04.c
new file mode 100644
index 000000000..bbe2996af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-04.c
@@ -0,0 +1,38 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int result[] = {10, 11, 15, 16, 20, 21, 25, 26, 30, 31, 35, 36, 40, 41, 45, 46, 50, 51};
+int X[] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0};
+
+__attribute__ ((noinline)) void
+foo (int *in, int *out)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ out[i] = in[i] + 5;
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, &X[2]);
+
+ /* check results: */
+ for (i = 0; i < N+2; i++)
+ {
+ if (X[i] != result[i])
+ abort ();
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c
new file mode 100644
index 000000000..f53985d3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c
@@ -0,0 +1,56 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+struct S
+{
+ unsigned short a;
+ unsigned short b;
+};
+
+struct S result[N] = {12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18,
+ 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24,
+ 24, 25, 25, 26, 26, 27, 27, 28};
+struct S X[N] = {10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16,
+ 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+ 23, 23, 24, 24, 25, 25};
+struct S Y[N] = {};
+
+__attribute__ ((noinline)) void
+foo (struct S * in, struct S * out)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ out[i].a = in[i].a + 2;
+ out[i].b = in[i].b + 3;
+ }
+}
+
+int
+main (void)
+{
+ int i;
+
+ check_vect ();
+
+ foo (X, Y);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (Y[i].a != result[i].a)
+ abort ();
+
+ if (Y[i].b != result[i].b)
+ abort ();
+
+ }
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-const-s16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-const-s16.c
new file mode 100644
index 000000000..a2fe9755a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-const-s16.c
@@ -0,0 +1,60 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+#include <stdlib.h>
+
+#define N 32
+
+__attribute__ ((noinline)) void
+foo (int *__restrict a,
+ short *__restrict b,
+ int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ a[i] = b[i] * 2333;
+
+ for (i = 0; i < n; i++)
+ if (a[i] != b[i] * 2333)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+bar (int *__restrict a,
+ short *__restrict b,
+ int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ a[i] = b[i] * (short) 2333;
+
+ for (i = 0; i < n; i++)
+ if (a[i] != b[i] * (short) 2333)
+ abort ();
+}
+
+int main (void)
+{
+ int i;
+ int a[N];
+ short b[N];
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 0;
+ b[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo (a, b, N);
+ bar (a, b, N);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { scan-tree-dump-times "pattern recognized" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-const-u16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-const-u16.c
new file mode 100644
index 000000000..e712da964
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-const-u16.c
@@ -0,0 +1,77 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+#include <stdlib.h>
+
+#define N 32
+
+__attribute__ ((noinline)) void
+foo (unsigned int *__restrict a,
+ unsigned short *__restrict b,
+ int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ a[i] = b[i] * 2333;
+
+ for (i = 0; i < n; i++)
+ if (a[i] != b[i] * 2333)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+bar (unsigned int *__restrict a,
+ unsigned short *__restrict b,
+ int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ a[i] = (unsigned short) 2333 * b[i];
+
+ for (i = 0; i < n; i++)
+ if (a[i] != b[i] * (unsigned short) 2333)
+ abort ();
+}
+
+__attribute__ ((noinline)) void
+baz (unsigned int *__restrict a,
+ unsigned short *__restrict b,
+ int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ a[i] = b[i] * 233333333;
+
+ for (i = 0; i < n; i++)
+ if (a[i] != b[i] * 233333333)
+ abort ();
+}
+
+
+int main (void)
+{
+ int i;
+ unsigned int a[N];
+ unsigned short b[N];
+
+ for (i = 0; i < N; i++)
+ {
+ a[i] = 0;
+ b[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo (a, b, N);
+ bar (a, b, N);
+ baz (a, b, N);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { scan-tree-dump-times "pattern recognized" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-half-u8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-half-u8.c
new file mode 100644
index 000000000..39078dfc4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-half-u8.c
@@ -0,0 +1,59 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+#include <stdlib.h>
+
+#define N 32
+#define COEF 32470
+
+unsigned char in[N];
+int out[N];
+
+__attribute__ ((noinline)) void
+foo ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ out[i] = in[i] * COEF;
+}
+
+__attribute__ ((noinline)) void
+bar ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ out[i] = COEF * in[i];
+}
+
+int main (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo ();
+
+ for (i = 0; i < N; i++)
+ if (out[i] != in[i] * COEF)
+ abort ();
+
+ bar ();
+
+ for (i = 0; i < N; i++)
+ if (out[i] != in[i] * COEF)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { scan-tree-dump-times "pattern recognized" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-half.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-half.c
new file mode 100644
index 000000000..3fb162de7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-half.c
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+#include <stdlib.h>
+
+#define N 32
+#define COEF 32470
+#define COEF2 324700
+
+unsigned char in[N];
+int out[N];
+int out2[N];
+
+__attribute__ ((noinline)) void
+foo (int a)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ out[i] = in[i] * COEF;
+ out2[i] = in[i] + a;
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ __asm__ volatile ("");
+ }
+
+ foo (COEF2);
+
+ for (i = 0; i < N; i++)
+ if (out[i] != in[i] * COEF || out2[i] != in[i] + COEF2)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { scan-tree-dump-times "pattern recognized" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-s16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-s16.c
new file mode 100644
index 000000000..983d7e70c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-s16.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+int result[N];
+
+/* short->int widening-mult */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ result[i] = X[i] * Y[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-s8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-s8.c
new file mode 100644
index 000000000..7a4c3c008
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-s8.c
@@ -0,0 +1,46 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+short result[N];
+
+/* char->short widening-mult */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ result[i] = X[i] * Y[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_qi_to_hi } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-sum.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-sum.c
new file mode 100644
index 000000000..289891830
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-sum.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+#define SUM 0
+
+/* Require widening-mult or data-unpacking (for the type promotion). */
+__attribute__ ((noinline)) int
+main1 (short *in, int off, short scale, int n)
+{
+ int i;
+ int sum = 0;
+
+ for (i = 0; i < n; i++) {
+ sum += ((int) in[i] * (int) in[i+off]) >> scale;
+ }
+
+ return sum;
+}
+
+int main (void)
+{
+ int i;
+ int sum;
+ short X[N];
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = 16-i;
+ __asm__ volatile ("");
+ }
+
+ sum = main1 (X, 1, 16, N-1);
+
+ if (sum != SUM)
+ abort ();
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u16.c
new file mode 100644
index 000000000..71faa11ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u16.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned short X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned short Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned int result[N];
+
+/* unsigned short->unsigned int widening-mult. */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ result[i] = (unsigned int)(X[i] * Y[i]);
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { scan-tree-dump-times "pattern recognized" 1 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c
new file mode 100644
index 000000000..ef8030215
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-mult-u8.c
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+unsigned char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
+unsigned short result[N];
+
+/* unsigned char-> unsigned short widening-mult. */
+__attribute__ ((noinline)) int
+foo1(int len) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ result[i] = X[i] * Y[i];
+ }
+}
+
+int main (void)
+{
+ int i;
+
+ check_vect ();
+
+ for (i=0; i<N; i++) {
+ X[i] = i;
+ Y[i] = 64-i;
+ __asm__ volatile ("");
+ }
+
+ foo1 (N);
+
+ for (i=0; i<N; i++) {
+ if (result[i] != X[i] * Y[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { target vect_widen_mult_qi_to_hi_pattern } } } */
+/* { dg-final { scan-tree-dump-times "pattern recognized" 1 "vect" { target vect_widen_mult_qi_to_hi_pattern } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-s16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-s16.c
new file mode 100644
index 000000000..efee60437
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-s16.c
@@ -0,0 +1,107 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+#define C 16
+
+__attribute__ ((noinline)) void
+foo (short *src, int *dst)
+{
+ int i;
+ short b, b0, b1, b2, b3, *s = src;
+ int *d = dst;
+
+ for (i = 0; i < N/4; i++)
+ {
+ b0 = *s++;
+ b1 = *s++;
+ b2 = *s++;
+ b3 = *s++;
+ *d = b0 << C;
+ d++;
+ *d = b1 << C;
+ d++;
+ *d = b2 << C;
+ d++;
+ *d = b3 << C;
+ d++;
+ }
+
+ s = src;
+ d = dst;
+ for (i = 0; i < N; i++)
+ {
+ b = *s++;
+ if (*d != b << C)
+ abort ();
+ d++;
+ }
+
+ s = src;
+ d = dst;
+ for (i = 0; i < N/4; i++)
+ {
+ b0 = *s++;
+ b1 = *s++;
+ b2 = *s++;
+ b3 = *s++;
+ *d = b0 << C;
+ d++;
+ *d = b1 << C;
+ d++;
+ *d = b2 << C;
+ d++;
+ *d = b3 << 6;
+ d++;
+ }
+
+ s = src;
+ d = dst;
+ for (i = 0; i < N/4; i++)
+ {
+ b = *s++;
+ if (*d != b << C)
+ abort ();
+ d++;
+ b = *s++;
+ if (*d != b << C)
+ abort ();
+ d++;
+ b = *s++;
+ if (*d != b << C)
+ abort ();
+ d++;
+ b = *s++;
+ if (*d != b << 6)
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ short in[N];
+ int out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 8 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-s8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-s8.c
new file mode 100644
index 000000000..e829a7995
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-s8.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+#define C 12
+
+__attribute__ ((noinline)) void
+foo (char *src, int *dst)
+{
+ int i;
+ char b, *s = src;
+ int *d = dst;
+
+ for (i = 0; i < N; i++)
+ {
+ b = *s++;
+ *d = b << C;
+ d++;
+ }
+
+ s = src;
+ d = dst;
+ for (i = 0; i < N; i++)
+ {
+ b = *s++;
+ if (*d != b << C)
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ char in[N];
+ int out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 1 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-u16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-u16.c
new file mode 100644
index 000000000..75834d481
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-u16.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+#define C 7
+
+__attribute__ ((noinline)) void
+foo (unsigned short *src, unsigned int *dst)
+{
+ int i;
+ unsigned short b, *s = src;
+ unsigned int *d = dst;
+
+ for (i = 0; i < N; i++)
+ {
+ b = *s++;
+ *d = b << C;
+ d++;
+ }
+
+ s = src;
+ d = dst;
+ for (i = 0; i < N; i++)
+ {
+ b = *s++;
+ if (*d != b << C)
+ abort ();
+ d++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ unsigned short in[N];
+ unsigned int out[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 1 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-u8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-u8.c
new file mode 100644
index 000000000..49d5a88a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-widen-shift-u8.c
@@ -0,0 +1,64 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_shift } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+#define C1 10
+#define C2 5
+
+__attribute__ ((noinline)) void
+foo (unsigned char *src, unsigned int *dst1, unsigned int *dst2)
+{
+ int i;
+ unsigned char b, *s = src;
+ unsigned int *d1 = dst1, *d2 = dst2;
+
+ for (i = 0; i < N; i++)
+ {
+ b = *s++;
+ *d1 = b << C1;
+ d1++;
+ *d2 = b << C2;
+ d2++;
+ }
+
+ s = src;
+ d1 = dst1;
+ d2 = dst2;
+ for (i = 0; i < N; i++)
+ {
+ b = *s++;
+ if (*d1 != b << C1 || *d2 != b << C2)
+ abort ();
+ d1++;
+ d2++;
+ }
+}
+
+int main (void)
+{
+ int i;
+ unsigned char in[N];
+ unsigned int out1[N];
+ unsigned int out2[N];
+
+ check_vect ();
+
+ for (i = 0; i < N; i++)
+ {
+ in[i] = i;
+ out1[i] = 255;
+ out2[i] = 255;
+ __asm__ volatile ("");
+ }
+
+ foo (in, out1, out2);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp
new file mode 100644
index 000000000..fa11e7e5e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp
@@ -0,0 +1,311 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Set up flags used for tests that don't specify options.
+global DEFAULT_VECTCFLAGS
+set DEFAULT_VECTCFLAGS ""
+
+# If the target system supports vector instructions, the default action
+# for a test is 'run', otherwise it's 'compile'. Save current default.
+# Executing vector instructions on a system without hardware vector support
+# is also disabled by a call to check_vect, but disabling execution here is
+# more efficient.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+
+# Skip these tests for targets that do not support generating vector
+# code. Set additional target-dependent vector flags, which can be
+# overridden by using dg-options in individual tests.
+if ![check_vect_support_and_set_flags] {
+ return
+}
+
+# These flags are used for all targets.
+lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model" "-fno-common"
+
+# If the linker used understands -M <mapfile>, pass it to clear hardware
+# capabilities set by the Sun assembler.
+# Try mapfile syntax v2 first which is the only way to clear hwcap_2 flags.
+set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcapv2.map"
+
+if ![check_no_compiler_messages mapfilev2 executable {
+ int main (void) { return 0; }
+} $clearcap_ldflags ] {
+ # If this doesn't work, fall back to the less capable v1 syntax.
+ set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map"
+
+ if ![check_no_compiler_messages mapfile executable {
+ int main (void) { return 0; }
+ } $clearcap_ldflags ] {
+ unset clearcap_ldflags
+ }
+}
+
+if [info exists clearcap_ldflags] {
+ lappend DEFAULT_VECTCFLAGS $clearcap_ldflags
+}
+
+# Initialize `dg'.
+dg-init
+
+global VEC_FLAGS
+set VEC_FLAGS $DEFAULT_VECTCFLAGS
+
+global O1_VECTCFLAGS
+set O1_VECTCFLAGS $DEFAULT_VECTCFLAGS
+lappend O1_VECTCFLAGS "-O1"
+lappend O1_VECTCFLAGS "-fdump-tree-vect-details"
+
+global O_VECTCFLAGS
+set O_VECTCFLAGS $DEFAULT_VECTCFLAGS
+lappend O_VECTCFLAGS "-O"
+lappend O_VECTCFLAGS "-fdump-tree-vect-details"
+
+lappend DEFAULT_VECTCFLAGS "-O2"
+
+# Tests that should be run without generating dump info
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/nodump-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# "-O -fdump-tree-veclower2"
+lappend VEC_FLAGS "-O" "-fdump-tree-veclower2"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vec-scal-*.\[cS\]]] \
+ "" $VEC_FLAGS
+
+set VECT_SLP_CFLAGS $DEFAULT_VECTCFLAGS
+
+lappend DEFAULT_VECTCFLAGS "-fdump-tree-vect-details"
+lappend VECT_SLP_CFLAGS "-fdump-tree-slp-details"
+
+# Main loop.
+set VECT_ADDITIONAL_FLAGS [list ""]
+if { [check_effective_target_lto] } {
+ lappend VECT_ADDITIONAL_FLAGS "-flto -ffat-lto-objects"
+}
+foreach flags $VECT_ADDITIONAL_FLAGS {
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[cS\]]] \
+ $flags $DEFAULT_VECTCFLAGS
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[cS\]]] \
+ $flags $DEFAULT_VECTCFLAGS
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/slp-*.\[cS\]]] \
+ $flags $DEFAULT_VECTCFLAGS
+ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/bb-slp*.\[cS\]]] \
+ $flags $VECT_SLP_CFLAGS
+}
+
+#### Tests with special options
+global SAVED_DEFAULT_VECTCFLAGS
+set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
+set SAVED_VECT_SLP_CFLAGS $VECT_SLP_CFLAGS
+
+# --param vect-max-version-for-alias-checks=0 tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=0"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -ffast-math tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-ffast-math"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-\[ipsv\]*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -ffast-math SLP tests
+set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
+lappend VECT_SLP_CFLAGS "-ffast-math"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-bb-slp-*.\[cS\]]] \
+ "" $VECT_SLP_CFLAGS
+
+# -fno-fast-math tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-fast-math"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fast-math-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-math-errno tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-math-errno"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-math-errno-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fwrapv tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fwrapv"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/wrapv-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -ftrapv tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-ftrapv"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/trapv-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fdump-tree-dceloop-details tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fdump-tree-dceloop-details"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dump-tree-dceloop-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-dce tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-dce"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dce-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fsection-anchors tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fsection-anchors"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/section-anchors-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# alignment-sensitive -fsection-anchors tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fsection-anchors" \
+ "-fdump-ipa-increase_alignment-details"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/aligned-section-anchors-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-section-anchors tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-section-anchors"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-section-anchors-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -funswitch-loops tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-funswitch-loops"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/unswitch-loops-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-trapping-math tests
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-trapping-math"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-trapping-math-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-scev-cprop
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-vect-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-scev-cprop
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-pr*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-scev-cprop
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-outer-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-scev-cprop -fno-tree-reassoc
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop" "-fno-tree-reassoc"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-noreassoc-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-scev-cprop
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-scev-cprop"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-scevccp-slp-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-dominator-opts
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-dominator-opts"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dom-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-pre
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-pre"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-pre-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# With -Os
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-Os"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# With --param ggc-min-expand=0 --param ggc-min-heapsize=0
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "--param" "ggc-min-expand=0" "--param" "ggc-min-heapsize=0"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/ggc-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -ftree-loop-if-convert-stores
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-ftree-loop-if-convert-stores"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/if-cvt-stores-vect-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# With -O3.
+# Don't allow IPA cloning, because it throws our counts out of whack.
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone"
+if [istarget "spu-*-*"] {
+ lappend DEFAULT_VECTCFLAGS "-funroll-loops"
+}
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# With -O1
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O1-*.\[cS\]]] \
+ "" $O1_VECTCFLAGS
+
+# With -O
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O-*.\[cS\]]] \
+ "" $O_VECTCFLAGS
+
+# -fno-tree-reassoc
+set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
+lappend VECT_SLP_CFLAGS "-fno-tree-reassoc"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-reassoc-bb-slp-*.\[cS\]]] \
+ "" $VECT_SLP_CFLAGS
+
+# -fno-tree-fre
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-fre"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-fre-*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-fre -fno-tree-pre
+set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
+lappend DEFAULT_VECTCFLAGS "-fno-tree-fre" "-fno-tree-pre"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-fre-pre*.\[cS\]]] \
+ "" $DEFAULT_VECTCFLAGS
+
+# -fno-tree-sra
+set VECT_SLP_CFLAGS $SAVED_VECT_SLP_CFLAGS
+lappend VECT_SLP_CFLAGS "-fno-tree-sra"
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]]] \
+ "" $VECT_SLP_CFLAGS
+
+
+# Clean up.
+set dg-do-what-default ${save-dg-do-what-default}
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-7.c
new file mode 100644
index 000000000..5d495440f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-7.c
@@ -0,0 +1,52 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 128
+
+short sa[N];
+short sb[N];
+
+int main1 ()
+{
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ sb[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sb[i] != 5)
+ abort ();
+ }
+
+ for (i = 0; i < N; i++)
+ {
+ sa[i] = sb[i] + (short)100;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (sa[i] != 105)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+/* Fails for 32-bit targets that don't vectorize PLUS. */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c
new file mode 100644
index 000000000..4b04a9d41
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c
@@ -0,0 +1,51 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 121
+
+signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30};
+signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline))
+void main1 (signed char x, signed char max_result, signed char min_result)
+{
+ int i;
+ signed char diff = 2;
+ signed char max = x;
+ signed char min = x;
+
+ for (i = 0; i < N; i++) {
+ diff += (signed char)(b[i] - c[i]);
+ }
+
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c
new file mode 100644
index 000000000..0468b1966
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c
@@ -0,0 +1,50 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+#define DIFF 242
+
+short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+
+__attribute__ ((noinline))
+void main1 (short x, short max_result, short min_result)
+{
+ int i;
+ short diff = 2;
+ short max = x;
+ short min = x;
+
+ for (i = 0; i < N; i++) {
+ diff += (short)(b[i] - c[i]);
+ }
+ for (i = 0; i < N; i++) {
+ max = max < c[i] ? c[i] : max;
+ }
+
+ for (i = 0; i < N; i++) {
+ min = min > c[i] ? c[i] : min;
+ }
+
+ /* check results: */
+ if (diff != DIFF)
+ abort ();
+ if (max != max_result)
+ abort ();
+ if (min != min_result)
+ abort ();
+}
+
+int main (void)
+{
+ check_vect ();
+
+ main1 (100, 100, 1);
+ main1 (0, 15, 0);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_int_max } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c
new file mode 100644
index 000000000..68caa8bd1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 64
+
+#define DOT -21856
+
+signed char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63};
+signed char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
+
+/* char->short->short dot product.
+ The dot-product pattern should be detected.
+ Should be vectorized on vect_sdot_qi targets (targets that support
+ dot-product of signed char).
+ This test currently fails to vectorize on targets that support
+ dot-product of chars into and int accumulator.
+ Can also be vectorized as widening-mult + summation,
+ or with type-conversion support.
+ */
+__attribute__ ((noinline)) short
+foo(int len) {
+ int i;
+ short result = 0;
+
+ for (i=0; i<len; i++) {
+ result += (X[i] * Y[i]);
+ }
+ return result;
+}
+
+int main (void)
+{
+ int i;
+ short dot;
+
+ check_vect ();
+
+ dot = foo (N);
+ if (dot != DOT)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vect_recog_dot_prod_pattern: detected" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" } } */
+
+/* When vectorizer is enhanced to vectorize accumulation into short for targets
+ that support accumulation into int (e.g. ia64) we'd have:
+dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_sdot_qi } }
+*/
+/* In the meantime expect: */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-pattern-2c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-pattern-2c.c
new file mode 100644
index 000000000..7611c353c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-pattern-2c.c
@@ -0,0 +1,41 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+signed char data_ch[N] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
+#define SUM 210
+
+__attribute__ ((noinline)) int
+foo ()
+{
+ int i;
+ signed short shortsum = 0;
+
+ /* widenning sum: sum chars into short. */
+
+ for (i = 0; i < N; i++)
+ {
+ shortsum += data_ch[i];
+ }
+
+ /* check results: */
+ if (shortsum != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo ();
+}
+
+/* { dg-final { scan-tree-dump "vect_recog_widen_sum_pattern: detected" "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_qi_to_hi } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_qi_to_hi } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vector-shift-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vector-shift-2.c
new file mode 100644
index 000000000..380f2dfb3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vector-shift-2.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+typedef unsigned vec __attribute__ ((vector_size (4*sizeof(int))));
+void
+f (vec *a)
+{
+ vec s = { 5, 5, 5, 5 };
+ *a = *a << s;
+}
+
+/* { dg-final { scan-tree-dump "<< 5" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vector-shift.c b/gcc-4.9/gcc/testsuite/gcc.dg/vector-shift.c
new file mode 100644
index 000000000..2a4d415c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vector-shift.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+typedef unsigned vec __attribute__ ((vector_size (4 * sizeof (int))));
+
+void
+f (vec *x)
+{
+ *x = (*x << 4) << 3;
+}
+
+/* { dg-final { scan-tree-dump "<< 7" "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/verbose-asm.c b/gcc-4.9/gcc/testsuite/gcc.dg/verbose-asm.c
new file mode 100644
index 000000000..7d105d31c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/verbose-asm.c
@@ -0,0 +1,27 @@
+/* Test whether -fverbose-asm works. */
+/* { dg-do compile } */
+/* { dg-options "-fverbose-asm" } */
+
+void foo (int *x)
+{
+ (*x)++;
+}
+
+int bar (int *y)
+{
+ int a, b;
+ b = 10;
+ a = 26;
+ foo (&a);
+ a += 10;
+ foo (&a);
+ *y--;
+ return b;
+}
+
+int
+main (int argc, char *argv [])
+{
+ bar (&argc);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-1.c
new file mode 100644
index 000000000..864b971dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-1.c
@@ -0,0 +1,9 @@
+/* Test visibility attribute on function definition. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+void
+__attribute__((visibility ("hidden")))
+foo()
+{ }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-10.c
new file mode 100644
index 000000000..d86ce1b1a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-10.c
@@ -0,0 +1,19 @@
+/* Test that a definition marked with dllexport has default
+ visibility. */
+/* { dg-require-visibility "" } */
+/* { dg-require-dll "" } */
+/* { dg-options "-fvisibility=hidden" } */
+/* { dg-final { scan-not-hidden "g" } } */
+/* { dg-final { scan-not-hidden "h" } } */
+/* { dg-final { scan-not-hidden "k" } } */
+/* { dg-final { scan-not-hidden "l" } } */
+
+__declspec(dllexport) void g() {}
+
+__declspec(dllexport) void h();
+void h() {}
+
+__declspec(dllexport) int k;
+
+__declspec(dllexport) extern int l;
+int l;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-11.c
new file mode 100644
index 000000000..d616fe9ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-11.c
@@ -0,0 +1,26 @@
+/* PR middle-end/20297 */
+/* The memcpy FUNCTION_DECL built in the middle-end for block moves got
+ hidden visibility from the first push, so the call didn't use the PLT. */
+
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-skip-if "" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-require-visibility "" } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-Os -fpic -mstringop-strategy=libcall" } */
+/* { dg-final { scan-assembler "memcpy@PLT" } } */
+
+#pragma GCC visibility push(hidden)
+#pragma GCC visibility push(default)
+extern void* memcpy (void *, const void *, __SIZE_TYPE__);
+#pragma GCC visibility pop
+
+struct a { int a[4096]; };
+
+extern void *bar (struct a *, struct a *, int);
+
+void *
+foo (struct a *a, struct a *b, int c)
+{
+ struct a cc = *b;
+ return bar (a, &cc, 4 * c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-12.c
new file mode 100644
index 000000000..6012bd9ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-12.c
@@ -0,0 +1,10 @@
+/* Test that dllimport'd functions have default visibility. */
+/* { dg-require-visibility "" } */
+/* { dg-require-dll "" } */
+/* { dg-options "-fvisibility=hidden" } */
+/* { dg-final { scan-not-hidden "f1" } } */
+
+extern void __attribute__((dllimport)) f1();
+void f2() {
+ f1();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-13.c
new file mode 100644
index 000000000..5f7a7c7a0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-13.c
@@ -0,0 +1,19 @@
+/* { dg-require-visibility "" } */
+/* { dg-require-dll "" } */
+
+extern void __attribute__((dllimport, visibility("hidden")))
+ f1(); /* { dg-error "visibility" } */
+extern void __attribute__((visibility("hidden"), dllimport))
+ f2(); /* { dg-error "visibility" } */
+extern void __attribute__((dllexport, visibility("hidden")))
+ f3(); /* { dg-error "visibility" } */
+extern void __attribute__((visibility("hidden"), dllexport))
+ f4(); /* { dg-error "visibility" } */
+extern void __attribute__((visibility("default"), dllimport))
+ f5();
+extern void __attribute__((dllimport, visibility("default")))
+ f6();
+extern void __attribute__((visibility("default"), dllexport))
+ f7();
+extern void __attribute__((dllexport, visibility("default")))
+ f8();
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-14.c
new file mode 100644
index 000000000..1c01f8399
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-14.c
@@ -0,0 +1,10 @@
+/* Test that called external functions are marked. */
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+int f () {
+ foo();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-15.c
new file mode 100644
index 000000000..8d331d76c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-15.c
@@ -0,0 +1,12 @@
+/* Test that accessed external functions are marked. */
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+typedef void (*foo_t)(void);
+
+foo_t g(void) {
+ return foo;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-16.c
new file mode 100644
index 000000000..52a25cdef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-16.c
@@ -0,0 +1,10 @@
+/* Test that accessed external variables are marked. */
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int f () {
+ return foo;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-17.c
new file mode 100644
index 000000000..0ff3e83de
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-17.c
@@ -0,0 +1,10 @@
+/* Test that external variable whose address is taken are marked. */
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int *f () {
+ return &foo;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-18.c
new file mode 100644
index 000000000..f54c73b19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-18.c
@@ -0,0 +1,8 @@
+/* Test that external variable whose address is taken are marked. */
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int *test = &foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-19.c
new file mode 100644
index 000000000..3c2455fb2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-19.c
@@ -0,0 +1,9 @@
+/* Test that accessed external functions are marked. */
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-darwin* } { "*" } { "" } } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+typedef void (*foo_t)(void);
+foo_t test = foo;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-2.c
new file mode 100644
index 000000000..0977abac2
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-2.c
@@ -0,0 +1,10 @@
+/* Test that visibility attribute on declaration extends to definition. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+void
+__attribute__((visibility ("hidden")))
+foo();
+
+void foo() { }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-20.c
new file mode 100644
index 000000000..5fc7447f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-20.c
@@ -0,0 +1,18 @@
+/* PR target/39175 */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-options "-O2 -fvisibility=hidden -fpic" { target fpic } } */
+
+__attribute__((noinline)) int
+foo (int x)
+{
+ return x;
+}
+
+int foo (int x);
+
+int
+bar (int x)
+{
+ return foo (x);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-21.c
new file mode 100644
index 000000000..59d1b4567
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-21.c
@@ -0,0 +1,14 @@
+/* Test visibility attribute on function definition. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsection-anchors" } */
+/* { dg-require-visibility "" } */
+/* { dg-require-weak "" } */
+/* { dg-require-effective-target section_anchors } */
+/* { dg-final { scan-assembler-not "ANCHOR" } } */
+
+int __attribute__((weak, visibility("hidden"))) weak_hidden[3];
+
+int *f_weak_hidden ()
+{
+ return weak_hidden;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-3.c
new file mode 100644
index 000000000..cb5a71524
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-3.c
@@ -0,0 +1,8 @@
+/* Test visibility attribute on forward declaration of global variable */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "xyzzy" } } */
+
+int
+__attribute__((visibility ("hidden")))
+xyzzy = 5;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-4.c
new file mode 100644
index 000000000..af0d461c3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-4.c
@@ -0,0 +1,10 @@
+/* Test visibility attribute on forward declaration of global variable */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "xyzzy" } } */
+
+extern int
+__attribute__((visibility ("hidden")))
+xyzzy;
+
+int xyzzy = 5;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c
new file mode 100644
index 000000000..0302768c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c
@@ -0,0 +1,12 @@
+/* Test visibility attribute on definition of a function that has
+ already had a forward declaration. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+void foo();
+
+void
+ __attribute__((visibility ("hidden")))
+foo()
+{ }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-6.c
new file mode 100644
index 000000000..4e9deebec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-6.c
@@ -0,0 +1,11 @@
+/* Test visibility attribute on definition of global variable that has
+ already had a forward declaration. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "xyzzy" } } */
+
+extern int xyzzy;
+
+int
+__attribute__((visibility ("hidden")))
+xyzzy = 5;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-7.c
new file mode 100644
index 000000000..016f3dda6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-7.c
@@ -0,0 +1,12 @@
+/* Test warning from conflicting visibility specifications. */
+/* { dg-do compile } */
+/* { dg-require-visibility "protected" } */
+/* { dg-final { scan-hidden "xyzzy" } } */
+
+extern int
+__attribute__((visibility ("hidden")))
+xyzzy; /* { dg-message "note: previous declaration" "" } */
+
+int
+__attribute__((visibility ("protected")))
+xyzzy = 5; /* { dg-warning "different visibility" "" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-8.c
new file mode 100644
index 000000000..89f89c082
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-8.c
@@ -0,0 +1,16 @@
+/* Test hidden visibility on built-in functions (for libc). PR 13856. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "__GI_fputs_unlocked" } } */
+
+int fputs_unlocked (const char *restrict, int *restrict)
+ __asm__ ("__GI_fputs_unlocked")
+ __attribute__ ((visibility ("hidden")));
+
+int
+fputs_unlocked (str, fp)
+ const char *str;
+ int *fp;
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-9.c
new file mode 100644
index 000000000..9d5751684
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-9.c
@@ -0,0 +1,9 @@
+/* Test that -fvisibility works. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-options "-fvisibility=hidden" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+void foo();
+
+void foo() { }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-a.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-a.c
new file mode 100644
index 000000000..23a51d7e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-a.c
@@ -0,0 +1,10 @@
+/* Test that #pragma GCC visibility works. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+#pragma GCC visibility push(hidden)
+void foo();
+#pragma GCC visibility pop
+
+void foo() { }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-b.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-b.c
new file mode 100644
index 000000000..b1f15758a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-b.c
@@ -0,0 +1,13 @@
+/* { dg-do assemble { target *-*-darwin* } } */
+
+#define __private_extern__ extern __attribute__((visibility ("hidden")))
+
+__private_extern__ int n;
+
+int
+mach_error_type(int sub)
+{
+ if (sub >= n)
+ return 1;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-c.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-c.c
new file mode 100644
index 000000000..22412e02b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-c.c
@@ -0,0 +1,10 @@
+/* Test that visibility works on common symbols also. */
+/* { dg-do assemble } */
+/* { dg-require-visibility "" } */
+
+int options __attribute__((__visibility__("hidden")));
+
+void f(void)
+{
+ options = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-d.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-d.c
new file mode 100644
index 000000000..6f8851b62
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-d.c
@@ -0,0 +1,205 @@
+/* PR middle-end/20303 */
+/* Test nesting of #pragma GCC visibility. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-not-hidden "foo00" } } */
+/* { dg-final { scan-hidden "foo01" } } */
+/* { dg-final { scan-not-hidden "foo02" } } */
+/* { dg-final { scan-hidden "foo03" } } */
+/* { dg-final { scan-not-hidden "foo04" } } */
+/* { dg-final { scan-not-hidden "foo05" } } */
+/* { dg-final { scan-not-hidden "foo06" } } */
+/* { dg-final { scan-hidden "foo07" } } */
+/* { dg-final { scan-not-hidden "foo08" } } */
+/* { dg-final { scan-hidden "foo09" } } */
+/* { dg-final { scan-not-hidden "foo10" } } */
+/* { dg-final { scan-hidden "foo11" } } */
+/* { dg-final { scan-hidden "foo12" } } */
+/* { dg-final { scan-hidden "foo13" } } */
+/* { dg-final { scan-not-hidden "foo14" } } */
+/* { dg-final { scan-hidden "foo15" } } */
+/* { dg-final { scan-not-hidden "foo16" } } */
+/* { dg-final { scan-hidden "foo17" } } */
+/* { dg-final { scan-not-hidden "foo18" } } */
+/* { dg-final { scan-hidden "foo19" } } */
+/* { dg-final { scan-not-hidden "foo20" } } */
+/* { dg-final { scan-hidden "foo21" } } */
+/* { dg-final { scan-not-hidden "foo22" } } */
+/* { dg-final { scan-hidden "foo23" } } */
+/* { dg-final { scan-not-hidden "foo24" } } */
+/* { dg-final { scan-hidden "foo25" } } */
+/* { dg-final { scan-not-hidden "foo26" } } */
+/* { dg-final { scan-hidden "foo27" } } */
+/* { dg-final { scan-not-hidden "foo28" } } */
+/* { dg-final { scan-hidden "foo29" } } */
+/* { dg-final { scan-not-hidden "foo30" } } */
+/* { dg-final { scan-hidden "foo31" } } */
+/* { dg-final { scan-not-hidden "foo32" } } */
+/* { dg-final { scan-hidden "foo33" } } */
+/* { dg-final { scan-not-hidden "foo34" } } */
+/* { dg-final { scan-hidden "foo35" } } */
+/* { dg-final { scan-not-hidden "foo36" } } */
+/* { dg-final { scan-hidden "foo37" } } */
+/* { dg-final { scan-not-hidden "foo38" } } */
+/* { dg-final { scan-hidden "foo39" } } */
+/* { dg-final { scan-not-hidden "foo40" } } */
+/* { dg-final { scan-hidden "foo41" } } */
+/* { dg-final { scan-not-hidden "foo42" } } */
+/* { dg-final { scan-hidden "foo43" } } */
+/* { dg-final { scan-not-hidden "foo44" } } */
+/* { dg-final { scan-hidden "foo45" } } */
+/* { dg-final { scan-hidden "foo46" } } */
+/* { dg-final { scan-hidden "foo47" } } */
+/* { dg-final { scan-not-hidden "foo48" } } */
+/* { dg-final { scan-hidden "foo49" } } */
+/* { dg-final { scan-not-hidden "foo50" } } */
+/* { dg-final { scan-hidden "foo51" } } */
+/* { dg-final { scan-not-hidden "foo52" } } */
+/* { dg-final { scan-not-hidden "foo53" } } */
+/* { dg-final { scan-not-hidden "foo54" } } */
+/* { dg-final { scan-hidden "foo55" } } */
+/* { dg-final { scan-not-hidden "foo56" } } */
+/* { dg-final { scan-hidden "foo57" } } */
+/* { dg-final { scan-not-hidden "foo58" } } */
+/* { dg-final { scan-hidden "foo59" } } */
+
+#pragma GCC visibility push(default)
+void foo00();
+#pragma GCC visibility push(hidden)
+void foo01();
+#pragma GCC visibility push(default)
+void foo02();
+#pragma GCC visibility push(hidden)
+void foo03();
+#pragma GCC visibility push(default)
+void foo04();
+#pragma GCC visibility push(default)
+void foo05();
+#pragma GCC visibility push(default)
+void foo06();
+#pragma GCC visibility push(hidden)
+void foo07();
+#pragma GCC visibility push(default)
+void foo08();
+#pragma GCC visibility push(hidden)
+void foo09();
+#pragma GCC visibility push(default)
+void foo10();
+#pragma GCC visibility push(hidden)
+void foo11();
+#pragma GCC visibility push(hidden)
+void foo12();
+#pragma GCC visibility push(hidden)
+void foo13();
+#pragma GCC visibility push(default)
+void foo14();
+#pragma GCC visibility push(hidden)
+void foo15();
+#pragma GCC visibility push(default)
+void foo16();
+#pragma GCC visibility push(hidden)
+void foo17();
+#pragma GCC visibility push(default)
+void foo18();
+#pragma GCC visibility push(hidden)
+void foo19();
+#pragma GCC visibility push(default)
+void foo20();
+#pragma GCC visibility push(hidden)
+void foo21();
+#pragma GCC visibility push(default)
+void foo22();
+#pragma GCC visibility push(hidden)
+void foo23();
+#pragma GCC visibility push(default)
+void foo24();
+#pragma GCC visibility push(hidden)
+void foo25();
+#pragma GCC visibility push(default)
+void foo26();
+#pragma GCC visibility push(hidden)
+void foo27();
+#pragma GCC visibility push(default)
+void foo28();
+#pragma GCC visibility push(hidden)
+void foo29();
+#pragma GCC visibility pop
+void foo30();
+#pragma GCC visibility pop
+void foo31();
+#pragma GCC visibility pop
+void foo32();
+#pragma GCC visibility pop
+void foo33();
+#pragma GCC visibility pop
+void foo34();
+#pragma GCC visibility pop
+void foo35();
+#pragma GCC visibility pop
+void foo36();
+#pragma GCC visibility pop
+void foo37();
+#pragma GCC visibility pop
+void foo38();
+#pragma GCC visibility pop
+void foo39();
+#pragma GCC visibility pop
+void foo40();
+#pragma GCC visibility pop
+void foo41();
+#pragma GCC visibility pop
+void foo42();
+#pragma GCC visibility pop
+void foo43();
+#pragma GCC visibility pop
+void foo44();
+#pragma GCC visibility pop
+void foo45();
+#pragma GCC visibility pop
+void foo46();
+#pragma GCC visibility pop
+void foo47();
+#pragma GCC visibility pop
+void foo48();
+#pragma GCC visibility pop
+void foo49();
+#pragma GCC visibility pop
+void foo50();
+#pragma GCC visibility pop
+void foo51();
+#pragma GCC visibility pop
+void foo52();
+#pragma GCC visibility pop
+void foo53();
+#pragma GCC visibility pop
+void foo54();
+#pragma GCC visibility pop
+void foo55();
+#pragma GCC visibility pop
+void foo56();
+#pragma GCC visibility pop
+void foo57();
+#pragma GCC visibility pop
+void foo58();
+#pragma GCC visibility push (hidden)
+void foo59();
+#pragma GCC visibility pop
+#pragma GCC visibility pop
+
+#define D(N) \
+void foo##N##0() { } \
+void foo##N##1() { } \
+void foo##N##2() { } \
+void foo##N##3() { } \
+void foo##N##4() { } \
+void foo##N##5() { } \
+void foo##N##6() { } \
+void foo##N##7() { } \
+void foo##N##8() { } \
+void foo##N##9() { }
+D(0)
+D(1)
+D(2)
+D(3)
+D(4)
+D(5)
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-10.c
new file mode 100644
index 000000000..47dff47c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-10.c
@@ -0,0 +1,7 @@
+/* ICE with VLA in nested parameter declaration: should be treated
+ like [*] instead of the size being expanded. Bug 28504 from Volker
+ Reichelt <reichelt@gcc.gnu.org>. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void foo(void (*p)(int n, int x[n])) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-11.c
new file mode 100644
index 000000000..9c23e860a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-11.c
@@ -0,0 +1,13 @@
+/* Further tests of [*] being rejected other that in declarations, as
+ per the consensus in DR#341 that the second example there should be
+ invalid (but warnings because the final wording appears to allow
+ these cases). */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+void foo11a(int x[sizeof(int *(*)[*])]); /* { dg-warning "not in a declaration" } */
+void foo11b(__SIZE_TYPE__ x, int y[(__UINTPTR_TYPE__)(int (*)[*])x]); /* { dg-warning "not in a declaration" } */
+void foo11c(struct s { int (*x)[*]; } *y); /* { dg-error "a member of a structure or union cannot have a variably modified type" "variably modified" } */
+/* { dg-warning "'struct s' declared inside parameter list" "struct decl" { target *-*-* } 11 } */
+/* { dg-warning "its scope is only this definition or declaration" "struct scope" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-12.c
new file mode 100644
index 000000000..604ea88dc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-12.c
@@ -0,0 +1,50 @@
+/* Test for typeof evaluation: should be at the appropriate point in
+ the containing expression rather than just adding a statement. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+extern void exit (int);
+extern void abort (void);
+
+void *p;
+
+void
+f1 (void)
+{
+ int i = 0, j = -1, k = -1;
+ /* typeof applied to expression with cast. */
+ (j = ++i), (void)(typeof ((int (*)[(k = ++i)])p))p;
+ if (j != 1 || k != 2 || i != 2)
+ abort ();
+}
+
+void
+f2 (void)
+{
+ int i = 0, j = -1, k = -1;
+ /* typeof applied to type. */
+ (j = ++i), (void)(typeof (int (*)[(k = ++i)]))p;
+ if (j != 1 || k != 2 || i != 2)
+ abort ();
+}
+
+void
+f3 (void)
+{
+ int i = 0, j = -1, k = -1;
+ void *q;
+ /* typeof applied to expression with cast that is used. */
+ (j = ++i), (void)((typeof (1 + (int (*)[(k = ++i)])p))p);
+ if (j != 1 || k != 2 || i != 2)
+ abort ();
+}
+
+int
+main (void)
+{
+ f1 ();
+ f2 ();
+ f3 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-13.c
new file mode 100644
index 000000000..70b63059d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-13.c
@@ -0,0 +1,99 @@
+/* Test for VLA size evaluation; see PR 35198. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+extern void exit (int);
+extern void abort (void);
+
+int i;
+void *p;
+
+void
+f1 (void *x, int j)
+{
+ p = (int (*)[++i])x;
+ if (i != j)
+ abort ();
+}
+
+void
+f1c (void *x, int j)
+{
+ p = (int (*)[++i]){x};
+ if (i != j)
+ abort ();
+}
+
+void
+f2 (void *x, int j)
+{
+ x = (void *)(int (*)[++i])p;
+ if (i != j)
+ abort ();
+}
+
+void
+f2c (void *x, int j)
+{
+ x = (void *)(int (*)[++i]){p};
+ if (i != j)
+ abort ();
+}
+
+void
+f3 (void *x, int j)
+{
+ (void)(int (*)[++i])p;
+ if (i != j)
+ abort ();
+}
+
+void
+f3c (void *x, int j)
+{
+ (void)(int (*)[++i]){p};
+ if (i != j)
+ abort ();
+}
+
+void
+f4 (void *x, int j)
+{
+ (int (*)[++i])p;
+ (int (*)[++i])p;
+ if (i != j)
+ abort ();
+}
+
+void
+f4c (void *x, int j)
+{
+ (int (*)[++i]){p};
+ (int (*)[++i]){p};
+ if (i != j)
+ abort ();
+}
+
+void
+f5c (void *x, int j, int k)
+{
+ (++i, f3c (x, j), (int (*)[++i]){p});
+ if (i != k)
+ abort ();
+}
+
+int
+main (void)
+{
+ f1 (p, 1);
+ f2 (p, 2);
+ f3 (p, 3);
+ f4 (p, 5);
+ f1c (p, 6);
+ f2c (p, 7);
+ f3c (p, 8);
+ f4c (p, 10);
+ f5c (p, 12, 13);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-14.c
new file mode 100644
index 000000000..3dbb11ed1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-14.c
@@ -0,0 +1,33 @@
+/* Test for VLA size evaluation in va_arg. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+#include <stdarg.h>
+
+extern void exit (int);
+extern void abort (void);
+
+int a[10];
+int i = 9;
+
+void
+f (int n, ...)
+{
+ va_list ap;
+ void *p;
+ va_start (ap, n);
+ p = va_arg (ap, typeof (int (*)[++i]));
+ if (p != a)
+ abort ();
+ if (i != n)
+ abort ();
+ va_end (ap);
+}
+
+int
+main (void)
+{
+ f (10, &a);
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-15.c
new file mode 100644
index 000000000..800163bc1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-15.c
@@ -0,0 +1,27 @@
+/* Test for VLA size evaluation in sizeof typeof. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+#include <stdarg.h>
+
+extern void exit (int);
+extern void abort (void);
+
+char a[1];
+
+void
+f1 (void)
+{
+ int i = 0;
+ int j = sizeof (typeof (*(++i, (char (*)[i])a)));
+ if (i != 1 || j != 1)
+ abort ();
+}
+
+int
+main (void)
+{
+ f1 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-16.c
new file mode 100644
index 000000000..05e751af7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-16.c
@@ -0,0 +1,70 @@
+/* Test for modifying and taking addresses of compound literals whose
+ variably modified types involve typeof. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+#include <stdarg.h>
+
+extern void exit (int);
+extern void abort (void);
+
+int a[1];
+
+void
+f1 (void)
+{
+ int i = 0;
+ int (**p)[1] = &(typeof (++i, (int (*)[i])a)){&a};
+ if (*p != &a)
+ abort ();
+ if (i != 1)
+ abort ();
+}
+
+void
+f2 (void)
+{
+ int i = 0;
+ (typeof (++i, (int (*)[i])a)){&a} = 0;
+ if (i != 1)
+ abort ();
+}
+
+void
+f3 (void)
+{
+ int i = 0;
+ (typeof (++i, (int (*)[i])a)){&a} += 1;
+ if (i != 1)
+ abort ();
+}
+
+void
+f4 (void)
+{
+ int i = 0;
+ --(typeof (++i, (int (*)[i])a)){&a + 1};
+ if (i != 1)
+ abort ();
+}
+
+void
+f5 (void)
+{
+ int i = 0;
+ (typeof (++i, (int (*)[i])a)){&a}++;
+ if (i != 1)
+ abort ();
+}
+
+int
+main (void)
+{
+ f1 ();
+ f2 ();
+ f3 ();
+ f4 ();
+ f5 ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-17.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-17.c
new file mode 100644
index 000000000..07d393004
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-17.c
@@ -0,0 +1,9 @@
+/* Test diagnostics for VLA whose size folds to an integer constant at
+ file scope. PR 39605. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#define FIRST ((void*)0x80)
+#define LAST ((void*)0x86)
+
+static int b[LAST-FIRST]; /* { dg-warning "variably modified 'b' at file scope" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-18.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-18.c
new file mode 100644
index 000000000..c60069cfd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-18.c
@@ -0,0 +1,9 @@
+/* Test diagnostics for VLA whose size folds to an integer constant at
+ file scope; the diagnostic should be a pedwarn. PR 39605. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+#define FIRST ((char*)0x80)
+#define LAST ((char*)0x86)
+
+static int b[LAST-FIRST]; /* { dg-error "variably modified 'b' at file scope" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-19.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-19.c
new file mode 100644
index 000000000..83093c929
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-19.c
@@ -0,0 +1,32 @@
+/* Test diagnostics for variably modified function return types. PR
+ 39564. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+int a;
+
+void
+f1 (void)
+{
+ typedef int T[a];
+ extern T *g1 (void); /* { dg-error "non-nested function with variably modified type" } */
+}
+
+void
+f2 (void)
+{
+ extern int (*g2 (void))[a]; /* { dg-error "non-nested function with variably modified type" } */
+}
+
+void
+f3 (void)
+{
+ typedef int T[a];
+ T *g3 (void); /* { dg-error "non-nested function with variably modified type" } */
+}
+
+void
+f4 (void)
+{
+ int (*g4 (void))[a]; /* { dg-error "non-nested function with variably modified type" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-2.c
new file mode 100644
index 000000000..72c646590
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-2.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* These are crash tests related to PR middle-end/6994; see also
+ g++.dg/ext/vla1.C. Note that at present A and C cannot be inlined. */
+
+static inline void A (int i)
+{
+ struct S { int ar[1][i]; } s;
+
+ s.ar[0][0] = 0;
+}
+
+void B(void)
+{
+ A(23);
+}
+
+static inline void C (int i)
+{
+ union U { int ar[1][i]; } u;
+
+ u.ar[0][0] = 0;
+}
+
+void D(void)
+{
+ C(23);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-20.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-20.c
new file mode 100644
index 000000000..04d9ee753
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-20.c
@@ -0,0 +1,12 @@
+/* Test use of sizeof with [*] in type name: should not refer to
+ zero-size array. PR 39582. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+void foo11d(int x[sizeof(int *[*])]); /* { dg-warning "not in a declaration" } */
+
+/* Although the size is not constant, it may nevertheless appear in a
+ constant expression if not evaluated. */
+
+void foo11e(int x[1 ? 0 : sizeof(int *[*])]); /* { dg-warning "not in a declaration" } */
+/* { dg-error "zero-size array" "correct zero size" { target *-*-* } 11 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-21.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-21.c
new file mode 100644
index 000000000..a39ae0b42
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-21.c
@@ -0,0 +1,7 @@
+/* Type names for VLAs should be allowed outside functions if the size
+ is not evaluated. PR 39581. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+int a;
+int b = sizeof (int (*)[a]);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-22.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-22.c
new file mode 100644
index 000000000..f924650af
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-22.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void bar (int *);
+
+static inline __attribute__((always_inline))
+int
+foo (int i)
+{
+ struct S {
+ int ar[1][i];
+ } s;
+
+ s.ar[0][0] = 0;
+ bar (&s.ar[0][0]);
+}
+
+void
+baz (int i)
+{
+ foo (i + 2);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-23.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-23.c
new file mode 100644
index 000000000..47be41233
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-23.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/50615 */
+/* Testcase by Zdenek Sojka <zsojka@seznam.cz> */
+
+/* { dg-do compile } */
+/* { dg-options "-O --param max-cse-insns=1" } */
+
+int
+foo (int a)
+{
+ if (!a)
+ return 1;
+
+ {
+ int s[a];
+ return 0;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-3.c
new file mode 100644
index 000000000..619c0422a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+/* This used to crash as we did not preserve the correct type
+ for __SIZE_TYPE__. See PR22439. */
+
+char foo(__SIZE_TYPE__ n)
+{
+ char c[1][n];
+ return c[0][0];
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-4.c
new file mode 100644
index 000000000..7ffbfb31b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-4.c
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+/* PR c/18740 */
+
+static int i;
+
+int foo(int n)
+{
+ int (*t)[n];
+ i = 0;
+ int j = 0;
+ char b[1][n+3]; /* Variable length array. */
+ int d[3][n]; /* Variable length array. */
+ sizeof (b[i++ + sizeof(j++)]); /* Outer sizeof is evaluated for vla, but not the inner one. */
+ if (i != 1 || j != 0)
+ return 1;
+ __typeof__(b[i++]) c1; /* typeof is evauluated when given a vm */
+ if (i != 2)
+ return 1;
+ __typeof__(t + (i++,0)) c2; /* typeof is evauluated when given a vm */
+ if (i != 3)
+ return 1;
+ __typeof__(i + (i++,0)) c3; /* typeof is not evauluated when not given a vm */
+ if (i != 3)
+ return 1;
+ sizeof (d[i++]); /* sizeof is evaluated for vla. */
+ if (i != 4)
+ return 1;
+ __alignof__(__typeof__(t + (i++,0))); /* typeof is not evauluated when given a vm inside alignof*/
+ if (i != 4)
+ return 1;
+ sizeof(__typeof__(t + (i++,0))); /* typeof is not evauluated when given a vm inside sizeof*/
+ if (i != 4)
+ return 1;
+ return 0;
+}
+
+int foo6(int a, int b[a][a], int (*c)[sizeof(*b)]) {
+ return sizeof (*c);
+}
+
+int main() {
+ int b[10][10];
+ int (*c)[sizeof(int)*10];
+ if (foo6(10, b, c) != 10*sizeof(int)*sizeof(int))
+ return 1;
+ return foo(10);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-5.c
new file mode 100644
index 000000000..f5256c4c4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-5.c
@@ -0,0 +1,24 @@
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+void foo1(int (*o)(int p[*])) { }
+
+void foo2(int o[*]);
+void foo3(int o[4][*]);
+
+void foo4(int j, int a[j]);
+void foo4(int, int a[*]);
+void foo4(int, int a[]);
+void foo4(int j, int a[j]) {
+}
+
+int foo5(int a, int b[*][*], int c[static sizeof(*b)]);
+int foo5(int a, int b[10][10], int c[400]) {
+ return sizeof (c);
+}
+
+int foo6(int a, int b[*][*], int c[static sizeof(*b)]);
+int foo6(int a, int b[a][a], int c[sizeof(*b)]) {
+ return sizeof (c);
+}
+
+void foo7(__typeof__ (int (*)(int o[*])) i);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-6.c
new file mode 100644
index 000000000..a7f5f0515
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-6.c
@@ -0,0 +1,29 @@
+/* { dg-options "-std=c99 -pedantic-errors" } */
+
+int a[*]; /* { dg-error "not allowed in other than function prototype scope" } */
+void foo1() { int a[*]; } /* { dg-error "not allowed in other than function prototype scope" } */
+void foo2() { int a[*]; } /* { dg-error "not allowed in other than function prototype scope" } */
+int foo3(int i)[*]; /* { dg-error "not allowed in other than function prototype scope" } */
+void foo4(int o[*][4]) { } /* { dg-error "not allowed in other than function prototype scope" } */
+void foo5(int o[4][*]) { } /* { dg-error "not allowed in other than function prototype scope" } */
+
+/* [*] can't be used in a type that's not a declaration (maybe, the
+ final wording for DR#341 would allow it although the first
+ discussed intent would not). */
+void foo11(int x[sizeof(int (*)[*])]); /* { dg-warning "not in a declaration" } */
+/* This case is allowed per DR#341. */
+void foo12(int [*]);
+
+extern int n;
+int B[100];
+void foo10(int m) {
+ typedef int (*vla)[m];
+ struct tag {
+ vla x; /* { dg-error "a member of a structure or union cannot have a variably modified type" } */
+ /* PR c/7948 */
+ int (*y)[n]; /* { dg-error "a member of a structure or union cannot have a variably modified type" } */
+ int z[n]; /* { dg-error "a member of a structure or union cannot have a variably modified type" } */
+ };
+ /* PR c/25802 */
+ extern int (*r)[m]; /* { dg-error "variably modified type must have no linkage" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-7.c
new file mode 100644
index 000000000..e8c8cd455
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-7.c
@@ -0,0 +1,3 @@
+/* { dg-options "-std=c99" } */
+
+int (*foo)(int (*a)[*]);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-8.c
new file mode 100644
index 000000000..fea2337cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-8.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors" } */
+/* Radar 4336222 */
+
+int a;
+struct s { void (*f)(int (*)[a]); };
+
+static int i;
+static int new_i() { i++; return i; }
+static int bar1(int a[new_i()][new_i()]);
+
+void foo(int n) {
+ extern void bar(int i[n][n]); /* Since this isn't a VM type ensure we can have linkage. */
+ extern int bar1(int a[new_i()][new_i()]); /* Since this isn't a VM type ensure we can have linkage. */
+}
+
+void foo1(int n) {
+ goto A;
+ void bar(int i[n][n]); /* Not a VM type, as VM arguments don't matter. */
+ int bar1(int a[new_i()][new_i()]); /* Not a VM type, as VM arguments don't matter. */
+ A:
+ ;
+}
+
+void foo2(int n) {
+ goto A; /* { dg-error "jump into scope of identifier with variably modified type" } */
+ int (*(*bar2)(void))[n];
+ A:
+ ;
+}
+
+/* Match extra informative notes. */
+/* { dg-message "note: label '\[^\n'\]*' defined here" "defined" { target *-*-* } 0 } */
+/* { dg-message "note: '\[^\n'\]*' declared here" "declared" { target *-*-* } 0 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-9.c
new file mode 100644
index 000000000..506a1a2eb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-9.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic-errors -W -Wall" } */
+/* PR c/28280 */
+
+void f(__SIZE_TYPE__ d)
+{
+ typedef int t[d];
+ t *g = (__typeof (g)) d;
+ (void) g;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-1.c
new file mode 100644
index 000000000..316bf98bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-1.c
@@ -0,0 +1,15 @@
+/* Test for tree-checking error when initializing a variable-length array
+ (not allowed): constructor_max_index needs to be an INTEGER_CST. */
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int a;
+
+void
+foo (void)
+{
+ int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */
+ /* { dg-warning "excess elements in array initializer" "excess" { target *-*-* } 12 } */
+ /* { dg-warning "near initialization" "near" { target *-*-* } 12 } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-2.c
new file mode 100644
index 000000000..e13d97cd1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-2.c
@@ -0,0 +1,10 @@
+/* Arrays of unknown size with element type a VLA type should not be
+ initialized (C99 isn't clear about whether such arrays are VLAs,
+ but this is the only reasonable interpretation). Bug 16409, first
+ testcase. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const int i = 1;
+void foo() { char a[][i] = {""}; } /* { dg-error "variable-sized object may not be initialized" } */
+/* { dg-error "array size missing in 'a'" "extra error" { target *-*-* } 9 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-3.c
new file mode 100644
index 000000000..710bcc038
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-3.c
@@ -0,0 +1,9 @@
+/* Arrays of unknown size with element type a VLA type should not be
+ initialized (C99 isn't clear about whether such arrays are VLAs,
+ but this is the only reasonable interpretation). Bug 16409, second
+ testcase. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void foo(int i) { char a[][i] = {""}; } /* { dg-error "variable-sized object may not be initialized" } */
+/* { dg-error "array size missing in 'a'" "extra error" { target *-*-* } 8 } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-4.c
new file mode 100644
index 000000000..06351d04e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-4.c
@@ -0,0 +1,7 @@
+/* Test for ICE on VLA compound literal. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const int i = 1;
+void foo() { char *p = (char [i]){ "" }; } /* { dg-error "compound literal has variable size" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-5.c
new file mode 100644
index 000000000..aa9f4910a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vla-init-5.c
@@ -0,0 +1,7 @@
+/* Test for ICE on incomplete-array-of-VLA compound literal. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const int i = 1;
+void foo() { void *p = (char [][i]){ "" }; } /* { dg-error "compound literal has variable size" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-01.c
new file mode 100644
index 000000000..8cdacb640
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-01.c
@@ -0,0 +1,11 @@
+#include "harness.h"
+
+vector unsigned char a;
+
+static void test()
+{
+ check(sizeof(a) == 16, "sizeof(a)");
+ check(((long)&a & 15) == 0, "alignof(a)");
+ check((long)&a != 0, "&a");
+ check(vec_all_eq(a,((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})), "value(a)");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-02.c
new file mode 100644
index 000000000..2f9aca5da
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-02.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector unsigned char u8;
+vector signed char s8;
+vector bool char b8;
+vector unsigned short u16;
+vector signed short s16;
+vector bool short b16;
+vector unsigned int u32;
+vector signed int s32;
+vector bool int b32;
+vector float f32;
+vector pixel p16;
+
+vector unsigned char const u8c;
+vector signed char const s8c;
+vector bool char const b8c;
+vector unsigned short const u16c;
+vector signed short const s16c;
+vector bool short const b16c;
+vector unsigned int const u32c;
+vector signed int const s32c;
+vector bool int const b32c;
+vector float const f32c;
+vector pixel const p16c;
+
+vector unsigned char volatile u8v;
+vector signed char volatile s8v;
+vector bool char volatile b8v;
+vector unsigned short volatile u16v;
+vector signed short volatile s16v;
+vector bool short volatile b16v;
+vector unsigned int volatile u32v;
+vector signed int volatile s32v;
+vector bool int volatile b32v;
+vector float volatile f32v;
+vector pixel volatile p16v;
+
+const vector unsigned char u8c_;
+const vector signed char s8c_;
+const vector bool char b8c_;
+const vector unsigned short u16c_;
+const vector signed short s16c_;
+const vector bool short b16c_;
+const vector unsigned int u32c_;
+const vector signed int s32c_;
+const vector bool int b32c_;
+const vector float f32c_;
+const vector pixel p16c_;
+
+volatile vector unsigned char u8v_;
+volatile vector signed char s8v_;
+volatile vector bool char b8v_;
+volatile vector unsigned short u16v_;
+volatile vector signed short s16v_;
+volatile vector bool short b16v_;
+volatile vector unsigned int u32v_;
+volatile vector signed int s32v_;
+volatile vector bool int b32v_;
+volatile vector float f32v_;
+volatile vector pixel p16v_;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-03.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-03.c
new file mode 100644
index 000000000..2f8f816ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-03.c
@@ -0,0 +1,64 @@
+#include <altivec.h>
+int main()
+{
+ vector unsigned char u8;
+ vector signed char s8;
+ vector bool char b8;
+ vector unsigned short u16;
+ vector signed short s16;
+ vector bool short b16;
+ vector unsigned int u32;
+ vector signed int s32;
+ vector bool int b32;
+ vector float f32;
+ vector pixel p16;
+
+ vector unsigned char const u8c;
+ vector signed char const s8c;
+ vector bool char const b8c;
+ vector unsigned short const u16c;
+ vector signed short const s16c;
+ vector bool short const b16c;
+ vector unsigned int const u32c;
+ vector signed int const s32c;
+ vector bool int const b32c;
+ vector float const f32c;
+ vector pixel const p16c;
+
+ vector unsigned char volatile u8v;
+ vector signed char volatile s8v;
+ vector bool char volatile b8v;
+ vector unsigned short volatile u16v;
+ vector signed short volatile s16v;
+ vector bool short volatile b16v;
+ vector unsigned int volatile u32v;
+ vector signed int volatile s32v;
+ vector bool int volatile b32v;
+ vector float volatile f32v;
+ vector pixel volatile p16v;
+
+ const vector unsigned char u8c_;
+ const vector signed char s8c_;
+ const vector bool char b8c_;
+ const vector unsigned short u16c_;
+ const vector signed short s16c_;
+ const vector bool short b16c_;
+ const vector unsigned int u32c_;
+ const vector signed int s32c_;
+ const vector bool int b32c_;
+ const vector float f32c_;
+ const vector pixel p16c_;
+
+ volatile vector unsigned char u8v_;
+ volatile vector signed char s8v_;
+ volatile vector bool char b8v_;
+ volatile vector unsigned short u16v_;
+ volatile vector signed short s16v_;
+ volatile vector bool short b16v_;
+ volatile vector unsigned int u32v_;
+ volatile vector signed int s32v_;
+ volatile vector bool int b32v_;
+ volatile vector float f32v_;
+ volatile vector pixel p16v_;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-04.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-04.c
new file mode 100644
index 000000000..5807ea335
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-04.c
@@ -0,0 +1,7 @@
+#include <altivec.h>
+int main()
+{
+ vector unsigned char a,b;
+ b = (vector unsigned char)a;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-05.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-05.c
new file mode 100644
index 000000000..63eb10b7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-05.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector float _0 ;
+vector pixel _1 ;
+vector bool int _2 ;
+vector unsigned int _3 ;
+vector signed int _4 ;
+vector bool short _5 ;
+vector unsigned short _6 ;
+vector signed short _7 ;
+vector bool char _8 ;
+vector unsigned char _9 ;
+vector signed char _10 ;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-06-ansi.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-06-ansi.c
new file mode 100644
index 000000000..780a4e6bc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-06-ansi.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-ansi -maltivec" } */
+
+#include <altivec.h>
+vector char bool _4 ;
+vector char unsigned _31 ;
+vector char signed _59 ;
+/* bool is permitted in the predefine method, as it is expanded
+ unconditionally to int. */
+bool _84 ;
+vector pixel _89 ;
+vector int bool _95 ;
+vector short bool _102 ;
+vector unsigned int _122 ;
+vector unsigned short _129 ;
+vector signed int _150 ;
+vector signed short _157 ;
+vector int bool _179 ;
+vector int short bool _186 ;
+vector unsigned int _206 ;
+vector int unsigned short _213 ;
+vector signed int _234 ;
+vector int signed short _241 ;
+vector float _339 ;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-06.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-06.c
new file mode 100644
index 000000000..d25164c31
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-06.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector char bool _4 ;
+vector char unsigned _31 ;
+vector char signed _59 ;
+vector pixel _89 ;
+vector int bool _95 ;
+vector short bool _102 ;
+vector unsigned int _122 ;
+vector unsigned short _129 ;
+vector signed int _150 ;
+vector signed short _157 ;
+vector int bool _179 ;
+vector int short bool _186 ;
+vector unsigned int _206 ;
+vector int unsigned short _213 ;
+vector signed int _234 ;
+vector int signed short _241 ;
+vector float _339 ;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-07-ansi.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-07-ansi.c
new file mode 100644
index 000000000..cfc98639b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-07-ansi.c
@@ -0,0 +1,59 @@
+/* { dg-do compile } */
+/* { dg-options "-ansi -maltivec" } */
+
+#include <altivec.h>
+vector char bool _0 ;
+vector bool char _8 ;
+vector char unsigned _56 ;
+vector unsigned char _64 ;
+vector char signed _112 ;
+vector signed char _120 ;
+/* bool is permitted in the predefine method, as it is expanded
+ unconditionally to int. */
+bool _168 ;
+vector pixel _170 ;
+vector int bool _178 ;
+vector bool int _186 ;
+vector short bool _234 ;
+vector bool short _242 ;
+vector unsigned int _290 ;
+vector int unsigned _298 ;
+vector unsigned short _346 ;
+vector short unsigned _354 ;
+vector signed int _402 ;
+vector int signed _410 ;
+vector signed short _458 ;
+vector short signed _466 ;
+vector int bool _514 ;
+vector int bool _544 ;
+vector int bool _559 ;
+vector bool int _589 ;
+vector int short bool _874 ;
+vector int bool short _889 ;
+vector short int bool _904 ;
+vector short bool int _919 ;
+vector bool int short _934 ;
+vector bool short int _949 ;
+vector unsigned int _1234 ;
+vector int unsigned _1249 ;
+vector unsigned int _1279 ;
+vector int unsigned _1294 ;
+vector unsigned int _1309 ;
+vector int unsigned short _1594 ;
+vector int short unsigned _1609 ;
+vector unsigned int short _1624 ;
+vector unsigned short int _1639 ;
+vector short int unsigned _1654 ;
+vector short unsigned int _1669 ;
+vector signed int _1954 ;
+vector int signed _1969 ;
+vector signed int _1999 ;
+vector int signed _2014 ;
+vector signed int _2029 ;
+vector int signed short _2314 ;
+vector int short signed _2329 ;
+vector signed int short _2344 ;
+vector signed short int _2359 ;
+vector short int signed _2374 ;
+vector short signed int _2389 ;
+vector float _2674 ;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-07.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-07.c
new file mode 100644
index 000000000..44bf4029f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1b-07.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector char bool _0 ;
+vector bool char _8 ;
+vector char unsigned _56 ;
+vector unsigned char _64 ;
+vector char signed _112 ;
+vector signed char _120 ;
+vector pixel _170 ;
+vector int bool _178 ;
+vector bool int _186 ;
+vector short bool _234 ;
+vector bool short _242 ;
+vector unsigned int _290 ;
+vector int unsigned _298 ;
+vector unsigned short _346 ;
+vector short unsigned _354 ;
+vector signed int _402 ;
+vector int signed _410 ;
+vector signed short _458 ;
+vector short signed _466 ;
+vector int bool _514 ;
+vector int bool _544 ;
+vector int bool _559 ;
+vector bool int _589 ;
+vector int short bool _874 ;
+vector int bool short _889 ;
+vector short int bool _904 ;
+vector short bool int _919 ;
+vector bool int short _934 ;
+vector bool short int _949 ;
+vector unsigned int _1234 ;
+vector int unsigned _1249 ;
+vector unsigned int _1279 ;
+vector int unsigned _1294 ;
+vector unsigned int _1309 ;
+vector int unsigned short _1594 ;
+vector int short unsigned _1609 ;
+vector unsigned int short _1624 ;
+vector unsigned short int _1639 ;
+vector short int unsigned _1654 ;
+vector short unsigned int _1669 ;
+vector signed int _1954 ;
+vector int signed _1969 ;
+vector signed int _1999 ;
+vector int signed _2014 ;
+vector signed int _2029 ;
+vector int signed short _2314 ;
+vector int short signed _2329 ;
+vector signed int short _2344 ;
+vector signed short int _2359 ;
+vector short int signed _2374 ;
+vector short signed int _2389 ;
+vector float _2674 ;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1c-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1c-01.c
new file mode 100644
index 000000000..974bda19e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1c-01.c
@@ -0,0 +1,56 @@
+#include <stddef.h>
+#include "harness.h"
+
+/* Declare vector types. */
+vector unsigned char u8;
+vector signed char s8;
+vector bool char b8;
+vector unsigned short u16;
+vector signed short s16;
+vector bool short b16;
+vector unsigned int u32;
+vector signed int s32;
+vector bool int b32;
+vector float f32;
+vector pixel p16;
+
+vector unsigned char *u8c = &u8;
+vector signed char *s8c = &s8;
+vector bool char *b8c = &b8;
+vector unsigned short *u16c = &u16;
+vector signed short *s16c = &s16;
+vector bool short *b16c = &b16;
+vector unsigned int *u32c = &u32;
+vector signed int *s32c = &s32;
+vector bool int *b32c = &b32;
+vector float *f32c = &f32;
+vector pixel *p16c = &p16;
+
+static void test()
+{
+ check(((ptrdiff_t)u8c & 15) == 0, "alignof(u8)");
+ check(((ptrdiff_t)u8c & 15) == 0, "alignof(u8)");
+ check(((ptrdiff_t)s8c & 15) == 0, "alignof(s8)");
+ check(((ptrdiff_t)b8c & 15) == 0, "alignof(b8)");
+ check(((ptrdiff_t)u16c & 15) == 0, "alignof(u16)");
+ check(((ptrdiff_t)s16c & 15) == 0, "alignof(s16)");
+ check(((ptrdiff_t)b16c & 15) == 0, "alignof(b16)");
+ check(((ptrdiff_t)u32c & 15) == 0, "alignof(u32)");
+ check(((ptrdiff_t)s32c & 15) == 0, "alignof(s32)");
+ check(((ptrdiff_t)b32c & 15) == 0, "alignof(b32)");
+ check(((ptrdiff_t)f32c & 15) == 0, "alignof(f32)");
+ check(((ptrdiff_t)p16c & 15) == 0, "alignof(p16)");
+
+ check((ptrdiff_t)u8c == (ptrdiff_t)&u8, "u8c == &u8");
+ check((ptrdiff_t)u8c == (ptrdiff_t)&u8, "u8c == &u8");
+ check((ptrdiff_t)s8c == (ptrdiff_t)&s8, "s8c == &s8");
+ check((ptrdiff_t)b8c == (ptrdiff_t)&b8, "b8c == &b8");
+ check((ptrdiff_t)u16c == (ptrdiff_t)&u16, "u16c == &u16");
+ check((ptrdiff_t)s16c == (ptrdiff_t)&s16, "s16c == &s16");
+ check((ptrdiff_t)b16c == (ptrdiff_t)&b16, "b16c == &b16");
+ check((ptrdiff_t)u32c == (ptrdiff_t)&u32, "u32c == &u32");
+ check((ptrdiff_t)s32c == (ptrdiff_t)&s32, "s32c == &s32");
+ check((ptrdiff_t)b32c == (ptrdiff_t)&b32, "b32c == &b32");
+ check((ptrdiff_t)f32c == (ptrdiff_t)&f32, "f32c == &f32");
+ check((ptrdiff_t)p16c == (ptrdiff_t)&p16, "p16c == &p16");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1c-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1c-02.c
new file mode 100644
index 000000000..be6adf647
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/1c-02.c
@@ -0,0 +1,34 @@
+#include "harness.h"
+
+/* Vector types used in aggregates. */
+struct { char b; vector unsigned char a; char e; } u8;
+struct { char b; vector signed char a; char e; } s8;
+struct { char b; vector bool char a; char e; } b8;
+struct { char b; vector unsigned short a; char e; } u16;
+struct { char b; vector signed short a; char e; } s16;
+struct { char b; vector bool short a; char e; } b16;
+struct { char b; vector unsigned int a; char e; } u32;
+struct { char b; vector signed int a; char e; } s32;
+struct { char b; vector bool int a; char e; } b32;
+struct { char b; vector float a; char e; } f32;
+struct { char b; vector pixel a; char e; } p16;
+
+union { char b; vector unsigned char a; } u8u;
+union { char b; vector signed char a; } s8u;
+union { char b; vector bool char a; } b8u;
+union { char b; vector unsigned short a; } u16u;
+union { char b; vector signed short a; } s16u;
+union { char b; vector bool short a; } b16u;
+union { char b; vector unsigned int a; } u32u;
+union { char b; vector signed int a; } s32u;
+union { char b; vector bool int a; } b32u;
+union { char b; vector float a; } f32u;
+union { char b; vector pixel a; } p16u;
+
+static void test()
+{
+ check((long)&u8.a - (long)&u8 == 16, "u8.a");
+ check((long)&u8.e - (long)&u8 == 32, "u8.e");
+ check(sizeof(u8) == 48, "sizeof(u8)");
+ check(sizeof(u8u) == 16, "sizeof(u8u)");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01.c
new file mode 100644
index 000000000..86e514d4a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01.c
@@ -0,0 +1,16 @@
+#include "harness.h"
+/* Simple use of a non-overloaded generic vector intrinsic. */
+
+static vector unsigned int
+f(vector unsigned int a, vector unsigned int b)
+{
+ return vec_addc(a,b);
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector unsigned int){1,1,3,2}),
+ ((vector unsigned int){-1,-2,3,-4})),
+ ((vector unsigned int){1,0,0,0})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01a.c
new file mode 100644
index 000000000..7619d1185
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01a.c
@@ -0,0 +1,17 @@
+#include "harness.h"
+
+/* Simple use of a non-overloaded specific vector intrinsic. */
+
+vector unsigned int
+f(vector unsigned int a, vector unsigned int b)
+{
+ return vec_vaddcuw(a,b);
+}
+
+void test()
+{
+ check(vec_all_eq(f(((vector unsigned int){1,1,3,2}),
+ ((vector unsigned int){-1,-2,3,-4})),
+ ((vector unsigned int){1,0,0,0})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01m.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01m.c
new file mode 100644
index 000000000..d57287007
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-01m.c
@@ -0,0 +1,17 @@
+#include "harness.h"
+
+/* Simple use of a non-overloaded specific vector intrinsic. */
+
+vector unsigned int
+f(vector unsigned int a, vector unsigned int b)
+{
+ return vec_vaddcuw(a,b);
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector unsigned int){1,1,3,2}),
+ ((vector unsigned int){-1,-2,3,-4})),
+ ((vector unsigned int){1,0,0,0})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-03.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-03.c
new file mode 100644
index 000000000..5f46ee6f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-03.c
@@ -0,0 +1,18 @@
+#include "harness.h"
+
+/* Small expression involving non-overloaded generic vector intrinsics. */
+
+vector float
+f(vector float a, vector float b, vector float c)
+{
+ return vec_nmsub(a, vec_re(b), vec_nmsub(b, c, vec_expte(a)));
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){-249.181808, -369.230774, -495.294098, -575.368408})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-03m.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-03m.c
new file mode 100644
index 000000000..68feecee7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-03m.c
@@ -0,0 +1,18 @@
+#include "harness.h"
+
+/* Small expression involving non-overloaded specific vector intrinsics. */
+
+vector float
+f(vector float a, vector float b, vector float c)
+{
+ return vec_nmsub(a, vec_vrefp(b), vec_nmsub(b, c, vec_vexptefp(a)));
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){-249.181808, -369.230774, -495.294098, -575.368408})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-04.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-04.c
new file mode 100644
index 000000000..a04497bed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-04.c
@@ -0,0 +1,22 @@
+#include "harness.h"
+
+/* Small expression involving non-overloaded vector intrinsics. */
+
+vector float
+f(vector float a, vector float b, vector float c)
+{
+ return vec_vmaddfp(a, vec_re(b), vec_vmaxfp(c, vec_expte(a)));
+}
+
+static void test()
+{
+ check(vec_all_gt(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){23.18, 29.23, 32.29, 128.36}))
+ && vec_all_lt(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){23.19, 29.24, 32.30, 128.37})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-04m.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-04m.c
new file mode 100644
index 000000000..b6e273bcc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-04m.c
@@ -0,0 +1,22 @@
+#include "harness.h"
+
+/* Small expression involving non-overloaded specific vector intrinsics. */
+
+vector float
+f(vector float a, vector float b, vector float c)
+{
+ return vec_vmaddfp(a, vec_vrefp(b), vec_vmaxfp(c, vec_vexptefp(a)));
+}
+
+static void test()
+{
+ check(vec_all_gt(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){23.18, 29.23, 32.29, 128.36}))
+ && vec_all_lt(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){23.19, 29.24, 32.30, 128.37})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-05.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-05.c
new file mode 100644
index 000000000..8d6ba5eab
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-05.c
@@ -0,0 +1,26 @@
+#include "harness.h"
+
+/* Small expression involving non-overloaded specific vector intrinsics. */
+
+vector float
+f(vector float a, vector float b, vector float c)
+{
+ vector float q = vec_expte(a);
+ vector float r = vec_vsubfp(c, q);
+ vector float s = vec_re(b);
+ vector float t = vec_nmsub(s, c, r);
+ return t;
+}
+
+static void test()
+{
+ check(vec_all_gt(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){16.90, 18.76, -2.83, -92.95}))
+ && vec_all_lt(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){16.91, 18.77, -2.82, -92.94})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-06.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-06.c
new file mode 100644
index 000000000..6f27b3860
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-06.c
@@ -0,0 +1,15 @@
+#include "harness.h"
+
+vector unsigned int
+f(vector unsigned int a, vector unsigned int b)
+{
+ return vec_addc(vec_addc(a,b),b);
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector unsigned int){2,4,6,8}),
+ ((vector unsigned int){-1,-2,-3,-4})),
+ ((vector unsigned int){1,0,0,0})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-06m.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-06m.c
new file mode 100644
index 000000000..e616f9aef
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-06m.c
@@ -0,0 +1,15 @@
+#include "harness.h"
+
+vector unsigned int
+f(vector unsigned int a, vector unsigned int b)
+{
+ return vec_vaddcuw(vec_vaddcuw(a,b),b);
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector unsigned int){2,4,6,8}),
+ ((vector unsigned int){-1,-2,-3,-4})),
+ ((vector unsigned int){1,0,0,0})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-07.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-07.c
new file mode 100644
index 000000000..197fd23c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3a-07.c
@@ -0,0 +1,16 @@
+#include "harness.h"
+
+static vector unsigned char
+zero()
+{
+ /* MCC allocates a stack slot for and loads an uninitialized local
+ variable. */
+ vector unsigned char a;
+ return vec_sub(a,a);
+}
+
+static void test()
+{
+ static vector unsigned char zerov;
+ check(vec_all_eq(zero(), zerov), "zero");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-01.c
new file mode 100644
index 000000000..e8feec481
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-01.c
@@ -0,0 +1,18 @@
+#include "harness.h"
+
+/* Simple use of a overloaded generic vector intrinsic. */
+
+vector unsigned int
+f(vector unsigned int a, vector unsigned int b)
+{
+ return vec_subs(a,b);
+}
+
+static void test()
+{
+ static vector unsigned int zero;
+ check(vec_all_eq(f(((vector unsigned int){2,4,6,8}),
+ ((vector unsigned int){2,4,6,8})),
+ zero),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-02.c
new file mode 100644
index 000000000..66693e0ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-02.c
@@ -0,0 +1,16 @@
+#include "harness.h"
+
+vector unsigned char
+f(vector unsigned char a, vector unsigned char b)
+{
+ return vec_vsububs(a,b);
+}
+
+static void test()
+{
+ static vector unsigned char zero;
+ check(vec_all_eq(f(((vector unsigned char){2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}),
+ ((vector unsigned char){2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2})),
+ zero),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-10.c
new file mode 100644
index 000000000..5f8fb3adf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-10.c
@@ -0,0 +1,21 @@
+#include "harness.h"
+
+typedef vector unsigned int x;
+
+x f (x a)
+{
+ return vec_addc(a,a);
+}
+
+void g (int b)
+{
+ vec_dst(&b, 3, 3);
+ vec_dst(&b, 1, 1);
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector unsigned int){0x80000000,0x7fffffff,3,4})),
+ ((vector unsigned int){1,0,0,0})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-13.c
new file mode 100644
index 000000000..42c3ca4fa
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-13.c
@@ -0,0 +1,15 @@
+#include "harness.h"
+
+vector signed int
+f(vector float a, vector signed int b)
+{
+ return vec_splat(vec_cts(vec_ctf(vec_ctu(a, 31),0),9),2);
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector float){1,2,3,4}),
+ ((vector signed int){2,4,6,8})),
+ ((vector signed int){2147483647, 2147483647, 2147483647, 2147483647})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-14.c
new file mode 100644
index 000000000..02b2d901e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-14.c
@@ -0,0 +1,29 @@
+#include "harness.h"
+
+static vector bool char x(void);
+static void g(void);
+
+static vector bool char
+f (void)
+{
+ vector bool char a = x();
+ g();
+ return a;
+}
+
+static vector bool char
+x (void)
+{
+ static vector bool char zero;
+ return zero;
+}
+
+static void g ()
+{
+}
+
+static void test()
+{
+ static vector bool char zero;
+ check(vec_all_eq(f(), zero), "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-15.c
new file mode 100644
index 000000000..ec9cf2c5a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3b-15.c
@@ -0,0 +1,19 @@
+#include "harness.h"
+
+vector unsigned char
+f (vector unsigned char a, vector unsigned char b, vector unsigned char c)
+{
+ return vec_perm(a,b,c);
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector unsigned char){0,1,2,3,4,5,6,7,
+ 8,9,10,11,12,13,14,15}),
+ ((vector unsigned char){70,71,72,73,74,75,76,77,
+ 78,79,80,81,82,83,84,85}),
+ ((vector unsigned char){0x1,0x14,0x18,0x10,0x16,0x15,0x19,0x1a,
+ 0x1c,0x1c,0x1c,0x12,0x8,0x1d,0x1b,0xe})),
+ ((vector unsigned char){1,74,78,70,76,75,79,80,82,82,82,72,8,83,81,14})),
+ "f");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-01.c
new file mode 100644
index 000000000..c6da229f4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-01.c
@@ -0,0 +1,86 @@
+#include "harness.h"
+
+vector unsigned char u8;
+vector signed char s8;
+vector bool char b8;
+vector unsigned short u16;
+vector signed short s16;
+vector bool short b16;
+vector unsigned int u32;
+vector signed int s32;
+vector bool int b32;
+vector float f32;
+vector pixel p16;
+
+static void g(void);
+
+static void f(void *p)
+{
+ u8 = vec_ld(16, (unsigned char *)p);
+ u16 = vec_ld(16, (unsigned short*)p);
+ u32 = vec_ld(16, (unsigned int*)p);
+ s8 = vec_ld(16, (signed char *)p);
+ s16 = vec_ld(16, (short*)p);
+ s32 = vec_ld(16, (int*)p);
+ g();
+ u8 = vec_ld(16, (vector unsigned char*)p);
+ s8 = vec_ld(16, (vector signed char*)p);
+ b8 = vec_ld(16, (vector bool char*)p);
+ g();
+ u16 = vec_ld(16, (vector unsigned short*)p);
+ s16 = vec_ld(16, (vector signed short*)p);
+ b16 = vec_ld(16, (vector bool short*)p);
+ g();
+ u32 = vec_ld(16, (vector unsigned int*)p);
+ s32 = vec_ld(16, (vector signed int*)p);
+ b32 = vec_ld(16, (vector bool int*)p);
+ f32 = vec_ld(16, (vector float*)p);
+ p16 = vec_ld(16, (vector pixel*)p);
+ g();
+ u8 = vec_lde(16, (unsigned char *)p);
+ u16 = vec_lde(16, (unsigned short*)p);
+ u32 = vec_lde(16, (unsigned int*)p);
+ s8 = vec_lde(16, (signed char *)p);
+ s16 = vec_lde(16, (short*)p);
+ s32 = vec_lde(16, (int*)p);
+ f32 = vec_ldl(16, (vector float*)p);
+ p16 = vec_ldl(16, (vector pixel*)p);
+ g();
+ u8 = vec_ldl(16, (vector unsigned char*)p);
+ s8 = vec_ldl(16, (vector signed char*)p);
+ b8 = vec_ldl(16, (vector bool char*)p);
+ g();
+ u16 = vec_ldl(16, (vector unsigned short*)p);
+ s16 = vec_ldl(16, (vector signed short*)p);
+ b16 = vec_ldl(16, (vector bool short*)p);
+ g();
+ u32 = vec_ldl(16, (vector unsigned int*)p);
+ s32 = vec_ldl(16, (vector signed int*)p);
+ b32 = vec_ldl(16, (vector bool int*)p);
+ f32 = vec_ldl(16, (vector float*)p);
+ p16 = vec_ldl(16, (vector pixel*)p);
+}
+
+static void g ()
+{
+}
+
+static void test()
+{
+ static vector unsigned int value = {1,-2,3,-4};
+ static vector unsigned int buffer[2];
+#define chek(v, s) check(vec_all_eq(v, value), s)
+ buffer[1] = value;
+ f((void *)buffer);
+ chek((vector unsigned int) u8, "u8");
+ chek((vector unsigned int) s8, "s8");
+ chek((vector unsigned int) b8, "b8");
+ chek((vector unsigned int) u16, "u16");
+ chek((vector unsigned int) s16, "s16");
+ chek((vector unsigned int) b16, "b16");
+ chek((vector unsigned int) u32, "u32");
+ chek((vector unsigned int) s32, "s32");
+ chek((vector unsigned int) b32, "b32");
+ chek((vector unsigned int) f32, "f32");
+ chek((vector unsigned int) p16, "p16");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-01a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-01a.c
new file mode 100644
index 000000000..2499ca665
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-01a.c
@@ -0,0 +1,1450 @@
+/* { dg-do compile } */
+#include <altivec.h>
+typedef const volatile unsigned int _1;
+typedef const unsigned int _2;
+typedef volatile unsigned int _3;
+typedef unsigned int _4;
+typedef const volatile vector bool short _5;
+typedef const vector bool short _6;
+typedef volatile vector bool short _7;
+typedef vector bool short _8;
+typedef const volatile signed short _9;
+typedef const signed short _10;
+typedef volatile signed short _11;
+typedef signed short _12;
+typedef const volatile unsigned _13;
+typedef const unsigned _14;
+typedef volatile unsigned _15;
+typedef unsigned _16;
+typedef const volatile signed short int _17;
+typedef const signed short int _18;
+typedef volatile signed short int _19;
+typedef signed short int _20;
+typedef const volatile unsigned short int _21;
+typedef const unsigned short int _22;
+typedef volatile unsigned short int _23;
+typedef unsigned short int _24;
+typedef const volatile vector pixel _25;
+typedef const vector pixel _26;
+typedef volatile vector pixel _27;
+typedef vector pixel _28;
+typedef const volatile vector bool int _29;
+typedef const vector bool int _30;
+typedef volatile vector bool int _31;
+typedef vector bool int _32;
+typedef const volatile vector signed char _33;
+typedef const vector signed char _34;
+typedef volatile vector signed char _35;
+typedef vector signed char _36;
+typedef const volatile unsigned _37;
+typedef const unsigned _38;
+typedef volatile unsigned _39;
+typedef unsigned _40;
+typedef const volatile signed int _41;
+typedef const signed int _42;
+typedef volatile signed int _43;
+typedef signed int _44;
+typedef const volatile vector float _45;
+typedef const vector float _46;
+typedef volatile vector float _47;
+typedef vector float _48;
+typedef const volatile vector signed short _49;
+typedef const vector signed short _50;
+typedef volatile vector signed short _51;
+typedef vector signed short _52;
+typedef const volatile unsigned char _53;
+typedef const unsigned char _54;
+typedef volatile unsigned char _55;
+typedef unsigned char _56;
+typedef const volatile signed int _57;
+typedef const signed int _58;
+typedef volatile signed int _59;
+typedef signed int _60;
+typedef const volatile unsigned int _61;
+typedef const unsigned int _62;
+typedef volatile unsigned int _63;
+typedef unsigned int _64;
+typedef const volatile unsigned short _65;
+typedef const unsigned short _66;
+typedef volatile unsigned short _67;
+typedef unsigned short _68;
+typedef const volatile short _69;
+typedef const short _70;
+typedef volatile short _71;
+typedef short _72;
+typedef const volatile int _73;
+typedef const int _74;
+typedef volatile int _75;
+typedef int _76;
+typedef const volatile vector unsigned short _77;
+typedef const vector unsigned short _78;
+typedef volatile vector unsigned short _79;
+typedef vector unsigned short _80;
+typedef const volatile vector bool char _81;
+typedef const vector bool char _82;
+typedef volatile vector bool char _83;
+typedef vector bool char _84;
+typedef const volatile signed _85;
+typedef const signed _86;
+typedef volatile signed _87;
+typedef signed _88;
+typedef const volatile vector signed int _89;
+typedef const vector signed int _90;
+typedef volatile vector signed int _91;
+typedef vector signed int _92;
+typedef const volatile vector unsigned int _93;
+typedef const vector unsigned int _94;
+typedef volatile vector unsigned int _95;
+typedef vector unsigned int _96;
+typedef const volatile signed _97;
+typedef const signed _98;
+typedef volatile signed _99;
+typedef signed _100;
+typedef const volatile short int _101;
+typedef const short int _102;
+typedef volatile short int _103;
+typedef short int _104;
+typedef const volatile int _105;
+typedef const int _106;
+typedef volatile int _107;
+typedef int _108;
+typedef const volatile int _109;
+typedef const int _110;
+typedef volatile int _111;
+typedef int _112;
+typedef const volatile vector unsigned char _113;
+typedef const vector unsigned char _114;
+typedef volatile vector unsigned char _115;
+typedef vector unsigned char _116;
+typedef const volatile signed char _117;
+typedef const signed char _118;
+typedef volatile signed char _119;
+typedef signed char _120;
+typedef const volatile float _121;
+typedef const float _122;
+typedef volatile float _123;
+typedef float _124;
+
+vector unsigned char u8;
+vector signed char s8;
+vector bool char b8;
+vector unsigned short u16;
+vector signed short s16;
+vector bool short b16;
+vector unsigned int u32;
+vector signed int s32;
+vector bool int b32;
+vector float f32;
+vector pixel p16;
+
+void f(void *p)
+{
+ u8 = vec_lvsl(1,(const volatile unsigned int *)p);
+ u8 = vec_lvsl(1,(_1 *)p);
+ u8 = vec_lvsr(1,(const volatile unsigned int *)p);
+ u8 = vec_lvsr(1,(_1 *)p);
+ u8 = vec_lvsl(1,(const unsigned int *)p);
+ u8 = vec_lvsl(1,(_2 *)p);
+ u8 = vec_lvsr(1,(const unsigned int *)p);
+ u8 = vec_lvsr(1,(_2 *)p);
+ u32 = vec_ld(1,(const unsigned int *)p);
+ u32 = vec_ld(1,(_2 *)p);
+ u32 = vec_lde(1,(const unsigned int *)p);
+ u32 = vec_lde(1,(_2 *)p);
+ u32 = vec_ldl(1,(const unsigned int *)p);
+ u32 = vec_ldl(1,(_2 *)p);
+ vec_dst((const unsigned int *)p,1,1);
+ vec_dstst((const unsigned int *)p,1,1);
+ vec_dststt((const unsigned int *)p,1,1);
+ vec_dstt((const unsigned int *)p,1,1);
+ vec_dst((_2 *)p,1,1);
+ vec_dstst((_2 *)p,1,1);
+ vec_dststt((_2 *)p,1,1);
+ vec_dstt((_2 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile unsigned int *)p);
+ u8 = vec_lvsl(1,(_3 *)p);
+ u8 = vec_lvsr(1,( volatile unsigned int *)p);
+ u8 = vec_lvsr(1,(_3 *)p);
+ u8 = vec_lvsl(1,( unsigned int *)p);
+ u8 = vec_lvsl(1,(_4 *)p);
+ u8 = vec_lvsr(1,( unsigned int *)p);
+ u8 = vec_lvsr(1,(_4 *)p);
+ u32 = vec_ld(1,( unsigned int *)p);
+ u32 = vec_ld(1,(_4 *)p);
+ u32 = vec_lde(1,( unsigned int *)p);
+ u32 = vec_lde(1,(_4 *)p);
+ u32 = vec_ldl(1,( unsigned int *)p);
+ u32 = vec_ldl(1,(_4 *)p);
+ vec_dst(( unsigned int *)p,1,1);
+ vec_dstst(( unsigned int *)p,1,1);
+ vec_dststt(( unsigned int *)p,1,1);
+ vec_dstt(( unsigned int *)p,1,1);
+ vec_dst((_4 *)p,1,1);
+ vec_dstst((_4 *)p,1,1);
+ vec_dststt((_4 *)p,1,1);
+ vec_dstt((_4 *)p,1,1);
+ vec_st(u32,1,( unsigned int *)p);
+ vec_st(u32,1,(_4 *)p);
+ vec_ste(u32,1,( unsigned int *)p);
+ vec_ste(u32,1,(_4 *)p);
+ vec_stl(u32,1,( unsigned int *)p);
+ vec_stl(u32,1,(_4 *)p);
+ b16 = vec_ld(1,(const vector bool short *)p);
+ b16 = vec_ld(1,(_6 *)p);
+ b16 = vec_ldl(1,(const vector bool short *)p);
+ b16 = vec_ldl(1,(_6 *)p);
+ vec_dst((const vector bool short *)p,1,1);
+ vec_dstst((const vector bool short *)p,1,1);
+ vec_dststt((const vector bool short *)p,1,1);
+ vec_dstt((const vector bool short *)p,1,1);
+ vec_dst((_6 *)p,1,1);
+ vec_dstst((_6 *)p,1,1);
+ vec_dststt((_6 *)p,1,1);
+ vec_dstt((_6 *)p,1,1);
+ b16 = vec_ld(1,( vector bool short *)p);
+ b16 = vec_ld(1,(_8 *)p);
+ b16 = vec_ldl(1,( vector bool short *)p);
+ b16 = vec_ldl(1,(_8 *)p);
+ vec_dst(( vector bool short *)p,1,1);
+ vec_dstst(( vector bool short *)p,1,1);
+ vec_dststt(( vector bool short *)p,1,1);
+ vec_dstt(( vector bool short *)p,1,1);
+ vec_dst((_8 *)p,1,1);
+ vec_dstst((_8 *)p,1,1);
+ vec_dststt((_8 *)p,1,1);
+ vec_dstt((_8 *)p,1,1);
+ vec_st(b16,1,( vector bool short *)p);
+ vec_st(b16,1,(_8 *)p);
+ vec_stl(b16,1,( vector bool short *)p);
+ vec_stl(b16,1,(_8 *)p);
+ u8 = vec_lvsl(1,(const volatile signed short *)p);
+ u8 = vec_lvsl(1,(_9 *)p);
+ u8 = vec_lvsr(1,(const volatile signed short *)p);
+ u8 = vec_lvsr(1,(_9 *)p);
+ u8 = vec_lvsl(1,(const signed short *)p);
+ u8 = vec_lvsl(1,(_10 *)p);
+ u8 = vec_lvsr(1,(const signed short *)p);
+ u8 = vec_lvsr(1,(_10 *)p);
+ s16 = vec_ld(1,(const signed short *)p);
+ s16 = vec_ld(1,(_10 *)p);
+ s16 = vec_lde(1,(const signed short *)p);
+ s16 = vec_lde(1,(_10 *)p);
+ s16 = vec_ldl(1,(const signed short *)p);
+ s16 = vec_ldl(1,(_10 *)p);
+ vec_dst((const signed short *)p,1,1);
+ vec_dstst((const signed short *)p,1,1);
+ vec_dststt((const signed short *)p,1,1);
+ vec_dstt((const signed short *)p,1,1);
+ vec_dst((_10 *)p,1,1);
+ vec_dstst((_10 *)p,1,1);
+ vec_dststt((_10 *)p,1,1);
+ vec_dstt((_10 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile signed short *)p);
+ u8 = vec_lvsl(1,(_11 *)p);
+ u8 = vec_lvsr(1,( volatile signed short *)p);
+ u8 = vec_lvsr(1,(_11 *)p);
+ u8 = vec_lvsl(1,( signed short *)p);
+ u8 = vec_lvsl(1,(_12 *)p);
+ u8 = vec_lvsr(1,( signed short *)p);
+ u8 = vec_lvsr(1,(_12 *)p);
+ s16 = vec_ld(1,( signed short *)p);
+ s16 = vec_ld(1,(_12 *)p);
+ s16 = vec_lde(1,( signed short *)p);
+ s16 = vec_lde(1,(_12 *)p);
+ s16 = vec_ldl(1,( signed short *)p);
+ s16 = vec_ldl(1,(_12 *)p);
+ vec_dst(( signed short *)p,1,1);
+ vec_dstst(( signed short *)p,1,1);
+ vec_dststt(( signed short *)p,1,1);
+ vec_dstt(( signed short *)p,1,1);
+ vec_dst((_12 *)p,1,1);
+ vec_dstst((_12 *)p,1,1);
+ vec_dststt((_12 *)p,1,1);
+ vec_dstt((_12 *)p,1,1);
+ vec_st(s16,1,( signed short *)p);
+ vec_st(s16,1,(_12 *)p);
+ vec_ste(s16,1,( signed short *)p);
+ vec_ste(s16,1,(_12 *)p);
+ vec_stl(s16,1,( signed short *)p);
+ vec_stl(s16,1,(_12 *)p);
+ u8 = vec_lvsl(1,(const volatile unsigned *)p);
+ u8 = vec_lvsl(1,(_13 *)p);
+ u8 = vec_lvsr(1,(const volatile unsigned *)p);
+ u8 = vec_lvsr(1,(_13 *)p);
+ u8 = vec_lvsl(1,(const unsigned *)p);
+ u8 = vec_lvsl(1,(_14 *)p);
+ u8 = vec_lvsr(1,(const unsigned *)p);
+ u8 = vec_lvsr(1,(_14 *)p);
+ u32 = vec_ld(1,(const unsigned *)p);
+ u32 = vec_ld(1,(_14 *)p);
+ u32 = vec_lde(1,(const unsigned *)p);
+ u32 = vec_lde(1,(_14 *)p);
+ u32 = vec_ldl(1,(const unsigned *)p);
+ u32 = vec_ldl(1,(_14 *)p);
+ vec_dst((const unsigned *)p,1,1);
+ vec_dstst((const unsigned *)p,1,1);
+ vec_dststt((const unsigned *)p,1,1);
+ vec_dstt((const unsigned *)p,1,1);
+ vec_dst((_14 *)p,1,1);
+ vec_dstst((_14 *)p,1,1);
+ vec_dststt((_14 *)p,1,1);
+ vec_dstt((_14 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile unsigned *)p);
+ u8 = vec_lvsl(1,(_15 *)p);
+ u8 = vec_lvsr(1,( volatile unsigned *)p);
+ u8 = vec_lvsr(1,(_15 *)p);
+ u8 = vec_lvsl(1,( unsigned *)p);
+ u8 = vec_lvsl(1,(_16 *)p);
+ u8 = vec_lvsr(1,( unsigned *)p);
+ u8 = vec_lvsr(1,(_16 *)p);
+ u32 = vec_ld(1,( unsigned *)p);
+ u32 = vec_ld(1,(_16 *)p);
+ u32 = vec_lde(1,( unsigned *)p);
+ u32 = vec_lde(1,(_16 *)p);
+ u32 = vec_ldl(1,( unsigned *)p);
+ u32 = vec_ldl(1,(_16 *)p);
+ vec_dst(( unsigned *)p,1,1);
+ vec_dstst(( unsigned *)p,1,1);
+ vec_dststt(( unsigned *)p,1,1);
+ vec_dstt(( unsigned *)p,1,1);
+ vec_dst((_16 *)p,1,1);
+ vec_dstst((_16 *)p,1,1);
+ vec_dststt((_16 *)p,1,1);
+ vec_dstt((_16 *)p,1,1);
+ vec_st(u32,1,( unsigned *)p);
+ vec_st(u32,1,(_16 *)p);
+ vec_ste(u32,1,( unsigned *)p);
+ vec_ste(u32,1,(_16 *)p);
+ vec_stl(u32,1,( unsigned *)p);
+ vec_stl(u32,1,(_16 *)p);
+ u8 = vec_lvsl(1,(const volatile signed short int *)p);
+ u8 = vec_lvsl(1,(_17 *)p);
+ u8 = vec_lvsr(1,(const volatile signed short int *)p);
+ u8 = vec_lvsr(1,(_17 *)p);
+ u8 = vec_lvsl(1,(const signed short int *)p);
+ u8 = vec_lvsl(1,(_18 *)p);
+ u8 = vec_lvsr(1,(const signed short int *)p);
+ u8 = vec_lvsr(1,(_18 *)p);
+ s16 = vec_ld(1,(const signed short int *)p);
+ s16 = vec_ld(1,(_18 *)p);
+ s16 = vec_lde(1,(const signed short int *)p);
+ s16 = vec_lde(1,(_18 *)p);
+ s16 = vec_ldl(1,(const signed short int *)p);
+ s16 = vec_ldl(1,(_18 *)p);
+ vec_dst((const signed short int *)p,1,1);
+ vec_dstst((const signed short int *)p,1,1);
+ vec_dststt((const signed short int *)p,1,1);
+ vec_dstt((const signed short int *)p,1,1);
+ vec_dst((_18 *)p,1,1);
+ vec_dstst((_18 *)p,1,1);
+ vec_dststt((_18 *)p,1,1);
+ vec_dstt((_18 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile signed short int *)p);
+ u8 = vec_lvsl(1,(_19 *)p);
+ u8 = vec_lvsr(1,( volatile signed short int *)p);
+ u8 = vec_lvsr(1,(_19 *)p);
+ u8 = vec_lvsl(1,( signed short int *)p);
+ u8 = vec_lvsl(1,(_20 *)p);
+ u8 = vec_lvsr(1,( signed short int *)p);
+ u8 = vec_lvsr(1,(_20 *)p);
+ s16 = vec_ld(1,( signed short int *)p);
+ s16 = vec_ld(1,(_20 *)p);
+ s16 = vec_lde(1,( signed short int *)p);
+ s16 = vec_lde(1,(_20 *)p);
+ s16 = vec_ldl(1,( signed short int *)p);
+ s16 = vec_ldl(1,(_20 *)p);
+ vec_dst(( signed short int *)p,1,1);
+ vec_dstst(( signed short int *)p,1,1);
+ vec_dststt(( signed short int *)p,1,1);
+ vec_dstt(( signed short int *)p,1,1);
+ vec_dst((_20 *)p,1,1);
+ vec_dstst((_20 *)p,1,1);
+ vec_dststt((_20 *)p,1,1);
+ vec_dstt((_20 *)p,1,1);
+ vec_st(s16,1,( signed short int *)p);
+ vec_st(s16,1,(_20 *)p);
+ vec_ste(s16,1,( signed short int *)p);
+ vec_ste(s16,1,(_20 *)p);
+ vec_stl(s16,1,( signed short int *)p);
+ vec_stl(s16,1,(_20 *)p);
+ u8 = vec_lvsl(1,(const volatile unsigned short int *)p);
+ u8 = vec_lvsl(1,(_21 *)p);
+ u8 = vec_lvsr(1,(const volatile unsigned short int *)p);
+ u8 = vec_lvsr(1,(_21 *)p);
+ u8 = vec_lvsl(1,(const unsigned short int *)p);
+ u8 = vec_lvsl(1,(_22 *)p);
+ u8 = vec_lvsr(1,(const unsigned short int *)p);
+ u8 = vec_lvsr(1,(_22 *)p);
+ u16 = vec_ld(1,(const unsigned short int *)p);
+ u16 = vec_ld(1,(_22 *)p);
+ u16 = vec_lde(1,(const unsigned short int *)p);
+ u16 = vec_lde(1,(_22 *)p);
+ u16 = vec_ldl(1,(const unsigned short int *)p);
+ u16 = vec_ldl(1,(_22 *)p);
+ vec_dst((const unsigned short int *)p,1,1);
+ vec_dstst((const unsigned short int *)p,1,1);
+ vec_dststt((const unsigned short int *)p,1,1);
+ vec_dstt((const unsigned short int *)p,1,1);
+ vec_dst((_22 *)p,1,1);
+ vec_dstst((_22 *)p,1,1);
+ vec_dststt((_22 *)p,1,1);
+ vec_dstt((_22 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile unsigned short int *)p);
+ u8 = vec_lvsl(1,(_23 *)p);
+ u8 = vec_lvsr(1,( volatile unsigned short int *)p);
+ u8 = vec_lvsr(1,(_23 *)p);
+ u8 = vec_lvsl(1,( unsigned short int *)p);
+ u8 = vec_lvsl(1,(_24 *)p);
+ u8 = vec_lvsr(1,( unsigned short int *)p);
+ u8 = vec_lvsr(1,(_24 *)p);
+ u16 = vec_ld(1,( unsigned short int *)p);
+ u16 = vec_ld(1,(_24 *)p);
+ u16 = vec_lde(1,( unsigned short int *)p);
+ u16 = vec_lde(1,(_24 *)p);
+ u16 = vec_ldl(1,( unsigned short int *)p);
+ u16 = vec_ldl(1,(_24 *)p);
+ vec_dst(( unsigned short int *)p,1,1);
+ vec_dstst(( unsigned short int *)p,1,1);
+ vec_dststt(( unsigned short int *)p,1,1);
+ vec_dstt(( unsigned short int *)p,1,1);
+ vec_dst((_24 *)p,1,1);
+ vec_dstst((_24 *)p,1,1);
+ vec_dststt((_24 *)p,1,1);
+ vec_dstt((_24 *)p,1,1);
+ vec_st(u16,1,( unsigned short int *)p);
+ vec_st(u16,1,(_24 *)p);
+ vec_ste(u16,1,( unsigned short int *)p);
+ vec_ste(u16,1,(_24 *)p);
+ vec_stl(u16,1,( unsigned short int *)p);
+ vec_stl(u16,1,(_24 *)p);
+ p16 = vec_ld(1,(const vector pixel *)p);
+ p16 = vec_ld(1,(_26 *)p);
+ p16 = vec_ldl(1,(const vector pixel *)p);
+ p16 = vec_ldl(1,(_26 *)p);
+ vec_dst((const vector pixel *)p,1,1);
+ vec_dstst((const vector pixel *)p,1,1);
+ vec_dststt((const vector pixel *)p,1,1);
+ vec_dstt((const vector pixel *)p,1,1);
+ vec_dst((_26 *)p,1,1);
+ vec_dstst((_26 *)p,1,1);
+ vec_dststt((_26 *)p,1,1);
+ vec_dstt((_26 *)p,1,1);
+ p16 = vec_ld(1,( vector pixel *)p);
+ p16 = vec_ld(1,(_28 *)p);
+ p16 = vec_ldl(1,( vector pixel *)p);
+ p16 = vec_ldl(1,(_28 *)p);
+ vec_dst(( vector pixel *)p,1,1);
+ vec_dstst(( vector pixel *)p,1,1);
+ vec_dststt(( vector pixel *)p,1,1);
+ vec_dstt(( vector pixel *)p,1,1);
+ vec_dst((_28 *)p,1,1);
+ vec_dstst((_28 *)p,1,1);
+ vec_dststt((_28 *)p,1,1);
+ vec_dstt((_28 *)p,1,1);
+ vec_st(p16,1,( vector pixel *)p);
+ vec_st(p16,1,(_28 *)p);
+ vec_stl(p16,1,( vector pixel *)p);
+ vec_stl(p16,1,(_28 *)p);
+ b32 = vec_ld(1,(const vector bool int *)p);
+ b32 = vec_ld(1,(_30 *)p);
+ b32 = vec_ldl(1,(const vector bool int *)p);
+ b32 = vec_ldl(1,(_30 *)p);
+ vec_dst((const vector bool int *)p,1,1);
+ vec_dstst((const vector bool int *)p,1,1);
+ vec_dststt((const vector bool int *)p,1,1);
+ vec_dstt((const vector bool int *)p,1,1);
+ vec_dst((_30 *)p,1,1);
+ vec_dstst((_30 *)p,1,1);
+ vec_dststt((_30 *)p,1,1);
+ vec_dstt((_30 *)p,1,1);
+ b32 = vec_ld(1,( vector bool int *)p);
+ b32 = vec_ld(1,(_32 *)p);
+ b32 = vec_ldl(1,( vector bool int *)p);
+ b32 = vec_ldl(1,(_32 *)p);
+ vec_dst(( vector bool int *)p,1,1);
+ vec_dstst(( vector bool int *)p,1,1);
+ vec_dststt(( vector bool int *)p,1,1);
+ vec_dstt(( vector bool int *)p,1,1);
+ vec_dst((_32 *)p,1,1);
+ vec_dstst((_32 *)p,1,1);
+ vec_dststt((_32 *)p,1,1);
+ vec_dstt((_32 *)p,1,1);
+ vec_st(b32,1,( vector bool int *)p);
+ vec_st(b32,1,(_32 *)p);
+ vec_stl(b32,1,( vector bool int *)p);
+ vec_stl(b32,1,(_32 *)p);
+ s8 = vec_ld(1,(const vector signed char *)p);
+ s8 = vec_ld(1,(_34 *)p);
+ s8 = vec_ldl(1,(const vector signed char *)p);
+ s8 = vec_ldl(1,(_34 *)p);
+ vec_dst((const vector signed char *)p,1,1);
+ vec_dstst((const vector signed char *)p,1,1);
+ vec_dststt((const vector signed char *)p,1,1);
+ vec_dstt((const vector signed char *)p,1,1);
+ vec_dst((_34 *)p,1,1);
+ vec_dstst((_34 *)p,1,1);
+ vec_dststt((_34 *)p,1,1);
+ vec_dstt((_34 *)p,1,1);
+ s8 = vec_ld(1,( vector signed char *)p);
+ s8 = vec_ld(1,(_36 *)p);
+ s8 = vec_ldl(1,( vector signed char *)p);
+ s8 = vec_ldl(1,(_36 *)p);
+ vec_dst(( vector signed char *)p,1,1);
+ vec_dstst(( vector signed char *)p,1,1);
+ vec_dststt(( vector signed char *)p,1,1);
+ vec_dstt(( vector signed char *)p,1,1);
+ vec_dst((_36 *)p,1,1);
+ vec_dstst((_36 *)p,1,1);
+ vec_dststt((_36 *)p,1,1);
+ vec_dstt((_36 *)p,1,1);
+ vec_st(s8,1,( vector signed char *)p);
+ vec_st(s8,1,(_36 *)p);
+ vec_stl(s8,1,( vector signed char *)p);
+ vec_stl(s8,1,(_36 *)p);
+ u8 = vec_lvsl(1,(const volatile unsigned *)p);
+ u8 = vec_lvsl(1,(_37 *)p);
+ u8 = vec_lvsr(1,(const volatile unsigned *)p);
+ u8 = vec_lvsr(1,(_37 *)p);
+ u8 = vec_lvsl(1,(const unsigned *)p);
+ u8 = vec_lvsl(1,(_38 *)p);
+ u8 = vec_lvsr(1,(const unsigned *)p);
+ u8 = vec_lvsr(1,(_38 *)p);
+ u32 = vec_ld(1,(const unsigned *)p);
+ u32 = vec_ld(1,(_38 *)p);
+ u32 = vec_lde(1,(const unsigned *)p);
+ u32 = vec_lde(1,(_38 *)p);
+ u32 = vec_ldl(1,(const unsigned *)p);
+ u32 = vec_ldl(1,(_38 *)p);
+ vec_dst((const unsigned *)p,1,1);
+ vec_dstst((const unsigned *)p,1,1);
+ vec_dststt((const unsigned *)p,1,1);
+ vec_dstt((const unsigned *)p,1,1);
+ vec_dst((_38 *)p,1,1);
+ vec_dstst((_38 *)p,1,1);
+ vec_dststt((_38 *)p,1,1);
+ vec_dstt((_38 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile unsigned *)p);
+ u8 = vec_lvsl(1,(_39 *)p);
+ u8 = vec_lvsr(1,( volatile unsigned *)p);
+ u8 = vec_lvsr(1,(_39 *)p);
+ u8 = vec_lvsl(1,( unsigned *)p);
+ u8 = vec_lvsl(1,(_40 *)p);
+ u8 = vec_lvsr(1,( unsigned *)p);
+ u8 = vec_lvsr(1,(_40 *)p);
+ u32 = vec_ld(1,( unsigned *)p);
+ u32 = vec_ld(1,(_40 *)p);
+ u32 = vec_lde(1,( unsigned *)p);
+ u32 = vec_lde(1,(_40 *)p);
+ u32 = vec_ldl(1,( unsigned *)p);
+ u32 = vec_ldl(1,(_40 *)p);
+ vec_dst(( unsigned *)p,1,1);
+ vec_dstst(( unsigned *)p,1,1);
+ vec_dststt(( unsigned *)p,1,1);
+ vec_dstt(( unsigned *)p,1,1);
+ vec_dst((_40 *)p,1,1);
+ vec_dstst((_40 *)p,1,1);
+ vec_dststt((_40 *)p,1,1);
+ vec_dstt((_40 *)p,1,1);
+ vec_st(u32,1,( unsigned *)p);
+ vec_st(u32,1,(_40 *)p);
+ vec_ste(u32,1,( unsigned *)p);
+ vec_ste(u32,1,(_40 *)p);
+ vec_stl(u32,1,( unsigned *)p);
+ vec_stl(u32,1,(_40 *)p);
+ u8 = vec_lvsl(1,(const volatile signed int *)p);
+ u8 = vec_lvsl(1,(_41 *)p);
+ u8 = vec_lvsr(1,(const volatile signed int *)p);
+ u8 = vec_lvsr(1,(_41 *)p);
+ u8 = vec_lvsl(1,(const signed int *)p);
+ u8 = vec_lvsl(1,(_42 *)p);
+ u8 = vec_lvsr(1,(const signed int *)p);
+ u8 = vec_lvsr(1,(_42 *)p);
+ s32 = vec_ld(1,(const signed int *)p);
+ s32 = vec_ld(1,(_42 *)p);
+ s32 = vec_lde(1,(const signed int *)p);
+ s32 = vec_lde(1,(_42 *)p);
+ s32 = vec_ldl(1,(const signed int *)p);
+ s32 = vec_ldl(1,(_42 *)p);
+ vec_dst((const signed int *)p,1,1);
+ vec_dstst((const signed int *)p,1,1);
+ vec_dststt((const signed int *)p,1,1);
+ vec_dstt((const signed int *)p,1,1);
+ vec_dst((_42 *)p,1,1);
+ vec_dstst((_42 *)p,1,1);
+ vec_dststt((_42 *)p,1,1);
+ vec_dstt((_42 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile signed int *)p);
+ u8 = vec_lvsl(1,(_43 *)p);
+ u8 = vec_lvsr(1,( volatile signed int *)p);
+ u8 = vec_lvsr(1,(_43 *)p);
+ u8 = vec_lvsl(1,( signed int *)p);
+ u8 = vec_lvsl(1,(_44 *)p);
+ u8 = vec_lvsr(1,( signed int *)p);
+ u8 = vec_lvsr(1,(_44 *)p);
+ s32 = vec_ld(1,( signed int *)p);
+ s32 = vec_ld(1,(_44 *)p);
+ s32 = vec_lde(1,( signed int *)p);
+ s32 = vec_lde(1,(_44 *)p);
+ s32 = vec_ldl(1,( signed int *)p);
+ s32 = vec_ldl(1,(_44 *)p);
+ vec_dst(( signed int *)p,1,1);
+ vec_dstst(( signed int *)p,1,1);
+ vec_dststt(( signed int *)p,1,1);
+ vec_dstt(( signed int *)p,1,1);
+ vec_dst((_44 *)p,1,1);
+ vec_dstst((_44 *)p,1,1);
+ vec_dststt((_44 *)p,1,1);
+ vec_dstt((_44 *)p,1,1);
+ vec_st(s32,1,( signed int *)p);
+ vec_st(s32,1,(_44 *)p);
+ vec_ste(s32,1,( signed int *)p);
+ vec_ste(s32,1,(_44 *)p);
+ vec_stl(s32,1,( signed int *)p);
+ vec_stl(s32,1,(_44 *)p);
+ f32 = vec_ld(1,(const vector float *)p);
+ f32 = vec_ld(1,(_46 *)p);
+ f32 = vec_ldl(1,(const vector float *)p);
+ f32 = vec_ldl(1,(_46 *)p);
+ vec_dst((const vector float *)p,1,1);
+ vec_dstst((const vector float *)p,1,1);
+ vec_dststt((const vector float *)p,1,1);
+ vec_dstt((const vector float *)p,1,1);
+ vec_dst((_46 *)p,1,1);
+ vec_dstst((_46 *)p,1,1);
+ vec_dststt((_46 *)p,1,1);
+ vec_dstt((_46 *)p,1,1);
+ f32 = vec_ld(1,( vector float *)p);
+ f32 = vec_ld(1,(_48 *)p);
+ f32 = vec_ldl(1,( vector float *)p);
+ f32 = vec_ldl(1,(_48 *)p);
+ vec_dst(( vector float *)p,1,1);
+ vec_dstst(( vector float *)p,1,1);
+ vec_dststt(( vector float *)p,1,1);
+ vec_dstt(( vector float *)p,1,1);
+ vec_dst((_48 *)p,1,1);
+ vec_dstst((_48 *)p,1,1);
+ vec_dststt((_48 *)p,1,1);
+ vec_dstt((_48 *)p,1,1);
+ vec_st(f32,1,( vector float *)p);
+ vec_st(f32,1,(_48 *)p);
+ vec_stl(f32,1,( vector float *)p);
+ vec_stl(f32,1,(_48 *)p);
+ s16 = vec_ld(1,(const vector signed short *)p);
+ s16 = vec_ld(1,(_50 *)p);
+ s16 = vec_ldl(1,(const vector signed short *)p);
+ s16 = vec_ldl(1,(_50 *)p);
+ vec_dst((const vector signed short *)p,1,1);
+ vec_dstst((const vector signed short *)p,1,1);
+ vec_dststt((const vector signed short *)p,1,1);
+ vec_dstt((const vector signed short *)p,1,1);
+ vec_dst((_50 *)p,1,1);
+ vec_dstst((_50 *)p,1,1);
+ vec_dststt((_50 *)p,1,1);
+ vec_dstt((_50 *)p,1,1);
+ s16 = vec_ld(1,( vector signed short *)p);
+ s16 = vec_ld(1,(_52 *)p);
+ s16 = vec_ldl(1,( vector signed short *)p);
+ s16 = vec_ldl(1,(_52 *)p);
+ vec_dst(( vector signed short *)p,1,1);
+ vec_dstst(( vector signed short *)p,1,1);
+ vec_dststt(( vector signed short *)p,1,1);
+ vec_dstt(( vector signed short *)p,1,1);
+ vec_dst((_52 *)p,1,1);
+ vec_dstst((_52 *)p,1,1);
+ vec_dststt((_52 *)p,1,1);
+ vec_dstt((_52 *)p,1,1);
+ vec_st(s16,1,( vector signed short *)p);
+ vec_st(s16,1,(_52 *)p);
+ vec_stl(s16,1,( vector signed short *)p);
+ vec_stl(s16,1,(_52 *)p);
+ u8 = vec_lvsl(1,(const volatile unsigned char *)p);
+ u8 = vec_lvsl(1,(_53 *)p);
+ u8 = vec_lvsr(1,(const volatile unsigned char *)p);
+ u8 = vec_lvsr(1,(_53 *)p);
+ u8 = vec_lvsl(1,(const unsigned char *)p);
+ u8 = vec_lvsl(1,(_54 *)p);
+ u8 = vec_lvsr(1,(const unsigned char *)p);
+ u8 = vec_lvsr(1,(_54 *)p);
+ u8 = vec_ld(1,(const unsigned char *)p);
+ u8 = vec_ld(1,(_54 *)p);
+ u8 = vec_lde(1,(const unsigned char *)p);
+ u8 = vec_lde(1,(_54 *)p);
+ u8 = vec_ldl(1,(const unsigned char *)p);
+ u8 = vec_ldl(1,(_54 *)p);
+ vec_dst((const unsigned char *)p,1,1);
+ vec_dstst((const unsigned char *)p,1,1);
+ vec_dststt((const unsigned char *)p,1,1);
+ vec_dstt((const unsigned char *)p,1,1);
+ vec_dst((_54 *)p,1,1);
+ vec_dstst((_54 *)p,1,1);
+ vec_dststt((_54 *)p,1,1);
+ vec_dstt((_54 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile unsigned char *)p);
+ u8 = vec_lvsl(1,(_55 *)p);
+ u8 = vec_lvsr(1,( volatile unsigned char *)p);
+ u8 = vec_lvsr(1,(_55 *)p);
+ u8 = vec_lvsl(1,( unsigned char *)p);
+ u8 = vec_lvsl(1,(_56 *)p);
+ u8 = vec_lvsr(1,( unsigned char *)p);
+ u8 = vec_lvsr(1,(_56 *)p);
+ u8 = vec_ld(1,( unsigned char *)p);
+ u8 = vec_ld(1,(_56 *)p);
+ u8 = vec_lde(1,( unsigned char *)p);
+ u8 = vec_lde(1,(_56 *)p);
+ u8 = vec_ldl(1,( unsigned char *)p);
+ u8 = vec_ldl(1,(_56 *)p);
+ vec_dst(( unsigned char *)p,1,1);
+ vec_dstst(( unsigned char *)p,1,1);
+ vec_dststt(( unsigned char *)p,1,1);
+ vec_dstt(( unsigned char *)p,1,1);
+ vec_dst((_56 *)p,1,1);
+ vec_dstst((_56 *)p,1,1);
+ vec_dststt((_56 *)p,1,1);
+ vec_dstt((_56 *)p,1,1);
+ vec_st(u8,1,( unsigned char *)p);
+ vec_st(u8,1,(_56 *)p);
+ vec_ste(u8,1,( unsigned char *)p);
+ vec_ste(u8,1,(_56 *)p);
+ vec_stl(u8,1,( unsigned char *)p);
+ vec_stl(u8,1,(_56 *)p);
+ u8 = vec_lvsl(1,(const volatile signed int *)p);
+ u8 = vec_lvsl(1,(_57 *)p);
+ u8 = vec_lvsr(1,(const volatile signed int *)p);
+ u8 = vec_lvsr(1,(_57 *)p);
+ u8 = vec_lvsl(1,(const signed int *)p);
+ u8 = vec_lvsl(1,(_58 *)p);
+ u8 = vec_lvsr(1,(const signed int *)p);
+ u8 = vec_lvsr(1,(_58 *)p);
+ s32 = vec_ld(1,(const signed int *)p);
+ s32 = vec_ld(1,(_58 *)p);
+ s32 = vec_lde(1,(const signed int *)p);
+ s32 = vec_lde(1,(_58 *)p);
+ s32 = vec_ldl(1,(const signed int *)p);
+ s32 = vec_ldl(1,(_58 *)p);
+ vec_dst((const signed int *)p,1,1);
+ vec_dstst((const signed int *)p,1,1);
+ vec_dststt((const signed int *)p,1,1);
+ vec_dstt((const signed int *)p,1,1);
+ vec_dst((_58 *)p,1,1);
+ vec_dstst((_58 *)p,1,1);
+ vec_dststt((_58 *)p,1,1);
+ vec_dstt((_58 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile signed int *)p);
+ u8 = vec_lvsl(1,(_59 *)p);
+ u8 = vec_lvsr(1,( volatile signed int *)p);
+ u8 = vec_lvsr(1,(_59 *)p);
+ u8 = vec_lvsl(1,( signed int *)p);
+ u8 = vec_lvsl(1,(_60 *)p);
+ u8 = vec_lvsr(1,( signed int *)p);
+ u8 = vec_lvsr(1,(_60 *)p);
+ s32 = vec_ld(1,( signed int *)p);
+ s32 = vec_ld(1,(_60 *)p);
+ s32 = vec_lde(1,( signed int *)p);
+ s32 = vec_lde(1,(_60 *)p);
+ s32 = vec_ldl(1,( signed int *)p);
+ s32 = vec_ldl(1,(_60 *)p);
+ vec_dst(( signed int *)p,1,1);
+ vec_dstst(( signed int *)p,1,1);
+ vec_dststt(( signed int *)p,1,1);
+ vec_dstt(( signed int *)p,1,1);
+ vec_dst((_60 *)p,1,1);
+ vec_dstst((_60 *)p,1,1);
+ vec_dststt((_60 *)p,1,1);
+ vec_dstt((_60 *)p,1,1);
+ vec_st(s32,1,( signed int *)p);
+ vec_st(s32,1,(_60 *)p);
+ vec_ste(s32,1,( signed int *)p);
+ vec_ste(s32,1,(_60 *)p);
+ vec_stl(s32,1,( signed int *)p);
+ vec_stl(s32,1,(_60 *)p);
+ u8 = vec_lvsl(1,(const volatile unsigned int *)p);
+ u8 = vec_lvsl(1,(_61 *)p);
+ u8 = vec_lvsr(1,(const volatile unsigned int *)p);
+ u8 = vec_lvsr(1,(_61 *)p);
+ u8 = vec_lvsl(1,(const unsigned int *)p);
+ u8 = vec_lvsl(1,(_62 *)p);
+ u8 = vec_lvsr(1,(const unsigned int *)p);
+ u8 = vec_lvsr(1,(_62 *)p);
+ u32 = vec_ld(1,(const unsigned int *)p);
+ u32 = vec_ld(1,(_62 *)p);
+ u32 = vec_lde(1,(const unsigned int *)p);
+ u32 = vec_lde(1,(_62 *)p);
+ u32 = vec_ldl(1,(const unsigned int *)p);
+ u32 = vec_ldl(1,(_62 *)p);
+ vec_dst((const unsigned int *)p,1,1);
+ vec_dstst((const unsigned int *)p,1,1);
+ vec_dststt((const unsigned int *)p,1,1);
+ vec_dstt((const unsigned int *)p,1,1);
+ vec_dst((_62 *)p,1,1);
+ vec_dstst((_62 *)p,1,1);
+ vec_dststt((_62 *)p,1,1);
+ vec_dstt((_62 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile unsigned int *)p);
+ u8 = vec_lvsl(1,(_63 *)p);
+ u8 = vec_lvsr(1,( volatile unsigned int *)p);
+ u8 = vec_lvsr(1,(_63 *)p);
+ u8 = vec_lvsl(1,( unsigned int *)p);
+ u8 = vec_lvsl(1,(_64 *)p);
+ u8 = vec_lvsr(1,( unsigned int *)p);
+ u8 = vec_lvsr(1,(_64 *)p);
+ u32 = vec_ld(1,( unsigned int *)p);
+ u32 = vec_ld(1,(_64 *)p);
+ u32 = vec_lde(1,( unsigned int *)p);
+ u32 = vec_lde(1,(_64 *)p);
+ u32 = vec_ldl(1,( unsigned int *)p);
+ u32 = vec_ldl(1,(_64 *)p);
+ vec_dst(( unsigned int *)p,1,1);
+ vec_dstst(( unsigned int *)p,1,1);
+ vec_dststt(( unsigned int *)p,1,1);
+ vec_dstt(( unsigned int *)p,1,1);
+ vec_dst((_64 *)p,1,1);
+ vec_dstst((_64 *)p,1,1);
+ vec_dststt((_64 *)p,1,1);
+ vec_dstt((_64 *)p,1,1);
+ vec_st(u32,1,( unsigned int *)p);
+ vec_st(u32,1,(_64 *)p);
+ vec_ste(u32,1,( unsigned int *)p);
+ vec_ste(u32,1,(_64 *)p);
+ vec_stl(u32,1,( unsigned int *)p);
+ vec_stl(u32,1,(_64 *)p);
+ u8 = vec_lvsl(1,(const volatile unsigned short *)p);
+ u8 = vec_lvsl(1,(_65 *)p);
+ u8 = vec_lvsr(1,(const volatile unsigned short *)p);
+ u8 = vec_lvsr(1,(_65 *)p);
+ u8 = vec_lvsl(1,(const unsigned short *)p);
+ u8 = vec_lvsl(1,(_66 *)p);
+ u8 = vec_lvsr(1,(const unsigned short *)p);
+ u8 = vec_lvsr(1,(_66 *)p);
+ u16 = vec_ld(1,(const unsigned short *)p);
+ u16 = vec_ld(1,(_66 *)p);
+ u16 = vec_lde(1,(const unsigned short *)p);
+ u16 = vec_lde(1,(_66 *)p);
+ u16 = vec_ldl(1,(const unsigned short *)p);
+ u16 = vec_ldl(1,(_66 *)p);
+ vec_dst((const unsigned short *)p,1,1);
+ vec_dstst((const unsigned short *)p,1,1);
+ vec_dststt((const unsigned short *)p,1,1);
+ vec_dstt((const unsigned short *)p,1,1);
+ vec_dst((_66 *)p,1,1);
+ vec_dstst((_66 *)p,1,1);
+ vec_dststt((_66 *)p,1,1);
+ vec_dstt((_66 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile unsigned short *)p);
+ u8 = vec_lvsl(1,(_67 *)p);
+ u8 = vec_lvsr(1,( volatile unsigned short *)p);
+ u8 = vec_lvsr(1,(_67 *)p);
+ u8 = vec_lvsl(1,( unsigned short *)p);
+ u8 = vec_lvsl(1,(_68 *)p);
+ u8 = vec_lvsr(1,( unsigned short *)p);
+ u8 = vec_lvsr(1,(_68 *)p);
+ u16 = vec_ld(1,( unsigned short *)p);
+ u16 = vec_ld(1,(_68 *)p);
+ u16 = vec_lde(1,( unsigned short *)p);
+ u16 = vec_lde(1,(_68 *)p);
+ u16 = vec_ldl(1,( unsigned short *)p);
+ u16 = vec_ldl(1,(_68 *)p);
+ vec_dst(( unsigned short *)p,1,1);
+ vec_dstst(( unsigned short *)p,1,1);
+ vec_dststt(( unsigned short *)p,1,1);
+ vec_dstt(( unsigned short *)p,1,1);
+ vec_dst((_68 *)p,1,1);
+ vec_dstst((_68 *)p,1,1);
+ vec_dststt((_68 *)p,1,1);
+ vec_dstt((_68 *)p,1,1);
+ vec_st(u16,1,( unsigned short *)p);
+ vec_st(u16,1,(_68 *)p);
+ vec_ste(u16,1,( unsigned short *)p);
+ vec_ste(u16,1,(_68 *)p);
+ vec_stl(u16,1,( unsigned short *)p);
+ vec_stl(u16,1,(_68 *)p);
+ u8 = vec_lvsl(1,(const volatile short *)p);
+ u8 = vec_lvsl(1,(_69 *)p);
+ u8 = vec_lvsr(1,(const volatile short *)p);
+ u8 = vec_lvsr(1,(_69 *)p);
+ u8 = vec_lvsl(1,(const short *)p);
+ u8 = vec_lvsl(1,(_70 *)p);
+ u8 = vec_lvsr(1,(const short *)p);
+ u8 = vec_lvsr(1,(_70 *)p);
+ s16 = vec_ld(1,(const short *)p);
+ s16 = vec_ld(1,(_70 *)p);
+ s16 = vec_lde(1,(const short *)p);
+ s16 = vec_lde(1,(_70 *)p);
+ s16 = vec_ldl(1,(const short *)p);
+ s16 = vec_ldl(1,(_70 *)p);
+ vec_dst((const short *)p,1,1);
+ vec_dstst((const short *)p,1,1);
+ vec_dststt((const short *)p,1,1);
+ vec_dstt((const short *)p,1,1);
+ vec_dst((_70 *)p,1,1);
+ vec_dstst((_70 *)p,1,1);
+ vec_dststt((_70 *)p,1,1);
+ vec_dstt((_70 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile short *)p);
+ u8 = vec_lvsl(1,(_71 *)p);
+ u8 = vec_lvsr(1,( volatile short *)p);
+ u8 = vec_lvsr(1,(_71 *)p);
+ u8 = vec_lvsl(1,( short *)p);
+ u8 = vec_lvsl(1,(_72 *)p);
+ u8 = vec_lvsr(1,( short *)p);
+ u8 = vec_lvsr(1,(_72 *)p);
+ s16 = vec_ld(1,( short *)p);
+ s16 = vec_ld(1,(_72 *)p);
+ s16 = vec_lde(1,( short *)p);
+ s16 = vec_lde(1,(_72 *)p);
+ s16 = vec_ldl(1,( short *)p);
+ s16 = vec_ldl(1,(_72 *)p);
+ vec_dst(( short *)p,1,1);
+ vec_dstst(( short *)p,1,1);
+ vec_dststt(( short *)p,1,1);
+ vec_dstt(( short *)p,1,1);
+ vec_dst((_72 *)p,1,1);
+ vec_dstst((_72 *)p,1,1);
+ vec_dststt((_72 *)p,1,1);
+ vec_dstt((_72 *)p,1,1);
+ vec_st(s16,1,( short *)p);
+ vec_st(s16,1,(_72 *)p);
+ vec_ste(s16,1,( short *)p);
+ vec_ste(s16,1,(_72 *)p);
+ vec_stl(s16,1,( short *)p);
+ vec_stl(s16,1,(_72 *)p);
+ u8 = vec_lvsl(1,(const int volatile *)p);
+ u8 = vec_lvsl(1,(_73 *)p);
+ u8 = vec_lvsr(1,(const int volatile *)p);
+ u8 = vec_lvsr(1,(_73 *)p);
+ u8 = vec_lvsl(1,(const int *)p);
+ u8 = vec_lvsl(1,(_74 *)p);
+ u8 = vec_lvsr(1,(const int *)p);
+ u8 = vec_lvsr(1,(_74 *)p);
+ s32 = vec_ld(1,(const int *)p);
+ s32 = vec_ld(1,(_74 *)p);
+ s32 = vec_lde(1,(const int *)p);
+ s32 = vec_lde(1,(_74 *)p);
+ s32 = vec_ldl(1,(const int *)p);
+ s32 = vec_ldl(1,(_74 *)p);
+ vec_dst((const int *)p,1,1);
+ vec_dstst((const int *)p,1,1);
+ vec_dststt((const int *)p,1,1);
+ vec_dstt((const int *)p,1,1);
+ vec_dst((_74 *)p,1,1);
+ vec_dstst((_74 *)p,1,1);
+ vec_dststt((_74 *)p,1,1);
+ vec_dstt((_74 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile int *)p);
+ u8 = vec_lvsl(1,(_75 *)p);
+ u8 = vec_lvsr(1,( volatile int *)p);
+ u8 = vec_lvsr(1,(_75 *)p);
+ u8 = vec_lvsl(1,( int *)p);
+ u8 = vec_lvsl(1,(_76 *)p);
+ u8 = vec_lvsr(1,( int *)p);
+ u8 = vec_lvsr(1,(_76 *)p);
+ s32 = vec_ld(1,( int *)p);
+ s32 = vec_ld(1,(_76 *)p);
+ s32 = vec_lde(1,(int *)p);
+ s32 = vec_lde(1,(_76 *)p);
+ s32 = vec_ldl(1,(int *)p);
+ s32 = vec_ldl(1,(_76 *)p);
+ vec_dst((int *)p,1,1);
+ vec_dstst((int *)p,1,1);
+ vec_dststt((int *)p,1,1);
+ vec_dstt((int *)p,1,1);
+ vec_dst((_76 *)p,1,1);
+ vec_dstst((_76 *)p,1,1);
+ vec_dststt((_76 *)p,1,1);
+ vec_dstt((_76 *)p,1,1);
+ vec_st(s32,1,(int *)p);
+ vec_st(s32,1,(_76 *)p);
+ vec_ste(s32,1,(int *)p);
+ vec_ste(s32,1,(_76 *)p);
+ vec_stl(s32,1,(int *)p);
+ vec_stl(s32,1,(_76 *)p);
+ u16 = vec_ld(1,(const vector unsigned short *)p);
+ u16 = vec_ld(1,(_78 *)p);
+ u16 = vec_ldl(1,(const vector unsigned short *)p);
+ u16 = vec_ldl(1,(_78 *)p);
+ vec_dst((const vector unsigned short *)p,1,1);
+ vec_dstst((const vector unsigned short *)p,1,1);
+ vec_dststt((const vector unsigned short *)p,1,1);
+ vec_dstt((const vector unsigned short *)p,1,1);
+ vec_dst((_78 *)p,1,1);
+ vec_dstst((_78 *)p,1,1);
+ vec_dststt((_78 *)p,1,1);
+ vec_dstt((_78 *)p,1,1);
+ u16 = vec_ld(1,( vector unsigned short *)p);
+ u16 = vec_ld(1,(_80 *)p);
+ u16 = vec_ldl(1,( vector unsigned short *)p);
+ u16 = vec_ldl(1,(_80 *)p);
+ vec_dst(( vector unsigned short *)p,1,1);
+ vec_dstst(( vector unsigned short *)p,1,1);
+ vec_dststt(( vector unsigned short *)p,1,1);
+ vec_dstt(( vector unsigned short *)p,1,1);
+ vec_dst((_80 *)p,1,1);
+ vec_dstst((_80 *)p,1,1);
+ vec_dststt((_80 *)p,1,1);
+ vec_dstt((_80 *)p,1,1);
+ vec_st(u16,1,( vector unsigned short *)p);
+ vec_st(u16,1,(_80 *)p);
+ vec_stl(u16,1,( vector unsigned short *)p);
+ vec_stl(u16,1,(_80 *)p);
+ b8 = vec_ld(1,(const vector bool char *)p);
+ b8 = vec_ld(1,(_82 *)p);
+ b8 = vec_ldl(1,(const vector bool char *)p);
+ b8 = vec_ldl(1,(_82 *)p);
+ vec_dst((const vector bool char *)p,1,1);
+ vec_dstst((const vector bool char *)p,1,1);
+ vec_dststt((const vector bool char *)p,1,1);
+ vec_dstt((const vector bool char *)p,1,1);
+ vec_dst((_82 *)p,1,1);
+ vec_dstst((_82 *)p,1,1);
+ vec_dststt((_82 *)p,1,1);
+ vec_dstt((_82 *)p,1,1);
+ b8 = vec_ld(1,( vector bool char *)p);
+ b8 = vec_ld(1,(_84 *)p);
+ b8 = vec_ldl(1,( vector bool char *)p);
+ b8 = vec_ldl(1,(_84 *)p);
+ vec_dst(( vector bool char *)p,1,1);
+ vec_dstst(( vector bool char *)p,1,1);
+ vec_dststt(( vector bool char *)p,1,1);
+ vec_dstt(( vector bool char *)p,1,1);
+ vec_dst((_84 *)p,1,1);
+ vec_dstst((_84 *)p,1,1);
+ vec_dststt((_84 *)p,1,1);
+ vec_dstt((_84 *)p,1,1);
+ vec_st(b8,1,( vector bool char *)p);
+ vec_st(b8,1,(_84 *)p);
+ vec_stl(b8,1,( vector bool char *)p);
+ vec_stl(b8,1,(_84 *)p);
+ u8 = vec_lvsl(1,(const volatile int signed *)p);
+ u8 = vec_lvsl(1,(_85 *)p);
+ u8 = vec_lvsr(1,(const volatile int signed *)p);
+ u8 = vec_lvsr(1,(_85 *)p);
+ u8 = vec_lvsl(1,(const int signed *)p);
+ u8 = vec_lvsl(1,(_86 *)p);
+ u8 = vec_lvsr(1,(const int signed *)p);
+ u8 = vec_lvsr(1,(_86 *)p);
+ s32 = vec_ld(1,(const int signed *)p);
+ s32 = vec_ld(1,(_86 *)p);
+ s32 = vec_lde(1,(const int signed *)p);
+ s32 = vec_lde(1,(_86 *)p);
+ s32 = vec_ldl(1,(const int signed *)p);
+ s32 = vec_ldl(1,(_86 *)p);
+ vec_dst((const int signed *)p,1,1);
+ vec_dstst((const int signed *)p,1,1);
+ vec_dststt((const int signed *)p,1,1);
+ vec_dstt((const int signed *)p,1,1);
+ vec_dst((_86 *)p,1,1);
+ vec_dstst((_86 *)p,1,1);
+ vec_dststt((_86 *)p,1,1);
+ vec_dstt((_86 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile int signed *)p);
+ u8 = vec_lvsl(1,(_87 *)p);
+ u8 = vec_lvsr(1,( volatile int signed *)p);
+ u8 = vec_lvsr(1,(_87 *)p);
+ u8 = vec_lvsl(1,(int signed *)p);
+ u8 = vec_lvsl(1,(_88 *)p);
+ u8 = vec_lvsr(1,(int signed *)p);
+ u8 = vec_lvsr(1,(_88 *)p);
+ s32 = vec_ld(1,(int signed *)p);
+ s32 = vec_ld(1,(_88 *)p);
+ s32 = vec_lde(1,(int signed *)p);
+ s32 = vec_lde(1,(_88 *)p);
+ s32 = vec_ldl(1,(int signed *)p);
+ s32 = vec_ldl(1,(_88 *)p);
+ vec_dst((int signed *)p,1,1);
+ vec_dstst((int signed *)p,1,1);
+ vec_dststt((int signed *)p,1,1);
+ vec_dstt((int signed *)p,1,1);
+ vec_dst((_88 *)p,1,1);
+ vec_dstst((_88 *)p,1,1);
+ vec_dststt((_88 *)p,1,1);
+ vec_dstt((_88 *)p,1,1);
+ vec_st(s32,1,(int signed *)p);
+ vec_st(s32,1,(_88 *)p);
+ vec_ste(s32,1,(int signed *)p);
+ vec_ste(s32,1,(_88 *)p);
+ vec_stl(s32,1,(int signed *)p);
+ vec_stl(s32,1,(_88 *)p);
+ s32 = vec_ld(1,(const vector signed int *)p);
+ s32 = vec_ld(1,(_90 *)p);
+ s32 = vec_ldl(1,(const vector signed int *)p);
+ s32 = vec_ldl(1,(_90 *)p);
+ vec_dst((const vector signed int *)p,1,1);
+ vec_dstst((const vector signed int *)p,1,1);
+ vec_dststt((const vector signed int *)p,1,1);
+ vec_dstt((const vector signed int *)p,1,1);
+ vec_dst((_90 *)p,1,1);
+ vec_dstst((_90 *)p,1,1);
+ vec_dststt((_90 *)p,1,1);
+ vec_dstt((_90 *)p,1,1);
+ s32 = vec_ld(1,( vector signed int *)p);
+ s32 = vec_ld(1,(_92 *)p);
+ s32 = vec_ldl(1,( vector signed int *)p);
+ s32 = vec_ldl(1,(_92 *)p);
+ vec_dst(( vector signed int *)p,1,1);
+ vec_dstst(( vector signed int *)p,1,1);
+ vec_dststt(( vector signed int *)p,1,1);
+ vec_dstt(( vector signed int *)p,1,1);
+ vec_dst((_92 *)p,1,1);
+ vec_dstst((_92 *)p,1,1);
+ vec_dststt((_92 *)p,1,1);
+ vec_dstt((_92 *)p,1,1);
+ vec_st(s32,1,( vector signed int *)p);
+ vec_st(s32,1,(_92 *)p);
+ vec_stl(s32,1,( vector signed int *)p);
+ vec_stl(s32,1,(_92 *)p);
+ u32 = vec_ld(1,(const vector unsigned int *)p);
+ u32 = vec_ld(1,(_94 *)p);
+ u32 = vec_ldl(1,(const vector unsigned int *)p);
+ u32 = vec_ldl(1,(_94 *)p);
+ vec_dst((const vector unsigned int *)p,1,1);
+ vec_dstst((const vector unsigned int *)p,1,1);
+ vec_dststt((const vector unsigned int *)p,1,1);
+ vec_dstt((const vector unsigned int *)p,1,1);
+ vec_dst((_94 *)p,1,1);
+ vec_dstst((_94 *)p,1,1);
+ vec_dststt((_94 *)p,1,1);
+ vec_dstt((_94 *)p,1,1);
+ u32 = vec_ld(1,( vector unsigned int *)p);
+ u32 = vec_ld(1,(_96 *)p);
+ u32 = vec_ldl(1,( vector unsigned int *)p);
+ u32 = vec_ldl(1,(_96 *)p);
+ vec_dst(( vector unsigned int *)p,1,1);
+ vec_dstst(( vector unsigned int *)p,1,1);
+ vec_dststt(( vector unsigned int *)p,1,1);
+ vec_dstt(( vector unsigned int *)p,1,1);
+ vec_dst((_96 *)p,1,1);
+ vec_dstst((_96 *)p,1,1);
+ vec_dststt((_96 *)p,1,1);
+ vec_dstt((_96 *)p,1,1);
+ vec_st(u32,1,( vector unsigned int *)p);
+ vec_st(u32,1,(_96 *)p);
+ vec_stl(u32,1,( vector unsigned int *)p);
+ vec_stl(u32,1,(_96 *)p);
+ u8 = vec_lvsl(1,(const volatile int signed *)p);
+ u8 = vec_lvsl(1,(_97 *)p);
+ u8 = vec_lvsr(1,(const volatile int signed *)p);
+ u8 = vec_lvsr(1,(_97 *)p);
+ u8 = vec_lvsl(1,(const int signed *)p);
+ u8 = vec_lvsl(1,(_98 *)p);
+ u8 = vec_lvsr(1,(const int signed *)p);
+ u8 = vec_lvsr(1,(_98 *)p);
+ s32 = vec_ld(1,(const int signed *)p);
+ s32 = vec_ld(1,(_98 *)p);
+ s32 = vec_lde(1,(const int signed *)p);
+ s32 = vec_lde(1,(_98 *)p);
+ s32 = vec_ldl(1,(const int signed *)p);
+ s32 = vec_ldl(1,(_98 *)p);
+ vec_dst((const int signed *)p,1,1);
+ vec_dstst((const int signed *)p,1,1);
+ vec_dststt((const int signed *)p,1,1);
+ vec_dstt((const int signed *)p,1,1);
+ vec_dst((_98 *)p,1,1);
+ vec_dstst((_98 *)p,1,1);
+ vec_dststt((_98 *)p,1,1);
+ vec_dstt((_98 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile int signed *)p);
+ u8 = vec_lvsl(1,(_99 *)p);
+ u8 = vec_lvsr(1,( volatile int signed *)p);
+ u8 = vec_lvsr(1,(_99 *)p);
+ u8 = vec_lvsl(1,(int signed *)p);
+ u8 = vec_lvsl(1,(_100 *)p);
+ u8 = vec_lvsr(1,(int signed *)p);
+ u8 = vec_lvsr(1,(_100 *)p);
+ s32 = vec_ld(1,(int signed *)p);
+ s32 = vec_ld(1,(_100 *)p);
+ s32 = vec_lde(1,(int signed *)p);
+ s32 = vec_lde(1,(_100 *)p);
+ s32 = vec_ldl(1,(int signed *)p);
+ s32 = vec_ldl(1,(_100 *)p);
+ vec_dst((int signed *)p,1,1);
+ vec_dstst((int signed *)p,1,1);
+ vec_dststt((int signed *)p,1,1);
+ vec_dstt((int signed *)p,1,1);
+ vec_dst((_100 *)p,1,1);
+ vec_dstst((_100 *)p,1,1);
+ vec_dststt((_100 *)p,1,1);
+ vec_dstt((_100 *)p,1,1);
+ vec_st(s32,1,(int signed *)p);
+ vec_st(s32,1,(_100 *)p);
+ vec_ste(s32,1,(int signed *)p);
+ vec_ste(s32,1,(_100 *)p);
+ vec_stl(s32,1,(int signed *)p);
+ vec_stl(s32,1,(_100 *)p);
+ u8 = vec_lvsl(1,(const volatile short int *)p);
+ u8 = vec_lvsl(1,(_101 *)p);
+ u8 = vec_lvsr(1,(const volatile short int *)p);
+ u8 = vec_lvsr(1,(_101 *)p);
+ u8 = vec_lvsl(1,(const short int *)p);
+ u8 = vec_lvsl(1,(_102 *)p);
+ u8 = vec_lvsr(1,(const short int *)p);
+ u8 = vec_lvsr(1,(_102 *)p);
+ s16 = vec_ld(1,(const short int *)p);
+ s16 = vec_ld(1,(_102 *)p);
+ s16 = vec_lde(1,(const short int *)p);
+ s16 = vec_lde(1,(_102 *)p);
+ s16 = vec_ldl(1,(const short int *)p);
+ s16 = vec_ldl(1,(_102 *)p);
+ vec_dst((const short int *)p,1,1);
+ vec_dstst((const short int *)p,1,1);
+ vec_dststt((const short int *)p,1,1);
+ vec_dstt((const short int *)p,1,1);
+ vec_dst((_102 *)p,1,1);
+ vec_dstst((_102 *)p,1,1);
+ vec_dststt((_102 *)p,1,1);
+ vec_dstt((_102 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile short int *)p);
+ u8 = vec_lvsl(1,(_103 *)p);
+ u8 = vec_lvsr(1,( volatile short int *)p);
+ u8 = vec_lvsr(1,(_103 *)p);
+ u8 = vec_lvsl(1,( short int *)p);
+ u8 = vec_lvsl(1,(_104 *)p);
+ u8 = vec_lvsr(1,( short int *)p);
+ u8 = vec_lvsr(1,(_104 *)p);
+ s16 = vec_ld(1,( short int *)p);
+ s16 = vec_ld(1,(_104 *)p);
+ s16 = vec_lde(1,( short int *)p);
+ s16 = vec_lde(1,(_104 *)p);
+ s16 = vec_ldl(1,( short int *)p);
+ s16 = vec_ldl(1,(_104 *)p);
+ vec_dst(( short int *)p,1,1);
+ vec_dstst(( short int *)p,1,1);
+ vec_dststt(( short int *)p,1,1);
+ vec_dstt(( short int *)p,1,1);
+ vec_dst((_104 *)p,1,1);
+ vec_dstst((_104 *)p,1,1);
+ vec_dststt((_104 *)p,1,1);
+ vec_dstt((_104 *)p,1,1);
+ vec_st(s16,1,( short int *)p);
+ vec_st(s16,1,(_104 *)p);
+ vec_ste(s16,1,( short int *)p);
+ vec_ste(s16,1,(_104 *)p);
+ vec_stl(s16,1,( short int *)p);
+ vec_stl(s16,1,(_104 *)p);
+ u8 = vec_lvsl(1,(const volatile int *)p);
+ u8 = vec_lvsl(1,(_105 *)p);
+ u8 = vec_lvsr(1,(const volatile int *)p);
+ u8 = vec_lvsr(1,(_105 *)p);
+ u8 = vec_lvsl(1,(const int *)p);
+ u8 = vec_lvsl(1,(_106 *)p);
+ u8 = vec_lvsr(1,(const int *)p);
+ u8 = vec_lvsr(1,(_106 *)p);
+ s32 = vec_ld(1,(const int *)p);
+ s32 = vec_ld(1,(_106 *)p);
+ s32 = vec_lde(1,(const int *)p);
+ s32 = vec_lde(1,(_106 *)p);
+ s32 = vec_ldl(1,(const int *)p);
+ s32 = vec_ldl(1,(_106 *)p);
+ vec_dst((const int *)p,1,1);
+ vec_dstst((const int *)p,1,1);
+ vec_dststt((const int *)p,1,1);
+ vec_dstt((const int *)p,1,1);
+ vec_dst((_106 *)p,1,1);
+ vec_dstst((_106 *)p,1,1);
+ vec_dststt((_106 *)p,1,1);
+ vec_dstt((_106 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile int *)p);
+ u8 = vec_lvsl(1,(_107 *)p);
+ u8 = vec_lvsr(1,( volatile int *)p);
+ u8 = vec_lvsr(1,(_107 *)p);
+ u8 = vec_lvsl(1,( int *)p);
+ u8 = vec_lvsl(1,(_108 *)p);
+ u8 = vec_lvsr(1,( int *)p);
+ u8 = vec_lvsr(1,(_108 *)p);
+ s32 = vec_ld(1,( int *)p);
+ s32 = vec_ld(1,(_108 *)p);
+ s32 = vec_lde(1,( int *)p);
+ s32 = vec_lde(1,(_108 *)p);
+ s32 = vec_ldl(1,( int *)p);
+ s32 = vec_ldl(1,(_108 *)p);
+ vec_dst(( int *)p,1,1);
+ vec_dstst(( int *)p,1,1);
+ vec_dststt(( int *)p,1,1);
+ vec_dstt(( int *)p,1,1);
+ vec_dst((_108 *)p,1,1);
+ vec_dstst((_108 *)p,1,1);
+ vec_dststt((_108 *)p,1,1);
+ vec_dstt((_108 *)p,1,1);
+ vec_st(s32,1,( int *)p);
+ vec_st(s32,1,(_108 *)p);
+ vec_ste(s32,1,( int *)p);
+ vec_ste(s32,1,(_108 *)p);
+ vec_stl(s32,1,( int *)p);
+ vec_stl(s32,1,(_108 *)p);
+ u8 = vec_lvsl(1,(const volatile int *)p);
+ u8 = vec_lvsl(1,(_109 *)p);
+ u8 = vec_lvsr(1,(const volatile int *)p);
+ u8 = vec_lvsr(1,(_109 *)p);
+ u8 = vec_lvsl(1,(const int *)p);
+ u8 = vec_lvsl(1,(_110 *)p);
+ u8 = vec_lvsr(1,(const int *)p);
+ u8 = vec_lvsr(1,(_110 *)p);
+ s32 = vec_ld(1,(const int *)p);
+ s32 = vec_ld(1,(_110 *)p);
+ s32 = vec_lde(1,(const int *)p);
+ s32 = vec_lde(1,(_110 *)p);
+ s32 = vec_ldl(1,(const int *)p);
+ s32 = vec_ldl(1,(_110 *)p);
+ vec_dst((const int *)p,1,1);
+ vec_dstst((const int *)p,1,1);
+ vec_dststt((const int *)p,1,1);
+ vec_dstt((const int *)p,1,1);
+ vec_dst((_110 *)p,1,1);
+ vec_dstst((_110 *)p,1,1);
+ vec_dststt((_110 *)p,1,1);
+ vec_dstt((_110 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile int *)p);
+ u8 = vec_lvsl(1,(_111 *)p);
+ u8 = vec_lvsr(1,( volatile int *)p);
+ u8 = vec_lvsr(1,(_111 *)p);
+ u8 = vec_lvsl(1,( int *)p);
+ u8 = vec_lvsl(1,(_112 *)p);
+ u8 = vec_lvsr(1,( int *)p);
+ u8 = vec_lvsr(1,(_112 *)p);
+ s32 = vec_ld(1,( int *)p);
+ s32 = vec_ld(1,(_112 *)p);
+ s32 = vec_lde(1,( int *)p);
+ s32 = vec_lde(1,(_112 *)p);
+ s32 = vec_ldl(1,( int *)p);
+ s32 = vec_ldl(1,(_112 *)p);
+ vec_dst(( int *)p,1,1);
+ vec_dstst(( int *)p,1,1);
+ vec_dststt(( int *)p,1,1);
+ vec_dstt(( int *)p,1,1);
+ vec_dst((_112 *)p,1,1);
+ vec_dstst((_112 *)p,1,1);
+ vec_dststt((_112 *)p,1,1);
+ vec_dstt((_112 *)p,1,1);
+ vec_st(s32,1,( int *)p);
+ vec_st(s32,1,(_112 *)p);
+ vec_ste(s32,1,( int *)p);
+ vec_ste(s32,1,(_112 *)p);
+ vec_stl(s32,1,( int *)p);
+ vec_stl(s32,1,(_112 *)p);
+ u8 = vec_ld(1,(const vector unsigned char *)p);
+ u8 = vec_ld(1,(_114 *)p);
+ u8 = vec_ldl(1,(const vector unsigned char *)p);
+ u8 = vec_ldl(1,(_114 *)p);
+ vec_dst((const vector unsigned char *)p,1,1);
+ vec_dstst((const vector unsigned char *)p,1,1);
+ vec_dststt((const vector unsigned char *)p,1,1);
+ vec_dstt((const vector unsigned char *)p,1,1);
+ vec_dst((_114 *)p,1,1);
+ vec_dstst((_114 *)p,1,1);
+ vec_dststt((_114 *)p,1,1);
+ vec_dstt((_114 *)p,1,1);
+ u8 = vec_ld(1,( vector unsigned char *)p);
+ u8 = vec_ld(1,(_116 *)p);
+ u8 = vec_ldl(1,( vector unsigned char *)p);
+ u8 = vec_ldl(1,(_116 *)p);
+ vec_dst(( vector unsigned char *)p,1,1);
+ vec_dstst(( vector unsigned char *)p,1,1);
+ vec_dststt(( vector unsigned char *)p,1,1);
+ vec_dstt(( vector unsigned char *)p,1,1);
+ vec_dst((_116 *)p,1,1);
+ vec_dstst((_116 *)p,1,1);
+ vec_dststt((_116 *)p,1,1);
+ vec_dstt((_116 *)p,1,1);
+ vec_st(u8,1,( vector unsigned char *)p);
+ vec_st(u8,1,(_116 *)p);
+ vec_stl(u8,1,( vector unsigned char *)p);
+ vec_stl(u8,1,(_116 *)p);
+ u8 = vec_lvsl(1,(const volatile signed char *)p);
+ u8 = vec_lvsl(1,(_117 *)p);
+ u8 = vec_lvsr(1,(const volatile signed char *)p);
+ u8 = vec_lvsr(1,(_117 *)p);
+ u8 = vec_lvsl(1,(const signed char *)p);
+ u8 = vec_lvsl(1,(_118 *)p);
+ u8 = vec_lvsr(1,(const signed char *)p);
+ u8 = vec_lvsr(1,(_118 *)p);
+ s8 = vec_ld(1,(const signed char *)p);
+ s8 = vec_ld(1,(_118 *)p);
+ s8 = vec_lde(1,(const signed char *)p);
+ s8 = vec_lde(1,(_118 *)p);
+ s8 = vec_ldl(1,(const signed char *)p);
+ s8 = vec_ldl(1,(_118 *)p);
+ vec_dst((const signed char *)p,1,1);
+ vec_dstst((const signed char *)p,1,1);
+ vec_dststt((const signed char *)p,1,1);
+ vec_dstt((const signed char *)p,1,1);
+ vec_dst((_118 *)p,1,1);
+ vec_dstst((_118 *)p,1,1);
+ vec_dststt((_118 *)p,1,1);
+ vec_dstt((_118 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile signed char *)p);
+ u8 = vec_lvsl(1,(_119 *)p);
+ u8 = vec_lvsr(1,( volatile signed char *)p);
+ u8 = vec_lvsr(1,(_119 *)p);
+ u8 = vec_lvsl(1,( signed char *)p);
+ u8 = vec_lvsl(1,(_120 *)p);
+ u8 = vec_lvsr(1,( signed char *)p);
+ u8 = vec_lvsr(1,(_120 *)p);
+ s8 = vec_ld(1,( signed char *)p);
+ s8 = vec_ld(1,(_120 *)p);
+ s8 = vec_lde(1,( signed char *)p);
+ s8 = vec_lde(1,(_120 *)p);
+ s8 = vec_ldl(1,( signed char *)p);
+ s8 = vec_ldl(1,(_120 *)p);
+ vec_dst(( signed char *)p,1,1);
+ vec_dstst(( signed char *)p,1,1);
+ vec_dststt(( signed char *)p,1,1);
+ vec_dstt(( signed char *)p,1,1);
+ vec_dst((_120 *)p,1,1);
+ vec_dstst((_120 *)p,1,1);
+ vec_dststt((_120 *)p,1,1);
+ vec_dstt((_120 *)p,1,1);
+ vec_st(s8,1,( signed char *)p);
+ vec_st(s8,1,(_120 *)p);
+ vec_ste(s8,1,( signed char *)p);
+ vec_ste(s8,1,(_120 *)p);
+ vec_stl(s8,1,( signed char *)p);
+ vec_stl(s8,1,(_120 *)p);
+ u8 = vec_lvsl(1,(const volatile float *)p);
+ u8 = vec_lvsl(1,(_121 *)p);
+ u8 = vec_lvsr(1,(const volatile float *)p);
+ u8 = vec_lvsr(1,(_121 *)p);
+ u8 = vec_lvsl(1,(const float *)p);
+ u8 = vec_lvsl(1,(_122 *)p);
+ u8 = vec_lvsr(1,(const float *)p);
+ u8 = vec_lvsr(1,(_122 *)p);
+ f32 = vec_ld(1,(const float *)p);
+ f32 = vec_ld(1,(_122 *)p);
+ f32 = vec_lde(1,(const float *)p);
+ f32 = vec_lde(1,(_122 *)p);
+ f32 = vec_ldl(1,(const float *)p);
+ f32 = vec_ldl(1,(_122 *)p);
+ vec_dst((const float *)p,1,1);
+ vec_dstst((const float *)p,1,1);
+ vec_dststt((const float *)p,1,1);
+ vec_dstt((const float *)p,1,1);
+ vec_dst((_122 *)p,1,1);
+ vec_dstst((_122 *)p,1,1);
+ vec_dststt((_122 *)p,1,1);
+ vec_dstt((_122 *)p,1,1);
+ u8 = vec_lvsl(1,( volatile float *)p);
+ u8 = vec_lvsl(1,(_123 *)p);
+ u8 = vec_lvsr(1,( volatile float *)p);
+ u8 = vec_lvsr(1,(_123 *)p);
+ u8 = vec_lvsl(1,( float *)p);
+ u8 = vec_lvsl(1,(_124 *)p);
+ u8 = vec_lvsr(1,( float *)p);
+ u8 = vec_lvsr(1,(_124 *)p);
+ f32 = vec_ld(1,( float *)p);
+ f32 = vec_ld(1,(_124 *)p);
+ f32 = vec_lde(1,( float *)p);
+ f32 = vec_lde(1,(_124 *)p);
+ f32 = vec_ldl(1,( float *)p);
+ f32 = vec_ldl(1,(_124 *)p);
+ vec_dst(( float *)p,1,1);
+ vec_dstst(( float *)p,1,1);
+ vec_dststt(( float *)p,1,1);
+ vec_dstt(( float *)p,1,1);
+ vec_dst((_124 *)p,1,1);
+ vec_dstst((_124 *)p,1,1);
+ vec_dststt((_124 *)p,1,1);
+ vec_dstt((_124 *)p,1,1);
+ vec_st(f32,1,( float *)p);
+ vec_st(f32,1,(_124 *)p);
+ vec_ste(f32,1,( float *)p);
+ vec_ste(f32,1,(_124 *)p);
+ vec_stl(f32,1,( float *)p);
+ vec_stl(f32,1,(_124 *)p);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-02.c
new file mode 100644
index 000000000..1d105dde4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-02.c
@@ -0,0 +1,17 @@
+#include "harness.h"
+
+vector unsigned char u8;
+
+static void f(void *p)
+{
+ u8 = vec_ld(1, (unsigned char *)p);
+}
+
+static void test()
+{
+ static vector unsigned int value = {1,-2,3,-4};
+ static vector unsigned int buffer[2];
+ buffer[1] = value;
+ f((void *)(-1+(char*)(buffer+1)));
+ check(vec_all_eq((vector unsigned int) u8, value), "u8");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-03.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-03.c
new file mode 100644
index 000000000..2228c0357
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3c-03.c
@@ -0,0 +1,17 @@
+#include "harness.h"
+
+vector unsigned char u8;
+
+static void f(int i, void *p)
+{
+ u8 = vec_ld(i, (unsigned char *)p);
+}
+
+static void test()
+{
+ static vector unsigned int value = {1,-2,3,-4};
+ static vector unsigned int buffer[2];
+ buffer[1] = value;
+ f(37,(void *)(-37+(char*)(buffer+1)));
+ check(vec_all_eq((vector unsigned int) u8, value), "u8");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3d-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3d-01.c
new file mode 100644
index 000000000..48657c866
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/3d-01.c
@@ -0,0 +1,171 @@
+/* { dg-do compile } */
+#include <altivec.h>
+int i;
+
+void
+test_vec_all_gt(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_all_gt(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_all_le(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_all_le(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_any_gt(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_any_gt(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_any_le(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_any_le(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_all_lt(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_all_lt(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_all_ge(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_all_ge(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_any_lt(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_any_lt(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_any_ge(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_any_ge(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_all_eq(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_all_eq(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_all_ne(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_all_ne(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_any_eq(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_any_eq(u8a, u8b))
+ i = 1;
+}
+
+void
+test_vec_any_ne(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (vec_any_ne(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_all_gt(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_all_gt(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_all_le(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_all_le(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_any_gt(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_any_gt(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_any_le(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_any_le(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_all_lt(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_all_lt(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_all_ge(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_all_ge(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_any_lt(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_any_lt(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_any_ge(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_any_ge(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_all_eq(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_all_eq(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_all_ne(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_all_ne(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_any_eq(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_any_eq(u8a, u8b))
+ i = 1;
+}
+
+void
+test_not_vec_any_ne(vector unsigned char u8a, vector unsigned char u8b)
+{
+ if (!vec_any_ne(u8a, u8b))
+ i = 1;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/4-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/4-01.c
new file mode 100644
index 000000000..f454a2eda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/4-01.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector unsigned int
+f(vector signed char a)
+{
+ return (vector unsigned int)(a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/4-03.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/4-03.c
new file mode 100644
index 000000000..1c3ccd746
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/4-03.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector unsigned int
+f(vector signed char a)
+{
+ return (vector unsigned int)a;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-01.c
new file mode 100644
index 000000000..c3cb6e990
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-01.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector unsigned int a = {1,1,1,1};
+vector unsigned int b = {1,2,3,4};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-02.c
new file mode 100644
index 000000000..0bb4eb008
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-02.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector float a = {1,1,1,1};
+vector float b = {1,2.0,3,4U};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-03.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-03.c
new file mode 100644
index 000000000..3d048e87b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-03.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector unsigned char u8 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+vector signed char s8 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+vector bool char b8 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+vector unsigned short u16 = {1,1,1,1,1,1,1,1};
+vector signed short s16 = {1,1,1,1,1,1,1,1};
+vector bool short b16 = {1,1,1,1,1,1,1,1};
+vector unsigned int u32 = {1,1,1,1};
+vector signed int s32 = {1,1,1,1};
+vector bool int b32 = {1,1,1,1};
+vector float f32 = {1,1,1,1};
+vector pixel p16 = {1,1,1,1,1,1,1,1};
+
+vector unsigned char u8_
+ = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+vector signed char s8_
+ = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+vector bool char b8_
+ = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+vector unsigned short u16_ = {1,2,3,4,5,6,7,8};
+vector signed short s16_ = {1,2,3,4,5,6,7,8};
+vector bool short b16_ = {1,2,3,4,5,6,7,8};
+vector unsigned int u32_ = {1,2,3,4};
+vector signed int s32_ = {1,2,3,4};
+vector bool int b32_ = {1,2,3,4};
+vector float f32_ = {1,2,3,4};
+vector pixel p16_ = {1,2,3,4,5,6,7,8};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-04.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-04.c
new file mode 100644
index 000000000..c5135e888
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-04.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector unsigned int a;
+vector unsigned int b;
+void
+f(void)
+{
+ a = ((vector unsigned int){1,1,1,1});
+ b = ((vector unsigned int){1,2,3,4});
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-07t.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-07t.c
new file mode 100644
index 000000000..c03e6558f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-07t.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+#include <altivec.h>
+typedef vector unsigned char t_u8;
+typedef vector signed char t_s8;
+typedef vector bool char t_b8;
+typedef vector unsigned short t_u16;
+typedef vector signed short t_s16;
+typedef vector bool short t_b16;
+typedef vector unsigned int t_u32;
+typedef vector signed int t_s32;
+typedef vector bool int t_b32;
+typedef vector float t_f32;
+typedef vector pixel t_p16;
+
+t_u8 u8 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+t_s8 s8 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+t_b8 b8 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+t_u16 u16 = {1,1,1,1,1,1,1,1};
+t_s16 s16 = {1,1,1,1,1,1,1,1};
+t_b16 b16 = {1,1,1,1,1,1,1,1};
+t_u32 u32 = {1,1,1,1};
+t_s32 s32 = {1,1,1,1};
+t_b32 b32 = {1,1,1,1};
+t_f32 f32 = {1,1,1,1};
+t_p16 p16 = {1,1,1,1,1,1,1,1};
+
+t_u8 u8_ = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+t_s8 s8_ = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+t_b8 b8_ = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+t_u16 u16_ = {1,2,3,4,5,6,7,8};
+t_s16 s16_ = {1,2,3,4,5,6,7,8};
+t_b16 b16_ = {1,2,3,4,5,6,7,8};
+t_u32 u32_ = {1,2,3,4};
+t_s32 s32_ = {1,2,3,4};
+t_b32 b32_ = {1,2,3,4};
+t_f32 f32_ = {1,2,3,4};
+t_p16 p16_ = {1,2,3,4,5,6,7,8};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-10.c
new file mode 100644
index 000000000..5f1b6ddc1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-10.c
@@ -0,0 +1,1352 @@
+/* { dg-do compile } */
+#include <altivec.h>
+void fu32a(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){0,0,0,0});
+ *u32++ = ((vector unsigned int){1,1,1,1});
+ *u32++ = ((vector unsigned int){2,2,2,2});
+ *u32++ = ((vector unsigned int){3,3,3,3});
+ *u32++ = ((vector unsigned int){4,4,4,4});
+ *u32++ = ((vector unsigned int){5,5,5,5});
+ *u32++ = ((vector unsigned int){6,6,6,6});
+ *u32++ = ((vector unsigned int){7,7,7,7});
+ *u32++ = ((vector unsigned int){8,8,8,8});
+ *u32++ = ((vector unsigned int){9,9,9,9});
+ *u32++ = ((vector unsigned int){10,10,10,10});
+ *u32++ = ((vector unsigned int){11,11,11,11});
+ *u32++ = ((vector unsigned int){12,12,12,12});
+ *u32++ = ((vector unsigned int){13,13,13,13});
+ *u32++ = ((vector unsigned int){14,14,14,14});
+ *u32++ = ((vector unsigned int){15,15,15,15});
+}
+void fu32b(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){65537,65537,65537,65537});
+ *u32++ = ((vector unsigned int){131074,131074,131074,131074});
+ *u32++ = ((vector unsigned int){196611,196611,196611,196611});
+ *u32++ = ((vector unsigned int){262148,262148,262148,262148});
+ *u32++ = ((vector unsigned int){327685,327685,327685,327685});
+ *u32++ = ((vector unsigned int){393222,393222,393222,393222});
+ *u32++ = ((vector unsigned int){458759,458759,458759,458759});
+ *u32++ = ((vector unsigned int){524296,524296,524296,524296});
+ *u32++ = ((vector unsigned int){589833,589833,589833,589833});
+ *u32++ = ((vector unsigned int){655370,655370,655370,655370});
+ *u32++ = ((vector unsigned int){720907,720907,720907,720907});
+ *u32++ = ((vector unsigned int){786444,786444,786444,786444});
+ *u32++ = ((vector unsigned int){851981,851981,851981,851981});
+ *u32++ = ((vector unsigned int){917518,917518,917518,917518});
+ *u32++ = ((vector unsigned int){983055,983055,983055,983055});
+}
+void fu32c(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){16843009,16843009,16843009,16843009});
+ *u32++ = ((vector unsigned int){33686018,33686018,33686018,33686018});
+ *u32++ = ((vector unsigned int){50529027,50529027,50529027,50529027});
+ *u32++ = ((vector unsigned int){67372036,67372036,67372036,67372036});
+ *u32++ = ((vector unsigned int){84215045,84215045,84215045,84215045});
+ *u32++ = ((vector unsigned int){101058054,101058054,101058054,101058054});
+ *u32++ = ((vector unsigned int){117901063,117901063,117901063,117901063});
+ *u32++ = ((vector unsigned int){134744072,134744072,134744072,134744072});
+ *u32++ = ((vector unsigned int){151587081,151587081,151587081,151587081});
+ *u32++ = ((vector unsigned int){168430090,168430090,168430090,168430090});
+ *u32++ = ((vector unsigned int){185273099,185273099,185273099,185273099});
+ *u32++ = ((vector unsigned int){202116108,202116108,202116108,202116108});
+ *u32++ = ((vector unsigned int){218959117,218959117,218959117,218959117});
+ *u32++ = ((vector unsigned int){235802126,235802126,235802126,235802126});
+ *u32++ = ((vector unsigned int){252645135,252645135,252645135,252645135});
+}
+void fu32d(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){4042322160,4042322160,4042322160,4042322160});
+ *u32++ = ((vector unsigned int){4059165169,4059165169,4059165169,4059165169});
+ *u32++ = ((vector unsigned int){4076008178,4076008178,4076008178,4076008178});
+ *u32++ = ((vector unsigned int){4092851187,4092851187,4092851187,4092851187});
+ *u32++ = ((vector unsigned int){4109694196,4109694196,4109694196,4109694196});
+ *u32++ = ((vector unsigned int){4126537205,4126537205,4126537205,4126537205});
+ *u32++ = ((vector unsigned int){4143380214,4143380214,4143380214,4143380214});
+ *u32++ = ((vector unsigned int){4160223223,4160223223,4160223223,4160223223});
+ *u32++ = ((vector unsigned int){4177066232,4177066232,4177066232,4177066232});
+ *u32++ = ((vector unsigned int){4193909241,4193909241,4193909241,4193909241});
+ *u32++ = ((vector unsigned int){4210752250,4210752250,4210752250,4210752250});
+ *u32++ = ((vector unsigned int){4227595259,4227595259,4227595259,4227595259});
+ *u32++ = ((vector unsigned int){4244438268,4244438268,4244438268,4244438268});
+ *u32++ = ((vector unsigned int){4261281277,4261281277,4261281277,4261281277});
+ *u32++ = ((vector unsigned int){4278124286,4278124286,4278124286,4278124286});
+}
+void fu32e(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){4293984240,4293984240,4293984240,4293984240});
+ *u32++ = ((vector unsigned int){4294049777,4294049777,4294049777,4294049777});
+ *u32++ = ((vector unsigned int){4294115314,4294115314,4294115314,4294115314});
+ *u32++ = ((vector unsigned int){4294180851,4294180851,4294180851,4294180851});
+ *u32++ = ((vector unsigned int){4294246388,4294246388,4294246388,4294246388});
+ *u32++ = ((vector unsigned int){4294311925,4294311925,4294311925,4294311925});
+ *u32++ = ((vector unsigned int){4294377462,4294377462,4294377462,4294377462});
+ *u32++ = ((vector unsigned int){4294442999,4294442999,4294442999,4294442999});
+ *u32++ = ((vector unsigned int){4294508536,4294508536,4294508536,4294508536});
+ *u32++ = ((vector unsigned int){4294574073,4294574073,4294574073,4294574073});
+ *u32++ = ((vector unsigned int){4294639610,4294639610,4294639610,4294639610});
+ *u32++ = ((vector unsigned int){4294705147,4294705147,4294705147,4294705147});
+ *u32++ = ((vector unsigned int){4294770684,4294770684,4294770684,4294770684});
+ *u32++ = ((vector unsigned int){4294836221,4294836221,4294836221,4294836221});
+ *u32++ = ((vector unsigned int){4294901758,4294901758,4294901758,4294901758});
+}
+void fu32f(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){4294967280,4294967280,4294967280,4294967280});
+ *u32++ = ((vector unsigned int){4294967281,4294967281,4294967281,4294967281});
+ *u32++ = ((vector unsigned int){4294967282,4294967282,4294967282,4294967282});
+ *u32++ = ((vector unsigned int){4294967283,4294967283,4294967283,4294967283});
+ *u32++ = ((vector unsigned int){4294967284,4294967284,4294967284,4294967284});
+ *u32++ = ((vector unsigned int){4294967285,4294967285,4294967285,4294967285});
+ *u32++ = ((vector unsigned int){4294967286,4294967286,4294967286,4294967286});
+ *u32++ = ((vector unsigned int){4294967287,4294967287,4294967287,4294967287});
+ *u32++ = ((vector unsigned int){4294967288,4294967288,4294967288,4294967288});
+ *u32++ = ((vector unsigned int){4294967289,4294967289,4294967289,4294967289});
+ *u32++ = ((vector unsigned int){4294967290,4294967290,4294967290,4294967290});
+ *u32++ = ((vector unsigned int){4294967291,4294967291,4294967291,4294967291});
+ *u32++ = ((vector unsigned int){4294967292,4294967292,4294967292,4294967292});
+ *u32++ = ((vector unsigned int){4294967293,4294967293,4294967293,4294967293});
+ *u32++ = ((vector unsigned int){4294967294,4294967294,4294967294,4294967294});
+ *u32++ = ((vector unsigned int){4294967295,4294967295,4294967295,4294967295});
+}
+void fu32g(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){-252645136,-252645136,-252645136,-252645136});
+ *u32++ = ((vector unsigned int){-235802127,-235802127,-235802127,-235802127});
+ *u32++ = ((vector unsigned int){-218959118,-218959118,-218959118,-218959118});
+ *u32++ = ((vector unsigned int){-202116109,-202116109,-202116109,-202116109});
+ *u32++ = ((vector unsigned int){-185273100,-185273100,-185273100,-185273100});
+ *u32++ = ((vector unsigned int){-168430091,-168430091,-168430091,-168430091});
+ *u32++ = ((vector unsigned int){-151587082,-151587082,-151587082,-151587082});
+ *u32++ = ((vector unsigned int){-134744073,-134744073,-134744073,-134744073});
+ *u32++ = ((vector unsigned int){-117901064,-117901064,-117901064,-117901064});
+ *u32++ = ((vector unsigned int){-101058055,-101058055,-101058055,-101058055});
+ *u32++ = ((vector unsigned int){-84215046,-84215046,-84215046,-84215046});
+ *u32++ = ((vector unsigned int){-67372037,-67372037,-67372037,-67372037});
+ *u32++ = ((vector unsigned int){-50529028,-50529028,-50529028,-50529028});
+ *u32++ = ((vector unsigned int){-33686019,-33686019,-33686019,-33686019});
+ *u32++ = ((vector unsigned int){-16843010,-16843010,-16843010,-16843010});
+}
+void fu32h(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){-983056,-983056,-983056,-983056});
+ *u32++ = ((vector unsigned int){-917519,-917519,-917519,-917519});
+ *u32++ = ((vector unsigned int){-851982,-851982,-851982,-851982});
+ *u32++ = ((vector unsigned int){-786445,-786445,-786445,-786445});
+ *u32++ = ((vector unsigned int){-720908,-720908,-720908,-720908});
+ *u32++ = ((vector unsigned int){-655371,-655371,-655371,-655371});
+ *u32++ = ((vector unsigned int){-589834,-589834,-589834,-589834});
+ *u32++ = ((vector unsigned int){-524297,-524297,-524297,-524297});
+ *u32++ = ((vector unsigned int){-458760,-458760,-458760,-458760});
+ *u32++ = ((vector unsigned int){-393223,-393223,-393223,-393223});
+ *u32++ = ((vector unsigned int){-327686,-327686,-327686,-327686});
+ *u32++ = ((vector unsigned int){-262149,-262149,-262149,-262149});
+ *u32++ = ((vector unsigned int){-196612,-196612,-196612,-196612});
+ *u32++ = ((vector unsigned int){-131075,-131075,-131075,-131075});
+ *u32++ = ((vector unsigned int){-65538,-65538,-65538,-65538});
+}
+void fu32i(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){-16,-16,-16,-16});
+ *u32++ = ((vector unsigned int){-15,-15,-15,-15});
+ *u32++ = ((vector unsigned int){-14,-14,-14,-14});
+ *u32++ = ((vector unsigned int){-13,-13,-13,-13});
+ *u32++ = ((vector unsigned int){-12,-12,-12,-12});
+ *u32++ = ((vector unsigned int){-11,-11,-11,-11});
+ *u32++ = ((vector unsigned int){-10,-10,-10,-10});
+ *u32++ = ((vector unsigned int){-9,-9,-9,-9});
+ *u32++ = ((vector unsigned int){-8,-8,-8,-8});
+ *u32++ = ((vector unsigned int){-7,-7,-7,-7});
+ *u32++ = ((vector unsigned int){-6,-6,-6,-6});
+ *u32++ = ((vector unsigned int){-5,-5,-5,-5});
+ *u32++ = ((vector unsigned int){-4,-4,-4,-4});
+ *u32++ = ((vector unsigned int){-3,-3,-3,-3});
+ *u32++ = ((vector unsigned int){-2,-2,-2,-2});
+ *u32++ = ((vector unsigned int){-1,-1,-1,-1});
+}
+void fu32j(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0});
+ *u32++ = ((vector unsigned int){0xfffffff1,0xfffffff1,0xfffffff1,0xfffffff1});
+ *u32++ = ((vector unsigned int){0xfffffff2,0xfffffff2,0xfffffff2,0xfffffff2});
+ *u32++ = ((vector unsigned int){0xfffffff3,0xfffffff3,0xfffffff3,0xfffffff3});
+ *u32++ = ((vector unsigned int){0xfffffff4,0xfffffff4,0xfffffff4,0xfffffff4});
+ *u32++ = ((vector unsigned int){0xfffffff5,0xfffffff5,0xfffffff5,0xfffffff5});
+ *u32++ = ((vector unsigned int){0xfffffff6,0xfffffff6,0xfffffff6,0xfffffff6});
+ *u32++ = ((vector unsigned int){0xfffffff7,0xfffffff7,0xfffffff7,0xfffffff7});
+ *u32++ = ((vector unsigned int){0xfffffff8,0xfffffff8,0xfffffff8,0xfffffff8});
+ *u32++ = ((vector unsigned int){0xfffffff9,0xfffffff9,0xfffffff9,0xfffffff9});
+ *u32++ = ((vector unsigned int){0xfffffffa,0xfffffffa,0xfffffffa,0xfffffffa});
+ *u32++ = ((vector unsigned int){0xfffffffb,0xfffffffb,0xfffffffb,0xfffffffb});
+ *u32++ = ((vector unsigned int){0xfffffffc,0xfffffffc,0xfffffffc,0xfffffffc});
+ *u32++ = ((vector unsigned int){0xfffffffd,0xfffffffd,0xfffffffd,0xfffffffd});
+ *u32++ = ((vector unsigned int){0xfffffffe,0xfffffffe,0xfffffffe,0xfffffffe});
+ *u32++ = ((vector unsigned int){0xffffffff,0xffffffff,0xffffffff,0xffffffff});
+}
+void fu32k(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){0x00000000,0x00000000,0x00000000,0x00000000});
+ *u32++ = ((vector unsigned int){0x00000001,0x00000001,0x00000001,0x00000001});
+ *u32++ = ((vector unsigned int){0x00000002,0x00000002,0x00000002,0x00000002});
+ *u32++ = ((vector unsigned int){0x00000003,0x00000003,0x00000003,0x00000003});
+ *u32++ = ((vector unsigned int){0x00000004,0x00000004,0x00000004,0x00000004});
+ *u32++ = ((vector unsigned int){0x00000005,0x00000005,0x00000005,0x00000005});
+ *u32++ = ((vector unsigned int){0x00000006,0x00000006,0x00000006,0x00000006});
+ *u32++ = ((vector unsigned int){0x00000007,0x00000007,0x00000007,0x00000007});
+ *u32++ = ((vector unsigned int){0x00000008,0x00000008,0x00000008,0x00000008});
+ *u32++ = ((vector unsigned int){0x00000009,0x00000009,0x00000009,0x00000009});
+ *u32++ = ((vector unsigned int){0x0000000a,0x0000000a,0x0000000a,0x0000000a});
+ *u32++ = ((vector unsigned int){0x0000000b,0x0000000b,0x0000000b,0x0000000b});
+ *u32++ = ((vector unsigned int){0x0000000c,0x0000000c,0x0000000c,0x0000000c});
+ *u32++ = ((vector unsigned int){0x0000000d,0x0000000d,0x0000000d,0x0000000d});
+ *u32++ = ((vector unsigned int){0x0000000e,0x0000000e,0x0000000e,0x0000000e});
+ *u32++ = ((vector unsigned int){0x0000000f,0x0000000f,0x0000000f,0x0000000f});
+}
+void fu32l(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){0xfff0fff0,0xfff0fff0,0xfff0fff0,0xfff0fff0});
+ *u32++ = ((vector unsigned int){0xfff1fff1,0xfff1fff1,0xfff1fff1,0xfff1fff1});
+ *u32++ = ((vector unsigned int){0xfff2fff2,0xfff2fff2,0xfff2fff2,0xfff2fff2});
+ *u32++ = ((vector unsigned int){0xfff3fff3,0xfff3fff3,0xfff3fff3,0xfff3fff3});
+ *u32++ = ((vector unsigned int){0xfff4fff4,0xfff4fff4,0xfff4fff4,0xfff4fff4});
+ *u32++ = ((vector unsigned int){0xfff5fff5,0xfff5fff5,0xfff5fff5,0xfff5fff5});
+ *u32++ = ((vector unsigned int){0xfff6fff6,0xfff6fff6,0xfff6fff6,0xfff6fff6});
+ *u32++ = ((vector unsigned int){0xfff7fff7,0xfff7fff7,0xfff7fff7,0xfff7fff7});
+ *u32++ = ((vector unsigned int){0xfff8fff8,0xfff8fff8,0xfff8fff8,0xfff8fff8});
+ *u32++ = ((vector unsigned int){0xfff9fff9,0xfff9fff9,0xfff9fff9,0xfff9fff9});
+ *u32++ = ((vector unsigned int){0xfffafffa,0xfffafffa,0xfffafffa,0xfffafffa});
+ *u32++ = ((vector unsigned int){0xfffbfffb,0xfffbfffb,0xfffbfffb,0xfffbfffb});
+ *u32++ = ((vector unsigned int){0xfffcfffc,0xfffcfffc,0xfffcfffc,0xfffcfffc});
+ *u32++ = ((vector unsigned int){0xfffdfffd,0xfffdfffd,0xfffdfffd,0xfffdfffd});
+ *u32++ = ((vector unsigned int){0xfffefffe,0xfffefffe,0xfffefffe,0xfffefffe});
+ *u32++ = ((vector unsigned int){0xffffffff,0xffffffff,0xffffffff,0xffffffff});
+}
+void fu32m(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){0x00000000,0x00000000,0x00000000,0x00000000});
+ *u32++ = ((vector unsigned int){0x00010001,0x00010001,0x00010001,0x00010001});
+ *u32++ = ((vector unsigned int){0x00020002,0x00020002,0x00020002,0x00020002});
+ *u32++ = ((vector unsigned int){0x00030003,0x00030003,0x00030003,0x00030003});
+ *u32++ = ((vector unsigned int){0x00040004,0x00040004,0x00040004,0x00040004});
+ *u32++ = ((vector unsigned int){0x00050005,0x00050005,0x00050005,0x00050005});
+ *u32++ = ((vector unsigned int){0x00060006,0x00060006,0x00060006,0x00060006});
+ *u32++ = ((vector unsigned int){0x00070007,0x00070007,0x00070007,0x00070007});
+ *u32++ = ((vector unsigned int){0x00080008,0x00080008,0x00080008,0x00080008});
+ *u32++ = ((vector unsigned int){0x00090009,0x00090009,0x00090009,0x00090009});
+ *u32++ = ((vector unsigned int){0x000a000a,0x000a000a,0x000a000a,0x000a000a});
+ *u32++ = ((vector unsigned int){0x000b000b,0x000b000b,0x000b000b,0x000b000b});
+ *u32++ = ((vector unsigned int){0x000c000c,0x000c000c,0x000c000c,0x000c000c});
+ *u32++ = ((vector unsigned int){0x000d000d,0x000d000d,0x000d000d,0x000d000d});
+ *u32++ = ((vector unsigned int){0x000e000e,0x000e000e,0x000e000e,0x000e000e});
+ *u32++ = ((vector unsigned int){0x000f000f,0x000f000f,0x000f000f,0x000f000f});
+}
+void fu32n(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){0xf0f0f0f0,0xf0f0f0f0,0xf0f0f0f0,0xf0f0f0f0});
+ *u32++ = ((vector unsigned int){0xf1f1f1f1,0xf1f1f1f1,0xf1f1f1f1,0xf1f1f1f1});
+ *u32++ = ((vector unsigned int){0xf2f2f2f2,0xf2f2f2f2,0xf2f2f2f2,0xf2f2f2f2});
+ *u32++ = ((vector unsigned int){0xf3f3f3f3,0xf3f3f3f3,0xf3f3f3f3,0xf3f3f3f3});
+ *u32++ = ((vector unsigned int){0xf4f4f4f4,0xf4f4f4f4,0xf4f4f4f4,0xf4f4f4f4});
+ *u32++ = ((vector unsigned int){0xf5f5f5f5,0xf5f5f5f5,0xf5f5f5f5,0xf5f5f5f5});
+ *u32++ = ((vector unsigned int){0xf6f6f6f6,0xf6f6f6f6,0xf6f6f6f6,0xf6f6f6f6});
+ *u32++ = ((vector unsigned int){0xf7f7f7f7,0xf7f7f7f7,0xf7f7f7f7,0xf7f7f7f7});
+ *u32++ = ((vector unsigned int){0xf8f8f8f8,0xf8f8f8f8,0xf8f8f8f8,0xf8f8f8f8});
+ *u32++ = ((vector unsigned int){0xf9f9f9f9,0xf9f9f9f9,0xf9f9f9f9,0xf9f9f9f9});
+ *u32++ = ((vector unsigned int){0xfafafafa,0xfafafafa,0xfafafafa,0xfafafafa});
+ *u32++ = ((vector unsigned int){0xfbfbfbfb,0xfbfbfbfb,0xfbfbfbfb,0xfbfbfbfb});
+ *u32++ = ((vector unsigned int){0xfcfcfcfc,0xfcfcfcfc,0xfcfcfcfc,0xfcfcfcfc});
+ *u32++ = ((vector unsigned int){0xfdfdfdfd,0xfdfdfdfd,0xfdfdfdfd,0xfdfdfdfd});
+ *u32++ = ((vector unsigned int){0xfefefefe,0xfefefefe,0xfefefefe,0xfefefefe});
+ *u32++ = ((vector unsigned int){0xffffffff,0xffffffff,0xffffffff,0xffffffff});
+}
+void fu32o(vector unsigned int *u32)
+{
+ *u32++ = ((vector unsigned int){0x00000000,0x00000000,0x00000000,0x00000000});
+ *u32++ = ((vector unsigned int){0x01010101,0x01010101,0x01010101,0x01010101});
+ *u32++ = ((vector unsigned int){0x02020202,0x02020202,0x02020202,0x02020202});
+ *u32++ = ((vector unsigned int){0x03030303,0x03030303,0x03030303,0x03030303});
+ *u32++ = ((vector unsigned int){0x04040404,0x04040404,0x04040404,0x04040404});
+ *u32++ = ((vector unsigned int){0x05050505,0x05050505,0x05050505,0x05050505});
+ *u32++ = ((vector unsigned int){0x06060606,0x06060606,0x06060606,0x06060606});
+ *u32++ = ((vector unsigned int){0x07070707,0x07070707,0x07070707,0x07070707});
+ *u32++ = ((vector unsigned int){0x08080808,0x08080808,0x08080808,0x08080808});
+ *u32++ = ((vector unsigned int){0x09090909,0x09090909,0x09090909,0x09090909});
+ *u32++ = ((vector unsigned int){0x0a0a0a0a,0x0a0a0a0a,0x0a0a0a0a,0x0a0a0a0a});
+ *u32++ = ((vector unsigned int){0x0b0b0b0b,0x0b0b0b0b,0x0b0b0b0b,0x0b0b0b0b});
+ *u32++ = ((vector unsigned int){0x0c0c0c0c,0x0c0c0c0c,0x0c0c0c0c,0x0c0c0c0c});
+ *u32++ = ((vector unsigned int){0x0d0d0d0d,0x0d0d0d0d,0x0d0d0d0d,0x0d0d0d0d});
+ *u32++ = ((vector unsigned int){0x0e0e0e0e,0x0e0e0e0e,0x0e0e0e0e,0x0e0e0e0e});
+ *u32++ = ((vector unsigned int){0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f});
+}
+void fu16a(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){0xffff,0xfff0,0xffff,0xfff0,0xffff,0xfff0,0xffff,0xfff0});
+ *u16++ = ((vector unsigned short){0xffff,0xfff1,0xffff,0xfff1,0xffff,0xfff1,0xffff,0xfff1});
+ *u16++ = ((vector unsigned short){0xffff,0xfff2,0xffff,0xfff2,0xffff,0xfff2,0xffff,0xfff2});
+ *u16++ = ((vector unsigned short){0xffff,0xfff3,0xffff,0xfff3,0xffff,0xfff3,0xffff,0xfff3});
+ *u16++ = ((vector unsigned short){0xffff,0xfff4,0xffff,0xfff4,0xffff,0xfff4,0xffff,0xfff4});
+ *u16++ = ((vector unsigned short){0xffff,0xfff5,0xffff,0xfff5,0xffff,0xfff5,0xffff,0xfff5});
+ *u16++ = ((vector unsigned short){0xffff,0xfff6,0xffff,0xfff6,0xffff,0xfff6,0xffff,0xfff6});
+ *u16++ = ((vector unsigned short){0xffff,0xfff7,0xffff,0xfff7,0xffff,0xfff7,0xffff,0xfff7});
+ *u16++ = ((vector unsigned short){0xffff,0xfff8,0xffff,0xfff8,0xffff,0xfff8,0xffff,0xfff8});
+ *u16++ = ((vector unsigned short){0xffff,0xfff9,0xffff,0xfff9,0xffff,0xfff9,0xffff,0xfff9});
+ *u16++ = ((vector unsigned short){0xffff,0xfffa,0xffff,0xfffa,0xffff,0xfffa,0xffff,0xfffa});
+ *u16++ = ((vector unsigned short){0xffff,0xfffb,0xffff,0xfffb,0xffff,0xfffb,0xffff,0xfffb});
+ *u16++ = ((vector unsigned short){0xffff,0xfffc,0xffff,0xfffc,0xffff,0xfffc,0xffff,0xfffc});
+ *u16++ = ((vector unsigned short){0xffff,0xfffd,0xffff,0xfffd,0xffff,0xfffd,0xffff,0xfffd});
+ *u16++ = ((vector unsigned short){0xffff,0xfffe,0xffff,0xfffe,0xffff,0xfffe,0xffff,0xfffe});
+ *u16++ = ((vector unsigned short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff});
+}
+void fu16b(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000});
+ *u16++ = ((vector unsigned short){0x0000,0x0001,0x0000,0x0001,0x0000,0x0001,0x0000,0x0001});
+ *u16++ = ((vector unsigned short){0x0000,0x0002,0x0000,0x0002,0x0000,0x0002,0x0000,0x0002});
+ *u16++ = ((vector unsigned short){0x0000,0x0003,0x0000,0x0003,0x0000,0x0003,0x0000,0x0003});
+ *u16++ = ((vector unsigned short){0x0000,0x0004,0x0000,0x0004,0x0000,0x0004,0x0000,0x0004});
+ *u16++ = ((vector unsigned short){0x0000,0x0005,0x0000,0x0005,0x0000,0x0005,0x0000,0x0005});
+ *u16++ = ((vector unsigned short){0x0000,0x0006,0x0000,0x0006,0x0000,0x0006,0x0000,0x0006});
+ *u16++ = ((vector unsigned short){0x0000,0x0007,0x0000,0x0007,0x0000,0x0007,0x0000,0x0007});
+ *u16++ = ((vector unsigned short){0x0000,0x0008,0x0000,0x0008,0x0000,0x0008,0x0000,0x0008});
+ *u16++ = ((vector unsigned short){0x0000,0x0009,0x0000,0x0009,0x0000,0x0009,0x0000,0x0009});
+ *u16++ = ((vector unsigned short){0x0000,0x000a,0x0000,0x000a,0x0000,0x000a,0x0000,0x000a});
+ *u16++ = ((vector unsigned short){0x0000,0x000b,0x0000,0x000b,0x0000,0x000b,0x0000,0x000b});
+ *u16++ = ((vector unsigned short){0x0000,0x000c,0x0000,0x000c,0x0000,0x000c,0x0000,0x000c});
+ *u16++ = ((vector unsigned short){0x0000,0x000d,0x0000,0x000d,0x0000,0x000d,0x0000,0x000d});
+ *u16++ = ((vector unsigned short){0x0000,0x000e,0x0000,0x000e,0x0000,0x000e,0x0000,0x000e});
+ *u16++ = ((vector unsigned short){0x0000,0x000f,0x0000,0x000f,0x0000,0x000f,0x0000,0x000f});
+}
+void fu16c(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0});
+ *u16++ = ((vector unsigned short){0xfff1,0xfff1,0xfff1,0xfff1,0xfff1,0xfff1,0xfff1,0xfff1});
+ *u16++ = ((vector unsigned short){0xfff2,0xfff2,0xfff2,0xfff2,0xfff2,0xfff2,0xfff2,0xfff2});
+ *u16++ = ((vector unsigned short){0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3});
+ *u16++ = ((vector unsigned short){0xfff4,0xfff4,0xfff4,0xfff4,0xfff4,0xfff4,0xfff4,0xfff4});
+ *u16++ = ((vector unsigned short){0xfff5,0xfff5,0xfff5,0xfff5,0xfff5,0xfff5,0xfff5,0xfff5});
+ *u16++ = ((vector unsigned short){0xfff6,0xfff6,0xfff6,0xfff6,0xfff6,0xfff6,0xfff6,0xfff6});
+ *u16++ = ((vector unsigned short){0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7});
+ *u16++ = ((vector unsigned short){0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8});
+ *u16++ = ((vector unsigned short){0xfff9,0xfff9,0xfff9,0xfff9,0xfff9,0xfff9,0xfff9,0xfff9});
+ *u16++ = ((vector unsigned short){0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa});
+ *u16++ = ((vector unsigned short){0xfffb,0xfffb,0xfffb,0xfffb,0xfffb,0xfffb,0xfffb,0xfffb});
+ *u16++ = ((vector unsigned short){0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc});
+ *u16++ = ((vector unsigned short){0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd});
+ *u16++ = ((vector unsigned short){0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe});
+ *u16++ = ((vector unsigned short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff});
+}
+void fu16d(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000});
+ *u16++ = ((vector unsigned short){0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001});
+ *u16++ = ((vector unsigned short){0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002});
+ *u16++ = ((vector unsigned short){0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003});
+ *u16++ = ((vector unsigned short){0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004});
+ *u16++ = ((vector unsigned short){0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005});
+ *u16++ = ((vector unsigned short){0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006});
+ *u16++ = ((vector unsigned short){0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007});
+ *u16++ = ((vector unsigned short){0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008});
+ *u16++ = ((vector unsigned short){0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009});
+ *u16++ = ((vector unsigned short){0x000a,0x000a,0x000a,0x000a,0x000a,0x000a,0x000a,0x000a});
+ *u16++ = ((vector unsigned short){0x000b,0x000b,0x000b,0x000b,0x000b,0x000b,0x000b,0x000b});
+ *u16++ = ((vector unsigned short){0x000c,0x000c,0x000c,0x000c,0x000c,0x000c,0x000c,0x000c});
+ *u16++ = ((vector unsigned short){0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d});
+ *u16++ = ((vector unsigned short){0x000e,0x000e,0x000e,0x000e,0x000e,0x000e,0x000e,0x000e});
+ *u16++ = ((vector unsigned short){0x000f,0x000f,0x000f,0x000f,0x000f,0x000f,0x000f,0x000f});
+}
+void fu16e(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0});
+ *u16++ = ((vector unsigned short){0xf1f1,0xf1f1,0xf1f1,0xf1f1,0xf1f1,0xf1f1,0xf1f1,0xf1f1});
+ *u16++ = ((vector unsigned short){0xf2f2,0xf2f2,0xf2f2,0xf2f2,0xf2f2,0xf2f2,0xf2f2,0xf2f2});
+ *u16++ = ((vector unsigned short){0xf3f3,0xf3f3,0xf3f3,0xf3f3,0xf3f3,0xf3f3,0xf3f3,0xf3f3});
+ *u16++ = ((vector unsigned short){0xf4f4,0xf4f4,0xf4f4,0xf4f4,0xf4f4,0xf4f4,0xf4f4,0xf4f4});
+ *u16++ = ((vector unsigned short){0xf5f5,0xf5f5,0xf5f5,0xf5f5,0xf5f5,0xf5f5,0xf5f5,0xf5f5});
+ *u16++ = ((vector unsigned short){0xf6f6,0xf6f6,0xf6f6,0xf6f6,0xf6f6,0xf6f6,0xf6f6,0xf6f6});
+ *u16++ = ((vector unsigned short){0xf7f7,0xf7f7,0xf7f7,0xf7f7,0xf7f7,0xf7f7,0xf7f7,0xf7f7});
+ *u16++ = ((vector unsigned short){0xf8f8,0xf8f8,0xf8f8,0xf8f8,0xf8f8,0xf8f8,0xf8f8,0xf8f8});
+ *u16++ = ((vector unsigned short){0xf9f9,0xf9f9,0xf9f9,0xf9f9,0xf9f9,0xf9f9,0xf9f9,0xf9f9});
+ *u16++ = ((vector unsigned short){0xfafa,0xfafa,0xfafa,0xfafa,0xfafa,0xfafa,0xfafa,0xfafa});
+ *u16++ = ((vector unsigned short){0xfbfb,0xfbfb,0xfbfb,0xfbfb,0xfbfb,0xfbfb,0xfbfb,0xfbfb});
+ *u16++ = ((vector unsigned short){0xfcfc,0xfcfc,0xfcfc,0xfcfc,0xfcfc,0xfcfc,0xfcfc,0xfcfc});
+ *u16++ = ((vector unsigned short){0xfdfd,0xfdfd,0xfdfd,0xfdfd,0xfdfd,0xfdfd,0xfdfd,0xfdfd});
+ *u16++ = ((vector unsigned short){0xfefe,0xfefe,0xfefe,0xfefe,0xfefe,0xfefe,0xfefe,0xfefe});
+ *u16++ = ((vector unsigned short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff});
+}
+void fu16f(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000});
+ *u16++ = ((vector unsigned short){0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101});
+ *u16++ = ((vector unsigned short){0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202});
+ *u16++ = ((vector unsigned short){0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303});
+ *u16++ = ((vector unsigned short){0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404});
+ *u16++ = ((vector unsigned short){0x0505,0x0505,0x0505,0x0505,0x0505,0x0505,0x0505,0x0505});
+ *u16++ = ((vector unsigned short){0x0606,0x0606,0x0606,0x0606,0x0606,0x0606,0x0606,0x0606});
+ *u16++ = ((vector unsigned short){0x0707,0x0707,0x0707,0x0707,0x0707,0x0707,0x0707,0x0707});
+ *u16++ = ((vector unsigned short){0x0808,0x0808,0x0808,0x0808,0x0808,0x0808,0x0808,0x0808});
+ *u16++ = ((vector unsigned short){0x0909,0x0909,0x0909,0x0909,0x0909,0x0909,0x0909,0x0909});
+ *u16++ = ((vector unsigned short){0x0a0a,0x0a0a,0x0a0a,0x0a0a,0x0a0a,0x0a0a,0x0a0a,0x0a0a});
+ *u16++ = ((vector unsigned short){0x0b0b,0x0b0b,0x0b0b,0x0b0b,0x0b0b,0x0b0b,0x0b0b,0x0b0b});
+ *u16++ = ((vector unsigned short){0x0c0c,0x0c0c,0x0c0c,0x0c0c,0x0c0c,0x0c0c,0x0c0c,0x0c0c});
+ *u16++ = ((vector unsigned short){0x0d0d,0x0d0d,0x0d0d,0x0d0d,0x0d0d,0x0d0d,0x0d0d,0x0d0d});
+ *u16++ = ((vector unsigned short){0x0e0e,0x0e0e,0x0e0e,0x0e0e,0x0e0e,0x0e0e,0x0e0e,0x0e0e});
+ *u16++ = ((vector unsigned short){0x0f0f,0x0f0f,0x0f0f,0x0f0f,0x0f0f,0x0f0f,0x0f0f,0x0f0f});
+}
+void fu16g(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){0,0,0,0,0,0,0,0});
+ *u16++ = ((vector unsigned short){1,1,1,1,1,1,1,1});
+ *u16++ = ((vector unsigned short){2,2,2,2,2,2,2,2});
+ *u16++ = ((vector unsigned short){3,3,3,3,3,3,3,3});
+ *u16++ = ((vector unsigned short){4,4,4,4,4,4,4,4});
+ *u16++ = ((vector unsigned short){5,5,5,5,5,5,5,5});
+ *u16++ = ((vector unsigned short){6,6,6,6,6,6,6,6});
+ *u16++ = ((vector unsigned short){7,7,7,7,7,7,7,7});
+ *u16++ = ((vector unsigned short){8,8,8,8,8,8,8,8});
+ *u16++ = ((vector unsigned short){9,9,9,9,9,9,9,9});
+ *u16++ = ((vector unsigned short){10,10,10,10,10,10,10,10});
+ *u16++ = ((vector unsigned short){11,11,11,11,11,11,11,11});
+ *u16++ = ((vector unsigned short){12,12,12,12,12,12,12,12});
+ *u16++ = ((vector unsigned short){13,13,13,13,13,13,13,13});
+ *u16++ = ((vector unsigned short){14,14,14,14,14,14,14,14});
+ *u16++ = ((vector unsigned short){15,15,15,15,15,15,15,15});
+}
+void fu16h(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){257,257,257,257,257,257,257,257});
+ *u16++ = ((vector unsigned short){514,514,514,514,514,514,514,514});
+ *u16++ = ((vector unsigned short){771,771,771,771,771,771,771,771});
+ *u16++ = ((vector unsigned short){1028,1028,1028,1028,1028,1028,1028,1028});
+ *u16++ = ((vector unsigned short){1285,1285,1285,1285,1285,1285,1285,1285});
+ *u16++ = ((vector unsigned short){1542,1542,1542,1542,1542,1542,1542,1542});
+ *u16++ = ((vector unsigned short){1799,1799,1799,1799,1799,1799,1799,1799});
+ *u16++ = ((vector unsigned short){2056,2056,2056,2056,2056,2056,2056,2056});
+ *u16++ = ((vector unsigned short){2313,2313,2313,2313,2313,2313,2313,2313});
+ *u16++ = ((vector unsigned short){2570,2570,2570,2570,2570,2570,2570,2570});
+ *u16++ = ((vector unsigned short){2827,2827,2827,2827,2827,2827,2827,2827});
+ *u16++ = ((vector unsigned short){3084,3084,3084,3084,3084,3084,3084,3084});
+ *u16++ = ((vector unsigned short){3341,3341,3341,3341,3341,3341,3341,3341});
+ *u16++ = ((vector unsigned short){3598,3598,3598,3598,3598,3598,3598,3598});
+ *u16++ = ((vector unsigned short){3855,3855,3855,3855,3855,3855,3855,3855});
+}
+void fu16i(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){61680,61680,61680,61680,61680,61680,61680,61680});
+ *u16++ = ((vector unsigned short){61937,61937,61937,61937,61937,61937,61937,61937});
+ *u16++ = ((vector unsigned short){62194,62194,62194,62194,62194,62194,62194,62194});
+ *u16++ = ((vector unsigned short){62451,62451,62451,62451,62451,62451,62451,62451});
+ *u16++ = ((vector unsigned short){62708,62708,62708,62708,62708,62708,62708,62708});
+ *u16++ = ((vector unsigned short){62965,62965,62965,62965,62965,62965,62965,62965});
+ *u16++ = ((vector unsigned short){63222,63222,63222,63222,63222,63222,63222,63222});
+ *u16++ = ((vector unsigned short){63479,63479,63479,63479,63479,63479,63479,63479});
+ *u16++ = ((vector unsigned short){63736,63736,63736,63736,63736,63736,63736,63736});
+ *u16++ = ((vector unsigned short){63993,63993,63993,63993,63993,63993,63993,63993});
+ *u16++ = ((vector unsigned short){64250,64250,64250,64250,64250,64250,64250,64250});
+ *u16++ = ((vector unsigned short){64507,64507,64507,64507,64507,64507,64507,64507});
+ *u16++ = ((vector unsigned short){64764,64764,64764,64764,64764,64764,64764,64764});
+ *u16++ = ((vector unsigned short){65021,65021,65021,65021,65021,65021,65021,65021});
+ *u16++ = ((vector unsigned short){65278,65278,65278,65278,65278,65278,65278,65278});
+}
+void fu16j(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){65520,65520,65520,65520,65520,65520,65520,65520});
+ *u16++ = ((vector unsigned short){65521,65521,65521,65521,65521,65521,65521,65521});
+ *u16++ = ((vector unsigned short){65522,65522,65522,65522,65522,65522,65522,65522});
+ *u16++ = ((vector unsigned short){65523,65523,65523,65523,65523,65523,65523,65523});
+ *u16++ = ((vector unsigned short){65524,65524,65524,65524,65524,65524,65524,65524});
+ *u16++ = ((vector unsigned short){65525,65525,65525,65525,65525,65525,65525,65525});
+ *u16++ = ((vector unsigned short){65526,65526,65526,65526,65526,65526,65526,65526});
+ *u16++ = ((vector unsigned short){65527,65527,65527,65527,65527,65527,65527,65527});
+ *u16++ = ((vector unsigned short){65528,65528,65528,65528,65528,65528,65528,65528});
+ *u16++ = ((vector unsigned short){65529,65529,65529,65529,65529,65529,65529,65529});
+ *u16++ = ((vector unsigned short){65530,65530,65530,65530,65530,65530,65530,65530});
+ *u16++ = ((vector unsigned short){65531,65531,65531,65531,65531,65531,65531,65531});
+ *u16++ = ((vector unsigned short){65532,65532,65532,65532,65532,65532,65532,65532});
+ *u16++ = ((vector unsigned short){65533,65533,65533,65533,65533,65533,65533,65533});
+ *u16++ = ((vector unsigned short){65534,65534,65534,65534,65534,65534,65534,65534});
+ *u16++ = ((vector unsigned short){65535,65535,65535,65535,65535,65535,65535,65535});
+}
+void fu16k(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){-3856,-3856,-3856,-3856,-3856,-3856,-3856,-3856});
+ *u16++ = ((vector unsigned short){-3599,-3599,-3599,-3599,-3599,-3599,-3599,-3599});
+ *u16++ = ((vector unsigned short){-3342,-3342,-3342,-3342,-3342,-3342,-3342,-3342});
+ *u16++ = ((vector unsigned short){-3085,-3085,-3085,-3085,-3085,-3085,-3085,-3085});
+ *u16++ = ((vector unsigned short){-2828,-2828,-2828,-2828,-2828,-2828,-2828,-2828});
+ *u16++ = ((vector unsigned short){-2571,-2571,-2571,-2571,-2571,-2571,-2571,-2571});
+ *u16++ = ((vector unsigned short){-2314,-2314,-2314,-2314,-2314,-2314,-2314,-2314});
+ *u16++ = ((vector unsigned short){-2057,-2057,-2057,-2057,-2057,-2057,-2057,-2057});
+ *u16++ = ((vector unsigned short){-1800,-1800,-1800,-1800,-1800,-1800,-1800,-1800});
+ *u16++ = ((vector unsigned short){-1543,-1543,-1543,-1543,-1543,-1543,-1543,-1543});
+ *u16++ = ((vector unsigned short){-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286});
+ *u16++ = ((vector unsigned short){-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029});
+ *u16++ = ((vector unsigned short){-772,-772,-772,-772,-772,-772,-772,-772});
+ *u16++ = ((vector unsigned short){-515,-515,-515,-515,-515,-515,-515,-515});
+ *u16++ = ((vector unsigned short){-258,-258,-258,-258,-258,-258,-258,-258});
+}
+void fu16l(vector unsigned short *u16)
+{
+ *u16++ = ((vector unsigned short){-16,-16,-16,-16,-16,-16,-16,-16});
+ *u16++ = ((vector unsigned short){-15,-15,-15,-15,-15,-15,-15,-15});
+ *u16++ = ((vector unsigned short){-14,-14,-14,-14,-14,-14,-14,-14});
+ *u16++ = ((vector unsigned short){-13,-13,-13,-13,-13,-13,-13,-13});
+ *u16++ = ((vector unsigned short){-12,-12,-12,-12,-12,-12,-12,-12});
+ *u16++ = ((vector unsigned short){-11,-11,-11,-11,-11,-11,-11,-11});
+ *u16++ = ((vector unsigned short){-10,-10,-10,-10,-10,-10,-10,-10});
+ *u16++ = ((vector unsigned short){-9,-9,-9,-9,-9,-9,-9,-9});
+ *u16++ = ((vector unsigned short){-8,-8,-8,-8,-8,-8,-8,-8});
+ *u16++ = ((vector unsigned short){-7,-7,-7,-7,-7,-7,-7,-7});
+ *u16++ = ((vector unsigned short){-6,-6,-6,-6,-6,-6,-6,-6});
+ *u16++ = ((vector unsigned short){-5,-5,-5,-5,-5,-5,-5,-5});
+ *u16++ = ((vector unsigned short){-4,-4,-4,-4,-4,-4,-4,-4});
+ *u16++ = ((vector unsigned short){-3,-3,-3,-3,-3,-3,-3,-3});
+ *u16++ = ((vector unsigned short){-2,-2,-2,-2,-2,-2,-2,-2});
+ *u16++ = ((vector unsigned short){-1,-1,-1,-1,-1,-1,-1,-1});
+}
+void fu8a(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xf1});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf2,0xff,0xff,0xff,0xf2,0xff,0xff,0xff,0xf2,0xff,0xff,0xff,0xf2});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xf3});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf4,0xff,0xff,0xff,0xf4,0xff,0xff,0xff,0xf4,0xff,0xff,0xff,0xf4});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf5,0xff,0xff,0xff,0xf5,0xff,0xff,0xff,0xf5,0xff,0xff,0xff,0xf5});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf6,0xff,0xff,0xff,0xf6,0xff,0xff,0xff,0xf6,0xff,0xff,0xff,0xf6});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xf7});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xf8});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0xf9});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xfa,0xff,0xff,0xff,0xfa,0xff,0xff,0xff,0xfa,0xff,0xff,0xff,0xfa});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xfb});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xfd});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff});
+}
+void fu8b(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x05});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0a});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x0b});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0d});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x0e});
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x0f});
+}
+void fu8c(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0});
+ *u8++ = ((vector unsigned char){0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1});
+ *u8++ = ((vector unsigned char){0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2});
+ *u8++ = ((vector unsigned char){0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3});
+ *u8++ = ((vector unsigned char){0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4});
+ *u8++ = ((vector unsigned char){0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5});
+ *u8++ = ((vector unsigned char){0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6});
+ *u8++ = ((vector unsigned char){0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7});
+ *u8++ = ((vector unsigned char){0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8});
+ *u8++ = ((vector unsigned char){0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9});
+ *u8++ = ((vector unsigned char){0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa});
+ *u8++ = ((vector unsigned char){0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb});
+ *u8++ = ((vector unsigned char){0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc});
+ *u8++ = ((vector unsigned char){0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd});
+ *u8++ = ((vector unsigned char){0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff});
+}
+void fu8d(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
+ *u8++ = ((vector unsigned char){0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01});
+ *u8++ = ((vector unsigned char){0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02});
+ *u8++ = ((vector unsigned char){0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03});
+ *u8++ = ((vector unsigned char){0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04});
+ *u8++ = ((vector unsigned char){0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05});
+ *u8++ = ((vector unsigned char){0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06});
+ *u8++ = ((vector unsigned char){0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07});
+ *u8++ = ((vector unsigned char){0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08});
+ *u8++ = ((vector unsigned char){0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09});
+ *u8++ = ((vector unsigned char){0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a});
+ *u8++ = ((vector unsigned char){0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b});
+ *u8++ = ((vector unsigned char){0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c});
+ *u8++ = ((vector unsigned char){0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d});
+ *u8++ = ((vector unsigned char){0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e});
+ *u8++ = ((vector unsigned char){0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f});
+}
+void fu8e(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
+ *u8++ = ((vector unsigned char){0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01});
+ *u8++ = ((vector unsigned char){0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02});
+ *u8++ = ((vector unsigned char){0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03});
+ *u8++ = ((vector unsigned char){0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04});
+ *u8++ = ((vector unsigned char){0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05});
+ *u8++ = ((vector unsigned char){0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06});
+ *u8++ = ((vector unsigned char){0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07});
+ *u8++ = ((vector unsigned char){0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08});
+ *u8++ = ((vector unsigned char){0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09});
+ *u8++ = ((vector unsigned char){0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a});
+ *u8++ = ((vector unsigned char){0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b});
+ *u8++ = ((vector unsigned char){0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c});
+ *u8++ = ((vector unsigned char){0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d});
+ *u8++ = ((vector unsigned char){0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e});
+ *u8++ = ((vector unsigned char){0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f});
+}
+void fu8f(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0});
+ *u8++ = ((vector unsigned char){0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1});
+ *u8++ = ((vector unsigned char){0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2});
+ *u8++ = ((vector unsigned char){0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3});
+ *u8++ = ((vector unsigned char){0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4});
+ *u8++ = ((vector unsigned char){0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5});
+ *u8++ = ((vector unsigned char){0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6});
+ *u8++ = ((vector unsigned char){0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7});
+ *u8++ = ((vector unsigned char){0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8});
+ *u8++ = ((vector unsigned char){0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9});
+ *u8++ = ((vector unsigned char){0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa});
+ *u8++ = ((vector unsigned char){0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb});
+ *u8++ = ((vector unsigned char){0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc});
+ *u8++ = ((vector unsigned char){0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd});
+ *u8++ = ((vector unsigned char){0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe});
+ *u8++ = ((vector unsigned char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff});
+}
+void fu8g(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0});
+ *u8++ = ((vector unsigned char){1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1});
+ *u8++ = ((vector unsigned char){2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2});
+ *u8++ = ((vector unsigned char){3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3});
+ *u8++ = ((vector unsigned char){4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4});
+ *u8++ = ((vector unsigned char){5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5});
+ *u8++ = ((vector unsigned char){6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6});
+ *u8++ = ((vector unsigned char){7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7});
+ *u8++ = ((vector unsigned char){8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8});
+ *u8++ = ((vector unsigned char){9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9});
+ *u8++ = ((vector unsigned char){10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10});
+ *u8++ = ((vector unsigned char){11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11});
+ *u8++ = ((vector unsigned char){12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12});
+ *u8++ = ((vector unsigned char){13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13});
+ *u8++ = ((vector unsigned char){14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14});
+ *u8++ = ((vector unsigned char){15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15});
+}
+void fu8h(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240});
+ *u8++ = ((vector unsigned char){241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241});
+ *u8++ = ((vector unsigned char){242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242});
+ *u8++ = ((vector unsigned char){243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243});
+ *u8++ = ((vector unsigned char){244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244});
+ *u8++ = ((vector unsigned char){245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245});
+ *u8++ = ((vector unsigned char){246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246});
+ *u8++ = ((vector unsigned char){247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247});
+ *u8++ = ((vector unsigned char){248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248});
+ *u8++ = ((vector unsigned char){249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249});
+ *u8++ = ((vector unsigned char){250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250});
+ *u8++ = ((vector unsigned char){251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251});
+ *u8++ = ((vector unsigned char){252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252});
+ *u8++ = ((vector unsigned char){253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253});
+ *u8++ = ((vector unsigned char){254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254});
+ *u8++ = ((vector unsigned char){255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255});
+}
+void fu8i(vector unsigned char *u8)
+{
+ *u8++ = ((vector unsigned char){-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1});
+ *u8++ = ((vector unsigned char){-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2});
+ *u8++ = ((vector unsigned char){-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3});
+ *u8++ = ((vector unsigned char){-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4});
+ *u8++ = ((vector unsigned char){-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5});
+ *u8++ = ((vector unsigned char){-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6});
+ *u8++ = ((vector unsigned char){-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7});
+ *u8++ = ((vector unsigned char){-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8});
+ *u8++ = ((vector unsigned char){-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9});
+ *u8++ = ((vector unsigned char){-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10});
+ *u8++ = ((vector unsigned char){-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11});
+ *u8++ = ((vector unsigned char){-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12});
+ *u8++ = ((vector unsigned char){-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13});
+ *u8++ = ((vector unsigned char){-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14});
+ *u8++ = ((vector unsigned char){-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15});
+ *u8++ = ((vector unsigned char){-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16});
+}
+void fs32a(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){0,0,0,0});
+ *s32++ = ((vector signed int){1,1,1,1});
+ *s32++ = ((vector signed int){2,2,2,2});
+ *s32++ = ((vector signed int){3,3,3,3});
+ *s32++ = ((vector signed int){4,4,4,4});
+ *s32++ = ((vector signed int){5,5,5,5});
+ *s32++ = ((vector signed int){6,6,6,6});
+ *s32++ = ((vector signed int){7,7,7,7});
+ *s32++ = ((vector signed int){8,8,8,8});
+ *s32++ = ((vector signed int){9,9,9,9});
+ *s32++ = ((vector signed int){10,10,10,10});
+ *s32++ = ((vector signed int){11,11,11,11});
+ *s32++ = ((vector signed int){12,12,12,12});
+ *s32++ = ((vector signed int){13,13,13,13});
+ *s32++ = ((vector signed int){14,14,14,14});
+ *s32++ = ((vector signed int){15,15,15,15});
+}
+void fs32b(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){65537,65537,65537,65537});
+ *s32++ = ((vector signed int){131074,131074,131074,131074});
+ *s32++ = ((vector signed int){196611,196611,196611,196611});
+ *s32++ = ((vector signed int){262148,262148,262148,262148});
+ *s32++ = ((vector signed int){327685,327685,327685,327685});
+ *s32++ = ((vector signed int){393222,393222,393222,393222});
+ *s32++ = ((vector signed int){458759,458759,458759,458759});
+ *s32++ = ((vector signed int){524296,524296,524296,524296});
+ *s32++ = ((vector signed int){589833,589833,589833,589833});
+ *s32++ = ((vector signed int){655370,655370,655370,655370});
+ *s32++ = ((vector signed int){720907,720907,720907,720907});
+ *s32++ = ((vector signed int){786444,786444,786444,786444});
+ *s32++ = ((vector signed int){851981,851981,851981,851981});
+ *s32++ = ((vector signed int){917518,917518,917518,917518});
+ *s32++ = ((vector signed int){983055,983055,983055,983055});
+}
+void fs32c(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){16843009,16843009,16843009,16843009});
+ *s32++ = ((vector signed int){33686018,33686018,33686018,33686018});
+ *s32++ = ((vector signed int){50529027,50529027,50529027,50529027});
+ *s32++ = ((vector signed int){67372036,67372036,67372036,67372036});
+ *s32++ = ((vector signed int){84215045,84215045,84215045,84215045});
+ *s32++ = ((vector signed int){101058054,101058054,101058054,101058054});
+ *s32++ = ((vector signed int){117901063,117901063,117901063,117901063});
+ *s32++ = ((vector signed int){134744072,134744072,134744072,134744072});
+ *s32++ = ((vector signed int){151587081,151587081,151587081,151587081});
+ *s32++ = ((vector signed int){168430090,168430090,168430090,168430090});
+ *s32++ = ((vector signed int){185273099,185273099,185273099,185273099});
+ *s32++ = ((vector signed int){202116108,202116108,202116108,202116108});
+ *s32++ = ((vector signed int){218959117,218959117,218959117,218959117});
+ *s32++ = ((vector signed int){235802126,235802126,235802126,235802126});
+ *s32++ = ((vector signed int){252645135,252645135,252645135,252645135});
+}
+void fs32d(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){4042322160,4042322160,4042322160,4042322160});
+ *s32++ = ((vector signed int){4059165169,4059165169,4059165169,4059165169});
+ *s32++ = ((vector signed int){4076008178,4076008178,4076008178,4076008178});
+ *s32++ = ((vector signed int){4092851187,4092851187,4092851187,4092851187});
+ *s32++ = ((vector signed int){4109694196,4109694196,4109694196,4109694196});
+ *s32++ = ((vector signed int){4126537205,4126537205,4126537205,4126537205});
+ *s32++ = ((vector signed int){4143380214,4143380214,4143380214,4143380214});
+ *s32++ = ((vector signed int){4160223223,4160223223,4160223223,4160223223});
+ *s32++ = ((vector signed int){4177066232,4177066232,4177066232,4177066232});
+ *s32++ = ((vector signed int){4193909241,4193909241,4193909241,4193909241});
+ *s32++ = ((vector signed int){4210752250,4210752250,4210752250,4210752250});
+ *s32++ = ((vector signed int){4227595259,4227595259,4227595259,4227595259});
+ *s32++ = ((vector signed int){4244438268,4244438268,4244438268,4244438268});
+ *s32++ = ((vector signed int){4261281277,4261281277,4261281277,4261281277});
+ *s32++ = ((vector signed int){4278124286,4278124286,4278124286,4278124286});
+}
+void fs32e(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){4293984240,4293984240,4293984240,4293984240});
+ *s32++ = ((vector signed int){4294049777,4294049777,4294049777,4294049777});
+ *s32++ = ((vector signed int){4294115314,4294115314,4294115314,4294115314});
+ *s32++ = ((vector signed int){4294180851,4294180851,4294180851,4294180851});
+ *s32++ = ((vector signed int){4294246388,4294246388,4294246388,4294246388});
+ *s32++ = ((vector signed int){4294311925,4294311925,4294311925,4294311925});
+ *s32++ = ((vector signed int){4294377462,4294377462,4294377462,4294377462});
+ *s32++ = ((vector signed int){4294442999,4294442999,4294442999,4294442999});
+ *s32++ = ((vector signed int){4294508536,4294508536,4294508536,4294508536});
+ *s32++ = ((vector signed int){4294574073,4294574073,4294574073,4294574073});
+ *s32++ = ((vector signed int){4294639610,4294639610,4294639610,4294639610});
+ *s32++ = ((vector signed int){4294705147,4294705147,4294705147,4294705147});
+ *s32++ = ((vector signed int){4294770684,4294770684,4294770684,4294770684});
+ *s32++ = ((vector signed int){4294836221,4294836221,4294836221,4294836221});
+ *s32++ = ((vector signed int){4294901758,4294901758,4294901758,4294901758});
+}
+void fs32f(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){4294967280,4294967280,4294967280,4294967280});
+ *s32++ = ((vector signed int){4294967281,4294967281,4294967281,4294967281});
+ *s32++ = ((vector signed int){4294967282,4294967282,4294967282,4294967282});
+ *s32++ = ((vector signed int){4294967283,4294967283,4294967283,4294967283});
+ *s32++ = ((vector signed int){4294967284,4294967284,4294967284,4294967284});
+ *s32++ = ((vector signed int){4294967285,4294967285,4294967285,4294967285});
+ *s32++ = ((vector signed int){4294967286,4294967286,4294967286,4294967286});
+ *s32++ = ((vector signed int){4294967287,4294967287,4294967287,4294967287});
+ *s32++ = ((vector signed int){4294967288,4294967288,4294967288,4294967288});
+ *s32++ = ((vector signed int){4294967289,4294967289,4294967289,4294967289});
+ *s32++ = ((vector signed int){4294967290,4294967290,4294967290,4294967290});
+ *s32++ = ((vector signed int){4294967291,4294967291,4294967291,4294967291});
+ *s32++ = ((vector signed int){4294967292,4294967292,4294967292,4294967292});
+ *s32++ = ((vector signed int){4294967293,4294967293,4294967293,4294967293});
+ *s32++ = ((vector signed int){4294967294,4294967294,4294967294,4294967294});
+ *s32++ = ((vector signed int){4294967295,4294967295,4294967295,4294967295});
+}
+void fs32g(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){-252645136,-252645136,-252645136,-252645136});
+ *s32++ = ((vector signed int){-235802127,-235802127,-235802127,-235802127});
+ *s32++ = ((vector signed int){-218959118,-218959118,-218959118,-218959118});
+ *s32++ = ((vector signed int){-202116109,-202116109,-202116109,-202116109});
+ *s32++ = ((vector signed int){-185273100,-185273100,-185273100,-185273100});
+ *s32++ = ((vector signed int){-168430091,-168430091,-168430091,-168430091});
+ *s32++ = ((vector signed int){-151587082,-151587082,-151587082,-151587082});
+ *s32++ = ((vector signed int){-134744073,-134744073,-134744073,-134744073});
+ *s32++ = ((vector signed int){-117901064,-117901064,-117901064,-117901064});
+ *s32++ = ((vector signed int){-101058055,-101058055,-101058055,-101058055});
+ *s32++ = ((vector signed int){-84215046,-84215046,-84215046,-84215046});
+ *s32++ = ((vector signed int){-67372037,-67372037,-67372037,-67372037});
+ *s32++ = ((vector signed int){-50529028,-50529028,-50529028,-50529028});
+ *s32++ = ((vector signed int){-33686019,-33686019,-33686019,-33686019});
+ *s32++ = ((vector signed int){-16843010,-16843010,-16843010,-16843010});
+}
+void fs32h(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){-983056,-983056,-983056,-983056});
+ *s32++ = ((vector signed int){-917519,-917519,-917519,-917519});
+ *s32++ = ((vector signed int){-851982,-851982,-851982,-851982});
+ *s32++ = ((vector signed int){-786445,-786445,-786445,-786445});
+ *s32++ = ((vector signed int){-720908,-720908,-720908,-720908});
+ *s32++ = ((vector signed int){-655371,-655371,-655371,-655371});
+ *s32++ = ((vector signed int){-589834,-589834,-589834,-589834});
+ *s32++ = ((vector signed int){-524297,-524297,-524297,-524297});
+ *s32++ = ((vector signed int){-458760,-458760,-458760,-458760});
+ *s32++ = ((vector signed int){-393223,-393223,-393223,-393223});
+ *s32++ = ((vector signed int){-327686,-327686,-327686,-327686});
+ *s32++ = ((vector signed int){-262149,-262149,-262149,-262149});
+ *s32++ = ((vector signed int){-196612,-196612,-196612,-196612});
+ *s32++ = ((vector signed int){-131075,-131075,-131075,-131075});
+ *s32++ = ((vector signed int){-65538,-65538,-65538,-65538});
+}
+void fs32i(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){-16,-16,-16,-16});
+ *s32++ = ((vector signed int){-15,-15,-15,-15});
+ *s32++ = ((vector signed int){-14,-14,-14,-14});
+ *s32++ = ((vector signed int){-13,-13,-13,-13});
+ *s32++ = ((vector signed int){-12,-12,-12,-12});
+ *s32++ = ((vector signed int){-11,-11,-11,-11});
+ *s32++ = ((vector signed int){-10,-10,-10,-10});
+ *s32++ = ((vector signed int){-9,-9,-9,-9});
+ *s32++ = ((vector signed int){-8,-8,-8,-8});
+ *s32++ = ((vector signed int){-7,-7,-7,-7});
+ *s32++ = ((vector signed int){-6,-6,-6,-6});
+ *s32++ = ((vector signed int){-5,-5,-5,-5});
+ *s32++ = ((vector signed int){-4,-4,-4,-4});
+ *s32++ = ((vector signed int){-3,-3,-3,-3});
+ *s32++ = ((vector signed int){-2,-2,-2,-2});
+ *s32++ = ((vector signed int){-1,-1,-1,-1});
+}
+void fs32j(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){0xfffffff0,0xfffffff0,0xfffffff0,0xfffffff0});
+ *s32++ = ((vector signed int){0xfffffff1,0xfffffff1,0xfffffff1,0xfffffff1});
+ *s32++ = ((vector signed int){0xfffffff2,0xfffffff2,0xfffffff2,0xfffffff2});
+ *s32++ = ((vector signed int){0xfffffff3,0xfffffff3,0xfffffff3,0xfffffff3});
+ *s32++ = ((vector signed int){0xfffffff4,0xfffffff4,0xfffffff4,0xfffffff4});
+ *s32++ = ((vector signed int){0xfffffff5,0xfffffff5,0xfffffff5,0xfffffff5});
+ *s32++ = ((vector signed int){0xfffffff6,0xfffffff6,0xfffffff6,0xfffffff6});
+ *s32++ = ((vector signed int){0xfffffff7,0xfffffff7,0xfffffff7,0xfffffff7});
+ *s32++ = ((vector signed int){0xfffffff8,0xfffffff8,0xfffffff8,0xfffffff8});
+ *s32++ = ((vector signed int){0xfffffff9,0xfffffff9,0xfffffff9,0xfffffff9});
+ *s32++ = ((vector signed int){0xfffffffa,0xfffffffa,0xfffffffa,0xfffffffa});
+ *s32++ = ((vector signed int){0xfffffffb,0xfffffffb,0xfffffffb,0xfffffffb});
+ *s32++ = ((vector signed int){0xfffffffc,0xfffffffc,0xfffffffc,0xfffffffc});
+ *s32++ = ((vector signed int){0xfffffffd,0xfffffffd,0xfffffffd,0xfffffffd});
+ *s32++ = ((vector signed int){0xfffffffe,0xfffffffe,0xfffffffe,0xfffffffe});
+ *s32++ = ((vector signed int){0xffffffff,0xffffffff,0xffffffff,0xffffffff});
+}
+void fs32k(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){0x00000000,0x00000000,0x00000000,0x00000000});
+ *s32++ = ((vector signed int){0x00000001,0x00000001,0x00000001,0x00000001});
+ *s32++ = ((vector signed int){0x00000002,0x00000002,0x00000002,0x00000002});
+ *s32++ = ((vector signed int){0x00000003,0x00000003,0x00000003,0x00000003});
+ *s32++ = ((vector signed int){0x00000004,0x00000004,0x00000004,0x00000004});
+ *s32++ = ((vector signed int){0x00000005,0x00000005,0x00000005,0x00000005});
+ *s32++ = ((vector signed int){0x00000006,0x00000006,0x00000006,0x00000006});
+ *s32++ = ((vector signed int){0x00000007,0x00000007,0x00000007,0x00000007});
+ *s32++ = ((vector signed int){0x00000008,0x00000008,0x00000008,0x00000008});
+ *s32++ = ((vector signed int){0x00000009,0x00000009,0x00000009,0x00000009});
+ *s32++ = ((vector signed int){0x0000000a,0x0000000a,0x0000000a,0x0000000a});
+ *s32++ = ((vector signed int){0x0000000b,0x0000000b,0x0000000b,0x0000000b});
+ *s32++ = ((vector signed int){0x0000000c,0x0000000c,0x0000000c,0x0000000c});
+ *s32++ = ((vector signed int){0x0000000d,0x0000000d,0x0000000d,0x0000000d});
+ *s32++ = ((vector signed int){0x0000000e,0x0000000e,0x0000000e,0x0000000e});
+ *s32++ = ((vector signed int){0x0000000f,0x0000000f,0x0000000f,0x0000000f});
+}
+void fs32l(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){0xfff0fff0,0xfff0fff0,0xfff0fff0,0xfff0fff0});
+ *s32++ = ((vector signed int){0xfff1fff1,0xfff1fff1,0xfff1fff1,0xfff1fff1});
+ *s32++ = ((vector signed int){0xfff2fff2,0xfff2fff2,0xfff2fff2,0xfff2fff2});
+ *s32++ = ((vector signed int){0xfff3fff3,0xfff3fff3,0xfff3fff3,0xfff3fff3});
+ *s32++ = ((vector signed int){0xfff4fff4,0xfff4fff4,0xfff4fff4,0xfff4fff4});
+ *s32++ = ((vector signed int){0xfff5fff5,0xfff5fff5,0xfff5fff5,0xfff5fff5});
+ *s32++ = ((vector signed int){0xfff6fff6,0xfff6fff6,0xfff6fff6,0xfff6fff6});
+ *s32++ = ((vector signed int){0xfff7fff7,0xfff7fff7,0xfff7fff7,0xfff7fff7});
+ *s32++ = ((vector signed int){0xfff8fff8,0xfff8fff8,0xfff8fff8,0xfff8fff8});
+ *s32++ = ((vector signed int){0xfff9fff9,0xfff9fff9,0xfff9fff9,0xfff9fff9});
+ *s32++ = ((vector signed int){0xfffafffa,0xfffafffa,0xfffafffa,0xfffafffa});
+ *s32++ = ((vector signed int){0xfffbfffb,0xfffbfffb,0xfffbfffb,0xfffbfffb});
+ *s32++ = ((vector signed int){0xfffcfffc,0xfffcfffc,0xfffcfffc,0xfffcfffc});
+ *s32++ = ((vector signed int){0xfffdfffd,0xfffdfffd,0xfffdfffd,0xfffdfffd});
+ *s32++ = ((vector signed int){0xfffefffe,0xfffefffe,0xfffefffe,0xfffefffe});
+ *s32++ = ((vector signed int){0xffffffff,0xffffffff,0xffffffff,0xffffffff});
+}
+void fs32m(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){0x00000000,0x00000000,0x00000000,0x00000000});
+ *s32++ = ((vector signed int){0x00010001,0x00010001,0x00010001,0x00010001});
+ *s32++ = ((vector signed int){0x00020002,0x00020002,0x00020002,0x00020002});
+ *s32++ = ((vector signed int){0x00030003,0x00030003,0x00030003,0x00030003});
+ *s32++ = ((vector signed int){0x00040004,0x00040004,0x00040004,0x00040004});
+ *s32++ = ((vector signed int){0x00050005,0x00050005,0x00050005,0x00050005});
+ *s32++ = ((vector signed int){0x00060006,0x00060006,0x00060006,0x00060006});
+ *s32++ = ((vector signed int){0x00070007,0x00070007,0x00070007,0x00070007});
+ *s32++ = ((vector signed int){0x00080008,0x00080008,0x00080008,0x00080008});
+ *s32++ = ((vector signed int){0x00090009,0x00090009,0x00090009,0x00090009});
+ *s32++ = ((vector signed int){0x000a000a,0x000a000a,0x000a000a,0x000a000a});
+ *s32++ = ((vector signed int){0x000b000b,0x000b000b,0x000b000b,0x000b000b});
+ *s32++ = ((vector signed int){0x000c000c,0x000c000c,0x000c000c,0x000c000c});
+ *s32++ = ((vector signed int){0x000d000d,0x000d000d,0x000d000d,0x000d000d});
+ *s32++ = ((vector signed int){0x000e000e,0x000e000e,0x000e000e,0x000e000e});
+ *s32++ = ((vector signed int){0x000f000f,0x000f000f,0x000f000f,0x000f000f});
+}
+void fs32n(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){0xf0f0f0f0,0xf0f0f0f0,0xf0f0f0f0,0xf0f0f0f0});
+ *s32++ = ((vector signed int){0xf1f1f1f1,0xf1f1f1f1,0xf1f1f1f1,0xf1f1f1f1});
+ *s32++ = ((vector signed int){0xf2f2f2f2,0xf2f2f2f2,0xf2f2f2f2,0xf2f2f2f2});
+ *s32++ = ((vector signed int){0xf3f3f3f3,0xf3f3f3f3,0xf3f3f3f3,0xf3f3f3f3});
+ *s32++ = ((vector signed int){0xf4f4f4f4,0xf4f4f4f4,0xf4f4f4f4,0xf4f4f4f4});
+ *s32++ = ((vector signed int){0xf5f5f5f5,0xf5f5f5f5,0xf5f5f5f5,0xf5f5f5f5});
+ *s32++ = ((vector signed int){0xf6f6f6f6,0xf6f6f6f6,0xf6f6f6f6,0xf6f6f6f6});
+ *s32++ = ((vector signed int){0xf7f7f7f7,0xf7f7f7f7,0xf7f7f7f7,0xf7f7f7f7});
+ *s32++ = ((vector signed int){0xf8f8f8f8,0xf8f8f8f8,0xf8f8f8f8,0xf8f8f8f8});
+ *s32++ = ((vector signed int){0xf9f9f9f9,0xf9f9f9f9,0xf9f9f9f9,0xf9f9f9f9});
+ *s32++ = ((vector signed int){0xfafafafa,0xfafafafa,0xfafafafa,0xfafafafa});
+ *s32++ = ((vector signed int){0xfbfbfbfb,0xfbfbfbfb,0xfbfbfbfb,0xfbfbfbfb});
+ *s32++ = ((vector signed int){0xfcfcfcfc,0xfcfcfcfc,0xfcfcfcfc,0xfcfcfcfc});
+ *s32++ = ((vector signed int){0xfdfdfdfd,0xfdfdfdfd,0xfdfdfdfd,0xfdfdfdfd});
+ *s32++ = ((vector signed int){0xfefefefe,0xfefefefe,0xfefefefe,0xfefefefe});
+ *s32++ = ((vector signed int){0xffffffff,0xffffffff,0xffffffff,0xffffffff});
+}
+void fs32o(vector signed int *s32)
+{
+ *s32++ = ((vector signed int){0x00000000,0x00000000,0x00000000,0x00000000});
+ *s32++ = ((vector signed int){0x01010101,0x01010101,0x01010101,0x01010101});
+ *s32++ = ((vector signed int){0x02020202,0x02020202,0x02020202,0x02020202});
+ *s32++ = ((vector signed int){0x03030303,0x03030303,0x03030303,0x03030303});
+ *s32++ = ((vector signed int){0x04040404,0x04040404,0x04040404,0x04040404});
+ *s32++ = ((vector signed int){0x05050505,0x05050505,0x05050505,0x05050505});
+ *s32++ = ((vector signed int){0x06060606,0x06060606,0x06060606,0x06060606});
+ *s32++ = ((vector signed int){0x07070707,0x07070707,0x07070707,0x07070707});
+ *s32++ = ((vector signed int){0x08080808,0x08080808,0x08080808,0x08080808});
+ *s32++ = ((vector signed int){0x09090909,0x09090909,0x09090909,0x09090909});
+ *s32++ = ((vector signed int){0x0a0a0a0a,0x0a0a0a0a,0x0a0a0a0a,0x0a0a0a0a});
+ *s32++ = ((vector signed int){0x0b0b0b0b,0x0b0b0b0b,0x0b0b0b0b,0x0b0b0b0b});
+ *s32++ = ((vector signed int){0x0c0c0c0c,0x0c0c0c0c,0x0c0c0c0c,0x0c0c0c0c});
+ *s32++ = ((vector signed int){0x0d0d0d0d,0x0d0d0d0d,0x0d0d0d0d,0x0d0d0d0d});
+ *s32++ = ((vector signed int){0x0e0e0e0e,0x0e0e0e0e,0x0e0e0e0e,0x0e0e0e0e});
+ *s32++ = ((vector signed int){0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f});
+}
+void fs16a(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){0xffff,0xfff0,0xffff,0xfff0,0xffff,0xfff0,0xffff,0xfff0});
+ *s16++ = ((vector signed short){0xffff,0xfff1,0xffff,0xfff1,0xffff,0xfff1,0xffff,0xfff1});
+ *s16++ = ((vector signed short){0xffff,0xfff2,0xffff,0xfff2,0xffff,0xfff2,0xffff,0xfff2});
+ *s16++ = ((vector signed short){0xffff,0xfff3,0xffff,0xfff3,0xffff,0xfff3,0xffff,0xfff3});
+ *s16++ = ((vector signed short){0xffff,0xfff4,0xffff,0xfff4,0xffff,0xfff4,0xffff,0xfff4});
+ *s16++ = ((vector signed short){0xffff,0xfff5,0xffff,0xfff5,0xffff,0xfff5,0xffff,0xfff5});
+ *s16++ = ((vector signed short){0xffff,0xfff6,0xffff,0xfff6,0xffff,0xfff6,0xffff,0xfff6});
+ *s16++ = ((vector signed short){0xffff,0xfff7,0xffff,0xfff7,0xffff,0xfff7,0xffff,0xfff7});
+ *s16++ = ((vector signed short){0xffff,0xfff8,0xffff,0xfff8,0xffff,0xfff8,0xffff,0xfff8});
+ *s16++ = ((vector signed short){0xffff,0xfff9,0xffff,0xfff9,0xffff,0xfff9,0xffff,0xfff9});
+ *s16++ = ((vector signed short){0xffff,0xfffa,0xffff,0xfffa,0xffff,0xfffa,0xffff,0xfffa});
+ *s16++ = ((vector signed short){0xffff,0xfffb,0xffff,0xfffb,0xffff,0xfffb,0xffff,0xfffb});
+ *s16++ = ((vector signed short){0xffff,0xfffc,0xffff,0xfffc,0xffff,0xfffc,0xffff,0xfffc});
+ *s16++ = ((vector signed short){0xffff,0xfffd,0xffff,0xfffd,0xffff,0xfffd,0xffff,0xfffd});
+ *s16++ = ((vector signed short){0xffff,0xfffe,0xffff,0xfffe,0xffff,0xfffe,0xffff,0xfffe});
+ *s16++ = ((vector signed short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff});
+}
+void fs16b(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000});
+ *s16++ = ((vector signed short){0x0000,0x0001,0x0000,0x0001,0x0000,0x0001,0x0000,0x0001});
+ *s16++ = ((vector signed short){0x0000,0x0002,0x0000,0x0002,0x0000,0x0002,0x0000,0x0002});
+ *s16++ = ((vector signed short){0x0000,0x0003,0x0000,0x0003,0x0000,0x0003,0x0000,0x0003});
+ *s16++ = ((vector signed short){0x0000,0x0004,0x0000,0x0004,0x0000,0x0004,0x0000,0x0004});
+ *s16++ = ((vector signed short){0x0000,0x0005,0x0000,0x0005,0x0000,0x0005,0x0000,0x0005});
+ *s16++ = ((vector signed short){0x0000,0x0006,0x0000,0x0006,0x0000,0x0006,0x0000,0x0006});
+ *s16++ = ((vector signed short){0x0000,0x0007,0x0000,0x0007,0x0000,0x0007,0x0000,0x0007});
+ *s16++ = ((vector signed short){0x0000,0x0008,0x0000,0x0008,0x0000,0x0008,0x0000,0x0008});
+ *s16++ = ((vector signed short){0x0000,0x0009,0x0000,0x0009,0x0000,0x0009,0x0000,0x0009});
+ *s16++ = ((vector signed short){0x0000,0x000a,0x0000,0x000a,0x0000,0x000a,0x0000,0x000a});
+ *s16++ = ((vector signed short){0x0000,0x000b,0x0000,0x000b,0x0000,0x000b,0x0000,0x000b});
+ *s16++ = ((vector signed short){0x0000,0x000c,0x0000,0x000c,0x0000,0x000c,0x0000,0x000c});
+ *s16++ = ((vector signed short){0x0000,0x000d,0x0000,0x000d,0x0000,0x000d,0x0000,0x000d});
+ *s16++ = ((vector signed short){0x0000,0x000e,0x0000,0x000e,0x0000,0x000e,0x0000,0x000e});
+ *s16++ = ((vector signed short){0x0000,0x000f,0x0000,0x000f,0x0000,0x000f,0x0000,0x000f});
+}
+void fs16c(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0,0xfff0});
+ *s16++ = ((vector signed short){0xfff1,0xfff1,0xfff1,0xfff1,0xfff1,0xfff1,0xfff1,0xfff1});
+ *s16++ = ((vector signed short){0xfff2,0xfff2,0xfff2,0xfff2,0xfff2,0xfff2,0xfff2,0xfff2});
+ *s16++ = ((vector signed short){0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3,0xfff3});
+ *s16++ = ((vector signed short){0xfff4,0xfff4,0xfff4,0xfff4,0xfff4,0xfff4,0xfff4,0xfff4});
+ *s16++ = ((vector signed short){0xfff5,0xfff5,0xfff5,0xfff5,0xfff5,0xfff5,0xfff5,0xfff5});
+ *s16++ = ((vector signed short){0xfff6,0xfff6,0xfff6,0xfff6,0xfff6,0xfff6,0xfff6,0xfff6});
+ *s16++ = ((vector signed short){0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7,0xfff7});
+ *s16++ = ((vector signed short){0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8,0xfff8});
+ *s16++ = ((vector signed short){0xfff9,0xfff9,0xfff9,0xfff9,0xfff9,0xfff9,0xfff9,0xfff9});
+ *s16++ = ((vector signed short){0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa,0xfffa});
+ *s16++ = ((vector signed short){0xfffb,0xfffb,0xfffb,0xfffb,0xfffb,0xfffb,0xfffb,0xfffb});
+ *s16++ = ((vector signed short){0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc,0xfffc});
+ *s16++ = ((vector signed short){0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd});
+ *s16++ = ((vector signed short){0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe,0xfffe});
+ *s16++ = ((vector signed short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff});
+}
+void fs16d(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000});
+ *s16++ = ((vector signed short){0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001});
+ *s16++ = ((vector signed short){0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002,0x0002});
+ *s16++ = ((vector signed short){0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003,0x0003});
+ *s16++ = ((vector signed short){0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004});
+ *s16++ = ((vector signed short){0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005,0x0005});
+ *s16++ = ((vector signed short){0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006,0x0006});
+ *s16++ = ((vector signed short){0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007,0x0007});
+ *s16++ = ((vector signed short){0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008});
+ *s16++ = ((vector signed short){0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009,0x0009});
+ *s16++ = ((vector signed short){0x000a,0x000a,0x000a,0x000a,0x000a,0x000a,0x000a,0x000a});
+ *s16++ = ((vector signed short){0x000b,0x000b,0x000b,0x000b,0x000b,0x000b,0x000b,0x000b});
+ *s16++ = ((vector signed short){0x000c,0x000c,0x000c,0x000c,0x000c,0x000c,0x000c,0x000c});
+ *s16++ = ((vector signed short){0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d,0x000d});
+ *s16++ = ((vector signed short){0x000e,0x000e,0x000e,0x000e,0x000e,0x000e,0x000e,0x000e});
+ *s16++ = ((vector signed short){0x000f,0x000f,0x000f,0x000f,0x000f,0x000f,0x000f,0x000f});
+}
+void fs16e(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0,0xf0f0});
+ *s16++ = ((vector signed short){0xf1f1,0xf1f1,0xf1f1,0xf1f1,0xf1f1,0xf1f1,0xf1f1,0xf1f1});
+ *s16++ = ((vector signed short){0xf2f2,0xf2f2,0xf2f2,0xf2f2,0xf2f2,0xf2f2,0xf2f2,0xf2f2});
+ *s16++ = ((vector signed short){0xf3f3,0xf3f3,0xf3f3,0xf3f3,0xf3f3,0xf3f3,0xf3f3,0xf3f3});
+ *s16++ = ((vector signed short){0xf4f4,0xf4f4,0xf4f4,0xf4f4,0xf4f4,0xf4f4,0xf4f4,0xf4f4});
+ *s16++ = ((vector signed short){0xf5f5,0xf5f5,0xf5f5,0xf5f5,0xf5f5,0xf5f5,0xf5f5,0xf5f5});
+ *s16++ = ((vector signed short){0xf6f6,0xf6f6,0xf6f6,0xf6f6,0xf6f6,0xf6f6,0xf6f6,0xf6f6});
+ *s16++ = ((vector signed short){0xf7f7,0xf7f7,0xf7f7,0xf7f7,0xf7f7,0xf7f7,0xf7f7,0xf7f7});
+ *s16++ = ((vector signed short){0xf8f8,0xf8f8,0xf8f8,0xf8f8,0xf8f8,0xf8f8,0xf8f8,0xf8f8});
+ *s16++ = ((vector signed short){0xf9f9,0xf9f9,0xf9f9,0xf9f9,0xf9f9,0xf9f9,0xf9f9,0xf9f9});
+ *s16++ = ((vector signed short){0xfafa,0xfafa,0xfafa,0xfafa,0xfafa,0xfafa,0xfafa,0xfafa});
+ *s16++ = ((vector signed short){0xfbfb,0xfbfb,0xfbfb,0xfbfb,0xfbfb,0xfbfb,0xfbfb,0xfbfb});
+ *s16++ = ((vector signed short){0xfcfc,0xfcfc,0xfcfc,0xfcfc,0xfcfc,0xfcfc,0xfcfc,0xfcfc});
+ *s16++ = ((vector signed short){0xfdfd,0xfdfd,0xfdfd,0xfdfd,0xfdfd,0xfdfd,0xfdfd,0xfdfd});
+ *s16++ = ((vector signed short){0xfefe,0xfefe,0xfefe,0xfefe,0xfefe,0xfefe,0xfefe,0xfefe});
+ *s16++ = ((vector signed short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff});
+}
+void fs16f(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000});
+ *s16++ = ((vector signed short){0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101});
+ *s16++ = ((vector signed short){0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202,0x0202});
+ *s16++ = ((vector signed short){0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303,0x0303});
+ *s16++ = ((vector signed short){0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404,0x0404});
+ *s16++ = ((vector signed short){0x0505,0x0505,0x0505,0x0505,0x0505,0x0505,0x0505,0x0505});
+ *s16++ = ((vector signed short){0x0606,0x0606,0x0606,0x0606,0x0606,0x0606,0x0606,0x0606});
+ *s16++ = ((vector signed short){0x0707,0x0707,0x0707,0x0707,0x0707,0x0707,0x0707,0x0707});
+ *s16++ = ((vector signed short){0x0808,0x0808,0x0808,0x0808,0x0808,0x0808,0x0808,0x0808});
+ *s16++ = ((vector signed short){0x0909,0x0909,0x0909,0x0909,0x0909,0x0909,0x0909,0x0909});
+ *s16++ = ((vector signed short){0x0a0a,0x0a0a,0x0a0a,0x0a0a,0x0a0a,0x0a0a,0x0a0a,0x0a0a});
+ *s16++ = ((vector signed short){0x0b0b,0x0b0b,0x0b0b,0x0b0b,0x0b0b,0x0b0b,0x0b0b,0x0b0b});
+ *s16++ = ((vector signed short){0x0c0c,0x0c0c,0x0c0c,0x0c0c,0x0c0c,0x0c0c,0x0c0c,0x0c0c});
+ *s16++ = ((vector signed short){0x0d0d,0x0d0d,0x0d0d,0x0d0d,0x0d0d,0x0d0d,0x0d0d,0x0d0d});
+ *s16++ = ((vector signed short){0x0e0e,0x0e0e,0x0e0e,0x0e0e,0x0e0e,0x0e0e,0x0e0e,0x0e0e});
+ *s16++ = ((vector signed short){0x0f0f,0x0f0f,0x0f0f,0x0f0f,0x0f0f,0x0f0f,0x0f0f,0x0f0f});
+}
+void fs16g(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){0,0,0,0,0,0,0,0});
+ *s16++ = ((vector signed short){1,1,1,1,1,1,1,1});
+ *s16++ = ((vector signed short){2,2,2,2,2,2,2,2});
+ *s16++ = ((vector signed short){3,3,3,3,3,3,3,3});
+ *s16++ = ((vector signed short){4,4,4,4,4,4,4,4});
+ *s16++ = ((vector signed short){5,5,5,5,5,5,5,5});
+ *s16++ = ((vector signed short){6,6,6,6,6,6,6,6});
+ *s16++ = ((vector signed short){7,7,7,7,7,7,7,7});
+ *s16++ = ((vector signed short){8,8,8,8,8,8,8,8});
+ *s16++ = ((vector signed short){9,9,9,9,9,9,9,9});
+ *s16++ = ((vector signed short){10,10,10,10,10,10,10,10});
+ *s16++ = ((vector signed short){11,11,11,11,11,11,11,11});
+ *s16++ = ((vector signed short){12,12,12,12,12,12,12,12});
+ *s16++ = ((vector signed short){13,13,13,13,13,13,13,13});
+ *s16++ = ((vector signed short){14,14,14,14,14,14,14,14});
+ *s16++ = ((vector signed short){15,15,15,15,15,15,15,15});
+}
+void fs16h(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){257,257,257,257,257,257,257,257});
+ *s16++ = ((vector signed short){514,514,514,514,514,514,514,514});
+ *s16++ = ((vector signed short){771,771,771,771,771,771,771,771});
+ *s16++ = ((vector signed short){1028,1028,1028,1028,1028,1028,1028,1028});
+ *s16++ = ((vector signed short){1285,1285,1285,1285,1285,1285,1285,1285});
+ *s16++ = ((vector signed short){1542,1542,1542,1542,1542,1542,1542,1542});
+ *s16++ = ((vector signed short){1799,1799,1799,1799,1799,1799,1799,1799});
+ *s16++ = ((vector signed short){2056,2056,2056,2056,2056,2056,2056,2056});
+ *s16++ = ((vector signed short){2313,2313,2313,2313,2313,2313,2313,2313});
+ *s16++ = ((vector signed short){2570,2570,2570,2570,2570,2570,2570,2570});
+ *s16++ = ((vector signed short){2827,2827,2827,2827,2827,2827,2827,2827});
+ *s16++ = ((vector signed short){3084,3084,3084,3084,3084,3084,3084,3084});
+ *s16++ = ((vector signed short){3341,3341,3341,3341,3341,3341,3341,3341});
+ *s16++ = ((vector signed short){3598,3598,3598,3598,3598,3598,3598,3598});
+ *s16++ = ((vector signed short){3855,3855,3855,3855,3855,3855,3855,3855});
+}
+void fs16i(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){61680,61680,61680,61680,61680,61680,61680,61680});
+ *s16++ = ((vector signed short){61937,61937,61937,61937,61937,61937,61937,61937});
+ *s16++ = ((vector signed short){62194,62194,62194,62194,62194,62194,62194,62194});
+ *s16++ = ((vector signed short){62451,62451,62451,62451,62451,62451,62451,62451});
+ *s16++ = ((vector signed short){62708,62708,62708,62708,62708,62708,62708,62708});
+ *s16++ = ((vector signed short){62965,62965,62965,62965,62965,62965,62965,62965});
+ *s16++ = ((vector signed short){63222,63222,63222,63222,63222,63222,63222,63222});
+ *s16++ = ((vector signed short){63479,63479,63479,63479,63479,63479,63479,63479});
+ *s16++ = ((vector signed short){63736,63736,63736,63736,63736,63736,63736,63736});
+ *s16++ = ((vector signed short){63993,63993,63993,63993,63993,63993,63993,63993});
+ *s16++ = ((vector signed short){64250,64250,64250,64250,64250,64250,64250,64250});
+ *s16++ = ((vector signed short){64507,64507,64507,64507,64507,64507,64507,64507});
+ *s16++ = ((vector signed short){64764,64764,64764,64764,64764,64764,64764,64764});
+ *s16++ = ((vector signed short){65021,65021,65021,65021,65021,65021,65021,65021});
+ *s16++ = ((vector signed short){65278,65278,65278,65278,65278,65278,65278,65278});
+}
+void fs16j(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){65520,65520,65520,65520,65520,65520,65520,65520});
+ *s16++ = ((vector signed short){65521,65521,65521,65521,65521,65521,65521,65521});
+ *s16++ = ((vector signed short){65522,65522,65522,65522,65522,65522,65522,65522});
+ *s16++ = ((vector signed short){65523,65523,65523,65523,65523,65523,65523,65523});
+ *s16++ = ((vector signed short){65524,65524,65524,65524,65524,65524,65524,65524});
+ *s16++ = ((vector signed short){65525,65525,65525,65525,65525,65525,65525,65525});
+ *s16++ = ((vector signed short){65526,65526,65526,65526,65526,65526,65526,65526});
+ *s16++ = ((vector signed short){65527,65527,65527,65527,65527,65527,65527,65527});
+ *s16++ = ((vector signed short){65528,65528,65528,65528,65528,65528,65528,65528});
+ *s16++ = ((vector signed short){65529,65529,65529,65529,65529,65529,65529,65529});
+ *s16++ = ((vector signed short){65530,65530,65530,65530,65530,65530,65530,65530});
+ *s16++ = ((vector signed short){65531,65531,65531,65531,65531,65531,65531,65531});
+ *s16++ = ((vector signed short){65532,65532,65532,65532,65532,65532,65532,65532});
+ *s16++ = ((vector signed short){65533,65533,65533,65533,65533,65533,65533,65533});
+ *s16++ = ((vector signed short){65534,65534,65534,65534,65534,65534,65534,65534});
+ *s16++ = ((vector signed short){65535,65535,65535,65535,65535,65535,65535,65535});
+}
+void fs16k(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){-3856,-3856,-3856,-3856,-3856,-3856,-3856,-3856});
+ *s16++ = ((vector signed short){-3599,-3599,-3599,-3599,-3599,-3599,-3599,-3599});
+ *s16++ = ((vector signed short){-3342,-3342,-3342,-3342,-3342,-3342,-3342,-3342});
+ *s16++ = ((vector signed short){-3085,-3085,-3085,-3085,-3085,-3085,-3085,-3085});
+ *s16++ = ((vector signed short){-2828,-2828,-2828,-2828,-2828,-2828,-2828,-2828});
+ *s16++ = ((vector signed short){-2571,-2571,-2571,-2571,-2571,-2571,-2571,-2571});
+ *s16++ = ((vector signed short){-2314,-2314,-2314,-2314,-2314,-2314,-2314,-2314});
+ *s16++ = ((vector signed short){-2057,-2057,-2057,-2057,-2057,-2057,-2057,-2057});
+ *s16++ = ((vector signed short){-1800,-1800,-1800,-1800,-1800,-1800,-1800,-1800});
+ *s16++ = ((vector signed short){-1543,-1543,-1543,-1543,-1543,-1543,-1543,-1543});
+ *s16++ = ((vector signed short){-1286,-1286,-1286,-1286,-1286,-1286,-1286,-1286});
+ *s16++ = ((vector signed short){-1029,-1029,-1029,-1029,-1029,-1029,-1029,-1029});
+ *s16++ = ((vector signed short){-772,-772,-772,-772,-772,-772,-772,-772});
+ *s16++ = ((vector signed short){-515,-515,-515,-515,-515,-515,-515,-515});
+ *s16++ = ((vector signed short){-258,-258,-258,-258,-258,-258,-258,-258});
+}
+void fs16l(vector signed short *s16)
+{
+ *s16++ = ((vector signed short){-16,-16,-16,-16,-16,-16,-16,-16});
+ *s16++ = ((vector signed short){-15,-15,-15,-15,-15,-15,-15,-15});
+ *s16++ = ((vector signed short){-14,-14,-14,-14,-14,-14,-14,-14});
+ *s16++ = ((vector signed short){-13,-13,-13,-13,-13,-13,-13,-13});
+ *s16++ = ((vector signed short){-12,-12,-12,-12,-12,-12,-12,-12});
+ *s16++ = ((vector signed short){-11,-11,-11,-11,-11,-11,-11,-11});
+ *s16++ = ((vector signed short){-10,-10,-10,-10,-10,-10,-10,-10});
+ *s16++ = ((vector signed short){-9,-9,-9,-9,-9,-9,-9,-9});
+ *s16++ = ((vector signed short){-8,-8,-8,-8,-8,-8,-8,-8});
+ *s16++ = ((vector signed short){-7,-7,-7,-7,-7,-7,-7,-7});
+ *s16++ = ((vector signed short){-6,-6,-6,-6,-6,-6,-6,-6});
+ *s16++ = ((vector signed short){-5,-5,-5,-5,-5,-5,-5,-5});
+ *s16++ = ((vector signed short){-4,-4,-4,-4,-4,-4,-4,-4});
+ *s16++ = ((vector signed short){-3,-3,-3,-3,-3,-3,-3,-3});
+ *s16++ = ((vector signed short){-2,-2,-2,-2,-2,-2,-2,-2});
+ *s16++ = ((vector signed short){-1,-1,-1,-1,-1,-1,-1,-1});
+}
+void fs8a(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xf1});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf2,0xff,0xff,0xff,0xf2,0xff,0xff,0xff,0xf2,0xff,0xff,0xff,0xf2});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xf3,0xff,0xff,0xff,0xf3});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf4,0xff,0xff,0xff,0xf4,0xff,0xff,0xff,0xf4,0xff,0xff,0xff,0xf4});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf5,0xff,0xff,0xff,0xf5,0xff,0xff,0xff,0xf5,0xff,0xff,0xff,0xf5});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf6,0xff,0xff,0xff,0xf6,0xff,0xff,0xff,0xf6,0xff,0xff,0xff,0xf6});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xf7});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xf8});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0xf9,0xff,0xff,0xff,0xf9});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xfa,0xff,0xff,0xff,0xfa,0xff,0xff,0xff,0xfa,0xff,0xff,0xff,0xfa});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xfb,0xff,0xff,0xff,0xfb});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xfd});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff});
+}
+void fs8b(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x03});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x05});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x06});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x09});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0a});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x0b});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x0c});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x0d});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x0e});
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x0f});
+}
+void fs8c(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0,0xff,0xf0});
+ *s8++ = ((vector signed char){0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1,0xff,0xf1});
+ *s8++ = ((vector signed char){0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2,0xff,0xf2});
+ *s8++ = ((vector signed char){0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3,0xff,0xf3});
+ *s8++ = ((vector signed char){0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4,0xff,0xf4});
+ *s8++ = ((vector signed char){0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5,0xff,0xf5});
+ *s8++ = ((vector signed char){0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6,0xff,0xf6});
+ *s8++ = ((vector signed char){0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7,0xff,0xf7});
+ *s8++ = ((vector signed char){0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8,0xff,0xf8});
+ *s8++ = ((vector signed char){0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9,0xff,0xf9});
+ *s8++ = ((vector signed char){0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa,0xff,0xfa});
+ *s8++ = ((vector signed char){0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb,0xff,0xfb});
+ *s8++ = ((vector signed char){0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc,0xff,0xfc});
+ *s8++ = ((vector signed char){0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd,0xff,0xfd});
+ *s8++ = ((vector signed char){0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe,0xff,0xfe});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff});
+}
+void fs8d(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
+ *s8++ = ((vector signed char){0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01});
+ *s8++ = ((vector signed char){0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02});
+ *s8++ = ((vector signed char){0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03});
+ *s8++ = ((vector signed char){0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04});
+ *s8++ = ((vector signed char){0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05});
+ *s8++ = ((vector signed char){0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06});
+ *s8++ = ((vector signed char){0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07});
+ *s8++ = ((vector signed char){0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08});
+ *s8++ = ((vector signed char){0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09});
+ *s8++ = ((vector signed char){0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a,0x00,0x0a});
+ *s8++ = ((vector signed char){0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b,0x00,0x0b});
+ *s8++ = ((vector signed char){0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c});
+ *s8++ = ((vector signed char){0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d,0x00,0x0d});
+ *s8++ = ((vector signed char){0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x00,0x0e});
+ *s8++ = ((vector signed char){0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f});
+}
+void fs8e(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00});
+ *s8++ = ((vector signed char){0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01});
+ *s8++ = ((vector signed char){0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02});
+ *s8++ = ((vector signed char){0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03});
+ *s8++ = ((vector signed char){0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04});
+ *s8++ = ((vector signed char){0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05});
+ *s8++ = ((vector signed char){0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06});
+ *s8++ = ((vector signed char){0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07});
+ *s8++ = ((vector signed char){0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08});
+ *s8++ = ((vector signed char){0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09});
+ *s8++ = ((vector signed char){0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a,0x0a});
+ *s8++ = ((vector signed char){0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b,0x0b});
+ *s8++ = ((vector signed char){0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c});
+ *s8++ = ((vector signed char){0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d});
+ *s8++ = ((vector signed char){0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e,0x0e});
+ *s8++ = ((vector signed char){0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f});
+}
+void fs8f(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0});
+ *s8++ = ((vector signed char){0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1});
+ *s8++ = ((vector signed char){0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2,0xf2});
+ *s8++ = ((vector signed char){0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3});
+ *s8++ = ((vector signed char){0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4,0xf4});
+ *s8++ = ((vector signed char){0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5,0xf5});
+ *s8++ = ((vector signed char){0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6,0xf6});
+ *s8++ = ((vector signed char){0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7});
+ *s8++ = ((vector signed char){0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8});
+ *s8++ = ((vector signed char){0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9,0xf9});
+ *s8++ = ((vector signed char){0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa});
+ *s8++ = ((vector signed char){0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb});
+ *s8++ = ((vector signed char){0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc});
+ *s8++ = ((vector signed char){0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd});
+ *s8++ = ((vector signed char){0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe});
+ *s8++ = ((vector signed char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff});
+}
+void fs8g(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0});
+ *s8++ = ((vector signed char){1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1});
+ *s8++ = ((vector signed char){2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2});
+ *s8++ = ((vector signed char){3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3});
+ *s8++ = ((vector signed char){4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4});
+ *s8++ = ((vector signed char){5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5});
+ *s8++ = ((vector signed char){6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6});
+ *s8++ = ((vector signed char){7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7});
+ *s8++ = ((vector signed char){8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8});
+ *s8++ = ((vector signed char){9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9});
+ *s8++ = ((vector signed char){10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10});
+ *s8++ = ((vector signed char){11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11});
+ *s8++ = ((vector signed char){12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12});
+ *s8++ = ((vector signed char){13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13});
+ *s8++ = ((vector signed char){14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14});
+ *s8++ = ((vector signed char){15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15});
+}
+void fs8h(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240});
+ *s8++ = ((vector signed char){241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241});
+ *s8++ = ((vector signed char){242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242});
+ *s8++ = ((vector signed char){243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243});
+ *s8++ = ((vector signed char){244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244});
+ *s8++ = ((vector signed char){245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245});
+ *s8++ = ((vector signed char){246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246});
+ *s8++ = ((vector signed char){247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247});
+ *s8++ = ((vector signed char){248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248});
+ *s8++ = ((vector signed char){249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249});
+ *s8++ = ((vector signed char){250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250});
+ *s8++ = ((vector signed char){251,251,251,251,251,251,251,251,251,251,251,251,251,251,251,251});
+ *s8++ = ((vector signed char){252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252});
+ *s8++ = ((vector signed char){253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253});
+ *s8++ = ((vector signed char){254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254});
+ *s8++ = ((vector signed char){255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255});
+}
+void fs8i(vector signed char *s8)
+{
+ *s8++ = ((vector signed char){-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1});
+ *s8++ = ((vector signed char){-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2});
+ *s8++ = ((vector signed char){-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3});
+ *s8++ = ((vector signed char){-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4});
+ *s8++ = ((vector signed char){-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5});
+ *s8++ = ((vector signed char){-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6,-6});
+ *s8++ = ((vector signed char){-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7});
+ *s8++ = ((vector signed char){-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8});
+ *s8++ = ((vector signed char){-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9});
+ *s8++ = ((vector signed char){-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10});
+ *s8++ = ((vector signed char){-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11});
+ *s8++ = ((vector signed char){-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12});
+ *s8++ = ((vector signed char){-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13,-13});
+ *s8++ = ((vector signed char){-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14,-14});
+ *s8++ = ((vector signed char){-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15,-15});
+ *s8++ = ((vector signed char){-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16,-16});
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-11.c
new file mode 100644
index 000000000..7d9b3975f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/5-11.c
@@ -0,0 +1,289 @@
+/* { dg-do compile } */
+#include <altivec.h>
+extern void fu32(vector unsigned int, vector unsigned int,
+ vector unsigned int, vector unsigned int);
+void fxu32(vector unsigned int u32a, vector unsigned int u32b,
+ vector unsigned int u32c, vector unsigned int u32d)
+{
+ fu32 (u32a,
+ u32b,
+ u32c,
+ vec_avg(u32d, u32d));
+ fu32 (vec_or (u32a, u32a),
+ vec_and (u32b, u32b),
+ vec_max (u32c, u32c),
+ vec_min (u32d, u32d));
+ fu32 (vec_sld (u32a, u32a, 0),
+ vec_sld (u32b, u32b, 0),
+ vec_sld (u32c, u32c, 0),
+ vec_sld (u32d, u32d, 0));
+ fu32 (((vector unsigned int){0,0,0,0}),
+ ((vector unsigned int){0,0,0,0}),
+ ((vector unsigned int){0,0,0,0}),
+ ((vector unsigned int){0,0,0,0}));
+ fu32 (vec_xor(u32a, u32a),
+ vec_andc(u32b, u32b),
+ vec_sub(u32c, u32c),
+ vec_subs(u32d, u32d));
+ fu32 (vec_splat_u32(0),
+ vec_splat_u32(0),
+ vec_splat_u32(0),
+ vec_splat_u32(0));
+ fu32 (((vector unsigned int){0xffffffff,0xffffffff,0xffffffff,0xffffffff}),
+ ((vector unsigned int){0xffffffff,0xffffffff,0xffffffff,0xffffffff}),
+ ((vector unsigned int){0xffffffff,0xffffffff,0xffffffff,0xffffffff}),
+ ((vector unsigned int){0xffffffff,0xffffffff,0xffffffff,0xffffffff}));
+ fu32 (vec_splat_u32(-1),
+ vec_splat_u32(-1),
+ vec_splat_u32(-1),
+ vec_splat_u32(-1));
+ fu32 ((vector unsigned int)vec_cmpeq(u32a, u32a),
+ (vector unsigned int)vec_cmpeq(u32b, u32b),
+ (vector unsigned int)vec_cmpeq(u32c, u32c),
+ (vector unsigned int)vec_cmpeq(u32d, u32d));
+}
+
+extern void fu16(vector unsigned short, vector unsigned short,
+ vector unsigned short, vector unsigned short);
+void fxu16(vector unsigned short u16a, vector unsigned short u16b,
+ vector unsigned short u16c, vector unsigned short u16d)
+{
+ fu16 (u16a,
+ u16b,
+ u16c,
+ vec_avg(u16d, u16d));
+ fu16 (vec_or (u16a, u16a),
+ vec_and (u16b, u16b),
+ vec_max (u16c, u16c),
+ vec_min (u16d, u16d));
+ fu16 (vec_sld (u16a, u16a, 0),
+ vec_sld (u16b, u16b, 0),
+ vec_sld (u16c, u16c, 0),
+ vec_sld (u16d, u16d, 0));
+ fu16 (((vector unsigned short){0,0,0,0,0,0,0,0}),
+ ((vector unsigned short){0,0,0,0,0,0,0,0}),
+ ((vector unsigned short){0,0,0,0,0,0,0,0}),
+ ((vector unsigned short){0,0,0,0,0,0,0,0}));
+ fu16 (vec_xor(u16a, u16a),
+ vec_andc(u16b, u16b),
+ vec_sub(u16c, u16c),
+ vec_subs(u16d, u16d));
+ fu16 (vec_splat_u16(0),
+ vec_splat_u16(0),
+ vec_splat_u16(0),
+ vec_splat_u16(0));
+ fu16 (((vector unsigned short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff}),
+ ((vector unsigned short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff}),
+ ((vector unsigned short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff}),
+ ((vector unsigned short){0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff}));
+ fu16 (vec_splat_u16(-1),
+ vec_splat_u16(-1),
+ vec_splat_u16(-1),
+ vec_splat_u16(-1));
+ fu16 ((vector unsigned short)vec_cmpeq(u16a, u16a),
+ (vector unsigned short)vec_cmpeq(u16b, u16b),
+ (vector unsigned short)vec_cmpeq(u16c, u16c),
+ (vector unsigned short)vec_cmpeq(u16d, u16d));
+}
+
+extern void fu8(vector unsigned char, vector unsigned char,
+ vector unsigned char, vector unsigned char);
+void fxu8(vector unsigned char u8a, vector unsigned char u8b,
+ vector unsigned char u8c, vector unsigned char u8d)
+{
+ fu8 (u8a,
+ u8b,
+ u8c,
+ vec_avg(u8d, u8d));
+ fu8 (vec_or (u8a, u8a),
+ vec_and (u8b, u8b),
+ vec_max (u8c, u8c),
+ vec_min (u8d, u8d));
+ fu8 (vec_sld (u8a, u8a, 0),
+ vec_sld (u8b, u8b, 0),
+ vec_sld (u8c, u8c, 0),
+ vec_sld (u8d, u8d, 0));
+ fu8 (((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}),
+ ((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}),
+ ((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}),
+ ((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}));
+ fu8 (vec_xor(u8a, u8a),
+ vec_andc(u8b, u8b),
+ vec_sub(u8c, u8c),
+ vec_subs(u8d, u8d));
+ fu8 (vec_splat_u8(0),
+ vec_splat_u8(0),
+ vec_splat_u8(0),
+ vec_splat_u8(0));
+ fu8 (((vector unsigned char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}),
+ ((vector unsigned char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}),
+ ((vector unsigned char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}),
+ ((vector unsigned char){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}));
+ fu8 (vec_splat_u8(-1),
+ vec_splat_u8(-1),
+ vec_splat_u8(-1),
+ vec_splat_u8(-1));
+ fu8 ((vector unsigned char)vec_cmpeq(u8a, u8a),
+ (vector unsigned char)vec_cmpeq(u8b, u8b),
+ (vector unsigned char)vec_cmpeq(u8c, u8c),
+ (vector unsigned char)vec_cmpeq(u8d, u8d));
+}
+
+extern void fs32(vector signed int, vector signed int,
+ vector signed int, vector signed int);
+void fxs32(vector signed int s32a, vector signed int s32b,
+ vector signed int s32c, vector signed int s32d)
+{
+ fs32 (s32a,
+ s32b,
+ s32c,
+ vec_avg(s32d, s32d));
+ fs32 (vec_or (s32a, s32a),
+ vec_and (s32b, s32b),
+ vec_max (s32c, s32c),
+ vec_min (s32d, s32d));
+ fs32 (vec_sld (s32a, s32a, 0),
+ vec_sld (s32b, s32b, 0),
+ vec_sld (s32c, s32c, 0),
+ vec_sld (s32d, s32d, 0));
+ fs32 (((vector signed int){0,0,0,0}),
+ ((vector signed int){0,0,0,0}),
+ ((vector signed int){0,0,0,0}),
+ ((vector signed int){0,0,0,0}));
+ fs32 (vec_xor(s32a, s32a),
+ vec_andc(s32b, s32b),
+ vec_sub(s32c, s32c),
+ vec_subs(s32d, s32d));
+ fs32 (vec_splat_s32(0),
+ vec_splat_s32(0),
+ vec_splat_s32(0),
+ vec_splat_s32(0));
+ fs32 (((vector signed int){-1,-1,-1,-1}),
+ ((vector signed int){-1,-1,-1,-1}),
+ ((vector signed int){-1,-1,-1,-1}),
+ ((vector signed int){-1,-1,-1,-1}));
+ fs32 (vec_splat_s32(-1),
+ vec_splat_s32(-1),
+ vec_splat_s32(-1),
+ vec_splat_s32(-1));
+ fs32 ((vector signed int)vec_cmpeq(s32a, s32a),
+ (vector signed int)vec_cmpeq(s32b, s32b),
+ (vector signed int)vec_cmpeq(s32c, s32c),
+ (vector signed int)vec_cmpeq(s32d, s32d));
+}
+
+extern void fs16(vector signed short, vector signed short,
+ vector signed short, vector signed short);
+void fxs16(vector signed short s16a, vector signed short s16b,
+ vector signed short s16c, vector signed short s16d)
+{
+ fs16 (s16a,
+ s16b,
+ s16c,
+ vec_avg(s16d, s16d));
+ fs16 (vec_or (s16a, s16a),
+ vec_and (s16b, s16b),
+ vec_max (s16c, s16c),
+ vec_min (s16d, s16d));
+ fs16 (vec_sld (s16a, s16a, 0),
+ vec_sld (s16b, s16b, 0),
+ vec_sld (s16c, s16c, 0),
+ vec_sld (s16d, s16d, 0));
+ fs16 (((vector signed short){0,0,0,0,0,0,0,0}),
+ ((vector signed short){0,0,0,0,0,0,0,0}),
+ ((vector signed short){0,0,0,0,0,0,0,0}),
+ ((vector signed short){0,0,0,0,0,0,0,0}));
+ fs16 (vec_xor(s16a, s16a),
+ vec_andc(s16b, s16b),
+ vec_sub(s16c, s16c),
+ vec_subs(s16d, s16d));
+ fs16 (vec_splat_s16(0),
+ vec_splat_s16(0),
+ vec_splat_s16(0),
+ vec_splat_s16(0));
+ fs16 (((vector signed short){-1,-1,-1,-1,-1,-1,-1,-1}),
+ ((vector signed short){-1,-1,-1,-1,-1,-1,-1,-1}),
+ ((vector signed short){-1,-1,-1,-1,-1,-1,-1,-1}),
+ ((vector signed short){-1,-1,-1,-1,-1,-1,-1,-1}));
+ fs16 (vec_splat_s16(-1),
+ vec_splat_s16(-1),
+ vec_splat_s16(-1),
+ vec_splat_s16(-1));
+ fs16 ((vector signed short)vec_cmpeq(s16a, s16a),
+ (vector signed short)vec_cmpeq(s16b, s16b),
+ (vector signed short)vec_cmpeq(s16c, s16c),
+ (vector signed short)vec_cmpeq(s16d, s16d));
+}
+
+extern void fs8(vector signed char, vector signed char,
+ vector signed char, vector signed char);
+void fxs8(vector signed char s8a, vector signed char s8b,
+ vector signed char s8c, vector signed char s8d)
+{
+ fs8 (s8a,
+ s8b,
+ s8c,
+ vec_avg(s8d, s8d));
+ fs8 (vec_or (s8a, s8a),
+ vec_and (s8b, s8b),
+ vec_max (s8c, s8c),
+ vec_min (s8d, s8d));
+ fs8 (vec_sld (s8a, s8a, 0),
+ vec_sld (s8b, s8b, 0),
+ vec_sld (s8c, s8c, 0),
+ vec_sld (s8d, s8d, 0));
+ fs8 (((vector signed char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}),
+ ((vector signed char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}),
+ ((vector signed char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}),
+ ((vector signed char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}));
+ fs8 (vec_xor(s8a, s8a),
+ vec_andc(s8b, s8b),
+ vec_sub(s8c, s8c),
+ vec_subs(s8d, s8d));
+ fs8 (vec_splat_s8(0),
+ vec_splat_s8(0),
+ vec_splat_s8(0),
+ vec_splat_s8(0));
+ fs8 (((vector signed char){-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}),
+ ((vector signed char){-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}),
+ ((vector signed char){-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}),
+ ((vector signed char){-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}));
+ fs8 (vec_splat_s8(-1),
+ vec_splat_s8(-1),
+ vec_splat_s8(-1),
+ vec_splat_s8(-1));
+ fs8 ((vector signed char)vec_cmpeq(s8a, s8a),
+ (vector signed char)vec_cmpeq(s8b, s8b),
+ (vector signed char)vec_cmpeq(s8c, s8c),
+ (vector signed char)vec_cmpeq(s8d, s8d));
+}
+
+void fu32(vector unsigned int a, vector unsigned int b,
+ vector unsigned int c, vector unsigned int d)
+{
+}
+
+void fu16(vector unsigned short a, vector unsigned short b,
+ vector unsigned short c, vector unsigned short d)
+{
+}
+
+void fu8(vector unsigned char a, vector unsigned char b,
+ vector unsigned char c, vector unsigned char d)
+{
+}
+
+void fs32(vector signed int a, vector signed int b,
+ vector signed int c, vector signed int d)
+{
+}
+
+void fs16(vector signed short a, vector signed short b,
+ vector signed short c, vector signed short d)
+{
+}
+
+void fs8(vector signed char a, vector signed char b,
+ vector signed char c, vector signed char d)
+{
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7-01.c
new file mode 100644
index 000000000..f986d8fe5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7-01.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+#include <altivec.h>
+extern vector signed short image[];
+extern vector signed short band[];
+
+#define load(a,b) (a[b])
+#define store(v,a,b) (a[b]) = (v)
+
+void
+haar (vector signed char a, vector signed char b, vector signed char c,
+ vector signed char d, unsigned int N, int XX)
+{
+ unsigned int i;
+ vector unsigned char high, low;
+ vector signed int zero = ((vector signed int){0,0,0,0});
+
+ for (i = 0; i < N; i++) {
+ high = (vector unsigned char) (vec_vmrghh (load(image, i+XX),
+ load(image, i)));
+ low = (vector unsigned char) (vec_vmrglh (load(image, i+XX),
+ load(image, i)));
+
+ store (vec_vpkswss (vec_vmsummbm (a, high, zero),
+ vec_vmsummbm (a, low, zero)),
+ band, i);
+ store (vec_vpkswss (vec_vmsummbm (b, high, zero),
+ vec_vmsummbm (b, low, zero)),
+ band, i+1);
+ store(vec_vpkswss (vec_vmsummbm (c, high, zero),
+ vec_vmsummbm (c, low, zero)),
+ band, i+2);
+ store(vec_vpkswss (vec_vmsummbm (d, high, zero),
+ vec_vmsummbm (d, low, zero)),
+ band, i+3);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7-01a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7-01a.c
new file mode 100644
index 000000000..c09835b43
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7-01a.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+#include <altivec.h>
+extern vector signed short image[];
+extern vector signed short band[];
+
+#define load(a,b) vec_ld((b)*16, a)
+#define store(v,a,b) vec_st(v,(b)*16,a)
+
+void
+haar (vector signed char a, vector signed char b, vector signed char c,
+ vector signed char d, unsigned int N, int XX)
+{
+ unsigned int i;
+ vector unsigned char high, low;
+ vector signed int zero = ((vector signed int){0,0,0,0});
+
+ for (i = 0; i < N; i++) {
+ high = (vector unsigned char) (vec_vmrghh (load(image, i+XX),
+ load(image, i)));
+ low = (vector unsigned char) (vec_vmrglh (load(image, i+XX),
+ load(image, i)));
+
+ store (vec_vpkswss (vec_vmsummbm (a, high, zero),
+ vec_vmsummbm (a, low, zero)),
+ band, i);
+ store (vec_vpkswss (vec_vmsummbm (b, high, zero),
+ vec_vmsummbm (b, low, zero)),
+ band, i+1);
+ store(vec_vpkswss (vec_vmsummbm (c, high, zero),
+ vec_vmsummbm (c, low, zero)),
+ band, i+2);
+ store(vec_vpkswss (vec_vmsummbm (d, high, zero),
+ vec_vmsummbm (d, low, zero)),
+ band, i+3);
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7c-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7c-01.c
new file mode 100644
index 000000000..68e07aa30
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7c-01.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector float
+f(int i)
+{
+ switch (i) {
+ case 0:
+ return (vector float)(((vector unsigned char){3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}));
+ }
+ return ((vector float){0,0,0,0});
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7d-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7d-01.c
new file mode 100644
index 000000000..dac5151ad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7d-01.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+#include <altivec.h>
+extern vector unsigned char a[];
+
+vector unsigned char
+f(vector unsigned char *p, int i, int b)
+{
+ if (b)
+ return p[i];
+ return vec_ld(i*16,p);
+}
+
+vector unsigned char
+g(int i, int b)
+{
+ if (b)
+ return a[i];
+ return vec_ld(i*16,a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7d-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7d-02.c
new file mode 100644
index 000000000..6294cc99e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/7d-02.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+#include <altivec.h>
+extern vector unsigned char a[];
+
+void f
+(vector unsigned char v, vector unsigned char *p, int i, int b)
+{
+ if (b)
+ p[i] = v;
+ else
+ vec_st(v, i*16,p);
+}
+
+void g
+(vector unsigned char v, int i, int b)
+{
+ if (b)
+ a[i] = v;
+ else
+ vec_st(v,i*16,a);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-01.c
new file mode 100644
index 000000000..d65815e3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-01.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+#include <altivec.h>
+
+int i = vec_step(vector unsigned short);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-02.c
new file mode 100644
index 000000000..72a4a907a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-02.c
@@ -0,0 +1,299 @@
+#include "harness.h"
+
+extern vector unsigned char u8;
+extern vector signed char s8;
+extern vector bool char b8;
+extern vector unsigned short u16;
+extern vector signed short s16;
+extern vector bool short b16;
+extern vector unsigned int u32;
+extern vector signed int s32;
+extern vector bool int b32;
+extern vector float f32;
+extern vector pixel p16;
+extern vector unsigned char const u8c;
+extern vector signed char const s8c;
+extern vector bool char const b8c;
+extern vector unsigned short const u16c;
+extern vector signed short const s16c;
+extern vector bool short const b16c;
+extern vector unsigned int const u32c;
+extern vector signed int const s32c;
+extern vector bool int const b32c;
+extern vector float const f32c;
+extern vector pixel const p16c;
+extern vector unsigned char volatile u8v;
+extern vector signed char volatile s8v;
+extern vector bool char volatile b8v;
+extern vector unsigned short volatile u16v;
+extern vector signed short volatile s16v;
+extern vector bool short volatile b16v;
+extern vector unsigned int volatile u32v;
+extern vector signed int volatile s32v;
+extern vector bool int volatile b32v;
+extern vector float volatile f32v;
+extern vector pixel volatile p16v;
+extern const vector unsigned char u8c_;
+extern const vector signed char s8c_;
+extern const vector bool char b8c_;
+extern const vector unsigned short u16c_;
+extern const vector signed short s16c_;
+extern const vector bool short b16c_;
+extern const vector unsigned int u32c_;
+extern const vector signed int s32c_;
+extern const vector bool int b32c_;
+extern const vector float f32c_;
+extern const vector pixel p16c_;
+extern volatile vector unsigned char u8v_;
+extern volatile vector signed char s8v_;
+extern volatile vector bool char b8v_;
+extern volatile vector unsigned short u16v_;
+extern volatile vector signed short s16v_;
+extern volatile vector bool short b16v_;
+extern volatile vector unsigned int u32v_;
+extern volatile vector signed int s32v_;
+extern volatile vector bool int b32v_;
+extern volatile vector float f32v_;
+extern volatile vector pixel p16v_;
+int i_u8 = vec_step(u8);
+int i_s8 = vec_step(s8);
+int i_b8 = vec_step(b8);
+int i_u16 = vec_step(u16);
+int i_s16 = vec_step(s16);
+int i_b16 = vec_step(b16);
+int i_u32 = vec_step(u32);
+int i_s32 = vec_step(s32);
+int i_b32 = vec_step(b32);
+int i_f32 = vec_step(f32);
+int i_p16 = vec_step(p16);
+int i_u8c = vec_step(u8c);
+int i_s8c = vec_step(s8c);
+int i_b8c = vec_step(b8c);
+int i_u16c = vec_step(u16c);
+int i_s16c = vec_step(s16c);
+int i_b16c = vec_step(b16c);
+int i_u32c = vec_step(u32c);
+int i_s32c = vec_step(s32c);
+int i_b32c = vec_step(b32c);
+int i_f32c = vec_step(f32c);
+int i_p16c = vec_step(p16c);
+int i_u8v = vec_step(u8v);
+int i_s8v = vec_step(s8v);
+int i_b8v = vec_step(b8v);
+int i_u16v = vec_step(u16v);
+int i_s16v = vec_step(s16v);
+int i_b16v = vec_step(b16v);
+int i_u32v = vec_step(u32v);
+int i_s32v = vec_step(s32v);
+int i_b32v = vec_step(b32v);
+int i_f32v = vec_step(f32v);
+int i_p16v = vec_step(p16v);
+int i_u8c_ = vec_step(u8c_);
+int i_s8c_ = vec_step(s8c_);
+int i_b8c_ = vec_step(b8c_);
+int i_u16c_ = vec_step(u16c_);
+int i_s16c_ = vec_step(s16c_);
+int i_b16c_ = vec_step(b16c_);
+int i_u32c_ = vec_step(u32c_);
+int i_s32c_ = vec_step(s32c_);
+int i_b32c_ = vec_step(b32c_);
+int i_f32c_ = vec_step(f32c_);
+int i_p16c_ = vec_step(p16c_);
+int i_u8v_ = vec_step(u8v_);
+int i_s8v_ = vec_step(s8v_);
+int i_b8v_ = vec_step(b8v_);
+int i_u16v_ = vec_step(u16v_);
+int i_s16v_ = vec_step(s16v_);
+int i_b16v_ = vec_step(b16v_);
+int i_u32v_ = vec_step(u32v_);
+int i_s32v_ = vec_step(s32v_);
+int i_b32v_ = vec_step(b32v_);
+int i_f32v_ = vec_step(f32v_);
+int i_p16v_ = vec_step(p16v_);
+int j_u8 = vec_step(vector unsigned char);
+int j_s8 = vec_step(vector signed char);
+int j_b8 = vec_step(vector bool char);
+int j_u16 = vec_step(vector unsigned short);
+int j_s16 = vec_step(vector signed short);
+int j_b16 = vec_step(vector bool short);
+int j_u32 = vec_step(vector unsigned int);
+int j_s32 = vec_step(vector signed int);
+int j_b32 = vec_step(vector bool int);
+int j_f32 = vec_step(vector float);
+int j_p16 = vec_step(vector pixel);
+int j_u8c = vec_step(vector unsigned char const);
+int j_s8c = vec_step(vector signed char const);
+int j_b8c = vec_step(vector bool char const);
+int j_u16c = vec_step(vector unsigned short const);
+int j_s16c = vec_step(vector signed short const);
+int j_b16c = vec_step(vector bool short const);
+int j_u32c = vec_step(vector unsigned int const);
+int j_s32c = vec_step(vector signed int const);
+int j_b32c = vec_step(vector bool int const);
+int j_f32c = vec_step(vector float const);
+int j_p16c = vec_step(vector pixel const);
+int j_u8v = vec_step(vector unsigned char volatile);
+int j_s8v = vec_step(vector signed char volatile);
+int j_b8v = vec_step(vector bool char volatile);
+int j_u16v = vec_step(vector unsigned short volatile);
+int j_s16v = vec_step(vector signed short volatile);
+int j_b16v = vec_step(vector bool short volatile);
+int j_u32v = vec_step(vector unsigned int volatile);
+int j_s32v = vec_step(vector signed int volatile);
+int j_b32v = vec_step(vector bool int volatile);
+int j_f32v = vec_step(vector float volatile);
+int j_p16v = vec_step(vector pixel volatile);
+int j_u8c_ = vec_step(const vector unsigned char);
+int j_s8c_ = vec_step(const vector signed char);
+int j_b8c_ = vec_step(const vector bool char);
+int j_u16c_ = vec_step(const vector unsigned short);
+int j_s16c_ = vec_step(const vector signed short);
+int j_b16c_ = vec_step(const vector bool short);
+int j_u32c_ = vec_step(const vector unsigned int);
+int j_s32c_ = vec_step(const vector signed int);
+int j_b32c_ = vec_step(const vector bool int);
+int j_f32c_ = vec_step(const vector float);
+int j_p16c_ = vec_step(const vector pixel);
+int j_u8v_ = vec_step(volatile vector unsigned char);
+int j_s8v_ = vec_step(volatile vector signed char);
+int j_b8v_ = vec_step(volatile vector bool char);
+int j_u16v_ = vec_step(volatile vector unsigned short);
+int j_s16v_ = vec_step(volatile vector signed short);
+int j_b16v_ = vec_step(volatile vector bool short);
+int j_u32v_ = vec_step(volatile vector unsigned int);
+int j_s32v_ = vec_step(volatile vector signed int);
+int j_b32v_ = vec_step(volatile vector bool int);
+int j_f32v_ = vec_step(volatile vector float);
+int j_p16v_ = vec_step(volatile vector pixel);
+
+static void test()
+{
+ int i_u8 = vec_step(u8);
+ int i_s8 = vec_step(s8);
+ int i_b8 = vec_step(b8);
+ int i_u16 = vec_step(u16);
+ int i_s16 = vec_step(s16);
+ int i_b16 = vec_step(b16);
+ int i_u32 = vec_step(u32);
+ int i_s32 = vec_step(s32);
+ int i_b32 = vec_step(b32);
+ int i_f32 = vec_step(f32);
+ int i_p16 = vec_step(p16);
+ int i_u8c = vec_step(u8c);
+ int i_s8c = vec_step(s8c);
+ int i_b8c = vec_step(b8c);
+ int i_u16c = vec_step(u16c);
+ int i_s16c = vec_step(s16c);
+ int i_b16c = vec_step(b16c);
+ int i_u32c = vec_step(u32c);
+ int i_s32c = vec_step(s32c);
+ int i_b32c = vec_step(b32c);
+ int i_f32c = vec_step(f32c);
+ int i_p16c = vec_step(p16c);
+ int i_u8v = vec_step(u8v);
+ int i_s8v = vec_step(s8v);
+ int i_b8v = vec_step(b8v);
+ int i_u16v = vec_step(u16v);
+ int i_s16v = vec_step(s16v);
+ int i_b16v = vec_step(b16v);
+ int i_u32v = vec_step(u32v);
+ int i_s32v = vec_step(s32v);
+ int i_b32v = vec_step(b32v);
+ int i_f32v = vec_step(f32v);
+ int i_p16v = vec_step(p16v);
+ int i_u8c_ = vec_step(u8c_);
+ int i_s8c_ = vec_step(s8c_);
+ int i_b8c_ = vec_step(b8c_);
+ int i_u16c_ = vec_step(u16c_);
+ int i_s16c_ = vec_step(s16c_);
+ int i_b16c_ = vec_step(b16c_);
+ int i_u32c_ = vec_step(u32c_);
+ int i_s32c_ = vec_step(s32c_);
+ int i_b32c_ = vec_step(b32c_);
+ int i_f32c_ = vec_step(f32c_);
+ int i_p16c_ = vec_step(p16c_);
+ int i_u8v_ = vec_step(u8v_);
+ int i_s8v_ = vec_step(s8v_);
+ int i_b8v_ = vec_step(b8v_);
+ int i_u16v_ = vec_step(u16v_);
+ int i_s16v_ = vec_step(s16v_);
+ int i_b16v_ = vec_step(b16v_);
+ int i_u32v_ = vec_step(u32v_);
+ int i_s32v_ = vec_step(s32v_);
+ int i_b32v_ = vec_step(b32v_);
+ int i_f32v_ = vec_step(f32v_);
+ int i_p16v_ = vec_step(p16v_);
+ int j_u8 = vec_step(vector unsigned char);
+ int j_s8 = vec_step(vector signed char);
+ int j_b8 = vec_step(vector bool char);
+ int j_u16 = vec_step(vector unsigned short);
+ int j_s16 = vec_step(vector signed short);
+ int j_b16 = vec_step(vector bool short);
+ int j_u32 = vec_step(vector unsigned int);
+ int j_s32 = vec_step(vector signed int);
+ int j_b32 = vec_step(vector bool int);
+ int j_f32 = vec_step(vector float);
+ int j_p16 = vec_step(vector pixel);
+ int j_u8c = vec_step(vector unsigned char const);
+ int j_s8c = vec_step(vector signed char const);
+ int j_b8c = vec_step(vector bool char const);
+ int j_u16c = vec_step(vector unsigned short const);
+ int j_s16c = vec_step(vector signed short const);
+ int j_b16c = vec_step(vector bool short const);
+ int j_u32c = vec_step(vector unsigned int const);
+ int j_s32c = vec_step(vector signed int const);
+ int j_b32c = vec_step(vector bool int const);
+ int j_f32c = vec_step(vector float const);
+ int j_p16c = vec_step(vector pixel const);
+ int j_u8v = vec_step(vector unsigned char volatile);
+ int j_s8v = vec_step(vector signed char volatile);
+ int j_b8v = vec_step(vector bool char volatile);
+ int j_u16v = vec_step(vector unsigned short volatile);
+ int j_s16v = vec_step(vector signed short volatile);
+ int j_b16v = vec_step(vector bool short volatile);
+ int j_u32v = vec_step(vector unsigned int volatile);
+ int j_s32v = vec_step(vector signed int volatile);
+ int j_b32v = vec_step(vector bool int volatile);
+ int j_f32v = vec_step(vector float volatile);
+ int j_p16v = vec_step(vector pixel volatile);
+ int j_u8c_ = vec_step(const vector unsigned char);
+ int j_s8c_ = vec_step(const vector signed char);
+ int j_b8c_ = vec_step(const vector bool char);
+ int j_u16c_ = vec_step(const vector unsigned short);
+ int j_s16c_ = vec_step(const vector signed short);
+ int j_b16c_ = vec_step(const vector bool short);
+ int j_u32c_ = vec_step(const vector unsigned int);
+ int j_s32c_ = vec_step(const vector signed int);
+ int j_b32c_ = vec_step(const vector bool int);
+ int j_f32c_ = vec_step(const vector float);
+ int j_p16c_ = vec_step(const vector pixel);
+ int j_u8v_ = vec_step(volatile vector unsigned char);
+ int j_s8v_ = vec_step(volatile vector signed char);
+ int j_b8v_ = vec_step(volatile vector bool char);
+ int j_u16v_ = vec_step(volatile vector unsigned short);
+ int j_s16v_ = vec_step(volatile vector signed short);
+ int j_b16v_ = vec_step(volatile vector bool short);
+ int j_u32v_ = vec_step(volatile vector unsigned int);
+ int j_s32v_ = vec_step(volatile vector signed int);
+ int j_b32v_ = vec_step(volatile vector bool int);
+ int j_f32v_ = vec_step(volatile vector float);
+ int j_p16v_ = vec_step(volatile vector pixel);
+ check((i_u8 + i_s8 + i_b8 + i_u16 + i_s16 + i_b16 + i_u32 + i_s32 +
+ i_b32 + i_f32 + i_p16 + i_u8c + i_s8c + i_b8c + i_u16c +
+ i_s16c + i_b16c + i_u32c + i_s32c + i_b32c + i_f32c + i_p16c
+ + i_u8v + i_s8v + i_b8v + i_u16v + i_s16v + i_b16v + i_u32v
+ + i_s32v + i_b32v + i_f32v + i_p16v + i_u8c_ + i_s8c_ +
+ i_b8c_ + i_u16c_ + i_s16c_ + i_b16c_ + i_u32c_ + i_s32c_ +
+ i_b32c_ + i_f32c_ + i_p16c_ + i_u8v_ + i_s8v_ + i_b8v_ +
+ i_u16v_ + i_s16v_ + i_b16v_ + i_u32v_ + i_s32v_ + i_b32v_ +
+ i_f32v_ + i_p16v_ + j_u8 + j_s8 + j_b8 + j_u16 + j_s16 +
+ j_b16 + j_u32 + j_s32 + j_b32 + j_f32 + j_p16 + j_u8c +
+ j_s8c + j_b8c + j_u16c + j_s16c + j_b16c + j_u32c + j_s32c +
+ j_b32c + j_f32c + j_p16c + j_u8v + j_s8v + j_b8v + j_u16v +
+ j_s16v + j_b16v + j_u32v + j_s32v + j_b32v + j_f32v + j_p16v
+ + j_u8c_ + j_s8c_ + j_b8c_ + j_u16c_ + j_s16c_ + j_b16c_ +
+ j_u32c_ + j_s32c_ + j_b32c_ + j_f32c_ + j_p16c_ + j_u8v_ +
+ j_s8v_ + j_b8v_ + j_u16v_ + j_s16v_ + j_b16v_ + j_u32v_ +
+ j_s32v_ + j_b32v_ + j_f32v_ + j_p16v_) == 960,
+ "vec_step");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-02a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-02a.c
new file mode 100644
index 000000000..cbea6ca6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/8-02a.c
@@ -0,0 +1,17 @@
+#include "harness.h"
+
+extern vector pixel p16;
+extern vector pixel const p16c;
+extern vector pixel volatile p16v;
+extern const vector pixel p16c_;
+extern volatile vector pixel p16v_;
+
+static void test()
+{
+ int i_p16 = vec_step(p16);
+ int i_p16c = vec_step(p16c);
+ int i_p16v = vec_step(p16v);
+ int i_p16c_ = vec_step(p16c_);
+ int i_p16v_ = vec_step(p16v_);
+ check((i_p16 + i_p16c + i_p16v + i_p16c_ + i_p16v_) == 40, "vec_step");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/brode-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/brode-1.c
new file mode 100644
index 000000000..234192bac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/brode-1.c
@@ -0,0 +1,10 @@
+#include <altivec.h>
+ int main( )
+ {
+ static int a[3][5][7];
+ {
+ vector signed int a4v;
+ a4v = vec_ldl(0, &a[0][0][0]);
+ }
+ return 0;
+ }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-1.c
new file mode 100644
index 000000000..fdf392d5f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-1.c
@@ -0,0 +1,39 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <altivec.h>
+
+#define NPAGES 20
+#define NSKIP 10
+static vector float big[NPAGES*4096/16] = { {1,1,1,1} };
+/* NPAGES pages worth. */
+
+static int failed;
+
+static void f(vector float *p)
+{
+ int i = 1;
+ p = (vector float *)(((ptrdiff_t)p + 4095) & ~4095);
+
+ i += NSKIP;
+ p += NSKIP*4096/16;
+
+ while (i < NPAGES)
+ {
+ if (!vec_all_eq(*p,((vector float){0,0,0,0})))
+ {
+ printf("*p isn't zero at 0x%p, page %d\n", p, i);
+ failed++;
+ }
+ i++;
+ p += 4096/16;
+ }
+}
+
+int main(void)
+{
+ f(big);
+ if (failed)
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-2.c
new file mode 100644
index 000000000..5cdbc9856
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-2.c
@@ -0,0 +1,24 @@
+#include "harness.h"
+
+static vector unsigned char value =
+ { 0x7c, 0x12, 0x1, 0xd5,
+ 0xc3, 0x99, 0x21, 0xe2,
+ 0x12, 0x57, 0xde, 0x6b,
+ 0x39, 0x66, 0xa8, 0x87 };
+
+void initn_c (int p1, int p2, signed char p3, int p4, double p5 ,
+ vector unsigned char p6, signed char p7)
+{
+ check(p1 == 3, "p1");
+ check(p2 == 4, "p2");
+ check(p3 == 5, "p3");
+ check(p4 == 6, "p4");
+ check(p5 == 1, "p5");
+ check(vec_all_eq(p6, value), "p6");
+ check(p7 == 7, "p7");
+}
+
+void test()
+{
+ initn_c (3, 4, 5, 6, 1, value, 7);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-3.c
new file mode 100644
index 000000000..aacca2667
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/bug-3.c
@@ -0,0 +1,45 @@
+#include "harness.h"
+
+static vector unsigned int value = { 9, 9, 9, 9 };
+
+void varargsC2 (int p1, int p2, int p3, int p4, int p5, int p6, int p7,
+ int p8, vector unsigned int p9, int p10)
+{
+ int i1;
+ int i2;
+ int i3;
+ int i4;
+ int i5;
+ int i6;
+ int i7;
+ int i8;
+ vector unsigned int i9;
+ int i10;
+
+ i1 = p1;
+ i2 = p2;
+ i3 = p3;
+ i4 = p4;
+ i5 = p5;
+ i6 = p6;
+ i7 = p7;
+ i8 = p8;
+ i9 = p9;
+ i10 = p10;
+
+ check(i1 == 1, "i1");
+ check(i2 == 2, "i2");
+ check(i3 == 3, "i3");
+ check(i4 == 4, "i4");
+ check(i5 == 5, "i5");
+ check(i6 == 6, "i6");
+ check(i7 == 7, "i7");
+ check(i8 == 8, "i8");
+ check(vec_all_eq(i9, value), "i9");
+ check(i10 == 10, "i10");
+}
+
+void test()
+{
+ varargsC2 (1, 2, 3, 4, 5, 6, 7, 8, ((vector unsigned int){9,9,9,9}), 10);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/cw-bug-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/cw-bug-1.c
new file mode 100644
index 000000000..0c3028b51
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/cw-bug-1.c
@@ -0,0 +1,12 @@
+#include <altivec.h>
+#include <stdlib.h>
+
+#define ZERO (((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}))
+
+int main(void)
+{
+ vector unsigned char a = ZERO;
+ if (vec_any_ne(a, ZERO))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/cw-bug-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/cw-bug-3.c
new file mode 100644
index 000000000..511a7e0ae
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/cw-bug-3.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector signed short hamming_window[1] = {
+ {2621, 2623, 2629, 2638, 2651, 2668, 2689, 2713}
+};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dct.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dct.c
new file mode 100644
index 000000000..00c4cd93c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dct.c
@@ -0,0 +1,176 @@
+/* { dg-do compile } */
+#include <altivec.h>
+
+inline void
+transpose_vmx (vector signed short *input, vector signed short *output)
+{
+ vector signed short v0, v1, v2, v3, v4, v5, v6, v7;
+ vector signed short x0, x1, x2, x3, x4, x5, x6, x7;
+
+ /* Matrix transpose */
+ v0 = vec_mergeh (input[0], input[4]);
+ v1 = vec_mergel (input[0], input[4]);
+ v2 = vec_mergeh (input[1], input[5]);
+ v3 = vec_mergel (input[1], input[5]);
+ v4 = vec_mergeh (input[2], input[6]);
+ v5 = vec_mergel (input[2], input[6]);
+ v6 = vec_mergeh (input[3], input[7]);
+ v7 = vec_mergel (input[3], input[7]);
+
+ x0 = vec_mergeh (v0, v4);
+ x1 = vec_mergel (v0, v4);
+ x2 = vec_mergeh (v1, v5);
+ x3 = vec_mergel (v1, v5);
+ x4 = vec_mergeh (v2, v6);
+ x5 = vec_mergel (v2, v6);
+ x6 = vec_mergeh (v3, v7);
+ x7 = vec_mergel (v3, v7);
+
+ output[0] = vec_mergeh (x0, x4);
+ output[1] = vec_mergel (x0, x4);
+ output[2] = vec_mergeh (x1, x5);
+ output[3] = vec_mergel (x1, x5);
+ output[4] = vec_mergeh (x2, x6);
+ output[5] = vec_mergel (x2, x6);
+ output[6] = vec_mergeh (x3, x7);
+ output[7] = vec_mergel (x3, x7);
+}
+
+void
+dct_vmx (vector signed short *input, vector signed short *output,
+ vector signed short *postscale)
+{
+ vector signed short mul0, mul1, mul2, mul3, mul4, mul5, mul6, mul;
+ vector signed short v0, v1, v2, v3, v4, v5, v6, v7, v8, v9;
+ vector signed short v20, v21, v22, v23, v24, v25, v26, v27, v31;
+ int i;
+ vector signed short in[8], out[8];
+
+ /* Load first eight rows of input data */
+
+ /* Load multiplication constants */
+
+ /* Splat multiplication constants */
+ mul0 = vec_splat(input[8],0);
+ mul1 = vec_splat(input[8],1);
+ mul2 = vec_splat(input[8],2);
+ mul3 = vec_splat(input[8],3);
+ mul4 = vec_splat(input[8],4);
+ mul5 = vec_splat(input[8],5);
+ mul6 = vec_splat(input[8],6);
+
+ /* Perform DCT on the eight columns */
+
+ /*********** Stage 1 ***********/
+
+ v8 = vec_adds (input[0], input[7]);
+ v9 = vec_subs (input[0], input[7]);
+ v0 = vec_adds (input[1], input[6]);
+ v7 = vec_subs (input[1], input[6]);
+ v1 = vec_adds (input[2], input[5]);
+ v6 = vec_subs (input[2], input[5]);
+ v2 = vec_adds (input[3], input[4]);
+ v5 = vec_subs (input[3], input[4]);
+
+ /*********** Stage 2 ***********/
+
+ /* Top */
+ v3 = vec_adds (v8, v2); /* (V0+V7) + (V3+V4) */
+ v4 = vec_subs (v8, v2); /* (V0+V7) - (V3+V4) */
+ v2 = vec_adds (v0, v1); /* (V1+V6) + (V2+V5) */
+ v8 = vec_subs (v0, v1); /* (V1+V6) - (V2+V5) */
+
+ /* Bottom */
+ v0 = vec_subs (v7, v6); /* (V1-V6) - (V2-V5) */
+ v1 = vec_adds (v7, v6); /* (V1-V6) + (V2-V5) */
+
+ /*********** Stage 3 ***********/
+
+ /* Top */
+ in[0] = vec_adds (v3, v2); /* y0 = v3 + v2 */
+ in[4] = vec_subs (v3, v2); /* y4 = v3 - v2 */
+ in[2] = vec_mradds (v8, mul2, v4); /* y2 = v8 * a0 + v4 */
+ v6 = vec_mradds (v4, mul2, mul6);
+ in[6] = vec_subs (v6, v8); /* y6 = v4 * a0 - v8 */
+
+ /* Bottom */
+ v6 = vec_mradds (v0, mul0, v5); /* v6 = v0 * (c4) + v5 */
+ v7 = vec_mradds (v0, mul4, v5); /* v7 = v0 * (-c4) + v5 */
+ v2 = vec_mradds (v1, mul4, v9); /* v2 = v1 * (-c4) + v9 */
+ v3 = vec_mradds (v1, mul0, v9); /* v3 = v1 * (c4) + v9 */
+
+ /*********** Stage 4 ***********/
+
+ /* Bottom */
+ in[1] = vec_mradds (v6, mul3, v3); /* y1 = v6 * (a1) + v3 */
+ v23 = vec_mradds (v3, mul3, mul6);
+ in[7] = vec_subs (v23, v6); /* y7 = v3 * (a1) - v6 */
+ in[5] = vec_mradds (v2, mul1, v7); /* y5 = v2 * (a2) + v7 */
+ in[3] = vec_mradds (v7, mul5, v2); /* y3 = v7 * (-a2) + v2 */
+
+ transpose_vmx (in, out);
+
+ /* Perform DCT on the eight rows */
+
+ /*********** Stage 1 ***********/
+
+ v8 = vec_adds (out[0], out[7]);
+ v9 = vec_subs (out[0], out[7]);
+ v0 = vec_adds (out[1], out[6]);
+ v7 = vec_subs (out[1], out[6]);
+ v1 = vec_adds (out[2], out[5]);
+ v6 = vec_subs (out[2], out[5]);
+ v2 = vec_adds (out[3], out[4]);
+ v5 = vec_subs (out[3], out[4]);
+
+ /*********** Stage 2 ***********/
+
+ /* Top */
+ v3 = vec_adds (v8, v2); /* (V0+V7) + (V3+V4) */
+ v4 = vec_subs (v8, v2); /* (V0+V7) - (V3+V4) */
+ v2 = vec_adds (v0, v1); /* (V1+V6) + (V2+V5) */
+ v8 = vec_subs (v0, v1); /* (V1+V6) - (V2+V5) */
+
+ /* Bottom */
+ v0 = vec_subs (v7, v6); /* (V1-V6) - (V2-V5) */
+ v1 = vec_adds (v7, v6); /* (V1-V6) + (V2-V5) */
+
+ /*********** Stage 3 ***********/
+
+ /* Top */
+ v25 = vec_subs (v25, v25); /* reinit v25 = 0 */
+
+ v20 = vec_adds (v3, v2); /* y0 = v3 + v2 */
+ v24 = vec_subs (v3, v2); /* y4 = v3 - v2 */
+ v22 = vec_mradds (v8, mul2, v4); /* y2 = v8 * a0 + v4 */
+ v6 = vec_mradds (v4, mul2, v25);
+ v26 = vec_subs (v6, v8); /* y6 = v4 * a0 - v8 */
+
+ /* Bottom */
+ v6 = vec_mradds (v0, mul0, v5); /* v6 = v0 * (c4) + v5 */
+ v7 = vec_mradds (v0, mul4, v5); /* v7 = v0 * (-c4) + v5 */
+ v2 = vec_mradds (v1, mul4, v9); /* v2 = v1 * (-c4) + v9 */
+ v3 = vec_mradds (v1, mul0, v9); /* v3 = v1 * (c4) + v9 */
+
+ /*********** Stage 4 ***********/
+
+ /* Bottom */
+ v21 = vec_mradds (v6, mul3, v3); /* y1 = v6 * (a1) + v3 */
+ v23 = vec_mradds (v3, mul3, v25);
+ v27 = vec_subs (v23, v6); /* y7 = v3 * (a1) - v6 */
+ v25 = vec_mradds (v2, mul1, v7); /* y5 = v2 * (a2) + v7 */
+ v23 = vec_mradds (v7, mul5, v2); /* y3 = v7 * (-a2) + v2 */
+
+ /* Post-scale and store reults */
+
+ v31 = vec_subs (v31, v31); /* reinit v25 = 0 */
+
+ output[0] = vec_mradds (postscale[0], v20, v31);
+ output[2] = vec_mradds (postscale[2], v22, v31);
+ output[4] = vec_mradds (postscale[4], v24, v31);
+ output[6] = vec_mradds (postscale[6], v26, v31);
+ output[1] = vec_mradds (postscale[1], v21, v31);
+ output[3] = vec_mradds (postscale[3], v23, v31);
+ output[5] = vec_mradds (postscale[5], v25, v31);
+ output[7] = vec_mradds (postscale[7], v27, v31);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-1.c
new file mode 100644
index 000000000..c92435e09
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-1.c
@@ -0,0 +1,26 @@
+#include <altivec.h>
+vector unsigned char v;
+typedef unsigned char T[16];
+T t;
+typedef struct { unsigned char a[16]; } R;
+R r;
+typedef union {
+ unsigned char u8[16];
+ signed char s8[16];
+ unsigned short u16[8];
+ signed short s16[8];
+ unsigned int u32[4];
+ signed int s32[4];
+ float f32[4];
+} U;
+U u;
+static void use(void *p) {
+}
+int main() {
+ use (&v);
+ use (&t);
+ use (&r);
+ use (&u);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-2.c
new file mode 100644
index 000000000..60380bcfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-2.c
@@ -0,0 +1,42 @@
+#include <altivec.h>
+vector unsigned char u8 = {1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10,11,12,13,14,15,16};
+vector signed char s8 = {1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10,11,12,13,14,15,16};
+vector bool char b8 = {0, -1, 0, -1, 0, 0, 0, 0,
+ -1, -1, -1, -1, 0, -1, 0, -1};
+vector unsigned short u16 = {1, 2, 3, 4, 5, 6, 7, 8};
+vector signed short s16 = {1, 2, 3, 4, 5, 6, 7, 8};
+vector bool short b16 = {-1, 0, -1, 0, -1, -1, 0, 0};
+vector unsigned int u32 = {1, 2, 3, 4};
+vector signed int s32 = {1, 2, 3, 4};
+vector bool int b32 = {0, -1, -1, 0};
+vector float f32 = {1, 2, 3, 4};
+vector pixel p16 = {1, 2, 3, 4, 5, 6, 7, 8};
+
+static void f_u8(vector unsigned char *p) {}
+static void f_s8(vector signed char *p) {}
+static void f_b8(vector bool char *p) {}
+static void f_u16(vector unsigned short *p) {}
+static void f_s16(vector signed short *p) {}
+static void f_b16(vector bool short *p) {}
+static void f_u32(vector unsigned int *p) {}
+static void f_s32(vector signed int *p) {}
+static void f_b32(vector bool int *p) {}
+static void f_f32(vector float *p) {}
+static void f_p16(vector pixel *p) {}
+
+int main() {
+ f_u8(&u8);
+ f_s8(&s8);
+ f_b8(&b8);
+ f_u16(&u16);
+ f_s16(&s16);
+ f_b16(&b16);
+ f_u32(&u32);
+ f_s32(&s32);
+ f_b32(&b32);
+ f_f32(&f32);
+ f_p16(&p16);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-3.c
new file mode 100644
index 000000000..a9fc86629
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-3.c
@@ -0,0 +1,75 @@
+#include <altivec.h>
+vector unsigned char u8;
+vector signed char s8;
+vector bool char b8;
+vector unsigned short u16;
+vector signed short s16;
+vector bool short b16;
+vector unsigned int u32;
+vector signed int s32;
+vector bool int b32;
+vector float f32;
+vector pixel p16;
+
+void f_u8(vector unsigned char *p) {
+ u8 = *p;
+}
+void f_s8(vector signed char *p) {
+ s8 = *p;
+}
+void f_b8(vector bool char *p) {
+ b8 = *p;
+}
+void f_u16(vector unsigned short *p) {
+ u16 = *p;
+}
+void f_s16(vector signed short *p) {
+ s16 = *p;
+}
+void f_b16(vector bool short *p) {
+ b16 = *p;
+}
+void f_u32(vector unsigned int *p) {
+ u32 = *p;
+}
+void f_s32(vector signed int *p) {
+ s32 = *p;
+}
+void f_b32(vector bool int *p) {
+ b32 = *p;
+}
+void f_f32(vector float *p) {
+ f32 = *p;
+}
+void f_p16(vector pixel *p) {
+ p16 = *p;
+}
+
+int main() {
+ vector unsigned char u8 = ((vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10,11,12,13,14,15,16});
+ vector signed char s8 = ((vector signed char){1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10,11,12,13,14,15,16});
+ vector bool char b8 = ((vector bool char){0, -1, 0, -1, 0, 0, 0, 0,
+ -1, -1, -1, -1, 0, -1, 0, -1});
+ vector unsigned short u16 = ((vector unsigned short){1, 2, 3, 4, 5, 6, 7, 8});
+ vector signed short s16 = ((vector signed short){1, 2, 3, 4, 5, 6, 7, 8});
+ vector bool short b16 = ((vector bool short){-1, 0, -1, 0, -1, -1, 0, 0});
+ vector unsigned int u32 = ((vector unsigned int){1, 2, 3, 4});
+ vector signed int s32 = ((vector signed int){1, 2, 3, 4});
+ vector bool int b32 = ((vector bool int){0, -1, -1, 0});
+ vector float f32 = ((vector float){1, 2, 3, 4});
+ vector pixel p16 = ((vector pixel){1, 2, 3, 4, 5, 6, 7, 8});
+ f_u8(&u8);
+ f_s8(&s8);
+ f_b8(&b8);
+ f_u16(&u16);
+ f_s16(&s16);
+ f_b16(&b16);
+ f_u32(&u32);
+ f_s32(&s32);
+ f_b32(&b32);
+ f_f32(&f32);
+ f_p16(&p16);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-4.c
new file mode 100644
index 000000000..e30ba2674
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/debug-4.c
@@ -0,0 +1,78 @@
+#include <altivec.h>
+vector unsigned char u8;
+vector signed char s8;
+vector bool char b8;
+vector unsigned short u16;
+vector signed short s16;
+vector bool short b16;
+vector unsigned int u32;
+vector signed int s32;
+vector bool int b32;
+vector float f32;
+vector pixel p16;
+
+void f_u8(vector unsigned char *p) {
+ u8 = vec_add(*p, *p);
+}
+void f_s8(vector signed char *p) {
+ s8 = vec_add(*p, *p);
+}
+void f_b8(vector bool char *p) {
+ b8 = vec_cmpgt(s8, s8);
+ b8 = vec_xor(b8, *p);
+}
+void f_u16(vector unsigned short *p) {
+ u16 = vec_add(*p, *p);
+}
+void f_s16(vector signed short *p) {
+ s16 = vec_add(*p, *p);
+}
+void f_b16(vector bool short *p) {
+ b16 = vec_cmpgt(s16, s16);
+ b16 = vec_xor(b16, *p);
+}
+void f_u32(vector unsigned int *p) {
+ u32 = vec_add(*p, *p);
+}
+void f_s32(vector signed int *p) {
+ s32 = vec_add(*p, *p);
+}
+void f_b32(vector bool int *p) {
+ b32 = vec_cmpgt(s32, s32);
+ b32 = vec_xor(b32, *p);
+}
+void f_f32(vector float *p) {
+ f32 = vec_add(*p, *p);
+}
+void f_p16(vector pixel *p) {
+ p16 = *p;
+}
+
+int main() {
+ vector unsigned char u8 = ((vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10,11,12,13,14,15,16});
+ vector signed char s8 = ((vector signed char){1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10,11,12,13,14,15,16});
+ vector bool char b8 = ((vector bool char){0, -1, 0, -1, 0, 0, 0, 0,
+ -1, -1, -1, -1, 0, -1, 0, -1});
+ vector unsigned short u16 = ((vector unsigned short){1, 2, 3, 4, 5, 6, 7, 8});
+ vector signed short s16 = ((vector signed short){1, 2, 3, 4, 5, 6, 7, 8});
+ vector bool short b16 = ((vector bool short){-1, 0, -1, 0, -1, -1, 0, 0});
+ vector unsigned int u32 = ((vector unsigned int){1, 2, 3, 4});
+ vector signed int s32 = ((vector signed int){1, 2, 3, 4});
+ vector bool int b32 = ((vector bool int){0, -1, -1, 0});
+ vector float f32 = ((vector float){1, 2, 3, 4});
+ vector pixel p16 = ((vector pixel){1, 2, 3, 4, 5, 6, 7, 8});
+ f_u8(&u8);
+ f_s8(&s8);
+ f_b8(&b8);
+ f_u16(&u16);
+ f_s16(&s16);
+ f_b16(&b16);
+ f_u32(&u32);
+ f_s32(&s32);
+ f_b32(&b32);
+ f_f32(&f32);
+ f_p16(&p16);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dos-bug-1-gdb.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dos-bug-1-gdb.c
new file mode 100644
index 000000000..dc4c4d3d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dos-bug-1-gdb.c
@@ -0,0 +1,7 @@
+#include <altivec.h>
+static vector unsigned int v = {0x01020304,0x05060708,0x21324354,0x65768798};
+static vector unsigned int f() { return v; }
+int main() {
+ vector unsigned int x = f();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dos-bug-2-gdb.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dos-bug-2-gdb.c
new file mode 100644
index 000000000..4ec47b12d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/dos-bug-2-gdb.c
@@ -0,0 +1,7 @@
+#include <altivec.h>
+static vector unsigned int v = {0x01020304,0x05060708,0x21324354,0x65768798};
+static vector unsigned int f() { return vec_splat(v,0); }
+int main() {
+ vector unsigned int x = f();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/eg-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/eg-5.c
new file mode 100644
index 000000000..eb4b4e028
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/eg-5.c
@@ -0,0 +1,25 @@
+#include "harness.h"
+
+static vector float
+matvecmul4 (vector float c0, vector float c1, vector float c2,
+ vector float c3, vector float v)
+{
+ /* Set result to a vector of f32 0's */
+ vector float result = ((vector float){0.,0.,0.,0.});
+ result = vec_madd (c0, vec_splat (v, 0), result);
+ result = vec_madd (c1, vec_splat (v, 1), result);
+ result = vec_madd (c2, vec_splat (v, 2), result);
+ result = vec_madd (c3, vec_splat (v, 3), result);
+ return result;
+}
+
+static void test()
+{
+ check(vec_all_eq(matvecmul4(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37}),
+ ((vector float){41,43,47,53}),
+ ((vector float){59,61,67,71})),
+ ((vector float){5241, 5966, 6746, 7814})),
+ "matvecmul4");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-be-order.c
new file mode 100644
index 000000000..5c09471d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-be-order.c
@@ -0,0 +1,33 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ vector unsigned char va = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vb = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector unsigned short vc = {0,1,2,3,4,5,6,7};
+ vector signed short vd = {-4,-3,-2,-1,0,1,2,3};
+ vector unsigned int ve = {0,1,2,3};
+ vector signed int vf = {-2,-1,0,1};
+ vector float vg = {-2.0f,-1.0f,0.0f,1.0f};
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ check (vec_extract (va, 5) == 10, "vec_extract (va, 5)");
+ check (vec_extract (vb, 0) == 7, "vec_extract (vb, 0)");
+ check (vec_extract (vc, 7) == 0, "vec_extract (vc, 7)");
+ check (vec_extract (vd, 3) == 0, "vec_extract (vd, 3)");
+ check (vec_extract (ve, 2) == 1, "vec_extract (ve, 2)");
+ check (vec_extract (vf, 1) == 0, "vec_extract (vf, 1)");
+ check (vec_extract (vg, 0) == 1.0f, "vec_extract (vg, 0)");
+#else
+ check (vec_extract (va, 5) == 5, "vec_extract (va, 5)");
+ check (vec_extract (vb, 0) == -8, "vec_extract (vb, 0)");
+ check (vec_extract (vc, 7) == 7, "vec_extract (vc, 7)");
+ check (vec_extract (vd, 3) == -1, "vec_extract (vd, 3)");
+ check (vec_extract (ve, 2) == 2, "vec_extract (ve, 2)");
+ check (vec_extract (vf, 1) == -1, "vec_extract (vf, 1)");
+ check (vec_extract (vg, 0) == -2.0f, "vec_extract (vg, 0)");
+#endif
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c
new file mode 100644
index 000000000..6428ea5d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c
@@ -0,0 +1,19 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ vector long long vl = {0, 1};
+ vector double vd = {0.0, 1.0};
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ check (vec_extract (vl, 0) == 1, "vl, 0");
+ check (vec_extract (vd, 1) == 0.0, "vd, 1");
+#else
+ check (vec_extract (vl, 0) == 0, "vl, 0");
+ check (vec_extract (vd, 1) == 1.0, "vd, 1");
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-vsx.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-vsx.c
new file mode 100644
index 000000000..cd34a2ae3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract-vsx.c
@@ -0,0 +1,16 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ vector long long vl = {0, 1};
+ vector double vd = {0.0, 1.0};
+
+ check (vec_extract (vl, 0) == 0, "vec_extract, vl, 0");
+ check (vec_extract (vd, 1) == 1.0, "vec_extract, vd, 1");
+ check (vl[0] == 0, "[], vl, 0");
+ check (vd[1] == 1.0, "[], vd, 0");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract.c
new file mode 100644
index 000000000..6fc472557
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/extract.c
@@ -0,0 +1,21 @@
+#include "harness.h"
+
+static void test()
+{
+ vector unsigned char va = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vb = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector unsigned short vc = {0,1,2,3,4,5,6,7};
+ vector signed short vd = {-4,-3,-2,-1,0,1,2,3};
+ vector unsigned int ve = {0,1,2,3};
+ vector signed int vf = {-2,-1,0,1};
+ vector float vg = {-2.0f,-1.0f,0.0f,1.0f};
+
+ check (vec_extract (va, 5) == 5, "vec_extract (va, 5)");
+ check (vec_extract (vb, 0) == -8, "vec_extract (vb, 0)");
+ check (vec_extract (vc, 7) == 7, "vec_extract (vc, 7)");
+ check (vec_extract (vd, 3) == -1, "vec_extract (vd, 3)");
+ check (vec_extract (ve, 2) == 2, "vec_extract (ve, 2)");
+ check (vec_extract (vf, 1) == -1, "vec_extract (vf, 1)");
+ check (vec_extract (vg, 0) == -2.0f, "vec_extract (vg, 0)");
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/fft.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/fft.c
new file mode 100644
index 000000000..2b8a537c6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/fft.c
@@ -0,0 +1,99 @@
+/* { dg-do compile } */
+#include <altivec.h>
+
+inline void
+transpose4x4(vector float *matrix)
+{
+ vector float v0, v1, v2, v3;
+
+ v0 = vec_mergeh(matrix[0], matrix[2]);
+ v1 = vec_mergel(matrix[0], matrix[2]);
+ v2 = vec_mergeh(matrix[1], matrix[3]);
+ v3 = vec_mergel(matrix[1], matrix[3]);
+
+ matrix[0] = vec_mergeh(v0, v2);
+ matrix[1] = vec_mergel(v0, v2);
+ matrix[2] = vec_mergeh(v1, v3);
+ matrix[3] = vec_mergel(v1, v3);
+}
+
+void
+vec_ifft64(vector float *x0, vector float *x1)
+{
+ int i;
+ vector float real[4], imag[4];
+ vector float c0r, c1r, c2r, c3r, c0i, c1i, c2i, c3i;
+ vector float d0r, d1r, d2r, d3r, d0i, d1i, d2i, d3i;
+
+ /*
+ * N=64
+ *
+ * Stage 1: t=1 => k = 0, j = 0..15
+ * ================================
+ * for j = 0:15
+ * c0 = x0(j+0*16);
+ * c1 = x0(j+1*16);
+ * c2 = x0(j+2*16);
+ * c3 = x0(j+3*16);
+ *
+ * d0 = c0 + c2;
+ * d1 = c0 - c2;
+ * d2 = c1 + c3;
+ * d3 = i*(c1 - c3);
+ *
+ * x1(4j+0) = d0 + d2;
+ * x1(4j+1) = d1 + d3;
+ * x1(4j+2) = d0 - d2;
+ * x1(4j+3) = d1 - d3;
+ * end
+ ******************************************************/
+
+ for (i=0; i < 4; i++)
+ {
+ c0r = x0[i];
+ c1r = x0[i+4];
+ c2r = x0[i+8];
+ c3r = x0[i+12];
+
+ c0i = x0[i+16];
+ c1i = x0[i+20];
+ c2i = x0[i+24];
+ c3i = x0[i+28];
+
+ d0r = vec_add(c0r, c2r);
+ d1r = vec_sub(c0r, c2r);
+ d2r = vec_add(c1r, c3r);
+ d3r = vec_sub(c3i, c1i);
+
+ d0i = vec_add(c0i, c2i);
+ d1i = vec_sub(c0i, c2i);
+ d2i = vec_add(c1i, c3i);
+ d3i = vec_sub(c1r, c3r);
+
+ /* Calculate real{x1} */
+ real[0] = vec_add(d0r, d2r);
+ real[1] = vec_add(d1r, d3r);
+ real[2] = vec_sub(d0r, d2r);
+ real[3] = vec_sub(d1r, d3r);
+
+ transpose4x4(real);
+
+ /* Calculate imag{x1} */
+ imag[0] = vec_add(d0i, d2i);
+ imag[1] = vec_add(d1i, d3i);
+ imag[2] = vec_sub(d0i, d2i);
+ imag[3] = vec_sub(d1i, d3i);
+
+ transpose4x4(imag);
+
+ x1[4*i] = real[0];
+ x1[4*i+1] = real[1];
+ x1[4*i+2] = real[2];
+ x1[4*i+3] = real[3];
+
+ x1[4*i+16] = imag[0];
+ x1[4*i+17] = imag[1];
+ x1[4*i+18] = imag[2];
+ x1[4*i+19] = imag[3];
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-1.c
new file mode 100644
index 000000000..684ffe90e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+#include <altivec.h>
+typedef struct n_a {
+ signed char m1;
+ vector float m2;
+} n_a;
+
+typedef struct n_b {
+ signed char m1;
+ struct n_a m2;
+} n_b;
+
+extern void f(n_b *);
+
+void initn_b(signed char p1, struct n_a p2)
+{
+ n_b _i;
+ ((_i).m1 = p1, (_i).m2 = p2);
+ f(&_i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-2.c
new file mode 100644
index 000000000..f2f3c4cfe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-2.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+#include <altivec.h>
+typedef struct n_a {
+ signed char m1;
+ vector float m2;
+} n_a;
+
+typedef struct n_b {
+ signed char m1;
+ struct n_a m2;
+} n_b;
+
+extern void f(n_b *);
+
+void initn_b()
+{
+ n_b _i;
+ f(&_i);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-3.c
new file mode 100644
index 000000000..77b2a002f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-3.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+#include <altivec.h>
+void valuen014(vector float p1, vector float p2, vector float p3,
+ vector float p4, vector float p5, vector float p6,
+ vector float p7, vector float p8, vector float p9,
+ vector float p10, vector float p11, vector float p12,
+ int p13)
+{
+}
+
+void f()
+{
+ valuen014(((vector float) {1.83e+09, 5.73e+08, -2.96e+08, -7.46e+08}),
+ ((vector float) {-2.01e+09, 9.89e+08, -1.92e+09, 2.09e+09}),
+ ((vector float) {1.95e+09, -2.41e+08, 2.67e+08, 1.67e+09}),
+ ((vector float) {-2.12e+09, 8.18e+08, 9.47e+08, -1.25e+09}),
+ ((vector float) {-9.47e+08, -9.3e+08, -1.65e+09, 1.64e+09}),
+ ((vector float) {-7.99e+07, 4.86e+08, -3.4e+06, 3.11e+08}),
+ ((vector float) {1.78e+09, 1.22e+09, -1.27e+09, -3.11e+08}),
+ ((vector float) {1.41e+09, -5.38e+07, -2.08e+09, 1.54e+09}),
+ ((vector float) {3.1e+08, -1.49e+09, 5.38e+08, -1.3e+09}),
+ ((vector float) {9.66e+08, 5.5e+08, 1.75e+08, -8.22e+07}),
+ ((vector float) {-1.72e+08, -2.06e+09, 1.14e+09, -4.64e+08}),
+ ((vector float) {-1.25e+09, 8.12e+07, -2.02e+09, 4.71e+08}),
+ 962425441);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-4.c
new file mode 100644
index 000000000..beb920f2c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-4.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+#include <altivec.h>
+extern vector unsigned int gn00111;
+long f() { return (long)&gn00111; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-5.c
new file mode 100644
index 000000000..0eaa6adb7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-5.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+#include <altivec.h>
+void valuen014(vector float p1, vector float p2, vector float p3,
+ vector float p4, vector float p5, vector float p6,
+ vector float p7, vector float p8, vector float p9,
+ vector float p10, vector float p11, vector float p12,
+ vector float px)
+{
+}
+
+void f()
+{
+ valuen014(((vector float) {1.83e+09, 5.73e+08, -2.96e+08, -7.46e+08}),
+ ((vector float) {-2.01e+09, 9.89e+08, -1.92e+09, 2.09e+09}),
+ ((vector float) {1.95e+09, -2.41e+08, 2.67e+08, 1.67e+09}),
+ ((vector float) {-2.12e+09, 8.18e+08, 9.47e+08, -1.25e+09}),
+ ((vector float) {-9.47e+08, -9.3e+08, -1.65e+09, 1.64e+09}),
+ ((vector float) {-7.99e+07, 4.86e+08, -3.4e+06, 3.11e+08}),
+ ((vector float) {1.78e+09, 1.22e+09, -1.27e+09, -3.11e+08}),
+ ((vector float) {1.41e+09, -5.38e+07, -2.08e+09, 1.54e+09}),
+ ((vector float) {3.1e+08, -1.49e+09, 5.38e+08, -1.3e+09}),
+ ((vector float) {9.66e+08, 5.5e+08, 1.75e+08, -8.22e+07}),
+ ((vector float) {-1.72e+08, -2.06e+09, 1.14e+09, -4.64e+08}),
+ ((vector float) {-1.25e+09, 8.12e+07, -2.02e+09, 4.71e+08}),
+ ((vector float){1,1,1,1}));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-6.c
new file mode 100644
index 000000000..f0a424a2b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-6.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+#include <altivec.h>
+void valuen014(vector float p1, vector float p2, vector float p3,
+ vector float p4, vector float p5, vector float p6,
+ vector float p7, vector float p8, vector float p9,
+ vector float p10, vector float p11, vector float p12,
+ vector float px, vector float py, vector float pz,
+ int p13)
+{
+}
+
+void f()
+{
+ valuen014(((vector float) {1.83e+09, 5.73e+08, -2.96e+08, -7.46e+08}),
+ ((vector float) {-2.01e+09, 9.89e+08, -1.92e+09, 2.09e+09}),
+ ((vector float) {1.95e+09, -2.41e+08, 2.67e+08, 1.67e+09}),
+ ((vector float) {-2.12e+09, 8.18e+08, 9.47e+08, -1.25e+09}),
+ ((vector float) {-9.47e+08, -9.3e+08, -1.65e+09, 1.64e+09}),
+ ((vector float) {-7.99e+07, 4.86e+08, -3.4e+06, 3.11e+08}),
+ ((vector float) {1.78e+09, 1.22e+09, -1.27e+09, -3.11e+08}),
+ ((vector float) {1.41e+09, -5.38e+07, -2.08e+09, 1.54e+09}),
+ ((vector float) {3.1e+08, -1.49e+09, 5.38e+08, -1.3e+09}),
+ ((vector float) {9.66e+08, 5.5e+08, 1.75e+08, -8.22e+07}),
+ ((vector float) {-1.72e+08, -2.06e+09, 1.14e+09, -4.64e+08}),
+ ((vector float) {-1.25e+09, 8.12e+07, -2.02e+09, 4.71e+08}),
+ ((vector float){1,1,1,1}),
+ ((vector float){2,2,2,2}),
+ ((vector float){3,3,3,3}),
+ 962425441);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-7.c
new file mode 100644
index 000000000..452977bbf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-7.c
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+#include <altivec.h>
+extern void referencen001(int *p1, int *p2, int *p3, int *p4, int *p5, int *p6, int *p7, vector float *p8);
+
+extern int gn0011;
+
+extern int gn0012;
+
+extern int gn0013;
+
+extern int gn0014;
+
+extern int gn0015;
+
+extern int gn0016;
+
+extern int gn0017;
+
+extern vector float gn0018;
+
+void testn001(void)
+{
+ int a1;
+ int a2;
+ int a3;
+ int a4;
+ int a5;
+ int a6;
+ int a7;
+ vector float a8;
+
+ (a1 = -53786696, a2 = -1840132710, a3 = -2130504990, a4 = 1429848501, a5 = 1139248605, a6 = 428762253, a7 = -1581480596, a8 = ((vector float) {1.66e+09, -1.83e+09, -6.79e+08, 1.58e+09}));
+
+ referencen001(&a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-8.c
new file mode 100644
index 000000000..33d4bd7e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-8.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+#include <altivec.h>
+
+typedef struct n001 {
+ signed char m1;
+ vector float m2;
+ int m3;
+ vector signed short m4;
+ signed char m5;
+ vector unsigned short m6;
+} n001;
+
+ n001 _i = {-4, {-1.84e+09, -2.13e+09, 1.43e+09, 1.14e+09}, 428762253, {-24132, 25298, -27969, -10358, 24164, -5157, -18143, -6509}, 40, {0x8737, 0xd7cf, 0xb6a7, 0x948f, 0x790b, 0x9255, 0x872d, 0xe72c}};
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-9.c
new file mode 100644
index 000000000..b54338a3b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-9.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+#include <altivec.h>
+
+vector signed short _j = {-24132, 25298, -27969, -10358, 24164, -5157, -18143, -6509};
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-b.c
new file mode 100644
index 000000000..e893ff181
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-b.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector unsigned char u8a, u8b, u8c, u8d, *u8ptr;
+vector signed short s16a, s16b, s16c, s16d;
+vector unsigned short u16a, u16b, u16c, u16d;
+vector unsigned int u32a, u32b, u32c, u32d;
+vector float f32a, f32b, f32c, f32d, f32e;
+int i, j, *p;
+
+void test()
+{
+ u8c = vec_add(u8a, u8b);
+ f32c = vec_ceil(f32a);
+ f32d = vec_vcfux(u32a, 31U);
+ s16c = vec_splat_s16(-16);
+ u8d = vec_vsldoi(u8a, u8b, 15);
+ f32e = vec_vmaddfp(f32a, f32b, f32c);
+
+ vec_dss(3);
+ vec_dssall();
+ vec_mtvscr(u8a);
+ u16a = vec_mfvscr();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-c.c
new file mode 100644
index 000000000..33fed4bd9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-c.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector signed short s16ss() { vector signed short a; return vec_subs(a,a); }
+vector signed short s16s() { vector signed short a; return vec_sub(a,a); }
+vector signed short s16x() { vector signed short a; return vec_xor(a,a); }
+vector signed short s16a() { vector signed short a; return vec_andc(a,a); }
+vector unsigned char u8;
+vector signed short s16;
+vector bool int b32;
+vector float f32;
+vector pixel p16;
+void x()
+{
+ u8 = ((vector unsigned char){3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3});
+ s16 = ((vector signed short){-7,-7,-7,-7,-7,-7,-7,-7});
+ b32 = ((vector bool int) {10,20,30,40});
+ f32 = ((vector float) {2,4,6,8});
+ p16 = ((vector pixel){23,23,23,23,23,23,23,23});
+}
+vector unsigned int a;
+vector unsigned int b;
+void f(void) {
+ a = ((vector unsigned int){1,1,1,1});
+ b = ((vector unsigned int){1,2,3,4});
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-d.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-d.c
new file mode 100644
index 000000000..2b2151eec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-d.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+#include <altivec.h>
+static void f() {}
+extern void g() {}
+extern vector unsigned char permute_128(vector unsigned char);
+
+void foo()
+{
+ vector unsigned char input
+ = {0,1,2,4,8,16,32,64,128,0,1,2,4,8,16,32};
+ vector unsigned char result = permute_128(input);
+ void (*p)() = f;
+ void (*q)() = g;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-e.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-e.c
new file mode 100644
index 000000000..58e4fc3d3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-e.c
@@ -0,0 +1,44 @@
+#include "harness.h"
+
+typedef struct n_a
+{
+ signed char m1;
+ short m2;
+ int m3;
+ double m4;
+ vector float m5;
+}
+n_a;
+
+static void
+initn_a(signed char p1, short p2, int p3, double p4, vector float p5)
+{
+ n_a i;
+ static struct
+ {
+ n_a b;
+ char a;
+ }
+ x;
+
+ i.m1 = p1;
+ i.m2 = p2;
+ i.m3 = p3;
+ i.m4 = p4;
+ i.m5 = p5;
+
+ check(i.m1 == -17, "i.m1");
+ check(i.m2 == 9165, "i.m2");
+ check(i.m3 == -1857760764, "i.m3");
+ check(i.m4 == 7.3e+18, "i.m4");
+ check(vec_all_eq(i.m5, ((vector float){-5.02e+08,
+ -4.34e+08,
+ -1.04e+09,
+ 1.42e+09})), "i.m5");
+}
+
+static void test()
+{
+ initn_a(-17, 9165, -1857760764, 7.3e+18,
+ ((vector float){-5.02e+08, -4.34e+08, -1.04e+09, 1.42e+09}));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-f.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-f.c
new file mode 100644
index 000000000..fb61bb15a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-f.c
@@ -0,0 +1,125 @@
+/* { dg-do compile } */
+#include <altivec.h>
+typedef short Word16;
+typedef int Word32;
+typedef int Flag;
+
+extern Flag Overflow;
+extern Flag Carry;
+
+extern vector signed short table[8];
+extern vector signed short slope_cos[8];
+
+void Lsf_lsp(
+ vector signed short lsfq[],
+ vector signed short lspq[]
+)
+{
+ vector signed short Q17_con = ((vector signed short){20861,20861,20861,20861,20861,20861,20861,20861});
+ vector unsigned char perm1 = ((vector unsigned char){0, 8, 1, 9, 2, 10, 3,
+ 11, 4, 12, 5 ,13, 6, 14, 7, 15});
+ vector unsigned char PerIndex, tmpIndex;
+ vector signed short tmp0, tmp1, tmp2, tmp3;
+ vector signed short stmp0, stmp1, stmp2, stmp3;
+ vector signed short index0, index1, offset0, offset1;
+ vector signed short table0, table1, slope0, slope1;
+ vector unsigned short select;
+ vector signed int L_tmp0, L_tmp1, L_tmp2, L_tmp3;
+
+
+ tmp0 = vec_madds(lsfq[0], Q17_con, (((vector signed short){0,0,0,0,0,0,0,0})) );
+ tmp1 = vec_madds(lsfq[1], Q17_con, (((vector signed short){0,0,0,0,0,0,0,0})) );
+
+
+ offset0 = vec_and(tmp0, (((vector signed short){0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff})) );
+ offset1 = vec_and(tmp1, (((vector signed short){0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff})) );
+
+
+ index0 = vec_min(vec_sra(tmp0, (((vector unsigned short){8,8,8,8,8,8,8,8})) ), (((vector signed short){63,63,63,63,63,63,63,63})) );
+ index1 = vec_min(vec_sra(tmp1, (((vector unsigned short){8,8,8,8,8,8,8,8})) ), (((vector signed short){63,63,63,63,63,63,63,63})) );
+
+
+
+ tmp0 = vec_sl(index0, (vector unsigned short)((((vector signed short){1,1,1,1,1,1,1,1})) ));
+ PerIndex = (vector unsigned char)vec_packs(tmp0, vec_add(tmp0, (((vector signed short){1,1,1,1,1,1,1,1})) ));
+ PerIndex = vec_perm(PerIndex, PerIndex, perm1);
+
+
+ tmp0 = vec_perm(table[0], table[1], PerIndex);
+ stmp0 = vec_perm(slope_cos[0], slope_cos[1], PerIndex);
+
+ tmpIndex = vec_sub(PerIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp1 = vec_perm(table[2], table[3], tmpIndex);
+ stmp1 = vec_perm(slope_cos[2], slope_cos[3], tmpIndex);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31})) );
+ tmp2 = vec_sel(tmp0, tmp1, select);
+ stmp2 = vec_sel(stmp0, stmp1, select);
+
+ tmpIndex = vec_sub(tmpIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp0 = vec_perm(table[4], table[5], tmpIndex);
+ stmp0 = vec_perm(slope_cos[4], slope_cos[5], tmpIndex);
+
+ tmpIndex = vec_sub(tmpIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp1 = vec_perm(table[6], table[7], tmpIndex);
+ stmp1 = vec_perm(slope_cos[6], slope_cos[7], tmpIndex);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95})) );
+ tmp3 = vec_sel(tmp0, tmp1, select);
+ stmp3 = vec_sel(stmp0, stmp1, select);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63})) );
+ table0 = vec_sel(tmp2, tmp3, select);
+ slope0 = vec_sel(stmp2, stmp3, select);
+
+ tmp0 = vec_sl(index1, (vector unsigned short)((((vector signed short){1,1,1,1,1,1,1,1})) ));
+ PerIndex = (vector unsigned char)vec_packs(tmp0, vec_add(tmp0, (((vector signed short){1,1,1,1,1,1,1,1})) ));
+ PerIndex = vec_perm(PerIndex, PerIndex, perm1);
+
+
+ tmp0 = vec_perm(table[0], table[1], PerIndex);
+ stmp0 = vec_perm(slope_cos[0], slope_cos[1], PerIndex);
+
+ tmpIndex = vec_sub(PerIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp1 = vec_perm(table[2], table[3], tmpIndex);
+ stmp1 = vec_perm(slope_cos[2], slope_cos[3], tmpIndex);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31})) );
+ tmp2 = vec_sel(tmp0, tmp1, select);
+ stmp2 = vec_sel(stmp0, stmp1, select);
+
+ tmpIndex = vec_sub(tmpIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp0 = vec_perm(table[4], table[5], tmpIndex);
+ stmp0 = vec_perm(slope_cos[4], slope_cos[5], tmpIndex);
+
+ tmpIndex = vec_sub(tmpIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp1 = vec_perm(table[6], table[7], tmpIndex);
+ stmp1 = vec_perm(slope_cos[6], slope_cos[7], tmpIndex);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95})) );
+ tmp3 = vec_sel(tmp0, tmp1, select);
+ stmp3 = vec_sel(stmp0, stmp1, select);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63})) );
+ table1 = vec_sel(tmp2, tmp3, select);
+ slope1 = vec_sel(stmp2, stmp3, select);
+
+
+
+ L_tmp0 = vec_sra(vec_mule(slope0, offset0), (((vector unsigned int){12,12,12,12})) );
+ L_tmp1 = vec_sra(vec_mulo(slope0, offset0), (((vector unsigned int){12,12,12,12})) );
+ L_tmp2 = vec_sra(vec_mule(slope1, offset1), (((vector unsigned int){12,12,12,12})) );
+ L_tmp3 = vec_sra(vec_mulo(slope1, offset1), (((vector unsigned int){12,12,12,12})) );
+
+
+ tmp0 = vec_packs(L_tmp0, L_tmp2);
+ tmp1 = vec_packs(L_tmp1, L_tmp3);
+ tmp2 = vec_mergeh(tmp0, tmp1);
+ tmp3 = vec_mergel(tmp0, tmp1);
+
+
+ lspq[0] = vec_adds(table0, tmp2);
+ lspq[1] = vec_adds(table1, tmp3);
+
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-g.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-g.c
new file mode 100644
index 000000000..573a73b35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-g.c
@@ -0,0 +1,119 @@
+/* { dg-do compile } */
+#include <altivec.h>
+extern vector signed short table[8];
+extern vector signed short slope_cos[8];
+extern vector signed short slope_acos[8];
+
+void Lsf_lsp(
+ vector signed short lsfq[],
+ vector signed short lspq[]
+)
+{
+ vector signed short Q17_con = ((vector signed short){20861,20861,20861,20861,20861,20861,20861,20861});
+ vector unsigned char perm1 = ((vector unsigned char){0, 8, 1, 9, 2, 10, 3,
+ 11, 4, 12, 5 ,13, 6, 14, 7, 15});
+ vector unsigned char PerIndex, tmpIndex;
+ vector signed short tmp0, tmp1, tmp2, tmp3;
+ vector signed short stmp0, stmp1, stmp2, stmp3;
+ vector signed short index0, index1, offset0, offset1;
+ vector signed short table0, table1, slope0, slope1;
+ vector unsigned short select;
+ vector signed int L_tmp0, L_tmp1, L_tmp2, L_tmp3;
+
+
+ tmp0 = vec_madds(lsfq[0], Q17_con, (((vector signed short){0,0,0,0,0,0,0,0})) );
+ tmp1 = vec_madds(lsfq[1], Q17_con, (((vector signed short){0,0,0,0,0,0,0,0})) );
+
+
+ offset0 = vec_and(tmp0, (((vector signed short){0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff})) );
+ offset1 = vec_and(tmp1, (((vector signed short){0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff})) );
+
+
+ index0 = vec_min(vec_sra(tmp0, (((vector unsigned short){8,8,8,8,8,8,8,8})) ), (((vector signed short){63,63,63,63,63,63,63,63})) );
+ index1 = vec_min(vec_sra(tmp1, (((vector unsigned short){8,8,8,8,8,8,8,8})) ), (((vector signed short){63,63,63,63,63,63,63,63})) );
+
+
+
+ tmp0 = vec_sl(index0, (vector unsigned short)((((vector signed short){1,1,1,1,1,1,1,1})) ));
+ PerIndex = (vector unsigned char)vec_packs(tmp0, vec_add(tmp0, (((vector signed short){1,1,1,1,1,1,1,1})) ));
+ PerIndex = vec_perm(PerIndex, PerIndex, perm1);
+
+
+ tmp0 = vec_perm(table[0], table[1], PerIndex);
+ stmp0 = vec_perm(slope_cos[0], slope_cos[1], PerIndex);
+
+ tmpIndex = vec_sub(PerIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp1 = vec_perm(table[2], table[3], tmpIndex);
+ stmp1 = vec_perm(slope_cos[2], slope_cos[3], tmpIndex);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31})) );
+ tmp2 = vec_sel(tmp0, tmp1, select);
+ stmp2 = vec_sel(stmp0, stmp1, select);
+
+ tmpIndex = vec_sub(tmpIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp0 = vec_perm(table[4], table[5], tmpIndex);
+ stmp0 = vec_perm(slope_cos[4], slope_cos[5], tmpIndex);
+
+ tmpIndex = vec_sub(tmpIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp1 = vec_perm(table[6], table[7], tmpIndex);
+ stmp1 = vec_perm(slope_cos[6], slope_cos[7], tmpIndex);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95})) );
+ tmp3 = vec_sel(tmp0, tmp1, select);
+ stmp3 = vec_sel(stmp0, stmp1, select);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63})) );
+ table0 = vec_sel(tmp2, tmp3, select);
+ slope0 = vec_sel(stmp2, stmp3, select);
+
+ tmp0 = vec_sl(index1, (vector unsigned short)((((vector signed short){1,1,1,1,1,1,1,1})) ));
+ PerIndex = (vector unsigned char)vec_packs(tmp0, vec_add(tmp0, (((vector signed short){1,1,1,1,1,1,1,1})) ));
+ PerIndex = vec_perm(PerIndex, PerIndex, perm1);
+
+
+ tmp0 = vec_perm(table[0], table[1], PerIndex);
+ stmp0 = vec_perm(slope_cos[0], slope_cos[1], PerIndex);
+
+ tmpIndex = vec_sub(PerIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp1 = vec_perm(table[2], table[3], tmpIndex);
+ stmp1 = vec_perm(slope_cos[2], slope_cos[3], tmpIndex);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31})) );
+ tmp2 = vec_sel(tmp0, tmp1, select);
+ stmp2 = vec_sel(stmp0, stmp1, select);
+
+ tmpIndex = vec_sub(tmpIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp0 = vec_perm(table[4], table[5], tmpIndex);
+ stmp0 = vec_perm(slope_cos[4], slope_cos[5], tmpIndex);
+
+ tmpIndex = vec_sub(tmpIndex, (((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32})) );
+ tmp1 = vec_perm(table[6], table[7], tmpIndex);
+ stmp1 = vec_perm(slope_cos[6], slope_cos[7], tmpIndex);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95})) );
+ tmp3 = vec_sel(tmp0, tmp1, select);
+ stmp3 = vec_sel(stmp0, stmp1, select);
+
+ select = (vector unsigned short)vec_cmpgt(PerIndex, (((vector unsigned char){63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63})) );
+ table1 = vec_sel(tmp2, tmp3, select);
+ slope1 = vec_sel(stmp2, stmp3, select);
+
+
+
+ L_tmp0 = vec_sra(vec_mule(slope0, offset0), (((vector unsigned int){12,12,12,12})) );
+ L_tmp1 = vec_sra(vec_mulo(slope0, offset0), (((vector unsigned int){12,12,12,12})) );
+ L_tmp2 = vec_sra(vec_mule(slope1, offset1), (((vector unsigned int){12,12,12,12})) );
+ L_tmp3 = vec_sra(vec_mulo(slope1, offset1), (((vector unsigned int){12,12,12,12})) );
+
+
+ tmp0 = vec_packs(L_tmp0, L_tmp2);
+ tmp1 = vec_packs(L_tmp1, L_tmp3);
+ tmp2 = vec_mergeh(tmp0, tmp1);
+ tmp3 = vec_mergel(tmp0, tmp1);
+
+
+ lspq[0] = vec_adds(table0, tmp2);
+ lspq[1] = vec_adds(table1, tmp3);
+
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c
new file mode 100644
index 000000000..3e0e6a079
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c
@@ -0,0 +1,57 @@
+#include "harness.h"
+
+/* This problem occurs if a function is inlined. When its local
+ variables get allocated space on the caller's (the function to
+ which it is inlined) stack frame, they don't get 16-byte alignment
+ even if they need it. Here's an example with a union (that's the
+ first case I uncovered, but it's probably a general occurrence on
+ inlining). */
+
+#define N 10
+/* adjust N = size of buffer to try to get bad alignment for inlined union */
+
+#define DO_INLINE __attribute__ ((always_inline))
+#define DONT_INLINE __attribute__ ((noinline))
+
+#ifdef __LITTLE_ENDIAN__
+static inline DO_INLINE int inline_me(vector signed short data)
+{
+ union {vector signed short v; signed short s[8];} u;
+ signed short x;
+ unsigned char x1, x2;
+
+ u.v = data;
+ x = u.s[7];
+ x1 = (x >> 8) & 0xff;
+ x2 = x & 0xff;
+ return ((x2 << 8) | x1);
+}
+#else
+static inline DO_INLINE int inline_me(vector signed short data)
+{
+ union {vector signed short v; signed short s[8];} u;
+ u.v = data;
+ return u.s[7];
+}
+#endif
+
+static DONT_INLINE int foo(vector signed short data)
+{
+ int c, buffer[N], i;
+ c = inline_me(data);
+ for (i=0; i<N; i++) {
+ if (i == 0)
+ buffer[i] = c;
+ else
+ buffer[i] = buffer[i-1] + c*i;
+ }
+ return buffer[N-1];
+}
+
+static void test()
+{
+ check(foo((vector signed short)
+ ((vector unsigned char){1,2,3,4,5,6,7,8,
+ 9,10,11,12,13,14,15,16})) == 0x2b4e0,
+ "foo");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/harness.h b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/harness.h
new file mode 100644
index 000000000..faea3e97d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/harness.h
@@ -0,0 +1,30 @@
+/* Common code for most VMX test cases. To use, include this file,
+ then write a routine named test() that performs a series of calls
+ to check(). */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <altivec.h>
+
+static int failed;
+static void test (void);
+
+static void
+check (int result, const char *name)
+{
+ if (!result)
+ {
+ failed++;
+ printf ("fail %s\n", name);
+ }
+}
+
+int
+main (void)
+{
+ test ();
+ if (failed)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-be-order.c
new file mode 100644
index 000000000..592ef28c0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-be-order.c
@@ -0,0 +1,65 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ vector unsigned char va = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vb = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector unsigned short vc = {0,1,2,3,4,5,6,7};
+ vector signed short vd = {-4,-3,-2,-1,0,1,2,3};
+ vector unsigned int ve = {0,1,2,3};
+ vector signed int vf = {-2,-1,0,1};
+ vector float vg = {-2.0f,-1.0f,0.0f,1.0f};
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ check (vec_all_eq (vec_insert (16, va, 5),
+ ((vector unsigned char)
+ {0,1,2,3,4,5,6,7,8,9,16,11,12,13,14,15})),
+ "vec_insert (va LE)");
+ check (vec_all_eq (vec_insert (-16, vb, 0),
+ ((vector signed char)
+ {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,-16})),
+ "vec_insert (vb LE)");
+ check (vec_all_eq (vec_insert (16, vc, 7),
+ ((vector unsigned short){16,1,2,3,4,5,6,7})),
+ "vec_insert (vc LE)");
+ check (vec_all_eq (vec_insert (-16, vd, 3),
+ ((vector signed short){-4,-3,-2,-1,-16,1,2,3})),
+ "vec_insert (vd LE)");
+ check (vec_all_eq (vec_insert (16, ve, 2),
+ ((vector unsigned int){0,16,2,3})),
+ "vec_insert (ve LE)");
+ check (vec_all_eq (vec_insert (-16, vf, 1),
+ ((vector signed int){-2,-1,-16,1})),
+ "vec_insert (vf LE)");
+ check (vec_all_eq (vec_insert (-16.0f, vg, 0),
+ ((vector float){-2.0f,-1.0f,0.0f,-16.0f})),
+ "vec_insert (vg LE)");
+#else
+ check (vec_all_eq (vec_insert (16, va, 5),
+ ((vector unsigned char)
+ {0,1,2,3,4,16,6,7,8,9,10,11,12,13,14,15})),
+ "vec_insert (va BE)");
+ check (vec_all_eq (vec_insert (-16, vb, 0),
+ ((vector signed char)
+ {-16,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7})),
+ "vec_insert (vb BE)");
+ check (vec_all_eq (vec_insert (16, vc, 7),
+ ((vector unsigned short){0,1,2,3,4,5,6,16})),
+ "vec_insert (vc BE)");
+ check (vec_all_eq (vec_insert (-16, vd, 3),
+ ((vector signed short){-4,-3,-2,-16,0,1,2,3})),
+ "vec_insert (vd BE)");
+ check (vec_all_eq (vec_insert (16, ve, 2),
+ ((vector unsigned int){0,1,16,3})),
+ "vec_insert (ve BE)");
+ check (vec_all_eq (vec_insert (-16, vf, 1),
+ ((vector signed int){-2,-16,0,1})),
+ "vec_insert (vf BE)");
+ check (vec_all_eq (vec_insert (-16.0f, vg, 0),
+ ((vector float){-16.0f,-1.0f,0.0f,1.0f})),
+ "vec_insert (vg BE)");
+#endif
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c
new file mode 100644
index 000000000..672fc449e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c
@@ -0,0 +1,34 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static int vec_long_long_eq (vector long long x, vector long long y)
+{
+ return (x[0] == y[0] && x[1] == y[1]);
+}
+
+static int vec_dbl_eq (vector double x, vector double y)
+{
+ return (x[0] == y[0] && x[1] == y[1]);
+}
+
+static void test()
+{
+ vector long long vl = {0, 1};
+ vector double vd = {0.0, 1.0};
+ vector long long vlr = vec_insert (2, vl, 0);
+ vector double vdr = vec_insert (2.0, vd, 1);
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector long long vler = {0, 2};
+ vector double vder = {2.0, 1.0};
+#else
+ vector long long vler = {2, 1};
+ vector double vder = {0.0, 2.0};
+#endif
+
+ check (vec_long_long_eq (vlr, vler), "vl");
+ check (vec_dbl_eq (vdr, vder), "vd");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-vsx.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-vsx.c
new file mode 100644
index 000000000..afb9c7016
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert-vsx.c
@@ -0,0 +1,28 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static int vec_long_long_eq (vector long long x, vector long long y)
+{
+ return (x[0] == y[0] && x[1] == y[1]);
+}
+
+static int vec_dbl_eq (vector double x, vector double y)
+{
+ return (x[0] == y[0] && x[1] == y[1]);
+}
+
+static void test()
+{
+ vector long long vl = {0, 1};
+ vector double vd = {0.0, 1.0};
+ vector long long vlr = vec_insert (2, vl, 0);
+ vector double vdr = vec_insert (2.0, vd, 1);
+ vector long long vler = {2, 1};
+ vector double vder = {0.0, 2.0};
+
+ check (vec_long_long_eq (vlr, vler), "vl");
+ check (vec_dbl_eq (vdr, vder), "vd");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert.c
new file mode 100644
index 000000000..39cd75d87
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/insert.c
@@ -0,0 +1,37 @@
+#include "harness.h"
+
+static void test()
+{
+ vector unsigned char va = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vb = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector unsigned short vc = {0,1,2,3,4,5,6,7};
+ vector signed short vd = {-4,-3,-2,-1,0,1,2,3};
+ vector unsigned int ve = {0,1,2,3};
+ vector signed int vf = {-2,-1,0,1};
+ vector float vg = {-2.0f,-1.0f,0.0f,1.0f};
+
+ check (vec_all_eq (vec_insert (16, va, 5),
+ ((vector unsigned char)
+ {0,1,2,3,4,16,6,7,8,9,10,11,12,13,14,15})),
+ "vec_insert (va)");
+ check (vec_all_eq (vec_insert (-16, vb, 0),
+ ((vector signed char)
+ {-16,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7})),
+ "vec_insert (vb)");
+ check (vec_all_eq (vec_insert (16, vc, 7),
+ ((vector unsigned short){0,1,2,3,4,5,6,16})),
+ "vec_insert (vc)");
+ check (vec_all_eq (vec_insert (-16, vd, 3),
+ ((vector signed short){-4,-3,-2,-16,0,1,2,3})),
+ "vec_insert (vd)");
+ check (vec_all_eq (vec_insert (16, ve, 2),
+ ((vector unsigned int){0,1,16,3})),
+ "vec_insert (ve)");
+ check (vec_all_eq (vec_insert (-16, vf, 1),
+ ((vector signed int){-2,-16,0,1})),
+ "vec_insert (vf)");
+ check (vec_all_eq (vec_insert (-16.0f, vg, 0),
+ ((vector float){-16.0f,-1.0f,0.0f,1.0f})),
+ "vec_insert (vg)");
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira1.c
new file mode 100644
index 000000000..eee286912
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira1.c
@@ -0,0 +1,10 @@
+#include <altivec.h>
+#include <stdlib.h>
+vector unsigned char u8a, u8b;
+
+int main()
+{
+ if (!vec_all_eq(u8a, u8b))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2.c
new file mode 100644
index 000000000..cf2248097
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+#include <altivec.h>
+vector unsigned char u8a, u8b, u8c, u8d, *u8ptr;
+vector signed short s16a, s16b, s16c, s16d;
+vector unsigned short u16a, u16b, u16c, u16d;
+vector unsigned int u32a, u32b, u32c, u32d;
+vector float f32a, f32b, f32c, f32d, f32e;
+int i, j, *p;
+
+void test()
+{
+ u8c = vec_add(u8a, u8b);
+ f32c = vec_ceil(f32a);
+ f32d = vec_vcfux(u32a, 31U);
+ s16c = vec_splat_s16(-16);
+ u8d = vec_vsldoi(u8a, u8b, 15);
+ f32e = vec_vmaddfp(f32a, f32b, f32c);
+ /* vec_dstst(u8ptr, i, 3U); */
+ vec_dss(3);
+ vec_dssall();
+ vec_mtvscr(u8a);
+ u16a = vec_mfvscr();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2a.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2a.c
new file mode 100644
index 000000000..e6a716d6f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2a.c
@@ -0,0 +1,9 @@
+#include <altivec.h>
+vector unsigned char *u8ptr;
+int i;
+
+int main()
+{
+ vec_dstst(u8ptr, i, 3U);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2b.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2b.c
new file mode 100644
index 000000000..d9a33f2dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2b.c
@@ -0,0 +1,17 @@
+#include "harness.h"
+
+static vector float
+f(vector float f32a, vector float f32b, vector float f32c)
+{
+ f32c = vec_ceil(f32a);
+ return vec_vmaddfp(f32a, f32b, f32c);
+}
+
+static void test()
+{
+ check(vec_all_eq(f(((vector float){2,3,5,7}),
+ ((vector float){11,13,17,19}),
+ ((vector float){23,29,31,37})),
+ ((vector float){24, 42, 90, 140})),
+ "test");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2c.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2c.c
new file mode 100644
index 000000000..bce5469ce
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ira2c.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+double __fabs(double a) { return a; }
+double __fmadd(double a, double b, double c) { return a*b+c; }
+
+double
+test(double f32a, double f32b, double f32c)
+{
+ f32c = __fabs(f32a);
+ return __fmadd(f32a, f32b, f32c);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-be-order.c
new file mode 100644
index 000000000..903b997c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-be-order.c
@@ -0,0 +1,107 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned char svbc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned short svbs[8] __attribute__ ((aligned (16)));
+static unsigned short svp[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static unsigned int svbi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ svuc[i] = i;
+ svsc[i] = i - 8;
+ svbc[i] = (i % 2) ? 0xff : 0;
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ svus[i] = i;
+ svss[i] = i - 4;
+ svbs[i] = (i % 2) ? 0xffff : 0;
+ svp[i] = i;
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ svui[i] = i;
+ svsi[i] = i - 2;
+ svbi[i] = (i % 2) ? 0xffffffff : 0;
+ svf[i] = i * 1.0f;
+ }
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char evuc = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+ vector signed char evsc = {7,6,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7,-8};
+ vector bool char evbc = {255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0};
+ vector unsigned short evus = {7,6,5,4,3,2,1,0};
+ vector signed short evss = {3,2,1,0,-1,-2,-3,-4};
+ vector bool short evbs = {65535,0,65535,0,65535,0,65535,0};
+ vector pixel evp = {7,6,5,4,3,2,1,0};
+ vector unsigned int evui = {3,2,1,0};
+ vector signed int evsi = {1,0,-1,-2};
+ vector bool int evbi = {0xffffffff,0,0xffffffff,0};
+ vector float evf = {3.0,2.0,1.0,0.0};
+#else
+ vector unsigned char evuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char evsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char evbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
+ vector unsigned short evus = {0,1,2,3,4,5,6,7};
+ vector signed short evss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short evbs = {0,65535,0,65535,0,65535,0,65535};
+ vector pixel evp = {0,1,2,3,4,5,6,7};
+ vector unsigned int evui = {0,1,2,3};
+ vector signed int evsi = {-2,-1,0,1};
+ vector bool int evbi = {0,0xffffffff,0,0xffffffff};
+ vector float evf = {0.0,1.0,2.0,3.0};
+#endif
+
+ vector unsigned char vuc;
+ vector signed char vsc;
+ vector bool char vbc;
+ vector unsigned short vus;
+ vector signed short vss;
+ vector bool short vbs;
+ vector pixel vp;
+ vector unsigned int vui;
+ vector signed int vsi;
+ vector bool int vbi;
+ vector float vf;
+
+ init ();
+
+ vuc = vec_ld (0, (vector unsigned char *)svuc);
+ vsc = vec_ld (0, (vector signed char *)svsc);
+ vbc = vec_ld (0, (vector bool char *)svbc);
+ vus = vec_ld (0, (vector unsigned short *)svus);
+ vss = vec_ld (0, (vector signed short *)svss);
+ vbs = vec_ld (0, (vector bool short *)svbs);
+ vp = vec_ld (0, (vector pixel *)svp);
+ vui = vec_ld (0, (vector unsigned int *)svui);
+ vsi = vec_ld (0, (vector signed int *)svsi);
+ vbi = vec_ld (0, (vector bool int *)svbi);
+ vf = vec_ld (0, (vector float *)svf);
+
+ check (vec_all_eq (vuc, evuc), "vuc");
+ check (vec_all_eq (vsc, evsc), "vsc");
+ check (vec_all_eq (vbc, evbc), "vbc");
+ check (vec_all_eq (vus, evus), "vus");
+ check (vec_all_eq (vss, evss), "vss");
+ check (vec_all_eq (vbs, evbs), "vbs");
+ check (vec_all_eq (vp, evp ), "vp" );
+ check (vec_all_eq (vui, evui), "vui");
+ check (vec_all_eq (vsi, evsi), "vsi");
+ check (vec_all_eq (vbi, evbi), "vbi");
+ check (vec_all_eq (vf, evf ), "vf" );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c
new file mode 100644
index 000000000..fc81beb0d
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c
@@ -0,0 +1,44 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static unsigned long long svul[2] __attribute__ ((aligned (16)));
+static double svd[2] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ svul[i] = i;
+ svd[i] = i * 1.0;
+ }
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned long long evul = {1,0};
+ vector double evd = {1.0,0.0};
+#else
+ vector unsigned long long evul = {0,1};
+ vector double evd = {0.0,1.0};
+#endif
+
+ vector unsigned long long vul;
+ vector double vd;
+ unsigned i;
+
+ init ();
+
+ vul = vec_ld (0, (vector unsigned long long *)svul);
+ vd = vec_ld (0, (vector double *)svd);
+
+ for (i = 0; i < 2; ++i)
+ {
+ check (vul[i] == evul[i], "vul");
+ check (vd[i] == evd[i], "vd" );
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-vsx.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-vsx.c
new file mode 100644
index 000000000..9d2a529f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld-vsx.c
@@ -0,0 +1,39 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static unsigned long long svul[2] __attribute__ ((aligned (16)));
+static double svd[2] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ svul[i] = i;
+ svd[i] = i * 1.0;
+ }
+}
+
+static void test ()
+{
+ vector unsigned long long evul = {0,1};
+ vector double evd = {0.0,1.0};
+
+ vector unsigned long long vul;
+ vector double vd;
+ unsigned i;
+
+ init ();
+
+ vul = vec_ld (0, (vector unsigned long long *)svul);
+ vd = vec_ld (0, (vector double *)svd);
+
+ for (i = 0; i < 2; ++i)
+ {
+ check (vul[i] == evul[i], "vul");
+ check (vd[i] == evd[i], "vd" );
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld.c
new file mode 100644
index 000000000..851fbd58a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ld.c
@@ -0,0 +1,91 @@
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned char svbc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned short svbs[8] __attribute__ ((aligned (16)));
+static unsigned short svp[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static unsigned int svbi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ svuc[i] = i;
+ svsc[i] = i - 8;
+ svbc[i] = (i % 2) ? 0xff : 0;
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ svus[i] = i;
+ svss[i] = i - 4;
+ svbs[i] = (i % 2) ? 0xffff : 0;
+ svp[i] = i;
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ svui[i] = i;
+ svsi[i] = i - 2;
+ svbi[i] = (i % 2) ? 0xffffffff : 0;
+ svf[i] = i * 1.0f;
+ }
+}
+
+static void test ()
+{
+ vector unsigned char evuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char evsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char evbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
+ vector unsigned short evus = {0,1,2,3,4,5,6,7};
+ vector signed short evss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short evbs = {0,65535,0,65535,0,65535,0,65535};
+ vector pixel evp = {0,1,2,3,4,5,6,7};
+ vector unsigned int evui = {0,1,2,3};
+ vector signed int evsi = {-2,-1,0,1};
+ vector bool int evbi = {0,0xffffffff,0,0xffffffff};
+ vector float evf = {0.0,1.0,2.0,3.0};
+
+ vector unsigned char vuc;
+ vector signed char vsc;
+ vector bool char vbc;
+ vector unsigned short vus;
+ vector signed short vss;
+ vector bool short vbs;
+ vector pixel vp;
+ vector unsigned int vui;
+ vector signed int vsi;
+ vector bool int vbi;
+ vector float vf;
+
+ init ();
+
+ vuc = vec_ld (0, (vector unsigned char *)svuc);
+ vsc = vec_ld (0, (vector signed char *)svsc);
+ vbc = vec_ld (0, (vector bool char *)svbc);
+ vus = vec_ld (0, (vector unsigned short *)svus);
+ vss = vec_ld (0, (vector signed short *)svss);
+ vbs = vec_ld (0, (vector bool short *)svbs);
+ vp = vec_ld (0, (vector pixel *)svp);
+ vui = vec_ld (0, (vector unsigned int *)svui);
+ vsi = vec_ld (0, (vector signed int *)svsi);
+ vbi = vec_ld (0, (vector bool int *)svbi);
+ vf = vec_ld (0, (vector float *)svf);
+
+ check (vec_all_eq (vuc, evuc), "vuc");
+ check (vec_all_eq (vsc, evsc), "vsc");
+ check (vec_all_eq (vbc, evbc), "vbc");
+ check (vec_all_eq (vus, evus), "vus");
+ check (vec_all_eq (vss, evss), "vss");
+ check (vec_all_eq (vbs, evbs), "vbs");
+ check (vec_all_eq (vp, evp ), "vp" );
+ check (vec_all_eq (vui, evui), "vui");
+ check (vec_all_eq (vsi, evsi), "vsi");
+ check (vec_all_eq (vbi, evbi), "vbi");
+ check (vec_all_eq (vf, evf ), "vf" );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/lde-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/lde-be-order.c
new file mode 100644
index 000000000..9a6d5bae5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/lde-be-order.c
@@ -0,0 +1,73 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ int i;
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ for (i = 15; i >= 0; --i)
+#else
+ for (i = 0; i < 16; ++i)
+#endif
+ {
+ svuc[i] = i;
+ svsc[i] = i - 8;
+ }
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ for (i = 7; i >= 0; --i)
+#else
+ for (i = 0; i < 8; ++i)
+#endif
+ {
+ svus[i] = i;
+ svss[i] = i - 4;
+ }
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ for (i = 3; i >= 0; --i)
+#else
+ for (i = 0; i < 4; ++i)
+#endif
+ {
+ svui[i] = i;
+ svsi[i] = i - 2;
+ svf[i] = i * 1.0f;
+ }
+}
+
+static void test ()
+{
+ vector unsigned char vuc;
+ vector signed char vsc;
+ vector unsigned short vus;
+ vector signed short vss;
+ vector unsigned int vui;
+ vector signed int vsi;
+ vector float vf;
+
+ init ();
+
+ vuc = vec_lde (9*1, (unsigned char *)svuc);
+ vsc = vec_lde (14*1, (signed char *)svsc);
+ vus = vec_lde (7*2, (unsigned short *)svus);
+ vss = vec_lde (1*2, (signed short *)svss);
+ vui = vec_lde (3*4, (unsigned int *)svui);
+ vsi = vec_lde (2*4, (signed int *)svsi);
+ vf = vec_lde (0*4, (float *)svf);
+
+ check (vec_extract (vuc, 9) == 9, "vuc");
+ check (vec_extract (vsc, 14) == 6, "vsc");
+ check (vec_extract (vus, 7) == 7, "vus");
+ check (vec_extract (vss, 1) == -3, "vss");
+ check (vec_extract (vui, 3) == 3, "vui");
+ check (vec_extract (vsi, 2) == 0, "vsi");
+ check (vec_extract (vf, 0) == 0.0, "vf");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/lde.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/lde.c
new file mode 100644
index 000000000..5594963c7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/lde.c
@@ -0,0 +1,59 @@
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ svuc[i] = i;
+ svsc[i] = i - 8;
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ svus[i] = i;
+ svss[i] = i - 4;
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ svui[i] = i;
+ svsi[i] = i - 2;
+ svf[i] = i * 1.0f;
+ }
+}
+
+static void test ()
+{
+ vector unsigned char vuc;
+ vector signed char vsc;
+ vector unsigned short vus;
+ vector signed short vss;
+ vector unsigned int vui;
+ vector signed int vsi;
+ vector float vf;
+
+ init ();
+
+ vuc = vec_lde (9*1, (unsigned char *)svuc);
+ vsc = vec_lde (14*1, (signed char *)svsc);
+ vus = vec_lde (7*2, (unsigned short *)svus);
+ vss = vec_lde (1*2, (signed short *)svss);
+ vui = vec_lde (3*4, (unsigned int *)svui);
+ vsi = vec_lde (2*4, (signed int *)svsi);
+ vf = vec_lde (0*4, (float *)svf);
+
+ check (vec_extract (vuc, 9) == 9, "vuc");
+ check (vec_extract (vsc, 14) == 6, "vsc");
+ check (vec_extract (vus, 7) == 7, "vus");
+ check (vec_extract (vss, 1) == -3, "vss");
+ check (vec_extract (vui, 3) == 3, "vui");
+ check (vec_extract (vsi, 2) == 0, "vsi");
+ check (vec_extract (vf, 0) == 0.0, "vf");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-be-order.c
new file mode 100644
index 000000000..397849fe1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-be-order.c
@@ -0,0 +1,107 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned char svbc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned short svbs[8] __attribute__ ((aligned (16)));
+static unsigned short svp[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static unsigned int svbi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ svuc[i] = i;
+ svsc[i] = i - 8;
+ svbc[i] = (i % 2) ? 0xff : 0;
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ svus[i] = i;
+ svss[i] = i - 4;
+ svbs[i] = (i % 2) ? 0xffff : 0;
+ svp[i] = i;
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ svui[i] = i;
+ svsi[i] = i - 2;
+ svbi[i] = (i % 2) ? 0xffffffff : 0;
+ svf[i] = i * 1.0f;
+ }
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char evuc = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+ vector signed char evsc = {7,6,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7,-8};
+ vector bool char evbc = {255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0};
+ vector unsigned short evus = {7,6,5,4,3,2,1,0};
+ vector signed short evss = {3,2,1,0,-1,-2,-3,-4};
+ vector bool short evbs = {65535,0,65535,0,65535,0,65535,0};
+ vector pixel evp = {7,6,5,4,3,2,1,0};
+ vector unsigned int evui = {3,2,1,0};
+ vector signed int evsi = {1,0,-1,-2};
+ vector bool int evbi = {0xffffffff,0,0xffffffff,0};
+ vector float evf = {3.0,2.0,1.0,0.0};
+#else
+ vector unsigned char evuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char evsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char evbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
+ vector unsigned short evus = {0,1,2,3,4,5,6,7};
+ vector signed short evss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short evbs = {0,65535,0,65535,0,65535,0,65535};
+ vector pixel evp = {0,1,2,3,4,5,6,7};
+ vector unsigned int evui = {0,1,2,3};
+ vector signed int evsi = {-2,-1,0,1};
+ vector bool int evbi = {0,0xffffffff,0,0xffffffff};
+ vector float evf = {0.0,1.0,2.0,3.0};
+#endif
+
+ vector unsigned char vuc;
+ vector signed char vsc;
+ vector bool char vbc;
+ vector unsigned short vus;
+ vector signed short vss;
+ vector bool short vbs;
+ vector pixel vp;
+ vector unsigned int vui;
+ vector signed int vsi;
+ vector bool int vbi;
+ vector float vf;
+
+ init ();
+
+ vuc = vec_ldl (0, (vector unsigned char *)svuc);
+ vsc = vec_ldl (0, (vector signed char *)svsc);
+ vbc = vec_ldl (0, (vector bool char *)svbc);
+ vus = vec_ldl (0, (vector unsigned short *)svus);
+ vss = vec_ldl (0, (vector signed short *)svss);
+ vbs = vec_ldl (0, (vector bool short *)svbs);
+ vp = vec_ldl (0, (vector pixel *)svp);
+ vui = vec_ldl (0, (vector unsigned int *)svui);
+ vsi = vec_ldl (0, (vector signed int *)svsi);
+ vbi = vec_ldl (0, (vector bool int *)svbi);
+ vf = vec_ldl (0, (vector float *)svf);
+
+ check (vec_all_eq (vuc, evuc), "vuc");
+ check (vec_all_eq (vsc, evsc), "vsc");
+ check (vec_all_eq (vbc, evbc), "vbc");
+ check (vec_all_eq (vus, evus), "vus");
+ check (vec_all_eq (vss, evss), "vss");
+ check (vec_all_eq (vbs, evbs), "vbs");
+ check (vec_all_eq (vp, evp ), "vp" );
+ check (vec_all_eq (vui, evui), "vui");
+ check (vec_all_eq (vsi, evsi), "vsi");
+ check (vec_all_eq (vbi, evbi), "vbi");
+ check (vec_all_eq (vf, evf ), "vf" );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c
new file mode 100644
index 000000000..1dd0ca33e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c
@@ -0,0 +1,44 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static unsigned long long svul[2] __attribute__ ((aligned (16)));
+static double svd[2] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ svul[i] = i;
+ svd[i] = i * 1.0;
+ }
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned long long evul = {1,0};
+ vector double evd = {1.0,0.0};
+#else
+ vector unsigned long long evul = {0,1};
+ vector double evd = {0.0,1.0};
+#endif
+
+ vector unsigned long long vul;
+ vector double vd;
+ unsigned i;
+
+ init ();
+
+ vul = vec_ldl (0, (vector unsigned long long *)svul);
+ vd = vec_ldl (0, (vector double *)svd);
+
+ for (i = 0; i < 2; ++i)
+ {
+ check (vul[i] == evul[i], "vul");
+ check (vd[i] == evd[i], "vd" );
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-vsx.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-vsx.c
new file mode 100644
index 000000000..4bf3224f6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl-vsx.c
@@ -0,0 +1,39 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static unsigned long long svul[2] __attribute__ ((aligned (16)));
+static double svd[2] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ svul[i] = i;
+ svd[i] = i * 1.0;
+ }
+}
+
+static void test ()
+{
+ vector unsigned long long evul = {0,1};
+ vector double evd = {0.0,1.0};
+
+ vector unsigned long long vul;
+ vector double vd;
+ unsigned i;
+
+ init ();
+
+ vul = vec_ldl (0, (vector unsigned long long *)svul);
+ vd = vec_ldl (0, (vector double *)svd);
+
+ for (i = 0; i < 2; ++i)
+ {
+ check (vul[i] == evul[i], "vul");
+ check (vd[i] == evd[i], "vd" );
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl.c
new file mode 100644
index 000000000..3f9a603e3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ldl.c
@@ -0,0 +1,91 @@
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned char svbc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned short svbs[8] __attribute__ ((aligned (16)));
+static unsigned short svp[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static unsigned int svbi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void init ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ svuc[i] = i;
+ svsc[i] = i - 8;
+ svbc[i] = (i % 2) ? 0xff : 0;
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ svus[i] = i;
+ svss[i] = i - 4;
+ svbs[i] = (i % 2) ? 0xffff : 0;
+ svp[i] = i;
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ svui[i] = i;
+ svsi[i] = i - 2;
+ svbi[i] = (i % 2) ? 0xffffffff : 0;
+ svf[i] = i * 1.0f;
+ }
+}
+
+static void test ()
+{
+ vector unsigned char evuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char evsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char evbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
+ vector unsigned short evus = {0,1,2,3,4,5,6,7};
+ vector signed short evss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short evbs = {0,65535,0,65535,0,65535,0,65535};
+ vector pixel evp = {0,1,2,3,4,5,6,7};
+ vector unsigned int evui = {0,1,2,3};
+ vector signed int evsi = {-2,-1,0,1};
+ vector bool int evbi = {0,0xffffffff,0,0xffffffff};
+ vector float evf = {0.0,1.0,2.0,3.0};
+
+ vector unsigned char vuc;
+ vector signed char vsc;
+ vector bool char vbc;
+ vector unsigned short vus;
+ vector signed short vss;
+ vector bool short vbs;
+ vector pixel vp;
+ vector unsigned int vui;
+ vector signed int vsi;
+ vector bool int vbi;
+ vector float vf;
+
+ init ();
+
+ vuc = vec_ldl (0, (vector unsigned char *)svuc);
+ vsc = vec_ldl (0, (vector signed char *)svsc);
+ vbc = vec_ldl (0, (vector bool char *)svbc);
+ vus = vec_ldl (0, (vector unsigned short *)svus);
+ vss = vec_ldl (0, (vector signed short *)svss);
+ vbs = vec_ldl (0, (vector bool short *)svbs);
+ vp = vec_ldl (0, (vector pixel *)svp);
+ vui = vec_ldl (0, (vector unsigned int *)svui);
+ vsi = vec_ldl (0, (vector signed int *)svsi);
+ vbi = vec_ldl (0, (vector bool int *)svbi);
+ vf = vec_ldl (0, (vector float *)svf);
+
+ check (vec_all_eq (vuc, evuc), "vuc");
+ check (vec_all_eq (vsc, evsc), "vsc");
+ check (vec_all_eq (vbc, evbc), "vbc");
+ check (vec_all_eq (vus, evus), "vus");
+ check (vec_all_eq (vss, evss), "vss");
+ check (vec_all_eq (vbs, evbs), "vbs");
+ check (vec_all_eq (vp, evp ), "vp" );
+ check (vec_all_eq (vui, evui), "vui");
+ check (vec_all_eq (vsi, evsi), "vsi");
+ check (vec_all_eq (vbi, evbi), "vbi");
+ check (vec_all_eq (vf, evf ), "vf" );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mem.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mem.c
new file mode 100644
index 000000000..a26eb3cfc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mem.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+#include <altivec.h>
+void
+f(vector unsigned char *a, vector unsigned char *b, vector unsigned char *c)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ c[i] = vec_add(a[i], b[i]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-be-order.c
new file mode 100644
index 000000000..2de888fa4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-be-order.c
@@ -0,0 +1,96 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned char vuca = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned char vucb
+ = {16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+ vector signed char vsca
+ = {-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed char vscb = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned short vusa = {0,1,2,3,4,5,6,7};
+ vector unsigned short vusb = {8,9,10,11,12,13,14,15};
+ vector signed short vssa = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed short vssb = {0,1,2,3,4,5,6,7};
+ vector unsigned int vuia = {0,1,2,3};
+ vector unsigned int vuib = {4,5,6,7};
+ vector signed int vsia = {-4,-3,-2,-1};
+ vector signed int vsib = {0,1,2,3};
+ vector float vfa = {-4.0,-3.0,-2.0,-1.0};
+ vector float vfb = {0.0,1.0,2.0,3.0};
+
+ /* Result vectors. */
+ vector unsigned char vuch, vucl;
+ vector signed char vsch, vscl;
+ vector unsigned short vush, vusl;
+ vector signed short vssh, vssl;
+ vector unsigned int vuih, vuil;
+ vector signed int vsih, vsil;
+ vector float vfh, vfl;
+
+ /* Expected result vectors. */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char vucrh = {24,8,25,9,26,10,27,11,28,12,29,13,30,14,31,15};
+ vector unsigned char vucrl = {16,0,17,1,18,2,19,3,20,4,21,5,22,6,23,7};
+ vector signed char vscrh = {8,-8,9,-7,10,-6,11,-5,12,-4,13,-3,14,-2,15,-1};
+ vector signed char vscrl = {0,-16,1,-15,2,-14,3,-13,4,-12,5,-11,6,-10,7,-9};
+ vector unsigned short vusrh = {12,4,13,5,14,6,15,7};
+ vector unsigned short vusrl = {8,0,9,1,10,2,11,3};
+ vector signed short vssrh = {4,-4,5,-3,6,-2,7,-1};
+ vector signed short vssrl = {0,-8,1,-7,2,-6,3,-5};
+ vector unsigned int vuirh = {6,2,7,3};
+ vector unsigned int vuirl = {4,0,5,1};
+ vector signed int vsirh = {2,-2,3,-1};
+ vector signed int vsirl = {0,-4,1,-3};
+ vector float vfrh = {2.0,-2.0,3.0,-1.0};
+ vector float vfrl = {0.0,-4.0,1.0,-3.0};
+#else
+ vector unsigned char vucrh = {0,16,1,17,2,18,3,19,4,20,5,21,6,22,7,23};
+ vector unsigned char vucrl = {8,24,9,25,10,26,11,27,12,28,13,29,14,30,15,31};
+ vector signed char vscrh = {-16,0,-15,1,-14,2,-13,3,-12,4,-11,5,-10,6,-9,7};
+ vector signed char vscrl = {-8,8,-7,9,-6,10,-5,11,-4,12,-3,13,-2,14,-1,15};
+ vector unsigned short vusrh = {0,8,1,9,2,10,3,11};
+ vector unsigned short vusrl = {4,12,5,13,6,14,7,15};
+ vector signed short vssrh = {-8,0,-7,1,-6,2,-5,3};
+ vector signed short vssrl = {-4,4,-3,5,-2,6,-1,7};
+ vector unsigned int vuirh = {0,4,1,5};
+ vector unsigned int vuirl = {2,6,3,7};
+ vector signed int vsirh = {-4,0,-3,1};
+ vector signed int vsirl = {-2,2,-1,3};
+ vector float vfrh = {-4.0,0.0,-3.0,1.0};
+ vector float vfrl = {-2.0,2.0,-1.0,3.0};
+#endif
+
+ vuch = vec_mergeh (vuca, vucb);
+ vucl = vec_mergel (vuca, vucb);
+ vsch = vec_mergeh (vsca, vscb);
+ vscl = vec_mergel (vsca, vscb);
+ vush = vec_mergeh (vusa, vusb);
+ vusl = vec_mergel (vusa, vusb);
+ vssh = vec_mergeh (vssa, vssb);
+ vssl = vec_mergel (vssa, vssb);
+ vuih = vec_mergeh (vuia, vuib);
+ vuil = vec_mergel (vuia, vuib);
+ vsih = vec_mergeh (vsia, vsib);
+ vsil = vec_mergel (vsia, vsib);
+ vfh = vec_mergeh (vfa, vfb );
+ vfl = vec_mergel (vfa, vfb );
+
+ check (vec_all_eq (vuch, vucrh), "vuch");
+ check (vec_all_eq (vucl, vucrl), "vucl");
+ check (vec_all_eq (vsch, vscrh), "vsch");
+ check (vec_all_eq (vscl, vscrl), "vscl");
+ check (vec_all_eq (vush, vusrh), "vush");
+ check (vec_all_eq (vusl, vusrl), "vusl");
+ check (vec_all_eq (vssh, vssrh), "vssh");
+ check (vec_all_eq (vssl, vssrl), "vssl");
+ check (vec_all_eq (vuih, vuirh), "vuih");
+ check (vec_all_eq (vuil, vuirl), "vuil");
+ check (vec_all_eq (vsih, vsirh), "vsih");
+ check (vec_all_eq (vsil, vsirl), "vsil");
+ check (vec_all_eq (vfh, vfrh), "vfh");
+ check (vec_all_eq (vfl, vfrl), "vfl");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c
new file mode 100644
index 000000000..440ac9a00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c
@@ -0,0 +1,51 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static int vec_long_long_eq (vector long long x, vector long long y)
+{
+ return (x[0] == y[0] && x[1] == y[1]);
+}
+
+static int vec_double_eq (vector double x, vector double y)
+{
+ return (x[0] == y[0] && x[1] == y[1]);
+}
+
+static void test()
+{
+ /* Input vectors. */
+ vector long long vla = {-2,-1};
+ vector long long vlb = {0,1};
+ vector double vda = {-2.0,-1.0};
+ vector double vdb = {0.0,1.0};
+
+ /* Result vectors. */
+ vector long long vlh, vll;
+ vector double vdh, vdl;
+
+ /* Expected result vectors. */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector long long vlrh = {1,-1};
+ vector long long vlrl = {0,-2};
+ vector double vdrh = {1.0,-1.0};
+ vector double vdrl = {0.0,-2.0};
+#else
+ vector long long vlrh = {-2,0};
+ vector long long vlrl = {-1,1};
+ vector double vdrh = {-2.0,0.0};
+ vector double vdrl = {-1.0,1.0};
+#endif
+
+ vlh = vec_mergeh (vla, vlb);
+ vll = vec_mergel (vla, vlb);
+ vdh = vec_mergeh (vda, vdb);
+ vdl = vec_mergel (vda, vdb);
+
+ check (vec_long_long_eq (vlh, vlrh), "vlh");
+ check (vec_long_long_eq (vll, vlrl), "vll");
+ check (vec_double_eq (vdh, vdrh), "vdh" );
+ check (vec_double_eq (vdl, vdrl), "vdl" );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-vsx.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-vsx.c
new file mode 100644
index 000000000..851f35bd3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge-vsx.c
@@ -0,0 +1,44 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static int vec_long_long_eq (vector long long x, vector long long y)
+{
+ return (x[0] == y[0] && x[1] == y[1]);
+}
+
+static int vec_double_eq (vector double x, vector double y)
+{
+ return (x[0] == y[0] && x[1] == y[1]);
+}
+
+static void test()
+{
+ /* Input vectors. */
+ vector long long vla = {-2,-1};
+ vector long long vlb = {0,1};
+ vector double vda = {-2.0,-1.0};
+ vector double vdb = {0.0,1.0};
+
+ /* Result vectors. */
+ vector long long vlh, vll;
+ vector double vdh, vdl;
+
+ /* Expected result vectors. */
+ vector long long vlrh = {-2,0};
+ vector long long vlrl = {-1,1};
+ vector double vdrh = {-2.0,0.0};
+ vector double vdrl = {-1.0,1.0};
+
+ vlh = vec_mergeh (vla, vlb);
+ vll = vec_mergel (vla, vlb);
+ vdh = vec_mergeh (vda, vdb);
+ vdl = vec_mergel (vda, vdb);
+
+ check (vec_long_long_eq (vlh, vlrh), "vlh");
+ check (vec_long_long_eq (vll, vlrl), "vll");
+ check (vec_double_eq (vdh, vdrh), "vdh" );
+ check (vec_double_eq (vdl, vdrl), "vdl" );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge.c
new file mode 100644
index 000000000..84b14fea7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/merge.c
@@ -0,0 +1,77 @@
+#include "harness.h"
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned char vuca = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned char vucb
+ = {16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+ vector signed char vsca
+ = {-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed char vscb = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned short vusa = {0,1,2,3,4,5,6,7};
+ vector unsigned short vusb = {8,9,10,11,12,13,14,15};
+ vector signed short vssa = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed short vssb = {0,1,2,3,4,5,6,7};
+ vector unsigned int vuia = {0,1,2,3};
+ vector unsigned int vuib = {4,5,6,7};
+ vector signed int vsia = {-4,-3,-2,-1};
+ vector signed int vsib = {0,1,2,3};
+ vector float vfa = {-4.0,-3.0,-2.0,-1.0};
+ vector float vfb = {0.0,1.0,2.0,3.0};
+
+ /* Result vectors. */
+ vector unsigned char vuch, vucl;
+ vector signed char vsch, vscl;
+ vector unsigned short vush, vusl;
+ vector signed short vssh, vssl;
+ vector unsigned int vuih, vuil;
+ vector signed int vsih, vsil;
+ vector float vfh, vfl;
+
+ /* Expected result vectors. */
+ vector unsigned char vucrh = {0,16,1,17,2,18,3,19,4,20,5,21,6,22,7,23};
+ vector unsigned char vucrl = {8,24,9,25,10,26,11,27,12,28,13,29,14,30,15,31};
+ vector signed char vscrh = {-16,0,-15,1,-14,2,-13,3,-12,4,-11,5,-10,6,-9,7};
+ vector signed char vscrl = {-8,8,-7,9,-6,10,-5,11,-4,12,-3,13,-2,14,-1,15};
+ vector unsigned short vusrh = {0,8,1,9,2,10,3,11};
+ vector unsigned short vusrl = {4,12,5,13,6,14,7,15};
+ vector signed short vssrh = {-8,0,-7,1,-6,2,-5,3};
+ vector signed short vssrl = {-4,4,-3,5,-2,6,-1,7};
+ vector unsigned int vuirh = {0,4,1,5};
+ vector unsigned int vuirl = {2,6,3,7};
+ vector signed int vsirh = {-4,0,-3,1};
+ vector signed int vsirl = {-2,2,-1,3};
+ vector float vfrh = {-4.0,0.0,-3.0,1.0};
+ vector float vfrl = {-2.0,2.0,-1.0,3.0};
+
+ vuch = vec_mergeh (vuca, vucb);
+ vucl = vec_mergel (vuca, vucb);
+ vsch = vec_mergeh (vsca, vscb);
+ vscl = vec_mergel (vsca, vscb);
+ vush = vec_mergeh (vusa, vusb);
+ vusl = vec_mergel (vusa, vusb);
+ vssh = vec_mergeh (vssa, vssb);
+ vssl = vec_mergel (vssa, vssb);
+ vuih = vec_mergeh (vuia, vuib);
+ vuil = vec_mergel (vuia, vuib);
+ vsih = vec_mergeh (vsia, vsib);
+ vsil = vec_mergel (vsia, vsib);
+ vfh = vec_mergeh (vfa, vfb );
+ vfl = vec_mergel (vfa, vfb );
+
+ check (vec_all_eq (vuch, vucrh), "vuch");
+ check (vec_all_eq (vucl, vucrl), "vucl");
+ check (vec_all_eq (vsch, vscrh), "vsch");
+ check (vec_all_eq (vscl, vscrl), "vscl");
+ check (vec_all_eq (vush, vusrh), "vush");
+ check (vec_all_eq (vusl, vusrl), "vusl");
+ check (vec_all_eq (vssh, vssrh), "vssh");
+ check (vec_all_eq (vssl, vssrl), "vssl");
+ check (vec_all_eq (vuih, vuirh), "vuih");
+ check (vec_all_eq (vuil, vuirl), "vuil");
+ check (vec_all_eq (vsih, vsirh), "vsih");
+ check (vec_all_eq (vsil, vsirl), "vsil");
+ check (vec_all_eq (vfh, vfrh), "vfh");
+ check (vec_all_eq (vfl, vfrl), "vfl");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c
new file mode 100644
index 000000000..ff3047486
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c
@@ -0,0 +1,64 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ vector unsigned char vuca = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned char vucb = {2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3};
+ vector signed char vsca = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector signed char vscb = {2,-3,2,-3,2,-3,2,-3,2,-3,2,-3,2,-3,2,-3};
+ vector unsigned short vusa = {0,1,2,3,4,5,6,7};
+ vector unsigned short vusb = {2,3,2,3,2,3,2,3};
+ vector signed short vssa = {-4,-3,-2,-1,0,1,2,3};
+ vector signed short vssb = {2,-3,2,-3,2,-3,2,-3};
+ vector unsigned short vuse, vuso;
+ vector signed short vsse, vsso;
+ vector unsigned int vuie, vuio;
+ vector signed int vsie, vsio;
+
+ vuse = vec_mule (vuca, vucb);
+ vuso = vec_mulo (vuca, vucb);
+ vsse = vec_mule (vsca, vscb);
+ vsso = vec_mulo (vsca, vscb);
+ vuie = vec_mule (vusa, vusb);
+ vuio = vec_mulo (vusa, vusb);
+ vsie = vec_mule (vssa, vssb);
+ vsio = vec_mulo (vssa, vssb);
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ check (vec_all_eq (vuse,
+ ((vector unsigned short){3,9,15,21,27,33,39,45})),
+ "vuse");
+ check (vec_all_eq (vuso,
+ ((vector unsigned short){0,4,8,12,16,20,24,28})),
+ "vuso");
+ check (vec_all_eq (vsse,
+ ((vector signed short){21,15,9,3,-3,-9,-15,-21})),
+ "vsse");
+ check (vec_all_eq (vsso,
+ ((vector signed short){-16,-12,-8,-4,0,4,8,12})),
+ "vsso");
+ check (vec_all_eq (vuie, ((vector unsigned int){3,9,15,21})), "vuie");
+ check (vec_all_eq (vuio, ((vector unsigned int){0,4,8,12})), "vuio");
+ check (vec_all_eq (vsie, ((vector signed int){9,3,-3,-9})), "vsie");
+ check (vec_all_eq (vsio, ((vector signed int){-8,-4,0,4})), "vsio");
+#else
+ check (vec_all_eq (vuse,
+ ((vector unsigned short){0,4,8,12,16,20,24,28})),
+ "vuse");
+ check (vec_all_eq (vuso,
+ ((vector unsigned short){3,9,15,21,27,33,39,45})),
+ "vuso");
+ check (vec_all_eq (vsse,
+ ((vector signed short){-16,-12,-8,-4,0,4,8,12})),
+ "vsse");
+ check (vec_all_eq (vsso,
+ ((vector signed short){21,15,9,3,-3,-9,-15,-21})),
+ "vsso");
+ check (vec_all_eq (vuie, ((vector unsigned int){0,4,8,12})), "vuie");
+ check (vec_all_eq (vuio, ((vector unsigned int){3,9,15,21})), "vuio");
+ check (vec_all_eq (vsie, ((vector signed int){-8,-4,0,4})), "vsie");
+ check (vec_all_eq (vsio, ((vector signed int){9,3,-3,-9})), "vsio");
+#endif
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mult-even-odd.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mult-even-odd.c
new file mode 100644
index 000000000..34b72e900
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/mult-even-odd.c
@@ -0,0 +1,43 @@
+#include "harness.h"
+
+static void test()
+{
+ vector unsigned char vuca = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned char vucb = {2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3};
+ vector signed char vsca = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector signed char vscb = {2,-3,2,-3,2,-3,2,-3,2,-3,2,-3,2,-3,2,-3};
+ vector unsigned short vusa = {0,1,2,3,4,5,6,7};
+ vector unsigned short vusb = {2,3,2,3,2,3,2,3};
+ vector signed short vssa = {-4,-3,-2,-1,0,1,2,3};
+ vector signed short vssb = {2,-3,2,-3,2,-3,2,-3};
+ vector unsigned short vuse, vuso;
+ vector signed short vsse, vsso;
+ vector unsigned int vuie, vuio;
+ vector signed int vsie, vsio;
+
+ vuse = vec_mule (vuca, vucb);
+ vuso = vec_mulo (vuca, vucb);
+ vsse = vec_mule (vsca, vscb);
+ vsso = vec_mulo (vsca, vscb);
+ vuie = vec_mule (vusa, vusb);
+ vuio = vec_mulo (vusa, vusb);
+ vsie = vec_mule (vssa, vssb);
+ vsio = vec_mulo (vssa, vssb);
+
+ check (vec_all_eq (vuse,
+ ((vector unsigned short){0,4,8,12,16,20,24,28})),
+ "vuse");
+ check (vec_all_eq (vuso,
+ ((vector unsigned short){3,9,15,21,27,33,39,45})),
+ "vuso");
+ check (vec_all_eq (vsse,
+ ((vector signed short){-16,-12,-8,-4,0,4,8,12})),
+ "vsse");
+ check (vec_all_eq (vsso,
+ ((vector signed short){21,15,9,3,-3,-9,-15,-21})),
+ "vsso");
+ check (vec_all_eq (vuie, ((vector unsigned int){0,4,8,12})), "vuie");
+ check (vec_all_eq (vuio, ((vector unsigned int){3,9,15,21})), "vuio");
+ check (vec_all_eq (vsie, ((vector signed int){-8,-4,0,4})), "vsie");
+ check (vec_all_eq (vsio, ((vector signed int){9,3,-3,-9})), "vsio");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/newton-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/newton-1.c
new file mode 100644
index 000000000..c5963c034
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/newton-1.c
@@ -0,0 +1,67 @@
+/* { dg-do compile } */
+#include <altivec.h>
+
+#define SPLAT76 ((vector unsigned char)\
+ {0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3})
+#define SPLAT54 ((vector unsigned char)\
+ {4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7})
+#define SPLAT32 ((vector unsigned char)\
+ {8,9,10,11,8,9,10,11,8,9,10,11,8,9,10,11})
+#define SPLAT10 ((vector unsigned char)\
+ {12,13,14,15,12,13,14,15,12,13,14,15,12,13,14,15})
+#define INTERLEAVE ((vector unsigned char)\
+ {0,1,16,17,4,5,20,21,8,9,24,25,12,13,28,29})
+
+long real_32_manytaps (long ntaps, vector signed short *c, long ndat,
+ vector signed short *x, vector signed short *y)
+{
+ long i, j, op, ndatavec, ncoefvec;
+ vector signed short x0, x1;
+ vector signed short coef;
+ vector signed short cr10, cr32, cr54, cr76;
+ vector signed int y_even, y_odd;
+ vector signed short *x1p;
+
+ op = 0;
+ ndatavec = ndat >> 3;
+ ncoefvec = ntaps >> 3;
+
+ for (i = 0; i < ndatavec; i += 1) {
+ x0 = x[i];
+
+ y_even = ((vector signed int){0x8000,0x8000,0x8000,0x8000});
+ y_odd = ((vector signed int){0x8000,0x8000,0x8000,0x8000});
+
+ j = 0;
+ x1p = x + 1 + i;
+
+ do {
+
+ coef = c[j];
+ x1 = x1p[j];
+
+ cr10 = vec_perm(coef, coef, SPLAT10);
+ y_odd = vec_msums(cr10, x1, y_odd);
+ y_even = vec_msums(cr10, vec_sld(x0, x1, 14), y_even);
+
+ cr32 = vec_perm(coef, coef, SPLAT32);
+ y_odd = vec_msums(cr32, vec_sld(x0, x1, 12), y_odd);
+ y_even = vec_msums(cr32, vec_sld(x0, x1, 10), y_even);
+
+ cr54 = vec_perm(coef, coef, SPLAT54);
+ y_odd = vec_msums(cr54, vec_sld(x0, x1, 8), y_odd);
+ y_even = vec_msums(cr54, vec_sld(x0, x1, 6), y_even);
+
+ cr76 = vec_perm(coef, coef, SPLAT76);
+ y_odd = vec_msums(cr76, vec_sld(x0, x1, 4), y_odd);
+ y_even = vec_msums(cr76, vec_sld(x0, x1, 2), y_even);
+
+ x0 = x1;
+
+ } while (++j < ncoefvec);
+ y[op++] = (vector signed short) vec_perm(y_even, y_odd, INTERLEAVE);
+
+ }
+
+ return op*8;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops-long-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops-long-1.c
new file mode 100644
index 000000000..547170679
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops-long-1.c
@@ -0,0 +1,80 @@
+/* { dg-do compile } */
+
+/* Checks from the original ops.c that pass pointers to long or
+ unsigned long for operations that support that in released versions
+ of <altivec.h>. */
+
+#include <altivec.h>
+#include <stdlib.h>
+extern int *var_int;
+extern long * *var_long_ptr;
+extern unsigned long * *var_unsigned_long_ptr;
+extern vector signed int * *var_vec_s32_ptr;
+extern vector signed int *var_vec_s32;
+extern vector unsigned char * *var_vec_u8_ptr;
+extern vector unsigned char *var_vec_u8;
+extern vector unsigned int * *var_vec_u32_ptr;
+extern vector unsigned int *var_vec_u32;
+
+void f13() {
+ *var_vec_s32++ = vec_ld(var_int[0], var_long_ptr[1]);
+ *var_vec_s32++ = vec_lde(var_int[0], var_long_ptr[1]);
+ *var_vec_s32++ = vec_ldl(var_int[0], var_long_ptr[1]);
+ *var_vec_s32++ = vec_lvewx(var_int[0], var_long_ptr[1]);
+ *var_vec_s32++ = vec_lvx(var_int[0], var_long_ptr[1]);
+ *var_vec_s32++ = vec_lvxl(var_int[0], var_long_ptr[1]);
+}
+void f22() {
+ *var_vec_u32++ = vec_ld(var_int[0], var_unsigned_long_ptr[1]);
+ *var_vec_u32++ = vec_lde(var_int[0], var_unsigned_long_ptr[1]);
+ *var_vec_u32++ = vec_ldl(var_int[0], var_unsigned_long_ptr[1]);
+ *var_vec_u32++ = vec_lvewx(var_int[0], var_unsigned_long_ptr[1]);
+ *var_vec_u32++ = vec_lvx(var_int[0], var_unsigned_long_ptr[1]);
+ *var_vec_u32++ = vec_lvxl(var_int[0], var_unsigned_long_ptr[1]);
+}
+void f25() {
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_long_ptr[1]);
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_unsigned_long_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_long_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_unsigned_long_ptr[1]);
+}
+void f33() {
+ vec_dst(var_long_ptr[0], var_int[1], 0);
+ vec_dst(var_long_ptr[0], var_int[1], 1);
+ vec_dst(var_long_ptr[0], var_int[1], 2);
+ vec_dst(var_long_ptr[0], var_int[1], 3);
+ vec_dst(var_unsigned_long_ptr[0], var_int[1], 0);
+ vec_dst(var_unsigned_long_ptr[0], var_int[1], 1);
+ vec_dst(var_unsigned_long_ptr[0], var_int[1], 2);
+ vec_dst(var_unsigned_long_ptr[0], var_int[1], 3);
+}
+void f34() {
+ vec_dstst(var_long_ptr[0], var_int[1], 0);
+ vec_dstst(var_long_ptr[0], var_int[1], 1);
+ vec_dstst(var_long_ptr[0], var_int[1], 2);
+ vec_dstst(var_long_ptr[0], var_int[1], 3);
+ vec_dstst(var_unsigned_long_ptr[0], var_int[1], 0);
+ vec_dstst(var_unsigned_long_ptr[0], var_int[1], 1);
+ vec_dstst(var_unsigned_long_ptr[0], var_int[1], 2);
+ vec_dstst(var_unsigned_long_ptr[0], var_int[1], 3);
+}
+void f35() {
+ vec_dststt(var_long_ptr[0], var_int[1], 0);
+ vec_dststt(var_long_ptr[0], var_int[1], 1);
+ vec_dststt(var_long_ptr[0], var_int[1], 2);
+ vec_dststt(var_long_ptr[0], var_int[1], 3);
+ vec_dststt(var_unsigned_long_ptr[0], var_int[1], 0);
+ vec_dststt(var_unsigned_long_ptr[0], var_int[1], 1);
+ vec_dststt(var_unsigned_long_ptr[0], var_int[1], 2);
+ vec_dststt(var_unsigned_long_ptr[0], var_int[1], 3);
+ vec_dstt(var_long_ptr[0], var_int[1], 0);
+ vec_dstt(var_long_ptr[0], var_int[1], 1);
+ vec_dstt(var_long_ptr[0], var_int[1], 2);
+ vec_dstt(var_long_ptr[0], var_int[1], 3);
+}
+void f36() {
+ vec_dstt(var_unsigned_long_ptr[0], var_int[1], 0);
+ vec_dstt(var_unsigned_long_ptr[0], var_int[1], 1);
+ vec_dstt(var_unsigned_long_ptr[0], var_int[1], 2);
+ vec_dstt(var_unsigned_long_ptr[0], var_int[1], 3);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops-long-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops-long-2.c
new file mode 100644
index 000000000..9cb672106
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops-long-2.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+
+/* Checks from the original ops.c that pass pointers to long or
+ unsigned long to operations that do not support that in released
+ versions of altivec.h. */
+
+#include <altivec.h>
+#include <stdlib.h>
+extern int *var_int;
+extern long * *var_long_ptr;
+extern unsigned long * *var_unsigned_long_ptr;
+extern vector signed int * *var_vec_s32_ptr;
+extern vector signed int *var_vec_s32;
+extern vector unsigned char * *var_vec_u8_ptr;
+extern vector unsigned char *var_vec_u8;
+extern vector unsigned int * *var_vec_u32_ptr;
+extern vector unsigned int *var_vec_u32;
+
+void f36() {
+ vec_st(var_vec_s32[0], var_int[1], var_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_st(var_vec_u32[0], var_int[1], var_unsigned_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+}
+void f37() {
+ vec_ste(var_vec_s32[0], var_int[1], var_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_ste(var_vec_u32[0], var_int[1], var_unsigned_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_stl(var_vec_s32[0], var_int[1], var_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_stl(var_vec_u32[0], var_int[1], var_unsigned_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_stvewx(var_vec_s32[0], var_int[1], var_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_stvewx(var_vec_u32[0], var_int[1], var_unsigned_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_stvx(var_vec_s32[0], var_int[1], var_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_stvx(var_vec_u32[0], var_int[1], var_unsigned_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_stvxl(var_vec_s32[0], var_int[1], var_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+ vec_stvxl(var_vec_u32[0], var_int[1], var_unsigned_long_ptr[2]); /* { dg-error "invalid parameter combination" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops.c
new file mode 100644
index 000000000..b39ad1d65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ops.c
@@ -0,0 +1,3831 @@
+/* { dg-do compile } */
+#include <altivec.h>
+#include <stdlib.h>
+extern char * *var_char_ptr;
+extern float * *var_float_ptr;
+extern int * *var_int_ptr;
+extern int *var_cc24f;
+extern int *var_cc24fd;
+extern int *var_cc24fr;
+extern int *var_cc24t;
+extern int *var_cc24td;
+extern int *var_cc24tr;
+extern int *var_cc26f;
+extern int *var_cc26fd;
+extern int *var_cc26fr;
+extern int *var_cc26t;
+extern int *var_cc26td;
+extern int *var_cc26tr;
+extern int *var_int;
+extern short * *var_short_ptr;
+extern signed char * *var_signed_char_ptr;
+extern unsigned char * *var_unsigned_char_ptr;
+extern unsigned int * *var_unsigned_int_ptr;
+extern unsigned short * *var_unsigned_short_ptr;
+extern vector bool char * *var_vec_b8_ptr;
+extern vector bool char *var_vec_b8;
+extern vector bool int * *var_vec_b32_ptr;
+extern vector bool int *var_vec_b32;
+extern vector bool short * *var_vec_b16_ptr;
+extern vector bool short *var_vec_b16;
+extern vector float * *var_vec_f32_ptr;
+extern vector float *var_vec_f32;
+extern vector pixel * *var_vec_p16_ptr;
+extern vector pixel *var_vec_p16;
+extern vector signed char * *var_vec_s8_ptr;
+extern vector signed char *var_vec_s8;
+extern vector signed int * *var_vec_s32_ptr;
+extern vector signed int *var_vec_s32;
+extern vector signed short * *var_vec_s16_ptr;
+extern vector signed short *var_vec_s16;
+extern vector unsigned char * *var_vec_u8_ptr;
+extern vector unsigned char *var_vec_u8;
+extern vector unsigned int * *var_vec_u32_ptr;
+extern vector unsigned int *var_vec_u32;
+extern vector unsigned short * *var_vec_u16_ptr;
+extern vector unsigned short *var_vec_u16;
+extern vector unsigned short *var_volatile_vec_u16;
+void f0() {
+ *var_cc24f++ = vec_any_le(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc24f++ = vec_any_le(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc24f++ = vec_any_le(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc24f++ = vec_any_le(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc24f++ = vec_any_le(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc24f++ = vec_any_le(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc24f++ = vec_any_le(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc24f++ = vec_any_le(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc24f++ = vec_any_le(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc24f++ = vec_any_le(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc24f++ = vec_any_le(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc24f++ = vec_any_le(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc24f++ = vec_any_le(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc24f++ = vec_any_le(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc24f++ = vec_any_le(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc24f++ = vec_any_le(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc24f++ = vec_any_le(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc24f++ = vec_any_le(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b16[0], var_vec_b16[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b32[0], var_vec_b32[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b8[0], var_vec_b8[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_p16[0], var_vec_p16[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc24f++ = vec_any_ne(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc24f++ = vec_any_nge(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24f++ = vec_any_ngt(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24fd++ = vec_any_nan(var_vec_f32[0]);
+ *var_cc24fr++ = vec_any_ge(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc24fr++ = vec_any_ge(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc24fr++ = vec_any_nle(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24fr++ = vec_any_nlt(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b16[0], var_vec_b16[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b32[0], var_vec_b32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b8[0], var_vec_b8[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_p16[0], var_vec_p16[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc24t++ = vec_all_eq(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc24t++ = vec_all_ge(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_s8[0], var_vec_b8[1]);
+}
+void f1() {
+ *var_cc24t++ = vec_all_gt(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc24t++ = vec_all_gt(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc24td++ = vec_all_numeric(var_vec_f32[0]);
+ *var_cc24tr++ = vec_all_le(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc24tr++ = vec_all_lt(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b16[0], var_vec_b16[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b32[0], var_vec_b32[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b8[0], var_vec_b8[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_p16[0], var_vec_p16[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc26f++ = vec_any_eq(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc26f++ = vec_any_ge(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc26f++ = vec_any_gt(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc26f++ = vec_any_out(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26fd++ = vec_any_numeric(var_vec_f32[0]);
+ *var_cc26fr++ = vec_any_le(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc26fr++ = vec_any_lt(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc26t++ = vec_all_in(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26t++ = vec_all_le(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc26t++ = vec_all_le(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc26t++ = vec_all_le(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc26t++ = vec_all_le(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc26t++ = vec_all_le(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc26t++ = vec_all_le(var_vec_b8[0], var_vec_u8[1]);
+}
+void f2() {
+ *var_cc26t++ = vec_all_le(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc26t++ = vec_all_le(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc26t++ = vec_all_le(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc26t++ = vec_all_le(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc26t++ = vec_all_le(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc26t++ = vec_all_le(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc26t++ = vec_all_le(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc26t++ = vec_all_le(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc26t++ = vec_all_le(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc26t++ = vec_all_le(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc26t++ = vec_all_le(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc26t++ = vec_all_le(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b16[0], var_vec_b16[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b32[0], var_vec_b32[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b8[0], var_vec_b8[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_p16[0], var_vec_p16[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc26t++ = vec_all_ne(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc26t++ = vec_all_nge(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26t++ = vec_all_ngt(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26td++ = vec_all_nan(var_vec_f32[0]);
+ *var_cc26tr++ = vec_all_ge(var_vec_b16[0], var_vec_s16[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_b16[0], var_vec_u16[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_b32[0], var_vec_s32[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_b32[0], var_vec_u32[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_b8[0], var_vec_s8[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_b8[0], var_vec_u8[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_s16[0], var_vec_b16[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_s16[0], var_vec_s16[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_s32[0], var_vec_b32[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_s32[0], var_vec_s32[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_s8[0], var_vec_b8[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_s8[0], var_vec_s8[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_u16[0], var_vec_b16[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_u16[0], var_vec_u16[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_u32[0], var_vec_b32[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_u32[0], var_vec_u32[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_u8[0], var_vec_b8[1]);
+ *var_cc26tr++ = vec_all_ge(var_vec_u8[0], var_vec_u8[1]);
+ *var_cc26tr++ = vec_all_nle(var_vec_f32[0], var_vec_f32[1]);
+ *var_cc26tr++ = vec_all_nlt(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_b16++ = vec_and(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_andc(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_cmpeq(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_b16++ = vec_cmpeq(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_b16++ = vec_cmpgt(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_b16++ = vec_cmpgt(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_b16++ = vec_ld(var_int[0], var_vec_b16_ptr[1]);
+ *var_vec_b16++ = vec_ldl(var_int[0], var_vec_b16_ptr[1]);
+ *var_vec_b16++ = vec_lvx(var_int[0], var_vec_b16_ptr[1]);
+ *var_vec_b16++ = vec_lvxl(var_int[0], var_vec_b16_ptr[1]);
+ *var_vec_b16++ = vec_mergeh(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_mergel(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_nor(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_or(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_pack(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b16++ = vec_perm(var_vec_b16[0], var_vec_b16[1], var_vec_u8[2]);
+ *var_vec_b16++ = vec_sel(var_vec_b16[0], var_vec_b16[1], var_vec_b16[2]);
+ *var_vec_b16++ = vec_sel(var_vec_b16[0], var_vec_b16[1], var_vec_u16[2]);
+ *var_vec_b16++ = vec_sll(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_b16++ = vec_sll(var_vec_b16[0], var_vec_u32[1]);
+ *var_vec_b16++ = vec_sll(var_vec_b16[0], var_vec_u8[1]);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 0);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 1);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 2);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 3);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 4);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 5);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 6);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 7);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 8);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 9);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 10);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 11);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 12);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 13);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 14);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 15);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 16);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 17);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 18);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 19);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 20);
+}
+void f3() {
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 21);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 22);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 23);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 24);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 25);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 26);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 27);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 28);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 29);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 30);
+ *var_vec_b16++ = vec_splat(var_vec_b16[0], 31);
+ *var_vec_b16++ = vec_srl(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_b16++ = vec_srl(var_vec_b16[0], var_vec_u32[1]);
+ *var_vec_b16++ = vec_srl(var_vec_b16[0], var_vec_u8[1]);
+ *var_vec_b16++ = vec_unpackh(var_vec_b8[0]);
+ *var_vec_b16++ = vec_unpackl(var_vec_b8[0]);
+ *var_vec_b16++ = vec_vand(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_vandc(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_vcmpequh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_b16++ = vec_vcmpequh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_b16++ = vec_vcmpgtsh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_b16++ = vec_vcmpgtuh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_b16++ = vec_vmrghh(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_vmrglh(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_vnor(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_vor(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_vperm(var_vec_b16[0], var_vec_b16[1], var_vec_u8[2]);
+ *var_vec_b16++ = vec_vpkuwum(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b16++ = vec_vsel(var_vec_b16[0], var_vec_b16[1], var_vec_b16[2]);
+ *var_vec_b16++ = vec_vsel(var_vec_b16[0], var_vec_b16[1], var_vec_u16[2]);
+ *var_vec_b16++ = vec_vsl(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_b16++ = vec_vsl(var_vec_b16[0], var_vec_u32[1]);
+ *var_vec_b16++ = vec_vsl(var_vec_b16[0], var_vec_u8[1]);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 0);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 1);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 2);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 3);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 4);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 5);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 6);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 7);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 8);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 9);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 10);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 11);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 12);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 13);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 14);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 15);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 16);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 17);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 18);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 19);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 20);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 21);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 22);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 23);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 24);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 25);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 26);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 27);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 28);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 29);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 30);
+ *var_vec_b16++ = vec_vsplth(var_vec_b16[0], 31);
+ *var_vec_b16++ = vec_vsr(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_b16++ = vec_vsr(var_vec_b16[0], var_vec_u32[1]);
+ *var_vec_b16++ = vec_vsr(var_vec_b16[0], var_vec_u8[1]);
+ *var_vec_b16++ = vec_vupkhsb(var_vec_b8[0]);
+ *var_vec_b16++ = vec_vupklsb(var_vec_b8[0]);
+ *var_vec_b16++ = vec_vxor(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b16++ = vec_xor(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b32++ = vec_and(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_andc(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_cmpeq(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_b32++ = vec_cmpeq(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_b32++ = vec_cmpeq(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_b32++ = vec_cmpge(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_b32++ = vec_cmpgt(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_b32++ = vec_cmpgt(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_b32++ = vec_cmpgt(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_b32++ = vec_ld(var_int[0], var_vec_b32_ptr[1]);
+ *var_vec_b32++ = vec_ldl(var_int[0], var_vec_b32_ptr[1]);
+ *var_vec_b32++ = vec_lvx(var_int[0], var_vec_b32_ptr[1]);
+ *var_vec_b32++ = vec_lvxl(var_int[0], var_vec_b32_ptr[1]);
+ *var_vec_b32++ = vec_mergeh(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_mergel(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_nor(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_or(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_perm(var_vec_b32[0], var_vec_b32[1], var_vec_u8[2]);
+ *var_vec_b32++ = vec_sel(var_vec_b32[0], var_vec_b32[1], var_vec_b32[2]);
+ *var_vec_b32++ = vec_sel(var_vec_b32[0], var_vec_b32[1], var_vec_u32[2]);
+ *var_vec_b32++ = vec_sll(var_vec_b32[0], var_vec_u16[1]);
+ *var_vec_b32++ = vec_sll(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_b32++ = vec_sll(var_vec_b32[0], var_vec_u8[1]);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 0);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 1);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 2);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 3);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 4);
+}
+void f4() {
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 5);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 6);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 7);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 8);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 9);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 10);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 11);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 12);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 13);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 14);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 15);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 16);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 17);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 18);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 19);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 20);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 21);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 22);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 23);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 24);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 25);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 26);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 27);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 28);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 29);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 30);
+ *var_vec_b32++ = vec_splat(var_vec_b32[0], 31);
+ *var_vec_b32++ = vec_srl(var_vec_b32[0], var_vec_u16[1]);
+ *var_vec_b32++ = vec_srl(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_b32++ = vec_srl(var_vec_b32[0], var_vec_u8[1]);
+ *var_vec_b32++ = vec_unpackh(var_vec_b16[0]);
+ *var_vec_b32++ = vec_unpackl(var_vec_b16[0]);
+ *var_vec_b32++ = vec_vand(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_vandc(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_vcmpeqfp(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_b32++ = vec_vcmpequw(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_b32++ = vec_vcmpequw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_b32++ = vec_vcmpgefp(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_b32++ = vec_vcmpgtfp(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_b32++ = vec_vcmpgtsw(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_b32++ = vec_vcmpgtuw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_b32++ = vec_vmrghw(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_vmrglw(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_vnor(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_vor(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_vperm(var_vec_b32[0], var_vec_b32[1], var_vec_u8[2]);
+ *var_vec_b32++ = vec_vsel(var_vec_b32[0], var_vec_b32[1], var_vec_b32[2]);
+ *var_vec_b32++ = vec_vsel(var_vec_b32[0], var_vec_b32[1], var_vec_u32[2]);
+ *var_vec_b32++ = vec_vsl(var_vec_b32[0], var_vec_u16[1]);
+ *var_vec_b32++ = vec_vsl(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_b32++ = vec_vsl(var_vec_b32[0], var_vec_u8[1]);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 0);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 1);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 2);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 3);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 4);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 5);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 6);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 7);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 8);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 9);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 10);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 11);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 12);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 13);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 14);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 15);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 16);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 17);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 18);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 19);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 20);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 21);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 22);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 23);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 24);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 25);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 26);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 27);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 28);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 29);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 30);
+ *var_vec_b32++ = vec_vspltw(var_vec_b32[0], 31);
+ *var_vec_b32++ = vec_vsr(var_vec_b32[0], var_vec_u16[1]);
+ *var_vec_b32++ = vec_vsr(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_b32++ = vec_vsr(var_vec_b32[0], var_vec_u8[1]);
+ *var_vec_b32++ = vec_vupkhsh(var_vec_b16[0]);
+ *var_vec_b32++ = vec_vupklsh(var_vec_b16[0]);
+ *var_vec_b32++ = vec_vxor(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b32++ = vec_xor(var_vec_b32[0], var_vec_b32[1]);
+ *var_vec_b8++ = vec_and(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_andc(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_cmpeq(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_b8++ = vec_cmpeq(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_b8++ = vec_cmpgt(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_b8++ = vec_cmpgt(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_b8++ = vec_ld(var_int[0], var_vec_b8_ptr[1]);
+ *var_vec_b8++ = vec_ldl(var_int[0], var_vec_b8_ptr[1]);
+ *var_vec_b8++ = vec_lvx(var_int[0], var_vec_b8_ptr[1]);
+ *var_vec_b8++ = vec_lvxl(var_int[0], var_vec_b8_ptr[1]);
+}
+void f5() {
+ *var_vec_b8++ = vec_mergeh(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_mergel(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_nor(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_or(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_pack(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b8++ = vec_perm(var_vec_b8[0], var_vec_b8[1], var_vec_u8[2]);
+ *var_vec_b8++ = vec_sel(var_vec_b8[0], var_vec_b8[1], var_vec_b8[2]);
+ *var_vec_b8++ = vec_sel(var_vec_b8[0], var_vec_b8[1], var_vec_u8[2]);
+ *var_vec_b8++ = vec_sll(var_vec_b8[0], var_vec_u16[1]);
+ *var_vec_b8++ = vec_sll(var_vec_b8[0], var_vec_u32[1]);
+ *var_vec_b8++ = vec_sll(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 0);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 1);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 2);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 3);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 4);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 5);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 6);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 7);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 8);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 9);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 10);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 11);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 12);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 13);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 14);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 15);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 16);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 17);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 18);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 19);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 20);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 21);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 22);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 23);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 24);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 25);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 26);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 27);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 28);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 29);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 30);
+ *var_vec_b8++ = vec_splat(var_vec_b8[0], 31);
+ *var_vec_b8++ = vec_srl(var_vec_b8[0], var_vec_u16[1]);
+ *var_vec_b8++ = vec_srl(var_vec_b8[0], var_vec_u32[1]);
+ *var_vec_b8++ = vec_srl(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_b8++ = vec_vand(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_vandc(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_vcmpequb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_b8++ = vec_vcmpequb(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_b8++ = vec_vcmpgtsb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_b8++ = vec_vcmpgtub(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_b8++ = vec_vmrghb(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_vmrglb(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_vnor(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_vor(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_vperm(var_vec_b8[0], var_vec_b8[1], var_vec_u8[2]);
+ *var_vec_b8++ = vec_vpkuhum(var_vec_b16[0], var_vec_b16[1]);
+ *var_vec_b8++ = vec_vsel(var_vec_b8[0], var_vec_b8[1], var_vec_b8[2]);
+ *var_vec_b8++ = vec_vsel(var_vec_b8[0], var_vec_b8[1], var_vec_u8[2]);
+ *var_vec_b8++ = vec_vsl(var_vec_b8[0], var_vec_u16[1]);
+ *var_vec_b8++ = vec_vsl(var_vec_b8[0], var_vec_u32[1]);
+ *var_vec_b8++ = vec_vsl(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 0);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 1);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 2);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 3);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 4);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 5);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 6);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 7);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 8);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 9);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 10);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 11);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 12);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 13);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 14);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 15);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 16);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 17);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 18);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 19);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 20);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 21);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 22);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 23);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 24);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 25);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 26);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 27);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 28);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 29);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 30);
+ *var_vec_b8++ = vec_vspltb(var_vec_b8[0], 31);
+ *var_vec_b8++ = vec_vsr(var_vec_b8[0], var_vec_u16[1]);
+ *var_vec_b8++ = vec_vsr(var_vec_b8[0], var_vec_u32[1]);
+ *var_vec_b8++ = vec_vsr(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_b8++ = vec_vxor(var_vec_b8[0], var_vec_b8[1]);
+ *var_vec_b8++ = vec_xor(var_vec_b8[0], var_vec_b8[1]);
+}
+void f6() {
+ *var_vec_f32++ = vec_add(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_and(var_vec_b32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_and(var_vec_f32[0], var_vec_b32[1]);
+ *var_vec_f32++ = vec_and(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_andc(var_vec_b32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_andc(var_vec_f32[0], var_vec_b32[1]);
+ *var_vec_f32++ = vec_andc(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_ceil(var_vec_f32[0]);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 0);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 1);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 2);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 3);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 4);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 5);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 6);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 7);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 8);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 9);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 10);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 11);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 12);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 13);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 14);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 15);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 16);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 17);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 18);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 19);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 20);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 21);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 22);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 23);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 24);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 25);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 26);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 27);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 28);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 29);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 30);
+ *var_vec_f32++ = vec_ctf(var_vec_s32[0], 31);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 0);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 1);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 2);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 3);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 4);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 5);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 6);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 7);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 8);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 9);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 10);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 11);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 12);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 13);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 14);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 15);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 16);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 17);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 18);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 19);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 20);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 21);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 22);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 23);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 24);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 25);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 26);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 27);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 28);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 29);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 30);
+ *var_vec_f32++ = vec_ctf(var_vec_u32[0], 31);
+ *var_vec_f32++ = vec_expte(var_vec_f32[0]);
+ *var_vec_f32++ = vec_floor(var_vec_f32[0]);
+ *var_vec_f32++ = vec_ld(var_int[0], var_float_ptr[1]);
+ *var_vec_f32++ = vec_ld(var_int[0], var_vec_f32_ptr[1]);
+ *var_vec_f32++ = vec_lde(var_int[0], var_float_ptr[1]);
+ *var_vec_f32++ = vec_ldl(var_int[0], var_float_ptr[1]);
+ *var_vec_f32++ = vec_ldl(var_int[0], var_vec_f32_ptr[1]);
+ *var_vec_f32++ = vec_loge(var_vec_f32[0]);
+ *var_vec_f32++ = vec_lvewx(var_int[0], var_float_ptr[1]);
+ *var_vec_f32++ = vec_lvx(var_int[0], var_float_ptr[1]);
+ *var_vec_f32++ = vec_lvx(var_int[0], var_vec_f32_ptr[1]);
+ *var_vec_f32++ = vec_lvxl(var_int[0], var_float_ptr[1]);
+ *var_vec_f32++ = vec_lvxl(var_int[0], var_vec_f32_ptr[1]);
+ *var_vec_f32++ = vec_madd(var_vec_f32[0], var_vec_f32[1], var_vec_f32[2]);
+ *var_vec_f32++ = vec_max(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_mergeh(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_mergel(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_min(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_nmsub(var_vec_f32[0], var_vec_f32[1], var_vec_f32[2]);
+ *var_vec_f32++ = vec_nor(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_or(var_vec_b32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_or(var_vec_f32[0], var_vec_b32[1]);
+ *var_vec_f32++ = vec_or(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_perm(var_vec_f32[0], var_vec_f32[1], var_vec_u8[2]);
+ *var_vec_f32++ = vec_re(var_vec_f32[0]);
+ *var_vec_f32++ = vec_round(var_vec_f32[0]);
+ *var_vec_f32++ = vec_rsqrte(var_vec_f32[0]);
+ *var_vec_f32++ = vec_sel(var_vec_f32[0], var_vec_f32[1], var_vec_b32[2]);
+}
+void f7() {
+ *var_vec_f32++ = vec_sel(var_vec_f32[0], var_vec_f32[1], var_vec_u32[2]);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 0);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 1);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 2);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 3);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 4);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 5);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 6);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 7);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 8);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 9);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 10);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 11);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 12);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 13);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 14);
+ *var_vec_f32++ = vec_sld(var_vec_f32[0], var_vec_f32[1], 15);
+ *var_vec_f32++ = vec_slo(var_vec_f32[0], var_vec_s8[1]);
+ *var_vec_f32++ = vec_slo(var_vec_f32[0], var_vec_u8[1]);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 0);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 1);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 2);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 3);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 4);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 5);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 6);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 7);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 8);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 9);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 10);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 11);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 12);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 13);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 14);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 15);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 16);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 17);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 18);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 19);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 20);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 21);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 22);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 23);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 24);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 25);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 26);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 27);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 28);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 29);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 30);
+ *var_vec_f32++ = vec_splat(var_vec_f32[0], 31);
+ *var_vec_f32++ = vec_sro(var_vec_f32[0], var_vec_s8[1]);
+ *var_vec_f32++ = vec_sro(var_vec_f32[0], var_vec_u8[1]);
+ *var_vec_f32++ = vec_sub(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_trunc(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vaddfp(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vand(var_vec_b32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vand(var_vec_f32[0], var_vec_b32[1]);
+ *var_vec_f32++ = vec_vand(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vandc(var_vec_b32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vandc(var_vec_f32[0], var_vec_b32[1]);
+ *var_vec_f32++ = vec_vandc(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 0);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 1);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 2);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 3);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 4);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 5);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 6);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 7);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 8);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 9);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 10);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 11);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 12);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 13);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 14);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 15);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 16);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 17);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 18);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 19);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 20);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 21);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 22);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 23);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 24);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 25);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 26);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 27);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 28);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 29);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 30);
+ *var_vec_f32++ = vec_vcfsx(var_vec_s32[0], 31);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 0);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 1);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 2);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 3);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 4);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 5);
+}
+void f8() {
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 6);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 7);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 8);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 9);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 10);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 11);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 12);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 13);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 14);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 15);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 16);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 17);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 18);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 19);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 20);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 21);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 22);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 23);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 24);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 25);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 26);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 27);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 28);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 29);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 30);
+ *var_vec_f32++ = vec_vcfux(var_vec_u32[0], 31);
+ *var_vec_f32++ = vec_vexptefp(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vlogefp(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vmaddfp(var_vec_f32[0], var_vec_f32[1], var_vec_f32[2]);
+ *var_vec_f32++ = vec_vmaxfp(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vminfp(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vmrghw(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vmrglw(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vnmsubfp(var_vec_f32[0], var_vec_f32[1], var_vec_f32[2]);
+ *var_vec_f32++ = vec_vnor(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vor(var_vec_b32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vor(var_vec_f32[0], var_vec_b32[1]);
+ *var_vec_f32++ = vec_vor(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vperm(var_vec_f32[0], var_vec_f32[1], var_vec_u8[2]);
+ *var_vec_f32++ = vec_vrefp(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vrfim(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vrfin(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vrfip(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vrfiz(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vrsqrtefp(var_vec_f32[0]);
+ *var_vec_f32++ = vec_vsel(var_vec_f32[0], var_vec_f32[1], var_vec_b32[2]);
+ *var_vec_f32++ = vec_vsel(var_vec_f32[0], var_vec_f32[1], var_vec_u32[2]);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 0);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 1);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 2);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 3);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 4);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 5);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 6);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 7);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 8);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 9);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 10);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 11);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 12);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 13);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 14);
+ *var_vec_f32++ = vec_vsldoi(var_vec_f32[0], var_vec_f32[1], 15);
+ *var_vec_f32++ = vec_vslo(var_vec_f32[0], var_vec_s8[1]);
+ *var_vec_f32++ = vec_vslo(var_vec_f32[0], var_vec_u8[1]);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 0);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 1);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 2);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 3);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 4);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 5);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 6);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 7);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 8);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 9);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 10);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 11);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 12);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 13);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 14);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 15);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 16);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 17);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 18);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 19);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 20);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 21);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 22);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 23);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 24);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 25);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 26);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 27);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 28);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 29);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 30);
+ *var_vec_f32++ = vec_vspltw(var_vec_f32[0], 31);
+ *var_vec_f32++ = vec_vsro(var_vec_f32[0], var_vec_s8[1]);
+ *var_vec_f32++ = vec_vsro(var_vec_f32[0], var_vec_u8[1]);
+ *var_vec_f32++ = vec_vsubfp(var_vec_f32[0], var_vec_f32[1]);
+}
+void f9() {
+ *var_vec_f32++ = vec_vxor(var_vec_b32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_vxor(var_vec_f32[0], var_vec_b32[1]);
+ *var_vec_f32++ = vec_vxor(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_xor(var_vec_b32[0], var_vec_f32[1]);
+ *var_vec_f32++ = vec_xor(var_vec_f32[0], var_vec_b32[1]);
+ *var_vec_f32++ = vec_xor(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_p16++ = vec_ld(var_int[0], var_vec_p16_ptr[1]);
+ *var_vec_p16++ = vec_ldl(var_int[0], var_vec_p16_ptr[1]);
+ *var_vec_p16++ = vec_lvx(var_int[0], var_vec_p16_ptr[1]);
+ *var_vec_p16++ = vec_lvxl(var_int[0], var_vec_p16_ptr[1]);
+ *var_vec_p16++ = vec_mergeh(var_vec_p16[0], var_vec_p16[1]);
+ *var_vec_p16++ = vec_mergel(var_vec_p16[0], var_vec_p16[1]);
+ *var_vec_p16++ = vec_packpx(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_p16++ = vec_perm(var_vec_p16[0], var_vec_p16[1], var_vec_u8[2]);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 0);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 1);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 2);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 3);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 4);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 5);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 6);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 7);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 8);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 9);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 10);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 11);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 12);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 13);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 14);
+ *var_vec_p16++ = vec_sld(var_vec_p16[0], var_vec_p16[1], 15);
+ *var_vec_p16++ = vec_sll(var_vec_p16[0], var_vec_u16[1]);
+ *var_vec_p16++ = vec_sll(var_vec_p16[0], var_vec_u32[1]);
+ *var_vec_p16++ = vec_sll(var_vec_p16[0], var_vec_u8[1]);
+ *var_vec_p16++ = vec_slo(var_vec_p16[0], var_vec_s8[1]);
+ *var_vec_p16++ = vec_slo(var_vec_p16[0], var_vec_u8[1]);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 0);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 1);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 2);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 3);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 4);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 5);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 6);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 7);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 8);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 9);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 10);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 11);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 12);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 13);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 14);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 15);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 16);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 17);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 18);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 19);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 20);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 21);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 22);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 23);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 24);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 25);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 26);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 27);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 28);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 29);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 30);
+ *var_vec_p16++ = vec_splat(var_vec_p16[0], 31);
+ *var_vec_p16++ = vec_srl(var_vec_p16[0], var_vec_u16[1]);
+ *var_vec_p16++ = vec_srl(var_vec_p16[0], var_vec_u32[1]);
+ *var_vec_p16++ = vec_srl(var_vec_p16[0], var_vec_u8[1]);
+ *var_vec_p16++ = vec_sro(var_vec_p16[0], var_vec_s8[1]);
+ *var_vec_p16++ = vec_sro(var_vec_p16[0], var_vec_u8[1]);
+ *var_vec_p16++ = vec_vmrghh(var_vec_p16[0], var_vec_p16[1]);
+ *var_vec_p16++ = vec_vmrglh(var_vec_p16[0], var_vec_p16[1]);
+ *var_vec_p16++ = vec_vperm(var_vec_p16[0], var_vec_p16[1], var_vec_u8[2]);
+ *var_vec_p16++ = vec_vpkpx(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_p16++ = vec_vsl(var_vec_p16[0], var_vec_u16[1]);
+ *var_vec_p16++ = vec_vsl(var_vec_p16[0], var_vec_u32[1]);
+ *var_vec_p16++ = vec_vsl(var_vec_p16[0], var_vec_u8[1]);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 0);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 1);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 2);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 3);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 4);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 5);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 6);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 7);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 8);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 9);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 10);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 11);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 12);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 13);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 14);
+ *var_vec_p16++ = vec_vsldoi(var_vec_p16[0], var_vec_p16[1], 15);
+ *var_vec_p16++ = vec_vslo(var_vec_p16[0], var_vec_s8[1]);
+ *var_vec_p16++ = vec_vslo(var_vec_p16[0], var_vec_u8[1]);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 0);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 1);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 2);
+}
+void f10() {
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 3);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 4);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 5);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 6);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 7);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 8);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 9);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 10);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 11);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 12);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 13);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 14);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 15);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 16);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 17);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 18);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 19);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 20);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 21);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 22);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 23);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 24);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 25);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 26);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 27);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 28);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 29);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 30);
+ *var_vec_p16++ = vec_vsplth(var_vec_p16[0], 31);
+ *var_vec_p16++ = vec_vsr(var_vec_p16[0], var_vec_u16[1]);
+ *var_vec_p16++ = vec_vsr(var_vec_p16[0], var_vec_u32[1]);
+ *var_vec_p16++ = vec_vsr(var_vec_p16[0], var_vec_u8[1]);
+ *var_vec_p16++ = vec_vsro(var_vec_p16[0], var_vec_s8[1]);
+ *var_vec_p16++ = vec_vsro(var_vec_p16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_add(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_add(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_add(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_adds(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_adds(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_adds(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_and(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_and(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_and(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_andc(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_andc(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_andc(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_avg(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_ld(var_int[0], var_short_ptr[1]);
+ *var_vec_s16++ = vec_ld(var_int[0], var_vec_s16_ptr[1]);
+ *var_vec_s16++ = vec_lde(var_int[0], var_short_ptr[1]);
+ *var_vec_s16++ = vec_ldl(var_int[0], var_short_ptr[1]);
+ *var_vec_s16++ = vec_ldl(var_int[0], var_vec_s16_ptr[1]);
+ *var_vec_s16++ = vec_lvehx(var_int[0], var_short_ptr[1]);
+ *var_vec_s16++ = vec_lvx(var_int[0], var_short_ptr[1]);
+ *var_vec_s16++ = vec_lvx(var_int[0], var_vec_s16_ptr[1]);
+ *var_vec_s16++ = vec_lvxl(var_int[0], var_short_ptr[1]);
+ *var_vec_s16++ = vec_lvxl(var_int[0], var_vec_s16_ptr[1]);
+ *var_vec_s16++ = vec_madds(var_vec_s16[0], var_vec_s16[1], var_vec_s16[2]);
+ *var_vec_s16++ = vec_max(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_max(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_max(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_mergeh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_mergel(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_min(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_min(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_min(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_mladd(var_vec_s16[0], var_vec_s16[1], var_vec_s16[2]);
+ *var_vec_s16++ = vec_mladd(var_vec_s16[0], var_vec_u16[1], var_vec_u16[2]);
+ *var_vec_s16++ = vec_mladd(var_vec_u16[0], var_vec_s16[1], var_vec_s16[2]);
+ *var_vec_s16++ = vec_mradds(var_vec_s16[0], var_vec_s16[1], var_vec_s16[2]);
+ *var_vec_s16++ = vec_mule(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s16++ = vec_mulo(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s16++ = vec_nor(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_or(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_or(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_or(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_pack(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s16++ = vec_packs(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s16++ = vec_perm(var_vec_s16[0], var_vec_s16[1], var_vec_u8[2]);
+ *var_vec_s16++ = vec_rl(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_sel(var_vec_s16[0], var_vec_s16[1], var_vec_b16[2]);
+ *var_vec_s16++ = vec_sel(var_vec_s16[0], var_vec_s16[1], var_vec_u16[2]);
+ *var_vec_s16++ = vec_sl(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 0);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 1);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 2);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 3);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 4);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 5);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 6);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 7);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 8);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 9);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 10);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 11);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 12);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 13);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 14);
+ *var_vec_s16++ = vec_sld(var_vec_s16[0], var_vec_s16[1], 15);
+ *var_vec_s16++ = vec_sll(var_vec_s16[0], var_vec_u16[1]);
+}
+void f11() {
+ *var_vec_s16++ = vec_sll(var_vec_s16[0], var_vec_u32[1]);
+ *var_vec_s16++ = vec_sll(var_vec_s16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_slo(var_vec_s16[0], var_vec_s8[1]);
+ *var_vec_s16++ = vec_slo(var_vec_s16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 0);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 1);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 2);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 3);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 4);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 5);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 6);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 7);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 8);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 9);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 10);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 11);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 12);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 13);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 14);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 15);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 16);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 17);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 18);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 19);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 20);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 21);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 22);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 23);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 24);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 25);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 26);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 27);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 28);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 29);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 30);
+ *var_vec_s16++ = vec_splat(var_vec_s16[0], 31);
+ *var_vec_s16++ = vec_splat_s16( 0);
+ *var_vec_s16++ = vec_splat_s16( 1);
+ *var_vec_s16++ = vec_splat_s16( 2);
+ *var_vec_s16++ = vec_splat_s16( 3);
+ *var_vec_s16++ = vec_splat_s16( 4);
+ *var_vec_s16++ = vec_splat_s16( 5);
+ *var_vec_s16++ = vec_splat_s16( 6);
+ *var_vec_s16++ = vec_splat_s16( 7);
+ *var_vec_s16++ = vec_splat_s16( 8);
+ *var_vec_s16++ = vec_splat_s16( 9);
+ *var_vec_s16++ = vec_splat_s16( -1);
+ *var_vec_s16++ = vec_splat_s16( -2);
+ *var_vec_s16++ = vec_splat_s16( -3);
+ *var_vec_s16++ = vec_splat_s16( -4);
+ *var_vec_s16++ = vec_splat_s16( -5);
+ *var_vec_s16++ = vec_splat_s16( -6);
+ *var_vec_s16++ = vec_splat_s16( -7);
+ *var_vec_s16++ = vec_splat_s16( -8);
+ *var_vec_s16++ = vec_splat_s16( -9);
+ *var_vec_s16++ = vec_splat_s16( 10);
+ *var_vec_s16++ = vec_splat_s16( 11);
+ *var_vec_s16++ = vec_splat_s16( 12);
+ *var_vec_s16++ = vec_splat_s16( 13);
+ *var_vec_s16++ = vec_splat_s16( 14);
+ *var_vec_s16++ = vec_splat_s16( 15);
+ *var_vec_s16++ = vec_splat_s16(-10);
+ *var_vec_s16++ = vec_splat_s16(-11);
+ *var_vec_s16++ = vec_splat_s16(-12);
+ *var_vec_s16++ = vec_splat_s16(-13);
+ *var_vec_s16++ = vec_splat_s16(-14);
+ *var_vec_s16++ = vec_splat_s16(-15);
+ *var_vec_s16++ = vec_splat_s16(-16);
+ *var_vec_s16++ = vec_sr(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_sra(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_srl(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_srl(var_vec_s16[0], var_vec_u32[1]);
+ *var_vec_s16++ = vec_srl(var_vec_s16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_sro(var_vec_s16[0], var_vec_s8[1]);
+ *var_vec_s16++ = vec_sro(var_vec_s16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_sub(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_sub(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_sub(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_subs(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_subs(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_subs(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_unpackh(var_vec_s8[0]);
+ *var_vec_s16++ = vec_unpackl(var_vec_s8[0]);
+ *var_vec_s16++ = vec_vaddshs(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vaddshs(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vaddshs(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vadduhm(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vadduhm(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vadduhm(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vand(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vand(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vand(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vandc(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vandc(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vandc(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vavgsh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vmaxsh(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vmaxsh(var_vec_s16[0], var_vec_b16[1]);
+}
+void f12() {
+ *var_vec_s16++ = vec_vmaxsh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vmhaddshs(var_vec_s16[0], var_vec_s16[1], var_vec_s16[2]);
+ *var_vec_s16++ = vec_vmhraddshs(var_vec_s16[0], var_vec_s16[1], var_vec_s16[2]);
+ *var_vec_s16++ = vec_vminsh(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vminsh(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vminsh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vmladduhm(var_vec_s16[0], var_vec_s16[1], var_vec_s16[2]);
+ *var_vec_s16++ = vec_vmladduhm(var_vec_s16[0], var_vec_u16[1], var_vec_u16[2]);
+ *var_vec_s16++ = vec_vmladduhm(var_vec_u16[0], var_vec_s16[1], var_vec_s16[2]);
+ *var_vec_s16++ = vec_vmrghh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vmrglh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vmulesb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s16++ = vec_vmulosb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s16++ = vec_vnor(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vor(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vor(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vor(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vperm(var_vec_s16[0], var_vec_s16[1], var_vec_u8[2]);
+ *var_vec_s16++ = vec_vpkswss(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s16++ = vec_vpkuwum(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s16++ = vec_vrlh(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_vsel(var_vec_s16[0], var_vec_s16[1], var_vec_b16[2]);
+ *var_vec_s16++ = vec_vsel(var_vec_s16[0], var_vec_s16[1], var_vec_u16[2]);
+ *var_vec_s16++ = vec_vsl(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_vsl(var_vec_s16[0], var_vec_u32[1]);
+ *var_vec_s16++ = vec_vsl(var_vec_s16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 0);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 1);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 2);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 3);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 4);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 5);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 6);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 7);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 8);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 9);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 10);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 11);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 12);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 13);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 14);
+ *var_vec_s16++ = vec_vsldoi(var_vec_s16[0], var_vec_s16[1], 15);
+ *var_vec_s16++ = vec_vslh(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_vslo(var_vec_s16[0], var_vec_s8[1]);
+ *var_vec_s16++ = vec_vslo(var_vec_s16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 0);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 1);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 2);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 3);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 4);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 5);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 6);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 7);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 8);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 9);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 10);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 11);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 12);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 13);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 14);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 15);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 16);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 17);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 18);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 19);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 20);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 21);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 22);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 23);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 24);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 25);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 26);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 27);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 28);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 29);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 30);
+ *var_vec_s16++ = vec_vsplth(var_vec_s16[0], 31);
+ *var_vec_s16++ = vec_vspltish( 0);
+ *var_vec_s16++ = vec_vspltish( 1);
+ *var_vec_s16++ = vec_vspltish( 2);
+ *var_vec_s16++ = vec_vspltish( 3);
+ *var_vec_s16++ = vec_vspltish( 4);
+ *var_vec_s16++ = vec_vspltish( 5);
+ *var_vec_s16++ = vec_vspltish( 6);
+ *var_vec_s16++ = vec_vspltish( 7);
+ *var_vec_s16++ = vec_vspltish( 8);
+ *var_vec_s16++ = vec_vspltish( 9);
+ *var_vec_s16++ = vec_vspltish( -1);
+ *var_vec_s16++ = vec_vspltish( -2);
+ *var_vec_s16++ = vec_vspltish( -3);
+ *var_vec_s16++ = vec_vspltish( -4);
+ *var_vec_s16++ = vec_vspltish( -5);
+ *var_vec_s16++ = vec_vspltish( -6);
+ *var_vec_s16++ = vec_vspltish( -7);
+ *var_vec_s16++ = vec_vspltish( -8);
+ *var_vec_s16++ = vec_vspltish( -9);
+ *var_vec_s16++ = vec_vspltish( 10);
+ *var_vec_s16++ = vec_vspltish( 11);
+ *var_vec_s16++ = vec_vspltish( 12);
+ *var_vec_s16++ = vec_vspltish( 13);
+}
+void f13() {
+ *var_vec_s16++ = vec_vspltish( 14);
+ *var_vec_s16++ = vec_vspltish( 15);
+ *var_vec_s16++ = vec_vspltish(-10);
+ *var_vec_s16++ = vec_vspltish(-11);
+ *var_vec_s16++ = vec_vspltish(-12);
+ *var_vec_s16++ = vec_vspltish(-13);
+ *var_vec_s16++ = vec_vspltish(-14);
+ *var_vec_s16++ = vec_vspltish(-15);
+ *var_vec_s16++ = vec_vspltish(-16);
+ *var_vec_s16++ = vec_vsr(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_vsr(var_vec_s16[0], var_vec_u32[1]);
+ *var_vec_s16++ = vec_vsr(var_vec_s16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_vsrah(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_vsrh(var_vec_s16[0], var_vec_u16[1]);
+ *var_vec_s16++ = vec_vsro(var_vec_s16[0], var_vec_s8[1]);
+ *var_vec_s16++ = vec_vsro(var_vec_s16[0], var_vec_u8[1]);
+ *var_vec_s16++ = vec_vsubshs(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vsubshs(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vsubshs(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vsubuhm(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vsubuhm(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vsubuhm(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vupkhsb(var_vec_s8[0]);
+ *var_vec_s16++ = vec_vupklsb(var_vec_s8[0]);
+ *var_vec_s16++ = vec_vxor(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_vxor(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_vxor(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_xor(var_vec_b16[0], var_vec_s16[1]);
+ *var_vec_s16++ = vec_xor(var_vec_s16[0], var_vec_b16[1]);
+ *var_vec_s16++ = vec_xor(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s32++ = vec_add(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_add(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_add(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_adds(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_adds(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_adds(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_and(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_and(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_and(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_andc(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_andc(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_andc(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_avg(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_cmpb(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 0);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 1);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 2);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 3);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 4);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 5);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 6);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 7);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 8);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 9);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 10);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 11);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 12);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 13);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 14);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 15);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 16);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 17);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 18);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 19);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 20);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 21);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 22);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 23);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 24);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 25);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 26);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 27);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 28);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 29);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 30);
+ *var_vec_s32++ = vec_cts(var_vec_f32[0], 31);
+ *var_vec_s32++ = vec_ld(var_int[0], var_int_ptr[1]);
+ *var_vec_s32++ = vec_ld(var_int[0], var_vec_s32_ptr[1]);
+ *var_vec_s32++ = vec_lde(var_int[0], var_int_ptr[1]);
+ *var_vec_s32++ = vec_ldl(var_int[0], var_int_ptr[1]);
+ *var_vec_s32++ = vec_ldl(var_int[0], var_vec_s32_ptr[1]);
+ *var_vec_s32++ = vec_lvewx(var_int[0], var_int_ptr[1]);
+ *var_vec_s32++ = vec_lvx(var_int[0], var_int_ptr[1]);
+ *var_vec_s32++ = vec_lvx(var_int[0], var_vec_s32_ptr[1]);
+ *var_vec_s32++ = vec_lvxl(var_int[0], var_int_ptr[1]);
+ *var_vec_s32++ = vec_lvxl(var_int[0], var_vec_s32_ptr[1]);
+ *var_vec_s32++ = vec_max(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_max(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_max(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_mergeh(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_mergel(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_min(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_min(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_min(var_vec_s32[0], var_vec_s32[1]);
+}
+void f14() {
+ *var_vec_s32++ = vec_msum(var_vec_s16[0], var_vec_s16[1], var_vec_s32[2]);
+ *var_vec_s32++ = vec_msum(var_vec_s8[0], var_vec_u8[1], var_vec_s32[2]);
+ *var_vec_s32++ = vec_msums(var_vec_s16[0], var_vec_s16[1], var_vec_s32[2]);
+ *var_vec_s32++ = vec_mule(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s32++ = vec_mulo(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s32++ = vec_nor(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_or(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_or(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_or(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_perm(var_vec_s32[0], var_vec_s32[1], var_vec_u8[2]);
+ *var_vec_s32++ = vec_rl(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_sel(var_vec_s32[0], var_vec_s32[1], var_vec_b32[2]);
+ *var_vec_s32++ = vec_sel(var_vec_s32[0], var_vec_s32[1], var_vec_u32[2]);
+ *var_vec_s32++ = vec_sl(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 0);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 1);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 2);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 3);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 4);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 5);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 6);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 7);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 8);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 9);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 10);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 11);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 12);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 13);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 14);
+ *var_vec_s32++ = vec_sld(var_vec_s32[0], var_vec_s32[1], 15);
+ *var_vec_s32++ = vec_sll(var_vec_s32[0], var_vec_u16[1]);
+ *var_vec_s32++ = vec_sll(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_sll(var_vec_s32[0], var_vec_u8[1]);
+ *var_vec_s32++ = vec_slo(var_vec_s32[0], var_vec_s8[1]);
+ *var_vec_s32++ = vec_slo(var_vec_s32[0], var_vec_u8[1]);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 0);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 1);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 2);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 3);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 4);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 5);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 6);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 7);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 8);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 9);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 10);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 11);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 12);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 13);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 14);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 15);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 16);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 17);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 18);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 19);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 20);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 21);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 22);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 23);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 24);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 25);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 26);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 27);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 28);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 29);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 30);
+ *var_vec_s32++ = vec_splat(var_vec_s32[0], 31);
+ *var_vec_s32++ = vec_splat_s32( 0);
+ *var_vec_s32++ = vec_splat_s32( 1);
+ *var_vec_s32++ = vec_splat_s32( 2);
+ *var_vec_s32++ = vec_splat_s32( 3);
+ *var_vec_s32++ = vec_splat_s32( 4);
+ *var_vec_s32++ = vec_splat_s32( 5);
+ *var_vec_s32++ = vec_splat_s32( 6);
+ *var_vec_s32++ = vec_splat_s32( 7);
+ *var_vec_s32++ = vec_splat_s32( 8);
+ *var_vec_s32++ = vec_splat_s32( 9);
+ *var_vec_s32++ = vec_splat_s32( -1);
+ *var_vec_s32++ = vec_splat_s32( -2);
+ *var_vec_s32++ = vec_splat_s32( -3);
+ *var_vec_s32++ = vec_splat_s32( -4);
+ *var_vec_s32++ = vec_splat_s32( -5);
+ *var_vec_s32++ = vec_splat_s32( -6);
+ *var_vec_s32++ = vec_splat_s32( -7);
+ *var_vec_s32++ = vec_splat_s32( -8);
+ *var_vec_s32++ = vec_splat_s32( -9);
+ *var_vec_s32++ = vec_splat_s32( 10);
+ *var_vec_s32++ = vec_splat_s32( 11);
+ *var_vec_s32++ = vec_splat_s32( 12);
+ *var_vec_s32++ = vec_splat_s32( 13);
+ *var_vec_s32++ = vec_splat_s32( 14);
+ *var_vec_s32++ = vec_splat_s32( 15);
+ *var_vec_s32++ = vec_splat_s32(-10);
+ *var_vec_s32++ = vec_splat_s32(-11);
+ *var_vec_s32++ = vec_splat_s32(-12);
+ *var_vec_s32++ = vec_splat_s32(-13);
+ *var_vec_s32++ = vec_splat_s32(-14);
+ *var_vec_s32++ = vec_splat_s32(-15);
+ *var_vec_s32++ = vec_splat_s32(-16);
+ *var_vec_s32++ = vec_sr(var_vec_s32[0], var_vec_u32[1]);
+}
+void f15() {
+ *var_vec_s32++ = vec_sra(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_srl(var_vec_s32[0], var_vec_u16[1]);
+ *var_vec_s32++ = vec_srl(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_srl(var_vec_s32[0], var_vec_u8[1]);
+ *var_vec_s32++ = vec_sro(var_vec_s32[0], var_vec_s8[1]);
+ *var_vec_s32++ = vec_sro(var_vec_s32[0], var_vec_u8[1]);
+ *var_vec_s32++ = vec_sub(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_sub(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_sub(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_subs(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_subs(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_subs(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_sum2s(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_sum4s(var_vec_s16[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_sum4s(var_vec_s8[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_sums(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_unpackh(var_vec_s16[0]);
+ *var_vec_s32++ = vec_unpackl(var_vec_s16[0]);
+ *var_vec_s32++ = vec_vaddsws(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vaddsws(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vaddsws(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vadduwm(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vadduwm(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vadduwm(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vand(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vand(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vand(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vandc(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vandc(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vandc(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vavgsw(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vcmpbfp(var_vec_f32[0], var_vec_f32[1]);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 0);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 1);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 2);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 3);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 4);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 5);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 6);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 7);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 8);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 9);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 10);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 11);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 12);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 13);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 14);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 15);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 16);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 17);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 18);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 19);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 20);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 21);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 22);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 23);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 24);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 25);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 26);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 27);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 28);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 29);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 30);
+ *var_vec_s32++ = vec_vctsxs(var_vec_f32[0], 31);
+ *var_vec_s32++ = vec_vmaxsw(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vmaxsw(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vmaxsw(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vminsw(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vminsw(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vminsw(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vmrghw(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vmrglw(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vmsummbm(var_vec_s8[0], var_vec_u8[1], var_vec_s32[2]);
+ *var_vec_s32++ = vec_vmsumshm(var_vec_s16[0], var_vec_s16[1], var_vec_s32[2]);
+ *var_vec_s32++ = vec_vmsumshs(var_vec_s16[0], var_vec_s16[1], var_vec_s32[2]);
+ *var_vec_s32++ = vec_vmulesh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s32++ = vec_vmulosh(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s32++ = vec_vnor(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vor(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vor(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vor(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vperm(var_vec_s32[0], var_vec_s32[1], var_vec_u8[2]);
+ *var_vec_s32++ = vec_vrlw(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_vsel(var_vec_s32[0], var_vec_s32[1], var_vec_b32[2]);
+ *var_vec_s32++ = vec_vsel(var_vec_s32[0], var_vec_s32[1], var_vec_u32[2]);
+ *var_vec_s32++ = vec_vsl(var_vec_s32[0], var_vec_u16[1]);
+ *var_vec_s32++ = vec_vsl(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_vsl(var_vec_s32[0], var_vec_u8[1]);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 0);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 1);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 2);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 3);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 4);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 5);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 6);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 7);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 8);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 9);
+}
+void f16() {
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 10);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 11);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 12);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 13);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 14);
+ *var_vec_s32++ = vec_vsldoi(var_vec_s32[0], var_vec_s32[1], 15);
+ *var_vec_s32++ = vec_vslo(var_vec_s32[0], var_vec_s8[1]);
+ *var_vec_s32++ = vec_vslo(var_vec_s32[0], var_vec_u8[1]);
+ *var_vec_s32++ = vec_vslw(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_vspltisw( 0);
+ *var_vec_s32++ = vec_vspltisw( 1);
+ *var_vec_s32++ = vec_vspltisw( 2);
+ *var_vec_s32++ = vec_vspltisw( 3);
+ *var_vec_s32++ = vec_vspltisw( 4);
+ *var_vec_s32++ = vec_vspltisw( 5);
+ *var_vec_s32++ = vec_vspltisw( 6);
+ *var_vec_s32++ = vec_vspltisw( 7);
+ *var_vec_s32++ = vec_vspltisw( 8);
+ *var_vec_s32++ = vec_vspltisw( 9);
+ *var_vec_s32++ = vec_vspltisw( -1);
+ *var_vec_s32++ = vec_vspltisw( -2);
+ *var_vec_s32++ = vec_vspltisw( -3);
+ *var_vec_s32++ = vec_vspltisw( -4);
+ *var_vec_s32++ = vec_vspltisw( -5);
+ *var_vec_s32++ = vec_vspltisw( -6);
+ *var_vec_s32++ = vec_vspltisw( -7);
+ *var_vec_s32++ = vec_vspltisw( -8);
+ *var_vec_s32++ = vec_vspltisw( -9);
+ *var_vec_s32++ = vec_vspltisw( 10);
+ *var_vec_s32++ = vec_vspltisw( 11);
+ *var_vec_s32++ = vec_vspltisw( 12);
+ *var_vec_s32++ = vec_vspltisw( 13);
+ *var_vec_s32++ = vec_vspltisw( 14);
+ *var_vec_s32++ = vec_vspltisw( 15);
+ *var_vec_s32++ = vec_vspltisw(-10);
+ *var_vec_s32++ = vec_vspltisw(-11);
+ *var_vec_s32++ = vec_vspltisw(-12);
+ *var_vec_s32++ = vec_vspltisw(-13);
+ *var_vec_s32++ = vec_vspltisw(-14);
+ *var_vec_s32++ = vec_vspltisw(-15);
+ *var_vec_s32++ = vec_vspltisw(-16);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 0);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 1);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 2);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 3);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 4);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 5);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 6);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 7);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 8);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 9);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 10);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 11);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 12);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 13);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 14);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 15);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 16);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 17);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 18);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 19);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 20);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 21);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 22);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 23);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 24);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 25);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 26);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 27);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 28);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 29);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 30);
+ *var_vec_s32++ = vec_vspltw(var_vec_s32[0], 31);
+ *var_vec_s32++ = vec_vsr(var_vec_s32[0], var_vec_u16[1]);
+ *var_vec_s32++ = vec_vsr(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_vsr(var_vec_s32[0], var_vec_u8[1]);
+ *var_vec_s32++ = vec_vsraw(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_vsro(var_vec_s32[0], var_vec_s8[1]);
+ *var_vec_s32++ = vec_vsro(var_vec_s32[0], var_vec_u8[1]);
+ *var_vec_s32++ = vec_vsrw(var_vec_s32[0], var_vec_u32[1]);
+ *var_vec_s32++ = vec_vsubsws(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vsubsws(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vsubsws(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vsubuwm(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vsubuwm(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vsubuwm(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vsum2sws(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vsum4sbs(var_vec_s8[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vsum4shs(var_vec_s16[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vsumsws(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vupkhsh(var_vec_s16[0]);
+ *var_vec_s32++ = vec_vupklsh(var_vec_s16[0]);
+ *var_vec_s32++ = vec_vxor(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_vxor(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_vxor(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_xor(var_vec_b32[0], var_vec_s32[1]);
+ *var_vec_s32++ = vec_xor(var_vec_s32[0], var_vec_b32[1]);
+ *var_vec_s32++ = vec_xor(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_s8++ = vec_add(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_add(var_vec_s8[0], var_vec_b8[1]);
+}
+void f17() {
+ *var_vec_s8++ = vec_add(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_adds(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_adds(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_adds(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_and(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_and(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_and(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_andc(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_andc(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_andc(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_avg(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_ld(var_int[0], var_signed_char_ptr[1]);
+ *var_vec_s8++ = vec_ld(var_int[0], var_vec_s8_ptr[1]);
+ *var_vec_s8++ = vec_lde(var_int[0], var_signed_char_ptr[1]);
+ *var_vec_s8++ = vec_ldl(var_int[0], var_signed_char_ptr[1]);
+ *var_vec_s8++ = vec_ldl(var_int[0], var_vec_s8_ptr[1]);
+ *var_vec_s8++ = vec_lvebx(var_int[0], var_signed_char_ptr[1]);
+ *var_vec_s8++ = vec_lvx(var_int[0], var_signed_char_ptr[1]);
+ *var_vec_s8++ = vec_lvx(var_int[0], var_vec_s8_ptr[1]);
+ *var_vec_s8++ = vec_lvxl(var_int[0], var_signed_char_ptr[1]);
+ *var_vec_s8++ = vec_lvxl(var_int[0], var_vec_s8_ptr[1]);
+ *var_vec_s8++ = vec_max(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_max(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_max(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_mergeh(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_mergel(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_min(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_min(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_min(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_nor(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_or(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_or(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_or(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_pack(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s8++ = vec_packs(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s8++ = vec_perm(var_vec_s8[0], var_vec_s8[1], var_vec_u8[2]);
+ *var_vec_s8++ = vec_rl(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_sel(var_vec_s8[0], var_vec_s8[1], var_vec_b8[2]);
+ *var_vec_s8++ = vec_sel(var_vec_s8[0], var_vec_s8[1], var_vec_u8[2]);
+ *var_vec_s8++ = vec_sl(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 0);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 1);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 2);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 3);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 4);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 5);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 6);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 7);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 8);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 9);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 10);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 11);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 12);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 13);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 14);
+ *var_vec_s8++ = vec_sld(var_vec_s8[0], var_vec_s8[1], 15);
+ *var_vec_s8++ = vec_sll(var_vec_s8[0], var_vec_u16[1]);
+ *var_vec_s8++ = vec_sll(var_vec_s8[0], var_vec_u32[1]);
+ *var_vec_s8++ = vec_sll(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_slo(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_slo(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 0);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 1);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 2);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 3);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 4);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 5);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 6);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 7);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 8);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 9);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 10);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 11);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 12);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 13);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 14);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 15);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 16);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 17);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 18);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 19);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 20);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 21);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 22);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 23);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 24);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 25);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 26);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 27);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 28);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 29);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 30);
+ *var_vec_s8++ = vec_splat(var_vec_s8[0], 31);
+ *var_vec_s8++ = vec_splat_s8( 0);
+ *var_vec_s8++ = vec_splat_s8( 1);
+ *var_vec_s8++ = vec_splat_s8( 2);
+ *var_vec_s8++ = vec_splat_s8( 3);
+ *var_vec_s8++ = vec_splat_s8( 4);
+ *var_vec_s8++ = vec_splat_s8( 5);
+ *var_vec_s8++ = vec_splat_s8( 6);
+}
+void f18() {
+ *var_vec_s8++ = vec_splat_s8( 7);
+ *var_vec_s8++ = vec_splat_s8( 8);
+ *var_vec_s8++ = vec_splat_s8( 9);
+ *var_vec_s8++ = vec_splat_s8( -1);
+ *var_vec_s8++ = vec_splat_s8( -2);
+ *var_vec_s8++ = vec_splat_s8( -3);
+ *var_vec_s8++ = vec_splat_s8( -4);
+ *var_vec_s8++ = vec_splat_s8( -5);
+ *var_vec_s8++ = vec_splat_s8( -6);
+ *var_vec_s8++ = vec_splat_s8( -7);
+ *var_vec_s8++ = vec_splat_s8( -8);
+ *var_vec_s8++ = vec_splat_s8( -9);
+ *var_vec_s8++ = vec_splat_s8( 10);
+ *var_vec_s8++ = vec_splat_s8( 11);
+ *var_vec_s8++ = vec_splat_s8( 12);
+ *var_vec_s8++ = vec_splat_s8( 13);
+ *var_vec_s8++ = vec_splat_s8( 14);
+ *var_vec_s8++ = vec_splat_s8( 15);
+ *var_vec_s8++ = vec_splat_s8(-10);
+ *var_vec_s8++ = vec_splat_s8(-11);
+ *var_vec_s8++ = vec_splat_s8(-12);
+ *var_vec_s8++ = vec_splat_s8(-13);
+ *var_vec_s8++ = vec_splat_s8(-14);
+ *var_vec_s8++ = vec_splat_s8(-15);
+ *var_vec_s8++ = vec_splat_s8(-16);
+ *var_vec_s8++ = vec_sr(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_sra(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_srl(var_vec_s8[0], var_vec_u16[1]);
+ *var_vec_s8++ = vec_srl(var_vec_s8[0], var_vec_u32[1]);
+ *var_vec_s8++ = vec_srl(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_sro(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_sro(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_sub(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_sub(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_sub(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_subs(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_subs(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_subs(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vaddsbs(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vaddsbs(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vaddsbs(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vaddubm(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vaddubm(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vaddubm(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vand(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vand(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vand(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vandc(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vandc(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vandc(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vavgsb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vmaxsb(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vmaxsb(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vmaxsb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vminsb(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vminsb(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vminsb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vmrghb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vmrglb(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vnor(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vor(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vor(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vor(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vperm(var_vec_s8[0], var_vec_s8[1], var_vec_u8[2]);
+ *var_vec_s8++ = vec_vpkshss(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s8++ = vec_vpkuhum(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_s8++ = vec_vrlb(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_vsel(var_vec_s8[0], var_vec_s8[1], var_vec_b8[2]);
+ *var_vec_s8++ = vec_vsel(var_vec_s8[0], var_vec_s8[1], var_vec_u8[2]);
+ *var_vec_s8++ = vec_vsl(var_vec_s8[0], var_vec_u16[1]);
+ *var_vec_s8++ = vec_vsl(var_vec_s8[0], var_vec_u32[1]);
+ *var_vec_s8++ = vec_vsl(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_vslb(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 0);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 1);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 2);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 3);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 4);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 5);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 6);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 7);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 8);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 9);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 10);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 11);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 12);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 13);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 14);
+ *var_vec_s8++ = vec_vsldoi(var_vec_s8[0], var_vec_s8[1], 15);
+ *var_vec_s8++ = vec_vslo(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vslo(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 0);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 1);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 2);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 3);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 4);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 5);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 6);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 7);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 8);
+}
+void f19() {
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 9);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 10);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 11);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 12);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 13);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 14);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 15);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 16);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 17);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 18);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 19);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 20);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 21);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 22);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 23);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 24);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 25);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 26);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 27);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 28);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 29);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 30);
+ *var_vec_s8++ = vec_vspltb(var_vec_s8[0], 31);
+ *var_vec_s8++ = vec_vspltisb( 0);
+ *var_vec_s8++ = vec_vspltisb( 1);
+ *var_vec_s8++ = vec_vspltisb( 2);
+ *var_vec_s8++ = vec_vspltisb( 3);
+ *var_vec_s8++ = vec_vspltisb( 4);
+ *var_vec_s8++ = vec_vspltisb( 5);
+ *var_vec_s8++ = vec_vspltisb( 6);
+ *var_vec_s8++ = vec_vspltisb( 7);
+ *var_vec_s8++ = vec_vspltisb( 8);
+ *var_vec_s8++ = vec_vspltisb( 9);
+ *var_vec_s8++ = vec_vspltisb( -1);
+ *var_vec_s8++ = vec_vspltisb( -2);
+ *var_vec_s8++ = vec_vspltisb( -3);
+ *var_vec_s8++ = vec_vspltisb( -4);
+ *var_vec_s8++ = vec_vspltisb( -5);
+ *var_vec_s8++ = vec_vspltisb( -6);
+ *var_vec_s8++ = vec_vspltisb( -7);
+ *var_vec_s8++ = vec_vspltisb( -8);
+ *var_vec_s8++ = vec_vspltisb( -9);
+ *var_vec_s8++ = vec_vspltisb( 10);
+ *var_vec_s8++ = vec_vspltisb( 11);
+ *var_vec_s8++ = vec_vspltisb( 12);
+ *var_vec_s8++ = vec_vspltisb( 13);
+ *var_vec_s8++ = vec_vspltisb( 14);
+ *var_vec_s8++ = vec_vspltisb( 15);
+ *var_vec_s8++ = vec_vspltisb(-10);
+ *var_vec_s8++ = vec_vspltisb(-11);
+ *var_vec_s8++ = vec_vspltisb(-12);
+ *var_vec_s8++ = vec_vspltisb(-13);
+ *var_vec_s8++ = vec_vspltisb(-14);
+ *var_vec_s8++ = vec_vspltisb(-15);
+ *var_vec_s8++ = vec_vspltisb(-16);
+ *var_vec_s8++ = vec_vsr(var_vec_s8[0], var_vec_u16[1]);
+ *var_vec_s8++ = vec_vsr(var_vec_s8[0], var_vec_u32[1]);
+ *var_vec_s8++ = vec_vsr(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_vsrab(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_vsrb(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_vsro(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vsro(var_vec_s8[0], var_vec_u8[1]);
+ *var_vec_s8++ = vec_vsubsbs(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vsubsbs(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vsubsbs(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vsububm(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vsububm(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vsububm(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vxor(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_vxor(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_vxor(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_xor(var_vec_b8[0], var_vec_s8[1]);
+ *var_vec_s8++ = vec_xor(var_vec_s8[0], var_vec_b8[1]);
+ *var_vec_s8++ = vec_xor(var_vec_s8[0], var_vec_s8[1]);
+ *var_vec_u16++ = vec_add(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_add(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_add(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_adds(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_adds(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_adds(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_and(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_and(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_and(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_andc(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_andc(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_andc(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_avg(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_ld(var_int[0], var_unsigned_short_ptr[1]);
+ *var_vec_u16++ = vec_ld(var_int[0], var_vec_u16_ptr[1]);
+ *var_vec_u16++ = vec_lde(var_int[0], var_unsigned_short_ptr[1]);
+ *var_vec_u16++ = vec_ldl(var_int[0], var_unsigned_short_ptr[1]);
+ *var_vec_u16++ = vec_ldl(var_int[0], var_vec_u16_ptr[1]);
+ *var_vec_u16++ = vec_lvehx(var_int[0], var_unsigned_short_ptr[1]);
+ *var_vec_u16++ = vec_lvx(var_int[0], var_unsigned_short_ptr[1]);
+ *var_vec_u16++ = vec_lvx(var_int[0], var_vec_u16_ptr[1]);
+ *var_vec_u16++ = vec_lvxl(var_int[0], var_unsigned_short_ptr[1]);
+ *var_vec_u16++ = vec_lvxl(var_int[0], var_vec_u16_ptr[1]);
+ *var_vec_u16++ = vec_max(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_max(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_max(var_vec_u16[0], var_vec_u16[1]);
+}
+void f20() {
+ *var_vec_u16++ = vec_mergeh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_mergel(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_min(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_min(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_min(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_mladd(var_vec_u16[0], var_vec_u16[1], var_vec_u16[2]);
+ *var_vec_u16++ = vec_mule(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_mulo(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_nor(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_or(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_or(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_or(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_pack(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_packs(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_packsu(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_u16++ = vec_packsu(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_perm(var_vec_u16[0], var_vec_u16[1], var_vec_u8[2]);
+ *var_vec_u16++ = vec_rl(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_sel(var_vec_u16[0], var_vec_u16[1], var_vec_b16[2]);
+ *var_vec_u16++ = vec_sel(var_vec_u16[0], var_vec_u16[1], var_vec_u16[2]);
+ *var_vec_u16++ = vec_sl(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 0);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 1);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 2);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 3);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 4);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 5);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 6);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 7);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 8);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 9);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 10);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 11);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 12);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 13);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 14);
+ *var_vec_u16++ = vec_sld(var_vec_u16[0], var_vec_u16[1], 15);
+ *var_vec_u16++ = vec_sll(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_sll(var_vec_u16[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_sll(var_vec_u16[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_slo(var_vec_u16[0], var_vec_s8[1]);
+ *var_vec_u16++ = vec_slo(var_vec_u16[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 0);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 1);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 2);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 3);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 4);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 5);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 6);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 7);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 8);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 9);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 10);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 11);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 12);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 13);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 14);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 15);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 16);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 17);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 18);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 19);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 20);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 21);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 22);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 23);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 24);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 25);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 26);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 27);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 28);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 29);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 30);
+ *var_vec_u16++ = vec_splat(var_vec_u16[0], 31);
+ *var_vec_u16++ = vec_splat_u16( 0);
+ *var_vec_u16++ = vec_splat_u16( 1);
+ *var_vec_u16++ = vec_splat_u16( 2);
+ *var_vec_u16++ = vec_splat_u16( 3);
+ *var_vec_u16++ = vec_splat_u16( 4);
+ *var_vec_u16++ = vec_splat_u16( 5);
+ *var_vec_u16++ = vec_splat_u16( 6);
+ *var_vec_u16++ = vec_splat_u16( 7);
+ *var_vec_u16++ = vec_splat_u16( 8);
+ *var_vec_u16++ = vec_splat_u16( 9);
+ *var_vec_u16++ = vec_splat_u16( -1);
+ *var_vec_u16++ = vec_splat_u16( -2);
+ *var_vec_u16++ = vec_splat_u16( -3);
+ *var_vec_u16++ = vec_splat_u16( -4);
+ *var_vec_u16++ = vec_splat_u16( -5);
+ *var_vec_u16++ = vec_splat_u16( -6);
+ *var_vec_u16++ = vec_splat_u16( -7);
+ *var_vec_u16++ = vec_splat_u16( -8);
+ *var_vec_u16++ = vec_splat_u16( -9);
+ *var_vec_u16++ = vec_splat_u16( 10);
+ *var_vec_u16++ = vec_splat_u16( 11);
+ *var_vec_u16++ = vec_splat_u16( 12);
+ *var_vec_u16++ = vec_splat_u16( 13);
+ *var_vec_u16++ = vec_splat_u16( 14);
+ *var_vec_u16++ = vec_splat_u16( 15);
+ *var_vec_u16++ = vec_splat_u16(-10);
+}
+void f21() {
+ *var_vec_u16++ = vec_splat_u16(-11);
+ *var_vec_u16++ = vec_splat_u16(-12);
+ *var_vec_u16++ = vec_splat_u16(-13);
+ *var_vec_u16++ = vec_splat_u16(-14);
+ *var_vec_u16++ = vec_splat_u16(-15);
+ *var_vec_u16++ = vec_splat_u16(-16);
+ *var_vec_u16++ = vec_sr(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_sra(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_srl(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_srl(var_vec_u16[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_srl(var_vec_u16[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_sro(var_vec_u16[0], var_vec_s8[1]);
+ *var_vec_u16++ = vec_sro(var_vec_u16[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_sub(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_sub(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_sub(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_subs(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_subs(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_subs(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vadduhm(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vadduhm(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vadduhm(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vadduhs(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vadduhs(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vadduhs(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vand(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vand(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vand(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vandc(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vandc(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vandc(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vavguh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vmaxuh(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vmaxuh(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vmaxuh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vminuh(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vminuh(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vminuh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vmladduhm(var_vec_u16[0], var_vec_u16[1], var_vec_u16[2]);
+ *var_vec_u16++ = vec_vmrghh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vmrglh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vmuleub(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_vmuloub(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_vnor(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vor(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vor(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vor(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vperm(var_vec_u16[0], var_vec_u16[1], var_vec_u8[2]);
+ *var_vec_u16++ = vec_vpkswus(var_vec_s32[0], var_vec_s32[1]);
+ *var_vec_u16++ = vec_vpkuwum(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_vpkuwus(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_vrlh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vsel(var_vec_u16[0], var_vec_u16[1], var_vec_b16[2]);
+ *var_vec_u16++ = vec_vsel(var_vec_u16[0], var_vec_u16[1], var_vec_u16[2]);
+ *var_vec_u16++ = vec_vsl(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vsl(var_vec_u16[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_vsl(var_vec_u16[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 0);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 1);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 2);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 3);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 4);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 5);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 6);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 7);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 8);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 9);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 10);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 11);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 12);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 13);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 14);
+ *var_vec_u16++ = vec_vsldoi(var_vec_u16[0], var_vec_u16[1], 15);
+ *var_vec_u16++ = vec_vslh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vslo(var_vec_u16[0], var_vec_s8[1]);
+ *var_vec_u16++ = vec_vslo(var_vec_u16[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 0);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 1);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 2);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 3);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 4);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 5);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 6);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 7);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 8);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 9);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 10);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 11);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 12);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 13);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 14);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 15);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 16);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 17);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 18);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 19);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 20);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 21);
+}
+void f22() {
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 22);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 23);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 24);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 25);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 26);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 27);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 28);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 29);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 30);
+ *var_vec_u16++ = vec_vsplth(var_vec_u16[0], 31);
+ *var_vec_u16++ = vec_vsr(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vsr(var_vec_u16[0], var_vec_u32[1]);
+ *var_vec_u16++ = vec_vsr(var_vec_u16[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_vsrah(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vsrh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vsro(var_vec_u16[0], var_vec_s8[1]);
+ *var_vec_u16++ = vec_vsro(var_vec_u16[0], var_vec_u8[1]);
+ *var_vec_u16++ = vec_vsubuhm(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vsubuhm(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vsubuhm(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vsubuhs(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vsubuhs(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vsubuhs(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vxor(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_vxor(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_vxor(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_xor(var_vec_b16[0], var_vec_u16[1]);
+ *var_vec_u16++ = vec_xor(var_vec_u16[0], var_vec_b16[1]);
+ *var_vec_u16++ = vec_xor(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_add(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_add(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_add(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_addc(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_adds(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_adds(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_adds(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_and(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_and(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_and(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_andc(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_andc(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_andc(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_avg(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 0);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 1);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 2);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 3);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 4);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 5);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 6);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 7);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 8);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 9);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 10);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 11);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 12);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 13);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 14);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 15);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 16);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 17);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 18);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 19);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 20);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 21);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 22);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 23);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 24);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 25);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 26);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 27);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 28);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 29);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 30);
+ *var_vec_u32++ = vec_ctu(var_vec_f32[0], 31);
+ *var_vec_u32++ = vec_ld(var_int[0], var_unsigned_int_ptr[1]);
+ *var_vec_u32++ = vec_ld(var_int[0], var_vec_u32_ptr[1]);
+ *var_vec_u32++ = vec_lde(var_int[0], var_unsigned_int_ptr[1]);
+ *var_vec_u32++ = vec_ldl(var_int[0], var_unsigned_int_ptr[1]);
+ *var_vec_u32++ = vec_ldl(var_int[0], var_vec_u32_ptr[1]);
+ *var_vec_u32++ = vec_lvewx(var_int[0], var_unsigned_int_ptr[1]);
+ *var_vec_u32++ = vec_lvx(var_int[0], var_unsigned_int_ptr[1]);
+ *var_vec_u32++ = vec_lvx(var_int[0], var_vec_u32_ptr[1]);
+ *var_vec_u32++ = vec_lvxl(var_int[0], var_unsigned_int_ptr[1]);
+ *var_vec_u32++ = vec_lvxl(var_int[0], var_vec_u32_ptr[1]);
+ *var_vec_u32++ = vec_max(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_max(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_max(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_mergeh(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_mergel(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_min(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_min(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_min(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_msum(var_vec_u16[0], var_vec_u16[1], var_vec_u32[2]);
+}
+void f23() {
+ *var_vec_u32++ = vec_msum(var_vec_u8[0], var_vec_u8[1], var_vec_u32[2]);
+ *var_vec_u32++ = vec_msums(var_vec_u16[0], var_vec_u16[1], var_vec_u32[2]);
+ *var_vec_u32++ = vec_mule(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_mulo(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_nor(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_or(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_or(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_or(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_perm(var_vec_u32[0], var_vec_u32[1], var_vec_u8[2]);
+ *var_vec_u32++ = vec_rl(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_sel(var_vec_u32[0], var_vec_u32[1], var_vec_b32[2]);
+ *var_vec_u32++ = vec_sel(var_vec_u32[0], var_vec_u32[1], var_vec_u32[2]);
+ *var_vec_u32++ = vec_sl(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 0);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 1);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 2);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 3);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 4);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 5);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 6);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 7);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 8);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 9);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 10);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 11);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 12);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 13);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 14);
+ *var_vec_u32++ = vec_sld(var_vec_u32[0], var_vec_u32[1], 15);
+ *var_vec_u32++ = vec_sll(var_vec_u32[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_sll(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_sll(var_vec_u32[0], var_vec_u8[1]);
+ *var_vec_u32++ = vec_slo(var_vec_u32[0], var_vec_s8[1]);
+ *var_vec_u32++ = vec_slo(var_vec_u32[0], var_vec_u8[1]);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 0);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 1);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 2);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 3);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 4);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 5);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 6);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 7);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 8);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 9);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 10);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 11);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 12);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 13);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 14);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 15);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 16);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 17);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 18);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 19);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 20);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 21);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 22);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 23);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 24);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 25);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 26);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 27);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 28);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 29);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 30);
+ *var_vec_u32++ = vec_splat(var_vec_u32[0], 31);
+ *var_vec_u32++ = vec_splat_u32( 0);
+ *var_vec_u32++ = vec_splat_u32( 1);
+ *var_vec_u32++ = vec_splat_u32( 2);
+ *var_vec_u32++ = vec_splat_u32( 3);
+ *var_vec_u32++ = vec_splat_u32( 4);
+ *var_vec_u32++ = vec_splat_u32( 5);
+ *var_vec_u32++ = vec_splat_u32( 6);
+ *var_vec_u32++ = vec_splat_u32( 7);
+ *var_vec_u32++ = vec_splat_u32( 8);
+ *var_vec_u32++ = vec_splat_u32( 9);
+ *var_vec_u32++ = vec_splat_u32( -1);
+ *var_vec_u32++ = vec_splat_u32( -2);
+ *var_vec_u32++ = vec_splat_u32( -3);
+ *var_vec_u32++ = vec_splat_u32( -4);
+ *var_vec_u32++ = vec_splat_u32( -5);
+ *var_vec_u32++ = vec_splat_u32( -6);
+ *var_vec_u32++ = vec_splat_u32( -7);
+ *var_vec_u32++ = vec_splat_u32( -8);
+ *var_vec_u32++ = vec_splat_u32( -9);
+ *var_vec_u32++ = vec_splat_u32( 10);
+ *var_vec_u32++ = vec_splat_u32( 11);
+ *var_vec_u32++ = vec_splat_u32( 12);
+ *var_vec_u32++ = vec_splat_u32( 13);
+ *var_vec_u32++ = vec_splat_u32( 14);
+ *var_vec_u32++ = vec_splat_u32( 15);
+ *var_vec_u32++ = vec_splat_u32(-10);
+ *var_vec_u32++ = vec_splat_u32(-11);
+ *var_vec_u32++ = vec_splat_u32(-12);
+ *var_vec_u32++ = vec_splat_u32(-13);
+ *var_vec_u32++ = vec_splat_u32(-14);
+ *var_vec_u32++ = vec_splat_u32(-15);
+ *var_vec_u32++ = vec_splat_u32(-16);
+ *var_vec_u32++ = vec_sr(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_sra(var_vec_u32[0], var_vec_u32[1]);
+}
+void f24() {
+ *var_vec_u32++ = vec_srl(var_vec_u32[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_srl(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_srl(var_vec_u32[0], var_vec_u8[1]);
+ *var_vec_u32++ = vec_sro(var_vec_u32[0], var_vec_s8[1]);
+ *var_vec_u32++ = vec_sro(var_vec_u32[0], var_vec_u8[1]);
+ *var_vec_u32++ = vec_sub(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_sub(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_sub(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_subc(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_subs(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_subs(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_subs(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_sum4s(var_vec_u8[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_unpackh(var_vec_p16[0]);
+ *var_vec_u32++ = vec_unpackl(var_vec_p16[0]);
+ *var_vec_u32++ = vec_vaddcuw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vadduwm(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vadduwm(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vadduwm(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vadduws(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vadduws(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vadduws(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vand(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vand(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vand(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vandc(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vandc(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vandc(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vavguw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 0);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 1);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 2);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 3);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 4);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 5);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 6);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 7);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 8);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 9);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 10);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 11);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 12);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 13);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 14);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 15);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 16);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 17);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 18);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 19);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 20);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 21);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 22);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 23);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 24);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 25);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 26);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 27);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 28);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 29);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 30);
+ *var_vec_u32++ = vec_vctuxs(var_vec_f32[0], 31);
+ *var_vec_u32++ = vec_vmaxuw(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vmaxuw(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vmaxuw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vminuw(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vminuw(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vminuw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vmrghw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vmrglw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vmsumubm(var_vec_u8[0], var_vec_u8[1], var_vec_u32[2]);
+ *var_vec_u32++ = vec_vmsumuhm(var_vec_u16[0], var_vec_u16[1], var_vec_u32[2]);
+ *var_vec_u32++ = vec_vmsumuhs(var_vec_u16[0], var_vec_u16[1], var_vec_u32[2]);
+ *var_vec_u32++ = vec_vmuleuh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_vmulouh(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_vnor(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vor(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vor(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vor(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vperm(var_vec_u32[0], var_vec_u32[1], var_vec_u8[2]);
+ *var_vec_u32++ = vec_vrlw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsel(var_vec_u32[0], var_vec_u32[1], var_vec_b32[2]);
+ *var_vec_u32++ = vec_vsel(var_vec_u32[0], var_vec_u32[1], var_vec_u32[2]);
+ *var_vec_u32++ = vec_vsl(var_vec_u32[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_vsl(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsl(var_vec_u32[0], var_vec_u8[1]);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 0);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 1);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 2);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 3);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 4);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 5);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 6);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 7);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 8);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 9);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 10);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 11);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 12);
+}
+void f25() {
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 13);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 14);
+ *var_vec_u32++ = vec_vsldoi(var_vec_u32[0], var_vec_u32[1], 15);
+ *var_vec_u32++ = vec_vslo(var_vec_u32[0], var_vec_s8[1]);
+ *var_vec_u32++ = vec_vslo(var_vec_u32[0], var_vec_u8[1]);
+ *var_vec_u32++ = vec_vslw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 0);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 1);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 2);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 3);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 4);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 5);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 6);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 7);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 8);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 9);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 10);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 11);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 12);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 13);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 14);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 15);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 16);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 17);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 18);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 19);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 20);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 21);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 22);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 23);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 24);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 25);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 26);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 27);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 28);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 29);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 30);
+ *var_vec_u32++ = vec_vspltw(var_vec_u32[0], 31);
+ *var_vec_u32++ = vec_vsr(var_vec_u32[0], var_vec_u16[1]);
+ *var_vec_u32++ = vec_vsr(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsr(var_vec_u32[0], var_vec_u8[1]);
+ *var_vec_u32++ = vec_vsraw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsro(var_vec_u32[0], var_vec_s8[1]);
+ *var_vec_u32++ = vec_vsro(var_vec_u32[0], var_vec_u8[1]);
+ *var_vec_u32++ = vec_vsrw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsubcuw(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsubuwm(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsubuwm(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vsubuwm(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsubuws(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsubuws(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vsubuws(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vsum4ubs(var_vec_u8[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vupkhpx(var_vec_p16[0]);
+ *var_vec_u32++ = vec_vupklpx(var_vec_p16[0]);
+ *var_vec_u32++ = vec_vxor(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_vxor(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_vxor(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_xor(var_vec_b32[0], var_vec_u32[1]);
+ *var_vec_u32++ = vec_xor(var_vec_u32[0], var_vec_b32[1]);
+ *var_vec_u32++ = vec_xor(var_vec_u32[0], var_vec_u32[1]);
+ *var_vec_u8++ = vec_add(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_add(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_add(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_adds(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_adds(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_adds(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_and(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_and(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_and(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_andc(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_andc(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_andc(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_avg(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_ld(var_int[0], var_unsigned_char_ptr[1]);
+ *var_vec_u8++ = vec_ld(var_int[0], var_vec_u8_ptr[1]);
+ *var_vec_u8++ = vec_lde(var_int[0], var_unsigned_char_ptr[1]);
+ *var_vec_u8++ = vec_ldl(var_int[0], var_unsigned_char_ptr[1]);
+ *var_vec_u8++ = vec_ldl(var_int[0], var_vec_u8_ptr[1]);
+ *var_vec_u8++ = vec_lvebx(var_int[0], var_unsigned_char_ptr[1]);
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_float_ptr[1]);
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_int_ptr[1]);
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_short_ptr[1]);
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_signed_char_ptr[1]);
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_unsigned_char_ptr[1]);
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_unsigned_int_ptr[1]);
+ *var_vec_u8++ = vec_lvsl(var_int[0], var_unsigned_short_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_float_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_int_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_short_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_signed_char_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_unsigned_char_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_unsigned_int_ptr[1]);
+ *var_vec_u8++ = vec_lvsr(var_int[0], var_unsigned_short_ptr[1]);
+ *var_vec_u8++ = vec_lvx(var_int[0], var_unsigned_char_ptr[1]);
+ *var_vec_u8++ = vec_lvx(var_int[0], var_vec_u8_ptr[1]);
+}
+void f26() {
+ *var_vec_u8++ = vec_lvxl(var_int[0], var_unsigned_char_ptr[1]);
+ *var_vec_u8++ = vec_lvxl(var_int[0], var_vec_u8_ptr[1]);
+ *var_vec_u8++ = vec_max(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_max(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_max(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_mergeh(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_mergel(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_min(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_min(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_min(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_nor(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_or(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_or(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_or(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_pack(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_packs(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_packsu(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_u8++ = vec_packsu(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_perm(var_vec_u8[0], var_vec_u8[1], var_vec_u8[2]);
+ *var_vec_u8++ = vec_rl(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_sel(var_vec_u8[0], var_vec_u8[1], var_vec_b8[2]);
+ *var_vec_u8++ = vec_sel(var_vec_u8[0], var_vec_u8[1], var_vec_u8[2]);
+ *var_vec_u8++ = vec_sl(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 0);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 1);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 2);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 3);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 4);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 5);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 6);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 7);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 8);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 9);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 10);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 11);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 12);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 13);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 14);
+ *var_vec_u8++ = vec_sld(var_vec_u8[0], var_vec_u8[1], 15);
+ *var_vec_u8++ = vec_sll(var_vec_u8[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_sll(var_vec_u8[0], var_vec_u32[1]);
+ *var_vec_u8++ = vec_sll(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_slo(var_vec_u8[0], var_vec_s8[1]);
+ *var_vec_u8++ = vec_slo(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 0);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 1);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 2);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 3);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 4);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 5);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 6);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 7);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 8);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 9);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 10);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 11);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 12);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 13);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 14);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 15);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 16);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 17);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 18);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 19);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 20);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 21);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 22);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 23);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 24);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 25);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 26);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 27);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 28);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 29);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 30);
+ *var_vec_u8++ = vec_splat(var_vec_u8[0], 31);
+ *var_vec_u8++ = vec_splat_u8( 0);
+ *var_vec_u8++ = vec_splat_u8( 1);
+ *var_vec_u8++ = vec_splat_u8( 2);
+ *var_vec_u8++ = vec_splat_u8( 3);
+ *var_vec_u8++ = vec_splat_u8( 4);
+ *var_vec_u8++ = vec_splat_u8( 5);
+ *var_vec_u8++ = vec_splat_u8( 6);
+ *var_vec_u8++ = vec_splat_u8( 7);
+ *var_vec_u8++ = vec_splat_u8( 8);
+ *var_vec_u8++ = vec_splat_u8( 9);
+ *var_vec_u8++ = vec_splat_u8( -1);
+ *var_vec_u8++ = vec_splat_u8( -2);
+ *var_vec_u8++ = vec_splat_u8( -3);
+ *var_vec_u8++ = vec_splat_u8( -4);
+ *var_vec_u8++ = vec_splat_u8( -5);
+ *var_vec_u8++ = vec_splat_u8( -6);
+ *var_vec_u8++ = vec_splat_u8( -7);
+ *var_vec_u8++ = vec_splat_u8( -8);
+ *var_vec_u8++ = vec_splat_u8( -9);
+ *var_vec_u8++ = vec_splat_u8( 10);
+ *var_vec_u8++ = vec_splat_u8( 11);
+ *var_vec_u8++ = vec_splat_u8( 12);
+ *var_vec_u8++ = vec_splat_u8( 13);
+ *var_vec_u8++ = vec_splat_u8( 14);
+}
+void f27() {
+ *var_vec_u8++ = vec_splat_u8( 15);
+ *var_vec_u8++ = vec_splat_u8(-10);
+ *var_vec_u8++ = vec_splat_u8(-11);
+ *var_vec_u8++ = vec_splat_u8(-12);
+ *var_vec_u8++ = vec_splat_u8(-13);
+ *var_vec_u8++ = vec_splat_u8(-14);
+ *var_vec_u8++ = vec_splat_u8(-15);
+ *var_vec_u8++ = vec_splat_u8(-16);
+ *var_vec_u8++ = vec_sr(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_sra(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_srl(var_vec_u8[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_srl(var_vec_u8[0], var_vec_u32[1]);
+ *var_vec_u8++ = vec_srl(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_sro(var_vec_u8[0], var_vec_s8[1]);
+ *var_vec_u8++ = vec_sro(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_sub(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_sub(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_sub(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_subs(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_subs(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_subs(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vaddubm(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vaddubm(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vaddubm(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vaddubs(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vaddubs(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vaddubs(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vand(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vand(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vand(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vandc(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vandc(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vandc(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vavgub(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vmaxub(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vmaxub(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vmaxub(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vminub(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vminub(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vminub(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vmrghb(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vmrglb(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vnor(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vor(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vor(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vor(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vperm(var_vec_u8[0], var_vec_u8[1], var_vec_u8[2]);
+ *var_vec_u8++ = vec_vpkshus(var_vec_s16[0], var_vec_s16[1]);
+ *var_vec_u8++ = vec_vpkuhum(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_vpkuhus(var_vec_u16[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_vrlb(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsel(var_vec_u8[0], var_vec_u8[1], var_vec_b8[2]);
+ *var_vec_u8++ = vec_vsel(var_vec_u8[0], var_vec_u8[1], var_vec_u8[2]);
+ *var_vec_u8++ = vec_vsl(var_vec_u8[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_vsl(var_vec_u8[0], var_vec_u32[1]);
+ *var_vec_u8++ = vec_vsl(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vslb(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 0);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 1);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 2);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 3);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 4);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 5);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 6);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 7);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 8);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 9);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 10);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 11);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 12);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 13);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 14);
+ *var_vec_u8++ = vec_vsldoi(var_vec_u8[0], var_vec_u8[1], 15);
+ *var_vec_u8++ = vec_vslo(var_vec_u8[0], var_vec_s8[1]);
+ *var_vec_u8++ = vec_vslo(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 0);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 1);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 2);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 3);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 4);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 5);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 6);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 7);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 8);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 9);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 10);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 11);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 12);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 13);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 14);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 15);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 16);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 17);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 18);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 19);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 20);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 21);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 22);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 23);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 24);
+}
+void f28() {
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 25);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 26);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 27);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 28);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 29);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 30);
+ *var_vec_u8++ = vec_vspltb(var_vec_u8[0], 31);
+ *var_vec_u8++ = vec_vsr(var_vec_u8[0], var_vec_u16[1]);
+ *var_vec_u8++ = vec_vsr(var_vec_u8[0], var_vec_u32[1]);
+ *var_vec_u8++ = vec_vsr(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsrab(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsrb(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsro(var_vec_u8[0], var_vec_s8[1]);
+ *var_vec_u8++ = vec_vsro(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsububm(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsububm(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vsububm(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsububs(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vsububs(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vsububs(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vxor(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_vxor(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_vxor(var_vec_u8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_xor(var_vec_b8[0], var_vec_u8[1]);
+ *var_vec_u8++ = vec_xor(var_vec_u8[0], var_vec_b8[1]);
+ *var_vec_u8++ = vec_xor(var_vec_u8[0], var_vec_u8[1]);
+ *var_volatile_vec_u16++ = vec_mfvscr();
+ if(!vec_all_eq(var_vec_b16[0], var_vec_b16[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_b16[0], var_vec_s16[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_b16[0], var_vec_u16[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_b32[0], var_vec_b32[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_b32[0], var_vec_s32[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_b32[0], var_vec_u32[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_b8[0], var_vec_b8[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_b8[0], var_vec_s8[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_b8[0], var_vec_u8[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_f32[0], var_vec_f32[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_p16[0], var_vec_p16[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_s16[0], var_vec_b16[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_s16[0], var_vec_s16[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_s32[0], var_vec_b32[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_s32[0], var_vec_s32[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_s8[0], var_vec_b8[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_s8[0], var_vec_s8[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_u16[0], var_vec_b16[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_u16[0], var_vec_u16[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_u32[0], var_vec_b32[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_u32[0], var_vec_u32[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_u8[0], var_vec_b8[1])) *var_cc24t++;
+ if(!vec_all_eq(var_vec_u8[0], var_vec_u8[1])) *var_cc24t++;
+ if(!vec_all_ge(var_vec_b16[0], var_vec_s16[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_b16[0], var_vec_u16[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_b32[0], var_vec_s32[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_b32[0], var_vec_u32[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_b8[0], var_vec_s8[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_b8[0], var_vec_u8[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_f32[0], var_vec_f32[1])) *var_cc24t++;
+ if(!vec_all_ge(var_vec_s16[0], var_vec_b16[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_s16[0], var_vec_s16[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_s32[0], var_vec_b32[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_s32[0], var_vec_s32[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_s8[0], var_vec_b8[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_s8[0], var_vec_s8[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_u16[0], var_vec_b16[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_u16[0], var_vec_u16[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_u32[0], var_vec_b32[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_u32[0], var_vec_u32[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_u8[0], var_vec_b8[1])) *var_cc26tr++;
+ if(!vec_all_ge(var_vec_u8[0], var_vec_u8[1])) *var_cc26tr++;
+ if(!vec_all_gt(var_vec_b16[0], var_vec_s16[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_b16[0], var_vec_u16[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_b32[0], var_vec_s32[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_b32[0], var_vec_u32[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_b8[0], var_vec_s8[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_b8[0], var_vec_u8[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_f32[0], var_vec_f32[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_s16[0], var_vec_b16[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_s16[0], var_vec_s16[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_s32[0], var_vec_b32[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_s32[0], var_vec_s32[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_s8[0], var_vec_b8[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_s8[0], var_vec_s8[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_u16[0], var_vec_b16[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_u16[0], var_vec_u16[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_u32[0], var_vec_b32[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_u32[0], var_vec_u32[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_u8[0], var_vec_b8[1])) *var_cc24t++;
+ if(!vec_all_gt(var_vec_u8[0], var_vec_u8[1])) *var_cc24t++;
+ if(!vec_all_in(var_vec_f32[0], var_vec_f32[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_b16[0], var_vec_s16[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_b16[0], var_vec_u16[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_b32[0], var_vec_s32[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_b32[0], var_vec_u32[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_b8[0], var_vec_s8[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_b8[0], var_vec_u8[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_f32[0], var_vec_f32[1])) *var_cc24tr++;
+ if(!vec_all_le(var_vec_s16[0], var_vec_b16[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_s16[0], var_vec_s16[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_s32[0], var_vec_b32[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_s32[0], var_vec_s32[1])) *var_cc26t++;
+}
+void f29() {
+ if(!vec_all_le(var_vec_s8[0], var_vec_b8[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_s8[0], var_vec_s8[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_u16[0], var_vec_b16[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_u16[0], var_vec_u16[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_u32[0], var_vec_b32[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_u32[0], var_vec_u32[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_u8[0], var_vec_b8[1])) *var_cc26t++;
+ if(!vec_all_le(var_vec_u8[0], var_vec_u8[1])) *var_cc26t++;
+ if(!vec_all_lt(var_vec_b16[0], var_vec_s16[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_b16[0], var_vec_u16[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_b32[0], var_vec_s32[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_b32[0], var_vec_u32[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_b8[0], var_vec_s8[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_b8[0], var_vec_u8[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_f32[0], var_vec_f32[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_s16[0], var_vec_b16[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_s16[0], var_vec_s16[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_s32[0], var_vec_b32[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_s32[0], var_vec_s32[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_s8[0], var_vec_b8[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_s8[0], var_vec_s8[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_u16[0], var_vec_b16[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_u16[0], var_vec_u16[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_u32[0], var_vec_b32[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_u32[0], var_vec_u32[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_u8[0], var_vec_b8[1])) *var_cc24tr++;
+ if(!vec_all_lt(var_vec_u8[0], var_vec_u8[1])) *var_cc24tr++;
+ if(!vec_all_nan(var_vec_f32[0])) *var_cc26td++;
+ if(!vec_all_ne(var_vec_b16[0], var_vec_b16[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_b16[0], var_vec_s16[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_b16[0], var_vec_u16[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_b32[0], var_vec_b32[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_b32[0], var_vec_s32[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_b32[0], var_vec_u32[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_b8[0], var_vec_b8[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_b8[0], var_vec_s8[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_b8[0], var_vec_u8[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_f32[0], var_vec_f32[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_p16[0], var_vec_p16[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_s16[0], var_vec_b16[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_s16[0], var_vec_s16[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_s32[0], var_vec_b32[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_s32[0], var_vec_s32[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_s8[0], var_vec_b8[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_s8[0], var_vec_s8[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_u16[0], var_vec_b16[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_u16[0], var_vec_u16[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_u32[0], var_vec_b32[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_u32[0], var_vec_u32[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_u8[0], var_vec_b8[1])) *var_cc26t++;
+ if(!vec_all_ne(var_vec_u8[0], var_vec_u8[1])) *var_cc26t++;
+ if(!vec_all_nge(var_vec_f32[0], var_vec_f32[1])) *var_cc26t++;
+ if(!vec_all_ngt(var_vec_f32[0], var_vec_f32[1])) *var_cc26t++;
+ if(!vec_all_nle(var_vec_f32[0], var_vec_f32[1])) *var_cc26tr++;
+ if(!vec_all_nlt(var_vec_f32[0], var_vec_f32[1])) *var_cc26tr++;
+ if(!vec_all_numeric(var_vec_f32[0])) *var_cc24td++;
+ if(!vec_any_eq(var_vec_b16[0], var_vec_b16[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_b16[0], var_vec_s16[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_b16[0], var_vec_u16[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_b32[0], var_vec_b32[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_b32[0], var_vec_s32[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_b32[0], var_vec_u32[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_b8[0], var_vec_b8[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_b8[0], var_vec_s8[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_b8[0], var_vec_u8[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_f32[0], var_vec_f32[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_p16[0], var_vec_p16[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_s16[0], var_vec_b16[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_s16[0], var_vec_s16[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_s32[0], var_vec_b32[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_s32[0], var_vec_s32[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_s8[0], var_vec_b8[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_s8[0], var_vec_s8[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_u16[0], var_vec_b16[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_u16[0], var_vec_u16[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_u32[0], var_vec_b32[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_u32[0], var_vec_u32[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_u8[0], var_vec_b8[1])) *var_cc26f++;
+ if(!vec_any_eq(var_vec_u8[0], var_vec_u8[1])) *var_cc26f++;
+ if(!vec_any_ge(var_vec_b16[0], var_vec_s16[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_b16[0], var_vec_u16[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_b32[0], var_vec_s32[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_b32[0], var_vec_u32[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_b8[0], var_vec_s8[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_b8[0], var_vec_u8[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_f32[0], var_vec_f32[1])) *var_cc26f++;
+ if(!vec_any_ge(var_vec_s16[0], var_vec_b16[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_s16[0], var_vec_s16[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_s32[0], var_vec_b32[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_s32[0], var_vec_s32[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_s8[0], var_vec_b8[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_s8[0], var_vec_s8[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_u16[0], var_vec_b16[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_u16[0], var_vec_u16[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_u32[0], var_vec_b32[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_u32[0], var_vec_u32[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_u8[0], var_vec_b8[1])) *var_cc24fr++;
+ if(!vec_any_ge(var_vec_u8[0], var_vec_u8[1])) *var_cc24fr++;
+ if(!vec_any_gt(var_vec_b16[0], var_vec_s16[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_b16[0], var_vec_u16[1])) *var_cc26f++;
+}
+void f30() {
+ if(!vec_any_gt(var_vec_b32[0], var_vec_s32[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_b32[0], var_vec_u32[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_b8[0], var_vec_s8[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_b8[0], var_vec_u8[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_f32[0], var_vec_f32[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_s16[0], var_vec_b16[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_s16[0], var_vec_s16[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_s32[0], var_vec_b32[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_s32[0], var_vec_s32[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_s8[0], var_vec_b8[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_s8[0], var_vec_s8[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_u16[0], var_vec_b16[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_u16[0], var_vec_u16[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_u32[0], var_vec_b32[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_u32[0], var_vec_u32[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_u8[0], var_vec_b8[1])) *var_cc26f++;
+ if(!vec_any_gt(var_vec_u8[0], var_vec_u8[1])) *var_cc26f++;
+ if(!vec_any_le(var_vec_b16[0], var_vec_s16[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_b16[0], var_vec_u16[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_b32[0], var_vec_s32[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_b32[0], var_vec_u32[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_b8[0], var_vec_s8[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_b8[0], var_vec_u8[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_f32[0], var_vec_f32[1])) *var_cc26fr++;
+ if(!vec_any_le(var_vec_s16[0], var_vec_b16[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_s16[0], var_vec_s16[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_s32[0], var_vec_b32[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_s32[0], var_vec_s32[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_s8[0], var_vec_b8[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_s8[0], var_vec_s8[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_u16[0], var_vec_b16[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_u16[0], var_vec_u16[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_u32[0], var_vec_b32[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_u32[0], var_vec_u32[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_u8[0], var_vec_b8[1])) *var_cc24f++;
+ if(!vec_any_le(var_vec_u8[0], var_vec_u8[1])) *var_cc24f++;
+ if(!vec_any_lt(var_vec_b16[0], var_vec_s16[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_b16[0], var_vec_u16[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_b32[0], var_vec_s32[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_b32[0], var_vec_u32[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_b8[0], var_vec_s8[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_b8[0], var_vec_u8[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_f32[0], var_vec_f32[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_s16[0], var_vec_b16[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_s16[0], var_vec_s16[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_s32[0], var_vec_b32[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_s32[0], var_vec_s32[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_s8[0], var_vec_b8[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_s8[0], var_vec_s8[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_u16[0], var_vec_b16[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_u16[0], var_vec_u16[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_u32[0], var_vec_b32[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_u32[0], var_vec_u32[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_u8[0], var_vec_b8[1])) *var_cc26fr++;
+ if(!vec_any_lt(var_vec_u8[0], var_vec_u8[1])) *var_cc26fr++;
+ if(!vec_any_nan(var_vec_f32[0])) *var_cc24fd++;
+ if(!vec_any_ne(var_vec_b16[0], var_vec_b16[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_b16[0], var_vec_s16[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_b16[0], var_vec_u16[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_b32[0], var_vec_b32[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_b32[0], var_vec_s32[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_b32[0], var_vec_u32[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_b8[0], var_vec_b8[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_b8[0], var_vec_s8[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_b8[0], var_vec_u8[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_f32[0], var_vec_f32[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_p16[0], var_vec_p16[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_s16[0], var_vec_b16[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_s16[0], var_vec_s16[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_s32[0], var_vec_b32[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_s32[0], var_vec_s32[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_s8[0], var_vec_b8[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_s8[0], var_vec_s8[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_u16[0], var_vec_b16[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_u16[0], var_vec_u16[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_u32[0], var_vec_b32[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_u32[0], var_vec_u32[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_u8[0], var_vec_b8[1])) *var_cc24f++;
+ if(!vec_any_ne(var_vec_u8[0], var_vec_u8[1])) *var_cc24f++;
+ if(!vec_any_nge(var_vec_f32[0], var_vec_f32[1])) *var_cc24f++;
+ if(!vec_any_ngt(var_vec_f32[0], var_vec_f32[1])) *var_cc24f++;
+ if(!vec_any_nle(var_vec_f32[0], var_vec_f32[1])) *var_cc24fr++;
+ if(!vec_any_nlt(var_vec_f32[0], var_vec_f32[1])) *var_cc24fr++;
+ if(!vec_any_numeric(var_vec_f32[0])) *var_cc26fd++;
+ if(!vec_any_out(var_vec_f32[0], var_vec_f32[1])) *var_cc26f++;
+ if(vec_all_eq(var_vec_b16[0], var_vec_b16[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_b16[0], var_vec_s16[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_b16[0], var_vec_u16[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_b32[0], var_vec_b32[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_b32[0], var_vec_s32[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_b32[0], var_vec_u32[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_b8[0], var_vec_b8[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_b8[0], var_vec_s8[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_b8[0], var_vec_u8[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_f32[0], var_vec_f32[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_p16[0], var_vec_p16[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_s16[0], var_vec_b16[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_s16[0], var_vec_s16[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_s32[0], var_vec_b32[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_s32[0], var_vec_s32[1])) *var_cc24t++;
+}
+void f31() {
+ if(vec_all_eq(var_vec_s8[0], var_vec_b8[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_s8[0], var_vec_s8[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_u16[0], var_vec_b16[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_u16[0], var_vec_u16[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_u32[0], var_vec_b32[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_u32[0], var_vec_u32[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_u8[0], var_vec_b8[1])) *var_cc24t++;
+ if(vec_all_eq(var_vec_u8[0], var_vec_u8[1])) *var_cc24t++;
+ if(vec_all_ge(var_vec_b16[0], var_vec_s16[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_b16[0], var_vec_u16[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_b32[0], var_vec_s32[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_b32[0], var_vec_u32[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_b8[0], var_vec_s8[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_b8[0], var_vec_u8[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_f32[0], var_vec_f32[1])) *var_cc24t++;
+ if(vec_all_ge(var_vec_s16[0], var_vec_b16[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_s16[0], var_vec_s16[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_s32[0], var_vec_b32[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_s32[0], var_vec_s32[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_s8[0], var_vec_b8[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_s8[0], var_vec_s8[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_u16[0], var_vec_b16[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_u16[0], var_vec_u16[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_u32[0], var_vec_b32[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_u32[0], var_vec_u32[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_u8[0], var_vec_b8[1])) *var_cc26tr++;
+ if(vec_all_ge(var_vec_u8[0], var_vec_u8[1])) *var_cc26tr++;
+ if(vec_all_gt(var_vec_b16[0], var_vec_s16[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_b16[0], var_vec_u16[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_b32[0], var_vec_s32[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_b32[0], var_vec_u32[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_b8[0], var_vec_s8[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_b8[0], var_vec_u8[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_f32[0], var_vec_f32[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_s16[0], var_vec_b16[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_s16[0], var_vec_s16[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_s32[0], var_vec_b32[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_s32[0], var_vec_s32[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_s8[0], var_vec_b8[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_s8[0], var_vec_s8[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_u16[0], var_vec_b16[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_u16[0], var_vec_u16[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_u32[0], var_vec_b32[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_u32[0], var_vec_u32[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_u8[0], var_vec_b8[1])) *var_cc24t++;
+ if(vec_all_gt(var_vec_u8[0], var_vec_u8[1])) *var_cc24t++;
+ if(vec_all_in(var_vec_f32[0], var_vec_f32[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_b16[0], var_vec_s16[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_b16[0], var_vec_u16[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_b32[0], var_vec_s32[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_b32[0], var_vec_u32[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_b8[0], var_vec_s8[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_b8[0], var_vec_u8[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_f32[0], var_vec_f32[1])) *var_cc24tr++;
+ if(vec_all_le(var_vec_s16[0], var_vec_b16[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_s16[0], var_vec_s16[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_s32[0], var_vec_b32[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_s32[0], var_vec_s32[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_s8[0], var_vec_b8[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_s8[0], var_vec_s8[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_u16[0], var_vec_b16[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_u16[0], var_vec_u16[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_u32[0], var_vec_b32[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_u32[0], var_vec_u32[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_u8[0], var_vec_b8[1])) *var_cc26t++;
+ if(vec_all_le(var_vec_u8[0], var_vec_u8[1])) *var_cc26t++;
+ if(vec_all_lt(var_vec_b16[0], var_vec_s16[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_b16[0], var_vec_u16[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_b32[0], var_vec_s32[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_b32[0], var_vec_u32[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_b8[0], var_vec_s8[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_b8[0], var_vec_u8[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_f32[0], var_vec_f32[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_s16[0], var_vec_b16[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_s16[0], var_vec_s16[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_s32[0], var_vec_b32[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_s32[0], var_vec_s32[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_s8[0], var_vec_b8[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_s8[0], var_vec_s8[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_u16[0], var_vec_b16[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_u16[0], var_vec_u16[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_u32[0], var_vec_b32[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_u32[0], var_vec_u32[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_u8[0], var_vec_b8[1])) *var_cc24tr++;
+ if(vec_all_lt(var_vec_u8[0], var_vec_u8[1])) *var_cc24tr++;
+ if(vec_all_nan(var_vec_f32[0])) *var_cc26td++;
+ if(vec_all_ne(var_vec_b16[0], var_vec_b16[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_b16[0], var_vec_s16[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_b16[0], var_vec_u16[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_b32[0], var_vec_b32[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_b32[0], var_vec_s32[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_b32[0], var_vec_u32[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_b8[0], var_vec_b8[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_b8[0], var_vec_s8[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_b8[0], var_vec_u8[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_f32[0], var_vec_f32[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_p16[0], var_vec_p16[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_s16[0], var_vec_b16[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_s16[0], var_vec_s16[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_s32[0], var_vec_b32[1])) *var_cc26t++;
+}
+void f32() {
+ if(vec_all_ne(var_vec_s32[0], var_vec_s32[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_s8[0], var_vec_b8[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_s8[0], var_vec_s8[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_u16[0], var_vec_b16[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_u16[0], var_vec_u16[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_u32[0], var_vec_b32[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_u32[0], var_vec_u32[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_u8[0], var_vec_b8[1])) *var_cc26t++;
+ if(vec_all_ne(var_vec_u8[0], var_vec_u8[1])) *var_cc26t++;
+ if(vec_all_nge(var_vec_f32[0], var_vec_f32[1])) *var_cc26t++;
+ if(vec_all_ngt(var_vec_f32[0], var_vec_f32[1])) *var_cc26t++;
+ if(vec_all_nle(var_vec_f32[0], var_vec_f32[1])) *var_cc26tr++;
+ if(vec_all_nlt(var_vec_f32[0], var_vec_f32[1])) *var_cc26tr++;
+ if(vec_all_numeric(var_vec_f32[0])) *var_cc24td++;
+ if(vec_any_eq(var_vec_b16[0], var_vec_b16[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_b16[0], var_vec_s16[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_b16[0], var_vec_u16[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_b32[0], var_vec_b32[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_b32[0], var_vec_s32[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_b32[0], var_vec_u32[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_b8[0], var_vec_b8[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_b8[0], var_vec_s8[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_b8[0], var_vec_u8[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_f32[0], var_vec_f32[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_p16[0], var_vec_p16[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_s16[0], var_vec_b16[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_s16[0], var_vec_s16[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_s32[0], var_vec_b32[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_s32[0], var_vec_s32[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_s8[0], var_vec_b8[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_s8[0], var_vec_s8[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_u16[0], var_vec_b16[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_u16[0], var_vec_u16[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_u32[0], var_vec_b32[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_u32[0], var_vec_u32[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_u8[0], var_vec_b8[1])) *var_cc26f++;
+ if(vec_any_eq(var_vec_u8[0], var_vec_u8[1])) *var_cc26f++;
+ if(vec_any_ge(var_vec_b16[0], var_vec_s16[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_b16[0], var_vec_u16[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_b32[0], var_vec_s32[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_b32[0], var_vec_u32[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_b8[0], var_vec_s8[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_b8[0], var_vec_u8[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_f32[0], var_vec_f32[1])) *var_cc26f++;
+ if(vec_any_ge(var_vec_s16[0], var_vec_b16[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_s16[0], var_vec_s16[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_s32[0], var_vec_b32[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_s32[0], var_vec_s32[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_s8[0], var_vec_b8[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_s8[0], var_vec_s8[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_u16[0], var_vec_b16[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_u16[0], var_vec_u16[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_u32[0], var_vec_b32[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_u32[0], var_vec_u32[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_u8[0], var_vec_b8[1])) *var_cc24fr++;
+ if(vec_any_ge(var_vec_u8[0], var_vec_u8[1])) *var_cc24fr++;
+ if(vec_any_gt(var_vec_b16[0], var_vec_s16[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_b16[0], var_vec_u16[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_b32[0], var_vec_s32[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_b32[0], var_vec_u32[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_b8[0], var_vec_s8[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_b8[0], var_vec_u8[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_f32[0], var_vec_f32[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_s16[0], var_vec_b16[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_s16[0], var_vec_s16[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_s32[0], var_vec_b32[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_s32[0], var_vec_s32[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_s8[0], var_vec_b8[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_s8[0], var_vec_s8[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_u16[0], var_vec_b16[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_u16[0], var_vec_u16[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_u32[0], var_vec_b32[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_u32[0], var_vec_u32[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_u8[0], var_vec_b8[1])) *var_cc26f++;
+ if(vec_any_gt(var_vec_u8[0], var_vec_u8[1])) *var_cc26f++;
+ if(vec_any_le(var_vec_b16[0], var_vec_s16[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_b16[0], var_vec_u16[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_b32[0], var_vec_s32[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_b32[0], var_vec_u32[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_b8[0], var_vec_s8[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_b8[0], var_vec_u8[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_f32[0], var_vec_f32[1])) *var_cc26fr++;
+ if(vec_any_le(var_vec_s16[0], var_vec_b16[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_s16[0], var_vec_s16[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_s32[0], var_vec_b32[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_s32[0], var_vec_s32[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_s8[0], var_vec_b8[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_s8[0], var_vec_s8[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_u16[0], var_vec_b16[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_u16[0], var_vec_u16[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_u32[0], var_vec_b32[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_u32[0], var_vec_u32[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_u8[0], var_vec_b8[1])) *var_cc24f++;
+ if(vec_any_le(var_vec_u8[0], var_vec_u8[1])) *var_cc24f++;
+ if(vec_any_lt(var_vec_b16[0], var_vec_s16[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_b16[0], var_vec_u16[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_b32[0], var_vec_s32[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_b32[0], var_vec_u32[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_b8[0], var_vec_s8[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_b8[0], var_vec_u8[1])) *var_cc26fr++;
+}
+void f33() {
+ if(vec_any_lt(var_vec_f32[0], var_vec_f32[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_s16[0], var_vec_b16[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_s16[0], var_vec_s16[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_s32[0], var_vec_b32[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_s32[0], var_vec_s32[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_s8[0], var_vec_b8[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_s8[0], var_vec_s8[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_u16[0], var_vec_b16[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_u16[0], var_vec_u16[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_u32[0], var_vec_b32[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_u32[0], var_vec_u32[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_u8[0], var_vec_b8[1])) *var_cc26fr++;
+ if(vec_any_lt(var_vec_u8[0], var_vec_u8[1])) *var_cc26fr++;
+ if(vec_any_nan(var_vec_f32[0])) *var_cc24fd++;
+ if(vec_any_ne(var_vec_b16[0], var_vec_b16[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_b16[0], var_vec_s16[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_b16[0], var_vec_u16[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_b32[0], var_vec_b32[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_b32[0], var_vec_s32[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_b32[0], var_vec_u32[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_b8[0], var_vec_b8[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_b8[0], var_vec_s8[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_b8[0], var_vec_u8[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_f32[0], var_vec_f32[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_p16[0], var_vec_p16[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_s16[0], var_vec_b16[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_s16[0], var_vec_s16[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_s32[0], var_vec_b32[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_s32[0], var_vec_s32[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_s8[0], var_vec_b8[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_s8[0], var_vec_s8[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_u16[0], var_vec_b16[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_u16[0], var_vec_u16[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_u32[0], var_vec_b32[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_u32[0], var_vec_u32[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_u8[0], var_vec_b8[1])) *var_cc24f++;
+ if(vec_any_ne(var_vec_u8[0], var_vec_u8[1])) *var_cc24f++;
+ if(vec_any_nge(var_vec_f32[0], var_vec_f32[1])) *var_cc24f++;
+ if(vec_any_ngt(var_vec_f32[0], var_vec_f32[1])) *var_cc24f++;
+ if(vec_any_nle(var_vec_f32[0], var_vec_f32[1])) *var_cc24fr++;
+ if(vec_any_nlt(var_vec_f32[0], var_vec_f32[1])) *var_cc24fr++;
+ if(vec_any_numeric(var_vec_f32[0])) *var_cc26fd++;
+ if(vec_any_out(var_vec_f32[0], var_vec_f32[1])) *var_cc26f++;
+ vec_dss( 0);
+ vec_dss( 1);
+ vec_dss( 2);
+ vec_dss( 3);
+ vec_dssall();
+ vec_dst(var_float_ptr[0], var_int[1], 0);
+ vec_dst(var_float_ptr[0], var_int[1], 1);
+ vec_dst(var_float_ptr[0], var_int[1], 2);
+ vec_dst(var_float_ptr[0], var_int[1], 3);
+ vec_dst(var_int_ptr[0], var_int[1], 0);
+ vec_dst(var_int_ptr[0], var_int[1], 1);
+ vec_dst(var_int_ptr[0], var_int[1], 2);
+ vec_dst(var_int_ptr[0], var_int[1], 3);
+ vec_dst(var_short_ptr[0], var_int[1], 0);
+ vec_dst(var_short_ptr[0], var_int[1], 1);
+ vec_dst(var_short_ptr[0], var_int[1], 2);
+ vec_dst(var_short_ptr[0], var_int[1], 3);
+ vec_dst(var_signed_char_ptr[0], var_int[1], 0);
+ vec_dst(var_signed_char_ptr[0], var_int[1], 1);
+ vec_dst(var_signed_char_ptr[0], var_int[1], 2);
+ vec_dst(var_signed_char_ptr[0], var_int[1], 3);
+ vec_dst(var_unsigned_char_ptr[0], var_int[1], 0);
+ vec_dst(var_unsigned_char_ptr[0], var_int[1], 1);
+ vec_dst(var_unsigned_char_ptr[0], var_int[1], 2);
+ vec_dst(var_unsigned_char_ptr[0], var_int[1], 3);
+ vec_dst(var_unsigned_int_ptr[0], var_int[1], 0);
+ vec_dst(var_unsigned_int_ptr[0], var_int[1], 1);
+ vec_dst(var_unsigned_int_ptr[0], var_int[1], 2);
+ vec_dst(var_unsigned_int_ptr[0], var_int[1], 3);
+ vec_dst(var_unsigned_short_ptr[0], var_int[1], 0);
+ vec_dst(var_unsigned_short_ptr[0], var_int[1], 1);
+ vec_dst(var_unsigned_short_ptr[0], var_int[1], 2);
+ vec_dst(var_unsigned_short_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_b16_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_b16_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_b16_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_b16_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_b32_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_b32_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_b32_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_b32_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_b8_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_b8_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_b8_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_b8_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_f32_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_f32_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_f32_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_f32_ptr[0], var_int[1], 3);
+}
+void f34() {
+ vec_dst(var_vec_p16_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_p16_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_p16_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_p16_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_s16_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_s16_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_s16_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_s16_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_s32_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_s32_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_s32_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_s32_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_s8_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_s8_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_s8_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_s8_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_u16_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_u16_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_u16_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_u16_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_u32_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_u32_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_u32_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_u32_ptr[0], var_int[1], 3);
+ vec_dst(var_vec_u8_ptr[0], var_int[1], 0);
+ vec_dst(var_vec_u8_ptr[0], var_int[1], 1);
+ vec_dst(var_vec_u8_ptr[0], var_int[1], 2);
+ vec_dst(var_vec_u8_ptr[0], var_int[1], 3);
+ vec_dstst(var_float_ptr[0], var_int[1], 0);
+ vec_dstst(var_float_ptr[0], var_int[1], 1);
+ vec_dstst(var_float_ptr[0], var_int[1], 2);
+ vec_dstst(var_float_ptr[0], var_int[1], 3);
+ vec_dstst(var_int_ptr[0], var_int[1], 0);
+ vec_dstst(var_int_ptr[0], var_int[1], 1);
+ vec_dstst(var_int_ptr[0], var_int[1], 2);
+ vec_dstst(var_int_ptr[0], var_int[1], 3);
+ vec_dstst(var_short_ptr[0], var_int[1], 0);
+ vec_dstst(var_short_ptr[0], var_int[1], 1);
+ vec_dstst(var_short_ptr[0], var_int[1], 2);
+ vec_dstst(var_short_ptr[0], var_int[1], 3);
+ vec_dstst(var_signed_char_ptr[0], var_int[1], 0);
+ vec_dstst(var_signed_char_ptr[0], var_int[1], 1);
+ vec_dstst(var_signed_char_ptr[0], var_int[1], 2);
+ vec_dstst(var_signed_char_ptr[0], var_int[1], 3);
+ vec_dstst(var_unsigned_char_ptr[0], var_int[1], 0);
+ vec_dstst(var_unsigned_char_ptr[0], var_int[1], 1);
+ vec_dstst(var_unsigned_char_ptr[0], var_int[1], 2);
+ vec_dstst(var_unsigned_char_ptr[0], var_int[1], 3);
+ vec_dstst(var_unsigned_int_ptr[0], var_int[1], 0);
+ vec_dstst(var_unsigned_int_ptr[0], var_int[1], 1);
+ vec_dstst(var_unsigned_int_ptr[0], var_int[1], 2);
+ vec_dstst(var_unsigned_int_ptr[0], var_int[1], 3);
+ vec_dstst(var_unsigned_short_ptr[0], var_int[1], 0);
+ vec_dstst(var_unsigned_short_ptr[0], var_int[1], 1);
+ vec_dstst(var_unsigned_short_ptr[0], var_int[1], 2);
+ vec_dstst(var_unsigned_short_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_b16_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_b16_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_b16_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_b16_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_b32_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_b32_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_b32_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_b32_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_b8_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_b8_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_b8_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_b8_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_f32_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_f32_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_f32_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_f32_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_p16_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_p16_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_p16_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_p16_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_s16_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_s16_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_s16_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_s16_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_s32_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_s32_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_s32_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_s32_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_s8_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_s8_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_s8_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_s8_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_u16_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_u16_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_u16_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_u16_ptr[0], var_int[1], 3);
+}
+void f35() {
+ vec_dstst(var_vec_u32_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_u32_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_u32_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_u32_ptr[0], var_int[1], 3);
+ vec_dstst(var_vec_u8_ptr[0], var_int[1], 0);
+ vec_dstst(var_vec_u8_ptr[0], var_int[1], 1);
+ vec_dstst(var_vec_u8_ptr[0], var_int[1], 2);
+ vec_dstst(var_vec_u8_ptr[0], var_int[1], 3);
+ vec_dststt(var_float_ptr[0], var_int[1], 0);
+ vec_dststt(var_float_ptr[0], var_int[1], 1);
+ vec_dststt(var_float_ptr[0], var_int[1], 2);
+ vec_dststt(var_float_ptr[0], var_int[1], 3);
+ vec_dststt(var_int_ptr[0], var_int[1], 0);
+ vec_dststt(var_int_ptr[0], var_int[1], 1);
+ vec_dststt(var_int_ptr[0], var_int[1], 2);
+ vec_dststt(var_int_ptr[0], var_int[1], 3);
+ vec_dststt(var_short_ptr[0], var_int[1], 0);
+ vec_dststt(var_short_ptr[0], var_int[1], 1);
+ vec_dststt(var_short_ptr[0], var_int[1], 2);
+ vec_dststt(var_short_ptr[0], var_int[1], 3);
+ vec_dststt(var_signed_char_ptr[0], var_int[1], 0);
+ vec_dststt(var_signed_char_ptr[0], var_int[1], 1);
+ vec_dststt(var_signed_char_ptr[0], var_int[1], 2);
+ vec_dststt(var_signed_char_ptr[0], var_int[1], 3);
+ vec_dststt(var_unsigned_char_ptr[0], var_int[1], 0);
+ vec_dststt(var_unsigned_char_ptr[0], var_int[1], 1);
+ vec_dststt(var_unsigned_char_ptr[0], var_int[1], 2);
+ vec_dststt(var_unsigned_char_ptr[0], var_int[1], 3);
+ vec_dststt(var_unsigned_int_ptr[0], var_int[1], 0);
+ vec_dststt(var_unsigned_int_ptr[0], var_int[1], 1);
+ vec_dststt(var_unsigned_int_ptr[0], var_int[1], 2);
+ vec_dststt(var_unsigned_int_ptr[0], var_int[1], 3);
+ vec_dststt(var_unsigned_short_ptr[0], var_int[1], 0);
+ vec_dststt(var_unsigned_short_ptr[0], var_int[1], 1);
+ vec_dststt(var_unsigned_short_ptr[0], var_int[1], 2);
+ vec_dststt(var_unsigned_short_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_b16_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_b16_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_b16_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_b16_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_b32_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_b32_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_b32_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_b32_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_b8_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_b8_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_b8_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_b8_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_f32_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_f32_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_f32_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_f32_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_p16_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_p16_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_p16_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_p16_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_s16_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_s16_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_s16_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_s16_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_s32_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_s32_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_s32_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_s32_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_s8_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_s8_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_s8_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_s8_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_u16_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_u16_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_u16_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_u16_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_u32_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_u32_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_u32_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_u32_ptr[0], var_int[1], 3);
+ vec_dststt(var_vec_u8_ptr[0], var_int[1], 0);
+ vec_dststt(var_vec_u8_ptr[0], var_int[1], 1);
+ vec_dststt(var_vec_u8_ptr[0], var_int[1], 2);
+ vec_dststt(var_vec_u8_ptr[0], var_int[1], 3);
+ vec_dstt(var_float_ptr[0], var_int[1], 0);
+ vec_dstt(var_float_ptr[0], var_int[1], 1);
+ vec_dstt(var_float_ptr[0], var_int[1], 2);
+ vec_dstt(var_float_ptr[0], var_int[1], 3);
+ vec_dstt(var_int_ptr[0], var_int[1], 0);
+ vec_dstt(var_int_ptr[0], var_int[1], 1);
+ vec_dstt(var_int_ptr[0], var_int[1], 2);
+ vec_dstt(var_int_ptr[0], var_int[1], 3);
+}
+void f36() {
+ vec_dstt(var_short_ptr[0], var_int[1], 0);
+ vec_dstt(var_short_ptr[0], var_int[1], 1);
+ vec_dstt(var_short_ptr[0], var_int[1], 2);
+ vec_dstt(var_short_ptr[0], var_int[1], 3);
+ vec_dstt(var_signed_char_ptr[0], var_int[1], 0);
+ vec_dstt(var_signed_char_ptr[0], var_int[1], 1);
+ vec_dstt(var_signed_char_ptr[0], var_int[1], 2);
+ vec_dstt(var_signed_char_ptr[0], var_int[1], 3);
+ vec_dstt(var_unsigned_char_ptr[0], var_int[1], 0);
+ vec_dstt(var_unsigned_char_ptr[0], var_int[1], 1);
+ vec_dstt(var_unsigned_char_ptr[0], var_int[1], 2);
+ vec_dstt(var_unsigned_char_ptr[0], var_int[1], 3);
+ vec_dstt(var_unsigned_int_ptr[0], var_int[1], 0);
+ vec_dstt(var_unsigned_int_ptr[0], var_int[1], 1);
+ vec_dstt(var_unsigned_int_ptr[0], var_int[1], 2);
+ vec_dstt(var_unsigned_int_ptr[0], var_int[1], 3);
+ vec_dstt(var_unsigned_short_ptr[0], var_int[1], 0);
+ vec_dstt(var_unsigned_short_ptr[0], var_int[1], 1);
+ vec_dstt(var_unsigned_short_ptr[0], var_int[1], 2);
+ vec_dstt(var_unsigned_short_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_b16_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_b16_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_b16_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_b16_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_b32_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_b32_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_b32_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_b32_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_b8_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_b8_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_b8_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_b8_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_f32_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_f32_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_f32_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_f32_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_p16_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_p16_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_p16_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_p16_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_s16_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_s16_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_s16_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_s16_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_s32_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_s32_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_s32_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_s32_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_s8_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_s8_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_s8_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_s8_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_u16_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_u16_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_u16_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_u16_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_u32_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_u32_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_u32_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_u32_ptr[0], var_int[1], 3);
+ vec_dstt(var_vec_u8_ptr[0], var_int[1], 0);
+ vec_dstt(var_vec_u8_ptr[0], var_int[1], 1);
+ vec_dstt(var_vec_u8_ptr[0], var_int[1], 2);
+ vec_dstt(var_vec_u8_ptr[0], var_int[1], 3);
+ vec_mtvscr(var_vec_b16[0]);
+ vec_mtvscr(var_vec_b32[0]);
+ vec_mtvscr(var_vec_b8[0]);
+ vec_mtvscr(var_vec_p16[0]);
+ vec_mtvscr(var_vec_s16[0]);
+ vec_mtvscr(var_vec_s32[0]);
+ vec_mtvscr(var_vec_s8[0]);
+ vec_mtvscr(var_vec_u16[0]);
+ vec_mtvscr(var_vec_u32[0]);
+ vec_mtvscr(var_vec_u8[0]);
+ vec_st(var_vec_b16[0], var_int[1], var_vec_b16_ptr[2]);
+ vec_st(var_vec_b32[0], var_int[1], var_vec_b32_ptr[2]);
+ vec_st(var_vec_b8[0], var_int[1], var_vec_b8_ptr[2]);
+ vec_st(var_vec_f32[0], var_int[1], var_float_ptr[2]);
+ vec_st(var_vec_f32[0], var_int[1], var_vec_f32_ptr[2]);
+ vec_st(var_vec_p16[0], var_int[1], var_vec_p16_ptr[2]);
+ vec_st(var_vec_s16[0], var_int[1], var_short_ptr[2]);
+ vec_st(var_vec_s16[0], var_int[1], var_vec_s16_ptr[2]);
+ vec_st(var_vec_s32[0], var_int[1], var_int_ptr[2]);
+ vec_st(var_vec_s32[0], var_int[1], var_vec_s32_ptr[2]);
+ vec_st(var_vec_s8[0], var_int[1], var_signed_char_ptr[2]);
+ vec_st(var_vec_s8[0], var_int[1], var_vec_s8_ptr[2]);
+ vec_st(var_vec_u16[0], var_int[1], var_unsigned_short_ptr[2]);
+ vec_st(var_vec_u16[0], var_int[1], var_vec_u16_ptr[2]);
+ vec_st(var_vec_u32[0], var_int[1], var_unsigned_int_ptr[2]);
+ vec_st(var_vec_u32[0], var_int[1], var_vec_u32_ptr[2]);
+ vec_st(var_vec_u8[0], var_int[1], var_unsigned_char_ptr[2]);
+ vec_st(var_vec_u8[0], var_int[1], var_vec_u8_ptr[2]);
+ vec_ste(var_vec_f32[0], var_int[1], var_float_ptr[2]);
+ vec_ste(var_vec_s16[0], var_int[1], var_short_ptr[2]);
+}
+void f37() {
+ vec_ste(var_vec_s32[0], var_int[1], var_int_ptr[2]);
+ vec_ste(var_vec_s8[0], var_int[1], var_signed_char_ptr[2]);
+ vec_ste(var_vec_u16[0], var_int[1], var_unsigned_short_ptr[2]);
+ vec_ste(var_vec_u32[0], var_int[1], var_unsigned_int_ptr[2]);
+ vec_ste(var_vec_u8[0], var_int[1], var_unsigned_char_ptr[2]);
+ vec_stl(var_vec_b16[0], var_int[1], var_vec_b16_ptr[2]);
+ vec_stl(var_vec_b32[0], var_int[1], var_vec_b32_ptr[2]);
+ vec_stl(var_vec_b8[0], var_int[1], var_vec_b8_ptr[2]);
+ vec_stl(var_vec_f32[0], var_int[1], var_float_ptr[2]);
+ vec_stl(var_vec_f32[0], var_int[1], var_vec_f32_ptr[2]);
+ vec_stl(var_vec_p16[0], var_int[1], var_vec_p16_ptr[2]);
+ vec_stl(var_vec_s16[0], var_int[1], var_short_ptr[2]);
+ vec_stl(var_vec_s16[0], var_int[1], var_vec_s16_ptr[2]);
+ vec_stl(var_vec_s32[0], var_int[1], var_int_ptr[2]);
+ vec_stl(var_vec_s32[0], var_int[1], var_vec_s32_ptr[2]);
+ vec_stl(var_vec_s8[0], var_int[1], var_signed_char_ptr[2]);
+ vec_stl(var_vec_s8[0], var_int[1], var_vec_s8_ptr[2]);
+ vec_stl(var_vec_u16[0], var_int[1], var_unsigned_short_ptr[2]);
+ vec_stl(var_vec_u16[0], var_int[1], var_vec_u16_ptr[2]);
+ vec_stl(var_vec_u32[0], var_int[1], var_unsigned_int_ptr[2]);
+ vec_stl(var_vec_u32[0], var_int[1], var_vec_u32_ptr[2]);
+ vec_stl(var_vec_u8[0], var_int[1], var_unsigned_char_ptr[2]);
+ vec_stl(var_vec_u8[0], var_int[1], var_vec_u8_ptr[2]);
+ vec_stvebx(var_vec_s8[0], var_int[1], var_signed_char_ptr[2]);
+ vec_stvebx(var_vec_u8[0], var_int[1], var_unsigned_char_ptr[2]);
+ vec_stvehx(var_vec_s16[0], var_int[1], var_short_ptr[2]);
+ vec_stvehx(var_vec_u16[0], var_int[1], var_unsigned_short_ptr[2]);
+ vec_stvewx(var_vec_f32[0], var_int[1], var_float_ptr[2]);
+ vec_stvewx(var_vec_s32[0], var_int[1], var_int_ptr[2]);
+ vec_stvewx(var_vec_u32[0], var_int[1], var_unsigned_int_ptr[2]);
+ vec_stvx(var_vec_b16[0], var_int[1], var_vec_b16_ptr[2]);
+ vec_stvx(var_vec_b32[0], var_int[1], var_vec_b32_ptr[2]);
+ vec_stvx(var_vec_b8[0], var_int[1], var_vec_b8_ptr[2]);
+ vec_stvx(var_vec_f32[0], var_int[1], var_float_ptr[2]);
+ vec_stvx(var_vec_f32[0], var_int[1], var_vec_f32_ptr[2]);
+ vec_stvx(var_vec_p16[0], var_int[1], var_vec_p16_ptr[2]);
+ vec_stvx(var_vec_s16[0], var_int[1], var_short_ptr[2]);
+ vec_stvx(var_vec_s16[0], var_int[1], var_vec_s16_ptr[2]);
+ vec_stvx(var_vec_s32[0], var_int[1], var_int_ptr[2]);
+ vec_stvx(var_vec_s32[0], var_int[1], var_vec_s32_ptr[2]);
+ vec_stvx(var_vec_s8[0], var_int[1], var_signed_char_ptr[2]);
+ vec_stvx(var_vec_s8[0], var_int[1], var_vec_s8_ptr[2]);
+ vec_stvx(var_vec_u16[0], var_int[1], var_unsigned_short_ptr[2]);
+ vec_stvx(var_vec_u16[0], var_int[1], var_vec_u16_ptr[2]);
+ vec_stvx(var_vec_u32[0], var_int[1], var_unsigned_int_ptr[2]);
+ vec_stvx(var_vec_u32[0], var_int[1], var_vec_u32_ptr[2]);
+ vec_stvx(var_vec_u8[0], var_int[1], var_unsigned_char_ptr[2]);
+ vec_stvx(var_vec_u8[0], var_int[1], var_vec_u8_ptr[2]);
+ vec_stvxl(var_vec_b16[0], var_int[1], var_vec_b16_ptr[2]);
+ vec_stvxl(var_vec_b32[0], var_int[1], var_vec_b32_ptr[2]);
+ vec_stvxl(var_vec_b8[0], var_int[1], var_vec_b8_ptr[2]);
+ vec_stvxl(var_vec_f32[0], var_int[1], var_float_ptr[2]);
+ vec_stvxl(var_vec_f32[0], var_int[1], var_vec_f32_ptr[2]);
+ vec_stvxl(var_vec_p16[0], var_int[1], var_vec_p16_ptr[2]);
+ vec_stvxl(var_vec_s16[0], var_int[1], var_short_ptr[2]);
+ vec_stvxl(var_vec_s16[0], var_int[1], var_vec_s16_ptr[2]);
+ vec_stvxl(var_vec_s32[0], var_int[1], var_int_ptr[2]);
+ vec_stvxl(var_vec_s32[0], var_int[1], var_vec_s32_ptr[2]);
+ vec_stvxl(var_vec_s8[0], var_int[1], var_signed_char_ptr[2]);
+ vec_stvxl(var_vec_s8[0], var_int[1], var_vec_s8_ptr[2]);
+ vec_stvxl(var_vec_u16[0], var_int[1], var_unsigned_short_ptr[2]);
+ vec_stvxl(var_vec_u16[0], var_int[1], var_vec_u16_ptr[2]);
+ vec_stvxl(var_vec_u32[0], var_int[1], var_unsigned_int_ptr[2]);
+ vec_stvxl(var_vec_u32[0], var_int[1], var_vec_u32_ptr[2]);
+ vec_stvxl(var_vec_u8[0], var_int[1], var_unsigned_char_ptr[2]);
+ vec_stvxl(var_vec_u8[0], var_int[1], var_vec_u8_ptr[2]);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pack-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pack-be-order.c
new file mode 100644
index 000000000..c400fc882
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pack-be-order.c
@@ -0,0 +1,136 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+#define BIG 4294967295
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned short vusa = {0,1,2,3,4,5,6,7};
+ vector unsigned short vusb = {8,9,10,11,12,13,14,15};
+ vector signed short vssa = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed short vssb = {0,1,2,3,4,5,6,7};
+ vector bool short vbsa = {0,65535,65535,0,0,0,65535,0};
+ vector bool short vbsb = {65535,0,0,65535,65535,65535,0,65535};
+ vector unsigned int vuia = {0,1,2,3};
+ vector unsigned int vuib = {4,5,6,7};
+ vector signed int vsia = {-4,-3,-2,-1};
+ vector signed int vsib = {0,1,2,3};
+ vector bool int vbia = {0,BIG,BIG,BIG};
+ vector bool int vbib = {BIG,0,0,0};
+ vector unsigned int vipa = {(0<<24) + (2<<19) + (3<<11) + (4<<3),
+ (1<<24) + (5<<19) + (6<<11) + (7<<3),
+ (0<<24) + (8<<19) + (9<<11) + (10<<3),
+ (1<<24) + (11<<19) + (12<<11) + (13<<3)};
+ vector unsigned int vipb = {(1<<24) + (14<<19) + (15<<11) + (16<<3),
+ (0<<24) + (17<<19) + (18<<11) + (19<<3),
+ (1<<24) + (20<<19) + (21<<11) + (22<<3),
+ (0<<24) + (23<<19) + (24<<11) + (25<<3)};
+ vector unsigned short vusc = {0,256,1,257,2,258,3,259};
+ vector unsigned short vusd = {4,260,5,261,6,262,7,263};
+ vector signed short vssc = {-1,-128,0,127,-2,-129,1,128};
+ vector signed short vssd = {-3,-130,2,129,-4,-131,3,130};
+ vector unsigned int vuic = {0,65536,1,65537};
+ vector unsigned int vuid = {2,65538,3,65539};
+ vector signed int vsic = {-1,-32768,0,32767};
+ vector signed int vsid = {-2,-32769,1,32768};
+
+ /* Result vectors. */
+ vector unsigned char vucr;
+ vector signed char vscr;
+ vector bool char vbcr;
+ vector unsigned short vusr;
+ vector signed short vssr;
+ vector bool short vbsr;
+ vector pixel vpr;
+ vector unsigned char vucsr;
+ vector signed char vscsr;
+ vector unsigned short vussr;
+ vector signed short vsssr;
+ vector unsigned char vucsur1, vucsur2;
+ vector unsigned short vussur1, vussur2;
+
+ /* Expected result vectors. */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char vucer = {8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7};
+ vector signed char vscer = {0,1,2,3,4,5,6,7,-8,-7,-6,-5,-4,-3,-2,-1};
+ vector bool char vbcer = {255,0,0,255,255,255,0,255,0,255,255,0,0,0,255,0};
+ vector unsigned short vuser = {4,5,6,7,0,1,2,3};
+ vector signed short vsser = {0,1,2,3,-4,-3,-2,-1};
+ vector bool short vbser = {65535,0,0,0,0,65535,65535,65535};
+ vector pixel vper = {(1<<15) + (14<<10) + (15<<5) + 16,
+ (0<<15) + (17<<10) + (18<<5) + 19,
+ (1<<15) + (20<<10) + (21<<5) + 22,
+ (0<<15) + (23<<10) + (24<<5) + 25,
+ (0<<15) + (2<<10) + (3<<5) + 4,
+ (1<<15) + (5<<10) + (6<<5) + 7,
+ (0<<15) + (8<<10) + (9<<5) + 10,
+ (1<<15) + (11<<10) + (12<<5) + 13};
+ vector unsigned char vucser = {4,255,5,255,6,255,7,255,0,255,1,255,2,255,3,255};
+ vector signed char vscser = {-3,-128,2,127,-4,-128,3,127,
+ -1,-128,0,127,-2,-128,1,127};
+ vector unsigned short vusser = {2,65535,3,65535,0,65535,1,65535};
+ vector signed short vssser = {-2,-32768,1,32767,-1,-32768,0,32767};
+ vector unsigned char vucsuer1 = {4,255,5,255,6,255,7,255,0,255,1,255,2,255,3,255};
+ vector unsigned char vucsuer2 = {0,0,2,129,0,0,3,130,0,0,0,127,0,0,1,128};
+ vector unsigned short vussuer1 = {2,65535,3,65535,0,65535,1,65535};
+ vector unsigned short vussuer2 = {0,0,1,32768,0,0,0,32767};
+#else
+ vector unsigned char vucer = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vscer = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char vbcer = {0,255,255,0,0,0,255,0,255,0,0,255,255,255,0,255};
+ vector unsigned short vuser = {0,1,2,3,4,5,6,7};
+ vector signed short vsser = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short vbser = {0,65535,65535,65535,65535,0,0,0};
+ vector pixel vper = {(0<<15) + (2<<10) + (3<<5) + 4,
+ (1<<15) + (5<<10) + (6<<5) + 7,
+ (0<<15) + (8<<10) + (9<<5) + 10,
+ (1<<15) + (11<<10) + (12<<5) + 13,
+ (1<<15) + (14<<10) + (15<<5) + 16,
+ (0<<15) + (17<<10) + (18<<5) + 19,
+ (1<<15) + (20<<10) + (21<<5) + 22,
+ (0<<15) + (23<<10) + (24<<5) + 25};
+ vector unsigned char vucser = {0,255,1,255,2,255,3,255,4,255,5,255,6,255,7,255};
+ vector signed char vscser = {-1,-128,0,127,-2,-128,1,127,
+ -3,-128,2,127,-4,-128,3,127};
+ vector unsigned short vusser = {0,65535,1,65535,2,65535,3,65535};
+ vector signed short vssser = {-1,-32768,0,32767,-2,-32768,1,32767};
+ vector unsigned char vucsuer1 = {0,255,1,255,2,255,3,255,4,255,5,255,6,255,7,255};
+ vector unsigned char vucsuer2 = {0,0,0,127,0,0,1,128,0,0,2,129,0,0,3,130};
+ vector unsigned short vussuer1 = {0,65535,1,65535,2,65535,3,65535};
+ vector unsigned short vussuer2 = {0,0,0,32767,0,0,1,32768};
+#endif
+
+ vucr = vec_pack (vusa, vusb);
+ vscr = vec_pack (vssa, vssb);
+ vbcr = vec_pack (vbsa, vbsb);
+ vusr = vec_pack (vuia, vuib);
+ vssr = vec_pack (vsia, vsib);
+ vbsr = vec_pack (vbia, vbib);
+ vpr = vec_packpx (vipa, vipb);
+ vucsr = vec_packs (vusc, vusd);
+ vscsr = vec_packs (vssc, vssd);
+ vussr = vec_packs (vuic, vuid);
+ vsssr = vec_packs (vsic, vsid);
+ vucsur1 = vec_packsu (vusc, vusd);
+ vucsur2 = vec_packsu (vssc, vssd);
+ vussur1 = vec_packsu (vuic, vuid);
+ vussur2 = vec_packsu (vsic, vsid);
+
+ check (vec_all_eq (vucr, vucer), "vucr");
+ check (vec_all_eq (vscr, vscer), "vscr");
+ check (vec_all_eq (vbcr, vbcer), "vbcr");
+ check (vec_all_eq (vusr, vuser), "vusr");
+ check (vec_all_eq (vssr, vsser), "vssr");
+ check (vec_all_eq (vbsr, vbser), "vbsr");
+ check (vec_all_eq (vpr, vper ), "vpr" );
+ check (vec_all_eq (vucsr, vucser), "vucsr");
+ check (vec_all_eq (vscsr, vscser), "vscsr");
+ check (vec_all_eq (vussr, vusser), "vussr");
+ check (vec_all_eq (vsssr, vssser), "vsssr");
+ check (vec_all_eq (vucsur1, vucsuer1), "vucsur1");
+ check (vec_all_eq (vucsur2, vucsuer2), "vucsur2");
+ check (vec_all_eq (vussur1, vussuer1), "vussur1");
+ check (vec_all_eq (vussur2, vussuer2), "vussur2");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pack.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pack.c
new file mode 100644
index 000000000..d1b49f0a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pack.c
@@ -0,0 +1,108 @@
+#include "harness.h"
+
+#define BIG 4294967295
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned short vusa = {0,1,2,3,4,5,6,7};
+ vector unsigned short vusb = {8,9,10,11,12,13,14,15};
+ vector signed short vssa = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed short vssb = {0,1,2,3,4,5,6,7};
+ vector bool short vbsa = {0,65535,65535,0,0,0,65535,0};
+ vector bool short vbsb = {65535,0,0,65535,65535,65535,0,65535};
+ vector unsigned int vuia = {0,1,2,3};
+ vector unsigned int vuib = {4,5,6,7};
+ vector signed int vsia = {-4,-3,-2,-1};
+ vector signed int vsib = {0,1,2,3};
+ vector bool int vbia = {0,BIG,BIG,BIG};
+ vector bool int vbib = {BIG,0,0,0};
+ vector unsigned int vipa = {(0<<24) + (2<<19) + (3<<11) + (4<<3),
+ (1<<24) + (5<<19) + (6<<11) + (7<<3),
+ (0<<24) + (8<<19) + (9<<11) + (10<<3),
+ (1<<24) + (11<<19) + (12<<11) + (13<<3)};
+ vector unsigned int vipb = {(1<<24) + (14<<19) + (15<<11) + (16<<3),
+ (0<<24) + (17<<19) + (18<<11) + (19<<3),
+ (1<<24) + (20<<19) + (21<<11) + (22<<3),
+ (0<<24) + (23<<19) + (24<<11) + (25<<3)};
+ vector unsigned short vusc = {0,256,1,257,2,258,3,259};
+ vector unsigned short vusd = {4,260,5,261,6,262,7,263};
+ vector signed short vssc = {-1,-128,0,127,-2,-129,1,128};
+ vector signed short vssd = {-3,-130,2,129,-4,-131,3,130};
+ vector unsigned int vuic = {0,65536,1,65537};
+ vector unsigned int vuid = {2,65538,3,65539};
+ vector signed int vsic = {-1,-32768,0,32767};
+ vector signed int vsid = {-2,-32769,1,32768};
+
+ /* Result vectors. */
+ vector unsigned char vucr;
+ vector signed char vscr;
+ vector bool char vbcr;
+ vector unsigned short vusr;
+ vector signed short vssr;
+ vector bool short vbsr;
+ vector pixel vpr;
+ vector unsigned char vucsr;
+ vector signed char vscsr;
+ vector unsigned short vussr;
+ vector signed short vsssr;
+ vector unsigned char vucsur1, vucsur2;
+ vector unsigned short vussur1, vussur2;
+
+ /* Expected result vectors. */
+ vector unsigned char vucer = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vscer = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char vbcer = {0,255,255,0,0,0,255,0,255,0,0,255,255,255,0,255};
+ vector unsigned short vuser = {0,1,2,3,4,5,6,7};
+ vector signed short vsser = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short vbser = {0,65535,65535,65535,65535,0,0,0};
+ vector pixel vper = {(0<<15) + (2<<10) + (3<<5) + 4,
+ (1<<15) + (5<<10) + (6<<5) + 7,
+ (0<<15) + (8<<10) + (9<<5) + 10,
+ (1<<15) + (11<<10) + (12<<5) + 13,
+ (1<<15) + (14<<10) + (15<<5) + 16,
+ (0<<15) + (17<<10) + (18<<5) + 19,
+ (1<<15) + (20<<10) + (21<<5) + 22,
+ (0<<15) + (23<<10) + (24<<5) + 25};
+ vector unsigned char vucser = {0,255,1,255,2,255,3,255,4,255,5,255,6,255,7,255};
+ vector signed char vscser = {-1,-128,0,127,-2,-128,1,127,
+ -3,-128,2,127,-4,-128,3,127};
+ vector unsigned short vusser = {0,65535,1,65535,2,65535,3,65535};
+ vector signed short vssser = {-1,-32768,0,32767,-2,-32768,1,32767};
+ vector unsigned char vucsuer1 = {0,255,1,255,2,255,3,255,4,255,5,255,6,255,7,255};
+ vector unsigned char vucsuer2 = {0,0,0,127,0,0,1,128,0,0,2,129,0,0,3,130};
+ vector unsigned short vussuer1 = {0,65535,1,65535,2,65535,3,65535};
+ vector unsigned short vussuer2 = {0,0,0,32767,0,0,1,32768};
+
+ vucr = vec_pack (vusa, vusb);
+ vscr = vec_pack (vssa, vssb);
+ vbcr = vec_pack (vbsa, vbsb);
+ vusr = vec_pack (vuia, vuib);
+ vssr = vec_pack (vsia, vsib);
+ vbsr = vec_pack (vbia, vbib);
+ vpr = vec_packpx (vipa, vipb);
+ vucsr = vec_packs (vusc, vusd);
+ vscsr = vec_packs (vssc, vssd);
+ vussr = vec_packs (vuic, vuid);
+ vsssr = vec_packs (vsic, vsid);
+ vucsur1 = vec_packsu (vusc, vusd);
+ vucsur2 = vec_packsu (vssc, vssd);
+ vussur1 = vec_packsu (vuic, vuid);
+ vussur2 = vec_packsu (vsic, vsid);
+
+ check (vec_all_eq (vucr, vucer), "vucr");
+ check (vec_all_eq (vscr, vscer), "vscr");
+ check (vec_all_eq (vbcr, vbcer), "vbcr");
+ check (vec_all_eq (vusr, vuser), "vusr");
+ check (vec_all_eq (vssr, vsser), "vssr");
+ check (vec_all_eq (vbsr, vbser), "vbsr");
+ check (vec_all_eq (vpr, vper ), "vpr" );
+ check (vec_all_eq (vucsr, vucser), "vucsr");
+ check (vec_all_eq (vscsr, vscser), "vscsr");
+ check (vec_all_eq (vussr, vusser), "vussr");
+ check (vec_all_eq (vsssr, vssser), "vsssr");
+ check (vec_all_eq (vucsur1, vucsuer1), "vucsur1");
+ check (vec_all_eq (vucsur2, vucsuer2), "vucsur2");
+ check (vec_all_eq (vussur1, vussuer1), "vussur1");
+ check (vec_all_eq (vussur2, vussuer2), "vussur2");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/perm-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/perm-be-order.c
new file mode 100644
index 000000000..604f63dc9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/perm-be-order.c
@@ -0,0 +1,74 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned char vuca = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned char vucb = {16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+ vector signed char vsca = {-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed char vscb = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned short vusa = {0,1,2,3,4,5,6,7};
+ vector unsigned short vusb = {8,9,10,11,12,13,14,15};
+ vector signed short vssa = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed short vssb = {0,1,2,3,4,5,6,7};
+ vector unsigned int vuia = {0,1,2,3};
+ vector unsigned int vuib = {4,5,6,7};
+ vector signed int vsia = {-4,-3,-2,-1};
+ vector signed int vsib = {0,1,2,3};
+ vector float vfa = {-4.0,-3.0,-2.0,-1.0};
+ vector float vfb = {0.0,1.0,2.0,3.0};
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char vucp = {15,16,14,17,13,18,12,19,11,20,10,21,9,22,8,23};
+ vector unsigned char vscp = {15,16,14,17,13,18,12,19,11,20,10,21,9,22,8,23};
+ vector unsigned char vusp = {15,14,17,16,13,12,19,18,11,10,21,20,9,8,23,22};
+ vector unsigned char vssp = {15,14,17,16,13,12,19,18,11,10,21,20,9,8,23,22};
+ vector unsigned char vuip = {15,14,13,12,19,18,17,16,11,10,9,8,23,22,21,20};
+ vector unsigned char vsip = {15,14,13,12,19,18,17,16,11,10,9,8,23,22,21,20};
+ vector unsigned char vfp = {15,14,13,12,19,18,17,16,11,10,9,8,23,22,21,20};
+#else
+ vector unsigned char vucp = {0,31,1,30,2,29,3,28,4,27,5,26,6,25,7,24};
+ vector unsigned char vscp = {0,31,1,30,2,29,3,28,4,27,5,26,6,25,7,24};
+ vector unsigned char vusp = {0,1,30,31,2,3,28,29,4,5,26,27,6,7,24,25};
+ vector unsigned char vssp = {0,1,30,31,2,3,28,29,4,5,26,27,6,7,24,25};
+ vector unsigned char vuip = {0,1,2,3,28,29,30,31,4,5,6,7,24,25,26,27};
+ vector unsigned char vsip = {0,1,2,3,28,29,30,31,4,5,6,7,24,25,26,27};
+ vector unsigned char vfp = {0,1,2,3,28,29,30,31,4,5,6,7,24,25,26,27};
+#endif
+
+ /* Result vectors. */
+ vector unsigned char vuc;
+ vector signed char vsc;
+ vector unsigned short vus;
+ vector signed short vss;
+ vector unsigned int vui;
+ vector signed int vsi;
+ vector float vf;
+
+ /* Expected result vectors. */
+ vector unsigned char vucr = {0,31,1,30,2,29,3,28,4,27,5,26,6,25,7,24};
+ vector signed char vscr = {-16,15,-15,14,-14,13,-13,12,-12,11,-11,10,-10,9,-9,8};
+ vector unsigned short vusr = {0,15,1,14,2,13,3,12};
+ vector signed short vssr = {-8,7,-7,6,-6,5,-5,4};
+ vector unsigned int vuir = {0,7,1,6};
+ vector signed int vsir = {-4,3,-3,2};
+ vector float vfr = {-4.0,3.0,-3.0,2.0};
+
+ vuc = vec_perm (vuca, vucb, vucp);
+ vsc = vec_perm (vsca, vscb, vscp);
+ vus = vec_perm (vusa, vusb, vusp);
+ vss = vec_perm (vssa, vssb, vssp);
+ vui = vec_perm (vuia, vuib, vuip);
+ vsi = vec_perm (vsia, vsib, vsip);
+ vf = vec_perm (vfa, vfb, vfp );
+
+ check (vec_all_eq (vuc, vucr), "vuc");
+ check (vec_all_eq (vsc, vscr), "vsc");
+ check (vec_all_eq (vus, vusr), "vus");
+ check (vec_all_eq (vss, vssr), "vss");
+ check (vec_all_eq (vui, vuir), "vui");
+ check (vec_all_eq (vsi, vsir), "vsi");
+ check (vec_all_eq (vf, vfr), "vf" );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/perm.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/perm.c
new file mode 100644
index 000000000..be6bf3422
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/perm.c
@@ -0,0 +1,69 @@
+#include "harness.h"
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned char vuca = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned char vucb
+ = {16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
+ vector unsigned char vucp = {0,31,1,30,2,29,3,28,4,27,5,26,6,25,7,24};
+
+ vector signed char vsca
+ = {-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed char vscb = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector unsigned char vscp = {0,31,1,30,2,29,3,28,4,27,5,26,6,25,7,24};
+
+ vector unsigned short vusa = {0,1,2,3,4,5,6,7};
+ vector unsigned short vusb = {8,9,10,11,12,13,14,15};
+ vector unsigned char vusp = {0,1,30,31,2,3,28,29,4,5,26,27,6,7,24,25};
+
+ vector signed short vssa = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed short vssb = {0,1,2,3,4,5,6,7};
+ vector unsigned char vssp = {0,1,30,31,2,3,28,29,4,5,26,27,6,7,24,25};
+
+ vector unsigned int vuia = {0,1,2,3};
+ vector unsigned int vuib = {4,5,6,7};
+ vector unsigned char vuip = {0,1,2,3,28,29,30,31,4,5,6,7,24,25,26,27};
+
+ vector signed int vsia = {-4,-3,-2,-1};
+ vector signed int vsib = {0,1,2,3};
+ vector unsigned char vsip = {0,1,2,3,28,29,30,31,4,5,6,7,24,25,26,27};
+
+ vector float vfa = {-4.0,-3.0,-2.0,-1.0};
+ vector float vfb = {0.0,1.0,2.0,3.0};
+ vector unsigned char vfp = {0,1,2,3,28,29,30,31,4,5,6,7,24,25,26,27};
+
+ /* Result vectors. */
+ vector unsigned char vuc;
+ vector signed char vsc;
+ vector unsigned short vus;
+ vector signed short vss;
+ vector unsigned int vui;
+ vector signed int vsi;
+ vector float vf;
+
+ /* Expected result vectors. */
+ vector unsigned char vucr = {0,31,1,30,2,29,3,28,4,27,5,26,6,25,7,24};
+ vector signed char vscr = {-16,15,-15,14,-14,13,-13,12,-12,11,-11,10,-10,9,-9,8};
+ vector unsigned short vusr = {0,15,1,14,2,13,3,12};
+ vector signed short vssr = {-8,7,-7,6,-6,5,-5,4};
+ vector unsigned int vuir = {0,7,1,6};
+ vector signed int vsir = {-4,3,-3,2};
+ vector float vfr = {-4.0,3.0,-3.0,2.0};
+
+ vuc = vec_perm (vuca, vucb, vucp);
+ vsc = vec_perm (vsca, vscb, vscp);
+ vus = vec_perm (vusa, vusb, vusp);
+ vss = vec_perm (vssa, vssb, vssp);
+ vui = vec_perm (vuia, vuib, vuip);
+ vsi = vec_perm (vsia, vsib, vsip);
+ vf = vec_perm (vfa, vfb, vfp );
+
+ check (vec_all_eq (vuc, vucr), "vuc");
+ check (vec_all_eq (vsc, vscr), "vsc");
+ check (vec_all_eq (vus, vusr), "vus");
+ check (vec_all_eq (vss, vssr), "vss");
+ check (vec_all_eq (vui, vuir), "vui");
+ check (vec_all_eq (vsi, vsir), "vsi");
+ check (vec_all_eq (vf, vfr), "vf" );
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pr27006.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pr27006.c
new file mode 100644
index 000000000..d34d51e92
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pr27006.c
@@ -0,0 +1,22 @@
+/* { dg-options "-maltivec" } */
+
+extern void abort ();
+
+typedef union
+{
+ int i[4];
+ __attribute__((altivec(vector__))) int v;
+} vec_int4;
+
+int main (void)
+{
+ vec_int4 i1;
+
+ i1.v = (__attribute__((altivec(vector__))) int){31, 31, 31, 31};
+
+ if (i1.i[0] != 31)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pr27842.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pr27842.c
new file mode 100644
index 000000000..ad3130d00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/pr27842.c
@@ -0,0 +1,26 @@
+#include <altivec.h>
+
+extern void abort (void);
+extern int memcmp (const void *, const void *, __SIZE_TYPE__);
+
+void test (vector float *p, int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ p[i] = vec_abs (p[i]);
+}
+
+int
+main (void)
+{
+ vector float p = (vector float){ 0.5, 0.5, 0.5, 0.5 };
+ vector float q = p;
+
+ test (&p, 1);
+
+ if (memcmp (&p, &q, sizeof (p)))
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sn7153.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sn7153.c
new file mode 100644
index 000000000..2381a891c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sn7153.c
@@ -0,0 +1,66 @@
+/* In the source code, the vec_adds appears before the call to
+ validate_sat(). In the .s code, the vaddubs has been moved to after
+ the call to validate_sat(). This invalidates the meaning of checking
+ the saturation bit. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <altivec.h>
+
+static int failed;
+
+void validate_sat();
+void validate_u8(vector unsigned char, vector unsigned char);
+
+int
+main()
+{
+ vector unsigned char result_u8;
+ vec_mtvscr(((vector unsigned short){0,0,0,0,0,0,0,0}));
+ result_u8 = vec_adds(((vector unsigned
+ char){0,1,2,3,0xfc,0xfd,0xfe,0xff,
+ 0,1,2,3,0xfc,0xfd,0xfe,0xff}),
+ ((vector unsigned
+ char){0,0xf0,0xfd,0xfd,2,2,2,2,0,
+ 0xf0,0xfd,0xfd,2,2,2,2}));
+ validate_sat();
+ validate_u8(result_u8, ((vector unsigned
+ char){0,0xf1,0xff,0xff,0xfe,0xff,0xff,0xff,
+ 0,0xf1,0xff,0xff,0xfe,0xff,0xff,0xff}));
+ if (failed)
+ abort ();
+ return 0;
+}
+
+void validate_sat()
+{
+#ifdef __LITTLE_ENDIAN__
+ if (vec_any_ne(vec_splat(vec_mfvscr(), 0), ((vector unsigned short){1,1,1,1,1,1,1,1})))
+#else
+ if (vec_any_ne(vec_splat(vec_mfvscr(), 7), ((vector unsigned short){1,1,1,1,1,1,1,1})))
+#endif
+ {
+ union {vector unsigned short v; unsigned short s[8];} u;
+ u.v = vec_mfvscr();
+ printf("error: vscr == { %d,%d,%d,%d,%d,%d,%d,%d }",
+ u.s[0], u.s[1], u.s[2], u.s[3],
+ u.s[4], u.s[5], u.s[6], u.s[7]);
+ printf("expected { 1,1,1,1,1,1,1,1 }\n");
+ failed++;
+ }
+}
+
+void validate_u8(vector unsigned char v, vector unsigned char vx)
+{
+ union {vector unsigned char v; unsigned char x[16]; } u, ux;
+ int i;
+ u.v = v;
+ ux.v = vx;
+ for (i=0; i<16; i++) {
+ if (u.x[i] != ux.x[i]) {
+ printf(" error: field %d %#2.2x expected %#2.2x\n",
+ i, u.x[i], ux.x[i]);
+ failed++;
+ }
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill.c
new file mode 100644
index 000000000..dad489c34
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill.c
@@ -0,0 +1,131 @@
+#include <altivec.h>
+extern vector unsigned char u8(void);
+extern vector signed char s8(void);
+extern vector bool char b8(void);
+extern vector unsigned short u16(void);
+extern vector signed short s16(void);
+extern vector bool short b16(void);
+extern vector unsigned int u32(void);
+extern vector signed int s32(void);
+extern vector bool int b32(void);
+extern vector float f32(void);
+extern vector pixel p16(void);
+
+extern void g(vector unsigned char, ...);
+
+void f()
+{
+ vector unsigned char u8l = u8();
+ vector signed char s8l = s8();
+ vector bool char b8l = b8();
+ vector unsigned short u16l = u16();
+ vector signed short s16l = s16();
+ vector bool short b16l = b16();
+ vector unsigned int u32l = u32();
+ vector signed int s32l = s32();
+ vector bool int b32l = b32();
+ vector float f32l = f32();
+ vector pixel p16l = p16();
+ vector unsigned char u8lx = u8();
+ vector signed char s8lx = s8();
+ vector bool char b8lx = b8();
+ vector unsigned short u16lx = u16();
+ vector signed short s16lx = s16();
+ vector bool short b16lx = b16();
+ vector unsigned int u32lx = u32();
+ vector signed int s32lx = s32();
+ vector bool int b32lx = b32();
+ vector float f32lx = f32();
+ vector pixel p16lx = p16();
+
+ g(u8l, s8l, b8l, u16l, s16l, b16l, u32l, s32l, b32l, f32l, p16l,
+ u8lx, s8lx, b8lx, u16lx, s16lx, b16lx, u32lx, s32lx, b32lx, f32lx, p16lx);
+}
+
+vector unsigned char
+u8(void)
+{
+ static vector unsigned char zero;
+ return zero;
+}
+
+vector signed char
+s8(void)
+{
+ static vector signed char zero;
+ return zero;
+}
+
+vector bool char
+b8(void)
+{
+ static vector bool char zero;
+ return zero;
+}
+
+vector unsigned short
+u16(void)
+{
+ static vector unsigned short zero;
+ return zero;
+}
+
+vector signed short
+s16(void)
+{
+ static vector signed short zero;
+ return zero;
+}
+
+vector bool short
+b16(void)
+{
+ static vector bool short zero;
+ return zero;
+}
+
+vector unsigned int
+u32(void)
+{
+ static vector unsigned int zero;
+ return zero;
+}
+
+vector signed int
+s32(void)
+{
+ static vector signed int zero;
+ return zero;
+}
+
+vector bool int
+b32(void)
+{
+ static vector bool int zero;
+ return zero;
+}
+
+vector float
+f32(void)
+{
+ static vector float zero;
+ return zero;
+}
+
+vector pixel
+p16(void)
+{
+ static vector pixel zero;
+ return zero;
+}
+
+void
+g(vector unsigned char a, ...)
+{
+}
+
+int main()
+{
+ f();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill2.c
new file mode 100644
index 000000000..4c7337bd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill2.c
@@ -0,0 +1,155 @@
+#include <altivec.h>
+extern vector unsigned char u8(void);
+extern vector signed char s8(void);
+extern vector bool char b8(void);
+extern vector unsigned short u16(void);
+extern vector signed short s16(void);
+extern vector bool short b16(void);
+extern vector unsigned int u32(void);
+extern vector signed int s32(void);
+extern vector bool int b32(void);
+extern vector float f32(void);
+extern vector pixel p16(void);
+extern double d(void);
+extern int i(void);
+
+extern void g(vector unsigned char, ...);
+
+void f()
+{
+ int i1l = i();
+ vector unsigned char u8l = u8();
+ vector signed char s8l = s8();
+ vector bool char b8l = b8();
+ int i2l = i();
+ vector unsigned short u16l = u16();
+ vector signed short s16l = s16();
+ vector bool short b16l = b16();
+ int i3l = i();
+ vector unsigned int u32l = u32();
+ vector signed int s32l = s32();
+ vector bool int b32l = b32();
+ double d1l = d();
+ vector float f32l = f32();
+ vector pixel p16l = p16();
+ double d2l = d();
+ vector unsigned char u8lx = u8();
+ vector signed char s8lx = s8();
+ vector bool char b8lx = b8();
+ vector unsigned short u16lx = u16();
+ vector signed short s16lx = s16();
+ vector bool short b16lx = b16();
+ vector unsigned int u32lx = u32();
+ vector signed int s32lx = s32();
+ vector bool int b32lx = b32();
+ vector float f32lx = f32();
+ vector pixel p16lx = p16();
+
+ if (i1l)
+ g(u8l, s8l, b8l, u16l, s16l, b16l, u32l, s32l, b32l, f32l, p16l,
+ u8lx, s8lx, b8lx, u16lx, s16lx, b16lx, u32lx, s32lx, b32lx, f32lx, p16lx,
+ i1l, i2l, i3l, d1l, d2l);
+ g(u8l, i1l, i2l, i3l, d1l, d2l);
+}
+
+double
+d(void)
+{
+ static double zero;
+ return zero;
+}
+
+int
+i(void)
+{
+ static int non_zero;
+ return ++non_zero;
+}
+
+vector unsigned char
+u8(void)
+{
+ static vector unsigned char zero;
+ return zero;
+}
+
+vector signed char
+s8(void)
+{
+ static vector signed char zero;
+ return zero;
+}
+
+vector bool char
+b8(void)
+{
+ static vector bool char zero;
+ return zero;
+}
+
+vector unsigned short
+u16(void)
+{
+ static vector unsigned short zero;
+ return zero;
+}
+
+vector signed short
+s16(void)
+{
+ static vector signed short zero;
+ return zero;
+}
+
+vector bool short
+b16(void)
+{
+ static vector bool short zero;
+ return zero;
+}
+
+vector unsigned int
+u32(void)
+{
+ static vector unsigned int zero;
+ return zero;
+}
+
+vector signed int
+s32(void)
+{
+ static vector signed int zero;
+ return zero;
+}
+
+vector bool int
+b32(void)
+{
+ static vector bool int zero;
+ return zero;
+}
+
+vector float
+f32(void)
+{
+ static vector float zero;
+ return zero;
+}
+
+vector pixel
+p16(void)
+{
+ static vector pixel zero;
+ return zero;
+}
+
+void
+g(vector unsigned char a, ...)
+{
+}
+
+int main()
+{
+ f();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill3.c
new file mode 100644
index 000000000..9f1c45c65
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/spill3.c
@@ -0,0 +1,156 @@
+#include <altivec.h>
+extern void g(vector unsigned char, ...);
+extern vector unsigned char v(void);
+extern double d(void);
+extern int i(void);
+
+static vector unsigned char v1l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v2l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v3l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v4l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v5l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v6l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v7l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v8l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v9l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v10l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v11l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static vector unsigned char v12l = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+static double d1l = 0;
+static double d2l = 0;
+static double d3l = 0;
+static double d4l = 0;
+static double d5l = 0;
+static double d6l = 0;
+static double d7l = 0;
+static double d8l = 0;
+static double d9l = 0;
+static double d10l = 0;
+static double d11l = 0;
+static double d12l = 0;
+static double d13l = 0;
+static double d14l = 0;
+static double d15l = 0;
+static double d16l = 0;
+static double d17l = 0;
+static double d18l = 0;
+static int i1l = 0;
+static int i2l = 0;
+static int i3l = 0;
+static int i4l = 0;
+static int i5l = 0;
+static int i6l = 0;
+static int i7l = 0;
+static int i8l = 0;
+static int i9l = 0;
+static int i10l = 0;
+static int i11l = 0;
+static int i12l = 0;
+static int i13l = 0;
+static int i14l = 0;
+static int i15l = 0;
+static int i16l = 0;
+static int i17l = 0;
+static int i18l = 0;
+static int i19l = 0;
+
+void f()
+{
+ char buffer[23];
+ vector unsigned char v1l = v();
+ vector unsigned char v2l = v();
+ vector unsigned char v3l = v();
+ vector unsigned char v4l = v();
+ vector unsigned char v5l = v();
+ vector unsigned char v6l = v();
+ vector unsigned char v7l = v();
+ vector unsigned char v8l = v();
+ vector unsigned char v9l = v();
+ vector unsigned char v10l = v();
+ vector unsigned char v11l = v();
+ vector unsigned char v12l = v();
+
+ double d1l = d();
+ double d2l = d();
+ double d3l = d();
+ double d4l = d();
+ double d5l = d();
+ double d6l = d();
+ double d7l = d();
+ double d8l = d();
+ double d9l = d();
+ double d10l = d();
+ double d11l = d();
+ double d12l = d();
+ double d13l = d();
+ double d14l = d();
+ double d15l = d();
+ double d16l = d();
+ double d17l = d();
+ double d18l = d();
+
+ int i1l = i();
+ int i2l = i();
+ int i3l = i();
+ int i4l = i();
+ int i5l = i();
+ int i6l = i();
+ int i7l = i();
+ int i8l = i();
+ int i9l = i();
+ int i10l = i();
+ int i11l = i();
+ int i12l = i();
+ int i13l = i();
+ int i14l = i();
+ int i15l = i();
+ int i16l = i();
+ int i17l = i();
+ int i18l = i();
+ int i19l = i();
+
+ if (d1l)
+ g(v1l, v2l, v3l, v4l, v5l, v6l, v7l, v8l, v9l, v10l, v11l, v12l,
+ d1l, d2l, d3l, d4l, d5l, d6l, d7l, d8l, d9l, d10l, d11l, d12l,
+ d13l, d14l, d15l, d16l, d17l, d18l,
+ i1l, i2l, i3l, i4l, i5l, i6l, i7l, i8l, i9l, i10l, i11l, i12l,
+ i13l, i14l, i15l, i16l, i17l, i18l, i19l);
+
+ g(v1l, buffer,
+ d1l, d2l, d3l, d4l, d5l, d6l, d7l, d8l, d9l, d10l, d11l, d12l,
+ d13l, d14l, d15l, d16l, d17l, d18l,
+ i1l, i2l, i3l, i4l, i5l, i6l, i7l, i8l, i9l, i10l, i11l, i12l,
+ i13l, i14l, i15l, i16l, i17l, i18l, i19l);
+}
+
+double
+d(void)
+{
+ static double zero;
+ return zero;
+}
+
+int
+i(void)
+{
+ static int non_zero;
+ return ++non_zero;
+}
+
+vector unsigned char
+v(void)
+{
+ static vector unsigned char zero;
+ return zero;
+}
+
+void
+g(vector unsigned char a, ...)
+{
+}
+
+int main()
+{
+ f();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-be-order.c
new file mode 100644
index 000000000..e265ae4be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-be-order.c
@@ -0,0 +1,59 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector unsigned short vus = {0,1,2,3,4,5,6,7};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector float vf = {-2.0,-1.0,0.0,1.0};
+
+ /* Result vectors. */
+ vector unsigned char vucr;
+ vector signed char vscr;
+ vector unsigned short vusr;
+ vector signed short vssr;
+ vector unsigned int vuir;
+ vector signed int vsir;
+ vector float vfr;
+
+ /* Expected result vectors. */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char vucer = {14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14};
+ vector signed char vscer = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
+ vector unsigned short vuser = {0,0,0,0,0,0,0,0};
+ vector signed short vsser = {3,3,3,3,3,3,3,3};
+ vector unsigned int vuier = {1,1,1,1};
+ vector signed int vsier = {-2,-2,-2,-2};
+ vector float vfer = {0.0,0.0,0.0,0.0};
+#else
+ vector unsigned char vucer = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+ vector signed char vscer = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ vector unsigned short vuser = {7,7,7,7,7,7,7,7};
+ vector signed short vsser = {-4,-4,-4,-4,-4,-4,-4,-4};
+ vector unsigned int vuier = {2,2,2,2};
+ vector signed int vsier = {1,1,1,1};
+ vector float vfer = {-1.0,-1.0,-1.0,-1.0};
+#endif
+
+ vucr = vec_splat (vuc, 1);
+ vscr = vec_splat (vsc, 8);
+ vusr = vec_splat (vus, 7);
+ vssr = vec_splat (vss, 0);
+ vuir = vec_splat (vui, 2);
+ vsir = vec_splat (vsi, 3);
+ vfr = vec_splat (vf, 1);
+
+ check (vec_all_eq (vucr, vucer), "vuc");
+ check (vec_all_eq (vscr, vscer), "vsc");
+ check (vec_all_eq (vusr, vuser), "vus");
+ check (vec_all_eq (vssr, vsser), "vss");
+ check (vec_all_eq (vuir, vuier), "vui");
+ check (vec_all_eq (vsir, vsier), "vsi");
+ check (vec_all_eq (vfr, vfer ), "vf");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c
new file mode 100644
index 000000000..cd389bd0f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c
@@ -0,0 +1,37 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector float vf = {-2.0,-1.0,0.0,1.0};
+
+ /* Result vectors. */
+ vector unsigned int vuir;
+ vector signed int vsir;
+ vector float vfr;
+
+ /* Expected result vectors. */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned int vuier = {1,1,1,1};
+ vector signed int vsier = {-2,-2,-2,-2};
+ vector float vfer = {0.0,0.0,0.0,0.0};
+#else
+ vector unsigned int vuier = {2,2,2,2};
+ vector signed int vsier = {1,1,1,1};
+ vector float vfer = {-1.0,-1.0,-1.0,-1.0};
+#endif
+
+ vuir = vec_splat (vui, 2);
+ vsir = vec_splat (vsi, 3);
+ vfr = vec_splat (vf, 1);
+
+ check (vec_all_eq (vuir, vuier), "vui");
+ check (vec_all_eq (vsir, vsier), "vsi");
+ check (vec_all_eq (vfr, vfer ), "vf");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-vsx.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-vsx.c
new file mode 100644
index 000000000..5a6e7dfe4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat-vsx.c
@@ -0,0 +1,31 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector float vf = {-2.0,-1.0,0.0,1.0};
+
+ /* Result vectors. */
+ vector unsigned int vuir;
+ vector signed int vsir;
+ vector float vfr;
+
+ /* Expected result vectors. */
+ vector unsigned int vuier = {2,2,2,2};
+ vector signed int vsier = {1,1,1,1};
+ vector float vfer = {-1.0,-1.0,-1.0,-1.0};
+
+ vuir = vec_splat (vui, 2);
+ vsir = vec_splat (vsi, 3);
+ vfr = vec_splat (vf, 1);
+
+ check (vec_all_eq (vuir, vuier), "vui");
+ check (vec_all_eq (vsir, vsier), "vsi");
+ check (vec_all_eq (vfr, vfer ), "vf");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat.c
new file mode 100644
index 000000000..e45974ac9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/splat.c
@@ -0,0 +1,47 @@
+#include "harness.h"
+
+static void test()
+{
+ /* Input vectors. */
+ vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector unsigned short vus = {0,1,2,3,4,5,6,7};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector float vf = {-2.0,-1.0,0.0,1.0};
+
+ /* Result vectors. */
+ vector unsigned char vucr;
+ vector signed char vscr;
+ vector unsigned short vusr;
+ vector signed short vssr;
+ vector unsigned int vuir;
+ vector signed int vsir;
+ vector float vfr;
+
+ /* Expected result vectors. */
+ vector unsigned char vucer = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+ vector signed char vscer = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ vector unsigned short vuser = {7,7,7,7,7,7,7,7};
+ vector signed short vsser = {-4,-4,-4,-4,-4,-4,-4,-4};
+ vector unsigned int vuier = {2,2,2,2};
+ vector signed int vsier = {1,1,1,1};
+ vector float vfer = {-1.0,-1.0,-1.0,-1.0};
+
+ vucr = vec_splat (vuc, 1);
+ vscr = vec_splat (vsc, 8);
+ vusr = vec_splat (vus, 7);
+ vssr = vec_splat (vss, 0);
+ vuir = vec_splat (vui, 2);
+ vsir = vec_splat (vsi, 3);
+ vfr = vec_splat (vf, 1);
+
+ check (vec_all_eq (vucr, vucer), "vuc");
+ check (vec_all_eq (vscr, vscer), "vsc");
+ check (vec_all_eq (vusr, vuser), "vus");
+ check (vec_all_eq (vssr, vsser), "vss");
+ check (vec_all_eq (vuir, vuier), "vui");
+ check (vec_all_eq (vsir, vsier), "vsi");
+ check (vec_all_eq (vfr, vfer ), "vf");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-be-order.c
new file mode 100644
index 000000000..1a7b01bb5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-be-order.c
@@ -0,0 +1,83 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned char svbc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned short svbs[8] __attribute__ ((aligned (16)));
+static unsigned short svp[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static unsigned int svbi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ check (svuc[i] == i, "svuc");
+ check (svsc[i] == i - 8, "svsc");
+ check (svbc[i] == ((i % 2) ? 0xff : 0), "svbc");
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ check (svus[i] == i, "svus");
+ check (svss[i] == i - 4, "svss");
+ check (svbs[i] == ((i % 2) ? 0xffff : 0), "svbs");
+ check (svp[i] == i, "svp");
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ check (svui[i] == i, "svui");
+ check (svsi[i] == i - 2, "svsi");
+ check (svbi[i] == ((i % 2) ? 0xffffffff : 0), "svbi");
+ check (svf[i] == i * 1.0f, "svf");
+ }
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char vuc = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+ vector signed char vsc = {7,6,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7,-8};
+ vector bool char vbc = {255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0};
+ vector unsigned short vus = {7,6,5,4,3,2,1,0};
+ vector signed short vss = {3,2,1,0,-1,-2,-3,-4};
+ vector bool short vbs = {65535,0,65535,0,65535,0,65535,0};
+ vector pixel vp = {7,6,5,4,3,2,1,0};
+ vector unsigned int vui = {3,2,1,0};
+ vector signed int vsi = {1,0,-1,-2};
+ vector bool int vbi = {0xffffffff,0,0xffffffff,0};
+ vector float vf = {3.0,2.0,1.0,0.0};
+#else
+ vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char vbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
+ vector unsigned short vus = {0,1,2,3,4,5,6,7};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short vbs = {0,65535,0,65535,0,65535,0,65535};
+ vector pixel vp = {0,1,2,3,4,5,6,7};
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector bool int vbi = {0,0xffffffff,0,0xffffffff};
+ vector float vf = {0.0,1.0,2.0,3.0};
+#endif
+
+ vec_st (vuc, 0, (vector unsigned char *)svuc);
+ vec_st (vsc, 0, (vector signed char *)svsc);
+ vec_st (vbc, 0, (vector bool char *)svbc);
+ vec_st (vus, 0, (vector unsigned short *)svus);
+ vec_st (vss, 0, (vector signed short *)svss);
+ vec_st (vbs, 0, (vector bool short *)svbs);
+ vec_st (vp, 0, (vector pixel *)svp);
+ vec_st (vui, 0, (vector unsigned int *)svui);
+ vec_st (vsi, 0, (vector signed int *)svsi);
+ vec_st (vbi, 0, (vector bool int *)svbi);
+ vec_st (vf, 0, (vector float *)svf);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c
new file mode 100644
index 000000000..a2688fab5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c
@@ -0,0 +1,34 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static unsigned long long svul[2] __attribute__ ((aligned (16)));
+static double svd[2] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ check (svul[i] == i, "svul");
+ check (svd[i] == i * 1.0, "svd");
+ }
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned long long vul = {1,0};
+ vector double vd = {1.0,0.0};
+#else
+ vector unsigned long long vul = {0,1};
+ vector double vd = {0.0,1.0};
+#endif
+
+ vec_st (vul, 0, (vector unsigned long long *)svul);
+ vec_st (vd, 0, (vector double *)svd);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-vsx.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-vsx.c
new file mode 100644
index 000000000..ef67de0ba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st-vsx.c
@@ -0,0 +1,29 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static unsigned long long svul[2] __attribute__ ((aligned (16)));
+static double svd[2] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ check (svul[i] == i, "svul");
+ check (svd[i] == i * 1.0, "svd");
+ }
+}
+
+static void test ()
+{
+ vector unsigned long long vul = {0,1};
+ vector double vd = {0.0,1.0};
+
+ vec_st (vul, 0, (vector unsigned long long *)svul);
+ vec_st (vd, 0, (vector double *)svd);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st.c
new file mode 100644
index 000000000..3339b7283
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/st.c
@@ -0,0 +1,67 @@
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned char svbc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned short svbs[8] __attribute__ ((aligned (16)));
+static unsigned short svp[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static unsigned int svbi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ check (svuc[i] == i, "svuc");
+ check (svsc[i] == i - 8, "svsc");
+ check (svbc[i] == ((i % 2) ? 0xff : 0), "svbc");
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ check (svus[i] == i, "svus");
+ check (svss[i] == i - 4, "svss");
+ check (svbs[i] == ((i % 2) ? 0xffff : 0), "svbs");
+ check (svp[i] == i, "svp");
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ check (svui[i] == i, "svui");
+ check (svsi[i] == i - 2, "svsi");
+ check (svbi[i] == ((i % 2) ? 0xffffffff : 0), "svbi");
+ check (svf[i] == i * 1.0f, "svf");
+ }
+}
+
+static void test ()
+{
+ vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char vbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
+ vector unsigned short vus = {0,1,2,3,4,5,6,7};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short vbs = {0,65535,0,65535,0,65535,0,65535};
+ vector pixel vp = {0,1,2,3,4,5,6,7};
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector bool int vbi = {0,0xffffffff,0,0xffffffff};
+ vector float vf = {0.0,1.0,2.0,3.0};
+
+ vec_st (vuc, 0, (vector unsigned char *)svuc);
+ vec_st (vsc, 0, (vector signed char *)svsc);
+ vec_st (vbc, 0, (vector bool char *)svbc);
+ vec_st (vus, 0, (vector unsigned short *)svus);
+ vec_st (vss, 0, (vector signed short *)svss);
+ vec_st (vbs, 0, (vector bool short *)svbs);
+ vec_st (vp, 0, (vector pixel *)svp);
+ vec_st (vui, 0, (vector unsigned int *)svui);
+ vec_st (vsi, 0, (vector signed int *)svsi);
+ vec_st (vbi, 0, (vector bool int *)svbi);
+ vec_st (vf, 0, (vector float *)svf);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ste-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ste-be-order.c
new file mode 100644
index 000000000..75f2004f3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ste-be-order.c
@@ -0,0 +1,53 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ check (svuc[9] == 9, "svuc");
+ check (svsc[14] == 6, "svsc");
+ check (svus[7] == 7, "svus");
+ check (svss[1] == -3, "svss");
+ check (svui[3] == 3, "svui");
+ check (svsi[2] == 0, "svsi");
+ check (svf[0] == 0.0, "svf");
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char vuc = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+ vector signed char vsc = {7,6,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7,-8};
+ vector unsigned short vus = {7,6,5,4,3,2,1,0};
+ vector signed short vss = {3,2,1,0,-1,-2,-3,-4};
+ vector unsigned int vui = {3,2,1,0};
+ vector signed int vsi = {1,0,-1,-2};
+ vector float vf = {3.0,2.0,1.0,0.0};
+#else
+ vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector unsigned short vus = {0,1,2,3,4,5,6,7};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector float vf = {0.0,1.0,2.0,3.0};
+#endif
+
+ vec_ste (vuc, 9*1, (unsigned char *)svuc);
+ vec_ste (vsc, 14*1, (signed char *)svsc);
+ vec_ste (vus, 7*2, (unsigned short *)svus);
+ vec_ste (vss, 1*2, (signed short *)svss);
+ vec_ste (vui, 3*4, (unsigned int *)svui);
+ vec_ste (vsi, 2*4, (signed int *)svsi);
+ vec_ste (vf, 0*4, (float *)svf);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ste.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ste.c
new file mode 100644
index 000000000..9bbda3b32
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/ste.c
@@ -0,0 +1,41 @@
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ check (svuc[9] == 9, "svuc");
+ check (svsc[14] == 6, "svsc");
+ check (svus[7] == 7, "svus");
+ check (svss[1] == -3, "svss");
+ check (svui[3] == 3, "svui");
+ check (svsi[2] == 0, "svsi");
+ check (svf[0] == 0.0, "svf");
+}
+
+static void test ()
+{
+ vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector unsigned short vus = {0,1,2,3,4,5,6,7};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector float vf = {0.0,1.0,2.0,3.0};
+
+ vec_ste (vuc, 9*1, (unsigned char *)svuc);
+ vec_ste (vsc, 14*1, (signed char *)svsc);
+ vec_ste (vus, 7*2, (unsigned short *)svus);
+ vec_ste (vss, 1*2, (signed short *)svss);
+ vec_ste (vui, 3*4, (unsigned int *)svui);
+ vec_ste (vsi, 2*4, (signed int *)svsi);
+ vec_ste (vf, 0*4, (float *)svf);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-be-order.c
new file mode 100644
index 000000000..7f00a0364
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-be-order.c
@@ -0,0 +1,83 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned char svbc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned short svbs[8] __attribute__ ((aligned (16)));
+static unsigned short svp[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static unsigned int svbi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ check (svuc[i] == i, "svuc");
+ check (svsc[i] == i - 8, "svsc");
+ check (svbc[i] == ((i % 2) ? 0xff : 0), "svbc");
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ check (svus[i] == i, "svus");
+ check (svss[i] == i - 4, "svss");
+ check (svbs[i] == ((i % 2) ? 0xffff : 0), "svbs");
+ check (svp[i] == i, "svp");
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ check (svui[i] == i, "svui");
+ check (svsi[i] == i - 2, "svsi");
+ check (svbi[i] == ((i % 2) ? 0xffffffff : 0), "svbi");
+ check (svf[i] == i * 1.0f, "svf");
+ }
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned char vuc = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+ vector signed char vsc = {7,6,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7,-8};
+ vector bool char vbc = {255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0};
+ vector unsigned short vus = {7,6,5,4,3,2,1,0};
+ vector signed short vss = {3,2,1,0,-1,-2,-3,-4};
+ vector bool short vbs = {65535,0,65535,0,65535,0,65535,0};
+ vector pixel vp = {7,6,5,4,3,2,1,0};
+ vector unsigned int vui = {3,2,1,0};
+ vector signed int vsi = {1,0,-1,-2};
+ vector bool int vbi = {0xffffffff,0,0xffffffff,0};
+ vector float vf = {3.0,2.0,1.0,0.0};
+#else
+ vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char vbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
+ vector unsigned short vus = {0,1,2,3,4,5,6,7};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short vbs = {0,65535,0,65535,0,65535,0,65535};
+ vector pixel vp = {0,1,2,3,4,5,6,7};
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector bool int vbi = {0,0xffffffff,0,0xffffffff};
+ vector float vf = {0.0,1.0,2.0,3.0};
+#endif
+
+ vec_stl (vuc, 0, (vector unsigned char *)svuc);
+ vec_stl (vsc, 0, (vector signed char *)svsc);
+ vec_stl (vbc, 0, (vector bool char *)svbc);
+ vec_stl (vus, 0, (vector unsigned short *)svus);
+ vec_stl (vss, 0, (vector signed short *)svss);
+ vec_stl (vbs, 0, (vector bool short *)svbs);
+ vec_stl (vp, 0, (vector pixel *)svp);
+ vec_stl (vui, 0, (vector unsigned int *)svui);
+ vec_stl (vsi, 0, (vector signed int *)svsi);
+ vec_stl (vbi, 0, (vector bool int *)svbi);
+ vec_stl (vf, 0, (vector float *)svf);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c
new file mode 100644
index 000000000..26f2c2772
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c
@@ -0,0 +1,34 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static unsigned long long svul[2] __attribute__ ((aligned (16)));
+static double svd[2] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ check (svul[i] == i, "svul");
+ check (svd[i] == i * 1.0, "svd");
+ }
+}
+
+static void test ()
+{
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector unsigned long long vul = {1,0};
+ vector double vd = {1.0,0.0};
+#else
+ vector unsigned long long vul = {0,1};
+ vector double vd = {0.0,1.0};
+#endif
+
+ vec_stl (vul, 0, (vector unsigned long long *)svul);
+ vec_stl (vd, 0, (vector double *)svd);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-vsx.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-vsx.c
new file mode 100644
index 000000000..9a1cce6f8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl-vsx.c
@@ -0,0 +1,29 @@
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx" } */
+
+#include "harness.h"
+
+static unsigned long long svul[2] __attribute__ ((aligned (16)));
+static double svd[2] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ unsigned int i;
+ for (i = 0; i < 2; ++i)
+ {
+ check (svul[i] == i, "svul");
+ check (svd[i] == i * 1.0, "svd");
+ }
+}
+
+static void test ()
+{
+ vector unsigned long long vul = {0,1};
+ vector double vd = {0.0,1.0};
+
+ vec_stl (vul, 0, (vector unsigned long long *)svul);
+ vec_stl (vd, 0, (vector double *)svd);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl.c
new file mode 100644
index 000000000..9ebd8782a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/stl.c
@@ -0,0 +1,67 @@
+#include "harness.h"
+
+static unsigned char svuc[16] __attribute__ ((aligned (16)));
+static signed char svsc[16] __attribute__ ((aligned (16)));
+static unsigned char svbc[16] __attribute__ ((aligned (16)));
+static unsigned short svus[8] __attribute__ ((aligned (16)));
+static signed short svss[8] __attribute__ ((aligned (16)));
+static unsigned short svbs[8] __attribute__ ((aligned (16)));
+static unsigned short svp[8] __attribute__ ((aligned (16)));
+static unsigned int svui[4] __attribute__ ((aligned (16)));
+static signed int svsi[4] __attribute__ ((aligned (16)));
+static unsigned int svbi[4] __attribute__ ((aligned (16)));
+static float svf[4] __attribute__ ((aligned (16)));
+
+static void check_arrays ()
+{
+ unsigned int i;
+ for (i = 0; i < 16; ++i)
+ {
+ check (svuc[i] == i, "svuc");
+ check (svsc[i] == i - 8, "svsc");
+ check (svbc[i] == ((i % 2) ? 0xff : 0), "svbc");
+ }
+ for (i = 0; i < 8; ++i)
+ {
+ check (svus[i] == i, "svus");
+ check (svss[i] == i - 4, "svss");
+ check (svbs[i] == ((i % 2) ? 0xffff : 0), "svbs");
+ check (svp[i] == i, "svp");
+ }
+ for (i = 0; i < 4; ++i)
+ {
+ check (svui[i] == i, "svui");
+ check (svsi[i] == i - 2, "svsi");
+ check (svbi[i] == ((i % 2) ? 0xffffffff : 0), "svbi");
+ check (svf[i] == i * 1.0f, "svf");
+ }
+}
+
+static void test ()
+{
+ vector unsigned char vuc = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char vbc = {0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255};
+ vector unsigned short vus = {0,1,2,3,4,5,6,7};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short vbs = {0,65535,0,65535,0,65535,0,65535};
+ vector pixel vp = {0,1,2,3,4,5,6,7};
+ vector unsigned int vui = {0,1,2,3};
+ vector signed int vsi = {-2,-1,0,1};
+ vector bool int vbi = {0,0xffffffff,0,0xffffffff};
+ vector float vf = {0.0,1.0,2.0,3.0};
+
+ vec_stl (vuc, 0, (vector unsigned char *)svuc);
+ vec_stl (vsc, 0, (vector signed char *)svsc);
+ vec_stl (vbc, 0, (vector bool char *)svbc);
+ vec_stl (vus, 0, (vector unsigned short *)svus);
+ vec_stl (vss, 0, (vector signed short *)svss);
+ vec_stl (vbs, 0, (vector bool short *)svbs);
+ vec_stl (vp, 0, (vector pixel *)svp);
+ vec_stl (vui, 0, (vector unsigned int *)svui);
+ vec_stl (vsi, 0, (vector signed int *)svsi);
+ vec_stl (vbi, 0, (vector bool int *)svbi);
+ vec_stl (vf, 0, (vector float *)svf);
+
+ check_arrays ();
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c
new file mode 100644
index 000000000..0981cc1d5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c
@@ -0,0 +1,19 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ vector signed int vsia = {-10,1,2,3};
+ vector signed int vsib = {100,101,102,-103};
+ vector signed int vsir;
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector signed int vsier = {91,0,107,0};
+#else
+ vector signed int vsier = {0,92,0,-98};
+#endif
+
+ vsir = vec_sum2s (vsia, vsib);
+
+ check (vec_all_eq (vsir, vsier), "vsir");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sum2s.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sum2s.c
new file mode 100644
index 000000000..ded05be84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/sum2s.c
@@ -0,0 +1,13 @@
+#include "harness.h"
+
+static void test()
+{
+ vector signed int vsia = {-10,1,2,3};
+ vector signed int vsib = {100,101,102,-103};
+ vector signed int vsir;
+ vector signed int vsier = {0,92,0,-98};
+
+ vsir = vec_sum2s (vsia, vsib);
+
+ check (vec_all_eq (vsir, vsier), "vsir");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/t.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/t.c
new file mode 100644
index 000000000..3a7d5a94a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/t.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+#include <altivec.h>
+typedef unsigned long size_t;
+vector signed int T_vec_s32;
+void *T_void_ptr;
+const void *T_const_void_ptr;
+size_t T_size_t;
+char *T_char_ptr;
+vector signed short T_vec_s16;
+vector signed char T_vec_s8;
+vector unsigned short T_vec_u16;
+vector unsigned int T_vec_u32;
+vector unsigned char T_vec_u8;
+vector float T_vec_f32;
+int T_int;
+float *T_float_ptr;
+void f(void);
+short *T_short_ptr;
+vector signed short *T_vec_s16_ptr;
+int *T_int_ptr;
+vector signed int *T_vec_s32_ptr;
+signed char *T_signed_char_ptr;
+vector signed char *T_vec_s8_ptr;
+unsigned short *T_unsigned_short_ptr;
+vector unsigned short *T_vec_u16_ptr;
+unsigned int *T_unsigned_int_ptr;
+vector unsigned int *T_vec_u32_ptr;
+unsigned char *T_unsigned_char_ptr;
+vector unsigned char *T_vec_u8_ptr;
+double T_double;
+int T_intb;
+vector bool short *T_vec_b16_ptr;
+vector bool int *T_vec_b32_ptr;
+vector bool char *T_vec_b8_ptr;
+vector float *T_vec_f32_ptr;
+vector pixel *T_vec_p16_ptr;
+vector bool short T_vec_b16;
+vector pixel T_vec_p16;
+vector bool int T_vec_b32;
+vector bool char T_vec_b8;
+float T_float;
+volatile void g(void);
+const char *T_const_char_ptr;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/unpack-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/unpack-be-order.c
new file mode 100644
index 000000000..e174433dd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/unpack-be-order.c
@@ -0,0 +1,88 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+#define BIG 4294967295
+
+static void test()
+{
+ /* Input vectors. */
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char vbc = {0,255,255,0,0,0,255,0,255,0,0,255,255,255,0,255};
+ vector pixel vp = {(0<<15) + (1<<10) + (2<<5) + 3,
+ (1<<15) + (4<<10) + (5<<5) + 6,
+ (0<<15) + (7<<10) + (8<<5) + 9,
+ (1<<15) + (10<<10) + (11<<5) + 12,
+ (1<<15) + (13<<10) + (14<<5) + 15,
+ (0<<15) + (16<<10) + (17<<5) + 18,
+ (1<<15) + (19<<10) + (20<<5) + 21,
+ (0<<15) + (22<<10) + (23<<5) + 24};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short vbs = {0,65535,65535,0,0,0,65535,0};
+
+ /* Result vectors. */
+ vector signed short vsch, vscl;
+ vector bool short vbsh, vbsl;
+ vector unsigned int vuih, vuil;
+ vector signed int vsih, vsil;
+ vector bool int vbih, vbil;
+
+ /* Expected result vectors. */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector signed short vschr = {0,1,2,3,4,5,6,7};
+ vector signed short vsclr = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector bool short vbshr = {65535,0,0,65535,65535,65535,0,65535};
+ vector bool short vbslr = {0,65535,65535,0,0,0,65535,0};
+ vector unsigned int vuihr = {(65535<<24) + (13<<16) + (14<<8) + 15,
+ (0<<24) + (16<<16) + (17<<8) + 18,
+ (65535<<24) + (19<<16) + (20<<8) + 21,
+ (0<<24) + (22<<16) + (23<<8) + 24};
+ vector unsigned int vuilr = {(0<<24) + (1<<16) + (2<<8) + 3,
+ (65535<<24) + (4<<16) + (5<<8) + 6,
+ (0<<24) + (7<<16) + (8<<8) + 9,
+ (65535<<24) + (10<<16) + (11<<8) + 12};
+ vector signed int vsihr = {0,1,2,3};
+ vector signed int vsilr = {-4,-3,-2,-1};
+ vector bool int vbihr = {0,0,BIG,0};
+ vector bool int vbilr = {0,BIG,BIG,0};
+#else
+ vector signed short vschr = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed short vsclr = {0,1,2,3,4,5,6,7};
+ vector bool short vbshr = {0,65535,65535,0,0,0,65535,0};
+ vector bool short vbslr = {65535,0,0,65535,65535,65535,0,65535};
+ vector unsigned int vuihr = {(0<<24) + (1<<16) + (2<<8) + 3,
+ (65535<<24) + (4<<16) + (5<<8) + 6,
+ (0<<24) + (7<<16) + (8<<8) + 9,
+ (65535<<24) + (10<<16) + (11<<8) + 12};
+ vector unsigned int vuilr = {(65535<<24) + (13<<16) + (14<<8) + 15,
+ (0<<24) + (16<<16) + (17<<8) + 18,
+ (65535<<24) + (19<<16) + (20<<8) + 21,
+ (0<<24) + (22<<16) + (23<<8) + 24};
+ vector signed int vsihr = {-4,-3,-2,-1};
+ vector signed int vsilr = {0,1,2,3};
+ vector bool int vbihr = {0,BIG,BIG,0};
+ vector bool int vbilr = {0,0,BIG,0};
+#endif
+
+ vsch = vec_unpackh (vsc);
+ vscl = vec_unpackl (vsc);
+ vbsh = vec_unpackh (vbc);
+ vbsl = vec_unpackl (vbc);
+ vuih = vec_unpackh (vp);
+ vuil = vec_unpackl (vp);
+ vsih = vec_unpackh (vss);
+ vsil = vec_unpackl (vss);
+ vbih = vec_unpackh (vbs);
+ vbil = vec_unpackl (vbs);
+
+ check (vec_all_eq (vsch, vschr), "vsch");
+ check (vec_all_eq (vscl, vsclr), "vscl");
+ check (vec_all_eq (vbsh, vbshr), "vbsh");
+ check (vec_all_eq (vbsl, vbslr), "vbsl");
+ check (vec_all_eq (vuih, vuihr), "vuih");
+ check (vec_all_eq (vuil, vuilr), "vuil");
+ check (vec_all_eq (vsih, vsihr), "vsih");
+ check (vec_all_eq (vsil, vsilr), "vsil");
+ check (vec_all_eq (vbih, vbihr), "vbih");
+ check (vec_all_eq (vbil, vbilr), "vbil");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/unpack.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/unpack.c
new file mode 100644
index 000000000..3c13163cb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/unpack.c
@@ -0,0 +1,67 @@
+#include "harness.h"
+
+#define BIG 4294967295
+
+static void test()
+{
+ /* Input vectors. */
+ vector signed char vsc = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
+ vector bool char vbc = {0,255,255,0,0,0,255,0,255,0,0,255,255,255,0,255};
+ vector pixel vp = {(0<<15) + (1<<10) + (2<<5) + 3,
+ (1<<15) + (4<<10) + (5<<5) + 6,
+ (0<<15) + (7<<10) + (8<<5) + 9,
+ (1<<15) + (10<<10) + (11<<5) + 12,
+ (1<<15) + (13<<10) + (14<<5) + 15,
+ (0<<15) + (16<<10) + (17<<5) + 18,
+ (1<<15) + (19<<10) + (20<<5) + 21,
+ (0<<15) + (22<<10) + (23<<5) + 24};
+ vector signed short vss = {-4,-3,-2,-1,0,1,2,3};
+ vector bool short vbs = {0,65535,65535,0,0,0,65535,0};
+
+ /* Result vectors. */
+ vector signed short vsch, vscl;
+ vector bool short vbsh, vbsl;
+ vector unsigned int vuih, vuil;
+ vector signed int vsih, vsil;
+ vector bool int vbih, vbil;
+
+ /* Expected result vectors. */
+ vector signed short vschr = {-8,-7,-6,-5,-4,-3,-2,-1};
+ vector signed short vsclr = {0,1,2,3,4,5,6,7};
+ vector bool short vbshr = {0,65535,65535,0,0,0,65535,0};
+ vector bool short vbslr = {65535,0,0,65535,65535,65535,0,65535};
+ vector unsigned int vuihr = {(0<<24) + (1<<16) + (2<<8) + 3,
+ (65535<<24) + (4<<16) + (5<<8) + 6,
+ (0<<24) + (7<<16) + (8<<8) + 9,
+ (65535<<24) + (10<<16) + (11<<8) + 12};
+ vector unsigned int vuilr = {(65535<<24) + (13<<16) + (14<<8) + 15,
+ (0<<24) + (16<<16) + (17<<8) + 18,
+ (65535<<24) + (19<<16) + (20<<8) + 21,
+ (0<<24) + (22<<16) + (23<<8) + 24};
+ vector signed int vsihr = {-4,-3,-2,-1};
+ vector signed int vsilr = {0,1,2,3};
+ vector bool int vbihr = {0,BIG,BIG,0};
+ vector bool int vbilr = {0,0,BIG,0};
+
+ vsch = vec_unpackh (vsc);
+ vscl = vec_unpackl (vsc);
+ vbsh = vec_unpackh (vbc);
+ vbsl = vec_unpackl (vbc);
+ vuih = vec_unpackh (vp);
+ vuil = vec_unpackl (vp);
+ vsih = vec_unpackh (vss);
+ vsil = vec_unpackl (vss);
+ vbih = vec_unpackh (vbs);
+ vbil = vec_unpackl (vbs);
+
+ check (vec_all_eq (vsch, vschr), "vsch");
+ check (vec_all_eq (vscl, vsclr), "vscl");
+ check (vec_all_eq (vbsh, vbshr), "vbsh");
+ check (vec_all_eq (vbsl, vbslr), "vbsl");
+ check (vec_all_eq (vuih, vuihr), "vuih");
+ check (vec_all_eq (vuil, vuilr), "vuil");
+ check (vec_all_eq (vsih, vsihr), "vsih");
+ check (vec_all_eq (vsil, vsilr), "vsil");
+ check (vec_all_eq (vbih, vbihr), "vbih");
+ check (vec_all_eq (vbil, vbilr), "vbil");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-1.c
new file mode 100644
index 000000000..596137464
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-1.c
@@ -0,0 +1,99 @@
+#include <altivec.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+typedef vector unsigned int T;
+
+extern void f1(int, ...);
+extern void f2(int, T, ...);
+extern void f3(int, T, T, ...);
+extern void f4(int, T, T, T);
+
+void printx(T a)
+{
+ union {
+ T v;
+ unsigned int a[4];
+ } u;
+ u.v = a;
+ printf("%d, %d, %d, %d\n", u.a[0], u.a[1], u.a[2], u.a[3]);
+}
+
+void f1(int a, ...)
+{
+ va_list ap;
+ va_start (ap, a);
+ while (a-- > 0)
+ printx(va_arg(ap, T));
+ va_end (ap);
+}
+
+void f2(int a, T b, ...)
+{
+ va_list ap;
+ printx(b);
+ a--;
+ va_start (ap, b);
+ while (a-- > 0)
+ printx(va_arg(ap, T));
+ va_end (ap);
+}
+
+void f3(int a, T b, T c, ...)
+{
+ va_list ap;
+ printx(b);
+ a--;
+ printx(c);
+ a--;
+ va_start (ap, c);
+ while (a-- > 0)
+ printx(va_arg(ap, T));
+ va_end (ap);
+}
+
+void f4(int a, T b, T c,
+ T d)
+{
+ printx(b);
+ a--;
+ printx(c);
+ a--;
+ printx(d);
+ a--;
+}
+
+int main()
+{
+ f4 (3,
+ ((T){1,1,1,1}),
+ ((T){2,2,2,2}),
+ ((T){3,3,3,3}));
+ f3 (3,
+ ((T){4,4,4,4}),
+ ((T){5,5,5,5}),
+ ((T){6,6,6,6}));
+ f2 (3,
+ ((T){7,7,7,7}),
+ ((T){8,8,8,8}),
+ ((T){9,9,9,9}));
+ f1 (3,
+ ((T){10,10,10,10}),
+ ((T){11,11,11,11}),
+ ((T){12,12,12,12}));
+ return 0;
+}
+
+/* { dg-output "1, 1, 1, 1(\n|\r\n|\r)" }
+ { dg-output "2, 2, 2, 2(\n|\r\n|\r)" }
+ { dg-output "3, 3, 3, 3(\n|\r\n|\r)" }
+ { dg-output "4, 4, 4, 4(\n|\r\n|\r)" }
+ { dg-output "5, 5, 5, 5(\n|\r\n|\r)" }
+ { dg-output "6, 6, 6, 6(\n|\r\n|\r)" }
+ { dg-output "7, 7, 7, 7(\n|\r\n|\r)" }
+ { dg-output "8, 8, 8, 8(\n|\r\n|\r)" }
+ { dg-output "9, 9, 9, 9(\n|\r\n|\r)" }
+ { dg-output "10, 10, 10, 10(\n|\r\n|\r)" }
+ { dg-output "11, 11, 11, 11(\n|\r\n|\r)" }
+ { dg-output "12, 12, 12, 12(\n|\r\n|\r)" }
+ */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-2.c
new file mode 100644
index 000000000..1df171529
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-2.c
@@ -0,0 +1,78 @@
+#include "harness.h"
+#include <stdarg.h>
+
+static void
+varargsn003(vector float p1, vector float p2, vector float p3, ...)
+{
+ va_list ap;
+ vector float i1;
+ vector float i2;
+ vector float i3;
+ vector float i4;
+ vector float i5;
+ vector float i6;
+ vector float i7;
+ vector float i8;
+ vector float i9;
+ vector float i10;
+ vector float i11;
+ vector float i12;
+ vector float i13;
+ vector float i14;
+ vector float i15;
+ int i16;
+
+ va_start(ap, p3);
+ i1 = p1;
+ i2 = p2;
+ i3 = p3;
+ i4 = va_arg(ap, vector float);
+ i5 = va_arg(ap, vector float);
+ i6 = va_arg(ap, vector float);
+ i7 = va_arg(ap, vector float);
+ i8 = va_arg(ap, vector float);
+ i9 = va_arg(ap, vector float);
+ i10 = va_arg(ap, vector float);
+ i11 = va_arg(ap, vector float);
+ i12 = va_arg(ap, vector float);
+ i13 = va_arg(ap, vector float);
+ i14 = va_arg(ap, vector float);
+ i15 = va_arg(ap, vector float);
+ i16 = va_arg(ap, int);
+ va_end(ap);
+
+ check(vec_all_eq(i1, ((vector float){1.14e+09, 4.29e+08, -1.58e+09, 1.66e+09})), "i1");
+ check(vec_all_eq(i2, ((vector float){-1.83e+09, -6.79e+08, 1.58e+09, -3.38e+08})), "i2");
+ check(vec_all_eq(i3, ((vector float){-1.19e+09, -4.27e+08, 6.84e+08, 1.21e+08})), "i3");
+ check(vec_all_eq(i4, ((vector float){1.47e+09, 9.17e+08, 3.45e+08, -1.17e+08})), "i4");
+ check(vec_all_eq(i5, ((vector float){3.08e+08, 1.2e+08, 1.73e+09, 1.77e+09})), "i5");
+ check(vec_all_eq(i6, ((vector float){1.89e+09, 2.06e+09, 2.64e+08, 1.05e+09})), "i6");
+ check(vec_all_eq(i7, ((vector float){5.45e+08, 1.37e+09, -8.2e+08, 4.32e+07})), "i7");
+ check(vec_all_eq(i8, ((vector float){3.47e+08, -1.66e+09, 1.25e+09, 1.53e+09})), "i8");
+ check(vec_all_eq(i9, ((vector float){-6.04e+08, 1.48e+09, -1.48e+09, 1.92e+09})), "i9");
+ check(vec_all_eq(i10, ((vector float){-1.66e+09, -8.92e+08, -3.78e+08, 2.11e+09})), "i10");
+ check(vec_all_eq(i11, ((vector float){-7.46e+08, 4.01e+08, -1.78e+09, 1.83e+09})), "i11");
+ check(vec_all_eq(i12, ((vector float){1.83e+09, 5.73e+08, -2.96e+08, -7.46e+08})), "i12");
+ check(vec_all_eq(i13, ((vector float){-2.01e+09, 9.89e+08, -1.92e+09, 2.09e+09})), "i13");
+ check(vec_all_eq(i14, ((vector float){1.95e+09, -2.41e+08, 2.67e+08, 1.67e+09})), "i14");
+ check(vec_all_eq(i15, ((vector float){-2.12e+09, 8.18e+08, 9.47e+08, -1.25e+09})), "i15");
+ check(i16 == -947264420, "i16");
+}
+
+static void test()
+{
+ varargsn003(((vector float){1.14e+09, 4.29e+08, -1.58e+09, 1.66e+09}),
+ ((vector float){-1.83e+09, -6.79e+08, 1.58e+09, -3.38e+08}),
+ ((vector float){-1.19e+09, -4.27e+08, 6.84e+08, 1.21e+08}),
+ ((vector float){1.47e+09, 9.17e+08, 3.45e+08, -1.17e+08}),
+ ((vector float){3.08e+08, 1.2e+08, 1.73e+09, 1.77e+09}),
+ ((vector float){1.89e+09, 2.06e+09, 2.64e+08, 1.05e+09}),
+ ((vector float){5.45e+08, 1.37e+09, -8.2e+08, 4.32e+07}),
+ ((vector float){3.47e+08, -1.66e+09, 1.25e+09, 1.53e+09}),
+ ((vector float){-6.04e+08, 1.48e+09, -1.48e+09, 1.92e+09}),
+ ((vector float){-1.66e+09, -8.92e+08, -3.78e+08, 2.11e+09}),
+ ((vector float){-7.46e+08, 4.01e+08, -1.78e+09, 1.83e+09}),
+ ((vector float){1.83e+09, 5.73e+08, -2.96e+08, -7.46e+08}),
+ ((vector float){-2.01e+09, 9.89e+08, -1.92e+09, 2.09e+09}),
+ ((vector float){1.95e+09, -2.41e+08, 2.67e+08, 1.67e+09}), ((vector float){-2.12e+09, 8.18e+08, 9.47e+08, -1.25e+09}), -947264420);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-3.c
new file mode 100644
index 000000000..be8b71bf9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-3.c
@@ -0,0 +1,75 @@
+#include "harness.h"
+#include <stdarg.h>
+
+typedef struct n_a
+{
+ signed char m1;
+ short m2;
+ int m3;
+ double m4;
+ vector float m5;
+}
+n_a;
+
+void
+varlistn_a(signed char p1, va_list ap)
+{
+ n_a q;
+ q.m1 = p1;
+ q.m2 = va_arg(ap, int);
+ q.m3 = va_arg(ap, int);
+ q.m4 = va_arg(ap, double);
+ q.m5 = va_arg(ap, vector float);
+
+ check(q.m1 == 77, "q.m1");
+ check(q.m2 == 1924, "q.m2");
+ check(q.m3 == -1471601920, "q.m3");
+ check(q.m4 == 3.65e+18, "q.m4");
+ check(vec_all_eq(q.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})), "q.m5");
+}
+
+void
+varargsn_a(signed char p1, ...)
+{
+ n_a r, s;
+ va_list ap;
+
+ va_start(ap, p1);
+ r.m1 = p1;
+ r.m2 = va_arg(ap, int);
+ r.m3 = va_arg(ap, int);
+ r.m4 = va_arg(ap, double);
+ r.m5 = va_arg(ap, vector float);
+ va_end(ap);
+
+ check(r.m1 == 77, "r.m1");
+ check(r.m2 == 1924, "r.m2");
+ check(r.m3 == -1471601920, "r.m3");
+ check(r.m4 == 3.65e+18, "r.m4");
+ check(vec_all_eq(r.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})), "r.m5");
+
+ va_start(ap, p1);
+ s.m1 = p1;
+ s.m2 = va_arg(ap, int);
+ s.m3 = va_arg(ap, int);
+ s.m4 = va_arg(ap, double);
+ s.m5 = va_arg(ap, vector float);
+ va_end(ap);
+
+ check(s.m1 == 77, "s.m1");
+ check(s.m2 == 1924, "s.m2");
+ check(s.m3 == -1471601920, "s.m3");
+ check(s.m4 == 3.65e+18, "s.m4");
+ check(vec_all_eq(s.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})), "s.m5");
+
+ va_start(ap, p1);
+ varlistn_a(p1, ap);
+ va_end(ap);
+}
+
+
+
+void test()
+{
+ varargsn_a(77, 1924, -1471601920, 3.65e+18, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08}));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-4.c
new file mode 100644
index 000000000..a17551953
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-4.c
@@ -0,0 +1,291 @@
+#include "harness.h"
+#include <stdarg.h>
+#include <stddef.h>
+#include <string.h>
+
+typedef struct n_a
+{
+ signed char m1;
+ short m2;
+ int m3;
+ double m4;
+ vector float m5;
+}
+n_a;
+
+static n_a gn_a;
+
+static int
+lay(char *p, int start, int end, int n)
+{
+ int b;
+ unsigned char ch;
+ unsigned int mask;
+
+ start *= 8;
+ end *= 8;
+ n *= 8;
+
+ for (b = 0; b + 8 <= start; b += 8)
+ {
+ ch = *p++;
+ if (ch != 0xff)
+ for (mask = 0x80; mask; b++, mask >>= 1)
+ if ((ch & mask) != mask)
+ return b;
+ }
+
+ if (b < start)
+ {
+ ch = *p++;
+ for (mask = 0x80; b < start; b++, mask >>= 1)
+ if ((ch & mask) != mask)
+ return b;
+ for (; mask && b < end; b++, mask >>= 1)
+ if ((ch & mask) != 0)
+ return b;
+ }
+
+ for (; b + 8 <= end; b += 8)
+ {
+ ch = *p++;
+ if (ch != 0)
+ for (mask = 0x80; mask; b++, mask >>= 1)
+ if ((ch & mask) != 0)
+ return b;
+ }
+
+ if (b < end)
+ {
+ ch = *p++;
+ for (mask = 0x80; b < end; b++, mask >>= 1)
+ if ((ch & mask) != 0)
+ return b;
+ for (; mask && b < n; b++, mask >>= 1)
+ if ((ch & mask) != mask)
+ return b;
+ }
+
+ for (; b + 8 <= n; b += 8)
+ {
+ ch = *p++;
+ if (ch != 0xff)
+ for (mask = 0x80; mask; b++, mask >>= 1)
+ if ((ch & mask) != mask)
+ return b;
+ }
+
+ return n;
+}
+
+static void
+initn_a(signed char p1, short p2, int p3, double p4, vector float p5)
+{
+ n_a i;
+
+ i.m1 = p1;
+ i.m2 = p2;
+ i.m3 = p3;
+ i.m4 = p4;
+ i.m5 = p5;
+
+ check(i.m1 == 77, "i.m1");
+ check(i.m2 == 1924, "i.m2");
+ check(i.m3 == -1471601920, "i.m3");
+ check(vec_all_eq(i.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "i.m5");
+
+ check(sizeof(n_a) == 32, "sizeof(n_a)");
+
+ check(offsetof(n_a, m1) == 0, "offsetof(m1)");
+ check(offsetof(n_a, m2) == 2, "offsetof(m2)");
+ check(offsetof(n_a, m3) == 4, "offsetof(m3)");
+ check(offsetof(n_a, m4) == 8, "offsetof(m4)");
+ check(offsetof(n_a, m5) == 16, "offsetof(m5)");
+
+ check(sizeof(i.m1) == 1, "sizeof(m1)");
+ check(sizeof(i.m2) == 2, "sizeof(m2)");
+ check(sizeof(i.m3) == 4, "sizeof(m3)");
+ check(sizeof(i.m4) == 8, "sizeof(m4)");
+ check(sizeof(i.m5) == 16, "sizeof(m5)");
+
+#define lay_check(field) do { \
+ memset((char *)&i, 0xFF, sizeof(i)); \
+ lay_reset(field); \
+ check(lay((char *)&i, \
+ offsetof(n_a, field), \
+ offsetof(n_a, field) + sizeof(i.field), \
+ sizeof(i)) == sizeof(i)*8, \
+ "lay(" #field ")"); \
+ } while (0)
+#define lay_reset(field) i.field = 0
+
+ lay_check(m1);
+ lay_check(m2);
+ lay_check(m3);
+ lay_check(m4);
+#undef lay_reset
+#define lay_reset(field) i.field = ((vector float){0,0,0,0})
+ lay_check(m5);
+
+#undef lay_check
+#undef lay_reset
+}
+
+n_a
+valuen_a(void)
+{
+ return gn_a;
+}
+
+n_a *
+addrn_a(void)
+{
+ return &gn_a;
+}
+
+static void
+eqn_a(n_a * a)
+{
+ check(a->m1 == 77, "a->m1");
+ check(a->m2 == 1924, "a->m2");
+ check(a->m3 == -1471601920, "a->m3");
+ check(vec_all_eq(a->m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "a->m5");
+}
+
+static void
+getsn_a(n_a * a)
+{
+ a->m1 = 77;
+ a->m2 = 1924;
+ a->m3 = -1471601920;
+ a->m4 = 3.65e+18;
+ a->m5 = ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08});
+}
+
+static void
+varlistn_a(signed char p1, va_list ap)
+{
+ n_a q;
+ q.m1 = p1;
+ q.m2 = va_arg(ap, int);
+ q.m3 = va_arg(ap, int);
+ q.m4 = va_arg(ap, double);
+ q.m5 = va_arg(ap, vector float);
+
+ check(q.m1 == 77, "q.m1");
+ check(q.m2 == 1924, "q.m2");
+ check(q.m3 == -1471601920, "q.m3");
+ check(vec_all_eq(q.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "q.m5");
+}
+
+static void
+varargsn_a(signed char p1, ...)
+{
+ n_a q, r;
+ va_list ap;
+
+ va_start(ap, p1);
+ q.m1 = p1;
+ q.m2 = va_arg(ap, int);
+ q.m3 = va_arg(ap, int);
+ q.m4 = va_arg(ap, double);
+ q.m5 = va_arg(ap, vector float);
+ va_end(ap);
+
+ check(q.m1 == 77, "q.m1");
+ check(q.m2 == 1924, "q.m2");
+ check(q.m3 == -1471601920, "q.m3");
+ check(vec_all_eq(q.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "q.m5");
+
+ va_start(ap, p1);
+ r.m1 = p1;
+ r.m2 = va_arg(ap, int);
+ r.m3 = va_arg(ap, int);
+ r.m4 = va_arg(ap, double);
+ r.m5 = va_arg(ap, vector float);
+ va_end(ap);
+
+ check(r.m1 == 77, "r.m1");
+ check(r.m2 == 1924, "r.m2");
+ check(r.m3 == -1471601920, "r.m3");
+ check(vec_all_eq(r.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "r.m5");
+
+ va_start(ap, p1);
+ varlistn_a(p1, ap);
+ va_end(ap);
+}
+
+static void
+test()
+{
+ static struct
+ {
+ char a;
+ n_a b;
+ }
+ s;
+ n_a v[3], a, *p;
+
+ static n_a i = { 77, 1924, -1471601920, 3.65e+18, {-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08} };
+
+ memset((char *)&(v), -1, sizeof(v));
+ v[1] = s.b;
+ check(lay((char *)&v, sizeof(n_a), sizeof(n_a)*2, sizeof(n_a)*3) == sizeof(n_a)*3*8,
+ "structure assignment");
+
+ check(i.m1 == 77, "i.m1");
+ check(i.m2 == 1924, "i.m2");
+ check(i.m3 == -1471601920, "i.m3");
+ check(vec_all_eq(i.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "i.m5");
+
+ initn_a(77, 1924, -1471601920, 3.65e+18, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08}));
+ varargsn_a(77, 1924, -1471601920, 3.65e+18, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08}));
+
+ gn_a.m1 = 77;
+ gn_a.m2 = 1924;
+ gn_a.m3 = -1471601920;
+ gn_a.m4 = 3.65e+18;
+ gn_a.m5 = ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08});
+ a = valuen_a();
+
+ check(a.m1 == 77, "a.m1");
+ check(a.m2 == 1924, "a.m2");
+ check(a.m3 == -1471601920, "a.m3");
+ check(vec_all_eq(a.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "a.m5");
+
+ p = addrn_a();
+
+ check(p->m1 == 77, "p->m1");
+ check(p->m2 == 1924, "p->m2");
+ check(p->m3 == -1471601920, "p->m3");
+ check(vec_all_eq(p->m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "p->m5");
+
+ eqn_a(&a);
+
+ check(gn_a.m1 == 77, "gn_a.m1");
+ check(gn_a.m2 == 1924, "gn_a.m2");
+ check(gn_a.m3 == -1471601920, "gn_a.m3");
+ check(vec_all_eq(gn_a.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "gn_a.m5");
+
+ getsn_a(&v[0]);
+ v[2].m1 = v[0].m1;
+ v[2].m2 = v[0].m2;
+ v[2].m3 = v[0].m3;
+ v[2].m4 = v[0].m4;
+ v[2].m5 = v[0].m5;
+
+ check(v[2].m1 == 77, "v[2].m1");
+ check(v[2].m2 == 1924, "v[2].m2");
+ check(v[2].m3 == -1471601920, "v[2].m3");
+ check(vec_all_eq(v[2].m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})),
+ "v[2].m5");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-5.c
new file mode 100644
index 000000000..ed551c2df
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-5.c
@@ -0,0 +1,71 @@
+#include "harness.h"
+#include <stdarg.h>
+
+typedef struct n025
+{
+ int m1;
+ double m2;
+ int m3;
+ vector signed int m4;
+}
+n025;
+
+static void
+varlistn025(int p1, double p2, va_list ap)
+{
+ n025 q;
+ q.m1 = p1;
+ q.m2 = p2;
+ q.m3 = va_arg(ap, int);
+ q.m4 = va_arg(ap, vector signed int);
+
+ check(q.m1 == 1363477585, "q.m1");
+ check(q.m2 == -8.72e+18, "q.m2");
+ check(q.m3 == 198652649, "q.m3");
+ check(vec_all_eq(q.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
+ "q.m5");
+}
+
+
+void
+varargsn025(int p1, double p2, ...)
+{
+ n025 r, s;
+ va_list ap;
+
+ va_start(ap, p2);
+ r.m1 = p1;
+ r.m2 = p2;
+ r.m3 = va_arg(ap, int);
+ r.m4 = va_arg(ap, vector signed int);
+ va_end(ap);
+
+ check(r.m1 == 1363477585, "r.m1");
+ check(r.m2 == -8.72e+18, "r.m2");
+ check(r.m3 == 198652649, "r.m3");
+ check(vec_all_eq(r.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
+ "r.m5");
+
+ va_start(ap, p2);
+ s.m1 = p1;
+ s.m2 = p2;
+ s.m3 = va_arg(ap, int);
+ s.m4 = va_arg(ap, vector signed int);
+ va_end(ap);
+
+ check(s.m1 == 1363477585, "s.m1");
+ check(s.m2 == -8.72e+18, "s.m2");
+ check(s.m3 == 198652649, "s.m3");
+ check(vec_all_eq(s.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
+ "s.m5");
+
+ va_start(ap, p2);
+ varlistn025(p1, p2, ap);
+ va_end(ap);
+}
+
+static void test()
+{
+ varargsn025(1363477585, -8.72e+18, 198652649,
+ ((vector signed int){323001541, -1353029458, 1756879633, -327031280}));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-6.c
new file mode 100644
index 000000000..b1f436fd0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-6.c
@@ -0,0 +1,35 @@
+#include "harness.h"
+#include <stdarg.h>
+
+typedef struct n025
+{
+ int m1;
+ double m2;
+ int m3;
+ vector signed int m4;
+}
+n025;
+
+static void
+varargsn025(int p1, double p2, ...)
+{
+ n025 q;
+ va_list ap;
+ va_start(ap, p2);
+ q.m1 = p1;
+ q.m2 = p2;
+ q.m3 = va_arg(ap, int);
+ q.m4 = va_arg(ap, vector signed int);
+ va_end(ap);
+
+ check(q.m1 == 1363477585, "q.m1");
+ check(q.m2 == -8.72e+18, "q.m2");
+ check(q.m3 == 198652649, "q.m3");
+ check(vec_all_eq(q.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
+ "q.m4");
+}
+
+static void test()
+{
+ varargsn025(1363477585, -8.72e+18, 198652649, ((vector signed int){323001541, -1353029458, 1756879633, -327031280}));
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-7.c
new file mode 100644
index 000000000..2a09d0ca0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/varargs-7.c
@@ -0,0 +1,83 @@
+#include "harness.h"
+#include <stdarg.h>
+
+static void
+varargsn001(vector unsigned int p1, vector unsigned int p2,
+ vector unsigned int p3, vector unsigned int p4,
+ vector unsigned int p5, vector unsigned int p6,
+ vector unsigned int p7, vector unsigned int p8,
+ vector unsigned int p9, vector unsigned int p10,
+ vector unsigned int p11, vector unsigned int p12,
+ vector unsigned int p13, ...)
+{
+ va_list ap;
+ vector unsigned int i1;
+ vector unsigned int i2;
+ vector unsigned int i3;
+ vector unsigned int i4;
+ vector unsigned int i5;
+ vector unsigned int i6;
+ vector unsigned int i7;
+ vector unsigned int i8;
+ vector unsigned int i9;
+ vector unsigned int i10;
+ vector unsigned int i11;
+ vector unsigned int i12;
+ vector unsigned int i13;
+ vector unsigned int i14;
+ int i15;
+
+ va_start(ap, p13);
+
+ i1 = p1;
+ i2 = p2;
+ i3 = p3;
+ i4 = p4;
+ i5 = p5;
+ i6 = p6;
+ i7 = p7;
+ i8 = p8;
+ i9 = p9;
+ i10 = p10;
+ i11 = p11;
+ i12 = p12;
+ i13 = p13;
+ i14 = va_arg(ap, vector unsigned int);
+ i15 = va_arg(ap, int);
+ va_end(ap);
+
+ check(vec_all_eq(i1, ((vector unsigned int){1,1,1,1})), "i1");
+ check(vec_all_eq(i2, ((vector unsigned int){2,2,2,2})), "i2");
+ check(vec_all_eq(i3, ((vector unsigned int){3,3,3,3})), "i3");
+ check(vec_all_eq(i4, ((vector unsigned int){4,4,4,4})), "i4");
+ check(vec_all_eq(i5, ((vector unsigned int){5,5,5,5})), "i5");
+ check(vec_all_eq(i6, ((vector unsigned int){6,6,6,6})), "i6");
+ check(vec_all_eq(i7, ((vector unsigned int){7,7,7,7})), "i7");
+ check(vec_all_eq(i8, ((vector unsigned int){8,8,8,8})), "i8");
+ check(vec_all_eq(i9, ((vector unsigned int){9,9,9,9})), "i9");
+ check(vec_all_eq(i10, ((vector unsigned int){10,10,10,10})), "i10");
+ check(vec_all_eq(i11, ((vector unsigned int){11,11,11,11})), "i11");
+ check(vec_all_eq(i12, ((vector unsigned int){12,12,12,12})), "i12");
+ check(vec_all_eq(i13, ((vector unsigned int){13,13,13,13})), "i13");
+ check(vec_all_eq(i14, ((vector unsigned int){14,14,14,14})), "i14");
+ check(i15 == 15, "i15");
+}
+
+static void test()
+{
+ varargsn001(((vector unsigned int){1,1,1,1}),
+ ((vector unsigned int){2,2,2,2}),
+ ((vector unsigned int){3,3,3,3}),
+ ((vector unsigned int){4,4,4,4}),
+ ((vector unsigned int){5,5,5,5}),
+ ((vector unsigned int){6,6,6,6}),
+ ((vector unsigned int){7,7,7,7}),
+ ((vector unsigned int){8,8,8,8}),
+ ((vector unsigned int){9,9,9,9}),
+ ((vector unsigned int){10,10,10,10}),
+ ((vector unsigned int){11,11,11,11}),
+ ((vector unsigned int){12,12,12,12}),
+ ((vector unsigned int){13,13,13,13}),
+ ((vector unsigned int){14,14,14,14}),
+ 15);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vec-set.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vec-set.c
new file mode 100644
index 000000000..fa11c47a1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vec-set.c
@@ -0,0 +1,14 @@
+#include "harness.h"
+
+vector short
+vec_set (short m)
+{
+ return (vector short){m, 0, 0, 0, 0, 0, 0, 0};
+}
+
+static void test()
+{
+ check (vec_all_eq (vec_set (7),
+ ((vector short){7, 0, 0, 0, 0, 0, 0, 0})),
+ "vec_set");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vmx.exp b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vmx.exp
new file mode 100644
index 000000000..b3c73e859
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vmx.exp
@@ -0,0 +1,57 @@
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Skip these tests for non-PowerPC targets and for targets where AltiVec
+# is not supported.
+if {![istarget powerpc*-*-*]
+ || ![check_effective_target_powerpc_altivec_ok] } {
+ return
+}
+
+# If a testcase doesn't have special options, use these.
+# -pedantic-errors is inappropriate here, as this subdirectory tests
+# nothing but extensions.
+global DEFAULT_VMXCFLAGS
+if ![info exists DEFAULT_VMXCFLAGS] then {
+ set DEFAULT_VMXCFLAGS "-maltivec -mabi=altivec -std=gnu99 -mno-vsx"
+}
+
+# If the target system supports AltiVec instructions, the default action
+# for a test is 'run', otherwise it's 'compile'.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+if { [check_vmx_hw_available ] } {
+ set dg-do-what-default run
+} else {
+ set dg-do-what-default compile
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] \
+ $DEFAULT_VMXCFLAGS
+
+# All done.
+dg-finish
+
+set dg-do-what-default ${save-dg-do-what-default}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vsums-be-order.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vsums-be-order.c
new file mode 100644
index 000000000..e4a34e9f9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vsums-be-order.c
@@ -0,0 +1,20 @@
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+
+#include "harness.h"
+
+static void test()
+{
+ vector signed int va = {-7,11,-13,17};
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ vector signed int vb = {128,0,0,0};
+ vector signed int evd = {136,0,0,0};
+#else
+ vector signed int vb = {0,0,0,128};
+ vector signed int evd = {0,0,0,136};
+#endif
+
+ vector signed int vd = vec_sums (va, vb);
+
+ check (vec_all_eq (vd, evd), "sums");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vsums.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vsums.c
new file mode 100644
index 000000000..d678aceec
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/vsums.c
@@ -0,0 +1,12 @@
+#include "harness.h"
+
+static void test()
+{
+ vector signed int va = {-7,11,-13,17};
+ vector signed int vb = {0,0,0,128};
+ vector signed int evd = {0,0,0,136};
+
+ vector signed int vd = vec_sums (va, vb);
+
+ check (vec_all_eq (vd, evd), "sums");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-01.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-01.c
new file mode 100644
index 000000000..324e83e35
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-01.c
@@ -0,0 +1,25 @@
+#include <altivec.h>
+vector bool char
+g(vector unsigned char, vector bool char);
+
+vector bool char
+f(vector bool char b, vector unsigned char d)
+{
+ vector bool char *p = &b;
+ *p = g(d,b);
+ return *p;
+}
+
+vector bool char b8;
+vector unsigned char u8;
+vector bool char
+g(vector unsigned char a, vector bool char b)
+{
+ return b8;
+}
+
+int main()
+{
+ f(b8, u8);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-02.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-02.c
new file mode 100644
index 000000000..4ddcc0c00
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-02.c
@@ -0,0 +1,34 @@
+#include <altivec.h>
+
+static vector bool char
+g(vector unsigned char, vector bool char);
+
+static int q(void);
+
+static vector bool char
+f(vector bool char b, vector unsigned char d)
+{
+ vector bool char *p = &b;
+ *p = g(d,b);
+ return q() ? *p : b;
+}
+
+static vector bool char b8;
+static vector unsigned char u8;
+
+static vector bool char
+g(vector unsigned char a, vector bool char b)
+{
+ return b8;
+}
+
+static int q ()
+{
+ return 1;
+}
+
+int main()
+{
+ f(b8, u8);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-03.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-03.c
new file mode 100644
index 000000000..0972ac9a3
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-03.c
@@ -0,0 +1,124 @@
+#include <altivec.h>
+extern vector unsigned char u8(void);
+extern vector signed char s8(void);
+extern vector bool char b8(void);
+extern vector unsigned short u16(void);
+extern vector signed short s16(void);
+extern vector bool short b16(void);
+extern vector unsigned int u32(void);
+extern vector signed int s32(void);
+extern vector bool int b32(void);
+extern vector float f32(void);
+extern vector pixel p16(void);
+
+extern void g(vector unsigned char, ...);
+
+void
+f(vector unsigned char u8p, vector signed char s8p, vector bool char b8p,
+ vector unsigned short u16p, vector signed short s16p,
+ vector bool short b16p, vector unsigned int u32p,
+ vector signed int s32p, vector bool int b32p,
+ vector float f32p, vector pixel p16p)
+{
+ vector unsigned char u8l = u8();
+ vector signed char s8l = s8();
+ vector bool char b8l = b8();
+ vector unsigned short u16l = u16();
+ vector signed short s16l = s16();
+ vector bool short b16l = b16();
+ vector unsigned int u32l = u32();
+ vector signed int s32l = s32();
+ vector bool int b32l = b32();
+ vector float f32l = f32();
+ vector pixel p16l = p16();
+
+ g(u8l, s8l, b8l, u16l, s16l, b16l, u32l, s32l, b32l, f32l, p16l);
+}
+
+vector unsigned char
+u8(void)
+{
+ static vector unsigned char zero;
+ return zero;
+}
+
+vector signed char
+s8(void)
+{
+ static vector signed char zero;
+ return zero;
+}
+
+vector bool char
+b8(void)
+{
+ static vector bool char zero;
+ return zero;
+}
+
+vector unsigned short
+u16(void)
+{
+ static vector unsigned short zero;
+ return zero;
+}
+
+vector signed short
+s16(void)
+{
+ static vector signed short zero;
+ return zero;
+}
+
+vector bool short
+b16(void)
+{
+ static vector bool short zero;
+ return zero;
+}
+
+vector unsigned int
+u32(void)
+{
+ static vector unsigned int zero;
+ return zero;
+}
+
+vector signed int
+s32(void)
+{
+ static vector signed int zero;
+ return zero;
+}
+
+vector bool int
+b32(void)
+{
+ static vector bool int zero;
+ return zero;
+}
+
+vector float
+f32(void)
+{
+ static vector float zero;
+ return zero;
+}
+
+vector pixel
+p16(void)
+{
+ static vector pixel zero;
+ return zero;
+}
+
+void
+g(vector unsigned char a, ...)
+{
+}
+
+int main()
+{
+ f(u8(), s8(), b8(), u16(), s16(), b16(), u32(), s32(), b32(), f32(), p16());
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-04.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-04.c
new file mode 100644
index 000000000..44694c8a6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-04.c
@@ -0,0 +1,80 @@
+#include <altivec.h>
+vector unsigned char
+permute_128(vector unsigned char input)
+{
+ vector unsigned char result, new_bit;
+
+ vector unsigned char select2 = ((vector unsigned char){2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2});
+ vector unsigned char select3 = ((vector unsigned char){4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4});
+ vector unsigned char select4 = ((vector unsigned char){8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8});
+ vector unsigned char select5 = ((vector unsigned char){16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16});
+ vector unsigned char select6 = ((vector unsigned char){32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32});
+ vector unsigned char select7 = ((vector unsigned char){64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64});
+ vector unsigned char select8 = ((vector unsigned char){128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128});
+
+ vector unsigned char control1
+ = ((vector unsigned char){15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0});
+ vector unsigned char control2
+ = ((vector unsigned char){15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0});
+ vector unsigned char control3
+ = ((vector unsigned char){15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0});
+ vector unsigned char control4
+ = ((vector unsigned char){15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0});
+ vector unsigned char control5
+ = ((vector unsigned char){15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0});
+ vector unsigned char control6
+ = ((vector unsigned char){15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0});
+ vector unsigned char control7
+ = ((vector unsigned char){15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0});
+ vector unsigned char control8
+ = ((vector unsigned char){15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0});
+ vector unsigned char rotate1 = ((vector unsigned char){1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1});
+ vector unsigned char rotate2 = ((vector unsigned char){3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3});
+ vector unsigned char rotate3 = ((vector unsigned char){5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5});
+ vector unsigned char rotate4 = ((vector unsigned char){7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7});
+ vector unsigned char rotate5 = ((vector unsigned char){1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1});
+ vector unsigned char rotate6 = ((vector unsigned char){3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3});
+ vector unsigned char rotate7 = ((vector unsigned char){5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5});
+ vector unsigned char rotate8 = ((vector unsigned char){7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7});
+
+ result = vec_vperm(input, input, control1);
+ result = vec_rl(result, rotate1);
+
+ new_bit = vec_vperm(input, input, control2);
+ new_bit = vec_rl(new_bit, rotate2);
+ result = vec_sel(result, new_bit, select2);
+
+ new_bit = vec_vperm(input, input, control3);
+ new_bit = vec_rl(new_bit, rotate3);
+ result = vec_sel(result, new_bit, select3);
+
+ new_bit = vec_vperm(input, input, control4);
+ new_bit = vec_rl(new_bit, rotate4);
+ result = vec_sel(result, new_bit, select4);
+
+ new_bit = vec_vperm(input, input, control5);
+ new_bit = vec_rl(new_bit, rotate5);
+ result = vec_sel(result, new_bit, select5);
+
+ new_bit = vec_vperm(input, input, control6);
+ new_bit = vec_rl(new_bit, rotate6);
+ result = vec_sel(result, new_bit, select6);
+
+ new_bit = vec_vperm(input, input, control7);
+ new_bit = vec_rl(new_bit, rotate7);
+ result = vec_sel(result, new_bit, select7);
+
+ new_bit = vec_vperm(input, input, control8);
+ new_bit = vec_rl(new_bit, rotate8);
+ result = vec_sel(result, new_bit, select8);
+
+ return result;
+}
+
+int main()
+{
+ vector unsigned char input
+ = ((vector unsigned char){0,1,2,4,8,16,32,64,128,0,1,2,4,8,16,32});
+ vector unsigned char result = permute_128(input);
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-05.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-05.c
new file mode 100644
index 000000000..80c13dcf0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/x-05.c
@@ -0,0 +1,82 @@
+#include <altivec.h>
+
+static vector unsigned char select2 = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
+static vector unsigned char select3 = {4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4};
+static vector unsigned char select4 = {8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8};
+static vector unsigned char select5 = {16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16};
+static vector unsigned char select6 = {32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32};
+static vector unsigned char select7 = {64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64};
+static vector unsigned char select8 = {128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128};
+
+static vector unsigned char control1
+ = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+static vector unsigned char control2
+ = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+static vector unsigned char control3
+ = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+static vector unsigned char control4
+ = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+static vector unsigned char control5
+ = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+static vector unsigned char control6
+ = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+static vector unsigned char control7
+ = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+static vector unsigned char control8
+ = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0};
+static vector unsigned char rotate1 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+static vector unsigned char rotate2 = {3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3};
+static vector unsigned char rotate3 = {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5};
+static vector unsigned char rotate4 = {7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7};
+static vector unsigned char rotate5 = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+static vector unsigned char rotate6 = {3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3};
+static vector unsigned char rotate7 = {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5};
+static vector unsigned char rotate8 = {7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7};
+
+static vector unsigned char permute_128(vector unsigned char input)
+{
+ vector unsigned char result, new_bit;
+
+ /* and now the code */
+ result = vec_vperm(input, input, control1);
+ result = vec_rl(result, rotate1);
+
+ new_bit = vec_vperm(input, input, control2);
+ new_bit = vec_rl(new_bit, rotate2);
+ result = vec_sel(result, new_bit, select2);
+
+ new_bit = vec_vperm(input, input, control3);
+ new_bit = vec_rl(new_bit, rotate3);
+ result = vec_sel(result, new_bit, select3);
+
+ new_bit = vec_vperm(input, input, control4);
+ new_bit = vec_rl(new_bit, rotate4);
+ result = vec_sel(result, new_bit, select4);
+
+ new_bit = vec_vperm(input, input, control5);
+ new_bit = vec_rl(new_bit, rotate5);
+ result = vec_sel(result, new_bit, select5);
+
+ new_bit = vec_vperm(input, input, control6);
+ new_bit = vec_rl(new_bit, rotate6);
+ result = vec_sel(result, new_bit, select6);
+
+ new_bit = vec_vperm(input, input, control7);
+ new_bit = vec_rl(new_bit, rotate7);
+ result = vec_sel(result, new_bit, select7);
+
+ new_bit = vec_vperm(input, input, control8);
+ new_bit = vec_rl(new_bit, rotate8);
+ result = vec_sel(result, new_bit, select8);
+
+ return result;
+}
+
+int main()
+{
+ vector unsigned char input
+ = {0,1,2,4,8,16,32,64,128,0,1,2,4,8,16,32};
+ vector unsigned char result = permute_128(input);
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/yousufi-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/yousufi-1.c
new file mode 100644
index 000000000..eed4be3d1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/yousufi-1.c
@@ -0,0 +1,15 @@
+#include "harness.h"
+
+/* Tests the vec_ctu function, which converts a vector of floats to a vector
+ of unsigned ints. In powerpc-eabisim-run ver. moto-1.0, vec_ctu produces
+ strange output for input values of less than ~.0039. -Umair */
+
+static void test()
+{
+ vector float input = ((vector float){0.003,0.003,0.003,0.003});
+ vector unsigned int output;
+ vector unsigned int expect = ((vector unsigned int){0,0,0,0});
+
+ output = vec_ctu(input, 1);
+ check(vec_all_eq(output, expect), "vec_ctu");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/zero-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/zero-1.c
new file mode 100644
index 000000000..637351cc5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/zero-1.c
@@ -0,0 +1,13 @@
+#include "harness.h"
+
+static vector unsigned int funny()
+{
+ vector unsigned int a;
+ return vec_andc(vec_add(a,a),vec_add(a,a));
+}
+
+static void test()
+{
+ static vector unsigned int zero;
+ check(vec_all_eq(funny(), zero), "funny");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vmx/zero.c b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/zero.c
new file mode 100644
index 000000000..9a337e6e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vmx/zero.c
@@ -0,0 +1,100 @@
+#include "harness.h"
+
+vector signed short zs16() { return ((vector signed short){0,0,0,0,0,0,0,0}); }
+vector signed short s16ss() { vector signed short a; return vec_subs(a,a); }
+vector signed short s16s() { vector signed short a; return vec_sub(a,a); }
+vector signed short s16x() { vector signed short a; return vec_xor(a,a); }
+vector signed short s16a() { vector signed short a; return vec_andc(a,a); }
+
+vector unsigned short zu16() { return ((vector unsigned short){0,0,0,0,0,0,0,0}); }
+vector unsigned short u16ss() { vector unsigned short a; return vec_subs(a,a); }
+vector unsigned short u16s() { vector unsigned short a; return vec_sub(a,a); }
+vector unsigned short u16x() { vector unsigned short a; return vec_xor(a,a); }
+vector unsigned short u16a() { vector unsigned short a; return vec_andc(a,a); }
+
+vector signed int zs32() { return ((vector signed int){0,0,0,0}); }
+vector signed int s32ss() { vector signed int a; return vec_subs(a,a); }
+vector signed int s32s() { vector signed int a; return vec_sub(a,a); }
+vector signed int s32x() { vector signed int a; return vec_xor(a,a); }
+vector signed int s32a() { vector signed int a; return vec_andc(a,a); }
+
+vector unsigned int zu32() { return ((vector unsigned int){0,0,0,0}); }
+vector unsigned int u32ss() { vector unsigned int a; return vec_subs(a,a); }
+vector unsigned int u32s() { vector unsigned int a; return vec_sub(a,a); }
+vector unsigned int u32x() { vector unsigned int a; return vec_xor(a,a); }
+vector unsigned int u32a() { vector unsigned int a; return vec_andc(a,a); }
+
+vector signed char zs8() { return ((vector signed char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}); }
+vector signed char s8ss() { vector signed char a; return vec_subs(a,a); }
+vector signed char s8s() { vector signed char a; return vec_sub(a,a); }
+vector signed char s8x() { vector signed char a; return vec_xor(a,a); }
+vector signed char s8a() { vector signed char a; return vec_andc(a,a); }
+
+vector unsigned char zu8() { return ((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}); }
+vector unsigned char u8ss() { vector unsigned char a; return vec_subs(a,a); }
+vector unsigned char u8s() { vector unsigned char a; return vec_sub(a,a); }
+vector unsigned char u8x() { vector unsigned char a; return vec_xor(a,a); }
+vector unsigned char u8a() { vector unsigned char a; return vec_andc(a,a); }
+
+vector pixel zp16() { return ((vector pixel){0,0,0,0,0,0,0,0}); }
+
+vector bool short zb16() { return ((vector bool short){0,0,0,0,0,0,0,0}); }
+
+vector bool short b16x() { vector bool short a; return vec_xor(a,a); }
+vector bool short b16a() { vector bool short a; return vec_andc(a,a); }
+vector bool int zb32() { return ((vector bool int){0,0,0,0}); }
+
+vector bool int b32x() { vector bool int a; return vec_xor(a,a); }
+vector bool int b32a() { vector bool int a; return vec_andc(a,a); }
+vector bool char zb8() { return ((vector bool char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}); }
+
+vector bool char b8x() { vector bool char a; return vec_xor(a,a); }
+vector bool char b8a() { vector bool char a; return vec_andc(a,a); }
+
+static void test()
+{
+ static vector unsigned int zerov;
+#define zcheck(val, tag) \
+ check(vec_all_eq((vector unsigned int)(val), zerov), tag)
+
+ zcheck(zs16(), "zs16");
+ zcheck(s16ss(), "s16ss");
+ zcheck(s16s(), "s16s");
+ zcheck(s16x(), "s16x");
+ zcheck(s16a(), "s16a");
+ zcheck(zu16(), "zu16");
+ zcheck(u16ss(), "u16ss");
+ zcheck(u16s(), "u16s");
+ zcheck(u16x(), "u16x");
+ zcheck(u16a(), "u16a");
+ zcheck(zs32(), "zs32");
+ zcheck(s32ss(), "s32ss");
+ zcheck(s32s(), "s32s");
+ zcheck(s32x(), "s32x");
+ zcheck(s32a(), "s32a");
+ zcheck(zu32(), "zu32");
+ zcheck(u32ss(), "u32ss");
+ zcheck(u32s(), "u32s");
+ zcheck(u32x(), "u32x");
+ zcheck(u32a(), "u32a");
+ zcheck(zs8(), "zs8");
+ zcheck(s8ss(), "s8ss");
+ zcheck(s8s(), "s8s");
+ zcheck(s8x(), "s8x");
+ zcheck(s8a(), "s8a");
+ zcheck(zu8(), "zu8");
+ zcheck(u8ss(), "u8ss");
+ zcheck(u8s(), "u8s");
+ zcheck(u8x(), "u8x");
+ zcheck(u8a(), "u8a");
+ zcheck(zp16(), "zp16");
+ zcheck(zb16(), "zb16");
+ zcheck(b16x(), "b16x");
+ zcheck(b16a(), "b16a");
+ zcheck(zb32(), "zb32");
+ zcheck(b32x(), "b32x");
+ zcheck(b32a(), "b32a");
+ zcheck(zb8(), "zb8");
+ zcheck(b8x(), "b8x");
+ zcheck(b8a(), "b8a");
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/void-cast-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/void-cast-1.c
new file mode 100644
index 000000000..bd4e7b3bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/void-cast-1.c
@@ -0,0 +1,11 @@
+/* Don't warn where the left-hand side of a comma expression is a
+ comma expression whose right-hand side is cast to void. Bug
+ 21159. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+int a, b, c, d;
+int e(void) { return (void)a, b; }
+int f(void) { return (void)a, (void)b, c; }
+int g(void) { return (void)a, (void)b, (void)c, d; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/void-cast-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/void-cast-2.c
new file mode 100644
index 000000000..7accebfb7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/void-cast-2.c
@@ -0,0 +1,8 @@
+/* Test further cases of warnings for comma expressions, with and
+ without casts to void. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+int a, b, c, d;
+int e(void) { return (char)a, b; } /* { dg-warning "left-hand operand of comma expression has no effect" } */
+int f(void) { return (a ? (void)b : (void)c), d; } /* { dg-warning "left-hand operand of comma expression has no effect" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/volatile-bitfields-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/volatile-bitfields-1.c
new file mode 100644
index 000000000..6adda27fe
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/volatile-bitfields-1.c
@@ -0,0 +1,23 @@
+/* { dg-options "-fstrict-volatile-bitfields" } */
+/* { dg-do run } */
+
+extern int puts(const char *);
+extern void abort(void) __attribute__((noreturn));
+
+typedef struct {
+ volatile unsigned short a:8, b:8;
+} BitStruct;
+
+BitStruct bits = {1, 2};
+
+void check(int i, int j)
+{
+ if (i != 1 || j != 2) puts("FAIL"), abort();
+}
+
+int main ()
+{
+ check(bits.a, bits.b);
+
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/volatile-bitfields-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/volatile-bitfields-2.c
new file mode 100644
index 000000000..a57cd7475
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/volatile-bitfields-2.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-fstrict-volatile-bitfields" } */
+
+extern void abort(void);
+struct thing {
+ volatile unsigned short a: 8;
+ volatile unsigned short b: 8;
+} t = {1,2};
+
+int main()
+{
+ t.a = 3;
+ if (t.a !=3 || t.b !=2) abort();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/volatile1.c b/gcc-4.9/gcc/testsuite/gcc.dg/volatile1.c
new file mode 100644
index 000000000..61a3979b7
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/volatile1.c
@@ -0,0 +1,9 @@
+/* PR c/12553: we were erroneously setting TREE_SIDE_EFFECTS on &y, which
+ confused tree-ssa. */
+
+void f()
+{
+ int x;
+ volatile int y;
+ &x == &y;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/volatile2.c b/gcc-4.9/gcc/testsuite/gcc.dg/volatile2.c
new file mode 100644
index 000000000..d663123c8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/volatile2.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+struct GTeth_desc
+{
+ unsigned ed_cmdsts;
+};
+struct GTeth_softc
+{
+ struct GTeth_desc txq_desc[32];
+};
+
+void foo(struct GTeth_softc *sc)
+{
+ /* Verify that we retain the volatileness on the
+ store until after optimization. */
+ volatile struct GTeth_desc *p = &sc->txq_desc[0];
+ p->ed_cmdsts = 0;
+}
+
+/* { dg-final { scan-tree-dump "{v}" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/volatile3.c b/gcc-4.9/gcc/testsuite/gcc.dg/volatile3.c
new file mode 100644
index 000000000..4a5893d97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/volatile3.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-ssa" } */
+
+volatile int *q;
+void foo(int i)
+{
+ volatile int a[2];
+ volatile int *p = &a[i];
+ q = p;
+}
+
+/* { dg-final { scan-tree-dump-not "{v}" "ssa" } } */
+/* { dg-final { cleanup-tree-dump "ssa" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vshift-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-1.c
new file mode 100644
index 000000000..2220ad5a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-1.c
@@ -0,0 +1,132 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+#include <stdlib.h>
+
+#define N 64
+
+#ifndef TYPE1
+#define TYPE1 int
+#define TYPE2 long long
+#endif
+
+signed TYPE1 a[N], b[N], g[N];
+unsigned TYPE1 c[N], h[N];
+signed TYPE2 d[N], e[N], j[N];
+unsigned TYPE2 f[N], k[N];
+
+__attribute__((noinline)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ g[i] = a[i] << b[i];
+}
+
+__attribute__((noinline)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ g[i] = a[i] >> b[i];
+}
+
+__attribute__((noinline)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ h[i] = c[i] >> b[i];
+}
+
+__attribute__((noinline)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ j[i] = d[i] << e[i];
+}
+
+__attribute__((noinline)) void
+f5 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ j[i] = d[i] >> e[i];
+}
+
+__attribute__((noinline)) void
+f6 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ k[i] = f[i] >> e[i];
+}
+
+__attribute__((noinline)) void
+f7 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ j[i] = d[i] << b[i];
+}
+
+__attribute__((noinline)) void
+f8 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ j[i] = d[i] >> b[i];
+}
+
+__attribute__((noinline)) void
+f9 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ k[i] = f[i] >> b[i];
+}
+
+int
+main ()
+{
+ int i;
+ for (i = 0; i < N; i++)
+ {
+ asm ("");
+ c[i] = (rand () << 1) | (rand () & 1);
+ b[i] = (i * 85) & (sizeof (TYPE1) * __CHAR_BIT__ - 1);
+ a[i] = c[i];
+ d[i] = (rand () << 1) | (rand () & 1);
+ d[i] |= (unsigned long long) c[i] << 32;
+ e[i] = (i * 85) & (sizeof (TYPE2) * __CHAR_BIT__ - 1);
+ f[i] = d[i];
+ }
+ f1 ();
+ f3 ();
+ f4 ();
+ f6 ();
+ for (i = 0; i < N; i++)
+ if (g[i] != (signed TYPE1) (a[i] << b[i])
+ || h[i] != (unsigned TYPE1) (c[i] >> b[i])
+ || j[i] != (signed TYPE2) (d[i] << e[i])
+ || k[i] != (unsigned TYPE2) (f[i] >> e[i]))
+ abort ();
+ f2 ();
+ f5 ();
+ f9 ();
+ for (i = 0; i < N; i++)
+ if (g[i] != (signed TYPE1) (a[i] >> b[i])
+ || j[i] != (signed TYPE2) (d[i] >> e[i])
+ || k[i] != (unsigned TYPE2) (f[i] >> b[i]))
+ abort ();
+ f7 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != (signed TYPE2) (d[i] << b[i]))
+ abort ();
+ f8 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != (signed TYPE2) (d[i] >> b[i]))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vshift-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-2.c
new file mode 100644
index 000000000..8f490d209
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-2.c
@@ -0,0 +1,7 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+#define TYPE1 char
+#define TYPE2 short
+
+#include "vshift-1.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vshift-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-3.c
new file mode 100644
index 000000000..367e66065
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-3.c
@@ -0,0 +1,136 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+#include <stdlib.h>
+
+#define N 64
+
+#ifndef TYPE1
+#define TYPE1 int
+#define TYPE2 long long
+#endif
+
+signed TYPE1 a[N], b, g[N];
+unsigned TYPE1 c[N], h[N];
+signed TYPE2 d[N], e, j[N];
+unsigned TYPE2 f[N], k[N];
+
+#ifndef S
+#define S(x) x
+#endif
+
+__attribute__((noinline)) void
+f1 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ g[i] = a[i] << S (b);
+}
+
+__attribute__((noinline)) void
+f2 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ g[i] = a[i] >> S (b);
+}
+
+__attribute__((noinline)) void
+f3 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ h[i] = c[i] >> S (b);
+}
+
+__attribute__((noinline)) void
+f4 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ j[i] = d[i] << S (e);
+}
+
+__attribute__((noinline)) void
+f5 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ j[i] = d[i] >> S (e);
+}
+
+__attribute__((noinline)) void
+f6 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ k[i] = f[i] >> S (e);
+}
+
+__attribute__((noinline)) void
+f7 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ j[i] = d[i] << S (b);
+}
+
+__attribute__((noinline)) void
+f8 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ j[i] = d[i] >> S (b);
+}
+
+__attribute__((noinline)) void
+f9 (void)
+{
+ int i;
+ for (i = 0; i < N; i++)
+ k[i] = f[i] >> S (b);
+}
+
+int
+main ()
+{
+ int i;
+ b = 7;
+ e = 12;
+ for (i = 0; i < N; i++)
+ {
+ asm ("");
+ c[i] = (rand () << 1) | (rand () & 1);
+ a[i] = c[i];
+ d[i] = (rand () << 1) | (rand () & 1);
+ d[i] |= (unsigned long long) c[i] << 32;
+ f[i] = d[i];
+ }
+ f1 ();
+ f3 ();
+ f4 ();
+ f6 ();
+ for (i = 0; i < N; i++)
+ if (g[i] != (signed TYPE1) (a[i] << S (b))
+ || h[i] != (unsigned TYPE1) (c[i] >> S (b))
+ || j[i] != (signed TYPE2) (d[i] << S (e))
+ || k[i] != (unsigned TYPE2) (f[i] >> S (e)))
+ abort ();
+ f2 ();
+ f5 ();
+ f9 ();
+ for (i = 0; i < N; i++)
+ if (g[i] != (signed TYPE1) (a[i] >> S (b))
+ || j[i] != (signed TYPE2) (d[i] >> S (e))
+ || k[i] != (unsigned TYPE2) (f[i] >> S (b)))
+ abort ();
+ f7 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != (signed TYPE2) (d[i] << S (b)))
+ abort ();
+ f8 ();
+ for (i = 0; i < N; i++)
+ if (j[i] != (signed TYPE2) (d[i] >> S (b)))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vshift-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-4.c
new file mode 100644
index 000000000..c43fbcc19
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-4.c
@@ -0,0 +1,6 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+#define S(x) 3
+
+#include "vshift-3.c"
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vshift-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-5.c
new file mode 100644
index 000000000..daa5f1c5c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vshift-5.c
@@ -0,0 +1,81 @@
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+extern void abort (void);
+long long a[16];
+
+__attribute__((noinline, noclone)) void
+f1 (void)
+{
+ long long a0, a1, a2, a3;
+ a0 = a[0];
+ a1 = a[1];
+ a2 = a[2];
+ a3 = a[3];
+ a0 = a0 << 2;
+ a1 = a1 << 3;
+ a2 = a2 << 4;
+ a3 = a3 << 5;
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+}
+
+__attribute__((noinline, noclone)) void
+f2 (void)
+{
+ long long a0, a1, a2, a3;
+ a0 = a[0];
+ a1 = a[1];
+ a2 = a[2];
+ a3 = a[3];
+ a0 = a0 << 2;
+ a1 = a1 << 2;
+ a2 = a2 << 2;
+ a3 = a3 << 2;
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+}
+
+__attribute__((noinline, noclone)) void
+f3 (int x)
+{
+ long long a0, a1, a2, a3;
+ a0 = a[0];
+ a1 = a[1];
+ a2 = a[2];
+ a3 = a[3];
+ a0 = a0 << x;
+ a1 = a1 << x;
+ a2 = a2 << x;
+ a3 = a3 << x;
+ a[0] = a0;
+ a[1] = a1;
+ a[2] = a2;
+ a[3] = a3;
+}
+
+int
+main ()
+{
+ a[0] = 4LL;
+ a[1] = 3LL;
+ a[2] = 2LL;
+ a[3] = 1LL;
+ f1 ();
+ if (a[0] != (4LL << 2) || a[1] != (3LL << 3)
+ || a[2] != (2LL << 4) || a[3] != (1LL << 5))
+ abort ();
+ f2 ();
+ if (a[0] != (4LL << 4) || a[1] != (3LL << 5)
+ || a[2] != (2LL << 6) || a[3] != (1LL << 7))
+ abort ();
+ f3 (3);
+ if (a[0] != (4LL << 7) || a[1] != (3LL << 8)
+ || a[2] != (2LL << 9) || a[3] != (1LL << 10))
+ abort ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/initpri1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/initpri1.c
new file mode 100644
index 000000000..555bffe73
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/initpri1.c
@@ -0,0 +1,19 @@
+/* On VxWorks, in RTP mode, constructors and destructors go in named
+ sections. The section names must include the initialization
+ priority, even for constructors and destructors with the default
+ priority. */
+
+/* The selector below excludes VxWorks AE because AE does not support
+ RTP mode. */
+/* { dg-do compile { target { *-*-vxworks* && { ! *-*-vxworksae* } } } } */
+/* { dg-options "-mrtp" } */
+/* { dg-final { scan-assembler "ctors\.00000" } } */
+/* { dg-final { scan-assembler "dtors\.00000" } } */
+
+volatile int i;
+
+void c1 () __attribute__((constructor));
+void c1 () { ++i; }
+
+void d1 () __attribute__((destructor));
+void d1 () { --i; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/initpri2.c b/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/initpri2.c
new file mode 100644
index 000000000..7f483efad
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/initpri2.c
@@ -0,0 +1,15 @@
+/* On VxWorks, in kernel mode, there is no support for .ctors/.dtors.
+ Instead, initialization is handled by munch. */
+
+/* { dg-do compile { target vxworks_kernel } } */
+/* { dg-final { scan-assembler-not "\.ctors" } } */
+/* { dg-final { scan-assembler-not "\.dtors" } } */
+
+volatile int i;
+
+void c1 () __attribute__((constructor));
+void c1 () { ++i; }
+
+void d1 () __attribute__((destructor));
+void d1 () { --i; }
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/vxworks.exp b/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/vxworks.exp
new file mode 100644
index 000000000..43189cef4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/vxworks/vxworks.exp
@@ -0,0 +1,36 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cSi\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/warn-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/warn-1.c
new file mode 100644
index 000000000..6db4ae5cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/warn-1.c
@@ -0,0 +1,16 @@
+/* The compiler used to say passing arg 0 of, which is wrong. */
+/* Radar 3069179 */
+
+/* { dg-options "-O3" } */
+
+static void foo (p)
+ int p;
+{
+}
+
+void bar (void)
+{
+ void *vp;
+
+ foo (vp); /* { dg-bogus "passing argument 1 of" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/warn-addr-cmp.c b/gcc-4.9/gcc/testsuite/gcc.dg/warn-addr-cmp.c
new file mode 100644
index 000000000..07491d1bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/warn-addr-cmp.c
@@ -0,0 +1,79 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-Waddress" } */
+/* Warning when addr convert to bool always gives known result.
+ Ada/Pascal programmers sometimes write 0-param functions without
+ (), and might as well warn on variables, too. */
+
+int func (void);
+extern int var;
+int weak_func (void) __attribute__ ((weak));
+extern int weak_var __attribute__ ((weak));
+
+int
+test_func_cmp (void)
+{
+ if (func) /* { dg-warning "the address of 'func'" } */
+ return 1;
+ if (!func) /* { dg-warning "the address of 'func'" } */
+ return 1;
+ if (&var) /* { dg-warning "the address of 'var'" } */
+ return 1;
+ if (!&var) /* { dg-warning "the address of 'var'" } */
+ return 1;
+ if (weak_func)
+ return 1;
+ if (!weak_func)
+ return 1;
+ if (&weak_var)
+ return 1;
+ if (!&weak_var)
+ return 1;
+ return 0;
+}
+
+/* Test equality with 0 on the right hand side. */
+int
+test_func_cmp_rhs_zero (void)
+{
+ if (func == 0) /* { dg-warning "the comparison will always evaluate as 'false'" } */
+ return 1;
+ if (func != 0) /* { dg-warning "the comparison will always evaluate as 'true'" } */
+ return 1;
+ if (&var == 0) /* { dg-warning "the comparison will always evaluate as 'false'" } */
+ return 1;
+ if (&var != 0) /* { dg-warning "the comparison will always evaluate as 'true'" } */
+ return 1;
+ if (weak_func == 0)
+ return 1;
+ if (weak_func != 0)
+ return 1;
+ if (&weak_var == 0)
+ return 1;
+ if (&weak_var != 0)
+ return 1;
+ return 0;
+}
+
+/* Test equality with 0 on the left hand side. */
+int
+test_func_cmp_lhs_zero (void)
+{
+ if (0 == func) /* { dg-warning "the comparison will always evaluate as 'false'" } */
+ return 1;
+ if (0 != func) /* { dg-warning "the comparison will always evaluate as 'true'" } */
+ return 1;
+ if (0 == &var) /* { dg-warning "the comparison will always evaluate as 'false'" } */
+ return 1;
+ if (0 != &var) /* { dg-warning "the comparison will always evaluate as 'true'" } */
+ return 1;
+ if (0 == weak_func)
+ return 1;
+ if (0 != weak_func)
+ return 1;
+ if (0 == &weak_var)
+ return 1;
+ if (0 != &weak_var)
+ return 1;
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/warn-nsstring.c b/gcc-4.9/gcc/testsuite/gcc.dg/warn-nsstring.c
new file mode 100644
index 000000000..600ff34d9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/warn-nsstring.c
@@ -0,0 +1,7 @@
+/* Check that the NSString format extension is rejected in c. */
+/* { dg-do compile } */
+/* { dg-options "-Wformat" } */
+extern void NSLog (void *fmt, ...) __attribute__((format(__NSString__, 1, 2))); /* { dg-warning "is only allowed in Objective-C dialects" } */
+extern void NSLog1 (void *fmt, ...) __attribute__((format(NSString, 1, 2))); /* { dg-warning "is only allowed in Objective-C dialects" } */
+
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wcaselabel-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wcaselabel-1.c
new file mode 100644
index 000000000..6f673dfaf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wcaselabel-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+
+int foo(int x)
+{
+ switch(x)
+ {
+
+ case 0 % 0: /* { dg-error "case label does not reduce to an integer constant" } */
+ return 1;
+ default:
+ return 2;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wchar_t-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wchar_t-1.c
new file mode 100644
index 000000000..8e22ece3c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wchar_t-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target wchar } } */
+/* { dg-options "-Wall" } */
+
+/* Compile with -Wall to get a warning if built-in and system wchar_t don't
+ match. */
+
+#define _STDDEF_H
+#include <wchar.h>
+
+__WCHAR_TYPE__ __wc_t__;
+wchar_t *wc_t_p;
+
+void
+wct (void)
+{
+ wc_t_p = &__wc_t__;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wchar_t-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/wchar_t-2.c
new file mode 100644
index 000000000..95ddca0e5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wchar_t-2.c
@@ -0,0 +1,6 @@
+/* { dg-options "-fshort-wchar" } */
+/* Check that "-fshort-wchar" makes wchar_t the same size as "unsigned
+ short". */
+
+extern int i[sizeof (L'a')];
+int i[sizeof (unsigned short)];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wdate-time.c b/gcc-4.9/gcc/testsuite/gcc.dg/wdate-time.c
new file mode 100644
index 000000000..0ff27b4cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wdate-time.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Wdate-time" } */
+
+const char time[] = __TIME__; /* { dg-warning "might prevent reproducible builds" } */
+const char date[] = __DATE__; /* { dg-warning "might prevent reproducible builds" } */
+const char timestamp[] = __TIMESTAMP__; /* { dg-warning "might prevent reproducible builds" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/typeof-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/typeof-2.c
new file mode 100644
index 000000000..45a12ebf9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/typeof-2.c
@@ -0,0 +1,51 @@
+/* Test typeof with __asm redirection. */
+/* { dg-do compile } */
+/* -mlongcall will cause us to place &baz3 in the CTR register. */
+/* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2" } */
+/* Using -mshort-calls avoids loading the function addresses in
+ registers and thus getting the counts wrong. */
+/* { dg-additional-options "-mshort-calls" { target epiphany-*-* } } */
+
+extern int foo1 (int x) __asm ("baz1");
+int bar1 (int x) { return x; }
+extern __typeof (bar1) foo1 __attribute ((weak, alias ("bar1")));
+
+extern int foo2 (int x) __attribute__ ((const));
+extern __typeof (foo2) foo2 __asm ("baz2");
+int bar2 (int x)
+{
+ return foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x);
+}
+
+extern int foo3 (int x);
+extern __typeof (foo3) foo3 __asm ("baz3");
+int bar3 (int x)
+{
+ return foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x);
+}
+
+// { dg-final { scan-assembler-not "foo1" } }
+// { dg-final { scan-assembler "baz1" } }
+// { dg-final { scan-assembler-not "foo2" } }
+// { dg-final { scan-assembler "baz2" } }
+// { dg-final { scan-assembler-not "baz2.*baz2.*baz2.*baz2.*baz2.*baz2" } }
+// { dg-final { scan-assembler-not "foo3" } }
+// SH targets put the function address into a constant pool and / or register,
+// so it does not appear repeated (as much as expected) in the assembler.
+// { dg-final { global target_triplet } }
+// { dg-final { if [string match sh-*-* $target_triplet ] {return} } }
+// { dg-final { if [string match {sh[elb1-9]*-*-*} $target_triplet ] {return} } }
+// Likewise for S/390 targets
+// { dg-final { if [string match s390*-*-* $target_triplet ] {return} } }
+// Likewise for CRIS targets.
+// { dg-final { if [string match cris-*-* $target_triplet ] {return} } }
+// { dg-final { if [string match crisv32-*-* $target_triplet ] {return} } }
+// Likewise for m68k targets.
+// { dg-final { if [string match fido-*-* $target_triplet ] {return} } }
+// { dg-final { if [string match m68k-*-* $target_triplet ] {return} } }
+// Likewise for moxie targets.
+// { dg-final { if [string match moxie-*-* $target_triplet ] {return} } }
+// { dg-final { scan-assembler "baz3.*baz3.*baz3.*baz3.*baz3.*baz3" } }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-1.c
new file mode 100644
index 000000000..14e9de7ac
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-1.c
@@ -0,0 +1,52 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-fno-common" } */
+/* { dg-skip-if "" { *-*-mingw* } { "*" } { "" } } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?b" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?c" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?d" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?e" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?g" } } */
+/* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?i" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?j" } } */
+
+#pragma weak a
+int a;
+
+int b;
+#pragma weak b
+
+#pragma weak c
+extern int c;
+int c;
+
+extern int d;
+#pragma weak d
+int d;
+
+#pragma weak e
+void e(void) { }
+
+#if 0
+/* This permutation is illegal. */
+void f(void) { }
+#pragma weak f
+#endif
+
+#pragma weak g
+int g = 1;
+
+#if 0
+/* This permutation is illegal. */
+int h = 1;
+#pragma weak h
+#endif
+
+#pragma weak i
+extern int i;
+
+#pragma weak j
+extern int j;
+int use_j() { return j; }
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-10.c
new file mode 100644
index 000000000..f39fbc4bb
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-10.c
@@ -0,0 +1,13 @@
+/* Test for #pragma weak where the weak alias symbol isn't declared,
+ although the symbol it is an alias for is defined in the
+ translation unit. Bug 7544. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+/* { dg-options "-fno-common" } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?bar1" } } */
+
+#pragma weak bar1 = foo1
+void foo1 (void) {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-11.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-11.c
new file mode 100644
index 000000000..c20135a3a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-11.c
@@ -0,0 +1,10 @@
+/* PR 19031 */
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+/* { dg-options "-funit-at-a-time" } */
+
+/* { dg-final { scan-assembler "xyzzy" } } */
+
+static const int local = 1;
+#pragma weak xyzzy = local
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-12.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-12.c
new file mode 100644
index 000000000..72cc1445e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-12.c
@@ -0,0 +1,17 @@
+/* Test for #pragma weak with declaration not at file scope. */
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "" } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?foo" } } */
+
+#pragma weak foo
+
+int
+main (void)
+{
+ extern int foo (void);
+ if (&foo)
+ return foo ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-13.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-13.c
new file mode 100644
index 000000000..15106a534
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-13.c
@@ -0,0 +1,13 @@
+/* Test for weak aliases with multiple declarations. Sun assembler
+ rejects multiple weak alias definitions in the output. */
+/* { dg-do assemble } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+/* { dg-options "" } */
+
+#pragma weak foo = _foo
+
+extern int foo;
+extern int foo;
+
+int _foo = 4;
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-14.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-14.c
new file mode 100644
index 000000000..33c7933f1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-14.c
@@ -0,0 +1,34 @@
+// { dg-do run }
+// { dg-require-weak "" }
+// { dg-require-alias "" }
+// { dg-options "-O2 -fno-common" }
+
+// Copyright 2005 Free Software Foundation, Inc.
+// Contributed by Alexandre Oliva <aoliva@redhat.com>
+
+// PR middle-end/24295
+
+// The unit-at-a-time call graph code used to fail to emit variables
+// without external linkage that were only used indirectly, through
+// aliases. We might then get linker failures because the static
+// variable was not defined, or run-time errors because the weak alias
+// ended up pointing somewhere random.
+
+#include <stdlib.h>
+
+static unsigned long lv1 = 0xdeadbeefUL;
+#pragma weak Av1a = lv1
+extern unsigned long Av1a;
+
+static unsigned long lf1(void) { return 0x510bea7UL; }
+#pragma weak Af1a = lf1
+extern unsigned long Af1a(void);
+
+int main (void) {
+ if (! &Av1a
+ || ! &Af1a
+ || Av1a != 0xdeadbeefUL
+ || Af1a() != 0x510bea7UL)
+ abort ();
+ exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-15.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-15.c
new file mode 100644
index 000000000..34b089bda
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-15.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-fno-common" } */
+/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */
+/* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?b" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?c" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?d" } } */
+
+#pragma weak a
+extern char a[];
+
+char *user_a(void)
+{
+ return a+1;
+}
+
+int x;
+int extern inline b(int y)
+{
+ return x+y;
+}
+
+extern int b(int y);
+
+int user_b(int z)
+{
+ return b(z);
+}
+
+#pragma weak c
+extern int c;
+
+int *user_c = &c;
+
+#pragma weak d
+extern char d[];
+
+char *user_d = &d[1];
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-16.c
new file mode 100644
index 000000000..d557a6e45
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-16.c
@@ -0,0 +1,22 @@
+/* From PR37280. */
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-fno-common -Os" } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_index" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_table" } } */
+/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */
+
+extern int kallsyms_token_index[] __attribute__((weak));
+extern int kallsyms_token_table[] __attribute__((weak));
+void kallsyms_expand_symbol(int *result)
+{
+ int len = *result;
+ int *tptr;
+ while(len) {
+ tptr = &kallsyms_token_table[ kallsyms_token_index[*result] ];
+ len--;
+ while (*tptr) tptr++;
+ *tptr = 1;
+ }
+ *result = 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-2.c
new file mode 100644
index 000000000..b328c3c08
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-2.c
@@ -0,0 +1,48 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-fno-common" } */
+/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1c" } } */
+/* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?ffoo1d" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1e" } } */
+
+/* test function addresses with #pragma weak */
+
+#pragma weak ffoo1a
+extern void * ffoo1a (void);
+void * foo1a (void)
+{
+ return (void *)ffoo1a;
+}
+
+extern void * ffoo1b (void);
+#pragma weak ffoo1b
+void * foo1b (void)
+{
+ return (void *)ffoo1b;
+}
+
+extern void * ffoo1c (void);
+void * foo1c (void)
+{
+ return (void *)ffoo1c;
+}
+#pragma weak ffoo1c
+
+
+int ffoo1d (void);
+#pragma weak ffoo1d
+
+
+extern void * ffoo1e (void);
+#pragma weak ffoo1e
+void * foo1e (void)
+{
+ if (ffoo1e)
+ ffoo1e ();
+ return 0;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-3.c
new file mode 100644
index 000000000..ca6e0b620
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-3.c
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-require-weak "" } */
+/* { dg-options "-fno-common -Waddress" } */
+/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1c" } } */
+/* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?ffoo1d" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1e" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1f" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1g" } } */
+
+/* test function addresses with __attribute__((weak)) */
+
+extern void * ffoo1a (void) __attribute__((weak));
+extern void * ffoo1a (void);
+void * foo1a (void)
+{
+ return (void *)ffoo1a;
+}
+
+
+extern void * ffoo1b (void);
+extern void * ffoo1b (void) __attribute__((weak));
+void * foo1b (void)
+{
+ return (void *)ffoo1b;
+}
+
+
+extern void * ffoo1c (void);
+void * foo1c (void)
+{
+ return (void *)ffoo1c;
+}
+extern void * ffoo1c (void) __attribute__((weak));
+
+
+int ffoo1d (void);
+int ffoo1d (void) __attribute__((weak));
+
+
+extern void * ffoo1e (void);
+extern void * ffoo1e (void) __attribute__((weak));
+void * foo1e (void)
+{
+ if (ffoo1e)
+ ffoo1e ();
+ return 0;
+}
+
+
+extern void * ffoo1f (void);
+void * foo1f (void)
+{
+ if (ffoo1f) /* { dg-warning "" } */
+ ffoo1f ();
+ return 0;
+}
+void * ffoox1f (void) { return (void *)0; }
+extern void * ffoo1f (void) __attribute__((weak, alias ("ffoox1f")));
+
+
+extern void * ffoo1g (void);
+void * ffoox1g (void) { return (void *)0; }
+extern void * ffoo1g (void) __attribute__((weak, alias ("ffoox1g")));
+void * foo1g (void)
+{
+ if (ffoo1g)
+ ffoo1g ();
+ return 0;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-4.c
new file mode 100644
index 000000000..a84f58083
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-4.c
@@ -0,0 +1,106 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-fno-common" } */
+/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1c" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1d" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1e" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1f" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1g" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1h" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1i" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1j" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1k" } } */
+
+/* test variable addresses with #pragma weak */
+
+#pragma weak vfoo1a
+extern int vfoo1a;
+void * foo1a (void)
+{
+ return (void *)&vfoo1a;
+}
+
+
+extern int vfoo1b;
+#pragma weak vfoo1b
+void * foo1b (void)
+{
+ return (void *)&vfoo1b;
+}
+
+
+extern int vfoo1c;
+void * foo1c (void)
+{
+ return (void *)&vfoo1c;
+}
+#pragma weak vfoo1c
+
+
+#pragma weak vfoo1d
+int vfoo1d;
+void * foo1d (void)
+{
+ return (void *)&vfoo1d;
+}
+
+
+int vfoo1e;
+#pragma weak vfoo1e
+void * foo1e (void)
+{
+ return (void *)&vfoo1e;
+}
+
+
+int vfoo1f;
+void * foo1f (void)
+{
+ return (void *)&vfoo1f;
+}
+#pragma weak vfoo1f
+
+
+extern int vfoo1g;
+void * foo1g (void)
+{
+ return (void *)&vfoo1g;
+}
+#pragma weak vfoo1g
+int vfoo1g;
+
+
+extern int vfoo1h;
+void * foo1h (void)
+{
+ return (void *)&vfoo1h;
+}
+int vfoo1h;
+#pragma weak vfoo1h
+
+
+int vfoo1i;
+extern int vfoo1i;
+void * foo1i (void)
+{
+ return (void *)&vfoo1i;
+}
+#pragma weak vfoo1i
+
+
+extern int vfoo1j;
+int vfoo1j;
+void * foo1j (void)
+{
+ return (void *)&vfoo1j;
+}
+#pragma weak vfoo1j
+
+
+#pragma weak vfoo1k
+int vfoo1k = 1;
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-5.c
new file mode 100644
index 000000000..714c9dca0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-5.c
@@ -0,0 +1,110 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+/* { dg-options "-fno-common" } */
+/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1c" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1d" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1e" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1f" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1g" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1h" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1i" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1j" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1k" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1l" } } */
+
+/* test variable addresses with __attribute__ ((weak)) */
+
+extern int vfoo1a __attribute__((weak));
+extern int vfoo1a;
+void * foo1a (void)
+{
+ return (void *)&vfoo1a;
+}
+
+
+extern int vfoo1b;
+extern int vfoo1b __attribute__((weak));
+void * foo1b (void)
+{
+ return (void *)&vfoo1b;
+}
+
+
+extern int vfoo1c;
+void * foo1c (void)
+{
+ return (void *)&vfoo1c;
+}
+extern int vfoo1c __attribute__((weak));
+
+
+extern int vfoo1d __attribute__((weak));
+int vfoo1d;
+void * foo1d (void)
+{
+ return (void *)&vfoo1d;
+}
+
+
+int vfoo1e;
+extern int vfoo1e __attribute__((weak));
+void * foo1e (void)
+{
+ return (void *)&vfoo1e;
+}
+
+
+int vfoo1f;
+void * foo1f (void)
+{
+ return (void *)&vfoo1f;
+}
+extern int vfoo1f __attribute__((weak));
+
+
+extern int vfoo1g;
+void * foo1g (void)
+{
+ return (void *)&vfoo1g;
+}
+int vfoo1g __attribute__((weak));
+
+
+extern int vfoo1h __attribute__((weak));
+void * foo1h (void)
+{
+ return (void *)&vfoo1h;
+}
+extern int vfoo1h __attribute__((weak));
+int vfoo1h;
+
+
+extern int vfoo1i __attribute__((weak));
+void * foo1i (void)
+{
+ return (void *)&vfoo1i;
+}
+extern int vfoo1i __attribute__((weak));
+extern int vfoo1i;
+
+
+extern int vfoo1j __attribute__((weak));
+void * foo1j (void)
+{
+ return (void *)&vfoo1j;
+}
+extern int vfoo1j;
+extern int vfoo1j __attribute__((weak));
+
+
+extern int vfoo1k __attribute__((weak));
+int vfoo1k = 1;
+
+
+int vfoox1l = 1;
+extern int vfoo1l __attribute__((weak, alias ("vfoox1l")));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-6.c
new file mode 100644
index 000000000..6fa0d66ff
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-6.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+
+extern void * foo (void);
+void * foo (void) { return (void *)foo; }
+/* { dg-error "function pointer" "pointer conversion" { target *-*-* } 5 } */
+#pragma weak foo
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-7.c
new file mode 100644
index 000000000..07c03bc97
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-7.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+
+extern void * foo (void);
+void * foo (void) { return (void *)foo; }
+/* { dg-error "function pointer" "pointer conversion" { target *-*-* } 5 } */
+extern void * foo (void) __attribute__((weak));
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-8.c
new file mode 100644
index 000000000..3de2e1e2f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-8.c
@@ -0,0 +1,8 @@
+/* { dg-do assemble } */
+/* { dg-require-weak "" } */
+
+__attribute__ ((weak)) int i;
+
+int f() {
+ return i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-9.c
new file mode 100644
index 000000000..abbd0201c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak-9.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-require-alias "" } */
+/* { dg-options "-fno-common" } */
+
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f1" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f2" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f3" } } */
+/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?f4" } } */
+
+void notf1() { }
+void notf2() { }
+void notf3() { }
+void notf4() { }
+
+void f1() __attribute__((weak, alias("notf1")));
+void f2() __attribute__((alias("notf2"), weak));
+
+#pragma weak f3=notf3
+void f3();
+
+void f4();
+#pragma weak f4=notf4
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak.exp b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak.exp
new file mode 100644
index 000000000..8d0eaaab6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/weak/weak.exp
@@ -0,0 +1,31 @@
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+dg-finish
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/webizer.c b/gcc-4.9/gcc/testsuite/gcc.dg/webizer.c
new file mode 100644
index 000000000..4f03037c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/webizer.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -funroll-loops" } */
+typedef struct rowbox {
+ int startx ;
+ int endx ;
+ int endx1 ;
+ int startx2 ;
+ int ypos ;
+ int desiredL ;
+} ROWBOX ;
+ROWBOX rowArray1[3] ;
+ROWBOX *rowArray = rowArray1;
+
+int numRows = 2;
+
+int row = 1;
+int block = 0;
+double ckt_size_factor ;
+
+__attribute__ ((noinline))
+configure2()
+{
+ block = 0 ;
+ for( row = 1 ; row <= numRows ; row++ ) {
+ block++ ;
+ if( rowArray[row].endx1 > 0 ) {
+ block++ ;
+ }
+ }
+}
+
+main()
+{
+ configure2();
+ __builtin_exit (0);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/winline-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/winline-1.c
new file mode 100644
index 000000000..ac2ae8242
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/winline-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+
+void q(void);
+inline int t(void)
+{
+ int ret;
+ q();
+ ret = t(); /* We define sane semantics for inline keyword on recursive
+ functions, so do not warn here. */
+ q();
+ return ret;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/winline-10.c b/gcc-4.9/gcc/testsuite/gcc.dg/winline-10.c
new file mode 100644
index 000000000..2106253fc
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/winline-10.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Winline" } */
+
+struct s { int a; };
+
+inline void f (x) /* { dg-warning "inlining .* mismatched arg" "" } */
+ int x;
+{
+ asm ("");
+}
+
+void g (struct s x)
+{
+ f (x); /* { dg-warning "called from here" "" } */
+}
+
+void f (int x); /* { dg-warning "follows non-prototype definition" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/winline-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/winline-2.c
new file mode 100644
index 000000000..584c68fdd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/winline-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+
+inline int q(void); /* { dg-warning "body not available" "" } */
+inline int t(void)
+{
+ return q(); /* { dg-warning "called from here" "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/winline-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/winline-3.c
new file mode 100644
index 000000000..fc12f573a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/winline-3.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2 --param max-inline-insns-single=1 --param inline-min-speedup=100" } */
+
+void big (void);
+inline int q(void) /* { dg-warning "max-inline-insns-single" "" } */
+{
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+}
+inline int t (void)
+{
+ return q (); /* { dg-warning "called from here" "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/winline-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/winline-5.c
new file mode 100644
index 000000000..a42ae943f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/winline-5.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2 --param inline-unit-growth=0 --param large-unit-insns=0" } */
+
+void big (void);
+inline int q(void) /* { dg-warning "inline-unit-growth" } */
+{
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+}
+int t (void)
+{
+ return q (); /* { dg-warning "called from here" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/winline-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/winline-6.c
new file mode 100644
index 000000000..4e22ce144
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/winline-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2 --param large-function-growth=0 --param large-function-insns=1" } */
+
+void big (void);
+inline int q(void) /* { dg-warning "large-function-growth" } */
+{
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+}
+inline int t (void)
+{
+ return q () + 1; /* { dg-warning "called from here" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/winline-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/winline-7.c
new file mode 100644
index 000000000..19262da7c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/winline-7.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+
+extern void *alloca (__SIZE_TYPE__);
+
+void big (void);
+inline void *q (void) /* { dg-warning "(function not inlinable|alloca)" } */
+{
+ return alloca (10);
+}
+inline void *t (void)
+{
+ return q (); /* { dg-warning "called from here" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/winline-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/winline-9.c
new file mode 100644
index 000000000..fddf5c68f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/winline-9.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Winline --param large-stack-frame=10 --param large-stack-frame-growth=2" } */
+
+int a,b;
+void test(char *);
+static inline
+int aa (void)
+{
+ char t[10];
+ test(t);
+}
+static inline
+int bb (void) /* { dg-warning "large-stack-frame" "" } */
+{
+ char t[100];
+ test(t);
+}
+
+t()
+{
+ if (a)
+ aa();
+ if (b)
+ bb(); /* { dg-warning "called from here" "" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wint_t-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wint_t-1.c
new file mode 100644
index 000000000..0574fb9a4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wint_t-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target wchar } } */
+/* { dg-options "-Wall" } */
+
+/* Compile with -Wall to get a warning if built-in and system wint_t don't
+ match. */
+
+#define _STDDEF_H
+#include <wchar.h>
+
+__WINT_TYPE__ __wi_t__;
+wint_t *wi_t_p;
+
+void
+wit (void)
+{
+ wi_t_p = &__wi_t__;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wmul-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wmul-1.c
new file mode 100644
index 000000000..3e762f4c1
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wmul-1.c
@@ -0,0 +1,19 @@
+/* Not to fuse widening multiply with accumulate if the multiply has more than
+ one uses.
+ Note that for targets where pointer and int are of the same size or
+ widening multiply-and-accumulate is not available, this test just passes. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-widening_mul" } */
+
+typedef int ArrT [10][10];
+
+void
+foo (ArrT Arr, int Idx)
+{
+ Arr[Idx][Idx] = 1;
+ Arr[Idx + 10][Idx] = 2;
+}
+
+/* { dg-final { scan-tree-dump-not "WIDEN_MULT_PLUS_EXPR" "widening_mul" } } */
+/* { dg-final { cleanup-tree-dump "widening_mul" } } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-aggr-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-aggr-init-1.c
new file mode 100644
index 000000000..f17531e8f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-aggr-init-1.c
@@ -0,0 +1,48 @@
+/* Test for -Wtraditional warnings on automatic aggregate initialization.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+struct foo
+{
+ int i;
+ long l;
+};
+
+struct foo f0 = { 0, 0 };
+static struct foo f1 = { 0, 0 };
+
+void
+testfunc1 ()
+{
+ struct foo f3 = { 0, 0 }; /* { dg-warning "traditional C rejects automatic" "automatic aggregate initialization" } */
+ static struct foo f4 = { 0, 0 };
+
+ f3 = f4;
+
+ __extension__ ({
+ struct foo f5 = { 0, 0 }; /* { dg-bogus "traditional C rejects automatic" "__extension__ disables warnings" } */
+ f5.i = 0;
+ });
+
+ {
+ struct foo f6 = { 0, 0 }; /* { dg-warning "traditional C rejects automatic" "__extension__ reenables warnings" } */
+ f6.i = 0;
+ }
+}
+
+# 35 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+struct foo f7 = { 0, 0 };
+static struct foo f8 = { 0, 0 };
+
+void
+testfunc2 ()
+{
+ struct foo f9 = { 0, 0 };
+ static struct foo f10 = { 0, 0 };
+
+ f9 = f10;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-conversion-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-conversion-1.c
new file mode 100644
index 000000000..72094c218
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-conversion-1.c
@@ -0,0 +1,66 @@
+/* Test for -Wtraditional warnings on conversions by prototypes.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 4/09/2001. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+extern void foo_i (int);
+extern void foo_f (float);
+extern void foo_ld (long double);
+extern void foo_cd (__complex__ double);
+
+extern int i;
+extern float f;
+extern long double ld;
+extern __complex__ double cd;
+
+void
+testfunc1 ()
+{
+ foo_i (i);
+ foo_i (f); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
+ foo_i (ld); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
+ foo_i (cd); /* { dg-warning "as integer rather than complex" "prototype conversion warning" } */
+
+ foo_f (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
+ foo_f (f); /* { dg-warning "as 'float' rather than 'double'" "prototype conversion warning" } */
+ foo_f (ld); /* { dg-warning "as 'float' rather than 'double'" "prototype conversion warning" } */
+ foo_f (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */
+
+ foo_ld (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
+ foo_ld (f); /* { dg-warning "as 'float' rather than 'double'" "small double" { target { "avr-*-*" } } } */
+ foo_ld (ld);/* { dg-warning "as 'float' rather than 'double'" "small long double" { target { "avr-*-*" } } } */
+ foo_ld (cd);/* { dg-warning "as floating rather than complex" "prototype conversion warning" } */
+
+ foo_cd (i); /* { dg-warning "as complex rather than integer" "prototype conversion warning" } */
+ foo_cd (f); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */
+ foo_cd (ld); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */
+ foo_cd (cd);
+}
+
+# 54 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+void
+testfunc2 ()
+{
+ foo_i (i);
+ foo_i (f);
+ foo_i (ld);
+ foo_i (cd);
+
+ foo_f (i);
+ foo_f (f);
+ foo_f (ld);
+ foo_f (cd);
+
+ foo_ld (i);
+ foo_ld (f);
+ foo_ld (ld);
+ foo_ld (cd);
+
+ foo_cd (i);
+ foo_cd (f);
+ foo_cd (ld);
+ foo_cd (cd);
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-escape-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-escape-1.c
new file mode 100644
index 000000000..7f48de5e8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-escape-1.c
@@ -0,0 +1,22 @@
+/* Test for -Wtraditional warnings on escape characters.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+void
+testfunc ()
+{
+ char c;
+
+ c = '\a'; /* { dg-warning "the meaning of" "escaped character warning " } */
+ c = '\x2'; /* { dg-warning "the meaning of" "escaped character warning " } */
+ c = '\n';
+
+# 17 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ c = '\a';
+ c = '\x2';
+ c = '\n';
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-func-def-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-func-def-1.c
new file mode 100644
index 000000000..049e05b85
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-func-def-1.c
@@ -0,0 +1,204 @@
+/* Test for -Wtraditional warnings on ISO C function definitions.
+ Note, gcc should omit these warnings in system header files.
+ Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 6/30/2002. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+/* Test some simple cases. */
+
+void f_void1 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+void f_void2 ()
+{
+ return;
+}
+
+void f_int1 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+void f_int2 (f)
+ int f;
+{
+ return;
+}
+
+/* Test that we don't ever warn about nested functions. */
+
+void f_int3 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ void f3a (void) { return; }
+ void f3b () { return; }
+ void f3c (int f) { return; }
+ void f3d (f) int f; { return; }
+ void f3e (const char *f, ...) { return; }
+ return;
+}
+
+void f_int4 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ void f4a (void) { return; }
+ void f4b () { return; }
+ void f4c (int f) { return; }
+ void f4d (f) int f; { return; }
+ void f4e (const char *f, ...) { return; }
+ auto f4f (void) { return 0; }
+ return;
+}
+
+void f_int5 (f)
+ int f;
+{
+ void f5a (void) { return; }
+ void f5b () { return; }
+ void f5c (int f) { return; }
+ void f5d (f) int f; { return; }
+ void f5e (const char *f, ...) { return; }
+ return;
+}
+
+void f_int6 (f)
+ int f;
+{
+ void f6a (void) { return; }
+ void f6b () { return; }
+ void f6c (int f) { return; }
+ void f6d (f) int f; { return; }
+ void f6e (const char *f, ...) { return; }
+ auto f6f (void) { return 0; }
+ return;
+}
+
+/* Test that prototypes are silently accepted and function definitions
+ are still warned about. */
+
+extern void f_int_p1 (int);
+void f_int_p1 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+extern void f_int_p2 (int f);
+void f_int_p2 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+extern void f_int_p3 (int);
+void f_int_p3 (f)
+ int f;
+{
+ return;
+}
+
+extern void f_int_p4 (int f);
+void f_int_p4 (f)
+ int f;
+{
+ return;
+}
+
+extern void f_void_p1 ();
+void f_void_p1 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+extern void f_void_p2 (void);
+void f_void_p2 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+extern void f_blank_p1 ();
+void f_blank_p1 ()
+{
+ return;
+}
+
+extern void f_blank_p2 (void);
+void f_blank_p2 ()
+{
+ return;
+}
+
+/* Test some implicit int functions. */
+
+f_impl1()
+{
+ return 0;
+}
+
+f_impl2(void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return 0;
+}
+
+f_impl3(int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return 0;
+}
+
+/* Test stdarg functions. */
+
+f_stdarg1(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return 0;
+}
+
+void f_stdarg2(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+extern void f_stdarg3(const char *, ...);
+void f_stdarg3(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+/* Test handling function pointer parameters. */
+
+void f_fnptr1 (int f, int (*fp)(int));
+void f_fnptr1 (int f, int (*fp)(int)) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return;
+}
+
+void f_fnptr2 (int f, int (*fp)(int));
+void f_fnptr2 (f, fp)
+ int f;
+ int (*fp)(int);
+{
+ return;
+}
+
+/* Test for main. */
+
+int
+main (int argc, char **argv) /* { dg-warning "traditional C rejects ISO C style" } */
+{
+ return 0;
+}
+
+# 182 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+void fsys1 (void)
+{
+ return;
+}
+
+void fsys2 (int f)
+{
+ return;
+}
+
+void fsys3 (const char *f, ...)
+{
+ return;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-int-type-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-int-type-1.c
new file mode 100644
index 000000000..c0a600d84
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-int-type-1.c
@@ -0,0 +1,52 @@
+/* Test for -Wtraditional warnings on integer constant types.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Wtraditional" } */
+
+void
+testfunc ()
+{
+ long long i;
+
+ /* Octal and hex values shouldn't issue -Wtraditional warnings. */
+ i = 0x80000000;
+ i = 0xFFFFFFFF;
+ i = 037777777777;
+
+ i = 0x8000000000000000;
+ i = 0xFFFFFFFFFFFFFFFF;
+ i = 01777777777777777777777;
+
+ /* Nor should values outside the range of (32-bit) unsigned long but
+ inside the range of long long. [since -traditional has no long long,
+ we can pretend it worked the way it does in C99.] */
+ i = 9223372036854775807;
+
+ /* But this one should, since it doesn't fit in long (long), but
+ does fit in unsigned long (long). */
+ i = 18446744073709551615; /* { dg-warning "integer constant is so large that it is unsigned" "so large" } */
+ /* { dg-warning "this decimal constant would be unsigned in ISO C90" "ISO C90" { target *-*-* } 28 } */
+
+# 29 "sys-header.h" 3
+}
+
+void
+testfunc2( )
+{
+ long long i;
+
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ i = 0x80000000;
+ i = 0xFFFFFFFF;
+ i = 037777777777;
+
+ i = 0x8000000000000000;
+ i = 0xFFFFFFFFFFFFFFFF;
+ i = 01777777777777777777777;
+
+ i = 9223372036854775807;
+ i = 18446744073709551615;
+}
+
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-label-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-label-1.c
new file mode 100644
index 000000000..78a4d6b0a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-label-1.c
@@ -0,0 +1,52 @@
+/* Test for -Wtraditional warnings on label conflicts with identifiers.
+ Note, gcc should omit these warnings in system header files.
+ Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/24/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+enum foo1 { a };
+struct foo2 { int i; };
+union foo3 { int j; };
+int foo4;
+typedef int foo5;
+
+void
+testfunc1 (foo6)
+ int foo6;
+{
+ int foo7;
+
+ foo1:
+ foo2:
+ foo3:
+ foo4: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
+ foo5: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
+ foo6: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
+ foo7: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
+ testfunc1: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
+ a: /* { dg-warning "traditional C lacks" "label conflicts with identifier" } */
+ i:
+ j: ;
+}
+
+# 32 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+void
+testfunc2 (foo6)
+ int foo6;
+{
+ int foo7;
+
+ foo1:
+ foo2:
+ foo3:
+ foo4:
+ foo5:
+ foo6:
+ foo7:
+ testfunc2:
+ a:
+ i:
+ j: ;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-static-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-static-1.c
new file mode 100644
index 000000000..318b2f32c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-static-1.c
@@ -0,0 +1,14 @@
+/* Test for -Wtraditional warnings on static/non-static mismatches.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+static void testfunc1(void); /* { dg-message "note: previous declaration" } */
+void testfunc1() {} /* { dg-warning "non-static.*follows static" "non-static follows static" } */
+
+# 11 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+static void testfunc2(void);
+void testfunc2() {}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-strcat-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-strcat-1.c
new file mode 100644
index 000000000..730a929c5
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-strcat-1.c
@@ -0,0 +1,18 @@
+/* Test for -Wtraditional warnings on string concatenation.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+void
+testfunc ()
+{
+ const char *foo;
+
+ foo = "hello" "hello"; /* { dg-warning "concatenation" "string concatenation" } */
+
+# 15 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ foo = "hello" "hello";
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-suffix-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-suffix-1.c
new file mode 100644
index 000000000..ed0b40ecf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-suffix-1.c
@@ -0,0 +1,35 @@
+/* Test for -Wtraditional warnings on integer constant suffixes.
+ Note, gcc should omit these warnings in system header files.
+ Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/24/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+void
+testfunc ()
+{
+ int i;
+ double f;
+
+ i = 1L;
+ i = 1l;
+ i = 1U; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+ i = 1u; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+ f = 1.0;
+ f = 1.0F; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+ f = 1.0f; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+ f = 1.0L; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+ f = 1.0l; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
+
+# 24 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ i = 1L;
+ i = 1l;
+ i = 1U;
+ i = 1u;
+ f = 1.0;
+ f = 1.0F;
+ f = 1.0f;
+ f = 1.0L;
+ f = 1.0l;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-switch-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-switch-1.c
new file mode 100644
index 000000000..f0381bc5e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-switch-1.c
@@ -0,0 +1,25 @@
+/* Test for -Wtraditional warnings on switch operands of type long.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+void
+testfunc (l)
+ long l;
+{
+ switch (l) /* { dg-warning "switch expression" "switch expression" } */
+ {
+ default:
+ break;
+ }
+
+# 17 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ switch (l)
+ {
+ default:
+ break;
+ }
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-unary-plus-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-unary-plus-1.c
new file mode 100644
index 000000000..aee892c53
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-unary-plus-1.c
@@ -0,0 +1,20 @@
+/* Test for -Wtraditional warnings on the unary plus operator.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+void
+testfunc ()
+{
+ int i;
+
+ i = +1; /* { dg-warning "unary plus operator" "unary plus operator" } */
+ i = +i; /* { dg-warning "unary plus operator" "unary plus operator" } */
+
+# 16 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ i = +1;
+ i = +i;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-1.c
new file mode 100644
index 000000000..b6a814d7a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-1.c
@@ -0,0 +1,25 @@
+/* Test for -Wtraditional warnings on union initialization.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+union foo
+{
+ int i;
+ long l;
+};
+
+void
+testfunc ()
+{
+ /* Note we only warn for nonzero initializers. */
+ static union foo f1 = { 0 };
+ static union foo f2 = { 1 }; /* { dg-warning "traditional C rejects initialization of unions" "initialization of unions" } */
+
+# 21 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ static union foo f3 = { 0 };
+ static union foo f4 = { 1 };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-2.c
new file mode 100644
index 000000000..bea26f1bf
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-2.c
@@ -0,0 +1,45 @@
+/* Test for -Wtraditional warnings on union initialization.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 9/11/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+union foo1
+{
+ float f;
+ int i;
+ long l;
+};
+
+union foo2
+{
+ int i;
+ float f;
+ long l;
+};
+
+void
+testfunc ()
+{
+ /* Note we only warn for nonzero initializers. */
+ static union foo1 f1 = {0};
+ static union foo2 f2 = {0};
+ static union foo1 f3 = {1}; /* { dg-warning "traditional C rejects initialization of unions" "initialization of unions" } */
+ static union foo2 f4 = {1}; /* { dg-warning "traditional C rejects initialization of unions" "initialization of unions" } */
+ static union foo1 f5 = {0.0};
+ static union foo2 f6 = {0.0};
+ static union foo1 f7 = {1.0}; /* { dg-warning "traditional C rejects initialization of unions" "initialization of unions" } */
+ static union foo2 f8 = {1.0}; /* { dg-warning "traditional C rejects initialization of unions" "initialization of unions" } */
+
+# 35 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ static union foo1 b1 = {0};
+ static union foo2 b2 = {0};
+ static union foo1 b3 = {1};
+ static union foo2 b4 = {1};
+ static union foo1 b5 = {0.0};
+ static union foo2 b6 = {0.0};
+ static union foo1 b7 = {1.0};
+ static union foo2 b8 = {1.0};
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-3.c
new file mode 100644
index 000000000..407554a9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtr-union-init-3.c
@@ -0,0 +1,64 @@
+/* Test for -Wtraditional warnings on union initialization.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 9/11/2000. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+struct bar
+{
+ int i;
+ long j;
+};
+
+union foo
+{
+ struct bar b;
+ int i;
+ long l;
+};
+
+union foo2
+{
+ int i;
+ long l;
+};
+
+struct baz
+{
+ int a;
+ double b;
+ union foo c;
+};
+
+struct baz2
+{
+ int a;
+ double b;
+ union foo2 c;
+};
+
+void
+testfunc ()
+{
+ /* Note we only warn for nonzero initializers. Xfail on substructures. */
+ static union foo f1 = {{0,0}}; /* { dg-bogus "traditional C rejects initialization of unions" "initialization of unions" { xfail *-*-* } } */
+ static union foo f2 = {{1,1}}; /* { dg-warning "traditional C rejects initialization of unions" "initialization of unions" } */
+
+ static struct baz f3 = { 1, 2, {{0,0}} }; /* { dg-bogus "traditional C rejects initialization of unions" "initialization of unions" { xfail *-*-* } } */
+ static struct baz f4 = { 1, 2, {{1,1}} }; /* { dg-warning "traditional C rejects initialization of unions" "initialization of unions" } */
+
+ static struct baz2 f5 = { 1, 2, {0} };
+ static struct baz2 f6 = { 1, 2, {1} }; /* { dg-warning "traditional C rejects initialization of unions" "initialization of unions" } */
+
+# 54 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+ static union foo b1 = {{0,0}};
+ static union foo b2 = {{1,1}};
+
+ static struct baz b3 = { 1, 2, {{0,0}} };
+ static struct baz b4 = { 1, 2, {{1,1}} };
+
+ static struct baz2 b5 = { 1, 2, {0} };
+ static struct baz2 b6 = { 1, 2, {1} };
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wtypequal.c b/gcc-4.9/gcc/testsuite/gcc.dg/wtypequal.c
new file mode 100644
index 000000000..9a7189929
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wtypequal.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+
+int *__restrict *p;
+void f(void)
+{
+ __typeof(*p) *q = p; /* { dg-bogus "discards qualifiers" } */
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wvla-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-1.c
new file mode 100644
index 000000000..c8f21078b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -Wvla" } */
+
+extern void
+func (int i, int array[i]); /* { dg-warning "variable length array 'array' is used" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wvla-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-2.c
new file mode 100644
index 000000000..d811a112f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-2.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -Wvla" } */
+
+extern void
+func (int i, int array[i]); /* { dg-warning "variable length array 'array' is used" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wvla-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-3.c
new file mode 100644
index 000000000..45132fa6b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-3.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -std=c89 -Wvla" } */
+
+extern void
+func (int i, int array[i]); /* { dg-error "ISO C90 forbids variable.* array 'array'" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wvla-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-4.c
new file mode 100644
index 000000000..8c15292ed
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-4.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -std=c99 -Wvla" } */
+
+extern void
+func (int i, int array[i]); /* { dg-warning "variable length array 'array' is used" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wvla-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-5.c
new file mode 100644
index 000000000..919b8dc20
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-5.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -std=c89 -Wno-vla" } */
+
+extern void
+func (int i, int array[i]);
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wvla-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-6.c
new file mode 100644
index 000000000..f21435b02
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-6.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89 -Wvla" } */
+
+extern void
+func (int i, int [i]); /* { dg-warning "variable length array is used" } */
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wvla-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-7.c
new file mode 100644
index 000000000..4c264f0d8
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/wvla-7.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic-errors -std=c89 -Wvla" } */
+
+extern void
+func (int i, int [i]); /* { dg-error "ISO C90 forbids variable" } */